@unocss/runtime 0.44.2 → 0.44.5

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