diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css
index 9da0577..eb9d159 100644
--- a/dist/BlueMarble-For-GreasyFork.user.css
+++ b/dist/BlueMarble-For-GreasyFork.user.css
@@ -1,3 +1,131 @@
+/* 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;
+}
+.bm-windowed #bm-filter-flex {
+ flex-direction: column;
+ gap: 0.25em;
+}
+.bm-windowed .bm-filter-color {
+ width: auto;
+ margin: 0;
+ padding: 0;
+}
+.bm-windowed .bm-filter-container-rgb {
+ display: flex;
+ width: 100%;
+ gap: 0.5ch;
+ align-items: center;
+ padding: 0.1em 0.5ch;
+ border: none;
+ border-radius: 1em;
+}
+#bm-window-filter.bm-windowed .bm-filter-container-rgb button {
+ padding: 0.5em 0.25ch;
+}
+.bm-windowed .bm-filter-container-rgb svg {
+ width: 3ch;
+}
+.bm-windowed .bm-filter-color h2 {
+ font-size: 0.75em;
+}
+
+/* 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;
@@ -285,132 +413,4 @@ input[type=file] {
font-size: 1em;
}
-/* 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;
-}
-.bm-windowed #bm-filter-flex {
- flex-direction: column;
- gap: 0.25em;
-}
-.bm-windowed .bm-filter-color {
- width: auto;
- margin: 0;
- padding: 0;
-}
-.bm-windowed .bm-filter-container-rgb {
- display: flex;
- width: 100%;
- gap: 0.5ch;
- align-items: center;
- padding: 0.1em 0.5ch;
- border: none;
- border-radius: 1em;
-}
-#bm-window-filter.bm-windowed .bm-filter-container-rgb button {
- padding: 0.5em 0.25ch;
-}
-.bm-windowed .bm-filter-container-rgb svg {
- width: 3ch;
-}
-.bm-windowed .bm-filter-color h2 {
- font-size: 0.75em;
-}
-
-/* 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 0a34caa..10597ba 100644
--- a/dist/BlueMarble-For-GreasyFork.user.js
+++ b/dist/BlueMarble-For-GreasyFork.user.js
@@ -2,7 +2,7 @@
// @name Blue Marble
// @name:en Blue Marble
// @namespace https://github.com/SwingTheVine/
-// @version 0.90.76
+// @version 0.91.0
// @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features.
// @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features.
// @author SwingTheVine
diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js
index 1f3b524..c4cfd7b 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.76
+// @version 0.91.0
// @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features.
// @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features.
// @author SwingTheVine
@@ -38,4 +38,4 @@
The "Blue Marble" image is owned by NASA.
*/
-(()=>{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]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={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.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),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,g,w).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.T={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 C,T,S,k,D=class{constructor(t,n){e(this,y),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,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,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,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(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.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,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}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,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,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}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(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}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`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})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=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,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=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 L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),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)=>{}).Tt().yt({class:"bm-k",textContent:"ā¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(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.Dt(`#${this.Nt}.bm-J`,`#${this.Nt} .bm-H`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#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)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-B bm-u bm-b",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-l").parentNode)},S=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._t),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().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=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 M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=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 H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt: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 M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):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 A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=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)=>{}).Tt().yt({class:"bm-k",textContent:"ā¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(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"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nāāāāāāā āāā āāā āāāāāāāāāāā\nāāāāāāāāāāā āāā āāāāāāāāāāā\nāāāāāāāāāāā āāā āāāāāāāāā \nāāāāāāāāāāā āāā āāāāāāāāā \nāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā\nāāāāāāā āāāāāāāā āāāāāāā āāāāāāāā\n\nāāāā āāāā āāāāāā āāāāāāā āāāāāāā āāā āāāāāāāā\nāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āāāāāāāā\nāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āāāāāā \nāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āāāāāā \nāāā āāā āāāāāā āāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāā\nāāā āāāāāā āāāāāā āāāāāāāāāā āāāāāāāāāāāāāāāā\n",class:"bm-1E","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({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:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-J`,`#${this.Nt} .bm-H`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-m",this.ne="bm-v",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}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)=>{}).Tt().yt({class:"bm-k",textContent:"ā¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-u"}).yt({class:"bm-k",textContent:"š","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).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().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,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,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"}).R({id:"bm-c",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-7",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-d",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-3",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-4",innerHTML:"??? ???"}).W().W().G({class:"bm-B"}).U({innerHTML:`Colors with the icon ${this.ie.replace("