@unocss/runtime 0.50.8 → 0.51.1

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