diff --git a/dist/js/color-picker.cjs b/dist/js/color-picker.cjs index 00fdd63..d70323f 100644 --- a/dist/js/color-picker.cjs +++ b/dist/js/color-picker.cjs @@ -1,8 +1,8 @@ -"use strict";const Z={},ue=o=>{const{type:t,currentTarget:e}=o;[...Z[t]].forEach(([s,r])=>{e===s&&[...r].forEach(([n,i])=>{n.apply(s,[o]),typeof i=="object"&&i.once&&jt(s,t,n,i)})})},be=(o,t,e,s)=>{Z[t]||(Z[t]=new Map);const r=Z[t];r.has(o)||r.set(o,new Map);const n=r.get(o),{size:i}=n;n.set(e,s),i||o.addEventListener(t,ue,s)},jt=(o,t,e,s)=>{const r=Z[t],n=r&&r.get(o),i=n&&n.get(e),a=i!==void 0?i:s;n&&n.has(e)&&n.delete(e),r&&(!n||!n.size)&&r.delete(o),(!r||!r.size)&&delete Z[t],(!n||!n.size)&&o.removeEventListener(t,ue,a)},Ut="aria-description",Et="aria-expanded",Re="aria-hidden",St="aria-selected",et="aria-valuenow",ot="aria-valuetext",Oe="change",De="DOMContentLoaded",Fe="focusin",Ie="focusout",_t="keydown",Ke="keyup",Mt="click",Ve="pointerdown",pe="pointermove",Be="pointerup",je="resize",qe="scroll",ze="touchmove",j="ArrowDown",st="ArrowUp",gt="ArrowLeft",G="ArrowRight",Ge="Enter",Ue="Escape",Wt="Space",_e="transitionDuration",We="transitionProperty",X="tabindex",Je=navigator.userAgentData,vt=Je,{userAgent:Ze}=navigator,wt=Ze,Jt=/iPhone|iPad|iPod|Android/i;vt?vt.brands.some(o=>Jt.test(o.brand)):Jt.test(wt);const Zt=/(iPhone|iPod|iPad)/;vt?vt.brands.some(o=>Zt.test(o.brand)):Zt.test(wt);wt&&wt.includes("Firefox");const{head:yt}=document;["webkitPerspective","perspective"].some(o=>o in yt.style);const Xe=(o,t,e,s)=>{const r=s||!1;o.addEventListener(t,e,r)},Ye=(o,t,e,s)=>{const r=s||!1;o.removeEventListener(t,e,r)},Qe=(o,t,e,s)=>{const r=n=>{(n.target===o||n.currentTarget===o)&&(e.apply(o,[n]),Ye(o,t,r,s))};Xe(o,t,r,s)},to=()=>{};(()=>{let o=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(o=!0,o)});Qe(document,De,to,t)}catch{}return o})();["webkitTransform","transform"].some(o=>o in yt.style);["webkitAnimation","animation"].some(o=>o in yt.style);["webkitTransition","transition"].some(o=>o in yt.style);const xt=(o,t)=>o.getAttribute(t),m=(o,t,e)=>o.setAttribute(t,e),Ct=(o,t)=>o.removeAttribute(t),q=(o,...t)=>{o.classList.add(...t)},O=(o,...t)=>{o.classList.remove(...t)},T=(o,t)=>o.classList.contains(t),qt=o=>o!=null&&typeof o=="object"||!1,Q=o=>qt(o)&&typeof o.nodeType=="number"&&[1,2,3,4,5,6,7,8,9,10,11].some(t=>o.nodeType===t)||!1,lt=o=>Q(o)&&o.nodeType===1||!1,W=new Map,ht={data:W,set:(o,t,e)=>{lt(o)&&(W.has(t)||W.set(t,new Map),W.get(t).set(o,e))},getAllFor:o=>W.get(o)||null,get:(o,t)=>{if(!lt(o)||!t)return null;const e=ht.getAllFor(t);return o&&e&&e.get(o)||null},remove:(o,t)=>{const e=ht.getAllFor(t);!e||!lt(o)||(e.delete(o),e.size===0&&W.delete(t))}},eo=(o,t)=>ht.get(o,t),B=o=>typeof o=="string"||!1,oo=o=>qt(o)&&o.constructor.name==="Window"||!1,de=o=>Q(o)&&o.nodeType===9||!1,V=o=>oo(o)?o.document:de(o)?o:Q(o)?o.ownerDocument:window.document,K=(o,...t)=>Object.assign(o,...t),x=o=>{if(!o)return;if(B(o))return V().createElement(o);const{tagName:t}=o,e=x(t);if(!e)return;const s={...o};return delete s.tagName,K(e,s)},Tt=(o,t)=>{if(!o||!t)return;if(B(t))return V().createElementNS(o,t);const{tagName:e}=t,s=Tt(o,e);if(!s)return;const r={...t};return delete r.tagName,K(s,r)},so=(o,t)=>o.dispatchEvent(t),Rt=(o,t)=>{const e=getComputedStyle(o),s=t.replace("webkit","Webkit").replace(/([A-Z])/g,"-$1").toLowerCase();return e.getPropertyValue(s)},ro=o=>{const t=Rt(o,We),e=Rt(o,_e),s=e.includes("ms")?1:1e3,r=t&&t!=="none"?parseFloat(e)*s:0;return Number.isNaN(r)?0:r},U=(o,t)=>o.focus(t),Xt=o=>["true",!0].includes(o)?!0:["false",!1].includes(o)?!1:["null","",null,void 0].includes(o)?null:o!==""&&!Number.isNaN(+o)?+o:o,dt=o=>Object.entries(o),no=o=>o.toLowerCase(),io=(o,t,e,s)=>{const r={...e},n={...o.dataset},i={...t},a={},l="title";return dt(n).forEach(([c,h])=>{const b=s&&typeof c=="string"&&c.includes(s)?c.replace(s,"").replace(/[A-Z]/g,u=>no(u)):c;a[b]=Xt(h)}),dt(r).forEach(([c,h])=>{r[c]=Xt(h)}),dt(t).forEach(([c,h])=>{c in r?i[c]=r[c]:c in a?i[c]=a[c]:i[c]=c===l?xt(o,l):h}),i},Yt=o=>Object.fromEntries(o),ao=o=>o.offsetHeight,D=(o,t)=>{dt(t).forEach(([e,s])=>{if(s&&B(e)&&e.includes("--"))o.style.setProperty(e,s);else{const r={};r[e]=s,K(o.style,r)}})},lo=o=>qt(o)&&o.constructor.name==="Map"||!1,fe=o=>o.toUpperCase(),ut=(o,t)=>{const{width:e,height:s,top:r,right:n,bottom:i,left:a}=o.getBoundingClientRect();let l=1,c=1;if(t&<(o)){const{offsetWidth:h,offsetHeight:b}=o;l=h>0?Math.round(e)/h:1,c=b>0?Math.round(s)/b:1}return{width:e/l,height:s/c,top:r/c,right:n/l,bottom:i/c,left:a/l,x:a/l,y:r/c}},Lt=o=>V(o).documentElement;let Qt=0,te=0;const J=new Map,me=(o,t)=>{let e=t?Qt:te;if(t){const s=me(o),r=J.get(s)||new Map;J.has(s)||J.set(s,r),lo(r)&&!r.has(t)?(r.set(t,e),Qt+=1):e=r.get(t)}else{const s=o.id||o;J.has(s)?e=J.get(s):(J.set(s,e),te+=1)}return e},co=o=>{var t;return o?de(o)?o.defaultView:Q(o)?(t=o?.ownerDocument)==null?void 0:t.defaultView:o:window},At=o=>Array.isArray(o)||!1,ve=(o,t)=>o?o.closest(t)||ve(o.getRootNode().host,t):null,_=(o,t)=>lt(o)?o:(Q(t)?t:V()).querySelector(o),rt=(o,t)=>(t&&Q(t)?t:V()).getElementsByClassName(o),zt=["transparent","currentColor","inherit","revert","initial"],v=o=>{const t=Math.floor(o);return o-t<.5?t:Math.round(o)},$t=[["aliceblue",{r:240,g:248,b:255}],["antiquewhite",{r:250,g:235,b:215}],["aqua",{r:0,g:255,b:255}],["aquamarine",{r:127,g:255,b:212}],["azure",{r:240,g:255,b:255}],["beige",{r:245,g:245,b:220}],["bisque",{r:255,g:228,b:196}],["black",{r:0,g:0,b:0}],["blanchedalmond",{r:255,g:235,b:205}],["blue",{r:0,g:0,b:255}],["blueviolet",{r:138,g:43,b:226}],["brown",{r:165,g:42,b:42}],["burlywood",{r:222,g:184,b:135}],["cadetblue",{r:95,g:158,b:160}],["chartreuse",{r:127,g:255,b:0}],["chocolate",{r:210,g:105,b:30}],["coral",{r:255,g:127,b:80}],["cornflowerblue",{r:100,g:149,b:237}],["cornsilk",{r:255,g:248,b:220}],["crimson",{r:220,g:20,b:60}],["cyan",{r:0,g:255,b:255}],["darkblue",{r:0,g:0,b:139}],["darkcyan",{r:0,g:139,b:139}],["darkgoldenrod",{r:184,g:134,b:11}],["darkgray",{r:169,g:169,b:169}],["darkgreen",{r:0,g:100,b:0}],["darkgrey",{r:169,g:169,b:169}],["darkkhaki",{r:189,g:183,b:107}],["darkmagenta",{r:139,g:0,b:139}],["darkolivegreen",{r:85,g:107,b:47}],["darkorange",{r:255,g:140,b:0}],["darkorchid",{r:153,g:50,b:204}],["darkred",{r:139,g:0,b:0}],["darksalmon",{r:233,g:150,b:122}],["darkseagreen",{r:143,g:188,b:143}],["darkslateblue",{r:72,g:61,b:139}],["darkslategray",{r:47,g:79,b:79}],["darkslategrey",{r:47,g:79,b:79}],["darkturquoise",{r:0,g:206,b:209}],["darkviolet",{r:148,g:0,b:211}],["deeppink",{r:255,g:20,b:147}],["deepskyblue",{r:0,g:191,b:255}],["dimgray",{r:105,g:105,b:105}],["dimgrey",{r:105,g:105,b:105}],["dodgerblue",{r:30,g:144,b:255}],["firebrick",{r:178,g:34,b:34}],["floralwhite",{r:255,g:250,b:240}],["forestgreen",{r:34,g:139,b:34}],["fuchsia",{r:255,g:0,b:255}],["gainsboro",{r:220,g:220,b:220}],["ghostwhite",{r:248,g:248,b:255}],["goldenrod",{r:218,g:165,b:32}],["gold",{r:255,g:215,b:0}],["gray",{r:128,g:128,b:128}],["green",{r:0,g:128,b:0}],["greenyellow",{r:173,g:255,b:47}],["grey",{r:128,g:128,b:128}],["honeydew",{r:240,g:255,b:240}],["hotpink",{r:255,g:105,b:180}],["indianred",{r:205,g:92,b:92}],["indigo",{r:75,g:0,b:130}],["ivory",{r:255,g:255,b:240}],["khaki",{r:240,g:230,b:140}],["lavenderblush",{r:255,g:240,b:245}],["lavender",{r:230,g:230,b:250}],["lawngreen",{r:124,g:252,b:0}],["lemonchiffon",{r:255,g:250,b:205}],["lightblue",{r:173,g:216,b:230}],["lightcoral",{r:240,g:128,b:128}],["lightcyan",{r:224,g:255,b:255}],["lightgoldenrodyellow",{r:250,g:250,b:210}],["lightgray",{r:211,g:211,b:211}],["lightgreen",{r:144,g:238,b:144}],["lightgrey",{r:211,g:211,b:211}],["lightpink",{r:255,g:182,b:193}],["lightsalmon",{r:255,g:160,b:122}],["lightseagreen",{r:32,g:178,b:170}],["lightskyblue",{r:135,g:206,b:250}],["lightslategray",{r:119,g:136,b:153}],["lightslategrey",{r:119,g:136,b:153}],["lightsteelblue",{r:176,g:196,b:222}],["lightyellow",{r:255,g:255,b:224}],["lime",{r:0,g:255,b:0}],["limegreen",{r:50,g:205,b:50}],["linen",{r:250,g:240,b:230}],["magenta",{r:255,g:0,b:255}],["maroon",{r:128,g:0,b:0}],["mediumaquamarine",{r:102,g:205,b:170}],["mediumblue",{r:0,g:0,b:205}],["mediumorchid",{r:186,g:85,b:211}],["mediumpurple",{r:147,g:112,b:219}],["mediumseagreen",{r:60,g:179,b:113}],["mediumslateblue",{r:123,g:104,b:238}],["mediumspringgreen",{r:0,g:250,b:154}],["mediumturquoise",{r:72,g:209,b:204}],["mediumvioletred",{r:199,g:21,b:133}],["midnightblue",{r:25,g:25,b:112}],["mintcream",{r:245,g:255,b:250}],["mistyrose",{r:255,g:228,b:225}],["moccasin",{r:255,g:228,b:181}],["navajowhite",{r:255,g:222,b:173}],["navy",{r:0,g:0,b:128}],["oldlace",{r:253,g:245,b:230}],["olive",{r:128,g:128,b:0}],["olivedrab",{r:107,g:142,b:35}],["orange",{r:255,g:165,b:0}],["orangered",{r:255,g:69,b:0}],["orchid",{r:218,g:112,b:214}],["palegoldenrod",{r:238,g:232,b:170}],["palegreen",{r:152,g:251,b:152}],["paleturquoise",{r:175,g:238,b:238}],["palevioletred",{r:219,g:112,b:147}],["papayawhip",{r:255,g:239,b:213}],["peachpuff",{r:255,g:218,b:185}],["peru",{r:205,g:133,b:63}],["pink",{r:255,g:192,b:203}],["plum",{r:221,g:160,b:221}],["powderblue",{r:176,g:224,b:230}],["purple",{r:128,g:0,b:128}],["rebeccapurple",{r:102,g:51,b:153}],["red",{r:255,g:0,b:0}],["rosybrown",{r:188,g:143,b:143}],["royalblue",{r:65,g:105,b:225}],["saddlebrown",{r:139,g:69,b:19}],["salmon",{r:250,g:128,b:114}],["sandybrown",{r:244,g:164,b:96}],["seagreen",{r:46,g:139,b:87}],["seashell",{r:255,g:245,b:238}],["sienna",{r:160,g:82,b:45}],["silver",{r:192,g:192,b:192}],["skyblue",{r:135,g:206,b:235}],["slateblue",{r:106,g:90,b:205}],["slategray",{r:112,g:128,b:144}],["slategrey",{r:112,g:128,b:144}],["snow",{r:255,g:250,b:250}],["springgreen",{r:0,g:255,b:127}],["steelblue",{r:70,g:130,b:180}],["tan",{r:210,g:180,b:140}],["teal",{r:0,g:128,b:128}],["thistle",{r:216,g:191,b:216}],["tomato",{r:255,g:99,b:71}],["turquoise",{r:64,g:224,b:208}],["violet",{r:238,g:130,b:238}],["wheat",{r:245,g:222,b:179}],["white",{r:255,g:255,b:255}],["whitesmoke",{r:245,g:245,b:245}],["yellow",{r:255,g:255,b:0}],["yellowgreen",{r:154,g:205,b:50}]],we="deg|rad|grad|turn",$e="[-\\+]?\\d+%?",ke="[-\\+]?\\d*\\.\\d+%?",ye=`[-\\+]?\\d*\\.?\\d+(?:${we})?`,ft=`(?:${ke})|(?:${$e})`,Ot=`(?:${ft})|(?:${ye}?)`,ho="(?:[\\s|\\(\\s|\\s\\(\\s]+)?",go="(?:[\\s|\\)\\s]+)?",ee="(?:[,|\\s]+)",uo="(?:[,|\\/\\s]*)?",nt=`${ho}(${Ot})${ee}(${ft})${ee}(${ft})${uo}(${ft})?${go}`,I={CSS_UNIT:new RegExp(Ot),ANGLES:we,CSS_ANGLE:ye,CSS_INTEGER:$e,CSS_NUMBER:ke,CSS_UNIT2:Ot,PERMISSIVE_MATCH:nt,hwb:new RegExp(`hwb${nt}`),rgb:new RegExp(`rgb(?:a)?${nt}`),hsl:new RegExp(`hsl(?:a)?${nt}`),hsv:new RegExp(`hsv(?:a)?${nt}`),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/},xe=o=>zt.includes(o),it=(o,t)=>o!==null&&typeof o=="object"&&Object.keys(t).every(e=>e in o),Pe=o=>`${o}`.includes(".")&&parseFloat(o)===1,kt=o=>typeof o=="string"&&o.includes("%"),H=o=>!!I.CSS_UNIT.exec(`${o}`),Se=["rgb","hex","hsl","hsv","hwb"],Ce=o=>zt.includes(o)||["#",...Se].some(t=>o.includes(t))?!1:$t.some(([t])=>o===t),R=(o,t)=>{let e=o;if(typeof o=="number"&&Math.min(o,0)===0&&Math.max(o,1)===1)return o;Pe(o)&&(e="100%");const s=kt(e);return e=t===360?parseFloat(e):Math.min(t,Math.max(0,parseFloat(e))),s&&(e=e*t/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/t:e=e%t/t,e)},Dt=o=>{let t=parseFloat(o);return(Number.isNaN(t)||t<0||t>1)&&(t=1),t},bt=o=>Math.min(1,Math.max(0,o)),z=o=>o.length===1?`0${o}`:String(o),Le=o=>{const[[,t]]=$t.filter(([e])=>e===o.toLowerCase());return t},N=o=>parseInt(o,16),Ft=o=>N(o)/255,Ae=o=>v(o*255).toString(16),oe=(o,t,e)=>{const s=Math.max(o,t,e),r=Math.min(o,t,e);let n=0,i=0;const a=(s+r)/2;if(s===r)i=0,n=0;else{const l=s-r;i=a>.5?l/(2-s-r):l/(s+r),s===o&&(n=(t-e)/l+(t{let s=e;return s<0&&(s+=1),s>1&&(s-=1),s<1/6?o+(t-o)*(6*s):s<1/2?t:s<2/3?o+(t-o)*(2/3-s)*6:o},ct=(o,t,e)=>{let s=0,r=0,n=0;if(t===0)r=e,n=e,s=e;else if(e){const i=e<.5?e*(1+t):e+t-e*t,a=2*e-i;s=mt(a,i,o+1/3),r=mt(a,i,o),n=mt(a,i,o-1/3)}return{r:s,g:r,b:n}},se=(o,t,e)=>{let s=0,r=0;const n=Math.min(o,t,e),i=Math.max(o,t,e),a=1-i;if(i===n)return{h:0,w:n,b:a};o===n?(s=t-e,r=3):(s=t===n?e-o:o-t,r=t===n?5:1);const l=(r-s/(i-n))/6;return{h:l===1?0:l,w:n,b:a}},He=(o,t,e)=>{if(t+e>=1){const i=t/(t+e);return{r:i,g:i,b:i}}let{r:s,g:r,b:n}=ct(o,1,.5);return[s,r,n]=[s,r,n].map(i=>i*(1-t-e)+t),{r:s,g:r,b:n}},re=(o,t,e)=>{const s=Math.max(o,t,e),r=Math.min(o,t,e);let n=0;const i=s,a=s-r,l=s===0?0:a/s;return s===r?n=0:(o===s&&(n=(t-e)/a+(t{const s=o*6,r=t,n=e,i=Math.floor(s),a=s-i,l=n*(1-r),c=n*(1-a*r),h=n*(1-(1-a)*r),b=i%6,u=[n,c,l,l,h,n][b],d=[h,n,n,c,l,l][b],g=[l,l,h,n,n,c][b];return{r:u,g:d,b:g}},ne=(o,t,e,s)=>{const r=[z(v(o).toString(16)),z(v(t).toString(16)),z(v(e).toString(16))];return s&&r[0].charAt(0)===r[0].charAt(1)&&r[1].charAt(0)===r[1].charAt(1)&&r[2].charAt(0)===r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")},Ht=(o,t,e,s,r)=>{const n=[z(v(o).toString(16)),z(v(t).toString(16)),z(v(e).toString(16)),z(Ae(s))];return r&&n[0].charAt(0)===n[0].charAt(1)&&n[1].charAt(0)===n[1].charAt(1)&&n[2].charAt(0)===n[2].charAt(1)&&n[3].charAt(0)===n[3].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0)+n[3].charAt(0):n.join("")},Ne=o=>{const t=String(o).trim().toLowerCase();if(Ce(t))return Object.assign(Le(t),{a:1,format:"rgb",ok:!0});if(xe(t))return{r:0,g:0,b:0,a:t==="transparent"?0:1,format:"rgb",ok:!0};let[,e,s,r,n]=I.rgb.exec(t)||[];return e&&s&&r?{r:e,g:s,b:r,a:n!==void 0?n:1,format:"rgb",ok:!0}:([,e,s,r,n]=I.hsl.exec(t)||[],e&&s&&r?{h:e,s,l:r,a:n!==void 0?n:1,format:"hsl",ok:!0}:([,e,s,r,n]=I.hsv.exec(t)||[],e&&s&&r?{h:e,s,v:r,a:n!==void 0?n:1,format:"hsv",ok:!0}:([,e,s,r,n]=I.hwb.exec(t)||[],e&&s&&r?{h:e,w:s,b:r,a:n!==void 0?n:1,format:"hwb",ok:!0}:([,e,s,r,n]=I.hex8.exec(t)||[],e&&s&&r&&n?{r:N(e),g:N(s),b:N(r),a:Ft(n),format:"hex",ok:!0}:([,e,s,r]=I.hex6.exec(t)||[],e&&s&&r?{r:N(e),g:N(s),b:N(r),a:1,format:"hex",ok:!0}:([,e,s,r,n]=I.hex4.exec(t)||[],e&&s&&r&&n?{r:N(e+e),g:N(s+s),b:N(r+r),a:Ft(n+n),format:"hex",ok:!0}:([,e,s,r]=I.hex3.exec(t)||[],e&&s&&r?{r:N(e+e),g:N(s+s),b:N(r+r),a:1,format:"hex",ok:!0}:{r:0,g:0,b:0,a:1,format:"rgb",ok:!o})))))))},ie=o=>{let t={r:0,g:0,b:0},e=o,s=1,r,n,i,a,l,c,h,b,u="rgb",d=!1;return(!e||typeof e=="string")&&(e=Ne(e),d=e.ok),it(e,t)&&H(e.r)&&H(e.g)&&H(e.b)&&({r:h,g:b,b:l}=e,[h,b,l]=[h,b,l].map(g=>R(g,kt(g)?100:255)),t={r:h,g:b,b:l},u="format"in e?e.format:"rgb"),it(e,{h:0,s:0,v:0})&&H(e.h)&&H(e.s)&&H(e.v)&&({h:c,s:r,v:n}=e,c=R(c,360),r=R(r,100),n=R(n,100),t=It(c,r,n),u="hsv"),it(e,{h:0,s:0,l:0})&&H(e.h)&&H(e.s)&&H(e.l)&&({h:c,s:r,l:i}=e,c=R(c,360),r=R(r,100),i=R(i,100),t=ct(c,r,i),u="hsl"),it(e,{h:0,w:0,b:0})&&H(e.h)&&H(e.w)&&H(e.b)&&({h:c,w:a,b:l}=e,c=R(c,360),a=R(a,100),l=R(l,100),t=He(c,a,l),u="hwb"),H(e.a)&&(s=e.a,s=kt(s)||parseFloat(`${s}`)>1?R(s,100):s),{r:t.r,g:t.g,b:t.b,a:Dt(s),format:u,ok:d}},bo="1.0.8";class y{static matchers=I;static isOnePointZero=Pe;static isPercentage=kt;static isValidCSSUnit=H;static isNonColor=xe;static isColorName=Ce;static isColorType=it;static pad2=z;static clamp01=bt;static bound01=R;static boundAlpha=Dt;static getRGBFromName=Le;static convertHexToDecimal=Ft;static convertDecimalToHex=Ae;static rgbToHsl=oe;static rgbToHex=ne;static rgbToHsv=re;static rgbToHwb=se;static rgbaToHex=Ht;static hslToRgb=It;static hsvToRgb=It;static hueToRgb=mt;static hwbToRgb=He;static parseIntFromHex=N;static stringInputToObject=Ne;static inputToRGB=ie;static roundPart=v;static webColors=$t;static nonColors=zt;static version=bo;r;g;b;a;format;ok;originalInput;constructor(t,e){const s=e&&Se.includes(e)?e:"",{r,g:n,b:i,a,ok:l,format:c}=ie(t);this.originalInput=t,this.r=r,this.g=n,this.b=i,this.a=a,this.ok=l,this.format=s||c}get isValid(){return this.ok}get isDark(){return this.brightness<120}get luminance(){const{r:t,g:e,b:s}=this;let r=0,n=0,i=0;return t<=.03928?r=t/12.92:r=((t+.055)/1.055)**2.4,e<=.03928?n=e/12.92:n=((e+.055)/1.055)**2.4,s<=.03928?i=s/12.92:i=((s+.055)/1.055)**2.4,.2126*r+.7152*n+.0722*i}get brightness(){const{r:t,g:e,b:s}=this.toRgb();return(t*299+e*587+s*114)/1e3}get name(){const{r:t,g:e,b:s}=this.toRgb(),[r]=$t.map(([n,i])=>{const a=(((i.r-t)*.3)**2+((i.g-e)*.6)**2+((i.b-s)*.1)**2)**.5;return[n,a]}).find(([,n],i,a)=>n===Math.min(...a.map(([,l])=>l)));return r}toRgb(){let{r:t,g:e,b:s,a:r}=this;return[t,e,s]=[t,e,s].map(n=>v(n*255*100)/100),r=v(r*100)/100,{r:t,g:e,b:s,a:r}}toRgbString(){const{r:t,g:e,b:s,a:r}=this.toRgb(),[n,i,a]=[t,e,s].map(v);return r===1?`rgb(${n}, ${i}, ${a})`:`rgba(${n}, ${i}, ${a}, ${r})`}toRgbCSS4String(){const{r:t,g:e,b:s,a:r}=this.toRgb(),[n,i,a]=[t,e,s].map(v),l=r===1?"":` / ${v(r*100)}%`;return`rgb(${n} ${i} ${a}${l})`}toHex(t){const{r:e,g:s,b:r,a:n}=this.toRgb();return n===1?ne(e,s,r,t):Ht(e,s,r,n,t)}toHexString(t){return`#${this.toHex(t)}`}toHex8(t){const{r:e,g:s,b:r,a:n}=this.toRgb();return Ht(e,s,r,n,t)}toHex8String(t){return`#${this.toHex8(t)}`}toHsv(){const{r:t,g:e,b:s,a:r}=this,{h:n,s:i,v:a}=re(t,e,s);return{h:n,s:i,v:a,a:r}}toHsl(){const{r:t,g:e,b:s,a:r}=this,{h:n,s:i,l:a}=oe(t,e,s);return{h:n,s:i,l:a,a:r}}toHslString(){let{h:t,s:e,l:s,a:r}=this.toHsl();return t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100)/100,r===1?`hsl(${t}, ${e}%, ${s}%)`:`hsla(${t}, ${e}%, ${s}%, ${r})`}toHslCSS4String(){let{h:t,s:e,l:s,a:r}=this.toHsl();t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100);const n=r<100?` / ${v(r)}%`:"";return`hsl(${t}deg ${e}% ${s}%${n})`}toHwb(){const{r:t,g:e,b:s,a:r}=this,{h:n,w:i,b:a}=se(t,e,s);return{h:n,w:i,b:a,a:r}}toHwbString(){let{h:t,w:e,b:s,a:r}=this.toHwb();t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100);const n=r<100?` / ${v(r)}%`:"";return`hwb(${t}deg ${e}% ${s}%${n})`}setAlpha(t){return typeof t!="number"?this:(this.a=Dt(t),this)}saturate(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=ct(e,bt(s+t/100),r);return Object.assign(this,{r:n,g:i,b:a}),this}desaturate(t){return typeof t=="number"?this.saturate(-t):this}greyscale(){return this.saturate(-100)}lighten(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=ct(e,s,bt(r+t/100));return Object.assign(this,{r:n,g:i,b:a}),this}darken(t){return typeof t=="number"?this.lighten(-t):this}spin(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=ct(bt((e*360+t)%360/360),s,r);return Object.assign(this,{r:n,g:i,b:a}),this}clone(){return new y(this)}toString(t){const{format:e}=this;return e==="hex"?this.toHexString(t):e==="hsl"?this.toHslString():e==="hwb"?this.toHwbString():this.toRgbString()}}class Kt{static Color=y;hue;hueSteps;lightSteps;saturation;colors;constructor(...t){let e=0,s=12,r=10,n=[.5],i=100;if(t.length===4)[e,s,r,i]=t;else if(t.length===3)[e,s,r]=t;else if(t.length===2&&([s,r]=t,[s,r].some(g=>g<1)))throw TypeError("ColorPalette: the two minimum arguments must be numbers higher than 0.");const a=[],l=360/s,c=y.roundPart((r-(r%2?1:0))/2),h=[.25,.2,.15,.11,.09,.075],b=[[1,2,3],[4,5],[6,7],[8,9],[10,11],[12,13]],u=b.find(g=>g.includes(r)),d=u?h[b.indexOf(u)]:100/(r+(r%2?0:1))/100;for(let g=1;g{const w=new y({h:p,s:1,l:f});a.push(i<100?w.saturate(i-100):w)})}this.hue=e,this.hueSteps=s,this.lightSteps=r,this.saturation=i,this.colors=a}}const Vt={pickerLabel:"Colour Picker",appearanceLabel:"Colour Appearance",valueLabel:"Colour Value",toggleLabel:"Select Colour",presetsLabel:"Colour Presets",defaultsLabel:"Colour Defaults",formatLabel:"Format",alphaLabel:"Alpha",hexLabel:"Hexadecimal",hueLabel:"Hue",whitenessLabel:"Whiteness",blacknessLabel:"Blackness",saturationLabel:"Saturation",lightnessLabel:"Lightness",redLabel:"Red",greenLabel:"Green",blueLabel:"Blue"},at=["white","black","grey","red","orange","brown","gold","olive","yellow","lime","green","teal","cyan","blue","violet","magenta","pink"],ae=o=>{if(!B(o))return!1;try{JSON.parse(o)}catch{return!1}return!0},Bt="v-hidden",po=o=>{const{format:t,id:e,componentLabels:s}=o,r=x({tagName:"div",className:`color-form ${t}`});let n=["hex"];return t==="rgb"?n=["red","green","blue","alpha"]:t==="hsl"?n=["hue","saturation","lightness","alpha"]:t==="hwb"&&(n=["hue","whiteness","blackness","alpha"]),n.forEach(i=>{const[a]=t==="hex"?["#"]:fe(i).split(""),l=`color_${t}_${i}_${e}`,c=s[`${i}Label`],h=x({tagName:"label"});m(h,"for",l),h.append(x({tagName:"span",ariaHidden:"true",innerText:`${a}:`}),x({tagName:"span",className:Bt,innerText:c}));const b=x({tagName:"input",id:l,type:t==="hex"?"text":"number",value:i==="alpha"?"100":"0",className:`color-input ${i}`,autocomplete:"off",spellcheck:!1});let u="100",d="1";i!=="alpha"&&(t==="rgb"?(u="255",d="1"):i==="hue"&&(u="360",d="1")),K(b,{min:"0",max:u,step:d}),r.append(h,b)}),r},fo=o=>{const{format:t,componentLabels:e}=o,{hueLabel:s,alphaLabel:r,lightnessLabel:n,saturationLabel:i,whitenessLabel:a,blacknessLabel:l}=e,c=t==="hsl"?360:100,h=t==="hsl"?100:360,b=100;let u=t==="hsl"?`${s} & ${n}`:`${n} & ${i}`;u=t==="hwb"?`${a} & ${l}`:u;const d=t==="hsl"?`${i}`:`${s}`,g=x({tagName:"div",className:`color-controls ${t}`}),p="color-pointer",f="color-slider";return[{i:1,c:p,l:u,min:0,max:c},{i:2,c:f,l:d,min:0,max:h},{i:3,c:f,l:r,min:0,max:b}].forEach($=>{const{i:P,c:L,l:S,min:C,max:M}=$,E=x({tagName:"div",className:"color-control",role:"presentation"});E.append(x({tagName:"div",className:`visual-control visual-control${P}`}));const A=x({tagName:"div",className:`${L} knob`,ariaLive:"polite",ariaLabel:S,role:"slider",tabIndex:0,ariaValueMin:`${C}`,ariaValueMax:`${M}`});E.append(A),g.append(E)}),g},le=(o,t,e)=>{const{input:s,format:r,componentLabels:n}=o,{defaultsLabel:i,presetsLabel:a}=n,l=e==="color-options",c=t instanceof Kt,h=l?a:i,b=c?t.colors:t,u=b.length,{lightSteps:d}=c?t:{lightSteps:null},g=d||[9,10].find(A=>u>=A*2&&!(u%A))||5,p=l&&u>g;let f=2;f=p&&u>g*2?3:f,f=p&&u>g*3?4:f,f=p&&u>g*4?5:f;const w=f-(u<=g*3?1:2),$=p&&u>w*g;let P=e;P+=$?" scrollable":"",P+=p?" multiline":"";const L=p?"1px":"0.25rem";let S=p?1.75:2;S=g>5&&p?1.5:S;const C=`${w*S}rem`,M=`calc(${f} * ${S}rem + ${f-1} * ${L})`,E=x({tagName:"ul",className:P,role:"listbox",ariaLabel:h});return $&&D(E,{"--grid-item-size":`${S}rem`,"--grid-fit":`${g}`,"--grid-gap":L,"--grid-height":C,"--grid-hover-height":M}),b.forEach(A=>{let[F,tt]=typeof A=="string"?A.trim().split(":"):[];A instanceof y&&(F=A.toHexString(),tt=F);const Gt=new y(A instanceof y?A:F,r).toString()===xt(s,"value"),Pt=x({tagName:"li",className:`color-option${Gt?" active":""}`,innerText:`${tt||F}`,tabIndex:0,role:"option",ariaSelected:Gt?"true":"false"});m(Pt,"data-value",`${F}`),l&&D(Pt,{backgroundColor:F}),E.append(Pt)}),E},mo=o=>{const{input:t,parent:e,format:s,id:r,componentLabels:n,colorKeywords:i,colorPresets:a}=o,l=xt(t,"value")||"#fff",{nonColors:c}=y,{toggleLabel:h,pickerLabel:b,formatLabel:u,hexLabel:d}=n,g=c.includes(l)?"#fff":l;o.color=new y(g,s);const p=s==="hex"?d:fe(s),f=x({id:`picker-btn-${r}`,tagName:"button",className:"picker-toggle btn-appearance",ariaExpanded:"false",ariaHasPopup:"true"});f.append(x({tagName:"span",className:Bt,innerText:`${b}. ${u}: ${p}`}));const w=x({tagName:"div",className:"color-dropdown picker",role:"group",ariaLabelledBy:`picker-btn-${r}`}),$=fo(o),P=po(o);if(w.append($,P),t.before(f),e.append(w),i||a){const L=x({tagName:"div",className:"color-dropdown scrollable menu"});a&&L.append(le(o,a,"color-options")),i&&i.length&&L.append(le(o,i,"color-defaults"));const S=x({tagName:"button",className:"menu-toggle btn-appearance",tabIndex:-1,ariaExpanded:"false",ariaHasPopup:"true"}),C=encodeURI("http://www.w3.org/2000/svg"),M=Tt(C,{tagName:"svg"});m(M,"xmlns",C),m(M,"viewBox","0 0 512 512"),m(M,Re,"true");const E=Tt(C,{tagName:"path"});m(E,"d","M98,158l157,156L411,158l27,27L255,368L71,185L98,158z"),m(E,"fill","#fff"),M.append(E),S.append(x({tagName:"span",className:Bt,innerText:`${h}`}),M),e.append(S,L)}i&&c.includes(l)&&(o.value=l),m(t,X,"-1")},vo="2.0.0-alpha9",Y="color-picker",wo=`[data-function="${Y}"]`,ce=`.${Y}`,$o={componentLabels:Vt,colorLabels:at,format:"rgb",colorPresets:!1,colorKeywords:!1},{roundPart:k,nonColors:pt}=y,ko=o=>eo(o,Y),yo=o=>new Te(o),he=(o,t)=>{const e=t?be:jt,{input:s,pickerToggle:r,menuToggle:n}=o;e(s,Fe,o.showPicker),e(r,Mt,o.togglePicker),n&&e(n,Mt,o.toggleMenu)},Ee=(o,t)=>{const e=t?be:jt,{input:s,colorMenu:r,parent:n}=o,i=V(s),a=co(i);e(o.controls,Ve,o.pointerDown),o.controlKnobs.forEach(l=>e(l,_t,o.handleKnobs)),e(a,qe,o.handleScroll),e(a,je,o.update),[s,...o.inputs].forEach(l=>e(l,Oe,o.changeHandler)),r&&(e(r,Mt,o.menuClickHandler),e(r,_t,o.menuKeyHandler)),e(i,pe,o.pointerMove),e(i,Be,o.pointerUp),e(n,Ie,o.handleFocusOut),e(i,Ke,o.handleDismiss)},ge=o=>{so(o.input,new CustomEvent("colorpicker.change"))},Me=o=>{o&&["bottom","top"].forEach(t=>O(o,t))},Nt=(o,t)=>{const{colorPicker:e,colorMenu:s,menuToggle:r,pickerToggle:n,parent:i}=o,a=t===e,l=a?s:e,c=a?r:n,h=a?n:r;T(i,"open")||q(i,"open"),l&&(O(l,"show"),Me(l)),q(t,"bottom"),ao(t),q(t,"show"),a&&o.update(),o.isOpen||(Ee(o,!0),o.updateDropdownPosition(),o.isOpen=!0,m(o.input,X,"0"),r&&m(r,X,"0")),m(h,Et,"true"),c&&m(c,Et,"false")};class Te{static Color=y;static ColorPalette=Kt;static getInstance=ko;static init=yo;static selector=wo;static roundPart=k;static setElementStyle=D;static setAttribute=m;static getBoundingClientRect=ut;static version=vo;static colorNames=at;static colorPickerLabels=Vt;id;input;color;format="rgb";parent;dragElement;isOpen=!1;controlPositions;colorLabels=Yt(at.map(t=>[t,t]));colorKeywords;colorPresets;componentLabels;pickerToggle;menuToggle;colorPicker;colorMenu;controls;inputs;controlKnobs;visuals;constructor(t,e){const s=_(t);if(typeof t>"u")throw new TypeError("ColorPicker target not specified.");if(B(t)&&!s)throw new TypeError(`ColorPicker target "${t}" cannot be found.`);this.input=s;const r=ve(s,ce);if(!r)throw new TypeError("ColorPicker requires a specific markup to work.");this.parent=r,this.id=me(s,Y),this.dragElement=void 0,this.isOpen=!1,this.controlPositions={c1x:0,c1y:0,c2y:0,c3y:0},this.colorKeywords=!1,this.colorPresets=!1;const{format:n,componentLabels:i,colorLabels:a,colorKeywords:l,colorPresets:c}=io(s,$o,e||{});let h=at;At(a)&&a.length===17?h=a:B(a)&&a.split(",").length===17&&(h=a.split(",")),K(this.colorLabels,Yt(h.map((p,f)=>[at[f],p])));const b=B(i)&&ae(i)?JSON.parse(i):i;if(this.componentLabels=K({...Vt},b),this.color=new y(s.value||"#fff",n),this.format=n,At(l)&&l.length?this.colorKeywords=l:B(l)&&l.length&&(this.colorKeywords=l.split(",").map(p=>p.trim())),At(c)&&c.length)this.colorPresets=c;else if(c&&ae(c)){const{hue:p,hueSteps:f,lightSteps:w,saturation:$}=JSON.parse(c);this.colorPresets=new Kt(p,f,w,$)}else B(c)&&(this.colorPresets=c.split(",").map(p=>p.trim()));mo(this);const[u,d]=rt("color-dropdown",r);this.pickerToggle=_(".picker-toggle",r),this.menuToggle=_(".menu-toggle",r),this.colorPicker=u,this.colorMenu=d,this.inputs=[...rt("color-input",r)];const[g]=rt("color-controls",r);this.controls=g,this.controlKnobs=[...rt("knob",g)],this.visuals=[...rt("visual-control",g)],this.update(),he(this,!0),ht.set(s,Y,this)}get value(){return this.input.value}set value(t){this.input.value=t}get hasNonColor(){return this.colorKeywords instanceof Array&&this.colorKeywords.some(t=>pt.includes(t))}get hex(){return this.color.toHex(!0)}get hsv(){return this.color.toHsv()}get hsl(){return this.color.toHsl()}get hwb(){return this.color.toHwb()}get rgb(){return this.color.toRgb()}get brightness(){return this.color.brightness}get luminance(){return this.color.luminance}get isDark(){const{color:t,brightness:e}=this;return e<120&&t.a>.33}get isValid(){const t=this.input.value;return t!==""&&new y(t).isValid}get appearance(){const{colorLabels:t,hsl:e,hsv:s,format:r}=this,n=k(e.h*360),i=r==="hsl"?e.s:s.s,a=k(i*100),l=k(e.l*100),c=s.v*100;let h="black";if(l===100&&a===0)h=t.white;else if(l===0)h=t.black;else if(a===0)h=t.grey;else if(n<15||n>=345)h=t.red;else if(n>=15&&n<45)h=c>80&&a>80?t.orange:t.brown;else if(n>=45&&n<75){const b=n>46&&n<54&&c<80&&a>90,u=n>=54&&n<75&&c<80;h=b?t.gold:t.yellow,h=u?t.olive:h}else n>=75&&n<155?h=c<68?t.green:t.lime:n>=155&&n<175?h=t.teal:n>=175&&n<195?h=t.cyan:n>=195&&n<255?h=t.blue:n>=255&&n<270?h=t.violet:n>=270&&n<295?h=t.magenta:n>=295&&n<345&&(h=t.pink);return h}updateVisuals(){const{controlPositions:t,visuals:e}=this,[s,r,n]=e,{offsetHeight:i}=s,a=t.c2y/i,{r:l,g:c,b:h}=new y({h:a,s:1,l:.5}).toRgb(),b="linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)",u=1-t.c3y/i,d=k(u*100)/100,g=new y({h:a,s:1,l:.5,a:u}).toRgbString(),p=`linear-gradient( +"use strict";const _t="aria-description",Nt="aria-expanded",Me="aria-hidden",St="aria-selected",tt="aria-valuenow",et="aria-valuetext",Te="change",Re="DOMContentLoaded",Oe="focusin",De="focusout",zt="keydown",Fe="keyup",Et="click",Ie="pointerdown",ue="pointermove",Ke="pointerup",Ve="resize",Be="scroll",je="touchmove",j="ArrowDown",ot="ArrowUp",ht="ArrowLeft",U="ArrowRight",qe="Enter",Ge="Escape",Wt="Space",Ue="transitionDuration",_e="transitionProperty",X="tabindex",ze=navigator.userAgentData,mt=ze,{userAgent:We}=navigator,vt=We,Jt=/iPhone|iPad|iPod|Android/i;mt?mt.brands.some(o=>Jt.test(o.brand)):Jt.test(vt);const Xt=/(iPhone|iPod|iPad)/;mt?mt.brands.some(o=>Xt.test(o.brand)):Xt.test(vt);vt&&vt.includes("Firefox");const{head:kt}=document;["webkitPerspective","perspective"].some(o=>o in kt.style);const Bt=(o,t,e,s)=>{const r=s||!1;o.addEventListener(t,e,r)},jt=(o,t,e,s)=>{const r=s||!1;o.removeEventListener(t,e,r)},Je=(o,t,e,s)=>{const r=n=>{(n.target===o||n.currentTarget===o)&&(e.apply(o,[n]),jt(o,t,r,s))};Bt(o,t,r,s)},Xe=()=>{};(()=>{let o=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(o=!0,o)});Je(document,Re,Xe,t)}catch{}return o})();["webkitTransform","transform"].some(o=>o in kt.style);["webkitAnimation","animation"].some(o=>o in kt.style);["webkitTransition","transition"].some(o=>o in kt.style);const yt=(o,t)=>o.getAttribute(t),m=(o,t,e)=>o.setAttribute(t,e),Pt=(o,t)=>o.removeAttribute(t),q=(o,...t)=>{o.classList.add(...t)},O=(o,...t)=>{o.classList.remove(...t)},T=(o,t)=>o.classList.contains(t),qt=o=>o!=null&&typeof o=="object"||!1,Y=o=>qt(o)&&typeof o.nodeType=="number"&&[1,2,3,4,5,6,7,8,9,10,11].some(t=>o.nodeType===t)||!1,at=o=>Y(o)&&o.nodeType===1||!1,W=new Map,ct={data:W,set:(o,t,e)=>{at(o)&&(W.has(t)||W.set(t,new Map),W.get(t).set(o,e))},getAllFor:o=>W.get(o)||null,get:(o,t)=>{if(!at(o)||!t)return null;const e=ct.getAllFor(t);return o&&e&&e.get(o)||null},remove:(o,t)=>{const e=ct.getAllFor(t);!e||!at(o)||(e.delete(o),e.size===0&&W.delete(t))}},Ze=(o,t)=>ct.get(o,t),B=o=>typeof o=="string"||!1,Ye=o=>qt(o)&&o.constructor.name==="Window"||!1,be=o=>Y(o)&&o.nodeType===9||!1,V=o=>Ye(o)?o.document:be(o)?o:Y(o)?o.ownerDocument:window.document,K=(o,...t)=>Object.assign(o,...t),x=o=>{if(!o)return;if(B(o))return V().createElement(o);const{tagName:t}=o,e=x(t);if(!e)return;const s={...o};return delete s.tagName,K(e,s)},Mt=(o,t)=>{if(!o||!t)return;if(B(t))return V().createElementNS(o,t);const{tagName:e}=t,s=Mt(o,e);if(!s)return;const r={...t};return delete r.tagName,K(s,r)},Qe=(o,t)=>o.dispatchEvent(t),Tt=(o,t)=>{const e=getComputedStyle(o),s=t.replace("webkit","Webkit").replace(/([A-Z])/g,"-$1").toLowerCase();return e.getPropertyValue(s)},to=o=>{const t=Tt(o,_e),e=Tt(o,Ue),s=e.includes("ms")?1:1e3,r=t&&t!=="none"?parseFloat(e)*s:0;return Number.isNaN(r)?0:r},_=(o,t)=>o.focus(t),Zt=o=>["true",!0].includes(o)?!0:["false",!1].includes(o)?!1:["null","",null,void 0].includes(o)?null:o!==""&&!Number.isNaN(+o)?+o:o,pt=o=>Object.entries(o),eo=o=>o.toLowerCase(),oo=(o,t,e,s)=>{const r={...e},n={...o.dataset},i={...t},a={},l="title";return pt(n).forEach(([c,h])=>{const b=s&&typeof c=="string"&&c.includes(s)?c.replace(s,"").replace(/[A-Z]/g,u=>eo(u)):c;a[b]=Zt(h)}),pt(r).forEach(([c,h])=>{r[c]=Zt(h)}),pt(t).forEach(([c,h])=>{c in r?i[c]=r[c]:c in a?i[c]=a[c]:i[c]=c===l?yt(o,l):h}),i},Yt=o=>Object.fromEntries(o),so=o=>o.offsetHeight,D=(o,t)=>{pt(t).forEach(([e,s])=>{if(s&&B(e)&&e.includes("--"))o.style.setProperty(e,s);else{const r={};r[e]=s,K(o.style,r)}})},ro=o=>qt(o)&&o.constructor.name==="Map"||!1,pe=o=>o.toUpperCase(),gt=(o,t)=>{const{width:e,height:s,top:r,right:n,bottom:i,left:a}=o.getBoundingClientRect();let l=1,c=1;if(t&&at(o)){const{offsetWidth:h,offsetHeight:b}=o;l=h>0?Math.round(e)/h:1,c=b>0?Math.round(s)/b:1}return{width:e/l,height:s/c,top:r/c,right:n/l,bottom:i/c,left:a/l,x:a/l,y:r/c}},Ct=o=>V(o).documentElement;let Qt=0,te=0;const J=new Map,de=(o,t)=>{let e=t?Qt:te;if(t){const s=de(o),r=J.get(s)||new Map;J.has(s)||J.set(s,r),ro(r)&&!r.has(t)?(r.set(t,e),Qt+=1):e=r.get(t)}else{const s=o.id||o;J.has(s)?e=J.get(s):(J.set(s,e),te+=1)}return e},no=o=>{var t;return o?be(o)?o.defaultView:Y(o)?(t=o?.ownerDocument)==null?void 0:t.defaultView:o:window},Lt=o=>Array.isArray(o)||!1,fe=(o,t)=>o?o.closest(t)||fe(o.getRootNode().host,t):null,z=(o,t)=>at(o)?o:(Y(t)?t:V()).querySelector(o),st=(o,t)=>(t&&Y(t)?t:V()).getElementsByClassName(o),Gt=["transparent","currentColor","inherit","revert","initial"],v=o=>{const t=Math.floor(o);return o-t<.5?t:Math.round(o)},wt=[["aliceblue",{r:240,g:248,b:255}],["antiquewhite",{r:250,g:235,b:215}],["aqua",{r:0,g:255,b:255}],["aquamarine",{r:127,g:255,b:212}],["azure",{r:240,g:255,b:255}],["beige",{r:245,g:245,b:220}],["bisque",{r:255,g:228,b:196}],["black",{r:0,g:0,b:0}],["blanchedalmond",{r:255,g:235,b:205}],["blue",{r:0,g:0,b:255}],["blueviolet",{r:138,g:43,b:226}],["brown",{r:165,g:42,b:42}],["burlywood",{r:222,g:184,b:135}],["cadetblue",{r:95,g:158,b:160}],["chartreuse",{r:127,g:255,b:0}],["chocolate",{r:210,g:105,b:30}],["coral",{r:255,g:127,b:80}],["cornflowerblue",{r:100,g:149,b:237}],["cornsilk",{r:255,g:248,b:220}],["crimson",{r:220,g:20,b:60}],["cyan",{r:0,g:255,b:255}],["darkblue",{r:0,g:0,b:139}],["darkcyan",{r:0,g:139,b:139}],["darkgoldenrod",{r:184,g:134,b:11}],["darkgray",{r:169,g:169,b:169}],["darkgreen",{r:0,g:100,b:0}],["darkgrey",{r:169,g:169,b:169}],["darkkhaki",{r:189,g:183,b:107}],["darkmagenta",{r:139,g:0,b:139}],["darkolivegreen",{r:85,g:107,b:47}],["darkorange",{r:255,g:140,b:0}],["darkorchid",{r:153,g:50,b:204}],["darkred",{r:139,g:0,b:0}],["darksalmon",{r:233,g:150,b:122}],["darkseagreen",{r:143,g:188,b:143}],["darkslateblue",{r:72,g:61,b:139}],["darkslategray",{r:47,g:79,b:79}],["darkslategrey",{r:47,g:79,b:79}],["darkturquoise",{r:0,g:206,b:209}],["darkviolet",{r:148,g:0,b:211}],["deeppink",{r:255,g:20,b:147}],["deepskyblue",{r:0,g:191,b:255}],["dimgray",{r:105,g:105,b:105}],["dimgrey",{r:105,g:105,b:105}],["dodgerblue",{r:30,g:144,b:255}],["firebrick",{r:178,g:34,b:34}],["floralwhite",{r:255,g:250,b:240}],["forestgreen",{r:34,g:139,b:34}],["fuchsia",{r:255,g:0,b:255}],["gainsboro",{r:220,g:220,b:220}],["ghostwhite",{r:248,g:248,b:255}],["goldenrod",{r:218,g:165,b:32}],["gold",{r:255,g:215,b:0}],["gray",{r:128,g:128,b:128}],["green",{r:0,g:128,b:0}],["greenyellow",{r:173,g:255,b:47}],["grey",{r:128,g:128,b:128}],["honeydew",{r:240,g:255,b:240}],["hotpink",{r:255,g:105,b:180}],["indianred",{r:205,g:92,b:92}],["indigo",{r:75,g:0,b:130}],["ivory",{r:255,g:255,b:240}],["khaki",{r:240,g:230,b:140}],["lavenderblush",{r:255,g:240,b:245}],["lavender",{r:230,g:230,b:250}],["lawngreen",{r:124,g:252,b:0}],["lemonchiffon",{r:255,g:250,b:205}],["lightblue",{r:173,g:216,b:230}],["lightcoral",{r:240,g:128,b:128}],["lightcyan",{r:224,g:255,b:255}],["lightgoldenrodyellow",{r:250,g:250,b:210}],["lightgray",{r:211,g:211,b:211}],["lightgreen",{r:144,g:238,b:144}],["lightgrey",{r:211,g:211,b:211}],["lightpink",{r:255,g:182,b:193}],["lightsalmon",{r:255,g:160,b:122}],["lightseagreen",{r:32,g:178,b:170}],["lightskyblue",{r:135,g:206,b:250}],["lightslategray",{r:119,g:136,b:153}],["lightslategrey",{r:119,g:136,b:153}],["lightsteelblue",{r:176,g:196,b:222}],["lightyellow",{r:255,g:255,b:224}],["lime",{r:0,g:255,b:0}],["limegreen",{r:50,g:205,b:50}],["linen",{r:250,g:240,b:230}],["magenta",{r:255,g:0,b:255}],["maroon",{r:128,g:0,b:0}],["mediumaquamarine",{r:102,g:205,b:170}],["mediumblue",{r:0,g:0,b:205}],["mediumorchid",{r:186,g:85,b:211}],["mediumpurple",{r:147,g:112,b:219}],["mediumseagreen",{r:60,g:179,b:113}],["mediumslateblue",{r:123,g:104,b:238}],["mediumspringgreen",{r:0,g:250,b:154}],["mediumturquoise",{r:72,g:209,b:204}],["mediumvioletred",{r:199,g:21,b:133}],["midnightblue",{r:25,g:25,b:112}],["mintcream",{r:245,g:255,b:250}],["mistyrose",{r:255,g:228,b:225}],["moccasin",{r:255,g:228,b:181}],["navajowhite",{r:255,g:222,b:173}],["navy",{r:0,g:0,b:128}],["oldlace",{r:253,g:245,b:230}],["olive",{r:128,g:128,b:0}],["olivedrab",{r:107,g:142,b:35}],["orange",{r:255,g:165,b:0}],["orangered",{r:255,g:69,b:0}],["orchid",{r:218,g:112,b:214}],["palegoldenrod",{r:238,g:232,b:170}],["palegreen",{r:152,g:251,b:152}],["paleturquoise",{r:175,g:238,b:238}],["palevioletred",{r:219,g:112,b:147}],["papayawhip",{r:255,g:239,b:213}],["peachpuff",{r:255,g:218,b:185}],["peru",{r:205,g:133,b:63}],["pink",{r:255,g:192,b:203}],["plum",{r:221,g:160,b:221}],["powderblue",{r:176,g:224,b:230}],["purple",{r:128,g:0,b:128}],["rebeccapurple",{r:102,g:51,b:153}],["red",{r:255,g:0,b:0}],["rosybrown",{r:188,g:143,b:143}],["royalblue",{r:65,g:105,b:225}],["saddlebrown",{r:139,g:69,b:19}],["salmon",{r:250,g:128,b:114}],["sandybrown",{r:244,g:164,b:96}],["seagreen",{r:46,g:139,b:87}],["seashell",{r:255,g:245,b:238}],["sienna",{r:160,g:82,b:45}],["silver",{r:192,g:192,b:192}],["skyblue",{r:135,g:206,b:235}],["slateblue",{r:106,g:90,b:205}],["slategray",{r:112,g:128,b:144}],["slategrey",{r:112,g:128,b:144}],["snow",{r:255,g:250,b:250}],["springgreen",{r:0,g:255,b:127}],["steelblue",{r:70,g:130,b:180}],["tan",{r:210,g:180,b:140}],["teal",{r:0,g:128,b:128}],["thistle",{r:216,g:191,b:216}],["tomato",{r:255,g:99,b:71}],["turquoise",{r:64,g:224,b:208}],["violet",{r:238,g:130,b:238}],["wheat",{r:245,g:222,b:179}],["white",{r:255,g:255,b:255}],["whitesmoke",{r:245,g:245,b:245}],["yellow",{r:255,g:255,b:0}],["yellowgreen",{r:154,g:205,b:50}]],me="deg|rad|grad|turn",ve="[-\\+]?\\d+%?",we="[-\\+]?\\d*\\.\\d+%?",$e=`[-\\+]?\\d*\\.?\\d+(?:${me})?`,dt=`(?:${we})|(?:${ve})`,Rt=`(?:${dt})|(?:${$e}?)`,io="(?:[\\s|\\(\\s|\\s\\(\\s]+)?",ao="(?:[\\s|\\)\\s]+)?",ee="(?:[,|\\s]+)",lo="(?:[,|\\/\\s]*)?",rt=`${io}(${Rt})${ee}(${dt})${ee}(${dt})${lo}(${dt})?${ao}`,I={CSS_UNIT:new RegExp(Rt),ANGLES:me,CSS_ANGLE:$e,CSS_INTEGER:ve,CSS_NUMBER:we,CSS_UNIT2:Rt,PERMISSIVE_MATCH:rt,hwb:new RegExp(`hwb${rt}`),rgb:new RegExp(`rgb(?:a)?${rt}`),hsl:new RegExp(`hsl(?:a)?${rt}`),hsv:new RegExp(`hsv(?:a)?${rt}`),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/},ke=o=>Gt.includes(o),nt=(o,t)=>o!==null&&typeof o=="object"&&Object.keys(t).every(e=>e in o),ye=o=>`${o}`.includes(".")&&parseFloat(o)===1,$t=o=>typeof o=="string"&&o.includes("%"),H=o=>!!I.CSS_UNIT.exec(`${o}`),xe=["rgb","hex","hsl","hsv","hwb"],Se=o=>Gt.includes(o)||["#",...xe].some(t=>o.includes(t))?!1:wt.some(([t])=>o===t),R=(o,t)=>{let e=o;if(typeof o=="number"&&Math.min(o,0)===0&&Math.max(o,1)===1)return o;ye(o)&&(e="100%");const s=$t(e);return e=t===360?parseFloat(e):Math.min(t,Math.max(0,parseFloat(e))),s&&(e=e*t/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/t:e=e%t/t,e)},Ot=o=>{let t=parseFloat(o);return(Number.isNaN(t)||t<0||t>1)&&(t=1),t},ut=o=>Math.min(1,Math.max(0,o)),G=o=>o.length===1?`0${o}`:String(o),Pe=o=>{const[[,t]]=wt.filter(([e])=>e===o.toLowerCase());return t},N=o=>parseInt(o,16),Dt=o=>N(o)/255,Ce=o=>v(o*255).toString(16),oe=(o,t,e)=>{const s=Math.max(o,t,e),r=Math.min(o,t,e);let n=0,i=0;const a=(s+r)/2;if(s===r)i=0,n=0;else{const l=s-r;i=a>.5?l/(2-s-r):l/(s+r),s===o&&(n=(t-e)/l+(t{let s=e;return s<0&&(s+=1),s>1&&(s-=1),s<1/6?o+(t-o)*(6*s):s<1/2?t:s<2/3?o+(t-o)*(2/3-s)*6:o},lt=(o,t,e)=>{let s=0,r=0,n=0;if(t===0)r=e,n=e,s=e;else if(e){const i=e<.5?e*(1+t):e+t-e*t,a=2*e-i;s=ft(a,i,o+1/3),r=ft(a,i,o),n=ft(a,i,o-1/3)}return{r:s,g:r,b:n}},se=(o,t,e)=>{let s=0,r=0;const n=Math.min(o,t,e),i=Math.max(o,t,e),a=1-i;if(i===n)return{h:0,w:n,b:a};o===n?(s=t-e,r=3):(s=t===n?e-o:o-t,r=t===n?5:1);const l=(r-s/(i-n))/6;return{h:l===1?0:l,w:n,b:a}},Le=(o,t,e)=>{if(t+e>=1){const i=t/(t+e);return{r:i,g:i,b:i}}let{r:s,g:r,b:n}=lt(o,1,.5);return[s,r,n]=[s,r,n].map(i=>i*(1-t-e)+t),{r:s,g:r,b:n}},re=(o,t,e)=>{const s=Math.max(o,t,e),r=Math.min(o,t,e);let n=0;const i=s,a=s-r,l=s===0?0:a/s;return s===r?n=0:(o===s&&(n=(t-e)/a+(t{const s=o*6,r=t,n=e,i=Math.floor(s),a=s-i,l=n*(1-r),c=n*(1-a*r),h=n*(1-(1-a)*r),b=i%6,u=[n,c,l,l,h,n][b],d=[h,n,n,c,l,l][b],g=[l,l,h,n,n,c][b];return{r:u,g:d,b:g}},ne=(o,t,e,s)=>{const r=[G(v(o).toString(16)),G(v(t).toString(16)),G(v(e).toString(16))];return s&&r[0].charAt(0)===r[0].charAt(1)&&r[1].charAt(0)===r[1].charAt(1)&&r[2].charAt(0)===r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")},At=(o,t,e,s,r)=>{const n=[G(v(o).toString(16)),G(v(t).toString(16)),G(v(e).toString(16)),G(Ce(s))];return r&&n[0].charAt(0)===n[0].charAt(1)&&n[1].charAt(0)===n[1].charAt(1)&&n[2].charAt(0)===n[2].charAt(1)&&n[3].charAt(0)===n[3].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0)+n[3].charAt(0):n.join("")},Ae=o=>{const t=String(o).trim().toLowerCase();if(Se(t))return Object.assign(Pe(t),{a:1,format:"rgb",ok:!0});if(ke(t))return{r:0,g:0,b:0,a:t==="transparent"?0:1,format:"rgb",ok:!0};let[,e,s,r,n]=I.rgb.exec(t)||[];return e&&s&&r?{r:e,g:s,b:r,a:n!==void 0?n:1,format:"rgb",ok:!0}:([,e,s,r,n]=I.hsl.exec(t)||[],e&&s&&r?{h:e,s,l:r,a:n!==void 0?n:1,format:"hsl",ok:!0}:([,e,s,r,n]=I.hsv.exec(t)||[],e&&s&&r?{h:e,s,v:r,a:n!==void 0?n:1,format:"hsv",ok:!0}:([,e,s,r,n]=I.hwb.exec(t)||[],e&&s&&r?{h:e,w:s,b:r,a:n!==void 0?n:1,format:"hwb",ok:!0}:([,e,s,r,n]=I.hex8.exec(t)||[],e&&s&&r&&n?{r:N(e),g:N(s),b:N(r),a:Dt(n),format:"hex",ok:!0}:([,e,s,r]=I.hex6.exec(t)||[],e&&s&&r?{r:N(e),g:N(s),b:N(r),a:1,format:"hex",ok:!0}:([,e,s,r,n]=I.hex4.exec(t)||[],e&&s&&r&&n?{r:N(e+e),g:N(s+s),b:N(r+r),a:Dt(n+n),format:"hex",ok:!0}:([,e,s,r]=I.hex3.exec(t)||[],e&&s&&r?{r:N(e+e),g:N(s+s),b:N(r+r),a:1,format:"hex",ok:!0}:{r:0,g:0,b:0,a:1,format:"rgb",ok:!o})))))))},ie=o=>{let t={r:0,g:0,b:0},e=o,s=1,r,n,i,a,l,c,h,b,u="rgb",d=!1;return(!e||typeof e=="string")&&(e=Ae(e),d=e.ok),nt(e,t)&&H(e.r)&&H(e.g)&&H(e.b)&&({r:h,g:b,b:l}=e,[h,b,l]=[h,b,l].map(g=>R(g,$t(g)?100:255)),t={r:h,g:b,b:l},u="format"in e?e.format:"rgb"),nt(e,{h:0,s:0,v:0})&&H(e.h)&&H(e.s)&&H(e.v)&&({h:c,s:r,v:n}=e,c=R(c,360),r=R(r,100),n=R(n,100),t=Ft(c,r,n),u="hsv"),nt(e,{h:0,s:0,l:0})&&H(e.h)&&H(e.s)&&H(e.l)&&({h:c,s:r,l:i}=e,c=R(c,360),r=R(r,100),i=R(i,100),t=lt(c,r,i),u="hsl"),nt(e,{h:0,w:0,b:0})&&H(e.h)&&H(e.w)&&H(e.b)&&({h:c,w:a,b:l}=e,c=R(c,360),a=R(a,100),l=R(l,100),t=Le(c,a,l),u="hwb"),H(e.a)&&(s=e.a,s=$t(s)||parseFloat(`${s}`)>1?R(s,100):s),{r:t.r,g:t.g,b:t.b,a:Ot(s),format:u,ok:d}},co="1.0.8";class y{static matchers=I;static isOnePointZero=ye;static isPercentage=$t;static isValidCSSUnit=H;static isNonColor=ke;static isColorName=Se;static isColorType=nt;static pad2=G;static clamp01=ut;static bound01=R;static boundAlpha=Ot;static getRGBFromName=Pe;static convertHexToDecimal=Dt;static convertDecimalToHex=Ce;static rgbToHsl=oe;static rgbToHex=ne;static rgbToHsv=re;static rgbToHwb=se;static rgbaToHex=At;static hslToRgb=Ft;static hsvToRgb=Ft;static hueToRgb=ft;static hwbToRgb=Le;static parseIntFromHex=N;static stringInputToObject=Ae;static inputToRGB=ie;static roundPart=v;static webColors=wt;static nonColors=Gt;static version=co;r;g;b;a;format;ok;originalInput;constructor(t,e){const s=e&&xe.includes(e)?e:"",{r,g:n,b:i,a,ok:l,format:c}=ie(t);this.originalInput=t,this.r=r,this.g=n,this.b=i,this.a=a,this.ok=l,this.format=s||c}get isValid(){return this.ok}get isDark(){return this.brightness<120}get luminance(){const{r:t,g:e,b:s}=this;let r=0,n=0,i=0;return t<=.03928?r=t/12.92:r=((t+.055)/1.055)**2.4,e<=.03928?n=e/12.92:n=((e+.055)/1.055)**2.4,s<=.03928?i=s/12.92:i=((s+.055)/1.055)**2.4,.2126*r+.7152*n+.0722*i}get brightness(){const{r:t,g:e,b:s}=this.toRgb();return(t*299+e*587+s*114)/1e3}get name(){const{r:t,g:e,b:s}=this.toRgb(),[r]=wt.map(([n,i])=>{const a=(((i.r-t)*.3)**2+((i.g-e)*.6)**2+((i.b-s)*.1)**2)**.5;return[n,a]}).find(([,n],i,a)=>n===Math.min(...a.map(([,l])=>l)));return r}toRgb(){let{r:t,g:e,b:s,a:r}=this;return[t,e,s]=[t,e,s].map(n=>v(n*255*100)/100),r=v(r*100)/100,{r:t,g:e,b:s,a:r}}toRgbString(){const{r:t,g:e,b:s,a:r}=this.toRgb(),[n,i,a]=[t,e,s].map(v);return r===1?`rgb(${n}, ${i}, ${a})`:`rgba(${n}, ${i}, ${a}, ${r})`}toRgbCSS4String(){const{r:t,g:e,b:s,a:r}=this.toRgb(),[n,i,a]=[t,e,s].map(v),l=r===1?"":` / ${v(r*100)}%`;return`rgb(${n} ${i} ${a}${l})`}toHex(t){const{r:e,g:s,b:r,a:n}=this.toRgb();return n===1?ne(e,s,r,t):At(e,s,r,n,t)}toHexString(t){return`#${this.toHex(t)}`}toHex8(t){const{r:e,g:s,b:r,a:n}=this.toRgb();return At(e,s,r,n,t)}toHex8String(t){return`#${this.toHex8(t)}`}toHsv(){const{r:t,g:e,b:s,a:r}=this,{h:n,s:i,v:a}=re(t,e,s);return{h:n,s:i,v:a,a:r}}toHsl(){const{r:t,g:e,b:s,a:r}=this,{h:n,s:i,l:a}=oe(t,e,s);return{h:n,s:i,l:a,a:r}}toHslString(){let{h:t,s:e,l:s,a:r}=this.toHsl();return t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100)/100,r===1?`hsl(${t}, ${e}%, ${s}%)`:`hsla(${t}, ${e}%, ${s}%, ${r})`}toHslCSS4String(){let{h:t,s:e,l:s,a:r}=this.toHsl();t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100);const n=r<100?` / ${v(r)}%`:"";return`hsl(${t}deg ${e}% ${s}%${n})`}toHwb(){const{r:t,g:e,b:s,a:r}=this,{h:n,w:i,b:a}=se(t,e,s);return{h:n,w:i,b:a,a:r}}toHwbString(){let{h:t,w:e,b:s,a:r}=this.toHwb();t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100);const n=r<100?` / ${v(r)}%`:"";return`hwb(${t}deg ${e}% ${s}%${n})`}setAlpha(t){return typeof t!="number"?this:(this.a=Ot(t),this)}saturate(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=lt(e,ut(s+t/100),r);return Object.assign(this,{r:n,g:i,b:a}),this}desaturate(t){return typeof t=="number"?this.saturate(-t):this}greyscale(){return this.saturate(-100)}lighten(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=lt(e,s,ut(r+t/100));return Object.assign(this,{r:n,g:i,b:a}),this}darken(t){return typeof t=="number"?this.lighten(-t):this}spin(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=lt(ut((e*360+t)%360/360),s,r);return Object.assign(this,{r:n,g:i,b:a}),this}clone(){return new y(this)}toString(t){const{format:e}=this;return e==="hex"?this.toHexString(t):e==="hsl"?this.toHslString():e==="hwb"?this.toHwbString():this.toRgbString()}}class It{static Color=y;hue;hueSteps;lightSteps;saturation;colors;constructor(...t){let e=0,s=12,r=10,n=[.5],i=100;if(t.length===4)[e,s,r,i]=t;else if(t.length===3)[e,s,r]=t;else if(t.length===2&&([s,r]=t,[s,r].some(g=>g<1)))throw TypeError("ColorPalette: the two minimum arguments must be numbers higher than 0.");const a=[],l=360/s,c=y.roundPart((r-(r%2?1:0))/2),h=[.25,.2,.15,.11,.09,.075],b=[[1,2,3],[4,5],[6,7],[8,9],[10,11],[12,13]],u=b.find(g=>g.includes(r)),d=u?h[b.indexOf(u)]:100/(r+(r%2?0:1))/100;for(let g=1;g{const w=new y({h:p,s:1,l:f});a.push(i<100?w.saturate(i-100):w)})}this.hue=e,this.hueSteps=s,this.lightSteps=r,this.saturation=i,this.colors=a}}const Kt={pickerLabel:"Colour Picker",appearanceLabel:"Colour Appearance",valueLabel:"Colour Value",toggleLabel:"Select Colour",presetsLabel:"Colour Presets",defaultsLabel:"Colour Defaults",formatLabel:"Format",alphaLabel:"Alpha",hexLabel:"Hexadecimal",hueLabel:"Hue",whitenessLabel:"Whiteness",blacknessLabel:"Blackness",saturationLabel:"Saturation",lightnessLabel:"Lightness",redLabel:"Red",greenLabel:"Green",blueLabel:"Blue"},it=["white","black","grey","red","orange","brown","gold","olive","yellow","lime","green","teal","cyan","blue","violet","magenta","pink"],ae=o=>{if(!B(o))return!1;try{JSON.parse(o)}catch{return!1}return!0},Vt="v-hidden",ho=o=>{const{format:t,id:e,componentLabels:s}=o,r=x({tagName:"div",className:`color-form ${t}`});let n=["hex"];return t==="rgb"?n=["red","green","blue","alpha"]:t==="hsl"?n=["hue","saturation","lightness","alpha"]:t==="hwb"&&(n=["hue","whiteness","blackness","alpha"]),n.forEach(i=>{const[a]=t==="hex"?["#"]:pe(i).split(""),l=`color_${t}_${i}_${e}`,c=s[`${i}Label`],h=x({tagName:"label"});m(h,"for",l),h.append(x({tagName:"span",ariaHidden:"true",innerText:`${a}:`}),x({tagName:"span",className:Vt,innerText:c}));const b=x({tagName:"input",id:l,type:t==="hex"?"text":"number",value:i==="alpha"?"100":"0",className:`color-input ${i}`,autocomplete:"off",spellcheck:!1});let u="100",d="1";i!=="alpha"&&(t==="rgb"?(u="255",d="1"):i==="hue"&&(u="360",d="1")),K(b,{min:"0",max:u,step:d}),r.append(h,b)}),r},go=o=>{const{format:t,componentLabels:e}=o,{hueLabel:s,alphaLabel:r,lightnessLabel:n,saturationLabel:i,whitenessLabel:a,blacknessLabel:l}=e,c=t==="hsl"?360:100,h=t==="hsl"?100:360,b=100;let u=t==="hsl"?`${s} & ${n}`:`${n} & ${i}`;u=t==="hwb"?`${a} & ${l}`:u;const d=t==="hsl"?`${i}`:`${s}`,g=x({tagName:"div",className:`color-controls ${t}`}),p="color-pointer",f="color-slider";return[{i:1,c:p,l:u,min:0,max:c},{i:2,c:f,l:d,min:0,max:h},{i:3,c:f,l:r,min:0,max:b}].forEach($=>{const{i:S,c:L,l:P,min:C,max:M}=$,E=x({tagName:"div",className:"color-control",role:"presentation"});E.append(x({tagName:"div",className:`visual-control visual-control${S}`}));const A=x({tagName:"div",className:`${L} knob`,ariaLive:"polite",ariaLabel:P,role:"slider",tabIndex:0,ariaValueMin:`${C}`,ariaValueMax:`${M}`});E.append(A),g.append(E)}),g},le=(o,t,e)=>{const{input:s,format:r,componentLabels:n}=o,{defaultsLabel:i,presetsLabel:a}=n,l=e==="color-options",c=t instanceof It,h=l?a:i,b=c?t.colors:t,u=b.length,{lightSteps:d}=c?t:{lightSteps:null},g=d||[9,10].find(A=>u>=A*2&&!(u%A))||5,p=l&&u>g;let f=2;f=p&&u>g*2?3:f,f=p&&u>g*3?4:f,f=p&&u>g*4?5:f;const w=f-(u<=g*3?1:2),$=p&&u>w*g;let S=e;S+=$?" scrollable":"",S+=p?" multiline":"";const L=p?"1px":"0.25rem";let P=p?1.75:2;P=g>5&&p?1.5:P;const C=`${w*P}rem`,M=`calc(${f} * ${P}rem + ${f-1} * ${L})`,E=x({tagName:"ul",className:S,role:"listbox",ariaLabel:h});return $&&D(E,{"--grid-item-size":`${P}rem`,"--grid-fit":`${g}`,"--grid-gap":L,"--grid-height":C,"--grid-hover-height":M}),b.forEach(A=>{let[F,Q]=typeof A=="string"?A.trim().split(":"):[];A instanceof y&&(F=A.toHexString(),Q=F);const Ut=new y(A instanceof y?A:F,r).toString()===yt(s,"value"),xt=x({tagName:"li",className:`color-option${Ut?" active":""}`,innerText:`${Q||F}`,tabIndex:0,role:"option",ariaSelected:Ut?"true":"false"});m(xt,"data-value",`${F}`),l&&D(xt,{backgroundColor:F}),E.append(xt)}),E},uo=o=>{const{input:t,parent:e,format:s,id:r,componentLabels:n,colorKeywords:i,colorPresets:a}=o,l=yt(t,"value")||"#fff",{nonColors:c}=y,{toggleLabel:h,pickerLabel:b,formatLabel:u,hexLabel:d}=n,g=c.includes(l)?"#fff":l;o.color=new y(g,s);const p=s==="hex"?d:pe(s),f=x({id:`picker-btn-${r}`,tagName:"button",type:"button",className:"picker-toggle btn-appearance",ariaExpanded:"false",ariaHasPopup:"true"});f.append(x({tagName:"span",className:Vt,innerText:`${b}. ${u}: ${p}`}));const w=x({tagName:"div",className:"color-dropdown picker",role:"group",ariaLabelledBy:`picker-btn-${r}`}),$=go(o),S=ho(o);if(w.append($,S),t.before(f),e.append(w),i||a){const L=x({tagName:"div",className:"color-dropdown scrollable menu"});a&&L.append(le(o,a,"color-options")),i&&i.length&&L.append(le(o,i,"color-defaults"));const P=x({tagName:"button",type:"button",className:"menu-toggle btn-appearance",tabIndex:-1,ariaExpanded:"false",ariaHasPopup:"true"}),C=encodeURI("http://www.w3.org/2000/svg"),M=Mt(C,{tagName:"svg"});m(M,"xmlns",C),m(M,"viewBox","0 0 512 512"),m(M,Me,"true");const E=Mt(C,{tagName:"path"});m(E,"d","M98,158l157,156L411,158l27,27L255,368L71,185L98,158z"),m(E,"fill","#fff"),M.append(E),P.append(x({tagName:"span",className:Vt,innerText:`${h}`}),M),e.append(P,L)}i&&c.includes(l)&&(o.value=l),m(t,X,"-1")},bo="2.0.0-alpha10",Z="color-picker",po=`[data-function="${Z}"]`,ce=`.${Z}`,fo={componentLabels:Kt,colorLabels:it,format:"rgb",colorPresets:!1,colorKeywords:!1},{roundPart:k,nonColors:bt}=y,mo=o=>Ze(o,Z),vo=o=>new Ee(o),he=(o,t)=>{const e=t?Bt:jt,{input:s,pickerToggle:r,menuToggle:n}=o;e(s,Oe,o.showPicker),e(r,Et,o.togglePicker),n&&e(n,Et,o.toggleMenu)},He=(o,t)=>{const e=t?Bt:jt,{input:s,colorMenu:r,parent:n}=o,i=V(s),a=no(i);e(o.controls,Ie,o.pointerDown),o.controlKnobs.forEach(l=>e(l,zt,o.handleKnobs)),e(a,Be,o.handleScroll),e(a,Ve,o.update),[s,...o.inputs].forEach(l=>e(l,Te,o.changeHandler)),r&&(e(r,Et,o.menuClickHandler),e(r,zt,o.menuKeyHandler)),e(i,ue,o.pointerMove),e(i,Ke,o.pointerUp),e(n,De,o.handleFocusOut),e(i,Fe,o.handleDismiss)},ge=o=>{Qe(o.input,new CustomEvent("colorpicker.change"))},Ne=o=>{o&&["bottom","top"].forEach(t=>O(o,t))},Ht=(o,t)=>{const{colorPicker:e,colorMenu:s,menuToggle:r,pickerToggle:n,parent:i}=o,a=t===e,l=a?s:e,c=a?r:n,h=a?n:r;T(i,"open")||q(i,"open"),l&&(O(l,"show"),Ne(l)),q(t,"bottom"),so(t),q(t,"show"),a&&o.update(),o.isOpen||(He(o,!0),o.updateDropdownPosition(),o.isOpen=!0,m(o.input,X,"0"),r&&m(r,X,"0")),m(h,Nt,"true"),c&&m(c,Nt,"false")};class Ee{static Color=y;static ColorPalette=It;static getInstance=mo;static init=vo;static selector=po;static roundPart=k;static setElementStyle=D;static setAttribute=m;static getBoundingClientRect=gt;static version=bo;static colorNames=it;static colorPickerLabels=Kt;id;input;color;format="rgb";parent;dragElement;isOpen=!1;controlPositions;colorLabels=Yt(it.map(t=>[t,t]));colorKeywords;colorPresets;componentLabels;pickerToggle;menuToggle;colorPicker;colorMenu;controls;inputs;controlKnobs;visuals;constructor(t,e){const s=z(t);if(typeof t>"u")throw new TypeError("ColorPicker target not specified.");if(B(t)&&!s)throw new TypeError(`ColorPicker target "${t}" cannot be found.`);this.input=s;const r=fe(s,ce);if(!r)throw new TypeError("ColorPicker requires a specific markup to work.");this.parent=r,this.id=de(s,Z),this.dragElement=void 0,this.isOpen=!1,this.controlPositions={c1x:0,c1y:0,c2y:0,c3y:0},this.colorKeywords=!1,this.colorPresets=!1;const{format:n,componentLabels:i,colorLabels:a,colorKeywords:l,colorPresets:c}=oo(s,fo,e||{});let h=it;Lt(a)&&a.length===17?h=a:B(a)&&a.split(",").length===17&&(h=a.split(",")),K(this.colorLabels,Yt(h.map((p,f)=>[it[f],p])));const b=B(i)&&ae(i)?JSON.parse(i):i;if(this.componentLabels=K({...Kt},b),this.color=new y(s.value||"#fff",n),this.format=n,Lt(l)&&l.length?this.colorKeywords=l:B(l)&&l.length&&(this.colorKeywords=l.split(",").map(p=>p.trim())),Lt(c)&&c.length)this.colorPresets=c;else if(c&&ae(c)){const{hue:p,hueSteps:f,lightSteps:w,saturation:$}=JSON.parse(c);this.colorPresets=new It(p,f,w,$)}else B(c)&&(this.colorPresets=c.split(",").map(p=>p.trim()));uo(this);const[u,d]=st("color-dropdown",r);this.pickerToggle=z(".picker-toggle",r),this.menuToggle=z(".menu-toggle",r),this.colorPicker=u,this.colorMenu=d,this.inputs=[...st("color-input",r)];const[g]=st("color-controls",r);this.controls=g,this.controlKnobs=[...st("knob",g)],this.visuals=[...st("visual-control",g)],this.update(),he(this,!0),ct.set(s,Z,this)}get value(){return this.input.value}set value(t){this.input.value=t}get hasNonColor(){return this.colorKeywords instanceof Array&&this.colorKeywords.some(t=>bt.includes(t))}get hex(){return this.color.toHex(!0)}get hsv(){return this.color.toHsv()}get hsl(){return this.color.toHsl()}get hwb(){return this.color.toHwb()}get rgb(){return this.color.toRgb()}get brightness(){return this.color.brightness}get luminance(){return this.color.luminance}get isDark(){const{color:t,brightness:e}=this;return e<120&&t.a>.33}get isValid(){const t=this.input.value;return t!==""&&new y(t).isValid}get appearance(){const{colorLabels:t,hsl:e,hsv:s,format:r}=this,n=k(e.h*360),i=r==="hsl"?e.s:s.s,a=k(i*100),l=k(e.l*100),c=s.v*100;let h="black";if(l===100&&a===0)h=t.white;else if(l===0)h=t.black;else if(a===0)h=t.grey;else if(n<15||n>=345)h=t.red;else if(n>=15&&n<45)h=c>80&&a>80?t.orange:t.brown;else if(n>=45&&n<75){const b=n>46&&n<54&&c<80&&a>90,u=n>=54&&n<75&&c<80;h=b?t.gold:t.yellow,h=u?t.olive:h}else n>=75&&n<155?h=c<68?t.green:t.lime:n>=155&&n<175?h=t.teal:n>=175&&n<195?h=t.cyan:n>=195&&n<255?h=t.blue:n>=255&&n<270?h=t.violet:n>=270&&n<295?h=t.magenta:n>=295&&n<345&&(h=t.pink);return h}updateVisuals(){const{controlPositions:t,visuals:e}=this,[s,r,n]=e,{offsetHeight:i}=s,a=t.c2y/i,{r:l,g:c,b:h}=new y({h:a,s:1,l:.5}).toRgb(),b="linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)",u=1-t.c3y/i,d=k(u*100)/100,g=new y({h:a,s:1,l:.5,a:u}).toRgbString(),p=`linear-gradient( rgb(255,0,0) 0%, rgb(255,255,0) 16.67%, rgb(0,255,0) 33.33%, rgb(0,255,255) 50%, rgb(0,0,255) 66.67%, rgb(255,0,255) 83.33%, rgb(255,0,0) 100%)`;D(s,{background:`linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,${d}) 100%), linear-gradient(to right, rgba(255,255,255,${d}) 0%, ${g} 100%), - ${b}`}),D(r,{background:p}),D(n,{background:`linear-gradient(rgba(${l},${c},${h},1) 0%,rgba(${l},${c},${h},0) 100%)`})}handleFocusOut=({relatedTarget:t})=>{t&&!this.parent.contains(t)&&this.hide(!0)};handleDismiss=({code:t})=>{this.isOpen&&t===Ue&&this.hide()};handleScroll=t=>{const{activeElement:e}=V(this.input);this.updateDropdownPosition(),([pe,ze].includes(t.type)&&this.dragElement||e&&this.controlKnobs.includes(e))&&(t.stopPropagation(),t.preventDefault())};menuKeyHandler=t=>{const{target:e,code:s}=t,{previousElementSibling:r,nextElementSibling:n,parentElement:i}=e,a=i&&T(i,"color-options"),l=i?[...i.children]:[],c=a&&Rt(i,"grid-template-columns").split(" ").length,h=l.indexOf(e),b=h>-1&&c&&l[h-c],u=h>-1&&c&&l[h+c];[j,st,Wt].includes(s)&&t.preventDefault(),a?b&&s===st?U(b):u&&s===j?U(u):r&&s===gt?U(r):n&&s===G&&U(n):r&&[gt,st].includes(s)?U(r):n&&[G,j].includes(s)&&U(n),[Ge,Wt].includes(s)&&this.menuClickHandler(t)};menuClickHandler=t=>{const{target:e}=t,{colorMenu:s}=this,r=(xt(e,"data-value")||"").trim();if(!r.length)return;const n=_("li.active",s);let i=r;i=pt.includes(i)?"white":i,i=i==="transparent"?"rgba(0,0,0,0)":i;const{r:a,g:l,b:c,a:h}=new y(i);K(this.color,{r:a,g:l,b:c,a:h}),this.update(),n!==e&&(n&&(O(n,"active"),Ct(n,St)),q(e,"active"),m(e,St,"true"),pt.includes(r)&&(this.value=r),ge(this))};pointerDown=t=>{if(t.button!==0)return;const{target:e,pageX:s,pageY:r}=t,{colorMenu:n,visuals:i,controlKnobs:a}=this,[l,c,h]=i,[b,u,d]=a,g=a.includes(e)?e.previousElementSibling:e,p=ut(g),f=Lt(l),w=s-f.scrollLeft-p.left,$=r-f.scrollTop-p.top;if(e===l||e===b?(this.dragElement=g,this.changeControl1(w,$)):e===c||e===u?(this.dragElement=g,this.changeControl2($)):(e===h||e===d)&&(this.dragElement=g,this.changeAlpha($)),n){const P=_("li.active",n);P&&(O(P,"active"),Ct(P,St))}t.preventDefault()};pointerUp=({target:t})=>{const{parent:e}=this,s=V(e),r=_(`${ce}.open`,s)!==null,n=s.getSelection();!this.dragElement&&(!n||!n.toString().length)&&!e.contains(t)&&this.hide(r),this.dragElement=void 0};pointerMove=t=>{const{dragElement:e,visuals:s}=this,[r,n,i]=s,{pageX:a,pageY:l}=t;if(!e)return;const c=ut(e),h=Lt(r),b=a-h.scrollLeft-c.left,u=l-h.scrollTop-c.top;e===r&&this.changeControl1(b,u),e===n&&this.changeControl2(u),e===i&&this.changeAlpha(u)};handleKnobs=t=>{const{target:e,code:s}=t;if(![st,j,gt,G].includes(s))return;t.preventDefault();const{controlKnobs:r,visuals:n}=this,{offsetWidth:i,offsetHeight:a}=n[0],[l,c,h]=r,{activeElement:b}=V(l),u=r.find(g=>g===b),d=a/360;if(u){let g=0,p=0;if(e===l){const f=i/100;[gt,G].includes(s)?this.controlPositions.c1x+=s===G?f:-f:[st,j].includes(s)&&(this.controlPositions.c1y+=s===j?d:-d),g=this.controlPositions.c1x,p=this.controlPositions.c1y,this.changeControl1(g,p)}else e===c?(this.controlPositions.c2y+=[j,G].includes(s)?d:-d,p=this.controlPositions.c2y,this.changeControl2(p)):e===h&&(this.controlPositions.c3y+=[j,G].includes(s)?d:-d,p=this.controlPositions.c3y,this.changeAlpha(p));this.handleScroll(t)}};changeHandler=()=>{let t;const{inputs:e,format:s,value:r,input:n,controlPositions:i,visuals:a}=this,{activeElement:l}=V(n),{offsetHeight:c}=a[0],[h,,,b]=e,[u,d,g,p]=s==="rgb"?e.map($=>parseFloat($.value)/($===b?100:1)):e.map($=>parseFloat($.value)/($!==h?100:360)),f=this.hasNonColor&&pt.includes(r),w=b?p:1-i.c3y/c;if(l===n||l&&e.includes(l)){l===n?f?t=r==="transparent"?"rgba(0,0,0,0)":"rgb(0,0,0)":t=r:s==="hex"?t=h.value:s==="hsl"?t={h:u,s:d,l:g,a:w}:s==="hwb"?t={h:u,w:d,b:g,a:w}:t={r:u,g:d,b:g,a:w};const{r:$,g:P,b:L,a:S}=new y(t);K(this.color,{r:$,g:P,b:L,a:S}),this.setControlPositions(),this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals(),l===n&&f&&(this.value=r)}};changeControl1(t,e){let[s,r]=[0,0];const{controlPositions:n,visuals:i}=this,{offsetHeight:a,offsetWidth:l}=i[0];t>l?s=l:t>=0&&(s=t),e>a?r=a:e>=0&&(r=e);const c=n.c2y/a,h=s/l,b=1-r/a,u=1-n.c3y/a,{r:d,g,b:p,a:f}=new y({h:c,s:h,v:b,a:u});K(this.color,{r:d,g,b:p,a:f}),this.controlPositions.c1x=s,this.controlPositions.c1y=r,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}changeControl2(t){const{controlPositions:e,visuals:s}=this,{offsetHeight:r,offsetWidth:n}=s[0];let i=0;t>r?i=r:t>=0&&(i=t);const a=i/r,l=e.c1x/n,c=1-e.c1y/r,h=1-e.c3y/r,{r:b,g:u,b:d,a:g}=new y({h:a,s:l,v:c,a:h});K(this.color,{r:b,g:u,b:d,a:g}),this.controlPositions.c2y=i,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}changeAlpha(t){const{visuals:e}=this,{offsetHeight:s}=e[0];let r=0;t>s?r=s:t>=0&&(r=t);const n=1-r/s;this.color.setAlpha(n),this.controlPositions.c3y=r,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}update=()=>{this.updateDropdownPosition(),this.updateAppearance(),this.setControlPositions(),this.updateInputs(!0),this.updateControls(),this.updateVisuals()};updateDropdownPosition(){const{input:t,colorPicker:e,colorMenu:s}=this,r=ut(t),{top:n,bottom:i}=r,{offsetHeight:a}=t,l=Lt(t).clientHeight,h=T(e,"show")?e:s;if(!h)return;const{offsetHeight:b}=h,u=l-i,d=n,g=n+b+a>l,p=n-b<0;(T(h,"bottom")||!p)&&u{t&&t.preventDefault();const{colorPicker:e}=this;this.isOpen&&T(e,"show")?this.hide(!0):Nt(this,e)};showPicker=()=>{const{colorPicker:t}=this;["top","bottom"].some(e=>T(t,e))||Nt(this,t)};toggleMenu=t=>{t&&t.preventDefault();const{colorMenu:e}=this;this.isOpen&&T(e,"show")?this.hide(!0):Nt(this,e)};hide(t){if(this.isOpen){const{pickerToggle:e,menuToggle:s,colorPicker:r,colorMenu:n,parent:i,input:a}=this,l=T(r,"show"),c=l?r:n,h=l?e:s,b=c&&ro(c);this.value=this.color.toString(!0),c&&(O(c,"show"),m(h,Et,"false"),setTimeout(()=>{Me(c),_(".show",i)||(O(i,"open"),Ee(this),this.isOpen=!1)},b)),t||U(e),m(a,X,"-1"),h===s&&m(s,X,"-1")}}dispose(){const{input:t,parent:e}=this;this.hide(!0),he(this),[...e.children].forEach(s=>{s!==t&&s.remove()}),Ct(t,X),D(t,{backgroundColor:""}),["txt-light","txt-dark"].forEach(s=>O(e,s)),ht.remove(t,Y)}}module.exports=Te; + ${b}`}),D(r,{background:p}),D(n,{background:`linear-gradient(rgba(${l},${c},${h},1) 0%,rgba(${l},${c},${h},0) 100%)`})}handleFocusOut=({relatedTarget:t})=>{t&&!this.parent.contains(t)&&this.hide(!0)};handleDismiss=({code:t})=>{this.isOpen&&t===Ge&&this.hide()};handleScroll=t=>{const{activeElement:e}=V(this.input);this.updateDropdownPosition(),([ue,je].includes(t.type)&&this.dragElement||e&&this.controlKnobs.includes(e))&&(t.stopPropagation(),t.preventDefault())};menuKeyHandler=t=>{const{target:e,code:s}=t,{previousElementSibling:r,nextElementSibling:n,parentElement:i}=e,a=i&&T(i,"color-options"),l=i?[...i.children]:[],c=a&&Tt(i,"grid-template-columns").split(" ").length,h=l.indexOf(e),b=h>-1&&c&&l[h-c],u=h>-1&&c&&l[h+c];[j,ot,Wt].includes(s)&&t.preventDefault(),a?b&&s===ot?_(b):u&&s===j?_(u):r&&s===ht?_(r):n&&s===U&&_(n):r&&[ht,ot].includes(s)?_(r):n&&[U,j].includes(s)&&_(n),[qe,Wt].includes(s)&&this.menuClickHandler(t)};menuClickHandler=t=>{const{target:e}=t,{colorMenu:s}=this,r=(yt(e,"data-value")||"").trim();if(!r.length)return;const n=z("li.active",s);let i=r;i=bt.includes(i)?"white":i,i=i==="transparent"?"rgba(0,0,0,0)":i;const{r:a,g:l,b:c,a:h}=new y(i);K(this.color,{r:a,g:l,b:c,a:h}),this.update(),n!==e&&(n&&(O(n,"active"),Pt(n,St)),q(e,"active"),m(e,St,"true"),bt.includes(r)&&(this.value=r),ge(this))};pointerDown=t=>{if(t.button!==0)return;const{target:e,pageX:s,pageY:r}=t,{colorMenu:n,visuals:i,controlKnobs:a}=this,[l,c,h]=i,[b,u,d]=a,g=a.includes(e)?e.previousElementSibling:e,p=gt(g),f=Ct(l),w=s-f.scrollLeft-p.left,$=r-f.scrollTop-p.top;if(e===l||e===b?(this.dragElement=g,this.changeControl1(w,$)):e===c||e===u?(this.dragElement=g,this.changeControl2($)):(e===h||e===d)&&(this.dragElement=g,this.changeAlpha($)),n){const S=z("li.active",n);S&&(O(S,"active"),Pt(S,St))}t.preventDefault()};pointerUp=({target:t})=>{const{parent:e}=this,s=V(e),r=z(`${ce}.open`,s)!==null,n=s.getSelection();!this.dragElement&&(!n||!n.toString().length)&&!e.contains(t)&&this.hide(r),this.dragElement=void 0};pointerMove=t=>{const{dragElement:e,visuals:s}=this,[r,n,i]=s,{pageX:a,pageY:l}=t;if(!e)return;const c=gt(e),h=Ct(r),b=a-h.scrollLeft-c.left,u=l-h.scrollTop-c.top;e===r&&this.changeControl1(b,u),e===n&&this.changeControl2(u),e===i&&this.changeAlpha(u)};handleKnobs=t=>{const{target:e,code:s}=t;if(![ot,j,ht,U].includes(s))return;t.preventDefault();const{controlKnobs:r,visuals:n}=this,{offsetWidth:i,offsetHeight:a}=n[0],[l,c,h]=r,{activeElement:b}=V(l),u=r.find(g=>g===b),d=a/360;if(u){let g=0,p=0;if(e===l){const f=i/100;[ht,U].includes(s)?this.controlPositions.c1x+=s===U?f:-f:[ot,j].includes(s)&&(this.controlPositions.c1y+=s===j?d:-d),g=this.controlPositions.c1x,p=this.controlPositions.c1y,this.changeControl1(g,p)}else e===c?(this.controlPositions.c2y+=[j,U].includes(s)?d:-d,p=this.controlPositions.c2y,this.changeControl2(p)):e===h&&(this.controlPositions.c3y+=[j,U].includes(s)?d:-d,p=this.controlPositions.c3y,this.changeAlpha(p));this.handleScroll(t)}};changeHandler=()=>{let t;const{inputs:e,format:s,value:r,input:n,controlPositions:i,visuals:a}=this,{activeElement:l}=V(n),{offsetHeight:c}=a[0],[h,,,b]=e,[u,d,g,p]=s==="rgb"?e.map($=>parseFloat($.value)/($===b?100:1)):e.map($=>parseFloat($.value)/($!==h?100:360)),f=this.hasNonColor&&bt.includes(r),w=b?p:1-i.c3y/c;if(l===n||l&&e.includes(l)){l===n?f?t=r==="transparent"?"rgba(0,0,0,0)":"rgb(0,0,0)":t=r:s==="hex"?t=h.value:s==="hsl"?t={h:u,s:d,l:g,a:w}:s==="hwb"?t={h:u,w:d,b:g,a:w}:t={r:u,g:d,b:g,a:w};const{r:$,g:S,b:L,a:P}=new y(t);K(this.color,{r:$,g:S,b:L,a:P}),this.setControlPositions(),this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals(),l===n&&f&&(this.value=r)}};changeControl1(t,e){let[s,r]=[0,0];const{controlPositions:n,visuals:i}=this,{offsetHeight:a,offsetWidth:l}=i[0];t>l?s=l:t>=0&&(s=t),e>a?r=a:e>=0&&(r=e);const c=n.c2y/a,h=s/l,b=1-r/a,u=1-n.c3y/a,{r:d,g,b:p,a:f}=new y({h:c,s:h,v:b,a:u});K(this.color,{r:d,g,b:p,a:f}),this.controlPositions.c1x=s,this.controlPositions.c1y=r,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}changeControl2(t){const{controlPositions:e,visuals:s}=this,{offsetHeight:r,offsetWidth:n}=s[0];let i=0;t>r?i=r:t>=0&&(i=t);const a=i/r,l=e.c1x/n,c=1-e.c1y/r,h=1-e.c3y/r,{r:b,g:u,b:d,a:g}=new y({h:a,s:l,v:c,a:h});K(this.color,{r:b,g:u,b:d,a:g}),this.controlPositions.c2y=i,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}changeAlpha(t){const{visuals:e}=this,{offsetHeight:s}=e[0];let r=0;t>s?r=s:t>=0&&(r=t);const n=1-r/s;this.color.setAlpha(n),this.controlPositions.c3y=r,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}update=()=>{this.updateDropdownPosition(),this.updateAppearance(),this.setControlPositions(),this.updateInputs(!0),this.updateControls(),this.updateVisuals()};updateDropdownPosition(){const{input:t,colorPicker:e,colorMenu:s}=this,r=gt(t),{top:n,bottom:i}=r,{offsetHeight:a}=t,l=Ct(t).clientHeight,h=T(e,"show")?e:s;if(!h)return;const{offsetHeight:b}=h,u=l-i,d=n,g=n+b+a>l,p=n-b<0;(T(h,"bottom")||!p)&&u{t&&t.preventDefault();const{colorPicker:e}=this;this.isOpen&&T(e,"show")?this.hide(!0):Ht(this,e)};showPicker=()=>{const{colorPicker:t}=this;["top","bottom"].some(e=>T(t,e))||Ht(this,t)};toggleMenu=t=>{t&&t.preventDefault();const{colorMenu:e}=this;this.isOpen&&T(e,"show")?this.hide(!0):Ht(this,e)};hide(t){if(this.isOpen){const{pickerToggle:e,menuToggle:s,colorPicker:r,colorMenu:n,parent:i,input:a}=this,l=T(r,"show"),c=l?r:n,h=l?e:s,b=c&&to(c);this.value=this.color.toString(!0),c&&(O(c,"show"),m(h,Nt,"false"),setTimeout(()=>{Ne(c),z(".show",i)||(O(i,"open"),He(this),this.isOpen=!1)},b)),t||_(e),m(a,X,"-1"),h===s&&m(s,X,"-1")}}dispose(){const{input:t,parent:e}=this;this.hide(!0),he(this),[...e.children].forEach(s=>{s!==t&&s.remove()}),Pt(t,X),D(t,{backgroundColor:""}),["txt-light","txt-dark"].forEach(s=>O(e,s)),ct.remove(t,Z)}}module.exports=Ee; //# sourceMappingURL=color-picker.cjs.map diff --git a/dist/js/color-picker.cjs.map b/dist/js/color-picker.cjs.map index b265363..3a3851c 100644 --- a/dist/js/color-picker.cjs.map +++ b/dist/js/color-picker.cjs.map @@ -1 +1 @@ -{"version":3,"file":"color-picker.cjs","sources":["../../node_modules/.pnpm/@thednp+event-listener@2.0.2/node_modules/@thednp/event-listener/dist/event-listener.mjs","../../node_modules/.pnpm/@thednp+shorty@2.0.0-alpha17/node_modules/@thednp/shorty/dist/shorty.mjs","../../node_modules/.pnpm/@thednp+color@1.0.8/node_modules/@thednp/color/dist/index.mjs","../../src/ts/colorPalette.ts","../../src/ts/util/colorPickerLabels.ts","../../src/ts/util/colorNames.ts","../../src/ts/util/isValidJSON.ts","../../src/ts/util/vHidden.ts","../../src/ts/util/getColorForm.ts","../../src/ts/util/getColorControls.ts","../../src/ts/util/getColorMenu.ts","../../src/ts/util/setMarkup.ts","../../src/ts/index.ts"],"sourcesContent":["const e = {}, f = (t) => {\n const { type: c, currentTarget: i } = t;\n [...e[c]].forEach(([n, s]) => {\n i === n && [...s].forEach(([o, a]) => {\n o.apply(n, [t]), typeof a == \"object\" && a.once && r(n, c, o, a);\n });\n });\n}, E = (t, c, i, n) => {\n e[c] || (e[c] = /* @__PURE__ */ new Map());\n const s = e[c];\n s.has(t) || s.set(t, /* @__PURE__ */ new Map());\n const o = s.get(t), { size: a } = o;\n o.set(i, n), a || t.addEventListener(c, f, n);\n}, r = (t, c, i, n) => {\n const s = e[c], o = s && s.get(t), a = o && o.get(i), d = a !== void 0 ? a : n;\n o && o.has(i) && o.delete(i), s && (!o || !o.size) && s.delete(t), (!s || !s.size) && delete e[c], (!o || !o.size) && t.removeEventListener(c, f, d);\n}, g = E, M = r;\nexport {\n E as addListener,\n f as globalListener,\n M as off,\n g as on,\n e as registry,\n r as removeListener\n};\n//# sourceMappingURL=event-listener.mjs.map\n","const pe = \"aria-checked\", me = \"aria-description\", fe = \"aria-describedby\", ge = \"aria-expanded\", ve = \"aria-haspopup\", Ee = \"aria-hidden\", be = \"aria-label\", he = \"aria-labelledby\", ye = \"aria-modal\", we = \"aria-pressed\", Ae = \"aria-selected\", Se = \"aria-valuemin\", Me = \"aria-valuemax\", Ne = \"aria-valuenow\", ke = \"aria-valuetext\", q = \"abort\", G = \"beforeunload\", J = \"blur\", K = \"change\", X = \"contextmenu\", P = \"DOMContentLoaded\", Y = \"DOMMouseScroll\", Z = \"error\", $ = \"focus\", _ = \"focusin\", tt = \"focusout\", et = \"gesturechange\", nt = \"gestureend\", ot = \"gesturestart\", st = \"keydown\", ct = \"keypress\", rt = \"keyup\", at = \"load\", it = \"click\", ut = \"dblclick\", lt = \"mousedown\", dt = \"mouseup\", pt = \"hover\", mt = \"mouseenter\", ft = \"mouseleave\", gt = \"mousein\", vt = \"mouseout\", Et = \"mouseover\", bt = \"mousemove\", ht = \"mousewheel\", yt = \"move\", wt = \"orientationchange\", At = \"pointercancel\", St = \"pointerdown\", Mt = \"pointerleave\", Nt = \"pointermove\", kt = \"pointerup\", Tt = \"readystatechange\", Dt = \"reset\", Ct = \"resize\", Ot = \"select\", Lt = \"selectend\", It = \"selectstart\", zt = \"scroll\", xt = \"submit\", Vt = \"touchstart\", Bt = \"touchmove\", Ht = \"touchcancel\", Pt = \"touchend\", Ft = \"unload\", Te = {\n DOMContentLoaded: P,\n DOMMouseScroll: Y,\n abort: q,\n beforeunload: G,\n blur: J,\n change: K,\n click: it,\n contextmenu: X,\n dblclick: ut,\n error: Z,\n focus: $,\n focusin: _,\n focusout: tt,\n gesturechange: et,\n gestureend: nt,\n gesturestart: ot,\n hover: pt,\n keydown: st,\n keypress: ct,\n keyup: rt,\n load: at,\n mousedown: lt,\n mousemove: bt,\n mousein: gt,\n mouseout: vt,\n mouseenter: mt,\n mouseleave: ft,\n mouseover: Et,\n mouseup: dt,\n mousewheel: ht,\n move: yt,\n orientationchange: wt,\n pointercancel: At,\n pointerdown: St,\n pointerleave: Mt,\n pointermove: Nt,\n pointerup: kt,\n readystatechange: Tt,\n reset: Dt,\n resize: Ct,\n scroll: zt,\n select: Ot,\n selectend: Lt,\n selectstart: It,\n submit: xt,\n touchcancel: Ht,\n touchend: Pt,\n touchmove: Bt,\n touchstart: Vt,\n unload: Ft\n}, De = \"drag\", Ce = \"dragstart\", Oe = \"dragenter\", Le = \"dragleave\", Ie = \"dragover\", ze = \"dragend\", xe = \"loadstart\", Ve = {\n start: \"mousedown\",\n end: \"mouseup\",\n move: \"mousemove\",\n cancel: \"mouseleave\"\n}, Be = { down: \"mousedown\", up: \"mouseup\" }, He = \"onmouseleave\" in document ? [\"mouseenter\", \"mouseleave\"] : (\n /* istanbul ignore next */\n [\"mouseover\", \"mouseout\"]\n), Pe = {\n start: \"touchstart\",\n end: \"touchend\",\n move: \"touchmove\",\n cancel: \"touchcancel\"\n}, Fe = { in: \"focusin\", out: \"focusout\" }, Ue = {\n Backspace: \"Backspace\",\n // 8\n Tab: \"Tab\",\n // 9\n Enter: \"Enter\",\n // 13\n Shift: \"Shift\",\n // 16\n Control: \"Control\",\n // 17\n Alt: \"Alt\",\n // 18\n Pause: \"Pause\",\n // 19\n CapsLock: \"CapsLock\",\n // 20\n Escape: \"Escape\",\n // 27\n Scape: \"Space\",\n // 32\n ArrowLeft: \"ArrowLeft\",\n // 37\n ArrowUp: \"ArrowUp\",\n // 38\n ArrowRight: \"ArrowRight\",\n // 39\n ArrowDown: \"ArrowDown\",\n // 40\n Insert: \"Insert\",\n // 45\n Delete: \"Delete\",\n // 46\n Meta: \"Meta\",\n // 91 windows key\n ContextMenu: \"ContextMenu\",\n // 93\n ScrollLock: \"ScrollLock\"\n // 145\n}, We = \"Alt\", Re = \"ArrowDown\", Qe = \"ArrowUp\", je = \"ArrowLeft\", qe = \"ArrowRight\", Ge = \"Backspace\", Je = \"CapsLock\", Ke = \"Control\", Xe = \"Delete\", Ye = \"Enter\", Ze = \"Escape\", $e = \"Insert\", _e = \"Meta\", tn = \"Pause\", en = \"ScrollLock\", nn = \"Shift\", on = \"Space\", sn = \"Tab\", Ut = \"animationDuration\", Wt = \"animationDelay\", F = \"animationName\", D = \"animationend\", Rt = \"transitionDuration\", Qt = \"transitionDelay\", C = \"transitionend\", U = \"transitionProperty\", cn = \"addEventListener\", rn = \"removeEventListener\", an = {\n linear: \"linear\",\n easingSinusoidalIn: \"cubic-bezier(0.47,0,0.745,0.715)\",\n easingSinusoidalOut: \"cubic-bezier(0.39,0.575,0.565,1)\",\n easingSinusoidalInOut: \"cubic-bezier(0.445,0.05,0.55,0.95)\",\n easingQuadraticIn: \"cubic-bezier(0.550,0.085,0.680,0.530)\",\n easingQuadraticOut: \"cubic-bezier(0.250,0.460,0.450,0.940)\",\n easingQuadraticInOut: \"cubic-bezier(0.455,0.030,0.515,0.955)\",\n easingCubicIn: \"cubic-bezier(0.55,0.055,0.675,0.19)\",\n easingCubicOut: \"cubic-bezier(0.215,0.61,0.355,1)\",\n easingCubicInOut: \"cubic-bezier(0.645,0.045,0.355,1)\",\n easingQuarticIn: \"cubic-bezier(0.895,0.03,0.685,0.22)\",\n easingQuarticOut: \"cubic-bezier(0.165,0.84,0.44,1)\",\n easingQuarticInOut: \"cubic-bezier(0.77,0,0.175,1)\",\n easingQuinticIn: \"cubic-bezier(0.755,0.05,0.855,0.06)\",\n easingQuinticOut: \"cubic-bezier(0.23,1,0.32,1)\",\n easingQuinticInOut: \"cubic-bezier(0.86,0,0.07,1)\",\n easingExponentialIn: \"cubic-bezier(0.95,0.05,0.795,0.035)\",\n easingExponentialOut: \"cubic-bezier(0.19,1,0.22,1)\",\n easingExponentialInOut: \"cubic-bezier(1,0,0,1)\",\n easingCircularIn: \"cubic-bezier(0.6,0.04,0.98,0.335)\",\n easingCircularOut: \"cubic-bezier(0.075,0.82,0.165,1)\",\n easingCircularInOut: \"cubic-bezier(0.785,0.135,0.15,0.86)\",\n easingBackIn: \"cubic-bezier(0.6,-0.28,0.735,0.045)\",\n easingBackOut: \"cubic-bezier(0.175,0.885,0.32,1.275)\",\n easingBackInOut: \"cubic-bezier(0.68,-0.55,0.265,1.55)\"\n}, un = \"offsetHeight\", ln = \"offsetWidth\", dn = \"scrollHeight\", pn = \"scrollWidth\", mn = \"tabindex\", jt = navigator.userAgentData, A = jt, { userAgent: qt } = navigator, S = qt, z = /iPhone|iPad|iPod|Android/i;\nlet O = !1;\nA ? O = A.brands.some((t) => z.test(t.brand)) : O = z.test(S);\nconst fn = O, x = /(iPhone|iPod|iPad)/, gn = A ? A.brands.some((t) => x.test(t.brand)) : (\n /* istanbul ignore next */\n x.test(S)\n), vn = S ? S.includes(\"Firefox\") : (\n /* istanbul ignore next */\n !1\n), { head: M } = document, En = [\"webkitPerspective\", \"perspective\"].some((t) => t in M.style), Gt = (t, e, n, o) => {\n const s = o || !1;\n t.addEventListener(e, n, s);\n}, Jt = (t, e, n, o) => {\n const s = o || !1;\n t.removeEventListener(e, n, s);\n}, Kt = (t, e, n, o) => {\n const s = (r) => {\n (r.target === t || r.currentTarget === t) && (n.apply(t, [r]), Jt(t, e, s, o));\n };\n Gt(t, e, s, o);\n}, Xt = () => {\n}, bn = (() => {\n let t = !1;\n try {\n const e = Object.defineProperty({}, \"passive\", {\n get: () => (t = !0, t)\n });\n Kt(document, P, Xt, e);\n } catch {\n }\n return t;\n})(), hn = [\"webkitTransform\", \"transform\"].some((t) => t in M.style), yn = \"ontouchstart\" in window || /* istanbul ignore next */\n\"msMaxTouchPoints\" in navigator, wn = [\"webkitAnimation\", \"animation\"].some((t) => t in M.style), An = [\"webkitTransition\", \"transition\"].some((t) => t in M.style), Yt = (t, e) => t.getAttribute(e), Sn = (t, e, n) => e.getAttributeNS(t, n), Mn = (t, e) => t.hasAttribute(e), Nn = (t, e, n) => e.hasAttributeNS(t, n), kn = (t, e, n) => t.setAttribute(e, n), Tn = (t, e, n, o) => e.setAttributeNS(t, n, o), Dn = (t, e) => t.removeAttribute(e), Cn = (t, e, n) => e.removeAttributeNS(t, n), On = (t, ...e) => {\n t.classList.add(...e);\n}, Ln = (t, ...e) => {\n t.classList.remove(...e);\n}, In = (t, e) => t.classList.contains(e), { body: zn } = document, { documentElement: xn } = document, Vn = (t) => Array.from(t), v = (t) => t != null && typeof t == \"object\" || !1, i = (t) => v(t) && typeof t.nodeType == \"number\" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some((e) => t.nodeType === e) || !1, u = (t) => i(t) && t.nodeType === 1 || !1, E = /* @__PURE__ */ new Map(), L = {\n data: E,\n /**\n * Sets web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @param instance the component instance\n */\n set: (t, e, n) => {\n if (!u(t))\n return;\n E.has(e) || E.set(e, /* @__PURE__ */ new Map()), E.get(e).set(t, n);\n },\n /**\n * Returns all instances for specified component.\n *\n * @param component the component's name or a unique key\n * @returns all the component instances\n */\n getAllFor: (t) => E.get(t) || null,\n /**\n * Returns the instance associated with the target.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @returns the instance\n */\n get: (t, e) => {\n if (!u(t) || !e)\n return null;\n const n = L.getAllFor(e);\n return t && n && n.get(t) || null;\n },\n /**\n * Removes web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n */\n remove: (t, e) => {\n const n = L.getAllFor(e);\n !n || !u(t) || (n.delete(t), n.size === 0 && E.delete(e));\n }\n}, Bn = (t, e) => L.get(t, e), N = (t) => typeof t == \"string\" || !1, W = (t) => v(t) && t.constructor.name === \"Window\" || !1, R = (t) => i(t) && t.nodeType === 9 || !1, d = (t) => W(t) ? t.document : R(t) ? t : i(t) ? t.ownerDocument : window.document, k = (t, ...e) => Object.assign(t, ...e), Zt = (t) => {\n if (!t)\n return;\n if (N(t))\n return d().createElement(t);\n const { tagName: e } = t, n = Zt(e);\n if (!n)\n return;\n const o = { ...t };\n return delete o.tagName, k(n, o);\n}, $t = (t, e) => {\n if (!t || !e)\n return;\n if (N(e))\n return d().createElementNS(t, e);\n const { tagName: n } = e, o = $t(t, n);\n if (!o)\n return;\n const s = { ...e };\n return delete s.tagName, k(o, s);\n}, Q = (t, e) => t.dispatchEvent(e), Hn = (t, e, n) => n.indexOf(t) === e, g = (t, e) => {\n const n = getComputedStyle(t), o = e.replace(\"webkit\", \"Webkit\").replace(/([A-Z])/g, \"-$1\").toLowerCase();\n return n.getPropertyValue(o);\n}, _t = (t) => {\n const e = g(t, F), n = g(t, Wt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, te = (t) => {\n const e = g(t, F), n = g(t, Ut), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Pn = (t, e) => {\n let n = 0;\n const o = new Event(D), s = te(t), r = _t(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(D, a), n = 1);\n };\n t.addEventListener(D, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, ee = (t) => {\n const e = g(t, U), n = g(t, Qt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, ne = (t) => {\n const e = g(t, U), n = g(t, Rt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Fn = (t, e) => {\n let n = 0;\n const o = new Event(C), s = ne(t), r = ee(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(C, a), n = 1);\n };\n t.addEventListener(C, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, Un = (t) => Float32Array.from(Array.from(t)), Wn = (t) => Float64Array.from(Array.from(t)), Rn = (t, e) => t.focus(e), V = (t) => [\"true\", !0].includes(t) ? !0 : [\"false\", !1].includes(t) ? !1 : [\"null\", \"\", null, void 0].includes(t) ? null : t !== \"\" && !Number.isNaN(+t) ? +t : t, w = (t) => Object.entries(t), oe = (t) => t.toLowerCase(), Qn = (t, e, n, o) => {\n const s = { ...n }, r = { ...t.dataset }, a = { ...e }, l = {}, p = \"title\";\n return w(r).forEach(([c, m]) => {\n const y = o && typeof c == \"string\" && c.includes(o) ? c.replace(o, \"\").replace(/[A-Z]/g, (j) => oe(j)) : c;\n l[y] = V(m);\n }), w(s).forEach(([c, m]) => {\n s[c] = V(m);\n }), w(e).forEach(([c, m]) => {\n c in s ? a[c] = s[c] : c in l ? a[c] = l[c] : a[c] = c === p ? Yt(t, p) : m;\n }), a;\n}, jn = (t, e) => v(t) && (Object.hasOwn(t, e) || e in t), qn = (t) => Object.keys(t), Gn = (t) => Object.values(t), Jn = (t) => Object.fromEntries(t), Kn = (t, e) => {\n const n = new CustomEvent(t, {\n cancelable: !0,\n bubbles: !0\n });\n return v(e) && k(n, e), n;\n}, Xn = { passive: !0 }, Yn = (t) => t.offsetHeight, Zn = (t, e) => {\n w(e).forEach(([n, o]) => {\n if (o && N(n) && n.includes(\"--\"))\n t.style.setProperty(n, o);\n else {\n const s = {};\n s[n] = o, k(t.style, s);\n }\n });\n}, I = (t) => v(t) && t.constructor.name === \"Map\" || !1, se = (t) => typeof t == \"number\" || !1, f = /* @__PURE__ */ new Map(), $n = {\n /**\n * Sets a new timeout timer for an element, or element -> key association.\n *\n * @param element target element\n * @param callback the callback\n * @param delay the execution delay\n * @param key a unique key\n */\n set: (t, e, n, o) => {\n u(t) && (o && o.length ? (f.has(t) || f.set(t, /* @__PURE__ */ new Map()), f.get(t).set(o, setTimeout(e, n))) : f.set(t, setTimeout(e, n)));\n },\n /**\n * Returns the timer associated with the target.\n *\n * @param element target element\n * @param key a unique\n * @returns the timer\n */\n get: (t, e) => {\n if (!u(t))\n return null;\n const n = f.get(t);\n return e && n && I(n) ? n.get(e) || /* istanbul ignore next */\n null : se(n) ? n : null;\n },\n /**\n * Clears the element's timer.\n *\n * @param element target element\n * @param key a unique key\n */\n clear: (t, e) => {\n if (!u(t))\n return;\n const n = f.get(t);\n e && e.length && I(n) ? (clearTimeout(n.get(e)), n.delete(e), n.size === 0 && f.delete(t)) : (clearTimeout(n), f.delete(t));\n }\n}, _n = (t) => t.toUpperCase(), h = (t, e) => {\n const { width: n, height: o, top: s, right: r, bottom: a, left: l } = t.getBoundingClientRect();\n let p = 1, c = 1;\n if (e && u(t)) {\n const { offsetWidth: m, offsetHeight: y } = t;\n p = m > 0 ? Math.round(n) / m : (\n /* istanbul ignore next */\n 1\n ), c = y > 0 ? Math.round(o) / y : (\n /* istanbul ignore next */\n 1\n );\n }\n return {\n width: n / p,\n height: o / c,\n top: s / c,\n right: r / p,\n bottom: a / c,\n left: l / p,\n x: l / p,\n y: s / c\n };\n}, to = (t) => d(t).body, T = (t) => d(t).documentElement, eo = (t) => d(t).head, no = (t) => {\n const e = W(t), n = e ? t.scrollX : t.scrollLeft, o = e ? t.scrollY : t.scrollTop;\n return { x: n, y: o };\n}, ce = (t) => i(t) && t.constructor.name === \"ShadowRoot\" || !1, oo = (t) => t.nodeName === \"HTML\" ? t : u(t) && t.assignedSlot || // step into the shadow DOM of the parent of a slotted node\ni(t) && t.parentNode || // DOM Element detected\nce(t) && t.host || // ShadowRoot detected\nT(t), re = (t) => {\n if (!u(t))\n return !1;\n const { width: e, height: n } = h(t), { offsetWidth: o, offsetHeight: s } = t;\n return Math.round(e) !== o || Math.round(n) !== s;\n}, so = (t, e, n) => {\n const o = u(e), s = h(t, o && re(e)), r = { x: 0, y: 0 };\n if (o) {\n const a = h(e, !0);\n r.x = a.x + e.clientLeft, r.y = a.y + e.clientTop;\n }\n return {\n x: s.left + n.x - r.x,\n y: s.top + n.y - r.y,\n width: s.width,\n height: s.height\n };\n};\nlet B = 0, H = 0;\nconst b = /* @__PURE__ */ new Map(), ae = (t, e) => {\n let n = e ? B : H;\n if (e) {\n const o = ae(t), s = b.get(o) || /* @__PURE__ */ new Map();\n b.has(o) || b.set(o, s), I(s) && !s.has(e) ? (s.set(e, n), B += 1) : n = s.get(e);\n } else {\n const o = t.id || t;\n b.has(o) ? n = b.get(o) : (b.set(o, n), H += 1);\n }\n return n;\n}, co = (t) => {\n var e;\n return t ? R(t) ? t.defaultView : i(t) ? (e = t == null ? void 0 : t.ownerDocument) == null ? void 0 : e.defaultView : t : window;\n}, ie = (t) => Array.isArray(t) || !1, ro = (t) => i(t) && t.nodeName === \"CANVAS\" || !1, ue = (t) => u(t) && !!t.shadowRoot || !1, ao = (t) => i(t) && [1, 2, 3, 4, 5, 6, 7, 8].some((e) => t.nodeType === e) || !1, io = (t) => {\n if (!i(t))\n return !1;\n const { top: e, bottom: n } = h(t), { clientHeight: o } = T(t);\n return e <= o && n >= 0;\n}, uo = (t) => {\n if (!i(t))\n return !1;\n const { clientWidth: e, clientHeight: n } = T(t), { top: o, left: s, bottom: r, right: a } = h(t, !0);\n return o >= 0 && s >= 0 && r <= n && a <= e;\n}, lo = (t) => ie(t) && t.every(u) || !1, po = (t) => typeof t == \"function\" || !1, mo = (t) => v(t) && t.constructor.name === \"HTMLCollection\" || !1, fo = (t) => u(t) && t.tagName === \"IMG\" || !1, go = (t) => {\n if (!N(t))\n return !1;\n try {\n JSON.parse(t);\n } catch {\n return !1;\n }\n return !0;\n}, vo = (t) => v(t) && t.constructor.name === \"WeakMap\" || !1, Eo = (t) => i(t) && [\"SVG\", \"Image\", \"Video\", \"Canvas\"].some((e) => t.constructor.name.includes(e)) || !1, bo = (t) => v(t) && t.constructor.name === \"NodeList\" || !1, ho = (t) => T(t).dir === \"rtl\", yo = (t) => i(t) && t.constructor.name.includes(\"SVG\") || !1, wo = (t) => i(t) && [\"TABLE\", \"TD\", \"TH\"].includes(t.nodeName) || !1, le = (t, e) => t ? t.closest(e) || // break out of `ShadowRoot`\nle(t.getRootNode().host, e) : null, Ao = (t, e) => u(t) ? t : (i(e) ? e : d()).querySelector(t), de = (t, e) => (i(e) ? e : d()).getElementsByTagName(t), So = (t) => [...de(\"*\", t)].filter(ue), Mo = (t, e) => d(e).getElementById(t) || null, No = (t, e) => (i(e) ? e : d()).querySelectorAll(t), ko = (t, e) => (e && i(e) ? e : d()).getElementsByClassName(\n t\n), To = (t, e) => t.matches(e), Do = \"2.0.0alpha17\";\nexport {\n Vn as ArrayFrom,\n P as DOMContentLoadedEvent,\n Y as DOMMouseScrollEvent,\n L as Data,\n Un as Float32ArrayFrom,\n Wn as Float64ArrayFrom,\n k as ObjectAssign,\n w as ObjectEntries,\n Jn as ObjectFromEntries,\n jn as ObjectHasOwn,\n qn as ObjectKeys,\n Gn as ObjectValues,\n $n as Timer,\n q as abortEvent,\n On as addClass,\n cn as addEventListener,\n Wt as animationDelay,\n Ut as animationDuration,\n D as animationEndEvent,\n F as animationName,\n pe as ariaChecked,\n fe as ariaDescribedBy,\n me as ariaDescription,\n ge as ariaExpanded,\n ve as ariaHasPopup,\n Ee as ariaHidden,\n be as ariaLabel,\n he as ariaLabelledBy,\n ye as ariaModal,\n we as ariaPressed,\n Ae as ariaSelected,\n Me as ariaValueMax,\n Se as ariaValueMin,\n Ne as ariaValueNow,\n ke as ariaValueText,\n G as beforeunloadEvent,\n an as bezierEasings,\n J as blurEvent,\n K as changeEvent,\n le as closest,\n X as contextmenuEvent,\n Kn as createCustomEvent,\n Zt as createElement,\n $t as createElementNS,\n Q as dispatchEvent,\n Hn as distinct,\n zn as documentBody,\n xn as documentElement,\n M as documentHead,\n De as dragEvent,\n ze as dragendEvent,\n Oe as dragenterEvent,\n Le as dragleaveEvent,\n Ie as dragoverEvent,\n Ce as dragstartEvent,\n Pn as emulateAnimationEnd,\n Fn as emulateTransitionEnd,\n Z as errorEvent,\n Rn as focus,\n $ as focusEvent,\n Fe as focusEvents,\n _ as focusinEvent,\n tt as focusoutEvent,\n et as gesturechangeEvent,\n nt as gestureendEvent,\n ot as gesturestartEvent,\n Yt as getAttribute,\n Sn as getAttributeNS,\n h as getBoundingClientRect,\n So as getCustomElements,\n d as getDocument,\n to as getDocumentBody,\n T as getDocumentElement,\n eo as getDocumentHead,\n _t as getElementAnimationDelay,\n te as getElementAnimationDuration,\n Mo as getElementById,\n g as getElementStyle,\n ee as getElementTransitionDelay,\n ne as getElementTransitionDuration,\n ko as getElementsByClassName,\n de as getElementsByTagName,\n Bn as getInstance,\n no as getNodeScroll,\n oo as getParentNode,\n so as getRectRelativeToOffsetParent,\n ae as getUID,\n co as getWindow,\n Mn as hasAttribute,\n Nn as hasAttributeNS,\n In as hasClass,\n gn as isApple,\n ie as isArray,\n ro as isCanvas,\n ue as isCustomElement,\n R as isDocument,\n ao as isElement,\n io as isElementInScrollRange,\n uo as isElementInViewport,\n lo as isElementsArray,\n vn as isFirefox,\n po as isFunction,\n mo as isHTMLCollection,\n u as isHTMLElement,\n fo as isHTMLImageElement,\n go as isJSON,\n I as isMap,\n Eo as isMedia,\n fn as isMobile,\n i as isNode,\n bo as isNodeList,\n se as isNumber,\n v as isObject,\n ho as isRTL,\n yo as isSVGElement,\n re as isScaledElement,\n ce as isShadowRoot,\n N as isString,\n wo as isTableElement,\n vo as isWeakMap,\n W as isWindow,\n We as keyAlt,\n Re as keyArrowDown,\n je as keyArrowLeft,\n qe as keyArrowRight,\n Qe as keyArrowUp,\n Ge as keyBackspace,\n Je as keyCapsLock,\n Ke as keyControl,\n Xe as keyDelete,\n Ye as keyEnter,\n Ze as keyEscape,\n $e as keyInsert,\n _e as keyMeta,\n tn as keyPause,\n en as keyScrollLock,\n nn as keyShift,\n on as keySpace,\n sn as keyTab,\n Ue as keyboardEventKeys,\n st as keydownEvent,\n ct as keypressEvent,\n rt as keyupEvent,\n at as loadEvent,\n xe as loadstartEvent,\n To as matches,\n Be as mouseClickEvents,\n He as mouseHoverEvents,\n Ve as mouseSwipeEvents,\n it as mouseclickEvent,\n ut as mousedblclickEvent,\n lt as mousedownEvent,\n mt as mouseenterEvent,\n pt as mousehoverEvent,\n gt as mouseinEvent,\n ft as mouseleaveEvent,\n bt as mousemoveEvent,\n vt as mouseoutEvent,\n Et as mouseoverEvent,\n dt as mouseupEvent,\n ht as mousewheelEvent,\n yt as moveEvent,\n Te as nativeEvents,\n Xt as noop,\n Qn as normalizeOptions,\n V as normalizeValue,\n Jt as off,\n un as offsetHeight,\n ln as offsetWidth,\n Gt as on,\n Kt as one,\n wt as orientationchangeEvent,\n Xn as passiveHandler,\n At as pointercancelEvent,\n St as pointerdownEvent,\n Mt as pointerleaveEvent,\n Nt as pointermoveEvent,\n kt as pointerupEvent,\n Ao as querySelector,\n No as querySelectorAll,\n Tt as readystatechangeEvent,\n Yn as reflow,\n Dn as removeAttribute,\n Cn as removeAttributeNS,\n Ln as removeClass,\n rn as removeEventListener,\n Dt as resetEvent,\n Ct as resizeEvent,\n zt as scrollEvent,\n dn as scrollHeight,\n pn as scrollWidth,\n Ot as selectEvent,\n Lt as selectendEvent,\n It as selectstartEvent,\n kn as setAttribute,\n Tn as setAttributeNS,\n Zn as setElementStyle,\n xt as submitEvent,\n En as support3DTransform,\n wn as supportAnimation,\n bn as supportPassive,\n yn as supportTouch,\n hn as supportTransform,\n An as supportTransition,\n mn as tabindex,\n oe as toLowerCase,\n _n as toUpperCase,\n Pe as touchEvents,\n Ht as touchcancelEvent,\n Pt as touchendEvent,\n Bt as touchmoveEvent,\n Vt as touchstartEvent,\n Qt as transitionDelay,\n Rt as transitionDuration,\n C as transitionEndEvent,\n U as transitionProperty,\n Ft as unloadEvent,\n S as userAgent,\n A as userAgentData,\n Do as version\n};\n//# sourceMappingURL=shorty.mjs.map\n","const N = [\"transparent\", \"currentColor\", \"inherit\", \"revert\", \"initial\"], b = (o) => {\n const t = Math.floor(o);\n return o - t < 0.5 ? t : Math.round(o);\n}, T = [\n [\n \"aliceblue\",\n {\n r: 240,\n g: 248,\n b: 255\n }\n ],\n [\n \"antiquewhite\",\n {\n r: 250,\n g: 235,\n b: 215\n }\n ],\n [\n \"aqua\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"aquamarine\",\n {\n r: 127,\n g: 255,\n b: 212\n }\n ],\n [\n \"azure\",\n {\n r: 240,\n g: 255,\n b: 255\n }\n ],\n [\n \"beige\",\n {\n r: 245,\n g: 245,\n b: 220\n }\n ],\n [\n \"bisque\",\n {\n r: 255,\n g: 228,\n b: 196\n }\n ],\n [\n \"black\",\n {\n r: 0,\n g: 0,\n b: 0\n }\n ],\n [\n \"blanchedalmond\",\n {\n r: 255,\n g: 235,\n b: 205\n }\n ],\n [\n \"blue\",\n {\n r: 0,\n g: 0,\n b: 255\n }\n ],\n [\n \"blueviolet\",\n {\n r: 138,\n g: 43,\n b: 226\n }\n ],\n [\n \"brown\",\n {\n r: 165,\n g: 42,\n b: 42\n }\n ],\n [\n \"burlywood\",\n {\n r: 222,\n g: 184,\n b: 135\n }\n ],\n [\n \"cadetblue\",\n {\n r: 95,\n g: 158,\n b: 160\n }\n ],\n [\n \"chartreuse\",\n {\n r: 127,\n g: 255,\n b: 0\n }\n ],\n [\n \"chocolate\",\n {\n r: 210,\n g: 105,\n b: 30\n }\n ],\n [\n \"coral\",\n {\n r: 255,\n g: 127,\n b: 80\n }\n ],\n [\n \"cornflowerblue\",\n {\n r: 100,\n g: 149,\n b: 237\n }\n ],\n [\n \"cornsilk\",\n {\n r: 255,\n g: 248,\n b: 220\n }\n ],\n [\n \"crimson\",\n {\n r: 220,\n g: 20,\n b: 60\n }\n ],\n [\n \"cyan\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"darkblue\",\n {\n r: 0,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkcyan\",\n {\n r: 0,\n g: 139,\n b: 139\n }\n ],\n [\n \"darkgoldenrod\",\n {\n r: 184,\n g: 134,\n b: 11\n }\n ],\n [\n \"darkgray\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkgreen\",\n {\n r: 0,\n g: 100,\n b: 0\n }\n ],\n [\n \"darkgrey\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkkhaki\",\n {\n r: 189,\n g: 183,\n b: 107\n }\n ],\n [\n \"darkmagenta\",\n {\n r: 139,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkolivegreen\",\n {\n r: 85,\n g: 107,\n b: 47\n }\n ],\n [\n \"darkorange\",\n {\n r: 255,\n g: 140,\n b: 0\n }\n ],\n [\n \"darkorchid\",\n {\n r: 153,\n g: 50,\n b: 204\n }\n ],\n [\n \"darkred\",\n {\n r: 139,\n g: 0,\n b: 0\n }\n ],\n [\n \"darksalmon\",\n {\n r: 233,\n g: 150,\n b: 122\n }\n ],\n [\n \"darkseagreen\",\n {\n r: 143,\n g: 188,\n b: 143\n }\n ],\n [\n \"darkslateblue\",\n {\n r: 72,\n g: 61,\n b: 139\n }\n ],\n [\n \"darkslategray\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkslategrey\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkturquoise\",\n {\n r: 0,\n g: 206,\n b: 209\n }\n ],\n [\n \"darkviolet\",\n {\n r: 148,\n g: 0,\n b: 211\n }\n ],\n [\n \"deeppink\",\n {\n r: 255,\n g: 20,\n b: 147\n }\n ],\n [\n \"deepskyblue\",\n {\n r: 0,\n g: 191,\n b: 255\n }\n ],\n [\n \"dimgray\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dimgrey\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dodgerblue\",\n {\n r: 30,\n g: 144,\n b: 255\n }\n ],\n [\n \"firebrick\",\n {\n r: 178,\n g: 34,\n b: 34\n }\n ],\n [\n \"floralwhite\",\n {\n r: 255,\n g: 250,\n b: 240\n }\n ],\n [\n \"forestgreen\",\n {\n r: 34,\n g: 139,\n b: 34\n }\n ],\n [\n \"fuchsia\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"gainsboro\",\n {\n r: 220,\n g: 220,\n b: 220\n }\n ],\n [\n \"ghostwhite\",\n {\n r: 248,\n g: 248,\n b: 255\n }\n ],\n [\n \"goldenrod\",\n {\n r: 218,\n g: 165,\n b: 32\n }\n ],\n [\n \"gold\",\n {\n r: 255,\n g: 215,\n b: 0\n }\n ],\n [\n \"gray\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"green\",\n {\n r: 0,\n g: 128,\n b: 0\n }\n ],\n [\n \"greenyellow\",\n {\n r: 173,\n g: 255,\n b: 47\n }\n ],\n [\n \"grey\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"honeydew\",\n {\n r: 240,\n g: 255,\n b: 240\n }\n ],\n [\n \"hotpink\",\n {\n r: 255,\n g: 105,\n b: 180\n }\n ],\n [\n \"indianred\",\n {\n r: 205,\n g: 92,\n b: 92\n }\n ],\n [\n \"indigo\",\n {\n r: 75,\n g: 0,\n b: 130\n }\n ],\n [\n \"ivory\",\n {\n r: 255,\n g: 255,\n b: 240\n }\n ],\n [\n \"khaki\",\n {\n r: 240,\n g: 230,\n b: 140\n }\n ],\n [\n \"lavenderblush\",\n {\n r: 255,\n g: 240,\n b: 245\n }\n ],\n [\n \"lavender\",\n {\n r: 230,\n g: 230,\n b: 250\n }\n ],\n [\n \"lawngreen\",\n {\n r: 124,\n g: 252,\n b: 0\n }\n ],\n [\n \"lemonchiffon\",\n {\n r: 255,\n g: 250,\n b: 205\n }\n ],\n [\n \"lightblue\",\n {\n r: 173,\n g: 216,\n b: 230\n }\n ],\n [\n \"lightcoral\",\n {\n r: 240,\n g: 128,\n b: 128\n }\n ],\n [\n \"lightcyan\",\n {\n r: 224,\n g: 255,\n b: 255\n }\n ],\n [\n \"lightgoldenrodyellow\",\n {\n r: 250,\n g: 250,\n b: 210\n }\n ],\n [\n \"lightgray\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightgreen\",\n {\n r: 144,\n g: 238,\n b: 144\n }\n ],\n [\n \"lightgrey\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightpink\",\n {\n r: 255,\n g: 182,\n b: 193\n }\n ],\n [\n \"lightsalmon\",\n {\n r: 255,\n g: 160,\n b: 122\n }\n ],\n [\n \"lightseagreen\",\n {\n r: 32,\n g: 178,\n b: 170\n }\n ],\n [\n \"lightskyblue\",\n {\n r: 135,\n g: 206,\n b: 250\n }\n ],\n [\n \"lightslategray\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightslategrey\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightsteelblue\",\n {\n r: 176,\n g: 196,\n b: 222\n }\n ],\n [\n \"lightyellow\",\n {\n r: 255,\n g: 255,\n b: 224\n }\n ],\n [\n \"lime\",\n {\n r: 0,\n g: 255,\n b: 0\n }\n ],\n [\n \"limegreen\",\n {\n r: 50,\n g: 205,\n b: 50\n }\n ],\n [\n \"linen\",\n {\n r: 250,\n g: 240,\n b: 230\n }\n ],\n [\n \"magenta\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"maroon\",\n {\n r: 128,\n g: 0,\n b: 0\n }\n ],\n [\n \"mediumaquamarine\",\n {\n r: 102,\n g: 205,\n b: 170\n }\n ],\n [\n \"mediumblue\",\n {\n r: 0,\n g: 0,\n b: 205\n }\n ],\n [\n \"mediumorchid\",\n {\n r: 186,\n g: 85,\n b: 211\n }\n ],\n [\n \"mediumpurple\",\n {\n r: 147,\n g: 112,\n b: 219\n }\n ],\n [\n \"mediumseagreen\",\n {\n r: 60,\n g: 179,\n b: 113\n }\n ],\n [\n \"mediumslateblue\",\n {\n r: 123,\n g: 104,\n b: 238\n }\n ],\n [\n \"mediumspringgreen\",\n {\n r: 0,\n g: 250,\n b: 154\n }\n ],\n [\n \"mediumturquoise\",\n {\n r: 72,\n g: 209,\n b: 204\n }\n ],\n [\n \"mediumvioletred\",\n {\n r: 199,\n g: 21,\n b: 133\n }\n ],\n [\n \"midnightblue\",\n {\n r: 25,\n g: 25,\n b: 112\n }\n ],\n [\n \"mintcream\",\n {\n r: 245,\n g: 255,\n b: 250\n }\n ],\n [\n \"mistyrose\",\n {\n r: 255,\n g: 228,\n b: 225\n }\n ],\n [\n \"moccasin\",\n {\n r: 255,\n g: 228,\n b: 181\n }\n ],\n [\n \"navajowhite\",\n {\n r: 255,\n g: 222,\n b: 173\n }\n ],\n [\n \"navy\",\n {\n r: 0,\n g: 0,\n b: 128\n }\n ],\n [\n \"oldlace\",\n {\n r: 253,\n g: 245,\n b: 230\n }\n ],\n [\n \"olive\",\n {\n r: 128,\n g: 128,\n b: 0\n }\n ],\n [\n \"olivedrab\",\n {\n r: 107,\n g: 142,\n b: 35\n }\n ],\n [\n \"orange\",\n {\n r: 255,\n g: 165,\n b: 0\n }\n ],\n [\n \"orangered\",\n {\n r: 255,\n g: 69,\n b: 0\n }\n ],\n [\n \"orchid\",\n {\n r: 218,\n g: 112,\n b: 214\n }\n ],\n [\n \"palegoldenrod\",\n {\n r: 238,\n g: 232,\n b: 170\n }\n ],\n [\n \"palegreen\",\n {\n r: 152,\n g: 251,\n b: 152\n }\n ],\n [\n \"paleturquoise\",\n {\n r: 175,\n g: 238,\n b: 238\n }\n ],\n [\n \"palevioletred\",\n {\n r: 219,\n g: 112,\n b: 147\n }\n ],\n [\n \"papayawhip\",\n {\n r: 255,\n g: 239,\n b: 213\n }\n ],\n [\n \"peachpuff\",\n {\n r: 255,\n g: 218,\n b: 185\n }\n ],\n [\n \"peru\",\n {\n r: 205,\n g: 133,\n b: 63\n }\n ],\n [\n \"pink\",\n {\n r: 255,\n g: 192,\n b: 203\n }\n ],\n [\n \"plum\",\n {\n r: 221,\n g: 160,\n b: 221\n }\n ],\n [\n \"powderblue\",\n {\n r: 176,\n g: 224,\n b: 230\n }\n ],\n [\n \"purple\",\n {\n r: 128,\n g: 0,\n b: 128\n }\n ],\n [\n \"rebeccapurple\",\n {\n r: 102,\n g: 51,\n b: 153\n }\n ],\n [\n \"red\",\n {\n r: 255,\n g: 0,\n b: 0\n }\n ],\n [\n \"rosybrown\",\n {\n r: 188,\n g: 143,\n b: 143\n }\n ],\n [\n \"royalblue\",\n {\n r: 65,\n g: 105,\n b: 225\n }\n ],\n [\n \"saddlebrown\",\n {\n r: 139,\n g: 69,\n b: 19\n }\n ],\n [\n \"salmon\",\n {\n r: 250,\n g: 128,\n b: 114\n }\n ],\n [\n \"sandybrown\",\n {\n r: 244,\n g: 164,\n b: 96\n }\n ],\n [\n \"seagreen\",\n {\n r: 46,\n g: 139,\n b: 87\n }\n ],\n [\n \"seashell\",\n {\n r: 255,\n g: 245,\n b: 238\n }\n ],\n [\n \"sienna\",\n {\n r: 160,\n g: 82,\n b: 45\n }\n ],\n [\n \"silver\",\n {\n r: 192,\n g: 192,\n b: 192\n }\n ],\n [\n \"skyblue\",\n {\n r: 135,\n g: 206,\n b: 235\n }\n ],\n [\n \"slateblue\",\n {\n r: 106,\n g: 90,\n b: 205\n }\n ],\n [\n \"slategray\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"slategrey\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"snow\",\n {\n r: 255,\n g: 250,\n b: 250\n }\n ],\n [\n \"springgreen\",\n {\n r: 0,\n g: 255,\n b: 127\n }\n ],\n [\n \"steelblue\",\n {\n r: 70,\n g: 130,\n b: 180\n }\n ],\n [\n \"tan\",\n {\n r: 210,\n g: 180,\n b: 140\n }\n ],\n [\n \"teal\",\n {\n r: 0,\n g: 128,\n b: 128\n }\n ],\n [\n \"thistle\",\n {\n r: 216,\n g: 191,\n b: 216\n }\n ],\n [\n \"tomato\",\n {\n r: 255,\n g: 99,\n b: 71\n }\n ],\n [\n \"turquoise\",\n {\n r: 64,\n g: 224,\n b: 208\n }\n ],\n [\n \"violet\",\n {\n r: 238,\n g: 130,\n b: 238\n }\n ],\n [\n \"wheat\",\n {\n r: 245,\n g: 222,\n b: 179\n }\n ],\n [\n \"white\",\n {\n r: 255,\n g: 255,\n b: 255\n }\n ],\n [\n \"whitesmoke\",\n {\n r: 245,\n g: 245,\n b: 245\n }\n ],\n [\n \"yellow\",\n {\n r: 255,\n g: 255,\n b: 0\n }\n ],\n [\n \"yellowgreen\",\n {\n r: 154,\n g: 205,\n b: 50\n }\n ]\n], B = \"deg|rad|grad|turn\", U = \"[-\\\\+]?\\\\d+%?\", D = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\", L = `[-\\\\+]?\\\\d*\\\\.?\\\\d+(?:${B})?`, v = `(?:${D})|(?:${U})`, F = `(?:${v})|(?:${L}?)`, rr = \"(?:[\\\\s|\\\\(\\\\s|\\\\s\\\\(\\\\s]+)?\", tr = \"(?:[\\\\s|\\\\)\\\\s]+)?\", O = \"(?:[,|\\\\s]+)\", er = \"(?:[,|\\\\/\\\\s]*)?\", $ = `${rr}(${F})${O}(${v})${O}(${v})${er}(${v})?${tr}`, f = {\n CSS_UNIT: new RegExp(F),\n ANGLES: B,\n CSS_ANGLE: L,\n CSS_INTEGER: U,\n CSS_NUMBER: D,\n CSS_UNIT2: F,\n PERMISSIVE_MATCH: $,\n hwb: new RegExp(`hwb${$}`),\n rgb: new RegExp(`rgb(?:a)?${$}`),\n hsl: new RegExp(`hsl(?:a)?${$}`),\n hsv: new RegExp(`hsv(?:a)?${$}`),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n}, V = (o) => N.includes(o), k = (o, t) => o !== null && typeof o == \"object\" && Object.keys(t).every((r) => r in o), Z = (o) => `${o}`.includes(\".\") && parseFloat(o) === 1, R = (o) => typeof o == \"string\" && o.includes(\"%\"), c = (o) => !!f.CSS_UNIT.exec(`${o}`), z = [\"rgb\", \"hex\", \"hsl\", \"hsv\", \"hwb\"], J = (o) => N.includes(o) || [\"#\", ...z].some((t) => o.includes(t)) ? !1 : T.some(([t]) => o === t), u = (o, t) => {\n let r = o;\n if (typeof o == \"number\" && Math.min(o, 0) === 0 && // round values to 6 decimals Math.round(N * (10 ** 6)) / 10 ** 6\n Math.max(o, 1) === 1)\n return o;\n Z(o) && (r = \"100%\");\n const e = R(r);\n return r = t === 360 ? parseFloat(r) : Math.min(t, Math.max(0, parseFloat(r))), e && (r = r * t / 100), Math.abs(r - t) < 1e-6 ? 1 : (t === 360 ? r = (r < 0 ? r % t + t : r % t) / t : r = r % t / t, r);\n}, M = (o) => {\n let t = parseFloat(o);\n return (Number.isNaN(t) || t < 0 || t > 1) && (t = 1), t;\n}, x = (o) => Math.min(1, Math.max(0, o)), p = (o) => o.length === 1 ? `0${o}` : String(o), K = (o) => {\n const [[, t]] = T.filter(([r]) => r === o.toLowerCase());\n return t;\n}, h = (o) => parseInt(o, 16), E = (o) => h(o) / 255, Q = (o) => b(o * 255).toString(16), _ = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0, g = 0;\n const a = (e + s) / 2;\n if (e === s)\n g = 0, n = 0;\n else {\n const i = e - s;\n g = a > 0.5 ? i / (2 - e - s) : i / (e + s), e === o && (n = (t - r) / i + (t < r ? 6 : 0)), e === t && (n = (r - o) / i + 2), e === r && (n = (o - t) / i + 4), n /= 6;\n }\n return { h: n, s: g, l: a };\n}, H = (o, t, r) => {\n let e = r;\n return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? o + (t - o) * (6 * e) : e < 1 / 2 ? t : e < 2 / 3 ? o + (t - o) * (2 / 3 - e) * 6 : o;\n}, y = (o, t, r) => {\n let e = 0, s = 0, n = 0;\n if (t === 0)\n s = r, n = r, e = r;\n else if (r) {\n const g = r < 0.5 ? r * (1 + t) : r + t - r * t, a = 2 * r - g;\n e = H(a, g, o + 1 / 3), s = H(a, g, o), n = H(a, g, o - 1 / 3);\n }\n return { r: e, g: s, b: n };\n}, G = (o, t, r) => {\n let e = 0, s = 0;\n const n = Math.min(o, t, r), g = Math.max(o, t, r), a = 1 - g;\n if (g === n)\n return { h: 0, w: n, b: a };\n o === n ? (e = t - r, s = 3) : (e = t === n ? r - o : o - t, s = t === n ? 5 : 1);\n const i = (s - e / (g - n)) / 6;\n return {\n h: i === 1 ? 0 : i,\n w: n,\n b: a\n };\n}, X = (o, t, r) => {\n if (t + r >= 1) {\n const g = t / (t + r);\n return { r: g, g, b: g };\n }\n let { r: e, g: s, b: n } = y(o, 1, 0.5);\n return [e, s, n] = [e, s, n].map((g) => g * (1 - t - r) + t), { r: e, g: s, b: n };\n}, P = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0;\n const g = e, a = e - s, i = e === 0 ? 0 : a / e;\n return e === s ? n = 0 : (o === e && (n = (t - r) / a + (t < r ? 6 : 0)), t === e && (n = (r - o) / a + 2), r === e && (n = (o - t) / a + 4), n /= 6), { h: n, s: i, v: g };\n}, I = (o, t, r) => {\n const e = o * 6, s = t, n = r, g = Math.floor(e), a = e - g, i = n * (1 - s), l = n * (1 - a * s), d = n * (1 - (1 - a) * s), m = g % 6, w = [n, l, i, i, d, n][m], S = [d, n, n, l, i, i][m], A = [i, i, d, n, n, l][m];\n return { r: w, g: S, b: A };\n}, j = (o, t, r, e) => {\n const s = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16))\n ];\n return e && s[0].charAt(0) === s[0].charAt(1) && s[1].charAt(0) === s[1].charAt(1) && s[2].charAt(0) === s[2].charAt(1) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) : s.join(\"\");\n}, C = (o, t, r, e, s) => {\n const n = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16)),\n p(Q(e))\n ];\n return s && n[0].charAt(0) === n[0].charAt(1) && n[1].charAt(0) === n[1].charAt(1) && n[2].charAt(0) === n[2].charAt(1) && n[3].charAt(0) === n[3].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join(\"\");\n}, Y = (o) => {\n const t = String(o).trim().toLowerCase();\n if (J(t))\n return Object.assign(K(t), {\n a: 1,\n format: \"rgb\",\n ok: !0\n });\n if (V(t))\n return {\n r: 0,\n g: 0,\n b: 0,\n a: t === \"transparent\" ? 0 : 1,\n format: \"rgb\",\n ok: !0\n };\n let [, r, e, s, n] = f.rgb.exec(t) || [];\n return r && e && s ? {\n r,\n g: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"rgb\",\n ok: !0\n } : ([, r, e, s, n] = f.hsl.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n l: s,\n a: n !== void 0 ? n : 1,\n format: \"hsl\",\n ok: !0\n } : ([, r, e, s, n] = f.hsv.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n v: s,\n a: n !== void 0 ? n : 1,\n format: \"hsv\",\n ok: !0\n } : ([, r, e, s, n] = f.hwb.exec(t) || [], r && e && s ? {\n h: r,\n w: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"hwb\",\n ok: !0\n } : ([, r, e, s, n] = f.hex8.exec(t) || [], r && e && s && n ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: E(n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex6.exec(t) || [], r && e && s ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : ([, r, e, s, n] = f.hex4.exec(t) || [], r && e && s && n ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: E(n + n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex3.exec(t) || [], r && e && s ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : {\n r: 0,\n g: 0,\n b: 0,\n a: 1,\n format: \"rgb\",\n ok: !o\n })))))));\n}, q = (o) => {\n let t = { r: 0, g: 0, b: 0 }, r = o, e = 1, s, n, g, a, i, l, d, m, w = \"rgb\", S = !1;\n return (!r || typeof r == \"string\") && (r = Y(r), S = r.ok), k(r, t) && c(r.r) && c(r.g) && c(r.b) && ({ r: d, g: m, b: i } = r, [d, m, i] = [d, m, i].map((A) => u(A, R(A) ? 100 : 255)), t = { r: d, g: m, b: i }, w = \"format\" in r ? r.format : \"rgb\"), k(r, { h: 0, s: 0, v: 0 }) && c(r.h) && c(r.s) && c(r.v) && ({ h: l, s, v: n } = r, l = u(l, 360), s = u(s, 100), n = u(n, 100), t = I(l, s, n), w = \"hsv\"), k(r, { h: 0, s: 0, l: 0 }) && c(r.h) && c(r.s) && c(r.l) && ({ h: l, s, l: g } = r, l = u(l, 360), s = u(s, 100), g = u(g, 100), t = y(l, s, g), w = \"hsl\"), k(r, { h: 0, w: 0, b: 0 }) && c(r.h) && c(r.w) && c(r.b) && ({ h: l, w: a, b: i } = r, l = u(l, 360), a = u(a, 100), i = u(i, 100), t = X(l, a, i), w = \"hwb\"), c(r.a) && (e = r.a, e = R(e) || parseFloat(`${e}`) > 1 ? u(e, 100) : e), {\n r: t.r,\n g: t.g,\n b: t.b,\n a: M(e),\n format: w,\n ok: S\n };\n}, sr = \"1.0.8\";\nclass W {\n // bring main utilities to front\n static matchers = f;\n static isOnePointZero = Z;\n static isPercentage = R;\n static isValidCSSUnit = c;\n static isNonColor = V;\n static isColorName = J;\n static isColorType = k;\n static pad2 = p;\n static clamp01 = x;\n static bound01 = u;\n static boundAlpha = M;\n static getRGBFromName = K;\n static convertHexToDecimal = E;\n static convertDecimalToHex = Q;\n static rgbToHsl = _;\n static rgbToHex = j;\n static rgbToHsv = P;\n static rgbToHwb = G;\n static rgbaToHex = C;\n static hslToRgb = I;\n static hsvToRgb = I;\n static hueToRgb = H;\n static hwbToRgb = X;\n static parseIntFromHex = h;\n static stringInputToObject = Y;\n static inputToRGB = q;\n static roundPart = b;\n static webColors = T;\n static nonColors = N;\n static version = sr;\n // main public properties\n r;\n g;\n b;\n a;\n format;\n ok;\n originalInput;\n // main public methods\n constructor(t, r) {\n const e = r && z.includes(r) ? r : \"\", { r: s, g: n, b: g, a, ok: i, format: l } = q(t);\n this.originalInput = t, this.r = s, this.g = n, this.b = g, this.a = a, this.ok = i, this.format = e || l;\n }\n /**\n * Checks if the current input value is a valid colour.\n */\n get isValid() {\n return this.ok;\n }\n /**\n * Checks if the current colour requires a light text colour.\n */\n get isDark() {\n return this.brightness < 120;\n }\n /**\n * Returns the perceived luminance of a colour.\n *\n * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n */\n get luminance() {\n const { r: t, g: r, b: e } = this;\n let s = 0, n = 0, g = 0;\n return t <= 0.03928 ? s = t / 12.92 : s = ((t + 0.055) / 1.055) ** 2.4, r <= 0.03928 ? n = r / 12.92 : n = ((r + 0.055) / 1.055) ** 2.4, e <= 0.03928 ? g = e / 12.92 : g = ((e + 0.055) / 1.055) ** 2.4, 0.2126 * s + 0.7152 * n + 0.0722 * g;\n }\n /**\n * Returns the perceived brightness of the colour.\n */\n get brightness() {\n const { r: t, g: r, b: e } = this.toRgb();\n return (t * 299 + r * 587 + e * 114) / 1e3;\n }\n /**\n * Returns the web colour name closest to the current colour.\n */\n get name() {\n const { r: t, g: r, b: e } = this.toRgb(), [s] = T.map(([n, g]) => {\n const a = (\n // ((rgb.r - r) ** 2 + (rgb.g - g) ** 2 + (rgb.b - b) ** 2) ** 0.5; // standard\n (((g.r - t) * 0.3) ** 2 + ((g.g - r) * 0.6) ** 2 + ((g.b - e) * 0.1) ** 2) ** 0.5\n );\n return [n, a];\n }).find(([, n], g, a) => n === Math.min(...a.map(([, i]) => i)));\n return s;\n }\n /**\n * Returns the colour as an RGBA object.\n */\n toRgb() {\n let { r: t, g: r, b: e, a: s } = this;\n return [t, r, e] = [t, r, e].map((n) => b(n * 255 * 100) / 100), s = b(s * 100) / 100, {\n r: t,\n g: r,\n b: e,\n a: s\n };\n }\n /**\n * Returns the RGBA values concatenated into a CSS3 Module string format.\n * * rgb(255,255,255)\n * * rgba(255,255,255,0.5)\n */\n toRgbString() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b);\n return s === 1 ? `rgb(${n}, ${g}, ${a})` : `rgba(${n}, ${g}, ${a}, ${s})`;\n }\n /**\n * Returns the RGBA values concatenated into a CSS4 Module string format.\n * * rgb(255 255 255)\n * * rgb(255 255 255 / 50%)\n */\n toRgbCSS4String() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b), i = s === 1 ? \"\" : ` / ${b(s * 100)}%`;\n return `rgb(${n} ${g} ${a}${i})`;\n }\n /**\n * Returns the hexadecimal value of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the decimal value.\n */\n toHex(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return n === 1 ? j(r, e, s, t) : C(r, e, s, n, t);\n }\n /**\n * Returns the CSS valid hexadecimal vaue of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the value.\n */\n toHexString(t) {\n return `#${this.toHex(t)}`;\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return C(r, e, s, n, t);\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8String(t) {\n return `#${this.toHex8(t)}`;\n }\n /**\n * Returns the colour as a HSVA object.\n */\n toHsv() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, v: a } = P(t, r, e);\n return {\n h: n,\n s: g,\n v: a,\n a: s\n };\n }\n /**\n * Returns the colour as an HSLA object.\n */\n toHsl() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, l: a } = _(t, r, e);\n return {\n h: n,\n s: g,\n l: a,\n a: s\n };\n }\n /**\n * Returns the HSLA values concatenated into a CSS3 Module format string.\n * * `hsl(150, 100%, 50%)`\n * * `hsla(150, 100%, 50%, 0.5)`\n */\n toHslString() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n return t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100) / 100, s === 1 ? `hsl(${t}, ${r}%, ${e}%)` : `hsla(${t}, ${r}%, ${e}%, ${s})`;\n }\n /**\n * Returns the HSLA values concatenated into a CSS4 Module format string.\n * * `hsl(150deg 100% 50%)`\n * * `hsl(150deg 100% 50% / 50%)`\n */\n toHslCSS4String() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hsl(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Returns the colour as an HWBA object.\n */\n toHwb() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, w: g, b: a } = G(t, r, e);\n return {\n h: n,\n w: g,\n b: a,\n a: s\n };\n }\n /**\n * Returns the HWBA values concatenated into a string.\n */\n toHwbString() {\n let { h: t, w: r, b: e, a: s } = this.toHwb();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hwb(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Sets the alpha value of the current colour.\n */\n setAlpha(t) {\n return typeof t != \"number\" ? this : (this.a = M(t), this);\n }\n /**\n * Saturate the colour with a given amount.\n */\n saturate(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, x(e + t / 100), s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Desaturate the colour with a given amount.\n */\n desaturate(t) {\n return typeof t == \"number\" ? this.saturate(-t) : this;\n }\n /**\n * Completely desaturates a colour into greyscale.\n * Same as calling `desaturate(100)`\n */\n greyscale() {\n return this.saturate(-100);\n }\n /**\n * Increase the colour lightness with a given amount.\n */\n lighten(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, e, x(s + t / 100));\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Decrease the colour lightness with a given amount.\n */\n darken(t) {\n return typeof t == \"number\" ? this.lighten(-t) : this;\n }\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n spin(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(x((r * 360 + t) % 360 / 360), e, s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /** Returns a clone of the current `Color` instance. */\n clone() {\n return new W(this);\n }\n /**\n * Returns the colour value in CSS valid string format.\n */\n toString(t) {\n const { format: r } = this;\n return r === \"hex\" ? this.toHexString(t) : r === \"hsl\" ? this.toHslString() : r === \"hwb\" ? this.toHwbString() : this.toRgbString();\n }\n}\nexport {\n W as default\n};\n//# sourceMappingURL=index.mjs.map\n","import Color from '@thednp/color';\n// import { isNumber } from '@thednp/shorty';\n\n/**\n * Returns a color palette with a given set of parameters.\n *\n * @example\n * new ColorPalette(0, 12, 10, 80);\n * // => { hue: 0, hueSteps: 12, lightSteps: 10, saturation: 80, colors: Array }\n */\nexport default class ColorPalette {\n public static Color = Color;\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n colors: Color[];\n /**\n * The `hue` parameter is optional, which would be set to 0.\n * * `args.hue` the starting Hue [0, 360]\n * * `args.hueSteps` Hue Steps Count [5, 24]\n * * `args.lightSteps` Lightness Steps Count [5, 12]\n * * `args.saturation` Saturation [0, 100]\n */\n constructor(...args: [number?, number?, number?, number?]) {\n let hue = 0;\n let hueSteps = 12;\n let lightSteps = 10;\n let lightnessArray = [0.5];\n let saturation = 100;\n // if (!args.every(n => isNumber(n))) throw TypeError('ColorPalette only accepts numbers.');\n\n if (args.length === 4) {\n [hue, hueSteps, lightSteps, saturation] = args as [number, number, number, number];\n } else if (args.length === 3) {\n [hue, hueSteps, lightSteps] = args as [number, number, number];\n } else if (args.length === 2) {\n [hueSteps, lightSteps] = args as [number, number];\n if ([hueSteps, lightSteps].some(n => n < 1)) {\n throw TypeError('ColorPalette: the two minimum arguments must be numbers higher than 0.');\n }\n }\n\n const colors: Color[] = [];\n const hueStep = 360 / hueSteps;\n const half = Color.roundPart((lightSteps - (lightSteps % 2 ? 1 : 0)) / 2);\n const steps1To13 = [0.25, 0.2, 0.15, 0.11, 0.09, 0.075];\n const lightSets = [\n [1, 2, 3],\n [4, 5],\n [6, 7],\n [8, 9],\n [10, 11],\n [12, 13],\n ];\n const closestSet = lightSets.find(set => set.includes(lightSteps));\n\n // find a lightStep that won't go beyond black and white\n // something within the [10-90] range of lightness\n const lightStep = closestSet\n ? steps1To13[lightSets.indexOf(closestSet)]\n : 100 / (lightSteps + (lightSteps % 2 ? 0 : 1)) / 100;\n\n // light tints\n for (let i = 1; i < half + 1; i += 1) {\n lightnessArray = [...lightnessArray, 0.5 + lightStep * i];\n }\n\n // dark tints\n for (let i = 1; i < lightSteps - half; i += 1) {\n lightnessArray = [0.5 - lightStep * i, ...lightnessArray];\n }\n\n // feed `colors` Array\n for (let i = 0; i < hueSteps; i += 1) {\n const currentHue = ((hue + i * hueStep) % 360) / 360;\n lightnessArray.forEach(l => {\n const newColor = new Color({ h: currentHue, s: 1, l });\n colors.push(saturation < 100 ? newColor.saturate(saturation - 100) : newColor);\n });\n }\n\n this.hue = hue;\n this.hueSteps = hueSteps;\n this.lightSteps = lightSteps;\n this.saturation = saturation;\n this.colors = colors;\n }\n}\n","import ColorPickerLabels from '../interface/colorPickerLabels';\n\n/** The labels presented to the user. */\nconst colorPickerLabels: ColorPickerLabels = {\n pickerLabel: 'Colour Picker',\n appearanceLabel: 'Colour Appearance',\n valueLabel: 'Colour Value',\n toggleLabel: 'Select Colour',\n presetsLabel: 'Colour Presets',\n defaultsLabel: 'Colour Defaults',\n formatLabel: 'Format',\n alphaLabel: 'Alpha',\n hexLabel: 'Hexadecimal',\n hueLabel: 'Hue',\n whitenessLabel: 'Whiteness',\n blacknessLabel: 'Blackness',\n saturationLabel: 'Saturation',\n lightnessLabel: 'Lightness',\n redLabel: 'Red',\n greenLabel: 'Green',\n blueLabel: 'Blue',\n};\n\nexport default colorPickerLabels;\n","/** A list of 17 color names used for WAI-ARIA compliance. */\nconst colorNames: string[] = [\n 'white',\n 'black',\n 'grey',\n 'red',\n 'orange',\n 'brown',\n 'gold',\n 'olive',\n 'yellow',\n 'lime',\n 'green',\n 'teal',\n 'cyan',\n 'blue',\n 'violet',\n 'magenta',\n 'pink',\n];\nexport default colorNames;\n","import { isString } from '@thednp/shorty';\n\n/**\n * Check if a string is valid JSON string.\n *\n * @param str the string input\n * @returns the query result\n */\nconst isValidJSON = (str: unknown): str is string => {\n if (!isString(str)) return false;\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n};\n\nexport default isValidJSON;\n","const vHidden = 'v-hidden';\nexport default vHidden;\n","import { createElement, setAttribute, ObjectAssign, toUpperCase } from '@thednp/shorty';\n\nimport vHidden from './vHidden';\nimport ColorPicker from '../index';\n\n/**\n * Returns the color form for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns a new `
` element with color component ``\n */\nconst getColorForm = (self: ColorPicker): HTMLElement => {\n const { format, id, componentLabels } = self;\n const colorForm = createElement({\n tagName: 'div',\n className: `color-form ${format}`,\n }) as HTMLElement;\n\n let components = ['hex'];\n if (format === 'rgb') components = ['red', 'green', 'blue', 'alpha'];\n else if (format === 'hsl') components = ['hue', 'saturation', 'lightness', 'alpha'];\n else if (format === 'hwb') components = ['hue', 'whiteness', 'blackness', 'alpha'];\n\n components.forEach((c: string): void => {\n const [C] = format === 'hex' ? ['#'] : toUpperCase(c).split('');\n const cID = `color_${format}_${c}_${id}`;\n const formatLabel = componentLabels[`${c}Label`];\n const cInputLabel = createElement({ tagName: 'label' }) as HTMLElement;\n setAttribute(cInputLabel, 'for', cID);\n cInputLabel.append(\n createElement({\n tagName: 'span',\n ariaHidden: 'true',\n innerText: `${C}:`,\n }) as HTMLElement,\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: formatLabel,\n }) as HTMLElement,\n );\n const cInput = createElement({\n tagName: 'input',\n id: cID,\n // name: cID, - prevent saving the value to a form\n type: format === 'hex' ? 'text' : 'number',\n value: c === 'alpha' ? '100' : '0',\n className: `color-input ${c}`,\n autocomplete: 'off',\n spellcheck: false,\n } as Partial) as HTMLInputElement;\n\n // alpha\n let max = '100';\n let step = '1';\n if (c !== 'alpha') {\n if (format === 'rgb') {\n max = '255';\n step = '1';\n } else if (c === 'hue') {\n max = '360';\n step = '1';\n }\n }\n ObjectAssign(cInput, {\n min: '0',\n max,\n step,\n });\n colorForm.append(cInputLabel, cInput);\n });\n return colorForm;\n};\n\nexport default getColorForm;\n","import { createElement } from '@thednp/shorty';\n\nimport ColorPicker from '..';\n\n/**\n * Returns all color controls for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns color controls\n */\nconst getColorControls = (self: ColorPicker): HTMLElement => {\n const { format, componentLabels } = self;\n const { hueLabel, alphaLabel, lightnessLabel, saturationLabel, whitenessLabel, blacknessLabel } = componentLabels;\n\n const max1 = format === 'hsl' ? 360 : 100;\n const max2 = format === 'hsl' ? 100 : 360;\n const max3 = 100;\n\n let ctrl1Label = format === 'hsl' ? `${hueLabel} & ${lightnessLabel}` : `${lightnessLabel} & ${saturationLabel}`;\n\n ctrl1Label = format === 'hwb' ? `${whitenessLabel} & ${blacknessLabel}` : ctrl1Label;\n\n const ctrl2Label = format === 'hsl' ? `${saturationLabel}` : `${hueLabel}`;\n\n const colorControls = createElement({\n tagName: 'div',\n className: `color-controls ${format}`,\n }) as HTMLElement;\n\n const colorPointer = 'color-pointer';\n const colorSlider = 'color-slider';\n\n const controls = [\n {\n i: 1,\n c: colorPointer,\n l: ctrl1Label,\n min: 0,\n max: max1,\n },\n {\n i: 2,\n c: colorSlider,\n l: ctrl2Label,\n min: 0,\n max: max2,\n },\n {\n i: 3,\n c: colorSlider,\n l: alphaLabel,\n min: 0,\n max: max3,\n },\n ];\n\n controls.forEach(template => {\n const { i, c, l, min, max } = template;\n const control = createElement({\n tagName: 'div',\n className: 'color-control',\n role: 'presentation',\n }) as HTMLElement;\n\n control.append(\n createElement({\n tagName: 'div',\n className: `visual-control visual-control${i}`,\n }) as HTMLElement,\n );\n\n const knob = createElement({\n tagName: 'div',\n className: `${c} knob`,\n ariaLive: 'polite',\n ariaLabel: l,\n role: 'slider',\n tabIndex: 0,\n ariaValueMin: `${min}`,\n ariaValueMax: `${max}`,\n }) as HTMLElement;\n\n control.append(knob);\n colorControls.append(control);\n });\n\n return colorControls;\n};\n\nexport default getColorControls;\n","import { setAttribute, getAttribute, createElement, setElementStyle } from '@thednp/shorty';\n\nimport Color from '@thednp/color';\nimport ColorPalette from '../colorPalette';\nimport ColorPicker from '../index';\n\n/**\n * Returns a color-defaults with given values and class.\n */\nconst getColorMenu = (self: ColorPicker, colorsSource: ColorPalette | string[], menuClass: string): HTMLElement => {\n const { input, format, componentLabels } = self;\n const { defaultsLabel, presetsLabel } = componentLabels;\n const isOptionsMenu = menuClass === 'color-options';\n const isPalette = colorsSource instanceof ColorPalette;\n const menuLabel = isOptionsMenu ? presetsLabel : defaultsLabel;\n const colorsArray = isPalette ? colorsSource.colors : colorsSource;\n const colorsCount = colorsArray.length;\n const { lightSteps } = isPalette ? colorsSource : { lightSteps: null };\n const fit = lightSteps || [9, 10].find(x => colorsCount >= x * 2 && !(colorsCount % x)) || 5;\n const isMultiLine = isOptionsMenu && colorsCount > fit;\n let rowCountHover = 2;\n rowCountHover = isMultiLine && colorsCount > fit * 2 ? 3 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 3 ? 4 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 4 ? 5 : rowCountHover;\n const rowCount = rowCountHover - (colorsCount <= fit * 3 ? 1 : 2);\n const isScrollable = isMultiLine && colorsCount > rowCount * fit;\n let finalClass = menuClass;\n finalClass += isScrollable ? ' scrollable' : '';\n finalClass += isMultiLine ? ' multiline' : '';\n const gap = isMultiLine ? '1px' : '0.25rem';\n let optionSize = isMultiLine ? 1.75 : 2;\n optionSize = fit > 5 && isMultiLine ? 1.5 : optionSize;\n const menuHeight = `${rowCount * optionSize}rem`;\n const menuHeightHover = `calc(${rowCountHover} * ${optionSize}rem + ${rowCountHover - 1} * ${gap})`;\n\n //
    is an `HTMLElement`\n const menu = createElement({\n tagName: 'ul',\n className: finalClass,\n role: 'listbox',\n ariaLabel: menuLabel,\n }) as HTMLElement;\n\n if (isScrollable) {\n setElementStyle(menu, {\n '--grid-item-size': `${optionSize}rem`,\n '--grid-fit': `${fit}`,\n '--grid-gap': gap,\n '--grid-height': menuHeight,\n '--grid-hover-height': menuHeightHover,\n });\n }\n\n colorsArray.forEach(x => {\n let [value, label] = typeof x === 'string' ? x.trim().split(':') : [];\n if (x instanceof Color) {\n value = x.toHexString();\n label = value;\n }\n const color = new Color(x instanceof Color ? x : value, format);\n const isActive = color.toString() === getAttribute(input, 'value');\n const active = isActive ? ' active' : '';\n\n const option = createElement({\n tagName: 'li',\n className: `color-option${active}`,\n innerText: `${label || value}`,\n tabIndex: 0,\n role: 'option',\n ariaSelected: isActive ? 'true' : 'false',\n }) as HTMLElement;\n setAttribute(option, 'data-value', `${value}`);\n\n if (isOptionsMenu) {\n setElementStyle(option, { backgroundColor: value });\n }\n\n menu.append(option);\n });\n return menu;\n};\n\nexport default getColorMenu;\n","import {\n getAttribute,\n setAttribute,\n toUpperCase,\n ariaHidden,\n tabindex,\n createElement,\n createElementNS,\n} from '@thednp/shorty';\n\nimport Color from '@thednp/color';\n\nimport getColorForm from './getColorForm';\nimport getColorControls from './getColorControls';\nimport getColorMenu from './getColorMenu';\nimport vHidden from './vHidden';\n\nimport ColorPicker from '../index';\n\n/**\n * Generate HTML markup and update instance properties.\n *\n * @param self\n */\nconst setMarkup = (self: ColorPicker) => {\n const { input, parent, format, id, componentLabels, colorKeywords, colorPresets } = self;\n const colorValue = getAttribute(input, 'value') || '#fff';\n const { nonColors } = Color;\n\n const { toggleLabel, pickerLabel, formatLabel, hexLabel } = componentLabels;\n\n // update color\n const color = nonColors.includes(colorValue) ? '#fff' : colorValue;\n self.color = new Color(color, format);\n\n // set initial controls dimensions\n const formatString = format === 'hex' ? hexLabel : toUpperCase(format);\n\n const pickerBtn = createElement({\n id: `picker-btn-${id}`,\n tagName: 'button',\n className: 'picker-toggle btn-appearance',\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLElement;\n\n pickerBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${pickerLabel}. ${formatLabel}: ${formatString}`,\n }) as HTMLElement,\n );\n\n const pickerDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown picker',\n role: 'group',\n ariaLabelledBy: `picker-btn-${id}`,\n } as Partial & { ariaLabelledBy: string }) as HTMLElement;\n\n const colorControls = getColorControls(self);\n const colorForm = getColorForm(self);\n\n pickerDropdown.append(colorControls, colorForm);\n input.before(pickerBtn);\n parent.append(pickerDropdown);\n\n // set colour key menu template\n if (colorKeywords || colorPresets) {\n const presetsDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown scrollable menu',\n }) as HTMLElement;\n\n // color presets\n if (colorPresets) {\n presetsDropdown.append(getColorMenu(self, colorPresets, 'color-options'));\n }\n\n // explicit defaults [reset, initial, inherit, transparent, currentColor]\n // also custom defaults [default: #069, complementary: #930]\n if (colorKeywords && colorKeywords.length) {\n presetsDropdown.append(getColorMenu(self, colorKeywords, 'color-defaults'));\n }\n\n const presetsBtn = createElement({\n tagName: 'button',\n className: 'menu-toggle btn-appearance',\n tabIndex: -1,\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLElement;\n\n const xmlns = encodeURI('http://www.w3.org/2000/svg');\n const presetsIcon = createElementNS(xmlns, {\n tagName: 'svg',\n }) as HTMLElement;\n setAttribute(presetsIcon, 'xmlns', xmlns);\n setAttribute(presetsIcon, 'viewBox', '0 0 512 512');\n setAttribute(presetsIcon, ariaHidden, 'true');\n\n const path = createElementNS(xmlns, {\n tagName: 'path',\n }) as HTMLElement;\n setAttribute(path, 'd', 'M98,158l157,156L411,158l27,27L255,368L71,185L98,158z');\n setAttribute(path, 'fill', '#fff');\n presetsIcon.append(path);\n presetsBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${toggleLabel}`,\n }) as HTMLElement,\n presetsIcon,\n );\n\n parent.append(presetsBtn, presetsDropdown);\n }\n\n // solve non-colors after settings save\n if (colorKeywords && nonColors.includes(colorValue)) {\n self.value = colorValue;\n }\n setAttribute(input, tabindex, '-1');\n};\n\nexport default setMarkup;\n","import { addListener, removeListener } from '@thednp/event-listener';\n\nimport {\n ariaDescription,\n ariaSelected,\n ariaValueNow,\n ariaValueText,\n ariaExpanded,\n keyArrowDown,\n keyArrowUp,\n keyArrowLeft,\n keyArrowRight,\n keyEnter,\n keySpace,\n keyEscape,\n focusinEvent,\n mouseclickEvent,\n keydownEvent,\n changeEvent,\n touchmoveEvent,\n pointerdownEvent,\n pointermoveEvent,\n pointerupEvent,\n tabindex,\n focusoutEvent,\n resizeEvent,\n keyupEvent,\n scrollEvent,\n dispatchEvent,\n getElementsByClassName,\n closest,\n querySelector,\n getElementTransitionDuration,\n getBoundingClientRect,\n getUID,\n getElementStyle,\n getDocumentElement,\n getDocument,\n ObjectAssign,\n ObjectFromEntries,\n Data,\n getInstance,\n setElementStyle,\n normalizeOptions,\n reflow,\n focus,\n hasClass,\n addClass,\n removeClass,\n setAttribute,\n getAttribute,\n removeAttribute,\n isArray,\n isString,\n getWindow,\n} from '@thednp/shorty';\n\n// ColorPicker Util\n// ================\nimport Color from '@thednp/color';\nimport type { RGBA, HWBA, HSLA, HSVA } from '@thednp/color';\n\nimport ColorPalette from './colorPalette';\nimport colorPickerLabels from './util/colorPickerLabels';\nimport colorNames from './util/colorNames';\nimport isValidJSON from './util/isValidJSON';\nimport setMarkup from './util/setMarkup';\n\nimport ColorPickerOptions from './interface/colorPickerOptions';\nimport ColorPickerLabels from './interface/colorPickerLabels';\nimport type ColorNames from './interface/ColorNames';\nimport { version } from '../../package.json';\n\n// ColorPicker GC\n// ==============\nconst colorPickerString = 'color-picker';\nconst colorPickerSelector = `[data-function=\"${colorPickerString}\"]`;\nconst colorPickerParentSelector = `.${colorPickerString}`;\nconst colorPickerDefaults: ColorPickerOptions = {\n componentLabels: colorPickerLabels,\n colorLabels: colorNames,\n format: 'rgb',\n colorPresets: false,\n colorKeywords: false,\n};\nconst { roundPart, nonColors } = Color;\n\n// ColorPicker Static Methods\n// ==========================\nconst getColorPickerInstance = (element: HTMLInputElement) => getInstance(element, colorPickerString);\nconst initColorPicker = (element: HTMLInputElement) => new ColorPicker(element);\n\n// ColorPicker Private Methods\n// ===========================\n\n/**\n * Add / remove `ColorPicker` main event listeners.\n */\nconst toggleEvents = (self: ColorPicker, action?: boolean) => {\n const fn = action ? addListener : removeListener;\n const { input, pickerToggle, menuToggle } = self;\n\n fn(input, focusinEvent, self.showPicker);\n fn(pickerToggle, mouseclickEvent, self.togglePicker);\n\n if (menuToggle) {\n fn(menuToggle, mouseclickEvent, self.toggleMenu);\n }\n};\n\n/**\n * Add / remove `ColorPicker` event listeners active only when open.\n */\nconst toggleEventsOnShown = (self: ColorPicker, action?: boolean) => {\n const fn = action ? addListener : removeListener;\n const { input, colorMenu, parent } = self;\n const doc = getDocument(input);\n const win = getWindow(doc);\n\n fn(self.controls, pointerdownEvent, self.pointerDown as EventListener);\n self.controlKnobs.forEach(x => fn(x, keydownEvent, self.handleKnobs as EventListener));\n\n fn(win, scrollEvent, self.handleScroll);\n fn(win, resizeEvent, self.update);\n\n [input, ...self.inputs].forEach(x => fn(x, changeEvent, self.changeHandler));\n\n if (colorMenu) {\n fn(colorMenu, mouseclickEvent, self.menuClickHandler);\n fn(colorMenu, keydownEvent, self.menuKeyHandler as EventListener);\n }\n\n fn(doc, pointermoveEvent, self.pointerMove as EventListener);\n fn(doc, pointerupEvent, self.pointerUp as EventListener);\n fn(parent, focusoutEvent, self.handleFocusOut as EventListener);\n fn(doc, keyupEvent, self.handleDismiss as EventListener);\n};\n\n/**\n * Triggers the `ColorPicker` original event.\n */\nconst firePickerChange = (self: ColorPicker) => {\n dispatchEvent(self.input, new CustomEvent('colorpicker.change'));\n};\n\n/**\n * Hides a visible dropdown.\n */\nconst removePosition = (element: HTMLElement) => {\n /* istanbul ignore else */\n if (element) {\n ['bottom', 'top'].forEach(x => removeClass(element, x));\n }\n};\n\n/**\n * Shows a `ColorPicker` dropdown and close the curent open dropdown.\n */\nconst showDropdown = (self: ColorPicker, dropdown: HTMLElement) => {\n const { colorPicker, colorMenu, menuToggle, pickerToggle, parent } = self;\n const isPicker = dropdown === colorPicker;\n const openDropdown = isPicker ? colorMenu : colorPicker;\n const activeBtn = isPicker ? menuToggle : pickerToggle;\n const nextBtn = !isPicker ? menuToggle : pickerToggle;\n\n if (!hasClass(parent, 'open')) {\n addClass(parent, 'open');\n }\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n removePosition(openDropdown);\n }\n addClass(dropdown, 'bottom');\n reflow(dropdown);\n addClass(dropdown, 'show');\n\n if (isPicker) self.update();\n\n if (!self.isOpen) {\n toggleEventsOnShown(self, true);\n self.updateDropdownPosition();\n self.isOpen = true;\n setAttribute(self.input, tabindex, '0');\n if (menuToggle) {\n setAttribute(menuToggle, tabindex, '0');\n }\n }\n\n setAttribute(nextBtn, ariaExpanded, 'true');\n if (activeBtn) {\n setAttribute(activeBtn, ariaExpanded, 'false');\n }\n};\n\n/**\n * Color Picker Web Component\n *\n * @see http://thednp.github.io/color-picker\n */\nexport default class ColorPicker {\n // bring utils to staic\n public static Color = Color;\n public static ColorPalette = ColorPalette;\n public static getInstance = getColorPickerInstance;\n public static init = initColorPicker;\n public static selector = colorPickerSelector;\n // utils important for render\n public static roundPart = roundPart;\n public static setElementStyle = setElementStyle;\n public static setAttribute = setAttribute;\n public static getBoundingClientRect = getBoundingClientRect;\n public static version = version;\n public static colorNames = colorNames;\n public static colorPickerLabels = colorPickerLabels;\n\n id: number;\n input: HTMLInputElement;\n color: Color;\n format = 'rgb';\n parent: HTMLElement;\n dragElement: HTMLElement | undefined;\n isOpen = false;\n controlPositions: {\n c1x: number;\n c1y: number;\n c2y: number;\n c3y: number;\n };\n colorLabels: ColorNames = ObjectFromEntries(colorNames.map(c => [c, c])) as ColorNames;\n colorKeywords: string[] | false;\n colorPresets: ColorPalette | string[] | false;\n componentLabels: ColorPickerLabels;\n pickerToggle: HTMLElement;\n menuToggle: HTMLElement;\n colorPicker: HTMLElement;\n colorMenu: HTMLElement;\n controls: HTMLElement;\n inputs: HTMLInputElement[];\n controlKnobs: HTMLElement[];\n visuals: HTMLElement[];\n\n /**\n * Returns a new `ColorPicker` instance. The target of this constructor\n * must be an `HTMLInputElement`.\n *\n * @param target the target `` element\n * @param config instance options\n */\n constructor(target: (HTMLElement & HTMLInputElement) | string, config?: Partial) {\n const input = querySelector(target) as HTMLInputElement;\n\n // invalidate\n if (typeof target === 'undefined') throw new TypeError(`ColorPicker target not specified.`);\n if (isString(target) && !input) throw new TypeError(`ColorPicker target \"${target}\" cannot be found.`);\n this.input = input;\n\n const parent = closest(input, colorPickerParentSelector);\n if (!parent) throw new TypeError('ColorPicker requires a specific markup to work.');\n\n this.parent = parent;\n this.id = getUID(input, colorPickerString);\n this.dragElement = undefined;\n this.isOpen = false;\n this.controlPositions = {\n c1x: 0,\n c1y: 0,\n c2y: 0,\n c3y: 0,\n };\n // this.colorLabels = {};\n this.colorKeywords = false;\n this.colorPresets = false;\n\n // process options\n const { format, componentLabels, colorLabels, colorKeywords, colorPresets } = normalizeOptions(\n input,\n colorPickerDefaults,\n config || {},\n );\n\n let translatedColorLabels = colorNames;\n /* istanbul ignore else */\n if (isArray(colorLabels) && colorLabels.length === 17) {\n translatedColorLabels = colorLabels;\n } else if (isString(colorLabels) && colorLabels.split(',').length === 17) {\n translatedColorLabels = colorLabels.split(',');\n }\n\n // expose colour labels to all methods\n ObjectAssign(this.colorLabels, ObjectFromEntries(translatedColorLabels.map((c, i) => [colorNames[i], c])));\n\n // update and expose component labels\n const tempComponentLabels =\n isString(componentLabels) && isValidJSON(componentLabels)\n ? (JSON.parse(componentLabels) as ColorPickerLabels)\n : componentLabels;\n this.componentLabels = ObjectAssign({ ...colorPickerLabels }, tempComponentLabels);\n this.color = new Color(input.value || '#fff', format);\n this.format = format;\n\n // set colour defaults\n if (isArray(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords;\n } else if (isString(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords.split(',').map(x => x.trim());\n }\n\n // set colour presets\n if (isArray(colorPresets) && colorPresets.length) {\n this.colorPresets = colorPresets;\n } else if (colorPresets && isValidJSON(colorPresets)) {\n const { hue, hueSteps, lightSteps, saturation } = JSON.parse(colorPresets) as {\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n };\n this.colorPresets = new ColorPalette(hue, hueSteps, lightSteps, saturation);\n } else if (isString(colorPresets)) {\n this.colorPresets = colorPresets.split(',').map((x: string) => x.trim());\n }\n\n // generate markup\n setMarkup(this);\n\n const [colorPicker, colorMenu] = getElementsByClassName('color-dropdown', parent);\n // set main elements\n this.pickerToggle = querySelector('.picker-toggle', parent) as HTMLElement;\n this.menuToggle = querySelector('.menu-toggle', parent) as HTMLElement;\n this.colorPicker = colorPicker;\n this.colorMenu = colorMenu;\n this.inputs = [...getElementsByClassName('color-input', parent)] as HTMLInputElement[];\n const [controls] = getElementsByClassName('color-controls', parent);\n this.controls = controls;\n this.controlKnobs = [...getElementsByClassName('knob', controls)];\n this.visuals = [...getElementsByClassName('visual-control', controls)];\n\n // update colour picker controls, inputs and visuals\n this.update();\n // console.log(this)\n\n // add main events listeners\n toggleEvents(this, true);\n\n // set component data\n Data.set(input, colorPickerString, this);\n }\n\n /** Returns the current colour value */\n get value(): string {\n return this.input.value;\n }\n\n /**\n * Sets a new colour value.\n *\n * @param {string} v new colour value\n */\n set value(v: string) {\n this.input.value = v;\n }\n\n /** Check if the colour presets include any non-colour. */\n get hasNonColor(): boolean {\n return this.colorKeywords instanceof Array && this.colorKeywords.some(x => nonColors.includes(x));\n }\n\n /** Returns hexadecimal value of the current colour. */\n get hex(): string {\n return this.color.toHex(true);\n }\n\n /** Returns the current colour value in {h,s,v,a} object format. */\n get hsv(): HSVA {\n return this.color.toHsv();\n }\n\n /** Returns the current colour value in {h,s,l,a} object format. */\n get hsl(): HSLA {\n return this.color.toHsl();\n }\n\n /** Returns the current colour value in {h,w,b,a} object format. */\n get hwb(): HWBA {\n return this.color.toHwb();\n }\n\n /** Returns the current colour value in {r,g,b,a} object format. */\n get rgb(): RGBA {\n return this.color.toRgb();\n }\n\n /** Returns the current colour brightness. */\n get brightness(): number {\n return this.color.brightness;\n }\n\n /** Returns the current colour luminance. */\n get luminance(): number {\n return this.color.luminance;\n }\n\n /** Checks if the current colour requires a light text colour. */\n get isDark(): boolean {\n const { color, brightness } = this;\n return brightness < 120 && color.a > 0.33;\n }\n\n /** Checks if the current input value is a valid colour. */\n get isValid(): boolean {\n const inputValue = this.input.value;\n return inputValue !== '' && new Color(inputValue).isValid;\n }\n\n /** Returns the colour appearance, usually the closest colour name for the current value. */\n get appearance(): string {\n const { colorLabels, hsl, hsv, format } = this;\n\n const hue = roundPart(hsl.h * 360);\n const saturationSource = format === 'hsl' ? hsl.s : hsv.s;\n const saturation = roundPart(saturationSource * 100);\n const lightness = roundPart(hsl.l * 100);\n const hsvl = hsv.v * 100;\n\n let colorName = 'black';\n\n // determine color appearance\n /* istanbul ignore else */\n if (lightness === 100 && saturation === 0) {\n colorName = colorLabels.white;\n } else if (lightness === 0) {\n colorName = colorLabels.black;\n } else if (saturation === 0) {\n colorName = colorLabels.grey;\n } else if (hue < 15 || hue >= 345) {\n colorName = colorLabels.red;\n } else if (hue >= 15 && hue < 45) {\n colorName = hsvl > 80 && saturation > 80 ? colorLabels.orange : colorLabels.brown;\n } else if (hue >= 45 && hue < 75) {\n const isGold = hue > 46 && hue < 54 && hsvl < 80 && saturation > 90;\n const isOlive = hue >= 54 && hue < 75 && hsvl < 80;\n colorName = isGold ? colorLabels.gold : colorLabels.yellow;\n colorName = isOlive ? colorLabels.olive : colorName;\n } else if (hue >= 75 && hue < 155) {\n colorName = hsvl < 68 ? colorLabels.green : colorLabels.lime;\n } else if (hue >= 155 && hue < 175) {\n colorName = colorLabels.teal;\n } else if (hue >= 175 && hue < 195) {\n colorName = colorLabels.cyan;\n } else if (hue >= 195 && hue < 255) {\n colorName = colorLabels.blue;\n } else if (hue >= 255 && hue < 270) {\n colorName = colorLabels.violet;\n } else if (hue >= 270 && hue < 295) {\n colorName = colorLabels.magenta;\n } else if (hue >= 295 && hue < 345) {\n colorName = colorLabels.pink;\n }\n return colorName;\n }\n\n /** Updates `ColorPicker` visuals. */\n updateVisuals(): void {\n const { controlPositions, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { offsetHeight } = v1;\n const hue = controlPositions.c2y / offsetHeight;\n const { r, g, b } = new Color({ h: hue, s: 1, l: 0.5 }).toRgb();\n const whiteGrad = 'linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)';\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n const roundA = roundPart(alpha * 100) / 100;\n\n const fill = new Color({\n h: hue,\n s: 1,\n l: 0.5,\n a: alpha,\n }).toRgbString();\n const hueGradient = `linear-gradient(\n rgb(255,0,0) 0%, rgb(255,255,0) 16.67%,\n rgb(0,255,0) 33.33%, rgb(0,255,255) 50%,\n rgb(0,0,255) 66.67%, rgb(255,0,255) 83.33%,\n rgb(255,0,0) 100%)`;\n setElementStyle(v1, {\n background: `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,${roundA}) 100%),\n linear-gradient(to right, rgba(255,255,255,${roundA}) 0%, ${fill} 100%),\n ${whiteGrad}`,\n });\n setElementStyle(v2, { background: hueGradient });\n\n setElementStyle(v3, {\n background: `linear-gradient(rgba(${r},${g},${b},1) 0%,rgba(${r},${g},${b},0) 100%)`,\n });\n }\n\n /**\n * The `ColorPicker` *focusout* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleFocusOut = ({ relatedTarget }: FocusEvent & { relatedTarget: HTMLElement }): void => {\n if (relatedTarget && !this.parent.contains(relatedTarget)) {\n this.hide(true);\n }\n };\n\n /**\n * The `ColorPicker` *keyup* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleDismiss = ({ code }: KeyboardEvent): void => {\n if (this.isOpen && code === keyEscape) {\n this.hide();\n }\n };\n\n /**\n * The `ColorPicker` *scroll* event listener when open.\n *\n * @param e\n */\n handleScroll = (e: Event) => {\n const { activeElement } = getDocument(this.input);\n\n this.updateDropdownPosition();\n\n /* istanbul ignore next */\n if (\n ([pointermoveEvent, touchmoveEvent].includes(e.type) && this.dragElement) ||\n (activeElement && this.controlKnobs.includes(activeElement as HTMLElement))\n ) {\n e.stopPropagation();\n e.preventDefault();\n }\n };\n\n /**\n * The `ColorPicker` keyboard event listener for menu navigation.\n *\n * @param e\n */\n menuKeyHandler = (e: KeyboardEvent & { target: HTMLElement }) => {\n const { target, code } = e;\n const { previousElementSibling, nextElementSibling, parentElement } = target;\n const isColorOptionsMenu = parentElement && hasClass(parentElement, 'color-options');\n const allSiblings = parentElement ? [...parentElement.children] : [];\n const columnsCount =\n isColorOptionsMenu && getElementStyle(parentElement, 'grid-template-columns').split(' ').length;\n const currentIndex = allSiblings.indexOf(target);\n const previousElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex - columnsCount];\n const nextElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex + columnsCount];\n\n if ([keyArrowDown, keyArrowUp, keySpace].includes(code)) {\n // prevent scroll when navigating the menu via arrow keys / Space\n e.preventDefault();\n }\n if (isColorOptionsMenu) {\n if (previousElement && code === keyArrowUp) {\n focus(previousElement as HTMLElement);\n } else if (nextElement && code === keyArrowDown) {\n focus(nextElement as HTMLElement);\n } else if (previousElementSibling && code === keyArrowLeft) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && code === keyArrowRight) {\n focus(nextElementSibling as HTMLElement);\n }\n } else if (previousElementSibling && [keyArrowLeft, keyArrowUp].includes(code)) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && [keyArrowRight, keyArrowDown].includes(code)) {\n focus(nextElementSibling as HTMLElement);\n }\n\n if ([keyEnter, keySpace].includes(code)) {\n this.menuClickHandler(e);\n }\n };\n\n /**\n * The `ColorPicker` click event listener for the colour menu presets / defaults.\n *\n * @param e\n * @this {ColorPicker}\n */\n menuClickHandler = (e: Event) => {\n const { target } = e;\n const { colorMenu } = this;\n const newOption = (getAttribute(target as HTMLElement, 'data-value') || '').trim();\n // invalidate for targets other than color options\n if (!newOption.length) return;\n const currentActive = querySelector('li.active', colorMenu);\n let newColor = newOption;\n newColor = nonColors.includes(newColor) ? 'white' : newColor;\n newColor = newColor === 'transparent' ? 'rgba(0,0,0,0)' : newColor;\n\n const { r, g, b, a } = new Color(newColor);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n this.update();\n\n /* istanbul ignore else */\n if (currentActive !== target) {\n /* istanbul ignore else */\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n\n addClass(target as HTMLElement, 'active');\n setAttribute(target as HTMLElement, ariaSelected, 'true');\n\n if (nonColors.includes(newOption)) {\n this.value = newOption;\n }\n firePickerChange(this);\n }\n };\n\n /**\n * The `ColorPicker` *touchstart* / *mousedown* events listener for control knobs.\n *\n * @param e\n */\n pointerDown = (e: PointerEvent & { target: HTMLElement }) => {\n if (e.button !== 0) return;\n const { target, pageX, pageY } = e;\n const { colorMenu, visuals, controlKnobs } = this;\n const [v1, v2, v3] = visuals;\n const [c1, c2, c3] = controlKnobs;\n const visual = controlKnobs.includes(target) ? (target.previousElementSibling as HTMLElement) : target;\n const visualRect = getBoundingClientRect(visual);\n const html = getDocumentElement(v1);\n const offsetX = pageX - html.scrollLeft - visualRect.left;\n const offsetY = pageY - html.scrollTop - visualRect.top;\n\n /* istanbul ignore else */\n if (target === v1 || target === c1) {\n this.dragElement = visual;\n this.changeControl1(offsetX, offsetY);\n } else if (target === v2 || target === c2) {\n this.dragElement = visual;\n this.changeControl2(offsetY);\n } else if (target === v3 || target === c3) {\n this.dragElement = visual;\n this.changeAlpha(offsetY);\n }\n\n if (colorMenu) {\n const currentActive = querySelector('li.active', colorMenu);\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n }\n e.preventDefault();\n };\n\n /**\n * The `ColorPicker` *touchend* / *mouseup* events listener for control knobs.\n *\n * @param e\n * @this\n */\n pointerUp = ({ target }: PointerEvent & { target: HTMLElement }) => {\n const { parent } = this;\n const doc = getDocument(parent);\n const currentOpen = querySelector(`${colorPickerParentSelector}.open`, doc) !== null;\n const selection = doc.getSelection();\n\n if (!this.dragElement && (!selection || !selection.toString().length) && !parent.contains(target)) {\n this.hide(currentOpen);\n }\n\n this.dragElement = undefined;\n };\n\n /**\n * The `ColorPicker` *touchmove* / *mousemove* events listener for control knobs.\n *\n * @param {PointerEvent} e\n */\n pointerMove = (e: PointerEvent) => {\n const { dragElement, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { pageX, pageY } = e;\n\n if (!dragElement) return;\n\n const controlRect = getBoundingClientRect(dragElement);\n const win = getDocumentElement(v1);\n const offsetX = pageX - win.scrollLeft - controlRect.left;\n const offsetY = pageY - win.scrollTop - controlRect.top;\n\n if (dragElement === v1) {\n this.changeControl1(offsetX, offsetY);\n }\n\n if (dragElement === v2) {\n this.changeControl2(offsetY);\n }\n\n if (dragElement === v3) {\n this.changeAlpha(offsetY);\n }\n };\n\n /**\n * The `ColorPicker` *keydown* event listener for control knobs.\n *\n * @param e\n */\n handleKnobs = (e: Event & { code: string }) => {\n const { target, code } = e;\n\n // only react to arrow buttons\n if (![keyArrowUp, keyArrowDown, keyArrowLeft, keyArrowRight].includes(code)) return;\n e.preventDefault();\n\n const { controlKnobs, visuals } = this;\n const { offsetWidth, offsetHeight } = visuals[0];\n const [c1, c2, c3] = controlKnobs;\n const { activeElement } = getDocument(c1);\n const currentKnob = controlKnobs.find(x => x === activeElement);\n const yRatio = offsetHeight / 360;\n\n /* istanbul ignore else */\n if (currentKnob) {\n let offsetX = 0;\n let offsetY = 0;\n\n /* istanbul ignore else */\n if (target === c1) {\n const xRatio = offsetWidth / 100;\n\n /* istanbul ignore else */\n if ([keyArrowLeft, keyArrowRight].includes(code)) {\n this.controlPositions.c1x += code === keyArrowRight ? xRatio : -xRatio;\n } else if ([keyArrowUp, keyArrowDown].includes(code)) {\n this.controlPositions.c1y += code === keyArrowDown ? yRatio : -yRatio;\n }\n\n offsetX = this.controlPositions.c1x;\n offsetY = this.controlPositions.c1y;\n this.changeControl1(offsetX, offsetY);\n } else if (target === c2) {\n this.controlPositions.c2y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c2y;\n this.changeControl2(offsetY);\n } else if (target === c3) {\n this.controlPositions.c3y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c3y;\n this.changeAlpha(offsetY);\n }\n this.handleScroll(e);\n }\n };\n\n /** The event listener of the colour form inputs. */\n changeHandler = (): void => {\n let colorSource;\n const { inputs, format, value: currentValue, input, controlPositions, visuals } = this;\n const { activeElement } = getDocument(input);\n const { offsetHeight } = visuals[0];\n const [i1, , , i4] = inputs;\n const [v1, v2, v3, v4] =\n format === 'rgb'\n ? inputs.map(i => parseFloat(i.value) / (i === i4 ? 100 : 1))\n : inputs.map(i => parseFloat(i.value) / (i !== i1 ? 100 : 360));\n const isNonColorValue = this.hasNonColor && nonColors.includes(currentValue);\n const alpha = i4 ? v4 : 1 - controlPositions.c3y / offsetHeight;\n\n /* istanbul ignore else */\n if (activeElement === input || (activeElement && inputs.includes(activeElement as HTMLInputElement))) {\n if (activeElement === input) {\n if (isNonColorValue) {\n colorSource = currentValue === 'transparent' ? 'rgba(0,0,0,0)' : 'rgb(0,0,0)';\n } else {\n colorSource = currentValue;\n }\n } else if (format === 'hex') {\n colorSource = i1.value;\n } else if (format === 'hsl') {\n colorSource = {\n h: v1,\n s: v2,\n l: v3,\n a: alpha,\n };\n } else if (format === 'hwb') {\n colorSource = {\n h: v1,\n w: v2,\n b: v3,\n a: alpha,\n };\n } else {\n colorSource = {\n r: v1,\n g: v2,\n b: v3,\n a: alpha,\n };\n }\n\n const { r, g, b, a } = new Color(colorSource);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n this.setControlPositions();\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n\n // set non-color keyword\n if (activeElement === input && isNonColorValue) {\n this.value = currentValue;\n }\n }\n };\n\n /**\n * Updates `ColorPicker` first control:\n * * `lightness` and `saturation` for HEX/RGB;\n * * `lightness` and `hue` for HSL.\n *\n * @param X the X component of the offset\n * @param Y the Y component of the offset\n */\n changeControl1(X: number, Y: number): void {\n let [offsetX, offsetY] = [0, 0];\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n if (X > offsetWidth) offsetX = offsetWidth;\n else if (X >= 0) offsetX = X;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = controlPositions.c2y / offsetHeight;\n\n const saturation = offsetX / offsetWidth;\n\n const lightness = 1 - offsetY / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new positions\n this.controlPositions.c1x = offsetX;\n this.controlPositions.c1y = offsetY;\n\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` second control:\n * * `hue` for HEX/RGB/HWB;\n * * `saturation` for HSL.\n *\n * @param Y the Y offset\n */\n changeControl2(Y: number) {\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = offsetY / offsetHeight;\n const saturation = controlPositions.c1x / offsetWidth;\n const lightness = 1 - controlPositions.c1y / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new position\n this.controlPositions.c2y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` last control,\n * the `alpha` channel.\n *\n * @param Y\n */\n changeAlpha(Y: number) {\n const { visuals } = this;\n const { offsetHeight } = visuals[0];\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n // update color alpha\n const alpha = 1 - offsetY / offsetHeight;\n this.color.setAlpha(alpha);\n // update position\n this.controlPositions.c3y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` control positions on:\n * * initialization\n * * window resize\n */\n update = () => {\n this.updateDropdownPosition();\n this.updateAppearance();\n this.setControlPositions();\n this.updateInputs(true);\n this.updateControls();\n this.updateVisuals();\n };\n\n /** Updates the open dropdown position on *scroll* event. */\n updateDropdownPosition() {\n const { input, colorPicker, colorMenu } = this;\n const elRect = getBoundingClientRect(input);\n const { top, bottom } = elRect;\n const { offsetHeight: elHeight } = input;\n const windowHeight = getDocumentElement(input).clientHeight;\n const isPicker = hasClass(colorPicker, 'show');\n const dropdown = isPicker ? colorPicker : colorMenu;\n if (!dropdown) return;\n const { offsetHeight: dropHeight } = dropdown;\n const distanceBottom = windowHeight - bottom;\n const distanceTop = top;\n const bottomExceed = top + dropHeight + elHeight > windowHeight; // show\n const topExceed = top - dropHeight < 0; // show-top\n\n if ((hasClass(dropdown, 'bottom') || !topExceed) && distanceBottom < distanceTop && bottomExceed) {\n removeClass(dropdown, 'bottom');\n addClass(dropdown, 'top');\n } else {\n removeClass(dropdown, 'top');\n addClass(dropdown, 'bottom');\n }\n }\n\n /** Updates control knobs' positions. */\n setControlPositions() {\n const { visuals, color, hsv } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n const alpha = color.a;\n const hue = hsv.h;\n\n const saturation = hsv.s;\n const lightness = hsv.v;\n\n this.controlPositions.c1x = saturation * offsetWidth;\n this.controlPositions.c1y = (1 - lightness) * offsetHeight;\n this.controlPositions.c2y = hue * offsetHeight;\n this.controlPositions.c3y = (1 - alpha) * offsetHeight;\n }\n\n /** Update the visual appearance label and control knob labels. */\n updateAppearance() {\n const { componentLabels, color, parent, hsv, hex, format, controlKnobs } = this;\n const { appearanceLabel, hexLabel, valueLabel } = componentLabels;\n let { r, g, b } = color.toRgb();\n const [knob1, knob2, knob3] = controlKnobs;\n const hue = roundPart(hsv.h * 360);\n const alpha = color.a;\n const saturation = roundPart(hsv.s * 100);\n const lightness = roundPart(hsv.v * 100);\n const colorName = this.appearance;\n\n let colorLabel = `${hexLabel} ${hex.split('').join(' ')}`;\n\n if (format === 'hwb') {\n const { hwb } = this;\n const whiteness = roundPart(hwb.w * 100);\n const blackness = roundPart(hwb.b * 100);\n colorLabel = `HWB: ${hue}°, ${whiteness}%, ${blackness}%`;\n setAttribute(knob1, ariaValueText, `${whiteness}% & ${blackness}%`);\n setAttribute(knob1, ariaValueNow, `${whiteness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}%`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n } else {\n [r, g, b] = [r, g, b].map(roundPart);\n colorLabel = format === 'hsl' ? `HSL: ${hue}°, ${saturation}%, ${lightness}%` : colorLabel;\n colorLabel = format === 'rgb' ? `RGB: ${r}, ${g}, ${b}` : colorLabel;\n\n setAttribute(knob1, ariaValueText, `${lightness}% & ${saturation}%`);\n setAttribute(knob1, ariaValueNow, `${lightness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}°`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n }\n\n const alphaValue = roundPart(alpha * 100);\n setAttribute(knob3, ariaValueText, `${alphaValue}%`);\n setAttribute(knob3, ariaValueNow, `${alphaValue}`);\n\n // update the input backgroundColor\n const newColor = color.toString();\n setElementStyle(this.input, { backgroundColor: newColor });\n\n // toggle dark/light classes will also style the placeholder\n // dark sets color white, light sets color black\n // isDark ? '#000' : '#fff'\n if (!this.isDark) {\n if (hasClass(parent, 'txt-dark')) removeClass(parent, 'txt-dark');\n if (!hasClass(parent, 'txt-light')) addClass(parent, 'txt-light');\n } else {\n if (hasClass(parent, 'txt-light')) removeClass(parent, 'txt-light');\n if (!hasClass(parent, 'txt-dark')) addClass(parent, 'txt-dark');\n }\n }\n\n /** Updates the control knobs actual positions. */\n updateControls() {\n const { controlKnobs, controlPositions } = this;\n let { c1x, c1y, c2y, c3y } = controlPositions;\n const [control1, control2, control3] = controlKnobs;\n // round control positions\n [c1x, c1y, c2y, c3y] = [c1x, c1y, c2y, c3y].map(roundPart);\n\n setElementStyle(control1, {\n transform: `translate3d(${c1x - 4}px,${c1y - 4}px,0)`,\n });\n setElementStyle(control2, { transform: `translate3d(0,${c2y - 4}px,0)` });\n setElementStyle(control3, { transform: `translate3d(0,${c3y - 4}px,0)` });\n }\n\n /**\n * Updates all color form inputs.\n *\n * @param isPrevented when `true`, the component original event is prevented\n */\n updateInputs(isPrevented?: boolean) {\n const { value: oldColor, format, inputs, color, hsl } = this;\n const [i1, i2, i3, i4] = inputs;\n const alpha = roundPart(color.a * 100);\n const hue = roundPart(hsl.h * 360);\n let newColor = color.toString();\n\n /* istanbul ignore else */\n if (format === 'hex') {\n newColor = this.color.toHexString(true);\n i1.value = this.hex;\n } else if (format === 'hsl') {\n const lightness = roundPart(hsl.l * 100);\n const saturation = roundPart(hsl.s * 100);\n newColor = this.color.toHslString();\n i1.value = `${hue}`;\n i2.value = `${saturation}`;\n i3.value = `${lightness}`;\n i4.value = `${alpha}`;\n } else if (format === 'hwb') {\n const { w, b } = this.hwb;\n const whiteness = roundPart(w * 100);\n const blackness = roundPart(b * 100);\n\n newColor = this.color.toHwbString();\n i1.value = `${hue}`;\n i2.value = `${whiteness}`;\n i3.value = `${blackness}`;\n i4.value = `${alpha}`;\n } else if (format === 'rgb') {\n let { r, g, b } = this.rgb;\n [r, g, b] = [r, g, b].map(roundPart);\n\n newColor = this.color.toRgbString();\n i1.value = `${r}`;\n i2.value = `${g}`;\n i3.value = `${b}`;\n i4.value = `${alpha}`;\n }\n\n // update the color value\n this.value = newColor;\n\n // don't trigger the custom event unless it's really changed\n if (!isPrevented && newColor !== oldColor) {\n firePickerChange(this);\n }\n }\n\n /**\n * Toggle the `ColorPicker` dropdown visibility.\n *\n * @param e\n */\n togglePicker = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorPicker } = this;\n\n if (this.isOpen && hasClass(colorPicker, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorPicker);\n }\n };\n\n /** Shows the `ColorPicker` dropdown. */\n showPicker = () => {\n const { colorPicker } = this;\n\n if (!['top', 'bottom'].some(c => hasClass(colorPicker, c))) {\n showDropdown(this, colorPicker);\n }\n };\n\n /**\n * Toggles the visibility of the `ColorPicker` presets menu.\n *\n * @param e\n * @this {ColorPicker}\n */\n toggleMenu = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorMenu } = this;\n\n if (this.isOpen && hasClass(colorMenu, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorMenu);\n }\n };\n\n /**\n * Hides the currently open `ColorPicker` dropdown.\n *\n * @param {boolean=} focusPrevented\n */\n hide(focusPrevented?: boolean) {\n if (this.isOpen) {\n const { pickerToggle, menuToggle, colorPicker, colorMenu, parent, input } = this;\n const openPicker = hasClass(colorPicker, 'show');\n const openDropdown = openPicker ? colorPicker : colorMenu;\n const relatedBtn = openPicker ? pickerToggle : menuToggle;\n const animationDuration = openDropdown && getElementTransitionDuration(openDropdown);\n\n this.value = this.color.toString(true);\n\n /* istanbul ignore else */\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n setAttribute(relatedBtn, ariaExpanded, 'false');\n setTimeout(() => {\n removePosition(openDropdown);\n /* istanbul ignore else */\n if (!querySelector('.show', parent)) {\n removeClass(parent, 'open');\n toggleEventsOnShown(this);\n this.isOpen = false;\n }\n }, animationDuration);\n }\n\n if (!focusPrevented) {\n focus(pickerToggle);\n }\n setAttribute(input, tabindex, '-1');\n if (relatedBtn === menuToggle) {\n setAttribute(menuToggle, tabindex, '-1');\n }\n }\n }\n\n /** Removes `ColorPicker` from target ``. */\n dispose() {\n const { input, parent } = this;\n this.hide(true);\n toggleEvents(this);\n [...parent.children].forEach(el => {\n if (el !== input) el.remove();\n });\n\n removeAttribute(input, tabindex);\n setElementStyle(input, { backgroundColor: '' });\n\n ['txt-light', 'txt-dark'].forEach(c => removeClass(parent, c));\n Data.remove(input, colorPickerString);\n }\n}\n"],"names":["e","f","t","c","i","n","s","o","a","r","E","d","me","ge","Ee","Ae","Ne","ke","K","P","_","tt","st","rt","it","St","Nt","kt","Ct","zt","Bt","Re","Qe","je","qe","Ye","Ze","on","Rt","U","mn","jt","A","qt","S","z","x","M","Gt","Jt","Kt","Xt","Yt","kn","Dn","On","Ln","In","v","u","L","Bn","N","W","R","k","Zt","$t","Q","g","ne","Rn","V","w","oe","Qn","l","p","m","y","j","Jn","Yn","Zn","I","_n","h","T","B","H","b","ae","ie","le","Ao","ko","D","F","rr","tr","O","er","$","Z","J","G","X","C","Y","q","sr","ColorPalette","Color","args","hue","hueSteps","lightSteps","lightnessArray","saturation","colors","hueStep","half","steps1To13","lightSets","closestSet","set","lightStep","currentHue","newColor","colorPickerLabels","colorNames","isValidJSON","str","isString","vHidden","getColorForm","self","format","id","componentLabels","colorForm","createElement","components","toUpperCase","cID","formatLabel","cInputLabel","setAttribute","cInput","max","step","ObjectAssign","getColorControls","hueLabel","alphaLabel","lightnessLabel","saturationLabel","whitenessLabel","blacknessLabel","max1","max2","max3","ctrl1Label","ctrl2Label","colorControls","colorPointer","colorSlider","template","min","control","knob","getColorMenu","colorsSource","menuClass","input","defaultsLabel","presetsLabel","isOptionsMenu","isPalette","menuLabel","colorsArray","colorsCount","fit","isMultiLine","rowCountHover","rowCount","isScrollable","finalClass","gap","optionSize","menuHeight","menuHeightHover","menu","setElementStyle","value","label","isActive","getAttribute","option","setMarkup","parent","colorKeywords","colorPresets","colorValue","nonColors","toggleLabel","pickerLabel","hexLabel","color","formatString","pickerBtn","pickerDropdown","presetsDropdown","presetsBtn","xmlns","presetsIcon","createElementNS","ariaHidden","path","tabindex","colorPickerString","colorPickerSelector","colorPickerParentSelector","colorPickerDefaults","roundPart","getColorPickerInstance","element","getInstance","initColorPicker","ColorPicker","toggleEvents","action","fn","addListener","removeListener","pickerToggle","menuToggle","focusinEvent","mouseclickEvent","toggleEventsOnShown","colorMenu","doc","getDocument","win","getWindow","pointerdownEvent","keydownEvent","scrollEvent","resizeEvent","changeEvent","pointermoveEvent","pointerupEvent","focusoutEvent","keyupEvent","firePickerChange","dispatchEvent","removePosition","removeClass","showDropdown","dropdown","colorPicker","isPicker","openDropdown","activeBtn","nextBtn","hasClass","addClass","reflow","ariaExpanded","getBoundingClientRect","version","ObjectFromEntries","target","config","querySelector","closest","getUID","colorLabels","normalizeOptions","translatedColorLabels","isArray","tempComponentLabels","getElementsByClassName","controls","Data","brightness","inputValue","hsl","hsv","saturationSource","lightness","hsvl","colorName","isGold","isOlive","controlPositions","visuals","v1","v2","v3","offsetHeight","whiteGrad","alpha","roundA","fill","hueGradient","relatedTarget","code","keyEscape","activeElement","touchmoveEvent","previousElementSibling","nextElementSibling","parentElement","isColorOptionsMenu","allSiblings","columnsCount","getElementStyle","currentIndex","previousElement","nextElement","keyArrowDown","keyArrowUp","keySpace","focus","keyArrowLeft","keyArrowRight","keyEnter","newOption","currentActive","removeAttribute","ariaSelected","pageX","pageY","controlKnobs","c1","c2","c3","visual","visualRect","html","getDocumentElement","offsetX","offsetY","currentOpen","selection","dragElement","controlRect","offsetWidth","currentKnob","yRatio","xRatio","colorSource","inputs","currentValue","i1","i4","v4","isNonColorValue","elRect","top","bottom","elHeight","windowHeight","dropHeight","distanceBottom","distanceTop","bottomExceed","topExceed","hex","appearanceLabel","valueLabel","knob1","knob2","knob3","colorLabel","hwb","whiteness","blackness","ariaValueText","ariaValueNow","ariaDescription","alphaValue","c1x","c1y","c2y","c3y","control1","control2","control3","isPrevented","oldColor","i2","i3","focusPrevented","openPicker","relatedBtn","animationDuration","getElementTransitionDuration","el"],"mappings":"aAAK,MAACA,EAAI,CAAE,EAAEC,GAAKC,GAAM,CACvB,KAAM,CAAE,KAAMC,EAAG,cAAeC,CAAC,EAAKF,EACtC,CAAC,GAAGF,EAAEG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAACE,EAAGC,CAAC,IAAM,CAC5BF,IAAMC,GAAK,CAAC,GAAGC,CAAC,EAAE,QAAQ,CAAC,CAACC,EAAGC,CAAC,IAAM,CACpCD,EAAE,MAAMF,EAAG,CAACH,CAAC,CAAC,EAAG,OAAOM,GAAK,UAAYA,EAAE,MAAQC,GAAEJ,EAAGF,EAAGI,EAAGC,CAAC,CACrE,CAAK,CACL,CAAG,CACH,EAAGE,GAAI,CAACR,EAAGC,EAAGC,EAAGC,IAAM,CACrBL,EAAEG,CAAC,IAAMH,EAAEG,CAAC,EAAoB,IAAI,KACpC,MAAMG,EAAIN,EAAEG,CAAC,EACbG,EAAE,IAAIJ,CAAC,GAAKI,EAAE,IAAIJ,EAAmB,IAAI,GAAK,EAC9C,MAAMK,EAAID,EAAE,IAAIJ,CAAC,EAAG,CAAE,KAAMM,CAAG,EAAGD,EAClCA,EAAE,IAAIH,EAAGC,CAAC,EAAGG,GAAKN,EAAE,iBAAiBC,EAAGF,GAAGI,CAAC,CAC9C,EAAGI,GAAI,CAACP,EAAGC,EAAGC,EAAGC,IAAM,CACrB,MAAMC,EAAIN,EAAEG,CAAC,EAAGI,EAAID,GAAKA,EAAE,IAAIJ,CAAC,EAAGM,EAAID,GAAKA,EAAE,IAAIH,CAAC,EAAGO,EAAIH,IAAM,OAASA,EAAIH,EAC7EE,GAAKA,EAAE,IAAIH,CAAC,GAAKG,EAAE,OAAOH,CAAC,E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,MAAM,EAAI,KAAK,MAAM,CAAC,EACtB,OAAO,EAAI,EAAI,GAAM,EAAI,KAAK,MAAM,CAAC,CACvC,EAAGH,GAAI,CACL,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,GACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,uBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,mBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,oBACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,CACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,MACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,MACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,E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c,WAAAC,EAAY,YAAAwB,EAAa,UAAApB,EAAW,OAAAxC,EAAQ,MAAA1B,CAAU,EAAA,KACtE6N,EAAalI,EAASL,EAAa,MAAM,EACzCE,EAAeqI,EAAavI,EAAcpB,EAC1C4J,EAAaD,EAAahK,EAAeC,EACzCiK,EAAoBvI,GAAgBwI,GAA6BxI,CAAY,EAEnF,KAAK,MAAQ,KAAK,MAAM,SAAS,EAAI,EAGjCA,IACFL,EAAYK,EAAc,MAAM,EACnBnH,EAAAyP,EAAYhI,GAAc,OAAO,EAC9C,WAAW,IAAM,CACfZ,GAAeM,CAAY,EAEtBY,EAAc,QAAS1E,CAAM,IAChCyD,EAAYzD,EAAQ,MAAM,EAC1BuC,GAAoB,IAAI,EACxB,KAAK,OAAS,KAEf8J,CAAiB,GAGjBH,GACHtE,EAAMzF,CAAY,EAEPxF,EAAA2B,EAAO6C,EAAU,IAAI,EAC9BiL,IAAehK,GACJzF,EAAAyF,EAAYjB,EAAU,IAAI,CAE3C,CACF,CAGA,SAAU,CACF,KAAA,CAAE,MAAA7C,EAAO,OAAA0B,CAAW,EAAA,KAC1B,KAAK,KAAK,EAAI,EACd8B,GAAa,IAAI,EACjB,CAAC,GAAG9B,EAAO,QAAQ,EAAE,QAAcuM,GAAA,CAC7BA,IAAOjO,GAAOiO,EAAG,OAAO,CAAA,CAC7B,EAEDrE,GAAgB5J,EAAO6C,CAAQ,EAC/B1B,EAAgBnB,EAAO,CAAE,gBAAiB,EAAI,CAAA,EAE7C,CAAA,YAAa,UAAU,EAAE,WAAamF,EAAYzD,EAAQrM,CAAC,CAAC,EACxDyR,GAAA,OAAO9G,EAAO8C,CAAiB,CACtC,CACF","x_google_ignoreList":[0,1,2]} \ No newline at end of file +{"version":3,"file":"color-picker.cjs","sources":["../../node_modules/.pnpm/@thednp+shorty@2.0.0-alpha21/node_modules/@thednp/shorty/dist/shorty.mjs","../../node_modules/.pnpm/@thednp+color@1.0.8/node_modules/@thednp/color/dist/index.mjs","../../src/ts/colorPalette.ts","../../src/ts/util/colorPickerLabels.ts","../../src/ts/util/colorNames.ts","../../src/ts/util/isValidJSON.ts","../../src/ts/util/vHidden.ts","../../src/ts/util/getColorForm.ts","../../src/ts/util/getColorControls.ts","../../src/ts/util/getColorMenu.ts","../../src/ts/util/setMarkup.ts","../../src/ts/index.ts"],"sourcesContent":["const pe = \"aria-checked\", me = \"aria-description\", fe = \"aria-describedby\", ge = \"aria-expanded\", ve = \"aria-haspopup\", Ee = \"aria-hidden\", be = \"aria-label\", he = \"aria-labelledby\", ye = \"aria-modal\", we = \"aria-pressed\", Ae = \"aria-selected\", Se = \"aria-valuemin\", Ne = \"aria-valuemax\", ke = \"aria-valuenow\", Me = \"aria-valuetext\", q = \"abort\", G = \"beforeunload\", J = \"blur\", K = \"change\", X = \"contextmenu\", P = \"DOMContentLoaded\", Y = \"DOMMouseScroll\", Z = \"error\", $ = \"focus\", _ = \"focusin\", tt = \"focusout\", et = \"gesturechange\", nt = \"gestureend\", ot = \"gesturestart\", st = \"keydown\", ct = \"keypress\", rt = \"keyup\", at = \"load\", it = \"click\", ut = \"dblclick\", lt = \"mousedown\", dt = \"mouseup\", pt = \"hover\", mt = \"mouseenter\", ft = \"mouseleave\", gt = \"mousein\", vt = \"mouseout\", Et = \"mouseover\", bt = \"mousemove\", ht = \"mousewheel\", yt = \"move\", wt = \"orientationchange\", At = \"pointercancel\", St = \"pointerdown\", Nt = \"pointerleave\", kt = \"pointermove\", Mt = \"pointerup\", Tt = \"readystatechange\", Dt = \"reset\", Ct = \"resize\", Ot = \"select\", Lt = \"selectend\", It = \"selectstart\", zt = \"scroll\", xt = \"submit\", Vt = \"touchstart\", Bt = \"touchmove\", Ht = \"touchcancel\", Pt = \"touchend\", Ft = \"unload\", Te = {\n DOMContentLoaded: P,\n DOMMouseScroll: Y,\n abort: q,\n beforeunload: G,\n blur: J,\n change: K,\n click: it,\n contextmenu: X,\n dblclick: ut,\n error: Z,\n focus: $,\n focusin: _,\n focusout: tt,\n gesturechange: et,\n gestureend: nt,\n gesturestart: ot,\n hover: pt,\n keydown: st,\n keypress: ct,\n keyup: rt,\n load: at,\n mousedown: lt,\n mousemove: bt,\n mousein: gt,\n mouseout: vt,\n mouseenter: mt,\n mouseleave: ft,\n mouseover: Et,\n mouseup: dt,\n mousewheel: ht,\n move: yt,\n orientationchange: wt,\n pointercancel: At,\n pointerdown: St,\n pointerleave: Nt,\n pointermove: kt,\n pointerup: Mt,\n readystatechange: Tt,\n reset: Dt,\n resize: Ct,\n scroll: zt,\n select: Ot,\n selectend: Lt,\n selectstart: It,\n submit: xt,\n touchcancel: Ht,\n touchend: Pt,\n touchmove: Bt,\n touchstart: Vt,\n unload: Ft\n}, De = \"drag\", Ce = \"dragstart\", Oe = \"dragenter\", Le = \"dragleave\", Ie = \"dragover\", ze = \"dragend\", xe = \"loadstart\", Ve = {\n start: \"mousedown\",\n end: \"mouseup\",\n move: \"mousemove\",\n cancel: \"mouseleave\"\n}, Be = { down: \"mousedown\", up: \"mouseup\" }, He = \"onmouseleave\" in document ? [\"mouseenter\", \"mouseleave\"] : (\n /* istanbul ignore next */\n [\"mouseover\", \"mouseout\"]\n), Pe = {\n start: \"touchstart\",\n end: \"touchend\",\n move: \"touchmove\",\n cancel: \"touchcancel\"\n}, Fe = { in: \"focusin\", out: \"focusout\" }, Ue = {\n Backspace: \"Backspace\",\n // 8\n Tab: \"Tab\",\n // 9\n Enter: \"Enter\",\n // 13\n Shift: \"Shift\",\n // 16\n Control: \"Control\",\n // 17\n Alt: \"Alt\",\n // 18\n Pause: \"Pause\",\n // 19\n CapsLock: \"CapsLock\",\n // 20\n Escape: \"Escape\",\n // 27\n Scape: \"Space\",\n // 32\n ArrowLeft: \"ArrowLeft\",\n // 37\n ArrowUp: \"ArrowUp\",\n // 38\n ArrowRight: \"ArrowRight\",\n // 39\n ArrowDown: \"ArrowDown\",\n // 40\n Insert: \"Insert\",\n // 45\n Delete: \"Delete\",\n // 46\n Meta: \"Meta\",\n // 91 windows key\n ContextMenu: \"ContextMenu\",\n // 93\n ScrollLock: \"ScrollLock\"\n // 145\n}, We = \"Alt\", Re = \"ArrowDown\", Qe = \"ArrowUp\", je = \"ArrowLeft\", qe = \"ArrowRight\", Ge = \"Backspace\", Je = \"CapsLock\", Ke = \"Control\", Xe = \"Delete\", Ye = \"Enter\", Ze = \"NumpadEnter\", $e = \"Escape\", _e = \"Insert\", tn = \"Meta\", en = \"Pause\", nn = \"ScrollLock\", on = \"Shift\", sn = \"Space\", cn = \"Tab\", Ut = \"animationDuration\", Wt = \"animationDelay\", F = \"animationName\", D = \"animationend\", Rt = \"transitionDuration\", Qt = \"transitionDelay\", C = \"transitionend\", U = \"transitionProperty\", rn = \"addEventListener\", an = \"removeEventListener\", un = {\n linear: \"linear\",\n easingSinusoidalIn: \"cubic-bezier(0.47,0,0.745,0.715)\",\n easingSinusoidalOut: \"cubic-bezier(0.39,0.575,0.565,1)\",\n easingSinusoidalInOut: \"cubic-bezier(0.445,0.05,0.55,0.95)\",\n easingQuadraticIn: \"cubic-bezier(0.550,0.085,0.680,0.530)\",\n easingQuadraticOut: \"cubic-bezier(0.250,0.460,0.450,0.940)\",\n easingQuadraticInOut: \"cubic-bezier(0.455,0.030,0.515,0.955)\",\n easingCubicIn: \"cubic-bezier(0.55,0.055,0.675,0.19)\",\n easingCubicOut: \"cubic-bezier(0.215,0.61,0.355,1)\",\n easingCubicInOut: \"cubic-bezier(0.645,0.045,0.355,1)\",\n easingQuarticIn: \"cubic-bezier(0.895,0.03,0.685,0.22)\",\n easingQuarticOut: \"cubic-bezier(0.165,0.84,0.44,1)\",\n easingQuarticInOut: \"cubic-bezier(0.77,0,0.175,1)\",\n easingQuinticIn: \"cubic-bezier(0.755,0.05,0.855,0.06)\",\n easingQuinticOut: \"cubic-bezier(0.23,1,0.32,1)\",\n easingQuinticInOut: \"cubic-bezier(0.86,0,0.07,1)\",\n easingExponentialIn: \"cubic-bezier(0.95,0.05,0.795,0.035)\",\n easingExponentialOut: \"cubic-bezier(0.19,1,0.22,1)\",\n easingExponentialInOut: \"cubic-bezier(1,0,0,1)\",\n easingCircularIn: \"cubic-bezier(0.6,0.04,0.98,0.335)\",\n easingCircularOut: \"cubic-bezier(0.075,0.82,0.165,1)\",\n easingCircularInOut: \"cubic-bezier(0.785,0.135,0.15,0.86)\",\n easingBackIn: \"cubic-bezier(0.6,-0.28,0.735,0.045)\",\n easingBackOut: \"cubic-bezier(0.175,0.885,0.32,1.275)\",\n easingBackInOut: \"cubic-bezier(0.68,-0.55,0.265,1.55)\"\n}, ln = \"offsetHeight\", dn = \"offsetWidth\", pn = \"scrollHeight\", mn = \"scrollWidth\", fn = \"tabindex\", jt = navigator.userAgentData, A = jt, { userAgent: qt } = navigator, S = qt, z = /iPhone|iPad|iPod|Android/i;\nlet O = !1;\nA ? O = A.brands.some((t) => z.test(t.brand)) : O = z.test(S);\nconst gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.brand)) : (\n /* istanbul ignore next */\n x.test(S)\n), En = S ? S.includes(\"Firefox\") : (\n /* istanbul ignore next */\n !1\n), { head: N } = document, bn = [\"webkitPerspective\", \"perspective\"].some((t) => t in N.style), Gt = (t, e, n, o) => {\n const s = o || !1;\n t.addEventListener(e, n, s);\n}, Jt = (t, e, n, o) => {\n const s = o || !1;\n t.removeEventListener(e, n, s);\n}, Kt = (t, e, n, o) => {\n const s = (r) => {\n (r.target === t || r.currentTarget === t) && (n.apply(t, [r]), Jt(t, e, s, o));\n };\n Gt(t, e, s, o);\n}, Xt = () => {\n}, hn = (() => {\n let t = !1;\n try {\n const e = Object.defineProperty({}, \"passive\", {\n get: () => (t = !0, t)\n });\n Kt(document, P, Xt, e);\n } catch {\n }\n return t;\n})(), yn = [\"webkitTransform\", \"transform\"].some((t) => t in N.style), wn = \"ontouchstart\" in window || /* istanbul ignore next */\n\"msMaxTouchPoints\" in navigator, An = [\"webkitAnimation\", \"animation\"].some((t) => t in N.style), Sn = [\"webkitTransition\", \"transition\"].some((t) => t in N.style), Yt = (t, e) => t.getAttribute(e), Nn = (t, e, n) => e.getAttributeNS(t, n), kn = (t, e) => t.hasAttribute(e), Mn = (t, e, n) => e.hasAttributeNS(t, n), Tn = (t, e, n) => t.setAttribute(e, n), Dn = (t, e, n, o) => e.setAttributeNS(t, n, o), Cn = (t, e) => t.removeAttribute(e), On = (t, e, n) => e.removeAttributeNS(t, n), Ln = (t, ...e) => {\n t.classList.add(...e);\n}, In = (t, ...e) => {\n t.classList.remove(...e);\n}, zn = (t, e) => t.classList.contains(e), { body: xn } = document, { documentElement: Vn } = document, Bn = (t) => Array.from(t), v = (t) => t != null && typeof t == \"object\" || !1, i = (t) => v(t) && typeof t.nodeType == \"number\" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some((e) => t.nodeType === e) || !1, u = (t) => i(t) && t.nodeType === 1 || !1, E = /* @__PURE__ */ new Map(), L = {\n data: E,\n /**\n * Sets web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @param instance the component instance\n */\n set: (t, e, n) => {\n if (!u(t))\n return;\n E.has(e) || E.set(e, /* @__PURE__ */ new Map()), E.get(e).set(t, n);\n },\n /**\n * Returns all instances for specified component.\n *\n * @param component the component's name or a unique key\n * @returns all the component instances\n */\n getAllFor: (t) => E.get(t) || null,\n /**\n * Returns the instance associated with the target.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @returns the instance\n */\n get: (t, e) => {\n if (!u(t) || !e)\n return null;\n const n = L.getAllFor(e);\n return t && n && n.get(t) || null;\n },\n /**\n * Removes web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n */\n remove: (t, e) => {\n const n = L.getAllFor(e);\n !n || !u(t) || (n.delete(t), n.size === 0 && E.delete(e));\n }\n}, Hn = (t, e) => L.get(t, e), k = (t) => typeof t == \"string\" || !1, W = (t) => v(t) && t.constructor.name === \"Window\" || !1, R = (t) => i(t) && t.nodeType === 9 || !1, d = (t) => W(t) ? t.document : R(t) ? t : i(t) ? t.ownerDocument : window.document, M = (t, ...e) => Object.assign(t, ...e), Zt = (t) => {\n if (!t)\n return;\n if (k(t))\n return d().createElement(t);\n const { tagName: e } = t, n = Zt(e);\n if (!n)\n return;\n const o = { ...t };\n return delete o.tagName, M(n, o);\n}, $t = (t, e) => {\n if (!t || !e)\n return;\n if (k(e))\n return d().createElementNS(t, e);\n const { tagName: n } = e, o = $t(t, n);\n if (!o)\n return;\n const s = { ...e };\n return delete s.tagName, M(o, s);\n}, Q = (t, e) => t.dispatchEvent(e), Pn = (t, e, n) => n.indexOf(t) === e, g = (t, e) => {\n const n = getComputedStyle(t), o = e.replace(\"webkit\", \"Webkit\").replace(/([A-Z])/g, \"-$1\").toLowerCase();\n return n.getPropertyValue(o);\n}, _t = (t) => {\n const e = g(t, F), n = g(t, Wt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, te = (t) => {\n const e = g(t, F), n = g(t, Ut), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Fn = (t, e) => {\n let n = 0;\n const o = new Event(D), s = te(t), r = _t(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(D, a), n = 1);\n };\n t.addEventListener(D, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, ee = (t) => {\n const e = g(t, U), n = g(t, Qt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, ne = (t) => {\n const e = g(t, U), n = g(t, Rt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Un = (t, e) => {\n let n = 0;\n const o = new Event(C), s = ne(t), r = ee(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(C, a), n = 1);\n };\n t.addEventListener(C, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, Wn = (t) => Float32Array.from(Array.from(t)), Rn = (t) => Float64Array.from(Array.from(t)), Qn = (t, e) => t.focus(e), V = (t) => [\"true\", !0].includes(t) ? !0 : [\"false\", !1].includes(t) ? !1 : [\"null\", \"\", null, void 0].includes(t) ? null : t !== \"\" && !Number.isNaN(+t) ? +t : t, w = (t) => Object.entries(t), oe = (t) => t.toLowerCase(), jn = (t, e, n, o) => {\n const s = { ...n }, r = { ...t.dataset }, a = { ...e }, l = {}, p = \"title\";\n return w(r).forEach(([c, m]) => {\n const y = o && typeof c == \"string\" && c.includes(o) ? c.replace(o, \"\").replace(/[A-Z]/g, (j) => oe(j)) : c;\n l[y] = V(m);\n }), w(s).forEach(([c, m]) => {\n s[c] = V(m);\n }), w(e).forEach(([c, m]) => {\n c in s ? a[c] = s[c] : c in l ? a[c] = l[c] : a[c] = c === p ? Yt(t, p) : m;\n }), a;\n}, qn = (t, e) => v(t) && (Object.hasOwn(t, e) || e in t), Gn = (t) => Object.keys(t), Jn = (t) => Object.values(t), Kn = (t) => Object.fromEntries(t), Xn = (t, e) => {\n const n = new CustomEvent(t, {\n cancelable: !0,\n bubbles: !0\n });\n return v(e) && M(n, e), n;\n}, Yn = { passive: !0 }, Zn = (t) => t.offsetHeight, $n = (t, e) => {\n w(e).forEach(([n, o]) => {\n if (o && k(n) && n.includes(\"--\"))\n t.style.setProperty(n, o);\n else {\n const s = {};\n s[n] = o, M(t.style, s);\n }\n });\n}, I = (t) => v(t) && t.constructor.name === \"Map\" || !1, se = (t) => typeof t == \"number\" || !1, f = /* @__PURE__ */ new Map(), _n = {\n /**\n * Sets a new timeout timer for an element, or element -> key association.\n *\n * @param element target element\n * @param callback the callback\n * @param delay the execution delay\n * @param key a unique key\n */\n set: (t, e, n, o) => {\n u(t) && (o && o.length ? (f.has(t) || f.set(t, /* @__PURE__ */ new Map()), f.get(t).set(o, setTimeout(e, n))) : f.set(t, setTimeout(e, n)));\n },\n /**\n * Returns the timer associated with the target.\n *\n * @param element target element\n * @param key a unique\n * @returns the timer\n */\n get: (t, e) => {\n if (!u(t))\n return null;\n const n = f.get(t);\n return e && n && I(n) ? n.get(e) || /* istanbul ignore next */\n null : se(n) ? n : null;\n },\n /**\n * Clears the element's timer.\n *\n * @param element target element\n * @param key a unique key\n */\n clear: (t, e) => {\n if (!u(t))\n return;\n const n = f.get(t);\n e && e.length && I(n) ? (clearTimeout(n.get(e)), n.delete(e), n.size === 0 && f.delete(t)) : (clearTimeout(n), f.delete(t));\n }\n}, to = (t) => t.toUpperCase(), h = (t, e) => {\n const { width: n, height: o, top: s, right: r, bottom: a, left: l } = t.getBoundingClientRect();\n let p = 1, c = 1;\n if (e && u(t)) {\n const { offsetWidth: m, offsetHeight: y } = t;\n p = m > 0 ? Math.round(n) / m : (\n /* istanbul ignore next */\n 1\n ), c = y > 0 ? Math.round(o) / y : (\n /* istanbul ignore next */\n 1\n );\n }\n return {\n width: n / p,\n height: o / c,\n top: s / c,\n right: r / p,\n bottom: a / c,\n left: l / p,\n x: l / p,\n y: s / c\n };\n}, eo = (t) => d(t).body, T = (t) => d(t).documentElement, no = (t) => d(t).head, oo = (t) => {\n const e = W(t), n = e ? t.scrollX : t.scrollLeft, o = e ? t.scrollY : t.scrollTop;\n return { x: n, y: o };\n}, ce = (t) => i(t) && t.constructor.name === \"ShadowRoot\" || !1, so = (t) => t.nodeName === \"HTML\" ? t : u(t) && t.assignedSlot || // step into the shadow DOM of the parent of a slotted node\ni(t) && t.parentNode || // DOM Element detected\nce(t) && t.host || // ShadowRoot detected\nT(t), re = (t) => {\n if (!u(t))\n return !1;\n const { width: e, height: n } = h(t), { offsetWidth: o, offsetHeight: s } = t;\n return Math.round(e) !== o || Math.round(n) !== s;\n}, co = (t, e, n) => {\n const o = u(e), s = h(t, o && re(e)), r = { x: 0, y: 0 };\n if (o) {\n const a = h(e, !0);\n r.x = a.x + e.clientLeft, r.y = a.y + e.clientTop;\n }\n return {\n x: s.left + n.x - r.x,\n y: s.top + n.y - r.y,\n width: s.width,\n height: s.height\n };\n};\nlet B = 0, H = 0;\nconst b = /* @__PURE__ */ new Map(), ae = (t, e) => {\n let n = e ? B : H;\n if (e) {\n const o = ae(t), s = b.get(o) || /* @__PURE__ */ new Map();\n b.has(o) || b.set(o, s), I(s) && !s.has(e) ? (s.set(e, n), B += 1) : n = s.get(e);\n } else {\n const o = t.id || t;\n b.has(o) ? n = b.get(o) : (b.set(o, n), H += 1);\n }\n return n;\n}, ro = (t) => {\n var e;\n return t ? R(t) ? t.defaultView : i(t) ? (e = t == null ? void 0 : t.ownerDocument) == null ? void 0 : e.defaultView : t : window;\n}, ie = (t) => Array.isArray(t) || !1, ao = (t) => i(t) && t.nodeName === \"CANVAS\" || !1, ue = (t) => u(t) && !!t.shadowRoot || !1, io = (t) => i(t) && [1, 2, 3, 4, 5, 6, 7, 8].some((e) => t.nodeType === e) || !1, uo = (t) => {\n if (!i(t))\n return !1;\n const { top: e, bottom: n } = h(t), { clientHeight: o } = T(t);\n return e <= o && n >= 0;\n}, lo = (t) => {\n if (!i(t))\n return !1;\n const { clientWidth: e, clientHeight: n } = T(t), { top: o, left: s, bottom: r, right: a } = h(t, !0);\n return o >= 0 && s >= 0 && r <= n && a <= e;\n}, po = (t) => ie(t) && t.every(u) || !1, mo = (t) => typeof t == \"function\" || !1, fo = (t) => v(t) && t.constructor.name === \"HTMLCollection\" || !1, go = (t) => u(t) && t.tagName === \"IMG\" || !1, vo = (t) => {\n if (!k(t))\n return !1;\n try {\n JSON.parse(t);\n } catch {\n return !1;\n }\n return !0;\n}, Eo = (t) => v(t) && t.constructor.name === \"WeakMap\" || !1, bo = (t) => i(t) && [\"SVG\", \"Image\", \"Video\", \"Canvas\"].some((e) => t.constructor.name.includes(e)) || !1, ho = (t) => v(t) && t.constructor.name === \"NodeList\" || !1, yo = (t) => T(t).dir === \"rtl\", wo = (t) => i(t) && t.constructor.name.includes(\"SVG\") || !1, Ao = (t) => i(t) && [\"TABLE\", \"TD\", \"TH\"].includes(t.nodeName) || !1, le = (t, e) => t ? t.closest(e) || // break out of `ShadowRoot`\nle(t.getRootNode().host, e) : null, So = (t, e) => u(t) ? t : (i(e) ? e : d()).querySelector(t), de = (t, e) => (i(e) ? e : d()).getElementsByTagName(t), No = (t) => [...de(\"*\", t)].filter(ue), ko = (t, e) => d(e).getElementById(t) || null, Mo = (t, e) => (i(e) ? e : d()).querySelectorAll(t), To = (t, e) => (e && i(e) ? e : d()).getElementsByClassName(\n t\n), Do = (t, e) => t.matches(e), Co = \"2.0.0alpha21\";\nexport {\n Bn as ArrayFrom,\n P as DOMContentLoadedEvent,\n Y as DOMMouseScrollEvent,\n L as Data,\n Wn as Float32ArrayFrom,\n Rn as Float64ArrayFrom,\n M as ObjectAssign,\n w as ObjectEntries,\n Kn as ObjectFromEntries,\n qn as ObjectHasOwn,\n Gn as ObjectKeys,\n Jn as ObjectValues,\n _n as Timer,\n q as abortEvent,\n Ln as addClass,\n rn as addEventListener,\n Wt as animationDelay,\n Ut as animationDuration,\n D as animationEndEvent,\n F as animationName,\n pe as ariaChecked,\n fe as ariaDescribedBy,\n me as ariaDescription,\n ge as ariaExpanded,\n ve as ariaHasPopup,\n Ee as ariaHidden,\n be as ariaLabel,\n he as ariaLabelledBy,\n ye as ariaModal,\n we as ariaPressed,\n Ae as ariaSelected,\n Ne as ariaValueMax,\n Se as ariaValueMin,\n ke as ariaValueNow,\n Me as ariaValueText,\n G as beforeunloadEvent,\n un as bezierEasings,\n J as blurEvent,\n K as changeEvent,\n le as closest,\n X as contextmenuEvent,\n Xn as createCustomEvent,\n Zt as createElement,\n $t as createElementNS,\n Q as dispatchEvent,\n Pn as distinct,\n xn as documentBody,\n Vn as documentElement,\n N as documentHead,\n De as dragEvent,\n ze as dragendEvent,\n Oe as dragenterEvent,\n Le as dragleaveEvent,\n Ie as dragoverEvent,\n Ce as dragstartEvent,\n Fn as emulateAnimationEnd,\n Un as emulateTransitionEnd,\n Z as errorEvent,\n Qn as focus,\n $ as focusEvent,\n Fe as focusEvents,\n _ as focusinEvent,\n tt as focusoutEvent,\n et as gesturechangeEvent,\n nt as gestureendEvent,\n ot as gesturestartEvent,\n Yt as getAttribute,\n Nn as getAttributeNS,\n h as getBoundingClientRect,\n No as getCustomElements,\n d as getDocument,\n eo as getDocumentBody,\n T as getDocumentElement,\n no as getDocumentHead,\n _t as getElementAnimationDelay,\n te as getElementAnimationDuration,\n ko as getElementById,\n g as getElementStyle,\n ee as getElementTransitionDelay,\n ne as getElementTransitionDuration,\n To as getElementsByClassName,\n de as getElementsByTagName,\n Hn as getInstance,\n oo as getNodeScroll,\n so as getParentNode,\n co as getRectRelativeToOffsetParent,\n ae as getUID,\n ro as getWindow,\n kn as hasAttribute,\n Mn as hasAttributeNS,\n zn as hasClass,\n vn as isApple,\n ie as isArray,\n ao as isCanvas,\n ue as isCustomElement,\n R as isDocument,\n io as isElement,\n uo as isElementInScrollRange,\n lo as isElementInViewport,\n po as isElementsArray,\n En as isFirefox,\n mo as isFunction,\n fo as isHTMLCollection,\n u as isHTMLElement,\n go as isHTMLImageElement,\n vo as isJSON,\n I as isMap,\n bo as isMedia,\n gn as isMobile,\n i as isNode,\n ho as isNodeList,\n se as isNumber,\n v as isObject,\n yo as isRTL,\n wo as isSVGElement,\n re as isScaledElement,\n ce as isShadowRoot,\n k as isString,\n Ao as isTableElement,\n Eo as isWeakMap,\n W as isWindow,\n We as keyAlt,\n Re as keyArrowDown,\n je as keyArrowLeft,\n qe as keyArrowRight,\n Qe as keyArrowUp,\n Ge as keyBackspace,\n Je as keyCapsLock,\n Ke as keyControl,\n Xe as keyDelete,\n Ye as keyEnter,\n $e as keyEscape,\n _e as keyInsert,\n tn as keyMeta,\n Ze as keyNumpadEnter,\n en as keyPause,\n nn as keyScrollLock,\n on as keyShift,\n sn as keySpace,\n cn as keyTab,\n Ue as keyboardEventKeys,\n st as keydownEvent,\n ct as keypressEvent,\n rt as keyupEvent,\n at as loadEvent,\n xe as loadstartEvent,\n Do as matches,\n Be as mouseClickEvents,\n He as mouseHoverEvents,\n Ve as mouseSwipeEvents,\n it as mouseclickEvent,\n ut as mousedblclickEvent,\n lt as mousedownEvent,\n mt as mouseenterEvent,\n pt as mousehoverEvent,\n gt as mouseinEvent,\n ft as mouseleaveEvent,\n bt as mousemoveEvent,\n vt as mouseoutEvent,\n Et as mouseoverEvent,\n dt as mouseupEvent,\n ht as mousewheelEvent,\n yt as moveEvent,\n Te as nativeEvents,\n Xt as noop,\n jn as normalizeOptions,\n V as normalizeValue,\n Jt as off,\n ln as offsetHeight,\n dn as offsetWidth,\n Gt as on,\n Kt as one,\n wt as orientationchangeEvent,\n Yn as passiveHandler,\n At as pointercancelEvent,\n St as pointerdownEvent,\n Nt as pointerleaveEvent,\n kt as pointermoveEvent,\n Mt as pointerupEvent,\n So as querySelector,\n Mo as querySelectorAll,\n Tt as readystatechangeEvent,\n Zn as reflow,\n Cn as removeAttribute,\n On as removeAttributeNS,\n In as removeClass,\n an as removeEventListener,\n Dt as resetEvent,\n Ct as resizeEvent,\n zt as scrollEvent,\n pn as scrollHeight,\n mn as scrollWidth,\n Ot as selectEvent,\n Lt as selectendEvent,\n It as selectstartEvent,\n Tn as setAttribute,\n Dn as setAttributeNS,\n $n as setElementStyle,\n xt as submitEvent,\n bn as support3DTransform,\n An as supportAnimation,\n hn as supportPassive,\n wn as supportTouch,\n yn as supportTransform,\n Sn as supportTransition,\n fn as tabindex,\n oe as toLowerCase,\n to as toUpperCase,\n Pe as touchEvents,\n Ht as touchcancelEvent,\n Pt as touchendEvent,\n Bt as touchmoveEvent,\n Vt as touchstartEvent,\n Qt as transitionDelay,\n Rt as transitionDuration,\n C as transitionEndEvent,\n U as transitionProperty,\n Ft as unloadEvent,\n S as userAgent,\n A as userAgentData,\n Co as version\n};\n//# sourceMappingURL=shorty.mjs.map\n","const N = [\"transparent\", \"currentColor\", \"inherit\", \"revert\", \"initial\"], b = (o) => {\n const t = Math.floor(o);\n return o - t < 0.5 ? t : Math.round(o);\n}, T = [\n [\n \"aliceblue\",\n {\n r: 240,\n g: 248,\n b: 255\n }\n ],\n [\n \"antiquewhite\",\n {\n r: 250,\n g: 235,\n b: 215\n }\n ],\n [\n \"aqua\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"aquamarine\",\n {\n r: 127,\n g: 255,\n b: 212\n }\n ],\n [\n \"azure\",\n {\n r: 240,\n g: 255,\n b: 255\n }\n ],\n [\n \"beige\",\n {\n r: 245,\n g: 245,\n b: 220\n }\n ],\n [\n \"bisque\",\n {\n r: 255,\n g: 228,\n b: 196\n }\n ],\n [\n \"black\",\n {\n r: 0,\n g: 0,\n b: 0\n }\n ],\n [\n \"blanchedalmond\",\n {\n r: 255,\n g: 235,\n b: 205\n }\n ],\n [\n \"blue\",\n {\n r: 0,\n g: 0,\n b: 255\n }\n ],\n [\n \"blueviolet\",\n {\n r: 138,\n g: 43,\n b: 226\n }\n ],\n [\n \"brown\",\n {\n r: 165,\n g: 42,\n b: 42\n }\n ],\n [\n \"burlywood\",\n {\n r: 222,\n g: 184,\n b: 135\n }\n ],\n [\n \"cadetblue\",\n {\n r: 95,\n g: 158,\n b: 160\n }\n ],\n [\n \"chartreuse\",\n {\n r: 127,\n g: 255,\n b: 0\n }\n ],\n [\n \"chocolate\",\n {\n r: 210,\n g: 105,\n b: 30\n }\n ],\n [\n \"coral\",\n {\n r: 255,\n g: 127,\n b: 80\n }\n ],\n [\n \"cornflowerblue\",\n {\n r: 100,\n g: 149,\n b: 237\n }\n ],\n [\n \"cornsilk\",\n {\n r: 255,\n g: 248,\n b: 220\n }\n ],\n [\n \"crimson\",\n {\n r: 220,\n g: 20,\n b: 60\n }\n ],\n [\n \"cyan\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"darkblue\",\n {\n r: 0,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkcyan\",\n {\n r: 0,\n g: 139,\n b: 139\n }\n ],\n [\n \"darkgoldenrod\",\n {\n r: 184,\n g: 134,\n b: 11\n }\n ],\n [\n \"darkgray\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkgreen\",\n {\n r: 0,\n g: 100,\n b: 0\n }\n ],\n [\n \"darkgrey\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkkhaki\",\n {\n r: 189,\n g: 183,\n b: 107\n }\n ],\n [\n \"darkmagenta\",\n {\n r: 139,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkolivegreen\",\n {\n r: 85,\n g: 107,\n b: 47\n }\n ],\n [\n \"darkorange\",\n {\n r: 255,\n g: 140,\n b: 0\n }\n ],\n [\n \"darkorchid\",\n {\n r: 153,\n g: 50,\n b: 204\n }\n ],\n [\n \"darkred\",\n {\n r: 139,\n g: 0,\n b: 0\n }\n ],\n [\n \"darksalmon\",\n {\n r: 233,\n g: 150,\n b: 122\n }\n ],\n [\n \"darkseagreen\",\n {\n r: 143,\n g: 188,\n b: 143\n }\n ],\n [\n \"darkslateblue\",\n {\n r: 72,\n g: 61,\n b: 139\n }\n ],\n [\n \"darkslategray\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkslategrey\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkturquoise\",\n {\n r: 0,\n g: 206,\n b: 209\n }\n ],\n [\n \"darkviolet\",\n {\n r: 148,\n g: 0,\n b: 211\n }\n ],\n [\n \"deeppink\",\n {\n r: 255,\n g: 20,\n b: 147\n }\n ],\n [\n \"deepskyblue\",\n {\n r: 0,\n g: 191,\n b: 255\n }\n ],\n [\n \"dimgray\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dimgrey\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dodgerblue\",\n {\n r: 30,\n g: 144,\n b: 255\n }\n ],\n [\n \"firebrick\",\n {\n r: 178,\n g: 34,\n b: 34\n }\n ],\n [\n \"floralwhite\",\n {\n r: 255,\n g: 250,\n b: 240\n }\n ],\n [\n \"forestgreen\",\n {\n r: 34,\n g: 139,\n b: 34\n }\n ],\n [\n \"fuchsia\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"gainsboro\",\n {\n r: 220,\n g: 220,\n b: 220\n }\n ],\n [\n \"ghostwhite\",\n {\n r: 248,\n g: 248,\n b: 255\n }\n ],\n [\n \"goldenrod\",\n {\n r: 218,\n g: 165,\n b: 32\n }\n ],\n [\n \"gold\",\n {\n r: 255,\n g: 215,\n b: 0\n }\n ],\n [\n \"gray\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"green\",\n {\n r: 0,\n g: 128,\n b: 0\n }\n ],\n [\n \"greenyellow\",\n {\n r: 173,\n g: 255,\n b: 47\n }\n ],\n [\n \"grey\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"honeydew\",\n {\n r: 240,\n g: 255,\n b: 240\n }\n ],\n [\n \"hotpink\",\n {\n r: 255,\n g: 105,\n b: 180\n }\n ],\n [\n \"indianred\",\n {\n r: 205,\n g: 92,\n b: 92\n }\n ],\n [\n \"indigo\",\n {\n r: 75,\n g: 0,\n b: 130\n }\n ],\n [\n \"ivory\",\n {\n r: 255,\n g: 255,\n b: 240\n }\n ],\n [\n \"khaki\",\n {\n r: 240,\n g: 230,\n b: 140\n }\n ],\n [\n \"lavenderblush\",\n {\n r: 255,\n g: 240,\n b: 245\n }\n ],\n [\n \"lavender\",\n {\n r: 230,\n g: 230,\n b: 250\n }\n ],\n [\n \"lawngreen\",\n {\n r: 124,\n g: 252,\n b: 0\n }\n ],\n [\n \"lemonchiffon\",\n {\n r: 255,\n g: 250,\n b: 205\n }\n ],\n [\n \"lightblue\",\n {\n r: 173,\n g: 216,\n b: 230\n }\n ],\n [\n \"lightcoral\",\n {\n r: 240,\n g: 128,\n b: 128\n }\n ],\n [\n \"lightcyan\",\n {\n r: 224,\n g: 255,\n b: 255\n }\n ],\n [\n \"lightgoldenrodyellow\",\n {\n r: 250,\n g: 250,\n b: 210\n }\n ],\n [\n \"lightgray\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightgreen\",\n {\n r: 144,\n g: 238,\n b: 144\n }\n ],\n [\n \"lightgrey\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightpink\",\n {\n r: 255,\n g: 182,\n b: 193\n }\n ],\n [\n \"lightsalmon\",\n {\n r: 255,\n g: 160,\n b: 122\n }\n ],\n [\n \"lightseagreen\",\n {\n r: 32,\n g: 178,\n b: 170\n }\n ],\n [\n \"lightskyblue\",\n {\n r: 135,\n g: 206,\n b: 250\n }\n ],\n [\n \"lightslategray\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightslategrey\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightsteelblue\",\n {\n r: 176,\n g: 196,\n b: 222\n }\n ],\n [\n \"lightyellow\",\n {\n r: 255,\n g: 255,\n b: 224\n }\n ],\n [\n \"lime\",\n {\n r: 0,\n g: 255,\n b: 0\n }\n ],\n [\n \"limegreen\",\n {\n r: 50,\n g: 205,\n b: 50\n }\n ],\n [\n \"linen\",\n {\n r: 250,\n g: 240,\n b: 230\n }\n ],\n [\n \"magenta\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"maroon\",\n {\n r: 128,\n g: 0,\n b: 0\n }\n ],\n [\n \"mediumaquamarine\",\n {\n r: 102,\n g: 205,\n b: 170\n }\n ],\n [\n \"mediumblue\",\n {\n r: 0,\n g: 0,\n b: 205\n }\n ],\n [\n \"mediumorchid\",\n {\n r: 186,\n g: 85,\n b: 211\n }\n ],\n [\n \"mediumpurple\",\n {\n r: 147,\n g: 112,\n b: 219\n }\n ],\n [\n \"mediumseagreen\",\n {\n r: 60,\n g: 179,\n b: 113\n }\n ],\n [\n \"mediumslateblue\",\n {\n r: 123,\n g: 104,\n b: 238\n }\n ],\n [\n \"mediumspringgreen\",\n {\n r: 0,\n g: 250,\n b: 154\n }\n ],\n [\n \"mediumturquoise\",\n {\n r: 72,\n g: 209,\n b: 204\n }\n ],\n [\n \"mediumvioletred\",\n {\n r: 199,\n g: 21,\n b: 133\n }\n ],\n [\n \"midnightblue\",\n {\n r: 25,\n g: 25,\n b: 112\n }\n ],\n [\n \"mintcream\",\n {\n r: 245,\n g: 255,\n b: 250\n }\n ],\n [\n \"mistyrose\",\n {\n r: 255,\n g: 228,\n b: 225\n }\n ],\n [\n \"moccasin\",\n {\n r: 255,\n g: 228,\n b: 181\n }\n ],\n [\n \"navajowhite\",\n {\n r: 255,\n g: 222,\n b: 173\n }\n ],\n [\n \"navy\",\n {\n r: 0,\n g: 0,\n b: 128\n }\n ],\n [\n \"oldlace\",\n {\n r: 253,\n g: 245,\n b: 230\n }\n ],\n [\n \"olive\",\n {\n r: 128,\n g: 128,\n b: 0\n }\n ],\n [\n \"olivedrab\",\n {\n r: 107,\n g: 142,\n b: 35\n }\n ],\n [\n \"orange\",\n {\n r: 255,\n g: 165,\n b: 0\n }\n ],\n [\n \"orangered\",\n {\n r: 255,\n g: 69,\n b: 0\n }\n ],\n [\n \"orchid\",\n {\n r: 218,\n g: 112,\n b: 214\n }\n ],\n [\n \"palegoldenrod\",\n {\n r: 238,\n g: 232,\n b: 170\n }\n ],\n [\n \"palegreen\",\n {\n r: 152,\n g: 251,\n b: 152\n }\n ],\n [\n \"paleturquoise\",\n {\n r: 175,\n g: 238,\n b: 238\n }\n ],\n [\n \"palevioletred\",\n {\n r: 219,\n g: 112,\n b: 147\n }\n ],\n [\n \"papayawhip\",\n {\n r: 255,\n g: 239,\n b: 213\n }\n ],\n [\n \"peachpuff\",\n {\n r: 255,\n g: 218,\n b: 185\n }\n ],\n [\n \"peru\",\n {\n r: 205,\n g: 133,\n b: 63\n }\n ],\n [\n \"pink\",\n {\n r: 255,\n g: 192,\n b: 203\n }\n ],\n [\n \"plum\",\n {\n r: 221,\n g: 160,\n b: 221\n }\n ],\n [\n \"powderblue\",\n {\n r: 176,\n g: 224,\n b: 230\n }\n ],\n [\n \"purple\",\n {\n r: 128,\n g: 0,\n b: 128\n }\n ],\n [\n \"rebeccapurple\",\n {\n r: 102,\n g: 51,\n b: 153\n }\n ],\n [\n \"red\",\n {\n r: 255,\n g: 0,\n b: 0\n }\n ],\n [\n \"rosybrown\",\n {\n r: 188,\n g: 143,\n b: 143\n }\n ],\n [\n \"royalblue\",\n {\n r: 65,\n g: 105,\n b: 225\n }\n ],\n [\n \"saddlebrown\",\n {\n r: 139,\n g: 69,\n b: 19\n }\n ],\n [\n \"salmon\",\n {\n r: 250,\n g: 128,\n b: 114\n }\n ],\n [\n \"sandybrown\",\n {\n r: 244,\n g: 164,\n b: 96\n }\n ],\n [\n \"seagreen\",\n {\n r: 46,\n g: 139,\n b: 87\n }\n ],\n [\n \"seashell\",\n {\n r: 255,\n g: 245,\n b: 238\n }\n ],\n [\n \"sienna\",\n {\n r: 160,\n g: 82,\n b: 45\n }\n ],\n [\n \"silver\",\n {\n r: 192,\n g: 192,\n b: 192\n }\n ],\n [\n \"skyblue\",\n {\n r: 135,\n g: 206,\n b: 235\n }\n ],\n [\n \"slateblue\",\n {\n r: 106,\n g: 90,\n b: 205\n }\n ],\n [\n \"slategray\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"slategrey\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"snow\",\n {\n r: 255,\n g: 250,\n b: 250\n }\n ],\n [\n \"springgreen\",\n {\n r: 0,\n g: 255,\n b: 127\n }\n ],\n [\n \"steelblue\",\n {\n r: 70,\n g: 130,\n b: 180\n }\n ],\n [\n \"tan\",\n {\n r: 210,\n g: 180,\n b: 140\n }\n ],\n [\n \"teal\",\n {\n r: 0,\n g: 128,\n b: 128\n }\n ],\n [\n \"thistle\",\n {\n r: 216,\n g: 191,\n b: 216\n }\n ],\n [\n \"tomato\",\n {\n r: 255,\n g: 99,\n b: 71\n }\n ],\n [\n \"turquoise\",\n {\n r: 64,\n g: 224,\n b: 208\n }\n ],\n [\n \"violet\",\n {\n r: 238,\n g: 130,\n b: 238\n }\n ],\n [\n \"wheat\",\n {\n r: 245,\n g: 222,\n b: 179\n }\n ],\n [\n \"white\",\n {\n r: 255,\n g: 255,\n b: 255\n }\n ],\n [\n \"whitesmoke\",\n {\n r: 245,\n g: 245,\n b: 245\n }\n ],\n [\n \"yellow\",\n {\n r: 255,\n g: 255,\n b: 0\n }\n ],\n [\n \"yellowgreen\",\n {\n r: 154,\n g: 205,\n b: 50\n }\n ]\n], B = \"deg|rad|grad|turn\", U = \"[-\\\\+]?\\\\d+%?\", D = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\", L = `[-\\\\+]?\\\\d*\\\\.?\\\\d+(?:${B})?`, v = `(?:${D})|(?:${U})`, F = `(?:${v})|(?:${L}?)`, rr = \"(?:[\\\\s|\\\\(\\\\s|\\\\s\\\\(\\\\s]+)?\", tr = \"(?:[\\\\s|\\\\)\\\\s]+)?\", O = \"(?:[,|\\\\s]+)\", er = \"(?:[,|\\\\/\\\\s]*)?\", $ = `${rr}(${F})${O}(${v})${O}(${v})${er}(${v})?${tr}`, f = {\n CSS_UNIT: new RegExp(F),\n ANGLES: B,\n CSS_ANGLE: L,\n CSS_INTEGER: U,\n CSS_NUMBER: D,\n CSS_UNIT2: F,\n PERMISSIVE_MATCH: $,\n hwb: new RegExp(`hwb${$}`),\n rgb: new RegExp(`rgb(?:a)?${$}`),\n hsl: new RegExp(`hsl(?:a)?${$}`),\n hsv: new RegExp(`hsv(?:a)?${$}`),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n}, V = (o) => N.includes(o), k = (o, t) => o !== null && typeof o == \"object\" && Object.keys(t).every((r) => r in o), Z = (o) => `${o}`.includes(\".\") && parseFloat(o) === 1, R = (o) => typeof o == \"string\" && o.includes(\"%\"), c = (o) => !!f.CSS_UNIT.exec(`${o}`), z = [\"rgb\", \"hex\", \"hsl\", \"hsv\", \"hwb\"], J = (o) => N.includes(o) || [\"#\", ...z].some((t) => o.includes(t)) ? !1 : T.some(([t]) => o === t), u = (o, t) => {\n let r = o;\n if (typeof o == \"number\" && Math.min(o, 0) === 0 && // round values to 6 decimals Math.round(N * (10 ** 6)) / 10 ** 6\n Math.max(o, 1) === 1)\n return o;\n Z(o) && (r = \"100%\");\n const e = R(r);\n return r = t === 360 ? parseFloat(r) : Math.min(t, Math.max(0, parseFloat(r))), e && (r = r * t / 100), Math.abs(r - t) < 1e-6 ? 1 : (t === 360 ? r = (r < 0 ? r % t + t : r % t) / t : r = r % t / t, r);\n}, M = (o) => {\n let t = parseFloat(o);\n return (Number.isNaN(t) || t < 0 || t > 1) && (t = 1), t;\n}, x = (o) => Math.min(1, Math.max(0, o)), p = (o) => o.length === 1 ? `0${o}` : String(o), K = (o) => {\n const [[, t]] = T.filter(([r]) => r === o.toLowerCase());\n return t;\n}, h = (o) => parseInt(o, 16), E = (o) => h(o) / 255, Q = (o) => b(o * 255).toString(16), _ = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0, g = 0;\n const a = (e + s) / 2;\n if (e === s)\n g = 0, n = 0;\n else {\n const i = e - s;\n g = a > 0.5 ? i / (2 - e - s) : i / (e + s), e === o && (n = (t - r) / i + (t < r ? 6 : 0)), e === t && (n = (r - o) / i + 2), e === r && (n = (o - t) / i + 4), n /= 6;\n }\n return { h: n, s: g, l: a };\n}, H = (o, t, r) => {\n let e = r;\n return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? o + (t - o) * (6 * e) : e < 1 / 2 ? t : e < 2 / 3 ? o + (t - o) * (2 / 3 - e) * 6 : o;\n}, y = (o, t, r) => {\n let e = 0, s = 0, n = 0;\n if (t === 0)\n s = r, n = r, e = r;\n else if (r) {\n const g = r < 0.5 ? r * (1 + t) : r + t - r * t, a = 2 * r - g;\n e = H(a, g, o + 1 / 3), s = H(a, g, o), n = H(a, g, o - 1 / 3);\n }\n return { r: e, g: s, b: n };\n}, G = (o, t, r) => {\n let e = 0, s = 0;\n const n = Math.min(o, t, r), g = Math.max(o, t, r), a = 1 - g;\n if (g === n)\n return { h: 0, w: n, b: a };\n o === n ? (e = t - r, s = 3) : (e = t === n ? r - o : o - t, s = t === n ? 5 : 1);\n const i = (s - e / (g - n)) / 6;\n return {\n h: i === 1 ? 0 : i,\n w: n,\n b: a\n };\n}, X = (o, t, r) => {\n if (t + r >= 1) {\n const g = t / (t + r);\n return { r: g, g, b: g };\n }\n let { r: e, g: s, b: n } = y(o, 1, 0.5);\n return [e, s, n] = [e, s, n].map((g) => g * (1 - t - r) + t), { r: e, g: s, b: n };\n}, P = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0;\n const g = e, a = e - s, i = e === 0 ? 0 : a / e;\n return e === s ? n = 0 : (o === e && (n = (t - r) / a + (t < r ? 6 : 0)), t === e && (n = (r - o) / a + 2), r === e && (n = (o - t) / a + 4), n /= 6), { h: n, s: i, v: g };\n}, I = (o, t, r) => {\n const e = o * 6, s = t, n = r, g = Math.floor(e), a = e - g, i = n * (1 - s), l = n * (1 - a * s), d = n * (1 - (1 - a) * s), m = g % 6, w = [n, l, i, i, d, n][m], S = [d, n, n, l, i, i][m], A = [i, i, d, n, n, l][m];\n return { r: w, g: S, b: A };\n}, j = (o, t, r, e) => {\n const s = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16))\n ];\n return e && s[0].charAt(0) === s[0].charAt(1) && s[1].charAt(0) === s[1].charAt(1) && s[2].charAt(0) === s[2].charAt(1) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) : s.join(\"\");\n}, C = (o, t, r, e, s) => {\n const n = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16)),\n p(Q(e))\n ];\n return s && n[0].charAt(0) === n[0].charAt(1) && n[1].charAt(0) === n[1].charAt(1) && n[2].charAt(0) === n[2].charAt(1) && n[3].charAt(0) === n[3].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join(\"\");\n}, Y = (o) => {\n const t = String(o).trim().toLowerCase();\n if (J(t))\n return Object.assign(K(t), {\n a: 1,\n format: \"rgb\",\n ok: !0\n });\n if (V(t))\n return {\n r: 0,\n g: 0,\n b: 0,\n a: t === \"transparent\" ? 0 : 1,\n format: \"rgb\",\n ok: !0\n };\n let [, r, e, s, n] = f.rgb.exec(t) || [];\n return r && e && s ? {\n r,\n g: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"rgb\",\n ok: !0\n } : ([, r, e, s, n] = f.hsl.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n l: s,\n a: n !== void 0 ? n : 1,\n format: \"hsl\",\n ok: !0\n } : ([, r, e, s, n] = f.hsv.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n v: s,\n a: n !== void 0 ? n : 1,\n format: \"hsv\",\n ok: !0\n } : ([, r, e, s, n] = f.hwb.exec(t) || [], r && e && s ? {\n h: r,\n w: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"hwb\",\n ok: !0\n } : ([, r, e, s, n] = f.hex8.exec(t) || [], r && e && s && n ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: E(n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex6.exec(t) || [], r && e && s ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : ([, r, e, s, n] = f.hex4.exec(t) || [], r && e && s && n ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: E(n + n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex3.exec(t) || [], r && e && s ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : {\n r: 0,\n g: 0,\n b: 0,\n a: 1,\n format: \"rgb\",\n ok: !o\n })))))));\n}, q = (o) => {\n let t = { r: 0, g: 0, b: 0 }, r = o, e = 1, s, n, g, a, i, l, d, m, w = \"rgb\", S = !1;\n return (!r || typeof r == \"string\") && (r = Y(r), S = r.ok), k(r, t) && c(r.r) && c(r.g) && c(r.b) && ({ r: d, g: m, b: i } = r, [d, m, i] = [d, m, i].map((A) => u(A, R(A) ? 100 : 255)), t = { r: d, g: m, b: i }, w = \"format\" in r ? r.format : \"rgb\"), k(r, { h: 0, s: 0, v: 0 }) && c(r.h) && c(r.s) && c(r.v) && ({ h: l, s, v: n } = r, l = u(l, 360), s = u(s, 100), n = u(n, 100), t = I(l, s, n), w = \"hsv\"), k(r, { h: 0, s: 0, l: 0 }) && c(r.h) && c(r.s) && c(r.l) && ({ h: l, s, l: g } = r, l = u(l, 360), s = u(s, 100), g = u(g, 100), t = y(l, s, g), w = \"hsl\"), k(r, { h: 0, w: 0, b: 0 }) && c(r.h) && c(r.w) && c(r.b) && ({ h: l, w: a, b: i } = r, l = u(l, 360), a = u(a, 100), i = u(i, 100), t = X(l, a, i), w = \"hwb\"), c(r.a) && (e = r.a, e = R(e) || parseFloat(`${e}`) > 1 ? u(e, 100) : e), {\n r: t.r,\n g: t.g,\n b: t.b,\n a: M(e),\n format: w,\n ok: S\n };\n}, sr = \"1.0.8\";\nclass W {\n // bring main utilities to front\n static matchers = f;\n static isOnePointZero = Z;\n static isPercentage = R;\n static isValidCSSUnit = c;\n static isNonColor = V;\n static isColorName = J;\n static isColorType = k;\n static pad2 = p;\n static clamp01 = x;\n static bound01 = u;\n static boundAlpha = M;\n static getRGBFromName = K;\n static convertHexToDecimal = E;\n static convertDecimalToHex = Q;\n static rgbToHsl = _;\n static rgbToHex = j;\n static rgbToHsv = P;\n static rgbToHwb = G;\n static rgbaToHex = C;\n static hslToRgb = I;\n static hsvToRgb = I;\n static hueToRgb = H;\n static hwbToRgb = X;\n static parseIntFromHex = h;\n static stringInputToObject = Y;\n static inputToRGB = q;\n static roundPart = b;\n static webColors = T;\n static nonColors = N;\n static version = sr;\n // main public properties\n r;\n g;\n b;\n a;\n format;\n ok;\n originalInput;\n // main public methods\n constructor(t, r) {\n const e = r && z.includes(r) ? r : \"\", { r: s, g: n, b: g, a, ok: i, format: l } = q(t);\n this.originalInput = t, this.r = s, this.g = n, this.b = g, this.a = a, this.ok = i, this.format = e || l;\n }\n /**\n * Checks if the current input value is a valid colour.\n */\n get isValid() {\n return this.ok;\n }\n /**\n * Checks if the current colour requires a light text colour.\n */\n get isDark() {\n return this.brightness < 120;\n }\n /**\n * Returns the perceived luminance of a colour.\n *\n * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n */\n get luminance() {\n const { r: t, g: r, b: e } = this;\n let s = 0, n = 0, g = 0;\n return t <= 0.03928 ? s = t / 12.92 : s = ((t + 0.055) / 1.055) ** 2.4, r <= 0.03928 ? n = r / 12.92 : n = ((r + 0.055) / 1.055) ** 2.4, e <= 0.03928 ? g = e / 12.92 : g = ((e + 0.055) / 1.055) ** 2.4, 0.2126 * s + 0.7152 * n + 0.0722 * g;\n }\n /**\n * Returns the perceived brightness of the colour.\n */\n get brightness() {\n const { r: t, g: r, b: e } = this.toRgb();\n return (t * 299 + r * 587 + e * 114) / 1e3;\n }\n /**\n * Returns the web colour name closest to the current colour.\n */\n get name() {\n const { r: t, g: r, b: e } = this.toRgb(), [s] = T.map(([n, g]) => {\n const a = (\n // ((rgb.r - r) ** 2 + (rgb.g - g) ** 2 + (rgb.b - b) ** 2) ** 0.5; // standard\n (((g.r - t) * 0.3) ** 2 + ((g.g - r) * 0.6) ** 2 + ((g.b - e) * 0.1) ** 2) ** 0.5\n );\n return [n, a];\n }).find(([, n], g, a) => n === Math.min(...a.map(([, i]) => i)));\n return s;\n }\n /**\n * Returns the colour as an RGBA object.\n */\n toRgb() {\n let { r: t, g: r, b: e, a: s } = this;\n return [t, r, e] = [t, r, e].map((n) => b(n * 255 * 100) / 100), s = b(s * 100) / 100, {\n r: t,\n g: r,\n b: e,\n a: s\n };\n }\n /**\n * Returns the RGBA values concatenated into a CSS3 Module string format.\n * * rgb(255,255,255)\n * * rgba(255,255,255,0.5)\n */\n toRgbString() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b);\n return s === 1 ? `rgb(${n}, ${g}, ${a})` : `rgba(${n}, ${g}, ${a}, ${s})`;\n }\n /**\n * Returns the RGBA values concatenated into a CSS4 Module string format.\n * * rgb(255 255 255)\n * * rgb(255 255 255 / 50%)\n */\n toRgbCSS4String() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b), i = s === 1 ? \"\" : ` / ${b(s * 100)}%`;\n return `rgb(${n} ${g} ${a}${i})`;\n }\n /**\n * Returns the hexadecimal value of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the decimal value.\n */\n toHex(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return n === 1 ? j(r, e, s, t) : C(r, e, s, n, t);\n }\n /**\n * Returns the CSS valid hexadecimal vaue of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the value.\n */\n toHexString(t) {\n return `#${this.toHex(t)}`;\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return C(r, e, s, n, t);\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8String(t) {\n return `#${this.toHex8(t)}`;\n }\n /**\n * Returns the colour as a HSVA object.\n */\n toHsv() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, v: a } = P(t, r, e);\n return {\n h: n,\n s: g,\n v: a,\n a: s\n };\n }\n /**\n * Returns the colour as an HSLA object.\n */\n toHsl() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, l: a } = _(t, r, e);\n return {\n h: n,\n s: g,\n l: a,\n a: s\n };\n }\n /**\n * Returns the HSLA values concatenated into a CSS3 Module format string.\n * * `hsl(150, 100%, 50%)`\n * * `hsla(150, 100%, 50%, 0.5)`\n */\n toHslString() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n return t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100) / 100, s === 1 ? `hsl(${t}, ${r}%, ${e}%)` : `hsla(${t}, ${r}%, ${e}%, ${s})`;\n }\n /**\n * Returns the HSLA values concatenated into a CSS4 Module format string.\n * * `hsl(150deg 100% 50%)`\n * * `hsl(150deg 100% 50% / 50%)`\n */\n toHslCSS4String() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hsl(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Returns the colour as an HWBA object.\n */\n toHwb() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, w: g, b: a } = G(t, r, e);\n return {\n h: n,\n w: g,\n b: a,\n a: s\n };\n }\n /**\n * Returns the HWBA values concatenated into a string.\n */\n toHwbString() {\n let { h: t, w: r, b: e, a: s } = this.toHwb();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hwb(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Sets the alpha value of the current colour.\n */\n setAlpha(t) {\n return typeof t != \"number\" ? this : (this.a = M(t), this);\n }\n /**\n * Saturate the colour with a given amount.\n */\n saturate(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, x(e + t / 100), s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Desaturate the colour with a given amount.\n */\n desaturate(t) {\n return typeof t == \"number\" ? this.saturate(-t) : this;\n }\n /**\n * Completely desaturates a colour into greyscale.\n * Same as calling `desaturate(100)`\n */\n greyscale() {\n return this.saturate(-100);\n }\n /**\n * Increase the colour lightness with a given amount.\n */\n lighten(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, e, x(s + t / 100));\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Decrease the colour lightness with a given amount.\n */\n darken(t) {\n return typeof t == \"number\" ? this.lighten(-t) : this;\n }\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n spin(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(x((r * 360 + t) % 360 / 360), e, s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /** Returns a clone of the current `Color` instance. */\n clone() {\n return new W(this);\n }\n /**\n * Returns the colour value in CSS valid string format.\n */\n toString(t) {\n const { format: r } = this;\n return r === \"hex\" ? this.toHexString(t) : r === \"hsl\" ? this.toHslString() : r === \"hwb\" ? this.toHwbString() : this.toRgbString();\n }\n}\nexport {\n W as default\n};\n//# sourceMappingURL=index.mjs.map\n","import Color from '@thednp/color';\n// import { isNumber } from '@thednp/shorty';\n\n/**\n * Returns a color palette with a given set of parameters.\n *\n * @example\n * new ColorPalette(0, 12, 10, 80);\n * // => { hue: 0, hueSteps: 12, lightSteps: 10, saturation: 80, colors: Array }\n */\nexport default class ColorPalette {\n public static Color = Color;\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n colors: Color[];\n /**\n * The `hue` parameter is optional, which would be set to 0.\n * * `args.hue` the starting Hue [0, 360]\n * * `args.hueSteps` Hue Steps Count [5, 24]\n * * `args.lightSteps` Lightness Steps Count [5, 12]\n * * `args.saturation` Saturation [0, 100]\n */\n constructor(...args: [number?, number?, number?, number?]) {\n let hue = 0;\n let hueSteps = 12;\n let lightSteps = 10;\n let lightnessArray = [0.5];\n let saturation = 100;\n // if (!args.every(n => isNumber(n))) throw TypeError('ColorPalette only accepts numbers.');\n\n if (args.length === 4) {\n [hue, hueSteps, lightSteps, saturation] = args as [number, number, number, number];\n } else if (args.length === 3) {\n [hue, hueSteps, lightSteps] = args as [number, number, number];\n } else if (args.length === 2) {\n [hueSteps, lightSteps] = args as [number, number];\n if ([hueSteps, lightSteps].some(n => n < 1)) {\n throw TypeError('ColorPalette: the two minimum arguments must be numbers higher than 0.');\n }\n }\n\n const colors: Color[] = [];\n const hueStep = 360 / hueSteps;\n const half = Color.roundPart((lightSteps - (lightSteps % 2 ? 1 : 0)) / 2);\n const steps1To13 = [0.25, 0.2, 0.15, 0.11, 0.09, 0.075];\n const lightSets = [\n [1, 2, 3],\n [4, 5],\n [6, 7],\n [8, 9],\n [10, 11],\n [12, 13],\n ];\n const closestSet = lightSets.find(set => set.includes(lightSteps));\n\n // find a lightStep that won't go beyond black and white\n // something within the [10-90] range of lightness\n const lightStep = closestSet\n ? steps1To13[lightSets.indexOf(closestSet)]\n : 100 / (lightSteps + (lightSteps % 2 ? 0 : 1)) / 100;\n\n // light tints\n for (let i = 1; i < half + 1; i += 1) {\n lightnessArray = [...lightnessArray, 0.5 + lightStep * i];\n }\n\n // dark tints\n for (let i = 1; i < lightSteps - half; i += 1) {\n lightnessArray = [0.5 - lightStep * i, ...lightnessArray];\n }\n\n // feed `colors` Array\n for (let i = 0; i < hueSteps; i += 1) {\n const currentHue = ((hue + i * hueStep) % 360) / 360;\n lightnessArray.forEach(l => {\n const newColor = new Color({ h: currentHue, s: 1, l });\n colors.push(saturation < 100 ? newColor.saturate(saturation - 100) : newColor);\n });\n }\n\n this.hue = hue;\n this.hueSteps = hueSteps;\n this.lightSteps = lightSteps;\n this.saturation = saturation;\n this.colors = colors;\n }\n}\n","import ColorPickerLabels from '../interface/colorPickerLabels';\n\n/** The labels presented to the user. */\nconst colorPickerLabels: ColorPickerLabels = {\n pickerLabel: 'Colour Picker',\n appearanceLabel: 'Colour Appearance',\n valueLabel: 'Colour Value',\n toggleLabel: 'Select Colour',\n presetsLabel: 'Colour Presets',\n defaultsLabel: 'Colour Defaults',\n formatLabel: 'Format',\n alphaLabel: 'Alpha',\n hexLabel: 'Hexadecimal',\n hueLabel: 'Hue',\n whitenessLabel: 'Whiteness',\n blacknessLabel: 'Blackness',\n saturationLabel: 'Saturation',\n lightnessLabel: 'Lightness',\n redLabel: 'Red',\n greenLabel: 'Green',\n blueLabel: 'Blue',\n};\n\nexport default colorPickerLabels;\n","/** A list of 17 color names used for WAI-ARIA compliance. */\nconst colorNames: string[] = [\n 'white',\n 'black',\n 'grey',\n 'red',\n 'orange',\n 'brown',\n 'gold',\n 'olive',\n 'yellow',\n 'lime',\n 'green',\n 'teal',\n 'cyan',\n 'blue',\n 'violet',\n 'magenta',\n 'pink',\n];\nexport default colorNames;\n","import { isString } from '@thednp/shorty';\n\n/**\n * Check if a string is valid JSON string.\n *\n * @param str the string input\n * @returns the query result\n */\nconst isValidJSON = (str: unknown): str is string => {\n if (!isString(str)) return false;\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n};\n\nexport default isValidJSON;\n","const vHidden = 'v-hidden';\nexport default vHidden;\n","import { createElement, setAttribute, ObjectAssign, toUpperCase } from '@thednp/shorty';\n\nimport vHidden from './vHidden';\nimport ColorPicker from '../index';\n\n/**\n * Returns the color form for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns a new `
    ` element with color component ``\n */\nconst getColorForm = (self: ColorPicker): HTMLElement => {\n const { format, id, componentLabels } = self;\n const colorForm = createElement({\n tagName: 'div',\n className: `color-form ${format}`,\n }) as HTMLElement;\n\n let components = ['hex'];\n if (format === 'rgb') components = ['red', 'green', 'blue', 'alpha'];\n else if (format === 'hsl') components = ['hue', 'saturation', 'lightness', 'alpha'];\n else if (format === 'hwb') components = ['hue', 'whiteness', 'blackness', 'alpha'];\n\n components.forEach((c: string): void => {\n const [C] = format === 'hex' ? ['#'] : toUpperCase(c).split('');\n const cID = `color_${format}_${c}_${id}`;\n const formatLabel = componentLabels[`${c}Label`];\n const cInputLabel = createElement({ tagName: 'label' }) as HTMLElement;\n setAttribute(cInputLabel, 'for', cID);\n cInputLabel.append(\n createElement({\n tagName: 'span',\n ariaHidden: 'true',\n innerText: `${C}:`,\n }) as HTMLElement,\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: formatLabel,\n }) as HTMLElement,\n );\n const cInput = createElement({\n tagName: 'input',\n id: cID,\n // name: cID, - prevent saving the value to a form\n type: format === 'hex' ? 'text' : 'number',\n value: c === 'alpha' ? '100' : '0',\n className: `color-input ${c}`,\n autocomplete: 'off',\n spellcheck: false,\n } as Partial) as HTMLInputElement;\n\n // alpha\n let max = '100';\n let step = '1';\n if (c !== 'alpha') {\n if (format === 'rgb') {\n max = '255';\n step = '1';\n } else if (c === 'hue') {\n max = '360';\n step = '1';\n }\n }\n ObjectAssign(cInput, {\n min: '0',\n max,\n step,\n });\n colorForm.append(cInputLabel, cInput);\n });\n return colorForm;\n};\n\nexport default getColorForm;\n","import { createElement } from '@thednp/shorty';\n\nimport ColorPicker from '..';\n\n/**\n * Returns all color controls for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns color controls\n */\nconst getColorControls = (self: ColorPicker): HTMLElement => {\n const { format, componentLabels } = self;\n const { hueLabel, alphaLabel, lightnessLabel, saturationLabel, whitenessLabel, blacknessLabel } = componentLabels;\n\n const max1 = format === 'hsl' ? 360 : 100;\n const max2 = format === 'hsl' ? 100 : 360;\n const max3 = 100;\n\n let ctrl1Label = format === 'hsl' ? `${hueLabel} & ${lightnessLabel}` : `${lightnessLabel} & ${saturationLabel}`;\n\n ctrl1Label = format === 'hwb' ? `${whitenessLabel} & ${blacknessLabel}` : ctrl1Label;\n\n const ctrl2Label = format === 'hsl' ? `${saturationLabel}` : `${hueLabel}`;\n\n const colorControls = createElement({\n tagName: 'div',\n className: `color-controls ${format}`,\n }) as HTMLElement;\n\n const colorPointer = 'color-pointer';\n const colorSlider = 'color-slider';\n\n const controls = [\n {\n i: 1,\n c: colorPointer,\n l: ctrl1Label,\n min: 0,\n max: max1,\n },\n {\n i: 2,\n c: colorSlider,\n l: ctrl2Label,\n min: 0,\n max: max2,\n },\n {\n i: 3,\n c: colorSlider,\n l: alphaLabel,\n min: 0,\n max: max3,\n },\n ];\n\n controls.forEach(template => {\n const { i, c, l, min, max } = template;\n const control = createElement({\n tagName: 'div',\n className: 'color-control',\n role: 'presentation',\n }) as HTMLElement;\n\n control.append(\n createElement({\n tagName: 'div',\n className: `visual-control visual-control${i}`,\n }) as HTMLElement,\n );\n\n const knob = createElement({\n tagName: 'div',\n className: `${c} knob`,\n ariaLive: 'polite',\n ariaLabel: l,\n role: 'slider',\n tabIndex: 0,\n ariaValueMin: `${min}`,\n ariaValueMax: `${max}`,\n }) as HTMLElement;\n\n control.append(knob);\n colorControls.append(control);\n });\n\n return colorControls;\n};\n\nexport default getColorControls;\n","import { setAttribute, getAttribute, createElement, setElementStyle } from '@thednp/shorty';\n\nimport Color from '@thednp/color';\nimport ColorPalette from '../colorPalette';\nimport ColorPicker from '../index';\n\n/**\n * Returns a color-defaults with given values and class.\n */\nconst getColorMenu = (self: ColorPicker, colorsSource: ColorPalette | string[], menuClass: string): HTMLElement => {\n const { input, format, componentLabels } = self;\n const { defaultsLabel, presetsLabel } = componentLabels;\n const isOptionsMenu = menuClass === 'color-options';\n const isPalette = colorsSource instanceof ColorPalette;\n const menuLabel = isOptionsMenu ? presetsLabel : defaultsLabel;\n const colorsArray = isPalette ? colorsSource.colors : colorsSource;\n const colorsCount = colorsArray.length;\n const { lightSteps } = isPalette ? colorsSource : { lightSteps: null };\n const fit = lightSteps || [9, 10].find(x => colorsCount >= x * 2 && !(colorsCount % x)) || 5;\n const isMultiLine = isOptionsMenu && colorsCount > fit;\n let rowCountHover = 2;\n rowCountHover = isMultiLine && colorsCount > fit * 2 ? 3 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 3 ? 4 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 4 ? 5 : rowCountHover;\n const rowCount = rowCountHover - (colorsCount <= fit * 3 ? 1 : 2);\n const isScrollable = isMultiLine && colorsCount > rowCount * fit;\n let finalClass = menuClass;\n finalClass += isScrollable ? ' scrollable' : '';\n finalClass += isMultiLine ? ' multiline' : '';\n const gap = isMultiLine ? '1px' : '0.25rem';\n let optionSize = isMultiLine ? 1.75 : 2;\n optionSize = fit > 5 && isMultiLine ? 1.5 : optionSize;\n const menuHeight = `${rowCount * optionSize}rem`;\n const menuHeightHover = `calc(${rowCountHover} * ${optionSize}rem + ${rowCountHover - 1} * ${gap})`;\n\n //
      is an `HTMLElement`\n const menu = createElement({\n tagName: 'ul',\n className: finalClass,\n role: 'listbox',\n ariaLabel: menuLabel,\n }) as HTMLElement;\n\n if (isScrollable) {\n setElementStyle(menu, {\n '--grid-item-size': `${optionSize}rem`,\n '--grid-fit': `${fit}`,\n '--grid-gap': gap,\n '--grid-height': menuHeight,\n '--grid-hover-height': menuHeightHover,\n });\n }\n\n colorsArray.forEach(x => {\n let [value, label] = typeof x === 'string' ? x.trim().split(':') : [];\n if (x instanceof Color) {\n value = x.toHexString();\n label = value;\n }\n const color = new Color(x instanceof Color ? x : value, format);\n const isActive = color.toString() === getAttribute(input, 'value');\n const active = isActive ? ' active' : '';\n\n const option = createElement({\n tagName: 'li',\n className: `color-option${active}`,\n innerText: `${label || value}`,\n tabIndex: 0,\n role: 'option',\n ariaSelected: isActive ? 'true' : 'false',\n }) as HTMLElement;\n setAttribute(option, 'data-value', `${value}`);\n\n if (isOptionsMenu) {\n setElementStyle(option, { backgroundColor: value });\n }\n\n menu.append(option);\n });\n return menu;\n};\n\nexport default getColorMenu;\n","import {\n getAttribute,\n setAttribute,\n toUpperCase,\n ariaHidden,\n tabindex,\n createElement,\n createElementNS,\n} from '@thednp/shorty';\n\nimport Color from '@thednp/color';\n\nimport getColorForm from './getColorForm';\nimport getColorControls from './getColorControls';\nimport getColorMenu from './getColorMenu';\nimport vHidden from './vHidden';\n\nimport ColorPicker from '../index';\n\n/**\n * Generate HTML markup and update instance properties.\n *\n * @param self\n */\nconst setMarkup = (self: ColorPicker) => {\n const { input, parent, format, id, componentLabels, colorKeywords, colorPresets } = self;\n const colorValue = getAttribute(input, 'value') || '#fff';\n const { nonColors } = Color;\n\n const { toggleLabel, pickerLabel, formatLabel, hexLabel } = componentLabels;\n\n // update color\n const color = nonColors.includes(colorValue) ? '#fff' : colorValue;\n self.color = new Color(color, format);\n\n // set initial controls dimensions\n const formatString = format === 'hex' ? hexLabel : toUpperCase(format);\n\n const pickerBtn = createElement({\n id: `picker-btn-${id}`,\n tagName: 'button',\n type: 'button',\n className: 'picker-toggle btn-appearance',\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLButtonElement;\n\n pickerBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${pickerLabel}. ${formatLabel}: ${formatString}`,\n }) as HTMLElement,\n );\n\n const pickerDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown picker',\n role: 'group',\n ariaLabelledBy: `picker-btn-${id}`,\n } as Partial & { ariaLabelledBy: string }) as HTMLElement;\n\n const colorControls = getColorControls(self);\n const colorForm = getColorForm(self);\n\n pickerDropdown.append(colorControls, colorForm);\n input.before(pickerBtn);\n parent.append(pickerDropdown);\n\n // set colour key menu template\n if (colorKeywords || colorPresets) {\n const presetsDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown scrollable menu',\n }) as HTMLElement;\n\n // color presets\n if (colorPresets) {\n presetsDropdown.append(getColorMenu(self, colorPresets, 'color-options'));\n }\n\n // explicit defaults [reset, initial, inherit, transparent, currentColor]\n // also custom defaults [default: #069, complementary: #930]\n if (colorKeywords && colorKeywords.length) {\n presetsDropdown.append(getColorMenu(self, colorKeywords, 'color-defaults'));\n }\n\n const presetsBtn = createElement({\n tagName: 'button',\n type: 'button',\n className: 'menu-toggle btn-appearance',\n tabIndex: -1,\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLButtonElement;\n\n const xmlns = encodeURI('http://www.w3.org/2000/svg');\n const presetsIcon = createElementNS(xmlns, {\n tagName: 'svg',\n }) as HTMLElement;\n setAttribute(presetsIcon, 'xmlns', xmlns);\n setAttribute(presetsIcon, 'viewBox', '0 0 512 512');\n setAttribute(presetsIcon, ariaHidden, 'true');\n\n const path = createElementNS(xmlns, {\n tagName: 'path',\n }) as HTMLElement;\n setAttribute(path, 'd', 'M98,158l157,156L411,158l27,27L255,368L71,185L98,158z');\n setAttribute(path, 'fill', '#fff');\n presetsIcon.append(path);\n presetsBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${toggleLabel}`,\n }) as HTMLElement,\n presetsIcon,\n );\n\n parent.append(presetsBtn, presetsDropdown);\n }\n\n // solve non-colors after settings save\n if (colorKeywords && nonColors.includes(colorValue)) {\n self.value = colorValue;\n }\n setAttribute(input, tabindex, '-1');\n};\n\nexport default setMarkup;\n","import {\n ariaDescription,\n ariaSelected,\n ariaValueNow,\n ariaValueText,\n ariaExpanded,\n keyArrowDown,\n keyArrowUp,\n keyArrowLeft,\n keyArrowRight,\n keyEnter,\n keySpace,\n keyEscape,\n focusinEvent,\n mouseclickEvent,\n keydownEvent,\n changeEvent,\n touchmoveEvent,\n pointerdownEvent,\n pointermoveEvent,\n pointerupEvent,\n tabindex,\n focusoutEvent,\n resizeEvent,\n keyupEvent,\n scrollEvent,\n dispatchEvent,\n getElementsByClassName,\n closest,\n querySelector,\n getElementTransitionDuration,\n getBoundingClientRect,\n getUID,\n getElementStyle,\n getDocumentElement,\n getDocument,\n ObjectAssign,\n ObjectFromEntries,\n Data,\n getInstance,\n setElementStyle,\n normalizeOptions,\n reflow,\n focus,\n hasClass,\n addClass,\n removeClass,\n setAttribute,\n getAttribute,\n removeAttribute,\n isArray,\n isString,\n getWindow,\n on,\n off,\n} from '@thednp/shorty';\n\n// ColorPicker Util\n// ================\nimport Color from '@thednp/color';\nimport type { RGBA, HWBA, HSLA, HSVA } from '@thednp/color';\n\nimport ColorPalette from './colorPalette';\nimport colorPickerLabels from './util/colorPickerLabels';\nimport colorNames from './util/colorNames';\nimport isValidJSON from './util/isValidJSON';\nimport setMarkup from './util/setMarkup';\n\nimport ColorPickerOptions from './interface/colorPickerOptions';\nimport ColorPickerLabels from './interface/colorPickerLabels';\nimport type ColorNames from './interface/ColorNames';\nimport { version } from '../../package.json';\n\n// ColorPicker GC\n// ==============\nconst colorPickerString = 'color-picker';\nconst colorPickerSelector = `[data-function=\"${colorPickerString}\"]`;\nconst colorPickerParentSelector = `.${colorPickerString}`;\nconst colorPickerDefaults: ColorPickerOptions = {\n componentLabels: colorPickerLabels,\n colorLabels: colorNames,\n format: 'rgb',\n colorPresets: false,\n colorKeywords: false,\n};\nconst { roundPart, nonColors } = Color;\n\n// ColorPicker Static Methods\n// ==========================\nconst getColorPickerInstance = (element: HTMLInputElement) => getInstance(element, colorPickerString);\nconst initColorPicker = (element: HTMLInputElement) => new ColorPicker(element);\n\n// ColorPicker Private Methods\n// ===========================\n\n/**\n * Add / remove `ColorPicker` main event listeners.\n */\nconst toggleEvents = (self: ColorPicker, action?: boolean) => {\n const fn = action ? on : off;\n const { input, pickerToggle, menuToggle } = self;\n\n fn(input, focusinEvent, self.showPicker);\n fn(pickerToggle, mouseclickEvent, self.togglePicker);\n\n if (menuToggle) {\n fn(menuToggle, mouseclickEvent, self.toggleMenu);\n }\n};\n\n/**\n * Add / remove `ColorPicker` event listeners active only when open.\n */\nconst toggleEventsOnShown = (self: ColorPicker, action?: boolean) => {\n const fn = action ? on : off;\n const { input, colorMenu, parent } = self;\n const doc = getDocument(input);\n const win = getWindow(doc);\n\n fn(self.controls, pointerdownEvent, self.pointerDown as EventListener);\n self.controlKnobs.forEach(x => fn(x, keydownEvent, self.handleKnobs as EventListener));\n\n fn(win, scrollEvent, self.handleScroll);\n fn(win, resizeEvent, self.update);\n\n [input, ...self.inputs].forEach(x => fn(x, changeEvent, self.changeHandler));\n\n if (colorMenu) {\n fn(colorMenu, mouseclickEvent, self.menuClickHandler);\n fn(colorMenu, keydownEvent, self.menuKeyHandler as EventListener);\n }\n\n fn(doc, pointermoveEvent, self.pointerMove as EventListener);\n fn(doc, pointerupEvent, self.pointerUp as EventListener);\n fn(parent, focusoutEvent, self.handleFocusOut as EventListener);\n fn(doc, keyupEvent, self.handleDismiss as EventListener);\n};\n\n/**\n * Triggers the `ColorPicker` original event.\n */\nconst firePickerChange = (self: ColorPicker) => {\n dispatchEvent(self.input, new CustomEvent('colorpicker.change'));\n};\n\n/**\n * Hides a visible dropdown.\n */\nconst removePosition = (element: HTMLElement) => {\n /* istanbul ignore else */\n if (element) {\n ['bottom', 'top'].forEach(x => removeClass(element, x));\n }\n};\n\n/**\n * Shows a `ColorPicker` dropdown and close the curent open dropdown.\n */\nconst showDropdown = (self: ColorPicker, dropdown: HTMLElement) => {\n const { colorPicker, colorMenu, menuToggle, pickerToggle, parent } = self;\n const isPicker = dropdown === colorPicker;\n const openDropdown = isPicker ? colorMenu : colorPicker;\n const activeBtn = isPicker ? menuToggle : pickerToggle;\n const nextBtn = !isPicker ? menuToggle : pickerToggle;\n\n if (!hasClass(parent, 'open')) {\n addClass(parent, 'open');\n }\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n removePosition(openDropdown);\n }\n addClass(dropdown, 'bottom');\n reflow(dropdown);\n addClass(dropdown, 'show');\n\n if (isPicker) self.update();\n\n if (!self.isOpen) {\n toggleEventsOnShown(self, true);\n self.updateDropdownPosition();\n self.isOpen = true;\n setAttribute(self.input, tabindex, '0');\n if (menuToggle) {\n setAttribute(menuToggle, tabindex, '0');\n }\n }\n\n setAttribute(nextBtn, ariaExpanded, 'true');\n if (activeBtn) {\n setAttribute(activeBtn, ariaExpanded, 'false');\n }\n};\n\n/**\n * Color Picker Web Component\n *\n * @see http://thednp.github.io/color-picker\n */\nexport default class ColorPicker {\n // bring utils to staic\n public static Color = Color;\n public static ColorPalette = ColorPalette;\n public static getInstance = getColorPickerInstance;\n public static init = initColorPicker;\n public static selector = colorPickerSelector;\n // utils important for render\n public static roundPart = roundPart;\n public static setElementStyle = setElementStyle;\n public static setAttribute = setAttribute;\n public static getBoundingClientRect = getBoundingClientRect;\n public static version = version;\n public static colorNames = colorNames;\n public static colorPickerLabels = colorPickerLabels;\n\n id: number;\n input: HTMLInputElement;\n color: Color;\n format = 'rgb';\n parent: HTMLElement;\n dragElement: HTMLElement | undefined;\n isOpen = false;\n controlPositions: {\n c1x: number;\n c1y: number;\n c2y: number;\n c3y: number;\n };\n colorLabels: ColorNames = ObjectFromEntries(colorNames.map(c => [c, c])) as ColorNames;\n colorKeywords: string[] | false;\n colorPresets: ColorPalette | string[] | false;\n componentLabels: ColorPickerLabels;\n pickerToggle: HTMLElement;\n menuToggle: HTMLElement;\n colorPicker: HTMLElement;\n colorMenu: HTMLElement;\n controls: HTMLElement;\n inputs: HTMLInputElement[];\n controlKnobs: HTMLElement[];\n visuals: HTMLElement[];\n\n /**\n * Returns a new `ColorPicker` instance. The target of this constructor\n * must be an `HTMLInputElement`.\n *\n * @param target the target `` element\n * @param config instance options\n */\n constructor(target: (HTMLElement & HTMLInputElement) | string, config?: Partial) {\n const input = querySelector(target) as HTMLInputElement;\n\n // invalidate\n if (typeof target === 'undefined') throw new TypeError(`ColorPicker target not specified.`);\n if (isString(target) && !input) throw new TypeError(`ColorPicker target \"${target}\" cannot be found.`);\n this.input = input;\n\n const parent = closest(input, colorPickerParentSelector);\n if (!parent) throw new TypeError('ColorPicker requires a specific markup to work.');\n\n this.parent = parent;\n this.id = getUID(input, colorPickerString);\n this.dragElement = undefined;\n this.isOpen = false;\n this.controlPositions = {\n c1x: 0,\n c1y: 0,\n c2y: 0,\n c3y: 0,\n };\n // this.colorLabels = {};\n this.colorKeywords = false;\n this.colorPresets = false;\n\n // process options\n const { format, componentLabels, colorLabels, colorKeywords, colorPresets } = normalizeOptions(\n input,\n colorPickerDefaults,\n config || {},\n );\n\n let translatedColorLabels = colorNames;\n /* istanbul ignore else */\n if (isArray(colorLabels) && colorLabels.length === 17) {\n translatedColorLabels = colorLabels;\n } else if (isString(colorLabels) && colorLabels.split(',').length === 17) {\n translatedColorLabels = colorLabels.split(',');\n }\n\n // expose colour labels to all methods\n ObjectAssign(this.colorLabels, ObjectFromEntries(translatedColorLabels.map((c, i) => [colorNames[i], c])));\n\n // update and expose component labels\n const tempComponentLabels =\n isString(componentLabels) && isValidJSON(componentLabels)\n ? (JSON.parse(componentLabels) as ColorPickerLabels)\n : componentLabels;\n this.componentLabels = ObjectAssign({ ...colorPickerLabels }, tempComponentLabels);\n this.color = new Color(input.value || '#fff', format);\n this.format = format;\n\n // set colour defaults\n if (isArray(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords;\n } else if (isString(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords.split(',').map(x => x.trim());\n }\n\n // set colour presets\n if (isArray(colorPresets) && colorPresets.length) {\n this.colorPresets = colorPresets;\n } else if (colorPresets && isValidJSON(colorPresets)) {\n const { hue, hueSteps, lightSteps, saturation } = JSON.parse(colorPresets) as {\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n };\n this.colorPresets = new ColorPalette(hue, hueSteps, lightSteps, saturation);\n } else if (isString(colorPresets)) {\n this.colorPresets = colorPresets.split(',').map((x: string) => x.trim());\n }\n\n // generate markup\n setMarkup(this);\n\n const [colorPicker, colorMenu] = getElementsByClassName('color-dropdown', parent);\n // set main elements\n this.pickerToggle = querySelector('.picker-toggle', parent) as HTMLElement;\n this.menuToggle = querySelector('.menu-toggle', parent) as HTMLElement;\n this.colorPicker = colorPicker;\n this.colorMenu = colorMenu;\n this.inputs = [...getElementsByClassName('color-input', parent)] as HTMLInputElement[];\n const [controls] = getElementsByClassName('color-controls', parent);\n this.controls = controls;\n this.controlKnobs = [...getElementsByClassName('knob', controls)];\n this.visuals = [...getElementsByClassName('visual-control', controls)];\n\n // update colour picker controls, inputs and visuals\n this.update();\n // console.log(this)\n\n // add main events listeners\n toggleEvents(this, true);\n\n // set component data\n Data.set(input, colorPickerString, this);\n }\n\n /** Returns the current colour value */\n get value(): string {\n return this.input.value;\n }\n\n /**\n * Sets a new colour value.\n *\n * @param {string} v new colour value\n */\n set value(v: string) {\n this.input.value = v;\n }\n\n /** Check if the colour presets include any non-colour. */\n get hasNonColor(): boolean {\n return this.colorKeywords instanceof Array && this.colorKeywords.some(x => nonColors.includes(x));\n }\n\n /** Returns hexadecimal value of the current colour. */\n get hex(): string {\n return this.color.toHex(true);\n }\n\n /** Returns the current colour value in {h,s,v,a} object format. */\n get hsv(): HSVA {\n return this.color.toHsv();\n }\n\n /** Returns the current colour value in {h,s,l,a} object format. */\n get hsl(): HSLA {\n return this.color.toHsl();\n }\n\n /** Returns the current colour value in {h,w,b,a} object format. */\n get hwb(): HWBA {\n return this.color.toHwb();\n }\n\n /** Returns the current colour value in {r,g,b,a} object format. */\n get rgb(): RGBA {\n return this.color.toRgb();\n }\n\n /** Returns the current colour brightness. */\n get brightness(): number {\n return this.color.brightness;\n }\n\n /** Returns the current colour luminance. */\n get luminance(): number {\n return this.color.luminance;\n }\n\n /** Checks if the current colour requires a light text colour. */\n get isDark(): boolean {\n const { color, brightness } = this;\n return brightness < 120 && color.a > 0.33;\n }\n\n /** Checks if the current input value is a valid colour. */\n get isValid(): boolean {\n const inputValue = this.input.value;\n return inputValue !== '' && new Color(inputValue).isValid;\n }\n\n /** Returns the colour appearance, usually the closest colour name for the current value. */\n get appearance(): string {\n const { colorLabels, hsl, hsv, format } = this;\n\n const hue = roundPart(hsl.h * 360);\n const saturationSource = format === 'hsl' ? hsl.s : hsv.s;\n const saturation = roundPart(saturationSource * 100);\n const lightness = roundPart(hsl.l * 100);\n const hsvl = hsv.v * 100;\n\n let colorName = 'black';\n\n // determine color appearance\n /* istanbul ignore else */\n if (lightness === 100 && saturation === 0) {\n colorName = colorLabels.white;\n } else if (lightness === 0) {\n colorName = colorLabels.black;\n } else if (saturation === 0) {\n colorName = colorLabels.grey;\n } else if (hue < 15 || hue >= 345) {\n colorName = colorLabels.red;\n } else if (hue >= 15 && hue < 45) {\n colorName = hsvl > 80 && saturation > 80 ? colorLabels.orange : colorLabels.brown;\n } else if (hue >= 45 && hue < 75) {\n const isGold = hue > 46 && hue < 54 && hsvl < 80 && saturation > 90;\n const isOlive = hue >= 54 && hue < 75 && hsvl < 80;\n colorName = isGold ? colorLabels.gold : colorLabels.yellow;\n colorName = isOlive ? colorLabels.olive : colorName;\n } else if (hue >= 75 && hue < 155) {\n colorName = hsvl < 68 ? colorLabels.green : colorLabels.lime;\n } else if (hue >= 155 && hue < 175) {\n colorName = colorLabels.teal;\n } else if (hue >= 175 && hue < 195) {\n colorName = colorLabels.cyan;\n } else if (hue >= 195 && hue < 255) {\n colorName = colorLabels.blue;\n } else if (hue >= 255 && hue < 270) {\n colorName = colorLabels.violet;\n } else if (hue >= 270 && hue < 295) {\n colorName = colorLabels.magenta;\n } else if (hue >= 295 && hue < 345) {\n colorName = colorLabels.pink;\n }\n return colorName;\n }\n\n /** Updates `ColorPicker` visuals. */\n updateVisuals(): void {\n const { controlPositions, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { offsetHeight } = v1;\n const hue = controlPositions.c2y / offsetHeight;\n const { r, g, b } = new Color({ h: hue, s: 1, l: 0.5 }).toRgb();\n const whiteGrad = 'linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)';\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n const roundA = roundPart(alpha * 100) / 100;\n\n const fill = new Color({\n h: hue,\n s: 1,\n l: 0.5,\n a: alpha,\n }).toRgbString();\n const hueGradient = `linear-gradient(\n rgb(255,0,0) 0%, rgb(255,255,0) 16.67%,\n rgb(0,255,0) 33.33%, rgb(0,255,255) 50%,\n rgb(0,0,255) 66.67%, rgb(255,0,255) 83.33%,\n rgb(255,0,0) 100%)`;\n setElementStyle(v1, {\n background: `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,${roundA}) 100%),\n linear-gradient(to right, rgba(255,255,255,${roundA}) 0%, ${fill} 100%),\n ${whiteGrad}`,\n });\n setElementStyle(v2, { background: hueGradient });\n\n setElementStyle(v3, {\n background: `linear-gradient(rgba(${r},${g},${b},1) 0%,rgba(${r},${g},${b},0) 100%)`,\n });\n }\n\n /**\n * The `ColorPicker` *focusout* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleFocusOut = ({ relatedTarget }: FocusEvent & { relatedTarget: HTMLElement }): void => {\n if (relatedTarget && !this.parent.contains(relatedTarget)) {\n this.hide(true);\n }\n };\n\n /**\n * The `ColorPicker` *keyup* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleDismiss = ({ code }: KeyboardEvent): void => {\n if (this.isOpen && code === keyEscape) {\n this.hide();\n }\n };\n\n /**\n * The `ColorPicker` *scroll* event listener when open.\n *\n * @param e\n */\n handleScroll = (e: Event) => {\n const { activeElement } = getDocument(this.input);\n\n this.updateDropdownPosition();\n\n /* istanbul ignore next */\n if (\n ([pointermoveEvent, touchmoveEvent].includes(e.type) && this.dragElement) ||\n (activeElement && this.controlKnobs.includes(activeElement as HTMLElement))\n ) {\n e.stopPropagation();\n e.preventDefault();\n }\n };\n\n /**\n * The `ColorPicker` keyboard event listener for menu navigation.\n *\n * @param e\n */\n menuKeyHandler = (e: KeyboardEvent & { target: HTMLElement }) => {\n const { target, code } = e;\n const { previousElementSibling, nextElementSibling, parentElement } = target;\n const isColorOptionsMenu = parentElement && hasClass(parentElement, 'color-options');\n const allSiblings = parentElement ? [...parentElement.children] : [];\n const columnsCount =\n isColorOptionsMenu && getElementStyle(parentElement, 'grid-template-columns').split(' ').length;\n const currentIndex = allSiblings.indexOf(target);\n const previousElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex - columnsCount];\n const nextElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex + columnsCount];\n\n if ([keyArrowDown, keyArrowUp, keySpace].includes(code)) {\n // prevent scroll when navigating the menu via arrow keys / Space\n e.preventDefault();\n }\n if (isColorOptionsMenu) {\n if (previousElement && code === keyArrowUp) {\n focus(previousElement as HTMLElement);\n } else if (nextElement && code === keyArrowDown) {\n focus(nextElement as HTMLElement);\n } else if (previousElementSibling && code === keyArrowLeft) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && code === keyArrowRight) {\n focus(nextElementSibling as HTMLElement);\n }\n } else if (previousElementSibling && [keyArrowLeft, keyArrowUp].includes(code)) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && [keyArrowRight, keyArrowDown].includes(code)) {\n focus(nextElementSibling as HTMLElement);\n }\n\n if ([keyEnter, keySpace].includes(code)) {\n this.menuClickHandler(e);\n }\n };\n\n /**\n * The `ColorPicker` click event listener for the colour menu presets / defaults.\n *\n * @param e\n * @this {ColorPicker}\n */\n menuClickHandler = (e: Event) => {\n const { target } = e;\n const { colorMenu } = this;\n const newOption = (getAttribute(target as HTMLElement, 'data-value') || '').trim();\n // invalidate for targets other than color options\n if (!newOption.length) return;\n const currentActive = querySelector('li.active', colorMenu);\n let newColor = newOption;\n newColor = nonColors.includes(newColor) ? 'white' : newColor;\n newColor = newColor === 'transparent' ? 'rgba(0,0,0,0)' : newColor;\n\n const { r, g, b, a } = new Color(newColor);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n this.update();\n\n /* istanbul ignore else */\n if (currentActive !== target) {\n /* istanbul ignore else */\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n\n addClass(target as HTMLElement, 'active');\n setAttribute(target as HTMLElement, ariaSelected, 'true');\n\n if (nonColors.includes(newOption)) {\n this.value = newOption;\n }\n firePickerChange(this);\n }\n };\n\n /**\n * The `ColorPicker` *touchstart* / *mousedown* events listener for control knobs.\n *\n * @param e\n */\n pointerDown = (e: PointerEvent & { target: HTMLElement }) => {\n if (e.button !== 0) return;\n const { target, pageX, pageY } = e;\n const { colorMenu, visuals, controlKnobs } = this;\n const [v1, v2, v3] = visuals;\n const [c1, c2, c3] = controlKnobs;\n const visual = controlKnobs.includes(target) ? (target.previousElementSibling as HTMLElement) : target;\n const visualRect = getBoundingClientRect(visual);\n const html = getDocumentElement(v1);\n const offsetX = pageX - html.scrollLeft - visualRect.left;\n const offsetY = pageY - html.scrollTop - visualRect.top;\n\n /* istanbul ignore else */\n if (target === v1 || target === c1) {\n this.dragElement = visual;\n this.changeControl1(offsetX, offsetY);\n } else if (target === v2 || target === c2) {\n this.dragElement = visual;\n this.changeControl2(offsetY);\n } else if (target === v3 || target === c3) {\n this.dragElement = visual;\n this.changeAlpha(offsetY);\n }\n\n if (colorMenu) {\n const currentActive = querySelector('li.active', colorMenu);\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n }\n e.preventDefault();\n };\n\n /**\n * The `ColorPicker` *touchend* / *mouseup* events listener for control knobs.\n *\n * @param e\n * @this\n */\n pointerUp = ({ target }: PointerEvent & { target: HTMLElement }) => {\n const { parent } = this;\n const doc = getDocument(parent);\n const currentOpen = querySelector(`${colorPickerParentSelector}.open`, doc) !== null;\n const selection = doc.getSelection();\n\n if (!this.dragElement && (!selection || !selection.toString().length) && !parent.contains(target)) {\n this.hide(currentOpen);\n }\n\n this.dragElement = undefined;\n };\n\n /**\n * The `ColorPicker` *touchmove* / *mousemove* events listener for control knobs.\n *\n * @param {PointerEvent} e\n */\n pointerMove = (e: PointerEvent) => {\n const { dragElement, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { pageX, pageY } = e;\n\n if (!dragElement) return;\n\n const controlRect = getBoundingClientRect(dragElement);\n const win = getDocumentElement(v1);\n const offsetX = pageX - win.scrollLeft - controlRect.left;\n const offsetY = pageY - win.scrollTop - controlRect.top;\n\n if (dragElement === v1) {\n this.changeControl1(offsetX, offsetY);\n }\n\n if (dragElement === v2) {\n this.changeControl2(offsetY);\n }\n\n if (dragElement === v3) {\n this.changeAlpha(offsetY);\n }\n };\n\n /**\n * The `ColorPicker` *keydown* event listener for control knobs.\n *\n * @param e\n */\n handleKnobs = (e: Event & { code: string }) => {\n const { target, code } = e;\n\n // only react to arrow buttons\n if (![keyArrowUp, keyArrowDown, keyArrowLeft, keyArrowRight].includes(code)) return;\n e.preventDefault();\n\n const { controlKnobs, visuals } = this;\n const { offsetWidth, offsetHeight } = visuals[0];\n const [c1, c2, c3] = controlKnobs;\n const { activeElement } = getDocument(c1);\n const currentKnob = controlKnobs.find(x => x === activeElement);\n const yRatio = offsetHeight / 360;\n\n /* istanbul ignore else */\n if (currentKnob) {\n let offsetX = 0;\n let offsetY = 0;\n\n /* istanbul ignore else */\n if (target === c1) {\n const xRatio = offsetWidth / 100;\n\n /* istanbul ignore else */\n if ([keyArrowLeft, keyArrowRight].includes(code)) {\n this.controlPositions.c1x += code === keyArrowRight ? xRatio : -xRatio;\n } else if ([keyArrowUp, keyArrowDown].includes(code)) {\n this.controlPositions.c1y += code === keyArrowDown ? yRatio : -yRatio;\n }\n\n offsetX = this.controlPositions.c1x;\n offsetY = this.controlPositions.c1y;\n this.changeControl1(offsetX, offsetY);\n } else if (target === c2) {\n this.controlPositions.c2y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c2y;\n this.changeControl2(offsetY);\n } else if (target === c3) {\n this.controlPositions.c3y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c3y;\n this.changeAlpha(offsetY);\n }\n this.handleScroll(e);\n }\n };\n\n /** The event listener of the colour form inputs. */\n changeHandler = (): void => {\n let colorSource;\n const { inputs, format, value: currentValue, input, controlPositions, visuals } = this;\n const { activeElement } = getDocument(input);\n const { offsetHeight } = visuals[0];\n const [i1, , , i4] = inputs;\n const [v1, v2, v3, v4] =\n format === 'rgb'\n ? inputs.map(i => parseFloat(i.value) / (i === i4 ? 100 : 1))\n : inputs.map(i => parseFloat(i.value) / (i !== i1 ? 100 : 360));\n const isNonColorValue = this.hasNonColor && nonColors.includes(currentValue);\n const alpha = i4 ? v4 : 1 - controlPositions.c3y / offsetHeight;\n\n /* istanbul ignore else */\n if (activeElement === input || (activeElement && inputs.includes(activeElement as HTMLInputElement))) {\n if (activeElement === input) {\n if (isNonColorValue) {\n colorSource = currentValue === 'transparent' ? 'rgba(0,0,0,0)' : 'rgb(0,0,0)';\n } else {\n colorSource = currentValue;\n }\n } else if (format === 'hex') {\n colorSource = i1.value;\n } else if (format === 'hsl') {\n colorSource = {\n h: v1,\n s: v2,\n l: v3,\n a: alpha,\n };\n } else if (format === 'hwb') {\n colorSource = {\n h: v1,\n w: v2,\n b: v3,\n a: alpha,\n };\n } else {\n colorSource = {\n r: v1,\n g: v2,\n b: v3,\n a: alpha,\n };\n }\n\n const { r, g, b, a } = new Color(colorSource);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n this.setControlPositions();\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n\n // set non-color keyword\n if (activeElement === input && isNonColorValue) {\n this.value = currentValue;\n }\n }\n };\n\n /**\n * Updates `ColorPicker` first control:\n * * `lightness` and `saturation` for HEX/RGB;\n * * `lightness` and `hue` for HSL.\n *\n * @param X the X component of the offset\n * @param Y the Y component of the offset\n */\n changeControl1(X: number, Y: number): void {\n let [offsetX, offsetY] = [0, 0];\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n if (X > offsetWidth) offsetX = offsetWidth;\n else if (X >= 0) offsetX = X;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = controlPositions.c2y / offsetHeight;\n\n const saturation = offsetX / offsetWidth;\n\n const lightness = 1 - offsetY / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new positions\n this.controlPositions.c1x = offsetX;\n this.controlPositions.c1y = offsetY;\n\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` second control:\n * * `hue` for HEX/RGB/HWB;\n * * `saturation` for HSL.\n *\n * @param Y the Y offset\n */\n changeControl2(Y: number) {\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = offsetY / offsetHeight;\n const saturation = controlPositions.c1x / offsetWidth;\n const lightness = 1 - controlPositions.c1y / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new position\n this.controlPositions.c2y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` last control,\n * the `alpha` channel.\n *\n * @param Y\n */\n changeAlpha(Y: number) {\n const { visuals } = this;\n const { offsetHeight } = visuals[0];\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n // update color alpha\n const alpha = 1 - offsetY / offsetHeight;\n this.color.setAlpha(alpha);\n // update position\n this.controlPositions.c3y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` control positions on:\n * * initialization\n * * window resize\n */\n update = () => {\n this.updateDropdownPosition();\n this.updateAppearance();\n this.setControlPositions();\n this.updateInputs(true);\n this.updateControls();\n this.updateVisuals();\n };\n\n /** Updates the open dropdown position on *scroll* event. */\n updateDropdownPosition() {\n const { input, colorPicker, colorMenu } = this;\n const elRect = getBoundingClientRect(input);\n const { top, bottom } = elRect;\n const { offsetHeight: elHeight } = input;\n const windowHeight = getDocumentElement(input).clientHeight;\n const isPicker = hasClass(colorPicker, 'show');\n const dropdown = isPicker ? colorPicker : colorMenu;\n if (!dropdown) return;\n const { offsetHeight: dropHeight } = dropdown;\n const distanceBottom = windowHeight - bottom;\n const distanceTop = top;\n const bottomExceed = top + dropHeight + elHeight > windowHeight; // show\n const topExceed = top - dropHeight < 0; // show-top\n\n if ((hasClass(dropdown, 'bottom') || !topExceed) && distanceBottom < distanceTop && bottomExceed) {\n removeClass(dropdown, 'bottom');\n addClass(dropdown, 'top');\n } else {\n removeClass(dropdown, 'top');\n addClass(dropdown, 'bottom');\n }\n }\n\n /** Updates control knobs' positions. */\n setControlPositions() {\n const { visuals, color, hsv } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n const alpha = color.a;\n const hue = hsv.h;\n\n const saturation = hsv.s;\n const lightness = hsv.v;\n\n this.controlPositions.c1x = saturation * offsetWidth;\n this.controlPositions.c1y = (1 - lightness) * offsetHeight;\n this.controlPositions.c2y = hue * offsetHeight;\n this.controlPositions.c3y = (1 - alpha) * offsetHeight;\n }\n\n /** Update the visual appearance label and control knob labels. */\n updateAppearance() {\n const { componentLabels, color, parent, hsv, hex, format, controlKnobs } = this;\n const { appearanceLabel, hexLabel, valueLabel } = componentLabels;\n let { r, g, b } = color.toRgb();\n const [knob1, knob2, knob3] = controlKnobs;\n const hue = roundPart(hsv.h * 360);\n const alpha = color.a;\n const saturation = roundPart(hsv.s * 100);\n const lightness = roundPart(hsv.v * 100);\n const colorName = this.appearance;\n\n let colorLabel = `${hexLabel} ${hex.split('').join(' ')}`;\n\n if (format === 'hwb') {\n const { hwb } = this;\n const whiteness = roundPart(hwb.w * 100);\n const blackness = roundPart(hwb.b * 100);\n colorLabel = `HWB: ${hue}°, ${whiteness}%, ${blackness}%`;\n setAttribute(knob1, ariaValueText, `${whiteness}% & ${blackness}%`);\n setAttribute(knob1, ariaValueNow, `${whiteness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}%`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n } else {\n [r, g, b] = [r, g, b].map(roundPart);\n colorLabel = format === 'hsl' ? `HSL: ${hue}°, ${saturation}%, ${lightness}%` : colorLabel;\n colorLabel = format === 'rgb' ? `RGB: ${r}, ${g}, ${b}` : colorLabel;\n\n setAttribute(knob1, ariaValueText, `${lightness}% & ${saturation}%`);\n setAttribute(knob1, ariaValueNow, `${lightness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}°`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n }\n\n const alphaValue = roundPart(alpha * 100);\n setAttribute(knob3, ariaValueText, `${alphaValue}%`);\n setAttribute(knob3, ariaValueNow, `${alphaValue}`);\n\n // update the input backgroundColor\n const newColor = color.toString();\n setElementStyle(this.input, { backgroundColor: newColor });\n\n // toggle dark/light classes will also style the placeholder\n // dark sets color white, light sets color black\n // isDark ? '#000' : '#fff'\n if (!this.isDark) {\n if (hasClass(parent, 'txt-dark')) removeClass(parent, 'txt-dark');\n if (!hasClass(parent, 'txt-light')) addClass(parent, 'txt-light');\n } else {\n if (hasClass(parent, 'txt-light')) removeClass(parent, 'txt-light');\n if (!hasClass(parent, 'txt-dark')) addClass(parent, 'txt-dark');\n }\n }\n\n /** Updates the control knobs actual positions. */\n updateControls() {\n const { controlKnobs, controlPositions } = this;\n let { c1x, c1y, c2y, c3y } = controlPositions;\n const [control1, control2, control3] = controlKnobs;\n // round control positions\n [c1x, c1y, c2y, c3y] = [c1x, c1y, c2y, c3y].map(roundPart);\n\n setElementStyle(control1, {\n transform: `translate3d(${c1x - 4}px,${c1y - 4}px,0)`,\n });\n setElementStyle(control2, { transform: `translate3d(0,${c2y - 4}px,0)` });\n setElementStyle(control3, { transform: `translate3d(0,${c3y - 4}px,0)` });\n }\n\n /**\n * Updates all color form inputs.\n *\n * @param isPrevented when `true`, the component original event is prevented\n */\n updateInputs(isPrevented?: boolean) {\n const { value: oldColor, format, inputs, color, hsl } = this;\n const [i1, i2, i3, i4] = inputs;\n const alpha = roundPart(color.a * 100);\n const hue = roundPart(hsl.h * 360);\n let newColor = color.toString();\n\n /* istanbul ignore else */\n if (format === 'hex') {\n newColor = this.color.toHexString(true);\n i1.value = this.hex;\n } else if (format === 'hsl') {\n const lightness = roundPart(hsl.l * 100);\n const saturation = roundPart(hsl.s * 100);\n newColor = this.color.toHslString();\n i1.value = `${hue}`;\n i2.value = `${saturation}`;\n i3.value = `${lightness}`;\n i4.value = `${alpha}`;\n } else if (format === 'hwb') {\n const { w, b } = this.hwb;\n const whiteness = roundPart(w * 100);\n const blackness = roundPart(b * 100);\n\n newColor = this.color.toHwbString();\n i1.value = `${hue}`;\n i2.value = `${whiteness}`;\n i3.value = `${blackness}`;\n i4.value = `${alpha}`;\n } else if (format === 'rgb') {\n let { r, g, b } = this.rgb;\n [r, g, b] = [r, g, b].map(roundPart);\n\n newColor = this.color.toRgbString();\n i1.value = `${r}`;\n i2.value = `${g}`;\n i3.value = `${b}`;\n i4.value = `${alpha}`;\n }\n\n // update the color value\n this.value = newColor;\n\n // don't trigger the custom event unless it's really changed\n if (!isPrevented && newColor !== oldColor) {\n firePickerChange(this);\n }\n }\n\n /**\n * Toggle the `ColorPicker` dropdown visibility.\n *\n * @param e\n */\n togglePicker = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorPicker } = this;\n\n if (this.isOpen && hasClass(colorPicker, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorPicker);\n }\n };\n\n /** Shows the `ColorPicker` dropdown. */\n showPicker = () => {\n const { colorPicker } = this;\n\n if (!['top', 'bottom'].some(c => hasClass(colorPicker, c))) {\n showDropdown(this, colorPicker);\n }\n };\n\n /**\n * Toggles the visibility of the `ColorPicker` presets menu.\n *\n * @param e\n * @this {ColorPicker}\n */\n toggleMenu = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorMenu } = this;\n\n if (this.isOpen && hasClass(colorMenu, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorMenu);\n }\n };\n\n /**\n * Hides the currently open `ColorPicker` dropdown.\n *\n * @param {boolean=} focusPrevented\n */\n hide(focusPrevented?: boolean) {\n if (this.isOpen) {\n const { pickerToggle, menuToggle, colorPicker, colorMenu, parent, input } = this;\n const openPicker = hasClass(colorPicker, 'show');\n const openDropdown = openPicker ? colorPicker : colorMenu;\n const relatedBtn = openPicker ? pickerToggle : menuToggle;\n const animationDuration = openDropdown && getElementTransitionDuration(openDropdown);\n\n this.value = this.color.toString(true);\n\n /* istanbul ignore else */\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n setAttribute(relatedBtn, ariaExpanded, 'false');\n setTimeout(() => {\n removePosition(openDropdown);\n /* istanbul ignore else */\n if (!querySelector('.show', parent)) {\n removeClass(parent, 'open');\n toggleEventsOnShown(this);\n this.isOpen = false;\n }\n }, animationDuration);\n }\n\n if (!focusPrevented) {\n focus(pickerToggle);\n }\n setAttribute(input, tabindex, '-1');\n if (relatedBtn === menuToggle) {\n setAttribute(menuToggle, tabindex, '-1');\n }\n }\n }\n\n /** Removes `ColorPicker` from target ``. */\n dispose() {\n const { input, parent } = this;\n this.hide(true);\n toggleEvents(this);\n [...parent.children].forEach(el => {\n if (el !== input) el.remove();\n });\n\n removeAttribute(input, tabindex);\n setElementStyle(input, { backgroundColor: '' });\n\n ['txt-light', 'txt-dark'].forEach(c => removeClass(parent, c));\n Data.remove(input, colorPickerString);\n }\n}\n"],"names":["me","ge","Ee","Ae","ke","Me","K","P","_","tt","st","rt","it","St","kt","Mt","Ct","zt","Bt","Re","Qe","je","qe","Ye","$e","sn","Rt","U","fn","jt","A","qt","S","z","t","x","N","Gt","e","n","o","s","Jt","Kt","r","Xt","Yt","Tn","Cn","Ln","In","zn","v","i","u","E","L","Hn","k","W","R","d","M","Zt","$t","Q","g","ne","Qn","V","w","oe","jn","a","l","p","m","y","j","Kn","Zn","$n","I","to","h","T","B","H","b","ae","ro","ie","le","So","To","D","F","rr","tr","O","er","$","f","Z","c","J","G","X","C","Y","q","sr","ColorPalette","Color","args","hue","hueSteps","lightSteps","lightnessArray","saturation","colors","hueStep","half","steps1To13","lightSets","closestSet","set","lightStep","currentHue","newColor","colorPickerLabels","colorNames","isValidJSON","str","isString","vHidden","getColorForm","self","format","id","componentLabels","colorForm","createElement","components","toUpperCase","cID","formatLabel","cInputLabel","setAttribute","cInput","max","step","ObjectAssign","getColorControls","hueLabel","alphaLabel","lightnessLabel","saturationLabel","whitenessLabel","blacknessLabel","max1","max2","max3","ctrl1Label","ctrl2Label","colorControls","colorPointer","colorSlider","template","min","control","knob","getColorMenu","colorsSource","menuClass","input","defaultsLabel","presetsLabel","isOptionsMenu","isPalette","menuLabel","colorsArray","colorsCount","fit","isMultiLine","rowCountHover","rowCount","isScrollable","finalClass","gap","optionSize","menuHeight","menuHeightHover","menu","setElementStyle","value","label","isActive","getAttribute","option","setMarkup","parent","colorKeywords","colorPresets","colorValue","nonColors","toggleLabel","pickerLabel","hexLabel","color","formatString","pickerBtn","pickerDropdown","presetsDropdown","presetsBtn","xmlns","presetsIcon","createElementNS","ariaHidden","path","tabindex","colorPickerString","colorPickerSelector","colorPickerParentSelector","colorPickerDefaults","roundPart","getColorPickerInstance","element","getInstance","initColorPicker","ColorPicker","toggleEvents","action","on","off","pickerToggle","menuToggle","focusinEvent","mouseclickEvent","toggleEventsOnShown","colorMenu","doc","getDocument","win","getWindow","pointerdownEvent","keydownEvent","scrollEvent","resizeEvent","changeEvent","pointermoveEvent","pointerupEvent","focusoutEvent","keyupEvent","firePickerChange","dispatchEvent","removePosition","removeClass","showDropdown","dropdown","colorPicker","isPicker","openDropdown","activeBtn","nextBtn","hasClass","addClass","reflow","ariaExpanded","getBoundingClientRect","version","ObjectFromEntries","target","config","querySelector","closest","getUID","colorLabels","normalizeOptions","translatedColorLabels","isArray","tempComponentLabels","getElementsByClassName","controls","Data","brightness","inputValue","hsl","hsv","saturationSource","lightness","hsvl","colorName","isGold","isOlive","controlPositions","visuals","v1","v2","v3","offsetHeight","whiteGrad","alpha","roundA","fill","hueGradient","relatedTarget","code","keyEscape","activeElement","touchmoveEvent","previousElementSibling","nextElementSibling","parentElement","isColorOptionsMenu","allSiblings","columnsCount","getElementStyle","currentIndex","previousElement","nextElement","keyArrowDown","keyArrowUp","keySpace","focus","keyArrowLeft","keyArrowRight","keyEnter","newOption","currentActive","removeAttribute","ariaSelected","pageX","pageY","controlKnobs","c1","c2","c3","visual","visualRect","html","getDocumentElement","offsetX","offsetY","currentOpen","selection","dragElement","controlRect","offsetWidth","currentKnob","yRatio","xRatio","colorSource","inputs","currentValue","i1","i4","v4","isNonColorValue","elRect","top","bottom","elHeight","windowHeight","dropHeight","distanceBottom","distanceTop","bottomExceed","topExceed","hex","appearanceLabel","valueLabel","knob1","knob2","knob3","colorLabel","hwb","whiteness","blackness","ariaValueText","ariaValueNow","ariaDescription","alphaValue","c1x","c1y","c2y","c3y","control1","control2","control3","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,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,GACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,uBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,mBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,oBACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,CACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,MACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,MACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,CACH,EAAGC,GAAI,oBAAqB3D,GAAI,gBAAiBoE,GAAI,uBAA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AAa,MAAM,EACzCE,EAAeqI,EAAavI,EAAcpB,EAC1C4J,EAAaD,EAAahK,EAAeC,EACzCiK,EAAoBvI,GAAgBwI,GAA6BxI,CAAY,EAEnF,KAAK,MAAQ,KAAK,MAAM,SAAS,EAAI,EAGjCA,IACFL,EAAYK,EAAc,MAAM,EACnBlH,EAAAwP,EAAYhI,GAAc,OAAO,EAC9C,WAAW,IAAM,CACfZ,GAAeM,CAAY,EAEtBY,EAAc,QAASzE,CAAM,IAChCwD,EAAYxD,EAAQ,MAAM,EAC1BsC,GAAoB,IAAI,EACxB,KAAK,OAAS,KAEf8J,CAAiB,GAGjBH,GACHtE,EAAMzF,CAAY,EAEPvF,EAAA2B,EAAO6C,EAAU,IAAI,EAC9BgL,IAAehK,GACJxF,EAAAwF,EAAYhB,EAAU,IAAI,CAE3C,CACF,CAGA,SAAU,CACF,KAAA,CAAE,MAAA7C,EAAO,OAAA0B,CAAW,EAAA,KAC1B,KAAK,KAAK,EAAI,EACd8B,GAAa,IAAI,EACjB,CAAC,GAAG9B,EAAO,QAAQ,EAAE,QAAcsM,GAAA,CAC7BA,IAAOhO,GAAOgO,EAAG,OAAO,CAAA,CAC7B,EAEDrE,GAAgB3J,EAAO6C,CAAQ,EAC/B1B,EAAgBnB,EAAO,CAAE,gBAAiB,EAAI,CAAA,EAE7C,CAAA,YAAa,UAAU,EAAE,WAAakF,EAAYxD,EAAQjG,CAAC,CAAC,EACxDoL,GAAA,OAAO7G,EAAO8C,CAAiB,CACtC,CACF","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/dist/js/color-picker.js b/dist/js/color-picker.js index 4914ad2..bcb8404 100644 --- a/dist/js/color-picker.js +++ b/dist/js/color-picker.js @@ -1,8 +1,8 @@ -var ColorPicker=function(){"use strict";const W={},Gt=o=>{const{type:t,currentTarget:e}=o;[...W[t]].forEach(([s,r])=>{e===s&&[...r].forEach(([n,i])=>{n.apply(s,[o]),typeof i=="object"&&i.once&&Pt(s,t,n,i)})})},Ut=(o,t,e,s)=>{W[t]||(W[t]=new Map);const r=W[t];r.has(o)||r.set(o,new Map);const n=r.get(o),{size:i}=n;n.set(e,s),i||o.addEventListener(t,Gt,s)},Pt=(o,t,e,s)=>{const r=W[t],n=r&&r.get(o),i=n&&n.get(e),a=i!==void 0?i:s;n&&n.has(e)&&n.delete(e),r&&(!n||!n.size)&&r.delete(o),(!r||!r.size)&&delete W[t],(!n||!n.size)&&o.removeEventListener(t,Gt,a)},_t="aria-description",St="aria-expanded",Re="aria-hidden",Ct="aria-selected",tt="aria-valuenow",et="aria-valuetext",Oe="change",De="DOMContentLoaded",Fe="focusin",Ie="focusout",Wt="keydown",Ke="keyup",Lt="click",Ve="pointerdown",Jt="pointermove",Be="pointerup",je="resize",qe="scroll",ze="touchmove",j="ArrowDown",ot="ArrowUp",gt="ArrowLeft",G="ArrowRight",Ge="Enter",Ue="Escape",Zt="Space",_e="transitionDuration",We="transitionProperty",J="tabindex",Je=navigator.userAgentData,ut=Je,{userAgent:Ze}=navigator,bt=Ze,Xt=/iPhone|iPad|iPod|Android/i;ut?ut.brands.some(o=>Xt.test(o.brand)):Xt.test(bt);const Yt=/(iPhone|iPod|iPad)/;ut?ut.brands.some(o=>Yt.test(o.brand)):Yt.test(bt),bt&&bt.includes("Firefox");const{head:pt}=document;["webkitPerspective","perspective"].some(o=>o in pt.style);const Xe=(o,t,e,s)=>{const r=s||!1;o.addEventListener(t,e,r)},Ye=(o,t,e,s)=>{const r=s||!1;o.removeEventListener(t,e,r)},Qe=(o,t,e,s)=>{const r=n=>{(n.target===o||n.currentTarget===o)&&(e.apply(o,[n]),Ye(o,t,r,s))};Xe(o,t,r,s)},to=()=>{};(()=>{let o=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(o=!0,o)});Qe(document,De,to,t)}catch{}return o})(),["webkitTransform","transform"].some(o=>o in pt.style),["webkitAnimation","animation"].some(o=>o in pt.style),["webkitTransition","transition"].some(o=>o in pt.style);const dt=(o,t)=>o.getAttribute(t),m=(o,t,e)=>o.setAttribute(t,e),At=(o,t)=>o.removeAttribute(t),q=(o,...t)=>{o.classList.add(...t)},O=(o,...t)=>{o.classList.remove(...t)},M=(o,t)=>o.classList.contains(t),Ht=o=>o!=null&&typeof o=="object"||!1,Z=o=>Ht(o)&&typeof o.nodeType=="number"&&[1,2,3,4,5,6,7,8,9,10,11].some(t=>o.nodeType===t)||!1,st=o=>Z(o)&&o.nodeType===1||!1,X=new Map,rt={data:X,set:(o,t,e)=>{st(o)&&(X.has(t)||X.set(t,new Map),X.get(t).set(o,e))},getAllFor:o=>X.get(o)||null,get:(o,t)=>{if(!st(o)||!t)return null;const e=rt.getAllFor(t);return o&&e&&e.get(o)||null},remove:(o,t)=>{const e=rt.getAllFor(t);!e||!st(o)||(e.delete(o),e.size===0&&X.delete(t))}},eo=(o,t)=>rt.get(o,t),B=o=>typeof o=="string"||!1,oo=o=>Ht(o)&&o.constructor.name==="Window"||!1,Qt=o=>Z(o)&&o.nodeType===9||!1,F=o=>oo(o)?o.document:Qt(o)?o:Z(o)?o.ownerDocument:window.document,I=(o,...t)=>Object.assign(o,...t),x=o=>{if(!o)return;if(B(o))return F().createElement(o);const{tagName:t}=o,e=x(t);if(!e)return;const s={...o};return delete s.tagName,I(e,s)},Nt=(o,t)=>{if(!o||!t)return;if(B(t))return F().createElementNS(o,t);const{tagName:e}=t,s=Nt(o,e);if(!s)return;const r={...t};return delete r.tagName,I(s,r)},so=(o,t)=>o.dispatchEvent(t),Et=(o,t)=>{const e=getComputedStyle(o),s=t.replace("webkit","Webkit").replace(/([A-Z])/g,"-$1").toLowerCase();return e.getPropertyValue(s)},ro=o=>{const t=Et(o,We),e=Et(o,_e),s=e.includes("ms")?1:1e3,r=t&&t!=="none"?parseFloat(e)*s:0;return Number.isNaN(r)?0:r},U=(o,t)=>o.focus(t),te=o=>["true",!0].includes(o)?!0:["false",!1].includes(o)?!1:["null","",null,void 0].includes(o)?null:o!==""&&!Number.isNaN(+o)?+o:o,ft=o=>Object.entries(o),no=o=>o.toLowerCase(),io=(o,t,e,s)=>{const r={...e},n={...o.dataset},i={...t},a={},l="title";return ft(n).forEach(([c,h])=>{const b=s&&typeof c=="string"&&c.includes(s)?c.replace(s,"").replace(/[A-Z]/g,u=>no(u)):c;a[b]=te(h)}),ft(r).forEach(([c,h])=>{r[c]=te(h)}),ft(t).forEach(([c,h])=>{c in r?i[c]=r[c]:c in a?i[c]=a[c]:i[c]=c===l?dt(o,l):h}),i},ee=o=>Object.fromEntries(o),ao=o=>o.offsetHeight,D=(o,t)=>{ft(t).forEach(([e,s])=>{if(s&&B(e)&&e.includes("--"))o.style.setProperty(e,s);else{const r={};r[e]=s,I(o.style,r)}})},lo=o=>Ht(o)&&o.constructor.name==="Map"||!1,oe=o=>o.toUpperCase(),mt=(o,t)=>{const{width:e,height:s,top:r,right:n,bottom:i,left:a}=o.getBoundingClientRect();let l=1,c=1;if(t&&st(o)){const{offsetWidth:h,offsetHeight:b}=o;l=h>0?Math.round(e)/h:1,c=b>0?Math.round(s)/b:1}return{width:e/l,height:s/c,top:r/c,right:n/l,bottom:i/c,left:a/l,x:a/l,y:r/c}},Mt=o=>F(o).documentElement;let se=0,re=0;const Y=new Map,ne=(o,t)=>{let e=t?se:re;if(t){const s=ne(o),r=Y.get(s)||new Map;Y.has(s)||Y.set(s,r),lo(r)&&!r.has(t)?(r.set(t,e),se+=1):e=r.get(t)}else{const s=o.id||o;Y.has(s)?e=Y.get(s):(Y.set(s,e),re+=1)}return e},co=o=>{var t;return o?Qt(o)?o.defaultView:Z(o)?(t=o?.ownerDocument)==null?void 0:t.defaultView:o:window},Tt=o=>Array.isArray(o)||!1,ie=(o,t)=>o?o.closest(t)||ie(o.getRootNode().host,t):null,_=(o,t)=>st(o)?o:(Z(t)?t:F()).querySelector(o),nt=(o,t)=>(t&&Z(t)?t:F()).getElementsByClassName(o),Rt=["transparent","currentColor","inherit","revert","initial"],v=o=>{const t=Math.floor(o);return o-t<.5?t:Math.round(o)},vt=[["aliceblue",{r:240,g:248,b:255}],["antiquewhite",{r:250,g:235,b:215}],["aqua",{r:0,g:255,b:255}],["aquamarine",{r:127,g:255,b:212}],["azure",{r:240,g:255,b:255}],["beige",{r:245,g:245,b:220}],["bisque",{r:255,g:228,b:196}],["black",{r:0,g:0,b:0}],["blanchedalmond",{r:255,g:235,b:205}],["blue",{r:0,g:0,b:255}],["blueviolet",{r:138,g:43,b:226}],["brown",{r:165,g:42,b:42}],["burlywood",{r:222,g:184,b:135}],["cadetblue",{r:95,g:158,b:160}],["chartreuse",{r:127,g:255,b:0}],["chocolate",{r:210,g:105,b:30}],["coral",{r:255,g:127,b:80}],["cornflowerblue",{r:100,g:149,b:237}],["cornsilk",{r:255,g:248,b:220}],["crimson",{r:220,g:20,b:60}],["cyan",{r:0,g:255,b:255}],["darkblue",{r:0,g:0,b:139}],["darkcyan",{r:0,g:139,b:139}],["darkgoldenrod",{r:184,g:134,b:11}],["darkgray",{r:169,g:169,b:169}],["darkgreen",{r:0,g:100,b:0}],["darkgrey",{r:169,g:169,b:169}],["darkkhaki",{r:189,g:183,b:107}],["darkmagenta",{r:139,g:0,b:139}],["darkolivegreen",{r:85,g:107,b:47}],["darkorange",{r:255,g:140,b:0}],["darkorchid",{r:153,g:50,b:204}],["darkred",{r:139,g:0,b:0}],["darksalmon",{r:233,g:150,b:122}],["darkseagreen",{r:143,g:188,b:143}],["darkslateblue",{r:72,g:61,b:139}],["darkslategray",{r:47,g:79,b:79}],["darkslategrey",{r:47,g:79,b:79}],["darkturquoise",{r:0,g:206,b:209}],["darkviolet",{r:148,g:0,b:211}],["deeppink",{r:255,g:20,b:147}],["deepskyblue",{r:0,g:191,b:255}],["dimgray",{r:105,g:105,b:105}],["dimgrey",{r:105,g:105,b:105}],["dodgerblue",{r:30,g:144,b:255}],["firebrick",{r:178,g:34,b:34}],["floralwhite",{r:255,g:250,b:240}],["forestgreen",{r:34,g:139,b:34}],["fuchsia",{r:255,g:0,b:255}],["gainsboro",{r:220,g:220,b:220}],["ghostwhite",{r:248,g:248,b:255}],["goldenrod",{r:218,g:165,b:32}],["gold",{r:255,g:215,b:0}],["gray",{r:128,g:128,b:128}],["green",{r:0,g:128,b:0}],["greenyellow",{r:173,g:255,b:47}],["grey",{r:128,g:128,b:128}],["honeydew",{r:240,g:255,b:240}],["hotpink",{r:255,g:105,b:180}],["indianred",{r:205,g:92,b:92}],["indigo",{r:75,g:0,b:130}],["ivory",{r:255,g:255,b:240}],["khaki",{r:240,g:230,b:140}],["lavenderblush",{r:255,g:240,b:245}],["lavender",{r:230,g:230,b:250}],["lawngreen",{r:124,g:252,b:0}],["lemonchiffon",{r:255,g:250,b:205}],["lightblue",{r:173,g:216,b:230}],["lightcoral",{r:240,g:128,b:128}],["lightcyan",{r:224,g:255,b:255}],["lightgoldenrodyellow",{r:250,g:250,b:210}],["lightgray",{r:211,g:211,b:211}],["lightgreen",{r:144,g:238,b:144}],["lightgrey",{r:211,g:211,b:211}],["lightpink",{r:255,g:182,b:193}],["lightsalmon",{r:255,g:160,b:122}],["lightseagreen",{r:32,g:178,b:170}],["lightskyblue",{r:135,g:206,b:250}],["lightslategray",{r:119,g:136,b:153}],["lightslategrey",{r:119,g:136,b:153}],["lightsteelblue",{r:176,g:196,b:222}],["lightyellow",{r:255,g:255,b:224}],["lime",{r:0,g:255,b:0}],["limegreen",{r:50,g:205,b:50}],["linen",{r:250,g:240,b:230}],["magenta",{r:255,g:0,b:255}],["maroon",{r:128,g:0,b:0}],["mediumaquamarine",{r:102,g:205,b:170}],["mediumblue",{r:0,g:0,b:205}],["mediumorchid",{r:186,g:85,b:211}],["mediumpurple",{r:147,g:112,b:219}],["mediumseagreen",{r:60,g:179,b:113}],["mediumslateblue",{r:123,g:104,b:238}],["mediumspringgreen",{r:0,g:250,b:154}],["mediumturquoise",{r:72,g:209,b:204}],["mediumvioletred",{r:199,g:21,b:133}],["midnightblue",{r:25,g:25,b:112}],["mintcream",{r:245,g:255,b:250}],["mistyrose",{r:255,g:228,b:225}],["moccasin",{r:255,g:228,b:181}],["navajowhite",{r:255,g:222,b:173}],["navy",{r:0,g:0,b:128}],["oldlace",{r:253,g:245,b:230}],["olive",{r:128,g:128,b:0}],["olivedrab",{r:107,g:142,b:35}],["orange",{r:255,g:165,b:0}],["orangered",{r:255,g:69,b:0}],["orchid",{r:218,g:112,b:214}],["palegoldenrod",{r:238,g:232,b:170}],["palegreen",{r:152,g:251,b:152}],["paleturquoise",{r:175,g:238,b:238}],["palevioletred",{r:219,g:112,b:147}],["papayawhip",{r:255,g:239,b:213}],["peachpuff",{r:255,g:218,b:185}],["peru",{r:205,g:133,b:63}],["pink",{r:255,g:192,b:203}],["plum",{r:221,g:160,b:221}],["powderblue",{r:176,g:224,b:230}],["purple",{r:128,g:0,b:128}],["rebeccapurple",{r:102,g:51,b:153}],["red",{r:255,g:0,b:0}],["rosybrown",{r:188,g:143,b:143}],["royalblue",{r:65,g:105,b:225}],["saddlebrown",{r:139,g:69,b:19}],["salmon",{r:250,g:128,b:114}],["sandybrown",{r:244,g:164,b:96}],["seagreen",{r:46,g:139,b:87}],["seashell",{r:255,g:245,b:238}],["sienna",{r:160,g:82,b:45}],["silver",{r:192,g:192,b:192}],["skyblue",{r:135,g:206,b:235}],["slateblue",{r:106,g:90,b:205}],["slategray",{r:112,g:128,b:144}],["slategrey",{r:112,g:128,b:144}],["snow",{r:255,g:250,b:250}],["springgreen",{r:0,g:255,b:127}],["steelblue",{r:70,g:130,b:180}],["tan",{r:210,g:180,b:140}],["teal",{r:0,g:128,b:128}],["thistle",{r:216,g:191,b:216}],["tomato",{r:255,g:99,b:71}],["turquoise",{r:64,g:224,b:208}],["violet",{r:238,g:130,b:238}],["wheat",{r:245,g:222,b:179}],["white",{r:255,g:255,b:255}],["whitesmoke",{r:245,g:245,b:245}],["yellow",{r:255,g:255,b:0}],["yellowgreen",{r:154,g:205,b:50}]],ae="deg|rad|grad|turn",le="[-\\+]?\\d+%?",ce="[-\\+]?\\d*\\.\\d+%?",he=`[-\\+]?\\d*\\.?\\d+(?:${ae})?`,wt=`(?:${ce})|(?:${le})`,Ot=`(?:${wt})|(?:${he}?)`,ho="(?:[\\s|\\(\\s|\\s\\(\\s]+)?",go="(?:[\\s|\\)\\s]+)?",ge="(?:[,|\\s]+)",uo="(?:[,|\\/\\s]*)?",it=`${ho}(${Ot})${ge}(${wt})${ge}(${wt})${uo}(${wt})?${go}`,K={CSS_UNIT:new RegExp(Ot),ANGLES:ae,CSS_ANGLE:he,CSS_INTEGER:le,CSS_NUMBER:ce,CSS_UNIT2:Ot,PERMISSIVE_MATCH:it,hwb:new RegExp(`hwb${it}`),rgb:new RegExp(`rgb(?:a)?${it}`),hsl:new RegExp(`hsl(?:a)?${it}`),hsv:new RegExp(`hsv(?:a)?${it}`),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/},ue=o=>Rt.includes(o),at=(o,t)=>o!==null&&typeof o=="object"&&Object.keys(t).every(e=>e in o),be=o=>`${o}`.includes(".")&&parseFloat(o)===1,$t=o=>typeof o=="string"&&o.includes("%"),L=o=>!!K.CSS_UNIT.exec(`${o}`),pe=["rgb","hex","hsl","hsv","hwb"],de=o=>Rt.includes(o)||["#",...pe].some(t=>o.includes(t))?!1:vt.some(([t])=>o===t),T=(o,t)=>{let e=o;if(typeof o=="number"&&Math.min(o,0)===0&&Math.max(o,1)===1)return o;be(o)&&(e="100%");const s=$t(e);return e=t===360?parseFloat(e):Math.min(t,Math.max(0,parseFloat(e))),s&&(e=e*t/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/t:e=e%t/t,e)},Dt=o=>{let t=parseFloat(o);return(Number.isNaN(t)||t<0||t>1)&&(t=1),t},kt=o=>Math.min(1,Math.max(0,o)),z=o=>o.length===1?`0${o}`:String(o),fe=o=>{const[[,t]]=vt.filter(([e])=>e===o.toLowerCase());return t},A=o=>parseInt(o,16),Ft=o=>A(o)/255,me=o=>v(o*255).toString(16),ve=(o,t,e)=>{const s=Math.max(o,t,e),r=Math.min(o,t,e);let n=0,i=0;const a=(s+r)/2;if(s===r)i=0,n=0;else{const l=s-r;i=a>.5?l/(2-s-r):l/(s+r),s===o&&(n=(t-e)/l+(t{let s=e;return s<0&&(s+=1),s>1&&(s-=1),s<1/6?o+(t-o)*(6*s):s<1/2?t:s<2/3?o+(t-o)*(2/3-s)*6:o},lt=(o,t,e)=>{let s=0,r=0,n=0;if(t===0)r=e,n=e,s=e;else if(e){const i=e<.5?e*(1+t):e+t-e*t,a=2*e-i;s=yt(a,i,o+1/3),r=yt(a,i,o),n=yt(a,i,o-1/3)}return{r:s,g:r,b:n}},we=(o,t,e)=>{let s=0,r=0;const n=Math.min(o,t,e),i=Math.max(o,t,e),a=1-i;if(i===n)return{h:0,w:n,b:a};o===n?(s=t-e,r=3):(s=t===n?e-o:o-t,r=t===n?5:1);const l=(r-s/(i-n))/6;return{h:l===1?0:l,w:n,b:a}},$e=(o,t,e)=>{if(t+e>=1){const i=t/(t+e);return{r:i,g:i,b:i}}let{r:s,g:r,b:n}=lt(o,1,.5);return[s,r,n]=[s,r,n].map(i=>i*(1-t-e)+t),{r:s,g:r,b:n}},ke=(o,t,e)=>{const s=Math.max(o,t,e),r=Math.min(o,t,e);let n=0;const i=s,a=s-r,l=s===0?0:a/s;return s===r?n=0:(o===s&&(n=(t-e)/a+(t{const s=o*6,r=t,n=e,i=Math.floor(s),a=s-i,l=n*(1-r),c=n*(1-a*r),h=n*(1-(1-a)*r),b=i%6,u=[n,c,l,l,h,n][b],d=[h,n,n,c,l,l][b],g=[l,l,h,n,n,c][b];return{r:u,g:d,b:g}},ye=(o,t,e,s)=>{const r=[z(v(o).toString(16)),z(v(t).toString(16)),z(v(e).toString(16))];return s&&r[0].charAt(0)===r[0].charAt(1)&&r[1].charAt(0)===r[1].charAt(1)&&r[2].charAt(0)===r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")},Kt=(o,t,e,s,r)=>{const n=[z(v(o).toString(16)),z(v(t).toString(16)),z(v(e).toString(16)),z(me(s))];return r&&n[0].charAt(0)===n[0].charAt(1)&&n[1].charAt(0)===n[1].charAt(1)&&n[2].charAt(0)===n[2].charAt(1)&&n[3].charAt(0)===n[3].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0)+n[3].charAt(0):n.join("")},xe=o=>{const t=String(o).trim().toLowerCase();if(de(t))return Object.assign(fe(t),{a:1,format:"rgb",ok:!0});if(ue(t))return{r:0,g:0,b:0,a:t==="transparent"?0:1,format:"rgb",ok:!0};let[,e,s,r,n]=K.rgb.exec(t)||[];return e&&s&&r?{r:e,g:s,b:r,a:n!==void 0?n:1,format:"rgb",ok:!0}:([,e,s,r,n]=K.hsl.exec(t)||[],e&&s&&r?{h:e,s,l:r,a:n!==void 0?n:1,format:"hsl",ok:!0}:([,e,s,r,n]=K.hsv.exec(t)||[],e&&s&&r?{h:e,s,v:r,a:n!==void 0?n:1,format:"hsv",ok:!0}:([,e,s,r,n]=K.hwb.exec(t)||[],e&&s&&r?{h:e,w:s,b:r,a:n!==void 0?n:1,format:"hwb",ok:!0}:([,e,s,r,n]=K.hex8.exec(t)||[],e&&s&&r&&n?{r:A(e),g:A(s),b:A(r),a:Ft(n),format:"hex",ok:!0}:([,e,s,r]=K.hex6.exec(t)||[],e&&s&&r?{r:A(e),g:A(s),b:A(r),a:1,format:"hex",ok:!0}:([,e,s,r,n]=K.hex4.exec(t)||[],e&&s&&r&&n?{r:A(e+e),g:A(s+s),b:A(r+r),a:Ft(n+n),format:"hex",ok:!0}:([,e,s,r]=K.hex3.exec(t)||[],e&&s&&r?{r:A(e+e),g:A(s+s),b:A(r+r),a:1,format:"hex",ok:!0}:{r:0,g:0,b:0,a:1,format:"rgb",ok:!o})))))))},Pe=o=>{let t={r:0,g:0,b:0},e=o,s=1,r,n,i,a,l,c,h,b,u="rgb",d=!1;return(!e||typeof e=="string")&&(e=xe(e),d=e.ok),at(e,t)&&L(e.r)&&L(e.g)&&L(e.b)&&({r:h,g:b,b:l}=e,[h,b,l]=[h,b,l].map(g=>T(g,$t(g)?100:255)),t={r:h,g:b,b:l},u="format"in e?e.format:"rgb"),at(e,{h:0,s:0,v:0})&&L(e.h)&&L(e.s)&&L(e.v)&&({h:c,s:r,v:n}=e,c=T(c,360),r=T(r,100),n=T(n,100),t=It(c,r,n),u="hsv"),at(e,{h:0,s:0,l:0})&&L(e.h)&&L(e.s)&&L(e.l)&&({h:c,s:r,l:i}=e,c=T(c,360),r=T(r,100),i=T(i,100),t=lt(c,r,i),u="hsl"),at(e,{h:0,w:0,b:0})&&L(e.h)&&L(e.w)&&L(e.b)&&({h:c,w:a,b:l}=e,c=T(c,360),a=T(a,100),l=T(l,100),t=$e(c,a,l),u="hwb"),L(e.a)&&(s=e.a,s=$t(s)||parseFloat(`${s}`)>1?T(s,100):s),{r:t.r,g:t.g,b:t.b,a:Dt(s),format:u,ok:d}},bo="1.0.8";class k{static matchers=K;static isOnePointZero=be;static isPercentage=$t;static isValidCSSUnit=L;static isNonColor=ue;static isColorName=de;static isColorType=at;static pad2=z;static clamp01=kt;static bound01=T;static boundAlpha=Dt;static getRGBFromName=fe;static convertHexToDecimal=Ft;static convertDecimalToHex=me;static rgbToHsl=ve;static rgbToHex=ye;static rgbToHsv=ke;static rgbToHwb=we;static rgbaToHex=Kt;static hslToRgb=It;static hsvToRgb=It;static hueToRgb=yt;static hwbToRgb=$e;static parseIntFromHex=A;static stringInputToObject=xe;static inputToRGB=Pe;static roundPart=v;static webColors=vt;static nonColors=Rt;static version=bo;r;g;b;a;format;ok;originalInput;constructor(t,e){const s=e&&pe.includes(e)?e:"",{r,g:n,b:i,a,ok:l,format:c}=Pe(t);this.originalInput=t,this.r=r,this.g=n,this.b=i,this.a=a,this.ok=l,this.format=s||c}get isValid(){return this.ok}get isDark(){return this.brightness<120}get luminance(){const{r:t,g:e,b:s}=this;let r=0,n=0,i=0;return t<=.03928?r=t/12.92:r=((t+.055)/1.055)**2.4,e<=.03928?n=e/12.92:n=((e+.055)/1.055)**2.4,s<=.03928?i=s/12.92:i=((s+.055)/1.055)**2.4,.2126*r+.7152*n+.0722*i}get brightness(){const{r:t,g:e,b:s}=this.toRgb();return(t*299+e*587+s*114)/1e3}get name(){const{r:t,g:e,b:s}=this.toRgb(),[r]=vt.map(([n,i])=>{const a=(((i.r-t)*.3)**2+((i.g-e)*.6)**2+((i.b-s)*.1)**2)**.5;return[n,a]}).find(([,n],i,a)=>n===Math.min(...a.map(([,l])=>l)));return r}toRgb(){let{r:t,g:e,b:s,a:r}=this;return[t,e,s]=[t,e,s].map(n=>v(n*255*100)/100),r=v(r*100)/100,{r:t,g:e,b:s,a:r}}toRgbString(){const{r:t,g:e,b:s,a:r}=this.toRgb(),[n,i,a]=[t,e,s].map(v);return r===1?`rgb(${n}, ${i}, ${a})`:`rgba(${n}, ${i}, ${a}, ${r})`}toRgbCSS4String(){const{r:t,g:e,b:s,a:r}=this.toRgb(),[n,i,a]=[t,e,s].map(v),l=r===1?"":` / ${v(r*100)}%`;return`rgb(${n} ${i} ${a}${l})`}toHex(t){const{r:e,g:s,b:r,a:n}=this.toRgb();return n===1?ye(e,s,r,t):Kt(e,s,r,n,t)}toHexString(t){return`#${this.toHex(t)}`}toHex8(t){const{r:e,g:s,b:r,a:n}=this.toRgb();return Kt(e,s,r,n,t)}toHex8String(t){return`#${this.toHex8(t)}`}toHsv(){const{r:t,g:e,b:s,a:r}=this,{h:n,s:i,v:a}=ke(t,e,s);return{h:n,s:i,v:a,a:r}}toHsl(){const{r:t,g:e,b:s,a:r}=this,{h:n,s:i,l:a}=ve(t,e,s);return{h:n,s:i,l:a,a:r}}toHslString(){let{h:t,s:e,l:s,a:r}=this.toHsl();return t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100)/100,r===1?`hsl(${t}, ${e}%, ${s}%)`:`hsla(${t}, ${e}%, ${s}%, ${r})`}toHslCSS4String(){let{h:t,s:e,l:s,a:r}=this.toHsl();t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100);const n=r<100?` / ${v(r)}%`:"";return`hsl(${t}deg ${e}% ${s}%${n})`}toHwb(){const{r:t,g:e,b:s,a:r}=this,{h:n,w:i,b:a}=we(t,e,s);return{h:n,w:i,b:a,a:r}}toHwbString(){let{h:t,w:e,b:s,a:r}=this.toHwb();t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100);const n=r<100?` / ${v(r)}%`:"";return`hwb(${t}deg ${e}% ${s}%${n})`}setAlpha(t){return typeof t!="number"?this:(this.a=Dt(t),this)}saturate(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=lt(e,kt(s+t/100),r);return Object.assign(this,{r:n,g:i,b:a}),this}desaturate(t){return typeof t=="number"?this.saturate(-t):this}greyscale(){return this.saturate(-100)}lighten(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=lt(e,s,kt(r+t/100));return Object.assign(this,{r:n,g:i,b:a}),this}darken(t){return typeof t=="number"?this.lighten(-t):this}spin(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=lt(kt((e*360+t)%360/360),s,r);return Object.assign(this,{r:n,g:i,b:a}),this}clone(){return new k(this)}toString(t){const{format:e}=this;return e==="hex"?this.toHexString(t):e==="hsl"?this.toHslString():e==="hwb"?this.toHwbString():this.toRgbString()}}class Vt{static Color=k;hue;hueSteps;lightSteps;saturation;colors;constructor(...t){let e=0,s=12,r=10,n=[.5],i=100;if(t.length===4)[e,s,r,i]=t;else if(t.length===3)[e,s,r]=t;else if(t.length===2&&([s,r]=t,[s,r].some(g=>g<1)))throw TypeError("ColorPalette: the two minimum arguments must be numbers higher than 0.");const a=[],l=360/s,c=k.roundPart((r-(r%2?1:0))/2),h=[.25,.2,.15,.11,.09,.075],b=[[1,2,3],[4,5],[6,7],[8,9],[10,11],[12,13]],u=b.find(g=>g.includes(r)),d=u?h[b.indexOf(u)]:100/(r+(r%2?0:1))/100;for(let g=1;g{const w=new k({h:p,s:1,l:f});a.push(i<100?w.saturate(i-100):w)})}this.hue=e,this.hueSteps=s,this.lightSteps=r,this.saturation=i,this.colors=a}}const Bt={pickerLabel:"Colour Picker",appearanceLabel:"Colour Appearance",valueLabel:"Colour Value",toggleLabel:"Select Colour",presetsLabel:"Colour Presets",defaultsLabel:"Colour Defaults",formatLabel:"Format",alphaLabel:"Alpha",hexLabel:"Hexadecimal",hueLabel:"Hue",whitenessLabel:"Whiteness",blacknessLabel:"Blackness",saturationLabel:"Saturation",lightnessLabel:"Lightness",redLabel:"Red",greenLabel:"Green",blueLabel:"Blue"},ct=["white","black","grey","red","orange","brown","gold","olive","yellow","lime","green","teal","cyan","blue","violet","magenta","pink"],Se=o=>{if(!B(o))return!1;try{JSON.parse(o)}catch{return!1}return!0},jt="v-hidden",po=o=>{const{format:t,id:e,componentLabels:s}=o,r=x({tagName:"div",className:`color-form ${t}`});let n=["hex"];return t==="rgb"?n=["red","green","blue","alpha"]:t==="hsl"?n=["hue","saturation","lightness","alpha"]:t==="hwb"&&(n=["hue","whiteness","blackness","alpha"]),n.forEach(i=>{const[a]=t==="hex"?["#"]:oe(i).split(""),l=`color_${t}_${i}_${e}`,c=s[`${i}Label`],h=x({tagName:"label"});m(h,"for",l),h.append(x({tagName:"span",ariaHidden:"true",innerText:`${a}:`}),x({tagName:"span",className:jt,innerText:c}));const b=x({tagName:"input",id:l,type:t==="hex"?"text":"number",value:i==="alpha"?"100":"0",className:`color-input ${i}`,autocomplete:"off",spellcheck:!1});let u="100",d="1";i!=="alpha"&&(t==="rgb"?(u="255",d="1"):i==="hue"&&(u="360",d="1")),I(b,{min:"0",max:u,step:d}),r.append(h,b)}),r},fo=o=>{const{format:t,componentLabels:e}=o,{hueLabel:s,alphaLabel:r,lightnessLabel:n,saturationLabel:i,whitenessLabel:a,blacknessLabel:l}=e,c=t==="hsl"?360:100,h=t==="hsl"?100:360,b=100;let u=t==="hsl"?`${s} & ${n}`:`${n} & ${i}`;u=t==="hwb"?`${a} & ${l}`:u;const d=t==="hsl"?`${i}`:`${s}`,g=x({tagName:"div",className:`color-controls ${t}`}),p="color-pointer",f="color-slider";return[{i:1,c:p,l:u,min:0,max:c},{i:2,c:f,l:d,min:0,max:h},{i:3,c:f,l:r,min:0,max:b}].forEach($=>{const{i:P,c:H,l:S,min:C,max:R}=$,E=x({tagName:"div",className:"color-control",role:"presentation"});E.append(x({tagName:"div",className:`visual-control visual-control${P}`}));const N=x({tagName:"div",className:`${H} knob`,ariaLive:"polite",ariaLabel:S,role:"slider",tabIndex:0,ariaValueMin:`${C}`,ariaValueMax:`${R}`});E.append(N),g.append(E)}),g},Ce=(o,t,e)=>{const{input:s,format:r,componentLabels:n}=o,{defaultsLabel:i,presetsLabel:a}=n,l=e==="color-options",c=t instanceof Vt,h=l?a:i,b=c?t.colors:t,u=b.length,{lightSteps:d}=c?t:{lightSteps:null},g=d||[9,10].find(N=>u>=N*2&&!(u%N))||5,p=l&&u>g;let f=2;f=p&&u>g*2?3:f,f=p&&u>g*3?4:f,f=p&&u>g*4?5:f;const w=f-(u<=g*3?1:2),$=p&&u>w*g;let P=e;P+=$?" scrollable":"",P+=p?" multiline":"";const H=p?"1px":"0.25rem";let S=p?1.75:2;S=g>5&&p?1.5:S;const C=`${w*S}rem`,R=`calc(${f} * ${S}rem + ${f-1} * ${H})`,E=x({tagName:"ul",className:P,role:"listbox",ariaLabel:h});return $&&D(E,{"--grid-item-size":`${S}rem`,"--grid-fit":`${g}`,"--grid-gap":H,"--grid-height":C,"--grid-hover-height":R}),b.forEach(N=>{let[V,ht]=typeof N=="string"?N.trim().split(":"):[];N instanceof k&&(V=N.toHexString(),ht=V);const Te=new k(N instanceof k?N:V,r).toString()===dt(s,"value"),zt=x({tagName:"li",className:`color-option${Te?" active":""}`,innerText:`${ht||V}`,tabIndex:0,role:"option",ariaSelected:Te?"true":"false"});m(zt,"data-value",`${V}`),l&&D(zt,{backgroundColor:V}),E.append(zt)}),E},mo=o=>{const{input:t,parent:e,format:s,id:r,componentLabels:n,colorKeywords:i,colorPresets:a}=o,l=dt(t,"value")||"#fff",{nonColors:c}=k,{toggleLabel:h,pickerLabel:b,formatLabel:u,hexLabel:d}=n,g=c.includes(l)?"#fff":l;o.color=new k(g,s);const p=s==="hex"?d:oe(s),f=x({id:`picker-btn-${r}`,tagName:"button",className:"picker-toggle btn-appearance",ariaExpanded:"false",ariaHasPopup:"true"});f.append(x({tagName:"span",className:jt,innerText:`${b}. ${u}: ${p}`}));const w=x({tagName:"div",className:"color-dropdown picker",role:"group",ariaLabelledBy:`picker-btn-${r}`}),$=fo(o),P=po(o);if(w.append($,P),t.before(f),e.append(w),i||a){const H=x({tagName:"div",className:"color-dropdown scrollable menu"});a&&H.append(Ce(o,a,"color-options")),i&&i.length&&H.append(Ce(o,i,"color-defaults"));const S=x({tagName:"button",className:"menu-toggle btn-appearance",tabIndex:-1,ariaExpanded:"false",ariaHasPopup:"true"}),C=encodeURI("http://www.w3.org/2000/svg"),R=Nt(C,{tagName:"svg"});m(R,"xmlns",C),m(R,"viewBox","0 0 512 512"),m(R,Re,"true");const E=Nt(C,{tagName:"path"});m(E,"d","M98,158l157,156L411,158l27,27L255,368L71,185L98,158z"),m(E,"fill","#fff"),R.append(E),S.append(x({tagName:"span",className:jt,innerText:`${h}`}),R),e.append(S,H)}i&&c.includes(l)&&(o.value=l),m(t,J,"-1")},vo="2.0.0-alpha9",Q="color-picker",wo=`[data-function="${Q}"]`,Le=`.${Q}`,$o={componentLabels:Bt,colorLabels:ct,format:"rgb",colorPresets:!1,colorKeywords:!1},{roundPart:y,nonColors:xt}=k,ko=o=>eo(o,Q),yo=o=>new Me(o),Ae=(o,t)=>{const e=t?Ut:Pt,{input:s,pickerToggle:r,menuToggle:n}=o;e(s,Fe,o.showPicker),e(r,Lt,o.togglePicker),n&&e(n,Lt,o.toggleMenu)},He=(o,t)=>{const e=t?Ut:Pt,{input:s,colorMenu:r,parent:n}=o,i=F(s),a=co(i);e(o.controls,Ve,o.pointerDown),o.controlKnobs.forEach(l=>e(l,Wt,o.handleKnobs)),e(a,qe,o.handleScroll),e(a,je,o.update),[s,...o.inputs].forEach(l=>e(l,Oe,o.changeHandler)),r&&(e(r,Lt,o.menuClickHandler),e(r,Wt,o.menuKeyHandler)),e(i,Jt,o.pointerMove),e(i,Be,o.pointerUp),e(n,Ie,o.handleFocusOut),e(i,Ke,o.handleDismiss)},Ne=o=>{so(o.input,new CustomEvent("colorpicker.change"))},Ee=o=>{o&&["bottom","top"].forEach(t=>O(o,t))},qt=(o,t)=>{const{colorPicker:e,colorMenu:s,menuToggle:r,pickerToggle:n,parent:i}=o,a=t===e,l=a?s:e,c=a?r:n,h=a?n:r;M(i,"open")||q(i,"open"),l&&(O(l,"show"),Ee(l)),q(t,"bottom"),ao(t),q(t,"show"),a&&o.update(),o.isOpen||(He(o,!0),o.updateDropdownPosition(),o.isOpen=!0,m(o.input,J,"0"),r&&m(r,J,"0")),m(h,St,"true"),c&&m(c,St,"false")};class Me{static Color=k;static ColorPalette=Vt;static getInstance=ko;static init=yo;static selector=wo;static roundPart=y;static setElementStyle=D;static setAttribute=m;static getBoundingClientRect=mt;static version=vo;static colorNames=ct;static colorPickerLabels=Bt;id;input;color;format="rgb";parent;dragElement;isOpen=!1;controlPositions;colorLabels=ee(ct.map(t=>[t,t]));colorKeywords;colorPresets;componentLabels;pickerToggle;menuToggle;colorPicker;colorMenu;controls;inputs;controlKnobs;visuals;constructor(t,e){const s=_(t);if(typeof t>"u")throw new TypeError("ColorPicker target not specified.");if(B(t)&&!s)throw new TypeError(`ColorPicker target "${t}" cannot be found.`);this.input=s;const r=ie(s,Le);if(!r)throw new TypeError("ColorPicker requires a specific markup to work.");this.parent=r,this.id=ne(s,Q),this.dragElement=void 0,this.isOpen=!1,this.controlPositions={c1x:0,c1y:0,c2y:0,c3y:0},this.colorKeywords=!1,this.colorPresets=!1;const{format:n,componentLabels:i,colorLabels:a,colorKeywords:l,colorPresets:c}=io(s,$o,e||{});let h=ct;Tt(a)&&a.length===17?h=a:B(a)&&a.split(",").length===17&&(h=a.split(",")),I(this.colorLabels,ee(h.map((p,f)=>[ct[f],p])));const b=B(i)&&Se(i)?JSON.parse(i):i;if(this.componentLabels=I({...Bt},b),this.color=new k(s.value||"#fff",n),this.format=n,Tt(l)&&l.length?this.colorKeywords=l:B(l)&&l.length&&(this.colorKeywords=l.split(",").map(p=>p.trim())),Tt(c)&&c.length)this.colorPresets=c;else if(c&&Se(c)){const{hue:p,hueSteps:f,lightSteps:w,saturation:$}=JSON.parse(c);this.colorPresets=new Vt(p,f,w,$)}else B(c)&&(this.colorPresets=c.split(",").map(p=>p.trim()));mo(this);const[u,d]=nt("color-dropdown",r);this.pickerToggle=_(".picker-toggle",r),this.menuToggle=_(".menu-toggle",r),this.colorPicker=u,this.colorMenu=d,this.inputs=[...nt("color-input",r)];const[g]=nt("color-controls",r);this.controls=g,this.controlKnobs=[...nt("knob",g)],this.visuals=[...nt("visual-control",g)],this.update(),Ae(this,!0),rt.set(s,Q,this)}get value(){return this.input.value}set value(t){this.input.value=t}get hasNonColor(){return this.colorKeywords instanceof Array&&this.colorKeywords.some(t=>xt.includes(t))}get hex(){return this.color.toHex(!0)}get hsv(){return this.color.toHsv()}get hsl(){return this.color.toHsl()}get hwb(){return this.color.toHwb()}get rgb(){return this.color.toRgb()}get brightness(){return this.color.brightness}get luminance(){return this.color.luminance}get isDark(){const{color:t,brightness:e}=this;return e<120&&t.a>.33}get isValid(){const t=this.input.value;return t!==""&&new k(t).isValid}get appearance(){const{colorLabels:t,hsl:e,hsv:s,format:r}=this,n=y(e.h*360),i=r==="hsl"?e.s:s.s,a=y(i*100),l=y(e.l*100),c=s.v*100;let h="black";if(l===100&&a===0)h=t.white;else if(l===0)h=t.black;else if(a===0)h=t.grey;else if(n<15||n>=345)h=t.red;else if(n>=15&&n<45)h=c>80&&a>80?t.orange:t.brown;else if(n>=45&&n<75){const b=n>46&&n<54&&c<80&&a>90,u=n>=54&&n<75&&c<80;h=b?t.gold:t.yellow,h=u?t.olive:h}else n>=75&&n<155?h=c<68?t.green:t.lime:n>=155&&n<175?h=t.teal:n>=175&&n<195?h=t.cyan:n>=195&&n<255?h=t.blue:n>=255&&n<270?h=t.violet:n>=270&&n<295?h=t.magenta:n>=295&&n<345&&(h=t.pink);return h}updateVisuals(){const{controlPositions:t,visuals:e}=this,[s,r,n]=e,{offsetHeight:i}=s,a=t.c2y/i,{r:l,g:c,b:h}=new k({h:a,s:1,l:.5}).toRgb(),b="linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)",u=1-t.c3y/i,d=y(u*100)/100,g=new k({h:a,s:1,l:.5,a:u}).toRgbString(),p=`linear-gradient( +var ColorPicker=function(){"use strict";const Ut="aria-description",xt="aria-expanded",Me="aria-hidden",Pt="aria-selected",Q="aria-valuenow",tt="aria-valuetext",Te="change",Re="DOMContentLoaded",Oe="focusin",De="focusout",_t="keydown",Fe="keyup",St="click",Ie="pointerdown",zt="pointermove",Ke="pointerup",Ve="resize",Be="scroll",je="touchmove",j="ArrowDown",et="ArrowUp",ht="ArrowLeft",U="ArrowRight",qe="Enter",Ge="Escape",Wt="Space",Ue="transitionDuration",_e="transitionProperty",W="tabindex",ze=navigator.userAgentData,gt=ze,{userAgent:We}=navigator,ut=We,Jt=/iPhone|iPad|iPod|Android/i;gt?gt.brands.some(o=>Jt.test(o.brand)):Jt.test(ut);const Xt=/(iPhone|iPod|iPad)/;gt?gt.brands.some(o=>Xt.test(o.brand)):Xt.test(ut),ut&&ut.includes("Firefox");const{head:bt}=document;["webkitPerspective","perspective"].some(o=>o in bt.style);const Ct=(o,t,e,s)=>{const r=s||!1;o.addEventListener(t,e,r)},Lt=(o,t,e,s)=>{const r=s||!1;o.removeEventListener(t,e,r)},Je=(o,t,e,s)=>{const r=n=>{(n.target===o||n.currentTarget===o)&&(e.apply(o,[n]),Lt(o,t,r,s))};Ct(o,t,r,s)},Xe=()=>{};(()=>{let o=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(o=!0,o)});Je(document,Re,Xe,t)}catch{}return o})(),["webkitTransform","transform"].some(o=>o in bt.style),["webkitAnimation","animation"].some(o=>o in bt.style),["webkitTransition","transition"].some(o=>o in bt.style);const pt=(o,t)=>o.getAttribute(t),m=(o,t,e)=>o.setAttribute(t,e),At=(o,t)=>o.removeAttribute(t),q=(o,...t)=>{o.classList.add(...t)},O=(o,...t)=>{o.classList.remove(...t)},M=(o,t)=>o.classList.contains(t),Ht=o=>o!=null&&typeof o=="object"||!1,J=o=>Ht(o)&&typeof o.nodeType=="number"&&[1,2,3,4,5,6,7,8,9,10,11].some(t=>o.nodeType===t)||!1,ot=o=>J(o)&&o.nodeType===1||!1,X=new Map,st={data:X,set:(o,t,e)=>{ot(o)&&(X.has(t)||X.set(t,new Map),X.get(t).set(o,e))},getAllFor:o=>X.get(o)||null,get:(o,t)=>{if(!ot(o)||!t)return null;const e=st.getAllFor(t);return o&&e&&e.get(o)||null},remove:(o,t)=>{const e=st.getAllFor(t);!e||!ot(o)||(e.delete(o),e.size===0&&X.delete(t))}},Ze=(o,t)=>st.get(o,t),B=o=>typeof o=="string"||!1,Ye=o=>Ht(o)&&o.constructor.name==="Window"||!1,Zt=o=>J(o)&&o.nodeType===9||!1,F=o=>Ye(o)?o.document:Zt(o)?o:J(o)?o.ownerDocument:window.document,I=(o,...t)=>Object.assign(o,...t),x=o=>{if(!o)return;if(B(o))return F().createElement(o);const{tagName:t}=o,e=x(t);if(!e)return;const s={...o};return delete s.tagName,I(e,s)},Nt=(o,t)=>{if(!o||!t)return;if(B(t))return F().createElementNS(o,t);const{tagName:e}=t,s=Nt(o,e);if(!s)return;const r={...t};return delete r.tagName,I(s,r)},Qe=(o,t)=>o.dispatchEvent(t),Et=(o,t)=>{const e=getComputedStyle(o),s=t.replace("webkit","Webkit").replace(/([A-Z])/g,"-$1").toLowerCase();return e.getPropertyValue(s)},to=o=>{const t=Et(o,_e),e=Et(o,Ue),s=e.includes("ms")?1:1e3,r=t&&t!=="none"?parseFloat(e)*s:0;return Number.isNaN(r)?0:r},_=(o,t)=>o.focus(t),Yt=o=>["true",!0].includes(o)?!0:["false",!1].includes(o)?!1:["null","",null,void 0].includes(o)?null:o!==""&&!Number.isNaN(+o)?+o:o,dt=o=>Object.entries(o),eo=o=>o.toLowerCase(),oo=(o,t,e,s)=>{const r={...e},n={...o.dataset},i={...t},a={},l="title";return dt(n).forEach(([c,h])=>{const b=s&&typeof c=="string"&&c.includes(s)?c.replace(s,"").replace(/[A-Z]/g,u=>eo(u)):c;a[b]=Yt(h)}),dt(r).forEach(([c,h])=>{r[c]=Yt(h)}),dt(t).forEach(([c,h])=>{c in r?i[c]=r[c]:c in a?i[c]=a[c]:i[c]=c===l?pt(o,l):h}),i},Qt=o=>Object.fromEntries(o),so=o=>o.offsetHeight,D=(o,t)=>{dt(t).forEach(([e,s])=>{if(s&&B(e)&&e.includes("--"))o.style.setProperty(e,s);else{const r={};r[e]=s,I(o.style,r)}})},ro=o=>Ht(o)&&o.constructor.name==="Map"||!1,te=o=>o.toUpperCase(),ft=(o,t)=>{const{width:e,height:s,top:r,right:n,bottom:i,left:a}=o.getBoundingClientRect();let l=1,c=1;if(t&&ot(o)){const{offsetWidth:h,offsetHeight:b}=o;l=h>0?Math.round(e)/h:1,c=b>0?Math.round(s)/b:1}return{width:e/l,height:s/c,top:r/c,right:n/l,bottom:i/c,left:a/l,x:a/l,y:r/c}},Mt=o=>F(o).documentElement;let ee=0,oe=0;const Z=new Map,se=(o,t)=>{let e=t?ee:oe;if(t){const s=se(o),r=Z.get(s)||new Map;Z.has(s)||Z.set(s,r),ro(r)&&!r.has(t)?(r.set(t,e),ee+=1):e=r.get(t)}else{const s=o.id||o;Z.has(s)?e=Z.get(s):(Z.set(s,e),oe+=1)}return e},no=o=>{var t;return o?Zt(o)?o.defaultView:J(o)?(t=o?.ownerDocument)==null?void 0:t.defaultView:o:window},Tt=o=>Array.isArray(o)||!1,re=(o,t)=>o?o.closest(t)||re(o.getRootNode().host,t):null,z=(o,t)=>ot(o)?o:(J(t)?t:F()).querySelector(o),rt=(o,t)=>(t&&J(t)?t:F()).getElementsByClassName(o),Rt=["transparent","currentColor","inherit","revert","initial"],v=o=>{const t=Math.floor(o);return o-t<.5?t:Math.round(o)},mt=[["aliceblue",{r:240,g:248,b:255}],["antiquewhite",{r:250,g:235,b:215}],["aqua",{r:0,g:255,b:255}],["aquamarine",{r:127,g:255,b:212}],["azure",{r:240,g:255,b:255}],["beige",{r:245,g:245,b:220}],["bisque",{r:255,g:228,b:196}],["black",{r:0,g:0,b:0}],["blanchedalmond",{r:255,g:235,b:205}],["blue",{r:0,g:0,b:255}],["blueviolet",{r:138,g:43,b:226}],["brown",{r:165,g:42,b:42}],["burlywood",{r:222,g:184,b:135}],["cadetblue",{r:95,g:158,b:160}],["chartreuse",{r:127,g:255,b:0}],["chocolate",{r:210,g:105,b:30}],["coral",{r:255,g:127,b:80}],["cornflowerblue",{r:100,g:149,b:237}],["cornsilk",{r:255,g:248,b:220}],["crimson",{r:220,g:20,b:60}],["cyan",{r:0,g:255,b:255}],["darkblue",{r:0,g:0,b:139}],["darkcyan",{r:0,g:139,b:139}],["darkgoldenrod",{r:184,g:134,b:11}],["darkgray",{r:169,g:169,b:169}],["darkgreen",{r:0,g:100,b:0}],["darkgrey",{r:169,g:169,b:169}],["darkkhaki",{r:189,g:183,b:107}],["darkmagenta",{r:139,g:0,b:139}],["darkolivegreen",{r:85,g:107,b:47}],["darkorange",{r:255,g:140,b:0}],["darkorchid",{r:153,g:50,b:204}],["darkred",{r:139,g:0,b:0}],["darksalmon",{r:233,g:150,b:122}],["darkseagreen",{r:143,g:188,b:143}],["darkslateblue",{r:72,g:61,b:139}],["darkslategray",{r:47,g:79,b:79}],["darkslategrey",{r:47,g:79,b:79}],["darkturquoise",{r:0,g:206,b:209}],["darkviolet",{r:148,g:0,b:211}],["deeppink",{r:255,g:20,b:147}],["deepskyblue",{r:0,g:191,b:255}],["dimgray",{r:105,g:105,b:105}],["dimgrey",{r:105,g:105,b:105}],["dodgerblue",{r:30,g:144,b:255}],["firebrick",{r:178,g:34,b:34}],["floralwhite",{r:255,g:250,b:240}],["forestgreen",{r:34,g:139,b:34}],["fuchsia",{r:255,g:0,b:255}],["gainsboro",{r:220,g:220,b:220}],["ghostwhite",{r:248,g:248,b:255}],["goldenrod",{r:218,g:165,b:32}],["gold",{r:255,g:215,b:0}],["gray",{r:128,g:128,b:128}],["green",{r:0,g:128,b:0}],["greenyellow",{r:173,g:255,b:47}],["grey",{r:128,g:128,b:128}],["honeydew",{r:240,g:255,b:240}],["hotpink",{r:255,g:105,b:180}],["indianred",{r:205,g:92,b:92}],["indigo",{r:75,g:0,b:130}],["ivory",{r:255,g:255,b:240}],["khaki",{r:240,g:230,b:140}],["lavenderblush",{r:255,g:240,b:245}],["lavender",{r:230,g:230,b:250}],["lawngreen",{r:124,g:252,b:0}],["lemonchiffon",{r:255,g:250,b:205}],["lightblue",{r:173,g:216,b:230}],["lightcoral",{r:240,g:128,b:128}],["lightcyan",{r:224,g:255,b:255}],["lightgoldenrodyellow",{r:250,g:250,b:210}],["lightgray",{r:211,g:211,b:211}],["lightgreen",{r:144,g:238,b:144}],["lightgrey",{r:211,g:211,b:211}],["lightpink",{r:255,g:182,b:193}],["lightsalmon",{r:255,g:160,b:122}],["lightseagreen",{r:32,g:178,b:170}],["lightskyblue",{r:135,g:206,b:250}],["lightslategray",{r:119,g:136,b:153}],["lightslategrey",{r:119,g:136,b:153}],["lightsteelblue",{r:176,g:196,b:222}],["lightyellow",{r:255,g:255,b:224}],["lime",{r:0,g:255,b:0}],["limegreen",{r:50,g:205,b:50}],["linen",{r:250,g:240,b:230}],["magenta",{r:255,g:0,b:255}],["maroon",{r:128,g:0,b:0}],["mediumaquamarine",{r:102,g:205,b:170}],["mediumblue",{r:0,g:0,b:205}],["mediumorchid",{r:186,g:85,b:211}],["mediumpurple",{r:147,g:112,b:219}],["mediumseagreen",{r:60,g:179,b:113}],["mediumslateblue",{r:123,g:104,b:238}],["mediumspringgreen",{r:0,g:250,b:154}],["mediumturquoise",{r:72,g:209,b:204}],["mediumvioletred",{r:199,g:21,b:133}],["midnightblue",{r:25,g:25,b:112}],["mintcream",{r:245,g:255,b:250}],["mistyrose",{r:255,g:228,b:225}],["moccasin",{r:255,g:228,b:181}],["navajowhite",{r:255,g:222,b:173}],["navy",{r:0,g:0,b:128}],["oldlace",{r:253,g:245,b:230}],["olive",{r:128,g:128,b:0}],["olivedrab",{r:107,g:142,b:35}],["orange",{r:255,g:165,b:0}],["orangered",{r:255,g:69,b:0}],["orchid",{r:218,g:112,b:214}],["palegoldenrod",{r:238,g:232,b:170}],["palegreen",{r:152,g:251,b:152}],["paleturquoise",{r:175,g:238,b:238}],["palevioletred",{r:219,g:112,b:147}],["papayawhip",{r:255,g:239,b:213}],["peachpuff",{r:255,g:218,b:185}],["peru",{r:205,g:133,b:63}],["pink",{r:255,g:192,b:203}],["plum",{r:221,g:160,b:221}],["powderblue",{r:176,g:224,b:230}],["purple",{r:128,g:0,b:128}],["rebeccapurple",{r:102,g:51,b:153}],["red",{r:255,g:0,b:0}],["rosybrown",{r:188,g:143,b:143}],["royalblue",{r:65,g:105,b:225}],["saddlebrown",{r:139,g:69,b:19}],["salmon",{r:250,g:128,b:114}],["sandybrown",{r:244,g:164,b:96}],["seagreen",{r:46,g:139,b:87}],["seashell",{r:255,g:245,b:238}],["sienna",{r:160,g:82,b:45}],["silver",{r:192,g:192,b:192}],["skyblue",{r:135,g:206,b:235}],["slateblue",{r:106,g:90,b:205}],["slategray",{r:112,g:128,b:144}],["slategrey",{r:112,g:128,b:144}],["snow",{r:255,g:250,b:250}],["springgreen",{r:0,g:255,b:127}],["steelblue",{r:70,g:130,b:180}],["tan",{r:210,g:180,b:140}],["teal",{r:0,g:128,b:128}],["thistle",{r:216,g:191,b:216}],["tomato",{r:255,g:99,b:71}],["turquoise",{r:64,g:224,b:208}],["violet",{r:238,g:130,b:238}],["wheat",{r:245,g:222,b:179}],["white",{r:255,g:255,b:255}],["whitesmoke",{r:245,g:245,b:245}],["yellow",{r:255,g:255,b:0}],["yellowgreen",{r:154,g:205,b:50}]],ne="deg|rad|grad|turn",ie="[-\\+]?\\d+%?",ae="[-\\+]?\\d*\\.\\d+%?",le=`[-\\+]?\\d*\\.?\\d+(?:${ne})?`,vt=`(?:${ae})|(?:${ie})`,Ot=`(?:${vt})|(?:${le}?)`,io="(?:[\\s|\\(\\s|\\s\\(\\s]+)?",ao="(?:[\\s|\\)\\s]+)?",ce="(?:[,|\\s]+)",lo="(?:[,|\\/\\s]*)?",nt=`${io}(${Ot})${ce}(${vt})${ce}(${vt})${lo}(${vt})?${ao}`,K={CSS_UNIT:new RegExp(Ot),ANGLES:ne,CSS_ANGLE:le,CSS_INTEGER:ie,CSS_NUMBER:ae,CSS_UNIT2:Ot,PERMISSIVE_MATCH:nt,hwb:new RegExp(`hwb${nt}`),rgb:new RegExp(`rgb(?:a)?${nt}`),hsl:new RegExp(`hsl(?:a)?${nt}`),hsv:new RegExp(`hsv(?:a)?${nt}`),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/},he=o=>Rt.includes(o),it=(o,t)=>o!==null&&typeof o=="object"&&Object.keys(t).every(e=>e in o),ge=o=>`${o}`.includes(".")&&parseFloat(o)===1,wt=o=>typeof o=="string"&&o.includes("%"),L=o=>!!K.CSS_UNIT.exec(`${o}`),ue=["rgb","hex","hsl","hsv","hwb"],be=o=>Rt.includes(o)||["#",...ue].some(t=>o.includes(t))?!1:mt.some(([t])=>o===t),T=(o,t)=>{let e=o;if(typeof o=="number"&&Math.min(o,0)===0&&Math.max(o,1)===1)return o;ge(o)&&(e="100%");const s=wt(e);return e=t===360?parseFloat(e):Math.min(t,Math.max(0,parseFloat(e))),s&&(e=e*t/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/t:e=e%t/t,e)},Dt=o=>{let t=parseFloat(o);return(Number.isNaN(t)||t<0||t>1)&&(t=1),t},$t=o=>Math.min(1,Math.max(0,o)),G=o=>o.length===1?`0${o}`:String(o),pe=o=>{const[[,t]]=mt.filter(([e])=>e===o.toLowerCase());return t},A=o=>parseInt(o,16),Ft=o=>A(o)/255,de=o=>v(o*255).toString(16),fe=(o,t,e)=>{const s=Math.max(o,t,e),r=Math.min(o,t,e);let n=0,i=0;const a=(s+r)/2;if(s===r)i=0,n=0;else{const l=s-r;i=a>.5?l/(2-s-r):l/(s+r),s===o&&(n=(t-e)/l+(t{let s=e;return s<0&&(s+=1),s>1&&(s-=1),s<1/6?o+(t-o)*(6*s):s<1/2?t:s<2/3?o+(t-o)*(2/3-s)*6:o},at=(o,t,e)=>{let s=0,r=0,n=0;if(t===0)r=e,n=e,s=e;else if(e){const i=e<.5?e*(1+t):e+t-e*t,a=2*e-i;s=kt(a,i,o+1/3),r=kt(a,i,o),n=kt(a,i,o-1/3)}return{r:s,g:r,b:n}},me=(o,t,e)=>{let s=0,r=0;const n=Math.min(o,t,e),i=Math.max(o,t,e),a=1-i;if(i===n)return{h:0,w:n,b:a};o===n?(s=t-e,r=3):(s=t===n?e-o:o-t,r=t===n?5:1);const l=(r-s/(i-n))/6;return{h:l===1?0:l,w:n,b:a}},ve=(o,t,e)=>{if(t+e>=1){const i=t/(t+e);return{r:i,g:i,b:i}}let{r:s,g:r,b:n}=at(o,1,.5);return[s,r,n]=[s,r,n].map(i=>i*(1-t-e)+t),{r:s,g:r,b:n}},we=(o,t,e)=>{const s=Math.max(o,t,e),r=Math.min(o,t,e);let n=0;const i=s,a=s-r,l=s===0?0:a/s;return s===r?n=0:(o===s&&(n=(t-e)/a+(t{const s=o*6,r=t,n=e,i=Math.floor(s),a=s-i,l=n*(1-r),c=n*(1-a*r),h=n*(1-(1-a)*r),b=i%6,u=[n,c,l,l,h,n][b],d=[h,n,n,c,l,l][b],g=[l,l,h,n,n,c][b];return{r:u,g:d,b:g}},$e=(o,t,e,s)=>{const r=[G(v(o).toString(16)),G(v(t).toString(16)),G(v(e).toString(16))];return s&&r[0].charAt(0)===r[0].charAt(1)&&r[1].charAt(0)===r[1].charAt(1)&&r[2].charAt(0)===r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")},Kt=(o,t,e,s,r)=>{const n=[G(v(o).toString(16)),G(v(t).toString(16)),G(v(e).toString(16)),G(de(s))];return r&&n[0].charAt(0)===n[0].charAt(1)&&n[1].charAt(0)===n[1].charAt(1)&&n[2].charAt(0)===n[2].charAt(1)&&n[3].charAt(0)===n[3].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0)+n[3].charAt(0):n.join("")},ke=o=>{const t=String(o).trim().toLowerCase();if(be(t))return Object.assign(pe(t),{a:1,format:"rgb",ok:!0});if(he(t))return{r:0,g:0,b:0,a:t==="transparent"?0:1,format:"rgb",ok:!0};let[,e,s,r,n]=K.rgb.exec(t)||[];return e&&s&&r?{r:e,g:s,b:r,a:n!==void 0?n:1,format:"rgb",ok:!0}:([,e,s,r,n]=K.hsl.exec(t)||[],e&&s&&r?{h:e,s,l:r,a:n!==void 0?n:1,format:"hsl",ok:!0}:([,e,s,r,n]=K.hsv.exec(t)||[],e&&s&&r?{h:e,s,v:r,a:n!==void 0?n:1,format:"hsv",ok:!0}:([,e,s,r,n]=K.hwb.exec(t)||[],e&&s&&r?{h:e,w:s,b:r,a:n!==void 0?n:1,format:"hwb",ok:!0}:([,e,s,r,n]=K.hex8.exec(t)||[],e&&s&&r&&n?{r:A(e),g:A(s),b:A(r),a:Ft(n),format:"hex",ok:!0}:([,e,s,r]=K.hex6.exec(t)||[],e&&s&&r?{r:A(e),g:A(s),b:A(r),a:1,format:"hex",ok:!0}:([,e,s,r,n]=K.hex4.exec(t)||[],e&&s&&r&&n?{r:A(e+e),g:A(s+s),b:A(r+r),a:Ft(n+n),format:"hex",ok:!0}:([,e,s,r]=K.hex3.exec(t)||[],e&&s&&r?{r:A(e+e),g:A(s+s),b:A(r+r),a:1,format:"hex",ok:!0}:{r:0,g:0,b:0,a:1,format:"rgb",ok:!o})))))))},ye=o=>{let t={r:0,g:0,b:0},e=o,s=1,r,n,i,a,l,c,h,b,u="rgb",d=!1;return(!e||typeof e=="string")&&(e=ke(e),d=e.ok),it(e,t)&&L(e.r)&&L(e.g)&&L(e.b)&&({r:h,g:b,b:l}=e,[h,b,l]=[h,b,l].map(g=>T(g,wt(g)?100:255)),t={r:h,g:b,b:l},u="format"in e?e.format:"rgb"),it(e,{h:0,s:0,v:0})&&L(e.h)&&L(e.s)&&L(e.v)&&({h:c,s:r,v:n}=e,c=T(c,360),r=T(r,100),n=T(n,100),t=It(c,r,n),u="hsv"),it(e,{h:0,s:0,l:0})&&L(e.h)&&L(e.s)&&L(e.l)&&({h:c,s:r,l:i}=e,c=T(c,360),r=T(r,100),i=T(i,100),t=at(c,r,i),u="hsl"),it(e,{h:0,w:0,b:0})&&L(e.h)&&L(e.w)&&L(e.b)&&({h:c,w:a,b:l}=e,c=T(c,360),a=T(a,100),l=T(l,100),t=ve(c,a,l),u="hwb"),L(e.a)&&(s=e.a,s=wt(s)||parseFloat(`${s}`)>1?T(s,100):s),{r:t.r,g:t.g,b:t.b,a:Dt(s),format:u,ok:d}},co="1.0.8";class k{static matchers=K;static isOnePointZero=ge;static isPercentage=wt;static isValidCSSUnit=L;static isNonColor=he;static isColorName=be;static isColorType=it;static pad2=G;static clamp01=$t;static bound01=T;static boundAlpha=Dt;static getRGBFromName=pe;static convertHexToDecimal=Ft;static convertDecimalToHex=de;static rgbToHsl=fe;static rgbToHex=$e;static rgbToHsv=we;static rgbToHwb=me;static rgbaToHex=Kt;static hslToRgb=It;static hsvToRgb=It;static hueToRgb=kt;static hwbToRgb=ve;static parseIntFromHex=A;static stringInputToObject=ke;static inputToRGB=ye;static roundPart=v;static webColors=mt;static nonColors=Rt;static version=co;r;g;b;a;format;ok;originalInput;constructor(t,e){const s=e&&ue.includes(e)?e:"",{r,g:n,b:i,a,ok:l,format:c}=ye(t);this.originalInput=t,this.r=r,this.g=n,this.b=i,this.a=a,this.ok=l,this.format=s||c}get isValid(){return this.ok}get isDark(){return this.brightness<120}get luminance(){const{r:t,g:e,b:s}=this;let r=0,n=0,i=0;return t<=.03928?r=t/12.92:r=((t+.055)/1.055)**2.4,e<=.03928?n=e/12.92:n=((e+.055)/1.055)**2.4,s<=.03928?i=s/12.92:i=((s+.055)/1.055)**2.4,.2126*r+.7152*n+.0722*i}get brightness(){const{r:t,g:e,b:s}=this.toRgb();return(t*299+e*587+s*114)/1e3}get name(){const{r:t,g:e,b:s}=this.toRgb(),[r]=mt.map(([n,i])=>{const a=(((i.r-t)*.3)**2+((i.g-e)*.6)**2+((i.b-s)*.1)**2)**.5;return[n,a]}).find(([,n],i,a)=>n===Math.min(...a.map(([,l])=>l)));return r}toRgb(){let{r:t,g:e,b:s,a:r}=this;return[t,e,s]=[t,e,s].map(n=>v(n*255*100)/100),r=v(r*100)/100,{r:t,g:e,b:s,a:r}}toRgbString(){const{r:t,g:e,b:s,a:r}=this.toRgb(),[n,i,a]=[t,e,s].map(v);return r===1?`rgb(${n}, ${i}, ${a})`:`rgba(${n}, ${i}, ${a}, ${r})`}toRgbCSS4String(){const{r:t,g:e,b:s,a:r}=this.toRgb(),[n,i,a]=[t,e,s].map(v),l=r===1?"":` / ${v(r*100)}%`;return`rgb(${n} ${i} ${a}${l})`}toHex(t){const{r:e,g:s,b:r,a:n}=this.toRgb();return n===1?$e(e,s,r,t):Kt(e,s,r,n,t)}toHexString(t){return`#${this.toHex(t)}`}toHex8(t){const{r:e,g:s,b:r,a:n}=this.toRgb();return Kt(e,s,r,n,t)}toHex8String(t){return`#${this.toHex8(t)}`}toHsv(){const{r:t,g:e,b:s,a:r}=this,{h:n,s:i,v:a}=we(t,e,s);return{h:n,s:i,v:a,a:r}}toHsl(){const{r:t,g:e,b:s,a:r}=this,{h:n,s:i,l:a}=fe(t,e,s);return{h:n,s:i,l:a,a:r}}toHslString(){let{h:t,s:e,l:s,a:r}=this.toHsl();return t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100)/100,r===1?`hsl(${t}, ${e}%, ${s}%)`:`hsla(${t}, ${e}%, ${s}%, ${r})`}toHslCSS4String(){let{h:t,s:e,l:s,a:r}=this.toHsl();t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100);const n=r<100?` / ${v(r)}%`:"";return`hsl(${t}deg ${e}% ${s}%${n})`}toHwb(){const{r:t,g:e,b:s,a:r}=this,{h:n,w:i,b:a}=me(t,e,s);return{h:n,w:i,b:a,a:r}}toHwbString(){let{h:t,w:e,b:s,a:r}=this.toHwb();t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100);const n=r<100?` / ${v(r)}%`:"";return`hwb(${t}deg ${e}% ${s}%${n})`}setAlpha(t){return typeof t!="number"?this:(this.a=Dt(t),this)}saturate(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=at(e,$t(s+t/100),r);return Object.assign(this,{r:n,g:i,b:a}),this}desaturate(t){return typeof t=="number"?this.saturate(-t):this}greyscale(){return this.saturate(-100)}lighten(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=at(e,s,$t(r+t/100));return Object.assign(this,{r:n,g:i,b:a}),this}darken(t){return typeof t=="number"?this.lighten(-t):this}spin(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=at($t((e*360+t)%360/360),s,r);return Object.assign(this,{r:n,g:i,b:a}),this}clone(){return new k(this)}toString(t){const{format:e}=this;return e==="hex"?this.toHexString(t):e==="hsl"?this.toHslString():e==="hwb"?this.toHwbString():this.toRgbString()}}class Vt{static Color=k;hue;hueSteps;lightSteps;saturation;colors;constructor(...t){let e=0,s=12,r=10,n=[.5],i=100;if(t.length===4)[e,s,r,i]=t;else if(t.length===3)[e,s,r]=t;else if(t.length===2&&([s,r]=t,[s,r].some(g=>g<1)))throw TypeError("ColorPalette: the two minimum arguments must be numbers higher than 0.");const a=[],l=360/s,c=k.roundPart((r-(r%2?1:0))/2),h=[.25,.2,.15,.11,.09,.075],b=[[1,2,3],[4,5],[6,7],[8,9],[10,11],[12,13]],u=b.find(g=>g.includes(r)),d=u?h[b.indexOf(u)]:100/(r+(r%2?0:1))/100;for(let g=1;g{const w=new k({h:p,s:1,l:f});a.push(i<100?w.saturate(i-100):w)})}this.hue=e,this.hueSteps=s,this.lightSteps=r,this.saturation=i,this.colors=a}}const Bt={pickerLabel:"Colour Picker",appearanceLabel:"Colour Appearance",valueLabel:"Colour Value",toggleLabel:"Select Colour",presetsLabel:"Colour Presets",defaultsLabel:"Colour Defaults",formatLabel:"Format",alphaLabel:"Alpha",hexLabel:"Hexadecimal",hueLabel:"Hue",whitenessLabel:"Whiteness",blacknessLabel:"Blackness",saturationLabel:"Saturation",lightnessLabel:"Lightness",redLabel:"Red",greenLabel:"Green",blueLabel:"Blue"},lt=["white","black","grey","red","orange","brown","gold","olive","yellow","lime","green","teal","cyan","blue","violet","magenta","pink"],xe=o=>{if(!B(o))return!1;try{JSON.parse(o)}catch{return!1}return!0},jt="v-hidden",ho=o=>{const{format:t,id:e,componentLabels:s}=o,r=x({tagName:"div",className:`color-form ${t}`});let n=["hex"];return t==="rgb"?n=["red","green","blue","alpha"]:t==="hsl"?n=["hue","saturation","lightness","alpha"]:t==="hwb"&&(n=["hue","whiteness","blackness","alpha"]),n.forEach(i=>{const[a]=t==="hex"?["#"]:te(i).split(""),l=`color_${t}_${i}_${e}`,c=s[`${i}Label`],h=x({tagName:"label"});m(h,"for",l),h.append(x({tagName:"span",ariaHidden:"true",innerText:`${a}:`}),x({tagName:"span",className:jt,innerText:c}));const b=x({tagName:"input",id:l,type:t==="hex"?"text":"number",value:i==="alpha"?"100":"0",className:`color-input ${i}`,autocomplete:"off",spellcheck:!1});let u="100",d="1";i!=="alpha"&&(t==="rgb"?(u="255",d="1"):i==="hue"&&(u="360",d="1")),I(b,{min:"0",max:u,step:d}),r.append(h,b)}),r},go=o=>{const{format:t,componentLabels:e}=o,{hueLabel:s,alphaLabel:r,lightnessLabel:n,saturationLabel:i,whitenessLabel:a,blacknessLabel:l}=e,c=t==="hsl"?360:100,h=t==="hsl"?100:360,b=100;let u=t==="hsl"?`${s} & ${n}`:`${n} & ${i}`;u=t==="hwb"?`${a} & ${l}`:u;const d=t==="hsl"?`${i}`:`${s}`,g=x({tagName:"div",className:`color-controls ${t}`}),p="color-pointer",f="color-slider";return[{i:1,c:p,l:u,min:0,max:c},{i:2,c:f,l:d,min:0,max:h},{i:3,c:f,l:r,min:0,max:b}].forEach($=>{const{i:P,c:H,l:S,min:C,max:R}=$,E=x({tagName:"div",className:"color-control",role:"presentation"});E.append(x({tagName:"div",className:`visual-control visual-control${P}`}));const N=x({tagName:"div",className:`${H} knob`,ariaLive:"polite",ariaLabel:S,role:"slider",tabIndex:0,ariaValueMin:`${C}`,ariaValueMax:`${R}`});E.append(N),g.append(E)}),g},Pe=(o,t,e)=>{const{input:s,format:r,componentLabels:n}=o,{defaultsLabel:i,presetsLabel:a}=n,l=e==="color-options",c=t instanceof Vt,h=l?a:i,b=c?t.colors:t,u=b.length,{lightSteps:d}=c?t:{lightSteps:null},g=d||[9,10].find(N=>u>=N*2&&!(u%N))||5,p=l&&u>g;let f=2;f=p&&u>g*2?3:f,f=p&&u>g*3?4:f,f=p&&u>g*4?5:f;const w=f-(u<=g*3?1:2),$=p&&u>w*g;let P=e;P+=$?" scrollable":"",P+=p?" multiline":"";const H=p?"1px":"0.25rem";let S=p?1.75:2;S=g>5&&p?1.5:S;const C=`${w*S}rem`,R=`calc(${f} * ${S}rem + ${f-1} * ${H})`,E=x({tagName:"ul",className:P,role:"listbox",ariaLabel:h});return $&&D(E,{"--grid-item-size":`${S}rem`,"--grid-fit":`${g}`,"--grid-gap":H,"--grid-height":C,"--grid-hover-height":R}),b.forEach(N=>{let[V,ct]=typeof N=="string"?N.trim().split(":"):[];N instanceof k&&(V=N.toHexString(),ct=V);const Ee=new k(N instanceof k?N:V,r).toString()===pt(s,"value"),Gt=x({tagName:"li",className:`color-option${Ee?" active":""}`,innerText:`${ct||V}`,tabIndex:0,role:"option",ariaSelected:Ee?"true":"false"});m(Gt,"data-value",`${V}`),l&&D(Gt,{backgroundColor:V}),E.append(Gt)}),E},uo=o=>{const{input:t,parent:e,format:s,id:r,componentLabels:n,colorKeywords:i,colorPresets:a}=o,l=pt(t,"value")||"#fff",{nonColors:c}=k,{toggleLabel:h,pickerLabel:b,formatLabel:u,hexLabel:d}=n,g=c.includes(l)?"#fff":l;o.color=new k(g,s);const p=s==="hex"?d:te(s),f=x({id:`picker-btn-${r}`,tagName:"button",type:"button",className:"picker-toggle btn-appearance",ariaExpanded:"false",ariaHasPopup:"true"});f.append(x({tagName:"span",className:jt,innerText:`${b}. ${u}: ${p}`}));const w=x({tagName:"div",className:"color-dropdown picker",role:"group",ariaLabelledBy:`picker-btn-${r}`}),$=go(o),P=ho(o);if(w.append($,P),t.before(f),e.append(w),i||a){const H=x({tagName:"div",className:"color-dropdown scrollable menu"});a&&H.append(Pe(o,a,"color-options")),i&&i.length&&H.append(Pe(o,i,"color-defaults"));const S=x({tagName:"button",type:"button",className:"menu-toggle btn-appearance",tabIndex:-1,ariaExpanded:"false",ariaHasPopup:"true"}),C=encodeURI("http://www.w3.org/2000/svg"),R=Nt(C,{tagName:"svg"});m(R,"xmlns",C),m(R,"viewBox","0 0 512 512"),m(R,Me,"true");const E=Nt(C,{tagName:"path"});m(E,"d","M98,158l157,156L411,158l27,27L255,368L71,185L98,158z"),m(E,"fill","#fff"),R.append(E),S.append(x({tagName:"span",className:jt,innerText:`${h}`}),R),e.append(S,H)}i&&c.includes(l)&&(o.value=l),m(t,W,"-1")},bo="2.0.0-alpha10",Y="color-picker",po=`[data-function="${Y}"]`,Se=`.${Y}`,fo={componentLabels:Bt,colorLabels:lt,format:"rgb",colorPresets:!1,colorKeywords:!1},{roundPart:y,nonColors:yt}=k,mo=o=>Ze(o,Y),vo=o=>new Ne(o),Ce=(o,t)=>{const e=t?Ct:Lt,{input:s,pickerToggle:r,menuToggle:n}=o;e(s,Oe,o.showPicker),e(r,St,o.togglePicker),n&&e(n,St,o.toggleMenu)},Le=(o,t)=>{const e=t?Ct:Lt,{input:s,colorMenu:r,parent:n}=o,i=F(s),a=no(i);e(o.controls,Ie,o.pointerDown),o.controlKnobs.forEach(l=>e(l,_t,o.handleKnobs)),e(a,Be,o.handleScroll),e(a,Ve,o.update),[s,...o.inputs].forEach(l=>e(l,Te,o.changeHandler)),r&&(e(r,St,o.menuClickHandler),e(r,_t,o.menuKeyHandler)),e(i,zt,o.pointerMove),e(i,Ke,o.pointerUp),e(n,De,o.handleFocusOut),e(i,Fe,o.handleDismiss)},Ae=o=>{Qe(o.input,new CustomEvent("colorpicker.change"))},He=o=>{o&&["bottom","top"].forEach(t=>O(o,t))},qt=(o,t)=>{const{colorPicker:e,colorMenu:s,menuToggle:r,pickerToggle:n,parent:i}=o,a=t===e,l=a?s:e,c=a?r:n,h=a?n:r;M(i,"open")||q(i,"open"),l&&(O(l,"show"),He(l)),q(t,"bottom"),so(t),q(t,"show"),a&&o.update(),o.isOpen||(Le(o,!0),o.updateDropdownPosition(),o.isOpen=!0,m(o.input,W,"0"),r&&m(r,W,"0")),m(h,xt,"true"),c&&m(c,xt,"false")};class Ne{static Color=k;static ColorPalette=Vt;static getInstance=mo;static init=vo;static selector=po;static roundPart=y;static setElementStyle=D;static setAttribute=m;static getBoundingClientRect=ft;static version=bo;static colorNames=lt;static colorPickerLabels=Bt;id;input;color;format="rgb";parent;dragElement;isOpen=!1;controlPositions;colorLabels=Qt(lt.map(t=>[t,t]));colorKeywords;colorPresets;componentLabels;pickerToggle;menuToggle;colorPicker;colorMenu;controls;inputs;controlKnobs;visuals;constructor(t,e){const s=z(t);if(typeof t>"u")throw new TypeError("ColorPicker target not specified.");if(B(t)&&!s)throw new TypeError(`ColorPicker target "${t}" cannot be found.`);this.input=s;const r=re(s,Se);if(!r)throw new TypeError("ColorPicker requires a specific markup to work.");this.parent=r,this.id=se(s,Y),this.dragElement=void 0,this.isOpen=!1,this.controlPositions={c1x:0,c1y:0,c2y:0,c3y:0},this.colorKeywords=!1,this.colorPresets=!1;const{format:n,componentLabels:i,colorLabels:a,colorKeywords:l,colorPresets:c}=oo(s,fo,e||{});let h=lt;Tt(a)&&a.length===17?h=a:B(a)&&a.split(",").length===17&&(h=a.split(",")),I(this.colorLabels,Qt(h.map((p,f)=>[lt[f],p])));const b=B(i)&&xe(i)?JSON.parse(i):i;if(this.componentLabels=I({...Bt},b),this.color=new k(s.value||"#fff",n),this.format=n,Tt(l)&&l.length?this.colorKeywords=l:B(l)&&l.length&&(this.colorKeywords=l.split(",").map(p=>p.trim())),Tt(c)&&c.length)this.colorPresets=c;else if(c&&xe(c)){const{hue:p,hueSteps:f,lightSteps:w,saturation:$}=JSON.parse(c);this.colorPresets=new Vt(p,f,w,$)}else B(c)&&(this.colorPresets=c.split(",").map(p=>p.trim()));uo(this);const[u,d]=rt("color-dropdown",r);this.pickerToggle=z(".picker-toggle",r),this.menuToggle=z(".menu-toggle",r),this.colorPicker=u,this.colorMenu=d,this.inputs=[...rt("color-input",r)];const[g]=rt("color-controls",r);this.controls=g,this.controlKnobs=[...rt("knob",g)],this.visuals=[...rt("visual-control",g)],this.update(),Ce(this,!0),st.set(s,Y,this)}get value(){return this.input.value}set value(t){this.input.value=t}get hasNonColor(){return this.colorKeywords instanceof Array&&this.colorKeywords.some(t=>yt.includes(t))}get hex(){return this.color.toHex(!0)}get hsv(){return this.color.toHsv()}get hsl(){return this.color.toHsl()}get hwb(){return this.color.toHwb()}get rgb(){return this.color.toRgb()}get brightness(){return this.color.brightness}get luminance(){return this.color.luminance}get isDark(){const{color:t,brightness:e}=this;return e<120&&t.a>.33}get isValid(){const t=this.input.value;return t!==""&&new k(t).isValid}get appearance(){const{colorLabels:t,hsl:e,hsv:s,format:r}=this,n=y(e.h*360),i=r==="hsl"?e.s:s.s,a=y(i*100),l=y(e.l*100),c=s.v*100;let h="black";if(l===100&&a===0)h=t.white;else if(l===0)h=t.black;else if(a===0)h=t.grey;else if(n<15||n>=345)h=t.red;else if(n>=15&&n<45)h=c>80&&a>80?t.orange:t.brown;else if(n>=45&&n<75){const b=n>46&&n<54&&c<80&&a>90,u=n>=54&&n<75&&c<80;h=b?t.gold:t.yellow,h=u?t.olive:h}else n>=75&&n<155?h=c<68?t.green:t.lime:n>=155&&n<175?h=t.teal:n>=175&&n<195?h=t.cyan:n>=195&&n<255?h=t.blue:n>=255&&n<270?h=t.violet:n>=270&&n<295?h=t.magenta:n>=295&&n<345&&(h=t.pink);return h}updateVisuals(){const{controlPositions:t,visuals:e}=this,[s,r,n]=e,{offsetHeight:i}=s,a=t.c2y/i,{r:l,g:c,b:h}=new k({h:a,s:1,l:.5}).toRgb(),b="linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)",u=1-t.c3y/i,d=y(u*100)/100,g=new k({h:a,s:1,l:.5,a:u}).toRgbString(),p=`linear-gradient( rgb(255,0,0) 0%, rgb(255,255,0) 16.67%, rgb(0,255,0) 33.33%, rgb(0,255,255) 50%, rgb(0,0,255) 66.67%, rgb(255,0,255) 83.33%, rgb(255,0,0) 100%)`;D(s,{background:`linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,${d}) 100%), linear-gradient(to right, rgba(255,255,255,${d}) 0%, ${g} 100%), - ${b}`}),D(r,{background:p}),D(n,{background:`linear-gradient(rgba(${l},${c},${h},1) 0%,rgba(${l},${c},${h},0) 100%)`})}handleFocusOut=({relatedTarget:t})=>{t&&!this.parent.contains(t)&&this.hide(!0)};handleDismiss=({code:t})=>{this.isOpen&&t===Ue&&this.hide()};handleScroll=t=>{const{activeElement:e}=F(this.input);this.updateDropdownPosition(),([Jt,ze].includes(t.type)&&this.dragElement||e&&this.controlKnobs.includes(e))&&(t.stopPropagation(),t.preventDefault())};menuKeyHandler=t=>{const{target:e,code:s}=t,{previousElementSibling:r,nextElementSibling:n,parentElement:i}=e,a=i&&M(i,"color-options"),l=i?[...i.children]:[],c=a&&Et(i,"grid-template-columns").split(" ").length,h=l.indexOf(e),b=h>-1&&c&&l[h-c],u=h>-1&&c&&l[h+c];[j,ot,Zt].includes(s)&&t.preventDefault(),a?b&&s===ot?U(b):u&&s===j?U(u):r&&s===gt?U(r):n&&s===G&&U(n):r&&[gt,ot].includes(s)?U(r):n&&[G,j].includes(s)&&U(n),[Ge,Zt].includes(s)&&this.menuClickHandler(t)};menuClickHandler=t=>{const{target:e}=t,{colorMenu:s}=this,r=(dt(e,"data-value")||"").trim();if(!r.length)return;const n=_("li.active",s);let i=r;i=xt.includes(i)?"white":i,i=i==="transparent"?"rgba(0,0,0,0)":i;const{r:a,g:l,b:c,a:h}=new k(i);I(this.color,{r:a,g:l,b:c,a:h}),this.update(),n!==e&&(n&&(O(n,"active"),At(n,Ct)),q(e,"active"),m(e,Ct,"true"),xt.includes(r)&&(this.value=r),Ne(this))};pointerDown=t=>{if(t.button!==0)return;const{target:e,pageX:s,pageY:r}=t,{colorMenu:n,visuals:i,controlKnobs:a}=this,[l,c,h]=i,[b,u,d]=a,g=a.includes(e)?e.previousElementSibling:e,p=mt(g),f=Mt(l),w=s-f.scrollLeft-p.left,$=r-f.scrollTop-p.top;if(e===l||e===b?(this.dragElement=g,this.changeControl1(w,$)):e===c||e===u?(this.dragElement=g,this.changeControl2($)):(e===h||e===d)&&(this.dragElement=g,this.changeAlpha($)),n){const P=_("li.active",n);P&&(O(P,"active"),At(P,Ct))}t.preventDefault()};pointerUp=({target:t})=>{const{parent:e}=this,s=F(e),r=_(`${Le}.open`,s)!==null,n=s.getSelection();!this.dragElement&&(!n||!n.toString().length)&&!e.contains(t)&&this.hide(r),this.dragElement=void 0};pointerMove=t=>{const{dragElement:e,visuals:s}=this,[r,n,i]=s,{pageX:a,pageY:l}=t;if(!e)return;const c=mt(e),h=Mt(r),b=a-h.scrollLeft-c.left,u=l-h.scrollTop-c.top;e===r&&this.changeControl1(b,u),e===n&&this.changeControl2(u),e===i&&this.changeAlpha(u)};handleKnobs=t=>{const{target:e,code:s}=t;if(![ot,j,gt,G].includes(s))return;t.preventDefault();const{controlKnobs:r,visuals:n}=this,{offsetWidth:i,offsetHeight:a}=n[0],[l,c,h]=r,{activeElement:b}=F(l),u=r.find(g=>g===b),d=a/360;if(u){let g=0,p=0;if(e===l){const f=i/100;[gt,G].includes(s)?this.controlPositions.c1x+=s===G?f:-f:[ot,j].includes(s)&&(this.controlPositions.c1y+=s===j?d:-d),g=this.controlPositions.c1x,p=this.controlPositions.c1y,this.changeControl1(g,p)}else e===c?(this.controlPositions.c2y+=[j,G].includes(s)?d:-d,p=this.controlPositions.c2y,this.changeControl2(p)):e===h&&(this.controlPositions.c3y+=[j,G].includes(s)?d:-d,p=this.controlPositions.c3y,this.changeAlpha(p));this.handleScroll(t)}};changeHandler=()=>{let t;const{inputs:e,format:s,value:r,input:n,controlPositions:i,visuals:a}=this,{activeElement:l}=F(n),{offsetHeight:c}=a[0],[h,,,b]=e,[u,d,g,p]=s==="rgb"?e.map($=>parseFloat($.value)/($===b?100:1)):e.map($=>parseFloat($.value)/($!==h?100:360)),f=this.hasNonColor&&xt.includes(r),w=b?p:1-i.c3y/c;if(l===n||l&&e.includes(l)){l===n?f?t=r==="transparent"?"rgba(0,0,0,0)":"rgb(0,0,0)":t=r:s==="hex"?t=h.value:s==="hsl"?t={h:u,s:d,l:g,a:w}:s==="hwb"?t={h:u,w:d,b:g,a:w}:t={r:u,g:d,b:g,a:w};const{r:$,g:P,b:H,a:S}=new k(t);I(this.color,{r:$,g:P,b:H,a:S}),this.setControlPositions(),this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals(),l===n&&f&&(this.value=r)}};changeControl1(t,e){let[s,r]=[0,0];const{controlPositions:n,visuals:i}=this,{offsetHeight:a,offsetWidth:l}=i[0];t>l?s=l:t>=0&&(s=t),e>a?r=a:e>=0&&(r=e);const c=n.c2y/a,h=s/l,b=1-r/a,u=1-n.c3y/a,{r:d,g,b:p,a:f}=new k({h:c,s:h,v:b,a:u});I(this.color,{r:d,g,b:p,a:f}),this.controlPositions.c1x=s,this.controlPositions.c1y=r,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}changeControl2(t){const{controlPositions:e,visuals:s}=this,{offsetHeight:r,offsetWidth:n}=s[0];let i=0;t>r?i=r:t>=0&&(i=t);const a=i/r,l=e.c1x/n,c=1-e.c1y/r,h=1-e.c3y/r,{r:b,g:u,b:d,a:g}=new k({h:a,s:l,v:c,a:h});I(this.color,{r:b,g:u,b:d,a:g}),this.controlPositions.c2y=i,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}changeAlpha(t){const{visuals:e}=this,{offsetHeight:s}=e[0];let r=0;t>s?r=s:t>=0&&(r=t);const n=1-r/s;this.color.setAlpha(n),this.controlPositions.c3y=r,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}update=()=>{this.updateDropdownPosition(),this.updateAppearance(),this.setControlPositions(),this.updateInputs(!0),this.updateControls(),this.updateVisuals()};updateDropdownPosition(){const{input:t,colorPicker:e,colorMenu:s}=this,r=mt(t),{top:n,bottom:i}=r,{offsetHeight:a}=t,l=Mt(t).clientHeight,h=M(e,"show")?e:s;if(!h)return;const{offsetHeight:b}=h,u=l-i,d=n,g=n+b+a>l,p=n-b<0;(M(h,"bottom")||!p)&&u{t&&t.preventDefault();const{colorPicker:e}=this;this.isOpen&&M(e,"show")?this.hide(!0):qt(this,e)};showPicker=()=>{const{colorPicker:t}=this;["top","bottom"].some(e=>M(t,e))||qt(this,t)};toggleMenu=t=>{t&&t.preventDefault();const{colorMenu:e}=this;this.isOpen&&M(e,"show")?this.hide(!0):qt(this,e)};hide(t){if(this.isOpen){const{pickerToggle:e,menuToggle:s,colorPicker:r,colorMenu:n,parent:i,input:a}=this,l=M(r,"show"),c=l?r:n,h=l?e:s,b=c&&ro(c);this.value=this.color.toString(!0),c&&(O(c,"show"),m(h,St,"false"),setTimeout(()=>{Ee(c),_(".show",i)||(O(i,"open"),He(this),this.isOpen=!1)},b)),t||U(e),m(a,J,"-1"),h===s&&m(s,J,"-1")}}dispose(){const{input:t,parent:e}=this;this.hide(!0),Ae(this),[...e.children].forEach(s=>{s!==t&&s.remove()}),At(t,J),D(t,{backgroundColor:""}),["txt-light","txt-dark"].forEach(s=>O(e,s)),rt.remove(t,Q)}}return Me}(); + ${b}`}),D(r,{background:p}),D(n,{background:`linear-gradient(rgba(${l},${c},${h},1) 0%,rgba(${l},${c},${h},0) 100%)`})}handleFocusOut=({relatedTarget:t})=>{t&&!this.parent.contains(t)&&this.hide(!0)};handleDismiss=({code:t})=>{this.isOpen&&t===Ge&&this.hide()};handleScroll=t=>{const{activeElement:e}=F(this.input);this.updateDropdownPosition(),([zt,je].includes(t.type)&&this.dragElement||e&&this.controlKnobs.includes(e))&&(t.stopPropagation(),t.preventDefault())};menuKeyHandler=t=>{const{target:e,code:s}=t,{previousElementSibling:r,nextElementSibling:n,parentElement:i}=e,a=i&&M(i,"color-options"),l=i?[...i.children]:[],c=a&&Et(i,"grid-template-columns").split(" ").length,h=l.indexOf(e),b=h>-1&&c&&l[h-c],u=h>-1&&c&&l[h+c];[j,et,Wt].includes(s)&&t.preventDefault(),a?b&&s===et?_(b):u&&s===j?_(u):r&&s===ht?_(r):n&&s===U&&_(n):r&&[ht,et].includes(s)?_(r):n&&[U,j].includes(s)&&_(n),[qe,Wt].includes(s)&&this.menuClickHandler(t)};menuClickHandler=t=>{const{target:e}=t,{colorMenu:s}=this,r=(pt(e,"data-value")||"").trim();if(!r.length)return;const n=z("li.active",s);let i=r;i=yt.includes(i)?"white":i,i=i==="transparent"?"rgba(0,0,0,0)":i;const{r:a,g:l,b:c,a:h}=new k(i);I(this.color,{r:a,g:l,b:c,a:h}),this.update(),n!==e&&(n&&(O(n,"active"),At(n,Pt)),q(e,"active"),m(e,Pt,"true"),yt.includes(r)&&(this.value=r),Ae(this))};pointerDown=t=>{if(t.button!==0)return;const{target:e,pageX:s,pageY:r}=t,{colorMenu:n,visuals:i,controlKnobs:a}=this,[l,c,h]=i,[b,u,d]=a,g=a.includes(e)?e.previousElementSibling:e,p=ft(g),f=Mt(l),w=s-f.scrollLeft-p.left,$=r-f.scrollTop-p.top;if(e===l||e===b?(this.dragElement=g,this.changeControl1(w,$)):e===c||e===u?(this.dragElement=g,this.changeControl2($)):(e===h||e===d)&&(this.dragElement=g,this.changeAlpha($)),n){const P=z("li.active",n);P&&(O(P,"active"),At(P,Pt))}t.preventDefault()};pointerUp=({target:t})=>{const{parent:e}=this,s=F(e),r=z(`${Se}.open`,s)!==null,n=s.getSelection();!this.dragElement&&(!n||!n.toString().length)&&!e.contains(t)&&this.hide(r),this.dragElement=void 0};pointerMove=t=>{const{dragElement:e,visuals:s}=this,[r,n,i]=s,{pageX:a,pageY:l}=t;if(!e)return;const c=ft(e),h=Mt(r),b=a-h.scrollLeft-c.left,u=l-h.scrollTop-c.top;e===r&&this.changeControl1(b,u),e===n&&this.changeControl2(u),e===i&&this.changeAlpha(u)};handleKnobs=t=>{const{target:e,code:s}=t;if(![et,j,ht,U].includes(s))return;t.preventDefault();const{controlKnobs:r,visuals:n}=this,{offsetWidth:i,offsetHeight:a}=n[0],[l,c,h]=r,{activeElement:b}=F(l),u=r.find(g=>g===b),d=a/360;if(u){let g=0,p=0;if(e===l){const f=i/100;[ht,U].includes(s)?this.controlPositions.c1x+=s===U?f:-f:[et,j].includes(s)&&(this.controlPositions.c1y+=s===j?d:-d),g=this.controlPositions.c1x,p=this.controlPositions.c1y,this.changeControl1(g,p)}else e===c?(this.controlPositions.c2y+=[j,U].includes(s)?d:-d,p=this.controlPositions.c2y,this.changeControl2(p)):e===h&&(this.controlPositions.c3y+=[j,U].includes(s)?d:-d,p=this.controlPositions.c3y,this.changeAlpha(p));this.handleScroll(t)}};changeHandler=()=>{let t;const{inputs:e,format:s,value:r,input:n,controlPositions:i,visuals:a}=this,{activeElement:l}=F(n),{offsetHeight:c}=a[0],[h,,,b]=e,[u,d,g,p]=s==="rgb"?e.map($=>parseFloat($.value)/($===b?100:1)):e.map($=>parseFloat($.value)/($!==h?100:360)),f=this.hasNonColor&&yt.includes(r),w=b?p:1-i.c3y/c;if(l===n||l&&e.includes(l)){l===n?f?t=r==="transparent"?"rgba(0,0,0,0)":"rgb(0,0,0)":t=r:s==="hex"?t=h.value:s==="hsl"?t={h:u,s:d,l:g,a:w}:s==="hwb"?t={h:u,w:d,b:g,a:w}:t={r:u,g:d,b:g,a:w};const{r:$,g:P,b:H,a:S}=new k(t);I(this.color,{r:$,g:P,b:H,a:S}),this.setControlPositions(),this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals(),l===n&&f&&(this.value=r)}};changeControl1(t,e){let[s,r]=[0,0];const{controlPositions:n,visuals:i}=this,{offsetHeight:a,offsetWidth:l}=i[0];t>l?s=l:t>=0&&(s=t),e>a?r=a:e>=0&&(r=e);const c=n.c2y/a,h=s/l,b=1-r/a,u=1-n.c3y/a,{r:d,g,b:p,a:f}=new k({h:c,s:h,v:b,a:u});I(this.color,{r:d,g,b:p,a:f}),this.controlPositions.c1x=s,this.controlPositions.c1y=r,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}changeControl2(t){const{controlPositions:e,visuals:s}=this,{offsetHeight:r,offsetWidth:n}=s[0];let i=0;t>r?i=r:t>=0&&(i=t);const a=i/r,l=e.c1x/n,c=1-e.c1y/r,h=1-e.c3y/r,{r:b,g:u,b:d,a:g}=new k({h:a,s:l,v:c,a:h});I(this.color,{r:b,g:u,b:d,a:g}),this.controlPositions.c2y=i,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}changeAlpha(t){const{visuals:e}=this,{offsetHeight:s}=e[0];let r=0;t>s?r=s:t>=0&&(r=t);const n=1-r/s;this.color.setAlpha(n),this.controlPositions.c3y=r,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}update=()=>{this.updateDropdownPosition(),this.updateAppearance(),this.setControlPositions(),this.updateInputs(!0),this.updateControls(),this.updateVisuals()};updateDropdownPosition(){const{input:t,colorPicker:e,colorMenu:s}=this,r=ft(t),{top:n,bottom:i}=r,{offsetHeight:a}=t,l=Mt(t).clientHeight,h=M(e,"show")?e:s;if(!h)return;const{offsetHeight:b}=h,u=l-i,d=n,g=n+b+a>l,p=n-b<0;(M(h,"bottom")||!p)&&u{t&&t.preventDefault();const{colorPicker:e}=this;this.isOpen&&M(e,"show")?this.hide(!0):qt(this,e)};showPicker=()=>{const{colorPicker:t}=this;["top","bottom"].some(e=>M(t,e))||qt(this,t)};toggleMenu=t=>{t&&t.preventDefault();const{colorMenu:e}=this;this.isOpen&&M(e,"show")?this.hide(!0):qt(this,e)};hide(t){if(this.isOpen){const{pickerToggle:e,menuToggle:s,colorPicker:r,colorMenu:n,parent:i,input:a}=this,l=M(r,"show"),c=l?r:n,h=l?e:s,b=c&&to(c);this.value=this.color.toString(!0),c&&(O(c,"show"),m(h,xt,"false"),setTimeout(()=>{He(c),z(".show",i)||(O(i,"open"),Le(this),this.isOpen=!1)},b)),t||_(e),m(a,W,"-1"),h===s&&m(s,W,"-1")}}dispose(){const{input:t,parent:e}=this;this.hide(!0),Ce(this),[...e.children].forEach(s=>{s!==t&&s.remove()}),At(t,W),D(t,{backgroundColor:""}),["txt-light","txt-dark"].forEach(s=>O(e,s)),st.remove(t,Y)}}return Ne}(); //# sourceMappingURL=color-picker.js.map diff --git a/dist/js/color-picker.js.map b/dist/js/color-picker.js.map index 81c28f1..e1f63c3 100644 --- a/dist/js/color-picker.js.map +++ b/dist/js/color-picker.js.map @@ -1 +1 @@ -{"version":3,"file":"color-picker.js","sources":["../../node_modules/.pnpm/@thednp+event-listener@2.0.2/node_modules/@thednp/event-listener/dist/event-listener.mjs","../../node_modules/.pnpm/@thednp+shorty@2.0.0-alpha17/node_modules/@thednp/shorty/dist/shorty.mjs","../../node_modules/.pnpm/@thednp+color@1.0.8/node_modules/@thednp/color/dist/index.mjs","../../src/ts/colorPalette.ts","../../src/ts/util/colorPickerLabels.ts","../../src/ts/util/colorNames.ts","../../src/ts/util/isValidJSON.ts","../../src/ts/util/vHidden.ts","../../src/ts/util/getColorForm.ts","../../src/ts/util/getColorControls.ts","../../src/ts/util/getColorMenu.ts","../../src/ts/util/setMarkup.ts","../../src/ts/index.ts"],"sourcesContent":["const e = {}, f = (t) => {\n const { type: c, currentTarget: i } = t;\n [...e[c]].forEach(([n, s]) => {\n i === n && [...s].forEach(([o, a]) => {\n o.apply(n, [t]), typeof a == \"object\" && a.once && r(n, c, o, a);\n });\n });\n}, E = (t, c, i, n) => {\n e[c] || (e[c] = /* @__PURE__ */ new Map());\n const s = e[c];\n s.has(t) || s.set(t, /* @__PURE__ */ new Map());\n const o = s.get(t), { size: a } = o;\n o.set(i, n), a || t.addEventListener(c, f, n);\n}, r = (t, c, i, n) => {\n const s = e[c], o = s && s.get(t), a = o && o.get(i), d = a !== void 0 ? a : n;\n o && o.has(i) && o.delete(i), s && (!o || !o.size) && s.delete(t), (!s || !s.size) && delete e[c], (!o || !o.size) && t.removeEventListener(c, f, d);\n}, g = E, M = r;\nexport {\n E as addListener,\n f as globalListener,\n M as off,\n g as on,\n e as registry,\n r as removeListener\n};\n//# sourceMappingURL=event-listener.mjs.map\n","const pe = \"aria-checked\", me = \"aria-description\", fe = \"aria-describedby\", ge = \"aria-expanded\", ve = \"aria-haspopup\", Ee = \"aria-hidden\", be = \"aria-label\", he = \"aria-labelledby\", ye = \"aria-modal\", we = \"aria-pressed\", Ae = \"aria-selected\", Se = \"aria-valuemin\", Me = \"aria-valuemax\", Ne = \"aria-valuenow\", ke = \"aria-valuetext\", q = \"abort\", G = \"beforeunload\", J = \"blur\", K = \"change\", X = \"contextmenu\", P = \"DOMContentLoaded\", Y = \"DOMMouseScroll\", Z = \"error\", $ = \"focus\", _ = \"focusin\", tt = \"focusout\", et = \"gesturechange\", nt = \"gestureend\", ot = \"gesturestart\", st = \"keydown\", ct = \"keypress\", rt = \"keyup\", at = \"load\", it = \"click\", ut = \"dblclick\", lt = \"mousedown\", dt = \"mouseup\", pt = \"hover\", mt = \"mouseenter\", ft = \"mouseleave\", gt = \"mousein\", vt = \"mouseout\", Et = \"mouseover\", bt = \"mousemove\", ht = \"mousewheel\", yt = \"move\", wt = \"orientationchange\", At = \"pointercancel\", St = \"pointerdown\", Mt = \"pointerleave\", Nt = \"pointermove\", kt = \"pointerup\", Tt = \"readystatechange\", Dt = \"reset\", Ct = \"resize\", Ot = \"select\", Lt = \"selectend\", It = \"selectstart\", zt = \"scroll\", xt = \"submit\", Vt = \"touchstart\", Bt = \"touchmove\", Ht = \"touchcancel\", Pt = \"touchend\", Ft = \"unload\", Te = {\n DOMContentLoaded: P,\n DOMMouseScroll: Y,\n abort: q,\n beforeunload: G,\n blur: J,\n change: K,\n click: it,\n contextmenu: X,\n dblclick: ut,\n error: Z,\n focus: $,\n focusin: _,\n focusout: tt,\n gesturechange: et,\n gestureend: nt,\n gesturestart: ot,\n hover: pt,\n keydown: st,\n keypress: ct,\n keyup: rt,\n load: at,\n mousedown: lt,\n mousemove: bt,\n mousein: gt,\n mouseout: vt,\n mouseenter: mt,\n mouseleave: ft,\n mouseover: Et,\n mouseup: dt,\n mousewheel: ht,\n move: yt,\n orientationchange: wt,\n pointercancel: At,\n pointerdown: St,\n pointerleave: Mt,\n pointermove: Nt,\n pointerup: kt,\n readystatechange: Tt,\n reset: Dt,\n resize: Ct,\n scroll: zt,\n select: Ot,\n selectend: Lt,\n selectstart: It,\n submit: xt,\n touchcancel: Ht,\n touchend: Pt,\n touchmove: Bt,\n touchstart: Vt,\n unload: Ft\n}, De = \"drag\", Ce = \"dragstart\", Oe = \"dragenter\", Le = \"dragleave\", Ie = \"dragover\", ze = \"dragend\", xe = \"loadstart\", Ve = {\n start: \"mousedown\",\n end: \"mouseup\",\n move: \"mousemove\",\n cancel: \"mouseleave\"\n}, Be = { down: \"mousedown\", up: \"mouseup\" }, He = \"onmouseleave\" in document ? [\"mouseenter\", \"mouseleave\"] : (\n /* istanbul ignore next */\n [\"mouseover\", \"mouseout\"]\n), Pe = {\n start: \"touchstart\",\n end: \"touchend\",\n move: \"touchmove\",\n cancel: \"touchcancel\"\n}, Fe = { in: \"focusin\", out: \"focusout\" }, Ue = {\n Backspace: \"Backspace\",\n // 8\n Tab: \"Tab\",\n // 9\n Enter: \"Enter\",\n // 13\n Shift: \"Shift\",\n // 16\n Control: \"Control\",\n // 17\n Alt: \"Alt\",\n // 18\n Pause: \"Pause\",\n // 19\n CapsLock: \"CapsLock\",\n // 20\n Escape: \"Escape\",\n // 27\n Scape: \"Space\",\n // 32\n ArrowLeft: \"ArrowLeft\",\n // 37\n ArrowUp: \"ArrowUp\",\n // 38\n ArrowRight: \"ArrowRight\",\n // 39\n ArrowDown: \"ArrowDown\",\n // 40\n Insert: \"Insert\",\n // 45\n Delete: \"Delete\",\n // 46\n Meta: \"Meta\",\n // 91 windows key\n ContextMenu: \"ContextMenu\",\n // 93\n ScrollLock: \"ScrollLock\"\n // 145\n}, We = \"Alt\", Re = \"ArrowDown\", Qe = \"ArrowUp\", je = \"ArrowLeft\", qe = \"ArrowRight\", Ge = \"Backspace\", Je = \"CapsLock\", Ke = \"Control\", Xe = \"Delete\", Ye = \"Enter\", Ze = \"Escape\", $e = \"Insert\", _e = \"Meta\", tn = \"Pause\", en = \"ScrollLock\", nn = \"Shift\", on = \"Space\", sn = \"Tab\", Ut = \"animationDuration\", Wt = \"animationDelay\", F = \"animationName\", D = \"animationend\", Rt = \"transitionDuration\", Qt = \"transitionDelay\", C = \"transitionend\", U = \"transitionProperty\", cn = \"addEventListener\", rn = \"removeEventListener\", an = {\n linear: \"linear\",\n easingSinusoidalIn: \"cubic-bezier(0.47,0,0.745,0.715)\",\n easingSinusoidalOut: \"cubic-bezier(0.39,0.575,0.565,1)\",\n easingSinusoidalInOut: \"cubic-bezier(0.445,0.05,0.55,0.95)\",\n easingQuadraticIn: \"cubic-bezier(0.550,0.085,0.680,0.530)\",\n easingQuadraticOut: \"cubic-bezier(0.250,0.460,0.450,0.940)\",\n easingQuadraticInOut: \"cubic-bezier(0.455,0.030,0.515,0.955)\",\n easingCubicIn: \"cubic-bezier(0.55,0.055,0.675,0.19)\",\n easingCubicOut: \"cubic-bezier(0.215,0.61,0.355,1)\",\n easingCubicInOut: \"cubic-bezier(0.645,0.045,0.355,1)\",\n easingQuarticIn: \"cubic-bezier(0.895,0.03,0.685,0.22)\",\n easingQuarticOut: \"cubic-bezier(0.165,0.84,0.44,1)\",\n easingQuarticInOut: \"cubic-bezier(0.77,0,0.175,1)\",\n easingQuinticIn: \"cubic-bezier(0.755,0.05,0.855,0.06)\",\n easingQuinticOut: \"cubic-bezier(0.23,1,0.32,1)\",\n easingQuinticInOut: \"cubic-bezier(0.86,0,0.07,1)\",\n easingExponentialIn: \"cubic-bezier(0.95,0.05,0.795,0.035)\",\n easingExponentialOut: \"cubic-bezier(0.19,1,0.22,1)\",\n easingExponentialInOut: \"cubic-bezier(1,0,0,1)\",\n easingCircularIn: \"cubic-bezier(0.6,0.04,0.98,0.335)\",\n easingCircularOut: \"cubic-bezier(0.075,0.82,0.165,1)\",\n easingCircularInOut: \"cubic-bezier(0.785,0.135,0.15,0.86)\",\n easingBackIn: \"cubic-bezier(0.6,-0.28,0.735,0.045)\",\n easingBackOut: \"cubic-bezier(0.175,0.885,0.32,1.275)\",\n easingBackInOut: \"cubic-bezier(0.68,-0.55,0.265,1.55)\"\n}, un = \"offsetHeight\", ln = \"offsetWidth\", dn = \"scrollHeight\", pn = \"scrollWidth\", mn = \"tabindex\", jt = navigator.userAgentData, A = jt, { userAgent: qt } = navigator, S = qt, z = /iPhone|iPad|iPod|Android/i;\nlet O = !1;\nA ? O = A.brands.some((t) => z.test(t.brand)) : O = z.test(S);\nconst fn = O, x = /(iPhone|iPod|iPad)/, gn = A ? A.brands.some((t) => x.test(t.brand)) : (\n /* istanbul ignore next */\n x.test(S)\n), vn = S ? S.includes(\"Firefox\") : (\n /* istanbul ignore next */\n !1\n), { head: M } = document, En = [\"webkitPerspective\", \"perspective\"].some((t) => t in M.style), Gt = (t, e, n, o) => {\n const s = o || !1;\n t.addEventListener(e, n, s);\n}, Jt = (t, e, n, o) => {\n const s = o || !1;\n t.removeEventListener(e, n, s);\n}, Kt = (t, e, n, o) => {\n const s = (r) => {\n (r.target === t || r.currentTarget === t) && (n.apply(t, [r]), Jt(t, e, s, o));\n };\n Gt(t, e, s, o);\n}, Xt = () => {\n}, bn = (() => {\n let t = !1;\n try {\n const e = Object.defineProperty({}, \"passive\", {\n get: () => (t = !0, t)\n });\n Kt(document, P, Xt, e);\n } catch {\n }\n return t;\n})(), hn = [\"webkitTransform\", \"transform\"].some((t) => t in M.style), yn = \"ontouchstart\" in window || /* istanbul ignore next */\n\"msMaxTouchPoints\" in navigator, wn = [\"webkitAnimation\", \"animation\"].some((t) => t in M.style), An = [\"webkitTransition\", \"transition\"].some((t) => t in M.style), Yt = (t, e) => t.getAttribute(e), Sn = (t, e, n) => e.getAttributeNS(t, n), Mn = (t, e) => t.hasAttribute(e), Nn = (t, e, n) => e.hasAttributeNS(t, n), kn = (t, e, n) => t.setAttribute(e, n), Tn = (t, e, n, o) => e.setAttributeNS(t, n, o), Dn = (t, e) => t.removeAttribute(e), Cn = (t, e, n) => e.removeAttributeNS(t, n), On = (t, ...e) => {\n t.classList.add(...e);\n}, Ln = (t, ...e) => {\n t.classList.remove(...e);\n}, In = (t, e) => t.classList.contains(e), { body: zn } = document, { documentElement: xn } = document, Vn = (t) => Array.from(t), v = (t) => t != null && typeof t == \"object\" || !1, i = (t) => v(t) && typeof t.nodeType == \"number\" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some((e) => t.nodeType === e) || !1, u = (t) => i(t) && t.nodeType === 1 || !1, E = /* @__PURE__ */ new Map(), L = {\n data: E,\n /**\n * Sets web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @param instance the component instance\n */\n set: (t, e, n) => {\n if (!u(t))\n return;\n E.has(e) || E.set(e, /* @__PURE__ */ new Map()), E.get(e).set(t, n);\n },\n /**\n * Returns all instances for specified component.\n *\n * @param component the component's name or a unique key\n * @returns all the component instances\n */\n getAllFor: (t) => E.get(t) || null,\n /**\n * Returns the instance associated with the target.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @returns the instance\n */\n get: (t, e) => {\n if (!u(t) || !e)\n return null;\n const n = L.getAllFor(e);\n return t && n && n.get(t) || null;\n },\n /**\n * Removes web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n */\n remove: (t, e) => {\n const n = L.getAllFor(e);\n !n || !u(t) || (n.delete(t), n.size === 0 && E.delete(e));\n }\n}, Bn = (t, e) => L.get(t, e), N = (t) => typeof t == \"string\" || !1, W = (t) => v(t) && t.constructor.name === \"Window\" || !1, R = (t) => i(t) && t.nodeType === 9 || !1, d = (t) => W(t) ? t.document : R(t) ? t : i(t) ? t.ownerDocument : window.document, k = (t, ...e) => Object.assign(t, ...e), Zt = (t) => {\n if (!t)\n return;\n if (N(t))\n return d().createElement(t);\n const { tagName: e } = t, n = Zt(e);\n if (!n)\n return;\n const o = { ...t };\n return delete o.tagName, k(n, o);\n}, $t = (t, e) => {\n if (!t || !e)\n return;\n if (N(e))\n return d().createElementNS(t, e);\n const { tagName: n } = e, o = $t(t, n);\n if (!o)\n return;\n const s = { ...e };\n return delete s.tagName, k(o, s);\n}, Q = (t, e) => t.dispatchEvent(e), Hn = (t, e, n) => n.indexOf(t) === e, g = (t, e) => {\n const n = getComputedStyle(t), o = e.replace(\"webkit\", \"Webkit\").replace(/([A-Z])/g, \"-$1\").toLowerCase();\n return n.getPropertyValue(o);\n}, _t = (t) => {\n const e = g(t, F), n = g(t, Wt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, te = (t) => {\n const e = g(t, F), n = g(t, Ut), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Pn = (t, e) => {\n let n = 0;\n const o = new Event(D), s = te(t), r = _t(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(D, a), n = 1);\n };\n t.addEventListener(D, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, ee = (t) => {\n const e = g(t, U), n = g(t, Qt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, ne = (t) => {\n const e = g(t, U), n = g(t, Rt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Fn = (t, e) => {\n let n = 0;\n const o = new Event(C), s = ne(t), r = ee(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(C, a), n = 1);\n };\n t.addEventListener(C, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, Un = (t) => Float32Array.from(Array.from(t)), Wn = (t) => Float64Array.from(Array.from(t)), Rn = (t, e) => t.focus(e), V = (t) => [\"true\", !0].includes(t) ? !0 : [\"false\", !1].includes(t) ? !1 : [\"null\", \"\", null, void 0].includes(t) ? null : t !== \"\" && !Number.isNaN(+t) ? +t : t, w = (t) => Object.entries(t), oe = (t) => t.toLowerCase(), Qn = (t, e, n, o) => {\n const s = { ...n }, r = { ...t.dataset }, a = { ...e }, l = {}, p = \"title\";\n return w(r).forEach(([c, m]) => {\n const y = o && typeof c == \"string\" && c.includes(o) ? c.replace(o, \"\").replace(/[A-Z]/g, (j) => oe(j)) : c;\n l[y] = V(m);\n }), w(s).forEach(([c, m]) => {\n s[c] = V(m);\n }), w(e).forEach(([c, m]) => {\n c in s ? a[c] = s[c] : c in l ? a[c] = l[c] : a[c] = c === p ? Yt(t, p) : m;\n }), a;\n}, jn = (t, e) => v(t) && (Object.hasOwn(t, e) || e in t), qn = (t) => Object.keys(t), Gn = (t) => Object.values(t), Jn = (t) => Object.fromEntries(t), Kn = (t, e) => {\n const n = new CustomEvent(t, {\n cancelable: !0,\n bubbles: !0\n });\n return v(e) && k(n, e), n;\n}, Xn = { passive: !0 }, Yn = (t) => t.offsetHeight, Zn = (t, e) => {\n w(e).forEach(([n, o]) => {\n if (o && N(n) && n.includes(\"--\"))\n t.style.setProperty(n, o);\n else {\n const s = {};\n s[n] = o, k(t.style, s);\n }\n });\n}, I = (t) => v(t) && t.constructor.name === \"Map\" || !1, se = (t) => typeof t == \"number\" || !1, f = /* @__PURE__ */ new Map(), $n = {\n /**\n * Sets a new timeout timer for an element, or element -> key association.\n *\n * @param element target element\n * @param callback the callback\n * @param delay the execution delay\n * @param key a unique key\n */\n set: (t, e, n, o) => {\n u(t) && (o && o.length ? (f.has(t) || f.set(t, /* @__PURE__ */ new Map()), f.get(t).set(o, setTimeout(e, n))) : f.set(t, setTimeout(e, n)));\n },\n /**\n * Returns the timer associated with the target.\n *\n * @param element target element\n * @param key a unique\n * @returns the timer\n */\n get: (t, e) => {\n if (!u(t))\n return null;\n const n = f.get(t);\n return e && n && I(n) ? n.get(e) || /* istanbul ignore next */\n null : se(n) ? n : null;\n },\n /**\n * Clears the element's timer.\n *\n * @param element target element\n * @param key a unique key\n */\n clear: (t, e) => {\n if (!u(t))\n return;\n const n = f.get(t);\n e && e.length && I(n) ? (clearTimeout(n.get(e)), n.delete(e), n.size === 0 && f.delete(t)) : (clearTimeout(n), f.delete(t));\n }\n}, _n = (t) => t.toUpperCase(), h = (t, e) => {\n const { width: n, height: o, top: s, right: r, bottom: a, left: l } = t.getBoundingClientRect();\n let p = 1, c = 1;\n if (e && u(t)) {\n const { offsetWidth: m, offsetHeight: y } = t;\n p = m > 0 ? Math.round(n) / m : (\n /* istanbul ignore next */\n 1\n ), c = y > 0 ? Math.round(o) / y : (\n /* istanbul ignore next */\n 1\n );\n }\n return {\n width: n / p,\n height: o / c,\n top: s / c,\n right: r / p,\n bottom: a / c,\n left: l / p,\n x: l / p,\n y: s / c\n };\n}, to = (t) => d(t).body, T = (t) => d(t).documentElement, eo = (t) => d(t).head, no = (t) => {\n const e = W(t), n = e ? t.scrollX : t.scrollLeft, o = e ? t.scrollY : t.scrollTop;\n return { x: n, y: o };\n}, ce = (t) => i(t) && t.constructor.name === \"ShadowRoot\" || !1, oo = (t) => t.nodeName === \"HTML\" ? t : u(t) && t.assignedSlot || // step into the shadow DOM of the parent of a slotted node\ni(t) && t.parentNode || // DOM Element detected\nce(t) && t.host || // ShadowRoot detected\nT(t), re = (t) => {\n if (!u(t))\n return !1;\n const { width: e, height: n } = h(t), { offsetWidth: o, offsetHeight: s } = t;\n return Math.round(e) !== o || Math.round(n) !== s;\n}, so = (t, e, n) => {\n const o = u(e), s = h(t, o && re(e)), r = { x: 0, y: 0 };\n if (o) {\n const a = h(e, !0);\n r.x = a.x + e.clientLeft, r.y = a.y + e.clientTop;\n }\n return {\n x: s.left + n.x - r.x,\n y: s.top + n.y - r.y,\n width: s.width,\n height: s.height\n };\n};\nlet B = 0, H = 0;\nconst b = /* @__PURE__ */ new Map(), ae = (t, e) => {\n let n = e ? B : H;\n if (e) {\n const o = ae(t), s = b.get(o) || /* @__PURE__ */ new Map();\n b.has(o) || b.set(o, s), I(s) && !s.has(e) ? (s.set(e, n), B += 1) : n = s.get(e);\n } else {\n const o = t.id || t;\n b.has(o) ? n = b.get(o) : (b.set(o, n), H += 1);\n }\n return n;\n}, co = (t) => {\n var e;\n return t ? R(t) ? t.defaultView : i(t) ? (e = t == null ? void 0 : t.ownerDocument) == null ? void 0 : e.defaultView : t : window;\n}, ie = (t) => Array.isArray(t) || !1, ro = (t) => i(t) && t.nodeName === \"CANVAS\" || !1, ue = (t) => u(t) && !!t.shadowRoot || !1, ao = (t) => i(t) && [1, 2, 3, 4, 5, 6, 7, 8].some((e) => t.nodeType === e) || !1, io = (t) => {\n if (!i(t))\n return !1;\n const { top: e, bottom: n } = h(t), { clientHeight: o } = T(t);\n return e <= o && n >= 0;\n}, uo = (t) => {\n if (!i(t))\n return !1;\n const { clientWidth: e, clientHeight: n } = T(t), { top: o, left: s, bottom: r, right: a } = h(t, !0);\n return o >= 0 && s >= 0 && r <= n && a <= e;\n}, lo = (t) => ie(t) && t.every(u) || !1, po = (t) => typeof t == \"function\" || !1, mo = (t) => v(t) && t.constructor.name === \"HTMLCollection\" || !1, fo = (t) => u(t) && t.tagName === \"IMG\" || !1, go = (t) => {\n if (!N(t))\n return !1;\n try {\n JSON.parse(t);\n } catch {\n return !1;\n }\n return !0;\n}, vo = (t) => v(t) && t.constructor.name === \"WeakMap\" || !1, Eo = (t) => i(t) && [\"SVG\", \"Image\", \"Video\", \"Canvas\"].some((e) => t.constructor.name.includes(e)) || !1, bo = (t) => v(t) && t.constructor.name === \"NodeList\" || !1, ho = (t) => T(t).dir === \"rtl\", yo = (t) => i(t) && t.constructor.name.includes(\"SVG\") || !1, wo = (t) => i(t) && [\"TABLE\", \"TD\", \"TH\"].includes(t.nodeName) || !1, le = (t, e) => t ? t.closest(e) || // break out of `ShadowRoot`\nle(t.getRootNode().host, e) : null, Ao = (t, e) => u(t) ? t : (i(e) ? e : d()).querySelector(t), de = (t, e) => (i(e) ? e : d()).getElementsByTagName(t), So = (t) => [...de(\"*\", t)].filter(ue), Mo = (t, e) => d(e).getElementById(t) || null, No = (t, e) => (i(e) ? e : d()).querySelectorAll(t), ko = (t, e) => (e && i(e) ? e : d()).getElementsByClassName(\n t\n), To = (t, e) => t.matches(e), Do = \"2.0.0alpha17\";\nexport {\n Vn as ArrayFrom,\n P as DOMContentLoadedEvent,\n Y as DOMMouseScrollEvent,\n L as Data,\n Un as Float32ArrayFrom,\n Wn as Float64ArrayFrom,\n k as ObjectAssign,\n w as ObjectEntries,\n Jn as ObjectFromEntries,\n jn as ObjectHasOwn,\n qn as ObjectKeys,\n Gn as ObjectValues,\n $n as Timer,\n q as abortEvent,\n On as addClass,\n cn as addEventListener,\n Wt as animationDelay,\n Ut as animationDuration,\n D as animationEndEvent,\n F as animationName,\n pe as ariaChecked,\n fe as ariaDescribedBy,\n me as ariaDescription,\n ge as ariaExpanded,\n ve as ariaHasPopup,\n Ee as ariaHidden,\n be as ariaLabel,\n he as ariaLabelledBy,\n ye as ariaModal,\n we as ariaPressed,\n Ae as ariaSelected,\n Me as ariaValueMax,\n Se as ariaValueMin,\n Ne as ariaValueNow,\n ke as ariaValueText,\n G as beforeunloadEvent,\n an as bezierEasings,\n J as blurEvent,\n K as changeEvent,\n le as closest,\n X as contextmenuEvent,\n Kn as createCustomEvent,\n Zt as createElement,\n $t as createElementNS,\n Q as dispatchEvent,\n Hn as distinct,\n zn as documentBody,\n xn as documentElement,\n M as documentHead,\n De as dragEvent,\n ze as dragendEvent,\n Oe as dragenterEvent,\n Le as dragleaveEvent,\n Ie as dragoverEvent,\n Ce as dragstartEvent,\n Pn as emulateAnimationEnd,\n Fn as emulateTransitionEnd,\n Z as errorEvent,\n Rn as focus,\n $ as focusEvent,\n Fe as focusEvents,\n _ as focusinEvent,\n tt as focusoutEvent,\n et as gesturechangeEvent,\n nt as gestureendEvent,\n ot as gesturestartEvent,\n Yt as getAttribute,\n Sn as getAttributeNS,\n h as getBoundingClientRect,\n So as getCustomElements,\n d as getDocument,\n to as getDocumentBody,\n T as getDocumentElement,\n eo as getDocumentHead,\n _t as getElementAnimationDelay,\n te as getElementAnimationDuration,\n Mo as getElementById,\n g as getElementStyle,\n ee as getElementTransitionDelay,\n ne as getElementTransitionDuration,\n ko as getElementsByClassName,\n de as getElementsByTagName,\n Bn as getInstance,\n no as getNodeScroll,\n oo as getParentNode,\n so as getRectRelativeToOffsetParent,\n ae as getUID,\n co as getWindow,\n Mn as hasAttribute,\n Nn as hasAttributeNS,\n In as hasClass,\n gn as isApple,\n ie as isArray,\n ro as isCanvas,\n ue as isCustomElement,\n R as isDocument,\n ao as isElement,\n io as isElementInScrollRange,\n uo as isElementInViewport,\n lo as isElementsArray,\n vn as isFirefox,\n po as isFunction,\n mo as isHTMLCollection,\n u as isHTMLElement,\n fo as isHTMLImageElement,\n go as isJSON,\n I as isMap,\n Eo as isMedia,\n fn as isMobile,\n i as isNode,\n bo as isNodeList,\n se as isNumber,\n v as isObject,\n ho as isRTL,\n yo as isSVGElement,\n re as isScaledElement,\n ce as isShadowRoot,\n N as isString,\n wo as isTableElement,\n vo as isWeakMap,\n W as isWindow,\n We as keyAlt,\n Re as keyArrowDown,\n je as keyArrowLeft,\n qe as keyArrowRight,\n Qe as keyArrowUp,\n Ge as keyBackspace,\n Je as keyCapsLock,\n Ke as keyControl,\n Xe as keyDelete,\n Ye as keyEnter,\n Ze as keyEscape,\n $e as keyInsert,\n _e as keyMeta,\n tn as keyPause,\n en as keyScrollLock,\n nn as keyShift,\n on as keySpace,\n sn as keyTab,\n Ue as keyboardEventKeys,\n st as keydownEvent,\n ct as keypressEvent,\n rt as keyupEvent,\n at as loadEvent,\n xe as loadstartEvent,\n To as matches,\n Be as mouseClickEvents,\n He as mouseHoverEvents,\n Ve as mouseSwipeEvents,\n it as mouseclickEvent,\n ut as mousedblclickEvent,\n lt as mousedownEvent,\n mt as mouseenterEvent,\n pt as mousehoverEvent,\n gt as mouseinEvent,\n ft as mouseleaveEvent,\n bt as mousemoveEvent,\n vt as mouseoutEvent,\n Et as mouseoverEvent,\n dt as mouseupEvent,\n ht as mousewheelEvent,\n yt as moveEvent,\n Te as nativeEvents,\n Xt as noop,\n Qn as normalizeOptions,\n V as normalizeValue,\n Jt as off,\n un as offsetHeight,\n ln as offsetWidth,\n Gt as on,\n Kt as one,\n wt as orientationchangeEvent,\n Xn as passiveHandler,\n At as pointercancelEvent,\n St as pointerdownEvent,\n Mt as pointerleaveEvent,\n Nt as pointermoveEvent,\n kt as pointerupEvent,\n Ao as querySelector,\n No as querySelectorAll,\n Tt as readystatechangeEvent,\n Yn as reflow,\n Dn as removeAttribute,\n Cn as removeAttributeNS,\n Ln as removeClass,\n rn as removeEventListener,\n Dt as resetEvent,\n Ct as resizeEvent,\n zt as scrollEvent,\n dn as scrollHeight,\n pn as scrollWidth,\n Ot as selectEvent,\n Lt as selectendEvent,\n It as selectstartEvent,\n kn as setAttribute,\n Tn as setAttributeNS,\n Zn as setElementStyle,\n xt as submitEvent,\n En as support3DTransform,\n wn as supportAnimation,\n bn as supportPassive,\n yn as supportTouch,\n hn as supportTransform,\n An as supportTransition,\n mn as tabindex,\n oe as toLowerCase,\n _n as toUpperCase,\n Pe as touchEvents,\n Ht as touchcancelEvent,\n Pt as touchendEvent,\n Bt as touchmoveEvent,\n Vt as touchstartEvent,\n Qt as transitionDelay,\n Rt as transitionDuration,\n C as transitionEndEvent,\n U as transitionProperty,\n Ft as unloadEvent,\n S as userAgent,\n A as userAgentData,\n Do as version\n};\n//# sourceMappingURL=shorty.mjs.map\n","const N = [\"transparent\", \"currentColor\", \"inherit\", \"revert\", \"initial\"], b = (o) => {\n const t = Math.floor(o);\n return o - t < 0.5 ? t : Math.round(o);\n}, T = [\n [\n \"aliceblue\",\n {\n r: 240,\n g: 248,\n b: 255\n }\n ],\n [\n \"antiquewhite\",\n {\n r: 250,\n g: 235,\n b: 215\n }\n ],\n [\n \"aqua\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"aquamarine\",\n {\n r: 127,\n g: 255,\n b: 212\n }\n ],\n [\n \"azure\",\n {\n r: 240,\n g: 255,\n b: 255\n }\n ],\n [\n \"beige\",\n {\n r: 245,\n g: 245,\n b: 220\n }\n ],\n [\n \"bisque\",\n {\n r: 255,\n g: 228,\n b: 196\n }\n ],\n [\n \"black\",\n {\n r: 0,\n g: 0,\n b: 0\n }\n ],\n [\n \"blanchedalmond\",\n {\n r: 255,\n g: 235,\n b: 205\n }\n ],\n [\n \"blue\",\n {\n r: 0,\n g: 0,\n b: 255\n }\n ],\n [\n \"blueviolet\",\n {\n r: 138,\n g: 43,\n b: 226\n }\n ],\n [\n \"brown\",\n {\n r: 165,\n g: 42,\n b: 42\n }\n ],\n [\n \"burlywood\",\n {\n r: 222,\n g: 184,\n b: 135\n }\n ],\n [\n \"cadetblue\",\n {\n r: 95,\n g: 158,\n b: 160\n }\n ],\n [\n \"chartreuse\",\n {\n r: 127,\n g: 255,\n b: 0\n }\n ],\n [\n \"chocolate\",\n {\n r: 210,\n g: 105,\n b: 30\n }\n ],\n [\n \"coral\",\n {\n r: 255,\n g: 127,\n b: 80\n }\n ],\n [\n \"cornflowerblue\",\n {\n r: 100,\n g: 149,\n b: 237\n }\n ],\n [\n \"cornsilk\",\n {\n r: 255,\n g: 248,\n b: 220\n }\n ],\n [\n \"crimson\",\n {\n r: 220,\n g: 20,\n b: 60\n }\n ],\n [\n \"cyan\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"darkblue\",\n {\n r: 0,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkcyan\",\n {\n r: 0,\n g: 139,\n b: 139\n }\n ],\n [\n \"darkgoldenrod\",\n {\n r: 184,\n g: 134,\n b: 11\n }\n ],\n [\n \"darkgray\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkgreen\",\n {\n r: 0,\n g: 100,\n b: 0\n }\n ],\n [\n \"darkgrey\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkkhaki\",\n {\n r: 189,\n g: 183,\n b: 107\n }\n ],\n [\n \"darkmagenta\",\n {\n r: 139,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkolivegreen\",\n {\n r: 85,\n g: 107,\n b: 47\n }\n ],\n [\n \"darkorange\",\n {\n r: 255,\n g: 140,\n b: 0\n }\n ],\n [\n \"darkorchid\",\n {\n r: 153,\n g: 50,\n b: 204\n }\n ],\n [\n \"darkred\",\n {\n r: 139,\n g: 0,\n b: 0\n }\n ],\n [\n \"darksalmon\",\n {\n r: 233,\n g: 150,\n b: 122\n }\n ],\n [\n \"darkseagreen\",\n {\n r: 143,\n g: 188,\n b: 143\n }\n ],\n [\n \"darkslateblue\",\n {\n r: 72,\n g: 61,\n b: 139\n }\n ],\n [\n \"darkslategray\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkslategrey\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkturquoise\",\n {\n r: 0,\n g: 206,\n b: 209\n }\n ],\n [\n \"darkviolet\",\n {\n r: 148,\n g: 0,\n b: 211\n }\n ],\n [\n \"deeppink\",\n {\n r: 255,\n g: 20,\n b: 147\n }\n ],\n [\n \"deepskyblue\",\n {\n r: 0,\n g: 191,\n b: 255\n }\n ],\n [\n \"dimgray\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dimgrey\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dodgerblue\",\n {\n r: 30,\n g: 144,\n b: 255\n }\n ],\n [\n \"firebrick\",\n {\n r: 178,\n g: 34,\n b: 34\n }\n ],\n [\n \"floralwhite\",\n {\n r: 255,\n g: 250,\n b: 240\n }\n ],\n [\n \"forestgreen\",\n {\n r: 34,\n g: 139,\n b: 34\n }\n ],\n [\n \"fuchsia\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"gainsboro\",\n {\n r: 220,\n g: 220,\n b: 220\n }\n ],\n [\n \"ghostwhite\",\n {\n r: 248,\n g: 248,\n b: 255\n }\n ],\n [\n \"goldenrod\",\n {\n r: 218,\n g: 165,\n b: 32\n }\n ],\n [\n \"gold\",\n {\n r: 255,\n g: 215,\n b: 0\n }\n ],\n [\n \"gray\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"green\",\n {\n r: 0,\n g: 128,\n b: 0\n }\n ],\n [\n \"greenyellow\",\n {\n r: 173,\n g: 255,\n b: 47\n }\n ],\n [\n \"grey\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"honeydew\",\n {\n r: 240,\n g: 255,\n b: 240\n }\n ],\n [\n \"hotpink\",\n {\n r: 255,\n g: 105,\n b: 180\n }\n ],\n [\n \"indianred\",\n {\n r: 205,\n g: 92,\n b: 92\n }\n ],\n [\n \"indigo\",\n {\n r: 75,\n g: 0,\n b: 130\n }\n ],\n [\n \"ivory\",\n {\n r: 255,\n g: 255,\n b: 240\n }\n ],\n [\n \"khaki\",\n {\n r: 240,\n g: 230,\n b: 140\n }\n ],\n [\n \"lavenderblush\",\n {\n r: 255,\n g: 240,\n b: 245\n }\n ],\n [\n \"lavender\",\n {\n r: 230,\n g: 230,\n b: 250\n }\n ],\n [\n \"lawngreen\",\n {\n r: 124,\n g: 252,\n b: 0\n }\n ],\n [\n \"lemonchiffon\",\n {\n r: 255,\n g: 250,\n b: 205\n }\n ],\n [\n \"lightblue\",\n {\n r: 173,\n g: 216,\n b: 230\n }\n ],\n [\n \"lightcoral\",\n {\n r: 240,\n g: 128,\n b: 128\n }\n ],\n [\n \"lightcyan\",\n {\n r: 224,\n g: 255,\n b: 255\n }\n ],\n [\n \"lightgoldenrodyellow\",\n {\n r: 250,\n g: 250,\n b: 210\n }\n ],\n [\n \"lightgray\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightgreen\",\n {\n r: 144,\n g: 238,\n b: 144\n }\n ],\n [\n \"lightgrey\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightpink\",\n {\n r: 255,\n g: 182,\n b: 193\n }\n ],\n [\n \"lightsalmon\",\n {\n r: 255,\n g: 160,\n b: 122\n }\n ],\n [\n \"lightseagreen\",\n {\n r: 32,\n g: 178,\n b: 170\n }\n ],\n [\n \"lightskyblue\",\n {\n r: 135,\n g: 206,\n b: 250\n }\n ],\n [\n \"lightslategray\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightslategrey\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightsteelblue\",\n {\n r: 176,\n g: 196,\n b: 222\n }\n ],\n [\n \"lightyellow\",\n {\n r: 255,\n g: 255,\n b: 224\n }\n ],\n [\n \"lime\",\n {\n r: 0,\n g: 255,\n b: 0\n }\n ],\n [\n \"limegreen\",\n {\n r: 50,\n g: 205,\n b: 50\n }\n ],\n [\n \"linen\",\n {\n r: 250,\n g: 240,\n b: 230\n }\n ],\n [\n \"magenta\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"maroon\",\n {\n r: 128,\n g: 0,\n b: 0\n }\n ],\n [\n \"mediumaquamarine\",\n {\n r: 102,\n g: 205,\n b: 170\n }\n ],\n [\n \"mediumblue\",\n {\n r: 0,\n g: 0,\n b: 205\n }\n ],\n [\n \"mediumorchid\",\n {\n r: 186,\n g: 85,\n b: 211\n }\n ],\n [\n \"mediumpurple\",\n {\n r: 147,\n g: 112,\n b: 219\n }\n ],\n [\n \"mediumseagreen\",\n {\n r: 60,\n g: 179,\n b: 113\n }\n ],\n [\n \"mediumslateblue\",\n {\n r: 123,\n g: 104,\n b: 238\n }\n ],\n [\n \"mediumspringgreen\",\n {\n r: 0,\n g: 250,\n b: 154\n }\n ],\n [\n \"mediumturquoise\",\n {\n r: 72,\n g: 209,\n b: 204\n }\n ],\n [\n \"mediumvioletred\",\n {\n r: 199,\n g: 21,\n b: 133\n }\n ],\n [\n \"midnightblue\",\n {\n r: 25,\n g: 25,\n b: 112\n }\n ],\n [\n \"mintcream\",\n {\n r: 245,\n g: 255,\n b: 250\n }\n ],\n [\n \"mistyrose\",\n {\n r: 255,\n g: 228,\n b: 225\n }\n ],\n [\n \"moccasin\",\n {\n r: 255,\n g: 228,\n b: 181\n }\n ],\n [\n \"navajowhite\",\n {\n r: 255,\n g: 222,\n b: 173\n }\n ],\n [\n \"navy\",\n {\n r: 0,\n g: 0,\n b: 128\n }\n ],\n [\n \"oldlace\",\n {\n r: 253,\n g: 245,\n b: 230\n }\n ],\n [\n \"olive\",\n {\n r: 128,\n g: 128,\n b: 0\n }\n ],\n [\n \"olivedrab\",\n {\n r: 107,\n g: 142,\n b: 35\n }\n ],\n [\n \"orange\",\n {\n r: 255,\n g: 165,\n b: 0\n }\n ],\n [\n \"orangered\",\n {\n r: 255,\n g: 69,\n b: 0\n }\n ],\n [\n \"orchid\",\n {\n r: 218,\n g: 112,\n b: 214\n }\n ],\n [\n \"palegoldenrod\",\n {\n r: 238,\n g: 232,\n b: 170\n }\n ],\n [\n \"palegreen\",\n {\n r: 152,\n g: 251,\n b: 152\n }\n ],\n [\n \"paleturquoise\",\n {\n r: 175,\n g: 238,\n b: 238\n }\n ],\n [\n \"palevioletred\",\n {\n r: 219,\n g: 112,\n b: 147\n }\n ],\n [\n \"papayawhip\",\n {\n r: 255,\n g: 239,\n b: 213\n }\n ],\n [\n \"peachpuff\",\n {\n r: 255,\n g: 218,\n b: 185\n }\n ],\n [\n \"peru\",\n {\n r: 205,\n g: 133,\n b: 63\n }\n ],\n [\n \"pink\",\n {\n r: 255,\n g: 192,\n b: 203\n }\n ],\n [\n \"plum\",\n {\n r: 221,\n g: 160,\n b: 221\n }\n ],\n [\n \"powderblue\",\n {\n r: 176,\n g: 224,\n b: 230\n }\n ],\n [\n \"purple\",\n {\n r: 128,\n g: 0,\n b: 128\n }\n ],\n [\n \"rebeccapurple\",\n {\n r: 102,\n g: 51,\n b: 153\n }\n ],\n [\n \"red\",\n {\n r: 255,\n g: 0,\n b: 0\n }\n ],\n [\n \"rosybrown\",\n {\n r: 188,\n g: 143,\n b: 143\n }\n ],\n [\n \"royalblue\",\n {\n r: 65,\n g: 105,\n b: 225\n }\n ],\n [\n \"saddlebrown\",\n {\n r: 139,\n g: 69,\n b: 19\n }\n ],\n [\n \"salmon\",\n {\n r: 250,\n g: 128,\n b: 114\n }\n ],\n [\n \"sandybrown\",\n {\n r: 244,\n g: 164,\n b: 96\n }\n ],\n [\n \"seagreen\",\n {\n r: 46,\n g: 139,\n b: 87\n }\n ],\n [\n \"seashell\",\n {\n r: 255,\n g: 245,\n b: 238\n }\n ],\n [\n \"sienna\",\n {\n r: 160,\n g: 82,\n b: 45\n }\n ],\n [\n \"silver\",\n {\n r: 192,\n g: 192,\n b: 192\n }\n ],\n [\n \"skyblue\",\n {\n r: 135,\n g: 206,\n b: 235\n }\n ],\n [\n \"slateblue\",\n {\n r: 106,\n g: 90,\n b: 205\n }\n ],\n [\n \"slategray\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"slategrey\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"snow\",\n {\n r: 255,\n g: 250,\n b: 250\n }\n ],\n [\n \"springgreen\",\n {\n r: 0,\n g: 255,\n b: 127\n }\n ],\n [\n \"steelblue\",\n {\n r: 70,\n g: 130,\n b: 180\n }\n ],\n [\n \"tan\",\n {\n r: 210,\n g: 180,\n b: 140\n }\n ],\n [\n \"teal\",\n {\n r: 0,\n g: 128,\n b: 128\n }\n ],\n [\n \"thistle\",\n {\n r: 216,\n g: 191,\n b: 216\n }\n ],\n [\n \"tomato\",\n {\n r: 255,\n g: 99,\n b: 71\n }\n ],\n [\n \"turquoise\",\n {\n r: 64,\n g: 224,\n b: 208\n }\n ],\n [\n \"violet\",\n {\n r: 238,\n g: 130,\n b: 238\n }\n ],\n [\n \"wheat\",\n {\n r: 245,\n g: 222,\n b: 179\n }\n ],\n [\n \"white\",\n {\n r: 255,\n g: 255,\n b: 255\n }\n ],\n [\n \"whitesmoke\",\n {\n r: 245,\n g: 245,\n b: 245\n }\n ],\n [\n \"yellow\",\n {\n r: 255,\n g: 255,\n b: 0\n }\n ],\n [\n \"yellowgreen\",\n {\n r: 154,\n g: 205,\n b: 50\n }\n ]\n], B = \"deg|rad|grad|turn\", U = \"[-\\\\+]?\\\\d+%?\", D = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\", L = `[-\\\\+]?\\\\d*\\\\.?\\\\d+(?:${B})?`, v = `(?:${D})|(?:${U})`, F = `(?:${v})|(?:${L}?)`, rr = \"(?:[\\\\s|\\\\(\\\\s|\\\\s\\\\(\\\\s]+)?\", tr = \"(?:[\\\\s|\\\\)\\\\s]+)?\", O = \"(?:[,|\\\\s]+)\", er = \"(?:[,|\\\\/\\\\s]*)?\", $ = `${rr}(${F})${O}(${v})${O}(${v})${er}(${v})?${tr}`, f = {\n CSS_UNIT: new RegExp(F),\n ANGLES: B,\n CSS_ANGLE: L,\n CSS_INTEGER: U,\n CSS_NUMBER: D,\n CSS_UNIT2: F,\n PERMISSIVE_MATCH: $,\n hwb: new RegExp(`hwb${$}`),\n rgb: new RegExp(`rgb(?:a)?${$}`),\n hsl: new RegExp(`hsl(?:a)?${$}`),\n hsv: new RegExp(`hsv(?:a)?${$}`),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n}, V = (o) => N.includes(o), k = (o, t) => o !== null && typeof o == \"object\" && Object.keys(t).every((r) => r in o), Z = (o) => `${o}`.includes(\".\") && parseFloat(o) === 1, R = (o) => typeof o == \"string\" && o.includes(\"%\"), c = (o) => !!f.CSS_UNIT.exec(`${o}`), z = [\"rgb\", \"hex\", \"hsl\", \"hsv\", \"hwb\"], J = (o) => N.includes(o) || [\"#\", ...z].some((t) => o.includes(t)) ? !1 : T.some(([t]) => o === t), u = (o, t) => {\n let r = o;\n if (typeof o == \"number\" && Math.min(o, 0) === 0 && // round values to 6 decimals Math.round(N * (10 ** 6)) / 10 ** 6\n Math.max(o, 1) === 1)\n return o;\n Z(o) && (r = \"100%\");\n const e = R(r);\n return r = t === 360 ? parseFloat(r) : Math.min(t, Math.max(0, parseFloat(r))), e && (r = r * t / 100), Math.abs(r - t) < 1e-6 ? 1 : (t === 360 ? r = (r < 0 ? r % t + t : r % t) / t : r = r % t / t, r);\n}, M = (o) => {\n let t = parseFloat(o);\n return (Number.isNaN(t) || t < 0 || t > 1) && (t = 1), t;\n}, x = (o) => Math.min(1, Math.max(0, o)), p = (o) => o.length === 1 ? `0${o}` : String(o), K = (o) => {\n const [[, t]] = T.filter(([r]) => r === o.toLowerCase());\n return t;\n}, h = (o) => parseInt(o, 16), E = (o) => h(o) / 255, Q = (o) => b(o * 255).toString(16), _ = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0, g = 0;\n const a = (e + s) / 2;\n if (e === s)\n g = 0, n = 0;\n else {\n const i = e - s;\n g = a > 0.5 ? i / (2 - e - s) : i / (e + s), e === o && (n = (t - r) / i + (t < r ? 6 : 0)), e === t && (n = (r - o) / i + 2), e === r && (n = (o - t) / i + 4), n /= 6;\n }\n return { h: n, s: g, l: a };\n}, H = (o, t, r) => {\n let e = r;\n return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? o + (t - o) * (6 * e) : e < 1 / 2 ? t : e < 2 / 3 ? o + (t - o) * (2 / 3 - e) * 6 : o;\n}, y = (o, t, r) => {\n let e = 0, s = 0, n = 0;\n if (t === 0)\n s = r, n = r, e = r;\n else if (r) {\n const g = r < 0.5 ? r * (1 + t) : r + t - r * t, a = 2 * r - g;\n e = H(a, g, o + 1 / 3), s = H(a, g, o), n = H(a, g, o - 1 / 3);\n }\n return { r: e, g: s, b: n };\n}, G = (o, t, r) => {\n let e = 0, s = 0;\n const n = Math.min(o, t, r), g = Math.max(o, t, r), a = 1 - g;\n if (g === n)\n return { h: 0, w: n, b: a };\n o === n ? (e = t - r, s = 3) : (e = t === n ? r - o : o - t, s = t === n ? 5 : 1);\n const i = (s - e / (g - n)) / 6;\n return {\n h: i === 1 ? 0 : i,\n w: n,\n b: a\n };\n}, X = (o, t, r) => {\n if (t + r >= 1) {\n const g = t / (t + r);\n return { r: g, g, b: g };\n }\n let { r: e, g: s, b: n } = y(o, 1, 0.5);\n return [e, s, n] = [e, s, n].map((g) => g * (1 - t - r) + t), { r: e, g: s, b: n };\n}, P = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0;\n const g = e, a = e - s, i = e === 0 ? 0 : a / e;\n return e === s ? n = 0 : (o === e && (n = (t - r) / a + (t < r ? 6 : 0)), t === e && (n = (r - o) / a + 2), r === e && (n = (o - t) / a + 4), n /= 6), { h: n, s: i, v: g };\n}, I = (o, t, r) => {\n const e = o * 6, s = t, n = r, g = Math.floor(e), a = e - g, i = n * (1 - s), l = n * (1 - a * s), d = n * (1 - (1 - a) * s), m = g % 6, w = [n, l, i, i, d, n][m], S = [d, n, n, l, i, i][m], A = [i, i, d, n, n, l][m];\n return { r: w, g: S, b: A };\n}, j = (o, t, r, e) => {\n const s = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16))\n ];\n return e && s[0].charAt(0) === s[0].charAt(1) && s[1].charAt(0) === s[1].charAt(1) && s[2].charAt(0) === s[2].charAt(1) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) : s.join(\"\");\n}, C = (o, t, r, e, s) => {\n const n = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16)),\n p(Q(e))\n ];\n return s && n[0].charAt(0) === n[0].charAt(1) && n[1].charAt(0) === n[1].charAt(1) && n[2].charAt(0) === n[2].charAt(1) && n[3].charAt(0) === n[3].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join(\"\");\n}, Y = (o) => {\n const t = String(o).trim().toLowerCase();\n if (J(t))\n return Object.assign(K(t), {\n a: 1,\n format: \"rgb\",\n ok: !0\n });\n if (V(t))\n return {\n r: 0,\n g: 0,\n b: 0,\n a: t === \"transparent\" ? 0 : 1,\n format: \"rgb\",\n ok: !0\n };\n let [, r, e, s, n] = f.rgb.exec(t) || [];\n return r && e && s ? {\n r,\n g: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"rgb\",\n ok: !0\n } : ([, r, e, s, n] = f.hsl.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n l: s,\n a: n !== void 0 ? n : 1,\n format: \"hsl\",\n ok: !0\n } : ([, r, e, s, n] = f.hsv.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n v: s,\n a: n !== void 0 ? n : 1,\n format: \"hsv\",\n ok: !0\n } : ([, r, e, s, n] = f.hwb.exec(t) || [], r && e && s ? {\n h: r,\n w: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"hwb\",\n ok: !0\n } : ([, r, e, s, n] = f.hex8.exec(t) || [], r && e && s && n ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: E(n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex6.exec(t) || [], r && e && s ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : ([, r, e, s, n] = f.hex4.exec(t) || [], r && e && s && n ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: E(n + n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex3.exec(t) || [], r && e && s ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : {\n r: 0,\n g: 0,\n b: 0,\n a: 1,\n format: \"rgb\",\n ok: !o\n })))))));\n}, q = (o) => {\n let t = { r: 0, g: 0, b: 0 }, r = o, e = 1, s, n, g, a, i, l, d, m, w = \"rgb\", S = !1;\n return (!r || typeof r == \"string\") && (r = Y(r), S = r.ok), k(r, t) && c(r.r) && c(r.g) && c(r.b) && ({ r: d, g: m, b: i } = r, [d, m, i] = [d, m, i].map((A) => u(A, R(A) ? 100 : 255)), t = { r: d, g: m, b: i }, w = \"format\" in r ? r.format : \"rgb\"), k(r, { h: 0, s: 0, v: 0 }) && c(r.h) && c(r.s) && c(r.v) && ({ h: l, s, v: n } = r, l = u(l, 360), s = u(s, 100), n = u(n, 100), t = I(l, s, n), w = \"hsv\"), k(r, { h: 0, s: 0, l: 0 }) && c(r.h) && c(r.s) && c(r.l) && ({ h: l, s, l: g } = r, l = u(l, 360), s = u(s, 100), g = u(g, 100), t = y(l, s, g), w = \"hsl\"), k(r, { h: 0, w: 0, b: 0 }) && c(r.h) && c(r.w) && c(r.b) && ({ h: l, w: a, b: i } = r, l = u(l, 360), a = u(a, 100), i = u(i, 100), t = X(l, a, i), w = \"hwb\"), c(r.a) && (e = r.a, e = R(e) || parseFloat(`${e}`) > 1 ? u(e, 100) : e), {\n r: t.r,\n g: t.g,\n b: t.b,\n a: M(e),\n format: w,\n ok: S\n };\n}, sr = \"1.0.8\";\nclass W {\n // bring main utilities to front\n static matchers = f;\n static isOnePointZero = Z;\n static isPercentage = R;\n static isValidCSSUnit = c;\n static isNonColor = V;\n static isColorName = J;\n static isColorType = k;\n static pad2 = p;\n static clamp01 = x;\n static bound01 = u;\n static boundAlpha = M;\n static getRGBFromName = K;\n static convertHexToDecimal = E;\n static convertDecimalToHex = Q;\n static rgbToHsl = _;\n static rgbToHex = j;\n static rgbToHsv = P;\n static rgbToHwb = G;\n static rgbaToHex = C;\n static hslToRgb = I;\n static hsvToRgb = I;\n static hueToRgb = H;\n static hwbToRgb = X;\n static parseIntFromHex = h;\n static stringInputToObject = Y;\n static inputToRGB = q;\n static roundPart = b;\n static webColors = T;\n static nonColors = N;\n static version = sr;\n // main public properties\n r;\n g;\n b;\n a;\n format;\n ok;\n originalInput;\n // main public methods\n constructor(t, r) {\n const e = r && z.includes(r) ? r : \"\", { r: s, g: n, b: g, a, ok: i, format: l } = q(t);\n this.originalInput = t, this.r = s, this.g = n, this.b = g, this.a = a, this.ok = i, this.format = e || l;\n }\n /**\n * Checks if the current input value is a valid colour.\n */\n get isValid() {\n return this.ok;\n }\n /**\n * Checks if the current colour requires a light text colour.\n */\n get isDark() {\n return this.brightness < 120;\n }\n /**\n * Returns the perceived luminance of a colour.\n *\n * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n */\n get luminance() {\n const { r: t, g: r, b: e } = this;\n let s = 0, n = 0, g = 0;\n return t <= 0.03928 ? s = t / 12.92 : s = ((t + 0.055) / 1.055) ** 2.4, r <= 0.03928 ? n = r / 12.92 : n = ((r + 0.055) / 1.055) ** 2.4, e <= 0.03928 ? g = e / 12.92 : g = ((e + 0.055) / 1.055) ** 2.4, 0.2126 * s + 0.7152 * n + 0.0722 * g;\n }\n /**\n * Returns the perceived brightness of the colour.\n */\n get brightness() {\n const { r: t, g: r, b: e } = this.toRgb();\n return (t * 299 + r * 587 + e * 114) / 1e3;\n }\n /**\n * Returns the web colour name closest to the current colour.\n */\n get name() {\n const { r: t, g: r, b: e } = this.toRgb(), [s] = T.map(([n, g]) => {\n const a = (\n // ((rgb.r - r) ** 2 + (rgb.g - g) ** 2 + (rgb.b - b) ** 2) ** 0.5; // standard\n (((g.r - t) * 0.3) ** 2 + ((g.g - r) * 0.6) ** 2 + ((g.b - e) * 0.1) ** 2) ** 0.5\n );\n return [n, a];\n }).find(([, n], g, a) => n === Math.min(...a.map(([, i]) => i)));\n return s;\n }\n /**\n * Returns the colour as an RGBA object.\n */\n toRgb() {\n let { r: t, g: r, b: e, a: s } = this;\n return [t, r, e] = [t, r, e].map((n) => b(n * 255 * 100) / 100), s = b(s * 100) / 100, {\n r: t,\n g: r,\n b: e,\n a: s\n };\n }\n /**\n * Returns the RGBA values concatenated into a CSS3 Module string format.\n * * rgb(255,255,255)\n * * rgba(255,255,255,0.5)\n */\n toRgbString() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b);\n return s === 1 ? `rgb(${n}, ${g}, ${a})` : `rgba(${n}, ${g}, ${a}, ${s})`;\n }\n /**\n * Returns the RGBA values concatenated into a CSS4 Module string format.\n * * rgb(255 255 255)\n * * rgb(255 255 255 / 50%)\n */\n toRgbCSS4String() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b), i = s === 1 ? \"\" : ` / ${b(s * 100)}%`;\n return `rgb(${n} ${g} ${a}${i})`;\n }\n /**\n * Returns the hexadecimal value of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the decimal value.\n */\n toHex(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return n === 1 ? j(r, e, s, t) : C(r, e, s, n, t);\n }\n /**\n * Returns the CSS valid hexadecimal vaue of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the value.\n */\n toHexString(t) {\n return `#${this.toHex(t)}`;\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return C(r, e, s, n, t);\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8String(t) {\n return `#${this.toHex8(t)}`;\n }\n /**\n * Returns the colour as a HSVA object.\n */\n toHsv() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, v: a } = P(t, r, e);\n return {\n h: n,\n s: g,\n v: a,\n a: s\n };\n }\n /**\n * Returns the colour as an HSLA object.\n */\n toHsl() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, l: a } = _(t, r, e);\n return {\n h: n,\n s: g,\n l: a,\n a: s\n };\n }\n /**\n * Returns the HSLA values concatenated into a CSS3 Module format string.\n * * `hsl(150, 100%, 50%)`\n * * `hsla(150, 100%, 50%, 0.5)`\n */\n toHslString() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n return t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100) / 100, s === 1 ? `hsl(${t}, ${r}%, ${e}%)` : `hsla(${t}, ${r}%, ${e}%, ${s})`;\n }\n /**\n * Returns the HSLA values concatenated into a CSS4 Module format string.\n * * `hsl(150deg 100% 50%)`\n * * `hsl(150deg 100% 50% / 50%)`\n */\n toHslCSS4String() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hsl(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Returns the colour as an HWBA object.\n */\n toHwb() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, w: g, b: a } = G(t, r, e);\n return {\n h: n,\n w: g,\n b: a,\n a: s\n };\n }\n /**\n * Returns the HWBA values concatenated into a string.\n */\n toHwbString() {\n let { h: t, w: r, b: e, a: s } = this.toHwb();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hwb(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Sets the alpha value of the current colour.\n */\n setAlpha(t) {\n return typeof t != \"number\" ? this : (this.a = M(t), this);\n }\n /**\n * Saturate the colour with a given amount.\n */\n saturate(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, x(e + t / 100), s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Desaturate the colour with a given amount.\n */\n desaturate(t) {\n return typeof t == \"number\" ? this.saturate(-t) : this;\n }\n /**\n * Completely desaturates a colour into greyscale.\n * Same as calling `desaturate(100)`\n */\n greyscale() {\n return this.saturate(-100);\n }\n /**\n * Increase the colour lightness with a given amount.\n */\n lighten(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, e, x(s + t / 100));\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Decrease the colour lightness with a given amount.\n */\n darken(t) {\n return typeof t == \"number\" ? this.lighten(-t) : this;\n }\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n spin(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(x((r * 360 + t) % 360 / 360), e, s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /** Returns a clone of the current `Color` instance. */\n clone() {\n return new W(this);\n }\n /**\n * Returns the colour value in CSS valid string format.\n */\n toString(t) {\n const { format: r } = this;\n return r === \"hex\" ? this.toHexString(t) : r === \"hsl\" ? this.toHslString() : r === \"hwb\" ? this.toHwbString() : this.toRgbString();\n }\n}\nexport {\n W as default\n};\n//# sourceMappingURL=index.mjs.map\n","import Color from '@thednp/color';\n// import { isNumber } from '@thednp/shorty';\n\n/**\n * Returns a color palette with a given set of parameters.\n *\n * @example\n * new ColorPalette(0, 12, 10, 80);\n * // => { hue: 0, hueSteps: 12, lightSteps: 10, saturation: 80, colors: Array }\n */\nexport default class ColorPalette {\n public static Color = Color;\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n colors: Color[];\n /**\n * The `hue` parameter is optional, which would be set to 0.\n * * `args.hue` the starting Hue [0, 360]\n * * `args.hueSteps` Hue Steps Count [5, 24]\n * * `args.lightSteps` Lightness Steps Count [5, 12]\n * * `args.saturation` Saturation [0, 100]\n */\n constructor(...args: [number?, number?, number?, number?]) {\n let hue = 0;\n let hueSteps = 12;\n let lightSteps = 10;\n let lightnessArray = [0.5];\n let saturation = 100;\n // if (!args.every(n => isNumber(n))) throw TypeError('ColorPalette only accepts numbers.');\n\n if (args.length === 4) {\n [hue, hueSteps, lightSteps, saturation] = args as [number, number, number, number];\n } else if (args.length === 3) {\n [hue, hueSteps, lightSteps] = args as [number, number, number];\n } else if (args.length === 2) {\n [hueSteps, lightSteps] = args as [number, number];\n if ([hueSteps, lightSteps].some(n => n < 1)) {\n throw TypeError('ColorPalette: the two minimum arguments must be numbers higher than 0.');\n }\n }\n\n const colors: Color[] = [];\n const hueStep = 360 / hueSteps;\n const half = Color.roundPart((lightSteps - (lightSteps % 2 ? 1 : 0)) / 2);\n const steps1To13 = [0.25, 0.2, 0.15, 0.11, 0.09, 0.075];\n const lightSets = [\n [1, 2, 3],\n [4, 5],\n [6, 7],\n [8, 9],\n [10, 11],\n [12, 13],\n ];\n const closestSet = lightSets.find(set => set.includes(lightSteps));\n\n // find a lightStep that won't go beyond black and white\n // something within the [10-90] range of lightness\n const lightStep = closestSet\n ? steps1To13[lightSets.indexOf(closestSet)]\n : 100 / (lightSteps + (lightSteps % 2 ? 0 : 1)) / 100;\n\n // light tints\n for (let i = 1; i < half + 1; i += 1) {\n lightnessArray = [...lightnessArray, 0.5 + lightStep * i];\n }\n\n // dark tints\n for (let i = 1; i < lightSteps - half; i += 1) {\n lightnessArray = [0.5 - lightStep * i, ...lightnessArray];\n }\n\n // feed `colors` Array\n for (let i = 0; i < hueSteps; i += 1) {\n const currentHue = ((hue + i * hueStep) % 360) / 360;\n lightnessArray.forEach(l => {\n const newColor = new Color({ h: currentHue, s: 1, l });\n colors.push(saturation < 100 ? newColor.saturate(saturation - 100) : newColor);\n });\n }\n\n this.hue = hue;\n this.hueSteps = hueSteps;\n this.lightSteps = lightSteps;\n this.saturation = saturation;\n this.colors = colors;\n }\n}\n","import ColorPickerLabels from '../interface/colorPickerLabels';\n\n/** The labels presented to the user. */\nconst colorPickerLabels: ColorPickerLabels = {\n pickerLabel: 'Colour Picker',\n appearanceLabel: 'Colour Appearance',\n valueLabel: 'Colour Value',\n toggleLabel: 'Select Colour',\n presetsLabel: 'Colour Presets',\n defaultsLabel: 'Colour Defaults',\n formatLabel: 'Format',\n alphaLabel: 'Alpha',\n hexLabel: 'Hexadecimal',\n hueLabel: 'Hue',\n whitenessLabel: 'Whiteness',\n blacknessLabel: 'Blackness',\n saturationLabel: 'Saturation',\n lightnessLabel: 'Lightness',\n redLabel: 'Red',\n greenLabel: 'Green',\n blueLabel: 'Blue',\n};\n\nexport default colorPickerLabels;\n","/** A list of 17 color names used for WAI-ARIA compliance. */\nconst colorNames: string[] = [\n 'white',\n 'black',\n 'grey',\n 'red',\n 'orange',\n 'brown',\n 'gold',\n 'olive',\n 'yellow',\n 'lime',\n 'green',\n 'teal',\n 'cyan',\n 'blue',\n 'violet',\n 'magenta',\n 'pink',\n];\nexport default colorNames;\n","import { isString } from '@thednp/shorty';\n\n/**\n * Check if a string is valid JSON string.\n *\n * @param str the string input\n * @returns the query result\n */\nconst isValidJSON = (str: unknown): str is string => {\n if (!isString(str)) return false;\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n};\n\nexport default isValidJSON;\n","const vHidden = 'v-hidden';\nexport default vHidden;\n","import { createElement, setAttribute, ObjectAssign, toUpperCase } from '@thednp/shorty';\n\nimport vHidden from './vHidden';\nimport ColorPicker from '../index';\n\n/**\n * Returns the color form for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns a new `
      ` element with color component ``\n */\nconst getColorForm = (self: ColorPicker): HTMLElement => {\n const { format, id, componentLabels } = self;\n const colorForm = createElement({\n tagName: 'div',\n className: `color-form ${format}`,\n }) as HTMLElement;\n\n let components = ['hex'];\n if (format === 'rgb') components = ['red', 'green', 'blue', 'alpha'];\n else if (format === 'hsl') components = ['hue', 'saturation', 'lightness', 'alpha'];\n else if (format === 'hwb') components = ['hue', 'whiteness', 'blackness', 'alpha'];\n\n components.forEach((c: string): void => {\n const [C] = format === 'hex' ? ['#'] : toUpperCase(c).split('');\n const cID = `color_${format}_${c}_${id}`;\n const formatLabel = componentLabels[`${c}Label`];\n const cInputLabel = createElement({ tagName: 'label' }) as HTMLElement;\n setAttribute(cInputLabel, 'for', cID);\n cInputLabel.append(\n createElement({\n tagName: 'span',\n ariaHidden: 'true',\n innerText: `${C}:`,\n }) as HTMLElement,\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: formatLabel,\n }) as HTMLElement,\n );\n const cInput = createElement({\n tagName: 'input',\n id: cID,\n // name: cID, - prevent saving the value to a form\n type: format === 'hex' ? 'text' : 'number',\n value: c === 'alpha' ? '100' : '0',\n className: `color-input ${c}`,\n autocomplete: 'off',\n spellcheck: false,\n } as Partial) as HTMLInputElement;\n\n // alpha\n let max = '100';\n let step = '1';\n if (c !== 'alpha') {\n if (format === 'rgb') {\n max = '255';\n step = '1';\n } else if (c === 'hue') {\n max = '360';\n step = '1';\n }\n }\n ObjectAssign(cInput, {\n min: '0',\n max,\n step,\n });\n colorForm.append(cInputLabel, cInput);\n });\n return colorForm;\n};\n\nexport default getColorForm;\n","import { createElement } from '@thednp/shorty';\n\nimport ColorPicker from '..';\n\n/**\n * Returns all color controls for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns color controls\n */\nconst getColorControls = (self: ColorPicker): HTMLElement => {\n const { format, componentLabels } = self;\n const { hueLabel, alphaLabel, lightnessLabel, saturationLabel, whitenessLabel, blacknessLabel } = componentLabels;\n\n const max1 = format === 'hsl' ? 360 : 100;\n const max2 = format === 'hsl' ? 100 : 360;\n const max3 = 100;\n\n let ctrl1Label = format === 'hsl' ? `${hueLabel} & ${lightnessLabel}` : `${lightnessLabel} & ${saturationLabel}`;\n\n ctrl1Label = format === 'hwb' ? `${whitenessLabel} & ${blacknessLabel}` : ctrl1Label;\n\n const ctrl2Label = format === 'hsl' ? `${saturationLabel}` : `${hueLabel}`;\n\n const colorControls = createElement({\n tagName: 'div',\n className: `color-controls ${format}`,\n }) as HTMLElement;\n\n const colorPointer = 'color-pointer';\n const colorSlider = 'color-slider';\n\n const controls = [\n {\n i: 1,\n c: colorPointer,\n l: ctrl1Label,\n min: 0,\n max: max1,\n },\n {\n i: 2,\n c: colorSlider,\n l: ctrl2Label,\n min: 0,\n max: max2,\n },\n {\n i: 3,\n c: colorSlider,\n l: alphaLabel,\n min: 0,\n max: max3,\n },\n ];\n\n controls.forEach(template => {\n const { i, c, l, min, max } = template;\n const control = createElement({\n tagName: 'div',\n className: 'color-control',\n role: 'presentation',\n }) as HTMLElement;\n\n control.append(\n createElement({\n tagName: 'div',\n className: `visual-control visual-control${i}`,\n }) as HTMLElement,\n );\n\n const knob = createElement({\n tagName: 'div',\n className: `${c} knob`,\n ariaLive: 'polite',\n ariaLabel: l,\n role: 'slider',\n tabIndex: 0,\n ariaValueMin: `${min}`,\n ariaValueMax: `${max}`,\n }) as HTMLElement;\n\n control.append(knob);\n colorControls.append(control);\n });\n\n return colorControls;\n};\n\nexport default getColorControls;\n","import { setAttribute, getAttribute, createElement, setElementStyle } from '@thednp/shorty';\n\nimport Color from '@thednp/color';\nimport ColorPalette from '../colorPalette';\nimport ColorPicker from '../index';\n\n/**\n * Returns a color-defaults with given values and class.\n */\nconst getColorMenu = (self: ColorPicker, colorsSource: ColorPalette | string[], menuClass: string): HTMLElement => {\n const { input, format, componentLabels } = self;\n const { defaultsLabel, presetsLabel } = componentLabels;\n const isOptionsMenu = menuClass === 'color-options';\n const isPalette = colorsSource instanceof ColorPalette;\n const menuLabel = isOptionsMenu ? presetsLabel : defaultsLabel;\n const colorsArray = isPalette ? colorsSource.colors : colorsSource;\n const colorsCount = colorsArray.length;\n const { lightSteps } = isPalette ? colorsSource : { lightSteps: null };\n const fit = lightSteps || [9, 10].find(x => colorsCount >= x * 2 && !(colorsCount % x)) || 5;\n const isMultiLine = isOptionsMenu && colorsCount > fit;\n let rowCountHover = 2;\n rowCountHover = isMultiLine && colorsCount > fit * 2 ? 3 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 3 ? 4 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 4 ? 5 : rowCountHover;\n const rowCount = rowCountHover - (colorsCount <= fit * 3 ? 1 : 2);\n const isScrollable = isMultiLine && colorsCount > rowCount * fit;\n let finalClass = menuClass;\n finalClass += isScrollable ? ' scrollable' : '';\n finalClass += isMultiLine ? ' multiline' : '';\n const gap = isMultiLine ? '1px' : '0.25rem';\n let optionSize = isMultiLine ? 1.75 : 2;\n optionSize = fit > 5 && isMultiLine ? 1.5 : optionSize;\n const menuHeight = `${rowCount * optionSize}rem`;\n const menuHeightHover = `calc(${rowCountHover} * ${optionSize}rem + ${rowCountHover - 1} * ${gap})`;\n\n //
        is an `HTMLElement`\n const menu = createElement({\n tagName: 'ul',\n className: finalClass,\n role: 'listbox',\n ariaLabel: menuLabel,\n }) as HTMLElement;\n\n if (isScrollable) {\n setElementStyle(menu, {\n '--grid-item-size': `${optionSize}rem`,\n '--grid-fit': `${fit}`,\n '--grid-gap': gap,\n '--grid-height': menuHeight,\n '--grid-hover-height': menuHeightHover,\n });\n }\n\n colorsArray.forEach(x => {\n let [value, label] = typeof x === 'string' ? x.trim().split(':') : [];\n if (x instanceof Color) {\n value = x.toHexString();\n label = value;\n }\n const color = new Color(x instanceof Color ? x : value, format);\n const isActive = color.toString() === getAttribute(input, 'value');\n const active = isActive ? ' active' : '';\n\n const option = createElement({\n tagName: 'li',\n className: `color-option${active}`,\n innerText: `${label || value}`,\n tabIndex: 0,\n role: 'option',\n ariaSelected: isActive ? 'true' : 'false',\n }) as HTMLElement;\n setAttribute(option, 'data-value', `${value}`);\n\n if (isOptionsMenu) {\n setElementStyle(option, { backgroundColor: value });\n }\n\n menu.append(option);\n });\n return menu;\n};\n\nexport default getColorMenu;\n","import {\n getAttribute,\n setAttribute,\n toUpperCase,\n ariaHidden,\n tabindex,\n createElement,\n createElementNS,\n} from '@thednp/shorty';\n\nimport Color from '@thednp/color';\n\nimport getColorForm from './getColorForm';\nimport getColorControls from './getColorControls';\nimport getColorMenu from './getColorMenu';\nimport vHidden from './vHidden';\n\nimport ColorPicker from '../index';\n\n/**\n * Generate HTML markup and update instance properties.\n *\n * @param self\n */\nconst setMarkup = (self: ColorPicker) => {\n const { input, parent, format, id, componentLabels, colorKeywords, colorPresets } = self;\n const colorValue = getAttribute(input, 'value') || '#fff';\n const { nonColors } = Color;\n\n const { toggleLabel, pickerLabel, formatLabel, hexLabel } = componentLabels;\n\n // update color\n const color = nonColors.includes(colorValue) ? '#fff' : colorValue;\n self.color = new Color(color, format);\n\n // set initial controls dimensions\n const formatString = format === 'hex' ? hexLabel : toUpperCase(format);\n\n const pickerBtn = createElement({\n id: `picker-btn-${id}`,\n tagName: 'button',\n className: 'picker-toggle btn-appearance',\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLElement;\n\n pickerBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${pickerLabel}. ${formatLabel}: ${formatString}`,\n }) as HTMLElement,\n );\n\n const pickerDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown picker',\n role: 'group',\n ariaLabelledBy: `picker-btn-${id}`,\n } as Partial & { ariaLabelledBy: string }) as HTMLElement;\n\n const colorControls = getColorControls(self);\n const colorForm = getColorForm(self);\n\n pickerDropdown.append(colorControls, colorForm);\n input.before(pickerBtn);\n parent.append(pickerDropdown);\n\n // set colour key menu template\n if (colorKeywords || colorPresets) {\n const presetsDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown scrollable menu',\n }) as HTMLElement;\n\n // color presets\n if (colorPresets) {\n presetsDropdown.append(getColorMenu(self, colorPresets, 'color-options'));\n }\n\n // explicit defaults [reset, initial, inherit, transparent, currentColor]\n // also custom defaults [default: #069, complementary: #930]\n if (colorKeywords && colorKeywords.length) {\n presetsDropdown.append(getColorMenu(self, colorKeywords, 'color-defaults'));\n }\n\n const presetsBtn = createElement({\n tagName: 'button',\n className: 'menu-toggle btn-appearance',\n tabIndex: -1,\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLElement;\n\n const xmlns = encodeURI('http://www.w3.org/2000/svg');\n const presetsIcon = createElementNS(xmlns, {\n tagName: 'svg',\n }) as HTMLElement;\n setAttribute(presetsIcon, 'xmlns', xmlns);\n setAttribute(presetsIcon, 'viewBox', '0 0 512 512');\n setAttribute(presetsIcon, ariaHidden, 'true');\n\n const path = createElementNS(xmlns, {\n tagName: 'path',\n }) as HTMLElement;\n setAttribute(path, 'd', 'M98,158l157,156L411,158l27,27L255,368L71,185L98,158z');\n setAttribute(path, 'fill', '#fff');\n presetsIcon.append(path);\n presetsBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${toggleLabel}`,\n }) as HTMLElement,\n presetsIcon,\n );\n\n parent.append(presetsBtn, presetsDropdown);\n }\n\n // solve non-colors after settings save\n if (colorKeywords && nonColors.includes(colorValue)) {\n self.value = colorValue;\n }\n setAttribute(input, tabindex, '-1');\n};\n\nexport default setMarkup;\n","import { addListener, removeListener } from '@thednp/event-listener';\n\nimport {\n ariaDescription,\n ariaSelected,\n ariaValueNow,\n ariaValueText,\n ariaExpanded,\n keyArrowDown,\n keyArrowUp,\n keyArrowLeft,\n keyArrowRight,\n keyEnter,\n keySpace,\n keyEscape,\n focusinEvent,\n mouseclickEvent,\n keydownEvent,\n changeEvent,\n touchmoveEvent,\n pointerdownEvent,\n pointermoveEvent,\n pointerupEvent,\n tabindex,\n focusoutEvent,\n resizeEvent,\n keyupEvent,\n scrollEvent,\n dispatchEvent,\n getElementsByClassName,\n closest,\n querySelector,\n getElementTransitionDuration,\n getBoundingClientRect,\n getUID,\n getElementStyle,\n getDocumentElement,\n getDocument,\n ObjectAssign,\n ObjectFromEntries,\n Data,\n getInstance,\n setElementStyle,\n normalizeOptions,\n reflow,\n focus,\n hasClass,\n addClass,\n removeClass,\n setAttribute,\n getAttribute,\n removeAttribute,\n isArray,\n isString,\n getWindow,\n} from '@thednp/shorty';\n\n// ColorPicker Util\n// ================\nimport Color from '@thednp/color';\nimport type { RGBA, HWBA, HSLA, HSVA } from '@thednp/color';\n\nimport ColorPalette from './colorPalette';\nimport colorPickerLabels from './util/colorPickerLabels';\nimport colorNames from './util/colorNames';\nimport isValidJSON from './util/isValidJSON';\nimport setMarkup from './util/setMarkup';\n\nimport ColorPickerOptions from './interface/colorPickerOptions';\nimport ColorPickerLabels from './interface/colorPickerLabels';\nimport type ColorNames from './interface/ColorNames';\nimport { version } from '../../package.json';\n\n// ColorPicker GC\n// ==============\nconst colorPickerString = 'color-picker';\nconst colorPickerSelector = `[data-function=\"${colorPickerString}\"]`;\nconst colorPickerParentSelector = `.${colorPickerString}`;\nconst colorPickerDefaults: ColorPickerOptions = {\n componentLabels: colorPickerLabels,\n colorLabels: colorNames,\n format: 'rgb',\n colorPresets: false,\n colorKeywords: false,\n};\nconst { roundPart, nonColors } = Color;\n\n// ColorPicker Static Methods\n// ==========================\nconst getColorPickerInstance = (element: HTMLInputElement) => getInstance(element, colorPickerString);\nconst initColorPicker = (element: HTMLInputElement) => new ColorPicker(element);\n\n// ColorPicker Private Methods\n// ===========================\n\n/**\n * Add / remove `ColorPicker` main event listeners.\n */\nconst toggleEvents = (self: ColorPicker, action?: boolean) => {\n const fn = action ? addListener : removeListener;\n const { input, pickerToggle, menuToggle } = self;\n\n fn(input, focusinEvent, self.showPicker);\n fn(pickerToggle, mouseclickEvent, self.togglePicker);\n\n if (menuToggle) {\n fn(menuToggle, mouseclickEvent, self.toggleMenu);\n }\n};\n\n/**\n * Add / remove `ColorPicker` event listeners active only when open.\n */\nconst toggleEventsOnShown = (self: ColorPicker, action?: boolean) => {\n const fn = action ? addListener : removeListener;\n const { input, colorMenu, parent } = self;\n const doc = getDocument(input);\n const win = getWindow(doc);\n\n fn(self.controls, pointerdownEvent, self.pointerDown as EventListener);\n self.controlKnobs.forEach(x => fn(x, keydownEvent, self.handleKnobs as EventListener));\n\n fn(win, scrollEvent, self.handleScroll);\n fn(win, resizeEvent, self.update);\n\n [input, ...self.inputs].forEach(x => fn(x, changeEvent, self.changeHandler));\n\n if (colorMenu) {\n fn(colorMenu, mouseclickEvent, self.menuClickHandler);\n fn(colorMenu, keydownEvent, self.menuKeyHandler as EventListener);\n }\n\n fn(doc, pointermoveEvent, self.pointerMove as EventListener);\n fn(doc, pointerupEvent, self.pointerUp as EventListener);\n fn(parent, focusoutEvent, self.handleFocusOut as EventListener);\n fn(doc, keyupEvent, self.handleDismiss as EventListener);\n};\n\n/**\n * Triggers the `ColorPicker` original event.\n */\nconst firePickerChange = (self: ColorPicker) => {\n dispatchEvent(self.input, new CustomEvent('colorpicker.change'));\n};\n\n/**\n * Hides a visible dropdown.\n */\nconst removePosition = (element: HTMLElement) => {\n /* istanbul ignore else */\n if (element) {\n ['bottom', 'top'].forEach(x => removeClass(element, x));\n }\n};\n\n/**\n * Shows a `ColorPicker` dropdown and close the curent open dropdown.\n */\nconst showDropdown = (self: ColorPicker, dropdown: HTMLElement) => {\n const { colorPicker, colorMenu, menuToggle, pickerToggle, parent } = self;\n const isPicker = dropdown === colorPicker;\n const openDropdown = isPicker ? colorMenu : colorPicker;\n const activeBtn = isPicker ? menuToggle : pickerToggle;\n const nextBtn = !isPicker ? menuToggle : pickerToggle;\n\n if (!hasClass(parent, 'open')) {\n addClass(parent, 'open');\n }\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n removePosition(openDropdown);\n }\n addClass(dropdown, 'bottom');\n reflow(dropdown);\n addClass(dropdown, 'show');\n\n if (isPicker) self.update();\n\n if (!self.isOpen) {\n toggleEventsOnShown(self, true);\n self.updateDropdownPosition();\n self.isOpen = true;\n setAttribute(self.input, tabindex, '0');\n if (menuToggle) {\n setAttribute(menuToggle, tabindex, '0');\n }\n }\n\n setAttribute(nextBtn, ariaExpanded, 'true');\n if (activeBtn) {\n setAttribute(activeBtn, ariaExpanded, 'false');\n }\n};\n\n/**\n * Color Picker Web Component\n *\n * @see http://thednp.github.io/color-picker\n */\nexport default class ColorPicker {\n // bring utils to staic\n public static Color = Color;\n public static ColorPalette = ColorPalette;\n public static getInstance = getColorPickerInstance;\n public static init = initColorPicker;\n public static selector = colorPickerSelector;\n // utils important for render\n public static roundPart = roundPart;\n public static setElementStyle = setElementStyle;\n public static setAttribute = setAttribute;\n public static getBoundingClientRect = getBoundingClientRect;\n public static version = version;\n public static colorNames = colorNames;\n public static colorPickerLabels = colorPickerLabels;\n\n id: number;\n input: HTMLInputElement;\n color: Color;\n format = 'rgb';\n parent: HTMLElement;\n dragElement: HTMLElement | undefined;\n isOpen = false;\n controlPositions: {\n c1x: number;\n c1y: number;\n c2y: number;\n c3y: number;\n };\n colorLabels: ColorNames = ObjectFromEntries(colorNames.map(c => [c, c])) as ColorNames;\n colorKeywords: string[] | false;\n colorPresets: ColorPalette | string[] | false;\n componentLabels: ColorPickerLabels;\n pickerToggle: HTMLElement;\n menuToggle: HTMLElement;\n colorPicker: HTMLElement;\n colorMenu: HTMLElement;\n controls: HTMLElement;\n inputs: HTMLInputElement[];\n controlKnobs: HTMLElement[];\n visuals: HTMLElement[];\n\n /**\n * Returns a new `ColorPicker` instance. The target of this constructor\n * must be an `HTMLInputElement`.\n *\n * @param target the target `` element\n * @param config instance options\n */\n constructor(target: (HTMLElement & HTMLInputElement) | string, config?: Partial) {\n const input = querySelector(target) as HTMLInputElement;\n\n // invalidate\n if (typeof target === 'undefined') throw new TypeError(`ColorPicker target not specified.`);\n if (isString(target) && !input) throw new TypeError(`ColorPicker target \"${target}\" cannot be found.`);\n this.input = input;\n\n const parent = closest(input, colorPickerParentSelector);\n if (!parent) throw new TypeError('ColorPicker requires a specific markup to work.');\n\n this.parent = parent;\n this.id = getUID(input, colorPickerString);\n this.dragElement = undefined;\n this.isOpen = false;\n this.controlPositions = {\n c1x: 0,\n c1y: 0,\n c2y: 0,\n c3y: 0,\n };\n // this.colorLabels = {};\n this.colorKeywords = false;\n this.colorPresets = false;\n\n // process options\n const { format, componentLabels, colorLabels, colorKeywords, colorPresets } = normalizeOptions(\n input,\n colorPickerDefaults,\n config || {},\n );\n\n let translatedColorLabels = colorNames;\n /* istanbul ignore else */\n if (isArray(colorLabels) && colorLabels.length === 17) {\n translatedColorLabels = colorLabels;\n } else if (isString(colorLabels) && colorLabels.split(',').length === 17) {\n translatedColorLabels = colorLabels.split(',');\n }\n\n // expose colour labels to all methods\n ObjectAssign(this.colorLabels, ObjectFromEntries(translatedColorLabels.map((c, i) => [colorNames[i], c])));\n\n // update and expose component labels\n const tempComponentLabels =\n isString(componentLabels) && isValidJSON(componentLabels)\n ? (JSON.parse(componentLabels) as ColorPickerLabels)\n : componentLabels;\n this.componentLabels = ObjectAssign({ ...colorPickerLabels }, tempComponentLabels);\n this.color = new Color(input.value || '#fff', format);\n this.format = format;\n\n // set colour defaults\n if (isArray(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords;\n } else if (isString(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords.split(',').map(x => x.trim());\n }\n\n // set colour presets\n if (isArray(colorPresets) && colorPresets.length) {\n this.colorPresets = colorPresets;\n } else if (colorPresets && isValidJSON(colorPresets)) {\n const { hue, hueSteps, lightSteps, saturation } = JSON.parse(colorPresets) as {\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n };\n this.colorPresets = new ColorPalette(hue, hueSteps, lightSteps, saturation);\n } else if (isString(colorPresets)) {\n this.colorPresets = colorPresets.split(',').map((x: string) => x.trim());\n }\n\n // generate markup\n setMarkup(this);\n\n const [colorPicker, colorMenu] = getElementsByClassName('color-dropdown', parent);\n // set main elements\n this.pickerToggle = querySelector('.picker-toggle', parent) as HTMLElement;\n this.menuToggle = querySelector('.menu-toggle', parent) as HTMLElement;\n this.colorPicker = colorPicker;\n this.colorMenu = colorMenu;\n this.inputs = [...getElementsByClassName('color-input', parent)] as HTMLInputElement[];\n const [controls] = getElementsByClassName('color-controls', parent);\n this.controls = controls;\n this.controlKnobs = [...getElementsByClassName('knob', controls)];\n this.visuals = [...getElementsByClassName('visual-control', controls)];\n\n // update colour picker controls, inputs and visuals\n this.update();\n // console.log(this)\n\n // add main events listeners\n toggleEvents(this, true);\n\n // set component data\n Data.set(input, colorPickerString, this);\n }\n\n /** Returns the current colour value */\n get value(): string {\n return this.input.value;\n }\n\n /**\n * Sets a new colour value.\n *\n * @param {string} v new colour value\n */\n set value(v: string) {\n this.input.value = v;\n }\n\n /** Check if the colour presets include any non-colour. */\n get hasNonColor(): boolean {\n return this.colorKeywords instanceof Array && this.colorKeywords.some(x => nonColors.includes(x));\n }\n\n /** Returns hexadecimal value of the current colour. */\n get hex(): string {\n return this.color.toHex(true);\n }\n\n /** Returns the current colour value in {h,s,v,a} object format. */\n get hsv(): HSVA {\n return this.color.toHsv();\n }\n\n /** Returns the current colour value in {h,s,l,a} object format. */\n get hsl(): HSLA {\n return this.color.toHsl();\n }\n\n /** Returns the current colour value in {h,w,b,a} object format. */\n get hwb(): HWBA {\n return this.color.toHwb();\n }\n\n /** Returns the current colour value in {r,g,b,a} object format. */\n get rgb(): RGBA {\n return this.color.toRgb();\n }\n\n /** Returns the current colour brightness. */\n get brightness(): number {\n return this.color.brightness;\n }\n\n /** Returns the current colour luminance. */\n get luminance(): number {\n return this.color.luminance;\n }\n\n /** Checks if the current colour requires a light text colour. */\n get isDark(): boolean {\n const { color, brightness } = this;\n return brightness < 120 && color.a > 0.33;\n }\n\n /** Checks if the current input value is a valid colour. */\n get isValid(): boolean {\n const inputValue = this.input.value;\n return inputValue !== '' && new Color(inputValue).isValid;\n }\n\n /** Returns the colour appearance, usually the closest colour name for the current value. */\n get appearance(): string {\n const { colorLabels, hsl, hsv, format } = this;\n\n const hue = roundPart(hsl.h * 360);\n const saturationSource = format === 'hsl' ? hsl.s : hsv.s;\n const saturation = roundPart(saturationSource * 100);\n const lightness = roundPart(hsl.l * 100);\n const hsvl = hsv.v * 100;\n\n let colorName = 'black';\n\n // determine color appearance\n /* istanbul ignore else */\n if (lightness === 100 && saturation === 0) {\n colorName = colorLabels.white;\n } else if (lightness === 0) {\n colorName = colorLabels.black;\n } else if (saturation === 0) {\n colorName = colorLabels.grey;\n } else if (hue < 15 || hue >= 345) {\n colorName = colorLabels.red;\n } else if (hue >= 15 && hue < 45) {\n colorName = hsvl > 80 && saturation > 80 ? colorLabels.orange : colorLabels.brown;\n } else if (hue >= 45 && hue < 75) {\n const isGold = hue > 46 && hue < 54 && hsvl < 80 && saturation > 90;\n const isOlive = hue >= 54 && hue < 75 && hsvl < 80;\n colorName = isGold ? colorLabels.gold : colorLabels.yellow;\n colorName = isOlive ? colorLabels.olive : colorName;\n } else if (hue >= 75 && hue < 155) {\n colorName = hsvl < 68 ? colorLabels.green : colorLabels.lime;\n } else if (hue >= 155 && hue < 175) {\n colorName = colorLabels.teal;\n } else if (hue >= 175 && hue < 195) {\n colorName = colorLabels.cyan;\n } else if (hue >= 195 && hue < 255) {\n colorName = colorLabels.blue;\n } else if (hue >= 255 && hue < 270) {\n colorName = colorLabels.violet;\n } else if (hue >= 270 && hue < 295) {\n colorName = colorLabels.magenta;\n } else if (hue >= 295 && hue < 345) {\n colorName = colorLabels.pink;\n }\n return colorName;\n }\n\n /** Updates `ColorPicker` visuals. */\n updateVisuals(): void {\n const { controlPositions, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { offsetHeight } = v1;\n const hue = controlPositions.c2y / offsetHeight;\n const { r, g, b } = new Color({ h: hue, s: 1, l: 0.5 }).toRgb();\n const whiteGrad = 'linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)';\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n const roundA = roundPart(alpha * 100) / 100;\n\n const fill = new Color({\n h: hue,\n s: 1,\n l: 0.5,\n a: alpha,\n }).toRgbString();\n const hueGradient = `linear-gradient(\n rgb(255,0,0) 0%, rgb(255,255,0) 16.67%,\n rgb(0,255,0) 33.33%, rgb(0,255,255) 50%,\n rgb(0,0,255) 66.67%, rgb(255,0,255) 83.33%,\n rgb(255,0,0) 100%)`;\n setElementStyle(v1, {\n background: `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,${roundA}) 100%),\n linear-gradient(to right, rgba(255,255,255,${roundA}) 0%, ${fill} 100%),\n ${whiteGrad}`,\n });\n setElementStyle(v2, { background: hueGradient });\n\n setElementStyle(v3, {\n background: `linear-gradient(rgba(${r},${g},${b},1) 0%,rgba(${r},${g},${b},0) 100%)`,\n });\n }\n\n /**\n * The `ColorPicker` *focusout* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleFocusOut = ({ relatedTarget }: FocusEvent & { relatedTarget: HTMLElement }): void => {\n if (relatedTarget && !this.parent.contains(relatedTarget)) {\n this.hide(true);\n }\n };\n\n /**\n * The `ColorPicker` *keyup* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleDismiss = ({ code }: KeyboardEvent): void => {\n if (this.isOpen && code === keyEscape) {\n this.hide();\n }\n };\n\n /**\n * The `ColorPicker` *scroll* event listener when open.\n *\n * @param e\n */\n handleScroll = (e: Event) => {\n const { activeElement } = getDocument(this.input);\n\n this.updateDropdownPosition();\n\n /* istanbul ignore next */\n if (\n ([pointermoveEvent, touchmoveEvent].includes(e.type) && this.dragElement) ||\n (activeElement && this.controlKnobs.includes(activeElement as HTMLElement))\n ) {\n e.stopPropagation();\n e.preventDefault();\n }\n };\n\n /**\n * The `ColorPicker` keyboard event listener for menu navigation.\n *\n * @param e\n */\n menuKeyHandler = (e: KeyboardEvent & { target: HTMLElement }) => {\n const { target, code } = e;\n const { previousElementSibling, nextElementSibling, parentElement } = target;\n const isColorOptionsMenu = parentElement && hasClass(parentElement, 'color-options');\n const allSiblings = parentElement ? [...parentElement.children] : [];\n const columnsCount =\n isColorOptionsMenu && getElementStyle(parentElement, 'grid-template-columns').split(' ').length;\n const currentIndex = allSiblings.indexOf(target);\n const previousElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex - columnsCount];\n const nextElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex + columnsCount];\n\n if ([keyArrowDown, keyArrowUp, keySpace].includes(code)) {\n // prevent scroll when navigating the menu via arrow keys / Space\n e.preventDefault();\n }\n if (isColorOptionsMenu) {\n if (previousElement && code === keyArrowUp) {\n focus(previousElement as HTMLElement);\n } else if (nextElement && code === keyArrowDown) {\n focus(nextElement as HTMLElement);\n } else if (previousElementSibling && code === keyArrowLeft) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && code === keyArrowRight) {\n focus(nextElementSibling as HTMLElement);\n }\n } else if (previousElementSibling && [keyArrowLeft, keyArrowUp].includes(code)) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && [keyArrowRight, keyArrowDown].includes(code)) {\n focus(nextElementSibling as HTMLElement);\n }\n\n if ([keyEnter, keySpace].includes(code)) {\n this.menuClickHandler(e);\n }\n };\n\n /**\n * The `ColorPicker` click event listener for the colour menu presets / defaults.\n *\n * @param e\n * @this {ColorPicker}\n */\n menuClickHandler = (e: Event) => {\n const { target } = e;\n const { colorMenu } = this;\n const newOption = (getAttribute(target as HTMLElement, 'data-value') || '').trim();\n // invalidate for targets other than color options\n if (!newOption.length) return;\n const currentActive = querySelector('li.active', colorMenu);\n let newColor = newOption;\n newColor = nonColors.includes(newColor) ? 'white' : newColor;\n newColor = newColor === 'transparent' ? 'rgba(0,0,0,0)' : newColor;\n\n const { r, g, b, a } = new Color(newColor);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n this.update();\n\n /* istanbul ignore else */\n if (currentActive !== target) {\n /* istanbul ignore else */\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n\n addClass(target as HTMLElement, 'active');\n setAttribute(target as HTMLElement, ariaSelected, 'true');\n\n if (nonColors.includes(newOption)) {\n this.value = newOption;\n }\n firePickerChange(this);\n }\n };\n\n /**\n * The `ColorPicker` *touchstart* / *mousedown* events listener for control knobs.\n *\n * @param e\n */\n pointerDown = (e: PointerEvent & { target: HTMLElement }) => {\n if (e.button !== 0) return;\n const { target, pageX, pageY } = e;\n const { colorMenu, visuals, controlKnobs } = this;\n const [v1, v2, v3] = visuals;\n const [c1, c2, c3] = controlKnobs;\n const visual = controlKnobs.includes(target) ? (target.previousElementSibling as HTMLElement) : target;\n const visualRect = getBoundingClientRect(visual);\n const html = getDocumentElement(v1);\n const offsetX = pageX - html.scrollLeft - visualRect.left;\n const offsetY = pageY - html.scrollTop - visualRect.top;\n\n /* istanbul ignore else */\n if (target === v1 || target === c1) {\n this.dragElement = visual;\n this.changeControl1(offsetX, offsetY);\n } else if (target === v2 || target === c2) {\n this.dragElement = visual;\n this.changeControl2(offsetY);\n } else if (target === v3 || target === c3) {\n this.dragElement = visual;\n this.changeAlpha(offsetY);\n }\n\n if (colorMenu) {\n const currentActive = querySelector('li.active', colorMenu);\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n }\n e.preventDefault();\n };\n\n /**\n * The `ColorPicker` *touchend* / *mouseup* events listener for control knobs.\n *\n * @param e\n * @this\n */\n pointerUp = ({ target }: PointerEvent & { target: HTMLElement }) => {\n const { parent } = this;\n const doc = getDocument(parent);\n const currentOpen = querySelector(`${colorPickerParentSelector}.open`, doc) !== null;\n const selection = doc.getSelection();\n\n if (!this.dragElement && (!selection || !selection.toString().length) && !parent.contains(target)) {\n this.hide(currentOpen);\n }\n\n this.dragElement = undefined;\n };\n\n /**\n * The `ColorPicker` *touchmove* / *mousemove* events listener for control knobs.\n *\n * @param {PointerEvent} e\n */\n pointerMove = (e: PointerEvent) => {\n const { dragElement, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { pageX, pageY } = e;\n\n if (!dragElement) return;\n\n const controlRect = getBoundingClientRect(dragElement);\n const win = getDocumentElement(v1);\n const offsetX = pageX - win.scrollLeft - controlRect.left;\n const offsetY = pageY - win.scrollTop - controlRect.top;\n\n if (dragElement === v1) {\n this.changeControl1(offsetX, offsetY);\n }\n\n if (dragElement === v2) {\n this.changeControl2(offsetY);\n }\n\n if (dragElement === v3) {\n this.changeAlpha(offsetY);\n }\n };\n\n /**\n * The `ColorPicker` *keydown* event listener for control knobs.\n *\n * @param e\n */\n handleKnobs = (e: Event & { code: string }) => {\n const { target, code } = e;\n\n // only react to arrow buttons\n if (![keyArrowUp, keyArrowDown, keyArrowLeft, keyArrowRight].includes(code)) return;\n e.preventDefault();\n\n const { controlKnobs, visuals } = this;\n const { offsetWidth, offsetHeight } = visuals[0];\n const [c1, c2, c3] = controlKnobs;\n const { activeElement } = getDocument(c1);\n const currentKnob = controlKnobs.find(x => x === activeElement);\n const yRatio = offsetHeight / 360;\n\n /* istanbul ignore else */\n if (currentKnob) {\n let offsetX = 0;\n let offsetY = 0;\n\n /* istanbul ignore else */\n if (target === c1) {\n const xRatio = offsetWidth / 100;\n\n /* istanbul ignore else */\n if ([keyArrowLeft, keyArrowRight].includes(code)) {\n this.controlPositions.c1x += code === keyArrowRight ? xRatio : -xRatio;\n } else if ([keyArrowUp, keyArrowDown].includes(code)) {\n this.controlPositions.c1y += code === keyArrowDown ? yRatio : -yRatio;\n }\n\n offsetX = this.controlPositions.c1x;\n offsetY = this.controlPositions.c1y;\n this.changeControl1(offsetX, offsetY);\n } else if (target === c2) {\n this.controlPositions.c2y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c2y;\n this.changeControl2(offsetY);\n } else if (target === c3) {\n this.controlPositions.c3y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c3y;\n this.changeAlpha(offsetY);\n }\n this.handleScroll(e);\n }\n };\n\n /** The event listener of the colour form inputs. */\n changeHandler = (): void => {\n let colorSource;\n const { inputs, format, value: currentValue, input, controlPositions, visuals } = this;\n const { activeElement } = getDocument(input);\n const { offsetHeight } = visuals[0];\n const [i1, , , i4] = inputs;\n const [v1, v2, v3, v4] =\n format === 'rgb'\n ? inputs.map(i => parseFloat(i.value) / (i === i4 ? 100 : 1))\n : inputs.map(i => parseFloat(i.value) / (i !== i1 ? 100 : 360));\n const isNonColorValue = this.hasNonColor && nonColors.includes(currentValue);\n const alpha = i4 ? v4 : 1 - controlPositions.c3y / offsetHeight;\n\n /* istanbul ignore else */\n if (activeElement === input || (activeElement && inputs.includes(activeElement as HTMLInputElement))) {\n if (activeElement === input) {\n if (isNonColorValue) {\n colorSource = currentValue === 'transparent' ? 'rgba(0,0,0,0)' : 'rgb(0,0,0)';\n } else {\n colorSource = currentValue;\n }\n } else if (format === 'hex') {\n colorSource = i1.value;\n } else if (format === 'hsl') {\n colorSource = {\n h: v1,\n s: v2,\n l: v3,\n a: alpha,\n };\n } else if (format === 'hwb') {\n colorSource = {\n h: v1,\n w: v2,\n b: v3,\n a: alpha,\n };\n } else {\n colorSource = {\n r: v1,\n g: v2,\n b: v3,\n a: alpha,\n };\n }\n\n const { r, g, b, a } = new Color(colorSource);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n this.setControlPositions();\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n\n // set non-color keyword\n if (activeElement === input && isNonColorValue) {\n this.value = currentValue;\n }\n }\n };\n\n /**\n * Updates `ColorPicker` first control:\n * * `lightness` and `saturation` for HEX/RGB;\n * * `lightness` and `hue` for HSL.\n *\n * @param X the X component of the offset\n * @param Y the Y component of the offset\n */\n changeControl1(X: number, Y: number): void {\n let [offsetX, offsetY] = [0, 0];\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n if (X > offsetWidth) offsetX = offsetWidth;\n else if (X >= 0) offsetX = X;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = controlPositions.c2y / offsetHeight;\n\n const saturation = offsetX / offsetWidth;\n\n const lightness = 1 - offsetY / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new positions\n this.controlPositions.c1x = offsetX;\n this.controlPositions.c1y = offsetY;\n\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` second control:\n * * `hue` for HEX/RGB/HWB;\n * * `saturation` for HSL.\n *\n * @param Y the Y offset\n */\n changeControl2(Y: number) {\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = offsetY / offsetHeight;\n const saturation = controlPositions.c1x / offsetWidth;\n const lightness = 1 - controlPositions.c1y / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new position\n this.controlPositions.c2y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` last control,\n * the `alpha` channel.\n *\n * @param Y\n */\n changeAlpha(Y: number) {\n const { visuals } = this;\n const { offsetHeight } = visuals[0];\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n // update color alpha\n const alpha = 1 - offsetY / offsetHeight;\n this.color.setAlpha(alpha);\n // update position\n this.controlPositions.c3y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` control positions on:\n * * initialization\n * * window resize\n */\n update = () => {\n this.updateDropdownPosition();\n this.updateAppearance();\n this.setControlPositions();\n this.updateInputs(true);\n this.updateControls();\n this.updateVisuals();\n };\n\n /** Updates the open dropdown position on *scroll* event. */\n updateDropdownPosition() {\n const { input, colorPicker, colorMenu } = this;\n const elRect = getBoundingClientRect(input);\n const { top, bottom } = elRect;\n const { offsetHeight: elHeight } = input;\n const windowHeight = getDocumentElement(input).clientHeight;\n const isPicker = hasClass(colorPicker, 'show');\n const dropdown = isPicker ? colorPicker : colorMenu;\n if (!dropdown) return;\n const { offsetHeight: dropHeight } = dropdown;\n const distanceBottom = windowHeight - bottom;\n const distanceTop = top;\n const bottomExceed = top + dropHeight + elHeight > windowHeight; // show\n const topExceed = top - dropHeight < 0; // show-top\n\n if ((hasClass(dropdown, 'bottom') || !topExceed) && distanceBottom < distanceTop && bottomExceed) {\n removeClass(dropdown, 'bottom');\n addClass(dropdown, 'top');\n } else {\n removeClass(dropdown, 'top');\n addClass(dropdown, 'bottom');\n }\n }\n\n /** Updates control knobs' positions. */\n setControlPositions() {\n const { visuals, color, hsv } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n const alpha = color.a;\n const hue = hsv.h;\n\n const saturation = hsv.s;\n const lightness = hsv.v;\n\n this.controlPositions.c1x = saturation * offsetWidth;\n this.controlPositions.c1y = (1 - lightness) * offsetHeight;\n this.controlPositions.c2y = hue * offsetHeight;\n this.controlPositions.c3y = (1 - alpha) * offsetHeight;\n }\n\n /** Update the visual appearance label and control knob labels. */\n updateAppearance() {\n const { componentLabels, color, parent, hsv, hex, format, controlKnobs } = this;\n const { appearanceLabel, hexLabel, valueLabel } = componentLabels;\n let { r, g, b } = color.toRgb();\n const [knob1, knob2, knob3] = controlKnobs;\n const hue = roundPart(hsv.h * 360);\n const alpha = color.a;\n const saturation = roundPart(hsv.s * 100);\n const lightness = roundPart(hsv.v * 100);\n const colorName = this.appearance;\n\n let colorLabel = `${hexLabel} ${hex.split('').join(' ')}`;\n\n if (format === 'hwb') {\n const { hwb } = this;\n const whiteness = roundPart(hwb.w * 100);\n const blackness = roundPart(hwb.b * 100);\n colorLabel = `HWB: ${hue}°, ${whiteness}%, ${blackness}%`;\n setAttribute(knob1, ariaValueText, `${whiteness}% & ${blackness}%`);\n setAttribute(knob1, ariaValueNow, `${whiteness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}%`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n } else {\n [r, g, b] = [r, g, b].map(roundPart);\n colorLabel = format === 'hsl' ? `HSL: ${hue}°, ${saturation}%, ${lightness}%` : colorLabel;\n colorLabel = format === 'rgb' ? `RGB: ${r}, ${g}, ${b}` : colorLabel;\n\n setAttribute(knob1, ariaValueText, `${lightness}% & ${saturation}%`);\n setAttribute(knob1, ariaValueNow, `${lightness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}°`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n }\n\n const alphaValue = roundPart(alpha * 100);\n setAttribute(knob3, ariaValueText, `${alphaValue}%`);\n setAttribute(knob3, ariaValueNow, `${alphaValue}`);\n\n // update the input backgroundColor\n const newColor = color.toString();\n setElementStyle(this.input, { backgroundColor: newColor });\n\n // toggle dark/light classes will also style the placeholder\n // dark sets color white, light sets color black\n // isDark ? '#000' : '#fff'\n if (!this.isDark) {\n if (hasClass(parent, 'txt-dark')) removeClass(parent, 'txt-dark');\n if (!hasClass(parent, 'txt-light')) addClass(parent, 'txt-light');\n } else {\n if (hasClass(parent, 'txt-light')) removeClass(parent, 'txt-light');\n if (!hasClass(parent, 'txt-dark')) addClass(parent, 'txt-dark');\n }\n }\n\n /** Updates the control knobs actual positions. */\n updateControls() {\n const { controlKnobs, controlPositions } = this;\n let { c1x, c1y, c2y, c3y } = controlPositions;\n const [control1, control2, control3] = controlKnobs;\n // round control positions\n [c1x, c1y, c2y, c3y] = [c1x, c1y, c2y, c3y].map(roundPart);\n\n setElementStyle(control1, {\n transform: `translate3d(${c1x - 4}px,${c1y - 4}px,0)`,\n });\n setElementStyle(control2, { transform: `translate3d(0,${c2y - 4}px,0)` });\n setElementStyle(control3, { transform: `translate3d(0,${c3y - 4}px,0)` });\n }\n\n /**\n * Updates all color form inputs.\n *\n * @param isPrevented when `true`, the component original event is prevented\n */\n updateInputs(isPrevented?: boolean) {\n const { value: oldColor, format, inputs, color, hsl } = this;\n const [i1, i2, i3, i4] = inputs;\n const alpha = roundPart(color.a * 100);\n const hue = roundPart(hsl.h * 360);\n let newColor = color.toString();\n\n /* istanbul ignore else */\n if (format === 'hex') {\n newColor = this.color.toHexString(true);\n i1.value = this.hex;\n } else if (format === 'hsl') {\n const lightness = roundPart(hsl.l * 100);\n const saturation = roundPart(hsl.s * 100);\n newColor = this.color.toHslString();\n i1.value = `${hue}`;\n i2.value = `${saturation}`;\n i3.value = `${lightness}`;\n i4.value = `${alpha}`;\n } else if (format === 'hwb') {\n const { w, b } = this.hwb;\n const whiteness = roundPart(w * 100);\n const blackness = roundPart(b * 100);\n\n newColor = this.color.toHwbString();\n i1.value = `${hue}`;\n i2.value = `${whiteness}`;\n i3.value = `${blackness}`;\n i4.value = `${alpha}`;\n } else if (format === 'rgb') {\n let { r, g, b } = this.rgb;\n [r, g, b] = [r, g, b].map(roundPart);\n\n newColor = this.color.toRgbString();\n i1.value = `${r}`;\n i2.value = `${g}`;\n i3.value = `${b}`;\n i4.value = `${alpha}`;\n }\n\n // update the color value\n this.value = newColor;\n\n // don't trigger the custom event unless it's really changed\n if (!isPrevented && newColor !== oldColor) {\n firePickerChange(this);\n }\n }\n\n /**\n * Toggle the `ColorPicker` dropdown visibility.\n *\n * @param e\n */\n togglePicker = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorPicker } = this;\n\n if (this.isOpen && hasClass(colorPicker, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorPicker);\n }\n };\n\n /** Shows the `ColorPicker` dropdown. */\n showPicker = () => {\n const { colorPicker } = this;\n\n if (!['top', 'bottom'].some(c => hasClass(colorPicker, c))) {\n showDropdown(this, colorPicker);\n }\n };\n\n /**\n * Toggles the visibility of the `ColorPicker` presets menu.\n *\n * @param e\n * @this {ColorPicker}\n */\n toggleMenu = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorMenu } = this;\n\n if (this.isOpen && hasClass(colorMenu, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorMenu);\n }\n };\n\n /**\n * Hides the currently open `ColorPicker` dropdown.\n *\n * @param {boolean=} focusPrevented\n */\n hide(focusPrevented?: boolean) {\n if (this.isOpen) {\n const { pickerToggle, menuToggle, colorPicker, colorMenu, parent, input } = this;\n const openPicker = hasClass(colorPicker, 'show');\n const openDropdown = openPicker ? colorPicker : colorMenu;\n const relatedBtn = openPicker ? pickerToggle : menuToggle;\n const animationDuration = openDropdown && getElementTransitionDuration(openDropdown);\n\n this.value = this.color.toString(true);\n\n /* istanbul ignore else */\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n setAttribute(relatedBtn, ariaExpanded, 'false');\n setTimeout(() => {\n removePosition(openDropdown);\n /* istanbul ignore else */\n if (!querySelector('.show', parent)) {\n removeClass(parent, 'open');\n toggleEventsOnShown(this);\n this.isOpen = false;\n }\n }, animationDuration);\n }\n\n if (!focusPrevented) {\n focus(pickerToggle);\n }\n setAttribute(input, tabindex, '-1');\n if (relatedBtn === menuToggle) {\n setAttribute(menuToggle, tabindex, '-1');\n }\n }\n }\n\n /** Removes `ColorPicker` from target ``. */\n dispose() {\n const { input, parent } = this;\n this.hide(true);\n toggleEvents(this);\n [...parent.children].forEach(el => {\n if (el !== input) el.remove();\n });\n\n removeAttribute(input, tabindex);\n setElementStyle(input, { backgroundColor: '' });\n\n ['txt-light', 'txt-dark'].forEach(c => removeClass(parent, c));\n Data.remove(input, colorPickerString);\n }\n}\n"],"names":["e","f","t","c","i","n","s","o","a","r","E","d","me","ge","Ee","Ae","Ne","ke","K","P","_","tt","st","rt","it","St","Nt","kt","Ct","zt","Bt","Re","Qe","je","qe","Ye","Ze","on","Rt","U","mn","jt","A","qt","S","z","x","M","Gt","Jt","Kt","Xt","Yt","kn","Dn","On","Ln","In","v","u","L","Bn","N","W","R","k","Zt","$t","Q","g","ne","Rn","V","w","oe","Qn","l","p","m","y","j","Jn","Yn","Zn","I","_n","h","T","B","H","b","ae","ie","le","Ao","ko","D","F","rr","tr","O","er","$","Z","J","G","X","C","Y","q","sr","ColorPalette","Color","args","hue","hueSteps","lightSteps","lightnessArray","saturation","colors","hueStep","half","steps1To13","lightSets","closestSet","set","lightStep","currentHue","newColor","colorPickerLabels","colorNames","isValidJSON","str","isString","vHidden","getColorForm","self","format","id","componentLabels","colorForm","createElement","components","toUpperCase","cID","formatLabel","cInputLabel","setAttribute","cInput","max","step","ObjectAssign","getColorControls","hueLabel","alphaLabel","lightnessLabel","saturationLabel","whitenessLabel","blacknessLabel","max1","max2","max3","ctrl1Label","ctrl2Label","colorControls","colorPointer","colorSlider","template","min","control","knob","getColorMenu","colorsSource","menuClass","input","defaultsLabel","presetsLabel","isOptionsMenu","isPalette","menuLabel","colorsArray","colorsCount","fit","isMultiLine","rowCountHover","rowCount","isScrollable","finalClass","gap","optionSize","menuHeight","menuHeightHover","menu","setElementStyle","value","label","isActive","getAttribute","option","setMarkup","parent","colorKeywords","colorPresets","colorValue","nonColors","toggleLabel","pickerLabel","hexLabel","color","formatString","pickerBtn","pickerDropdown","presetsDropdown","presetsBtn","xmlns","presetsIcon","createElementNS","ariaHidden","path","tabindex","colorPickerString","colorPickerSelector","colorPickerParentSelector","colorPickerDefaults","roundPart","getColorPickerInstance","element","getInstance","initColorPicker","ColorPicker","toggleEvents","action","fn","addListener","removeListener","pickerToggle","menuToggle","focusinEvent","mouseclickEvent","toggleEventsOnShown","colorMenu","doc","getDocument","win","getWindow","pointerdownEvent","keydownEvent","scrollEvent","resizeEvent","changeEvent","pointermoveEvent","pointerupEvent","focusoutEvent","keyupEvent","firePickerChange","dispatchEvent","removePosition","removeClass","showDropdown","dropdown","colorPicker","isPicker","openDropdown","activeBtn","nextBtn","hasClass","addClass","reflow","ariaExpanded","getBoundingClientRect","version","ObjectFromEntries","target","config","querySelector","closest","getUID","colorLabels","normalizeOptions","translatedColorLabels","isArray","tempComponentLabels","getElementsByClassName","controls","Data","brightness","inputValue","hsl","hsv","saturationSource","lightness","hsvl","colorName","isGold","isOlive","controlPositions","visuals","v1","v2","v3","offsetHeight","whiteGrad","alpha","roundA","fill","hueGradient","relatedTarget","code","keyEscape","activeElement","touchmoveEvent","previousElementSibling","nextElementSibling","parentElement","isColorOptionsMenu","allSiblings","columnsCount","getElementStyle","currentIndex","previousElement","nextElement","keyArrowDown","keyArrowUp","keySpace","focus","keyArrowLeft","keyArrowRight","keyEnter","newOption","currentActive","removeAttribute","ariaSelected","pageX","pageY","controlKnobs","c1","c2","c3","visual","visualRect","html","getDocumentElement","offsetX","offsetY","currentOpen","selection","dragElement","controlRect","offsetWidth","currentKnob","yRatio","xRatio","colorSource","inputs","currentValue","i1","i4","v4","isNonColorValue","elRect","top","bottom","elHeight","windowHeight","dropHeight","distanceBottom","distanceTop","bottomExceed","topExceed","hex","appearanceLabel","valueLabel","knob1","knob2","knob3","colorLabel","hwb","whiteness","blackness","ariaValueText","ariaValueNow","ariaDescription","alphaValue","c1x","c1y","c2y","c3y","control1","control2","control3","isPrevented","oldColor","i2","i3","focusPrevented","openPicker","relatedBtn","animationDuration","getElementTransitionDuration","el"],"mappings":"wCAAM,MAAAA,EAAI,CAAE,EAAEC,GAAKC,GAAM,CACvB,KAAM,CAAE,KAAM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H,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,GACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,uBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,mBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,oBACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,CACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,MACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,MACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,CACH,EAAGC,GAAI,oBAAqBjD,GAAI,gBAAiByD,GAAI,uBAAwBpC,GAAI,yBAAyB4B,EAAC,KAAM9B,GAAI,MAAMsC,EAAC,QAAQzD,EAAC,IAAK0D,GAAI,MAAMvC,EAAC,QAAQE,EAAC,KAAMsC,GAAK,+BAAgCC,GAAK,qB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AAI,EAGjCA,IACFL,EAAYK,EAAc,MAAM,EACnBnH,EAAAyP,EAAYhI,GAAc,OAAO,EAC9C,WAAW,IAAM,CACfZ,GAAeM,CAAY,EAEtBY,EAAc,QAAS1E,CAAM,IAChCyD,EAAYzD,EAAQ,MAAM,EAC1BuC,GAAoB,IAAI,EACxB,KAAK,OAAS,KAEf8J,CAAiB,GAGjBH,GACHtE,EAAMzF,CAAY,EAEPxF,EAAA2B,EAAO6C,EAAU,IAAI,EAC9BiL,IAAehK,GACJzF,EAAAyF,EAAYjB,EAAU,IAAI,CAE3C,CACF,CAGA,SAAU,CACF,KAAA,CAAE,MAAA7C,EAAO,OAAA0B,CAAW,EAAA,KAC1B,KAAK,KAAK,EAAI,EACd8B,GAAa,IAAI,EACjB,CAAC,GAAG9B,EAAO,QAAQ,EAAE,QAAcuM,GAAA,CAC7BA,IAAOjO,GAAOiO,EAAG,OAAO,CAAA,CAC7B,EAEDrE,GAAgB5J,EAAO6C,CAAQ,EAC/B1B,EAAgBnB,EAAO,CAAE,gBAAiB,EAAI,CAAA,EAE7C,CAAA,YAAa,UAAU,EAAE,WAAamF,EAAYzD,EAAQrM,CAAC,CAAC,EACxDyR,GAAA,OAAO9G,EAAO8C,CAAiB,CACtC,CACF","x_google_ignoreList":[0,1,2]} \ No newline at end of file +{"version":3,"file":"color-picker.js","sources":["../../node_modules/.pnpm/@thednp+shorty@2.0.0-alpha21/node_modules/@thednp/shorty/dist/shorty.mjs","../../node_modules/.pnpm/@thednp+color@1.0.8/node_modules/@thednp/color/dist/index.mjs","../../src/ts/colorPalette.ts","../../src/ts/util/colorPickerLabels.ts","../../src/ts/util/colorNames.ts","../../src/ts/util/isValidJSON.ts","../../src/ts/util/vHidden.ts","../../src/ts/util/getColorForm.ts","../../src/ts/util/getColorControls.ts","../../src/ts/util/getColorMenu.ts","../../src/ts/util/setMarkup.ts","../../src/ts/index.ts"],"sourcesContent":["const pe = \"aria-checked\", me = \"aria-description\", fe = \"aria-describedby\", ge = \"aria-expanded\", ve = \"aria-haspopup\", Ee = \"aria-hidden\", be = \"aria-label\", he = \"aria-labelledby\", ye = \"aria-modal\", we = \"aria-pressed\", Ae = \"aria-selected\", Se = \"aria-valuemin\", Ne = \"aria-valuemax\", ke = \"aria-valuenow\", Me = \"aria-valuetext\", q = \"abort\", G = \"beforeunload\", J = \"blur\", K = \"change\", X = \"contextmenu\", P = \"DOMContentLoaded\", Y = \"DOMMouseScroll\", Z = \"error\", $ = \"focus\", _ = \"focusin\", tt = \"focusout\", et = \"gesturechange\", nt = \"gestureend\", ot = \"gesturestart\", st = \"keydown\", ct = \"keypress\", rt = \"keyup\", at = \"load\", it = \"click\", ut = \"dblclick\", lt = \"mousedown\", dt = \"mouseup\", pt = \"hover\", mt = \"mouseenter\", ft = \"mouseleave\", gt = \"mousein\", vt = \"mouseout\", Et = \"mouseover\", bt = \"mousemove\", ht = \"mousewheel\", yt = \"move\", wt = \"orientationchange\", At = \"pointercancel\", St = \"pointerdown\", Nt = \"pointerleave\", kt = \"pointermove\", Mt = \"pointerup\", Tt = \"readystatechange\", Dt = \"reset\", Ct = \"resize\", Ot = \"select\", Lt = \"selectend\", It = \"selectstart\", zt = \"scroll\", xt = \"submit\", Vt = \"touchstart\", Bt = \"touchmove\", Ht = \"touchcancel\", Pt = \"touchend\", Ft = \"unload\", Te = {\n DOMContentLoaded: P,\n DOMMouseScroll: Y,\n abort: q,\n beforeunload: G,\n blur: J,\n change: K,\n click: it,\n contextmenu: X,\n dblclick: ut,\n error: Z,\n focus: $,\n focusin: _,\n focusout: tt,\n gesturechange: et,\n gestureend: nt,\n gesturestart: ot,\n hover: pt,\n keydown: st,\n keypress: ct,\n keyup: rt,\n load: at,\n mousedown: lt,\n mousemove: bt,\n mousein: gt,\n mouseout: vt,\n mouseenter: mt,\n mouseleave: ft,\n mouseover: Et,\n mouseup: dt,\n mousewheel: ht,\n move: yt,\n orientationchange: wt,\n pointercancel: At,\n pointerdown: St,\n pointerleave: Nt,\n pointermove: kt,\n pointerup: Mt,\n readystatechange: Tt,\n reset: Dt,\n resize: Ct,\n scroll: zt,\n select: Ot,\n selectend: Lt,\n selectstart: It,\n submit: xt,\n touchcancel: Ht,\n touchend: Pt,\n touchmove: Bt,\n touchstart: Vt,\n unload: Ft\n}, De = \"drag\", Ce = \"dragstart\", Oe = \"dragenter\", Le = \"dragleave\", Ie = \"dragover\", ze = \"dragend\", xe = \"loadstart\", Ve = {\n start: \"mousedown\",\n end: \"mouseup\",\n move: \"mousemove\",\n cancel: \"mouseleave\"\n}, Be = { down: \"mousedown\", up: \"mouseup\" }, He = \"onmouseleave\" in document ? [\"mouseenter\", \"mouseleave\"] : (\n /* istanbul ignore next */\n [\"mouseover\", \"mouseout\"]\n), Pe = {\n start: \"touchstart\",\n end: \"touchend\",\n move: \"touchmove\",\n cancel: \"touchcancel\"\n}, Fe = { in: \"focusin\", out: \"focusout\" }, Ue = {\n Backspace: \"Backspace\",\n // 8\n Tab: \"Tab\",\n // 9\n Enter: \"Enter\",\n // 13\n Shift: \"Shift\",\n // 16\n Control: \"Control\",\n // 17\n Alt: \"Alt\",\n // 18\n Pause: \"Pause\",\n // 19\n CapsLock: \"CapsLock\",\n // 20\n Escape: \"Escape\",\n // 27\n Scape: \"Space\",\n // 32\n ArrowLeft: \"ArrowLeft\",\n // 37\n ArrowUp: \"ArrowUp\",\n // 38\n ArrowRight: \"ArrowRight\",\n // 39\n ArrowDown: \"ArrowDown\",\n // 40\n Insert: \"Insert\",\n // 45\n Delete: \"Delete\",\n // 46\n Meta: \"Meta\",\n // 91 windows key\n ContextMenu: \"ContextMenu\",\n // 93\n ScrollLock: \"ScrollLock\"\n // 145\n}, We = \"Alt\", Re = \"ArrowDown\", Qe = \"ArrowUp\", je = \"ArrowLeft\", qe = \"ArrowRight\", Ge = \"Backspace\", Je = \"CapsLock\", Ke = \"Control\", Xe = \"Delete\", Ye = \"Enter\", Ze = \"NumpadEnter\", $e = \"Escape\", _e = \"Insert\", tn = \"Meta\", en = \"Pause\", nn = \"ScrollLock\", on = \"Shift\", sn = \"Space\", cn = \"Tab\", Ut = \"animationDuration\", Wt = \"animationDelay\", F = \"animationName\", D = \"animationend\", Rt = \"transitionDuration\", Qt = \"transitionDelay\", C = \"transitionend\", U = \"transitionProperty\", rn = \"addEventListener\", an = \"removeEventListener\", un = {\n linear: \"linear\",\n easingSinusoidalIn: \"cubic-bezier(0.47,0,0.745,0.715)\",\n easingSinusoidalOut: \"cubic-bezier(0.39,0.575,0.565,1)\",\n easingSinusoidalInOut: \"cubic-bezier(0.445,0.05,0.55,0.95)\",\n easingQuadraticIn: \"cubic-bezier(0.550,0.085,0.680,0.530)\",\n easingQuadraticOut: \"cubic-bezier(0.250,0.460,0.450,0.940)\",\n easingQuadraticInOut: \"cubic-bezier(0.455,0.030,0.515,0.955)\",\n easingCubicIn: \"cubic-bezier(0.55,0.055,0.675,0.19)\",\n easingCubicOut: \"cubic-bezier(0.215,0.61,0.355,1)\",\n easingCubicInOut: \"cubic-bezier(0.645,0.045,0.355,1)\",\n easingQuarticIn: \"cubic-bezier(0.895,0.03,0.685,0.22)\",\n easingQuarticOut: \"cubic-bezier(0.165,0.84,0.44,1)\",\n easingQuarticInOut: \"cubic-bezier(0.77,0,0.175,1)\",\n easingQuinticIn: \"cubic-bezier(0.755,0.05,0.855,0.06)\",\n easingQuinticOut: \"cubic-bezier(0.23,1,0.32,1)\",\n easingQuinticInOut: \"cubic-bezier(0.86,0,0.07,1)\",\n easingExponentialIn: \"cubic-bezier(0.95,0.05,0.795,0.035)\",\n easingExponentialOut: \"cubic-bezier(0.19,1,0.22,1)\",\n easingExponentialInOut: \"cubic-bezier(1,0,0,1)\",\n easingCircularIn: \"cubic-bezier(0.6,0.04,0.98,0.335)\",\n easingCircularOut: \"cubic-bezier(0.075,0.82,0.165,1)\",\n easingCircularInOut: \"cubic-bezier(0.785,0.135,0.15,0.86)\",\n easingBackIn: \"cubic-bezier(0.6,-0.28,0.735,0.045)\",\n easingBackOut: \"cubic-bezier(0.175,0.885,0.32,1.275)\",\n easingBackInOut: \"cubic-bezier(0.68,-0.55,0.265,1.55)\"\n}, ln = \"offsetHeight\", dn = \"offsetWidth\", pn = \"scrollHeight\", mn = \"scrollWidth\", fn = \"tabindex\", jt = navigator.userAgentData, A = jt, { userAgent: qt } = navigator, S = qt, z = /iPhone|iPad|iPod|Android/i;\nlet O = !1;\nA ? O = A.brands.some((t) => z.test(t.brand)) : O = z.test(S);\nconst gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.brand)) : (\n /* istanbul ignore next */\n x.test(S)\n), En = S ? S.includes(\"Firefox\") : (\n /* istanbul ignore next */\n !1\n), { head: N } = document, bn = [\"webkitPerspective\", \"perspective\"].some((t) => t in N.style), Gt = (t, e, n, o) => {\n const s = o || !1;\n t.addEventListener(e, n, s);\n}, Jt = (t, e, n, o) => {\n const s = o || !1;\n t.removeEventListener(e, n, s);\n}, Kt = (t, e, n, o) => {\n const s = (r) => {\n (r.target === t || r.currentTarget === t) && (n.apply(t, [r]), Jt(t, e, s, o));\n };\n Gt(t, e, s, o);\n}, Xt = () => {\n}, hn = (() => {\n let t = !1;\n try {\n const e = Object.defineProperty({}, \"passive\", {\n get: () => (t = !0, t)\n });\n Kt(document, P, Xt, e);\n } catch {\n }\n return t;\n})(), yn = [\"webkitTransform\", \"transform\"].some((t) => t in N.style), wn = \"ontouchstart\" in window || /* istanbul ignore next */\n\"msMaxTouchPoints\" in navigator, An = [\"webkitAnimation\", \"animation\"].some((t) => t in N.style), Sn = [\"webkitTransition\", \"transition\"].some((t) => t in N.style), Yt = (t, e) => t.getAttribute(e), Nn = (t, e, n) => e.getAttributeNS(t, n), kn = (t, e) => t.hasAttribute(e), Mn = (t, e, n) => e.hasAttributeNS(t, n), Tn = (t, e, n) => t.setAttribute(e, n), Dn = (t, e, n, o) => e.setAttributeNS(t, n, o), Cn = (t, e) => t.removeAttribute(e), On = (t, e, n) => e.removeAttributeNS(t, n), Ln = (t, ...e) => {\n t.classList.add(...e);\n}, In = (t, ...e) => {\n t.classList.remove(...e);\n}, zn = (t, e) => t.classList.contains(e), { body: xn } = document, { documentElement: Vn } = document, Bn = (t) => Array.from(t), v = (t) => t != null && typeof t == \"object\" || !1, i = (t) => v(t) && typeof t.nodeType == \"number\" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some((e) => t.nodeType === e) || !1, u = (t) => i(t) && t.nodeType === 1 || !1, E = /* @__PURE__ */ new Map(), L = {\n data: E,\n /**\n * Sets web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @param instance the component instance\n */\n set: (t, e, n) => {\n if (!u(t))\n return;\n E.has(e) || E.set(e, /* @__PURE__ */ new Map()), E.get(e).set(t, n);\n },\n /**\n * Returns all instances for specified component.\n *\n * @param component the component's name or a unique key\n * @returns all the component instances\n */\n getAllFor: (t) => E.get(t) || null,\n /**\n * Returns the instance associated with the target.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @returns the instance\n */\n get: (t, e) => {\n if (!u(t) || !e)\n return null;\n const n = L.getAllFor(e);\n return t && n && n.get(t) || null;\n },\n /**\n * Removes web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n */\n remove: (t, e) => {\n const n = L.getAllFor(e);\n !n || !u(t) || (n.delete(t), n.size === 0 && E.delete(e));\n }\n}, Hn = (t, e) => L.get(t, e), k = (t) => typeof t == \"string\" || !1, W = (t) => v(t) && t.constructor.name === \"Window\" || !1, R = (t) => i(t) && t.nodeType === 9 || !1, d = (t) => W(t) ? t.document : R(t) ? t : i(t) ? t.ownerDocument : window.document, M = (t, ...e) => Object.assign(t, ...e), Zt = (t) => {\n if (!t)\n return;\n if (k(t))\n return d().createElement(t);\n const { tagName: e } = t, n = Zt(e);\n if (!n)\n return;\n const o = { ...t };\n return delete o.tagName, M(n, o);\n}, $t = (t, e) => {\n if (!t || !e)\n return;\n if (k(e))\n return d().createElementNS(t, e);\n const { tagName: n } = e, o = $t(t, n);\n if (!o)\n return;\n const s = { ...e };\n return delete s.tagName, M(o, s);\n}, Q = (t, e) => t.dispatchEvent(e), Pn = (t, e, n) => n.indexOf(t) === e, g = (t, e) => {\n const n = getComputedStyle(t), o = e.replace(\"webkit\", \"Webkit\").replace(/([A-Z])/g, \"-$1\").toLowerCase();\n return n.getPropertyValue(o);\n}, _t = (t) => {\n const e = g(t, F), n = g(t, Wt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, te = (t) => {\n const e = g(t, F), n = g(t, Ut), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Fn = (t, e) => {\n let n = 0;\n const o = new Event(D), s = te(t), r = _t(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(D, a), n = 1);\n };\n t.addEventListener(D, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, ee = (t) => {\n const e = g(t, U), n = g(t, Qt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, ne = (t) => {\n const e = g(t, U), n = g(t, Rt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Un = (t, e) => {\n let n = 0;\n const o = new Event(C), s = ne(t), r = ee(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(C, a), n = 1);\n };\n t.addEventListener(C, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, Wn = (t) => Float32Array.from(Array.from(t)), Rn = (t) => Float64Array.from(Array.from(t)), Qn = (t, e) => t.focus(e), V = (t) => [\"true\", !0].includes(t) ? !0 : [\"false\", !1].includes(t) ? !1 : [\"null\", \"\", null, void 0].includes(t) ? null : t !== \"\" && !Number.isNaN(+t) ? +t : t, w = (t) => Object.entries(t), oe = (t) => t.toLowerCase(), jn = (t, e, n, o) => {\n const s = { ...n }, r = { ...t.dataset }, a = { ...e }, l = {}, p = \"title\";\n return w(r).forEach(([c, m]) => {\n const y = o && typeof c == \"string\" && c.includes(o) ? c.replace(o, \"\").replace(/[A-Z]/g, (j) => oe(j)) : c;\n l[y] = V(m);\n }), w(s).forEach(([c, m]) => {\n s[c] = V(m);\n }), w(e).forEach(([c, m]) => {\n c in s ? a[c] = s[c] : c in l ? a[c] = l[c] : a[c] = c === p ? Yt(t, p) : m;\n }), a;\n}, qn = (t, e) => v(t) && (Object.hasOwn(t, e) || e in t), Gn = (t) => Object.keys(t), Jn = (t) => Object.values(t), Kn = (t) => Object.fromEntries(t), Xn = (t, e) => {\n const n = new CustomEvent(t, {\n cancelable: !0,\n bubbles: !0\n });\n return v(e) && M(n, e), n;\n}, Yn = { passive: !0 }, Zn = (t) => t.offsetHeight, $n = (t, e) => {\n w(e).forEach(([n, o]) => {\n if (o && k(n) && n.includes(\"--\"))\n t.style.setProperty(n, o);\n else {\n const s = {};\n s[n] = o, M(t.style, s);\n }\n });\n}, I = (t) => v(t) && t.constructor.name === \"Map\" || !1, se = (t) => typeof t == \"number\" || !1, f = /* @__PURE__ */ new Map(), _n = {\n /**\n * Sets a new timeout timer for an element, or element -> key association.\n *\n * @param element target element\n * @param callback the callback\n * @param delay the execution delay\n * @param key a unique key\n */\n set: (t, e, n, o) => {\n u(t) && (o && o.length ? (f.has(t) || f.set(t, /* @__PURE__ */ new Map()), f.get(t).set(o, setTimeout(e, n))) : f.set(t, setTimeout(e, n)));\n },\n /**\n * Returns the timer associated with the target.\n *\n * @param element target element\n * @param key a unique\n * @returns the timer\n */\n get: (t, e) => {\n if (!u(t))\n return null;\n const n = f.get(t);\n return e && n && I(n) ? n.get(e) || /* istanbul ignore next */\n null : se(n) ? n : null;\n },\n /**\n * Clears the element's timer.\n *\n * @param element target element\n * @param key a unique key\n */\n clear: (t, e) => {\n if (!u(t))\n return;\n const n = f.get(t);\n e && e.length && I(n) ? (clearTimeout(n.get(e)), n.delete(e), n.size === 0 && f.delete(t)) : (clearTimeout(n), f.delete(t));\n }\n}, to = (t) => t.toUpperCase(), h = (t, e) => {\n const { width: n, height: o, top: s, right: r, bottom: a, left: l } = t.getBoundingClientRect();\n let p = 1, c = 1;\n if (e && u(t)) {\n const { offsetWidth: m, offsetHeight: y } = t;\n p = m > 0 ? Math.round(n) / m : (\n /* istanbul ignore next */\n 1\n ), c = y > 0 ? Math.round(o) / y : (\n /* istanbul ignore next */\n 1\n );\n }\n return {\n width: n / p,\n height: o / c,\n top: s / c,\n right: r / p,\n bottom: a / c,\n left: l / p,\n x: l / p,\n y: s / c\n };\n}, eo = (t) => d(t).body, T = (t) => d(t).documentElement, no = (t) => d(t).head, oo = (t) => {\n const e = W(t), n = e ? t.scrollX : t.scrollLeft, o = e ? t.scrollY : t.scrollTop;\n return { x: n, y: o };\n}, ce = (t) => i(t) && t.constructor.name === \"ShadowRoot\" || !1, so = (t) => t.nodeName === \"HTML\" ? t : u(t) && t.assignedSlot || // step into the shadow DOM of the parent of a slotted node\ni(t) && t.parentNode || // DOM Element detected\nce(t) && t.host || // ShadowRoot detected\nT(t), re = (t) => {\n if (!u(t))\n return !1;\n const { width: e, height: n } = h(t), { offsetWidth: o, offsetHeight: s } = t;\n return Math.round(e) !== o || Math.round(n) !== s;\n}, co = (t, e, n) => {\n const o = u(e), s = h(t, o && re(e)), r = { x: 0, y: 0 };\n if (o) {\n const a = h(e, !0);\n r.x = a.x + e.clientLeft, r.y = a.y + e.clientTop;\n }\n return {\n x: s.left + n.x - r.x,\n y: s.top + n.y - r.y,\n width: s.width,\n height: s.height\n };\n};\nlet B = 0, H = 0;\nconst b = /* @__PURE__ */ new Map(), ae = (t, e) => {\n let n = e ? B : H;\n if (e) {\n const o = ae(t), s = b.get(o) || /* @__PURE__ */ new Map();\n b.has(o) || b.set(o, s), I(s) && !s.has(e) ? (s.set(e, n), B += 1) : n = s.get(e);\n } else {\n const o = t.id || t;\n b.has(o) ? n = b.get(o) : (b.set(o, n), H += 1);\n }\n return n;\n}, ro = (t) => {\n var e;\n return t ? R(t) ? t.defaultView : i(t) ? (e = t == null ? void 0 : t.ownerDocument) == null ? void 0 : e.defaultView : t : window;\n}, ie = (t) => Array.isArray(t) || !1, ao = (t) => i(t) && t.nodeName === \"CANVAS\" || !1, ue = (t) => u(t) && !!t.shadowRoot || !1, io = (t) => i(t) && [1, 2, 3, 4, 5, 6, 7, 8].some((e) => t.nodeType === e) || !1, uo = (t) => {\n if (!i(t))\n return !1;\n const { top: e, bottom: n } = h(t), { clientHeight: o } = T(t);\n return e <= o && n >= 0;\n}, lo = (t) => {\n if (!i(t))\n return !1;\n const { clientWidth: e, clientHeight: n } = T(t), { top: o, left: s, bottom: r, right: a } = h(t, !0);\n return o >= 0 && s >= 0 && r <= n && a <= e;\n}, po = (t) => ie(t) && t.every(u) || !1, mo = (t) => typeof t == \"function\" || !1, fo = (t) => v(t) && t.constructor.name === \"HTMLCollection\" || !1, go = (t) => u(t) && t.tagName === \"IMG\" || !1, vo = (t) => {\n if (!k(t))\n return !1;\n try {\n JSON.parse(t);\n } catch {\n return !1;\n }\n return !0;\n}, Eo = (t) => v(t) && t.constructor.name === \"WeakMap\" || !1, bo = (t) => i(t) && [\"SVG\", \"Image\", \"Video\", \"Canvas\"].some((e) => t.constructor.name.includes(e)) || !1, ho = (t) => v(t) && t.constructor.name === \"NodeList\" || !1, yo = (t) => T(t).dir === \"rtl\", wo = (t) => i(t) && t.constructor.name.includes(\"SVG\") || !1, Ao = (t) => i(t) && [\"TABLE\", \"TD\", \"TH\"].includes(t.nodeName) || !1, le = (t, e) => t ? t.closest(e) || // break out of `ShadowRoot`\nle(t.getRootNode().host, e) : null, So = (t, e) => u(t) ? t : (i(e) ? e : d()).querySelector(t), de = (t, e) => (i(e) ? e : d()).getElementsByTagName(t), No = (t) => [...de(\"*\", t)].filter(ue), ko = (t, e) => d(e).getElementById(t) || null, Mo = (t, e) => (i(e) ? e : d()).querySelectorAll(t), To = (t, e) => (e && i(e) ? e : d()).getElementsByClassName(\n t\n), Do = (t, e) => t.matches(e), Co = \"2.0.0alpha21\";\nexport {\n Bn as ArrayFrom,\n P as DOMContentLoadedEvent,\n Y as DOMMouseScrollEvent,\n L as Data,\n Wn as Float32ArrayFrom,\n Rn as Float64ArrayFrom,\n M as ObjectAssign,\n w as ObjectEntries,\n Kn as ObjectFromEntries,\n qn as ObjectHasOwn,\n Gn as ObjectKeys,\n Jn as ObjectValues,\n _n as Timer,\n q as abortEvent,\n Ln as addClass,\n rn as addEventListener,\n Wt as animationDelay,\n Ut as animationDuration,\n D as animationEndEvent,\n F as animationName,\n pe as ariaChecked,\n fe as ariaDescribedBy,\n me as ariaDescription,\n ge as ariaExpanded,\n ve as ariaHasPopup,\n Ee as ariaHidden,\n be as ariaLabel,\n he as ariaLabelledBy,\n ye as ariaModal,\n we as ariaPressed,\n Ae as ariaSelected,\n Ne as ariaValueMax,\n Se as ariaValueMin,\n ke as ariaValueNow,\n Me as ariaValueText,\n G as beforeunloadEvent,\n un as bezierEasings,\n J as blurEvent,\n K as changeEvent,\n le as closest,\n X as contextmenuEvent,\n Xn as createCustomEvent,\n Zt as createElement,\n $t as createElementNS,\n Q as dispatchEvent,\n Pn as distinct,\n xn as documentBody,\n Vn as documentElement,\n N as documentHead,\n De as dragEvent,\n ze as dragendEvent,\n Oe as dragenterEvent,\n Le as dragleaveEvent,\n Ie as dragoverEvent,\n Ce as dragstartEvent,\n Fn as emulateAnimationEnd,\n Un as emulateTransitionEnd,\n Z as errorEvent,\n Qn as focus,\n $ as focusEvent,\n Fe as focusEvents,\n _ as focusinEvent,\n tt as focusoutEvent,\n et as gesturechangeEvent,\n nt as gestureendEvent,\n ot as gesturestartEvent,\n Yt as getAttribute,\n Nn as getAttributeNS,\n h as getBoundingClientRect,\n No as getCustomElements,\n d as getDocument,\n eo as getDocumentBody,\n T as getDocumentElement,\n no as getDocumentHead,\n _t as getElementAnimationDelay,\n te as getElementAnimationDuration,\n ko as getElementById,\n g as getElementStyle,\n ee as getElementTransitionDelay,\n ne as getElementTransitionDuration,\n To as getElementsByClassName,\n de as getElementsByTagName,\n Hn as getInstance,\n oo as getNodeScroll,\n so as getParentNode,\n co as getRectRelativeToOffsetParent,\n ae as getUID,\n ro as getWindow,\n kn as hasAttribute,\n Mn as hasAttributeNS,\n zn as hasClass,\n vn as isApple,\n ie as isArray,\n ao as isCanvas,\n ue as isCustomElement,\n R as isDocument,\n io as isElement,\n uo as isElementInScrollRange,\n lo as isElementInViewport,\n po as isElementsArray,\n En as isFirefox,\n mo as isFunction,\n fo as isHTMLCollection,\n u as isHTMLElement,\n go as isHTMLImageElement,\n vo as isJSON,\n I as isMap,\n bo as isMedia,\n gn as isMobile,\n i as isNode,\n ho as isNodeList,\n se as isNumber,\n v as isObject,\n yo as isRTL,\n wo as isSVGElement,\n re as isScaledElement,\n ce as isShadowRoot,\n k as isString,\n Ao as isTableElement,\n Eo as isWeakMap,\n W as isWindow,\n We as keyAlt,\n Re as keyArrowDown,\n je as keyArrowLeft,\n qe as keyArrowRight,\n Qe as keyArrowUp,\n Ge as keyBackspace,\n Je as keyCapsLock,\n Ke as keyControl,\n Xe as keyDelete,\n Ye as keyEnter,\n $e as keyEscape,\n _e as keyInsert,\n tn as keyMeta,\n Ze as keyNumpadEnter,\n en as keyPause,\n nn as keyScrollLock,\n on as keyShift,\n sn as keySpace,\n cn as keyTab,\n Ue as keyboardEventKeys,\n st as keydownEvent,\n ct as keypressEvent,\n rt as keyupEvent,\n at as loadEvent,\n xe as loadstartEvent,\n Do as matches,\n Be as mouseClickEvents,\n He as mouseHoverEvents,\n Ve as mouseSwipeEvents,\n it as mouseclickEvent,\n ut as mousedblclickEvent,\n lt as mousedownEvent,\n mt as mouseenterEvent,\n pt as mousehoverEvent,\n gt as mouseinEvent,\n ft as mouseleaveEvent,\n bt as mousemoveEvent,\n vt as mouseoutEvent,\n Et as mouseoverEvent,\n dt as mouseupEvent,\n ht as mousewheelEvent,\n yt as moveEvent,\n Te as nativeEvents,\n Xt as noop,\n jn as normalizeOptions,\n V as normalizeValue,\n Jt as off,\n ln as offsetHeight,\n dn as offsetWidth,\n Gt as on,\n Kt as one,\n wt as orientationchangeEvent,\n Yn as passiveHandler,\n At as pointercancelEvent,\n St as pointerdownEvent,\n Nt as pointerleaveEvent,\n kt as pointermoveEvent,\n Mt as pointerupEvent,\n So as querySelector,\n Mo as querySelectorAll,\n Tt as readystatechangeEvent,\n Zn as reflow,\n Cn as removeAttribute,\n On as removeAttributeNS,\n In as removeClass,\n an as removeEventListener,\n Dt as resetEvent,\n Ct as resizeEvent,\n zt as scrollEvent,\n pn as scrollHeight,\n mn as scrollWidth,\n Ot as selectEvent,\n Lt as selectendEvent,\n It as selectstartEvent,\n Tn as setAttribute,\n Dn as setAttributeNS,\n $n as setElementStyle,\n xt as submitEvent,\n bn as support3DTransform,\n An as supportAnimation,\n hn as supportPassive,\n wn as supportTouch,\n yn as supportTransform,\n Sn as supportTransition,\n fn as tabindex,\n oe as toLowerCase,\n to as toUpperCase,\n Pe as touchEvents,\n Ht as touchcancelEvent,\n Pt as touchendEvent,\n Bt as touchmoveEvent,\n Vt as touchstartEvent,\n Qt as transitionDelay,\n Rt as transitionDuration,\n C as transitionEndEvent,\n U as transitionProperty,\n Ft as unloadEvent,\n S as userAgent,\n A as userAgentData,\n Co as version\n};\n//# sourceMappingURL=shorty.mjs.map\n","const N = [\"transparent\", \"currentColor\", \"inherit\", \"revert\", \"initial\"], b = (o) => {\n const t = Math.floor(o);\n return o - t < 0.5 ? t : Math.round(o);\n}, T = [\n [\n \"aliceblue\",\n {\n r: 240,\n g: 248,\n b: 255\n }\n ],\n [\n \"antiquewhite\",\n {\n r: 250,\n g: 235,\n b: 215\n }\n ],\n [\n \"aqua\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"aquamarine\",\n {\n r: 127,\n g: 255,\n b: 212\n }\n ],\n [\n \"azure\",\n {\n r: 240,\n g: 255,\n b: 255\n }\n ],\n [\n \"beige\",\n {\n r: 245,\n g: 245,\n b: 220\n }\n ],\n [\n \"bisque\",\n {\n r: 255,\n g: 228,\n b: 196\n }\n ],\n [\n \"black\",\n {\n r: 0,\n g: 0,\n b: 0\n }\n ],\n [\n \"blanchedalmond\",\n {\n r: 255,\n g: 235,\n b: 205\n }\n ],\n [\n \"blue\",\n {\n r: 0,\n g: 0,\n b: 255\n }\n ],\n [\n \"blueviolet\",\n {\n r: 138,\n g: 43,\n b: 226\n }\n ],\n [\n \"brown\",\n {\n r: 165,\n g: 42,\n b: 42\n }\n ],\n [\n \"burlywood\",\n {\n r: 222,\n g: 184,\n b: 135\n }\n ],\n [\n \"cadetblue\",\n {\n r: 95,\n g: 158,\n b: 160\n }\n ],\n [\n \"chartreuse\",\n {\n r: 127,\n g: 255,\n b: 0\n }\n ],\n [\n \"chocolate\",\n {\n r: 210,\n g: 105,\n b: 30\n }\n ],\n [\n \"coral\",\n {\n r: 255,\n g: 127,\n b: 80\n }\n ],\n [\n \"cornflowerblue\",\n {\n r: 100,\n g: 149,\n b: 237\n }\n ],\n [\n \"cornsilk\",\n {\n r: 255,\n g: 248,\n b: 220\n }\n ],\n [\n \"crimson\",\n {\n r: 220,\n g: 20,\n b: 60\n }\n ],\n [\n \"cyan\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"darkblue\",\n {\n r: 0,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkcyan\",\n {\n r: 0,\n g: 139,\n b: 139\n }\n ],\n [\n \"darkgoldenrod\",\n {\n r: 184,\n g: 134,\n b: 11\n }\n ],\n [\n \"darkgray\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkgreen\",\n {\n r: 0,\n g: 100,\n b: 0\n }\n ],\n [\n \"darkgrey\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkkhaki\",\n {\n r: 189,\n g: 183,\n b: 107\n }\n ],\n [\n \"darkmagenta\",\n {\n r: 139,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkolivegreen\",\n {\n r: 85,\n g: 107,\n b: 47\n }\n ],\n [\n \"darkorange\",\n {\n r: 255,\n g: 140,\n b: 0\n }\n ],\n [\n \"darkorchid\",\n {\n r: 153,\n g: 50,\n b: 204\n }\n ],\n [\n \"darkred\",\n {\n r: 139,\n g: 0,\n b: 0\n }\n ],\n [\n \"darksalmon\",\n {\n r: 233,\n g: 150,\n b: 122\n }\n ],\n [\n \"darkseagreen\",\n {\n r: 143,\n g: 188,\n b: 143\n }\n ],\n [\n \"darkslateblue\",\n {\n r: 72,\n g: 61,\n b: 139\n }\n ],\n [\n \"darkslategray\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkslategrey\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkturquoise\",\n {\n r: 0,\n g: 206,\n b: 209\n }\n ],\n [\n \"darkviolet\",\n {\n r: 148,\n g: 0,\n b: 211\n }\n ],\n [\n \"deeppink\",\n {\n r: 255,\n g: 20,\n b: 147\n }\n ],\n [\n \"deepskyblue\",\n {\n r: 0,\n g: 191,\n b: 255\n }\n ],\n [\n \"dimgray\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dimgrey\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dodgerblue\",\n {\n r: 30,\n g: 144,\n b: 255\n }\n ],\n [\n \"firebrick\",\n {\n r: 178,\n g: 34,\n b: 34\n }\n ],\n [\n \"floralwhite\",\n {\n r: 255,\n g: 250,\n b: 240\n }\n ],\n [\n \"forestgreen\",\n {\n r: 34,\n g: 139,\n b: 34\n }\n ],\n [\n \"fuchsia\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"gainsboro\",\n {\n r: 220,\n g: 220,\n b: 220\n }\n ],\n [\n \"ghostwhite\",\n {\n r: 248,\n g: 248,\n b: 255\n }\n ],\n [\n \"goldenrod\",\n {\n r: 218,\n g: 165,\n b: 32\n }\n ],\n [\n \"gold\",\n {\n r: 255,\n g: 215,\n b: 0\n }\n ],\n [\n \"gray\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"green\",\n {\n r: 0,\n g: 128,\n b: 0\n }\n ],\n [\n \"greenyellow\",\n {\n r: 173,\n g: 255,\n b: 47\n }\n ],\n [\n \"grey\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"honeydew\",\n {\n r: 240,\n g: 255,\n b: 240\n }\n ],\n [\n \"hotpink\",\n {\n r: 255,\n g: 105,\n b: 180\n }\n ],\n [\n \"indianred\",\n {\n r: 205,\n g: 92,\n b: 92\n }\n ],\n [\n \"indigo\",\n {\n r: 75,\n g: 0,\n b: 130\n }\n ],\n [\n \"ivory\",\n {\n r: 255,\n g: 255,\n b: 240\n }\n ],\n [\n \"khaki\",\n {\n r: 240,\n g: 230,\n b: 140\n }\n ],\n [\n \"lavenderblush\",\n {\n r: 255,\n g: 240,\n b: 245\n }\n ],\n [\n \"lavender\",\n {\n r: 230,\n g: 230,\n b: 250\n }\n ],\n [\n \"lawngreen\",\n {\n r: 124,\n g: 252,\n b: 0\n }\n ],\n [\n \"lemonchiffon\",\n {\n r: 255,\n g: 250,\n b: 205\n }\n ],\n [\n \"lightblue\",\n {\n r: 173,\n g: 216,\n b: 230\n }\n ],\n [\n \"lightcoral\",\n {\n r: 240,\n g: 128,\n b: 128\n }\n ],\n [\n \"lightcyan\",\n {\n r: 224,\n g: 255,\n b: 255\n }\n ],\n [\n \"lightgoldenrodyellow\",\n {\n r: 250,\n g: 250,\n b: 210\n }\n ],\n [\n \"lightgray\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightgreen\",\n {\n r: 144,\n g: 238,\n b: 144\n }\n ],\n [\n \"lightgrey\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightpink\",\n {\n r: 255,\n g: 182,\n b: 193\n }\n ],\n [\n \"lightsalmon\",\n {\n r: 255,\n g: 160,\n b: 122\n }\n ],\n [\n \"lightseagreen\",\n {\n r: 32,\n g: 178,\n b: 170\n }\n ],\n [\n \"lightskyblue\",\n {\n r: 135,\n g: 206,\n b: 250\n }\n ],\n [\n \"lightslategray\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightslategrey\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightsteelblue\",\n {\n r: 176,\n g: 196,\n b: 222\n }\n ],\n [\n \"lightyellow\",\n {\n r: 255,\n g: 255,\n b: 224\n }\n ],\n [\n \"lime\",\n {\n r: 0,\n g: 255,\n b: 0\n }\n ],\n [\n \"limegreen\",\n {\n r: 50,\n g: 205,\n b: 50\n }\n ],\n [\n \"linen\",\n {\n r: 250,\n g: 240,\n b: 230\n }\n ],\n [\n \"magenta\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"maroon\",\n {\n r: 128,\n g: 0,\n b: 0\n }\n ],\n [\n \"mediumaquamarine\",\n {\n r: 102,\n g: 205,\n b: 170\n }\n ],\n [\n \"mediumblue\",\n {\n r: 0,\n g: 0,\n b: 205\n }\n ],\n [\n \"mediumorchid\",\n {\n r: 186,\n g: 85,\n b: 211\n }\n ],\n [\n \"mediumpurple\",\n {\n r: 147,\n g: 112,\n b: 219\n }\n ],\n [\n \"mediumseagreen\",\n {\n r: 60,\n g: 179,\n b: 113\n }\n ],\n [\n \"mediumslateblue\",\n {\n r: 123,\n g: 104,\n b: 238\n }\n ],\n [\n \"mediumspringgreen\",\n {\n r: 0,\n g: 250,\n b: 154\n }\n ],\n [\n \"mediumturquoise\",\n {\n r: 72,\n g: 209,\n b: 204\n }\n ],\n [\n \"mediumvioletred\",\n {\n r: 199,\n g: 21,\n b: 133\n }\n ],\n [\n \"midnightblue\",\n {\n r: 25,\n g: 25,\n b: 112\n }\n ],\n [\n \"mintcream\",\n {\n r: 245,\n g: 255,\n b: 250\n }\n ],\n [\n \"mistyrose\",\n {\n r: 255,\n g: 228,\n b: 225\n }\n ],\n [\n \"moccasin\",\n {\n r: 255,\n g: 228,\n b: 181\n }\n ],\n [\n \"navajowhite\",\n {\n r: 255,\n g: 222,\n b: 173\n }\n ],\n [\n \"navy\",\n {\n r: 0,\n g: 0,\n b: 128\n }\n ],\n [\n \"oldlace\",\n {\n r: 253,\n g: 245,\n b: 230\n }\n ],\n [\n \"olive\",\n {\n r: 128,\n g: 128,\n b: 0\n }\n ],\n [\n \"olivedrab\",\n {\n r: 107,\n g: 142,\n b: 35\n }\n ],\n [\n \"orange\",\n {\n r: 255,\n g: 165,\n b: 0\n }\n ],\n [\n \"orangered\",\n {\n r: 255,\n g: 69,\n b: 0\n }\n ],\n [\n \"orchid\",\n {\n r: 218,\n g: 112,\n b: 214\n }\n ],\n [\n \"palegoldenrod\",\n {\n r: 238,\n g: 232,\n b: 170\n }\n ],\n [\n \"palegreen\",\n {\n r: 152,\n g: 251,\n b: 152\n }\n ],\n [\n \"paleturquoise\",\n {\n r: 175,\n g: 238,\n b: 238\n }\n ],\n [\n \"palevioletred\",\n {\n r: 219,\n g: 112,\n b: 147\n }\n ],\n [\n \"papayawhip\",\n {\n r: 255,\n g: 239,\n b: 213\n }\n ],\n [\n \"peachpuff\",\n {\n r: 255,\n g: 218,\n b: 185\n }\n ],\n [\n \"peru\",\n {\n r: 205,\n g: 133,\n b: 63\n }\n ],\n [\n \"pink\",\n {\n r: 255,\n g: 192,\n b: 203\n }\n ],\n [\n \"plum\",\n {\n r: 221,\n g: 160,\n b: 221\n }\n ],\n [\n \"powderblue\",\n {\n r: 176,\n g: 224,\n b: 230\n }\n ],\n [\n \"purple\",\n {\n r: 128,\n g: 0,\n b: 128\n }\n ],\n [\n \"rebeccapurple\",\n {\n r: 102,\n g: 51,\n b: 153\n }\n ],\n [\n \"red\",\n {\n r: 255,\n g: 0,\n b: 0\n }\n ],\n [\n \"rosybrown\",\n {\n r: 188,\n g: 143,\n b: 143\n }\n ],\n [\n \"royalblue\",\n {\n r: 65,\n g: 105,\n b: 225\n }\n ],\n [\n \"saddlebrown\",\n {\n r: 139,\n g: 69,\n b: 19\n }\n ],\n [\n \"salmon\",\n {\n r: 250,\n g: 128,\n b: 114\n }\n ],\n [\n \"sandybrown\",\n {\n r: 244,\n g: 164,\n b: 96\n }\n ],\n [\n \"seagreen\",\n {\n r: 46,\n g: 139,\n b: 87\n }\n ],\n [\n \"seashell\",\n {\n r: 255,\n g: 245,\n b: 238\n }\n ],\n [\n \"sienna\",\n {\n r: 160,\n g: 82,\n b: 45\n }\n ],\n [\n \"silver\",\n {\n r: 192,\n g: 192,\n b: 192\n }\n ],\n [\n \"skyblue\",\n {\n r: 135,\n g: 206,\n b: 235\n }\n ],\n [\n \"slateblue\",\n {\n r: 106,\n g: 90,\n b: 205\n }\n ],\n [\n \"slategray\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"slategrey\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"snow\",\n {\n r: 255,\n g: 250,\n b: 250\n }\n ],\n [\n \"springgreen\",\n {\n r: 0,\n g: 255,\n b: 127\n }\n ],\n [\n \"steelblue\",\n {\n r: 70,\n g: 130,\n b: 180\n }\n ],\n [\n \"tan\",\n {\n r: 210,\n g: 180,\n b: 140\n }\n ],\n [\n \"teal\",\n {\n r: 0,\n g: 128,\n b: 128\n }\n ],\n [\n \"thistle\",\n {\n r: 216,\n g: 191,\n b: 216\n }\n ],\n [\n \"tomato\",\n {\n r: 255,\n g: 99,\n b: 71\n }\n ],\n [\n \"turquoise\",\n {\n r: 64,\n g: 224,\n b: 208\n }\n ],\n [\n \"violet\",\n {\n r: 238,\n g: 130,\n b: 238\n }\n ],\n [\n \"wheat\",\n {\n r: 245,\n g: 222,\n b: 179\n }\n ],\n [\n \"white\",\n {\n r: 255,\n g: 255,\n b: 255\n }\n ],\n [\n \"whitesmoke\",\n {\n r: 245,\n g: 245,\n b: 245\n }\n ],\n [\n \"yellow\",\n {\n r: 255,\n g: 255,\n b: 0\n }\n ],\n [\n \"yellowgreen\",\n {\n r: 154,\n g: 205,\n b: 50\n }\n ]\n], B = \"deg|rad|grad|turn\", U = \"[-\\\\+]?\\\\d+%?\", D = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\", L = `[-\\\\+]?\\\\d*\\\\.?\\\\d+(?:${B})?`, v = `(?:${D})|(?:${U})`, F = `(?:${v})|(?:${L}?)`, rr = \"(?:[\\\\s|\\\\(\\\\s|\\\\s\\\\(\\\\s]+)?\", tr = \"(?:[\\\\s|\\\\)\\\\s]+)?\", O = \"(?:[,|\\\\s]+)\", er = \"(?:[,|\\\\/\\\\s]*)?\", $ = `${rr}(${F})${O}(${v})${O}(${v})${er}(${v})?${tr}`, f = {\n CSS_UNIT: new RegExp(F),\n ANGLES: B,\n CSS_ANGLE: L,\n CSS_INTEGER: U,\n CSS_NUMBER: D,\n CSS_UNIT2: F,\n PERMISSIVE_MATCH: $,\n hwb: new RegExp(`hwb${$}`),\n rgb: new RegExp(`rgb(?:a)?${$}`),\n hsl: new RegExp(`hsl(?:a)?${$}`),\n hsv: new RegExp(`hsv(?:a)?${$}`),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n}, V = (o) => N.includes(o), k = (o, t) => o !== null && typeof o == \"object\" && Object.keys(t).every((r) => r in o), Z = (o) => `${o}`.includes(\".\") && parseFloat(o) === 1, R = (o) => typeof o == \"string\" && o.includes(\"%\"), c = (o) => !!f.CSS_UNIT.exec(`${o}`), z = [\"rgb\", \"hex\", \"hsl\", \"hsv\", \"hwb\"], J = (o) => N.includes(o) || [\"#\", ...z].some((t) => o.includes(t)) ? !1 : T.some(([t]) => o === t), u = (o, t) => {\n let r = o;\n if (typeof o == \"number\" && Math.min(o, 0) === 0 && // round values to 6 decimals Math.round(N * (10 ** 6)) / 10 ** 6\n Math.max(o, 1) === 1)\n return o;\n Z(o) && (r = \"100%\");\n const e = R(r);\n return r = t === 360 ? parseFloat(r) : Math.min(t, Math.max(0, parseFloat(r))), e && (r = r * t / 100), Math.abs(r - t) < 1e-6 ? 1 : (t === 360 ? r = (r < 0 ? r % t + t : r % t) / t : r = r % t / t, r);\n}, M = (o) => {\n let t = parseFloat(o);\n return (Number.isNaN(t) || t < 0 || t > 1) && (t = 1), t;\n}, x = (o) => Math.min(1, Math.max(0, o)), p = (o) => o.length === 1 ? `0${o}` : String(o), K = (o) => {\n const [[, t]] = T.filter(([r]) => r === o.toLowerCase());\n return t;\n}, h = (o) => parseInt(o, 16), E = (o) => h(o) / 255, Q = (o) => b(o * 255).toString(16), _ = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0, g = 0;\n const a = (e + s) / 2;\n if (e === s)\n g = 0, n = 0;\n else {\n const i = e - s;\n g = a > 0.5 ? i / (2 - e - s) : i / (e + s), e === o && (n = (t - r) / i + (t < r ? 6 : 0)), e === t && (n = (r - o) / i + 2), e === r && (n = (o - t) / i + 4), n /= 6;\n }\n return { h: n, s: g, l: a };\n}, H = (o, t, r) => {\n let e = r;\n return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? o + (t - o) * (6 * e) : e < 1 / 2 ? t : e < 2 / 3 ? o + (t - o) * (2 / 3 - e) * 6 : o;\n}, y = (o, t, r) => {\n let e = 0, s = 0, n = 0;\n if (t === 0)\n s = r, n = r, e = r;\n else if (r) {\n const g = r < 0.5 ? r * (1 + t) : r + t - r * t, a = 2 * r - g;\n e = H(a, g, o + 1 / 3), s = H(a, g, o), n = H(a, g, o - 1 / 3);\n }\n return { r: e, g: s, b: n };\n}, G = (o, t, r) => {\n let e = 0, s = 0;\n const n = Math.min(o, t, r), g = Math.max(o, t, r), a = 1 - g;\n if (g === n)\n return { h: 0, w: n, b: a };\n o === n ? (e = t - r, s = 3) : (e = t === n ? r - o : o - t, s = t === n ? 5 : 1);\n const i = (s - e / (g - n)) / 6;\n return {\n h: i === 1 ? 0 : i,\n w: n,\n b: a\n };\n}, X = (o, t, r) => {\n if (t + r >= 1) {\n const g = t / (t + r);\n return { r: g, g, b: g };\n }\n let { r: e, g: s, b: n } = y(o, 1, 0.5);\n return [e, s, n] = [e, s, n].map((g) => g * (1 - t - r) + t), { r: e, g: s, b: n };\n}, P = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0;\n const g = e, a = e - s, i = e === 0 ? 0 : a / e;\n return e === s ? n = 0 : (o === e && (n = (t - r) / a + (t < r ? 6 : 0)), t === e && (n = (r - o) / a + 2), r === e && (n = (o - t) / a + 4), n /= 6), { h: n, s: i, v: g };\n}, I = (o, t, r) => {\n const e = o * 6, s = t, n = r, g = Math.floor(e), a = e - g, i = n * (1 - s), l = n * (1 - a * s), d = n * (1 - (1 - a) * s), m = g % 6, w = [n, l, i, i, d, n][m], S = [d, n, n, l, i, i][m], A = [i, i, d, n, n, l][m];\n return { r: w, g: S, b: A };\n}, j = (o, t, r, e) => {\n const s = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16))\n ];\n return e && s[0].charAt(0) === s[0].charAt(1) && s[1].charAt(0) === s[1].charAt(1) && s[2].charAt(0) === s[2].charAt(1) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) : s.join(\"\");\n}, C = (o, t, r, e, s) => {\n const n = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16)),\n p(Q(e))\n ];\n return s && n[0].charAt(0) === n[0].charAt(1) && n[1].charAt(0) === n[1].charAt(1) && n[2].charAt(0) === n[2].charAt(1) && n[3].charAt(0) === n[3].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join(\"\");\n}, Y = (o) => {\n const t = String(o).trim().toLowerCase();\n if (J(t))\n return Object.assign(K(t), {\n a: 1,\n format: \"rgb\",\n ok: !0\n });\n if (V(t))\n return {\n r: 0,\n g: 0,\n b: 0,\n a: t === \"transparent\" ? 0 : 1,\n format: \"rgb\",\n ok: !0\n };\n let [, r, e, s, n] = f.rgb.exec(t) || [];\n return r && e && s ? {\n r,\n g: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"rgb\",\n ok: !0\n } : ([, r, e, s, n] = f.hsl.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n l: s,\n a: n !== void 0 ? n : 1,\n format: \"hsl\",\n ok: !0\n } : ([, r, e, s, n] = f.hsv.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n v: s,\n a: n !== void 0 ? n : 1,\n format: \"hsv\",\n ok: !0\n } : ([, r, e, s, n] = f.hwb.exec(t) || [], r && e && s ? {\n h: r,\n w: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"hwb\",\n ok: !0\n } : ([, r, e, s, n] = f.hex8.exec(t) || [], r && e && s && n ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: E(n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex6.exec(t) || [], r && e && s ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : ([, r, e, s, n] = f.hex4.exec(t) || [], r && e && s && n ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: E(n + n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex3.exec(t) || [], r && e && s ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : {\n r: 0,\n g: 0,\n b: 0,\n a: 1,\n format: \"rgb\",\n ok: !o\n })))))));\n}, q = (o) => {\n let t = { r: 0, g: 0, b: 0 }, r = o, e = 1, s, n, g, a, i, l, d, m, w = \"rgb\", S = !1;\n return (!r || typeof r == \"string\") && (r = Y(r), S = r.ok), k(r, t) && c(r.r) && c(r.g) && c(r.b) && ({ r: d, g: m, b: i } = r, [d, m, i] = [d, m, i].map((A) => u(A, R(A) ? 100 : 255)), t = { r: d, g: m, b: i }, w = \"format\" in r ? r.format : \"rgb\"), k(r, { h: 0, s: 0, v: 0 }) && c(r.h) && c(r.s) && c(r.v) && ({ h: l, s, v: n } = r, l = u(l, 360), s = u(s, 100), n = u(n, 100), t = I(l, s, n), w = \"hsv\"), k(r, { h: 0, s: 0, l: 0 }) && c(r.h) && c(r.s) && c(r.l) && ({ h: l, s, l: g } = r, l = u(l, 360), s = u(s, 100), g = u(g, 100), t = y(l, s, g), w = \"hsl\"), k(r, { h: 0, w: 0, b: 0 }) && c(r.h) && c(r.w) && c(r.b) && ({ h: l, w: a, b: i } = r, l = u(l, 360), a = u(a, 100), i = u(i, 100), t = X(l, a, i), w = \"hwb\"), c(r.a) && (e = r.a, e = R(e) || parseFloat(`${e}`) > 1 ? u(e, 100) : e), {\n r: t.r,\n g: t.g,\n b: t.b,\n a: M(e),\n format: w,\n ok: S\n };\n}, sr = \"1.0.8\";\nclass W {\n // bring main utilities to front\n static matchers = f;\n static isOnePointZero = Z;\n static isPercentage = R;\n static isValidCSSUnit = c;\n static isNonColor = V;\n static isColorName = J;\n static isColorType = k;\n static pad2 = p;\n static clamp01 = x;\n static bound01 = u;\n static boundAlpha = M;\n static getRGBFromName = K;\n static convertHexToDecimal = E;\n static convertDecimalToHex = Q;\n static rgbToHsl = _;\n static rgbToHex = j;\n static rgbToHsv = P;\n static rgbToHwb = G;\n static rgbaToHex = C;\n static hslToRgb = I;\n static hsvToRgb = I;\n static hueToRgb = H;\n static hwbToRgb = X;\n static parseIntFromHex = h;\n static stringInputToObject = Y;\n static inputToRGB = q;\n static roundPart = b;\n static webColors = T;\n static nonColors = N;\n static version = sr;\n // main public properties\n r;\n g;\n b;\n a;\n format;\n ok;\n originalInput;\n // main public methods\n constructor(t, r) {\n const e = r && z.includes(r) ? r : \"\", { r: s, g: n, b: g, a, ok: i, format: l } = q(t);\n this.originalInput = t, this.r = s, this.g = n, this.b = g, this.a = a, this.ok = i, this.format = e || l;\n }\n /**\n * Checks if the current input value is a valid colour.\n */\n get isValid() {\n return this.ok;\n }\n /**\n * Checks if the current colour requires a light text colour.\n */\n get isDark() {\n return this.brightness < 120;\n }\n /**\n * Returns the perceived luminance of a colour.\n *\n * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n */\n get luminance() {\n const { r: t, g: r, b: e } = this;\n let s = 0, n = 0, g = 0;\n return t <= 0.03928 ? s = t / 12.92 : s = ((t + 0.055) / 1.055) ** 2.4, r <= 0.03928 ? n = r / 12.92 : n = ((r + 0.055) / 1.055) ** 2.4, e <= 0.03928 ? g = e / 12.92 : g = ((e + 0.055) / 1.055) ** 2.4, 0.2126 * s + 0.7152 * n + 0.0722 * g;\n }\n /**\n * Returns the perceived brightness of the colour.\n */\n get brightness() {\n const { r: t, g: r, b: e } = this.toRgb();\n return (t * 299 + r * 587 + e * 114) / 1e3;\n }\n /**\n * Returns the web colour name closest to the current colour.\n */\n get name() {\n const { r: t, g: r, b: e } = this.toRgb(), [s] = T.map(([n, g]) => {\n const a = (\n // ((rgb.r - r) ** 2 + (rgb.g - g) ** 2 + (rgb.b - b) ** 2) ** 0.5; // standard\n (((g.r - t) * 0.3) ** 2 + ((g.g - r) * 0.6) ** 2 + ((g.b - e) * 0.1) ** 2) ** 0.5\n );\n return [n, a];\n }).find(([, n], g, a) => n === Math.min(...a.map(([, i]) => i)));\n return s;\n }\n /**\n * Returns the colour as an RGBA object.\n */\n toRgb() {\n let { r: t, g: r, b: e, a: s } = this;\n return [t, r, e] = [t, r, e].map((n) => b(n * 255 * 100) / 100), s = b(s * 100) / 100, {\n r: t,\n g: r,\n b: e,\n a: s\n };\n }\n /**\n * Returns the RGBA values concatenated into a CSS3 Module string format.\n * * rgb(255,255,255)\n * * rgba(255,255,255,0.5)\n */\n toRgbString() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b);\n return s === 1 ? `rgb(${n}, ${g}, ${a})` : `rgba(${n}, ${g}, ${a}, ${s})`;\n }\n /**\n * Returns the RGBA values concatenated into a CSS4 Module string format.\n * * rgb(255 255 255)\n * * rgb(255 255 255 / 50%)\n */\n toRgbCSS4String() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b), i = s === 1 ? \"\" : ` / ${b(s * 100)}%`;\n return `rgb(${n} ${g} ${a}${i})`;\n }\n /**\n * Returns the hexadecimal value of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the decimal value.\n */\n toHex(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return n === 1 ? j(r, e, s, t) : C(r, e, s, n, t);\n }\n /**\n * Returns the CSS valid hexadecimal vaue of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the value.\n */\n toHexString(t) {\n return `#${this.toHex(t)}`;\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return C(r, e, s, n, t);\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8String(t) {\n return `#${this.toHex8(t)}`;\n }\n /**\n * Returns the colour as a HSVA object.\n */\n toHsv() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, v: a } = P(t, r, e);\n return {\n h: n,\n s: g,\n v: a,\n a: s\n };\n }\n /**\n * Returns the colour as an HSLA object.\n */\n toHsl() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, l: a } = _(t, r, e);\n return {\n h: n,\n s: g,\n l: a,\n a: s\n };\n }\n /**\n * Returns the HSLA values concatenated into a CSS3 Module format string.\n * * `hsl(150, 100%, 50%)`\n * * `hsla(150, 100%, 50%, 0.5)`\n */\n toHslString() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n return t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100) / 100, s === 1 ? `hsl(${t}, ${r}%, ${e}%)` : `hsla(${t}, ${r}%, ${e}%, ${s})`;\n }\n /**\n * Returns the HSLA values concatenated into a CSS4 Module format string.\n * * `hsl(150deg 100% 50%)`\n * * `hsl(150deg 100% 50% / 50%)`\n */\n toHslCSS4String() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hsl(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Returns the colour as an HWBA object.\n */\n toHwb() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, w: g, b: a } = G(t, r, e);\n return {\n h: n,\n w: g,\n b: a,\n a: s\n };\n }\n /**\n * Returns the HWBA values concatenated into a string.\n */\n toHwbString() {\n let { h: t, w: r, b: e, a: s } = this.toHwb();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hwb(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Sets the alpha value of the current colour.\n */\n setAlpha(t) {\n return typeof t != \"number\" ? this : (this.a = M(t), this);\n }\n /**\n * Saturate the colour with a given amount.\n */\n saturate(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, x(e + t / 100), s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Desaturate the colour with a given amount.\n */\n desaturate(t) {\n return typeof t == \"number\" ? this.saturate(-t) : this;\n }\n /**\n * Completely desaturates a colour into greyscale.\n * Same as calling `desaturate(100)`\n */\n greyscale() {\n return this.saturate(-100);\n }\n /**\n * Increase the colour lightness with a given amount.\n */\n lighten(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, e, x(s + t / 100));\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Decrease the colour lightness with a given amount.\n */\n darken(t) {\n return typeof t == \"number\" ? this.lighten(-t) : this;\n }\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n spin(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(x((r * 360 + t) % 360 / 360), e, s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /** Returns a clone of the current `Color` instance. */\n clone() {\n return new W(this);\n }\n /**\n * Returns the colour value in CSS valid string format.\n */\n toString(t) {\n const { format: r } = this;\n return r === \"hex\" ? this.toHexString(t) : r === \"hsl\" ? this.toHslString() : r === \"hwb\" ? this.toHwbString() : this.toRgbString();\n }\n}\nexport {\n W as default\n};\n//# sourceMappingURL=index.mjs.map\n","import Color from '@thednp/color';\n// import { isNumber } from '@thednp/shorty';\n\n/**\n * Returns a color palette with a given set of parameters.\n *\n * @example\n * new ColorPalette(0, 12, 10, 80);\n * // => { hue: 0, hueSteps: 12, lightSteps: 10, saturation: 80, colors: Array }\n */\nexport default class ColorPalette {\n public static Color = Color;\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n colors: Color[];\n /**\n * The `hue` parameter is optional, which would be set to 0.\n * * `args.hue` the starting Hue [0, 360]\n * * `args.hueSteps` Hue Steps Count [5, 24]\n * * `args.lightSteps` Lightness Steps Count [5, 12]\n * * `args.saturation` Saturation [0, 100]\n */\n constructor(...args: [number?, number?, number?, number?]) {\n let hue = 0;\n let hueSteps = 12;\n let lightSteps = 10;\n let lightnessArray = [0.5];\n let saturation = 100;\n // if (!args.every(n => isNumber(n))) throw TypeError('ColorPalette only accepts numbers.');\n\n if (args.length === 4) {\n [hue, hueSteps, lightSteps, saturation] = args as [number, number, number, number];\n } else if (args.length === 3) {\n [hue, hueSteps, lightSteps] = args as [number, number, number];\n } else if (args.length === 2) {\n [hueSteps, lightSteps] = args as [number, number];\n if ([hueSteps, lightSteps].some(n => n < 1)) {\n throw TypeError('ColorPalette: the two minimum arguments must be numbers higher than 0.');\n }\n }\n\n const colors: Color[] = [];\n const hueStep = 360 / hueSteps;\n const half = Color.roundPart((lightSteps - (lightSteps % 2 ? 1 : 0)) / 2);\n const steps1To13 = [0.25, 0.2, 0.15, 0.11, 0.09, 0.075];\n const lightSets = [\n [1, 2, 3],\n [4, 5],\n [6, 7],\n [8, 9],\n [10, 11],\n [12, 13],\n ];\n const closestSet = lightSets.find(set => set.includes(lightSteps));\n\n // find a lightStep that won't go beyond black and white\n // something within the [10-90] range of lightness\n const lightStep = closestSet\n ? steps1To13[lightSets.indexOf(closestSet)]\n : 100 / (lightSteps + (lightSteps % 2 ? 0 : 1)) / 100;\n\n // light tints\n for (let i = 1; i < half + 1; i += 1) {\n lightnessArray = [...lightnessArray, 0.5 + lightStep * i];\n }\n\n // dark tints\n for (let i = 1; i < lightSteps - half; i += 1) {\n lightnessArray = [0.5 - lightStep * i, ...lightnessArray];\n }\n\n // feed `colors` Array\n for (let i = 0; i < hueSteps; i += 1) {\n const currentHue = ((hue + i * hueStep) % 360) / 360;\n lightnessArray.forEach(l => {\n const newColor = new Color({ h: currentHue, s: 1, l });\n colors.push(saturation < 100 ? newColor.saturate(saturation - 100) : newColor);\n });\n }\n\n this.hue = hue;\n this.hueSteps = hueSteps;\n this.lightSteps = lightSteps;\n this.saturation = saturation;\n this.colors = colors;\n }\n}\n","import ColorPickerLabels from '../interface/colorPickerLabels';\n\n/** The labels presented to the user. */\nconst colorPickerLabels: ColorPickerLabels = {\n pickerLabel: 'Colour Picker',\n appearanceLabel: 'Colour Appearance',\n valueLabel: 'Colour Value',\n toggleLabel: 'Select Colour',\n presetsLabel: 'Colour Presets',\n defaultsLabel: 'Colour Defaults',\n formatLabel: 'Format',\n alphaLabel: 'Alpha',\n hexLabel: 'Hexadecimal',\n hueLabel: 'Hue',\n whitenessLabel: 'Whiteness',\n blacknessLabel: 'Blackness',\n saturationLabel: 'Saturation',\n lightnessLabel: 'Lightness',\n redLabel: 'Red',\n greenLabel: 'Green',\n blueLabel: 'Blue',\n};\n\nexport default colorPickerLabels;\n","/** A list of 17 color names used for WAI-ARIA compliance. */\nconst colorNames: string[] = [\n 'white',\n 'black',\n 'grey',\n 'red',\n 'orange',\n 'brown',\n 'gold',\n 'olive',\n 'yellow',\n 'lime',\n 'green',\n 'teal',\n 'cyan',\n 'blue',\n 'violet',\n 'magenta',\n 'pink',\n];\nexport default colorNames;\n","import { isString } from '@thednp/shorty';\n\n/**\n * Check if a string is valid JSON string.\n *\n * @param str the string input\n * @returns the query result\n */\nconst isValidJSON = (str: unknown): str is string => {\n if (!isString(str)) return false;\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n};\n\nexport default isValidJSON;\n","const vHidden = 'v-hidden';\nexport default vHidden;\n","import { createElement, setAttribute, ObjectAssign, toUpperCase } from '@thednp/shorty';\n\nimport vHidden from './vHidden';\nimport ColorPicker from '../index';\n\n/**\n * Returns the color form for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns a new `
        ` element with color component ``\n */\nconst getColorForm = (self: ColorPicker): HTMLElement => {\n const { format, id, componentLabels } = self;\n const colorForm = createElement({\n tagName: 'div',\n className: `color-form ${format}`,\n }) as HTMLElement;\n\n let components = ['hex'];\n if (format === 'rgb') components = ['red', 'green', 'blue', 'alpha'];\n else if (format === 'hsl') components = ['hue', 'saturation', 'lightness', 'alpha'];\n else if (format === 'hwb') components = ['hue', 'whiteness', 'blackness', 'alpha'];\n\n components.forEach((c: string): void => {\n const [C] = format === 'hex' ? ['#'] : toUpperCase(c).split('');\n const cID = `color_${format}_${c}_${id}`;\n const formatLabel = componentLabels[`${c}Label`];\n const cInputLabel = createElement({ tagName: 'label' }) as HTMLElement;\n setAttribute(cInputLabel, 'for', cID);\n cInputLabel.append(\n createElement({\n tagName: 'span',\n ariaHidden: 'true',\n innerText: `${C}:`,\n }) as HTMLElement,\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: formatLabel,\n }) as HTMLElement,\n );\n const cInput = createElement({\n tagName: 'input',\n id: cID,\n // name: cID, - prevent saving the value to a form\n type: format === 'hex' ? 'text' : 'number',\n value: c === 'alpha' ? '100' : '0',\n className: `color-input ${c}`,\n autocomplete: 'off',\n spellcheck: false,\n } as Partial) as HTMLInputElement;\n\n // alpha\n let max = '100';\n let step = '1';\n if (c !== 'alpha') {\n if (format === 'rgb') {\n max = '255';\n step = '1';\n } else if (c === 'hue') {\n max = '360';\n step = '1';\n }\n }\n ObjectAssign(cInput, {\n min: '0',\n max,\n step,\n });\n colorForm.append(cInputLabel, cInput);\n });\n return colorForm;\n};\n\nexport default getColorForm;\n","import { createElement } from '@thednp/shorty';\n\nimport ColorPicker from '..';\n\n/**\n * Returns all color controls for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns color controls\n */\nconst getColorControls = (self: ColorPicker): HTMLElement => {\n const { format, componentLabels } = self;\n const { hueLabel, alphaLabel, lightnessLabel, saturationLabel, whitenessLabel, blacknessLabel } = componentLabels;\n\n const max1 = format === 'hsl' ? 360 : 100;\n const max2 = format === 'hsl' ? 100 : 360;\n const max3 = 100;\n\n let ctrl1Label = format === 'hsl' ? `${hueLabel} & ${lightnessLabel}` : `${lightnessLabel} & ${saturationLabel}`;\n\n ctrl1Label = format === 'hwb' ? `${whitenessLabel} & ${blacknessLabel}` : ctrl1Label;\n\n const ctrl2Label = format === 'hsl' ? `${saturationLabel}` : `${hueLabel}`;\n\n const colorControls = createElement({\n tagName: 'div',\n className: `color-controls ${format}`,\n }) as HTMLElement;\n\n const colorPointer = 'color-pointer';\n const colorSlider = 'color-slider';\n\n const controls = [\n {\n i: 1,\n c: colorPointer,\n l: ctrl1Label,\n min: 0,\n max: max1,\n },\n {\n i: 2,\n c: colorSlider,\n l: ctrl2Label,\n min: 0,\n max: max2,\n },\n {\n i: 3,\n c: colorSlider,\n l: alphaLabel,\n min: 0,\n max: max3,\n },\n ];\n\n controls.forEach(template => {\n const { i, c, l, min, max } = template;\n const control = createElement({\n tagName: 'div',\n className: 'color-control',\n role: 'presentation',\n }) as HTMLElement;\n\n control.append(\n createElement({\n tagName: 'div',\n className: `visual-control visual-control${i}`,\n }) as HTMLElement,\n );\n\n const knob = createElement({\n tagName: 'div',\n className: `${c} knob`,\n ariaLive: 'polite',\n ariaLabel: l,\n role: 'slider',\n tabIndex: 0,\n ariaValueMin: `${min}`,\n ariaValueMax: `${max}`,\n }) as HTMLElement;\n\n control.append(knob);\n colorControls.append(control);\n });\n\n return colorControls;\n};\n\nexport default getColorControls;\n","import { setAttribute, getAttribute, createElement, setElementStyle } from '@thednp/shorty';\n\nimport Color from '@thednp/color';\nimport ColorPalette from '../colorPalette';\nimport ColorPicker from '../index';\n\n/**\n * Returns a color-defaults with given values and class.\n */\nconst getColorMenu = (self: ColorPicker, colorsSource: ColorPalette | string[], menuClass: string): HTMLElement => {\n const { input, format, componentLabels } = self;\n const { defaultsLabel, presetsLabel } = componentLabels;\n const isOptionsMenu = menuClass === 'color-options';\n const isPalette = colorsSource instanceof ColorPalette;\n const menuLabel = isOptionsMenu ? presetsLabel : defaultsLabel;\n const colorsArray = isPalette ? colorsSource.colors : colorsSource;\n const colorsCount = colorsArray.length;\n const { lightSteps } = isPalette ? colorsSource : { lightSteps: null };\n const fit = lightSteps || [9, 10].find(x => colorsCount >= x * 2 && !(colorsCount % x)) || 5;\n const isMultiLine = isOptionsMenu && colorsCount > fit;\n let rowCountHover = 2;\n rowCountHover = isMultiLine && colorsCount > fit * 2 ? 3 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 3 ? 4 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 4 ? 5 : rowCountHover;\n const rowCount = rowCountHover - (colorsCount <= fit * 3 ? 1 : 2);\n const isScrollable = isMultiLine && colorsCount > rowCount * fit;\n let finalClass = menuClass;\n finalClass += isScrollable ? ' scrollable' : '';\n finalClass += isMultiLine ? ' multiline' : '';\n const gap = isMultiLine ? '1px' : '0.25rem';\n let optionSize = isMultiLine ? 1.75 : 2;\n optionSize = fit > 5 && isMultiLine ? 1.5 : optionSize;\n const menuHeight = `${rowCount * optionSize}rem`;\n const menuHeightHover = `calc(${rowCountHover} * ${optionSize}rem + ${rowCountHover - 1} * ${gap})`;\n\n //
          is an `HTMLElement`\n const menu = createElement({\n tagName: 'ul',\n className: finalClass,\n role: 'listbox',\n ariaLabel: menuLabel,\n }) as HTMLElement;\n\n if (isScrollable) {\n setElementStyle(menu, {\n '--grid-item-size': `${optionSize}rem`,\n '--grid-fit': `${fit}`,\n '--grid-gap': gap,\n '--grid-height': menuHeight,\n '--grid-hover-height': menuHeightHover,\n });\n }\n\n colorsArray.forEach(x => {\n let [value, label] = typeof x === 'string' ? x.trim().split(':') : [];\n if (x instanceof Color) {\n value = x.toHexString();\n label = value;\n }\n const color = new Color(x instanceof Color ? x : value, format);\n const isActive = color.toString() === getAttribute(input, 'value');\n const active = isActive ? ' active' : '';\n\n const option = createElement({\n tagName: 'li',\n className: `color-option${active}`,\n innerText: `${label || value}`,\n tabIndex: 0,\n role: 'option',\n ariaSelected: isActive ? 'true' : 'false',\n }) as HTMLElement;\n setAttribute(option, 'data-value', `${value}`);\n\n if (isOptionsMenu) {\n setElementStyle(option, { backgroundColor: value });\n }\n\n menu.append(option);\n });\n return menu;\n};\n\nexport default getColorMenu;\n","import {\n getAttribute,\n setAttribute,\n toUpperCase,\n ariaHidden,\n tabindex,\n createElement,\n createElementNS,\n} from '@thednp/shorty';\n\nimport Color from '@thednp/color';\n\nimport getColorForm from './getColorForm';\nimport getColorControls from './getColorControls';\nimport getColorMenu from './getColorMenu';\nimport vHidden from './vHidden';\n\nimport ColorPicker from '../index';\n\n/**\n * Generate HTML markup and update instance properties.\n *\n * @param self\n */\nconst setMarkup = (self: ColorPicker) => {\n const { input, parent, format, id, componentLabels, colorKeywords, colorPresets } = self;\n const colorValue = getAttribute(input, 'value') || '#fff';\n const { nonColors } = Color;\n\n const { toggleLabel, pickerLabel, formatLabel, hexLabel } = componentLabels;\n\n // update color\n const color = nonColors.includes(colorValue) ? '#fff' : colorValue;\n self.color = new Color(color, format);\n\n // set initial controls dimensions\n const formatString = format === 'hex' ? hexLabel : toUpperCase(format);\n\n const pickerBtn = createElement({\n id: `picker-btn-${id}`,\n tagName: 'button',\n type: 'button',\n className: 'picker-toggle btn-appearance',\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLButtonElement;\n\n pickerBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${pickerLabel}. ${formatLabel}: ${formatString}`,\n }) as HTMLElement,\n );\n\n const pickerDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown picker',\n role: 'group',\n ariaLabelledBy: `picker-btn-${id}`,\n } as Partial & { ariaLabelledBy: string }) as HTMLElement;\n\n const colorControls = getColorControls(self);\n const colorForm = getColorForm(self);\n\n pickerDropdown.append(colorControls, colorForm);\n input.before(pickerBtn);\n parent.append(pickerDropdown);\n\n // set colour key menu template\n if (colorKeywords || colorPresets) {\n const presetsDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown scrollable menu',\n }) as HTMLElement;\n\n // color presets\n if (colorPresets) {\n presetsDropdown.append(getColorMenu(self, colorPresets, 'color-options'));\n }\n\n // explicit defaults [reset, initial, inherit, transparent, currentColor]\n // also custom defaults [default: #069, complementary: #930]\n if (colorKeywords && colorKeywords.length) {\n presetsDropdown.append(getColorMenu(self, colorKeywords, 'color-defaults'));\n }\n\n const presetsBtn = createElement({\n tagName: 'button',\n type: 'button',\n className: 'menu-toggle btn-appearance',\n tabIndex: -1,\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLButtonElement;\n\n const xmlns = encodeURI('http://www.w3.org/2000/svg');\n const presetsIcon = createElementNS(xmlns, {\n tagName: 'svg',\n }) as HTMLElement;\n setAttribute(presetsIcon, 'xmlns', xmlns);\n setAttribute(presetsIcon, 'viewBox', '0 0 512 512');\n setAttribute(presetsIcon, ariaHidden, 'true');\n\n const path = createElementNS(xmlns, {\n tagName: 'path',\n }) as HTMLElement;\n setAttribute(path, 'd', 'M98,158l157,156L411,158l27,27L255,368L71,185L98,158z');\n setAttribute(path, 'fill', '#fff');\n presetsIcon.append(path);\n presetsBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${toggleLabel}`,\n }) as HTMLElement,\n presetsIcon,\n );\n\n parent.append(presetsBtn, presetsDropdown);\n }\n\n // solve non-colors after settings save\n if (colorKeywords && nonColors.includes(colorValue)) {\n self.value = colorValue;\n }\n setAttribute(input, tabindex, '-1');\n};\n\nexport default setMarkup;\n","import {\n ariaDescription,\n ariaSelected,\n ariaValueNow,\n ariaValueText,\n ariaExpanded,\n keyArrowDown,\n keyArrowUp,\n keyArrowLeft,\n keyArrowRight,\n keyEnter,\n keySpace,\n keyEscape,\n focusinEvent,\n mouseclickEvent,\n keydownEvent,\n changeEvent,\n touchmoveEvent,\n pointerdownEvent,\n pointermoveEvent,\n pointerupEvent,\n tabindex,\n focusoutEvent,\n resizeEvent,\n keyupEvent,\n scrollEvent,\n dispatchEvent,\n getElementsByClassName,\n closest,\n querySelector,\n getElementTransitionDuration,\n getBoundingClientRect,\n getUID,\n getElementStyle,\n getDocumentElement,\n getDocument,\n ObjectAssign,\n ObjectFromEntries,\n Data,\n getInstance,\n setElementStyle,\n normalizeOptions,\n reflow,\n focus,\n hasClass,\n addClass,\n removeClass,\n setAttribute,\n getAttribute,\n removeAttribute,\n isArray,\n isString,\n getWindow,\n on,\n off,\n} from '@thednp/shorty';\n\n// ColorPicker Util\n// ================\nimport Color from '@thednp/color';\nimport type { RGBA, HWBA, HSLA, HSVA } from '@thednp/color';\n\nimport ColorPalette from './colorPalette';\nimport colorPickerLabels from './util/colorPickerLabels';\nimport colorNames from './util/colorNames';\nimport isValidJSON from './util/isValidJSON';\nimport setMarkup from './util/setMarkup';\n\nimport ColorPickerOptions from './interface/colorPickerOptions';\nimport ColorPickerLabels from './interface/colorPickerLabels';\nimport type ColorNames from './interface/ColorNames';\nimport { version } from '../../package.json';\n\n// ColorPicker GC\n// ==============\nconst colorPickerString = 'color-picker';\nconst colorPickerSelector = `[data-function=\"${colorPickerString}\"]`;\nconst colorPickerParentSelector = `.${colorPickerString}`;\nconst colorPickerDefaults: ColorPickerOptions = {\n componentLabels: colorPickerLabels,\n colorLabels: colorNames,\n format: 'rgb',\n colorPresets: false,\n colorKeywords: false,\n};\nconst { roundPart, nonColors } = Color;\n\n// ColorPicker Static Methods\n// ==========================\nconst getColorPickerInstance = (element: HTMLInputElement) => getInstance(element, colorPickerString);\nconst initColorPicker = (element: HTMLInputElement) => new ColorPicker(element);\n\n// ColorPicker Private Methods\n// ===========================\n\n/**\n * Add / remove `ColorPicker` main event listeners.\n */\nconst toggleEvents = (self: ColorPicker, action?: boolean) => {\n const fn = action ? on : off;\n const { input, pickerToggle, menuToggle } = self;\n\n fn(input, focusinEvent, self.showPicker);\n fn(pickerToggle, mouseclickEvent, self.togglePicker);\n\n if (menuToggle) {\n fn(menuToggle, mouseclickEvent, self.toggleMenu);\n }\n};\n\n/**\n * Add / remove `ColorPicker` event listeners active only when open.\n */\nconst toggleEventsOnShown = (self: ColorPicker, action?: boolean) => {\n const fn = action ? on : off;\n const { input, colorMenu, parent } = self;\n const doc = getDocument(input);\n const win = getWindow(doc);\n\n fn(self.controls, pointerdownEvent, self.pointerDown as EventListener);\n self.controlKnobs.forEach(x => fn(x, keydownEvent, self.handleKnobs as EventListener));\n\n fn(win, scrollEvent, self.handleScroll);\n fn(win, resizeEvent, self.update);\n\n [input, ...self.inputs].forEach(x => fn(x, changeEvent, self.changeHandler));\n\n if (colorMenu) {\n fn(colorMenu, mouseclickEvent, self.menuClickHandler);\n fn(colorMenu, keydownEvent, self.menuKeyHandler as EventListener);\n }\n\n fn(doc, pointermoveEvent, self.pointerMove as EventListener);\n fn(doc, pointerupEvent, self.pointerUp as EventListener);\n fn(parent, focusoutEvent, self.handleFocusOut as EventListener);\n fn(doc, keyupEvent, self.handleDismiss as EventListener);\n};\n\n/**\n * Triggers the `ColorPicker` original event.\n */\nconst firePickerChange = (self: ColorPicker) => {\n dispatchEvent(self.input, new CustomEvent('colorpicker.change'));\n};\n\n/**\n * Hides a visible dropdown.\n */\nconst removePosition = (element: HTMLElement) => {\n /* istanbul ignore else */\n if (element) {\n ['bottom', 'top'].forEach(x => removeClass(element, x));\n }\n};\n\n/**\n * Shows a `ColorPicker` dropdown and close the curent open dropdown.\n */\nconst showDropdown = (self: ColorPicker, dropdown: HTMLElement) => {\n const { colorPicker, colorMenu, menuToggle, pickerToggle, parent } = self;\n const isPicker = dropdown === colorPicker;\n const openDropdown = isPicker ? colorMenu : colorPicker;\n const activeBtn = isPicker ? menuToggle : pickerToggle;\n const nextBtn = !isPicker ? menuToggle : pickerToggle;\n\n if (!hasClass(parent, 'open')) {\n addClass(parent, 'open');\n }\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n removePosition(openDropdown);\n }\n addClass(dropdown, 'bottom');\n reflow(dropdown);\n addClass(dropdown, 'show');\n\n if (isPicker) self.update();\n\n if (!self.isOpen) {\n toggleEventsOnShown(self, true);\n self.updateDropdownPosition();\n self.isOpen = true;\n setAttribute(self.input, tabindex, '0');\n if (menuToggle) {\n setAttribute(menuToggle, tabindex, '0');\n }\n }\n\n setAttribute(nextBtn, ariaExpanded, 'true');\n if (activeBtn) {\n setAttribute(activeBtn, ariaExpanded, 'false');\n }\n};\n\n/**\n * Color Picker Web Component\n *\n * @see http://thednp.github.io/color-picker\n */\nexport default class ColorPicker {\n // bring utils to staic\n public static Color = Color;\n public static ColorPalette = ColorPalette;\n public static getInstance = getColorPickerInstance;\n public static init = initColorPicker;\n public static selector = colorPickerSelector;\n // utils important for render\n public static roundPart = roundPart;\n public static setElementStyle = setElementStyle;\n public static setAttribute = setAttribute;\n public static getBoundingClientRect = getBoundingClientRect;\n public static version = version;\n public static colorNames = colorNames;\n public static colorPickerLabels = colorPickerLabels;\n\n id: number;\n input: HTMLInputElement;\n color: Color;\n format = 'rgb';\n parent: HTMLElement;\n dragElement: HTMLElement | undefined;\n isOpen = false;\n controlPositions: {\n c1x: number;\n c1y: number;\n c2y: number;\n c3y: number;\n };\n colorLabels: ColorNames = ObjectFromEntries(colorNames.map(c => [c, c])) as ColorNames;\n colorKeywords: string[] | false;\n colorPresets: ColorPalette | string[] | false;\n componentLabels: ColorPickerLabels;\n pickerToggle: HTMLElement;\n menuToggle: HTMLElement;\n colorPicker: HTMLElement;\n colorMenu: HTMLElement;\n controls: HTMLElement;\n inputs: HTMLInputElement[];\n controlKnobs: HTMLElement[];\n visuals: HTMLElement[];\n\n /**\n * Returns a new `ColorPicker` instance. The target of this constructor\n * must be an `HTMLInputElement`.\n *\n * @param target the target `` element\n * @param config instance options\n */\n constructor(target: (HTMLElement & HTMLInputElement) | string, config?: Partial) {\n const input = querySelector(target) as HTMLInputElement;\n\n // invalidate\n if (typeof target === 'undefined') throw new TypeError(`ColorPicker target not specified.`);\n if (isString(target) && !input) throw new TypeError(`ColorPicker target \"${target}\" cannot be found.`);\n this.input = input;\n\n const parent = closest(input, colorPickerParentSelector);\n if (!parent) throw new TypeError('ColorPicker requires a specific markup to work.');\n\n this.parent = parent;\n this.id = getUID(input, colorPickerString);\n this.dragElement = undefined;\n this.isOpen = false;\n this.controlPositions = {\n c1x: 0,\n c1y: 0,\n c2y: 0,\n c3y: 0,\n };\n // this.colorLabels = {};\n this.colorKeywords = false;\n this.colorPresets = false;\n\n // process options\n const { format, componentLabels, colorLabels, colorKeywords, colorPresets } = normalizeOptions(\n input,\n colorPickerDefaults,\n config || {},\n );\n\n let translatedColorLabels = colorNames;\n /* istanbul ignore else */\n if (isArray(colorLabels) && colorLabels.length === 17) {\n translatedColorLabels = colorLabels;\n } else if (isString(colorLabels) && colorLabels.split(',').length === 17) {\n translatedColorLabels = colorLabels.split(',');\n }\n\n // expose colour labels to all methods\n ObjectAssign(this.colorLabels, ObjectFromEntries(translatedColorLabels.map((c, i) => [colorNames[i], c])));\n\n // update and expose component labels\n const tempComponentLabels =\n isString(componentLabels) && isValidJSON(componentLabels)\n ? (JSON.parse(componentLabels) as ColorPickerLabels)\n : componentLabels;\n this.componentLabels = ObjectAssign({ ...colorPickerLabels }, tempComponentLabels);\n this.color = new Color(input.value || '#fff', format);\n this.format = format;\n\n // set colour defaults\n if (isArray(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords;\n } else if (isString(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords.split(',').map(x => x.trim());\n }\n\n // set colour presets\n if (isArray(colorPresets) && colorPresets.length) {\n this.colorPresets = colorPresets;\n } else if (colorPresets && isValidJSON(colorPresets)) {\n const { hue, hueSteps, lightSteps, saturation } = JSON.parse(colorPresets) as {\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n };\n this.colorPresets = new ColorPalette(hue, hueSteps, lightSteps, saturation);\n } else if (isString(colorPresets)) {\n this.colorPresets = colorPresets.split(',').map((x: string) => x.trim());\n }\n\n // generate markup\n setMarkup(this);\n\n const [colorPicker, colorMenu] = getElementsByClassName('color-dropdown', parent);\n // set main elements\n this.pickerToggle = querySelector('.picker-toggle', parent) as HTMLElement;\n this.menuToggle = querySelector('.menu-toggle', parent) as HTMLElement;\n this.colorPicker = colorPicker;\n this.colorMenu = colorMenu;\n this.inputs = [...getElementsByClassName('color-input', parent)] as HTMLInputElement[];\n const [controls] = getElementsByClassName('color-controls', parent);\n this.controls = controls;\n this.controlKnobs = [...getElementsByClassName('knob', controls)];\n this.visuals = [...getElementsByClassName('visual-control', controls)];\n\n // update colour picker controls, inputs and visuals\n this.update();\n // console.log(this)\n\n // add main events listeners\n toggleEvents(this, true);\n\n // set component data\n Data.set(input, colorPickerString, this);\n }\n\n /** Returns the current colour value */\n get value(): string {\n return this.input.value;\n }\n\n /**\n * Sets a new colour value.\n *\n * @param {string} v new colour value\n */\n set value(v: string) {\n this.input.value = v;\n }\n\n /** Check if the colour presets include any non-colour. */\n get hasNonColor(): boolean {\n return this.colorKeywords instanceof Array && this.colorKeywords.some(x => nonColors.includes(x));\n }\n\n /** Returns hexadecimal value of the current colour. */\n get hex(): string {\n return this.color.toHex(true);\n }\n\n /** Returns the current colour value in {h,s,v,a} object format. */\n get hsv(): HSVA {\n return this.color.toHsv();\n }\n\n /** Returns the current colour value in {h,s,l,a} object format. */\n get hsl(): HSLA {\n return this.color.toHsl();\n }\n\n /** Returns the current colour value in {h,w,b,a} object format. */\n get hwb(): HWBA {\n return this.color.toHwb();\n }\n\n /** Returns the current colour value in {r,g,b,a} object format. */\n get rgb(): RGBA {\n return this.color.toRgb();\n }\n\n /** Returns the current colour brightness. */\n get brightness(): number {\n return this.color.brightness;\n }\n\n /** Returns the current colour luminance. */\n get luminance(): number {\n return this.color.luminance;\n }\n\n /** Checks if the current colour requires a light text colour. */\n get isDark(): boolean {\n const { color, brightness } = this;\n return brightness < 120 && color.a > 0.33;\n }\n\n /** Checks if the current input value is a valid colour. */\n get isValid(): boolean {\n const inputValue = this.input.value;\n return inputValue !== '' && new Color(inputValue).isValid;\n }\n\n /** Returns the colour appearance, usually the closest colour name for the current value. */\n get appearance(): string {\n const { colorLabels, hsl, hsv, format } = this;\n\n const hue = roundPart(hsl.h * 360);\n const saturationSource = format === 'hsl' ? hsl.s : hsv.s;\n const saturation = roundPart(saturationSource * 100);\n const lightness = roundPart(hsl.l * 100);\n const hsvl = hsv.v * 100;\n\n let colorName = 'black';\n\n // determine color appearance\n /* istanbul ignore else */\n if (lightness === 100 && saturation === 0) {\n colorName = colorLabels.white;\n } else if (lightness === 0) {\n colorName = colorLabels.black;\n } else if (saturation === 0) {\n colorName = colorLabels.grey;\n } else if (hue < 15 || hue >= 345) {\n colorName = colorLabels.red;\n } else if (hue >= 15 && hue < 45) {\n colorName = hsvl > 80 && saturation > 80 ? colorLabels.orange : colorLabels.brown;\n } else if (hue >= 45 && hue < 75) {\n const isGold = hue > 46 && hue < 54 && hsvl < 80 && saturation > 90;\n const isOlive = hue >= 54 && hue < 75 && hsvl < 80;\n colorName = isGold ? colorLabels.gold : colorLabels.yellow;\n colorName = isOlive ? colorLabels.olive : colorName;\n } else if (hue >= 75 && hue < 155) {\n colorName = hsvl < 68 ? colorLabels.green : colorLabels.lime;\n } else if (hue >= 155 && hue < 175) {\n colorName = colorLabels.teal;\n } else if (hue >= 175 && hue < 195) {\n colorName = colorLabels.cyan;\n } else if (hue >= 195 && hue < 255) {\n colorName = colorLabels.blue;\n } else if (hue >= 255 && hue < 270) {\n colorName = colorLabels.violet;\n } else if (hue >= 270 && hue < 295) {\n colorName = colorLabels.magenta;\n } else if (hue >= 295 && hue < 345) {\n colorName = colorLabels.pink;\n }\n return colorName;\n }\n\n /** Updates `ColorPicker` visuals. */\n updateVisuals(): void {\n const { controlPositions, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { offsetHeight } = v1;\n const hue = controlPositions.c2y / offsetHeight;\n const { r, g, b } = new Color({ h: hue, s: 1, l: 0.5 }).toRgb();\n const whiteGrad = 'linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)';\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n const roundA = roundPart(alpha * 100) / 100;\n\n const fill = new Color({\n h: hue,\n s: 1,\n l: 0.5,\n a: alpha,\n }).toRgbString();\n const hueGradient = `linear-gradient(\n rgb(255,0,0) 0%, rgb(255,255,0) 16.67%,\n rgb(0,255,0) 33.33%, rgb(0,255,255) 50%,\n rgb(0,0,255) 66.67%, rgb(255,0,255) 83.33%,\n rgb(255,0,0) 100%)`;\n setElementStyle(v1, {\n background: `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,${roundA}) 100%),\n linear-gradient(to right, rgba(255,255,255,${roundA}) 0%, ${fill} 100%),\n ${whiteGrad}`,\n });\n setElementStyle(v2, { background: hueGradient });\n\n setElementStyle(v3, {\n background: `linear-gradient(rgba(${r},${g},${b},1) 0%,rgba(${r},${g},${b},0) 100%)`,\n });\n }\n\n /**\n * The `ColorPicker` *focusout* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleFocusOut = ({ relatedTarget }: FocusEvent & { relatedTarget: HTMLElement }): void => {\n if (relatedTarget && !this.parent.contains(relatedTarget)) {\n this.hide(true);\n }\n };\n\n /**\n * The `ColorPicker` *keyup* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleDismiss = ({ code }: KeyboardEvent): void => {\n if (this.isOpen && code === keyEscape) {\n this.hide();\n }\n };\n\n /**\n * The `ColorPicker` *scroll* event listener when open.\n *\n * @param e\n */\n handleScroll = (e: Event) => {\n const { activeElement } = getDocument(this.input);\n\n this.updateDropdownPosition();\n\n /* istanbul ignore next */\n if (\n ([pointermoveEvent, touchmoveEvent].includes(e.type) && this.dragElement) ||\n (activeElement && this.controlKnobs.includes(activeElement as HTMLElement))\n ) {\n e.stopPropagation();\n e.preventDefault();\n }\n };\n\n /**\n * The `ColorPicker` keyboard event listener for menu navigation.\n *\n * @param e\n */\n menuKeyHandler = (e: KeyboardEvent & { target: HTMLElement }) => {\n const { target, code } = e;\n const { previousElementSibling, nextElementSibling, parentElement } = target;\n const isColorOptionsMenu = parentElement && hasClass(parentElement, 'color-options');\n const allSiblings = parentElement ? [...parentElement.children] : [];\n const columnsCount =\n isColorOptionsMenu && getElementStyle(parentElement, 'grid-template-columns').split(' ').length;\n const currentIndex = allSiblings.indexOf(target);\n const previousElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex - columnsCount];\n const nextElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex + columnsCount];\n\n if ([keyArrowDown, keyArrowUp, keySpace].includes(code)) {\n // prevent scroll when navigating the menu via arrow keys / Space\n e.preventDefault();\n }\n if (isColorOptionsMenu) {\n if (previousElement && code === keyArrowUp) {\n focus(previousElement as HTMLElement);\n } else if (nextElement && code === keyArrowDown) {\n focus(nextElement as HTMLElement);\n } else if (previousElementSibling && code === keyArrowLeft) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && code === keyArrowRight) {\n focus(nextElementSibling as HTMLElement);\n }\n } else if (previousElementSibling && [keyArrowLeft, keyArrowUp].includes(code)) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && [keyArrowRight, keyArrowDown].includes(code)) {\n focus(nextElementSibling as HTMLElement);\n }\n\n if ([keyEnter, keySpace].includes(code)) {\n this.menuClickHandler(e);\n }\n };\n\n /**\n * The `ColorPicker` click event listener for the colour menu presets / defaults.\n *\n * @param e\n * @this {ColorPicker}\n */\n menuClickHandler = (e: Event) => {\n const { target } = e;\n const { colorMenu } = this;\n const newOption = (getAttribute(target as HTMLElement, 'data-value') || '').trim();\n // invalidate for targets other than color options\n if (!newOption.length) return;\n const currentActive = querySelector('li.active', colorMenu);\n let newColor = newOption;\n newColor = nonColors.includes(newColor) ? 'white' : newColor;\n newColor = newColor === 'transparent' ? 'rgba(0,0,0,0)' : newColor;\n\n const { r, g, b, a } = new Color(newColor);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n this.update();\n\n /* istanbul ignore else */\n if (currentActive !== target) {\n /* istanbul ignore else */\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n\n addClass(target as HTMLElement, 'active');\n setAttribute(target as HTMLElement, ariaSelected, 'true');\n\n if (nonColors.includes(newOption)) {\n this.value = newOption;\n }\n firePickerChange(this);\n }\n };\n\n /**\n * The `ColorPicker` *touchstart* / *mousedown* events listener for control knobs.\n *\n * @param e\n */\n pointerDown = (e: PointerEvent & { target: HTMLElement }) => {\n if (e.button !== 0) return;\n const { target, pageX, pageY } = e;\n const { colorMenu, visuals, controlKnobs } = this;\n const [v1, v2, v3] = visuals;\n const [c1, c2, c3] = controlKnobs;\n const visual = controlKnobs.includes(target) ? (target.previousElementSibling as HTMLElement) : target;\n const visualRect = getBoundingClientRect(visual);\n const html = getDocumentElement(v1);\n const offsetX = pageX - html.scrollLeft - visualRect.left;\n const offsetY = pageY - html.scrollTop - visualRect.top;\n\n /* istanbul ignore else */\n if (target === v1 || target === c1) {\n this.dragElement = visual;\n this.changeControl1(offsetX, offsetY);\n } else if (target === v2 || target === c2) {\n this.dragElement = visual;\n this.changeControl2(offsetY);\n } else if (target === v3 || target === c3) {\n this.dragElement = visual;\n this.changeAlpha(offsetY);\n }\n\n if (colorMenu) {\n const currentActive = querySelector('li.active', colorMenu);\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n }\n e.preventDefault();\n };\n\n /**\n * The `ColorPicker` *touchend* / *mouseup* events listener for control knobs.\n *\n * @param e\n * @this\n */\n pointerUp = ({ target }: PointerEvent & { target: HTMLElement }) => {\n const { parent } = this;\n const doc = getDocument(parent);\n const currentOpen = querySelector(`${colorPickerParentSelector}.open`, doc) !== null;\n const selection = doc.getSelection();\n\n if (!this.dragElement && (!selection || !selection.toString().length) && !parent.contains(target)) {\n this.hide(currentOpen);\n }\n\n this.dragElement = undefined;\n };\n\n /**\n * The `ColorPicker` *touchmove* / *mousemove* events listener for control knobs.\n *\n * @param {PointerEvent} e\n */\n pointerMove = (e: PointerEvent) => {\n const { dragElement, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { pageX, pageY } = e;\n\n if (!dragElement) return;\n\n const controlRect = getBoundingClientRect(dragElement);\n const win = getDocumentElement(v1);\n const offsetX = pageX - win.scrollLeft - controlRect.left;\n const offsetY = pageY - win.scrollTop - controlRect.top;\n\n if (dragElement === v1) {\n this.changeControl1(offsetX, offsetY);\n }\n\n if (dragElement === v2) {\n this.changeControl2(offsetY);\n }\n\n if (dragElement === v3) {\n this.changeAlpha(offsetY);\n }\n };\n\n /**\n * The `ColorPicker` *keydown* event listener for control knobs.\n *\n * @param e\n */\n handleKnobs = (e: Event & { code: string }) => {\n const { target, code } = e;\n\n // only react to arrow buttons\n if (![keyArrowUp, keyArrowDown, keyArrowLeft, keyArrowRight].includes(code)) return;\n e.preventDefault();\n\n const { controlKnobs, visuals } = this;\n const { offsetWidth, offsetHeight } = visuals[0];\n const [c1, c2, c3] = controlKnobs;\n const { activeElement } = getDocument(c1);\n const currentKnob = controlKnobs.find(x => x === activeElement);\n const yRatio = offsetHeight / 360;\n\n /* istanbul ignore else */\n if (currentKnob) {\n let offsetX = 0;\n let offsetY = 0;\n\n /* istanbul ignore else */\n if (target === c1) {\n const xRatio = offsetWidth / 100;\n\n /* istanbul ignore else */\n if ([keyArrowLeft, keyArrowRight].includes(code)) {\n this.controlPositions.c1x += code === keyArrowRight ? xRatio : -xRatio;\n } else if ([keyArrowUp, keyArrowDown].includes(code)) {\n this.controlPositions.c1y += code === keyArrowDown ? yRatio : -yRatio;\n }\n\n offsetX = this.controlPositions.c1x;\n offsetY = this.controlPositions.c1y;\n this.changeControl1(offsetX, offsetY);\n } else if (target === c2) {\n this.controlPositions.c2y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c2y;\n this.changeControl2(offsetY);\n } else if (target === c3) {\n this.controlPositions.c3y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c3y;\n this.changeAlpha(offsetY);\n }\n this.handleScroll(e);\n }\n };\n\n /** The event listener of the colour form inputs. */\n changeHandler = (): void => {\n let colorSource;\n const { inputs, format, value: currentValue, input, controlPositions, visuals } = this;\n const { activeElement } = getDocument(input);\n const { offsetHeight } = visuals[0];\n const [i1, , , i4] = inputs;\n const [v1, v2, v3, v4] =\n format === 'rgb'\n ? inputs.map(i => parseFloat(i.value) / (i === i4 ? 100 : 1))\n : inputs.map(i => parseFloat(i.value) / (i !== i1 ? 100 : 360));\n const isNonColorValue = this.hasNonColor && nonColors.includes(currentValue);\n const alpha = i4 ? v4 : 1 - controlPositions.c3y / offsetHeight;\n\n /* istanbul ignore else */\n if (activeElement === input || (activeElement && inputs.includes(activeElement as HTMLInputElement))) {\n if (activeElement === input) {\n if (isNonColorValue) {\n colorSource = currentValue === 'transparent' ? 'rgba(0,0,0,0)' : 'rgb(0,0,0)';\n } else {\n colorSource = currentValue;\n }\n } else if (format === 'hex') {\n colorSource = i1.value;\n } else if (format === 'hsl') {\n colorSource = {\n h: v1,\n s: v2,\n l: v3,\n a: alpha,\n };\n } else if (format === 'hwb') {\n colorSource = {\n h: v1,\n w: v2,\n b: v3,\n a: alpha,\n };\n } else {\n colorSource = {\n r: v1,\n g: v2,\n b: v3,\n a: alpha,\n };\n }\n\n const { r, g, b, a } = new Color(colorSource);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n this.setControlPositions();\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n\n // set non-color keyword\n if (activeElement === input && isNonColorValue) {\n this.value = currentValue;\n }\n }\n };\n\n /**\n * Updates `ColorPicker` first control:\n * * `lightness` and `saturation` for HEX/RGB;\n * * `lightness` and `hue` for HSL.\n *\n * @param X the X component of the offset\n * @param Y the Y component of the offset\n */\n changeControl1(X: number, Y: number): void {\n let [offsetX, offsetY] = [0, 0];\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n if (X > offsetWidth) offsetX = offsetWidth;\n else if (X >= 0) offsetX = X;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = controlPositions.c2y / offsetHeight;\n\n const saturation = offsetX / offsetWidth;\n\n const lightness = 1 - offsetY / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new positions\n this.controlPositions.c1x = offsetX;\n this.controlPositions.c1y = offsetY;\n\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` second control:\n * * `hue` for HEX/RGB/HWB;\n * * `saturation` for HSL.\n *\n * @param Y the Y offset\n */\n changeControl2(Y: number) {\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = offsetY / offsetHeight;\n const saturation = controlPositions.c1x / offsetWidth;\n const lightness = 1 - controlPositions.c1y / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new position\n this.controlPositions.c2y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` last control,\n * the `alpha` channel.\n *\n * @param Y\n */\n changeAlpha(Y: number) {\n const { visuals } = this;\n const { offsetHeight } = visuals[0];\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n // update color alpha\n const alpha = 1 - offsetY / offsetHeight;\n this.color.setAlpha(alpha);\n // update position\n this.controlPositions.c3y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` control positions on:\n * * initialization\n * * window resize\n */\n update = () => {\n this.updateDropdownPosition();\n this.updateAppearance();\n this.setControlPositions();\n this.updateInputs(true);\n this.updateControls();\n this.updateVisuals();\n };\n\n /** Updates the open dropdown position on *scroll* event. */\n updateDropdownPosition() {\n const { input, colorPicker, colorMenu } = this;\n const elRect = getBoundingClientRect(input);\n const { top, bottom } = elRect;\n const { offsetHeight: elHeight } = input;\n const windowHeight = getDocumentElement(input).clientHeight;\n const isPicker = hasClass(colorPicker, 'show');\n const dropdown = isPicker ? colorPicker : colorMenu;\n if (!dropdown) return;\n const { offsetHeight: dropHeight } = dropdown;\n const distanceBottom = windowHeight - bottom;\n const distanceTop = top;\n const bottomExceed = top + dropHeight + elHeight > windowHeight; // show\n const topExceed = top - dropHeight < 0; // show-top\n\n if ((hasClass(dropdown, 'bottom') || !topExceed) && distanceBottom < distanceTop && bottomExceed) {\n removeClass(dropdown, 'bottom');\n addClass(dropdown, 'top');\n } else {\n removeClass(dropdown, 'top');\n addClass(dropdown, 'bottom');\n }\n }\n\n /** Updates control knobs' positions. */\n setControlPositions() {\n const { visuals, color, hsv } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n const alpha = color.a;\n const hue = hsv.h;\n\n const saturation = hsv.s;\n const lightness = hsv.v;\n\n this.controlPositions.c1x = saturation * offsetWidth;\n this.controlPositions.c1y = (1 - lightness) * offsetHeight;\n this.controlPositions.c2y = hue * offsetHeight;\n this.controlPositions.c3y = (1 - alpha) * offsetHeight;\n }\n\n /** Update the visual appearance label and control knob labels. */\n updateAppearance() {\n const { componentLabels, color, parent, hsv, hex, format, controlKnobs } = this;\n const { appearanceLabel, hexLabel, valueLabel } = componentLabels;\n let { r, g, b } = color.toRgb();\n const [knob1, knob2, knob3] = controlKnobs;\n const hue = roundPart(hsv.h * 360);\n const alpha = color.a;\n const saturation = roundPart(hsv.s * 100);\n const lightness = roundPart(hsv.v * 100);\n const colorName = this.appearance;\n\n let colorLabel = `${hexLabel} ${hex.split('').join(' ')}`;\n\n if (format === 'hwb') {\n const { hwb } = this;\n const whiteness = roundPart(hwb.w * 100);\n const blackness = roundPart(hwb.b * 100);\n colorLabel = `HWB: ${hue}°, ${whiteness}%, ${blackness}%`;\n setAttribute(knob1, ariaValueText, `${whiteness}% & ${blackness}%`);\n setAttribute(knob1, ariaValueNow, `${whiteness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}%`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n } else {\n [r, g, b] = [r, g, b].map(roundPart);\n colorLabel = format === 'hsl' ? `HSL: ${hue}°, ${saturation}%, ${lightness}%` : colorLabel;\n colorLabel = format === 'rgb' ? `RGB: ${r}, ${g}, ${b}` : colorLabel;\n\n setAttribute(knob1, ariaValueText, `${lightness}% & ${saturation}%`);\n setAttribute(knob1, ariaValueNow, `${lightness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}°`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n }\n\n const alphaValue = roundPart(alpha * 100);\n setAttribute(knob3, ariaValueText, `${alphaValue}%`);\n setAttribute(knob3, ariaValueNow, `${alphaValue}`);\n\n // update the input backgroundColor\n const newColor = color.toString();\n setElementStyle(this.input, { backgroundColor: newColor });\n\n // toggle dark/light classes will also style the placeholder\n // dark sets color white, light sets color black\n // isDark ? '#000' : '#fff'\n if (!this.isDark) {\n if (hasClass(parent, 'txt-dark')) removeClass(parent, 'txt-dark');\n if (!hasClass(parent, 'txt-light')) addClass(parent, 'txt-light');\n } else {\n if (hasClass(parent, 'txt-light')) removeClass(parent, 'txt-light');\n if (!hasClass(parent, 'txt-dark')) addClass(parent, 'txt-dark');\n }\n }\n\n /** Updates the control knobs actual positions. */\n updateControls() {\n const { controlKnobs, controlPositions } = this;\n let { c1x, c1y, c2y, c3y } = controlPositions;\n const [control1, control2, control3] = controlKnobs;\n // round control positions\n [c1x, c1y, c2y, c3y] = [c1x, c1y, c2y, c3y].map(roundPart);\n\n setElementStyle(control1, {\n transform: `translate3d(${c1x - 4}px,${c1y - 4}px,0)`,\n });\n setElementStyle(control2, { transform: `translate3d(0,${c2y - 4}px,0)` });\n setElementStyle(control3, { transform: `translate3d(0,${c3y - 4}px,0)` });\n }\n\n /**\n * Updates all color form inputs.\n *\n * @param isPrevented when `true`, the component original event is prevented\n */\n updateInputs(isPrevented?: boolean) {\n const { value: oldColor, format, inputs, color, hsl } = this;\n const [i1, i2, i3, i4] = inputs;\n const alpha = roundPart(color.a * 100);\n const hue = roundPart(hsl.h * 360);\n let newColor = color.toString();\n\n /* istanbul ignore else */\n if (format === 'hex') {\n newColor = this.color.toHexString(true);\n i1.value = this.hex;\n } else if (format === 'hsl') {\n const lightness = roundPart(hsl.l * 100);\n const saturation = roundPart(hsl.s * 100);\n newColor = this.color.toHslString();\n i1.value = `${hue}`;\n i2.value = `${saturation}`;\n i3.value = `${lightness}`;\n i4.value = `${alpha}`;\n } else if (format === 'hwb') {\n const { w, b } = this.hwb;\n const whiteness = roundPart(w * 100);\n const blackness = roundPart(b * 100);\n\n newColor = this.color.toHwbString();\n i1.value = `${hue}`;\n i2.value = `${whiteness}`;\n i3.value = `${blackness}`;\n i4.value = `${alpha}`;\n } else if (format === 'rgb') {\n let { r, g, b } = this.rgb;\n [r, g, b] = [r, g, b].map(roundPart);\n\n newColor = this.color.toRgbString();\n i1.value = `${r}`;\n i2.value = `${g}`;\n i3.value = `${b}`;\n i4.value = `${alpha}`;\n }\n\n // update the color value\n this.value = newColor;\n\n // don't trigger the custom event unless it's really changed\n if (!isPrevented && newColor !== oldColor) {\n firePickerChange(this);\n }\n }\n\n /**\n * Toggle the `ColorPicker` dropdown visibility.\n *\n * @param e\n */\n togglePicker = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorPicker } = this;\n\n if (this.isOpen && hasClass(colorPicker, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorPicker);\n }\n };\n\n /** Shows the `ColorPicker` dropdown. */\n showPicker = () => {\n const { colorPicker } = this;\n\n if (!['top', 'bottom'].some(c => hasClass(colorPicker, c))) {\n showDropdown(this, colorPicker);\n }\n };\n\n /**\n * Toggles the visibility of the `ColorPicker` presets menu.\n *\n * @param e\n * @this {ColorPicker}\n */\n toggleMenu = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorMenu } = this;\n\n if (this.isOpen && hasClass(colorMenu, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorMenu);\n }\n };\n\n /**\n * Hides the currently open `ColorPicker` dropdown.\n *\n * @param {boolean=} focusPrevented\n */\n hide(focusPrevented?: boolean) {\n if (this.isOpen) {\n const { pickerToggle, menuToggle, colorPicker, colorMenu, parent, input } = this;\n const openPicker = hasClass(colorPicker, 'show');\n const openDropdown = openPicker ? colorPicker : colorMenu;\n const relatedBtn = openPicker ? pickerToggle : menuToggle;\n const animationDuration = openDropdown && getElementTransitionDuration(openDropdown);\n\n this.value = this.color.toString(true);\n\n /* istanbul ignore else */\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n setAttribute(relatedBtn, ariaExpanded, 'false');\n setTimeout(() => {\n removePosition(openDropdown);\n /* istanbul ignore else */\n if (!querySelector('.show', parent)) {\n removeClass(parent, 'open');\n toggleEventsOnShown(this);\n this.isOpen = false;\n }\n }, animationDuration);\n }\n\n if (!focusPrevented) {\n focus(pickerToggle);\n }\n setAttribute(input, tabindex, '-1');\n if (relatedBtn === menuToggle) {\n setAttribute(menuToggle, tabindex, '-1');\n }\n }\n }\n\n /** Removes `ColorPicker` from target ``. */\n dispose() {\n const { input, parent } = this;\n this.hide(true);\n toggleEvents(this);\n [...parent.children].forEach(el => {\n if (el !== input) el.remove();\n });\n\n removeAttribute(input, tabindex);\n setElementStyle(input, { backgroundColor: '' });\n\n ['txt-light', 'txt-dark'].forEach(c => removeClass(parent, c));\n Data.remove(input, colorPickerString);\n }\n}\n"],"names":["me","ge","Ee","Ae","ke","Me","K","P","_","tt","st","rt","it","St","kt","Mt","Ct","zt","Bt","Re","Qe","je","qe","Ye","$e","sn","Rt","U","fn","jt","A","qt","S","z","t","x","N","Gt","e","n","o","s","Jt","Kt","r","Xt","Yt","Tn","Cn","Ln","In","zn","v","i","u","E","L","Hn","k","W","R","d","M","Zt","$t","Q","g","ne","Qn","V","w","oe","jn","a","l","p","m","y","j","Kn","Zn","$n","I","to","h","T","B","H","b","ae","ro","ie","le","So","To","D","F","rr","tr","O","er","$","f","Z","c","J","G","X","C","Y","q","sr","ColorPalette","Color","args","hue","hueSteps","lightSteps","lightnessArray","saturation","colors","hueStep","half","steps1To13","lightSets","closestSet","set","lightStep","currentHue","newColor","colorPickerLabels","colorNames","isValidJSON","str","isString","vHidden","getColorForm","self","format","id","componentLabels","colorForm","createElement","components","toUpperCase","cID","formatLabel","cInputLabel","setAttribute","cInput","max","step","ObjectAssign","getColorControls","hueLabel","alphaLabel","lightnessLabel","saturationLabel","whitenessLabel","blacknessLabel","max1","max2","max3","ctrl1Label","ctrl2Label","colorControls","colorPointer","colorSlider","template","min","control","knob","getColorMenu","colorsSource","menuClass","input","defaultsLabel","presetsLabel","isOptionsMenu","isPalette","menuLabel","colorsArray","colorsCount","fit","isMultiLine","rowCountHover","rowCount","isScrollable","finalClass","gap","optionSize","menuHeight","menuHeightHover","menu","setElementStyle","value","label","isActive","getAttribute","option","setMarkup","parent","colorKeywords","colorPresets","colorValue","nonColors","toggleLabel","pickerLabel","hexLabel","color","formatString","pickerBtn","pickerDropdown","presetsDropdown","presetsBtn","xmlns","presetsIcon","createElementNS","ariaHidden","path","tabindex","colorPickerString","colorPickerSelector","colorPickerParentSelector","colorPickerDefaults","roundPart","getColorPickerInstance","element","getInstance","initColorPicker","ColorPicker","toggleEvents","action","on","off","pickerToggle","menuToggle","focusinEvent","mouseclickEvent","toggleEventsOnShown","colorMenu","doc","getDocument","win","getWindow","pointerdownEvent","keydownEvent","scrollEvent","resizeEvent","changeEvent","pointermoveEvent","pointerupEvent","focusoutEvent","keyupEvent","firePickerChange","dispatchEvent","removePosition","removeClass","showDropdown","dropdown","colorPicker","isPicker","openDropdown","activeBtn","nextBtn","hasClass","addClass","reflow","ariaExpanded","getBoundingClientRect","version","ObjectFromEntries","target","config","querySelector","closest","getUID","colorLabels","normalizeOptions","translatedColorLabels","isArray","tempComponentLabels","getElementsByClassName","controls","Data","brightness","inputValue","hsl","hsv","saturationSource","lightness","hsvl","colorName","isGold","isOlive","controlPositions","visuals","v1","v2","v3","offsetHeight","whiteGrad","alpha","roundA","fill","hueGradient","relatedTarget","code","keyEscape","activeElement","touchmoveEvent","previousElementSibling","nextElementSibling","parentElement","isColorOptionsMenu","allSiblings","columnsCount","getElementStyle","currentIndex","previousElement","nextElement","keyArrowDown","keyArrowUp","keySpace","focus","keyArrowLeft","keyArrowRight","keyEnter","newOption","currentActive","removeAttribute","ariaSelected","pageX","pageY","controlKnobs","c1","c2","c3","visual","visualRect","html","getDocumentElement","offsetX","offsetY","currentOpen","selection","dragElement","controlRect","offsetWidth","currentKnob","yRatio","xRatio","colorSource","inputs","currentValue","i1","i4","v4","isNonColorValue","elRect","top","bottom","elHeight","windowHeight","dropHeight","distanceBottom","distanceTop","bottomExceed","topExceed","hex","appearanceLabel","valueLabel","knob1","knob2","knob3","colorLabel","hwb","whiteness","blackness","ariaValueText","ariaValueNow","ariaDescription","alphaValue","c1x","c1y","c2y","c3y","control1","control2","control3","isPrevented","oldColor","i2","i3","focusPrevented","openPicker","relatedBtn","animationDuration","getElementTransitionDuration","el"],"mappings":"wCAAK,MAAsBA,GAAK,mBAA6CC,GAAK,gBAAuCC,GAAK,cAAkGC,GAAK,gBAA6DC,EAAK,gBAAiBC,GAAK,iBAA+DC,GAAI,SAA6BC,GAAI,mBAAoEC,GAAI,UAAWC,GAAK,WAA0EC,GAAK,UAA4BC,GAAK,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G,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,GACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,uBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,mBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,oBACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,CACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,MACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,MACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,CACH,EAAGC,GAAI,oBAAqB3D,GAAI,gBAAiBoE,GAAI,uBAAwBvC,GAAI,yBAAyB8B,EAAC,KAAMlC,GAAI,MAAM2C,EAAC,QAAQpE,EAAC,IAAKqE,GAAI,MAAM5C,EAAC,QAAQI,EAAC,KAAMyC,GAAK,+BAAgCC,GAAK,qBAAsBC,GAAI,eAAgBC,GAAK,mBAAoBC,GAAI,GAAGJ,EAAE,IAAID,EAAC,IAAIG,EAAC,IAAI/C,EAAC,IAAI+C,EAA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,GAAeM,CAAY,EAEtBY,EAAc,QAASzE,CAAM,IAChCwD,EAAYxD,EAAQ,MAAM,EAC1BsC,GAAoB,IAAI,EACxB,KAAK,OAAS,KAEf8J,CAAiB,GAGjBH,GACHtE,EAAMzF,CAAY,EAEPvF,EAAA2B,EAAO6C,EAAU,IAAI,EAC9BgL,IAAehK,GACJxF,EAAAwF,EAAYhB,EAAU,IAAI,CAE3C,CACF,CAGA,SAAU,CACF,KAAA,CAAE,MAAA7C,EAAO,OAAA0B,CAAW,EAAA,KAC1B,KAAK,KAAK,EAAI,EACd8B,GAAa,IAAI,EACjB,CAAC,GAAG9B,EAAO,QAAQ,EAAE,QAAcsM,GAAA,CAC7BA,IAAOhO,GAAOgO,EAAG,OAAO,CAAA,CAC7B,EAEDrE,GAAgB3J,EAAO6C,CAAQ,EAC/B1B,EAAgBnB,EAAO,CAAE,gBAAiB,EAAI,CAAA,EAE7C,CAAA,YAAa,UAAU,EAAE,WAAakF,EAAYxD,EAAQjG,CAAC,CAAC,EACxDoL,GAAA,OAAO7G,EAAO8C,CAAiB,CACtC,CACF","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/dist/js/color-picker.mjs b/dist/js/color-picker.mjs index fb84c63..f5bdd8a 100644 --- a/dist/js/color-picker.mjs +++ b/dist/js/color-picker.mjs @@ -1,41 +1,25 @@ -const Z = {}, ue = (o) => { - const { type: t, currentTarget: e } = o; - [...Z[t]].forEach(([s, r]) => { - e === s && [...r].forEach(([n, i]) => { - n.apply(s, [o]), typeof i == "object" && i.once && jt(s, t, n, i); - }); - }); -}, be = (o, t, e, s) => { - Z[t] || (Z[t] = /* @__PURE__ */ new Map()); - const r = Z[t]; - r.has(o) || r.set(o, /* @__PURE__ */ new Map()); - const n = r.get(o), { size: i } = n; - n.set(e, s), i || o.addEventListener(t, ue, s); -}, jt = (o, t, e, s) => { - const r = Z[t], n = r && r.get(o), i = n && n.get(e), a = i !== void 0 ? i : s; - n && n.has(e) && n.delete(e), r && (!n || !n.size) && r.delete(o), (!r || !r.size) && delete Z[t], (!n || !n.size) && o.removeEventListener(t, ue, a); -}, Ut = "aria-description", Et = "aria-expanded", Te = "aria-hidden", St = "aria-selected", et = "aria-valuenow", ot = "aria-valuetext", Re = "change", Oe = "DOMContentLoaded", De = "focusin", Fe = "focusout", _t = "keydown", Ie = "keyup", Mt = "click", Ke = "pointerdown", pe = "pointermove", Ve = "pointerup", Be = "resize", je = "scroll", qe = "touchmove", j = "ArrowDown", st = "ArrowUp", gt = "ArrowLeft", G = "ArrowRight", ze = "Enter", Ge = "Escape", Wt = "Space", Ue = "transitionDuration", _e = "transitionProperty", X = "tabindex", We = navigator.userAgentData, vt = We, { userAgent: Je } = navigator, wt = Je, Jt = /iPhone|iPad|iPod|Android/i; -vt ? vt.brands.some((o) => Jt.test(o.brand)) : Jt.test(wt); -const Zt = /(iPhone|iPod|iPad)/; -vt ? vt.brands.some((o) => Zt.test(o.brand)) : ( +const _t = "aria-description", Nt = "aria-expanded", Ee = "aria-hidden", St = "aria-selected", tt = "aria-valuenow", et = "aria-valuetext", Me = "change", Te = "DOMContentLoaded", Re = "focusin", Oe = "focusout", zt = "keydown", De = "keyup", Et = "click", Fe = "pointerdown", ue = "pointermove", Ie = "pointerup", Ke = "resize", Ve = "scroll", Be = "touchmove", j = "ArrowDown", ot = "ArrowUp", ht = "ArrowLeft", U = "ArrowRight", je = "Enter", qe = "Escape", Wt = "Space", Ge = "transitionDuration", Ue = "transitionProperty", X = "tabindex", _e = navigator.userAgentData, mt = _e, { userAgent: ze } = navigator, vt = ze, Jt = /iPhone|iPad|iPod|Android/i; +mt ? mt.brands.some((o) => Jt.test(o.brand)) : Jt.test(vt); +const Xt = /(iPhone|iPod|iPad)/; +mt ? mt.brands.some((o) => Xt.test(o.brand)) : ( /* istanbul ignore next */ - Zt.test(wt) + Xt.test(vt) ); -wt && wt.includes("Firefox"); -const { head: yt } = document; -["webkitPerspective", "perspective"].some((o) => o in yt.style); -const Ze = (o, t, e, s) => { +vt && vt.includes("Firefox"); +const { head: kt } = document; +["webkitPerspective", "perspective"].some((o) => o in kt.style); +const Bt = (o, t, e, s) => { const r = s || !1; o.addEventListener(t, e, r); -}, Xe = (o, t, e, s) => { +}, jt = (o, t, e, s) => { const r = s || !1; o.removeEventListener(t, e, r); -}, Ye = (o, t, e, s) => { +}, We = (o, t, e, s) => { const r = (n) => { - (n.target === o || n.currentTarget === o) && (e.apply(o, [n]), Xe(o, t, r, s)); + (n.target === o || n.currentTarget === o) && (e.apply(o, [n]), jt(o, t, r, s)); }; - Ze(o, t, r, s); -}, Qe = () => { + Bt(o, t, r, s); +}, Je = () => { }; (() => { let o = !1; @@ -43,19 +27,19 @@ const Ze = (o, t, e, s) => { const t = Object.defineProperty({}, "passive", { get: () => (o = !0, o) }); - Ye(document, Oe, Qe, t); + We(document, Te, Je, t); } catch { } return o; })(); -["webkitTransform", "transform"].some((o) => o in yt.style); -["webkitAnimation", "animation"].some((o) => o in yt.style); -["webkitTransition", "transition"].some((o) => o in yt.style); -const xt = (o, t) => o.getAttribute(t), m = (o, t, e) => o.setAttribute(t, e), Ct = (o, t) => o.removeAttribute(t), q = (o, ...t) => { +["webkitTransform", "transform"].some((o) => o in kt.style); +["webkitAnimation", "animation"].some((o) => o in kt.style); +["webkitTransition", "transition"].some((o) => o in kt.style); +const yt = (o, t) => o.getAttribute(t), m = (o, t, e) => o.setAttribute(t, e), Pt = (o, t) => o.removeAttribute(t), q = (o, ...t) => { o.classList.add(...t); }, O = (o, ...t) => { o.classList.remove(...t); -}, T = (o, t) => o.classList.contains(t), qt = (o) => o != null && typeof o == "object" || !1, Q = (o) => qt(o) && typeof o.nodeType == "number" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some((t) => o.nodeType === t) || !1, lt = (o) => Q(o) && o.nodeType === 1 || !1, W = /* @__PURE__ */ new Map(), ht = { +}, T = (o, t) => o.classList.contains(t), qt = (o) => o != null && typeof o == "object" || !1, Y = (o) => qt(o) && typeof o.nodeType == "number" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some((t) => o.nodeType === t) || !1, at = (o) => Y(o) && o.nodeType === 1 || !1, W = /* @__PURE__ */ new Map(), ct = { data: W, /** * Sets web components data. @@ -65,7 +49,7 @@ const xt = (o, t) => o.getAttribute(t), m = (o, t, e) => o.setAttribute(t, e), C * @param instance the component instance */ set: (o, t, e) => { - lt(o) && (W.has(t) || W.set(t, /* @__PURE__ */ new Map()), W.get(t).set(o, e)); + at(o) && (W.has(t) || W.set(t, /* @__PURE__ */ new Map()), W.get(t).set(o, e)); }, /** * Returns all instances for specified component. @@ -82,9 +66,9 @@ const xt = (o, t) => o.getAttribute(t), m = (o, t, e) => o.setAttribute(t, e), C * @returns the instance */ get: (o, t) => { - if (!lt(o) || !t) + if (!at(o) || !t) return null; - const e = ht.getAllFor(t); + const e = ct.getAllFor(t); return o && e && e.get(o) || null; }, /** @@ -94,10 +78,10 @@ const xt = (o, t) => o.getAttribute(t), m = (o, t, e) => o.setAttribute(t, e), C * @param component the component's name or a unique key */ remove: (o, t) => { - const e = ht.getAllFor(t); - !e || !lt(o) || (e.delete(o), e.size === 0 && W.delete(t)); + const e = ct.getAllFor(t); + !e || !at(o) || (e.delete(o), e.size === 0 && W.delete(t)); } -}, to = (o, t) => ht.get(o, t), B = (o) => typeof o == "string" || !1, eo = (o) => qt(o) && o.constructor.name === "Window" || !1, de = (o) => Q(o) && o.nodeType === 9 || !1, V = (o) => eo(o) ? o.document : de(o) ? o : Q(o) ? o.ownerDocument : window.document, K = (o, ...t) => Object.assign(o, ...t), x = (o) => { +}, Xe = (o, t) => ct.get(o, t), B = (o) => typeof o == "string" || !1, Ze = (o) => qt(o) && o.constructor.name === "Window" || !1, be = (o) => Y(o) && o.nodeType === 9 || !1, V = (o) => Ze(o) ? o.document : be(o) ? o : Y(o) ? o.ownerDocument : window.document, K = (o, ...t) => Object.assign(o, ...t), x = (o) => { if (!o) return; if (B(o)) @@ -107,21 +91,21 @@ const xt = (o, t) => o.getAttribute(t), m = (o, t, e) => o.setAttribute(t, e), C return; const s = { ...o }; return delete s.tagName, K(e, s); -}, Tt = (o, t) => { +}, Mt = (o, t) => { if (!o || !t) return; if (B(t)) return V().createElementNS(o, t); - const { tagName: e } = t, s = Tt(o, e); + const { tagName: e } = t, s = Mt(o, e); if (!s) return; const r = { ...t }; return delete r.tagName, K(s, r); -}, oo = (o, t) => o.dispatchEvent(t), Rt = (o, t) => { +}, Ye = (o, t) => o.dispatchEvent(t), Tt = (o, t) => { const e = getComputedStyle(o), s = t.replace("webkit", "Webkit").replace(/([A-Z])/g, "-$1").toLowerCase(); return e.getPropertyValue(s); -}, so = (o) => { - const t = Rt(o, _e), e = Rt(o, Ue), s = e.includes("ms") ? ( +}, Qe = (o) => { + const t = Tt(o, Ue), e = Tt(o, Ge), s = e.includes("ms") ? ( /* istanbul ignore next */ 1 ) : 1e3, r = t && t !== "none" ? parseFloat(e) * s : ( @@ -132,18 +116,18 @@ const xt = (o, t) => o.getAttribute(t), m = (o, t, e) => o.setAttribute(t, e), C /* istanbul ignore next */ 0 ) : r; -}, U = (o, t) => o.focus(t), Xt = (o) => ["true", !0].includes(o) ? !0 : ["false", !1].includes(o) ? !1 : ["null", "", null, void 0].includes(o) ? null : o !== "" && !Number.isNaN(+o) ? +o : o, dt = (o) => Object.entries(o), ro = (o) => o.toLowerCase(), no = (o, t, e, s) => { +}, _ = (o, t) => o.focus(t), Zt = (o) => ["true", !0].includes(o) ? !0 : ["false", !1].includes(o) ? !1 : ["null", "", null, void 0].includes(o) ? null : o !== "" && !Number.isNaN(+o) ? +o : o, pt = (o) => Object.entries(o), to = (o) => o.toLowerCase(), eo = (o, t, e, s) => { const r = { ...e }, n = { ...o.dataset }, i = { ...t }, a = {}, l = "title"; - return dt(n).forEach(([c, h]) => { - const b = s && typeof c == "string" && c.includes(s) ? c.replace(s, "").replace(/[A-Z]/g, (u) => ro(u)) : c; - a[b] = Xt(h); - }), dt(r).forEach(([c, h]) => { - r[c] = Xt(h); - }), dt(t).forEach(([c, h]) => { - c in r ? i[c] = r[c] : c in a ? i[c] = a[c] : i[c] = c === l ? xt(o, l) : h; + return pt(n).forEach(([c, h]) => { + const b = s && typeof c == "string" && c.includes(s) ? c.replace(s, "").replace(/[A-Z]/g, (u) => to(u)) : c; + a[b] = Zt(h); + }), pt(r).forEach(([c, h]) => { + r[c] = Zt(h); + }), pt(t).forEach(([c, h]) => { + c in r ? i[c] = r[c] : c in a ? i[c] = a[c] : i[c] = c === l ? yt(o, l) : h; }), i; -}, Yt = (o) => Object.fromEntries(o), io = (o) => o.offsetHeight, D = (o, t) => { - dt(t).forEach(([e, s]) => { +}, Yt = (o) => Object.fromEntries(o), oo = (o) => o.offsetHeight, D = (o, t) => { + pt(t).forEach(([e, s]) => { if (s && B(e) && e.includes("--")) o.style.setProperty(e, s); else { @@ -151,10 +135,10 @@ const xt = (o, t) => o.getAttribute(t), m = (o, t, e) => o.setAttribute(t, e), C r[e] = s, K(o.style, r); } }); -}, ao = (o) => qt(o) && o.constructor.name === "Map" || !1, fe = (o) => o.toUpperCase(), ut = (o, t) => { +}, so = (o) => qt(o) && o.constructor.name === "Map" || !1, pe = (o) => o.toUpperCase(), gt = (o, t) => { const { width: e, height: s, top: r, right: n, bottom: i, left: a } = o.getBoundingClientRect(); let l = 1, c = 1; - if (t && lt(o)) { + if (t && at(o)) { const { offsetWidth: h, offsetHeight: b } = o; l = h > 0 ? Math.round(e) / h : ( /* istanbul ignore next */ @@ -174,28 +158,28 @@ const xt = (o, t) => o.getAttribute(t), m = (o, t, e) => o.setAttribute(t, e), C x: a / l, y: r / c }; -}, Lt = (o) => V(o).documentElement; +}, Ct = (o) => V(o).documentElement; let Qt = 0, te = 0; -const J = /* @__PURE__ */ new Map(), me = (o, t) => { +const J = /* @__PURE__ */ new Map(), de = (o, t) => { let e = t ? Qt : te; if (t) { - const s = me(o), r = J.get(s) || /* @__PURE__ */ new Map(); - J.has(s) || J.set(s, r), ao(r) && !r.has(t) ? (r.set(t, e), Qt += 1) : e = r.get(t); + const s = de(o), r = J.get(s) || /* @__PURE__ */ new Map(); + J.has(s) || J.set(s, r), so(r) && !r.has(t) ? (r.set(t, e), Qt += 1) : e = r.get(t); } else { const s = o.id || o; J.has(s) ? e = J.get(s) : (J.set(s, e), te += 1); } return e; -}, lo = (o) => { +}, ro = (o) => { var t; - return o ? de(o) ? o.defaultView : Q(o) ? (t = o?.ownerDocument) == null ? void 0 : t.defaultView : o : window; -}, At = (o) => Array.isArray(o) || !1, ve = (o, t) => o ? o.closest(t) || // break out of `ShadowRoot` -ve(o.getRootNode().host, t) : null, _ = (o, t) => lt(o) ? o : (Q(t) ? t : V()).querySelector(o), rt = (o, t) => (t && Q(t) ? t : V()).getElementsByClassName( + return o ? be(o) ? o.defaultView : Y(o) ? (t = o?.ownerDocument) == null ? void 0 : t.defaultView : o : window; +}, Lt = (o) => Array.isArray(o) || !1, fe = (o, t) => o ? o.closest(t) || // break out of `ShadowRoot` +fe(o.getRootNode().host, t) : null, z = (o, t) => at(o) ? o : (Y(t) ? t : V()).querySelector(o), st = (o, t) => (t && Y(t) ? t : V()).getElementsByClassName( o -), zt = ["transparent", "currentColor", "inherit", "revert", "initial"], v = (o) => { +), Gt = ["transparent", "currentColor", "inherit", "revert", "initial"], v = (o) => { const t = Math.floor(o); return o - t < 0.5 ? t : Math.round(o); -}, $t = [ +}, wt = [ [ "aliceblue", { @@ -1380,37 +1364,37 @@ ve(o.getRootNode().host, t) : null, _ = (o, t) => lt(o) ? o : (Q(t) ? t : V()).q b: 50 } ] -], we = "deg|rad|grad|turn", $e = "[-\\+]?\\d+%?", ke = "[-\\+]?\\d*\\.\\d+%?", ye = `[-\\+]?\\d*\\.?\\d+(?:${we})?`, ft = `(?:${ke})|(?:${$e})`, Ot = `(?:${ft})|(?:${ye}?)`, co = "(?:[\\s|\\(\\s|\\s\\(\\s]+)?", ho = "(?:[\\s|\\)\\s]+)?", ee = "(?:[,|\\s]+)", go = "(?:[,|\\/\\s]*)?", nt = `${co}(${Ot})${ee}(${ft})${ee}(${ft})${go}(${ft})?${ho}`, I = { - CSS_UNIT: new RegExp(Ot), - ANGLES: we, - CSS_ANGLE: ye, - CSS_INTEGER: $e, - CSS_NUMBER: ke, - CSS_UNIT2: Ot, - PERMISSIVE_MATCH: nt, - hwb: new RegExp(`hwb${nt}`), - rgb: new RegExp(`rgb(?:a)?${nt}`), - hsl: new RegExp(`hsl(?:a)?${nt}`), - hsv: new RegExp(`hsv(?:a)?${nt}`), +], me = "deg|rad|grad|turn", ve = "[-\\+]?\\d+%?", we = "[-\\+]?\\d*\\.\\d+%?", $e = `[-\\+]?\\d*\\.?\\d+(?:${me})?`, dt = `(?:${we})|(?:${ve})`, Rt = `(?:${dt})|(?:${$e}?)`, no = "(?:[\\s|\\(\\s|\\s\\(\\s]+)?", io = "(?:[\\s|\\)\\s]+)?", ee = "(?:[,|\\s]+)", ao = "(?:[,|\\/\\s]*)?", rt = `${no}(${Rt})${ee}(${dt})${ee}(${dt})${ao}(${dt})?${io}`, I = { + CSS_UNIT: new RegExp(Rt), + ANGLES: me, + CSS_ANGLE: $e, + CSS_INTEGER: ve, + CSS_NUMBER: we, + CSS_UNIT2: Rt, + PERMISSIVE_MATCH: rt, + hwb: new RegExp(`hwb${rt}`), + rgb: new RegExp(`rgb(?:a)?${rt}`), + hsl: new RegExp(`hsl(?:a)?${rt}`), + hsv: new RegExp(`hsv(?:a)?${rt}`), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ -}, xe = (o) => zt.includes(o), it = (o, t) => o !== null && typeof o == "object" && Object.keys(t).every((e) => e in o), Pe = (o) => `${o}`.includes(".") && parseFloat(o) === 1, kt = (o) => typeof o == "string" && o.includes("%"), H = (o) => !!I.CSS_UNIT.exec(`${o}`), Se = ["rgb", "hex", "hsl", "hsv", "hwb"], Ce = (o) => zt.includes(o) || ["#", ...Se].some((t) => o.includes(t)) ? !1 : $t.some(([t]) => o === t), R = (o, t) => { +}, ke = (o) => Gt.includes(o), nt = (o, t) => o !== null && typeof o == "object" && Object.keys(t).every((e) => e in o), ye = (o) => `${o}`.includes(".") && parseFloat(o) === 1, $t = (o) => typeof o == "string" && o.includes("%"), H = (o) => !!I.CSS_UNIT.exec(`${o}`), xe = ["rgb", "hex", "hsl", "hsv", "hwb"], Se = (o) => Gt.includes(o) || ["#", ...xe].some((t) => o.includes(t)) ? !1 : wt.some(([t]) => o === t), R = (o, t) => { let e = o; if (typeof o == "number" && Math.min(o, 0) === 0 && // round values to 6 decimals Math.round(N * (10 ** 6)) / 10 ** 6 Math.max(o, 1) === 1) return o; - Pe(o) && (e = "100%"); - const s = kt(e); + ye(o) && (e = "100%"); + const s = $t(e); return e = t === 360 ? parseFloat(e) : Math.min(t, Math.max(0, parseFloat(e))), s && (e = e * t / 100), Math.abs(e - t) < 1e-6 ? 1 : (t === 360 ? e = (e < 0 ? e % t + t : e % t) / t : e = e % t / t, e); -}, Dt = (o) => { +}, Ot = (o) => { let t = parseFloat(o); return (Number.isNaN(t) || t < 0 || t > 1) && (t = 1), t; -}, bt = (o) => Math.min(1, Math.max(0, o)), z = (o) => o.length === 1 ? `0${o}` : String(o), Le = (o) => { - const [[, t]] = $t.filter(([e]) => e === o.toLowerCase()); +}, ut = (o) => Math.min(1, Math.max(0, o)), G = (o) => o.length === 1 ? `0${o}` : String(o), Pe = (o) => { + const [[, t]] = wt.filter(([e]) => e === o.toLowerCase()); return t; -}, N = (o) => parseInt(o, 16), Ft = (o) => N(o) / 255, Ae = (o) => v(o * 255).toString(16), oe = (o, t, e) => { +}, N = (o) => parseInt(o, 16), Dt = (o) => N(o) / 255, Ce = (o) => v(o * 255).toString(16), oe = (o, t, e) => { const s = Math.max(o, t, e), r = Math.min(o, t, e); let n = 0, i = 0; const a = (s + r) / 2; @@ -1421,16 +1405,16 @@ ve(o.getRootNode().host, t) : null, _ = (o, t) => lt(o) ? o : (Q(t) ? t : V()).q i = a > 0.5 ? l / (2 - s - r) : l / (s + r), s === o && (n = (t - e) / l + (t < e ? 6 : 0)), s === t && (n = (e - o) / l + 2), s === e && (n = (o - t) / l + 4), n /= 6; } return { h: n, s: i, l: a }; -}, mt = (o, t, e) => { +}, ft = (o, t, e) => { let s = e; return s < 0 && (s += 1), s > 1 && (s -= 1), s < 1 / 6 ? o + (t - o) * (6 * s) : s < 1 / 2 ? t : s < 2 / 3 ? o + (t - o) * (2 / 3 - s) * 6 : o; -}, ct = (o, t, e) => { +}, lt = (o, t, e) => { let s = 0, r = 0, n = 0; if (t === 0) r = e, n = e, s = e; else if (e) { const i = e < 0.5 ? e * (1 + t) : e + t - e * t, a = 2 * e - i; - s = mt(a, i, o + 1 / 3), r = mt(a, i, o), n = mt(a, i, o - 1 / 3); + s = ft(a, i, o + 1 / 3), r = ft(a, i, o), n = ft(a, i, o - 1 / 3); } return { r: s, g: r, b: n }; }, se = (o, t, e) => { @@ -1445,45 +1429,45 @@ ve(o.getRootNode().host, t) : null, _ = (o, t) => lt(o) ? o : (Q(t) ? t : V()).q w: n, b: a }; -}, He = (o, t, e) => { +}, Le = (o, t, e) => { if (t + e >= 1) { const i = t / (t + e); return { r: i, g: i, b: i }; } - let { r: s, g: r, b: n } = ct(o, 1, 0.5); + let { r: s, g: r, b: n } = lt(o, 1, 0.5); return [s, r, n] = [s, r, n].map((i) => i * (1 - t - e) + t), { r: s, g: r, b: n }; }, re = (o, t, e) => { const s = Math.max(o, t, e), r = Math.min(o, t, e); let n = 0; const i = s, a = s - r, l = s === 0 ? 0 : a / s; return s === r ? n = 0 : (o === s && (n = (t - e) / a + (t < e ? 6 : 0)), t === s && (n = (e - o) / a + 2), e === s && (n = (o - t) / a + 4), n /= 6), { h: n, s: l, v: i }; -}, It = (o, t, e) => { +}, Ft = (o, t, e) => { const s = o * 6, r = t, n = e, i = Math.floor(s), a = s - i, l = n * (1 - r), c = n * (1 - a * r), h = n * (1 - (1 - a) * r), b = i % 6, u = [n, c, l, l, h, n][b], d = [h, n, n, c, l, l][b], g = [l, l, h, n, n, c][b]; return { r: u, g: d, b: g }; }, ne = (o, t, e, s) => { const r = [ - z(v(o).toString(16)), - z(v(t).toString(16)), - z(v(e).toString(16)) + G(v(o).toString(16)), + G(v(t).toString(16)), + G(v(e).toString(16)) ]; return s && r[0].charAt(0) === r[0].charAt(1) && r[1].charAt(0) === r[1].charAt(1) && r[2].charAt(0) === r[2].charAt(1) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) : r.join(""); -}, Ht = (o, t, e, s, r) => { +}, At = (o, t, e, s, r) => { const n = [ - z(v(o).toString(16)), - z(v(t).toString(16)), - z(v(e).toString(16)), - z(Ae(s)) + G(v(o).toString(16)), + G(v(t).toString(16)), + G(v(e).toString(16)), + G(Ce(s)) ]; return r && n[0].charAt(0) === n[0].charAt(1) && n[1].charAt(0) === n[1].charAt(1) && n[2].charAt(0) === n[2].charAt(1) && n[3].charAt(0) === n[3].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join(""); -}, Ne = (o) => { +}, Ae = (o) => { const t = String(o).trim().toLowerCase(); - if (Ce(t)) - return Object.assign(Le(t), { + if (Se(t)) + return Object.assign(Pe(t), { a: 1, format: "rgb", ok: !0 }); - if (xe(t)) + if (ke(t)) return { r: 0, g: 0, @@ -1525,7 +1509,7 @@ ve(o.getRootNode().host, t) : null, _ = (o, t) => lt(o) ? o : (Q(t) ? t : V()).q r: N(e), g: N(s), b: N(r), - a: Ft(n), + a: Dt(n), format: "hex", ok: !0 } : ([, e, s, r] = I.hex6.exec(t) || [], e && s && r ? { @@ -1539,7 +1523,7 @@ ve(o.getRootNode().host, t) : null, _ = (o, t) => lt(o) ? o : (Q(t) ? t : V()).q r: N(e + e), g: N(s + s), b: N(r + r), - a: Ft(n + n), + a: Dt(n + n), format: "hex", ok: !0 } : ([, e, s, r] = I.hex3.exec(t) || [], e && s && r ? { @@ -1559,47 +1543,47 @@ ve(o.getRootNode().host, t) : null, _ = (o, t) => lt(o) ? o : (Q(t) ? t : V()).q }))))))); }, ie = (o) => { let t = { r: 0, g: 0, b: 0 }, e = o, s = 1, r, n, i, a, l, c, h, b, u = "rgb", d = !1; - return (!e || typeof e == "string") && (e = Ne(e), d = e.ok), it(e, t) && H(e.r) && H(e.g) && H(e.b) && ({ r: h, g: b, b: l } = e, [h, b, l] = [h, b, l].map((g) => R(g, kt(g) ? 100 : 255)), t = { r: h, g: b, b: l }, u = "format" in e ? e.format : "rgb"), it(e, { h: 0, s: 0, v: 0 }) && H(e.h) && H(e.s) && H(e.v) && ({ h: c, s: r, v: n } = e, c = R(c, 360), r = R(r, 100), n = R(n, 100), t = It(c, r, n), u = "hsv"), it(e, { h: 0, s: 0, l: 0 }) && H(e.h) && H(e.s) && H(e.l) && ({ h: c, s: r, l: i } = e, c = R(c, 360), r = R(r, 100), i = R(i, 100), t = ct(c, r, i), u = "hsl"), it(e, { h: 0, w: 0, b: 0 }) && H(e.h) && H(e.w) && H(e.b) && ({ h: c, w: a, b: l } = e, c = R(c, 360), a = R(a, 100), l = R(l, 100), t = He(c, a, l), u = "hwb"), H(e.a) && (s = e.a, s = kt(s) || parseFloat(`${s}`) > 1 ? R(s, 100) : s), { + return (!e || typeof e == "string") && (e = Ae(e), d = e.ok), nt(e, t) && H(e.r) && H(e.g) && H(e.b) && ({ r: h, g: b, b: l } = e, [h, b, l] = [h, b, l].map((g) => R(g, $t(g) ? 100 : 255)), t = { r: h, g: b, b: l }, u = "format" in e ? e.format : "rgb"), nt(e, { h: 0, s: 0, v: 0 }) && H(e.h) && H(e.s) && H(e.v) && ({ h: c, s: r, v: n } = e, c = R(c, 360), r = R(r, 100), n = R(n, 100), t = Ft(c, r, n), u = "hsv"), nt(e, { h: 0, s: 0, l: 0 }) && H(e.h) && H(e.s) && H(e.l) && ({ h: c, s: r, l: i } = e, c = R(c, 360), r = R(r, 100), i = R(i, 100), t = lt(c, r, i), u = "hsl"), nt(e, { h: 0, w: 0, b: 0 }) && H(e.h) && H(e.w) && H(e.b) && ({ h: c, w: a, b: l } = e, c = R(c, 360), a = R(a, 100), l = R(l, 100), t = Le(c, a, l), u = "hwb"), H(e.a) && (s = e.a, s = $t(s) || parseFloat(`${s}`) > 1 ? R(s, 100) : s), { r: t.r, g: t.g, b: t.b, - a: Dt(s), + a: Ot(s), format: u, ok: d }; -}, uo = "1.0.8"; +}, lo = "1.0.8"; class y { // bring main utilities to front static matchers = I; - static isOnePointZero = Pe; - static isPercentage = kt; + static isOnePointZero = ye; + static isPercentage = $t; static isValidCSSUnit = H; - static isNonColor = xe; - static isColorName = Ce; - static isColorType = it; - static pad2 = z; - static clamp01 = bt; + static isNonColor = ke; + static isColorName = Se; + static isColorType = nt; + static pad2 = G; + static clamp01 = ut; static bound01 = R; - static boundAlpha = Dt; - static getRGBFromName = Le; - static convertHexToDecimal = Ft; - static convertDecimalToHex = Ae; + static boundAlpha = Ot; + static getRGBFromName = Pe; + static convertHexToDecimal = Dt; + static convertDecimalToHex = Ce; static rgbToHsl = oe; static rgbToHex = ne; static rgbToHsv = re; static rgbToHwb = se; - static rgbaToHex = Ht; - static hslToRgb = It; - static hsvToRgb = It; - static hueToRgb = mt; - static hwbToRgb = He; + static rgbaToHex = At; + static hslToRgb = Ft; + static hsvToRgb = Ft; + static hueToRgb = ft; + static hwbToRgb = Le; static parseIntFromHex = N; - static stringInputToObject = Ne; + static stringInputToObject = Ae; static inputToRGB = ie; static roundPart = v; - static webColors = $t; - static nonColors = zt; - static version = uo; + static webColors = wt; + static nonColors = Gt; + static version = lo; // main public properties r; g; @@ -1610,7 +1594,7 @@ class y { originalInput; // main public methods constructor(t, e) { - const s = e && Se.includes(e) ? e : "", { r, g: n, b: i, a, ok: l, format: c } = ie(t); + const s = e && xe.includes(e) ? e : "", { r, g: n, b: i, a, ok: l, format: c } = ie(t); this.originalInput = t, this.r = r, this.g = n, this.b = i, this.a = a, this.ok = l, this.format = s || c; } /** @@ -1646,7 +1630,7 @@ class y { * Returns the web colour name closest to the current colour. */ get name() { - const { r: t, g: e, b: s } = this.toRgb(), [r] = $t.map(([n, i]) => { + const { r: t, g: e, b: s } = this.toRgb(), [r] = wt.map(([n, i]) => { const a = ( // ((rgb.r - r) ** 2 + (rgb.g - g) ** 2 + (rgb.b - b) ** 2) ** 0.5; // standard (((i.r - t) * 0.3) ** 2 + ((i.g - e) * 0.6) ** 2 + ((i.b - s) * 0.1) ** 2) ** 0.5 @@ -1691,7 +1675,7 @@ class y { */ toHex(t) { const { r: e, g: s, b: r, a: n } = this.toRgb(); - return n === 1 ? ne(e, s, r, t) : Ht(e, s, r, n, t); + return n === 1 ? ne(e, s, r, t) : At(e, s, r, n, t); } /** * Returns the CSS valid hexadecimal vaue of the colour. When the parameter is *true* @@ -1705,7 +1689,7 @@ class y { */ toHex8(t) { const { r: e, g: s, b: r, a: n } = this.toRgb(); - return Ht(e, s, r, n, t); + return At(e, s, r, n, t); } /** * Returns the HEX8 value of the colour. @@ -1782,7 +1766,7 @@ class y { * Sets the alpha value of the current colour. */ setAlpha(t) { - return typeof t != "number" ? this : (this.a = Dt(t), this); + return typeof t != "number" ? this : (this.a = Ot(t), this); } /** * Saturate the colour with a given amount. @@ -1790,7 +1774,7 @@ class y { saturate(t) { if (typeof t != "number") return this; - const { h: e, s, l: r } = this.toHsl(), { r: n, g: i, b: a } = ct(e, bt(s + t / 100), r); + const { h: e, s, l: r } = this.toHsl(), { r: n, g: i, b: a } = lt(e, ut(s + t / 100), r); return Object.assign(this, { r: n, g: i, b: a }), this; } /** @@ -1812,7 +1796,7 @@ class y { lighten(t) { if (typeof t != "number") return this; - const { h: e, s, l: r } = this.toHsl(), { r: n, g: i, b: a } = ct(e, s, bt(r + t / 100)); + const { h: e, s, l: r } = this.toHsl(), { r: n, g: i, b: a } = lt(e, s, ut(r + t / 100)); return Object.assign(this, { r: n, g: i, b: a }), this; } /** @@ -1828,7 +1812,7 @@ class y { spin(t) { if (typeof t != "number") return this; - const { h: e, s, l: r } = this.toHsl(), { r: n, g: i, b: a } = ct(bt((e * 360 + t) % 360 / 360), s, r); + const { h: e, s, l: r } = this.toHsl(), { r: n, g: i, b: a } = lt(ut((e * 360 + t) % 360 / 360), s, r); return Object.assign(this, { r: n, g: i, b: a }), this; } /** Returns a clone of the current `Color` instance. */ @@ -1843,7 +1827,7 @@ class y { return e === "hex" ? this.toHexString(t) : e === "hsl" ? this.toHslString() : e === "hwb" ? this.toHwbString() : this.toRgbString(); } } -class Kt { +class It { static Color = y; hue; hueSteps; @@ -1887,7 +1871,7 @@ class Kt { this.hue = e, this.hueSteps = s, this.lightSteps = r, this.saturation = i, this.colors = a; } } -const Vt = { +const Kt = { pickerLabel: "Colour Picker", appearanceLabel: "Colour Appearance", valueLabel: "Colour Value", @@ -1905,7 +1889,7 @@ const Vt = { redLabel: "Red", greenLabel: "Green", blueLabel: "Blue" -}, at = [ +}, it = [ "white", "black", "grey", @@ -1932,14 +1916,14 @@ const Vt = { return !1; } return !0; -}, Bt = "v-hidden", bo = (o) => { +}, Vt = "v-hidden", co = (o) => { const { format: t, id: e, componentLabels: s } = o, r = x({ tagName: "div", className: `color-form ${t}` }); let n = ["hex"]; return t === "rgb" ? n = ["red", "green", "blue", "alpha"] : t === "hsl" ? n = ["hue", "saturation", "lightness", "alpha"] : t === "hwb" && (n = ["hue", "whiteness", "blackness", "alpha"]), n.forEach((i) => { - const [a] = t === "hex" ? ["#"] : fe(i).split(""), l = `color_${t}_${i}_${e}`, c = s[`${i}Label`], h = x({ tagName: "label" }); + const [a] = t === "hex" ? ["#"] : pe(i).split(""), l = `color_${t}_${i}_${e}`, c = s[`${i}Label`], h = x({ tagName: "label" }); m(h, "for", l), h.append( x({ tagName: "span", @@ -1948,7 +1932,7 @@ const Vt = { }), x({ tagName: "span", - className: Bt, + className: Vt, innerText: c }) ); @@ -1969,7 +1953,7 @@ const Vt = { step: d }), r.append(h, b); }), r; -}, po = (o) => { +}, ho = (o) => { const { format: t, componentLabels: e } = o, { hueLabel: s, alphaLabel: r, lightnessLabel: n, saturationLabel: i, whitenessLabel: a, blacknessLabel: l } = e, c = t === "hsl" ? 360 : 100, h = t === "hsl" ? 100 : 360, b = 100; let u = t === "hsl" ? `${s} & ${n}` : `${n} & ${i}`; u = t === "hwb" ? `${a} & ${l}` : u; @@ -2000,7 +1984,7 @@ const Vt = { max: b } ].forEach(($) => { - const { i: P, c: L, l: S, min: C, max: M } = $, E = x({ + const { i: S, c: L, l: P, min: C, max: M } = $, E = x({ tagName: "div", className: "color-control", role: "presentation" @@ -2008,14 +1992,14 @@ const Vt = { E.append( x({ tagName: "div", - className: `visual-control visual-control${P}` + className: `visual-control visual-control${S}` }) ); const A = x({ tagName: "div", className: `${L} knob`, ariaLive: "polite", - ariaLabel: S, + ariaLabel: P, role: "slider", tabIndex: 0, ariaValueMin: `${C}`, @@ -2024,46 +2008,47 @@ const Vt = { E.append(A), g.append(E); }), g; }, le = (o, t, e) => { - const { input: s, format: r, componentLabels: n } = o, { defaultsLabel: i, presetsLabel: a } = n, l = e === "color-options", c = t instanceof Kt, h = l ? a : i, b = c ? t.colors : t, u = b.length, { lightSteps: d } = c ? t : { lightSteps: null }, g = d || [9, 10].find((A) => u >= A * 2 && !(u % A)) || 5, p = l && u > g; + const { input: s, format: r, componentLabels: n } = o, { defaultsLabel: i, presetsLabel: a } = n, l = e === "color-options", c = t instanceof It, h = l ? a : i, b = c ? t.colors : t, u = b.length, { lightSteps: d } = c ? t : { lightSteps: null }, g = d || [9, 10].find((A) => u >= A * 2 && !(u % A)) || 5, p = l && u > g; let f = 2; f = p && u > g * 2 ? 3 : f, f = p && u > g * 3 ? 4 : f, f = p && u > g * 4 ? 5 : f; const w = f - (u <= g * 3 ? 1 : 2), $ = p && u > w * g; - let P = e; - P += $ ? " scrollable" : "", P += p ? " multiline" : ""; + let S = e; + S += $ ? " scrollable" : "", S += p ? " multiline" : ""; const L = p ? "1px" : "0.25rem"; - let S = p ? 1.75 : 2; - S = g > 5 && p ? 1.5 : S; - const C = `${w * S}rem`, M = `calc(${f} * ${S}rem + ${f - 1} * ${L})`, E = x({ + let P = p ? 1.75 : 2; + P = g > 5 && p ? 1.5 : P; + const C = `${w * P}rem`, M = `calc(${f} * ${P}rem + ${f - 1} * ${L})`, E = x({ tagName: "ul", - className: P, + className: S, role: "listbox", ariaLabel: h }); return $ && D(E, { - "--grid-item-size": `${S}rem`, + "--grid-item-size": `${P}rem`, "--grid-fit": `${g}`, "--grid-gap": L, "--grid-height": C, "--grid-hover-height": M }), b.forEach((A) => { - let [F, tt] = typeof A == "string" ? A.trim().split(":") : []; - A instanceof y && (F = A.toHexString(), tt = F); - const Gt = new y(A instanceof y ? A : F, r).toString() === xt(s, "value"), Pt = x({ + let [F, Q] = typeof A == "string" ? A.trim().split(":") : []; + A instanceof y && (F = A.toHexString(), Q = F); + const Ut = new y(A instanceof y ? A : F, r).toString() === yt(s, "value"), xt = x({ tagName: "li", - className: `color-option${Gt ? " active" : ""}`, - innerText: `${tt || F}`, + className: `color-option${Ut ? " active" : ""}`, + innerText: `${Q || F}`, tabIndex: 0, role: "option", - ariaSelected: Gt ? "true" : "false" + ariaSelected: Ut ? "true" : "false" }); - m(Pt, "data-value", `${F}`), l && D(Pt, { backgroundColor: F }), E.append(Pt); + m(xt, "data-value", `${F}`), l && D(xt, { backgroundColor: F }), E.append(xt); }), E; -}, fo = (o) => { - const { input: t, parent: e, format: s, id: r, componentLabels: n, colorKeywords: i, colorPresets: a } = o, l = xt(t, "value") || "#fff", { nonColors: c } = y, { toggleLabel: h, pickerLabel: b, formatLabel: u, hexLabel: d } = n, g = c.includes(l) ? "#fff" : l; +}, go = (o) => { + const { input: t, parent: e, format: s, id: r, componentLabels: n, colorKeywords: i, colorPresets: a } = o, l = yt(t, "value") || "#fff", { nonColors: c } = y, { toggleLabel: h, pickerLabel: b, formatLabel: u, hexLabel: d } = n, g = c.includes(l) ? "#fff" : l; o.color = new y(g, s); - const p = s === "hex" ? d : fe(s), f = x({ + const p = s === "hex" ? d : pe(s), f = x({ id: `picker-btn-${r}`, tagName: "button", + type: "button", className: "picker-toggle btn-appearance", ariaExpanded: "false", ariaHasPopup: "true" @@ -2071,7 +2056,7 @@ const Vt = { f.append( x({ tagName: "span", - className: Bt, + className: Vt, innerText: `${b}. ${u}: ${p}` }) ); @@ -2080,71 +2065,72 @@ const Vt = { className: "color-dropdown picker", role: "group", ariaLabelledBy: `picker-btn-${r}` - }), $ = po(o), P = bo(o); - if (w.append($, P), t.before(f), e.append(w), i || a) { + }), $ = ho(o), S = co(o); + if (w.append($, S), t.before(f), e.append(w), i || a) { const L = x({ tagName: "div", className: "color-dropdown scrollable menu" }); a && L.append(le(o, a, "color-options")), i && i.length && L.append(le(o, i, "color-defaults")); - const S = x({ + const P = x({ tagName: "button", + type: "button", className: "menu-toggle btn-appearance", tabIndex: -1, ariaExpanded: "false", ariaHasPopup: "true" - }), C = encodeURI("http://www.w3.org/2000/svg"), M = Tt(C, { + }), C = encodeURI("http://www.w3.org/2000/svg"), M = Mt(C, { tagName: "svg" }); - m(M, "xmlns", C), m(M, "viewBox", "0 0 512 512"), m(M, Te, "true"); - const E = Tt(C, { + m(M, "xmlns", C), m(M, "viewBox", "0 0 512 512"), m(M, Ee, "true"); + const E = Mt(C, { tagName: "path" }); - m(E, "d", "M98,158l157,156L411,158l27,27L255,368L71,185L98,158z"), m(E, "fill", "#fff"), M.append(E), S.append( + m(E, "d", "M98,158l157,156L411,158l27,27L255,368L71,185L98,158z"), m(E, "fill", "#fff"), M.append(E), P.append( x({ tagName: "span", - className: Bt, + className: Vt, innerText: `${h}` }), M - ), e.append(S, L); + ), e.append(P, L); } i && c.includes(l) && (o.value = l), m(t, X, "-1"); -}, mo = "2.0.0-alpha9", Y = "color-picker", vo = `[data-function="${Y}"]`, ce = `.${Y}`, wo = { - componentLabels: Vt, - colorLabels: at, +}, uo = "2.0.0-alpha10", Z = "color-picker", bo = `[data-function="${Z}"]`, ce = `.${Z}`, po = { + componentLabels: Kt, + colorLabels: it, format: "rgb", colorPresets: !1, colorKeywords: !1 -}, { roundPart: k, nonColors: pt } = y, $o = (o) => to(o, Y), ko = (o) => new yo(o), he = (o, t) => { - const e = t ? be : jt, { input: s, pickerToggle: r, menuToggle: n } = o; - e(s, De, o.showPicker), e(r, Mt, o.togglePicker), n && e(n, Mt, o.toggleMenu); -}, Ee = (o, t) => { - const e = t ? be : jt, { input: s, colorMenu: r, parent: n } = o, i = V(s), a = lo(i); - e(o.controls, Ke, o.pointerDown), o.controlKnobs.forEach((l) => e(l, _t, o.handleKnobs)), e(a, je, o.handleScroll), e(a, Be, o.update), [s, ...o.inputs].forEach((l) => e(l, Re, o.changeHandler)), r && (e(r, Mt, o.menuClickHandler), e(r, _t, o.menuKeyHandler)), e(i, pe, o.pointerMove), e(i, Ve, o.pointerUp), e(n, Fe, o.handleFocusOut), e(i, Ie, o.handleDismiss); +}, { roundPart: k, nonColors: bt } = y, fo = (o) => Xe(o, Z), mo = (o) => new vo(o), he = (o, t) => { + const e = t ? Bt : jt, { input: s, pickerToggle: r, menuToggle: n } = o; + e(s, Re, o.showPicker), e(r, Et, o.togglePicker), n && e(n, Et, o.toggleMenu); +}, He = (o, t) => { + const e = t ? Bt : jt, { input: s, colorMenu: r, parent: n } = o, i = V(s), a = ro(i); + e(o.controls, Fe, o.pointerDown), o.controlKnobs.forEach((l) => e(l, zt, o.handleKnobs)), e(a, Ve, o.handleScroll), e(a, Ke, o.update), [s, ...o.inputs].forEach((l) => e(l, Me, o.changeHandler)), r && (e(r, Et, o.menuClickHandler), e(r, zt, o.menuKeyHandler)), e(i, ue, o.pointerMove), e(i, Ie, o.pointerUp), e(n, Oe, o.handleFocusOut), e(i, De, o.handleDismiss); }, ge = (o) => { - oo(o.input, new CustomEvent("colorpicker.change")); -}, Me = (o) => { + Ye(o.input, new CustomEvent("colorpicker.change")); +}, Ne = (o) => { o && ["bottom", "top"].forEach((t) => O(o, t)); -}, Nt = (o, t) => { +}, Ht = (o, t) => { const { colorPicker: e, colorMenu: s, menuToggle: r, pickerToggle: n, parent: i } = o, a = t === e, l = a ? s : e, c = a ? r : n, h = a ? n : r; - T(i, "open") || q(i, "open"), l && (O(l, "show"), Me(l)), q(t, "bottom"), io(t), q(t, "show"), a && o.update(), o.isOpen || (Ee(o, !0), o.updateDropdownPosition(), o.isOpen = !0, m(o.input, X, "0"), r && m(r, X, "0")), m(h, Et, "true"), c && m(c, Et, "false"); + T(i, "open") || q(i, "open"), l && (O(l, "show"), Ne(l)), q(t, "bottom"), oo(t), q(t, "show"), a && o.update(), o.isOpen || (He(o, !0), o.updateDropdownPosition(), o.isOpen = !0, m(o.input, X, "0"), r && m(r, X, "0")), m(h, Nt, "true"), c && m(c, Nt, "false"); }; -class yo { +class vo { // bring utils to staic static Color = y; - static ColorPalette = Kt; - static getInstance = $o; - static init = ko; - static selector = vo; + static ColorPalette = It; + static getInstance = fo; + static init = mo; + static selector = bo; // utils important for render static roundPart = k; static setElementStyle = D; static setAttribute = m; - static getBoundingClientRect = ut; - static version = mo; - static colorNames = at; - static colorPickerLabels = Vt; + static getBoundingClientRect = gt; + static version = uo; + static colorNames = it; + static colorPickerLabels = Kt; id; input; color; @@ -2153,7 +2139,7 @@ class yo { dragElement; isOpen = !1; controlPositions; - colorLabels = Yt(at.map((t) => [t, t])); + colorLabels = Yt(it.map((t) => [t, t])); colorKeywords; colorPresets; componentLabels; @@ -2173,41 +2159,41 @@ class yo { * @param config instance options */ constructor(t, e) { - const s = _(t); + const s = z(t); if (typeof t > "u") throw new TypeError("ColorPicker target not specified."); if (B(t) && !s) throw new TypeError(`ColorPicker target "${t}" cannot be found.`); this.input = s; - const r = ve(s, ce); + const r = fe(s, ce); if (!r) throw new TypeError("ColorPicker requires a specific markup to work."); - this.parent = r, this.id = me(s, Y), this.dragElement = void 0, this.isOpen = !1, this.controlPositions = { + this.parent = r, this.id = de(s, Z), this.dragElement = void 0, this.isOpen = !1, this.controlPositions = { c1x: 0, c1y: 0, c2y: 0, c3y: 0 }, this.colorKeywords = !1, this.colorPresets = !1; - const { format: n, componentLabels: i, colorLabels: a, colorKeywords: l, colorPresets: c } = no( + const { format: n, componentLabels: i, colorLabels: a, colorKeywords: l, colorPresets: c } = eo( s, - wo, + po, e || {} ); - let h = at; - At(a) && a.length === 17 ? h = a : B(a) && a.split(",").length === 17 && (h = a.split(",")), K(this.colorLabels, Yt(h.map((p, f) => [at[f], p]))); + let h = it; + Lt(a) && a.length === 17 ? h = a : B(a) && a.split(",").length === 17 && (h = a.split(",")), K(this.colorLabels, Yt(h.map((p, f) => [it[f], p]))); const b = B(i) && ae(i) ? JSON.parse(i) : i; - if (this.componentLabels = K({ ...Vt }, b), this.color = new y(s.value || "#fff", n), this.format = n, At(l) && l.length ? this.colorKeywords = l : B(l) && l.length && (this.colorKeywords = l.split(",").map((p) => p.trim())), At(c) && c.length) + if (this.componentLabels = K({ ...Kt }, b), this.color = new y(s.value || "#fff", n), this.format = n, Lt(l) && l.length ? this.colorKeywords = l : B(l) && l.length && (this.colorKeywords = l.split(",").map((p) => p.trim())), Lt(c) && c.length) this.colorPresets = c; else if (c && ae(c)) { const { hue: p, hueSteps: f, lightSteps: w, saturation: $ } = JSON.parse(c); - this.colorPresets = new Kt(p, f, w, $); + this.colorPresets = new It(p, f, w, $); } else B(c) && (this.colorPresets = c.split(",").map((p) => p.trim())); - fo(this); - const [u, d] = rt("color-dropdown", r); - this.pickerToggle = _(".picker-toggle", r), this.menuToggle = _(".menu-toggle", r), this.colorPicker = u, this.colorMenu = d, this.inputs = [...rt("color-input", r)]; - const [g] = rt("color-controls", r); - this.controls = g, this.controlKnobs = [...rt("knob", g)], this.visuals = [...rt("visual-control", g)], this.update(), he(this, !0), ht.set(s, Y, this); + go(this); + const [u, d] = st("color-dropdown", r); + this.pickerToggle = z(".picker-toggle", r), this.menuToggle = z(".menu-toggle", r), this.colorPicker = u, this.colorMenu = d, this.inputs = [...st("color-input", r)]; + const [g] = st("color-controls", r); + this.controls = g, this.controlKnobs = [...st("knob", g)], this.visuals = [...st("visual-control", g)], this.update(), he(this, !0), ct.set(s, Z, this); } /** Returns the current colour value */ get value() { @@ -2223,7 +2209,7 @@ class yo { } /** Check if the colour presets include any non-colour. */ get hasNonColor() { - return this.colorKeywords instanceof Array && this.colorKeywords.some((t) => pt.includes(t)); + return this.colorKeywords instanceof Array && this.colorKeywords.some((t) => bt.includes(t)); } /** Returns hexadecimal value of the current colour. */ get hex() { @@ -2320,7 +2306,7 @@ class yo { * @this {ColorPicker} */ handleDismiss = ({ code: t }) => { - this.isOpen && t === Ge && this.hide(); + this.isOpen && t === qe && this.hide(); }; /** * The `ColorPicker` *scroll* event listener when open. @@ -2329,7 +2315,7 @@ class yo { */ handleScroll = (t) => { const { activeElement: e } = V(this.input); - this.updateDropdownPosition(), ([pe, qe].includes(t.type) && this.dragElement || e && this.controlKnobs.includes(e)) && (t.stopPropagation(), t.preventDefault()); + this.updateDropdownPosition(), ([ue, Be].includes(t.type) && this.dragElement || e && this.controlKnobs.includes(e)) && (t.stopPropagation(), t.preventDefault()); }; /** * The `ColorPicker` keyboard event listener for menu navigation. @@ -2337,8 +2323,8 @@ class yo { * @param e */ menuKeyHandler = (t) => { - const { target: e, code: s } = t, { previousElementSibling: r, nextElementSibling: n, parentElement: i } = e, a = i && T(i, "color-options"), l = i ? [...i.children] : [], c = a && Rt(i, "grid-template-columns").split(" ").length, h = l.indexOf(e), b = h > -1 && c && l[h - c], u = h > -1 && c && l[h + c]; - [j, st, Wt].includes(s) && t.preventDefault(), a ? b && s === st ? U(b) : u && s === j ? U(u) : r && s === gt ? U(r) : n && s === G && U(n) : r && [gt, st].includes(s) ? U(r) : n && [G, j].includes(s) && U(n), [ze, Wt].includes(s) && this.menuClickHandler(t); + const { target: e, code: s } = t, { previousElementSibling: r, nextElementSibling: n, parentElement: i } = e, a = i && T(i, "color-options"), l = i ? [...i.children] : [], c = a && Tt(i, "grid-template-columns").split(" ").length, h = l.indexOf(e), b = h > -1 && c && l[h - c], u = h > -1 && c && l[h + c]; + [j, ot, Wt].includes(s) && t.preventDefault(), a ? b && s === ot ? _(b) : u && s === j ? _(u) : r && s === ht ? _(r) : n && s === U && _(n) : r && [ht, ot].includes(s) ? _(r) : n && [U, j].includes(s) && _(n), [je, Wt].includes(s) && this.menuClickHandler(t); }; /** * The `ColorPicker` click event listener for the colour menu presets / defaults. @@ -2347,19 +2333,19 @@ class yo { * @this {ColorPicker} */ menuClickHandler = (t) => { - const { target: e } = t, { colorMenu: s } = this, r = (xt(e, "data-value") || "").trim(); + const { target: e } = t, { colorMenu: s } = this, r = (yt(e, "data-value") || "").trim(); if (!r.length) return; - const n = _("li.active", s); + const n = z("li.active", s); let i = r; - i = pt.includes(i) ? "white" : i, i = i === "transparent" ? "rgba(0,0,0,0)" : i; + i = bt.includes(i) ? "white" : i, i = i === "transparent" ? "rgba(0,0,0,0)" : i; const { r: a, g: l, b: c, a: h } = new y(i); K(this.color, { r: a, g: l, b: c, a: h - }), this.update(), n !== e && (n && (O(n, "active"), Ct(n, St)), q(e, "active"), m(e, St, "true"), pt.includes(r) && (this.value = r), ge(this)); + }), this.update(), n !== e && (n && (O(n, "active"), Pt(n, St)), q(e, "active"), m(e, St, "true"), bt.includes(r) && (this.value = r), ge(this)); }; /** * The `ColorPicker` *touchstart* / *mousedown* events listener for control knobs. @@ -2369,10 +2355,10 @@ class yo { pointerDown = (t) => { if (t.button !== 0) return; - const { target: e, pageX: s, pageY: r } = t, { colorMenu: n, visuals: i, controlKnobs: a } = this, [l, c, h] = i, [b, u, d] = a, g = a.includes(e) ? e.previousElementSibling : e, p = ut(g), f = Lt(l), w = s - f.scrollLeft - p.left, $ = r - f.scrollTop - p.top; + const { target: e, pageX: s, pageY: r } = t, { colorMenu: n, visuals: i, controlKnobs: a } = this, [l, c, h] = i, [b, u, d] = a, g = a.includes(e) ? e.previousElementSibling : e, p = gt(g), f = Ct(l), w = s - f.scrollLeft - p.left, $ = r - f.scrollTop - p.top; if (e === l || e === b ? (this.dragElement = g, this.changeControl1(w, $)) : e === c || e === u ? (this.dragElement = g, this.changeControl2($)) : (e === h || e === d) && (this.dragElement = g, this.changeAlpha($)), n) { - const P = _("li.active", n); - P && (O(P, "active"), Ct(P, St)); + const S = z("li.active", n); + S && (O(S, "active"), Pt(S, St)); } t.preventDefault(); }; @@ -2383,7 +2369,7 @@ class yo { * @this */ pointerUp = ({ target: t }) => { - const { parent: e } = this, s = V(e), r = _(`${ce}.open`, s) !== null, n = s.getSelection(); + const { parent: e } = this, s = V(e), r = z(`${ce}.open`, s) !== null, n = s.getSelection(); !this.dragElement && (!n || !n.toString().length) && !e.contains(t) && this.hide(r), this.dragElement = void 0; }; /** @@ -2395,7 +2381,7 @@ class yo { const { dragElement: e, visuals: s } = this, [r, n, i] = s, { pageX: a, pageY: l } = t; if (!e) return; - const c = ut(e), h = Lt(r), b = a - h.scrollLeft - c.left, u = l - h.scrollTop - c.top; + const c = gt(e), h = Ct(r), b = a - h.scrollLeft - c.left, u = l - h.scrollTop - c.top; e === r && this.changeControl1(b, u), e === n && this.changeControl2(u), e === i && this.changeAlpha(u); }; /** @@ -2405,7 +2391,7 @@ class yo { */ handleKnobs = (t) => { const { target: e, code: s } = t; - if (![st, j, gt, G].includes(s)) + if (![ot, j, ht, U].includes(s)) return; t.preventDefault(); const { controlKnobs: r, visuals: n } = this, { offsetWidth: i, offsetHeight: a } = n[0], [l, c, h] = r, { activeElement: b } = V(l), u = r.find((g) => g === b), d = a / 360; @@ -2413,16 +2399,16 @@ class yo { let g = 0, p = 0; if (e === l) { const f = i / 100; - [gt, G].includes(s) ? this.controlPositions.c1x += s === G ? f : -f : [st, j].includes(s) && (this.controlPositions.c1y += s === j ? d : -d), g = this.controlPositions.c1x, p = this.controlPositions.c1y, this.changeControl1(g, p); + [ht, U].includes(s) ? this.controlPositions.c1x += s === U ? f : -f : [ot, j].includes(s) && (this.controlPositions.c1y += s === j ? d : -d), g = this.controlPositions.c1x, p = this.controlPositions.c1y, this.changeControl1(g, p); } else - e === c ? (this.controlPositions.c2y += [j, G].includes(s) ? d : -d, p = this.controlPositions.c2y, this.changeControl2(p)) : e === h && (this.controlPositions.c3y += [j, G].includes(s) ? d : -d, p = this.controlPositions.c3y, this.changeAlpha(p)); + e === c ? (this.controlPositions.c2y += [j, U].includes(s) ? d : -d, p = this.controlPositions.c2y, this.changeControl2(p)) : e === h && (this.controlPositions.c3y += [j, U].includes(s) ? d : -d, p = this.controlPositions.c3y, this.changeAlpha(p)); this.handleScroll(t); } }; /** The event listener of the colour form inputs. */ changeHandler = () => { let t; - const { inputs: e, format: s, value: r, input: n, controlPositions: i, visuals: a } = this, { activeElement: l } = V(n), { offsetHeight: c } = a[0], [h, , , b] = e, [u, d, g, p] = s === "rgb" ? e.map(($) => parseFloat($.value) / ($ === b ? 100 : 1)) : e.map(($) => parseFloat($.value) / ($ !== h ? 100 : 360)), f = this.hasNonColor && pt.includes(r), w = b ? p : 1 - i.c3y / c; + const { inputs: e, format: s, value: r, input: n, controlPositions: i, visuals: a } = this, { activeElement: l } = V(n), { offsetHeight: c } = a[0], [h, , , b] = e, [u, d, g, p] = s === "rgb" ? e.map(($) => parseFloat($.value) / ($ === b ? 100 : 1)) : e.map(($) => parseFloat($.value) / ($ !== h ? 100 : 360)), f = this.hasNonColor && bt.includes(r), w = b ? p : 1 - i.c3y / c; if (l === n || l && e.includes(l)) { l === n ? f ? t = r === "transparent" ? "rgba(0,0,0,0)" : "rgb(0,0,0)" : t = r : s === "hex" ? t = h.value : s === "hsl" ? t = { h: u, @@ -2440,12 +2426,12 @@ class yo { b: g, a: w }; - const { r: $, g: P, b: L, a: S } = new y(t); + const { r: $, g: S, b: L, a: P } = new y(t); K(this.color, { r: $, - g: P, + g: S, b: L, - a: S + a: P }), this.setControlPositions(), this.updateAppearance(), this.updateInputs(), this.updateControls(), this.updateVisuals(), l === n && f && (this.value = r); } }; @@ -2521,7 +2507,7 @@ class yo { }; /** Updates the open dropdown position on *scroll* event. */ updateDropdownPosition() { - const { input: t, colorPicker: e, colorMenu: s } = this, r = ut(t), { top: n, bottom: i } = r, { offsetHeight: a } = t, l = Lt(t).clientHeight, h = T(e, "show") ? e : s; + const { input: t, colorPicker: e, colorMenu: s } = this, r = gt(t), { top: n, bottom: i } = r, { offsetHeight: a } = t, l = Ct(t).clientHeight, h = T(e, "show") ? e : s; if (!h) return; const { offsetHeight: b } = h, u = l - i, d = n, g = n + b + a > l, p = n - b < 0; @@ -2536,15 +2522,15 @@ class yo { updateAppearance() { const { componentLabels: t, color: e, parent: s, hsv: r, hex: n, format: i, controlKnobs: a } = this, { appearanceLabel: l, hexLabel: c, valueLabel: h } = t; let { r: b, g: u, b: d } = e.toRgb(); - const [g, p, f] = a, w = k(r.h * 360), $ = e.a, P = k(r.s * 100), L = k(r.v * 100), S = this.appearance; + const [g, p, f] = a, w = k(r.h * 360), $ = e.a, S = k(r.s * 100), L = k(r.v * 100), P = this.appearance; let C = `${c} ${n.split("").join(" ")}`; if (i === "hwb") { - const { hwb: A } = this, F = k(A.w * 100), tt = k(A.b * 100); - C = `HWB: ${w}°, ${F}%, ${tt}%`, m(g, ot, `${F}% & ${tt}%`), m(g, et, `${F}`), m(p, Ut, `${h}: ${C}. ${l}: ${S}.`), m(p, ot, `${w}%`), m(p, et, `${w}`); + const { hwb: A } = this, F = k(A.w * 100), Q = k(A.b * 100); + C = `HWB: ${w}°, ${F}%, ${Q}%`, m(g, et, `${F}% & ${Q}%`), m(g, tt, `${F}`), m(p, _t, `${h}: ${C}. ${l}: ${P}.`), m(p, et, `${w}%`), m(p, tt, `${w}`); } else - [b, u, d] = [b, u, d].map(k), C = i === "hsl" ? `HSL: ${w}°, ${P}%, ${L}%` : C, C = i === "rgb" ? `RGB: ${b}, ${u}, ${d}` : C, m(g, ot, `${L}% & ${P}%`), m(g, et, `${L}`), m(p, Ut, `${h}: ${C}. ${l}: ${S}.`), m(p, ot, `${w}°`), m(p, et, `${w}`); + [b, u, d] = [b, u, d].map(k), C = i === "hsl" ? `HSL: ${w}°, ${S}%, ${L}%` : C, C = i === "rgb" ? `RGB: ${b}, ${u}, ${d}` : C, m(g, et, `${L}% & ${S}%`), m(g, tt, `${L}`), m(p, _t, `${h}: ${C}. ${l}: ${P}.`), m(p, et, `${w}°`), m(p, tt, `${w}`); const M = k($ * 100); - m(f, ot, `${M}%`), m(f, et, `${M}`); + m(f, et, `${M}%`), m(f, tt, `${M}`); const E = e.toString(); D(this.input, { backgroundColor: E }), this.isDark ? (T(s, "txt-light") && O(s, "txt-light"), T(s, "txt-dark") || q(s, "txt-dark")) : (T(s, "txt-dark") && O(s, "txt-dark"), T(s, "txt-light") || q(s, "txt-light")); } @@ -2587,12 +2573,12 @@ class yo { togglePicker = (t) => { t && t.preventDefault(); const { colorPicker: e } = this; - this.isOpen && T(e, "show") ? this.hide(!0) : Nt(this, e); + this.isOpen && T(e, "show") ? this.hide(!0) : Ht(this, e); }; /** Shows the `ColorPicker` dropdown. */ showPicker = () => { const { colorPicker: t } = this; - ["top", "bottom"].some((e) => T(t, e)) || Nt(this, t); + ["top", "bottom"].some((e) => T(t, e)) || Ht(this, t); }; /** * Toggles the visibility of the `ColorPicker` presets menu. @@ -2603,7 +2589,7 @@ class yo { toggleMenu = (t) => { t && t.preventDefault(); const { colorMenu: e } = this; - this.isOpen && T(e, "show") ? this.hide(!0) : Nt(this, e); + this.isOpen && T(e, "show") ? this.hide(!0) : Ht(this, e); }; /** * Hides the currently open `ColorPicker` dropdown. @@ -2612,10 +2598,10 @@ class yo { */ hide(t) { if (this.isOpen) { - const { pickerToggle: e, menuToggle: s, colorPicker: r, colorMenu: n, parent: i, input: a } = this, l = T(r, "show"), c = l ? r : n, h = l ? e : s, b = c && so(c); - this.value = this.color.toString(!0), c && (O(c, "show"), m(h, Et, "false"), setTimeout(() => { - Me(c), _(".show", i) || (O(i, "open"), Ee(this), this.isOpen = !1); - }, b)), t || U(e), m(a, X, "-1"), h === s && m(s, X, "-1"); + const { pickerToggle: e, menuToggle: s, colorPicker: r, colorMenu: n, parent: i, input: a } = this, l = T(r, "show"), c = l ? r : n, h = l ? e : s, b = c && Qe(c); + this.value = this.color.toString(!0), c && (O(c, "show"), m(h, Nt, "false"), setTimeout(() => { + Ne(c), z(".show", i) || (O(i, "open"), He(this), this.isOpen = !1); + }, b)), t || _(e), m(a, X, "-1"), h === s && m(s, X, "-1"); } } /** Removes `ColorPicker` from target ``. */ @@ -2623,10 +2609,10 @@ class yo { const { input: t, parent: e } = this; this.hide(!0), he(this), [...e.children].forEach((s) => { s !== t && s.remove(); - }), Ct(t, X), D(t, { backgroundColor: "" }), ["txt-light", "txt-dark"].forEach((s) => O(e, s)), ht.remove(t, Y); + }), Pt(t, X), D(t, { backgroundColor: "" }), ["txt-light", "txt-dark"].forEach((s) => O(e, s)), ct.remove(t, Z); } } export { - yo as default + vo as default }; //# sourceMappingURL=color-picker.mjs.map diff --git a/dist/js/color-picker.mjs.map b/dist/js/color-picker.mjs.map index ec64270..e6be578 100644 --- a/dist/js/color-picker.mjs.map +++ b/dist/js/color-picker.mjs.map @@ -1 +1 @@ -{"version":3,"file":"color-picker.mjs","sources":["../../node_modules/.pnpm/@thednp+event-listener@2.0.2/node_modules/@thednp/event-listener/dist/event-listener.mjs","../../node_modules/.pnpm/@thednp+shorty@2.0.0-alpha17/node_modules/@thednp/shorty/dist/shorty.mjs","../../node_modules/.pnpm/@thednp+color@1.0.8/node_modules/@thednp/color/dist/index.mjs","../../src/ts/colorPalette.ts","../../src/ts/util/colorPickerLabels.ts","../../src/ts/util/colorNames.ts","../../src/ts/util/isValidJSON.ts","../../src/ts/util/vHidden.ts","../../src/ts/util/getColorForm.ts","../../src/ts/util/getColorControls.ts","../../src/ts/util/getColorMenu.ts","../../src/ts/util/setMarkup.ts","../../src/ts/index.ts"],"sourcesContent":["const e = {}, f = (t) => {\n const { type: c, currentTarget: i } = t;\n [...e[c]].forEach(([n, s]) => {\n i === n && [...s].forEach(([o, a]) => {\n o.apply(n, [t]), typeof a == \"object\" && a.once && r(n, c, o, a);\n });\n });\n}, E = (t, c, i, n) => {\n e[c] || (e[c] = /* @__PURE__ */ new Map());\n const s = e[c];\n s.has(t) || s.set(t, /* @__PURE__ */ new Map());\n const o = s.get(t), { size: a } = o;\n o.set(i, n), a || t.addEventListener(c, f, n);\n}, r = (t, c, i, n) => {\n const s = e[c], o = s && s.get(t), a = o && o.get(i), d = a !== void 0 ? a : n;\n o && o.has(i) && o.delete(i), s && (!o || !o.size) && s.delete(t), (!s || !s.size) && delete e[c], (!o || !o.size) && t.removeEventListener(c, f, d);\n}, g = E, M = r;\nexport {\n E as addListener,\n f as globalListener,\n M as off,\n g as on,\n e as registry,\n r as removeListener\n};\n//# sourceMappingURL=event-listener.mjs.map\n","const pe = \"aria-checked\", me = \"aria-description\", fe = \"aria-describedby\", ge = \"aria-expanded\", ve = \"aria-haspopup\", Ee = \"aria-hidden\", be = \"aria-label\", he = \"aria-labelledby\", ye = \"aria-modal\", we = \"aria-pressed\", Ae = \"aria-selected\", Se = \"aria-valuemin\", Me = \"aria-valuemax\", Ne = \"aria-valuenow\", ke = \"aria-valuetext\", q = \"abort\", G = \"beforeunload\", J = \"blur\", K = \"change\", X = \"contextmenu\", P = \"DOMContentLoaded\", Y = \"DOMMouseScroll\", Z = \"error\", $ = \"focus\", _ = \"focusin\", tt = \"focusout\", et = \"gesturechange\", nt = \"gestureend\", ot = \"gesturestart\", st = \"keydown\", ct = \"keypress\", rt = \"keyup\", at = \"load\", it = \"click\", ut = \"dblclick\", lt = \"mousedown\", dt = \"mouseup\", pt = \"hover\", mt = \"mouseenter\", ft = \"mouseleave\", gt = \"mousein\", vt = \"mouseout\", Et = \"mouseover\", bt = \"mousemove\", ht = \"mousewheel\", yt = \"move\", wt = \"orientationchange\", At = \"pointercancel\", St = \"pointerdown\", Mt = \"pointerleave\", Nt = \"pointermove\", kt = \"pointerup\", Tt = \"readystatechange\", Dt = \"reset\", Ct = \"resize\", Ot = \"select\", Lt = \"selectend\", It = \"selectstart\", zt = \"scroll\", xt = \"submit\", Vt = \"touchstart\", Bt = \"touchmove\", Ht = \"touchcancel\", Pt = \"touchend\", Ft = \"unload\", Te = {\n DOMContentLoaded: P,\n DOMMouseScroll: Y,\n abort: q,\n beforeunload: G,\n blur: J,\n change: K,\n click: it,\n contextmenu: X,\n dblclick: ut,\n error: Z,\n focus: $,\n focusin: _,\n focusout: tt,\n gesturechange: et,\n gestureend: nt,\n gesturestart: ot,\n hover: pt,\n keydown: st,\n keypress: ct,\n keyup: rt,\n load: at,\n mousedown: lt,\n mousemove: bt,\n mousein: gt,\n mouseout: vt,\n mouseenter: mt,\n mouseleave: ft,\n mouseover: Et,\n mouseup: dt,\n mousewheel: ht,\n move: yt,\n orientationchange: wt,\n pointercancel: At,\n pointerdown: St,\n pointerleave: Mt,\n pointermove: Nt,\n pointerup: kt,\n readystatechange: Tt,\n reset: Dt,\n resize: Ct,\n scroll: zt,\n select: Ot,\n selectend: Lt,\n selectstart: It,\n submit: xt,\n touchcancel: Ht,\n touchend: Pt,\n touchmove: Bt,\n touchstart: Vt,\n unload: Ft\n}, De = \"drag\", Ce = \"dragstart\", Oe = \"dragenter\", Le = \"dragleave\", Ie = \"dragover\", ze = \"dragend\", xe = \"loadstart\", Ve = {\n start: \"mousedown\",\n end: \"mouseup\",\n move: \"mousemove\",\n cancel: \"mouseleave\"\n}, Be = { down: \"mousedown\", up: \"mouseup\" }, He = \"onmouseleave\" in document ? [\"mouseenter\", \"mouseleave\"] : (\n /* istanbul ignore next */\n [\"mouseover\", \"mouseout\"]\n), Pe = {\n start: \"touchstart\",\n end: \"touchend\",\n move: \"touchmove\",\n cancel: \"touchcancel\"\n}, Fe = { in: \"focusin\", out: \"focusout\" }, Ue = {\n Backspace: \"Backspace\",\n // 8\n Tab: \"Tab\",\n // 9\n Enter: \"Enter\",\n // 13\n Shift: \"Shift\",\n // 16\n Control: \"Control\",\n // 17\n Alt: \"Alt\",\n // 18\n Pause: \"Pause\",\n // 19\n CapsLock: \"CapsLock\",\n // 20\n Escape: \"Escape\",\n // 27\n Scape: \"Space\",\n // 32\n ArrowLeft: \"ArrowLeft\",\n // 37\n ArrowUp: \"ArrowUp\",\n // 38\n ArrowRight: \"ArrowRight\",\n // 39\n ArrowDown: \"ArrowDown\",\n // 40\n Insert: \"Insert\",\n // 45\n Delete: \"Delete\",\n // 46\n Meta: \"Meta\",\n // 91 windows key\n ContextMenu: \"ContextMenu\",\n // 93\n ScrollLock: \"ScrollLock\"\n // 145\n}, We = \"Alt\", Re = \"ArrowDown\", Qe = \"ArrowUp\", je = \"ArrowLeft\", qe = \"ArrowRight\", Ge = \"Backspace\", Je = \"CapsLock\", Ke = \"Control\", Xe = \"Delete\", Ye = \"Enter\", Ze = \"Escape\", $e = \"Insert\", _e = \"Meta\", tn = \"Pause\", en = \"ScrollLock\", nn = \"Shift\", on = \"Space\", sn = \"Tab\", Ut = \"animationDuration\", Wt = \"animationDelay\", F = \"animationName\", D = \"animationend\", Rt = \"transitionDuration\", Qt = \"transitionDelay\", C = \"transitionend\", U = \"transitionProperty\", cn = \"addEventListener\", rn = \"removeEventListener\", an = {\n linear: \"linear\",\n easingSinusoidalIn: \"cubic-bezier(0.47,0,0.745,0.715)\",\n easingSinusoidalOut: \"cubic-bezier(0.39,0.575,0.565,1)\",\n easingSinusoidalInOut: \"cubic-bezier(0.445,0.05,0.55,0.95)\",\n easingQuadraticIn: \"cubic-bezier(0.550,0.085,0.680,0.530)\",\n easingQuadraticOut: \"cubic-bezier(0.250,0.460,0.450,0.940)\",\n easingQuadraticInOut: \"cubic-bezier(0.455,0.030,0.515,0.955)\",\n easingCubicIn: \"cubic-bezier(0.55,0.055,0.675,0.19)\",\n easingCubicOut: \"cubic-bezier(0.215,0.61,0.355,1)\",\n easingCubicInOut: \"cubic-bezier(0.645,0.045,0.355,1)\",\n easingQuarticIn: \"cubic-bezier(0.895,0.03,0.685,0.22)\",\n easingQuarticOut: \"cubic-bezier(0.165,0.84,0.44,1)\",\n easingQuarticInOut: \"cubic-bezier(0.77,0,0.175,1)\",\n easingQuinticIn: \"cubic-bezier(0.755,0.05,0.855,0.06)\",\n easingQuinticOut: \"cubic-bezier(0.23,1,0.32,1)\",\n easingQuinticInOut: \"cubic-bezier(0.86,0,0.07,1)\",\n easingExponentialIn: \"cubic-bezier(0.95,0.05,0.795,0.035)\",\n easingExponentialOut: \"cubic-bezier(0.19,1,0.22,1)\",\n easingExponentialInOut: \"cubic-bezier(1,0,0,1)\",\n easingCircularIn: \"cubic-bezier(0.6,0.04,0.98,0.335)\",\n easingCircularOut: \"cubic-bezier(0.075,0.82,0.165,1)\",\n easingCircularInOut: \"cubic-bezier(0.785,0.135,0.15,0.86)\",\n easingBackIn: \"cubic-bezier(0.6,-0.28,0.735,0.045)\",\n easingBackOut: \"cubic-bezier(0.175,0.885,0.32,1.275)\",\n easingBackInOut: \"cubic-bezier(0.68,-0.55,0.265,1.55)\"\n}, un = \"offsetHeight\", ln = \"offsetWidth\", dn = \"scrollHeight\", pn = \"scrollWidth\", mn = \"tabindex\", jt = navigator.userAgentData, A = jt, { userAgent: qt } = navigator, S = qt, z = /iPhone|iPad|iPod|Android/i;\nlet O = !1;\nA ? O = A.brands.some((t) => z.test(t.brand)) : O = z.test(S);\nconst fn = O, x = /(iPhone|iPod|iPad)/, gn = A ? A.brands.some((t) => x.test(t.brand)) : (\n /* istanbul ignore next */\n x.test(S)\n), vn = S ? S.includes(\"Firefox\") : (\n /* istanbul ignore next */\n !1\n), { head: M } = document, En = [\"webkitPerspective\", \"perspective\"].some((t) => t in M.style), Gt = (t, e, n, o) => {\n const s = o || !1;\n t.addEventListener(e, n, s);\n}, Jt = (t, e, n, o) => {\n const s = o || !1;\n t.removeEventListener(e, n, s);\n}, Kt = (t, e, n, o) => {\n const s = (r) => {\n (r.target === t || r.currentTarget === t) && (n.apply(t, [r]), Jt(t, e, s, o));\n };\n Gt(t, e, s, o);\n}, Xt = () => {\n}, bn = (() => {\n let t = !1;\n try {\n const e = Object.defineProperty({}, \"passive\", {\n get: () => (t = !0, t)\n });\n Kt(document, P, Xt, e);\n } catch {\n }\n return t;\n})(), hn = [\"webkitTransform\", \"transform\"].some((t) => t in M.style), yn = \"ontouchstart\" in window || /* istanbul ignore next */\n\"msMaxTouchPoints\" in navigator, wn = [\"webkitAnimation\", \"animation\"].some((t) => t in M.style), An = [\"webkitTransition\", \"transition\"].some((t) => t in M.style), Yt = (t, e) => t.getAttribute(e), Sn = (t, e, n) => e.getAttributeNS(t, n), Mn = (t, e) => t.hasAttribute(e), Nn = (t, e, n) => e.hasAttributeNS(t, n), kn = (t, e, n) => t.setAttribute(e, n), Tn = (t, e, n, o) => e.setAttributeNS(t, n, o), Dn = (t, e) => t.removeAttribute(e), Cn = (t, e, n) => e.removeAttributeNS(t, n), On = (t, ...e) => {\n t.classList.add(...e);\n}, Ln = (t, ...e) => {\n t.classList.remove(...e);\n}, In = (t, e) => t.classList.contains(e), { body: zn } = document, { documentElement: xn } = document, Vn = (t) => Array.from(t), v = (t) => t != null && typeof t == \"object\" || !1, i = (t) => v(t) && typeof t.nodeType == \"number\" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some((e) => t.nodeType === e) || !1, u = (t) => i(t) && t.nodeType === 1 || !1, E = /* @__PURE__ */ new Map(), L = {\n data: E,\n /**\n * Sets web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @param instance the component instance\n */\n set: (t, e, n) => {\n if (!u(t))\n return;\n E.has(e) || E.set(e, /* @__PURE__ */ new Map()), E.get(e).set(t, n);\n },\n /**\n * Returns all instances for specified component.\n *\n * @param component the component's name or a unique key\n * @returns all the component instances\n */\n getAllFor: (t) => E.get(t) || null,\n /**\n * Returns the instance associated with the target.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @returns the instance\n */\n get: (t, e) => {\n if (!u(t) || !e)\n return null;\n const n = L.getAllFor(e);\n return t && n && n.get(t) || null;\n },\n /**\n * Removes web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n */\n remove: (t, e) => {\n const n = L.getAllFor(e);\n !n || !u(t) || (n.delete(t), n.size === 0 && E.delete(e));\n }\n}, Bn = (t, e) => L.get(t, e), N = (t) => typeof t == \"string\" || !1, W = (t) => v(t) && t.constructor.name === \"Window\" || !1, R = (t) => i(t) && t.nodeType === 9 || !1, d = (t) => W(t) ? t.document : R(t) ? t : i(t) ? t.ownerDocument : window.document, k = (t, ...e) => Object.assign(t, ...e), Zt = (t) => {\n if (!t)\n return;\n if (N(t))\n return d().createElement(t);\n const { tagName: e } = t, n = Zt(e);\n if (!n)\n return;\n const o = { ...t };\n return delete o.tagName, k(n, o);\n}, $t = (t, e) => {\n if (!t || !e)\n return;\n if (N(e))\n return d().createElementNS(t, e);\n const { tagName: n } = e, o = $t(t, n);\n if (!o)\n return;\n const s = { ...e };\n return delete s.tagName, k(o, s);\n}, Q = (t, e) => t.dispatchEvent(e), Hn = (t, e, n) => n.indexOf(t) === e, g = (t, e) => {\n const n = getComputedStyle(t), o = e.replace(\"webkit\", \"Webkit\").replace(/([A-Z])/g, \"-$1\").toLowerCase();\n return n.getPropertyValue(o);\n}, _t = (t) => {\n const e = g(t, F), n = g(t, Wt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, te = (t) => {\n const e = g(t, F), n = g(t, Ut), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Pn = (t, e) => {\n let n = 0;\n const o = new Event(D), s = te(t), r = _t(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(D, a), n = 1);\n };\n t.addEventListener(D, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, ee = (t) => {\n const e = g(t, U), n = g(t, Qt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, ne = (t) => {\n const e = g(t, U), n = g(t, Rt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Fn = (t, e) => {\n let n = 0;\n const o = new Event(C), s = ne(t), r = ee(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(C, a), n = 1);\n };\n t.addEventListener(C, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, Un = (t) => Float32Array.from(Array.from(t)), Wn = (t) => Float64Array.from(Array.from(t)), Rn = (t, e) => t.focus(e), V = (t) => [\"true\", !0].includes(t) ? !0 : [\"false\", !1].includes(t) ? !1 : [\"null\", \"\", null, void 0].includes(t) ? null : t !== \"\" && !Number.isNaN(+t) ? +t : t, w = (t) => Object.entries(t), oe = (t) => t.toLowerCase(), Qn = (t, e, n, o) => {\n const s = { ...n }, r = { ...t.dataset }, a = { ...e }, l = {}, p = \"title\";\n return w(r).forEach(([c, m]) => {\n const y = o && typeof c == \"string\" && c.includes(o) ? c.replace(o, \"\").replace(/[A-Z]/g, (j) => oe(j)) : c;\n l[y] = V(m);\n }), w(s).forEach(([c, m]) => {\n s[c] = V(m);\n }), w(e).forEach(([c, m]) => {\n c in s ? a[c] = s[c] : c in l ? a[c] = l[c] : a[c] = c === p ? Yt(t, p) : m;\n }), a;\n}, jn = (t, e) => v(t) && (Object.hasOwn(t, e) || e in t), qn = (t) => Object.keys(t), Gn = (t) => Object.values(t), Jn = (t) => Object.fromEntries(t), Kn = (t, e) => {\n const n = new CustomEvent(t, {\n cancelable: !0,\n bubbles: !0\n });\n return v(e) && k(n, e), n;\n}, Xn = { passive: !0 }, Yn = (t) => t.offsetHeight, Zn = (t, e) => {\n w(e).forEach(([n, o]) => {\n if (o && N(n) && n.includes(\"--\"))\n t.style.setProperty(n, o);\n else {\n const s = {};\n s[n] = o, k(t.style, s);\n }\n });\n}, I = (t) => v(t) && t.constructor.name === \"Map\" || !1, se = (t) => typeof t == \"number\" || !1, f = /* @__PURE__ */ new Map(), $n = {\n /**\n * Sets a new timeout timer for an element, or element -> key association.\n *\n * @param element target element\n * @param callback the callback\n * @param delay the execution delay\n * @param key a unique key\n */\n set: (t, e, n, o) => {\n u(t) && (o && o.length ? (f.has(t) || f.set(t, /* @__PURE__ */ new Map()), f.get(t).set(o, setTimeout(e, n))) : f.set(t, setTimeout(e, n)));\n },\n /**\n * Returns the timer associated with the target.\n *\n * @param element target element\n * @param key a unique\n * @returns the timer\n */\n get: (t, e) => {\n if (!u(t))\n return null;\n const n = f.get(t);\n return e && n && I(n) ? n.get(e) || /* istanbul ignore next */\n null : se(n) ? n : null;\n },\n /**\n * Clears the element's timer.\n *\n * @param element target element\n * @param key a unique key\n */\n clear: (t, e) => {\n if (!u(t))\n return;\n const n = f.get(t);\n e && e.length && I(n) ? (clearTimeout(n.get(e)), n.delete(e), n.size === 0 && f.delete(t)) : (clearTimeout(n), f.delete(t));\n }\n}, _n = (t) => t.toUpperCase(), h = (t, e) => {\n const { width: n, height: o, top: s, right: r, bottom: a, left: l } = t.getBoundingClientRect();\n let p = 1, c = 1;\n if (e && u(t)) {\n const { offsetWidth: m, offsetHeight: y } = t;\n p = m > 0 ? Math.round(n) / m : (\n /* istanbul ignore next */\n 1\n ), c = y > 0 ? Math.round(o) / y : (\n /* istanbul ignore next */\n 1\n );\n }\n return {\n width: n / p,\n height: o / c,\n top: s / c,\n right: r / p,\n bottom: a / c,\n left: l / p,\n x: l / p,\n y: s / c\n };\n}, to = (t) => d(t).body, T = (t) => d(t).documentElement, eo = (t) => d(t).head, no = (t) => {\n const e = W(t), n = e ? t.scrollX : t.scrollLeft, o = e ? t.scrollY : t.scrollTop;\n return { x: n, y: o };\n}, ce = (t) => i(t) && t.constructor.name === \"ShadowRoot\" || !1, oo = (t) => t.nodeName === \"HTML\" ? t : u(t) && t.assignedSlot || // step into the shadow DOM of the parent of a slotted node\ni(t) && t.parentNode || // DOM Element detected\nce(t) && t.host || // ShadowRoot detected\nT(t), re = (t) => {\n if (!u(t))\n return !1;\n const { width: e, height: n } = h(t), { offsetWidth: o, offsetHeight: s } = t;\n return Math.round(e) !== o || Math.round(n) !== s;\n}, so = (t, e, n) => {\n const o = u(e), s = h(t, o && re(e)), r = { x: 0, y: 0 };\n if (o) {\n const a = h(e, !0);\n r.x = a.x + e.clientLeft, r.y = a.y + e.clientTop;\n }\n return {\n x: s.left + n.x - r.x,\n y: s.top + n.y - r.y,\n width: s.width,\n height: s.height\n };\n};\nlet B = 0, H = 0;\nconst b = /* @__PURE__ */ new Map(), ae = (t, e) => {\n let n = e ? B : H;\n if (e) {\n const o = ae(t), s = b.get(o) || /* @__PURE__ */ new Map();\n b.has(o) || b.set(o, s), I(s) && !s.has(e) ? (s.set(e, n), B += 1) : n = s.get(e);\n } else {\n const o = t.id || t;\n b.has(o) ? n = b.get(o) : (b.set(o, n), H += 1);\n }\n return n;\n}, co = (t) => {\n var e;\n return t ? R(t) ? t.defaultView : i(t) ? (e = t == null ? void 0 : t.ownerDocument) == null ? void 0 : e.defaultView : t : window;\n}, ie = (t) => Array.isArray(t) || !1, ro = (t) => i(t) && t.nodeName === \"CANVAS\" || !1, ue = (t) => u(t) && !!t.shadowRoot || !1, ao = (t) => i(t) && [1, 2, 3, 4, 5, 6, 7, 8].some((e) => t.nodeType === e) || !1, io = (t) => {\n if (!i(t))\n return !1;\n const { top: e, bottom: n } = h(t), { clientHeight: o } = T(t);\n return e <= o && n >= 0;\n}, uo = (t) => {\n if (!i(t))\n return !1;\n const { clientWidth: e, clientHeight: n } = T(t), { top: o, left: s, bottom: r, right: a } = h(t, !0);\n return o >= 0 && s >= 0 && r <= n && a <= e;\n}, lo = (t) => ie(t) && t.every(u) || !1, po = (t) => typeof t == \"function\" || !1, mo = (t) => v(t) && t.constructor.name === \"HTMLCollection\" || !1, fo = (t) => u(t) && t.tagName === \"IMG\" || !1, go = (t) => {\n if (!N(t))\n return !1;\n try {\n JSON.parse(t);\n } catch {\n return !1;\n }\n return !0;\n}, vo = (t) => v(t) && t.constructor.name === \"WeakMap\" || !1, Eo = (t) => i(t) && [\"SVG\", \"Image\", \"Video\", \"Canvas\"].some((e) => t.constructor.name.includes(e)) || !1, bo = (t) => v(t) && t.constructor.name === \"NodeList\" || !1, ho = (t) => T(t).dir === \"rtl\", yo = (t) => i(t) && t.constructor.name.includes(\"SVG\") || !1, wo = (t) => i(t) && [\"TABLE\", \"TD\", \"TH\"].includes(t.nodeName) || !1, le = (t, e) => t ? t.closest(e) || // break out of `ShadowRoot`\nle(t.getRootNode().host, e) : null, Ao = (t, e) => u(t) ? t : (i(e) ? e : d()).querySelector(t), de = (t, e) => (i(e) ? e : d()).getElementsByTagName(t), So = (t) => [...de(\"*\", t)].filter(ue), Mo = (t, e) => d(e).getElementById(t) || null, No = (t, e) => (i(e) ? e : d()).querySelectorAll(t), ko = (t, e) => (e && i(e) ? e : d()).getElementsByClassName(\n t\n), To = (t, e) => t.matches(e), Do = \"2.0.0alpha17\";\nexport {\n Vn as ArrayFrom,\n P as DOMContentLoadedEvent,\n Y as DOMMouseScrollEvent,\n L as Data,\n Un as Float32ArrayFrom,\n Wn as Float64ArrayFrom,\n k as ObjectAssign,\n w as ObjectEntries,\n Jn as ObjectFromEntries,\n jn as ObjectHasOwn,\n qn as ObjectKeys,\n Gn as ObjectValues,\n $n as Timer,\n q as abortEvent,\n On as addClass,\n cn as addEventListener,\n Wt as animationDelay,\n Ut as animationDuration,\n D as animationEndEvent,\n F as animationName,\n pe as ariaChecked,\n fe as ariaDescribedBy,\n me as ariaDescription,\n ge as ariaExpanded,\n ve as ariaHasPopup,\n Ee as ariaHidden,\n be as ariaLabel,\n he as ariaLabelledBy,\n ye as ariaModal,\n we as ariaPressed,\n Ae as ariaSelected,\n Me as ariaValueMax,\n Se as ariaValueMin,\n Ne as ariaValueNow,\n ke as ariaValueText,\n G as beforeunloadEvent,\n an as bezierEasings,\n J as blurEvent,\n K as changeEvent,\n le as closest,\n X as contextmenuEvent,\n Kn as createCustomEvent,\n Zt as createElement,\n $t as createElementNS,\n Q as dispatchEvent,\n Hn as distinct,\n zn as documentBody,\n xn as documentElement,\n M as documentHead,\n De as dragEvent,\n ze as dragendEvent,\n Oe as dragenterEvent,\n Le as dragleaveEvent,\n Ie as dragoverEvent,\n Ce as dragstartEvent,\n Pn as emulateAnimationEnd,\n Fn as emulateTransitionEnd,\n Z as errorEvent,\n Rn as focus,\n $ as focusEvent,\n Fe as focusEvents,\n _ as focusinEvent,\n tt as focusoutEvent,\n et as gesturechangeEvent,\n nt as gestureendEvent,\n ot as gesturestartEvent,\n Yt as getAttribute,\n Sn as getAttributeNS,\n h as getBoundingClientRect,\n So as getCustomElements,\n d as getDocument,\n to as getDocumentBody,\n T as getDocumentElement,\n eo as getDocumentHead,\n _t as getElementAnimationDelay,\n te as getElementAnimationDuration,\n Mo as getElementById,\n g as getElementStyle,\n ee as getElementTransitionDelay,\n ne as getElementTransitionDuration,\n ko as getElementsByClassName,\n de as getElementsByTagName,\n Bn as getInstance,\n no as getNodeScroll,\n oo as getParentNode,\n so as getRectRelativeToOffsetParent,\n ae as getUID,\n co as getWindow,\n Mn as hasAttribute,\n Nn as hasAttributeNS,\n In as hasClass,\n gn as isApple,\n ie as isArray,\n ro as isCanvas,\n ue as isCustomElement,\n R as isDocument,\n ao as isElement,\n io as isElementInScrollRange,\n uo as isElementInViewport,\n lo as isElementsArray,\n vn as isFirefox,\n po as isFunction,\n mo as isHTMLCollection,\n u as isHTMLElement,\n fo as isHTMLImageElement,\n go as isJSON,\n I as isMap,\n Eo as isMedia,\n fn as isMobile,\n i as isNode,\n bo as isNodeList,\n se as isNumber,\n v as isObject,\n ho as isRTL,\n yo as isSVGElement,\n re as isScaledElement,\n ce as isShadowRoot,\n N as isString,\n wo as isTableElement,\n vo as isWeakMap,\n W as isWindow,\n We as keyAlt,\n Re as keyArrowDown,\n je as keyArrowLeft,\n qe as keyArrowRight,\n Qe as keyArrowUp,\n Ge as keyBackspace,\n Je as keyCapsLock,\n Ke as keyControl,\n Xe as keyDelete,\n Ye as keyEnter,\n Ze as keyEscape,\n $e as keyInsert,\n _e as keyMeta,\n tn as keyPause,\n en as keyScrollLock,\n nn as keyShift,\n on as keySpace,\n sn as keyTab,\n Ue as keyboardEventKeys,\n st as keydownEvent,\n ct as keypressEvent,\n rt as keyupEvent,\n at as loadEvent,\n xe as loadstartEvent,\n To as matches,\n Be as mouseClickEvents,\n He as mouseHoverEvents,\n Ve as mouseSwipeEvents,\n it as mouseclickEvent,\n ut as mousedblclickEvent,\n lt as mousedownEvent,\n mt as mouseenterEvent,\n pt as mousehoverEvent,\n gt as mouseinEvent,\n ft as mouseleaveEvent,\n bt as mousemoveEvent,\n vt as mouseoutEvent,\n Et as mouseoverEvent,\n dt as mouseupEvent,\n ht as mousewheelEvent,\n yt as moveEvent,\n Te as nativeEvents,\n Xt as noop,\n Qn as normalizeOptions,\n V as normalizeValue,\n Jt as off,\n un as offsetHeight,\n ln as offsetWidth,\n Gt as on,\n Kt as one,\n wt as orientationchangeEvent,\n Xn as passiveHandler,\n At as pointercancelEvent,\n St as pointerdownEvent,\n Mt as pointerleaveEvent,\n Nt as pointermoveEvent,\n kt as pointerupEvent,\n Ao as querySelector,\n No as querySelectorAll,\n Tt as readystatechangeEvent,\n Yn as reflow,\n Dn as removeAttribute,\n Cn as removeAttributeNS,\n Ln as removeClass,\n rn as removeEventListener,\n Dt as resetEvent,\n Ct as resizeEvent,\n zt as scrollEvent,\n dn as scrollHeight,\n pn as scrollWidth,\n Ot as selectEvent,\n Lt as selectendEvent,\n It as selectstartEvent,\n kn as setAttribute,\n Tn as setAttributeNS,\n Zn as setElementStyle,\n xt as submitEvent,\n En as support3DTransform,\n wn as supportAnimation,\n bn as supportPassive,\n yn as supportTouch,\n hn as supportTransform,\n An as supportTransition,\n mn as tabindex,\n oe as toLowerCase,\n _n as toUpperCase,\n Pe as touchEvents,\n Ht as touchcancelEvent,\n Pt as touchendEvent,\n Bt as touchmoveEvent,\n Vt as touchstartEvent,\n Qt as transitionDelay,\n Rt as transitionDuration,\n C as transitionEndEvent,\n U as transitionProperty,\n Ft as unloadEvent,\n S as userAgent,\n A as userAgentData,\n Do as version\n};\n//# sourceMappingURL=shorty.mjs.map\n","const N = [\"transparent\", \"currentColor\", \"inherit\", \"revert\", \"initial\"], b = (o) => {\n const t = Math.floor(o);\n return o - t < 0.5 ? t : Math.round(o);\n}, T = [\n [\n \"aliceblue\",\n {\n r: 240,\n g: 248,\n b: 255\n }\n ],\n [\n \"antiquewhite\",\n {\n r: 250,\n g: 235,\n b: 215\n }\n ],\n [\n \"aqua\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"aquamarine\",\n {\n r: 127,\n g: 255,\n b: 212\n }\n ],\n [\n \"azure\",\n {\n r: 240,\n g: 255,\n b: 255\n }\n ],\n [\n \"beige\",\n {\n r: 245,\n g: 245,\n b: 220\n }\n ],\n [\n \"bisque\",\n {\n r: 255,\n g: 228,\n b: 196\n }\n ],\n [\n \"black\",\n {\n r: 0,\n g: 0,\n b: 0\n }\n ],\n [\n \"blanchedalmond\",\n {\n r: 255,\n g: 235,\n b: 205\n }\n ],\n [\n \"blue\",\n {\n r: 0,\n g: 0,\n b: 255\n }\n ],\n [\n \"blueviolet\",\n {\n r: 138,\n g: 43,\n b: 226\n }\n ],\n [\n \"brown\",\n {\n r: 165,\n g: 42,\n b: 42\n }\n ],\n [\n \"burlywood\",\n {\n r: 222,\n g: 184,\n b: 135\n }\n ],\n [\n \"cadetblue\",\n {\n r: 95,\n g: 158,\n b: 160\n }\n ],\n [\n \"chartreuse\",\n {\n r: 127,\n g: 255,\n b: 0\n }\n ],\n [\n \"chocolate\",\n {\n r: 210,\n g: 105,\n b: 30\n }\n ],\n [\n \"coral\",\n {\n r: 255,\n g: 127,\n b: 80\n }\n ],\n [\n \"cornflowerblue\",\n {\n r: 100,\n g: 149,\n b: 237\n }\n ],\n [\n \"cornsilk\",\n {\n r: 255,\n g: 248,\n b: 220\n }\n ],\n [\n \"crimson\",\n {\n r: 220,\n g: 20,\n b: 60\n }\n ],\n [\n \"cyan\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"darkblue\",\n {\n r: 0,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkcyan\",\n {\n r: 0,\n g: 139,\n b: 139\n }\n ],\n [\n \"darkgoldenrod\",\n {\n r: 184,\n g: 134,\n b: 11\n }\n ],\n [\n \"darkgray\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkgreen\",\n {\n r: 0,\n g: 100,\n b: 0\n }\n ],\n [\n \"darkgrey\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkkhaki\",\n {\n r: 189,\n g: 183,\n b: 107\n }\n ],\n [\n \"darkmagenta\",\n {\n r: 139,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkolivegreen\",\n {\n r: 85,\n g: 107,\n b: 47\n }\n ],\n [\n \"darkorange\",\n {\n r: 255,\n g: 140,\n b: 0\n }\n ],\n [\n \"darkorchid\",\n {\n r: 153,\n g: 50,\n b: 204\n }\n ],\n [\n \"darkred\",\n {\n r: 139,\n g: 0,\n b: 0\n }\n ],\n [\n \"darksalmon\",\n {\n r: 233,\n g: 150,\n b: 122\n }\n ],\n [\n \"darkseagreen\",\n {\n r: 143,\n g: 188,\n b: 143\n }\n ],\n [\n \"darkslateblue\",\n {\n r: 72,\n g: 61,\n b: 139\n }\n ],\n [\n \"darkslategray\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkslategrey\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkturquoise\",\n {\n r: 0,\n g: 206,\n b: 209\n }\n ],\n [\n \"darkviolet\",\n {\n r: 148,\n g: 0,\n b: 211\n }\n ],\n [\n \"deeppink\",\n {\n r: 255,\n g: 20,\n b: 147\n }\n ],\n [\n \"deepskyblue\",\n {\n r: 0,\n g: 191,\n b: 255\n }\n ],\n [\n \"dimgray\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dimgrey\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dodgerblue\",\n {\n r: 30,\n g: 144,\n b: 255\n }\n ],\n [\n \"firebrick\",\n {\n r: 178,\n g: 34,\n b: 34\n }\n ],\n [\n \"floralwhite\",\n {\n r: 255,\n g: 250,\n b: 240\n }\n ],\n [\n \"forestgreen\",\n {\n r: 34,\n g: 139,\n b: 34\n }\n ],\n [\n \"fuchsia\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"gainsboro\",\n {\n r: 220,\n g: 220,\n b: 220\n }\n ],\n [\n \"ghostwhite\",\n {\n r: 248,\n g: 248,\n b: 255\n }\n ],\n [\n \"goldenrod\",\n {\n r: 218,\n g: 165,\n b: 32\n }\n ],\n [\n \"gold\",\n {\n r: 255,\n g: 215,\n b: 0\n }\n ],\n [\n \"gray\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"green\",\n {\n r: 0,\n g: 128,\n b: 0\n }\n ],\n [\n \"greenyellow\",\n {\n r: 173,\n g: 255,\n b: 47\n }\n ],\n [\n \"grey\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"honeydew\",\n {\n r: 240,\n g: 255,\n b: 240\n }\n ],\n [\n \"hotpink\",\n {\n r: 255,\n g: 105,\n b: 180\n }\n ],\n [\n \"indianred\",\n {\n r: 205,\n g: 92,\n b: 92\n }\n ],\n [\n \"indigo\",\n {\n r: 75,\n g: 0,\n b: 130\n }\n ],\n [\n \"ivory\",\n {\n r: 255,\n g: 255,\n b: 240\n }\n ],\n [\n \"khaki\",\n {\n r: 240,\n g: 230,\n b: 140\n }\n ],\n [\n \"lavenderblush\",\n {\n r: 255,\n g: 240,\n b: 245\n }\n ],\n [\n \"lavender\",\n {\n r: 230,\n g: 230,\n b: 250\n }\n ],\n [\n \"lawngreen\",\n {\n r: 124,\n g: 252,\n b: 0\n }\n ],\n [\n \"lemonchiffon\",\n {\n r: 255,\n g: 250,\n b: 205\n }\n ],\n [\n \"lightblue\",\n {\n r: 173,\n g: 216,\n b: 230\n }\n ],\n [\n \"lightcoral\",\n {\n r: 240,\n g: 128,\n b: 128\n }\n ],\n [\n \"lightcyan\",\n {\n r: 224,\n g: 255,\n b: 255\n }\n ],\n [\n \"lightgoldenrodyellow\",\n {\n r: 250,\n g: 250,\n b: 210\n }\n ],\n [\n \"lightgray\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightgreen\",\n {\n r: 144,\n g: 238,\n b: 144\n }\n ],\n [\n \"lightgrey\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightpink\",\n {\n r: 255,\n g: 182,\n b: 193\n }\n ],\n [\n \"lightsalmon\",\n {\n r: 255,\n g: 160,\n b: 122\n }\n ],\n [\n \"lightseagreen\",\n {\n r: 32,\n g: 178,\n b: 170\n }\n ],\n [\n \"lightskyblue\",\n {\n r: 135,\n g: 206,\n b: 250\n }\n ],\n [\n \"lightslategray\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightslategrey\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightsteelblue\",\n {\n r: 176,\n g: 196,\n b: 222\n }\n ],\n [\n \"lightyellow\",\n {\n r: 255,\n g: 255,\n b: 224\n }\n ],\n [\n \"lime\",\n {\n r: 0,\n g: 255,\n b: 0\n }\n ],\n [\n \"limegreen\",\n {\n r: 50,\n g: 205,\n b: 50\n }\n ],\n [\n \"linen\",\n {\n r: 250,\n g: 240,\n b: 230\n }\n ],\n [\n \"magenta\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"maroon\",\n {\n r: 128,\n g: 0,\n b: 0\n }\n ],\n [\n \"mediumaquamarine\",\n {\n r: 102,\n g: 205,\n b: 170\n }\n ],\n [\n \"mediumblue\",\n {\n r: 0,\n g: 0,\n b: 205\n }\n ],\n [\n \"mediumorchid\",\n {\n r: 186,\n g: 85,\n b: 211\n }\n ],\n [\n \"mediumpurple\",\n {\n r: 147,\n g: 112,\n b: 219\n }\n ],\n [\n \"mediumseagreen\",\n {\n r: 60,\n g: 179,\n b: 113\n }\n ],\n [\n \"mediumslateblue\",\n {\n r: 123,\n g: 104,\n b: 238\n }\n ],\n [\n \"mediumspringgreen\",\n {\n r: 0,\n g: 250,\n b: 154\n }\n ],\n [\n \"mediumturquoise\",\n {\n r: 72,\n g: 209,\n b: 204\n }\n ],\n [\n \"mediumvioletred\",\n {\n r: 199,\n g: 21,\n b: 133\n }\n ],\n [\n \"midnightblue\",\n {\n r: 25,\n g: 25,\n b: 112\n }\n ],\n [\n \"mintcream\",\n {\n r: 245,\n g: 255,\n b: 250\n }\n ],\n [\n \"mistyrose\",\n {\n r: 255,\n g: 228,\n b: 225\n }\n ],\n [\n \"moccasin\",\n {\n r: 255,\n g: 228,\n b: 181\n }\n ],\n [\n \"navajowhite\",\n {\n r: 255,\n g: 222,\n b: 173\n }\n ],\n [\n \"navy\",\n {\n r: 0,\n g: 0,\n b: 128\n }\n ],\n [\n \"oldlace\",\n {\n r: 253,\n g: 245,\n b: 230\n }\n ],\n [\n \"olive\",\n {\n r: 128,\n g: 128,\n b: 0\n }\n ],\n [\n \"olivedrab\",\n {\n r: 107,\n g: 142,\n b: 35\n }\n ],\n [\n \"orange\",\n {\n r: 255,\n g: 165,\n b: 0\n }\n ],\n [\n \"orangered\",\n {\n r: 255,\n g: 69,\n b: 0\n }\n ],\n [\n \"orchid\",\n {\n r: 218,\n g: 112,\n b: 214\n }\n ],\n [\n \"palegoldenrod\",\n {\n r: 238,\n g: 232,\n b: 170\n }\n ],\n [\n \"palegreen\",\n {\n r: 152,\n g: 251,\n b: 152\n }\n ],\n [\n \"paleturquoise\",\n {\n r: 175,\n g: 238,\n b: 238\n }\n ],\n [\n \"palevioletred\",\n {\n r: 219,\n g: 112,\n b: 147\n }\n ],\n [\n \"papayawhip\",\n {\n r: 255,\n g: 239,\n b: 213\n }\n ],\n [\n \"peachpuff\",\n {\n r: 255,\n g: 218,\n b: 185\n }\n ],\n [\n \"peru\",\n {\n r: 205,\n g: 133,\n b: 63\n }\n ],\n [\n \"pink\",\n {\n r: 255,\n g: 192,\n b: 203\n }\n ],\n [\n \"plum\",\n {\n r: 221,\n g: 160,\n b: 221\n }\n ],\n [\n \"powderblue\",\n {\n r: 176,\n g: 224,\n b: 230\n }\n ],\n [\n \"purple\",\n {\n r: 128,\n g: 0,\n b: 128\n }\n ],\n [\n \"rebeccapurple\",\n {\n r: 102,\n g: 51,\n b: 153\n }\n ],\n [\n \"red\",\n {\n r: 255,\n g: 0,\n b: 0\n }\n ],\n [\n \"rosybrown\",\n {\n r: 188,\n g: 143,\n b: 143\n }\n ],\n [\n \"royalblue\",\n {\n r: 65,\n g: 105,\n b: 225\n }\n ],\n [\n \"saddlebrown\",\n {\n r: 139,\n g: 69,\n b: 19\n }\n ],\n [\n \"salmon\",\n {\n r: 250,\n g: 128,\n b: 114\n }\n ],\n [\n \"sandybrown\",\n {\n r: 244,\n g: 164,\n b: 96\n }\n ],\n [\n \"seagreen\",\n {\n r: 46,\n g: 139,\n b: 87\n }\n ],\n [\n \"seashell\",\n {\n r: 255,\n g: 245,\n b: 238\n }\n ],\n [\n \"sienna\",\n {\n r: 160,\n g: 82,\n b: 45\n }\n ],\n [\n \"silver\",\n {\n r: 192,\n g: 192,\n b: 192\n }\n ],\n [\n \"skyblue\",\n {\n r: 135,\n g: 206,\n b: 235\n }\n ],\n [\n \"slateblue\",\n {\n r: 106,\n g: 90,\n b: 205\n }\n ],\n [\n \"slategray\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"slategrey\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"snow\",\n {\n r: 255,\n g: 250,\n b: 250\n }\n ],\n [\n \"springgreen\",\n {\n r: 0,\n g: 255,\n b: 127\n }\n ],\n [\n \"steelblue\",\n {\n r: 70,\n g: 130,\n b: 180\n }\n ],\n [\n \"tan\",\n {\n r: 210,\n g: 180,\n b: 140\n }\n ],\n [\n \"teal\",\n {\n r: 0,\n g: 128,\n b: 128\n }\n ],\n [\n \"thistle\",\n {\n r: 216,\n g: 191,\n b: 216\n }\n ],\n [\n \"tomato\",\n {\n r: 255,\n g: 99,\n b: 71\n }\n ],\n [\n \"turquoise\",\n {\n r: 64,\n g: 224,\n b: 208\n }\n ],\n [\n \"violet\",\n {\n r: 238,\n g: 130,\n b: 238\n }\n ],\n [\n \"wheat\",\n {\n r: 245,\n g: 222,\n b: 179\n }\n ],\n [\n \"white\",\n {\n r: 255,\n g: 255,\n b: 255\n }\n ],\n [\n \"whitesmoke\",\n {\n r: 245,\n g: 245,\n b: 245\n }\n ],\n [\n \"yellow\",\n {\n r: 255,\n g: 255,\n b: 0\n }\n ],\n [\n \"yellowgreen\",\n {\n r: 154,\n g: 205,\n b: 50\n }\n ]\n], B = \"deg|rad|grad|turn\", U = \"[-\\\\+]?\\\\d+%?\", D = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\", L = `[-\\\\+]?\\\\d*\\\\.?\\\\d+(?:${B})?`, v = `(?:${D})|(?:${U})`, F = `(?:${v})|(?:${L}?)`, rr = \"(?:[\\\\s|\\\\(\\\\s|\\\\s\\\\(\\\\s]+)?\", tr = \"(?:[\\\\s|\\\\)\\\\s]+)?\", O = \"(?:[,|\\\\s]+)\", er = \"(?:[,|\\\\/\\\\s]*)?\", $ = `${rr}(${F})${O}(${v})${O}(${v})${er}(${v})?${tr}`, f = {\n CSS_UNIT: new RegExp(F),\n ANGLES: B,\n CSS_ANGLE: L,\n CSS_INTEGER: U,\n CSS_NUMBER: D,\n CSS_UNIT2: F,\n PERMISSIVE_MATCH: $,\n hwb: new RegExp(`hwb${$}`),\n rgb: new RegExp(`rgb(?:a)?${$}`),\n hsl: new RegExp(`hsl(?:a)?${$}`),\n hsv: new RegExp(`hsv(?:a)?${$}`),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n}, V = (o) => N.includes(o), k = (o, t) => o !== null && typeof o == \"object\" && Object.keys(t).every((r) => r in o), Z = (o) => `${o}`.includes(\".\") && parseFloat(o) === 1, R = (o) => typeof o == \"string\" && o.includes(\"%\"), c = (o) => !!f.CSS_UNIT.exec(`${o}`), z = [\"rgb\", \"hex\", \"hsl\", \"hsv\", \"hwb\"], J = (o) => N.includes(o) || [\"#\", ...z].some((t) => o.includes(t)) ? !1 : T.some(([t]) => o === t), u = (o, t) => {\n let r = o;\n if (typeof o == \"number\" && Math.min(o, 0) === 0 && // round values to 6 decimals Math.round(N * (10 ** 6)) / 10 ** 6\n Math.max(o, 1) === 1)\n return o;\n Z(o) && (r = \"100%\");\n const e = R(r);\n return r = t === 360 ? parseFloat(r) : Math.min(t, Math.max(0, parseFloat(r))), e && (r = r * t / 100), Math.abs(r - t) < 1e-6 ? 1 : (t === 360 ? r = (r < 0 ? r % t + t : r % t) / t : r = r % t / t, r);\n}, M = (o) => {\n let t = parseFloat(o);\n return (Number.isNaN(t) || t < 0 || t > 1) && (t = 1), t;\n}, x = (o) => Math.min(1, Math.max(0, o)), p = (o) => o.length === 1 ? `0${o}` : String(o), K = (o) => {\n const [[, t]] = T.filter(([r]) => r === o.toLowerCase());\n return t;\n}, h = (o) => parseInt(o, 16), E = (o) => h(o) / 255, Q = (o) => b(o * 255).toString(16), _ = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0, g = 0;\n const a = (e + s) / 2;\n if (e === s)\n g = 0, n = 0;\n else {\n const i = e - s;\n g = a > 0.5 ? i / (2 - e - s) : i / (e + s), e === o && (n = (t - r) / i + (t < r ? 6 : 0)), e === t && (n = (r - o) / i + 2), e === r && (n = (o - t) / i + 4), n /= 6;\n }\n return { h: n, s: g, l: a };\n}, H = (o, t, r) => {\n let e = r;\n return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? o + (t - o) * (6 * e) : e < 1 / 2 ? t : e < 2 / 3 ? o + (t - o) * (2 / 3 - e) * 6 : o;\n}, y = (o, t, r) => {\n let e = 0, s = 0, n = 0;\n if (t === 0)\n s = r, n = r, e = r;\n else if (r) {\n const g = r < 0.5 ? r * (1 + t) : r + t - r * t, a = 2 * r - g;\n e = H(a, g, o + 1 / 3), s = H(a, g, o), n = H(a, g, o - 1 / 3);\n }\n return { r: e, g: s, b: n };\n}, G = (o, t, r) => {\n let e = 0, s = 0;\n const n = Math.min(o, t, r), g = Math.max(o, t, r), a = 1 - g;\n if (g === n)\n return { h: 0, w: n, b: a };\n o === n ? (e = t - r, s = 3) : (e = t === n ? r - o : o - t, s = t === n ? 5 : 1);\n const i = (s - e / (g - n)) / 6;\n return {\n h: i === 1 ? 0 : i,\n w: n,\n b: a\n };\n}, X = (o, t, r) => {\n if (t + r >= 1) {\n const g = t / (t + r);\n return { r: g, g, b: g };\n }\n let { r: e, g: s, b: n } = y(o, 1, 0.5);\n return [e, s, n] = [e, s, n].map((g) => g * (1 - t - r) + t), { r: e, g: s, b: n };\n}, P = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0;\n const g = e, a = e - s, i = e === 0 ? 0 : a / e;\n return e === s ? n = 0 : (o === e && (n = (t - r) / a + (t < r ? 6 : 0)), t === e && (n = (r - o) / a + 2), r === e && (n = (o - t) / a + 4), n /= 6), { h: n, s: i, v: g };\n}, I = (o, t, r) => {\n const e = o * 6, s = t, n = r, g = Math.floor(e), a = e - g, i = n * (1 - s), l = n * (1 - a * s), d = n * (1 - (1 - a) * s), m = g % 6, w = [n, l, i, i, d, n][m], S = [d, n, n, l, i, i][m], A = [i, i, d, n, n, l][m];\n return { r: w, g: S, b: A };\n}, j = (o, t, r, e) => {\n const s = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16))\n ];\n return e && s[0].charAt(0) === s[0].charAt(1) && s[1].charAt(0) === s[1].charAt(1) && s[2].charAt(0) === s[2].charAt(1) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) : s.join(\"\");\n}, C = (o, t, r, e, s) => {\n const n = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16)),\n p(Q(e))\n ];\n return s && n[0].charAt(0) === n[0].charAt(1) && n[1].charAt(0) === n[1].charAt(1) && n[2].charAt(0) === n[2].charAt(1) && n[3].charAt(0) === n[3].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join(\"\");\n}, Y = (o) => {\n const t = String(o).trim().toLowerCase();\n if (J(t))\n return Object.assign(K(t), {\n a: 1,\n format: \"rgb\",\n ok: !0\n });\n if (V(t))\n return {\n r: 0,\n g: 0,\n b: 0,\n a: t === \"transparent\" ? 0 : 1,\n format: \"rgb\",\n ok: !0\n };\n let [, r, e, s, n] = f.rgb.exec(t) || [];\n return r && e && s ? {\n r,\n g: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"rgb\",\n ok: !0\n } : ([, r, e, s, n] = f.hsl.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n l: s,\n a: n !== void 0 ? n : 1,\n format: \"hsl\",\n ok: !0\n } : ([, r, e, s, n] = f.hsv.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n v: s,\n a: n !== void 0 ? n : 1,\n format: \"hsv\",\n ok: !0\n } : ([, r, e, s, n] = f.hwb.exec(t) || [], r && e && s ? {\n h: r,\n w: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"hwb\",\n ok: !0\n } : ([, r, e, s, n] = f.hex8.exec(t) || [], r && e && s && n ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: E(n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex6.exec(t) || [], r && e && s ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : ([, r, e, s, n] = f.hex4.exec(t) || [], r && e && s && n ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: E(n + n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex3.exec(t) || [], r && e && s ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : {\n r: 0,\n g: 0,\n b: 0,\n a: 1,\n format: \"rgb\",\n ok: !o\n })))))));\n}, q = (o) => {\n let t = { r: 0, g: 0, b: 0 }, r = o, e = 1, s, n, g, a, i, l, d, m, w = \"rgb\", S = !1;\n return (!r || typeof r == \"string\") && (r = Y(r), S = r.ok), k(r, t) && c(r.r) && c(r.g) && c(r.b) && ({ r: d, g: m, b: i } = r, [d, m, i] = [d, m, i].map((A) => u(A, R(A) ? 100 : 255)), t = { r: d, g: m, b: i }, w = \"format\" in r ? r.format : \"rgb\"), k(r, { h: 0, s: 0, v: 0 }) && c(r.h) && c(r.s) && c(r.v) && ({ h: l, s, v: n } = r, l = u(l, 360), s = u(s, 100), n = u(n, 100), t = I(l, s, n), w = \"hsv\"), k(r, { h: 0, s: 0, l: 0 }) && c(r.h) && c(r.s) && c(r.l) && ({ h: l, s, l: g } = r, l = u(l, 360), s = u(s, 100), g = u(g, 100), t = y(l, s, g), w = \"hsl\"), k(r, { h: 0, w: 0, b: 0 }) && c(r.h) && c(r.w) && c(r.b) && ({ h: l, w: a, b: i } = r, l = u(l, 360), a = u(a, 100), i = u(i, 100), t = X(l, a, i), w = \"hwb\"), c(r.a) && (e = r.a, e = R(e) || parseFloat(`${e}`) > 1 ? u(e, 100) : e), {\n r: t.r,\n g: t.g,\n b: t.b,\n a: M(e),\n format: w,\n ok: S\n };\n}, sr = \"1.0.8\";\nclass W {\n // bring main utilities to front\n static matchers = f;\n static isOnePointZero = Z;\n static isPercentage = R;\n static isValidCSSUnit = c;\n static isNonColor = V;\n static isColorName = J;\n static isColorType = k;\n static pad2 = p;\n static clamp01 = x;\n static bound01 = u;\n static boundAlpha = M;\n static getRGBFromName = K;\n static convertHexToDecimal = E;\n static convertDecimalToHex = Q;\n static rgbToHsl = _;\n static rgbToHex = j;\n static rgbToHsv = P;\n static rgbToHwb = G;\n static rgbaToHex = C;\n static hslToRgb = I;\n static hsvToRgb = I;\n static hueToRgb = H;\n static hwbToRgb = X;\n static parseIntFromHex = h;\n static stringInputToObject = Y;\n static inputToRGB = q;\n static roundPart = b;\n static webColors = T;\n static nonColors = N;\n static version = sr;\n // main public properties\n r;\n g;\n b;\n a;\n format;\n ok;\n originalInput;\n // main public methods\n constructor(t, r) {\n const e = r && z.includes(r) ? r : \"\", { r: s, g: n, b: g, a, ok: i, format: l } = q(t);\n this.originalInput = t, this.r = s, this.g = n, this.b = g, this.a = a, this.ok = i, this.format = e || l;\n }\n /**\n * Checks if the current input value is a valid colour.\n */\n get isValid() {\n return this.ok;\n }\n /**\n * Checks if the current colour requires a light text colour.\n */\n get isDark() {\n return this.brightness < 120;\n }\n /**\n * Returns the perceived luminance of a colour.\n *\n * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n */\n get luminance() {\n const { r: t, g: r, b: e } = this;\n let s = 0, n = 0, g = 0;\n return t <= 0.03928 ? s = t / 12.92 : s = ((t + 0.055) / 1.055) ** 2.4, r <= 0.03928 ? n = r / 12.92 : n = ((r + 0.055) / 1.055) ** 2.4, e <= 0.03928 ? g = e / 12.92 : g = ((e + 0.055) / 1.055) ** 2.4, 0.2126 * s + 0.7152 * n + 0.0722 * g;\n }\n /**\n * Returns the perceived brightness of the colour.\n */\n get brightness() {\n const { r: t, g: r, b: e } = this.toRgb();\n return (t * 299 + r * 587 + e * 114) / 1e3;\n }\n /**\n * Returns the web colour name closest to the current colour.\n */\n get name() {\n const { r: t, g: r, b: e } = this.toRgb(), [s] = T.map(([n, g]) => {\n const a = (\n // ((rgb.r - r) ** 2 + (rgb.g - g) ** 2 + (rgb.b - b) ** 2) ** 0.5; // standard\n (((g.r - t) * 0.3) ** 2 + ((g.g - r) * 0.6) ** 2 + ((g.b - e) * 0.1) ** 2) ** 0.5\n );\n return [n, a];\n }).find(([, n], g, a) => n === Math.min(...a.map(([, i]) => i)));\n return s;\n }\n /**\n * Returns the colour as an RGBA object.\n */\n toRgb() {\n let { r: t, g: r, b: e, a: s } = this;\n return [t, r, e] = [t, r, e].map((n) => b(n * 255 * 100) / 100), s = b(s * 100) / 100, {\n r: t,\n g: r,\n b: e,\n a: s\n };\n }\n /**\n * Returns the RGBA values concatenated into a CSS3 Module string format.\n * * rgb(255,255,255)\n * * rgba(255,255,255,0.5)\n */\n toRgbString() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b);\n return s === 1 ? `rgb(${n}, ${g}, ${a})` : `rgba(${n}, ${g}, ${a}, ${s})`;\n }\n /**\n * Returns the RGBA values concatenated into a CSS4 Module string format.\n * * rgb(255 255 255)\n * * rgb(255 255 255 / 50%)\n */\n toRgbCSS4String() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b), i = s === 1 ? \"\" : ` / ${b(s * 100)}%`;\n return `rgb(${n} ${g} ${a}${i})`;\n }\n /**\n * Returns the hexadecimal value of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the decimal value.\n */\n toHex(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return n === 1 ? j(r, e, s, t) : C(r, e, s, n, t);\n }\n /**\n * Returns the CSS valid hexadecimal vaue of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the value.\n */\n toHexString(t) {\n return `#${this.toHex(t)}`;\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return C(r, e, s, n, t);\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8String(t) {\n return `#${this.toHex8(t)}`;\n }\n /**\n * Returns the colour as a HSVA object.\n */\n toHsv() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, v: a } = P(t, r, e);\n return {\n h: n,\n s: g,\n v: a,\n a: s\n };\n }\n /**\n * Returns the colour as an HSLA object.\n */\n toHsl() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, l: a } = _(t, r, e);\n return {\n h: n,\n s: g,\n l: a,\n a: s\n };\n }\n /**\n * Returns the HSLA values concatenated into a CSS3 Module format string.\n * * `hsl(150, 100%, 50%)`\n * * `hsla(150, 100%, 50%, 0.5)`\n */\n toHslString() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n return t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100) / 100, s === 1 ? `hsl(${t}, ${r}%, ${e}%)` : `hsla(${t}, ${r}%, ${e}%, ${s})`;\n }\n /**\n * Returns the HSLA values concatenated into a CSS4 Module format string.\n * * `hsl(150deg 100% 50%)`\n * * `hsl(150deg 100% 50% / 50%)`\n */\n toHslCSS4String() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hsl(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Returns the colour as an HWBA object.\n */\n toHwb() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, w: g, b: a } = G(t, r, e);\n return {\n h: n,\n w: g,\n b: a,\n a: s\n };\n }\n /**\n * Returns the HWBA values concatenated into a string.\n */\n toHwbString() {\n let { h: t, w: r, b: e, a: s } = this.toHwb();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hwb(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Sets the alpha value of the current colour.\n */\n setAlpha(t) {\n return typeof t != \"number\" ? this : (this.a = M(t), this);\n }\n /**\n * Saturate the colour with a given amount.\n */\n saturate(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, x(e + t / 100), s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Desaturate the colour with a given amount.\n */\n desaturate(t) {\n return typeof t == \"number\" ? this.saturate(-t) : this;\n }\n /**\n * Completely desaturates a colour into greyscale.\n * Same as calling `desaturate(100)`\n */\n greyscale() {\n return this.saturate(-100);\n }\n /**\n * Increase the colour lightness with a given amount.\n */\n lighten(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, e, x(s + t / 100));\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Decrease the colour lightness with a given amount.\n */\n darken(t) {\n return typeof t == \"number\" ? this.lighten(-t) : this;\n }\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n spin(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(x((r * 360 + t) % 360 / 360), e, s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /** Returns a clone of the current `Color` instance. */\n clone() {\n return new W(this);\n }\n /**\n * Returns the colour value in CSS valid string format.\n */\n toString(t) {\n const { format: r } = this;\n return r === \"hex\" ? this.toHexString(t) : r === \"hsl\" ? this.toHslString() : r === \"hwb\" ? this.toHwbString() : this.toRgbString();\n }\n}\nexport {\n W as default\n};\n//# sourceMappingURL=index.mjs.map\n","import Color from '@thednp/color';\n// import { isNumber } from '@thednp/shorty';\n\n/**\n * Returns a color palette with a given set of parameters.\n *\n * @example\n * new ColorPalette(0, 12, 10, 80);\n * // => { hue: 0, hueSteps: 12, lightSteps: 10, saturation: 80, colors: Array }\n */\nexport default class ColorPalette {\n public static Color = Color;\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n colors: Color[];\n /**\n * The `hue` parameter is optional, which would be set to 0.\n * * `args.hue` the starting Hue [0, 360]\n * * `args.hueSteps` Hue Steps Count [5, 24]\n * * `args.lightSteps` Lightness Steps Count [5, 12]\n * * `args.saturation` Saturation [0, 100]\n */\n constructor(...args: [number?, number?, number?, number?]) {\n let hue = 0;\n let hueSteps = 12;\n let lightSteps = 10;\n let lightnessArray = [0.5];\n let saturation = 100;\n // if (!args.every(n => isNumber(n))) throw TypeError('ColorPalette only accepts numbers.');\n\n if (args.length === 4) {\n [hue, hueSteps, lightSteps, saturation] = args as [number, number, number, number];\n } else if (args.length === 3) {\n [hue, hueSteps, lightSteps] = args as [number, number, number];\n } else if (args.length === 2) {\n [hueSteps, lightSteps] = args as [number, number];\n if ([hueSteps, lightSteps].some(n => n < 1)) {\n throw TypeError('ColorPalette: the two minimum arguments must be numbers higher than 0.');\n }\n }\n\n const colors: Color[] = [];\n const hueStep = 360 / hueSteps;\n const half = Color.roundPart((lightSteps - (lightSteps % 2 ? 1 : 0)) / 2);\n const steps1To13 = [0.25, 0.2, 0.15, 0.11, 0.09, 0.075];\n const lightSets = [\n [1, 2, 3],\n [4, 5],\n [6, 7],\n [8, 9],\n [10, 11],\n [12, 13],\n ];\n const closestSet = lightSets.find(set => set.includes(lightSteps));\n\n // find a lightStep that won't go beyond black and white\n // something within the [10-90] range of lightness\n const lightStep = closestSet\n ? steps1To13[lightSets.indexOf(closestSet)]\n : 100 / (lightSteps + (lightSteps % 2 ? 0 : 1)) / 100;\n\n // light tints\n for (let i = 1; i < half + 1; i += 1) {\n lightnessArray = [...lightnessArray, 0.5 + lightStep * i];\n }\n\n // dark tints\n for (let i = 1; i < lightSteps - half; i += 1) {\n lightnessArray = [0.5 - lightStep * i, ...lightnessArray];\n }\n\n // feed `colors` Array\n for (let i = 0; i < hueSteps; i += 1) {\n const currentHue = ((hue + i * hueStep) % 360) / 360;\n lightnessArray.forEach(l => {\n const newColor = new Color({ h: currentHue, s: 1, l });\n colors.push(saturation < 100 ? newColor.saturate(saturation - 100) : newColor);\n });\n }\n\n this.hue = hue;\n this.hueSteps = hueSteps;\n this.lightSteps = lightSteps;\n this.saturation = saturation;\n this.colors = colors;\n }\n}\n","import ColorPickerLabels from '../interface/colorPickerLabels';\n\n/** The labels presented to the user. */\nconst colorPickerLabels: ColorPickerLabels = {\n pickerLabel: 'Colour Picker',\n appearanceLabel: 'Colour Appearance',\n valueLabel: 'Colour Value',\n toggleLabel: 'Select Colour',\n presetsLabel: 'Colour Presets',\n defaultsLabel: 'Colour Defaults',\n formatLabel: 'Format',\n alphaLabel: 'Alpha',\n hexLabel: 'Hexadecimal',\n hueLabel: 'Hue',\n whitenessLabel: 'Whiteness',\n blacknessLabel: 'Blackness',\n saturationLabel: 'Saturation',\n lightnessLabel: 'Lightness',\n redLabel: 'Red',\n greenLabel: 'Green',\n blueLabel: 'Blue',\n};\n\nexport default colorPickerLabels;\n","/** A list of 17 color names used for WAI-ARIA compliance. */\nconst colorNames: string[] = [\n 'white',\n 'black',\n 'grey',\n 'red',\n 'orange',\n 'brown',\n 'gold',\n 'olive',\n 'yellow',\n 'lime',\n 'green',\n 'teal',\n 'cyan',\n 'blue',\n 'violet',\n 'magenta',\n 'pink',\n];\nexport default colorNames;\n","import { isString } from '@thednp/shorty';\n\n/**\n * Check if a string is valid JSON string.\n *\n * @param str the string input\n * @returns the query result\n */\nconst isValidJSON = (str: unknown): str is string => {\n if (!isString(str)) return false;\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n};\n\nexport default isValidJSON;\n","const vHidden = 'v-hidden';\nexport default vHidden;\n","import { createElement, setAttribute, ObjectAssign, toUpperCase } from '@thednp/shorty';\n\nimport vHidden from './vHidden';\nimport ColorPicker from '../index';\n\n/**\n * Returns the color form for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns a new `
          ` element with color component ``\n */\nconst getColorForm = (self: ColorPicker): HTMLElement => {\n const { format, id, componentLabels } = self;\n const colorForm = createElement({\n tagName: 'div',\n className: `color-form ${format}`,\n }) as HTMLElement;\n\n let components = ['hex'];\n if (format === 'rgb') components = ['red', 'green', 'blue', 'alpha'];\n else if (format === 'hsl') components = ['hue', 'saturation', 'lightness', 'alpha'];\n else if (format === 'hwb') components = ['hue', 'whiteness', 'blackness', 'alpha'];\n\n components.forEach((c: string): void => {\n const [C] = format === 'hex' ? ['#'] : toUpperCase(c).split('');\n const cID = `color_${format}_${c}_${id}`;\n const formatLabel = componentLabels[`${c}Label`];\n const cInputLabel = createElement({ tagName: 'label' }) as HTMLElement;\n setAttribute(cInputLabel, 'for', cID);\n cInputLabel.append(\n createElement({\n tagName: 'span',\n ariaHidden: 'true',\n innerText: `${C}:`,\n }) as HTMLElement,\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: formatLabel,\n }) as HTMLElement,\n );\n const cInput = createElement({\n tagName: 'input',\n id: cID,\n // name: cID, - prevent saving the value to a form\n type: format === 'hex' ? 'text' : 'number',\n value: c === 'alpha' ? '100' : '0',\n className: `color-input ${c}`,\n autocomplete: 'off',\n spellcheck: false,\n } as Partial) as HTMLInputElement;\n\n // alpha\n let max = '100';\n let step = '1';\n if (c !== 'alpha') {\n if (format === 'rgb') {\n max = '255';\n step = '1';\n } else if (c === 'hue') {\n max = '360';\n step = '1';\n }\n }\n ObjectAssign(cInput, {\n min: '0',\n max,\n step,\n });\n colorForm.append(cInputLabel, cInput);\n });\n return colorForm;\n};\n\nexport default getColorForm;\n","import { createElement } from '@thednp/shorty';\n\nimport ColorPicker from '..';\n\n/**\n * Returns all color controls for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns color controls\n */\nconst getColorControls = (self: ColorPicker): HTMLElement => {\n const { format, componentLabels } = self;\n const { hueLabel, alphaLabel, lightnessLabel, saturationLabel, whitenessLabel, blacknessLabel } = componentLabels;\n\n const max1 = format === 'hsl' ? 360 : 100;\n const max2 = format === 'hsl' ? 100 : 360;\n const max3 = 100;\n\n let ctrl1Label = format === 'hsl' ? `${hueLabel} & ${lightnessLabel}` : `${lightnessLabel} & ${saturationLabel}`;\n\n ctrl1Label = format === 'hwb' ? `${whitenessLabel} & ${blacknessLabel}` : ctrl1Label;\n\n const ctrl2Label = format === 'hsl' ? `${saturationLabel}` : `${hueLabel}`;\n\n const colorControls = createElement({\n tagName: 'div',\n className: `color-controls ${format}`,\n }) as HTMLElement;\n\n const colorPointer = 'color-pointer';\n const colorSlider = 'color-slider';\n\n const controls = [\n {\n i: 1,\n c: colorPointer,\n l: ctrl1Label,\n min: 0,\n max: max1,\n },\n {\n i: 2,\n c: colorSlider,\n l: ctrl2Label,\n min: 0,\n max: max2,\n },\n {\n i: 3,\n c: colorSlider,\n l: alphaLabel,\n min: 0,\n max: max3,\n },\n ];\n\n controls.forEach(template => {\n const { i, c, l, min, max } = template;\n const control = createElement({\n tagName: 'div',\n className: 'color-control',\n role: 'presentation',\n }) as HTMLElement;\n\n control.append(\n createElement({\n tagName: 'div',\n className: `visual-control visual-control${i}`,\n }) as HTMLElement,\n );\n\n const knob = createElement({\n tagName: 'div',\n className: `${c} knob`,\n ariaLive: 'polite',\n ariaLabel: l,\n role: 'slider',\n tabIndex: 0,\n ariaValueMin: `${min}`,\n ariaValueMax: `${max}`,\n }) as HTMLElement;\n\n control.append(knob);\n colorControls.append(control);\n });\n\n return colorControls;\n};\n\nexport default getColorControls;\n","import { setAttribute, getAttribute, createElement, setElementStyle } from '@thednp/shorty';\n\nimport Color from '@thednp/color';\nimport ColorPalette from '../colorPalette';\nimport ColorPicker from '../index';\n\n/**\n * Returns a color-defaults with given values and class.\n */\nconst getColorMenu = (self: ColorPicker, colorsSource: ColorPalette | string[], menuClass: string): HTMLElement => {\n const { input, format, componentLabels } = self;\n const { defaultsLabel, presetsLabel } = componentLabels;\n const isOptionsMenu = menuClass === 'color-options';\n const isPalette = colorsSource instanceof ColorPalette;\n const menuLabel = isOptionsMenu ? presetsLabel : defaultsLabel;\n const colorsArray = isPalette ? colorsSource.colors : colorsSource;\n const colorsCount = colorsArray.length;\n const { lightSteps } = isPalette ? colorsSource : { lightSteps: null };\n const fit = lightSteps || [9, 10].find(x => colorsCount >= x * 2 && !(colorsCount % x)) || 5;\n const isMultiLine = isOptionsMenu && colorsCount > fit;\n let rowCountHover = 2;\n rowCountHover = isMultiLine && colorsCount > fit * 2 ? 3 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 3 ? 4 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 4 ? 5 : rowCountHover;\n const rowCount = rowCountHover - (colorsCount <= fit * 3 ? 1 : 2);\n const isScrollable = isMultiLine && colorsCount > rowCount * fit;\n let finalClass = menuClass;\n finalClass += isScrollable ? ' scrollable' : '';\n finalClass += isMultiLine ? ' multiline' : '';\n const gap = isMultiLine ? '1px' : '0.25rem';\n let optionSize = isMultiLine ? 1.75 : 2;\n optionSize = fit > 5 && isMultiLine ? 1.5 : optionSize;\n const menuHeight = `${rowCount * optionSize}rem`;\n const menuHeightHover = `calc(${rowCountHover} * ${optionSize}rem + ${rowCountHover - 1} * ${gap})`;\n\n //
            is an `HTMLElement`\n const menu = createElement({\n tagName: 'ul',\n className: finalClass,\n role: 'listbox',\n ariaLabel: menuLabel,\n }) as HTMLElement;\n\n if (isScrollable) {\n setElementStyle(menu, {\n '--grid-item-size': `${optionSize}rem`,\n '--grid-fit': `${fit}`,\n '--grid-gap': gap,\n '--grid-height': menuHeight,\n '--grid-hover-height': menuHeightHover,\n });\n }\n\n colorsArray.forEach(x => {\n let [value, label] = typeof x === 'string' ? x.trim().split(':') : [];\n if (x instanceof Color) {\n value = x.toHexString();\n label = value;\n }\n const color = new Color(x instanceof Color ? x : value, format);\n const isActive = color.toString() === getAttribute(input, 'value');\n const active = isActive ? ' active' : '';\n\n const option = createElement({\n tagName: 'li',\n className: `color-option${active}`,\n innerText: `${label || value}`,\n tabIndex: 0,\n role: 'option',\n ariaSelected: isActive ? 'true' : 'false',\n }) as HTMLElement;\n setAttribute(option, 'data-value', `${value}`);\n\n if (isOptionsMenu) {\n setElementStyle(option, { backgroundColor: value });\n }\n\n menu.append(option);\n });\n return menu;\n};\n\nexport default getColorMenu;\n","import {\n getAttribute,\n setAttribute,\n toUpperCase,\n ariaHidden,\n tabindex,\n createElement,\n createElementNS,\n} from '@thednp/shorty';\n\nimport Color from '@thednp/color';\n\nimport getColorForm from './getColorForm';\nimport getColorControls from './getColorControls';\nimport getColorMenu from './getColorMenu';\nimport vHidden from './vHidden';\n\nimport ColorPicker from '../index';\n\n/**\n * Generate HTML markup and update instance properties.\n *\n * @param self\n */\nconst setMarkup = (self: ColorPicker) => {\n const { input, parent, format, id, componentLabels, colorKeywords, colorPresets } = self;\n const colorValue = getAttribute(input, 'value') || '#fff';\n const { nonColors } = Color;\n\n const { toggleLabel, pickerLabel, formatLabel, hexLabel } = componentLabels;\n\n // update color\n const color = nonColors.includes(colorValue) ? '#fff' : colorValue;\n self.color = new Color(color, format);\n\n // set initial controls dimensions\n const formatString = format === 'hex' ? hexLabel : toUpperCase(format);\n\n const pickerBtn = createElement({\n id: `picker-btn-${id}`,\n tagName: 'button',\n className: 'picker-toggle btn-appearance',\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLElement;\n\n pickerBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${pickerLabel}. ${formatLabel}: ${formatString}`,\n }) as HTMLElement,\n );\n\n const pickerDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown picker',\n role: 'group',\n ariaLabelledBy: `picker-btn-${id}`,\n } as Partial & { ariaLabelledBy: string }) as HTMLElement;\n\n const colorControls = getColorControls(self);\n const colorForm = getColorForm(self);\n\n pickerDropdown.append(colorControls, colorForm);\n input.before(pickerBtn);\n parent.append(pickerDropdown);\n\n // set colour key menu template\n if (colorKeywords || colorPresets) {\n const presetsDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown scrollable menu',\n }) as HTMLElement;\n\n // color presets\n if (colorPresets) {\n presetsDropdown.append(getColorMenu(self, colorPresets, 'color-options'));\n }\n\n // explicit defaults [reset, initial, inherit, transparent, currentColor]\n // also custom defaults [default: #069, complementary: #930]\n if (colorKeywords && colorKeywords.length) {\n presetsDropdown.append(getColorMenu(self, colorKeywords, 'color-defaults'));\n }\n\n const presetsBtn = createElement({\n tagName: 'button',\n className: 'menu-toggle btn-appearance',\n tabIndex: -1,\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLElement;\n\n const xmlns = encodeURI('http://www.w3.org/2000/svg');\n const presetsIcon = createElementNS(xmlns, {\n tagName: 'svg',\n }) as HTMLElement;\n setAttribute(presetsIcon, 'xmlns', xmlns);\n setAttribute(presetsIcon, 'viewBox', '0 0 512 512');\n setAttribute(presetsIcon, ariaHidden, 'true');\n\n const path = createElementNS(xmlns, {\n tagName: 'path',\n }) as HTMLElement;\n setAttribute(path, 'd', 'M98,158l157,156L411,158l27,27L255,368L71,185L98,158z');\n setAttribute(path, 'fill', '#fff');\n presetsIcon.append(path);\n presetsBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${toggleLabel}`,\n }) as HTMLElement,\n presetsIcon,\n );\n\n parent.append(presetsBtn, presetsDropdown);\n }\n\n // solve non-colors after settings save\n if (colorKeywords && nonColors.includes(colorValue)) {\n self.value = colorValue;\n }\n setAttribute(input, tabindex, '-1');\n};\n\nexport default setMarkup;\n","import { addListener, removeListener } from '@thednp/event-listener';\n\nimport {\n ariaDescription,\n ariaSelected,\n ariaValueNow,\n ariaValueText,\n ariaExpanded,\n keyArrowDown,\n keyArrowUp,\n keyArrowLeft,\n keyArrowRight,\n keyEnter,\n keySpace,\n keyEscape,\n focusinEvent,\n mouseclickEvent,\n keydownEvent,\n changeEvent,\n touchmoveEvent,\n pointerdownEvent,\n pointermoveEvent,\n pointerupEvent,\n tabindex,\n focusoutEvent,\n resizeEvent,\n keyupEvent,\n scrollEvent,\n dispatchEvent,\n getElementsByClassName,\n closest,\n querySelector,\n getElementTransitionDuration,\n getBoundingClientRect,\n getUID,\n getElementStyle,\n getDocumentElement,\n getDocument,\n ObjectAssign,\n ObjectFromEntries,\n Data,\n getInstance,\n setElementStyle,\n normalizeOptions,\n reflow,\n focus,\n hasClass,\n addClass,\n removeClass,\n setAttribute,\n getAttribute,\n removeAttribute,\n isArray,\n isString,\n getWindow,\n} from '@thednp/shorty';\n\n// ColorPicker Util\n// ================\nimport Color from '@thednp/color';\nimport type { RGBA, HWBA, HSLA, HSVA } from '@thednp/color';\n\nimport ColorPalette from './colorPalette';\nimport colorPickerLabels from './util/colorPickerLabels';\nimport colorNames from './util/colorNames';\nimport isValidJSON from './util/isValidJSON';\nimport setMarkup from './util/setMarkup';\n\nimport ColorPickerOptions from './interface/colorPickerOptions';\nimport ColorPickerLabels from './interface/colorPickerLabels';\nimport type ColorNames from './interface/ColorNames';\nimport { version } from '../../package.json';\n\n// ColorPicker GC\n// ==============\nconst colorPickerString = 'color-picker';\nconst colorPickerSelector = `[data-function=\"${colorPickerString}\"]`;\nconst colorPickerParentSelector = `.${colorPickerString}`;\nconst colorPickerDefaults: ColorPickerOptions = {\n componentLabels: colorPickerLabels,\n colorLabels: colorNames,\n format: 'rgb',\n colorPresets: false,\n colorKeywords: false,\n};\nconst { roundPart, nonColors } = Color;\n\n// ColorPicker Static Methods\n// ==========================\nconst getColorPickerInstance = (element: HTMLInputElement) => getInstance(element, colorPickerString);\nconst initColorPicker = (element: HTMLInputElement) => new ColorPicker(element);\n\n// ColorPicker Private Methods\n// ===========================\n\n/**\n * Add / remove `ColorPicker` main event listeners.\n */\nconst toggleEvents = (self: ColorPicker, action?: boolean) => {\n const fn = action ? addListener : removeListener;\n const { input, pickerToggle, menuToggle } = self;\n\n fn(input, focusinEvent, self.showPicker);\n fn(pickerToggle, mouseclickEvent, self.togglePicker);\n\n if (menuToggle) {\n fn(menuToggle, mouseclickEvent, self.toggleMenu);\n }\n};\n\n/**\n * Add / remove `ColorPicker` event listeners active only when open.\n */\nconst toggleEventsOnShown = (self: ColorPicker, action?: boolean) => {\n const fn = action ? addListener : removeListener;\n const { input, colorMenu, parent } = self;\n const doc = getDocument(input);\n const win = getWindow(doc);\n\n fn(self.controls, pointerdownEvent, self.pointerDown as EventListener);\n self.controlKnobs.forEach(x => fn(x, keydownEvent, self.handleKnobs as EventListener));\n\n fn(win, scrollEvent, self.handleScroll);\n fn(win, resizeEvent, self.update);\n\n [input, ...self.inputs].forEach(x => fn(x, changeEvent, self.changeHandler));\n\n if (colorMenu) {\n fn(colorMenu, mouseclickEvent, self.menuClickHandler);\n fn(colorMenu, keydownEvent, self.menuKeyHandler as EventListener);\n }\n\n fn(doc, pointermoveEvent, self.pointerMove as EventListener);\n fn(doc, pointerupEvent, self.pointerUp as EventListener);\n fn(parent, focusoutEvent, self.handleFocusOut as EventListener);\n fn(doc, keyupEvent, self.handleDismiss as EventListener);\n};\n\n/**\n * Triggers the `ColorPicker` original event.\n */\nconst firePickerChange = (self: ColorPicker) => {\n dispatchEvent(self.input, new CustomEvent('colorpicker.change'));\n};\n\n/**\n * Hides a visible dropdown.\n */\nconst removePosition = (element: HTMLElement) => {\n /* istanbul ignore else */\n if (element) {\n ['bottom', 'top'].forEach(x => removeClass(element, x));\n }\n};\n\n/**\n * Shows a `ColorPicker` dropdown and close the curent open dropdown.\n */\nconst showDropdown = (self: ColorPicker, dropdown: HTMLElement) => {\n const { colorPicker, colorMenu, menuToggle, pickerToggle, parent } = self;\n const isPicker = dropdown === colorPicker;\n const openDropdown = isPicker ? colorMenu : colorPicker;\n const activeBtn = isPicker ? menuToggle : pickerToggle;\n const nextBtn = !isPicker ? menuToggle : pickerToggle;\n\n if (!hasClass(parent, 'open')) {\n addClass(parent, 'open');\n }\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n removePosition(openDropdown);\n }\n addClass(dropdown, 'bottom');\n reflow(dropdown);\n addClass(dropdown, 'show');\n\n if (isPicker) self.update();\n\n if (!self.isOpen) {\n toggleEventsOnShown(self, true);\n self.updateDropdownPosition();\n self.isOpen = true;\n setAttribute(self.input, tabindex, '0');\n if (menuToggle) {\n setAttribute(menuToggle, tabindex, '0');\n }\n }\n\n setAttribute(nextBtn, ariaExpanded, 'true');\n if (activeBtn) {\n setAttribute(activeBtn, ariaExpanded, 'false');\n }\n};\n\n/**\n * Color Picker Web Component\n *\n * @see http://thednp.github.io/color-picker\n */\nexport default class ColorPicker {\n // bring utils to staic\n public static Color = Color;\n public static ColorPalette = ColorPalette;\n public static getInstance = getColorPickerInstance;\n public static init = initColorPicker;\n public static selector = colorPickerSelector;\n // utils important for render\n public static roundPart = roundPart;\n public static setElementStyle = setElementStyle;\n public static setAttribute = setAttribute;\n public static getBoundingClientRect = getBoundingClientRect;\n public static version = version;\n public static colorNames = colorNames;\n public static colorPickerLabels = colorPickerLabels;\n\n id: number;\n input: HTMLInputElement;\n color: Color;\n format = 'rgb';\n parent: HTMLElement;\n dragElement: HTMLElement | undefined;\n isOpen = false;\n controlPositions: {\n c1x: number;\n c1y: number;\n c2y: number;\n c3y: number;\n };\n colorLabels: ColorNames = ObjectFromEntries(colorNames.map(c => [c, c])) as ColorNames;\n colorKeywords: string[] | false;\n colorPresets: ColorPalette | string[] | false;\n componentLabels: ColorPickerLabels;\n pickerToggle: HTMLElement;\n menuToggle: HTMLElement;\n colorPicker: HTMLElement;\n colorMenu: HTMLElement;\n controls: HTMLElement;\n inputs: HTMLInputElement[];\n controlKnobs: HTMLElement[];\n visuals: HTMLElement[];\n\n /**\n * Returns a new `ColorPicker` instance. The target of this constructor\n * must be an `HTMLInputElement`.\n *\n * @param target the target `` element\n * @param config instance options\n */\n constructor(target: (HTMLElement & HTMLInputElement) | string, config?: Partial) {\n const input = querySelector(target) as HTMLInputElement;\n\n // invalidate\n if (typeof target === 'undefined') throw new TypeError(`ColorPicker target not specified.`);\n if (isString(target) && !input) throw new TypeError(`ColorPicker target \"${target}\" cannot be found.`);\n this.input = input;\n\n const parent = closest(input, colorPickerParentSelector);\n if (!parent) throw new TypeError('ColorPicker requires a specific markup to work.');\n\n this.parent = parent;\n this.id = getUID(input, colorPickerString);\n this.dragElement = undefined;\n this.isOpen = false;\n this.controlPositions = {\n c1x: 0,\n c1y: 0,\n c2y: 0,\n c3y: 0,\n };\n // this.colorLabels = {};\n this.colorKeywords = false;\n this.colorPresets = false;\n\n // process options\n const { format, componentLabels, colorLabels, colorKeywords, colorPresets } = normalizeOptions(\n input,\n colorPickerDefaults,\n config || {},\n );\n\n let translatedColorLabels = colorNames;\n /* istanbul ignore else */\n if (isArray(colorLabels) && colorLabels.length === 17) {\n translatedColorLabels = colorLabels;\n } else if (isString(colorLabels) && colorLabels.split(',').length === 17) {\n translatedColorLabels = colorLabels.split(',');\n }\n\n // expose colour labels to all methods\n ObjectAssign(this.colorLabels, ObjectFromEntries(translatedColorLabels.map((c, i) => [colorNames[i], c])));\n\n // update and expose component labels\n const tempComponentLabels =\n isString(componentLabels) && isValidJSON(componentLabels)\n ? (JSON.parse(componentLabels) as ColorPickerLabels)\n : componentLabels;\n this.componentLabels = ObjectAssign({ ...colorPickerLabels }, tempComponentLabels);\n this.color = new Color(input.value || '#fff', format);\n this.format = format;\n\n // set colour defaults\n if (isArray(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords;\n } else if (isString(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords.split(',').map(x => x.trim());\n }\n\n // set colour presets\n if (isArray(colorPresets) && colorPresets.length) {\n this.colorPresets = colorPresets;\n } else if (colorPresets && isValidJSON(colorPresets)) {\n const { hue, hueSteps, lightSteps, saturation } = JSON.parse(colorPresets) as {\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n };\n this.colorPresets = new ColorPalette(hue, hueSteps, lightSteps, saturation);\n } else if (isString(colorPresets)) {\n this.colorPresets = colorPresets.split(',').map((x: string) => x.trim());\n }\n\n // generate markup\n setMarkup(this);\n\n const [colorPicker, colorMenu] = getElementsByClassName('color-dropdown', parent);\n // set main elements\n this.pickerToggle = querySelector('.picker-toggle', parent) as HTMLElement;\n this.menuToggle = querySelector('.menu-toggle', parent) as HTMLElement;\n this.colorPicker = colorPicker;\n this.colorMenu = colorMenu;\n this.inputs = [...getElementsByClassName('color-input', parent)] as HTMLInputElement[];\n const [controls] = getElementsByClassName('color-controls', parent);\n this.controls = controls;\n this.controlKnobs = [...getElementsByClassName('knob', controls)];\n this.visuals = [...getElementsByClassName('visual-control', controls)];\n\n // update colour picker controls, inputs and visuals\n this.update();\n // console.log(this)\n\n // add main events listeners\n toggleEvents(this, true);\n\n // set component data\n Data.set(input, colorPickerString, this);\n }\n\n /** Returns the current colour value */\n get value(): string {\n return this.input.value;\n }\n\n /**\n * Sets a new colour value.\n *\n * @param {string} v new colour value\n */\n set value(v: string) {\n this.input.value = v;\n }\n\n /** Check if the colour presets include any non-colour. */\n get hasNonColor(): boolean {\n return this.colorKeywords instanceof Array && this.colorKeywords.some(x => nonColors.includes(x));\n }\n\n /** Returns hexadecimal value of the current colour. */\n get hex(): string {\n return this.color.toHex(true);\n }\n\n /** Returns the current colour value in {h,s,v,a} object format. */\n get hsv(): HSVA {\n return this.color.toHsv();\n }\n\n /** Returns the current colour value in {h,s,l,a} object format. */\n get hsl(): HSLA {\n return this.color.toHsl();\n }\n\n /** Returns the current colour value in {h,w,b,a} object format. */\n get hwb(): HWBA {\n return this.color.toHwb();\n }\n\n /** Returns the current colour value in {r,g,b,a} object format. */\n get rgb(): RGBA {\n return this.color.toRgb();\n }\n\n /** Returns the current colour brightness. */\n get brightness(): number {\n return this.color.brightness;\n }\n\n /** Returns the current colour luminance. */\n get luminance(): number {\n return this.color.luminance;\n }\n\n /** Checks if the current colour requires a light text colour. */\n get isDark(): boolean {\n const { color, brightness } = this;\n return brightness < 120 && color.a > 0.33;\n }\n\n /** Checks if the current input value is a valid colour. */\n get isValid(): boolean {\n const inputValue = this.input.value;\n return inputValue !== '' && new Color(inputValue).isValid;\n }\n\n /** Returns the colour appearance, usually the closest colour name for the current value. */\n get appearance(): string {\n const { colorLabels, hsl, hsv, format } = this;\n\n const hue = roundPart(hsl.h * 360);\n const saturationSource = format === 'hsl' ? hsl.s : hsv.s;\n const saturation = roundPart(saturationSource * 100);\n const lightness = roundPart(hsl.l * 100);\n const hsvl = hsv.v * 100;\n\n let colorName = 'black';\n\n // determine color appearance\n /* istanbul ignore else */\n if (lightness === 100 && saturation === 0) {\n colorName = colorLabels.white;\n } else if (lightness === 0) {\n colorName = colorLabels.black;\n } else if (saturation === 0) {\n colorName = colorLabels.grey;\n } else if (hue < 15 || hue >= 345) {\n colorName = colorLabels.red;\n } else if (hue >= 15 && hue < 45) {\n colorName = hsvl > 80 && saturation > 80 ? colorLabels.orange : colorLabels.brown;\n } else if (hue >= 45 && hue < 75) {\n const isGold = hue > 46 && hue < 54 && hsvl < 80 && saturation > 90;\n const isOlive = hue >= 54 && hue < 75 && hsvl < 80;\n colorName = isGold ? colorLabels.gold : colorLabels.yellow;\n colorName = isOlive ? colorLabels.olive : colorName;\n } else if (hue >= 75 && hue < 155) {\n colorName = hsvl < 68 ? colorLabels.green : colorLabels.lime;\n } else if (hue >= 155 && hue < 175) {\n colorName = colorLabels.teal;\n } else if (hue >= 175 && hue < 195) {\n colorName = colorLabels.cyan;\n } else if (hue >= 195 && hue < 255) {\n colorName = colorLabels.blue;\n } else if (hue >= 255 && hue < 270) {\n colorName = colorLabels.violet;\n } else if (hue >= 270 && hue < 295) {\n colorName = colorLabels.magenta;\n } else if (hue >= 295 && hue < 345) {\n colorName = colorLabels.pink;\n }\n return colorName;\n }\n\n /** Updates `ColorPicker` visuals. */\n updateVisuals(): void {\n const { controlPositions, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { offsetHeight } = v1;\n const hue = controlPositions.c2y / offsetHeight;\n const { r, g, b } = new Color({ h: hue, s: 1, l: 0.5 }).toRgb();\n const whiteGrad = 'linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)';\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n const roundA = roundPart(alpha * 100) / 100;\n\n const fill = new Color({\n h: hue,\n s: 1,\n l: 0.5,\n a: alpha,\n }).toRgbString();\n const hueGradient = `linear-gradient(\n rgb(255,0,0) 0%, rgb(255,255,0) 16.67%,\n rgb(0,255,0) 33.33%, rgb(0,255,255) 50%,\n rgb(0,0,255) 66.67%, rgb(255,0,255) 83.33%,\n rgb(255,0,0) 100%)`;\n setElementStyle(v1, {\n background: `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,${roundA}) 100%),\n linear-gradient(to right, rgba(255,255,255,${roundA}) 0%, ${fill} 100%),\n ${whiteGrad}`,\n });\n setElementStyle(v2, { background: hueGradient });\n\n setElementStyle(v3, {\n background: `linear-gradient(rgba(${r},${g},${b},1) 0%,rgba(${r},${g},${b},0) 100%)`,\n });\n }\n\n /**\n * The `ColorPicker` *focusout* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleFocusOut = ({ relatedTarget }: FocusEvent & { relatedTarget: HTMLElement }): void => {\n if (relatedTarget && !this.parent.contains(relatedTarget)) {\n this.hide(true);\n }\n };\n\n /**\n * The `ColorPicker` *keyup* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleDismiss = ({ code }: KeyboardEvent): void => {\n if (this.isOpen && code === keyEscape) {\n this.hide();\n }\n };\n\n /**\n * The `ColorPicker` *scroll* event listener when open.\n *\n * @param e\n */\n handleScroll = (e: Event) => {\n const { activeElement } = getDocument(this.input);\n\n this.updateDropdownPosition();\n\n /* istanbul ignore next */\n if (\n ([pointermoveEvent, touchmoveEvent].includes(e.type) && this.dragElement) ||\n (activeElement && this.controlKnobs.includes(activeElement as HTMLElement))\n ) {\n e.stopPropagation();\n e.preventDefault();\n }\n };\n\n /**\n * The `ColorPicker` keyboard event listener for menu navigation.\n *\n * @param e\n */\n menuKeyHandler = (e: KeyboardEvent & { target: HTMLElement }) => {\n const { target, code } = e;\n const { previousElementSibling, nextElementSibling, parentElement } = target;\n const isColorOptionsMenu = parentElement && hasClass(parentElement, 'color-options');\n const allSiblings = parentElement ? [...parentElement.children] : [];\n const columnsCount =\n isColorOptionsMenu && getElementStyle(parentElement, 'grid-template-columns').split(' ').length;\n const currentIndex = allSiblings.indexOf(target);\n const previousElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex - columnsCount];\n const nextElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex + columnsCount];\n\n if ([keyArrowDown, keyArrowUp, keySpace].includes(code)) {\n // prevent scroll when navigating the menu via arrow keys / Space\n e.preventDefault();\n }\n if (isColorOptionsMenu) {\n if (previousElement && code === keyArrowUp) {\n focus(previousElement as HTMLElement);\n } else if (nextElement && code === keyArrowDown) {\n focus(nextElement as HTMLElement);\n } else if (previousElementSibling && code === keyArrowLeft) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && code === keyArrowRight) {\n focus(nextElementSibling as HTMLElement);\n }\n } else if (previousElementSibling && [keyArrowLeft, keyArrowUp].includes(code)) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && [keyArrowRight, keyArrowDown].includes(code)) {\n focus(nextElementSibling as HTMLElement);\n }\n\n if ([keyEnter, keySpace].includes(code)) {\n this.menuClickHandler(e);\n }\n };\n\n /**\n * The `ColorPicker` click event listener for the colour menu presets / defaults.\n *\n * @param e\n * @this {ColorPicker}\n */\n menuClickHandler = (e: Event) => {\n const { target } = e;\n const { colorMenu } = this;\n const newOption = (getAttribute(target as HTMLElement, 'data-value') || '').trim();\n // invalidate for targets other than color options\n if (!newOption.length) return;\n const currentActive = querySelector('li.active', colorMenu);\n let newColor = newOption;\n newColor = nonColors.includes(newColor) ? 'white' : newColor;\n newColor = newColor === 'transparent' ? 'rgba(0,0,0,0)' : newColor;\n\n const { r, g, b, a } = new Color(newColor);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n this.update();\n\n /* istanbul ignore else */\n if (currentActive !== target) {\n /* istanbul ignore else */\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n\n addClass(target as HTMLElement, 'active');\n setAttribute(target as HTMLElement, ariaSelected, 'true');\n\n if (nonColors.includes(newOption)) {\n this.value = newOption;\n }\n firePickerChange(this);\n }\n };\n\n /**\n * The `ColorPicker` *touchstart* / *mousedown* events listener for control knobs.\n *\n * @param e\n */\n pointerDown = (e: PointerEvent & { target: HTMLElement }) => {\n if (e.button !== 0) return;\n const { target, pageX, pageY } = e;\n const { colorMenu, visuals, controlKnobs } = this;\n const [v1, v2, v3] = visuals;\n const [c1, c2, c3] = controlKnobs;\n const visual = controlKnobs.includes(target) ? (target.previousElementSibling as HTMLElement) : target;\n const visualRect = getBoundingClientRect(visual);\n const html = getDocumentElement(v1);\n const offsetX = pageX - html.scrollLeft - visualRect.left;\n const offsetY = pageY - html.scrollTop - visualRect.top;\n\n /* istanbul ignore else */\n if (target === v1 || target === c1) {\n this.dragElement = visual;\n this.changeControl1(offsetX, offsetY);\n } else if (target === v2 || target === c2) {\n this.dragElement = visual;\n this.changeControl2(offsetY);\n } else if (target === v3 || target === c3) {\n this.dragElement = visual;\n this.changeAlpha(offsetY);\n }\n\n if (colorMenu) {\n const currentActive = querySelector('li.active', colorMenu);\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n }\n e.preventDefault();\n };\n\n /**\n * The `ColorPicker` *touchend* / *mouseup* events listener for control knobs.\n *\n * @param e\n * @this\n */\n pointerUp = ({ target }: PointerEvent & { target: HTMLElement }) => {\n const { parent } = this;\n const doc = getDocument(parent);\n const currentOpen = querySelector(`${colorPickerParentSelector}.open`, doc) !== null;\n const selection = doc.getSelection();\n\n if (!this.dragElement && (!selection || !selection.toString().length) && !parent.contains(target)) {\n this.hide(currentOpen);\n }\n\n this.dragElement = undefined;\n };\n\n /**\n * The `ColorPicker` *touchmove* / *mousemove* events listener for control knobs.\n *\n * @param {PointerEvent} e\n */\n pointerMove = (e: PointerEvent) => {\n const { dragElement, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { pageX, pageY } = e;\n\n if (!dragElement) return;\n\n const controlRect = getBoundingClientRect(dragElement);\n const win = getDocumentElement(v1);\n const offsetX = pageX - win.scrollLeft - controlRect.left;\n const offsetY = pageY - win.scrollTop - controlRect.top;\n\n if (dragElement === v1) {\n this.changeControl1(offsetX, offsetY);\n }\n\n if (dragElement === v2) {\n this.changeControl2(offsetY);\n }\n\n if (dragElement === v3) {\n this.changeAlpha(offsetY);\n }\n };\n\n /**\n * The `ColorPicker` *keydown* event listener for control knobs.\n *\n * @param e\n */\n handleKnobs = (e: Event & { code: string }) => {\n const { target, code } = e;\n\n // only react to arrow buttons\n if (![keyArrowUp, keyArrowDown, keyArrowLeft, keyArrowRight].includes(code)) return;\n e.preventDefault();\n\n const { controlKnobs, visuals } = this;\n const { offsetWidth, offsetHeight } = visuals[0];\n const [c1, c2, c3] = controlKnobs;\n const { activeElement } = getDocument(c1);\n const currentKnob = controlKnobs.find(x => x === activeElement);\n const yRatio = offsetHeight / 360;\n\n /* istanbul ignore else */\n if (currentKnob) {\n let offsetX = 0;\n let offsetY = 0;\n\n /* istanbul ignore else */\n if (target === c1) {\n const xRatio = offsetWidth / 100;\n\n /* istanbul ignore else */\n if ([keyArrowLeft, keyArrowRight].includes(code)) {\n this.controlPositions.c1x += code === keyArrowRight ? xRatio : -xRatio;\n } else if ([keyArrowUp, keyArrowDown].includes(code)) {\n this.controlPositions.c1y += code === keyArrowDown ? yRatio : -yRatio;\n }\n\n offsetX = this.controlPositions.c1x;\n offsetY = this.controlPositions.c1y;\n this.changeControl1(offsetX, offsetY);\n } else if (target === c2) {\n this.controlPositions.c2y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c2y;\n this.changeControl2(offsetY);\n } else if (target === c3) {\n this.controlPositions.c3y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c3y;\n this.changeAlpha(offsetY);\n }\n this.handleScroll(e);\n }\n };\n\n /** The event listener of the colour form inputs. */\n changeHandler = (): void => {\n let colorSource;\n const { inputs, format, value: currentValue, input, controlPositions, visuals } = this;\n const { activeElement } = getDocument(input);\n const { offsetHeight } = visuals[0];\n const [i1, , , i4] = inputs;\n const [v1, v2, v3, v4] =\n format === 'rgb'\n ? inputs.map(i => parseFloat(i.value) / (i === i4 ? 100 : 1))\n : inputs.map(i => parseFloat(i.value) / (i !== i1 ? 100 : 360));\n const isNonColorValue = this.hasNonColor && nonColors.includes(currentValue);\n const alpha = i4 ? v4 : 1 - controlPositions.c3y / offsetHeight;\n\n /* istanbul ignore else */\n if (activeElement === input || (activeElement && inputs.includes(activeElement as HTMLInputElement))) {\n if (activeElement === input) {\n if (isNonColorValue) {\n colorSource = currentValue === 'transparent' ? 'rgba(0,0,0,0)' : 'rgb(0,0,0)';\n } else {\n colorSource = currentValue;\n }\n } else if (format === 'hex') {\n colorSource = i1.value;\n } else if (format === 'hsl') {\n colorSource = {\n h: v1,\n s: v2,\n l: v3,\n a: alpha,\n };\n } else if (format === 'hwb') {\n colorSource = {\n h: v1,\n w: v2,\n b: v3,\n a: alpha,\n };\n } else {\n colorSource = {\n r: v1,\n g: v2,\n b: v3,\n a: alpha,\n };\n }\n\n const { r, g, b, a } = new Color(colorSource);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n this.setControlPositions();\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n\n // set non-color keyword\n if (activeElement === input && isNonColorValue) {\n this.value = currentValue;\n }\n }\n };\n\n /**\n * Updates `ColorPicker` first control:\n * * `lightness` and `saturation` for HEX/RGB;\n * * `lightness` and `hue` for HSL.\n *\n * @param X the X component of the offset\n * @param Y the Y component of the offset\n */\n changeControl1(X: number, Y: number): void {\n let [offsetX, offsetY] = [0, 0];\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n if (X > offsetWidth) offsetX = offsetWidth;\n else if (X >= 0) offsetX = X;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = controlPositions.c2y / offsetHeight;\n\n const saturation = offsetX / offsetWidth;\n\n const lightness = 1 - offsetY / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new positions\n this.controlPositions.c1x = offsetX;\n this.controlPositions.c1y = offsetY;\n\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` second control:\n * * `hue` for HEX/RGB/HWB;\n * * `saturation` for HSL.\n *\n * @param Y the Y offset\n */\n changeControl2(Y: number) {\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = offsetY / offsetHeight;\n const saturation = controlPositions.c1x / offsetWidth;\n const lightness = 1 - controlPositions.c1y / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new position\n this.controlPositions.c2y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` last control,\n * the `alpha` channel.\n *\n * @param Y\n */\n changeAlpha(Y: number) {\n const { visuals } = this;\n const { offsetHeight } = visuals[0];\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n // update color alpha\n const alpha = 1 - offsetY / offsetHeight;\n this.color.setAlpha(alpha);\n // update position\n this.controlPositions.c3y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` control positions on:\n * * initialization\n * * window resize\n */\n update = () => {\n this.updateDropdownPosition();\n this.updateAppearance();\n this.setControlPositions();\n this.updateInputs(true);\n this.updateControls();\n this.updateVisuals();\n };\n\n /** Updates the open dropdown position on *scroll* event. */\n updateDropdownPosition() {\n const { input, colorPicker, colorMenu } = this;\n const elRect = getBoundingClientRect(input);\n const { top, bottom } = elRect;\n const { offsetHeight: elHeight } = input;\n const windowHeight = getDocumentElement(input).clientHeight;\n const isPicker = hasClass(colorPicker, 'show');\n const dropdown = isPicker ? colorPicker : colorMenu;\n if (!dropdown) return;\n const { offsetHeight: dropHeight } = dropdown;\n const distanceBottom = windowHeight - bottom;\n const distanceTop = top;\n const bottomExceed = top + dropHeight + elHeight > windowHeight; // show\n const topExceed = top - dropHeight < 0; // show-top\n\n if ((hasClass(dropdown, 'bottom') || !topExceed) && distanceBottom < distanceTop && bottomExceed) {\n removeClass(dropdown, 'bottom');\n addClass(dropdown, 'top');\n } else {\n removeClass(dropdown, 'top');\n addClass(dropdown, 'bottom');\n }\n }\n\n /** Updates control knobs' positions. */\n setControlPositions() {\n const { visuals, color, hsv } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n const alpha = color.a;\n const hue = hsv.h;\n\n const saturation = hsv.s;\n const lightness = hsv.v;\n\n this.controlPositions.c1x = saturation * offsetWidth;\n this.controlPositions.c1y = (1 - lightness) * offsetHeight;\n this.controlPositions.c2y = hue * offsetHeight;\n this.controlPositions.c3y = (1 - alpha) * offsetHeight;\n }\n\n /** Update the visual appearance label and control knob labels. */\n updateAppearance() {\n const { componentLabels, color, parent, hsv, hex, format, controlKnobs } = this;\n const { appearanceLabel, hexLabel, valueLabel } = componentLabels;\n let { r, g, b } = color.toRgb();\n const [knob1, knob2, knob3] = controlKnobs;\n const hue = roundPart(hsv.h * 360);\n const alpha = color.a;\n const saturation = roundPart(hsv.s * 100);\n const lightness = roundPart(hsv.v * 100);\n const colorName = this.appearance;\n\n let colorLabel = `${hexLabel} ${hex.split('').join(' ')}`;\n\n if (format === 'hwb') {\n const { hwb } = this;\n const whiteness = roundPart(hwb.w * 100);\n const blackness = roundPart(hwb.b * 100);\n colorLabel = `HWB: ${hue}°, ${whiteness}%, ${blackness}%`;\n setAttribute(knob1, ariaValueText, `${whiteness}% & ${blackness}%`);\n setAttribute(knob1, ariaValueNow, `${whiteness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}%`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n } else {\n [r, g, b] = [r, g, b].map(roundPart);\n colorLabel = format === 'hsl' ? `HSL: ${hue}°, ${saturation}%, ${lightness}%` : colorLabel;\n colorLabel = format === 'rgb' ? `RGB: ${r}, ${g}, ${b}` : colorLabel;\n\n setAttribute(knob1, ariaValueText, `${lightness}% & ${saturation}%`);\n setAttribute(knob1, ariaValueNow, `${lightness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}°`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n }\n\n const alphaValue = roundPart(alpha * 100);\n setAttribute(knob3, ariaValueText, `${alphaValue}%`);\n setAttribute(knob3, ariaValueNow, `${alphaValue}`);\n\n // update the input backgroundColor\n const newColor = color.toString();\n setElementStyle(this.input, { backgroundColor: newColor });\n\n // toggle dark/light classes will also style the placeholder\n // dark sets color white, light sets color black\n // isDark ? '#000' : '#fff'\n if (!this.isDark) {\n if (hasClass(parent, 'txt-dark')) removeClass(parent, 'txt-dark');\n if (!hasClass(parent, 'txt-light')) addClass(parent, 'txt-light');\n } else {\n if (hasClass(parent, 'txt-light')) removeClass(parent, 'txt-light');\n if (!hasClass(parent, 'txt-dark')) addClass(parent, 'txt-dark');\n }\n }\n\n /** Updates the control knobs actual positions. */\n updateControls() {\n const { controlKnobs, controlPositions } = this;\n let { c1x, c1y, c2y, c3y } = controlPositions;\n const [control1, control2, control3] = controlKnobs;\n // round control positions\n [c1x, c1y, c2y, c3y] = [c1x, c1y, c2y, c3y].map(roundPart);\n\n setElementStyle(control1, {\n transform: `translate3d(${c1x - 4}px,${c1y - 4}px,0)`,\n });\n setElementStyle(control2, { transform: `translate3d(0,${c2y - 4}px,0)` });\n setElementStyle(control3, { transform: `translate3d(0,${c3y - 4}px,0)` });\n }\n\n /**\n * Updates all color form inputs.\n *\n * @param isPrevented when `true`, the component original event is prevented\n */\n updateInputs(isPrevented?: boolean) {\n const { value: oldColor, format, inputs, color, hsl } = this;\n const [i1, i2, i3, i4] = inputs;\n const alpha = roundPart(color.a * 100);\n const hue = roundPart(hsl.h * 360);\n let newColor = color.toString();\n\n /* istanbul ignore else */\n if (format === 'hex') {\n newColor = this.color.toHexString(true);\n i1.value = this.hex;\n } else if (format === 'hsl') {\n const lightness = roundPart(hsl.l * 100);\n const saturation = roundPart(hsl.s * 100);\n newColor = this.color.toHslString();\n i1.value = `${hue}`;\n i2.value = `${saturation}`;\n i3.value = `${lightness}`;\n i4.value = `${alpha}`;\n } else if (format === 'hwb') {\n const { w, b } = this.hwb;\n const whiteness = roundPart(w * 100);\n const blackness = roundPart(b * 100);\n\n newColor = this.color.toHwbString();\n i1.value = `${hue}`;\n i2.value = `${whiteness}`;\n i3.value = `${blackness}`;\n i4.value = `${alpha}`;\n } else if (format === 'rgb') {\n let { r, g, b } = this.rgb;\n [r, g, b] = [r, g, b].map(roundPart);\n\n newColor = this.color.toRgbString();\n i1.value = `${r}`;\n i2.value = `${g}`;\n i3.value = `${b}`;\n i4.value = `${alpha}`;\n }\n\n // update the color value\n this.value = newColor;\n\n // don't trigger the custom event unless it's really changed\n if (!isPrevented && newColor !== oldColor) {\n firePickerChange(this);\n }\n }\n\n /**\n * Toggle the `ColorPicker` dropdown visibility.\n *\n * @param e\n */\n togglePicker = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorPicker } = this;\n\n if (this.isOpen && hasClass(colorPicker, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorPicker);\n }\n };\n\n /** Shows the `ColorPicker` dropdown. */\n showPicker = () => {\n const { colorPicker } = this;\n\n if (!['top', 'bottom'].some(c => hasClass(colorPicker, c))) {\n showDropdown(this, colorPicker);\n }\n };\n\n /**\n * Toggles the visibility of the `ColorPicker` presets menu.\n *\n * @param e\n * @this {ColorPicker}\n */\n toggleMenu = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorMenu } = this;\n\n if (this.isOpen && hasClass(colorMenu, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorMenu);\n }\n };\n\n /**\n * Hides the currently open `ColorPicker` dropdown.\n *\n * @param {boolean=} focusPrevented\n */\n hide(focusPrevented?: boolean) {\n if (this.isOpen) {\n const { pickerToggle, menuToggle, colorPicker, colorMenu, parent, input } = this;\n const openPicker = hasClass(colorPicker, 'show');\n const openDropdown = openPicker ? colorPicker : colorMenu;\n const relatedBtn = openPicker ? pickerToggle : menuToggle;\n const animationDuration = openDropdown && getElementTransitionDuration(openDropdown);\n\n this.value = this.color.toString(true);\n\n /* istanbul ignore else */\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n setAttribute(relatedBtn, ariaExpanded, 'false');\n setTimeout(() => {\n removePosition(openDropdown);\n /* istanbul ignore else */\n if (!querySelector('.show', parent)) {\n removeClass(parent, 'open');\n toggleEventsOnShown(this);\n this.isOpen = false;\n }\n }, animationDuration);\n }\n\n if (!focusPrevented) {\n focus(pickerToggle);\n }\n setAttribute(input, tabindex, '-1');\n if (relatedBtn === menuToggle) {\n setAttribute(menuToggle, tabindex, '-1');\n }\n }\n }\n\n /** Removes `ColorPicker` from target ``. */\n dispose() {\n const { input, parent } = this;\n this.hide(true);\n toggleEvents(this);\n [...parent.children].forEach(el => {\n if (el !== input) el.remove();\n });\n\n removeAttribute(input, tabindex);\n setElementStyle(input, { backgroundColor: '' });\n\n ['txt-light', 'txt-dark'].forEach(c => removeClass(parent, c));\n Data.remove(input, colorPickerString);\n }\n}\n"],"names":["e","f","t","c","i","n","s","o","a","r","E","d","me","ge","Ee","Ae","Ne","ke","K","P","_","tt","st","rt","it","St","Nt","kt","Ct","zt","Bt","Re","Qe","je","qe","Ye","Ze","on","Rt","U","mn","jt","A","qt","S","z","x","M","Gt","Jt","Kt","Xt","Yt","kn","Dn","On","Ln","In","v","u","L","Bn","N","W","R","k","Zt","$t","Q","g","ne","Rn","V","w","oe","Qn","l","p","m","y","j","Jn","Yn","Zn","I","_n","h","T","B","H","b","ae","co","ie","le","Ao","ko","D","F","rr","tr","O","er","$","Z","J","G","X","C","Y","q","sr","ColorPalette","Color","args","hue","hueSteps","lightSteps","lightnessArray","saturation","colors","hueStep","half","steps1To13","lightSets","closestSet","set","lightStep","currentHue","newColor","colorPickerLabels","colorNames","isValidJSON","str","isString","vHidden","getColorForm","self","format","id","componentLabels","colorForm","createElement","components","toUpperCase","cID","formatLabel","cInputLabel","setAttribute","cInput","max","step","ObjectAssign","getColorControls","hueLabel","alphaLabel","lightnessLabel","saturationLabel","whitenessLabel","blacknessLabel","max1","max2","max3","ctrl1Label","ctrl2Label","colorControls","colorPointer","colorSlider","template","min","control","knob","getColorMenu","colorsSource","menuClass","input","defaultsLabel","presetsLabel","isOptionsMenu","isPalette","menuLabel","colorsArray","colorsCount","fit","isMultiLine","rowCountHover","rowCount","isScrollable","finalClass","gap","optionSize","menuHeight","menuHeightHover","menu","setElementStyle","value","label","isActive","getAttribute","option","setMarkup","parent","colorKeywords","colorPresets","colorValue","nonColors","toggleLabel","pickerLabel","hexLabel","color","formatString","pickerBtn","pickerDropdown","presetsDropdown","presetsBtn","xmlns","presetsIcon","createElementNS","ariaHidden","path","tabindex","colorPickerString","colorPickerSelector","colorPickerParentSelector","colorPickerDefaults","roundPart","getColorPickerInstance","element","getInstance","initColorPicker","ColorPicker","toggleEvents","action","fn","addListener","removeListener","pickerToggle","menuToggle","focusinEvent","mouseclickEvent","toggleEventsOnShown","colorMenu","doc","getDocument","win","getWindow","pointerdownEvent","keydownEvent","scrollEvent","resizeEvent","changeEvent","pointermoveEvent","pointerupEvent","focusoutEvent","keyupEvent","firePickerChange","dispatchEvent","removePosition","removeClass","showDropdown","dropdown","colorPicker","isPicker","openDropdown","activeBtn","nextBtn","hasClass","addClass","reflow","ariaExpanded","getBoundingClientRect","version","ObjectFromEntries","target","config","querySelector","closest","getUID","colorLabels","normalizeOptions","translatedColorLabels","isArray","tempComponentLabels","getElementsByClassName","controls","Data","brightness","inputValue","hsl","hsv","saturationSource","lightness","hsvl","colorName","isGold","isOlive","controlPositions","visuals","v1","v2","v3","offsetHeight","whiteGrad","alpha","roundA","fill","hueGradient","relatedTarget","code","keyEscape","activeElement","touchmoveEvent","previousElementSibling","nextElementSibling","parentElement","isColorOptionsMenu","allSiblings","columnsCount","getElementStyle","currentIndex","previousElement","nextElement","keyArrowDown","keyArrowUp","keySpace","focus","keyArrowLeft","keyArrowRight","keyEnter","newOption","currentActive","removeAttribute","ariaSelected","pageX","pageY","controlKnobs","c1","c2","c3","visual","visualRect","html","getDocumentElement","offsetX","offsetY","currentOpen","selection","dragElement","controlRect","offsetWidth","currentKnob","yRatio","xRatio","colorSource","inputs","currentValue","i1","i4","v4","isNonColorValue","elRect","top","bottom","elHeight","windowHeight","dropHeight","distanceBottom","distanceTop","bottomExceed","topExceed","hex","appearanceLabel","valueLabel","knob1","knob2","knob3","colorLabel","hwb","whiteness","blackness","ariaValueText","ariaValueNow","ariaDescription","alphaValue","c1x","c1y","c2y","c3y","control1","control2","control3","isPrevented","oldColor","i2","i3","focusPrevented","openPicker","relatedBtn","animationDuration","getElementTransitionDuration","el"],"mappings":"AAAK,MAACA,IAAI,CAAE,GAAEC,KAAI,CAACC,MAAM;AACvB,QAAM,EAAE,MAAMC,GAAG,eAAeC,EAAC,IAAKF;AACtC,GAAC,GAAGF,EAAEG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAACE,GAAGC,CAAC,MAAM;AAC5B,IAAAF,MAAMC,KAAK,CAAC,GAAGC,CAAC,EAAE,QAAQ,CAAC,CAACC,GAAGC,CAAC,MAAM;AACpC,MAAAD,EAAE,MAAMF,GAAG,CAACH,CAAC,CAAC,GAAG,OAAOM,KAAK,YAAYA,EAAE,QAAQC,GAAEJ,GAAGF,GAAGI,GAAGC,CAAC;AAAA,IACrE,CAAK;AAAA,EACL,CAAG;AACH,GAAGE,KAAI,CAACR,GAAGC,GAAGC,GAAGC,MAAM;AACrB,EAAAL,EAAEG,CAAC,MAAMH,EAAEG,CAAC,IAAoB,oBAAI,IAAG;AACvC,QAAMG,IAAIN,EAAEG,CAAC;AACb,EAAAG,EAAE,IAAIJ,CAAC,KAAKI,EAAE,IAAIJ,GAAmB,oBAAI,IAAG,CAAE;AAC9C,QAAMK,IAAID,EAAE,IAAIJ,CAAC,GAAG,E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,GACd8B,GAAa,IAAI,GACjB,CAAC,GAAG9B,EAAO,QAAQ,EAAE,QAAQ,CAAMuM,MAAA;AACjC,MAAIA,MAAOjO,KAAOiO,EAAG,OAAO;AAAA,IAAA,CAC7B,GAEDrE,GAAgB5J,GAAO6C,CAAQ,GAC/B1B,EAAgBnB,GAAO,EAAE,iBAAiB,GAAI,CAAA,GAE7C,CAAA,aAAa,UAAU,EAAE,QAAQ,OAAKmF,EAAYzD,GAAQtM,CAAC,CAAC,GACxD0R,GAAA,OAAO9G,GAAO8C,CAAiB;AAAA,EACtC;AACF;","x_google_ignoreList":[0,1,2]} \ No newline at end of file +{"version":3,"file":"color-picker.mjs","sources":["../../node_modules/.pnpm/@thednp+shorty@2.0.0-alpha21/node_modules/@thednp/shorty/dist/shorty.mjs","../../node_modules/.pnpm/@thednp+color@1.0.8/node_modules/@thednp/color/dist/index.mjs","../../src/ts/colorPalette.ts","../../src/ts/util/colorPickerLabels.ts","../../src/ts/util/colorNames.ts","../../src/ts/util/isValidJSON.ts","../../src/ts/util/vHidden.ts","../../src/ts/util/getColorForm.ts","../../src/ts/util/getColorControls.ts","../../src/ts/util/getColorMenu.ts","../../src/ts/util/setMarkup.ts","../../src/ts/index.ts"],"sourcesContent":["const pe = \"aria-checked\", me = \"aria-description\", fe = \"aria-describedby\", ge = \"aria-expanded\", ve = \"aria-haspopup\", Ee = \"aria-hidden\", be = \"aria-label\", he = \"aria-labelledby\", ye = \"aria-modal\", we = \"aria-pressed\", Ae = \"aria-selected\", Se = \"aria-valuemin\", Ne = \"aria-valuemax\", ke = \"aria-valuenow\", Me = \"aria-valuetext\", q = \"abort\", G = \"beforeunload\", J = \"blur\", K = \"change\", X = \"contextmenu\", P = \"DOMContentLoaded\", Y = \"DOMMouseScroll\", Z = \"error\", $ = \"focus\", _ = \"focusin\", tt = \"focusout\", et = \"gesturechange\", nt = \"gestureend\", ot = \"gesturestart\", st = \"keydown\", ct = \"keypress\", rt = \"keyup\", at = \"load\", it = \"click\", ut = \"dblclick\", lt = \"mousedown\", dt = \"mouseup\", pt = \"hover\", mt = \"mouseenter\", ft = \"mouseleave\", gt = \"mousein\", vt = \"mouseout\", Et = \"mouseover\", bt = \"mousemove\", ht = \"mousewheel\", yt = \"move\", wt = \"orientationchange\", At = \"pointercancel\", St = \"pointerdown\", Nt = \"pointerleave\", kt = \"pointermove\", Mt = \"pointerup\", Tt = \"readystatechange\", Dt = \"reset\", Ct = \"resize\", Ot = \"select\", Lt = \"selectend\", It = \"selectstart\", zt = \"scroll\", xt = \"submit\", Vt = \"touchstart\", Bt = \"touchmove\", Ht = \"touchcancel\", Pt = \"touchend\", Ft = \"unload\", Te = {\n DOMContentLoaded: P,\n DOMMouseScroll: Y,\n abort: q,\n beforeunload: G,\n blur: J,\n change: K,\n click: it,\n contextmenu: X,\n dblclick: ut,\n error: Z,\n focus: $,\n focusin: _,\n focusout: tt,\n gesturechange: et,\n gestureend: nt,\n gesturestart: ot,\n hover: pt,\n keydown: st,\n keypress: ct,\n keyup: rt,\n load: at,\n mousedown: lt,\n mousemove: bt,\n mousein: gt,\n mouseout: vt,\n mouseenter: mt,\n mouseleave: ft,\n mouseover: Et,\n mouseup: dt,\n mousewheel: ht,\n move: yt,\n orientationchange: wt,\n pointercancel: At,\n pointerdown: St,\n pointerleave: Nt,\n pointermove: kt,\n pointerup: Mt,\n readystatechange: Tt,\n reset: Dt,\n resize: Ct,\n scroll: zt,\n select: Ot,\n selectend: Lt,\n selectstart: It,\n submit: xt,\n touchcancel: Ht,\n touchend: Pt,\n touchmove: Bt,\n touchstart: Vt,\n unload: Ft\n}, De = \"drag\", Ce = \"dragstart\", Oe = \"dragenter\", Le = \"dragleave\", Ie = \"dragover\", ze = \"dragend\", xe = \"loadstart\", Ve = {\n start: \"mousedown\",\n end: \"mouseup\",\n move: \"mousemove\",\n cancel: \"mouseleave\"\n}, Be = { down: \"mousedown\", up: \"mouseup\" }, He = \"onmouseleave\" in document ? [\"mouseenter\", \"mouseleave\"] : (\n /* istanbul ignore next */\n [\"mouseover\", \"mouseout\"]\n), Pe = {\n start: \"touchstart\",\n end: \"touchend\",\n move: \"touchmove\",\n cancel: \"touchcancel\"\n}, Fe = { in: \"focusin\", out: \"focusout\" }, Ue = {\n Backspace: \"Backspace\",\n // 8\n Tab: \"Tab\",\n // 9\n Enter: \"Enter\",\n // 13\n Shift: \"Shift\",\n // 16\n Control: \"Control\",\n // 17\n Alt: \"Alt\",\n // 18\n Pause: \"Pause\",\n // 19\n CapsLock: \"CapsLock\",\n // 20\n Escape: \"Escape\",\n // 27\n Scape: \"Space\",\n // 32\n ArrowLeft: \"ArrowLeft\",\n // 37\n ArrowUp: \"ArrowUp\",\n // 38\n ArrowRight: \"ArrowRight\",\n // 39\n ArrowDown: \"ArrowDown\",\n // 40\n Insert: \"Insert\",\n // 45\n Delete: \"Delete\",\n // 46\n Meta: \"Meta\",\n // 91 windows key\n ContextMenu: \"ContextMenu\",\n // 93\n ScrollLock: \"ScrollLock\"\n // 145\n}, We = \"Alt\", Re = \"ArrowDown\", Qe = \"ArrowUp\", je = \"ArrowLeft\", qe = \"ArrowRight\", Ge = \"Backspace\", Je = \"CapsLock\", Ke = \"Control\", Xe = \"Delete\", Ye = \"Enter\", Ze = \"NumpadEnter\", $e = \"Escape\", _e = \"Insert\", tn = \"Meta\", en = \"Pause\", nn = \"ScrollLock\", on = \"Shift\", sn = \"Space\", cn = \"Tab\", Ut = \"animationDuration\", Wt = \"animationDelay\", F = \"animationName\", D = \"animationend\", Rt = \"transitionDuration\", Qt = \"transitionDelay\", C = \"transitionend\", U = \"transitionProperty\", rn = \"addEventListener\", an = \"removeEventListener\", un = {\n linear: \"linear\",\n easingSinusoidalIn: \"cubic-bezier(0.47,0,0.745,0.715)\",\n easingSinusoidalOut: \"cubic-bezier(0.39,0.575,0.565,1)\",\n easingSinusoidalInOut: \"cubic-bezier(0.445,0.05,0.55,0.95)\",\n easingQuadraticIn: \"cubic-bezier(0.550,0.085,0.680,0.530)\",\n easingQuadraticOut: \"cubic-bezier(0.250,0.460,0.450,0.940)\",\n easingQuadraticInOut: \"cubic-bezier(0.455,0.030,0.515,0.955)\",\n easingCubicIn: \"cubic-bezier(0.55,0.055,0.675,0.19)\",\n easingCubicOut: \"cubic-bezier(0.215,0.61,0.355,1)\",\n easingCubicInOut: \"cubic-bezier(0.645,0.045,0.355,1)\",\n easingQuarticIn: \"cubic-bezier(0.895,0.03,0.685,0.22)\",\n easingQuarticOut: \"cubic-bezier(0.165,0.84,0.44,1)\",\n easingQuarticInOut: \"cubic-bezier(0.77,0,0.175,1)\",\n easingQuinticIn: \"cubic-bezier(0.755,0.05,0.855,0.06)\",\n easingQuinticOut: \"cubic-bezier(0.23,1,0.32,1)\",\n easingQuinticInOut: \"cubic-bezier(0.86,0,0.07,1)\",\n easingExponentialIn: \"cubic-bezier(0.95,0.05,0.795,0.035)\",\n easingExponentialOut: \"cubic-bezier(0.19,1,0.22,1)\",\n easingExponentialInOut: \"cubic-bezier(1,0,0,1)\",\n easingCircularIn: \"cubic-bezier(0.6,0.04,0.98,0.335)\",\n easingCircularOut: \"cubic-bezier(0.075,0.82,0.165,1)\",\n easingCircularInOut: \"cubic-bezier(0.785,0.135,0.15,0.86)\",\n easingBackIn: \"cubic-bezier(0.6,-0.28,0.735,0.045)\",\n easingBackOut: \"cubic-bezier(0.175,0.885,0.32,1.275)\",\n easingBackInOut: \"cubic-bezier(0.68,-0.55,0.265,1.55)\"\n}, ln = \"offsetHeight\", dn = \"offsetWidth\", pn = \"scrollHeight\", mn = \"scrollWidth\", fn = \"tabindex\", jt = navigator.userAgentData, A = jt, { userAgent: qt } = navigator, S = qt, z = /iPhone|iPad|iPod|Android/i;\nlet O = !1;\nA ? O = A.brands.some((t) => z.test(t.brand)) : O = z.test(S);\nconst gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.brand)) : (\n /* istanbul ignore next */\n x.test(S)\n), En = S ? S.includes(\"Firefox\") : (\n /* istanbul ignore next */\n !1\n), { head: N } = document, bn = [\"webkitPerspective\", \"perspective\"].some((t) => t in N.style), Gt = (t, e, n, o) => {\n const s = o || !1;\n t.addEventListener(e, n, s);\n}, Jt = (t, e, n, o) => {\n const s = o || !1;\n t.removeEventListener(e, n, s);\n}, Kt = (t, e, n, o) => {\n const s = (r) => {\n (r.target === t || r.currentTarget === t) && (n.apply(t, [r]), Jt(t, e, s, o));\n };\n Gt(t, e, s, o);\n}, Xt = () => {\n}, hn = (() => {\n let t = !1;\n try {\n const e = Object.defineProperty({}, \"passive\", {\n get: () => (t = !0, t)\n });\n Kt(document, P, Xt, e);\n } catch {\n }\n return t;\n})(), yn = [\"webkitTransform\", \"transform\"].some((t) => t in N.style), wn = \"ontouchstart\" in window || /* istanbul ignore next */\n\"msMaxTouchPoints\" in navigator, An = [\"webkitAnimation\", \"animation\"].some((t) => t in N.style), Sn = [\"webkitTransition\", \"transition\"].some((t) => t in N.style), Yt = (t, e) => t.getAttribute(e), Nn = (t, e, n) => e.getAttributeNS(t, n), kn = (t, e) => t.hasAttribute(e), Mn = (t, e, n) => e.hasAttributeNS(t, n), Tn = (t, e, n) => t.setAttribute(e, n), Dn = (t, e, n, o) => e.setAttributeNS(t, n, o), Cn = (t, e) => t.removeAttribute(e), On = (t, e, n) => e.removeAttributeNS(t, n), Ln = (t, ...e) => {\n t.classList.add(...e);\n}, In = (t, ...e) => {\n t.classList.remove(...e);\n}, zn = (t, e) => t.classList.contains(e), { body: xn } = document, { documentElement: Vn } = document, Bn = (t) => Array.from(t), v = (t) => t != null && typeof t == \"object\" || !1, i = (t) => v(t) && typeof t.nodeType == \"number\" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some((e) => t.nodeType === e) || !1, u = (t) => i(t) && t.nodeType === 1 || !1, E = /* @__PURE__ */ new Map(), L = {\n data: E,\n /**\n * Sets web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @param instance the component instance\n */\n set: (t, e, n) => {\n if (!u(t))\n return;\n E.has(e) || E.set(e, /* @__PURE__ */ new Map()), E.get(e).set(t, n);\n },\n /**\n * Returns all instances for specified component.\n *\n * @param component the component's name or a unique key\n * @returns all the component instances\n */\n getAllFor: (t) => E.get(t) || null,\n /**\n * Returns the instance associated with the target.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @returns the instance\n */\n get: (t, e) => {\n if (!u(t) || !e)\n return null;\n const n = L.getAllFor(e);\n return t && n && n.get(t) || null;\n },\n /**\n * Removes web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n */\n remove: (t, e) => {\n const n = L.getAllFor(e);\n !n || !u(t) || (n.delete(t), n.size === 0 && E.delete(e));\n }\n}, Hn = (t, e) => L.get(t, e), k = (t) => typeof t == \"string\" || !1, W = (t) => v(t) && t.constructor.name === \"Window\" || !1, R = (t) => i(t) && t.nodeType === 9 || !1, d = (t) => W(t) ? t.document : R(t) ? t : i(t) ? t.ownerDocument : window.document, M = (t, ...e) => Object.assign(t, ...e), Zt = (t) => {\n if (!t)\n return;\n if (k(t))\n return d().createElement(t);\n const { tagName: e } = t, n = Zt(e);\n if (!n)\n return;\n const o = { ...t };\n return delete o.tagName, M(n, o);\n}, $t = (t, e) => {\n if (!t || !e)\n return;\n if (k(e))\n return d().createElementNS(t, e);\n const { tagName: n } = e, o = $t(t, n);\n if (!o)\n return;\n const s = { ...e };\n return delete s.tagName, M(o, s);\n}, Q = (t, e) => t.dispatchEvent(e), Pn = (t, e, n) => n.indexOf(t) === e, g = (t, e) => {\n const n = getComputedStyle(t), o = e.replace(\"webkit\", \"Webkit\").replace(/([A-Z])/g, \"-$1\").toLowerCase();\n return n.getPropertyValue(o);\n}, _t = (t) => {\n const e = g(t, F), n = g(t, Wt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, te = (t) => {\n const e = g(t, F), n = g(t, Ut), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Fn = (t, e) => {\n let n = 0;\n const o = new Event(D), s = te(t), r = _t(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(D, a), n = 1);\n };\n t.addEventListener(D, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, ee = (t) => {\n const e = g(t, U), n = g(t, Qt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, ne = (t) => {\n const e = g(t, U), n = g(t, Rt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Un = (t, e) => {\n let n = 0;\n const o = new Event(C), s = ne(t), r = ee(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(C, a), n = 1);\n };\n t.addEventListener(C, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, Wn = (t) => Float32Array.from(Array.from(t)), Rn = (t) => Float64Array.from(Array.from(t)), Qn = (t, e) => t.focus(e), V = (t) => [\"true\", !0].includes(t) ? !0 : [\"false\", !1].includes(t) ? !1 : [\"null\", \"\", null, void 0].includes(t) ? null : t !== \"\" && !Number.isNaN(+t) ? +t : t, w = (t) => Object.entries(t), oe = (t) => t.toLowerCase(), jn = (t, e, n, o) => {\n const s = { ...n }, r = { ...t.dataset }, a = { ...e }, l = {}, p = \"title\";\n return w(r).forEach(([c, m]) => {\n const y = o && typeof c == \"string\" && c.includes(o) ? c.replace(o, \"\").replace(/[A-Z]/g, (j) => oe(j)) : c;\n l[y] = V(m);\n }), w(s).forEach(([c, m]) => {\n s[c] = V(m);\n }), w(e).forEach(([c, m]) => {\n c in s ? a[c] = s[c] : c in l ? a[c] = l[c] : a[c] = c === p ? Yt(t, p) : m;\n }), a;\n}, qn = (t, e) => v(t) && (Object.hasOwn(t, e) || e in t), Gn = (t) => Object.keys(t), Jn = (t) => Object.values(t), Kn = (t) => Object.fromEntries(t), Xn = (t, e) => {\n const n = new CustomEvent(t, {\n cancelable: !0,\n bubbles: !0\n });\n return v(e) && M(n, e), n;\n}, Yn = { passive: !0 }, Zn = (t) => t.offsetHeight, $n = (t, e) => {\n w(e).forEach(([n, o]) => {\n if (o && k(n) && n.includes(\"--\"))\n t.style.setProperty(n, o);\n else {\n const s = {};\n s[n] = o, M(t.style, s);\n }\n });\n}, I = (t) => v(t) && t.constructor.name === \"Map\" || !1, se = (t) => typeof t == \"number\" || !1, f = /* @__PURE__ */ new Map(), _n = {\n /**\n * Sets a new timeout timer for an element, or element -> key association.\n *\n * @param element target element\n * @param callback the callback\n * @param delay the execution delay\n * @param key a unique key\n */\n set: (t, e, n, o) => {\n u(t) && (o && o.length ? (f.has(t) || f.set(t, /* @__PURE__ */ new Map()), f.get(t).set(o, setTimeout(e, n))) : f.set(t, setTimeout(e, n)));\n },\n /**\n * Returns the timer associated with the target.\n *\n * @param element target element\n * @param key a unique\n * @returns the timer\n */\n get: (t, e) => {\n if (!u(t))\n return null;\n const n = f.get(t);\n return e && n && I(n) ? n.get(e) || /* istanbul ignore next */\n null : se(n) ? n : null;\n },\n /**\n * Clears the element's timer.\n *\n * @param element target element\n * @param key a unique key\n */\n clear: (t, e) => {\n if (!u(t))\n return;\n const n = f.get(t);\n e && e.length && I(n) ? (clearTimeout(n.get(e)), n.delete(e), n.size === 0 && f.delete(t)) : (clearTimeout(n), f.delete(t));\n }\n}, to = (t) => t.toUpperCase(), h = (t, e) => {\n const { width: n, height: o, top: s, right: r, bottom: a, left: l } = t.getBoundingClientRect();\n let p = 1, c = 1;\n if (e && u(t)) {\n const { offsetWidth: m, offsetHeight: y } = t;\n p = m > 0 ? Math.round(n) / m : (\n /* istanbul ignore next */\n 1\n ), c = y > 0 ? Math.round(o) / y : (\n /* istanbul ignore next */\n 1\n );\n }\n return {\n width: n / p,\n height: o / c,\n top: s / c,\n right: r / p,\n bottom: a / c,\n left: l / p,\n x: l / p,\n y: s / c\n };\n}, eo = (t) => d(t).body, T = (t) => d(t).documentElement, no = (t) => d(t).head, oo = (t) => {\n const e = W(t), n = e ? t.scrollX : t.scrollLeft, o = e ? t.scrollY : t.scrollTop;\n return { x: n, y: o };\n}, ce = (t) => i(t) && t.constructor.name === \"ShadowRoot\" || !1, so = (t) => t.nodeName === \"HTML\" ? t : u(t) && t.assignedSlot || // step into the shadow DOM of the parent of a slotted node\ni(t) && t.parentNode || // DOM Element detected\nce(t) && t.host || // ShadowRoot detected\nT(t), re = (t) => {\n if (!u(t))\n return !1;\n const { width: e, height: n } = h(t), { offsetWidth: o, offsetHeight: s } = t;\n return Math.round(e) !== o || Math.round(n) !== s;\n}, co = (t, e, n) => {\n const o = u(e), s = h(t, o && re(e)), r = { x: 0, y: 0 };\n if (o) {\n const a = h(e, !0);\n r.x = a.x + e.clientLeft, r.y = a.y + e.clientTop;\n }\n return {\n x: s.left + n.x - r.x,\n y: s.top + n.y - r.y,\n width: s.width,\n height: s.height\n };\n};\nlet B = 0, H = 0;\nconst b = /* @__PURE__ */ new Map(), ae = (t, e) => {\n let n = e ? B : H;\n if (e) {\n const o = ae(t), s = b.get(o) || /* @__PURE__ */ new Map();\n b.has(o) || b.set(o, s), I(s) && !s.has(e) ? (s.set(e, n), B += 1) : n = s.get(e);\n } else {\n const o = t.id || t;\n b.has(o) ? n = b.get(o) : (b.set(o, n), H += 1);\n }\n return n;\n}, ro = (t) => {\n var e;\n return t ? R(t) ? t.defaultView : i(t) ? (e = t == null ? void 0 : t.ownerDocument) == null ? void 0 : e.defaultView : t : window;\n}, ie = (t) => Array.isArray(t) || !1, ao = (t) => i(t) && t.nodeName === \"CANVAS\" || !1, ue = (t) => u(t) && !!t.shadowRoot || !1, io = (t) => i(t) && [1, 2, 3, 4, 5, 6, 7, 8].some((e) => t.nodeType === e) || !1, uo = (t) => {\n if (!i(t))\n return !1;\n const { top: e, bottom: n } = h(t), { clientHeight: o } = T(t);\n return e <= o && n >= 0;\n}, lo = (t) => {\n if (!i(t))\n return !1;\n const { clientWidth: e, clientHeight: n } = T(t), { top: o, left: s, bottom: r, right: a } = h(t, !0);\n return o >= 0 && s >= 0 && r <= n && a <= e;\n}, po = (t) => ie(t) && t.every(u) || !1, mo = (t) => typeof t == \"function\" || !1, fo = (t) => v(t) && t.constructor.name === \"HTMLCollection\" || !1, go = (t) => u(t) && t.tagName === \"IMG\" || !1, vo = (t) => {\n if (!k(t))\n return !1;\n try {\n JSON.parse(t);\n } catch {\n return !1;\n }\n return !0;\n}, Eo = (t) => v(t) && t.constructor.name === \"WeakMap\" || !1, bo = (t) => i(t) && [\"SVG\", \"Image\", \"Video\", \"Canvas\"].some((e) => t.constructor.name.includes(e)) || !1, ho = (t) => v(t) && t.constructor.name === \"NodeList\" || !1, yo = (t) => T(t).dir === \"rtl\", wo = (t) => i(t) && t.constructor.name.includes(\"SVG\") || !1, Ao = (t) => i(t) && [\"TABLE\", \"TD\", \"TH\"].includes(t.nodeName) || !1, le = (t, e) => t ? t.closest(e) || // break out of `ShadowRoot`\nle(t.getRootNode().host, e) : null, So = (t, e) => u(t) ? t : (i(e) ? e : d()).querySelector(t), de = (t, e) => (i(e) ? e : d()).getElementsByTagName(t), No = (t) => [...de(\"*\", t)].filter(ue), ko = (t, e) => d(e).getElementById(t) || null, Mo = (t, e) => (i(e) ? e : d()).querySelectorAll(t), To = (t, e) => (e && i(e) ? e : d()).getElementsByClassName(\n t\n), Do = (t, e) => t.matches(e), Co = \"2.0.0alpha21\";\nexport {\n Bn as ArrayFrom,\n P as DOMContentLoadedEvent,\n Y as DOMMouseScrollEvent,\n L as Data,\n Wn as Float32ArrayFrom,\n Rn as Float64ArrayFrom,\n M as ObjectAssign,\n w as ObjectEntries,\n Kn as ObjectFromEntries,\n qn as ObjectHasOwn,\n Gn as ObjectKeys,\n Jn as ObjectValues,\n _n as Timer,\n q as abortEvent,\n Ln as addClass,\n rn as addEventListener,\n Wt as animationDelay,\n Ut as animationDuration,\n D as animationEndEvent,\n F as animationName,\n pe as ariaChecked,\n fe as ariaDescribedBy,\n me as ariaDescription,\n ge as ariaExpanded,\n ve as ariaHasPopup,\n Ee as ariaHidden,\n be as ariaLabel,\n he as ariaLabelledBy,\n ye as ariaModal,\n we as ariaPressed,\n Ae as ariaSelected,\n Ne as ariaValueMax,\n Se as ariaValueMin,\n ke as ariaValueNow,\n Me as ariaValueText,\n G as beforeunloadEvent,\n un as bezierEasings,\n J as blurEvent,\n K as changeEvent,\n le as closest,\n X as contextmenuEvent,\n Xn as createCustomEvent,\n Zt as createElement,\n $t as createElementNS,\n Q as dispatchEvent,\n Pn as distinct,\n xn as documentBody,\n Vn as documentElement,\n N as documentHead,\n De as dragEvent,\n ze as dragendEvent,\n Oe as dragenterEvent,\n Le as dragleaveEvent,\n Ie as dragoverEvent,\n Ce as dragstartEvent,\n Fn as emulateAnimationEnd,\n Un as emulateTransitionEnd,\n Z as errorEvent,\n Qn as focus,\n $ as focusEvent,\n Fe as focusEvents,\n _ as focusinEvent,\n tt as focusoutEvent,\n et as gesturechangeEvent,\n nt as gestureendEvent,\n ot as gesturestartEvent,\n Yt as getAttribute,\n Nn as getAttributeNS,\n h as getBoundingClientRect,\n No as getCustomElements,\n d as getDocument,\n eo as getDocumentBody,\n T as getDocumentElement,\n no as getDocumentHead,\n _t as getElementAnimationDelay,\n te as getElementAnimationDuration,\n ko as getElementById,\n g as getElementStyle,\n ee as getElementTransitionDelay,\n ne as getElementTransitionDuration,\n To as getElementsByClassName,\n de as getElementsByTagName,\n Hn as getInstance,\n oo as getNodeScroll,\n so as getParentNode,\n co as getRectRelativeToOffsetParent,\n ae as getUID,\n ro as getWindow,\n kn as hasAttribute,\n Mn as hasAttributeNS,\n zn as hasClass,\n vn as isApple,\n ie as isArray,\n ao as isCanvas,\n ue as isCustomElement,\n R as isDocument,\n io as isElement,\n uo as isElementInScrollRange,\n lo as isElementInViewport,\n po as isElementsArray,\n En as isFirefox,\n mo as isFunction,\n fo as isHTMLCollection,\n u as isHTMLElement,\n go as isHTMLImageElement,\n vo as isJSON,\n I as isMap,\n bo as isMedia,\n gn as isMobile,\n i as isNode,\n ho as isNodeList,\n se as isNumber,\n v as isObject,\n yo as isRTL,\n wo as isSVGElement,\n re as isScaledElement,\n ce as isShadowRoot,\n k as isString,\n Ao as isTableElement,\n Eo as isWeakMap,\n W as isWindow,\n We as keyAlt,\n Re as keyArrowDown,\n je as keyArrowLeft,\n qe as keyArrowRight,\n Qe as keyArrowUp,\n Ge as keyBackspace,\n Je as keyCapsLock,\n Ke as keyControl,\n Xe as keyDelete,\n Ye as keyEnter,\n $e as keyEscape,\n _e as keyInsert,\n tn as keyMeta,\n Ze as keyNumpadEnter,\n en as keyPause,\n nn as keyScrollLock,\n on as keyShift,\n sn as keySpace,\n cn as keyTab,\n Ue as keyboardEventKeys,\n st as keydownEvent,\n ct as keypressEvent,\n rt as keyupEvent,\n at as loadEvent,\n xe as loadstartEvent,\n Do as matches,\n Be as mouseClickEvents,\n He as mouseHoverEvents,\n Ve as mouseSwipeEvents,\n it as mouseclickEvent,\n ut as mousedblclickEvent,\n lt as mousedownEvent,\n mt as mouseenterEvent,\n pt as mousehoverEvent,\n gt as mouseinEvent,\n ft as mouseleaveEvent,\n bt as mousemoveEvent,\n vt as mouseoutEvent,\n Et as mouseoverEvent,\n dt as mouseupEvent,\n ht as mousewheelEvent,\n yt as moveEvent,\n Te as nativeEvents,\n Xt as noop,\n jn as normalizeOptions,\n V as normalizeValue,\n Jt as off,\n ln as offsetHeight,\n dn as offsetWidth,\n Gt as on,\n Kt as one,\n wt as orientationchangeEvent,\n Yn as passiveHandler,\n At as pointercancelEvent,\n St as pointerdownEvent,\n Nt as pointerleaveEvent,\n kt as pointermoveEvent,\n Mt as pointerupEvent,\n So as querySelector,\n Mo as querySelectorAll,\n Tt as readystatechangeEvent,\n Zn as reflow,\n Cn as removeAttribute,\n On as removeAttributeNS,\n In as removeClass,\n an as removeEventListener,\n Dt as resetEvent,\n Ct as resizeEvent,\n zt as scrollEvent,\n pn as scrollHeight,\n mn as scrollWidth,\n Ot as selectEvent,\n Lt as selectendEvent,\n It as selectstartEvent,\n Tn as setAttribute,\n Dn as setAttributeNS,\n $n as setElementStyle,\n xt as submitEvent,\n bn as support3DTransform,\n An as supportAnimation,\n hn as supportPassive,\n wn as supportTouch,\n yn as supportTransform,\n Sn as supportTransition,\n fn as tabindex,\n oe as toLowerCase,\n to as toUpperCase,\n Pe as touchEvents,\n Ht as touchcancelEvent,\n Pt as touchendEvent,\n Bt as touchmoveEvent,\n Vt as touchstartEvent,\n Qt as transitionDelay,\n Rt as transitionDuration,\n C as transitionEndEvent,\n U as transitionProperty,\n Ft as unloadEvent,\n S as userAgent,\n A as userAgentData,\n Co as version\n};\n//# sourceMappingURL=shorty.mjs.map\n","const N = [\"transparent\", \"currentColor\", \"inherit\", \"revert\", \"initial\"], b = (o) => {\n const t = Math.floor(o);\n return o - t < 0.5 ? t : Math.round(o);\n}, T = [\n [\n \"aliceblue\",\n {\n r: 240,\n g: 248,\n b: 255\n }\n ],\n [\n \"antiquewhite\",\n {\n r: 250,\n g: 235,\n b: 215\n }\n ],\n [\n \"aqua\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"aquamarine\",\n {\n r: 127,\n g: 255,\n b: 212\n }\n ],\n [\n \"azure\",\n {\n r: 240,\n g: 255,\n b: 255\n }\n ],\n [\n \"beige\",\n {\n r: 245,\n g: 245,\n b: 220\n }\n ],\n [\n \"bisque\",\n {\n r: 255,\n g: 228,\n b: 196\n }\n ],\n [\n \"black\",\n {\n r: 0,\n g: 0,\n b: 0\n }\n ],\n [\n \"blanchedalmond\",\n {\n r: 255,\n g: 235,\n b: 205\n }\n ],\n [\n \"blue\",\n {\n r: 0,\n g: 0,\n b: 255\n }\n ],\n [\n \"blueviolet\",\n {\n r: 138,\n g: 43,\n b: 226\n }\n ],\n [\n \"brown\",\n {\n r: 165,\n g: 42,\n b: 42\n }\n ],\n [\n \"burlywood\",\n {\n r: 222,\n g: 184,\n b: 135\n }\n ],\n [\n \"cadetblue\",\n {\n r: 95,\n g: 158,\n b: 160\n }\n ],\n [\n \"chartreuse\",\n {\n r: 127,\n g: 255,\n b: 0\n }\n ],\n [\n \"chocolate\",\n {\n r: 210,\n g: 105,\n b: 30\n }\n ],\n [\n \"coral\",\n {\n r: 255,\n g: 127,\n b: 80\n }\n ],\n [\n \"cornflowerblue\",\n {\n r: 100,\n g: 149,\n b: 237\n }\n ],\n [\n \"cornsilk\",\n {\n r: 255,\n g: 248,\n b: 220\n }\n ],\n [\n \"crimson\",\n {\n r: 220,\n g: 20,\n b: 60\n }\n ],\n [\n \"cyan\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"darkblue\",\n {\n r: 0,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkcyan\",\n {\n r: 0,\n g: 139,\n b: 139\n }\n ],\n [\n \"darkgoldenrod\",\n {\n r: 184,\n g: 134,\n b: 11\n }\n ],\n [\n \"darkgray\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkgreen\",\n {\n r: 0,\n g: 100,\n b: 0\n }\n ],\n [\n \"darkgrey\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkkhaki\",\n {\n r: 189,\n g: 183,\n b: 107\n }\n ],\n [\n \"darkmagenta\",\n {\n r: 139,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkolivegreen\",\n {\n r: 85,\n g: 107,\n b: 47\n }\n ],\n [\n \"darkorange\",\n {\n r: 255,\n g: 140,\n b: 0\n }\n ],\n [\n \"darkorchid\",\n {\n r: 153,\n g: 50,\n b: 204\n }\n ],\n [\n \"darkred\",\n {\n r: 139,\n g: 0,\n b: 0\n }\n ],\n [\n \"darksalmon\",\n {\n r: 233,\n g: 150,\n b: 122\n }\n ],\n [\n \"darkseagreen\",\n {\n r: 143,\n g: 188,\n b: 143\n }\n ],\n [\n \"darkslateblue\",\n {\n r: 72,\n g: 61,\n b: 139\n }\n ],\n [\n \"darkslategray\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkslategrey\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkturquoise\",\n {\n r: 0,\n g: 206,\n b: 209\n }\n ],\n [\n \"darkviolet\",\n {\n r: 148,\n g: 0,\n b: 211\n }\n ],\n [\n \"deeppink\",\n {\n r: 255,\n g: 20,\n b: 147\n }\n ],\n [\n \"deepskyblue\",\n {\n r: 0,\n g: 191,\n b: 255\n }\n ],\n [\n \"dimgray\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dimgrey\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dodgerblue\",\n {\n r: 30,\n g: 144,\n b: 255\n }\n ],\n [\n \"firebrick\",\n {\n r: 178,\n g: 34,\n b: 34\n }\n ],\n [\n \"floralwhite\",\n {\n r: 255,\n g: 250,\n b: 240\n }\n ],\n [\n \"forestgreen\",\n {\n r: 34,\n g: 139,\n b: 34\n }\n ],\n [\n \"fuchsia\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"gainsboro\",\n {\n r: 220,\n g: 220,\n b: 220\n }\n ],\n [\n \"ghostwhite\",\n {\n r: 248,\n g: 248,\n b: 255\n }\n ],\n [\n \"goldenrod\",\n {\n r: 218,\n g: 165,\n b: 32\n }\n ],\n [\n \"gold\",\n {\n r: 255,\n g: 215,\n b: 0\n }\n ],\n [\n \"gray\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"green\",\n {\n r: 0,\n g: 128,\n b: 0\n }\n ],\n [\n \"greenyellow\",\n {\n r: 173,\n g: 255,\n b: 47\n }\n ],\n [\n \"grey\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"honeydew\",\n {\n r: 240,\n g: 255,\n b: 240\n }\n ],\n [\n \"hotpink\",\n {\n r: 255,\n g: 105,\n b: 180\n }\n ],\n [\n \"indianred\",\n {\n r: 205,\n g: 92,\n b: 92\n }\n ],\n [\n \"indigo\",\n {\n r: 75,\n g: 0,\n b: 130\n }\n ],\n [\n \"ivory\",\n {\n r: 255,\n g: 255,\n b: 240\n }\n ],\n [\n \"khaki\",\n {\n r: 240,\n g: 230,\n b: 140\n }\n ],\n [\n \"lavenderblush\",\n {\n r: 255,\n g: 240,\n b: 245\n }\n ],\n [\n \"lavender\",\n {\n r: 230,\n g: 230,\n b: 250\n }\n ],\n [\n \"lawngreen\",\n {\n r: 124,\n g: 252,\n b: 0\n }\n ],\n [\n \"lemonchiffon\",\n {\n r: 255,\n g: 250,\n b: 205\n }\n ],\n [\n \"lightblue\",\n {\n r: 173,\n g: 216,\n b: 230\n }\n ],\n [\n \"lightcoral\",\n {\n r: 240,\n g: 128,\n b: 128\n }\n ],\n [\n \"lightcyan\",\n {\n r: 224,\n g: 255,\n b: 255\n }\n ],\n [\n \"lightgoldenrodyellow\",\n {\n r: 250,\n g: 250,\n b: 210\n }\n ],\n [\n \"lightgray\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightgreen\",\n {\n r: 144,\n g: 238,\n b: 144\n }\n ],\n [\n \"lightgrey\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightpink\",\n {\n r: 255,\n g: 182,\n b: 193\n }\n ],\n [\n \"lightsalmon\",\n {\n r: 255,\n g: 160,\n b: 122\n }\n ],\n [\n \"lightseagreen\",\n {\n r: 32,\n g: 178,\n b: 170\n }\n ],\n [\n \"lightskyblue\",\n {\n r: 135,\n g: 206,\n b: 250\n }\n ],\n [\n \"lightslategray\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightslategrey\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightsteelblue\",\n {\n r: 176,\n g: 196,\n b: 222\n }\n ],\n [\n \"lightyellow\",\n {\n r: 255,\n g: 255,\n b: 224\n }\n ],\n [\n \"lime\",\n {\n r: 0,\n g: 255,\n b: 0\n }\n ],\n [\n \"limegreen\",\n {\n r: 50,\n g: 205,\n b: 50\n }\n ],\n [\n \"linen\",\n {\n r: 250,\n g: 240,\n b: 230\n }\n ],\n [\n \"magenta\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"maroon\",\n {\n r: 128,\n g: 0,\n b: 0\n }\n ],\n [\n \"mediumaquamarine\",\n {\n r: 102,\n g: 205,\n b: 170\n }\n ],\n [\n \"mediumblue\",\n {\n r: 0,\n g: 0,\n b: 205\n }\n ],\n [\n \"mediumorchid\",\n {\n r: 186,\n g: 85,\n b: 211\n }\n ],\n [\n \"mediumpurple\",\n {\n r: 147,\n g: 112,\n b: 219\n }\n ],\n [\n \"mediumseagreen\",\n {\n r: 60,\n g: 179,\n b: 113\n }\n ],\n [\n \"mediumslateblue\",\n {\n r: 123,\n g: 104,\n b: 238\n }\n ],\n [\n \"mediumspringgreen\",\n {\n r: 0,\n g: 250,\n b: 154\n }\n ],\n [\n \"mediumturquoise\",\n {\n r: 72,\n g: 209,\n b: 204\n }\n ],\n [\n \"mediumvioletred\",\n {\n r: 199,\n g: 21,\n b: 133\n }\n ],\n [\n \"midnightblue\",\n {\n r: 25,\n g: 25,\n b: 112\n }\n ],\n [\n \"mintcream\",\n {\n r: 245,\n g: 255,\n b: 250\n }\n ],\n [\n \"mistyrose\",\n {\n r: 255,\n g: 228,\n b: 225\n }\n ],\n [\n \"moccasin\",\n {\n r: 255,\n g: 228,\n b: 181\n }\n ],\n [\n \"navajowhite\",\n {\n r: 255,\n g: 222,\n b: 173\n }\n ],\n [\n \"navy\",\n {\n r: 0,\n g: 0,\n b: 128\n }\n ],\n [\n \"oldlace\",\n {\n r: 253,\n g: 245,\n b: 230\n }\n ],\n [\n \"olive\",\n {\n r: 128,\n g: 128,\n b: 0\n }\n ],\n [\n \"olivedrab\",\n {\n r: 107,\n g: 142,\n b: 35\n }\n ],\n [\n \"orange\",\n {\n r: 255,\n g: 165,\n b: 0\n }\n ],\n [\n \"orangered\",\n {\n r: 255,\n g: 69,\n b: 0\n }\n ],\n [\n \"orchid\",\n {\n r: 218,\n g: 112,\n b: 214\n }\n ],\n [\n \"palegoldenrod\",\n {\n r: 238,\n g: 232,\n b: 170\n }\n ],\n [\n \"palegreen\",\n {\n r: 152,\n g: 251,\n b: 152\n }\n ],\n [\n \"paleturquoise\",\n {\n r: 175,\n g: 238,\n b: 238\n }\n ],\n [\n \"palevioletred\",\n {\n r: 219,\n g: 112,\n b: 147\n }\n ],\n [\n \"papayawhip\",\n {\n r: 255,\n g: 239,\n b: 213\n }\n ],\n [\n \"peachpuff\",\n {\n r: 255,\n g: 218,\n b: 185\n }\n ],\n [\n \"peru\",\n {\n r: 205,\n g: 133,\n b: 63\n }\n ],\n [\n \"pink\",\n {\n r: 255,\n g: 192,\n b: 203\n }\n ],\n [\n \"plum\",\n {\n r: 221,\n g: 160,\n b: 221\n }\n ],\n [\n \"powderblue\",\n {\n r: 176,\n g: 224,\n b: 230\n }\n ],\n [\n \"purple\",\n {\n r: 128,\n g: 0,\n b: 128\n }\n ],\n [\n \"rebeccapurple\",\n {\n r: 102,\n g: 51,\n b: 153\n }\n ],\n [\n \"red\",\n {\n r: 255,\n g: 0,\n b: 0\n }\n ],\n [\n \"rosybrown\",\n {\n r: 188,\n g: 143,\n b: 143\n }\n ],\n [\n \"royalblue\",\n {\n r: 65,\n g: 105,\n b: 225\n }\n ],\n [\n \"saddlebrown\",\n {\n r: 139,\n g: 69,\n b: 19\n }\n ],\n [\n \"salmon\",\n {\n r: 250,\n g: 128,\n b: 114\n }\n ],\n [\n \"sandybrown\",\n {\n r: 244,\n g: 164,\n b: 96\n }\n ],\n [\n \"seagreen\",\n {\n r: 46,\n g: 139,\n b: 87\n }\n ],\n [\n \"seashell\",\n {\n r: 255,\n g: 245,\n b: 238\n }\n ],\n [\n \"sienna\",\n {\n r: 160,\n g: 82,\n b: 45\n }\n ],\n [\n \"silver\",\n {\n r: 192,\n g: 192,\n b: 192\n }\n ],\n [\n \"skyblue\",\n {\n r: 135,\n g: 206,\n b: 235\n }\n ],\n [\n \"slateblue\",\n {\n r: 106,\n g: 90,\n b: 205\n }\n ],\n [\n \"slategray\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"slategrey\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"snow\",\n {\n r: 255,\n g: 250,\n b: 250\n }\n ],\n [\n \"springgreen\",\n {\n r: 0,\n g: 255,\n b: 127\n }\n ],\n [\n \"steelblue\",\n {\n r: 70,\n g: 130,\n b: 180\n }\n ],\n [\n \"tan\",\n {\n r: 210,\n g: 180,\n b: 140\n }\n ],\n [\n \"teal\",\n {\n r: 0,\n g: 128,\n b: 128\n }\n ],\n [\n \"thistle\",\n {\n r: 216,\n g: 191,\n b: 216\n }\n ],\n [\n \"tomato\",\n {\n r: 255,\n g: 99,\n b: 71\n }\n ],\n [\n \"turquoise\",\n {\n r: 64,\n g: 224,\n b: 208\n }\n ],\n [\n \"violet\",\n {\n r: 238,\n g: 130,\n b: 238\n }\n ],\n [\n \"wheat\",\n {\n r: 245,\n g: 222,\n b: 179\n }\n ],\n [\n \"white\",\n {\n r: 255,\n g: 255,\n b: 255\n }\n ],\n [\n \"whitesmoke\",\n {\n r: 245,\n g: 245,\n b: 245\n }\n ],\n [\n \"yellow\",\n {\n r: 255,\n g: 255,\n b: 0\n }\n ],\n [\n \"yellowgreen\",\n {\n r: 154,\n g: 205,\n b: 50\n }\n ]\n], B = \"deg|rad|grad|turn\", U = \"[-\\\\+]?\\\\d+%?\", D = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\", L = `[-\\\\+]?\\\\d*\\\\.?\\\\d+(?:${B})?`, v = `(?:${D})|(?:${U})`, F = `(?:${v})|(?:${L}?)`, rr = \"(?:[\\\\s|\\\\(\\\\s|\\\\s\\\\(\\\\s]+)?\", tr = \"(?:[\\\\s|\\\\)\\\\s]+)?\", O = \"(?:[,|\\\\s]+)\", er = \"(?:[,|\\\\/\\\\s]*)?\", $ = `${rr}(${F})${O}(${v})${O}(${v})${er}(${v})?${tr}`, f = {\n CSS_UNIT: new RegExp(F),\n ANGLES: B,\n CSS_ANGLE: L,\n CSS_INTEGER: U,\n CSS_NUMBER: D,\n CSS_UNIT2: F,\n PERMISSIVE_MATCH: $,\n hwb: new RegExp(`hwb${$}`),\n rgb: new RegExp(`rgb(?:a)?${$}`),\n hsl: new RegExp(`hsl(?:a)?${$}`),\n hsv: new RegExp(`hsv(?:a)?${$}`),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n}, V = (o) => N.includes(o), k = (o, t) => o !== null && typeof o == \"object\" && Object.keys(t).every((r) => r in o), Z = (o) => `${o}`.includes(\".\") && parseFloat(o) === 1, R = (o) => typeof o == \"string\" && o.includes(\"%\"), c = (o) => !!f.CSS_UNIT.exec(`${o}`), z = [\"rgb\", \"hex\", \"hsl\", \"hsv\", \"hwb\"], J = (o) => N.includes(o) || [\"#\", ...z].some((t) => o.includes(t)) ? !1 : T.some(([t]) => o === t), u = (o, t) => {\n let r = o;\n if (typeof o == \"number\" && Math.min(o, 0) === 0 && // round values to 6 decimals Math.round(N * (10 ** 6)) / 10 ** 6\n Math.max(o, 1) === 1)\n return o;\n Z(o) && (r = \"100%\");\n const e = R(r);\n return r = t === 360 ? parseFloat(r) : Math.min(t, Math.max(0, parseFloat(r))), e && (r = r * t / 100), Math.abs(r - t) < 1e-6 ? 1 : (t === 360 ? r = (r < 0 ? r % t + t : r % t) / t : r = r % t / t, r);\n}, M = (o) => {\n let t = parseFloat(o);\n return (Number.isNaN(t) || t < 0 || t > 1) && (t = 1), t;\n}, x = (o) => Math.min(1, Math.max(0, o)), p = (o) => o.length === 1 ? `0${o}` : String(o), K = (o) => {\n const [[, t]] = T.filter(([r]) => r === o.toLowerCase());\n return t;\n}, h = (o) => parseInt(o, 16), E = (o) => h(o) / 255, Q = (o) => b(o * 255).toString(16), _ = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0, g = 0;\n const a = (e + s) / 2;\n if (e === s)\n g = 0, n = 0;\n else {\n const i = e - s;\n g = a > 0.5 ? i / (2 - e - s) : i / (e + s), e === o && (n = (t - r) / i + (t < r ? 6 : 0)), e === t && (n = (r - o) / i + 2), e === r && (n = (o - t) / i + 4), n /= 6;\n }\n return { h: n, s: g, l: a };\n}, H = (o, t, r) => {\n let e = r;\n return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? o + (t - o) * (6 * e) : e < 1 / 2 ? t : e < 2 / 3 ? o + (t - o) * (2 / 3 - e) * 6 : o;\n}, y = (o, t, r) => {\n let e = 0, s = 0, n = 0;\n if (t === 0)\n s = r, n = r, e = r;\n else if (r) {\n const g = r < 0.5 ? r * (1 + t) : r + t - r * t, a = 2 * r - g;\n e = H(a, g, o + 1 / 3), s = H(a, g, o), n = H(a, g, o - 1 / 3);\n }\n return { r: e, g: s, b: n };\n}, G = (o, t, r) => {\n let e = 0, s = 0;\n const n = Math.min(o, t, r), g = Math.max(o, t, r), a = 1 - g;\n if (g === n)\n return { h: 0, w: n, b: a };\n o === n ? (e = t - r, s = 3) : (e = t === n ? r - o : o - t, s = t === n ? 5 : 1);\n const i = (s - e / (g - n)) / 6;\n return {\n h: i === 1 ? 0 : i,\n w: n,\n b: a\n };\n}, X = (o, t, r) => {\n if (t + r >= 1) {\n const g = t / (t + r);\n return { r: g, g, b: g };\n }\n let { r: e, g: s, b: n } = y(o, 1, 0.5);\n return [e, s, n] = [e, s, n].map((g) => g * (1 - t - r) + t), { r: e, g: s, b: n };\n}, P = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0;\n const g = e, a = e - s, i = e === 0 ? 0 : a / e;\n return e === s ? n = 0 : (o === e && (n = (t - r) / a + (t < r ? 6 : 0)), t === e && (n = (r - o) / a + 2), r === e && (n = (o - t) / a + 4), n /= 6), { h: n, s: i, v: g };\n}, I = (o, t, r) => {\n const e = o * 6, s = t, n = r, g = Math.floor(e), a = e - g, i = n * (1 - s), l = n * (1 - a * s), d = n * (1 - (1 - a) * s), m = g % 6, w = [n, l, i, i, d, n][m], S = [d, n, n, l, i, i][m], A = [i, i, d, n, n, l][m];\n return { r: w, g: S, b: A };\n}, j = (o, t, r, e) => {\n const s = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16))\n ];\n return e && s[0].charAt(0) === s[0].charAt(1) && s[1].charAt(0) === s[1].charAt(1) && s[2].charAt(0) === s[2].charAt(1) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) : s.join(\"\");\n}, C = (o, t, r, e, s) => {\n const n = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16)),\n p(Q(e))\n ];\n return s && n[0].charAt(0) === n[0].charAt(1) && n[1].charAt(0) === n[1].charAt(1) && n[2].charAt(0) === n[2].charAt(1) && n[3].charAt(0) === n[3].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join(\"\");\n}, Y = (o) => {\n const t = String(o).trim().toLowerCase();\n if (J(t))\n return Object.assign(K(t), {\n a: 1,\n format: \"rgb\",\n ok: !0\n });\n if (V(t))\n return {\n r: 0,\n g: 0,\n b: 0,\n a: t === \"transparent\" ? 0 : 1,\n format: \"rgb\",\n ok: !0\n };\n let [, r, e, s, n] = f.rgb.exec(t) || [];\n return r && e && s ? {\n r,\n g: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"rgb\",\n ok: !0\n } : ([, r, e, s, n] = f.hsl.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n l: s,\n a: n !== void 0 ? n : 1,\n format: \"hsl\",\n ok: !0\n } : ([, r, e, s, n] = f.hsv.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n v: s,\n a: n !== void 0 ? n : 1,\n format: \"hsv\",\n ok: !0\n } : ([, r, e, s, n] = f.hwb.exec(t) || [], r && e && s ? {\n h: r,\n w: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"hwb\",\n ok: !0\n } : ([, r, e, s, n] = f.hex8.exec(t) || [], r && e && s && n ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: E(n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex6.exec(t) || [], r && e && s ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : ([, r, e, s, n] = f.hex4.exec(t) || [], r && e && s && n ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: E(n + n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex3.exec(t) || [], r && e && s ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : {\n r: 0,\n g: 0,\n b: 0,\n a: 1,\n format: \"rgb\",\n ok: !o\n })))))));\n}, q = (o) => {\n let t = { r: 0, g: 0, b: 0 }, r = o, e = 1, s, n, g, a, i, l, d, m, w = \"rgb\", S = !1;\n return (!r || typeof r == \"string\") && (r = Y(r), S = r.ok), k(r, t) && c(r.r) && c(r.g) && c(r.b) && ({ r: d, g: m, b: i } = r, [d, m, i] = [d, m, i].map((A) => u(A, R(A) ? 100 : 255)), t = { r: d, g: m, b: i }, w = \"format\" in r ? r.format : \"rgb\"), k(r, { h: 0, s: 0, v: 0 }) && c(r.h) && c(r.s) && c(r.v) && ({ h: l, s, v: n } = r, l = u(l, 360), s = u(s, 100), n = u(n, 100), t = I(l, s, n), w = \"hsv\"), k(r, { h: 0, s: 0, l: 0 }) && c(r.h) && c(r.s) && c(r.l) && ({ h: l, s, l: g } = r, l = u(l, 360), s = u(s, 100), g = u(g, 100), t = y(l, s, g), w = \"hsl\"), k(r, { h: 0, w: 0, b: 0 }) && c(r.h) && c(r.w) && c(r.b) && ({ h: l, w: a, b: i } = r, l = u(l, 360), a = u(a, 100), i = u(i, 100), t = X(l, a, i), w = \"hwb\"), c(r.a) && (e = r.a, e = R(e) || parseFloat(`${e}`) > 1 ? u(e, 100) : e), {\n r: t.r,\n g: t.g,\n b: t.b,\n a: M(e),\n format: w,\n ok: S\n };\n}, sr = \"1.0.8\";\nclass W {\n // bring main utilities to front\n static matchers = f;\n static isOnePointZero = Z;\n static isPercentage = R;\n static isValidCSSUnit = c;\n static isNonColor = V;\n static isColorName = J;\n static isColorType = k;\n static pad2 = p;\n static clamp01 = x;\n static bound01 = u;\n static boundAlpha = M;\n static getRGBFromName = K;\n static convertHexToDecimal = E;\n static convertDecimalToHex = Q;\n static rgbToHsl = _;\n static rgbToHex = j;\n static rgbToHsv = P;\n static rgbToHwb = G;\n static rgbaToHex = C;\n static hslToRgb = I;\n static hsvToRgb = I;\n static hueToRgb = H;\n static hwbToRgb = X;\n static parseIntFromHex = h;\n static stringInputToObject = Y;\n static inputToRGB = q;\n static roundPart = b;\n static webColors = T;\n static nonColors = N;\n static version = sr;\n // main public properties\n r;\n g;\n b;\n a;\n format;\n ok;\n originalInput;\n // main public methods\n constructor(t, r) {\n const e = r && z.includes(r) ? r : \"\", { r: s, g: n, b: g, a, ok: i, format: l } = q(t);\n this.originalInput = t, this.r = s, this.g = n, this.b = g, this.a = a, this.ok = i, this.format = e || l;\n }\n /**\n * Checks if the current input value is a valid colour.\n */\n get isValid() {\n return this.ok;\n }\n /**\n * Checks if the current colour requires a light text colour.\n */\n get isDark() {\n return this.brightness < 120;\n }\n /**\n * Returns the perceived luminance of a colour.\n *\n * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n */\n get luminance() {\n const { r: t, g: r, b: e } = this;\n let s = 0, n = 0, g = 0;\n return t <= 0.03928 ? s = t / 12.92 : s = ((t + 0.055) / 1.055) ** 2.4, r <= 0.03928 ? n = r / 12.92 : n = ((r + 0.055) / 1.055) ** 2.4, e <= 0.03928 ? g = e / 12.92 : g = ((e + 0.055) / 1.055) ** 2.4, 0.2126 * s + 0.7152 * n + 0.0722 * g;\n }\n /**\n * Returns the perceived brightness of the colour.\n */\n get brightness() {\n const { r: t, g: r, b: e } = this.toRgb();\n return (t * 299 + r * 587 + e * 114) / 1e3;\n }\n /**\n * Returns the web colour name closest to the current colour.\n */\n get name() {\n const { r: t, g: r, b: e } = this.toRgb(), [s] = T.map(([n, g]) => {\n const a = (\n // ((rgb.r - r) ** 2 + (rgb.g - g) ** 2 + (rgb.b - b) ** 2) ** 0.5; // standard\n (((g.r - t) * 0.3) ** 2 + ((g.g - r) * 0.6) ** 2 + ((g.b - e) * 0.1) ** 2) ** 0.5\n );\n return [n, a];\n }).find(([, n], g, a) => n === Math.min(...a.map(([, i]) => i)));\n return s;\n }\n /**\n * Returns the colour as an RGBA object.\n */\n toRgb() {\n let { r: t, g: r, b: e, a: s } = this;\n return [t, r, e] = [t, r, e].map((n) => b(n * 255 * 100) / 100), s = b(s * 100) / 100, {\n r: t,\n g: r,\n b: e,\n a: s\n };\n }\n /**\n * Returns the RGBA values concatenated into a CSS3 Module string format.\n * * rgb(255,255,255)\n * * rgba(255,255,255,0.5)\n */\n toRgbString() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b);\n return s === 1 ? `rgb(${n}, ${g}, ${a})` : `rgba(${n}, ${g}, ${a}, ${s})`;\n }\n /**\n * Returns the RGBA values concatenated into a CSS4 Module string format.\n * * rgb(255 255 255)\n * * rgb(255 255 255 / 50%)\n */\n toRgbCSS4String() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b), i = s === 1 ? \"\" : ` / ${b(s * 100)}%`;\n return `rgb(${n} ${g} ${a}${i})`;\n }\n /**\n * Returns the hexadecimal value of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the decimal value.\n */\n toHex(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return n === 1 ? j(r, e, s, t) : C(r, e, s, n, t);\n }\n /**\n * Returns the CSS valid hexadecimal vaue of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the value.\n */\n toHexString(t) {\n return `#${this.toHex(t)}`;\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return C(r, e, s, n, t);\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8String(t) {\n return `#${this.toHex8(t)}`;\n }\n /**\n * Returns the colour as a HSVA object.\n */\n toHsv() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, v: a } = P(t, r, e);\n return {\n h: n,\n s: g,\n v: a,\n a: s\n };\n }\n /**\n * Returns the colour as an HSLA object.\n */\n toHsl() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, l: a } = _(t, r, e);\n return {\n h: n,\n s: g,\n l: a,\n a: s\n };\n }\n /**\n * Returns the HSLA values concatenated into a CSS3 Module format string.\n * * `hsl(150, 100%, 50%)`\n * * `hsla(150, 100%, 50%, 0.5)`\n */\n toHslString() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n return t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100) / 100, s === 1 ? `hsl(${t}, ${r}%, ${e}%)` : `hsla(${t}, ${r}%, ${e}%, ${s})`;\n }\n /**\n * Returns the HSLA values concatenated into a CSS4 Module format string.\n * * `hsl(150deg 100% 50%)`\n * * `hsl(150deg 100% 50% / 50%)`\n */\n toHslCSS4String() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hsl(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Returns the colour as an HWBA object.\n */\n toHwb() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, w: g, b: a } = G(t, r, e);\n return {\n h: n,\n w: g,\n b: a,\n a: s\n };\n }\n /**\n * Returns the HWBA values concatenated into a string.\n */\n toHwbString() {\n let { h: t, w: r, b: e, a: s } = this.toHwb();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hwb(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Sets the alpha value of the current colour.\n */\n setAlpha(t) {\n return typeof t != \"number\" ? this : (this.a = M(t), this);\n }\n /**\n * Saturate the colour with a given amount.\n */\n saturate(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, x(e + t / 100), s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Desaturate the colour with a given amount.\n */\n desaturate(t) {\n return typeof t == \"number\" ? this.saturate(-t) : this;\n }\n /**\n * Completely desaturates a colour into greyscale.\n * Same as calling `desaturate(100)`\n */\n greyscale() {\n return this.saturate(-100);\n }\n /**\n * Increase the colour lightness with a given amount.\n */\n lighten(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, e, x(s + t / 100));\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Decrease the colour lightness with a given amount.\n */\n darken(t) {\n return typeof t == \"number\" ? this.lighten(-t) : this;\n }\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n spin(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(x((r * 360 + t) % 360 / 360), e, s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /** Returns a clone of the current `Color` instance. */\n clone() {\n return new W(this);\n }\n /**\n * Returns the colour value in CSS valid string format.\n */\n toString(t) {\n const { format: r } = this;\n return r === \"hex\" ? this.toHexString(t) : r === \"hsl\" ? this.toHslString() : r === \"hwb\" ? this.toHwbString() : this.toRgbString();\n }\n}\nexport {\n W as default\n};\n//# sourceMappingURL=index.mjs.map\n","import Color from '@thednp/color';\n// import { isNumber } from '@thednp/shorty';\n\n/**\n * Returns a color palette with a given set of parameters.\n *\n * @example\n * new ColorPalette(0, 12, 10, 80);\n * // => { hue: 0, hueSteps: 12, lightSteps: 10, saturation: 80, colors: Array }\n */\nexport default class ColorPalette {\n public static Color = Color;\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n colors: Color[];\n /**\n * The `hue` parameter is optional, which would be set to 0.\n * * `args.hue` the starting Hue [0, 360]\n * * `args.hueSteps` Hue Steps Count [5, 24]\n * * `args.lightSteps` Lightness Steps Count [5, 12]\n * * `args.saturation` Saturation [0, 100]\n */\n constructor(...args: [number?, number?, number?, number?]) {\n let hue = 0;\n let hueSteps = 12;\n let lightSteps = 10;\n let lightnessArray = [0.5];\n let saturation = 100;\n // if (!args.every(n => isNumber(n))) throw TypeError('ColorPalette only accepts numbers.');\n\n if (args.length === 4) {\n [hue, hueSteps, lightSteps, saturation] = args as [number, number, number, number];\n } else if (args.length === 3) {\n [hue, hueSteps, lightSteps] = args as [number, number, number];\n } else if (args.length === 2) {\n [hueSteps, lightSteps] = args as [number, number];\n if ([hueSteps, lightSteps].some(n => n < 1)) {\n throw TypeError('ColorPalette: the two minimum arguments must be numbers higher than 0.');\n }\n }\n\n const colors: Color[] = [];\n const hueStep = 360 / hueSteps;\n const half = Color.roundPart((lightSteps - (lightSteps % 2 ? 1 : 0)) / 2);\n const steps1To13 = [0.25, 0.2, 0.15, 0.11, 0.09, 0.075];\n const lightSets = [\n [1, 2, 3],\n [4, 5],\n [6, 7],\n [8, 9],\n [10, 11],\n [12, 13],\n ];\n const closestSet = lightSets.find(set => set.includes(lightSteps));\n\n // find a lightStep that won't go beyond black and white\n // something within the [10-90] range of lightness\n const lightStep = closestSet\n ? steps1To13[lightSets.indexOf(closestSet)]\n : 100 / (lightSteps + (lightSteps % 2 ? 0 : 1)) / 100;\n\n // light tints\n for (let i = 1; i < half + 1; i += 1) {\n lightnessArray = [...lightnessArray, 0.5 + lightStep * i];\n }\n\n // dark tints\n for (let i = 1; i < lightSteps - half; i += 1) {\n lightnessArray = [0.5 - lightStep * i, ...lightnessArray];\n }\n\n // feed `colors` Array\n for (let i = 0; i < hueSteps; i += 1) {\n const currentHue = ((hue + i * hueStep) % 360) / 360;\n lightnessArray.forEach(l => {\n const newColor = new Color({ h: currentHue, s: 1, l });\n colors.push(saturation < 100 ? newColor.saturate(saturation - 100) : newColor);\n });\n }\n\n this.hue = hue;\n this.hueSteps = hueSteps;\n this.lightSteps = lightSteps;\n this.saturation = saturation;\n this.colors = colors;\n }\n}\n","import ColorPickerLabels from '../interface/colorPickerLabels';\n\n/** The labels presented to the user. */\nconst colorPickerLabels: ColorPickerLabels = {\n pickerLabel: 'Colour Picker',\n appearanceLabel: 'Colour Appearance',\n valueLabel: 'Colour Value',\n toggleLabel: 'Select Colour',\n presetsLabel: 'Colour Presets',\n defaultsLabel: 'Colour Defaults',\n formatLabel: 'Format',\n alphaLabel: 'Alpha',\n hexLabel: 'Hexadecimal',\n hueLabel: 'Hue',\n whitenessLabel: 'Whiteness',\n blacknessLabel: 'Blackness',\n saturationLabel: 'Saturation',\n lightnessLabel: 'Lightness',\n redLabel: 'Red',\n greenLabel: 'Green',\n blueLabel: 'Blue',\n};\n\nexport default colorPickerLabels;\n","/** A list of 17 color names used for WAI-ARIA compliance. */\nconst colorNames: string[] = [\n 'white',\n 'black',\n 'grey',\n 'red',\n 'orange',\n 'brown',\n 'gold',\n 'olive',\n 'yellow',\n 'lime',\n 'green',\n 'teal',\n 'cyan',\n 'blue',\n 'violet',\n 'magenta',\n 'pink',\n];\nexport default colorNames;\n","import { isString } from '@thednp/shorty';\n\n/**\n * Check if a string is valid JSON string.\n *\n * @param str the string input\n * @returns the query result\n */\nconst isValidJSON = (str: unknown): str is string => {\n if (!isString(str)) return false;\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n};\n\nexport default isValidJSON;\n","const vHidden = 'v-hidden';\nexport default vHidden;\n","import { createElement, setAttribute, ObjectAssign, toUpperCase } from '@thednp/shorty';\n\nimport vHidden from './vHidden';\nimport ColorPicker from '../index';\n\n/**\n * Returns the color form for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns a new `
            ` element with color component ``\n */\nconst getColorForm = (self: ColorPicker): HTMLElement => {\n const { format, id, componentLabels } = self;\n const colorForm = createElement({\n tagName: 'div',\n className: `color-form ${format}`,\n }) as HTMLElement;\n\n let components = ['hex'];\n if (format === 'rgb') components = ['red', 'green', 'blue', 'alpha'];\n else if (format === 'hsl') components = ['hue', 'saturation', 'lightness', 'alpha'];\n else if (format === 'hwb') components = ['hue', 'whiteness', 'blackness', 'alpha'];\n\n components.forEach((c: string): void => {\n const [C] = format === 'hex' ? ['#'] : toUpperCase(c).split('');\n const cID = `color_${format}_${c}_${id}`;\n const formatLabel = componentLabels[`${c}Label`];\n const cInputLabel = createElement({ tagName: 'label' }) as HTMLElement;\n setAttribute(cInputLabel, 'for', cID);\n cInputLabel.append(\n createElement({\n tagName: 'span',\n ariaHidden: 'true',\n innerText: `${C}:`,\n }) as HTMLElement,\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: formatLabel,\n }) as HTMLElement,\n );\n const cInput = createElement({\n tagName: 'input',\n id: cID,\n // name: cID, - prevent saving the value to a form\n type: format === 'hex' ? 'text' : 'number',\n value: c === 'alpha' ? '100' : '0',\n className: `color-input ${c}`,\n autocomplete: 'off',\n spellcheck: false,\n } as Partial) as HTMLInputElement;\n\n // alpha\n let max = '100';\n let step = '1';\n if (c !== 'alpha') {\n if (format === 'rgb') {\n max = '255';\n step = '1';\n } else if (c === 'hue') {\n max = '360';\n step = '1';\n }\n }\n ObjectAssign(cInput, {\n min: '0',\n max,\n step,\n });\n colorForm.append(cInputLabel, cInput);\n });\n return colorForm;\n};\n\nexport default getColorForm;\n","import { createElement } from '@thednp/shorty';\n\nimport ColorPicker from '..';\n\n/**\n * Returns all color controls for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns color controls\n */\nconst getColorControls = (self: ColorPicker): HTMLElement => {\n const { format, componentLabels } = self;\n const { hueLabel, alphaLabel, lightnessLabel, saturationLabel, whitenessLabel, blacknessLabel } = componentLabels;\n\n const max1 = format === 'hsl' ? 360 : 100;\n const max2 = format === 'hsl' ? 100 : 360;\n const max3 = 100;\n\n let ctrl1Label = format === 'hsl' ? `${hueLabel} & ${lightnessLabel}` : `${lightnessLabel} & ${saturationLabel}`;\n\n ctrl1Label = format === 'hwb' ? `${whitenessLabel} & ${blacknessLabel}` : ctrl1Label;\n\n const ctrl2Label = format === 'hsl' ? `${saturationLabel}` : `${hueLabel}`;\n\n const colorControls = createElement({\n tagName: 'div',\n className: `color-controls ${format}`,\n }) as HTMLElement;\n\n const colorPointer = 'color-pointer';\n const colorSlider = 'color-slider';\n\n const controls = [\n {\n i: 1,\n c: colorPointer,\n l: ctrl1Label,\n min: 0,\n max: max1,\n },\n {\n i: 2,\n c: colorSlider,\n l: ctrl2Label,\n min: 0,\n max: max2,\n },\n {\n i: 3,\n c: colorSlider,\n l: alphaLabel,\n min: 0,\n max: max3,\n },\n ];\n\n controls.forEach(template => {\n const { i, c, l, min, max } = template;\n const control = createElement({\n tagName: 'div',\n className: 'color-control',\n role: 'presentation',\n }) as HTMLElement;\n\n control.append(\n createElement({\n tagName: 'div',\n className: `visual-control visual-control${i}`,\n }) as HTMLElement,\n );\n\n const knob = createElement({\n tagName: 'div',\n className: `${c} knob`,\n ariaLive: 'polite',\n ariaLabel: l,\n role: 'slider',\n tabIndex: 0,\n ariaValueMin: `${min}`,\n ariaValueMax: `${max}`,\n }) as HTMLElement;\n\n control.append(knob);\n colorControls.append(control);\n });\n\n return colorControls;\n};\n\nexport default getColorControls;\n","import { setAttribute, getAttribute, createElement, setElementStyle } from '@thednp/shorty';\n\nimport Color from '@thednp/color';\nimport ColorPalette from '../colorPalette';\nimport ColorPicker from '../index';\n\n/**\n * Returns a color-defaults with given values and class.\n */\nconst getColorMenu = (self: ColorPicker, colorsSource: ColorPalette | string[], menuClass: string): HTMLElement => {\n const { input, format, componentLabels } = self;\n const { defaultsLabel, presetsLabel } = componentLabels;\n const isOptionsMenu = menuClass === 'color-options';\n const isPalette = colorsSource instanceof ColorPalette;\n const menuLabel = isOptionsMenu ? presetsLabel : defaultsLabel;\n const colorsArray = isPalette ? colorsSource.colors : colorsSource;\n const colorsCount = colorsArray.length;\n const { lightSteps } = isPalette ? colorsSource : { lightSteps: null };\n const fit = lightSteps || [9, 10].find(x => colorsCount >= x * 2 && !(colorsCount % x)) || 5;\n const isMultiLine = isOptionsMenu && colorsCount > fit;\n let rowCountHover = 2;\n rowCountHover = isMultiLine && colorsCount > fit * 2 ? 3 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 3 ? 4 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 4 ? 5 : rowCountHover;\n const rowCount = rowCountHover - (colorsCount <= fit * 3 ? 1 : 2);\n const isScrollable = isMultiLine && colorsCount > rowCount * fit;\n let finalClass = menuClass;\n finalClass += isScrollable ? ' scrollable' : '';\n finalClass += isMultiLine ? ' multiline' : '';\n const gap = isMultiLine ? '1px' : '0.25rem';\n let optionSize = isMultiLine ? 1.75 : 2;\n optionSize = fit > 5 && isMultiLine ? 1.5 : optionSize;\n const menuHeight = `${rowCount * optionSize}rem`;\n const menuHeightHover = `calc(${rowCountHover} * ${optionSize}rem + ${rowCountHover - 1} * ${gap})`;\n\n //
              is an `HTMLElement`\n const menu = createElement({\n tagName: 'ul',\n className: finalClass,\n role: 'listbox',\n ariaLabel: menuLabel,\n }) as HTMLElement;\n\n if (isScrollable) {\n setElementStyle(menu, {\n '--grid-item-size': `${optionSize}rem`,\n '--grid-fit': `${fit}`,\n '--grid-gap': gap,\n '--grid-height': menuHeight,\n '--grid-hover-height': menuHeightHover,\n });\n }\n\n colorsArray.forEach(x => {\n let [value, label] = typeof x === 'string' ? x.trim().split(':') : [];\n if (x instanceof Color) {\n value = x.toHexString();\n label = value;\n }\n const color = new Color(x instanceof Color ? x : value, format);\n const isActive = color.toString() === getAttribute(input, 'value');\n const active = isActive ? ' active' : '';\n\n const option = createElement({\n tagName: 'li',\n className: `color-option${active}`,\n innerText: `${label || value}`,\n tabIndex: 0,\n role: 'option',\n ariaSelected: isActive ? 'true' : 'false',\n }) as HTMLElement;\n setAttribute(option, 'data-value', `${value}`);\n\n if (isOptionsMenu) {\n setElementStyle(option, { backgroundColor: value });\n }\n\n menu.append(option);\n });\n return menu;\n};\n\nexport default getColorMenu;\n","import {\n getAttribute,\n setAttribute,\n toUpperCase,\n ariaHidden,\n tabindex,\n createElement,\n createElementNS,\n} from '@thednp/shorty';\n\nimport Color from '@thednp/color';\n\nimport getColorForm from './getColorForm';\nimport getColorControls from './getColorControls';\nimport getColorMenu from './getColorMenu';\nimport vHidden from './vHidden';\n\nimport ColorPicker from '../index';\n\n/**\n * Generate HTML markup and update instance properties.\n *\n * @param self\n */\nconst setMarkup = (self: ColorPicker) => {\n const { input, parent, format, id, componentLabels, colorKeywords, colorPresets } = self;\n const colorValue = getAttribute(input, 'value') || '#fff';\n const { nonColors } = Color;\n\n const { toggleLabel, pickerLabel, formatLabel, hexLabel } = componentLabels;\n\n // update color\n const color = nonColors.includes(colorValue) ? '#fff' : colorValue;\n self.color = new Color(color, format);\n\n // set initial controls dimensions\n const formatString = format === 'hex' ? hexLabel : toUpperCase(format);\n\n const pickerBtn = createElement({\n id: `picker-btn-${id}`,\n tagName: 'button',\n type: 'button',\n className: 'picker-toggle btn-appearance',\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLButtonElement;\n\n pickerBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${pickerLabel}. ${formatLabel}: ${formatString}`,\n }) as HTMLElement,\n );\n\n const pickerDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown picker',\n role: 'group',\n ariaLabelledBy: `picker-btn-${id}`,\n } as Partial & { ariaLabelledBy: string }) as HTMLElement;\n\n const colorControls = getColorControls(self);\n const colorForm = getColorForm(self);\n\n pickerDropdown.append(colorControls, colorForm);\n input.before(pickerBtn);\n parent.append(pickerDropdown);\n\n // set colour key menu template\n if (colorKeywords || colorPresets) {\n const presetsDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown scrollable menu',\n }) as HTMLElement;\n\n // color presets\n if (colorPresets) {\n presetsDropdown.append(getColorMenu(self, colorPresets, 'color-options'));\n }\n\n // explicit defaults [reset, initial, inherit, transparent, currentColor]\n // also custom defaults [default: #069, complementary: #930]\n if (colorKeywords && colorKeywords.length) {\n presetsDropdown.append(getColorMenu(self, colorKeywords, 'color-defaults'));\n }\n\n const presetsBtn = createElement({\n tagName: 'button',\n type: 'button',\n className: 'menu-toggle btn-appearance',\n tabIndex: -1,\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLButtonElement;\n\n const xmlns = encodeURI('http://www.w3.org/2000/svg');\n const presetsIcon = createElementNS(xmlns, {\n tagName: 'svg',\n }) as HTMLElement;\n setAttribute(presetsIcon, 'xmlns', xmlns);\n setAttribute(presetsIcon, 'viewBox', '0 0 512 512');\n setAttribute(presetsIcon, ariaHidden, 'true');\n\n const path = createElementNS(xmlns, {\n tagName: 'path',\n }) as HTMLElement;\n setAttribute(path, 'd', 'M98,158l157,156L411,158l27,27L255,368L71,185L98,158z');\n setAttribute(path, 'fill', '#fff');\n presetsIcon.append(path);\n presetsBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${toggleLabel}`,\n }) as HTMLElement,\n presetsIcon,\n );\n\n parent.append(presetsBtn, presetsDropdown);\n }\n\n // solve non-colors after settings save\n if (colorKeywords && nonColors.includes(colorValue)) {\n self.value = colorValue;\n }\n setAttribute(input, tabindex, '-1');\n};\n\nexport default setMarkup;\n","import {\n ariaDescription,\n ariaSelected,\n ariaValueNow,\n ariaValueText,\n ariaExpanded,\n keyArrowDown,\n keyArrowUp,\n keyArrowLeft,\n keyArrowRight,\n keyEnter,\n keySpace,\n keyEscape,\n focusinEvent,\n mouseclickEvent,\n keydownEvent,\n changeEvent,\n touchmoveEvent,\n pointerdownEvent,\n pointermoveEvent,\n pointerupEvent,\n tabindex,\n focusoutEvent,\n resizeEvent,\n keyupEvent,\n scrollEvent,\n dispatchEvent,\n getElementsByClassName,\n closest,\n querySelector,\n getElementTransitionDuration,\n getBoundingClientRect,\n getUID,\n getElementStyle,\n getDocumentElement,\n getDocument,\n ObjectAssign,\n ObjectFromEntries,\n Data,\n getInstance,\n setElementStyle,\n normalizeOptions,\n reflow,\n focus,\n hasClass,\n addClass,\n removeClass,\n setAttribute,\n getAttribute,\n removeAttribute,\n isArray,\n isString,\n getWindow,\n on,\n off,\n} from '@thednp/shorty';\n\n// ColorPicker Util\n// ================\nimport Color from '@thednp/color';\nimport type { RGBA, HWBA, HSLA, HSVA } from '@thednp/color';\n\nimport ColorPalette from './colorPalette';\nimport colorPickerLabels from './util/colorPickerLabels';\nimport colorNames from './util/colorNames';\nimport isValidJSON from './util/isValidJSON';\nimport setMarkup from './util/setMarkup';\n\nimport ColorPickerOptions from './interface/colorPickerOptions';\nimport ColorPickerLabels from './interface/colorPickerLabels';\nimport type ColorNames from './interface/ColorNames';\nimport { version } from '../../package.json';\n\n// ColorPicker GC\n// ==============\nconst colorPickerString = 'color-picker';\nconst colorPickerSelector = `[data-function=\"${colorPickerString}\"]`;\nconst colorPickerParentSelector = `.${colorPickerString}`;\nconst colorPickerDefaults: ColorPickerOptions = {\n componentLabels: colorPickerLabels,\n colorLabels: colorNames,\n format: 'rgb',\n colorPresets: false,\n colorKeywords: false,\n};\nconst { roundPart, nonColors } = Color;\n\n// ColorPicker Static Methods\n// ==========================\nconst getColorPickerInstance = (element: HTMLInputElement) => getInstance(element, colorPickerString);\nconst initColorPicker = (element: HTMLInputElement) => new ColorPicker(element);\n\n// ColorPicker Private Methods\n// ===========================\n\n/**\n * Add / remove `ColorPicker` main event listeners.\n */\nconst toggleEvents = (self: ColorPicker, action?: boolean) => {\n const fn = action ? on : off;\n const { input, pickerToggle, menuToggle } = self;\n\n fn(input, focusinEvent, self.showPicker);\n fn(pickerToggle, mouseclickEvent, self.togglePicker);\n\n if (menuToggle) {\n fn(menuToggle, mouseclickEvent, self.toggleMenu);\n }\n};\n\n/**\n * Add / remove `ColorPicker` event listeners active only when open.\n */\nconst toggleEventsOnShown = (self: ColorPicker, action?: boolean) => {\n const fn = action ? on : off;\n const { input, colorMenu, parent } = self;\n const doc = getDocument(input);\n const win = getWindow(doc);\n\n fn(self.controls, pointerdownEvent, self.pointerDown as EventListener);\n self.controlKnobs.forEach(x => fn(x, keydownEvent, self.handleKnobs as EventListener));\n\n fn(win, scrollEvent, self.handleScroll);\n fn(win, resizeEvent, self.update);\n\n [input, ...self.inputs].forEach(x => fn(x, changeEvent, self.changeHandler));\n\n if (colorMenu) {\n fn(colorMenu, mouseclickEvent, self.menuClickHandler);\n fn(colorMenu, keydownEvent, self.menuKeyHandler as EventListener);\n }\n\n fn(doc, pointermoveEvent, self.pointerMove as EventListener);\n fn(doc, pointerupEvent, self.pointerUp as EventListener);\n fn(parent, focusoutEvent, self.handleFocusOut as EventListener);\n fn(doc, keyupEvent, self.handleDismiss as EventListener);\n};\n\n/**\n * Triggers the `ColorPicker` original event.\n */\nconst firePickerChange = (self: ColorPicker) => {\n dispatchEvent(self.input, new CustomEvent('colorpicker.change'));\n};\n\n/**\n * Hides a visible dropdown.\n */\nconst removePosition = (element: HTMLElement) => {\n /* istanbul ignore else */\n if (element) {\n ['bottom', 'top'].forEach(x => removeClass(element, x));\n }\n};\n\n/**\n * Shows a `ColorPicker` dropdown and close the curent open dropdown.\n */\nconst showDropdown = (self: ColorPicker, dropdown: HTMLElement) => {\n const { colorPicker, colorMenu, menuToggle, pickerToggle, parent } = self;\n const isPicker = dropdown === colorPicker;\n const openDropdown = isPicker ? colorMenu : colorPicker;\n const activeBtn = isPicker ? menuToggle : pickerToggle;\n const nextBtn = !isPicker ? menuToggle : pickerToggle;\n\n if (!hasClass(parent, 'open')) {\n addClass(parent, 'open');\n }\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n removePosition(openDropdown);\n }\n addClass(dropdown, 'bottom');\n reflow(dropdown);\n addClass(dropdown, 'show');\n\n if (isPicker) self.update();\n\n if (!self.isOpen) {\n toggleEventsOnShown(self, true);\n self.updateDropdownPosition();\n self.isOpen = true;\n setAttribute(self.input, tabindex, '0');\n if (menuToggle) {\n setAttribute(menuToggle, tabindex, '0');\n }\n }\n\n setAttribute(nextBtn, ariaExpanded, 'true');\n if (activeBtn) {\n setAttribute(activeBtn, ariaExpanded, 'false');\n }\n};\n\n/**\n * Color Picker Web Component\n *\n * @see http://thednp.github.io/color-picker\n */\nexport default class ColorPicker {\n // bring utils to staic\n public static Color = Color;\n public static ColorPalette = ColorPalette;\n public static getInstance = getColorPickerInstance;\n public static init = initColorPicker;\n public static selector = colorPickerSelector;\n // utils important for render\n public static roundPart = roundPart;\n public static setElementStyle = setElementStyle;\n public static setAttribute = setAttribute;\n public static getBoundingClientRect = getBoundingClientRect;\n public static version = version;\n public static colorNames = colorNames;\n public static colorPickerLabels = colorPickerLabels;\n\n id: number;\n input: HTMLInputElement;\n color: Color;\n format = 'rgb';\n parent: HTMLElement;\n dragElement: HTMLElement | undefined;\n isOpen = false;\n controlPositions: {\n c1x: number;\n c1y: number;\n c2y: number;\n c3y: number;\n };\n colorLabels: ColorNames = ObjectFromEntries(colorNames.map(c => [c, c])) as ColorNames;\n colorKeywords: string[] | false;\n colorPresets: ColorPalette | string[] | false;\n componentLabels: ColorPickerLabels;\n pickerToggle: HTMLElement;\n menuToggle: HTMLElement;\n colorPicker: HTMLElement;\n colorMenu: HTMLElement;\n controls: HTMLElement;\n inputs: HTMLInputElement[];\n controlKnobs: HTMLElement[];\n visuals: HTMLElement[];\n\n /**\n * Returns a new `ColorPicker` instance. The target of this constructor\n * must be an `HTMLInputElement`.\n *\n * @param target the target `` element\n * @param config instance options\n */\n constructor(target: (HTMLElement & HTMLInputElement) | string, config?: Partial) {\n const input = querySelector(target) as HTMLInputElement;\n\n // invalidate\n if (typeof target === 'undefined') throw new TypeError(`ColorPicker target not specified.`);\n if (isString(target) && !input) throw new TypeError(`ColorPicker target \"${target}\" cannot be found.`);\n this.input = input;\n\n const parent = closest(input, colorPickerParentSelector);\n if (!parent) throw new TypeError('ColorPicker requires a specific markup to work.');\n\n this.parent = parent;\n this.id = getUID(input, colorPickerString);\n this.dragElement = undefined;\n this.isOpen = false;\n this.controlPositions = {\n c1x: 0,\n c1y: 0,\n c2y: 0,\n c3y: 0,\n };\n // this.colorLabels = {};\n this.colorKeywords = false;\n this.colorPresets = false;\n\n // process options\n const { format, componentLabels, colorLabels, colorKeywords, colorPresets } = normalizeOptions(\n input,\n colorPickerDefaults,\n config || {},\n );\n\n let translatedColorLabels = colorNames;\n /* istanbul ignore else */\n if (isArray(colorLabels) && colorLabels.length === 17) {\n translatedColorLabels = colorLabels;\n } else if (isString(colorLabels) && colorLabels.split(',').length === 17) {\n translatedColorLabels = colorLabels.split(',');\n }\n\n // expose colour labels to all methods\n ObjectAssign(this.colorLabels, ObjectFromEntries(translatedColorLabels.map((c, i) => [colorNames[i], c])));\n\n // update and expose component labels\n const tempComponentLabels =\n isString(componentLabels) && isValidJSON(componentLabels)\n ? (JSON.parse(componentLabels) as ColorPickerLabels)\n : componentLabels;\n this.componentLabels = ObjectAssign({ ...colorPickerLabels }, tempComponentLabels);\n this.color = new Color(input.value || '#fff', format);\n this.format = format;\n\n // set colour defaults\n if (isArray(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords;\n } else if (isString(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords.split(',').map(x => x.trim());\n }\n\n // set colour presets\n if (isArray(colorPresets) && colorPresets.length) {\n this.colorPresets = colorPresets;\n } else if (colorPresets && isValidJSON(colorPresets)) {\n const { hue, hueSteps, lightSteps, saturation } = JSON.parse(colorPresets) as {\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n };\n this.colorPresets = new ColorPalette(hue, hueSteps, lightSteps, saturation);\n } else if (isString(colorPresets)) {\n this.colorPresets = colorPresets.split(',').map((x: string) => x.trim());\n }\n\n // generate markup\n setMarkup(this);\n\n const [colorPicker, colorMenu] = getElementsByClassName('color-dropdown', parent);\n // set main elements\n this.pickerToggle = querySelector('.picker-toggle', parent) as HTMLElement;\n this.menuToggle = querySelector('.menu-toggle', parent) as HTMLElement;\n this.colorPicker = colorPicker;\n this.colorMenu = colorMenu;\n this.inputs = [...getElementsByClassName('color-input', parent)] as HTMLInputElement[];\n const [controls] = getElementsByClassName('color-controls', parent);\n this.controls = controls;\n this.controlKnobs = [...getElementsByClassName('knob', controls)];\n this.visuals = [...getElementsByClassName('visual-control', controls)];\n\n // update colour picker controls, inputs and visuals\n this.update();\n // console.log(this)\n\n // add main events listeners\n toggleEvents(this, true);\n\n // set component data\n Data.set(input, colorPickerString, this);\n }\n\n /** Returns the current colour value */\n get value(): string {\n return this.input.value;\n }\n\n /**\n * Sets a new colour value.\n *\n * @param {string} v new colour value\n */\n set value(v: string) {\n this.input.value = v;\n }\n\n /** Check if the colour presets include any non-colour. */\n get hasNonColor(): boolean {\n return this.colorKeywords instanceof Array && this.colorKeywords.some(x => nonColors.includes(x));\n }\n\n /** Returns hexadecimal value of the current colour. */\n get hex(): string {\n return this.color.toHex(true);\n }\n\n /** Returns the current colour value in {h,s,v,a} object format. */\n get hsv(): HSVA {\n return this.color.toHsv();\n }\n\n /** Returns the current colour value in {h,s,l,a} object format. */\n get hsl(): HSLA {\n return this.color.toHsl();\n }\n\n /** Returns the current colour value in {h,w,b,a} object format. */\n get hwb(): HWBA {\n return this.color.toHwb();\n }\n\n /** Returns the current colour value in {r,g,b,a} object format. */\n get rgb(): RGBA {\n return this.color.toRgb();\n }\n\n /** Returns the current colour brightness. */\n get brightness(): number {\n return this.color.brightness;\n }\n\n /** Returns the current colour luminance. */\n get luminance(): number {\n return this.color.luminance;\n }\n\n /** Checks if the current colour requires a light text colour. */\n get isDark(): boolean {\n const { color, brightness } = this;\n return brightness < 120 && color.a > 0.33;\n }\n\n /** Checks if the current input value is a valid colour. */\n get isValid(): boolean {\n const inputValue = this.input.value;\n return inputValue !== '' && new Color(inputValue).isValid;\n }\n\n /** Returns the colour appearance, usually the closest colour name for the current value. */\n get appearance(): string {\n const { colorLabels, hsl, hsv, format } = this;\n\n const hue = roundPart(hsl.h * 360);\n const saturationSource = format === 'hsl' ? hsl.s : hsv.s;\n const saturation = roundPart(saturationSource * 100);\n const lightness = roundPart(hsl.l * 100);\n const hsvl = hsv.v * 100;\n\n let colorName = 'black';\n\n // determine color appearance\n /* istanbul ignore else */\n if (lightness === 100 && saturation === 0) {\n colorName = colorLabels.white;\n } else if (lightness === 0) {\n colorName = colorLabels.black;\n } else if (saturation === 0) {\n colorName = colorLabels.grey;\n } else if (hue < 15 || hue >= 345) {\n colorName = colorLabels.red;\n } else if (hue >= 15 && hue < 45) {\n colorName = hsvl > 80 && saturation > 80 ? colorLabels.orange : colorLabels.brown;\n } else if (hue >= 45 && hue < 75) {\n const isGold = hue > 46 && hue < 54 && hsvl < 80 && saturation > 90;\n const isOlive = hue >= 54 && hue < 75 && hsvl < 80;\n colorName = isGold ? colorLabels.gold : colorLabels.yellow;\n colorName = isOlive ? colorLabels.olive : colorName;\n } else if (hue >= 75 && hue < 155) {\n colorName = hsvl < 68 ? colorLabels.green : colorLabels.lime;\n } else if (hue >= 155 && hue < 175) {\n colorName = colorLabels.teal;\n } else if (hue >= 175 && hue < 195) {\n colorName = colorLabels.cyan;\n } else if (hue >= 195 && hue < 255) {\n colorName = colorLabels.blue;\n } else if (hue >= 255 && hue < 270) {\n colorName = colorLabels.violet;\n } else if (hue >= 270 && hue < 295) {\n colorName = colorLabels.magenta;\n } else if (hue >= 295 && hue < 345) {\n colorName = colorLabels.pink;\n }\n return colorName;\n }\n\n /** Updates `ColorPicker` visuals. */\n updateVisuals(): void {\n const { controlPositions, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { offsetHeight } = v1;\n const hue = controlPositions.c2y / offsetHeight;\n const { r, g, b } = new Color({ h: hue, s: 1, l: 0.5 }).toRgb();\n const whiteGrad = 'linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)';\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n const roundA = roundPart(alpha * 100) / 100;\n\n const fill = new Color({\n h: hue,\n s: 1,\n l: 0.5,\n a: alpha,\n }).toRgbString();\n const hueGradient = `linear-gradient(\n rgb(255,0,0) 0%, rgb(255,255,0) 16.67%,\n rgb(0,255,0) 33.33%, rgb(0,255,255) 50%,\n rgb(0,0,255) 66.67%, rgb(255,0,255) 83.33%,\n rgb(255,0,0) 100%)`;\n setElementStyle(v1, {\n background: `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,${roundA}) 100%),\n linear-gradient(to right, rgba(255,255,255,${roundA}) 0%, ${fill} 100%),\n ${whiteGrad}`,\n });\n setElementStyle(v2, { background: hueGradient });\n\n setElementStyle(v3, {\n background: `linear-gradient(rgba(${r},${g},${b},1) 0%,rgba(${r},${g},${b},0) 100%)`,\n });\n }\n\n /**\n * The `ColorPicker` *focusout* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleFocusOut = ({ relatedTarget }: FocusEvent & { relatedTarget: HTMLElement }): void => {\n if (relatedTarget && !this.parent.contains(relatedTarget)) {\n this.hide(true);\n }\n };\n\n /**\n * The `ColorPicker` *keyup* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleDismiss = ({ code }: KeyboardEvent): void => {\n if (this.isOpen && code === keyEscape) {\n this.hide();\n }\n };\n\n /**\n * The `ColorPicker` *scroll* event listener when open.\n *\n * @param e\n */\n handleScroll = (e: Event) => {\n const { activeElement } = getDocument(this.input);\n\n this.updateDropdownPosition();\n\n /* istanbul ignore next */\n if (\n ([pointermoveEvent, touchmoveEvent].includes(e.type) && this.dragElement) ||\n (activeElement && this.controlKnobs.includes(activeElement as HTMLElement))\n ) {\n e.stopPropagation();\n e.preventDefault();\n }\n };\n\n /**\n * The `ColorPicker` keyboard event listener for menu navigation.\n *\n * @param e\n */\n menuKeyHandler = (e: KeyboardEvent & { target: HTMLElement }) => {\n const { target, code } = e;\n const { previousElementSibling, nextElementSibling, parentElement } = target;\n const isColorOptionsMenu = parentElement && hasClass(parentElement, 'color-options');\n const allSiblings = parentElement ? [...parentElement.children] : [];\n const columnsCount =\n isColorOptionsMenu && getElementStyle(parentElement, 'grid-template-columns').split(' ').length;\n const currentIndex = allSiblings.indexOf(target);\n const previousElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex - columnsCount];\n const nextElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex + columnsCount];\n\n if ([keyArrowDown, keyArrowUp, keySpace].includes(code)) {\n // prevent scroll when navigating the menu via arrow keys / Space\n e.preventDefault();\n }\n if (isColorOptionsMenu) {\n if (previousElement && code === keyArrowUp) {\n focus(previousElement as HTMLElement);\n } else if (nextElement && code === keyArrowDown) {\n focus(nextElement as HTMLElement);\n } else if (previousElementSibling && code === keyArrowLeft) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && code === keyArrowRight) {\n focus(nextElementSibling as HTMLElement);\n }\n } else if (previousElementSibling && [keyArrowLeft, keyArrowUp].includes(code)) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && [keyArrowRight, keyArrowDown].includes(code)) {\n focus(nextElementSibling as HTMLElement);\n }\n\n if ([keyEnter, keySpace].includes(code)) {\n this.menuClickHandler(e);\n }\n };\n\n /**\n * The `ColorPicker` click event listener for the colour menu presets / defaults.\n *\n * @param e\n * @this {ColorPicker}\n */\n menuClickHandler = (e: Event) => {\n const { target } = e;\n const { colorMenu } = this;\n const newOption = (getAttribute(target as HTMLElement, 'data-value') || '').trim();\n // invalidate for targets other than color options\n if (!newOption.length) return;\n const currentActive = querySelector('li.active', colorMenu);\n let newColor = newOption;\n newColor = nonColors.includes(newColor) ? 'white' : newColor;\n newColor = newColor === 'transparent' ? 'rgba(0,0,0,0)' : newColor;\n\n const { r, g, b, a } = new Color(newColor);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n this.update();\n\n /* istanbul ignore else */\n if (currentActive !== target) {\n /* istanbul ignore else */\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n\n addClass(target as HTMLElement, 'active');\n setAttribute(target as HTMLElement, ariaSelected, 'true');\n\n if (nonColors.includes(newOption)) {\n this.value = newOption;\n }\n firePickerChange(this);\n }\n };\n\n /**\n * The `ColorPicker` *touchstart* / *mousedown* events listener for control knobs.\n *\n * @param e\n */\n pointerDown = (e: PointerEvent & { target: HTMLElement }) => {\n if (e.button !== 0) return;\n const { target, pageX, pageY } = e;\n const { colorMenu, visuals, controlKnobs } = this;\n const [v1, v2, v3] = visuals;\n const [c1, c2, c3] = controlKnobs;\n const visual = controlKnobs.includes(target) ? (target.previousElementSibling as HTMLElement) : target;\n const visualRect = getBoundingClientRect(visual);\n const html = getDocumentElement(v1);\n const offsetX = pageX - html.scrollLeft - visualRect.left;\n const offsetY = pageY - html.scrollTop - visualRect.top;\n\n /* istanbul ignore else */\n if (target === v1 || target === c1) {\n this.dragElement = visual;\n this.changeControl1(offsetX, offsetY);\n } else if (target === v2 || target === c2) {\n this.dragElement = visual;\n this.changeControl2(offsetY);\n } else if (target === v3 || target === c3) {\n this.dragElement = visual;\n this.changeAlpha(offsetY);\n }\n\n if (colorMenu) {\n const currentActive = querySelector('li.active', colorMenu);\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n }\n e.preventDefault();\n };\n\n /**\n * The `ColorPicker` *touchend* / *mouseup* events listener for control knobs.\n *\n * @param e\n * @this\n */\n pointerUp = ({ target }: PointerEvent & { target: HTMLElement }) => {\n const { parent } = this;\n const doc = getDocument(parent);\n const currentOpen = querySelector(`${colorPickerParentSelector}.open`, doc) !== null;\n const selection = doc.getSelection();\n\n if (!this.dragElement && (!selection || !selection.toString().length) && !parent.contains(target)) {\n this.hide(currentOpen);\n }\n\n this.dragElement = undefined;\n };\n\n /**\n * The `ColorPicker` *touchmove* / *mousemove* events listener for control knobs.\n *\n * @param {PointerEvent} e\n */\n pointerMove = (e: PointerEvent) => {\n const { dragElement, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { pageX, pageY } = e;\n\n if (!dragElement) return;\n\n const controlRect = getBoundingClientRect(dragElement);\n const win = getDocumentElement(v1);\n const offsetX = pageX - win.scrollLeft - controlRect.left;\n const offsetY = pageY - win.scrollTop - controlRect.top;\n\n if (dragElement === v1) {\n this.changeControl1(offsetX, offsetY);\n }\n\n if (dragElement === v2) {\n this.changeControl2(offsetY);\n }\n\n if (dragElement === v3) {\n this.changeAlpha(offsetY);\n }\n };\n\n /**\n * The `ColorPicker` *keydown* event listener for control knobs.\n *\n * @param e\n */\n handleKnobs = (e: Event & { code: string }) => {\n const { target, code } = e;\n\n // only react to arrow buttons\n if (![keyArrowUp, keyArrowDown, keyArrowLeft, keyArrowRight].includes(code)) return;\n e.preventDefault();\n\n const { controlKnobs, visuals } = this;\n const { offsetWidth, offsetHeight } = visuals[0];\n const [c1, c2, c3] = controlKnobs;\n const { activeElement } = getDocument(c1);\n const currentKnob = controlKnobs.find(x => x === activeElement);\n const yRatio = offsetHeight / 360;\n\n /* istanbul ignore else */\n if (currentKnob) {\n let offsetX = 0;\n let offsetY = 0;\n\n /* istanbul ignore else */\n if (target === c1) {\n const xRatio = offsetWidth / 100;\n\n /* istanbul ignore else */\n if ([keyArrowLeft, keyArrowRight].includes(code)) {\n this.controlPositions.c1x += code === keyArrowRight ? xRatio : -xRatio;\n } else if ([keyArrowUp, keyArrowDown].includes(code)) {\n this.controlPositions.c1y += code === keyArrowDown ? yRatio : -yRatio;\n }\n\n offsetX = this.controlPositions.c1x;\n offsetY = this.controlPositions.c1y;\n this.changeControl1(offsetX, offsetY);\n } else if (target === c2) {\n this.controlPositions.c2y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c2y;\n this.changeControl2(offsetY);\n } else if (target === c3) {\n this.controlPositions.c3y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c3y;\n this.changeAlpha(offsetY);\n }\n this.handleScroll(e);\n }\n };\n\n /** The event listener of the colour form inputs. */\n changeHandler = (): void => {\n let colorSource;\n const { inputs, format, value: currentValue, input, controlPositions, visuals } = this;\n const { activeElement } = getDocument(input);\n const { offsetHeight } = visuals[0];\n const [i1, , , i4] = inputs;\n const [v1, v2, v3, v4] =\n format === 'rgb'\n ? inputs.map(i => parseFloat(i.value) / (i === i4 ? 100 : 1))\n : inputs.map(i => parseFloat(i.value) / (i !== i1 ? 100 : 360));\n const isNonColorValue = this.hasNonColor && nonColors.includes(currentValue);\n const alpha = i4 ? v4 : 1 - controlPositions.c3y / offsetHeight;\n\n /* istanbul ignore else */\n if (activeElement === input || (activeElement && inputs.includes(activeElement as HTMLInputElement))) {\n if (activeElement === input) {\n if (isNonColorValue) {\n colorSource = currentValue === 'transparent' ? 'rgba(0,0,0,0)' : 'rgb(0,0,0)';\n } else {\n colorSource = currentValue;\n }\n } else if (format === 'hex') {\n colorSource = i1.value;\n } else if (format === 'hsl') {\n colorSource = {\n h: v1,\n s: v2,\n l: v3,\n a: alpha,\n };\n } else if (format === 'hwb') {\n colorSource = {\n h: v1,\n w: v2,\n b: v3,\n a: alpha,\n };\n } else {\n colorSource = {\n r: v1,\n g: v2,\n b: v3,\n a: alpha,\n };\n }\n\n const { r, g, b, a } = new Color(colorSource);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n this.setControlPositions();\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n\n // set non-color keyword\n if (activeElement === input && isNonColorValue) {\n this.value = currentValue;\n }\n }\n };\n\n /**\n * Updates `ColorPicker` first control:\n * * `lightness` and `saturation` for HEX/RGB;\n * * `lightness` and `hue` for HSL.\n *\n * @param X the X component of the offset\n * @param Y the Y component of the offset\n */\n changeControl1(X: number, Y: number): void {\n let [offsetX, offsetY] = [0, 0];\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n if (X > offsetWidth) offsetX = offsetWidth;\n else if (X >= 0) offsetX = X;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = controlPositions.c2y / offsetHeight;\n\n const saturation = offsetX / offsetWidth;\n\n const lightness = 1 - offsetY / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new positions\n this.controlPositions.c1x = offsetX;\n this.controlPositions.c1y = offsetY;\n\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` second control:\n * * `hue` for HEX/RGB/HWB;\n * * `saturation` for HSL.\n *\n * @param Y the Y offset\n */\n changeControl2(Y: number) {\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = offsetY / offsetHeight;\n const saturation = controlPositions.c1x / offsetWidth;\n const lightness = 1 - controlPositions.c1y / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new position\n this.controlPositions.c2y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` last control,\n * the `alpha` channel.\n *\n * @param Y\n */\n changeAlpha(Y: number) {\n const { visuals } = this;\n const { offsetHeight } = visuals[0];\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n // update color alpha\n const alpha = 1 - offsetY / offsetHeight;\n this.color.setAlpha(alpha);\n // update position\n this.controlPositions.c3y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` control positions on:\n * * initialization\n * * window resize\n */\n update = () => {\n this.updateDropdownPosition();\n this.updateAppearance();\n this.setControlPositions();\n this.updateInputs(true);\n this.updateControls();\n this.updateVisuals();\n };\n\n /** Updates the open dropdown position on *scroll* event. */\n updateDropdownPosition() {\n const { input, colorPicker, colorMenu } = this;\n const elRect = getBoundingClientRect(input);\n const { top, bottom } = elRect;\n const { offsetHeight: elHeight } = input;\n const windowHeight = getDocumentElement(input).clientHeight;\n const isPicker = hasClass(colorPicker, 'show');\n const dropdown = isPicker ? colorPicker : colorMenu;\n if (!dropdown) return;\n const { offsetHeight: dropHeight } = dropdown;\n const distanceBottom = windowHeight - bottom;\n const distanceTop = top;\n const bottomExceed = top + dropHeight + elHeight > windowHeight; // show\n const topExceed = top - dropHeight < 0; // show-top\n\n if ((hasClass(dropdown, 'bottom') || !topExceed) && distanceBottom < distanceTop && bottomExceed) {\n removeClass(dropdown, 'bottom');\n addClass(dropdown, 'top');\n } else {\n removeClass(dropdown, 'top');\n addClass(dropdown, 'bottom');\n }\n }\n\n /** Updates control knobs' positions. */\n setControlPositions() {\n const { visuals, color, hsv } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n const alpha = color.a;\n const hue = hsv.h;\n\n const saturation = hsv.s;\n const lightness = hsv.v;\n\n this.controlPositions.c1x = saturation * offsetWidth;\n this.controlPositions.c1y = (1 - lightness) * offsetHeight;\n this.controlPositions.c2y = hue * offsetHeight;\n this.controlPositions.c3y = (1 - alpha) * offsetHeight;\n }\n\n /** Update the visual appearance label and control knob labels. */\n updateAppearance() {\n const { componentLabels, color, parent, hsv, hex, format, controlKnobs } = this;\n const { appearanceLabel, hexLabel, valueLabel } = componentLabels;\n let { r, g, b } = color.toRgb();\n const [knob1, knob2, knob3] = controlKnobs;\n const hue = roundPart(hsv.h * 360);\n const alpha = color.a;\n const saturation = roundPart(hsv.s * 100);\n const lightness = roundPart(hsv.v * 100);\n const colorName = this.appearance;\n\n let colorLabel = `${hexLabel} ${hex.split('').join(' ')}`;\n\n if (format === 'hwb') {\n const { hwb } = this;\n const whiteness = roundPart(hwb.w * 100);\n const blackness = roundPart(hwb.b * 100);\n colorLabel = `HWB: ${hue}°, ${whiteness}%, ${blackness}%`;\n setAttribute(knob1, ariaValueText, `${whiteness}% & ${blackness}%`);\n setAttribute(knob1, ariaValueNow, `${whiteness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}%`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n } else {\n [r, g, b] = [r, g, b].map(roundPart);\n colorLabel = format === 'hsl' ? `HSL: ${hue}°, ${saturation}%, ${lightness}%` : colorLabel;\n colorLabel = format === 'rgb' ? `RGB: ${r}, ${g}, ${b}` : colorLabel;\n\n setAttribute(knob1, ariaValueText, `${lightness}% & ${saturation}%`);\n setAttribute(knob1, ariaValueNow, `${lightness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}°`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n }\n\n const alphaValue = roundPart(alpha * 100);\n setAttribute(knob3, ariaValueText, `${alphaValue}%`);\n setAttribute(knob3, ariaValueNow, `${alphaValue}`);\n\n // update the input backgroundColor\n const newColor = color.toString();\n setElementStyle(this.input, { backgroundColor: newColor });\n\n // toggle dark/light classes will also style the placeholder\n // dark sets color white, light sets color black\n // isDark ? '#000' : '#fff'\n if (!this.isDark) {\n if (hasClass(parent, 'txt-dark')) removeClass(parent, 'txt-dark');\n if (!hasClass(parent, 'txt-light')) addClass(parent, 'txt-light');\n } else {\n if (hasClass(parent, 'txt-light')) removeClass(parent, 'txt-light');\n if (!hasClass(parent, 'txt-dark')) addClass(parent, 'txt-dark');\n }\n }\n\n /** Updates the control knobs actual positions. */\n updateControls() {\n const { controlKnobs, controlPositions } = this;\n let { c1x, c1y, c2y, c3y } = controlPositions;\n const [control1, control2, control3] = controlKnobs;\n // round control positions\n [c1x, c1y, c2y, c3y] = [c1x, c1y, c2y, c3y].map(roundPart);\n\n setElementStyle(control1, {\n transform: `translate3d(${c1x - 4}px,${c1y - 4}px,0)`,\n });\n setElementStyle(control2, { transform: `translate3d(0,${c2y - 4}px,0)` });\n setElementStyle(control3, { transform: `translate3d(0,${c3y - 4}px,0)` });\n }\n\n /**\n * Updates all color form inputs.\n *\n * @param isPrevented when `true`, the component original event is prevented\n */\n updateInputs(isPrevented?: boolean) {\n const { value: oldColor, format, inputs, color, hsl } = this;\n const [i1, i2, i3, i4] = inputs;\n const alpha = roundPart(color.a * 100);\n const hue = roundPart(hsl.h * 360);\n let newColor = color.toString();\n\n /* istanbul ignore else */\n if (format === 'hex') {\n newColor = this.color.toHexString(true);\n i1.value = this.hex;\n } else if (format === 'hsl') {\n const lightness = roundPart(hsl.l * 100);\n const saturation = roundPart(hsl.s * 100);\n newColor = this.color.toHslString();\n i1.value = `${hue}`;\n i2.value = `${saturation}`;\n i3.value = `${lightness}`;\n i4.value = `${alpha}`;\n } else if (format === 'hwb') {\n const { w, b } = this.hwb;\n const whiteness = roundPart(w * 100);\n const blackness = roundPart(b * 100);\n\n newColor = this.color.toHwbString();\n i1.value = `${hue}`;\n i2.value = `${whiteness}`;\n i3.value = `${blackness}`;\n i4.value = `${alpha}`;\n } else if (format === 'rgb') {\n let { r, g, b } = this.rgb;\n [r, g, b] = [r, g, b].map(roundPart);\n\n newColor = this.color.toRgbString();\n i1.value = `${r}`;\n i2.value = `${g}`;\n i3.value = `${b}`;\n i4.value = `${alpha}`;\n }\n\n // update the color value\n this.value = newColor;\n\n // don't trigger the custom event unless it's really changed\n if (!isPrevented && newColor !== oldColor) {\n firePickerChange(this);\n }\n }\n\n /**\n * Toggle the `ColorPicker` dropdown visibility.\n *\n * @param e\n */\n togglePicker = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorPicker } = this;\n\n if (this.isOpen && hasClass(colorPicker, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorPicker);\n }\n };\n\n /** Shows the `ColorPicker` dropdown. */\n showPicker = () => {\n const { colorPicker } = this;\n\n if (!['top', 'bottom'].some(c => hasClass(colorPicker, c))) {\n showDropdown(this, colorPicker);\n }\n };\n\n /**\n * Toggles the visibility of the `ColorPicker` presets menu.\n *\n * @param e\n * @this {ColorPicker}\n */\n toggleMenu = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorMenu } = this;\n\n if (this.isOpen && hasClass(colorMenu, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorMenu);\n }\n };\n\n /**\n * Hides the currently open `ColorPicker` dropdown.\n *\n * @param {boolean=} focusPrevented\n */\n hide(focusPrevented?: boolean) {\n if (this.isOpen) {\n const { pickerToggle, menuToggle, colorPicker, colorMenu, parent, input } = this;\n const openPicker = hasClass(colorPicker, 'show');\n const openDropdown = openPicker ? colorPicker : colorMenu;\n const relatedBtn = openPicker ? pickerToggle : menuToggle;\n const animationDuration = openDropdown && getElementTransitionDuration(openDropdown);\n\n this.value = this.color.toString(true);\n\n /* istanbul ignore else */\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n setAttribute(relatedBtn, ariaExpanded, 'false');\n setTimeout(() => {\n removePosition(openDropdown);\n /* istanbul ignore else */\n if (!querySelector('.show', parent)) {\n removeClass(parent, 'open');\n toggleEventsOnShown(this);\n this.isOpen = false;\n }\n }, animationDuration);\n }\n\n if (!focusPrevented) {\n focus(pickerToggle);\n }\n setAttribute(input, tabindex, '-1');\n if (relatedBtn === menuToggle) {\n setAttribute(menuToggle, tabindex, '-1');\n }\n }\n }\n\n /** Removes `ColorPicker` from target ``. */\n dispose() {\n const { input, parent } = this;\n this.hide(true);\n toggleEvents(this);\n [...parent.children].forEach(el => {\n if (el !== input) el.remove();\n });\n\n removeAttribute(input, tabindex);\n setElementStyle(input, { backgroundColor: '' });\n\n ['txt-light', 'txt-dark'].forEach(c => removeClass(parent, c));\n Data.remove(input, colorPickerString);\n }\n}\n"],"names":["me","ge","Ae","ke","Me","K","P","_","tt","st","rt","it","St","kt","Mt","Ct","zt","Bt","Re","Qe","je","qe","Ye","$e","sn","Rt","U","fn","jt","A","qt","S","z","t","x","N","Gt","e","n","o","s","Jt","Kt","r","Xt","Yt","Tn","Cn","Ln","In","zn","v","i","u","E","L","Hn","k","W","R","d","M","Zt","$t","Q","g","ne","Qn","V","w","oe","jn","a","l","p","m","y","j","Kn","Zn","$n","I","to","h","T","B","H","b","ae","ie","le","So","To","D","F","rr","tr","O","er","$","f","Z","c","J","G","X","C","Y","q","sr","ColorPalette","Color","args","hue","hueSteps","lightSteps","lightnessArray","saturation","colors","hueStep","half","steps1To13","lightSets","closestSet","set","lightStep","currentHue","newColor","colorPickerLabels","colorNames","isValidJSON","str","isString","vHidden","getColorForm","self","format","id","componentLabels","colorForm","createElement","components","toUpperCase","cID","formatLabel","cInputLabel","setAttribute","cInput","max","step","ObjectAssign","getColorControls","hueLabel","alphaLabel","lightnessLabel","saturationLabel","whitenessLabel","blacknessLabel","max1","max2","max3","ctrl1Label","ctrl2Label","colorControls","colorPointer","colorSlider","template","min","control","knob","getColorMenu","colorsSource","menuClass","input","defaultsLabel","presetsLabel","isOptionsMenu","isPalette","menuLabel","colorsArray","colorsCount","fit","isMultiLine","rowCountHover","rowCount","isScrollable","finalClass","gap","optionSize","menuHeight","menuHeightHover","menu","setElementStyle","value","label","isActive","getAttribute","option","setMarkup","parent","colorKeywords","colorPresets","colorValue","nonColors","toggleLabel","pickerLabel","hexLabel","color","formatString","pickerBtn","pickerDropdown","presetsDropdown","presetsBtn","xmlns","presetsIcon","createElementNS","ariaHidden","path","tabindex","colorPickerString","colorPickerSelector","colorPickerParentSelector","colorPickerDefaults","roundPart","getColorPickerInstance","element","getInstance","initColorPicker","ColorPicker","toggleEvents","action","on","off","pickerToggle","menuToggle","focusinEvent","mouseclickEvent","toggleEventsOnShown","colorMenu","doc","getDocument","win","getWindow","pointerdownEvent","keydownEvent","scrollEvent","resizeEvent","changeEvent","pointermoveEvent","pointerupEvent","focusoutEvent","keyupEvent","firePickerChange","dispatchEvent","removePosition","removeClass","showDropdown","dropdown","colorPicker","isPicker","openDropdown","activeBtn","nextBtn","hasClass","addClass","reflow","ariaExpanded","getBoundingClientRect","version","ObjectFromEntries","target","config","querySelector","closest","getUID","colorLabels","normalizeOptions","translatedColorLabels","isArray","tempComponentLabels","getElementsByClassName","controls","Data","brightness","inputValue","hsl","hsv","saturationSource","lightness","hsvl","colorName","isGold","isOlive","controlPositions","visuals","v1","v2","v3","offsetHeight","whiteGrad","alpha","roundA","fill","hueGradient","relatedTarget","code","keyEscape","activeElement","touchmoveEvent","previousElementSibling","nextElementSibling","parentElement","isColorOptionsMenu","allSiblings","columnsCount","getElementStyle","currentIndex","previousElement","nextElement","keyArrowDown","keyArrowUp","keySpace","focus","keyArrowLeft","keyArrowRight","keyEnter","newOption","currentActive","removeAttribute","ariaSelected","pageX","pageY","controlKnobs","c1","c2","c3","visual","visualRect","html","getDocumentElement","offsetX","offsetY","currentOpen","selection","dragElement","controlRect","offsetWidth","currentKnob","yRatio","xRatio","colorSource","inputs","currentValue","i1","i4","v4","isNonColorValue","elRect","top","bottom","elHeight","windowHeight","dropHeight","distanceBottom","distanceTop","bottomExceed","topExceed","hex","appearanceLabel","valueLabel","knob1","knob2","knob3","colorLabel","hwb","whiteness","blackness","ariaValueText","ariaValueNow","ariaDescription","alphaValue","c1x","c1y","c2y","c3y","control1","control2","control3","isPrevented","oldColor","i2","i3","focusPrevented","openPicker","relatedBtn","animationDuration","getElementTransitionDuration","el"],"mappings":"AAAK,MAAsBA,KAAK,oBAA6CC,KAAK,iBAAuC,KAAK,eAAkGC,KAAK,iBAA6DC,KAAK,iBAAiBC,KAAK,kBAA+DC,KAAI,UAA6BC,KAAI,oBAAoEC,KAAI,WAAWC,KAAK,YAA0EC,KAAK,WAA4BC,KAAK,SAAsBC,KAAK,SAAqQC,KAAK,eAAoCC,KAAK,eAAeC,KAAK,aAAoDC,KAAK,UAA+DC,KAAK,UAA4CC,KAAK,aAuG1mCC,IAAK,aAAaC,KAAK,WAAWC,KAAK,aAAaC,IAAK,cAAgFC,KAAK,SAA6BC,KAAK,UAAqFC,KAAK,SAA+GC,KAAK,sBAAmEC,KAAI,sBA0B/XC,IAAK,YAAYC,KAAK,UAAU,eAAeC,KAAID,IAAI,EAAE,WAAWE,GAAI,IAAG,WAAWC,KAAID,IAAIE,KAAI;AAEvLH,KAAQA,GAAE,OAAO,KAAK,CAACI,MAAMD,GAAE,KAAKC,EAAE,KAAK,CAAC,IAAQD,GAA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,EAAE,OAAA7C,GAAO,QAAA0B,EAAW,IAAA;AAC1B,SAAK,KAAK,EAAI,GACd8B,GAAa,IAAI,GACjB,CAAC,GAAG9B,EAAO,QAAQ,EAAE,QAAQ,CAAMsM,MAAA;AACjC,MAAIA,MAAOhO,KAAOgO,EAAG,OAAO;AAAA,IAAA,CAC7B,GAEDrE,GAAgB3J,GAAO6C,CAAQ,GAC/B1B,EAAgBnB,GAAO,EAAE,iBAAiB,GAAI,CAAA,GAE7C,CAAA,aAAa,UAAU,EAAE,QAAQ,OAAKkF,EAAYxD,GAAQjG,CAAC,CAAC,GACxDoL,GAAA,OAAO7G,GAAO8C,CAAiB;AAAA,EACtC;AACF;","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/docs/js/color-picker.js b/docs/js/color-picker.js index 4914ad2..bcb8404 100644 --- a/docs/js/color-picker.js +++ b/docs/js/color-picker.js @@ -1,8 +1,8 @@ -var ColorPicker=function(){"use strict";const W={},Gt=o=>{const{type:t,currentTarget:e}=o;[...W[t]].forEach(([s,r])=>{e===s&&[...r].forEach(([n,i])=>{n.apply(s,[o]),typeof i=="object"&&i.once&&Pt(s,t,n,i)})})},Ut=(o,t,e,s)=>{W[t]||(W[t]=new Map);const r=W[t];r.has(o)||r.set(o,new Map);const n=r.get(o),{size:i}=n;n.set(e,s),i||o.addEventListener(t,Gt,s)},Pt=(o,t,e,s)=>{const r=W[t],n=r&&r.get(o),i=n&&n.get(e),a=i!==void 0?i:s;n&&n.has(e)&&n.delete(e),r&&(!n||!n.size)&&r.delete(o),(!r||!r.size)&&delete W[t],(!n||!n.size)&&o.removeEventListener(t,Gt,a)},_t="aria-description",St="aria-expanded",Re="aria-hidden",Ct="aria-selected",tt="aria-valuenow",et="aria-valuetext",Oe="change",De="DOMContentLoaded",Fe="focusin",Ie="focusout",Wt="keydown",Ke="keyup",Lt="click",Ve="pointerdown",Jt="pointermove",Be="pointerup",je="resize",qe="scroll",ze="touchmove",j="ArrowDown",ot="ArrowUp",gt="ArrowLeft",G="ArrowRight",Ge="Enter",Ue="Escape",Zt="Space",_e="transitionDuration",We="transitionProperty",J="tabindex",Je=navigator.userAgentData,ut=Je,{userAgent:Ze}=navigator,bt=Ze,Xt=/iPhone|iPad|iPod|Android/i;ut?ut.brands.some(o=>Xt.test(o.brand)):Xt.test(bt);const Yt=/(iPhone|iPod|iPad)/;ut?ut.brands.some(o=>Yt.test(o.brand)):Yt.test(bt),bt&&bt.includes("Firefox");const{head:pt}=document;["webkitPerspective","perspective"].some(o=>o in pt.style);const Xe=(o,t,e,s)=>{const r=s||!1;o.addEventListener(t,e,r)},Ye=(o,t,e,s)=>{const r=s||!1;o.removeEventListener(t,e,r)},Qe=(o,t,e,s)=>{const r=n=>{(n.target===o||n.currentTarget===o)&&(e.apply(o,[n]),Ye(o,t,r,s))};Xe(o,t,r,s)},to=()=>{};(()=>{let o=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(o=!0,o)});Qe(document,De,to,t)}catch{}return o})(),["webkitTransform","transform"].some(o=>o in pt.style),["webkitAnimation","animation"].some(o=>o in pt.style),["webkitTransition","transition"].some(o=>o in pt.style);const dt=(o,t)=>o.getAttribute(t),m=(o,t,e)=>o.setAttribute(t,e),At=(o,t)=>o.removeAttribute(t),q=(o,...t)=>{o.classList.add(...t)},O=(o,...t)=>{o.classList.remove(...t)},M=(o,t)=>o.classList.contains(t),Ht=o=>o!=null&&typeof o=="object"||!1,Z=o=>Ht(o)&&typeof o.nodeType=="number"&&[1,2,3,4,5,6,7,8,9,10,11].some(t=>o.nodeType===t)||!1,st=o=>Z(o)&&o.nodeType===1||!1,X=new Map,rt={data:X,set:(o,t,e)=>{st(o)&&(X.has(t)||X.set(t,new Map),X.get(t).set(o,e))},getAllFor:o=>X.get(o)||null,get:(o,t)=>{if(!st(o)||!t)return null;const e=rt.getAllFor(t);return o&&e&&e.get(o)||null},remove:(o,t)=>{const e=rt.getAllFor(t);!e||!st(o)||(e.delete(o),e.size===0&&X.delete(t))}},eo=(o,t)=>rt.get(o,t),B=o=>typeof o=="string"||!1,oo=o=>Ht(o)&&o.constructor.name==="Window"||!1,Qt=o=>Z(o)&&o.nodeType===9||!1,F=o=>oo(o)?o.document:Qt(o)?o:Z(o)?o.ownerDocument:window.document,I=(o,...t)=>Object.assign(o,...t),x=o=>{if(!o)return;if(B(o))return F().createElement(o);const{tagName:t}=o,e=x(t);if(!e)return;const s={...o};return delete s.tagName,I(e,s)},Nt=(o,t)=>{if(!o||!t)return;if(B(t))return F().createElementNS(o,t);const{tagName:e}=t,s=Nt(o,e);if(!s)return;const r={...t};return delete r.tagName,I(s,r)},so=(o,t)=>o.dispatchEvent(t),Et=(o,t)=>{const e=getComputedStyle(o),s=t.replace("webkit","Webkit").replace(/([A-Z])/g,"-$1").toLowerCase();return e.getPropertyValue(s)},ro=o=>{const t=Et(o,We),e=Et(o,_e),s=e.includes("ms")?1:1e3,r=t&&t!=="none"?parseFloat(e)*s:0;return Number.isNaN(r)?0:r},U=(o,t)=>o.focus(t),te=o=>["true",!0].includes(o)?!0:["false",!1].includes(o)?!1:["null","",null,void 0].includes(o)?null:o!==""&&!Number.isNaN(+o)?+o:o,ft=o=>Object.entries(o),no=o=>o.toLowerCase(),io=(o,t,e,s)=>{const r={...e},n={...o.dataset},i={...t},a={},l="title";return ft(n).forEach(([c,h])=>{const b=s&&typeof c=="string"&&c.includes(s)?c.replace(s,"").replace(/[A-Z]/g,u=>no(u)):c;a[b]=te(h)}),ft(r).forEach(([c,h])=>{r[c]=te(h)}),ft(t).forEach(([c,h])=>{c in r?i[c]=r[c]:c in a?i[c]=a[c]:i[c]=c===l?dt(o,l):h}),i},ee=o=>Object.fromEntries(o),ao=o=>o.offsetHeight,D=(o,t)=>{ft(t).forEach(([e,s])=>{if(s&&B(e)&&e.includes("--"))o.style.setProperty(e,s);else{const r={};r[e]=s,I(o.style,r)}})},lo=o=>Ht(o)&&o.constructor.name==="Map"||!1,oe=o=>o.toUpperCase(),mt=(o,t)=>{const{width:e,height:s,top:r,right:n,bottom:i,left:a}=o.getBoundingClientRect();let l=1,c=1;if(t&&st(o)){const{offsetWidth:h,offsetHeight:b}=o;l=h>0?Math.round(e)/h:1,c=b>0?Math.round(s)/b:1}return{width:e/l,height:s/c,top:r/c,right:n/l,bottom:i/c,left:a/l,x:a/l,y:r/c}},Mt=o=>F(o).documentElement;let se=0,re=0;const Y=new Map,ne=(o,t)=>{let e=t?se:re;if(t){const s=ne(o),r=Y.get(s)||new Map;Y.has(s)||Y.set(s,r),lo(r)&&!r.has(t)?(r.set(t,e),se+=1):e=r.get(t)}else{const s=o.id||o;Y.has(s)?e=Y.get(s):(Y.set(s,e),re+=1)}return e},co=o=>{var t;return o?Qt(o)?o.defaultView:Z(o)?(t=o?.ownerDocument)==null?void 0:t.defaultView:o:window},Tt=o=>Array.isArray(o)||!1,ie=(o,t)=>o?o.closest(t)||ie(o.getRootNode().host,t):null,_=(o,t)=>st(o)?o:(Z(t)?t:F()).querySelector(o),nt=(o,t)=>(t&&Z(t)?t:F()).getElementsByClassName(o),Rt=["transparent","currentColor","inherit","revert","initial"],v=o=>{const t=Math.floor(o);return o-t<.5?t:Math.round(o)},vt=[["aliceblue",{r:240,g:248,b:255}],["antiquewhite",{r:250,g:235,b:215}],["aqua",{r:0,g:255,b:255}],["aquamarine",{r:127,g:255,b:212}],["azure",{r:240,g:255,b:255}],["beige",{r:245,g:245,b:220}],["bisque",{r:255,g:228,b:196}],["black",{r:0,g:0,b:0}],["blanchedalmond",{r:255,g:235,b:205}],["blue",{r:0,g:0,b:255}],["blueviolet",{r:138,g:43,b:226}],["brown",{r:165,g:42,b:42}],["burlywood",{r:222,g:184,b:135}],["cadetblue",{r:95,g:158,b:160}],["chartreuse",{r:127,g:255,b:0}],["chocolate",{r:210,g:105,b:30}],["coral",{r:255,g:127,b:80}],["cornflowerblue",{r:100,g:149,b:237}],["cornsilk",{r:255,g:248,b:220}],["crimson",{r:220,g:20,b:60}],["cyan",{r:0,g:255,b:255}],["darkblue",{r:0,g:0,b:139}],["darkcyan",{r:0,g:139,b:139}],["darkgoldenrod",{r:184,g:134,b:11}],["darkgray",{r:169,g:169,b:169}],["darkgreen",{r:0,g:100,b:0}],["darkgrey",{r:169,g:169,b:169}],["darkkhaki",{r:189,g:183,b:107}],["darkmagenta",{r:139,g:0,b:139}],["darkolivegreen",{r:85,g:107,b:47}],["darkorange",{r:255,g:140,b:0}],["darkorchid",{r:153,g:50,b:204}],["darkred",{r:139,g:0,b:0}],["darksalmon",{r:233,g:150,b:122}],["darkseagreen",{r:143,g:188,b:143}],["darkslateblue",{r:72,g:61,b:139}],["darkslategray",{r:47,g:79,b:79}],["darkslategrey",{r:47,g:79,b:79}],["darkturquoise",{r:0,g:206,b:209}],["darkviolet",{r:148,g:0,b:211}],["deeppink",{r:255,g:20,b:147}],["deepskyblue",{r:0,g:191,b:255}],["dimgray",{r:105,g:105,b:105}],["dimgrey",{r:105,g:105,b:105}],["dodgerblue",{r:30,g:144,b:255}],["firebrick",{r:178,g:34,b:34}],["floralwhite",{r:255,g:250,b:240}],["forestgreen",{r:34,g:139,b:34}],["fuchsia",{r:255,g:0,b:255}],["gainsboro",{r:220,g:220,b:220}],["ghostwhite",{r:248,g:248,b:255}],["goldenrod",{r:218,g:165,b:32}],["gold",{r:255,g:215,b:0}],["gray",{r:128,g:128,b:128}],["green",{r:0,g:128,b:0}],["greenyellow",{r:173,g:255,b:47}],["grey",{r:128,g:128,b:128}],["honeydew",{r:240,g:255,b:240}],["hotpink",{r:255,g:105,b:180}],["indianred",{r:205,g:92,b:92}],["indigo",{r:75,g:0,b:130}],["ivory",{r:255,g:255,b:240}],["khaki",{r:240,g:230,b:140}],["lavenderblush",{r:255,g:240,b:245}],["lavender",{r:230,g:230,b:250}],["lawngreen",{r:124,g:252,b:0}],["lemonchiffon",{r:255,g:250,b:205}],["lightblue",{r:173,g:216,b:230}],["lightcoral",{r:240,g:128,b:128}],["lightcyan",{r:224,g:255,b:255}],["lightgoldenrodyellow",{r:250,g:250,b:210}],["lightgray",{r:211,g:211,b:211}],["lightgreen",{r:144,g:238,b:144}],["lightgrey",{r:211,g:211,b:211}],["lightpink",{r:255,g:182,b:193}],["lightsalmon",{r:255,g:160,b:122}],["lightseagreen",{r:32,g:178,b:170}],["lightskyblue",{r:135,g:206,b:250}],["lightslategray",{r:119,g:136,b:153}],["lightslategrey",{r:119,g:136,b:153}],["lightsteelblue",{r:176,g:196,b:222}],["lightyellow",{r:255,g:255,b:224}],["lime",{r:0,g:255,b:0}],["limegreen",{r:50,g:205,b:50}],["linen",{r:250,g:240,b:230}],["magenta",{r:255,g:0,b:255}],["maroon",{r:128,g:0,b:0}],["mediumaquamarine",{r:102,g:205,b:170}],["mediumblue",{r:0,g:0,b:205}],["mediumorchid",{r:186,g:85,b:211}],["mediumpurple",{r:147,g:112,b:219}],["mediumseagreen",{r:60,g:179,b:113}],["mediumslateblue",{r:123,g:104,b:238}],["mediumspringgreen",{r:0,g:250,b:154}],["mediumturquoise",{r:72,g:209,b:204}],["mediumvioletred",{r:199,g:21,b:133}],["midnightblue",{r:25,g:25,b:112}],["mintcream",{r:245,g:255,b:250}],["mistyrose",{r:255,g:228,b:225}],["moccasin",{r:255,g:228,b:181}],["navajowhite",{r:255,g:222,b:173}],["navy",{r:0,g:0,b:128}],["oldlace",{r:253,g:245,b:230}],["olive",{r:128,g:128,b:0}],["olivedrab",{r:107,g:142,b:35}],["orange",{r:255,g:165,b:0}],["orangered",{r:255,g:69,b:0}],["orchid",{r:218,g:112,b:214}],["palegoldenrod",{r:238,g:232,b:170}],["palegreen",{r:152,g:251,b:152}],["paleturquoise",{r:175,g:238,b:238}],["palevioletred",{r:219,g:112,b:147}],["papayawhip",{r:255,g:239,b:213}],["peachpuff",{r:255,g:218,b:185}],["peru",{r:205,g:133,b:63}],["pink",{r:255,g:192,b:203}],["plum",{r:221,g:160,b:221}],["powderblue",{r:176,g:224,b:230}],["purple",{r:128,g:0,b:128}],["rebeccapurple",{r:102,g:51,b:153}],["red",{r:255,g:0,b:0}],["rosybrown",{r:188,g:143,b:143}],["royalblue",{r:65,g:105,b:225}],["saddlebrown",{r:139,g:69,b:19}],["salmon",{r:250,g:128,b:114}],["sandybrown",{r:244,g:164,b:96}],["seagreen",{r:46,g:139,b:87}],["seashell",{r:255,g:245,b:238}],["sienna",{r:160,g:82,b:45}],["silver",{r:192,g:192,b:192}],["skyblue",{r:135,g:206,b:235}],["slateblue",{r:106,g:90,b:205}],["slategray",{r:112,g:128,b:144}],["slategrey",{r:112,g:128,b:144}],["snow",{r:255,g:250,b:250}],["springgreen",{r:0,g:255,b:127}],["steelblue",{r:70,g:130,b:180}],["tan",{r:210,g:180,b:140}],["teal",{r:0,g:128,b:128}],["thistle",{r:216,g:191,b:216}],["tomato",{r:255,g:99,b:71}],["turquoise",{r:64,g:224,b:208}],["violet",{r:238,g:130,b:238}],["wheat",{r:245,g:222,b:179}],["white",{r:255,g:255,b:255}],["whitesmoke",{r:245,g:245,b:245}],["yellow",{r:255,g:255,b:0}],["yellowgreen",{r:154,g:205,b:50}]],ae="deg|rad|grad|turn",le="[-\\+]?\\d+%?",ce="[-\\+]?\\d*\\.\\d+%?",he=`[-\\+]?\\d*\\.?\\d+(?:${ae})?`,wt=`(?:${ce})|(?:${le})`,Ot=`(?:${wt})|(?:${he}?)`,ho="(?:[\\s|\\(\\s|\\s\\(\\s]+)?",go="(?:[\\s|\\)\\s]+)?",ge="(?:[,|\\s]+)",uo="(?:[,|\\/\\s]*)?",it=`${ho}(${Ot})${ge}(${wt})${ge}(${wt})${uo}(${wt})?${go}`,K={CSS_UNIT:new RegExp(Ot),ANGLES:ae,CSS_ANGLE:he,CSS_INTEGER:le,CSS_NUMBER:ce,CSS_UNIT2:Ot,PERMISSIVE_MATCH:it,hwb:new RegExp(`hwb${it}`),rgb:new RegExp(`rgb(?:a)?${it}`),hsl:new RegExp(`hsl(?:a)?${it}`),hsv:new RegExp(`hsv(?:a)?${it}`),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/},ue=o=>Rt.includes(o),at=(o,t)=>o!==null&&typeof o=="object"&&Object.keys(t).every(e=>e in o),be=o=>`${o}`.includes(".")&&parseFloat(o)===1,$t=o=>typeof o=="string"&&o.includes("%"),L=o=>!!K.CSS_UNIT.exec(`${o}`),pe=["rgb","hex","hsl","hsv","hwb"],de=o=>Rt.includes(o)||["#",...pe].some(t=>o.includes(t))?!1:vt.some(([t])=>o===t),T=(o,t)=>{let e=o;if(typeof o=="number"&&Math.min(o,0)===0&&Math.max(o,1)===1)return o;be(o)&&(e="100%");const s=$t(e);return e=t===360?parseFloat(e):Math.min(t,Math.max(0,parseFloat(e))),s&&(e=e*t/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/t:e=e%t/t,e)},Dt=o=>{let t=parseFloat(o);return(Number.isNaN(t)||t<0||t>1)&&(t=1),t},kt=o=>Math.min(1,Math.max(0,o)),z=o=>o.length===1?`0${o}`:String(o),fe=o=>{const[[,t]]=vt.filter(([e])=>e===o.toLowerCase());return t},A=o=>parseInt(o,16),Ft=o=>A(o)/255,me=o=>v(o*255).toString(16),ve=(o,t,e)=>{const s=Math.max(o,t,e),r=Math.min(o,t,e);let n=0,i=0;const a=(s+r)/2;if(s===r)i=0,n=0;else{const l=s-r;i=a>.5?l/(2-s-r):l/(s+r),s===o&&(n=(t-e)/l+(t{let s=e;return s<0&&(s+=1),s>1&&(s-=1),s<1/6?o+(t-o)*(6*s):s<1/2?t:s<2/3?o+(t-o)*(2/3-s)*6:o},lt=(o,t,e)=>{let s=0,r=0,n=0;if(t===0)r=e,n=e,s=e;else if(e){const i=e<.5?e*(1+t):e+t-e*t,a=2*e-i;s=yt(a,i,o+1/3),r=yt(a,i,o),n=yt(a,i,o-1/3)}return{r:s,g:r,b:n}},we=(o,t,e)=>{let s=0,r=0;const n=Math.min(o,t,e),i=Math.max(o,t,e),a=1-i;if(i===n)return{h:0,w:n,b:a};o===n?(s=t-e,r=3):(s=t===n?e-o:o-t,r=t===n?5:1);const l=(r-s/(i-n))/6;return{h:l===1?0:l,w:n,b:a}},$e=(o,t,e)=>{if(t+e>=1){const i=t/(t+e);return{r:i,g:i,b:i}}let{r:s,g:r,b:n}=lt(o,1,.5);return[s,r,n]=[s,r,n].map(i=>i*(1-t-e)+t),{r:s,g:r,b:n}},ke=(o,t,e)=>{const s=Math.max(o,t,e),r=Math.min(o,t,e);let n=0;const i=s,a=s-r,l=s===0?0:a/s;return s===r?n=0:(o===s&&(n=(t-e)/a+(t{const s=o*6,r=t,n=e,i=Math.floor(s),a=s-i,l=n*(1-r),c=n*(1-a*r),h=n*(1-(1-a)*r),b=i%6,u=[n,c,l,l,h,n][b],d=[h,n,n,c,l,l][b],g=[l,l,h,n,n,c][b];return{r:u,g:d,b:g}},ye=(o,t,e,s)=>{const r=[z(v(o).toString(16)),z(v(t).toString(16)),z(v(e).toString(16))];return s&&r[0].charAt(0)===r[0].charAt(1)&&r[1].charAt(0)===r[1].charAt(1)&&r[2].charAt(0)===r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")},Kt=(o,t,e,s,r)=>{const n=[z(v(o).toString(16)),z(v(t).toString(16)),z(v(e).toString(16)),z(me(s))];return r&&n[0].charAt(0)===n[0].charAt(1)&&n[1].charAt(0)===n[1].charAt(1)&&n[2].charAt(0)===n[2].charAt(1)&&n[3].charAt(0)===n[3].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0)+n[3].charAt(0):n.join("")},xe=o=>{const t=String(o).trim().toLowerCase();if(de(t))return Object.assign(fe(t),{a:1,format:"rgb",ok:!0});if(ue(t))return{r:0,g:0,b:0,a:t==="transparent"?0:1,format:"rgb",ok:!0};let[,e,s,r,n]=K.rgb.exec(t)||[];return e&&s&&r?{r:e,g:s,b:r,a:n!==void 0?n:1,format:"rgb",ok:!0}:([,e,s,r,n]=K.hsl.exec(t)||[],e&&s&&r?{h:e,s,l:r,a:n!==void 0?n:1,format:"hsl",ok:!0}:([,e,s,r,n]=K.hsv.exec(t)||[],e&&s&&r?{h:e,s,v:r,a:n!==void 0?n:1,format:"hsv",ok:!0}:([,e,s,r,n]=K.hwb.exec(t)||[],e&&s&&r?{h:e,w:s,b:r,a:n!==void 0?n:1,format:"hwb",ok:!0}:([,e,s,r,n]=K.hex8.exec(t)||[],e&&s&&r&&n?{r:A(e),g:A(s),b:A(r),a:Ft(n),format:"hex",ok:!0}:([,e,s,r]=K.hex6.exec(t)||[],e&&s&&r?{r:A(e),g:A(s),b:A(r),a:1,format:"hex",ok:!0}:([,e,s,r,n]=K.hex4.exec(t)||[],e&&s&&r&&n?{r:A(e+e),g:A(s+s),b:A(r+r),a:Ft(n+n),format:"hex",ok:!0}:([,e,s,r]=K.hex3.exec(t)||[],e&&s&&r?{r:A(e+e),g:A(s+s),b:A(r+r),a:1,format:"hex",ok:!0}:{r:0,g:0,b:0,a:1,format:"rgb",ok:!o})))))))},Pe=o=>{let t={r:0,g:0,b:0},e=o,s=1,r,n,i,a,l,c,h,b,u="rgb",d=!1;return(!e||typeof e=="string")&&(e=xe(e),d=e.ok),at(e,t)&&L(e.r)&&L(e.g)&&L(e.b)&&({r:h,g:b,b:l}=e,[h,b,l]=[h,b,l].map(g=>T(g,$t(g)?100:255)),t={r:h,g:b,b:l},u="format"in e?e.format:"rgb"),at(e,{h:0,s:0,v:0})&&L(e.h)&&L(e.s)&&L(e.v)&&({h:c,s:r,v:n}=e,c=T(c,360),r=T(r,100),n=T(n,100),t=It(c,r,n),u="hsv"),at(e,{h:0,s:0,l:0})&&L(e.h)&&L(e.s)&&L(e.l)&&({h:c,s:r,l:i}=e,c=T(c,360),r=T(r,100),i=T(i,100),t=lt(c,r,i),u="hsl"),at(e,{h:0,w:0,b:0})&&L(e.h)&&L(e.w)&&L(e.b)&&({h:c,w:a,b:l}=e,c=T(c,360),a=T(a,100),l=T(l,100),t=$e(c,a,l),u="hwb"),L(e.a)&&(s=e.a,s=$t(s)||parseFloat(`${s}`)>1?T(s,100):s),{r:t.r,g:t.g,b:t.b,a:Dt(s),format:u,ok:d}},bo="1.0.8";class k{static matchers=K;static isOnePointZero=be;static isPercentage=$t;static isValidCSSUnit=L;static isNonColor=ue;static isColorName=de;static isColorType=at;static pad2=z;static clamp01=kt;static bound01=T;static boundAlpha=Dt;static getRGBFromName=fe;static convertHexToDecimal=Ft;static convertDecimalToHex=me;static rgbToHsl=ve;static rgbToHex=ye;static rgbToHsv=ke;static rgbToHwb=we;static rgbaToHex=Kt;static hslToRgb=It;static hsvToRgb=It;static hueToRgb=yt;static hwbToRgb=$e;static parseIntFromHex=A;static stringInputToObject=xe;static inputToRGB=Pe;static roundPart=v;static webColors=vt;static nonColors=Rt;static version=bo;r;g;b;a;format;ok;originalInput;constructor(t,e){const s=e&&pe.includes(e)?e:"",{r,g:n,b:i,a,ok:l,format:c}=Pe(t);this.originalInput=t,this.r=r,this.g=n,this.b=i,this.a=a,this.ok=l,this.format=s||c}get isValid(){return this.ok}get isDark(){return this.brightness<120}get luminance(){const{r:t,g:e,b:s}=this;let r=0,n=0,i=0;return t<=.03928?r=t/12.92:r=((t+.055)/1.055)**2.4,e<=.03928?n=e/12.92:n=((e+.055)/1.055)**2.4,s<=.03928?i=s/12.92:i=((s+.055)/1.055)**2.4,.2126*r+.7152*n+.0722*i}get brightness(){const{r:t,g:e,b:s}=this.toRgb();return(t*299+e*587+s*114)/1e3}get name(){const{r:t,g:e,b:s}=this.toRgb(),[r]=vt.map(([n,i])=>{const a=(((i.r-t)*.3)**2+((i.g-e)*.6)**2+((i.b-s)*.1)**2)**.5;return[n,a]}).find(([,n],i,a)=>n===Math.min(...a.map(([,l])=>l)));return r}toRgb(){let{r:t,g:e,b:s,a:r}=this;return[t,e,s]=[t,e,s].map(n=>v(n*255*100)/100),r=v(r*100)/100,{r:t,g:e,b:s,a:r}}toRgbString(){const{r:t,g:e,b:s,a:r}=this.toRgb(),[n,i,a]=[t,e,s].map(v);return r===1?`rgb(${n}, ${i}, ${a})`:`rgba(${n}, ${i}, ${a}, ${r})`}toRgbCSS4String(){const{r:t,g:e,b:s,a:r}=this.toRgb(),[n,i,a]=[t,e,s].map(v),l=r===1?"":` / ${v(r*100)}%`;return`rgb(${n} ${i} ${a}${l})`}toHex(t){const{r:e,g:s,b:r,a:n}=this.toRgb();return n===1?ye(e,s,r,t):Kt(e,s,r,n,t)}toHexString(t){return`#${this.toHex(t)}`}toHex8(t){const{r:e,g:s,b:r,a:n}=this.toRgb();return Kt(e,s,r,n,t)}toHex8String(t){return`#${this.toHex8(t)}`}toHsv(){const{r:t,g:e,b:s,a:r}=this,{h:n,s:i,v:a}=ke(t,e,s);return{h:n,s:i,v:a,a:r}}toHsl(){const{r:t,g:e,b:s,a:r}=this,{h:n,s:i,l:a}=ve(t,e,s);return{h:n,s:i,l:a,a:r}}toHslString(){let{h:t,s:e,l:s,a:r}=this.toHsl();return t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100)/100,r===1?`hsl(${t}, ${e}%, ${s}%)`:`hsla(${t}, ${e}%, ${s}%, ${r})`}toHslCSS4String(){let{h:t,s:e,l:s,a:r}=this.toHsl();t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100);const n=r<100?` / ${v(r)}%`:"";return`hsl(${t}deg ${e}% ${s}%${n})`}toHwb(){const{r:t,g:e,b:s,a:r}=this,{h:n,w:i,b:a}=we(t,e,s);return{h:n,w:i,b:a,a:r}}toHwbString(){let{h:t,w:e,b:s,a:r}=this.toHwb();t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100);const n=r<100?` / ${v(r)}%`:"";return`hwb(${t}deg ${e}% ${s}%${n})`}setAlpha(t){return typeof t!="number"?this:(this.a=Dt(t),this)}saturate(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=lt(e,kt(s+t/100),r);return Object.assign(this,{r:n,g:i,b:a}),this}desaturate(t){return typeof t=="number"?this.saturate(-t):this}greyscale(){return this.saturate(-100)}lighten(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=lt(e,s,kt(r+t/100));return Object.assign(this,{r:n,g:i,b:a}),this}darken(t){return typeof t=="number"?this.lighten(-t):this}spin(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=lt(kt((e*360+t)%360/360),s,r);return Object.assign(this,{r:n,g:i,b:a}),this}clone(){return new k(this)}toString(t){const{format:e}=this;return e==="hex"?this.toHexString(t):e==="hsl"?this.toHslString():e==="hwb"?this.toHwbString():this.toRgbString()}}class Vt{static Color=k;hue;hueSteps;lightSteps;saturation;colors;constructor(...t){let e=0,s=12,r=10,n=[.5],i=100;if(t.length===4)[e,s,r,i]=t;else if(t.length===3)[e,s,r]=t;else if(t.length===2&&([s,r]=t,[s,r].some(g=>g<1)))throw TypeError("ColorPalette: the two minimum arguments must be numbers higher than 0.");const a=[],l=360/s,c=k.roundPart((r-(r%2?1:0))/2),h=[.25,.2,.15,.11,.09,.075],b=[[1,2,3],[4,5],[6,7],[8,9],[10,11],[12,13]],u=b.find(g=>g.includes(r)),d=u?h[b.indexOf(u)]:100/(r+(r%2?0:1))/100;for(let g=1;g{const w=new k({h:p,s:1,l:f});a.push(i<100?w.saturate(i-100):w)})}this.hue=e,this.hueSteps=s,this.lightSteps=r,this.saturation=i,this.colors=a}}const Bt={pickerLabel:"Colour Picker",appearanceLabel:"Colour Appearance",valueLabel:"Colour Value",toggleLabel:"Select Colour",presetsLabel:"Colour Presets",defaultsLabel:"Colour Defaults",formatLabel:"Format",alphaLabel:"Alpha",hexLabel:"Hexadecimal",hueLabel:"Hue",whitenessLabel:"Whiteness",blacknessLabel:"Blackness",saturationLabel:"Saturation",lightnessLabel:"Lightness",redLabel:"Red",greenLabel:"Green",blueLabel:"Blue"},ct=["white","black","grey","red","orange","brown","gold","olive","yellow","lime","green","teal","cyan","blue","violet","magenta","pink"],Se=o=>{if(!B(o))return!1;try{JSON.parse(o)}catch{return!1}return!0},jt="v-hidden",po=o=>{const{format:t,id:e,componentLabels:s}=o,r=x({tagName:"div",className:`color-form ${t}`});let n=["hex"];return t==="rgb"?n=["red","green","blue","alpha"]:t==="hsl"?n=["hue","saturation","lightness","alpha"]:t==="hwb"&&(n=["hue","whiteness","blackness","alpha"]),n.forEach(i=>{const[a]=t==="hex"?["#"]:oe(i).split(""),l=`color_${t}_${i}_${e}`,c=s[`${i}Label`],h=x({tagName:"label"});m(h,"for",l),h.append(x({tagName:"span",ariaHidden:"true",innerText:`${a}:`}),x({tagName:"span",className:jt,innerText:c}));const b=x({tagName:"input",id:l,type:t==="hex"?"text":"number",value:i==="alpha"?"100":"0",className:`color-input ${i}`,autocomplete:"off",spellcheck:!1});let u="100",d="1";i!=="alpha"&&(t==="rgb"?(u="255",d="1"):i==="hue"&&(u="360",d="1")),I(b,{min:"0",max:u,step:d}),r.append(h,b)}),r},fo=o=>{const{format:t,componentLabels:e}=o,{hueLabel:s,alphaLabel:r,lightnessLabel:n,saturationLabel:i,whitenessLabel:a,blacknessLabel:l}=e,c=t==="hsl"?360:100,h=t==="hsl"?100:360,b=100;let u=t==="hsl"?`${s} & ${n}`:`${n} & ${i}`;u=t==="hwb"?`${a} & ${l}`:u;const d=t==="hsl"?`${i}`:`${s}`,g=x({tagName:"div",className:`color-controls ${t}`}),p="color-pointer",f="color-slider";return[{i:1,c:p,l:u,min:0,max:c},{i:2,c:f,l:d,min:0,max:h},{i:3,c:f,l:r,min:0,max:b}].forEach($=>{const{i:P,c:H,l:S,min:C,max:R}=$,E=x({tagName:"div",className:"color-control",role:"presentation"});E.append(x({tagName:"div",className:`visual-control visual-control${P}`}));const N=x({tagName:"div",className:`${H} knob`,ariaLive:"polite",ariaLabel:S,role:"slider",tabIndex:0,ariaValueMin:`${C}`,ariaValueMax:`${R}`});E.append(N),g.append(E)}),g},Ce=(o,t,e)=>{const{input:s,format:r,componentLabels:n}=o,{defaultsLabel:i,presetsLabel:a}=n,l=e==="color-options",c=t instanceof Vt,h=l?a:i,b=c?t.colors:t,u=b.length,{lightSteps:d}=c?t:{lightSteps:null},g=d||[9,10].find(N=>u>=N*2&&!(u%N))||5,p=l&&u>g;let f=2;f=p&&u>g*2?3:f,f=p&&u>g*3?4:f,f=p&&u>g*4?5:f;const w=f-(u<=g*3?1:2),$=p&&u>w*g;let P=e;P+=$?" scrollable":"",P+=p?" multiline":"";const H=p?"1px":"0.25rem";let S=p?1.75:2;S=g>5&&p?1.5:S;const C=`${w*S}rem`,R=`calc(${f} * ${S}rem + ${f-1} * ${H})`,E=x({tagName:"ul",className:P,role:"listbox",ariaLabel:h});return $&&D(E,{"--grid-item-size":`${S}rem`,"--grid-fit":`${g}`,"--grid-gap":H,"--grid-height":C,"--grid-hover-height":R}),b.forEach(N=>{let[V,ht]=typeof N=="string"?N.trim().split(":"):[];N instanceof k&&(V=N.toHexString(),ht=V);const Te=new k(N instanceof k?N:V,r).toString()===dt(s,"value"),zt=x({tagName:"li",className:`color-option${Te?" active":""}`,innerText:`${ht||V}`,tabIndex:0,role:"option",ariaSelected:Te?"true":"false"});m(zt,"data-value",`${V}`),l&&D(zt,{backgroundColor:V}),E.append(zt)}),E},mo=o=>{const{input:t,parent:e,format:s,id:r,componentLabels:n,colorKeywords:i,colorPresets:a}=o,l=dt(t,"value")||"#fff",{nonColors:c}=k,{toggleLabel:h,pickerLabel:b,formatLabel:u,hexLabel:d}=n,g=c.includes(l)?"#fff":l;o.color=new k(g,s);const p=s==="hex"?d:oe(s),f=x({id:`picker-btn-${r}`,tagName:"button",className:"picker-toggle btn-appearance",ariaExpanded:"false",ariaHasPopup:"true"});f.append(x({tagName:"span",className:jt,innerText:`${b}. ${u}: ${p}`}));const w=x({tagName:"div",className:"color-dropdown picker",role:"group",ariaLabelledBy:`picker-btn-${r}`}),$=fo(o),P=po(o);if(w.append($,P),t.before(f),e.append(w),i||a){const H=x({tagName:"div",className:"color-dropdown scrollable menu"});a&&H.append(Ce(o,a,"color-options")),i&&i.length&&H.append(Ce(o,i,"color-defaults"));const S=x({tagName:"button",className:"menu-toggle btn-appearance",tabIndex:-1,ariaExpanded:"false",ariaHasPopup:"true"}),C=encodeURI("http://www.w3.org/2000/svg"),R=Nt(C,{tagName:"svg"});m(R,"xmlns",C),m(R,"viewBox","0 0 512 512"),m(R,Re,"true");const E=Nt(C,{tagName:"path"});m(E,"d","M98,158l157,156L411,158l27,27L255,368L71,185L98,158z"),m(E,"fill","#fff"),R.append(E),S.append(x({tagName:"span",className:jt,innerText:`${h}`}),R),e.append(S,H)}i&&c.includes(l)&&(o.value=l),m(t,J,"-1")},vo="2.0.0-alpha9",Q="color-picker",wo=`[data-function="${Q}"]`,Le=`.${Q}`,$o={componentLabels:Bt,colorLabels:ct,format:"rgb",colorPresets:!1,colorKeywords:!1},{roundPart:y,nonColors:xt}=k,ko=o=>eo(o,Q),yo=o=>new Me(o),Ae=(o,t)=>{const e=t?Ut:Pt,{input:s,pickerToggle:r,menuToggle:n}=o;e(s,Fe,o.showPicker),e(r,Lt,o.togglePicker),n&&e(n,Lt,o.toggleMenu)},He=(o,t)=>{const e=t?Ut:Pt,{input:s,colorMenu:r,parent:n}=o,i=F(s),a=co(i);e(o.controls,Ve,o.pointerDown),o.controlKnobs.forEach(l=>e(l,Wt,o.handleKnobs)),e(a,qe,o.handleScroll),e(a,je,o.update),[s,...o.inputs].forEach(l=>e(l,Oe,o.changeHandler)),r&&(e(r,Lt,o.menuClickHandler),e(r,Wt,o.menuKeyHandler)),e(i,Jt,o.pointerMove),e(i,Be,o.pointerUp),e(n,Ie,o.handleFocusOut),e(i,Ke,o.handleDismiss)},Ne=o=>{so(o.input,new CustomEvent("colorpicker.change"))},Ee=o=>{o&&["bottom","top"].forEach(t=>O(o,t))},qt=(o,t)=>{const{colorPicker:e,colorMenu:s,menuToggle:r,pickerToggle:n,parent:i}=o,a=t===e,l=a?s:e,c=a?r:n,h=a?n:r;M(i,"open")||q(i,"open"),l&&(O(l,"show"),Ee(l)),q(t,"bottom"),ao(t),q(t,"show"),a&&o.update(),o.isOpen||(He(o,!0),o.updateDropdownPosition(),o.isOpen=!0,m(o.input,J,"0"),r&&m(r,J,"0")),m(h,St,"true"),c&&m(c,St,"false")};class Me{static Color=k;static ColorPalette=Vt;static getInstance=ko;static init=yo;static selector=wo;static roundPart=y;static setElementStyle=D;static setAttribute=m;static getBoundingClientRect=mt;static version=vo;static colorNames=ct;static colorPickerLabels=Bt;id;input;color;format="rgb";parent;dragElement;isOpen=!1;controlPositions;colorLabels=ee(ct.map(t=>[t,t]));colorKeywords;colorPresets;componentLabels;pickerToggle;menuToggle;colorPicker;colorMenu;controls;inputs;controlKnobs;visuals;constructor(t,e){const s=_(t);if(typeof t>"u")throw new TypeError("ColorPicker target not specified.");if(B(t)&&!s)throw new TypeError(`ColorPicker target "${t}" cannot be found.`);this.input=s;const r=ie(s,Le);if(!r)throw new TypeError("ColorPicker requires a specific markup to work.");this.parent=r,this.id=ne(s,Q),this.dragElement=void 0,this.isOpen=!1,this.controlPositions={c1x:0,c1y:0,c2y:0,c3y:0},this.colorKeywords=!1,this.colorPresets=!1;const{format:n,componentLabels:i,colorLabels:a,colorKeywords:l,colorPresets:c}=io(s,$o,e||{});let h=ct;Tt(a)&&a.length===17?h=a:B(a)&&a.split(",").length===17&&(h=a.split(",")),I(this.colorLabels,ee(h.map((p,f)=>[ct[f],p])));const b=B(i)&&Se(i)?JSON.parse(i):i;if(this.componentLabels=I({...Bt},b),this.color=new k(s.value||"#fff",n),this.format=n,Tt(l)&&l.length?this.colorKeywords=l:B(l)&&l.length&&(this.colorKeywords=l.split(",").map(p=>p.trim())),Tt(c)&&c.length)this.colorPresets=c;else if(c&&Se(c)){const{hue:p,hueSteps:f,lightSteps:w,saturation:$}=JSON.parse(c);this.colorPresets=new Vt(p,f,w,$)}else B(c)&&(this.colorPresets=c.split(",").map(p=>p.trim()));mo(this);const[u,d]=nt("color-dropdown",r);this.pickerToggle=_(".picker-toggle",r),this.menuToggle=_(".menu-toggle",r),this.colorPicker=u,this.colorMenu=d,this.inputs=[...nt("color-input",r)];const[g]=nt("color-controls",r);this.controls=g,this.controlKnobs=[...nt("knob",g)],this.visuals=[...nt("visual-control",g)],this.update(),Ae(this,!0),rt.set(s,Q,this)}get value(){return this.input.value}set value(t){this.input.value=t}get hasNonColor(){return this.colorKeywords instanceof Array&&this.colorKeywords.some(t=>xt.includes(t))}get hex(){return this.color.toHex(!0)}get hsv(){return this.color.toHsv()}get hsl(){return this.color.toHsl()}get hwb(){return this.color.toHwb()}get rgb(){return this.color.toRgb()}get brightness(){return this.color.brightness}get luminance(){return this.color.luminance}get isDark(){const{color:t,brightness:e}=this;return e<120&&t.a>.33}get isValid(){const t=this.input.value;return t!==""&&new k(t).isValid}get appearance(){const{colorLabels:t,hsl:e,hsv:s,format:r}=this,n=y(e.h*360),i=r==="hsl"?e.s:s.s,a=y(i*100),l=y(e.l*100),c=s.v*100;let h="black";if(l===100&&a===0)h=t.white;else if(l===0)h=t.black;else if(a===0)h=t.grey;else if(n<15||n>=345)h=t.red;else if(n>=15&&n<45)h=c>80&&a>80?t.orange:t.brown;else if(n>=45&&n<75){const b=n>46&&n<54&&c<80&&a>90,u=n>=54&&n<75&&c<80;h=b?t.gold:t.yellow,h=u?t.olive:h}else n>=75&&n<155?h=c<68?t.green:t.lime:n>=155&&n<175?h=t.teal:n>=175&&n<195?h=t.cyan:n>=195&&n<255?h=t.blue:n>=255&&n<270?h=t.violet:n>=270&&n<295?h=t.magenta:n>=295&&n<345&&(h=t.pink);return h}updateVisuals(){const{controlPositions:t,visuals:e}=this,[s,r,n]=e,{offsetHeight:i}=s,a=t.c2y/i,{r:l,g:c,b:h}=new k({h:a,s:1,l:.5}).toRgb(),b="linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)",u=1-t.c3y/i,d=y(u*100)/100,g=new k({h:a,s:1,l:.5,a:u}).toRgbString(),p=`linear-gradient( +var ColorPicker=function(){"use strict";const Ut="aria-description",xt="aria-expanded",Me="aria-hidden",Pt="aria-selected",Q="aria-valuenow",tt="aria-valuetext",Te="change",Re="DOMContentLoaded",Oe="focusin",De="focusout",_t="keydown",Fe="keyup",St="click",Ie="pointerdown",zt="pointermove",Ke="pointerup",Ve="resize",Be="scroll",je="touchmove",j="ArrowDown",et="ArrowUp",ht="ArrowLeft",U="ArrowRight",qe="Enter",Ge="Escape",Wt="Space",Ue="transitionDuration",_e="transitionProperty",W="tabindex",ze=navigator.userAgentData,gt=ze,{userAgent:We}=navigator,ut=We,Jt=/iPhone|iPad|iPod|Android/i;gt?gt.brands.some(o=>Jt.test(o.brand)):Jt.test(ut);const Xt=/(iPhone|iPod|iPad)/;gt?gt.brands.some(o=>Xt.test(o.brand)):Xt.test(ut),ut&&ut.includes("Firefox");const{head:bt}=document;["webkitPerspective","perspective"].some(o=>o in bt.style);const Ct=(o,t,e,s)=>{const r=s||!1;o.addEventListener(t,e,r)},Lt=(o,t,e,s)=>{const r=s||!1;o.removeEventListener(t,e,r)},Je=(o,t,e,s)=>{const r=n=>{(n.target===o||n.currentTarget===o)&&(e.apply(o,[n]),Lt(o,t,r,s))};Ct(o,t,r,s)},Xe=()=>{};(()=>{let o=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(o=!0,o)});Je(document,Re,Xe,t)}catch{}return o})(),["webkitTransform","transform"].some(o=>o in bt.style),["webkitAnimation","animation"].some(o=>o in bt.style),["webkitTransition","transition"].some(o=>o in bt.style);const pt=(o,t)=>o.getAttribute(t),m=(o,t,e)=>o.setAttribute(t,e),At=(o,t)=>o.removeAttribute(t),q=(o,...t)=>{o.classList.add(...t)},O=(o,...t)=>{o.classList.remove(...t)},M=(o,t)=>o.classList.contains(t),Ht=o=>o!=null&&typeof o=="object"||!1,J=o=>Ht(o)&&typeof o.nodeType=="number"&&[1,2,3,4,5,6,7,8,9,10,11].some(t=>o.nodeType===t)||!1,ot=o=>J(o)&&o.nodeType===1||!1,X=new Map,st={data:X,set:(o,t,e)=>{ot(o)&&(X.has(t)||X.set(t,new Map),X.get(t).set(o,e))},getAllFor:o=>X.get(o)||null,get:(o,t)=>{if(!ot(o)||!t)return null;const e=st.getAllFor(t);return o&&e&&e.get(o)||null},remove:(o,t)=>{const e=st.getAllFor(t);!e||!ot(o)||(e.delete(o),e.size===0&&X.delete(t))}},Ze=(o,t)=>st.get(o,t),B=o=>typeof o=="string"||!1,Ye=o=>Ht(o)&&o.constructor.name==="Window"||!1,Zt=o=>J(o)&&o.nodeType===9||!1,F=o=>Ye(o)?o.document:Zt(o)?o:J(o)?o.ownerDocument:window.document,I=(o,...t)=>Object.assign(o,...t),x=o=>{if(!o)return;if(B(o))return F().createElement(o);const{tagName:t}=o,e=x(t);if(!e)return;const s={...o};return delete s.tagName,I(e,s)},Nt=(o,t)=>{if(!o||!t)return;if(B(t))return F().createElementNS(o,t);const{tagName:e}=t,s=Nt(o,e);if(!s)return;const r={...t};return delete r.tagName,I(s,r)},Qe=(o,t)=>o.dispatchEvent(t),Et=(o,t)=>{const e=getComputedStyle(o),s=t.replace("webkit","Webkit").replace(/([A-Z])/g,"-$1").toLowerCase();return e.getPropertyValue(s)},to=o=>{const t=Et(o,_e),e=Et(o,Ue),s=e.includes("ms")?1:1e3,r=t&&t!=="none"?parseFloat(e)*s:0;return Number.isNaN(r)?0:r},_=(o,t)=>o.focus(t),Yt=o=>["true",!0].includes(o)?!0:["false",!1].includes(o)?!1:["null","",null,void 0].includes(o)?null:o!==""&&!Number.isNaN(+o)?+o:o,dt=o=>Object.entries(o),eo=o=>o.toLowerCase(),oo=(o,t,e,s)=>{const r={...e},n={...o.dataset},i={...t},a={},l="title";return dt(n).forEach(([c,h])=>{const b=s&&typeof c=="string"&&c.includes(s)?c.replace(s,"").replace(/[A-Z]/g,u=>eo(u)):c;a[b]=Yt(h)}),dt(r).forEach(([c,h])=>{r[c]=Yt(h)}),dt(t).forEach(([c,h])=>{c in r?i[c]=r[c]:c in a?i[c]=a[c]:i[c]=c===l?pt(o,l):h}),i},Qt=o=>Object.fromEntries(o),so=o=>o.offsetHeight,D=(o,t)=>{dt(t).forEach(([e,s])=>{if(s&&B(e)&&e.includes("--"))o.style.setProperty(e,s);else{const r={};r[e]=s,I(o.style,r)}})},ro=o=>Ht(o)&&o.constructor.name==="Map"||!1,te=o=>o.toUpperCase(),ft=(o,t)=>{const{width:e,height:s,top:r,right:n,bottom:i,left:a}=o.getBoundingClientRect();let l=1,c=1;if(t&&ot(o)){const{offsetWidth:h,offsetHeight:b}=o;l=h>0?Math.round(e)/h:1,c=b>0?Math.round(s)/b:1}return{width:e/l,height:s/c,top:r/c,right:n/l,bottom:i/c,left:a/l,x:a/l,y:r/c}},Mt=o=>F(o).documentElement;let ee=0,oe=0;const Z=new Map,se=(o,t)=>{let e=t?ee:oe;if(t){const s=se(o),r=Z.get(s)||new Map;Z.has(s)||Z.set(s,r),ro(r)&&!r.has(t)?(r.set(t,e),ee+=1):e=r.get(t)}else{const s=o.id||o;Z.has(s)?e=Z.get(s):(Z.set(s,e),oe+=1)}return e},no=o=>{var t;return o?Zt(o)?o.defaultView:J(o)?(t=o?.ownerDocument)==null?void 0:t.defaultView:o:window},Tt=o=>Array.isArray(o)||!1,re=(o,t)=>o?o.closest(t)||re(o.getRootNode().host,t):null,z=(o,t)=>ot(o)?o:(J(t)?t:F()).querySelector(o),rt=(o,t)=>(t&&J(t)?t:F()).getElementsByClassName(o),Rt=["transparent","currentColor","inherit","revert","initial"],v=o=>{const t=Math.floor(o);return o-t<.5?t:Math.round(o)},mt=[["aliceblue",{r:240,g:248,b:255}],["antiquewhite",{r:250,g:235,b:215}],["aqua",{r:0,g:255,b:255}],["aquamarine",{r:127,g:255,b:212}],["azure",{r:240,g:255,b:255}],["beige",{r:245,g:245,b:220}],["bisque",{r:255,g:228,b:196}],["black",{r:0,g:0,b:0}],["blanchedalmond",{r:255,g:235,b:205}],["blue",{r:0,g:0,b:255}],["blueviolet",{r:138,g:43,b:226}],["brown",{r:165,g:42,b:42}],["burlywood",{r:222,g:184,b:135}],["cadetblue",{r:95,g:158,b:160}],["chartreuse",{r:127,g:255,b:0}],["chocolate",{r:210,g:105,b:30}],["coral",{r:255,g:127,b:80}],["cornflowerblue",{r:100,g:149,b:237}],["cornsilk",{r:255,g:248,b:220}],["crimson",{r:220,g:20,b:60}],["cyan",{r:0,g:255,b:255}],["darkblue",{r:0,g:0,b:139}],["darkcyan",{r:0,g:139,b:139}],["darkgoldenrod",{r:184,g:134,b:11}],["darkgray",{r:169,g:169,b:169}],["darkgreen",{r:0,g:100,b:0}],["darkgrey",{r:169,g:169,b:169}],["darkkhaki",{r:189,g:183,b:107}],["darkmagenta",{r:139,g:0,b:139}],["darkolivegreen",{r:85,g:107,b:47}],["darkorange",{r:255,g:140,b:0}],["darkorchid",{r:153,g:50,b:204}],["darkred",{r:139,g:0,b:0}],["darksalmon",{r:233,g:150,b:122}],["darkseagreen",{r:143,g:188,b:143}],["darkslateblue",{r:72,g:61,b:139}],["darkslategray",{r:47,g:79,b:79}],["darkslategrey",{r:47,g:79,b:79}],["darkturquoise",{r:0,g:206,b:209}],["darkviolet",{r:148,g:0,b:211}],["deeppink",{r:255,g:20,b:147}],["deepskyblue",{r:0,g:191,b:255}],["dimgray",{r:105,g:105,b:105}],["dimgrey",{r:105,g:105,b:105}],["dodgerblue",{r:30,g:144,b:255}],["firebrick",{r:178,g:34,b:34}],["floralwhite",{r:255,g:250,b:240}],["forestgreen",{r:34,g:139,b:34}],["fuchsia",{r:255,g:0,b:255}],["gainsboro",{r:220,g:220,b:220}],["ghostwhite",{r:248,g:248,b:255}],["goldenrod",{r:218,g:165,b:32}],["gold",{r:255,g:215,b:0}],["gray",{r:128,g:128,b:128}],["green",{r:0,g:128,b:0}],["greenyellow",{r:173,g:255,b:47}],["grey",{r:128,g:128,b:128}],["honeydew",{r:240,g:255,b:240}],["hotpink",{r:255,g:105,b:180}],["indianred",{r:205,g:92,b:92}],["indigo",{r:75,g:0,b:130}],["ivory",{r:255,g:255,b:240}],["khaki",{r:240,g:230,b:140}],["lavenderblush",{r:255,g:240,b:245}],["lavender",{r:230,g:230,b:250}],["lawngreen",{r:124,g:252,b:0}],["lemonchiffon",{r:255,g:250,b:205}],["lightblue",{r:173,g:216,b:230}],["lightcoral",{r:240,g:128,b:128}],["lightcyan",{r:224,g:255,b:255}],["lightgoldenrodyellow",{r:250,g:250,b:210}],["lightgray",{r:211,g:211,b:211}],["lightgreen",{r:144,g:238,b:144}],["lightgrey",{r:211,g:211,b:211}],["lightpink",{r:255,g:182,b:193}],["lightsalmon",{r:255,g:160,b:122}],["lightseagreen",{r:32,g:178,b:170}],["lightskyblue",{r:135,g:206,b:250}],["lightslategray",{r:119,g:136,b:153}],["lightslategrey",{r:119,g:136,b:153}],["lightsteelblue",{r:176,g:196,b:222}],["lightyellow",{r:255,g:255,b:224}],["lime",{r:0,g:255,b:0}],["limegreen",{r:50,g:205,b:50}],["linen",{r:250,g:240,b:230}],["magenta",{r:255,g:0,b:255}],["maroon",{r:128,g:0,b:0}],["mediumaquamarine",{r:102,g:205,b:170}],["mediumblue",{r:0,g:0,b:205}],["mediumorchid",{r:186,g:85,b:211}],["mediumpurple",{r:147,g:112,b:219}],["mediumseagreen",{r:60,g:179,b:113}],["mediumslateblue",{r:123,g:104,b:238}],["mediumspringgreen",{r:0,g:250,b:154}],["mediumturquoise",{r:72,g:209,b:204}],["mediumvioletred",{r:199,g:21,b:133}],["midnightblue",{r:25,g:25,b:112}],["mintcream",{r:245,g:255,b:250}],["mistyrose",{r:255,g:228,b:225}],["moccasin",{r:255,g:228,b:181}],["navajowhite",{r:255,g:222,b:173}],["navy",{r:0,g:0,b:128}],["oldlace",{r:253,g:245,b:230}],["olive",{r:128,g:128,b:0}],["olivedrab",{r:107,g:142,b:35}],["orange",{r:255,g:165,b:0}],["orangered",{r:255,g:69,b:0}],["orchid",{r:218,g:112,b:214}],["palegoldenrod",{r:238,g:232,b:170}],["palegreen",{r:152,g:251,b:152}],["paleturquoise",{r:175,g:238,b:238}],["palevioletred",{r:219,g:112,b:147}],["papayawhip",{r:255,g:239,b:213}],["peachpuff",{r:255,g:218,b:185}],["peru",{r:205,g:133,b:63}],["pink",{r:255,g:192,b:203}],["plum",{r:221,g:160,b:221}],["powderblue",{r:176,g:224,b:230}],["purple",{r:128,g:0,b:128}],["rebeccapurple",{r:102,g:51,b:153}],["red",{r:255,g:0,b:0}],["rosybrown",{r:188,g:143,b:143}],["royalblue",{r:65,g:105,b:225}],["saddlebrown",{r:139,g:69,b:19}],["salmon",{r:250,g:128,b:114}],["sandybrown",{r:244,g:164,b:96}],["seagreen",{r:46,g:139,b:87}],["seashell",{r:255,g:245,b:238}],["sienna",{r:160,g:82,b:45}],["silver",{r:192,g:192,b:192}],["skyblue",{r:135,g:206,b:235}],["slateblue",{r:106,g:90,b:205}],["slategray",{r:112,g:128,b:144}],["slategrey",{r:112,g:128,b:144}],["snow",{r:255,g:250,b:250}],["springgreen",{r:0,g:255,b:127}],["steelblue",{r:70,g:130,b:180}],["tan",{r:210,g:180,b:140}],["teal",{r:0,g:128,b:128}],["thistle",{r:216,g:191,b:216}],["tomato",{r:255,g:99,b:71}],["turquoise",{r:64,g:224,b:208}],["violet",{r:238,g:130,b:238}],["wheat",{r:245,g:222,b:179}],["white",{r:255,g:255,b:255}],["whitesmoke",{r:245,g:245,b:245}],["yellow",{r:255,g:255,b:0}],["yellowgreen",{r:154,g:205,b:50}]],ne="deg|rad|grad|turn",ie="[-\\+]?\\d+%?",ae="[-\\+]?\\d*\\.\\d+%?",le=`[-\\+]?\\d*\\.?\\d+(?:${ne})?`,vt=`(?:${ae})|(?:${ie})`,Ot=`(?:${vt})|(?:${le}?)`,io="(?:[\\s|\\(\\s|\\s\\(\\s]+)?",ao="(?:[\\s|\\)\\s]+)?",ce="(?:[,|\\s]+)",lo="(?:[,|\\/\\s]*)?",nt=`${io}(${Ot})${ce}(${vt})${ce}(${vt})${lo}(${vt})?${ao}`,K={CSS_UNIT:new RegExp(Ot),ANGLES:ne,CSS_ANGLE:le,CSS_INTEGER:ie,CSS_NUMBER:ae,CSS_UNIT2:Ot,PERMISSIVE_MATCH:nt,hwb:new RegExp(`hwb${nt}`),rgb:new RegExp(`rgb(?:a)?${nt}`),hsl:new RegExp(`hsl(?:a)?${nt}`),hsv:new RegExp(`hsv(?:a)?${nt}`),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/},he=o=>Rt.includes(o),it=(o,t)=>o!==null&&typeof o=="object"&&Object.keys(t).every(e=>e in o),ge=o=>`${o}`.includes(".")&&parseFloat(o)===1,wt=o=>typeof o=="string"&&o.includes("%"),L=o=>!!K.CSS_UNIT.exec(`${o}`),ue=["rgb","hex","hsl","hsv","hwb"],be=o=>Rt.includes(o)||["#",...ue].some(t=>o.includes(t))?!1:mt.some(([t])=>o===t),T=(o,t)=>{let e=o;if(typeof o=="number"&&Math.min(o,0)===0&&Math.max(o,1)===1)return o;ge(o)&&(e="100%");const s=wt(e);return e=t===360?parseFloat(e):Math.min(t,Math.max(0,parseFloat(e))),s&&(e=e*t/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/t:e=e%t/t,e)},Dt=o=>{let t=parseFloat(o);return(Number.isNaN(t)||t<0||t>1)&&(t=1),t},$t=o=>Math.min(1,Math.max(0,o)),G=o=>o.length===1?`0${o}`:String(o),pe=o=>{const[[,t]]=mt.filter(([e])=>e===o.toLowerCase());return t},A=o=>parseInt(o,16),Ft=o=>A(o)/255,de=o=>v(o*255).toString(16),fe=(o,t,e)=>{const s=Math.max(o,t,e),r=Math.min(o,t,e);let n=0,i=0;const a=(s+r)/2;if(s===r)i=0,n=0;else{const l=s-r;i=a>.5?l/(2-s-r):l/(s+r),s===o&&(n=(t-e)/l+(t{let s=e;return s<0&&(s+=1),s>1&&(s-=1),s<1/6?o+(t-o)*(6*s):s<1/2?t:s<2/3?o+(t-o)*(2/3-s)*6:o},at=(o,t,e)=>{let s=0,r=0,n=0;if(t===0)r=e,n=e,s=e;else if(e){const i=e<.5?e*(1+t):e+t-e*t,a=2*e-i;s=kt(a,i,o+1/3),r=kt(a,i,o),n=kt(a,i,o-1/3)}return{r:s,g:r,b:n}},me=(o,t,e)=>{let s=0,r=0;const n=Math.min(o,t,e),i=Math.max(o,t,e),a=1-i;if(i===n)return{h:0,w:n,b:a};o===n?(s=t-e,r=3):(s=t===n?e-o:o-t,r=t===n?5:1);const l=(r-s/(i-n))/6;return{h:l===1?0:l,w:n,b:a}},ve=(o,t,e)=>{if(t+e>=1){const i=t/(t+e);return{r:i,g:i,b:i}}let{r:s,g:r,b:n}=at(o,1,.5);return[s,r,n]=[s,r,n].map(i=>i*(1-t-e)+t),{r:s,g:r,b:n}},we=(o,t,e)=>{const s=Math.max(o,t,e),r=Math.min(o,t,e);let n=0;const i=s,a=s-r,l=s===0?0:a/s;return s===r?n=0:(o===s&&(n=(t-e)/a+(t{const s=o*6,r=t,n=e,i=Math.floor(s),a=s-i,l=n*(1-r),c=n*(1-a*r),h=n*(1-(1-a)*r),b=i%6,u=[n,c,l,l,h,n][b],d=[h,n,n,c,l,l][b],g=[l,l,h,n,n,c][b];return{r:u,g:d,b:g}},$e=(o,t,e,s)=>{const r=[G(v(o).toString(16)),G(v(t).toString(16)),G(v(e).toString(16))];return s&&r[0].charAt(0)===r[0].charAt(1)&&r[1].charAt(0)===r[1].charAt(1)&&r[2].charAt(0)===r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")},Kt=(o,t,e,s,r)=>{const n=[G(v(o).toString(16)),G(v(t).toString(16)),G(v(e).toString(16)),G(de(s))];return r&&n[0].charAt(0)===n[0].charAt(1)&&n[1].charAt(0)===n[1].charAt(1)&&n[2].charAt(0)===n[2].charAt(1)&&n[3].charAt(0)===n[3].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0)+n[3].charAt(0):n.join("")},ke=o=>{const t=String(o).trim().toLowerCase();if(be(t))return Object.assign(pe(t),{a:1,format:"rgb",ok:!0});if(he(t))return{r:0,g:0,b:0,a:t==="transparent"?0:1,format:"rgb",ok:!0};let[,e,s,r,n]=K.rgb.exec(t)||[];return e&&s&&r?{r:e,g:s,b:r,a:n!==void 0?n:1,format:"rgb",ok:!0}:([,e,s,r,n]=K.hsl.exec(t)||[],e&&s&&r?{h:e,s,l:r,a:n!==void 0?n:1,format:"hsl",ok:!0}:([,e,s,r,n]=K.hsv.exec(t)||[],e&&s&&r?{h:e,s,v:r,a:n!==void 0?n:1,format:"hsv",ok:!0}:([,e,s,r,n]=K.hwb.exec(t)||[],e&&s&&r?{h:e,w:s,b:r,a:n!==void 0?n:1,format:"hwb",ok:!0}:([,e,s,r,n]=K.hex8.exec(t)||[],e&&s&&r&&n?{r:A(e),g:A(s),b:A(r),a:Ft(n),format:"hex",ok:!0}:([,e,s,r]=K.hex6.exec(t)||[],e&&s&&r?{r:A(e),g:A(s),b:A(r),a:1,format:"hex",ok:!0}:([,e,s,r,n]=K.hex4.exec(t)||[],e&&s&&r&&n?{r:A(e+e),g:A(s+s),b:A(r+r),a:Ft(n+n),format:"hex",ok:!0}:([,e,s,r]=K.hex3.exec(t)||[],e&&s&&r?{r:A(e+e),g:A(s+s),b:A(r+r),a:1,format:"hex",ok:!0}:{r:0,g:0,b:0,a:1,format:"rgb",ok:!o})))))))},ye=o=>{let t={r:0,g:0,b:0},e=o,s=1,r,n,i,a,l,c,h,b,u="rgb",d=!1;return(!e||typeof e=="string")&&(e=ke(e),d=e.ok),it(e,t)&&L(e.r)&&L(e.g)&&L(e.b)&&({r:h,g:b,b:l}=e,[h,b,l]=[h,b,l].map(g=>T(g,wt(g)?100:255)),t={r:h,g:b,b:l},u="format"in e?e.format:"rgb"),it(e,{h:0,s:0,v:0})&&L(e.h)&&L(e.s)&&L(e.v)&&({h:c,s:r,v:n}=e,c=T(c,360),r=T(r,100),n=T(n,100),t=It(c,r,n),u="hsv"),it(e,{h:0,s:0,l:0})&&L(e.h)&&L(e.s)&&L(e.l)&&({h:c,s:r,l:i}=e,c=T(c,360),r=T(r,100),i=T(i,100),t=at(c,r,i),u="hsl"),it(e,{h:0,w:0,b:0})&&L(e.h)&&L(e.w)&&L(e.b)&&({h:c,w:a,b:l}=e,c=T(c,360),a=T(a,100),l=T(l,100),t=ve(c,a,l),u="hwb"),L(e.a)&&(s=e.a,s=wt(s)||parseFloat(`${s}`)>1?T(s,100):s),{r:t.r,g:t.g,b:t.b,a:Dt(s),format:u,ok:d}},co="1.0.8";class k{static matchers=K;static isOnePointZero=ge;static isPercentage=wt;static isValidCSSUnit=L;static isNonColor=he;static isColorName=be;static isColorType=it;static pad2=G;static clamp01=$t;static bound01=T;static boundAlpha=Dt;static getRGBFromName=pe;static convertHexToDecimal=Ft;static convertDecimalToHex=de;static rgbToHsl=fe;static rgbToHex=$e;static rgbToHsv=we;static rgbToHwb=me;static rgbaToHex=Kt;static hslToRgb=It;static hsvToRgb=It;static hueToRgb=kt;static hwbToRgb=ve;static parseIntFromHex=A;static stringInputToObject=ke;static inputToRGB=ye;static roundPart=v;static webColors=mt;static nonColors=Rt;static version=co;r;g;b;a;format;ok;originalInput;constructor(t,e){const s=e&&ue.includes(e)?e:"",{r,g:n,b:i,a,ok:l,format:c}=ye(t);this.originalInput=t,this.r=r,this.g=n,this.b=i,this.a=a,this.ok=l,this.format=s||c}get isValid(){return this.ok}get isDark(){return this.brightness<120}get luminance(){const{r:t,g:e,b:s}=this;let r=0,n=0,i=0;return t<=.03928?r=t/12.92:r=((t+.055)/1.055)**2.4,e<=.03928?n=e/12.92:n=((e+.055)/1.055)**2.4,s<=.03928?i=s/12.92:i=((s+.055)/1.055)**2.4,.2126*r+.7152*n+.0722*i}get brightness(){const{r:t,g:e,b:s}=this.toRgb();return(t*299+e*587+s*114)/1e3}get name(){const{r:t,g:e,b:s}=this.toRgb(),[r]=mt.map(([n,i])=>{const a=(((i.r-t)*.3)**2+((i.g-e)*.6)**2+((i.b-s)*.1)**2)**.5;return[n,a]}).find(([,n],i,a)=>n===Math.min(...a.map(([,l])=>l)));return r}toRgb(){let{r:t,g:e,b:s,a:r}=this;return[t,e,s]=[t,e,s].map(n=>v(n*255*100)/100),r=v(r*100)/100,{r:t,g:e,b:s,a:r}}toRgbString(){const{r:t,g:e,b:s,a:r}=this.toRgb(),[n,i,a]=[t,e,s].map(v);return r===1?`rgb(${n}, ${i}, ${a})`:`rgba(${n}, ${i}, ${a}, ${r})`}toRgbCSS4String(){const{r:t,g:e,b:s,a:r}=this.toRgb(),[n,i,a]=[t,e,s].map(v),l=r===1?"":` / ${v(r*100)}%`;return`rgb(${n} ${i} ${a}${l})`}toHex(t){const{r:e,g:s,b:r,a:n}=this.toRgb();return n===1?$e(e,s,r,t):Kt(e,s,r,n,t)}toHexString(t){return`#${this.toHex(t)}`}toHex8(t){const{r:e,g:s,b:r,a:n}=this.toRgb();return Kt(e,s,r,n,t)}toHex8String(t){return`#${this.toHex8(t)}`}toHsv(){const{r:t,g:e,b:s,a:r}=this,{h:n,s:i,v:a}=we(t,e,s);return{h:n,s:i,v:a,a:r}}toHsl(){const{r:t,g:e,b:s,a:r}=this,{h:n,s:i,l:a}=fe(t,e,s);return{h:n,s:i,l:a,a:r}}toHslString(){let{h:t,s:e,l:s,a:r}=this.toHsl();return t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100)/100,r===1?`hsl(${t}, ${e}%, ${s}%)`:`hsla(${t}, ${e}%, ${s}%, ${r})`}toHslCSS4String(){let{h:t,s:e,l:s,a:r}=this.toHsl();t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100);const n=r<100?` / ${v(r)}%`:"";return`hsl(${t}deg ${e}% ${s}%${n})`}toHwb(){const{r:t,g:e,b:s,a:r}=this,{h:n,w:i,b:a}=me(t,e,s);return{h:n,w:i,b:a,a:r}}toHwbString(){let{h:t,w:e,b:s,a:r}=this.toHwb();t=v(t*360),e=v(e*100),s=v(s*100),r=v(r*100);const n=r<100?` / ${v(r)}%`:"";return`hwb(${t}deg ${e}% ${s}%${n})`}setAlpha(t){return typeof t!="number"?this:(this.a=Dt(t),this)}saturate(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=at(e,$t(s+t/100),r);return Object.assign(this,{r:n,g:i,b:a}),this}desaturate(t){return typeof t=="number"?this.saturate(-t):this}greyscale(){return this.saturate(-100)}lighten(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=at(e,s,$t(r+t/100));return Object.assign(this,{r:n,g:i,b:a}),this}darken(t){return typeof t=="number"?this.lighten(-t):this}spin(t){if(typeof t!="number")return this;const{h:e,s,l:r}=this.toHsl(),{r:n,g:i,b:a}=at($t((e*360+t)%360/360),s,r);return Object.assign(this,{r:n,g:i,b:a}),this}clone(){return new k(this)}toString(t){const{format:e}=this;return e==="hex"?this.toHexString(t):e==="hsl"?this.toHslString():e==="hwb"?this.toHwbString():this.toRgbString()}}class Vt{static Color=k;hue;hueSteps;lightSteps;saturation;colors;constructor(...t){let e=0,s=12,r=10,n=[.5],i=100;if(t.length===4)[e,s,r,i]=t;else if(t.length===3)[e,s,r]=t;else if(t.length===2&&([s,r]=t,[s,r].some(g=>g<1)))throw TypeError("ColorPalette: the two minimum arguments must be numbers higher than 0.");const a=[],l=360/s,c=k.roundPart((r-(r%2?1:0))/2),h=[.25,.2,.15,.11,.09,.075],b=[[1,2,3],[4,5],[6,7],[8,9],[10,11],[12,13]],u=b.find(g=>g.includes(r)),d=u?h[b.indexOf(u)]:100/(r+(r%2?0:1))/100;for(let g=1;g{const w=new k({h:p,s:1,l:f});a.push(i<100?w.saturate(i-100):w)})}this.hue=e,this.hueSteps=s,this.lightSteps=r,this.saturation=i,this.colors=a}}const Bt={pickerLabel:"Colour Picker",appearanceLabel:"Colour Appearance",valueLabel:"Colour Value",toggleLabel:"Select Colour",presetsLabel:"Colour Presets",defaultsLabel:"Colour Defaults",formatLabel:"Format",alphaLabel:"Alpha",hexLabel:"Hexadecimal",hueLabel:"Hue",whitenessLabel:"Whiteness",blacknessLabel:"Blackness",saturationLabel:"Saturation",lightnessLabel:"Lightness",redLabel:"Red",greenLabel:"Green",blueLabel:"Blue"},lt=["white","black","grey","red","orange","brown","gold","olive","yellow","lime","green","teal","cyan","blue","violet","magenta","pink"],xe=o=>{if(!B(o))return!1;try{JSON.parse(o)}catch{return!1}return!0},jt="v-hidden",ho=o=>{const{format:t,id:e,componentLabels:s}=o,r=x({tagName:"div",className:`color-form ${t}`});let n=["hex"];return t==="rgb"?n=["red","green","blue","alpha"]:t==="hsl"?n=["hue","saturation","lightness","alpha"]:t==="hwb"&&(n=["hue","whiteness","blackness","alpha"]),n.forEach(i=>{const[a]=t==="hex"?["#"]:te(i).split(""),l=`color_${t}_${i}_${e}`,c=s[`${i}Label`],h=x({tagName:"label"});m(h,"for",l),h.append(x({tagName:"span",ariaHidden:"true",innerText:`${a}:`}),x({tagName:"span",className:jt,innerText:c}));const b=x({tagName:"input",id:l,type:t==="hex"?"text":"number",value:i==="alpha"?"100":"0",className:`color-input ${i}`,autocomplete:"off",spellcheck:!1});let u="100",d="1";i!=="alpha"&&(t==="rgb"?(u="255",d="1"):i==="hue"&&(u="360",d="1")),I(b,{min:"0",max:u,step:d}),r.append(h,b)}),r},go=o=>{const{format:t,componentLabels:e}=o,{hueLabel:s,alphaLabel:r,lightnessLabel:n,saturationLabel:i,whitenessLabel:a,blacknessLabel:l}=e,c=t==="hsl"?360:100,h=t==="hsl"?100:360,b=100;let u=t==="hsl"?`${s} & ${n}`:`${n} & ${i}`;u=t==="hwb"?`${a} & ${l}`:u;const d=t==="hsl"?`${i}`:`${s}`,g=x({tagName:"div",className:`color-controls ${t}`}),p="color-pointer",f="color-slider";return[{i:1,c:p,l:u,min:0,max:c},{i:2,c:f,l:d,min:0,max:h},{i:3,c:f,l:r,min:0,max:b}].forEach($=>{const{i:P,c:H,l:S,min:C,max:R}=$,E=x({tagName:"div",className:"color-control",role:"presentation"});E.append(x({tagName:"div",className:`visual-control visual-control${P}`}));const N=x({tagName:"div",className:`${H} knob`,ariaLive:"polite",ariaLabel:S,role:"slider",tabIndex:0,ariaValueMin:`${C}`,ariaValueMax:`${R}`});E.append(N),g.append(E)}),g},Pe=(o,t,e)=>{const{input:s,format:r,componentLabels:n}=o,{defaultsLabel:i,presetsLabel:a}=n,l=e==="color-options",c=t instanceof Vt,h=l?a:i,b=c?t.colors:t,u=b.length,{lightSteps:d}=c?t:{lightSteps:null},g=d||[9,10].find(N=>u>=N*2&&!(u%N))||5,p=l&&u>g;let f=2;f=p&&u>g*2?3:f,f=p&&u>g*3?4:f,f=p&&u>g*4?5:f;const w=f-(u<=g*3?1:2),$=p&&u>w*g;let P=e;P+=$?" scrollable":"",P+=p?" multiline":"";const H=p?"1px":"0.25rem";let S=p?1.75:2;S=g>5&&p?1.5:S;const C=`${w*S}rem`,R=`calc(${f} * ${S}rem + ${f-1} * ${H})`,E=x({tagName:"ul",className:P,role:"listbox",ariaLabel:h});return $&&D(E,{"--grid-item-size":`${S}rem`,"--grid-fit":`${g}`,"--grid-gap":H,"--grid-height":C,"--grid-hover-height":R}),b.forEach(N=>{let[V,ct]=typeof N=="string"?N.trim().split(":"):[];N instanceof k&&(V=N.toHexString(),ct=V);const Ee=new k(N instanceof k?N:V,r).toString()===pt(s,"value"),Gt=x({tagName:"li",className:`color-option${Ee?" active":""}`,innerText:`${ct||V}`,tabIndex:0,role:"option",ariaSelected:Ee?"true":"false"});m(Gt,"data-value",`${V}`),l&&D(Gt,{backgroundColor:V}),E.append(Gt)}),E},uo=o=>{const{input:t,parent:e,format:s,id:r,componentLabels:n,colorKeywords:i,colorPresets:a}=o,l=pt(t,"value")||"#fff",{nonColors:c}=k,{toggleLabel:h,pickerLabel:b,formatLabel:u,hexLabel:d}=n,g=c.includes(l)?"#fff":l;o.color=new k(g,s);const p=s==="hex"?d:te(s),f=x({id:`picker-btn-${r}`,tagName:"button",type:"button",className:"picker-toggle btn-appearance",ariaExpanded:"false",ariaHasPopup:"true"});f.append(x({tagName:"span",className:jt,innerText:`${b}. ${u}: ${p}`}));const w=x({tagName:"div",className:"color-dropdown picker",role:"group",ariaLabelledBy:`picker-btn-${r}`}),$=go(o),P=ho(o);if(w.append($,P),t.before(f),e.append(w),i||a){const H=x({tagName:"div",className:"color-dropdown scrollable menu"});a&&H.append(Pe(o,a,"color-options")),i&&i.length&&H.append(Pe(o,i,"color-defaults"));const S=x({tagName:"button",type:"button",className:"menu-toggle btn-appearance",tabIndex:-1,ariaExpanded:"false",ariaHasPopup:"true"}),C=encodeURI("http://www.w3.org/2000/svg"),R=Nt(C,{tagName:"svg"});m(R,"xmlns",C),m(R,"viewBox","0 0 512 512"),m(R,Me,"true");const E=Nt(C,{tagName:"path"});m(E,"d","M98,158l157,156L411,158l27,27L255,368L71,185L98,158z"),m(E,"fill","#fff"),R.append(E),S.append(x({tagName:"span",className:jt,innerText:`${h}`}),R),e.append(S,H)}i&&c.includes(l)&&(o.value=l),m(t,W,"-1")},bo="2.0.0-alpha10",Y="color-picker",po=`[data-function="${Y}"]`,Se=`.${Y}`,fo={componentLabels:Bt,colorLabels:lt,format:"rgb",colorPresets:!1,colorKeywords:!1},{roundPart:y,nonColors:yt}=k,mo=o=>Ze(o,Y),vo=o=>new Ne(o),Ce=(o,t)=>{const e=t?Ct:Lt,{input:s,pickerToggle:r,menuToggle:n}=o;e(s,Oe,o.showPicker),e(r,St,o.togglePicker),n&&e(n,St,o.toggleMenu)},Le=(o,t)=>{const e=t?Ct:Lt,{input:s,colorMenu:r,parent:n}=o,i=F(s),a=no(i);e(o.controls,Ie,o.pointerDown),o.controlKnobs.forEach(l=>e(l,_t,o.handleKnobs)),e(a,Be,o.handleScroll),e(a,Ve,o.update),[s,...o.inputs].forEach(l=>e(l,Te,o.changeHandler)),r&&(e(r,St,o.menuClickHandler),e(r,_t,o.menuKeyHandler)),e(i,zt,o.pointerMove),e(i,Ke,o.pointerUp),e(n,De,o.handleFocusOut),e(i,Fe,o.handleDismiss)},Ae=o=>{Qe(o.input,new CustomEvent("colorpicker.change"))},He=o=>{o&&["bottom","top"].forEach(t=>O(o,t))},qt=(o,t)=>{const{colorPicker:e,colorMenu:s,menuToggle:r,pickerToggle:n,parent:i}=o,a=t===e,l=a?s:e,c=a?r:n,h=a?n:r;M(i,"open")||q(i,"open"),l&&(O(l,"show"),He(l)),q(t,"bottom"),so(t),q(t,"show"),a&&o.update(),o.isOpen||(Le(o,!0),o.updateDropdownPosition(),o.isOpen=!0,m(o.input,W,"0"),r&&m(r,W,"0")),m(h,xt,"true"),c&&m(c,xt,"false")};class Ne{static Color=k;static ColorPalette=Vt;static getInstance=mo;static init=vo;static selector=po;static roundPart=y;static setElementStyle=D;static setAttribute=m;static getBoundingClientRect=ft;static version=bo;static colorNames=lt;static colorPickerLabels=Bt;id;input;color;format="rgb";parent;dragElement;isOpen=!1;controlPositions;colorLabels=Qt(lt.map(t=>[t,t]));colorKeywords;colorPresets;componentLabels;pickerToggle;menuToggle;colorPicker;colorMenu;controls;inputs;controlKnobs;visuals;constructor(t,e){const s=z(t);if(typeof t>"u")throw new TypeError("ColorPicker target not specified.");if(B(t)&&!s)throw new TypeError(`ColorPicker target "${t}" cannot be found.`);this.input=s;const r=re(s,Se);if(!r)throw new TypeError("ColorPicker requires a specific markup to work.");this.parent=r,this.id=se(s,Y),this.dragElement=void 0,this.isOpen=!1,this.controlPositions={c1x:0,c1y:0,c2y:0,c3y:0},this.colorKeywords=!1,this.colorPresets=!1;const{format:n,componentLabels:i,colorLabels:a,colorKeywords:l,colorPresets:c}=oo(s,fo,e||{});let h=lt;Tt(a)&&a.length===17?h=a:B(a)&&a.split(",").length===17&&(h=a.split(",")),I(this.colorLabels,Qt(h.map((p,f)=>[lt[f],p])));const b=B(i)&&xe(i)?JSON.parse(i):i;if(this.componentLabels=I({...Bt},b),this.color=new k(s.value||"#fff",n),this.format=n,Tt(l)&&l.length?this.colorKeywords=l:B(l)&&l.length&&(this.colorKeywords=l.split(",").map(p=>p.trim())),Tt(c)&&c.length)this.colorPresets=c;else if(c&&xe(c)){const{hue:p,hueSteps:f,lightSteps:w,saturation:$}=JSON.parse(c);this.colorPresets=new Vt(p,f,w,$)}else B(c)&&(this.colorPresets=c.split(",").map(p=>p.trim()));uo(this);const[u,d]=rt("color-dropdown",r);this.pickerToggle=z(".picker-toggle",r),this.menuToggle=z(".menu-toggle",r),this.colorPicker=u,this.colorMenu=d,this.inputs=[...rt("color-input",r)];const[g]=rt("color-controls",r);this.controls=g,this.controlKnobs=[...rt("knob",g)],this.visuals=[...rt("visual-control",g)],this.update(),Ce(this,!0),st.set(s,Y,this)}get value(){return this.input.value}set value(t){this.input.value=t}get hasNonColor(){return this.colorKeywords instanceof Array&&this.colorKeywords.some(t=>yt.includes(t))}get hex(){return this.color.toHex(!0)}get hsv(){return this.color.toHsv()}get hsl(){return this.color.toHsl()}get hwb(){return this.color.toHwb()}get rgb(){return this.color.toRgb()}get brightness(){return this.color.brightness}get luminance(){return this.color.luminance}get isDark(){const{color:t,brightness:e}=this;return e<120&&t.a>.33}get isValid(){const t=this.input.value;return t!==""&&new k(t).isValid}get appearance(){const{colorLabels:t,hsl:e,hsv:s,format:r}=this,n=y(e.h*360),i=r==="hsl"?e.s:s.s,a=y(i*100),l=y(e.l*100),c=s.v*100;let h="black";if(l===100&&a===0)h=t.white;else if(l===0)h=t.black;else if(a===0)h=t.grey;else if(n<15||n>=345)h=t.red;else if(n>=15&&n<45)h=c>80&&a>80?t.orange:t.brown;else if(n>=45&&n<75){const b=n>46&&n<54&&c<80&&a>90,u=n>=54&&n<75&&c<80;h=b?t.gold:t.yellow,h=u?t.olive:h}else n>=75&&n<155?h=c<68?t.green:t.lime:n>=155&&n<175?h=t.teal:n>=175&&n<195?h=t.cyan:n>=195&&n<255?h=t.blue:n>=255&&n<270?h=t.violet:n>=270&&n<295?h=t.magenta:n>=295&&n<345&&(h=t.pink);return h}updateVisuals(){const{controlPositions:t,visuals:e}=this,[s,r,n]=e,{offsetHeight:i}=s,a=t.c2y/i,{r:l,g:c,b:h}=new k({h:a,s:1,l:.5}).toRgb(),b="linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)",u=1-t.c3y/i,d=y(u*100)/100,g=new k({h:a,s:1,l:.5,a:u}).toRgbString(),p=`linear-gradient( rgb(255,0,0) 0%, rgb(255,255,0) 16.67%, rgb(0,255,0) 33.33%, rgb(0,255,255) 50%, rgb(0,0,255) 66.67%, rgb(255,0,255) 83.33%, rgb(255,0,0) 100%)`;D(s,{background:`linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,${d}) 100%), linear-gradient(to right, rgba(255,255,255,${d}) 0%, ${g} 100%), - ${b}`}),D(r,{background:p}),D(n,{background:`linear-gradient(rgba(${l},${c},${h},1) 0%,rgba(${l},${c},${h},0) 100%)`})}handleFocusOut=({relatedTarget:t})=>{t&&!this.parent.contains(t)&&this.hide(!0)};handleDismiss=({code:t})=>{this.isOpen&&t===Ue&&this.hide()};handleScroll=t=>{const{activeElement:e}=F(this.input);this.updateDropdownPosition(),([Jt,ze].includes(t.type)&&this.dragElement||e&&this.controlKnobs.includes(e))&&(t.stopPropagation(),t.preventDefault())};menuKeyHandler=t=>{const{target:e,code:s}=t,{previousElementSibling:r,nextElementSibling:n,parentElement:i}=e,a=i&&M(i,"color-options"),l=i?[...i.children]:[],c=a&&Et(i,"grid-template-columns").split(" ").length,h=l.indexOf(e),b=h>-1&&c&&l[h-c],u=h>-1&&c&&l[h+c];[j,ot,Zt].includes(s)&&t.preventDefault(),a?b&&s===ot?U(b):u&&s===j?U(u):r&&s===gt?U(r):n&&s===G&&U(n):r&&[gt,ot].includes(s)?U(r):n&&[G,j].includes(s)&&U(n),[Ge,Zt].includes(s)&&this.menuClickHandler(t)};menuClickHandler=t=>{const{target:e}=t,{colorMenu:s}=this,r=(dt(e,"data-value")||"").trim();if(!r.length)return;const n=_("li.active",s);let i=r;i=xt.includes(i)?"white":i,i=i==="transparent"?"rgba(0,0,0,0)":i;const{r:a,g:l,b:c,a:h}=new k(i);I(this.color,{r:a,g:l,b:c,a:h}),this.update(),n!==e&&(n&&(O(n,"active"),At(n,Ct)),q(e,"active"),m(e,Ct,"true"),xt.includes(r)&&(this.value=r),Ne(this))};pointerDown=t=>{if(t.button!==0)return;const{target:e,pageX:s,pageY:r}=t,{colorMenu:n,visuals:i,controlKnobs:a}=this,[l,c,h]=i,[b,u,d]=a,g=a.includes(e)?e.previousElementSibling:e,p=mt(g),f=Mt(l),w=s-f.scrollLeft-p.left,$=r-f.scrollTop-p.top;if(e===l||e===b?(this.dragElement=g,this.changeControl1(w,$)):e===c||e===u?(this.dragElement=g,this.changeControl2($)):(e===h||e===d)&&(this.dragElement=g,this.changeAlpha($)),n){const P=_("li.active",n);P&&(O(P,"active"),At(P,Ct))}t.preventDefault()};pointerUp=({target:t})=>{const{parent:e}=this,s=F(e),r=_(`${Le}.open`,s)!==null,n=s.getSelection();!this.dragElement&&(!n||!n.toString().length)&&!e.contains(t)&&this.hide(r),this.dragElement=void 0};pointerMove=t=>{const{dragElement:e,visuals:s}=this,[r,n,i]=s,{pageX:a,pageY:l}=t;if(!e)return;const c=mt(e),h=Mt(r),b=a-h.scrollLeft-c.left,u=l-h.scrollTop-c.top;e===r&&this.changeControl1(b,u),e===n&&this.changeControl2(u),e===i&&this.changeAlpha(u)};handleKnobs=t=>{const{target:e,code:s}=t;if(![ot,j,gt,G].includes(s))return;t.preventDefault();const{controlKnobs:r,visuals:n}=this,{offsetWidth:i,offsetHeight:a}=n[0],[l,c,h]=r,{activeElement:b}=F(l),u=r.find(g=>g===b),d=a/360;if(u){let g=0,p=0;if(e===l){const f=i/100;[gt,G].includes(s)?this.controlPositions.c1x+=s===G?f:-f:[ot,j].includes(s)&&(this.controlPositions.c1y+=s===j?d:-d),g=this.controlPositions.c1x,p=this.controlPositions.c1y,this.changeControl1(g,p)}else e===c?(this.controlPositions.c2y+=[j,G].includes(s)?d:-d,p=this.controlPositions.c2y,this.changeControl2(p)):e===h&&(this.controlPositions.c3y+=[j,G].includes(s)?d:-d,p=this.controlPositions.c3y,this.changeAlpha(p));this.handleScroll(t)}};changeHandler=()=>{let t;const{inputs:e,format:s,value:r,input:n,controlPositions:i,visuals:a}=this,{activeElement:l}=F(n),{offsetHeight:c}=a[0],[h,,,b]=e,[u,d,g,p]=s==="rgb"?e.map($=>parseFloat($.value)/($===b?100:1)):e.map($=>parseFloat($.value)/($!==h?100:360)),f=this.hasNonColor&&xt.includes(r),w=b?p:1-i.c3y/c;if(l===n||l&&e.includes(l)){l===n?f?t=r==="transparent"?"rgba(0,0,0,0)":"rgb(0,0,0)":t=r:s==="hex"?t=h.value:s==="hsl"?t={h:u,s:d,l:g,a:w}:s==="hwb"?t={h:u,w:d,b:g,a:w}:t={r:u,g:d,b:g,a:w};const{r:$,g:P,b:H,a:S}=new k(t);I(this.color,{r:$,g:P,b:H,a:S}),this.setControlPositions(),this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals(),l===n&&f&&(this.value=r)}};changeControl1(t,e){let[s,r]=[0,0];const{controlPositions:n,visuals:i}=this,{offsetHeight:a,offsetWidth:l}=i[0];t>l?s=l:t>=0&&(s=t),e>a?r=a:e>=0&&(r=e);const c=n.c2y/a,h=s/l,b=1-r/a,u=1-n.c3y/a,{r:d,g,b:p,a:f}=new k({h:c,s:h,v:b,a:u});I(this.color,{r:d,g,b:p,a:f}),this.controlPositions.c1x=s,this.controlPositions.c1y=r,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}changeControl2(t){const{controlPositions:e,visuals:s}=this,{offsetHeight:r,offsetWidth:n}=s[0];let i=0;t>r?i=r:t>=0&&(i=t);const a=i/r,l=e.c1x/n,c=1-e.c1y/r,h=1-e.c3y/r,{r:b,g:u,b:d,a:g}=new k({h:a,s:l,v:c,a:h});I(this.color,{r:b,g:u,b:d,a:g}),this.controlPositions.c2y=i,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}changeAlpha(t){const{visuals:e}=this,{offsetHeight:s}=e[0];let r=0;t>s?r=s:t>=0&&(r=t);const n=1-r/s;this.color.setAlpha(n),this.controlPositions.c3y=r,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}update=()=>{this.updateDropdownPosition(),this.updateAppearance(),this.setControlPositions(),this.updateInputs(!0),this.updateControls(),this.updateVisuals()};updateDropdownPosition(){const{input:t,colorPicker:e,colorMenu:s}=this,r=mt(t),{top:n,bottom:i}=r,{offsetHeight:a}=t,l=Mt(t).clientHeight,h=M(e,"show")?e:s;if(!h)return;const{offsetHeight:b}=h,u=l-i,d=n,g=n+b+a>l,p=n-b<0;(M(h,"bottom")||!p)&&u{t&&t.preventDefault();const{colorPicker:e}=this;this.isOpen&&M(e,"show")?this.hide(!0):qt(this,e)};showPicker=()=>{const{colorPicker:t}=this;["top","bottom"].some(e=>M(t,e))||qt(this,t)};toggleMenu=t=>{t&&t.preventDefault();const{colorMenu:e}=this;this.isOpen&&M(e,"show")?this.hide(!0):qt(this,e)};hide(t){if(this.isOpen){const{pickerToggle:e,menuToggle:s,colorPicker:r,colorMenu:n,parent:i,input:a}=this,l=M(r,"show"),c=l?r:n,h=l?e:s,b=c&&ro(c);this.value=this.color.toString(!0),c&&(O(c,"show"),m(h,St,"false"),setTimeout(()=>{Ee(c),_(".show",i)||(O(i,"open"),He(this),this.isOpen=!1)},b)),t||U(e),m(a,J,"-1"),h===s&&m(s,J,"-1")}}dispose(){const{input:t,parent:e}=this;this.hide(!0),Ae(this),[...e.children].forEach(s=>{s!==t&&s.remove()}),At(t,J),D(t,{backgroundColor:""}),["txt-light","txt-dark"].forEach(s=>O(e,s)),rt.remove(t,Q)}}return Me}(); + ${b}`}),D(r,{background:p}),D(n,{background:`linear-gradient(rgba(${l},${c},${h},1) 0%,rgba(${l},${c},${h},0) 100%)`})}handleFocusOut=({relatedTarget:t})=>{t&&!this.parent.contains(t)&&this.hide(!0)};handleDismiss=({code:t})=>{this.isOpen&&t===Ge&&this.hide()};handleScroll=t=>{const{activeElement:e}=F(this.input);this.updateDropdownPosition(),([zt,je].includes(t.type)&&this.dragElement||e&&this.controlKnobs.includes(e))&&(t.stopPropagation(),t.preventDefault())};menuKeyHandler=t=>{const{target:e,code:s}=t,{previousElementSibling:r,nextElementSibling:n,parentElement:i}=e,a=i&&M(i,"color-options"),l=i?[...i.children]:[],c=a&&Et(i,"grid-template-columns").split(" ").length,h=l.indexOf(e),b=h>-1&&c&&l[h-c],u=h>-1&&c&&l[h+c];[j,et,Wt].includes(s)&&t.preventDefault(),a?b&&s===et?_(b):u&&s===j?_(u):r&&s===ht?_(r):n&&s===U&&_(n):r&&[ht,et].includes(s)?_(r):n&&[U,j].includes(s)&&_(n),[qe,Wt].includes(s)&&this.menuClickHandler(t)};menuClickHandler=t=>{const{target:e}=t,{colorMenu:s}=this,r=(pt(e,"data-value")||"").trim();if(!r.length)return;const n=z("li.active",s);let i=r;i=yt.includes(i)?"white":i,i=i==="transparent"?"rgba(0,0,0,0)":i;const{r:a,g:l,b:c,a:h}=new k(i);I(this.color,{r:a,g:l,b:c,a:h}),this.update(),n!==e&&(n&&(O(n,"active"),At(n,Pt)),q(e,"active"),m(e,Pt,"true"),yt.includes(r)&&(this.value=r),Ae(this))};pointerDown=t=>{if(t.button!==0)return;const{target:e,pageX:s,pageY:r}=t,{colorMenu:n,visuals:i,controlKnobs:a}=this,[l,c,h]=i,[b,u,d]=a,g=a.includes(e)?e.previousElementSibling:e,p=ft(g),f=Mt(l),w=s-f.scrollLeft-p.left,$=r-f.scrollTop-p.top;if(e===l||e===b?(this.dragElement=g,this.changeControl1(w,$)):e===c||e===u?(this.dragElement=g,this.changeControl2($)):(e===h||e===d)&&(this.dragElement=g,this.changeAlpha($)),n){const P=z("li.active",n);P&&(O(P,"active"),At(P,Pt))}t.preventDefault()};pointerUp=({target:t})=>{const{parent:e}=this,s=F(e),r=z(`${Se}.open`,s)!==null,n=s.getSelection();!this.dragElement&&(!n||!n.toString().length)&&!e.contains(t)&&this.hide(r),this.dragElement=void 0};pointerMove=t=>{const{dragElement:e,visuals:s}=this,[r,n,i]=s,{pageX:a,pageY:l}=t;if(!e)return;const c=ft(e),h=Mt(r),b=a-h.scrollLeft-c.left,u=l-h.scrollTop-c.top;e===r&&this.changeControl1(b,u),e===n&&this.changeControl2(u),e===i&&this.changeAlpha(u)};handleKnobs=t=>{const{target:e,code:s}=t;if(![et,j,ht,U].includes(s))return;t.preventDefault();const{controlKnobs:r,visuals:n}=this,{offsetWidth:i,offsetHeight:a}=n[0],[l,c,h]=r,{activeElement:b}=F(l),u=r.find(g=>g===b),d=a/360;if(u){let g=0,p=0;if(e===l){const f=i/100;[ht,U].includes(s)?this.controlPositions.c1x+=s===U?f:-f:[et,j].includes(s)&&(this.controlPositions.c1y+=s===j?d:-d),g=this.controlPositions.c1x,p=this.controlPositions.c1y,this.changeControl1(g,p)}else e===c?(this.controlPositions.c2y+=[j,U].includes(s)?d:-d,p=this.controlPositions.c2y,this.changeControl2(p)):e===h&&(this.controlPositions.c3y+=[j,U].includes(s)?d:-d,p=this.controlPositions.c3y,this.changeAlpha(p));this.handleScroll(t)}};changeHandler=()=>{let t;const{inputs:e,format:s,value:r,input:n,controlPositions:i,visuals:a}=this,{activeElement:l}=F(n),{offsetHeight:c}=a[0],[h,,,b]=e,[u,d,g,p]=s==="rgb"?e.map($=>parseFloat($.value)/($===b?100:1)):e.map($=>parseFloat($.value)/($!==h?100:360)),f=this.hasNonColor&&yt.includes(r),w=b?p:1-i.c3y/c;if(l===n||l&&e.includes(l)){l===n?f?t=r==="transparent"?"rgba(0,0,0,0)":"rgb(0,0,0)":t=r:s==="hex"?t=h.value:s==="hsl"?t={h:u,s:d,l:g,a:w}:s==="hwb"?t={h:u,w:d,b:g,a:w}:t={r:u,g:d,b:g,a:w};const{r:$,g:P,b:H,a:S}=new k(t);I(this.color,{r:$,g:P,b:H,a:S}),this.setControlPositions(),this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals(),l===n&&f&&(this.value=r)}};changeControl1(t,e){let[s,r]=[0,0];const{controlPositions:n,visuals:i}=this,{offsetHeight:a,offsetWidth:l}=i[0];t>l?s=l:t>=0&&(s=t),e>a?r=a:e>=0&&(r=e);const c=n.c2y/a,h=s/l,b=1-r/a,u=1-n.c3y/a,{r:d,g,b:p,a:f}=new k({h:c,s:h,v:b,a:u});I(this.color,{r:d,g,b:p,a:f}),this.controlPositions.c1x=s,this.controlPositions.c1y=r,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}changeControl2(t){const{controlPositions:e,visuals:s}=this,{offsetHeight:r,offsetWidth:n}=s[0];let i=0;t>r?i=r:t>=0&&(i=t);const a=i/r,l=e.c1x/n,c=1-e.c1y/r,h=1-e.c3y/r,{r:b,g:u,b:d,a:g}=new k({h:a,s:l,v:c,a:h});I(this.color,{r:b,g:u,b:d,a:g}),this.controlPositions.c2y=i,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}changeAlpha(t){const{visuals:e}=this,{offsetHeight:s}=e[0];let r=0;t>s?r=s:t>=0&&(r=t);const n=1-r/s;this.color.setAlpha(n),this.controlPositions.c3y=r,this.updateAppearance(),this.updateInputs(),this.updateControls(),this.updateVisuals()}update=()=>{this.updateDropdownPosition(),this.updateAppearance(),this.setControlPositions(),this.updateInputs(!0),this.updateControls(),this.updateVisuals()};updateDropdownPosition(){const{input:t,colorPicker:e,colorMenu:s}=this,r=ft(t),{top:n,bottom:i}=r,{offsetHeight:a}=t,l=Mt(t).clientHeight,h=M(e,"show")?e:s;if(!h)return;const{offsetHeight:b}=h,u=l-i,d=n,g=n+b+a>l,p=n-b<0;(M(h,"bottom")||!p)&&u{t&&t.preventDefault();const{colorPicker:e}=this;this.isOpen&&M(e,"show")?this.hide(!0):qt(this,e)};showPicker=()=>{const{colorPicker:t}=this;["top","bottom"].some(e=>M(t,e))||qt(this,t)};toggleMenu=t=>{t&&t.preventDefault();const{colorMenu:e}=this;this.isOpen&&M(e,"show")?this.hide(!0):qt(this,e)};hide(t){if(this.isOpen){const{pickerToggle:e,menuToggle:s,colorPicker:r,colorMenu:n,parent:i,input:a}=this,l=M(r,"show"),c=l?r:n,h=l?e:s,b=c&&to(c);this.value=this.color.toString(!0),c&&(O(c,"show"),m(h,xt,"false"),setTimeout(()=>{He(c),z(".show",i)||(O(i,"open"),Le(this),this.isOpen=!1)},b)),t||_(e),m(a,W,"-1"),h===s&&m(s,W,"-1")}}dispose(){const{input:t,parent:e}=this;this.hide(!0),Ce(this),[...e.children].forEach(s=>{s!==t&&s.remove()}),At(t,W),D(t,{backgroundColor:""}),["txt-light","txt-dark"].forEach(s=>O(e,s)),st.remove(t,Y)}}return Ne}(); //# sourceMappingURL=color-picker.js.map diff --git a/docs/js/color-picker.js.map b/docs/js/color-picker.js.map index 81c28f1..e1f63c3 100644 --- a/docs/js/color-picker.js.map +++ b/docs/js/color-picker.js.map @@ -1 +1 @@ -{"version":3,"file":"color-picker.js","sources":["../../node_modules/.pnpm/@thednp+event-listener@2.0.2/node_modules/@thednp/event-listener/dist/event-listener.mjs","../../node_modules/.pnpm/@thednp+shorty@2.0.0-alpha17/node_modules/@thednp/shorty/dist/shorty.mjs","../../node_modules/.pnpm/@thednp+color@1.0.8/node_modules/@thednp/color/dist/index.mjs","../../src/ts/colorPalette.ts","../../src/ts/util/colorPickerLabels.ts","../../src/ts/util/colorNames.ts","../../src/ts/util/isValidJSON.ts","../../src/ts/util/vHidden.ts","../../src/ts/util/getColorForm.ts","../../src/ts/util/getColorControls.ts","../../src/ts/util/getColorMenu.ts","../../src/ts/util/setMarkup.ts","../../src/ts/index.ts"],"sourcesContent":["const e = {}, f = (t) => {\n const { type: c, currentTarget: i } = t;\n [...e[c]].forEach(([n, s]) => {\n i === n && [...s].forEach(([o, a]) => {\n o.apply(n, [t]), typeof a == \"object\" && a.once && r(n, c, o, a);\n });\n });\n}, E = (t, c, i, n) => {\n e[c] || (e[c] = /* @__PURE__ */ new Map());\n const s = e[c];\n s.has(t) || s.set(t, /* @__PURE__ */ new Map());\n const o = s.get(t), { size: a } = o;\n o.set(i, n), a || t.addEventListener(c, f, n);\n}, r = (t, c, i, n) => {\n const s = e[c], o = s && s.get(t), a = o && o.get(i), d = a !== void 0 ? a : n;\n o && o.has(i) && o.delete(i), s && (!o || !o.size) && s.delete(t), (!s || !s.size) && delete e[c], (!o || !o.size) && t.removeEventListener(c, f, d);\n}, g = E, M = r;\nexport {\n E as addListener,\n f as globalListener,\n M as off,\n g as on,\n e as registry,\n r as removeListener\n};\n//# sourceMappingURL=event-listener.mjs.map\n","const pe = \"aria-checked\", me = \"aria-description\", fe = \"aria-describedby\", ge = \"aria-expanded\", ve = \"aria-haspopup\", Ee = \"aria-hidden\", be = \"aria-label\", he = \"aria-labelledby\", ye = \"aria-modal\", we = \"aria-pressed\", Ae = \"aria-selected\", Se = \"aria-valuemin\", Me = \"aria-valuemax\", Ne = \"aria-valuenow\", ke = \"aria-valuetext\", q = \"abort\", G = \"beforeunload\", J = \"blur\", K = \"change\", X = \"contextmenu\", P = \"DOMContentLoaded\", Y = \"DOMMouseScroll\", Z = \"error\", $ = \"focus\", _ = \"focusin\", tt = \"focusout\", et = \"gesturechange\", nt = \"gestureend\", ot = \"gesturestart\", st = \"keydown\", ct = \"keypress\", rt = \"keyup\", at = \"load\", it = \"click\", ut = \"dblclick\", lt = \"mousedown\", dt = \"mouseup\", pt = \"hover\", mt = \"mouseenter\", ft = \"mouseleave\", gt = \"mousein\", vt = \"mouseout\", Et = \"mouseover\", bt = \"mousemove\", ht = \"mousewheel\", yt = \"move\", wt = \"orientationchange\", At = \"pointercancel\", St = \"pointerdown\", Mt = \"pointerleave\", Nt = \"pointermove\", kt = \"pointerup\", Tt = \"readystatechange\", Dt = \"reset\", Ct = \"resize\", Ot = \"select\", Lt = \"selectend\", It = \"selectstart\", zt = \"scroll\", xt = \"submit\", Vt = \"touchstart\", Bt = \"touchmove\", Ht = \"touchcancel\", Pt = \"touchend\", Ft = \"unload\", Te = {\n DOMContentLoaded: P,\n DOMMouseScroll: Y,\n abort: q,\n beforeunload: G,\n blur: J,\n change: K,\n click: it,\n contextmenu: X,\n dblclick: ut,\n error: Z,\n focus: $,\n focusin: _,\n focusout: tt,\n gesturechange: et,\n gestureend: nt,\n gesturestart: ot,\n hover: pt,\n keydown: st,\n keypress: ct,\n keyup: rt,\n load: at,\n mousedown: lt,\n mousemove: bt,\n mousein: gt,\n mouseout: vt,\n mouseenter: mt,\n mouseleave: ft,\n mouseover: Et,\n mouseup: dt,\n mousewheel: ht,\n move: yt,\n orientationchange: wt,\n pointercancel: At,\n pointerdown: St,\n pointerleave: Mt,\n pointermove: Nt,\n pointerup: kt,\n readystatechange: Tt,\n reset: Dt,\n resize: Ct,\n scroll: zt,\n select: Ot,\n selectend: Lt,\n selectstart: It,\n submit: xt,\n touchcancel: Ht,\n touchend: Pt,\n touchmove: Bt,\n touchstart: Vt,\n unload: Ft\n}, De = \"drag\", Ce = \"dragstart\", Oe = \"dragenter\", Le = \"dragleave\", Ie = \"dragover\", ze = \"dragend\", xe = \"loadstart\", Ve = {\n start: \"mousedown\",\n end: \"mouseup\",\n move: \"mousemove\",\n cancel: \"mouseleave\"\n}, Be = { down: \"mousedown\", up: \"mouseup\" }, He = \"onmouseleave\" in document ? [\"mouseenter\", \"mouseleave\"] : (\n /* istanbul ignore next */\n [\"mouseover\", \"mouseout\"]\n), Pe = {\n start: \"touchstart\",\n end: \"touchend\",\n move: \"touchmove\",\n cancel: \"touchcancel\"\n}, Fe = { in: \"focusin\", out: \"focusout\" }, Ue = {\n Backspace: \"Backspace\",\n // 8\n Tab: \"Tab\",\n // 9\n Enter: \"Enter\",\n // 13\n Shift: \"Shift\",\n // 16\n Control: \"Control\",\n // 17\n Alt: \"Alt\",\n // 18\n Pause: \"Pause\",\n // 19\n CapsLock: \"CapsLock\",\n // 20\n Escape: \"Escape\",\n // 27\n Scape: \"Space\",\n // 32\n ArrowLeft: \"ArrowLeft\",\n // 37\n ArrowUp: \"ArrowUp\",\n // 38\n ArrowRight: \"ArrowRight\",\n // 39\n ArrowDown: \"ArrowDown\",\n // 40\n Insert: \"Insert\",\n // 45\n Delete: \"Delete\",\n // 46\n Meta: \"Meta\",\n // 91 windows key\n ContextMenu: \"ContextMenu\",\n // 93\n ScrollLock: \"ScrollLock\"\n // 145\n}, We = \"Alt\", Re = \"ArrowDown\", Qe = \"ArrowUp\", je = \"ArrowLeft\", qe = \"ArrowRight\", Ge = \"Backspace\", Je = \"CapsLock\", Ke = \"Control\", Xe = \"Delete\", Ye = \"Enter\", Ze = \"Escape\", $e = \"Insert\", _e = \"Meta\", tn = \"Pause\", en = \"ScrollLock\", nn = \"Shift\", on = \"Space\", sn = \"Tab\", Ut = \"animationDuration\", Wt = \"animationDelay\", F = \"animationName\", D = \"animationend\", Rt = \"transitionDuration\", Qt = \"transitionDelay\", C = \"transitionend\", U = \"transitionProperty\", cn = \"addEventListener\", rn = \"removeEventListener\", an = {\n linear: \"linear\",\n easingSinusoidalIn: \"cubic-bezier(0.47,0,0.745,0.715)\",\n easingSinusoidalOut: \"cubic-bezier(0.39,0.575,0.565,1)\",\n easingSinusoidalInOut: \"cubic-bezier(0.445,0.05,0.55,0.95)\",\n easingQuadraticIn: \"cubic-bezier(0.550,0.085,0.680,0.530)\",\n easingQuadraticOut: \"cubic-bezier(0.250,0.460,0.450,0.940)\",\n easingQuadraticInOut: \"cubic-bezier(0.455,0.030,0.515,0.955)\",\n easingCubicIn: \"cubic-bezier(0.55,0.055,0.675,0.19)\",\n easingCubicOut: \"cubic-bezier(0.215,0.61,0.355,1)\",\n easingCubicInOut: \"cubic-bezier(0.645,0.045,0.355,1)\",\n easingQuarticIn: \"cubic-bezier(0.895,0.03,0.685,0.22)\",\n easingQuarticOut: \"cubic-bezier(0.165,0.84,0.44,1)\",\n easingQuarticInOut: \"cubic-bezier(0.77,0,0.175,1)\",\n easingQuinticIn: \"cubic-bezier(0.755,0.05,0.855,0.06)\",\n easingQuinticOut: \"cubic-bezier(0.23,1,0.32,1)\",\n easingQuinticInOut: \"cubic-bezier(0.86,0,0.07,1)\",\n easingExponentialIn: \"cubic-bezier(0.95,0.05,0.795,0.035)\",\n easingExponentialOut: \"cubic-bezier(0.19,1,0.22,1)\",\n easingExponentialInOut: \"cubic-bezier(1,0,0,1)\",\n easingCircularIn: \"cubic-bezier(0.6,0.04,0.98,0.335)\",\n easingCircularOut: \"cubic-bezier(0.075,0.82,0.165,1)\",\n easingCircularInOut: \"cubic-bezier(0.785,0.135,0.15,0.86)\",\n easingBackIn: \"cubic-bezier(0.6,-0.28,0.735,0.045)\",\n easingBackOut: \"cubic-bezier(0.175,0.885,0.32,1.275)\",\n easingBackInOut: \"cubic-bezier(0.68,-0.55,0.265,1.55)\"\n}, un = \"offsetHeight\", ln = \"offsetWidth\", dn = \"scrollHeight\", pn = \"scrollWidth\", mn = \"tabindex\", jt = navigator.userAgentData, A = jt, { userAgent: qt } = navigator, S = qt, z = /iPhone|iPad|iPod|Android/i;\nlet O = !1;\nA ? O = A.brands.some((t) => z.test(t.brand)) : O = z.test(S);\nconst fn = O, x = /(iPhone|iPod|iPad)/, gn = A ? A.brands.some((t) => x.test(t.brand)) : (\n /* istanbul ignore next */\n x.test(S)\n), vn = S ? S.includes(\"Firefox\") : (\n /* istanbul ignore next */\n !1\n), { head: M } = document, En = [\"webkitPerspective\", \"perspective\"].some((t) => t in M.style), Gt = (t, e, n, o) => {\n const s = o || !1;\n t.addEventListener(e, n, s);\n}, Jt = (t, e, n, o) => {\n const s = o || !1;\n t.removeEventListener(e, n, s);\n}, Kt = (t, e, n, o) => {\n const s = (r) => {\n (r.target === t || r.currentTarget === t) && (n.apply(t, [r]), Jt(t, e, s, o));\n };\n Gt(t, e, s, o);\n}, Xt = () => {\n}, bn = (() => {\n let t = !1;\n try {\n const e = Object.defineProperty({}, \"passive\", {\n get: () => (t = !0, t)\n });\n Kt(document, P, Xt, e);\n } catch {\n }\n return t;\n})(), hn = [\"webkitTransform\", \"transform\"].some((t) => t in M.style), yn = \"ontouchstart\" in window || /* istanbul ignore next */\n\"msMaxTouchPoints\" in navigator, wn = [\"webkitAnimation\", \"animation\"].some((t) => t in M.style), An = [\"webkitTransition\", \"transition\"].some((t) => t in M.style), Yt = (t, e) => t.getAttribute(e), Sn = (t, e, n) => e.getAttributeNS(t, n), Mn = (t, e) => t.hasAttribute(e), Nn = (t, e, n) => e.hasAttributeNS(t, n), kn = (t, e, n) => t.setAttribute(e, n), Tn = (t, e, n, o) => e.setAttributeNS(t, n, o), Dn = (t, e) => t.removeAttribute(e), Cn = (t, e, n) => e.removeAttributeNS(t, n), On = (t, ...e) => {\n t.classList.add(...e);\n}, Ln = (t, ...e) => {\n t.classList.remove(...e);\n}, In = (t, e) => t.classList.contains(e), { body: zn } = document, { documentElement: xn } = document, Vn = (t) => Array.from(t), v = (t) => t != null && typeof t == \"object\" || !1, i = (t) => v(t) && typeof t.nodeType == \"number\" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some((e) => t.nodeType === e) || !1, u = (t) => i(t) && t.nodeType === 1 || !1, E = /* @__PURE__ */ new Map(), L = {\n data: E,\n /**\n * Sets web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @param instance the component instance\n */\n set: (t, e, n) => {\n if (!u(t))\n return;\n E.has(e) || E.set(e, /* @__PURE__ */ new Map()), E.get(e).set(t, n);\n },\n /**\n * Returns all instances for specified component.\n *\n * @param component the component's name or a unique key\n * @returns all the component instances\n */\n getAllFor: (t) => E.get(t) || null,\n /**\n * Returns the instance associated with the target.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @returns the instance\n */\n get: (t, e) => {\n if (!u(t) || !e)\n return null;\n const n = L.getAllFor(e);\n return t && n && n.get(t) || null;\n },\n /**\n * Removes web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n */\n remove: (t, e) => {\n const n = L.getAllFor(e);\n !n || !u(t) || (n.delete(t), n.size === 0 && E.delete(e));\n }\n}, Bn = (t, e) => L.get(t, e), N = (t) => typeof t == \"string\" || !1, W = (t) => v(t) && t.constructor.name === \"Window\" || !1, R = (t) => i(t) && t.nodeType === 9 || !1, d = (t) => W(t) ? t.document : R(t) ? t : i(t) ? t.ownerDocument : window.document, k = (t, ...e) => Object.assign(t, ...e), Zt = (t) => {\n if (!t)\n return;\n if (N(t))\n return d().createElement(t);\n const { tagName: e } = t, n = Zt(e);\n if (!n)\n return;\n const o = { ...t };\n return delete o.tagName, k(n, o);\n}, $t = (t, e) => {\n if (!t || !e)\n return;\n if (N(e))\n return d().createElementNS(t, e);\n const { tagName: n } = e, o = $t(t, n);\n if (!o)\n return;\n const s = { ...e };\n return delete s.tagName, k(o, s);\n}, Q = (t, e) => t.dispatchEvent(e), Hn = (t, e, n) => n.indexOf(t) === e, g = (t, e) => {\n const n = getComputedStyle(t), o = e.replace(\"webkit\", \"Webkit\").replace(/([A-Z])/g, \"-$1\").toLowerCase();\n return n.getPropertyValue(o);\n}, _t = (t) => {\n const e = g(t, F), n = g(t, Wt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, te = (t) => {\n const e = g(t, F), n = g(t, Ut), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Pn = (t, e) => {\n let n = 0;\n const o = new Event(D), s = te(t), r = _t(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(D, a), n = 1);\n };\n t.addEventListener(D, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, ee = (t) => {\n const e = g(t, U), n = g(t, Qt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, ne = (t) => {\n const e = g(t, U), n = g(t, Rt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Fn = (t, e) => {\n let n = 0;\n const o = new Event(C), s = ne(t), r = ee(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(C, a), n = 1);\n };\n t.addEventListener(C, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, Un = (t) => Float32Array.from(Array.from(t)), Wn = (t) => Float64Array.from(Array.from(t)), Rn = (t, e) => t.focus(e), V = (t) => [\"true\", !0].includes(t) ? !0 : [\"false\", !1].includes(t) ? !1 : [\"null\", \"\", null, void 0].includes(t) ? null : t !== \"\" && !Number.isNaN(+t) ? +t : t, w = (t) => Object.entries(t), oe = (t) => t.toLowerCase(), Qn = (t, e, n, o) => {\n const s = { ...n }, r = { ...t.dataset }, a = { ...e }, l = {}, p = \"title\";\n return w(r).forEach(([c, m]) => {\n const y = o && typeof c == \"string\" && c.includes(o) ? c.replace(o, \"\").replace(/[A-Z]/g, (j) => oe(j)) : c;\n l[y] = V(m);\n }), w(s).forEach(([c, m]) => {\n s[c] = V(m);\n }), w(e).forEach(([c, m]) => {\n c in s ? a[c] = s[c] : c in l ? a[c] = l[c] : a[c] = c === p ? Yt(t, p) : m;\n }), a;\n}, jn = (t, e) => v(t) && (Object.hasOwn(t, e) || e in t), qn = (t) => Object.keys(t), Gn = (t) => Object.values(t), Jn = (t) => Object.fromEntries(t), Kn = (t, e) => {\n const n = new CustomEvent(t, {\n cancelable: !0,\n bubbles: !0\n });\n return v(e) && k(n, e), n;\n}, Xn = { passive: !0 }, Yn = (t) => t.offsetHeight, Zn = (t, e) => {\n w(e).forEach(([n, o]) => {\n if (o && N(n) && n.includes(\"--\"))\n t.style.setProperty(n, o);\n else {\n const s = {};\n s[n] = o, k(t.style, s);\n }\n });\n}, I = (t) => v(t) && t.constructor.name === \"Map\" || !1, se = (t) => typeof t == \"number\" || !1, f = /* @__PURE__ */ new Map(), $n = {\n /**\n * Sets a new timeout timer for an element, or element -> key association.\n *\n * @param element target element\n * @param callback the callback\n * @param delay the execution delay\n * @param key a unique key\n */\n set: (t, e, n, o) => {\n u(t) && (o && o.length ? (f.has(t) || f.set(t, /* @__PURE__ */ new Map()), f.get(t).set(o, setTimeout(e, n))) : f.set(t, setTimeout(e, n)));\n },\n /**\n * Returns the timer associated with the target.\n *\n * @param element target element\n * @param key a unique\n * @returns the timer\n */\n get: (t, e) => {\n if (!u(t))\n return null;\n const n = f.get(t);\n return e && n && I(n) ? n.get(e) || /* istanbul ignore next */\n null : se(n) ? n : null;\n },\n /**\n * Clears the element's timer.\n *\n * @param element target element\n * @param key a unique key\n */\n clear: (t, e) => {\n if (!u(t))\n return;\n const n = f.get(t);\n e && e.length && I(n) ? (clearTimeout(n.get(e)), n.delete(e), n.size === 0 && f.delete(t)) : (clearTimeout(n), f.delete(t));\n }\n}, _n = (t) => t.toUpperCase(), h = (t, e) => {\n const { width: n, height: o, top: s, right: r, bottom: a, left: l } = t.getBoundingClientRect();\n let p = 1, c = 1;\n if (e && u(t)) {\n const { offsetWidth: m, offsetHeight: y } = t;\n p = m > 0 ? Math.round(n) / m : (\n /* istanbul ignore next */\n 1\n ), c = y > 0 ? Math.round(o) / y : (\n /* istanbul ignore next */\n 1\n );\n }\n return {\n width: n / p,\n height: o / c,\n top: s / c,\n right: r / p,\n bottom: a / c,\n left: l / p,\n x: l / p,\n y: s / c\n };\n}, to = (t) => d(t).body, T = (t) => d(t).documentElement, eo = (t) => d(t).head, no = (t) => {\n const e = W(t), n = e ? t.scrollX : t.scrollLeft, o = e ? t.scrollY : t.scrollTop;\n return { x: n, y: o };\n}, ce = (t) => i(t) && t.constructor.name === \"ShadowRoot\" || !1, oo = (t) => t.nodeName === \"HTML\" ? t : u(t) && t.assignedSlot || // step into the shadow DOM of the parent of a slotted node\ni(t) && t.parentNode || // DOM Element detected\nce(t) && t.host || // ShadowRoot detected\nT(t), re = (t) => {\n if (!u(t))\n return !1;\n const { width: e, height: n } = h(t), { offsetWidth: o, offsetHeight: s } = t;\n return Math.round(e) !== o || Math.round(n) !== s;\n}, so = (t, e, n) => {\n const o = u(e), s = h(t, o && re(e)), r = { x: 0, y: 0 };\n if (o) {\n const a = h(e, !0);\n r.x = a.x + e.clientLeft, r.y = a.y + e.clientTop;\n }\n return {\n x: s.left + n.x - r.x,\n y: s.top + n.y - r.y,\n width: s.width,\n height: s.height\n };\n};\nlet B = 0, H = 0;\nconst b = /* @__PURE__ */ new Map(), ae = (t, e) => {\n let n = e ? B : H;\n if (e) {\n const o = ae(t), s = b.get(o) || /* @__PURE__ */ new Map();\n b.has(o) || b.set(o, s), I(s) && !s.has(e) ? (s.set(e, n), B += 1) : n = s.get(e);\n } else {\n const o = t.id || t;\n b.has(o) ? n = b.get(o) : (b.set(o, n), H += 1);\n }\n return n;\n}, co = (t) => {\n var e;\n return t ? R(t) ? t.defaultView : i(t) ? (e = t == null ? void 0 : t.ownerDocument) == null ? void 0 : e.defaultView : t : window;\n}, ie = (t) => Array.isArray(t) || !1, ro = (t) => i(t) && t.nodeName === \"CANVAS\" || !1, ue = (t) => u(t) && !!t.shadowRoot || !1, ao = (t) => i(t) && [1, 2, 3, 4, 5, 6, 7, 8].some((e) => t.nodeType === e) || !1, io = (t) => {\n if (!i(t))\n return !1;\n const { top: e, bottom: n } = h(t), { clientHeight: o } = T(t);\n return e <= o && n >= 0;\n}, uo = (t) => {\n if (!i(t))\n return !1;\n const { clientWidth: e, clientHeight: n } = T(t), { top: o, left: s, bottom: r, right: a } = h(t, !0);\n return o >= 0 && s >= 0 && r <= n && a <= e;\n}, lo = (t) => ie(t) && t.every(u) || !1, po = (t) => typeof t == \"function\" || !1, mo = (t) => v(t) && t.constructor.name === \"HTMLCollection\" || !1, fo = (t) => u(t) && t.tagName === \"IMG\" || !1, go = (t) => {\n if (!N(t))\n return !1;\n try {\n JSON.parse(t);\n } catch {\n return !1;\n }\n return !0;\n}, vo = (t) => v(t) && t.constructor.name === \"WeakMap\" || !1, Eo = (t) => i(t) && [\"SVG\", \"Image\", \"Video\", \"Canvas\"].some((e) => t.constructor.name.includes(e)) || !1, bo = (t) => v(t) && t.constructor.name === \"NodeList\" || !1, ho = (t) => T(t).dir === \"rtl\", yo = (t) => i(t) && t.constructor.name.includes(\"SVG\") || !1, wo = (t) => i(t) && [\"TABLE\", \"TD\", \"TH\"].includes(t.nodeName) || !1, le = (t, e) => t ? t.closest(e) || // break out of `ShadowRoot`\nle(t.getRootNode().host, e) : null, Ao = (t, e) => u(t) ? t : (i(e) ? e : d()).querySelector(t), de = (t, e) => (i(e) ? e : d()).getElementsByTagName(t), So = (t) => [...de(\"*\", t)].filter(ue), Mo = (t, e) => d(e).getElementById(t) || null, No = (t, e) => (i(e) ? e : d()).querySelectorAll(t), ko = (t, e) => (e && i(e) ? e : d()).getElementsByClassName(\n t\n), To = (t, e) => t.matches(e), Do = \"2.0.0alpha17\";\nexport {\n Vn as ArrayFrom,\n P as DOMContentLoadedEvent,\n Y as DOMMouseScrollEvent,\n L as Data,\n Un as Float32ArrayFrom,\n Wn as Float64ArrayFrom,\n k as ObjectAssign,\n w as ObjectEntries,\n Jn as ObjectFromEntries,\n jn as ObjectHasOwn,\n qn as ObjectKeys,\n Gn as ObjectValues,\n $n as Timer,\n q as abortEvent,\n On as addClass,\n cn as addEventListener,\n Wt as animationDelay,\n Ut as animationDuration,\n D as animationEndEvent,\n F as animationName,\n pe as ariaChecked,\n fe as ariaDescribedBy,\n me as ariaDescription,\n ge as ariaExpanded,\n ve as ariaHasPopup,\n Ee as ariaHidden,\n be as ariaLabel,\n he as ariaLabelledBy,\n ye as ariaModal,\n we as ariaPressed,\n Ae as ariaSelected,\n Me as ariaValueMax,\n Se as ariaValueMin,\n Ne as ariaValueNow,\n ke as ariaValueText,\n G as beforeunloadEvent,\n an as bezierEasings,\n J as blurEvent,\n K as changeEvent,\n le as closest,\n X as contextmenuEvent,\n Kn as createCustomEvent,\n Zt as createElement,\n $t as createElementNS,\n Q as dispatchEvent,\n Hn as distinct,\n zn as documentBody,\n xn as documentElement,\n M as documentHead,\n De as dragEvent,\n ze as dragendEvent,\n Oe as dragenterEvent,\n Le as dragleaveEvent,\n Ie as dragoverEvent,\n Ce as dragstartEvent,\n Pn as emulateAnimationEnd,\n Fn as emulateTransitionEnd,\n Z as errorEvent,\n Rn as focus,\n $ as focusEvent,\n Fe as focusEvents,\n _ as focusinEvent,\n tt as focusoutEvent,\n et as gesturechangeEvent,\n nt as gestureendEvent,\n ot as gesturestartEvent,\n Yt as getAttribute,\n Sn as getAttributeNS,\n h as getBoundingClientRect,\n So as getCustomElements,\n d as getDocument,\n to as getDocumentBody,\n T as getDocumentElement,\n eo as getDocumentHead,\n _t as getElementAnimationDelay,\n te as getElementAnimationDuration,\n Mo as getElementById,\n g as getElementStyle,\n ee as getElementTransitionDelay,\n ne as getElementTransitionDuration,\n ko as getElementsByClassName,\n de as getElementsByTagName,\n Bn as getInstance,\n no as getNodeScroll,\n oo as getParentNode,\n so as getRectRelativeToOffsetParent,\n ae as getUID,\n co as getWindow,\n Mn as hasAttribute,\n Nn as hasAttributeNS,\n In as hasClass,\n gn as isApple,\n ie as isArray,\n ro as isCanvas,\n ue as isCustomElement,\n R as isDocument,\n ao as isElement,\n io as isElementInScrollRange,\n uo as isElementInViewport,\n lo as isElementsArray,\n vn as isFirefox,\n po as isFunction,\n mo as isHTMLCollection,\n u as isHTMLElement,\n fo as isHTMLImageElement,\n go as isJSON,\n I as isMap,\n Eo as isMedia,\n fn as isMobile,\n i as isNode,\n bo as isNodeList,\n se as isNumber,\n v as isObject,\n ho as isRTL,\n yo as isSVGElement,\n re as isScaledElement,\n ce as isShadowRoot,\n N as isString,\n wo as isTableElement,\n vo as isWeakMap,\n W as isWindow,\n We as keyAlt,\n Re as keyArrowDown,\n je as keyArrowLeft,\n qe as keyArrowRight,\n Qe as keyArrowUp,\n Ge as keyBackspace,\n Je as keyCapsLock,\n Ke as keyControl,\n Xe as keyDelete,\n Ye as keyEnter,\n Ze as keyEscape,\n $e as keyInsert,\n _e as keyMeta,\n tn as keyPause,\n en as keyScrollLock,\n nn as keyShift,\n on as keySpace,\n sn as keyTab,\n Ue as keyboardEventKeys,\n st as keydownEvent,\n ct as keypressEvent,\n rt as keyupEvent,\n at as loadEvent,\n xe as loadstartEvent,\n To as matches,\n Be as mouseClickEvents,\n He as mouseHoverEvents,\n Ve as mouseSwipeEvents,\n it as mouseclickEvent,\n ut as mousedblclickEvent,\n lt as mousedownEvent,\n mt as mouseenterEvent,\n pt as mousehoverEvent,\n gt as mouseinEvent,\n ft as mouseleaveEvent,\n bt as mousemoveEvent,\n vt as mouseoutEvent,\n Et as mouseoverEvent,\n dt as mouseupEvent,\n ht as mousewheelEvent,\n yt as moveEvent,\n Te as nativeEvents,\n Xt as noop,\n Qn as normalizeOptions,\n V as normalizeValue,\n Jt as off,\n un as offsetHeight,\n ln as offsetWidth,\n Gt as on,\n Kt as one,\n wt as orientationchangeEvent,\n Xn as passiveHandler,\n At as pointercancelEvent,\n St as pointerdownEvent,\n Mt as pointerleaveEvent,\n Nt as pointermoveEvent,\n kt as pointerupEvent,\n Ao as querySelector,\n No as querySelectorAll,\n Tt as readystatechangeEvent,\n Yn as reflow,\n Dn as removeAttribute,\n Cn as removeAttributeNS,\n Ln as removeClass,\n rn as removeEventListener,\n Dt as resetEvent,\n Ct as resizeEvent,\n zt as scrollEvent,\n dn as scrollHeight,\n pn as scrollWidth,\n Ot as selectEvent,\n Lt as selectendEvent,\n It as selectstartEvent,\n kn as setAttribute,\n Tn as setAttributeNS,\n Zn as setElementStyle,\n xt as submitEvent,\n En as support3DTransform,\n wn as supportAnimation,\n bn as supportPassive,\n yn as supportTouch,\n hn as supportTransform,\n An as supportTransition,\n mn as tabindex,\n oe as toLowerCase,\n _n as toUpperCase,\n Pe as touchEvents,\n Ht as touchcancelEvent,\n Pt as touchendEvent,\n Bt as touchmoveEvent,\n Vt as touchstartEvent,\n Qt as transitionDelay,\n Rt as transitionDuration,\n C as transitionEndEvent,\n U as transitionProperty,\n Ft as unloadEvent,\n S as userAgent,\n A as userAgentData,\n Do as version\n};\n//# sourceMappingURL=shorty.mjs.map\n","const N = [\"transparent\", \"currentColor\", \"inherit\", \"revert\", \"initial\"], b = (o) => {\n const t = Math.floor(o);\n return o - t < 0.5 ? t : Math.round(o);\n}, T = [\n [\n \"aliceblue\",\n {\n r: 240,\n g: 248,\n b: 255\n }\n ],\n [\n \"antiquewhite\",\n {\n r: 250,\n g: 235,\n b: 215\n }\n ],\n [\n \"aqua\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"aquamarine\",\n {\n r: 127,\n g: 255,\n b: 212\n }\n ],\n [\n \"azure\",\n {\n r: 240,\n g: 255,\n b: 255\n }\n ],\n [\n \"beige\",\n {\n r: 245,\n g: 245,\n b: 220\n }\n ],\n [\n \"bisque\",\n {\n r: 255,\n g: 228,\n b: 196\n }\n ],\n [\n \"black\",\n {\n r: 0,\n g: 0,\n b: 0\n }\n ],\n [\n \"blanchedalmond\",\n {\n r: 255,\n g: 235,\n b: 205\n }\n ],\n [\n \"blue\",\n {\n r: 0,\n g: 0,\n b: 255\n }\n ],\n [\n \"blueviolet\",\n {\n r: 138,\n g: 43,\n b: 226\n }\n ],\n [\n \"brown\",\n {\n r: 165,\n g: 42,\n b: 42\n }\n ],\n [\n \"burlywood\",\n {\n r: 222,\n g: 184,\n b: 135\n }\n ],\n [\n \"cadetblue\",\n {\n r: 95,\n g: 158,\n b: 160\n }\n ],\n [\n \"chartreuse\",\n {\n r: 127,\n g: 255,\n b: 0\n }\n ],\n [\n \"chocolate\",\n {\n r: 210,\n g: 105,\n b: 30\n }\n ],\n [\n \"coral\",\n {\n r: 255,\n g: 127,\n b: 80\n }\n ],\n [\n \"cornflowerblue\",\n {\n r: 100,\n g: 149,\n b: 237\n }\n ],\n [\n \"cornsilk\",\n {\n r: 255,\n g: 248,\n b: 220\n }\n ],\n [\n \"crimson\",\n {\n r: 220,\n g: 20,\n b: 60\n }\n ],\n [\n \"cyan\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"darkblue\",\n {\n r: 0,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkcyan\",\n {\n r: 0,\n g: 139,\n b: 139\n }\n ],\n [\n \"darkgoldenrod\",\n {\n r: 184,\n g: 134,\n b: 11\n }\n ],\n [\n \"darkgray\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkgreen\",\n {\n r: 0,\n g: 100,\n b: 0\n }\n ],\n [\n \"darkgrey\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkkhaki\",\n {\n r: 189,\n g: 183,\n b: 107\n }\n ],\n [\n \"darkmagenta\",\n {\n r: 139,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkolivegreen\",\n {\n r: 85,\n g: 107,\n b: 47\n }\n ],\n [\n \"darkorange\",\n {\n r: 255,\n g: 140,\n b: 0\n }\n ],\n [\n \"darkorchid\",\n {\n r: 153,\n g: 50,\n b: 204\n }\n ],\n [\n \"darkred\",\n {\n r: 139,\n g: 0,\n b: 0\n }\n ],\n [\n \"darksalmon\",\n {\n r: 233,\n g: 150,\n b: 122\n }\n ],\n [\n \"darkseagreen\",\n {\n r: 143,\n g: 188,\n b: 143\n }\n ],\n [\n \"darkslateblue\",\n {\n r: 72,\n g: 61,\n b: 139\n }\n ],\n [\n \"darkslategray\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkslategrey\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkturquoise\",\n {\n r: 0,\n g: 206,\n b: 209\n }\n ],\n [\n \"darkviolet\",\n {\n r: 148,\n g: 0,\n b: 211\n }\n ],\n [\n \"deeppink\",\n {\n r: 255,\n g: 20,\n b: 147\n }\n ],\n [\n \"deepskyblue\",\n {\n r: 0,\n g: 191,\n b: 255\n }\n ],\n [\n \"dimgray\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dimgrey\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dodgerblue\",\n {\n r: 30,\n g: 144,\n b: 255\n }\n ],\n [\n \"firebrick\",\n {\n r: 178,\n g: 34,\n b: 34\n }\n ],\n [\n \"floralwhite\",\n {\n r: 255,\n g: 250,\n b: 240\n }\n ],\n [\n \"forestgreen\",\n {\n r: 34,\n g: 139,\n b: 34\n }\n ],\n [\n \"fuchsia\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"gainsboro\",\n {\n r: 220,\n g: 220,\n b: 220\n }\n ],\n [\n \"ghostwhite\",\n {\n r: 248,\n g: 248,\n b: 255\n }\n ],\n [\n \"goldenrod\",\n {\n r: 218,\n g: 165,\n b: 32\n }\n ],\n [\n \"gold\",\n {\n r: 255,\n g: 215,\n b: 0\n }\n ],\n [\n \"gray\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"green\",\n {\n r: 0,\n g: 128,\n b: 0\n }\n ],\n [\n \"greenyellow\",\n {\n r: 173,\n g: 255,\n b: 47\n }\n ],\n [\n \"grey\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"honeydew\",\n {\n r: 240,\n g: 255,\n b: 240\n }\n ],\n [\n \"hotpink\",\n {\n r: 255,\n g: 105,\n b: 180\n }\n ],\n [\n \"indianred\",\n {\n r: 205,\n g: 92,\n b: 92\n }\n ],\n [\n \"indigo\",\n {\n r: 75,\n g: 0,\n b: 130\n }\n ],\n [\n \"ivory\",\n {\n r: 255,\n g: 255,\n b: 240\n }\n ],\n [\n \"khaki\",\n {\n r: 240,\n g: 230,\n b: 140\n }\n ],\n [\n \"lavenderblush\",\n {\n r: 255,\n g: 240,\n b: 245\n }\n ],\n [\n \"lavender\",\n {\n r: 230,\n g: 230,\n b: 250\n }\n ],\n [\n \"lawngreen\",\n {\n r: 124,\n g: 252,\n b: 0\n }\n ],\n [\n \"lemonchiffon\",\n {\n r: 255,\n g: 250,\n b: 205\n }\n ],\n [\n \"lightblue\",\n {\n r: 173,\n g: 216,\n b: 230\n }\n ],\n [\n \"lightcoral\",\n {\n r: 240,\n g: 128,\n b: 128\n }\n ],\n [\n \"lightcyan\",\n {\n r: 224,\n g: 255,\n b: 255\n }\n ],\n [\n \"lightgoldenrodyellow\",\n {\n r: 250,\n g: 250,\n b: 210\n }\n ],\n [\n \"lightgray\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightgreen\",\n {\n r: 144,\n g: 238,\n b: 144\n }\n ],\n [\n \"lightgrey\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightpink\",\n {\n r: 255,\n g: 182,\n b: 193\n }\n ],\n [\n \"lightsalmon\",\n {\n r: 255,\n g: 160,\n b: 122\n }\n ],\n [\n \"lightseagreen\",\n {\n r: 32,\n g: 178,\n b: 170\n }\n ],\n [\n \"lightskyblue\",\n {\n r: 135,\n g: 206,\n b: 250\n }\n ],\n [\n \"lightslategray\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightslategrey\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightsteelblue\",\n {\n r: 176,\n g: 196,\n b: 222\n }\n ],\n [\n \"lightyellow\",\n {\n r: 255,\n g: 255,\n b: 224\n }\n ],\n [\n \"lime\",\n {\n r: 0,\n g: 255,\n b: 0\n }\n ],\n [\n \"limegreen\",\n {\n r: 50,\n g: 205,\n b: 50\n }\n ],\n [\n \"linen\",\n {\n r: 250,\n g: 240,\n b: 230\n }\n ],\n [\n \"magenta\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"maroon\",\n {\n r: 128,\n g: 0,\n b: 0\n }\n ],\n [\n \"mediumaquamarine\",\n {\n r: 102,\n g: 205,\n b: 170\n }\n ],\n [\n \"mediumblue\",\n {\n r: 0,\n g: 0,\n b: 205\n }\n ],\n [\n \"mediumorchid\",\n {\n r: 186,\n g: 85,\n b: 211\n }\n ],\n [\n \"mediumpurple\",\n {\n r: 147,\n g: 112,\n b: 219\n }\n ],\n [\n \"mediumseagreen\",\n {\n r: 60,\n g: 179,\n b: 113\n }\n ],\n [\n \"mediumslateblue\",\n {\n r: 123,\n g: 104,\n b: 238\n }\n ],\n [\n \"mediumspringgreen\",\n {\n r: 0,\n g: 250,\n b: 154\n }\n ],\n [\n \"mediumturquoise\",\n {\n r: 72,\n g: 209,\n b: 204\n }\n ],\n [\n \"mediumvioletred\",\n {\n r: 199,\n g: 21,\n b: 133\n }\n ],\n [\n \"midnightblue\",\n {\n r: 25,\n g: 25,\n b: 112\n }\n ],\n [\n \"mintcream\",\n {\n r: 245,\n g: 255,\n b: 250\n }\n ],\n [\n \"mistyrose\",\n {\n r: 255,\n g: 228,\n b: 225\n }\n ],\n [\n \"moccasin\",\n {\n r: 255,\n g: 228,\n b: 181\n }\n ],\n [\n \"navajowhite\",\n {\n r: 255,\n g: 222,\n b: 173\n }\n ],\n [\n \"navy\",\n {\n r: 0,\n g: 0,\n b: 128\n }\n ],\n [\n \"oldlace\",\n {\n r: 253,\n g: 245,\n b: 230\n }\n ],\n [\n \"olive\",\n {\n r: 128,\n g: 128,\n b: 0\n }\n ],\n [\n \"olivedrab\",\n {\n r: 107,\n g: 142,\n b: 35\n }\n ],\n [\n \"orange\",\n {\n r: 255,\n g: 165,\n b: 0\n }\n ],\n [\n \"orangered\",\n {\n r: 255,\n g: 69,\n b: 0\n }\n ],\n [\n \"orchid\",\n {\n r: 218,\n g: 112,\n b: 214\n }\n ],\n [\n \"palegoldenrod\",\n {\n r: 238,\n g: 232,\n b: 170\n }\n ],\n [\n \"palegreen\",\n {\n r: 152,\n g: 251,\n b: 152\n }\n ],\n [\n \"paleturquoise\",\n {\n r: 175,\n g: 238,\n b: 238\n }\n ],\n [\n \"palevioletred\",\n {\n r: 219,\n g: 112,\n b: 147\n }\n ],\n [\n \"papayawhip\",\n {\n r: 255,\n g: 239,\n b: 213\n }\n ],\n [\n \"peachpuff\",\n {\n r: 255,\n g: 218,\n b: 185\n }\n ],\n [\n \"peru\",\n {\n r: 205,\n g: 133,\n b: 63\n }\n ],\n [\n \"pink\",\n {\n r: 255,\n g: 192,\n b: 203\n }\n ],\n [\n \"plum\",\n {\n r: 221,\n g: 160,\n b: 221\n }\n ],\n [\n \"powderblue\",\n {\n r: 176,\n g: 224,\n b: 230\n }\n ],\n [\n \"purple\",\n {\n r: 128,\n g: 0,\n b: 128\n }\n ],\n [\n \"rebeccapurple\",\n {\n r: 102,\n g: 51,\n b: 153\n }\n ],\n [\n \"red\",\n {\n r: 255,\n g: 0,\n b: 0\n }\n ],\n [\n \"rosybrown\",\n {\n r: 188,\n g: 143,\n b: 143\n }\n ],\n [\n \"royalblue\",\n {\n r: 65,\n g: 105,\n b: 225\n }\n ],\n [\n \"saddlebrown\",\n {\n r: 139,\n g: 69,\n b: 19\n }\n ],\n [\n \"salmon\",\n {\n r: 250,\n g: 128,\n b: 114\n }\n ],\n [\n \"sandybrown\",\n {\n r: 244,\n g: 164,\n b: 96\n }\n ],\n [\n \"seagreen\",\n {\n r: 46,\n g: 139,\n b: 87\n }\n ],\n [\n \"seashell\",\n {\n r: 255,\n g: 245,\n b: 238\n }\n ],\n [\n \"sienna\",\n {\n r: 160,\n g: 82,\n b: 45\n }\n ],\n [\n \"silver\",\n {\n r: 192,\n g: 192,\n b: 192\n }\n ],\n [\n \"skyblue\",\n {\n r: 135,\n g: 206,\n b: 235\n }\n ],\n [\n \"slateblue\",\n {\n r: 106,\n g: 90,\n b: 205\n }\n ],\n [\n \"slategray\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"slategrey\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"snow\",\n {\n r: 255,\n g: 250,\n b: 250\n }\n ],\n [\n \"springgreen\",\n {\n r: 0,\n g: 255,\n b: 127\n }\n ],\n [\n \"steelblue\",\n {\n r: 70,\n g: 130,\n b: 180\n }\n ],\n [\n \"tan\",\n {\n r: 210,\n g: 180,\n b: 140\n }\n ],\n [\n \"teal\",\n {\n r: 0,\n g: 128,\n b: 128\n }\n ],\n [\n \"thistle\",\n {\n r: 216,\n g: 191,\n b: 216\n }\n ],\n [\n \"tomato\",\n {\n r: 255,\n g: 99,\n b: 71\n }\n ],\n [\n \"turquoise\",\n {\n r: 64,\n g: 224,\n b: 208\n }\n ],\n [\n \"violet\",\n {\n r: 238,\n g: 130,\n b: 238\n }\n ],\n [\n \"wheat\",\n {\n r: 245,\n g: 222,\n b: 179\n }\n ],\n [\n \"white\",\n {\n r: 255,\n g: 255,\n b: 255\n }\n ],\n [\n \"whitesmoke\",\n {\n r: 245,\n g: 245,\n b: 245\n }\n ],\n [\n \"yellow\",\n {\n r: 255,\n g: 255,\n b: 0\n }\n ],\n [\n \"yellowgreen\",\n {\n r: 154,\n g: 205,\n b: 50\n }\n ]\n], B = \"deg|rad|grad|turn\", U = \"[-\\\\+]?\\\\d+%?\", D = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\", L = `[-\\\\+]?\\\\d*\\\\.?\\\\d+(?:${B})?`, v = `(?:${D})|(?:${U})`, F = `(?:${v})|(?:${L}?)`, rr = \"(?:[\\\\s|\\\\(\\\\s|\\\\s\\\\(\\\\s]+)?\", tr = \"(?:[\\\\s|\\\\)\\\\s]+)?\", O = \"(?:[,|\\\\s]+)\", er = \"(?:[,|\\\\/\\\\s]*)?\", $ = `${rr}(${F})${O}(${v})${O}(${v})${er}(${v})?${tr}`, f = {\n CSS_UNIT: new RegExp(F),\n ANGLES: B,\n CSS_ANGLE: L,\n CSS_INTEGER: U,\n CSS_NUMBER: D,\n CSS_UNIT2: F,\n PERMISSIVE_MATCH: $,\n hwb: new RegExp(`hwb${$}`),\n rgb: new RegExp(`rgb(?:a)?${$}`),\n hsl: new RegExp(`hsl(?:a)?${$}`),\n hsv: new RegExp(`hsv(?:a)?${$}`),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n}, V = (o) => N.includes(o), k = (o, t) => o !== null && typeof o == \"object\" && Object.keys(t).every((r) => r in o), Z = (o) => `${o}`.includes(\".\") && parseFloat(o) === 1, R = (o) => typeof o == \"string\" && o.includes(\"%\"), c = (o) => !!f.CSS_UNIT.exec(`${o}`), z = [\"rgb\", \"hex\", \"hsl\", \"hsv\", \"hwb\"], J = (o) => N.includes(o) || [\"#\", ...z].some((t) => o.includes(t)) ? !1 : T.some(([t]) => o === t), u = (o, t) => {\n let r = o;\n if (typeof o == \"number\" && Math.min(o, 0) === 0 && // round values to 6 decimals Math.round(N * (10 ** 6)) / 10 ** 6\n Math.max(o, 1) === 1)\n return o;\n Z(o) && (r = \"100%\");\n const e = R(r);\n return r = t === 360 ? parseFloat(r) : Math.min(t, Math.max(0, parseFloat(r))), e && (r = r * t / 100), Math.abs(r - t) < 1e-6 ? 1 : (t === 360 ? r = (r < 0 ? r % t + t : r % t) / t : r = r % t / t, r);\n}, M = (o) => {\n let t = parseFloat(o);\n return (Number.isNaN(t) || t < 0 || t > 1) && (t = 1), t;\n}, x = (o) => Math.min(1, Math.max(0, o)), p = (o) => o.length === 1 ? `0${o}` : String(o), K = (o) => {\n const [[, t]] = T.filter(([r]) => r === o.toLowerCase());\n return t;\n}, h = (o) => parseInt(o, 16), E = (o) => h(o) / 255, Q = (o) => b(o * 255).toString(16), _ = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0, g = 0;\n const a = (e + s) / 2;\n if (e === s)\n g = 0, n = 0;\n else {\n const i = e - s;\n g = a > 0.5 ? i / (2 - e - s) : i / (e + s), e === o && (n = (t - r) / i + (t < r ? 6 : 0)), e === t && (n = (r - o) / i + 2), e === r && (n = (o - t) / i + 4), n /= 6;\n }\n return { h: n, s: g, l: a };\n}, H = (o, t, r) => {\n let e = r;\n return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? o + (t - o) * (6 * e) : e < 1 / 2 ? t : e < 2 / 3 ? o + (t - o) * (2 / 3 - e) * 6 : o;\n}, y = (o, t, r) => {\n let e = 0, s = 0, n = 0;\n if (t === 0)\n s = r, n = r, e = r;\n else if (r) {\n const g = r < 0.5 ? r * (1 + t) : r + t - r * t, a = 2 * r - g;\n e = H(a, g, o + 1 / 3), s = H(a, g, o), n = H(a, g, o - 1 / 3);\n }\n return { r: e, g: s, b: n };\n}, G = (o, t, r) => {\n let e = 0, s = 0;\n const n = Math.min(o, t, r), g = Math.max(o, t, r), a = 1 - g;\n if (g === n)\n return { h: 0, w: n, b: a };\n o === n ? (e = t - r, s = 3) : (e = t === n ? r - o : o - t, s = t === n ? 5 : 1);\n const i = (s - e / (g - n)) / 6;\n return {\n h: i === 1 ? 0 : i,\n w: n,\n b: a\n };\n}, X = (o, t, r) => {\n if (t + r >= 1) {\n const g = t / (t + r);\n return { r: g, g, b: g };\n }\n let { r: e, g: s, b: n } = y(o, 1, 0.5);\n return [e, s, n] = [e, s, n].map((g) => g * (1 - t - r) + t), { r: e, g: s, b: n };\n}, P = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0;\n const g = e, a = e - s, i = e === 0 ? 0 : a / e;\n return e === s ? n = 0 : (o === e && (n = (t - r) / a + (t < r ? 6 : 0)), t === e && (n = (r - o) / a + 2), r === e && (n = (o - t) / a + 4), n /= 6), { h: n, s: i, v: g };\n}, I = (o, t, r) => {\n const e = o * 6, s = t, n = r, g = Math.floor(e), a = e - g, i = n * (1 - s), l = n * (1 - a * s), d = n * (1 - (1 - a) * s), m = g % 6, w = [n, l, i, i, d, n][m], S = [d, n, n, l, i, i][m], A = [i, i, d, n, n, l][m];\n return { r: w, g: S, b: A };\n}, j = (o, t, r, e) => {\n const s = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16))\n ];\n return e && s[0].charAt(0) === s[0].charAt(1) && s[1].charAt(0) === s[1].charAt(1) && s[2].charAt(0) === s[2].charAt(1) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) : s.join(\"\");\n}, C = (o, t, r, e, s) => {\n const n = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16)),\n p(Q(e))\n ];\n return s && n[0].charAt(0) === n[0].charAt(1) && n[1].charAt(0) === n[1].charAt(1) && n[2].charAt(0) === n[2].charAt(1) && n[3].charAt(0) === n[3].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join(\"\");\n}, Y = (o) => {\n const t = String(o).trim().toLowerCase();\n if (J(t))\n return Object.assign(K(t), {\n a: 1,\n format: \"rgb\",\n ok: !0\n });\n if (V(t))\n return {\n r: 0,\n g: 0,\n b: 0,\n a: t === \"transparent\" ? 0 : 1,\n format: \"rgb\",\n ok: !0\n };\n let [, r, e, s, n] = f.rgb.exec(t) || [];\n return r && e && s ? {\n r,\n g: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"rgb\",\n ok: !0\n } : ([, r, e, s, n] = f.hsl.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n l: s,\n a: n !== void 0 ? n : 1,\n format: \"hsl\",\n ok: !0\n } : ([, r, e, s, n] = f.hsv.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n v: s,\n a: n !== void 0 ? n : 1,\n format: \"hsv\",\n ok: !0\n } : ([, r, e, s, n] = f.hwb.exec(t) || [], r && e && s ? {\n h: r,\n w: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"hwb\",\n ok: !0\n } : ([, r, e, s, n] = f.hex8.exec(t) || [], r && e && s && n ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: E(n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex6.exec(t) || [], r && e && s ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : ([, r, e, s, n] = f.hex4.exec(t) || [], r && e && s && n ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: E(n + n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex3.exec(t) || [], r && e && s ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : {\n r: 0,\n g: 0,\n b: 0,\n a: 1,\n format: \"rgb\",\n ok: !o\n })))))));\n}, q = (o) => {\n let t = { r: 0, g: 0, b: 0 }, r = o, e = 1, s, n, g, a, i, l, d, m, w = \"rgb\", S = !1;\n return (!r || typeof r == \"string\") && (r = Y(r), S = r.ok), k(r, t) && c(r.r) && c(r.g) && c(r.b) && ({ r: d, g: m, b: i } = r, [d, m, i] = [d, m, i].map((A) => u(A, R(A) ? 100 : 255)), t = { r: d, g: m, b: i }, w = \"format\" in r ? r.format : \"rgb\"), k(r, { h: 0, s: 0, v: 0 }) && c(r.h) && c(r.s) && c(r.v) && ({ h: l, s, v: n } = r, l = u(l, 360), s = u(s, 100), n = u(n, 100), t = I(l, s, n), w = \"hsv\"), k(r, { h: 0, s: 0, l: 0 }) && c(r.h) && c(r.s) && c(r.l) && ({ h: l, s, l: g } = r, l = u(l, 360), s = u(s, 100), g = u(g, 100), t = y(l, s, g), w = \"hsl\"), k(r, { h: 0, w: 0, b: 0 }) && c(r.h) && c(r.w) && c(r.b) && ({ h: l, w: a, b: i } = r, l = u(l, 360), a = u(a, 100), i = u(i, 100), t = X(l, a, i), w = \"hwb\"), c(r.a) && (e = r.a, e = R(e) || parseFloat(`${e}`) > 1 ? u(e, 100) : e), {\n r: t.r,\n g: t.g,\n b: t.b,\n a: M(e),\n format: w,\n ok: S\n };\n}, sr = \"1.0.8\";\nclass W {\n // bring main utilities to front\n static matchers = f;\n static isOnePointZero = Z;\n static isPercentage = R;\n static isValidCSSUnit = c;\n static isNonColor = V;\n static isColorName = J;\n static isColorType = k;\n static pad2 = p;\n static clamp01 = x;\n static bound01 = u;\n static boundAlpha = M;\n static getRGBFromName = K;\n static convertHexToDecimal = E;\n static convertDecimalToHex = Q;\n static rgbToHsl = _;\n static rgbToHex = j;\n static rgbToHsv = P;\n static rgbToHwb = G;\n static rgbaToHex = C;\n static hslToRgb = I;\n static hsvToRgb = I;\n static hueToRgb = H;\n static hwbToRgb = X;\n static parseIntFromHex = h;\n static stringInputToObject = Y;\n static inputToRGB = q;\n static roundPart = b;\n static webColors = T;\n static nonColors = N;\n static version = sr;\n // main public properties\n r;\n g;\n b;\n a;\n format;\n ok;\n originalInput;\n // main public methods\n constructor(t, r) {\n const e = r && z.includes(r) ? r : \"\", { r: s, g: n, b: g, a, ok: i, format: l } = q(t);\n this.originalInput = t, this.r = s, this.g = n, this.b = g, this.a = a, this.ok = i, this.format = e || l;\n }\n /**\n * Checks if the current input value is a valid colour.\n */\n get isValid() {\n return this.ok;\n }\n /**\n * Checks if the current colour requires a light text colour.\n */\n get isDark() {\n return this.brightness < 120;\n }\n /**\n * Returns the perceived luminance of a colour.\n *\n * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n */\n get luminance() {\n const { r: t, g: r, b: e } = this;\n let s = 0, n = 0, g = 0;\n return t <= 0.03928 ? s = t / 12.92 : s = ((t + 0.055) / 1.055) ** 2.4, r <= 0.03928 ? n = r / 12.92 : n = ((r + 0.055) / 1.055) ** 2.4, e <= 0.03928 ? g = e / 12.92 : g = ((e + 0.055) / 1.055) ** 2.4, 0.2126 * s + 0.7152 * n + 0.0722 * g;\n }\n /**\n * Returns the perceived brightness of the colour.\n */\n get brightness() {\n const { r: t, g: r, b: e } = this.toRgb();\n return (t * 299 + r * 587 + e * 114) / 1e3;\n }\n /**\n * Returns the web colour name closest to the current colour.\n */\n get name() {\n const { r: t, g: r, b: e } = this.toRgb(), [s] = T.map(([n, g]) => {\n const a = (\n // ((rgb.r - r) ** 2 + (rgb.g - g) ** 2 + (rgb.b - b) ** 2) ** 0.5; // standard\n (((g.r - t) * 0.3) ** 2 + ((g.g - r) * 0.6) ** 2 + ((g.b - e) * 0.1) ** 2) ** 0.5\n );\n return [n, a];\n }).find(([, n], g, a) => n === Math.min(...a.map(([, i]) => i)));\n return s;\n }\n /**\n * Returns the colour as an RGBA object.\n */\n toRgb() {\n let { r: t, g: r, b: e, a: s } = this;\n return [t, r, e] = [t, r, e].map((n) => b(n * 255 * 100) / 100), s = b(s * 100) / 100, {\n r: t,\n g: r,\n b: e,\n a: s\n };\n }\n /**\n * Returns the RGBA values concatenated into a CSS3 Module string format.\n * * rgb(255,255,255)\n * * rgba(255,255,255,0.5)\n */\n toRgbString() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b);\n return s === 1 ? `rgb(${n}, ${g}, ${a})` : `rgba(${n}, ${g}, ${a}, ${s})`;\n }\n /**\n * Returns the RGBA values concatenated into a CSS4 Module string format.\n * * rgb(255 255 255)\n * * rgb(255 255 255 / 50%)\n */\n toRgbCSS4String() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b), i = s === 1 ? \"\" : ` / ${b(s * 100)}%`;\n return `rgb(${n} ${g} ${a}${i})`;\n }\n /**\n * Returns the hexadecimal value of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the decimal value.\n */\n toHex(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return n === 1 ? j(r, e, s, t) : C(r, e, s, n, t);\n }\n /**\n * Returns the CSS valid hexadecimal vaue of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the value.\n */\n toHexString(t) {\n return `#${this.toHex(t)}`;\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return C(r, e, s, n, t);\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8String(t) {\n return `#${this.toHex8(t)}`;\n }\n /**\n * Returns the colour as a HSVA object.\n */\n toHsv() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, v: a } = P(t, r, e);\n return {\n h: n,\n s: g,\n v: a,\n a: s\n };\n }\n /**\n * Returns the colour as an HSLA object.\n */\n toHsl() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, l: a } = _(t, r, e);\n return {\n h: n,\n s: g,\n l: a,\n a: s\n };\n }\n /**\n * Returns the HSLA values concatenated into a CSS3 Module format string.\n * * `hsl(150, 100%, 50%)`\n * * `hsla(150, 100%, 50%, 0.5)`\n */\n toHslString() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n return t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100) / 100, s === 1 ? `hsl(${t}, ${r}%, ${e}%)` : `hsla(${t}, ${r}%, ${e}%, ${s})`;\n }\n /**\n * Returns the HSLA values concatenated into a CSS4 Module format string.\n * * `hsl(150deg 100% 50%)`\n * * `hsl(150deg 100% 50% / 50%)`\n */\n toHslCSS4String() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hsl(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Returns the colour as an HWBA object.\n */\n toHwb() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, w: g, b: a } = G(t, r, e);\n return {\n h: n,\n w: g,\n b: a,\n a: s\n };\n }\n /**\n * Returns the HWBA values concatenated into a string.\n */\n toHwbString() {\n let { h: t, w: r, b: e, a: s } = this.toHwb();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hwb(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Sets the alpha value of the current colour.\n */\n setAlpha(t) {\n return typeof t != \"number\" ? this : (this.a = M(t), this);\n }\n /**\n * Saturate the colour with a given amount.\n */\n saturate(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, x(e + t / 100), s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Desaturate the colour with a given amount.\n */\n desaturate(t) {\n return typeof t == \"number\" ? this.saturate(-t) : this;\n }\n /**\n * Completely desaturates a colour into greyscale.\n * Same as calling `desaturate(100)`\n */\n greyscale() {\n return this.saturate(-100);\n }\n /**\n * Increase the colour lightness with a given amount.\n */\n lighten(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, e, x(s + t / 100));\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Decrease the colour lightness with a given amount.\n */\n darken(t) {\n return typeof t == \"number\" ? this.lighten(-t) : this;\n }\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n spin(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(x((r * 360 + t) % 360 / 360), e, s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /** Returns a clone of the current `Color` instance. */\n clone() {\n return new W(this);\n }\n /**\n * Returns the colour value in CSS valid string format.\n */\n toString(t) {\n const { format: r } = this;\n return r === \"hex\" ? this.toHexString(t) : r === \"hsl\" ? this.toHslString() : r === \"hwb\" ? this.toHwbString() : this.toRgbString();\n }\n}\nexport {\n W as default\n};\n//# sourceMappingURL=index.mjs.map\n","import Color from '@thednp/color';\n// import { isNumber } from '@thednp/shorty';\n\n/**\n * Returns a color palette with a given set of parameters.\n *\n * @example\n * new ColorPalette(0, 12, 10, 80);\n * // => { hue: 0, hueSteps: 12, lightSteps: 10, saturation: 80, colors: Array }\n */\nexport default class ColorPalette {\n public static Color = Color;\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n colors: Color[];\n /**\n * The `hue` parameter is optional, which would be set to 0.\n * * `args.hue` the starting Hue [0, 360]\n * * `args.hueSteps` Hue Steps Count [5, 24]\n * * `args.lightSteps` Lightness Steps Count [5, 12]\n * * `args.saturation` Saturation [0, 100]\n */\n constructor(...args: [number?, number?, number?, number?]) {\n let hue = 0;\n let hueSteps = 12;\n let lightSteps = 10;\n let lightnessArray = [0.5];\n let saturation = 100;\n // if (!args.every(n => isNumber(n))) throw TypeError('ColorPalette only accepts numbers.');\n\n if (args.length === 4) {\n [hue, hueSteps, lightSteps, saturation] = args as [number, number, number, number];\n } else if (args.length === 3) {\n [hue, hueSteps, lightSteps] = args as [number, number, number];\n } else if (args.length === 2) {\n [hueSteps, lightSteps] = args as [number, number];\n if ([hueSteps, lightSteps].some(n => n < 1)) {\n throw TypeError('ColorPalette: the two minimum arguments must be numbers higher than 0.');\n }\n }\n\n const colors: Color[] = [];\n const hueStep = 360 / hueSteps;\n const half = Color.roundPart((lightSteps - (lightSteps % 2 ? 1 : 0)) / 2);\n const steps1To13 = [0.25, 0.2, 0.15, 0.11, 0.09, 0.075];\n const lightSets = [\n [1, 2, 3],\n [4, 5],\n [6, 7],\n [8, 9],\n [10, 11],\n [12, 13],\n ];\n const closestSet = lightSets.find(set => set.includes(lightSteps));\n\n // find a lightStep that won't go beyond black and white\n // something within the [10-90] range of lightness\n const lightStep = closestSet\n ? steps1To13[lightSets.indexOf(closestSet)]\n : 100 / (lightSteps + (lightSteps % 2 ? 0 : 1)) / 100;\n\n // light tints\n for (let i = 1; i < half + 1; i += 1) {\n lightnessArray = [...lightnessArray, 0.5 + lightStep * i];\n }\n\n // dark tints\n for (let i = 1; i < lightSteps - half; i += 1) {\n lightnessArray = [0.5 - lightStep * i, ...lightnessArray];\n }\n\n // feed `colors` Array\n for (let i = 0; i < hueSteps; i += 1) {\n const currentHue = ((hue + i * hueStep) % 360) / 360;\n lightnessArray.forEach(l => {\n const newColor = new Color({ h: currentHue, s: 1, l });\n colors.push(saturation < 100 ? newColor.saturate(saturation - 100) : newColor);\n });\n }\n\n this.hue = hue;\n this.hueSteps = hueSteps;\n this.lightSteps = lightSteps;\n this.saturation = saturation;\n this.colors = colors;\n }\n}\n","import ColorPickerLabels from '../interface/colorPickerLabels';\n\n/** The labels presented to the user. */\nconst colorPickerLabels: ColorPickerLabels = {\n pickerLabel: 'Colour Picker',\n appearanceLabel: 'Colour Appearance',\n valueLabel: 'Colour Value',\n toggleLabel: 'Select Colour',\n presetsLabel: 'Colour Presets',\n defaultsLabel: 'Colour Defaults',\n formatLabel: 'Format',\n alphaLabel: 'Alpha',\n hexLabel: 'Hexadecimal',\n hueLabel: 'Hue',\n whitenessLabel: 'Whiteness',\n blacknessLabel: 'Blackness',\n saturationLabel: 'Saturation',\n lightnessLabel: 'Lightness',\n redLabel: 'Red',\n greenLabel: 'Green',\n blueLabel: 'Blue',\n};\n\nexport default colorPickerLabels;\n","/** A list of 17 color names used for WAI-ARIA compliance. */\nconst colorNames: string[] = [\n 'white',\n 'black',\n 'grey',\n 'red',\n 'orange',\n 'brown',\n 'gold',\n 'olive',\n 'yellow',\n 'lime',\n 'green',\n 'teal',\n 'cyan',\n 'blue',\n 'violet',\n 'magenta',\n 'pink',\n];\nexport default colorNames;\n","import { isString } from '@thednp/shorty';\n\n/**\n * Check if a string is valid JSON string.\n *\n * @param str the string input\n * @returns the query result\n */\nconst isValidJSON = (str: unknown): str is string => {\n if (!isString(str)) return false;\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n};\n\nexport default isValidJSON;\n","const vHidden = 'v-hidden';\nexport default vHidden;\n","import { createElement, setAttribute, ObjectAssign, toUpperCase } from '@thednp/shorty';\n\nimport vHidden from './vHidden';\nimport ColorPicker from '../index';\n\n/**\n * Returns the color form for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns a new `
              ` element with color component ``\n */\nconst getColorForm = (self: ColorPicker): HTMLElement => {\n const { format, id, componentLabels } = self;\n const colorForm = createElement({\n tagName: 'div',\n className: `color-form ${format}`,\n }) as HTMLElement;\n\n let components = ['hex'];\n if (format === 'rgb') components = ['red', 'green', 'blue', 'alpha'];\n else if (format === 'hsl') components = ['hue', 'saturation', 'lightness', 'alpha'];\n else if (format === 'hwb') components = ['hue', 'whiteness', 'blackness', 'alpha'];\n\n components.forEach((c: string): void => {\n const [C] = format === 'hex' ? ['#'] : toUpperCase(c).split('');\n const cID = `color_${format}_${c}_${id}`;\n const formatLabel = componentLabels[`${c}Label`];\n const cInputLabel = createElement({ tagName: 'label' }) as HTMLElement;\n setAttribute(cInputLabel, 'for', cID);\n cInputLabel.append(\n createElement({\n tagName: 'span',\n ariaHidden: 'true',\n innerText: `${C}:`,\n }) as HTMLElement,\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: formatLabel,\n }) as HTMLElement,\n );\n const cInput = createElement({\n tagName: 'input',\n id: cID,\n // name: cID, - prevent saving the value to a form\n type: format === 'hex' ? 'text' : 'number',\n value: c === 'alpha' ? '100' : '0',\n className: `color-input ${c}`,\n autocomplete: 'off',\n spellcheck: false,\n } as Partial) as HTMLInputElement;\n\n // alpha\n let max = '100';\n let step = '1';\n if (c !== 'alpha') {\n if (format === 'rgb') {\n max = '255';\n step = '1';\n } else if (c === 'hue') {\n max = '360';\n step = '1';\n }\n }\n ObjectAssign(cInput, {\n min: '0',\n max,\n step,\n });\n colorForm.append(cInputLabel, cInput);\n });\n return colorForm;\n};\n\nexport default getColorForm;\n","import { createElement } from '@thednp/shorty';\n\nimport ColorPicker from '..';\n\n/**\n * Returns all color controls for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns color controls\n */\nconst getColorControls = (self: ColorPicker): HTMLElement => {\n const { format, componentLabels } = self;\n const { hueLabel, alphaLabel, lightnessLabel, saturationLabel, whitenessLabel, blacknessLabel } = componentLabels;\n\n const max1 = format === 'hsl' ? 360 : 100;\n const max2 = format === 'hsl' ? 100 : 360;\n const max3 = 100;\n\n let ctrl1Label = format === 'hsl' ? `${hueLabel} & ${lightnessLabel}` : `${lightnessLabel} & ${saturationLabel}`;\n\n ctrl1Label = format === 'hwb' ? `${whitenessLabel} & ${blacknessLabel}` : ctrl1Label;\n\n const ctrl2Label = format === 'hsl' ? `${saturationLabel}` : `${hueLabel}`;\n\n const colorControls = createElement({\n tagName: 'div',\n className: `color-controls ${format}`,\n }) as HTMLElement;\n\n const colorPointer = 'color-pointer';\n const colorSlider = 'color-slider';\n\n const controls = [\n {\n i: 1,\n c: colorPointer,\n l: ctrl1Label,\n min: 0,\n max: max1,\n },\n {\n i: 2,\n c: colorSlider,\n l: ctrl2Label,\n min: 0,\n max: max2,\n },\n {\n i: 3,\n c: colorSlider,\n l: alphaLabel,\n min: 0,\n max: max3,\n },\n ];\n\n controls.forEach(template => {\n const { i, c, l, min, max } = template;\n const control = createElement({\n tagName: 'div',\n className: 'color-control',\n role: 'presentation',\n }) as HTMLElement;\n\n control.append(\n createElement({\n tagName: 'div',\n className: `visual-control visual-control${i}`,\n }) as HTMLElement,\n );\n\n const knob = createElement({\n tagName: 'div',\n className: `${c} knob`,\n ariaLive: 'polite',\n ariaLabel: l,\n role: 'slider',\n tabIndex: 0,\n ariaValueMin: `${min}`,\n ariaValueMax: `${max}`,\n }) as HTMLElement;\n\n control.append(knob);\n colorControls.append(control);\n });\n\n return colorControls;\n};\n\nexport default getColorControls;\n","import { setAttribute, getAttribute, createElement, setElementStyle } from '@thednp/shorty';\n\nimport Color from '@thednp/color';\nimport ColorPalette from '../colorPalette';\nimport ColorPicker from '../index';\n\n/**\n * Returns a color-defaults with given values and class.\n */\nconst getColorMenu = (self: ColorPicker, colorsSource: ColorPalette | string[], menuClass: string): HTMLElement => {\n const { input, format, componentLabels } = self;\n const { defaultsLabel, presetsLabel } = componentLabels;\n const isOptionsMenu = menuClass === 'color-options';\n const isPalette = colorsSource instanceof ColorPalette;\n const menuLabel = isOptionsMenu ? presetsLabel : defaultsLabel;\n const colorsArray = isPalette ? colorsSource.colors : colorsSource;\n const colorsCount = colorsArray.length;\n const { lightSteps } = isPalette ? colorsSource : { lightSteps: null };\n const fit = lightSteps || [9, 10].find(x => colorsCount >= x * 2 && !(colorsCount % x)) || 5;\n const isMultiLine = isOptionsMenu && colorsCount > fit;\n let rowCountHover = 2;\n rowCountHover = isMultiLine && colorsCount > fit * 2 ? 3 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 3 ? 4 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 4 ? 5 : rowCountHover;\n const rowCount = rowCountHover - (colorsCount <= fit * 3 ? 1 : 2);\n const isScrollable = isMultiLine && colorsCount > rowCount * fit;\n let finalClass = menuClass;\n finalClass += isScrollable ? ' scrollable' : '';\n finalClass += isMultiLine ? ' multiline' : '';\n const gap = isMultiLine ? '1px' : '0.25rem';\n let optionSize = isMultiLine ? 1.75 : 2;\n optionSize = fit > 5 && isMultiLine ? 1.5 : optionSize;\n const menuHeight = `${rowCount * optionSize}rem`;\n const menuHeightHover = `calc(${rowCountHover} * ${optionSize}rem + ${rowCountHover - 1} * ${gap})`;\n\n //
                is an `HTMLElement`\n const menu = createElement({\n tagName: 'ul',\n className: finalClass,\n role: 'listbox',\n ariaLabel: menuLabel,\n }) as HTMLElement;\n\n if (isScrollable) {\n setElementStyle(menu, {\n '--grid-item-size': `${optionSize}rem`,\n '--grid-fit': `${fit}`,\n '--grid-gap': gap,\n '--grid-height': menuHeight,\n '--grid-hover-height': menuHeightHover,\n });\n }\n\n colorsArray.forEach(x => {\n let [value, label] = typeof x === 'string' ? x.trim().split(':') : [];\n if (x instanceof Color) {\n value = x.toHexString();\n label = value;\n }\n const color = new Color(x instanceof Color ? x : value, format);\n const isActive = color.toString() === getAttribute(input, 'value');\n const active = isActive ? ' active' : '';\n\n const option = createElement({\n tagName: 'li',\n className: `color-option${active}`,\n innerText: `${label || value}`,\n tabIndex: 0,\n role: 'option',\n ariaSelected: isActive ? 'true' : 'false',\n }) as HTMLElement;\n setAttribute(option, 'data-value', `${value}`);\n\n if (isOptionsMenu) {\n setElementStyle(option, { backgroundColor: value });\n }\n\n menu.append(option);\n });\n return menu;\n};\n\nexport default getColorMenu;\n","import {\n getAttribute,\n setAttribute,\n toUpperCase,\n ariaHidden,\n tabindex,\n createElement,\n createElementNS,\n} from '@thednp/shorty';\n\nimport Color from '@thednp/color';\n\nimport getColorForm from './getColorForm';\nimport getColorControls from './getColorControls';\nimport getColorMenu from './getColorMenu';\nimport vHidden from './vHidden';\n\nimport ColorPicker from '../index';\n\n/**\n * Generate HTML markup and update instance properties.\n *\n * @param self\n */\nconst setMarkup = (self: ColorPicker) => {\n const { input, parent, format, id, componentLabels, colorKeywords, colorPresets } = self;\n const colorValue = getAttribute(input, 'value') || '#fff';\n const { nonColors } = Color;\n\n const { toggleLabel, pickerLabel, formatLabel, hexLabel } = componentLabels;\n\n // update color\n const color = nonColors.includes(colorValue) ? '#fff' : colorValue;\n self.color = new Color(color, format);\n\n // set initial controls dimensions\n const formatString = format === 'hex' ? hexLabel : toUpperCase(format);\n\n const pickerBtn = createElement({\n id: `picker-btn-${id}`,\n tagName: 'button',\n className: 'picker-toggle btn-appearance',\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLElement;\n\n pickerBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${pickerLabel}. ${formatLabel}: ${formatString}`,\n }) as HTMLElement,\n );\n\n const pickerDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown picker',\n role: 'group',\n ariaLabelledBy: `picker-btn-${id}`,\n } as Partial & { ariaLabelledBy: string }) as HTMLElement;\n\n const colorControls = getColorControls(self);\n const colorForm = getColorForm(self);\n\n pickerDropdown.append(colorControls, colorForm);\n input.before(pickerBtn);\n parent.append(pickerDropdown);\n\n // set colour key menu template\n if (colorKeywords || colorPresets) {\n const presetsDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown scrollable menu',\n }) as HTMLElement;\n\n // color presets\n if (colorPresets) {\n presetsDropdown.append(getColorMenu(self, colorPresets, 'color-options'));\n }\n\n // explicit defaults [reset, initial, inherit, transparent, currentColor]\n // also custom defaults [default: #069, complementary: #930]\n if (colorKeywords && colorKeywords.length) {\n presetsDropdown.append(getColorMenu(self, colorKeywords, 'color-defaults'));\n }\n\n const presetsBtn = createElement({\n tagName: 'button',\n className: 'menu-toggle btn-appearance',\n tabIndex: -1,\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLElement;\n\n const xmlns = encodeURI('http://www.w3.org/2000/svg');\n const presetsIcon = createElementNS(xmlns, {\n tagName: 'svg',\n }) as HTMLElement;\n setAttribute(presetsIcon, 'xmlns', xmlns);\n setAttribute(presetsIcon, 'viewBox', '0 0 512 512');\n setAttribute(presetsIcon, ariaHidden, 'true');\n\n const path = createElementNS(xmlns, {\n tagName: 'path',\n }) as HTMLElement;\n setAttribute(path, 'd', 'M98,158l157,156L411,158l27,27L255,368L71,185L98,158z');\n setAttribute(path, 'fill', '#fff');\n presetsIcon.append(path);\n presetsBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${toggleLabel}`,\n }) as HTMLElement,\n presetsIcon,\n );\n\n parent.append(presetsBtn, presetsDropdown);\n }\n\n // solve non-colors after settings save\n if (colorKeywords && nonColors.includes(colorValue)) {\n self.value = colorValue;\n }\n setAttribute(input, tabindex, '-1');\n};\n\nexport default setMarkup;\n","import { addListener, removeListener } from '@thednp/event-listener';\n\nimport {\n ariaDescription,\n ariaSelected,\n ariaValueNow,\n ariaValueText,\n ariaExpanded,\n keyArrowDown,\n keyArrowUp,\n keyArrowLeft,\n keyArrowRight,\n keyEnter,\n keySpace,\n keyEscape,\n focusinEvent,\n mouseclickEvent,\n keydownEvent,\n changeEvent,\n touchmoveEvent,\n pointerdownEvent,\n pointermoveEvent,\n pointerupEvent,\n tabindex,\n focusoutEvent,\n resizeEvent,\n keyupEvent,\n scrollEvent,\n dispatchEvent,\n getElementsByClassName,\n closest,\n querySelector,\n getElementTransitionDuration,\n getBoundingClientRect,\n getUID,\n getElementStyle,\n getDocumentElement,\n getDocument,\n ObjectAssign,\n ObjectFromEntries,\n Data,\n getInstance,\n setElementStyle,\n normalizeOptions,\n reflow,\n focus,\n hasClass,\n addClass,\n removeClass,\n setAttribute,\n getAttribute,\n removeAttribute,\n isArray,\n isString,\n getWindow,\n} from '@thednp/shorty';\n\n// ColorPicker Util\n// ================\nimport Color from '@thednp/color';\nimport type { RGBA, HWBA, HSLA, HSVA } from '@thednp/color';\n\nimport ColorPalette from './colorPalette';\nimport colorPickerLabels from './util/colorPickerLabels';\nimport colorNames from './util/colorNames';\nimport isValidJSON from './util/isValidJSON';\nimport setMarkup from './util/setMarkup';\n\nimport ColorPickerOptions from './interface/colorPickerOptions';\nimport ColorPickerLabels from './interface/colorPickerLabels';\nimport type ColorNames from './interface/ColorNames';\nimport { version } from '../../package.json';\n\n// ColorPicker GC\n// ==============\nconst colorPickerString = 'color-picker';\nconst colorPickerSelector = `[data-function=\"${colorPickerString}\"]`;\nconst colorPickerParentSelector = `.${colorPickerString}`;\nconst colorPickerDefaults: ColorPickerOptions = {\n componentLabels: colorPickerLabels,\n colorLabels: colorNames,\n format: 'rgb',\n colorPresets: false,\n colorKeywords: false,\n};\nconst { roundPart, nonColors } = Color;\n\n// ColorPicker Static Methods\n// ==========================\nconst getColorPickerInstance = (element: HTMLInputElement) => getInstance(element, colorPickerString);\nconst initColorPicker = (element: HTMLInputElement) => new ColorPicker(element);\n\n// ColorPicker Private Methods\n// ===========================\n\n/**\n * Add / remove `ColorPicker` main event listeners.\n */\nconst toggleEvents = (self: ColorPicker, action?: boolean) => {\n const fn = action ? addListener : removeListener;\n const { input, pickerToggle, menuToggle } = self;\n\n fn(input, focusinEvent, self.showPicker);\n fn(pickerToggle, mouseclickEvent, self.togglePicker);\n\n if (menuToggle) {\n fn(menuToggle, mouseclickEvent, self.toggleMenu);\n }\n};\n\n/**\n * Add / remove `ColorPicker` event listeners active only when open.\n */\nconst toggleEventsOnShown = (self: ColorPicker, action?: boolean) => {\n const fn = action ? addListener : removeListener;\n const { input, colorMenu, parent } = self;\n const doc = getDocument(input);\n const win = getWindow(doc);\n\n fn(self.controls, pointerdownEvent, self.pointerDown as EventListener);\n self.controlKnobs.forEach(x => fn(x, keydownEvent, self.handleKnobs as EventListener));\n\n fn(win, scrollEvent, self.handleScroll);\n fn(win, resizeEvent, self.update);\n\n [input, ...self.inputs].forEach(x => fn(x, changeEvent, self.changeHandler));\n\n if (colorMenu) {\n fn(colorMenu, mouseclickEvent, self.menuClickHandler);\n fn(colorMenu, keydownEvent, self.menuKeyHandler as EventListener);\n }\n\n fn(doc, pointermoveEvent, self.pointerMove as EventListener);\n fn(doc, pointerupEvent, self.pointerUp as EventListener);\n fn(parent, focusoutEvent, self.handleFocusOut as EventListener);\n fn(doc, keyupEvent, self.handleDismiss as EventListener);\n};\n\n/**\n * Triggers the `ColorPicker` original event.\n */\nconst firePickerChange = (self: ColorPicker) => {\n dispatchEvent(self.input, new CustomEvent('colorpicker.change'));\n};\n\n/**\n * Hides a visible dropdown.\n */\nconst removePosition = (element: HTMLElement) => {\n /* istanbul ignore else */\n if (element) {\n ['bottom', 'top'].forEach(x => removeClass(element, x));\n }\n};\n\n/**\n * Shows a `ColorPicker` dropdown and close the curent open dropdown.\n */\nconst showDropdown = (self: ColorPicker, dropdown: HTMLElement) => {\n const { colorPicker, colorMenu, menuToggle, pickerToggle, parent } = self;\n const isPicker = dropdown === colorPicker;\n const openDropdown = isPicker ? colorMenu : colorPicker;\n const activeBtn = isPicker ? menuToggle : pickerToggle;\n const nextBtn = !isPicker ? menuToggle : pickerToggle;\n\n if (!hasClass(parent, 'open')) {\n addClass(parent, 'open');\n }\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n removePosition(openDropdown);\n }\n addClass(dropdown, 'bottom');\n reflow(dropdown);\n addClass(dropdown, 'show');\n\n if (isPicker) self.update();\n\n if (!self.isOpen) {\n toggleEventsOnShown(self, true);\n self.updateDropdownPosition();\n self.isOpen = true;\n setAttribute(self.input, tabindex, '0');\n if (menuToggle) {\n setAttribute(menuToggle, tabindex, '0');\n }\n }\n\n setAttribute(nextBtn, ariaExpanded, 'true');\n if (activeBtn) {\n setAttribute(activeBtn, ariaExpanded, 'false');\n }\n};\n\n/**\n * Color Picker Web Component\n *\n * @see http://thednp.github.io/color-picker\n */\nexport default class ColorPicker {\n // bring utils to staic\n public static Color = Color;\n public static ColorPalette = ColorPalette;\n public static getInstance = getColorPickerInstance;\n public static init = initColorPicker;\n public static selector = colorPickerSelector;\n // utils important for render\n public static roundPart = roundPart;\n public static setElementStyle = setElementStyle;\n public static setAttribute = setAttribute;\n public static getBoundingClientRect = getBoundingClientRect;\n public static version = version;\n public static colorNames = colorNames;\n public static colorPickerLabels = colorPickerLabels;\n\n id: number;\n input: HTMLInputElement;\n color: Color;\n format = 'rgb';\n parent: HTMLElement;\n dragElement: HTMLElement | undefined;\n isOpen = false;\n controlPositions: {\n c1x: number;\n c1y: number;\n c2y: number;\n c3y: number;\n };\n colorLabels: ColorNames = ObjectFromEntries(colorNames.map(c => [c, c])) as ColorNames;\n colorKeywords: string[] | false;\n colorPresets: ColorPalette | string[] | false;\n componentLabels: ColorPickerLabels;\n pickerToggle: HTMLElement;\n menuToggle: HTMLElement;\n colorPicker: HTMLElement;\n colorMenu: HTMLElement;\n controls: HTMLElement;\n inputs: HTMLInputElement[];\n controlKnobs: HTMLElement[];\n visuals: HTMLElement[];\n\n /**\n * Returns a new `ColorPicker` instance. The target of this constructor\n * must be an `HTMLInputElement`.\n *\n * @param target the target `` element\n * @param config instance options\n */\n constructor(target: (HTMLElement & HTMLInputElement) | string, config?: Partial) {\n const input = querySelector(target) as HTMLInputElement;\n\n // invalidate\n if (typeof target === 'undefined') throw new TypeError(`ColorPicker target not specified.`);\n if (isString(target) && !input) throw new TypeError(`ColorPicker target \"${target}\" cannot be found.`);\n this.input = input;\n\n const parent = closest(input, colorPickerParentSelector);\n if (!parent) throw new TypeError('ColorPicker requires a specific markup to work.');\n\n this.parent = parent;\n this.id = getUID(input, colorPickerString);\n this.dragElement = undefined;\n this.isOpen = false;\n this.controlPositions = {\n c1x: 0,\n c1y: 0,\n c2y: 0,\n c3y: 0,\n };\n // this.colorLabels = {};\n this.colorKeywords = false;\n this.colorPresets = false;\n\n // process options\n const { format, componentLabels, colorLabels, colorKeywords, colorPresets } = normalizeOptions(\n input,\n colorPickerDefaults,\n config || {},\n );\n\n let translatedColorLabels = colorNames;\n /* istanbul ignore else */\n if (isArray(colorLabels) && colorLabels.length === 17) {\n translatedColorLabels = colorLabels;\n } else if (isString(colorLabels) && colorLabels.split(',').length === 17) {\n translatedColorLabels = colorLabels.split(',');\n }\n\n // expose colour labels to all methods\n ObjectAssign(this.colorLabels, ObjectFromEntries(translatedColorLabels.map((c, i) => [colorNames[i], c])));\n\n // update and expose component labels\n const tempComponentLabels =\n isString(componentLabels) && isValidJSON(componentLabels)\n ? (JSON.parse(componentLabels) as ColorPickerLabels)\n : componentLabels;\n this.componentLabels = ObjectAssign({ ...colorPickerLabels }, tempComponentLabels);\n this.color = new Color(input.value || '#fff', format);\n this.format = format;\n\n // set colour defaults\n if (isArray(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords;\n } else if (isString(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords.split(',').map(x => x.trim());\n }\n\n // set colour presets\n if (isArray(colorPresets) && colorPresets.length) {\n this.colorPresets = colorPresets;\n } else if (colorPresets && isValidJSON(colorPresets)) {\n const { hue, hueSteps, lightSteps, saturation } = JSON.parse(colorPresets) as {\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n };\n this.colorPresets = new ColorPalette(hue, hueSteps, lightSteps, saturation);\n } else if (isString(colorPresets)) {\n this.colorPresets = colorPresets.split(',').map((x: string) => x.trim());\n }\n\n // generate markup\n setMarkup(this);\n\n const [colorPicker, colorMenu] = getElementsByClassName('color-dropdown', parent);\n // set main elements\n this.pickerToggle = querySelector('.picker-toggle', parent) as HTMLElement;\n this.menuToggle = querySelector('.menu-toggle', parent) as HTMLElement;\n this.colorPicker = colorPicker;\n this.colorMenu = colorMenu;\n this.inputs = [...getElementsByClassName('color-input', parent)] as HTMLInputElement[];\n const [controls] = getElementsByClassName('color-controls', parent);\n this.controls = controls;\n this.controlKnobs = [...getElementsByClassName('knob', controls)];\n this.visuals = [...getElementsByClassName('visual-control', controls)];\n\n // update colour picker controls, inputs and visuals\n this.update();\n // console.log(this)\n\n // add main events listeners\n toggleEvents(this, true);\n\n // set component data\n Data.set(input, colorPickerString, this);\n }\n\n /** Returns the current colour value */\n get value(): string {\n return this.input.value;\n }\n\n /**\n * Sets a new colour value.\n *\n * @param {string} v new colour value\n */\n set value(v: string) {\n this.input.value = v;\n }\n\n /** Check if the colour presets include any non-colour. */\n get hasNonColor(): boolean {\n return this.colorKeywords instanceof Array && this.colorKeywords.some(x => nonColors.includes(x));\n }\n\n /** Returns hexadecimal value of the current colour. */\n get hex(): string {\n return this.color.toHex(true);\n }\n\n /** Returns the current colour value in {h,s,v,a} object format. */\n get hsv(): HSVA {\n return this.color.toHsv();\n }\n\n /** Returns the current colour value in {h,s,l,a} object format. */\n get hsl(): HSLA {\n return this.color.toHsl();\n }\n\n /** Returns the current colour value in {h,w,b,a} object format. */\n get hwb(): HWBA {\n return this.color.toHwb();\n }\n\n /** Returns the current colour value in {r,g,b,a} object format. */\n get rgb(): RGBA {\n return this.color.toRgb();\n }\n\n /** Returns the current colour brightness. */\n get brightness(): number {\n return this.color.brightness;\n }\n\n /** Returns the current colour luminance. */\n get luminance(): number {\n return this.color.luminance;\n }\n\n /** Checks if the current colour requires a light text colour. */\n get isDark(): boolean {\n const { color, brightness } = this;\n return brightness < 120 && color.a > 0.33;\n }\n\n /** Checks if the current input value is a valid colour. */\n get isValid(): boolean {\n const inputValue = this.input.value;\n return inputValue !== '' && new Color(inputValue).isValid;\n }\n\n /** Returns the colour appearance, usually the closest colour name for the current value. */\n get appearance(): string {\n const { colorLabels, hsl, hsv, format } = this;\n\n const hue = roundPart(hsl.h * 360);\n const saturationSource = format === 'hsl' ? hsl.s : hsv.s;\n const saturation = roundPart(saturationSource * 100);\n const lightness = roundPart(hsl.l * 100);\n const hsvl = hsv.v * 100;\n\n let colorName = 'black';\n\n // determine color appearance\n /* istanbul ignore else */\n if (lightness === 100 && saturation === 0) {\n colorName = colorLabels.white;\n } else if (lightness === 0) {\n colorName = colorLabels.black;\n } else if (saturation === 0) {\n colorName = colorLabels.grey;\n } else if (hue < 15 || hue >= 345) {\n colorName = colorLabels.red;\n } else if (hue >= 15 && hue < 45) {\n colorName = hsvl > 80 && saturation > 80 ? colorLabels.orange : colorLabels.brown;\n } else if (hue >= 45 && hue < 75) {\n const isGold = hue > 46 && hue < 54 && hsvl < 80 && saturation > 90;\n const isOlive = hue >= 54 && hue < 75 && hsvl < 80;\n colorName = isGold ? colorLabels.gold : colorLabels.yellow;\n colorName = isOlive ? colorLabels.olive : colorName;\n } else if (hue >= 75 && hue < 155) {\n colorName = hsvl < 68 ? colorLabels.green : colorLabels.lime;\n } else if (hue >= 155 && hue < 175) {\n colorName = colorLabels.teal;\n } else if (hue >= 175 && hue < 195) {\n colorName = colorLabels.cyan;\n } else if (hue >= 195 && hue < 255) {\n colorName = colorLabels.blue;\n } else if (hue >= 255 && hue < 270) {\n colorName = colorLabels.violet;\n } else if (hue >= 270 && hue < 295) {\n colorName = colorLabels.magenta;\n } else if (hue >= 295 && hue < 345) {\n colorName = colorLabels.pink;\n }\n return colorName;\n }\n\n /** Updates `ColorPicker` visuals. */\n updateVisuals(): void {\n const { controlPositions, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { offsetHeight } = v1;\n const hue = controlPositions.c2y / offsetHeight;\n const { r, g, b } = new Color({ h: hue, s: 1, l: 0.5 }).toRgb();\n const whiteGrad = 'linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)';\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n const roundA = roundPart(alpha * 100) / 100;\n\n const fill = new Color({\n h: hue,\n s: 1,\n l: 0.5,\n a: alpha,\n }).toRgbString();\n const hueGradient = `linear-gradient(\n rgb(255,0,0) 0%, rgb(255,255,0) 16.67%,\n rgb(0,255,0) 33.33%, rgb(0,255,255) 50%,\n rgb(0,0,255) 66.67%, rgb(255,0,255) 83.33%,\n rgb(255,0,0) 100%)`;\n setElementStyle(v1, {\n background: `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,${roundA}) 100%),\n linear-gradient(to right, rgba(255,255,255,${roundA}) 0%, ${fill} 100%),\n ${whiteGrad}`,\n });\n setElementStyle(v2, { background: hueGradient });\n\n setElementStyle(v3, {\n background: `linear-gradient(rgba(${r},${g},${b},1) 0%,rgba(${r},${g},${b},0) 100%)`,\n });\n }\n\n /**\n * The `ColorPicker` *focusout* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleFocusOut = ({ relatedTarget }: FocusEvent & { relatedTarget: HTMLElement }): void => {\n if (relatedTarget && !this.parent.contains(relatedTarget)) {\n this.hide(true);\n }\n };\n\n /**\n * The `ColorPicker` *keyup* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleDismiss = ({ code }: KeyboardEvent): void => {\n if (this.isOpen && code === keyEscape) {\n this.hide();\n }\n };\n\n /**\n * The `ColorPicker` *scroll* event listener when open.\n *\n * @param e\n */\n handleScroll = (e: Event) => {\n const { activeElement } = getDocument(this.input);\n\n this.updateDropdownPosition();\n\n /* istanbul ignore next */\n if (\n ([pointermoveEvent, touchmoveEvent].includes(e.type) && this.dragElement) ||\n (activeElement && this.controlKnobs.includes(activeElement as HTMLElement))\n ) {\n e.stopPropagation();\n e.preventDefault();\n }\n };\n\n /**\n * The `ColorPicker` keyboard event listener for menu navigation.\n *\n * @param e\n */\n menuKeyHandler = (e: KeyboardEvent & { target: HTMLElement }) => {\n const { target, code } = e;\n const { previousElementSibling, nextElementSibling, parentElement } = target;\n const isColorOptionsMenu = parentElement && hasClass(parentElement, 'color-options');\n const allSiblings = parentElement ? [...parentElement.children] : [];\n const columnsCount =\n isColorOptionsMenu && getElementStyle(parentElement, 'grid-template-columns').split(' ').length;\n const currentIndex = allSiblings.indexOf(target);\n const previousElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex - columnsCount];\n const nextElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex + columnsCount];\n\n if ([keyArrowDown, keyArrowUp, keySpace].includes(code)) {\n // prevent scroll when navigating the menu via arrow keys / Space\n e.preventDefault();\n }\n if (isColorOptionsMenu) {\n if (previousElement && code === keyArrowUp) {\n focus(previousElement as HTMLElement);\n } else if (nextElement && code === keyArrowDown) {\n focus(nextElement as HTMLElement);\n } else if (previousElementSibling && code === keyArrowLeft) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && code === keyArrowRight) {\n focus(nextElementSibling as HTMLElement);\n }\n } else if (previousElementSibling && [keyArrowLeft, keyArrowUp].includes(code)) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && [keyArrowRight, keyArrowDown].includes(code)) {\n focus(nextElementSibling as HTMLElement);\n }\n\n if ([keyEnter, keySpace].includes(code)) {\n this.menuClickHandler(e);\n }\n };\n\n /**\n * The `ColorPicker` click event listener for the colour menu presets / defaults.\n *\n * @param e\n * @this {ColorPicker}\n */\n menuClickHandler = (e: Event) => {\n const { target } = e;\n const { colorMenu } = this;\n const newOption = (getAttribute(target as HTMLElement, 'data-value') || '').trim();\n // invalidate for targets other than color options\n if (!newOption.length) return;\n const currentActive = querySelector('li.active', colorMenu);\n let newColor = newOption;\n newColor = nonColors.includes(newColor) ? 'white' : newColor;\n newColor = newColor === 'transparent' ? 'rgba(0,0,0,0)' : newColor;\n\n const { r, g, b, a } = new Color(newColor);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n this.update();\n\n /* istanbul ignore else */\n if (currentActive !== target) {\n /* istanbul ignore else */\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n\n addClass(target as HTMLElement, 'active');\n setAttribute(target as HTMLElement, ariaSelected, 'true');\n\n if (nonColors.includes(newOption)) {\n this.value = newOption;\n }\n firePickerChange(this);\n }\n };\n\n /**\n * The `ColorPicker` *touchstart* / *mousedown* events listener for control knobs.\n *\n * @param e\n */\n pointerDown = (e: PointerEvent & { target: HTMLElement }) => {\n if (e.button !== 0) return;\n const { target, pageX, pageY } = e;\n const { colorMenu, visuals, controlKnobs } = this;\n const [v1, v2, v3] = visuals;\n const [c1, c2, c3] = controlKnobs;\n const visual = controlKnobs.includes(target) ? (target.previousElementSibling as HTMLElement) : target;\n const visualRect = getBoundingClientRect(visual);\n const html = getDocumentElement(v1);\n const offsetX = pageX - html.scrollLeft - visualRect.left;\n const offsetY = pageY - html.scrollTop - visualRect.top;\n\n /* istanbul ignore else */\n if (target === v1 || target === c1) {\n this.dragElement = visual;\n this.changeControl1(offsetX, offsetY);\n } else if (target === v2 || target === c2) {\n this.dragElement = visual;\n this.changeControl2(offsetY);\n } else if (target === v3 || target === c3) {\n this.dragElement = visual;\n this.changeAlpha(offsetY);\n }\n\n if (colorMenu) {\n const currentActive = querySelector('li.active', colorMenu);\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n }\n e.preventDefault();\n };\n\n /**\n * The `ColorPicker` *touchend* / *mouseup* events listener for control knobs.\n *\n * @param e\n * @this\n */\n pointerUp = ({ target }: PointerEvent & { target: HTMLElement }) => {\n const { parent } = this;\n const doc = getDocument(parent);\n const currentOpen = querySelector(`${colorPickerParentSelector}.open`, doc) !== null;\n const selection = doc.getSelection();\n\n if (!this.dragElement && (!selection || !selection.toString().length) && !parent.contains(target)) {\n this.hide(currentOpen);\n }\n\n this.dragElement = undefined;\n };\n\n /**\n * The `ColorPicker` *touchmove* / *mousemove* events listener for control knobs.\n *\n * @param {PointerEvent} e\n */\n pointerMove = (e: PointerEvent) => {\n const { dragElement, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { pageX, pageY } = e;\n\n if (!dragElement) return;\n\n const controlRect = getBoundingClientRect(dragElement);\n const win = getDocumentElement(v1);\n const offsetX = pageX - win.scrollLeft - controlRect.left;\n const offsetY = pageY - win.scrollTop - controlRect.top;\n\n if (dragElement === v1) {\n this.changeControl1(offsetX, offsetY);\n }\n\n if (dragElement === v2) {\n this.changeControl2(offsetY);\n }\n\n if (dragElement === v3) {\n this.changeAlpha(offsetY);\n }\n };\n\n /**\n * The `ColorPicker` *keydown* event listener for control knobs.\n *\n * @param e\n */\n handleKnobs = (e: Event & { code: string }) => {\n const { target, code } = e;\n\n // only react to arrow buttons\n if (![keyArrowUp, keyArrowDown, keyArrowLeft, keyArrowRight].includes(code)) return;\n e.preventDefault();\n\n const { controlKnobs, visuals } = this;\n const { offsetWidth, offsetHeight } = visuals[0];\n const [c1, c2, c3] = controlKnobs;\n const { activeElement } = getDocument(c1);\n const currentKnob = controlKnobs.find(x => x === activeElement);\n const yRatio = offsetHeight / 360;\n\n /* istanbul ignore else */\n if (currentKnob) {\n let offsetX = 0;\n let offsetY = 0;\n\n /* istanbul ignore else */\n if (target === c1) {\n const xRatio = offsetWidth / 100;\n\n /* istanbul ignore else */\n if ([keyArrowLeft, keyArrowRight].includes(code)) {\n this.controlPositions.c1x += code === keyArrowRight ? xRatio : -xRatio;\n } else if ([keyArrowUp, keyArrowDown].includes(code)) {\n this.controlPositions.c1y += code === keyArrowDown ? yRatio : -yRatio;\n }\n\n offsetX = this.controlPositions.c1x;\n offsetY = this.controlPositions.c1y;\n this.changeControl1(offsetX, offsetY);\n } else if (target === c2) {\n this.controlPositions.c2y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c2y;\n this.changeControl2(offsetY);\n } else if (target === c3) {\n this.controlPositions.c3y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c3y;\n this.changeAlpha(offsetY);\n }\n this.handleScroll(e);\n }\n };\n\n /** The event listener of the colour form inputs. */\n changeHandler = (): void => {\n let colorSource;\n const { inputs, format, value: currentValue, input, controlPositions, visuals } = this;\n const { activeElement } = getDocument(input);\n const { offsetHeight } = visuals[0];\n const [i1, , , i4] = inputs;\n const [v1, v2, v3, v4] =\n format === 'rgb'\n ? inputs.map(i => parseFloat(i.value) / (i === i4 ? 100 : 1))\n : inputs.map(i => parseFloat(i.value) / (i !== i1 ? 100 : 360));\n const isNonColorValue = this.hasNonColor && nonColors.includes(currentValue);\n const alpha = i4 ? v4 : 1 - controlPositions.c3y / offsetHeight;\n\n /* istanbul ignore else */\n if (activeElement === input || (activeElement && inputs.includes(activeElement as HTMLInputElement))) {\n if (activeElement === input) {\n if (isNonColorValue) {\n colorSource = currentValue === 'transparent' ? 'rgba(0,0,0,0)' : 'rgb(0,0,0)';\n } else {\n colorSource = currentValue;\n }\n } else if (format === 'hex') {\n colorSource = i1.value;\n } else if (format === 'hsl') {\n colorSource = {\n h: v1,\n s: v2,\n l: v3,\n a: alpha,\n };\n } else if (format === 'hwb') {\n colorSource = {\n h: v1,\n w: v2,\n b: v3,\n a: alpha,\n };\n } else {\n colorSource = {\n r: v1,\n g: v2,\n b: v3,\n a: alpha,\n };\n }\n\n const { r, g, b, a } = new Color(colorSource);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n this.setControlPositions();\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n\n // set non-color keyword\n if (activeElement === input && isNonColorValue) {\n this.value = currentValue;\n }\n }\n };\n\n /**\n * Updates `ColorPicker` first control:\n * * `lightness` and `saturation` for HEX/RGB;\n * * `lightness` and `hue` for HSL.\n *\n * @param X the X component of the offset\n * @param Y the Y component of the offset\n */\n changeControl1(X: number, Y: number): void {\n let [offsetX, offsetY] = [0, 0];\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n if (X > offsetWidth) offsetX = offsetWidth;\n else if (X >= 0) offsetX = X;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = controlPositions.c2y / offsetHeight;\n\n const saturation = offsetX / offsetWidth;\n\n const lightness = 1 - offsetY / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new positions\n this.controlPositions.c1x = offsetX;\n this.controlPositions.c1y = offsetY;\n\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` second control:\n * * `hue` for HEX/RGB/HWB;\n * * `saturation` for HSL.\n *\n * @param Y the Y offset\n */\n changeControl2(Y: number) {\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = offsetY / offsetHeight;\n const saturation = controlPositions.c1x / offsetWidth;\n const lightness = 1 - controlPositions.c1y / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new position\n this.controlPositions.c2y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` last control,\n * the `alpha` channel.\n *\n * @param Y\n */\n changeAlpha(Y: number) {\n const { visuals } = this;\n const { offsetHeight } = visuals[0];\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n // update color alpha\n const alpha = 1 - offsetY / offsetHeight;\n this.color.setAlpha(alpha);\n // update position\n this.controlPositions.c3y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` control positions on:\n * * initialization\n * * window resize\n */\n update = () => {\n this.updateDropdownPosition();\n this.updateAppearance();\n this.setControlPositions();\n this.updateInputs(true);\n this.updateControls();\n this.updateVisuals();\n };\n\n /** Updates the open dropdown position on *scroll* event. */\n updateDropdownPosition() {\n const { input, colorPicker, colorMenu } = this;\n const elRect = getBoundingClientRect(input);\n const { top, bottom } = elRect;\n const { offsetHeight: elHeight } = input;\n const windowHeight = getDocumentElement(input).clientHeight;\n const isPicker = hasClass(colorPicker, 'show');\n const dropdown = isPicker ? colorPicker : colorMenu;\n if (!dropdown) return;\n const { offsetHeight: dropHeight } = dropdown;\n const distanceBottom = windowHeight - bottom;\n const distanceTop = top;\n const bottomExceed = top + dropHeight + elHeight > windowHeight; // show\n const topExceed = top - dropHeight < 0; // show-top\n\n if ((hasClass(dropdown, 'bottom') || !topExceed) && distanceBottom < distanceTop && bottomExceed) {\n removeClass(dropdown, 'bottom');\n addClass(dropdown, 'top');\n } else {\n removeClass(dropdown, 'top');\n addClass(dropdown, 'bottom');\n }\n }\n\n /** Updates control knobs' positions. */\n setControlPositions() {\n const { visuals, color, hsv } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n const alpha = color.a;\n const hue = hsv.h;\n\n const saturation = hsv.s;\n const lightness = hsv.v;\n\n this.controlPositions.c1x = saturation * offsetWidth;\n this.controlPositions.c1y = (1 - lightness) * offsetHeight;\n this.controlPositions.c2y = hue * offsetHeight;\n this.controlPositions.c3y = (1 - alpha) * offsetHeight;\n }\n\n /** Update the visual appearance label and control knob labels. */\n updateAppearance() {\n const { componentLabels, color, parent, hsv, hex, format, controlKnobs } = this;\n const { appearanceLabel, hexLabel, valueLabel } = componentLabels;\n let { r, g, b } = color.toRgb();\n const [knob1, knob2, knob3] = controlKnobs;\n const hue = roundPart(hsv.h * 360);\n const alpha = color.a;\n const saturation = roundPart(hsv.s * 100);\n const lightness = roundPart(hsv.v * 100);\n const colorName = this.appearance;\n\n let colorLabel = `${hexLabel} ${hex.split('').join(' ')}`;\n\n if (format === 'hwb') {\n const { hwb } = this;\n const whiteness = roundPart(hwb.w * 100);\n const blackness = roundPart(hwb.b * 100);\n colorLabel = `HWB: ${hue}°, ${whiteness}%, ${blackness}%`;\n setAttribute(knob1, ariaValueText, `${whiteness}% & ${blackness}%`);\n setAttribute(knob1, ariaValueNow, `${whiteness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}%`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n } else {\n [r, g, b] = [r, g, b].map(roundPart);\n colorLabel = format === 'hsl' ? `HSL: ${hue}°, ${saturation}%, ${lightness}%` : colorLabel;\n colorLabel = format === 'rgb' ? `RGB: ${r}, ${g}, ${b}` : colorLabel;\n\n setAttribute(knob1, ariaValueText, `${lightness}% & ${saturation}%`);\n setAttribute(knob1, ariaValueNow, `${lightness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}°`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n }\n\n const alphaValue = roundPart(alpha * 100);\n setAttribute(knob3, ariaValueText, `${alphaValue}%`);\n setAttribute(knob3, ariaValueNow, `${alphaValue}`);\n\n // update the input backgroundColor\n const newColor = color.toString();\n setElementStyle(this.input, { backgroundColor: newColor });\n\n // toggle dark/light classes will also style the placeholder\n // dark sets color white, light sets color black\n // isDark ? '#000' : '#fff'\n if (!this.isDark) {\n if (hasClass(parent, 'txt-dark')) removeClass(parent, 'txt-dark');\n if (!hasClass(parent, 'txt-light')) addClass(parent, 'txt-light');\n } else {\n if (hasClass(parent, 'txt-light')) removeClass(parent, 'txt-light');\n if (!hasClass(parent, 'txt-dark')) addClass(parent, 'txt-dark');\n }\n }\n\n /** Updates the control knobs actual positions. */\n updateControls() {\n const { controlKnobs, controlPositions } = this;\n let { c1x, c1y, c2y, c3y } = controlPositions;\n const [control1, control2, control3] = controlKnobs;\n // round control positions\n [c1x, c1y, c2y, c3y] = [c1x, c1y, c2y, c3y].map(roundPart);\n\n setElementStyle(control1, {\n transform: `translate3d(${c1x - 4}px,${c1y - 4}px,0)`,\n });\n setElementStyle(control2, { transform: `translate3d(0,${c2y - 4}px,0)` });\n setElementStyle(control3, { transform: `translate3d(0,${c3y - 4}px,0)` });\n }\n\n /**\n * Updates all color form inputs.\n *\n * @param isPrevented when `true`, the component original event is prevented\n */\n updateInputs(isPrevented?: boolean) {\n const { value: oldColor, format, inputs, color, hsl } = this;\n const [i1, i2, i3, i4] = inputs;\n const alpha = roundPart(color.a * 100);\n const hue = roundPart(hsl.h * 360);\n let newColor = color.toString();\n\n /* istanbul ignore else */\n if (format === 'hex') {\n newColor = this.color.toHexString(true);\n i1.value = this.hex;\n } else if (format === 'hsl') {\n const lightness = roundPart(hsl.l * 100);\n const saturation = roundPart(hsl.s * 100);\n newColor = this.color.toHslString();\n i1.value = `${hue}`;\n i2.value = `${saturation}`;\n i3.value = `${lightness}`;\n i4.value = `${alpha}`;\n } else if (format === 'hwb') {\n const { w, b } = this.hwb;\n const whiteness = roundPart(w * 100);\n const blackness = roundPart(b * 100);\n\n newColor = this.color.toHwbString();\n i1.value = `${hue}`;\n i2.value = `${whiteness}`;\n i3.value = `${blackness}`;\n i4.value = `${alpha}`;\n } else if (format === 'rgb') {\n let { r, g, b } = this.rgb;\n [r, g, b] = [r, g, b].map(roundPart);\n\n newColor = this.color.toRgbString();\n i1.value = `${r}`;\n i2.value = `${g}`;\n i3.value = `${b}`;\n i4.value = `${alpha}`;\n }\n\n // update the color value\n this.value = newColor;\n\n // don't trigger the custom event unless it's really changed\n if (!isPrevented && newColor !== oldColor) {\n firePickerChange(this);\n }\n }\n\n /**\n * Toggle the `ColorPicker` dropdown visibility.\n *\n * @param e\n */\n togglePicker = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorPicker } = this;\n\n if (this.isOpen && hasClass(colorPicker, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorPicker);\n }\n };\n\n /** Shows the `ColorPicker` dropdown. */\n showPicker = () => {\n const { colorPicker } = this;\n\n if (!['top', 'bottom'].some(c => hasClass(colorPicker, c))) {\n showDropdown(this, colorPicker);\n }\n };\n\n /**\n * Toggles the visibility of the `ColorPicker` presets menu.\n *\n * @param e\n * @this {ColorPicker}\n */\n toggleMenu = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorMenu } = this;\n\n if (this.isOpen && hasClass(colorMenu, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorMenu);\n }\n };\n\n /**\n * Hides the currently open `ColorPicker` dropdown.\n *\n * @param {boolean=} focusPrevented\n */\n hide(focusPrevented?: boolean) {\n if (this.isOpen) {\n const { pickerToggle, menuToggle, colorPicker, colorMenu, parent, input } = this;\n const openPicker = hasClass(colorPicker, 'show');\n const openDropdown = openPicker ? colorPicker : colorMenu;\n const relatedBtn = openPicker ? pickerToggle : menuToggle;\n const animationDuration = openDropdown && getElementTransitionDuration(openDropdown);\n\n this.value = this.color.toString(true);\n\n /* istanbul ignore else */\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n setAttribute(relatedBtn, ariaExpanded, 'false');\n setTimeout(() => {\n removePosition(openDropdown);\n /* istanbul ignore else */\n if (!querySelector('.show', parent)) {\n removeClass(parent, 'open');\n toggleEventsOnShown(this);\n this.isOpen = false;\n }\n }, animationDuration);\n }\n\n if (!focusPrevented) {\n focus(pickerToggle);\n }\n setAttribute(input, tabindex, '-1');\n if (relatedBtn === menuToggle) {\n setAttribute(menuToggle, tabindex, '-1');\n }\n }\n }\n\n /** Removes `ColorPicker` from target ``. */\n dispose() {\n const { input, parent } = this;\n this.hide(true);\n toggleEvents(this);\n [...parent.children].forEach(el => {\n if (el !== input) el.remove();\n });\n\n removeAttribute(input, tabindex);\n setElementStyle(input, { backgroundColor: '' });\n\n ['txt-light', 'txt-dark'].forEach(c => removeClass(parent, c));\n Data.remove(input, colorPickerString);\n }\n}\n"],"names":["e","f","t","c","i","n","s","o","a","r","E","d","me","ge","Ee","Ae","Ne","ke","K","P","_","tt","st","rt","it","St","Nt","kt","Ct","zt","Bt","Re","Qe","je","qe","Ye","Ze","on","Rt","U","mn","jt","A","qt","S","z","x","M","Gt","Jt","Kt","Xt","Yt","kn","Dn","On","Ln","In","v","u","L","Bn","N","W","R","k","Zt","$t","Q","g","ne","Rn","V","w","oe","Qn","l","p","m","y","j","Jn","Yn","Zn","I","_n","h","T","B","H","b","ae","ie","le","Ao","ko","D","F","rr","tr","O","er","$","Z","J","G","X","C","Y","q","sr","ColorPalette","Color","args","hue","hueSteps","lightSteps","lightnessArray","saturation","colors","hueStep","half","steps1To13","lightSets","closestSet","set","lightStep","currentHue","newColor","colorPickerLabels","colorNames","isValidJSON","str","isString","vHidden","getColorForm","self","format","id","componentLabels","colorForm","createElement","components","toUpperCase","cID","formatLabel","cInputLabel","setAttribute","cInput","max","step","ObjectAssign","getColorControls","hueLabel","alphaLabel","lightnessLabel","saturationLabel","whitenessLabel","blacknessLabel","max1","max2","max3","ctrl1Label","ctrl2Label","colorControls","colorPointer","colorSlider","template","min","control","knob","getColorMenu","colorsSource","menuClass","input","defaultsLabel","presetsLabel","isOptionsMenu","isPalette","menuLabel","colorsArray","colorsCount","fit","isMultiLine","rowCountHover","rowCount","isScrollable","finalClass","gap","optionSize","menuHeight","menuHeightHover","menu","setElementStyle","value","label","isActive","getAttribute","option","setMarkup","parent","colorKeywords","colorPresets","colorValue","nonColors","toggleLabel","pickerLabel","hexLabel","color","formatString","pickerBtn","pickerDropdown","presetsDropdown","presetsBtn","xmlns","presetsIcon","createElementNS","ariaHidden","path","tabindex","colorPickerString","colorPickerSelector","colorPickerParentSelector","colorPickerDefaults","roundPart","getColorPickerInstance","element","getInstance","initColorPicker","ColorPicker","toggleEvents","action","fn","addListener","removeListener","pickerToggle","menuToggle","focusinEvent","mouseclickEvent","toggleEventsOnShown","colorMenu","doc","getDocument","win","getWindow","pointerdownEvent","keydownEvent","scrollEvent","resizeEvent","changeEvent","pointermoveEvent","pointerupEvent","focusoutEvent","keyupEvent","firePickerChange","dispatchEvent","removePosition","removeClass","showDropdown","dropdown","colorPicker","isPicker","openDropdown","activeBtn","nextBtn","hasClass","addClass","reflow","ariaExpanded","getBoundingClientRect","version","ObjectFromEntries","target","config","querySelector","closest","getUID","colorLabels","normalizeOptions","translatedColorLabels","isArray","tempComponentLabels","getElementsByClassName","controls","Data","brightness","inputValue","hsl","hsv","saturationSource","lightness","hsvl","colorName","isGold","isOlive","controlPositions","visuals","v1","v2","v3","offsetHeight","whiteGrad","alpha","roundA","fill","hueGradient","relatedTarget","code","keyEscape","activeElement","touchmoveEvent","previousElementSibling","nextElementSibling","parentElement","isColorOptionsMenu","allSiblings","columnsCount","getElementStyle","currentIndex","previousElement","nextElement","keyArrowDown","keyArrowUp","keySpace","focus","keyArrowLeft","keyArrowRight","keyEnter","newOption","currentActive","removeAttribute","ariaSelected","pageX","pageY","controlKnobs","c1","c2","c3","visual","visualRect","html","getDocumentElement","offsetX","offsetY","currentOpen","selection","dragElement","controlRect","offsetWidth","currentKnob","yRatio","xRatio","colorSource","inputs","currentValue","i1","i4","v4","isNonColorValue","elRect","top","bottom","elHeight","windowHeight","dropHeight","distanceBottom","distanceTop","bottomExceed","topExceed","hex","appearanceLabel","valueLabel","knob1","knob2","knob3","colorLabel","hwb","whiteness","blackness","ariaValueText","ariaValueNow","ariaDescription","alphaValue","c1x","c1y","c2y","c3y","control1","control2","control3","isPrevented","oldColor","i2","i3","focusPrevented","openPicker","relatedBtn","animationDuration","getElementTransitionDuration","el"],"mappings":"wCAAM,MAAAA,EAAI,CAAE,EAAEC,GAAKC,GAAM,CACvB,KAAM,CAAE,KAAMC,EAAG,cAAeC,CAAC,EAAKF,EACtC,CAAC,GAAGF,EAAEG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAACE,EAAGC,CAAC,IAAM,CAC5BF,IAAMC,GAAK,CAAC,GAAGC,CAAC,EAAE,QAAQ,CAAC,CAACC,EAAGC,CAAC,IAAM,CACpCD,EAAE,MAAMF,EAAG,CAACH,CAAC,CAAC,EAAG,OAAOM,GAAK,UAAYA,EAAE,MAAQC,GAAEJ,EAAGF,EAAGI,EAAGC,CAAC,CACrE,CAAK,CACL,CAAG,CACH,EAAGE,GAAI,CAACR,EAAGC,EAAGC,EAAGC,IAAM,CACrBL,EAAEG,CAAC,IAAMH,EAAEG,CAAC,EAAoB,IAAI,KACpC,MAAMG,EAAIN,EAAEG,CAAC,EACbG,EAAE,IAAIJ,CAAC,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,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,GACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,uBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,mBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,oBACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,CACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,MACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,MACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,C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AAE,QAAcuM,GAAA,CAC7BA,IAAOjO,GAAOiO,EAAG,OAAO,CAAA,CAC7B,EAEDrE,GAAgB5J,EAAO6C,CAAQ,EAC/B1B,EAAgBnB,EAAO,CAAE,gBAAiB,EAAI,CAAA,EAE7C,CAAA,YAAa,UAAU,EAAE,WAAamF,EAAYzD,EAAQrM,CAAC,CAAC,EACxDyR,GAAA,OAAO9G,EAAO8C,CAAiB,CACtC,CACF","x_google_ignoreList":[0,1,2]} \ No newline at end of file +{"version":3,"file":"color-picker.js","sources":["../../node_modules/.pnpm/@thednp+shorty@2.0.0-alpha21/node_modules/@thednp/shorty/dist/shorty.mjs","../../node_modules/.pnpm/@thednp+color@1.0.8/node_modules/@thednp/color/dist/index.mjs","../../src/ts/colorPalette.ts","../../src/ts/util/colorPickerLabels.ts","../../src/ts/util/colorNames.ts","../../src/ts/util/isValidJSON.ts","../../src/ts/util/vHidden.ts","../../src/ts/util/getColorForm.ts","../../src/ts/util/getColorControls.ts","../../src/ts/util/getColorMenu.ts","../../src/ts/util/setMarkup.ts","../../src/ts/index.ts"],"sourcesContent":["const pe = \"aria-checked\", me = \"aria-description\", fe = \"aria-describedby\", ge = \"aria-expanded\", ve = \"aria-haspopup\", Ee = \"aria-hidden\", be = \"aria-label\", he = \"aria-labelledby\", ye = \"aria-modal\", we = \"aria-pressed\", Ae = \"aria-selected\", Se = \"aria-valuemin\", Ne = \"aria-valuemax\", ke = \"aria-valuenow\", Me = \"aria-valuetext\", q = \"abort\", G = \"beforeunload\", J = \"blur\", K = \"change\", X = \"contextmenu\", P = \"DOMContentLoaded\", Y = \"DOMMouseScroll\", Z = \"error\", $ = \"focus\", _ = \"focusin\", tt = \"focusout\", et = \"gesturechange\", nt = \"gestureend\", ot = \"gesturestart\", st = \"keydown\", ct = \"keypress\", rt = \"keyup\", at = \"load\", it = \"click\", ut = \"dblclick\", lt = \"mousedown\", dt = \"mouseup\", pt = \"hover\", mt = \"mouseenter\", ft = \"mouseleave\", gt = \"mousein\", vt = \"mouseout\", Et = \"mouseover\", bt = \"mousemove\", ht = \"mousewheel\", yt = \"move\", wt = \"orientationchange\", At = \"pointercancel\", St = \"pointerdown\", Nt = \"pointerleave\", kt = \"pointermove\", Mt = \"pointerup\", Tt = \"readystatechange\", Dt = \"reset\", Ct = \"resize\", Ot = \"select\", Lt = \"selectend\", It = \"selectstart\", zt = \"scroll\", xt = \"submit\", Vt = \"touchstart\", Bt = \"touchmove\", Ht = \"touchcancel\", Pt = \"touchend\", Ft = \"unload\", Te = {\n DOMContentLoaded: P,\n DOMMouseScroll: Y,\n abort: q,\n beforeunload: G,\n blur: J,\n change: K,\n click: it,\n contextmenu: X,\n dblclick: ut,\n error: Z,\n focus: $,\n focusin: _,\n focusout: tt,\n gesturechange: et,\n gestureend: nt,\n gesturestart: ot,\n hover: pt,\n keydown: st,\n keypress: ct,\n keyup: rt,\n load: at,\n mousedown: lt,\n mousemove: bt,\n mousein: gt,\n mouseout: vt,\n mouseenter: mt,\n mouseleave: ft,\n mouseover: Et,\n mouseup: dt,\n mousewheel: ht,\n move: yt,\n orientationchange: wt,\n pointercancel: At,\n pointerdown: St,\n pointerleave: Nt,\n pointermove: kt,\n pointerup: Mt,\n readystatechange: Tt,\n reset: Dt,\n resize: Ct,\n scroll: zt,\n select: Ot,\n selectend: Lt,\n selectstart: It,\n submit: xt,\n touchcancel: Ht,\n touchend: Pt,\n touchmove: Bt,\n touchstart: Vt,\n unload: Ft\n}, De = \"drag\", Ce = \"dragstart\", Oe = \"dragenter\", Le = \"dragleave\", Ie = \"dragover\", ze = \"dragend\", xe = \"loadstart\", Ve = {\n start: \"mousedown\",\n end: \"mouseup\",\n move: \"mousemove\",\n cancel: \"mouseleave\"\n}, Be = { down: \"mousedown\", up: \"mouseup\" }, He = \"onmouseleave\" in document ? [\"mouseenter\", \"mouseleave\"] : (\n /* istanbul ignore next */\n [\"mouseover\", \"mouseout\"]\n), Pe = {\n start: \"touchstart\",\n end: \"touchend\",\n move: \"touchmove\",\n cancel: \"touchcancel\"\n}, Fe = { in: \"focusin\", out: \"focusout\" }, Ue = {\n Backspace: \"Backspace\",\n // 8\n Tab: \"Tab\",\n // 9\n Enter: \"Enter\",\n // 13\n Shift: \"Shift\",\n // 16\n Control: \"Control\",\n // 17\n Alt: \"Alt\",\n // 18\n Pause: \"Pause\",\n // 19\n CapsLock: \"CapsLock\",\n // 20\n Escape: \"Escape\",\n // 27\n Scape: \"Space\",\n // 32\n ArrowLeft: \"ArrowLeft\",\n // 37\n ArrowUp: \"ArrowUp\",\n // 38\n ArrowRight: \"ArrowRight\",\n // 39\n ArrowDown: \"ArrowDown\",\n // 40\n Insert: \"Insert\",\n // 45\n Delete: \"Delete\",\n // 46\n Meta: \"Meta\",\n // 91 windows key\n ContextMenu: \"ContextMenu\",\n // 93\n ScrollLock: \"ScrollLock\"\n // 145\n}, We = \"Alt\", Re = \"ArrowDown\", Qe = \"ArrowUp\", je = \"ArrowLeft\", qe = \"ArrowRight\", Ge = \"Backspace\", Je = \"CapsLock\", Ke = \"Control\", Xe = \"Delete\", Ye = \"Enter\", Ze = \"NumpadEnter\", $e = \"Escape\", _e = \"Insert\", tn = \"Meta\", en = \"Pause\", nn = \"ScrollLock\", on = \"Shift\", sn = \"Space\", cn = \"Tab\", Ut = \"animationDuration\", Wt = \"animationDelay\", F = \"animationName\", D = \"animationend\", Rt = \"transitionDuration\", Qt = \"transitionDelay\", C = \"transitionend\", U = \"transitionProperty\", rn = \"addEventListener\", an = \"removeEventListener\", un = {\n linear: \"linear\",\n easingSinusoidalIn: \"cubic-bezier(0.47,0,0.745,0.715)\",\n easingSinusoidalOut: \"cubic-bezier(0.39,0.575,0.565,1)\",\n easingSinusoidalInOut: \"cubic-bezier(0.445,0.05,0.55,0.95)\",\n easingQuadraticIn: \"cubic-bezier(0.550,0.085,0.680,0.530)\",\n easingQuadraticOut: \"cubic-bezier(0.250,0.460,0.450,0.940)\",\n easingQuadraticInOut: \"cubic-bezier(0.455,0.030,0.515,0.955)\",\n easingCubicIn: \"cubic-bezier(0.55,0.055,0.675,0.19)\",\n easingCubicOut: \"cubic-bezier(0.215,0.61,0.355,1)\",\n easingCubicInOut: \"cubic-bezier(0.645,0.045,0.355,1)\",\n easingQuarticIn: \"cubic-bezier(0.895,0.03,0.685,0.22)\",\n easingQuarticOut: \"cubic-bezier(0.165,0.84,0.44,1)\",\n easingQuarticInOut: \"cubic-bezier(0.77,0,0.175,1)\",\n easingQuinticIn: \"cubic-bezier(0.755,0.05,0.855,0.06)\",\n easingQuinticOut: \"cubic-bezier(0.23,1,0.32,1)\",\n easingQuinticInOut: \"cubic-bezier(0.86,0,0.07,1)\",\n easingExponentialIn: \"cubic-bezier(0.95,0.05,0.795,0.035)\",\n easingExponentialOut: \"cubic-bezier(0.19,1,0.22,1)\",\n easingExponentialInOut: \"cubic-bezier(1,0,0,1)\",\n easingCircularIn: \"cubic-bezier(0.6,0.04,0.98,0.335)\",\n easingCircularOut: \"cubic-bezier(0.075,0.82,0.165,1)\",\n easingCircularInOut: \"cubic-bezier(0.785,0.135,0.15,0.86)\",\n easingBackIn: \"cubic-bezier(0.6,-0.28,0.735,0.045)\",\n easingBackOut: \"cubic-bezier(0.175,0.885,0.32,1.275)\",\n easingBackInOut: \"cubic-bezier(0.68,-0.55,0.265,1.55)\"\n}, ln = \"offsetHeight\", dn = \"offsetWidth\", pn = \"scrollHeight\", mn = \"scrollWidth\", fn = \"tabindex\", jt = navigator.userAgentData, A = jt, { userAgent: qt } = navigator, S = qt, z = /iPhone|iPad|iPod|Android/i;\nlet O = !1;\nA ? O = A.brands.some((t) => z.test(t.brand)) : O = z.test(S);\nconst gn = O, x = /(iPhone|iPod|iPad)/, vn = A ? A.brands.some((t) => x.test(t.brand)) : (\n /* istanbul ignore next */\n x.test(S)\n), En = S ? S.includes(\"Firefox\") : (\n /* istanbul ignore next */\n !1\n), { head: N } = document, bn = [\"webkitPerspective\", \"perspective\"].some((t) => t in N.style), Gt = (t, e, n, o) => {\n const s = o || !1;\n t.addEventListener(e, n, s);\n}, Jt = (t, e, n, o) => {\n const s = o || !1;\n t.removeEventListener(e, n, s);\n}, Kt = (t, e, n, o) => {\n const s = (r) => {\n (r.target === t || r.currentTarget === t) && (n.apply(t, [r]), Jt(t, e, s, o));\n };\n Gt(t, e, s, o);\n}, Xt = () => {\n}, hn = (() => {\n let t = !1;\n try {\n const e = Object.defineProperty({}, \"passive\", {\n get: () => (t = !0, t)\n });\n Kt(document, P, Xt, e);\n } catch {\n }\n return t;\n})(), yn = [\"webkitTransform\", \"transform\"].some((t) => t in N.style), wn = \"ontouchstart\" in window || /* istanbul ignore next */\n\"msMaxTouchPoints\" in navigator, An = [\"webkitAnimation\", \"animation\"].some((t) => t in N.style), Sn = [\"webkitTransition\", \"transition\"].some((t) => t in N.style), Yt = (t, e) => t.getAttribute(e), Nn = (t, e, n) => e.getAttributeNS(t, n), kn = (t, e) => t.hasAttribute(e), Mn = (t, e, n) => e.hasAttributeNS(t, n), Tn = (t, e, n) => t.setAttribute(e, n), Dn = (t, e, n, o) => e.setAttributeNS(t, n, o), Cn = (t, e) => t.removeAttribute(e), On = (t, e, n) => e.removeAttributeNS(t, n), Ln = (t, ...e) => {\n t.classList.add(...e);\n}, In = (t, ...e) => {\n t.classList.remove(...e);\n}, zn = (t, e) => t.classList.contains(e), { body: xn } = document, { documentElement: Vn } = document, Bn = (t) => Array.from(t), v = (t) => t != null && typeof t == \"object\" || !1, i = (t) => v(t) && typeof t.nodeType == \"number\" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some((e) => t.nodeType === e) || !1, u = (t) => i(t) && t.nodeType === 1 || !1, E = /* @__PURE__ */ new Map(), L = {\n data: E,\n /**\n * Sets web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @param instance the component instance\n */\n set: (t, e, n) => {\n if (!u(t))\n return;\n E.has(e) || E.set(e, /* @__PURE__ */ new Map()), E.get(e).set(t, n);\n },\n /**\n * Returns all instances for specified component.\n *\n * @param component the component's name or a unique key\n * @returns all the component instances\n */\n getAllFor: (t) => E.get(t) || null,\n /**\n * Returns the instance associated with the target.\n *\n * @param element target element\n * @param component the component's name or a unique key\n * @returns the instance\n */\n get: (t, e) => {\n if (!u(t) || !e)\n return null;\n const n = L.getAllFor(e);\n return t && n && n.get(t) || null;\n },\n /**\n * Removes web components data.\n *\n * @param element target element\n * @param component the component's name or a unique key\n */\n remove: (t, e) => {\n const n = L.getAllFor(e);\n !n || !u(t) || (n.delete(t), n.size === 0 && E.delete(e));\n }\n}, Hn = (t, e) => L.get(t, e), k = (t) => typeof t == \"string\" || !1, W = (t) => v(t) && t.constructor.name === \"Window\" || !1, R = (t) => i(t) && t.nodeType === 9 || !1, d = (t) => W(t) ? t.document : R(t) ? t : i(t) ? t.ownerDocument : window.document, M = (t, ...e) => Object.assign(t, ...e), Zt = (t) => {\n if (!t)\n return;\n if (k(t))\n return d().createElement(t);\n const { tagName: e } = t, n = Zt(e);\n if (!n)\n return;\n const o = { ...t };\n return delete o.tagName, M(n, o);\n}, $t = (t, e) => {\n if (!t || !e)\n return;\n if (k(e))\n return d().createElementNS(t, e);\n const { tagName: n } = e, o = $t(t, n);\n if (!o)\n return;\n const s = { ...e };\n return delete s.tagName, M(o, s);\n}, Q = (t, e) => t.dispatchEvent(e), Pn = (t, e, n) => n.indexOf(t) === e, g = (t, e) => {\n const n = getComputedStyle(t), o = e.replace(\"webkit\", \"Webkit\").replace(/([A-Z])/g, \"-$1\").toLowerCase();\n return n.getPropertyValue(o);\n}, _t = (t) => {\n const e = g(t, F), n = g(t, Wt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, te = (t) => {\n const e = g(t, F), n = g(t, Ut), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : 0;\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Fn = (t, e) => {\n let n = 0;\n const o = new Event(D), s = te(t), r = _t(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(D, a), n = 1);\n };\n t.addEventListener(D, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, ee = (t) => {\n const e = g(t, U), n = g(t, Qt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, ne = (t) => {\n const e = g(t, U), n = g(t, Rt), o = n.includes(\"ms\") ? (\n /* istanbul ignore next */\n 1\n ) : 1e3, s = e && e !== \"none\" ? parseFloat(n) * o : (\n /* istanbul ignore next */\n 0\n );\n return Number.isNaN(s) ? (\n /* istanbul ignore next */\n 0\n ) : s;\n}, Un = (t, e) => {\n let n = 0;\n const o = new Event(C), s = ne(t), r = ee(t);\n if (s) {\n const a = (l) => {\n l.target === t && (e.apply(t, [l]), t.removeEventListener(C, a), n = 1);\n };\n t.addEventListener(C, a), setTimeout(() => {\n n || Q(t, o);\n }, s + r + 17);\n } else\n e.apply(t, [o]);\n}, Wn = (t) => Float32Array.from(Array.from(t)), Rn = (t) => Float64Array.from(Array.from(t)), Qn = (t, e) => t.focus(e), V = (t) => [\"true\", !0].includes(t) ? !0 : [\"false\", !1].includes(t) ? !1 : [\"null\", \"\", null, void 0].includes(t) ? null : t !== \"\" && !Number.isNaN(+t) ? +t : t, w = (t) => Object.entries(t), oe = (t) => t.toLowerCase(), jn = (t, e, n, o) => {\n const s = { ...n }, r = { ...t.dataset }, a = { ...e }, l = {}, p = \"title\";\n return w(r).forEach(([c, m]) => {\n const y = o && typeof c == \"string\" && c.includes(o) ? c.replace(o, \"\").replace(/[A-Z]/g, (j) => oe(j)) : c;\n l[y] = V(m);\n }), w(s).forEach(([c, m]) => {\n s[c] = V(m);\n }), w(e).forEach(([c, m]) => {\n c in s ? a[c] = s[c] : c in l ? a[c] = l[c] : a[c] = c === p ? Yt(t, p) : m;\n }), a;\n}, qn = (t, e) => v(t) && (Object.hasOwn(t, e) || e in t), Gn = (t) => Object.keys(t), Jn = (t) => Object.values(t), Kn = (t) => Object.fromEntries(t), Xn = (t, e) => {\n const n = new CustomEvent(t, {\n cancelable: !0,\n bubbles: !0\n });\n return v(e) && M(n, e), n;\n}, Yn = { passive: !0 }, Zn = (t) => t.offsetHeight, $n = (t, e) => {\n w(e).forEach(([n, o]) => {\n if (o && k(n) && n.includes(\"--\"))\n t.style.setProperty(n, o);\n else {\n const s = {};\n s[n] = o, M(t.style, s);\n }\n });\n}, I = (t) => v(t) && t.constructor.name === \"Map\" || !1, se = (t) => typeof t == \"number\" || !1, f = /* @__PURE__ */ new Map(), _n = {\n /**\n * Sets a new timeout timer for an element, or element -> key association.\n *\n * @param element target element\n * @param callback the callback\n * @param delay the execution delay\n * @param key a unique key\n */\n set: (t, e, n, o) => {\n u(t) && (o && o.length ? (f.has(t) || f.set(t, /* @__PURE__ */ new Map()), f.get(t).set(o, setTimeout(e, n))) : f.set(t, setTimeout(e, n)));\n },\n /**\n * Returns the timer associated with the target.\n *\n * @param element target element\n * @param key a unique\n * @returns the timer\n */\n get: (t, e) => {\n if (!u(t))\n return null;\n const n = f.get(t);\n return e && n && I(n) ? n.get(e) || /* istanbul ignore next */\n null : se(n) ? n : null;\n },\n /**\n * Clears the element's timer.\n *\n * @param element target element\n * @param key a unique key\n */\n clear: (t, e) => {\n if (!u(t))\n return;\n const n = f.get(t);\n e && e.length && I(n) ? (clearTimeout(n.get(e)), n.delete(e), n.size === 0 && f.delete(t)) : (clearTimeout(n), f.delete(t));\n }\n}, to = (t) => t.toUpperCase(), h = (t, e) => {\n const { width: n, height: o, top: s, right: r, bottom: a, left: l } = t.getBoundingClientRect();\n let p = 1, c = 1;\n if (e && u(t)) {\n const { offsetWidth: m, offsetHeight: y } = t;\n p = m > 0 ? Math.round(n) / m : (\n /* istanbul ignore next */\n 1\n ), c = y > 0 ? Math.round(o) / y : (\n /* istanbul ignore next */\n 1\n );\n }\n return {\n width: n / p,\n height: o / c,\n top: s / c,\n right: r / p,\n bottom: a / c,\n left: l / p,\n x: l / p,\n y: s / c\n };\n}, eo = (t) => d(t).body, T = (t) => d(t).documentElement, no = (t) => d(t).head, oo = (t) => {\n const e = W(t), n = e ? t.scrollX : t.scrollLeft, o = e ? t.scrollY : t.scrollTop;\n return { x: n, y: o };\n}, ce = (t) => i(t) && t.constructor.name === \"ShadowRoot\" || !1, so = (t) => t.nodeName === \"HTML\" ? t : u(t) && t.assignedSlot || // step into the shadow DOM of the parent of a slotted node\ni(t) && t.parentNode || // DOM Element detected\nce(t) && t.host || // ShadowRoot detected\nT(t), re = (t) => {\n if (!u(t))\n return !1;\n const { width: e, height: n } = h(t), { offsetWidth: o, offsetHeight: s } = t;\n return Math.round(e) !== o || Math.round(n) !== s;\n}, co = (t, e, n) => {\n const o = u(e), s = h(t, o && re(e)), r = { x: 0, y: 0 };\n if (o) {\n const a = h(e, !0);\n r.x = a.x + e.clientLeft, r.y = a.y + e.clientTop;\n }\n return {\n x: s.left + n.x - r.x,\n y: s.top + n.y - r.y,\n width: s.width,\n height: s.height\n };\n};\nlet B = 0, H = 0;\nconst b = /* @__PURE__ */ new Map(), ae = (t, e) => {\n let n = e ? B : H;\n if (e) {\n const o = ae(t), s = b.get(o) || /* @__PURE__ */ new Map();\n b.has(o) || b.set(o, s), I(s) && !s.has(e) ? (s.set(e, n), B += 1) : n = s.get(e);\n } else {\n const o = t.id || t;\n b.has(o) ? n = b.get(o) : (b.set(o, n), H += 1);\n }\n return n;\n}, ro = (t) => {\n var e;\n return t ? R(t) ? t.defaultView : i(t) ? (e = t == null ? void 0 : t.ownerDocument) == null ? void 0 : e.defaultView : t : window;\n}, ie = (t) => Array.isArray(t) || !1, ao = (t) => i(t) && t.nodeName === \"CANVAS\" || !1, ue = (t) => u(t) && !!t.shadowRoot || !1, io = (t) => i(t) && [1, 2, 3, 4, 5, 6, 7, 8].some((e) => t.nodeType === e) || !1, uo = (t) => {\n if (!i(t))\n return !1;\n const { top: e, bottom: n } = h(t), { clientHeight: o } = T(t);\n return e <= o && n >= 0;\n}, lo = (t) => {\n if (!i(t))\n return !1;\n const { clientWidth: e, clientHeight: n } = T(t), { top: o, left: s, bottom: r, right: a } = h(t, !0);\n return o >= 0 && s >= 0 && r <= n && a <= e;\n}, po = (t) => ie(t) && t.every(u) || !1, mo = (t) => typeof t == \"function\" || !1, fo = (t) => v(t) && t.constructor.name === \"HTMLCollection\" || !1, go = (t) => u(t) && t.tagName === \"IMG\" || !1, vo = (t) => {\n if (!k(t))\n return !1;\n try {\n JSON.parse(t);\n } catch {\n return !1;\n }\n return !0;\n}, Eo = (t) => v(t) && t.constructor.name === \"WeakMap\" || !1, bo = (t) => i(t) && [\"SVG\", \"Image\", \"Video\", \"Canvas\"].some((e) => t.constructor.name.includes(e)) || !1, ho = (t) => v(t) && t.constructor.name === \"NodeList\" || !1, yo = (t) => T(t).dir === \"rtl\", wo = (t) => i(t) && t.constructor.name.includes(\"SVG\") || !1, Ao = (t) => i(t) && [\"TABLE\", \"TD\", \"TH\"].includes(t.nodeName) || !1, le = (t, e) => t ? t.closest(e) || // break out of `ShadowRoot`\nle(t.getRootNode().host, e) : null, So = (t, e) => u(t) ? t : (i(e) ? e : d()).querySelector(t), de = (t, e) => (i(e) ? e : d()).getElementsByTagName(t), No = (t) => [...de(\"*\", t)].filter(ue), ko = (t, e) => d(e).getElementById(t) || null, Mo = (t, e) => (i(e) ? e : d()).querySelectorAll(t), To = (t, e) => (e && i(e) ? e : d()).getElementsByClassName(\n t\n), Do = (t, e) => t.matches(e), Co = \"2.0.0alpha21\";\nexport {\n Bn as ArrayFrom,\n P as DOMContentLoadedEvent,\n Y as DOMMouseScrollEvent,\n L as Data,\n Wn as Float32ArrayFrom,\n Rn as Float64ArrayFrom,\n M as ObjectAssign,\n w as ObjectEntries,\n Kn as ObjectFromEntries,\n qn as ObjectHasOwn,\n Gn as ObjectKeys,\n Jn as ObjectValues,\n _n as Timer,\n q as abortEvent,\n Ln as addClass,\n rn as addEventListener,\n Wt as animationDelay,\n Ut as animationDuration,\n D as animationEndEvent,\n F as animationName,\n pe as ariaChecked,\n fe as ariaDescribedBy,\n me as ariaDescription,\n ge as ariaExpanded,\n ve as ariaHasPopup,\n Ee as ariaHidden,\n be as ariaLabel,\n he as ariaLabelledBy,\n ye as ariaModal,\n we as ariaPressed,\n Ae as ariaSelected,\n Ne as ariaValueMax,\n Se as ariaValueMin,\n ke as ariaValueNow,\n Me as ariaValueText,\n G as beforeunloadEvent,\n un as bezierEasings,\n J as blurEvent,\n K as changeEvent,\n le as closest,\n X as contextmenuEvent,\n Xn as createCustomEvent,\n Zt as createElement,\n $t as createElementNS,\n Q as dispatchEvent,\n Pn as distinct,\n xn as documentBody,\n Vn as documentElement,\n N as documentHead,\n De as dragEvent,\n ze as dragendEvent,\n Oe as dragenterEvent,\n Le as dragleaveEvent,\n Ie as dragoverEvent,\n Ce as dragstartEvent,\n Fn as emulateAnimationEnd,\n Un as emulateTransitionEnd,\n Z as errorEvent,\n Qn as focus,\n $ as focusEvent,\n Fe as focusEvents,\n _ as focusinEvent,\n tt as focusoutEvent,\n et as gesturechangeEvent,\n nt as gestureendEvent,\n ot as gesturestartEvent,\n Yt as getAttribute,\n Nn as getAttributeNS,\n h as getBoundingClientRect,\n No as getCustomElements,\n d as getDocument,\n eo as getDocumentBody,\n T as getDocumentElement,\n no as getDocumentHead,\n _t as getElementAnimationDelay,\n te as getElementAnimationDuration,\n ko as getElementById,\n g as getElementStyle,\n ee as getElementTransitionDelay,\n ne as getElementTransitionDuration,\n To as getElementsByClassName,\n de as getElementsByTagName,\n Hn as getInstance,\n oo as getNodeScroll,\n so as getParentNode,\n co as getRectRelativeToOffsetParent,\n ae as getUID,\n ro as getWindow,\n kn as hasAttribute,\n Mn as hasAttributeNS,\n zn as hasClass,\n vn as isApple,\n ie as isArray,\n ao as isCanvas,\n ue as isCustomElement,\n R as isDocument,\n io as isElement,\n uo as isElementInScrollRange,\n lo as isElementInViewport,\n po as isElementsArray,\n En as isFirefox,\n mo as isFunction,\n fo as isHTMLCollection,\n u as isHTMLElement,\n go as isHTMLImageElement,\n vo as isJSON,\n I as isMap,\n bo as isMedia,\n gn as isMobile,\n i as isNode,\n ho as isNodeList,\n se as isNumber,\n v as isObject,\n yo as isRTL,\n wo as isSVGElement,\n re as isScaledElement,\n ce as isShadowRoot,\n k as isString,\n Ao as isTableElement,\n Eo as isWeakMap,\n W as isWindow,\n We as keyAlt,\n Re as keyArrowDown,\n je as keyArrowLeft,\n qe as keyArrowRight,\n Qe as keyArrowUp,\n Ge as keyBackspace,\n Je as keyCapsLock,\n Ke as keyControl,\n Xe as keyDelete,\n Ye as keyEnter,\n $e as keyEscape,\n _e as keyInsert,\n tn as keyMeta,\n Ze as keyNumpadEnter,\n en as keyPause,\n nn as keyScrollLock,\n on as keyShift,\n sn as keySpace,\n cn as keyTab,\n Ue as keyboardEventKeys,\n st as keydownEvent,\n ct as keypressEvent,\n rt as keyupEvent,\n at as loadEvent,\n xe as loadstartEvent,\n Do as matches,\n Be as mouseClickEvents,\n He as mouseHoverEvents,\n Ve as mouseSwipeEvents,\n it as mouseclickEvent,\n ut as mousedblclickEvent,\n lt as mousedownEvent,\n mt as mouseenterEvent,\n pt as mousehoverEvent,\n gt as mouseinEvent,\n ft as mouseleaveEvent,\n bt as mousemoveEvent,\n vt as mouseoutEvent,\n Et as mouseoverEvent,\n dt as mouseupEvent,\n ht as mousewheelEvent,\n yt as moveEvent,\n Te as nativeEvents,\n Xt as noop,\n jn as normalizeOptions,\n V as normalizeValue,\n Jt as off,\n ln as offsetHeight,\n dn as offsetWidth,\n Gt as on,\n Kt as one,\n wt as orientationchangeEvent,\n Yn as passiveHandler,\n At as pointercancelEvent,\n St as pointerdownEvent,\n Nt as pointerleaveEvent,\n kt as pointermoveEvent,\n Mt as pointerupEvent,\n So as querySelector,\n Mo as querySelectorAll,\n Tt as readystatechangeEvent,\n Zn as reflow,\n Cn as removeAttribute,\n On as removeAttributeNS,\n In as removeClass,\n an as removeEventListener,\n Dt as resetEvent,\n Ct as resizeEvent,\n zt as scrollEvent,\n pn as scrollHeight,\n mn as scrollWidth,\n Ot as selectEvent,\n Lt as selectendEvent,\n It as selectstartEvent,\n Tn as setAttribute,\n Dn as setAttributeNS,\n $n as setElementStyle,\n xt as submitEvent,\n bn as support3DTransform,\n An as supportAnimation,\n hn as supportPassive,\n wn as supportTouch,\n yn as supportTransform,\n Sn as supportTransition,\n fn as tabindex,\n oe as toLowerCase,\n to as toUpperCase,\n Pe as touchEvents,\n Ht as touchcancelEvent,\n Pt as touchendEvent,\n Bt as touchmoveEvent,\n Vt as touchstartEvent,\n Qt as transitionDelay,\n Rt as transitionDuration,\n C as transitionEndEvent,\n U as transitionProperty,\n Ft as unloadEvent,\n S as userAgent,\n A as userAgentData,\n Co as version\n};\n//# sourceMappingURL=shorty.mjs.map\n","const N = [\"transparent\", \"currentColor\", \"inherit\", \"revert\", \"initial\"], b = (o) => {\n const t = Math.floor(o);\n return o - t < 0.5 ? t : Math.round(o);\n}, T = [\n [\n \"aliceblue\",\n {\n r: 240,\n g: 248,\n b: 255\n }\n ],\n [\n \"antiquewhite\",\n {\n r: 250,\n g: 235,\n b: 215\n }\n ],\n [\n \"aqua\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"aquamarine\",\n {\n r: 127,\n g: 255,\n b: 212\n }\n ],\n [\n \"azure\",\n {\n r: 240,\n g: 255,\n b: 255\n }\n ],\n [\n \"beige\",\n {\n r: 245,\n g: 245,\n b: 220\n }\n ],\n [\n \"bisque\",\n {\n r: 255,\n g: 228,\n b: 196\n }\n ],\n [\n \"black\",\n {\n r: 0,\n g: 0,\n b: 0\n }\n ],\n [\n \"blanchedalmond\",\n {\n r: 255,\n g: 235,\n b: 205\n }\n ],\n [\n \"blue\",\n {\n r: 0,\n g: 0,\n b: 255\n }\n ],\n [\n \"blueviolet\",\n {\n r: 138,\n g: 43,\n b: 226\n }\n ],\n [\n \"brown\",\n {\n r: 165,\n g: 42,\n b: 42\n }\n ],\n [\n \"burlywood\",\n {\n r: 222,\n g: 184,\n b: 135\n }\n ],\n [\n \"cadetblue\",\n {\n r: 95,\n g: 158,\n b: 160\n }\n ],\n [\n \"chartreuse\",\n {\n r: 127,\n g: 255,\n b: 0\n }\n ],\n [\n \"chocolate\",\n {\n r: 210,\n g: 105,\n b: 30\n }\n ],\n [\n \"coral\",\n {\n r: 255,\n g: 127,\n b: 80\n }\n ],\n [\n \"cornflowerblue\",\n {\n r: 100,\n g: 149,\n b: 237\n }\n ],\n [\n \"cornsilk\",\n {\n r: 255,\n g: 248,\n b: 220\n }\n ],\n [\n \"crimson\",\n {\n r: 220,\n g: 20,\n b: 60\n }\n ],\n [\n \"cyan\",\n {\n r: 0,\n g: 255,\n b: 255\n }\n ],\n [\n \"darkblue\",\n {\n r: 0,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkcyan\",\n {\n r: 0,\n g: 139,\n b: 139\n }\n ],\n [\n \"darkgoldenrod\",\n {\n r: 184,\n g: 134,\n b: 11\n }\n ],\n [\n \"darkgray\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkgreen\",\n {\n r: 0,\n g: 100,\n b: 0\n }\n ],\n [\n \"darkgrey\",\n {\n r: 169,\n g: 169,\n b: 169\n }\n ],\n [\n \"darkkhaki\",\n {\n r: 189,\n g: 183,\n b: 107\n }\n ],\n [\n \"darkmagenta\",\n {\n r: 139,\n g: 0,\n b: 139\n }\n ],\n [\n \"darkolivegreen\",\n {\n r: 85,\n g: 107,\n b: 47\n }\n ],\n [\n \"darkorange\",\n {\n r: 255,\n g: 140,\n b: 0\n }\n ],\n [\n \"darkorchid\",\n {\n r: 153,\n g: 50,\n b: 204\n }\n ],\n [\n \"darkred\",\n {\n r: 139,\n g: 0,\n b: 0\n }\n ],\n [\n \"darksalmon\",\n {\n r: 233,\n g: 150,\n b: 122\n }\n ],\n [\n \"darkseagreen\",\n {\n r: 143,\n g: 188,\n b: 143\n }\n ],\n [\n \"darkslateblue\",\n {\n r: 72,\n g: 61,\n b: 139\n }\n ],\n [\n \"darkslategray\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkslategrey\",\n {\n r: 47,\n g: 79,\n b: 79\n }\n ],\n [\n \"darkturquoise\",\n {\n r: 0,\n g: 206,\n b: 209\n }\n ],\n [\n \"darkviolet\",\n {\n r: 148,\n g: 0,\n b: 211\n }\n ],\n [\n \"deeppink\",\n {\n r: 255,\n g: 20,\n b: 147\n }\n ],\n [\n \"deepskyblue\",\n {\n r: 0,\n g: 191,\n b: 255\n }\n ],\n [\n \"dimgray\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dimgrey\",\n {\n r: 105,\n g: 105,\n b: 105\n }\n ],\n [\n \"dodgerblue\",\n {\n r: 30,\n g: 144,\n b: 255\n }\n ],\n [\n \"firebrick\",\n {\n r: 178,\n g: 34,\n b: 34\n }\n ],\n [\n \"floralwhite\",\n {\n r: 255,\n g: 250,\n b: 240\n }\n ],\n [\n \"forestgreen\",\n {\n r: 34,\n g: 139,\n b: 34\n }\n ],\n [\n \"fuchsia\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"gainsboro\",\n {\n r: 220,\n g: 220,\n b: 220\n }\n ],\n [\n \"ghostwhite\",\n {\n r: 248,\n g: 248,\n b: 255\n }\n ],\n [\n \"goldenrod\",\n {\n r: 218,\n g: 165,\n b: 32\n }\n ],\n [\n \"gold\",\n {\n r: 255,\n g: 215,\n b: 0\n }\n ],\n [\n \"gray\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"green\",\n {\n r: 0,\n g: 128,\n b: 0\n }\n ],\n [\n \"greenyellow\",\n {\n r: 173,\n g: 255,\n b: 47\n }\n ],\n [\n \"grey\",\n {\n r: 128,\n g: 128,\n b: 128\n }\n ],\n [\n \"honeydew\",\n {\n r: 240,\n g: 255,\n b: 240\n }\n ],\n [\n \"hotpink\",\n {\n r: 255,\n g: 105,\n b: 180\n }\n ],\n [\n \"indianred\",\n {\n r: 205,\n g: 92,\n b: 92\n }\n ],\n [\n \"indigo\",\n {\n r: 75,\n g: 0,\n b: 130\n }\n ],\n [\n \"ivory\",\n {\n r: 255,\n g: 255,\n b: 240\n }\n ],\n [\n \"khaki\",\n {\n r: 240,\n g: 230,\n b: 140\n }\n ],\n [\n \"lavenderblush\",\n {\n r: 255,\n g: 240,\n b: 245\n }\n ],\n [\n \"lavender\",\n {\n r: 230,\n g: 230,\n b: 250\n }\n ],\n [\n \"lawngreen\",\n {\n r: 124,\n g: 252,\n b: 0\n }\n ],\n [\n \"lemonchiffon\",\n {\n r: 255,\n g: 250,\n b: 205\n }\n ],\n [\n \"lightblue\",\n {\n r: 173,\n g: 216,\n b: 230\n }\n ],\n [\n \"lightcoral\",\n {\n r: 240,\n g: 128,\n b: 128\n }\n ],\n [\n \"lightcyan\",\n {\n r: 224,\n g: 255,\n b: 255\n }\n ],\n [\n \"lightgoldenrodyellow\",\n {\n r: 250,\n g: 250,\n b: 210\n }\n ],\n [\n \"lightgray\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightgreen\",\n {\n r: 144,\n g: 238,\n b: 144\n }\n ],\n [\n \"lightgrey\",\n {\n r: 211,\n g: 211,\n b: 211\n }\n ],\n [\n \"lightpink\",\n {\n r: 255,\n g: 182,\n b: 193\n }\n ],\n [\n \"lightsalmon\",\n {\n r: 255,\n g: 160,\n b: 122\n }\n ],\n [\n \"lightseagreen\",\n {\n r: 32,\n g: 178,\n b: 170\n }\n ],\n [\n \"lightskyblue\",\n {\n r: 135,\n g: 206,\n b: 250\n }\n ],\n [\n \"lightslategray\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightslategrey\",\n {\n r: 119,\n g: 136,\n b: 153\n }\n ],\n [\n \"lightsteelblue\",\n {\n r: 176,\n g: 196,\n b: 222\n }\n ],\n [\n \"lightyellow\",\n {\n r: 255,\n g: 255,\n b: 224\n }\n ],\n [\n \"lime\",\n {\n r: 0,\n g: 255,\n b: 0\n }\n ],\n [\n \"limegreen\",\n {\n r: 50,\n g: 205,\n b: 50\n }\n ],\n [\n \"linen\",\n {\n r: 250,\n g: 240,\n b: 230\n }\n ],\n [\n \"magenta\",\n {\n r: 255,\n g: 0,\n b: 255\n }\n ],\n [\n \"maroon\",\n {\n r: 128,\n g: 0,\n b: 0\n }\n ],\n [\n \"mediumaquamarine\",\n {\n r: 102,\n g: 205,\n b: 170\n }\n ],\n [\n \"mediumblue\",\n {\n r: 0,\n g: 0,\n b: 205\n }\n ],\n [\n \"mediumorchid\",\n {\n r: 186,\n g: 85,\n b: 211\n }\n ],\n [\n \"mediumpurple\",\n {\n r: 147,\n g: 112,\n b: 219\n }\n ],\n [\n \"mediumseagreen\",\n {\n r: 60,\n g: 179,\n b: 113\n }\n ],\n [\n \"mediumslateblue\",\n {\n r: 123,\n g: 104,\n b: 238\n }\n ],\n [\n \"mediumspringgreen\",\n {\n r: 0,\n g: 250,\n b: 154\n }\n ],\n [\n \"mediumturquoise\",\n {\n r: 72,\n g: 209,\n b: 204\n }\n ],\n [\n \"mediumvioletred\",\n {\n r: 199,\n g: 21,\n b: 133\n }\n ],\n [\n \"midnightblue\",\n {\n r: 25,\n g: 25,\n b: 112\n }\n ],\n [\n \"mintcream\",\n {\n r: 245,\n g: 255,\n b: 250\n }\n ],\n [\n \"mistyrose\",\n {\n r: 255,\n g: 228,\n b: 225\n }\n ],\n [\n \"moccasin\",\n {\n r: 255,\n g: 228,\n b: 181\n }\n ],\n [\n \"navajowhite\",\n {\n r: 255,\n g: 222,\n b: 173\n }\n ],\n [\n \"navy\",\n {\n r: 0,\n g: 0,\n b: 128\n }\n ],\n [\n \"oldlace\",\n {\n r: 253,\n g: 245,\n b: 230\n }\n ],\n [\n \"olive\",\n {\n r: 128,\n g: 128,\n b: 0\n }\n ],\n [\n \"olivedrab\",\n {\n r: 107,\n g: 142,\n b: 35\n }\n ],\n [\n \"orange\",\n {\n r: 255,\n g: 165,\n b: 0\n }\n ],\n [\n \"orangered\",\n {\n r: 255,\n g: 69,\n b: 0\n }\n ],\n [\n \"orchid\",\n {\n r: 218,\n g: 112,\n b: 214\n }\n ],\n [\n \"palegoldenrod\",\n {\n r: 238,\n g: 232,\n b: 170\n }\n ],\n [\n \"palegreen\",\n {\n r: 152,\n g: 251,\n b: 152\n }\n ],\n [\n \"paleturquoise\",\n {\n r: 175,\n g: 238,\n b: 238\n }\n ],\n [\n \"palevioletred\",\n {\n r: 219,\n g: 112,\n b: 147\n }\n ],\n [\n \"papayawhip\",\n {\n r: 255,\n g: 239,\n b: 213\n }\n ],\n [\n \"peachpuff\",\n {\n r: 255,\n g: 218,\n b: 185\n }\n ],\n [\n \"peru\",\n {\n r: 205,\n g: 133,\n b: 63\n }\n ],\n [\n \"pink\",\n {\n r: 255,\n g: 192,\n b: 203\n }\n ],\n [\n \"plum\",\n {\n r: 221,\n g: 160,\n b: 221\n }\n ],\n [\n \"powderblue\",\n {\n r: 176,\n g: 224,\n b: 230\n }\n ],\n [\n \"purple\",\n {\n r: 128,\n g: 0,\n b: 128\n }\n ],\n [\n \"rebeccapurple\",\n {\n r: 102,\n g: 51,\n b: 153\n }\n ],\n [\n \"red\",\n {\n r: 255,\n g: 0,\n b: 0\n }\n ],\n [\n \"rosybrown\",\n {\n r: 188,\n g: 143,\n b: 143\n }\n ],\n [\n \"royalblue\",\n {\n r: 65,\n g: 105,\n b: 225\n }\n ],\n [\n \"saddlebrown\",\n {\n r: 139,\n g: 69,\n b: 19\n }\n ],\n [\n \"salmon\",\n {\n r: 250,\n g: 128,\n b: 114\n }\n ],\n [\n \"sandybrown\",\n {\n r: 244,\n g: 164,\n b: 96\n }\n ],\n [\n \"seagreen\",\n {\n r: 46,\n g: 139,\n b: 87\n }\n ],\n [\n \"seashell\",\n {\n r: 255,\n g: 245,\n b: 238\n }\n ],\n [\n \"sienna\",\n {\n r: 160,\n g: 82,\n b: 45\n }\n ],\n [\n \"silver\",\n {\n r: 192,\n g: 192,\n b: 192\n }\n ],\n [\n \"skyblue\",\n {\n r: 135,\n g: 206,\n b: 235\n }\n ],\n [\n \"slateblue\",\n {\n r: 106,\n g: 90,\n b: 205\n }\n ],\n [\n \"slategray\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"slategrey\",\n {\n r: 112,\n g: 128,\n b: 144\n }\n ],\n [\n \"snow\",\n {\n r: 255,\n g: 250,\n b: 250\n }\n ],\n [\n \"springgreen\",\n {\n r: 0,\n g: 255,\n b: 127\n }\n ],\n [\n \"steelblue\",\n {\n r: 70,\n g: 130,\n b: 180\n }\n ],\n [\n \"tan\",\n {\n r: 210,\n g: 180,\n b: 140\n }\n ],\n [\n \"teal\",\n {\n r: 0,\n g: 128,\n b: 128\n }\n ],\n [\n \"thistle\",\n {\n r: 216,\n g: 191,\n b: 216\n }\n ],\n [\n \"tomato\",\n {\n r: 255,\n g: 99,\n b: 71\n }\n ],\n [\n \"turquoise\",\n {\n r: 64,\n g: 224,\n b: 208\n }\n ],\n [\n \"violet\",\n {\n r: 238,\n g: 130,\n b: 238\n }\n ],\n [\n \"wheat\",\n {\n r: 245,\n g: 222,\n b: 179\n }\n ],\n [\n \"white\",\n {\n r: 255,\n g: 255,\n b: 255\n }\n ],\n [\n \"whitesmoke\",\n {\n r: 245,\n g: 245,\n b: 245\n }\n ],\n [\n \"yellow\",\n {\n r: 255,\n g: 255,\n b: 0\n }\n ],\n [\n \"yellowgreen\",\n {\n r: 154,\n g: 205,\n b: 50\n }\n ]\n], B = \"deg|rad|grad|turn\", U = \"[-\\\\+]?\\\\d+%?\", D = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\", L = `[-\\\\+]?\\\\d*\\\\.?\\\\d+(?:${B})?`, v = `(?:${D})|(?:${U})`, F = `(?:${v})|(?:${L}?)`, rr = \"(?:[\\\\s|\\\\(\\\\s|\\\\s\\\\(\\\\s]+)?\", tr = \"(?:[\\\\s|\\\\)\\\\s]+)?\", O = \"(?:[,|\\\\s]+)\", er = \"(?:[,|\\\\/\\\\s]*)?\", $ = `${rr}(${F})${O}(${v})${O}(${v})${er}(${v})?${tr}`, f = {\n CSS_UNIT: new RegExp(F),\n ANGLES: B,\n CSS_ANGLE: L,\n CSS_INTEGER: U,\n CSS_NUMBER: D,\n CSS_UNIT2: F,\n PERMISSIVE_MATCH: $,\n hwb: new RegExp(`hwb${$}`),\n rgb: new RegExp(`rgb(?:a)?${$}`),\n hsl: new RegExp(`hsl(?:a)?${$}`),\n hsv: new RegExp(`hsv(?:a)?${$}`),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n}, V = (o) => N.includes(o), k = (o, t) => o !== null && typeof o == \"object\" && Object.keys(t).every((r) => r in o), Z = (o) => `${o}`.includes(\".\") && parseFloat(o) === 1, R = (o) => typeof o == \"string\" && o.includes(\"%\"), c = (o) => !!f.CSS_UNIT.exec(`${o}`), z = [\"rgb\", \"hex\", \"hsl\", \"hsv\", \"hwb\"], J = (o) => N.includes(o) || [\"#\", ...z].some((t) => o.includes(t)) ? !1 : T.some(([t]) => o === t), u = (o, t) => {\n let r = o;\n if (typeof o == \"number\" && Math.min(o, 0) === 0 && // round values to 6 decimals Math.round(N * (10 ** 6)) / 10 ** 6\n Math.max(o, 1) === 1)\n return o;\n Z(o) && (r = \"100%\");\n const e = R(r);\n return r = t === 360 ? parseFloat(r) : Math.min(t, Math.max(0, parseFloat(r))), e && (r = r * t / 100), Math.abs(r - t) < 1e-6 ? 1 : (t === 360 ? r = (r < 0 ? r % t + t : r % t) / t : r = r % t / t, r);\n}, M = (o) => {\n let t = parseFloat(o);\n return (Number.isNaN(t) || t < 0 || t > 1) && (t = 1), t;\n}, x = (o) => Math.min(1, Math.max(0, o)), p = (o) => o.length === 1 ? `0${o}` : String(o), K = (o) => {\n const [[, t]] = T.filter(([r]) => r === o.toLowerCase());\n return t;\n}, h = (o) => parseInt(o, 16), E = (o) => h(o) / 255, Q = (o) => b(o * 255).toString(16), _ = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0, g = 0;\n const a = (e + s) / 2;\n if (e === s)\n g = 0, n = 0;\n else {\n const i = e - s;\n g = a > 0.5 ? i / (2 - e - s) : i / (e + s), e === o && (n = (t - r) / i + (t < r ? 6 : 0)), e === t && (n = (r - o) / i + 2), e === r && (n = (o - t) / i + 4), n /= 6;\n }\n return { h: n, s: g, l: a };\n}, H = (o, t, r) => {\n let e = r;\n return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? o + (t - o) * (6 * e) : e < 1 / 2 ? t : e < 2 / 3 ? o + (t - o) * (2 / 3 - e) * 6 : o;\n}, y = (o, t, r) => {\n let e = 0, s = 0, n = 0;\n if (t === 0)\n s = r, n = r, e = r;\n else if (r) {\n const g = r < 0.5 ? r * (1 + t) : r + t - r * t, a = 2 * r - g;\n e = H(a, g, o + 1 / 3), s = H(a, g, o), n = H(a, g, o - 1 / 3);\n }\n return { r: e, g: s, b: n };\n}, G = (o, t, r) => {\n let e = 0, s = 0;\n const n = Math.min(o, t, r), g = Math.max(o, t, r), a = 1 - g;\n if (g === n)\n return { h: 0, w: n, b: a };\n o === n ? (e = t - r, s = 3) : (e = t === n ? r - o : o - t, s = t === n ? 5 : 1);\n const i = (s - e / (g - n)) / 6;\n return {\n h: i === 1 ? 0 : i,\n w: n,\n b: a\n };\n}, X = (o, t, r) => {\n if (t + r >= 1) {\n const g = t / (t + r);\n return { r: g, g, b: g };\n }\n let { r: e, g: s, b: n } = y(o, 1, 0.5);\n return [e, s, n] = [e, s, n].map((g) => g * (1 - t - r) + t), { r: e, g: s, b: n };\n}, P = (o, t, r) => {\n const e = Math.max(o, t, r), s = Math.min(o, t, r);\n let n = 0;\n const g = e, a = e - s, i = e === 0 ? 0 : a / e;\n return e === s ? n = 0 : (o === e && (n = (t - r) / a + (t < r ? 6 : 0)), t === e && (n = (r - o) / a + 2), r === e && (n = (o - t) / a + 4), n /= 6), { h: n, s: i, v: g };\n}, I = (o, t, r) => {\n const e = o * 6, s = t, n = r, g = Math.floor(e), a = e - g, i = n * (1 - s), l = n * (1 - a * s), d = n * (1 - (1 - a) * s), m = g % 6, w = [n, l, i, i, d, n][m], S = [d, n, n, l, i, i][m], A = [i, i, d, n, n, l][m];\n return { r: w, g: S, b: A };\n}, j = (o, t, r, e) => {\n const s = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16))\n ];\n return e && s[0].charAt(0) === s[0].charAt(1) && s[1].charAt(0) === s[1].charAt(1) && s[2].charAt(0) === s[2].charAt(1) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) : s.join(\"\");\n}, C = (o, t, r, e, s) => {\n const n = [\n p(b(o).toString(16)),\n p(b(t).toString(16)),\n p(b(r).toString(16)),\n p(Q(e))\n ];\n return s && n[0].charAt(0) === n[0].charAt(1) && n[1].charAt(0) === n[1].charAt(1) && n[2].charAt(0) === n[2].charAt(1) && n[3].charAt(0) === n[3].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join(\"\");\n}, Y = (o) => {\n const t = String(o).trim().toLowerCase();\n if (J(t))\n return Object.assign(K(t), {\n a: 1,\n format: \"rgb\",\n ok: !0\n });\n if (V(t))\n return {\n r: 0,\n g: 0,\n b: 0,\n a: t === \"transparent\" ? 0 : 1,\n format: \"rgb\",\n ok: !0\n };\n let [, r, e, s, n] = f.rgb.exec(t) || [];\n return r && e && s ? {\n r,\n g: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"rgb\",\n ok: !0\n } : ([, r, e, s, n] = f.hsl.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n l: s,\n a: n !== void 0 ? n : 1,\n format: \"hsl\",\n ok: !0\n } : ([, r, e, s, n] = f.hsv.exec(t) || [], r && e && s ? {\n h: r,\n s: e,\n v: s,\n a: n !== void 0 ? n : 1,\n format: \"hsv\",\n ok: !0\n } : ([, r, e, s, n] = f.hwb.exec(t) || [], r && e && s ? {\n h: r,\n w: e,\n b: s,\n a: n !== void 0 ? n : 1,\n format: \"hwb\",\n ok: !0\n } : ([, r, e, s, n] = f.hex8.exec(t) || [], r && e && s && n ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: E(n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex6.exec(t) || [], r && e && s ? {\n r: h(r),\n g: h(e),\n b: h(s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : ([, r, e, s, n] = f.hex4.exec(t) || [], r && e && s && n ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: E(n + n),\n format: \"hex\",\n ok: !0\n } : ([, r, e, s] = f.hex3.exec(t) || [], r && e && s ? {\n r: h(r + r),\n g: h(e + e),\n b: h(s + s),\n a: 1,\n format: \"hex\",\n ok: !0\n } : {\n r: 0,\n g: 0,\n b: 0,\n a: 1,\n format: \"rgb\",\n ok: !o\n })))))));\n}, q = (o) => {\n let t = { r: 0, g: 0, b: 0 }, r = o, e = 1, s, n, g, a, i, l, d, m, w = \"rgb\", S = !1;\n return (!r || typeof r == \"string\") && (r = Y(r), S = r.ok), k(r, t) && c(r.r) && c(r.g) && c(r.b) && ({ r: d, g: m, b: i } = r, [d, m, i] = [d, m, i].map((A) => u(A, R(A) ? 100 : 255)), t = { r: d, g: m, b: i }, w = \"format\" in r ? r.format : \"rgb\"), k(r, { h: 0, s: 0, v: 0 }) && c(r.h) && c(r.s) && c(r.v) && ({ h: l, s, v: n } = r, l = u(l, 360), s = u(s, 100), n = u(n, 100), t = I(l, s, n), w = \"hsv\"), k(r, { h: 0, s: 0, l: 0 }) && c(r.h) && c(r.s) && c(r.l) && ({ h: l, s, l: g } = r, l = u(l, 360), s = u(s, 100), g = u(g, 100), t = y(l, s, g), w = \"hsl\"), k(r, { h: 0, w: 0, b: 0 }) && c(r.h) && c(r.w) && c(r.b) && ({ h: l, w: a, b: i } = r, l = u(l, 360), a = u(a, 100), i = u(i, 100), t = X(l, a, i), w = \"hwb\"), c(r.a) && (e = r.a, e = R(e) || parseFloat(`${e}`) > 1 ? u(e, 100) : e), {\n r: t.r,\n g: t.g,\n b: t.b,\n a: M(e),\n format: w,\n ok: S\n };\n}, sr = \"1.0.8\";\nclass W {\n // bring main utilities to front\n static matchers = f;\n static isOnePointZero = Z;\n static isPercentage = R;\n static isValidCSSUnit = c;\n static isNonColor = V;\n static isColorName = J;\n static isColorType = k;\n static pad2 = p;\n static clamp01 = x;\n static bound01 = u;\n static boundAlpha = M;\n static getRGBFromName = K;\n static convertHexToDecimal = E;\n static convertDecimalToHex = Q;\n static rgbToHsl = _;\n static rgbToHex = j;\n static rgbToHsv = P;\n static rgbToHwb = G;\n static rgbaToHex = C;\n static hslToRgb = I;\n static hsvToRgb = I;\n static hueToRgb = H;\n static hwbToRgb = X;\n static parseIntFromHex = h;\n static stringInputToObject = Y;\n static inputToRGB = q;\n static roundPart = b;\n static webColors = T;\n static nonColors = N;\n static version = sr;\n // main public properties\n r;\n g;\n b;\n a;\n format;\n ok;\n originalInput;\n // main public methods\n constructor(t, r) {\n const e = r && z.includes(r) ? r : \"\", { r: s, g: n, b: g, a, ok: i, format: l } = q(t);\n this.originalInput = t, this.r = s, this.g = n, this.b = g, this.a = a, this.ok = i, this.format = e || l;\n }\n /**\n * Checks if the current input value is a valid colour.\n */\n get isValid() {\n return this.ok;\n }\n /**\n * Checks if the current colour requires a light text colour.\n */\n get isDark() {\n return this.brightness < 120;\n }\n /**\n * Returns the perceived luminance of a colour.\n *\n * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n */\n get luminance() {\n const { r: t, g: r, b: e } = this;\n let s = 0, n = 0, g = 0;\n return t <= 0.03928 ? s = t / 12.92 : s = ((t + 0.055) / 1.055) ** 2.4, r <= 0.03928 ? n = r / 12.92 : n = ((r + 0.055) / 1.055) ** 2.4, e <= 0.03928 ? g = e / 12.92 : g = ((e + 0.055) / 1.055) ** 2.4, 0.2126 * s + 0.7152 * n + 0.0722 * g;\n }\n /**\n * Returns the perceived brightness of the colour.\n */\n get brightness() {\n const { r: t, g: r, b: e } = this.toRgb();\n return (t * 299 + r * 587 + e * 114) / 1e3;\n }\n /**\n * Returns the web colour name closest to the current colour.\n */\n get name() {\n const { r: t, g: r, b: e } = this.toRgb(), [s] = T.map(([n, g]) => {\n const a = (\n // ((rgb.r - r) ** 2 + (rgb.g - g) ** 2 + (rgb.b - b) ** 2) ** 0.5; // standard\n (((g.r - t) * 0.3) ** 2 + ((g.g - r) * 0.6) ** 2 + ((g.b - e) * 0.1) ** 2) ** 0.5\n );\n return [n, a];\n }).find(([, n], g, a) => n === Math.min(...a.map(([, i]) => i)));\n return s;\n }\n /**\n * Returns the colour as an RGBA object.\n */\n toRgb() {\n let { r: t, g: r, b: e, a: s } = this;\n return [t, r, e] = [t, r, e].map((n) => b(n * 255 * 100) / 100), s = b(s * 100) / 100, {\n r: t,\n g: r,\n b: e,\n a: s\n };\n }\n /**\n * Returns the RGBA values concatenated into a CSS3 Module string format.\n * * rgb(255,255,255)\n * * rgba(255,255,255,0.5)\n */\n toRgbString() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b);\n return s === 1 ? `rgb(${n}, ${g}, ${a})` : `rgba(${n}, ${g}, ${a}, ${s})`;\n }\n /**\n * Returns the RGBA values concatenated into a CSS4 Module string format.\n * * rgb(255 255 255)\n * * rgb(255 255 255 / 50%)\n */\n toRgbCSS4String() {\n const { r: t, g: r, b: e, a: s } = this.toRgb(), [n, g, a] = [t, r, e].map(b), i = s === 1 ? \"\" : ` / ${b(s * 100)}%`;\n return `rgb(${n} ${g} ${a}${i})`;\n }\n /**\n * Returns the hexadecimal value of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the decimal value.\n */\n toHex(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return n === 1 ? j(r, e, s, t) : C(r, e, s, n, t);\n }\n /**\n * Returns the CSS valid hexadecimal vaue of the colour. When the parameter is *true*\n * it will find a 3 characters shorthand of the value.\n */\n toHexString(t) {\n return `#${this.toHex(t)}`;\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8(t) {\n const { r, g: e, b: s, a: n } = this.toRgb();\n return C(r, e, s, n, t);\n }\n /**\n * Returns the HEX8 value of the colour.\n */\n toHex8String(t) {\n return `#${this.toHex8(t)}`;\n }\n /**\n * Returns the colour as a HSVA object.\n */\n toHsv() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, v: a } = P(t, r, e);\n return {\n h: n,\n s: g,\n v: a,\n a: s\n };\n }\n /**\n * Returns the colour as an HSLA object.\n */\n toHsl() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, s: g, l: a } = _(t, r, e);\n return {\n h: n,\n s: g,\n l: a,\n a: s\n };\n }\n /**\n * Returns the HSLA values concatenated into a CSS3 Module format string.\n * * `hsl(150, 100%, 50%)`\n * * `hsla(150, 100%, 50%, 0.5)`\n */\n toHslString() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n return t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100) / 100, s === 1 ? `hsl(${t}, ${r}%, ${e}%)` : `hsla(${t}, ${r}%, ${e}%, ${s})`;\n }\n /**\n * Returns the HSLA values concatenated into a CSS4 Module format string.\n * * `hsl(150deg 100% 50%)`\n * * `hsl(150deg 100% 50% / 50%)`\n */\n toHslCSS4String() {\n let { h: t, s: r, l: e, a: s } = this.toHsl();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hsl(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Returns the colour as an HWBA object.\n */\n toHwb() {\n const { r: t, g: r, b: e, a: s } = this, { h: n, w: g, b: a } = G(t, r, e);\n return {\n h: n,\n w: g,\n b: a,\n a: s\n };\n }\n /**\n * Returns the HWBA values concatenated into a string.\n */\n toHwbString() {\n let { h: t, w: r, b: e, a: s } = this.toHwb();\n t = b(t * 360), r = b(r * 100), e = b(e * 100), s = b(s * 100);\n const n = s < 100 ? ` / ${b(s)}%` : \"\";\n return `hwb(${t}deg ${r}% ${e}%${n})`;\n }\n /**\n * Sets the alpha value of the current colour.\n */\n setAlpha(t) {\n return typeof t != \"number\" ? this : (this.a = M(t), this);\n }\n /**\n * Saturate the colour with a given amount.\n */\n saturate(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, x(e + t / 100), s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Desaturate the colour with a given amount.\n */\n desaturate(t) {\n return typeof t == \"number\" ? this.saturate(-t) : this;\n }\n /**\n * Completely desaturates a colour into greyscale.\n * Same as calling `desaturate(100)`\n */\n greyscale() {\n return this.saturate(-100);\n }\n /**\n * Increase the colour lightness with a given amount.\n */\n lighten(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(r, e, x(s + t / 100));\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /**\n * Decrease the colour lightness with a given amount.\n */\n darken(t) {\n return typeof t == \"number\" ? this.lighten(-t) : this;\n }\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n spin(t) {\n if (typeof t != \"number\")\n return this;\n const { h: r, s: e, l: s } = this.toHsl(), { r: n, g, b: a } = y(x((r * 360 + t) % 360 / 360), e, s);\n return Object.assign(this, { r: n, g, b: a }), this;\n }\n /** Returns a clone of the current `Color` instance. */\n clone() {\n return new W(this);\n }\n /**\n * Returns the colour value in CSS valid string format.\n */\n toString(t) {\n const { format: r } = this;\n return r === \"hex\" ? this.toHexString(t) : r === \"hsl\" ? this.toHslString() : r === \"hwb\" ? this.toHwbString() : this.toRgbString();\n }\n}\nexport {\n W as default\n};\n//# sourceMappingURL=index.mjs.map\n","import Color from '@thednp/color';\n// import { isNumber } from '@thednp/shorty';\n\n/**\n * Returns a color palette with a given set of parameters.\n *\n * @example\n * new ColorPalette(0, 12, 10, 80);\n * // => { hue: 0, hueSteps: 12, lightSteps: 10, saturation: 80, colors: Array }\n */\nexport default class ColorPalette {\n public static Color = Color;\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n colors: Color[];\n /**\n * The `hue` parameter is optional, which would be set to 0.\n * * `args.hue` the starting Hue [0, 360]\n * * `args.hueSteps` Hue Steps Count [5, 24]\n * * `args.lightSteps` Lightness Steps Count [5, 12]\n * * `args.saturation` Saturation [0, 100]\n */\n constructor(...args: [number?, number?, number?, number?]) {\n let hue = 0;\n let hueSteps = 12;\n let lightSteps = 10;\n let lightnessArray = [0.5];\n let saturation = 100;\n // if (!args.every(n => isNumber(n))) throw TypeError('ColorPalette only accepts numbers.');\n\n if (args.length === 4) {\n [hue, hueSteps, lightSteps, saturation] = args as [number, number, number, number];\n } else if (args.length === 3) {\n [hue, hueSteps, lightSteps] = args as [number, number, number];\n } else if (args.length === 2) {\n [hueSteps, lightSteps] = args as [number, number];\n if ([hueSteps, lightSteps].some(n => n < 1)) {\n throw TypeError('ColorPalette: the two minimum arguments must be numbers higher than 0.');\n }\n }\n\n const colors: Color[] = [];\n const hueStep = 360 / hueSteps;\n const half = Color.roundPart((lightSteps - (lightSteps % 2 ? 1 : 0)) / 2);\n const steps1To13 = [0.25, 0.2, 0.15, 0.11, 0.09, 0.075];\n const lightSets = [\n [1, 2, 3],\n [4, 5],\n [6, 7],\n [8, 9],\n [10, 11],\n [12, 13],\n ];\n const closestSet = lightSets.find(set => set.includes(lightSteps));\n\n // find a lightStep that won't go beyond black and white\n // something within the [10-90] range of lightness\n const lightStep = closestSet\n ? steps1To13[lightSets.indexOf(closestSet)]\n : 100 / (lightSteps + (lightSteps % 2 ? 0 : 1)) / 100;\n\n // light tints\n for (let i = 1; i < half + 1; i += 1) {\n lightnessArray = [...lightnessArray, 0.5 + lightStep * i];\n }\n\n // dark tints\n for (let i = 1; i < lightSteps - half; i += 1) {\n lightnessArray = [0.5 - lightStep * i, ...lightnessArray];\n }\n\n // feed `colors` Array\n for (let i = 0; i < hueSteps; i += 1) {\n const currentHue = ((hue + i * hueStep) % 360) / 360;\n lightnessArray.forEach(l => {\n const newColor = new Color({ h: currentHue, s: 1, l });\n colors.push(saturation < 100 ? newColor.saturate(saturation - 100) : newColor);\n });\n }\n\n this.hue = hue;\n this.hueSteps = hueSteps;\n this.lightSteps = lightSteps;\n this.saturation = saturation;\n this.colors = colors;\n }\n}\n","import ColorPickerLabels from '../interface/colorPickerLabels';\n\n/** The labels presented to the user. */\nconst colorPickerLabels: ColorPickerLabels = {\n pickerLabel: 'Colour Picker',\n appearanceLabel: 'Colour Appearance',\n valueLabel: 'Colour Value',\n toggleLabel: 'Select Colour',\n presetsLabel: 'Colour Presets',\n defaultsLabel: 'Colour Defaults',\n formatLabel: 'Format',\n alphaLabel: 'Alpha',\n hexLabel: 'Hexadecimal',\n hueLabel: 'Hue',\n whitenessLabel: 'Whiteness',\n blacknessLabel: 'Blackness',\n saturationLabel: 'Saturation',\n lightnessLabel: 'Lightness',\n redLabel: 'Red',\n greenLabel: 'Green',\n blueLabel: 'Blue',\n};\n\nexport default colorPickerLabels;\n","/** A list of 17 color names used for WAI-ARIA compliance. */\nconst colorNames: string[] = [\n 'white',\n 'black',\n 'grey',\n 'red',\n 'orange',\n 'brown',\n 'gold',\n 'olive',\n 'yellow',\n 'lime',\n 'green',\n 'teal',\n 'cyan',\n 'blue',\n 'violet',\n 'magenta',\n 'pink',\n];\nexport default colorNames;\n","import { isString } from '@thednp/shorty';\n\n/**\n * Check if a string is valid JSON string.\n *\n * @param str the string input\n * @returns the query result\n */\nconst isValidJSON = (str: unknown): str is string => {\n if (!isString(str)) return false;\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n};\n\nexport default isValidJSON;\n","const vHidden = 'v-hidden';\nexport default vHidden;\n","import { createElement, setAttribute, ObjectAssign, toUpperCase } from '@thednp/shorty';\n\nimport vHidden from './vHidden';\nimport ColorPicker from '../index';\n\n/**\n * Returns the color form for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns a new `
                ` element with color component ``\n */\nconst getColorForm = (self: ColorPicker): HTMLElement => {\n const { format, id, componentLabels } = self;\n const colorForm = createElement({\n tagName: 'div',\n className: `color-form ${format}`,\n }) as HTMLElement;\n\n let components = ['hex'];\n if (format === 'rgb') components = ['red', 'green', 'blue', 'alpha'];\n else if (format === 'hsl') components = ['hue', 'saturation', 'lightness', 'alpha'];\n else if (format === 'hwb') components = ['hue', 'whiteness', 'blackness', 'alpha'];\n\n components.forEach((c: string): void => {\n const [C] = format === 'hex' ? ['#'] : toUpperCase(c).split('');\n const cID = `color_${format}_${c}_${id}`;\n const formatLabel = componentLabels[`${c}Label`];\n const cInputLabel = createElement({ tagName: 'label' }) as HTMLElement;\n setAttribute(cInputLabel, 'for', cID);\n cInputLabel.append(\n createElement({\n tagName: 'span',\n ariaHidden: 'true',\n innerText: `${C}:`,\n }) as HTMLElement,\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: formatLabel,\n }) as HTMLElement,\n );\n const cInput = createElement({\n tagName: 'input',\n id: cID,\n // name: cID, - prevent saving the value to a form\n type: format === 'hex' ? 'text' : 'number',\n value: c === 'alpha' ? '100' : '0',\n className: `color-input ${c}`,\n autocomplete: 'off',\n spellcheck: false,\n } as Partial) as HTMLInputElement;\n\n // alpha\n let max = '100';\n let step = '1';\n if (c !== 'alpha') {\n if (format === 'rgb') {\n max = '255';\n step = '1';\n } else if (c === 'hue') {\n max = '360';\n step = '1';\n }\n }\n ObjectAssign(cInput, {\n min: '0',\n max,\n step,\n });\n colorForm.append(cInputLabel, cInput);\n });\n return colorForm;\n};\n\nexport default getColorForm;\n","import { createElement } from '@thednp/shorty';\n\nimport ColorPicker from '..';\n\n/**\n * Returns all color controls for `ColorPicker`.\n *\n * @param self the `ColorPicker` instance\n * @returns color controls\n */\nconst getColorControls = (self: ColorPicker): HTMLElement => {\n const { format, componentLabels } = self;\n const { hueLabel, alphaLabel, lightnessLabel, saturationLabel, whitenessLabel, blacknessLabel } = componentLabels;\n\n const max1 = format === 'hsl' ? 360 : 100;\n const max2 = format === 'hsl' ? 100 : 360;\n const max3 = 100;\n\n let ctrl1Label = format === 'hsl' ? `${hueLabel} & ${lightnessLabel}` : `${lightnessLabel} & ${saturationLabel}`;\n\n ctrl1Label = format === 'hwb' ? `${whitenessLabel} & ${blacknessLabel}` : ctrl1Label;\n\n const ctrl2Label = format === 'hsl' ? `${saturationLabel}` : `${hueLabel}`;\n\n const colorControls = createElement({\n tagName: 'div',\n className: `color-controls ${format}`,\n }) as HTMLElement;\n\n const colorPointer = 'color-pointer';\n const colorSlider = 'color-slider';\n\n const controls = [\n {\n i: 1,\n c: colorPointer,\n l: ctrl1Label,\n min: 0,\n max: max1,\n },\n {\n i: 2,\n c: colorSlider,\n l: ctrl2Label,\n min: 0,\n max: max2,\n },\n {\n i: 3,\n c: colorSlider,\n l: alphaLabel,\n min: 0,\n max: max3,\n },\n ];\n\n controls.forEach(template => {\n const { i, c, l, min, max } = template;\n const control = createElement({\n tagName: 'div',\n className: 'color-control',\n role: 'presentation',\n }) as HTMLElement;\n\n control.append(\n createElement({\n tagName: 'div',\n className: `visual-control visual-control${i}`,\n }) as HTMLElement,\n );\n\n const knob = createElement({\n tagName: 'div',\n className: `${c} knob`,\n ariaLive: 'polite',\n ariaLabel: l,\n role: 'slider',\n tabIndex: 0,\n ariaValueMin: `${min}`,\n ariaValueMax: `${max}`,\n }) as HTMLElement;\n\n control.append(knob);\n colorControls.append(control);\n });\n\n return colorControls;\n};\n\nexport default getColorControls;\n","import { setAttribute, getAttribute, createElement, setElementStyle } from '@thednp/shorty';\n\nimport Color from '@thednp/color';\nimport ColorPalette from '../colorPalette';\nimport ColorPicker from '../index';\n\n/**\n * Returns a color-defaults with given values and class.\n */\nconst getColorMenu = (self: ColorPicker, colorsSource: ColorPalette | string[], menuClass: string): HTMLElement => {\n const { input, format, componentLabels } = self;\n const { defaultsLabel, presetsLabel } = componentLabels;\n const isOptionsMenu = menuClass === 'color-options';\n const isPalette = colorsSource instanceof ColorPalette;\n const menuLabel = isOptionsMenu ? presetsLabel : defaultsLabel;\n const colorsArray = isPalette ? colorsSource.colors : colorsSource;\n const colorsCount = colorsArray.length;\n const { lightSteps } = isPalette ? colorsSource : { lightSteps: null };\n const fit = lightSteps || [9, 10].find(x => colorsCount >= x * 2 && !(colorsCount % x)) || 5;\n const isMultiLine = isOptionsMenu && colorsCount > fit;\n let rowCountHover = 2;\n rowCountHover = isMultiLine && colorsCount > fit * 2 ? 3 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 3 ? 4 : rowCountHover;\n rowCountHover = isMultiLine && colorsCount > fit * 4 ? 5 : rowCountHover;\n const rowCount = rowCountHover - (colorsCount <= fit * 3 ? 1 : 2);\n const isScrollable = isMultiLine && colorsCount > rowCount * fit;\n let finalClass = menuClass;\n finalClass += isScrollable ? ' scrollable' : '';\n finalClass += isMultiLine ? ' multiline' : '';\n const gap = isMultiLine ? '1px' : '0.25rem';\n let optionSize = isMultiLine ? 1.75 : 2;\n optionSize = fit > 5 && isMultiLine ? 1.5 : optionSize;\n const menuHeight = `${rowCount * optionSize}rem`;\n const menuHeightHover = `calc(${rowCountHover} * ${optionSize}rem + ${rowCountHover - 1} * ${gap})`;\n\n //
                  is an `HTMLElement`\n const menu = createElement({\n tagName: 'ul',\n className: finalClass,\n role: 'listbox',\n ariaLabel: menuLabel,\n }) as HTMLElement;\n\n if (isScrollable) {\n setElementStyle(menu, {\n '--grid-item-size': `${optionSize}rem`,\n '--grid-fit': `${fit}`,\n '--grid-gap': gap,\n '--grid-height': menuHeight,\n '--grid-hover-height': menuHeightHover,\n });\n }\n\n colorsArray.forEach(x => {\n let [value, label] = typeof x === 'string' ? x.trim().split(':') : [];\n if (x instanceof Color) {\n value = x.toHexString();\n label = value;\n }\n const color = new Color(x instanceof Color ? x : value, format);\n const isActive = color.toString() === getAttribute(input, 'value');\n const active = isActive ? ' active' : '';\n\n const option = createElement({\n tagName: 'li',\n className: `color-option${active}`,\n innerText: `${label || value}`,\n tabIndex: 0,\n role: 'option',\n ariaSelected: isActive ? 'true' : 'false',\n }) as HTMLElement;\n setAttribute(option, 'data-value', `${value}`);\n\n if (isOptionsMenu) {\n setElementStyle(option, { backgroundColor: value });\n }\n\n menu.append(option);\n });\n return menu;\n};\n\nexport default getColorMenu;\n","import {\n getAttribute,\n setAttribute,\n toUpperCase,\n ariaHidden,\n tabindex,\n createElement,\n createElementNS,\n} from '@thednp/shorty';\n\nimport Color from '@thednp/color';\n\nimport getColorForm from './getColorForm';\nimport getColorControls from './getColorControls';\nimport getColorMenu from './getColorMenu';\nimport vHidden from './vHidden';\n\nimport ColorPicker from '../index';\n\n/**\n * Generate HTML markup and update instance properties.\n *\n * @param self\n */\nconst setMarkup = (self: ColorPicker) => {\n const { input, parent, format, id, componentLabels, colorKeywords, colorPresets } = self;\n const colorValue = getAttribute(input, 'value') || '#fff';\n const { nonColors } = Color;\n\n const { toggleLabel, pickerLabel, formatLabel, hexLabel } = componentLabels;\n\n // update color\n const color = nonColors.includes(colorValue) ? '#fff' : colorValue;\n self.color = new Color(color, format);\n\n // set initial controls dimensions\n const formatString = format === 'hex' ? hexLabel : toUpperCase(format);\n\n const pickerBtn = createElement({\n id: `picker-btn-${id}`,\n tagName: 'button',\n type: 'button',\n className: 'picker-toggle btn-appearance',\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLButtonElement;\n\n pickerBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${pickerLabel}. ${formatLabel}: ${formatString}`,\n }) as HTMLElement,\n );\n\n const pickerDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown picker',\n role: 'group',\n ariaLabelledBy: `picker-btn-${id}`,\n } as Partial & { ariaLabelledBy: string }) as HTMLElement;\n\n const colorControls = getColorControls(self);\n const colorForm = getColorForm(self);\n\n pickerDropdown.append(colorControls, colorForm);\n input.before(pickerBtn);\n parent.append(pickerDropdown);\n\n // set colour key menu template\n if (colorKeywords || colorPresets) {\n const presetsDropdown = createElement({\n tagName: 'div',\n className: 'color-dropdown scrollable menu',\n }) as HTMLElement;\n\n // color presets\n if (colorPresets) {\n presetsDropdown.append(getColorMenu(self, colorPresets, 'color-options'));\n }\n\n // explicit defaults [reset, initial, inherit, transparent, currentColor]\n // also custom defaults [default: #069, complementary: #930]\n if (colorKeywords && colorKeywords.length) {\n presetsDropdown.append(getColorMenu(self, colorKeywords, 'color-defaults'));\n }\n\n const presetsBtn = createElement({\n tagName: 'button',\n type: 'button',\n className: 'menu-toggle btn-appearance',\n tabIndex: -1,\n ariaExpanded: 'false',\n ariaHasPopup: 'true',\n }) as HTMLButtonElement;\n\n const xmlns = encodeURI('http://www.w3.org/2000/svg');\n const presetsIcon = createElementNS(xmlns, {\n tagName: 'svg',\n }) as HTMLElement;\n setAttribute(presetsIcon, 'xmlns', xmlns);\n setAttribute(presetsIcon, 'viewBox', '0 0 512 512');\n setAttribute(presetsIcon, ariaHidden, 'true');\n\n const path = createElementNS(xmlns, {\n tagName: 'path',\n }) as HTMLElement;\n setAttribute(path, 'd', 'M98,158l157,156L411,158l27,27L255,368L71,185L98,158z');\n setAttribute(path, 'fill', '#fff');\n presetsIcon.append(path);\n presetsBtn.append(\n createElement({\n tagName: 'span',\n className: vHidden,\n innerText: `${toggleLabel}`,\n }) as HTMLElement,\n presetsIcon,\n );\n\n parent.append(presetsBtn, presetsDropdown);\n }\n\n // solve non-colors after settings save\n if (colorKeywords && nonColors.includes(colorValue)) {\n self.value = colorValue;\n }\n setAttribute(input, tabindex, '-1');\n};\n\nexport default setMarkup;\n","import {\n ariaDescription,\n ariaSelected,\n ariaValueNow,\n ariaValueText,\n ariaExpanded,\n keyArrowDown,\n keyArrowUp,\n keyArrowLeft,\n keyArrowRight,\n keyEnter,\n keySpace,\n keyEscape,\n focusinEvent,\n mouseclickEvent,\n keydownEvent,\n changeEvent,\n touchmoveEvent,\n pointerdownEvent,\n pointermoveEvent,\n pointerupEvent,\n tabindex,\n focusoutEvent,\n resizeEvent,\n keyupEvent,\n scrollEvent,\n dispatchEvent,\n getElementsByClassName,\n closest,\n querySelector,\n getElementTransitionDuration,\n getBoundingClientRect,\n getUID,\n getElementStyle,\n getDocumentElement,\n getDocument,\n ObjectAssign,\n ObjectFromEntries,\n Data,\n getInstance,\n setElementStyle,\n normalizeOptions,\n reflow,\n focus,\n hasClass,\n addClass,\n removeClass,\n setAttribute,\n getAttribute,\n removeAttribute,\n isArray,\n isString,\n getWindow,\n on,\n off,\n} from '@thednp/shorty';\n\n// ColorPicker Util\n// ================\nimport Color from '@thednp/color';\nimport type { RGBA, HWBA, HSLA, HSVA } from '@thednp/color';\n\nimport ColorPalette from './colorPalette';\nimport colorPickerLabels from './util/colorPickerLabels';\nimport colorNames from './util/colorNames';\nimport isValidJSON from './util/isValidJSON';\nimport setMarkup from './util/setMarkup';\n\nimport ColorPickerOptions from './interface/colorPickerOptions';\nimport ColorPickerLabels from './interface/colorPickerLabels';\nimport type ColorNames from './interface/ColorNames';\nimport { version } from '../../package.json';\n\n// ColorPicker GC\n// ==============\nconst colorPickerString = 'color-picker';\nconst colorPickerSelector = `[data-function=\"${colorPickerString}\"]`;\nconst colorPickerParentSelector = `.${colorPickerString}`;\nconst colorPickerDefaults: ColorPickerOptions = {\n componentLabels: colorPickerLabels,\n colorLabels: colorNames,\n format: 'rgb',\n colorPresets: false,\n colorKeywords: false,\n};\nconst { roundPart, nonColors } = Color;\n\n// ColorPicker Static Methods\n// ==========================\nconst getColorPickerInstance = (element: HTMLInputElement) => getInstance(element, colorPickerString);\nconst initColorPicker = (element: HTMLInputElement) => new ColorPicker(element);\n\n// ColorPicker Private Methods\n// ===========================\n\n/**\n * Add / remove `ColorPicker` main event listeners.\n */\nconst toggleEvents = (self: ColorPicker, action?: boolean) => {\n const fn = action ? on : off;\n const { input, pickerToggle, menuToggle } = self;\n\n fn(input, focusinEvent, self.showPicker);\n fn(pickerToggle, mouseclickEvent, self.togglePicker);\n\n if (menuToggle) {\n fn(menuToggle, mouseclickEvent, self.toggleMenu);\n }\n};\n\n/**\n * Add / remove `ColorPicker` event listeners active only when open.\n */\nconst toggleEventsOnShown = (self: ColorPicker, action?: boolean) => {\n const fn = action ? on : off;\n const { input, colorMenu, parent } = self;\n const doc = getDocument(input);\n const win = getWindow(doc);\n\n fn(self.controls, pointerdownEvent, self.pointerDown as EventListener);\n self.controlKnobs.forEach(x => fn(x, keydownEvent, self.handleKnobs as EventListener));\n\n fn(win, scrollEvent, self.handleScroll);\n fn(win, resizeEvent, self.update);\n\n [input, ...self.inputs].forEach(x => fn(x, changeEvent, self.changeHandler));\n\n if (colorMenu) {\n fn(colorMenu, mouseclickEvent, self.menuClickHandler);\n fn(colorMenu, keydownEvent, self.menuKeyHandler as EventListener);\n }\n\n fn(doc, pointermoveEvent, self.pointerMove as EventListener);\n fn(doc, pointerupEvent, self.pointerUp as EventListener);\n fn(parent, focusoutEvent, self.handleFocusOut as EventListener);\n fn(doc, keyupEvent, self.handleDismiss as EventListener);\n};\n\n/**\n * Triggers the `ColorPicker` original event.\n */\nconst firePickerChange = (self: ColorPicker) => {\n dispatchEvent(self.input, new CustomEvent('colorpicker.change'));\n};\n\n/**\n * Hides a visible dropdown.\n */\nconst removePosition = (element: HTMLElement) => {\n /* istanbul ignore else */\n if (element) {\n ['bottom', 'top'].forEach(x => removeClass(element, x));\n }\n};\n\n/**\n * Shows a `ColorPicker` dropdown and close the curent open dropdown.\n */\nconst showDropdown = (self: ColorPicker, dropdown: HTMLElement) => {\n const { colorPicker, colorMenu, menuToggle, pickerToggle, parent } = self;\n const isPicker = dropdown === colorPicker;\n const openDropdown = isPicker ? colorMenu : colorPicker;\n const activeBtn = isPicker ? menuToggle : pickerToggle;\n const nextBtn = !isPicker ? menuToggle : pickerToggle;\n\n if (!hasClass(parent, 'open')) {\n addClass(parent, 'open');\n }\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n removePosition(openDropdown);\n }\n addClass(dropdown, 'bottom');\n reflow(dropdown);\n addClass(dropdown, 'show');\n\n if (isPicker) self.update();\n\n if (!self.isOpen) {\n toggleEventsOnShown(self, true);\n self.updateDropdownPosition();\n self.isOpen = true;\n setAttribute(self.input, tabindex, '0');\n if (menuToggle) {\n setAttribute(menuToggle, tabindex, '0');\n }\n }\n\n setAttribute(nextBtn, ariaExpanded, 'true');\n if (activeBtn) {\n setAttribute(activeBtn, ariaExpanded, 'false');\n }\n};\n\n/**\n * Color Picker Web Component\n *\n * @see http://thednp.github.io/color-picker\n */\nexport default class ColorPicker {\n // bring utils to staic\n public static Color = Color;\n public static ColorPalette = ColorPalette;\n public static getInstance = getColorPickerInstance;\n public static init = initColorPicker;\n public static selector = colorPickerSelector;\n // utils important for render\n public static roundPart = roundPart;\n public static setElementStyle = setElementStyle;\n public static setAttribute = setAttribute;\n public static getBoundingClientRect = getBoundingClientRect;\n public static version = version;\n public static colorNames = colorNames;\n public static colorPickerLabels = colorPickerLabels;\n\n id: number;\n input: HTMLInputElement;\n color: Color;\n format = 'rgb';\n parent: HTMLElement;\n dragElement: HTMLElement | undefined;\n isOpen = false;\n controlPositions: {\n c1x: number;\n c1y: number;\n c2y: number;\n c3y: number;\n };\n colorLabels: ColorNames = ObjectFromEntries(colorNames.map(c => [c, c])) as ColorNames;\n colorKeywords: string[] | false;\n colorPresets: ColorPalette | string[] | false;\n componentLabels: ColorPickerLabels;\n pickerToggle: HTMLElement;\n menuToggle: HTMLElement;\n colorPicker: HTMLElement;\n colorMenu: HTMLElement;\n controls: HTMLElement;\n inputs: HTMLInputElement[];\n controlKnobs: HTMLElement[];\n visuals: HTMLElement[];\n\n /**\n * Returns a new `ColorPicker` instance. The target of this constructor\n * must be an `HTMLInputElement`.\n *\n * @param target the target `` element\n * @param config instance options\n */\n constructor(target: (HTMLElement & HTMLInputElement) | string, config?: Partial) {\n const input = querySelector(target) as HTMLInputElement;\n\n // invalidate\n if (typeof target === 'undefined') throw new TypeError(`ColorPicker target not specified.`);\n if (isString(target) && !input) throw new TypeError(`ColorPicker target \"${target}\" cannot be found.`);\n this.input = input;\n\n const parent = closest(input, colorPickerParentSelector);\n if (!parent) throw new TypeError('ColorPicker requires a specific markup to work.');\n\n this.parent = parent;\n this.id = getUID(input, colorPickerString);\n this.dragElement = undefined;\n this.isOpen = false;\n this.controlPositions = {\n c1x: 0,\n c1y: 0,\n c2y: 0,\n c3y: 0,\n };\n // this.colorLabels = {};\n this.colorKeywords = false;\n this.colorPresets = false;\n\n // process options\n const { format, componentLabels, colorLabels, colorKeywords, colorPresets } = normalizeOptions(\n input,\n colorPickerDefaults,\n config || {},\n );\n\n let translatedColorLabels = colorNames;\n /* istanbul ignore else */\n if (isArray(colorLabels) && colorLabels.length === 17) {\n translatedColorLabels = colorLabels;\n } else if (isString(colorLabels) && colorLabels.split(',').length === 17) {\n translatedColorLabels = colorLabels.split(',');\n }\n\n // expose colour labels to all methods\n ObjectAssign(this.colorLabels, ObjectFromEntries(translatedColorLabels.map((c, i) => [colorNames[i], c])));\n\n // update and expose component labels\n const tempComponentLabels =\n isString(componentLabels) && isValidJSON(componentLabels)\n ? (JSON.parse(componentLabels) as ColorPickerLabels)\n : componentLabels;\n this.componentLabels = ObjectAssign({ ...colorPickerLabels }, tempComponentLabels);\n this.color = new Color(input.value || '#fff', format);\n this.format = format;\n\n // set colour defaults\n if (isArray(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords;\n } else if (isString(colorKeywords) && colorKeywords.length) {\n this.colorKeywords = colorKeywords.split(',').map(x => x.trim());\n }\n\n // set colour presets\n if (isArray(colorPresets) && colorPresets.length) {\n this.colorPresets = colorPresets;\n } else if (colorPresets && isValidJSON(colorPresets)) {\n const { hue, hueSteps, lightSteps, saturation } = JSON.parse(colorPresets) as {\n hue: number;\n hueSteps: number;\n lightSteps: number;\n saturation: number;\n };\n this.colorPresets = new ColorPalette(hue, hueSteps, lightSteps, saturation);\n } else if (isString(colorPresets)) {\n this.colorPresets = colorPresets.split(',').map((x: string) => x.trim());\n }\n\n // generate markup\n setMarkup(this);\n\n const [colorPicker, colorMenu] = getElementsByClassName('color-dropdown', parent);\n // set main elements\n this.pickerToggle = querySelector('.picker-toggle', parent) as HTMLElement;\n this.menuToggle = querySelector('.menu-toggle', parent) as HTMLElement;\n this.colorPicker = colorPicker;\n this.colorMenu = colorMenu;\n this.inputs = [...getElementsByClassName('color-input', parent)] as HTMLInputElement[];\n const [controls] = getElementsByClassName('color-controls', parent);\n this.controls = controls;\n this.controlKnobs = [...getElementsByClassName('knob', controls)];\n this.visuals = [...getElementsByClassName('visual-control', controls)];\n\n // update colour picker controls, inputs and visuals\n this.update();\n // console.log(this)\n\n // add main events listeners\n toggleEvents(this, true);\n\n // set component data\n Data.set(input, colorPickerString, this);\n }\n\n /** Returns the current colour value */\n get value(): string {\n return this.input.value;\n }\n\n /**\n * Sets a new colour value.\n *\n * @param {string} v new colour value\n */\n set value(v: string) {\n this.input.value = v;\n }\n\n /** Check if the colour presets include any non-colour. */\n get hasNonColor(): boolean {\n return this.colorKeywords instanceof Array && this.colorKeywords.some(x => nonColors.includes(x));\n }\n\n /** Returns hexadecimal value of the current colour. */\n get hex(): string {\n return this.color.toHex(true);\n }\n\n /** Returns the current colour value in {h,s,v,a} object format. */\n get hsv(): HSVA {\n return this.color.toHsv();\n }\n\n /** Returns the current colour value in {h,s,l,a} object format. */\n get hsl(): HSLA {\n return this.color.toHsl();\n }\n\n /** Returns the current colour value in {h,w,b,a} object format. */\n get hwb(): HWBA {\n return this.color.toHwb();\n }\n\n /** Returns the current colour value in {r,g,b,a} object format. */\n get rgb(): RGBA {\n return this.color.toRgb();\n }\n\n /** Returns the current colour brightness. */\n get brightness(): number {\n return this.color.brightness;\n }\n\n /** Returns the current colour luminance. */\n get luminance(): number {\n return this.color.luminance;\n }\n\n /** Checks if the current colour requires a light text colour. */\n get isDark(): boolean {\n const { color, brightness } = this;\n return brightness < 120 && color.a > 0.33;\n }\n\n /** Checks if the current input value is a valid colour. */\n get isValid(): boolean {\n const inputValue = this.input.value;\n return inputValue !== '' && new Color(inputValue).isValid;\n }\n\n /** Returns the colour appearance, usually the closest colour name for the current value. */\n get appearance(): string {\n const { colorLabels, hsl, hsv, format } = this;\n\n const hue = roundPart(hsl.h * 360);\n const saturationSource = format === 'hsl' ? hsl.s : hsv.s;\n const saturation = roundPart(saturationSource * 100);\n const lightness = roundPart(hsl.l * 100);\n const hsvl = hsv.v * 100;\n\n let colorName = 'black';\n\n // determine color appearance\n /* istanbul ignore else */\n if (lightness === 100 && saturation === 0) {\n colorName = colorLabels.white;\n } else if (lightness === 0) {\n colorName = colorLabels.black;\n } else if (saturation === 0) {\n colorName = colorLabels.grey;\n } else if (hue < 15 || hue >= 345) {\n colorName = colorLabels.red;\n } else if (hue >= 15 && hue < 45) {\n colorName = hsvl > 80 && saturation > 80 ? colorLabels.orange : colorLabels.brown;\n } else if (hue >= 45 && hue < 75) {\n const isGold = hue > 46 && hue < 54 && hsvl < 80 && saturation > 90;\n const isOlive = hue >= 54 && hue < 75 && hsvl < 80;\n colorName = isGold ? colorLabels.gold : colorLabels.yellow;\n colorName = isOlive ? colorLabels.olive : colorName;\n } else if (hue >= 75 && hue < 155) {\n colorName = hsvl < 68 ? colorLabels.green : colorLabels.lime;\n } else if (hue >= 155 && hue < 175) {\n colorName = colorLabels.teal;\n } else if (hue >= 175 && hue < 195) {\n colorName = colorLabels.cyan;\n } else if (hue >= 195 && hue < 255) {\n colorName = colorLabels.blue;\n } else if (hue >= 255 && hue < 270) {\n colorName = colorLabels.violet;\n } else if (hue >= 270 && hue < 295) {\n colorName = colorLabels.magenta;\n } else if (hue >= 295 && hue < 345) {\n colorName = colorLabels.pink;\n }\n return colorName;\n }\n\n /** Updates `ColorPicker` visuals. */\n updateVisuals(): void {\n const { controlPositions, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { offsetHeight } = v1;\n const hue = controlPositions.c2y / offsetHeight;\n const { r, g, b } = new Color({ h: hue, s: 1, l: 0.5 }).toRgb();\n const whiteGrad = 'linear-gradient(rgb(255,255,255) 0%, rgb(255,255,255) 100%)';\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n const roundA = roundPart(alpha * 100) / 100;\n\n const fill = new Color({\n h: hue,\n s: 1,\n l: 0.5,\n a: alpha,\n }).toRgbString();\n const hueGradient = `linear-gradient(\n rgb(255,0,0) 0%, rgb(255,255,0) 16.67%,\n rgb(0,255,0) 33.33%, rgb(0,255,255) 50%,\n rgb(0,0,255) 66.67%, rgb(255,0,255) 83.33%,\n rgb(255,0,0) 100%)`;\n setElementStyle(v1, {\n background: `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,${roundA}) 100%),\n linear-gradient(to right, rgba(255,255,255,${roundA}) 0%, ${fill} 100%),\n ${whiteGrad}`,\n });\n setElementStyle(v2, { background: hueGradient });\n\n setElementStyle(v3, {\n background: `linear-gradient(rgba(${r},${g},${b},1) 0%,rgba(${r},${g},${b},0) 100%)`,\n });\n }\n\n /**\n * The `ColorPicker` *focusout* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleFocusOut = ({ relatedTarget }: FocusEvent & { relatedTarget: HTMLElement }): void => {\n if (relatedTarget && !this.parent.contains(relatedTarget)) {\n this.hide(true);\n }\n };\n\n /**\n * The `ColorPicker` *keyup* event listener when open.\n *\n * @param e\n * @this {ColorPicker}\n */\n handleDismiss = ({ code }: KeyboardEvent): void => {\n if (this.isOpen && code === keyEscape) {\n this.hide();\n }\n };\n\n /**\n * The `ColorPicker` *scroll* event listener when open.\n *\n * @param e\n */\n handleScroll = (e: Event) => {\n const { activeElement } = getDocument(this.input);\n\n this.updateDropdownPosition();\n\n /* istanbul ignore next */\n if (\n ([pointermoveEvent, touchmoveEvent].includes(e.type) && this.dragElement) ||\n (activeElement && this.controlKnobs.includes(activeElement as HTMLElement))\n ) {\n e.stopPropagation();\n e.preventDefault();\n }\n };\n\n /**\n * The `ColorPicker` keyboard event listener for menu navigation.\n *\n * @param e\n */\n menuKeyHandler = (e: KeyboardEvent & { target: HTMLElement }) => {\n const { target, code } = e;\n const { previousElementSibling, nextElementSibling, parentElement } = target;\n const isColorOptionsMenu = parentElement && hasClass(parentElement, 'color-options');\n const allSiblings = parentElement ? [...parentElement.children] : [];\n const columnsCount =\n isColorOptionsMenu && getElementStyle(parentElement, 'grid-template-columns').split(' ').length;\n const currentIndex = allSiblings.indexOf(target);\n const previousElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex - columnsCount];\n const nextElement = currentIndex > -1 && columnsCount && allSiblings[currentIndex + columnsCount];\n\n if ([keyArrowDown, keyArrowUp, keySpace].includes(code)) {\n // prevent scroll when navigating the menu via arrow keys / Space\n e.preventDefault();\n }\n if (isColorOptionsMenu) {\n if (previousElement && code === keyArrowUp) {\n focus(previousElement as HTMLElement);\n } else if (nextElement && code === keyArrowDown) {\n focus(nextElement as HTMLElement);\n } else if (previousElementSibling && code === keyArrowLeft) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && code === keyArrowRight) {\n focus(nextElementSibling as HTMLElement);\n }\n } else if (previousElementSibling && [keyArrowLeft, keyArrowUp].includes(code)) {\n focus(previousElementSibling as HTMLElement);\n } else if (nextElementSibling && [keyArrowRight, keyArrowDown].includes(code)) {\n focus(nextElementSibling as HTMLElement);\n }\n\n if ([keyEnter, keySpace].includes(code)) {\n this.menuClickHandler(e);\n }\n };\n\n /**\n * The `ColorPicker` click event listener for the colour menu presets / defaults.\n *\n * @param e\n * @this {ColorPicker}\n */\n menuClickHandler = (e: Event) => {\n const { target } = e;\n const { colorMenu } = this;\n const newOption = (getAttribute(target as HTMLElement, 'data-value') || '').trim();\n // invalidate for targets other than color options\n if (!newOption.length) return;\n const currentActive = querySelector('li.active', colorMenu);\n let newColor = newOption;\n newColor = nonColors.includes(newColor) ? 'white' : newColor;\n newColor = newColor === 'transparent' ? 'rgba(0,0,0,0)' : newColor;\n\n const { r, g, b, a } = new Color(newColor);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n this.update();\n\n /* istanbul ignore else */\n if (currentActive !== target) {\n /* istanbul ignore else */\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n\n addClass(target as HTMLElement, 'active');\n setAttribute(target as HTMLElement, ariaSelected, 'true');\n\n if (nonColors.includes(newOption)) {\n this.value = newOption;\n }\n firePickerChange(this);\n }\n };\n\n /**\n * The `ColorPicker` *touchstart* / *mousedown* events listener for control knobs.\n *\n * @param e\n */\n pointerDown = (e: PointerEvent & { target: HTMLElement }) => {\n if (e.button !== 0) return;\n const { target, pageX, pageY } = e;\n const { colorMenu, visuals, controlKnobs } = this;\n const [v1, v2, v3] = visuals;\n const [c1, c2, c3] = controlKnobs;\n const visual = controlKnobs.includes(target) ? (target.previousElementSibling as HTMLElement) : target;\n const visualRect = getBoundingClientRect(visual);\n const html = getDocumentElement(v1);\n const offsetX = pageX - html.scrollLeft - visualRect.left;\n const offsetY = pageY - html.scrollTop - visualRect.top;\n\n /* istanbul ignore else */\n if (target === v1 || target === c1) {\n this.dragElement = visual;\n this.changeControl1(offsetX, offsetY);\n } else if (target === v2 || target === c2) {\n this.dragElement = visual;\n this.changeControl2(offsetY);\n } else if (target === v3 || target === c3) {\n this.dragElement = visual;\n this.changeAlpha(offsetY);\n }\n\n if (colorMenu) {\n const currentActive = querySelector('li.active', colorMenu);\n if (currentActive) {\n removeClass(currentActive, 'active');\n removeAttribute(currentActive, ariaSelected);\n }\n }\n e.preventDefault();\n };\n\n /**\n * The `ColorPicker` *touchend* / *mouseup* events listener for control knobs.\n *\n * @param e\n * @this\n */\n pointerUp = ({ target }: PointerEvent & { target: HTMLElement }) => {\n const { parent } = this;\n const doc = getDocument(parent);\n const currentOpen = querySelector(`${colorPickerParentSelector}.open`, doc) !== null;\n const selection = doc.getSelection();\n\n if (!this.dragElement && (!selection || !selection.toString().length) && !parent.contains(target)) {\n this.hide(currentOpen);\n }\n\n this.dragElement = undefined;\n };\n\n /**\n * The `ColorPicker` *touchmove* / *mousemove* events listener for control knobs.\n *\n * @param {PointerEvent} e\n */\n pointerMove = (e: PointerEvent) => {\n const { dragElement, visuals } = this;\n const [v1, v2, v3] = visuals;\n const { pageX, pageY } = e;\n\n if (!dragElement) return;\n\n const controlRect = getBoundingClientRect(dragElement);\n const win = getDocumentElement(v1);\n const offsetX = pageX - win.scrollLeft - controlRect.left;\n const offsetY = pageY - win.scrollTop - controlRect.top;\n\n if (dragElement === v1) {\n this.changeControl1(offsetX, offsetY);\n }\n\n if (dragElement === v2) {\n this.changeControl2(offsetY);\n }\n\n if (dragElement === v3) {\n this.changeAlpha(offsetY);\n }\n };\n\n /**\n * The `ColorPicker` *keydown* event listener for control knobs.\n *\n * @param e\n */\n handleKnobs = (e: Event & { code: string }) => {\n const { target, code } = e;\n\n // only react to arrow buttons\n if (![keyArrowUp, keyArrowDown, keyArrowLeft, keyArrowRight].includes(code)) return;\n e.preventDefault();\n\n const { controlKnobs, visuals } = this;\n const { offsetWidth, offsetHeight } = visuals[0];\n const [c1, c2, c3] = controlKnobs;\n const { activeElement } = getDocument(c1);\n const currentKnob = controlKnobs.find(x => x === activeElement);\n const yRatio = offsetHeight / 360;\n\n /* istanbul ignore else */\n if (currentKnob) {\n let offsetX = 0;\n let offsetY = 0;\n\n /* istanbul ignore else */\n if (target === c1) {\n const xRatio = offsetWidth / 100;\n\n /* istanbul ignore else */\n if ([keyArrowLeft, keyArrowRight].includes(code)) {\n this.controlPositions.c1x += code === keyArrowRight ? xRatio : -xRatio;\n } else if ([keyArrowUp, keyArrowDown].includes(code)) {\n this.controlPositions.c1y += code === keyArrowDown ? yRatio : -yRatio;\n }\n\n offsetX = this.controlPositions.c1x;\n offsetY = this.controlPositions.c1y;\n this.changeControl1(offsetX, offsetY);\n } else if (target === c2) {\n this.controlPositions.c2y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c2y;\n this.changeControl2(offsetY);\n } else if (target === c3) {\n this.controlPositions.c3y += [keyArrowDown, keyArrowRight].includes(code) ? yRatio : -yRatio;\n\n offsetY = this.controlPositions.c3y;\n this.changeAlpha(offsetY);\n }\n this.handleScroll(e);\n }\n };\n\n /** The event listener of the colour form inputs. */\n changeHandler = (): void => {\n let colorSource;\n const { inputs, format, value: currentValue, input, controlPositions, visuals } = this;\n const { activeElement } = getDocument(input);\n const { offsetHeight } = visuals[0];\n const [i1, , , i4] = inputs;\n const [v1, v2, v3, v4] =\n format === 'rgb'\n ? inputs.map(i => parseFloat(i.value) / (i === i4 ? 100 : 1))\n : inputs.map(i => parseFloat(i.value) / (i !== i1 ? 100 : 360));\n const isNonColorValue = this.hasNonColor && nonColors.includes(currentValue);\n const alpha = i4 ? v4 : 1 - controlPositions.c3y / offsetHeight;\n\n /* istanbul ignore else */\n if (activeElement === input || (activeElement && inputs.includes(activeElement as HTMLInputElement))) {\n if (activeElement === input) {\n if (isNonColorValue) {\n colorSource = currentValue === 'transparent' ? 'rgba(0,0,0,0)' : 'rgb(0,0,0)';\n } else {\n colorSource = currentValue;\n }\n } else if (format === 'hex') {\n colorSource = i1.value;\n } else if (format === 'hsl') {\n colorSource = {\n h: v1,\n s: v2,\n l: v3,\n a: alpha,\n };\n } else if (format === 'hwb') {\n colorSource = {\n h: v1,\n w: v2,\n b: v3,\n a: alpha,\n };\n } else {\n colorSource = {\n r: v1,\n g: v2,\n b: v3,\n a: alpha,\n };\n }\n\n const { r, g, b, a } = new Color(colorSource);\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n this.setControlPositions();\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n\n // set non-color keyword\n if (activeElement === input && isNonColorValue) {\n this.value = currentValue;\n }\n }\n };\n\n /**\n * Updates `ColorPicker` first control:\n * * `lightness` and `saturation` for HEX/RGB;\n * * `lightness` and `hue` for HSL.\n *\n * @param X the X component of the offset\n * @param Y the Y component of the offset\n */\n changeControl1(X: number, Y: number): void {\n let [offsetX, offsetY] = [0, 0];\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n if (X > offsetWidth) offsetX = offsetWidth;\n else if (X >= 0) offsetX = X;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = controlPositions.c2y / offsetHeight;\n\n const saturation = offsetX / offsetWidth;\n\n const lightness = 1 - offsetY / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new positions\n this.controlPositions.c1x = offsetX;\n this.controlPositions.c1y = offsetY;\n\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` second control:\n * * `hue` for HEX/RGB/HWB;\n * * `saturation` for HSL.\n *\n * @param Y the Y offset\n */\n changeControl2(Y: number) {\n const { controlPositions, visuals } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n const hue = offsetY / offsetHeight;\n const saturation = controlPositions.c1x / offsetWidth;\n const lightness = 1 - controlPositions.c1y / offsetHeight;\n const alpha = 1 - controlPositions.c3y / offsetHeight;\n\n // new color\n const { r, g, b, a } = new Color({\n h: hue,\n s: saturation,\n v: lightness,\n a: alpha,\n });\n\n ObjectAssign(this.color, {\n r,\n g,\n b,\n a,\n });\n\n // new position\n this.controlPositions.c2y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` last control,\n * the `alpha` channel.\n *\n * @param Y\n */\n changeAlpha(Y: number) {\n const { visuals } = this;\n const { offsetHeight } = visuals[0];\n let offsetY = 0;\n\n if (Y > offsetHeight) offsetY = offsetHeight;\n else if (Y >= 0) offsetY = Y;\n\n // update color alpha\n const alpha = 1 - offsetY / offsetHeight;\n this.color.setAlpha(alpha);\n // update position\n this.controlPositions.c3y = offsetY;\n // update color picker\n this.updateAppearance();\n this.updateInputs();\n this.updateControls();\n this.updateVisuals();\n }\n\n /**\n * Updates `ColorPicker` control positions on:\n * * initialization\n * * window resize\n */\n update = () => {\n this.updateDropdownPosition();\n this.updateAppearance();\n this.setControlPositions();\n this.updateInputs(true);\n this.updateControls();\n this.updateVisuals();\n };\n\n /** Updates the open dropdown position on *scroll* event. */\n updateDropdownPosition() {\n const { input, colorPicker, colorMenu } = this;\n const elRect = getBoundingClientRect(input);\n const { top, bottom } = elRect;\n const { offsetHeight: elHeight } = input;\n const windowHeight = getDocumentElement(input).clientHeight;\n const isPicker = hasClass(colorPicker, 'show');\n const dropdown = isPicker ? colorPicker : colorMenu;\n if (!dropdown) return;\n const { offsetHeight: dropHeight } = dropdown;\n const distanceBottom = windowHeight - bottom;\n const distanceTop = top;\n const bottomExceed = top + dropHeight + elHeight > windowHeight; // show\n const topExceed = top - dropHeight < 0; // show-top\n\n if ((hasClass(dropdown, 'bottom') || !topExceed) && distanceBottom < distanceTop && bottomExceed) {\n removeClass(dropdown, 'bottom');\n addClass(dropdown, 'top');\n } else {\n removeClass(dropdown, 'top');\n addClass(dropdown, 'bottom');\n }\n }\n\n /** Updates control knobs' positions. */\n setControlPositions() {\n const { visuals, color, hsv } = this;\n const { offsetHeight, offsetWidth } = visuals[0];\n const alpha = color.a;\n const hue = hsv.h;\n\n const saturation = hsv.s;\n const lightness = hsv.v;\n\n this.controlPositions.c1x = saturation * offsetWidth;\n this.controlPositions.c1y = (1 - lightness) * offsetHeight;\n this.controlPositions.c2y = hue * offsetHeight;\n this.controlPositions.c3y = (1 - alpha) * offsetHeight;\n }\n\n /** Update the visual appearance label and control knob labels. */\n updateAppearance() {\n const { componentLabels, color, parent, hsv, hex, format, controlKnobs } = this;\n const { appearanceLabel, hexLabel, valueLabel } = componentLabels;\n let { r, g, b } = color.toRgb();\n const [knob1, knob2, knob3] = controlKnobs;\n const hue = roundPart(hsv.h * 360);\n const alpha = color.a;\n const saturation = roundPart(hsv.s * 100);\n const lightness = roundPart(hsv.v * 100);\n const colorName = this.appearance;\n\n let colorLabel = `${hexLabel} ${hex.split('').join(' ')}`;\n\n if (format === 'hwb') {\n const { hwb } = this;\n const whiteness = roundPart(hwb.w * 100);\n const blackness = roundPart(hwb.b * 100);\n colorLabel = `HWB: ${hue}°, ${whiteness}%, ${blackness}%`;\n setAttribute(knob1, ariaValueText, `${whiteness}% & ${blackness}%`);\n setAttribute(knob1, ariaValueNow, `${whiteness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}%`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n } else {\n [r, g, b] = [r, g, b].map(roundPart);\n colorLabel = format === 'hsl' ? `HSL: ${hue}°, ${saturation}%, ${lightness}%` : colorLabel;\n colorLabel = format === 'rgb' ? `RGB: ${r}, ${g}, ${b}` : colorLabel;\n\n setAttribute(knob1, ariaValueText, `${lightness}% & ${saturation}%`);\n setAttribute(knob1, ariaValueNow, `${lightness}`);\n setAttribute(knob2, ariaDescription, `${valueLabel}: ${colorLabel}. ${appearanceLabel}: ${colorName}.`);\n setAttribute(knob2, ariaValueText, `${hue}°`);\n setAttribute(knob2, ariaValueNow, `${hue}`);\n }\n\n const alphaValue = roundPart(alpha * 100);\n setAttribute(knob3, ariaValueText, `${alphaValue}%`);\n setAttribute(knob3, ariaValueNow, `${alphaValue}`);\n\n // update the input backgroundColor\n const newColor = color.toString();\n setElementStyle(this.input, { backgroundColor: newColor });\n\n // toggle dark/light classes will also style the placeholder\n // dark sets color white, light sets color black\n // isDark ? '#000' : '#fff'\n if (!this.isDark) {\n if (hasClass(parent, 'txt-dark')) removeClass(parent, 'txt-dark');\n if (!hasClass(parent, 'txt-light')) addClass(parent, 'txt-light');\n } else {\n if (hasClass(parent, 'txt-light')) removeClass(parent, 'txt-light');\n if (!hasClass(parent, 'txt-dark')) addClass(parent, 'txt-dark');\n }\n }\n\n /** Updates the control knobs actual positions. */\n updateControls() {\n const { controlKnobs, controlPositions } = this;\n let { c1x, c1y, c2y, c3y } = controlPositions;\n const [control1, control2, control3] = controlKnobs;\n // round control positions\n [c1x, c1y, c2y, c3y] = [c1x, c1y, c2y, c3y].map(roundPart);\n\n setElementStyle(control1, {\n transform: `translate3d(${c1x - 4}px,${c1y - 4}px,0)`,\n });\n setElementStyle(control2, { transform: `translate3d(0,${c2y - 4}px,0)` });\n setElementStyle(control3, { transform: `translate3d(0,${c3y - 4}px,0)` });\n }\n\n /**\n * Updates all color form inputs.\n *\n * @param isPrevented when `true`, the component original event is prevented\n */\n updateInputs(isPrevented?: boolean) {\n const { value: oldColor, format, inputs, color, hsl } = this;\n const [i1, i2, i3, i4] = inputs;\n const alpha = roundPart(color.a * 100);\n const hue = roundPart(hsl.h * 360);\n let newColor = color.toString();\n\n /* istanbul ignore else */\n if (format === 'hex') {\n newColor = this.color.toHexString(true);\n i1.value = this.hex;\n } else if (format === 'hsl') {\n const lightness = roundPart(hsl.l * 100);\n const saturation = roundPart(hsl.s * 100);\n newColor = this.color.toHslString();\n i1.value = `${hue}`;\n i2.value = `${saturation}`;\n i3.value = `${lightness}`;\n i4.value = `${alpha}`;\n } else if (format === 'hwb') {\n const { w, b } = this.hwb;\n const whiteness = roundPart(w * 100);\n const blackness = roundPart(b * 100);\n\n newColor = this.color.toHwbString();\n i1.value = `${hue}`;\n i2.value = `${whiteness}`;\n i3.value = `${blackness}`;\n i4.value = `${alpha}`;\n } else if (format === 'rgb') {\n let { r, g, b } = this.rgb;\n [r, g, b] = [r, g, b].map(roundPart);\n\n newColor = this.color.toRgbString();\n i1.value = `${r}`;\n i2.value = `${g}`;\n i3.value = `${b}`;\n i4.value = `${alpha}`;\n }\n\n // update the color value\n this.value = newColor;\n\n // don't trigger the custom event unless it's really changed\n if (!isPrevented && newColor !== oldColor) {\n firePickerChange(this);\n }\n }\n\n /**\n * Toggle the `ColorPicker` dropdown visibility.\n *\n * @param e\n */\n togglePicker = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorPicker } = this;\n\n if (this.isOpen && hasClass(colorPicker, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorPicker);\n }\n };\n\n /** Shows the `ColorPicker` dropdown. */\n showPicker = () => {\n const { colorPicker } = this;\n\n if (!['top', 'bottom'].some(c => hasClass(colorPicker, c))) {\n showDropdown(this, colorPicker);\n }\n };\n\n /**\n * Toggles the visibility of the `ColorPicker` presets menu.\n *\n * @param e\n * @this {ColorPicker}\n */\n toggleMenu = (e?: Event) => {\n if (e) e.preventDefault();\n const { colorMenu } = this;\n\n if (this.isOpen && hasClass(colorMenu, 'show')) {\n this.hide(true);\n } else {\n showDropdown(this, colorMenu);\n }\n };\n\n /**\n * Hides the currently open `ColorPicker` dropdown.\n *\n * @param {boolean=} focusPrevented\n */\n hide(focusPrevented?: boolean) {\n if (this.isOpen) {\n const { pickerToggle, menuToggle, colorPicker, colorMenu, parent, input } = this;\n const openPicker = hasClass(colorPicker, 'show');\n const openDropdown = openPicker ? colorPicker : colorMenu;\n const relatedBtn = openPicker ? pickerToggle : menuToggle;\n const animationDuration = openDropdown && getElementTransitionDuration(openDropdown);\n\n this.value = this.color.toString(true);\n\n /* istanbul ignore else */\n if (openDropdown) {\n removeClass(openDropdown, 'show');\n setAttribute(relatedBtn, ariaExpanded, 'false');\n setTimeout(() => {\n removePosition(openDropdown);\n /* istanbul ignore else */\n if (!querySelector('.show', parent)) {\n removeClass(parent, 'open');\n toggleEventsOnShown(this);\n this.isOpen = false;\n }\n }, animationDuration);\n }\n\n if (!focusPrevented) {\n focus(pickerToggle);\n }\n setAttribute(input, tabindex, '-1');\n if (relatedBtn === menuToggle) {\n setAttribute(menuToggle, tabindex, '-1');\n }\n }\n }\n\n /** Removes `ColorPicker` from target ``. */\n dispose() {\n const { input, parent } = this;\n this.hide(true);\n toggleEvents(this);\n [...parent.children].forEach(el => {\n if (el !== input) el.remove();\n });\n\n removeAttribute(input, tabindex);\n setElementStyle(input, { backgroundColor: '' });\n\n ['txt-light', 'txt-dark'].forEach(c => removeClass(parent, c));\n Data.remove(input, colorPickerString);\n }\n}\n"],"names":["me","ge","Ee","Ae","ke","Me","K","P","_","tt","st","rt","it","St","kt","Mt","Ct","zt","Bt","Re","Qe","je","qe","Ye","$e","sn","Rt","U","fn","jt","A","qt","S","z","t","x","N","Gt","e","n","o","s","Jt","Kt","r","Xt","Yt","Tn","Cn","Ln","In","zn","v","i","u","E","L","Hn","k","W","R","d","M","Zt","$t","Q","g","ne","Qn","V","w","oe","jn","a","l","p","m","y","j","Kn","Zn","$n","I","to","h","T","B","H","b","ae","ro","ie","le","So","To","D","F","rr","tr","O","er","$","f","Z","c","J","G","X","C","Y","q","sr","ColorPalette","Color","args","hue","hueSteps","lightSteps","lightnessArray","saturation","colors","hueStep","half","steps1To13","lightSets","closestSet","set","lightStep","currentHue","newColor","colorPickerLabels","colorNames","isValidJSON","str","isString","vHidden","getColorForm","self","format","id","componentLabels","colorForm","createElement","components","toUpperCase","cID","formatLabel","cInputLabel","setAttribute","cInput","max","step","ObjectAssign","getColorControls","hueLabel","alphaLabel","lightnessLabel","saturationLabel","whitenessLabel","blacknessLabel","max1","max2","max3","ctrl1Label","ctrl2Label","colorControls","colorPointer","colorSlider","template","min","control","knob","getColorMenu","colorsSource","menuClass","input","defaultsLabel","presetsLabel","isOptionsMenu","isPalette","menuLabel","colorsArray","colorsCount","fit","isMultiLine","rowCountHover","rowCount","isScrollable","finalClass","gap","optionSize","menuHeight","menuHeightHover","menu","setElementStyle","value","label","isActive","getAttribute","option","setMarkup","parent","colorKeywords","colorPresets","colorValue","nonColors","toggleLabel","pickerLabel","hexLabel","color","formatString","pickerBtn","pickerDropdown","presetsDropdown","presetsBtn","xmlns","presetsIcon","createElementNS","ariaHidden","path","tabindex","colorPickerString","colorPickerSelector","colorPickerParentSelector","colorPickerDefaults","roundPart","getColorPickerInstance","element","getInstance","initColorPicker","ColorPicker","toggleEvents","action","on","off","pickerToggle","menuToggle","focusinEvent","mouseclickEvent","toggleEventsOnShown","colorMenu","doc","getDocument","win","getWindow","pointerdownEvent","keydownEvent","scrollEvent","resizeEvent","changeEvent","pointermoveEvent","pointerupEvent","focusoutEvent","keyupEvent","firePickerChange","dispatchEvent","removePosition","removeClass","showDropdown","dropdown","colorPicker","isPicker","openDropdown","activeBtn","nextBtn","hasClass","addClass","reflow","ariaExpanded","getBoundingClientRect","version","ObjectFromEntries","target","config","querySelector","closest","getUID","colorLabels","normalizeOptions","translatedColorLabels","isArray","tempComponentLabels","getElementsByClassName","controls","Data","brightness","inputValue","hsl","hsv","saturationSource","lightness","hsvl","colorName","isGold","isOlive","controlPositions","visuals","v1","v2","v3","offsetHeight","whiteGrad","alpha","roundA","fill","hueGradient","relatedTarget","code","keyEscape","activeElement","touchmoveEvent","previousElementSibling","nextElementSibling","parentElement","isColorOptionsMenu","allSiblings","columnsCount","getElementStyle","currentIndex","previousElement","nextElement","keyArrowDown","keyArrowUp","keySpace","focus","keyArrowLeft","keyArrowRight","keyEnter","newOption","currentActive","removeAttribute","ariaSelected","pageX","pageY","controlKnobs","c1","c2","c3","visual","visualRect","html","getDocumentElement","offsetX","offsetY","currentOpen","selection","dragElement","controlRect","offsetWidth","currentKnob","yRatio","xRatio","colorSource","inputs","currentValue","i1","i4","v4","isNonColorValue","elRect","top","bottom","elHeight","windowHeight","dropHeight","distanceBottom","distanceTop","bottomExceed","topExceed","hex","appearanceLabel","valueLabel","knob1","knob2","knob3","colorLabel","hwb","whiteness","blackness","ariaValueText","ariaValueNow","ariaDescription","alphaValue","c1x","c1y","c2y","c3y","control1","control2","control3","isPrevented","oldColor","i2","i3","focusPrevented","openPicker","relatedBtn","animationDuration","getElementTransitionDuration","el"],"mappings":"wCAAK,MAAsBA,GAAK,mBAA6CC,GAAK,gBAAuCC,GAAK,cAAkGC,GAAK,gBAA6DC,EAAK,gBAAiBC,GAAK,iBAA+DC,GAAI,SAA6BC,GAAI,mBAAoEC,GAAI,UAAWC,GAAK,WAA0EC,GAAK,UAA4BC,GAAK,QAAsBC,GAAK,QAAqQC,GAAK,cAAoCC,GAAK,cAAeC,GAAK,YAAoDC,GAAK,SAA+DC,GAAK,SAA4CC,GAAK,YAuG1mCC,EAAK,YAAaC,GAAK,UAAWC,GAAK,YAAaC,EAAK,aAAgFC,GAAK,QAA6BC,GAAK,SAAqFC,GAAK,QAA+GC,GAAK,qBAAmEC,GAAI,qBA0B/XC,EAAK,WAAYC,GAAK,UAAU,cAAeC,GAAID,GAAI,CAAE,UAAWE,EAAI,EAAG,UAAWC,GAAID,GAAIE,GAAI,4BAEvLH,GAAQA,GAAE,OAAO,KAAMI,GAAMD,GAAE,KAAKC,EAAE,KAAK,CAAC,EAAQD,GAAE,KAAKD,EAAC,EAC9CG,MAAAA,GAAI,qBAA2BL,GAAIA,GAAE,OAAO,KAAMI,GAAMC,GA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AC,GACzasD,GAAG1D,EAAE,YAAa,EAAC,KAAMI,CAAC,EAAI,KAAMuD,EAAK,CAAC3D,EAAGI,IAAMgB,GAAEpB,CAAC,EAAIA,GAAKmB,EAAEf,CAAC,EAAIA,EAAIuB,EAAC,GAAI,cAAc3B,CAAC,EAAwM4D,GAAK,CAAC5D,EAAGI,KAAOA,GAAKe,EAAEf,CAAC,EAAIA,EAAIuB,EAAC,GAAI,uBACzU3B,CACF,EC5bME,GAAI,CAAC,cAAe,eAAgB,UAAW,SAAU,SAAS,EAAGoD,EAAK,GAAM,CACpF,MAAM,EAAI,KAAK,MAAM,CAAC,EACtB,OAAO,EAAI,EAAI,GAAM,EAAI,KAAK,MAAM,CAAC,CACvC,EAAGH,GAAI,CACL,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,GACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,uBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,mBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,iBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,oBACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,kBACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,eACA,CACE,EAAG,GACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,QACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,CACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,GACJ,CACF,EACD,CACE,gBACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,MACA,CACE,EAAG,IACH,EAAG,EACH,EAAG,CACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,aACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,EACJ,CACF,EACD,CACE,WACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,EACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,cACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,YACA,CACE,EAAG,GACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,MACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,OACA,CACE,EAAG,EACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,UACA,CACE,EAAG,IACH,EAAG,IACH,EAAG,GACJ,CACF,EACD,CACE,SACA,CACE,EAAG,IACH,EAAG,GACH,EAAG,E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Q,EAC/B1B,EAAgBnB,EAAO,CAAE,gBAAiB,EAAI,CAAA,EAE7C,CAAA,YAAa,UAAU,EAAE,WAAakF,EAAYxD,EAAQjG,CAAC,CAAC,EACxDoL,GAAA,OAAO7G,EAAO8C,CAAiB,CACtC,CACF","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/package.json b/package.json index a1d7e54..89f00e3 100644 --- a/package.json +++ b/package.json @@ -38,13 +38,16 @@ "test": "npm run pre-test && cypress run", "cypress": "npm run pre-test && npx cypress open", "clean-coverage": "rimraf coverage .nyc_output", + "prepublishOnly": "pnpm up && pnpm format && pnpm build", "coverage:report": "nyc report --reporter=lcov --reporter=json --reporter=text --reporter=json-summary", "format": "prettier --write \"src/**/*.ts\"", + "lint": "npm run lint:ts && npm run check:ts && npm run lint:css", "fix:ts": "eslint src --config .eslintrc.cjs --fix", "lint:ts": "eslint src --config .eslintrc.cjs", + "check:ts": "tsc --noEmit", "fix:css": "stylelint --config .stylelintrc.json --fix scss \"src/scss/*.scss\"", "lint:css": "stylelint --config .stylelintrc.json scss \"src/scss/*.scss\"", - "build": "npm run lint:ts && npm run build-vite && npm run dts", + "build": "npm run lint && npm run build-vite && npm run dts", "build-vite": "vite build && npm run docs", "dev": "vite --open ./docs/dev.html --port 8577", "dts": "dts-bundle-generator --config ./dts.config.ts", diff --git a/src/ts/index.ts b/src/ts/index.ts index 9048cb6..284033e 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -51,7 +51,6 @@ import { isArray, isString, getWindow, - submitEvent, on, off, } from '@thednp/shorty'; @@ -101,7 +100,6 @@ const toggleEvents = (self: ColorPicker, action?: boolean) => { const fn = action ? on : off; const { input, pickerToggle, menuToggle } = self; - fn(input, submitEvent, (e) => e.stopPropagation()); fn(input, focusinEvent, self.showPicker); fn(pickerToggle, mouseclickEvent, self.togglePicker); diff --git a/tsconfig.json b/tsconfig.json index dffbb70..14c1692 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ // https://janessagarrow.com/blog/typescript-and-esbuild/ "compilerOptions": { "lib": ["DOM", "ESNext", "DOM.Iterable"], - "types": ["vite", "vite/client", "@thednp/shorty", "@thednp/event-listener", "@thednp/color"], + "types": ["vite", "vite/client", "@thednp/shorty", "@thednp/color"], "rootDir": "./", "baseUrl": "./", "module": "ESNext",