"use strict";var l=Object.create;var e=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var a=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var y=(r,t)=>{for(var n in t)e(r,n,{get:t[n],enumerable:!0})},u=(r,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of m(t))!p.call(r,i)&&i!==n&&e(r,i,{get:()=>t[i],enumerable:!(s=b(t,i))||s.enumerable});return r};var f=(r,t,n)=>(n=r!=null?l(a(r)):{},u(t||!r||!r.__esModule?e(n,"default",{value:r,enumerable:!0}):n,r)),B=r=>u(e({},"__esModule",{value:!0}),r);var x={};y(x,{default:()=>o});module.exports=B(x);var h=f(require("tinycolor2"),1),d=123;function M(r){return`#${Math.min(r,Math.pow(2,24)).toString(16).padStart(6,"0")}`}function g(r,t,n){return(r<<16)+(t<<8)+n}function w(r){let{r:t,g:n,b:s}=(0,h.default)(r).toRgb();return g(t,n,s)}function c(r,t){return r*d%Math.pow(2,t)}var o=class{csBits;registry;constructor(t=6){this.csBits=t,this.registry=["__reserved for background__"]}register(t){if(this.registry.length>=Math.pow(2,24-this.csBits))return null;let n=this.registry.length,s=c(n,this.csBits),i=M(n+(s<<24-this.csBits));return this.registry.push(t),i}lookup(t){let n=typeof t=="string"?w(t):g(...t);if(!n)return null;let s=n&Math.pow(2,24-this.csBits)-1,i=n>>24-this.csBits&Math.pow(2,this.csBits)-1;return c(s,this.csBits)!==i||s>=this.registry.length?null:this.registry[s]}};