diff --git a/assets/index-q82R8QKn.js b/assets/index-WeheIw_G.js similarity index 50% rename from assets/index-q82R8QKn.js rename to assets/index-WeheIw_G.js index 0e13936..6bf4f02 100644 --- a/assets/index-q82R8QKn.js +++ b/assets/index-WeheIw_G.js @@ -1,4 +1,4 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const b of u.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&o(b)}).observe(document,{childList:!0,subtree:!0});function r(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(a){if(a.ep)return;a.ep=!0;const u=r(a);fetch(a.href,u)}})();const $e=e=>{const t=De(e);return Ue(t)},De=e=>{const t=Xe(e.angle);return Ne({...e,angle:t})},Xe=e=>e*Math.PI/180,Ne=e=>({x:e.radius*Math.cos(e.angle),y:e.radius*Math.sin(e.angle)}),Ue=e=>({left:(e.x+1)/2,top:1-(e.y+1)/2}),be=e=>{const t=Be(e);return qe(t)},Be=e=>({x:e.left*2-1,y:1-e.top*2}),qe=e=>{const t=Ge(e);return{angle:Ae(t.angle),radius:t.radius}},Ae=e=>e*180/Math.PI,Ge=e=>({angle:Ye(Math.atan2(e.y,e.x),2*Math.PI),radius:Math.sqrt(e.x**2+e.y**2)}),Ye=(e,t)=>(e%t+t)%t,ve=document.createElement("template");ve.innerHTML=` +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function r(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(a){if(a.ep)return;a.ep=!0;const u=r(a);fetch(a.href,u)}})();const Ze=e=>{const t=Ke(e);return et(t)},Ke=e=>{const t=Je(e.angle);return Qe({...e,angle:t})},Je=e=>e*Math.PI/180,Qe=e=>({x:e.radius*Math.cos(e.angle),y:e.radius*Math.sin(e.angle)}),et=e=>({left:(e.x+1)/2,top:1-(e.y+1)/2}),me=e=>{const t=tt(e);return rt(t)},tt=e=>({x:e.left*2-1,y:1-e.top*2}),rt=e=>{const t=at(e);return{angle:nt(t.angle),radius:t.radius}},nt=e=>e*180/Math.PI,at=e=>({angle:ot(Math.atan2(e.y,e.x),2*Math.PI),radius:Math.sqrt(e.x**2+e.y**2)}),ot=(e,t)=>(e%t+t)%t,ve=document.createElement("template");ve.innerHTML=`
-`;class Ke extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ve.content.cloneNode(!0))}get point(){return this.shadowRoot.querySelector(".point")}get colour(){return this._colour}set colour(t){this.point.style.background=t.getHexCode();const{hue:r,saturation:o}=t.getHsl(),u=$e({angle:r,radius:o});this.point.style.setProperty("--left",`${u.left}`),this.point.style.setProperty("--top",`${u.top}`)}connectedCallback(){this.point.addEventListener("drag",t=>{this.dispatchEvent(new CustomEvent("point-drag",{detail:{left:t.x,top:t.y}}))}),this.point.addEventListener("dragstart",t=>{t.dataTransfer.setDragImage(new Image,0,0)}),this.getAttribute("base")===""&&(this.point.setAttribute("draggable","true"),this.point.setAttribute("class","point base"))}}window.customElements.define("colour-circle-point",Ke);var P=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},y={},re={},ne={},ae={},O={},oe={},N={};Object.defineProperty(N,"__esModule",{value:!0});N.colourFormatRegex=void 0;N.colourFormatRegex={hsl:/^hsl\s*\(\s*(?