effcss 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <p align="center">
2
2
  <a href="https://effnd.tech/css/">
3
- <img alt="effcss" src="https://effnd.tech/effcss_logo.svg" height="256px" />
3
+ <img alt="effcss" src="https://effnd.tech/css/logo.svg" height="256px" />
4
4
  </a>
5
5
  </p>
6
6
 
@@ -31,6 +31,11 @@ EffCSS is a self-confident CSS-in-JS library based only on the browser APIs. Use
31
31
  - [Repository](https://gitverse.ru/msabitov/effcss)
32
32
  - [Github mirror](https://github.com/msabitov/effcss)
33
33
 
34
+ ## Devtools
35
+
36
+ - [Mozilla Firefox](https://addons.mozilla.org/ru/firefox/addon/effcss-developer-tools/)
37
+ - [zip for Chromium based browsers](https://storage.yandexcloud.net/effcss-devtools/chromium-based.zip), that can be installed using [chrome://extensions](https://www.geeksforgeeks.org/installation-guide/how-to-add-extensions-in-google-chrome-browser/)
38
+
34
39
  ## Examples
35
40
 
36
41
  - [Vanilla TS](https://stackblitz.com/edit/effcss-3-ts-vitejs?file=index.html)
@@ -1,7 +1,7 @@
1
1
  /*
2
- * EffCSS v3.7.0
2
+ * EffCSS v3.8.0
3
3
  * {@link https://gitverse.ru/msabitov/effcss}
4
4
  * Copyright (c) Marat Sabitov
5
5
  * @license Apache-2.0
6
6
  */
7
- "function"==typeof SuppressedError&&SuppressedError;const t=void 0,e=Object.entries,s=Array.isArray,r=Object.defineProperties,n=t=>`data-${t}`,i=t=>"string"==typeof t,a=t=>null!==t&&"object"==typeof t,c=(t,e)=>`${t}${e?"__"+e:""}`,l=t=>t.split("."),o=(s,r)=>e(s).reduce(((s,[n,i])=>{if(a(i)){const c=e(i);c.length?s.push(...c.reduce(((s,[i,c])=>{if((e=>null!==e&&e!==t)(i)&&r&&s.push([n,i,t,t]),a(c)){const t=e(c);t.length&&s.push(...t.reduce(((t,[e,s])=>{const r=typeof s;return"string"!==r&&"number"!==r||t.push([n,i,e,s]),t}),[]))}return s}),[])):s.push([n,t,t,t])}return s}),[]),h=(t,e,s,r)=>""+(c(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),u=(t,e,s,r)=>"."+h(t,e,s,r),g=(t,e,s,r)=>`[${n(c(t,e))}${s&&r?`~="${s}_${r}"`:s?`~="${s}"`:""}]`,m=(t,...r)=>r.length?r.reduce(((t,r)=>(e(r).forEach((([e,r])=>{r&&"object"==typeof r&&t[e]?s(t[e])&&s(r)?t[e]=[...t[e],...r]:m(t[e],r||{}):t[e]=r})),t)),t):t,p={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},d="effcss-provider",b={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null},f=t=>Number((.1*184+.9*t).toFixed(2)),x={l:{dark:{bg:{xl:.24,l:.3,m:.36,s:.42,xs:.48},fg:{xl:.98,l:.93,m:.86,s:.79,xs:.72}},light:{bg:{xl:.98,l:.93,m:.88,s:.83,xs:.78},fg:{xl:0,l:.12,m:.24,s:.36,xs:.48}}},c:{dark:{bg:{pale:.02,base:.06,rich:.1},fg:{pale:.06,base:.1,rich:.14}},light:{bg:{pale:.01,base:.04,rich:.7},fg:{pale:.07,base:.11,rich:.15}}},h:{pri:184,sec:290,suc:f(142),inf:f(264),war:f(109),dan:f(29)}},$={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",rangle:"30deg",l:p,h:{def:261.35,b:261.35,i:194.77,e:29.23,w:70.66,s:142.49},c:{def:.03,xs:.03,s:.06,m:.1,l:.15,xl:.25},a:{def:1,min:0,xs:.1,s:.25,m:.5,l:.75,xl:.9,max:1},t:{def:300,xs:100,s:200,m:300,l:450,xl:600,no:0,min:50,max:750},int:[...Array(12).keys()],fr:{0:0,"1/12":"0.0833","1/10":"0.1","1/6":"0.1667","1/5":"0.2","1/4":"0.25","3/10":"0.3","1/3":"0.3333","2/5":"0.4","5/12":"0.4167","1/2":"0.5","7/12":"0.5833","3/5":"0.6","2/3":"0.6667","7/10":"0.7","3/4":"0.75","4/5":"0.8","5/6":"0.8333","9/10":"0.9","11/12":"0.9167",1:"1"},ar:{1:1,"2/1":2,"1/2":.5,"4/3":1.3333,"3/4":.75,"9/16":.5625,"16/9":1.7778}},light:{l:p},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:x,coef:{$0_:{xxs:.0625,xs:.125,s:.25,m:.5,l:.75,xl:.875,xxl:.9375},$1_:{xxs:1.0625,xs:1.125,s:1.25,m:1.5,l:1.75,xl:1.875,xxl:1.9375},$2_:{xxs:2.5,xs:4,s:5,m:7.5,l:10,xl:12,xxl:15},$16_:{xxs:20,xs:28,s:36,m:48,l:64,xl:80,xxl:120},max:150}};function v(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}const y=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},j=()=>{const t=new Set,s=new Map;return{use(e,r){const n=s.get(e);return n||(t.add(r),s.set(e,r),r)},useMany(t){return e(t).map((([t,e])=>this.use(e,t)))},getKey:t=>s.get(t),get keys(){return[...t]},get makers(){return Object.fromEntries(s.entries().map((([t,e])=>[e,t])))}}},O=(t,e,s)=>Object.entries(t).reduce(e,s),_=Symbol("noParse"),w=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(_)?`${c=a,c.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`:(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(n=a.startsWith)||void 0===n?void 0:n.call(a,"&"))||(null===(i=a.startsWith)||void 0===i?void 0:i.call(a,"@"))?"":"&")+a+`{${O(e,((t,e)=>t+w(...e,a)),"")}}`;var c},k="@media",S="@container",q="@property",A="@keyframes",E="@layer",P="@scope",z="@supports",C=(t,e)=>{const s=k+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};C.toString=()=>k;const I=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[P+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>I({root:e,limit:t,mode:r})},root:{value:t=>I({root:t,limit:s,mode:r})},both:{value:()=>I({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>I({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>I({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>I({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},N=t=>{const e={cp:1,lay:1,kf:1,cq:1},s=(s,r)=>{const n="string"==typeof r?r:t.name("cq",e.cq++),i=S+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>S;const r=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=q+" "+n;return{k:n,v:`var(${n})`,s:i,r:{[i]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>i}};r.toString=()=>q;const n=s=>{const r=s||t.name("kf",e.kf++),n=A+" "+r;return{k:r,s:n,toString:()=>n}};n.toString=()=>A;const i=s=>{const r=s||t.name("lay",e.lay++),n=E+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>E;i.toString=()=>P;const a=(t="",e=!1)=>{const s=z+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return a.toString=()=>z,{pr:r,kf:n,mq:C,cq:s,lay:i,sc:(t="",e="")=>{const s=P+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:a,keyframes:s=>{const r=t.name("kf",e.kf++),n=A+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:c,fm:l}=t;return{animation:[e,s,n,i,a,c,l,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[_]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,c="--"+t.name("cp",e.cp++),l=`var(${c}${void 0!==a?","+a:""})`,o=q+" "+c;return Object.defineProperties((t=>({[c]:t})),{[o]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>l},[_]:{value:!0}})},scope:I({})}},W=t=>t+"px",K=t=>t+"vh",M=t=>t+"vw",B=t=>t+"vmin",L=t=>t+"vmax",R=t=>t+"rem",V=t=>t+"deg",F=t=>t+"ms",H=t=>t+"%",T=t=>t+"cqw",Z=t=>t+"cqh",D=t=>t+"cqi",G=t=>t+"cqb",J=t=>t+"cqmin",Q=t=>t+"cqmax",U=Object.fromEntries,X=Object.entries,Y=":first-",tt=":last-",et=":only-",st="child",rt=":nth-",nt="of-type",it=rt+st,at=":focus",ct={r:":root",h:":hover",f:at,fv:at+"-visible",a:":active",v:":visited",val:":valid",inv:":invalid",e:":empty",d:":disabled",rq:":required",o:":optional",m:":modal",l:":link",ph:":placeholder",ch:":checked",po:":popover-open",fc:Y+st,lc:tt+st,oc:et+st,odd:it+"(odd)",even:it+"(even)",ft:Y+nt,lt:tt+nt,ot:et+nt,bef:"::before",aft:"::after",bd:"::backdrop"},lt={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:it,ntho:rt+nt,dir:":dir",lang:":lang"},ot="oklch",ht=t=>ot+`(${t})`,ut=t=>ht(`from ${t}`),gt="def",mt=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",gt),c:e("c",gt),h:e("h",gt),a:e("a",gt)},this.merge=t=>new s(Object.assign(this.state,t)),this.l=t=>this.merge({l:e("l",t)}),this.c=t=>this.merge({c:e("c",t)}),this.h=t=>this.merge({h:e("h",t)}),this.a=t=>this.merge({a:e("a",t)}),this.state=Object.assign(this.state,t)}get s(){return this.toString()}toString(){const{l:t,c:e,h:s,a:r}=this.state;return ht(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},pt=(t,e=.1)=>ut(`${t} calc(l + ${e}) c h / alpha)`),dt=(t,e=.1)=>ut(`${t} calc(l - ${e}) c h / alpha)`),bt=(t,e=.1)=>ut(`${t} l c h / calc(alpha + ${e}))`),ft=(t,e=.1)=>ut(`${t} l c h / calc(alpha - ${e}))`),xt=(t,e=.04)=>ut(`${t} l calc(c + ${e}) h / alpha)`),$t=(t,e=.04)=>ut(`${t} l calc(c - ${e}) h / alpha)`),vt=(t,e=30)=>ut(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),yt=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||ot}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,jt=t=>({create:mt(t),oklch:ht,lighten:pt,darken:dt,saturate:xt,desaturate:$t,fadein:bt,fadeout:ft,spin:vt,mix:yt}),Ot="palette",_t=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[_]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(Ot,"l",i,e)} ${t(Ot,"c",i,s)} ${t(Ot,"h",r)} / ${n})`}}return new e},wt="coef",kt=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(wt,this.state.center-4)}get xxs(){return t(wt,this.state.center-3)}get xs(){return t(wt,this.state.center-2)}get s(){return t(wt,this.state.center-1)}get m(){return t(wt,this.state.center)}get l(){return t(wt,this.state.center+1)}get xl(){return t(wt,this.state.center+2)}get xxl(){return t(wt,this.state.center+3)}get max(){return t(wt,this.state.center+4)}get $0_(){return new e({center:4})}get $1_(){return new e({center:12})}get $2_(){return new e({center:20})}get $16_(){return new e({center:28})}get $1(){return new e({center:8})}get $2(){return new e({center:16})}get $16(){return new e({center:24})}get short(){return{s:this.s,m:this.m,l:this.l}}get base(){return Object.assign(Object.assign({xs:this.xs},this.short),{xl:this.xl})}get long(){return Object.assign(Object.assign({xxs:this.xxs},this.base),{xxl:this.xxl})}get full(){return Object.assign(Object.assign({min:this.min},this.long),{max:this.max})}get main(){return{min:this.min,m:this.m,max:this.max}}get sparse(){return{min:this.min,xs:this.xs,m:this.m,xl:this.xl,max:this.max}}}return new e},St=Object.assign,qt=Object.entries,At={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>St(t,e(s+1))),{}),each:(t,e)=>qt(t).reduce(((t,[s,r])=>St(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},Et="width: ",Pt=t=>{const{scope:e,globalKey:s="",bp:r={}}=t,n=e(s).varExp,i=t=>n(...t.split(".")),a=(t=1)=>`calc(${t} * ${i("rtime")})`,c=(t=1)=>`calc(${t} * ${i("rangle")})`,l=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const o=e(t),h=N(o),u=t=>{const e=r[t]||t;return"number"==typeof e?e+"rem":""},g=t=>"min-"+Et+u(t),p=t=>"max-"+Et+u(t),d=(t,e)=>"string"==typeof e?h.cq(t,e):h.mq(t),b=(t,e,s)=>""+d(g(t)+") and ("+p(e),s),f={up:(t,e)=>""+d(g(t),e),down:(t,e)=>""+d(p(t),e),between:b,only:(t,e)=>b(t,t,e)};return x=s(Object.assign(At,{key:t,vars:i,size:l,time:a,angle:c,bem:o.selector,pseudo:Object.assign(U(X(ct).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),U(X(lt).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:jt(n),palette:_t(n),coef:kt(n),units:{px:W,vh:K,vw:M,vmin:B,vmax:L,rem:R,deg:V,ms:F,pc:H,cqw:T,cqh:Z,cqb:G,cqi:D,cqmin:J,cqmax:Q},at:h,limit:f,merge:m})),O(x,((t,e)=>t+w(...e)),"");var x}}};const zt="theme",Ct="size",It="time",Nt="angle",Wt="palette",Kt=Object.assign,Mt=Object.entries,Bt=Object.fromEntries,Lt=(t,e)=>t.getAttribute(e)||b[e],Rt=(t,e)=>{const s=Lt(t,e);return null!==s?Number(s):null},Vt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Ft=t=>`:root:has(script[is=${d}]${t?`[${t}]`:""})`,Ht=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],Tt=["xs","s","m","l","xl"],Zt=["pale","base","rich"];!function(t={}){const s=window.document,a=window.customElements;if(null==a?void 0:a.get(d))return!1;{class p extends HTMLScriptElement{constructor(){super(...arguments),this._c=j(),this._m=function(){let t={},e={},s=[],r=[];const n=(t,e)=>(e.toString=()=>"effcss-"+t,e),i=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...s]},a=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(i(s),t.push(e)),t}),[])},c=t=>s.findIndex((e=>e===t)),l=e=>e?t[e]:void 0,o=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},h=t=>{const e=l(t);return!!e&&-1!==c(e)};return{apply:i,notify:a,getIndex:c,get:l,has:t=>!!t&&!!l(t),getAll:()=>t,add:o,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=l(e);return!(!r||h(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=l(e);if(r&&h(e)){const e=c(r);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:r=>{const n=l(r);if(!n)return;const i=c(n);return i>-1&&(s.splice(i,1),delete t[r],delete e[r]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=n(e,r),!!r.cssRules.length&&o(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),a(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),i(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._settings=$,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base),r=t=>s("",t);function n(t,e){return Mt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?Kt(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=Bt(Mt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:c,light:l}=i,o=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]])}return s}(i,["","dark","light"]),h=this.size,u=this.time,g=this.angle,{l:m,c:p,h:d}=this._settings.palette,b=this._settings.coef,f=[0,...Ht(b.$0_),1,...Ht(b.$1_),2,...Ht(b.$2_),16,...Ht(b.$16_),b.max];this._=({bem:t,each:e,when:n,vars:c,merge:l,at:{mq:b},units:{px:x,ms:$,deg:v}})=>{const y="prefers-color-scheme",j={light:`${y}: light`,dark:`${y}: dark`};return l({[Ft()]:l({fontSize:c("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(d,((t,e)=>({[s(Wt,"h",t)]:e}))),{[s(Wt,"c","bg","gray")]:0,[s(Wt,"c","fg","gray")]:0},e(j,((t,r)=>({[b(r).s]:l(i[t]||{},e(Tt,((e,r)=>({[s(Wt,"l","bg",r)]:m[t].bg[r],[s(Wt,"l","fg",r)]:m[t].fg[r]}))),e(Zt,((e,r)=>({[s(Wt,"c","bg",r)]:p[t].bg[r],[s(Wt,"c","fg",r)]:p[t].fg[r]}))))}))))},e(o,((e,s)=>({[Ft(`${zt}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!h,{[Ft(Ct)]:{[r("rem")]:x(h)}}),n(!!u,{[Ft(It)]:{[r("rtime")]:$(u)}}),n(!!g,{[Ft(Nt)]:{[r("rangle")]:v(g)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let n=this._c.use(t,r);return(s||this._m&&!this._m.has(e))&&this._m.pack(n,this.css(t,n)),e||this._k.next(),this.resolve(n)},this.usePublic=t=>Bt(Mt(t).map((([t,e])=>[t,this.use(e,t)]))),this.usePrivate=t=>t.map((t=>this.use(t))),this.resolve=t=>this._s(t||this._k.base).attr,this.css=(t,e)=>this._p.compile({key:e,maker:t}),this.status=t=>{const e=this.key(t);return!!e&&this._m.status(e)},this.on=(...t)=>this._m.on(...t.map(this.key)),this.off=(...t)=>this._m.off(...t.map(this.key)),this.key=t=>"string"==typeof t?t:this._c.getKey(t),this.stylesheets=(t=this._c.keys)=>t.map((t=>this._m.get(this.key(t))))}static get observedAttributes(){return[Ct,It,Nt]}get prefix(){return Lt(this,"prefix")||""}get mode(){return Lt(this,"mode")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=m({},this._settings,t),{makers:i,bp:a,off:c}=n;(a&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==a||!this._p)&&(this._p=Pt({scope:this._s,globalKey:this._k.base,bp:a})),i&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==i&&(this._c.useMany(i),this.usePublic(i),(null==c?void 0:c.length)&&this._settings.off!==c&&this.off(...c),this.hydrate&&this._k.reset()),this._settings=n,(!(null===(r=this._m)||void 0===r?void 0:r.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}get makers(){return this._c.makers}set theme(t){Vt(this,zt,t)}get theme(){return Lt(this,zt)||""}set size(t){Vt(this,Ct,t)}get size(){return Rt(this,Ct)}set time(t){Vt(this,"time",t)}get time(){return Rt(this,It)}set angle(t){Vt(this,"angle",t)}get angle(){return Rt(this,Nt)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=y({prefix:this.prefix}),this._s=((t={})=>{const{mode:s}=t;let a,m;return t=>{const p=(...e)=>""+e.filter(Boolean).reduce(((t,e)=>`${t}-${e}`),t),d=(...t)=>"--"+p(...t);return"c"===s?(a=t=>{let e,s,r,n;return i(t)?([e,s,r,n]=l(t),u(p(e),s,r,n)):t&&o(t).map((([t,e,s,r])=>u(p(t),e,s,r))).join(",")},m=t=>{if(void 0===t)return v(m);let e,s,n,a;const c="class";let u="";return Array.isArray(t)?u=[...t.reduce(((t,r)=>([e,s,n,a]=l(r),t.add(h(p(e),s)),n&&t.add(h(p(e),s,n,a)),t)),new Set).values()].join(" "):i(t)?([e,s,n,a]=l(t),u=h(p(e),s,n,a)):u=t&&o(t,!0).map((([t,e,s,r])=>h(p(t),e,s,r))).join(" "),r({[c]:u},{toString:{value:()=>`${c}="${u}"`}})}):(a=t=>{let e,s,r,n;return i(t)?([e,s,r,n]=l(t),g(p(e),s,r,n)):t&&o(t).map((([t,e,s,r])=>g(p(t),e,s,r))).join(",")},m=t=>{if(void 0===t)return v(m);let s,a,h,u,g,d,b="";if(Array.isArray(t))d=t.reduce(((t,e)=>{[s,a,h,u]=l(e);const r=c(p(s),a);return g=n(r),b=h?u?`${h}_${u}`:`${h}`:"",t[g]&&b?t[g]=t[g]+" "+b:t[g]=b,t}),{});else if(i(t)){[s,a,h,u]=l(t);const e=c(p(s),a);g=n(e),b=h?u?`${h}_${u}`:`${h}`:"",d={[g]:b}}else d=t&&o(t,!0).reduce(((t,[e,s,r,i])=>{const a=c(p(e),s);g=n(a);const l=r?i?`${r}_${i}`:`${r}`:"";return b=t[g]?t[g]+" "+l:l,t[g]=b,t}),{});return r(d,{toString:{value:()=>e(d).map((([t,e])=>`${t}="${e}"`)).join(" ")}}),d}),{selector:a,attr:m,name:p,varName:d,varExp:(...t)=>`var(${d(...t)})`}}})({mode:this.mode});const a=this;this._n={set adoptedStyleSheets(t){a.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(s),this.settings=t}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}a.define(d,p,{extends:"script"})}}();
7
+ "function"==typeof SuppressedError&&SuppressedError;const t=void 0,e=Object.entries,s=Array.isArray,r=Object.defineProperties,n=t=>`data-${t}`,i=t=>"string"==typeof t,a=t=>null!==t&&"object"==typeof t,c=(t,e)=>`${t}${e?"__"+e:""}`,l=t=>t.split("."),o=(s,r)=>e(s).reduce(((s,[n,i])=>{if(a(i)){const c=e(i);c.length?s.push(...c.reduce(((s,[i,c])=>{if((e=>null!==e&&e!==t)(i)&&r&&s.push([n,i,t,t]),a(c)){const t=e(c);t.length&&s.push(...t.reduce(((t,[e,s])=>{const r=typeof s;return"string"!==r&&"number"!==r||t.push([n,i,e,s]),t}),[]))}return s}),[])):s.push([n,t,t,t])}return s}),[]),h=(t,e,s,r)=>""+(c(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),u=(t,e,s,r)=>"."+h(t,e,s,r),g=(t,e,s,r)=>`[${n(c(t,e))}${s&&r?`~="${s}_${r}"`:s?`~="${s}"`:""}]`,m=(t,...r)=>r.length?r.reduce(((t,r)=>(e(r).forEach((([e,r])=>{r&&"object"==typeof r&&t[e]?s(t[e])&&s(r)?t[e]=[...t[e],...r]:m(t[e],r||{}):t[e]=r})),t)),t):t,p={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},d="effcss-provider",b={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null},f=t=>Number((.1*184+.9*t).toFixed(2)),x={l:{dark:{bg:{xl:.24,l:.3,m:.36,s:.42,xs:.48},fg:{xl:.98,l:.93,m:.86,s:.79,xs:.72}},light:{bg:{xl:.98,l:.93,m:.88,s:.83,xs:.78},fg:{xl:0,l:.12,m:.24,s:.36,xs:.48}}},c:{dark:{bg:{pale:.02,base:.06,rich:.1},fg:{pale:.06,base:.1,rich:.14}},light:{bg:{pale:.01,base:.04,rich:.7},fg:{pale:.07,base:.11,rich:.15}}},h:{pri:184,sec:290,suc:f(142),inf:f(264),war:f(109),dan:f(29)}},$={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",rangle:"30deg",l:p,h:{def:261.35,b:261.35,i:194.77,e:29.23,w:70.66,s:142.49},c:{def:.03,xs:.03,s:.06,m:.1,l:.15,xl:.25},a:{def:1,min:0,xs:.1,s:.25,m:.5,l:.75,xl:.9,max:1},t:{def:300,xs:100,s:200,m:300,l:450,xl:600,no:0,min:50,max:750},int:[...Array(12).keys()],fr:{0:0,"1/12":"0.0833","1/10":"0.1","1/6":"0.1667","1/5":"0.2","1/4":"0.25","3/10":"0.3","1/3":"0.3333","2/5":"0.4","5/12":"0.4167","1/2":"0.5","7/12":"0.5833","3/5":"0.6","2/3":"0.6667","7/10":"0.7","3/4":"0.75","4/5":"0.8","5/6":"0.8333","9/10":"0.9","11/12":"0.9167",1:"1"},ar:{1:1,"2/1":2,"1/2":.5,"4/3":1.3333,"3/4":.75,"9/16":.5625,"16/9":1.7778}},light:{l:p},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:x,coef:{$0_:{xxs:.0625,xs:.125,s:.25,m:.5,l:.75,xl:.875,xxl:.9375},$1_:{xxs:1.0625,xs:1.125,s:1.25,m:1.5,l:1.75,xl:1.875,xxl:1.9375},$2_:{xxs:2.5,xs:4,s:5,m:7.5,l:10,xl:12,xxl:15},$16_:{xxs:20,xs:28,s:36,m:48,l:64,xl:80,xxl:120},max:150}};function v(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}const j=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},y=()=>{const t=new Set,s=new Map;return{use(e,r){const n=s.get(e);return n||(t.add(r),s.set(e,r),r)},useMany(t){return e(t).map((([t,e])=>this.use(e,t)))},getKey:t=>s.get(t),get keys(){return[...t]},get makers(){return Object.fromEntries(s.entries().map((([t,e])=>[e,t])))}}},O=(t,e,s)=>Object.entries(t).reduce(e,s),_=Symbol("noParse"),w=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(_)?`${c=a,c.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`:(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(n=a.startsWith)||void 0===n?void 0:n.call(a,"&"))||(null===(i=a.startsWith)||void 0===i?void 0:i.call(a,"@"))?"":"&")+a+`{${O(e,((t,e)=>t+w(...e,a)),"")}}`;var c},k="@media",S="@container",q="@property",A="@keyframes",E="@layer",P="@scope",z="@supports",C=(t,e)=>{const s=k+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};C.toString=()=>k;const W=new Set(["screen","all","print"]),I=t=>`(${t})`,N=t=>{const{type:e,or:s=[],and:r=[],not:n=!1}=t,i=()=>{const t=[],i=[];e&&i.push(e),r&&i.push(...r),i.length&&t.push(i),s&&t.push(...s);let a=t.map((t=>Array.isArray(t)?t.map((t=>{const e=t+"";return W.has(e)||2===e.split("(").length&&!e.startsWith("not")?e:I(e)})).join(" and "):t)).join(",");return n&&(a="not "+(a.includes(" and ")||a.includes(",")?I(a):a)),a};return Object.defineProperties((t=>{const e=i();return{[`${k}${e?" "+e:""}`]:t}}),{all:{get:()=>N(Object.assign(Object.assign({},t),{type:"all"}))},print:{get:()=>N(Object.assign(Object.assign({},t),{type:"print"}))},screen:{get:()=>N(Object.assign(Object.assign({},t),{type:"screen"}))},and:{value:(...e)=>N(Object.assign(Object.assign({},t),{and:[...r,...e]}))},or:{value:(...e)=>N(Object.assign(Object.assign({},t),{or:[...s,...e]}))},not:{get:()=>N(Object.assign(Object.assign({},t),{not:!n}))},toString:{value:i}})},K=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[P+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>K({root:e,limit:t,mode:r})},root:{value:t=>K({root:t,limit:s,mode:r})},both:{value:()=>K({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>K({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>K({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>K({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},M=t=>{const e={cp:1,lay:1,kf:1,cq:1},s=(s,r)=>{const n="string"==typeof r?r:t.name("cq",e.cq++),i=S+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>S;const r=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=q+" "+n;return{k:n,v:`var(${n})`,s:i,r:{[i]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>i}};r.toString=()=>q;const n=s=>{const r=s||t.name("kf",e.kf++),n=A+" "+r;return{k:r,s:n,toString:()=>n}};n.toString=()=>A;const i=s=>{const r=s||t.name("lay",e.lay++),n=E+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>E;i.toString=()=>P;const a=(t="",e=!1)=>{const s=z+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return a.toString=()=>z,{pr:r,kf:n,mq:C,cq:s,lay:i,sc:(t="",e="")=>{const s=P+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:a,keyframes:s=>{const r=t.name("kf",e.kf++),n=A+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:c,fm:l}=t;return{animation:[e,s,n,i,a,c,l,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[_]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,c="--"+t.name("cp",e.cp++),l=`var(${c}${void 0!==a?","+a:""})`,o=q+" "+c;return Object.defineProperties((t=>({[c]:t})),{[o]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>l},[_]:{value:!0}})},scope:K({}),media:N({})}},B=t=>t+"px",L=t=>t+"vh",R=t=>t+"vw",V=t=>t+"vmin",F=t=>t+"vmax",H=t=>t+"rem",T=t=>t+"deg",Z=t=>t+"ms",D=t=>t+"%",G=t=>t+"cqw",J=t=>t+"cqh",Q=t=>t+"cqi",U=t=>t+"cqb",X=t=>t+"cqmin",Y=t=>t+"cqmax",tt=Object.fromEntries,et=Object.entries,st=":first-",rt=":last-",nt=":only-",it="child",at=":nth-",ct="of-type",lt=at+it,ot=":focus",ht={r:":root",h:":hover",f:ot,fv:ot+"-visible",a:":active",v:":visited",val:":valid",inv:":invalid",e:":empty",d:":disabled",rq:":required",o:":optional",m:":modal",l:":link",ph:":placeholder",ch:":checked",po:":popover-open",fc:st+it,lc:rt+it,oc:nt+it,odd:lt+"(odd)",even:lt+"(even)",ft:st+ct,lt:rt+ct,ot:nt+ct,bef:"::before",aft:"::after",bd:"::backdrop"},ut={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:lt,ntho:at+ct,dir:":dir",lang:":lang"},gt="oklch",mt=t=>gt+`(${t})`,pt=t=>mt(`from ${t}`),dt="def",bt=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",dt),c:e("c",dt),h:e("h",dt),a:e("a",dt)},this.merge=t=>new s(Object.assign(this.state,t)),this.l=t=>this.merge({l:e("l",t)}),this.c=t=>this.merge({c:e("c",t)}),this.h=t=>this.merge({h:e("h",t)}),this.a=t=>this.merge({a:e("a",t)}),this.state=Object.assign(this.state,t)}get s(){return this.toString()}toString(){const{l:t,c:e,h:s,a:r}=this.state;return mt(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},ft=(t,e=.1)=>pt(`${t} calc(l + ${e}) c h / alpha)`),xt=(t,e=.1)=>pt(`${t} calc(l - ${e}) c h / alpha)`),$t=(t,e=.1)=>pt(`${t} l c h / calc(alpha + ${e}))`),vt=(t,e=.1)=>pt(`${t} l c h / calc(alpha - ${e}))`),jt=(t,e=.04)=>pt(`${t} l calc(c + ${e}) h / alpha)`),yt=(t,e=.04)=>pt(`${t} l calc(c - ${e}) h / alpha)`),Ot=(t,e=30)=>pt(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),_t=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||gt}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,wt=t=>({create:bt(t),oklch:mt,lighten:ft,darken:xt,saturate:jt,desaturate:yt,fadein:$t,fadeout:vt,spin:Ot,mix:_t}),kt="palette",St=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[_]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(kt,"l",i,e)} ${t(kt,"c",i,s)} ${t(kt,"h",r)} / ${n})`}}return new e},qt="coef",At=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(qt,this.state.center-4)}get xxs(){return t(qt,this.state.center-3)}get xs(){return t(qt,this.state.center-2)}get s(){return t(qt,this.state.center-1)}get m(){return t(qt,this.state.center)}get l(){return t(qt,this.state.center+1)}get xl(){return t(qt,this.state.center+2)}get xxl(){return t(qt,this.state.center+3)}get max(){return t(qt,this.state.center+4)}get $0_(){return new e({center:4})}get $1_(){return new e({center:12})}get $2_(){return new e({center:20})}get $16_(){return new e({center:28})}get $1(){return new e({center:8})}get $2(){return new e({center:16})}get $16(){return new e({center:24})}get short(){return{s:this.s,m:this.m,l:this.l}}get base(){return Object.assign(Object.assign({xs:this.xs},this.short),{xl:this.xl})}get long(){return Object.assign(Object.assign({xxs:this.xxs},this.base),{xxl:this.xxl})}get full(){return Object.assign(Object.assign({min:this.min},this.long),{max:this.max})}get main(){return{min:this.min,m:this.m,max:this.max}}get sparse(){return{min:this.min,xs:this.xs,m:this.m,xl:this.xl,max:this.max}}}return new e},Et=Object.assign,Pt=Object.entries,zt={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>Et(t,e(s+1))),{}),each:(t,e)=>Pt(t).reduce(((t,[s,r])=>Et(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},Ct="width: ",Wt=t=>{const{scope:e,globalKey:s="",bp:r={}}=t,n=e(s).varExp,i=t=>n(...t.split(".")),a=(t=1)=>`calc(${t} * ${i("rtime")})`,c=(t=1)=>`calc(${t} * ${i("rangle")})`,l=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const o=e(t),h=M(o),u=t=>{const e=r[t]||t;return"number"==typeof e?e+"rem":""},g=t=>"min-"+Ct+u(t),p=t=>"max-"+Ct+u(t),d=(t,e)=>"string"==typeof e?h.cq(t,e):h.mq(t),b=(t,e,s)=>""+d(g(t)+") and ("+p(e),s),f={up:(t,e)=>""+d(g(t),e),down:(t,e)=>""+d(p(t),e),between:b,only:(t,e)=>b(t,t,e)};return x=s(Object.assign(zt,{key:t,vars:i,size:l,time:a,angle:c,bem:o.selector,pseudo:Object.assign(tt(et(ht).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),tt(et(ut).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:wt(n),palette:St(n),coef:At(n),units:{px:B,vh:L,vw:R,vmin:V,vmax:F,rem:H,deg:T,ms:Z,pc:D,cqw:G,cqh:J,cqb:U,cqi:Q,cqmin:X,cqmax:Y},at:h,limit:f,merge:m})),O(x,((t,e)=>t+w(...e)),"");var x}}};const It="theme",Nt="size",Kt="time",Mt="angle",Bt="palette",Lt=Object.assign,Rt=Object.entries,Vt=Object.fromEntries,Ft=(t,e)=>t.getAttribute(e)||b[e],Ht=(t,e)=>{const s=Ft(t,e);return null!==s?Number(s):null},Tt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Zt=t=>`:root:has(script[is=${d}]${t?`[${t}]`:""})`,Dt=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],Gt=["xs","s","m","l","xl"],Jt=["pale","base","rich"];!function(t={}){const s=window.document,a=window.customElements;if(null==a?void 0:a.get(d))return!1;{class p extends HTMLScriptElement{constructor(){super(...arguments),this._c=y(),this._m=function(){let t={},e={},s=[],r=[];const n=(t,e)=>(e.toString=()=>"effcss-"+t,e),i=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...s]},a=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(i(s),t.push(e)),t}),[])},c=t=>s.findIndex((e=>e===t)),l=e=>e?t[e]:void 0,o=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},h=t=>{const e=l(t);return!!e&&-1!==c(e)};return{apply:i,notify:a,getIndex:c,get:l,has:t=>!!t&&!!l(t),getAll:()=>t,add:o,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=l(e);return!(!r||h(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=l(e);if(r&&h(e)){const e=c(r);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:r=>{const n=l(r);if(!n)return;const i=c(n);return i>-1&&(s.splice(i,1),delete t[r],delete e[r]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=n(e,r),!!r.cssRules.length&&o(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),a(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),i(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._settings=$,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base),r=t=>s("",t);function n(t,e){return Rt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?Lt(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=Vt(Rt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:c,light:l}=i,o=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]])}return s}(i,["","dark","light"]),h=this.size,u=this.time,g=this.angle,{l:m,c:p,h:d}=this._settings.palette,b=this._settings.coef,f=[0,...Dt(b.$0_),1,...Dt(b.$1_),2,...Dt(b.$2_),16,...Dt(b.$16_),b.max];this._=({bem:t,each:e,when:n,vars:c,merge:l,at:{media:b},units:{px:x,ms:$,deg:v}})=>{const j="prefers-color-scheme",y={light:`${j}: light`,dark:`${j}: dark`};return l({[Zt()]:l({fontSize:c("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(d,((t,e)=>({[s(Bt,"h",t)]:e}))),{[s(Bt,"c","bg","gray")]:0,[s(Bt,"c","fg","gray")]:0},e(y,((t,r)=>b.and(r)(l(i[t]||{},e(Gt,((e,r)=>({[s(Bt,"l","bg",r)]:m[t].bg[r],[s(Bt,"l","fg",r)]:m[t].fg[r]}))),e(Jt,((e,r)=>({[s(Bt,"c","bg",r)]:p[t].bg[r],[s(Bt,"c","fg",r)]:p[t].fg[r]}))))))))},e(o,((e,s)=>({[Zt(`${It}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!h,{[Zt(Nt)]:{[r("rem")]:x(h)}}),n(!!u,{[Zt(Kt)]:{[r("rtime")]:$(u)}}),n(!!g,{[Zt(Mt)]:{[r("rangle")]:v(g)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let n=this._c.use(t,r);return(s||this._m&&!this._m.has(e))&&this._m.pack(n,this.css(t,n)),e||this._k.next(),this.resolve(n)},this.usePublic=t=>Vt(Rt(t).map((([t,e])=>[t,this.use(e,t)]))),this.usePrivate=t=>t.map((t=>this.use(t))),this.resolve=t=>this._s(t||this._k.base).attr,this.css=(t,e)=>this._p.compile({key:e,maker:t}),this.status=t=>{const e=this.key(t);return!!e&&this._m.status(e)},this.on=(...t)=>this._m.on(...t.map(this.key)),this.off=(...t)=>this._m.off(...t.map(this.key)),this.key=t=>"string"==typeof t?t:this._c.getKey(t),this.stylesheets=(...t)=>{let e;return e=t.length?1===t.length&&Array.isArray(t[0])?t[0]:t:this._c.keys,e.map((t=>this._m.get(this.key(t))))}}static get observedAttributes(){return[Nt,Kt,Mt]}get prefix(){return Ft(this,"prefix")||""}get mode(){return Ft(this,"mode")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=m({},this._settings,t),{makers:i,bp:a,off:c}=n;(a&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==a||!this._p)&&(this._p=Wt({scope:this._s,globalKey:this._k.base,bp:a})),i&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==i&&(this._c.useMany(i),this.usePublic(i),(null==c?void 0:c.length)&&this._settings.off!==c&&this.off(...c),this.hydrate&&this._k.reset()),this._settings=n,(!(null===(r=this._m)||void 0===r?void 0:r.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}get makers(){return this._c.makers}set theme(t){Tt(this,It,t)}get theme(){return Ft(this,It)||""}set size(t){Tt(this,Nt,t)}get size(){return Ht(this,Nt)}set time(t){Tt(this,"time",t)}get time(){return Ht(this,Kt)}set angle(t){Tt(this,"angle",t)}get angle(){return Ht(this,Mt)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=j({prefix:this.prefix}),this._s=((t={})=>{const{mode:s}=t;let a,m;return t=>{const p=(...e)=>""+e.filter(Boolean).reduce(((t,e)=>`${t}-${e}`),t),d=(...t)=>"--"+p(...t);return"c"===s?(a=t=>{let e,s,r,n;return i(t)?([e,s,r,n]=l(t),u(p(e),s,r,n)):t&&o(t).map((([t,e,s,r])=>u(p(t),e,s,r))).join(",")},m=t=>{if(void 0===t)return v(m);let e,s,n,a;const c="class";let u="";return Array.isArray(t)?u=[...t.reduce(((t,r)=>([e,s,n,a]=l(r),t.add(h(p(e),s)),n&&t.add(h(p(e),s,n,a)),t)),new Set).values()].join(" "):i(t)?([e,s,n,a]=l(t),u=h(p(e),s,n,a)):u=t&&o(t,!0).map((([t,e,s,r])=>h(p(t),e,s,r))).join(" "),r({[c]:u},{toString:{value:()=>`${c}="${u}"`}})}):(a=t=>{let e,s,r,n;return i(t)?([e,s,r,n]=l(t),g(p(e),s,r,n)):t&&o(t).map((([t,e,s,r])=>g(p(t),e,s,r))).join(",")},m=t=>{if(void 0===t)return v(m);let s,a,h,u,g,d,b="";if(Array.isArray(t))d=t.reduce(((t,e)=>{[s,a,h,u]=l(e);const r=c(p(s),a);return g=n(r),b=h?u?`${h}_${u}`:`${h}`:"",t[g]&&b?t[g]=t[g]+" "+b:t[g]=b,t}),{});else if(i(t)){[s,a,h,u]=l(t);const e=c(p(s),a);g=n(e),b=h?u?`${h}_${u}`:`${h}`:"",d={[g]:b}}else d=t&&o(t,!0).reduce(((t,[e,s,r,i])=>{const a=c(p(e),s);g=n(a);const l=r?i?`${r}_${i}`:`${r}`:"";return b=t[g]?t[g]+" "+l:l,t[g]=b,t}),{});return r(d,{toString:{value:()=>e(d).map((([t,e])=>`${t}="${e}"`)).join(" ")}}),d}),{selector:a,attr:m,name:p,varName:d,varExp:(...t)=>`var(${d(...t)})`}}})({mode:this.mode});const a=this;this._n={set adoptedStyleSheets(t){a.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(s),this.settings=t}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}a.define(d,p,{extends:"script"})}}();
package/dist/consumer.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * EffCSS v3.7.0
2
+ * EffCSS v3.8.0
3
3
  * {@link https://gitverse.ru/msabitov/effcss}
4
4
  * Copyright (c) Marat Sabitov
5
5
  * @license Apache-2.0
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * EffCSS v3.7.0
2
+ * EffCSS v3.8.0
3
3
  * {@link https://gitverse.ru/msabitov/effcss}
4
4
  * Copyright (c) Marat Sabitov
5
5
  * @license Apache-2.0
6
6
  */
7
- "function"==typeof SuppressedError&&SuppressedError;const t=void 0,e=Object.entries,s=Array.isArray,r=Object.defineProperties,n=t=>`data-${t}`,i=t=>"string"==typeof t,a=t=>null!==t&&"object"==typeof t,c=(t,e)=>`${t}${e?"__"+e:""}`,l=t=>t.split("."),o=(s,r)=>e(s).reduce(((s,[n,i])=>{if(a(i)){const c=e(i);c.length?s.push(...c.reduce(((s,[i,c])=>{if((e=>null!==e&&e!==t)(i)&&r&&s.push([n,i,t,t]),a(c)){const t=e(c);t.length&&s.push(...t.reduce(((t,[e,s])=>{const r=typeof s;return"string"!==r&&"number"!==r||t.push([n,i,e,s]),t}),[]))}return s}),[])):s.push([n,t,t,t])}return s}),[]),h=(t,e,s,r)=>""+(c(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),u=(t,e,s,r)=>"."+h(t,e,s,r),g=(t,e,s,r)=>`[${n(c(t,e))}${s&&r?`~="${s}_${r}"`:s?`~="${s}"`:""}]`,m=(t,...r)=>r.length?r.reduce(((t,r)=>(e(r).forEach((([e,r])=>{r&&"object"==typeof r&&t[e]?s(t[e])&&s(r)?t[e]=[...t[e],...r]:m(t[e],r||{}):t[e]=r})),t)),t):t,p={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},d="effcss-provider",b={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null},f=t=>Number((.1*184+.9*t).toFixed(2)),x={l:{dark:{bg:{xl:.24,l:.3,m:.36,s:.42,xs:.48},fg:{xl:.98,l:.93,m:.86,s:.79,xs:.72}},light:{bg:{xl:.98,l:.93,m:.88,s:.83,xs:.78},fg:{xl:0,l:.12,m:.24,s:.36,xs:.48}}},c:{dark:{bg:{pale:.02,base:.06,rich:.1},fg:{pale:.06,base:.1,rich:.14}},light:{bg:{pale:.01,base:.04,rich:.7},fg:{pale:.07,base:.11,rich:.15}}},h:{pri:184,sec:290,suc:f(142),inf:f(264),war:f(109),dan:f(29)}},$={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",rangle:"30deg",l:p,h:{def:261.35,b:261.35,i:194.77,e:29.23,w:70.66,s:142.49},c:{def:.03,xs:.03,s:.06,m:.1,l:.15,xl:.25},a:{def:1,min:0,xs:.1,s:.25,m:.5,l:.75,xl:.9,max:1},t:{def:300,xs:100,s:200,m:300,l:450,xl:600,no:0,min:50,max:750},int:[...Array(12).keys()],fr:{0:0,"1/12":"0.0833","1/10":"0.1","1/6":"0.1667","1/5":"0.2","1/4":"0.25","3/10":"0.3","1/3":"0.3333","2/5":"0.4","5/12":"0.4167","1/2":"0.5","7/12":"0.5833","3/5":"0.6","2/3":"0.6667","7/10":"0.7","3/4":"0.75","4/5":"0.8","5/6":"0.8333","9/10":"0.9","11/12":"0.9167",1:"1"},ar:{1:1,"2/1":2,"1/2":.5,"4/3":1.3333,"3/4":.75,"9/16":.5625,"16/9":1.7778}},light:{l:p},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:x,coef:{$0_:{xxs:.0625,xs:.125,s:.25,m:.5,l:.75,xl:.875,xxl:.9375},$1_:{xxs:1.0625,xs:1.125,s:1.25,m:1.5,l:1.75,xl:1.875,xxl:1.9375},$2_:{xxs:2.5,xs:4,s:5,m:7.5,l:10,xl:12,xxl:15},$16_:{xxs:20,xs:28,s:36,m:48,l:64,xl:80,xxl:120},max:150}};function v(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}const y=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},j=()=>{const t=new Set,s=new Map;return{use(e,r){const n=s.get(e);return n||(t.add(r),s.set(e,r),r)},useMany(t){return e(t).map((([t,e])=>this.use(e,t)))},getKey:t=>s.get(t),get keys(){return[...t]},get makers(){return Object.fromEntries(s.entries().map((([t,e])=>[e,t])))}}},O=(t,e,s)=>Object.entries(t).reduce(e,s),_=Symbol("noParse"),w=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(_)?`${c=a,c.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`:(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(n=a.startsWith)||void 0===n?void 0:n.call(a,"&"))||(null===(i=a.startsWith)||void 0===i?void 0:i.call(a,"@"))?"":"&")+a+`{${O(e,((t,e)=>t+w(...e,a)),"")}}`;var c},k="@media",S="@container",q="@property",A="@keyframes",E="@layer",P="@scope",z="@supports",C=(t,e)=>{const s=k+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};C.toString=()=>k;const I=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[P+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>I({root:e,limit:t,mode:r})},root:{value:t=>I({root:t,limit:s,mode:r})},both:{value:()=>I({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>I({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>I({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>I({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},N=t=>{const e={cp:1,lay:1,kf:1,cq:1},s=(s,r)=>{const n="string"==typeof r?r:t.name("cq",e.cq++),i=S+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>S;const r=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=q+" "+n;return{k:n,v:`var(${n})`,s:i,r:{[i]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>i}};r.toString=()=>q;const n=s=>{const r=s||t.name("kf",e.kf++),n=A+" "+r;return{k:r,s:n,toString:()=>n}};n.toString=()=>A;const i=s=>{const r=s||t.name("lay",e.lay++),n=E+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>E;i.toString=()=>P;const a=(t="",e=!1)=>{const s=z+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return a.toString=()=>z,{pr:r,kf:n,mq:C,cq:s,lay:i,sc:(t="",e="")=>{const s=P+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:a,keyframes:s=>{const r=t.name("kf",e.kf++),n=A+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:c,fm:l}=t;return{animation:[e,s,n,i,a,c,l,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[_]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,c="--"+t.name("cp",e.cp++),l=`var(${c}${void 0!==a?","+a:""})`,o=q+" "+c;return Object.defineProperties((t=>({[c]:t})),{[o]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>l},[_]:{value:!0}})},scope:I({})}},W=t=>t+"px",K=t=>t+"vh",M=t=>t+"vw",B=t=>t+"vmin",L=t=>t+"vmax",R=t=>t+"rem",V=t=>t+"deg",F=t=>t+"ms",H=t=>t+"%",T=t=>t+"cqw",Z=t=>t+"cqh",D=t=>t+"cqi",G=t=>t+"cqb",J=t=>t+"cqmin",Q=t=>t+"cqmax",U=Object.fromEntries,X=Object.entries,Y=":first-",tt=":last-",et=":only-",st="child",rt=":nth-",nt="of-type",it=rt+st,at=":focus",ct={r:":root",h:":hover",f:at,fv:at+"-visible",a:":active",v:":visited",val:":valid",inv:":invalid",e:":empty",d:":disabled",rq:":required",o:":optional",m:":modal",l:":link",ph:":placeholder",ch:":checked",po:":popover-open",fc:Y+st,lc:tt+st,oc:et+st,odd:it+"(odd)",even:it+"(even)",ft:Y+nt,lt:tt+nt,ot:et+nt,bef:"::before",aft:"::after",bd:"::backdrop"},lt={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:it,ntho:rt+nt,dir:":dir",lang:":lang"},ot="oklch",ht=t=>ot+`(${t})`,ut=t=>ht(`from ${t}`),gt="def",mt=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",gt),c:e("c",gt),h:e("h",gt),a:e("a",gt)},this.merge=t=>new s(Object.assign(this.state,t)),this.l=t=>this.merge({l:e("l",t)}),this.c=t=>this.merge({c:e("c",t)}),this.h=t=>this.merge({h:e("h",t)}),this.a=t=>this.merge({a:e("a",t)}),this.state=Object.assign(this.state,t)}get s(){return this.toString()}toString(){const{l:t,c:e,h:s,a:r}=this.state;return ht(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},pt=(t,e=.1)=>ut(`${t} calc(l + ${e}) c h / alpha)`),dt=(t,e=.1)=>ut(`${t} calc(l - ${e}) c h / alpha)`),bt=(t,e=.1)=>ut(`${t} l c h / calc(alpha + ${e}))`),ft=(t,e=.1)=>ut(`${t} l c h / calc(alpha - ${e}))`),xt=(t,e=.04)=>ut(`${t} l calc(c + ${e}) h / alpha)`),$t=(t,e=.04)=>ut(`${t} l calc(c - ${e}) h / alpha)`),vt=(t,e=30)=>ut(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),yt=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||ot}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,jt=t=>({create:mt(t),oklch:ht,lighten:pt,darken:dt,saturate:xt,desaturate:$t,fadein:bt,fadeout:ft,spin:vt,mix:yt}),Ot="palette",_t=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[_]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(Ot,"l",i,e)} ${t(Ot,"c",i,s)} ${t(Ot,"h",r)} / ${n})`}}return new e},wt="coef",kt=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(wt,this.state.center-4)}get xxs(){return t(wt,this.state.center-3)}get xs(){return t(wt,this.state.center-2)}get s(){return t(wt,this.state.center-1)}get m(){return t(wt,this.state.center)}get l(){return t(wt,this.state.center+1)}get xl(){return t(wt,this.state.center+2)}get xxl(){return t(wt,this.state.center+3)}get max(){return t(wt,this.state.center+4)}get $0_(){return new e({center:4})}get $1_(){return new e({center:12})}get $2_(){return new e({center:20})}get $16_(){return new e({center:28})}get $1(){return new e({center:8})}get $2(){return new e({center:16})}get $16(){return new e({center:24})}get short(){return{s:this.s,m:this.m,l:this.l}}get base(){return Object.assign(Object.assign({xs:this.xs},this.short),{xl:this.xl})}get long(){return Object.assign(Object.assign({xxs:this.xxs},this.base),{xxl:this.xxl})}get full(){return Object.assign(Object.assign({min:this.min},this.long),{max:this.max})}get main(){return{min:this.min,m:this.m,max:this.max}}get sparse(){return{min:this.min,xs:this.xs,m:this.m,xl:this.xl,max:this.max}}}return new e},St=Object.assign,qt=Object.entries,At={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>St(t,e(s+1))),{}),each:(t,e)=>qt(t).reduce(((t,[s,r])=>St(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},Et="width: ",Pt=t=>{const{scope:e,globalKey:s="",bp:r={}}=t,n=e(s).varExp,i=t=>n(...t.split(".")),a=(t=1)=>`calc(${t} * ${i("rtime")})`,c=(t=1)=>`calc(${t} * ${i("rangle")})`,l=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const o=e(t),h=N(o),u=t=>{const e=r[t]||t;return"number"==typeof e?e+"rem":""},g=t=>"min-"+Et+u(t),p=t=>"max-"+Et+u(t),d=(t,e)=>"string"==typeof e?h.cq(t,e):h.mq(t),b=(t,e,s)=>""+d(g(t)+") and ("+p(e),s),f={up:(t,e)=>""+d(g(t),e),down:(t,e)=>""+d(p(t),e),between:b,only:(t,e)=>b(t,t,e)};return x=s(Object.assign(At,{key:t,vars:i,size:l,time:a,angle:c,bem:o.selector,pseudo:Object.assign(U(X(ct).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),U(X(lt).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:jt(n),palette:_t(n),coef:kt(n),units:{px:W,vh:K,vw:M,vmin:B,vmax:L,rem:R,deg:V,ms:F,pc:H,cqw:T,cqh:Z,cqb:G,cqi:D,cqmin:J,cqmax:Q},at:h,limit:f,merge:m})),O(x,((t,e)=>t+w(...e)),"");var x}}};const zt="theme",Ct="size",It="time",Nt="angle",Wt="palette",Kt=Object.assign,Mt=Object.entries,Bt=Object.fromEntries,Lt=(t,e)=>t.getAttribute(e)||b[e],Rt=(t,e)=>{const s=Lt(t,e);return null!==s?Number(s):null},Vt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Ft=t=>`:root:has(script[is=${d}]${t?`[${t}]`:""})`,Ht=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],Tt=["xs","s","m","l","xl"],Zt=["pale","base","rich"];function Dt(t={}){const s=window.document,a=window.customElements;if(null==a?void 0:a.get(d))return!1;{class p extends HTMLScriptElement{constructor(){super(...arguments),this._c=j(),this._m=function(){let t={},e={},s=[],r=[];const n=(t,e)=>(e.toString=()=>"effcss-"+t,e),i=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...s]},a=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(i(s),t.push(e)),t}),[])},c=t=>s.findIndex((e=>e===t)),l=e=>e?t[e]:void 0,o=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},h=t=>{const e=l(t);return!!e&&-1!==c(e)};return{apply:i,notify:a,getIndex:c,get:l,has:t=>!!t&&!!l(t),getAll:()=>t,add:o,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=l(e);return!(!r||h(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=l(e);if(r&&h(e)){const e=c(r);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:r=>{const n=l(r);if(!n)return;const i=c(n);return i>-1&&(s.splice(i,1),delete t[r],delete e[r]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=n(e,r),!!r.cssRules.length&&o(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),a(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),i(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._settings=$,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base),r=t=>s("",t);function n(t,e){return Mt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?Kt(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=Bt(Mt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:c,light:l}=i,o=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]])}return s}(i,["","dark","light"]),h=this.size,u=this.time,g=this.angle,{l:m,c:p,h:d}=this._settings.palette,b=this._settings.coef,f=[0,...Ht(b.$0_),1,...Ht(b.$1_),2,...Ht(b.$2_),16,...Ht(b.$16_),b.max];this._=({bem:t,each:e,when:n,vars:c,merge:l,at:{mq:b},units:{px:x,ms:$,deg:v}})=>{const y="prefers-color-scheme",j={light:`${y}: light`,dark:`${y}: dark`};return l({[Ft()]:l({fontSize:c("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(d,((t,e)=>({[s(Wt,"h",t)]:e}))),{[s(Wt,"c","bg","gray")]:0,[s(Wt,"c","fg","gray")]:0},e(j,((t,r)=>({[b(r).s]:l(i[t]||{},e(Tt,((e,r)=>({[s(Wt,"l","bg",r)]:m[t].bg[r],[s(Wt,"l","fg",r)]:m[t].fg[r]}))),e(Zt,((e,r)=>({[s(Wt,"c","bg",r)]:p[t].bg[r],[s(Wt,"c","fg",r)]:p[t].fg[r]}))))}))))},e(o,((e,s)=>({[Ft(`${zt}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!h,{[Ft(Ct)]:{[r("rem")]:x(h)}}),n(!!u,{[Ft(It)]:{[r("rtime")]:$(u)}}),n(!!g,{[Ft(Nt)]:{[r("rangle")]:v(g)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let n=this._c.use(t,r);return(s||this._m&&!this._m.has(e))&&this._m.pack(n,this.css(t,n)),e||this._k.next(),this.resolve(n)},this.usePublic=t=>Bt(Mt(t).map((([t,e])=>[t,this.use(e,t)]))),this.usePrivate=t=>t.map((t=>this.use(t))),this.resolve=t=>this._s(t||this._k.base).attr,this.css=(t,e)=>this._p.compile({key:e,maker:t}),this.status=t=>{const e=this.key(t);return!!e&&this._m.status(e)},this.on=(...t)=>this._m.on(...t.map(this.key)),this.off=(...t)=>this._m.off(...t.map(this.key)),this.key=t=>"string"==typeof t?t:this._c.getKey(t),this.stylesheets=(t=this._c.keys)=>t.map((t=>this._m.get(this.key(t))))}static get observedAttributes(){return[Ct,It,Nt]}get prefix(){return Lt(this,"prefix")||""}get mode(){return Lt(this,"mode")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=m({},this._settings,t),{makers:i,bp:a,off:c}=n;(a&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==a||!this._p)&&(this._p=Pt({scope:this._s,globalKey:this._k.base,bp:a})),i&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==i&&(this._c.useMany(i),this.usePublic(i),(null==c?void 0:c.length)&&this._settings.off!==c&&this.off(...c),this.hydrate&&this._k.reset()),this._settings=n,(!(null===(r=this._m)||void 0===r?void 0:r.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}get makers(){return this._c.makers}set theme(t){Vt(this,zt,t)}get theme(){return Lt(this,zt)||""}set size(t){Vt(this,Ct,t)}get size(){return Rt(this,Ct)}set time(t){Vt(this,"time",t)}get time(){return Rt(this,It)}set angle(t){Vt(this,"angle",t)}get angle(){return Rt(this,Nt)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=y({prefix:this.prefix}),this._s=((t={})=>{const{mode:s}=t;let a,m;return t=>{const p=(...e)=>""+e.filter(Boolean).reduce(((t,e)=>`${t}-${e}`),t),d=(...t)=>"--"+p(...t);return"c"===s?(a=t=>{let e,s,r,n;return i(t)?([e,s,r,n]=l(t),u(p(e),s,r,n)):t&&o(t).map((([t,e,s,r])=>u(p(t),e,s,r))).join(",")},m=t=>{if(void 0===t)return v(m);let e,s,n,a;const c="class";let u="";return Array.isArray(t)?u=[...t.reduce(((t,r)=>([e,s,n,a]=l(r),t.add(h(p(e),s)),n&&t.add(h(p(e),s,n,a)),t)),new Set).values()].join(" "):i(t)?([e,s,n,a]=l(t),u=h(p(e),s,n,a)):u=t&&o(t,!0).map((([t,e,s,r])=>h(p(t),e,s,r))).join(" "),r({[c]:u},{toString:{value:()=>`${c}="${u}"`}})}):(a=t=>{let e,s,r,n;return i(t)?([e,s,r,n]=l(t),g(p(e),s,r,n)):t&&o(t).map((([t,e,s,r])=>g(p(t),e,s,r))).join(",")},m=t=>{if(void 0===t)return v(m);let s,a,h,u,g,d,b="";if(Array.isArray(t))d=t.reduce(((t,e)=>{[s,a,h,u]=l(e);const r=c(p(s),a);return g=n(r),b=h?u?`${h}_${u}`:`${h}`:"",t[g]&&b?t[g]=t[g]+" "+b:t[g]=b,t}),{});else if(i(t)){[s,a,h,u]=l(t);const e=c(p(s),a);g=n(e),b=h?u?`${h}_${u}`:`${h}`:"",d={[g]:b}}else d=t&&o(t,!0).reduce(((t,[e,s,r,i])=>{const a=c(p(e),s);g=n(a);const l=r?i?`${r}_${i}`:`${r}`:"";return b=t[g]?t[g]+" "+l:l,t[g]=b,t}),{});return r(d,{toString:{value:()=>e(d).map((([t,e])=>`${t}="${e}"`)).join(" ")}}),d}),{selector:a,attr:m,name:p,varName:d,varExp:(...t)=>`var(${d(...t)})`}}})({mode:this.mode});const a=this;this._n={set adoptedStyleSheets(t){a.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(s),this.settings=t}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}return a.define(d,p,{extends:"script"}),!0}}export{Dt as defineProvider};
7
+ "function"==typeof SuppressedError&&SuppressedError;const t=void 0,e=Object.entries,s=Array.isArray,r=Object.defineProperties,n=t=>`data-${t}`,i=t=>"string"==typeof t,a=t=>null!==t&&"object"==typeof t,c=(t,e)=>`${t}${e?"__"+e:""}`,l=t=>t.split("."),o=(s,r)=>e(s).reduce(((s,[n,i])=>{if(a(i)){const c=e(i);c.length?s.push(...c.reduce(((s,[i,c])=>{if((e=>null!==e&&e!==t)(i)&&r&&s.push([n,i,t,t]),a(c)){const t=e(c);t.length&&s.push(...t.reduce(((t,[e,s])=>{const r=typeof s;return"string"!==r&&"number"!==r||t.push([n,i,e,s]),t}),[]))}return s}),[])):s.push([n,t,t,t])}return s}),[]),h=(t,e,s,r)=>""+(c(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),u=(t,e,s,r)=>"."+h(t,e,s,r),g=(t,e,s,r)=>`[${n(c(t,e))}${s&&r?`~="${s}_${r}"`:s?`~="${s}"`:""}]`,m=(t,...r)=>r.length?r.reduce(((t,r)=>(e(r).forEach((([e,r])=>{r&&"object"==typeof r&&t[e]?s(t[e])&&s(r)?t[e]=[...t[e],...r]:m(t[e],r||{}):t[e]=r})),t)),t):t,p={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},d="effcss-provider",b={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null},f=t=>Number((.1*184+.9*t).toFixed(2)),x={l:{dark:{bg:{xl:.24,l:.3,m:.36,s:.42,xs:.48},fg:{xl:.98,l:.93,m:.86,s:.79,xs:.72}},light:{bg:{xl:.98,l:.93,m:.88,s:.83,xs:.78},fg:{xl:0,l:.12,m:.24,s:.36,xs:.48}}},c:{dark:{bg:{pale:.02,base:.06,rich:.1},fg:{pale:.06,base:.1,rich:.14}},light:{bg:{pale:.01,base:.04,rich:.7},fg:{pale:.07,base:.11,rich:.15}}},h:{pri:184,sec:290,suc:f(142),inf:f(264),war:f(109),dan:f(29)}},$={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",rangle:"30deg",l:p,h:{def:261.35,b:261.35,i:194.77,e:29.23,w:70.66,s:142.49},c:{def:.03,xs:.03,s:.06,m:.1,l:.15,xl:.25},a:{def:1,min:0,xs:.1,s:.25,m:.5,l:.75,xl:.9,max:1},t:{def:300,xs:100,s:200,m:300,l:450,xl:600,no:0,min:50,max:750},int:[...Array(12).keys()],fr:{0:0,"1/12":"0.0833","1/10":"0.1","1/6":"0.1667","1/5":"0.2","1/4":"0.25","3/10":"0.3","1/3":"0.3333","2/5":"0.4","5/12":"0.4167","1/2":"0.5","7/12":"0.5833","3/5":"0.6","2/3":"0.6667","7/10":"0.7","3/4":"0.75","4/5":"0.8","5/6":"0.8333","9/10":"0.9","11/12":"0.9167",1:"1"},ar:{1:1,"2/1":2,"1/2":.5,"4/3":1.3333,"3/4":.75,"9/16":.5625,"16/9":1.7778}},light:{l:p},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:x,coef:{$0_:{xxs:.0625,xs:.125,s:.25,m:.5,l:.75,xl:.875,xxl:.9375},$1_:{xxs:1.0625,xs:1.125,s:1.25,m:1.5,l:1.75,xl:1.875,xxl:1.9375},$2_:{xxs:2.5,xs:4,s:5,m:7.5,l:10,xl:12,xxl:15},$16_:{xxs:20,xs:28,s:36,m:48,l:64,xl:80,xxl:120},max:150}};function v(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}const j=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},y=()=>{const t=new Set,s=new Map;return{use(e,r){const n=s.get(e);return n||(t.add(r),s.set(e,r),r)},useMany(t){return e(t).map((([t,e])=>this.use(e,t)))},getKey:t=>s.get(t),get keys(){return[...t]},get makers(){return Object.fromEntries(s.entries().map((([t,e])=>[e,t])))}}},O=(t,e,s)=>Object.entries(t).reduce(e,s),_=Symbol("noParse"),w=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(_)?`${c=a,c.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`:(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(n=a.startsWith)||void 0===n?void 0:n.call(a,"&"))||(null===(i=a.startsWith)||void 0===i?void 0:i.call(a,"@"))?"":"&")+a+`{${O(e,((t,e)=>t+w(...e,a)),"")}}`;var c},k="@media",S="@container",q="@property",A="@keyframes",E="@layer",P="@scope",z="@supports",C=(t,e)=>{const s=k+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};C.toString=()=>k;const W=new Set(["screen","all","print"]),I=t=>`(${t})`,N=t=>{const{type:e,or:s=[],and:r=[],not:n=!1}=t,i=()=>{const t=[],i=[];e&&i.push(e),r&&i.push(...r),i.length&&t.push(i),s&&t.push(...s);let a=t.map((t=>Array.isArray(t)?t.map((t=>{const e=t+"";return W.has(e)||2===e.split("(").length&&!e.startsWith("not")?e:I(e)})).join(" and "):t)).join(",");return n&&(a="not "+(a.includes(" and ")||a.includes(",")?I(a):a)),a};return Object.defineProperties((t=>{const e=i();return{[`${k}${e?" "+e:""}`]:t}}),{all:{get:()=>N(Object.assign(Object.assign({},t),{type:"all"}))},print:{get:()=>N(Object.assign(Object.assign({},t),{type:"print"}))},screen:{get:()=>N(Object.assign(Object.assign({},t),{type:"screen"}))},and:{value:(...e)=>N(Object.assign(Object.assign({},t),{and:[...r,...e]}))},or:{value:(...e)=>N(Object.assign(Object.assign({},t),{or:[...s,...e]}))},not:{get:()=>N(Object.assign(Object.assign({},t),{not:!n}))},toString:{value:i}})},K=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[P+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>K({root:e,limit:t,mode:r})},root:{value:t=>K({root:t,limit:s,mode:r})},both:{value:()=>K({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>K({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>K({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>K({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},M=t=>{const e={cp:1,lay:1,kf:1,cq:1},s=(s,r)=>{const n="string"==typeof r?r:t.name("cq",e.cq++),i=S+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>S;const r=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=q+" "+n;return{k:n,v:`var(${n})`,s:i,r:{[i]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>i}};r.toString=()=>q;const n=s=>{const r=s||t.name("kf",e.kf++),n=A+" "+r;return{k:r,s:n,toString:()=>n}};n.toString=()=>A;const i=s=>{const r=s||t.name("lay",e.lay++),n=E+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>E;i.toString=()=>P;const a=(t="",e=!1)=>{const s=z+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return a.toString=()=>z,{pr:r,kf:n,mq:C,cq:s,lay:i,sc:(t="",e="")=>{const s=P+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:a,keyframes:s=>{const r=t.name("kf",e.kf++),n=A+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:c,fm:l}=t;return{animation:[e,s,n,i,a,c,l,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[_]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,c="--"+t.name("cp",e.cp++),l=`var(${c}${void 0!==a?","+a:""})`,o=q+" "+c;return Object.defineProperties((t=>({[c]:t})),{[o]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>l},[_]:{value:!0}})},scope:K({}),media:N({})}},B=t=>t+"px",L=t=>t+"vh",R=t=>t+"vw",V=t=>t+"vmin",F=t=>t+"vmax",H=t=>t+"rem",T=t=>t+"deg",Z=t=>t+"ms",D=t=>t+"%",G=t=>t+"cqw",J=t=>t+"cqh",Q=t=>t+"cqi",U=t=>t+"cqb",X=t=>t+"cqmin",Y=t=>t+"cqmax",tt=Object.fromEntries,et=Object.entries,st=":first-",rt=":last-",nt=":only-",it="child",at=":nth-",ct="of-type",lt=at+it,ot=":focus",ht={r:":root",h:":hover",f:ot,fv:ot+"-visible",a:":active",v:":visited",val:":valid",inv:":invalid",e:":empty",d:":disabled",rq:":required",o:":optional",m:":modal",l:":link",ph:":placeholder",ch:":checked",po:":popover-open",fc:st+it,lc:rt+it,oc:nt+it,odd:lt+"(odd)",even:lt+"(even)",ft:st+ct,lt:rt+ct,ot:nt+ct,bef:"::before",aft:"::after",bd:"::backdrop"},ut={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:lt,ntho:at+ct,dir:":dir",lang:":lang"},gt="oklch",mt=t=>gt+`(${t})`,pt=t=>mt(`from ${t}`),dt="def",bt=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",dt),c:e("c",dt),h:e("h",dt),a:e("a",dt)},this.merge=t=>new s(Object.assign(this.state,t)),this.l=t=>this.merge({l:e("l",t)}),this.c=t=>this.merge({c:e("c",t)}),this.h=t=>this.merge({h:e("h",t)}),this.a=t=>this.merge({a:e("a",t)}),this.state=Object.assign(this.state,t)}get s(){return this.toString()}toString(){const{l:t,c:e,h:s,a:r}=this.state;return mt(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},ft=(t,e=.1)=>pt(`${t} calc(l + ${e}) c h / alpha)`),xt=(t,e=.1)=>pt(`${t} calc(l - ${e}) c h / alpha)`),$t=(t,e=.1)=>pt(`${t} l c h / calc(alpha + ${e}))`),vt=(t,e=.1)=>pt(`${t} l c h / calc(alpha - ${e}))`),jt=(t,e=.04)=>pt(`${t} l calc(c + ${e}) h / alpha)`),yt=(t,e=.04)=>pt(`${t} l calc(c - ${e}) h / alpha)`),Ot=(t,e=30)=>pt(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),_t=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||gt}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,wt=t=>({create:bt(t),oklch:mt,lighten:ft,darken:xt,saturate:jt,desaturate:yt,fadein:$t,fadeout:vt,spin:Ot,mix:_t}),kt="palette",St=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[_]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(kt,"l",i,e)} ${t(kt,"c",i,s)} ${t(kt,"h",r)} / ${n})`}}return new e},qt="coef",At=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(qt,this.state.center-4)}get xxs(){return t(qt,this.state.center-3)}get xs(){return t(qt,this.state.center-2)}get s(){return t(qt,this.state.center-1)}get m(){return t(qt,this.state.center)}get l(){return t(qt,this.state.center+1)}get xl(){return t(qt,this.state.center+2)}get xxl(){return t(qt,this.state.center+3)}get max(){return t(qt,this.state.center+4)}get $0_(){return new e({center:4})}get $1_(){return new e({center:12})}get $2_(){return new e({center:20})}get $16_(){return new e({center:28})}get $1(){return new e({center:8})}get $2(){return new e({center:16})}get $16(){return new e({center:24})}get short(){return{s:this.s,m:this.m,l:this.l}}get base(){return Object.assign(Object.assign({xs:this.xs},this.short),{xl:this.xl})}get long(){return Object.assign(Object.assign({xxs:this.xxs},this.base),{xxl:this.xxl})}get full(){return Object.assign(Object.assign({min:this.min},this.long),{max:this.max})}get main(){return{min:this.min,m:this.m,max:this.max}}get sparse(){return{min:this.min,xs:this.xs,m:this.m,xl:this.xl,max:this.max}}}return new e},Et=Object.assign,Pt=Object.entries,zt={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>Et(t,e(s+1))),{}),each:(t,e)=>Pt(t).reduce(((t,[s,r])=>Et(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},Ct="width: ",Wt=t=>{const{scope:e,globalKey:s="",bp:r={}}=t,n=e(s).varExp,i=t=>n(...t.split(".")),a=(t=1)=>`calc(${t} * ${i("rtime")})`,c=(t=1)=>`calc(${t} * ${i("rangle")})`,l=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const o=e(t),h=M(o),u=t=>{const e=r[t]||t;return"number"==typeof e?e+"rem":""},g=t=>"min-"+Ct+u(t),p=t=>"max-"+Ct+u(t),d=(t,e)=>"string"==typeof e?h.cq(t,e):h.mq(t),b=(t,e,s)=>""+d(g(t)+") and ("+p(e),s),f={up:(t,e)=>""+d(g(t),e),down:(t,e)=>""+d(p(t),e),between:b,only:(t,e)=>b(t,t,e)};return x=s(Object.assign(zt,{key:t,vars:i,size:l,time:a,angle:c,bem:o.selector,pseudo:Object.assign(tt(et(ht).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),tt(et(ut).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:wt(n),palette:St(n),coef:At(n),units:{px:B,vh:L,vw:R,vmin:V,vmax:F,rem:H,deg:T,ms:Z,pc:D,cqw:G,cqh:J,cqb:U,cqi:Q,cqmin:X,cqmax:Y},at:h,limit:f,merge:m})),O(x,((t,e)=>t+w(...e)),"");var x}}};const It="theme",Nt="size",Kt="time",Mt="angle",Bt="palette",Lt=Object.assign,Rt=Object.entries,Vt=Object.fromEntries,Ft=(t,e)=>t.getAttribute(e)||b[e],Ht=(t,e)=>{const s=Ft(t,e);return null!==s?Number(s):null},Tt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Zt=t=>`:root:has(script[is=${d}]${t?`[${t}]`:""})`,Dt=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],Gt=["xs","s","m","l","xl"],Jt=["pale","base","rich"];function Qt(t={}){const s=window.document,a=window.customElements;if(null==a?void 0:a.get(d))return!1;{class p extends HTMLScriptElement{constructor(){super(...arguments),this._c=y(),this._m=function(){let t={},e={},s=[],r=[];const n=(t,e)=>(e.toString=()=>"effcss-"+t,e),i=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...s]},a=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(i(s),t.push(e)),t}),[])},c=t=>s.findIndex((e=>e===t)),l=e=>e?t[e]:void 0,o=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},h=t=>{const e=l(t);return!!e&&-1!==c(e)};return{apply:i,notify:a,getIndex:c,get:l,has:t=>!!t&&!!l(t),getAll:()=>t,add:o,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=l(e);return!(!r||h(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=l(e);if(r&&h(e)){const e=c(r);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:r=>{const n=l(r);if(!n)return;const i=c(n);return i>-1&&(s.splice(i,1),delete t[r],delete e[r]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=n(e,r),!!r.cssRules.length&&o(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),a(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),i(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._settings=$,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base),r=t=>s("",t);function n(t,e){return Rt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?Lt(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=Vt(Rt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:c,light:l}=i,o=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]])}return s}(i,["","dark","light"]),h=this.size,u=this.time,g=this.angle,{l:m,c:p,h:d}=this._settings.palette,b=this._settings.coef,f=[0,...Dt(b.$0_),1,...Dt(b.$1_),2,...Dt(b.$2_),16,...Dt(b.$16_),b.max];this._=({bem:t,each:e,when:n,vars:c,merge:l,at:{media:b},units:{px:x,ms:$,deg:v}})=>{const j="prefers-color-scheme",y={light:`${j}: light`,dark:`${j}: dark`};return l({[Zt()]:l({fontSize:c("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(d,((t,e)=>({[s(Bt,"h",t)]:e}))),{[s(Bt,"c","bg","gray")]:0,[s(Bt,"c","fg","gray")]:0},e(y,((t,r)=>b.and(r)(l(i[t]||{},e(Gt,((e,r)=>({[s(Bt,"l","bg",r)]:m[t].bg[r],[s(Bt,"l","fg",r)]:m[t].fg[r]}))),e(Jt,((e,r)=>({[s(Bt,"c","bg",r)]:p[t].bg[r],[s(Bt,"c","fg",r)]:p[t].fg[r]}))))))))},e(o,((e,s)=>({[Zt(`${It}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!h,{[Zt(Nt)]:{[r("rem")]:x(h)}}),n(!!u,{[Zt(Kt)]:{[r("rtime")]:$(u)}}),n(!!g,{[Zt(Mt)]:{[r("rangle")]:v(g)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let n=this._c.use(t,r);return(s||this._m&&!this._m.has(e))&&this._m.pack(n,this.css(t,n)),e||this._k.next(),this.resolve(n)},this.usePublic=t=>Vt(Rt(t).map((([t,e])=>[t,this.use(e,t)]))),this.usePrivate=t=>t.map((t=>this.use(t))),this.resolve=t=>this._s(t||this._k.base).attr,this.css=(t,e)=>this._p.compile({key:e,maker:t}),this.status=t=>{const e=this.key(t);return!!e&&this._m.status(e)},this.on=(...t)=>this._m.on(...t.map(this.key)),this.off=(...t)=>this._m.off(...t.map(this.key)),this.key=t=>"string"==typeof t?t:this._c.getKey(t),this.stylesheets=(...t)=>{let e;return e=t.length?1===t.length&&Array.isArray(t[0])?t[0]:t:this._c.keys,e.map((t=>this._m.get(this.key(t))))}}static get observedAttributes(){return[Nt,Kt,Mt]}get prefix(){return Ft(this,"prefix")||""}get mode(){return Ft(this,"mode")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=m({},this._settings,t),{makers:i,bp:a,off:c}=n;(a&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==a||!this._p)&&(this._p=Wt({scope:this._s,globalKey:this._k.base,bp:a})),i&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==i&&(this._c.useMany(i),this.usePublic(i),(null==c?void 0:c.length)&&this._settings.off!==c&&this.off(...c),this.hydrate&&this._k.reset()),this._settings=n,(!(null===(r=this._m)||void 0===r?void 0:r.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}get makers(){return this._c.makers}set theme(t){Tt(this,It,t)}get theme(){return Ft(this,It)||""}set size(t){Tt(this,Nt,t)}get size(){return Ht(this,Nt)}set time(t){Tt(this,"time",t)}get time(){return Ht(this,Kt)}set angle(t){Tt(this,"angle",t)}get angle(){return Ht(this,Mt)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=j({prefix:this.prefix}),this._s=((t={})=>{const{mode:s}=t;let a,m;return t=>{const p=(...e)=>""+e.filter(Boolean).reduce(((t,e)=>`${t}-${e}`),t),d=(...t)=>"--"+p(...t);return"c"===s?(a=t=>{let e,s,r,n;return i(t)?([e,s,r,n]=l(t),u(p(e),s,r,n)):t&&o(t).map((([t,e,s,r])=>u(p(t),e,s,r))).join(",")},m=t=>{if(void 0===t)return v(m);let e,s,n,a;const c="class";let u="";return Array.isArray(t)?u=[...t.reduce(((t,r)=>([e,s,n,a]=l(r),t.add(h(p(e),s)),n&&t.add(h(p(e),s,n,a)),t)),new Set).values()].join(" "):i(t)?([e,s,n,a]=l(t),u=h(p(e),s,n,a)):u=t&&o(t,!0).map((([t,e,s,r])=>h(p(t),e,s,r))).join(" "),r({[c]:u},{toString:{value:()=>`${c}="${u}"`}})}):(a=t=>{let e,s,r,n;return i(t)?([e,s,r,n]=l(t),g(p(e),s,r,n)):t&&o(t).map((([t,e,s,r])=>g(p(t),e,s,r))).join(",")},m=t=>{if(void 0===t)return v(m);let s,a,h,u,g,d,b="";if(Array.isArray(t))d=t.reduce(((t,e)=>{[s,a,h,u]=l(e);const r=c(p(s),a);return g=n(r),b=h?u?`${h}_${u}`:`${h}`:"",t[g]&&b?t[g]=t[g]+" "+b:t[g]=b,t}),{});else if(i(t)){[s,a,h,u]=l(t);const e=c(p(s),a);g=n(e),b=h?u?`${h}_${u}`:`${h}`:"",d={[g]:b}}else d=t&&o(t,!0).reduce(((t,[e,s,r,i])=>{const a=c(p(e),s);g=n(a);const l=r?i?`${r}_${i}`:`${r}`:"";return b=t[g]?t[g]+" "+l:l,t[g]=b,t}),{});return r(d,{toString:{value:()=>e(d).map((([t,e])=>`${t}="${e}"`)).join(" ")}}),d}),{selector:a,attr:m,name:p,varName:d,varExp:(...t)=>`var(${d(...t)})`}}})({mode:this.mode});const a=this;this._n={set adoptedStyleSheets(t){a.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(s),this.settings=t}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}return a.define(d,p,{extends:"script"}),!0}}export{Qt as defineProvider};
@@ -61,6 +61,33 @@ type TScope = {
61
61
  */
62
62
  low: () => TScope;
63
63
  };
64
+ type TMedia = {
65
+ (val: object): object;
66
+ /**
67
+ * Combine with `or` logic
68
+ */
69
+ or: (...val: (TMedia | string)[]) => TMedia;
70
+ /**
71
+ * Combine with `and` logic
72
+ */
73
+ and: (...val: (TMedia | string)[]) => TMedia;
74
+ /**
75
+ * Negate with `not`
76
+ */
77
+ not: TMedia;
78
+ /**
79
+ * `screen` media type
80
+ */
81
+ screen: TMedia;
82
+ /**
83
+ * `all` media type
84
+ */
85
+ all: TMedia;
86
+ /**
87
+ * `print` media type
88
+ */
89
+ print: TMedia;
90
+ };
64
91
  export declare const resolveAtRules: (ctx: ReturnType<ReturnType<TCreateScope>>) => {
65
92
  /**
66
93
  * `@property` selector
@@ -118,6 +145,7 @@ export declare const resolveAtRules: (ctx: ReturnType<ReturnType<TCreateScope>>)
118
145
  };
119
146
  /**
120
147
  * `@media` selector
148
+ * @deprecated It will be deleted in the next major version, use `media` instead
121
149
  */
122
150
  mq: {
123
151
  (q: string, t?: string): {
@@ -242,5 +270,10 @@ export declare const resolveAtRules: (ctx: ReturnType<ReturnType<TCreateScope>>)
242
270
  * @param rules - nested rules
243
271
  */
244
272
  scope: TScope;
273
+ /**
274
+ * `@media` rule maker
275
+ * @param rules - nested rules
276
+ */
277
+ media: TMedia;
245
278
  };
246
279
  export {};
@@ -135,6 +135,7 @@ export interface IStyleProvider {
135
135
  * @param targets - target stylesheet makers and/or keys
136
136
  */
137
137
  stylesheets(targets?: TStyleTarget[]): (CSSStyleSheet | undefined)[];
138
+ stylesheets(...targets: TStyleTarget[]): (CSSStyleSheet | undefined)[];
138
139
  /**
139
140
  * String representation that allows save or send current state
140
141
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effcss",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "description": "Self-confident CSS-in-JS",
5
5
  "type": "module",
6
6
  "scripts": {