transform-to-unocss-core 0.0.21 → 0.0.22

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/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var P=Object.defineProperty;var Sr=Object.getOwnPropertyDescriptor;var Tr=Object.getOwnPropertyNames;var Ar=Object.prototype.hasOwnProperty;var Hr=(r,o)=>{for(var t in o)P(r,t,{get:o[t],enumerable:!0})},Mr=(r,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of Tr(o))!Ar.call(r,e)&&e!==t&&P(r,e,{get:()=>o[e],enumerable:!(n=Sr(o,e))||n.enumerable});return r};var Pr=r=>Mr(P({},"__esModule",{value:!0}),r);var ft={};Hr(ft,{cssMathFnRE:()=>B,diffTemplateStyle:()=>Gr,flag:()=>Er,getFirstName:()=>c,getHundred:()=>h,getLastName:()=>l,getStyleScoped:()=>Zr,getVal:()=>a,isCalc:()=>j,isColor:()=>Jr,isEmptyStyle:()=>Dr,isHex:()=>V,isHsl:()=>N,isNot:()=>Br,isPercent:()=>z,isRgb:()=>d,isSize:()=>qr,isUrl:()=>O,isVar:()=>w,joinEmpty:()=>G,joinWithLine:()=>I,joinWithUnderLine:()=>W,numberWithUnitRE:()=>K,toUnocss:()=>H,toUnocssClass:()=>Rr,transformImportant:()=>i,transformStyleToUnocss:()=>M,trim:()=>E});module.exports=Pr(ft);var Er=".__unocss_transfer__",B=/^(?:calc|clamp|min|max)\s*\(.*\)/,K=/[0-9]+(px|rem|em|%|vw|vh|vmin|vmax|deg)/;function Br(r){return/\[&:not\(/.test(r)}function j(r){return B.test(r)}function c(r){return r.split("-")[0]}function l(r){let o=r.split("-");return o[o.length-1]}function O(r){return r.startsWith("url(")}function z(r){return r.endsWith("%")}function V(r){return/^#[0-9A-Fa-f]{2,}$/.test(r)}function d(r){return r.startsWith("rgb")}function N(r){return r.startsWith("hsl")}function a(r,o,t,n=""){return j(r)||O(r)||V(r)||d(r)||N(r)||z(r)||w(r)?t?`-[${n}${E(r,"all").replace(/['"]/g,"")}]`:`="[${n}${E(r,"all").replace(/['"]/g,"")}]"`:`-${o?o(r):r}`}function h(r){return typeof r=="string"&&r.endsWith("%")?r.slice(0,-1):+r*100}function I(r){return r.replace(/\s+/," ").split(" ").join("-")}function W(r){return r.replace(/\s+/," ").split(" ").join("_")}function E(r,o="around"){return o==="pre"?r.replace(/(^\s*)/g,""):o==="post"?r.replace(/(\s*$)/g,""):o==="all"?r.replace(/\s+/g,""):o==="around"?r.replace(/(^\s*)|(\s*$)/g,""):r}function i(r){return r=r.replace(/\s+/," ").replace(/\s*,\s*/g,",").replace(/\s*\/\s*/,"/"),/rgb/.test(r)&&(r=r.replace(/rgba?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/hsl/.test(r)&&(r=r.replace(/hsla?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/var\([^\)]+\)/.test(r)&&(r=r.replace(/var\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),r.endsWith("!important")?[r.replace(/\s*\!important/,"").trim(),"!"]:[r.trim(),""]}function Gr(r,o){let t=r.match(/<style scoped>.*<\/style>/s),n=o.match(/<style scoped>.*<\/style>/s);return t[0]===n[0]}function Dr(r){return/<style scoped>[\n\s]*<\/style>/.test(r)}function Zr(r){let o=r.match(/<style scoped>(.*)<\/style>/s);return o?o[1]:""}function G(r){return r.replace(/\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s*,\s*/g,",")}function w(r){return r.startsWith("var(--")}function qr(r){return B.test(r)||K.test(r)}function Jr(r){return V(r)||d(r)||N(r)}function C(r,o){let[t,n]=i(o);return`${r[0]}${a(t,c)}${n}`}var Kr=["background-color","background-attachment","background-position"],Or=/linear-gradient\(\s*to([\w\s]+),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Qr=/linear-gradient\(\s*([^,]*),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Xr=/(radial|conic)-gradient\(([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,v="__comma__";function Q(r,o){let[t,n]=i(o);if(r==="background-size")return`bg${a(t,U,!1,"length:")}${n}`;if(Kr.includes(r))return`bg${a(t,U)}${n}`;if(["background","background-image"].includes(r)){if(/(linear)-gradient/.test(t)){let m=t.replace(/rgba?\(([^)]+)\)/g,($,p)=>$.replace(p,p.replace(/\s*,\s*/g,v))),f=m.match(Or);if(f){let[$,p,g,L]=f.slice(1);return $=$.split(" ").map(F=>F[0]).join(""),$?`bg-gradient-to-${$}${D(p,g,L)}`:D(p,g,L)}let u=m.match(Qr);return u?`bg-gradient-linear bg-gradient-[${u[1]},${u[2].replace(/\s+/,"_").replaceAll(v,",")},${u[3].replace(/\s+/,"_").replaceAll(v,",")}]`:void 0}else if(/(radial|conic)-gradient/.test(t)){let f=t.replace(/rgba?\(([^)]+)\)/g,(L,F)=>L.replace(F,F.replace(/\s*,\s*/g,v))).match(Xr);if(!f)return;let u=f[1],[$,p,g]=f.slice(2);return`bg-gradient-${u}${D($,p,g)}`}let e=t.match(/rgba?\([^)]+\)/);if(e){let m=e[0];return`bg="${t.replace(m,`[${m}]`)}${n}"`}let s=t.match(/url\(["'\s\.\-_\w\/]*\)/);return s?`bg="${t.replace(s[0],`[${s[0].replace(/['"]/g,"")}]${n}`)}"`:`bg${a(t,U)}${n}`}return r==="background-blend-mode"?`bg-blend-${t}${n}`:`${Yr(r,t)}-${yr(t)}${n}`}function Yr(r,o){return o.endsWith("repeat")?"bg":r.replace("background","bg")}function yr(r){return/(border)|(content)|(padding)-box/.test(r)?r.replace("-box",""):r.startsWith("repeat-")?r.replace("repeat-",""):U(r)}function U(r){return r.replace(/\s+/," ").replace(" ","-")}function D(r,o,t){let n="";if(o&&!t&&(t=o,o=""),r){r=r.replaceAll(v,",");let[e,s]=r.split(" ");s?n+=` from="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` from="${d(e)?`[${e}]`:e}"`)}if(o){o=o.replaceAll(v,",");let[e,s]=o.split(" ");s?n+=` via="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` via="${d(e)?`[${e}]`:e}"`)}if(t){t=t.replaceAll(v,",");let[e,s]=t.split(" ");s?n+=` to="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` to="${d(e)?`[${e}]`:e}"`)}return n}function Z(r,o){let[t,n]=i(o),e=r.split("-"),s=j(t)||w(t)?a(t):a(c(t));return`${e[0]}-${e[1][0]}${s}${n}`}function X(r,o){let[t,n]=i(o);if(r==="font-size")return`text-${t}${n}`;if(r==="font-weight")return`font-${t}${n}`;if(r==="font-family"){let e=t.match(/ui-(\w{0,4})/);if(!e)return`font-${o}${n}`;let[s,m]=e;return`font-${m}${n}`}return r==="font-style"?t==="normal"?`font-not-italic${n}`:`font-${t}${n}`:r==="font-variant-numeric"?t==="normal"?`normal-nums${n}`:`${t}${n}`:`font="${kr(t)}${n}"`}function kr(r){return r.split(" ").map(o=>/^[0-9]/.test(o)?`text-${o}`:o).join(" ")}function Y(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}var rt={"margin-left":"ml","margin-right":"mr","margin-top":"mt","margin-bottom":"mb","margin-inline-start":"ms","margin-inline-end":"me","padding-left":"pl","padding-right":"pr","padding-top":"pt","padding-bottom":"pb","padding-inline-start":"ps","padding-inline-end":"pe"};function q(r,o){let[t,n]=i(o),e=rt[r];if(e)return`${e}${a(t)}${n}`;let s=t.split(" "),m=s.length;return m===1?`${r[0]}${a(s[0])}${n}`:m===2?`${r[0]}x${a(s[1])}${n} ${r[0]}y${a(s[0])}${n}`:m===3?`${r[0]}x${a(s[1])}${n} ${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n}`:`${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n} ${r[0]}l${a(s[3])}${n} ${r[0]}r${a(s[1])}${n}`}function y(r,o){let[t,n]=i(o);return z(o)?`op-${t.replace("%","")}${n}`:`op-${+t*100}${n}`}function k(r,o){let[t,n]=i(o);return`text${a(t)}${n}`}function rr(r,o){let[t,n]=i(o);return r==="text-decoration-line"?t==="none"?`no-underline${n}`:`${t}${n}`:r==="text-transform"?t==="none"?`normal-case${n}`:`${t}${n}`:r.startsWith("text-decoration")||r==="text-indent"?`${r.split("-")[1]}${a(t)}${n}`:r==="text-underline-offset"?`underline-offset-${t}${n}`:`text-${t}${n}`}function tr(r,o){let[t,n]=i(o);return`v-${t}${n}`}var nr={1:"none",1.25:"tight",1.5:"normal",1.625:"relaxed",1.375:"snug"};function or(r,o){let[t,n]=i(o);return t in nr?`lh-${nr[t]}${n}`:`lh${a(t)}${n}`}var tt=["border-left","border-top","border-right","border-bottom"];function ir(r,o){let[t,n]=i(o);if(r==="border-spacing")return`${r}="[${W(t)}]${n}"`;if(r==="border-color"){if(t.includes(" ")){let e=t.split(" ").length,s=t.split(" ").map(p=>V(p)||d(p)||N(p)?`-[${p}]`:`-${p}`),[m,f,u,$]=s;switch(e){case 2:return`border-y${m}${n} border-x${f}${n}`;case 3:return`border-t${m}${n} border-b${u}${n} border-x${f}${n}`;case 4:return`border-t${m}${n} border-b${u}${n} border-r${f}${n} border-l${$}${n}`}}return`border${a(t)}${n}`}return r==="border-radius"?j(t)||!t.includes(" ")?`border-rd${a(t)}${n}`:`border-rd="[${W(t)}]${n}"`:tt.some(e=>r.startsWith(e))?t.split(" ").map(e=>`border-${r.split("-")[1][0]}${a(e)}${n}`).join(" "):r==="border-inline-end-width"?`border-e${a(t)}${n}`:r==="border-inline-start-width"?`border-s${a(t)}${n}`:r.startsWith("border-image")?"":/^\d[%|(px)|(rem)]$/.test(t)||r==="border-collapse"?`border-${t}${n}`:r==="border-width"||r==="border-style"?`border${a(t)}${n}`:r==="border-color"?t==="currentColor"?`border-current${n}`:`border${a(t)}${n}`:t.split(" ").map(e=>t==="currentColor"?`border-current${n}`:`border${a(e)}${n}`).join(" ")}function R(r,o){let[t,n]=i(o);return t==="none"?`hidden${n}`:t==="hidden"?`invisible${n}`:`${t}${n}`}function x(r,o){let[t,n]=i(o);return`${r}-${t}${n}`}function _(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}function b(r,o){let[t,n]=i(o);return`${c(r)}${a(t)}${n}`}function S(r,o){let[t,n]=i(o);return r.startsWith("box-decoration")?`box-decoration-${t}${n}`:r==="box-sizing"?`box-${c(t)}${n}`:`shadow="[${t.split(" ").join("_")}]${n}"`}var nt=["contrast","brightness","saturate"],ot=["grayscale","invert","sepia"];function T(r,o){let[t,n]=i(o),[e,s,m]=t.match(/([\w-]+)\((.*)\)/);return nt.includes(s)?`${s}-${h(m)}${n}`:s==="drop-shadow"?`drop-${S(s,m)}${n}`:ot.includes(s)?`${s}-${m.endsWith("%")?m.slice(0,-1):h(m)}${n}`:s==="hue-rotate"?`${s}-${m.slice(0,-3)}${n}`:`${s}-${m}${n}`}function er(r,o){let[t,n]=i(o);return`backdrop-${T(r,t)}${n}`}function sr(r,o){let[t,n]=i(o);return r==="transform-origin"?`origin-${I(t)}${n}`:r==="transform-style"?`transform-${t}`:G(t).split(" ").map(e=>{let s=e.match(/([a-z]+)([A-Z])?\((.*)\)/);if(!s)return;let[m,f,u,$]=s;if(u){let p=$.replace(/,(?![^()]*\))/g," ").split(" ");return p.length>1?`${f}-${u.toLowerCase()}="${p.map(g=>w(g)?`[${g}]`:f==="scale"?h(g):A(g)).join(" ")}${n}"`:`${f}="${u.toLowerCase()}-${w(p[0])?`[${p[0]}]`:f==="scale"?h(p[0]):A(p[0])}${n}"`}else{let p=$.replace(/,(?![^()]*\))/g," ").split(" ");return p.length>1?`${f}="${p.map(g=>w(g)?`[${g}]`:f==="scale"?h(g):A(g)).join(" ")}${n}"`:`${f}="${w(p[0])?`[${p[0]}]`:f==="scale"?h(p[0]):A(p[0])}${n}"`}}).filter(Boolean).join(" ")}function A(r){return r.endsWith("deg")?r.slice(0,-3):r}var it=["transition-delay","transition-duration"];function ar(r,o){let[t,n]=i(o);if(r==="transition-timing-function")return t==="linear"?`ease-${t}${n}`:`ease="[${t}]${n}"`;if(r==="transition")return`transition="${et(t)}"`;if(r==="transition-property")return t.includes("color")?`transition-color${n}`:t==="box-shadow"?`transition-shadow${n}`:`transition-${t}${n}`;if(it.includes(r))return`${r.split("-")[1]}-${t.slice(0,-2)}`}function et(r){let o=!1;return r.split(" ").map(t=>/^[0-9]/.test(t)||/^\.[0-9]/.test(t)?o?`delay${a(t,void 0,!0)}`:(o=!0,`duration${a(t,void 0,!0)}`):t==="background-color"?"colors":t).join(" ")}function mr(r,o){let[t,n]=i(o);return r==="justify-content"?`justify-${l(t)}${n}`:`${r}-${l(t)}${n}`}function pr(r,o){let[t,n]=i(o);return`${l(r)}-${l(t)}${n}`}var st=["flex-basis","flex-grow","flex-shrink"];function fr(r,o){let[t,n]=i(o);if(st.includes(r))return`${l(r)}-${t}${n}`;if(t==="1")return`flex-1${n}`;let e=t[0];return r==="flex"&&(e==="0"||e==="1")?`flex="[${W(t)}]${n}"`:`${c(r)}-${t.replace("column","col")}${n}`}function cr(r,o){let[t,n]=i(o);return t==="auto"?`${c(r)}-${t}`:`${c(r)}="[${t}]${n}"`}function lr(r,o){let[t,n]=i(o);return r==="column-gap"?`gap-x-${t}${n}`:`${r}-${t}${n}`}function ur(r,o){let[t,n]=i(o);return o==="isolate"?`${t}${n}`:`${r}-${t}${n}`}function $r(r,o){let[t,n]=i(o);return r==="object-position"?`${c(r)}-${I(t)}${n}`:`${c(r)}-${t}${n}`}function gr(r,o){let[t,n]=i(o),[e,s,m]=r.split("-");return m?`${e}-${m}-${t}${n}`:`${e}-${t}${n}`}function dr(r,o){let[t,n]=i(o);if(r.startsWith("grid-template")){let s=t.match(/repeat\s*\(\s*([0-9]+)/);return s?`grid-${l(r)==="rows"?"rows":"cols"}-${s[1]}${n}`:`grid-${l(r)==="rows"?"rows":"cols"}-${t}${n}`}if(r==="grid-auto-flow")return`grid-flow-${I(t).replace("column","col")}${n}`;if(r.startsWith("grid-auto")){let s=t.match(/minmax\s*\(\s*0\s*,\s*1fr/);return`auto-${l(r)==="rows"?"rows":"cols"}-${s?"fr":c(t)}${n}`}let e=t.match(/span\s+([0-9])/);return e?`${r.slice(5).replace("column","col")}-span-${e[1]}${n}`:t==="1/-1"?`${r.slice(5).replace("column","col")}-span-full${n}`:`${r.slice(5).replace("column","col")}-${t}${n}`}function xr(r,o){let[t,n]=i(o);return`gap-y-${t}${n}`}function br(r,o){let[t,n]=i(o);return`${r}-${l(t)}${n}`}function hr(r,o){let[t,n]=i(o);return`tracking-${t}${n}`}function wr(r,o){let[t,n]=i(o);return`whitespace-${t}${n}`}function Ir(r,o){let[t,n]=i(o);return r.startsWith("word-spacing")?`word-spacing${a(o)}`:t==="keep-all"?`break-keep${n}`:`break-${l(t)}${n}`}function vr(r,o){let[t,n]=i(o);return r==="outline-offset"?`${r}-${t}${n}`:`${c(r)}-${t}${n}`}function jr(r,o){let[t,n]=i(o);return`mix-blend-${t}${n}`}var at={vertical:"y",horizontal:"x"};function Wr(r,o){let[t,n]=i(o);return t==="both"?`${r}${n}`:`${r}-${at[t]||t}${n}`}function _r(r,o){let[t,n]=i(o);if(r.startsWith("scroll-snap"))return`snap-${t}${n}`;if(r==="scroll-behavior")return`scroll-${t}${n}`;let[e,s,m,f]=r.match(/scroll-(margin|padding)-?([\w]+)?-?([\w]+)?/);return m==="inline"&&f?`scroll-${s[0]}${f[0]}-${t}${n}`:m?`scroll-${s[0]}${m[0]}-${t}${n}`:`scroll-${s[0]}-${t}${n}`}function Vr(r,o){let[t,n]=i(o);return`${l(r)}-${t}${n}`}function Nr(r,o){let[t,n]=i(o);return`${r}-${c(t)}${n}`}function Lr(r,o){let[t,n]=i(o);return r==="animation-delay"?`animate${a(t)}${n}`:r==="animation"?`animate-${t.split(" ")[0]}${n}`:`animate-${t}${n}`}function Fr(r,o){let[t,n]=i(o);return t==='" "'||t==="' '"?`content-['_']${n}`:`content="[${t}]${n}"`}var mt={show:"visible",hide:"hidden"};function zr(r,o){var e;let[t,n]=i(o);return`table-empty-cells-${(e=mt[t])!=null?e:t}${n}`}function Cr(r,o){return o==="horizontal-tb"?"write-normal":`write-${o.replace("-rl","-right").replace("-lr","-left")}`}function Ur(r,o){let[t,n]=i(o);if(r==="inset-inline-start")return`start${a(t)}${n}`;if(r==="inset-inline-end")return`end${a(t)}${n}`}var J={animation:Lr,aspect:cr,backface:b,caption:b,column:lr,columns:x,break:x,empty:zr,box:S,writing:Cr,display:R,float:x,clear:x,isolation:ur,object:$r,overflow:x,overscroll:gr,position:R,top:_,left:_,right:_,bottom:_,visibility:R,z:C,flex:fr,order:x,grid:dr,gap:_,justify:mr,align:pr,place:br,padding:q,perspective:x,margin:q,width:C,min:Z,max:Z,height:C,font:X,letter:hr,line:or,list:b,text:rr,vertical:tr,white:wr,word:Ir,content:Fr,background:Q,border:ir,outline:vr,opacity:y,mix:jr,filter:T,backdrop:er,table:b,transition:ar,transform:sr,accent:b,appearance:b,cursor:Y,caret:b,pointer:x,resize:Wr,scroll:_r,inset:Ur,touch:b,user:Vr,will:Nr,fill:x,stroke:b,color:k,row:xr},pt=/([\w-]+)\s*:\s*([.\w\(\)-\s%+'",#\/!]+)/;function H(r,o=!1){var u;let t=r.match(pt);if(!t)return;let[n,e,s]=t,m=c(e),f=(u=J[m])==null?void 0:u.call(J,e,s);return f&&o?f.replace(/-([0-9\.]+)px/,($,p)=>`-${+p/4}`):f}function M(r,o){let t=[];return[r.split(";").filter(Boolean).reduce((n,e)=>{let s=H(e,o)||"";return s||t.push(e),n+=`${s} `},"").trim(),t]}function Rr(r,o=!1){let[t,n]=M(r,o);return[t?t.replace(/([^\s\=]+)="([^"]+)"/g,(e,s,m)=>m.split(" ").map(f=>`${s}-${f}`).join(" ")):"",n]}0&&(module.exports={cssMathFnRE,diffTemplateStyle,flag,getFirstName,getHundred,getLastName,getStyleScoped,getVal,isCalc,isColor,isEmptyStyle,isHex,isHsl,isNot,isPercent,isRgb,isSize,isUrl,isVar,joinEmpty,joinWithLine,joinWithUnderLine,numberWithUnitRE,toUnocss,toUnocssClass,transformImportant,transformStyleToUnocss,trim});
1
+ "use strict";var P=Object.defineProperty;var Sr=Object.getOwnPropertyDescriptor;var Tr=Object.getOwnPropertyNames;var Ar=Object.prototype.hasOwnProperty;var Hr=(r,o)=>{for(var t in o)P(r,t,{get:o[t],enumerable:!0})},Mr=(r,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of Tr(o))!Ar.call(r,e)&&e!==t&&P(r,e,{get:()=>o[e],enumerable:!(n=Sr(o,e))||n.enumerable});return r};var Pr=r=>Mr(P({},"__esModule",{value:!0}),r);var ft={};Hr(ft,{cssMathFnRE:()=>B,diffTemplateStyle:()=>Gr,flag:()=>Er,getFirstName:()=>c,getHundred:()=>h,getLastName:()=>l,getStyleScoped:()=>Zr,getVal:()=>a,isCalc:()=>j,isColor:()=>Jr,isEmptyStyle:()=>Dr,isHex:()=>V,isHsl:()=>N,isNot:()=>Br,isPercent:()=>z,isRgb:()=>d,isSize:()=>qr,isUrl:()=>O,isVar:()=>w,joinEmpty:()=>G,joinWithLine:()=>I,joinWithUnderLine:()=>W,numberWithUnitRE:()=>K,toUnocss:()=>H,toUnocssClass:()=>Rr,transformImportant:()=>i,transformStyleToUnocss:()=>M,trim:()=>E});module.exports=Pr(ft);var Er=".__unocss_transfer__",B=/^(?:calc|clamp|min|max)\s*\(.*\)/,K=/[0-9]+(px|rem|em|%|vw|vh|vmin|vmax|deg)/;function Br(r){return/\[&:not\(/.test(r)}function j(r){return B.test(r)}function c(r){return r.split("-")[0]}function l(r){let o=r.split("-");return o[o.length-1]}function O(r){return r.startsWith("url(")}function z(r){return r.endsWith("%")}function V(r){return/^#[0-9A-Fa-f]{2,}$/.test(r)}function d(r){return r.startsWith("rgb")}function N(r){return r.startsWith("hsl")}function a(r,o,t,n=""){return j(r)||O(r)||V(r)||d(r)||N(r)||z(r)||w(r)?t?`-[${n}${E(r,"all").replace(/['"]/g,"")}]`:`="[${n}${E(r,"all").replace(/['"]/g,"")}]"`:`-${o?o(r):r}`}function h(r){return typeof r=="string"&&r.endsWith("%")?r.slice(0,-1):+r*100}function I(r){return r.replace(/\s+/," ").split(" ").join("-")}function W(r){return r.replace(/\s+/," ").split(" ").join("_")}function E(r,o="around"){return o==="pre"?r.replace(/(^\s*)/g,""):o==="post"?r.replace(/(\s*$)/g,""):o==="all"?r.replace(/\s+/g,""):o==="around"?r.replace(/(^\s*)|(\s*$)/g,""):r}function i(r){return r=r.replace(/\s+/," ").replace(/\s*,\s*/g,",").replace(/\s*\/\s*/,"/"),/rgb/.test(r)&&(r=r.replace(/rgba?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/hsl/.test(r)&&(r=r.replace(/hsla?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/var\([^\)]+\)/.test(r)&&(r=r.replace(/var\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),r.endsWith("!important")?[r.replace(/\s*\!important/,"").trim(),"!"]:[r.trim(),""]}function Gr(r,o){let t=r.match(/<style scoped>.*<\/style>/s),n=o.match(/<style scoped>.*<\/style>/s);return t[0]===n[0]}function Dr(r){return/<style scoped>[\n\s]*<\/style>/.test(r)}function Zr(r){let o=r.match(/<style scoped>(.*)<\/style>/s);return o?o[1]:""}function G(r){return r.replace(/\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s*,\s*/g,",")}function w(r){return r.startsWith("var(--")}function qr(r){return B.test(r)||K.test(r)}function Jr(r){return V(r)||d(r)||N(r)}function C(r,o){let[t,n]=i(o);return`${r[0]}${a(t,c)}${n}`}var Kr=["background-color","background-attachment","background-position"],Or=/linear-gradient\(\s*to([\w\s]+),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Qr=/linear-gradient\(\s*([^,]*),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Xr=/(radial|conic)-gradient\(([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,v="__comma__";function Q(r,o){let[t,n]=i(o);if(r==="background-size")return`bg${a(t,U,!1,"length:")}${n}`;if(Kr.includes(r))return`bg${a(t,U)}${n}`;if(["background","background-image"].includes(r)){if(/^(linear)-gradient/.test(t)){let m=t.replace(/rgba?\(([^)]+)\)/g,($,p)=>$.replace(p,p.replace(/\s*,\s*/g,v))),f=m.match(Or);if(f){let[$,p,g,L]=f.slice(1);return $=$.split(" ").map(F=>F[0]).join(""),$?`bg-gradient-to-${$}${D(p,g,L)}`:D(p,g,L)}let u=m.match(Qr);return u?`bg-gradient-linear bg-gradient-[${u[1]},${u[2].replace(/\s+/,"_").replaceAll(v,",")},${u[3].replace(/\s+/,"_").replaceAll(v,",")}]`:void 0}else if(/^(radial|conic)-gradient/.test(t)){let f=t.replace(/rgba?\(([^)]+)\)/g,(L,F)=>L.replace(F,F.replace(/\s*,\s*/g,v))).match(Xr);if(!f)return;let u=f[1],[$,p,g]=f.slice(2);return`bg-gradient-${u}${D($,p,g)}`}let e=t.match(/rgba?\([^)]+\)/);if(e){let m=e[0];return`bg="${t.replace(m,`[${m}]`)}${n}"`}let s=t.match(/url\(["'\s\.\-_\w\/]*\)/);return s?`bg="${t.replace(s[0],`[${s[0].replace(/['"]/g,"")}]${n}`)}"`:`bg${a(t,U)}${n}`}return r==="background-blend-mode"?`bg-blend-${t}${n}`:`${Yr(r,t)}-${yr(t)}${n}`}function Yr(r,o){return o.endsWith("repeat")?"bg":r.replace("background","bg")}function yr(r){return/(border)|(content)|(padding)-box/.test(r)?r.replace("-box",""):r.startsWith("repeat-")?r.replace("repeat-",""):U(r)}function U(r){return r.replace(/\s+/," ").replace(" ","-")}function D(r,o,t){let n="";if(o&&!t&&(t=o,o=""),r){r=r.replaceAll(v,",");let[e,s]=r.split(" ");s?n+=` from="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` from="${d(e)?`[${e}]`:e}"`)}if(o){o=o.replaceAll(v,",");let[e,s]=o.split(" ");s?n+=` via="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` via="${d(e)?`[${e}]`:e}"`)}if(t){t=t.replaceAll(v,",");let[e,s]=t.split(" ");s?n+=` to="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` to="${d(e)?`[${e}]`:e}"`)}return n}function Z(r,o){let[t,n]=i(o),e=r.split("-"),s=j(t)||w(t)?a(t):a(c(t));return`${e[0]}-${e[1][0]}${s}${n}`}function X(r,o){let[t,n]=i(o);if(r==="font-size")return`text-${t}${n}`;if(r==="font-weight")return`font-${t}${n}`;if(r==="font-family"){let e=t.match(/ui-(\w{0,4})/);if(!e)return`font-${o}${n}`;let[s,m]=e;return`font-${m}${n}`}return r==="font-style"?t==="normal"?`font-not-italic${n}`:`font-${t}${n}`:r==="font-variant-numeric"?t==="normal"?`normal-nums${n}`:`${t}${n}`:`font="${kr(t)}${n}"`}function kr(r){return r.split(" ").map(o=>/^[0-9]/.test(o)?`text-${o}`:o).join(" ")}function Y(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}var rt={"margin-left":"ml","margin-right":"mr","margin-top":"mt","margin-bottom":"mb","margin-inline-start":"ms","margin-inline-end":"me","padding-left":"pl","padding-right":"pr","padding-top":"pt","padding-bottom":"pb","padding-inline-start":"ps","padding-inline-end":"pe"};function q(r,o){let[t,n]=i(o),e=rt[r];if(e)return`${e}${a(t)}${n}`;let s=t.split(" "),m=s.length;return m===1?`${r[0]}${a(s[0])}${n}`:m===2?`${r[0]}x${a(s[1])}${n} ${r[0]}y${a(s[0])}${n}`:m===3?`${r[0]}x${a(s[1])}${n} ${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n}`:`${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n} ${r[0]}l${a(s[3])}${n} ${r[0]}r${a(s[1])}${n}`}function y(r,o){let[t,n]=i(o);return z(o)?`op-${t.replace("%","")}${n}`:`op-${+t*100}${n}`}function k(r,o){let[t,n]=i(o);return`text${a(t)}${n}`}function rr(r,o){let[t,n]=i(o);return r==="text-decoration-line"?t==="none"?`no-underline${n}`:`${t}${n}`:r==="text-transform"?t==="none"?`normal-case${n}`:`${t}${n}`:r.startsWith("text-decoration")||r==="text-indent"?`${r.split("-")[1]}${a(t)}${n}`:r==="text-underline-offset"?`underline-offset-${t}${n}`:`text-${t}${n}`}function tr(r,o){let[t,n]=i(o);return`v-${t}${n}`}var nr={1:"none",1.25:"tight",1.375:"snug",1.5:"normal",1.625:"relaxed",2:"loose"};function or(r,o){let[t,n]=i(o);return t in nr?`lh-${nr[t]}${n}`:`lh${a(t)}${n}`}var tt=["border-left","border-top","border-right","border-bottom"];function ir(r,o){let[t,n]=i(o);if(r==="border-spacing")return`${r}="[${W(t)}]${n}"`;if(r==="border-color"){if(t.includes(" ")){let e=t.split(" ").length,s=t.split(" ").map(p=>V(p)||d(p)||N(p)?`-[${p}]`:`-${p}`),[m,f,u,$]=s;switch(e){case 2:return`border-y${m}${n} border-x${f}${n}`;case 3:return`border-t${m}${n} border-b${u}${n} border-x${f}${n}`;case 4:return`border-t${m}${n} border-b${u}${n} border-r${f}${n} border-l${$}${n}`}}return`border${a(t)}${n}`}return r==="border-radius"?j(t)||!t.includes(" ")?`border-rd${a(t)}${n}`:`border-rd="[${W(t)}]${n}"`:tt.some(e=>r.startsWith(e))?t.split(" ").map(e=>`border-${r.split("-")[1][0]}${a(e)}${n}`).join(" "):r==="border-inline-end-width"?`border-e${a(t)}${n}`:r==="border-inline-start-width"?`border-s${a(t)}${n}`:r.startsWith("border-image")?"":/^\d[%|(px)|(rem)]$/.test(t)||r==="border-collapse"?`border-${t}${n}`:r==="border-width"||r==="border-style"?`border${a(t)}${n}`:r==="border-color"?t==="currentColor"?`border-current${n}`:`border${a(t)}${n}`:t.split(" ").map(e=>t==="currentColor"?`border-current${n}`:`border${a(e)}${n}`).join(" ")}function R(r,o){let[t,n]=i(o);return t==="none"?`hidden${n}`:t==="hidden"?`invisible${n}`:`${t}${n}`}function x(r,o){let[t,n]=i(o);return`${r}-${t}${n}`}function _(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}function b(r,o){let[t,n]=i(o);return`${c(r)}${a(t)}${n}`}function S(r,o){let[t,n]=i(o);return r.startsWith("box-decoration")?`box-decoration-${t}${n}`:r==="box-sizing"?`box-${c(t)}${n}`:`shadow="[${t.split(" ").join("_")}]${n}"`}var nt=["contrast","brightness","saturate"],ot=["grayscale","invert","sepia"];function T(r,o){let[t,n]=i(o),[e,s,m]=t.match(/([\w-]+)\((.*)\)/);return nt.includes(s)?`${s}-${h(m)}${n}`:s==="drop-shadow"?`drop-${S(s,m)}${n}`:ot.includes(s)?`${s}-${m.endsWith("%")?m.slice(0,-1):h(m)}${n}`:s==="hue-rotate"?`${s}-${m.slice(0,-3)}${n}`:`${s}-${m}${n}`}function er(r,o){let[t,n]=i(o);return`backdrop-${T(r,t)}${n}`}function sr(r,o){let[t,n]=i(o);return r==="transform-origin"?`origin-${I(t)}${n}`:r==="transform-style"?`transform-${t}`:G(t).split(" ").map(e=>{let s=e.match(/([a-z]+)([A-Z])?\((.*)\)/);if(!s)return;let[m,f,u,$]=s;if(u){let p=$.replace(/,(?![^()]*\))/g," ").split(" ");return p.length>1?`${f}-${u.toLowerCase()}="${p.map(g=>w(g)?`[${g}]`:f==="scale"?h(g):A(g)).join(" ")}${n}"`:`${f}="${u.toLowerCase()}-${w(p[0])?`[${p[0]}]`:f==="scale"?h(p[0]):A(p[0])}${n}"`}else{let p=$.replace(/,(?![^()]*\))/g," ").split(" ");return p.length>1?`${f}="${p.map(g=>w(g)?`[${g}]`:f==="scale"?h(g):A(g)).join(" ")}${n}"`:`${f}="${w(p[0])?`[${p[0]}]`:f==="scale"?h(p[0]):A(p[0])}${n}"`}}).filter(Boolean).join(" ")}function A(r){return r.endsWith("deg")?r.slice(0,-3):r}var it=["transition-delay","transition-duration"];function ar(r,o){let[t,n]=i(o);if(r==="transition-timing-function")return t==="linear"?`ease-${t}${n}`:`ease="[${t}]${n}"`;if(r==="transition")return`transition="${et(t)}"`;if(r==="transition-property")return t.includes("color")?`transition-color${n}`:t==="box-shadow"?`transition-shadow${n}`:`transition-${t}${n}`;if(it.includes(r))return`${r.split("-")[1]}-${t.slice(0,-2)}`}function et(r){let o=!1;return r.split(" ").map(t=>/^[0-9]/.test(t)||/^\.[0-9]/.test(t)?o?`delay${a(t,void 0,!0)}`:(o=!0,`duration${a(t,void 0,!0)}`):t==="background-color"?"colors":t).join(" ")}function mr(r,o){let[t,n]=i(o);return r==="justify-content"?`justify-${l(t)}${n}`:`${r}-${l(t)}${n}`}function pr(r,o){let[t,n]=i(o);return`${l(r)}-${l(t)}${n}`}var st=["flex-basis","flex-grow","flex-shrink"];function fr(r,o){let[t,n]=i(o);if(st.includes(r))return`${l(r)}-${t}${n}`;if(t==="1")return`flex-1${n}`;let e=t[0];return r==="flex"&&(e==="0"||e==="1")?`flex="[${W(t)}]${n}"`:`${c(r)}-${t.replace("column","col")}${n}`}function cr(r,o){let[t,n]=i(o);return t==="auto"?`${c(r)}-${t}`:`${c(r)}="[${t}]${n}"`}function lr(r,o){let[t,n]=i(o);return r==="column-gap"?`gap-x-${t}${n}`:`${r}-${t}${n}`}function ur(r,o){let[t,n]=i(o);return o==="isolate"?`${t}${n}`:`${r}-${t}${n}`}function $r(r,o){let[t,n]=i(o);return r==="object-position"?`${c(r)}-${I(t)}${n}`:`${c(r)}-${t}${n}`}function gr(r,o){let[t,n]=i(o),[e,s,m]=r.split("-");return m?`${e}-${m}-${t}${n}`:`${e}-${t}${n}`}function dr(r,o){let[t,n]=i(o);if(r.startsWith("grid-template")){let s=t.match(/repeat\s*\(\s*([0-9]+)/);return s?`grid-${l(r)==="rows"?"rows":"cols"}-${s[1]}${n}`:`grid-${l(r)==="rows"?"rows":"cols"}-${t}${n}`}if(r==="grid-auto-flow")return`grid-flow-${I(t).replace("column","col")}${n}`;if(r.startsWith("grid-auto")){let s=t.match(/minmax\s*\(\s*0\s*,\s*1fr/);return`auto-${l(r)==="rows"?"rows":"cols"}-${s?"fr":c(t)}${n}`}let e=t.match(/span\s+([0-9])/);return e?`${r.slice(5).replace("column","col")}-span-${e[1]}${n}`:t==="1/-1"?`${r.slice(5).replace("column","col")}-span-full${n}`:`${r.slice(5).replace("column","col")}-${t}${n}`}function xr(r,o){let[t,n]=i(o);return`gap-y-${t}${n}`}function br(r,o){let[t,n]=i(o);return`${r}-${l(t)}${n}`}function hr(r,o){let[t,n]=i(o);return`tracking-${t}${n}`}function wr(r,o){let[t,n]=i(o);return`whitespace-${t}${n}`}function Ir(r,o){let[t,n]=i(o);return r.startsWith("word-spacing")?`word-spacing${a(o)}`:t==="keep-all"?`break-keep${n}`:`break-${l(t)}${n}`}function vr(r,o){let[t,n]=i(o);return r==="outline-offset"?`${r}-${t}${n}`:`${c(r)}-${t}${n}`}function jr(r,o){let[t,n]=i(o);return`mix-blend-${t}${n}`}var at={vertical:"y",horizontal:"x"};function Wr(r,o){let[t,n]=i(o);return t==="both"?`${r}${n}`:`${r}-${at[t]||t}${n}`}function _r(r,o){let[t,n]=i(o);if(r.startsWith("scroll-snap"))return`snap-${t}${n}`;if(r==="scroll-behavior")return`scroll-${t}${n}`;let[e,s,m,f]=r.match(/scroll-(margin|padding)-?([\w]+)?-?([\w]+)?/);return m==="inline"&&f?`scroll-${s[0]}${f[0]}-${t}${n}`:m?`scroll-${s[0]}${m[0]}-${t}${n}`:`scroll-${s[0]}-${t}${n}`}function Vr(r,o){let[t,n]=i(o);return`${l(r)}-${t}${n}`}function Nr(r,o){let[t,n]=i(o);return`${r}-${c(t)}${n}`}function Lr(r,o){let[t,n]=i(o);return r==="animation-delay"?`animate${a(t)}${n}`:r==="animation"?`animate-${t.split(" ")[0]}${n}`:`animate-${t}${n}`}function Fr(r,o){let[t,n]=i(o);return t==='" "'||t==="' '"?`content-['_']${n}`:`content="[${t}]${n}"`}var mt={show:"visible",hide:"hidden"};function zr(r,o){var e;let[t,n]=i(o);return`table-empty-cells-${(e=mt[t])!=null?e:t}${n}`}function Cr(r,o){return o==="horizontal-tb"?"write-normal":`write-${o.replace("-rl","-right").replace("-lr","-left")}`}function Ur(r,o){let[t,n]=i(o);if(r==="inset-inline-start")return`start${a(t)}${n}`;if(r==="inset-inline-end")return`end${a(t)}${n}`}var J={animation:Lr,aspect:cr,backface:b,caption:b,column:lr,columns:x,break:x,empty:zr,box:S,writing:Cr,display:R,float:x,clear:x,isolation:ur,object:$r,overflow:x,overscroll:gr,position:R,top:_,left:_,right:_,bottom:_,visibility:R,z:C,flex:fr,order:x,grid:dr,gap:_,justify:mr,align:pr,place:br,padding:q,perspective:x,margin:q,width:C,min:Z,max:Z,height:C,font:X,letter:hr,line:or,list:b,text:rr,vertical:tr,white:wr,word:Ir,content:Fr,background:Q,border:ir,outline:vr,opacity:y,mix:jr,filter:T,backdrop:er,table:b,transition:ar,transform:sr,accent:b,appearance:b,cursor:Y,caret:b,pointer:x,resize:Wr,scroll:_r,inset:Ur,touch:b,user:Vr,will:Nr,fill:x,stroke:b,color:k,row:xr},pt=/([\w-]+)\s*:\s*([.\w\(\)-\s%+'",#\/!]+)/;function H(r,o=!1){var u;let t=r.match(pt);if(!t)return;let[n,e,s]=t,m=c(e),f=(u=J[m])==null?void 0:u.call(J,e,s);return f&&o?f.replace(/-([0-9\.]+)px/,($,p)=>`-${+p/4}`):f}function M(r,o){let t=[];return[r.split(";").filter(Boolean).reduce((n,e)=>{let s=H(e,o)||"";return s||t.push(e),n+=`${s} `},"").trim(),t]}function Rr(r,o=!1){let[t,n]=M(r,o);return[t?t.replace(/([^\s\=]+)="([^"]+)"/g,(e,s,m)=>m.split(" ").map(f=>`${s}-${f}`).join(" ")):"",n]}0&&(module.exports={cssMathFnRE,diffTemplateStyle,flag,getFirstName,getHundred,getLastName,getStyleScoped,getVal,isCalc,isColor,isEmptyStyle,isHex,isHsl,isNot,isPercent,isRgb,isSize,isUrl,isVar,joinEmpty,joinWithLine,joinWithUnderLine,numberWithUnitRE,toUnocss,toUnocssClass,transformImportant,transformStyleToUnocss,trim});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var Xr=".__unocss_transfer__",Z=/^(?:calc|clamp|min|max)\s*\(.*\)/,zr=/[0-9]+(px|rem|em|%|vw|vh|vmin|vmax|deg)/;function Yr(r){return/\[&:not\(/.test(r)}function W(r){return Z.test(r)}function c(r){return r.split("-")[0]}function l(r){let o=r.split("-");return o[o.length-1]}function Cr(r){return r.startsWith("url(")}function A(r){return r.endsWith("%")}function L(r){return/^#[0-9A-Fa-f]{2,}$/.test(r)}function d(r){return r.startsWith("rgb")}function F(r){return r.startsWith("hsl")}function a(r,o,t,n=""){return W(r)||Cr(r)||L(r)||d(r)||F(r)||A(r)||w(r)?t?`-[${n}${D(r,"all").replace(/['"]/g,"")}]`:`="[${n}${D(r,"all").replace(/['"]/g,"")}]"`:`-${o?o(r):r}`}function h(r){return typeof r=="string"&&r.endsWith("%")?r.slice(0,-1):+r*100}function v(r){return r.replace(/\s+/," ").split(" ").join("-")}function _(r){return r.replace(/\s+/," ").split(" ").join("_")}function D(r,o="around"){return o==="pre"?r.replace(/(^\s*)/g,""):o==="post"?r.replace(/(\s*$)/g,""):o==="all"?r.replace(/\s+/g,""):o==="around"?r.replace(/(^\s*)|(\s*$)/g,""):r}function i(r){return r=r.replace(/\s+/," ").replace(/\s*,\s*/g,",").replace(/\s*\/\s*/,"/"),/rgb/.test(r)&&(r=r.replace(/rgba?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/hsl/.test(r)&&(r=r.replace(/hsla?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/var\([^\)]+\)/.test(r)&&(r=r.replace(/var\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),r.endsWith("!important")?[r.replace(/\s*\!important/,"").trim(),"!"]:[r.trim(),""]}function yr(r,o){let t=r.match(/<style scoped>.*<\/style>/s),n=o.match(/<style scoped>.*<\/style>/s);return t[0]===n[0]}function kr(r){return/<style scoped>[\n\s]*<\/style>/.test(r)}function rt(r){let o=r.match(/<style scoped>(.*)<\/style>/s);return o?o[1]:""}function q(r){return r.replace(/\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s*,\s*/g,",")}function w(r){return r.startsWith("var(--")}function tt(r){return Z.test(r)||zr.test(r)}function nt(r){return L(r)||d(r)||F(r)}function z(r,o){let[t,n]=i(o);return`${r[0]}${a(t,c)}${n}`}var Ur=["background-color","background-attachment","background-position"],Rr=/linear-gradient\(\s*to([\w\s]+),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Sr=/linear-gradient\(\s*([^,]*),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Tr=/(radial|conic)-gradient\(([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,I="__comma__";function J(r,o){let[t,n]=i(o);if(r==="background-size")return`bg${a(t,C,!1,"length:")}${n}`;if(Ur.includes(r))return`bg${a(t,C)}${n}`;if(["background","background-image"].includes(r)){if(/(linear)-gradient/.test(t)){let m=t.replace(/rgba?\(([^)]+)\)/g,($,p)=>$.replace(p,p.replace(/\s*,\s*/g,I))),f=m.match(Rr);if(f){let[$,p,g,V]=f.slice(1);return $=$.split(" ").map(N=>N[0]).join(""),$?`bg-gradient-to-${$}${H(p,g,V)}`:H(p,g,V)}let u=m.match(Sr);return u?`bg-gradient-linear bg-gradient-[${u[1]},${u[2].replace(/\s+/,"_").replaceAll(I,",")},${u[3].replace(/\s+/,"_").replaceAll(I,",")}]`:void 0}else if(/(radial|conic)-gradient/.test(t)){let f=t.replace(/rgba?\(([^)]+)\)/g,(V,N)=>V.replace(N,N.replace(/\s*,\s*/g,I))).match(Tr);if(!f)return;let u=f[1],[$,p,g]=f.slice(2);return`bg-gradient-${u}${H($,p,g)}`}let e=t.match(/rgba?\([^)]+\)/);if(e){let m=e[0];return`bg="${t.replace(m,`[${m}]`)}${n}"`}let s=t.match(/url\(["'\s\.\-_\w\/]*\)/);return s?`bg="${t.replace(s[0],`[${s[0].replace(/['"]/g,"")}]${n}`)}"`:`bg${a(t,C)}${n}`}return r==="background-blend-mode"?`bg-blend-${t}${n}`:`${Ar(r,t)}-${Hr(t)}${n}`}function Ar(r,o){return o.endsWith("repeat")?"bg":r.replace("background","bg")}function Hr(r){return/(border)|(content)|(padding)-box/.test(r)?r.replace("-box",""):r.startsWith("repeat-")?r.replace("repeat-",""):C(r)}function C(r){return r.replace(/\s+/," ").replace(" ","-")}function H(r,o,t){let n="";if(o&&!t&&(t=o,o=""),r){r=r.replaceAll(I,",");let[e,s]=r.split(" ");s?n+=` from="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` from="${d(e)?`[${e}]`:e}"`)}if(o){o=o.replaceAll(I,",");let[e,s]=o.split(" ");s?n+=` via="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` via="${d(e)?`[${e}]`:e}"`)}if(t){t=t.replaceAll(I,",");let[e,s]=t.split(" ");s?n+=` to="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` to="${d(e)?`[${e}]`:e}"`)}return n}function M(r,o){let[t,n]=i(o),e=r.split("-"),s=W(t)||w(t)?a(t):a(c(t));return`${e[0]}-${e[1][0]}${s}${n}`}function K(r,o){let[t,n]=i(o);if(r==="font-size")return`text-${t}${n}`;if(r==="font-weight")return`font-${t}${n}`;if(r==="font-family"){let e=t.match(/ui-(\w{0,4})/);if(!e)return`font-${o}${n}`;let[s,m]=e;return`font-${m}${n}`}return r==="font-style"?t==="normal"?`font-not-italic${n}`:`font-${t}${n}`:r==="font-variant-numeric"?t==="normal"?`normal-nums${n}`:`${t}${n}`:`font="${Mr(t)}${n}"`}function Mr(r){return r.split(" ").map(o=>/^[0-9]/.test(o)?`text-${o}`:o).join(" ")}function O(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}var Pr={"margin-left":"ml","margin-right":"mr","margin-top":"mt","margin-bottom":"mb","margin-inline-start":"ms","margin-inline-end":"me","padding-left":"pl","padding-right":"pr","padding-top":"pt","padding-bottom":"pb","padding-inline-start":"ps","padding-inline-end":"pe"};function P(r,o){let[t,n]=i(o),e=Pr[r];if(e)return`${e}${a(t)}${n}`;let s=t.split(" "),m=s.length;return m===1?`${r[0]}${a(s[0])}${n}`:m===2?`${r[0]}x${a(s[1])}${n} ${r[0]}y${a(s[0])}${n}`:m===3?`${r[0]}x${a(s[1])}${n} ${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n}`:`${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n} ${r[0]}l${a(s[3])}${n} ${r[0]}r${a(s[1])}${n}`}function Q(r,o){let[t,n]=i(o);return A(o)?`op-${t.replace("%","")}${n}`:`op-${+t*100}${n}`}function X(r,o){let[t,n]=i(o);return`text${a(t)}${n}`}function Y(r,o){let[t,n]=i(o);return r==="text-decoration-line"?t==="none"?`no-underline${n}`:`${t}${n}`:r==="text-transform"?t==="none"?`normal-case${n}`:`${t}${n}`:r.startsWith("text-decoration")||r==="text-indent"?`${r.split("-")[1]}${a(t)}${n}`:r==="text-underline-offset"?`underline-offset-${t}${n}`:`text-${t}${n}`}function y(r,o){let[t,n]=i(o);return`v-${t}${n}`}var k={1:"none",1.25:"tight",1.5:"normal",1.625:"relaxed",1.375:"snug"};function rr(r,o){let[t,n]=i(o);return t in k?`lh-${k[t]}${n}`:`lh${a(t)}${n}`}var Er=["border-left","border-top","border-right","border-bottom"];function tr(r,o){let[t,n]=i(o);if(r==="border-spacing")return`${r}="[${_(t)}]${n}"`;if(r==="border-color"){if(t.includes(" ")){let e=t.split(" ").length,s=t.split(" ").map(p=>L(p)||d(p)||F(p)?`-[${p}]`:`-${p}`),[m,f,u,$]=s;switch(e){case 2:return`border-y${m}${n} border-x${f}${n}`;case 3:return`border-t${m}${n} border-b${u}${n} border-x${f}${n}`;case 4:return`border-t${m}${n} border-b${u}${n} border-r${f}${n} border-l${$}${n}`}}return`border${a(t)}${n}`}return r==="border-radius"?W(t)||!t.includes(" ")?`border-rd${a(t)}${n}`:`border-rd="[${_(t)}]${n}"`:Er.some(e=>r.startsWith(e))?t.split(" ").map(e=>`border-${r.split("-")[1][0]}${a(e)}${n}`).join(" "):r==="border-inline-end-width"?`border-e${a(t)}${n}`:r==="border-inline-start-width"?`border-s${a(t)}${n}`:r.startsWith("border-image")?"":/^\d[%|(px)|(rem)]$/.test(t)||r==="border-collapse"?`border-${t}${n}`:r==="border-width"||r==="border-style"?`border${a(t)}${n}`:r==="border-color"?t==="currentColor"?`border-current${n}`:`border${a(t)}${n}`:t.split(" ").map(e=>t==="currentColor"?`border-current${n}`:`border${a(e)}${n}`).join(" ")}function U(r,o){let[t,n]=i(o);return t==="none"?`hidden${n}`:t==="hidden"?`invisible${n}`:`${t}${n}`}function x(r,o){let[t,n]=i(o);return`${r}-${t}${n}`}function j(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}function b(r,o){let[t,n]=i(o);return`${c(r)}${a(t)}${n}`}function R(r,o){let[t,n]=i(o);return r.startsWith("box-decoration")?`box-decoration-${t}${n}`:r==="box-sizing"?`box-${c(t)}${n}`:`shadow="[${t.split(" ").join("_")}]${n}"`}var Br=["contrast","brightness","saturate"],Gr=["grayscale","invert","sepia"];function S(r,o){let[t,n]=i(o),[e,s,m]=t.match(/([\w-]+)\((.*)\)/);return Br.includes(s)?`${s}-${h(m)}${n}`:s==="drop-shadow"?`drop-${R(s,m)}${n}`:Gr.includes(s)?`${s}-${m.endsWith("%")?m.slice(0,-1):h(m)}${n}`:s==="hue-rotate"?`${s}-${m.slice(0,-3)}${n}`:`${s}-${m}${n}`}function nr(r,o){let[t,n]=i(o);return`backdrop-${S(r,t)}${n}`}function or(r,o){let[t,n]=i(o);return r==="transform-origin"?`origin-${v(t)}${n}`:r==="transform-style"?`transform-${t}`:q(t).split(" ").map(e=>{let s=e.match(/([a-z]+)([A-Z])?\((.*)\)/);if(!s)return;let[m,f,u,$]=s;if(u){let p=$.replace(/,(?![^()]*\))/g," ").split(" ");return p.length>1?`${f}-${u.toLowerCase()}="${p.map(g=>w(g)?`[${g}]`:f==="scale"?h(g):T(g)).join(" ")}${n}"`:`${f}="${u.toLowerCase()}-${w(p[0])?`[${p[0]}]`:f==="scale"?h(p[0]):T(p[0])}${n}"`}else{let p=$.replace(/,(?![^()]*\))/g," ").split(" ");return p.length>1?`${f}="${p.map(g=>w(g)?`[${g}]`:f==="scale"?h(g):T(g)).join(" ")}${n}"`:`${f}="${w(p[0])?`[${p[0]}]`:f==="scale"?h(p[0]):T(p[0])}${n}"`}}).filter(Boolean).join(" ")}function T(r){return r.endsWith("deg")?r.slice(0,-3):r}var Dr=["transition-delay","transition-duration"];function ir(r,o){let[t,n]=i(o);if(r==="transition-timing-function")return t==="linear"?`ease-${t}${n}`:`ease="[${t}]${n}"`;if(r==="transition")return`transition="${Zr(t)}"`;if(r==="transition-property")return t.includes("color")?`transition-color${n}`:t==="box-shadow"?`transition-shadow${n}`:`transition-${t}${n}`;if(Dr.includes(r))return`${r.split("-")[1]}-${t.slice(0,-2)}`}function Zr(r){let o=!1;return r.split(" ").map(t=>/^[0-9]/.test(t)||/^\.[0-9]/.test(t)?o?`delay${a(t,void 0,!0)}`:(o=!0,`duration${a(t,void 0,!0)}`):t==="background-color"?"colors":t).join(" ")}function er(r,o){let[t,n]=i(o);return r==="justify-content"?`justify-${l(t)}${n}`:`${r}-${l(t)}${n}`}function sr(r,o){let[t,n]=i(o);return`${l(r)}-${l(t)}${n}`}var qr=["flex-basis","flex-grow","flex-shrink"];function ar(r,o){let[t,n]=i(o);if(qr.includes(r))return`${l(r)}-${t}${n}`;if(t==="1")return`flex-1${n}`;let e=t[0];return r==="flex"&&(e==="0"||e==="1")?`flex="[${_(t)}]${n}"`:`${c(r)}-${t.replace("column","col")}${n}`}function mr(r,o){let[t,n]=i(o);return t==="auto"?`${c(r)}-${t}`:`${c(r)}="[${t}]${n}"`}function pr(r,o){let[t,n]=i(o);return r==="column-gap"?`gap-x-${t}${n}`:`${r}-${t}${n}`}function fr(r,o){let[t,n]=i(o);return o==="isolate"?`${t}${n}`:`${r}-${t}${n}`}function cr(r,o){let[t,n]=i(o);return r==="object-position"?`${c(r)}-${v(t)}${n}`:`${c(r)}-${t}${n}`}function lr(r,o){let[t,n]=i(o),[e,s,m]=r.split("-");return m?`${e}-${m}-${t}${n}`:`${e}-${t}${n}`}function ur(r,o){let[t,n]=i(o);if(r.startsWith("grid-template")){let s=t.match(/repeat\s*\(\s*([0-9]+)/);return s?`grid-${l(r)==="rows"?"rows":"cols"}-${s[1]}${n}`:`grid-${l(r)==="rows"?"rows":"cols"}-${t}${n}`}if(r==="grid-auto-flow")return`grid-flow-${v(t).replace("column","col")}${n}`;if(r.startsWith("grid-auto")){let s=t.match(/minmax\s*\(\s*0\s*,\s*1fr/);return`auto-${l(r)==="rows"?"rows":"cols"}-${s?"fr":c(t)}${n}`}let e=t.match(/span\s+([0-9])/);return e?`${r.slice(5).replace("column","col")}-span-${e[1]}${n}`:t==="1/-1"?`${r.slice(5).replace("column","col")}-span-full${n}`:`${r.slice(5).replace("column","col")}-${t}${n}`}function $r(r,o){let[t,n]=i(o);return`gap-y-${t}${n}`}function gr(r,o){let[t,n]=i(o);return`${r}-${l(t)}${n}`}function dr(r,o){let[t,n]=i(o);return`tracking-${t}${n}`}function xr(r,o){let[t,n]=i(o);return`whitespace-${t}${n}`}function br(r,o){let[t,n]=i(o);return r.startsWith("word-spacing")?`word-spacing${a(o)}`:t==="keep-all"?`break-keep${n}`:`break-${l(t)}${n}`}function hr(r,o){let[t,n]=i(o);return r==="outline-offset"?`${r}-${t}${n}`:`${c(r)}-${t}${n}`}function wr(r,o){let[t,n]=i(o);return`mix-blend-${t}${n}`}var Jr={vertical:"y",horizontal:"x"};function Ir(r,o){let[t,n]=i(o);return t==="both"?`${r}${n}`:`${r}-${Jr[t]||t}${n}`}function vr(r,o){let[t,n]=i(o);if(r.startsWith("scroll-snap"))return`snap-${t}${n}`;if(r==="scroll-behavior")return`scroll-${t}${n}`;let[e,s,m,f]=r.match(/scroll-(margin|padding)-?([\w]+)?-?([\w]+)?/);return m==="inline"&&f?`scroll-${s[0]}${f[0]}-${t}${n}`:m?`scroll-${s[0]}${m[0]}-${t}${n}`:`scroll-${s[0]}-${t}${n}`}function jr(r,o){let[t,n]=i(o);return`${l(r)}-${t}${n}`}function Wr(r,o){let[t,n]=i(o);return`${r}-${c(t)}${n}`}function _r(r,o){let[t,n]=i(o);return r==="animation-delay"?`animate${a(t)}${n}`:r==="animation"?`animate-${t.split(" ")[0]}${n}`:`animate-${t}${n}`}function Vr(r,o){let[t,n]=i(o);return t==='" "'||t==="' '"?`content-['_']${n}`:`content="[${t}]${n}"`}var Kr={show:"visible",hide:"hidden"};function Nr(r,o){var e;let[t,n]=i(o);return`table-empty-cells-${(e=Kr[t])!=null?e:t}${n}`}function Lr(r,o){return o==="horizontal-tb"?"write-normal":`write-${o.replace("-rl","-right").replace("-lr","-left")}`}function Fr(r,o){let[t,n]=i(o);if(r==="inset-inline-start")return`start${a(t)}${n}`;if(r==="inset-inline-end")return`end${a(t)}${n}`}var E={animation:_r,aspect:mr,backface:b,caption:b,column:pr,columns:x,break:x,empty:Nr,box:R,writing:Lr,display:U,float:x,clear:x,isolation:fr,object:cr,overflow:x,overscroll:lr,position:U,top:j,left:j,right:j,bottom:j,visibility:U,z,flex:ar,order:x,grid:ur,gap:j,justify:er,align:sr,place:gr,padding:P,perspective:x,margin:P,width:z,min:M,max:M,height:z,font:K,letter:dr,line:rr,list:b,text:Y,vertical:y,white:xr,word:br,content:Vr,background:J,border:tr,outline:hr,opacity:Q,mix:wr,filter:S,backdrop:nr,table:b,transition:ir,transform:or,accent:b,appearance:b,cursor:O,caret:b,pointer:x,resize:Ir,scroll:vr,inset:Fr,touch:b,user:jr,will:Wr,fill:x,stroke:b,color:X,row:$r},Or=/([\w-]+)\s*:\s*([.\w\(\)-\s%+'",#\/!]+)/;function B(r,o=!1){var u;let t=r.match(Or);if(!t)return;let[n,e,s]=t,m=c(e),f=(u=E[m])==null?void 0:u.call(E,e,s);return f&&o?f.replace(/-([0-9\.]+)px/,($,p)=>`-${+p/4}`):f}function G(r,o){let t=[];return[r.split(";").filter(Boolean).reduce((n,e)=>{let s=B(e,o)||"";return s||t.push(e),n+=`${s} `},"").trim(),t]}function Qr(r,o=!1){let[t,n]=G(r,o);return[t?t.replace(/([^\s\=]+)="([^"]+)"/g,(e,s,m)=>m.split(" ").map(f=>`${s}-${f}`).join(" ")):"",n]}export{Z as cssMathFnRE,yr as diffTemplateStyle,Xr as flag,c as getFirstName,h as getHundred,l as getLastName,rt as getStyleScoped,a as getVal,W as isCalc,nt as isColor,kr as isEmptyStyle,L as isHex,F as isHsl,Yr as isNot,A as isPercent,d as isRgb,tt as isSize,Cr as isUrl,w as isVar,q as joinEmpty,v as joinWithLine,_ as joinWithUnderLine,zr as numberWithUnitRE,B as toUnocss,Qr as toUnocssClass,i as transformImportant,G as transformStyleToUnocss,D as trim};
1
+ var Xr=".__unocss_transfer__",Z=/^(?:calc|clamp|min|max)\s*\(.*\)/,zr=/[0-9]+(px|rem|em|%|vw|vh|vmin|vmax|deg)/;function Yr(r){return/\[&:not\(/.test(r)}function W(r){return Z.test(r)}function c(r){return r.split("-")[0]}function l(r){let o=r.split("-");return o[o.length-1]}function Cr(r){return r.startsWith("url(")}function A(r){return r.endsWith("%")}function L(r){return/^#[0-9A-Fa-f]{2,}$/.test(r)}function d(r){return r.startsWith("rgb")}function F(r){return r.startsWith("hsl")}function a(r,o,t,n=""){return W(r)||Cr(r)||L(r)||d(r)||F(r)||A(r)||w(r)?t?`-[${n}${D(r,"all").replace(/['"]/g,"")}]`:`="[${n}${D(r,"all").replace(/['"]/g,"")}]"`:`-${o?o(r):r}`}function h(r){return typeof r=="string"&&r.endsWith("%")?r.slice(0,-1):+r*100}function v(r){return r.replace(/\s+/," ").split(" ").join("-")}function _(r){return r.replace(/\s+/," ").split(" ").join("_")}function D(r,o="around"){return o==="pre"?r.replace(/(^\s*)/g,""):o==="post"?r.replace(/(\s*$)/g,""):o==="all"?r.replace(/\s+/g,""):o==="around"?r.replace(/(^\s*)|(\s*$)/g,""):r}function i(r){return r=r.replace(/\s+/," ").replace(/\s*,\s*/g,",").replace(/\s*\/\s*/,"/"),/rgb/.test(r)&&(r=r.replace(/rgba?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/hsl/.test(r)&&(r=r.replace(/hsla?\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),/var\([^\)]+\)/.test(r)&&(r=r.replace(/var\(([^\)]+)\)/g,(o,t)=>{let n=t.trim().split(" ");return o.replace(t,n.map((e,s)=>e.endsWith(",")?e:e+(n.length-1===s?"":",")).join(""))})),r.endsWith("!important")?[r.replace(/\s*\!important/,"").trim(),"!"]:[r.trim(),""]}function yr(r,o){let t=r.match(/<style scoped>.*<\/style>/s),n=o.match(/<style scoped>.*<\/style>/s);return t[0]===n[0]}function kr(r){return/<style scoped>[\n\s]*<\/style>/.test(r)}function rt(r){let o=r.match(/<style scoped>(.*)<\/style>/s);return o?o[1]:""}function q(r){return r.replace(/\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s*,\s*/g,",")}function w(r){return r.startsWith("var(--")}function tt(r){return Z.test(r)||zr.test(r)}function nt(r){return L(r)||d(r)||F(r)}function z(r,o){let[t,n]=i(o);return`${r[0]}${a(t,c)}${n}`}var Ur=["background-color","background-attachment","background-position"],Rr=/linear-gradient\(\s*to([\w\s]+),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Sr=/linear-gradient\(\s*([^,]*),?([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,Tr=/(radial|conic)-gradient\(([\w\(\)#%\s\.]+)?,([\w\(\)#%\s\.]+)?,?([\w#%\s\.]+)?\)$/,I="__comma__";function J(r,o){let[t,n]=i(o);if(r==="background-size")return`bg${a(t,C,!1,"length:")}${n}`;if(Ur.includes(r))return`bg${a(t,C)}${n}`;if(["background","background-image"].includes(r)){if(/^(linear)-gradient/.test(t)){let m=t.replace(/rgba?\(([^)]+)\)/g,($,p)=>$.replace(p,p.replace(/\s*,\s*/g,I))),f=m.match(Rr);if(f){let[$,p,g,V]=f.slice(1);return $=$.split(" ").map(N=>N[0]).join(""),$?`bg-gradient-to-${$}${H(p,g,V)}`:H(p,g,V)}let u=m.match(Sr);return u?`bg-gradient-linear bg-gradient-[${u[1]},${u[2].replace(/\s+/,"_").replaceAll(I,",")},${u[3].replace(/\s+/,"_").replaceAll(I,",")}]`:void 0}else if(/^(radial|conic)-gradient/.test(t)){let f=t.replace(/rgba?\(([^)]+)\)/g,(V,N)=>V.replace(N,N.replace(/\s*,\s*/g,I))).match(Tr);if(!f)return;let u=f[1],[$,p,g]=f.slice(2);return`bg-gradient-${u}${H($,p,g)}`}let e=t.match(/rgba?\([^)]+\)/);if(e){let m=e[0];return`bg="${t.replace(m,`[${m}]`)}${n}"`}let s=t.match(/url\(["'\s\.\-_\w\/]*\)/);return s?`bg="${t.replace(s[0],`[${s[0].replace(/['"]/g,"")}]${n}`)}"`:`bg${a(t,C)}${n}`}return r==="background-blend-mode"?`bg-blend-${t}${n}`:`${Ar(r,t)}-${Hr(t)}${n}`}function Ar(r,o){return o.endsWith("repeat")?"bg":r.replace("background","bg")}function Hr(r){return/(border)|(content)|(padding)-box/.test(r)?r.replace("-box",""):r.startsWith("repeat-")?r.replace("repeat-",""):C(r)}function C(r){return r.replace(/\s+/," ").replace(" ","-")}function H(r,o,t){let n="";if(o&&!t&&(t=o,o=""),r){r=r.replaceAll(I,",");let[e,s]=r.split(" ");s?n+=` from="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` from="${d(e)?`[${e}]`:e}"`)}if(o){o=o.replaceAll(I,",");let[e,s]=o.split(" ");s?n+=` via="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` via="${d(e)?`[${e}]`:e}"`)}if(t){t=t.replaceAll(I,",");let[e,s]=t.split(" ");s?n+=` to="${d(e)?`[${e}]`:e} ${s}"`:e&&(n+=` to="${d(e)?`[${e}]`:e}"`)}return n}function M(r,o){let[t,n]=i(o),e=r.split("-"),s=W(t)||w(t)?a(t):a(c(t));return`${e[0]}-${e[1][0]}${s}${n}`}function K(r,o){let[t,n]=i(o);if(r==="font-size")return`text-${t}${n}`;if(r==="font-weight")return`font-${t}${n}`;if(r==="font-family"){let e=t.match(/ui-(\w{0,4})/);if(!e)return`font-${o}${n}`;let[s,m]=e;return`font-${m}${n}`}return r==="font-style"?t==="normal"?`font-not-italic${n}`:`font-${t}${n}`:r==="font-variant-numeric"?t==="normal"?`normal-nums${n}`:`${t}${n}`:`font="${Mr(t)}${n}"`}function Mr(r){return r.split(" ").map(o=>/^[0-9]/.test(o)?`text-${o}`:o).join(" ")}function O(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}var Pr={"margin-left":"ml","margin-right":"mr","margin-top":"mt","margin-bottom":"mb","margin-inline-start":"ms","margin-inline-end":"me","padding-left":"pl","padding-right":"pr","padding-top":"pt","padding-bottom":"pb","padding-inline-start":"ps","padding-inline-end":"pe"};function P(r,o){let[t,n]=i(o),e=Pr[r];if(e)return`${e}${a(t)}${n}`;let s=t.split(" "),m=s.length;return m===1?`${r[0]}${a(s[0])}${n}`:m===2?`${r[0]}x${a(s[1])}${n} ${r[0]}y${a(s[0])}${n}`:m===3?`${r[0]}x${a(s[1])}${n} ${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n}`:`${r[0]}t${a(s[0])}${n} ${r[0]}b${a(s[2])}${n} ${r[0]}l${a(s[3])}${n} ${r[0]}r${a(s[1])}${n}`}function Q(r,o){let[t,n]=i(o);return A(o)?`op-${t.replace("%","")}${n}`:`op-${+t*100}${n}`}function X(r,o){let[t,n]=i(o);return`text${a(t)}${n}`}function Y(r,o){let[t,n]=i(o);return r==="text-decoration-line"?t==="none"?`no-underline${n}`:`${t}${n}`:r==="text-transform"?t==="none"?`normal-case${n}`:`${t}${n}`:r.startsWith("text-decoration")||r==="text-indent"?`${r.split("-")[1]}${a(t)}${n}`:r==="text-underline-offset"?`underline-offset-${t}${n}`:`text-${t}${n}`}function y(r,o){let[t,n]=i(o);return`v-${t}${n}`}var k={1:"none",1.25:"tight",1.375:"snug",1.5:"normal",1.625:"relaxed",2:"loose"};function rr(r,o){let[t,n]=i(o);return t in k?`lh-${k[t]}${n}`:`lh${a(t)}${n}`}var Er=["border-left","border-top","border-right","border-bottom"];function tr(r,o){let[t,n]=i(o);if(r==="border-spacing")return`${r}="[${_(t)}]${n}"`;if(r==="border-color"){if(t.includes(" ")){let e=t.split(" ").length,s=t.split(" ").map(p=>L(p)||d(p)||F(p)?`-[${p}]`:`-${p}`),[m,f,u,$]=s;switch(e){case 2:return`border-y${m}${n} border-x${f}${n}`;case 3:return`border-t${m}${n} border-b${u}${n} border-x${f}${n}`;case 4:return`border-t${m}${n} border-b${u}${n} border-r${f}${n} border-l${$}${n}`}}return`border${a(t)}${n}`}return r==="border-radius"?W(t)||!t.includes(" ")?`border-rd${a(t)}${n}`:`border-rd="[${_(t)}]${n}"`:Er.some(e=>r.startsWith(e))?t.split(" ").map(e=>`border-${r.split("-")[1][0]}${a(e)}${n}`).join(" "):r==="border-inline-end-width"?`border-e${a(t)}${n}`:r==="border-inline-start-width"?`border-s${a(t)}${n}`:r.startsWith("border-image")?"":/^\d[%|(px)|(rem)]$/.test(t)||r==="border-collapse"?`border-${t}${n}`:r==="border-width"||r==="border-style"?`border${a(t)}${n}`:r==="border-color"?t==="currentColor"?`border-current${n}`:`border${a(t)}${n}`:t.split(" ").map(e=>t==="currentColor"?`border-current${n}`:`border${a(e)}${n}`).join(" ")}function U(r,o){let[t,n]=i(o);return t==="none"?`hidden${n}`:t==="hidden"?`invisible${n}`:`${t}${n}`}function x(r,o){let[t,n]=i(o);return`${r}-${t}${n}`}function j(r,o){let[t,n]=i(o);return`${r}${a(t)}${n}`}function b(r,o){let[t,n]=i(o);return`${c(r)}${a(t)}${n}`}function R(r,o){let[t,n]=i(o);return r.startsWith("box-decoration")?`box-decoration-${t}${n}`:r==="box-sizing"?`box-${c(t)}${n}`:`shadow="[${t.split(" ").join("_")}]${n}"`}var Br=["contrast","brightness","saturate"],Gr=["grayscale","invert","sepia"];function S(r,o){let[t,n]=i(o),[e,s,m]=t.match(/([\w-]+)\((.*)\)/);return Br.includes(s)?`${s}-${h(m)}${n}`:s==="drop-shadow"?`drop-${R(s,m)}${n}`:Gr.includes(s)?`${s}-${m.endsWith("%")?m.slice(0,-1):h(m)}${n}`:s==="hue-rotate"?`${s}-${m.slice(0,-3)}${n}`:`${s}-${m}${n}`}function nr(r,o){let[t,n]=i(o);return`backdrop-${S(r,t)}${n}`}function or(r,o){let[t,n]=i(o);return r==="transform-origin"?`origin-${v(t)}${n}`:r==="transform-style"?`transform-${t}`:q(t).split(" ").map(e=>{let s=e.match(/([a-z]+)([A-Z])?\((.*)\)/);if(!s)return;let[m,f,u,$]=s;if(u){let p=$.replace(/,(?![^()]*\))/g," ").split(" ");return p.length>1?`${f}-${u.toLowerCase()}="${p.map(g=>w(g)?`[${g}]`:f==="scale"?h(g):T(g)).join(" ")}${n}"`:`${f}="${u.toLowerCase()}-${w(p[0])?`[${p[0]}]`:f==="scale"?h(p[0]):T(p[0])}${n}"`}else{let p=$.replace(/,(?![^()]*\))/g," ").split(" ");return p.length>1?`${f}="${p.map(g=>w(g)?`[${g}]`:f==="scale"?h(g):T(g)).join(" ")}${n}"`:`${f}="${w(p[0])?`[${p[0]}]`:f==="scale"?h(p[0]):T(p[0])}${n}"`}}).filter(Boolean).join(" ")}function T(r){return r.endsWith("deg")?r.slice(0,-3):r}var Dr=["transition-delay","transition-duration"];function ir(r,o){let[t,n]=i(o);if(r==="transition-timing-function")return t==="linear"?`ease-${t}${n}`:`ease="[${t}]${n}"`;if(r==="transition")return`transition="${Zr(t)}"`;if(r==="transition-property")return t.includes("color")?`transition-color${n}`:t==="box-shadow"?`transition-shadow${n}`:`transition-${t}${n}`;if(Dr.includes(r))return`${r.split("-")[1]}-${t.slice(0,-2)}`}function Zr(r){let o=!1;return r.split(" ").map(t=>/^[0-9]/.test(t)||/^\.[0-9]/.test(t)?o?`delay${a(t,void 0,!0)}`:(o=!0,`duration${a(t,void 0,!0)}`):t==="background-color"?"colors":t).join(" ")}function er(r,o){let[t,n]=i(o);return r==="justify-content"?`justify-${l(t)}${n}`:`${r}-${l(t)}${n}`}function sr(r,o){let[t,n]=i(o);return`${l(r)}-${l(t)}${n}`}var qr=["flex-basis","flex-grow","flex-shrink"];function ar(r,o){let[t,n]=i(o);if(qr.includes(r))return`${l(r)}-${t}${n}`;if(t==="1")return`flex-1${n}`;let e=t[0];return r==="flex"&&(e==="0"||e==="1")?`flex="[${_(t)}]${n}"`:`${c(r)}-${t.replace("column","col")}${n}`}function mr(r,o){let[t,n]=i(o);return t==="auto"?`${c(r)}-${t}`:`${c(r)}="[${t}]${n}"`}function pr(r,o){let[t,n]=i(o);return r==="column-gap"?`gap-x-${t}${n}`:`${r}-${t}${n}`}function fr(r,o){let[t,n]=i(o);return o==="isolate"?`${t}${n}`:`${r}-${t}${n}`}function cr(r,o){let[t,n]=i(o);return r==="object-position"?`${c(r)}-${v(t)}${n}`:`${c(r)}-${t}${n}`}function lr(r,o){let[t,n]=i(o),[e,s,m]=r.split("-");return m?`${e}-${m}-${t}${n}`:`${e}-${t}${n}`}function ur(r,o){let[t,n]=i(o);if(r.startsWith("grid-template")){let s=t.match(/repeat\s*\(\s*([0-9]+)/);return s?`grid-${l(r)==="rows"?"rows":"cols"}-${s[1]}${n}`:`grid-${l(r)==="rows"?"rows":"cols"}-${t}${n}`}if(r==="grid-auto-flow")return`grid-flow-${v(t).replace("column","col")}${n}`;if(r.startsWith("grid-auto")){let s=t.match(/minmax\s*\(\s*0\s*,\s*1fr/);return`auto-${l(r)==="rows"?"rows":"cols"}-${s?"fr":c(t)}${n}`}let e=t.match(/span\s+([0-9])/);return e?`${r.slice(5).replace("column","col")}-span-${e[1]}${n}`:t==="1/-1"?`${r.slice(5).replace("column","col")}-span-full${n}`:`${r.slice(5).replace("column","col")}-${t}${n}`}function $r(r,o){let[t,n]=i(o);return`gap-y-${t}${n}`}function gr(r,o){let[t,n]=i(o);return`${r}-${l(t)}${n}`}function dr(r,o){let[t,n]=i(o);return`tracking-${t}${n}`}function xr(r,o){let[t,n]=i(o);return`whitespace-${t}${n}`}function br(r,o){let[t,n]=i(o);return r.startsWith("word-spacing")?`word-spacing${a(o)}`:t==="keep-all"?`break-keep${n}`:`break-${l(t)}${n}`}function hr(r,o){let[t,n]=i(o);return r==="outline-offset"?`${r}-${t}${n}`:`${c(r)}-${t}${n}`}function wr(r,o){let[t,n]=i(o);return`mix-blend-${t}${n}`}var Jr={vertical:"y",horizontal:"x"};function Ir(r,o){let[t,n]=i(o);return t==="both"?`${r}${n}`:`${r}-${Jr[t]||t}${n}`}function vr(r,o){let[t,n]=i(o);if(r.startsWith("scroll-snap"))return`snap-${t}${n}`;if(r==="scroll-behavior")return`scroll-${t}${n}`;let[e,s,m,f]=r.match(/scroll-(margin|padding)-?([\w]+)?-?([\w]+)?/);return m==="inline"&&f?`scroll-${s[0]}${f[0]}-${t}${n}`:m?`scroll-${s[0]}${m[0]}-${t}${n}`:`scroll-${s[0]}-${t}${n}`}function jr(r,o){let[t,n]=i(o);return`${l(r)}-${t}${n}`}function Wr(r,o){let[t,n]=i(o);return`${r}-${c(t)}${n}`}function _r(r,o){let[t,n]=i(o);return r==="animation-delay"?`animate${a(t)}${n}`:r==="animation"?`animate-${t.split(" ")[0]}${n}`:`animate-${t}${n}`}function Vr(r,o){let[t,n]=i(o);return t==='" "'||t==="' '"?`content-['_']${n}`:`content="[${t}]${n}"`}var Kr={show:"visible",hide:"hidden"};function Nr(r,o){var e;let[t,n]=i(o);return`table-empty-cells-${(e=Kr[t])!=null?e:t}${n}`}function Lr(r,o){return o==="horizontal-tb"?"write-normal":`write-${o.replace("-rl","-right").replace("-lr","-left")}`}function Fr(r,o){let[t,n]=i(o);if(r==="inset-inline-start")return`start${a(t)}${n}`;if(r==="inset-inline-end")return`end${a(t)}${n}`}var E={animation:_r,aspect:mr,backface:b,caption:b,column:pr,columns:x,break:x,empty:Nr,box:R,writing:Lr,display:U,float:x,clear:x,isolation:fr,object:cr,overflow:x,overscroll:lr,position:U,top:j,left:j,right:j,bottom:j,visibility:U,z,flex:ar,order:x,grid:ur,gap:j,justify:er,align:sr,place:gr,padding:P,perspective:x,margin:P,width:z,min:M,max:M,height:z,font:K,letter:dr,line:rr,list:b,text:Y,vertical:y,white:xr,word:br,content:Vr,background:J,border:tr,outline:hr,opacity:Q,mix:wr,filter:S,backdrop:nr,table:b,transition:ir,transform:or,accent:b,appearance:b,cursor:O,caret:b,pointer:x,resize:Ir,scroll:vr,inset:Fr,touch:b,user:jr,will:Wr,fill:x,stroke:b,color:X,row:$r},Or=/([\w-]+)\s*:\s*([.\w\(\)-\s%+'",#\/!]+)/;function B(r,o=!1){var u;let t=r.match(Or);if(!t)return;let[n,e,s]=t,m=c(e),f=(u=E[m])==null?void 0:u.call(E,e,s);return f&&o?f.replace(/-([0-9\.]+)px/,($,p)=>`-${+p/4}`):f}function G(r,o){let t=[];return[r.split(";").filter(Boolean).reduce((n,e)=>{let s=B(e,o)||"";return s||t.push(e),n+=`${s} `},"").trim(),t]}function Qr(r,o=!1){let[t,n]=G(r,o);return[t?t.replace(/([^\s\=]+)="([^"]+)"/g,(e,s,m)=>m.split(" ").map(f=>`${s}-${f}`).join(" ")):"",n]}export{Z as cssMathFnRE,yr as diffTemplateStyle,Xr as flag,c as getFirstName,h as getHundred,l as getLastName,rt as getStyleScoped,a as getVal,W as isCalc,nt as isColor,kr as isEmptyStyle,L as isHex,F as isHsl,Yr as isNot,A as isPercent,d as isRgb,tt as isSize,Cr as isUrl,w as isVar,q as joinEmpty,v as joinWithLine,_ as joinWithUnderLine,zr as numberWithUnitRE,B as toUnocss,Qr as toUnocssClass,i as transformImportant,G as transformStyleToUnocss,D as trim};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "transform-to-unocss-core",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "packageManager": "pnpm@7.2.1",
5
5
  "description": "",
6
6
  "author": "Simon He",