@unocss/runtime 0.31.2 → 0.31.6

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
- (()=>{var mt=Object.defineProperty,yt=Object.defineProperties;var St=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var N=(n,t,e)=>t in n?mt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,_=(n,t)=>{for(var e in t||(t={}))W.call(t,e)&&N(n,e,t[e]);if(k)for(var e of k(t))Z.call(t,e)&&N(n,e,t[e]);return n},V=(n,t)=>yt(n,St(t));var J=(n,t)=>{var e={};for(var r in n)W.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&k)for(var r of k(n))t.indexOf(r)<0&&Z.call(n,r)&&(e[r]=n[r]);return e};function xt(n){let t=n.length,e=-1,r,i="",s=n.charCodeAt(0);for(;++e<t;){if(r=n.charCodeAt(e),r===0){i+="\uFFFD";continue}if(r===44){i+="\\2c ";continue}if(r>=1&&r<=31||r===127||e===0&&r>=48&&r<=57||e===1&&r>=48&&r<=57&&s===45){i+=`\\${r.toString(16)} `;continue}if(e===0&&t===1&&r===45){i+=`\\${n.charAt(e)}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){i+=n.charAt(e);continue}i+=`\\${n.charAt(e)}`}return i}var D=xt;function P(n){return(Array.isArray(n)?n:Object.entries(n)).filter(t=>t[1]!=null)}function Q(n){return Array.isArray(n)?n.find(t=>!Array.isArray(t)||Array.isArray(t[0]))?n.map(t=>P(t)):[n]:[P(n)]}function Ct(n){return n.filter(([t,e],r)=>{if(t.startsWith("$$"))return!1;for(let i=r-1;i>=0;i--)if(n[i][0]===t&&n[i][1]===e)return!1;return!0})}function K(n){return n==null?"":Ct(n).map(([t,e])=>e!=null?`${t}:${e};`:void 0).filter(Boolean).join("")}function L(n){return n&&typeof n=="object"&&!Array.isArray(n)}function z(n,t){let e=n,r=t;if(Array.isArray(e)&&Array.isArray(r))return[...e,...r];if(Array.isArray(e))return[...e];let i=_({},e);return L(e)&&L(r)&&Object.keys(r).forEach(s=>{L(r[s])?s in e?i[s]=z(e[s],r[s]):Object.assign(i,{[s]:r[s]}):Object.assign(i,{[s]:r[s]})}),i}function v(n){let t,e,r;if(Array.isArray(n)){for(e=Array(t=n.length);t--;)e[t]=(r=n[t])&&typeof r=="object"?v(r):r;return e}if(Object.prototype.toString.call(n)==="[object Object]"){e={};for(t in n)t==="__proto__"?Object.defineProperty(e,t,{value:v(n[t]),configurable:!0,enumerable:!0,writable:!0}):e[t]=(r=n[t])&&typeof r=="object"?v(r):r;return e}return n}function X(n){return typeof n[0]=="string"}function Y(n){return typeof n[0]=="string"}function O(n=[]){return Array.isArray(n)?n:[n]}function j(n){return Array.from(new Set(n))}var bt=/(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-?]/,F="$$shortcut-no-merge";function tt(n=""){return bt.test(n)}function et(n){return typeof n=="function"?{match:n}:n}function G(n){return n.length===3}function rt(n){return n!=null}var B=class{_map=new Map;get(t,e){let r=this._map.get(t);if(r)return r.get(e)}getFallback(t,e,r){let i=this._map.get(t);return i||(i=new Map,this._map.set(t,i)),i.has(e)||i.set(e,r),i.get(e)}set(t,e,r){let i=this._map.get(t);return i||(i=new Map,this._map.set(t,i)),i.set(e,r),this}has(t,e){var r;return(r=this._map.get(t))==null?void 0:r.has(e)}delete(t,e){var r;return((r=this._map.get(t))==null?void 0:r.delete(e))||!1}deleteTop(t){return this._map.delete(t)}map(t){return Array.from(this._map.entries()).flatMap(([e,r])=>Array.from(r.entries()).map(([i,s])=>t(s,e,i)))}};var nt=/([!\w+:_/-]+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;function it(n){return nt.lastIndex=0,n.replace(nt,(t,e,r,i)=>i.split(/\s/g).map(s=>s==="~"?e:s.replace(/^(!?)(.*)/,`$1${e}${r}$2`)).join(" "))}var st=new Set;function ot(n){st.has(n)||(console.warn("[unocss]",n),st.add(n))}var Rt=n=>n.split(/[\s'"`;>=]+/g).filter(tt),H={name:"split",order:0,extract({code:n}){return new Set(Rt(n))}};function wt(n){return O(n).flatMap(t=>Array.isArray(t)?[t]:Object.entries(t))}var Ut={shortcuts:-1,default:0};function I(n={},t={}){let e=Object.assign({},t,n),r=(e.presets||[]).flatMap(O),i=[...r.filter(u=>u.enforce==="pre"),...r.filter(u=>!u.enforce),...r.filter(u=>u.enforce==="post")],s=Object.assign(Ut,...r.map(u=>u.layers),n.layers);function o(u){return j([...i.flatMap(h=>O(h[u]||[])),...O(e[u]||[])])}let a=o("extractors");a.length||a.push(H),a.sort((u,h)=>(u.order||0)-(h.order||0));let l=o("rules"),f={},C=l.length;l.forEach((u,h)=>{X(u)&&(f[u[0]]=[h,u[1],u[2]],delete l[h])});let g=v([...i.map(u=>u.theme||{}),e.theme||{}].reduce((u,h)=>z(u,h),{}));o("extendTheme").forEach(u=>u(g));let x={templates:j(i.map(u=>{var h;return O((h=u.autocomplete)==null?void 0:h.templates)}).flat()),extractors:i.map(u=>{var h;return O((h=u.autocomplete)==null?void 0:h.extractors)}).flat().sort((u,h)=>(u.order||0)-(h.order||0))};return V(_({mergeSelectors:!0,warn:!0,blocklist:[],safelist:[],sortLayers:u=>u},e),{presets:i,envMode:e.envMode||"build",shortcutsLayer:e.shortcutsLayer||"shortcuts",layers:s,theme:g,rulesSize:C,rulesDynamic:l,rulesStaticMap:f,preprocess:o("preprocess"),postprocess:o("postprocess"),preflights:o("preflights"),autocomplete:x,variants:o("variants").map(et),shortcuts:wt(o("shortcuts")),extractors:a})}var at="0.31.2";var lt=class{constructor(t={},e={}){this.userConfig=t;this.defaults=e;this.config=I(t,e)}version=at;_cache=new Map;config;blocked=new Set;parentOrders=new Map;setConfig(t,e){!t||(e&&(this.defaults=e),this.userConfig=t,this.config=I(t,this.defaults),this.blocked.clear(),this.parentOrders.clear(),this._cache.clear())}async applyExtractors(t,e,r=new Set){let i={get original(){return t},code:t,id:e};for(let s of this.config.extractors){let o=await s.extract(i);o==null||o.forEach(a=>r.add(a))}return r}makeContext(t,e){let r={rawSelector:t,currentSelector:e[1],theme:this.config.theme,generator:this,variantHandlers:e[2],constructCSS:(...i)=>this.constructCustomCSS(r,...i),variantMatch:e};return r}async parseToken(t,e){var l;if(this.blocked.has(t))return;let r=`${t}${e?` ${e}`:""}`;if(this._cache.has(r))return this._cache.get(r);let i=t;for(let f of this.config.preprocess)i=f(t);if(this.isBlocked(i)){this.blocked.add(t),this._cache.set(r,null);return}let s=this.matchVariants(t,i);if(!s||this.isBlocked(s[1])){this.blocked.add(t),this._cache.set(r,null);return}let o=this.makeContext(t,[e||s[0],s[1],s[2],s[3]]),a=this.expandShortcut(o.currentSelector,o);if(a){let f=await this.stringifyShortcuts(o.variantMatch,o,a[0],a[1]);if(f!=null&&f.length)return this._cache.set(r,f),f}else{let f=(l=await this.parseUtil(o.variantMatch,o))==null?void 0:l.map(C=>this.stringifyUtil(C)).filter(rt);if(f!=null&&f.length)return this._cache.set(r,f),f}this._cache.set(r,null)}async generate(t="",{id:e,scope:r,preflights:i=!0,safelist:s=!0,minify:o=!1}={}){let a=typeof t=="string"?await this.applyExtractors(t,e):t;s&&this.config.safelist.forEach(p=>a.add(p));let l=o?"":`
2
- `,f=new Set(["default"]),C=new Set,g=new Map;await Promise.all(Array.from(a).map(async p=>{var m;if(C.has(p))return;let d=await this.parseToken(p);if(d!=null){C.add(p);for(let S of d){let b=S[3]||"";g.has(b)||g.set(b,[]),g.get(b).push(S),(m=S[4])!=null&&m.layer&&f.add(S[4].layer)}}})),i&&this.config.preflights.forEach(p=>{p.layer&&f.add(p.layer)});let x={},u=this.config.sortLayers(Array.from(f).sort((p,d)=>{var m,S;return((m=this.config.layers[p])!=null?m:0)-((S=this.config.layers[d])!=null?S:0)||p.localeCompare(d)})),h={};if(i){let p={generator:this,theme:this.config.theme};h=Object.fromEntries(await Promise.all(u.map(async d=>{let S=(await Promise.all(this.config.preflights.filter(b=>(b.layer||"default")===d).map(async b=>await b.getCSS(p)))).filter(Boolean).join(l);return[d,S]})))}let U=p=>{if(x[p])return x[p];let d=Array.from(g).sort((m,S)=>{var b,R,A;return((b=this.parentOrders.get(m[0]))!=null?b:0)-((R=this.parentOrders.get(S[0]))!=null?R:0)||((A=m[0])==null?void 0:A.localeCompare(S[0]||""))||0}).map(([m,S])=>{let b=S.length,R=S.filter(c=>{var y;return(((y=c[4])==null?void 0:y.layer)||"default")===p}).sort((c,y)=>{var w,M,E;return c[0]-y[0]||(((w=c[4])==null?void 0:w.sort)||0)-(((M=y[4])==null?void 0:M.sort)||0)||((E=c[1])==null?void 0:E.localeCompare(y[1]||""))||0}).map(c=>{var y;return[c[1]?$t(c[1],r):c[1],c[2],!!((y=c[4])!=null&&y.noMerge)]}).map(c=>[c[0]==null?c[0]:[c[0]],c[1],c[2]]);if(!R.length)return;let A=R.reverse().map(([c,y,w],M)=>{if(!w&&c&&this.config.mergeSelectors)for(let E=M+1;E<b;E++){let $=R[E];if($&&!$[2]&&$[0]&&$[1]===y)return $[0].push(...c),null}return c?`${[...new Set(c)].join(`,${l}`)}{${y}}`:y}).filter(Boolean).reverse().join(l);return m?`${m}{${l}${A}${l}}`:A}).filter(Boolean).join(l);return i&&(d=[h[p],d].filter(Boolean).join(l)),x[p]=!o&&d?`/* layer: ${p} */${l}${d}`:d},T=(p=u,d)=>p.filter(m=>!(d!=null&&d.includes(m))).map(m=>U(m)||"").filter(Boolean).join(l);return{get css(){return T()},layers:u,getLayers:T,getLayer:U,matched:C}}matchVariants(t,e){let r=new Set,i=[],s=e||t,o=!1,a={rawSelector:t,theme:this.config.theme,generator:this};for(;;){o=!1;for(let l of this.config.variants){if(!l.multiPass&&r.has(l))continue;let f=l.match(s,a);if(!!f){typeof f=="string"&&(f={matcher:f}),s=f.matcher,Array.isArray(f.parent)&&this.parentOrders.set(f.parent[0],f.parent[1]),i.push(f),r.add(l),o=!0;break}}if(!o)break;if(i.length>500)throw new Error(`Too many variants applied to "${t}"`)}return[t,s,i,r]}applyVariants(t,e=t[4],r=t[1]){let i=[...e].sort((a,l)=>(a.order||0)-(l.order||0)),s=i.reduce((a,l)=>{var f;return((f=l.body)==null?void 0:f.call(l,a))||a},t[2]),o={selector:i.reduce((a,l)=>{var f;return((f=l.selector)==null?void 0:f.call(l,a,s))||a},Tt(r)),entries:s,parent:i.reduce((a,l)=>Array.isArray(l.parent)?l.parent[0]:l.parent||a,void 0),layer:i.reduce((a,l)=>l.layer||a,void 0),sort:i.reduce((a,l)=>l.sort||a,void 0)};for(let a of this.config.postprocess)a(o);return o}constructCustomCSS(t,e,r){e=P(e);let{selector:i,entries:s,parent:o}=this.applyVariants([0,r||t.rawSelector,e,void 0,t.variantHandlers]),a=`${i}{${K(s)}}`;return o?`${o}{${a}}`:a}async parseUtil(t,e,r=!1){var C,g;let[i,s,o]=typeof t=="string"?this.matchVariants(t):t,a=this.config.rulesStaticMap[s];if(a&&a[1]&&(r||!((C=a[2])!=null&&C.internal)))return[[a[0],i,P(a[1]),a[2],o]];e.variantHandlers=o;let{rulesDynamic:l,rulesSize:f}=this.config;for(let x=f-1;x>=0;x--){let u=l[x];if(!u||((g=u[2])==null?void 0:g.internal)&&!r)continue;let[h,U,T]=u,p=s.match(h);if(!p)continue;let d=await U(p,e);if(!d)continue;if(typeof d=="string")return[[x,d,T]];let m=Q(d).filter(S=>S.length);if(m.length)return m.map(S=>[x,i,S,T,o])}}stringifyUtil(t){var x;if(!t)return;if(G(t))return[t[0],void 0,t[1],void 0,t[2]];let{selector:e,entries:r,parent:i,layer:s,sort:o}=this.applyVariants(t),a=K(r);if(!a)return;let u=(x=t[3])!=null?x:{},{layer:l,sort:f}=u,C=J(u,["layer","sort"]),g=V(_({},C),{layer:s!=null?s:l,sort:o!=null?o:f});return[t[0],e,a,i,g]}expandShortcut(t,e,r=3){if(r===0)return;let i,s;for(let o of this.config.shortcuts)if(Y(o)){if(o[0]===t){i=i||o[2],s=o[1];break}}else{let a=t.match(o[0]);if(a&&(s=o[1](a,e)),s){i=i||o[2];break}}if(typeof s=="string"&&(s=it(s).split(/\s+/g)),!!s)return[s.flatMap(o=>{var a;return((a=this.expandShortcut(o,e,r-1))==null?void 0:a[0])||[o]}).filter(o=>o!==""),i]}async stringifyShortcuts(t,e,r,i={layer:this.config.shortcutsLayer}){var C;let s=new B,o=(await Promise.all(j(r).map(async g=>{let x=await this.parseUtil(g,e,!0);return x||ot(`unmatched utility "${g}" in shortcut "${t[1]}"`),x||[]}))).flat(1).filter(Boolean).sort((g,x)=>g[0]-x[0]),[a,,l]=t,f=[];for(let g of o){if(G(g)){f.push([g[0],void 0,g[1],void 0,g[2]]);continue}let{selector:x,entries:u,parent:h,sort:U}=this.applyVariants(g,[...g[4],...l],a);s.getFallback(x,h,[[],g[0]])[0].push([u,!!((C=g[3])!=null&&C.noMerge),U!=null?U:0])}return f.concat(s.map(([g,x],u,h)=>{let U=(p,d,m)=>{let S=Math.max(...m.map(R=>R[1])),b=m.map(R=>R[0]);return(p?[b.flat(1)]:b).map(R=>{let A=K(R);if(A)return[x,u,A,h,V(_({},i),{noMerge:d,sort:S})]})};return[[g.filter(([,p])=>p).map(([p,,d])=>[p,d]),!0],[g.filter(([,p])=>!p).map(([p,,d])=>[p,d]),!1]].map(([p,d])=>[...U(!1,d,p.filter(([m])=>m.some(S=>S[0]===F))),...U(!0,d,p.filter(([m])=>m.every(S=>S[0]!==F)))])}).flat(2).filter(Boolean))}isBlocked(t){return!t||this.config.blocklist.some(e=>typeof e=="string"?e===t:e.test(t))}};function ut(n,t){return new lt(n,t)}var ft=/ \$\$ /,At=n=>n.match(ft);function $t(n,t){return At(n)?n.replace(ft,t?` ${t} `:" "):t?`${t} ${n}`:n}var ct=/^\[(.+?)(~?=)"(.*)"\]$/;function Tt(n){return ct.test(n)?n.replace(ct,(t,e,r,i)=>`[${D(e)}${r}"${D(i)}"]`):`.${D(n)}`}var Mt=n=>n.replace(/-(\w)/g,(t,e)=>e?e.toUpperCase():""),pt=n=>n.charAt(0).toUpperCase()+n.slice(1),dt=n=>n.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase(),gt=["Webkit","Moz","ms"];function ht(n){let t={};function e(r){let i=t[r];if(i)return i;let s=Mt(r);if(s!=="filter"&&s in n)return t[r]=dt(s);s=pt(s);for(let o=0;o<gt.length;o++){let a=`${gt[o]}${s}`;if(a in n)return t[r]=dt(pt(a))}return r}return({entries:r})=>r.forEach(i=>{i[0].startsWith("--")||(i[0]=e(i[0]))})}function q(n={}){var R,A;if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let t=window.__unocss||{},e=t==null?void 0:t.runtime,r=Object.assign(n.defaults||{},e);if(e!=null&&e.autoPrefix){let c=r.postprocess;c||(c=[]),Array.isArray(c)||(c=[c]),c.unshift(ht(document.createElement("div").style)),r.postprocess=c}(R=e==null?void 0:e.configResolved)==null||R.call(e,t,r);let i,s=!0,o,a=ut(t,r),l=new Set,f,C=[],g=()=>new Promise(c=>{C.push(c),f!=null&&clearTimeout(f),f=setTimeout(()=>u().then(()=>{let y=C;C=[],y.forEach(w=>w())}),0)});function x(c=document.body){if(c.nodeType!==1)return;let y=c;y.hasAttribute("un-cloak")&&y.removeAttribute("un-cloak"),y.querySelectorAll("[un-cloak]").forEach(w=>{w.removeAttribute("un-cloak")})}async function u(){let c=await a.generate(l);i||(i=document.createElement("style"),document.documentElement.prepend(i)),i.innerHTML=c.css,l=c.matched}async function h(c){let y=l.size;await a.applyExtractors(c,void 0,l),y!==l.size&&await g()}async function U(){let c=document.body&&document.body.outerHTML;c&&(await h(c),x())}let T=new MutationObserver(c=>{s||c.forEach(async y=>{if(y.target.nodeType!==1)return;let w=y.target;if(w!==i)if(y.type==="childList")y.addedNodes.forEach(async M=>{if(M.nodeType!==1)return;let E=M;o&&!o(E)||(await h(E.outerHTML),x(E))});else{if(o&&!o(w))return;if(y.attributeName!=="un-cloak"){let M=Array.from(w.attributes).map($=>$.value?`${$.name}="${$.value}"`:$.name).join(" "),E=`<${w.tagName.toLowerCase()} ${M}>`;await h(E)}w.hasAttribute("un-cloak")&&w.removeAttribute("un-cloak")}})}),p=!1;function d(){if(p)return;let c=document.documentElement||document.body;!c||(T.observe(c,{childList:!0,subtree:!0,attributes:!0}),p=!0)}function m(){U(),d()}function S(){document.readyState==="loading"?window.addEventListener("DOMContentLoaded",m):m()}let b=window.__unocss_runtime=window.__unocss_runtime={version:a.version,uno:a,async extract(c){typeof c!="string"&&(c.forEach(y=>l.add(y)),c=""),await h(c)},extractAll:U,inspect(c){o=c},toggleObserver(c){c===void 0?s=!s:s=!!c,!p&&!s&&S()}};((A=e==null?void 0:e.ready)==null?void 0:A.call(e,b))!==!1&&(s=!1,S())}q();})();
1
+ (()=>{var mt=Object.defineProperty,yt=Object.defineProperties;var St=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var W=(r,t,e)=>t in r?mt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,_=(r,t)=>{for(var e in t||(t={}))Z.call(t,e)&&W(r,e,t[e]);if(k)for(var e of k(t))J.call(t,e)&&W(r,e,t[e]);return r},V=(r,t)=>yt(r,St(t));var Q=(r,t)=>{var e={};for(var n in r)Z.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&k)for(var n of k(r))t.indexOf(n)<0&&J.call(r,n)&&(e[n]=r[n]);return e};function xt(r){let t=r.length,e=-1,n,i="",s=r.charCodeAt(0);for(;++e<t;){if(n=r.charCodeAt(e),n===0){i+="\uFFFD";continue}if(n===44){i+="\\2c ";continue}if(n>=1&&n<=31||n===127||e===0&&n>=48&&n<=57||e===1&&n>=48&&n<=57&&s===45){i+=`\\${n.toString(16)} `;continue}if(e===0&&t===1&&n===45){i+=`\\${r.charAt(e)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){i+=r.charAt(e);continue}i+=`\\${r.charAt(e)}`}return i}var D=xt;function P(r){return(Array.isArray(r)?r:Object.entries(r)).filter(t=>t[1]!=null)}function X(r){return Array.isArray(r)?r.find(t=>!Array.isArray(t)||Array.isArray(t[0]))?r.map(t=>P(t)):[r]:[P(r)]}function Ct(r){return r.filter(([t,e],n)=>{if(t.startsWith("$$"))return!1;for(let i=n-1;i>=0;i--)if(r[i][0]===t&&r[i][1]===e)return!1;return!0})}function K(r){return r==null?"":Ct(r).map(([t,e])=>e!=null?`${t}:${e};`:void 0).filter(Boolean).join("")}function z(r){return r&&typeof r=="object"&&!Array.isArray(r)}function F(r,t){let e=r,n=t;if(Array.isArray(e)&&Array.isArray(n))return[...e,...n];if(Array.isArray(e))return[...e];let i=_({},e);return z(e)&&z(n)&&Object.keys(n).forEach(s=>{z(n[s])?s in e?i[s]=F(e[s],n[s]):Object.assign(i,{[s]:n[s]}):Object.assign(i,{[s]:n[s]})}),i}function v(r){let t,e,n;if(Array.isArray(r)){for(e=Array(t=r.length);t--;)e[t]=(n=r[t])&&typeof n=="object"?v(n):n;return e}if(Object.prototype.toString.call(r)==="[object Object]"){e={};for(t in r)t==="__proto__"?Object.defineProperty(e,t,{value:v(r[t]),configurable:!0,enumerable:!0,writable:!0}):e[t]=(n=r[t])&&typeof n=="object"?v(n):n;return e}return r}function Y(r){return typeof r[0]=="string"}function tt(r){return typeof r[0]=="string"}function O(r=[]){return Array.isArray(r)?r:[r]}function j(r){return Array.from(new Set(r))}var bt=/(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:%-?]/,G="$$shortcut-no-merge";function et(r=""){return bt.test(r)}function rt(r){return typeof r=="function"?{match:r}:r}function B(r){return r.length===3}function nt(r){return r!=null}var L=class{_map=new Map;get(t,e){let n=this._map.get(t);if(n)return n.get(e)}getFallback(t,e,n){let i=this._map.get(t);return i||(i=new Map,this._map.set(t,i)),i.has(e)||i.set(e,n),i.get(e)}set(t,e,n){let i=this._map.get(t);return i||(i=new Map,this._map.set(t,i)),i.set(e,n),this}has(t,e){var n;return(n=this._map.get(t))==null?void 0:n.has(e)}delete(t,e){var n;return((n=this._map.get(t))==null?void 0:n.delete(e))||!1}deleteTop(t){return this._map.delete(t)}map(t){return Array.from(this._map.entries()).flatMap(([e,n])=>Array.from(n.entries()).map(([i,s])=>t(s,e,i)))}};var it=/([!\w+:_/-]+?)([:-])\(((?:[~!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm;function st(r){it.lastIndex=0;let t=!1;do{let e=r.toString();r=r.replace(it,(n,i,s,o)=>o.split(/\s/g).map(a=>a==="~"?i:a.replace(/^(!?)(.*)/,`$1${i}${s}$2`)).join(" ")),t=r.toString()!==e}while(t);return r}var ot=new Set;function at(r){ot.has(r)||(console.warn("[unocss]",r),ot.add(r))}var Rt=r=>r.split(/[\s'"`;>=]+/g).filter(et),H={name:"split",order:0,extract({code:r}){return new Set(Rt(r))}};function wt(r){return O(r).flatMap(t=>Array.isArray(t)?[t]:Object.entries(t))}var Ut={shortcuts:-1,default:0};function I(r={},t={}){let e=Object.assign({},t,r),n=(e.presets||[]).flatMap(O),i=[...n.filter(u=>u.enforce==="pre"),...n.filter(u=>!u.enforce),...n.filter(u=>u.enforce==="post")],s=Object.assign(Ut,...n.map(u=>u.layers),r.layers);function o(u){return j([...i.flatMap(h=>O(h[u]||[])),...O(e[u]||[])])}let a=o("extractors");a.length||a.push(H),a.sort((u,h)=>(u.order||0)-(h.order||0));let l=o("rules"),f={},C=l.length;l.forEach((u,h)=>{Y(u)&&(f[u[0]]=[h,u[1],u[2]],delete l[h])});let g=v([...i.map(u=>u.theme||{}),e.theme||{}].reduce((u,h)=>F(u,h),{}));o("extendTheme").forEach(u=>u(g));let x={templates:j(i.map(u=>{var h;return O((h=u.autocomplete)==null?void 0:h.templates)}).flat()),extractors:i.map(u=>{var h;return O((h=u.autocomplete)==null?void 0:h.extractors)}).flat().sort((u,h)=>(u.order||0)-(h.order||0))};return V(_({mergeSelectors:!0,warn:!0,blocklist:[],safelist:[],sortLayers:u=>u},e),{presets:i,envMode:e.envMode||"build",shortcutsLayer:e.shortcutsLayer||"shortcuts",layers:s,theme:g,rulesSize:C,rulesDynamic:l,rulesStaticMap:f,preprocess:o("preprocess"),postprocess:o("postprocess"),preflights:o("preflights"),autocomplete:x,variants:o("variants").map(rt),shortcuts:wt(o("shortcuts")),extractors:a})}var ct="0.31.6";var q=class{constructor(t={},e={}){this.userConfig=t;this.defaults=e;this.config=I(t,e)}version=ct;_cache=new Map;config;blocked=new Set;parentOrders=new Map;setConfig(t,e){!t||(e&&(this.defaults=e),this.userConfig=t,this.config=I(t,this.defaults),this.blocked.clear(),this.parentOrders.clear(),this._cache.clear())}async applyExtractors(t,e,n=new Set){let i={get original(){return t},code:t,id:e};for(let s of this.config.extractors){let o=await s.extract(i);o==null||o.forEach(a=>n.add(a))}return n}makeContext(t,e){let n={rawSelector:t,currentSelector:e[1],theme:this.config.theme,generator:this,variantHandlers:e[2],constructCSS:(...i)=>this.constructCustomCSS(n,...i),variantMatch:e};return n}async parseToken(t,e){var l;if(this.blocked.has(t))return;let n=`${t}${e?` ${e}`:""}`;if(this._cache.has(n))return this._cache.get(n);let i=t;for(let f of this.config.preprocess)i=f(t);if(this.isBlocked(i)){this.blocked.add(t),this._cache.set(n,null);return}let s=this.matchVariants(t,i);if(!s||this.isBlocked(s[1])){this.blocked.add(t),this._cache.set(n,null);return}let o=this.makeContext(t,[e||s[0],s[1],s[2],s[3]]),a=this.expandShortcut(o.currentSelector,o);if(a){let f=await this.stringifyShortcuts(o.variantMatch,o,a[0],a[1]);if(f!=null&&f.length)return this._cache.set(n,f),f}else{let f=(l=await this.parseUtil(o.variantMatch,o))==null?void 0:l.map(C=>this.stringifyUtil(C)).filter(nt);if(f!=null&&f.length)return this._cache.set(n,f),f}this._cache.set(n,null)}async generate(t="",{id:e,scope:n,preflights:i=!0,safelist:s=!0,minify:o=!1}={}){let a=typeof t=="string"?await this.applyExtractors(t,e):t;s&&this.config.safelist.forEach(p=>a.add(p));let l=o?"":`
2
+ `,f=new Set(["default"]),C=new Set,g=new Map;await Promise.all(Array.from(a).map(async p=>{var m;if(C.has(p))return;let d=await this.parseToken(p);if(d!=null){C.add(p);for(let S of d){let b=S[3]||"";g.has(b)||g.set(b,[]),g.get(b).push(S),(m=S[4])!=null&&m.layer&&f.add(S[4].layer)}}})),i&&this.config.preflights.forEach(p=>{p.layer&&f.add(p.layer)});let x={},u=this.config.sortLayers(Array.from(f).sort((p,d)=>{var m,S;return((m=this.config.layers[p])!=null?m:0)-((S=this.config.layers[d])!=null?S:0)||p.localeCompare(d)})),h={};if(i){let p={generator:this,theme:this.config.theme};h=Object.fromEntries(await Promise.all(u.map(async d=>{let S=(await Promise.all(this.config.preflights.filter(b=>(b.layer||"default")===d).map(async b=>await b.getCSS(p)))).filter(Boolean).join(l);return[d,S]})))}let U=p=>{if(x[p])return x[p];let d=Array.from(g).sort((m,S)=>{var b,R,A;return((b=this.parentOrders.get(m[0]))!=null?b:0)-((R=this.parentOrders.get(S[0]))!=null?R:0)||((A=m[0])==null?void 0:A.localeCompare(S[0]||""))||0}).map(([m,S])=>{let b=S.length,R=S.filter(c=>{var y;return(((y=c[4])==null?void 0:y.layer)||"default")===p}).sort((c,y)=>{var w,M,E;return c[0]-y[0]||(((w=c[4])==null?void 0:w.sort)||0)-(((M=y[4])==null?void 0:M.sort)||0)||((E=c[1])==null?void 0:E.localeCompare(y[1]||""))||0}).map(c=>{var y;return[c[1]?$t(c[1],n):c[1],c[2],!!((y=c[4])!=null&&y.noMerge)]}).map(c=>[c[0]==null?c[0]:[c[0]],c[1],c[2]]);if(!R.length)return;let A=R.reverse().map(([c,y,w],M)=>{if(!w&&c&&this.config.mergeSelectors)for(let E=M+1;E<b;E++){let $=R[E];if($&&!$[2]&&$[0]&&$[1]===y)return $[0].push(...c),null}return c?`${[...new Set(c)].join(`,${l}`)}{${y}}`:y}).filter(Boolean).reverse().join(l);return m?`${m}{${l}${A}${l}}`:A}).filter(Boolean).join(l);return i&&(d=[h[p],d].filter(Boolean).join(l)),x[p]=!o&&d?`/* layer: ${p} */${l}${d}`:d},T=(p=u,d)=>p.filter(m=>!(d!=null&&d.includes(m))).map(m=>U(m)||"").filter(Boolean).join(l);return{get css(){return T()},layers:u,getLayers:T,getLayer:U,matched:C}}matchVariants(t,e){let n=new Set,i=[],s=e||t,o=!1,a={rawSelector:t,theme:this.config.theme,generator:this};for(;;){o=!1;for(let l of this.config.variants){if(!l.multiPass&&n.has(l))continue;let f=l.match(s,a);if(!!f){typeof f=="string"&&(f={matcher:f}),s=f.matcher,Array.isArray(f.parent)&&this.parentOrders.set(f.parent[0],f.parent[1]),i.push(f),n.add(l),o=!0;break}}if(!o)break;if(i.length>500)throw new Error(`Too many variants applied to "${t}"`)}return[t,s,i,n]}applyVariants(t,e=t[4],n=t[1]){let i=[...e].sort((a,l)=>(a.order||0)-(l.order||0)),s=i.reduce((a,l)=>{var f;return((f=l.body)==null?void 0:f.call(l,a))||a},t[2]),o={selector:i.reduce((a,l)=>{var f;return((f=l.selector)==null?void 0:f.call(l,a,s))||a},Tt(n)),entries:s,parent:i.reduce((a,l)=>Array.isArray(l.parent)?l.parent[0]:l.parent||a,void 0),layer:i.reduce((a,l)=>l.layer||a,void 0),sort:i.reduce((a,l)=>l.sort||a,void 0)};for(let a of this.config.postprocess)a(o);return o}constructCustomCSS(t,e,n){e=P(e);let{selector:i,entries:s,parent:o}=this.applyVariants([0,n||t.rawSelector,e,void 0,t.variantHandlers]),a=`${i}{${K(s)}}`;return o?`${o}{${a}}`:a}async parseUtil(t,e,n=!1){var C,g;let[i,s,o]=typeof t=="string"?this.matchVariants(t):t,a=this.config.rulesStaticMap[s];if(a&&a[1]&&(n||!((C=a[2])!=null&&C.internal)))return[[a[0],i,P(a[1]),a[2],o]];e.variantHandlers=o;let{rulesDynamic:l,rulesSize:f}=this.config;for(let x=f-1;x>=0;x--){let u=l[x];if(!u||((g=u[2])==null?void 0:g.internal)&&!n)continue;let[h,U,T]=u,p=s.match(h);if(!p)continue;let d=await U(p,e);if(!d)continue;if(typeof d=="string")return[[x,d,T]];let m=X(d).filter(S=>S.length);if(m.length)return m.map(S=>[x,i,S,T,o])}}stringifyUtil(t){var x;if(!t)return;if(B(t))return[t[0],void 0,t[1],void 0,t[2]];let{selector:e,entries:n,parent:i,layer:s,sort:o}=this.applyVariants(t),a=K(n);if(!a)return;let u=(x=t[3])!=null?x:{},{layer:l,sort:f}=u,C=Q(u,["layer","sort"]),g=V(_({},C),{layer:s!=null?s:l,sort:o!=null?o:f});return[t[0],e,a,i,g]}expandShortcut(t,e,n=3){if(n===0)return;let i,s;for(let o of this.config.shortcuts)if(tt(o)){if(o[0]===t){i=i||o[2],s=o[1];break}}else{let a=t.match(o[0]);if(a&&(s=o[1](a,e)),s){i=i||o[2];break}}if(typeof s=="string"&&(s=st(s).split(/\s+/g)),!!s)return[s.flatMap(o=>{var a;return((a=this.expandShortcut(o,e,n-1))==null?void 0:a[0])||[o]}).filter(o=>o!==""),i]}async stringifyShortcuts(t,e,n,i={layer:this.config.shortcutsLayer}){var C;let s=new L,o=(await Promise.all(j(n).map(async g=>{let x=await this.parseUtil(g,e,!0);return x||at(`unmatched utility "${g}" in shortcut "${t[1]}"`),x||[]}))).flat(1).filter(Boolean).sort((g,x)=>g[0]-x[0]),[a,,l]=t,f=[];for(let g of o){if(B(g)){f.push([g[0],void 0,g[1],void 0,g[2]]);continue}let{selector:x,entries:u,parent:h,sort:U}=this.applyVariants(g,[...g[4],...l],a);s.getFallback(x,h,[[],g[0]])[0].push([u,!!((C=g[3])!=null&&C.noMerge),U!=null?U:0])}return f.concat(s.map(([g,x],u,h)=>{let U=(p,d,m)=>{let S=Math.max(...m.map(R=>R[1])),b=m.map(R=>R[0]);return(p?[b.flat(1)]:b).map(R=>{let A=K(R);if(A)return[x,u,A,h,V(_({},i),{noMerge:d,sort:S})]})};return[[g.filter(([,p])=>p).map(([p,,d])=>[p,d]),!0],[g.filter(([,p])=>!p).map(([p,,d])=>[p,d]),!1]].map(([p,d])=>[...U(!1,d,p.filter(([m])=>m.some(S=>S[0]===G))),...U(!0,d,p.filter(([m])=>m.every(S=>S[0]!==G)))])}).flat(2).filter(Boolean))}isBlocked(t){return!t||this.config.blocklist.some(e=>typeof e=="string"?e===t:e.test(t))}};function ut(r,t){return new q(r,t)}var ft=/ \$\$ /,At=r=>r.match(ft);function $t(r,t){return At(r)?r.replace(ft,t?` ${t} `:" "):t?`${t} ${r}`:r}var lt=/^\[(.+?)(~?=)"(.*)"\]$/;function Tt(r){return lt.test(r)?r.replace(lt,(t,e,n,i)=>`[${D(e)}${n}"${D(i)}"]`):`.${D(r)}`}var Mt=r=>r.replace(/-(\w)/g,(t,e)=>e?e.toUpperCase():""),pt=r=>r.charAt(0).toUpperCase()+r.slice(1),dt=r=>r.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase(),gt=["Webkit","Moz","ms"];function ht(r){let t={};function e(n){let i=t[n];if(i)return i;let s=Mt(n);if(s!=="filter"&&s in r)return t[n]=dt(s);s=pt(s);for(let o=0;o<gt.length;o++){let a=`${gt[o]}${s}`;if(a in r)return t[n]=dt(pt(a))}return n}return({entries:n})=>n.forEach(i=>{i[0].startsWith("--")||(i[0]=e(i[0]))})}function N(r={}){var R,A;if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let t=window.__unocss||{},e=t==null?void 0:t.runtime,n=Object.assign(r.defaults||{},e);if(e!=null&&e.autoPrefix){let c=n.postprocess;c||(c=[]),Array.isArray(c)||(c=[c]),c.unshift(ht(document.createElement("div").style)),n.postprocess=c}(R=e==null?void 0:e.configResolved)==null||R.call(e,t,n);let i,s=!0,o,a=ut(t,n),l=new Set,f,C=[],g=()=>new Promise(c=>{C.push(c),f!=null&&clearTimeout(f),f=setTimeout(()=>u().then(()=>{let y=C;C=[],y.forEach(w=>w())}),0)});function x(c=document.body){if(c.nodeType!==1)return;let y=c;y.hasAttribute("un-cloak")&&y.removeAttribute("un-cloak"),y.querySelectorAll("[un-cloak]").forEach(w=>{w.removeAttribute("un-cloak")})}async function u(){let c=await a.generate(l);i||(i=document.createElement("style"),document.documentElement.prepend(i)),i.innerHTML=c.css,l=c.matched}async function h(c){let y=l.size;await a.applyExtractors(c,void 0,l),y!==l.size&&await g()}async function U(){let c=document.body&&document.body.outerHTML;c&&(await h(c),x())}let T=new MutationObserver(c=>{s||c.forEach(async y=>{if(y.target.nodeType!==1)return;let w=y.target;if(w!==i)if(y.type==="childList")y.addedNodes.forEach(async M=>{if(M.nodeType!==1)return;let E=M;o&&!o(E)||(await h(E.outerHTML),x(E))});else{if(o&&!o(w))return;if(y.attributeName!=="un-cloak"){let M=Array.from(w.attributes).map($=>$.value?`${$.name}="${$.value}"`:$.name).join(" "),E=`<${w.tagName.toLowerCase()} ${M}>`;await h(E)}w.hasAttribute("un-cloak")&&w.removeAttribute("un-cloak")}})}),p=!1;function d(){if(p)return;let c=document.documentElement||document.body;!c||(T.observe(c,{childList:!0,subtree:!0,attributes:!0}),p=!0)}function m(){U(),d()}function S(){document.readyState==="loading"?window.addEventListener("DOMContentLoaded",m):m()}let b=window.__unocss_runtime=window.__unocss_runtime={version:a.version,uno:a,async extract(c){typeof c!="string"&&(c.forEach(y=>l.add(y)),c=""),await h(c)},extractAll:U,inspect(c){o=c},toggleObserver(c){c===void 0?s=!s:s=!!c,!p&&!s&&S()}};((A=e==null?void 0:e.ready)==null?void 0:A.call(e,b))!==!1&&(s=!1,S())}N();})();