@master/css 2.0.0-beta.129 → 2.0.0-beta.130
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/rule.js +1 -1
- package/dist/config/functions.d.ts +1 -1
- package/dist/esm/config/functions.mjs +1 -1
- package/dist/esm/config/rules.mjs +1 -1
- package/dist/esm/rule.mjs +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -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})},b=(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 p=e=>b(f({},"__esModule",{value:!0}),e);var
|
|
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})},b=(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 p=e=>b(f({},"__esModule",{value:!0}),e);var R={};h(R,{functions:()=>c});module.exports=p(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:""}};0&&(module.exports={functions});
|
package/dist/cjs/config/rules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var f=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},T=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of C(t))!S.call(e,n)&&n!==r&&f(e,n,{get:()=>t[n],enumerable:!(o=k(t,n))||o.enumerable});return e};var I=e=>T(f({},"__esModule",{value:!0}),e);var z={};R(z,{rules:()=>A});module.exports=I(z);var x=require("../constants/start-symbol"),v=require("../constants/box-underneath"),p=require("../constants/content-extrema"),d=require("../constants/sizing-values"),$=require("../utils/css-escape"),A={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={},r=(l,i)=>{let a=i.indexOf(":");if(a!==-1){l in t||(t[l]={});let c=t[l],g=i.slice(0,a);g in c||(c[g]=i.slice(a+1))}},o=l=>{let i=(a,c)=>{let g=c.slice((0,$.cssEscape)(l.className).length).match(/\{(.*)\}/)[1].split(";");for(let w of g)r(a,w)};if(this.theme){let a=l.natives.find(c=>c.theme===this.theme)??l.natives.find(c=>!c.theme);a&&i(this.theme,a.text)}else for(let a of l.natives)i(a.theme,a.text)},n=[],s="",u=()=>{s&&(n.push(s.replace(/ /g,"")),s="")},h=1;(function l(i){for(;h<e.length;h++){let a=e[h];if(!i){if(a===";"){u();continue}if(a==="}")break}if(s+=a,i===a){if(i==="'"||i==='"'){let c=0;for(let g=s.length-2;s[g]==="\\";g--)c++;if(c%2)continue}break}else a in x.START_SYMBOL&&i!=="'"&&i!=='"'&&(h++,l(x.START_SYMBOL[a]))}})(void 0),u();for(let l of n){let i=this.css.create(l);if(Array.isArray(i))for(let a of i)o(a);else i?o(i):r(this.theme??"",l)}let m={};for(let l in t)for(let[i,a]of Object.entries(t[l]))i in m?m[i][l]=a:m[i]={[l]:a};return console.log(m),m}},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){let t={};switch(e){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]="auto";break;case"antialiased":t["-webkit-font-smoothing"]="antialiased",t["-moz-osx-font-smoothing"]="grayscale";break}return t}},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"}},margin:{match:"^m(?:argin(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return y.call(this,e+t)},get order(){return this.prefix==="margin:"||this.prefix==="m:"?-1:0}},padding:{match:"^p(?:adding(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return y.call(this,e+t)},get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:d.SIZING_VALUES,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:d.SIZING_VALUES},height:{match:"^h:.",unit:"rem",native:!0,values:d.SIZING_VALUES},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:d.SIZING_VALUES},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:d.SIZING_VALUES},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,r]=e.split(" x ");return{width:t,height:r}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"min-width":t,"min-height":r}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"max-width":t,"max-height":r}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},inset:{match:"^(?:top|bottom|left|right):.",unit:"rem",native:!0,declare(e,t){return{[this.prefix.slice(0,-1)]:e+t}}},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:d.SIZING_VALUES},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:d.SIZING_VALUES},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},overflow:{match:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",declare(e,t){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e+t};case"y":return{"overflow-y":e+t}}return{overflow:e+t}},get order(){return-1}},overscrollBehavior:{match:"^overscroll-behavior(?:-[xy])?:",declare(e,t){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e+t};case"y":return{"overscroll-behavior-y":e+t};default:return{"overscroll-behavior":e+t}}}},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+.75+t:`calc(${e}${t} + ${.75}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:{...v.BOX_UNDERNEATH,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},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1},borderColor:{match:"^b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?(?:-color)?:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return b(this.prefix,e+t,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{match:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",unit:"rem",declare(e,t){if(this.prefix){let o="",n=this.prefix.split("-");if(n.length>1)for(let s=1;s<n.length-1;s++)o+=n[s][0];else o=this.prefix.slice(1,-1);switch(o){case"t":return{"border-top-left-radius":e+t,"border-top-right-radius":e+t};case"tl":case"lt":return{"border-top-left-radius":e+t};case"rt":case"tr":return{"border-top-right-radius":e+t};case"b":return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t};case"bl":case"lb":return{"border-bottom-left-radius":e+t};case"br":case"rb":return{"border-bottom-right-radius":e+t};case"l":return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t};case"r":return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t};default:return{"border-radius":e+t}}}let r=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(r)?r:"border-radius"]:e+t}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{match:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",declare(e,t){return b(this.prefix,e+t,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{match:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",unit:"rem",declare(e,t){return b(this.prefix,e+t,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},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},border:{match:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",unit:"rem",colored:!0,values:{current:"currentColor"},declare(e,t){return b(this.prefix,e+t)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},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:v.BOX_UNDERNEATH},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:v.BOX_UNDERNEATH},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:p.CONTENT_EXTREMA},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:p.CONTENT_EXTREMA,native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,values:p.CONTENT_EXTREMA},gridTemplateRows:{native:!0,values:p.CONTENT_EXTREMA},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},gap:{match:"^gap(?:-x|-y)?:.",unit:"rem",order:-1,declare(e,t){switch(this.prefix[4]){case"x":return{"column-gap":e+t};case"y":return{"row-gap":e+t};default:return{gap:e+t}}}},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},scrollMargin:{match:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e+t,"scroll-margin-right":e+t};case"y":return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t};case"l":return{"scroll-margin-left":e+t};case"r":return{"scroll-margin-right":e+t};case"t":return{"scroll-margin-top":e+t};case"b":return{"scroll-margin-bottom":e+t}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{match:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e+t,"scroll-padding-right":e+t};case"y":return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t};case"l":return{"scroll-padding-left":e+t};case"r":return{"scroll-padding-right":e+t};case"t":return{"scroll-padding-top":e+t};case"b":return{"scroll-padding-bottom":e+t}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},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:{...v.BOX_UNDERNEATH,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:{...v.BOX_UNDERNEATH,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}}}};function y(e){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:e};let r=this.prefix[0]==="m"?"margin":"padding",o=r+"-left",n=r+"-right",s=r+"-top",u=r+"-bottom";switch(this.prefix[1]){case"x":return{[o]:e,[n]:e};case"y":return{[s]:e,[u]:e};case"l":return{[o]:e};case"r":return{[n]:e};case"t":return{[s]:e};case"b":return{[u]:e};default:return{[r]:e}}}function b(e,t,r=""){let o="border-";r&&(r="-"+r);let n=/^b(order)?-?(.)?/.exec(e)[2],s=o+"left"+r,u=o+"right"+r,h=o+"top"+r,m=o+"bottom"+r;switch(n){case"x":return{[s]:t,[u]:t};case"y":return{[h]:t,[m]:t};case"l":return{[s]:t};case"r":return{[u]:t};case"t":return{[h]:t};case"b":return{[m]:t};default:return{["border"+r]:t}}}0&&(module.exports={rules});
|
|
1
|
+
var f=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},T=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of C(t))!S.call(e,n)&&n!==r&&f(e,n,{get:()=>t[n],enumerable:!(o=k(t,n))||o.enumerable});return e};var I=e=>T(f({},"__esModule",{value:!0}),e);var z={};R(z,{rules:()=>A});module.exports=I(z);var x=require("../constants/start-symbol"),v=require("../constants/box-underneath"),p=require("../constants/content-extrema"),d=require("../constants/sizing-values"),$=require("../utils/css-escape"),A={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={},r=(l,i)=>{let a=i.indexOf(":");if(a!==-1){l in t||(t[l]={});let c=t[l],g=i.slice(0,a);g in c||(c[g]=i.slice(a+1))}},o=l=>{let i=(a,c)=>{let g=c.slice((0,$.cssEscape)(l.className).length).match(/\{(.*)\}/)[1].split(";");for(let w of g)r(a,w)};if(this.theme){let a=l.natives.find(c=>c.theme===this.theme)??l.natives.find(c=>!c.theme);a&&i(this.theme,a.text)}else for(let a of l.natives)i(a.theme,a.text)},n=[],s="",u=()=>{s&&(n.push(s.replace(/ /g,"")),s="")},h=1;(function l(i){for(;h<e.length;h++){let a=e[h];if(!i){if(a===";"){u();continue}if(a==="}")break}if(s+=a,i===a){if(i==="'"||i==='"'){let c=0;for(let g=s.length-2;s[g]==="\\";g--)c++;if(c%2)continue}break}else a in x.START_SYMBOL&&i!=="'"&&i!=='"'&&(h++,l(x.START_SYMBOL[a]))}})(void 0),u();for(let l of n){let i=this.css.create(l);if(Array.isArray(i))for(let a of i)o(a);else i?o(i):r(this.theme??"",l)}let m={};for(let l in t)for(let[i,a]of Object.entries(t[l]))i in m?m[i][l]=a:m[i]={[l]:a};return console.log(m),m}},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){let t={};switch(e){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]="auto";break;case"antialiased":t["-webkit-font-smoothing"]="antialiased",t["-moz-osx-font-smoothing"]="grayscale";break}return t}},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"}},margin:{match:"^m(?:argin(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return y.call(this,e+t)},get order(){return this.prefix==="margin:"||this.prefix==="m:"?-1:0}},padding:{match:"^p(?:adding(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return y.call(this,e+t)},get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:d.SIZING_VALUES,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:d.SIZING_VALUES},height:{match:"^h:.",unit:"rem",native:!0,values:d.SIZING_VALUES},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:d.SIZING_VALUES},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:d.SIZING_VALUES},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,r]=e.split(" x ");return{width:t,height:r}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"min-width":t,"min-height":r}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"max-width":t,"max-height":r}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},inset:{match:"^(?:top|bottom|left|right):.",unit:"rem",native:!0,declare(e,t){return{[this.prefix.slice(0,-1)]:e+t}}},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:d.SIZING_VALUES},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:d.SIZING_VALUES},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},overflow:{match:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",declare(e,t){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e+t};case"y":return{"overflow-y":e+t}}return{overflow:e+t}},get order(){return-1}},overscrollBehavior:{match:"^overscroll-behavior(?:-[xy])?:",declare(e,t){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e+t};case"y":return{"overscroll-behavior-y":e+t};default:return{"overscroll-behavior":e+t}}}},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:{...v.BOX_UNDERNEATH,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},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1},borderColor:{match:"^b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?(?:-color)?:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return b(this.prefix,e+t,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{match:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",unit:"rem",declare(e,t){if(this.prefix){let o="",n=this.prefix.split("-");if(n.length>1)for(let s=1;s<n.length-1;s++)o+=n[s][0];else o=this.prefix.slice(1,-1);switch(o){case"t":return{"border-top-left-radius":e+t,"border-top-right-radius":e+t};case"tl":case"lt":return{"border-top-left-radius":e+t};case"rt":case"tr":return{"border-top-right-radius":e+t};case"b":return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t};case"bl":case"lb":return{"border-bottom-left-radius":e+t};case"br":case"rb":return{"border-bottom-right-radius":e+t};case"l":return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t};case"r":return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t};default:return{"border-radius":e+t}}}let r=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(r)?r:"border-radius"]:e+t}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{match:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",declare(e,t){return b(this.prefix,e+t,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{match:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",unit:"rem",declare(e,t){return b(this.prefix,e+t,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},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},border:{match:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",unit:"rem",colored:!0,values:{current:"currentColor"},declare(e,t){return b(this.prefix,e+t)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},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:v.BOX_UNDERNEATH},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:v.BOX_UNDERNEATH},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:p.CONTENT_EXTREMA},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:p.CONTENT_EXTREMA,native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,values:p.CONTENT_EXTREMA},gridTemplateRows:{native:!0,values:p.CONTENT_EXTREMA},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},gap:{match:"^gap(?:-x|-y)?:.",unit:"rem",order:-1,declare(e,t){switch(this.prefix[4]){case"x":return{"column-gap":e+t};case"y":return{"row-gap":e+t};default:return{gap:e+t}}}},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},scrollMargin:{match:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e+t,"scroll-margin-right":e+t};case"y":return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t};case"l":return{"scroll-margin-left":e+t};case"r":return{"scroll-margin-right":e+t};case"t":return{"scroll-margin-top":e+t};case"b":return{"scroll-margin-bottom":e+t}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{match:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e+t,"scroll-padding-right":e+t};case"y":return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t};case"l":return{"scroll-padding-left":e+t};case"r":return{"scroll-padding-right":e+t};case"t":return{"scroll-padding-top":e+t};case"b":return{"scroll-padding-bottom":e+t}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},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:{...v.BOX_UNDERNEATH,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:{...v.BOX_UNDERNEATH,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}}}};function y(e){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:e};let r=this.prefix[0]==="m"?"margin":"padding",o=r+"-left",n=r+"-right",s=r+"-top",u=r+"-bottom";switch(this.prefix[1]){case"x":return{[o]:e,[n]:e};case"y":return{[s]:e,[u]:e};case"l":return{[o]:e};case"r":return{[n]:e};case"t":return{[s]:e};case"b":return{[u]:e};default:return{[r]:e}}}function b(e,t,r=""){let o="border-";r&&(r="-"+r);let n=/^b(order)?-?(.)?/.exec(e)[2],s=o+"left"+r,u=o+"right"+r,h=o+"top"+r,m=o+"bottom"+r;switch(n){case"x":return{[s]:t,[u]:t};case"y":return{[h]:t,[m]:t};case"l":return{[s]:t};case"r":return{[u]:t};case"t":return{[h]:t};case"b":return{[m]:t};default:return{["border"+r]:t}}}0&&(module.exports={rules});
|
package/dist/cjs/rule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Q=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var me=(u,i)=>{for(var s in i)Q(u,s,{get:i[s],enumerable:!0})},xe=(u,i,s,y)=>{if(i&&typeof i=="object"||typeof i=="function")for(let v of de(i))!pe.call(u,v)&&v!==s&&Q(u,v,{get:()=>i[v],enumerable:!(y=ge(i,v))||y.enumerable});return u};var ye=u=>xe(Q({},"__esModule",{value:!0}),u);var ve={};me(ve,{Rule:()=>F});module.exports=ye(ve);var q=require("./constants/sorted-selectors"),$=require("./constants/start-symbol"),ce=require("./utils/css-escape");function oe(u){let i=typeof Buffer<"u"?Buffer:null;return!!(i&&u instanceof i||u instanceof Date||u instanceof RegExp)}function le(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 fe(u){let i=[];return u.forEach(function(s,y){typeof s=="object"&&s!==null?Array.isArray(s)?i[y]=fe(s):oe(s)?i[y]=le(s):i[y]=A({},s):i[y]=s}),i}function re(u,i){return i==="__proto__"?void 0:u[i]}function A(...u){let i={},s,y;return u.forEach(function(v){typeof v!="object"||v===null||Array.isArray(v)||Object.keys(v).forEach(function(j){if(y=re(i,j),s=re(v,j),s!==i)if(typeof s!="object"||s===null){i[j]=s;return}else if(Array.isArray(s)){i[j]=fe(s);return}else if(oe(s)){i[j]=le(s);return}else if(typeof y!="object"||y===null||Array.isArray(y)){i[j]=A({},s);return}else{i[j]=A(y,s);return}})}),i}var Se={unit:"",order:0,separators:[","]},F=class{constructor(i,s={},y){this.className=i;this.meta=s;this.css=y;this.config=A(Se,s.config);let{unit:v,order:j,colored:C,native:W,analyze:Y,transform:Z,declare:H,create:J}=this.config,{scope:K,important:ae,functions:ue}=y.config,{themeNames:X,colorNames:G,colorThemesMap:ee,selectors:z,breakpoints:te,mediaQueries:D,themeAffectedClassesBy:he,globalValues:I}=y,ie=he[i];this.order=j,J&&J.call(this,i);let _,ne,P,B,w;if(s.origin==="semantics"){let[g,f]=s.value;B=i.slice(g.length),_=f}else{let g;if(Y)[g,P]=Y.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 f=this,a=this.values,m=[","];this.config.separators.length&&m.push(...this.config.separators);let n="",t=0;(function r(e,c,l,o=void 0,h=[],b=[],d){let k=o===void 0,S,M=p=>p==="'"||p==='"',V=()=>S=n.length,O=()=>{if(n){let p=n,x=k?p:n.slice(S);if(n="",T="",a&&x in a&&!h.includes(x)){let R=t;t=0,r(a[x].toString(),c,void 0,o,[...h,x],b,d),t=R,k||(n=n.slice(0,S)+n)}else if(I&&x in I&&!b.includes(x)){let R=t;t=0,r(I[x].toString(),c,void 0,o,h,[...b,x],d),t=R,k||(n=n.slice(0,S)+n)}else if(k){let R=!d&&f.analyzeUnitValue(x,c);w.push({value:R?.value??x,unit:R?.unit})}else{let R=!d&&f.analyzeUnitValue(x,c);n=R?p.slice(0,S)+R.value+R.unit:p}V()}},E=M(l);V();let T="";for(;t<e.length;t++){let p=e[t];if(p===l){if(E){n+=p;let x=0;for(let R=n.length-2;n[R]==="\\";R--)x++;if(x%2)continue}else O(),n+=p;return}else if(!E&&p in $.START_SYMBOL){let x=p==="("&&T&&ue?.[T];x?.
|
|
1
|
+
var Q=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var me=(u,i)=>{for(var s in i)Q(u,s,{get:i[s],enumerable:!0})},xe=(u,i,s,y)=>{if(i&&typeof i=="object"||typeof i=="function")for(let v of de(i))!pe.call(u,v)&&v!==s&&Q(u,v,{get:()=>i[v],enumerable:!(y=ge(i,v))||y.enumerable});return u};var ye=u=>xe(Q({},"__esModule",{value:!0}),u);var ve={};me(ve,{Rule:()=>F});module.exports=ye(ve);var q=require("./constants/sorted-selectors"),$=require("./constants/start-symbol"),ce=require("./utils/css-escape");function oe(u){let i=typeof Buffer<"u"?Buffer:null;return!!(i&&u instanceof i||u instanceof Date||u instanceof RegExp)}function le(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 fe(u){let i=[];return u.forEach(function(s,y){typeof s=="object"&&s!==null?Array.isArray(s)?i[y]=fe(s):oe(s)?i[y]=le(s):i[y]=A({},s):i[y]=s}),i}function re(u,i){return i==="__proto__"?void 0:u[i]}function A(...u){let i={},s,y;return u.forEach(function(v){typeof v!="object"||v===null||Array.isArray(v)||Object.keys(v).forEach(function(j){if(y=re(i,j),s=re(v,j),s!==i)if(typeof s!="object"||s===null){i[j]=s;return}else if(Array.isArray(s)){i[j]=fe(s);return}else if(oe(s)){i[j]=le(s);return}else if(typeof y!="object"||y===null||Array.isArray(y)){i[j]=A({},s);return}else{i[j]=A(y,s);return}})}),i}var Se={unit:"",order:0,separators:[","]},F=class{constructor(i,s={},y){this.className=i;this.meta=s;this.css=y;this.config=A(Se,s.config);let{unit:v,order:j,colored:C,native:W,analyze:Y,transform:Z,declare:H,create:J}=this.config,{scope:K,important:ae,functions:ue}=y.config,{themeNames:X,colorNames:G,colorThemesMap:ee,selectors:z,breakpoints:te,mediaQueries:D,themeAffectedClassesBy:he,globalValues:I}=y,ie=he[i];this.order=j,J&&J.call(this,i);let _,ne,P,B,w;if(s.origin==="semantics"){let[g,f]=s.value;B=i.slice(g.length),_=f}else{let g;if(Y)[g,P]=Y.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 f=this,a=this.values,m=[","];this.config.separators.length&&m.push(...this.config.separators);let n="",t=0;(function r(e,c,l,o=void 0,h=[],b=[],d){let k=o===void 0,S,M=p=>p==="'"||p==='"',V=()=>S=n.length,O=()=>{if(n){let p=n,x=k?p:n.slice(S);if(n="",T="",a&&x in a&&!h.includes(x)){let R=t;t=0,r(a[x].toString(),c,void 0,o,[...h,x],b,d),t=R,k||(n=n.slice(0,S)+n)}else if(I&&x in I&&!b.includes(x)){let R=t;t=0,r(I[x].toString(),c,void 0,o,h,[...b,x],d),t=R,k||(n=n.slice(0,S)+n)}else if(k){let R=!d&&f.analyzeUnitValue(x,c);w.push({value:R?.value??x,unit:R?.unit})}else{let R=!d&&f.analyzeUnitValue(x,c);n=R?p.slice(0,S)+R.value+R.unit:p}V()}},E=M(l);V();let T="";for(;t<e.length;t++){let p=e[t];if(p===l){if(E){n+=p;let x=0;for(let R=n.length-2;n[R]==="\\";R--)x++;if(x%2)continue}else O(),n+=p;return}else if(!E&&p in $.START_SYMBOL){let x=p==="("&&T&&ue?.[T];x?.name&&(n=n.slice(0,n.length-T.length)+x.name,T=x.name),n+=p,t++;let R=$.START_SYMBOL[p];r(e,x?.unit??c,R,T||o||"",h,b,d||!!x?.transform),x?.transform&&(n=n.slice(0,S+T.length+1)+x.transform.call(f,n.slice(S+T.length+1,-1))+n.slice(-1)),k&&(M(R)?(w.push(n),n=""):O()),T=""}else if((p==="|"||p===" ")&&l!=="}"&&(!E||o==="path"))O(),k||(n+=" ",S++);else{if(!E){if(p==="."){if(isNaN(+e[t+1]))break;e[t-1]==="-"&&(n+="0")}else if(m.includes(p)){O(),k?w.push(p):(n+=p,S++);continue}else if(k&&(p==="#"&&(n||w.length&&e[t-1]!=="|"&&w[t-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(p)))break;T+=p}n+=p}}o===void 0&&O()})(g,v),B=g.slice(t)}B[0]==="!"&&(this.important=!0,B=B.slice(1));let se=g=>{let f=g.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((t,r)=>r%3?t:t.replace(/_/g," ")).join(""),a=[],m="",n=0;for(let t=0;t<f.length;t++){let r=f[t];if(r==="\\"){m+=r+f[++t];continue}!n&&r===","?(a.push(m),m=""):(m+=r,n&&r===")"?n--:r==="("&&n++)}return m&&a.push(m),a};this.prefixSelectors=P?se(P):[""];let N=B.split("@"),U=N[0];if(U){this.vendorSuffixSelectors={};let g=(t,r,e,c)=>{for(let[l,o]of r)if(l.test(t)){for(let h of o)g(t.replace(l,h),r,e,!0);return}c&&e.push(t)},f=[];""in z?g(U,z[""],f,!0):f.push(U);let a={};for(let[t,r]of Object.entries(z)){if(!t)continue;let e=[];for(let c of f)g(c,r,e,!1);e.length&&(a[t]=e)}let m=(t,r)=>{let e=r.reduce((c,l)=>(c.push(...se(l)),c),[]);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("",f);for(let t of Object.values(this.vendorSuffixSelectors))for(let r of t){this.hasWhere!==!1&&(this.hasWhere=r.includes(":where("));for(let e=0;e<q.SORTED_SELECTORS.length;e++)if(r.includes(q.SORTED_SELECTORS[e])){(this.priority===-1||this.priority>e)&&(this.priority=e);break}}}else this.vendorSuffixSelectors={"":[""]};for(let g=1;g<N.length;g++){let f=N[g];if(f)if(X.includes(f))this.theme=f;else if(f==="rtl"||f==="ltr")this.direction=f;else{let a,m,n=f.indexOf("_");if(n!==-1)a=f.slice(0,n),m=f.slice(n);else{let t=f.indexOf("(");t!==-1&&(a=f.slice(0,t),m=f.slice(t))}if(!a){a="media";let t=[];this.media={token:f,features:{}};let r=f.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(D&&e in D)t.push(D[e]);else{let c={token:e},l="",o="",h=0;e.startsWith("<=")?(o="<=",l="max-width"):e.startsWith(">=")||te[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=te[b];switch(l){case"max-width":case"min-width":d?Object.assign(c,this.analyzeUnitValue(d.toString(),"px")):Object.assign(c,this.analyzeUnitValue(b,"px")),c.unit==="px"&&(c.value+=h),this.media.features[l]=c,t.push("("+l+":"+(c.value+c.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,f)=>{let a,m=(r,e,c)=>{let l="";this.direction&&(l+="[dir="+this.direction+"] ");let o=this.prefixSelectors.map(d=>d+l),h=(d,k)=>o.map(S=>(d?"."+d+" ":"")+(K?K+" ":"")+S).reduce((S,M)=>(S.push(c.reduce((V,O)=>(V.push(M+"."+(0,ce.cssEscape)(k)+O),V),[]).join(",")),S),[]).join(","),b=h(e,i)+(ie?Object.entries(ie).filter(([d])=>this.theme||!C||!e||!d||d===e).map(([d,k])=>k.reduce((S,M)=>S+","+h(this.theme??((C||ne)&&e||d),M),"")).join(""):"")+"{"+r+"}";for(let d of Object.keys(this.at).sort((k,S)=>S==="supports"?-1:1))b="@"+d+" "+this.at[d]+"{"+b+"}";return b},n=[];if(w){let r=this.theme?[this.theme,""]:[g],e,c;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&&ee&&G){let h=!1,b=!1;o=o.replace(new RegExp(`(^|,| |\\()((?:${G.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(d,k,S,M)=>{b=!0;let V=ee[S];if(V){let O;for(let E of r)if(O=V[E])break;if(O){h=!0;let E=O;if(M){let T=M.endsWith("%")?parseFloat(M)/100:+M;T=isNaN(T)?1:Math.min(Math.max(T,0),1),E+=Math.round(T*255).toString(16).toUpperCase().padStart(2,"0")}return k+E}}return d}),b&&(c=h)}c!==void 0&&!e&&(e=c),n.push(o)}if(f&&(e===void 0?g:!e))return;if(a=n.reduce((l,o,h)=>l+o+(o===","||w[h+1]===","||h===w.length-1?"":" "),""),Z&&(a=Z.call(this,a,this.css.config)),C&&a==="current"&&(a="currentColor"),H){let l,o;if(w.length===1){let h=w[0];typeof h=="object"&&(l=h.value,o=h.unit)}_=H.call(this,o?l:a,o||"")}else _={[W]:a}}let t={};for(let r in _){let e=(o,h)=>{let b=h+((this.important||ae)&&!h.endsWith("!important")?"!important":"");o in t?t[o].push(b):t[o]=[b]},c=r+":",l=_[r];if(typeof l=="object"){ne=!0;for(let o in l)e(o,c+l[o])}else e(g,c+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 X)L(g,!0);else L("",!1)}at={};priority=-1;natives=[];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 y=s??this.config.unit;if(y){let v="",j=i.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(j)if(i.includes("/")){let[C,W]=i.split("/");return{value:+C/+W*100+"%",unit:v}}else{let C=+j[1];return v=j[3]||"",v||((y==="rem"||y==="em")&&(C=C/this.css.config.rootSize),v=y||""),{value:C,unit:v}}}}};0&&(module.exports={Rule});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var c={$:{
|
|
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 +1 @@
|
|
|
1
|
-
import{START_SYMBOL as f}from"../constants/start-symbol.mjs";import{BOX_UNDERNEATH as v}from"../constants/box-underneath.mjs";import{CONTENT_EXTREMA as p}from"../constants/content-extrema.mjs";import{SIZING_VALUES as g}from"../constants/sizing-values.mjs";import{cssEscape as $}from"../utils/css-escape.mjs";var T={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={},r=(o,i)=>{let a=i.indexOf(":");if(a!==-1){o in t||(t[o]={});let c=t[o],h=i.slice(0,a);h in c||(c[h]=i.slice(a+1))}},l=o=>{let i=(a,c)=>{let h=c.slice($(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let y of h)r(a,y)};if(this.theme){let a=o.natives.find(c=>c.theme===this.theme)??o.natives.find(c=>!c.theme);a&&i(this.theme,a.text)}else for(let a of o.natives)i(a.theme,a.text)},s=[],n="",u=()=>{n&&(s.push(n.replace(/ /g,"")),n="")},d=1;(function o(i){for(;d<e.length;d++){let a=e[d];if(!i){if(a===";"){u();continue}if(a==="}")break}if(n+=a,i===a){if(i==="'"||i==='"'){let c=0;for(let h=n.length-2;n[h]==="\\";h--)c++;if(c%2)continue}break}else a in f&&i!=="'"&&i!=='"'&&(d++,o(f[a]))}})(void 0),u();for(let o of s){let i=this.css.create(o);if(Array.isArray(i))for(let a of i)l(a);else i?l(i):r(this.theme??"",o)}let m={};for(let o in t)for(let[i,a]of Object.entries(t[o]))i in m?m[i][o]=a:m[i]={[o]:a};return console.log(m),m}},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){let t={};switch(e){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]="auto";break;case"antialiased":t["-webkit-font-smoothing"]="antialiased",t["-moz-osx-font-smoothing"]="grayscale";break}return t}},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"}},margin:{match:"^m(?:argin(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return x.call(this,e+t)},get order(){return this.prefix==="margin:"||this.prefix==="m:"?-1:0}},padding:{match:"^p(?:adding(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return x.call(this,e+t)},get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:g,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:g},height:{match:"^h:.",unit:"rem",native:!0,values:g},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:g},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:g},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,r]=e.split(" x ");return{width:t,height:r}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"min-width":t,"min-height":r}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"max-width":t,"max-height":r}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},inset:{match:"^(?:top|bottom|left|right):.",unit:"rem",native:!0,declare(e,t){return{[this.prefix.slice(0,-1)]:e+t}}},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:g},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:g},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},overflow:{match:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",declare(e,t){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e+t};case"y":return{"overflow-y":e+t}}return{overflow:e+t}},get order(){return-1}},overscrollBehavior:{match:"^overscroll-behavior(?:-[xy])?:",declare(e,t){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e+t};case"y":return{"overscroll-behavior-y":e+t};default:return{"overscroll-behavior":e+t}}}},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+.75+t:`calc(${e}${t} + ${.75}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:{...v,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},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1},borderColor:{match:"^b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?(?:-color)?:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return b(this.prefix,e+t,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{match:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",unit:"rem",declare(e,t){if(this.prefix){let l="",s=this.prefix.split("-");if(s.length>1)for(let n=1;n<s.length-1;n++)l+=s[n][0];else l=this.prefix.slice(1,-1);switch(l){case"t":return{"border-top-left-radius":e+t,"border-top-right-radius":e+t};case"tl":case"lt":return{"border-top-left-radius":e+t};case"rt":case"tr":return{"border-top-right-radius":e+t};case"b":return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t};case"bl":case"lb":return{"border-bottom-left-radius":e+t};case"br":case"rb":return{"border-bottom-right-radius":e+t};case"l":return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t};case"r":return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t};default:return{"border-radius":e+t}}}let r=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(r)?r:"border-radius"]:e+t}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{match:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",declare(e,t){return b(this.prefix,e+t,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{match:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",unit:"rem",declare(e,t){return b(this.prefix,e+t,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},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},border:{match:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",unit:"rem",colored:!0,values:{current:"currentColor"},declare(e,t){return b(this.prefix,e+t)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},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:v},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:v},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:p},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:p,native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,values:p},gridTemplateRows:{native:!0,values:p},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},gap:{match:"^gap(?:-x|-y)?:.",unit:"rem",order:-1,declare(e,t){switch(this.prefix[4]){case"x":return{"column-gap":e+t};case"y":return{"row-gap":e+t};default:return{gap:e+t}}}},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},scrollMargin:{match:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e+t,"scroll-margin-right":e+t};case"y":return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t};case"l":return{"scroll-margin-left":e+t};case"r":return{"scroll-margin-right":e+t};case"t":return{"scroll-margin-top":e+t};case"b":return{"scroll-margin-bottom":e+t}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{match:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e+t,"scroll-padding-right":e+t};case"y":return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t};case"l":return{"scroll-padding-left":e+t};case"r":return{"scroll-padding-right":e+t};case"t":return{"scroll-padding-top":e+t};case"b":return{"scroll-padding-bottom":e+t}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},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:{...v,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:{...v,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}}}};function x(e){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:e};let r=this.prefix[0]==="m"?"margin":"padding",l=r+"-left",s=r+"-right",n=r+"-top",u=r+"-bottom";switch(this.prefix[1]){case"x":return{[l]:e,[s]:e};case"y":return{[n]:e,[u]:e};case"l":return{[l]:e};case"r":return{[s]:e};case"t":return{[n]:e};case"b":return{[u]:e};default:return{[r]:e}}}function b(e,t,r=""){let l="border-";r&&(r="-"+r);let s=/^b(order)?-?(.)?/.exec(e)[2],n=l+"left"+r,u=l+"right"+r,d=l+"top"+r,m=l+"bottom"+r;switch(s){case"x":return{[n]:t,[u]:t};case"y":return{[d]:t,[m]:t};case"l":return{[n]:t};case"r":return{[u]:t};case"t":return{[d]:t};case"b":return{[m]:t};default:return{["border"+r]:t}}}export{T as rules};
|
|
1
|
+
import{START_SYMBOL as f}from"../constants/start-symbol.mjs";import{BOX_UNDERNEATH as v}from"../constants/box-underneath.mjs";import{CONTENT_EXTREMA as p}from"../constants/content-extrema.mjs";import{SIZING_VALUES as g}from"../constants/sizing-values.mjs";import{cssEscape as $}from"../utils/css-escape.mjs";var T={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={},r=(o,i)=>{let a=i.indexOf(":");if(a!==-1){o in t||(t[o]={});let c=t[o],h=i.slice(0,a);h in c||(c[h]=i.slice(a+1))}},l=o=>{let i=(a,c)=>{let h=c.slice($(o.className).length).match(/\{(.*)\}/)[1].split(";");for(let y of h)r(a,y)};if(this.theme){let a=o.natives.find(c=>c.theme===this.theme)??o.natives.find(c=>!c.theme);a&&i(this.theme,a.text)}else for(let a of o.natives)i(a.theme,a.text)},s=[],n="",u=()=>{n&&(s.push(n.replace(/ /g,"")),n="")},d=1;(function o(i){for(;d<e.length;d++){let a=e[d];if(!i){if(a===";"){u();continue}if(a==="}")break}if(n+=a,i===a){if(i==="'"||i==='"'){let c=0;for(let h=n.length-2;n[h]==="\\";h--)c++;if(c%2)continue}break}else a in f&&i!=="'"&&i!=='"'&&(d++,o(f[a]))}})(void 0),u();for(let o of s){let i=this.css.create(o);if(Array.isArray(i))for(let a of i)l(a);else i?l(i):r(this.theme??"",o)}let m={};for(let o in t)for(let[i,a]of Object.entries(t[o]))i in m?m[i][o]=a:m[i]={[o]:a};return console.log(m),m}},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){let t={};switch(e){case"subpixel-antialiased":t["-webkit-font-smoothing"]=t["-moz-osx-font-smoothing"]="auto";break;case"antialiased":t["-webkit-font-smoothing"]="antialiased",t["-moz-osx-font-smoothing"]="grayscale";break}return t}},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"}},margin:{match:"^m(?:argin(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return x.call(this,e+t)},get order(){return this.prefix==="margin:"||this.prefix==="m:"?-1:0}},padding:{match:"^p(?:adding(?:-(?:left|right|top|bottom))?|[xytblr]?):.",unit:"rem",declare(e,t){return x.call(this,e+t)},get order(){return this.prefix==="padding:"||this.prefix==="p:"?-1:0}},flexBasis:{values:g,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:g},height:{match:"^h:.",unit:"rem",native:!0,values:g},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:g},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:g},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,r]=e.split(" x ");return{width:t,height:r}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"min-width":t,"min-height":r}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,r]=e.split(" x ");return{"max-width":t,"max-height":r}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},inset:{match:"^(?:top|bottom|left|right):.",unit:"rem",native:!0,declare(e,t){return{[this.prefix.slice(0,-1)]:e+t}}},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:g},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:g},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},overflow:{match:"^overflow(?:-x|-y)?:(?:visible|overlay|hidden|scroll|auto|clip|inherit|initial|revert|revert-layer|unset|\\$|var|$values)",declare(e,t){if(this.prefix)switch(this.prefix.slice(-2,-1)){case"x":return{"overflow-x":e+t};case"y":return{"overflow-y":e+t}}return{overflow:e+t}},get order(){return-1}},overscrollBehavior:{match:"^overscroll-behavior(?:-[xy])?:",declare(e,t){switch(this.prefix.slice(-2,-1)){case"x":return{"overscroll-behavior-x":e+t};case"y":return{"overscroll-behavior-y":e+t};default:return{"overscroll-behavior":e+t}}}},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:{...v,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},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1},borderColor:{match:"^b(?:[xytblr]|(?:order(?:-(?:left|right|top|bottom))?))?(?:-color)?:(?:(?:#|(rgb|hsl)\\(.*\\))((?!\\|).)*$|(?:transparent|currentColor|inherit|$values|$colors))",colored:!0,values:{current:"currentColor"},declare(e,t){return b(this.prefix,e+t,"color")},get order(){return this.prefix==="border-color:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderRadius:{match:"^(?:r[tblr]?[tblr]?|border(?:-(?:top|bottom)-(?:left|right))?-radius):.",unit:"rem",declare(e,t){if(this.prefix){let l="",s=this.prefix.split("-");if(s.length>1)for(let n=1;n<s.length-1;n++)l+=s[n][0];else l=this.prefix.slice(1,-1);switch(l){case"t":return{"border-top-left-radius":e+t,"border-top-right-radius":e+t};case"tl":case"lt":return{"border-top-left-radius":e+t};case"rt":case"tr":return{"border-top-right-radius":e+t};case"b":return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t};case"bl":case"lb":return{"border-bottom-left-radius":e+t};case"br":case"rb":return{"border-bottom-right-radius":e+t};case"l":return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t};case"r":return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t};default:return{"border-radius":e+t}}}let r=this.prefix?.slice(0,-1);return{[["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"].includes(r)?r:"border-radius"]:e+t}},get order(){return this.prefix==="border-radius:"||this.prefix==="r:"?-1:0}},borderStyle:{match:"^(?:border(?:-(?:left|right|top|bottom))?-style:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|))",declare(e,t){return b(this.prefix,e+t,"style")},get order(){return this.prefix==="border-style:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderWidth:{match:"^(?:border(?:-(?:left|right|top|bottom))?-width:.|b(?:[xytblr]|order(?:-(?:left|right|top|bottom))?)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$)",unit:"rem",declare(e,t){return b(this.prefix,e+t,"width")},get order(){return this.prefix==="border-width:"||this.prefix==="b:"||this.prefix==="border:"?-1:0}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},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},border:{match:"^b(?:[xytblr]?|order(?:-(?:left|right|top|bottom))?):.",unit:"rem",colored:!0,values:{current:"currentColor"},declare(e,t){return b(this.prefix,e+t)},get order(){return this.prefix==="border:"||this.prefix==="b:"?-2:-1}},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:v},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:v},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:p},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:p,native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,values:p},gridTemplateRows:{native:!0,values:p},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},gap:{match:"^gap(?:-x|-y)?:.",unit:"rem",order:-1,declare(e,t){switch(this.prefix[4]){case"x":return{"column-gap":e+t};case"y":return{"row-gap":e+t};default:return{gap:e+t}}}},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},scrollMargin:{match:"^scroll-m(?:[xytblr]|argin(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="m")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-margin-left":e+t,"scroll-margin-right":e+t};case"y":return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t};case"l":return{"scroll-margin-left":e+t};case"r":return{"scroll-margin-right":e+t};case"t":return{"scroll-margin-top":e+t};case"b":return{"scroll-margin-bottom":e+t}}else return{[this.prefix.replace(/-m(?!argin)/,"-margin").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-margin:"||this.prefix==="scroll-m:"?-1:0}},scrollPadding:{match:"^scroll-p(?:[xytblr]|adding(?:-(?:top|bottom|left|right))?)?:.",unit:"rem",declare(e,t){if(this.prefix.slice(-3,-2)==="p")switch(this.prefix.slice(-2,-1)){case"x":return{"scroll-padding-left":e+t,"scroll-padding-right":e+t};case"y":return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t};case"l":return{"scroll-padding-left":e+t};case"r":return{"scroll-padding-right":e+t};case"t":return{"scroll-padding-top":e+t};case"b":return{"scroll-padding-bottom":e+t}}else return{[this.prefix.replace(/-p(?!adding)/,"-padding").slice(0,-1)]:e+t}},get order(){return this.prefix==="scroll-padding:"||this.prefix==="scroll-p:"?-1:0}},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:{...v,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:{...v,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}}}};function x(e){if(this.prefix.includes("-"))return{[this.prefix.slice(0,-1)]:e};let r=this.prefix[0]==="m"?"margin":"padding",l=r+"-left",s=r+"-right",n=r+"-top",u=r+"-bottom";switch(this.prefix[1]){case"x":return{[l]:e,[s]:e};case"y":return{[n]:e,[u]:e};case"l":return{[l]:e};case"r":return{[s]:e};case"t":return{[n]:e};case"b":return{[u]:e};default:return{[r]:e}}}function b(e,t,r=""){let l="border-";r&&(r="-"+r);let s=/^b(order)?-?(.)?/.exec(e)[2],n=l+"left"+r,u=l+"right"+r,d=l+"top"+r,m=l+"bottom"+r;switch(s){case"x":return{[n]:t,[u]:t};case"y":return{[d]:t,[m]:t};case"l":return{[n]:t};case"r":return{[u]:t};case"t":return{[d]:t};case"b":return{[m]:t};default:return{["border"+r]:t}}}export{T as rules};
|
package/dist/esm/rule.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SORTED_SELECTORS as re}from"./constants/sorted-selectors.mjs";import{START_SYMBOL as oe}from"./constants/start-symbol.mjs";import{cssEscape as ue}from"./utils/css-escape.mjs";function ie(y){let n=typeof Buffer<"u"?Buffer:null;return!!(n&&y instanceof n||y instanceof Date||y instanceof RegExp)}function ne(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let n=Buffer.alloc(y.length);return y.copy(n),n}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function se(y){let n=[];return y.forEach(function(l,S){typeof l=="object"&&l!==null?Array.isArray(l)?n[S]=se(l):ie(l)?n[S]=ne(l):n[S]=A({},l):n[S]=l}),n}function te(y,n){return n==="__proto__"?void 0:y[n]}function A(...y){let n={},l,S;return y.forEach(function(T){typeof T!="object"||T===null||Array.isArray(T)||Object.keys(T).forEach(function(j){if(S=te(n,j),l=te(T,j),l!==n)if(typeof l!="object"||l===null){n[j]=l;return}else if(Array.isArray(l)){n[j]=se(l);return}else if(ie(l)){n[j]=ne(l);return}else if(typeof S!="object"||S===null||Array.isArray(S)){n[j]=A({},l);return}else{n[j]=A(S,l);return}})}),n}var he={unit:"",order:0,separators:[","]},le=class{constructor(n,l={},S){this.className=n;this.meta=l;this.css=S;this.config=A(he,l.config);let{unit:T,order:j,colored:C,native:W,analyze:Q,transform:q,declare:$,create:F}=this.config,{scope:Y,important:fe,functions:ce}=S.config,{themeNames:Z,colorNames:H,colorThemesMap:J,selectors:z,breakpoints:K,mediaQueries:D,themeAffectedClassesBy:ae,globalValues:I}=S,X=ae[n];this.order=j,F&&F.call(this,n);let _,G,P,B,w;if(l.origin==="semantics"){let[h,f]=l.value;B=n.slice(h.length),_=f}else{let h;if(Q)[h,P]=Q.call(this,n);else if(l.origin==="match"){let s=n.indexOf(":");this.prefix=n.slice(0,s+1),this.prefix.includes("(")?(this.prefix=void 0,h=n):h=n.slice(s+1)}else l.origin==="symbol"&&(this.symbol=n[0],h=n.slice(1));w=[];let f=this,a=this.values,p=[","];this.config.separators.length&&p.push(...this.config.separators);let i="",t=0;(function s(e,c,o,r=void 0,u=[],v=[],g){let R=r===void 0,x,M=d=>d==="'"||d==='"',V=()=>x=i.length,O=()=>{if(i){let d=i,m=R?d:i.slice(x);if(i="",k="",a&&m in a&&!u.includes(m)){let b=t;t=0,s(a[m].toString(),c,void 0,r,[...u,m],v,g),t=b,R||(i=i.slice(0,x)+i)}else if(I&&m in I&&!v.includes(m)){let b=t;t=0,s(I[m].toString(),c,void 0,r,u,[...v,m],g),t=b,R||(i=i.slice(0,x)+i)}else if(R){let b=!g&&f.analyzeUnitValue(m,c);w.push({value:b?.value??m,unit:b?.unit})}else{let b=!g&&f.analyzeUnitValue(m,c);i=b?d.slice(0,x)+b.value+b.unit:d}V()}},E=M(o);V();let k="";for(;t<e.length;t++){let d=e[t];if(d===o){if(E){i+=d;let m=0;for(let b=i.length-2;i[b]==="\\";b--)m++;if(m%2)continue}else O(),i+=d;return}else if(!E&&d in oe){let m=d==="("&&k&&ce?.[k];m?.
|
|
1
|
+
import{SORTED_SELECTORS as re}from"./constants/sorted-selectors.mjs";import{START_SYMBOL as oe}from"./constants/start-symbol.mjs";import{cssEscape as ue}from"./utils/css-escape.mjs";function ie(y){let n=typeof Buffer<"u"?Buffer:null;return!!(n&&y instanceof n||y instanceof Date||y instanceof RegExp)}function ne(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let n=Buffer.alloc(y.length);return y.copy(n),n}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function se(y){let n=[];return y.forEach(function(l,S){typeof l=="object"&&l!==null?Array.isArray(l)?n[S]=se(l):ie(l)?n[S]=ne(l):n[S]=A({},l):n[S]=l}),n}function te(y,n){return n==="__proto__"?void 0:y[n]}function A(...y){let n={},l,S;return y.forEach(function(T){typeof T!="object"||T===null||Array.isArray(T)||Object.keys(T).forEach(function(j){if(S=te(n,j),l=te(T,j),l!==n)if(typeof l!="object"||l===null){n[j]=l;return}else if(Array.isArray(l)){n[j]=se(l);return}else if(ie(l)){n[j]=ne(l);return}else if(typeof S!="object"||S===null||Array.isArray(S)){n[j]=A({},l);return}else{n[j]=A(S,l);return}})}),n}var he={unit:"",order:0,separators:[","]},le=class{constructor(n,l={},S){this.className=n;this.meta=l;this.css=S;this.config=A(he,l.config);let{unit:T,order:j,colored:C,native:W,analyze:Q,transform:q,declare:$,create:F}=this.config,{scope:Y,important:fe,functions:ce}=S.config,{themeNames:Z,colorNames:H,colorThemesMap:J,selectors:z,breakpoints:K,mediaQueries:D,themeAffectedClassesBy:ae,globalValues:I}=S,X=ae[n];this.order=j,F&&F.call(this,n);let _,G,P,B,w;if(l.origin==="semantics"){let[h,f]=l.value;B=n.slice(h.length),_=f}else{let h;if(Q)[h,P]=Q.call(this,n);else if(l.origin==="match"){let s=n.indexOf(":");this.prefix=n.slice(0,s+1),this.prefix.includes("(")?(this.prefix=void 0,h=n):h=n.slice(s+1)}else l.origin==="symbol"&&(this.symbol=n[0],h=n.slice(1));w=[];let f=this,a=this.values,p=[","];this.config.separators.length&&p.push(...this.config.separators);let i="",t=0;(function s(e,c,o,r=void 0,u=[],v=[],g){let R=r===void 0,x,M=d=>d==="'"||d==='"',V=()=>x=i.length,O=()=>{if(i){let d=i,m=R?d:i.slice(x);if(i="",k="",a&&m in a&&!u.includes(m)){let b=t;t=0,s(a[m].toString(),c,void 0,r,[...u,m],v,g),t=b,R||(i=i.slice(0,x)+i)}else if(I&&m in I&&!v.includes(m)){let b=t;t=0,s(I[m].toString(),c,void 0,r,u,[...v,m],g),t=b,R||(i=i.slice(0,x)+i)}else if(R){let b=!g&&f.analyzeUnitValue(m,c);w.push({value:b?.value??m,unit:b?.unit})}else{let b=!g&&f.analyzeUnitValue(m,c);i=b?d.slice(0,x)+b.value+b.unit:d}V()}},E=M(o);V();let k="";for(;t<e.length;t++){let d=e[t];if(d===o){if(E){i+=d;let m=0;for(let b=i.length-2;i[b]==="\\";b--)m++;if(m%2)continue}else O(),i+=d;return}else if(!E&&d in oe){let m=d==="("&&k&&ce?.[k];m?.name&&(i=i.slice(0,i.length-k.length)+m.name,k=m.name),i+=d,t++;let b=oe[d];s(e,m?.unit??c,b,k||r||"",u,v,g||!!m?.transform),m?.transform&&(i=i.slice(0,x+k.length+1)+m.transform.call(f,i.slice(x+k.length+1,-1))+i.slice(-1)),R&&(M(b)?(w.push(i),i=""):O()),k=""}else if((d==="|"||d===" ")&&o!=="}"&&(!E||r==="path"))O(),R||(i+=" ",x++);else{if(!E){if(d==="."){if(isNaN(+e[t+1]))break;e[t-1]==="-"&&(i+="0")}else if(p.includes(d)){O(),R?w.push(d):(i+=d,x++);continue}else if(R&&(d==="#"&&(i||w.length&&e[t-1]!=="|"&&w[t-1]!==" ")||["!","*",">","+","~",":","[","@","_"].includes(d)))break;k+=d}i+=d}}r===void 0&&O()})(h,T),B=h.slice(t)}B[0]==="!"&&(this.important=!0,B=B.slice(1));let ee=h=>{let f=h.split(/(\\'(?:.*?)[^\\]\\')(?=[*_>~+,)])|(\[[^=]+='(?:.*?)[^\\]'\])/).map((t,s)=>s%3?t:t.replace(/_/g," ")).join(""),a=[],p="",i=0;for(let t=0;t<f.length;t++){let s=f[t];if(s==="\\"){p+=s+f[++t];continue}!i&&s===","?(a.push(p),p=""):(p+=s,i&&s===")"?i--:s==="("&&i++)}return p&&a.push(p),a};this.prefixSelectors=P?ee(P):[""];let N=B.split("@"),U=N[0];if(U){this.vendorSuffixSelectors={};let h=(t,s,e,c)=>{for(let[o,r]of s)if(o.test(t)){for(let u of r)h(t.replace(o,u),s,e,!0);return}c&&e.push(t)},f=[];""in z?h(U,z[""],f,!0):f.push(U);let a={};for(let[t,s]of Object.entries(z)){if(!t)continue;let e=[];for(let c of f)h(c,s,e,!1);e.length&&(a[t]=e)}let p=(t,s)=>{let e=s.reduce((c,o)=>(c.push(...ee(o)),c),[]);t in this.vendorSuffixSelectors?this.vendorSuffixSelectors[t].push(...e):this.vendorSuffixSelectors[t]=e},i=Object.keys(a);if(i.length)for(let t of i)p(t,a[t]);else p("",f);for(let t of Object.values(this.vendorSuffixSelectors))for(let s of t){this.hasWhere!==!1&&(this.hasWhere=s.includes(":where("));for(let e=0;e<re.length;e++)if(s.includes(re[e])){(this.priority===-1||this.priority>e)&&(this.priority=e);break}}}else this.vendorSuffixSelectors={"":[""]};for(let h=1;h<N.length;h++){let f=N[h];if(f)if(Z.includes(f))this.theme=f;else if(f==="rtl"||f==="ltr")this.direction=f;else{let a,p,i=f.indexOf("_");if(i!==-1)a=f.slice(0,i),p=f.slice(i);else{let t=f.indexOf("(");t!==-1&&(a=f.slice(0,t),p=f.slice(t))}if(!a){a="media";let t=[];this.media={token:f,features:{}};let s=f.split("&");for(let e of s)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(D&&e in D)t.push(D[e]);else{let c={token:e},o="",r="",u=0;e.startsWith("<=")?(r="<=",o="max-width"):e.startsWith(">=")||K[e]?(r=">=",o="min-width"):e.startsWith(">")?(r=">",o="min-width",u=.02):e.startsWith("<")&&(r="<",o="max-width",u=-.02);let v=r?e.replace(r,""):e,g=K[v];switch(o){case"max-width":case"min-width":g?Object.assign(c,this.analyzeUnitValue(g.toString(),"px")):Object.assign(c,this.analyzeUnitValue(v,"px")),c.unit==="px"&&(c.value+=u),this.media.features[o]=c,t.push("("+o+":"+(c.value+c.unit)+")");break}}p="",this.media.type&&(p=this.media.type),t.length&&(p+=(p?" and ":"")+t.join(" and "))}p&&(this.at[a]=(a in this.at?this.at[a]+" and ":"")+p.replace(/_/g," "))}}let L=(h,f)=>{let a,p=(s,e,c)=>{let o="";this.direction&&(o+="[dir="+this.direction+"] ");let r=this.prefixSelectors.map(g=>g+o),u=(g,R)=>r.map(x=>(g?"."+g+" ":"")+(Y?Y+" ":"")+x).reduce((x,M)=>(x.push(c.reduce((V,O)=>(V.push(M+"."+ue(R)+O),V),[]).join(",")),x),[]).join(","),v=u(e,n)+(X?Object.entries(X).filter(([g])=>this.theme||!C||!e||!g||g===e).map(([g,R])=>R.reduce((x,M)=>x+","+u(this.theme??((C||G)&&e||g),M),"")).join(""):"")+"{"+s+"}";for(let g of Object.keys(this.at).sort((R,x)=>x==="supports"?-1:1))v="@"+g+" "+this.at[g]+"{"+v+"}";return v},i=[];if(w){let s=this.theme?[this.theme,""]:[h],e,c;for(let o of w)if(typeof o=="string")i.push(o);else{let r=o.value;if(o.unit)r+=o.unit;else if(C&&J&&H){let u=!1,v=!1;r=r.replace(new RegExp(`(^|,| |\\()((?:${H.join("|")})(?:-(?:[0-9A-Za-z-]+))?)(?:\\/(\\.?[0-9]+%?))?(?=(\\)|\\}|,| |$))`,"gm"),(g,R,x,M)=>{v=!0;let V=J[x];if(V){let O;for(let E of s)if(O=V[E])break;if(O){u=!0;let E=O;if(M){let k=M.endsWith("%")?parseFloat(M)/100:+M;k=isNaN(k)?1:Math.min(Math.max(k,0),1),E+=Math.round(k*255).toString(16).toUpperCase().padStart(2,"0")}return R+E}}return g}),v&&(c=u)}c!==void 0&&!e&&(e=c),i.push(r)}if(f&&(e===void 0?h:!e))return;if(a=i.reduce((o,r,u)=>o+r+(r===","||w[u+1]===","||u===w.length-1?"":" "),""),q&&(a=q.call(this,a,this.css.config)),C&&a==="current"&&(a="currentColor"),$){let o,r;if(w.length===1){let u=w[0];typeof u=="object"&&(o=u.value,r=u.unit)}_=$.call(this,r?o:a,r||"")}else _={[W]:a}}let t={};for(let s in _){let e=(r,u)=>{let v=u+((this.important||fe)&&!u.endsWith("!important")?"!important":"");r in t?t[r].push(v):t[r]=[v]},c=s+":",o=_[s];if(typeof o=="object"){G=!0;for(let r in o)e(r,c+o[r])}else e(h,c+o.toString())}for(let s of Object.values(this.vendorSuffixSelectors))for(let e in t)this.natives.push({text:p(t[e].join(";"),e,s),theme:e})};if(this.theme)L(this.theme,!1);else if(C)for(let h of Z)L(h,!0);else L("",!1)}at={};priority=-1;natives=[];config;get values(){return this.css.values[this.config.id]}get text(){return this.natives.map(n=>n.text).join("")}resolveValue(n,l){return Number.isNaN(+n)?n:n/(l==="rem"||l==="em"?this.css.config.rootSize:1)+l}analyzeUnitValue(n,l){let S=l??this.config.unit;if(S){let T="",j=n.match(/^([+-.]?\d+(\.?\d+)?)(.*)?/);if(j)if(n.includes("/")){let[C,W]=n.split("/");return{value:+C/+W*100+"%",unit:T}}else{let C=+j[1];return T=j[3]||"",T||((S==="rem"||S==="em")&&(C=C/this.css.config.rootSize),T=S||""),{value:C,unit:T}}}}};export{le as Rule};
|