1import{r as v,j as t}from"./index-ChW4b2u4.js";import{C as et}from"./color-CE_Qbwdo.js";import{V as tt}from"./ValueList-B3l-gIaG.js";import{C as rt}from"./CSSLoader-CQYs5bb3.js";import{f as w}from"./formatBytes-xLNgkmZ9.js";function ve(e){return e.trim().startsWith("var(")}function nt({colors:e}){const[r,i]=v.useState("usage"),[s,n]=v.useState(!0),[o,l]=v.useState(new Set),[a,d]=v.useState(!1),c=g=>{const x=new Set(o);x.has(g)?x.delete(g):x.add(g),l(x)};if(!e||e.length===0)return t.jsx("div",{style:{padding:"2rem",textAlign:"center",opacity:.6},children:"No colors found"});const u=e.filter(g=>!ve(g.raw)),f=e.filter(g=>ve(g.raw)),j=[...u.filter(g=>o.size===0?!0:Array.from(o).some(x=>x==="other"?!g.properties.some(C=>["background-color","color","border-color","fill","stroke"].includes(C)):g.properties.includes(x)))].sort((g,x)=>{switch(r){case"usage":return x.count-g.count;case"hue":return(g.oklch?.h||0)-(x.oklch?.h||0);case"lightness":return(x.oklch?.l||0)-(g.oklch?.l||0);case"saturation":return(x.oklch?.c||0)-(g.oklch?.c||0);case"order":return g.firstPosition-x.firstPosition;default:return 0}});return t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",gap:"1rem",marginBottom:"1.5rem",alignItems:"center",background:"var(--bg-offset)",boxShadow:"inset 0 0 0 1px var(--border)",padding:"8px 16px",borderRadius:"12px"},children:[t.jsx("div",{style:{fontFamily:"monospace",display:"flex",flexDirection:"row",alignItems:"center",gap:"1rem",fontSize:"12px"},children:[{value:"background-color",label:"background-color"},{value:"color",label:"color"},{value:"border-color",label:"border-color"},{value:"fill",label:"fill"},{value:"stroke",label:"stroke"},{value:"other",label:"other"}].map(({value:g,label:x})=>t.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.25rem",cursor:"pointer",opacity:o.has(g)?1:.7},children:[t.jsx("input",{type:"checkbox",checked:o.has(g),onChange:()=>c(g),style:{cursor:"pointer"}}),x]},g))}),t.jsxs("label",{style:{fontSize:"var(--font-size-4)",fontWeight:"700",display:"flex",alignItems:"center",gap:"0.5rem"},children:["Sort by:",t.jsxs("select",{value:r,onChange:g=>i(g.target.value),style:{padding:"0.25rem 0.5rem"},children:[t.jsx("option",{value:"usage",children:"Usage"}),t.jsx("option",{value:"hue",children:"Hue"}),t.jsx("option",{value:"lightness",children:"Lightness"}),t.jsx("option",{value:"saturation",children:"Saturation"}),t.jsx("option",{value:"order",children:"Source Order"})]})]}),f.length>0&&t.jsxs("label",{style:{fontSize:"0.9rem",display:"flex",alignItems:"center",gap:"0.5rem"},children:[t.jsx("input",{type:"checkbox",checked:a,onChange:g=>d(g.target.checked)}),"Show CSS variables"]})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(192px, 1fr))",gap:"24px",marginBottom:"2rem"},children:j.map((g,x)=>t.jsxs("div",{style:{borderRadius:"6px",overflow:"hidden",boxShadow:"0 0 0px 1px var(--border)"},children:[t.jsx("div",{className:"bg-checker",style:{"--checker-size":"16px"},children:t.jsx("div",{style:{background:g.resolved||g.raw,height:"96px",borderRadius:"6px 6px 0 0",maxWidth:"100%"},title:`${g.raw}${g.resolved&&g.resolved!==g.raw?` â ${g.resolved}`:""}`})}),t.jsx("div",{style:{padding:"8px",fontSize:"12px",borderTop:"1px solid var(--border)"},children:t.jsx("div",{style:{whiteSpace:"nowrap",overflow:"hidden",fontSize:"10px"},title:`${g.resolved||(s?g.raw:g.normalized||g.raw)}${g.resolved&&g.resolved!==g.raw?` (raw: ${g.raw})`:""}`,children:t.jsxs("code",{children:[g.resolved||(s?g.raw:g.normalized||g.raw),g.resolved&&g.resolved!==g.raw&&t.jsxs("span",{children:["â ",g.resolved]})]})})})]},x))}),a&&f.length>0&&t.jsxs("div",{style:{marginTop:"3rem"},children:[t.jsxs("h3",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"1rem",paddingBottom:"0.5rem",borderBottom:"2px solid var(--border)"},children:["CSS Variables (",f.length,")"]}),t.jsxs("p",{style:{fontSize:"0.9rem",opacity:.7,marginBottom:"1rem"},children:["These are CSS variable references (e.g., ",t.jsx("code",{children:"var(--primary)"}),") that point to actual color values. They're excluded from the main palette to show only renderable colors."]}),t.jsx("div",{style:{display:"grid",gap:"0.5rem",fontFamily:"monospace",fontSize:"0.85rem"},children:f.map((g,x)=>t.jsxs("div",{style:{padding:"0.75rem",background:"var(--code-bg)",borderRadius:"4px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsx("span",{children:g.raw}),t.jsxs("span",{style:{opacity:.6}
1,children:[g.count,"Ã in ",g.properties.join(", ")]})]},x))})]})]})}function it(e){var r=0,i=e.children,s=i&&i.length;if(!s)r=1;else for(;--s>=0;)r+=i[s].value;e.value=r}function st(){return this.eachAfter(it)}function ot(e,r){let i=-1;for(const s of this)e.call(r,s,++i,this);return this}function at(e,r){for(var i=this,s=[i],n,o,l=-1;i=s.pop();)if(e.call(r,i,++l,this),n=i.children)for(o=n.length-1;o>=0;--o)s.push(n[o]);return this}function lt(e,r){for(var i=this,s=[i],n=[],o,l,a,d=-1;i=s.pop();)if(n.push(i),o=i.children)for(l=0,a=o.length;l<a;++l)s.push(o[l]);for(;i=n.pop();)e.call(r,i,++d,this);return this}function dt(e,r){let i=-1;for(const s of this)if(e.call(r,s,++i,this))return s}function ct(e){return this.eachAfter(function(r){for(var i=+e(r.data)||0,s=r.children,n=s&&s.length;--n>=0;)i+=s[n].value;r.value=i})}function pt(e){return this.eachBefore(function(r){r.children&&r.children.sort(e)})}function ht(e){for(var r=this,i=ut(r,e),s=[r];r!==i;)r=r.parent,s.push(r);for(var n=s.length;e!==i;)s.splice(n,0,e),e=e.parent;return s}function ut(e,r){if(e===r)return e;var i=e.ancestors(),s=r.ancestors(),n=null;for(e=i.pop(),r=s.pop();e===r;)n=e,e=i.pop(),r=s.pop();return n}function gt(){for(var e=this,r=[e];e=e.parent;)r.push(e);return r}function ft(){return Array.from(this)}function xt(){var e=[];return this.eachBefore(function(r){r.children||e.push(r)}),e}function mt(){var e=this,r=[];return e.each(function(i){i!==e&&r.push({source:i.parent,target:i})}),r}function*yt(){var e=this,r,i=[e],s,n,o;do for(r=i.reverse(),i=[];e=r.pop();)if(yield e,s=e.children)for(n=0,o=s.length;n<o;++n)i.push(s[n]);while(i.length)}function fe(e,r){e instanceof Map?(e=[void 0,e],r===void 0&&(r=jt)):r===void 0&&(r=bt);for(var i=new oe(e),s,n=[i],o,l,a,d;s=n.pop();)if((l=r(s.data))&&(d=(l=Array.from(l)).length))for(s.children=l,a=d-1;a>=0;--a)n.push(o=l[a]=new oe(l[a])),o.parent=s,o.depth=s.depth+1;return i.eachBefore(wt)}function vt(){return fe(this).eachBefore(St)}function bt(e){return e.children}function jt(e){return Array.isArray(e)?e[1]:null}function St(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function wt(e){var r=0;do e.height=r;while((e=e.parent)&&e.height<++r)}function oe(e){this.data=e,this.depth=this.height=0,this.parent=null}oe.prototype=fe.prototype={constructor:oe,count:st,each:ot,eachAfter:lt,eachBefore:at,find:dt,sum:ct,sort:pt,path:ht,ancestors:gt,descendants:ft,leaves:xt,links:mt,copy:vt,[Symbol.iterator]:yt};function zt(e){return e==null?null:kt(e)}function kt(e){if(typeof e!="function")throw new Error;return e}function be(){return 0}function Ct(e){return function(){return e}}const _t=1664525,Rt=1013904223,je=4294967296;function $t(){let e=1;return()=>(e=(_t*e+Rt)%je)/je}function Tt(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ft(e,r){let i=e.length,s,n;for(;i;)n=r()*i--|0,s=e[i],e[i]=e[n],e[n]=s;return e}function Wt(e,r){for(var i=0,s=(e=Ft(Array.from(e),r)).length,n=[],o,l;i<s;)o=e[i],l&&Ee(l,o)?++i:(l=Mt(n=At(n,o)),i=0);return l}function At(e,r){var i,s;if(pe(r,e))return[r];for(i=0;i<e.length;++i)if(ne(r,e[i])&&pe(Q(e[i],r),e))return[e[i],r];for(i=0;i<e.length-1;++i)for(s=i+1;s<e.length;++s)if(ne(Q(e[i],e[s]),r)&&ne(Q(e[i],r),e[s])&&ne(Q(e[s],r),e[i])&&pe(Ie(e[i],e[s],r),e))return[e[i],e[s],r];throw new Error}function ne(e,r){var i=e.r-r.r,s=r.x-e.x,n=r.y-e.y;return i<0||i*i<s*s+n*n}function Ee(e,r){var i=e.r-r.r+Math.max(e.r,r.r,1)*1e-9,s=r.x-e.x,n=r.y-e.y;return i>0&&i*i>s*s+n*n}function pe(e,r){for(var i=0;i<r.length;++i)if(!Ee(e,r[i]))return!1;return!0}function Mt(e){switch(e.length){case 1:return Bt(e[0]);case 2:return Q(e[0],e[1]);case 3:return Ie(e[0],e[1],e[2])}}function Bt(e){return{x:e.x,y:e.y,r:e.r}}function Q(e,r){var i=e.x,s=e.y,n=e.r,o=r.x,l=r.y,a=r.r,d=o-i,c=l-s,u=a-n,f=Math.sqrt(d*d+c*c);return{x:(i+o+d/f*u)/2,y:(s+l+c/f*u)/2,r:(f+n+a)/2}}function Ie(e,r,i){var s=e.x,n=e.y,o=e.r,l=r.x,a=r.y,d=r.r,c=i.x,u=i.y,f=i.r,y=s-l,j=s-c,g=n-a,x=n-u,C=d-o,S=f-o,k=s*s+n*n-o*o,R=k-l*l-a*a+d*d,T=k-c*c-u*u+f*f,A=j*g-y*x,I=(g*T-x*R)/(A*2)-s,G=(x*C-g*S)/A,O=(j*R-y*T)/(A*2)-n,J=(y*S-j*C)/A,Y=G*G+J*J-1,D=2*(o+I*G+O*J),Z=I*I+O*O-o*o,_=-(Math.abs(Y)>1e-6?(D+Math.sqrt(D*D-4*Y*Z))/(2*Y):Z/D);return{x:s+I+G*_,y:n+O+J*_,r:_}}function Se(e,r,i){var s=e.x-r.x,n,o,l=e.y-r.y,a,d,c=s*s+l*l;c?(o=r.r+i.r,o*=o,d=e.r+i.r,d*=d,o>d?(n=(c+d-o)/(2*c),a=Math.sqrt(Math.max(0,d/c-n*n)),i.x=e.x-n*s-a*l,i.y=e.y-n*l+a*s):(n=(c+o-d)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),i.x=r.x+n*s-a*l,i.y=r.y+n*l+a*s)):(i.x=r.x+i.r,i.y=r.y
1)}function we(e,r){var i=e.r+r.r-1e-6,s=r.x-e.x,n=r.y-e.y;return i>0&&i*i>s*s+n*n}function ze(e){var r=e._,i=e.next._,s=r.r+i.r,n=(r.x*i.r+i.x*r.r)/s,o=(r.y*i.r+i.y*r.r)/s;return n*n+o*o}function ie(e){this._=e,this.next=null,this.previous=null}function Et(e,r){if(!(o=(e=Tt(e)).length))return 0;var i,s,n,o,l,a,d,c,u,f,y;if(i=e[0],i.x=0,i.y=0,!(o>1))return i.r;if(s=e[1],i.x=-s.r,s.x=i.r,s.y=0,!(o>2))return i.r+s.r;Se(s,i,n=e[2]),i=new ie(i),s=new ie(s),n=new ie(n),i.next=n.previous=s,s.next=i.previous=n,n.next=s.previous=i;e:for(d=3;d<o;++d){Se(i._,s._,n=e[d]),n=new ie(n),c=s.next,u=i.previous,f=s._.r,y=i._.r;do if(f<=y){if(we(c._,n._)){s=c,i.next=s,s.previous=i,--d;continue e}f+=c._.r,c=c.next}else{if(we(u._,n._)){i=u,i.next=s,s.previous=i,--d;continue e}y+=u._.r,u=u.previous}while(c!==u.next);for(n.previous=i,n.next=s,i.next=s.previous=s=n,l=ze(i);(n=n.next)!==s;)(a=ze(n))<l&&(i=n,l=a);s=i.next}for(i=[s._],n=s;(n=n.next)!==s;)i.push(n._);for(n=Wt(i,r),d=0;d<o;++d)i=e[d],i.x-=n.x,i.y-=n.y;return n.r}function It(e){return Math.sqrt(e.value)}function Nt(){var e=null,r=1,i=1,s=be;function n(o){const l=$t();return o.x=r/2,o.y=i/2,e?o.eachBefore(ke(e)).eachAfter(he(s,.5,l)).eachBefore(Ce(1)):o.eachBefore(ke(It)).eachAfter(he(be,1,l)).eachAfter(he(s,o.r/Math.min(r,i),l)).eachBefore(Ce(Math.min(r,i)/(2*o.r))),o}return n.radius=function(o){return arguments.length?(e=zt(o),n):e},n.size=function(o){return arguments.length?(r=+o[0],i=+o[1],n):[r,i]},n.padding=function(o){return arguments.length?(s=typeof o=="function"?o:Ct(+o),n):s},n}function ke(e){return function(r){r.children||(r.r=Math.max(0,+e(r)||0))}}function he(e,r,i){return function(s){if(n=s.children){var n,o,l=n.length,a=e(s)*r||0,d;if(a)for(o=0;o<l;++o)n[o].r+=a;if(d=Et(n,i),a)for(o=0;o<l;++o)n[o].r-=a;s.r=d+a}}}function Ce(e){return function(r){var i=r.parent;r.r*=e,i&&(r.x=i.x+e*r.x,r.y=i.y+e*r.y)}}var ge="http://www.w3.org/1999/xhtml";const _e={svg:"http://www.w3.org/2000/svg",xhtml:ge,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ne(e){var r=e+="",i=r.indexOf(":");return i>=0&&(r=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),_e.hasOwnProperty(r)?{space:_e[r],local:e}:e}function Lt(e){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===ge&&r.documentElement.namespaceURI===ge?r.createElement(e):r.createElementNS(i,e)}}function Dt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Le(e){var r=Ne(e);return(r.local?Dt:Lt)(r)}function Pt(){}function De(e){return e==null?Pt:function(){return this.querySelector(e)}}function Ot(e){typeof e!="function"&&(e=De(e));for(var r=this._groups,i=r.length,s=new Array(i),n=0;n<i;++n)for(var o=r[n],l=o.length,a=s[n]=new Array(l),d,c,u=0;u<l;++u)(d=o[u])&&(c=e.call(d,d.__data__,u,o))&&("__data__"in d&&(c.__data__=d.__data__),a[u]=c);return new E(s,this._parents)}function Vt(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ht(){return[]}function qt(e){return e==null?Ht:function(){return this.querySelectorAll(e)}}function Ut(e){return function(){return Vt(e.apply(this,arguments))}}function Gt(e){typeof e=="function"?e=Ut(e):e=qt(e);for(var r=this._groups,i=r.length,s=[],n=[],o=0;o<i;++o)for(var l=r[o],a=l.length,d,c=0;c<a;++c)(d=l[c])&&(s.push(e.call(d,d.__data__,c,l)),n.push(d));return new E(s,n)}function Kt(e){return function(){return this.matches(e)}}function Pe(e){return function(r){return r.matches(e)}}var Jt=Array.prototype.find;function Qt(e){return function(){return Jt.call(this.children,e)}}function Xt(){return this.firstElementChild}function Yt(e){return this.select(e==null?Xt:Qt(typeof e=="function"?e:Pe(e)))}var Zt=Array.prototype.filter;function er(){return Array.from(this.children)}function tr(e){return function(){return Zt.call(this.children,e)}}function rr(e){return this.selectAll(e==null?er:tr(typeof e=="function"?e:Pe(e)))}function nr(e){typeof e!="function"&&(e=Kt(e));for(var r=this._groups,i=r.length,s=new Array(i),n=0;n<i;++n)for(var o=r[n],l=o.length,a=s[n]=[],d,c=0;c<l;++c)(d=o[c])&&e.call(d,d.__data__,c,o)&&a.push(d);return new E(s,this._parents)}function Oe(e){return new Array(e.length)}function ir(){return new E(this._enter||this._groups.map(Oe),this._parents)}function ae(e,r){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=r}ae.prototype={constructor:ae,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,r){return this._parent.insertBefore(e,r)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function sr(e){return function(){return e}}function or(e,r,i,s,n,o){for(var l=0,a,d=r.length,c=o.length;l<c;++l)(a=r[l])?(a.__data__=o[l],s[l]=a):i[l]=new ae(e,o[l]);for(;l<d;++l)(a=r[l])&&(n[l]=a)}function ar(e,r,i,s,n,o,l){var a,d,c=new Map,u=r.length,f=o.length,y=new Array(u),j;for(a=0;a<u;++a)(d=r[a])&&(y[a]=j=l.call(d,d.__data__,a,r)+"",c.has(j)?n[a]=d:c.set(j,d));for(a=0;a<f;++a)j=l.call(e,o[a],a,o)+"",(d=c.get(j))?(s[a]=d,d.__data__=o[a],c.delete(j)):i[a]=new ae(e,o[a]);for(a=0;a<u;++a)(d=r[a])&&c.get(y[a])===d&&(n[a]=d)}function lr(e){return e.__data__}function dr(e,r){if(!arguments.length)return Array.from(this,lr);var i=r?ar:or,s=this._parents,n=this._groups;typeof e!="function"&&(e=sr(e));for(var o=n.length,l=new Array(o),a=new Array(o),d=new Array(o),c=0;c<o;++c){var u=s[c],f=n[c],y=f.length,j=cr(e.call(u,u&&u.__data__,c,s)),g=j.length,x=a[c]=new Array(g),C=l[c]=new Array(g),S=d[c]=new Array(y);i(u,f,x,C,S,j,r);for(var k=0,R=0,T,A;k<g;++k)if(T=x[k]){for(k>=R&&(R=k+1);!(A=C[R])&&++R<g;);T._next=A||null}}return l=new E(l,s),l._enter=a,l._exit=d,l}function cr(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pr(){return new E(this._exit||this._groups.map(Oe),this._parents)}function hr(e,r,i){var s=this.enter(),n=this,o=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),r!=null&&(n=r(n),n&&(n=n.selection())),i==null?o.remove():i(o),s&&n?s.merge(n).order():n}function ur(e){for(var r=e.selection?e.selection():e,i=this._groups,s=r._groups,n=i.length,o=s.length,l=Math.min(n,o),a=new Array(n),d=0;d<l;++d)for(var c=i[d],u=s[d],f=c.length,y=a[d]=new Array(f),j,g=0;g<f;++g)(j=c[g]||u[g])&&(y[g]=j);for(;d<n;++d)a[d]=i[d];return new E(a,this._parents)}function gr(){for(var e=this._groups,r=-1,i=e.length;++r<i;)for(var s=e[r],n=s.length-1,o=s[n],l;--n>=0;)(l=s[n])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function fr(e){e||(e=xr);function r(f,y){return f&&y?e(f.__data__,y.__data__):!f-!y}for(var i=this._groups,s=i.length,n=new Array(s),o=0;o<s;++o){for(var l=i[o],a=l.length,d=n[o]=new Array(a),c,u=0;u<a;++u)(c=l[u])&&(d[u]=c);d.sort(r)}return new E(n,this._parents).order()}function xr(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}function mr(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function yr(){return Array.from(this)}function vr(){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var s=e[r],n=0,o=s.length;n<o;++n){var l=s[n];if(l)return l}return null}function br(){let e=0;for(const r of this)++e;return e}function jr(){return!this.node()}function Sr(e){for(var r=this._groups,i=0,s=r.length;i<s;++i)for(var n=r[i],o=0,l=n.length,a;o<l;++o)(a=n[o])&&e.call(a,a.__data__,o,n);return this}function wr(e){return function(){this.removeAttribute(e)}}function zr(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kr(e,r){return function(){this.setAttribute(e,r)}}function Cr(e,r){return function(){this.setAttributeNS(e.space,e.local,r)}}function _r(e,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function Rr(e,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function $r(e,r){var i=Ne(e);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((r==null?i.local?zr:wr:typeof r=="function"?i.local?Rr:_r:i.local?Cr:kr)(i,r))}function Ve(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Tr(e){return function(){this.style.removeProperty(e)}}function Fr(e,r,i){return function(){this.style.setProperty(e,r,i
vendor: 3,735 bytes, line 1
1)}}function Wr(e,r,i){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,i)}}function Ar(e,r,i){return arguments.length>1?this.each((r==null?Tr:typeof r=="function"?Wr:Fr)(e,r,i??"")):Mr(this.node(),e)}function Mr(e,r){return e.style.getPropertyValue(r)||Ve(e).getComputedStyle(e,null).getPropertyValue(r)}function Br(e){return function(){delete this[e]}}function Er(e,r){return function(){this[e]=r}}function Ir(e,r){return function(){var i=r.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function Nr(e,r){return arguments.length>1?this.each((r==null?Br:typeof r=="function"?Ir:Er)(e,r)):this.node()[e]}function He(e){return e.trim().split(/^|\s+/)}function xe(e){return e.classList||new qe(e)}function qe(e){this._node=e,this._names=He(e.getAttribute("class")||"")}qe.prototype={add:function(e){var r=this._names.indexOf(e);r<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var r=this._names.indexOf(e);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ue(e,r){for(var i=xe(e),s=-1,n=r.length;++s<n;)i.add(r[s])}function Ge(e,r){for(var i=xe(e),s=-1,n=r.length;++s<n;)i.remove(r[s])}function Lr(e){return function(){Ue(this,e)}}function Dr(e){return function(){Ge(this,e)}}function Pr(e,r){return function(){(r.apply(this,arguments)?Ue:Ge)(this,e)}}function Or(e,r){var i=He(e+"");if(arguments.length<2){for(var s=xe(this.node()),n=-1,o=i.length;++n<o;)if(!s.contains(i[n]))return!1;return!0}return this.each((typeof r=="function"?Pr:r?Lr:Dr)(i,r))}function Vr(){this.textContent=""}function Hr(e){return function(){this.textContent=e}}function qr(e){return function(){var r=e.apply(this,arguments);this.textContent=r??""}}function Ur(e){return arguments.length?this.each(e==null?Vr:(typeof e=="function"?qr:Hr)(e)):this.node().textContent}function Gr(){this.innerHTML=""}function Kr(e){return function(){this.innerHTML=e}}function Jr(e){return function(){var r=e.apply(this,arguments);this.innerHTML=r??""}}function Qr(e){return arguments.length?this.each(e==null?Gr:(typeof e=="function"?Jr:Kr)(e)):this.node().innerHTML}function Xr(){this.nextSibling&&this.parentNode.appendChild(this)}function Yr(){return this.each(Xr)}function Zr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function en(){return this.each(Zr)}function tn(e){var r=typeof e=="function"?e:Le(e);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function rn(){return null}function nn(e,r){var i=typeof e=="function"?e:Le(e),s=r==null?rn:typeof r=="function"?r:De(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function sn(){var e=this.parentNode;e&&e.removeChild(this)}function on(){return this.each(sn)}function an(){var e=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function ln(){var e=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function dn(e){return this.select(e?ln:an)}function cn(e){return arguments.length?this.property("__data__",e):this.node().__data__}function pn(e){return function(r){e.call(this,r,this.__data__)}}function hn(e){return e.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");return s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),{type:r,name:i}})}function un(e){return function(){var r=this.__on;if(r){for(var i=0,s=-1,n=r.length,o;i<n;++i)o=r[i],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):r[++s]=o;++s?r.length=s:delete this.__on}}}
1function gn(e,r,i){return function(){var s=this.__on,n,o=pn(r);if(s){for(var l=0,a=s.length;l<a;++l)if((n=s[l]).type===e.type&&n.name===e.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=o,n.options=i),n.value=r;return}}this.addEventListener(e.type,o,i),n={type:e.type,name:e.name,value:r,listener:o,options:i},s?s.push(n):this.__on=[n]}}function fn(e,r,i){var s=hn(e+""),n,o=s.length,l;if(arguments.length<2){var a=this.node().__on;if(a){for(var d=0,c=a.length,u;d<c;++d)for(n=0,u=a[d];n<o;++n)if((l=s[n]).type===u.type&&l.name===u.name)return u.value}return}for(a=r?gn:un,n=0;n<o;++n)this.each(a(s[n],r,i));return this}function Ke(e,r,i){var s=Ve(e),n=s.CustomEvent;typeof n=="function"?n=new n(r,i):(n=s.document.createEvent("Event"),i?(n.initEvent(r,i.bubbles,i.cancelable),n.detail=i.detail):n.initEvent(r,!1,!1)),e.dispatchEvent(n)}function xn(e,r){return function(){return Ke(this,e,r)}}function mn(e,r){return function(){return Ke(this,e,r.apply(this,arguments))}}function yn(e,r){return this.each((typeof r=="function"?mn:xn)(e,r))}function*vn(){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var s=e[r],n=0,o=s.length,l;n<o;++n)(l=s[n])&&(yield l)}var bn=[null];function E(e,r){this._groups=e,this._parents=r}function jn(){return this}E.prototype={constructor:E,select:Ot,selectAll:Gt,selectChild:Yt,selectChildren:rr,filter:nr,data:dr,enter:ir,exit:pr,join:hr,merge:ur,selection:jn,order:gr,sort:fr,call:mr,nodes:yr,node:vr,size:br,empty:jr,each:Sr,attr:$r,style:Ar,property:Nr,classed:Or,text:Ur,html:Qr,raise:Yr,lower:en,append:tn,insert:nn,remove:on,clone:dn,datum:cn,on:fn,dispatch:yn,[Symbol.iterator]:vn};function Sn(e){return typeof e=="string"?new E([[document.querySelector(e)]],[document.documentElement]):new E([[e]],bn)}function wn(e){if(!e.oklch)return!1;const{l:r,c:i}=e.oklch;if(i<.001||i<.01&&(r<.1||r>.95))return!0;if(i<.05)try{const s=e.resolved||e.raw;if(s.startsWith("#")){const n=s.substring(1);let o,l,a;if(n.length===3)o=parseInt(n[0]+n[0],16),l=parseInt(n[1]+n[1],16),a=parseInt(n[2]+n[2],16);else if(n.length===6)o=parseInt(n.substring(0,2),16),l=parseInt(n.substring(2,4),16),a=parseInt(n.substring(4,6),16);else return!1;if(Math.max(Math.abs(o-l),Math.abs(l-a),Math.abs(o-a))<=5)return!0}}catch{}return!1}function zn(e){if(e.hueCategory)return e.hueCategory;const r=e.oklch?.h||0;return e.oklch?.c,wn(e)?"gray":r>=0&&r<30||r>=330?"red":r>=30&&r<60?"orange":r>=60&&r<90?"yellow":r>=90&&r<150?"green":r>=150&&r<210?"cyan":r>=210&&r<270?"blue":r>=270&&r<330?"purple":"pink"}function kn({colors:e}){const r=v.useRef(null);return v.useEffect(()=>{const i=r.current;if(!i)return;const s=Sn(i);if(s.selectAll("*").remove(),!e||e.length===0)return;const n=e.filter(x=>{const C=x.resolved&&x.resolved.trim()!=="",S=x.oklch!==void 0;return C||S});if(n.length===0)return;const o={red:[],orange:[],yellow:[],green:[],cyan:[],blue:[],indigo:[],purple:[],magenta:[],violet:[],pink:[],gray:[]};n.forEach(x=>{const C=zn(x);o[C].push(x)}),Object.keys(o).forEach(x=>{o[x].sort((C,S)=>{const k=C.oklch?.h||0,R=S.oklch?.h||0;let T=k,A=R;x==="red"&&(k>=330&&(T=k-360),R>=330&&(A=R-360));const I=T-A;return Math.abs(I)>.1?I:S.count-C.count})});const l=["red","orange","yellow","green","cyan","blue","indigo","purple","magenta","violet","pink","gray"],a=Object.values(o).flat().reduce((x,C)=>x+C.count,0),d={name:"root",children:l.filter(x=>o[x].length>0).map(x=>{const C=o[x].reduce((S,k)=>S+k.count,0);return{name:x,value:Math.max(C,a*.05),children:o[x].map(S=>({name:S.raw,value:S.count,color:S.resolved||S.raw}))}})},f=Nt().size([512,512]).padding(2),y=fe(d).sum(x=>x.value||0).sort((x,C)=>(C.value||0)-(x.value||0)),j=f(y);s.selectAll("circle").data(j.descendants().filter(x=>x.depth===2)).enter().append("circle").attr("cx",x=>x.x).attr("cy",x=>x.y).attr("r",x=>Math.max(x.r,1.5)).attr("fill",x=>x.data.color||"#ccc").attr("stroke","var(--border)").attr("stroke-width",.5).append("title").text(x=>{const C=x.data.name,S=x.value,k=x.data.color;return`${C}: ${S}Ã 2Color: ${k}`})},[e]),t.jsx("svg",{ref:r,width:"100%",height:"auto",viewBox:"0 0 512 512",style:{margin:"16px",aspectRatio:1,display:"block",maxWidth:"512px"}})}const Cn=v.memo(kn);function Re(e){return e.trim().startsWith("var(")}function _n(e){const r=e.match(/rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*([\d.]+)\s*\)/);if(r&&parseFloat(r[1])<1)return!0;const i=e.match(/hsla?\(\s*[\d.]+\s*,\s*[\d.]+%?\s*,\s*[\d.]+%?\s*,\s*([\d.]+)\s*\)/);if(i&&parseFloat(i[1])<1)return!0;
2if(e.startsWith("#")){const s=e.slice(1);if(s.length===8)return parseInt(s.slice(6,8),16)/255<1;if(s.length===4)return parseInt(s[3]+s[3],16)/255<1}return e.toLowerCase()==="transparent"}function Rn(e){const r=e.resolved?.trim();return r||e.raw}function $e(e){return e.isOpaque===!0?!1:e.hasTransparency===!0?!0:_n(Rn(e))}function Te(e){const r=e.oklch?.h||0;return(e.oklch?.c||0)<.05?8:r>=0&&r<30?0:r>=30&&r<60?1:r>=60&&r<90?2:r>=90&&r<150?3:r>=150&&r<210?4:r>=210&&r<270?5:r>=270&&r<330?6:7}function $n({colors:e}){const{colorsWithPercentage:r,totalUsage:i}=v.useMemo(()=>{const s=e.filter(f=>!!(Re(f.raw)&&f.resolved||!Re(f.raw))),n=s.filter(f=>!$e(f)),o=s.filter(f=>$e(f)),l=[...n].sort((f,y)=>{const j=Te(f),g=Te(y);return j!==g?j-g:y.count-f.count}),a=[...o].sort((f,y)=>y.count-f.count),d=[...l,...a],c=d.reduce((f,y)=>f+y.count,0);return{colorsWithPercentage:d.map(f=>({...f,percentage:c>0?f.count/c*100:0})),totalUsage:c}},[e]);return r.length===0||i===0?null:t.jsx("div",{style:{background:"var(--bg)",display:"flex",width:"100%",height:"100%",overflow:"hidden",position:"relative",borderRadius:"20px",padding:"8px",border:"1px solid var(--border)"},children:t.jsx("div",{style:{height:"100%",width:"100%",display:"flex",flexWrap:"nowrap",borderRadius:"12px",overflow:"hidden",background:"repeating-conic-gradient(var(--checker-color-1) 0 25%, var(--checker-color-2) 0 50%) 50% / 20px 20px"},children:r.map((s,n)=>{const o=s.resolved||s.raw;return t.jsx("div",{style:{width:`${s.percentage}%`,background:o,position:"relative",transition:"opacity 0.2s ease"},title:`${s.raw}: ${s.count}Ã (${s.percentage.toFixed(1)}%)`},`${s.raw}-${n}`)})})})}const Tn=v.memo($n);function Fe(e){return e.trim().startsWith("var(")}function Fn({colors:e,limit:r=10}){const{topColors:i,totalUsage:s}=v.useMemo(()=>{const o=[...e.filter(a=>!!(Fe(a.raw)&&a.resolved||!Fe(a.raw))).filter(a=>{try{const d=a.resolved||a.raw;return d==="transparent"||d==="currentcolor"?!1:new et(d).alpha>=1}catch{return!0}})].sort((a,d)=>d.count-a.count),l=o.reduce((a,d)=>a+d.count,0);return{topColors:o.slice(0,r),totalUsage:l}},[e,r]);return i.length===0||s===0?null:t.jsx("div",{style:{display:"flex",flexDirection:"row",gap:"8px",borderRadius:"20px",boxShadow:"inset 0 0 0 1px var(--border)",padding:"8px",background:"var(--bg)"},children:i.map((n,o)=>{const l=n.resolved||n.raw;return t.jsx("div",{title:n.raw,className:"bg-checker",style:{height:"100%",width:"100%",borderRadius:"12px",overflow:"hidden"},children:t.jsx("div",{style:{width:"100%",height:"100%",aspectRatio:"2/1",background:l,flexShrink:0,borderRadius:"12px",boxShadow:"inset 0 0 0 .5px var(--border)"}})},`${n.raw}-${o}`)})})}const Wn=v.memo(Fn);function We(e){if(e.includes("transparent"))return!0;const r=e.matchAll(/rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)/g);for(const o of r)if(parseFloat(o[1])<1)return!0;const i=e.matchAll(/hsla?\(\s*[\d.]+\s*,\s*[\d.%]+\s*,\s*[\d.%]+\s*,\s*([\d.]+)\s*\)/g);for(const o of i)if(parseFloat(o[1])<1)return!0;const s=e.matchAll(/#([0-9a-fA-F]{8})\b/g);for(const o of s)if(parseInt(o[1].slice(6,8),16)/255<1)return!0;const n=e.matchAll(/#([0-9a-fA-F]{4})\b/g);for(const o of n){const l=o[1][3];if(parseInt(l+l,16)/255<1)return!0}return!1}function Ae(e){if(e.startsWith("#")){const n=e.slice(1);let o,l,a;if(n.length===3)o=parseInt(n[0]+n[0],16),l=parseInt(n[1]+n[1],16),a=parseInt(n[2]+n[2],16);else if(n.length===6)o=parseInt(n.slice(0,2),16),l=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16);else return!1;const d=Math.max(o,l,a),c=Math.min(o,l,a);return d-c>40}const r=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(r){const n=parseInt(r[1]),o=parseInt(r[2]),l=parseInt(r[3]),a=Math.max(n,o,l),d=Math.min(n,o,l);return a-d>40}const i=e.match(/hsla?\(\d+,\s*(\d+)%/);return i?parseInt(i[1])>30:/\b(red|blue|green|yellow|orange|purple|pink|cyan|magenta)\b/i.test(e)}function An(e){const r=[],i=e.matchAll(/#[0-9a-fA-F]{3,8}\b/g);for(const o of i)r.push(o[0]);const s=e.matchAll(/rgba?\([^)]+\)/g);for(const o of s)r.push(o[0]);const n=e.matchAll(/hsla?\([^)]+\)/g);for(const o of n)r.push(o[0]);return e.includes("transparent")&&r.push("transparent"),r}function Mn(e){const r=e.match(/#[0-9a-fA-F]{3,8}/g)||[],i=e.match(/rgba?\([^)]+\)/g)||[],s=e.match(/hsla?\([^)]+\)/g)||[];if(/\b(red|blue|green|yellow|orange|purple|pink|cyan|magenta)\b/i.test(e))return!1;const o=/\b(white|black|gray|grey)\b/i.test(e);let l=0,a=0;for(const d of r){const c=d.slice(1);let u,f,y;if(c.length===3)u=parseInt(c[0]+c[0],16),f=parseInt(c[1]+c[1],16),y=parseInt(c[2]+c[2],16);else if(c.length===6)u=parseInt(c.slice(0,2),16),f=parseInt(c.slice(2,4),16),y=parseInt(c.slice(4,6),16);else continue;l++,u===f&&f===y&&a++}for(const d of i){const c=d.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(c){l++;const[u,f,y,j]=c;f===y&&y===j&&a++}}for(const d of s){const c=d.match(/hsla?\(\d+,\s*(\d+)%/);c&&(l++,parseInt(c[1])<10&&a++)}return!!(l>0&&a===l||o&&l===0)}function Bn(e){const r=e.resolved||e.value;if(e.value.includes("var(")&&!e.resolved||Mn(r))return-1;const i=An(r),s=i.filter(a=>a==="transparent"||We(a)),n=i.filter(a=>a!=="transparent"&&!We(a));if(s.length>0&&!n.some(d=>Ae(d)))return-1;let o=100;const l=n.filter(a=>Ae(a)).length;return o+=l*20,o+=Math.log(e.count+1)*5,o}function En({gradients:e,limit:r=4}){const i=v.useMemo(()=>!e||e.length===0?[]:e.map(s=>{const n=Bn(s);return{gradient:s,score:n}}).filter(s=>s.score>=0).sort((s,n)=>n.score-s.score).slice(0,r),[e,r]);return i.length===0?null:t.jsx("div",{style:{display:"flex",flexDirection:"row",gap:"8px",marginTop:"12px",padding:"8px",boxShadow:"inset 0 0 0 1px var(--border)",borderRadius:"20px",background:"var(--bg)"},children:i.map(({gradient:s},n)=>{const o=s.resolved||s.value;return t.jsx("div",{className:"bg-checker",style:{width:"100%",borderRadius:"12px",overflow:"hidden"},children:t.jsx("div",{style:{width:"100%",height:"auto",aspectRatio:6/4,background:o,boxShadow:"inset 0 0 0 0.5px var(--border)"},title:s.value})},n)})})}const In=v.memo(En);function Nn({gradients:e}){return t.jsx("div",{style:{display:"grid",gap:"1rem",gridTemplateColumns:"repeat(4,1fr)"},children:e.map((r,i)=>t.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:"12px",overflow:"hidden",background:"no-repeat url(https://dlu344star2bj.cloudfront.net/unsplash/0001.jpg) top center",backgroundSize:"contain"},children:[t.jsx("div",{style:{background:r.value,aspectRatio:"2/1"}}),t.jsxs("div",{style:{height:"100%",background:"var(--bg)",padding:"1rem"},children:[t.jsx("div",{style:{fontFamily:"monospace",fontSize:"12px",marginBottom:"0.5rem",wordBreak:"break-all"},children:r.value}),t.jsxs("div",{style:{fontSize:"0.85rem",opacity:.6}
2,children:["Used ",r.count,"Ã in: ",r.properties.join(", ")]})]})]},i))})}const Ln="AIzaSyD0-Ay9AXWBEokjNqve7cbgEUAXap6ZdBU",Me="google-fonts-list",Dn=10080*60*1e3;let K=null;async function Pn(){if(K)return K;const e=localStorage.getItem(Me);if(e)try{const r=JSON.parse(e);if(Date.now()-r.timestamp<Dn)return K=new Set(r.fonts.map(s=>s.family.toLowerCase())),K}catch(r){console.warn("Failed to parse cached Google Fonts data",r)}try{const r=await fetch(`https://www.googleapis.com/webfonts/v1/webfonts?key=${Ln}&sort=popularity`);if(!r.ok)throw new Error(`Google Fonts API error: ${r.status}`);const s=(await r.json()).items||[],n={timestamp:Date.now(),fonts:s};return localStorage.setItem(Me,JSON.stringify(n)),K=new Set(s.map(o=>o.family.toLowerCase())),K}catch(r){return console.error("Failed to fetch Google Fonts list:",r),new Set}}function X(e){return e.split(",")[0].trim().replace(/['"]/g,"").trim()}async function On(e){const r=await Pn(),i=X(e).toLowerCase();return r.has(i)}function Vn(e){const i=X(e).replace(/ /g,"+"),s=`gfont-${i.toLowerCase()}`;if(document.getElementById(s))return;const n=document.createElement("link");n.id=s,n.rel="stylesheet",n.href=`https://fonts.googleapis.com/css2?family=${i}:wght@400;700&display=swap`,document.head.appendChild(n)}function Hn(e){return`https://fonts.google.com/specimen/${X(e).replace(/ /g,"+")}`}function qn({data:e}){const[r,i]=v.useState("size"),[s,n]=v.useState(new Set);if(v.useEffect(()=>{if(!e||!e.fontFamilies||e.fontFamilies.length===0)return;let a=!1;return(async()=>{const c=new Set;for(const u of e.fontFamilies.slice(0,10)){if(a)return;const f=X(u.value);await On(u.value)&&c.size<5&&(Vn(u.value),c.add(f))}a||n(c)})(),()=>{a=!0}},[e]),!e||!e.fontFamilies)return t.jsx("div",{style:{padding:"2rem",textAlign:"center"},children:"No typography data available"});const o=a=>{const d=parseFloat(a);if(isNaN(d))return 1/0;switch(a.replace(/[\d.-]/g,"").trim().toLowerCase()){case"px":return d;case"rem":return d*16;case"em":return d*16;case"pt":return d*1.333;case"%":return d*.16;case"vw":return d*10;case"vh":return d*10;default:return d}},l=v.useMemo(()=>[...e.fontSizes||[]].sort((a,d)=>r==="size"?o(a.value)-o(d.value):d.count-a.count),[e.fontSizes,r]);return t.jsxs("div",{children:[t.jsxs("div",{style:{background:"var(--bg)",borderRadius:"20px",padding:"32px",boxShadow:"inset 0 0 0 1px var(--border)"},children:[t.jsxs("h3",{style:{fontSize:"1.5rem",fontWeight:600,marginBottom:"1.5rem"},children:["Font Families (",e.fontFamilies?.length||0,")"]}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:(e.fontFamilies||[]).slice(0,12).map((a,d)=>{const c=a.value.includes("var("),u=c&&a.resolved?a.resolved:a.value,f=X(u),y=s.has(f);return t.jsxs("div",{style:{padding:"24px",border:"1px solid var(--border)",borderRadius:"12px",width:"100%"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"1rem"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem",flex:1},children:[t.jsx("code",{style:{fontSize:"var(--font-size-4)",fontWeight:500},children:a.value}),c&&a.resolved&&a.resolved!==a.value&&t.jsxs("div",{style:{fontSize:"16px",fontFamily:"monospace"},children:["â ",a.resolved]})]}),t.jsxs("span",{style:{fontSize:"0.85rem",background:"var(--bg)",padding:"0.25rem 0.75rem",borderRadius:"12px",display:"none"},children:[a.count,"Ã"]}),y&&t.jsx("a",{href:Hn(a.value),target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none",fontSize:"12px"},title:"View on Google Fonts",children:"Google Fonts"})]}),t.jsxs("div",{style:{marginTop:"1rem",maxWidth:"100%"},children:[t.jsx("p",{style:{fontFamily:y?`"${f}", ${u}`:u,fontSize:"2rem",margin:0,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",fontWeight:900},children:"The quick brown fox jumped over the lazy red dog 172,934 times"}),t.jsxs("p",{style:{fontFamily:y?`"${f}", ${u}`:u,marginTop:"8px",fontSize:"18px",fontWeight:100,whiteSpace:"nowrap",overflow:"hidden"},children:[t.jsx("b",{children:"ABCDEFGHIJKLMNOPQRSTUVWXYZ"})," abcdefghijklmnopqrstuvwxyz 0123456789 !@#$%^&*()[]-_+="]}),t.jsx("p",{style:{fontFamily:y?`"${f}", ${u}`:u,fontSize:"24px",margin:"0.25rem 0 0"}})]})]},d)})})]}),t.jsx("div",{style:{marginTop:"32px"},children:t.jsxs("div",{style:{padding:"24px",border:"1px solid var(--border)",borderRadius:"20px",background:"var(--bg)",minHeight:"200px"},children:[t.jsx("div",{style:{},children:t.jsxs("section",{style:{display:"flex",justifyContent:"space-between"},children:[t.jsxs("h3",{style:{fontSize:"1.5rem",fontWeight:600,margin:0},children:["Type Scale (",e.fontSizes?.length||0," unique)"]}),t.jsxs("div",{style:{padding:"0 0 0 4px",display:"flex",alignItems:"center",background:"var(--code-bg)",borderRadius:"8px",border:"1px solid var(--border)"},children:[t.jsx("button",{onClick:()=>i("size"),style:{padding:"4px 16px",background:r==="size"?"var(--accent)":"transparent",color:r==="size"?"white":"var(--fg)",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"var(--font-size-3)",fontWeight:500,transition:"all 0.2s"},children:"By Size"}),t.jsx("button",{onClick:()=>i("usage"),style:{padding:"0.5rem 1rem",background:r==="usage"?"var(--accent)":"transparent",color:r==="usage"?"white":"var(--fg)",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"var(--font-size-3)",fontWeight:500,transition:"all 0.2s"},children:"Usage"})]})]})}),t.jsx("div",{style:{},children:l.map((a,d)=>t.jsxs("div",{style:{maxWidth:"100%",overflow:"hidden",borderBottom:"1px solid var(--border)",padding:"12px 0 16px 0"},children:[t.jsxs("code",{style:{fontSize:"12px",whiteSpace:"nowrap",o
2pacity:.75,lineHeight:.5,display:"block",marginBottom:"8px"},children:[a.value," (",a.count,"x)"]}),t.jsx("p",{style:{fontSize:a.value,fontWeight:800,lineHeight:1,whiteSpace:"nowrap",margin:0},title:`${a.value} (used ${a.count}Ã)`,children:"Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz"})]},d))})]})}),t.jsx(Un,{data:e.fontWeights||[]}),t.jsx(Gn,{data:e.lineHeights||[]}),t.jsx(Kn,{data:e.letterSpacings||[]})]})}function Un({data:e}){const[r,i]=v.useState("value"),s=[...e].sort((n,o)=>{if(r==="value"){const l=parseFloat(n.value),a=parseFloat(o.value);return isNaN(l)&&isNaN(a)?0:isNaN(l)?1:isNaN(a)?-1:l-a}return o.count-n.count});return t.jsxs("article",{style:{marginTop:"32px",padding:"32px",borderRadius:"20px",background:"var(--bg)",boxShadow:"inset 0 0 0 1px var(--border)"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsxs("h3",{style:{fontSize:"1.5rem",fontWeight:600,margin:0},children:["Font Weights ",t.jsxs("span",{style:{fontFamily:"monospace",fontWeight:400,fontSize:"12px"},children:["(",e.length," unique)"]})]}),t.jsxs("div",{style:{display:"flex",gap:"0.25rem",padding:"0.25rem",background:"var(--code-bg)",borderRadius:"8px",border:"1px solid var(--border)"},children:[t.jsx("button",{onClick:()=>i("value"),style:{padding:"4px 16px",background:r==="value"?"var(--accent)":"transparent",color:r==="value"?"white":"var(--fg)",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:500,transition:"all 0.2s"},children:"Weight"}),t.jsx("button",{onClick:()=>i("usage"),style:{padding:"4px 16px",background:r==="usage"?"var(--accent)":"transparent",color:r==="usage"?"white":"var(--fg)",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:500,transition:"all 0.2s"},children:"Usage"})]})]}),t.jsx("div",{style:{display:"grid",gap:"0",overflowX:"auto",gridTemplateColumns:"repeat(1,1fr)"},children:s.map((n,o)=>t.jsxs("div",{"data-value":n.value,"data-count":n.count,className:"bottom-border",style:{fontSize:"12px",overflow:"hidden",padding:"4px 0"},children:[t.jsx("div",{style:{whiteSpace:"nowrap"},children:t.jsxs("div",{children:[t.jsx("code",{children:n.value})," (",n.count,")",n.resolved&&n.resolved!==n.value&&t.jsxs("span",{children:[" â ",n.resolved]})]})}),t.jsx("span",{style:{fontWeight:n.value,fontSize:"64px",display:"block",lineHeight:1.25},children:"Aa Bb Cc Dd Ee Ff Gg "})]},o))})]})}function Gn({data:e}){const[r,i]=v.useState("value"),s=[...e].sort((n,o)=>{if(r==="value"){const l=parseFloat(n.value),a=parseFloat(o.value);return isNaN(l)&&isNaN(a)?0:isNaN(l)?1:isNaN(a)?-1:l-a}return o.count-n.count});return t.jsx("article",{style:{marginTop:"32px",borderRadius:"20px",padding:"32px",background:"var(--bg)",boxShadow:"inset 0 0 0 1px var(--border)"},children:t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1.5rem"},children:[t.jsxs("h3",{style:{fontSize:"1.5rem",fontWeight:600,margin:0},children:["Line Heights ",t.jsxs("span",{style:{fontSize:"12px",fontWeight:400,fontFamily:"monospace"},children:["(",e.length," unique)"]})]}),t.jsxs("div",{style:{display:"flex",gap:"0.25rem",padding:"0.25rem",background:"var(--code-bg)",borderRadius:"8px",border:"1px solid var(--border)"},children:[t.jsx("button",{onClick:()=>i("value"),style:{padding:"4px 16px",background:r==="value"?"var(--accent)":"transparent",color:r==="value"?"white":"var(--fg)",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:500,transition:"all 0.2s"},children:"Value"}),t.jsx("button",{onClick:()=>i("usage"),style:{padding:"4px 16px",background:r==="usage"?"var(--accent)":"transparent",color:r==="usage"?"white":"var(--fg)",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:500,transition:"all 0.2s"},children:"Usage"})]})]}),t.jsx("div",{style:{background:"var(--bg)",display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:"32px"},children:s.map((n,o)=>t.jsxs("div",{"data-value":n.value,"data-count":n.count,children:[t.jsxs("div",{style:{marginBottom:"8px",color:"#777"},children:[t.jsx("code",{children:n.value})," - ",n.count,"Ã",n.resolved&&n.resolved!==n.value&&t.jsxs("span",{children:[" â ",n.resolved]})]}),t.jsxs("section",{children:[t.jsx("h2",{style:{marginBottom:".25em",lineHeight:n.value},children:"A two line title to showcase line height values and how they render"}),t.jsx("p",{style:{lineHeight:n.value},children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo."})]})]},o))})]})})}function Kn({data:e}){const[r,i]=v.useState("value"),s=[...e].sort((n,o)=>
2{if(r==="value"){const l=parseFloat(n.value),a=parseFloat(o.value);return isNaN(l)&&isNaN(a)?0:isNaN(l)?1:isNaN(a)?-1:l-a}return o.count-n.count});return t.jsxs("article",{style:{marginTop:"32px",padding:"32px",borderRadius:"20px",background:"var(--bg)",boxShadow:"inset 0 0 0 1px var(--border)"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1.5rem"},children:[t.jsxs("h3",{style:{fontSize:"1.5rem",fontWeight:600,margin:0},children:["Letter Spacing ",t.jsxs("span",{style:{fontSize:"var(--font-size-4)"},children:["(",e.length," unique)"]})]}),t.jsxs("div",{style:{display:"flex",gap:"0.5rem",padding:"0.25rem",background:"var(--code-bg)",borderRadius:"8px",border:"1px solid var(--border)"},children:[t.jsx("button",{onClick:()=>i("value"),style:{padding:"0.5rem 1rem",background:r==="value"?"var(--accent)":"transparent",color:r==="value"?"white":"var(--fg)",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"0.9rem",fontWeight:500,transition:"all 0.2s"},children:"Value"}),t.jsx("button",{onClick:()=>i("usage"),style:{padding:"0.5rem 1rem",background:r==="usage"?"var(--accent)":"transparent",color:r==="usage"?"white":"var(--fg)",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"0.9rem",fontWeight:500,transition:"all 0.2s"},children:"Usage"})]})]}),t.jsx("div",{style:{overflow:"hidden"},children:s.map((n,o)=>t.jsxs("div",{"data-value":n.value,"data-count":n.count,style:{padding:"8px 0"},className:"bottom-border",children:[t.jsx("code",{children:n.value})," - ",n.count,"Ã",n.resolved&&n.resolved!==n.value&&t.jsxs("span",{children:[" â ",n.resolved]}),t.jsxs("section",{style:{textTransform:"uppercase",marginTop:"8px"},children:[t.jsx("p",{style:{fontSize:"11px"},children:"The small label example"}),t.jsx("p",{style:{fontSize:"32px",lineHeight:1.2,fontWeight:900,whiteSpace:"nowrap"},children:"Some fantasticly ridiculous words for a larger title that should be tracked "})]})]},o))})]})}function Jn({data:e}){const[r,i]=v.useState(!1),[s,n]=v.useState(!1);if(!e||!e.byType)return t.jsx("div",{style:{padding:"2rem",textAlign:"center",opacity:.6},children:"No CSS variables defined."});const o=e.valueToVariables?Object.entries(e.valueToVariables).filter(([l,a])=>a.length>1).sort((l,a)=>a[1].length-l[1].length):[];return t.jsxs("div",{style:{display:"grid",gap:"2rem"},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"1rem"},children:[t.jsxs("div",{style:{padding:"1.5rem",border:"1px solid var(--border)",borderRadius:"8px",background:"var(--code-bg)"},children:[t.jsx("div",{style:{fontSize:"2.5rem",fontWeight:700,color:"var(--accent)"},children:e.defined}),t.jsx("div",{style:{opacity:.7,marginTop:"0.25rem"},children:"Variables Defined"})]}),t.jsxs("div",{style:{padding:"1.5rem",border:"1px solid var(--border)",borderRadius:"8px",background:"var(--code-bg)"},children:[t.jsx("div",{style:{fontSize:"2.5rem",fontWeight:700,color:"var(--accent)"},children:e.referenced}),t.jsx("div",{style:{opacity:.7,marginTop:"0.25rem"},children:"Variables Referenced"})]}),(e.redefined||0)>0&&t.jsxs("div",{style:{padding:"1.5rem",border:"1px solid var(--border)",borderRadius:"8px",background:"var(--code-bg)"},children:[t.jsx("div",{style:{fontSize:"2.5rem",fontWeight:700,color:"#f90"},children:e.redefined||0}),t.jsx("div",{style:{opacity:.7,marginTop:"0.25rem"},children:"Redefined Variables"})]}),o.length>0&&t.jsxs("div",{style:{padding:"1.5rem",border:"1px solid var(--border)",borderRadius:"8px",background:"var(--code-bg)"},children:[t.jsx("div",{style:{fontSize:"2.5rem",fontWeight:700,color:"#f90"},children:o.length}),t.jsx("div",{style:{marginTop:"4px"},children:"Duplicate Values"})]})]}),e.redefinitions&&e.redefinitions.length>0&&t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},children:[t.jsx("h3",{style:{fontSize:"1.25rem",fontWeight:600},children:"Redefined Variables"}),t.jsxs("button",{onClick:()=>n(!s),style:{padding:"0.5rem 1rem",fontSize:"0.85rem",background:"transparent",border:"1px solid var(--border)",borderRadius:"4px",cursor:"pointer"},children:[s?"Hide":"Show"," (",e.redefinitions?.length||0,")"]})]}),s&&t.jsx("div",{style:{display:"grid",gap:"1rem"},children:(e.redefinitions||[]).slice(0,20).map((l,a)=>t.jsxs("div",{style:{padding:"24px",border:"1px solid var(--border)",borderRadius:"12px",background:"var(--code-bg)"},children:[t.jsxs("code",{style:{fontWeight:700,display:"block",marginBottom:"16
2px"},children:[l.name," ",t.jsxs("span",{children:["(",l.count,")"]})]}),t.jsx("ul",{style:{fontSize:"var(--font-size-4)",display:"flex",flexWrap:"wrap",gap:"8px",listStyleType:"none"},children:l.values.map((d,c)=>t.jsx("li",{children:t.jsx("code",{style:{borderRadius:"6px",background:"var(--bg)",boxShadow:"inset 0 0 0 0px var(--border)",padding:"4px 8px",display:"inline-block",whiteSpace:"nowrap"},children:d})},c))})]},a))})]}),o.length>0&&t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"1rem"},children:[t.jsx("h3",{style:{fontSize:"1.25rem",fontWeight:600},children:"Duplicate Values"}),t.jsxs("button",{onClick:()=>i(!r),style:{padding:"0.5rem 1rem",fontSize:"0.85rem",background:"transparent",border:"1px solid var(--border)",borderRadius:"4px",cursor:"pointer"},children:[r?"Hide":"Show"," (",o.length,")"]})]}),r&&t.jsx("div",{style:{display:"grid",gap:"0.75rem"},children:o.slice(0,20).map(([l,a],d)=>t.jsxs("div",{style:{padding:"1rem",border:"1px solid var(--border)",borderRadius:"4px",background:"var(--code-bg)"},children:[t.jsx("div",{style:{fontFamily:"monospace",fontWeight:400,marginBottom:"0.5rem"},children:l}),t.jsxs("div",{style:{fontSize:"0.85rem",opacity:.7,marginBottom:"0.5rem"},children:["Used in ",a.length," variables:"]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",fontFamily:"monospace",fontSize:"0.85rem"},children:a.map((c,u)=>t.jsx("span",{style:{padding:"0.25rem 0.5rem",background:"var(--bg)",borderRadius:"4px",border:"1px solid var(--border)"},children:c},u))})]},d))})]}),Object.entries(e.byType).map(([l,a])=>a.length===0?null:t.jsxs("div",{children:[t.jsxs("h3",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"1rem",textTransform:"capitalize"},children:[l," (",a.length,")"]}),t.jsx("div",{style:{display:"grid",gap:"0.5rem"},children:a.map((d,c)=>t.jsxs("div",{style:{display:"grid",gridTemplateColumns:l==="colors"?"auto 1fr auto":"1fr auto",gap:"1rem",alignItems:"center",padding:"0.75rem",border:"1px solid var(--border)",borderRadius:"4px"},children:[l==="colors"&&t.jsx("div",{style:{width:"40px",height:"40px",background:d.value,border:"1px solid rgba(0,0,0,0.1)",borderRadius:"4px"}}),t.jsxs("div",{style:{fontFamily:"monospace",fontSize:"0.9rem"},children:[t.jsx("div",{style:{fontWeight:500,marginBottom:"0.25rem"},children:d.name}),t.jsx("div",{style:{opacity:.6,fontSize:"0.85rem"},children:d.value})]}),t.jsx("div",{style:{opacity:.5,fontSize:"0.85rem",whiteSpace:"nowrap"},children:d.count>0?`Ã${d.count}`:"unused"})]},c))})]},l))]})}function Qn({data:e}){const r=Math.max(...e.graph),i=e.graph.map((a,d)=>({score:d,count:a})).filter(a=>a.count>0),s=e.sourceOrder&&e.sourceOrder.length>0,n=s?Math.max(1,Math.floor(e.sourceOrder.length/200)):1,o=s?e.sourceOrder.filter((a,d)=>d%n===0):[],l=o.length>0?Math.max(...o.map(a=>a.score)):1;return t.jsx("div",{children:t.jsxs("div",{style:{display:"grid",gap:"2rem",gridTemplateColumns:"1fr 1fr 1fr"},children:[s&&t.jsxs("div",{children:[t.jsx("h3",{style:{fontSize:"var(--font-size-4)",fontWeight:400,fontFamily:"monospace",marginBottom:"8px"},children:"Source order"}),t.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"1px",height:"200px",padding:"1rem",border:"1px solid var(--border)",borderRadius:"12px",background:"var(--code-bg)"},children:o.map((a,d)=>{const c=l>0?a.score/l*100:0,[u,f,y]=a.specificity;return t.jsx("div",{style:{flex:1,height:`${c}%`,background:"var(--fg)",minHeight:c>0?"2px":"0",opacity:.8,transition:"opacity 0.2s"},title:`Position ${a.position}: ${u}-${f}-${y} (score: ${a.score})`},d)})})]}),t.jsxs("div",{children:[t.jsx("h3",{style:{fontSize:"var(--font-size-4)",fontWeight:400,fontFamily:"monospace",marginBottom:"8px"},children:"Score distribution"}),t.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"2px",height:"200px",padding:"1rem",border:"1px solid var(--border)",borderRadius:"12px",background:"var(--code-bg)"},children:i.map((a,d)=>{const c=r>0?a.count/r*100:0;return t.jsx("div",{style:{flex:1,height:`${c}%`,background:"var(--fg)",borderRadius:"2px 2px 0 0",minHeight:c>0?"2px":"0",opacity:.8,transition:"opacity 0.2s"},title:`Score ${a.score}: ${a.count} selectors`,onMouseEnter:u=>u.currentTarget.style.opacity="1",onMouseLeave:u=>u.currentTarget.style.opacity="0.8"},d)})}),t.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",justifyContent:"space-between",fontSize:"0.85rem",opacity:.6},children:[t.jsx("span",{children:"Low"}),t.jsx("span",{children:"High"})]})]}),t.jsxs("div",{children:[t.jsx("h3",{style:{fontSize:"var(--font-size-4)",fontWeight:400,fontFamily:"monospace",marginBottom:"1rem"}
2,children:"Highest Specificity Selectors"}),t.jsx("div",{children:[...e.values].sort((a,d)=>{const c=a.specificity[0]*100+a.specificity[1]*10+a.specificity[2];return d.specificity[0]*100+d.specificity[1]*10+d.specificity[2]-c}).slice(0,5).map((a,d)=>{const[c,u,f]=a.specificity,y=c*100+u*10+f;return t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",borderBottom:"1px solid var(--border)",fontFamily:"monospace"},children:[t.jsx("div",{style:{fontSize:"12px",fontWeight:900,minWidth:"60px",textAlign:"left",padding:"8px 0"},children:y}),t.jsx("div",{style:{paddingTop:"8px",display:"flex",fontSize:"0.75rem",whiteSpace:"nowrap",marginRight:"48px",display:"none"},children:t.jsxs("span",{title:"IDs",children:[c,"-",u,"-",f]})}),t.jsx("div",{style:{paddingTop:"8px",fontFamily:"monospace",fontSize:"10px",wordBreak:"break-all",textAlign:"left",whiteSpace:"nowrap",overflow:"hidden"},children:a.selector})]},d)})})]})]})})}function Xn({data:e}){let r=e.graph,i=!1;if(e.graph.length>500){const n=e.graph.map((o,l)=>({size:o,index:l}));n.sort((o,l)=>l.size-o.size),r=n.slice(0,500).sort((o,l)=>o.index-l.index).map(o=>o.size),i=!0}const s=Math.max(...r);return t.jsxs("div",{children:[t.jsxs("h3",{style:{fontSize:"var(--font-size-4)",fontWeight:400,fontFamily:"monospace",marginBottom:"8px"},children:["Ruleset sizes ",i?`(top 500 of ${e.graph.length.toLocaleString()})`:"(source order)"]}),t.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"1px",height:"200px",padding:"1rem",border:"1px solid var(--border)",borderRadius:"12px",background:"var(--code-bg)"},children:r.map((n,o)=>{const l=s>0?n/s*100:0;return t.jsx("div",{style:{flex:1,height:`${l}%`,background:"var(--fg)",minHeight:l>0?"2px":"0",opacity:.8,transition:"opacity 0.2s"},title:`${n} declarations`,onMouseEnter:a=>a.currentTarget.style.opacity="1",onMouseLeave:a=>a.currentTarget.style.opacity="0.8"},o)})}),t.jsx("div",{style:{marginTop:"0.5rem",display:"flex",justifyContent:"space-between",fontSize:"0.85rem",opacity:.6,fontFamily:"monospace"},children:t.jsxs("span",{children:["Max: ",e.max," ⢠Avg: ",e.average.toFixed(1)]})})]})}function Yn({title:e,values:r,type:i}){const s=r.slice(0,15);return t.jsxs("div",{children:[t.jsx("h3",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"1rem"},children:e}),t.jsx("div",{style:{display:"grid",gap:"1rem"},children:s.map((n,o)=>t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr auto",gap:"1rem",alignItems:"center",padding:"1rem",border:"1px solid var(--border)",borderRadius:"4px"},children:[t.jsxs("div",{style:{minWidth:"120px"},children:[i==="spacing"&&t.jsx("div",{style:{width:n.value,height:"20px",background:"var(--accent)",borderRadius:"2px"}}),i==="border-radius"&&t.jsx("div",{style:{width:"60px",height:"60px",background:"var(--accent)",borderRadius:n.value}}),i==="shadow"&&t.jsx("div",{style:{width:"60px",height:"60px",background:"var(--bg)",border:"1px solid var(--border)",boxShadow:n.value}}),i==="grid"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:n.value,gap:"4px",width:"100%",minHeight:"40px"},children:Array.from({length:Math.min(6,n.value.split(" ").length)}).map((l,a)=>t.jsx("div",{style:{background:"var(--accent)",opacity:.6,borderRadius:"2px"}},a))})]}),t.jsx("div",{style:{fontFamily:"monospace",fontSize:"0.9rem",wordBreak:"break-all"},children:n.value}),t.jsxs("div",{style:{opacity:.5,fontSize:"0.85rem",whiteSpace:"nowrap"},children:["Ã",n.count]})]},o))})]})}function Zn({data:e}){return!e||e.length===0?null:t.jsx("div",{style:{display:"grid",gap:"1.5rem",width:"100%",gridTemplateColumns:"repeat(4,1fr)"},children:e.map(r=>{const i=r.unique/r.total*100;return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",fontSize:"12px",lineHeight:1.25},children:[t.jsx("span",{style:{fontWeight:500,fontFamily:"monospace"},children:r.property}),t.jsxs("span",{style:{fontSize:"12px",opacity:.6,fontFamily:"monospace"},children:[r.total," / ",r.unique]})]}),t.jsx("div",{className:"bg-checker",style:{"--checker-size":"6px","--checker-color-1":"var(--border)","--checker-color-2":"var(--border)",position:"relative",height:"6px",borderRadius:"4px",width:"100%"},children:t.jsx("div",{style:{position:"absolute",top:"8px",left:0,height:"100%",width:`${i}%`,background:"var(--fg)",transition:"width 0.3s ease",borderRadius:"4px"}})})]},r.property)})})}function ei({values:e}){return!e||e.length===0?null:t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:"16px"},children:e.map((r,i)=>{const s=r.resolved||r.value,n=r.value.includes("var(");return t.jsxs("div",{style:{maxWidth:"100%",boxShadow:"inset 0 0 0 1px var(--border)",borderRadius:"20px",padding:"24px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:"0.5rem",flexWrap:"wrap",gap:"0.5rem"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem",flex:1},children:[t.jsx("code",{style:{fontSize:"0.875rem",fontFamily:"monospace",wordBreak:"break-all"},children:r.value}),n&&r.resolved&&r.resolved!==r.value&&t.jsxs("code",{style:{fontSize:"0.75rem",fontFamily:"monospace",opacity:.5,wordBreak:"break-all"},children:["â ",r.resolved]})]}),t.jsxs("span",{style:{fontSize:"0.75rem",opacity:.5,fontFamily:"monospace",whiteSpace:"nowrap"},children:["Ã",r.count]})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:s,gap:"4px",padding:"16px",background:"var(--bg-offset)",minHeight:"60px",maxWidth:"100%",maxHeight:"200px",overflow:"auto",boxShadow:"inset 0 0 0 1px var(--border)",borderRadius:"12px"},children:Array.from({length:24},(o,l)=>t.jsx("div",{style:{background:"var(--fg)",borderRadius:"6px",fontFamily:"monospace",color:"var(--fg)",overflow:"hidden",maxWidth:"100%",display:"inline-flex",alignItems:"center"},children:t.jsx("span",{style:{fontSize:"12px",padding:"4px 8px",color:"var(--bg)"},children:l+1})},l))})]},i)})})}function ti({percentage:e,size:r=80,strokeWidth:i=8}){const s=(r-i)/2,n=2*Math.PI*s,o=n-e/100*n,l=-(e/100)*n,a=r/2;return t.jsxs("svg",{width:r,height:r,style:{transform:"rotate(-90deg)"},children:[t.jsx("circle",{cx:a,cy:a,r:s,fill:"none",stroke:"#dfdfe0",strokeWidth:i,strokeDasharray:n,strokeDashoffset:o,style:{transition:"stroke-dashoffset 0.5s ease"}}),t.jsx("circle",{cx:a,cy:a,r:s,fill:"none",stroke:"#333339",strokeWidth:i,strokeDasharray:`${(100-e)/100*n} ${n}`,strokeDashoffset:l,opacity:1})]})}function se(e){const r=[];r.push("/**"),r.push(" * Design Tokens"),r.push(` * Extracted from: ${e.meta.domain||"CSS"}
2`),r.push(` * Generated: ${new Date().toLocaleString()}`),r.push(" * "),r.push(" * CSS Stats - cssstats.com"),r.push(" */"),r.push(""),r.push(":root {"),r.push(" /* ============================================ */"),r.push(" /* COLORS */"),r.push(" /* ============================================ */"),r.push(""),e.colors?.values?.length>0&&e.colors.values.sort((o,l)=>l.count-o.count).slice(0,50).forEach((o,l)=>{const a=ri(o.raw,l);r.push(` --color-${a}: ${o.raw}; /* used ${o.count}Ã */`)}),r.push(""),r.push(" /* ============================================ */"),r.push(" /* TYPOGRAPHY */"),r.push(" /* ============================================ */"),r.push(""),e.typography?.fontFamilies?.length>0&&(e.typography.fontFamilies.sort((n,o)=>o.count-n.count).slice(0,10).forEach((n,o)=>{const l=ni(n.value,o);r.push(` --font-${l}: ${n.value}; /* used ${n.count}Ã */`)}),r.push("")),e.typography?.fontSizes?.length>0&&(e.typography.fontSizes.filter(o=>!o.value.includes("clamp")&&!o.value.includes("calc")).sort((o,l)=>{const a=parseFloat(o.value),d=parseFloat(l.value);return a-d}).slice(0,20).forEach((o,l)=>{r.push(` --font-size-${l+1}: ${o.value}; /* used ${o.count}Ã */`)}),r.push("")),e.typography?.fontWeights?.length>0&&(e.typography.fontWeights.sort((n,o)=>parseInt(n.value)-parseInt(o.value)).forEach(n=>{const o=ii(n.value);r.push(` --font-weight-${o}: ${n.value}; /* used ${n.count}Ã */`)}),r.push("")),e.typography?.lineHeights?.length>0&&(e.typography.lineHeights.sort((n,o)=>parseFloat(n.value)-parseFloat(o.value)).slice(0,10).forEach((n,o)=>{r.push(` --line-height-${o+1}: ${n.value}; /* used ${n.count}Ã */`)}),r.push("")),e.typography?.letterSpacings?.length>0&&(e.typography.letterSpacings.sort((n,o)=>parseFloat(n.value)-parseFloat(o.value)).slice(0,10).forEach((n,o)=>{r.push(` --letter-spacing-${o+1}: ${n.value}; /* used ${n.count}Ã */`)}),r.push("")),r.push(" /* ============================================ */"),r.push(" /* SPACING */"),r.push(" /* ============================================ */"),r.push("");const i=new Map;return[...e.spacing?.padding||[],...e.spacing?.margin||[],...e.spacing?.gap||[]].forEach(n=>{n.value&&!n.value.includes("calc")&&!n.value.includes("clamp")&&i.set(n.value,(i.get(n.value)||0)+n.count)}),Array.from(i.entries()).sort((n,o)=>parseFloat(n[0])-parseFloat(o[0])).slice(0,20).forEach(([n,o],l)=>{r.push(` --spacing-${l}: ${n}; /* used ${o}Ã */`)}),r.push(""),r.push(" /* ============================================ */"),r.push(" /* BORDERS */"),r.push(" /* ============================================ */"),r.push(""),e.borders?.borderRadius?.length>0&&(e.borders.borderRadius.sort((n,o)=>parseFloat(n.value)-parseFloat(o.value)).slice(0,10).forEach((n,o)=>{r.push(` --radius-${o}: ${n.value}; /* used ${n.count}Ã */`)}),r.push("")),e.borders?.borderWidth?.length>0&&(e.borders.borderWidth.sort((n,o)=>parseFloat(n.value)-parseFloat(o.value)).slice(0,10).forEach((n,o)=>{r.push(` --border-width-${o}: ${n.value}; /* used ${n.count}Ã */`)}),r.push("")),r.push(" /* ============================================ */"),r.push(" /* SHADOWS */"),r.push(" /* ============================================ */"),r.push(""),e.shadows?.boxShadow?.length>0&&(e.shadows.boxShadow.sort((n,o)=>o.count-n.count).slice(0,10).forEach((n,o)=>{r.push(` --shadow-${o+1}: ${n.value}; /* used ${n.count}Ã */`)}),r.push("")),r.push("}"),r.push(""),r.join(` 3`)}function ri(e,r){const i=e.toLowerCase().replace(/\s+/g,"");if(!i.includes("#")&&!i.includes("rgb")&&!i.includes("hsl"))return i;const n={"#000":"black","#000000":"black","#fff":"white","#ffffff":"white","#f00":"red","#ff0000":"red","#0f0":"green","#00ff00":"green","#00f":"blue","#0000ff":"blue","#ff0":"yellow","#ffff00":"yellow","#0ff":"cyan","#00ffff":"cyan","#f0f":"magenta","#ff00ff":"magenta","#808080":"gray","#888":"gray","#ccc":"light-gray","#333":"dark-gray"}[i];return n||`${r+1}`}function ni(e,r){const i=e.split(",")[0].trim().replace(/['"]/g,"").toLowerCase(),n={arial:"sans",helvetica:"sans","system-ui":"system","-apple-system":"system","segoe ui":"system",georgia:"serif",times:"serif","times new roman":"serif",courier:"mono","courier new":"mono",monaco:"mono",consolas:"mono",menlo:"mono"}[i];return n||i.replace(/[^a-z0-9]/g,"-")||`family-${r+1}`}function ii(e){return{100:"thin",200:"extra-light",300:"light",400:"normal",500:"medium",600:"semibold",700:"bold",800:"extra-bold",900:"black",normal:"normal",bold:"bold",bolder:"bolder",lighter:"lighter"}[e]||e}function si(e,r,i="text/plain"){const s=new Blob([e],{type:i}),n=URL.createObjectURL(s),o=document.createElement("a");o.href=n,o.download=r,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(n)}async function oi(e){try{return await navigator.clipboard.writeText(e),!0}catch(r){return console.error("Failed to copy to clipboard:",r),!1}}function ai({stats:e}){const[r,i]=v.useState(null),[s,n]=v.useState(!0);v.useEffect(()=>{o()},[e]);const o=async()=>{n(!0);const u=[];
3Object.entries(e.properties).forEach(([S,k])=>{k.values.forEach(R=>{u.push({property:S,value:R.value})})});const f=Object.keys(e.media?.queries||{});let y="";u.forEach((S,k)=>{y+=`.d${k}{${S.property}:${S.value}}`});let j="";u.forEach((S,k)=>{j+=`.d${k}{${S.property}:${S.value}}`,f.forEach((R,T)=>{j+=`@media ${R}{.d${k}-m${T}{${S.property}:${S.value}}}`})});let g="";const x=["(min-width:640px)","(min-width:768px)","(min-width:1024px)"];u.forEach((S,k)=>{g+=`.d${k}{${S.property}:${S.value}}`,x.forEach((R,T)=>{g+=`@media ${R}{.d${k}-${["s","m","l"][T]}{${S.property}:${S.value}}}`})});const C={scenario1:{minified:y.length,gzipped:await l(y),css:y},scenario2:{minified:j.length,gzipped:await l(j),css:j},scenario3:{minified:g.length,gzipped:await l(g),css:g}};i(C),n(!1)},l=async u=>{try{const j=new Blob([u]).stream().pipeThrough(new CompressionStream("gzip"));return(await new Response(j).blob()).size}catch{return Math.floor(u.length*.25)}};if(s||!r)return t.jsx("div",{style:{padding:"2rem",borderRadius:"8px",marginTop:"2rem"},children:t.jsx("p",{style:{opacity:.7},children:"Calculating minimal CSS sizes..."})});const a=e.meta.minifiedGzipBytes||e.meta.gzipBytes||0,d=Object.values(e.properties).reduce((u,f)=>u+f.values.length,0),c=Object.keys(e.media?.queries||{}).length;return t.jsxs("div",{style:{marginTop:"12px"},children:[d>1&&t.jsxs("p",{style:{fontSize:"var(--font-size-4)",marginBottom:"1.5rem",lineHeight:1.6},children:[t.jsx("b",{children:"Potential file sizes"})," if all ",d.toLocaleString()," unique declarations were extracted into atomic classes and namespaced to 0, 4, or ",c," media queries"]}),d<2&&t.jsxs("p",{style:{fontSize:"var(--font-size-4)",marginBottom:"1.5rem",lineHeight:1.6},children:[t.jsx("b",{children:"Potential file sizes"})," if ",d.toLocaleString()," unique declaration is extracted into atomic classes and namespaced across 0, 4, or ",c," media queries"]}),t.jsxs("div",{style:{display:"grid",gap:"1.5rem",gridTemplateColumns:"repeat(auto-fit, minmax(192px, 1fr))"},children:[t.jsxs("div",{style:{padding:"1.5rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",borderRadius:"12px"},children:[t.jsx("h4",{style:{fontWeight:600,marginBottom:"0.25rem",fontSize:"11px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.1em"},children:"Atomic"}),t.jsx("p",{style:{display:"none",fontSize:"12px",marginTop:0,marginBottom:".5rem",lineHeight:1.5},children:"One class per unique declaration (no media queries)"}),t.jsx("div",{children:t.jsxs("div",{style:{fontSize:"32px",fontWeight:700,lineHeight:1},children:[w(r.scenario1.gzipped).value,t.jsx("span",{style:{fontSize:"var(--font-size-4)",marginLeft:"0.25rem"},children:w(r.scenario1.gzipped).unit})]})}),a>0&&t.jsx("div",{style:{marginTop:"8px",fontSize:"var(--font-size-4)"},children:r.scenario1.gzipped<a?t.jsx(t.Fragment,{children:t.jsxs("div",{style:{alignItems:"center",display:"inline-flex",gap:"6px",padding:"2px 6px",fontSize:"12px",marginTop:"4px",background:"palegreen",color:"darkgreen",borderRadius:"6px"},children:["-",w(a-r.scenario1.gzipped).value,w(a-r.scenario1.gzipped).unit," ",t.jsxs("span",{children:[" (",Math.round((1-r.scenario1.gzipped/a)*100),"%)"]})]})}):t.jsx(t.Fragment,{children:t.jsx("div",{style:{fontSize:"11px",backgroundColor:"palered",color:"darkred",borderRadius:"6px",padding:"2px 6px"},children:t.jsxs("div",{style:{opacity:.7,fontSize:"12px",marginTop:"4px"},children:["+",w(r.scenario1.gzipped-a).value,w(r.scenario1.gzipped-a).unit,t.jsxs("span",{children:["(",Math.round((r.scenario1.gzipped/a-1)*100),"%)"]})]})})})})]}),t.jsxs("div",{style:{padding:"1.5rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",borderRadius:"8px"},children:[t.jsx("h4",{style:{fontWeight:600,marginBottom:"0.25rem",fontSize:"11px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.1em"},children:"Atomic à 4"}),t.jsx("p",{style:{fontSize:"12px",marginBottom:"1rem",lineHeight:1.5,display:"none"},children:"Each declaration à 4 variants (global, sm, md, and lg media queries)"}),t.jsx("div",{children:t.jsxs("div",{style:{fontSize:"2rem",fontWeight:700,lineHeight:1},children:[w(r.scenario3.gzipped).value,t.jsx("span",{style:{fontSize:"var(--font-size-4)",marginLeft:"0.25rem"}
3,children:w(r.scenario3.gzipped).unit})]})}),a>0&&t.jsx("div",{style:{marginTop:"8px",fontSize:"var(--font-size-4)"},children:r.scenario3.gzipped<a?t.jsxs("div",{style:{fontSize:"12px",color:"darkgreen",backgroundColor:"palegreen",borderRadius:"6px",padding:"2px 6px",display:"inline-flex",gap:"6px"},children:["-",w(a-r.scenario3.gzipped).value,w(a-r.scenario3.gzipped).unit,t.jsxs("span",{children:[" (",Math.round((1-r.scenario3.gzipped/a)*100),"%)"]})]}):t.jsx(t.Fragment,{children:t.jsxs("div",{style:{fontSize:"12px",backgroundColor:"mistyRose",color:"darkred",display:"inline-flex",borderRadius:"6px",padding:"2px 6px",alignItems:"center",gap:"6px"},children:["+",w(r.scenario3.gzipped-a).value,w(r.scenario3.gzipped-a).unit,t.jsxs("span",{children:[" (",Math.round((r.scenario3.gzipped/a-1)*100),"%)"]})]})})})]}),t.jsxs("div",{style:{padding:"1.5rem",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",borderRadius:"8px"},children:[t.jsxs("h4",{style:{fontWeight:600,marginBottom:"0.25rem",fontSize:"11px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.1em"},children:["Atomic à ",c]}),t.jsxs("p",{style:{fontSize:"12px",marginBottom:"1rem",lineHeight:1.5,display:"none"},children:["Atomic classes namespaced across ",t.jsx("b",{children:c})," media queries"]}),t.jsx("div",{children:t.jsxs("div",{style:{fontSize:"2rem",fontWeight:700,lineHeight:1},children:[w(r.scenario2.gzipped).value,t.jsx("span",{style:{fontSize:"var(--font-size-4)",marginLeft:"0.25rem"},children:w(r.scenario2.gzipped).unit})]})}),a>0&&t.jsx("div",{style:{marginTop:"8px",fontSize:"var(--font-size-4)"},children:r.scenario2.gzipped<a?t.jsx(t.Fragment,{children:t.jsxs("div",{style:{display:"inline-flex",background:"palegreen",color:"darkgreen",fontSize:"12px",gap:"6px",borderRadius:"6px",padding:"2px 6px"},children:["-",w(a-r.scenario2.gzipped).value,w(a-r.scenario2.gzipped).unit,t.jsxs("span",{children:[" (",Math.round((1-r.scenario2.gzipped/a)*100),"%) "]})]})}):t.jsx(t.Fragment,{children:t.jsxs("div",{style:{display:"inline-flex",fontSize:"12px",gap:"6px",backgroundColor:"mistyrose",color:"darkred",padding:"2px 6px",borderRadius:"6px"},children:["+",w(r.scenario2.gzipped-a).value,w(r.scenario2.gzipped-a).unit,t.jsxs("span",{children:["(",Math.round((r.scenario2.gzipped/a-1)*100),"%)"]})]})})})]})]})]})}const F="https://api.cssstats.com";function ue(e){const r=new Set;for(const{value:i}of e){const s=i.split(/\s+/);s.length===1?r.add(s[0]):s.length===2?(r.add(s[0]),r.add(s[1])):s.length===3?(r.add(s[0]),r.add(s[1]),r.add(s[2])):s.length===4&&(r.add(s[0]),r.add(s[1]),r.add(s[2]),r.add(s[3]))}return Array.from(r)}function li(e){const r=ue(e.padding),i=ue(e.margin),s=ue(e.gap),n=Array.from(new Set([...r,...i,...s]));return{paddingValues:r,marginValues:i,gapValues:s,allValues:n}}function Be({currentSize:e,averageSize:r,medianSize:i}){if(!r||r<=0)return null;const s=e-r,n=s/r*100;let o;s<0?o=`${Math.abs(n).toFixed(1)}% smaller than average (${w(Math.abs(s)).value}${w(Math.abs(s)).unit} less)`:s>0?o=`${w(Math.abs(s)).value}${w(Math.abs(s)).unit} (${Math.abs(n).toFixed(1)}%) larger than average`:o="exactly average size";let l="";if(i&&i>0){const a=e-i,d=a/i*100;a<0?l=` and ${Math.abs(d).toFixed(1)}% smaller than median (${w(Math.abs(a)).value}${w(Math.abs(a)).unit} less)`:a>0?l=` and ${w(Math.abs(a)).value}${w(Math.abs(a)).unit} (${Math.abs(d).toFixed(1)}%) larger than median`:l=" and exactly median size"}return t.jsx("div",{style:{fontSize:"var(--font-size-3)",lineHeight:1.4},children:t.jsxs("div",{children:["This CSS is ",o,l]})})}function di({currentSize:e,averageSize:r,medianSize:i,currentLabel:s="This site",averageLabel:n="Platform average",medianLabel:o="Platform median"}){if(!r||r<=0)return null;const l=e-r;let a;l<0?a="smaller":l>0?a="larger":a="equal";const d=[e,r];i&&i>0&&d.push(i);const c=Math.max(...d),u=e/c*100,f=r/c*100,y=i&&i>0?i/c*100:0,j=w(e),g=w(r),x=i?w(i):null;return t.jsxs("div",{children:[t.jsx("div",{style:{marginBottom:"8px"},children:t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"}
3,children:[t.jsx("div",{style:{fontSize:"11px",opacity:.7,whiteSpace:"nowrap",width:"7ch"},children:s}),t.jsx("div",{style:{width:"100%",height:"20px",backgroundColor:"var(--code-bg)",borderRadius:"4px",overflow:"hidden"},children:t.jsxs("div",{style:{width:`${u}%`,height:"100%",backgroundColor:a==="smaller"?"palegreen":a==="larger"?"mistyrose":"lightgray",display:"flex",alignItems:"center",paddingLeft:"8px",borderRadius:"4px",fontSize:"11px",fontWeight:600,color:a==="smaller"?"darkgreen":a==="larger"?"darkred":"gray"},children:[j.value,j.unit]})})]})}),t.jsx("div",{style:{marginBottom:"8px"},children:t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx("div",{style:{fontSize:"11px",opacity:.7,width:"7ch",whiteSpace:"nowrap"},children:n}),t.jsx("div",{style:{width:"100%",height:"20px",backgroundColor:"var(--code-bg)",borderRadius:"4px",overflow:"hidden"},children:t.jsxs("div",{style:{width:`${f}%`,height:"100%",backgroundColor:"var(--border)",display:"flex",alignItems:"center",paddingLeft:"8px",fontSize:"11px",fontWeight:600,color:"var(--text)",borderRadius:"4px"},children:[g.value,g.unit]})})]})}),i&&i>0&&x&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx("div",{style:{fontSize:"11px",opacity:.7,width:"7ch",whiteSpace:"nowrap"},children:o}),t.jsx("div",{style:{width:"100%",height:"20px",backgroundColor:"var(--code-bg)",borderRadius:"4px",overflow:"hidden"},children:t.jsxs("div",{style:{width:`${y}%`,height:"100%",backgroundColor:"var(--border)",color:"var(--text)",display:"flex",alignItems:"center",paddingLeft:"8px",fontSize:"11px",fontWeight:600,borderRadius:"4px"},children:[x.value,x.unit]})})]})]})}function fi({snapshotId:e}){const[r,i]=v.useState(null),[s,n]=v.useState(!0),[o,l]=v.useState(null),[a,d]=v.useState(0),[c,u]=v.useState([]),[f,y]=v.useState(null),[j,g]=v.useState(null),[x,C]=v.useState(""),[S,k]=v.useState(new Set([e])),[R,T]=v.useState(!1),[A,I]=v.useState(!1),[G,O]=v.useState(!1),[J,Y]=v.useState(""),[D,Z]=v.useState(""),[_,ee]=v.useState("history"),[te,Je]=v.useState(!1),[me,ye]=v.useState(""),[N,le]=v.useState(["","",""]),[V,re]=v.useState(!1);v.useEffect(()=>{c.length<=1&&_==="history"&&ee("url")},[c,_]),v.useEffect(()=>{if(!r)return;const p=r.meta?.domain||"CSS Stats",h=`${F}/v1/og/${e}.png`,m=`${window.location.origin}/stats/${e}`,b=w(r.meta?.bytes||0),z=`CSS Stats for ${p}: ${b.value} ${b.unit}, ${r.rules.total.toLocaleString()} rules, ${r.colors.unique} colors`,$=(H,U)=>{let B=document.querySelector(`meta[property="${H}"]`);B||(B=document.createElement("meta"),B.setAttribute("property",H),document.head.appendChild(B)),B.content=U},L=(H,U)=>{let B=document.querySelector(`meta[name="${H}"]`);B||(B=document.createElement("meta"),B.setAttribute("name",H),document.head.appendChild(B)),B.content=U};return document.title=`${p} - CSS Stats`,$("og:title",`${p} - CSS Stats`),$("og:description",z),$("og:image",h),$("og:url",m),$("og:type","website"),L("twitter:card","summary_large_image"),L("twitter:title",`${p} - CSS Stats`),L("twitter:description",z),L("twitter:image",h),()=>{document.title="CSS Stats"}},[r,e]),v.useEffect(()=>{n(!0),l(null),d(0);const p=async(m=0)=>{try{const b=await fetch(`${F}/v1/stats/${e}`);if(!b.ok){if(b.status===404&&m<10){d(m+1);const L=2e3+m*1e3;setTimeout(()=>p(m+1),L);return}throw new Error(`Failed to load: ${b.status}`)}const z=await b.json();i(z),n(!1),z.meta?.domain&&Qe(z.meta.domain);const $=window.location.hash.slice(1);$&&setTimeout(()=>M($),100)}catch(b){l(b.message),n(!1)}};p(),(async()=>{try{const m=sessionStorage.getItem("platformAverages"),b=sessionStorage.getItem("platformAveragesTime");if(m&&b&&Date.now()-parseInt(b)<36e5){g(JSON.parse(m));return}const z=await fetch(`${F}/v1/stats/averages`);if(z.ok){const $=await z.json();g($),sessionStorage.setItem("platformAverages",JSON.stringify($)),sessionStorage.setItem("platformAveragesTime",Date.now().toString())}}catch(m){console.error("Failed to fetch platform averages:",m)}})()},[e]);const Qe=async p=>{try{const h=await fetch(`${F}/v1/sites/by-url?url=https://${p}`);
3if(h.ok){const m=await h.json();y(m.id);const b=await fetch(`${F}/v1/sites/${m.id}/snapshots`);if(b.ok){const z=await b.json();u(z.snapshots||[])}}}catch(h){console.error("Failed to fetch snapshots:",h)}},de=j?.averages?.minifiedGzipSize||0,ce=j?.medians?.minifiedGzipSize||0;j?.averages?.rules,j?.averages?.selectors,j?.averages?.declarations,j?.averages?.colors;const Xe=()=>{if(!c||c.length<=1)return null;const p=c.findIndex($=>$.id===e);if(p===-1||p===c.length-1)return null;const h=c[p],m=c[p+1];if(!h?.minified_gzip_size||!m?.minified_gzip_size)return null;const b=h.minified_gzip_size-m.minified_gzip_size,z=b/m.minified_gzip_size*100;return{delta:b,percentChange:z,isSmaller:b<0}},Ye=async()=>{T(!1);try{if(_==="history"&&x){console.log("[Compare] Starting history comparison:",e,x);const p=`/compare?ids=${e},${x}`;console.log("[Compare] Navigating to:",p),window.history.pushState({},"",p),window.dispatchEvent(new PopStateEvent("popstate"))}else if(_==="url"){const p=N.filter(h=>h.trim().length>0);if(p.length===1){const h=p[0].trim().match(/^https?:\/\//i)?p[0].trim():`https://${p[0].trim()}`;console.log("[Compare] Ingesting URL:",h);const b=await(await fetch(`${F}/v1/ingest`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:h,render:!1,force:!0})})).json();if(console.log("[Compare] Ingest response:",b),b.snapshotId){const z=`/compare?ids=${e},${b.snapshotId}`;console.log("[Compare] Navigating to:",z),window.history.pushState({},"",z),window.dispatchEvent(new PopStateEvent("popstate"))}else alert("Failed to analyze URL")}else if(p.length>=2){ye(`Processing ${p.length} URLs...`);const h=[e];for(let m=0;m<p.length;m++){const b=p[m];ye(`Analyzing ${m+1}/${p.length}: ${b.substring(0,50)}...`);const z=b.trim().match(/^https?:\/\//i)?b.trim():`https://${b.trim()}`;try{const L=await(await fetch(`${F}/v1/ingest`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:z,render:!1,force:!0})})).json();if(!L.snapshotId){console.warn(`Failed to ingest ${z}`);continue}let H=!1;for(let U=0;U<10;U++)if(await new Promise(Ze=>setTimeout(Ze,2e3+U*1e3)),(await fetch(`${F}/v1/stats/${L.snapshotId}`)).ok){h.push(L.snapshotId),H=!0;break}H||console.warn(`Stats not ready for ${z}`)}catch($){console.error(`Error processing ${z}:`,$)}}if(h.length>=2){const m=h.join(",");window.history.pushState({},"",`/compare?ids=${m}`),window.dispatchEvent(new PopStateEvent("popstate"))}else alert("Failed to analyze enough URLs for comparison")}}else if(_==="css"&&D){const h=await(await fetch(`${F}/v1/analyze-css`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({css:D})})).json();h.snapshotId&&(window.history.pushState({},"",`/compare?ids=${e},${h.snapshotId}`),window.dispatchEvent(new PopStateEvent("popstate")))}}catch(p){console.error("Failed to start comparison:",p),alert("Failed to prepare comparison")}finally{Je(!1)}},W={appearance:"none",padding:"6px 12px",fontSize:"12px",fontWeight:500,color:"var(--fg)",textDecoration:"none",borderRadius:"6px",whiteSpace:"nowrap",transition:"all 0.2s ease",border:"1px solid var(--border)",background:"var(--bg)",cursor:"pointer"},M=p=>{const h=document.getElementById(p);h&&(h.scrollIntoView({behavior:"smooth",block:"start"}),window.history.replaceState(null,"",`${window.location.pathname}#${p}`))};return s?t.jsx(rt,{message:a>0?`Processing... (${a}/10)`:"Loading CSS Stats",submessage:a>0?"Queue is analyzing the CSS, should be ready soon":void 0}):o||!r?t.jsxs("div",{style:{padding:"4rem 2rem",textAlign:"center"},children:[t.jsx("p",{style:{fontSize:"1.2rem",color:"#f44"},children:o||"Stats not found"}),t.jsx("p",{style:{marginTop:"1rem",opacity:.6},children:"The analysis might still be processing. Try refreshing in a few seconds."}),t.jsx("button",{onClick:()=>window.location.reload(),style:{marginTop:"1rem"},children:"Refresh"})]}):t.jsxs("div",{style:{backgroundImage:"linear-gradient(var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%)",backgroundSize:"100dvh 100dvw",backgroundAttachment:"fixed"},children:[t.jsx("nav",{style:{position:"sticky",top:0,zIndex:100,padding:"8px 16px",backdropFilter:"blur(10px)",backgroundColor:"var(--bg-alpha)",borderBottom:"1px solid var(--border)"},children:t.jsxs("div",{style:{display:"flex",gap:"0.5rem",overflowX:"auto",scrollbarWidth:"thin"},children:[t.jsx("button",{onClick:()=>M("overview"),style:W,children:"Overview"}),r.specificity&&t.jsx("button",{onClick:()=>M("specificity"),style:W,children:"Specificity"}),r.colors.unique>0&&t.jsx("button",{onClick:()=>M("colors"),style:W,children:"Colors"}),r.gradients.values.length>0&&t.jsx("button",{onClick:()=>M("gradients"),style:W,children:"Gradients"}),r.typography&&t.jsx("button",{onClick:()=>M("typography"),style:W,children:"Typography"}),(r.spacing.padding.length>0||r.spacing.margin.length>0||r.spacing.gap?.length>0)&&t.jsx("button",{onClick:()=>M("spacing"),style:W,children:"Spacing"}),r.shadows.boxShadow.length>0&&t.jsx("button",{onClick:()=>M("shadows"),style:W,children:"Shadows"}),r.borders.borderRadius.length>0&&t.jsx("button",{onClick:()=>M("borders"),style:W,children:"Borders"}),r.grids.gridTemplateColumns.length>0&&t.jsx("button",{onClick:()=>M("grids"),style:W,children:"Grids"}),r.variables.defined>0&&t.jsx("button",{onClick:()=>M("variables"),style:W,children:"Variables"}),r.backgroundImages.values.length>0&&t.jsx("button",{onClick:()=>
3M("background-images"),style:W,children:"Backgrounds"}),t.jsx("a",{href:`/stats/${e}/properties`,onClick:p=>{p.preventDefault(),window.history.pushState({},"",`/stats/${e}/properties`),window.dispatchEvent(new PopStateEvent("popstate"))},style:W,children:"Properties"}),t.jsx("a",{href:`/stats/${e}/selectors`,onClick:p=>{p.preventDefault(),window.history.pushState({},"",`/stats/${e}/selectors`),window.dispatchEvent(new PopStateEvent("popstate"))},style:W,children:"Selectors"}),t.jsx("a",{href:`/stats/${e}/declarations`,onClick:p=>{p.preventDefault(),window.history.pushState({},"",`/stats/${e}/declarations`),window.dispatchEvent(new PopStateEvent("popstate"))},style:W,children:"Declarations"}),t.jsx("a",{href:`${F}/v1/stats/${e}`,target:"_blank",rel:"noopener noreferrer",style:{fontSize:"10px",fontWeight:600,color:"var(--accent)",textDecoration:"none",padding:"8px 16px",background:"var(--bg)",color:"var(--fg)",borderRadius:"6px",marginLeft:"auto",marginRight:"8px",boxShadow:"inset 0 0 0 1px var(--border)",whiteSpace:"nowrap"},children:"JSON â"}),t.jsx("a",{href:`https://api.cssstats.com/v1/css/${e}`,target:"_blank",rel:"noopener noreferrer",style:{fontSize:"10px",fontWeight:600,color:"var(--accent)",textDecoration:"none",padding:"8px 16px",background:"var(--bg)",color:"var(--fg)",borderRadius:"6px",marginRight:"8px",boxShadow:"inset 0 0 0 1px var(--border)",whiteSpace:"nowrap"},children:"CSS â"}),t.jsx("button",{onClick:()=>T(!0),style:{width:"auto",fontSize:"12px",fontWeight:600,color:"var(--bg)",background:"var(--fg)",border:"none",borderRadius:"8px",cursor:"pointer",marginRight:"12px",padding:"4px 16px",boxShadow:"inset 0 0 0 3px var(--bg)"},children:"Compare"})]})}),t.jsxs("div",{style:{padding:"32px 32px"},children:[t.jsxs("section",{style:{marginBottom:"2rem"},children:[t.jsxs("div",{style:{flex:1,width:"100%"},children:[t.jsx("div",{style:{display:"flex"},children:(()=>{const p=c.filter((h,m)=>m===0?!0:h.css_hash!==c[m-1].css_hash);return p.length>1&&t.jsx("div",{style:{display:"flex",gap:"1.5rem",fontFamily:"monospace",flexWrap:"none",width:"100%",overflowX:"auto"},children:p.map(h=>t.jsx("a",{href:`/stats/${h.id}`,onClick:m=>{m.preventDefault(),window.history.pushState({},"",`/stats/${h.id}`),window.dispatchEvent(new PopStateEvent("popstate"))},style:{fontSize:"12px",textDecoration:"none",color:h.id===e?"var(--fg)":"inherit",fontWeight:h.id===e?600:400,opacity:h.id===e?1:.6,whiteSpace:"nowrap"},children:new Date(h.ts).toLocaleString()},h.id))})})()}),t.jsx("h1",{style:{whiteSpace:"nowrap",overflowX:"auto",fontSize:"64px",fontWeight:900,margin:0,lineHeight:1.15},children:(()=>{if(r.meta.url)try{const p=new URL(r.meta.url);return p.hostname+(p.pathname!=="/"?p.pathname:"")}catch{return r.meta.url}return r.meta.domain||"CSS Stats"})()})]}),t.jsx("article",{style:{display:"flex",gap:"1rem",alignItems:"center"}})]}),t.jsxs("section",{style:{display:"none"},id:"actions",children:[t.jsx("button",{onClick:()=>T(!0),style:{display:"flex",alignItems:"center",gap:"8px",padding:"0.75rem 1.5rem",fontSize:"1rem",fontWeight:600,background:"var(--accent)",color:"white",border:"none",borderRadius:"8px",cursor:"pointer",whiteSpace:"nowrap"},children:"Compare"}),t.jsx("button",{onClick:()=>I(!0),style:{padding:"0.75rem 1.5rem",fontSize:"1rem",fontWeight:600,background:"var(--fg)",color:"var(--bg)",border:"none",borderRadius:"8px",cursor:"pointer",whiteSpace:"nowrap"},children:"Export"}),t.jsx("button",{onClick:()=>O(!0),style:{padding:"0.75rem 1.5rem",fontSize:"1rem",fontWeight:600,background:"linear-gradient(135deg, #667eea, #764ba2)",color:"white",border:"none",borderRadius:"8px",cursor:"pointer",whiteSpace:"nowrap"},children:"Share"})]}),r.colors.values.length>0&&t.jsxs("section",{style:{display:"grid",gap:"1rem",scrollTopMargin:"0px"},className:"col-1 col-2-s",id:"overview",children:[t.jsxs("div",{children:[t.jsx("div",{style:{marginTop:"0px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"inset 0 0 0 1px var(--border)",borderRadius:"20px",background:"var(--bg)"},children:t.jsx(Cn,{colors:r.colors.values})}),t.jsx("div",{style:{height:"48px",margin:"16px 0"},children:t.jsx(Tn,{colors:r.colors.values})}),t.jsxs("div",{style:{margin:"16px 0"},children:[t.jsx(Wn,{colors:r.colors.values,limit:5}),t.jsx(In,{gradients:r.gradients.values,limit:4})]})]}),t.jsx("div",{children:t.jsxs("section",{style:{},children:[t.jsxs("div",{style:{background:"var(--bg)",boxShadow:"inset 0 0 0 1px var(--border)",borderRadius:"20px",marginBottom:"16
3px",paddingTop:"24px"},children:[t.jsxs("div",{style:{padding:"16px 32px 0px 32px",display:"flex",alignItems:"flex-start",gap:"64px"},children:[r.meta.minifiedGzipBytes&&(()=>{const p=w(r.meta.minifiedGzipBytes),h=Xe();return t.jsxs("dl",{style:{margin:0},children:[t.jsx("dt",{style:{margin:0,lineHeight:1,fontSize:"11px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.1em",whiteSpace:"nowrap"},children:"Minified + Gzip"}),t.jsxs("dd",{style:{margin:"4px 0 0 0",fontSize:"var(--font-size-8)",fontWeight:700,lineHeight:1},children:[t.jsx("span",{children:p.value}),t.jsx("span",{style:{fontSize:"var(--font-size-4)"},children:p.unit}),t.jsx("div",{style:{display:"grid",gap:"8px",marginTop:"8px",flexWrap:"wrap"},children:h&&t.jsxs("div",{style:{fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"4px",padding:"2px 6px",borderRadius:"6px",backgroundColor:h.isSmaller?"palegreen":"mistyrose",color:h.isSmaller?"darkgreen":"darkred"},children:[t.jsx("span",{children:h.isSmaller?"â":"â"}),t.jsxs("span",{children:[w(Math.abs(h.delta)).value,w(Math.abs(h.delta)).unit]}),t.jsxs("span",{children:["(",Math.abs(h.percentChange).toFixed(1),"%)"]}),t.jsx("span",{style:{opacity:.7},children:"vs last"})]})})]})]})})(),(()=>{const p=w(r.meta.bytes);return t.jsxs("dl",{style:{margin:0},children:[t.jsx("dt",{style:{margin:0,lineHeight:1,fontSize:"11px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.1em"},children:"Uncompressed"}),t.jsxs("dd",{style:{margin:"4px 0 0 0",fontSize:"var(--font-size-8)",fontWeight:700,lineHeight:1},children:[t.jsx("span",{children:p.value}),t.jsx("span",{style:{fontSize:"16px"},children:p.unit})]})]})})(),(()=>{const p=100-r.meta.minifiedGzipBytes/r.meta.bytes*100;return t.jsxs("dl",{style:{margin:0},children:[t.jsx("dt",{style:{lineHeight:1,fontSize:"11px",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.1em",whiteSpace:"nowrap"},children:"Compression rate"}),t.jsxs("dd",{style:{margin:"4px 0 0 0",display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx(ti,{percentage:p,size:24,strokeWidth:4}),t.jsxs("span",{style:{fontSize:"var(--font-size-8)",fontWeight:700,lineHeight:1},children:[p.toFixed(1),t.jsx("span",{style:{fontSize:"16px"},children:"%"})]})]})]})})()]}),t.jsx("div",{style:{display:"none",padding:"0 24px 0px 24px"},children:t.jsx(Be,{currentSize:r.meta.minifiedGzipBytes,averageSize:de,medianSize:ce})}),t.jsxs("div",{style:{borderBottom:"1px solid var(--border)",padding:"8px 24px 16px 24px",display:"grid",gridTemplateColumns:"2fr 2fr 1fr",gap:"16px",alignItems:"center"},children:[t.jsx("div",{style:{fontSize:"12px",background:"transparent",padding:"16px 16px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px var(--border)"},children:t.jsx(Be,{currentSize:r.meta.minifiedGzipBytes,averageSize:de,medianSize:ce})}),t.jsx(di,{currentSize:r.meta.minifiedGzipBytes,averageSize:de,medianSize:ce,currentLabel:"Current",averageLabel:"Average",medianLabel:"Median"})]}),t.jsx("div",{style:{padding:"16px 32px 32px 32px"},children:t.jsx(ai,{stats:r})})]}),t.jsxs("section",{style:{background:"var(--bg)",padding:"32px",boxShadow:"inset 0 0 0 1px var(--border)",borderRadius:"20px"},children:[t.jsx("h3",{style:{marginTop:0,fontSize:"16px",fontWeight:600,marginBottom:"16px"},children:"Counts"}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",alignItems:"flex-start",gap:"24px"},children:[t.jsxs("table",{className:"table-border",style:{margin:0,fontFamily:"monospace",width:"100%",fontSize:"12px"},children:[t.jsx("thead",{style:{display:"none"},children:t.jsxs("tr",{style:{fontSize:"12px",textTransform:"uppercase",letterSpacing:"0.1em"},children:[t.jsx("th",{children:"Name"}),t.jsx("th",{children:"Count"})]})}),t.jsxs("tbody",{children:[t.jsxs("tr",{children:[t.jsx("td",{children:"Selectors"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.selectors.total.toLocaleString()})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"ID Selectors"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.selectors.id?.toLocaleString()||0})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Class Selectors"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"}
3,children:r.selectors.class?.toLocaleString()||0})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Type Selectors"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.selectors.type?.toLocaleString()||0})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Attribute Selectors"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.selectors.attribute?.toLocaleString()||0})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Pseudo Classes"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.selectors.pseudoClass?.toLocaleString()||0})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Pseudo Elements"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.selectors.pseudoElement?.toLocaleString()||0})]})]})]}),t.jsxs("table",{className:"table-border",style:{margin:0,fontFamily:"monospace",width:"100%",fontSize:"12px"},children:[t.jsx("thead",{style:{display:"none"},children:t.jsxs("tr",{style:{fontSize:"12px",textTransform:"uppercase",letterSpacing:"0.1em"},children:[t.jsx("th",{children:"Name"}),t.jsx("th",{children:"Count"})]})}),t.jsxs("tbody",{children:[t.jsxs("tr",{children:[t.jsx("td",{children:"Properties"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:Object.keys(r.properties).length.toLocaleString()})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Declarations"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.declarations.total.toLocaleString()})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Rules"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.rules.total.toLocaleString()})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Avg Rule Size"}),t.jsxs("td",{style:{fontWeight:"bold",textAlign:"right"},children:[r.rules.size?.average?.toFixed(1)||0," decl"]})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Max Rule Size"}),t.jsxs("td",{style:{fontWeight:"bold",textAlign:"right"},children:[r.rules.size?.max||0," decl"]})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Avg Specificity"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.specificity.average?.toFixed(1)||0})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"!important"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.declarations.important?.length.toLocaleString()||0})]})]})]}),t.jsxs("table",{className:"table-border",style:{margin:0,fontFamily:"monospace",width:"100%",fontSize:"12px"},children:[t.jsx("thead",{style:{display:"none"},children:t.jsxs("tr",{style:{fontSize:"12px",textTransform:"uppercase",letterSpacing:"0.1em"},children:[t.jsx("th",{children:"Name"}),t.jsx("th",{children:"Count"})]})}),t.jsxs("tbody",{children:[t.jsxs("tr",{children:[t.jsx("td",{children:"Vendor Prefixed"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.declarations.vendorPrefixed?.toLocaleString()||0})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Property Resets"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.declarations.propertyResets?.toLocaleString()||0})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Variables"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.variables.defined})]}),r.media&&r.media.total>0&&t.jsxs("tr",{children:[t.jsx("td",{children:"Media Queries"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.media.total})]}),r.containers&&r.containers.total>0&&t.jsxs("tr",{children:[t.jsx("td",{children:"Container Queries"}),t.jsx("td",{style:{fontWeight:"bold",textAlign:"right"},children:r.containers.total})]})]})]})]})]}),(()=>{const p=Object.entries(r.properties).map(([h,m])=>({property:h,total:m.total,unique:m.unique,ratio:m.unique/m.total,score:(1-m.unique/m.total)*Math.log(m.total+1)})).filter(h=>h.total>=20&&h.unique<h.total).sort((h,m)=>m.score-h.score).slice(0,12);return p.length>0?t.jsxs("section",{style:{background:"var(--bg)",marginTop:"16px",borderRadius:"20px",padding:"32px 32px 48px 32px",boxShadow:"inset 0 0 0 1px var(--border)"},children:[t.jsx("h3",{style:{marginTop:0,fontSize:"16px",fontWeight:600,marginBottom:"16
3px"},children:"Total vs. unique declarations"}),t.jsx(Zn,{data:p})]}):null})()]})})]}),r.specificity&&t.jsx("div",{id:"specificity",style:{marginTop:"16px",scrollMarginTop:"80px"},children:t.jsxs("div",{style:{boxShadow:"inset 0 0 0 1px var(--border)",padding:"32px",borderRadius:"20px",background:"var(--bg)"},children:[t.jsxs("h2",{style:{margin:"8px 0 16px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:["Specificity",t.jsx("a",{href:`/stats/${e}/selectors`,onClick:p=>{p.preventDefault(),window.history.pushState({},"",`/stats/${e}/selectors`),window.dispatchEvent(new PopStateEvent("popstate"))},style:{fontSize:"0.9rem",opacity:.7,textDecoration:"none"},children:"View all selectors â"})]}),t.jsx(Qn,{data:r.specificity})]})}),r.rules?.size&&t.jsx("div",{style:{marginTop:"16px"},children:t.jsxs("div",{style:{boxShadow:"inset 0 0 0 1px var(--border)",padding:"32px",borderRadius:"20px",background:"var(--bg)"},children:[t.jsx("h2",{style:{margin:"8px 0 16px 0"},children:"Rules"}),t.jsx(Xn,{data:r.rules.size})]})}),r.colors.values.length>0&&t.jsx(t.Fragment,{children:t.jsxs("div",{id:"colors",style:{marginTop:"32px",scrollMarginTop:"80px",boxShadow:"inset 0 0 0 1px var(--border)",padding:"32px",borderRadius:"20px",background:"var(--bg)"},children:[t.jsxs("h2",{style:{marginBottom:"24px",fontSize:"32px",display:"flex",alignItems:"center",gap:"2rem"},children:["Colors",t.jsxs("dl",{style:{margin:0},children:[t.jsx("dt",{style:{fontSize:"12px"},children:"Total"}),t.jsx("dd",{style:{fontSize:"20px",fontWeight:"bold",lineHeight:1},children:r.colors.total})]}),t.jsxs("dl",{style:{margin:0},children:[t.jsx("dt",{style:{fontSize:"12px"},children:"Unique"}),t.jsx("dd",{style:{fontSize:"20px",fontWeight:"bold",lineHeight:1},children:r.colors.unique})]}),t.jsx("button",{onClick:()=>{window.history.pushState({},"",`/color-accessibility/${e}`),window.dispatchEvent(new PopStateEvent("popstate"))},style:{padding:"12px 32px",fontSize:"var(--font-size-4)",fontWeight:700,background:"var(--fg)",color:"var(--bg-offset)",border:"none",borderRadius:"12px",cursor:"pointer"},children:"Explore Accessible Combinations â"})]}),t.jsx(nt,{colors:r.colors.values}),t.jsx("button",{onClick:()=>{window.history.pushState({},"",`/color-accessibility/${e}`),window.dispatchEvent(new PopStateEvent("popstate"))},style:{display:"none",padding:"0.75rem 1.5rem",fontSize:"1rem",fontWeight:600,background:"var(--accent)",color:"white",border:"none",borderRadius:"8px",cursor:"pointer"},children:"Explore Accessible Combinations â"})]})}),r.gradients.values.length>0&&t.jsx("div",{id:"gradients",style:{scrollMarginTop:"80px",marginTop:"32px"},children:t.jsxs("div",{style:{background:"var(--bg)",boxShadow:"inset 0 0 0 1px var(--border)",borderRadius:"20px",padding:"32px"},children:[t.jsxs("h2",{style:{fontWeight:600,display:"flex",gap:"48px",marginBottom:"16px"},children:["Gradients",t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[t.jsxs("dl",{style:{margin:0},children:[t.jsx("dt",{style:{fontSize:"12px"},children:"Total"}),t.jsx("dd",{style:{fontSize:"20px",fontWeight:"bold",lineHeight:1},children:r.gradients?.total})]}),t.jsxs("dl",{children:[t.jsx("dt",{style:{fontSize:"12px"},children:"Unique"}),t.jsx("dd",{style:{fontSize:"20px",fontWeight:"bold",lineHeight:1},children:r.gradients?.values.length})]})]})]}),t.jsx(Nn,{gradients:r.gradients.values})]})}),t.jsxs("div",{id:"typography",style:{marginTop:"32px",scrollMarginTop:"80px"},children:[t.jsx("h2",{style:{fontSize:"48px",marginBottom:"16px"},children:"Typography"}),t.jsx(qn,{data:r.typography})]}),(r.spacing.padding.length>0||r.spacing.margin.length>0||r.spacing.gap?.length>0)&&t.jsx(t.Fragment,{children:t.jsx("div",{id:"spacing",style:{scrollMarginTop:"80px"},children:(()=>{const p=li(r.spacing);return t.jsxs("article",{style:{marginTop:"32px",borderRadius:"20px",background:"var(--bg)",boxShadow:"inset 0 0 0 1px var(--border)",padding:"32px 24px 48px 24px"},children:[t.jsx("h3",{style:{marginBottom:"16px"},children:"Spacing"}),t.jsxs("div",{style:{marginTop:"8px",display:"grid",gap:"8px",fontSize:"var(--font-size-3)"},children:[p.allValues.length>0&&t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"6ch 1fr",gap:"8px",alignItems:"center"},children:[t.jsx("span",{style:{textAlign:"right"},children:"All"}),t.jsx("div",{style:{background:"var(--bg-offset)",boxShadow:"inset 0 0 0 1px currentColor",width:"100%",position:"relative",height:"20px"},children:p.allValues.map((h,m)=>t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:h,borderRight:"1px solid var(--fg)"}},m))})]}),p.paddingValues.length>0&&t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"6ch 1fr",gap:"8px",alignItems:"center"},children:[t.jsx("span",{style:{textAlign:"right"},children:"Padding"}),t.jsx("div",{style:{background:"var(--bg-offset)",boxShadow:"inset 0 0 0 1px currentColor",width:"100%",position:"relative",height:"20px"},children:p.paddingValues.map((h,m)=>t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:h,borderRight:"1px solid var(--fg)"}},m))})]}),p.marginValues.length>0&&t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"6ch 1fr",gap:"8px",alignItems:"center"},children:[t.jsx("span",{style:{textAlign:"right"},children:"Margin"}),t.jsx("div",{style:{background:"var(--bg-offset)",boxShadow:"inset 0 0 0 1px currentColor",width:"100%",position:"relative",height:"20px"},children:p.marginValues.map((h,m)=>t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:h,borderRight:"1px solid var(--fg)"}},m))})]}),p.gapValues.length>0&&t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"6ch 1fr",gap:"8px",alignItems:"center"},children:[t.jsx("span",{style:{textAlign:"right"},children:"Gap"}),t.jsx("div",{style:{background:"var(--bg-offset)",boxShadow:"inset 0 0 0 1px currentColor",width:"100%",position:"relative",height:"20px"},children:p.gapValues.map((h,m)=>t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:h,borderRight:"1px solid var(--fg)"}},m))})]})]})]})})()})}),t.jsx("div",{id:"borders",style:{scrollMarginTop:"80px"},children:t.jsxs("div",{style:{display:"grid",gap:"2rem"},children:[r.borders.borderRadius.length>0&&t.jsx(tt,{title:"Border Radius",values:r.borders.borderRadius,propertyType:"border-radius",maxItems:30}),r.shadows.boxShadow.length>0&&t.jsx("div",{id:"shadows",style:{scrollMarginTop:"80px"},children:t.jsx(Yn,{title:"Box Shadow",values:r.shadows.boxShadow,type:"shadow"})}),r.grids.gridTemplateColumns.length>0&&t.jsxs("div",{id:"grids",style:{scrollMarginTop:"80px"},children:[t.jsx(P,{title:"Grid Template Columns",count:r.grids.gridTemplateColumns.length}),t.jsx(ei,{values:r.grids.gridTemplateColumns})]})]})}),t.jsx(q,{}),r.variables.defined>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:"variables",style:{scrollMarginTop:"80px"},children:[t.jsx(P,{title:"CSS Variables",count:r.variables.defined}),t.jsx(Jn,{data:r.variables})]}),t.jsx(q,{})]}),r.media&&r.media.total>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:"media-queries",style:{scrollMarginTop:"80px"},children:[t.jsx(P,{title:"Media Queries",count:r.media.total}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:Object.entries(r.media.queries||{}).sort(([,p],[,h])=>
3h.count-p.count).map(([p,h])=>t.jsxs("div",{style:{padding:"0.75rem",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"4px",display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[t.jsx("code",{style:{fontSize:"0.875rem",fontFamily:"monospace"},children:p}),t.jsxs("div",{style:{display:"flex",gap:"1rem",fontSize:"0.75rem",opacity:.6},children:[t.jsxs("span",{children:[h.count,"Ã used"]}),t.jsxs("span",{children:[h.rules," rules"]})]})]},p))})]}),t.jsx(q,{})]}),r.animations&&(r.animations.animationName?.length>0||r.animations.transition?.length>0)&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:"animations",style:{scrollMarginTop:"80px"},children:[t.jsx(P,{title:"Animations & Transitions"}),r.animations.animationName?.length>0&&t.jsxs("div",{style:{marginBottom:"2rem"},children:[t.jsxs("h4",{style:{fontSize:"1rem",fontWeight:600,marginBottom:"0.75rem",opacity:.8},children:["Animation Names (",r.animations.animationName.length,")"]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem"},children:r.animations.animationName.map((p,h)=>t.jsxs("span",{style:{padding:"0.25rem 0.5rem",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"3px",fontSize:"0.875rem",fontFamily:"monospace"},children:[p.value," ",t.jsxs("span",{style:{opacity:.5},children:["Ã",p.count]})]},h))})]}),r.animations.animationDuration?.length>0&&t.jsxs("div",{style:{marginBottom:"2rem"},children:[t.jsxs("h4",{style:{fontSize:"1rem",fontWeight:600,marginBottom:"0.75rem",opacity:.8},children:["Durations (",r.animations.animationDuration.length,")"]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem"},children:r.animations.animationDuration.map((p,h)=>t.jsxs("span",{style:{padding:"0.25rem 0.5rem",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"3px",fontSize:"0.875rem",fontFamily:"monospace"},children:[p.value," ",t.jsxs("span",{style:{opacity:.5},children:["Ã",p.count]})]},h))})]}),r.animations.transition?.length>0&&t.jsxs("div",{children:[t.jsxs("h4",{style:{fontSize:"1rem",fontWeight:600,marginBottom:"0.75rem",opacity:.8},children:["Transitions (",r.animations.transition.length,")"]}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:r.animations.transition.slice(0,20).map((p,h)=>t.jsxs("div",{style:{padding:"0.5rem",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"3px",display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[t.jsx("code",{style:{fontSize:"0.875rem",fontFamily:"monospace",flex:1},children:p.value}),t.jsxs("span",{style:{fontSize:"0.75rem",opacity:.5,marginLeft:"1rem"},children:["Ã",p.count]})]},h))})]})]}),t.jsx(q,{})]}),r.rules&&r.rules.byType&&Object.keys(r.rules.byType).length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:"rules-by-type",style:{scrollMarginTop:"80px"},children:[t.jsx(P,{title:"Rules by Type",count:r.rules.total}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:Object.entries(r.rules.byType).sort(([,p],[,h])=>h-p).map(([p,h])=>t.jsxs("div",{style:{padding:"0.75rem",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"4px",display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[t.jsx("span",{style:{fontSize:"0.875rem",fontFamily:"monospace"},children:p}),t.jsx("span",{style:{fontSize:"0.875rem",opacity:.6},children:h})]},p))})]}),t.jsx(q,{})]}),r.layers&&r.layers.names?.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:"layers",style:{scrollMarginTop:"80px"},children:[t.jsx(P,{title:"CSS Layers (@layer)",count:r.layers.names.length}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:r.layers.names.map((p,h)=>t.jsxs("div",{style:{padding:"0.75rem",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"4px",display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[t.jsx("span",{style:{fontSize:"0.875rem",fontFamily:"monospace"},children:p}),t.jsxs("span",{style:{fontSize:"0.75rem",opacity:.5},children:["Order: ",h+1]})]},h))})]}),t.jsx(q,{})]}),r.containers&&r.containers.total>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:"containers",style:{scrollMarginTop:"80px"},children:[t.jsx(P,{title:"Container Queries (@container)",count:r.containers.total}),r.containers.features&&Object.keys(r.containers.features).length>0&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:Object.entries(r.containers.features).sort(([,p],[,h])=>h-p).map(([p,h])=>t.jsxs("div",{style:{padding:"0.75rem",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"4px",display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[t.jsx("code",{style:{fontSize:"0.875rem",fontFamily:"monospace"},children:p}),t.jsx("span",{style:{fontSize:"0.875rem",opacity:.6},children:h})]},p))})]}),t.jsx(q,{})]}),r.variables&&r.variables.redefinitions?.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{id:"variable-redefinitions",style:{scrollMarginTop:"80px"},children:[t.jsx(P,{title:"Variable Redefinitions",count:r.variables.redefined}),t.jsx("p",{style:{fontSize:"0.875rem",opacity:.6,marginBottom:"1rem"},children:"CSS variables that are defined multiple times with different values"}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:r.variables.redefinitions.map((p,h)=>t.jsxs("div",{style:{padding:"1rem",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"4px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"0.5rem"},children:[t.jsx("code",{style:{fontSize:"0.875rem",fontFamily:"monospace",fontWeight:600},children:p.name}),t.jsxs("span",{style:{fontSize:"0.75rem",opacity:.5},children:[p.count," definitions"]})]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",marginTop:"0.5rem"},children:p.values.map((m,b)=>t.jsx("code",{style:{padding:"0.25rem 0.5rem",background:"var(--hover)",borderRadius:"3px",fontSize:"0.75rem",fontFamily:"monospace"},children:m},b))})]},h))})]}),t.jsx(q,{})]}),r.backgroundImages.values.length>0&&t.jsx(t.Fragment,{children:t.jsxs("div",{id:"background-images",style:{scrollMarginTop:"80px"}
3,children:[t.jsx(P,{title:"Background Images",count:r.backgroundImages.values.length}),t.jsx("div",{style:{display:"grid",gap:"1rem",fontFamily:"monospace",fontSize:"0.85rem"},children:r.backgroundImages.values.map((p,h)=>{const m=p.value.match(/url\(['"]?([^'"]+)['"]?\)/),b=m?m[1]:null;let z=b;if(b&&r.meta?.domain)try{b.startsWith("/")?z=`https://${r.meta.domain}${b}`:b.startsWith("./")||b.startsWith("../")?z=`https://${r.meta.domain}/${b}`:b.startsWith("http")||(z=`https://${r.meta.domain}/${b}`)}catch{}return t.jsxs("div",{style:{display:"flex",gap:"1rem",padding:"0.75rem",background:"var(--code-bg)",borderRadius:"4px",alignItems:"center"},children:[z&&z.startsWith("http")&&t.jsx("div",{style:{width:"80px",height:"80px",flexShrink:0,border:"1px solid rgba(0,0,0,0.1)",borderRadius:"4px",overflow:"hidden",background:"repeating-conic-gradient(#f0f0f0 0% 25%, transparent 0% 50%) 50% / 10px 10px"},children:t.jsx("img",{src:z,alt:"Background preview",style:{width:"100%",height:"100%",objectFit:"contain"},onError:$=>{$.currentTarget.style.display="none"}})}),t.jsxs("div",{style:{flex:1,wordBreak:"break-all"},children:[t.jsx("div",{style:{marginBottom:"0.25rem"},children:t.jsxs("span",{style:{opacity:.6},children:["Ã",p.count]})}),t.jsx("div",{style:{fontSize:"0.8rem"},children:p.value}),z&&z!==b&&t.jsxs("div",{style:{fontSize:"0.75rem",opacity:.5,marginTop:"0.25rem"},children:["â ",z]})]})]},h)})})]})})]}),R&&t.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:()=>T(!1),children:t.jsxs("div",{style:{background:"var(--bg)",borderRadius:"12px",padding:"2rem",maxWidth:"600px",width:"90%",maxHeight:"80vh",overflowY:"auto",border:"1px solid var(--border)"},onClick:p=>p.stopPropagation(),children:[t.jsx("h2",{style:{fontSize:"1.75rem",fontWeight:600,marginBottom:"0.5rem"},children:"Compare Design Systems"}),t.jsx("p",{style:{opacity:.7,marginBottom:"1.5rem"},children:"Compare CSS files side-by-side or analyze multiple sites. Choose what to compare:"}),t.jsxs("div",{style:{display:"grid",gap:"1rem",marginBottom:"1.5rem"},children:[t.jsxs("label",{style:{padding:"1rem",border:`2px solid ${_==="history"?"var(--accent)":"var(--border)"}`,borderRadius:"8px",cursor:c.length>1?"pointer":"not-allowed",display:"flex",alignItems:"center",gap:"0.75rem",opacity:c.length>1?1:.5},children:[t.jsx("input",{type:"radio",name:"compareMethod",value:"history",checked:_==="history",onChange:()=>ee("history"),disabled:c.length<=1,style:{cursor:c.length>1?"pointer":"not-allowed"}}),t.jsxs("div",{children:[t.jsxs("div",{style:{fontWeight:600,marginBottom:"0.25rem"},children:["ð Choose from History",c.length<=1&&" (No history yet)"]}),t.jsx("div",{style:{fontSize:"0.85rem",opacity:.7},children:"1:1 comparison with a previous snapshot"})]})]}),t.jsxs("label",{style:{padding:"1rem",border:`2px solid ${_==="url"?"var(--accent)":"var(--border)"}`,borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",gap:"0.75rem"},children:[t.jsx("input",{type:"radio",name:"compareMethod",value:"url",checked:_==="url",onChange:()=>ee("url"),style:{cursor:"pointer"}}),t.jsxs("div",{children:[t.jsx("div",{style:{fontWeight:600,marginBottom:"0.25rem"},children:"ð Enter URL(s)"}),t.jsx("div",{style:{fontSize:"0.85rem",opacity:.7},children:"Compare 1-32 websites"})]})]}),t.jsxs("label",{style:{padding:"1rem",border:`2px solid ${_==="css"?"var(--accent)":"var(--border)"}`,borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",gap:"0.75rem"},children:[t.jsx("input",{type:"radio",name:"compareMethod",value:"css",checked:_==="css",onChange:()=>ee("css"),style:{cursor:"pointer"}}),t.jsxs("div",{children:[t.jsx("div",{style:{fontWeight:600,marginBottom:"0.25rem"},children:"ð Paste CSS"}),t.jsx("div",{style:{fontSize:"0.85rem",opacity:.7},children:"1:1 comparison against raw CSS"})]})]})]}),_==="history"&&c.length>1&&t.jsxs("div",{style:{marginBottom:"1.5rem"},children:[t.jsx("label",{style:{display:"block",marginBottom:"0.5rem",fontWeight:500},children:"Select Snapshot"}),t.jsxs("select",{value:x,onChange:p=>C(p.target.value),style:{width:"100%",padding:"0.75rem",fontSize:"1rem",borderRadius:"4px",border:"1px solid var(--border)"},children:[t.jsx("option",{value:"",children:"Choose..."}),c.filter((h,m)=>h.id===e?!1:m===0?!0:h.css_hash!==c[m-1].css_hash).map(h=>
3t.jsx("option",{value:h.id,children:new Date(h.ts).toLocaleString()},h.id))]})]}),_==="url"&&t.jsxs("div",{style:{marginBottom:"1.5rem"},children:[t.jsxs("label",{style:{display:"block",marginBottom:"0.5rem",fontWeight:500},children:["Enter URL",N.length>1?"s":""," (",N.filter(p=>p.trim()).length,"/32)"]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:[N.map((p,h)=>t.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[t.jsx("input",{type:"text",value:p,onChange:m=>{const b=[...N];b[h]=m.target.value,le(b)},placeholder:"github.com or https://github.com",style:{flex:1,padding:"0.75rem",fontSize:"1rem",borderRadius:"4px",border:"1px solid var(--border)"}}),N.length>1&&t.jsx("button",{onClick:()=>{le(N.filter((m,b)=>b!==h))},style:{padding:"0.75rem",fontSize:"0.9rem",background:"transparent",border:"1px solid var(--border)",borderRadius:"4px",cursor:"pointer",opacity:.6},title:"Remove",children:"â"})]},h)),N.length<32&&t.jsx("button",{onClick:()=>le([...N,""]),style:{padding:"0.75rem",fontSize:"0.9rem",background:"transparent",border:"1px dashed var(--border)",borderRadius:"4px",cursor:"pointer",opacity:.6},children:"+ Add another URL"})]})]}),_==="css"&&t.jsxs("div",{style:{marginBottom:"1.5rem"},children:[t.jsx("label",{style:{display:"block",marginBottom:"0.5rem",fontWeight:500},children:"Paste CSS"}),t.jsx("textarea",{value:D,onChange:p=>Z(p.target.value),placeholder:"/* Paste CSS here */",style:{width:"100%",minHeight:"150px",padding:"0.75rem",fontSize:"1rem",borderRadius:"4px",border:"1px solid var(--border)",fontFamily:"monospace",background:"var(--code-bg)"}}
3)]}),t.jsxs("div",{style:{display:"flex",gap:"1rem",justifyContent:"flex-end"},children:[t.jsx("button",{onClick:()=>T(!1),style:{padding:"0.75rem 1.5rem",fontSize:"1rem",background:"transparent",border:"1px solid var(--border)",borderRadius:"8px",cursor:"pointer"},children:"Cancel"}),t.jsx("button",{onClick:Ye,disabled:te||_==="history"&&!x||_==="url"&&N.filter(p=>p.trim()).length===0||_==="css"&&!D.trim(),style:{padding:"0.75rem 1.5rem",fontSize:"1rem",fontWeight:600,background:"var(--accent)",color:"white",border:"none",borderRadius:"8px",cursor:te?"wait":"pointer",opacity:te?.6:1},children:te?t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.5rem"},children:[t.jsx("span",{children:"Processing..."}),me&&t.jsx("span",{style:{fontSize:"0.85rem",opacity:.8},children:me})]}):"Compare"})]})]})}),A&&t.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:()=>I(!1),children:t.jsxs("div",{style:{background:"var(--bg)",borderRadius:"12px",padding:"2rem",maxWidth:"800px",width:"90%",maxHeight:"80vh",overflowY:"auto",border:"1px solid var(--border)"},onClick:p=>p.stopPropagation(),children:[t.jsx("h2",{style:{fontSize:"1.75rem",fontWeight:600,marginBottom:"1rem"},children:"Export Design Tokens"}),t.jsx("p",{style:{opacity:.7,marginBottom:"1.5rem"},children:"Extract design tokens from analyzed CSS as production-ready code"}),t.jsxs("div",{style:{display:"grid",gap:"1rem",marginBottom:"1.5rem"},children:[t.jsxs("button",{onClick:()=>{const p=se(r);si(p,`design-tokens-${r.meta.domain?.replace(/[^a-z0-9]/gi,"-")||"export"}.css`,"text/css")},style:{padding:"1.25rem",border:"2px solid var(--border)",borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",gap:"1rem",background:"var(--bg)",textAlign:"left",transition:"all 0.2s"},onMouseEnter:p=>{p.currentTarget.style.borderColor="var(--accent)",p.currentTarget.style.background="var(--code-bg)"},onMouseLeave:p=>{p.currentTarget.style.borderColor="var(--border)",p.currentTarget.style.background="var(--bg)"},children:[t.jsx("div",{style:{fontSize:"2rem"},children:"ð¦"}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:600,marginBottom:"0.25rem",fontSize:"1.1rem"},children:"CSS Variables (.css)"}),t.jsx("div",{style:{fontSize:"0.85rem",opacity:.7},children:"Ready-to-use :root variables organized by category"})]}),t.jsx("div",{style:{fontSize:"1.5rem",opacity:.5},children:"â¬ï¸"})]}),t.jsxs("button",{onClick:async()=>{const p=se(r);await oi(p)&&(re(!0),setTimeout(()=>re(!1),2e3))},style:{padding:"1.25rem",border:"2px solid var(--border)",borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",gap:"1rem",background:V?"var(--accent)":"var(--bg)",color:V?"white":"inherit",textAlign:"left",transition:"all 0.2s"},onMouseEnter:p=>{V||(p.currentTarget.style.borderColor="var(--accent)",p.currentTarget.style.background="var(--code-bg)")},onMouseLeave:p=>{V||(p.currentTarget.style.borderColor="var(--border)",p.currentTarget.style.background="var(--bg)")},children:[t.jsx("div",{style:{fontSize:"2rem"},children:"ð"}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:600,marginBottom:"0.25rem",fontSize:"1.1rem"},children:V?"â Copied!":"Copy to Clipboard"}),t.jsx("div",{style:{fontSize:"0.85rem",opacity:.7},children:V?"CSS variables copied successfully":"Copy CSS variables to paste in your project"})]}),t.jsx("div",{style:{fontSize:"1.5rem",opacity:.5},children:V?"â":"ð"})]})]}),t.jsxs("div",{style:{marginBottom:"1.5rem"},children:[t.jsx("h3",{style:{fontSize:"1.1rem",fontWeight:600,marginBottom:"0.75rem"},children:"Preview"}),t.jsxs("pre",{style:{background:"var(--code-bg)",padding:"1rem",borderRadius:"4px",fontSize:"0.85rem",maxHeight:"300px",overflow:"auto",border:"1px solid var(--border)",lineHeight:1.5},children:[se(r).split(` 4`).slice(0,30).join(` 5`),se(r).split(` 6`).length>30&&` 7 ... 8}`]})]}),t.jsx("div",{style:{display:"flex",gap:"1rem",justifyContent:"flex-end"},children:t.jsx("button",{onClick:()=>I(!1),style:{padding:"0.75rem 1.5rem",fontSize:"1rem",background:"transparent",border:"1px solid var(--border)",borderRadius:"8px",cursor:"pointer"},children:"Close"})})]})}),G&&t.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:()=>O(!1),children:t.jsxs("div",{style:{background:"var(--bg)",borderRadius:"12px",padding:"2rem",maxWidth:"1000px",width:"90%",maxHeight:"90vh",overflow:"auto",border:"1px solid var(--border)"},onClick:p=>p.stopPropagation(),children:[t.jsxs("h2",{style:{fontSize:"1.75rem",fontWeight:600,marginBottom:"1rem"},children:["Share ",r?.meta?.domain||"Results"]}),t.jsx("p",{style:{opacity:.7,marginBottom:"1.5rem"},children:"Beautiful social media cards automatically generated for sharing"}),t.jsxs("div",{style:{marginBottom:"2rem"},children:[t.jsx("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:600,marginBottom:"0.5rem",opacity:.7},children:"Share URL"}),t.jsxs("div",{style:{display:"flex",gap:"0.5rem"},children:[t.jsx("input",{type:"text",value:`${window.location.origin}/stats/${e}`,readOnly:!0,style:{flex:1,padding:"0.75rem",border:"1px solid var(--border)",borderRadius:"8px",background:"var(--bg)",color:"var(--fg)",fontFamily:"monospace",fontSize:"0.9rem"}}),t.jsx("button",{onClick:()=>{navigator.clipboard.writeText(`${window.location.origin}/stats/${e}`),re(!0),setTimeout(()=>re(!1),2e3)},style:{padding:"0.75rem 1.5rem",fontSize:"0.9rem",fontWeight:600,background:"var(--accent)",color:"white",border:"none",borderRadius:"8px",cursor:"pointer",whiteSpace:"nowrap"},children:V?"â Copied":"Copy"})]})]}),t.jsxs("div",{style:{marginBottom:"2rem"},children:[t.jsx("h3",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"1rem"},children:"Social Media Preview"}),t.jsx("p",{style:{fontSize:"0.875rem",opacity:.7,marginBottom:"1rem"},children:"When you share this link on Twitter, LinkedIn, or Slack, this image will automatically appear."}),t.jsxs("div",{style:{display:"grid",gap:"1.5rem"},children:[t.jsxs("div",{children:[t.jsx("h4",{style:{fontSize:"1rem",fontWeight:600,marginBottom:"0.5rem"},children:"Default"}
8),t.jsx("div",{style:{border:"2px solid var(--border)",borderRadius:"12px",overflow:"hidden",background:"#f7fafc"},children:t.jsx("img",{src:`${F}/v1/og/${e}.png?template=default`,alt:"Default OG Image",style:{width:"100%",display:"block"}})}),t.jsx("a",{href:`${F}/v1/og/${e}.png?template=default`,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"0.5rem",fontSize:"0.875rem",color:"var(--accent)",textDecoration:"none"},children:"Open full size â"})]}),r?.colors?.unique>0&&t.jsxs("div",{children:[t.jsx("h4",{style:{fontSize:"1rem",fontWeight:600,marginBottom:"0.5rem"},children:"Color Palette"}),t.jsx("div",{style:{border:"2px solid var(--border)",borderRadius:"12px",overflow:"hidden",background:"#f7fafc"},children:t.jsx("img",{src:`${F}/v1/og/${e}.png?template=colors`,alt:"Colors OG Image",style:{width:"100%",display:"block"}})}),t.jsx("a",{href:`${F}/v1/og/${e}.png?template=colors`,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"0.5rem",fontSize:"0.875rem",color:"var(--accent)",textDecoration:"none"},children:"Open full size â"})]}),r?.specificity?.graph?.length>0&&t.jsxs("div",{children:[t.jsx("h4",{style:{fontSize:"var(--font-size-4)",fontWeight:600,marginBottom:"0.5rem"},children:"Specificity Graph â¨"}),t.jsx("div",{style:{border:"2px solid var(--border)",borderRadius:"12px",overflow:"hidden",background:"#0f0f23"},children:t.jsx("img",{src:`${F}/v1/og/${e}.png?template=specificity`,alt:"Specificity Graph OG Image",style:{width:"100%",display:"block"}})}),t.jsx("a",{href:`${F}/v1/og/${e}.png?template=specificity`,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"0.5rem",fontSize:"0.875rem",color:"var(--accent)",textDecoration:"none"},children:"Open full size â"})]}),t.jsxs("div",{children:[t.jsx("h4",{style:{fontSize:"var(--font-size-4)",fontWeight:600,marginBottom:"0.5rem"},children:"Minimal"}),t.jsx("div",{style:{border:"2px solid var(--border)",borderRadius:"12px",overflow:"hidden",background:"#f7fafc"},children:t.jsx("img",{src:`${F}/v1/og/${e}.png?template=minimal`,alt:"Minimal OG Image",style:{width:"100%",display:"block"}})}),t.jsx("a",{href:`${F}/v1/og/${e}.png?template=minimal`,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"0.5rem",fontSize:"0.875rem",color:"var(--accent)",textDecoration:"none"},children:"Open full size â"})]})]})]}),t.jsx("div",{style:{display:"flex",gap:"1rem",justifyContent:"flex-end"},children:t.jsx("button",{onClick:()=>O(!1),style:{padding:"0.75rem 1.5rem",fontSize:"1rem",background:"transparent",border:"1px solid var(--border)",borderRadius:"8px",cursor:"pointer"},children:"Close"})})]})})]})}function P({title:e,count:r}){return t.jsxs("h2",{style:{fontSize:"1.5rem",fontWeight:600,marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:"0.75rem"},children:[e,r!==void 0&&t.jsx("span",{style:{fontSize:"1rem",fontWeight:400,opacity:.5},children:r})]})}function q(){return t.jsx("hr",{style:{margin:"3rem 0"}})}export{fi as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.