@unocss/runtime 0.49.0 → 0.49.2

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/core.global.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{function Te(t){let e=t.length,r=-1,n,s="",i=t.charCodeAt(0);for(;++r<e;){if(n=t.charCodeAt(r),n===0){s+="\uFFFD";continue}if(n===44){s+="\\,";continue}if(n>=1&&n<=31||n===127||r===0&&n>=48&&n<=57||r===1&&n>=48&&n<=57&&i===45){s+=`\\${n.toString(16)} `;continue}if(r===0&&e===1&&n===45){s+=`\\${t.charAt(r)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=t.charAt(r);continue}s+=`\\${t.charAt(r)}`}return s}var K=Te;function v(t=[]){return Array.isArray(t)?t:[t]}function L(t){return Array.from(new Set(t))}function b(t){return typeof t=="string"}function j(t){return b(t)?t:(Array.isArray(t)?t:Object.entries(t)).filter(e=>e[1]!=null)}function te(t){return Array.isArray(t)?t.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?t.map(e=>j(e)):[t]:[j(t)]}function be(t){return t.filter(([e,r],n)=>{if(e.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(t[s][0]===e&&t[s][1]===r)return!1;return!0})}function F(t){return t==null?"":be(t).map(([e,r])=>r!=null?`${e}:${r};`:void 0).filter(Boolean).join("")}function H(t){return t&&typeof t=="object"&&!Array.isArray(t)}function N(t,e){let r=t,n=e;if(Array.isArray(r))return[...n];let s={...r};return H(r)&&H(n)&&Object.keys(n).forEach(i=>{H(r[i])&&H(n[i])||Array.isArray(r[i])&&Array.isArray(n[i])?s[i]=N(r[i],n[i]):Object.assign(s,{[i]:n[i]})}),s}function k(t){let e,r,n;if(Array.isArray(t)){for(r=Array(e=t.length);e--;)r[e]=(n=t[e])&&typeof n=="object"?k(n):n;return r}if(Object.prototype.toString.call(t)==="[object Object]"){r={};for(e in t)e==="__proto__"?Object.defineProperty(r,e,{value:k(t[e]),configurable:!0,enumerable:!0,writable:!0}):r[e]=(n=t[e])&&typeof n=="object"?k(n):n;return r}return t}function re(t){return b(t[0])}function ne(t){return b(t[0])}var Re=/[\w\u00A0-\uFFFF-_:%-?]/,Y="$$shortcut-no-merge";function se(t=""){return Re.test(t)}function ie(t){return typeof t=="function"?{match:t}:t}function q(t){return t.length===3}function oe(t){return t!=null}function ae(){}var G=class{_map=new Map;get(e,r){let n=this._map.get(e);if(n)return n.get(r)}getFallback(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.has(r)||s.set(r,n),s.get(r)}set(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.set(r,n),this}has(e,r){return this._map.get(e)?.has(r)}delete(e,r){return this._map.get(e)?.delete(r)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([r,n])=>Array.from(n.entries()).map(([s,i])=>e(i,r,s)))}};var B={};function ve(t=["-",":"]){let e=t.join("|");return B[e]||(B[e]=new RegExp(`((?:[!@\\w+:_/-]|\\[&?>?:?.*\\])+?)(${e})\\(((?:[~!\\w\\s:/\\\\,%#.$?-]|\\[.*?\\])+?)\\)(?!\\s*?=>)`,"gm")),B[e].lastIndex=0,B[e]}function ce(t,e=["-",":"],r=5){let n=ve(e),s=!1,i=t.toString();do{let o=i;i=i.replace(n,(a,u,l,c)=>e.includes(l)?c.split(/\s/g).filter(Boolean).map(p=>p==="~"?u:p.replace(/^(!?)(.*)/,`$1${u}${l}$2`)).join(" "):a),s=i!==o,r-=1}while(s&&r);return typeof t=="string"?i:t.length()?t.overwrite(0,t.length(),i):t}var le=new Set;function ue(t){le.has(t)||(console.warn("[unocss]",t),le.add(t))}var Ae=/\\?[\s'"`;{}]+/g,Z=/\[(\\\W|[\w-])+:['"]?\S+?['"]?\]/g,Ue=new RegExp(`^${Z.source}$`),we=t=>{let e=new Set;for(let r of t.matchAll(Z))!t[r.index-1]?.match(/^[\s'"`]/)||e.add(r[0]);return t.split(Ae).forEach(r=>{se(r)&&!Ue.test(r)&&e.add(r)}),[...e]},J={name:"split",order:0,extract({code:t}){return we(t)}};function fe(){return{events:{},emit(t,...e){(this.events[t]||[]).forEach(r=>r(...e))},on(t,e){return(this.events[t]=this.events[t]||[]).push(e),()=>this.events[t]=(this.events[t]||[]).filter(r=>r!==e)}}}var z="default",I="preflights",$e="shortcuts",pe={[I]:-100,[$e]:-10,[z]:0};function de(t){return v(t).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}function Ve(t){let e=t.shortcuts?de(t.shortcuts):void 0;if(t.shortcuts=e,t.prefix||t.layer){let r=n=>{n[2]||(n[2]={});let s=n[2];s.prefix==null&&t.prefix&&(s.prefix=v(t.prefix)),s.layer==null&&t.layer&&(s.layer=t.layer)};e?.forEach(r),t.rules?.forEach(r)}return t}function Q(t={},e={}){let r=Object.assign({},e,t),n=(r.presets||[]).flatMap(v).map(Ve),s=[...n.filter(f=>f.enforce==="pre"),...n.filter(f=>!f.enforce),...n.filter(f=>f.enforce==="post")],i=Object.assign(pe,...n.map(f=>f.layers),t.layers);function o(f){return L([...s.flatMap(d=>v(d[f]||[])),...v(r[f]||[])])}let a=o("extractors");a.length||a.push(J),a.sort((f,d)=>(f.order||0)-(d.order||0));let u=o("rules"),l={},c=u.length,p=u.map((f,d)=>{if(re(f)){v(f[2]?.prefix||"").forEach(x=>{l[x+f[0]]=[d,f[1],f[2],f]});return}return[d,...f]}).filter(Boolean).reverse(),y=k([...s.map(f=>f.theme||{}),r.theme||{}].reduce((f,d)=>N(f,d),{}));o("extendTheme").forEach(f=>f(y));let E={templates:L(s.map(f=>v(f.autocomplete?.templates)).flat()),extractors:s.map(f=>v(f.autocomplete?.extractors)).flat().sort((f,d)=>(f.order||0)-(d.order||0))},A=v(o("separators"));return A.length||(A=[":","-"]),{mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:f=>f,...r,presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:i,theme:y,rulesSize:c,rulesDynamic:p,rulesStaticMap:l,preprocess:o("preprocess"),postprocess:o("postprocess"),preflights:o("preflights"),autocomplete:E,variants:o("variants").map(ie),shortcuts:de(o("shortcuts")).reverse(),extractors:a,safelist:o("safelist"),separators:A}}var he="0.49.0";var X=class{constructor(e={},r={}){this.userConfig=e;this.defaults=r;this.config=Q(e,r),this.events.emit("config",this.config)}version=he;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=fe();setConfig(e,r){!e||(r&&(this.defaults=r),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=Q(e,this.defaults),this.events.emit("config",this.config))}async applyExtractors(e,r,n=new Set){let s={get original(){return e},code:e,id:r};for(let i of this.config.extractors){let o=await i.extract(s);if(o)for(let a of o)n.add(a)}return n}makeContext(e,r){let n={rawSelector:e,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:r};return n}async parseToken(e,r){if(this.blocked.has(e))return;let n=`${e}${r?` ${r}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=e;for(let l of this.config.preprocess)s=l(e);if(this.isBlocked(s)){this.blocked.add(e),this._cache.set(n,null);return}let i=this.matchVariants(e,s);if(!i||this.isBlocked(i[1])){this.blocked.add(e),this._cache.set(n,null);return}let o=this.makeContext(e,[r||i[0],i[1],i[2],i[3]]);this.config.details&&(o.variants=[...i[3]]);let a=this.expandShortcut(o.currentSelector,o),u=a?await this.stringifyShortcuts(o.variantMatch,o,a[0],a[1]):(await this.parseUtil(o.variantMatch,o))?.map(l=>this.stringifyUtil(l,o)).filter(oe);if(u?.length)return this._cache.set(n,u),u;this._cache.set(n,null)}async generate(e,r={}){let{id:n,scope:s,preflights:i=!0,safelist:o=!0,minify:a=!1}=r,u=b(e)?await this.applyExtractors(e,n):Array.isArray(e)?new Set(e):e;o&&this.config.safelist.forEach(h=>u.add(h));let l=a?"":`
1
+ "use strict";(()=>{function Te(t){let e=t.length,r=-1,n,s="",i=t.charCodeAt(0);for(;++r<e;){if(n=t.charCodeAt(r),n===0){s+="\uFFFD";continue}if(n===44){s+="\\,";continue}if(n>=1&&n<=31||n===127||r===0&&n>=48&&n<=57||r===1&&n>=48&&n<=57&&i===45){s+=`\\${n.toString(16)} `;continue}if(r===0&&e===1&&n===45){s+=`\\${t.charAt(r)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=t.charAt(r);continue}s+=`\\${t.charAt(r)}`}return s}var K=Te;function v(t=[]){return Array.isArray(t)?t:[t]}function L(t){return Array.from(new Set(t))}function b(t){return typeof t=="string"}function j(t){return b(t)?t:(Array.isArray(t)?t:Object.entries(t)).filter(e=>e[1]!=null)}function te(t){return Array.isArray(t)?t.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?t.map(e=>j(e)):[t]:[j(t)]}function be(t){return t.filter(([e,r],n)=>{if(e.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(t[s][0]===e&&t[s][1]===r)return!1;return!0})}function F(t){return t==null?"":be(t).map(([e,r])=>r!=null?`${e}:${r};`:void 0).filter(Boolean).join("")}function H(t){return t&&typeof t=="object"&&!Array.isArray(t)}function N(t,e){let r=t,n=e;if(Array.isArray(r))return[...n];let s={...r};return H(r)&&H(n)&&Object.keys(n).forEach(i=>{H(r[i])&&H(n[i])||Array.isArray(r[i])&&Array.isArray(n[i])?s[i]=N(r[i],n[i]):Object.assign(s,{[i]:n[i]})}),s}function k(t){let e,r,n;if(Array.isArray(t)){for(r=Array(e=t.length);e--;)r[e]=(n=t[e])&&typeof n=="object"?k(n):n;return r}if(Object.prototype.toString.call(t)==="[object Object]"){r={};for(e in t)e==="__proto__"?Object.defineProperty(r,e,{value:k(t[e]),configurable:!0,enumerable:!0,writable:!0}):r[e]=(n=t[e])&&typeof n=="object"?k(n):n;return r}return t}function re(t){return b(t[0])}function ne(t){return b(t[0])}var Re=/[\w\u00A0-\uFFFF-_:%-?]/,Y="$$shortcut-no-merge";function se(t=""){return Re.test(t)}function ie(t){return typeof t=="function"?{match:t}:t}function q(t){return t.length===3}function oe(t){return t!=null}function ae(){}var G=class{_map=new Map;get(e,r){let n=this._map.get(e);if(n)return n.get(r)}getFallback(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.has(r)||s.set(r,n),s.get(r)}set(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.set(r,n),this}has(e,r){return this._map.get(e)?.has(r)}delete(e,r){return this._map.get(e)?.delete(r)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([r,n])=>Array.from(n.entries()).map(([s,i])=>e(i,r,s)))}};var B={};function ve(t=["-",":"]){let e=t.join("|");return B[e]||(B[e]=new RegExp(`((?:[!@\\w+:_/-]|\\[&?>?:?.*\\])+?)(${e})\\(((?:[~!\\w\\s:/\\\\,%#.$?-]|\\[.*?\\])+?)\\)(?!\\s*?=>)`,"gm")),B[e].lastIndex=0,B[e]}function ce(t,e=["-",":"],r=5){let n=ve(e),s=!1,i=t.toString();do{let o=i;i=i.replace(n,(a,u,l,c)=>e.includes(l)?c.split(/\s/g).filter(Boolean).map(p=>p==="~"?u:p.replace(/^(!?)(.*)/,`$1${u}${l}$2`)).join(" "):a),s=i!==o,r-=1}while(s&&r);return typeof t=="string"?i:t.length()?t.overwrite(0,t.length(),i):t}var le=new Set;function ue(t){le.has(t)||(console.warn("[unocss]",t),le.add(t))}var Ae=/\\?[\s'"`;{}]+/g,Z=/\[(\\\W|[\w-])+:['"]?\S+?['"]?\]/g,Ue=new RegExp(`^${Z.source}$`),we=t=>{let e=new Set;for(let r of t.matchAll(Z))!t[r.index-1]?.match(/^[\s'"`]/)||e.add(r[0]);return t.split(Ae).forEach(r=>{se(r)&&!Ue.test(r)&&e.add(r)}),[...e]},J={name:"split",order:0,extract({code:t}){return we(t)}};function fe(){return{events:{},emit(t,...e){(this.events[t]||[]).forEach(r=>r(...e))},on(t,e){return(this.events[t]=this.events[t]||[]).push(e),()=>this.events[t]=(this.events[t]||[]).filter(r=>r!==e)}}}var z="default",I="preflights",$e="shortcuts",pe={[I]:-100,[$e]:-10,[z]:0};function de(t){return v(t).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}function Ve(t){let e=t.shortcuts?de(t.shortcuts):void 0;if(t.shortcuts=e,t.prefix||t.layer){let r=n=>{n[2]||(n[2]={});let s=n[2];s.prefix==null&&t.prefix&&(s.prefix=v(t.prefix)),s.layer==null&&t.layer&&(s.layer=t.layer)};e?.forEach(r),t.rules?.forEach(r)}return t}function Q(t={},e={}){let r=Object.assign({},e,t),n=(r.presets||[]).flatMap(v).map(Ve),s=[...n.filter(f=>f.enforce==="pre"),...n.filter(f=>!f.enforce),...n.filter(f=>f.enforce==="post")],i=Object.assign(pe,...n.map(f=>f.layers),t.layers);function o(f){return L([...s.flatMap(d=>v(d[f]||[])),...v(r[f]||[])])}let a=o("extractors");a.length||a.push(J),a.sort((f,d)=>(f.order||0)-(d.order||0));let u=o("rules"),l={},c=u.length,p=u.map((f,d)=>{if(re(f)){v(f[2]?.prefix||"").forEach(x=>{l[x+f[0]]=[d,f[1],f[2],f]});return}return[d,...f]}).filter(Boolean).reverse(),y=k([...s.map(f=>f.theme||{}),r.theme||{}].reduce((f,d)=>N(f,d),{}));o("extendTheme").forEach(f=>f(y));let E={templates:L(s.map(f=>v(f.autocomplete?.templates)).flat()),extractors:s.map(f=>v(f.autocomplete?.extractors)).flat().sort((f,d)=>(f.order||0)-(d.order||0))},A=v(o("separators"));return A.length||(A=[":","-"]),{mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:f=>f,...r,presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:i,theme:y,rulesSize:c,rulesDynamic:p,rulesStaticMap:l,preprocess:o("preprocess"),postprocess:o("postprocess"),preflights:o("preflights"),autocomplete:E,variants:o("variants").map(ie),shortcuts:de(o("shortcuts")).reverse(),extractors:a,safelist:o("safelist"),separators:A}}var he="0.49.2";var X=class{constructor(e={},r={}){this.userConfig=e;this.defaults=r;this.config=Q(e,r),this.events.emit("config",this.config)}version=he;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=fe();setConfig(e,r){!e||(r&&(this.defaults=r),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=Q(e,this.defaults),this.events.emit("config",this.config))}async applyExtractors(e,r,n=new Set){let s={get original(){return e},code:e,id:r};for(let i of this.config.extractors){let o=await i.extract(s);if(o)for(let a of o)n.add(a)}return n}makeContext(e,r){let n={rawSelector:e,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:r};return n}async parseToken(e,r){if(this.blocked.has(e))return;let n=`${e}${r?` ${r}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=e;for(let l of this.config.preprocess)s=l(e);if(this.isBlocked(s)){this.blocked.add(e),this._cache.set(n,null);return}let i=this.matchVariants(e,s);if(!i||this.isBlocked(i[1])){this.blocked.add(e),this._cache.set(n,null);return}let o=this.makeContext(e,[r||i[0],i[1],i[2],i[3]]);this.config.details&&(o.variants=[...i[3]]);let a=this.expandShortcut(o.currentSelector,o),u=a?await this.stringifyShortcuts(o.variantMatch,o,a[0],a[1]):(await this.parseUtil(o.variantMatch,o))?.map(l=>this.stringifyUtil(l,o)).filter(oe);if(u?.length)return this._cache.set(n,u),u;this._cache.set(n,null)}async generate(e,r={}){let{id:n,scope:s,preflights:i=!0,safelist:o=!0,minify:a=!1}=r,u=b(e)?await this.applyExtractors(e,n):Array.isArray(e)?new Set(e):e;o&&this.config.safelist.forEach(h=>u.add(h));let l=a?"":`
2
2
  `,c=new Set([z]),p=new Set,y=new Map,E={},A=Array.from(u).map(async h=>{if(p.has(h))return;let T=await this.parseToken(h);if(T!=null){p.add(h);for(let S of T){let U=S[3]||"",$=S[4]?.layer;y.has(U)||y.set(U,[]),y.get(U).push(S),$&&c.add($)}}});await Promise.all(A),await(async()=>{if(!i)return;let h={generator:this,theme:this.config.theme},T=new Set([]);this.config.preflights.forEach(({layer:S=I})=>{c.add(S),T.add(S)}),E=Object.fromEntries(await Promise.all(Array.from(T).map(async S=>{let $=(await Promise.all(this.config.preflights.filter(_=>(_.layer||I)===S).map(async _=>await _.getCSS(h)))).filter(Boolean).join(l);return[S,$]})))})();let f=this.config.sortLayers(Array.from(c).sort((h,T)=>(this.config.layers[h]??0)-(this.config.layers[T]??0)||h.localeCompare(T))),d={},R=h=>{if(d[h])return d[h];let T=Array.from(y).sort((U,$)=>(this.parentOrders.get(U[0])??0)-(this.parentOrders.get($[0])??0)||U[0]?.localeCompare($[0]||"")||0).map(([U,$])=>{let _=$.length,D=$.filter(g=>(g[4]?.layer||z)===h).sort((g,w)=>g[0]-w[0]||(g[4]?.sort||0)-(w[4]?.sort||0)||g[1]?.localeCompare(w[1]||"")||g[2]?.localeCompare(w[2]||"")||0).map(([,g,w,,V,,O])=>[[[(g&&Pe(g,s))??"",V?.sort??0]],w,!!(O??V?.noMerge)]);if(!D.length)return;let m=D.reverse().map(([g,w,V],O)=>{if(!V&&this.config.mergeSelectors)for(let P=O+1;P<_;P++){let M=D[P];if(M&&!M[2]&&(g&&M[0]||g==null&&M[0]==null)&&M[1]===w)return g&&M[0]&&M[0].push(...g),null}let W=g?L(g.sort((P,M)=>P[1]-M[1]||P[0]?.localeCompare(M[0]||"")||0).map(P=>P[0]).filter(Boolean)):[];return W.length?`${W.join(`,${l}`)}{${w}}`:w}).filter(Boolean).reverse().join(l);if(!U)return m;let C=U.split(" $$ ");return`${C.join("{")}{${l}${m}${l}}${C.map(g=>"").join("}")}`}).filter(Boolean).join(l);i&&(T=[E[h],T].filter(Boolean).join(l));let S=a?"":`/* layer: ${h} */${l}`;return d[h]=T?S+T:""},x=(h=f,T)=>h.filter(S=>!T?.includes(S)).map(S=>R(S)||"").filter(Boolean).join(l);return{get css(){return x()},layers:f,matched:p,getLayers:x,getLayer:R}}matchVariants(e,r){let n=new Set,s=[],i=r||e,o=!1,a={rawSelector:e,theme:this.config.theme,generator:this};for(;;){o=!1;for(let u of this.config.variants){if(!u.multiPass&&n.has(u))continue;let l=u.match(i,a);if(!!l){b(l)&&(l={matcher:l}),i=l.matcher,s.unshift(l),n.add(u),o=!0;break}}if(!o)break;if(s.length>500)throw new Error(`Too many variants applied to "${e}"`)}return[e,i,s,n]}applyVariants(e,r=e[4],n=e[1]){let i=r.slice().sort((l,c)=>(l.order||0)-(c.order||0)).reduceRight((l,c)=>p=>{let y=c.body?.(p.entries)||p.entries,E=Array.isArray(c.parent)?c.parent:[c.parent,void 0];return(c.handle??De)({...p,entries:y,selector:c.selector?.(p.selector,y)||p.selector,parent:E[0]||p.parent,parentOrder:E[1]||p.parentOrder,layer:c.layer||p.layer,sort:c.sort||p.sort},l)},l=>l)({prefix:"",selector:je(n),pseudo:"",entries:e[2]}),{parent:o,parentOrder:a}=i;o!=null&&a!=null&&this.parentOrders.set(o,a);let u={selector:Le([i.prefix,i.selector,i.pseudo].join("")),entries:i.entries,parent:o,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(let l of this.config.postprocess)l(u);return u}constructCustomCSS(e,r,n){let s=j(r);if(b(s))return s;let{selector:i,entries:o,parent:a}=this.applyVariants([0,n||e.rawSelector,s,void 0,e.variantHandlers]),u=`${i}{${F(o)}}`;return a?`${a}{${u}}`:u}async parseUtil(e,r,n=!1,s){let[i,o,a]=b(e)?this.matchVariants(e):e;this.config.details&&(r.rules=r.rules??[]);let u=this.config.rulesStaticMap[o];if(u&&u[1]&&(n||!u[2]?.internal)){this.config.details&&r.rules.push(u[3]);let c=u[0],p=j(u[1]),y=u[2];return b(p)?[[c,p,y]]:[[c,i,p,y,a]]}r.variantHandlers=a;let{rulesDynamic:l}=this.config;for(let[c,p,y,E]of l){if(E?.internal&&!n)continue;let A=o;if(E?.prefix){let x=v(E.prefix);if(s){let h=v(s);if(!x.some(T=>h.includes(T)))continue}else{let h=x.find(T=>o.startsWith(T));if(h==null)continue;A=o.slice(h.length)}}let f=A.match(p);if(!f)continue;let d=await y(f,r);if(!d)continue;this.config.details&&r.rules.push([p,y,E]);let R=te(d).filter(x=>x.length);if(R.length)return R.map(x=>b(x)?[c,x,E]:[c,i,x,E,a])}}stringifyUtil(e,r){if(!e)return;if(q(e))return[e[0],void 0,e[1],void 0,e[2],this.config.details?r:void 0,void 0];let{selector:n,entries:s,parent:i,layer:o,sort:a,noMerge:u}=this.applyVariants(e),l=F(s);if(!l)return;let{layer:c,sort:p,...y}=e[3]??{},E={...y,layer:o??c,sort:a??p};return[e[0],n,l,i,E,this.config.details?r:void 0,u]}expandShortcut(e,r,n=5){if(n===0)return;let s=this.config.details?a=>{r.shortcuts=r.shortcuts??[],r.shortcuts.push(a)}:ae,i,o;for(let a of this.config.shortcuts){let u=e;if(a[2]?.prefix){let c=v(a[2].prefix).find(p=>e.startsWith(p));if(c==null)continue;u=e.slice(c.length)}if(ne(a)){if(a[0]===u){i=i||a[2],o=a[1],s(a);break}}else{let l=u.match(a[0]);if(l&&(o=a[1](l,r)),o){i=i||a[2],s(a);break}}}if(b(o)&&(o=ce(o.trim()).split(/\s+/g)),!o){let[a,u]=b(e)?this.matchVariants(e):e;if(a!==u){let l=this.expandShortcut(u,r,n-1);l&&(o=l[0].map(c=>b(c)?a.replace(u,c):c))}}if(!!o)return[o.flatMap(a=>(b(a)?this.expandShortcut(a,r,n-1)?.[0]:void 0)||[a]).filter(Boolean),i]}async stringifyShortcuts(e,r,n,s={layer:this.config.shortcutsLayer}){let i=new G,o=(await Promise.all(L(n).map(async c=>{let p=b(c)?await this.parseUtil(c,r,!0,s.prefix):[[1/0,"{inline}",j(c),void 0,[]]];return p||ue(`unmatched utility "${c}" in shortcut "${e[1]}"`),p||[]}))).flat(1).filter(Boolean).sort((c,p)=>c[0]-p[0]),[a,,u]=e,l=[];for(let c of o){if(q(c)){l.push([c[0],void 0,c[1],void 0,c[2],r,void 0]);continue}let{selector:p,entries:y,parent:E,sort:A,noMerge:f}=this.applyVariants(c,[...c[4],...u],a);i.getFallback(p,E,[[],c[0]])[0].push([y,!!(f??c[3]?.noMerge),A??0])}return l.concat(i.map(([c,p],y,E)=>{let A=(d,R,x)=>{let h=Math.max(...x.map(S=>S[1])),T=x.map(S=>S[0]);return(d?[T.flat(1)]:T).map(S=>{let U=F(S);if(U)return[p,y,U,E,{...s,noMerge:R,sort:h},r,void 0]})};return[[c.filter(([,d])=>d).map(([d,,R])=>[d,R]),!0],[c.filter(([,d])=>!d).map(([d,,R])=>[d,R]),!1]].map(([d,R])=>[...A(!1,R,d.filter(([x])=>x.some(h=>h[0]===Y))),...A(!0,R,d.filter(([x])=>x.every(h=>h[0]!==Y)))])}).flat(2).filter(Boolean))}isBlocked(e){return!e||this.config.blocklist.some(r=>b(r)?r===e:r.test(e))}};function ge(t,e){return new X(t,e)}var _e=/\s\$\$\s+/g,Oe=t=>t.match(/\s\$\$\s/);function Pe(t,e){return Oe(t)?t.replace(_e,e?` ${e} `:" "):e?`${e} ${t}`:t}function Le(t){let e=t.match(/::[\w-]+(\([\w-]+\))?/g);if(e){for(let r of e)t=t.replace(r,"");t+=e.join("")}return t}var me=/^\[(.+?)(~?=)"(.*)"\]$/;function je(t){return me.test(t)?t.replace(me,(e,r,n,s)=>`[${K(r)}${n}"${K(s)}"]`):`.${K(t)}`}function De(t,e){return e(t)}var ke=t=>t.replace(/-(\w)/g,(e,r)=>r?r.toUpperCase():""),ye=t=>t.charAt(0).toUpperCase()+t.slice(1),xe=t=>t.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase(),Se=["Webkit","Moz","ms"];function Ce(t){let e={};function r(n){let s=e[n];if(s)return s;let i=ke(n);if(i!=="filter"&&i in t)return e[n]=xe(i);i=ye(i);for(let o=0;o<Se.length;o++){let a=`${Se[o]}${i}`;if(a in t)return e[n]=xe(ye(a))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=r(s[0]))})}function Ee(t){return t.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")}function ee(t={}){if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let e=window,r=document,n=e.__unocss||{},s=Object.assign({},t,n.runtime),i=s.defaults||{},o=s.cloakAttribute??"un-cloak";s.autoPrefix&&(i.postprocess=v(i.postprocess)).unshift(Ce(r.createElement("div").style)),s.configResolved?.(n,i);let a=ge(n,i),u=!0,l=new Set,c,p,y,E=[],A=()=>new Promise(m=>{E.push(m),y!=null&&clearTimeout(y),y=setTimeout(()=>R().then(()=>{let C=E;E=[],C.forEach(g=>g())}),0)});function f(m){if(m.nodeType!==1)return;let C=m;C.hasAttribute(o)&&C.removeAttribute(o),C.querySelectorAll(`[${o}]`).forEach(g=>{g.removeAttribute(o)})}function d(){return c||(c=r.createElement("style"),r.documentElement.prepend(c)),c}async function R(){let m=await a.generate(l),C=d();return C.innerHTML=m.css,l=m.matched,{...m,styleElement:C}}async function x(m){let C=l.size;await a.applyExtractors(m,void 0,l),C!==l.size&&await A()}async function h(){let m=r.body,C=m&&m.outerHTML;C&&(await x(`${C} ${Ee(C)}`),f(r.documentElement),f(m))}let T=new MutationObserver(m=>{u||m.forEach(async C=>{if(C.target.nodeType!==1)return;let g=C.target;if(g!==c)if(C.type==="childList")C.addedNodes.forEach(async w=>{if(w.nodeType!==1)return;let V=w;p&&!p(V)||(await x(V.outerHTML),f(V))});else{if(p&&!p(g))return;if(C.attributeName!==o){let w=Array.from(g.attributes).map(O=>O.value?`${O.name}="${O.value}"`:O.name).join(" "),V=`<${g.tagName.toLowerCase()} ${w}>`;await x(V)}g.hasAttribute(o)&&g.removeAttribute(o)}})}),S=!1;function U(){if(S)return;let m=r.documentElement||r.body;!m||(T.observe(m,{childList:!0,subtree:!0,attributes:!0}),S=!0)}function $(){h(),U()}function _(){r.readyState==="loading"?e.addEventListener("DOMContentLoaded",$):$()}let D=e.__unocss_runtime=e.__unocss_runtime={version:a.version,uno:a,async extract(m){b(m)||(m.forEach(C=>l.add(C)),m=""),await x(m)},extractAll:h,inspect(m){p=m},toggleObserver(m){m===void 0?u=!u:u=!!m,!S&&!u&&_()},update:R};s.ready?.(D)!==!1&&(u=!1,_())}ee();})();