From c2b8da3708a19330d95c2520f064808b0d0d5bb2 Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Fri, 27 Feb 2026 15:00:24 -0500 Subject: [PATCH] Added credits window --- build/build.js | 6 +- dist/BlueMarble-For-GreasyFork.user.css | 215 ++++++++++++------------ dist/BlueMarble-For-GreasyFork.user.js | 71 +++++++- dist/BlueMarble-Standalone.user.js | 4 +- dist/BlueMarble.user.css | 2 +- dist/BlueMarble.user.js | 4 +- docs/CREDITS.md | 3 +- docs/README.md | 4 +- package-lock.json | 4 +- package.json | 2 +- src/BlueMarble.meta.js | 2 +- src/WindowCredits.js | 99 +++++++++++ src/WindowMain.js | 11 +- src/overlay.css | 5 + 14 files changed, 305 insertions(+), 127 deletions(-) create mode 100644 src/WindowCredits.js diff --git a/build/build.js b/build/build.js index 2a95e5f..488e83b 100644 --- a/build/build.js +++ b/build/build.js @@ -87,20 +87,22 @@ const resultEsbuildJS = resultEsbuild.outputFiles.find(file => file.path.endsWit // Obfuscates the JS file let resultTerser = await terser.minify(resultEsbuildJS.text, { mangle: { - //toplevel: true, // Obfuscate top-level class/function names + // toplevel: true, // Should globally exposed variables, functions, classes, etc. be obfuscated? keep_classnames: false, // Should class names be preserved? keep_fnames: false, // Should function names be preserved? reserved: [], // List of keywords to preserve properties: { // regex: /.*/, // Yes, I am aware I should be using a RegEx. Yes, like you, I am also suprised the userscript still functions keep_quoted: true, // Should names in quotes be preserved? - reserved: [] // What properties should be preserved? + reserved: ['willReadFrequently'] // What properties should be preserved? }, }, format: { comments: 'some' // Save legal comments }, compress: { + // toplevel: true, // Should unused globally exposed variables, functions, classes, etc. be removed if unused *by Blue Marble*? + ecma: 2020, // Minimum supported ECMAScript version as release year. Note: versions before 2015 should pass in '5' dead_code: isGitHub, // Should unreachable code be removed? drop_console: isGitHub, // Should console code be removed? drop_debugger: isGitHub, // SHould debugger code be removed? diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css index 4e5b223..fe478b3 100644 --- a/dist/BlueMarble-For-GreasyFork.user.css +++ b/dist/BlueMarble-For-GreasyFork.user.css @@ -1,109 +1,3 @@ -/* src/WindowFilter.css */ -#bm-window-filter p svg { - display: inline; - height: 1em; - fill: white; -} -.bm-filter-flex { - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: center; - gap: 1em 3ch; -} -.bm-filter-color { - width: fit-content; - max-width: 35ch; - background-color: rgba(21, 48, 99, 0.9); - border-radius: 1em; - padding: 0.5em; - gap: 1ch; - transition: background-color 0.3s ease; -} -.bm-filter-color:hover, -.bm-filter-color:focus-within { - background-color: rgba(17, 40, 85, 0.9); -} -.bm-filter-container-rgb { - display: block; - border: thick double darkslategray; - width: fit-content; - height: fit-content; - padding: 1ch; -} -.bm-filter-color[data-id="-2"] .bm-filter-container-rgb { - background: - conic-gradient( - #aa0000 0%, - #aaaa00 16.6%, - #00aa00 33.3%, - #00aaaa 50%, - #0000aa 66.6%, - #aa00aa 83.3%, - #aa0000 100%); -} -.bm-filter-color[data-id="-1"] .bm-filter-container-rgb { - background: url('data:image/svg+xml;utf8,') repeat; - background-color: transparent !important; -} -.bm-filter-color[data-id="-1"] .bm-filter-container-rgb svg { - fill: white !important; -} -.bm-filter-color[data-id="0"] .bm-filter-container-rgb { - background-color: transparent !important; -} -.bm-filter-container-rgb button { - padding: 0.75em 0.5ch; -} -.bm-filter-container-rgb svg { - width: 4ch; -} -.bm-filter-color > .bm-flex-between { - flex-direction: column; - align-items: flex-start; - gap: 0; -} -.bm-filter-color small { - font-size: 0.75em; -} -#bm-window-filter .bm-filter-color.bm-color-hide { - display: none; -} - -/* src/WindowMain.css */ -#bm-window-main { - max-width: 300px; -} - -/* src/WindowWizard.css */ -#bm-wizard-tlist { - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: flex-start; -} -#bm-wizard-tlist > .bm-container { - width: 100%; - justify-content: flex-start; - background-color: rgba(21, 48, 99, 0.9); - border-radius: 1em; - padding: 0.5em; - transition: background-color 0.3s ease; -} -#bm-wizard-tlist > .bm-container:hover, -#bm-wizard-tlist > .bm-container:focus-within { - background-color: rgba(17, 40, 85, 0.9); -} -#bm-wizard-tlist .bm-wizard-template-container-image { - height: 100%; - font-size: xxx-large; -} -#bm-wizard-tlist .bm-wizard-template-container-flavor { - flex-direction: column; - align-items: flex-start; - gap: 0; -} - /* src/confettiManager.css */ div:has(> confetti-piece) { position: absolute; @@ -344,6 +238,9 @@ input[type=file] { height: 5.25em; width: 100%; } +.bm-window a:not(:has(*)) { + text-decoration: underline; +} .bm-window small { font-size: x-small; color: lightgray; @@ -371,4 +268,110 @@ input[type=file] { gap: 0.5ch; } +/* src/WindowFilter.css */ +#bm-window-filter p svg { + display: inline; + height: 1em; + fill: white; +} +.bm-filter-flex { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: center; + gap: 1em 3ch; +} +.bm-filter-color { + width: fit-content; + max-width: 35ch; + background-color: rgba(21, 48, 99, 0.9); + border-radius: 1em; + padding: 0.5em; + gap: 1ch; + transition: background-color 0.3s ease; +} +.bm-filter-color:hover, +.bm-filter-color:focus-within { + background-color: rgba(17, 40, 85, 0.9); +} +.bm-filter-container-rgb { + display: block; + border: thick double darkslategray; + width: fit-content; + height: fit-content; + padding: 1ch; +} +.bm-filter-color[data-id="-2"] .bm-filter-container-rgb { + background: + conic-gradient( + #aa0000 0%, + #aaaa00 16.6%, + #00aa00 33.3%, + #00aaaa 50%, + #0000aa 66.6%, + #aa00aa 83.3%, + #aa0000 100%); +} +.bm-filter-color[data-id="-1"] .bm-filter-container-rgb { + background: url('data:image/svg+xml;utf8,') repeat; + background-color: transparent !important; +} +.bm-filter-color[data-id="-1"] .bm-filter-container-rgb svg { + fill: white !important; +} +.bm-filter-color[data-id="0"] .bm-filter-container-rgb { + background-color: transparent !important; +} +#bm-window-filter .bm-filter-container-rgb button { + padding: 0.75em 0.5ch; +} +.bm-filter-container-rgb svg { + width: 4ch; +} +.bm-filter-color > .bm-flex-between { + flex-direction: column; + align-items: flex-start; + gap: 0; +} +.bm-filter-color small { + font-size: 0.75em; +} +#bm-window-filter .bm-filter-color.bm-color-hide { + display: none; +} + +/* src/WindowMain.css */ +#bm-window-main { + max-width: 300px; +} + +/* src/WindowWizard.css */ +#bm-wizard-tlist { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; +} +#bm-wizard-tlist > .bm-container { + width: 100%; + justify-content: flex-start; + background-color: rgba(21, 48, 99, 0.9); + border-radius: 1em; + padding: 0.5em; + transition: background-color 0.3s ease; +} +#bm-wizard-tlist > .bm-container:hover, +#bm-wizard-tlist > .bm-container:focus-within { + background-color: rgba(17, 40, 85, 0.9); +} +#bm-wizard-tlist .bm-wizard-template-container-image { + height: 100%; + font-size: xxx-large; +} +#bm-wizard-tlist .bm-wizard-template-container-flavor { + flex-direction: column; + align-items: flex-start; + gap: 0; +} + /* src/main.css */ diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index 02b16aa..5d61b2e 100644 --- a/dist/BlueMarble-For-GreasyFork.user.js +++ b/dist/BlueMarble-For-GreasyFork.user.js @@ -2,14 +2,14 @@ // @name Blue Marble // @name:en Blue Marble // @namespace https://github.com/SwingTheVine/ -// @version 0.90.0 +// @version 0.90.17 // @description A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @description:en A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @author SwingTheVine // @license MPL-2.0 // @supportURL https://discord.gg/tpeBPy46hf // @homepageURL https://bluemarble.lol/ -// @icon https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/8921e33df8eb2958601b8a791d28bacc0bf5fa2d/dist/assets/Favicon.png +// @icon https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/ffa17bc9a7c2db10efc201437dbf1637e11a6f61/dist/assets/Favicon.png // @updateURL https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/BlueMarble-For-GreasyFork.user.js // @downloadURL https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/BlueMarble-For-GreasyFork.user.js // @match https://wplace.live/* @@ -21,7 +21,7 @@ // @grant GM_xmlhttpRequest // @grant GM.download // @connect telemetry.thebluecorner.net -// @resource CSS-BM-File https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/8921e33df8eb2958601b8a791d28bacc0bf5fa2d/dist/BlueMarble-For-GreasyFork.user.css +// @resource CSS-BM-File https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/ffa17bc9a7c2db10efc201437dbf1637e11a6f61/dist/BlueMarble-For-GreasyFork.user.css // @antifeature tracking Anonymous opt-in telemetry data // @noframes // ==/UserScript== @@ -2606,6 +2606,62 @@ Did you try clicking the canvas first?`); }; customElements.define("confetti-piece", BlueMarbleConfettiPiece); + // src/WindowCredits.js + var WindowCredts = class extends Overlay { + /** Constructor for the Credits window + * @param {string} name - The name of the userscript + * @param {string} version - The version of the userscript + * @since 0.90.9 + * @see {@link Overlay#constructor} for examples + */ + constructor(name2, version2) { + super(name2, version2); + this.window = null; + this.windowID = "bm-window-credits"; + this.windowParent = document.body; + } + /** Spawns a Credits window. + * If another credits window already exists, we DON'T spawn another! + * Parent/child relationships in the DOM structure below are indicated by indentation. + * @since 0.90.9 + */ + buildWindow() { + const ascii = ` +\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 +\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D +\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 +\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D +\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 +\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D + +\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 +\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D +\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 +\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D +\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 +\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D +`; + if (document.querySelector(`#${this.windowID}`)) { + document.querySelector(`#${this.windowID}`).remove(); + return; + } + this.window = this.addDiv({ "id": this.windowID, "class": "bm-window" }, (instance, div) => { + }).addDragbar().addButton({ "class": "bm-button-circle", "textContent": "\u25BC", "aria-label": 'Minimize window "Credits"', "data-button-status": "expanded" }, (instance, button) => { + button.onclick = () => instance.handleMinimization(button); + button.ontouchend = () => { + button.click(); + }; + }).buildElement().addDiv().buildElement().addButton({ "class": "bm-button-circle", "textContent": "\u{1F7AA}", "aria-label": 'Close window "Credits"' }, (instance, button) => { + button.onclick = () => { + document.querySelector(`#${this.windowID}`)?.remove(); + }; + button.ontouchend = () => { + button.click(); + }; + }).buildElement().buildElement().addDiv({ "class": "bm-window-content" }).addDiv({ "class": "bm-container bm-center-vertically" }).addHeader(1, { "textContent": "Credits" }).buildElement().buildElement().addHr().buildElement().addDiv({ "class": "bm-container bm-scrollable" }).addSpan({ "innerHTML": ascii, "style": "white-space: pre;" }).buildElement().addBr().buildElement().addHr().buildElement().addBr().buildElement().addSpan({ "textContent": '"Blue Marble" userscript is made by SwingTheVine.' }).buildElement().addBr().buildElement().addSpan({ "innerHTML": 'The Blue Marble Website is made by crqch.' }).buildElement().addBr().buildElement().addSpan({ "textContent": `The Blue Marble Website used until ${localizeDate(new Date(1756069320 * 1e3))} was made by Camille Daguin.` }).buildElement().addBr().buildElement().addSpan({ "textContent": 'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)' }).buildElement().addBr().buildElement().addSpan({ "textContent": "Special Thanks:" }).buildElement().addUl().addLi({ "textContent": "Espresso, Meqa, and Robot for moderating SwingTheVine's community." }).buildElement().addLi({ "innerHTML": 'nof, darkness for creating similar userscripts!' }).buildElement().addLi({ "innerHTML": 'Wonda for the Blue Marble banner image!' }).buildElement().addLi({ "innerHTML": 'BullStein, allanf181 for being early beta testers!' }).buildElement().addLi({ "innerHTML": 'guidu_ and Nick-machado for the original "Minimize" Button code!' }).buildElement().addLi({ "innerHTML": 'Nomad and Gustav for the tutorials!' }).buildElement().addLi({ "innerHTML": 'TheBlueCorner for getting me interested in online pixel canvases!' }).buildElement().buildElement().buildElement().buildElement().buildElement().buildOverlay(this.windowParent); + } + }; + // src/WindowFilter.js var _WindowFilter_instances, buildColorList_fn, sortColorList_fn, selectColorList_fn; var WindowFilter = class extends Overlay { @@ -2959,7 +3015,7 @@ Did you try clicking the canvas first?`); }).buildElement().addButton({ "textContent": "Filter" }, (instance, button) => { button.onclick = () => __privateMethod(this, _WindowMain_instances, buildWindowFilter_fn).call(this); }).buildElement().buildElement().addDiv({ "class": "bm-container" }).addTextarea({ "id": this.outputStatusId, "placeholder": `Status: Sleeping... -Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().addDiv({ "class": "bm-container bm-flex-between", "style": "margin-bottom: 0;" }).addDiv({ "class": "bm-flex-between" }).addButton({ "class": "bm-button-circle", "innerHTML": "\u{1F9D9}", "title": "Template Wizard" }, (instance, button) => { +Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().addDiv({ "class": "bm-container bm-flex-between", "style": "margin-bottom: 0; flex-direction: column;" }).addDiv({ "class": "bm-flex-between" }).addButton({ "class": "bm-button-circle", "innerHTML": "\u{1F9D9}", "title": "Template Wizard" }, (instance, button) => { button.onclick = () => { const templateManager2 = instance.apiManager?.templateManager; const wizard = new WindowWizard(this.name, this.version, templateManager2?.schemaVersion, templateManager2); @@ -2977,7 +3033,12 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add button.onclick = () => { window.open("https://ko-fi.com/swingthevine", "_blank", "noopener noreferrer"); }; - }).buildElement().addSmall({ "textContent": "Made by SwingTheVine", "style": "margin-top: auto;" }).buildElement().buildElement().buildElement().buildElement().buildElement().buildOverlay(this.windowParent); + }).buildElement().addButton({ "class": "bm-button-circle", "innerHTML": "\u{1F91D}", "title": "Credits" }, (instance, button) => { + button.onclick = () => { + const credits = new WindowCredts(this.name, this.version); + credits.buildWindow(); + }; + }).buildElement().buildElement().addSmall({ "textContent": "Made by SwingTheVine", "style": "margin-top: auto;" }).buildElement().buildElement().buildElement().buildElement().buildElement().buildOverlay(this.windowParent); this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`); } }; diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index 42d6a23..dd56fdf 100644 --- a/dist/BlueMarble-Standalone.user.js +++ b/dist/BlueMarble-Standalone.user.js @@ -2,7 +2,7 @@ // @name Blue Marble // @name:en Blue Marble // @namespace https://github.com/SwingTheVine/ -// @version 0.90.0 +// @version 0.90.17 // @description A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @description:en A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @author SwingTheVine @@ -29,4 +29,4 @@ // License --> https://www.mozilla.org/en-US/MPL/2.0/ // Donate --> https://ko-fi.com/swingthevine -(()=>{var t=t=>{throw TypeError(t)},e=(e,i,n)=>i.has(e)?t("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,n),i=(e,i,n)=>(((e,i)=>{i.has(e)||t("Cannot access private method")})(e,i),n);function n(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function a(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function o(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function r(...t){(0,console.log)(...t)}function l(...t){(0,console.error)(...t)}function c(...t){(0,console.warn)(...t)}function h(t,e){if(0===t)return e[0];let i="";const n=e.length;for(;t>0;)i=e[t%n]+i,t=Math.floor(t/n);return i}function m(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&l(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function d(t){let e="";for(let i=0;i(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}var p,f,w,g,y,v=[{id:0,premium:!1,name:"Transparent",rgb:[0,0,0]},{id:1,premium:!1,name:"Black",rgb:[0,0,0]},{id:2,premium:!1,name:"Dark Gray",rgb:[60,60,60]},{id:3,premium:!1,name:"Gray",rgb:[120,120,120]},{id:4,premium:!1,name:"Light Gray",rgb:[210,210,210]},{id:5,premium:!1,name:"White",rgb:[255,255,255]},{id:6,premium:!1,name:"Deep Red",rgb:[96,0,24]},{id:7,premium:!1,name:"Red",rgb:[237,28,36]},{id:8,premium:!1,name:"Orange",rgb:[255,127,39]},{id:9,premium:!1,name:"Gold",rgb:[246,170,9]},{id:10,premium:!1,name:"Yellow",rgb:[249,221,59]},{id:11,premium:!1,name:"Light Yellow",rgb:[255,250,188]},{id:12,premium:!1,name:"Dark Green",rgb:[14,185,104]},{id:13,premium:!1,name:"Green",rgb:[19,230,123]},{id:14,premium:!1,name:"Light Green",rgb:[135,255,94]},{id:15,premium:!1,name:"Dark Teal",rgb:[12,129,110]},{id:16,premium:!1,name:"Teal",rgb:[16,174,166]},{id:17,premium:!1,name:"Light Teal",rgb:[19,225,190]},{id:18,premium:!1,name:"Dark Blue",rgb:[40,80,158]},{id:19,premium:!1,name:"Blue",rgb:[64,147,228]},{id:20,premium:!1,name:"Cyan",rgb:[96,247,242]},{id:21,premium:!1,name:"Indigo",rgb:[107,80,246]},{id:22,premium:!1,name:"Light Indigo",rgb:[153,177,251]},{id:23,premium:!1,name:"Dark Purple",rgb:[120,12,153]},{id:24,premium:!1,name:"Purple",rgb:[170,56,185]},{id:25,premium:!1,name:"Light Purple",rgb:[224,159,249]},{id:26,premium:!1,name:"Dark Pink",rgb:[203,0,122]},{id:27,premium:!1,name:"Pink",rgb:[236,31,128]},{id:28,premium:!1,name:"Light Pink",rgb:[243,141,169]},{id:29,premium:!1,name:"Dark Brown",rgb:[104,70,52]},{id:30,premium:!1,name:"Brown",rgb:[149,104,42]},{id:31,premium:!1,name:"Beige",rgb:[248,178,119]},{id:32,premium:!0,name:"Medium Gray",rgb:[170,170,170]},{id:33,premium:!0,name:"Dark Red",rgb:[165,14,30]},{id:34,premium:!0,name:"Light Red",rgb:[250,128,114]},{id:35,premium:!0,name:"Dark Orange",rgb:[228,92,26]},{id:36,premium:!0,name:"Light Tan",rgb:[214,181,148]},{id:37,premium:!0,name:"Dark Goldenrod",rgb:[156,132,49]},{id:38,premium:!0,name:"Goldenrod",rgb:[197,173,49]},{id:39,premium:!0,name:"Light Goldenrod",rgb:[232,212,95]},{id:40,premium:!0,name:"Dark Olive",rgb:[74,107,58]},{id:41,premium:!0,name:"Olive",rgb:[90,148,74]},{id:42,premium:!0,name:"Light Olive",rgb:[132,197,115]},{id:43,premium:!0,name:"Dark Cyan",rgb:[15,121,159]},{id:44,premium:!0,name:"Light Cyan",rgb:[187,250,242]},{id:45,premium:!0,name:"Light Blue",rgb:[125,199,255]},{id:46,premium:!0,name:"Dark Indigo",rgb:[77,49,184]},{id:47,premium:!0,name:"Dark Slate Blue",rgb:[74,66,132]},{id:48,premium:!0,name:"Slate Blue",rgb:[122,113,196]},{id:49,premium:!0,name:"Light Slate Blue",rgb:[181,174,241]},{id:50,premium:!0,name:"Light Brown",rgb:[219,164,99]},{id:51,premium:!0,name:"Dark Beige",rgb:[209,128,81]},{id:52,premium:!0,name:"Light Beige",rgb:[255,197,165]},{id:53,premium:!0,name:"Dark Peach",rgb:[155,82,73]},{id:54,premium:!0,name:"Peach",rgb:[209,128,120]},{id:55,premium:!0,name:"Light Peach",rgb:[250,182,164]},{id:56,premium:!0,name:"Dark Tan",rgb:[123,99,82]},{id:57,premium:!0,name:"Tan",rgb:[156,132,107]},{id:58,premium:!0,name:"Dark Slate",rgb:[51,57,65]},{id:59,premium:!0,name:"Slate",rgb:[109,117,141]},{id:60,premium:!0,name:"Light Slate",rgb:[179,185,209]},{id:61,premium:!0,name:"Dark Stone",rgb:[109,100,63]},{id:62,premium:!0,name:"Stone",rgb:[148,140,107]},{id:63,premium:!0,name:"Light Stone",rgb:[205,197,158]}],x=class{constructor({displayName:t="My template",o:i=0,l:n="",url:s="",file:a=null,coords:o=null,h:r=null,m:l={},u:c=1e3}={}){e(this,p),this.displayName=t,this.o=i,this.l=n,this.url=s,this.file=a,this.coords=o,this.h=r,this.m=l,this.u=c,this.p={total:0,colors:new Map}}async v(t,e){const n=await createImageBitmap(this.file),s=n.width,a=n.height;this.u=t;const o={},r={},l=new OffscreenCanvas(this.u,this.u),c=l.getContext("2d",{M:!0});l.width=s,l.height=a,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,p,f).call(this,c.getImageData(0,0,s,a),e);let u=0;for(const[t,e]of m)0!=t&&(u+=e);this.p={total:u,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),w=b.getContext("2d");w.clearRect(0,0,3,3),w.fillStyle="white",w.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,a,o]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const o=a.get(n);a.set(n,o?o+1:1)}return a};var M,T,$,C,S=class{constructor(t,i){e(this,w),this.name=t,this.version=i,this.D=null,this.O="bm-i",this.k=null,this.L=null,this.N=[]}B(t){this.D=t}I(){return this.N.length>0&&(this.L=this.N.pop()),this}A(t){t?.appendChild(this.k),this.k=null,this.L=null,this.N=[]}H(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"div",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"p",{},t)),this}W(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"small",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"span",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"details",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"summary",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"img",{},t)),this}j(t,e={},n=()=>{}){return n(this,i(this,w,g).call(this,"h"+t,{},e)),this}R(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"hr",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"br",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"form",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"fieldset",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"legend",{},t)),this}q(t={},e=()=>{}){const n=i(this,w,g).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,w,g).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.I(),e(this,n,s),this}Z(t={},e=()=>{}){const n=i(this,w,g).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.I(),e(this,n,i(this,w,g).call(this,"select",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"option",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"ol",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"ul",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"menu",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"li",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"table",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"caption",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"thead",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"tbody",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"tfoot",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"tr",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"th",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"td",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"button",{},t)),this}ft(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-M",onclick:()=>{this.wt(this.O,n)}};return e(this,i(this,w,g).call(this,"button",s,t)),this}gt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"input",{},t)),this}yt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,w,g).call(this,"div"),a=i(this,w,g).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.I();const o=i(this,w,g).call(this,"button",{textContent:n});return this.I(),this.I(),o.addEventListener("click",()=>{a.click()}),a.addEventListener("change",()=>{o.style.maxWidth=`${o.offsetWidth}px`,a.files.length>0?o.textContent=a.files[0].name:o.textContent=n}),e(this,s,a,o),this}vt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"textarea",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"div",{class:"bm-H"},t)),this}Mt(t=Date.now(),e=500,n={},s=()=>{}){const a="bm-L",o=n?.id||a+"-"+crypto.randomUUID().slice(0,8),r={class:a},l=i(this,w,g).call(this,"time",r,n);return l.id=o,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),i=Math.floor(e/3600),n=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${i}H${s}M${n}S`),l.textContent=String(i).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(n).padStart(2,"0")},e),s(this,l),this}wt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Tt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-J"),i=t.closest(".bm-H"),n=e.querySelector("h1"),s=e.querySelector(".bm-f");if(e.parentElement.append(e),"expanded"==t.dataset.buttonStatus){s.style.height=s.scrollHeight+"px",e.style.width=e.scrollWidth+"px",s.style.height="0",s.addEventListener("transitionend",function e(){s.style.display="none",t.disabled=!1,t.style.textDecoration="",s.removeEventListener("transitionend",e)});const i=n.cloneNode(!0),a=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${a}"`}else{const n=i.querySelector("h1"),a=n.textContent;n.remove(),s.style.display="",s.style.height="0",e.style.width="",s.style.height=s.scrollHeight+"px",s.addEventListener("transitionend",function e(){s.style.height="",t.disabled=!1,t.style.textDecoration="",s.removeEventListener("transitionend",e)}),t.textContent="ā–¼",t.dataset.buttonStatus="expanded",t.ariaLabel=`Minimize window "${a}"`}}$t(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Ct(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,a=!1,o=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(a){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,i.style.transform=`translate(${l}px, ${c}px)`,i.style.left="0px",i.style.top="0px",i.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{a=!0,d=i.getBoundingClientRect(),s=t-d.left,o=e-d.top;const b=window.getComputedStyle(i).transform;if(b&&"none"!==b){const t=new DOMMatrix(b);l=t.m41,c=t.m42}else l=d.left,c=d.top;h=l,m=c,document.body.style.userSelect="none",n.classList.add("bm-C"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{a=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-C"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",w),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{a&&d&&(h=t.clientX-s,m=t.clientY-o)},w=t=>{if(a&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-o,t.preventDefault()}};n.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),n.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}St(t){(0,console.info)(`${this.name}: ${t}`),this.wt(this.O,"Status: "+t,!0)}Ct(t){(0,console.error)(`${this.name}: ${t}`),this.wt(this.O,"Error: "+t,!0)}};w=new WeakSet,g=function(t,e={},n={}){const s=document.createElement(t);this.k?(this.L?.appendChild(s),this.N.push(this.L),this.L=s):(this.k=s,this.L=s);for(const[t,n]of Object.entries(e))i(this,w,y).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,w,y).call(this,s,t,e);return s},y=function(t,e,i){if("class"==e)t.classList.add(...i.split(/\s+/));else if("for"==e)t.htmlFor=i;else if("tabindex"==e)t.tabIndex=Number(i);else if("readonly"==e)t.readOnly="true"==i||"1"==i;else if("maxlength"==e)t.maxLength=Number(i);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i;else if(e.startsWith("aria")){const n=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+n[0].toUpperCase()+n.slice(1)]=i}else t[e]=i};var D=class extends S{constructor(t,i,n,s=void 0){super(t,i),e(this,M),this.window=null,this.Dt="bm-j",this.Ot=document.body,this.kt=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.kt?.scriptVersion,this.schemaVersion=this.kt?.schemaVersion,this.Lt=void 0,this.Nt=n,this.Bt=s}It(){if(document.querySelector(`#${this.Dt}`))return void document.querySelector(`#${this.Dt}`).remove();let t="";document.querySelector("#bm-t")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.Dt,class:"bm-J",style:t},(t,e)=>{}).xt().bt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Tt(e),e.ontouchend=()=>{e.click()}}).I().H().I().bt({class:"bm-k",textContent:"šŸžŖ","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Dt}`)?.remove()},e.ontouchend=()=>{e.click()}}).I().I().H({class:"bm-f"}).H({class:"bm-B bm-b"}).j(1,{textContent:"Template Wizard"}).I().I().R().I().H({class:"bm-B"}).j(2,{textContent:"Status"}).I().P({id:"bm-l",textContent:"Loading template storage status..."}).I().I().H({class:"bm-B bm-x"}).j(2,{textContent:"Detected templates:"}).I().I().I().I().A(this.Ot),this.$t(`#${this.Dt}.bm-J`,`#${this.Dt} .bm-H`),i(this,M,T).call(this),i(this,M,$).call(this)}};M=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Nt.split(/[-\.\+]/);let n="";t[0]==e[0]?t[1]==e[1]?(n='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Lt="Good"):(n='Template storage health: Poor!
You can still use your template, but some features may not work. It is recommended that you update Blue Marble\'s template storage. (Reason: MINOR version mismatch)',this.Lt="Poor"):t[0]Bad!
It is guaranteed that some features are broken. You might still be able to use the template. It is HIGHLY recommended that you download all templates and update Blue Marble\'s template storage before continuing. (Reason: MAJOR version mismatch)',this.Lt="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Lt="Dead");const s=`
If you want to continue using your current templates, then make sure the template storage (schema) is up-to-date.
If you don't want to update the template storage, then downgrade Blue Marble to version ${o(this.scriptVersion)} to continue using your templates.
Alternatively, if you don't care about corrupting the templates listed below, you can fix any issues with the template storage by uploading a new template.`;this.wt("#bm-l",`${n}
Your templates were created during Blue Marble version ${o(this.scriptVersion)} with schema version ${o(this.schemaVersion)}.
The current Blue Marble version is ${o(this.version)} and requires schema version ${o(this.Nt)}.${"Good"!=this.Lt?s:""}`);const a=new S(this.name,this.version);"Dead"!=this.Lt&&(a.H({class:"bm-B bm-u bm-b",style:"gap: 1.5ch;"}),a.bt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Bt.At().then(()=>{e.disabled=!1})}}).I()),"Poor"!=this.Lt&&"Bad"!=this.Lt||a.bt({textContent:`Update template storage to ${this.Nt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,M,C).call(this,!0)}}).I(),a.I().A(document.querySelector("#bm-l").parentNode)},$=function(){const t=this.kt?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Dt} .bm-x`),i=new S(this.name,this.version);i.H({id:"bm-o",class:"bm-B"});for(const e in t){const n=e,a=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),o=m(t?.[1]||"0",this.Bt.Ht),r=a.name||`Template ${e||""}`,l=a?.coords?.split(",").map(Number),c=a.pixels?.total??void 0,h=void 0,d="number"==typeof e?s(e):"???",u="number"==typeof o?s(o):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-B bm-u"}).H({class:"bm-u",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).I().W({textContent:`#${d}`}).I().I().H({class:"bm-u bm-0"}).j(3,{textContent:r}).I().U({textContent:`Uploaded by user #${u}`}).I().U({textContent:`Coordinates: ${l.join(", ")}`}).I().U({textContent:`Total Pixels: ${b}`}).I().I().I()}}i.I().A(e)}},C=async function(t){if(t){const t=document.querySelector(`#${this.Dt} .bm-f`);t.innerHTML="",new S(this.name,this.version).H({class:"bm-B"}).H({class:"bm-B bm-b"}).j(1,{textContent:"Template Wizard"}).I().I().R().I().H({class:"bm-B"}).j(2,{textContent:"Status"}).I().P({textContent:"Updating template storage. Please wait..."}).I().I().I().A(t)}GM_deleteValue("bmCoords");const e=this.kt?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new x({displayName:i.name,h:i.tiles});t.C();const e=await this.Bt.Pt(t);await this.Bt.Wt(e,t.displayName,t.coords)}t&&(document.querySelector(`#${this.Dt}`).remove(),new D(this.name,this.version,this.Nt,this.Bt).It())};var O,k,L,N,B=D;O=new WeakSet,k=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ut))},L=async function(t){const e=t.templates,i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),a=t?.scriptVersion;n[0]==s[0]?(n[1]!=s[1]&&new B(this.name,this.version,this.schemaVersion,this).It(),this.Gt=await async function({u:t,zt:i,Gt:n}){if(Object.keys(e).length>0)for(const s in e){const a=s,o=e[s];if(e.hasOwnProperty(s)){const e=a.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=o.name||`Template ${s||""}`,c={total:o.pixels?.total,colors:new Map(Object.entries(o.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=o.tiles,m={},d={},b=t*i;for(const t in h)if(h.hasOwnProperty(t)){const e=u(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(b,b).getContext("2d");s.drawImage(n,0,0);const a=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(a.data.buffer)}const p=new x({displayName:l,o:s||this.Gt?.length||0,l:r||""});p.p=c,p.h=m,p.m=d,n.push(p)}}return n}({u:this.u,zt:this.zt,Gt:this.Gt})):n[0]>>24&255,w=b>>>24&255,g=m.get(p)??-2;if(this.Vt.get(g)&&(e[i*r+l]=b),-1==g){const t=536870912;this.Vt.get(g)?e[i*r+l]=0:(h/n&1)==(u/n&1)?(e[i*r+l]=t,e[(i-1)*r+(l-1)]=t,e[(i-1)*r+(l+1)]=t,e[(i+1)*r+(l-1)]=t,e[(i+1)*r+(l+1)]=t):(e[i*r+l]=0,e[(i-1)*r+l]=t,e[(i+1)*r+l]=t,e[i*r+(l-1)]=t,e[i*r+(l+1)]=t)}if(-1==g&&b<=c){const t=d.get(g);d.set(g,t?t+1:1);continue}if(f<=c||w<=c)continue;if((m.get(b)??-2)!=g)continue;const y=d.get(g);d.set(g,y?y+1:1)}return{Et:d,Xt:e}};var I,A,H,P,W=class{constructor(){this.Jt=Math.ceil(80/1300*window.innerWidth),this.qt=v.slice(1)}Qt(t){const e=document.createElement("div");for(let t=0;t{t.parentNode.childElementCount<=1?t.parentNode.remove():t.remove()},e.appendChild(t)}t.appendChild(e)}},U=class extends HTMLElement{};customElements.define("confetti-piece",U);var G,z,_,F,j,R=class extends S{constructor(t){super(t.name,t.version),e(this,I),this.window=null,this.Dt="bm-m",this.Ot=document.body,this.Bt=t.D?.Bt,this.Zt='',this.Kt='';const{palette:i,S:n}=this.Bt.Yt;this.palette=i,this.te=0,this.ee=0}It(){if(document.querySelector(`#${this.Dt}`))return void document.querySelector(`#${this.Dt}`).remove();this.window=this.H({id:this.Dt,class:"bm-J"},(t,e)=>{}).xt().bt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Tt(e),e.ontouchend=()=>{e.click()}}).I().H().I().bt({class:"bm-k",textContent:"šŸžŖ","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Dt}`)?.remove()},e.ontouchend=()=>{e.click()}}).I().I().H({class:"bm-f"}).H({class:"bm-B bm-b"}).j(1,{textContent:"Color Filter"}).I().I().R().I().H({class:"bm-B bm-p bm-b",style:"gap: 1.5ch;"}).bt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,I,P).call(this,!1)}).I().bt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,I,P).call(this,!0)}).I().I().H({class:"bm-B bm-x"}).H({class:"bm-B",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-B"}).U({id:"bm-c",innerHTML:"Tiles Loaded: 0 / ???"}).I().Y().I().U({id:"bm-7",innerHTML:"Correct Pixels: ???"}).I().Y().I().U({id:"bm-d",innerHTML:"Total Pixels: ???"}).I().Y().I().U({id:"bm-3",innerHTML:"Complete: ??? (???)"}).I().Y().I().U({id:"bm-4",innerHTML:"??? ???"}).I().I().H({class:"bm-B"}).P({innerHTML:`Colors with the icon ${this.Zt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Dt} form`)),n={};for(const[t,i]of e)n[t]=i;i(this,I,H).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).I().I().I().I().I().I().I().A(this.Ot),this.$t(`#${this.Dt}.bm-J`,`#${this.Dt} .bm-H`);const t=document.querySelector(`#${this.Dt} .bm-B.bm-x`);let e=0,n=0;const o=new Map,r=new Map;for(const t of this.Bt.Gt){e+=t.p?.total??0??0;const i=t.p?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=r.get(t)??0;r.set(t,n+i)}const s=t.p?.correct??{};this.te+=Object.keys(s).length,this.ee+=Object.keys(t.h).length;for(const t of Object.values(s))for(const[e,i]of t){const t=Number(i)||0;n+=t;const s=o.get(e)??0;o.set(e,s+t)}}n>=e&&e&&this.te==this.ee&&(new W).Qt(document.querySelector(`#${this.Dt}`));const l=new Date(30*(e-n)*1e3+Date.now()),c=l.toLocaleString(void 0,{ie:"long",ne:"numeric",se:"2-digit",ae:"2-digit",oe:"2-digit"});this.wt("#bm-c",`Tiles Loaded: ${s(this.te)} / ${s(this.ee)}`),this.wt("#bm-7",`Correct Pixels: ${s(n)}`),this.wt("#bm-d",`Total Pixels: ${s(e)}`),this.wt("#bm-3",`Remaining: ${s((e||0)-(n||0))} (${a(((e||0)-(n||0))/(e||1))})`),this.wt("#bm-4",`Completed at: `),i(this,I,A).call(this,t,o,r),i(this,I,H).call(this,"id","ascending",!1)}};I=new WeakSet,A=function(t,e,i){const n=new S(this.name,this.version);n.H({class:"bm-v"});for(const t of this.palette){const o=b(t.rgb);let r=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(r="transparent");const l="white"==r?"bm-9":"bm-a",c=i.get(t.id)??0,h=s(c);let m=0,d="0",u=a(1);0!=c&&(m=e.get(t.id)??"???","number"!=typeof m&&this.te==this.ee&&t.id&&(m=0),d="string"==typeof m?m:s(m),u=isNaN(m/c)?"???":a(m/c));const p=parseInt(c)-parseInt(m),f=!!this.Bt.Vt.get(t.id);n.H({class:"bm-B bm-q bm-p","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(m))?"0":m,"data-total":c,"data-percent":"%"==u.slice(-1)?u.slice(0,-1):"0","data-incorrect":p||0}).H({class:"bm-5",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});`}).bt({class:"bm-r "+l,"data-state":f?"hidden":"shown","aria-label":f?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:f?this.Kt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Kt.replace("{const a=n.getAttribute("data-"+t),o=s.getAttribute("data-"+t),r=parseFloat(a),l=parseFloat(o),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-y"):Number(n.getAttribute("data-total"))||n.classList.add("bm-y"),c&&h)return"ascending"===e?r-l:l-r;{const t=a.toLowerCase(),i=o.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},P=function(t){const e=document.querySelector(".bm-v"),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-y"))continue;const i=e.querySelector(".bm-5 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},G=new WeakSet,z=function(){new R(this).It()},_=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{r("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-D"==e.id?(t.wt("bm-D",s?.[0]||""),t.wt("bm-E",s?.[1]||"")):1==s.length?t.wt(e.id,s?.[0]||""):(t.wt("bm-F",s?.[0]||""),t.wt("bm-G",s?.[1]||""),t.wt("bm-D",s?.[2]||""),t.wt("bm-E",s?.[3]||""))},F=new WeakSet,j=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Y=GM_info.script.name.toString(),V=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-N",Y),e.setAttribute("bm-K","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-N")||"Blue Marble",i=t?.getAttribute("bm-K")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:a,blobID:o,blobData:r,blink:l}=t.data;if(Date.now(),"blue-marble"==s&&o&&r&&!a){const t=n.get(o);"function"==typeof t?t(r):c(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",o),n.delete(o)}});const s=window.fetch;window.fetch=async function(...t){const e=await s.apply(this,t),i=e.clone(),a=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",o=i.headers.get("content-type")||"";if(o.includes("application/json"))i.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:a,jsonData:t},"*")}).catch(t=>{});else if(o.includes("image/")&&!a.includes("openfreemap")&&!a.includes("maps")){const t=Date.now(),e=await i.blob();return new Promise(s=>{const o=crypto.randomUUID();n.set(o,t=>{s(new Response(t,{headers:i.headers,status:i.status,statusText:i.statusText}))}),window.postMessage({source:"blue-marble",endpoint:a,blobID:o,blobData:e,blink:t})}).catch(t=>{Date.now()})}return e}});var E=`#bm-m p svg{display:inline;height:1em;fill:#fff}.bm-v{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}.bm-q{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}.bm-q:hover,.bm-q:focus-within{background-color:#112855e6}.bm-5{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}.bm-q[data-id="-2"] .bm-5{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}.bm-q[data-id="-1"] .bm-5{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}.bm-q[data-id="-1"] .bm-5 svg{fill:#fff!important}.bm-q[data-id="0"] .bm-5{background-color:transparent!important}.bm-5 button{padding:.75em .5ch}.bm-5 svg{width:4ch}.bm-q>.bm-p{flex-direction:column;align-items:flex-start;gap:0}.bm-q small{font-size:.75em}#bm-m .bm-q.bm-y{display:none}#bm-t{max-width:300px}#bm-o{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-o>.bm-B{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-o>.bm-B:hover,#bm-o>.bm-B:focus-within{background-color:#112855e6}#bm-o .bm-1{height:100%;font-size:xxx-large}#bm-o .bm-0{flex-direction:column;align-items:flex-start;gap:0}div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-J{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-H{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-H.bm-C{cursor:grabbing}.bm-J:has(.bm-H.bm-C){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-H.bm-C{pointer-events:auto}.bm-I{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-J h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-H h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:3px 0px rgba(21,48,99,.5),-3px 0px rgba(21,48,99,.5),0px 3px rgba(21,48,99,.5),0px -3px rgba(21,48,99,.5),3px 3px rgba(21,48,99,.5),-3px 3px rgba(21,48,99,.5),3px -3px rgba(21,48,99,.5),-3px -3px rgba(21,48,99,.5)}.bm-H div:has(h1){display:contents}.bm-J h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-J h3{display:inline-block;font-size:large;font-weight:700}.bm-B.bm-b{width:fit-content;margin-left:auto;margin-right:auto}.bm-B{margin:.5em 0}.bm-J button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-J button:hover,.bm-J button:focus-visible{background-color:#1061e5}.bm-J button:active,.bm-J button:disabled{background-color:#2e97ff}.bm-J button:disabled{text-decoration:line-through}.bm-k{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-z{vertical-align:middle}.bm-z svg{width:50%;margin:0 auto;fill:#111}.bm-J button.bm-r{background-color:unset}.bm-r.bm-9:hover,.bm-r.bm-9:focus{background-color:#ffffff2b}.bm-r.bm-9:active{background-color:#ffffff38}.bm-r.bm-a:hover,.bm-r.bm-a:focus{background-color:#0000002b}.bm-r.bm-a:active{background-color:#00000038}input[type=number].bm-s{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-s::-webkit-outer-spin-button,input[type=number].bm-s::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-A)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-A,input[type=file]{display:none!important;visibility:hidden!important;position:absolute!important;left:-9999px!important;top:-9999px!important;width:0!important;height:0!important;opacity:0!important;z-index:-9999!important;pointer-events:none!important}.bm-J select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-J label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-J input[type=checkbox]{width:1em}.bm-f{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-J textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-J small{font-size:x-small;color:#d3d3d3}.bm-J ul li{list-style:disc;margin-left:5ch}.bm-J .bm-B.bm-x{max-height:calc(80vh - 150px);overflow:auto}.bm-p{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-u{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}`;GM_addStyle(E);var X,J="@font-face{font-family:'Roboto Mono';font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAADGIAA4AAAAAWngAADEuAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHDQGYD9TVEFUSACEThEICoGbAPoCC4NKAAE2AiQDg0oEIAWEWAeEYQwHGzdHsxERbBwIgEaWFUXpovSC/zKBG0OsPsALHwg+NI1SpzSGCOqReFjIyBOMluTO77d+stdLxT8578xk8qTZE3w1OkJLH/HCf/x+7dyZJ38RsxRVsnqjLjUQIiGSyJtptC9XNc3uBUH3jMC+IPGCwECyDmFX89mpyks+JIiJf6k8fvmlMgTb7HBGzQZtEAQxQERakSoRUQFtQsyY02nPpbWwNnW6NDZla5z75dci42ORHwuCaq3Kmj0ET+QQ1DlUpAkssLsnhSTshycLrNy5f+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+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";J.indexOf("@font-face")+1?GM_addStyle(J):((X=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",X.rel="preload",X.as="style",X.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(X)),new class{constructor(){this.re=null,this.le=null,this.ce="#bm-g"}he(t){return this.le=t,this.re=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ce)}),this}me(){return this.re}observe(t,e=!1,i=!1){t.observe(this.le,{childList:e,subtree:i})}};var q=new class extends S{constructor(t,i){super(t,i),e(this,G),this.window=null,this.Dt="bm-t",this.Ot=document.body}It(){document.querySelector(`#${this.Dt}`)?this.Ct("Main window already exists!"):(this.window=this.H({id:this.Dt,class:"bm-J",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).xt().bt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Tt(e),e.ontouchend=()=>{e.click()}}).I().H().I().I().H({class:"bm-f"}).H({class:"bm-B"}).F({class:"bm-I",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa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j6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new W).Qt(document.querySelector(`#${this.Dt}`))})}).I().j(1,{textContent:this.name}).I().I().R().I().H({class:"bm-B"}).U({id:"bm-n",textContent:"Droplets:"}).I().Y().I().U({id:"bm-h",textContent:"Next level in..."}).I().Y().I().U({textContent:"Charges: "}).Mt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.D.de=e.id}).I().I().I().R().I().H({class:"bm-B"}).H({class:"bm-B"}).bt({class:"bm-k bm-z",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.D?.ue;e?.[0]?(t.wt("bm-F",e?.[0]||""),t.wt("bm-G",e?.[1]||""),t.wt("bm-D",e?.[2]||""),t.wt("bm-E",e?.[3]||"")):t.Ct("Coordinates are malformed! Did you try clicking on the canvas first?")}}).I().gt({type:"number",id:"bm-F",class:"bm-s",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,_).call(this,t,e,n))}).I().gt({type:"number",id:"bm-G",class:"bm-s",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,_).call(this,t,e,n))}).I().gt({type:"number",id:"bm-D",class:"bm-s",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,_).call(this,t,e,n))}).I().gt({type:"number",id:"bm-E",class:"bm-s",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,_).call(this,t,e,n))}).I().I().H({class:"bm-B"}).yt({class:"bm-A",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).I().I().H({class:"bm-B bm-p"}).bt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.D?.Bt?.be(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.St("Disabled templates!")):(t.D?.Bt?.be(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.St("Enabled templates!")),e.disabled=!1}}).I().bt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Dt} .bm-A`),i=document.querySelector("#bm-F");if(!i.checkValidity())return i.reportValidity(),void t.Ct("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-G");if(!n.checkValidity())return n.reportValidity(),void t.Ct("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-D");if(!s.checkValidity())return s.reportValidity(),void t.Ct("Coordinates are malformed! Did you try clicking on the canvas first?");const a=document.querySelector("#bm-E");if(!a.checkValidity())return a.reportValidity(),void t.Ct("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.D?.Bt.Wt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(a.value)]),t.St("Drew to canvas!")):t.Ct("No file selected!")}}).I().bt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,G,z).call(this)}).I().I().H({class:"bm-B"}).vt({id:this.O,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).I().I().H({class:"bm-B bm-p",style:"margin-bottom: 0;"}).H({class:"bm-p"}).bt({class:"bm-k",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.D?.Bt;new B(this.name,this.version,e?.schemaVersion,e).It()}}).I().bt({class:"bm-k",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).I().bt({class:"bm-k",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).I().bt({class:"bm-k",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).I().W({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).I().I().I().I().I().A(this.Ot),this.$t(`#${this.Dt}.bm-J`,`#${this.Dt} .bm-H`))}}(Y,V),Q=new class{constructor(t,i,n){e(this,O),this.name=t,this.version=i,this.k=n,this.schemaVersion="2.0.0",this.pe=null,this.Ht="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.u=1e3,this.zt=3,this.Rt=3,this.Yt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],a=n.rgb[2];for(let o=-t;o<=t;o++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+o,c=s+r,h=a+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,S:i}}(this.Rt),this.Ft=null,this.fe="",this.Gt=[],this.Ut=null,this.we=!0,this.ge=null,this.Vt=new Map}async ye(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Wt(t,e,n){this.Ut||(this.Ut=await this.ye()),this.k.St(`Creating template at ${n.join(", ")}...`);const s=new x({displayName:e,o:0,l:h(this.pe||0,this.Ht),file:t,coords:n}),{T:a,$:o}=await s.v(this.u,this.Yt);s.h=a;const r={total:s.p.total,colors:Object.fromEntries(s.p.colors)};this.Ut.templates[`${s.o} ${s.l}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:o},this.Gt=[],this.Gt.push(s),this.k.St(`Template created at ${n.join(", ")}!`),await i(this,O,k).call(this)}ve(){}async xe(){this.Ut||(this.Ut=await this.ye())}async Me(){r("Downloading all templates...");for(const t of this.Gt)await this.Te(t),await n(500)}async At(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Te(new x({displayName:i.name,o:e.split(" ")?.[0],l:e.split(" ")?.[1],h:i.tiles})),await n(500))}async Te(t){t.C();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Pt(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",$e:"uniquify",onload:()=>{r(`Download of template '${e}' complete!`)},onerror:(t,i)=>{l(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{c(`Download of template '${e}' has timed out!`)}})}async Pt(t){const e=t.h,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,a=1/0,o=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.u+c,u=l*this.u+h;s=Math.min(s,d),a=Math.min(a,u),o=Math.max(o,d+m.width/this.zt),r=Math.max(r,u+m.height/this.zt)});const l=new OffscreenCanvas(o-s,r-a),c=l.getContext("2d");return c.imageSmoothingEnabled=!1,i.forEach((t,e)=>{const[i,o,r,l]=t.split(",").map(Number),h=n[e],m=i*this.u+r,d=o*this.u+l;c.drawImage(h,m-s,d-a,h.width/this.zt,h.height/this.zt)}),l.convertToBlob({type:"image/png"})}async Ce(t,e){if(!this.we)return t;const n=this.u*this.zt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0");const a=this.Gt;a.sort((t,e)=>t.o-e.o);const o=a.map(t=>{const i=Object.keys(t.h).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Se:t,De:t.h[e],m:t.m?.[e],Oe:[i[0],i[1]],ke:[i[2],i[3]]}});return n?.[0]}).filter(Boolean),r=o?.length||0;if(!(r>0))return this.k.St(`Sleeping\nVersion: ${this.version}`),t;{const t=s(a.filter(t=>Object.keys(t.h).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.p.total||0),0));this.k.St(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of o){const n=!!t.Se.p?.colors?.get(-1);let s=t.m.slice();const a=Number(t.ke[0])*this.zt,o=Number(t.ke[1])*this.zt;if(0!=this.Vt.size||n||h.drawImage(t.De,a,o),!s){const e=h.getImageData(a,o,t.De.width,t.De.height);s=new Uint32Array(e.data.buffer)}Date.now();const{Et:r,Xt:l}=i(this,O,N).call(this,{_t:d,Ft:s,jt:[a,o,t.De.width,t.De.height]});let c=0;const m=0;for(const[t,e]of r)t!=m&&(c+=e);(0!=this.Vt.size||n)&&h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(l.buffer),t.De.width,t.De.height)),a,o),void 0===t.Se.p.correct&&(t.Se.p.correct={}),t.Se.p.correct[e]=r}return await c.convertToBlob({type:"image/png"})}Le(t){"BlueMarble"==t?.whoami&&i(this,O,L).call(this,t)}be(t){this.we=t}}(Y,V,q),Z=new class{constructor(t){this.Bt=t,this.Ne=!1,this.de="",this.ue=[],this.Be=[]}Ie(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const a=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(a){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Ct("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(n.id||n.id,this.Bt.pe=n.id,0!=this.de.length){const t=document.querySelector("#"+this.de);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.wt("bm-n",`Droplets: ${s(n.droplets)}`),t.wt("bm-h",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const a=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.ue.length&&(!a.length||!c.length))return void t.Ct("Coordinates are malformed!\nDid you try clicking the canvas first?");this.ue=[...a,...c];const h=(o=a,r=c,[parseInt(o[0])%4*1e3+parseInt(r[0]),parseInt(o[1])%4*1e3+parseInt(r[1])]),m=document.querySelectorAll("span");for(const t of m)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-g");const i=`(Tl X: ${a[0]}, Tl Y: ${a[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-g",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let d=i.endpoint.split("/");d=[parseInt(d[d.length-2]),parseInt(d[d.length-1].replace(".png",""))];const u=i.blobID,b=i.blobData,p=(Date.now(),await this.Bt.Ce(b,d));window.postMessage({source:"blue-marble",blobID:u,blobData:p,blink:i.blink});break;case"robots":this.Ne="false"==n.userscript?.toString().toLowerCase()}var o,r})}async Ae(t){let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return;const i=navigator.userAgent;let n=await this.He(i),s=this.Pe(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&l("Failed to send heartbeat:",t.statusText)},onerror:t=>{l("Error sending heartbeat:",t)}})}async He(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Pe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(Q);q.B(Z);var K=JSON.parse(GM_getValue("bmTemplates","{}"));Q.Le(K);var tt=JSON.parse(GM_getValue("bmUserSettings","{}"));if(0==Object.keys(tt).length){const t=crypto.randomUUID();GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>Z.Ae(V),18e5);var et=tt?.telemetry;if(null==et||et>1){const t=new class extends S{constructor(t,i,n,s){super(t,i),e(this,F),this.window=null,this.Dt="bm-e",this.Ot=document.body,this.We=n,this.uuid=s}async It(){if(document.querySelector(`#${this.Dt}`))return void this.Ct("Telemetry window already exists!");const t=await this.D.He(navigator.userAgent),e=this.D.Pe(navigator.userAgent);this.window=this.H({id:this.Dt,class:"bm-J",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-f"}).H({class:"bm-B bm-b"}).j(1,{textContent:`${this.name} Telemetry`}).I().I().R().I().H({class:"bm-B bm-u",style:"gap: 1.5ch; flex-wrap: wrap;"}).bt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,F,j).call(this,this.We);const t=document.getElementById(this.Dt);t?.remove()}}).I().bt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,F,j).call(this,0);const t=document.getElementById(this.Dt);t?.remove()}}).I().bt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).I().I().H({class:"bm-B bm-x"}).H({class:"bm-B"}).j(2,{textContent:"Legal"}).I().P({textContent:`We collect anonymous telemetry data such as your browser, OS, and script version to make the experience better for everyone. The data is never shared personally. The data is never sold. You can turn this off by pressing the "Disable" button, but keeping it on helps us improve features and reliability faster. Thank you for supporting ${this.name}!`}).I().I().R().I().H({class:"bm-B"}).j(2,{textContent:"Non-Legal Summary"}).I().P({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).I().et().nt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${o(this.uuid)}`}).I().nt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${o(this.version)}`}).I().nt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${o(t)}`}).I().nt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${o(e)}`}).I().nt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).I().I().P({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).I().I().I().I().I().A(this.Ot)}}(Y,V,1,tt?.uuid);t.B(Z),t.It()}q.It(),Z.Ie(q),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-w");if(!n){n=document.createElement("button"),n.id="bm-w",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),r(`%c${Y}%c (${V}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}var f,g,w,y,v,$=[{id:0,premium:!1,name:"Transparent",rgb:[0,0,0]},{id:1,premium:!1,name:"Black",rgb:[0,0,0]},{id:2,premium:!1,name:"Dark Gray",rgb:[60,60,60]},{id:3,premium:!1,name:"Gray",rgb:[120,120,120]},{id:4,premium:!1,name:"Light Gray",rgb:[210,210,210]},{id:5,premium:!1,name:"White",rgb:[255,255,255]},{id:6,premium:!1,name:"Deep Red",rgb:[96,0,24]},{id:7,premium:!1,name:"Red",rgb:[237,28,36]},{id:8,premium:!1,name:"Orange",rgb:[255,127,39]},{id:9,premium:!1,name:"Gold",rgb:[246,170,9]},{id:10,premium:!1,name:"Yellow",rgb:[249,221,59]},{id:11,premium:!1,name:"Light Yellow",rgb:[255,250,188]},{id:12,premium:!1,name:"Dark Green",rgb:[14,185,104]},{id:13,premium:!1,name:"Green",rgb:[19,230,123]},{id:14,premium:!1,name:"Light Green",rgb:[135,255,94]},{id:15,premium:!1,name:"Dark Teal",rgb:[12,129,110]},{id:16,premium:!1,name:"Teal",rgb:[16,174,166]},{id:17,premium:!1,name:"Light Teal",rgb:[19,225,190]},{id:18,premium:!1,name:"Dark Blue",rgb:[40,80,158]},{id:19,premium:!1,name:"Blue",rgb:[64,147,228]},{id:20,premium:!1,name:"Cyan",rgb:[96,247,242]},{id:21,premium:!1,name:"Indigo",rgb:[107,80,246]},{id:22,premium:!1,name:"Light Indigo",rgb:[153,177,251]},{id:23,premium:!1,name:"Dark Purple",rgb:[120,12,153]},{id:24,premium:!1,name:"Purple",rgb:[170,56,185]},{id:25,premium:!1,name:"Light Purple",rgb:[224,159,249]},{id:26,premium:!1,name:"Dark Pink",rgb:[203,0,122]},{id:27,premium:!1,name:"Pink",rgb:[236,31,128]},{id:28,premium:!1,name:"Light Pink",rgb:[243,141,169]},{id:29,premium:!1,name:"Dark Brown",rgb:[104,70,52]},{id:30,premium:!1,name:"Brown",rgb:[149,104,42]},{id:31,premium:!1,name:"Beige",rgb:[248,178,119]},{id:32,premium:!0,name:"Medium Gray",rgb:[170,170,170]},{id:33,premium:!0,name:"Dark Red",rgb:[165,14,30]},{id:34,premium:!0,name:"Light Red",rgb:[250,128,114]},{id:35,premium:!0,name:"Dark Orange",rgb:[228,92,26]},{id:36,premium:!0,name:"Light Tan",rgb:[214,181,148]},{id:37,premium:!0,name:"Dark Goldenrod",rgb:[156,132,49]},{id:38,premium:!0,name:"Goldenrod",rgb:[197,173,49]},{id:39,premium:!0,name:"Light Goldenrod",rgb:[232,212,95]},{id:40,premium:!0,name:"Dark Olive",rgb:[74,107,58]},{id:41,premium:!0,name:"Olive",rgb:[90,148,74]},{id:42,premium:!0,name:"Light Olive",rgb:[132,197,115]},{id:43,premium:!0,name:"Dark Cyan",rgb:[15,121,159]},{id:44,premium:!0,name:"Light Cyan",rgb:[187,250,242]},{id:45,premium:!0,name:"Light Blue",rgb:[125,199,255]},{id:46,premium:!0,name:"Dark Indigo",rgb:[77,49,184]},{id:47,premium:!0,name:"Dark Slate Blue",rgb:[74,66,132]},{id:48,premium:!0,name:"Slate Blue",rgb:[122,113,196]},{id:49,premium:!0,name:"Light Slate Blue",rgb:[181,174,241]},{id:50,premium:!0,name:"Light Brown",rgb:[219,164,99]},{id:51,premium:!0,name:"Dark Beige",rgb:[209,128,81]},{id:52,premium:!0,name:"Light Beige",rgb:[255,197,165]},{id:53,premium:!0,name:"Dark Peach",rgb:[155,82,73]},{id:54,premium:!0,name:"Peach",rgb:[209,128,120]},{id:55,premium:!0,name:"Light Peach",rgb:[250,182,164]},{id:56,premium:!0,name:"Dark Tan",rgb:[123,99,82]},{id:57,premium:!0,name:"Tan",rgb:[156,132,107]},{id:58,premium:!0,name:"Dark Slate",rgb:[51,57,65]},{id:59,premium:!0,name:"Slate",rgb:[109,117,141]},{id:60,premium:!0,name:"Light Slate",rgb:[179,185,209]},{id:61,premium:!0,name:"Dark Stone",rgb:[109,100,63]},{id:62,premium:!0,name:"Stone",rgb:[148,140,107]},{id:63,premium:!0,name:"Light Stone",rgb:[205,197,158]}],x=class{constructor({displayName:t="My template",p:n=0,v:i="",url:s="",file:o=null,coords:a=null,$:r=null,M:l={},T:c=1e3}={}){e(this,f),this.displayName=t,this.p=n,this.v=i,this.url=s,this.file=o,this.coords=a,this.$=r,this.M=l,this.T=c,this.C={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.T=t;const a={},r={},l=new OffscreenCanvas(this.T,this.T),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,f,g).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.C={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var M,T,C,S,D=class{constructor(t,n){e(this,w),this.name=t,this.version=n,this.N=null,this.B="bm-i",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"small",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"span",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,w,y).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,w,y).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,w,y).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,w,y).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,w,y).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-M",onclick:()=>{this.$t(this.B,i)}};return e(this,n(this,w,y).call(this,"button",s,t)),this}xt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,w,y).call(this,"div"),o=n(this,w,y).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,w,y).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Tt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"textarea",{},t)),this}Ct(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"div",{class:"bm-H"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-L",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,w,y).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}$t(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}Dt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-J"),n=t.closest(".bm-H"),i=e.querySelector("h1"),s=e.querySelector(".bm-f");if(e.parentElement.append(e),"expanded"==t.dataset.buttonStatus){s.style.height=s.scrollHeight+"px",e.style.width=e.scrollWidth+"px",s.style.height="0",s.addEventListener("transitionend",function e(){s.style.display="none",t.disabled=!1,t.style.textDecoration="",s.removeEventListener("transitionend",e)});const n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.remove(),s.style.display="",s.style.height="0",e.style.width="",s.style.height=s.scrollHeight+"px",s.addEventListener("transitionend",function e(){s.style.height="",t.disabled=!1,t.style.textDecoration="",s.removeEventListener("transitionend",e)}),t.textContent="ā–¼",t.dataset.buttonStatus="expanded",t.ariaLabel=`Minimize window "${o}"`}}kt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Ot(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).transform;if(b&&"none"!==b){const t=new DOMMatrix(b);l=t.m41,c=t.m42}else l=d.left,c=d.top;h=l,m=c,document.body.style.userSelect="none",i.classList.add("bm-C"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-C"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Lt(t){(0,console.info)(`${this.name}: ${t}`),this.$t(this.B,"Status: "+t,!0)}Ot(t){(0,console.error)(`${this.name}: ${t}`),this.$t(this.B,"Error: "+t,!0)}};w=new WeakSet,y=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,w,v).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,w,v).call(this,s,t,e);return s},v=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var k=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,M),this.window=null,this.Nt="bm-j",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-t")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-J",style:t},(t,e)=>{}).Ct().yt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Dt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-k",textContent:"šŸžŖ","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-f"}).G({class:"bm-B bm-b"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-B"}).J(2,{textContent:"Status"}).W().U({id:"bm-l",textContent:"Loading template storage status..."}).W().W().G({class:"bm-B bm-x"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.kt(`#${this.Nt}.bm-J`,`#${this.Nt} .bm-H`),n(this,M,T).call(this),n(this,M,C).call(this)}};M=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='Template storage health: Poor!
You can still use your template, but some features may not work. It is recommended that you update Blue Marble\'s template storage. (Reason: MINOR version mismatch)',this.Ht="Poor"):t[0]Bad!
It is guaranteed that some features are broken. You might still be able to use the template. It is HIGHLY recommended that you download all templates and update Blue Marble\'s template storage before continuing. (Reason: MAJOR version mismatch)',this.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="Dead");const s=`
If you want to continue using your current templates, then make sure the template storage (schema) is up-to-date.
If you don't want to update the template storage, then downgrade Blue Marble to version ${r(this.scriptVersion)} to continue using your templates.
Alternatively, if you don't care about corrupting the templates listed below, you can fix any issues with the template storage by uploading a new template.`;this.$t("#bm-l",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.${"Good"!=this.Ht?s:""}`);const o=new D(this.name,this.version);"Dead"!=this.Ht&&(o.G({class:"bm-B bm-u bm-b",style:"gap: 1.5ch;"}),o.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt._t().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||o.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,M,S).call(this,!0)}}).W(),o.W()._(document.querySelector("#bm-l").parentNode)},C=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-x`),n=new D(this.name,this.version);n.G({id:"bm-o",class:"bm-B"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt.Gt),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-B bm-u"}).G({class:"bm-u",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-u bm-0"}).J(3,{textContent:r}).W().j({textContent:`Uploaded by user #${u}`}).W().j({textContent:`Coordinates: ${l.join(", ")}`}).W().j({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},S=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-f`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-B"}).G({class:"bm-B bm-b"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-B"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new x({displayName:n.name,$:n.tiles});t.O();const e=await this.Pt.Ut(t);await this.Pt.zt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new k(this.name,this.version,this.At,this.Pt).Wt())};var O,L,N,B,I=k;O=new WeakSet,L=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},N=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new I(this.name,this.version,this.schemaVersion,this).Wt(),this.jt=await async function({T:t,Rt:n,jt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new x({displayName:l,p:s||this.jt?.length||0,v:r||""});p.C=c,p.$=m,p.M=d,i.push(p),console.log(this.jt),console.log("^^^ This ^^^")}}return i}({T:this.T,Rt:this.Rt,jt:this.jt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var H=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=$.slice(1)}ee(t){const e=document.createElement("div");for(let t=0;t{t.parentNode.childElementCount<=1?t.parentNode.remove():t.remove()},e.appendChild(t)}t.appendChild(e)}},A=class extends HTMLElement{};customElements.define("confetti-piece",A);var P,W,_,G,U,z,F,j,R,Y=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-J-credits",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():this.window=this.G({id:this.Nt,class:"bm-J"},(t,e)=>{}).Ct().yt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Dt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-k",textContent:"šŸžŖ","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-f"}).G({class:"bm-B bm-b"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-B bm-x"}).j({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",style:"white-space: pre;"}).W().q().W().X().W().q().W().j({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().j({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().j({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().j({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().j({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().W().W().W()._(this.Bt)}},E=class extends D{constructor(t){super(t.name,t.version),e(this,P),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.Pt=t.N?.Pt,this.ne='',this.ie='';const{palette:n,L:i}=this.Pt.Xt;this.palette=n,this.se=0,this.oe=0}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-J"},(t,e)=>{}).Ct().yt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Dt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-k",textContent:"šŸžŖ","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-f"}).G({class:"bm-B bm-b"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-B bm-p bm-b",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,P,G).call(this,!1)}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,P,G).call(this,!0)}).W().W().G({class:"bm-B bm-x"}).G({class:"bm-B",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-B"}).j({id:"bm-c",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().j({id:"bm-7",innerHTML:"Correct Pixels: ???"}).W().q().W().j({id:"bm-d",innerHTML:"Total Pixels: ???"}).W().q().W().j({id:"bm-3",innerHTML:"Complete: ??? (???)"}).W().q().W().j({id:"bm-4",innerHTML:"??? ???"}).W().W().G({class:"bm-B"}).U({innerHTML:`Colors with the icon ${this.ne.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,P,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.kt(`#${this.Nt}.bm-J`,`#${this.Nt} .bm-H`);const t=document.querySelector(`#${this.Nt} .bm-B.bm-x`);let e=0,i=0;const r=new Map,l=new Map;for(const t of this.Pt.jt){e+=t.C?.total??0??0;const n=t.C?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=l.get(t)??0;l.set(t,i+n)}const s=t.C?.correct??{};this.se+=Object.keys(s).length,this.oe+=Object.keys(t.$).length;for(const t of Object.values(s))for(const[e,n]of t){const t=Number(n)||0;i+=t;const s=r.get(e)??0;r.set(e,s+t)}}console.log(`Tiles loaded: ${this.se} / ${this.oe}`),i>=e&&e&&this.se==this.oe&&(new H).ee(document.querySelector(`#${this.Nt}`));const c=new Date(30*(e-i)*1e3+Date.now()),h=a(c);this.$t("#bm-c",`Tiles Loaded: ${s(this.se)} / ${s(this.oe)}`),this.$t("#bm-7",`Correct Pixels: ${s(i)}`),this.$t("#bm-d",`Total Pixels: ${s(e)}`),this.$t("#bm-3",`Remaining: ${s((e||0)-(i||0))} (${o(((e||0)-(i||0))/(e||1))})`),this.$t("#bm-4",`Completed at: `),n(this,P,W).call(this,t,r,l),n(this,P,_).call(this,"id","ascending",!1)}};P=new WeakSet,W=function(t,e,n){const i=new D(this.name,this.version);i.G({class:"bm-v"});for(const t of this.palette){const a=p(t.rgb);let r=1.05/(a+.05)>(a+.05)/.05?"white":"black";t.id||(r="transparent");const l="white"==r?"bm-9":"bm-a",c=n.get(t.id)??0,h=s(c);let m=0,d="0",u=o(1);0!=c&&(m=e.get(t.id)??"???","number"!=typeof m&&this.se==this.oe&&t.id&&(m=0),d="string"==typeof m?m:s(m),u=isNaN(m/c)?"???":o(m/c));const b=parseInt(c)-parseInt(m),f=!!this.Pt.qt.get(t.id);i.G({class:"bm-B bm-q bm-p","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(m))?"0":m,"data-total":c,"data-percent":"%"==u.slice(-1)?u.slice(0,-1):"0","data-incorrect":b||0}).G({class:"bm-5",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});`}).yt({class:"bm-r "+l,"data-state":f?"hidden":"shown","aria-label":f?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:f?this.ie.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.ie.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-y"):Number(i.getAttribute("data-total"))||i.classList.add("bm-y"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(".bm-v"),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-y"))continue;const n=e.querySelector(".bm-5 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=new WeakSet,z=function(){new E(this).Wt()},F=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-D"==e.id?(t.$t("bm-D",s?.[0]||""),t.$t("bm-E",s?.[1]||"")):1==s.length?t.$t(e.id,s?.[0]||""):(t.$t("bm-F",s?.[0]||""),t.$t("bm-G",s?.[1]||""),t.$t("bm-D",s?.[2]||""),t.$t("bm-E",s?.[3]||""))},j=new WeakSet,R=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var V=GM_info.script.name.toString(),J=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-N",V),e.setAttribute("bm-K","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-N")||"Blue Marble",n=t?.getAttribute("bm-K")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${i.size} Recieved IMAGE message about blob "${a}"`,n,""),console.log(`Blob fetch took %c${String(Math.floor(c/6e4)).padStart(2,"0")}:${String(Math.floor(c/1e3)%60).padStart(2,"0")}.${String(c%1e3).padStart(3,"0")}%c MM:SS.mmm`,n,""),console.log(i),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,n,"",a),i.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.toLocaleString()}\nTime Since Blink: ${String(Math.floor(o/6e4)).padStart(2,"0")}:${String(Math.floor(o/1e3)%60).padStart(2,"0")}.${String(o%1e3).padStart(3,"0")} MM:SS.mmm`),console.error("Exception stack:",s),console.groupEnd()})}return o}});var X=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-J{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-H{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-H.bm-C{cursor:grabbing}.bm-J:has(.bm-H.bm-C){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-H.bm-C{pointer-events:auto}.bm-I{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-J h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-H h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:3px 0px rgba(21,48,99,.5),-3px 0px rgba(21,48,99,.5),0px 3px rgba(21,48,99,.5),0px -3px rgba(21,48,99,.5),3px 3px rgba(21,48,99,.5),-3px 3px rgba(21,48,99,.5),3px -3px rgba(21,48,99,.5),-3px -3px rgba(21,48,99,.5)}.bm-H div:has(h1){display:contents}.bm-J h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-J h3{display:inline-block;font-size:large;font-weight:700}.bm-B.bm-b{width:fit-content;margin-left:auto;margin-right:auto}.bm-B{margin:.5em 0}.bm-J button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-J button:hover,.bm-J button:focus-visible{background-color:#1061e5}.bm-J button:active,.bm-J button:disabled{background-color:#2e97ff}.bm-J button:disabled{text-decoration:line-through}.bm-k{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-z{vertical-align:middle}.bm-z svg{width:50%;margin:0 auto;fill:#111}.bm-J button.bm-r{background-color:unset}.bm-r.bm-9:hover,.bm-r.bm-9:focus{background-color:#ffffff2b}.bm-r.bm-9:active{background-color:#ffffff38}.bm-r.bm-a:hover,.bm-r.bm-a:focus{background-color:#0000002b}.bm-r.bm-a:active{background-color:#00000038}input[type=number].bm-s{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-s::-webkit-outer-spin-button,input[type=number].bm-s::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-A)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-A,input[type=file]{display:none!important;visibility:hidden!important;position:absolute!important;left:-9999px!important;top:-9999px!important;width:0!important;height:0!important;opacity:0!important;z-index:-9999!important;pointer-events:none!important}.bm-J select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-J label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-J input[type=checkbox]{width:1em}.bm-f{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-J textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-J a:not(:has(*)){text-decoration:underline}.bm-J small{font-size:x-small;color:#d3d3d3}.bm-J ul li{list-style:disc;margin-left:5ch}.bm-J .bm-B.bm-x{max-height:calc(80vh - 150px);overflow:auto}.bm-p{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-u{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}#bm-m p svg{display:inline;height:1em;fill:#fff}.bm-v{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}.bm-q{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}.bm-q:hover,.bm-q:focus-within{background-color:#112855e6}.bm-5{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}.bm-q[data-id="-2"] .bm-5{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}.bm-q[data-id="-1"] .bm-5{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}.bm-q[data-id="-1"] .bm-5 svg{fill:#fff!important}.bm-q[data-id="0"] .bm-5{background-color:transparent!important}#bm-m .bm-5 button{padding:.75em .5ch}.bm-5 svg{width:4ch}.bm-q>.bm-p{flex-direction:column;align-items:flex-start;gap:0}.bm-q small{font-size:.75em}#bm-m .bm-q.bm-y{display:none}#bm-t{max-width:300px}#bm-o{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-o>.bm-B{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-o>.bm-B:hover,#bm-o>.bm-B:focus-within{background-color:#112855e6}#bm-o .bm-1{height:100%;font-size:xxx-large}#bm-o .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(X);var q,Q="@font-face{font-family:'Roboto Mono';font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAADGIAA4AAAAAWngAADEuAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHDQGYD9TVEFUSACEThEICoGbAPoCC4NKAAE2AiQDg0oEIAWEWAeEYQwHGzdHsxERbBwIgEaWFUXpovSC/zKBG0OsPsALHwg+NI1SpzSGCOqReFjIyBOMluTO77d+stdLxT8578xk8qTZE3w1OkJLH/HCf/x+7dyZJ38RsxRVsnqjLjUQIiGSyJtptC9XNc3uBUH3jMC+IPGCwECyDmFX89mpyks+JIiJf6k8fvmlMgTb7HBGzQZtEAQxQERakSoRUQFtQsyY02nPpbWwNnW6NDZla5z75dci42ORHwuCaq3Kmj0ET+QQ1DlUpAkssLsnhSTshycLrNy5f+5lOA2/t5MLU2NQJiJXK72oo8DYDLlCiWoygX9gnU3olU+HAod+kuJDaft726r09zRd1TAn9L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DCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";Q.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(Q)):((q=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",q.rel="preload",q.as="style",q.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(q)),new class{constructor(){this.ae=null,this.re=null,this.le="#bm-g"}ce(t){return this.re=t,this.ae=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.le)}),this}he(){return this.ae}observe(t,e=!1,n=!1){t.observe(this.re,{childList:e,subtree:n})}};var Z=new class extends D{constructor(t,n){super(t,n),e(this,U),this.window=null,this.Nt="bm-t",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Ot("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-J",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Ct().yt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Dt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-f"}).G({class:"bm-B"}).V({class:"bm-I",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7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Z84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new H).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-B"}).j({id:"bm-n",textContent:"Droplets:"}).W().q().W().j({id:"bm-h",textContent:"Next level in..."}).W().q().W().j({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.me=e.id}).W().W().W().X().W().G({class:"bm-B"}).G({class:"bm-B"}).yt({class:"bm-k bm-z",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.de;e?.[0]?(t.$t("bm-F",e?.[0]||""),t.$t("bm-G",e?.[1]||""),t.$t("bm-D",e?.[2]||""),t.$t("bm-E",e?.[3]||"")):t.Ot("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().xt({type:"number",id:"bm-F",class:"bm-s",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,U,F).call(this,t,e,i))}).W().xt({type:"number",id:"bm-G",class:"bm-s",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,U,F).call(this,t,e,i))}).W().xt({type:"number",id:"bm-D",class:"bm-s",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,U,F).call(this,t,e,i))}).W().xt({type:"number",id:"bm-E",class:"bm-s",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,U,F).call(this,t,e,i))}).W().W().G({class:"bm-B"}).Mt({class:"bm-A",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-B bm-p"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ue(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Lt("Disabled templates!")):(t.N?.Pt?.ue(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Lt("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-A`),n=document.querySelector("#bm-F");if(!n.checkValidity())return n.reportValidity(),void t.Ot("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-G");if(!i.checkValidity())return i.reportValidity(),void t.Ot("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-D");if(!s.checkValidity())return s.reportValidity(),void t.Ot("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-E");if(!o.checkValidity())return o.reportValidity(),void t.Ot("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.zt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Lt("Drew to canvas!")):t.Ot("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,U,z).call(this)}).W().W().G({class:"bm-B"}).Tt({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-B bm-p",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-p"}).yt({class:"bm-k",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new I(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-k",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-k",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-k",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-k",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new Y(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.kt(`#${this.Nt}.bm-J`,`#${this.Nt} .bm-H`))}}(V,J),K=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.be=null,this.Gt="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.T=1e3,this.Rt=3,this.Jt=3,this.Xt=function(t){const e=$;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,L:n}}(this.Jt),this.Et=null,this.pe="",this.jt=[],this.Ft=null,this.fe=!0,this.ge=null,this.qt=new Map}async we(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async zt(t,e,i){this.Ft||(this.Ft=await this.we(),console.log("Creating JSON...")),this.I.Lt(`Creating template at ${i.join(", ")}...`);const s=new x({displayName:e,p:0,v:m(this.be||0,this.Gt),file:t,coords:i}),{D:o,k:a}=await s.S(this.T,this.Xt);s.$=o;const r={total:s.C.total,colors:Object.fromEntries(s.C.colors)};this.Ft.templates[`${s.p} ${s.v}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.jt=[],this.jt.push(s),this.I.Lt(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.jt),console.log(JSON.stringify(this.Ft)),await n(this,O,L).call(this)}ye(){}async ve(){this.Ft||(this.Ft=await this.we(),console.log("Creating JSON..."))}async $e(){l("Downloading all templates..."),console.log(this.jt);for(const t of this.jt)await this.xe(t),await i(500)}async _t(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.xe(new x({displayName:n.name,p:e.split(" ")?.[0],v:e.split(" ")?.[1],$:n.tiles})),await i(500))}async xe(t){t.O();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Ut(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",Me:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Ut(t){console.log(t);const e=t.$,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.T+c,u=l*this.T+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Rt),r=Math.max(r,u+m.height/this.Rt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o;console.log(`Template Width: ${l}\nTemplate Height: ${c}`);const h=new OffscreenCanvas(l,c),m=h.getContext("2d");return m.imageSmoothingEnabled=!1,n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.T+r,d=a*this.T+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${d}) at (${h-s}, ${d-o}) on the canvas...`),m.drawImage(c,h-s,d-o,c.width/this.Rt,c.height/this.Rt)}),h.convertToBlob({type:"image/png"})}async Te(t,e){if(!this.fe)return t;const i=this.T*this.Rt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.jt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.$).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{Ce:t,Se:t.$[e],M:t.M?.[e],De:[n[0],n[1]],ke:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Lt(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.$).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.C.total||0),0));this.I.Lt(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t.Ce.C?.colors?.get(-1);let s=t.M.slice();const o=Number(t.ke[0])*this.Rt,a=Number(t.ke[1])*this.Rt;if(0!=this.qt.size||i||h.drawImage(t.Se,o,a),!s){const e=h.getImageData(o,a,t.Se.width,t.Se.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,B).call(this,{Yt:d,Et:s,Vt:[o,a,t.Se.width,t.Se.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Se.width,t.Se.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ce.C.correct&&(t.Ce.C.correct={}),t.Ce.C.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Oe(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,N).call(this,t)}ue(t){this.fe=t}}(V,J,Z),tt=new class{constructor(t){this.Pt=t,this.Le=!1,this.me="",this.de=[],this.Ne=[]}Be(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(i.status&&"2"!=i.status?.toString()[0])return void t.Ot("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.be=i.id,0!=this.me.length){const t=document.querySelector("#"+this.me);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.$t("bm-n",`Droplets: ${s(i.droplets)}`),t.$t("bm-h",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.de.length&&(!o.length||!c.length))return void t.Ot("Coordinates are malformed!\nDid you try clicking the canvas first?");this.de=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-g");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-g",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.Te(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.Le="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ie(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.He(n),s=this.Ae(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async He(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ae(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(K);Z.P(tt);var et=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(et),K.Oe(et);var nt=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(nt),console.log(Object.keys(nt).length),0==Object.keys(nt).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>tt.Ie(J),18e5);var it=nt?.telemetry;if(console.log(`Telemetry is ${!(null==it)}`),null==it||it>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,j),this.window=null,this.Nt="bm-e",this.Bt=document.body,this.Pe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Ot("Telemetry window already exists!");const t=await this.N.He(navigator.userAgent),e=this.N.Ae(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-J",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-f"}).G({class:"bm-B bm-b"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-B bm-u",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,j,R).call(this,this.Pe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,j,R).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-B bm-x"}).G({class:"bm-B"}).J(2,{textContent:"Legal"}).W().U({textContent:`We collect anonymous telemetry data such as your browser, OS, and script version to make the experience better for everyone. The data is never shared personally. The data is never sold. You can turn this off by pressing the "Disable" button, but keeping it on helps us improve features and reliability faster. Thank you for supporting ${this.name}!`}).W().W().X().W().G({class:"bm-B"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(V,J,1,nt?.uuid);t.P(tt),t.Wt()}Z.Wt(),tt.Be(Z),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-w");if(!i){i=document.createElement("button"),i.id="bm-w",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${V}%c (${J}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.css b/dist/BlueMarble.user.css index 0e8e32c..4b48179 100644 --- a/dist/BlueMarble.user.css +++ b/dist/BlueMarble.user.css @@ -1 +1 @@ -#bm-m p svg{display:inline;height:1em;fill:#fff}.bm-v{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}.bm-q{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}.bm-q:hover,.bm-q:focus-within{background-color:#112855e6}.bm-5{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}.bm-q[data-id="-2"] .bm-5{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}.bm-q[data-id="-1"] .bm-5{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}.bm-q[data-id="-1"] .bm-5 svg{fill:#fff!important}.bm-q[data-id="0"] .bm-5{background-color:transparent!important}.bm-5 button{padding:.75em .5ch}.bm-5 svg{width:4ch}.bm-q>.bm-p{flex-direction:column;align-items:flex-start;gap:0}.bm-q small{font-size:.75em}#bm-m .bm-q.bm-y{display:none}#bm-t{max-width:300px}#bm-o{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-o>.bm-B{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-o>.bm-B:hover,#bm-o>.bm-B:focus-within{background-color:#112855e6}#bm-o .bm-1{height:100%;font-size:xxx-large}#bm-o .bm-0{flex-direction:column;align-items:flex-start;gap:0}div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-J{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-H{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-H.bm-C{cursor:grabbing}.bm-J:has(.bm-H.bm-C){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-H.bm-C{pointer-events:auto}.bm-I{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-J h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-H h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:3px 0px rgba(21,48,99,.5),-3px 0px rgba(21,48,99,.5),0px 3px rgba(21,48,99,.5),0px -3px rgba(21,48,99,.5),3px 3px rgba(21,48,99,.5),-3px 3px rgba(21,48,99,.5),3px -3px rgba(21,48,99,.5),-3px -3px rgba(21,48,99,.5)}.bm-H div:has(h1){display:contents}.bm-J h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-J h3{display:inline-block;font-size:large;font-weight:700}.bm-B.bm-b{width:fit-content;margin-left:auto;margin-right:auto}.bm-B{margin:.5em 0}.bm-J button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-J button:hover,.bm-J button:focus-visible{background-color:#1061e5}.bm-J button:active,.bm-J button:disabled{background-color:#2e97ff}.bm-J button:disabled{text-decoration:line-through}.bm-k{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-z{vertical-align:middle}.bm-z svg{width:50%;margin:0 auto;fill:#111}.bm-J button.bm-r{background-color:unset}.bm-r.bm-9:hover,.bm-r.bm-9:focus{background-color:#ffffff2b}.bm-r.bm-9:active{background-color:#ffffff38}.bm-r.bm-a:hover,.bm-r.bm-a:focus{background-color:#0000002b}.bm-r.bm-a:active{background-color:#00000038}input[type=number].bm-s{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-s::-webkit-outer-spin-button,input[type=number].bm-s::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-A)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-A,input[type=file]{display:none!important;visibility:hidden!important;position:absolute!important;left:-9999px!important;top:-9999px!important;width:0!important;height:0!important;opacity:0!important;z-index:-9999!important;pointer-events:none!important}.bm-J select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-J label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-J input[type=checkbox]{width:1em}.bm-f{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-J textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-J small{font-size:x-small;color:#d3d3d3}.bm-J ul li{list-style:disc;margin-left:5ch}.bm-J .bm-B.bm-x{max-height:calc(80vh - 150px);overflow:auto}.bm-p{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-u{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch} +div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-J{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-H{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-H.bm-C{cursor:grabbing}.bm-J:has(.bm-H.bm-C){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-H.bm-C{pointer-events:auto}.bm-I{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-J h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-H h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:3px 0px rgba(21,48,99,.5),-3px 0px rgba(21,48,99,.5),0px 3px rgba(21,48,99,.5),0px -3px rgba(21,48,99,.5),3px 3px rgba(21,48,99,.5),-3px 3px rgba(21,48,99,.5),3px -3px rgba(21,48,99,.5),-3px -3px rgba(21,48,99,.5)}.bm-H div:has(h1){display:contents}.bm-J h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-J h3{display:inline-block;font-size:large;font-weight:700}.bm-B.bm-b{width:fit-content;margin-left:auto;margin-right:auto}.bm-B{margin:.5em 0}.bm-J button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-J button:hover,.bm-J button:focus-visible{background-color:#1061e5}.bm-J button:active,.bm-J button:disabled{background-color:#2e97ff}.bm-J button:disabled{text-decoration:line-through}.bm-k{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-z{vertical-align:middle}.bm-z svg{width:50%;margin:0 auto;fill:#111}.bm-J button.bm-r{background-color:unset}.bm-r.bm-9:hover,.bm-r.bm-9:focus{background-color:#ffffff2b}.bm-r.bm-9:active{background-color:#ffffff38}.bm-r.bm-a:hover,.bm-r.bm-a:focus{background-color:#0000002b}.bm-r.bm-a:active{background-color:#00000038}input[type=number].bm-s{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-s::-webkit-outer-spin-button,input[type=number].bm-s::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-A)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-A,input[type=file]{display:none!important;visibility:hidden!important;position:absolute!important;left:-9999px!important;top:-9999px!important;width:0!important;height:0!important;opacity:0!important;z-index:-9999!important;pointer-events:none!important}.bm-J select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-J label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-J input[type=checkbox]{width:1em}.bm-f{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-J textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-J a:not(:has(*)){text-decoration:underline}.bm-J small{font-size:x-small;color:#d3d3d3}.bm-J ul li{list-style:disc;margin-left:5ch}.bm-J .bm-B.bm-x{max-height:calc(80vh - 150px);overflow:auto}.bm-p{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-u{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}#bm-m p svg{display:inline;height:1em;fill:#fff}.bm-v{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}.bm-q{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}.bm-q:hover,.bm-q:focus-within{background-color:#112855e6}.bm-5{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}.bm-q[data-id="-2"] .bm-5{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}.bm-q[data-id="-1"] .bm-5{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}.bm-q[data-id="-1"] .bm-5 svg{fill:#fff!important}.bm-q[data-id="0"] .bm-5{background-color:transparent!important}#bm-m .bm-5 button{padding:.75em .5ch}.bm-5 svg{width:4ch}.bm-q>.bm-p{flex-direction:column;align-items:flex-start;gap:0}.bm-q small{font-size:.75em}#bm-m .bm-q.bm-y{display:none}#bm-t{max-width:300px}#bm-o{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-o>.bm-B{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-o>.bm-B:hover,#bm-o>.bm-B:focus-within{background-color:#112855e6}#bm-o .bm-1{height:100%;font-size:xxx-large}#bm-o .bm-0{flex-direction:column;align-items:flex-start;gap:0} diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index fe3528a..c6251d0 100644 --- a/dist/BlueMarble.user.js +++ b/dist/BlueMarble.user.js @@ -2,7 +2,7 @@ // @name Blue Marble // @name:en Blue Marble // @namespace https://github.com/SwingTheVine/ -// @version 0.90.0 +// @version 0.90.17 // @description A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @description:en A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @author SwingTheVine @@ -30,4 +30,4 @@ // License --> https://www.mozilla.org/en-US/MPL/2.0/ // Donate --> https://ko-fi.com/swingthevine -(()=>{var t=t=>{throw TypeError(t)},e=(e,i,n)=>i.has(e)?t("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,n),i=(e,i,n)=>(((e,i)=>{i.has(e)||t("Cannot access private method")})(e,i),n);function n(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function a(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function o(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function r(...t){(0,console.log)(...t)}function l(...t){(0,console.error)(...t)}function c(...t){(0,console.warn)(...t)}function h(t,e){if(0===t)return e[0];let i="";const n=e.length;for(;t>0;)i=e[t%n]+i,t=Math.floor(t/n);return i}function m(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&l(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function d(t){let e="";for(let i=0;i(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}var p,f,w,g,y,v=[{id:0,premium:!1,name:"Transparent",rgb:[0,0,0]},{id:1,premium:!1,name:"Black",rgb:[0,0,0]},{id:2,premium:!1,name:"Dark Gray",rgb:[60,60,60]},{id:3,premium:!1,name:"Gray",rgb:[120,120,120]},{id:4,premium:!1,name:"Light Gray",rgb:[210,210,210]},{id:5,premium:!1,name:"White",rgb:[255,255,255]},{id:6,premium:!1,name:"Deep Red",rgb:[96,0,24]},{id:7,premium:!1,name:"Red",rgb:[237,28,36]},{id:8,premium:!1,name:"Orange",rgb:[255,127,39]},{id:9,premium:!1,name:"Gold",rgb:[246,170,9]},{id:10,premium:!1,name:"Yellow",rgb:[249,221,59]},{id:11,premium:!1,name:"Light Yellow",rgb:[255,250,188]},{id:12,premium:!1,name:"Dark Green",rgb:[14,185,104]},{id:13,premium:!1,name:"Green",rgb:[19,230,123]},{id:14,premium:!1,name:"Light Green",rgb:[135,255,94]},{id:15,premium:!1,name:"Dark Teal",rgb:[12,129,110]},{id:16,premium:!1,name:"Teal",rgb:[16,174,166]},{id:17,premium:!1,name:"Light Teal",rgb:[19,225,190]},{id:18,premium:!1,name:"Dark Blue",rgb:[40,80,158]},{id:19,premium:!1,name:"Blue",rgb:[64,147,228]},{id:20,premium:!1,name:"Cyan",rgb:[96,247,242]},{id:21,premium:!1,name:"Indigo",rgb:[107,80,246]},{id:22,premium:!1,name:"Light Indigo",rgb:[153,177,251]},{id:23,premium:!1,name:"Dark Purple",rgb:[120,12,153]},{id:24,premium:!1,name:"Purple",rgb:[170,56,185]},{id:25,premium:!1,name:"Light Purple",rgb:[224,159,249]},{id:26,premium:!1,name:"Dark Pink",rgb:[203,0,122]},{id:27,premium:!1,name:"Pink",rgb:[236,31,128]},{id:28,premium:!1,name:"Light Pink",rgb:[243,141,169]},{id:29,premium:!1,name:"Dark Brown",rgb:[104,70,52]},{id:30,premium:!1,name:"Brown",rgb:[149,104,42]},{id:31,premium:!1,name:"Beige",rgb:[248,178,119]},{id:32,premium:!0,name:"Medium Gray",rgb:[170,170,170]},{id:33,premium:!0,name:"Dark Red",rgb:[165,14,30]},{id:34,premium:!0,name:"Light Red",rgb:[250,128,114]},{id:35,premium:!0,name:"Dark Orange",rgb:[228,92,26]},{id:36,premium:!0,name:"Light Tan",rgb:[214,181,148]},{id:37,premium:!0,name:"Dark Goldenrod",rgb:[156,132,49]},{id:38,premium:!0,name:"Goldenrod",rgb:[197,173,49]},{id:39,premium:!0,name:"Light Goldenrod",rgb:[232,212,95]},{id:40,premium:!0,name:"Dark Olive",rgb:[74,107,58]},{id:41,premium:!0,name:"Olive",rgb:[90,148,74]},{id:42,premium:!0,name:"Light Olive",rgb:[132,197,115]},{id:43,premium:!0,name:"Dark Cyan",rgb:[15,121,159]},{id:44,premium:!0,name:"Light Cyan",rgb:[187,250,242]},{id:45,premium:!0,name:"Light Blue",rgb:[125,199,255]},{id:46,premium:!0,name:"Dark Indigo",rgb:[77,49,184]},{id:47,premium:!0,name:"Dark Slate Blue",rgb:[74,66,132]},{id:48,premium:!0,name:"Slate Blue",rgb:[122,113,196]},{id:49,premium:!0,name:"Light Slate Blue",rgb:[181,174,241]},{id:50,premium:!0,name:"Light Brown",rgb:[219,164,99]},{id:51,premium:!0,name:"Dark Beige",rgb:[209,128,81]},{id:52,premium:!0,name:"Light Beige",rgb:[255,197,165]},{id:53,premium:!0,name:"Dark Peach",rgb:[155,82,73]},{id:54,premium:!0,name:"Peach",rgb:[209,128,120]},{id:55,premium:!0,name:"Light Peach",rgb:[250,182,164]},{id:56,premium:!0,name:"Dark Tan",rgb:[123,99,82]},{id:57,premium:!0,name:"Tan",rgb:[156,132,107]},{id:58,premium:!0,name:"Dark Slate",rgb:[51,57,65]},{id:59,premium:!0,name:"Slate",rgb:[109,117,141]},{id:60,premium:!0,name:"Light Slate",rgb:[179,185,209]},{id:61,premium:!0,name:"Dark Stone",rgb:[109,100,63]},{id:62,premium:!0,name:"Stone",rgb:[148,140,107]},{id:63,premium:!0,name:"Light Stone",rgb:[205,197,158]}],x=class{constructor({displayName:t="My template",o:i=0,l:n="",url:s="",file:a=null,coords:o=null,h:r=null,m:l={},u:c=1e3}={}){e(this,p),this.displayName=t,this.o=i,this.l=n,this.url=s,this.file=a,this.coords=o,this.h=r,this.m=l,this.u=c,this.p={total:0,colors:new Map}}async v(t,e){const n=await createImageBitmap(this.file),s=n.width,a=n.height;this.u=t;const o={},r={},l=new OffscreenCanvas(this.u,this.u),c=l.getContext("2d",{M:!0});l.width=s,l.height=a,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,p,f).call(this,c.getImageData(0,0,s,a),e);let u=0;for(const[t,e]of m)0!=t&&(u+=e);this.p={total:u,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),w=b.getContext("2d");w.clearRect(0,0,3,3),w.fillStyle="white",w.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,a,o]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const o=a.get(n);a.set(n,o?o+1:1)}return a};var M,T,$,C,S=class{constructor(t,i){e(this,w),this.name=t,this.version=i,this.D=null,this.O="bm-i",this.k=null,this.L=null,this.N=[]}B(t){this.D=t}I(){return this.N.length>0&&(this.L=this.N.pop()),this}A(t){t?.appendChild(this.k),this.k=null,this.L=null,this.N=[]}H(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"div",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"p",{},t)),this}W(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"small",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"span",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"details",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"summary",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"img",{},t)),this}j(t,e={},n=()=>{}){return n(this,i(this,w,g).call(this,"h"+t,{},e)),this}R(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"hr",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"br",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"form",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"fieldset",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"legend",{},t)),this}q(t={},e=()=>{}){const n=i(this,w,g).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,w,g).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.I(),e(this,n,s),this}Z(t={},e=()=>{}){const n=i(this,w,g).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.I(),e(this,n,i(this,w,g).call(this,"select",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"option",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"ol",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"ul",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"menu",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"li",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"table",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"caption",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"thead",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"tbody",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"tfoot",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"tr",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"th",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"td",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"button",{},t)),this}ft(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-M",onclick:()=>{this.wt(this.O,n)}};return e(this,i(this,w,g).call(this,"button",s,t)),this}gt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"input",{},t)),this}yt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,w,g).call(this,"div"),a=i(this,w,g).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.I();const o=i(this,w,g).call(this,"button",{textContent:n});return this.I(),this.I(),o.addEventListener("click",()=>{a.click()}),a.addEventListener("change",()=>{o.style.maxWidth=`${o.offsetWidth}px`,a.files.length>0?o.textContent=a.files[0].name:o.textContent=n}),e(this,s,a,o),this}vt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"textarea",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"div",{class:"bm-H"},t)),this}Mt(t=Date.now(),e=500,n={},s=()=>{}){const a="bm-L",o=n?.id||a+"-"+crypto.randomUUID().slice(0,8),r={class:a},l=i(this,w,g).call(this,"time",r,n);return l.id=o,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),i=Math.floor(e/3600),n=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${i}H${s}M${n}S`),l.textContent=String(i).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(n).padStart(2,"0")},e),s(this,l),this}wt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Tt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-J"),i=t.closest(".bm-H"),n=e.querySelector("h1"),s=e.querySelector(".bm-f");if(e.parentElement.append(e),"expanded"==t.dataset.buttonStatus){s.style.height=s.scrollHeight+"px",e.style.width=e.scrollWidth+"px",s.style.height="0",s.addEventListener("transitionend",function e(){s.style.display="none",t.disabled=!1,t.style.textDecoration="",s.removeEventListener("transitionend",e)});const i=n.cloneNode(!0),a=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${a}"`}else{const n=i.querySelector("h1"),a=n.textContent;n.remove(),s.style.display="",s.style.height="0",e.style.width="",s.style.height=s.scrollHeight+"px",s.addEventListener("transitionend",function e(){s.style.height="",t.disabled=!1,t.style.textDecoration="",s.removeEventListener("transitionend",e)}),t.textContent="ā–¼",t.dataset.buttonStatus="expanded",t.ariaLabel=`Minimize window "${a}"`}}$t(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Ct(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,a=!1,o=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(a){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,i.style.transform=`translate(${l}px, ${c}px)`,i.style.left="0px",i.style.top="0px",i.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{a=!0,d=i.getBoundingClientRect(),s=t-d.left,o=e-d.top;const b=window.getComputedStyle(i).transform;if(b&&"none"!==b){const t=new DOMMatrix(b);l=t.m41,c=t.m42}else l=d.left,c=d.top;h=l,m=c,document.body.style.userSelect="none",n.classList.add("bm-C"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{a=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-C"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",w),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{a&&d&&(h=t.clientX-s,m=t.clientY-o)},w=t=>{if(a&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-o,t.preventDefault()}};n.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),n.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}St(t){(0,console.info)(`${this.name}: ${t}`),this.wt(this.O,"Status: "+t,!0)}Ct(t){(0,console.error)(`${this.name}: ${t}`),this.wt(this.O,"Error: "+t,!0)}};w=new WeakSet,g=function(t,e={},n={}){const s=document.createElement(t);this.k?(this.L?.appendChild(s),this.N.push(this.L),this.L=s):(this.k=s,this.L=s);for(const[t,n]of Object.entries(e))i(this,w,y).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,w,y).call(this,s,t,e);return s},y=function(t,e,i){if("class"==e)t.classList.add(...i.split(/\s+/));else if("for"==e)t.htmlFor=i;else if("tabindex"==e)t.tabIndex=Number(i);else if("readonly"==e)t.readOnly="true"==i||"1"==i;else if("maxlength"==e)t.maxLength=Number(i);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i;else if(e.startsWith("aria")){const n=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+n[0].toUpperCase()+n.slice(1)]=i}else t[e]=i};var D=class extends S{constructor(t,i,n,s=void 0){super(t,i),e(this,M),this.window=null,this.Dt="bm-j",this.Ot=document.body,this.kt=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.kt?.scriptVersion,this.schemaVersion=this.kt?.schemaVersion,this.Lt=void 0,this.Nt=n,this.Bt=s}It(){if(document.querySelector(`#${this.Dt}`))return void document.querySelector(`#${this.Dt}`).remove();let t="";document.querySelector("#bm-t")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.Dt,class:"bm-J",style:t},(t,e)=>{}).xt().bt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Tt(e),e.ontouchend=()=>{e.click()}}).I().H().I().bt({class:"bm-k",textContent:"šŸžŖ","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Dt}`)?.remove()},e.ontouchend=()=>{e.click()}}).I().I().H({class:"bm-f"}).H({class:"bm-B bm-b"}).j(1,{textContent:"Template Wizard"}).I().I().R().I().H({class:"bm-B"}).j(2,{textContent:"Status"}).I().P({id:"bm-l",textContent:"Loading template storage status..."}).I().I().H({class:"bm-B bm-x"}).j(2,{textContent:"Detected templates:"}).I().I().I().I().A(this.Ot),this.$t(`#${this.Dt}.bm-J`,`#${this.Dt} .bm-H`),i(this,M,T).call(this),i(this,M,$).call(this)}};M=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Nt.split(/[-\.\+]/);let n="";t[0]==e[0]?t[1]==e[1]?(n='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Lt="Good"):(n='Template storage health: Poor!
You can still use your template, but some features may not work. It is recommended that you update Blue Marble\'s template storage. (Reason: MINOR version mismatch)',this.Lt="Poor"):t[0]Bad!
It is guaranteed that some features are broken. You might still be able to use the template. It is HIGHLY recommended that you download all templates and update Blue Marble\'s template storage before continuing. (Reason: MAJOR version mismatch)',this.Lt="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Lt="Dead");const s=`
If you want to continue using your current templates, then make sure the template storage (schema) is up-to-date.
If you don't want to update the template storage, then downgrade Blue Marble to version ${o(this.scriptVersion)} to continue using your templates.
Alternatively, if you don't care about corrupting the templates listed below, you can fix any issues with the template storage by uploading a new template.`;this.wt("#bm-l",`${n}
Your templates were created during Blue Marble version ${o(this.scriptVersion)} with schema version ${o(this.schemaVersion)}.
The current Blue Marble version is ${o(this.version)} and requires schema version ${o(this.Nt)}.${"Good"!=this.Lt?s:""}`);const a=new S(this.name,this.version);"Dead"!=this.Lt&&(a.H({class:"bm-B bm-u bm-b",style:"gap: 1.5ch;"}),a.bt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Bt.At().then(()=>{e.disabled=!1})}}).I()),"Poor"!=this.Lt&&"Bad"!=this.Lt||a.bt({textContent:`Update template storage to ${this.Nt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,M,C).call(this,!0)}}).I(),a.I().A(document.querySelector("#bm-l").parentNode)},$=function(){const t=this.kt?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Dt} .bm-x`),i=new S(this.name,this.version);i.H({id:"bm-o",class:"bm-B"});for(const e in t){const n=e,a=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),o=m(t?.[1]||"0",this.Bt.Ht),r=a.name||`Template ${e||""}`,l=a?.coords?.split(",").map(Number),c=a.pixels?.total??void 0,h=void 0,d="number"==typeof e?s(e):"???",u="number"==typeof o?s(o):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-B bm-u"}).H({class:"bm-u",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).I().W({textContent:`#${d}`}).I().I().H({class:"bm-u bm-0"}).j(3,{textContent:r}).I().U({textContent:`Uploaded by user #${u}`}).I().U({textContent:`Coordinates: ${l.join(", ")}`}).I().U({textContent:`Total Pixels: ${b}`}).I().I().I()}}i.I().A(e)}},C=async function(t){if(t){const t=document.querySelector(`#${this.Dt} .bm-f`);t.innerHTML="",new S(this.name,this.version).H({class:"bm-B"}).H({class:"bm-B bm-b"}).j(1,{textContent:"Template Wizard"}).I().I().R().I().H({class:"bm-B"}).j(2,{textContent:"Status"}).I().P({textContent:"Updating template storage. Please wait..."}).I().I().I().A(t)}GM_deleteValue("bmCoords");const e=this.kt?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new x({displayName:i.name,h:i.tiles});t.C();const e=await this.Bt.Pt(t);await this.Bt.Wt(e,t.displayName,t.coords)}t&&(document.querySelector(`#${this.Dt}`).remove(),new D(this.name,this.version,this.Nt,this.Bt).It())};var O,k,L,N,B=D;O=new WeakSet,k=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ut))},L=async function(t){const e=t.templates,i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),a=t?.scriptVersion;n[0]==s[0]?(n[1]!=s[1]&&new B(this.name,this.version,this.schemaVersion,this).It(),this.Gt=await async function({u:t,zt:i,Gt:n}){if(Object.keys(e).length>0)for(const s in e){const a=s,o=e[s];if(e.hasOwnProperty(s)){const e=a.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=o.name||`Template ${s||""}`,c={total:o.pixels?.total,colors:new Map(Object.entries(o.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=o.tiles,m={},d={},b=t*i;for(const t in h)if(h.hasOwnProperty(t)){const e=u(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(b,b).getContext("2d");s.drawImage(n,0,0);const a=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(a.data.buffer)}const p=new x({displayName:l,o:s||this.Gt?.length||0,l:r||""});p.p=c,p.h=m,p.m=d,n.push(p)}}return n}({u:this.u,zt:this.zt,Gt:this.Gt})):n[0]>>24&255,w=b>>>24&255,g=m.get(p)??-2;if(this.Vt.get(g)&&(e[i*r+l]=b),-1==g){const t=536870912;this.Vt.get(g)?e[i*r+l]=0:(h/n&1)==(u/n&1)?(e[i*r+l]=t,e[(i-1)*r+(l-1)]=t,e[(i-1)*r+(l+1)]=t,e[(i+1)*r+(l-1)]=t,e[(i+1)*r+(l+1)]=t):(e[i*r+l]=0,e[(i-1)*r+l]=t,e[(i+1)*r+l]=t,e[i*r+(l-1)]=t,e[i*r+(l+1)]=t)}if(-1==g&&b<=c){const t=d.get(g);d.set(g,t?t+1:1);continue}if(f<=c||w<=c)continue;if((m.get(b)??-2)!=g)continue;const y=d.get(g);d.set(g,y?y+1:1)}return{Et:d,Xt:e}};var I,A,H,P,W=class{constructor(){this.Jt=Math.ceil(80/1300*window.innerWidth),this.qt=v.slice(1)}Qt(t){const e=document.createElement("div");for(let t=0;t{t.parentNode.childElementCount<=1?t.parentNode.remove():t.remove()},e.appendChild(t)}t.appendChild(e)}},U=class extends HTMLElement{};customElements.define("confetti-piece",U);var G,z,_,F,j,R=class extends S{constructor(t){super(t.name,t.version),e(this,I),this.window=null,this.Dt="bm-m",this.Ot=document.body,this.Bt=t.D?.Bt,this.Zt='',this.Kt='';const{palette:i,S:n}=this.Bt.Yt;this.palette=i,this.te=0,this.ee=0}It(){if(document.querySelector(`#${this.Dt}`))return void document.querySelector(`#${this.Dt}`).remove();this.window=this.H({id:this.Dt,class:"bm-J"},(t,e)=>{}).xt().bt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Tt(e),e.ontouchend=()=>{e.click()}}).I().H().I().bt({class:"bm-k",textContent:"šŸžŖ","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Dt}`)?.remove()},e.ontouchend=()=>{e.click()}}).I().I().H({class:"bm-f"}).H({class:"bm-B bm-b"}).j(1,{textContent:"Color Filter"}).I().I().R().I().H({class:"bm-B bm-p bm-b",style:"gap: 1.5ch;"}).bt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,I,P).call(this,!1)}).I().bt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,I,P).call(this,!0)}).I().I().H({class:"bm-B bm-x"}).H({class:"bm-B",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-B"}).U({id:"bm-c",innerHTML:"Tiles Loaded: 0 / ???"}).I().Y().I().U({id:"bm-7",innerHTML:"Correct Pixels: ???"}).I().Y().I().U({id:"bm-d",innerHTML:"Total Pixels: ???"}).I().Y().I().U({id:"bm-3",innerHTML:"Complete: ??? (???)"}).I().Y().I().U({id:"bm-4",innerHTML:"??? ???"}).I().I().H({class:"bm-B"}).P({innerHTML:`Colors with the icon ${this.Zt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Dt} form`)),n={};for(const[t,i]of e)n[t]=i;i(this,I,H).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).I().I().I().I().I().I().I().A(this.Ot),this.$t(`#${this.Dt}.bm-J`,`#${this.Dt} .bm-H`);const t=document.querySelector(`#${this.Dt} .bm-B.bm-x`);let e=0,n=0;const o=new Map,r=new Map;for(const t of this.Bt.Gt){e+=t.p?.total??0??0;const i=t.p?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=r.get(t)??0;r.set(t,n+i)}const s=t.p?.correct??{};this.te+=Object.keys(s).length,this.ee+=Object.keys(t.h).length;for(const t of Object.values(s))for(const[e,i]of t){const t=Number(i)||0;n+=t;const s=o.get(e)??0;o.set(e,s+t)}}n>=e&&e&&this.te==this.ee&&(new W).Qt(document.querySelector(`#${this.Dt}`));const l=new Date(30*(e-n)*1e3+Date.now()),c=l.toLocaleString(void 0,{ie:"long",ne:"numeric",se:"2-digit",ae:"2-digit",oe:"2-digit"});this.wt("#bm-c",`Tiles Loaded: ${s(this.te)} / ${s(this.ee)}`),this.wt("#bm-7",`Correct Pixels: ${s(n)}`),this.wt("#bm-d",`Total Pixels: ${s(e)}`),this.wt("#bm-3",`Remaining: ${s((e||0)-(n||0))} (${a(((e||0)-(n||0))/(e||1))})`),this.wt("#bm-4",`Completed at: `),i(this,I,A).call(this,t,o,r),i(this,I,H).call(this,"id","ascending",!1)}};I=new WeakSet,A=function(t,e,i){const n=new S(this.name,this.version);n.H({class:"bm-v"});for(const t of this.palette){const o=b(t.rgb);let r=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(r="transparent");const l="white"==r?"bm-9":"bm-a",c=i.get(t.id)??0,h=s(c);let m=0,d="0",u=a(1);0!=c&&(m=e.get(t.id)??"???","number"!=typeof m&&this.te==this.ee&&t.id&&(m=0),d="string"==typeof m?m:s(m),u=isNaN(m/c)?"???":a(m/c));const p=parseInt(c)-parseInt(m),f=!!this.Bt.Vt.get(t.id);n.H({class:"bm-B bm-q bm-p","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(m))?"0":m,"data-total":c,"data-percent":"%"==u.slice(-1)?u.slice(0,-1):"0","data-incorrect":p||0}).H({class:"bm-5",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});`}).bt({class:"bm-r "+l,"data-state":f?"hidden":"shown","aria-label":f?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:f?this.Kt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Kt.replace("{const a=n.getAttribute("data-"+t),o=s.getAttribute("data-"+t),r=parseFloat(a),l=parseFloat(o),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-y"):Number(n.getAttribute("data-total"))||n.classList.add("bm-y"),c&&h)return"ascending"===e?r-l:l-r;{const t=a.toLowerCase(),i=o.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},P=function(t){const e=document.querySelector(".bm-v"),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-y"))continue;const i=e.querySelector(".bm-5 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},G=new WeakSet,z=function(){new R(this).It()},_=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{r("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-D"==e.id?(t.wt("bm-D",s?.[0]||""),t.wt("bm-E",s?.[1]||"")):1==s.length?t.wt(e.id,s?.[0]||""):(t.wt("bm-F",s?.[0]||""),t.wt("bm-G",s?.[1]||""),t.wt("bm-D",s?.[2]||""),t.wt("bm-E",s?.[3]||""))},F=new WeakSet,j=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Y=GM_info.script.name.toString(),V=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-N",Y),e.setAttribute("bm-K","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-N")||"Blue Marble",i=t?.getAttribute("bm-K")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:a,blobID:o,blobData:r,blink:l}=t.data;if(Date.now(),"blue-marble"==s&&o&&r&&!a){const t=n.get(o);"function"==typeof t?t(r):c(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",o),n.delete(o)}});const s=window.fetch;window.fetch=async function(...t){const e=await s.apply(this,t),i=e.clone(),a=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",o=i.headers.get("content-type")||"";if(o.includes("application/json"))i.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:a,jsonData:t},"*")}).catch(t=>{});else if(o.includes("image/")&&!a.includes("openfreemap")&&!a.includes("maps")){const t=Date.now(),e=await i.blob();return new Promise(s=>{const o=crypto.randomUUID();n.set(o,t=>{s(new Response(t,{headers:i.headers,status:i.status,statusText:i.statusText}))}),window.postMessage({source:"blue-marble",endpoint:a,blobID:o,blobData:e,blink:t})}).catch(t=>{Date.now()})}return e}});var E=GM_getResourceText("CSS-BM-File");GM_addStyle(E);var X,J="robotoMonoInjectionPoint";J.indexOf("@font-face")+1?GM_addStyle(J):((X=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",X.rel="preload",X.as="style",X.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(X)),new class{constructor(){this.re=null,this.le=null,this.ce="#bm-g"}he(t){return this.le=t,this.re=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ce)}),this}me(){return this.re}observe(t,e=!1,i=!1){t.observe(this.le,{childList:e,subtree:i})}};var q=new class extends S{constructor(t,i){super(t,i),e(this,G),this.window=null,this.Dt="bm-t",this.Ot=document.body}It(){document.querySelector(`#${this.Dt}`)?this.Ct("Main window already exists!"):(this.window=this.H({id:this.Dt,class:"bm-J",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).xt().bt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Tt(e),e.ontouchend=()=>{e.click()}}).I().H().I().I().H({class:"bm-f"}).H({class:"bm-B"}).F({class:"bm-I",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new W).Qt(document.querySelector(`#${this.Dt}`))})}).I().j(1,{textContent:this.name}).I().I().R().I().H({class:"bm-B"}).U({id:"bm-n",textContent:"Droplets:"}).I().Y().I().U({id:"bm-h",textContent:"Next level in..."}).I().Y().I().U({textContent:"Charges: "}).Mt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.D.de=e.id}).I().I().I().R().I().H({class:"bm-B"}).H({class:"bm-B"}).bt({class:"bm-k bm-z",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.D?.ue;e?.[0]?(t.wt("bm-F",e?.[0]||""),t.wt("bm-G",e?.[1]||""),t.wt("bm-D",e?.[2]||""),t.wt("bm-E",e?.[3]||"")):t.Ct("Coordinates are malformed! Did you try clicking on the canvas first?")}}).I().gt({type:"number",id:"bm-F",class:"bm-s",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,_).call(this,t,e,n))}).I().gt({type:"number",id:"bm-G",class:"bm-s",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,_).call(this,t,e,n))}).I().gt({type:"number",id:"bm-D",class:"bm-s",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,_).call(this,t,e,n))}).I().gt({type:"number",id:"bm-E",class:"bm-s",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,_).call(this,t,e,n))}).I().I().H({class:"bm-B"}).yt({class:"bm-A",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).I().I().H({class:"bm-B bm-p"}).bt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.D?.Bt?.be(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.St("Disabled templates!")):(t.D?.Bt?.be(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.St("Enabled templates!")),e.disabled=!1}}).I().bt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Dt} .bm-A`),i=document.querySelector("#bm-F");if(!i.checkValidity())return i.reportValidity(),void t.Ct("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-G");if(!n.checkValidity())return n.reportValidity(),void t.Ct("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-D");if(!s.checkValidity())return s.reportValidity(),void t.Ct("Coordinates are malformed! Did you try clicking on the canvas first?");const a=document.querySelector("#bm-E");if(!a.checkValidity())return a.reportValidity(),void t.Ct("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.D?.Bt.Wt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(a.value)]),t.St("Drew to canvas!")):t.Ct("No file selected!")}}).I().bt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,G,z).call(this)}).I().I().H({class:"bm-B"}).vt({id:this.O,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).I().I().H({class:"bm-B bm-p",style:"margin-bottom: 0;"}).H({class:"bm-p"}).bt({class:"bm-k",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.D?.Bt;new B(this.name,this.version,e?.schemaVersion,e).It()}}).I().bt({class:"bm-k",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).I().bt({class:"bm-k",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).I().bt({class:"bm-k",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).I().W({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).I().I().I().I().I().A(this.Ot),this.$t(`#${this.Dt}.bm-J`,`#${this.Dt} .bm-H`))}}(Y,V),Q=new class{constructor(t,i,n){e(this,O),this.name=t,this.version=i,this.k=n,this.schemaVersion="2.0.0",this.pe=null,this.Ht="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.u=1e3,this.zt=3,this.Rt=3,this.Yt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],a=n.rgb[2];for(let o=-t;o<=t;o++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+o,c=s+r,h=a+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,S:i}}(this.Rt),this.Ft=null,this.fe="",this.Gt=[],this.Ut=null,this.we=!0,this.ge=null,this.Vt=new Map}async ye(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Wt(t,e,n){this.Ut||(this.Ut=await this.ye()),this.k.St(`Creating template at ${n.join(", ")}...`);const s=new x({displayName:e,o:0,l:h(this.pe||0,this.Ht),file:t,coords:n}),{T:a,$:o}=await s.v(this.u,this.Yt);s.h=a;const r={total:s.p.total,colors:Object.fromEntries(s.p.colors)};this.Ut.templates[`${s.o} ${s.l}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:o},this.Gt=[],this.Gt.push(s),this.k.St(`Template created at ${n.join(", ")}!`),await i(this,O,k).call(this)}ve(){}async xe(){this.Ut||(this.Ut=await this.ye())}async Me(){r("Downloading all templates...");for(const t of this.Gt)await this.Te(t),await n(500)}async At(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Te(new x({displayName:i.name,o:e.split(" ")?.[0],l:e.split(" ")?.[1],h:i.tiles})),await n(500))}async Te(t){t.C();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Pt(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",$e:"uniquify",onload:()=>{r(`Download of template '${e}' complete!`)},onerror:(t,i)=>{l(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{c(`Download of template '${e}' has timed out!`)}})}async Pt(t){const e=t.h,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,a=1/0,o=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.u+c,u=l*this.u+h;s=Math.min(s,d),a=Math.min(a,u),o=Math.max(o,d+m.width/this.zt),r=Math.max(r,u+m.height/this.zt)});const l=new OffscreenCanvas(o-s,r-a),c=l.getContext("2d");return c.imageSmoothingEnabled=!1,i.forEach((t,e)=>{const[i,o,r,l]=t.split(",").map(Number),h=n[e],m=i*this.u+r,d=o*this.u+l;c.drawImage(h,m-s,d-a,h.width/this.zt,h.height/this.zt)}),l.convertToBlob({type:"image/png"})}async Ce(t,e){if(!this.we)return t;const n=this.u*this.zt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0");const a=this.Gt;a.sort((t,e)=>t.o-e.o);const o=a.map(t=>{const i=Object.keys(t.h).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Se:t,De:t.h[e],m:t.m?.[e],Oe:[i[0],i[1]],ke:[i[2],i[3]]}});return n?.[0]}).filter(Boolean),r=o?.length||0;if(!(r>0))return this.k.St(`Sleeping\nVersion: ${this.version}`),t;{const t=s(a.filter(t=>Object.keys(t.h).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.p.total||0),0));this.k.St(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of o){const n=!!t.Se.p?.colors?.get(-1);let s=t.m.slice();const a=Number(t.ke[0])*this.zt,o=Number(t.ke[1])*this.zt;if(0!=this.Vt.size||n||h.drawImage(t.De,a,o),!s){const e=h.getImageData(a,o,t.De.width,t.De.height);s=new Uint32Array(e.data.buffer)}Date.now();const{Et:r,Xt:l}=i(this,O,N).call(this,{_t:d,Ft:s,jt:[a,o,t.De.width,t.De.height]});let c=0;const m=0;for(const[t,e]of r)t!=m&&(c+=e);(0!=this.Vt.size||n)&&h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(l.buffer),t.De.width,t.De.height)),a,o),void 0===t.Se.p.correct&&(t.Se.p.correct={}),t.Se.p.correct[e]=r}return await c.convertToBlob({type:"image/png"})}Le(t){"BlueMarble"==t?.whoami&&i(this,O,L).call(this,t)}be(t){this.we=t}}(Y,V,q),Z=new class{constructor(t){this.Bt=t,this.Ne=!1,this.de="",this.ue=[],this.Be=[]}Ie(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const a=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(a){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Ct("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(n.id||n.id,this.Bt.pe=n.id,0!=this.de.length){const t=document.querySelector("#"+this.de);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.wt("bm-n",`Droplets: ${s(n.droplets)}`),t.wt("bm-h",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const a=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.ue.length&&(!a.length||!c.length))return void t.Ct("Coordinates are malformed!\nDid you try clicking the canvas first?");this.ue=[...a,...c];const h=(o=a,r=c,[parseInt(o[0])%4*1e3+parseInt(r[0]),parseInt(o[1])%4*1e3+parseInt(r[1])]),m=document.querySelectorAll("span");for(const t of m)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-g");const i=`(Tl X: ${a[0]}, Tl Y: ${a[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-g",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let d=i.endpoint.split("/");d=[parseInt(d[d.length-2]),parseInt(d[d.length-1].replace(".png",""))];const u=i.blobID,b=i.blobData,p=(Date.now(),await this.Bt.Ce(b,d));window.postMessage({source:"blue-marble",blobID:u,blobData:p,blink:i.blink});break;case"robots":this.Ne="false"==n.userscript?.toString().toLowerCase()}var o,r})}async Ae(t){let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return;const i=navigator.userAgent;let n=await this.He(i),s=this.Pe(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&l("Failed to send heartbeat:",t.statusText)},onerror:t=>{l("Error sending heartbeat:",t)}})}async He(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Pe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(Q);q.B(Z);var K=JSON.parse(GM_getValue("bmTemplates","{}"));Q.Le(K);var tt=JSON.parse(GM_getValue("bmUserSettings","{}"));if(0==Object.keys(tt).length){const t=crypto.randomUUID();GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>Z.Ae(V),18e5);var et=tt?.telemetry;if(null==et||et>1){const t=new class extends S{constructor(t,i,n,s){super(t,i),e(this,F),this.window=null,this.Dt="bm-e",this.Ot=document.body,this.We=n,this.uuid=s}async It(){if(document.querySelector(`#${this.Dt}`))return void this.Ct("Telemetry window already exists!");const t=await this.D.He(navigator.userAgent),e=this.D.Pe(navigator.userAgent);this.window=this.H({id:this.Dt,class:"bm-J",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-f"}).H({class:"bm-B bm-b"}).j(1,{textContent:`${this.name} Telemetry`}).I().I().R().I().H({class:"bm-B bm-u",style:"gap: 1.5ch; flex-wrap: wrap;"}).bt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,F,j).call(this,this.We);const t=document.getElementById(this.Dt);t?.remove()}}).I().bt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,F,j).call(this,0);const t=document.getElementById(this.Dt);t?.remove()}}).I().bt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).I().I().H({class:"bm-B bm-x"}).H({class:"bm-B"}).j(2,{textContent:"Legal"}).I().P({textContent:`We collect anonymous telemetry data such as your browser, OS, and script version to make the experience better for everyone. The data is never shared personally. The data is never sold. You can turn this off by pressing the "Disable" button, but keeping it on helps us improve features and reliability faster. Thank you for supporting ${this.name}!`}).I().I().R().I().H({class:"bm-B"}).j(2,{textContent:"Non-Legal Summary"}).I().P({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).I().et().nt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${o(this.uuid)}`}).I().nt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${o(this.version)}`}).I().nt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${o(t)}`}).I().nt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${o(e)}`}).I().nt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).I().I().P({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).I().I().I().I().I().A(this.Ot)}}(Y,V,1,tt?.uuid);t.B(Z),t.It()}q.It(),Z.Ie(q),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-w");if(!n){n=document.createElement("button"),n.id="bm-w",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),r(`%c${Y}%c (${V}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}var f,g,w,y,v,$=[{id:0,premium:!1,name:"Transparent",rgb:[0,0,0]},{id:1,premium:!1,name:"Black",rgb:[0,0,0]},{id:2,premium:!1,name:"Dark Gray",rgb:[60,60,60]},{id:3,premium:!1,name:"Gray",rgb:[120,120,120]},{id:4,premium:!1,name:"Light Gray",rgb:[210,210,210]},{id:5,premium:!1,name:"White",rgb:[255,255,255]},{id:6,premium:!1,name:"Deep Red",rgb:[96,0,24]},{id:7,premium:!1,name:"Red",rgb:[237,28,36]},{id:8,premium:!1,name:"Orange",rgb:[255,127,39]},{id:9,premium:!1,name:"Gold",rgb:[246,170,9]},{id:10,premium:!1,name:"Yellow",rgb:[249,221,59]},{id:11,premium:!1,name:"Light Yellow",rgb:[255,250,188]},{id:12,premium:!1,name:"Dark Green",rgb:[14,185,104]},{id:13,premium:!1,name:"Green",rgb:[19,230,123]},{id:14,premium:!1,name:"Light Green",rgb:[135,255,94]},{id:15,premium:!1,name:"Dark Teal",rgb:[12,129,110]},{id:16,premium:!1,name:"Teal",rgb:[16,174,166]},{id:17,premium:!1,name:"Light Teal",rgb:[19,225,190]},{id:18,premium:!1,name:"Dark Blue",rgb:[40,80,158]},{id:19,premium:!1,name:"Blue",rgb:[64,147,228]},{id:20,premium:!1,name:"Cyan",rgb:[96,247,242]},{id:21,premium:!1,name:"Indigo",rgb:[107,80,246]},{id:22,premium:!1,name:"Light Indigo",rgb:[153,177,251]},{id:23,premium:!1,name:"Dark Purple",rgb:[120,12,153]},{id:24,premium:!1,name:"Purple",rgb:[170,56,185]},{id:25,premium:!1,name:"Light Purple",rgb:[224,159,249]},{id:26,premium:!1,name:"Dark Pink",rgb:[203,0,122]},{id:27,premium:!1,name:"Pink",rgb:[236,31,128]},{id:28,premium:!1,name:"Light Pink",rgb:[243,141,169]},{id:29,premium:!1,name:"Dark Brown",rgb:[104,70,52]},{id:30,premium:!1,name:"Brown",rgb:[149,104,42]},{id:31,premium:!1,name:"Beige",rgb:[248,178,119]},{id:32,premium:!0,name:"Medium Gray",rgb:[170,170,170]},{id:33,premium:!0,name:"Dark Red",rgb:[165,14,30]},{id:34,premium:!0,name:"Light Red",rgb:[250,128,114]},{id:35,premium:!0,name:"Dark Orange",rgb:[228,92,26]},{id:36,premium:!0,name:"Light Tan",rgb:[214,181,148]},{id:37,premium:!0,name:"Dark Goldenrod",rgb:[156,132,49]},{id:38,premium:!0,name:"Goldenrod",rgb:[197,173,49]},{id:39,premium:!0,name:"Light Goldenrod",rgb:[232,212,95]},{id:40,premium:!0,name:"Dark Olive",rgb:[74,107,58]},{id:41,premium:!0,name:"Olive",rgb:[90,148,74]},{id:42,premium:!0,name:"Light Olive",rgb:[132,197,115]},{id:43,premium:!0,name:"Dark Cyan",rgb:[15,121,159]},{id:44,premium:!0,name:"Light Cyan",rgb:[187,250,242]},{id:45,premium:!0,name:"Light Blue",rgb:[125,199,255]},{id:46,premium:!0,name:"Dark Indigo",rgb:[77,49,184]},{id:47,premium:!0,name:"Dark Slate Blue",rgb:[74,66,132]},{id:48,premium:!0,name:"Slate Blue",rgb:[122,113,196]},{id:49,premium:!0,name:"Light Slate Blue",rgb:[181,174,241]},{id:50,premium:!0,name:"Light Brown",rgb:[219,164,99]},{id:51,premium:!0,name:"Dark Beige",rgb:[209,128,81]},{id:52,premium:!0,name:"Light Beige",rgb:[255,197,165]},{id:53,premium:!0,name:"Dark Peach",rgb:[155,82,73]},{id:54,premium:!0,name:"Peach",rgb:[209,128,120]},{id:55,premium:!0,name:"Light Peach",rgb:[250,182,164]},{id:56,premium:!0,name:"Dark Tan",rgb:[123,99,82]},{id:57,premium:!0,name:"Tan",rgb:[156,132,107]},{id:58,premium:!0,name:"Dark Slate",rgb:[51,57,65]},{id:59,premium:!0,name:"Slate",rgb:[109,117,141]},{id:60,premium:!0,name:"Light Slate",rgb:[179,185,209]},{id:61,premium:!0,name:"Dark Stone",rgb:[109,100,63]},{id:62,premium:!0,name:"Stone",rgb:[148,140,107]},{id:63,premium:!0,name:"Light Stone",rgb:[205,197,158]}],x=class{constructor({displayName:t="My template",p:n=0,v:i="",url:s="",file:o=null,coords:a=null,$:r=null,M:l={},T:c=1e3}={}){e(this,f),this.displayName=t,this.p=n,this.v=i,this.url=s,this.file=o,this.coords=a,this.$=r,this.M=l,this.T=c,this.C={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.T=t;const a={},r={},l=new OffscreenCanvas(this.T,this.T),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,f,g).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.C={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var M,T,C,S,D=class{constructor(t,n){e(this,w),this.name=t,this.version=n,this.N=null,this.B="bm-i",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"small",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"span",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,w,y).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,w,y).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,w,y).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,w,y).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,w,y).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-M",onclick:()=>{this.$t(this.B,i)}};return e(this,n(this,w,y).call(this,"button",s,t)),this}xt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,w,y).call(this,"div"),o=n(this,w,y).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,w,y).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Tt(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"textarea",{},t)),this}Ct(t={},e=()=>{}){return e(this,n(this,w,y).call(this,"div",{class:"bm-H"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-L",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,w,y).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}$t(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}Dt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-J"),n=t.closest(".bm-H"),i=e.querySelector("h1"),s=e.querySelector(".bm-f");if(e.parentElement.append(e),"expanded"==t.dataset.buttonStatus){s.style.height=s.scrollHeight+"px",e.style.width=e.scrollWidth+"px",s.style.height="0",s.addEventListener("transitionend",function e(){s.style.display="none",t.disabled=!1,t.style.textDecoration="",s.removeEventListener("transitionend",e)});const n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.remove(),s.style.display="",s.style.height="0",e.style.width="",s.style.height=s.scrollHeight+"px",s.addEventListener("transitionend",function e(){s.style.height="",t.disabled=!1,t.style.textDecoration="",s.removeEventListener("transitionend",e)}),t.textContent="ā–¼",t.dataset.buttonStatus="expanded",t.ariaLabel=`Minimize window "${o}"`}}kt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Ot(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).transform;if(b&&"none"!==b){const t=new DOMMatrix(b);l=t.m41,c=t.m42}else l=d.left,c=d.top;h=l,m=c,document.body.style.userSelect="none",i.classList.add("bm-C"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-C"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Lt(t){(0,console.info)(`${this.name}: ${t}`),this.$t(this.B,"Status: "+t,!0)}Ot(t){(0,console.error)(`${this.name}: ${t}`),this.$t(this.B,"Error: "+t,!0)}};w=new WeakSet,y=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,w,v).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,w,v).call(this,s,t,e);return s},v=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var k=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,M),this.window=null,this.Nt="bm-j",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-t")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-J",style:t},(t,e)=>{}).Ct().yt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Dt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-k",textContent:"šŸžŖ","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-f"}).G({class:"bm-B bm-b"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-B"}).J(2,{textContent:"Status"}).W().U({id:"bm-l",textContent:"Loading template storage status..."}).W().W().G({class:"bm-B bm-x"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.kt(`#${this.Nt}.bm-J`,`#${this.Nt} .bm-H`),n(this,M,T).call(this),n(this,M,C).call(this)}};M=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='Template storage health: Poor!
You can still use your template, but some features may not work. It is recommended that you update Blue Marble\'s template storage. (Reason: MINOR version mismatch)',this.Ht="Poor"):t[0]Bad!
It is guaranteed that some features are broken. You might still be able to use the template. It is HIGHLY recommended that you download all templates and update Blue Marble\'s template storage before continuing. (Reason: MAJOR version mismatch)',this.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="Dead");const s=`
If you want to continue using your current templates, then make sure the template storage (schema) is up-to-date.
If you don't want to update the template storage, then downgrade Blue Marble to version ${r(this.scriptVersion)} to continue using your templates.
Alternatively, if you don't care about corrupting the templates listed below, you can fix any issues with the template storage by uploading a new template.`;this.$t("#bm-l",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.${"Good"!=this.Ht?s:""}`);const o=new D(this.name,this.version);"Dead"!=this.Ht&&(o.G({class:"bm-B bm-u bm-b",style:"gap: 1.5ch;"}),o.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt._t().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||o.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,M,S).call(this,!0)}}).W(),o.W()._(document.querySelector("#bm-l").parentNode)},C=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-x`),n=new D(this.name,this.version);n.G({id:"bm-o",class:"bm-B"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt.Gt),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-B bm-u"}).G({class:"bm-u",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-u bm-0"}).J(3,{textContent:r}).W().j({textContent:`Uploaded by user #${u}`}).W().j({textContent:`Coordinates: ${l.join(", ")}`}).W().j({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},S=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-f`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-B"}).G({class:"bm-B bm-b"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-B"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new x({displayName:n.name,$:n.tiles});t.O();const e=await this.Pt.Ut(t);await this.Pt.zt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new k(this.name,this.version,this.At,this.Pt).Wt())};var O,L,N,B,I=k;O=new WeakSet,L=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},N=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new I(this.name,this.version,this.schemaVersion,this).Wt(),this.jt=await async function({T:t,Rt:n,jt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new x({displayName:l,p:s||this.jt?.length||0,v:r||""});p.C=c,p.$=m,p.M=d,i.push(p),console.log(this.jt),console.log("^^^ This ^^^")}}return i}({T:this.T,Rt:this.Rt,jt:this.jt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var H=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=$.slice(1)}ee(t){const e=document.createElement("div");for(let t=0;t{t.parentNode.childElementCount<=1?t.parentNode.remove():t.remove()},e.appendChild(t)}t.appendChild(e)}},A=class extends HTMLElement{};customElements.define("confetti-piece",A);var P,W,_,G,U,z,F,j,R,Y=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-J-credits",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():this.window=this.G({id:this.Nt,class:"bm-J"},(t,e)=>{}).Ct().yt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Dt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-k",textContent:"šŸžŖ","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-f"}).G({class:"bm-B bm-b"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-B bm-x"}).j({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",style:"white-space: pre;"}).W().q().W().X().W().q().W().j({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().j({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().j({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().j({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().j({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().W().W().W()._(this.Bt)}},E=class extends D{constructor(t){super(t.name,t.version),e(this,P),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.Pt=t.N?.Pt,this.ne='',this.ie='';const{palette:n,L:i}=this.Pt.Xt;this.palette=n,this.se=0,this.oe=0}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-J"},(t,e)=>{}).Ct().yt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Dt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-k",textContent:"šŸžŖ","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-f"}).G({class:"bm-B bm-b"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-B bm-p bm-b",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,P,G).call(this,!1)}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,P,G).call(this,!0)}).W().W().G({class:"bm-B bm-x"}).G({class:"bm-B",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-B"}).j({id:"bm-c",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().j({id:"bm-7",innerHTML:"Correct Pixels: ???"}).W().q().W().j({id:"bm-d",innerHTML:"Total Pixels: ???"}).W().q().W().j({id:"bm-3",innerHTML:"Complete: ??? (???)"}).W().q().W().j({id:"bm-4",innerHTML:"??? ???"}).W().W().G({class:"bm-B"}).U({innerHTML:`Colors with the icon ${this.ne.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,P,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.kt(`#${this.Nt}.bm-J`,`#${this.Nt} .bm-H`);const t=document.querySelector(`#${this.Nt} .bm-B.bm-x`);let e=0,i=0;const r=new Map,l=new Map;for(const t of this.Pt.jt){e+=t.C?.total??0??0;const n=t.C?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=l.get(t)??0;l.set(t,i+n)}const s=t.C?.correct??{};this.se+=Object.keys(s).length,this.oe+=Object.keys(t.$).length;for(const t of Object.values(s))for(const[e,n]of t){const t=Number(n)||0;i+=t;const s=r.get(e)??0;r.set(e,s+t)}}console.log(`Tiles loaded: ${this.se} / ${this.oe}`),i>=e&&e&&this.se==this.oe&&(new H).ee(document.querySelector(`#${this.Nt}`));const c=new Date(30*(e-i)*1e3+Date.now()),h=a(c);this.$t("#bm-c",`Tiles Loaded: ${s(this.se)} / ${s(this.oe)}`),this.$t("#bm-7",`Correct Pixels: ${s(i)}`),this.$t("#bm-d",`Total Pixels: ${s(e)}`),this.$t("#bm-3",`Remaining: ${s((e||0)-(i||0))} (${o(((e||0)-(i||0))/(e||1))})`),this.$t("#bm-4",`Completed at: `),n(this,P,W).call(this,t,r,l),n(this,P,_).call(this,"id","ascending",!1)}};P=new WeakSet,W=function(t,e,n){const i=new D(this.name,this.version);i.G({class:"bm-v"});for(const t of this.palette){const a=p(t.rgb);let r=1.05/(a+.05)>(a+.05)/.05?"white":"black";t.id||(r="transparent");const l="white"==r?"bm-9":"bm-a",c=n.get(t.id)??0,h=s(c);let m=0,d="0",u=o(1);0!=c&&(m=e.get(t.id)??"???","number"!=typeof m&&this.se==this.oe&&t.id&&(m=0),d="string"==typeof m?m:s(m),u=isNaN(m/c)?"???":o(m/c));const b=parseInt(c)-parseInt(m),f=!!this.Pt.qt.get(t.id);i.G({class:"bm-B bm-q bm-p","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(m))?"0":m,"data-total":c,"data-percent":"%"==u.slice(-1)?u.slice(0,-1):"0","data-incorrect":b||0}).G({class:"bm-5",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});`}).yt({class:"bm-r "+l,"data-state":f?"hidden":"shown","aria-label":f?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:f?this.ie.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.ie.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-y"):Number(i.getAttribute("data-total"))||i.classList.add("bm-y"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(".bm-v"),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-y"))continue;const n=e.querySelector(".bm-5 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=new WeakSet,z=function(){new E(this).Wt()},F=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-D"==e.id?(t.$t("bm-D",s?.[0]||""),t.$t("bm-E",s?.[1]||"")):1==s.length?t.$t(e.id,s?.[0]||""):(t.$t("bm-F",s?.[0]||""),t.$t("bm-G",s?.[1]||""),t.$t("bm-D",s?.[2]||""),t.$t("bm-E",s?.[3]||""))},j=new WeakSet,R=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var V=GM_info.script.name.toString(),J=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-N",V),e.setAttribute("bm-K","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-N")||"Blue Marble",n=t?.getAttribute("bm-K")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${i.size} Recieved IMAGE message about blob "${a}"`,n,""),console.log(`Blob fetch took %c${String(Math.floor(c/6e4)).padStart(2,"0")}:${String(Math.floor(c/1e3)%60).padStart(2,"0")}.${String(c%1e3).padStart(3,"0")}%c MM:SS.mmm`,n,""),console.log(i),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,n,"",a),i.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.toLocaleString()}\nTime Since Blink: ${String(Math.floor(o/6e4)).padStart(2,"0")}:${String(Math.floor(o/1e3)%60).padStart(2,"0")}.${String(o%1e3).padStart(3,"0")} MM:SS.mmm`),console.error("Exception stack:",s),console.groupEnd()})}return o}});var X=GM_getResourceText("CSS-BM-File");GM_addStyle(X);var q,Q="robotoMonoInjectionPoint";Q.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(Q)):((q=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",q.rel="preload",q.as="style",q.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(q)),new class{constructor(){this.ae=null,this.re=null,this.le="#bm-g"}ce(t){return this.re=t,this.ae=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.le)}),this}he(){return this.ae}observe(t,e=!1,n=!1){t.observe(this.re,{childList:e,subtree:n})}};var Z=new class extends D{constructor(t,n){super(t,n),e(this,U),this.window=null,this.Nt="bm-t",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Ot("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-J",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Ct().yt({class:"bm-k",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Dt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-f"}).G({class:"bm-B"}).V({class:"bm-I",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new H).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-B"}).j({id:"bm-n",textContent:"Droplets:"}).W().q().W().j({id:"bm-h",textContent:"Next level in..."}).W().q().W().j({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.me=e.id}).W().W().W().X().W().G({class:"bm-B"}).G({class:"bm-B"}).yt({class:"bm-k bm-z",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.de;e?.[0]?(t.$t("bm-F",e?.[0]||""),t.$t("bm-G",e?.[1]||""),t.$t("bm-D",e?.[2]||""),t.$t("bm-E",e?.[3]||"")):t.Ot("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().xt({type:"number",id:"bm-F",class:"bm-s",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,U,F).call(this,t,e,i))}).W().xt({type:"number",id:"bm-G",class:"bm-s",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,U,F).call(this,t,e,i))}).W().xt({type:"number",id:"bm-D",class:"bm-s",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,U,F).call(this,t,e,i))}).W().xt({type:"number",id:"bm-E",class:"bm-s",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,U,F).call(this,t,e,i))}).W().W().G({class:"bm-B"}).Mt({class:"bm-A",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-B bm-p"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ue(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Lt("Disabled templates!")):(t.N?.Pt?.ue(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Lt("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-A`),n=document.querySelector("#bm-F");if(!n.checkValidity())return n.reportValidity(),void t.Ot("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-G");if(!i.checkValidity())return i.reportValidity(),void t.Ot("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-D");if(!s.checkValidity())return s.reportValidity(),void t.Ot("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-E");if(!o.checkValidity())return o.reportValidity(),void t.Ot("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.zt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Lt("Drew to canvas!")):t.Ot("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,U,z).call(this)}).W().W().G({class:"bm-B"}).Tt({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-B bm-p",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-p"}).yt({class:"bm-k",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new I(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-k",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-k",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-k",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-k",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new Y(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.kt(`#${this.Nt}.bm-J`,`#${this.Nt} .bm-H`))}}(V,J),K=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.be=null,this.Gt="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.T=1e3,this.Rt=3,this.Jt=3,this.Xt=function(t){const e=$;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,L:n}}(this.Jt),this.Et=null,this.pe="",this.jt=[],this.Ft=null,this.fe=!0,this.ge=null,this.qt=new Map}async we(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async zt(t,e,i){this.Ft||(this.Ft=await this.we(),console.log("Creating JSON...")),this.I.Lt(`Creating template at ${i.join(", ")}...`);const s=new x({displayName:e,p:0,v:m(this.be||0,this.Gt),file:t,coords:i}),{D:o,k:a}=await s.S(this.T,this.Xt);s.$=o;const r={total:s.C.total,colors:Object.fromEntries(s.C.colors)};this.Ft.templates[`${s.p} ${s.v}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.jt=[],this.jt.push(s),this.I.Lt(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.jt),console.log(JSON.stringify(this.Ft)),await n(this,O,L).call(this)}ye(){}async ve(){this.Ft||(this.Ft=await this.we(),console.log("Creating JSON..."))}async $e(){l("Downloading all templates..."),console.log(this.jt);for(const t of this.jt)await this.xe(t),await i(500)}async _t(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.xe(new x({displayName:n.name,p:e.split(" ")?.[0],v:e.split(" ")?.[1],$:n.tiles})),await i(500))}async xe(t){t.O();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Ut(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",Me:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Ut(t){console.log(t);const e=t.$,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.T+c,u=l*this.T+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Rt),r=Math.max(r,u+m.height/this.Rt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o;console.log(`Template Width: ${l}\nTemplate Height: ${c}`);const h=new OffscreenCanvas(l,c),m=h.getContext("2d");return m.imageSmoothingEnabled=!1,n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.T+r,d=a*this.T+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${d}) at (${h-s}, ${d-o}) on the canvas...`),m.drawImage(c,h-s,d-o,c.width/this.Rt,c.height/this.Rt)}),h.convertToBlob({type:"image/png"})}async Te(t,e){if(!this.fe)return t;const i=this.T*this.Rt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.jt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.$).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{Ce:t,Se:t.$[e],M:t.M?.[e],De:[n[0],n[1]],ke:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Lt(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.$).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.C.total||0),0));this.I.Lt(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t.Ce.C?.colors?.get(-1);let s=t.M.slice();const o=Number(t.ke[0])*this.Rt,a=Number(t.ke[1])*this.Rt;if(0!=this.qt.size||i||h.drawImage(t.Se,o,a),!s){const e=h.getImageData(o,a,t.Se.width,t.Se.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,B).call(this,{Yt:d,Et:s,Vt:[o,a,t.Se.width,t.Se.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Se.width,t.Se.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ce.C.correct&&(t.Ce.C.correct={}),t.Ce.C.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Oe(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,N).call(this,t)}ue(t){this.fe=t}}(V,J,Z),tt=new class{constructor(t){this.Pt=t,this.Le=!1,this.me="",this.de=[],this.Ne=[]}Be(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(i.status&&"2"!=i.status?.toString()[0])return void t.Ot("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.be=i.id,0!=this.me.length){const t=document.querySelector("#"+this.me);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.$t("bm-n",`Droplets: ${s(i.droplets)}`),t.$t("bm-h",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.de.length&&(!o.length||!c.length))return void t.Ot("Coordinates are malformed!\nDid you try clicking the canvas first?");this.de=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-g");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-g",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.Te(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.Le="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ie(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.He(n),s=this.Ae(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async He(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ae(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(K);Z.P(tt);var et=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(et),K.Oe(et);var nt=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(nt),console.log(Object.keys(nt).length),0==Object.keys(nt).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>tt.Ie(J),18e5);var it=nt?.telemetry;if(console.log(`Telemetry is ${!(null==it)}`),null==it||it>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,j),this.window=null,this.Nt="bm-e",this.Bt=document.body,this.Pe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Ot("Telemetry window already exists!");const t=await this.N.He(navigator.userAgent),e=this.N.Ae(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-J",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-f"}).G({class:"bm-B bm-b"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-B bm-u",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,j,R).call(this,this.Pe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,j,R).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-B bm-x"}).G({class:"bm-B"}).J(2,{textContent:"Legal"}).W().U({textContent:`We collect anonymous telemetry data such as your browser, OS, and script version to make the experience better for everyone. The data is never shared personally. The data is never sold. You can turn this off by pressing the "Disable" button, but keeping it on helps us improve features and reliability faster. Thank you for supporting ${this.name}!`}).W().W().X().W().G({class:"bm-B"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(V,J,1,nt?.uuid);t.P(tt),t.Wt()}Z.Wt(),tt.Be(Z),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-w");if(!i){i=document.createElement("button"),i.id="bm-w",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${V}%c (${J}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/CREDITS.md b/docs/CREDITS.md index 8c83ce4..bcc0361 100644 --- a/docs/CREDITS.md +++ b/docs/CREDITS.md @@ -26,9 +26,10 @@ The [Blue Marble Website](https://bluemarble.camilledaguin.fr/) used until Aug/2 The favicon "Blue Marble" is owned by NASA. Special Thanks: +* Espresso, Meqa, and Robot for moderating SwingTheVine's community. * nof, [darkness](https://github.com/TouchedByDarkness) for creating similar userscripts! * [Wonda](https://wondapon.net/) for the Blue Marble banner image! * [BullStein](https://github.com/BullStein), [allanf181](https://github.com/allanf181) for being early beta testers! -* guidu_ and [Nick-machado](https://github.com/Nick-machado) for the "Minimize" Button code! +* guidu_ and [Nick-machado](https://github.com/Nick-machado) for the "Minimize" original Button code! * Nomad and [Gustav](https://www.youtube.com/@gustav_vv) for the tutorials! * TheBlueCorner for getting me interested in online pixel canvases! diff --git a/docs/README.md b/docs/README.md index 7608e6b..ff8efcf 100644 --- a/docs/README.md +++ b/docs/README.md @@ -50,8 +50,8 @@ Software License: MPL-2.0 Contact Me Blue Marble Website -WakaTime -Total Patches +WakaTime +Total Patches Total Lines of Code Total Comments Compression diff --git a/package-lock.json b/package-lock.json index 810fcbf..4b297f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.89.4", + "version": "0.90.17", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.89.4", + "version": "0.90.17", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index 6b960ec..7196f47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.90.0", + "version": "0.90.17", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index 4f72f18..b57b98d 100644 --- a/src/BlueMarble.meta.js +++ b/src/BlueMarble.meta.js @@ -2,7 +2,7 @@ // @name Blue Marble // @name:en Blue Marble // @namespace https://github.com/SwingTheVine/ -// @version 0.90.0 +// @version 0.90.17 // @description A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @description:en A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @author SwingTheVine diff --git a/src/WindowCredits.js b/src/WindowCredits.js new file mode 100644 index 0000000..f367d22 --- /dev/null +++ b/src/WindowCredits.js @@ -0,0 +1,99 @@ +import Overlay from "./Overlay"; +import { localizeDate } from "./utils"; + +/** Manages the credits window for Blue Marble. + * @class WindowCredits + * @since 0.90.9 + * @see {@link Overlay} for examples + */ +export default class WindowCredts extends Overlay { + + /** Constructor for the Credits window + * @param {string} name - The name of the userscript + * @param {string} version - The version of the userscript + * @since 0.90.9 + * @see {@link Overlay#constructor} for examples + */ + constructor(name, version) { + super(name, version); // Executes the code in the Overlay constructor + this.window = null; // Contains the *window* DOM tree + this.windowID = 'bm-window-credits'; // The ID attribute for this window + this.windowParent = document.body; // The parent of the window DOM tree + } + + /** Spawns a Credits window. + * If another credits window already exists, we DON'T spawn another! + * Parent/child relationships in the DOM structure below are indicated by indentation. + * @since 0.90.9 + */ + buildWindow() { + + // ASCII art of "Blue Marble" + const ascii = ` +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— +ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā• +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— +ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• +ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— +ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• + +ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— +ā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā• +ā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— +ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• +ā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— +ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā• +`; + + // If a credits window already exists, close it + if (document.querySelector(`#${this.windowID}`)) { + document.querySelector(`#${this.windowID}`).remove(); + return; + } + + // Creates a new credits window + this.window = this.addDiv({'id': this.windowID, 'class': 'bm-window'}, (instance, div) => {}) + .addDragbar() + .addButton({'class': 'bm-button-circle', 'textContent': 'ā–¼', 'aria-label': 'Minimize window "Credits"', 'data-button-status': 'expanded'}, (instance, button) => { + button.onclick = () => instance.handleMinimization(button); + button.ontouchend = () => {button.click()}; // Needed only to negate weird interaction with dragbar + }).buildElement() + .addDiv().buildElement() // Contains the minimized h1 element + .addButton({'class': 'bm-button-circle', 'textContent': 'šŸžŖ', 'aria-label': 'Close window "Credits"'}, (instance, button) => { + button.onclick = () => {document.querySelector(`#${this.windowID}`)?.remove();}; + button.ontouchend = () => {button.click();}; // Needed only to negate weird interaction with dragbar + }).buildElement() + .buildElement() + .addDiv({'class': 'bm-window-content'}) + .addDiv({'class': 'bm-container bm-center-vertically'}) + .addHeader(1, {'textContent': 'Credits'}).buildElement() + .buildElement() + .addHr().buildElement() + .addDiv({'class': 'bm-container bm-scrollable'}) + .addSpan({'innerHTML': ascii, 'style': 'white-space: pre;'}).buildElement() + .addBr().buildElement() + .addHr().buildElement() + .addBr().buildElement() + .addSpan({'textContent': '"Blue Marble" userscript is made by SwingTheVine.'}).buildElement() + .addBr().buildElement() + .addSpan({'innerHTML': 'The Blue Marble Website is made by crqch.'}).buildElement() + .addBr().buildElement() + .addSpan({'textContent': `The Blue Marble Website used until ${localizeDate(new Date(1756069320 * 1000))} was made by Camille Daguin.`}).buildElement() + .addBr().buildElement() + .addSpan({'textContent': 'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).buildElement() + .addBr().buildElement() + .addSpan({'textContent': 'Special Thanks:'}).buildElement() + .addUl() + .addLi({'textContent': 'Espresso, Meqa, and Robot for moderating SwingTheVine\'s community.'}).buildElement() + .addLi({'innerHTML': 'nof, darkness for creating similar userscripts!'}).buildElement() + .addLi({'innerHTML': 'Wonda for the Blue Marble banner image!'}).buildElement() + .addLi({'innerHTML': 'BullStein, allanf181 for being early beta testers!'}).buildElement() + .addLi({'innerHTML': 'guidu_ and Nick-machado for the original "Minimize" Button code!'}).buildElement() + .addLi({'innerHTML': 'Nomad and Gustav for the tutorials!'}).buildElement() + .addLi({'innerHTML': 'TheBlueCorner for getting me interested in online pixel canvases!'}).buildElement() + .buildElement() + .buildElement() + .buildElement() + .buildElement().buildOverlay(this.windowParent); + } +} \ No newline at end of file diff --git a/src/WindowMain.js b/src/WindowMain.js index b132886..91e14b9 100644 --- a/src/WindowMain.js +++ b/src/WindowMain.js @@ -1,6 +1,7 @@ import ConfettiManager from "./confetttiManager"; import Overlay from "./Overlay"; import { getClipboardData } from "./utils"; +import WindowCredts from "./WindowCredits"; import WindowFilter from "./WindowFilter"; import WindowWizard from "./WindowWizard"; @@ -159,7 +160,7 @@ export default class WindowMain extends Overlay { .addDiv({'class': 'bm-container'}) .addTextarea({'id': this.outputStatusId, 'placeholder': `Status: Sleeping...\nVersion: ${this.version}`, 'readOnly': true}).buildElement() .buildElement() - .addDiv({'class': 'bm-container bm-flex-between', 'style': 'margin-bottom: 0;'}) + .addDiv({'class': 'bm-container bm-flex-between', 'style': 'margin-bottom: 0; flex-direction: column;'}) .addDiv({'class': 'bm-flex-between'}) // .addButton({'class': 'bm-button-circle', 'innerHTML': 'šŸ–Œ'}).buildElement() .addButton({'class': 'bm-button-circle', 'innerHTML': 'šŸ§™', 'title': 'Template Wizard'}, (instance, button) => { @@ -183,7 +184,13 @@ export default class WindowMain extends Overlay { button.onclick = () => { window.open('https://ko-fi.com/swingthevine', '_blank', 'noopener noreferrer'); } - }) + }).buildElement() + .addButton({'class': 'bm-button-circle', 'innerHTML': 'šŸ¤', 'title': 'Credits'}, (instance, button) => { + button.onclick = () => { + const credits = new WindowCredts(this.name, this.version); + credits.buildWindow(); + } + }).buildElement() .buildElement() .addSmall({'textContent': 'Made by SwingTheVine', 'style': 'margin-top: auto;'}).buildElement() .buildElement() diff --git a/src/overlay.css b/src/overlay.css index 84a6c74..a67a1f4 100644 --- a/src/overlay.css +++ b/src/overlay.css @@ -285,6 +285,11 @@ input[type="file"] { width: 100%; } +/* Anchor/Links with no children */ +.bm-window a:not(:has(*)) { + text-decoration: underline; +} + /* Small elements */ .bm-window small { font-size: x-small;