transform-to-unocss-core 0.0.34 → 0.0.35

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 E=Object.defineProperty;var Bt=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var Gt=Object.prototype.hasOwnProperty;var Ot=(t,o)=>{for(var r in o)E(t,r,{get:o[r],enumerable:!0})},Dt=(t,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Et(o))!Gt.call(t,i)&&i!==r&&E(t,i,{get:()=>o[i],enumerable:!(n=Bt(o,i))||n.enumerable});return t};var Kt=t=>Dt(E({},"__esModule",{value:!0}),t);var br={};Ot(br,{browserReg:()=>F,cssMathFnRE:()=>O,diffTemplateStyle:()=>Jt,flag:()=>Zt,getFirstName:()=>l,getHundred:()=>I,getLastName:()=>$,getStyleScoped:()=>Xt,getVal:()=>a,isCalc:()=>v,isColor:()=>Yt,isEmptyStyle:()=>Qt,isHex:()=>L,isHsl:()=>N,isNot:()=>qt,isPercent:()=>S,isRgb:()=>b,isSize:()=>K,isUrl:()=>y,isVar:()=>j,joinEmpty:()=>D,joinWithLine:()=>_,joinWithUnderLine:()=>x,numberWithUnitRE:()=>Y,positionMap:()=>k,toUnocss:()=>H,toUnocssClass:()=>Ht,transformImportant:()=>e,transformStyleToUnocss:()=>B,trim:()=>G});module.exports=Kt(br);var Zt=".__unocss_transfer__",O=/^(?:calc|clamp|min|max)\s*\(.*\)/,Y=/^-?[0-9.]+(px|rem|em|%|vw|vh|vmin|vmax|deg)$/;function qt(t){return/\[&:not\(/.test(t)}function v(t){return O.test(t)}function l(t){return t.split("-")[0]}function $(t){let o=t.split("-");return o[o.length-1]}function y(t){return t.startsWith("url(")}function S(t){return t.endsWith("%")&&!t.includes(" ")}function L(t){return/^#[0-9A-F]{2,}$/i.test(t)}function b(t){return t.startsWith("rgb")}function N(t){return t.startsWith("hsl")}function a(t,o,r,n=""){return v(t)||y(t)||L(t)||b(t)||N(t)||S(t)||j(t)?r?`-[${n}${G(t,"all").replace(/['"]/g,"")}]`:`="[${n}${G(t,"all").replace(/['"]/g,"")}]"`:n?`-[${n}${o?o(t):t}]`:`-${o?o(t):t}`}function I(t){return typeof t=="string"&&t.endsWith("%")?t.slice(0,-1):+t*100}function _(t){return t.replace(/\s+/," ").split(" ").join("-")}function x(t){return t.replace(/\s+/," ").split(" ").join("_")}var k=["top","right","bottom","left","center"];function G(t,o="around"){return o==="pre"?t.replace(/(^\s*)/g,""):o==="post"?t.replace(/(\s*$)/g,""):o==="all"?t.replace(/\s+/g,""):o==="around"?t.replace(/(^\s*)|(\s*$)/g,""):t}function e(t){return t=t.replace(/\s+/," ").replace(/\s*,\s*/g,",").replace(/\s*\/\s*/,"/"),/rgb/.test(t)&&(t=t.replace(/rgba?\(([^)]+)\)/g,(o,r)=>{let n=r.trim().split(" ");return o.replace(r,n.map((i,s)=>i.endsWith(",")?i:i+(n.length-1===s?"":",")).join(""))})),/hsl/.test(t)&&(t=t.replace(/hsla?\(([^)]+)\)/g,(o,r)=>{let n=r.trim().split(" ");return o.replace(r,n.map((i,s)=>i.endsWith(",")?i:i+(n.length-1===s?"":",")).join(""))})),/var\([^)]+\)/.test(t)&&(t=t.replace(/var\(([^)]+)\)/g,(o,r)=>{let n=r.trim().split(" ");return o.replace(r,n.map((i,s)=>i.endsWith(",")?i:i+(n.length-1===s?"":",")).join(""))})),t.endsWith("!important")?[t.replace(/\s*!important/,"").trim(),"!"]:[t.trim(),""]}function Jt(t,o){let r=t.match(/<style scoped>.*<\/style>/s),n=o.match(/<style scoped>.*<\/style>/s);return r[0]===n[0]}function Qt(t){return/<style scoped>\s*<\/style>/.test(t)}function Xt(t){let o=t.match(/<style scoped>(.*)<\/style>/s);return o?o[1]:""}function D(t){return t.replace(/\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s*,\s*/g,",")}function j(t){return t.startsWith("var(--")}function K(t){return O.test(t)||Y.test(t)||k.includes(t)}function Yt(t){return L(t)||b(t)||N(t)}var F=/-webkit-|-moz-|-ms-|-o-/g;function tt(t,o){let[r,n]=e(o);return`${$(t)}-${$(r)}${n}`}function rt(t,o){let[r,n]=e(o);return t==="animation-delay"?`animate${a(r)}${n}`:t==="animation"?`animate-${r.split(" ")[0]}${n}`:`animate-${r}${n}`}function nt(t,o){let[r,n]=e(o);return r==="auto"?`${l(t)}-${r}`:`${l(t)}="[${r}]${n}"`}var yt=["box-shadow","drop-shadow"];function T(t,o){let[r,n]=e(o);if(t.startsWith("box-decoration"))return`box-decoration-${r}${n}`;if(t==="box-sizing")return`box-${l(r)}${n}`;if(yt.includes(t))return`shadow="[${r.split(" ").join("_")}]${n}"`}var kt=["contrast","brightness","saturate"],tr=["grayscale","invert","sepia"];function C(t,o){let[r,n]=e(o),[i,s,p]=r.match(/([\w-]+)\((.*)\)/);return kt.includes(s)?`${s}-${I(p)}${n}`:s==="drop-shadow"?`drop-${T(s,p)}${n}`:tr.includes(s)?`${s}-${p.endsWith("%")?p.slice(0,-1):I(p)}${n}`:s==="hue-rotate"?`${s}-${p.slice(0,-3)}${n}`:`${s}-${p}${n}`}function ot(t,o){let[r,n]=e(o);return`backdrop-${C(t,r)}${n}`}var rr=["background-color","background-attachment","background-position"],nr=/linear-gradient\(\s*to([\w\s]+),?([\w()#%\s.]+)?,([\w()#%\s.]+)?,?([\w#%\s.]+)?\)$/,or=/linear-gradient\(\s*([^,]*),?([\w()#%\s.]+)?,([\w()#%\s.]+)?,?([\w#%\s.]+)?\)$/,er=/(radial|conic)-gradient\(([\w()#%\s.]+)?,([\w()#%\s.]+)?,?([\w#%\s.]+)?\)$/,W="__comma__";function q(t,o){let[r,n]=e(o);if(t==="background-size")return`bg${a(r,/\d/.test(r)?ar:R,!1,"length:")}${n}`;if(rr.includes(t))return`bg${a(r,R)}${n}`;if(["background","background-image"].includes(t)){if(K(r))return`bg${a(r,R,!1,"position:")}${n}`;let i=r.replace(/rgba?\([^)]+\)/g,"temp");if(/\)\s*,/.test(i))return`bg="[${mr(r)}]"`;if(r.startsWith("linear-gradient")){let m=r.replace(/rgba?\(([^)]+)\)/g,(f,c)=>f.replace(c,c.replace(/\s*,\s*/g,W))),g=m.match(nr);if(g){let[f,c,d,U]=g.slice(1);return f=f.split(" ").map(z=>z[0]).join(""),f?`bg-gradient-to-${f}${Z(c,d,U)}`:Z(c,d,U)}let u=m.match(or);return u?`bg-gradient-linear bg-gradient-[${u[1]},${u[2].replace(/\s+/,"_").replaceAll(W,",")},${u[3].replace(/\s+/,"_").replaceAll(W,",")}]`:void 0}else if(/^(?:radial|conic)-gradient/.test(r)){let g=r.replace(/rgba?\(([^)]+)\)/g,(U,z)=>U.replace(z,z.replace(/\s*,\s*/g,W))).match(er);if(!g)return;let u=g[1],[f,c,d]=g.slice(2);return`bg-gradient-${u}${Z(f,c,d)}`}let s=r.match(/^rgba?\([^)]+\)$/);if(s){let m=s[0];return`bg="${r.replace(m,`[${m}]`)}${n}"`}let p=r.match(/^url\(["'\s.\-\w/@]*\)$/);if(p)return`bg="${r.replace(p[0],`[${p[0].replace(/['"]/g,"")}]${n}`)}"`;if(r.includes(" ")){let m=r.split(" ").map(f=>q(t,`${f}${n?" !important":""}`)).join(" "),g=/bg-\[position:([^\]]*)\]/g,u=m.match(g);if(u&&u.length>1){let f=`bg-[position:${u.map(c=>c.replace(g,"$1")).join("_")}]`;m=`${m.replace(g,"").replace(/\s+/g," ").split(" ").filter(Boolean).concat([f]).join(" ")}`}return m}return`bg${a(r,R)}${n}`}return t==="background-blend-mode"?`bg-blend-${r}${n}`:`${ir(t,r)}-${sr(r)}${n}`}function ir(t,o){return o.endsWith("repeat")?"bg":t.replace("background","bg")}function sr(t){return/border|content|padding-box/.test(t)?t.replace("-box",""):t.startsWith("repeat-")?t.replace("repeat-",""):R(t)}function R(t){return t.replace(/\s+/," ").replace(" ","-")}function ar(t){return t.replace(/\s+/," ").replace(" ","_")}function Z(t,o,r){let n="";if(o&&!r&&(r=o,o=""),t){t=t.replaceAll(W,",");let[i,s]=t.split(" ");s?n+=` from="${b(i)?`[${i}]`:i} ${s}"`:i&&(n+=` from="${b(i)?`[${i}]`:i}"`)}if(o){o=o.replaceAll(W,",");let[i,s]=o.split(" ");s?n+=` via="${b(i)?`[${i}]`:i} ${s}"`:i&&(n+=` via="${b(i)?`[${i}]`:i}"`)}if(r){r=r.replaceAll(W,",");let[i,s]=r.split(" ");s?n+=` to="${b(i)?`[${i}]`:i} ${s}"`:i&&(n+=` to="${b(i)?`[${i}]`:i}"`)}return n}var et="__transform_to_unocss__";function mr(t){let o={},r=0;return t=t.replace(/(rgba?|hsla?|lab|lch|hwb|color)\(\)*\)/,n=>(o[r++]=n,`${et}${r}}`)),t=t.split(/\)\s*,/).map(n=>`${n.replace(/\s*,\s*/g,",").replace(/\s+/g,"_")}`).join("),"),Object.keys(o).forEach(n=>{t=t.replace(`${et}${n}}`,o[n])}),t}var it=["border-top","border-right","border-bottom","border-left"];function st(t,o){let[r,n]=e(o);if(t==="border-spacing")return`${t}="[${x(r)}]${n}"`;if(t==="border-color"){if(r.includes(" ")){let i=r.split(" ").length,s=r.split(" ").map(f=>L(f)||b(f)||N(f)?`-[${f}]`:`-${f}`),[p,m,g,u]=s;switch(i){case 2:return`border-y${p}${n} border-x${m}${n}`;case 3:return`border-t${p}${n} border-b${g}${n} border-x${m}${n}`;case 4:return`border-t${p}${n} border-b${g}${n} border-r${m}${n} border-l${u}${n}`}}return`border${a(r)}${n}`}return t==="border-radius"?v(r)||!r.includes(" ")?`border-rd${a(r)}${n}`:`border-rd="[${x(r)}]${n}"`:it.some(i=>t.startsWith(i))?r.split(" ").map(i=>`border-${t.split("-")[1][0]}${a(i)}${n}`).join(" "):t==="border-inline-end-width"?`border-e${a(r)}${n}`:t==="border-inline-start-width"?`border-s${a(r)}${n}`:t.startsWith("border-image")?"":t==="border-width"&&r.includes(" ")?r.split(" ").map((i,s)=>`border-${it[s].split("-")[1][0]}${a(i)}${n}`).join(" "):/^\d[%|(px)rem]$/.test(r)||t==="border-collapse"?`border-${r}${n}`:t==="border-width"||t==="border-style"?`border${a(r)}${n}`:t==="border-color"?r==="currentColor"?`border-current${n}`:`border${a(r)}${n}`:r.split(" ").map(i=>r==="currentColor"?`border-current${n}`:`border${a(i)}${n}`).join(" ")}function at(t,o){let[r,n]=e(o);return`text${a(r)}${n}`}function mt(t,o){let[r,n]=e(o);return t==="column-gap"?`gap-x-${r}${n}`:`${t}-${r}${n}`}function pt(t,o){let[r,n]=e(o);return r==='" "'||r==="' '"?`content-['_']${n}`:`content-[${r.replace(/"/g,"'")}]${n}`}function ct(t,o){let[r,n]=e(o);return`${t}${a(r)}${n}`}function A(t,o){let[r,n]=e(o);return r==="none"?`hidden${n}`:r==="hidden"?`invisible${n}`:`${r}${n}`}var pr={show:"visible",hide:"hidden"};function lt(t,o){var i;let[r,n]=e(o);return`table-empty-cells-${(i=pr[r])!=null?i:r}${n}`}var cr=["flex-basis","flex-grow","flex-shrink"];function ft(t,o){let[r,n]=e(o);if(cr.includes(t))return`${$(t)}${a(r)}${n}`;if(r==="1")return`flex-1${n}`;let i=r[0];return t==="flex"&&(i==="0"||i==="1")?`flex="[${x(r)}]${n}"`:`${l(t)}-${r.replace("column","col")}${n}`}function h(t,o){let[r,n]=e(o);return`${t}-${r}${n}`}function ut(t,o){let[r,n]=e(o);if(t==="font-size")return`text-${r}${n}`;if(t==="font-weight")return`font-${r}${n}`;if(t==="font-family"){let i=r.match(/ui-(\w{0,4})/);if(!i)return`font-${o}${n}`;let[s,p]=i;return`font-${p}${n}`}return t==="font-style"?r==="normal"?`font-not-italic${n}`:`font-${r}${n}`:t==="font-variant-numeric"?r==="normal"?`normal-nums${n}`:`${r}${n}`:`font="${lr(r)}${n}"`}function lr(t){return t.split(" ").map(o=>/^\d/.test(o)?`text-${o}`:o).join(" ")}function $t(t,o){let[r,n]=e(o);if(t.startsWith("grid-template")){let s=r.match(/repeat\s*\(\s*(\d+)/);return s?`grid-${$(t)==="rows"?"rows":"cols"}-${s[1]}${n}`:`grid-${$(t)==="rows"?"rows":"cols"}-${r.includes(" ")?`[${x(r)}]`:r}${n}`}if(t==="grid-auto-flow")return`grid-flow-${_(r).replace("column","col")}${n}`;if(t.startsWith("grid-auto")){let s=r.match(/minmax\s*\(\s*0\s*,\s*1fr/);return`auto-${$(t)==="rows"?"rows":"cols"}-${s?"fr":l(r)}${n}`}let i=r.match(/span\s+(\d)/);return i?`${t.slice(5).replace("column","col")}-span-${i[1]}${n}`:r==="1/-1"?`${t.slice(5).replace("column","col")}-span-full${n}`:`${t.slice(5).replace("column","col")}-${r}${n}`}function gt(t,o){let[r,n]=e(o);if(t==="inset-inline-start")return`start${a(r)}${n}`;if(t==="inset-inline-end")return`end${a(r)}${n}`}function dt(t,o){let[r,n]=e(o);return o==="isolate"?`${r}${n}`:`${t}-${r}${n}`}function bt(t,o){let[r,n]=e(o);return t==="justify-content"?`justify-${$(r)}${n}`:`${t}-${$(r)}${n}`}function xt(t,o){let[r,n]=e(o);return`tracking-${r}${n}`}var ht={1:"none",1.25:"tight",1.375:"snug",1.5:"normal",1.625:"relaxed",2:"loose"};function wt(t,o){let[r,n]=e(o);return r in ht?`lh-${ht[r]}${n}`:`lh${a(r)}${n}`}function w(t,o){let[r,n]=e(o);return`${l(t)}${a(r)}${n}`}var fr={"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 J(t,o){let[r,n]=e(o),i=fr[t];if(i)return`${i}${a(r)}${n}`;let s=r.split(" "),p=s.length;return p===1?`${t[0]}${a(s[0])}${n}`:p===2?`${t[0]}x${a(s[1])}${n} ${t[0]}y${a(s[0])}${n}`:p===3?`${t[0]}x${a(s[1])}${n} ${t[0]}t${a(s[0])}${n} ${t[0]}b${a(s[2])}${n}`:`${t[0]}t${a(s[0])}${n} ${t[0]}b${a(s[2])}${n} ${t[0]}l${a(s[3])}${n} ${t[0]}r${a(s[1])}${n}`}function Q(t,o){let[r,n]=e(o),i=t.split("-"),s=v(r)||j(r)?a(r):a(l(r));return`${i[0]}-${i[1][0]}${s}${n}`}function It(t,o){let[r,n]=e(o);return`mix-blend-${r}${n}`}function jt(t,o){let[r,n]=e(o);return t==="object-position"?`${l(t)}-${_(r)}${n}`:`${l(t)}-${r}${n}`}function _t(t,o){let[r,n]=e(o);return S(o)?`op-${r.replace("%","")}${n}`:`op-${+r*100}${n}`}function Wt(t,o){let[r,n]=e(o);return t==="outline-offset"?`${t}-${r}${n}`:`${l(t)}-${r}${n}`}function vt(t,o){let[r,n]=e(o),[i,s,p]=t.split("-");return p?`${i}-${p}-${r}${n}`:`${i}-${r}${n}`}function Vt(t,o){let[r,n]=e(o);return`${t}-${$(r)}${n}`}var ur={vertical:"y",horizontal:"x"};function Lt(t,o){let[r,n]=e(o);return r==="both"?`${t}${n}`:`${t}-${ur[r]||r}${n}`}function Nt(t,o){let[r,n]=e(o);return`gap-y-${r}${n}`}function Ft(t,o){let[r,n]=e(o);if(t.startsWith("scroll-snap"))return`snap-${r}${n}`;if(t==="scroll-behavior")return`scroll-${r}${n}`;let[i,s,p,m]=t.match(/scroll-(margin|padding)-?(\w+)?-?(\w+)?/);return p==="inline"&&m?`scroll-${s[0]}${m[0]}-${r}${n}`:p?`scroll-${s[0]}${p[0]}-${r}${n}`:`scroll-${s[0]}-${r}${n}`}function M(t,o){let[r,n]=e(o);return r.startsWith("-")?`-${t[0]}${a(r.slice(1),l)}${n}`:`${t[0]}${a(r,l)}${n}`}function Rt(t,o){let[r,n]=e(o);return t==="text-decoration-line"?r==="none"?`no-underline${n}`:`${r}${n}`:t==="text-transform"?r==="none"?`normal-case${n}`:`${r}${n}`:t.startsWith("text-decoration")||t==="text-indent"?`${t.split("-")[1]}${a(r)}${n}`:t==="text-underline-offset"?`underline-offset-${r}${n}`:`text-${r}${n}`}function V(t,o){let[r,n]=e(o);return`${t}${a(r)}${n}`}function Ut(t,o){let[r,n]=e(o);return t==="transform-origin"?`origin-${/\d/.test(r)&&r.includes(" ")?`[${x(r)}]`:_(r)}${n}`:t==="transform-style"?`transform-${r}`:o==="none"?`${t}-none`:D(r).split(" ").map(i=>{let s=i.match(/([a-z]+)(3d)?([A-Z])?\((.*)\)/);if(!s)return;let[p,m,g,u,f]=s;if(u){let c=f.replace(/,(?![^()]*\))/g," ").split(" ");return c.length>1?`${m}-${u.toLowerCase()}="${c.map(d=>j(d)?`[${d}]`:m==="scale"?I(d):P(d)).join(" ")}${n}"`:`${m}="${u.toLowerCase()}-${j(c[0])?`[${c[0]}]`:m==="scale"?I(c[0]):P(c[0])}${n}"`}else{let c=f.replace(/,(?![^()]*\))/g," ").split(" ");return c.length>1?m==="translate"?`${m}="[${c.join(",")}]"`:`${m}="${c.map(d=>j(d)?`[${d}]`:m==="scale"?I(d):P(d)).join(" ")}${n}"`:`${m}="${j(c[0])?`[${c[0]}]`:m==="scale"?I(c[0]):P(c[0])}${n}"`}}).filter(Boolean).join(" ")}function P(t){return t.endsWith("deg")?t.slice(0,-3):t}var $r=["transition-delay","transition-duration"];function zt(t,o){let[r,n]=e(o);if(t==="transition-timing-function")return r==="linear"?`ease-${r}${n}`:`ease="[${r}]${n}"`;if(t==="transition")return`transition="${gr(r)}"`;if(t==="transition-property")return r.includes("color")?`transition-color${n}`:r==="box-shadow"?`transition-shadow${n}`:`transition-${r}${n}`;if($r.includes(t))return`${t.split("-")[1]}-${r.slice(0,-2)}`}function gr(t){let o=!1;return t.split(" ").map(r=>/^\d/.test(r)||/^\.\d/.test(r)?o?`delay${a(r,void 0,!0)}`:(o=!0,`duration${a(r,void 0,!0)}`):r==="background-color"?"colors":r).join(" ")}function St(t,o){let[r,n]=e(o);return`${$(t)}-${r}${n}`}function Tt(t,o){let[r,n]=e(o);return`v-${r}${n}`}function Ct(t,o){let[r,n]=e(o);return`whitespace-${r}${n}`}function At(t,o){let[r,n]=e(o);return`${t}-${l(r)}${n}`}function Mt(t,o){let[r,n]=e(o);return t.startsWith("word-spacing")?`word-spacing${a(o)}`:r==="keep-all"?`break-keep${n}`:`break-${$(r)}${n}`}function Pt(t,o){return o==="horizontal-tb"?"write-normal":`write-${o.replace("-rl","-right").replace("-lr","-left")}`}var X={animation:rt,aspect:nt,backface:w,caption:w,column:mt,columns:h,break:h,empty:lt,box:T,writing:Pt,display:A,float:h,clear:h,isolation:dt,object:jt,overflow:h,overscroll:vt,position:A,top:V,left:V,right:V,bottom:V,visibility:A,z:M,flex:ft,order:h,grid:$t,gap:V,justify:bt,align:tt,place:Vt,padding:J,perspective:h,margin:J,width:M,min:Q,max:Q,height:M,font:ut,letter:xt,line:wt,list:w,text:Rt,vertical:Tt,white:Ct,word:Mt,content:pt,background:q,border:st,outline:Wt,opacity:_t,mix:It,filter:C,backdrop:ot,table:w,transition:zt,transform:Ut,accent:w,appearance:w,cursor:ct,caret:w,pointer:h,resize:Lt,scroll:Ft,inset:gt,touch:w,user:St,will:At,fill:h,stroke:w,color:at,row:Nt},dr=/([\w-]+)\s*:\s*([.\w()-\s%+'",#/!@]+)/;function H(t,o=!1){var g;t=t.replace(F,"");let r=t.match(dr);if(!r)return;let[n,i,s]=r,p=l(i),m=(g=X[p])==null?void 0:g.call(X,i,s);return m&&o?m.replace(/-([0-9.]+)px/,(u,f)=>`-${+f/4}`).replace(/\[[^\]]+\]/g,u=>u.replace(/([0-9.]+)px/g,(f,c)=>`${+c/16}rem`)):m}function B(t,o){let r=[],n=new Set;return[t.split(";").filter(Boolean).reduce((i,s)=>{let p=s.replaceAll(F,"").trim();if(n.has(p))return i;n.add(p);let m=H(s,o)||"";return m||r.push(s),i+=`${m} `},"").trim().replace(/\s+/g," "),r]}function Ht(t,o=!1){let[r,n]=B(t,o);return[r?r.replace(/([^\s=]+)="([^"]+)"/g,(i,s,p)=>p.split(" ").map(m=>`${s}-${m}`).join(" ")):"",n]}0&&(module.exports={browserReg,cssMathFnRE,diffTemplateStyle,flag,getFirstName,getHundred,getLastName,getStyleScoped,getVal,isCalc,isColor,isEmptyStyle,isHex,isHsl,isNot,isPercent,isRgb,isSize,isUrl,isVar,joinEmpty,joinWithLine,joinWithUnderLine,numberWithUnitRE,positionMap,toUnocss,toUnocssClass,transformImportant,transformStyleToUnocss,trim});
1
+ "use strict";var E=Object.defineProperty;var Bt=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var Gt=Object.prototype.hasOwnProperty;var Ot=(t,o)=>{for(var r in o)E(t,r,{get:o[r],enumerable:!0})},Dt=(t,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Et(o))!Gt.call(t,i)&&i!==r&&E(t,i,{get:()=>o[i],enumerable:!(n=Bt(o,i))||n.enumerable});return t};var Kt=t=>Dt(E({},"__esModule",{value:!0}),t);var br={};Ot(br,{browserReg:()=>F,cssMathFnRE:()=>O,diffTemplateStyle:()=>Jt,flag:()=>Zt,getFirstName:()=>l,getHundred:()=>I,getLastName:()=>$,getStyleScoped:()=>Xt,getVal:()=>a,isCalc:()=>v,isColor:()=>Yt,isEmptyStyle:()=>Qt,isHex:()=>L,isHsl:()=>N,isNot:()=>qt,isPercent:()=>S,isRgb:()=>b,isSize:()=>K,isUrl:()=>y,isVar:()=>j,joinEmpty:()=>D,joinWithLine:()=>_,joinWithUnderLine:()=>x,numberWithUnitRE:()=>Y,positionMap:()=>k,toUnocss:()=>H,toUnocssClass:()=>Ht,transformImportant:()=>e,transformStyleToUnocss:()=>B,trim:()=>G});module.exports=Kt(br);var Zt=".__unocss_transfer__",O=/^(?:calc|clamp|min|max)\s*\(.*\)/,Y=/^-?[0-9.]+(px|rem|em|%|vw|vh|vmin|vmax|deg)$/;function qt(t){return/\[&:not\(/.test(t)}function v(t){return O.test(t)}function l(t){return t.split("-")[0]}function $(t){let o=t.split("-");return o[o.length-1]}function y(t){return t.startsWith("url(")}function S(t){return t.endsWith("%")&&!t.includes(" ")}function L(t){return/^#[0-9A-F]{2,}$/i.test(t)}function b(t){return t.startsWith("rgb")}function N(t){return t.startsWith("hsl")}function a(t,o,r,n=""){return v(t)||y(t)||L(t)||b(t)||N(t)||S(t)||j(t)?r?`-[${n}${G(t,"all").replace(/['"]/g,"")}]`:`="[${n}${G(t,"all").replace(/['"]/g,"")}]"`:n?`-[${n}${o?o(t):t}]`:`-${o?o(t):t}`}function I(t){return typeof t=="string"&&t.endsWith("%")?t.slice(0,-1):+t*100}function _(t){return t.replace(/\s+/," ").split(" ").join("-")}function x(t){return t.replace(/\s+/," ").split(" ").join("_")}var k=["top","right","bottom","left","center"];function G(t,o="around"){return o==="pre"?t.replace(/(^\s*)/g,""):o==="post"?t.replace(/(\s*$)/g,""):o==="all"?t.replace(/\s+/g,""):o==="around"?t.replace(/(^\s*)|(\s*$)/g,""):t}function e(t){return t=t.replace(/\s+/," ").replace(/\s*,\s*/g,",").replace(/\s*\/\s*/,"/"),/rgb/.test(t)&&(t=t.replace(/rgba?\(([^)]+)\)/g,(o,r)=>{let n=r.trim().split(" ");return o.replace(r,n.map((i,s)=>i.endsWith(",")?i:i+(n.length-1===s?"":",")).join(""))})),/hsl/.test(t)&&(t=t.replace(/hsla?\(([^)]+)\)/g,(o,r)=>{let n=r.trim().split(" ");return o.replace(r,n.map((i,s)=>i.endsWith(",")?i:i+(n.length-1===s?"":",")).join(""))})),/var\([^)]+\)/.test(t)&&(t=t.replace(/var\(([^)]+)\)/g,(o,r)=>{let n=r.trim().split(" ");return o.replace(r,n.map((i,s)=>i.endsWith(",")?i:i+(n.length-1===s?"":",")).join(""))})),t.endsWith("!important")?[t.replace(/\s*!important/,"").trim(),"!"]:[t.trim(),""]}function Jt(t,o){let r=t.match(/<style scoped>.*<\/style>/s),n=o.match(/<style scoped>.*<\/style>/s);return r[0]===n[0]}function Qt(t){return/<style scoped>\s*<\/style>/.test(t)}function Xt(t){let o=t.match(/<style scoped>(.*)<\/style>/s);return o?o[1]:""}function D(t){return t.replace(/\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s*,\s*/g,",")}function j(t){return t.startsWith("var(--")}function K(t){return O.test(t)||Y.test(t)||k.includes(t)}function Yt(t){return L(t)||b(t)||N(t)}var F=/-webkit-|-moz-|-ms-|-o-/g;function tt(t,o){let[r,n]=e(o);return`${$(t)}-${$(r)}${n}`}function rt(t,o){let[r,n]=e(o);return t==="animation-delay"?`animate${a(r)}${n}`:t==="animation"?`animate-${r.split(" ")[0]}${n}`:`animate-${r}${n}`}function nt(t,o){let[r,n]=e(o);return r==="auto"?`${l(t)}-${r}`:`${l(t)}="[${r}]${n}"`}var yt=["box-shadow","drop-shadow"];function T(t,o){let[r,n]=e(o);if(t.startsWith("box-decoration"))return`box-decoration-${r}${n}`;if(t==="box-sizing")return`box-${l(r)}${n}`;if(yt.includes(t))return`shadow="[${r.split(" ").join("_")}]${n}"`}var kt=["contrast","brightness","saturate"],tr=["grayscale","invert","sepia"];function C(t,o){let[r,n]=e(o),[i,s,p]=r.match(/([\w-]+)\((.*)\)/);return kt.includes(s)?`${s}-${I(p)}${n}`:s==="drop-shadow"?`drop-${T(s,p)}${n}`:tr.includes(s)?`${s}-${p.endsWith("%")?p.slice(0,-1):I(p)}${n}`:s==="hue-rotate"?`${s}-${p.slice(0,-3)}${n}`:`${s}-${p}${n}`}function ot(t,o){let[r,n]=e(o);return`backdrop-${C(t,r)}${n}`}var rr=["background-color","background-attachment","background-position"],nr=/linear-gradient\(\s*to([\w\s]+),?([\w()#%\s.]+)?,([\w()#%\s.]+)?,?([\w#%\s.]+)?\)$/,or=/linear-gradient\(\s*([^,]*),?([\w()#%\s.]+)?,([\w()#%\s.]+)?,?([\w#%\s.]+)?\)$/,er=/(radial|conic)-gradient\(([\w()#%\s.]+)?,([\w()#%\s.]+)?,?([\w#%\s.]+)?\)$/,W="__comma__";function q(t,o){let[r,n]=e(o);if(t==="background-size")return`bg${a(r,/\d/.test(r)?ar:R,!1,"length:")}${n}`;if(rr.includes(t))return`bg${a(r,R)}${n}`;if(["background","background-image"].includes(t)){if(K(r))return`bg${a(r,R,!1,"position:")}${n}`;let i=r.replace(/rgba?\([^)]+\)/g,"temp");if(/\)\s*,/.test(i))return`bg="[${mr(r)}]"`;if(r.startsWith("linear-gradient")){let m=r.replace(/rgba?\(([^)]+)\)/g,(f,c)=>f.replace(c,c.replace(/\s*,\s*/g,W))),g=m.match(nr);if(g){let[f,c,d,U]=g.slice(1);return f=f.split(" ").map(z=>z[0]).join(""),f?`bg-gradient-to-${f}${Z(c,d,U)}`:Z(c,d,U)}let u=m.match(or);return u?`bg-gradient-linear bg-gradient-[${u[1]},${u[2].replace(/\s+/,"_").replaceAll(W,",")},${u[3].replace(/\s+/,"_").replaceAll(W,",")}]`:void 0}else if(/^(?:radial|conic)-gradient/.test(r)){let g=r.replace(/rgba?\(([^)]+)\)/g,(U,z)=>U.replace(z,z.replace(/\s*,\s*/g,W))).match(er);if(!g)return;let u=g[1],[f,c,d]=g.slice(2);return`bg-gradient-${u}${Z(f,c,d)}`}let s=r.match(/^rgba?\([^)]+\)$/);if(s){let m=s[0];return`bg="${r.replace(m,`[${m}]`)}${n}"`}let p=r.match(/^url\(["'\s.\-\w/@]*\)$/);if(p)return`bg="${r.replace(p[0],`[${p[0].replace(/['"]/g,"")}]${n}`)}"`;if(r.includes(" ")){let m=r.split(" ").map(f=>q(t,`${f}${n?" !important":""}`)).join(" "),g=/bg-\[position:([^\]]*)\]/g,u=m.match(g);if(u&&u.length>1){let f=`bg-[position:${u.map(c=>c.replace(g,"$1")).join("_")}]`;m=`${m.replace(g,"").replace(/\s+/g," ").split(" ").filter(Boolean).concat([f]).join(" ")}`}return m}return`bg${a(r,R)}${n}`}return t==="background-blend-mode"?`bg-blend-${r}${n}`:`${ir(t,r)}-${sr(r)}${n}`}function ir(t,o){return o.endsWith("repeat")?"bg":t.replace("background","bg")}function sr(t){return/border|content|padding-box/.test(t)?t.replace("-box",""):t.startsWith("repeat-")?t.replace("repeat-",""):R(t)}function R(t){return t.replace(/\s+/," ").replace(" ","-")}function ar(t){return t.replace(/\s+/," ").replace(" ","_")}function Z(t,o,r){let n="";if(o&&!r&&(r=o,o=""),t){t=t.replaceAll(W,",");let[i,s]=t.split(" ");s?n+=` from="${b(i)?`[${i}]`:i} ${s}"`:i&&(n+=` from="${b(i)?`[${i}]`:i}"`)}if(o){o=o.replaceAll(W,",");let[i,s]=o.split(" ");s?n+=` via="${b(i)?`[${i}]`:i} ${s}"`:i&&(n+=` via="${b(i)?`[${i}]`:i}"`)}if(r){r=r.replaceAll(W,",");let[i,s]=r.split(" ");s?n+=` to="${b(i)?`[${i}]`:i} ${s}"`:i&&(n+=` to="${b(i)?`[${i}]`:i}"`)}return n}var et="__transform_to_unocss__";function mr(t){let o={},r=0;return t=t.replace(/(rgba?|hsla?|lab|lch|hwb|color)\(\)*\)/,n=>(o[r++]=n,`${et}${r}}`)),t=t.split(/\)\s*,/).map(n=>`${n.replace(/\s*,\s*/g,",").replace(/\s+/g,"_")}`).join("),"),Object.keys(o).forEach(n=>{t=t.replace(`${et}${n}}`,o[n])}),t}var it=["border-top","border-right","border-bottom","border-left"];function st(t,o){let[r,n]=e(o);if(t==="border-spacing")return`${t}="[${x(r)}]${n}"`;if(t==="border-color"){if(r.includes(" ")){let i=r.split(" ").length,s=r.split(" ").map(f=>L(f)||b(f)||N(f)?`-[${f}]`:`-${f}`),[p,m,g,u]=s;switch(i){case 2:return`border-y${p}${n} border-x${m}${n}`;case 3:return`border-t${p}${n} border-b${g}${n} border-x${m}${n}`;case 4:return`border-t${p}${n} border-b${g}${n} border-r${m}${n} border-l${u}${n}`}}return`border${a(r)}${n}`}return t==="border-radius"?v(r)||!r.includes(" ")?`border-rd${a(r)}${n}`:`border-rd="[${x(r)}]${n}"`:it.some(i=>t.startsWith(i))?r.split(" ").map(i=>`border-${t.split("-")[1][0]}${a(i)}${n}`).join(" "):t==="border-inline-end-width"?`border-e${a(r)}${n}`:t==="border-inline-start-width"?`border-s${a(r)}${n}`:t.startsWith("border-image")?"":t==="border-width"&&r.includes(" ")?r.split(" ").map((i,s)=>`border-${it[s].split("-")[1][0]}${a(i)}${n}`).join(" "):/^\d[%|(px)rem]$/.test(r)||t==="border-collapse"?`border-${r}${n}`:t==="border-width"||t==="border-style"?`border${a(r)}${n}`:t==="border-color"?r==="currentColor"?`border-current${n}`:`border${a(r)}${n}`:r.split(" ").map(i=>r==="currentColor"?`border-current${n}`:`border${a(i)}${n}`).join(" ")}function at(t,o){let[r,n]=e(o);return`text${a(r)}${n}`}function mt(t,o){let[r,n]=e(o);return t==="column-gap"?`gap-x-${r}${n}`:`${t}-${r}${n}`}function pt(t,o){let[r,n]=e(o);return r==='" "'||r==="' '"?`content-['_']${n}`:`content-[${r.replace(/"/g,"'")}]${n}`}function ct(t,o){let[r,n]=e(o);return`${t}${a(r)}${n}`}function A(t,o){let[r,n]=e(o);return r==="none"?`hidden${n}`:r==="hidden"?`invisible${n}`:`${r}${n}`}var pr={show:"visible",hide:"hidden"};function lt(t,o){var i;let[r,n]=e(o);return`table-empty-cells-${(i=pr[r])!=null?i:r}${n}`}var cr=["flex-basis","flex-grow","flex-shrink"];function ft(t,o){let[r,n]=e(o);if(cr.includes(t))return`${$(t)}${a(r)}${n}`;if(r==="1")return`flex-1${n}`;let i=r[0];return t==="flex"&&(i==="0"||i==="1")?`flex="[${x(r)}]${n}"`:`${l(t)}-${r.replace("column","col")}${n}`}function h(t,o){let[r,n]=e(o);return`${t}-${r}${n}`}function ut(t,o){let[r,n]=e(o);if(t==="font-size")return`text-${r}${n}`;if(t==="font-weight")return`font-${r}${n}`;if(t==="font-family"){let i=r.match(/ui-(\w{0,4})/);if(!i)return`font-${o}${n}`;let[s,p]=i;return`font-${p}${n}`}return t==="font-style"?r==="normal"?`font-not-italic${n}`:`font-${r}${n}`:t==="font-variant-numeric"?r==="normal"?`normal-nums${n}`:`${r}${n}`:`font="${lr(r)}${n}"`}function lr(t){return t.split(" ").map(o=>/^\d/.test(o)?`text-${o}`:o).join(" ")}function $t(t,o){let[r,n]=e(o);if(t.startsWith("grid-template")){let s=r.match(/repeat\s*\(\s*(\d+)/);return s?`grid-${$(t)==="rows"?"rows":"cols"}-${s[1]}${n}`:`grid-${$(t)==="rows"?"rows":"cols"}-${r.includes(" ")?`[${x(r)}]`:r}${n}`}if(t==="grid-auto-flow")return`grid-flow-${_(r).replace("column","col")}${n}`;if(t.startsWith("grid-auto")){let s=r.match(/minmax\s*\(\s*0\s*,\s*1fr/);return`auto-${$(t)==="rows"?"rows":"cols"}-${s?"fr":l(r)}${n}`}let i=r.match(/span\s+(\d)/);return i?`${t.slice(5).replace("column","col")}-span-${i[1]}${n}`:r==="1/-1"?`${t.slice(5).replace("column","col")}-span-full${n}`:`${t.slice(5).replace("column","col")}-${r}${n}`}function gt(t,o){let[r,n]=e(o);if(t==="inset-inline-start")return`start${a(r)}${n}`;if(t==="inset-inline-end")return`end${a(r)}${n}`}function dt(t,o){let[r,n]=e(o);return o==="isolate"?`${r}${n}`:`${t}-${r}${n}`}function bt(t,o){let[r,n]=e(o);return t==="justify-content"?`justify-${$(r)}${n}`:`${t}-${$(r)}${n}`}function xt(t,o){let[r,n]=e(o);return`tracking-${r}${n}`}var ht={1:"none",1.25:"tight",1.375:"snug",1.5:"normal",1.625:"relaxed",2:"loose"};function wt(t,o){let[r,n]=e(o);return r in ht?`lh-${ht[r]}${n}`:`lh${a(r,i=>/\d$/.test(i)?`[${i}]`:i)}${n}`}function w(t,o){let[r,n]=e(o);return`${l(t)}${a(r)}${n}`}var fr={"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 J(t,o){let[r,n]=e(o),i=fr[t];if(i)return`${i}${a(r)}${n}`;let s=r.split(" "),p=s.length;return p===1?`${t[0]}${a(s[0])}${n}`:p===2?`${t[0]}x${a(s[1])}${n} ${t[0]}y${a(s[0])}${n}`:p===3?`${t[0]}x${a(s[1])}${n} ${t[0]}t${a(s[0])}${n} ${t[0]}b${a(s[2])}${n}`:`${t[0]}t${a(s[0])}${n} ${t[0]}b${a(s[2])}${n} ${t[0]}l${a(s[3])}${n} ${t[0]}r${a(s[1])}${n}`}function Q(t,o){let[r,n]=e(o),i=t.split("-"),s=v(r)||j(r)?a(r):a(l(r));return`${i[0]}-${i[1][0]}${s}${n}`}function It(t,o){let[r,n]=e(o);return`mix-blend-${r}${n}`}function jt(t,o){let[r,n]=e(o);return t==="object-position"?`${l(t)}-${_(r)}${n}`:`${l(t)}-${r}${n}`}function _t(t,o){let[r,n]=e(o);return S(o)?`op-${r.replace("%","")}${n}`:`op-${+r*100}${n}`}function Wt(t,o){let[r,n]=e(o);return t==="outline-offset"?`${t}-${r}${n}`:`${l(t)}-${r}${n}`}function vt(t,o){let[r,n]=e(o),[i,s,p]=t.split("-");return p?`${i}-${p}-${r}${n}`:`${i}-${r}${n}`}function Vt(t,o){let[r,n]=e(o);return`${t}-${$(r)}${n}`}var ur={vertical:"y",horizontal:"x"};function Lt(t,o){let[r,n]=e(o);return r==="both"?`${t}${n}`:`${t}-${ur[r]||r}${n}`}function Nt(t,o){let[r,n]=e(o);return`gap-y-${r}${n}`}function Ft(t,o){let[r,n]=e(o);if(t.startsWith("scroll-snap"))return`snap-${r}${n}`;if(t==="scroll-behavior")return`scroll-${r}${n}`;let[i,s,p,m]=t.match(/scroll-(margin|padding)-?(\w+)?-?(\w+)?/);return p==="inline"&&m?`scroll-${s[0]}${m[0]}-${r}${n}`:p?`scroll-${s[0]}${p[0]}-${r}${n}`:`scroll-${s[0]}-${r}${n}`}function M(t,o){let[r,n]=e(o);return r.startsWith("-")?`-${t[0]}${a(r.slice(1),l)}${n}`:`${t[0]}${a(r,l)}${n}`}function Rt(t,o){let[r,n]=e(o);return t==="text-decoration-line"?r==="none"?`no-underline${n}`:`${r}${n}`:t==="text-transform"?r==="none"?`normal-case${n}`:`${r}${n}`:t.startsWith("text-decoration")||t==="text-indent"?`${t.split("-")[1]}${a(r)}${n}`:t==="text-underline-offset"?`underline-offset-${r}${n}`:`text-${r}${n}`}function V(t,o){let[r,n]=e(o);return`${t}${a(r)}${n}`}function Ut(t,o){let[r,n]=e(o);return t==="transform-origin"?`origin-${/\d/.test(r)&&r.includes(" ")?`[${x(r)}]`:_(r)}${n}`:t==="transform-style"?`transform-${r}`:o==="none"?`${t}-none`:D(r).split(" ").map(i=>{let s=i.match(/([a-z]+)(3d)?([A-Z])?\((.*)\)/);if(!s)return;let[p,m,g,u,f]=s;if(u){let c=f.replace(/,(?![^()]*\))/g," ").split(" ");return c.length>1?`${m}-${u.toLowerCase()}="${c.map(d=>j(d)?`[${d}]`:m==="scale"?I(d):P(d)).join(" ")}${n}"`:`${m}="${u.toLowerCase()}-${j(c[0])?`[${c[0]}]`:m==="scale"?I(c[0]):P(c[0])}${n}"`}else{let c=f.replace(/,(?![^()]*\))/g," ").split(" ");return c.length>1?m==="translate"?`${m}="[${c.join(",")}]"`:`${m}="${c.map(d=>j(d)?`[${d}]`:m==="scale"?I(d):P(d)).join(" ")}${n}"`:`${m}="${j(c[0])?`[${c[0]}]`:m==="scale"?I(c[0]):P(c[0])}${n}"`}}).filter(Boolean).join(" ")}function P(t){return t.endsWith("deg")?t.slice(0,-3):t}var $r=["transition-delay","transition-duration"];function zt(t,o){let[r,n]=e(o);if(t==="transition-timing-function")return r==="linear"?`ease-${r}${n}`:`ease="[${r}]${n}"`;if(t==="transition")return`transition="${gr(r)}"`;if(t==="transition-property")return r.includes("color")?`transition-color${n}`:r==="box-shadow"?`transition-shadow${n}`:`transition-${r}${n}`;if($r.includes(t))return`${t.split("-")[1]}-${r.slice(0,-2)}`}function gr(t){let o=!1;return t.split(" ").map(r=>/^\d/.test(r)||/^\.\d/.test(r)?o?`delay${a(r,void 0,!0)}`:(o=!0,`duration${a(r,void 0,!0)}`):r==="background-color"?"colors":r).join(" ")}function St(t,o){let[r,n]=e(o);return`${$(t)}-${r}${n}`}function Tt(t,o){let[r,n]=e(o);return`v-${r}${n}`}function Ct(t,o){let[r,n]=e(o);return`whitespace-${r}${n}`}function At(t,o){let[r,n]=e(o);return`${t}-${l(r)}${n}`}function Mt(t,o){let[r,n]=e(o);return t.startsWith("word-spacing")?`word-spacing${a(o)}`:r==="keep-all"?`break-keep${n}`:`break-${$(r)}${n}`}function Pt(t,o){return o==="horizontal-tb"?"write-normal":`write-${o.replace("-rl","-right").replace("-lr","-left")}`}var X={animation:rt,aspect:nt,backface:w,caption:w,column:mt,columns:h,break:h,empty:lt,box:T,writing:Pt,display:A,float:h,clear:h,isolation:dt,object:jt,overflow:h,overscroll:vt,position:A,top:V,left:V,right:V,bottom:V,visibility:A,z:M,flex:ft,order:h,grid:$t,gap:V,justify:bt,align:tt,place:Vt,padding:J,perspective:h,margin:J,width:M,min:Q,max:Q,height:M,font:ut,letter:xt,line:wt,list:w,text:Rt,vertical:Tt,white:Ct,word:Mt,content:pt,background:q,border:st,outline:Wt,opacity:_t,mix:It,filter:C,backdrop:ot,table:w,transition:zt,transform:Ut,accent:w,appearance:w,cursor:ct,caret:w,pointer:h,resize:Lt,scroll:Ft,inset:gt,touch:w,user:St,will:At,fill:h,stroke:w,color:at,row:Nt},dr=/([\w-]+)\s*:\s*([.\w()-\s%+'",#/!@]+)/;function H(t,o=!1){var g;t=t.replace(F,"");let r=t.match(dr);if(!r)return;let[n,i,s]=r,p=l(i),m=(g=X[p])==null?void 0:g.call(X,i,s);return m&&o?m.replace(/-([0-9.]+)px/,(u,f)=>`-${+f/4}`).replace(/\[[^\]]+\]/g,u=>u.replace(/([0-9.]+)px/g,(f,c)=>`${+c/16}rem`)):m}function B(t,o){let r=[],n=new Set;return[t.split(";").filter(Boolean).reduce((i,s)=>{let p=s.replaceAll(F,"").trim();if(n.has(p))return i;n.add(p);let m=H(s,o)||"";return m||r.push(s),i+=`${m} `},"").trim().replace(/\s+/g," "),r]}function Ht(t,o=!1){let[r,n]=B(t,o);return[r?r.replace(/([^\s=]+)="([^"]+)"/g,(i,s,p)=>p.split(" ").map(m=>`${s}-${m}`).join(" ")):"",n]}0&&(module.exports={browserReg,cssMathFnRE,diffTemplateStyle,flag,getFirstName,getHundred,getLastName,getStyleScoped,getVal,isCalc,isColor,isEmptyStyle,isHex,isHsl,isNot,isPercent,isRgb,isSize,isUrl,isVar,joinEmpty,joinWithLine,joinWithUnderLine,numberWithUnitRE,positionMap,toUnocss,toUnocssClass,transformImportant,transformStyleToUnocss,trim});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var er=".__unocss_transfer__",q=/^(?:calc|clamp|min|max)\s*\(.*\)/,Ct=/^-?[0-9.]+(px|rem|em|%|vw|vh|vmin|vmax|deg)$/;function ir(t){return/\[&:not\(/.test(t)}function V(t){return q.test(t)}function l(t){return t.split("-")[0]}function $(t){let o=t.split("-");return o[o.length-1]}function At(t){return t.startsWith("url(")}function P(t){return t.endsWith("%")&&!t.includes(" ")}function R(t){return/^#[0-9A-F]{2,}$/i.test(t)}function b(t){return t.startsWith("rgb")}function U(t){return t.startsWith("hsl")}function a(t,o,r,n=""){return V(t)||At(t)||R(t)||b(t)||U(t)||P(t)||j(t)?r?`-[${n}${Z(t,"all").replace(/['"]/g,"")}]`:`="[${n}${Z(t,"all").replace(/['"]/g,"")}]"`:n?`-[${n}${o?o(t):t}]`:`-${o?o(t):t}`}function I(t){return typeof t=="string"&&t.endsWith("%")?t.slice(0,-1):+t*100}function W(t){return t.replace(/\s+/," ").split(" ").join("-")}function w(t){return t.replace(/\s+/," ").split(" ").join("_")}var Mt=["top","right","bottom","left","center"];function Z(t,o="around"){return o==="pre"?t.replace(/(^\s*)/g,""):o==="post"?t.replace(/(\s*$)/g,""):o==="all"?t.replace(/\s+/g,""):o==="around"?t.replace(/(^\s*)|(\s*$)/g,""):t}function e(t){return t=t.replace(/\s+/," ").replace(/\s*,\s*/g,",").replace(/\s*\/\s*/,"/"),/rgb/.test(t)&&(t=t.replace(/rgba?\(([^)]+)\)/g,(o,r)=>{let n=r.trim().split(" ");return o.replace(r,n.map((i,s)=>i.endsWith(",")?i:i+(n.length-1===s?"":",")).join(""))})),/hsl/.test(t)&&(t=t.replace(/hsla?\(([^)]+)\)/g,(o,r)=>{let n=r.trim().split(" ");return o.replace(r,n.map((i,s)=>i.endsWith(",")?i:i+(n.length-1===s?"":",")).join(""))})),/var\([^)]+\)/.test(t)&&(t=t.replace(/var\(([^)]+)\)/g,(o,r)=>{let n=r.trim().split(" ");return o.replace(r,n.map((i,s)=>i.endsWith(",")?i:i+(n.length-1===s?"":",")).join(""))})),t.endsWith("!important")?[t.replace(/\s*!important/,"").trim(),"!"]:[t.trim(),""]}function sr(t,o){let r=t.match(/<style scoped>.*<\/style>/s),n=o.match(/<style scoped>.*<\/style>/s);return r[0]===n[0]}function ar(t){return/<style scoped>\s*<\/style>/.test(t)}function mr(t){let o=t.match(/<style scoped>(.*)<\/style>/s);return o?o[1]:""}function J(t){return t.replace(/\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s*,\s*/g,",")}function j(t){return t.startsWith("var(--")}function Q(t){return q.test(t)||Ct.test(t)||Mt.includes(t)}function pr(t){return R(t)||b(t)||U(t)}var z=/-webkit-|-moz-|-ms-|-o-/g;function X(t,o){let[r,n]=e(o);return`${$(t)}-${$(r)}${n}`}function Y(t,o){let[r,n]=e(o);return t==="animation-delay"?`animate${a(r)}${n}`:t==="animation"?`animate-${r.split(" ")[0]}${n}`:`animate-${r}${n}`}function y(t,o){let[r,n]=e(o);return r==="auto"?`${l(t)}-${r}`:`${l(t)}="[${r}]${n}"`}var Pt=["box-shadow","drop-shadow"];function S(t,o){let[r,n]=e(o);if(t.startsWith("box-decoration"))return`box-decoration-${r}${n}`;if(t==="box-sizing")return`box-${l(r)}${n}`;if(Pt.includes(t))return`shadow="[${r.split(" ").join("_")}]${n}"`}var Ht=["contrast","brightness","saturate"],Bt=["grayscale","invert","sepia"];function T(t,o){let[r,n]=e(o),[i,s,p]=r.match(/([\w-]+)\((.*)\)/);return Ht.includes(s)?`${s}-${I(p)}${n}`:s==="drop-shadow"?`drop-${S(s,p)}${n}`:Bt.includes(s)?`${s}-${p.endsWith("%")?p.slice(0,-1):I(p)}${n}`:s==="hue-rotate"?`${s}-${p.slice(0,-3)}${n}`:`${s}-${p}${n}`}function k(t,o){let[r,n]=e(o);return`backdrop-${T(t,r)}${n}`}var Et=["background-color","background-attachment","background-position"],Gt=/linear-gradient\(\s*to([\w\s]+),?([\w()#%\s.]+)?,([\w()#%\s.]+)?,?([\w#%\s.]+)?\)$/,Ot=/linear-gradient\(\s*([^,]*),?([\w()#%\s.]+)?,([\w()#%\s.]+)?,?([\w#%\s.]+)?\)$/,Dt=/(radial|conic)-gradient\(([\w()#%\s.]+)?,([\w()#%\s.]+)?,?([\w#%\s.]+)?\)$/,_="__comma__";function B(t,o){let[r,n]=e(o);if(t==="background-size")return`bg${a(r,/\d/.test(r)?qt:L,!1,"length:")}${n}`;if(Et.includes(t))return`bg${a(r,L)}${n}`;if(["background","background-image"].includes(t)){if(Q(r))return`bg${a(r,L,!1,"position:")}${n}`;let i=r.replace(/rgba?\([^)]+\)/g,"temp");if(/\)\s*,/.test(i))return`bg="[${Jt(r)}]"`;if(r.startsWith("linear-gradient")){let m=r.replace(/rgba?\(([^)]+)\)/g,(f,c)=>f.replace(c,c.replace(/\s*,\s*/g,_))),g=m.match(Gt);if(g){let[f,c,d,N]=g.slice(1);return f=f.split(" ").map(F=>F[0]).join(""),f?`bg-gradient-to-${f}${H(c,d,N)}`:H(c,d,N)}let u=m.match(Ot);return u?`bg-gradient-linear bg-gradient-[${u[1]},${u[2].replace(/\s+/,"_").replaceAll(_,",")},${u[3].replace(/\s+/,"_").replaceAll(_,",")}]`:void 0}else if(/^(?:radial|conic)-gradient/.test(r)){let g=r.replace(/rgba?\(([^)]+)\)/g,(N,F)=>N.replace(F,F.replace(/\s*,\s*/g,_))).match(Dt);if(!g)return;let u=g[1],[f,c,d]=g.slice(2);return`bg-gradient-${u}${H(f,c,d)}`}let s=r.match(/^rgba?\([^)]+\)$/);if(s){let m=s[0];return`bg="${r.replace(m,`[${m}]`)}${n}"`}let p=r.match(/^url\(["'\s.\-\w/@]*\)$/);if(p)return`bg="${r.replace(p[0],`[${p[0].replace(/['"]/g,"")}]${n}`)}"`;if(r.includes(" ")){let m=r.split(" ").map(f=>B(t,`${f}${n?" !important":""}`)).join(" "),g=/bg-\[position:([^\]]*)\]/g,u=m.match(g);if(u&&u.length>1){let f=`bg-[position:${u.map(c=>c.replace(g,"$1")).join("_")}]`;m=`${m.replace(g,"").replace(/\s+/g," ").split(" ").filter(Boolean).concat([f]).join(" ")}`}return m}return`bg${a(r,L)}${n}`}return t==="background-blend-mode"?`bg-blend-${r}${n}`:`${Kt(t,r)}-${Zt(r)}${n}`}function Kt(t,o){return o.endsWith("repeat")?"bg":t.replace("background","bg")}function Zt(t){return/border|content|padding-box/.test(t)?t.replace("-box",""):t.startsWith("repeat-")?t.replace("repeat-",""):L(t)}function L(t){return t.replace(/\s+/," ").replace(" ","-")}function qt(t){return t.replace(/\s+/," ").replace(" ","_")}function H(t,o,r){let n="";if(o&&!r&&(r=o,o=""),t){t=t.replaceAll(_,",");let[i,s]=t.split(" ");s?n+=` from="${b(i)?`[${i}]`:i} ${s}"`:i&&(n+=` from="${b(i)?`[${i}]`:i}"`)}if(o){o=o.replaceAll(_,",");let[i,s]=o.split(" ");s?n+=` via="${b(i)?`[${i}]`:i} ${s}"`:i&&(n+=` via="${b(i)?`[${i}]`:i}"`)}if(r){r=r.replaceAll(_,",");let[i,s]=r.split(" ");s?n+=` to="${b(i)?`[${i}]`:i} ${s}"`:i&&(n+=` to="${b(i)?`[${i}]`:i}"`)}return n}var tt="__transform_to_unocss__";function Jt(t){let o={},r=0;return t=t.replace(/(rgba?|hsla?|lab|lch|hwb|color)\(\)*\)/,n=>(o[r++]=n,`${tt}${r}}`)),t=t.split(/\)\s*,/).map(n=>`${n.replace(/\s*,\s*/g,",").replace(/\s+/g,"_")}`).join("),"),Object.keys(o).forEach(n=>{t=t.replace(`${tt}${n}}`,o[n])}),t}var rt=["border-top","border-right","border-bottom","border-left"];function nt(t,o){let[r,n]=e(o);if(t==="border-spacing")return`${t}="[${w(r)}]${n}"`;if(t==="border-color"){if(r.includes(" ")){let i=r.split(" ").length,s=r.split(" ").map(f=>R(f)||b(f)||U(f)?`-[${f}]`:`-${f}`),[p,m,g,u]=s;switch(i){case 2:return`border-y${p}${n} border-x${m}${n}`;case 3:return`border-t${p}${n} border-b${g}${n} border-x${m}${n}`;case 4:return`border-t${p}${n} border-b${g}${n} border-r${m}${n} border-l${u}${n}`}}return`border${a(r)}${n}`}return t==="border-radius"?V(r)||!r.includes(" ")?`border-rd${a(r)}${n}`:`border-rd="[${w(r)}]${n}"`:rt.some(i=>t.startsWith(i))?r.split(" ").map(i=>`border-${t.split("-")[1][0]}${a(i)}${n}`).join(" "):t==="border-inline-end-width"?`border-e${a(r)}${n}`:t==="border-inline-start-width"?`border-s${a(r)}${n}`:t.startsWith("border-image")?"":t==="border-width"&&r.includes(" ")?r.split(" ").map((i,s)=>`border-${rt[s].split("-")[1][0]}${a(i)}${n}`).join(" "):/^\d[%|(px)rem]$/.test(r)||t==="border-collapse"?`border-${r}${n}`:t==="border-width"||t==="border-style"?`border${a(r)}${n}`:t==="border-color"?r==="currentColor"?`border-current${n}`:`border${a(r)}${n}`:r.split(" ").map(i=>r==="currentColor"?`border-current${n}`:`border${a(i)}${n}`).join(" ")}function ot(t,o){let[r,n]=e(o);return`text${a(r)}${n}`}function et(t,o){let[r,n]=e(o);return t==="column-gap"?`gap-x-${r}${n}`:`${t}-${r}${n}`}function it(t,o){let[r,n]=e(o);return r==='" "'||r==="' '"?`content-['_']${n}`:`content-[${r.replace(/"/g,"'")}]${n}`}function st(t,o){let[r,n]=e(o);return`${t}${a(r)}${n}`}function C(t,o){let[r,n]=e(o);return r==="none"?`hidden${n}`:r==="hidden"?`invisible${n}`:`${r}${n}`}var Qt={show:"visible",hide:"hidden"};function at(t,o){var i;let[r,n]=e(o);return`table-empty-cells-${(i=Qt[r])!=null?i:r}${n}`}var Xt=["flex-basis","flex-grow","flex-shrink"];function mt(t,o){let[r,n]=e(o);if(Xt.includes(t))return`${$(t)}${a(r)}${n}`;if(r==="1")return`flex-1${n}`;let i=r[0];return t==="flex"&&(i==="0"||i==="1")?`flex="[${w(r)}]${n}"`:`${l(t)}-${r.replace("column","col")}${n}`}function x(t,o){let[r,n]=e(o);return`${t}-${r}${n}`}function pt(t,o){let[r,n]=e(o);if(t==="font-size")return`text-${r}${n}`;if(t==="font-weight")return`font-${r}${n}`;if(t==="font-family"){let i=r.match(/ui-(\w{0,4})/);if(!i)return`font-${o}${n}`;let[s,p]=i;return`font-${p}${n}`}return t==="font-style"?r==="normal"?`font-not-italic${n}`:`font-${r}${n}`:t==="font-variant-numeric"?r==="normal"?`normal-nums${n}`:`${r}${n}`:`font="${Yt(r)}${n}"`}function Yt(t){return t.split(" ").map(o=>/^\d/.test(o)?`text-${o}`:o).join(" ")}function ct(t,o){let[r,n]=e(o);if(t.startsWith("grid-template")){let s=r.match(/repeat\s*\(\s*(\d+)/);return s?`grid-${$(t)==="rows"?"rows":"cols"}-${s[1]}${n}`:`grid-${$(t)==="rows"?"rows":"cols"}-${r.includes(" ")?`[${w(r)}]`:r}${n}`}if(t==="grid-auto-flow")return`grid-flow-${W(r).replace("column","col")}${n}`;if(t.startsWith("grid-auto")){let s=r.match(/minmax\s*\(\s*0\s*,\s*1fr/);return`auto-${$(t)==="rows"?"rows":"cols"}-${s?"fr":l(r)}${n}`}let i=r.match(/span\s+(\d)/);return i?`${t.slice(5).replace("column","col")}-span-${i[1]}${n}`:r==="1/-1"?`${t.slice(5).replace("column","col")}-span-full${n}`:`${t.slice(5).replace("column","col")}-${r}${n}`}function lt(t,o){let[r,n]=e(o);if(t==="inset-inline-start")return`start${a(r)}${n}`;if(t==="inset-inline-end")return`end${a(r)}${n}`}function ft(t,o){let[r,n]=e(o);return o==="isolate"?`${r}${n}`:`${t}-${r}${n}`}function ut(t,o){let[r,n]=e(o);return t==="justify-content"?`justify-${$(r)}${n}`:`${t}-${$(r)}${n}`}function $t(t,o){let[r,n]=e(o);return`tracking-${r}${n}`}var gt={1:"none",1.25:"tight",1.375:"snug",1.5:"normal",1.625:"relaxed",2:"loose"};function dt(t,o){let[r,n]=e(o);return r in gt?`lh-${gt[r]}${n}`:`lh${a(r)}${n}`}function h(t,o){let[r,n]=e(o);return`${l(t)}${a(r)}${n}`}var yt={"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 E(t,o){let[r,n]=e(o),i=yt[t];if(i)return`${i}${a(r)}${n}`;let s=r.split(" "),p=s.length;return p===1?`${t[0]}${a(s[0])}${n}`:p===2?`${t[0]}x${a(s[1])}${n} ${t[0]}y${a(s[0])}${n}`:p===3?`${t[0]}x${a(s[1])}${n} ${t[0]}t${a(s[0])}${n} ${t[0]}b${a(s[2])}${n}`:`${t[0]}t${a(s[0])}${n} ${t[0]}b${a(s[2])}${n} ${t[0]}l${a(s[3])}${n} ${t[0]}r${a(s[1])}${n}`}function G(t,o){let[r,n]=e(o),i=t.split("-"),s=V(r)||j(r)?a(r):a(l(r));return`${i[0]}-${i[1][0]}${s}${n}`}function bt(t,o){let[r,n]=e(o);return`mix-blend-${r}${n}`}function xt(t,o){let[r,n]=e(o);return t==="object-position"?`${l(t)}-${W(r)}${n}`:`${l(t)}-${r}${n}`}function ht(t,o){let[r,n]=e(o);return P(o)?`op-${r.replace("%","")}${n}`:`op-${+r*100}${n}`}function wt(t,o){let[r,n]=e(o);return t==="outline-offset"?`${t}-${r}${n}`:`${l(t)}-${r}${n}`}function It(t,o){let[r,n]=e(o),[i,s,p]=t.split("-");return p?`${i}-${p}-${r}${n}`:`${i}-${r}${n}`}function jt(t,o){let[r,n]=e(o);return`${t}-${$(r)}${n}`}var kt={vertical:"y",horizontal:"x"};function _t(t,o){let[r,n]=e(o);return r==="both"?`${t}${n}`:`${t}-${kt[r]||r}${n}`}function Wt(t,o){let[r,n]=e(o);return`gap-y-${r}${n}`}function vt(t,o){let[r,n]=e(o);if(t.startsWith("scroll-snap"))return`snap-${r}${n}`;if(t==="scroll-behavior")return`scroll-${r}${n}`;let[i,s,p,m]=t.match(/scroll-(margin|padding)-?(\w+)?-?(\w+)?/);return p==="inline"&&m?`scroll-${s[0]}${m[0]}-${r}${n}`:p?`scroll-${s[0]}${p[0]}-${r}${n}`:`scroll-${s[0]}-${r}${n}`}function A(t,o){let[r,n]=e(o);return r.startsWith("-")?`-${t[0]}${a(r.slice(1),l)}${n}`:`${t[0]}${a(r,l)}${n}`}function Vt(t,o){let[r,n]=e(o);return t==="text-decoration-line"?r==="none"?`no-underline${n}`:`${r}${n}`:t==="text-transform"?r==="none"?`normal-case${n}`:`${r}${n}`:t.startsWith("text-decoration")||t==="text-indent"?`${t.split("-")[1]}${a(r)}${n}`:t==="text-underline-offset"?`underline-offset-${r}${n}`:`text-${r}${n}`}function v(t,o){let[r,n]=e(o);return`${t}${a(r)}${n}`}function Lt(t,o){let[r,n]=e(o);return t==="transform-origin"?`origin-${/\d/.test(r)&&r.includes(" ")?`[${w(r)}]`:W(r)}${n}`:t==="transform-style"?`transform-${r}`:o==="none"?`${t}-none`:J(r).split(" ").map(i=>{let s=i.match(/([a-z]+)(3d)?([A-Z])?\((.*)\)/);if(!s)return;let[p,m,g,u,f]=s;if(u){let c=f.replace(/,(?![^()]*\))/g," ").split(" ");return c.length>1?`${m}-${u.toLowerCase()}="${c.map(d=>j(d)?`[${d}]`:m==="scale"?I(d):M(d)).join(" ")}${n}"`:`${m}="${u.toLowerCase()}-${j(c[0])?`[${c[0]}]`:m==="scale"?I(c[0]):M(c[0])}${n}"`}else{let c=f.replace(/,(?![^()]*\))/g," ").split(" ");return c.length>1?m==="translate"?`${m}="[${c.join(",")}]"`:`${m}="${c.map(d=>j(d)?`[${d}]`:m==="scale"?I(d):M(d)).join(" ")}${n}"`:`${m}="${j(c[0])?`[${c[0]}]`:m==="scale"?I(c[0]):M(c[0])}${n}"`}}).filter(Boolean).join(" ")}function M(t){return t.endsWith("deg")?t.slice(0,-3):t}var tr=["transition-delay","transition-duration"];function Nt(t,o){let[r,n]=e(o);if(t==="transition-timing-function")return r==="linear"?`ease-${r}${n}`:`ease="[${r}]${n}"`;if(t==="transition")return`transition="${rr(r)}"`;if(t==="transition-property")return r.includes("color")?`transition-color${n}`:r==="box-shadow"?`transition-shadow${n}`:`transition-${r}${n}`;if(tr.includes(t))return`${t.split("-")[1]}-${r.slice(0,-2)}`}function rr(t){let o=!1;return t.split(" ").map(r=>/^\d/.test(r)||/^\.\d/.test(r)?o?`delay${a(r,void 0,!0)}`:(o=!0,`duration${a(r,void 0,!0)}`):r==="background-color"?"colors":r).join(" ")}function Ft(t,o){let[r,n]=e(o);return`${$(t)}-${r}${n}`}function Rt(t,o){let[r,n]=e(o);return`v-${r}${n}`}function Ut(t,o){let[r,n]=e(o);return`whitespace-${r}${n}`}function zt(t,o){let[r,n]=e(o);return`${t}-${l(r)}${n}`}function St(t,o){let[r,n]=e(o);return t.startsWith("word-spacing")?`word-spacing${a(o)}`:r==="keep-all"?`break-keep${n}`:`break-${$(r)}${n}`}function Tt(t,o){return o==="horizontal-tb"?"write-normal":`write-${o.replace("-rl","-right").replace("-lr","-left")}`}var O={animation:Y,aspect:y,backface:h,caption:h,column:et,columns:x,break:x,empty:at,box:S,writing:Tt,display:C,float:x,clear:x,isolation:ft,object:xt,overflow:x,overscroll:It,position:C,top:v,left:v,right:v,bottom:v,visibility:C,z:A,flex:mt,order:x,grid:ct,gap:v,justify:ut,align:X,place:jt,padding:E,perspective:x,margin:E,width:A,min:G,max:G,height:A,font:pt,letter:$t,line:dt,list:h,text:Vt,vertical:Rt,white:Ut,word:St,content:it,background:B,border:nt,outline:wt,opacity:ht,mix:bt,filter:T,backdrop:k,table:h,transition:Nt,transform:Lt,accent:h,appearance:h,cursor:st,caret:h,pointer:x,resize:_t,scroll:vt,inset:lt,touch:h,user:Ft,will:zt,fill:x,stroke:h,color:ot,row:Wt},nr=/([\w-]+)\s*:\s*([.\w()-\s%+'",#/!@]+)/;function D(t,o=!1){var g;t=t.replace(z,"");let r=t.match(nr);if(!r)return;let[n,i,s]=r,p=l(i),m=(g=O[p])==null?void 0:g.call(O,i,s);return m&&o?m.replace(/-([0-9.]+)px/,(u,f)=>`-${+f/4}`).replace(/\[[^\]]+\]/g,u=>u.replace(/([0-9.]+)px/g,(f,c)=>`${+c/16}rem`)):m}function K(t,o){let r=[],n=new Set;return[t.split(";").filter(Boolean).reduce((i,s)=>{let p=s.replaceAll(z,"").trim();if(n.has(p))return i;n.add(p);let m=D(s,o)||"";return m||r.push(s),i+=`${m} `},"").trim().replace(/\s+/g," "),r]}function or(t,o=!1){let[r,n]=K(t,o);return[r?r.replace(/([^\s=]+)="([^"]+)"/g,(i,s,p)=>p.split(" ").map(m=>`${s}-${m}`).join(" ")):"",n]}export{z as browserReg,q as cssMathFnRE,sr as diffTemplateStyle,er as flag,l as getFirstName,I as getHundred,$ as getLastName,mr as getStyleScoped,a as getVal,V as isCalc,pr as isColor,ar as isEmptyStyle,R as isHex,U as isHsl,ir as isNot,P as isPercent,b as isRgb,Q as isSize,At as isUrl,j as isVar,J as joinEmpty,W as joinWithLine,w as joinWithUnderLine,Ct as numberWithUnitRE,Mt as positionMap,D as toUnocss,or as toUnocssClass,e as transformImportant,K as transformStyleToUnocss,Z as trim};
1
+ var er=".__unocss_transfer__",q=/^(?:calc|clamp|min|max)\s*\(.*\)/,Ct=/^-?[0-9.]+(px|rem|em|%|vw|vh|vmin|vmax|deg)$/;function ir(t){return/\[&:not\(/.test(t)}function V(t){return q.test(t)}function l(t){return t.split("-")[0]}function $(t){let o=t.split("-");return o[o.length-1]}function At(t){return t.startsWith("url(")}function P(t){return t.endsWith("%")&&!t.includes(" ")}function R(t){return/^#[0-9A-F]{2,}$/i.test(t)}function b(t){return t.startsWith("rgb")}function U(t){return t.startsWith("hsl")}function a(t,o,r,n=""){return V(t)||At(t)||R(t)||b(t)||U(t)||P(t)||j(t)?r?`-[${n}${Z(t,"all").replace(/['"]/g,"")}]`:`="[${n}${Z(t,"all").replace(/['"]/g,"")}]"`:n?`-[${n}${o?o(t):t}]`:`-${o?o(t):t}`}function I(t){return typeof t=="string"&&t.endsWith("%")?t.slice(0,-1):+t*100}function W(t){return t.replace(/\s+/," ").split(" ").join("-")}function w(t){return t.replace(/\s+/," ").split(" ").join("_")}var Mt=["top","right","bottom","left","center"];function Z(t,o="around"){return o==="pre"?t.replace(/(^\s*)/g,""):o==="post"?t.replace(/(\s*$)/g,""):o==="all"?t.replace(/\s+/g,""):o==="around"?t.replace(/(^\s*)|(\s*$)/g,""):t}function e(t){return t=t.replace(/\s+/," ").replace(/\s*,\s*/g,",").replace(/\s*\/\s*/,"/"),/rgb/.test(t)&&(t=t.replace(/rgba?\(([^)]+)\)/g,(o,r)=>{let n=r.trim().split(" ");return o.replace(r,n.map((i,s)=>i.endsWith(",")?i:i+(n.length-1===s?"":",")).join(""))})),/hsl/.test(t)&&(t=t.replace(/hsla?\(([^)]+)\)/g,(o,r)=>{let n=r.trim().split(" ");return o.replace(r,n.map((i,s)=>i.endsWith(",")?i:i+(n.length-1===s?"":",")).join(""))})),/var\([^)]+\)/.test(t)&&(t=t.replace(/var\(([^)]+)\)/g,(o,r)=>{let n=r.trim().split(" ");return o.replace(r,n.map((i,s)=>i.endsWith(",")?i:i+(n.length-1===s?"":",")).join(""))})),t.endsWith("!important")?[t.replace(/\s*!important/,"").trim(),"!"]:[t.trim(),""]}function sr(t,o){let r=t.match(/<style scoped>.*<\/style>/s),n=o.match(/<style scoped>.*<\/style>/s);return r[0]===n[0]}function ar(t){return/<style scoped>\s*<\/style>/.test(t)}function mr(t){let o=t.match(/<style scoped>(.*)<\/style>/s);return o?o[1]:""}function J(t){return t.replace(/\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s*,\s*/g,",")}function j(t){return t.startsWith("var(--")}function Q(t){return q.test(t)||Ct.test(t)||Mt.includes(t)}function pr(t){return R(t)||b(t)||U(t)}var z=/-webkit-|-moz-|-ms-|-o-/g;function X(t,o){let[r,n]=e(o);return`${$(t)}-${$(r)}${n}`}function Y(t,o){let[r,n]=e(o);return t==="animation-delay"?`animate${a(r)}${n}`:t==="animation"?`animate-${r.split(" ")[0]}${n}`:`animate-${r}${n}`}function y(t,o){let[r,n]=e(o);return r==="auto"?`${l(t)}-${r}`:`${l(t)}="[${r}]${n}"`}var Pt=["box-shadow","drop-shadow"];function S(t,o){let[r,n]=e(o);if(t.startsWith("box-decoration"))return`box-decoration-${r}${n}`;if(t==="box-sizing")return`box-${l(r)}${n}`;if(Pt.includes(t))return`shadow="[${r.split(" ").join("_")}]${n}"`}var Ht=["contrast","brightness","saturate"],Bt=["grayscale","invert","sepia"];function T(t,o){let[r,n]=e(o),[i,s,p]=r.match(/([\w-]+)\((.*)\)/);return Ht.includes(s)?`${s}-${I(p)}${n}`:s==="drop-shadow"?`drop-${S(s,p)}${n}`:Bt.includes(s)?`${s}-${p.endsWith("%")?p.slice(0,-1):I(p)}${n}`:s==="hue-rotate"?`${s}-${p.slice(0,-3)}${n}`:`${s}-${p}${n}`}function k(t,o){let[r,n]=e(o);return`backdrop-${T(t,r)}${n}`}var Et=["background-color","background-attachment","background-position"],Gt=/linear-gradient\(\s*to([\w\s]+),?([\w()#%\s.]+)?,([\w()#%\s.]+)?,?([\w#%\s.]+)?\)$/,Ot=/linear-gradient\(\s*([^,]*),?([\w()#%\s.]+)?,([\w()#%\s.]+)?,?([\w#%\s.]+)?\)$/,Dt=/(radial|conic)-gradient\(([\w()#%\s.]+)?,([\w()#%\s.]+)?,?([\w#%\s.]+)?\)$/,_="__comma__";function B(t,o){let[r,n]=e(o);if(t==="background-size")return`bg${a(r,/\d/.test(r)?qt:L,!1,"length:")}${n}`;if(Et.includes(t))return`bg${a(r,L)}${n}`;if(["background","background-image"].includes(t)){if(Q(r))return`bg${a(r,L,!1,"position:")}${n}`;let i=r.replace(/rgba?\([^)]+\)/g,"temp");if(/\)\s*,/.test(i))return`bg="[${Jt(r)}]"`;if(r.startsWith("linear-gradient")){let m=r.replace(/rgba?\(([^)]+)\)/g,(f,c)=>f.replace(c,c.replace(/\s*,\s*/g,_))),g=m.match(Gt);if(g){let[f,c,d,N]=g.slice(1);return f=f.split(" ").map(F=>F[0]).join(""),f?`bg-gradient-to-${f}${H(c,d,N)}`:H(c,d,N)}let u=m.match(Ot);return u?`bg-gradient-linear bg-gradient-[${u[1]},${u[2].replace(/\s+/,"_").replaceAll(_,",")},${u[3].replace(/\s+/,"_").replaceAll(_,",")}]`:void 0}else if(/^(?:radial|conic)-gradient/.test(r)){let g=r.replace(/rgba?\(([^)]+)\)/g,(N,F)=>N.replace(F,F.replace(/\s*,\s*/g,_))).match(Dt);if(!g)return;let u=g[1],[f,c,d]=g.slice(2);return`bg-gradient-${u}${H(f,c,d)}`}let s=r.match(/^rgba?\([^)]+\)$/);if(s){let m=s[0];return`bg="${r.replace(m,`[${m}]`)}${n}"`}let p=r.match(/^url\(["'\s.\-\w/@]*\)$/);if(p)return`bg="${r.replace(p[0],`[${p[0].replace(/['"]/g,"")}]${n}`)}"`;if(r.includes(" ")){let m=r.split(" ").map(f=>B(t,`${f}${n?" !important":""}`)).join(" "),g=/bg-\[position:([^\]]*)\]/g,u=m.match(g);if(u&&u.length>1){let f=`bg-[position:${u.map(c=>c.replace(g,"$1")).join("_")}]`;m=`${m.replace(g,"").replace(/\s+/g," ").split(" ").filter(Boolean).concat([f]).join(" ")}`}return m}return`bg${a(r,L)}${n}`}return t==="background-blend-mode"?`bg-blend-${r}${n}`:`${Kt(t,r)}-${Zt(r)}${n}`}function Kt(t,o){return o.endsWith("repeat")?"bg":t.replace("background","bg")}function Zt(t){return/border|content|padding-box/.test(t)?t.replace("-box",""):t.startsWith("repeat-")?t.replace("repeat-",""):L(t)}function L(t){return t.replace(/\s+/," ").replace(" ","-")}function qt(t){return t.replace(/\s+/," ").replace(" ","_")}function H(t,o,r){let n="";if(o&&!r&&(r=o,o=""),t){t=t.replaceAll(_,",");let[i,s]=t.split(" ");s?n+=` from="${b(i)?`[${i}]`:i} ${s}"`:i&&(n+=` from="${b(i)?`[${i}]`:i}"`)}if(o){o=o.replaceAll(_,",");let[i,s]=o.split(" ");s?n+=` via="${b(i)?`[${i}]`:i} ${s}"`:i&&(n+=` via="${b(i)?`[${i}]`:i}"`)}if(r){r=r.replaceAll(_,",");let[i,s]=r.split(" ");s?n+=` to="${b(i)?`[${i}]`:i} ${s}"`:i&&(n+=` to="${b(i)?`[${i}]`:i}"`)}return n}var tt="__transform_to_unocss__";function Jt(t){let o={},r=0;return t=t.replace(/(rgba?|hsla?|lab|lch|hwb|color)\(\)*\)/,n=>(o[r++]=n,`${tt}${r}}`)),t=t.split(/\)\s*,/).map(n=>`${n.replace(/\s*,\s*/g,",").replace(/\s+/g,"_")}`).join("),"),Object.keys(o).forEach(n=>{t=t.replace(`${tt}${n}}`,o[n])}),t}var rt=["border-top","border-right","border-bottom","border-left"];function nt(t,o){let[r,n]=e(o);if(t==="border-spacing")return`${t}="[${w(r)}]${n}"`;if(t==="border-color"){if(r.includes(" ")){let i=r.split(" ").length,s=r.split(" ").map(f=>R(f)||b(f)||U(f)?`-[${f}]`:`-${f}`),[p,m,g,u]=s;switch(i){case 2:return`border-y${p}${n} border-x${m}${n}`;case 3:return`border-t${p}${n} border-b${g}${n} border-x${m}${n}`;case 4:return`border-t${p}${n} border-b${g}${n} border-r${m}${n} border-l${u}${n}`}}return`border${a(r)}${n}`}return t==="border-radius"?V(r)||!r.includes(" ")?`border-rd${a(r)}${n}`:`border-rd="[${w(r)}]${n}"`:rt.some(i=>t.startsWith(i))?r.split(" ").map(i=>`border-${t.split("-")[1][0]}${a(i)}${n}`).join(" "):t==="border-inline-end-width"?`border-e${a(r)}${n}`:t==="border-inline-start-width"?`border-s${a(r)}${n}`:t.startsWith("border-image")?"":t==="border-width"&&r.includes(" ")?r.split(" ").map((i,s)=>`border-${rt[s].split("-")[1][0]}${a(i)}${n}`).join(" "):/^\d[%|(px)rem]$/.test(r)||t==="border-collapse"?`border-${r}${n}`:t==="border-width"||t==="border-style"?`border${a(r)}${n}`:t==="border-color"?r==="currentColor"?`border-current${n}`:`border${a(r)}${n}`:r.split(" ").map(i=>r==="currentColor"?`border-current${n}`:`border${a(i)}${n}`).join(" ")}function ot(t,o){let[r,n]=e(o);return`text${a(r)}${n}`}function et(t,o){let[r,n]=e(o);return t==="column-gap"?`gap-x-${r}${n}`:`${t}-${r}${n}`}function it(t,o){let[r,n]=e(o);return r==='" "'||r==="' '"?`content-['_']${n}`:`content-[${r.replace(/"/g,"'")}]${n}`}function st(t,o){let[r,n]=e(o);return`${t}${a(r)}${n}`}function C(t,o){let[r,n]=e(o);return r==="none"?`hidden${n}`:r==="hidden"?`invisible${n}`:`${r}${n}`}var Qt={show:"visible",hide:"hidden"};function at(t,o){var i;let[r,n]=e(o);return`table-empty-cells-${(i=Qt[r])!=null?i:r}${n}`}var Xt=["flex-basis","flex-grow","flex-shrink"];function mt(t,o){let[r,n]=e(o);if(Xt.includes(t))return`${$(t)}${a(r)}${n}`;if(r==="1")return`flex-1${n}`;let i=r[0];return t==="flex"&&(i==="0"||i==="1")?`flex="[${w(r)}]${n}"`:`${l(t)}-${r.replace("column","col")}${n}`}function x(t,o){let[r,n]=e(o);return`${t}-${r}${n}`}function pt(t,o){let[r,n]=e(o);if(t==="font-size")return`text-${r}${n}`;if(t==="font-weight")return`font-${r}${n}`;if(t==="font-family"){let i=r.match(/ui-(\w{0,4})/);if(!i)return`font-${o}${n}`;let[s,p]=i;return`font-${p}${n}`}return t==="font-style"?r==="normal"?`font-not-italic${n}`:`font-${r}${n}`:t==="font-variant-numeric"?r==="normal"?`normal-nums${n}`:`${r}${n}`:`font="${Yt(r)}${n}"`}function Yt(t){return t.split(" ").map(o=>/^\d/.test(o)?`text-${o}`:o).join(" ")}function ct(t,o){let[r,n]=e(o);if(t.startsWith("grid-template")){let s=r.match(/repeat\s*\(\s*(\d+)/);return s?`grid-${$(t)==="rows"?"rows":"cols"}-${s[1]}${n}`:`grid-${$(t)==="rows"?"rows":"cols"}-${r.includes(" ")?`[${w(r)}]`:r}${n}`}if(t==="grid-auto-flow")return`grid-flow-${W(r).replace("column","col")}${n}`;if(t.startsWith("grid-auto")){let s=r.match(/minmax\s*\(\s*0\s*,\s*1fr/);return`auto-${$(t)==="rows"?"rows":"cols"}-${s?"fr":l(r)}${n}`}let i=r.match(/span\s+(\d)/);return i?`${t.slice(5).replace("column","col")}-span-${i[1]}${n}`:r==="1/-1"?`${t.slice(5).replace("column","col")}-span-full${n}`:`${t.slice(5).replace("column","col")}-${r}${n}`}function lt(t,o){let[r,n]=e(o);if(t==="inset-inline-start")return`start${a(r)}${n}`;if(t==="inset-inline-end")return`end${a(r)}${n}`}function ft(t,o){let[r,n]=e(o);return o==="isolate"?`${r}${n}`:`${t}-${r}${n}`}function ut(t,o){let[r,n]=e(o);return t==="justify-content"?`justify-${$(r)}${n}`:`${t}-${$(r)}${n}`}function $t(t,o){let[r,n]=e(o);return`tracking-${r}${n}`}var gt={1:"none",1.25:"tight",1.375:"snug",1.5:"normal",1.625:"relaxed",2:"loose"};function dt(t,o){let[r,n]=e(o);return r in gt?`lh-${gt[r]}${n}`:`lh${a(r,i=>/\d$/.test(i)?`[${i}]`:i)}${n}`}function h(t,o){let[r,n]=e(o);return`${l(t)}${a(r)}${n}`}var yt={"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 E(t,o){let[r,n]=e(o),i=yt[t];if(i)return`${i}${a(r)}${n}`;let s=r.split(" "),p=s.length;return p===1?`${t[0]}${a(s[0])}${n}`:p===2?`${t[0]}x${a(s[1])}${n} ${t[0]}y${a(s[0])}${n}`:p===3?`${t[0]}x${a(s[1])}${n} ${t[0]}t${a(s[0])}${n} ${t[0]}b${a(s[2])}${n}`:`${t[0]}t${a(s[0])}${n} ${t[0]}b${a(s[2])}${n} ${t[0]}l${a(s[3])}${n} ${t[0]}r${a(s[1])}${n}`}function G(t,o){let[r,n]=e(o),i=t.split("-"),s=V(r)||j(r)?a(r):a(l(r));return`${i[0]}-${i[1][0]}${s}${n}`}function bt(t,o){let[r,n]=e(o);return`mix-blend-${r}${n}`}function xt(t,o){let[r,n]=e(o);return t==="object-position"?`${l(t)}-${W(r)}${n}`:`${l(t)}-${r}${n}`}function ht(t,o){let[r,n]=e(o);return P(o)?`op-${r.replace("%","")}${n}`:`op-${+r*100}${n}`}function wt(t,o){let[r,n]=e(o);return t==="outline-offset"?`${t}-${r}${n}`:`${l(t)}-${r}${n}`}function It(t,o){let[r,n]=e(o),[i,s,p]=t.split("-");return p?`${i}-${p}-${r}${n}`:`${i}-${r}${n}`}function jt(t,o){let[r,n]=e(o);return`${t}-${$(r)}${n}`}var kt={vertical:"y",horizontal:"x"};function _t(t,o){let[r,n]=e(o);return r==="both"?`${t}${n}`:`${t}-${kt[r]||r}${n}`}function Wt(t,o){let[r,n]=e(o);return`gap-y-${r}${n}`}function vt(t,o){let[r,n]=e(o);if(t.startsWith("scroll-snap"))return`snap-${r}${n}`;if(t==="scroll-behavior")return`scroll-${r}${n}`;let[i,s,p,m]=t.match(/scroll-(margin|padding)-?(\w+)?-?(\w+)?/);return p==="inline"&&m?`scroll-${s[0]}${m[0]}-${r}${n}`:p?`scroll-${s[0]}${p[0]}-${r}${n}`:`scroll-${s[0]}-${r}${n}`}function A(t,o){let[r,n]=e(o);return r.startsWith("-")?`-${t[0]}${a(r.slice(1),l)}${n}`:`${t[0]}${a(r,l)}${n}`}function Vt(t,o){let[r,n]=e(o);return t==="text-decoration-line"?r==="none"?`no-underline${n}`:`${r}${n}`:t==="text-transform"?r==="none"?`normal-case${n}`:`${r}${n}`:t.startsWith("text-decoration")||t==="text-indent"?`${t.split("-")[1]}${a(r)}${n}`:t==="text-underline-offset"?`underline-offset-${r}${n}`:`text-${r}${n}`}function v(t,o){let[r,n]=e(o);return`${t}${a(r)}${n}`}function Lt(t,o){let[r,n]=e(o);return t==="transform-origin"?`origin-${/\d/.test(r)&&r.includes(" ")?`[${w(r)}]`:W(r)}${n}`:t==="transform-style"?`transform-${r}`:o==="none"?`${t}-none`:J(r).split(" ").map(i=>{let s=i.match(/([a-z]+)(3d)?([A-Z])?\((.*)\)/);if(!s)return;let[p,m,g,u,f]=s;if(u){let c=f.replace(/,(?![^()]*\))/g," ").split(" ");return c.length>1?`${m}-${u.toLowerCase()}="${c.map(d=>j(d)?`[${d}]`:m==="scale"?I(d):M(d)).join(" ")}${n}"`:`${m}="${u.toLowerCase()}-${j(c[0])?`[${c[0]}]`:m==="scale"?I(c[0]):M(c[0])}${n}"`}else{let c=f.replace(/,(?![^()]*\))/g," ").split(" ");return c.length>1?m==="translate"?`${m}="[${c.join(",")}]"`:`${m}="${c.map(d=>j(d)?`[${d}]`:m==="scale"?I(d):M(d)).join(" ")}${n}"`:`${m}="${j(c[0])?`[${c[0]}]`:m==="scale"?I(c[0]):M(c[0])}${n}"`}}).filter(Boolean).join(" ")}function M(t){return t.endsWith("deg")?t.slice(0,-3):t}var tr=["transition-delay","transition-duration"];function Nt(t,o){let[r,n]=e(o);if(t==="transition-timing-function")return r==="linear"?`ease-${r}${n}`:`ease="[${r}]${n}"`;if(t==="transition")return`transition="${rr(r)}"`;if(t==="transition-property")return r.includes("color")?`transition-color${n}`:r==="box-shadow"?`transition-shadow${n}`:`transition-${r}${n}`;if(tr.includes(t))return`${t.split("-")[1]}-${r.slice(0,-2)}`}function rr(t){let o=!1;return t.split(" ").map(r=>/^\d/.test(r)||/^\.\d/.test(r)?o?`delay${a(r,void 0,!0)}`:(o=!0,`duration${a(r,void 0,!0)}`):r==="background-color"?"colors":r).join(" ")}function Ft(t,o){let[r,n]=e(o);return`${$(t)}-${r}${n}`}function Rt(t,o){let[r,n]=e(o);return`v-${r}${n}`}function Ut(t,o){let[r,n]=e(o);return`whitespace-${r}${n}`}function zt(t,o){let[r,n]=e(o);return`${t}-${l(r)}${n}`}function St(t,o){let[r,n]=e(o);return t.startsWith("word-spacing")?`word-spacing${a(o)}`:r==="keep-all"?`break-keep${n}`:`break-${$(r)}${n}`}function Tt(t,o){return o==="horizontal-tb"?"write-normal":`write-${o.replace("-rl","-right").replace("-lr","-left")}`}var O={animation:Y,aspect:y,backface:h,caption:h,column:et,columns:x,break:x,empty:at,box:S,writing:Tt,display:C,float:x,clear:x,isolation:ft,object:xt,overflow:x,overscroll:It,position:C,top:v,left:v,right:v,bottom:v,visibility:C,z:A,flex:mt,order:x,grid:ct,gap:v,justify:ut,align:X,place:jt,padding:E,perspective:x,margin:E,width:A,min:G,max:G,height:A,font:pt,letter:$t,line:dt,list:h,text:Vt,vertical:Rt,white:Ut,word:St,content:it,background:B,border:nt,outline:wt,opacity:ht,mix:bt,filter:T,backdrop:k,table:h,transition:Nt,transform:Lt,accent:h,appearance:h,cursor:st,caret:h,pointer:x,resize:_t,scroll:vt,inset:lt,touch:h,user:Ft,will:zt,fill:x,stroke:h,color:ot,row:Wt},nr=/([\w-]+)\s*:\s*([.\w()-\s%+'",#/!@]+)/;function D(t,o=!1){var g;t=t.replace(z,"");let r=t.match(nr);if(!r)return;let[n,i,s]=r,p=l(i),m=(g=O[p])==null?void 0:g.call(O,i,s);return m&&o?m.replace(/-([0-9.]+)px/,(u,f)=>`-${+f/4}`).replace(/\[[^\]]+\]/g,u=>u.replace(/([0-9.]+)px/g,(f,c)=>`${+c/16}rem`)):m}function K(t,o){let r=[],n=new Set;return[t.split(";").filter(Boolean).reduce((i,s)=>{let p=s.replaceAll(z,"").trim();if(n.has(p))return i;n.add(p);let m=D(s,o)||"";return m||r.push(s),i+=`${m} `},"").trim().replace(/\s+/g," "),r]}function or(t,o=!1){let[r,n]=K(t,o);return[r?r.replace(/([^\s=]+)="([^"]+)"/g,(i,s,p)=>p.split(" ").map(m=>`${s}-${m}`).join(" ")):"",n]}export{z as browserReg,q as cssMathFnRE,sr as diffTemplateStyle,er as flag,l as getFirstName,I as getHundred,$ as getLastName,mr as getStyleScoped,a as getVal,V as isCalc,pr as isColor,ar as isEmptyStyle,R as isHex,U as isHsl,ir as isNot,P as isPercent,b as isRgb,Q as isSize,At as isUrl,j as isVar,J as joinEmpty,W as joinWithLine,w as joinWithUnderLine,Ct as numberWithUnitRE,Mt as positionMap,D as toUnocss,or as toUnocssClass,e as transformImportant,K as transformStyleToUnocss,Z as trim};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "transform-to-unocss-core",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "",
5
5
  "author": "Simon He",
6
6
  "license": "MIT",