From 959d539bf6cd02ffec2a3a694dbabe435055984d Mon Sep 17 00:00:00 2001 From: Tomas Date: Fri, 29 Mar 2024 15:17:09 +0100 Subject: [PATCH] Updates --- .../{index-q82R8QKn.js => index-WeheIw_G.js} | 28 +++++++++---------- index.html | 27 +++++++++--------- 2 files changed, 27 insertions(+), 28 deletions(-) rename assets/{index-q82R8QKn.js => index-WeheIw_G.js} (50%) 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*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*%?)\s*,\s*(?\d*\.?\d*%?)\s*\)$/i,hsla:/^hsla\s*\(\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*%?)\s*,\s*(?\d*\.?\d*%?)\s*,\s*(?\d*\.?\d*%?)\s*\)$/i,namedColour:/[\w-]+/i,namedTransparent:/transparent/i,rgbDecimal:/^rgb\s*\(\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*)\s*\)$/i,rgbHexLongWithHash:/^#[0-9a-fA-F]{6}$/i,rgbHexLongWithoutHash:/^[0-9a-fA-F]{6}$/i,rgbHexShortWithHash:/^#[0-9a-f]{3}$/i,rgbHexShortWithoutHash:/^[0-9a-f]{3}$/i,rgbaDecimal:/^rgba\s*\(\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*%?)\s*\)$/i,rgbaHexLongWithHash:/^#[0-9a-f]{8}$/i,rgbaHexLongWithoutHash:/^[0-9a-f]{8}$/i,rgbaHexShortWithHash:/^#[0-9a-fA-F]{4}$/i,rgbaHexShortWithoutHash:/^[0-9a-fA-F]{4}$/i};var ge={},Z={};Object.defineProperty(Z,"__esModule",{value:!0});Z.namedColours=void 0;Z.namedColours={aliceblue:{red:240,green:248,blue:255},antiquewhite:{red:250,green:235,blue:215},aqua:{red:0,green:255,blue:255},aquamarine:{red:127,green:255,blue:212},azure:{red:240,green:255,blue:255},beige:{red:245,green:245,blue:220},bisque:{red:255,green:228,blue:196},black:{red:0,green:0,blue:0},blanchedalmond:{red:255,green:235,blue:205},blue:{red:0,green:0,blue:255},blueviolet:{red:138,green:43,blue:226},brown:{red:165,green:42,blue:42},burlywood:{red:222,green:184,blue:135},cadetblue:{red:95,green:158,blue:160},chartreuse:{red:127,green:255,blue:0},chocolate:{red:210,green:105,blue:30},coral:{red:255,green:127,blue:80},cornflowerblue:{red:100,green:149,blue:237},cornsilk:{red:255,green:248,blue:220},crimson:{red:220,green:20,blue:60},cyan:{red:0,green:255,blue:255},darkblue:{red:0,green:0,blue:139},darkcyan:{red:0,green:139,blue:139},darkgoldenrod:{red:184,green:134,blue:11},darkgray:{red:169,green:169,blue:169},darkgreen:{red:0,green:100,blue:0},darkgrey:{red:169,green:169,blue:169},darkkhaki:{red:189,green:183,blue:107},darkmagenta:{red:139,green:0,blue:139},darkolivegreen:{red:85,green:107,blue:47},darkorange:{red:255,green:140,blue:0},darkorchid:{red:153,green:50,blue:204},darkred:{red:139,green:0,blue:0},darksalmon:{red:233,green:150,blue:122},darkseagreen:{red:143,green:188,blue:143},darkslateblue:{red:72,green:61,blue:139},darkslategray:{red:47,green:79,blue:79},darkslategrey:{red:47,green:79,blue:79},darkturquoise:{red:0,green:206,blue:209},darkviolet:{red:148,green:0,blue:211},deeppink:{red:255,green:20,blue:147},deepskyblue:{red:0,green:191,blue:255},dimgray:{red:105,green:105,blue:105},dimgrey:{red:105,green:105,blue:105},dodgerblue:{red:30,green:144,blue:255},firebrick:{red:178,green:34,blue:34},floralwhite:{red:255,green:250,blue:240},forestgreen:{red:34,green:139,blue:34},fuchsia:{red:255,green:0,blue:255},gainsboro:{red:220,green:220,blue:220},ghostwhite:{red:248,green:248,blue:255},gold:{red:255,green:215,blue:0},goldenrod:{red:218,green:165,blue:32},gray:{red:128,green:128,blue:128},green:{red:0,green:128,blue:0},greenyellow:{red:173,green:255,blue:47},grey:{red:128,green:128,blue:128},honeydew:{red:240,green:255,blue:240},hotpink:{red:255,green:105,blue:180},indianred:{red:205,green:92,blue:92},indigo:{red:75,green:0,blue:130},ivory:{red:255,green:255,blue:240},khaki:{red:240,green:230,blue:140},lavender:{red:230,green:230,blue:250},lavenderblush:{red:255,green:240,blue:245},lawngreen:{red:124,green:252,blue:0},lemonchiffon:{red:255,green:250,blue:205},lightblue:{red:173,green:216,blue:230},lightcoral:{red:240,green:128,blue:128},lightcyan:{red:224,green:255,blue:255},lightgoldenrodyellow:{red:250,green:250,blue:210},lightgray:{red:211,green:211,blue:211},lightgreen:{red:144,green:238,blue:144},lightgrey:{red:211,green:211,blue:211},lightpink:{red:255,green:182,blue:193},lightsalmon:{red:255,green:160,blue:122},lightseagreen:{red:32,green:178,blue:170},lightskyblue:{red:135,green:206,blue:250},lightslategray:{red:119,green:136,blue:153},lightslategrey:{red:119,green:136,blue:153},lightsteelblue:{red:176,green:196,blue:222},lightyellow:{red:255,green:255,blue:224},lime:{red:0,green:255,blue:0},limegreen:{red:50,green:205,blue:50},linen:{red:250,green:240,blue:230},magenta:{red:255,green:0,blue:255},maroon:{red:128,green:0,blue:0},mediumaquamarine:{red:102,green:205,blue:170},mediumblue:{red:0,green:0,blue:205},mediumorchid:{red:186,green:85,blue:211},mediumpurple:{red:147,green:112,blue:219},mediumseagreen:{red:60,green:179,blue:113},mediumslateblue:{red:123,green:104,blue:238},mediumspringgreen:{red:0,green:250,blue:154},mediumturquoise:{red:72,green:209,blue:204},mediumvioletred:{red:199,green:21,blue:133},midnightblue:{red:25,green:25,blue:112},mintcream:{red:245,green:255,blue:250},mistyrose:{red:255,green:228,blue:225},moccasin:{red:255,green:228,blue:181},navajowhite:{red:255,green:222,blue:173},navy:{red:0,green:0,blue:128},oldlace:{red:253,green:245,blue:230},olive:{red:128,green:128,blue:0},olivedrab:{red:107,green:142,blue:35},orange:{red:255,green:165,blue:0},orangered:{red:255,green:69,blue:0},orchid:{red:218,green:112,blue:214},palegoldenrod:{red:238,green:232,blue:170},palegreen:{red:152,green:251,blue:152},paleturquoise:{red:175,green:238,blue:238},palevioletred:{red:219,green:112,blue:147},papayawhip:{red:255,green:239,blue:213},peachpuff:{red:255,green:218,blue:185},peru:{red:205,green:133,blue:63},pink:{red:255,green:192,blue:203},plum:{red:221,green:160,blue:221},powderblue:{red:176,green:224,blue:230},purple:{red:128,green:0,blue:128},rebeccapurple:{red:102,green:51,blue:153},red:{red:255,green:0,blue:0},rosybrown:{red:188,green:143,blue:143},royalblue:{red:65,green:105,blue:225},saddlebrown:{red:139,green:69,blue:19},salmon:{red:250,green:128,blue:114},sandybrown:{red:244,green:164,blue:96},seagreen:{red:46,green:139,blue:87},seashell:{red:255,green:245,blue:238},sienna:{red:160,green:82,blue:45},silver:{red:192,green:192,blue:192},skyblue:{red:135,green:206,blue:235},slateblue:{red:106,green:90,blue:205},slategray:{red:112,green:128,blue:144},slategrey:{red:112,green:128,blue:144},snow:{red:255,green:250,blue:250},springgreen:{red:0,green:255,blue:127},steelblue:{red:70,green:130,blue:180},tan:{red:210,green:180,blue:140},teal:{red:0,green:128,blue:128},thistle:{red:216,green:191,blue:216},tomato:{red:255,green:99,blue:71},turquoise:{red:64,green:224,blue:208},violet:{red:238,green:130,blue:238},wheat:{red:245,green:222,blue:179},white:{red:255,green:255,blue:255},whitesmoke:{red:245,green:245,blue:245},yellow:{red:255,green:255,blue:0},yellowgreen:{red:154,green:205,blue:50}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isValidUnitIntervalOrPercentageValue=e.isValidUnitIntervalValue=e.isValid255ScaleValue=e.isValidPercentageValue=e.isValidDegreeValue=e.isValidTransparentName=e.isValidColourName=e.isValidRgba255String=e.isValidRgb255String=e.isValidHslaString=e.isValidHslString=void 0;var t=N,r=Z,o=function(d){var g=t.colourFormatRegex.hsl,H=d.trim().toLowerCase(),C=g.test(H);if(!C)return!1;var v=g.exec(H).groups,W=v.hue,F=v.saturation,I=v.lightness;return(0,e.isValidDegreeValue)(W)&&(0,e.isValidUnitIntervalOrPercentageValue)(F)&&(0,e.isValidUnitIntervalOrPercentageValue)(I)};e.isValidHslString=o;var a=function(d){var g=t.colourFormatRegex.hsla,H=d.trim().toLowerCase(),C=g.test(H);if(!C)return!1;var v=g.exec(H).groups,W=v.hue,F=v.saturation,I=v.lightness,Y=v.alpha;return(0,e.isValidDegreeValue)(W)&&(0,e.isValidUnitIntervalOrPercentageValue)(F)&&(0,e.isValidUnitIntervalOrPercentageValue)(I)&&(0,e.isValidUnitIntervalOrPercentageValue)(Y)};e.isValidHslaString=a;var u=function(d){var g=t.colourFormatRegex.rgbDecimal,H=d.trim().toLowerCase(),C=g.test(H);if(!C)return!1;var v=g.exec(H).groups,W=v.red,F=v.green,I=v.blue;return(0,e.isValid255ScaleValue)(W)&&(0,e.isValid255ScaleValue)(F)&&(0,e.isValid255ScaleValue)(I)};e.isValidRgb255String=u;var b=function(d){var g=t.colourFormatRegex.rgbaDecimal,H=d.trim().toLowerCase(),C=g.test(H);if(!C)return!1;var v=g.exec(H).groups,W=v.red,F=v.green,I=v.blue,Y=v.alpha;return(0,e.isValid255ScaleValue)(W)&&(0,e.isValid255ScaleValue)(F)&&(0,e.isValid255ScaleValue)(I)&&(0,e.isValidUnitIntervalOrPercentageValue)(Y)};e.isValidRgba255String=b;var c=function(d){var g=d.trim().toLowerCase();return Object.keys(r.namedColours).includes(g)};e.isValidColourName=c;var x=function(d){var g=d.trim().toLowerCase();return g==="transparent"};e.isValidTransparentName=x;var V=function(d){return/^(((([12]?\d{1,2})|(3[012345]\d))(\.\d+)?)|360(\.0+)?|\.\d+)$/.test(d)};e.isValidDegreeValue=V;var k=function(d){return/^((((\d{1,2}(\.\d+)?)|(100(\.0+)?)|(\.\d+))%)|0)$/.test(d)};e.isValidPercentageValue=k;var z=function(d){return/^((((1?\d{1,2})|(2([01234]\d|5[01234])))(\.\d+)?)|255(\.0+)?|\.\d+)$/.test(d)};e.isValid255ScaleValue=z;var U=function(d){return/^(0|0\.\d+|\.\d+|1(\.0+)?)$/.test(d)};e.isValidUnitIntervalValue=U;var m=function(d){return(0,e.isValidUnitIntervalValue)(d)||(0,e.isValidPercentageValue)(d)};e.isValidUnitIntervalOrPercentageValue=m})(ge);Object.defineProperty(oe,"__esModule",{value:!0});oe.isOnFormat=void 0;var Je=N,K=ge,Qe=function(e,t){switch(t){case"hsl":return(0,K.isValidHslString)(e);case"hsla":return(0,K.isValidHslaString)(e);case"namedColour":return(0,K.isValidColourName)(e);case"rgbDecimal":return(0,K.isValidRgb255String)(e);case"rgbaDecimal":return(0,K.isValidRgba255String)(e);default:return Je.colourFormatRegex[t].test(e)}};oe.isOnFormat=Qe;Object.defineProperty(O,"__esModule",{value:!0});O.ensureWithinUnitInterval=O.evaluateFormat=O.floor=J=O.round=O.modulo=void 0;var Ze=oe,et=N,tt=function(e,t){return(e%t+t)%t};O.modulo=tt;var rt=function(e,t){return t===void 0&&(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)},J=O.round=rt,nt=function(e,t){return t===void 0&&(t=0),Math.floor(e*Math.pow(10,t))/Math.pow(10,t)};O.floor=nt;var at=function(e){for(var t=Object.keys(et.colourFormatRegex),r=0,o=t;r1?1:e};O.ensureWithinUnitInterval=ot;var se={};Object.defineProperty(se,"__esModule",{value:!0});se.HueRegion=void 0;var me;(function(e){e.RedYellow="RedYellow",e.YellowGreen="YellowGreen",e.GreenCyan="GreenCyan",e.CyanBlue="CyanBlue",e.BlueMagenta="BlueMagenta",e.MagentaRed="MagentaRed"})(me||(se.HueRegion=me={}));(function(e){var t=P&&P.__assign||function(){return t=Object.assign||function(n){for(var s,i=1,l=arguments.length;i=0&&s<60?a.HueRegion.RedYellow:s>=60&&s<120?a.HueRegion.YellowGreen:s>=120&&s<180?a.HueRegion.GreenCyan:s>=180&&s<240?a.HueRegion.CyanBlue:s>=240&&s<300?a.HueRegion.BlueMagenta:a.HueRegion.MagentaRed},z=function(n,s){var i=n.red,l=n.green,h=n.blue;return{red:i+s,green:l+s,blue:h+s}},U=function(n){var s=b(n),i=s.red,l=s.green,h=s.blue,p=Math.max(i,l,h),w=Math.min(i,l,h),_=p-w,S=(p+w)/2,B=_===0?0:_/(1-Math.abs(2*S-1)),ue=_===0?0:d(i,l,h,p,_),he=(0,o.modulo)(ue*60,360);return{hue:he,saturation:B,lightness:S}};e.rgbToHsl=U;var m=function(n){var s=n.alpha,i=r(n,["alpha"]),l=(0,e.rgbToHsl)(i);return t(t({},l),{alpha:s})};e.rgbaToHsla=m;var d=function(n,s,i,l,h){switch(l){case n:return(s-i)/h;case s:return(i-n)/h+2;case i:return(n-s)/h+4;default:return 0}},g=function(n){var s=n.hue,i=n.saturation,l=n.value,h=l*i,p=s/60,w=h*(1-Math.abs(p%2-1)),_=l-h,S=V(s,h,w),B=z(S,_);return u(B)};e.hsvToRgb=g;var H=function(n){var s=b(n),i=s.red,l=s.green,h=s.blue,p=Math.max(i,l,h),w=Math.min(i,l,h),_=p-w,S=p,B=S===0?0:_/S,ue=_===0?0:d(i,l,h,p,_),he=(0,o.modulo)(ue*60,360);return{hue:he,saturation:B,value:S}};e.rgbToHsv=H;var C=function(n){var s=n.hue,i=n.saturation,l=n.value,h=l*i,p=(2-i)*l/2,w=h===0?0:h/(1-Math.abs(2*p-1));return{hue:s,saturation:w,lightness:p}};e.hsvToHsl=C;var v=function(n){var s=n.alpha,i=r(n,["alpha"]),l=(0,e.hsvToHsl)(i);return t(t({},l),{alpha:s})};e.hsvaToHsla=v;var W=function(n){var s=n.hue,i=n.saturation,l=n.lightness,h=(1-Math.abs(2*l-1))*i,p=l+h/2,w=p===0?0:h/p;return{hue:s,saturation:w,value:p}};e.hslToHsv=W;var F=function(n){var s=n.alpha,i=r(n,["alpha"]),l=(0,e.hslToHsv)(i);return t(t({},l),{alpha:s})};e.hslaToHsva=F;var I=function(n){var s=n.hue,i=n.saturation,l=n.lightness,h=n.alpha,p={hue:s,saturation:i,lightness:l},w=(0,e.hslToCieXyz)(p);return t(t({},w),{alpha:h})};e.cieHslaToXyza=I;var Y=function(n){var s=(0,e.hslToRgb)(n);return(0,e.rgbToCieXyz)(s)};e.hslToCieXyz=Y;var Le=function(n){var s=b(n),i=Me(s),l=i.red,h=i.green,p=i.blue,w=l*.4124564+h*.3575761+p*.1804375,_=l*.2126729+h*.7151522+p*.072175,S=l*.0193339+h*.119192+p*.9503041;return{x:w,y:_,z:S}};e.rgbToCieXyz=Le;var Me=function(n){var s=n.red,i=n.green,l=n.blue;return{red:ie(s),green:ie(i),blue:ie(l)}},ie=function(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)},ke=function(n){var s=n.x,i=n.y,l=n.z,h=n.alpha,p=(0,e.cieXyzToHsl)({x:s,y:i,z:l});return t(t({},p),{alpha:h})};e.cieXyzaToHsla=ke;var Fe=function(n){var s=(0,e.cieXyzToRgb)(n);return(0,e.rgbToHsl)(s)};e.cieXyzToHsl=Fe;var Ie=function(n){var s=n.x,i=n.y,l=n.z,h=s*3.2404542+i*-1.5371385+l*-.4985314,p=s*-.969266+i*1.8760108+l*.041556,w=s*.0556434+i*-.2040259+l*1.0572252,_=ze({red:h,green:p,blue:w}),S=je(_);return u(S)};e.cieXyzToRgb=Ie;var je=function(n){var s=n.red,i=n.green,l=n.blue;return{red:(0,o.ensureWithinUnitInterval)(s),green:(0,o.ensureWithinUnitInterval)(i),blue:(0,o.ensureWithinUnitInterval)(l)}},ze=function(n){var s=n.red,i=n.green,l=n.blue;return{red:le(s),green:le(i),blue:le(l)}},le=function(n){return n<=.0031308?n*12.92:1.055*Math.pow(n,1/2.4)-.055}})(ae);var f={},ce={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.numberFromPercentage=e.numberFromPercentageOrUnitInterval=e.shortHexToDecimal=e.hexPairToDecimal=void 0;var t=ge,r=function(c){return parseInt(c,16)};e.hexPairToDecimal=r;var o=function(c){return(0,e.hexPairToDecimal)(c+c)};e.shortHexToDecimal=o;var a=function(c){return(0,t.isValidUnitIntervalValue)(c)?parseFloat(c):(0,e.numberFromPercentage)(c)};e.numberFromPercentageOrUnitInterval=a;var u=function(c){var x=b.exec(c)[0];return parseFloat(x)/100};e.numberFromPercentage=u;var b=/\d*\.?\d*(?=%)/})(ce);var fe={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.shortHexWithoutHashToRgba=e.shortHexWithHashToRgba=e.shortHexWithoutHashToRgb=e.shortHexWithHashToRgb=e.hexWithoutHashToRgba=e.hexWithHashToRgba=e.hexWithoutHashToRgb=e.hexWithHashToRgb=e.rgba255StringToRgba=e.rgb255StringToRgb=void 0;var t=N,r=ce,o=function(m){var d=t.colourFormatRegex.rgbDecimal,g=d.exec(m).groups,H=g.red,C=g.green,v=g.blue;return{red:parseFloat(H),green:parseFloat(C),blue:parseFloat(v)}};e.rgb255StringToRgb=o;var a=function(m){var d=t.colourFormatRegex.rgbaDecimal,g=d.exec(m).groups,H=g.red,C=g.green,v=g.blue,W=g.alpha;return{red:parseFloat(H),green:parseFloat(C),blue:parseFloat(v),alpha:(0,r.numberFromPercentageOrUnitInterval)(W)}};e.rgba255StringToRgba=a;var u=function(m){return(0,e.hexWithoutHashToRgb)(m.substring(1))};e.hexWithHashToRgb=u;var b=function(m){var d=(0,r.hexPairToDecimal)(m.substring(0,2)),g=(0,r.hexPairToDecimal)(m.substring(2,4)),H=(0,r.hexPairToDecimal)(m.substring(4,6));return{red:d,green:g,blue:H}};e.hexWithoutHashToRgb=b;var c=function(m){return(0,e.hexWithoutHashToRgba)(m.substring(1))};e.hexWithHashToRgba=c;var x=function(m){var d=(0,e.hexWithoutHashToRgb)(m),g=d.red,H=d.green,C=d.blue,v=(0,r.hexPairToDecimal)(m.substring(6,8))/255;return{red:g,green:H,blue:C,alpha:v}};e.hexWithoutHashToRgba=x;var V=function(m){return(0,e.shortHexWithoutHashToRgb)(m.substring(1))};e.shortHexWithHashToRgb=V;var k=function(m){var d=(0,r.shortHexToDecimal)(m.substring(0,1)),g=(0,r.shortHexToDecimal)(m.substring(1,2)),H=(0,r.shortHexToDecimal)(m.substring(2,3));return{red:d,green:g,blue:H}};e.shortHexWithoutHashToRgb=k;var z=function(m){return(0,e.shortHexWithoutHashToRgba)(m.substring(1))};e.shortHexWithHashToRgba=z;var U=function(m){var d=(0,e.shortHexWithoutHashToRgb)(m),g=d.red,H=d.green,C=d.blue,v=(0,r.shortHexToDecimal)(m.substring(3,4))/255;return{red:g,green:H,blue:C,alpha:v}};e.shortHexWithoutHashToRgba=U})(fe);var te=P&&P.__assign||function(){return te=Object.assign||function(e){for(var t,r=1,o=arguments.length;r{const r=360/e,o=[];for(let a=0;a{const r=1/(e+1),o=t.getHsl(),a=[];for(let u=1;u<=e;u++){const b=u*r,c=new y.Chromator({...o,lightness:b});a.push(c)}return a},Te=document.createElement("template");Te.innerHTML=` +`;class st 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=Ze({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",st);var L=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},w={},te={},re={},ne={},k={},ae={},B={};Object.defineProperty(B,"__esModule",{value:!0});B.colourFormatRegex=void 0;B.colourFormatRegex={hsl:/^hsl\s*\(\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*%?)\s*,\s*(?\d*\.?\d*%?)\s*\)$/i,hsla:/^hsla\s*\(\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*%?)\s*,\s*(?\d*\.?\d*%?)\s*,\s*(?\d*\.?\d*%?)\s*\)$/i,namedColour:/[\w-]+/i,namedTransparent:/transparent/i,rgbDecimal:/^rgb\s*\(\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*)\s*\)$/i,rgbHexLongWithHash:/^#[0-9a-fA-F]{6}$/i,rgbHexLongWithoutHash:/^[0-9a-fA-F]{6}$/i,rgbHexShortWithHash:/^#[0-9a-f]{3}$/i,rgbHexShortWithoutHash:/^[0-9a-f]{3}$/i,rgbaDecimal:/^rgba\s*\(\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*)\s*,\s*(?\d*\.?\d*%?)\s*\)$/i,rgbaHexLongWithHash:/^#[0-9a-f]{8}$/i,rgbaHexLongWithoutHash:/^[0-9a-f]{8}$/i,rgbaHexShortWithHash:/^#[0-9a-fA-F]{4}$/i,rgbaHexShortWithoutHash:/^[0-9a-fA-F]{4}$/i};var ge={},Q={};Object.defineProperty(Q,"__esModule",{value:!0});Q.namedColours=void 0;Q.namedColours={aliceblue:{red:240,green:248,blue:255},antiquewhite:{red:250,green:235,blue:215},aqua:{red:0,green:255,blue:255},aquamarine:{red:127,green:255,blue:212},azure:{red:240,green:255,blue:255},beige:{red:245,green:245,blue:220},bisque:{red:255,green:228,blue:196},black:{red:0,green:0,blue:0},blanchedalmond:{red:255,green:235,blue:205},blue:{red:0,green:0,blue:255},blueviolet:{red:138,green:43,blue:226},brown:{red:165,green:42,blue:42},burlywood:{red:222,green:184,blue:135},cadetblue:{red:95,green:158,blue:160},chartreuse:{red:127,green:255,blue:0},chocolate:{red:210,green:105,blue:30},coral:{red:255,green:127,blue:80},cornflowerblue:{red:100,green:149,blue:237},cornsilk:{red:255,green:248,blue:220},crimson:{red:220,green:20,blue:60},cyan:{red:0,green:255,blue:255},darkblue:{red:0,green:0,blue:139},darkcyan:{red:0,green:139,blue:139},darkgoldenrod:{red:184,green:134,blue:11},darkgray:{red:169,green:169,blue:169},darkgreen:{red:0,green:100,blue:0},darkgrey:{red:169,green:169,blue:169},darkkhaki:{red:189,green:183,blue:107},darkmagenta:{red:139,green:0,blue:139},darkolivegreen:{red:85,green:107,blue:47},darkorange:{red:255,green:140,blue:0},darkorchid:{red:153,green:50,blue:204},darkred:{red:139,green:0,blue:0},darksalmon:{red:233,green:150,blue:122},darkseagreen:{red:143,green:188,blue:143},darkslateblue:{red:72,green:61,blue:139},darkslategray:{red:47,green:79,blue:79},darkslategrey:{red:47,green:79,blue:79},darkturquoise:{red:0,green:206,blue:209},darkviolet:{red:148,green:0,blue:211},deeppink:{red:255,green:20,blue:147},deepskyblue:{red:0,green:191,blue:255},dimgray:{red:105,green:105,blue:105},dimgrey:{red:105,green:105,blue:105},dodgerblue:{red:30,green:144,blue:255},firebrick:{red:178,green:34,blue:34},floralwhite:{red:255,green:250,blue:240},forestgreen:{red:34,green:139,blue:34},fuchsia:{red:255,green:0,blue:255},gainsboro:{red:220,green:220,blue:220},ghostwhite:{red:248,green:248,blue:255},gold:{red:255,green:215,blue:0},goldenrod:{red:218,green:165,blue:32},gray:{red:128,green:128,blue:128},green:{red:0,green:128,blue:0},greenyellow:{red:173,green:255,blue:47},grey:{red:128,green:128,blue:128},honeydew:{red:240,green:255,blue:240},hotpink:{red:255,green:105,blue:180},indianred:{red:205,green:92,blue:92},indigo:{red:75,green:0,blue:130},ivory:{red:255,green:255,blue:240},khaki:{red:240,green:230,blue:140},lavender:{red:230,green:230,blue:250},lavenderblush:{red:255,green:240,blue:245},lawngreen:{red:124,green:252,blue:0},lemonchiffon:{red:255,green:250,blue:205},lightblue:{red:173,green:216,blue:230},lightcoral:{red:240,green:128,blue:128},lightcyan:{red:224,green:255,blue:255},lightgoldenrodyellow:{red:250,green:250,blue:210},lightgray:{red:211,green:211,blue:211},lightgreen:{red:144,green:238,blue:144},lightgrey:{red:211,green:211,blue:211},lightpink:{red:255,green:182,blue:193},lightsalmon:{red:255,green:160,blue:122},lightseagreen:{red:32,green:178,blue:170},lightskyblue:{red:135,green:206,blue:250},lightslategray:{red:119,green:136,blue:153},lightslategrey:{red:119,green:136,blue:153},lightsteelblue:{red:176,green:196,blue:222},lightyellow:{red:255,green:255,blue:224},lime:{red:0,green:255,blue:0},limegreen:{red:50,green:205,blue:50},linen:{red:250,green:240,blue:230},magenta:{red:255,green:0,blue:255},maroon:{red:128,green:0,blue:0},mediumaquamarine:{red:102,green:205,blue:170},mediumblue:{red:0,green:0,blue:205},mediumorchid:{red:186,green:85,blue:211},mediumpurple:{red:147,green:112,blue:219},mediumseagreen:{red:60,green:179,blue:113},mediumslateblue:{red:123,green:104,blue:238},mediumspringgreen:{red:0,green:250,blue:154},mediumturquoise:{red:72,green:209,blue:204},mediumvioletred:{red:199,green:21,blue:133},midnightblue:{red:25,green:25,blue:112},mintcream:{red:245,green:255,blue:250},mistyrose:{red:255,green:228,blue:225},moccasin:{red:255,green:228,blue:181},navajowhite:{red:255,green:222,blue:173},navy:{red:0,green:0,blue:128},oldlace:{red:253,green:245,blue:230},olive:{red:128,green:128,blue:0},olivedrab:{red:107,green:142,blue:35},orange:{red:255,green:165,blue:0},orangered:{red:255,green:69,blue:0},orchid:{red:218,green:112,blue:214},palegoldenrod:{red:238,green:232,blue:170},palegreen:{red:152,green:251,blue:152},paleturquoise:{red:175,green:238,blue:238},palevioletred:{red:219,green:112,blue:147},papayawhip:{red:255,green:239,blue:213},peachpuff:{red:255,green:218,blue:185},peru:{red:205,green:133,blue:63},pink:{red:255,green:192,blue:203},plum:{red:221,green:160,blue:221},powderblue:{red:176,green:224,blue:230},purple:{red:128,green:0,blue:128},rebeccapurple:{red:102,green:51,blue:153},red:{red:255,green:0,blue:0},rosybrown:{red:188,green:143,blue:143},royalblue:{red:65,green:105,blue:225},saddlebrown:{red:139,green:69,blue:19},salmon:{red:250,green:128,blue:114},sandybrown:{red:244,green:164,blue:96},seagreen:{red:46,green:139,blue:87},seashell:{red:255,green:245,blue:238},sienna:{red:160,green:82,blue:45},silver:{red:192,green:192,blue:192},skyblue:{red:135,green:206,blue:235},slateblue:{red:106,green:90,blue:205},slategray:{red:112,green:128,blue:144},slategrey:{red:112,green:128,blue:144},snow:{red:255,green:250,blue:250},springgreen:{red:0,green:255,blue:127},steelblue:{red:70,green:130,blue:180},tan:{red:210,green:180,blue:140},teal:{red:0,green:128,blue:128},thistle:{red:216,green:191,blue:216},tomato:{red:255,green:99,blue:71},turquoise:{red:64,green:224,blue:208},violet:{red:238,green:130,blue:238},wheat:{red:245,green:222,blue:179},white:{red:255,green:255,blue:255},whitesmoke:{red:245,green:245,blue:245},yellow:{red:255,green:255,blue:0},yellowgreen:{red:154,green:205,blue:50}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isValidUnitIntervalOrPercentageValue=e.isValidUnitIntervalValue=e.isValid255ScaleValue=e.isValidPercentageValue=e.isValidDegreeValue=e.isValidTransparentName=e.isValidColourName=e.isValidRgba255String=e.isValidRgb255String=e.isValidHslaString=e.isValidHslString=void 0;var t=B,r=Q,o=function(h){var m=t.colourFormatRegex.hsl,T=h.trim().toLowerCase(),O=m.test(T);if(!O)return!1;var H=m.exec(T).groups,M=H.hue,z=H.saturation,j=H.lightness;return(0,e.isValidDegreeValue)(M)&&(0,e.isValidUnitIntervalOrPercentageValue)(z)&&(0,e.isValidUnitIntervalOrPercentageValue)(j)};e.isValidHslString=o;var a=function(h){var m=t.colourFormatRegex.hsla,T=h.trim().toLowerCase(),O=m.test(T);if(!O)return!1;var H=m.exec(T).groups,M=H.hue,z=H.saturation,j=H.lightness,Z=H.alpha;return(0,e.isValidDegreeValue)(M)&&(0,e.isValidUnitIntervalOrPercentageValue)(z)&&(0,e.isValidUnitIntervalOrPercentageValue)(j)&&(0,e.isValidUnitIntervalOrPercentageValue)(Z)};e.isValidHslaString=a;var u=function(h){var m=t.colourFormatRegex.rgbDecimal,T=h.trim().toLowerCase(),O=m.test(T);if(!O)return!1;var H=m.exec(T).groups,M=H.red,z=H.green,j=H.blue;return(0,e.isValid255ScaleValue)(M)&&(0,e.isValid255ScaleValue)(z)&&(0,e.isValid255ScaleValue)(j)};e.isValidRgb255String=u;var c=function(h){var m=t.colourFormatRegex.rgbaDecimal,T=h.trim().toLowerCase(),O=m.test(T);if(!O)return!1;var H=m.exec(T).groups,M=H.red,z=H.green,j=H.blue,Z=H.alpha;return(0,e.isValid255ScaleValue)(M)&&(0,e.isValid255ScaleValue)(z)&&(0,e.isValid255ScaleValue)(j)&&(0,e.isValidUnitIntervalOrPercentageValue)(Z)};e.isValidRgba255String=c;var b=function(h){var m=h.trim().toLowerCase();return Object.keys(r.namedColours).includes(m)};e.isValidColourName=b;var C=function(h){var m=h.trim().toLowerCase();return m==="transparent"};e.isValidTransparentName=C;var V=function(h){return/^(((([12]?\d{1,2})|(3[012345]\d))(\.\d+)?)|360(\.0+)?|\.\d+)$/.test(h)};e.isValidDegreeValue=V;var v=function(h){return/^((((\d{1,2}(\.\d+)?)|(100(\.0+)?)|(\.\d+))%)|0)$/.test(h)};e.isValidPercentageValue=v;var f=function(h){return/^((((1?\d{1,2})|(2([01234]\d|5[01234])))(\.\d+)?)|255(\.0+)?|\.\d+)$/.test(h)};e.isValid255ScaleValue=f;var E=function(h){return/^(0|0\.\d+|\.\d+|1(\.0+)?)$/.test(h)};e.isValidUnitIntervalValue=E;var g=function(h){return(0,e.isValidUnitIntervalValue)(h)||(0,e.isValidPercentageValue)(h)};e.isValidUnitIntervalOrPercentageValue=g})(ge);Object.defineProperty(ae,"__esModule",{value:!0});ae.isOnFormat=void 0;var it=B,K=ge,lt=function(e,t){switch(t){case"hsl":return(0,K.isValidHslString)(e);case"hsla":return(0,K.isValidHslaString)(e);case"namedColour":return(0,K.isValidColourName)(e);case"rgbDecimal":return(0,K.isValidRgb255String)(e);case"rgbaDecimal":return(0,K.isValidRgba255String)(e);default:return it.colourFormatRegex[t].test(e)}};ae.isOnFormat=lt;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.findInputToAlwaysIncreasingFunc=e.ensureWithinUnitInterval=e.evaluateFormat=e.floor=e.round=e.modulo=void 0;var t=ae,r=B,o=function(v,f){return(v%f+f)%f};e.modulo=o;var a=function(v,f){return f===void 0&&(f=0),Math.round(v*Math.pow(10,f))/Math.pow(10,f)};e.round=a;var u=function(v,f){return f===void 0&&(f=0),Math.floor(v*Math.pow(10,f))/Math.pow(10,f)};e.floor=u;var c=function(v){for(var f=Object.keys(r.colourFormatRegex),E=0,g=f;E1?1:v};e.ensureWithinUnitInterval=b;var C=function(v,f,E,g){g===void 0&&(g={start:0,end:1});var h=V(g);return Math.abs(v(h)-f)<=E?h:(v(h)=0&&s<60?a.HueRegion.RedYellow:s>=60&&s<120?a.HueRegion.YellowGreen:s>=120&&s<180?a.HueRegion.GreenCyan:s>=180&&s<240?a.HueRegion.CyanBlue:s>=240&&s<300?a.HueRegion.BlueMagenta:a.HueRegion.MagentaRed},f=function(n,s){var i=n.red,l=n.green,d=n.blue;return{red:i+s,green:l+s,blue:d+s}},E=function(n){var s=c(n),i=s.red,l=s.green,d=s.blue,p=Math.max(i,l,d),x=Math.min(i,l,d),S=p-x,P=(p+x)/2,U=S===0?0:S/(1-Math.abs(2*P-1)),le=S===0?0:h(i,l,d,p,S),ue=(0,o.modulo)(le*60,360);return{hue:ue,saturation:U,lightness:P}};e.rgbToHsl=E;var g=function(n){var s=n.alpha,i=r(n,["alpha"]),l=(0,e.rgbToHsl)(i);return t(t({},l),{alpha:s})};e.rgbaToHsla=g;var h=function(n,s,i,l,d){switch(l){case n:return(s-i)/d;case s:return(i-n)/d+2;case i:return(n-s)/d+4;default:return 0}},m=function(n){var s=n.hue,i=n.saturation,l=n.value,d=l*i,p=s/60,x=d*(1-Math.abs(p%2-1)),S=l-d,P=V(s,d,x),U=f(P,S);return u(U)};e.hsvToRgb=m;var T=function(n){var s=c(n),i=s.red,l=s.green,d=s.blue,p=Math.max(i,l,d),x=Math.min(i,l,d),S=p-x,P=p,U=P===0?0:S/P,le=S===0?0:h(i,l,d,p,S),ue=(0,o.modulo)(le*60,360);return{hue:ue,saturation:U,value:P}};e.rgbToHsv=T;var O=function(n){var s=n.hue,i=n.saturation,l=n.value,d=l*i,p=(2-i)*l/2,x=d===0?0:d/(1-Math.abs(2*p-1));return{hue:s,saturation:x,lightness:p}};e.hsvToHsl=O;var H=function(n){var s=n.alpha,i=r(n,["alpha"]),l=(0,e.hsvToHsl)(i);return t(t({},l),{alpha:s})};e.hsvaToHsla=H;var M=function(n){var s=n.hue,i=n.saturation,l=n.lightness,d=(1-Math.abs(2*l-1))*i,p=l+d/2,x=p===0?0:d/p;return{hue:s,saturation:x,value:p}};e.hslToHsv=M;var z=function(n){var s=n.alpha,i=r(n,["alpha"]),l=(0,e.hslToHsv)(i);return t(t({},l),{alpha:s})};e.hslaToHsva=z;var j=function(n){var s=n.hue,i=n.saturation,l=n.lightness,d=n.alpha,p={hue:s,saturation:i,lightness:l},x=(0,e.hslToCieXyz)(p);return t(t({},x),{alpha:d})};e.hslaToCieXyza=j;var Z=function(n){var s=(0,e.hslToRgb)(n);return(0,e.rgbToCieXyz)(s)};e.hslToCieXyz=Z;var Le=function(n){var s=c(n),i=be(s),l=i.red,d=i.green,p=i.blue,x=l*.4124564+d*.3575761+p*.1804375,S=l*.2126729+d*.7151522+p*.072175,P=l*.0193339+d*.119192+p*.9503041;return{x,y:S,z:P}};e.rgbToCieXyz=Le;var Me=function(n){var s=(0,e.hslToRgb)(n);return ke(s)};e.relativeLuminanceFromHsl=Me;var ke=function(n){var s=c(n),i=be(s),l=i.red,d=i.green,p=i.blue;return l*.2126729+d*.7151522+p*.072175},be=function(n){var s=n.red,i=n.green,l=n.blue;return{red:se(s),green:se(i),blue:se(l)}},se=function(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)},Fe=function(n){var s=n.x,i=n.y,l=n.z,d=n.alpha,p=(0,e.cieXyzToHsl)({x:s,y:i,z:l});return t(t({},p),{alpha:d})};e.cieXyzaToHsla=Fe;var Ie=function(n){var s=(0,e.cieXyzToRgb)(n);return(0,e.rgbToHsl)(s)};e.cieXyzToHsl=Ie;var ze=function(n){var s=n.x,i=n.y,l=n.z,d=s*Xe+i*De+l*Ne,p=s*Be+i*Ue+l*Ae,x=s*qe+i*Ge+l*Ye,S=$e({red:d,green:p,blue:x}),P=je(S);return u(P)};e.cieXyzToRgb=ze;var je=function(n){var s=n.red,i=n.green,l=n.blue;return{red:(0,o.ensureWithinUnitInterval)(s),green:(0,o.ensureWithinUnitInterval)(i),blue:(0,o.ensureWithinUnitInterval)(l)}},$e=function(n){var s=n.red,i=n.green,l=n.blue;return{red:ie(s),green:ie(i),blue:ie(l)}},ie=function(n){return n<=.0031308?n*12.92:1.055*Math.pow(n,1/2.4)-.055},Xe=3.2404542,De=-1.5371385,Ne=-.4985314,Be=-.969266,Ue=1.8760108,Ae=.041556,qe=.0556434,Ge=-.2040259,Ye=1.0572252})(ne);var y={},ce={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.numberFromPercentage=e.numberFromPercentageOrUnitInterval=e.shortHexToDecimal=e.hexPairToDecimal=void 0;var t=ge,r=function(b){return parseInt(b,16)};e.hexPairToDecimal=r;var o=function(b){return(0,e.hexPairToDecimal)(b+b)};e.shortHexToDecimal=o;var a=function(b){return(0,t.isValidUnitIntervalValue)(b)?parseFloat(b):(0,e.numberFromPercentage)(b)};e.numberFromPercentageOrUnitInterval=a;var u=function(b){var C=c.exec(b)[0];return parseFloat(C)/100};e.numberFromPercentage=u;var c=/\d*\.?\d*(?=%)/})(ce);var fe={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.shortHexWithoutHashToRgba=e.shortHexWithHashToRgba=e.shortHexWithoutHashToRgb=e.shortHexWithHashToRgb=e.hexWithoutHashToRgba=e.hexWithHashToRgba=e.hexWithoutHashToRgb=e.hexWithHashToRgb=e.rgba255StringToRgba=e.rgb255StringToRgb=void 0;var t=B,r=ce,o=function(g){var h=t.colourFormatRegex.rgbDecimal,m=h.exec(g).groups,T=m.red,O=m.green,H=m.blue;return{red:parseFloat(T),green:parseFloat(O),blue:parseFloat(H)}};e.rgb255StringToRgb=o;var a=function(g){var h=t.colourFormatRegex.rgbaDecimal,m=h.exec(g).groups,T=m.red,O=m.green,H=m.blue,M=m.alpha;return{red:parseFloat(T),green:parseFloat(O),blue:parseFloat(H),alpha:(0,r.numberFromPercentageOrUnitInterval)(M)}};e.rgba255StringToRgba=a;var u=function(g){return(0,e.hexWithoutHashToRgb)(g.substring(1))};e.hexWithHashToRgb=u;var c=function(g){var h=(0,r.hexPairToDecimal)(g.substring(0,2)),m=(0,r.hexPairToDecimal)(g.substring(2,4)),T=(0,r.hexPairToDecimal)(g.substring(4,6));return{red:h,green:m,blue:T}};e.hexWithoutHashToRgb=c;var b=function(g){return(0,e.hexWithoutHashToRgba)(g.substring(1))};e.hexWithHashToRgba=b;var C=function(g){var h=(0,e.hexWithoutHashToRgb)(g),m=h.red,T=h.green,O=h.blue,H=(0,r.hexPairToDecimal)(g.substring(6,8))/255;return{red:m,green:T,blue:O,alpha:H}};e.hexWithoutHashToRgba=C;var V=function(g){return(0,e.shortHexWithoutHashToRgb)(g.substring(1))};e.shortHexWithHashToRgb=V;var v=function(g){var h=(0,r.shortHexToDecimal)(g.substring(0,1)),m=(0,r.shortHexToDecimal)(g.substring(1,2)),T=(0,r.shortHexToDecimal)(g.substring(2,3));return{red:h,green:m,blue:T}};e.shortHexWithoutHashToRgb=v;var f=function(g){return(0,e.shortHexWithoutHashToRgba)(g.substring(1))};e.shortHexWithHashToRgba=f;var E=function(g){var h=(0,e.shortHexWithoutHashToRgb)(g),m=h.red,T=h.green,O=h.blue,H=(0,r.shortHexToDecimal)(g.substring(3,4))/255;return{red:m,green:T,blue:O,alpha:H}};e.shortHexWithoutHashToRgba=E})(fe);var ee=L&&L.__assign||function(){return ee=Object.assign||function(e){for(var t,r=1,o=arguments.length;r1)throw new Error("Relative luminance must be between 0 and 1. Received "+t+".");var o=function(a){var u=D(D({},r.hsl),{lightness:a});return(0,q.relativeLuminanceFromHsl)(u)};return this.hsl.lightness=(0,de.findInputToAlwaysIncreasingFunc)(o,t,1e-5),this},e}();te.Chromator=Xt;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Chromator=void 0;var t=te;Object.defineProperty(e,"Chromator",{enumerable:!0,get:function(){return t.Chromator}})})(w);const ye=(e,t)=>{const r=360/e,o=[];for(let a=0;a{const r=1/(e+1),o=t.getHsl(),a=[];for(let u=1;u<=e;u++){const c=u*r,b=new w.Chromator({...o,lightness:c});a.push(b)}return a},Te=document.createElement("template");Te.innerHTML=` -`;class Xt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Re.content.cloneNode(!0))}}window.customElements.define("shadow-box",Xt);const Ce=document.createElement("template");Ce.innerHTML=` +`;class Ut extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Re.content.cloneNode(!0))}}window.customElements.define("shadow-box",Ut);const Ce=document.createElement("template");Ce.innerHTML=` -`;class Bt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(_e.content.cloneNode(!0))}}window.customElements.define("layout-row",Bt);const Oe=document.createElement("template");Oe.innerHTML=` +`;class Gt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(_e.content.cloneNode(!0))}}window.customElements.define("layout-row",Gt);const Oe=document.createElement("template");Oe.innerHTML=` -`;class At extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Se.content.cloneNode(!0))}}window.customElements.define("layout-column",At);const Ee=document.createElement("template");Ee.innerHTML=` +`;class Zt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Se.content.cloneNode(!0))}}window.customElements.define("layout-column",Zt);const Ee=document.createElement("template");Ee.innerHTML=` -`;class Gt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ee.content.cloneNode(!0))}get colour(){return this._colour}set colour(t){this._colour=t;const r=t.getHexCode(),{hue:o,saturation:a,lightness:u}=t.getHsl(),b=t.getRelativeLuminance(),c=J(o,0),x=J(a,2),V=J(u,2),k=J(b,2),z=Intl.NumberFormat().format(c),U=Intl.NumberFormat().format(x),m=Intl.NumberFormat().format(V),d=Intl.NumberFormat().format(k);this.style.backgroundColor=r,this.style.color=b>1/3?"black":"white",this.title=`Hue: ${z}°; Saturation: ${U}; Lightness: ${m}; Relative luminance: ${d}`,this.hexElement.textContent=r}get hexElement(){return this.shadowRoot.querySelector("#hex")}connectedCallback(){const t=this.getAttribute("value");t!=null&&(this.colour=new y.Chromator(t))}}window.customElements.define("colour-box",Gt);const Pe=document.createElement("template");Pe.innerHTML=` +`;class Kt extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ee.content.cloneNode(!0))}get colour(){return this._colour}set colour(t){this._colour=t;const r=t.getHexCode(),{hue:o,saturation:a,lightness:u}=t.getHsl(),c=t.getRelativeLuminance(),b=k.round(o,0),C=k.round(a,2),V=k.round(u,2),v=k.round(c,2),f=Intl.NumberFormat().format(b),E=Intl.NumberFormat().format(C),g=Intl.NumberFormat().format(V),h=Intl.NumberFormat().format(v);this.style.backgroundColor=r,this.style.color=c>1/3?"black":"white",this.title=`Hue: ${f}°; Saturation: ${E}; Lightness: ${g}; Relative luminance: ${h}`,this.hexElement.textContent=r}get hexElement(){return this.shadowRoot.querySelector("#hex")}connectedCallback(){const t=this.getAttribute("value");t!=null&&(this.colour=new w.Chromator(t))}}window.customElements.define("colour-box",Kt);const Pe=document.createElement("template");Pe.innerHTML=` -`;class Yt extends HTMLElement{constructor(){super(),this._colour=new y.Chromator({hue:0,saturation:1,lightness:.5}),this._numberOfShades=8,this.boxes=[],this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Pe.content.cloneNode(!0))}get wrapper(){return this.shadowRoot.querySelector("#wrapper")}get colour(){return this._colour}set colour(t){this._colour=t,this.setBoxes()}get numberOfShades(){return this._numberOfShades}set numberOfShades(t){this._numberOfShades=t,this.setBoxes()}setBoxes(){const t=zt(this.numberOfShades,this.colour);this.boxes.length!==t.length?(this.boxes.forEach(r=>{r.remove()}),t.forEach(r=>{const o=document.createElement("colour-box");o.colour=r,this.wrapper.appendChild(o),this.boxes.push(o)})):this.boxes.forEach((r,o)=>{r.colour=t[o]})}connectedCallback(){const t=this.getAttribute("value");t!=null&&(this.colour=new y.Chromator(t)),this.setBoxes()}}window.customElements.define("colour-row",Yt);const Ve=document.createElement("template");Ve.innerHTML=` +`;class Jt extends HTMLElement{constructor(){super(),this._colour=new w.Chromator({hue:0,saturation:1,lightness:.5}),this._numberOfShades=8,this.boxes=[],this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Pe.content.cloneNode(!0))}get wrapper(){return this.shadowRoot.querySelector("#wrapper")}get colour(){return this._colour}set colour(t){this._colour=t,this.setBoxes()}get numberOfShades(){return this._numberOfShades}set numberOfShades(t){this._numberOfShades=t,this.setBoxes()}setBoxes(){const t=Dt(this.numberOfShades,this.colour);this.boxes.length!==t.length?(this.boxes.forEach(r=>{r.remove()}),t.forEach(r=>{const o=document.createElement("colour-box");o.colour=r,this.wrapper.appendChild(o),this.boxes.push(o)})):this.boxes.forEach((r,o)=>{r.colour=t[o]})}connectedCallback(){const t=this.getAttribute("value");t!=null&&(this.colour=new w.Chromator(t)),this.setBoxes()}}window.customElements.define("colour-row",Jt);const Ve=document.createElement("template");Ve.innerHTML=`
@@ -282,7 +282,7 @@ -`;class Kt extends HTMLElement{constructor(){super(),this._colour=new y.Chromator({hue:0,saturation:1,lightness:.5}),this._numberOfOpposites=3,this._numberOfShades=8,this.otherColourRows=[],this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ve.content.cloneNode(!0))}get mainColourRow(){return this.shadowRoot.querySelector("#maincolour")}get oppositesInput(){return this.shadowRoot.querySelector("#opposites")}get shadesInput(){return this.shadowRoot.querySelector("#shades")}get boxes(){return this.shadowRoot.querySelector("#boxes")}get colour(){return this._colour}set colour(t){this._colour=t,this.mainColourRow.colour=t,this.setOpposites()}get numberOfOpposites(){return this._numberOfOpposites}set numberOfOpposites(t){this._numberOfOpposites=t,this.setOpposites()}get numberOfShades(){return this._numberOfShades}set numberOfShades(t){this._numberOfShades=t,this.mainColourRow.numberOfShades=t,this.otherColourRows.forEach(r=>r.numberOfShades=t)}setOpposites(){const t=ye(this.numberOfOpposites,this.colour);t.splice(0,1),this.otherColourRows.length!==t.length?(this.otherColourRows.forEach(r=>r.remove()),t.forEach(r=>{const o=document.createElement("colour-row");o.colour=r,o.numberOfShades=this.numberOfShades,this.boxes.appendChild(o),this.otherColourRows.push(o)})):t.forEach((r,o)=>{const a=this.otherColourRows[o];a.colour=r,a.numberOfShades=this.numberOfShades})}connectedCallback(){const t=this.getAttribute("value");t!=null&&(this.colour=new y.Chromator(t)),this.setOpposites(),this.oppositesInput.addEventListener("input",()=>{this.numberOfOpposites=parseInt(this.oppositesInput.value),this.dispatchEvent(new CustomEvent("oppositeschange",{detail:this.numberOfOpposites}))}),this.shadesInput.addEventListener("input",()=>{this.numberOfShades=parseInt(this.shadesInput.value)})}}window.customElements.define("colour-properties",Kt);const We=document.createElement("template");We.innerHTML=` +`;class Qt extends HTMLElement{constructor(){super(),this._colour=new w.Chromator({hue:0,saturation:1,lightness:.5}),this._numberOfOpposites=3,this._numberOfShades=8,this.otherColourRows=[],this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ve.content.cloneNode(!0))}get mainColourRow(){return this.shadowRoot.querySelector("#maincolour")}get oppositesInput(){return this.shadowRoot.querySelector("#opposites")}get shadesInput(){return this.shadowRoot.querySelector("#shades")}get boxes(){return this.shadowRoot.querySelector("#boxes")}get colour(){return this._colour}set colour(t){this._colour=t,this.mainColourRow.colour=t,this.setOpposites()}get numberOfOpposites(){return this._numberOfOpposites}set numberOfOpposites(t){this._numberOfOpposites=t,this.setOpposites()}get numberOfShades(){return this._numberOfShades}set numberOfShades(t){this._numberOfShades=t,this.mainColourRow.numberOfShades=t,this.otherColourRows.forEach(r=>r.numberOfShades=t)}setOpposites(){const t=ye(this.numberOfOpposites,this.colour);t.splice(0,1),this.otherColourRows.length!==t.length?(this.otherColourRows.forEach(r=>r.remove()),t.forEach(r=>{const o=document.createElement("colour-row");o.colour=r,o.numberOfShades=this.numberOfShades,this.boxes.appendChild(o),this.otherColourRows.push(o)})):t.forEach((r,o)=>{const a=this.otherColourRows[o];a.colour=r,a.numberOfShades=this.numberOfShades})}connectedCallback(){const t=this.getAttribute("value");t!=null&&(this.colour=new w.Chromator(t)),this.setOpposites(),this.oppositesInput.addEventListener("input",()=>{this.numberOfOpposites=parseInt(this.oppositesInput.value),this.dispatchEvent(new CustomEvent("oppositeschange",{detail:this.numberOfOpposites}))}),this.shadesInput.addEventListener("input",()=>{this.numberOfShades=parseInt(this.shadesInput.value)})}}window.customElements.define("colour-properties",Qt);const We=document.createElement("template");We.innerHTML=`