@master/css 2.0.0-beta.147 → 2.0.0-beta.148
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/dist/cjs/css.js +1 -1
- package/dist/esm/css.mjs +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/cjs/css.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var N=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var U=(y,t,i)=>t in y?N(y,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):y[t]=i;var Y=(y,t)=>{for(var i in t)N(y,i,{get:t[i],enumerable:!0})},G=(y,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Z(t))!q.call(y,u)&&u!==i&&N(y,u,{get:()=>t[u],enumerable:!(n=_(t,u))||n.enumerable});return y};var J=y=>G(N({},"__esModule",{value:!0}),y);var T=(y,t,i)=>(U(y,typeof t!="symbol"?t+"":t,i),i);var P={};Y(P,{MasterCSS:()=>M});module.exports=J(P);function I(y){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&y instanceof t||y instanceof Date||y instanceof RegExp)}function $(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let t=Buffer.alloc(y.length);return y.copy(t),t}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function F(y){let t=[];return y.forEach(function(i,n){typeof i=="object"&&i!==null?Array.isArray(i)?t[n]=F(i):I(i)?t[n]=$(i):t[n]=O({},i):t[n]=i}),t}function W(y,t){return t==="__proto__"?void 0:y[t]}function O(...y){let t={},i,n;return y.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(v){if(n=W(t,v),i=W(u,v),i!==t)if(typeof i!="object"||i===null){t[v]=i;return}else if(Array.isArray(i)){t[v]=F(i);return}else if(I(i)){t[v]=$(i);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[v]=O({},i);return}else{t[v]=O(n,i);return}})}),t}var D=require("./rule"),j=require("./config"),H=require("./utils/rgb-to-hex"),Q=require("./constants/selector-symbols");var L=typeof window<"u",V=()=>{let y=document.createElement("style");return y.id="master",y},S=class{constructor(t=j.config){this.config=t;t?.override||(this.config=O(j.config,t),"keyframes"in t&&Object.assign(this.config.keyframes,t.keyframes)),this.cache(),L&&this.config.observe&&this.observe(document),S.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:t,classes:i,selectors:n,themes:u,colors:v,values:E,breakpoints:R,mediaQueries:g,rules:C}=this.config;function B(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(e,s,l="",c={}){let m=x=>x?(l?l+"-":"")+x:l,b=Object.entries(e),w=[],A=[];for(let x of b){let k=x[1];(typeof k=="object"&&!Array.isArray(k)?w:A).push(x)}for(let[x,k]of w)a(k,s,m(x),c);if(s&&l)A.length&&(c[l]=A.reduce((x,[k,z])=>(x[k]=z,x),{}));else for(let[x,k]of A)c[m(x)]=k;return c}if(t)for(let[e,s]of Object.entries(a(t,!0)))this.semantics.push([new RegExp("^"+B(e)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[e,s]]);if(n)for(let[e,s]of Object.entries(a(n,!1))){let l=new RegExp(B(e)+"(?![a-z-])");for(let c of Array.isArray(s)?s:[s]){let m=c.match(/^::-[a-z]+-/m)?.[0]??"",b=this.selectors[m];b||(b=this.selectors[m]=[]);let w=b.find(([A])=>A===l);w||(w=[l,[]],b.push(w)),w[1].push(c)}}E&&(this.globalValues=a(E,!1)),R&&(this.breakpoints=a(R,!1)),g&&(this.mediaQueries=a(g,!1));let d=i?a(i,!1):{},p=u&&!Array.isArray(u)?Object.entries(u).filter(([,{classes:e}])=>e).reduce((e,[s,{classes:l}])=>(e[s]=a(l,!1),e),{}):{},h=[...Object.keys(d),...Object.entries(p).flatMap(([e,s])=>Object.keys(s))],f=e=>{if(e in this.classes)return;let s=this.classes[e]=[],l=(c,m)=>{if(!m)return;let b=Array.isArray(m)?m:m.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let w of b){let A=x=>{x in this.themeAffectedClassesBy?c in this.themeAffectedClassesBy[x]?this.themeAffectedClassesBy[x][c].push(e):this.themeAffectedClassesBy[x][c]=[e]:this.themeAffectedClassesBy[x]={[c]:[e]},s.includes(x)||s.push(x)};if(h.includes(w)){f(w);for(let x of this.classes[w])A(x)}else A(w)}};l("",d?.[e]);for(let[c,m]of Object.entries(p))l(c,m?.[e])};for(let e of h)f(e);for(let e in this.themeAffectedClassesBy){let s=this.classesBy[e]=[];for(let l of Object.values(this.themeAffectedClassesBy[e]))for(let c of l)s.includes(c)||s.push(c)}let o=(e,s)=>{if(!s)return;let l=a(s,!0);for(let[c,m]of Object.entries(l)){let b=typeof m=="string"?{"":m}:m;for(let[w,A]of Object.entries(b)){let x=c+(w?"-"+w:"");x in this.colorThemesMap?this.colorThemesMap[x][e]=A:this.colorThemesMap[x]={[e]:A}}}for(let c in s)this.colorNames.includes(c)||this.colorNames.push(c)};if(o("",v),u)if(Array.isArray(u))this.themeNames.push(...u);else for(let e in u){let s=u[e];o(e,s.colors),this.themeNames.push(e)}let r=e=>{for(let[s,l]of Object.entries(this.colorThemesMap))for(let[c,m]of Object.entries(l))m.startsWith("#")||e(s,l,c,m)};if(r((e,s,l,c)=>{let m=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(c);if(m){let b="#"+(0,H.rgbToHex)(+m[1],+m[2],+m[3]);m[4]&&(b+=Math.round(255*+m[4]).toString(16)),s[l]=b}}),r((e,s,l,c)=>{let[m,b]=c.split("/"),w=this.colorThemesMap[m];if(w){let A=(l?w[l]:void 0)??w[""];s[l]=b?A.slice(0,7)+Math.round(255*+b).toString(16):A}else console.warn(`\`${c}\` doesn't exist in the extended config \`.colors\``),delete s[l],Object.keys(s).length||delete this.colorThemesMap[e]}),C)for(let e in C){let s=C[e],{native:l,values:c,colored:m}=s,b=s.match;if(s.id=e,s.native=l===!0?e.replace(/(?!^)[A-Z]/g,w=>"-"+w).toLowerCase():void 0,c&&(this.values[e]=a(c,!1)),b){let w=Object.keys(this.values[e]??{});b.includes("$values")&&(b=w.length?b.replace(/\$values/,w.join("|")):b.replace(/(?:\|)?\$values/,"")),m&&b.includes("$colors")&&(b=this.colorNames.length?b.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):b.replace(/(?:\|)?\$colors/,"")),this.matches[e]=new RegExp(b)}}}observe(t,i={subtree:!0,childList:!0}){if(this.root!==t){if(L&&t){this.root=t;let n=t===document;n&&(S.root=this),this.host=n?document.documentElement:this.root.host;let u=n?document.head:t,v=n?document.styleSheets:t.styleSheets;for(let R of v){let{ownerNode:g}=R;if(g&&g.id==="master"){this.style=g;break}}if(this.style)for(let R=0;R<this.style.sheet.cssRules.length;R++){let g=this.style.sheet.cssRules[R];if(g.constructor.name==="CSSKeyframesRule")continue;let C=a=>{if(a.selectorText){let p=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<p.length;h++){let f=p[h];if(f[0]==="."){let o=f.slice(1),r="";for(let e=0;e<o.length;e++){let s=o[e],l=o[e+1];if(s==="\\"){if(e++,l!=="\\"){r+=l;continue}}else if(Q.SELECTOR_SYMBOLS.includes(s))break;r+=s}if(!(r in this.ruleBy)&&!(r in this.classes)){let e=this.create(r)[0];if(e)return e}}}}else if(a.cssRules)for(let d=0;d<a.cssRules.length;d++){let p=C(a.cssRules[d]);if(p)return p}},B=C(g);if(B){this.rules.push(B),this.ruleBy[B.className]=B;for(let a=0;a<B.natives.length;a++)B.natives[a].cssRule=this.style.sheet.cssRules[R+a];R+=B.natives.length-1,B.config.insert?.call(B)}}else this.style=V(),u.append(this.style);let E=R=>{R.forEach(g=>{g in this.countBy?this.countBy[g]++:(this.countBy[g]=1,this.insert(g))})};E(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(R=>E(R.classList)),this.observer=new MutationObserver(R=>{let g={},C=[],B=[],a=[],d=(o,r)=>{r?o.classList.forEach(h):o.classList.forEach(p);let e=o.children;for(let s=0;s<e.length;s++){let l=e[s];l.classList&&(B.push(l),d(l,r))}},p=o=>{o in g?g[o]++:g[o]=1},h=o=>{o in g?g[o]--:o in this.countBy&&(g[o]=-1)},f=(o,r)=>{for(let e=0;e<o.length;e++){let s=o[e];s.classList&&!B.includes(s)&&!a.includes(s)&&(s.isConnected!==r?(B.push(s),d(s,r)):a.push(s))}};for(let o=0;o<R.length;o++){let r=R[o],{addedNodes:e,removedNodes:s,type:l,target:c}=r;if(l==="attributes"){if(C.find(m=>m.target===c))continue;C.push(r)}else f(e,!1),(!c.isConnected||!B.includes(c))&&f(s,!0)}if(!(!C.length&&!Object.keys(g).length)){for(let{oldValue:o,target:r}of C){let e=B.includes(r),s=r.classList,l=o?o.split(" "):[];if(e){if(r.isConnected)continue;for(let c of l)s.contains(c)||h(c)}else if(r.isConnected){s.forEach(c=>{l.includes(c)||p(c)});for(let c of l)s.contains(c)||h(c)}}for(let o in g){let r=g[o],e=(this.countBy[o]||0)+r;e===0?(delete this.countBy[o],this.delete(o)):(o in this.countBy||this.insert(o),this.countBy[o]=e)}}}),this.observer.observe(t,{...i,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let t=this.style?.sheet;if(t?.cssRules)for(let i=t.cssRules.length-1;i>=0;i--)t.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(t){for(let i in this.config.rules){let n=this.config.rules[i],u=this.matches[i],{symbol:v,native:E}=n;if(u&&u.test(t))return{origin:"match",config:n};if(v&&t.startsWith(v))return{origin:"symbol",config:n};if(E&&t.startsWith(E+":"))return{origin:"match",config:n}}for(let i of this.semantics)if(t.match(i[0]))return{origin:"semantics",value:i[1]}}create(t){let i=n=>{if(n in this.ruleBy)return this.ruleBy[n];let u=this.match(n);if(u)return new D.Rule(n,u,this)};return(t in this.classes?this.classes[t].map(n=>i(n)):[i(t)]).filter(n=>n&&n.text)}refresh(t){if(t?.override?this.config=t:this.config=O(j.config,t),this.cache(),!this.style)return;let i=V();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let n in this.countBy)this.insert(n)}destroy(){let t=S.instances;this.disconnect(),t.splice(t.indexOf(this),1)}delete(t){let i=this.style?.sheet,n=u=>{let v=this.ruleBy[u];if(!(!v||u in this.classesBy&&this.classesBy[u].some(E=>E in this.countBy))){if(i&&v.natives.length){let E=v.natives[0];for(let R=0;R<i.cssRules.length;R++)if(i.cssRules[R]===E.cssRule){for(let C=0;C<v.natives.length;C++)i.deleteRule(R);break}}this.rules.splice(this.rules.indexOf(v),1),delete this.ruleBy[u],v.config.delete&&v.config.delete.call(v,u)}};if(t in this.classes){for(let u of this.classes[t])u in this.countBy||n(u);delete this.ruleBy[t]}else n(t)}insert(t){let i=this.create(t);return i.length?(this.insertRules(i),!0):!1}insertRules(t){for(let i of t){if(this.ruleBy[i.className])continue;let n,u=Object.keys(this.keyframes).length,v=this.rules.length-1,{media:E,order:R,priority:g,hasWhere:C,className:B}=i,a=(h,f,o)=>{let r=h;for(;r<=v;r++){let e=this.rules[r];if(f?.(e))return o?-1:r-1;if(o?.(e))return r}return o?-1:r-1},d,p;if(E){let h=this.rules.findIndex(f=>f.media);if(h===-1)n=v+1;else{let{"max-width":f,"min-width":o}=E.features;if(f||o){let r=this.rules.findIndex(e=>e.media?.features["max-width"]||e.media?.features["min-width"]);if(r===-1)n=v+1;else if(f&&o){if(g===-1?(d=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),p=a(r,e=>e.priority!==-1)):(d=a(r,void 0,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),p=v),d!==-1){let e=f.value-o.value,s=p,l=d;for(d=void 0;s>=l;s--){let{"max-width":c,"min-width":m}=this.rules[s].media.features,b=c.value-m.value;if(b<e)p=s-1;else if(b===e)d=s;else break}}if(d!==-1){let e=f.value-o.value;for(let s=p;s>=d;s--){let{"max-width":l,"min-width":c}=this.rules[s].media.features,m=l.value-c.value;if(m<e)p=s-1;else if(m>e){d=s+1;break}}}}else if(o){if(g===-1?(d=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]),p=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1)):(d=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),p=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=p;e>=d;e--){let s=this.rules[e].media.features["min-width"].value;if(s>o.value)p=e-1;else if(s<o.value){d=e+1;break}}}else if(g===-1?(d=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),p=a(r,e=>e.media.features["min-width"]||e.priority!==-1)):(d=a(r,e=>e.media.features["min-width"]&&e.priority!==-1,e=>e.media.features["max-width"]&&e.priority!==-1),p=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=p;e>=d;e--){let s=this.rules[e].media.features["max-width"].value;if(s<f.value)p=e-1;else if(s>f.value){d=e+1;break}}}else g===-1?(d=h,p=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]||r.priority!==-1)):(d=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"],r=>r.priority!==-1),p=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=u?1:0;g===-1?(d=h,p=a(h,f=>f.media||f.priority!==-1)):(d=a(h,f=>f.media,f=>f.priority!==-1),p=a(h,f=>f.media))}if(n===void 0)if(d===-1)n=p+1;else{if(g===-1)for(let h=d;h<=p;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)&&(C&&!f.hasWhere||f.order>=R)){n=h;break}}else for(let h=d;h<=p;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)){if(C&&!f.hasWhere){n=h;break}if(f.priority<g){n=h;break}else if(f.priority===g){if(f.order>=R){n=h;break}}else n=h+1}}n===void 0&&(n=p+1)}if(this.rules.splice(n,0,i),this.ruleBy[B]=i,this.style){let h=this.style.sheet,f=0,o=r=>{let e=this.rules[r];if(e){if(!e.natives.length)return o(r-1);let s=e.natives[e.natives.length-1].cssRule;for(let l=0;l<h.cssRules.length;l++)if(h.cssRules[l]===s){f=l+1;break}}};o(n-1);for(let r=0;r<i.natives.length;)try{let e=i.natives[r];h.insertRule(e.text,f),e.cssRule=h.cssRules[f++],r++}catch(e){console.error(e),i.natives.splice(r,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(t=>t.text).join("")}},M=S;T(M,"root"),T(M,"config",j.config),T(M,"instances",[]),T(M,"refresh",t=>{for(let i of S.instances)i.refresh(t)});L&&(window.MasterCSS=M);0&&(module.exports={MasterCSS});
|
|
1
|
+
var L=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var Y=(y,s,i)=>s in y?L(y,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):y[s]=i;var G=(y,s)=>{for(var i in s)L(y,i,{get:s[i],enumerable:!0})},J=(y,s,i,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let u of q(s))!U.call(y,u)&&u!==i&&L(y,u,{get:()=>s[u],enumerable:!(o=Z(s,u))||o.enumerable});return y};var P=y=>J(L({},"__esModule",{value:!0}),y);var T=(y,s,i)=>(Y(y,typeof s!="symbol"?s+"":s,i),i);var X={};G(X,{MasterCSS:()=>k});module.exports=P(X);function $(y){let s=typeof Buffer<"u"?Buffer:null;return!!(s&&y instanceof s||y instanceof Date||y instanceof RegExp)}function F(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let s=Buffer.alloc(y.length);return y.copy(s),s}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function V(y){let s=[];return y.forEach(function(i,o){typeof i=="object"&&i!==null?Array.isArray(i)?s[o]=V(i):$(i)?s[o]=F(i):s[o]=M({},i):s[o]=i}),s}function I(y,s){return s==="__proto__"?void 0:y[s]}function M(...y){let s={},i,o;return y.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(v){if(o=I(s,v),i=I(u,v),i!==s)if(typeof i!="object"||i===null){s[v]=i;return}else if(Array.isArray(i)){s[v]=V(i);return}else if($(i)){s[v]=F(i);return}else if(typeof o!="object"||o===null||Array.isArray(o)){s[v]=M({},i);return}else{s[v]=M(o,i);return}})}),s}var H=require("./rule"),N=require("./config"),Q=require("./utils/rgb-to-hex"),z=require("./constants/selector-symbols");var W=typeof window<"u",D=()=>{let y=document.createElement("style");return y.id="master",y},S=class{constructor(s=N.config){this.config=s;s?.override||(this.config=M(N.config,s),"keyframes"in s&&Object.assign(this.config.keyframes,s.keyframes)),this.cache(),W&&this.config.observe&&this.observe(document),S.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:s,classes:i,selectors:o,themes:u,colors:v,values:A,breakpoints:w,mediaQueries:g,rules:E}=this.config;function C(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(t,n,c="",d={}){let b=R=>R?(c?c+"-":"")+R:c,x=Object.entries(t),B=[],O=[];for(let R of x){let j=R[1];(typeof j=="object"&&!Array.isArray(j)?B:O).push(R)}for(let[R,j]of B)a(j,n,b(R),d);if(n&&c)O.length&&(d[c]=O.reduce((R,[j,_])=>(R[j]=_,R),{}));else for(let[R,j]of O)d[b(R)]=j;return d}function m(t){for(let[n,c]of Object.entries(t))/^[0-9]+x$/.test(n)&&typeof c=="number"&&(t["-"+n]=c*-1);return t}if(s)for(let[t,n]of Object.entries(a(s,!0)))this.semantics.push([new RegExp("^"+C(t)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[t,n]]);if(o)for(let[t,n]of Object.entries(a(o,!1))){let c=new RegExp(C(t)+"(?![a-z-])");for(let d of Array.isArray(n)?n:[n]){let b=d.match(/^::-[a-z]+-/m)?.[0]??"",x=this.selectors[b];x||(x=this.selectors[b]=[]);let B=x.find(([O])=>O===c);B||(B=[c,[]],x.push(B)),B[1].push(d)}}A&&(this.globalValues=m(a(A,!1))),w&&(this.breakpoints=a(w,!1)),g&&(this.mediaQueries=a(g,!1));let p=i?a(i,!1):{},h=u&&!Array.isArray(u)?Object.entries(u).filter(([,{classes:t}])=>t).reduce((t,[n,{classes:c}])=>(t[n]=a(c,!1),t),{}):{},f=[...Object.keys(p),...Object.entries(h).flatMap(([t,n])=>Object.keys(n))],l=t=>{if(t in this.classes)return;let n=this.classes[t]=[],c=(d,b)=>{if(!b)return;let x=Array.isArray(b)?b:b.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let B of x){let O=R=>{R in this.themeAffectedClassesBy?d in this.themeAffectedClassesBy[R]?this.themeAffectedClassesBy[R][d].push(t):this.themeAffectedClassesBy[R][d]=[t]:this.themeAffectedClassesBy[R]={[d]:[t]},n.includes(R)||n.push(R)};if(f.includes(B)){l(B);for(let R of this.classes[B])O(R)}else O(B)}};c("",p?.[t]);for(let[d,b]of Object.entries(h))c(d,b?.[t])};for(let t of f)l(t);for(let t in this.themeAffectedClassesBy){let n=this.classesBy[t]=[];for(let c of Object.values(this.themeAffectedClassesBy[t]))for(let d of c)n.includes(d)||n.push(d)}let r=(t,n)=>{if(!n)return;let c=a(n,!0);for(let[d,b]of Object.entries(c)){let x=typeof b=="string"?{"":b}:b;for(let[B,O]of Object.entries(x)){let R=d+(B?"-"+B:"");R in this.colorThemesMap?this.colorThemesMap[R][t]=O:this.colorThemesMap[R]={[t]:O}}}for(let d in n)this.colorNames.includes(d)||this.colorNames.push(d)};if(r("",v),u)if(Array.isArray(u))this.themeNames.push(...u);else for(let t in u){let n=u[t];r(t,n.colors),this.themeNames.push(t)}let e=t=>{for(let[n,c]of Object.entries(this.colorThemesMap))for(let[d,b]of Object.entries(c))b.startsWith("#")||t(n,c,d,b)};if(e((t,n,c,d)=>{let b=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(d);if(b){let x="#"+(0,Q.rgbToHex)(+b[1],+b[2],+b[3]);b[4]&&(x+=Math.round(255*+b[4]).toString(16)),n[c]=x}}),e((t,n,c,d)=>{let[b,x]=d.split("/"),B=this.colorThemesMap[b];if(B){let O=(c?B[c]:void 0)??B[""];n[c]=x?O.slice(0,7)+Math.round(255*+x).toString(16):O}else console.warn(`\`${d}\` doesn't exist in the extended config \`.colors\``),delete n[c],Object.keys(n).length||delete this.colorThemesMap[t]}),E)for(let t in E){let n=E[t],{native:c,values:d,colored:b}=n,x=n.match;if(n.id=t,n.native=c===!0?t.replace(/(?!^)[A-Z]/g,B=>"-"+B).toLowerCase():void 0,d&&(this.values[t]=m(a(d,!1))),x){let B=Object.keys(this.values[t]??{});x.includes("$values")&&(x=B.length?x.replace(/\$values/,B.join("|")):x.replace(/(?:\|)?\$values/,"")),b&&x.includes("$colors")&&(x=this.colorNames.length?x.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):x.replace(/(?:\|)?\$colors/,"")),this.matches[t]=new RegExp(x)}}}observe(s,i={subtree:!0,childList:!0}){if(this.root!==s){if(W&&s){this.root=s;let o=s===document;o&&(S.root=this),this.host=o?document.documentElement:this.root.host;let u=o?document.head:s,v=o?document.styleSheets:s.styleSheets;for(let w of v){let{ownerNode:g}=w;if(g&&g.id==="master"){this.style=g;break}}if(this.style)for(let w=0;w<this.style.sheet.cssRules.length;w++){let g=this.style.sheet.cssRules[w];if(g.constructor.name==="CSSKeyframesRule")continue;let E=a=>{if(a.selectorText){let p=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<p.length;h++){let f=p[h];if(f[0]==="."){let l=f.slice(1),r="";for(let e=0;e<l.length;e++){let t=l[e],n=l[e+1];if(t==="\\"){if(e++,n!=="\\"){r+=n;continue}}else if(z.SELECTOR_SYMBOLS.includes(t))break;r+=t}if(!(r in this.ruleBy)&&!(r in this.classes)){let e=this.create(r)[0];if(e)return e}}}}else if(a.cssRules)for(let m=0;m<a.cssRules.length;m++){let p=E(a.cssRules[m]);if(p)return p}},C=E(g);if(C){this.rules.push(C),this.ruleBy[C.className]=C;for(let a=0;a<C.natives.length;a++)C.natives[a].cssRule=this.style.sheet.cssRules[w+a];w+=C.natives.length-1,C.config.insert?.call(C)}}else this.style=D(),u.append(this.style);let A=w=>{w.forEach(g=>{g in this.countBy?this.countBy[g]++:(this.countBy[g]=1,this.insert(g))})};A(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(w=>A(w.classList)),this.observer=new MutationObserver(w=>{let g={},E=[],C=[],a=[],m=(l,r)=>{r?l.classList.forEach(h):l.classList.forEach(p);let e=l.children;for(let t=0;t<e.length;t++){let n=e[t];n.classList&&(C.push(n),m(n,r))}},p=l=>{l in g?g[l]++:g[l]=1},h=l=>{l in g?g[l]--:l in this.countBy&&(g[l]=-1)},f=(l,r)=>{for(let e=0;e<l.length;e++){let t=l[e];t.classList&&!C.includes(t)&&!a.includes(t)&&(t.isConnected!==r?(C.push(t),m(t,r)):a.push(t))}};for(let l=0;l<w.length;l++){let r=w[l],{addedNodes:e,removedNodes:t,type:n,target:c}=r;if(n==="attributes"){if(E.find(d=>d.target===c))continue;E.push(r)}else f(e,!1),(!c.isConnected||!C.includes(c))&&f(t,!0)}if(!(!E.length&&!Object.keys(g).length)){for(let{oldValue:l,target:r}of E){let e=C.includes(r),t=r.classList,n=l?l.split(" "):[];if(e){if(r.isConnected)continue;for(let c of n)t.contains(c)||h(c)}else if(r.isConnected){t.forEach(c=>{n.includes(c)||p(c)});for(let c of n)t.contains(c)||h(c)}}for(let l in g){let r=g[l],e=(this.countBy[l]||0)+r;e===0?(delete this.countBy[l],this.delete(l)):(l in this.countBy||this.insert(l),this.countBy[l]=e)}}}),this.observer.observe(s,{...i,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let s=this.style?.sheet;if(s?.cssRules)for(let i=s.cssRules.length-1;i>=0;i--)s.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(s){for(let i in this.config.rules){let o=this.config.rules[i],u=this.matches[i],{symbol:v,native:A}=o;if(u&&u.test(s))return{origin:"match",config:o};if(v&&s.startsWith(v))return{origin:"symbol",config:o};if(A&&s.startsWith(A+":"))return{origin:"match",config:o}}for(let i of this.semantics)if(s.match(i[0]))return{origin:"semantics",value:i[1]}}create(s){let i=o=>{if(o in this.ruleBy)return this.ruleBy[o];let u=this.match(o);if(u)return new H.Rule(o,u,this)};return(s in this.classes?this.classes[s].map(o=>i(o)):[i(s)]).filter(o=>o&&o.text)}refresh(s){if(s?.override?this.config=s:this.config=M(N.config,s),this.cache(),!this.style)return;let i=D();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let o in this.countBy)this.insert(o)}destroy(){let s=S.instances;this.disconnect(),s.splice(s.indexOf(this),1)}delete(s){let i=this.style?.sheet,o=u=>{let v=this.ruleBy[u];if(!(!v||u in this.classesBy&&this.classesBy[u].some(A=>A in this.countBy))){if(i&&v.natives.length){let A=v.natives[0];for(let w=0;w<i.cssRules.length;w++)if(i.cssRules[w]===A.cssRule){for(let E=0;E<v.natives.length;E++)i.deleteRule(w);break}}this.rules.splice(this.rules.indexOf(v),1),delete this.ruleBy[u],v.config.delete&&v.config.delete.call(v,u)}};if(s in this.classes){for(let u of this.classes[s])u in this.countBy||o(u);delete this.ruleBy[s]}else o(s)}insert(s){let i=this.create(s);return i.length?(this.insertRules(i),!0):!1}insertRules(s){for(let i of s){if(this.ruleBy[i.className])continue;let o,u=Object.keys(this.keyframes).length,v=this.rules.length-1,{media:A,order:w,priority:g,hasWhere:E,className:C}=i,a=(h,f,l)=>{let r=h;for(;r<=v;r++){let e=this.rules[r];if(f?.(e))return l?-1:r-1;if(l?.(e))return r}return l?-1:r-1},m,p;if(A){let h=this.rules.findIndex(f=>f.media);if(h===-1)o=v+1;else{let{"max-width":f,"min-width":l}=A.features;if(f||l){let r=this.rules.findIndex(e=>e.media?.features["max-width"]||e.media?.features["min-width"]);if(r===-1)o=v+1;else if(f&&l){if(g===-1?(m=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),p=a(r,e=>e.priority!==-1)):(m=a(r,void 0,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),p=v),m!==-1){let e=f.value-l.value,t=p,n=m;for(m=void 0;t>=n;t--){let{"max-width":c,"min-width":d}=this.rules[t].media.features,b=c.value-d.value;if(b<e)p=t-1;else if(b===e)m=t;else break}}if(m!==-1){let e=f.value-l.value;for(let t=p;t>=m;t--){let{"max-width":n,"min-width":c}=this.rules[t].media.features,d=n.value-c.value;if(d<e)p=t-1;else if(d>e){m=t+1;break}}}}else if(l){if(g===-1?(m=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]),p=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1)):(m=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),p=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),m!==-1)for(let e=p;e>=m;e--){let t=this.rules[e].media.features["min-width"].value;if(t>l.value)p=e-1;else if(t<l.value){m=e+1;break}}}else if(g===-1?(m=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),p=a(r,e=>e.media.features["min-width"]||e.priority!==-1)):(m=a(r,e=>e.media.features["min-width"]&&e.priority!==-1,e=>e.media.features["max-width"]&&e.priority!==-1),p=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),m!==-1)for(let e=p;e>=m;e--){let t=this.rules[e].media.features["max-width"].value;if(t<f.value)p=e-1;else if(t>f.value){m=e+1;break}}}else g===-1?(m=h,p=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]||r.priority!==-1)):(m=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"],r=>r.priority!==-1),p=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=u?1:0;g===-1?(m=h,p=a(h,f=>f.media||f.priority!==-1)):(m=a(h,f=>f.media,f=>f.priority!==-1),p=a(h,f=>f.media))}if(o===void 0)if(m===-1)o=p+1;else{if(g===-1)for(let h=m;h<=p;h++){let f=this.rules[h];if(!(!E&&f.hasWhere)&&(E&&!f.hasWhere||f.order>=w)){o=h;break}}else for(let h=m;h<=p;h++){let f=this.rules[h];if(!(!E&&f.hasWhere)){if(E&&!f.hasWhere){o=h;break}if(f.priority<g){o=h;break}else if(f.priority===g){if(f.order>=w){o=h;break}}else o=h+1}}o===void 0&&(o=p+1)}if(this.rules.splice(o,0,i),this.ruleBy[C]=i,this.style){let h=this.style.sheet,f=0,l=r=>{let e=this.rules[r];if(e){if(!e.natives.length)return l(r-1);let t=e.natives[e.natives.length-1].cssRule;for(let n=0;n<h.cssRules.length;n++)if(h.cssRules[n]===t){f=n+1;break}}};l(o-1);for(let r=0;r<i.natives.length;)try{let e=i.natives[r];h.insertRule(e.text,f),e.cssRule=h.cssRules[f++],r++}catch(e){console.error(e),i.natives.splice(r,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(s=>s.text).join("")}},k=S;T(k,"root"),T(k,"config",N.config),T(k,"instances",[]),T(k,"refresh",s=>{for(let i of S.instances)i.refresh(s)});W&&(window.MasterCSS=k);0&&(module.exports={MasterCSS});
|
package/dist/esm/css.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var D=Object.defineProperty;var H=(v,t,i)=>t in v?D(v,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):v[t]=i;var S=(v,t,i)=>(H(v,typeof t!="symbol"?t+"":t,i),i);function W(v){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&v instanceof t||v instanceof Date||v instanceof RegExp)}function I(v){if(typeof Buffer<"u"&&Buffer&&v instanceof Buffer){let t=Buffer.alloc(v.length);return v.copy(t),t}else{if(v instanceof Date)return new Date(v.getTime());if(v instanceof RegExp)return new RegExp(v);throw new Error("Unexpected situation")}}function $(v){let t=[];return v.forEach(function(i,n){typeof i=="object"&&i!==null?Array.isArray(i)?t[n]=$(i):W(i)?t[n]=I(i):t[n]=M({},i):t[n]=i}),t}function L(v,t){return t==="__proto__"?void 0:v[t]}function M(...v){let t={},i,n;return v.forEach(function(g){typeof g!="object"||g===null||Array.isArray(g)||Object.keys(g).forEach(function(b){if(n=L(t,b),i=L(g,b),i!==t)if(typeof i!="object"||i===null){t[b]=i;return}else if(Array.isArray(i)){t[b]=$(i);return}else if(W(i)){t[b]=I(i);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[b]=M({},i);return}else{t[b]=M(n,i);return}})}),t}import{Rule as Q}from"./rule.mjs";import{config as T}from"./config/index.mjs";import{rgbToHex as z}from"./utils/rgb-to-hex.mjs";import{SELECTOR_SYMBOLS as _}from"./constants/selector-symbols.mjs";var N=typeof window<"u",F=()=>{let v=document.createElement("style");return v.id="master",v},O=class{constructor(t=T){this.config=t;t?.override||(this.config=M(T,t),"keyframes"in t&&Object.assign(this.config.keyframes,t.keyframes)),this.cache(),N&&this.config.observe&&this.observe(document),O.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:t,classes:i,selectors:n,themes:g,colors:b,values:E,breakpoints:R,mediaQueries:m,rules:C}=this.config;function B(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(e,s,l="",c={}){let d=x=>x?(l?l+"-":"")+x:l,p=Object.entries(e),w=[],A=[];for(let x of p){let j=x[1];(typeof j=="object"&&!Array.isArray(j)?w:A).push(x)}for(let[x,j]of w)a(j,s,d(x),c);if(s&&l)A.length&&(c[l]=A.reduce((x,[j,V])=>(x[j]=V,x),{}));else for(let[x,j]of A)c[d(x)]=j;return c}if(t)for(let[e,s]of Object.entries(a(t,!0)))this.semantics.push([new RegExp("^"+B(e)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[e,s]]);if(n)for(let[e,s]of Object.entries(a(n,!1))){let l=new RegExp(B(e)+"(?![a-z-])");for(let c of Array.isArray(s)?s:[s]){let d=c.match(/^::-[a-z]+-/m)?.[0]??"",p=this.selectors[d];p||(p=this.selectors[d]=[]);let w=p.find(([A])=>A===l);w||(w=[l,[]],p.push(w)),w[1].push(c)}}E&&(this.globalValues=a(E,!1)),R&&(this.breakpoints=a(R,!1)),m&&(this.mediaQueries=a(m,!1));let u=i?a(i,!1):{},y=g&&!Array.isArray(g)?Object.entries(g).filter(([,{classes:e}])=>e).reduce((e,[s,{classes:l}])=>(e[s]=a(l,!1),e),{}):{},h=[...Object.keys(u),...Object.entries(y).flatMap(([e,s])=>Object.keys(s))],f=e=>{if(e in this.classes)return;let s=this.classes[e]=[],l=(c,d)=>{if(!d)return;let p=Array.isArray(d)?d:d.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let w of p){let A=x=>{x in this.themeAffectedClassesBy?c in this.themeAffectedClassesBy[x]?this.themeAffectedClassesBy[x][c].push(e):this.themeAffectedClassesBy[x][c]=[e]:this.themeAffectedClassesBy[x]={[c]:[e]},s.includes(x)||s.push(x)};if(h.includes(w)){f(w);for(let x of this.classes[w])A(x)}else A(w)}};l("",u?.[e]);for(let[c,d]of Object.entries(y))l(c,d?.[e])};for(let e of h)f(e);for(let e in this.themeAffectedClassesBy){let s=this.classesBy[e]=[];for(let l of Object.values(this.themeAffectedClassesBy[e]))for(let c of l)s.includes(c)||s.push(c)}let o=(e,s)=>{if(!s)return;let l=a(s,!0);for(let[c,d]of Object.entries(l)){let p=typeof d=="string"?{"":d}:d;for(let[w,A]of Object.entries(p)){let x=c+(w?"-"+w:"");x in this.colorThemesMap?this.colorThemesMap[x][e]=A:this.colorThemesMap[x]={[e]:A}}}for(let c in s)this.colorNames.includes(c)||this.colorNames.push(c)};if(o("",b),g)if(Array.isArray(g))this.themeNames.push(...g);else for(let e in g){let s=g[e];o(e,s.colors),this.themeNames.push(e)}let r=e=>{for(let[s,l]of Object.entries(this.colorThemesMap))for(let[c,d]of Object.entries(l))d.startsWith("#")||e(s,l,c,d)};if(r((e,s,l,c)=>{let d=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(c);if(d){let p="#"+z(+d[1],+d[2],+d[3]);d[4]&&(p+=Math.round(255*+d[4]).toString(16)),s[l]=p}}),r((e,s,l,c)=>{let[d,p]=c.split("/"),w=this.colorThemesMap[d];if(w){let A=(l?w[l]:void 0)??w[""];s[l]=p?A.slice(0,7)+Math.round(255*+p).toString(16):A}else console.warn(`\`${c}\` doesn't exist in the extended config \`.colors\``),delete s[l],Object.keys(s).length||delete this.colorThemesMap[e]}),C)for(let e in C){let s=C[e],{native:l,values:c,colored:d}=s,p=s.match;if(s.id=e,s.native=l===!0?e.replace(/(?!^)[A-Z]/g,w=>"-"+w).toLowerCase():void 0,c&&(this.values[e]=a(c,!1)),p){let w=Object.keys(this.values[e]??{});p.includes("$values")&&(p=w.length?p.replace(/\$values/,w.join("|")):p.replace(/(?:\|)?\$values/,"")),d&&p.includes("$colors")&&(p=this.colorNames.length?p.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):p.replace(/(?:\|)?\$colors/,"")),this.matches[e]=new RegExp(p)}}}observe(t,i={subtree:!0,childList:!0}){if(this.root!==t){if(N&&t){this.root=t;let n=t===document;n&&(O.root=this),this.host=n?document.documentElement:this.root.host;let g=n?document.head:t,b=n?document.styleSheets:t.styleSheets;for(let R of b){let{ownerNode:m}=R;if(m&&m.id==="master"){this.style=m;break}}if(this.style)for(let R=0;R<this.style.sheet.cssRules.length;R++){let m=this.style.sheet.cssRules[R];if(m.constructor.name==="CSSKeyframesRule")continue;let C=a=>{if(a.selectorText){let y=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<y.length;h++){let f=y[h];if(f[0]==="."){let o=f.slice(1),r="";for(let e=0;e<o.length;e++){let s=o[e],l=o[e+1];if(s==="\\"){if(e++,l!=="\\"){r+=l;continue}}else if(_.includes(s))break;r+=s}if(!(r in this.ruleBy)&&!(r in this.classes)){let e=this.create(r)[0];if(e)return e}}}}else if(a.cssRules)for(let u=0;u<a.cssRules.length;u++){let y=C(a.cssRules[u]);if(y)return y}},B=C(m);if(B){this.rules.push(B),this.ruleBy[B.className]=B;for(let a=0;a<B.natives.length;a++)B.natives[a].cssRule=this.style.sheet.cssRules[R+a];R+=B.natives.length-1,B.config.insert?.call(B)}}else this.style=F(),g.append(this.style);let E=R=>{R.forEach(m=>{m in this.countBy?this.countBy[m]++:(this.countBy[m]=1,this.insert(m))})};E(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(R=>E(R.classList)),this.observer=new MutationObserver(R=>{let m={},C=[],B=[],a=[],u=(o,r)=>{r?o.classList.forEach(h):o.classList.forEach(y);let e=o.children;for(let s=0;s<e.length;s++){let l=e[s];l.classList&&(B.push(l),u(l,r))}},y=o=>{o in m?m[o]++:m[o]=1},h=o=>{o in m?m[o]--:o in this.countBy&&(m[o]=-1)},f=(o,r)=>{for(let e=0;e<o.length;e++){let s=o[e];s.classList&&!B.includes(s)&&!a.includes(s)&&(s.isConnected!==r?(B.push(s),u(s,r)):a.push(s))}};for(let o=0;o<R.length;o++){let r=R[o],{addedNodes:e,removedNodes:s,type:l,target:c}=r;if(l==="attributes"){if(C.find(d=>d.target===c))continue;C.push(r)}else f(e,!1),(!c.isConnected||!B.includes(c))&&f(s,!0)}if(!(!C.length&&!Object.keys(m).length)){for(let{oldValue:o,target:r}of C){let e=B.includes(r),s=r.classList,l=o?o.split(" "):[];if(e){if(r.isConnected)continue;for(let c of l)s.contains(c)||h(c)}else if(r.isConnected){s.forEach(c=>{l.includes(c)||y(c)});for(let c of l)s.contains(c)||h(c)}}for(let o in m){let r=m[o],e=(this.countBy[o]||0)+r;e===0?(delete this.countBy[o],this.delete(o)):(o in this.countBy||this.insert(o),this.countBy[o]=e)}}}),this.observer.observe(t,{...i,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let t=this.style?.sheet;if(t?.cssRules)for(let i=t.cssRules.length-1;i>=0;i--)t.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(t){for(let i in this.config.rules){let n=this.config.rules[i],g=this.matches[i],{symbol:b,native:E}=n;if(g&&g.test(t))return{origin:"match",config:n};if(b&&t.startsWith(b))return{origin:"symbol",config:n};if(E&&t.startsWith(E+":"))return{origin:"match",config:n}}for(let i of this.semantics)if(t.match(i[0]))return{origin:"semantics",value:i[1]}}create(t){let i=n=>{if(n in this.ruleBy)return this.ruleBy[n];let g=this.match(n);if(g)return new Q(n,g,this)};return(t in this.classes?this.classes[t].map(n=>i(n)):[i(t)]).filter(n=>n&&n.text)}refresh(t){if(t?.override?this.config=t:this.config=M(T,t),this.cache(),!this.style)return;let i=F();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let n in this.countBy)this.insert(n)}destroy(){let t=O.instances;this.disconnect(),t.splice(t.indexOf(this),1)}delete(t){let i=this.style?.sheet,n=g=>{let b=this.ruleBy[g];if(!(!b||g in this.classesBy&&this.classesBy[g].some(E=>E in this.countBy))){if(i&&b.natives.length){let E=b.natives[0];for(let R=0;R<i.cssRules.length;R++)if(i.cssRules[R]===E.cssRule){for(let C=0;C<b.natives.length;C++)i.deleteRule(R);break}}this.rules.splice(this.rules.indexOf(b),1),delete this.ruleBy[g],b.config.delete&&b.config.delete.call(b,g)}};if(t in this.classes){for(let g of this.classes[t])g in this.countBy||n(g);delete this.ruleBy[t]}else n(t)}insert(t){let i=this.create(t);return i.length?(this.insertRules(i),!0):!1}insertRules(t){for(let i of t){if(this.ruleBy[i.className])continue;let n,g=Object.keys(this.keyframes).length,b=this.rules.length-1,{media:E,order:R,priority:m,hasWhere:C,className:B}=i,a=(h,f,o)=>{let r=h;for(;r<=b;r++){let e=this.rules[r];if(f?.(e))return o?-1:r-1;if(o?.(e))return r}return o?-1:r-1},u,y;if(E){let h=this.rules.findIndex(f=>f.media);if(h===-1)n=b+1;else{let{"max-width":f,"min-width":o}=E.features;if(f||o){let r=this.rules.findIndex(e=>e.media?.features["max-width"]||e.media?.features["min-width"]);if(r===-1)n=b+1;else if(f&&o){if(m===-1?(u=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),y=a(r,e=>e.priority!==-1)):(u=a(r,void 0,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),y=b),u!==-1){let e=f.value-o.value,s=y,l=u;for(u=void 0;s>=l;s--){let{"max-width":c,"min-width":d}=this.rules[s].media.features,p=c.value-d.value;if(p<e)y=s-1;else if(p===e)u=s;else break}}if(u!==-1){let e=f.value-o.value;for(let s=y;s>=u;s--){let{"max-width":l,"min-width":c}=this.rules[s].media.features,d=l.value-c.value;if(d<e)y=s-1;else if(d>e){u=s+1;break}}}}else if(o){if(m===-1?(u=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]),y=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1)):(u=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),y=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),u!==-1)for(let e=y;e>=u;e--){let s=this.rules[e].media.features["min-width"].value;if(s>o.value)y=e-1;else if(s<o.value){u=e+1;break}}}else if(m===-1?(u=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),y=a(r,e=>e.media.features["min-width"]||e.priority!==-1)):(u=a(r,e=>e.media.features["min-width"]&&e.priority!==-1,e=>e.media.features["max-width"]&&e.priority!==-1),y=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),u!==-1)for(let e=y;e>=u;e--){let s=this.rules[e].media.features["max-width"].value;if(s<f.value)y=e-1;else if(s>f.value){u=e+1;break}}}else m===-1?(u=h,y=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]||r.priority!==-1)):(u=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"],r=>r.priority!==-1),y=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=g?1:0;m===-1?(u=h,y=a(h,f=>f.media||f.priority!==-1)):(u=a(h,f=>f.media,f=>f.priority!==-1),y=a(h,f=>f.media))}if(n===void 0)if(u===-1)n=y+1;else{if(m===-1)for(let h=u;h<=y;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)&&(C&&!f.hasWhere||f.order>=R)){n=h;break}}else for(let h=u;h<=y;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)){if(C&&!f.hasWhere){n=h;break}if(f.priority<m){n=h;break}else if(f.priority===m){if(f.order>=R){n=h;break}}else n=h+1}}n===void 0&&(n=y+1)}if(this.rules.splice(n,0,i),this.ruleBy[B]=i,this.style){let h=this.style.sheet,f=0,o=r=>{let e=this.rules[r];if(e){if(!e.natives.length)return o(r-1);let s=e.natives[e.natives.length-1].cssRule;for(let l=0;l<h.cssRules.length;l++)if(h.cssRules[l]===s){f=l+1;break}}};o(n-1);for(let r=0;r<i.natives.length;)try{let e=i.natives[r];h.insertRule(e.text,f),e.cssRule=h.cssRules[f++],r++}catch(e){console.error(e),i.natives.splice(r,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(t=>t.text).join("")}},k=O;S(k,"root"),S(k,"config",T),S(k,"instances",[]),S(k,"refresh",t=>{for(let i of O.instances)i.refresh(t)});N&&(window.MasterCSS=k);export{k as MasterCSS};
|
|
1
|
+
var H=Object.defineProperty;var Q=(x,s,i)=>s in x?H(x,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):x[s]=i;var T=(x,s,i)=>(Q(x,typeof s!="symbol"?s+"":s,i),i);function I(x){let s=typeof Buffer<"u"?Buffer:null;return!!(s&&x instanceof s||x instanceof Date||x instanceof RegExp)}function $(x){if(typeof Buffer<"u"&&Buffer&&x instanceof Buffer){let s=Buffer.alloc(x.length);return x.copy(s),s}else{if(x instanceof Date)return new Date(x.getTime());if(x instanceof RegExp)return new RegExp(x);throw new Error("Unexpected situation")}}function F(x){let s=[];return x.forEach(function(i,o){typeof i=="object"&&i!==null?Array.isArray(i)?s[o]=F(i):I(i)?s[o]=$(i):s[o]=M({},i):s[o]=i}),s}function W(x,s){return s==="__proto__"?void 0:x[s]}function M(...x){let s={},i,o;return x.forEach(function(g){typeof g!="object"||g===null||Array.isArray(g)||Object.keys(g).forEach(function(b){if(o=W(s,b),i=W(g,b),i!==s)if(typeof i!="object"||i===null){s[b]=i;return}else if(Array.isArray(i)){s[b]=F(i);return}else if(I(i)){s[b]=$(i);return}else if(typeof o!="object"||o===null||Array.isArray(o)){s[b]=M({},i);return}else{s[b]=M(o,i);return}})}),s}import{Rule as z}from"./rule.mjs";import{config as N}from"./config/index.mjs";import{rgbToHex as _}from"./utils/rgb-to-hex.mjs";import{SELECTOR_SYMBOLS as Z}from"./constants/selector-symbols.mjs";var L=typeof window<"u",V=()=>{let x=document.createElement("style");return x.id="master",x},S=class{constructor(s=N){this.config=s;s?.override||(this.config=M(N,s),"keyframes"in s&&Object.assign(this.config.keyframes,s.keyframes)),this.cache(),L&&this.config.observe&&this.observe(document),S.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:s,classes:i,selectors:o,themes:g,colors:b,values:j,breakpoints:w,mediaQueries:m,rules:E}=this.config;function C(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(t,n,c="",u={}){let p=R=>R?(c?c+"-":"")+R:c,v=Object.entries(t),B=[],A=[];for(let R of v){let O=R[1];(typeof O=="object"&&!Array.isArray(O)?B:A).push(R)}for(let[R,O]of B)a(O,n,p(R),u);if(n&&c)A.length&&(u[c]=A.reduce((R,[O,D])=>(R[O]=D,R),{}));else for(let[R,O]of A)u[p(R)]=O;return u}function d(t){for(let[n,c]of Object.entries(t))/^[0-9]+x$/.test(n)&&typeof c=="number"&&(t["-"+n]=c*-1);return t}if(s)for(let[t,n]of Object.entries(a(s,!0)))this.semantics.push([new RegExp("^"+C(t)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[t,n]]);if(o)for(let[t,n]of Object.entries(a(o,!1))){let c=new RegExp(C(t)+"(?![a-z-])");for(let u of Array.isArray(n)?n:[n]){let p=u.match(/^::-[a-z]+-/m)?.[0]??"",v=this.selectors[p];v||(v=this.selectors[p]=[]);let B=v.find(([A])=>A===c);B||(B=[c,[]],v.push(B)),B[1].push(u)}}j&&(this.globalValues=d(a(j,!1))),w&&(this.breakpoints=a(w,!1)),m&&(this.mediaQueries=a(m,!1));let y=i?a(i,!1):{},h=g&&!Array.isArray(g)?Object.entries(g).filter(([,{classes:t}])=>t).reduce((t,[n,{classes:c}])=>(t[n]=a(c,!1),t),{}):{},f=[...Object.keys(y),...Object.entries(h).flatMap(([t,n])=>Object.keys(n))],l=t=>{if(t in this.classes)return;let n=this.classes[t]=[],c=(u,p)=>{if(!p)return;let v=Array.isArray(p)?p:p.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let B of v){let A=R=>{R in this.themeAffectedClassesBy?u in this.themeAffectedClassesBy[R]?this.themeAffectedClassesBy[R][u].push(t):this.themeAffectedClassesBy[R][u]=[t]:this.themeAffectedClassesBy[R]={[u]:[t]},n.includes(R)||n.push(R)};if(f.includes(B)){l(B);for(let R of this.classes[B])A(R)}else A(B)}};c("",y?.[t]);for(let[u,p]of Object.entries(h))c(u,p?.[t])};for(let t of f)l(t);for(let t in this.themeAffectedClassesBy){let n=this.classesBy[t]=[];for(let c of Object.values(this.themeAffectedClassesBy[t]))for(let u of c)n.includes(u)||n.push(u)}let r=(t,n)=>{if(!n)return;let c=a(n,!0);for(let[u,p]of Object.entries(c)){let v=typeof p=="string"?{"":p}:p;for(let[B,A]of Object.entries(v)){let R=u+(B?"-"+B:"");R in this.colorThemesMap?this.colorThemesMap[R][t]=A:this.colorThemesMap[R]={[t]:A}}}for(let u in n)this.colorNames.includes(u)||this.colorNames.push(u)};if(r("",b),g)if(Array.isArray(g))this.themeNames.push(...g);else for(let t in g){let n=g[t];r(t,n.colors),this.themeNames.push(t)}let e=t=>{for(let[n,c]of Object.entries(this.colorThemesMap))for(let[u,p]of Object.entries(c))p.startsWith("#")||t(n,c,u,p)};if(e((t,n,c,u)=>{let p=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(u);if(p){let v="#"+_(+p[1],+p[2],+p[3]);p[4]&&(v+=Math.round(255*+p[4]).toString(16)),n[c]=v}}),e((t,n,c,u)=>{let[p,v]=u.split("/"),B=this.colorThemesMap[p];if(B){let A=(c?B[c]:void 0)??B[""];n[c]=v?A.slice(0,7)+Math.round(255*+v).toString(16):A}else console.warn(`\`${u}\` doesn't exist in the extended config \`.colors\``),delete n[c],Object.keys(n).length||delete this.colorThemesMap[t]}),E)for(let t in E){let n=E[t],{native:c,values:u,colored:p}=n,v=n.match;if(n.id=t,n.native=c===!0?t.replace(/(?!^)[A-Z]/g,B=>"-"+B).toLowerCase():void 0,u&&(this.values[t]=d(a(u,!1))),v){let B=Object.keys(this.values[t]??{});v.includes("$values")&&(v=B.length?v.replace(/\$values/,B.join("|")):v.replace(/(?:\|)?\$values/,"")),p&&v.includes("$colors")&&(v=this.colorNames.length?v.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):v.replace(/(?:\|)?\$colors/,"")),this.matches[t]=new RegExp(v)}}}observe(s,i={subtree:!0,childList:!0}){if(this.root!==s){if(L&&s){this.root=s;let o=s===document;o&&(S.root=this),this.host=o?document.documentElement:this.root.host;let g=o?document.head:s,b=o?document.styleSheets:s.styleSheets;for(let w of b){let{ownerNode:m}=w;if(m&&m.id==="master"){this.style=m;break}}if(this.style)for(let w=0;w<this.style.sheet.cssRules.length;w++){let m=this.style.sheet.cssRules[w];if(m.constructor.name==="CSSKeyframesRule")continue;let E=a=>{if(a.selectorText){let y=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<y.length;h++){let f=y[h];if(f[0]==="."){let l=f.slice(1),r="";for(let e=0;e<l.length;e++){let t=l[e],n=l[e+1];if(t==="\\"){if(e++,n!=="\\"){r+=n;continue}}else if(Z.includes(t))break;r+=t}if(!(r in this.ruleBy)&&!(r in this.classes)){let e=this.create(r)[0];if(e)return e}}}}else if(a.cssRules)for(let d=0;d<a.cssRules.length;d++){let y=E(a.cssRules[d]);if(y)return y}},C=E(m);if(C){this.rules.push(C),this.ruleBy[C.className]=C;for(let a=0;a<C.natives.length;a++)C.natives[a].cssRule=this.style.sheet.cssRules[w+a];w+=C.natives.length-1,C.config.insert?.call(C)}}else this.style=V(),g.append(this.style);let j=w=>{w.forEach(m=>{m in this.countBy?this.countBy[m]++:(this.countBy[m]=1,this.insert(m))})};j(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(w=>j(w.classList)),this.observer=new MutationObserver(w=>{let m={},E=[],C=[],a=[],d=(l,r)=>{r?l.classList.forEach(h):l.classList.forEach(y);let e=l.children;for(let t=0;t<e.length;t++){let n=e[t];n.classList&&(C.push(n),d(n,r))}},y=l=>{l in m?m[l]++:m[l]=1},h=l=>{l in m?m[l]--:l in this.countBy&&(m[l]=-1)},f=(l,r)=>{for(let e=0;e<l.length;e++){let t=l[e];t.classList&&!C.includes(t)&&!a.includes(t)&&(t.isConnected!==r?(C.push(t),d(t,r)):a.push(t))}};for(let l=0;l<w.length;l++){let r=w[l],{addedNodes:e,removedNodes:t,type:n,target:c}=r;if(n==="attributes"){if(E.find(u=>u.target===c))continue;E.push(r)}else f(e,!1),(!c.isConnected||!C.includes(c))&&f(t,!0)}if(!(!E.length&&!Object.keys(m).length)){for(let{oldValue:l,target:r}of E){let e=C.includes(r),t=r.classList,n=l?l.split(" "):[];if(e){if(r.isConnected)continue;for(let c of n)t.contains(c)||h(c)}else if(r.isConnected){t.forEach(c=>{n.includes(c)||y(c)});for(let c of n)t.contains(c)||h(c)}}for(let l in m){let r=m[l],e=(this.countBy[l]||0)+r;e===0?(delete this.countBy[l],this.delete(l)):(l in this.countBy||this.insert(l),this.countBy[l]=e)}}}),this.observer.observe(s,{...i,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let s=this.style?.sheet;if(s?.cssRules)for(let i=s.cssRules.length-1;i>=0;i--)s.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(s){for(let i in this.config.rules){let o=this.config.rules[i],g=this.matches[i],{symbol:b,native:j}=o;if(g&&g.test(s))return{origin:"match",config:o};if(b&&s.startsWith(b))return{origin:"symbol",config:o};if(j&&s.startsWith(j+":"))return{origin:"match",config:o}}for(let i of this.semantics)if(s.match(i[0]))return{origin:"semantics",value:i[1]}}create(s){let i=o=>{if(o in this.ruleBy)return this.ruleBy[o];let g=this.match(o);if(g)return new z(o,g,this)};return(s in this.classes?this.classes[s].map(o=>i(o)):[i(s)]).filter(o=>o&&o.text)}refresh(s){if(s?.override?this.config=s:this.config=M(N,s),this.cache(),!this.style)return;let i=V();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let o in this.countBy)this.insert(o)}destroy(){let s=S.instances;this.disconnect(),s.splice(s.indexOf(this),1)}delete(s){let i=this.style?.sheet,o=g=>{let b=this.ruleBy[g];if(!(!b||g in this.classesBy&&this.classesBy[g].some(j=>j in this.countBy))){if(i&&b.natives.length){let j=b.natives[0];for(let w=0;w<i.cssRules.length;w++)if(i.cssRules[w]===j.cssRule){for(let E=0;E<b.natives.length;E++)i.deleteRule(w);break}}this.rules.splice(this.rules.indexOf(b),1),delete this.ruleBy[g],b.config.delete&&b.config.delete.call(b,g)}};if(s in this.classes){for(let g of this.classes[s])g in this.countBy||o(g);delete this.ruleBy[s]}else o(s)}insert(s){let i=this.create(s);return i.length?(this.insertRules(i),!0):!1}insertRules(s){for(let i of s){if(this.ruleBy[i.className])continue;let o,g=Object.keys(this.keyframes).length,b=this.rules.length-1,{media:j,order:w,priority:m,hasWhere:E,className:C}=i,a=(h,f,l)=>{let r=h;for(;r<=b;r++){let e=this.rules[r];if(f?.(e))return l?-1:r-1;if(l?.(e))return r}return l?-1:r-1},d,y;if(j){let h=this.rules.findIndex(f=>f.media);if(h===-1)o=b+1;else{let{"max-width":f,"min-width":l}=j.features;if(f||l){let r=this.rules.findIndex(e=>e.media?.features["max-width"]||e.media?.features["min-width"]);if(r===-1)o=b+1;else if(f&&l){if(m===-1?(d=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),y=a(r,e=>e.priority!==-1)):(d=a(r,void 0,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),y=b),d!==-1){let e=f.value-l.value,t=y,n=d;for(d=void 0;t>=n;t--){let{"max-width":c,"min-width":u}=this.rules[t].media.features,p=c.value-u.value;if(p<e)y=t-1;else if(p===e)d=t;else break}}if(d!==-1){let e=f.value-l.value;for(let t=y;t>=d;t--){let{"max-width":n,"min-width":c}=this.rules[t].media.features,u=n.value-c.value;if(u<e)y=t-1;else if(u>e){d=t+1;break}}}}else if(l){if(m===-1?(d=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]),y=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1)):(d=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),y=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=y;e>=d;e--){let t=this.rules[e].media.features["min-width"].value;if(t>l.value)y=e-1;else if(t<l.value){d=e+1;break}}}else if(m===-1?(d=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),y=a(r,e=>e.media.features["min-width"]||e.priority!==-1)):(d=a(r,e=>e.media.features["min-width"]&&e.priority!==-1,e=>e.media.features["max-width"]&&e.priority!==-1),y=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=y;e>=d;e--){let t=this.rules[e].media.features["max-width"].value;if(t<f.value)y=e-1;else if(t>f.value){d=e+1;break}}}else m===-1?(d=h,y=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]||r.priority!==-1)):(d=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"],r=>r.priority!==-1),y=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=g?1:0;m===-1?(d=h,y=a(h,f=>f.media||f.priority!==-1)):(d=a(h,f=>f.media,f=>f.priority!==-1),y=a(h,f=>f.media))}if(o===void 0)if(d===-1)o=y+1;else{if(m===-1)for(let h=d;h<=y;h++){let f=this.rules[h];if(!(!E&&f.hasWhere)&&(E&&!f.hasWhere||f.order>=w)){o=h;break}}else for(let h=d;h<=y;h++){let f=this.rules[h];if(!(!E&&f.hasWhere)){if(E&&!f.hasWhere){o=h;break}if(f.priority<m){o=h;break}else if(f.priority===m){if(f.order>=w){o=h;break}}else o=h+1}}o===void 0&&(o=y+1)}if(this.rules.splice(o,0,i),this.ruleBy[C]=i,this.style){let h=this.style.sheet,f=0,l=r=>{let e=this.rules[r];if(e){if(!e.natives.length)return l(r-1);let t=e.natives[e.natives.length-1].cssRule;for(let n=0;n<h.cssRules.length;n++)if(h.cssRules[n]===t){f=n+1;break}}};l(o-1);for(let r=0;r<i.natives.length;)try{let e=i.natives[r];h.insertRule(e.text,f),e.cssRule=h.cssRules[f++],r++}catch(e){console.error(e),i.natives.splice(r,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(s=>s.text).join("")}},k=S;T(k,"root"),T(k,"config",N),T(k,"instances",[]),T(k,"refresh",s=>{for(let i of S.instances)i.refresh(s)});L&&(window.MasterCSS=k);export{k as MasterCSS};
|
package/dist/index.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var Ne=Object.defineProperty;var ze=(t,e,i)=>e in t?Ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var oe=(t,e,i)=>(ze(t,typeof e!="symbol"?e+"":e,i),i);function we(t){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&t instanceof e||t instanceof Date||t instanceof RegExp)}function ke(t){if(typeof Buffer<"u"&&Buffer&&t instanceof Buffer){let e=Buffer.alloc(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Se(t){let e=[];return t.forEach(function(i,s){typeof i=="object"&&i!==null?Array.isArray(i)?e[s]=Se(i):we(i)?e[s]=ke(i):e[s]=G({},i):e[s]=i}),e}function ye(t,e){return e==="__proto__"?void 0:t[e]}function G(...t){let e={},i,s;return t.forEach(function(c){typeof c!="object"||c===null||Array.isArray(c)||Object.keys(c).forEach(function(o){if(s=ye(e,o),i=ye(c,o),i!==e)if(typeof i!="object"||i===null){e[o]=i;return}else if(Array.isArray(i)){e[o]=Se(i);return}else if(we(i)){e[o]=ke(i);return}else if(typeof s!="object"||s===null||Array.isArray(s)){e[o]=G({},i);return}else{e[o]=G(s,i);return}})}),e}var ie={"(":")","'":"'",'"':'"',"{":"}"};function le(t){if(typeof CSS<"u")return CSS.escape(t);if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");let e=String(t),i=e.length,s=-1,c="",o,y=e.charCodeAt(0);if(i==1&&y==45)return"\\"+e;for(;++s<i;){if(o=e.charCodeAt(s),o==0){c+="\uFFFD";continue}if(o>=1&&o<=31||o==127||s==0&&o>=48&&o<=57||s==1&&o>=48&&o<=57&&y==45){c+="\\"+o.toString(16)+" ";continue}if(o>=128||o==45||o==95||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122){c+=e.charAt(s);continue}c+="\\"+e.charAt(s)}return c}var Fe={unit:"",order:0,separators:[","]},ce=class{constructor(e,i={},s){this.className=e;this.meta=i;this.css=s;this.config=G(Fe,i.config);let{unit:c,order:o,colored:y,native:w,analyze:h,transform:l,declare:d,create:n}=this.config,{scope:f,important:x,functions:S,themeDriver:k}=s.config,{themeNames:p,colorNames:u,colorThemesMap:r,selectors:a,breakpoints:b,mediaQueries:v,themeAffectedClassesBy:R,globalValues:j}=s,A=R[e];n&&n.call(this,e);let P,I,_,re,q;if(i.origin==="semantics"){let[W,O]=i.value;re=e.slice(W.length),P=O}else{let W;if(h)[W,_]=h.call(this,e);else if(i.origin==="match"){let B=e.indexOf(":");this.prefix=e.slice(0,B+1),W=e.slice(B+1)}else i.origin==="symbol"&&(this.symbol=e[0],W=e.slice(1));q=[];let O=this,L=this.values,z=[","];this.config.separators.length&&z.push(...this.config.separators);let C="",g=0;(function B(m,M,T,$=void 0,E=[],X=[],D){let U=$===void 0,F,J=N=>N==="'"||N==='"',ee=()=>F=C.length,Z=()=>{if(C){let N=C,V=U?N:C.slice(F);if(C="",Q="",L&&V in L&&!E.includes(V)){let H=g;g=0,B(L[V].toString(),M,void 0,$,[...E,V],X,D),g=H,U||(C=C.slice(0,F)+C)}else if(j&&V in j&&!X.includes(V)){let H=g;g=0,B(j[V].toString(),M,void 0,$,E,[...X,V],D),g=H,U||(C=C.slice(0,F)+C)}else if(U){let H=!D&&O.analyzeUnitValue(V,M);q.push({value:H?.value??V,unit:H?.unit})}else{let H=!D&&O.analyzeUnitValue(V,M);C=H?N.slice(0,F)+H.value+H.unit:N}ee()}},K=J(T);ee();let Q="";for(;g<m.length;g++){let N=m[g];if(N===T){if(K){C+=N;let V=0;for(let H=C.length-2;C[H]==="\\";H--)V++;if(V%2)continue}else Z(),C+=N;return}else if(!K&&N in ie){let V=N==="("&&Q&&S?.[Q];V?.name&&(C=C.slice(0,C.length-Q.length)+V.name,Q=V.name),C+=N,g++;let H=ie[N];B(m,V?.unit??M,H,Q||$||"",E,X,D||!!V?.transform),V?.transform&&(C=C.slice(0,F+Q.length+1)+V.transform.call(O,C.slice(F+Q.length+1,-1))+C.slice(-1)),U&&(J(H)?(q.push(C),C=""):Z()),Q=""}else if((N==="|"||N===" ")&&T!=="}"&&(!K||$==="path"))Z(),U||(C+=" ",F++);else{if(!K){if(N==="."){if(isNaN(+m[g+1]))break;m[g-1]==="-"&&(C+="0")}else if(z.includes(N)){Z(),U?q.push(N):(C+=N,F++);continue}else if(U&&(N==="#"&&(C||q.length&&m[g-1]!=="|"&&q[g-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(N)))break;Q+=N}C+=N}}$===void 0&&Z()})(W,c),re=W.slice(g)}this.order=typeof o=="function"?o.call(this,this.prefix):o,re[0]==="!"&&(this.important=!0,re=re.slice(1));let xe=W=>{let O=W.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((g,B)=>B%3?g:g.replace(/_/g," ")).join(""),L=[],z="",C=0;for(let g=0;g<O.length;g++){let B=O[g];if(B==="\\"){z+=B+O[++g];continue}!C&&B===","?(L.push(z),z=""):(z+=B,C&&B===")"?C--:B==="("&&C++)}return z&&L.push(z),L};this.prefixSelectors=_?xe(_):[""];let fe=re.split("@"),me=fe[0];if(me){this.vendorSuffixSelectors={};let W=(g,B,m,M)=>{for(let[T,$]of B)if(T.test(g)){for(let E of $)W(g.replace(T,E),B,m,!0);return}M&&m.push(g)},O=[];""in a?W(me,a[""],O,!0):O.push(me);let L={};for(let[g,B]of Object.entries(a)){if(!g)continue;let m=[];for(let M of O)W(M,B,m,!1);m.length&&(L[g]=m)}let z=(g,B)=>{let m=B.reduce((M,T)=>(M.push(...xe(T)),M),[]);g in this.vendorSuffixSelectors?this.vendorSuffixSelectors[g].push(...m):this.vendorSuffixSelectors[g]=m},C=Object.keys(L);if(C.length)for(let g of C)z(g,L[g]);else z("",O);for(let g of Object.values(this.vendorSuffixSelectors))for(let B of g){this.hasWhere!==!1&&(this.hasWhere=B.includes(":where("));let m=[":disabled",":active",":focus",":hover"];for(let M=0;M<m.length;M++)if(B.includes(m[M])){(this.priority===-1||this.priority>M)&&(this.priority=M);break}}}else this.vendorSuffixSelectors={"":[""]};for(let W=1;W<fe.length;W++){let O=fe[W];if(O)if(p.includes(O))this.theme=O;else if(O==="rtl"||O==="ltr")this.direction=O;else{let L,z,C=O.indexOf("_");if(C!==-1)L=O.slice(0,C),z=O.slice(C);else{let g=O.indexOf("(");g!==-1&&(L=O.slice(0,g),z=O.slice(g))}if(!L){L="media";let g=[];this.media={token:O,features:{}};let B=O.split("&");for(let m of B)if(m==="all"||m==="print"||m==="screen"||m==="speech")this.media.type=m;else if(m==="\u{1F5A8}")this.media.type="print";else if(m==="landscape"||m==="portrait")g.push("(orientation:"+m+")");else if(m==="motion"||m==="reduced-motion")g.push("(prefers-reduced-motion:"+(m==="motion"?"no-preference":"reduce")+")");else if(v&&m in v)g.push(v[m]);else{let M={token:m},T="",$="",E=0;m.startsWith("<=")?($="<=",T="max-width"):m.startsWith(">=")||b[m]?($=">=",T="min-width"):m.startsWith(">")?($=">",T="min-width",E=.02):m.startsWith("<")&&($="<",T="max-width",E=-.02);let X=$?m.replace($,""):m,D=b[X];switch(T){case"max-width":case"min-width":D?Object.assign(M,this.analyzeUnitValue(D.toString(),"px")):Object.assign(M,this.analyzeUnitValue(X,"px")),M.unit==="px"&&(M.value+=E),this.media.features[T]=M,g.push("("+T+":"+(M.value+M.unit)+")");break}}z="",this.media.type&&(z=this.media.type),g.length&&(z+=(z?" and ":"")+g.join(" and "))}z&&(this.at[L]=(L in this.at?this.at[L]+" and ":"")+z.replace(/_/g," "))}}let he=(W,O)=>{let L,z=(B,m,M)=>{let T="";this.direction&&(T+="[dir="+this.direction+"] ");let $=this.prefixSelectors.map(D=>D+T),E=(D,U)=>$.map(F=>(D&&k!=="media"?k==="host"?`:host(.${D}) `:`.${D} `:"")+(f?f+" ":"")+F).reduce((F,J)=>(F.push(M.reduce((ee,Z)=>(ee.push(J+"."+le(U)+Z),ee),[]).join(",")),F),[]).join(","),X=E(m,e)+(A?Object.entries(A).filter(([D])=>this.theme||!y||!m||!D||D===m).map(([D,U])=>U.reduce((F,J)=>F+","+E(this.theme??((y||I)&&m||D),J),"")).join(""):"")+"{"+B+"}";for(let D of Object.keys(this.at).sort((U,F)=>F==="supports"?-1:1))X="@"+D+" "+this.at[D]+"{"+X+"}";return m&&k==="media"&&(X=`@media(prefers-color-scheme:${m}){`+X+"}"),X},C=[];if(q){let B=[this.theme??W,""],m,M=!1;for(let T of q)if(typeof T=="string")C.push(T);else{let $=T.value;if(T.unit)$+=T.unit;else if(y&&r&&u){let E=!1;$=$.replace(new RegExp(`(^|,| |\\()((?:${u.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(X,D,U,F)=>{let J=r[U];if(J){let ee,Z;for(let K of B)if(ee=J[K]){Z=K;break}if(ee){E=!O||Z===W,m||(m=E);let K=ee;if(F){let Q=F.endsWith("%")?parseFloat(F)/100:+F;Q=isNaN(Q)?1:Math.min(Math.max(Q,0),1),K+=Math.round(Q*255).toString(16).toUpperCase().padStart(2,"0")}return D+K}else M=!0}return X})}C.push($)}if(O&&(M||(m===void 0?W:!m)))return;if(L=C.reduce((T,$,E)=>T+$+($===","||q[E+1]===","||E===q.length-1?"":" "),""),l&&(L=l.call(this,L,this.css.config)),y&&L==="current"&&(L="currentColor"),d){let T,$;if(q.length===1){let E=q[0];typeof E=="object"&&(T=E.value,$=E.unit)}P=d.call(this,$?T:L,$||"")}else P={[w]:L}}let g={};for(let B in P){let m=($,E)=>{let X=E+((this.important||x)&&!E.endsWith("!important")?"!important":"");$ in g?g[$].push(X):g[$]=[X]},M=B+":",T=P[B];if(typeof T=="object")if(Array.isArray(T))for(let $ of T)m(W,M+$.toString());else{I=!0;for(let $ in T)m($,M+T[$])}else m(W,M+T.toString())}for(let B of Object.values(this.vendorSuffixSelectors))for(let m in g)this.natives.push({text:z(g[m].join(";"),m,B),theme:m})};if(this.theme)he(this.theme,!1);else if(y)for(let W of p)he(W,!0);else he("",!1)}at={};priority=-1;natives=[];keyframeNames;config;get values(){return this.css.values[this.config.id]}get text(){return this.natives.map(e=>e.text).join("")}resolveValue(e,i){return Number.isNaN(+e)?e:e/(i==="rem"||i==="em"?this.css.config.rootSize:1)+i}analyzeUnitValue(e,i){let s=i??this.config.unit;if(s){let c="",o=e.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(o)if(e.includes("/")){let[y,w]=e.split("/");return{value:+y/+w*100+"%",unit:c}}else{let y=+o[1];return c=o[3]||"",c||((s==="rem"||s==="em")&&(y=y/this.css.config.rootSize),c=s||""),{value:y,unit:c}}}}};var Ce={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560};function se(t){t.startsWith("#")&&(t=t.slice(1));let e=t.match(/.{1,2}/g);return[parseInt(e[0],16),parseInt(e[1],16),parseInt(e[2],16)]}function ue(t,e,i){return((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)}function Y(t){typeof t=="string"&&(t={"":t});let e=""in t,i=!1;for(let s in t)if(s&&+s>=100){i=!0;break}if(!i&&(!e||Object.keys(t).length>1)){let s=0,c="0"in t?se(t[0]):[0,0,0],o,y,w=[],h=()=>{let l=o-s,d=y.map((n,f)=>(n-c[f])/l);for(let n of w){let f=n-s,x=c.map((S,k)=>Math.round(S+d[k]*f));t[n]="#"+ue.call(this,...x)}};for(let l=1;l<100;l++)l in t?(w.length?(o=l,y=se(t[l]),h(),w.length=0,c=y):c=se(t[l]),s=l):w.push(l);w.length&&(o=100,y="100"in t?se(t[100]):[255,255,255],h())}return e||(t[""]=t[i?"500":"50"]),t}var Re={black:"#000000",white:"#ffffff",slate:Y({5:"#141e2b",10:"#19212d",20:"#262f3e",30:"#323e52",40:"#41516b",50:"#616a84",55:"#6c7693",60:"#959db3",70:"#a3abbf",80:"#d7dae3",95:"#f6f7f8"}),gray:Y({5:"#1e1d1f",10:"#212022",20:"#2f2e30",30:"#3e3d40",40:"#504f52",50:"#6b6a6d",55:"#777679",60:"#9e9da0",70:"#abaaae",80:"#dad9db",95:"#f5f4f7"}),brown:Y({5:"#271b15",10:"#2b1e18",20:"#3c2b22",30:"#50382c",40:"#694839",50:"#8d604b",55:"#9d6b53",60:"#b79788",70:"#c1a598",80:"#efd5c9",95:"#faf2ef"}),orange:Y({5:"#2e1907",10:"#331b07",20:"#47260b",30:"#5d320e",40:"#7a4111",50:"#a15717",55:"#b4611a",60:"#e38739",70:"#e79855",80:"#f7d4b5",95:"#fcf1e7"}),gold:Y({5:"#281b00",10:"#2d1e01",20:"#3f2a00",30:"#543800",40:"#6d4900",50:"#906000",55:"#9c6d00",60:"#d09100",70:"#dca000",80:"#fbd67f",95:"#fff3d8"}),yellow:Y({5:"#251d00",10:"#282000",20:"#3a2e01",30:"#4b3b00",40:"#624e00",50:"#806700",55:"#8e7200",60:"#be9900",70:"#d0a700",80:"#edda8f",95:"#fff5ca"}),grass:Y({5:"#162106",10:"#182406",20:"#223308",30:"#2c4408",40:"#3a570b",50:"#4e750e",60:"#74ae15",70:"#7dbc17",80:"#bfe87c",95:"#ebfad4"}),green:Y({5:"#042311",10:"#032611",20:"#023717",30:"#03481f",40:"#025d26",50:"#067b34",55:"#07883a",60:"#09b64d",70:"#0ac553",80:"#80f1a4",95:"#e0fae8"}),beryl:Y({5:"#002319",10:"#00271c",20:"#003626",30:"#004732",40:"#005c41",50:"#007954",55:"#00875e",60:"#00b37c",70:"#00c387",80:"#72f0c5",95:"#d6fcef"}),teal:Y({5:"#012220",10:"#012624",20:"#003532",30:"#004541",40:"#005a54",50:"#00776f",55:"#00857c",60:"#00b1a5",70:"#00bfb2",80:"#6aeee5",95:"#d4fcf8"}),cyan:Y({5:"#00222b",10:"#00252e",20:"#013340",30:"#004457",40:"#00576f",50:"#007391",55:"#0080a1",60:"#00abd7",70:"#00b9e9",80:"#97e6fa",95:"#dff8ff"}),sky:Y({5:"#031f34",10:"#032339",20:"#04314e",30:"#044169",40:"#065386",50:"#086eb3",55:"#097ac5",60:"#29a4f5",70:"#4db3f7",80:"#b3e0ff",95:"#eaf6fe"}),blue:Y({5:"#07194a",10:"#081c53",20:"#0a2773",30:"#0e3496",40:"#1146b6",50:"#175fe9",55:"#2671ea",60:"#6b9ef1",70:"#81acf3",80:"#c6dbfe",95:"#edf4fe"}),indigo:Y({5:"#1f1645",10:"#20174f",20:"#2b1f74",30:"#37289d",40:"#463fb1",50:"#5a5bd5",55:"#6464f1",60:"#9393f5",70:"#a1a5ee",80:"#d5d7fe",95:"#f1f2ff"}),violet:Y({5:"#2b0a4e",10:"#2e0b57",20:"#3d1179",30:"#4e169f",40:"#5f2eba",50:"#7949e5",55:"#8755f5",60:"#ac8af8",70:"#b89bf9",80:"#e1d4fe",95:"#f5f1ff"}),purple:Y({5:"#2e0c47",10:"#330c4e",20:"#460f6c",30:"#5b1390",40:"#7421b1",50:"#9832e4",55:"#a348e7",60:"#c184ef",70:"#ca96f1",80:"#ead1fe",95:"#f9f0ff"}),fuchsia:Y({5:"#39092a",10:"#400932",20:"#560d4a",30:"#6f1165",40:"#8c158a",50:"#b61cbb",55:"#ca1fce",60:"#e66ee9",70:"#ea86ed",80:"#facbfb",95:"#feefff"}),pink:Y({5:"#3d0722",10:"#430725",20:"#5d0933",30:"#790d44",40:"#9a1058",50:"#ca1473",55:"#e11681",60:"#f170b4",70:"#f388c0",80:"#fdcde6",95:"#fff0f8"}),crimson:Y({5:"#430213",10:"#470314",20:"#62041c",30:"#800524",40:"#9f1036",50:"#ce1a4b",55:"#e8144c",60:"#f37596",70:"#f58ba7",80:"#fdceda",95:"#fff1f4"}),red:Y({5:"#450001",10:"#490102",20:"#640304",30:"#800506",40:"#a11012",50:"#d11a1e",55:"#ed0a0e",60:"#f97476",70:"#fa8b8d",80:"#fdcfcf",95:"#fff1f1"})};var $e="";var Te={"::scrollbar":"::-webkit-scrollbar","::scrollbar-button":"::-webkit-scrollbar-button","::scrollbar-thumb":"::-webkit-scrollbar-thumb","::scrollbar-track":"::-webkit-scrollbar-track","::scrollbar-track-piece":"::-webkit-scrollbar-track-piece","::scrollbar-corner":"::-webkit-scrollbar-corner","::slider-thumb":["::-webkit-slider-thumb","::-moz-range-thumb"],"::slider-runnable-track":["::-webkit-slider-runnable-track","::-moz-range-track"],"::meter":"::-webkit-meter","::resizer":"::-webkit-resizer","::progress":"::-webkit-progress",":first":":first-child",":last":":last-child",":even":":nth-child(2n)",":odd":":nth-child(odd)",":nth(":":nth-child("};var Be={square:{"aspect-ratio":"1/1"},video:{"aspect-ratio":"16/9"},rounded:{"border-radius":"1e9em"},round:{"border-radius":"50%"},hidden:{display:"none"},hide:{display:"none"},block:{display:"block"},table:{display:"table"},flex:{display:"flex"},grid:{display:"grid"},contents:{display:"contents"},inline:{display:"inline"},"inline-block":{display:"inline-block"},"inline-flex":{display:"inline-flex"},"inline-grid":{display:"inline-grid"},"inline-table":{display:"inline-table"},"table-cell":{display:"table-cell"},"table-caption":{display:"table-caption"},"flow-root":{display:"flow-root"},"list-item":{display:"list-item"},"table-row":{display:"table-row"},"table-column":{display:"table-column"},"table-row-group":{display:"table-row-group"},"table-column-group":{display:"table-column-group"},"table-header-group":{display:"table-header-group"},"table-footer-group":{display:"table-footer-group"},italic:{"font-style":"italic"},oblique:{"font-style":"oblique"},isolate:{isolation:"isolate"},overflowed:{overflow:"visible"},untouchable:{"pointer-events":"none"},static:{position:"static"},fixed:{position:"fixed"},abs:{position:"absolute"},rel:{position:"relative"},sticky:{position:"sticky"},uppercase:{"text-transform":"uppercase"},lowercase:{"text-transform":"lowercase"},capitalize:{"text-transform":"capitalize"},visible:{visibility:"visible"},invisible:{visibility:"hidden"},vw:{width:"100vw"},vh:{height:"100vh"},"max-vw":{"max-width":"100vw"},"max-vh":{"max-height":"100vh"},"min-vw":{"min-width":"100vw"},"min-vh":{"min-height":"100vh"},"center-content":{"justify-content":"center","align-items":"center"},"sr-only":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap","border-width":"0"},full:{width:"100%",height:"100%"},center:{left:0,right:0,"margin-left":"auto","margin-right":"auto"},middle:{top:0,bottom:0,"margin-top":"auto","margin-bottom":"auto"},"break-spaces":{"white-space":"break-spaces"},"break-word":{"overflow-wrap":"break-word",overflow:"hidden"},"gradient-text":{"-webkit-text-fill-color":"transparent","-webkit-background-clip":"text","background-clip":"text"}};var Me=["dark","light"];var Ve={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(t){let e=0;for(;e<t.length&&!(t[e]==="{"&&t[e-1]!=="\\");e++);return[t.slice(e),t.slice(0,e)]},declare(t){let e={},i=(l,d)=>{let n=d.indexOf(":");if(n!==-1){l in e||(e[l]={});let f=e[l],x=d.slice(0,n);x in f||(f[x]=d.slice(n+1))}},s=l=>{let d=(n,f)=>{let x=f.slice(le(l.className).length).match(/\{(.*)\}/)[1].split(";");for(let S of x)i(n,S)};if(this.theme){let n=l.natives.find(f=>f.theme===this.theme)??l.natives.find(f=>!f.theme);n&&d(this.theme,n.text)}else for(let n of l.natives)d(n.theme,n.text);if(l.keyframeNames){this.keyframeNames||(this.keyframeNames=[]);for(let n of l.keyframeNames)this.keyframeNames.includes(n)||this.keyframeNames.push(n)}},c=[],o="",y=()=>{o&&(c.push(o.replace(/ /g,"|")),o="")},w=1;(function l(d){for(;w<t.length;w++){let n=t[w];if(!d){if(n===";"){y();continue}if(n==="}")break}if(o+=n,d===n){if(d==="'"||d==='"'){let f=0;for(let x=o.length-2;o[x]==="\\";x--)f++;if(f%2)continue}break}else n in ie&&d!=="'"&&d!=='"'&&(w++,l(ie[n]))}})(void 0),y();for(let l of c){let d=this.css.create(l);if(Array.isArray(d))for(let n of d)s(n);else d?s(d):i(this.theme??"",l)}let h={};for(let l in e)for(let[d,n]of Object.entries(e[l]))d in h?h[d][l]=n:h[d]={[l]:n};return h},delete(){return ge.call(this)},insert(){return pe.call(this)}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(t){return{["--"+this.prefix.slice(1,-1)]:t}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(t){switch(t){case"subpixel-antialiased":return{"-webkit-font-smoothing":"auto","-moz-osx-font-smoothing":"auto"};case"antialiased":return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"}}}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},marginLeft:{match:"^ml:.",native:!0,unit:"rem"},marginRight:{match:"^mr:.",native:!0,unit:"rem"},marginTop:{match:"^mt:.",native:!0,unit:"rem"},marginBottom:{match:"^mb:.",native:!0,unit:"rem"},marginX:{match:"^(?:mx|margin-x):.",unit:"rem",order:-.5,declare(t,e){return{"margin-left":t+e,"margin-right":t+e}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(t,e){return{"margin-top":t+e,"margin-bottom":t+e}}},margin:{match:"^m:.",native:!0,unit:"rem",order:-1},paddingLeft:{match:"^pl:.",native:!0,unit:"rem"},paddingRight:{match:"^pr:.",native:!0,unit:"rem"},paddingTop:{match:"^pt:.",native:!0,unit:"rem"},paddingBottom:{match:"^pb:.",native:!0,unit:"rem"},paddingX:{match:"^(?:px|padding-x):.",unit:"rem",order:-.5,declare(t,e){return{"padding-left":t+e,"padding-right":t+e}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(t,e){return{"padding-top":t+e,"padding-bottom":t+e}}},padding:{match:"^p:.",native:!0,unit:"rem",order:-1},flexBasis:{values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},height:{match:"^h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t]},declare(t){let[e,i]=t.split(" x ");return{width:e,height:i}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t.slice(4)]},declare(t){let[e,i]=t.split(" x ");return{"min-width":e,"min-height":i}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t.slice(4)]},declare(t){let[e,i]=t.split(" x ");return{"max-width":e,"max-height":i}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},top:{native:!0,unit:"rem"},bottom:{native:!0,unit:"rem"},left:{native:!0,unit:"rem"},right:{native:!0,unit:"rem"},inset:{native:!0,unit:"rem",order:-1},lines:{match:"^lines:.",declare(t,e){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":t+e}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflowX:{native:!0,declare(t,e){return t==="overlay"?{"overflow-x":["auto",t]}:{"overflow-x":t}}},overflowY:{native:!0,declare(t,e){return t==="overlay"?{"overflow-y":["auto",t]}:{"overflow-y":t}}},overflow:{native:!0,order:-1,declare(t,e){return t==="overlay"?{overflow:["auto",t]}:{overflow:t}}},overscrollBehaviorX:{native:!0},overscrollBehaviorY:{native:!0},overscrollBehavior:{native:!0,order:-1},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{declare(t,e){return{"user-drag":t+e,"-webkit-user-drag":t+e}}},userSelect:{native:!0,declare(t,e){return{"user-select":t+e,"-webkit-user-select":t+e}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(t,e){return{"font-size":t+e,"line-height":e==="em"?t+.875+e:`calc(${t}${e} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(t,e){return{"-webkit-text-fill-color":t+e}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(t,e){return{"-webkit-text-stroke-width":t+e}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(t,e){return{"-webkit-text-stroke-color":t+e}}},textStroke:{unit:"rem",native:!0,declare(t,e){return{"-webkit-text-stroke":t+e}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(t){return je.call(this,t)},delete(){return ge.call(this)},insert(){return pe.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(t){return je.call(this,t)},delete(){return ge.call(this)},insert(){return pe.call(this)}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderTopColor:{match:"^b(?:t|order-top(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderBottomColor:{match:"^b(?:b|order-bottom(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderLeftColor:{match:"^b(?:l|order-left(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderRightColor:{match:"^b(?:r|order-right(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderXColor:{match:"^b(?:x|order-x(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(t,e){return{"border-left-color":t+e,"border-right-color":t+e}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(t,e){return{"border-top-color":t+e,"border-bottom-color":t+e}}},borderColor:{match:"^b(?:order)?(?:-color)?:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,order:-1,colored:!0,values:{current:"currentColor"}},borderTopLeftRadius:{match:"^r(?:tl|lt):.",unit:"rem",native:!0},borderTopRightRadius:{match:"^r(?:tr|rt):.",unit:"rem",native:!0},borderBottomLeftRadius:{match:"^r(?:bl|lb):.",unit:"rem",native:!0},borderBottomRightRadius:{match:"^r(?:br|rb):.",unit:"rem",native:!0},borderTopRadius:{match:"^rt:.",unit:"rem",order:-.5,declare(t,e){return{"border-top-left-radius":t+e,"border-top-right-radius":t+e}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(t,e){return{"border-bottom-left-radius":t+e,"border-bottom-right-radius":t+e}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(t,e){return{"border-top-left-radius":t+e,"border-bottom-left-radius":t+e}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(t,e){return{"border-top-right-radius":t+e,"border-bottom-right-radius":t+e}}},borderRadius:{match:"^r:.",unit:"rem",native:!0,order:-1},borderTopStyle:{match:"^b(?:t|order-top(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderBottomStyle:{match:"^b(?:b|order-bottom(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderLeftStyle:{match:"^b(?:l|order-left(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderRightStyle:{match:"^b(?:r|order-right(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderXStyle:{match:"^b(?:x|order-x(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(t,e){return{"border-left-style":t+e,"border-right-style":t+e}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(t,e){return{"border-top-style":t+e,"border-bottom-style":t+e}}},borderStyle:{match:"^b(?:order)?(?:-style)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0,order:-1},borderTopWidth:{match:"^b(?:t|order-top(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderBottomWidth:{match:"^b(?:b|order-bottom(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderLeftWidth:{match:"^b(?:l|order-left(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderRightWidth:{match:"^b(?:r|order-right(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderXWidth:{match:"^b(?:x|order-x(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(t,e){return{"border-left-width":t+e,"border-right-width":t+e}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(t,e){return{"border-top-width":t+e,"border-bottom-width":t+e}}},borderWidth:{match:"^b(?:order)?(?:-width)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0,order:-1},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0,order:-1},borderTop:{match:"^bt:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderBottom:{match:"^bb:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderLeft:{match:"^bl:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderRight:{match:"^br:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderX:{match:"^(?:bx|border-x):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(t){return{"border-left":t,"border-right":t}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(t){return{"border-top":t,"border-bottom":t}}},border:{match:"^b:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"},order:-2},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(t,e){return{"-webkit-background-clip":t+e,"background-clip":t+e}},values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)|gradient\\(.*\\))(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"},analyze(t){if(t.startsWith("gradient"))return["linear-"+t];let e=t.indexOf(":");return this.prefix=t.slice(0,e+1),[t.slice(e+1)]}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(t,e){return{"backdrop-filter":t+e,"-webkit-backdrop-filter":t+e}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(t){return this.prefix.slice(-5,-1)==="span"&&t!=="auto"?"span "+t+"/span "+t:t}},gridColumns:{match:"^grid-cols:.",declare(t,e){return{display:"grid","grid-template-columns":"repeat("+t+e+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(t){return this.prefix.slice(-5,-1)==="span"&&t!=="auto"?"span "+t+"/span "+t:t}},gridRows:{match:"^grid-rows:.",declare(t,e){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+t+e+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:{min:"min-content",max:"max-content"}},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:{min:"min-content",max:"max-content"},native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplateRows:{native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},columnGap:{match:"^gap-x:.",unit:"rem",native:!0},rowGap:{match:"^gap-y:.",unit:"rem",native:!0},gap:{unit:"rem",native:!0,order:-1},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(t,e){return{"box-decoration-break":t+e,"-webkit-box-decoration-break":t+e}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMarginLeft:{match:"^sml:.",native:!0,unit:"rem"},scrollMarginRight:{match:"^smr:.",native:!0,unit:"rem"},scrollMarginTop:{match:"^smt:.",native:!0,unit:"rem"},scrollMarginBottom:{match:"^smb:.",native:!0,unit:"rem"},scrollMarginX:{match:"^(?:smx|scroll-margin-x):.",unit:"rem",order:-.5,declare(t,e){return{"scroll-margin-left":t+e,"scroll-margin-right":t+e}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(t,e){return{"scroll-margin-top":t+e,"scroll-margin-bottom":t+e}}},scrollMargin:{match:"^sm:.",native:!0,unit:"rem",order:-1},scrollPaddingLeft:{match:"^spl:.",native:!0,unit:"rem"},scrollPaddingRight:{match:"^spr:.",native:!0,unit:"rem"},scrollPaddingTop:{match:"^spt:.",native:!0,unit:"rem"},scrollPaddingBottom:{match:"^spb:.",native:!0,unit:"rem"},scrollPaddingX:{match:"^(?:spx|scroll-padding-x):.",unit:"rem",order:-.5,declare(t,e){return{"scroll-padding-left":t+e,"scroll-padding-right":t+e}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(t,e){return{"scroll-padding-top":t+e,"scroll-padding-bottom":t+e}}},scrollPadding:{match:"^sp:.",native:!0,unit:"rem",order:-1},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(t,e){return{"mask-image":t+e,"-webkit-mask-image":t+e}}}},Oe=Ve;function je(t){if(!this.css.config.keyframes)return;let e=(this.meta.origin==="symbol"?t.slice(this.meta.config.symbol.length):t.slice(t.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);e?.length&&(this.keyframeNames=e)}function ge(){if(this.keyframeNames?.length){let t=this.css.rules[0];for(let e of this.keyframeNames){let i=this.css.keyframes[e];if(!--i.count){let s=t.natives.indexOf(i.native);this.css.style.sheet.deleteRule(s),t.natives.splice(s,1),delete this.css.keyframes[e]}}t.natives.length||this.css.rules.splice(0,1)}}function pe(){if(this.keyframeNames){let{config:t,keyframes:e,style:i,rules:s}=this.css,c=i?.sheet;for(let o of this.keyframeNames)if(o in e)e[o].count++;else{let y={text:`@keyframes ${o}{`+Object.entries(t.keyframes[o]).map(([h,l])=>`${h}{${Object.entries(l).map(([d,n])=>d+":"+n).join(";")}}`).join("")+"}",theme:""},w;if(Object.keys(e).length?(w=s[0]).natives.push(y):s.splice(0,0,w={natives:[y],get text(){return this.natives.map(h=>h.text).join("")}}),c){let h;for(let l=0;l<c.cssRules.length;l++){let d=c.cssRules[l];if(d.constructor.name!=="CSSKeyframesRule")break;if(d.name===o){h=d;break}}if(h)y.cssRule=h;else{let l=w.natives.length-1;c.insertRule(y.text,l),y.cssRule=c.cssRules[l]}}e[o]={native:y,count:1}}}}var Ie={fade:{"0%":{opacity:0},to:{opacity:1}},flash:{"0%,50%,to":{opacity:1},"25%,75%":{opacity:0}},float:{"0%":{transform:"none"},"50%":{transform:"translateY(-1.25rem)"},to:{transform:"none"}},heart:{"0%":{transform:"scale(1)"},"14%":{transform:"scale(1.3)"},"28%":{transform:"scale(1)"},"42%":{transform:"scale(1.3)"},"70%":{transform:"scale(1)"}},jump:{"0%,to":{transform:"translateY(-25%)","animation-timing-function":"cubic-bezier(.8,0,1,1)"},"50%":{transform:"translateY(0)","animation-timing-function":"cubic-bezier(0,0,.2,1)"}},ping:{"75%,to":{transform:"scale(2)",opacity:0}},pulse:{"0%":{transform:"none"},"50%":{transform:"scale(1.05)"},to:{transform:"none"}},rotate:{"0%":{transform:"rotate(-360deg)"},to:{transform:"none"}},shake:{"0%":{transform:"none"},"6.5%":{transform:"translateX(-6px) rotateY(-9deg)"},"18.5%":{transform:"translateX(5px) rotateY(7deg)"},"31.5%":{transform:"translateX(-3px) rotateY(-5deg)"},"43.5%":{transform:"translateX(2px) rotateY(3deg)"},"50%":{transform:"none"}},zoom:{"0%":{transform:"scale(0)"},to:{transform:"none"}}};var be={$:{name:"var",transform(t){return"--"+t}},calc:{transform(t){let e=this.values,i=this.css.globalValues,s="",c,o="",y=!1,w="",h=!0,l=(d,n="",f="")=>{if(c===2&&!y){let x=this.analyzeUnitValue(o,be.calc.unit);x&&(o=x.value+x.unit)}d!=="("?e&&o in e?o=e[o].toString():i&&o in i&&(o=i[o].toString()):w=o,d===")"&&(w=""),s+=o+n+d+f,c=null,y=!1,o=""};for(let d=0;d<t.length;d++){let n=t[d];if(n==="("||n===")"){l(n),h=!0;continue}else if(n===",")l(n,""," ");else if(n==="-"&&c!==1){let f=t[d-1];f==="("?s+=n:f===")"?l(n," "," "):isNaN(+t[d+1])?f==="-"?(l(n),c=1):l(n,h?"":" ",h?"":" "):l(n,o?" ":"",o?" ":"")}else if(n==="+"||n==="*"||n==="/"||w!=="var"&&n==="-")l(n," "," ");else{switch(c){case 1:break;case 2:n!=="."&&!/[0-9]/.test(n)&&(y=!0);break;default:c=isNaN(+n)?1:2}c?o+=n:s+=n}h=!1}return l(""),s}},translate:{unit:"rem"},translateX:{unit:"rem"},translateY:{unit:"rem"},translateZ:{unit:"rem"},translate3d:{unit:"rem"},skew:{unit:"deg"},skewX:{unit:"deg"},skewY:{unit:"deg"},skewZ:{unit:"deg"},skew3d:{unit:"deg"},rotate:{unit:"deg"},rotateX:{unit:"deg"},rotateY:{unit:"deg"},rotateZ:{unit:"deg"},rotate3d:{unit:"deg"},blur:{unit:"rem"},"drop-shadow":{unit:"rem"},"hue-rotate":{unit:"deg"},rgb:{unit:""},rgba:{unit:""},hsl:{unit:""},hsla:{unit:""},repeat:{unit:""}};var Ae="class";var ae={breakpoints:Ce,colors:Re,rootSize:16,scope:$e,selectors:Te,semantics:Be,themes:Me,rules:Oe,override:!1,observe:!0,important:!1,functions:be,keyframes:Ie,themeDriver:Ae};var Le=[",",".","#","[","!","*",">","+","~",":","@"];var ve=typeof window<"u",Ee=()=>{let t=document.createElement("style");return t.id="master",t},ne=class{constructor(e=ae){this.config=e;e?.override||(this.config=G(ae,e),"keyframes"in e&&Object.assign(this.config.keyframes,e.keyframes)),this.cache(),ve&&this.config.observe&&this.observe(document),ne.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:e,classes:i,selectors:s,themes:c,colors:o,values:y,breakpoints:w,mediaQueries:h,rules:l}=this.config;function d(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(r,a,b="",v={}){let R=I=>I?(b?b+"-":"")+I:b,j=Object.entries(r),A=[],P=[];for(let I of j){let _=I[1];(typeof _=="object"&&!Array.isArray(_)?A:P).push(I)}for(let[I,_]of A)n(_,a,R(I),v);if(a&&b)P.length&&(v[b]=P.reduce((I,[_,re])=>(I[_]=re,I),{}));else for(let[I,_]of P)v[R(I)]=_;return v}if(e)for(let[r,a]of Object.entries(n(e,!0)))this.semantics.push([new RegExp("^"+d(r)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[r,a]]);if(s)for(let[r,a]of Object.entries(n(s,!1))){let b=new RegExp(d(r)+"(?![a-z-])");for(let v of Array.isArray(a)?a:[a]){let R=v.match(/^::-[a-z]+-/m)?.[0]??"",j=this.selectors[R];j||(j=this.selectors[R]=[]);let A=j.find(([P])=>P===b);A||(A=[b,[]],j.push(A)),A[1].push(v)}}y&&(this.globalValues=n(y,!1)),w&&(this.breakpoints=n(w,!1)),h&&(this.mediaQueries=n(h,!1));let f=i?n(i,!1):{},x=c&&!Array.isArray(c)?Object.entries(c).filter(([,{classes:r}])=>r).reduce((r,[a,{classes:b}])=>(r[a]=n(b,!1),r),{}):{},S=[...Object.keys(f),...Object.entries(x).flatMap(([r,a])=>Object.keys(a))],k=r=>{if(r in this.classes)return;let a=this.classes[r]=[],b=(v,R)=>{if(!R)return;let j=Array.isArray(R)?R:R.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let A of j){let P=I=>{I in this.themeAffectedClassesBy?v in this.themeAffectedClassesBy[I]?this.themeAffectedClassesBy[I][v].push(r):this.themeAffectedClassesBy[I][v]=[r]:this.themeAffectedClassesBy[I]={[v]:[r]},a.includes(I)||a.push(I)};if(S.includes(A)){k(A);for(let I of this.classes[A])P(I)}else P(A)}};b("",f?.[r]);for(let[v,R]of Object.entries(x))b(v,R?.[r])};for(let r of S)k(r);for(let r in this.themeAffectedClassesBy){let a=this.classesBy[r]=[];for(let b of Object.values(this.themeAffectedClassesBy[r]))for(let v of b)a.includes(v)||a.push(v)}let p=(r,a)=>{if(!a)return;let b=n(a,!0);for(let[v,R]of Object.entries(b)){let j=typeof R=="string"?{"":R}:R;for(let[A,P]of Object.entries(j)){let I=v+(A?"-"+A:"");I in this.colorThemesMap?this.colorThemesMap[I][r]=P:this.colorThemesMap[I]={[r]:P}}}for(let v in a)this.colorNames.includes(v)||this.colorNames.push(v)};if(p("",o),c)if(Array.isArray(c))this.themeNames.push(...c);else for(let r in c){let a=c[r];p(r,a.colors),this.themeNames.push(r)}let u=r=>{for(let[a,b]of Object.entries(this.colorThemesMap))for(let[v,R]of Object.entries(b))R.startsWith("#")||r(a,b,v,R)};if(u((r,a,b,v)=>{let R=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(v);if(R){let j="#"+ue(+R[1],+R[2],+R[3]);R[4]&&(j+=Math.round(255*+R[4]).toString(16)),a[b]=j}}),u((r,a,b,v)=>{let[R,j]=v.split("/"),A=this.colorThemesMap[R];if(A){let P=(b?A[b]:void 0)??A[""];a[b]=j?P.slice(0,7)+Math.round(255*+j).toString(16):P}else console.warn(`\`${v}\` doesn't exist in the extended config \`.colors\``),delete a[b],Object.keys(a).length||delete this.colorThemesMap[r]}),l)for(let r in l){let a=l[r],{native:b,values:v,colored:R}=a,j=a.match;if(a.id=r,a.native=b===!0?r.replace(/(?!^)[A-Z]/g,A=>"-"+A).toLowerCase():void 0,v&&(this.values[r]=n(v,!1)),j){let A=Object.keys(this.values[r]??{});j.includes("$values")&&(j=A.length?j.replace(/\$values/,A.join("|")):j.replace(/(?:\|)?\$values/,"")),R&&j.includes("$colors")&&(j=this.colorNames.length?j.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):j.replace(/(?:\|)?\$colors/,"")),this.matches[r]=new RegExp(j)}}}observe(e,i={subtree:!0,childList:!0}){if(this.root!==e){if(ve&&e){this.root=e;let s=e===document;s&&(ne.root=this),this.host=s?document.documentElement:this.root.host;let c=s?document.head:e,o=s?document.styleSheets:e.styleSheets;for(let w of o){let{ownerNode:h}=w;if(h&&h.id==="master"){this.style=h;break}}if(this.style)for(let w=0;w<this.style.sheet.cssRules.length;w++){let h=this.style.sheet.cssRules[w];if(h.constructor.name==="CSSKeyframesRule")continue;let l=n=>{if(n.selectorText){let x=n.selectorText.split(", ")[0].split(" ");for(let S=0;S<x.length;S++){let k=x[S];if(k[0]==="."){let p=k.slice(1),u="";for(let r=0;r<p.length;r++){let a=p[r],b=p[r+1];if(a==="\\"){if(r++,b!=="\\"){u+=b;continue}}else if(Le.includes(a))break;u+=a}if(!(u in this.ruleBy)&&!(u in this.classes)){let r=this.create(u)[0];if(r)return r}}}}else if(n.cssRules)for(let f=0;f<n.cssRules.length;f++){let x=l(n.cssRules[f]);if(x)return x}},d=l(h);if(d){this.rules.push(d),this.ruleBy[d.className]=d;for(let n=0;n<d.natives.length;n++)d.natives[n].cssRule=this.style.sheet.cssRules[w+n];w+=d.natives.length-1,d.config.insert?.call(d)}}else this.style=Ee(),c.append(this.style);let y=w=>{w.forEach(h=>{h in this.countBy?this.countBy[h]++:(this.countBy[h]=1,this.insert(h))})};y(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(w=>y(w.classList)),this.observer=new MutationObserver(w=>{let h={},l=[],d=[],n=[],f=(p,u)=>{u?p.classList.forEach(S):p.classList.forEach(x);let r=p.children;for(let a=0;a<r.length;a++){let b=r[a];b.classList&&(d.push(b),f(b,u))}},x=p=>{p in h?h[p]++:h[p]=1},S=p=>{p in h?h[p]--:p in this.countBy&&(h[p]=-1)},k=(p,u)=>{for(let r=0;r<p.length;r++){let a=p[r];a.classList&&!d.includes(a)&&!n.includes(a)&&(a.isConnected!==u?(d.push(a),f(a,u)):n.push(a))}};for(let p=0;p<w.length;p++){let u=w[p],{addedNodes:r,removedNodes:a,type:b,target:v}=u;if(b==="attributes"){if(l.find(R=>R.target===v))continue;l.push(u)}else k(r,!1),(!v.isConnected||!d.includes(v))&&k(a,!0)}if(!(!l.length&&!Object.keys(h).length)){for(let{oldValue:p,target:u}of l){let r=d.includes(u),a=u.classList,b=p?p.split(" "):[];if(r){if(u.isConnected)continue;for(let v of b)a.contains(v)||S(v)}else if(u.isConnected){a.forEach(v=>{b.includes(v)||x(v)});for(let v of b)a.contains(v)||S(v)}}for(let p in h){let u=h[p],r=(this.countBy[p]||0)+u;r===0?(delete this.countBy[p],this.delete(p)):(p in this.countBy||this.insert(p),this.countBy[p]=r)}}}),this.observer.observe(e,{...i,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let e=this.style?.sheet;if(e?.cssRules)for(let i=e.cssRules.length-1;i>=0;i--)e.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(e){for(let i in this.config.rules){let s=this.config.rules[i],c=this.matches[i],{symbol:o,native:y}=s;if(c&&c.test(e))return{origin:"match",config:s};if(o&&e.startsWith(o))return{origin:"symbol",config:s};if(y&&e.startsWith(y+":"))return{origin:"match",config:s}}for(let i of this.semantics)if(e.match(i[0]))return{origin:"semantics",value:i[1]}}create(e){let i=s=>{if(s in this.ruleBy)return this.ruleBy[s];let c=this.match(s);if(c)return new ce(s,c,this)};return(e in this.classes?this.classes[e].map(s=>i(s)):[i(e)]).filter(s=>s&&s.text)}refresh(e){if(e?.override?this.config=e:this.config=G(ae,e),this.cache(),!this.style)return;let i=Ee();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let s in this.countBy)this.insert(s)}destroy(){let e=ne.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let i=this.style?.sheet,s=c=>{let o=this.ruleBy[c];if(!(!o||c in this.classesBy&&this.classesBy[c].some(y=>y in this.countBy))){if(i&&o.natives.length){let y=o.natives[0];for(let w=0;w<i.cssRules.length;w++)if(i.cssRules[w]===y.cssRule){for(let l=0;l<o.natives.length;l++)i.deleteRule(w);break}}this.rules.splice(this.rules.indexOf(o),1),delete this.ruleBy[c],o.config.delete&&o.config.delete.call(o,c)}};if(e in this.classes){for(let c of this.classes[e])c in this.countBy||s(c);delete this.ruleBy[e]}else s(e)}insert(e){let i=this.create(e);return i.length?(this.insertRules(i),!0):!1}insertRules(e){for(let i of e){if(this.ruleBy[i.className])continue;let s,c=Object.keys(this.keyframes).length,o=this.rules.length-1,{media:y,order:w,priority:h,hasWhere:l,className:d}=i,n=(S,k,p)=>{let u=S;for(;u<=o;u++){let r=this.rules[u];if(k?.(r))return p?-1:u-1;if(p?.(r))return u}return p?-1:u-1},f,x;if(y){let S=this.rules.findIndex(k=>k.media);if(S===-1)s=o+1;else{let{"max-width":k,"min-width":p}=y.features;if(k||p){let u=this.rules.findIndex(r=>r.media?.features["max-width"]||r.media?.features["min-width"]);if(u===-1)s=o+1;else if(k&&p){if(h===-1?(f=n(u,r=>r.priority!==-1,r=>r.media.features["max-width"]&&r.media.features["min-width"]),x=n(u,r=>r.priority!==-1)):(f=n(u,void 0,r=>r.media.features["max-width"]&&r.media.features["min-width"]&&r.priority!==-1),x=o),f!==-1){let r=k.value-p.value,a=x,b=f;for(f=void 0;a>=b;a--){let{"max-width":v,"min-width":R}=this.rules[a].media.features,j=v.value-R.value;if(j<r)x=a-1;else if(j===r)f=a;else break}}if(f!==-1){let r=k.value-p.value;for(let a=x;a>=f;a--){let{"max-width":b,"min-width":v}=this.rules[a].media.features,R=b.value-v.value;if(R<r)x=a-1;else if(R>r){f=a+1;break}}}}else if(p){if(h===-1?(f=n(u,r=>r.media.features["max-width"]&&r.media.features["min-width"]||r.priority!==-1,r=>!r.media.features["max-width"]&&r.media.features["min-width"]),x=n(u,r=>r.media.features["max-width"]&&r.media.features["min-width"]||r.priority!==-1)):(f=n(u,r=>r.media.features["max-width"]&&r.media.features["min-width"]&&r.priority!==-1,r=>!r.media.features["max-width"]&&r.media.features["min-width"]&&r.priority!==-1),x=n(u,r=>r.media.features["max-width"]&&r.media.features["min-width"]&&r.priority!==-1)),f!==-1)for(let r=x;r>=f;r--){let a=this.rules[r].media.features["min-width"].value;if(a>p.value)x=r-1;else if(a<p.value){f=r+1;break}}}else if(h===-1?(f=n(u,r=>r.media.features["min-width"]||r.priority!==-1,r=>r.media.features["max-width"]),x=n(u,r=>r.media.features["min-width"]||r.priority!==-1)):(f=n(u,r=>r.media.features["min-width"]&&r.priority!==-1,r=>r.media.features["max-width"]&&r.priority!==-1),x=n(u,r=>r.media.features["min-width"]&&r.priority!==-1)),f!==-1)for(let r=x;r>=f;r--){let a=this.rules[r].media.features["max-width"].value;if(a<k.value)x=r-1;else if(a>k.value){f=r+1;break}}}else h===-1?(f=S,x=n(S,u=>u.media?.features["max-width"]||u.media?.features["min-width"]||u.priority!==-1)):(f=n(S,u=>u.media?.features["max-width"]||u.media?.features["min-width"],u=>u.priority!==-1),x=n(S,u=>u.media?.features["max-width"]||u.media?.features["min-width"]))}}else{let S=c?1:0;h===-1?(f=S,x=n(S,k=>k.media||k.priority!==-1)):(f=n(S,k=>k.media,k=>k.priority!==-1),x=n(S,k=>k.media))}if(s===void 0)if(f===-1)s=x+1;else{if(h===-1)for(let S=f;S<=x;S++){let k=this.rules[S];if(!(!l&&k.hasWhere)&&(l&&!k.hasWhere||k.order>=w)){s=S;break}}else for(let S=f;S<=x;S++){let k=this.rules[S];if(!(!l&&k.hasWhere)){if(l&&!k.hasWhere){s=S;break}if(k.priority<h){s=S;break}else if(k.priority===h){if(k.order>=w){s=S;break}}else s=S+1}}s===void 0&&(s=x+1)}if(this.rules.splice(s,0,i),this.ruleBy[d]=i,this.style){let S=this.style.sheet,k=0,p=u=>{let r=this.rules[u];if(r){if(!r.natives.length)return p(u-1);let a=r.natives[r.natives.length-1].cssRule;for(let b=0;b<S.cssRules.length;b++)if(S.cssRules[b]===a){k=b+1;break}}};p(s-1);for(let u=0;u<i.natives.length;)try{let r=i.natives[u];S.insertRule(r.text,k),r.cssRule=S.cssRules[k++],u++}catch(r){console.error(r),i.natives.splice(u,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(e=>e.text).join("")}},te=ne;oe(te,"root"),oe(te,"config",ae),oe(te,"instances",[]),oe(te,"refresh",e=>{for(let i of ne.instances)i.refresh(e)});ve&&(window.MasterCSS=te);var We={store:"theme",init:!0},Pe=typeof document<"u",De=typeof localStorage<"u",de=class{constructor(e,i=Pe?document.documentElement:null){this.settings=e;this.host=i;this.settings=e?G(We,e):We,this.settings.init&&this.init()}e=typeof matchMedia<"u"?matchMedia?.("(prefers-color-scheme:dark)"):void 0;r;t;init(){let e=this.settings.default,i=this.storage;i&&(e=i),this.value=e}get storage(){let{store:e}=this.settings;if(De&&e)return localStorage.getItem(e)}get systemValue(){return this.e.matches?"dark":"light"}set value(e){this.r=e,e==="system"?(this.e?.addEventListener?.("change",this.i),this.current=this.systemValue):(this.n(),this.current=e)}get value(){return this.r}set current(e){let i=this.t;this.t=e,this.host&&i!==e&&(i&&this.host.classList.remove(i),e&&!this.host.classList.contains(e)&&(this.host.classList.add(e),this.host.style&&(this.host.style.colorScheme=e)))}get current(){return this.t}switch(e,i={store:!0,emit:!0}){e&&e!==this.value&&(this.value=e,De&&this.storage!==e&&this.settings.store&&localStorage.setItem(this.settings.store,e),i.emit&&this.host.dispatchEvent(new CustomEvent("theme",{detail:this})))}n(){this.e?.removeEventListener("change",this.i)}i=e=>{this.current=e.matches?"dark":"light"};destroy(){this.n()}};new te(window.masterCSSConfig);new de(window.masterCSSThemeSettings);})();
|
|
1
|
+
(()=>{var De=Object.defineProperty;var ze=(t,e,r)=>e in t?De(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var oe=(t,e,r)=>(ze(t,typeof e!="symbol"?e+"":e,r),r);function we(t){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&t instanceof e||t instanceof Date||t instanceof RegExp)}function ke(t){if(typeof Buffer<"u"&&Buffer&&t instanceof Buffer){let e=Buffer.alloc(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Se(t){let e=[];return t.forEach(function(r,a){typeof r=="object"&&r!==null?Array.isArray(r)?e[a]=Se(r):we(r)?e[a]=ke(r):e[a]=J({},r):e[a]=r}),e}function ye(t,e){return e==="__proto__"?void 0:t[e]}function J(...t){let e={},r,a;return t.forEach(function(c){typeof c!="object"||c===null||Array.isArray(c)||Object.keys(c).forEach(function(s){if(a=ye(e,s),r=ye(c,s),r!==e)if(typeof r!="object"||r===null){e[s]=r;return}else if(Array.isArray(r)){e[s]=Se(r);return}else if(we(r)){e[s]=ke(r);return}else if(typeof a!="object"||a===null||Array.isArray(a)){e[s]=J({},r);return}else{e[s]=J(a,r);return}})}),e}var ie={"(":")","'":"'",'"':'"',"{":"}"};function le(t){if(typeof CSS<"u")return CSS.escape(t);if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");let e=String(t),r=e.length,a=-1,c="",s,y=e.charCodeAt(0);if(r==1&&y==45)return"\\"+e;for(;++a<r;){if(s=e.charCodeAt(a),s==0){c+="\uFFFD";continue}if(s>=1&&s<=31||s==127||a==0&&s>=48&&s<=57||a==1&&s>=48&&s<=57&&y==45){c+="\\"+s.toString(16)+" ";continue}if(s>=128||s==45||s==95||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122){c+=e.charAt(a);continue}c+="\\"+e.charAt(a)}return c}var Ve={unit:"",order:0,separators:[","]},ce=class{constructor(e,r={},a){this.className=e;this.meta=r;this.css=a;this.config=J(Ve,r.config);let{unit:c,order:s,colored:y,native:w,analyze:g,transform:l,declare:f,create:n}=this.config,{scope:m,important:x,functions:S,themeDriver:k}=a.config,{themeNames:b,colorNames:u,colorThemesMap:i,selectors:o,breakpoints:d,mediaQueries:v,themeAffectedClassesBy:R,globalValues:T}=a,I=R[e];n&&n.call(this,e);let A,X,L,Q,Z;if(r.origin==="semantics"){let[N,O]=r.value;Q=e.slice(N.length),A=O}else{let N;if(g)[N,L]=g.call(this,e);else if(r.origin==="match"){let M=e.indexOf(":");this.prefix=e.slice(0,M+1),N=e.slice(M+1)}else r.origin==="symbol"&&(this.symbol=e[0],N=e.slice(1));Z=[];let O=this,E=this.values,V=[","];this.config.separators.length&&V.push(...this.config.separators);let C="",p=0;(function M(h,j,B,$=void 0,W=[],H=[],D){let _=$===void 0,F,ee=z=>z==="'"||z==='"',te=()=>F=C.length,K=()=>{if(C){let z=C,P=_?z:C.slice(F);if(C="",q="",E&&P in E&&!W.includes(P)){let U=p;p=0,M(E[P].toString(),j,void 0,$,[...W,P],H,D),p=U,_||(C=C.slice(0,F)+C)}else if(T&&P in T&&!H.includes(P)){let U=p;p=0,M(T[P].toString(),j,void 0,$,W,[...H,P],D),p=U,_||(C=C.slice(0,F)+C)}else if(_){let U=!D&&O.analyzeUnitValue(P,j);Z.push({value:U?.value??P,unit:U?.unit})}else{let U=!D&&O.analyzeUnitValue(P,j);C=U?z.slice(0,F)+U.value+U.unit:z}te()}},G=ee(B);te();let q="";for(;p<h.length;p++){let z=h[p];if(z===B){if(G){C+=z;let P=0;for(let U=C.length-2;C[U]==="\\";U--)P++;if(P%2)continue}else K(),C+=z;return}else if(!G&&z in ie){let P=z==="("&&q&&S?.[q];P?.name&&(C=C.slice(0,C.length-q.length)+P.name,q=P.name),C+=z,p++;let U=ie[z];M(h,P?.unit??j,U,q||$||"",W,H,D||!!P?.transform),P?.transform&&(C=C.slice(0,F+q.length+1)+P.transform.call(O,C.slice(F+q.length+1,-1))+C.slice(-1)),_&&(ee(U)?(Z.push(C),C=""):K()),q=""}else if((z==="|"||z===" ")&&B!=="}"&&(!G||$==="path"))K(),_||(C+=" ",F++);else{if(!G){if(z==="."){if(isNaN(+h[p+1]))break;h[p-1]==="-"&&(C+="0")}else if(V.includes(z)){K(),_?Z.push(z):(C+=z,F++);continue}else if(_&&(z==="#"&&(C||Z.length&&h[p-1]!=="|"&&Z[p-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(z)))break;q+=z}C+=z}}$===void 0&&K()})(N,c),Q=N.slice(p)}this.order=typeof s=="function"?s.call(this,this.prefix):s,Q[0]==="!"&&(this.important=!0,Q=Q.slice(1));let xe=N=>{let O=N.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((p,M)=>M%3?p:p.replace(/_/g," ")).join(""),E=[],V="",C=0;for(let p=0;p<O.length;p++){let M=O[p];if(M==="\\"){V+=M+O[++p];continue}!C&&M===","?(E.push(V),V=""):(V+=M,C&&M===")"?C--:M==="("&&C++)}return V&&E.push(V),E};this.prefixSelectors=L?xe(L):[""];let fe=Q.split("@"),me=fe[0];if(me){this.vendorSuffixSelectors={};let N=(p,M,h,j)=>{for(let[B,$]of M)if(B.test(p)){for(let W of $)N(p.replace(B,W),M,h,!0);return}j&&h.push(p)},O=[];""in o?N(me,o[""],O,!0):O.push(me);let E={};for(let[p,M]of Object.entries(o)){if(!p)continue;let h=[];for(let j of O)N(j,M,h,!1);h.length&&(E[p]=h)}let V=(p,M)=>{let h=M.reduce((j,B)=>(j.push(...xe(B)),j),[]);p in this.vendorSuffixSelectors?this.vendorSuffixSelectors[p].push(...h):this.vendorSuffixSelectors[p]=h},C=Object.keys(E);if(C.length)for(let p of C)V(p,E[p]);else V("",O);for(let p of Object.values(this.vendorSuffixSelectors))for(let M of p){this.hasWhere!==!1&&(this.hasWhere=M.includes(":where("));let h=[":disabled",":active",":focus",":hover"];for(let j=0;j<h.length;j++)if(M.includes(h[j])){(this.priority===-1||this.priority>j)&&(this.priority=j);break}}}else this.vendorSuffixSelectors={"":[""]};for(let N=1;N<fe.length;N++){let O=fe[N];if(O)if(b.includes(O))this.theme=O;else if(O==="rtl"||O==="ltr")this.direction=O;else{let E,V,C=O.indexOf("_");if(C!==-1)E=O.slice(0,C),V=O.slice(C);else{let p=O.indexOf("(");p!==-1&&(E=O.slice(0,p),V=O.slice(p))}if(!E){E="media";let p=[];this.media={token:O,features:{}};let M=O.split("&");for(let h of M)if(h==="all"||h==="print"||h==="screen"||h==="speech")this.media.type=h;else if(h==="\u{1F5A8}")this.media.type="print";else if(h==="landscape"||h==="portrait")p.push("(orientation:"+h+")");else if(h==="motion"||h==="reduced-motion")p.push("(prefers-reduced-motion:"+(h==="motion"?"no-preference":"reduce")+")");else if(v&&h in v)p.push(v[h]);else{let j={token:h},B="",$="",W=0;h.startsWith("<=")?($="<=",B="max-width"):h.startsWith(">=")||d[h]?($=">=",B="min-width"):h.startsWith(">")?($=">",B="min-width",W=.02):h.startsWith("<")&&($="<",B="max-width",W=-.02);let H=$?h.replace($,""):h,D=d[H];switch(B){case"max-width":case"min-width":D?Object.assign(j,this.analyzeUnitValue(D.toString(),"px")):Object.assign(j,this.analyzeUnitValue(H,"px")),j.unit==="px"&&(j.value+=W),this.media.features[B]=j,p.push("("+B+":"+(j.value+j.unit)+")");break}}V="",this.media.type&&(V=this.media.type),p.length&&(V+=(V?" and ":"")+p.join(" and "))}V&&(this.at[E]=(E in this.at?this.at[E]+" and ":"")+V.replace(/_/g," "))}}let he=(N,O)=>{let E,V=(M,h,j)=>{let B="";this.direction&&(B+="[dir="+this.direction+"] ");let $=this.prefixSelectors.map(D=>D+B),W=(D,_)=>$.map(F=>(D&&k!=="media"?k==="host"?`:host(.${D}) `:`.${D} `:"")+(m?m+" ":"")+F).reduce((F,ee)=>(F.push(j.reduce((te,K)=>(te.push(ee+"."+le(_)+K),te),[]).join(",")),F),[]).join(","),H=W(h,e)+(I?Object.entries(I).filter(([D])=>this.theme||!y||!h||!D||D===h).map(([D,_])=>_.reduce((F,ee)=>F+","+W(this.theme??((y||X)&&h||D),ee),"")).join(""):"")+"{"+M+"}";for(let D of Object.keys(this.at).sort((_,F)=>F==="supports"?-1:1))H="@"+D+" "+this.at[D]+"{"+H+"}";return h&&k==="media"&&(H=`@media(prefers-color-scheme:${h}){`+H+"}"),H},C=[];if(Z){let M=[this.theme??N,""],h,j=!1;for(let B of Z)if(typeof B=="string")C.push(B);else{let $=B.value;if(B.unit)$+=B.unit;else if(y&&i&&u){let W=!1;$=$.replace(new RegExp(`(^|,| |\\()((?:${u.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(H,D,_,F)=>{let ee=i[_];if(ee){let te,K;for(let G of M)if(te=ee[G]){K=G;break}if(te){W=!O||K===N,h||(h=W);let G=te;if(F){let q=F.endsWith("%")?parseFloat(F)/100:+F;q=isNaN(q)?1:Math.min(Math.max(q,0),1),G+=Math.round(q*255).toString(16).toUpperCase().padStart(2,"0")}return D+G}else j=!0}return H})}C.push($)}if(O&&(j||(h===void 0?N:!h)))return;if(E=C.reduce((B,$,W)=>B+$+($===","||Z[W+1]===","||W===Z.length-1?"":" "),""),l&&(E=l.call(this,E,this.css.config)),y&&E==="current"&&(E="currentColor"),f){let B,$;if(Z.length===1){let W=Z[0];typeof W=="object"&&(B=W.value,$=W.unit)}A=f.call(this,$?B:E,$||"")}else A={[w]:E}}let p={};for(let M in A){let h=($,W)=>{let H=W+((this.important||x)&&!W.endsWith("!important")?"!important":"");$ in p?p[$].push(H):p[$]=[H]},j=M+":",B=A[M];if(typeof B=="object")if(Array.isArray(B))for(let $ of B)h(N,j+$.toString());else{X=!0;for(let $ in B)h($,j+B[$])}else h(N,j+B.toString())}for(let M of Object.values(this.vendorSuffixSelectors))for(let h in p)this.natives.push({text:V(p[h].join(";"),h,M),theme:h})};if(this.theme)he(this.theme,!1);else if(y)for(let N of b)he(N,!0);else he("",!1)}at={};priority=-1;natives=[];keyframeNames;config;get values(){return this.css.values[this.config.id]}get text(){return this.natives.map(e=>e.text).join("")}resolveValue(e,r){return Number.isNaN(+e)?e:e/(r==="rem"||r==="em"?this.css.config.rootSize:1)+r}analyzeUnitValue(e,r){let a=r??this.config.unit;if(a){let c="",s=e.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(s)if(e.includes("/")){let[y,w]=e.split("/");return{value:+y/+w*100+"%",unit:c}}else{let y=+s[1];return c=s[3]||"",c||((a==="rem"||a==="em")&&(y=y/this.css.config.rootSize),c=a||""),{value:y,unit:c}}}}};var Ce={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560};function se(t){t.startsWith("#")&&(t=t.slice(1));let e=t.match(/.{1,2}/g);return[parseInt(e[0],16),parseInt(e[1],16),parseInt(e[2],16)]}function ue(t,e,r){return((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}function Y(t){typeof t=="string"&&(t={"":t});let e=""in t,r=!1;for(let a in t)if(a&&+a>=100){r=!0;break}if(!r&&(!e||Object.keys(t).length>1)){let a=0,c="0"in t?se(t[0]):[0,0,0],s,y,w=[],g=()=>{let l=s-a,f=y.map((n,m)=>(n-c[m])/l);for(let n of w){let m=n-a,x=c.map((S,k)=>Math.round(S+f[k]*m));t[n]="#"+ue.call(this,...x)}};for(let l=1;l<100;l++)l in t?(w.length?(s=l,y=se(t[l]),g(),w.length=0,c=y):c=se(t[l]),a=l):w.push(l);w.length&&(s=100,y="100"in t?se(t[100]):[255,255,255],g())}return e||(t[""]=t[r?"500":"50"]),t}var Re={black:"#000000",white:"#ffffff",slate:Y({5:"#141e2b",10:"#19212d",20:"#262f3e",30:"#323e52",40:"#41516b",50:"#616a84",55:"#6c7693",60:"#959db3",70:"#a3abbf",80:"#d7dae3",95:"#f6f7f8"}),gray:Y({5:"#1e1d1f",10:"#212022",20:"#2f2e30",30:"#3e3d40",40:"#504f52",50:"#6b6a6d",55:"#777679",60:"#9e9da0",70:"#abaaae",80:"#dad9db",95:"#f5f4f7"}),brown:Y({5:"#271b15",10:"#2b1e18",20:"#3c2b22",30:"#50382c",40:"#694839",50:"#8d604b",55:"#9d6b53",60:"#b79788",70:"#c1a598",80:"#efd5c9",95:"#faf2ef"}),orange:Y({5:"#2e1907",10:"#331b07",20:"#47260b",30:"#5d320e",40:"#7a4111",50:"#a15717",55:"#b4611a",60:"#e38739",70:"#e79855",80:"#f7d4b5",95:"#fcf1e7"}),gold:Y({5:"#281b00",10:"#2d1e01",20:"#3f2a00",30:"#543800",40:"#6d4900",50:"#906000",55:"#9c6d00",60:"#d09100",70:"#dca000",80:"#fbd67f",95:"#fff3d8"}),yellow:Y({5:"#251d00",10:"#282000",20:"#3a2e01",30:"#4b3b00",40:"#624e00",50:"#806700",55:"#8e7200",60:"#be9900",70:"#d0a700",80:"#edda8f",95:"#fff5ca"}),grass:Y({5:"#162106",10:"#182406",20:"#223308",30:"#2c4408",40:"#3a570b",50:"#4e750e",60:"#74ae15",70:"#7dbc17",80:"#bfe87c",95:"#ebfad4"}),green:Y({5:"#042311",10:"#032611",20:"#023717",30:"#03481f",40:"#025d26",50:"#067b34",55:"#07883a",60:"#09b64d",70:"#0ac553",80:"#80f1a4",95:"#e0fae8"}),beryl:Y({5:"#002319",10:"#00271c",20:"#003626",30:"#004732",40:"#005c41",50:"#007954",55:"#00875e",60:"#00b37c",70:"#00c387",80:"#72f0c5",95:"#d6fcef"}),teal:Y({5:"#012220",10:"#012624",20:"#003532",30:"#004541",40:"#005a54",50:"#00776f",55:"#00857c",60:"#00b1a5",70:"#00bfb2",80:"#6aeee5",95:"#d4fcf8"}),cyan:Y({5:"#00222b",10:"#00252e",20:"#013340",30:"#004457",40:"#00576f",50:"#007391",55:"#0080a1",60:"#00abd7",70:"#00b9e9",80:"#97e6fa",95:"#dff8ff"}),sky:Y({5:"#031f34",10:"#032339",20:"#04314e",30:"#044169",40:"#065386",50:"#086eb3",55:"#097ac5",60:"#29a4f5",70:"#4db3f7",80:"#b3e0ff",95:"#eaf6fe"}),blue:Y({5:"#07194a",10:"#081c53",20:"#0a2773",30:"#0e3496",40:"#1146b6",50:"#175fe9",55:"#2671ea",60:"#6b9ef1",70:"#81acf3",80:"#c6dbfe",95:"#edf4fe"}),indigo:Y({5:"#1f1645",10:"#20174f",20:"#2b1f74",30:"#37289d",40:"#463fb1",50:"#5a5bd5",55:"#6464f1",60:"#9393f5",70:"#a1a5ee",80:"#d5d7fe",95:"#f1f2ff"}),violet:Y({5:"#2b0a4e",10:"#2e0b57",20:"#3d1179",30:"#4e169f",40:"#5f2eba",50:"#7949e5",55:"#8755f5",60:"#ac8af8",70:"#b89bf9",80:"#e1d4fe",95:"#f5f1ff"}),purple:Y({5:"#2e0c47",10:"#330c4e",20:"#460f6c",30:"#5b1390",40:"#7421b1",50:"#9832e4",55:"#a348e7",60:"#c184ef",70:"#ca96f1",80:"#ead1fe",95:"#f9f0ff"}),fuchsia:Y({5:"#39092a",10:"#400932",20:"#560d4a",30:"#6f1165",40:"#8c158a",50:"#b61cbb",55:"#ca1fce",60:"#e66ee9",70:"#ea86ed",80:"#facbfb",95:"#feefff"}),pink:Y({5:"#3d0722",10:"#430725",20:"#5d0933",30:"#790d44",40:"#9a1058",50:"#ca1473",55:"#e11681",60:"#f170b4",70:"#f388c0",80:"#fdcde6",95:"#fff0f8"}),crimson:Y({5:"#430213",10:"#470314",20:"#62041c",30:"#800524",40:"#9f1036",50:"#ce1a4b",55:"#e8144c",60:"#f37596",70:"#f58ba7",80:"#fdceda",95:"#fff1f4"}),red:Y({5:"#450001",10:"#490102",20:"#640304",30:"#800506",40:"#a11012",50:"#d11a1e",55:"#ed0a0e",60:"#f97476",70:"#fa8b8d",80:"#fdcfcf",95:"#fff1f1"})};var $e="";var Te={"::scrollbar":"::-webkit-scrollbar","::scrollbar-button":"::-webkit-scrollbar-button","::scrollbar-thumb":"::-webkit-scrollbar-thumb","::scrollbar-track":"::-webkit-scrollbar-track","::scrollbar-track-piece":"::-webkit-scrollbar-track-piece","::scrollbar-corner":"::-webkit-scrollbar-corner","::slider-thumb":["::-webkit-slider-thumb","::-moz-range-thumb"],"::slider-runnable-track":["::-webkit-slider-runnable-track","::-moz-range-track"],"::meter":"::-webkit-meter","::resizer":"::-webkit-resizer","::progress":"::-webkit-progress",":first":":first-child",":last":":last-child",":even":":nth-child(2n)",":odd":":nth-child(odd)",":nth(":":nth-child("};var Be={square:{"aspect-ratio":"1/1"},video:{"aspect-ratio":"16/9"},rounded:{"border-radius":"1e9em"},round:{"border-radius":"50%"},hidden:{display:"none"},hide:{display:"none"},block:{display:"block"},table:{display:"table"},flex:{display:"flex"},grid:{display:"grid"},contents:{display:"contents"},inline:{display:"inline"},"inline-block":{display:"inline-block"},"inline-flex":{display:"inline-flex"},"inline-grid":{display:"inline-grid"},"inline-table":{display:"inline-table"},"table-cell":{display:"table-cell"},"table-caption":{display:"table-caption"},"flow-root":{display:"flow-root"},"list-item":{display:"list-item"},"table-row":{display:"table-row"},"table-column":{display:"table-column"},"table-row-group":{display:"table-row-group"},"table-column-group":{display:"table-column-group"},"table-header-group":{display:"table-header-group"},"table-footer-group":{display:"table-footer-group"},italic:{"font-style":"italic"},oblique:{"font-style":"oblique"},isolate:{isolation:"isolate"},overflowed:{overflow:"visible"},untouchable:{"pointer-events":"none"},static:{position:"static"},fixed:{position:"fixed"},abs:{position:"absolute"},rel:{position:"relative"},sticky:{position:"sticky"},uppercase:{"text-transform":"uppercase"},lowercase:{"text-transform":"lowercase"},capitalize:{"text-transform":"capitalize"},visible:{visibility:"visible"},invisible:{visibility:"hidden"},vw:{width:"100vw"},vh:{height:"100vh"},"max-vw":{"max-width":"100vw"},"max-vh":{"max-height":"100vh"},"min-vw":{"min-width":"100vw"},"min-vh":{"min-height":"100vh"},"center-content":{"justify-content":"center","align-items":"center"},"sr-only":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap","border-width":"0"},full:{width:"100%",height:"100%"},center:{left:0,right:0,"margin-left":"auto","margin-right":"auto"},middle:{top:0,bottom:0,"margin-top":"auto","margin-bottom":"auto"},"break-spaces":{"white-space":"break-spaces"},"break-word":{"overflow-wrap":"break-word",overflow:"hidden"},"gradient-text":{"-webkit-text-fill-color":"transparent","-webkit-background-clip":"text","background-clip":"text"}};var Me=["dark","light"];var Fe={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(t){let e=0;for(;e<t.length&&!(t[e]==="{"&&t[e-1]!=="\\");e++);return[t.slice(e),t.slice(0,e)]},declare(t){let e={},r=(l,f)=>{let n=f.indexOf(":");if(n!==-1){l in e||(e[l]={});let m=e[l],x=f.slice(0,n);x in m||(m[x]=f.slice(n+1))}},a=l=>{let f=(n,m)=>{let x=m.slice(le(l.className).length).match(/\{(.*)\}/)[1].split(";");for(let S of x)r(n,S)};if(this.theme){let n=l.natives.find(m=>m.theme===this.theme)??l.natives.find(m=>!m.theme);n&&f(this.theme,n.text)}else for(let n of l.natives)f(n.theme,n.text);if(l.keyframeNames){this.keyframeNames||(this.keyframeNames=[]);for(let n of l.keyframeNames)this.keyframeNames.includes(n)||this.keyframeNames.push(n)}},c=[],s="",y=()=>{s&&(c.push(s.replace(/ /g,"|")),s="")},w=1;(function l(f){for(;w<t.length;w++){let n=t[w];if(!f){if(n===";"){y();continue}if(n==="}")break}if(s+=n,f===n){if(f==="'"||f==='"'){let m=0;for(let x=s.length-2;s[x]==="\\";x--)m++;if(m%2)continue}break}else n in ie&&f!=="'"&&f!=='"'&&(w++,l(ie[n]))}})(void 0),y();for(let l of c){let f=this.css.create(l);if(Array.isArray(f))for(let n of f)a(n);else f?a(f):r(this.theme??"",l)}let g={};for(let l in e)for(let[f,n]of Object.entries(e[l]))f in g?g[f][l]=n:g[f]={[l]:n};return g},delete(){return ge.call(this)},insert(){return pe.call(this)}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(t){return{["--"+this.prefix.slice(1,-1)]:t}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(t){switch(t){case"subpixel-antialiased":return{"-webkit-font-smoothing":"auto","-moz-osx-font-smoothing":"auto"};case"antialiased":return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"}}}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},marginLeft:{match:"^ml:.",native:!0,unit:"rem"},marginRight:{match:"^mr:.",native:!0,unit:"rem"},marginTop:{match:"^mt:.",native:!0,unit:"rem"},marginBottom:{match:"^mb:.",native:!0,unit:"rem"},marginX:{match:"^(?:mx|margin-x):.",unit:"rem",order:-.5,declare(t,e){return{"margin-left":t+e,"margin-right":t+e}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(t,e){return{"margin-top":t+e,"margin-bottom":t+e}}},margin:{match:"^m:.",native:!0,unit:"rem",order:-1},paddingLeft:{match:"^pl:.",native:!0,unit:"rem"},paddingRight:{match:"^pr:.",native:!0,unit:"rem"},paddingTop:{match:"^pt:.",native:!0,unit:"rem"},paddingBottom:{match:"^pb:.",native:!0,unit:"rem"},paddingX:{match:"^(?:px|padding-x):.",unit:"rem",order:-.5,declare(t,e){return{"padding-left":t+e,"padding-right":t+e}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(t,e){return{"padding-top":t+e,"padding-bottom":t+e}}},padding:{match:"^p:.",native:!0,unit:"rem",order:-1},flexBasis:{values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},height:{match:"^h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t]},declare(t){let[e,r]=t.split(" x ");return{width:e,height:r}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t.slice(4)]},declare(t){let[e,r]=t.split(" x ");return{"min-width":e,"min-height":r}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(t){return[t.slice(4)]},declare(t){let[e,r]=t.split(" x ");return{"max-width":e,"max-height":r}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},top:{native:!0,unit:"rem"},bottom:{native:!0,unit:"rem"},left:{native:!0,unit:"rem"},right:{native:!0,unit:"rem"},inset:{native:!0,unit:"rem",order:-1},lines:{match:"^lines:.",declare(t,e){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":t+e}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflowX:{native:!0,declare(t,e){return t==="overlay"?{"overflow-x":["auto",t]}:{"overflow-x":t}}},overflowY:{native:!0,declare(t,e){return t==="overlay"?{"overflow-y":["auto",t]}:{"overflow-y":t}}},overflow:{native:!0,order:-1,declare(t,e){return t==="overlay"?{overflow:["auto",t]}:{overflow:t}}},overscrollBehaviorX:{native:!0},overscrollBehaviorY:{native:!0},overscrollBehavior:{native:!0,order:-1},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{declare(t,e){return{"user-drag":t+e,"-webkit-user-drag":t+e}}},userSelect:{native:!0,declare(t,e){return{"user-select":t+e,"-webkit-user-select":t+e}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(t,e){return{"font-size":t+e,"line-height":e==="em"?t+.875+e:`calc(${t}${e} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(t,e){return{"-webkit-text-fill-color":t+e}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(t,e){return{"-webkit-text-stroke-width":t+e}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(t,e){return{"-webkit-text-stroke-color":t+e}}},textStroke:{unit:"rem",native:!0,declare(t,e){return{"-webkit-text-stroke":t+e}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(t){return je.call(this,t)},delete(){return ge.call(this)},insert(){return pe.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(t){return je.call(this,t)},delete(){return ge.call(this)},insert(){return pe.call(this)}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderTopColor:{match:"^b(?:t|order-top(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderBottomColor:{match:"^b(?:b|order-bottom(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderLeftColor:{match:"^b(?:l|order-left(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderRightColor:{match:"^b(?:r|order-right(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderXColor:{match:"^b(?:x|order-x(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(t,e){return{"border-left-color":t+e,"border-right-color":t+e}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(t,e){return{"border-top-color":t+e,"border-bottom-color":t+e}}},borderColor:{match:"^b(?:order)?(?:-color)?:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,order:-1,colored:!0,values:{current:"currentColor"}},borderTopLeftRadius:{match:"^r(?:tl|lt):.",unit:"rem",native:!0},borderTopRightRadius:{match:"^r(?:tr|rt):.",unit:"rem",native:!0},borderBottomLeftRadius:{match:"^r(?:bl|lb):.",unit:"rem",native:!0},borderBottomRightRadius:{match:"^r(?:br|rb):.",unit:"rem",native:!0},borderTopRadius:{match:"^rt:.",unit:"rem",order:-.5,declare(t,e){return{"border-top-left-radius":t+e,"border-top-right-radius":t+e}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(t,e){return{"border-bottom-left-radius":t+e,"border-bottom-right-radius":t+e}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(t,e){return{"border-top-left-radius":t+e,"border-bottom-left-radius":t+e}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(t,e){return{"border-top-right-radius":t+e,"border-bottom-right-radius":t+e}}},borderRadius:{match:"^r:.",unit:"rem",native:!0,order:-1},borderTopStyle:{match:"^b(?:t|order-top(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderBottomStyle:{match:"^b(?:b|order-bottom(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderLeftStyle:{match:"^b(?:l|order-left(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderRightStyle:{match:"^b(?:r|order-right(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderXStyle:{match:"^b(?:x|order-x(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(t,e){return{"border-left-style":t+e,"border-right-style":t+e}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(t,e){return{"border-top-style":t+e,"border-bottom-style":t+e}}},borderStyle:{match:"^b(?:order)?(?:-style)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0,order:-1},borderTopWidth:{match:"^b(?:t|order-top(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderBottomWidth:{match:"^b(?:b|order-bottom(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderLeftWidth:{match:"^b(?:l|order-left(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderRightWidth:{match:"^b(?:r|order-right(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderXWidth:{match:"^b(?:x|order-x(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(t,e){return{"border-left-width":t+e,"border-right-width":t+e}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(t,e){return{"border-top-width":t+e,"border-bottom-width":t+e}}},borderWidth:{match:"^b(?:order)?(?:-width)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0,order:-1},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0,order:-1},borderTop:{match:"^bt:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderBottom:{match:"^bb:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderLeft:{match:"^bl:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderRight:{match:"^br:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderX:{match:"^(?:bx|border-x):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(t){return{"border-left":t,"border-right":t}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(t){return{"border-top":t,"border-bottom":t}}},border:{match:"^b:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"},order:-2},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(t,e){return{"-webkit-background-clip":t+e,"background-clip":t+e}},values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)|gradient\\(.*\\))(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"},analyze(t){if(t.startsWith("gradient"))return["linear-"+t];let e=t.indexOf(":");return this.prefix=t.slice(0,e+1),[t.slice(e+1)]}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(t,e){return{"backdrop-filter":t+e,"-webkit-backdrop-filter":t+e}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(t){return this.prefix.slice(-5,-1)==="span"&&t!=="auto"?"span "+t+"/span "+t:t}},gridColumns:{match:"^grid-cols:.",declare(t,e){return{display:"grid","grid-template-columns":"repeat("+t+e+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(t){return this.prefix.slice(-5,-1)==="span"&&t!=="auto"?"span "+t+"/span "+t:t}},gridRows:{match:"^grid-rows:.",declare(t,e){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+t+e+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:{min:"min-content",max:"max-content"}},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:{min:"min-content",max:"max-content"},native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplateRows:{native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},columnGap:{match:"^gap-x:.",unit:"rem",native:!0},rowGap:{match:"^gap-y:.",unit:"rem",native:!0},gap:{unit:"rem",native:!0,order:-1},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(t,e){return{"box-decoration-break":t+e,"-webkit-box-decoration-break":t+e}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMarginLeft:{match:"^sml:.",native:!0,unit:"rem"},scrollMarginRight:{match:"^smr:.",native:!0,unit:"rem"},scrollMarginTop:{match:"^smt:.",native:!0,unit:"rem"},scrollMarginBottom:{match:"^smb:.",native:!0,unit:"rem"},scrollMarginX:{match:"^(?:smx|scroll-margin-x):.",unit:"rem",order:-.5,declare(t,e){return{"scroll-margin-left":t+e,"scroll-margin-right":t+e}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(t,e){return{"scroll-margin-top":t+e,"scroll-margin-bottom":t+e}}},scrollMargin:{match:"^sm:.",native:!0,unit:"rem",order:-1},scrollPaddingLeft:{match:"^spl:.",native:!0,unit:"rem"},scrollPaddingRight:{match:"^spr:.",native:!0,unit:"rem"},scrollPaddingTop:{match:"^spt:.",native:!0,unit:"rem"},scrollPaddingBottom:{match:"^spb:.",native:!0,unit:"rem"},scrollPaddingX:{match:"^(?:spx|scroll-padding-x):.",unit:"rem",order:-.5,declare(t,e){return{"scroll-padding-left":t+e,"scroll-padding-right":t+e}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(t,e){return{"scroll-padding-top":t+e,"scroll-padding-bottom":t+e}}},scrollPadding:{match:"^sp:.",native:!0,unit:"rem",order:-1},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(t,e){return{"mask-image":t+e,"-webkit-mask-image":t+e}}}},Oe=Fe;function je(t){if(!this.css.config.keyframes)return;let e=(this.meta.origin==="symbol"?t.slice(this.meta.config.symbol.length):t.slice(t.indexOf(":")+1)).split("|").filter(r=>r in this.css.config.keyframes);e?.length&&(this.keyframeNames=e)}function ge(){if(this.keyframeNames?.length){let t=this.css.rules[0];for(let e of this.keyframeNames){let r=this.css.keyframes[e];if(!--r.count){let a=t.natives.indexOf(r.native);this.css.style.sheet.deleteRule(a),t.natives.splice(a,1),delete this.css.keyframes[e]}}t.natives.length||this.css.rules.splice(0,1)}}function pe(){if(this.keyframeNames){let{config:t,keyframes:e,style:r,rules:a}=this.css,c=r?.sheet;for(let s of this.keyframeNames)if(s in e)e[s].count++;else{let y={text:`@keyframes ${s}{`+Object.entries(t.keyframes[s]).map(([g,l])=>`${g}{${Object.entries(l).map(([f,n])=>f+":"+n).join(";")}}`).join("")+"}",theme:""},w;if(Object.keys(e).length?(w=a[0]).natives.push(y):a.splice(0,0,w={natives:[y],get text(){return this.natives.map(g=>g.text).join("")}}),c){let g;for(let l=0;l<c.cssRules.length;l++){let f=c.cssRules[l];if(f.constructor.name!=="CSSKeyframesRule")break;if(f.name===s){g=f;break}}if(g)y.cssRule=g;else{let l=w.natives.length-1;c.insertRule(y.text,l),y.cssRule=c.cssRules[l]}}e[s]={native:y,count:1}}}}var Ie={fade:{"0%":{opacity:0},to:{opacity:1}},flash:{"0%,50%,to":{opacity:1},"25%,75%":{opacity:0}},float:{"0%":{transform:"none"},"50%":{transform:"translateY(-1.25rem)"},to:{transform:"none"}},heart:{"0%":{transform:"scale(1)"},"14%":{transform:"scale(1.3)"},"28%":{transform:"scale(1)"},"42%":{transform:"scale(1.3)"},"70%":{transform:"scale(1)"}},jump:{"0%,to":{transform:"translateY(-25%)","animation-timing-function":"cubic-bezier(.8,0,1,1)"},"50%":{transform:"translateY(0)","animation-timing-function":"cubic-bezier(0,0,.2,1)"}},ping:{"75%,to":{transform:"scale(2)",opacity:0}},pulse:{"0%":{transform:"none"},"50%":{transform:"scale(1.05)"},to:{transform:"none"}},rotate:{"0%":{transform:"rotate(-360deg)"},to:{transform:"none"}},shake:{"0%":{transform:"none"},"6.5%":{transform:"translateX(-6px) rotateY(-9deg)"},"18.5%":{transform:"translateX(5px) rotateY(7deg)"},"31.5%":{transform:"translateX(-3px) rotateY(-5deg)"},"43.5%":{transform:"translateX(2px) rotateY(3deg)"},"50%":{transform:"none"}},zoom:{"0%":{transform:"scale(0)"},to:{transform:"none"}}};var be={$:{name:"var",transform(t){return"--"+t}},calc:{transform(t){let e=this.values,r=this.css.globalValues,a="",c,s="",y=!1,w="",g=!0,l=(f,n="",m="")=>{if(c===2&&!y){let x=this.analyzeUnitValue(s,be.calc.unit);x&&(s=x.value+x.unit)}f!=="("?e&&s in e?s=e[s].toString():r&&s in r&&(s=r[s].toString()):w=s,f===")"&&(w=""),a+=s+n+f+m,c=null,y=!1,s=""};for(let f=0;f<t.length;f++){let n=t[f];if(n==="("||n===")"){l(n),g=!0;continue}else if(n===",")l(n,""," ");else if(n==="-"&&c!==1){let m=t[f-1];m==="("?a+=n:m===")"?l(n," "," "):isNaN(+t[f+1])?m==="-"?(l(n),c=1):l(n,g?"":" ",g?"":" "):l(n,s?" ":"",s?" ":"")}else if(n==="+"||n==="*"||n==="/"||w!=="var"&&n==="-")l(n," "," ");else{switch(c){case 1:break;case 2:n!=="."&&!/[0-9]/.test(n)&&(y=!0);break;default:c=isNaN(+n)?1:2}c?s+=n:a+=n}g=!1}return l(""),a}},translate:{unit:"rem"},translateX:{unit:"rem"},translateY:{unit:"rem"},translateZ:{unit:"rem"},translate3d:{unit:"rem"},skew:{unit:"deg"},skewX:{unit:"deg"},skewY:{unit:"deg"},skewZ:{unit:"deg"},skew3d:{unit:"deg"},rotate:{unit:"deg"},rotateX:{unit:"deg"},rotateY:{unit:"deg"},rotateZ:{unit:"deg"},rotate3d:{unit:"deg"},blur:{unit:"rem"},"drop-shadow":{unit:"rem"},"hue-rotate":{unit:"deg"},rgb:{unit:""},rgba:{unit:""},hsl:{unit:""},hsla:{unit:""},repeat:{unit:""}};var Ae="class";var ae={breakpoints:Ce,colors:Re,rootSize:16,scope:$e,selectors:Te,semantics:Be,themes:Me,rules:Oe,override:!1,observe:!0,important:!1,functions:be,keyframes:Ie,themeDriver:Ae};var Le=[",",".","#","[","!","*",">","+","~",":","@"];var ve=typeof window<"u",Ee=()=>{let t=document.createElement("style");return t.id="master",t},ne=class{constructor(e=ae){this.config=e;e?.override||(this.config=J(ae,e),"keyframes"in e&&Object.assign(this.config.keyframes,e.keyframes)),this.cache(),ve&&this.config.observe&&this.observe(document),ne.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:e,classes:r,selectors:a,themes:c,colors:s,values:y,breakpoints:w,mediaQueries:g,rules:l}=this.config;function f(o){return o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(o,d,v="",R={}){let T=L=>L?(v?v+"-":"")+L:v,I=Object.entries(o),A=[],X=[];for(let L of I){let Q=L[1];(typeof Q=="object"&&!Array.isArray(Q)?A:X).push(L)}for(let[L,Q]of A)n(Q,d,T(L),R);if(d&&v)X.length&&(R[v]=X.reduce((L,[Q,Z])=>(L[Q]=Z,L),{}));else for(let[L,Q]of X)R[T(L)]=Q;return R}function m(o){for(let[d,v]of Object.entries(o))/^[0-9]+x$/.test(d)&&typeof v=="number"&&(o["-"+d]=v*-1);return o}if(e)for(let[o,d]of Object.entries(n(e,!0)))this.semantics.push([new RegExp("^"+f(o)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[o,d]]);if(a)for(let[o,d]of Object.entries(n(a,!1))){let v=new RegExp(f(o)+"(?![a-z-])");for(let R of Array.isArray(d)?d:[d]){let T=R.match(/^::-[a-z]+-/m)?.[0]??"",I=this.selectors[T];I||(I=this.selectors[T]=[]);let A=I.find(([X])=>X===v);A||(A=[v,[]],I.push(A)),A[1].push(R)}}y&&(this.globalValues=m(n(y,!1))),w&&(this.breakpoints=n(w,!1)),g&&(this.mediaQueries=n(g,!1));let x=r?n(r,!1):{},S=c&&!Array.isArray(c)?Object.entries(c).filter(([,{classes:o}])=>o).reduce((o,[d,{classes:v}])=>(o[d]=n(v,!1),o),{}):{},k=[...Object.keys(x),...Object.entries(S).flatMap(([o,d])=>Object.keys(d))],b=o=>{if(o in this.classes)return;let d=this.classes[o]=[],v=(R,T)=>{if(!T)return;let I=Array.isArray(T)?T:T.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let A of I){let X=L=>{L in this.themeAffectedClassesBy?R in this.themeAffectedClassesBy[L]?this.themeAffectedClassesBy[L][R].push(o):this.themeAffectedClassesBy[L][R]=[o]:this.themeAffectedClassesBy[L]={[R]:[o]},d.includes(L)||d.push(L)};if(k.includes(A)){b(A);for(let L of this.classes[A])X(L)}else X(A)}};v("",x?.[o]);for(let[R,T]of Object.entries(S))v(R,T?.[o])};for(let o of k)b(o);for(let o in this.themeAffectedClassesBy){let d=this.classesBy[o]=[];for(let v of Object.values(this.themeAffectedClassesBy[o]))for(let R of v)d.includes(R)||d.push(R)}let u=(o,d)=>{if(!d)return;let v=n(d,!0);for(let[R,T]of Object.entries(v)){let I=typeof T=="string"?{"":T}:T;for(let[A,X]of Object.entries(I)){let L=R+(A?"-"+A:"");L in this.colorThemesMap?this.colorThemesMap[L][o]=X:this.colorThemesMap[L]={[o]:X}}}for(let R in d)this.colorNames.includes(R)||this.colorNames.push(R)};if(u("",s),c)if(Array.isArray(c))this.themeNames.push(...c);else for(let o in c){let d=c[o];u(o,d.colors),this.themeNames.push(o)}let i=o=>{for(let[d,v]of Object.entries(this.colorThemesMap))for(let[R,T]of Object.entries(v))T.startsWith("#")||o(d,v,R,T)};if(i((o,d,v,R)=>{let T=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(R);if(T){let I="#"+ue(+T[1],+T[2],+T[3]);T[4]&&(I+=Math.round(255*+T[4]).toString(16)),d[v]=I}}),i((o,d,v,R)=>{let[T,I]=R.split("/"),A=this.colorThemesMap[T];if(A){let X=(v?A[v]:void 0)??A[""];d[v]=I?X.slice(0,7)+Math.round(255*+I).toString(16):X}else console.warn(`\`${R}\` doesn't exist in the extended config \`.colors\``),delete d[v],Object.keys(d).length||delete this.colorThemesMap[o]}),l)for(let o in l){let d=l[o],{native:v,values:R,colored:T}=d,I=d.match;if(d.id=o,d.native=v===!0?o.replace(/(?!^)[A-Z]/g,A=>"-"+A).toLowerCase():void 0,R&&(this.values[o]=m(n(R,!1))),I){let A=Object.keys(this.values[o]??{});I.includes("$values")&&(I=A.length?I.replace(/\$values/,A.join("|")):I.replace(/(?:\|)?\$values/,"")),T&&I.includes("$colors")&&(I=this.colorNames.length?I.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):I.replace(/(?:\|)?\$colors/,"")),this.matches[o]=new RegExp(I)}}}observe(e,r={subtree:!0,childList:!0}){if(this.root!==e){if(ve&&e){this.root=e;let a=e===document;a&&(ne.root=this),this.host=a?document.documentElement:this.root.host;let c=a?document.head:e,s=a?document.styleSheets:e.styleSheets;for(let w of s){let{ownerNode:g}=w;if(g&&g.id==="master"){this.style=g;break}}if(this.style)for(let w=0;w<this.style.sheet.cssRules.length;w++){let g=this.style.sheet.cssRules[w];if(g.constructor.name==="CSSKeyframesRule")continue;let l=n=>{if(n.selectorText){let x=n.selectorText.split(", ")[0].split(" ");for(let S=0;S<x.length;S++){let k=x[S];if(k[0]==="."){let b=k.slice(1),u="";for(let i=0;i<b.length;i++){let o=b[i],d=b[i+1];if(o==="\\"){if(i++,d!=="\\"){u+=d;continue}}else if(Le.includes(o))break;u+=o}if(!(u in this.ruleBy)&&!(u in this.classes)){let i=this.create(u)[0];if(i)return i}}}}else if(n.cssRules)for(let m=0;m<n.cssRules.length;m++){let x=l(n.cssRules[m]);if(x)return x}},f=l(g);if(f){this.rules.push(f),this.ruleBy[f.className]=f;for(let n=0;n<f.natives.length;n++)f.natives[n].cssRule=this.style.sheet.cssRules[w+n];w+=f.natives.length-1,f.config.insert?.call(f)}}else this.style=Ee(),c.append(this.style);let y=w=>{w.forEach(g=>{g in this.countBy?this.countBy[g]++:(this.countBy[g]=1,this.insert(g))})};y(this.host.classList),r.subtree&&this.host.querySelectorAll("[class]").forEach(w=>y(w.classList)),this.observer=new MutationObserver(w=>{let g={},l=[],f=[],n=[],m=(b,u)=>{u?b.classList.forEach(S):b.classList.forEach(x);let i=b.children;for(let o=0;o<i.length;o++){let d=i[o];d.classList&&(f.push(d),m(d,u))}},x=b=>{b in g?g[b]++:g[b]=1},S=b=>{b in g?g[b]--:b in this.countBy&&(g[b]=-1)},k=(b,u)=>{for(let i=0;i<b.length;i++){let o=b[i];o.classList&&!f.includes(o)&&!n.includes(o)&&(o.isConnected!==u?(f.push(o),m(o,u)):n.push(o))}};for(let b=0;b<w.length;b++){let u=w[b],{addedNodes:i,removedNodes:o,type:d,target:v}=u;if(d==="attributes"){if(l.find(R=>R.target===v))continue;l.push(u)}else k(i,!1),(!v.isConnected||!f.includes(v))&&k(o,!0)}if(!(!l.length&&!Object.keys(g).length)){for(let{oldValue:b,target:u}of l){let i=f.includes(u),o=u.classList,d=b?b.split(" "):[];if(i){if(u.isConnected)continue;for(let v of d)o.contains(v)||S(v)}else if(u.isConnected){o.forEach(v=>{d.includes(v)||x(v)});for(let v of d)o.contains(v)||S(v)}}for(let b in g){let u=g[b],i=(this.countBy[b]||0)+u;i===0?(delete this.countBy[b],this.delete(b)):(b in this.countBy||this.insert(b),this.countBy[b]=i)}}}),this.observer.observe(e,{...r,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let e=this.style?.sheet;if(e?.cssRules)for(let r=e.cssRules.length-1;r>=0;r--)e.deleteRule(r);this.style?.remove(),this.style=null,this.root=null}match(e){for(let r in this.config.rules){let a=this.config.rules[r],c=this.matches[r],{symbol:s,native:y}=a;if(c&&c.test(e))return{origin:"match",config:a};if(s&&e.startsWith(s))return{origin:"symbol",config:a};if(y&&e.startsWith(y+":"))return{origin:"match",config:a}}for(let r of this.semantics)if(e.match(r[0]))return{origin:"semantics",value:r[1]}}create(e){let r=a=>{if(a in this.ruleBy)return this.ruleBy[a];let c=this.match(a);if(c)return new ce(a,c,this)};return(e in this.classes?this.classes[e].map(a=>r(a)):[r(e)]).filter(a=>a&&a.text)}refresh(e){if(e?.override?this.config=e:this.config=J(ae,e),this.cache(),!this.style)return;let r=Ee();this.style.replaceWith(r),this.style=r,this.rules.length=0,this.ruleBy={};for(let a in this.countBy)this.insert(a)}destroy(){let e=ne.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let r=this.style?.sheet,a=c=>{let s=this.ruleBy[c];if(!(!s||c in this.classesBy&&this.classesBy[c].some(y=>y in this.countBy))){if(r&&s.natives.length){let y=s.natives[0];for(let w=0;w<r.cssRules.length;w++)if(r.cssRules[w]===y.cssRule){for(let l=0;l<s.natives.length;l++)r.deleteRule(w);break}}this.rules.splice(this.rules.indexOf(s),1),delete this.ruleBy[c],s.config.delete&&s.config.delete.call(s,c)}};if(e in this.classes){for(let c of this.classes[e])c in this.countBy||a(c);delete this.ruleBy[e]}else a(e)}insert(e){let r=this.create(e);return r.length?(this.insertRules(r),!0):!1}insertRules(e){for(let r of e){if(this.ruleBy[r.className])continue;let a,c=Object.keys(this.keyframes).length,s=this.rules.length-1,{media:y,order:w,priority:g,hasWhere:l,className:f}=r,n=(S,k,b)=>{let u=S;for(;u<=s;u++){let i=this.rules[u];if(k?.(i))return b?-1:u-1;if(b?.(i))return u}return b?-1:u-1},m,x;if(y){let S=this.rules.findIndex(k=>k.media);if(S===-1)a=s+1;else{let{"max-width":k,"min-width":b}=y.features;if(k||b){let u=this.rules.findIndex(i=>i.media?.features["max-width"]||i.media?.features["min-width"]);if(u===-1)a=s+1;else if(k&&b){if(g===-1?(m=n(u,i=>i.priority!==-1,i=>i.media.features["max-width"]&&i.media.features["min-width"]),x=n(u,i=>i.priority!==-1)):(m=n(u,void 0,i=>i.media.features["max-width"]&&i.media.features["min-width"]&&i.priority!==-1),x=s),m!==-1){let i=k.value-b.value,o=x,d=m;for(m=void 0;o>=d;o--){let{"max-width":v,"min-width":R}=this.rules[o].media.features,T=v.value-R.value;if(T<i)x=o-1;else if(T===i)m=o;else break}}if(m!==-1){let i=k.value-b.value;for(let o=x;o>=m;o--){let{"max-width":d,"min-width":v}=this.rules[o].media.features,R=d.value-v.value;if(R<i)x=o-1;else if(R>i){m=o+1;break}}}}else if(b){if(g===-1?(m=n(u,i=>i.media.features["max-width"]&&i.media.features["min-width"]||i.priority!==-1,i=>!i.media.features["max-width"]&&i.media.features["min-width"]),x=n(u,i=>i.media.features["max-width"]&&i.media.features["min-width"]||i.priority!==-1)):(m=n(u,i=>i.media.features["max-width"]&&i.media.features["min-width"]&&i.priority!==-1,i=>!i.media.features["max-width"]&&i.media.features["min-width"]&&i.priority!==-1),x=n(u,i=>i.media.features["max-width"]&&i.media.features["min-width"]&&i.priority!==-1)),m!==-1)for(let i=x;i>=m;i--){let o=this.rules[i].media.features["min-width"].value;if(o>b.value)x=i-1;else if(o<b.value){m=i+1;break}}}else if(g===-1?(m=n(u,i=>i.media.features["min-width"]||i.priority!==-1,i=>i.media.features["max-width"]),x=n(u,i=>i.media.features["min-width"]||i.priority!==-1)):(m=n(u,i=>i.media.features["min-width"]&&i.priority!==-1,i=>i.media.features["max-width"]&&i.priority!==-1),x=n(u,i=>i.media.features["min-width"]&&i.priority!==-1)),m!==-1)for(let i=x;i>=m;i--){let o=this.rules[i].media.features["max-width"].value;if(o<k.value)x=i-1;else if(o>k.value){m=i+1;break}}}else g===-1?(m=S,x=n(S,u=>u.media?.features["max-width"]||u.media?.features["min-width"]||u.priority!==-1)):(m=n(S,u=>u.media?.features["max-width"]||u.media?.features["min-width"],u=>u.priority!==-1),x=n(S,u=>u.media?.features["max-width"]||u.media?.features["min-width"]))}}else{let S=c?1:0;g===-1?(m=S,x=n(S,k=>k.media||k.priority!==-1)):(m=n(S,k=>k.media,k=>k.priority!==-1),x=n(S,k=>k.media))}if(a===void 0)if(m===-1)a=x+1;else{if(g===-1)for(let S=m;S<=x;S++){let k=this.rules[S];if(!(!l&&k.hasWhere)&&(l&&!k.hasWhere||k.order>=w)){a=S;break}}else for(let S=m;S<=x;S++){let k=this.rules[S];if(!(!l&&k.hasWhere)){if(l&&!k.hasWhere){a=S;break}if(k.priority<g){a=S;break}else if(k.priority===g){if(k.order>=w){a=S;break}}else a=S+1}}a===void 0&&(a=x+1)}if(this.rules.splice(a,0,r),this.ruleBy[f]=r,this.style){let S=this.style.sheet,k=0,b=u=>{let i=this.rules[u];if(i){if(!i.natives.length)return b(u-1);let o=i.natives[i.natives.length-1].cssRule;for(let d=0;d<S.cssRules.length;d++)if(S.cssRules[d]===o){k=d+1;break}}};b(a-1);for(let u=0;u<r.natives.length;)try{let i=r.natives[u];S.insertRule(i.text,k),i.cssRule=S.cssRules[k++],u++}catch(i){console.error(i),r.natives.splice(u,1)}}r.config.insert?.call(r)}}get text(){return this.rules.map(e=>e.text).join("")}},re=ne;oe(re,"root"),oe(re,"config",ae),oe(re,"instances",[]),oe(re,"refresh",e=>{for(let r of ne.instances)r.refresh(e)});ve&&(window.MasterCSS=re);var We={store:"theme",init:!0},Pe=typeof document<"u",Ne=typeof localStorage<"u",de=class{constructor(e,r=Pe?document.documentElement:null){this.settings=e;this.host=r;this.settings=e?J(We,e):We,this.settings.init&&this.init()}e=typeof matchMedia<"u"?matchMedia?.("(prefers-color-scheme:dark)"):void 0;r;t;init(){let e=this.settings.default,r=this.storage;r&&(e=r),this.value=e}get storage(){let{store:e}=this.settings;if(Ne&&e)return localStorage.getItem(e)}get systemValue(){return this.e.matches?"dark":"light"}set value(e){this.r=e,e==="system"?(this.e?.addEventListener?.("change",this.i),this.current=this.systemValue):(this.n(),this.current=e)}get value(){return this.r}set current(e){let r=this.t;this.t=e,this.host&&r!==e&&(r&&this.host.classList.remove(r),e&&!this.host.classList.contains(e)&&(this.host.classList.add(e),this.host.style&&(this.host.style.colorScheme=e)))}get current(){return this.t}switch(e,r={store:!0,emit:!0}){e&&e!==this.value&&(this.value=e,Ne&&this.storage!==e&&this.settings.store&&localStorage.setItem(this.settings.store,e),r.emit&&this.host.dispatchEvent(new CustomEvent("theme",{detail:this})))}n(){this.e?.removeEventListener("change",this.i)}i=e=>{this.current=e.matches?"dark":"light"};destroy(){this.n()}};new re(window.masterCSSConfig);new de(window.masterCSSThemeSettings);})();
|