diff --git a/assets/index-31f5d851.js b/assets/index-31f5d851.js deleted file mode 100644 index b4fee3f..0000000 --- a/assets/index-31f5d851.js +++ /dev/null @@ -1 +0,0 @@ -!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const o={};var f,p,y,g,h;function E(e){const t=e.value;if(delete o.bases,delete o.newBases,o.bases=t,B(t))S();else{t&&x("JSON is not correctly formatted. Please make sure you copied the whole PersistentPlayerBases section.",!0);const e=document.getElementsByClassName("bases");for(const t of Array.from(e))t.innerHTML=""}}function B(e){try{return JSON.parse(o.bases),!0}catch(t){return e&&console.warn("JSON error detected: ",t),!1}}function x(e,t){const n=document.getElementById("warning");n.innerHTML=e,n.style.display=t?"block":""}function S(){const e=document.getElementsByClassName("bases");for(const t of Array.from(e))t.style.willChange="contents";const t=JSON.parse(o.bases),n=[];for(let e=0;eO(e.target))),t.appendChild(n)}t.style.willChange=""}}function w(e,t){const n=t?"div":"span",s=document.createElement(n);return s.dataset.id=e.toString(),s.innerText=t,s}function O(e){const t=e.closest(".bases"),n=null==t?void 0:t.querySelector(".clicked");null==n||n.classList.remove("clicked"),n!=e&&e.classList.add("clicked")}function N(e){var t,n,s,i;e.style.pointerEvents="none";const r=Array.from(document.getElementsByClassName("clicked"));if(2!=r.length||!r[0]||!r[1]||(null==(n=null==(t=r[0])?void 0:t.dataset)?void 0:n.id)==(null==(i=null==(s=r[1])?void 0:s.dataset)?void 0:i.id))return e.classList.remove("is-primary"),e.classList.add("is-danger"),e.innerText="Failed!",void setTimeout((()=>{e.classList.remove("is-danger"),e.classList.add("is-primary"),e.innerText=o.buttonText,e.style.pointerEvents=""}),1500);const c=o.newBases??(o.newBases=o.bases),l=JSON.parse(c),a=[];for(const e of r)a.push(e.dataset.id);const d=structuredClone(l[a[0]].Objects),u=structuredClone(l[a[1]].Objects);l[a[1]].Objects=d,o.copy||(l[a[0]].Objects=u),o.newBases=JSON.stringify(l);const m=o.copy?"Copied":"Swapped";e.innerText=`${m}!`,L(`${m} "${r[0].innerText}" ${o.copy?"to":"and"} "${r[1].innerText}"`),setTimeout((()=>{e.innerText=o.buttonText,e.style.pointerEvents=""}),1500)}function C(e){e.style.pointerEvents="none";const t=e.innerText;if(!o.newBases)return e.classList.remove("is-primary"),e.classList.add("is-danger"),e.innerText="Failed!",void setTimeout((()=>{e.classList.remove("is-danger"),e.classList.add("is-primary"),e.innerText=t,e.style.pointerEvents=""}),1500);const n=JSON.parse(o.newBases),s=JSON.stringify(n,null,"\t");navigator.clipboard.writeText(s),e.innerText="Copied!",setTimeout((()=>{e.innerText=t,e.style.pointerEvents=""}),1500)}function b(e){const t=e.value.trim().toLowerCase(),n=e.nextElementSibling.children;for(const e of Array.from(n)){const n=e,s=n.innerText.toLowerCase();!t||s.includes(t)?n.style.display="":n.style.display="none"}}function L(e){const t=document.getElementById("actionlog"),n=document.createElement("div");n.innerText=e,n.classList.add("logItem"),null==t||t.appendChild(n)}function I(){if(!o.bases)return;const e=document.getElementsByClassName("clicked");for(const t of Array.from(e))t.classList.remove("clicked");o.newBases=JSON.parse(o.bases),L("Undid Edits")}function v(e){var t;o.copy=e;const n=document.querySelector("#output .columns .arrow");null==n||n.classList.toggle("copy",e),null==n||n.classList.toggle("swap",!e);const s=document.getElementById("swap");o.buttonText=e?"Copy Selected Base":"Swap Selected Bases",null!=(t=null==s?void 0:s.style)&&t.pointerEvents||(s.innerText=o.buttonText)}(()=>{v(document.getElementById("copyCheckbox").checked),E(document.getElementById("JSONinput"));const e=["left","right"],t=document.querySelector("#output .columns"),n=t.children;function s(e){const t=document.createElement("div"),n=document.createElement("input"),s=document.createElement("div");return t.classList.add("column"),t.id=e,n.type="text",n.placeholder="🔎 Search",n.classList.add("input"),n.addEventListener("input",(function(){b(this)})),s.classList.add("bases"),t.appendChild(n),t.appendChild(s),t}t.insertAdjacentElement("afterbegin",s(e[0])),Array.from(n).at(-1).insertAdjacentElement("beforebegin",s(e[1]))})(),null==(f=document.getElementById("copyCheckbox"))||f.addEventListener("change",(function(){v(this.checked)})),null==(p=document.getElementById("reset"))||p.addEventListener("click",(()=>I())),null==(y=document.getElementById("copy"))||y.addEventListener("click",(function(){C(this)})),null==(g=document.getElementById("swap"))||g.addEventListener("click",(function(){N(this)})),null==(h=document.getElementById("JSONinput"))||h.addEventListener("input",(function(){E(this)})); diff --git a/assets/index-c10c2104.js b/assets/index-c10c2104.js new file mode 100644 index 0000000..d4f1342 --- /dev/null +++ b/assets/index-c10c2104.js @@ -0,0 +1 @@ +!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const o={};var h,E,L,T,B;function v(e){const t=e.value;if(delete o.bases,delete o.newBases,o.bases=t,N(t))C();else{t&&O("JSON is not correctly formatted. Please make sure you copied the whole PersistentPlayerBases section.",!0);const e=document.getElementsByClassName("bases");for(const t of Array.from(e))t.innerHTML=""}}function N(e){try{return JSON.parse(o.bases),!0}catch(t){return e&&console.warn("JSON error detected: ",t),!1}}function O(e,t){const n=document.getElementById("warning");n.innerHTML=e,n.style.display=t?"block":""}function C(){const e=document.getElementsByClassName("bases");for(const t of Array.from(e))t.style.willChange="contents";const t=JSON.parse(o.bases),n=[];for(let e=0;eI(e.target))),t.appendChild(n)}t.style.willChange=""}}function b(e,t){const n=t?"div":"span",s=document.createElement(n);return s.dataset.id=e.toString(),s.innerText=t,s}function I(e){const t=e.closest(".bases"),n=null==t?void 0:t.querySelector(".clicked");null==n||n.classList.remove("clicked"),n!=e&&e.classList.add("clicked")}function J(e){var t,n,s,i,r,c,l,a;e.style.pointerEvents="none";const d=Array.from(document.getElementsByClassName("clicked"));if(2!==d.length||!d[0]||!d[1]||(null==(n=null==(t=d[0])?void 0:t.dataset)?void 0:n.id)===(null==(i=null==(s=d[1])?void 0:s.dataset)?void 0:i.id))return e.classList.remove("is-primary"),e.classList.add("is-danger"),2!==d.length?e.innerText="Must select 2 bases!":d[0]&&d[1]&&(null==(c=null==(r=d[0])?void 0:r.dataset)?void 0:c.id)!==(null==(a=null==(l=d[1])?void 0:l.dataset)?void 0:a.id)?e.innerText="Failed! (unknown cause)":e.innerText="Same base selected twice!",void setTimeout((()=>{e.classList.remove("is-danger"),e.classList.add("is-primary"),e.innerText=o.buttonText,e.style.pointerEvents=""}),1500);const u=o.newBases??(o.newBases=o.bases),m=JSON.parse(u),p=[];for(const e of d)p.push(e.dataset.id);const y=structuredClone(m[p[0]].Objects),f=structuredClone(m[p[1]].Objects);m[p[1]].Objects=y,o.copy||(m[p[0]].Objects=f),o.newBases=JSON.stringify(m);const g=o.copy?"Copied":"Swapped";e.innerText=`${g}!`,x(`${g} "${d[0].innerText}" ${o.copy?"to":"and"} "${d[1].innerText}"`),setTimeout((()=>{e.innerText=o.buttonText,e.style.pointerEvents=""}),1500)}function k(e){e.style.pointerEvents="none";const t=e.innerText;if(!o.newBases)return e.classList.remove("is-primary"),e.classList.add("is-danger"),e.innerText="No changes to copy!",void setTimeout((()=>{e.classList.remove("is-danger"),e.classList.add("is-primary"),e.innerText=t,e.style.pointerEvents=""}),1500);const n=JSON.parse(o.newBases),s=JSON.stringify(n,null,"\t");navigator.clipboard.writeText(s),e.innerText="Copied!",setTimeout((()=>{e.innerText=t,e.style.pointerEvents=""}),1500)}function A(e){const t=e.value.trim().toLowerCase(),n=e.nextElementSibling.children;for(const e of Array.from(n)){const n=e,s=n.innerText.toLowerCase();!t||s.includes(t)?n.style.display="":n.style.display="none"}}function x(e){const t=document.getElementById("actionlog"),n=document.createElement("div");n.innerText=e,n.classList.add("logItem"),null==t||t.appendChild(n)}function j(){if(!o.bases)return;const e=document.getElementsByClassName("clicked");for(const t of Array.from(e))t.classList.remove("clicked");o.newBases=JSON.parse(o.bases),x("Undid Edits")}function w(e){var t;o.copy=e;const n=document.querySelector("#output .columns .arrow");null==n||n.classList.toggle("copy",e),null==n||n.classList.toggle("swap",!e);const s=document.getElementById("swap");o.buttonText=e?"Copy Selected Base":"Swap Selected Bases",null!=(t=null==s?void 0:s.style)&&t.pointerEvents||(s.innerText=o.buttonText)}(()=>{w(document.getElementById("copyCheckbox").checked),v(document.getElementById("JSONinput"));const e=["left","right"],t=document.querySelector("#output .columns"),n=t.children;function s(e){const t=document.createElement("div"),n=document.createElement("input"),s=document.createElement("div");return t.classList.add("column"),t.id=e,n.type="text",n.placeholder="🔎 Search",n.classList.add("input"),n.addEventListener("input",(function(){A(this)})),s.classList.add("bases"),t.appendChild(n),t.appendChild(s),t}t.insertAdjacentElement("afterbegin",s(e[0])),Array.from(n).at(-1).insertAdjacentElement("beforebegin",s(e[1]))})(),null==(h=document.getElementById("copyCheckbox"))||h.addEventListener("change",(function(){w(this.checked)})),null==(E=document.getElementById("reset"))||E.addEventListener("click",(()=>j())),null==(L=document.getElementById("copy"))||L.addEventListener("click",(function(){k(this)})),null==(T=document.getElementById("swap"))||T.addEventListener("click",(function(){J(this)})),null==(B=document.getElementById("JSONinput"))||B.addEventListener("input",(function(){v(this)})); diff --git a/assets/index-40aa9a7b.css b/assets/index-e935b917.css similarity index 100% rename from assets/index-40aa9a7b.css rename to assets/index-e935b917.css diff --git a/index.html b/index.html index cc71a7b..384c773 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ - Base Relocator

Base Relocator


Log

\ No newline at end of file + Base Relocator

Base Relocator


Log

\ No newline at end of file