@master/css 2.0.0-beta.139 → 2.0.0-beta.140
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/config/functions.js +1 -1
- package/dist/cjs/config/rules.js +1 -1
- package/dist/cjs/css.js +1 -1
- package/dist/cjs/methods/extract-classes-from-html.js +1 -1
- package/dist/cjs/rule.js +1 -1
- package/dist/css.d.ts +7 -5
- package/dist/esm/config/functions.mjs +1 -1
- package/dist/esm/config/rules.mjs +1 -1
- package/dist/esm/css.mjs +1 -1
- package/dist/esm/methods/extract-classes-from-html.mjs +1 -1
- package/dist/esm/rule.mjs +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.js +8 -8
- package/dist/index.mjs +9 -9
- package/package.json +1 -1
- package/dist/cjs/constants/sizing-values.js +0 -1
- package/dist/cjs/constants/sorted-selectors.js +0 -1
- package/dist/constants/sizing-values.d.ts +0 -7
- package/dist/constants/sorted-selectors.d.ts +0 -1
- package/dist/esm/constants/sizing-values.mjs +0 -1
- package/dist/esm/constants/sorted-selectors.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var f=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var h=(e,n)=>{for(var s in n)f(e,s,{get:n[s],enumerable:!0})},
|
|
1
|
+
var f=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var h=(e,n)=>{for(var s in n)f(e,s,{get:n[s],enumerable:!0})},p=(e,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of k(n))!w.call(e,i)&&i!==s&&f(e,i,{get:()=>n[i],enumerable:!(a=m(n,i))||a.enumerable});return e};var b=e=>p(f({},"__esModule",{value:!0}),e);var R={};h(R,{functions:()=>c});module.exports=b(R);var c={$:{name:"var",transform(e){return"--"+e}},calc:{transform(e){let n=r=>r==="+"||r==="-"||r==="*"||r==="/",s="",a,i="",g=!1,l=!1,u=(r,t="",d="")=>{if(a===2&&!l){let o=this.analyzeUnitValue(i,c.calc.unit);o&&(i=o.value+o.unit)}s+=i+t+r+d,a=null,l=!1,i=""};for(let r=0;r<e.length;r++){let t=e[r];if(t==="("||t===")")g=t===")",u(t);else if(t===",")u(t,""," ");else{switch(a){case 1:break;case 2:if(n(t)){u(t," "," ");continue}else/[0-9]/.test(t)||(l=!0);break;default:g&&(s+=" "),isNaN(+t)?n(t)||(a=1):a=2;break}a?i+=t:s+=t}}return u(""),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:""}};0&&(module.exports={functions});
|
package/dist/cjs/config/rules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var g=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var w=(e,t)=>{for(var i in t)g(e,i,{get:t[i],enumerable:!0})},S=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of k(t))!C.call(e,n)&&n!==i&&g(e,n,{get:()=>t[n],enumerable:!(c=$(t,n))||c.enumerable});return e};var R=e=>S(g({},"__esModule",{value:!0}),e);var I={};w(I,{rules:()=>T});module.exports=R(I);var v=require("../constants/start-symbol"),x=require("../utils/css-escape"),B={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},i=(o,r)=>{let a=r.indexOf(":");if(a!==-1){o in t||(t[o]={});let u=t[o],h=r.slice(0,a);h in u||(u[h]=r.slice(a+1))}},c=o=>{let r=(a,u)=>{let h=u.slice((0,x.cssEscape)(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let y of h)i(a,y)};if(this.theme){let a=o.natives.find(u=>u.theme===this.theme)??o.natives.find(u=>!u.theme);a&&r(this.theme,a.text)}else for(let a of o.natives)r(a.theme,a.text)},n=[],l="",d=()=>{l&&(n.push(l.replace(/ /g,"")),l="")},m=1;(function o(r){for(;m<e.length;m++){let a=e[m];if(!r){if(a===";"){d();continue}if(a==="}")break}if(l+=a,r===a){if(r==="'"||r==='"'){let u=0;for(let h=l.length-2;l[h]==="\\";h--)u++;if(u%2)continue}break}else a in v.START_SYMBOL&&r!=="'"&&r!=='"'&&(m++,o(v.START_SYMBOL[a]))}})(void 0),d();for(let o of n){let r=this.css.create(o);if(Array.isArray(r))for(let a of r)c(a);else r?c(r):i(this.theme??"",o)}let s={};for(let o in t)for(let[r,a]of Object.entries(t[o]))r in s?s[r][o]=a:s[r]={[o]:a};return s}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},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(e){switch(e){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(e,t){return{"margin-left":e+t,"margin-right":e+t}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"margin-top":e+t,"margin-bottom":e+t}}},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(e,t){return{"padding-left":e+t,"padding-right":e+t}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"padding-top":e+t,"padding-bottom":e+t}}},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(e){return[e]},declare(e){let[t,i]=e.split(" x ");return{width:t,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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"min-width":t,"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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"max-width":t,"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(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},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},overflowY:{native:!0},overflow:{native:!0,order:-1},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(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},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(e){return b.call(this,e)},delete(e){return p.call(this,e)},insert(){return f.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return b.call(this,e)},delete(e){return p.call(this,e)},insert(){return f.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(e,t){return{"border-left-color":e+t,"border-right-color":e+t}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-top-color":e+t,"border-bottom-color":e+t}}},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(e,t){return{"border-top-left-radius":e+t,"border-top-right-radius":e+t}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(e,t){return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t}}},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(e,t){return{"border-left-style":e+t,"border-right-style":e+t}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-top-style":e+t,"border-bottom-style":e+t}}},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(e,t){return{"border-left-width":e+t,"border-right-width":e+t}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-top-width":e+t,"border-bottom-width":e+t}}},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(e){return{"border-left":e,"border-right":e}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-top":e,"border-bottom":e}}},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(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},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)(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"}},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(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},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(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",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(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},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(e,t){return{"scroll-margin-left":e+t,"scroll-margin-right":e+t}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t}}},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(e,t){return{"scroll-padding-left":e+t,"scroll-padding-right":e+t}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t}}},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(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},T=B;function b(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function p(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let i=this.css.keyframes[t];if(!--i.count){let c=e.natives.indexOf(i.native);this.css.style.sheet.deleteRule(c),e.natives.splice(c,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function f(){if(this.keyframeNames){let{config:e,keyframes:t,style:i,rules:c}=this.css,n=i?.sheet;for(let l of this.keyframeNames)if(l in t)t[l].count++;else{let d={text:`@keyframes ${l}{`+Object.entries(e.keyframes[l]).map(([s,o])=>`${s}{${Object.entries(o).map(([r,a])=>r+":"+a).join(";")}}`).join("")+"}",theme:""},m;if(Object.keys(t).length?(m=c[0]).natives.push(d):c.splice(0,0,m={natives:[d],get text(){return this.natives.map(s=>s.text).join("")}}),n){let s;for(let o=0;o<n.cssRules.length;o++){let r=n.cssRules[o];if(r.constructor.name!=="CSSKeyframesRule")break;if(r.name===l){s=r;break}}if(s)d.cssRule=s;else{let o=m.natives.length-1;n.insertRule(d.text,o),d.cssRule=n.cssRules[o]}}t[l]={native:d,count:1}}}}0&&(module.exports={rules});
|
|
1
|
+
var g=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var w=(e,t)=>{for(var i in t)g(e,i,{get:t[i],enumerable:!0})},S=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of k(t))!C.call(e,n)&&n!==i&&g(e,n,{get:()=>t[n],enumerable:!(c=$(t,n))||c.enumerable});return e};var R=e=>S(g({},"__esModule",{value:!0}),e);var I={};w(I,{rules:()=>T});module.exports=R(I);var v=require("../constants/start-symbol"),x=require("../utils/css-escape"),B={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},i=(o,r)=>{let a=r.indexOf(":");if(a!==-1){o in t||(t[o]={});let u=t[o],h=r.slice(0,a);h in u||(u[h]=r.slice(a+1))}},c=o=>{let r=(a,u)=>{let h=u.slice((0,x.cssEscape)(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let y of h)i(a,y)};if(this.theme){let a=o.natives.find(u=>u.theme===this.theme)??o.natives.find(u=>!u.theme);a&&r(this.theme,a.text)}else for(let a of o.natives)r(a.theme,a.text)},n=[],l="",d=()=>{l&&(n.push(l.replace(/ /g,"")),l="")},m=1;(function o(r){for(;m<e.length;m++){let a=e[m];if(!r){if(a===";"){d();continue}if(a==="}")break}if(l+=a,r===a){if(r==="'"||r==='"'){let u=0;for(let h=l.length-2;l[h]==="\\";h--)u++;if(u%2)continue}break}else a in v.START_SYMBOL&&r!=="'"&&r!=='"'&&(m++,o(v.START_SYMBOL[a]))}})(void 0),d();for(let o of n){let r=this.css.create(o);if(Array.isArray(r))for(let a of r)c(a);else r?c(r):i(this.theme??"",o)}let s={};for(let o in t)for(let[r,a]of Object.entries(t[o]))r in s?s[r][o]=a:s[r]={[o]:a};return s}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},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(e){switch(e){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(e,t){return{"margin-left":e+t,"margin-right":e+t}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"margin-top":e+t,"margin-bottom":e+t}}},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(e,t){return{"padding-left":e+t,"padding-right":e+t}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"padding-top":e+t,"padding-bottom":e+t}}},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(e){return[e]},declare(e){let[t,i]=e.split(" x ");return{width:t,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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"min-width":t,"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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"max-width":t,"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(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},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},overflowY:{native:!0},overflow:{native:!0,order:-1},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(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},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(e){return b.call(this,e)},delete(e){return p.call(this,e)},insert(){return f.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return b.call(this,e)},delete(e){return p.call(this,e)},insert(){return f.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(e,t){return{"border-left-color":e+t,"border-right-color":e+t}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-top-color":e+t,"border-bottom-color":e+t}}},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(e,t){return{"border-top-left-radius":e+t,"border-top-right-radius":e+t}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(e,t){return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t}}},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(e,t){return{"border-left-style":e+t,"border-right-style":e+t}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-top-style":e+t,"border-bottom-style":e+t}}},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(e,t){return{"border-left-width":e+t,"border-right-width":e+t}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-top-width":e+t,"border-bottom-width":e+t}}},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(e){return{"border-left":e,"border-right":e}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-top":e,"border-bottom":e}}},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(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},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)(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"}},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(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},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(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",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(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},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(e,t){return{"scroll-margin-left":e+t,"scroll-margin-right":e+t}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t}}},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(e,t){return{"scroll-padding-left":e+t,"scroll-padding-right":e+t}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t}}},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(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},T=B;function b(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function p(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let i=this.css.keyframes[t];if(!--i.count){let c=e.natives.indexOf(i.native);this.css.style.sheet.deleteRule(c),e.natives.splice(c,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function f(){if(this.keyframeNames){let{config:e,keyframes:t,style:i,rules:c}=this.css,n=i?.sheet;for(let l of this.keyframeNames)if(l in t)t[l].count++;else{let d={text:`@keyframes ${l}{`+Object.entries(e.keyframes[l]).map(([s,o])=>`${s}{${Object.entries(o).map(([r,a])=>r+":"+a).join(";")}}`).join("")+"}",theme:""},m;if(Object.keys(t).length?(m=c[0]).natives.push(d):c.splice(0,0,m={natives:[d],get text(){return this.natives.map(s=>s.text).join("")}}),n){let s;for(let o=0;o<n.cssRules.length;o++){let r=n.cssRules[o];if(r.constructor.name!=="CSSKeyframesRule")break;if(r.name===l){s=r;break}}if(s)d.cssRule=s;else{let o=m.natives.length-1;n.insertRule(d.text,o),d.cssRule=n.cssRules[o]}}t[l]={native:d,count:1}}}}0&&(module.exports={rules});
|
package/dist/cjs/css.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var S=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var P=(g,e,i)=>e in g?S(g,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):g[e]=i;var U=(g,e)=>{for(var i in e)S(g,i,{get:e[i],enumerable:!0})},Y=(g,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of Z(e))!q.call(g,d)&&d!==i&&S(g,d,{get:()=>e[d],enumerable:!(n=_(e,d))||n.enumerable});return g};var G=g=>Y(S({},"__esModule",{value:!0}),g);var O=(g,e,i)=>(P(g,typeof e!="symbol"?e+"":e,i),i);var J={};U(J,{MasterCSS:()=>W});module.exports=G(J);function F(g){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&g instanceof e||g instanceof Date||g instanceof RegExp)}function I(g){if(typeof Buffer<"u"&&Buffer&&g instanceof Buffer){let e=Buffer.alloc(g.length);return g.copy(e),e}else{if(g instanceof Date)return new Date(g.getTime());if(g instanceof RegExp)return new RegExp(g);throw new Error("Unexpected situation")}}function $(g){let e=[];return g.forEach(function(i,n){typeof i=="object"&&i!==null?Array.isArray(i)?e[n]=$(i):F(i)?e[n]=I(i):e[n]=j({},i):e[n]=i}),e}function L(g,e){return e==="__proto__"?void 0:g[e]}function j(...g){let e={},i,n;return g.forEach(function(d){typeof d!="object"||d===null||Array.isArray(d)||Object.keys(d).forEach(function(v){if(n=L(e,v),i=L(d,v),i!==e)if(typeof i!="object"||i===null){e[v]=i;return}else if(Array.isArray(i)){e[v]=$(i);return}else if(F(i)){e[v]=I(i);return}else if(typeof n!="object"||n===null||Array.isArray(n)){e[v]=j({},i);return}else{e[v]=j(n,i);return}})}),e}var D=require("./rule"),T=require("./config"),H=require("./utils/rgb-to-hex"),Q=require("./constants/selector-symbols");var N=typeof window<"u",V=()=>{let g=document.createElement("style");return g.id="master",g},A=class{constructor(e=T.config){this.config=e;e?.override||(this.config=j(T.config,e),"keyframes"in e&&Object.assign(this.config.keyframes,e.keyframes)),this.cache(),N&&this.config.observe&&this.observe(document),A.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:n,themes:d,colors:v,values:k,breakpoints:x,mediaQueries:y,rules:C}=this.config;function B(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function M(t,r,c="",s={}){let a=b=>b?(c?c+"-":"")+b:c,h=Object.entries(t),p=[],w=[];for(let b of h){let E=b[1];(typeof E=="object"&&!Array.isArray(E)?p:w).push(b)}for(let[b,E]of p)M(E,r,a(b),s);if(r&&c)w.length&&(s[c]=w.reduce((b,[E,z])=>(b[E]=z,b),{}));else for(let[b,E]of w)s[a(b)]=E;return s}if(e)for(let[t,r]of Object.entries(M(e,!0)))this.semantics.push([new RegExp("^"+B(t)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[t,r]]);if(n)for(let[t,r]of Object.entries(M(n,!1))){let c=new RegExp(B(t)+"(?![a-z-])");for(let s of Array.isArray(r)?r:[r]){let a=s.match(/^::-[a-z]+-/m)?.[0]??"",h=this.selectors[a];h||(h=this.selectors[a]=[]);let p=h.find(([w])=>w===c);p||(p=[c,[]],h.push(p)),p[1].push(s)}}k&&(this.globalValues=M(k,!1)),x&&(this.breakpoints=M(x,!1)),y&&(this.mediaQueries=M(y,!1));let f=i?M(i,!1):{},l=d&&!Array.isArray(d)?Object.entries(d).filter(([,{classes:t}])=>t).reduce((t,[r,{classes:c}])=>(t[r]=M(c,!1),t),{}):{},R=[...Object.keys(f),...Object.entries(l).flatMap(([t,r])=>Object.keys(r))],m=t=>{if(t in this.classes)return;let r=this.classes[t]=[],c=(s,a)=>{if(!a)return;let h=Array.isArray(a)?a:a.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let p of h){let w=b=>{b in this.themeAffectedClassesBy?s in this.themeAffectedClassesBy[b]?this.themeAffectedClassesBy[b][s].push(t):this.themeAffectedClassesBy[b][s]=[t]:this.themeAffectedClassesBy[b]={[s]:[t]},r.includes(b)||r.push(b)};if(R.includes(p)){m(p);for(let b of this.classes[p])w(b)}else w(p)}};c("",f?.[t]);for(let[s,a]of Object.entries(l))c(s,a?.[t])};for(let t of R)m(t);for(let t in this.themeAffectedClassesBy){let r=this.classesBy[t]=[];for(let c of Object.values(this.themeAffectedClassesBy[t]))for(let s of c)r.includes(s)||r.push(s)}let o=(t,r)=>{if(!r)return;let c=M(r,!0);for(let[s,a]of Object.entries(c)){let h=typeof a=="string"?{"":a}:a;for(let[p,w]of Object.entries(h)){let b=s+(p?"-"+p:"");b in this.colorThemesMap?this.colorThemesMap[b][t]=w:this.colorThemesMap[b]={[t]:w}}}for(let s in r)this.colorNames.includes(s)||this.colorNames.push(s)};if(o("",v),d)if(Array.isArray(d))this.themeNames.push(...d);else for(let t in d){let r=d[t];o(t,r.colors),this.themeNames.push(t)}let u=t=>{for(let[r,c]of Object.entries(this.colorThemesMap))for(let[s,a]of Object.entries(c))a.startsWith("#")||t(r,c,s,a)};if(u((t,r,c,s)=>{let a=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(s);if(a){let h="#"+(0,H.rgbToHex)(+a[1],+a[2],+a[3]);a[4]&&(h+=Math.round(255*+a[4]).toString(16)),r[c]=h}}),u((t,r,c,s)=>{let[a,h]=s.split("/"),p=this.colorThemesMap[a];if(p){let w=(c?p[c]:void 0)??p[""];r[c]=h?w.slice(0,7)+Math.round(255*+h).toString(16):w}else console.warn(`\`${s}\` doesn't exist in the extended config \`.colors\``),delete r[c],Object.keys(r).length||delete this.colorThemesMap[t]}),C)for(let t in C){let r=C[t],{native:c,values:s,colored:a}=r,h=r.match;if(r.id=t,r.native=c===!0?t.replace(/(?!^)[A-Z]/g,p=>"-"+p).toLowerCase():void 0,s&&(this.values[t]=M(s,!1)),h){let p=Object.keys(this.values[t]??{});h.includes("$values")&&(h=p.length?h.replace(/\$values/,p.join("|")):h.replace(/(?:\|)?\$values/,"")),a&&h.includes("$colors")&&(h=this.colorNames.length?h.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):h.replace(/(?:\|)?\$colors/,"")),this.matches[t]=new RegExp(h)}}}observe(e,i={subtree:!0,childList:!0}){if(this.root!==e){if(N&&e){this.root=e;let n=e===document;n&&(A.root=this),this.host=n?document.documentElement:root.host;let d=n?document.head:e,v=n?document.styleSheets:e.styleSheets;for(let x of v){let{ownerNode:y}=x;if(y.id==="master"){this.style=y;break}}if(this.style)for(let x=0;x<this.style.sheet.cssRules.length;x++){let y=this.style.sheet.cssRules[x];if(y.constructor.name==="CSSKeyframesRule")continue;let C=M=>{if(M.selectorText){let l=M.selectorText.split(", ")[0].split(" ");for(let R=0;R<l.length;R++){let m=l[R];if(m[0]==="."){let o=m.slice(1),u="";for(let t=0;t<o.length;t++){let r=o[t],c=o[t+1];if(r==="\\"){if(t++,c!=="\\"){u+=c;continue}}else if(Q.SELECTOR_SYMBOLS.includes(r))break;u+=r}if(!(u in this.ruleBy)&&!(u in this.classes)){let t=this.create(u)[0];if(t)return t}}}}else if(M.cssRules)for(let f=0;f<M.cssRules.length;f++){let l=C(M.cssRules[f]);if(l)return l}},B=C(y);if(B){this.rules.push(B),this.ruleBy[B.className]=B;for(let M=0;M<B.natives.length;M++)B.natives[M].cssRule=this.style.sheet.cssRules[x+M];x+=B.natives.length-1,B.config.insert?.call(B)}}else this.style=V(),d.append(this.style);let k=x=>{x.forEach(y=>{y in this.countBy?this.countBy[y]++:(this.countBy[y]=1,this.insert(y))})};k(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(x=>k(x.classList)),this.observer=new MutationObserver(x=>{let y={},C=[],B=[],M=[],f=(o,u)=>{u?o.classList.forEach(R):o.classList.forEach(l);let t=o.children;for(let r=0;r<t.length;r++){let c=t[r];c.classList&&(B.push(c),f(c,u))}},l=o=>{o in y?y[o]++:y[o]=1},R=o=>{o in y?y[o]--:o in this.countBy&&(y[o]=-1)},m=(o,u)=>{for(let t=0;t<o.length;t++){let r=o[t];r.classList&&!B.includes(r)&&!M.includes(r)&&(r.isConnected!==u?(B.push(r),f(r,u)):M.push(r))}};for(let o=0;o<x.length;o++){let u=x[o],{addedNodes:t,removedNodes:r,type:c,target:s}=u;if(c==="attributes"){if(C.find(a=>a.target===s))continue;C.push(u)}else m(t,!1),(!s.isConnected||!B.includes(s))&&m(r,!0)}if(!(!C.length&&!Object.keys(y).length)){for(let{oldValue:o,target:u}of C){let t=B.includes(u),r=u.classList,c=o?o.split(" "):[];if(t){if(u.isConnected)continue;for(let s of c)r.contains(s)||R(s)}else if(u.isConnected){r.forEach(s=>{c.includes(s)||l(s)});for(let s of c)r.contains(s)||R(s)}}for(let o in y){let u=y[o],t=(this.countBy[o]||0)+u;t===0?(delete this.countBy[o],this.delete(o)):(o in this.countBy||this.insert(o),this.countBy[o]=t)}}}),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 n=this.config.rules[i],d=this.matches[i],{symbol:v,native:k}=n;if(d&&d.test(e))return{origin:"match",config:n};if(v&&e.startsWith(v))return{origin:"symbol",config:n};if(k&&e.startsWith(k+":"))return{origin:"match",config:n}}for(let i of this.semantics)if(e.match(i[0]))return{origin:"semantics",value:i[1]}}create(e){let i=n=>{if(n in this.ruleBy)return this.ruleBy[n];let d=this.match(n);if(d)return new D.Rule(n,d,this)};return(e in this.classes?this.classes[e].map(n=>i(n)):[i(e)]).filter(n=>n&&n.text)}refresh(e){if(e?.override?this.config=e:this.config=j(T.config,e),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 e=A.instances;this.disconnect(),e.splice(e.indexOf(this),1)}delete(e){let i=this.style?.sheet,n=d=>{let v=this.ruleBy[d];if(!(!v||d in this.classesBy&&this.classesBy[d].some(k=>k in this.countBy))){if(i&&v.natives.length){let k=v.natives[0];for(let x=0;x<i.cssRules.length;x++)if(i.cssRules[x]===k.cssRule){for(let C=0;C<v.natives.length;C++)i.deleteRule(x);break}}this.rules.splice(this.rules.indexOf(v),1),delete this.ruleBy[d],v.config.delete&&v.config.delete.call(v,d)}};if(e in this.classes){for(let d of this.classes[e])d in this.countBy||n(d);delete this.ruleBy[e]}else n(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 n,d=Object.keys(this.keyframes).length,v=this.rules.length-1,{media:k,order:x,priority:y,hasWhere:C,className:B}=i,M=(f,l,R,m)=>{let o=d?1:0,u;l&&(o=f.findIndex(l)),R&&(u=f.findIndex(R)),o===-1&&(o=f.length),(u===void 0||u===-1)&&(u=f.length);let t=f.slice(o,u);for(let r=0;r<t.length;r++){let c=t[r];if(!(c.priority===-1||m&&m(c))&&(c.priority<y||c.priority===y&&(C&&!c.hasWhere||c.order>=x)))return o+r}return o+t.length};if(k){let f=this.rules.findIndex(l=>l.media);if(f!==-1){let l=k.features["max-width"],R=k.features["min-width"];if(l&&R){let m=l.value-R.value;for(let o=v;o>=f;o--){n=o;let u=this.rules[o],t=u.media,r=t.features["max-width"],c=t.features["min-width"];if(!r||!c){n++;break}let s=r.value-c.value;if(s===m){if(C!==u.hasWhere)continue;if(y!==-1){let a=[this.rules[o]];for(let h=o-1;h>=f;h--){let p=this.rules[h];if(p.hasWhere!==C)break;let w=p.media,b=w.features["max-width"],E=w.features["min-width"];if(!b||!E||b.value-E.value!==s)break;a.unshift(this.rules[h])}n=M(this.rules,h=>h.media&&h.priority!==-1&&h.media.features["min-width"]&&h.media.features["max-width"])}break}else if(s>m)break}}else if(R)for(let m=f;m<=v;m++){n=m;let o=this.rules[m],u=o.media,t=u.features["max-width"],r=u.features["min-width"];if(t){if(r)break;continue}let c=r?.value;if(c===R.value){if(!C&&o.hasWhere){n++;continue}if(y!==-1)n=M(this.rules,s=>s.media,s=>s.media&&s.priority!==-1&&s.media.features["min-width"]&&s.media.features["max-width"],s=>!s.media.features["min-width"]&&!s.media.features["max-width"]);else for(let s=m;s<=v;s++){let a=this.rules[s],h=a.media,p=h.features["min-width"];if(!h.features["max-width"]){if(a.hasWhere!==C||p.value!==c||a.order>=x)break;n=s+1}}break}else{if(c>R.value)break;n++}}else if(l)for(let m=v;m>=f;m--){n=m;let o=this.rules[m],u=o.media,t=u.features["max-width"];if(u.features["min-width"])continue;let c=t?.value;if(!c||c>l.value){n++;break}else if(c===l.value){if(C&&!o.hasWhere)continue;if(y!==-1)n=M(this.rules,s=>s.media,s=>s.media&&s.priority!==-1&&s.media.features["min-width"]&&s.media.features["max-width"],s=>!s.media.features["min-width"]&&!s.media.features["max-width"]);else{let s=[this.rules[m]];for(let a=m-1;a>=f;a--){let h=this.rules[a],p=h.media,w=p.features["min-width"],b=p.features["max-width"];if(!w&&(!b||b.value!==c||h.hasWhere!==C))break;s.unshift(h)}for(let a=0;a<s.length;a++){let h=s[a];if(!h.media.features["min-width"]){if(h.order>=x)break;n=m-s.length+2+a}}}break}}}if(n===void 0)if(f===-1)n=v+1;else if(y!==-1)n=f+M(this.rules.slice(f),void 0,l=>l.media.features["max-width"]||l.media.features["min-width"]);else if(C){let l=f;for(;l<this.rules.length;l++){let R=this.rules[l];if(R.priority!==-1||!R.hasWhere||R.order>=x){n=l;break}}n===void 0&&(n=l)}else for(let l=f;l<=v;l++){n=l;let R=this.rules[l],m=R.media;if(R.priority!==-1||m.features["max-width"]||m.features["min-width"])break;if(R.hasWhere)n++;else if(R.order>=x)break}}else if(y===-1){let f=d?1:0;if(C)for(;f<this.rules.length;f++){let l=this.rules[f];if(!l.hasWhere||l.media||l.priority!==-1||l.order>=x){n=f;break}}else for(;f<this.rules.length;f++){let l=this.rules[f];if(l.media||!l.hasWhere&&(l.order>=x||l.priority!==-1)){n=f;break}}n===void 0&&(n=f)}else n=M(this.rules,void 0,f=>f.media);if(this.rules.splice(n,0,i),this.ruleBy[B]=i,this.style){let f=this.style.sheet,l=0,R=m=>{let o=this.rules[m];if(o){if(!o.natives.length)return R(m-1);let u=o.natives[o.natives.length-1].cssRule;for(let t=0;t<f.cssRules.length;t++)if(f.cssRules[t]===u){l=t+1;break}}};R(n-1);for(let m=0;m<i.natives.length;)try{let o=i.natives[m];f.insertRule(o.text,l),o.cssRule=f.cssRules[l++],m++}catch(o){console.error(o),i.natives.splice(m,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(e=>e.text).join("")}},W=A;O(W,"root"),O(W,"config",T.config),O(W,"instances",[]),O(W,"refresh",e=>{for(let i of A.instances)i.refresh(e)});N&&(window.MasterCSS=W);0&&(module.exports={MasterCSS});
|
|
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:p,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)),p&&(this.mediaQueries=a(p,!1));let d=i?a(i,!1):{},g=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(g).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(g))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:root.host;let u=n?document.head:t,v=n?document.styleSheets:t.styleSheets;for(let R of v){let{ownerNode:p}=R;if(p.id==="master"){this.style=p;break}}if(this.style)for(let R=0;R<this.style.sheet.cssRules.length;R++){let p=this.style.sheet.cssRules[R];if(p.constructor.name==="CSSKeyframesRule")continue;let C=a=>{if(a.selectorText){let g=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<g.length;h++){let f=g[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 g=C(a.cssRules[d]);if(g)return g}},B=C(p);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(p=>{p in this.countBy?this.countBy[p]++:(this.countBy[p]=1,this.insert(p))})};E(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(R=>E(R.classList)),this.observer=new MutationObserver(R=>{let p={},C=[],B=[],a=[],d=(o,r)=>{r?o.classList.forEach(h):o.classList.forEach(g);let e=o.children;for(let s=0;s<e.length;s++){let l=e[s];l.classList&&(B.push(l),d(l,r))}},g=o=>{o in p?p[o]++:p[o]=1},h=o=>{o in p?p[o]--:o in this.countBy&&(p[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(p).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)||g(c)});for(let c of l)s.contains(c)||h(c)}}for(let o in p){let r=p[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:p,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,g;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(p===-1?(d=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),g=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),g=v),d!==-1){let e=f.value-o.value,s=g,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)g=s-1;else if(b===e)d=s;else break}}if(d!==-1){let e=f.value-o.value;for(let s=g;s>=d;s--){let{"max-width":l,"min-width":c}=this.rules[s].media.features,m=l.value-c.value;if(m<e)g=s-1;else if(m>e){d=s+1;break}}}}else if(o){if(p===-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"]),g=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),g=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=g;e>=d;e--){let s=this.rules[e].media.features["min-width"].value;if(s>o.value)g=e-1;else if(s<o.value){d=e+1;break}}}else if(p===-1?(d=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),g=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),g=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=g;e>=d;e--){let s=this.rules[e].media.features["max-width"].value;if(s<f.value)g=e-1;else if(s>f.value){d=e+1;break}}}else p===-1?(d=h,g=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),g=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=u?1:0;p===-1?(d=h,g=a(h,f=>f.media||f.priority!==-1)):(d=a(h,f=>f.media,f=>f.priority!==-1),g=a(h,f=>f.media))}if(n===void 0)if(d===-1)n=g+1;else{if(p===-1)for(let h=d;h<=g;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<=g;h++){let f=this.rules[h];if(!(!C&&f.hasWhere)){if(C&&!f.hasWhere){n=h;break}if(f.priority<p){n=h;break}else if(f.priority===p){if(f.order>=R){n=h;break}}else n=h+1}}n===void 0&&(n=g+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 +1 @@
|
|
|
1
|
-
var p=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var n=(e,t)=>{for(var s in t)p(e,s,{get:t[s],enumerable:!0})},g=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of c(t))!l.call(e,a)&&a!==s&&p(e,a,{get:()=>t[a],enumerable:!(o=r(t,a))||o.enumerable});return e};var i=e=>g(p({},"__esModule",{value:!0}),e);var
|
|
1
|
+
var p=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var n=(e,t)=>{for(var s in t)p(e,s,{get:t[s],enumerable:!0})},g=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of c(t))!l.call(e,a)&&a!==s&&p(e,a,{get:()=>t[a],enumerable:!(o=r(t,a))||o.enumerable});return e};var i=e=>g(p({},"__esModule",{value:!0}),e);var d={};n(d,{extractClassesFromHTML:()=>x});module.exports=i(d);var m=/&(amp|#38|lt|#60|gt|#62|apos|#39|#x27|quot|#34);/g,u={amp:"&","#38":"&",lt:"<","#60":"<",gt:">","#62":">",apos:"'","#39":"'","#x27":"'",quot:'"',"#34":'"'};function x(e){if(e)return e.split(/\sclass="([^"]*)"/gm).filter((t,s)=>s%2===1).map(t=>t.split(" ")).flat().map(t=>t.replace(m,(s,o)=>u[o]))}0&&(module.exports={extractClassesFromHTML});
|
package/dist/cjs/rule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Q=Object.defineProperty;var
|
|
1
|
+
var Q=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var de=Object.prototype.hasOwnProperty;var pe=(u,i)=>{for(var s in i)Q(u,s,{get:i[s],enumerable:!0})},me=(u,i,s,S)=>{if(i&&typeof i=="object"||typeof i=="function")for(let v of ge(i))!de.call(u,v)&&v!==s&&Q(u,v,{get:()=>i[v],enumerable:!(S=he(i,v))||S.enumerable});return u};var xe=u=>me(Q({},"__esModule",{value:!0}),u);var Se={};pe(Se,{Rule:()=>$});module.exports=xe(Se);var q=require("./constants/start-symbol"),fe=require("./utils/css-escape");function re(u){let i=typeof Buffer<"u"?Buffer:null;return!!(i&&u instanceof i||u instanceof Date||u instanceof RegExp)}function oe(u){if(typeof Buffer<"u"&&Buffer&&u instanceof Buffer){let i=Buffer.alloc(u.length);return u.copy(i),i}else{if(u instanceof Date)return new Date(u.getTime());if(u instanceof RegExp)return new RegExp(u);throw new Error("Unexpected situation")}}function le(u){let i=[];return u.forEach(function(s,S){typeof s=="object"&&s!==null?Array.isArray(s)?i[S]=le(s):re(s)?i[S]=oe(s):i[S]=A({},s):i[S]=s}),i}function se(u,i){return i==="__proto__"?void 0:u[i]}function A(...u){let i={},s,S;return u.forEach(function(v){typeof v!="object"||v===null||Array.isArray(v)||Object.keys(v).forEach(function(k){if(S=se(i,k),s=se(v,k),s!==i)if(typeof s!="object"||s===null){i[k]=s;return}else if(Array.isArray(s)){i[k]=le(s);return}else if(re(s)){i[k]=oe(s);return}else if(typeof S!="object"||S===null||Array.isArray(S)){i[k]=A({},s);return}else{i[k]=A(S,s);return}})}),i}var ye={unit:"",order:0,separators:[","]},$=class{constructor(i,s={},S){this.className=i;this.meta=s;this.css=S;this.config=A(ye,s.config);let{unit:v,order:k,colored:C,native:N,analyze:F,transform:Y,declare:Z,create:H}=this.config,{scope:J,important:ce,functions:ae}=S.config,{themeNames:K,colorNames:X,colorThemesMap:G,selectors:W,breakpoints:ee,mediaQueries:z,themeAffectedClassesBy:ue,globalValues:D}=S,te=ue[i];H&&H.call(this,i);let _,ie,I,B,w;if(s.origin==="semantics"){let[g,c]=s.value;B=i.slice(g.length),_=c}else{let g;if(F)[g,I]=F.call(this,i);else if(s.origin==="match"){let r=i.indexOf(":");this.prefix=i.slice(0,r+1),this.prefix.includes("(")?(this.prefix=void 0,g=i):g=i.slice(r+1)}else s.origin==="symbol"&&(this.symbol=i[0],g=i.slice(1));w=[];let c=this,a=this.values,m=[","];this.config.separators.length&&m.push(...this.config.separators);let n="",t=0;(function r(e,f,l,o=void 0,h=[],b=[],d){let T=o===void 0,x,E=p=>p==="'"||p==='"',V=()=>x=n.length,M=()=>{if(n){let p=n,y=T?p:n.slice(x);if(n="",j="",a&&y in a&&!h.includes(y)){let R=t;t=0,r(a[y].toString(),f,void 0,o,[...h,y],b,d),t=R,T||(n=n.slice(0,x)+n)}else if(D&&y in D&&!b.includes(y)){let R=t;t=0,r(D[y].toString(),f,void 0,o,h,[...b,y],d),t=R,T||(n=n.slice(0,x)+n)}else if(T){let R=!d&&c.analyzeUnitValue(y,f);w.push({value:R?.value??y,unit:R?.unit})}else{let R=!d&&c.analyzeUnitValue(y,f);n=R?p.slice(0,x)+R.value+R.unit:p}V()}},O=E(l);V();let j="";for(;t<e.length;t++){let p=e[t];if(p===l){if(O){n+=p;let y=0;for(let R=n.length-2;n[R]==="\\";R--)y++;if(y%2)continue}else M(),n+=p;return}else if(!O&&p in q.START_SYMBOL){let y=p==="("&&j&&ae?.[j];y?.name&&(n=n.slice(0,n.length-j.length)+y.name,j=y.name),n+=p,t++;let R=q.START_SYMBOL[p];r(e,y?.unit??f,R,j||o||"",h,b,d||!!y?.transform),y?.transform&&(n=n.slice(0,x+j.length+1)+y.transform.call(c,n.slice(x+j.length+1,-1))+n.slice(-1)),T&&(E(R)?(w.push(n),n=""):M()),j=""}else if((p==="|"||p===" ")&&l!=="}"&&(!O||o==="path"))M(),T||(n+=" ",x++);else{if(!O){if(p==="."){if(isNaN(+e[t+1]))break;e[t-1]==="-"&&(n+="0")}else if(m.includes(p)){M(),T?w.push(p):(n+=p,x++);continue}else if(T&&(p==="#"&&(n||w.length&&e[t-1]!=="|"&&w[t-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(p)))break;j+=p}n+=p}}o===void 0&&M()})(g,v),B=g.slice(t)}this.order=typeof k=="function"?k.call(this,this.prefix):k,B[0]==="!"&&(this.important=!0,B=B.slice(1));let ne=g=>{let c=g.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((t,r)=>r%3?t:t.replace(/_/g," ")).join(""),a=[],m="",n=0;for(let t=0;t<c.length;t++){let r=c[t];if(r==="\\"){m+=r+c[++t];continue}!n&&r===","?(a.push(m),m=""):(m+=r,n&&r===")"?n--:r==="("&&n++)}return m&&a.push(m),a};this.prefixSelectors=I?ne(I):[""];let P=B.split("@"),U=P[0];if(U){this.vendorSuffixSelectors={};let g=(t,r,e,f)=>{for(let[l,o]of r)if(l.test(t)){for(let h of o)g(t.replace(l,h),r,e,!0);return}f&&e.push(t)},c=[];""in W?g(U,W[""],c,!0):c.push(U);let a={};for(let[t,r]of Object.entries(W)){if(!t)continue;let e=[];for(let f of c)g(f,r,e,!1);e.length&&(a[t]=e)}let m=(t,r)=>{let e=r.reduce((f,l)=>(f.push(...ne(l)),f),[]);t in this.vendorSuffixSelectors?this.vendorSuffixSelectors[t].push(...e):this.vendorSuffixSelectors[t]=e},n=Object.keys(a);if(n.length)for(let t of n)m(t,a[t]);else m("",c);for(let t of Object.values(this.vendorSuffixSelectors))for(let r of t){this.hasWhere!==!1&&(this.hasWhere=r.includes(":where("));let e=[":disabled",":active",":focus",":hover"];for(let f=0;f<e.length;f++)if(r.includes(e[f])){(this.priority===-1||this.priority>f)&&(this.priority=f);break}}}else this.vendorSuffixSelectors={"":[""]};for(let g=1;g<P.length;g++){let c=P[g];if(c)if(K.includes(c))this.theme=c;else if(c==="rtl"||c==="ltr")this.direction=c;else{let a,m,n=c.indexOf("_");if(n!==-1)a=c.slice(0,n),m=c.slice(n);else{let t=c.indexOf("(");t!==-1&&(a=c.slice(0,t),m=c.slice(t))}if(!a){a="media";let t=[];this.media={token:c,features:{}};let r=c.split("&");for(let e of r)if(e==="all"||e==="print"||e==="screen"||e==="speech")this.media.type=e;else if(e==="\u{1F5A8}")this.media.type="print";else if(e==="landscape"||e==="portrait")t.push("(orientation:"+e+")");else if(e==="motion"||e==="reduced-motion")t.push("(prefers-reduced-motion:"+(e==="motion"?"no-preference":"reduce")+")");else if(z&&e in z)t.push(z[e]);else{let f={token:e},l="",o="",h=0;e.startsWith("<=")?(o="<=",l="max-width"):e.startsWith(">=")||ee[e]?(o=">=",l="min-width"):e.startsWith(">")?(o=">",l="min-width",h=.02):e.startsWith("<")&&(o="<",l="max-width",h=-.02);let b=o?e.replace(o,""):e,d=ee[b];switch(l){case"max-width":case"min-width":d?Object.assign(f,this.analyzeUnitValue(d.toString(),"px")):Object.assign(f,this.analyzeUnitValue(b,"px")),f.unit==="px"&&(f.value+=h),this.media.features[l]=f,t.push("("+l+":"+(f.value+f.unit)+")");break}}m="",this.media.type&&(m=this.media.type),t.length&&(m+=(m?" and ":"")+t.join(" and "))}m&&(this.at[a]=(a in this.at?this.at[a]+" and ":"")+m.replace(/_/g," "))}}let L=(g,c)=>{let a,m=(r,e,f)=>{let l="";this.direction&&(l+="[dir="+this.direction+"] ");let o=this.prefixSelectors.map(d=>d+l),h=(d,T)=>o.map(x=>(d?"."+d+" ":"")+(J?J+" ":"")+x).reduce((x,E)=>(x.push(f.reduce((V,M)=>(V.push(E+"."+(0,fe.cssEscape)(T)+M),V),[]).join(",")),x),[]).join(","),b=h(e,i)+(te?Object.entries(te).filter(([d])=>this.theme||!C||!e||!d||d===e).map(([d,T])=>T.reduce((x,E)=>x+","+h(this.theme??((C||ie)&&e||d),E),"")).join(""):"")+"{"+r+"}";for(let d of Object.keys(this.at).sort((T,x)=>x==="supports"?-1:1))b="@"+d+" "+this.at[d]+"{"+b+"}";return b},n=[];if(w){let r=[this.theme??g,""],e,f=!1;for(let l of w)if(typeof l=="string")n.push(l);else{let o=l.value;if(l.unit)o+=l.unit;else if(C&&G&&X){let h=!1;o=o.replace(new RegExp(`(^|,| |\\()((?:${X.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(b,d,T,x)=>{let E=G[T];if(E){let V,M;for(let O of r)if(V=E[O]){M=O;break}if(V){h=!c||M===g,e||(e=h);let O=V;if(x){let j=x.endsWith("%")?parseFloat(x)/100:+x;j=isNaN(j)?1:Math.min(Math.max(j,0),1),O+=Math.round(j*255).toString(16).toUpperCase().padStart(2,"0")}return d+O}else f=!0}return b})}n.push(o)}if(c&&(f||(e===void 0?g:!e)))return;if(a=n.reduce((l,o,h)=>l+o+(o===","||w[h+1]===","||h===w.length-1?"":" "),""),Y&&(a=Y.call(this,a,this.css.config)),C&&a==="current"&&(a="currentColor"),Z){let l,o;if(w.length===1){let h=w[0];typeof h=="object"&&(l=h.value,o=h.unit)}_=Z.call(this,o?l:a,o||"")}else _={[N]:a}}let t={};for(let r in _){let e=(o,h)=>{let b=h+((this.important||ce)&&!h.endsWith("!important")?"!important":"");o in t?t[o].push(b):t[o]=[b]},f=r+":",l=_[r];if(typeof l=="object"){ie=!0;for(let o in l)e(o,f+l[o])}else e(g,f+l.toString())}for(let r of Object.values(this.vendorSuffixSelectors))for(let e in t)this.natives.push({text:m(t[e].join(";"),e,r),theme:e})};if(this.theme)L(this.theme,!1);else if(C)for(let g of K)L(g,!0);else L("",!1)}at={};priority=-1;natives=[];keyframeNames;config;get values(){return this.css.values[this.config.id]}get text(){return this.natives.map(i=>i.text).join("")}resolveValue(i,s){return Number.isNaN(+i)?i:i/(s==="rem"||s==="em"?this.css.config.rootSize:1)+s}analyzeUnitValue(i,s){let S=s??this.config.unit;if(S){let v="",k=i.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(k)if(i.includes("/")){let[C,N]=i.split("/");return{value:+C/+N*100+"%",unit:v}}else{let C=+k[1];return v=k[3]||"",v||((S==="rem"||S==="em")&&(C=C/this.css.config.rootSize),v=S||""),{value:C,unit:v}}}}};0&&(module.exports={Rule});
|
package/dist/css.d.ts
CHANGED
|
@@ -66,11 +66,13 @@ export declare class MasterCSS {
|
|
|
66
66
|
* 4. normal selectors
|
|
67
67
|
* 5. media where
|
|
68
68
|
* 6. media normal
|
|
69
|
-
* 7. media selectors
|
|
70
|
-
* 8. media
|
|
71
|
-
* 9. media width
|
|
72
|
-
* 10. media width
|
|
73
|
-
|
|
69
|
+
* 7. media where selectors
|
|
70
|
+
* 8. media selectors
|
|
71
|
+
* 9. media width where
|
|
72
|
+
* 10. media width
|
|
73
|
+
* 11. media width where selectors
|
|
74
|
+
* 12. media width selectors
|
|
75
|
+
*/
|
|
74
76
|
insertRules(rules: Rule[]): void;
|
|
75
77
|
get text(): string;
|
|
76
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var c={$:{name:"var",transform(r){return"--"+r}},calc:{transform(r){let o=e=>e==="+"||e==="-"||e==="*"||e==="/",s="",n,i="",f=!1,u=!1,a=(e,t="",g="")=>{if(n===2&&!u){let l=this.analyzeUnitValue(i,c.calc.unit);l&&(i=l.value+l.unit)}s+=i+t+e+g,n=null,u=!1,i=""};for(let e=0;e<r.length;e++){let t=r[e];if(t==="("||t===")")f=t===")",a(t);else if(t===",")a(t,""," ");else{switch(n){case 1:break;case 2:if(o(t)){a(t," "," ");continue}else/[0-9]/.test(t)||(u=!0);break;default:f&&(s+=" "),isNaN(+t)?o(t)||(n=1):n=2;break}n?i+=t:s+=t}}return a(""),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:""}};export{c as functions};
|
|
1
|
+
var c={$:{name:"var",transform(r){return"--"+r}},calc:{transform(r){let o=e=>e==="+"||e==="-"||e==="*"||e==="/",s="",n,i="",f=!1,u=!1,a=(e,t="",g="")=>{if(n===2&&!u){let l=this.analyzeUnitValue(i,c.calc.unit);l&&(i=l.value+l.unit)}s+=i+t+e+g,n=null,u=!1,i=""};for(let e=0;e<r.length;e++){let t=r[e];if(t==="("||t===")")f=t===")",a(t);else if(t===",")a(t,""," ");else{switch(n){case 1:break;case 2:if(o(t)){a(t," "," ");continue}else/[0-9]/.test(t)||(u=!0);break;default:f&&(s+=" "),isNaN(+t)?o(t)||(n=1):n=2;break}n?i+=t:s+=t}}return a(""),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:""}};export{c as functions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{START_SYMBOL as g}from"../constants/start-symbol.mjs";import{cssEscape as x}from"../utils/css-escape.mjs";var y={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},i=(o,r)=>{let a=r.indexOf(":");if(a!==-1){o in t||(t[o]={});let s=t[o],h=r.slice(0,a);h in s||(s[h]=r.slice(a+1))}},u=o=>{let r=(a,s)=>{let h=s.slice(x(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let f of h)i(a,f)};if(this.theme){let a=o.natives.find(s=>s.theme===this.theme)??o.natives.find(s=>!s.theme);a&&r(this.theme,a.text)}else for(let a of o.natives)r(a.theme,a.text)},d=[],n="",c=()=>{n&&(d.push(n.replace(/ /g,"")),n="")},m=1;(function o(r){for(;m<e.length;m++){let a=e[m];if(!r){if(a===";"){c();continue}if(a==="}")break}if(n+=a,r===a){if(r==="'"||r==='"'){let s=0;for(let h=n.length-2;n[h]==="\\";h--)s++;if(s%2)continue}break}else a in g&&r!=="'"&&r!=='"'&&(m++,o(g[a]))}})(void 0),c();for(let o of d){let r=this.css.create(o);if(Array.isArray(r))for(let a of r)u(a);else r?u(r):i(this.theme??"",o)}let l={};for(let o in t)for(let[r,a]of Object.entries(t[o]))r in l?l[r][o]=a:l[r]={[o]:a};return l}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},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(e){switch(e){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(e,t){return{"margin-left":e+t,"margin-right":e+t}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"margin-top":e+t,"margin-bottom":e+t}}},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(e,t){return{"padding-left":e+t,"padding-right":e+t}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"padding-top":e+t,"padding-bottom":e+t}}},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(e){return[e]},declare(e){let[t,i]=e.split(" x ");return{width:t,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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"min-width":t,"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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"max-width":t,"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(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},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},overflowY:{native:!0},overflow:{native:!0,order:-1},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(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},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(e){return v.call(this,e)},delete(e){return b.call(this,e)},insert(){return p.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return v.call(this,e)},delete(e){return b.call(this,e)},insert(){return p.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(e,t){return{"border-left-color":e+t,"border-right-color":e+t}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-top-color":e+t,"border-bottom-color":e+t}}},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(e,t){return{"border-top-left-radius":e+t,"border-top-right-radius":e+t}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(e,t){return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t}}},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(e,t){return{"border-left-style":e+t,"border-right-style":e+t}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-top-style":e+t,"border-bottom-style":e+t}}},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(e,t){return{"border-left-width":e+t,"border-right-width":e+t}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-top-width":e+t,"border-bottom-width":e+t}}},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(e){return{"border-left":e,"border-right":e}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-top":e,"border-bottom":e}}},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(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},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)(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"}},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(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},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(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",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(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},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(e,t){return{"scroll-margin-left":e+t,"scroll-margin-right":e+t}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t}}},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(e,t){return{"scroll-padding-left":e+t,"scroll-padding-right":e+t}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t}}},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(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},C=y;function v(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function b(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let i=this.css.keyframes[t];if(!--i.count){let u=e.natives.indexOf(i.native);this.css.style.sheet.deleteRule(u),e.natives.splice(u,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function p(){if(this.keyframeNames){let{config:e,keyframes:t,style:i,rules:u}=this.css,d=i?.sheet;for(let n of this.keyframeNames)if(n in t)t[n].count++;else{let c={text:`@keyframes ${n}{`+Object.entries(e.keyframes[n]).map(([l,o])=>`${l}{${Object.entries(o).map(([r,a])=>r+":"+a).join(";")}}`).join("")+"}",theme:""},m;if(Object.keys(t).length?(m=u[0]).natives.push(c):u.splice(0,0,m={natives:[c],get text(){return this.natives.map(l=>l.text).join("")}}),d){let l;for(let o=0;o<d.cssRules.length;o++){let r=d.cssRules[o];if(r.constructor.name!=="CSSKeyframesRule")break;if(r.name===n){l=r;break}}if(l)c.cssRule=l;else{let o=m.natives.length-1;d.insertRule(c.text,o),c.cssRule=d.cssRules[o]}}t[n]={native:c,count:1}}}}export{C as rules};
|
|
1
|
+
import{START_SYMBOL as g}from"../constants/start-symbol.mjs";import{cssEscape as x}from"../utils/css-escape.mjs";var y={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},i=(o,r)=>{let a=r.indexOf(":");if(a!==-1){o in t||(t[o]={});let s=t[o],h=r.slice(0,a);h in s||(s[h]=r.slice(a+1))}},u=o=>{let r=(a,s)=>{let h=s.slice(x(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let f of h)i(a,f)};if(this.theme){let a=o.natives.find(s=>s.theme===this.theme)??o.natives.find(s=>!s.theme);a&&r(this.theme,a.text)}else for(let a of o.natives)r(a.theme,a.text)},d=[],n="",c=()=>{n&&(d.push(n.replace(/ /g,"")),n="")},m=1;(function o(r){for(;m<e.length;m++){let a=e[m];if(!r){if(a===";"){c();continue}if(a==="}")break}if(n+=a,r===a){if(r==="'"||r==='"'){let s=0;for(let h=n.length-2;n[h]==="\\";h--)s++;if(s%2)continue}break}else a in g&&r!=="'"&&r!=='"'&&(m++,o(g[a]))}})(void 0),c();for(let o of d){let r=this.css.create(o);if(Array.isArray(r))for(let a of r)u(a);else r?u(r):i(this.theme??"",o)}let l={};for(let o in t)for(let[r,a]of Object.entries(t[o]))r in l?l[r][o]=a:l[r]={[o]:a};return l}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},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(e){switch(e){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(e,t){return{"margin-left":e+t,"margin-right":e+t}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"margin-top":e+t,"margin-bottom":e+t}}},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(e,t){return{"padding-left":e+t,"padding-right":e+t}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"padding-top":e+t,"padding-bottom":e+t}}},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(e){return[e]},declare(e){let[t,i]=e.split(" x ");return{width:t,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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"min-width":t,"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(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"max-width":t,"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(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},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},overflowY:{native:!0},overflow:{native:!0,order:-1},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(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},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(e){return v.call(this,e)},delete(e){return b.call(this,e)},insert(){return p.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return v.call(this,e)},delete(e){return b.call(this,e)},insert(){return p.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(e,t){return{"border-left-color":e+t,"border-right-color":e+t}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-top-color":e+t,"border-bottom-color":e+t}}},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(e,t){return{"border-top-left-radius":e+t,"border-top-right-radius":e+t}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(e,t){return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t}}},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(e,t){return{"border-left-style":e+t,"border-right-style":e+t}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-top-style":e+t,"border-bottom-style":e+t}}},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(e,t){return{"border-left-width":e+t,"border-right-width":e+t}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-top-width":e+t,"border-bottom-width":e+t}}},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(e){return{"border-left":e,"border-right":e}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-top":e,"border-bottom":e}}},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(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},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)(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"}},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(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},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(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",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(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},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(e,t){return{"scroll-margin-left":e+t,"scroll-margin-right":e+t}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t}}},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(e,t){return{"scroll-padding-left":e+t,"scroll-padding-right":e+t}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t}}},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(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},C=y;function v(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function b(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let i=this.css.keyframes[t];if(!--i.count){let u=e.natives.indexOf(i.native);this.css.style.sheet.deleteRule(u),e.natives.splice(u,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function p(){if(this.keyframeNames){let{config:e,keyframes:t,style:i,rules:u}=this.css,d=i?.sheet;for(let n of this.keyframeNames)if(n in t)t[n].count++;else{let c={text:`@keyframes ${n}{`+Object.entries(e.keyframes[n]).map(([l,o])=>`${l}{${Object.entries(o).map(([r,a])=>r+":"+a).join(";")}}`).join("")+"}",theme:""},m;if(Object.keys(t).length?(m=u[0]).natives.push(c):u.splice(0,0,m={natives:[c],get text(){return this.natives.map(l=>l.text).join("")}}),d){let l;for(let o=0;o<d.cssRules.length;o++){let r=d.cssRules[o];if(r.constructor.name!=="CSSKeyframesRule")break;if(r.name===n){l=r;break}}if(l)c.cssRule=l;else{let o=m.natives.length-1;d.insertRule(c.text,o),c.cssRule=d.cssRules[o]}}t[n]={native:c,count:1}}}}export{C as rules};
|
package/dist/esm/css.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var D=Object.defineProperty;var H=(M,t,n)=>t in M?D(M,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):M[t]=n;var O=(M,t,n)=>(H(M,typeof t!="symbol"?t+"":t,n),n);function L(M){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&M instanceof t||M instanceof Date||M instanceof RegExp)}function F(M){if(typeof Buffer<"u"&&Buffer&&M instanceof Buffer){let t=Buffer.alloc(M.length);return M.copy(t),t}else{if(M instanceof Date)return new Date(M.getTime());if(M instanceof RegExp)return new RegExp(M);throw new Error("Unexpected situation")}}function I(M){let t=[];return M.forEach(function(n,o){typeof n=="object"&&n!==null?Array.isArray(n)?t[o]=I(n):L(n)?t[o]=F(n):t[o]=W({},n):t[o]=n}),t}function N(M,t){return t==="__proto__"?void 0:M[t]}function W(...M){let t={},n,o;return M.forEach(function(m){typeof m!="object"||m===null||Array.isArray(m)||Object.keys(m).forEach(function(R){if(o=N(t,R),n=N(m,R),n!==t)if(typeof n!="object"||n===null){t[R]=n;return}else if(Array.isArray(n)){t[R]=I(n);return}else if(L(n)){t[R]=F(n);return}else if(typeof o!="object"||o===null||Array.isArray(o)){t[R]=W({},n);return}else{t[R]=W(o,n);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 S=typeof window<"u",$=()=>{let M=document.createElement("style");return M.id="master",M},A=class{constructor(t=T){this.config=t;t?.override||(this.config=W(T,t),"keyframes"in t&&Object.assign(this.config.keyframes,t.keyframes)),this.cache(),S&&this.config.observe&&this.observe(document),A.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:n,selectors:o,themes:m,colors:R,values:k,breakpoints:v,mediaQueries:g,rules:C}=this.config;function B(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function x(e,i,c="",s={}){let a=p=>p?(c?c+"-":"")+p:c,h=Object.entries(e),y=[],w=[];for(let p of h){let E=p[1];(typeof E=="object"&&!Array.isArray(E)?y:w).push(p)}for(let[p,E]of y)x(E,i,a(p),s);if(i&&c)w.length&&(s[c]=w.reduce((p,[E,V])=>(p[E]=V,p),{}));else for(let[p,E]of w)s[a(p)]=E;return s}if(t)for(let[e,i]of Object.entries(x(t,!0)))this.semantics.push([new RegExp("^"+B(e)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[e,i]]);if(o)for(let[e,i]of Object.entries(x(o,!1))){let c=new RegExp(B(e)+"(?![a-z-])");for(let s of Array.isArray(i)?i:[i]){let a=s.match(/^::-[a-z]+-/m)?.[0]??"",h=this.selectors[a];h||(h=this.selectors[a]=[]);let y=h.find(([w])=>w===c);y||(y=[c,[]],h.push(y)),y[1].push(s)}}k&&(this.globalValues=x(k,!1)),v&&(this.breakpoints=x(v,!1)),g&&(this.mediaQueries=x(g,!1));let f=n?x(n,!1):{},l=m&&!Array.isArray(m)?Object.entries(m).filter(([,{classes:e}])=>e).reduce((e,[i,{classes:c}])=>(e[i]=x(c,!1),e),{}):{},b=[...Object.keys(f),...Object.entries(l).flatMap(([e,i])=>Object.keys(i))],d=e=>{if(e in this.classes)return;let i=this.classes[e]=[],c=(s,a)=>{if(!a)return;let h=Array.isArray(a)?a:a.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let y of h){let w=p=>{p in this.themeAffectedClassesBy?s in this.themeAffectedClassesBy[p]?this.themeAffectedClassesBy[p][s].push(e):this.themeAffectedClassesBy[p][s]=[e]:this.themeAffectedClassesBy[p]={[s]:[e]},i.includes(p)||i.push(p)};if(b.includes(y)){d(y);for(let p of this.classes[y])w(p)}else w(y)}};c("",f?.[e]);for(let[s,a]of Object.entries(l))c(s,a?.[e])};for(let e of b)d(e);for(let e in this.themeAffectedClassesBy){let i=this.classesBy[e]=[];for(let c of Object.values(this.themeAffectedClassesBy[e]))for(let s of c)i.includes(s)||i.push(s)}let r=(e,i)=>{if(!i)return;let c=x(i,!0);for(let[s,a]of Object.entries(c)){let h=typeof a=="string"?{"":a}:a;for(let[y,w]of Object.entries(h)){let p=s+(y?"-"+y:"");p in this.colorThemesMap?this.colorThemesMap[p][e]=w:this.colorThemesMap[p]={[e]:w}}}for(let s in i)this.colorNames.includes(s)||this.colorNames.push(s)};if(r("",R),m)if(Array.isArray(m))this.themeNames.push(...m);else for(let e in m){let i=m[e];r(e,i.colors),this.themeNames.push(e)}let u=e=>{for(let[i,c]of Object.entries(this.colorThemesMap))for(let[s,a]of Object.entries(c))a.startsWith("#")||e(i,c,s,a)};if(u((e,i,c,s)=>{let a=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(s);if(a){let h="#"+z(+a[1],+a[2],+a[3]);a[4]&&(h+=Math.round(255*+a[4]).toString(16)),i[c]=h}}),u((e,i,c,s)=>{let[a,h]=s.split("/"),y=this.colorThemesMap[a];if(y){let w=(c?y[c]:void 0)??y[""];i[c]=h?w.slice(0,7)+Math.round(255*+h).toString(16):w}else console.warn(`\`${s}\` doesn't exist in the extended config \`.colors\``),delete i[c],Object.keys(i).length||delete this.colorThemesMap[e]}),C)for(let e in C){let i=C[e],{native:c,values:s,colored:a}=i,h=i.match;if(i.id=e,i.native=c===!0?e.replace(/(?!^)[A-Z]/g,y=>"-"+y).toLowerCase():void 0,s&&(this.values[e]=x(s,!1)),h){let y=Object.keys(this.values[e]??{});h.includes("$values")&&(h=y.length?h.replace(/\$values/,y.join("|")):h.replace(/(?:\|)?\$values/,"")),a&&h.includes("$colors")&&(h=this.colorNames.length?h.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):h.replace(/(?:\|)?\$colors/,"")),this.matches[e]=new RegExp(h)}}}observe(t,n={subtree:!0,childList:!0}){if(this.root!==t){if(S&&t){this.root=t;let o=t===document;o&&(A.root=this),this.host=o?document.documentElement:root.host;let m=o?document.head:t,R=o?document.styleSheets:t.styleSheets;for(let v of R){let{ownerNode:g}=v;if(g.id==="master"){this.style=g;break}}if(this.style)for(let v=0;v<this.style.sheet.cssRules.length;v++){let g=this.style.sheet.cssRules[v];if(g.constructor.name==="CSSKeyframesRule")continue;let C=x=>{if(x.selectorText){let l=x.selectorText.split(", ")[0].split(" ");for(let b=0;b<l.length;b++){let d=l[b];if(d[0]==="."){let r=d.slice(1),u="";for(let e=0;e<r.length;e++){let i=r[e],c=r[e+1];if(i==="\\"){if(e++,c!=="\\"){u+=c;continue}}else if(_.includes(i))break;u+=i}if(!(u in this.ruleBy)&&!(u in this.classes)){let e=this.create(u)[0];if(e)return e}}}}else if(x.cssRules)for(let f=0;f<x.cssRules.length;f++){let l=C(x.cssRules[f]);if(l)return l}},B=C(g);if(B){this.rules.push(B),this.ruleBy[B.className]=B;for(let x=0;x<B.natives.length;x++)B.natives[x].cssRule=this.style.sheet.cssRules[v+x];v+=B.natives.length-1,B.config.insert?.call(B)}}else this.style=$(),m.append(this.style);let k=v=>{v.forEach(g=>{g in this.countBy?this.countBy[g]++:(this.countBy[g]=1,this.insert(g))})};k(this.host.classList),n.subtree&&this.host.querySelectorAll("[class]").forEach(v=>k(v.classList)),this.observer=new MutationObserver(v=>{let g={},C=[],B=[],x=[],f=(r,u)=>{u?r.classList.forEach(b):r.classList.forEach(l);let e=r.children;for(let i=0;i<e.length;i++){let c=e[i];c.classList&&(B.push(c),f(c,u))}},l=r=>{r in g?g[r]++:g[r]=1},b=r=>{r in g?g[r]--:r in this.countBy&&(g[r]=-1)},d=(r,u)=>{for(let e=0;e<r.length;e++){let i=r[e];i.classList&&!B.includes(i)&&!x.includes(i)&&(i.isConnected!==u?(B.push(i),f(i,u)):x.push(i))}};for(let r=0;r<v.length;r++){let u=v[r],{addedNodes:e,removedNodes:i,type:c,target:s}=u;if(c==="attributes"){if(C.find(a=>a.target===s))continue;C.push(u)}else d(e,!1),(!s.isConnected||!B.includes(s))&&d(i,!0)}if(!(!C.length&&!Object.keys(g).length)){for(let{oldValue:r,target:u}of C){let e=B.includes(u),i=u.classList,c=r?r.split(" "):[];if(e){if(u.isConnected)continue;for(let s of c)i.contains(s)||b(s)}else if(u.isConnected){i.forEach(s=>{c.includes(s)||l(s)});for(let s of c)i.contains(s)||b(s)}}for(let r in g){let u=g[r],e=(this.countBy[r]||0)+u;e===0?(delete this.countBy[r],this.delete(r)):(r in this.countBy||this.insert(r),this.countBy[r]=e)}}}),this.observer.observe(t,{...n,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 n=t.cssRules.length-1;n>=0;n--)t.deleteRule(n);this.style?.remove(),this.style=null,this.root=null}match(t){for(let n in this.config.rules){let o=this.config.rules[n],m=this.matches[n],{symbol:R,native:k}=o;if(m&&m.test(t))return{origin:"match",config:o};if(R&&t.startsWith(R))return{origin:"symbol",config:o};if(k&&t.startsWith(k+":"))return{origin:"match",config:o}}for(let n of this.semantics)if(t.match(n[0]))return{origin:"semantics",value:n[1]}}create(t){let n=o=>{if(o in this.ruleBy)return this.ruleBy[o];let m=this.match(o);if(m)return new Q(o,m,this)};return(t in this.classes?this.classes[t].map(o=>n(o)):[n(t)]).filter(o=>o&&o.text)}refresh(t){if(t?.override?this.config=t:this.config=W(T,t),this.cache(),!this.style)return;let n=$();this.style.replaceWith(n),this.style=n,this.rules.length=0,this.ruleBy={};for(let o in this.countBy)this.insert(o)}destroy(){let t=A.instances;this.disconnect(),t.splice(t.indexOf(this),1)}delete(t){let n=this.style?.sheet,o=m=>{let R=this.ruleBy[m];if(!(!R||m in this.classesBy&&this.classesBy[m].some(k=>k in this.countBy))){if(n&&R.natives.length){let k=R.natives[0];for(let v=0;v<n.cssRules.length;v++)if(n.cssRules[v]===k.cssRule){for(let C=0;C<R.natives.length;C++)n.deleteRule(v);break}}this.rules.splice(this.rules.indexOf(R),1),delete this.ruleBy[m],R.config.delete&&R.config.delete.call(R,m)}};if(t in this.classes){for(let m of this.classes[t])m in this.countBy||o(m);delete this.ruleBy[t]}else o(t)}insert(t){let n=this.create(t);return n.length?(this.insertRules(n),!0):!1}insertRules(t){for(let n of t){if(this.ruleBy[n.className])continue;let o,m=Object.keys(this.keyframes).length,R=this.rules.length-1,{media:k,order:v,priority:g,hasWhere:C,className:B}=n,x=(f,l,b,d)=>{let r=m?1:0,u;l&&(r=f.findIndex(l)),b&&(u=f.findIndex(b)),r===-1&&(r=f.length),(u===void 0||u===-1)&&(u=f.length);let e=f.slice(r,u);for(let i=0;i<e.length;i++){let c=e[i];if(!(c.priority===-1||d&&d(c))&&(c.priority<g||c.priority===g&&(C&&!c.hasWhere||c.order>=v)))return r+i}return r+e.length};if(k){let f=this.rules.findIndex(l=>l.media);if(f!==-1){let l=k.features["max-width"],b=k.features["min-width"];if(l&&b){let d=l.value-b.value;for(let r=R;r>=f;r--){o=r;let u=this.rules[r],e=u.media,i=e.features["max-width"],c=e.features["min-width"];if(!i||!c){o++;break}let s=i.value-c.value;if(s===d){if(C!==u.hasWhere)continue;if(g!==-1){let a=[this.rules[r]];for(let h=r-1;h>=f;h--){let y=this.rules[h];if(y.hasWhere!==C)break;let w=y.media,p=w.features["max-width"],E=w.features["min-width"];if(!p||!E||p.value-E.value!==s)break;a.unshift(this.rules[h])}o=x(this.rules,h=>h.media&&h.priority!==-1&&h.media.features["min-width"]&&h.media.features["max-width"])}break}else if(s>d)break}}else if(b)for(let d=f;d<=R;d++){o=d;let r=this.rules[d],u=r.media,e=u.features["max-width"],i=u.features["min-width"];if(e){if(i)break;continue}let c=i?.value;if(c===b.value){if(!C&&r.hasWhere){o++;continue}if(g!==-1)o=x(this.rules,s=>s.media,s=>s.media&&s.priority!==-1&&s.media.features["min-width"]&&s.media.features["max-width"],s=>!s.media.features["min-width"]&&!s.media.features["max-width"]);else for(let s=d;s<=R;s++){let a=this.rules[s],h=a.media,y=h.features["min-width"];if(!h.features["max-width"]){if(a.hasWhere!==C||y.value!==c||a.order>=v)break;o=s+1}}break}else{if(c>b.value)break;o++}}else if(l)for(let d=R;d>=f;d--){o=d;let r=this.rules[d],u=r.media,e=u.features["max-width"];if(u.features["min-width"])continue;let c=e?.value;if(!c||c>l.value){o++;break}else if(c===l.value){if(C&&!r.hasWhere)continue;if(g!==-1)o=x(this.rules,s=>s.media,s=>s.media&&s.priority!==-1&&s.media.features["min-width"]&&s.media.features["max-width"],s=>!s.media.features["min-width"]&&!s.media.features["max-width"]);else{let s=[this.rules[d]];for(let a=d-1;a>=f;a--){let h=this.rules[a],y=h.media,w=y.features["min-width"],p=y.features["max-width"];if(!w&&(!p||p.value!==c||h.hasWhere!==C))break;s.unshift(h)}for(let a=0;a<s.length;a++){let h=s[a];if(!h.media.features["min-width"]){if(h.order>=v)break;o=d-s.length+2+a}}}break}}}if(o===void 0)if(f===-1)o=R+1;else if(g!==-1)o=f+x(this.rules.slice(f),void 0,l=>l.media.features["max-width"]||l.media.features["min-width"]);else if(C){let l=f;for(;l<this.rules.length;l++){let b=this.rules[l];if(b.priority!==-1||!b.hasWhere||b.order>=v){o=l;break}}o===void 0&&(o=l)}else for(let l=f;l<=R;l++){o=l;let b=this.rules[l],d=b.media;if(b.priority!==-1||d.features["max-width"]||d.features["min-width"])break;if(b.hasWhere)o++;else if(b.order>=v)break}}else if(g===-1){let f=m?1:0;if(C)for(;f<this.rules.length;f++){let l=this.rules[f];if(!l.hasWhere||l.media||l.priority!==-1||l.order>=v){o=f;break}}else for(;f<this.rules.length;f++){let l=this.rules[f];if(l.media||!l.hasWhere&&(l.order>=v||l.priority!==-1)){o=f;break}}o===void 0&&(o=f)}else o=x(this.rules,void 0,f=>f.media);if(this.rules.splice(o,0,n),this.ruleBy[B]=n,this.style){let f=this.style.sheet,l=0,b=d=>{let r=this.rules[d];if(r){if(!r.natives.length)return b(d-1);let u=r.natives[r.natives.length-1].cssRule;for(let e=0;e<f.cssRules.length;e++)if(f.cssRules[e]===u){l=e+1;break}}};b(o-1);for(let d=0;d<n.natives.length;)try{let r=n.natives[d];f.insertRule(r.text,l),r.cssRule=f.cssRules[l++],d++}catch(r){console.error(r),n.natives.splice(d,1)}}n.config.insert?.call(n)}}get text(){return this.rules.map(t=>t.text).join("")}},j=A;O(j,"root"),O(j,"config",T),O(j,"instances",[]),O(j,"refresh",t=>{for(let n of A.instances)n.refresh(t)});S&&(window.MasterCSS=j);export{j as MasterCSS};
|
|
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(y){typeof y!="object"||y===null||Array.isArray(y)||Object.keys(y).forEach(function(b){if(n=L(t,b),i=L(y,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:y,colors:b,values:E,breakpoints:R,mediaQueries:g,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)),g&&(this.mediaQueries=a(g,!1));let u=i?a(i,!1):{},m=y&&!Array.isArray(y)?Object.entries(y).filter(([,{classes:e}])=>e).reduce((e,[s,{classes:l}])=>(e[s]=a(l,!1),e),{}):{},h=[...Object.keys(u),...Object.entries(m).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(m))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),y)if(Array.isArray(y))this.themeNames.push(...y);else for(let e in y){let s=y[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:root.host;let y=n?document.head:t,b=n?document.styleSheets:t.styleSheets;for(let R of b){let{ownerNode:g}=R;if(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 m=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<m.length;h++){let f=m[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 m=C(a.cssRules[u]);if(m)return m}},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=F(),y.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=[],u=(o,r)=>{r?o.classList.forEach(h):o.classList.forEach(m);let e=o.children;for(let s=0;s<e.length;s++){let l=e[s];l.classList&&(B.push(l),u(l,r))}},m=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),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(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)||m(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],y=this.matches[i],{symbol:b,native:E}=n;if(y&&y.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 y=this.match(n);if(y)return new Q(n,y,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=y=>{let b=this.ruleBy[y];if(!(!b||y in this.classesBy&&this.classesBy[y].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[y],b.config.delete&&b.config.delete.call(b,y)}};if(t in this.classes){for(let y of this.classes[t])y in this.countBy||n(y);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,y=Object.keys(this.keyframes).length,b=this.rules.length-1,{media:E,order:R,priority:g,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,m;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(g===-1?(u=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),m=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),m=b),u!==-1){let e=f.value-o.value,s=m,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)m=s-1;else if(p===e)u=s;else break}}if(u!==-1){let e=f.value-o.value;for(let s=m;s>=u;s--){let{"max-width":l,"min-width":c}=this.rules[s].media.features,d=l.value-c.value;if(d<e)m=s-1;else if(d>e){u=s+1;break}}}}else if(o){if(g===-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"]),m=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),m=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),u!==-1)for(let e=m;e>=u;e--){let s=this.rules[e].media.features["min-width"].value;if(s>o.value)m=e-1;else if(s<o.value){u=e+1;break}}}else if(g===-1?(u=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),m=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),m=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),u!==-1)for(let e=m;e>=u;e--){let s=this.rules[e].media.features["max-width"].value;if(s<f.value)m=e-1;else if(s>f.value){u=e+1;break}}}else g===-1?(u=h,m=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),m=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=y?1:0;g===-1?(u=h,m=a(h,f=>f.media||f.priority!==-1)):(u=a(h,f=>f.media,f=>f.priority!==-1),m=a(h,f=>f.media))}if(n===void 0)if(u===-1)n=m+1;else{if(g===-1)for(let h=u;h<=m;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<=m;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=m+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 +1 @@
|
|
|
1
|
-
var o=/&(amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g,p={amp:"&","#38":"&",lt:"<","#60":"<",gt:">","#62":">",apos:"'","#39":"'",quot:'"',"#34":'"'};function r(e){if(e)return e.split(/\sclass="([^"]*)"/gm).filter((t,s)=>s%2===1).map(t=>t.split(" ")).flat().map(t=>t.replace(o,(s,a)=>p[a]))}export{r as extractClassesFromHTML};
|
|
1
|
+
var o=/&(amp|#38|lt|#60|gt|#62|apos|#39|#x27|quot|#34);/g,p={amp:"&","#38":"&",lt:"<","#60":"<",gt:">","#62":">",apos:"'","#39":"'","#x27":"'",quot:'"',"#34":'"'};function r(e){if(e)return e.split(/\sclass="([^"]*)"/gm).filter((t,s)=>s%2===1).map(t=>t.split(" ")).flat().map(t=>t.replace(o,(s,a)=>p[a]))}export{r as extractClassesFromHTML};
|