colorjs.io
Version:
Let’s get serious about color
1 lines • 112 kB
JavaScript
"use strict";var e,t,r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n={};function o(){if(t)return e;t=1;var n=function(e){return e&&e.Math===Math&&e};return e=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r&&r)||n("object"==typeof r&&r)||function(){return this}()||Function("return this")()}var a,i,s,u,c,l,f,h,p={};function d(){return i?a:(i=1,a=function(e){try{return!!e()}catch(e){return!0}})}function m(){if(u)return s;u=1;var e=d();return s=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function g(){if(l)return c;l=1;var e=d();return c=!e((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))}function v(){if(h)return f;h=1;var e=g(),t=Function.prototype.call;return f=e?t.bind(t):function(){return t.apply(t,arguments)},f}var b,y,w,M,x,C,R,S,E,B,O,_,k,L,I,j,P,T,A,z,H,D,G,$,q,W,N,F,X,Y,Z,J,K,U,V,Q,ee,te,re,ne,oe,ae={};function ie(){return w?y:(w=1,y=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function se(){if(x)return M;x=1;var e=g(),t=Function.prototype,r=t.call,n=e&&t.bind.bind(r,r);return M=e?n:function(e){return function(){return r.apply(e,arguments)}},M}function ue(){if(R)return C;R=1;var e=se(),t=e({}.toString),r=e("".slice);return C=function(e){return r(t(e),8,-1)}}function ce(){return O?B:(O=1,B=function(e){return null==e})}function le(){if(k)return _;k=1;var e=ce(),t=TypeError;return _=function(r){if(e(r))throw new t("Can't call method on "+r);return r}}function fe(){if(I)return L;I=1;var e=function(){if(E)return S;E=1;var e=se(),t=d(),r=ue(),n=Object,o=e("".split);return S=t((function(){return!n("z").propertyIsEnumerable(0)}))?function(e){return"String"===r(e)?o(e,""):n(e)}:n}(),t=le();return L=function(r){return e(t(r))}}function he(){if(P)return j;P=1;var e="object"==typeof document&&document.all;return j=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function pe(){if(A)return T;A=1;var e=he();return T=function(t){return"object"==typeof t?null!==t:e(t)}}function de(){if(H)return z;H=1;var e=o(),t=he();return z=function(r,n){return arguments.length<2?(o=e[r],t(o)?o:void 0):e[r]&&e[r][n];var o},z}function me(){if(G)return D;G=1;var e=se();return D=e({}.isPrototypeOf)}function ge(){if(N)return W;N=1;var e,t,r=o(),n=function(){if(q)return $;q=1;var e=o().navigator,t=e&&e.userAgent;return $=t?String(t):""}(),a=r.process,i=r.Deno,s=a&&a.versions||i&&i.version,u=s&&s.v8;return u&&(t=(e=u.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&n&&(!(e=n.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=n.match(/Chrome\/(\d+)/))&&(t=+e[1]),W=t}function ve(){if(X)return F;X=1;var e=ge(),t=d(),r=o().String;return F=!!Object.getOwnPropertySymbols&&!t((function(){var t=Symbol("symbol detection");return!r(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))}function be(){if(Z)return Y;Z=1;var e=ve();return Y=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function ye(){if(K)return J;K=1;var e=de(),t=he(),r=me(),n=be(),o=Object;return J=n?function(e){return"symbol"==typeof e}:function(n){var a=e("Symbol");return t(a)&&r(a.prototype,o(n))}}function we(){if(V)return U;V=1;var e=String;return U=function(t){try{return e(t)}catch(e){return"Object"}}}function Me(){if(ee)return Q;ee=1;var e=he(),t=we(),r=TypeError;return Q=function(n){if(e(n))return n;throw new r(t(n)+" is not a function")}}function xe(){if(re)return te;re=1;var e=Me(),t=ce();return te=function(r,n){var o=r[n];return t(o)?void 0:e(o)}}function Ce(){if(oe)return ne;oe=1;var e=v(),t=he(),r=pe(),n=TypeError;return ne=function(o,a){var i,s;if("string"===a&&t(i=o.toString)&&!r(s=e(i,o)))return s;if(t(i=o.valueOf)&&!r(s=e(i,o)))return s;if("string"!==a&&t(i=o.toString)&&!r(s=e(i,o)))return s;throw new n("Can't convert object to primitive value")}}var Re,Se,Ee,Be,Oe,_e,ke,Le,Ie,je,Pe,Te,Ae,ze,He,De,Ge,$e,qe,We,Ne,Fe,Xe,Ye,Ze={exports:{}};function Je(){return Se?Re:(Se=1,Re=!1)}function Ke(){if(Be)return Ee;Be=1;var e=o(),t=Object.defineProperty;return Ee=function(r,n){try{t(e,r,{value:n,configurable:!0,writable:!0})}catch(t){e[r]=n}return n}}function Ue(){if(Oe)return Ze.exports;Oe=1;var e=Je(),t=o(),r=Ke(),n="__core-js_shared__",a=Ze.exports=t[n]||r(n,{});return(a.versions||(a.versions=[])).push({version:"3.39.0",mode:e?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"}),Ze.exports}function Ve(){if(ke)return _e;ke=1;var e=Ue();return _e=function(t,r){return e[t]||(e[t]=r||{})}}function Qe(){if(Ie)return Le;Ie=1;var e=le(),t=Object;return Le=function(r){return t(e(r))}}function et(){if(Pe)return je;Pe=1;var e=se(),t=Qe(),r=e({}.hasOwnProperty);return je=Object.hasOwn||function(e,n){return r(t(e),n)}}function tt(){if(Ae)return Te;Ae=1;var e=se(),t=0,r=Math.random(),n=e(1..toString);return Te=function(e){return"Symbol("+(void 0===e?"":e)+")_"+n(++t+r,36)}}function rt(){if(He)return ze;He=1;var e=o(),t=Ve(),r=et(),n=tt(),a=ve(),i=be(),s=e.Symbol,u=t("wks"),c=i?s.for||s:s&&s.withoutSetter||n;return ze=function(e){return r(u,e)||(u[e]=a&&r(s,e)?s[e]:c("Symbol."+e)),u[e]}}function nt(){if(Ge)return De;Ge=1;var e=v(),t=pe(),r=ye(),n=xe(),o=Ce(),a=rt(),i=TypeError,s=a("toPrimitive");return De=function(a,u){if(!t(a)||r(a))return a;var c,l=n(a,s);if(l){if(void 0===u&&(u="default"),c=e(l,a,u),!t(c)||r(c))return c;throw new i("Can't convert object to primitive value")}return void 0===u&&(u="number"),o(a,u)}}function ot(){if(qe)return $e;qe=1;var e=nt(),t=ye();return $e=function(r){var n=e(r,"string");return t(n)?n:n+""}}function at(){if(Ne)return We;Ne=1;var e=o(),t=pe(),r=e.document,n=t(r)&&t(r.createElement);return We=function(e){return n?r.createElement(e):{}}}function it(){if(Xe)return Fe;Xe=1;var e=m(),t=d(),r=at();return Fe=!e&&!t((function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))}function st(){if(Ye)return p;Ye=1;var e=m(),t=v(),r=function(){if(b)return ae;b=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,r=t&&!e.call({1:2},1);return ae.f=r?function(e){var r=t(this,e);return!!r&&r.enumerable}:e,ae}(),n=ie(),o=fe(),a=ot(),i=et(),s=it(),u=Object.getOwnPropertyDescriptor;return p.f=e?u:function(e,c){if(e=o(e),c=a(c),s)try{return u(e,c)}catch(e){}if(i(e,c))return n(!t(r.f,e,c),e[c])},p}var ut,ct,lt,ft,ht,pt,dt,mt={};function gt(){if(ct)return ut;ct=1;var e=m(),t=d();return ut=e&&t((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}function vt(){if(ft)return lt;ft=1;var e=pe(),t=String,r=TypeError;return lt=function(n){if(e(n))return n;throw new r(t(n)+" is not an object")}}function bt(){if(ht)return mt;ht=1;var e=m(),t=it(),r=gt(),n=vt(),o=ot(),a=TypeError,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",c="configurable",l="writable";return mt.f=e?r?function(e,t,r){if(n(e),t=o(t),n(r),"function"==typeof e&&"prototype"===t&&"value"in r&&l in r&&!r[l]){var a=s(e,t);a&&a[l]&&(e[t]=r.value,r={configurable:c in r?r[c]:a[c],enumerable:u in r?r[u]:a[u],writable:!1})}return i(e,t,r)}:i:function(e,r,s){if(n(e),r=o(r),n(s),t)try{return i(e,r,s)}catch(e){}if("get"in s||"set"in s)throw new a("Accessors not supported");return"value"in s&&(e[r]=s.value),e},mt}function yt(){if(dt)return pt;dt=1;var e=m(),t=bt(),r=ie();return pt=e?function(e,n,o){return t.f(e,n,r(1,o))}:function(e,t,r){return e[t]=r,e}}var wt,Mt,xt,Ct,Rt,St,Et,Bt,Ot,_t,kt,Lt,It,jt,Pt,Tt={exports:{}};function At(){if(Ct)return xt;Ct=1;var e=se(),t=he(),r=Ue(),n=e(Function.toString);return t(r.inspectSource)||(r.inspectSource=function(e){return n(e)}),xt=r.inspectSource}function zt(){if(Bt)return Et;Bt=1;var e=Ve(),t=tt(),r=e("keys");return Et=function(e){return r[e]||(r[e]=t(e))}}function Ht(){return _t?Ot:(_t=1,Ot={})}function Dt(){if(Lt)return kt;Lt=1;var e,t,r,n=function(){if(St)return Rt;St=1;var e=o(),t=he(),r=e.WeakMap;return Rt=t(r)&&/native code/.test(String(r))}(),a=o(),i=pe(),s=yt(),u=et(),c=Ue(),l=zt(),f=Ht(),h="Object already initialized",p=a.TypeError,d=a.WeakMap;if(n||c.state){var m=c.state||(c.state=new d);m.get=m.get,m.has=m.has,m.set=m.set,e=function(e,t){if(m.has(e))throw new p(h);return t.facade=e,m.set(e,t),t},t=function(e){return m.get(e)||{}},r=function(e){return m.has(e)}}else{var g=l("state");f[g]=!0,e=function(e,t){if(u(e,g))throw new p(h);return t.facade=e,s(e,g,t),t},t=function(e){return u(e,g)?e[g]:{}},r=function(e){return u(e,g)}}return kt={set:e,get:t,has:r,enforce:function(n){return r(n)?t(n):e(n,{})},getterFor:function(e){return function(r){var n;if(!i(r)||(n=t(r)).type!==e)throw new p("Incompatible receiver, "+e+" required");return n}}}}function Gt(){if(It)return Tt.exports;It=1;var e=se(),t=d(),r=he(),n=et(),o=m(),a=function(){if(Mt)return wt;Mt=1;var e=m(),t=et(),r=Function.prototype,n=e&&Object.getOwnPropertyDescriptor,o=t(r,"name"),a=o&&"something"===function(){}.name,i=o&&(!e||e&&n(r,"name").configurable);return wt={EXISTS:o,PROPER:a,CONFIGURABLE:i}}().CONFIGURABLE,i=At(),s=Dt(),u=s.enforce,c=s.get,l=String,f=Object.defineProperty,h=e("".slice),p=e("".replace),g=e([].join),v=o&&!t((function(){return 8!==f((function(){}),"length",{value:8}).length})),b=String(String).split("String"),y=Tt.exports=function(e,t,r){"Symbol("===h(l(t),0,7)&&(t="["+p(l(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!n(e,"name")||a&&e.name!==t)&&(o?f(e,"name",{value:t,configurable:!0}):e.name=t),v&&r&&n(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&n(r,"constructor")&&r.constructor?o&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=u(e);return n(i,"source")||(i.source=g(b,"string"==typeof t?t:"")),e};return Function.prototype.toString=y((function(){return r(this)&&c(this).source||i(this)}),"toString"),Tt.exports}function $t(){if(Pt)return jt;Pt=1;var e=he(),t=bt(),r=Gt(),n=Ke();return jt=function(o,a,i,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:a;if(e(i)&&r(i,c,s),s.global)u?o[a]=i:n(a,i);else{try{s.unsafe?o[a]&&(u=!0):delete o[a]}catch(e){}u?o[a]=i:t.f(o,a,{value:i,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return o}}var qt,Wt,Nt,Ft,Xt,Yt,Zt,Jt,Kt,Ut,Vt,Qt,er,tr,rr,nr,or,ar={};function ir(){if(Ft)return Nt;Ft=1;var e=function(){if(Wt)return qt;Wt=1;var e=Math.ceil,t=Math.floor;return qt=Math.trunc||function(r){var n=+r;return(n>0?t:e)(n)},qt}();return Nt=function(t){var r=+t;return r!=r||0===r?0:e(r)}}function sr(){if(Yt)return Xt;Yt=1;var e=ir(),t=Math.max,r=Math.min;return Xt=function(n,o){var a=e(n);return a<0?t(a+o,0):r(a,o)}}function ur(){if(Jt)return Zt;Jt=1;var e=ir(),t=Math.min;return Zt=function(r){var n=e(r);return n>0?t(n,9007199254740991):0}}function cr(){if(Ut)return Kt;Ut=1;var e=ur();return Kt=function(t){return e(t.length)}}function lr(){if(tr)return er;tr=1;var e=se(),t=et(),r=fe(),n=function(){if(Qt)return Vt;Qt=1;var e=fe(),t=sr(),r=cr(),n=function(n){return function(o,a,i){var s=e(o),u=r(s);if(0===u)return!n&&-1;var c,l=t(i,u);if(n&&a!=a){for(;u>l;)if((c=s[l++])!=c)return!0}else for(;u>l;l++)if((n||l in s)&&s[l]===a)return n||l||0;return!n&&-1}};return Vt={includes:n(!0),indexOf:n(!1)}}().indexOf,o=Ht(),a=e([].push);return er=function(e,i){var s,u=r(e),c=0,l=[];for(s in u)!t(o,s)&&t(u,s)&&a(l,s);for(;i.length>c;)t(u,s=i[c++])&&(~n(l,s)||a(l,s));return l}}function fr(){return nr?rr:(nr=1,rr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var hr,pr,dr,mr,gr,vr,br,yr,wr,Mr,xr,Cr,Rr,Sr,Er,Br,Or,_r,kr,Lr,Ir,jr,Pr,Tr,Ar,zr,Hr,Dr,Gr,$r,qr,Wr,Nr,Fr,Xr,Yr,Zr,Jr,Kr,Ur,Vr,Qr,en={};function tn(){if(dr)return pr;dr=1;var e=de(),t=se(),r=function(){if(or)return ar;or=1;var e=lr(),t=fr().concat("length","prototype");return ar.f=Object.getOwnPropertyNames||function(r){return e(r,t)},ar}(),n=(hr||(hr=1,en.f=Object.getOwnPropertySymbols),en),o=vt(),a=t([].concat);return pr=e("Reflect","ownKeys")||function(e){var t=r.f(o(e)),i=n.f;return i?a(t,i(e)):t}}function rn(){if(gr)return mr;gr=1;var e=et(),t=tn(),r=st(),n=bt();return mr=function(o,a,i){for(var s=t(a),u=n.f,c=r.f,l=0;l<s.length;l++){var f=s[l];e(o,f)||i&&e(i,f)||u(o,f,c(a,f))}}}function nn(){if(wr)return yr;wr=1;var e=o(),t=st().f,r=yt(),n=$t(),a=Ke(),i=rn(),s=function(){if(br)return vr;br=1;var e=d(),t=he(),r=/#|\.prototype\./,n=function(r,n){var u=a[o(r)];return u===s||u!==i&&(t(n)?e(n):!!n)},o=n.normalize=function(e){return String(e).replace(r,".").toLowerCase()},a=n.data={},i=n.NATIVE="N",s=n.POLYFILL="P";return vr=n}();return yr=function(o,u){var c,l,f,h,p,d=o.target,m=o.global,g=o.stat;if(c=m?e:g?e[d]||a(d,{}):e[d]&&e[d].prototype)for(l in u){if(h=u[l],f=o.dontCallGetSet?(p=t(c,l))&&p.value:c[l],!s(m?l:d+(g?".":"#")+l,o.forced)&&void 0!==f){if(typeof h==typeof f)continue;i(h,f)}(o.sham||f&&f.sham)&&r(h,"sham",!0),n(c,l,h,o)}}}function on(){if(Rr)return Cr;Rr=1;var e=se(),t=Me();return Cr=function(r,n,o){try{return e(t(Object.getOwnPropertyDescriptor(r,n)[o]))}catch(e){}}}function an(){if(Er)return Sr;Er=1;var e=pe();return Sr=function(t){return e(t)||null===t}}function sn(){if(Or)return Br;Or=1;var e=an(),t=String,r=TypeError;return Br=function(n){if(e(n))return n;throw new r("Can't set "+t(n)+" as a prototype")}}function un(){if(kr)return _r;kr=1;var e=on(),t=pe(),r=le(),n=sn();return _r=Object.setPrototypeOf||("__proto__"in{}?function(){var o,a=!1,i={};try{(o=e(Object.prototype,"__proto__","set"))(i,[]),a=i instanceof Array}catch(e){}return function(e,i){return r(e),n(i),t(e)?(a?o(e,i):e.__proto__=i,e):e}}():void 0)}function cn(){if(Ir)return Lr;Ir=1;var e=bt().f;return Lr=function(t,r,n){n in t||e(t,n,{configurable:!0,get:function(){return r[n]},set:function(e){r[n]=e}})}}function ln(){if(Pr)return jr;Pr=1;var e=he(),t=pe(),r=un();return jr=function(n,o,a){var i,s;return r&&e(i=o.constructor)&&i!==a&&t(s=i.prototype)&&s!==a.prototype&&r(n,s),n}}function fn(){if(Hr)return zr;Hr=1;var e=function(){if(Ar)return Tr;Ar=1;var e={};return e[rt()("toStringTag")]="z",Tr="[object z]"===String(e)}(),t=he(),r=ue(),n=rt()("toStringTag"),o=Object,a="Arguments"===r(function(){return arguments}());return zr=e?r:function(e){var i,s,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(s=function(e,t){try{return e[t]}catch(e){}}(i=o(e),n))?s:a?r(i):"Object"===(u=r(i))&&t(i.callee)?"Arguments":u}}function hn(){if(Gr)return Dr;Gr=1;var e=fn(),t=String;return Dr=function(r){if("Symbol"===e(r))throw new TypeError("Cannot convert a Symbol value to a string");return t(r)}}function pn(){if(qr)return $r;qr=1;var e=hn();return $r=function(t,r){return void 0===t?arguments.length<2?"":r:e(t)},$r}function dn(){if(Nr)return Wr;Nr=1;var e=pe(),t=yt();return Wr=function(r,n){e(n)&&"cause"in n&&t(r,"cause",n.cause)}}function mn(){if(Kr)return Jr;Kr=1;var e=yt(),t=function(){if(Xr)return Fr;Xr=1;var e=se(),t=Error,r=e("".replace),n=String(new t("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,a=o.test(n);return Fr=function(e,n){if(a&&"string"==typeof e&&!t.prepareStackTrace)for(;n--;)e=r(e,o,"");return e}}(),r=function(){if(Zr)return Yr;Zr=1;var e=d(),t=ie();return Yr=!e((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",t(1,7)),7!==e.stack)}))}(),n=Error.captureStackTrace;return Jr=function(o,a,i,s){r&&(n?n(o,a):e(o,"stack",t(i,s)))}}function gn(){if(Vr)return Ur;Vr=1;var e=de(),t=et(),r=yt(),n=me(),o=un(),a=rn(),i=cn(),s=ln(),u=pn(),c=dn(),l=mn(),f=m(),h=Je();return Ur=function(p,d,m,g){var v="stackTraceLimit",b=g?2:1,y=p.split("."),w=y[y.length-1],M=e.apply(null,y);if(M){var x=M.prototype;if(!h&&t(x,"cause")&&delete x.cause,!m)return M;var C=e("Error"),R=d((function(e,t){var o=u(g?t:e,void 0),a=g?new M(e):new M;return void 0!==o&&r(a,"message",o),l(a,R,a.stack,2),this&&n(x,this)&&s(a,this,R),arguments.length>b&&c(a,arguments[b]),a}));if(R.prototype=x,"Error"!==w?o?o(R,C):a(R,C,{name:!0}):f&&v in M&&(i(R,M,v),i(R,M,"prepareStackTrace")),a(R,M),!h)try{x.name!==w&&r(x,"name",w),x.constructor=R}catch(e){}return R}},Ur}!function(){if(Qr)return n;Qr=1;var e=nn(),t=o(),r=function(){if(xr)return Mr;xr=1;var e=g(),t=Function.prototype,r=t.apply,n=t.call;return Mr="object"==typeof Reflect&&Reflect.apply||(e?n.bind(r):function(){return n.apply(r,arguments)}),Mr}(),a=gn(),i="WebAssembly",s=t[i],u=7!==new Error("e",{cause:7}).cause,c=function(t,r){var n={};n[t]=a(t,r,u),e({global:!0,constructor:!0,arity:1,forced:u},n)},l=function(t,r){if(s&&s[t]){var n={};n[t]=a(i+"."+t,r,u),e({target:i,stat:!0,constructor:!0,arity:1,forced:u},n)}};c("Error",(function(e){return function(t){return r(e,this,arguments)}})),c("EvalError",(function(e){return function(t){return r(e,this,arguments)}})),c("RangeError",(function(e){return function(t){return r(e,this,arguments)}})),c("ReferenceError",(function(e){return function(t){return r(e,this,arguments)}})),c("SyntaxError",(function(e){return function(t){return r(e,this,arguments)}})),c("TypeError",(function(e){return function(t){return r(e,this,arguments)}})),c("URIError",(function(e){return function(t){return r(e,this,arguments)}})),l("CompileError",(function(e){return function(t){return r(e,this,arguments)}})),l("LinkError",(function(e){return function(t){return r(e,this,arguments)}})),l("RuntimeError",(function(e){return function(t){return r(e,this,arguments)}}))}();var vn,bn,yn,wn,Mn,xn,Cn,Rn={};function Sn(){if(bn)return vn;bn=1;var e=ue();return vn=Array.isArray||function(t){return"Array"===e(t)}}function En(){if(xn)return Mn;xn=1;var e=TypeError;return Mn=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}}!function(){if(Cn)return Rn;Cn=1;var e=nn(),t=Qe(),r=cr(),n=function(){if(wn)return yn;wn=1;var e=m(),t=Sn(),r=TypeError,n=Object.getOwnPropertyDescriptor,o=e&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();return yn=o?function(e,o){if(t(e)&&!n(e,"length").writable)throw new r("Cannot set read only .length");return e.length=o}:function(e,t){return e.length=t}}(),o=En();e({target:"Array",proto:!0,arity:1,forced:d()((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var a=t(this),i=r(a),s=arguments.length;o(i+s);for(var u=0;u<s;u++)a[i]=arguments[u],i++;return n(a,i),i}})}();var Bn,On,_n,kn,Ln,In,jn,Pn,Tn,An,zn={};function Hn(){if(On)return Bn;On=1;var e=me(),t=TypeError;return Bn=function(r,n){if(e(n,r))return r;throw new t("Incorrect invocation")}}function Dn(){if(In)return Ln;In=1;var e=et(),t=he(),r=Qe(),n=zt(),o=function(){if(kn)return _n;kn=1;var e=d();return _n=!e((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))}(),a=n("IE_PROTO"),i=Object,s=i.prototype;return Ln=o?i.getPrototypeOf:function(n){var o=r(n);if(e(o,a))return o[a];var u=o.constructor;return t(u)&&o instanceof u?u.prototype:o instanceof i?s:null}}function Gn(){if(Pn)return jn;Pn=1;var e=Gt(),t=bt();return jn=function(r,n,o){return o.get&&e(o.get,n,{getter:!0}),o.set&&e(o.set,n,{setter:!0}),t.f(r,n,o)}}function $n(){if(An)return Tn;An=1;var e=m(),t=bt(),r=ie();return Tn=function(n,o,a){e?t.f(n,o,r(0,a)):n[o]=a}}var qn,Wn,Nn,Fn,Xn,Yn,Zn,Jn,Kn,Un,Vn,Qn={};function eo(){if(Wn)return qn;Wn=1;var e=lr(),t=fr();return qn=Object.keys||function(r){return e(r,t)}}function to(){if(Xn)return Fn;Xn=1;var e=de();return Fn=e("document","documentElement")}function ro(){if(Zn)return Yn;Zn=1;var e,t=vt(),r=function(){if(Nn)return Qn;Nn=1;var e=m(),t=gt(),r=bt(),n=vt(),o=fe(),a=eo();return Qn.f=e&&!t?Object.defineProperties:function(e,t){n(e);for(var i,s=o(t),u=a(t),c=u.length,l=0;c>l;)r.f(e,i=u[l++],s[i]);return e},Qn}(),n=fr(),o=Ht(),a=to(),i=at(),s=zt(),u="prototype",c="script",l=s("IE_PROTO"),f=function(){},h=function(e){return"<"+c+">"+e+"</"+c+">"},p=function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t},d=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,r,o;d="undefined"!=typeof document?document.domain&&e?p(e):(r=i("iframe"),o="java"+c+":",r.style.display="none",a.appendChild(r),r.src=String(o),(t=r.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):p(e);for(var s=n.length;s--;)delete d[u][n[s]];return d()};return o[l]=!0,Yn=Object.create||function(e,n){var o;return null!==e?(f[u]=t(e),o=new f,f[u]=null,o[l]=e):o=d(),void 0===n?o:r.f(o,n)}}function no(){if(Kn)return Jn;Kn=1;var e,t,r,n=d(),o=he(),a=pe(),i=ro(),s=Dn(),u=$t(),c=rt(),l=Je(),f=c("iterator"),h=!1;return[].keys&&("next"in(r=[].keys())?(t=s(s(r)))!==Object.prototype&&(e=t):h=!0),!a(e)||n((function(){var t={};return e[f].call(t)!==t}))?e={}:l&&(e=i(e)),o(e[f])||u(e,f,(function(){return this})),Jn={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:h}}Vn||(Vn=1,function(){if(Un)return zn;Un=1;var e=nn(),t=o(),r=Hn(),n=vt(),a=he(),i=Dn(),s=Gn(),u=$n(),c=d(),l=et(),f=rt(),h=no().IteratorPrototype,p=m(),g=Je(),v="constructor",b="Iterator",y=f("toStringTag"),w=TypeError,M=t[b],x=g||!a(M)||M.prototype!==h||!c((function(){M({})})),C=function(){if(r(this,h),i(this)===h)throw new w("Abstract class Iterator not directly constructable")},R=function(e,t){p?s(h,e,{configurable:!0,get:function(){return t},set:function(t){if(n(this),this===h)throw new w("You can't redefine this property");l(this,e)?this[e]=t:u(this,e,t)}}):h[e]=t};l(h,y)||R(y,b),!x&&l(h,v)&&h[v]!==Object||R(v,C),C.prototype=h,e({global:!0,constructor:!0,forced:x},{Iterator:C})}());var oo,ao,io,so,uo,co,lo,fo,ho,po,mo,go,vo,bo,yo,wo,Mo,xo,Co,Ro,So={};function Eo(){if(so)return io;so=1;var e=function(){if(ao)return oo;ao=1;var e=ue(),t=se();return oo=function(r){if("Function"===e(r))return t(r)}}(),t=Me(),r=g(),n=e(e.bind);return io=function(e,o){return t(e),void 0===o?e:r?n(e,o):function(){return e.apply(o,arguments)}},io}function Bo(){return co?uo:(co=1,uo={})}function Oo(){if(fo)return lo;fo=1;var e=rt(),t=Bo(),r=e("iterator"),n=Array.prototype;return lo=function(e){return void 0!==e&&(t.Array===e||n[r]===e)}}function _o(){if(po)return ho;po=1;var e=fn(),t=xe(),r=ce(),n=Bo(),o=rt()("iterator");return ho=function(a){if(!r(a))return t(a,o)||t(a,"@@iterator")||n[e(a)]}}function ko(){if(go)return mo;go=1;var e=v(),t=Me(),r=vt(),n=we(),o=_o(),a=TypeError;return mo=function(i,s){var u=arguments.length<2?o(i):s;if(t(u))return r(e(u,i));throw new a(n(i)+" is not iterable")},mo}function Lo(){if(bo)return vo;bo=1;var e=v(),t=vt(),r=xe();return vo=function(n,o,a){var i,s;t(n);try{if(!(i=r(n,"return"))){if("throw"===o)throw a;return a}i=e(i,n)}catch(e){s=!0,i=e}if("throw"===o)throw a;if(s)throw i;return t(i),a}}function Io(){if(wo)return yo;wo=1;var e=Eo(),t=v(),r=vt(),n=we(),o=Oo(),a=cr(),i=me(),s=ko(),u=_o(),c=Lo(),l=TypeError,f=function(e,t){this.stopped=e,this.result=t},h=f.prototype;return yo=function(p,d,m){var g,v,b,y,w,M,x,C=m&&m.that,R=!(!m||!m.AS_ENTRIES),S=!(!m||!m.IS_RECORD),E=!(!m||!m.IS_ITERATOR),B=!(!m||!m.INTERRUPTED),O=e(d,C),_=function(e){return g&&c(g,"normal",e),new f(!0,e)},k=function(e){return R?(r(e),B?O(e[0],e[1],_):O(e[0],e[1])):B?O(e,_):O(e)};if(S)g=p.iterator;else if(E)g=p;else{if(!(v=u(p)))throw new l(n(p)+" is not iterable");if(o(v)){for(b=0,y=a(p);y>b;b++)if((w=k(p[b]))&&i(h,w))return w;return new f(!1)}g=s(p,v)}for(M=S?p.next:g.next;!(x=t(M,g)).done;){try{w=k(x.value)}catch(e){c(g,"throw",e)}if("object"==typeof w&&w&&i(h,w))return w}return new f(!1)}}function jo(){return xo?Mo:(xo=1,Mo=function(e){return{iterator:e,next:e.next,done:!1}})}Ro||(Ro=1,function(){if(Co)return So;Co=1;var e=nn(),t=Io(),r=Me(),n=vt(),o=jo();e({target:"Iterator",proto:!0,real:!0},{every:function(e){n(this),r(e);var a=o(this),i=0;return!t(a,(function(t,r){if(!e(t,i++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}());var Po,To,Ao,zo,Ho,Do,Go,$o,qo,Wo,No,Fo,Xo={};function Yo(){if(To)return Po;To=1;var e=$t();return Po=function(t,r,n){for(var o in r)e(t,o,r[o],n);return t}}function Zo(){return zo?Ao:(zo=1,Ao=function(e,t){return{value:e,done:t}})}function Jo(){if(Do)return Ho;Do=1;var e=v(),t=ro(),r=yt(),n=Yo(),o=rt(),a=Dt(),i=xe(),s=no().IteratorPrototype,u=Zo(),c=Lo(),l=o("toStringTag"),f="IteratorHelper",h="WrapForValidIterator",p=a.set,d=function(r){var o=a.getterFor(r?h:f);return n(t(s),{next:function(){var e=o(this);if(r)return e.nextHandler();try{var t=e.done?void 0:e.nextHandler();return u(t,e.done)}catch(t){throw e.done=!0,t}},return:function(){var t=o(this),n=t.iterator;if(t.done=!0,r){var a=i(n,"return");return a?e(a,n):u(void 0,!0)}if(t.inner)try{c(t.inner.iterator,"normal")}catch(e){return c(n,"throw",e)}return n&&c(n,"normal"),u(void 0,!0)}})},m=d(!0),g=d(!1);return r(g,l,"Iterator Helper"),Ho=function(e,t){var r=function(r,n){n?(n.iterator=r.iterator,n.next=r.next):n=r,n.type=t?h:f,n.nextHandler=e,n.counter=0,n.done=!1,p(this,n)};return r.prototype=t?m:g,r}}function Ko(){if($o)return Go;$o=1;var e=vt(),t=Lo();return Go=function(r,n,o,a){try{return a?n(e(o)[0],o[1]):n(o)}catch(e){t(r,"throw",e)}}}function Uo(){if(No)return Xo;No=1;var e=nn(),t=function(){if(Wo)return qo;Wo=1;var e=v(),t=Me(),r=vt(),n=jo(),o=Jo(),a=Ko(),i=o((function(){var t=this.iterator,n=r(e(this.next,t));if(!(this.done=!!n.done))return a(t,this.mapper,[n.value,this.counter++],!0)}));return qo=function(e){return r(this),t(e),new i(n(this),{mapper:e})}}();return e({target:"Iterator",proto:!0,real:!0,forced:Je()},{map:t}),Xo}Fo||(Fo=1,Uo());var Vo,Qo,ea={};Qo||(Qo=1,function(){if(Vo)return ea;Vo=1;var e=nn(),t=Io(),r=Me(),n=vt(),o=jo();e({target:"Iterator",proto:!0,real:!0},{some:function(e){n(this),r(e);var a=o(this),i=0;return t(a,(function(t,r){if(e(t,i++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})}());var ta,ra,na,oa,aa,ia,sa,ua,ca,la,fa,ha,pa,da,ma,ga,va,ba,ya,wa,Ma={};function xa(){if(ra)return ta;ra=1;var e=se(),t=Set.prototype;return ta={Set:Set,add:e(t.add),has:e(t.has),remove:e(t.delete),proto:t}}function Ca(){if(oa)return na;oa=1;var e=xa().has;return na=function(t){return e(t),t}}function Ra(){if(ia)return aa;ia=1;var e=v();return aa=function(t,r,n){for(var o,a,i=n?t:t.iterator,s=t.next;!(o=e(s,i)).done;)if(void 0!==(a=r(o.value)))return a}}function Sa(){if(ua)return sa;ua=1;var e=se(),t=Ra(),r=xa(),n=r.Set,o=r.proto,a=e(o.forEach),i=e(o.keys),s=i(new n).next;return sa=function(e,r,n){return n?t({iterator:i(e),next:s},r):a(e,r)},sa}function Ea(){if(la)return ca;la=1;var e=xa(),t=Sa(),r=e.Set,n=e.add;return ca=function(e){var o=new r;return t(e,(function(e){n(o,e)})),o},ca}function Ba(){if(ha)return fa;ha=1;var e=on(),t=xa();return fa=e(t.proto,"size","get")||function(e){return e.size},fa}function Oa(){if(da)return pa;da=1;var e=Me(),t=vt(),r=v(),n=ir(),o=jo(),a="Invalid size",i=RangeError,s=TypeError,u=Math.max,c=function(t,r){this.set=t,this.size=u(r,0),this.has=e(t.has),this.keys=e(t.keys)};return c.prototype={getIterator:function(){return o(t(r(this.keys,this.set)))},includes:function(e){return r(this.has,this.set,e)}},pa=function(e){t(e);var r=+e.size;if(r!=r)throw new s(a);var o=n(r);if(o<0)throw new i(a);return new c(e,o)}}function _a(){if(ba)return va;ba=1;var e=de(),t=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};return va=function(r){var n=e("Set");try{(new n)[r](t(0));try{return(new n)[r](t(-1)),!1}catch(e){return!0}}catch(e){return!1}}}function ka(){if(ya)return Ma;ya=1;var e=nn(),t=function(){if(ga)return ma;ga=1;var e=Ca(),t=xa(),r=Ea(),n=Ba(),o=Oa(),a=Sa(),i=Ra(),s=t.has,u=t.remove;return ma=function(t){var c=e(this),l=o(t),f=r(c);return n(c)<=l.size?a(c,(function(e){l.includes(e)&&u(f,e)})):i(l.getIterator(),(function(e){s(c,e)&&u(f,e)})),f}}();return e({target:"Set",proto:!0,real:!0,forced:!_a()("difference")},{difference:t}),Ma}wa||(wa=1,ka());var La,Ia,ja,Pa,Ta={};function Aa(){if(ja)return Ta;ja=1;var e=nn(),t=d(),r=function(){if(Ia)return La;Ia=1;var e=Ca(),t=xa(),r=Ba(),n=Oa(),o=Sa(),a=Ra(),i=t.Set,s=t.add,u=t.has;return La=function(t){var c=e(this),l=n(t),f=new i;return r(c)>l.size?a(l.getIterator(),(function(e){u(c,e)&&s(f,e)})):o(c,(function(e){l.includes(e)&&s(f,e)})),f}}();return e({target:"Set",proto:!0,real:!0,forced:!_a()("intersection")||t((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:r}),Ta}Pa||(Pa=1,Aa());var za,Ha,Da,Ga,$a={};function qa(){if(Da)return $a;Da=1;var e=nn(),t=function(){if(Ha)return za;Ha=1;var e=Ca(),t=xa().has,r=Ba(),n=Oa(),o=Sa(),a=Ra(),i=Lo();return za=function(s){var u=e(this),c=n(s);if(r(u)<=c.size)return!1!==o(u,(function(e){if(c.includes(e))return!1}),!0);var l=c.getIterator();return!1!==a(l,(function(e){if(t(u,e))return i(l,"normal",!1)}))}}();return e({target:"Set",proto:!0,real:!0,forced:!_a()("isDisjointFrom")},{isDisjointFrom:t}),$a}Ga||(Ga=1,qa());var Wa,Na,Fa,Xa,Ya={};function Za(){if(Fa)return Ya;Fa=1;var e=nn(),t=function(){if(Na)return Wa;Na=1;var e=Ca(),t=Ba(),r=Sa(),n=Oa();return Wa=function(o){var a=e(this),i=n(o);return!(t(a)>i.size)&&!1!==r(a,(function(e){if(!i.includes(e))return!1}),!0)}}();return e({target:"Set",proto:!0,real:!0,forced:!_a()("isSubsetOf")},{isSubsetOf:t}),Ya}Xa||(Xa=1,Za());var Ja,Ka,Ua,Va,Qa={};function ei(){if(Ua)return Qa;Ua=1;var e=nn(),t=function(){if(Ka)return Ja;Ka=1;var e=Ca(),t=xa().has,r=Ba(),n=Oa(),o=Ra(),a=Lo();return Ja=function(i){var s=e(this),u=n(i);if(r(s)<u.size)return!1;var c=u.getIterator();return!1!==o(c,(function(e){if(!t(s,e))return a(c,"normal",!1)}))}}();return e({target:"Set",proto:!0,real:!0,forced:!_a()("isSupersetOf")},{isSupersetOf:t}),Qa}Va||(Va=1,ei());var ti,ri,ni,oi,ai={};function ii(){if(ni)return ai;ni=1;var e=nn(),t=function(){if(ri)return ti;ri=1;var e=Ca(),t=xa(),r=Ea(),n=Oa(),o=Ra(),a=t.add,i=t.has,s=t.remove;return ti=function(t){var u=e(this),c=n(t).getIterator(),l=r(u);return o(c,(function(e){i(u,e)?s(l,e):a(l,e)})),l}}();return e({target:"Set",proto:!0,real:!0,forced:!_a()("symmetricDifference")},{symmetricDifference:t}),ai}oi||(oi=1,ii());var si,ui,ci,li,fi={};function hi(){if(ci)return fi;ci=1;var e=nn(),t=function(){if(ui)return si;ui=1;var e=Ca(),t=xa().add,r=Ea(),n=Oa(),o=Ra();return si=function(a){var i=e(this),s=n(a).getIterator(),u=r(i);return o(s,(function(e){t(u,e)})),u}}();return e({target:"Set",proto:!0,real:!0,forced:!_a()("union")},{union:t}),fi}function pi(e,t){let r,n,o=e.length,a=!1,i=!1;Array.isArray(e[0])?r=e:(r=[e],o=r.length,a=!0),Array.isArray(t[0])?n=t:(n=t.length>0?t.map((e=>[e])):[[]],i=!0);let s=n[0].length,u=n[0].map(((e,t)=>n.map((e=>e[t])))),c=r.map((e=>u.map((t=>{let r=0;if(!Array.isArray(e)){for(let n of t)r+=e*n;return r}for(let n=0;n<e.length;n++)r+=e[n]*(t[n]||0);return r}))));return 1===o&&a&&(c=c[0]),1===s&&i?1===o&&a?c[0]:c.map((e=>e[0])):c}function di(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function mi(e,t,r=[0,0,0]){const n=di(e,t[0]),o=di(e,t[1]),a=di(e,t[2]);return r[0]=n,r[1]=o,r[2]=a,r}function gi(e){return"string"===vi(e)}function vi(e){return(Object.prototype.toString.call(e).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function bi(e,{precision:t=16,unit:r}){return yi(e)?"none":(e=+Mi(e,t))+(null!=r?r:"")}function yi(e){return null===e}function wi(e){return yi(e)?0:e}function Mi(e,t){if(0===e)return 0;let r=~~e,n=0;r&&t&&(n=1+~~Math.log10(Math.abs(r)));const o=10**(t-n);return Math.floor(e*o+.5)/o}function xi(e,t,r){return isNaN(e)?t:isNaN(t)?e:e+(t-e)*r}function Ci(e,t,r){return!e||!t||e===t||e[0]===t[0]&&e[1]===t[1]||isNaN(r)||null===r?r:xi(t[0],t[1],function(e,t,r){return(r-e)/(t-e)}(e[0],e[1],r))}function Ri(e,t,r){return Math.max(Math.min(r,t),e)}function Si(e,t){return Math.sign(e)===Math.sign(t)?e:-e}function Ei(e,t){return Si(Math.abs(e)**t,e)}function Bi(e,t){return 0===t?0:e/t}function Oi(e,t){if(e instanceof t)return!0;const r=t.name;for(;e;){var n;const t=Object.getPrototypeOf(e),o=null==t||null===(n=t.constructor)||void 0===n?void 0:n.name;if(o===r)return!0;if(!o||"Object"===o)return!1;e=t}return!1}li||(li=1,hi());var _i,ki,Li={};ki||(ki=1,function(){if(_i)return Li;_i=1;var e=nn(),t=Io(),r=Me(),n=vt(),o=jo();e({target:"Iterator",proto:!0,real:!0},{find:function(e){n(this),r(e);var a=o(this),i=0;return t(a,(function(t,r){if(e(t,i++))return r(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})}());class Ii{type;coordMeta;coordRange;range;constructor(e,t){var r;("object"==typeof e&&(this.coordMeta=e),t)&&(this.coordMeta=t,this.coordRange=null!==(r=t.range)&&void 0!==r?r:t.refRange);if("string"==typeof e){let t=e.trim().match(/^(?<type><[a-z]+>)(\[(?<min>-?[.\d]+),\s*(?<max>-?[.\d]+)\])?$/);if(!t)throw new TypeError(`Cannot parse ${e} as a type definition.`);this.type=t.groups.type;let{min:r,max:n}=t.groups;(r||n)&&(this.range=[+r,+n])}}get computedRange(){return this.range?this.range:"<percentage>"===this.type?this.percentageRange():"<angle>"===this.type?[0,360]:null}get unit(){return"<percentage>"===this.type?"%":"<angle>"===this.type?"deg":""}resolve(e){if("<angle>"===this.type)return e;let t=this.computedRange,r=this.coordRange;var n;"<percentage>"===this.type&&(null!==(n=r)&&void 0!==n||(r=this.percentageRange()));return Ci(t,r,e)}serialize(e,t){let r="<percentage>"===this.type?this.percentageRange(100):this.computedRange,n=this.unit;return bi(e=Ci(this.coordRange,r,e),{unit:n,precision:t})}toString(){let e=this.type;if(this.range){let[t="",r=""]=this.range;e+=`[${t},${r}]`}return e}percentageRange(e=1){let t;return t=this.coordMeta&&this.coordMeta.range||this.coordRange&&this.coordRange[0]>=0?[0,1]:[-1,1],[t[0]*e,t[1]*e]}static get(e,t){return Oi(e,this)?e:new this(e,t)}}const ji=Symbol("instance");class Pi{type;name;spaceCoords;coords;id;alpha;constructor(e,t=e.space){e[ji]=this,this.type="function",this.name="color",Object.assign(this,e),this.space=t,"custom"!==this.type&&(this.spaceCoords=Object.values(t.coords),this.coords||(this.coords=this.spaceCoords.map((e=>{let t=["<number>","<percentage>"];return"angle"===e.type&&t.push("<angle>"),t}))),this.coords=this.coords.map(((e,t)=>{let r=this.spaceCoords[t];return"string"==typeof e&&(e=e.trim().split(/\s*\|\s*/)),e.map((e=>Ii.get(e,r)))})))}serializeCoords(e,t,r){return r=e.map(((e,t)=>{var n,o;return Ii.get(null!==(n=null===(o=r)||void 0===o?void 0:o[t])&&void 0!==n?n:this.coords[t][0],this.spaceCoords[t])})),e.map(((e,n)=>r[n].serialize(e,t)))}coerceCoords(e,t){return Object.entries(this.space.coords).map((([r,n],o)=>{let a=e[o];if(yi(a)||isNaN(a))return a;let i=t[o],s=this.coords[o].find((e=>e.type==i));if(!s){var u,c;let e=n.name||r;throw new TypeError(`${null!==(u=null!=i?i:null===(c=a)||void 0===c?void 0:c.raw)&&void 0!==u?u:a} not allowed for ${e} in ${this.name}()`)}return a=s.resolve(a),s.range&&(t[o]=s.toString()),a}))}canSerialize(){return"function"===this.type||this.serialize}parse(e){return null}static get(e,...t){return!e||Oi(e,this)?e:e[ji]?e[ji]:new Pi(e,...t)}}var Ti,Ai,zi={};Ai||(Ai=1,function(){if(Ti)return zi;Ti=1;var e=nn(),t=Io(),r=Me(),n=vt(),o=jo();e({target:"Iterator",proto:!0,real:!0},{forEach:function(e){n(this),r(e);var a=o(this),i=0;t(a,(function(t){e(t,i++)}),{IS_RECORD:!0})}})}());class Hi{add(e,t,r){if("string"==typeof arguments[0])(Array.isArray(e)?e:[e]).forEach((function(e){this[e]=this[e]||[],t&&this[e][r?"unshift":"push"](t)}),this);else for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1])}run(e,t){this[e]=this[e]||[],this[e].forEach((function(e){e.call(t&&t.context?t.context:t,t)}))}}const Di=new Hi,Gi={D50:[.3457/.3585,1,.2958/.3585],D65:[.3127/.329,1,.3583/.329]};function $i(e){return Array.isArray(e)?e:Gi[e]}function qi(e,t,r,n={}){if(e=$i(e),t=$i(t),!e||!t)throw new TypeError(`Missing white point to convert ${e?"":"from"}${e||t?"":"/"}${t?"":"to"}`);if(e===t)return r;let o={W1:e,W2:t,XYZ:r,options:n};if(Di.run("chromatic-adaptation-start",o),o.M||(o.W1===Gi.D65&&o.W2===Gi.D50?o.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:o.W1===Gi.D50&&o.W2===Gi.D65&&(o.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),Di.run("chromatic-adaptation-end",o),o.M)return mi(o.XYZ,o.M);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}var Wi,Ni={gamut_mapping:"css",precision:5,deltaE:"76",verbose:"test"!==(null===globalThis||void 0===globalThis||null===(Wi=globalThis.process)||void 0===Wi||null===(Wi=Wi.env)||void 0===Wi||null===(Wi=Wi.NODE_ENV)||void 0===Wi?void 0:Wi.toLowerCase()),warn:function(e){var t,r;this.verbose&&(null===globalThis||void 0===globalThis||null===(t=globalThis.console)||void 0===t||null===(r=t.warn)||void 0===r||r.call(t,e))}};function Fi(e,t){var r,n;let o,a={str:null===(r=String(e))||void 0===r?void 0:r.trim(),options:t};if(Di.run("parse-start",a),a.color)return a.color;a.parsed=function(e){if(!e)return;e=e.trim();let t=e.match(Yi.function);if(t){let e=[],r=[],n=!1,o=t[1].toLowerCase(),a=t[2].replace(Yi.singleArgument,((t,a)=>{let{value:i,meta:s}=function(e){var t;let r={},n=null===(t=e.match(Yi.unitValue))||void 0===t?void 0:t[0],o=r.raw=e;n?(r.type="%"===n?"<percentage>":"<angle>",r.unit=n,r.unitless=Number(o.slice(0,-n.length)),o=r.unitless*Xi[n]):Yi.number.test(o)?(o=Number(o),r.type="<number>"):"none"===o?o=null:"NaN"===o||"calc(NaN)"===o?(o=NaN,r.type="<number>"):r.type="<ident>";return{value:o,meta:r}}(a);return(t.startsWith("/")||"color"!==o&&3===e.length)&&(n=!0),e.push(i),r.push(s),""}));return{name:o,args:e,argMeta:r,lastAlpha:n,commas:a.includes(","),rawName:t[1],rawArgs:t[2]}}}(a.str);let i=a.options?null!==(n=a.options.parseMeta)&&void 0!==n?n:a.options.meta:null;if(a.parsed){let t,r,n=a.parsed.name,c=a.parsed.args,l=c.map(((e,t)=>{var r;return null===(r=a.parsed.argMeta[t])||void 0===r?void 0:r.type}));if("color"===n){let o=c.shift();l.shift();let i=o.startsWith("--")?o.substring(2):`--${o}`,f=[o,i];if(t=Ji.findFormat({name:n,id:f,type:"function"}),!t){var s;let t,r=o in Ji.registry?o:i;if(r in Ji.registry){var u;let n=null===(u=Ji.registry[r].formats)||void 0===u||null===(u=u.color)||void 0===u?void 0:u.id;if(n){t=`Did you mean ${e.replace("color("+o,"color("+n)}?`}}throw new TypeError(`Cannot parse ${a.str}. `+(null!==(s=t)&&void 0!==s?s:"Missing a plugin?"))}r=t.space,t.id.startsWith("--")&&!o.startsWith("--")&&Ni.warn(`${r.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${t.id}) instead of color(${o}).`),o.startsWith("--")&&!t.id.startsWith("--")&&Ni.warn(`${r.name} is a standard space and supported in the CSS spec. Use color(${t.id}) instead of prefixed color(${o}).`)}else t=Ji.findFormat({name:n,type:"function"}),r=t.space;i&&Object.assign(i,{format:t,formatId:t.name,types:l,commas:a.parsed.commas});let f=1;a.parsed.lastAlpha&&(f=a.parsed.args.pop(),i&&(i.alphaType=l.pop()));let h=t.coords.length;if(c.length!==h)throw new TypeError(`Expected ${h} coordinates for ${r.id} in ${a.str}), got ${c.length}`);c=t.coerceCoords(c,l),o={spaceId:r.id,coords:c,alpha:f}}else e:for(let e of Ji.all)for(let t in e.formats){let r=e.formats[t];if("custom"!==r.type)continue;if(r.test&&!r.test(a.str))continue;let n=e.getFormat(r),s=n.parse(a.str);if(s){i&&Object.assign(i,{format:n,formatId:t}),o=s;break e}}if(!o)throw new TypeError(`Could not parse ${e} as a color. Missing a plugin?`);return o.alpha=yi(o.alpha)?o.alpha:void 0===o.alpha?1:Ri(0,o.alpha,1),o}const Xi={"%":.01,deg:1,grad:.9,rad:180/Math.PI,turn:360},Yi={function:/^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i,number:/^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i,unitValue:RegExp(`(${Object.keys(Xi).join("|")})$`),singleArgument:/\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g};function Zi(e,t){if(Array.isArray(e))return e.map((e=>Zi(e,t)));if(!e)throw new TypeError("Empty color reference");gi(e)&&(e=Fi(e,t));let r=e.space||e.spaceId;return"string"==typeof r&&(e.space=Ji.get(r)),void 0===e.alpha&&(e.alpha=1),e}class Ji{constructor(e){var t,r,n,o,a,i;this.id=e.id,this.name=e.name,this.base=e.base?Ji.get(e.base):null,this.aliases=e.aliases,this.displaySpaces=null===(t=e.displaySpaces)||void 0===t?void 0:t.map((e=>Ji.get(e))),this.bases=[];for(let e=this.base;e;e=e.base)this.bases.push(e);e.rgbGamut&&(this.rgbGamut=e.rgbGamut),e.linearGamut&&(this.linearGamut=e.linearGamut),this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);let s=null!==(r=e.coords)&&void 0!==r?r:this.base.coords;for(let e in s)"name"in s[e]||(s[e].name=e);this.coords=s;let u=null!==(n=null!==(o=e.white)&&void 0!==o?o:this.base.white)&&void 0!==n?n:"D65";this.white=$i(u),this.formats=null!==(a=e.formats)&&void 0!==a?a:{};for(let e in this.formats){let t=this.formats[e];t.type||(t.type="function"),t.name||(t.name=e)}var c;null!==(i=this.formats.color)&&void 0!==i&&i.id||(this.formats.color={...null!==(c=this.formats.color)&&void 0!==c?c:{},id:e.cssId||this.id});e.gamutSpace?this.gamutSpace="self"===e.gamutSpace?this:Ji.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(e,t)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:Ki(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Di.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=75e-6}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let r=Object.values(this.coords);return e.every(((e,n)=>{let o=r[n];if("angle"!==o.type&&o.range){if(yi(e))return!0;let[r,n]=o.range;return(void 0===r||e>=r-t)&&(void 0===n||e<=n+t)}return!0}))}get isUnbounded(){return Object.values(this.coords).every((e=>!("range"in e)))}get cssId(){var e;return(null===(e=this.formats)||void 0===e||null===(e=e.color)||void 0===e?void 0:e.id)||this.id}get isPolar(){for(let e in this.coords)if("angle"===this.coords[e].type)return!0;return!1}getFormat(e){if(!e)return null;"default"===e?e=Object.values(this.formats)[0]:"string"==typeof e&&(e=this.formats[e]);let t=Pi.get(e,this);return t!==e&&e.name in this.formats&&(this.formats[e.name]=t),t}equals(e){return!!e&&(this===e||this.id===e||this.id===e.id)}to(e,t){if(1===arguments.length){const r=Zi(e);[e,t]=[r.space,r.coords]}if(e=Ji.get(e),this.equals(e))return t;t=t.map((e=>yi(e)?0:e));let r,n,o=this.path,a=e.path;for(let e=0;e<o.length&&o[e].equals(a[e]);e++)r=o[e],n=e;if(!r)throw new Error(`Cannot convert between color spaces ${this} and ${e}: no connection space was found`);for(let e=o.length-1;e>n;e--)t=o[e].toBase(t);for(let e=n+1;e<a.length;e++)t=a[e].fromBase(t);return t}from(e,t){if(1===arguments.length){const r=Zi(e);[e,t]=[r.space,r.coords]}return(e=Ji.get(e)).to(this,t)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let r in this.coords){var t;let n=this.coords[r],o=n.range||n.refRange;e.push(null!==(t=null==o?void 0:o.min)&&void 0!==t?t:0)}return e}static registry={};static get all(){return[...new Set(Object.values(Ji.registry))]}static register(e,t){if(1===arguments.length&&(e=(t=arguments[0]).id),t=this.get(t),this.registry[e]&&this.registry[e]!==t)throw new Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=t,1===arguments.length&&t.aliases)for(let e of t.aliases)this.register(e,t);return t}static get(e,...t){if(!e||Oi(e,this))return e;if("string"===vi(e)){let t=Ji.registry[e.toLowerCase()];if(!t)throw new TypeError(`No color space found with id = "${e}"`);return t}if(t.length)return Ji.get(...t);throw new TypeError(`${e} is not a valid color space`)}static findFormat(e,t=Ji.all){if(!e)return null;"string"==typeof e&&(e={name:e});for(let o of t)for(let[t,a]of Object.entries(o.formats)){var r,n;null!==(r=a.name)&&void 0!==r||(a.name=t),null!==(n=a.type)&&void 0!==n||(a.type="function");let i=!(e.name&&a.name!==e.name||e.type&&a.type!==e.type);if(e.id){let t=a.ids||[a.id],r=Array.isArray(e.id)?e.id:[e.id];i&&(i=r.some((e=>t.includes(e))))}if(i){let e=Pi.get(a,o);return e!==a&&(o.formats[a.name]=e),e}}return null}static resolveCoord(e,t){let r,n,o=vi(e);if("string"===o?e.includes(".")?[r,n]=e.split("."):[r,n]=[,e]:Array.isArray(e)?[r,n]=e:(r=e.space,n=e.coordId),r=Ji.get(r),r||(r=t),!r)throw new TypeError(`Cannot resolve coordinate reference ${e}: No color space specified and relative references are not allowed here`);if(o=vi(n),"number"===o||"string"===o&&n>=0){let e=Object.entries(r.coords)[n];if(e)return{space:r,id:e[0],index:n,...e[1]}}r=Ji.get(r);let a=n.toLowerCase(),i=0;for(let e in r.coords){var s;let t=r.coords[e];if(e.toLowerCase()===a||(null===(s=t.name)||void 0===s?void 0:s.toLowerCase())===a)return{space:r,id:e,index:i,...t};i++}throw new TypeError(`No "${n}" coordinate found in ${r.name}. Its coordinates are: ${Object.keys(r.coords).join(", ")}`)}static DEFAULT_FORMAT={type:"functions",name:"color"}}function Ki(e){let t=[e];for(let r=e;r=r.base;)t.push(r);return t}var Ui=new Ji({id:"xyz-d65",name:"XYZ D65",coords:{x:{refRange:[0,1],name:"X"},y:{refRange:[0,1],name:"Y"},z:{refRange:[0,1],name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});class Vi extends Ji{constructor(e){var t,r,n;(e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=Ui),e.toXYZ_M&&e.fromXYZ_M)&&(null!==(r=e.toBase)&&void 0!==r||(e.toBase=t=>{let r=mi(t,e.toXYZ_M);return this.white!==this.base.white&&(r=qi(this.white,this.base.white,r)),r}),null!==(n=e.fromBase)&&void 0!==n||(e.fromBase=t=>mi(t=qi(this.base.white,this.white,t),e.fromXYZ_M)));null!==(t=e.referred)&&void 0!==t||(e.referred="display"),super(e)}}function Qi(e,t){e=Zi(e);let r,n=Ji.get(t,null==t?void 0:t.space),o=null==t?void 0:t.precision;return r=!n||e.space.equals(n)?e.coords.slice():n.from(e),void 0===o?r:r.map((e=>Mi(e,o)))}function es(e,t){var r;if(e=Zi(e),"alpha"===t)return null!==(r=e.alpha)&&void 0!==r?r:1;let{space:n,index:o}=Ji.resolveCoord(t,e.space);return Qi(e,n)[o]}function ts(e,t,r,n){return e=Zi(e),Array.isArray(t)&&([t,r,n]=[e.space,t,r]),t=Ji.get(t),e.coords=t===e.space?r.slice():t.to(e.space,r),void 0!==n&&(e.alpha=n),e}function rs(e,t,r){if(e=Zi(e),2===arguments.length&&"object"===vi(arguments[1])){let t=arguments[1];for(let r in t)rs(e,r,t[r])}else if("function"==typeof r&&(r=r(es(e,t))),"alpha"===t)e.alpha=r;else{let{space:n,index:o}=Ji.resolveCoord(t,e.space),a=Qi(e,n);a[o]=r,ts(e,n,a)}return e}ts.returns="color",rs.returns="color";var ns=new Ji({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Ui,fromBase:e=>qi(Ui.white,"D50",e),toBase:e=>qi("D50",Ui.white,e)});const os=216/24389,as=24/116,is=24389/27;let ss=Gi.D50;var us=new Ji({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:ss,base:ns,fromBase(e){let t=e.map(((e,t)=>e/ss[t])).map((e=>e>os?Math.cbrt(e):(is*e+16)/116));return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(e){let[t,r,n]=e,o=[];return o[1]=(t+16)/116,o[0]=r/500+o[1],o[2]=o[1]-n/200,[o[0]>as?Math.pow(o[0],3):(116*o[0]-16)/is,e[0]>8?Math.pow((e[0]+16)/116,3):e[0]/is,o[2]>as?Math.pow(o[2],3):(116*o[2]-16)/is].map(((e,t)=>e*ss[t]))},formats:{lab:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function cs(e){return"number"!=typeof e?e:(e%360+360)%360}function ls(e,t){let[r,n]=t,o=yi(r),a=yi(n);if(o&&a)return[r,n];if(o?r=n:a&&(n=r),"raw"===e)return t;r=cs(r),n=cs(n);let i=n-r;return"increasing"===e?i<0&&(n+=360):"decreasing"===e?i>0&&(r+=360):"longer"===e?-180<i&&i<180&&(i>0?r+=360:n+=360):"shorter"===e&&(i>180?r+=360:i<-180&&(n+=360)),[r,n]}var fs=new Ji({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:us,fromBase(e){if(void 0===this.ε){let e=Object.values(this.base.coords)[1].refRange,t=e[1]-e[0];this.ε=t/1e5}let[t,r,n]=e,o=Math.abs(r)<this.ε&&Math.abs(n)<this.ε,a=o?null:cs(180*Math.atan2(n,r)/Math.PI);return[t,o?0:Math.sqrt(r**2+n**2),a]},toBase(e){let[t,r,n]=e,o=null,a=null;return yi(n)||(r=r<0?0:r,o=r*Math.cos(n*Math.PI/180),a=r*Math.sin(n*Math.PI/180)),[t,o,a]},formats:{lch:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}});const hs=25**7,ps=Math.PI,ds=180/ps,ms=ps/180;function gs(e){const t=e*e;return t*t*t*e}function vs(e,t,{kL:r=1,kC:n=1,kH:o=1}={}){[e,t]=Zi([e,t]);let[a,i,s]=us.from(e),u=fs.from(us,[a,i,s])[1],[c,l,f]=us.from(t),h=fs.from(us,[c,l,f])[1];u<0&&(u=0),h<0&&(h=0);let p=gs((u+h)/2),d=.5*(1-Math.sqrt(p/(p+hs))),m=(1+d)*i,g=(1+d)*l,v=Math.sqrt(m**2+s**2),b=Math.sqrt(g**2+f**2),y=0===m&&0===s?0:Math.atan2(s,m),w=0===g&&0===f?0:Math.atan2(f,g);y<0&&(y+=2*ps),w<0&&(w+=2*ps),y*=ds,w*=ds;let M,x=c-a,C=b-v,R=w-y,S=y+w,E=Math.abs(R);v*b==0?M=0:E<=180?M=R:R>180?M=R-360:R<-180?M=R+360:Ni.warn("the unthinkable has happened");let B,O=2*Math.sqrt(b*v)*Math.sin(M*ms/2),_=(a+c)/2,k=(v+b)/2,L=gs(k);B=v*b==0?S:E<=180?S/2:S<360?(S+360)/2:(S-360)/2;let I=(_-50)**2,j=1+.015*I/Math.sqrt(20+I),P=1+.045*k,T=1;T-=.17*Math.cos((B-30)*ms),T+=.24*Math.cos(2*B*ms),T+=.32*Math.cos((3*B+6)*ms),T-=.2*Math.cos((4*B-63)*ms);let A=1+.015*k*T,z=30*Math.exp(-1*((B-275)/25)**2),H=2*Math.sqrt(L/(L+hs)),D=(x/(r*j))**2;return D+=(C/(n*P))**2,D+=(O/(o*A))**2,D+=-1*Math.sin(2*z*ms)*H*(C/(n*P))*(O/(o*A)),Math.sqrt(D)}const bs=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],ys=[[1.2268798758459243,-.557814994460