'use strict';var chunkYISEJCI6_cjs=require('./chunk-YISEJCI6.cjs');var $=s=>({r:chunkYISEJCI6_cjs.a(s.r,0,255),g:chunkYISEJCI6_cjs.a(s.g,0,255),b:chunkYISEJCI6_cjs.a(s.b,0,255),alpha:chunkYISEJCI6_cjs.a(chunkYISEJCI6_cjs.b(s.alpha,3),0,1)}),x=s=>{if(!chunkYISEJCI6_cjs.h(s))return null;let n=s.colorSpace;if(n==="display-p3"||n==="rec2020"||n==="a98-rgb"||n==="prophoto-rgb"||!chunkYISEJCI6_cjs.i(s,["r","g","b"]))return null;let{r:e,g:t,b:c,alpha:l=1}=s;return !chunkYISEJCI6_cjs.f(e)||!chunkYISEJCI6_cjs.f(t)||!chunkYISEJCI6_cjs.f(c)||!chunkYISEJCI6_cjs.f(l)?null:$({r:chunkYISEJCI6_cjs.g(e),g:chunkYISEJCI6_cjs.g(t),b:chunkYISEJCI6_cjs.g(c),alpha:chunkYISEJCI6_cjs.g(l)})},y=new RegExp(`^rgba?\\(\\s*(?<r>${chunkYISEJCI6_cjs.k})(?<rp>%?)\\s*(?:,\\s*(?<g_c>${chunkYISEJCI6_cjs.k})(?<gp_c>%?)\\s*,\\s*(?<b_c>${chunkYISEJCI6_cjs.k})(?<bp_c>%?)(?:\\s*,\\s*(?<al_c>${chunkYISEJCI6_cjs.k})(?<alp_c>%?))?\\s*|\\s+(?<g_s>${chunkYISEJCI6_cjs.k})(?<gp_s>%?)\\s+(?<b_s>${chunkYISEJCI6_cjs.k})(?<bp_s>%?)(?:\\s*/\\s*(?<al_s>${chunkYISEJCI6_cjs.k})(?<alp_s>%?))?\\s*)\\)$`,"i"),N=s=>{if(typeof s!="string")return null;let n=y.exec(s.trim())?.groups;if(!n)return null;let e=n.g_c!==void 0,t=n.g_c??n.g_s,c=n.b_c??n.b_s,l=!!n.rp,b=!!(n.gp_c??n.gp_s),_=!!(n.bp_c??n.bp_s),m=l?chunkYISEJCI6_cjs.l(n.r)/100*255:chunkYISEJCI6_cjs.l(n.r),w=b?chunkYISEJCI6_cjs.l(t)/100*255:chunkYISEJCI6_cjs.l(t),d=_?chunkYISEJCI6_cjs.l(c)/100*255:chunkYISEJCI6_cjs.l(c);if(e&&(l!==b||b!==_||/^none$/i.test(n.r)||/^none$/i.test(t)||/^none$/i.test(c)))return null;let u=n.al_c??n.al_s,h=!!(n.alp_c??n.alp_s);if(e&&u!==void 0&&/^none$/i.test(u))return null;let k=u===void 0?1:chunkYISEJCI6_cjs.l(u)/(h?100:1);return $({r:m,g:w,b:d,alpha:k})};exports.a=$;exports.b=x;exports.c=N;//# sourceMappingURL=chunk-2KB6V6KD.cjs.map
//# sourceMappingURL=chunk-2KB6V6KD.cjs.map