@unocss/runtime 66.2.0 → 66.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributify.global.js +3 -3
- package/core.global.js +2 -2
- package/full.global.js +3 -3
- package/mini.global.js +3 -3
- package/package.json +4 -4
- package/preset-icons.global.js +1 -1
- package/preset-mini.global.js +1 -1
- package/preset-uno.global.js +1 -1
- package/preset-web-fonts.global.js +15 -15
- package/preset-wind.global.js +1 -1
- package/uno.global.js +3 -3
package/core.global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(()=>{var G="default",W="preflights",ke="shortcuts",_e="imports",pe={[_e]:-200,[W]:-100,[ke]:-10,[G]:0};var de=/[\\:]?[\s'"`;{}]+/g;function Le(n){return n.split(de)}var Y={name:"@unocss/core/extractor-split",order:0,extract({code:n}){return Le(n)}};function U(n=[]){return Array.isArray(n)?n:[n]}function _(n){return Array.from(new Set(n))}function ie(n,e){return n.reduce((t,r)=>(t.findIndex(i=>e(r,i))===-1&&t.push(r),t),[])}function P(n){return typeof n=="string"}var H=class extends Set{_map=new Map;constructor(e){if(super(),e)for(let t of e)this.add(t)}add(e){return this._map.set(e,(this._map.get(e)??0)+1),super.add(e)}delete(e){return this._map.has(e)?(this._map.delete(e),super.delete(e)):!1}clear(){this._map.clear(),super.clear()}getCount(e){return this._map.get(e)??0}setCount(e,t){return this._map.set(e,t),super.add(e)}};function q(n){return n instanceof H}function De(n){let e=n.length,t=-1,r,s="",i=n.charCodeAt(0);for(;++t<e;){if(r=n.charCodeAt(t),r===0){s+="\uFFFD";continue}if(r===37){s+="\\%";continue}if(r===44){s+="\\,";continue}if(r>=1&&r<=31||r===127||t===0&&r>=48&&r<=57||t===1&&r>=48&&r<=57&&i===45){s+=`\\${r.toString(16)} `;continue}if(t===0&&e===1&&r===45){s+=`\\${n.charAt(t)}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){s+=n.charAt(t);continue}s+=`\\${n.charAt(t)}`}return s}var Z=De;function me(){return{events:{},emit(n,...e){(this.events[n]||[]).forEach(t=>t(...e))},on(n,e){return(this.events[n]=this.events[n]||[]).push(e),()=>this.events[n]=(this.events[n]||[]).filter(t=>t!==e)}}}function ge(n){return typeof n=="function"?{match:n}:n}function oe(n){return n.length===3}function J(n){return n!=null}function he(){}var Q=class{_map=new Map;get(e,t){let r=this._map.get(e);if(r)return r.get(t)}getFallback(e,t,r){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.has(t)||s.set(t,r),s.get(t)}set(e,t,r){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.set(t,r),this}has(e,t){return this._map.get(e)?.has(t)}delete(e,t){return this._map.get(e)?.delete(t)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([t,r])=>Array.from(r.entries()).map(([s,i])=>e(i,t,s)))}},X=class extends Map{getFallback(e,t){let r=this.get(e);return r===void 0?(this.set(e,t),t):r}map(e){let t=[];return this.forEach((r,s)=>{t.push(e(r,s))}),t}flatMap(e){let t=[];return this.forEach((r,s)=>{t.push(...e(r,s))}),t}};function N(n){return P(n)?n:(Array.isArray(n)?n:Object.entries(n)).filter(e=>e[1]!=null)}function ae(n){return Array.isArray(n)?n.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?n.map(e=>N(e)):[n]:[N(n)]}function Fe(n){return n.filter(([e,t],r)=>{if(e.startsWith("$$"))return!1;for(let s=r-1;s>=0;s--)if(n[s][0]===e&&n[s][1]===t)return!1;return!0})}function te(n){return n==null?"":Fe(n).map(([e,t])=>t!=null&&typeof t!="function"?`${e}:${t};`:void 0).filter(Boolean).join("")}function ee(n){return n&&typeof n=="object"&&!Array.isArray(n)}function le(n,e,t=!1){let r=n,s=e;if(Array.isArray(s))return t&&Array.isArray(s)?[...r,...s]:[...s];let i={...r};return ee(r)&&ee(s)&&Object.keys(s).forEach(f=>{ee(r[f])&&ee(s[f])||Array.isArray(r[f])&&Array.isArray(s[f])?i[f]=le(r[f],s[f],t):Object.assign(i,{[f]:s[f]})}),i}function B(n){let e,t,r;if(Array.isArray(n)){for(t=Array.from({length:e=n.length});e--;)t[e]=(r=n[e])&&typeof r=="object"?B(r):r;return t}if(Object.prototype.toString.call(n)==="[object Object]"){t={};for(e in n)e==="__proto__"?Object.defineProperty(t,e,{value:B(n[e]),configurable:!0,enumerable:!0,writable:!0}):t[e]=(r=n[e])&&typeof r=="object"?B(r):r;return t}return n}function ye(n){return P(n[0])}function xe(n){return P(n[0])}var ne={};function Ie(n=["-",":"]){let e=n.join("|");return ne[e]||(ne[e]=new RegExp(`((?:[!@<~\\w+:_-]|\\[&?>?:?\\S*\\])+?)(${e})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[[^\\]]*?\\])+?)\\)(?!\\s*?=>)`,"gm")),ne[e].lastIndex=0,ne[e]}function Ke(n,e=["-",":"],t=5){let r=Ie(e),s,i=n.toString(),f=new Set,d=new Map;do s=!1,i=i.replace(r,(o,a,c,h,y)=>{if(!e.includes(c))return o;s=!0,f.add(a+c);let R=y+a.length+c.length+1,T={length:o.length,items:[]};d.set(y,T);for(let b of[...h.matchAll(/\S+/g)]){let $=R+b.index,S=d.get($)?.items;S?d.delete($):S=[{offset:$,length:b[0].length,className:b[0]}];for(let C of S)C.className=C.className==="~"?a:C.className.replace(/^(!?)(.*)/,`$1${a}${c}$2`),T.items.push(C)}return"$".repeat(o.length)}),t-=1;while(s&&t);let l;if(typeof n=="string"){l="";let o=0;for(let[a,c]of d)l+=n.slice(o,a),l+=c.items.map(h=>h.className).join(" "),o=a+c.length;l+=n.slice(o)}else{l=n;for(let[o,a]of d)l.overwrite(o,o+a.length,a.items.map(c=>c.className).join(" "))}return{prefixes:Array.from(f),hasChanged:s,groupsByOffset:d,get expanded(){return l.toString()}}}function Se(n,e=["-",":"],t=5){let r=Ke(n,e,t);return typeof n=="string"?r.expanded:n}var be=new Set;function Ce(n){be.has(n)||(console.warn("[unocss]",n),be.add(n))}function Ee(n){return U(n).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}var Te="_uno_resolved";async function Ge(n){let e=typeof n=="function"?await n():await n;if(Te in e)return e;e={...e},Object.defineProperty(e,Te,{value:!0,enumerable:!1});let t=e.shortcuts?Ee(e.shortcuts):void 0;if(e.shortcuts=t,e.prefix||e.layer){let r=s=>{s[2]||(s[2]={});let i=s[2];i.prefix==null&&e.prefix&&(i.prefix=U(e.prefix)),i.layer==null&&e.layer&&(i.layer=e.layer)};t?.forEach(r),e.rules?.forEach(r)}return e}async function ve(n){let e=await Ge(n);if(!e.presets)return[e];let t=(await Promise.all((e.presets||[]).flatMap(U).flatMap(ve))).flat();return[e,...t]}function He(n){if(n.length===0)return{};let e=[],t=[],r=!1,s=[],i=[],f=[];for(let l of n){if(l.pipeline===!1){r=!0;break}else l.pipeline?.include&&e.push(l.pipeline.include),l.pipeline?.exclude&&t.push(l.pipeline.exclude);l.filesystem&&s.push(l.filesystem),l.inline&&i.push(l.inline),l.plain&&f.push(l.plain)}let d={pipeline:r?!1:{include:_(Re(...e)),exclude:_(Re(...t))}};return s.length&&(d.filesystem=_(s.flat())),i.length&&(d.inline=_(i.flat())),f.length&&(d.plain=_(f.flat())),d}async function ce(n={},e={}){let t=Object.assign({},e,n),r=ie((await Promise.all((t.presets||[]).flatMap(U).flatMap(ve))).flat(),(p,u)=>p.name===u.name),s=[...r.filter(p=>p.enforce==="pre"),...r.filter(p=>!p.enforce),...r.filter(p=>p.enforce==="post")],i=[...s,t],f=[...i].reverse(),d=Object.assign({},pe,...i.map(p=>p.layers));function l(p){return _(i.flatMap(u=>U(u[p]||[])))}let o=l("extractors"),a=f.find(p=>p.extractorDefault!==void 0)?.extractorDefault;a===void 0&&(a=Y),a&&!o.includes(a)&&o.unshift(a),o.sort((p,u)=>(p.order||0)-(u.order||0));let c=l("rules"),h={},y=c.length,R=c.filter(p=>ye(p)?(U(p[2]?.prefix||"").forEach(m=>{h[m+p[0]]=p}),!1):!0).reverse(),T=Be(i.map(p=>p.theme)),b=l("extendTheme");for(let p of b)T=p(T)||T;let $={templates:_(i.flatMap(p=>U(p.autocomplete?.templates))),extractors:i.flatMap(p=>U(p.autocomplete?.extractors)).sort((p,u)=>(p.order||0)-(u.order||0)),shorthands:Ne(i.map(p=>p.autocomplete?.shorthands||{}))},S=l("separators");S.length||(S=[":","-"]);let C=l("content"),V=He(C),v={mergeSelectors:!0,warn:!0,sortLayers:p=>p,...t,blocklist:l("blocklist"),presets:s,envMode:t.envMode||"build",shortcutsLayer:t.shortcutsLayer||"shortcuts",layers:d,theme:T,rules:c,rulesSize:y,rulesDynamic:R,rulesStaticMap:h,preprocess:l("preprocess"),postprocess:l("postprocess"),preflights:l("preflights"),autocomplete:$,variants:l("variants").map(ge).sort((p,u)=>(p.order||0)-(u.order||0)),shortcuts:Ee(l("shortcuts")).reverse(),extractors:o,safelist:l("safelist"),separators:S,details:t.details??t.envMode==="dev",content:V,transformers:ie(l("transformers"),(p,u)=>p.name===u.name)};for(let p of i)p?.configResolved?.(v);return v}function Be(n){return n.map(e=>e?B(e):{}).reduce((e,t)=>le(e,t),{})}function Ne(n){return n.reduce((e,t)=>{let r={};for(let s in t){let i=t[s];Array.isArray(i)?r[s]=`(${i.join("|")})`:r[s]=i}return{...e,...r}},{})}function Re(...n){return n.flatMap(ze)}function ze(n){return Array.isArray(n)?n:n?[n]:[]}var we="66.2.0";var I={shortcutsNoMerge:"$$symbol-shortcut-no-merge",noMerge:"$$symbol-no-merge",variants:"$$symbol-variants",parent:"$$symbol-parent",selector:"$$symbol-selector",layer:"$$symbol-layer",sort:"$$symbol-sort"},ue=class n{constructor(e={},t={}){this.userConfig=e;this.defaults=t}version=we;events=me();config=void 0;cache=new Map;blocked=new Set;parentOrders=new Map;activatedRules=new Set;static async create(e={},t={}){let r=new n(e,t);return r.config=await ce(r.userConfig,r.defaults),r.events.emit("config",r.config),r}async setConfig(e,t){e&&(t&&(this.defaults=t),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this.activatedRules.clear(),this.cache.clear(),this.config=await ce(e,this.defaults),this.events.emit("config",this.config))}async applyExtractors(e,t,r=new Set){let s={original:e,code:e,id:t,extracted:r,envMode:this.config.envMode};for(let i of this.config.extractors){let f=await i.extract?.(s);if(f)if(q(f)&&q(r))for(let d of f)r.setCount(d,r.getCount(d)+f.getCount(d));else for(let d of f)r.add(d)}return r}makeContext(e,t){let r={rawSelector:e,currentSelector:t[1],theme:this.config.theme,generator:this,symbols:I,variantHandlers:t[2],constructCSS:(...s)=>this.constructCustomCSS(r,...s),variantMatch:t};return r}async parseToken(e,t){if(this.blocked.has(e))return;let r=`${e}${t?` ${t}`:""}`;if(this.cache.has(r))return this.cache.get(r);let s=e;for(let l of this.config.preprocess)s=l(e);if(this.isBlocked(s)){this.blocked.add(e),this.cache.set(r,null);return}let i=await this.matchVariants(e,s);if(i.every(l=>!l||this.isBlocked(l[1]))){this.blocked.add(e),this.cache.set(r,null);return}let f=async l=>{let o=this.makeContext(e,[t||l[0],l[1],l[2],l[3]]);this.config.details&&(o.variants=[...l[3]]);let a=await this.expandShortcut(o.currentSelector,o);return a?await this.stringifyShortcuts(o.variantMatch,o,a[0],a[1]):(await this.parseUtil(o.variantMatch,o))?.map(h=>this.stringifyUtil(h,o)).filter(J)},d=(await Promise.all(i.map(l=>f(l)))).flat().filter(l=>!!l);if(d?.length)return this.cache.set(r,d),d;this.cache.set(r,null)}async generate(e,t={}){let{id:r,scope:s,preflights:i=!0,safelist:f=!0,minify:d=!1,extendedInfo:l=!1}=t,o=P(e)?await this.applyExtractors(e,r,l?new H:new Set):Array.isArray(e)?new Set(e):e;if(f){let u={generator:this,theme:this.config.theme};this.config.safelist.flatMap(m=>typeof m=="function"?m(u):m).forEach(m=>{let g=m.trim();g&&!o.has(g)&&o.add(g)})}let a=d?"":`
|
|
2
|
-
`,c=new Set([G]),h=l?new Map:new Set,y=new Map,R={},T=Array.from(o).map(async u=>{if(h.has(u))return;let m=await this.parseToken(u);if(m!=null){h instanceof Map?h.set(u,{data:m,count:q(o)?o.getCount(u):-1}):h.add(u);for(let g of m){let j=g[3]||"",k=g[4]?.layer;y.has(j)||y.set(j,[]),y.get(j).push(g),k&&c.add(k)}}});await Promise.all(T),await(async()=>{if(!i)return;let u={generator:this,theme:this.config.theme},m=new Set([]);this.config.preflights.forEach(({layer:g=W})=>{c.add(g),m.add(g)}),R=Object.fromEntries(await Promise.all(Array.from(m).map(async g=>{let k=(await Promise.all(this.config.preflights.filter(L=>(L.layer||W)===g).map(async L=>await L.getCSS(u)))).filter(Boolean).join(a);return[g,k]})))})();let b=this.config.sortLayers(Array.from(c).sort((u,m)=>(this.config.layers[u]??0)-(this.config.layers[m]??0)||u.localeCompare(m))),$={},S=this.config.outputToCssLayers,C=u=>{let m=u;return typeof S=="object"&&(m=S.cssLayerName?.(u)),m===null?null:m??u},V=(u=G)=>{if($[u])return $[u];let m=Array.from(y).sort((k,L)=>(this.parentOrders.get(k[0])??0)-(this.parentOrders.get(L[0])??0)||k[0]?.localeCompare(L[0]||"")||0).map(([k,L])=>{let x=L.length,E=L.filter(A=>(A[4]?.layer||G)===u).sort((A,D)=>A[0]-D[0]||(A[4]?.sort||0)-(D[4]?.sort||0)||A[5]?.currentSelector?.localeCompare(D[5]?.currentSelector??"")||A[1]?.localeCompare(D[1]||"")||A[2]?.localeCompare(D[2]||"")||0).map(([,A,D,,z,,re])=>[[[(A&&qe(A,s))??"",z?.sort??0]],D,!!(re??z?.noMerge)]);if(!E.length)return;let w=E.reverse().map(([A,D,z],re)=>{if(!z&&this.config.mergeSelectors)for(let K=re+1;K<x;K++){let F=E[K];if(F&&!F[2]&&(A&&F[0]||A==null&&F[0]==null)&&F[1]===D)return A&&F[0]&&F[0].push(...A),null}let se=A?_(A.sort((K,F)=>K[1]-F[1]||K[0]?.localeCompare(F[0]||"")||0).map(K=>K[0]).filter(Boolean)):[];return se.length?`${se.join(`,${a}`)}{${D}}`:D}).filter(Boolean),M=Array.from(new Set(w)).reverse().join(a);if(!k)return M;let O=k.split(" $$ ");return`${O.join("{")}{${a}${M}${a}${"}".repeat(O.length)}`}).filter(Boolean).join(a);i&&(m=[R[u],m].filter(Boolean).join(a));let g;S&&m&&(g=C(u),g!==null&&(m=`@layer ${g}{${a}${m}${a}}`));let j=d?"":`/* layer: ${u}${g&&g!==u?`, alias: ${g}`:""} */${a}`;return $[u]=m?j+m:""},v=(u=b,m)=>{let g=u.filter(j=>!m?.includes(j));return[S&&g.length>0?`@layer ${g.map(C).filter(J).join(", ")};`:void 0,...g.map(j=>V(j)||"")].filter(Boolean).join(a)};return{get css(){return v()},layers:b,matched:h,getLayers:v,getLayer:V,setLayer:async(u,m)=>{let g=await m(V(u));return $[u]=g,g}}}async matchVariants(e,t){let r={rawSelector:e,theme:this.config.theme,generator:this},s=async i=>{let f=!0,[,,d,l]=i;for(;f;){f=!1;let o=i[1];for(let a of this.config.variants){if(!a.multiPass&&l.has(a))continue;let c=await a.match(o,r);if(c){if(P(c)){if(c===o)continue;c={matcher:c}}if(Array.isArray(c)){if(!c.length)continue;if(c.length===1)c=c[0];else{if(a.multiPass)throw new Error("multiPass can not be used together with array return variants");let h=c.map(y=>{let R=y.matcher??o,T=[y,...d],b=new Set(l);return b.add(a),[i[0],R,T,b]});return(await Promise.all(h.map(y=>s(y)))).flat()}}i[1]=c.matcher??o,d.unshift(c),l.add(a),f=!0;break}}if(!f)break;if(d.length>500)throw new Error(`Too many variants applied to "${e}"`)}return[i]};return await s([e,t||e,[],new Set])}applyVariants(e,t=e[4],r=e[1]){let i=t.slice().sort((o,a)=>(o.order||0)-(a.order||0)).reduceRight((o,a)=>c=>{let h=a.body?.(c.entries)||c.entries,y=Array.isArray(a.parent)?a.parent:[a.parent,void 0],R=a.selector?.(c.selector,h);return(a.handle??Je)({...c,entries:h,selector:R||c.selector,parent:y[0]||c.parent,parentOrder:y[1]||c.parentOrder,layer:a.layer||c.layer,sort:a.sort||c.sort},o)},o=>o)({prefix:"",selector:Ze(r),pseudo:"",entries:e[2]}),{parent:f,parentOrder:d}=i;f!=null&&d!=null&&this.parentOrders.set(f,d);let l={selector:[i.prefix,i.selector,i.pseudo].join(""),entries:i.entries,parent:f,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(let o of this.config.postprocess)o(l);return l}constructCustomCSS(e,t,r){let s=N(t);if(P(s))return s;let{selector:i,entries:f,parent:d}=this.applyVariants([0,r||e.rawSelector,s,void 0,e.variantHandlers]),l=`${i}{${te(f)}}`;return d?`${d}{${l}}`:l}async parseUtil(e,t,r=!1,s){let i=P(e)?await this.matchVariants(e):[e],f=async([l,o,a])=>{this.config.details&&(t.rules=t.rules??[]);let c=this.config.rulesStaticMap[o];if(c&&c[1]&&(r||!c[2]?.internal)){this.config.details&&t.rules.push(c);let y=this.config.rules.indexOf(c),R=ae(c[1]).filter(b=>b.length),T=c[2];if(R.length)return t.generator.activatedRules.add(c),R.map(b=>P(b)?[y,b,T]:[y,l,b,T,a])}t.variantHandlers=a;let{rulesDynamic:h}=this.config;for(let y of h){let[R,T,b]=y;if(b?.internal&&!r)continue;let $=o;if(b?.prefix){let v=U(b.prefix);if(s){let p=U(s);if(!v.some(u=>p.includes(u)))continue}else{let p=v.find(u=>o.startsWith(u));if(p==null)continue;$=o.slice(p.length)}}let S=$.match(R);if(!S)continue;let C=await T(S,t);if(!C)continue;if(this.config.details&&t.rules.push(y),typeof C!="string")if(Symbol.asyncIterator in C){let v=[];for await(let p of C)p&&v.push(p);C=v}else Symbol.iterator in C&&!Array.isArray(C)&&(C=Array.from(C).filter(J));let V=ae(C).filter(v=>v.length);if(V.length){t.generator.activatedRules.add(y);let v=this.config.rules.indexOf(y);return V.map(p=>{if(P(p))return[v,p,b];let u=a,m=b;for(let g of p)g[0]===I.variants?typeof g[1]=="function"?u=g[1](u)||u:u=[...U(g[1]),...u]:g[0]===I.parent?u=[{parent:g[1]},...u]:g[0]===I.selector?u=[{selector:g[1]},...u]:g[0]===I.layer?u=[{layer:g[1]},...u]:g[0]===I.sort?m={...m,sort:g[1]}:g[0]===I.noMerge&&(m={...m,noMerge:g[1]});return[v,l,p,m,u]})}}},d=(await Promise.all(i.map(l=>f(l)))).flat().filter(l=>!!l);if(d.length)return d}stringifyUtil(e,t){if(!e)return;if(oe(e))return[e[0],void 0,e[1],void 0,e[2],this.config.details?t:void 0,void 0];let{selector:r,entries:s,parent:i,layer:f,sort:d,noMerge:l}=this.applyVariants(e),o=te(s);if(!o)return;let{layer:a,sort:c,...h}=e[3]??{},y={...h,layer:f??a,sort:d??c};return[e[0],r,o,i,y,this.config.details?t:void 0,l]}async expandShortcut(e,t,r=5){if(r===0)return;let s=this.config.details?o=>{t.shortcuts=t.shortcuts??[],t.shortcuts.push(o)}:he,i,f,d,l;for(let o of this.config.shortcuts){let a=e;if(o[2]?.prefix){let h=U(o[2].prefix).find(y=>e.startsWith(y));if(h==null)continue;a=e.slice(h.length)}if(xe(o)){if(o[0]===a){i=i||o[2],f=o[1],s(o);break}}else{let c=a.match(o[0]);if(c&&(f=o[1](c,t)),f){i=i||o[2],s(o);break}}}if(f&&(d=_(U(f).filter(P).map(o=>Se(o.trim()).split(/\s+/g)).flat()),l=U(f).filter(o=>!P(o)).map(o=>({handles:[],value:o}))),!f){let o=P(e)?await this.matchVariants(e):[e];for(let a of o){let[c,h,y]=a;if(c!==h){let R=await this.expandShortcut(h,t,r-1);R&&(d=R[0].filter(P).map(T=>c.replace(h,T)),l=R[0].filter(T=>!P(T)).map(T=>({handles:[...T.handles,...y],value:T.value})))}}}if(!(!d?.length&&!l?.length))return[[await Promise.all(U(d).map(async o=>(await this.expandShortcut(o,t,r-1))?.[0]||[o])),l].flat(2).filter(o=>!!o),i]}async stringifyShortcuts(e,t,r,s={layer:this.config.shortcutsLayer}){let i=new X,f=(await Promise.all(_(r).map(async a=>{let c=P(a)?await this.parseUtil(a,t,!0,s.prefix):[[Number.POSITIVE_INFINITY,"{inline}",N(a.value),void 0,a.handles]];return!c&&this.config.warn&&Ce(`unmatched utility "${a}" in shortcut "${e[1]}"`),c||[]}))).flat(1).filter(Boolean).sort((a,c)=>a[0]-c[0]),[d,,l]=e,o=[];for(let a of f){if(oe(a)){o.push([a[0],void 0,a[1],void 0,a[2],t,void 0]);continue}let{selector:c,entries:h,parent:y,sort:R,noMerge:T,layer:b}=this.applyVariants(a,[...a[4],...l],d);i.getFallback(b??s.layer,new Q).getFallback(c,y,[[],a[0]])[0].push([h,!!(T??a[3]?.noMerge),R??0])}return o.concat(i.flatMap((a,c)=>a.map(([h,y],R,T)=>{let b=(S,C,V)=>{let v=Math.max(...V.map(u=>u[1])),p=V.map(u=>u[0]);return(S?[p.flat(1)]:p).map(u=>{let m=te(u);if(m)return[y,R,m,T,{...s,noMerge:C,sort:v,layer:c},t,void 0]})};return[[h.filter(([,S])=>S).map(([S,,C])=>[S,C]),!0],[h.filter(([,S])=>!S).map(([S,,C])=>[S,C]),!1]].map(([S,C])=>[...b(!1,C,S.filter(([V])=>V.some(v=>v[0]===I.shortcutsNoMerge))),...b(!0,C,S.filter(([V])=>V.every(v=>v[0]!==I.shortcutsNoMerge)))])}).flat(2).filter(Boolean)))}isBlocked(e){return!e||this.config.blocklist.map(t=>Array.isArray(t)?t[0]:t).some(t=>typeof t=="function"?t(e):P(t)?t===e:t.test(e))}getBlocked(e){let t=this.config.blocklist.find(r=>{let s=Array.isArray(r)?r[0]:r;return typeof s=="function"?s(e):P(s)?s===e:s.test(e)});return t?Array.isArray(t)?t:[t,void 0]:void 0}};async function Me(n,e){return await ue.create(n,e)}var Pe=/\s\$\$\s+/g;function Ye(n){return Pe.test(n)}function qe(n,e){return Ye(n)?n.replace(Pe,e?` ${e} `:" "):e?`${e} ${n}`:n}var Ae=/^\[(.+?)(~?=)"(.*)"\]$/;function Ze(n){return Ae.test(n)?n.replace(Ae,(e,t,r,s)=>`[${Z(t)}${r}"${Z(s)}"]`):`.${Z(n)}`}function Je(n,e){return e(n)}function Qe(n){return n.replace(/-(\w)/g,(e,t)=>t?t.toUpperCase():"")}function Ue(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Ve(n){return n.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase()}var $e=["Webkit","Moz","ms"];function Oe(n){let e={};function t(r){let s=e[r];if(s)return s;let i=Qe(r);if(i!=="filter"&&i in n)return e[r]=Ve(i);i=Ue(i);for(let f=0;f<$e.length;f++){let d=`${$e[f]}${i}`;if(d in n)return e[r]=Ve(Ue(d))}return r}return({entries:r})=>r.forEach(s=>{s[0].startsWith("--")||(s[0]=t(s[0]))})}function je(n){return n.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<")}async function fe(n={}){if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let e=window,t=window.document,r=()=>t.documentElement,s=e.__unocss||{},i=Object.assign({},n,s.runtime),f=i.defaults||{},d=i.cloakAttribute??"un-cloak";i.autoPrefix&&(f.postprocess=U(f.postprocess)).unshift(Oe(t.createElement("div").style)),i.configResolved?.(s,f);let l=await Me(s,f),o=x=>i.inject?i.inject(x):r().prepend(x),a=()=>i.rootElement?i.rootElement():t.body,c=new Map,h=!0,y=new Set,R,T,b=[],$=()=>new Promise(x=>{b.push(x),T!=null&&clearTimeout(T),T=setTimeout(()=>V().then(()=>{let E=b;b=[],E.forEach(w=>w())}),0)});function S(x,E=!1){if(x.nodeType!==1)return;let w=x;w.hasAttribute(d)&&w.removeAttribute(d),E&&w.querySelectorAll(`[${d}]`).forEach(M=>{M.removeAttribute(d)})}function C(x,E){let w=c.get(x);if(!w)if(w=t.createElement("style"),w.setAttribute("data-unocss-runtime-layer",x),c.set(x,w),E==null)o(w);else{let M=C(E),O=M.parentNode;O?O.insertBefore(w,M.nextSibling):o(w)}return w}async function V(){let x=[...y],E=await l.generate(x);return E.layers.reduce((M,O)=>(C(O,M).innerHTML=E.getLayer(O)??"",O),void 0),x.filter(M=>!E.matched.has(M)).forEach(M=>y.delete(M)),{...E,getStyleElement:M=>c.get(M),getStyleElements:()=>c}}async function v(x){let E=y.size;await l.applyExtractors(x,void 0,y),E!==y.size&&await $()}async function p(x=a()){let E=x&&x.outerHTML;E&&(await v(`${E} ${je(E)}`),S(r()),S(x,!0))}let u=new MutationObserver(x=>{h||x.forEach(async E=>{if(E.target.nodeType!==1)return;let w=E.target;for(let M of c)if(w===M[1])return;if(E.type==="childList")E.addedNodes.forEach(async M=>{if(M.nodeType!==1)return;let O=M;R&&!R(O)||(await v(O.outerHTML),S(O))});else{if(R&&!R(w))return;if(E.attributeName!==d){let M=Array.from(w.attributes).map(A=>A.value?`${A.name}="${A.value}"`:A.name).join(" "),O=`<${w.tagName.toLowerCase()} ${M}>`;await v(O)}S(w)}})}),m=!1;function g(){if(m)return;let x=i.observer?.target?i.observer.target():a();x&&(u.observe(x,{childList:!0,subtree:!0,attributes:!0,attributeFilter:i.observer?.attributeFilter}),m=!0)}function j(){i.bypassDefined&&Xe(l.blocked),p(),g()}function k(){t.readyState==="loading"?e.addEventListener("DOMContentLoaded",j):j()}let L=e.__unocss_runtime=e.__unocss_runtime={version:l.version,uno:l,async extract(x){P(x)||(x.forEach(E=>y.add(E)),x=""),await v(x)},extractAll:p,inspect(x){R=x},toggleObserver(x){x===void 0?h=!h:h=!!x,!m&&!h&&k()},update:V,presets:e.__unocss_runtime?.presets??{}};i.ready?.(L)!==!1&&(h=!1,k())}function Xe(n=new Set){for(let e=0;e<document.styleSheets.length;e++){let t=document.styleSheets[e],r;try{if(r=t.cssRules||t.rules,!r)continue;Array.from(r).flatMap(s=>s.selectorText?.split(/,/g)||[]).forEach(s=>{s&&(s=s.trim(),s.startsWith(".")&&(s=s.slice(1)),n.add(s))})}catch{continue}}return n}fe();})();
|
|
1
|
+
"use strict";(()=>{var G="default",W="preflights",ke="shortcuts",_e="imports",pe={[_e]:-200,[W]:-100,[ke]:-10,[G]:0};var de=/[\\:]?[\s'"`;{}]+/g;function Le(n){return n.split(de)}var Y={name:"@unocss/core/extractor-split",order:0,extract({code:n}){return Le(n)}};function U(n=[]){return Array.isArray(n)?n:[n]}function _(n){return Array.from(new Set(n))}function ie(n,e){return n.reduce((t,r)=>(t.findIndex(i=>e(r,i))===-1&&t.push(r),t),[])}function P(n){return typeof n=="string"}var H=class extends Set{_map=new Map;constructor(e){if(super(),e)for(let t of e)this.add(t)}add(e){return this._map.set(e,(this._map.get(e)??0)+1),super.add(e)}delete(e){return this._map.has(e)?(this._map.delete(e),super.delete(e)):!1}clear(){this._map.clear(),super.clear()}getCount(e){return this._map.get(e)??0}setCount(e,t){return this._map.set(e,t),super.add(e)}};function q(n){return n instanceof H}function De(n){let e=n.length,t=-1,r,s="",i=n.charCodeAt(0);for(;++t<e;){if(r=n.charCodeAt(t),r===0){s+="\uFFFD";continue}if(r===37){s+="\\%";continue}if(r===44){s+="\\,";continue}if(r>=1&&r<=31||r===127||t===0&&r>=48&&r<=57||t===1&&r>=48&&r<=57&&i===45){s+=`\\${r.toString(16)} `;continue}if(t===0&&e===1&&r===45){s+=`\\${n.charAt(t)}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){s+=n.charAt(t);continue}s+=`\\${n.charAt(t)}`}return s}var Z=De;function me(){return{events:{},emit(n,...e){(this.events[n]||[]).forEach(t=>t(...e))},on(n,e){return(this.events[n]=this.events[n]||[]).push(e),()=>this.events[n]=(this.events[n]||[]).filter(t=>t!==e)}}}function ge(n){return typeof n=="function"?{match:n}:n}function oe(n){return n.length===3}function J(n){return n!=null}function he(){}var Q=class{_map=new Map;get(e,t){let r=this._map.get(e);if(r)return r.get(t)}getFallback(e,t,r){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.has(t)||s.set(t,r),s.get(t)}set(e,t,r){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.set(t,r),this}has(e,t){return this._map.get(e)?.has(t)}delete(e,t){return this._map.get(e)?.delete(t)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([t,r])=>Array.from(r.entries()).map(([s,i])=>e(i,t,s)))}},X=class extends Map{getFallback(e,t){let r=this.get(e);return r===void 0?(this.set(e,t),t):r}map(e){let t=[];return this.forEach((r,s)=>{t.push(e(r,s))}),t}flatMap(e){let t=[];return this.forEach((r,s)=>{t.push(...e(r,s))}),t}};function N(n){return P(n)?n:(Array.isArray(n)?n:Object.entries(n)).filter(e=>e[1]!=null)}function ae(n){return Array.isArray(n)?n.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?n.map(e=>N(e)):[n]:[N(n)]}function Fe(n){return n.filter(([e,t],r)=>{if(e.startsWith("$$"))return!1;for(let s=r-1;s>=0;s--)if(n[s][0]===e&&n[s][1]===t)return!1;return!0})}function te(n){return n==null?"":Fe(n).map(([e,t])=>t!=null&&typeof t!="function"?`${e}:${t};`:void 0).filter(Boolean).join("")}function ee(n){return n&&typeof n=="object"&&!Array.isArray(n)}function le(n,e,t=!1){let r=n,s=e;if(Array.isArray(s))return t&&Array.isArray(s)?[...r,...s]:[...s];let i={...r};return ee(r)&&ee(s)&&Object.keys(s).forEach(f=>{ee(r[f])&&ee(s[f])||Array.isArray(r[f])&&Array.isArray(s[f])?i[f]=le(r[f],s[f],t):Object.assign(i,{[f]:s[f]})}),i}function B(n){let e,t,r;if(Array.isArray(n)){for(t=Array.from({length:e=n.length});e--;)t[e]=(r=n[e])&&typeof r=="object"?B(r):r;return t}if(Object.prototype.toString.call(n)==="[object Object]"){t={};for(e in n)e==="__proto__"?Object.defineProperty(t,e,{value:B(n[e]),configurable:!0,enumerable:!0,writable:!0}):t[e]=(r=n[e])&&typeof r=="object"?B(r):r;return t}return n}function ye(n){return P(n[0])}function xe(n){return P(n[0])}var ne={};function Ie(n=["-",":"]){let e=n.join("|");return ne[e]||(ne[e]=new RegExp(`((?:[!@<~\\w+:_-]|\\[&?>?:?\\S*\\])+?)(${e})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[[^\\]]*?\\])+?)\\)(?!\\s*?=>)`,"gm")),ne[e].lastIndex=0,ne[e]}function Ke(n,e=["-",":"],t=5){let r=Ie(e),s,i=n.toString(),f=new Set,p=new Map;do s=!1,i=i.replace(r,(o,a,c,h,y)=>{if(!e.includes(c))return o;s=!0,f.add(a+c);let R=y+a.length+c.length+1,v={length:o.length,items:[]};p.set(y,v);for(let b of[...h.matchAll(/\S+/g)]){let $=R+b.index,C=p.get($)?.items;C?p.delete($):C=[{offset:$,length:b[0].length,className:b[0]}];for(let S of C)S.className=S.className==="~"?a:S.className.replace(/^(!?)(.*)/,`$1${a}${c}$2`),v.items.push(S)}return"$".repeat(o.length)}),t-=1;while(s&&t);let l;if(typeof n=="string"){l="";let o=0;for(let[a,c]of p)l+=n.slice(o,a),l+=c.items.map(h=>h.className).join(" "),o=a+c.length;l+=n.slice(o)}else{l=n;for(let[o,a]of p)l.overwrite(o,o+a.length,a.items.map(c=>c.className).join(" "))}return{prefixes:Array.from(f),hasChanged:s,groupsByOffset:p,get expanded(){return l.toString()}}}function Se(n,e=["-",":"],t=5){let r=Ke(n,e,t);return typeof n=="string"?r.expanded:n}var be=new Set;function Ce(n){be.has(n)||(console.warn("[unocss]",n),be.add(n))}function Ee(n){return U(n).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}var Te="_uno_resolved";async function Ge(n){let e=typeof n=="function"?await n():await n;if(Te in e)return e;e={...e},Object.defineProperty(e,Te,{value:!0,enumerable:!1});let t=e.shortcuts?Ee(e.shortcuts):void 0;if(e.shortcuts=t,e.prefix||e.layer){let r=s=>{s[2]||(s[2]={});let i=s[2];i.prefix==null&&e.prefix&&(i.prefix=U(e.prefix)),i.layer==null&&e.layer&&(i.layer=e.layer)};t?.forEach(r),e.rules?.forEach(r)}return e}async function ve(n){let e=await Ge(n);if(!e.presets)return[e];let t=(await Promise.all((e.presets||[]).flatMap(U).flatMap(ve))).flat();return[e,...t]}function He(n){if(n.length===0)return{};let e=[],t=[],r=!1,s=[],i=[],f=[];for(let l of n){if(l.pipeline===!1){r=!0;break}else l.pipeline?.include&&e.push(l.pipeline.include),l.pipeline?.exclude&&t.push(l.pipeline.exclude);l.filesystem&&s.push(l.filesystem),l.inline&&i.push(l.inline),l.plain&&f.push(l.plain)}let p={pipeline:r?!1:{include:_(Re(...e)),exclude:_(Re(...t))}};return s.length&&(p.filesystem=_(s.flat())),i.length&&(p.inline=_(i.flat())),f.length&&(p.plain=_(f.flat())),p}async function ce(n={},e={}){let t=Object.assign({},e,n),r=ie((await Promise.all((t.presets||[]).flatMap(U).flatMap(ve))).flat(),(u,T)=>u.name===T.name),s=[...r.filter(u=>u.enforce==="pre"),...r.filter(u=>!u.enforce),...r.filter(u=>u.enforce==="post")],i=[...s,t],f=[...i].reverse(),p=Object.assign({},pe,...i.map(u=>u.layers));function l(u){return _(i.flatMap(T=>U(T[u]||[])))}let o=l("extractors"),a=f.find(u=>u.extractorDefault!==void 0)?.extractorDefault;a===void 0&&(a=Y),a&&!o.includes(a)&&o.unshift(a),o.sort((u,T)=>(u.order||0)-(T.order||0));let c=l("rules"),h={},y=c.length,R=c.filter(u=>ye(u)?(U(u[2]?.prefix||"").forEach(d=>{h[d+u[0]]=u}),!1):!0).reverse(),v={templates:_(i.flatMap(u=>U(u.autocomplete?.templates))),extractors:i.flatMap(u=>U(u.autocomplete?.extractors)).sort((u,T)=>(u.order||0)-(T.order||0)),shorthands:Ne(i.map(u=>u.autocomplete?.shorthands||{}))},b=l("separators");b.length||(b=[":","-"]);let $=l("content"),C=He($),S={mergeSelectors:!0,warn:!0,sortLayers:u=>u,...t,blocklist:l("blocklist"),presets:s,envMode:t.envMode||"build",shortcutsLayer:t.shortcutsLayer||"shortcuts",layers:p,theme:Be(i.map(u=>u.theme)),rules:c,rulesSize:y,rulesDynamic:R,rulesStaticMap:h,preprocess:l("preprocess"),postprocess:l("postprocess"),preflights:l("preflights"),autocomplete:v,variants:l("variants").map(ge).sort((u,T)=>(u.order||0)-(T.order||0)),shortcuts:Ee(l("shortcuts")).reverse(),extractors:o,safelist:l("safelist"),separators:b,details:t.details??t.envMode==="dev",content:C,transformers:ie(l("transformers"),(u,T)=>u.name===T.name)},V=l("extendTheme");for(let u of V)S.theme=u(S.theme,S)||S.theme;for(let u of i)u?.configResolved?.(S);return S}function Be(n){return n.map(e=>e?B(e):{}).reduce((e,t)=>le(e,t),{})}function Ne(n){return n.reduce((e,t)=>{let r={};for(let s in t){let i=t[s];Array.isArray(i)?r[s]=`(${i.join("|")})`:r[s]=i}return{...e,...r}},{})}function Re(...n){return n.flatMap(ze)}function ze(n){return Array.isArray(n)?n:n?[n]:[]}var we="66.2.2";var I={shortcutsNoMerge:"$$symbol-shortcut-no-merge",noMerge:"$$symbol-no-merge",variants:"$$symbol-variants",parent:"$$symbol-parent",selector:"$$symbol-selector",layer:"$$symbol-layer",sort:"$$symbol-sort"},ue=class n{constructor(e={},t={}){this.userConfig=e;this.defaults=t}version=we;events=me();config=void 0;cache=new Map;blocked=new Set;parentOrders=new Map;activatedRules=new Set;static async create(e={},t={}){let r=new n(e,t);return r.config=await ce(r.userConfig,r.defaults),r.events.emit("config",r.config),r}async setConfig(e,t){e&&(t&&(this.defaults=t),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this.activatedRules.clear(),this.cache.clear(),this.config=await ce(e,this.defaults),this.events.emit("config",this.config))}async applyExtractors(e,t,r=new Set){let s={original:e,code:e,id:t,extracted:r,envMode:this.config.envMode};for(let i of this.config.extractors){let f=await i.extract?.(s);if(f)if(q(f)&&q(r))for(let p of f)r.setCount(p,r.getCount(p)+f.getCount(p));else for(let p of f)r.add(p)}return r}makeContext(e,t){let r={rawSelector:e,currentSelector:t[1],theme:this.config.theme,generator:this,symbols:I,variantHandlers:t[2],constructCSS:(...s)=>this.constructCustomCSS(r,...s),variantMatch:t};return r}async parseToken(e,t){if(this.blocked.has(e))return;let r=`${e}${t?` ${t}`:""}`;if(this.cache.has(r))return this.cache.get(r);let s=e;for(let l of this.config.preprocess)s=l(e);if(this.isBlocked(s)){this.blocked.add(e),this.cache.set(r,null);return}let i=await this.matchVariants(e,s);if(i.every(l=>!l||this.isBlocked(l[1]))){this.blocked.add(e),this.cache.set(r,null);return}let f=async l=>{let o=this.makeContext(e,[t||l[0],l[1],l[2],l[3]]);this.config.details&&(o.variants=[...l[3]]);let a=await this.expandShortcut(o.currentSelector,o);return a?await this.stringifyShortcuts(o.variantMatch,o,a[0],a[1]):(await this.parseUtil(o.variantMatch,o))?.map(h=>this.stringifyUtil(h,o)).filter(J)},p=(await Promise.all(i.map(l=>f(l)))).flat().filter(l=>!!l);if(p?.length)return this.cache.set(r,p),p;this.cache.set(r,null)}async generate(e,t={}){let{id:r,scope:s,preflights:i=!0,safelist:f=!0,minify:p=!1,extendedInfo:l=!1}=t,o=P(e)?await this.applyExtractors(e,r,l?new H:new Set):Array.isArray(e)?new Set(e):e;if(f){let d={generator:this,theme:this.config.theme};this.config.safelist.flatMap(m=>typeof m=="function"?m(d):m).forEach(m=>{let g=m.trim();g&&!o.has(g)&&o.add(g)})}let a=p?"":`
|
|
2
|
+
`,c=new Set([G]),h=l?new Map:new Set,y=new Map,R={},v=Array.from(o).map(async d=>{if(h.has(d))return;let m=await this.parseToken(d);if(m!=null){h instanceof Map?h.set(d,{data:m,count:q(o)?o.getCount(d):-1}):h.add(d);for(let g of m){let j=g[3]||"",k=g[4]?.layer;y.has(j)||y.set(j,[]),y.get(j).push(g),k&&c.add(k)}}});await Promise.all(v),await(async()=>{if(!i)return;let d={generator:this,theme:this.config.theme},m=new Set([]);this.config.preflights.forEach(({layer:g=W})=>{c.add(g),m.add(g)}),R=Object.fromEntries(await Promise.all(Array.from(m).map(async g=>{let k=(await Promise.all(this.config.preflights.filter(L=>(L.layer||W)===g).map(async L=>await L.getCSS(d)))).filter(Boolean).join(a);return[g,k]})))})();let b=this.config.sortLayers(Array.from(c).sort((d,m)=>(this.config.layers[d]??0)-(this.config.layers[m]??0)||d.localeCompare(m))),$={},C=this.config.outputToCssLayers,S=d=>{let m=d;return typeof C=="object"&&(m=C.cssLayerName?.(d)),m===null?null:m??d},V=(d=G)=>{if($[d])return $[d];let m=Array.from(y).sort((k,L)=>(this.parentOrders.get(k[0])??0)-(this.parentOrders.get(L[0])??0)||k[0]?.localeCompare(L[0]||"")||0).map(([k,L])=>{let x=L.length,E=L.filter(A=>(A[4]?.layer||G)===d).sort((A,D)=>A[0]-D[0]||(A[4]?.sort||0)-(D[4]?.sort||0)||A[5]?.currentSelector?.localeCompare(D[5]?.currentSelector??"")||A[1]?.localeCompare(D[1]||"")||A[2]?.localeCompare(D[2]||"")||0).map(([,A,D,,z,,re])=>[[[(A&&qe(A,s))??"",z?.sort??0]],D,!!(re??z?.noMerge)]);if(!E.length)return;let w=E.reverse().map(([A,D,z],re)=>{if(!z&&this.config.mergeSelectors)for(let K=re+1;K<x;K++){let F=E[K];if(F&&!F[2]&&(A&&F[0]||A==null&&F[0]==null)&&F[1]===D)return A&&F[0]&&F[0].push(...A),null}let se=A?_(A.sort((K,F)=>K[1]-F[1]||K[0]?.localeCompare(F[0]||"")||0).map(K=>K[0]).filter(Boolean)):[];return se.length?`${se.join(`,${a}`)}{${D}}`:D}).filter(Boolean),M=Array.from(new Set(w)).reverse().join(a);if(!k)return M;let O=k.split(" $$ ");return`${O.join("{")}{${a}${M}${a}${"}".repeat(O.length)}`}).filter(Boolean).join(a);i&&(m=[R[d],m].filter(Boolean).join(a));let g;C&&m&&(g=S(d),g!==null&&(m=`@layer ${g}{${a}${m}${a}}`));let j=p?"":`/* layer: ${d}${g&&g!==d?`, alias: ${g}`:""} */${a}`;return $[d]=m?j+m:""},u=(d=b,m)=>{let g=d.filter(j=>!m?.includes(j));return[C&&g.length>0?`@layer ${g.map(S).filter(J).join(", ")};`:void 0,...g.map(j=>V(j)||"")].filter(Boolean).join(a)};return{get css(){return u()},layers:b,matched:h,getLayers:u,getLayer:V,setLayer:async(d,m)=>{let g=await m(V(d));return $[d]=g,g}}}async matchVariants(e,t){let r={rawSelector:e,theme:this.config.theme,generator:this},s=async i=>{let f=!0,[,,p,l]=i;for(;f;){f=!1;let o=i[1];for(let a of this.config.variants){if(!a.multiPass&&l.has(a))continue;let c=await a.match(o,r);if(c){if(P(c)){if(c===o)continue;c={matcher:c}}if(Array.isArray(c)){if(!c.length)continue;if(c.length===1)c=c[0];else{if(a.multiPass)throw new Error("multiPass can not be used together with array return variants");let h=c.map(y=>{let R=y.matcher??o,v=[y,...p],b=new Set(l);return b.add(a),[i[0],R,v,b]});return(await Promise.all(h.map(y=>s(y)))).flat()}}i[1]=c.matcher??o,p.unshift(c),l.add(a),f=!0;break}}if(!f)break;if(p.length>500)throw new Error(`Too many variants applied to "${e}"`)}return[i]};return await s([e,t||e,[],new Set])}applyVariants(e,t=e[4],r=e[1]){let i=t.slice().sort((o,a)=>(o.order||0)-(a.order||0)).reduceRight((o,a)=>c=>{let h=a.body?.(c.entries)||c.entries,y=Array.isArray(a.parent)?a.parent:[a.parent,void 0],R=a.selector?.(c.selector,h);return(a.handle??Je)({...c,entries:h,selector:R||c.selector,parent:y[0]||c.parent,parentOrder:y[1]||c.parentOrder,layer:a.layer||c.layer,sort:a.sort||c.sort},o)},o=>o)({prefix:"",selector:Ze(r),pseudo:"",entries:e[2]}),{parent:f,parentOrder:p}=i;f!=null&&p!=null&&this.parentOrders.set(f,p);let l={selector:[i.prefix,i.selector,i.pseudo].join(""),entries:i.entries,parent:f,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(let o of this.config.postprocess)o(l);return l}constructCustomCSS(e,t,r){let s=N(t);if(P(s))return s;let{selector:i,entries:f,parent:p}=this.applyVariants([0,r||e.rawSelector,s,void 0,e.variantHandlers]),l=`${i}{${te(f)}}`;return p?`${p}{${l}}`:l}async parseUtil(e,t,r=!1,s){let i=P(e)?await this.matchVariants(e):[e],f=async([l,o,a])=>{this.config.details&&(t.rules=t.rules??[]);let c=this.config.rulesStaticMap[o];if(c&&c[1]&&(r||!c[2]?.internal)){this.config.details&&t.rules.push(c);let y=this.config.rules.indexOf(c),R=ae(c[1]).filter(b=>b.length),v=c[2];if(R.length)return t.generator.activatedRules.add(c),R.map(b=>P(b)?[y,b,v]:[y,l,b,v,a])}t.variantHandlers=a;let{rulesDynamic:h}=this.config;for(let y of h){let[R,v,b]=y;if(b?.internal&&!r)continue;let $=o;if(b?.prefix){let u=U(b.prefix);if(s){let T=U(s);if(!u.some(d=>T.includes(d)))continue}else{let T=u.find(d=>o.startsWith(d));if(T==null)continue;$=o.slice(T.length)}}let C=$.match(R);if(!C)continue;let S=await v(C,t);if(!S)continue;if(this.config.details&&t.rules.push(y),typeof S!="string")if(Symbol.asyncIterator in S){let u=[];for await(let T of S)T&&u.push(T);S=u}else Symbol.iterator in S&&!Array.isArray(S)&&(S=Array.from(S).filter(J));let V=ae(S).filter(u=>u.length);if(V.length){t.generator.activatedRules.add(y);let u=this.config.rules.indexOf(y);return V.map(T=>{if(P(T))return[u,T,b];let d=a,m=b;for(let g of T)g[0]===I.variants?typeof g[1]=="function"?d=g[1](d)||d:d=[...U(g[1]),...d]:g[0]===I.parent?d=[{parent:g[1]},...d]:g[0]===I.selector?d=[{selector:g[1]},...d]:g[0]===I.layer?d=[{layer:g[1]},...d]:g[0]===I.sort?m={...m,sort:g[1]}:g[0]===I.noMerge&&(m={...m,noMerge:g[1]});return[u,l,T,m,d]})}}},p=(await Promise.all(i.map(l=>f(l)))).flat().filter(l=>!!l);if(p.length)return p}stringifyUtil(e,t){if(!e)return;if(oe(e))return[e[0],void 0,e[1],void 0,e[2],this.config.details?t:void 0,void 0];let{selector:r,entries:s,parent:i,layer:f,sort:p,noMerge:l}=this.applyVariants(e),o=te(s);if(!o)return;let{layer:a,sort:c,...h}=e[3]??{},y={...h,layer:f??a,sort:p??c};return[e[0],r,o,i,y,this.config.details?t:void 0,l]}async expandShortcut(e,t,r=5){if(r===0)return;let s=this.config.details?o=>{t.shortcuts=t.shortcuts??[],t.shortcuts.push(o)}:he,i,f,p,l;for(let o of this.config.shortcuts){let a=e;if(o[2]?.prefix){let h=U(o[2].prefix).find(y=>e.startsWith(y));if(h==null)continue;a=e.slice(h.length)}if(xe(o)){if(o[0]===a){i=i||o[2],f=o[1],s(o);break}}else{let c=a.match(o[0]);if(c&&(f=o[1](c,t)),f){i=i||o[2],s(o);break}}}if(f&&(p=_(U(f).filter(P).map(o=>Se(o.trim()).split(/\s+/g)).flat()),l=U(f).filter(o=>!P(o)).map(o=>({handles:[],value:o}))),!f){let o=P(e)?await this.matchVariants(e):[e];for(let a of o){let[c,h,y]=a;if(c!==h){let R=await this.expandShortcut(h,t,r-1);R&&(p=R[0].filter(P).map(v=>c.replace(h,v)),l=R[0].filter(v=>!P(v)).map(v=>({handles:[...v.handles,...y],value:v.value})))}}}if(!(!p?.length&&!l?.length))return[[await Promise.all(U(p).map(async o=>(await this.expandShortcut(o,t,r-1))?.[0]||[o])),l].flat(2).filter(o=>!!o),i]}async stringifyShortcuts(e,t,r,s={layer:this.config.shortcutsLayer}){let i=new X,f=(await Promise.all(_(r).map(async a=>{let c=P(a)?await this.parseUtil(a,t,!0,s.prefix):[[Number.POSITIVE_INFINITY,"{inline}",N(a.value),void 0,a.handles]];return!c&&this.config.warn&&Ce(`unmatched utility "${a}" in shortcut "${e[1]}"`),c||[]}))).flat(1).filter(Boolean).sort((a,c)=>a[0]-c[0]),[p,,l]=e,o=[];for(let a of f){if(oe(a)){o.push([a[0],void 0,a[1],void 0,a[2],t,void 0]);continue}let{selector:c,entries:h,parent:y,sort:R,noMerge:v,layer:b}=this.applyVariants(a,[...a[4],...l],p);i.getFallback(b??s.layer,new Q).getFallback(c,y,[[],a[0]])[0].push([h,!!(v??a[3]?.noMerge),R??0])}return o.concat(i.flatMap((a,c)=>a.map(([h,y],R,v)=>{let b=(C,S,V)=>{let u=Math.max(...V.map(d=>d[1])),T=V.map(d=>d[0]);return(C?[T.flat(1)]:T).map(d=>{let m=te(d);if(m)return[y,R,m,v,{...s,noMerge:S,sort:u,layer:c},t,void 0]})};return[[h.filter(([,C])=>C).map(([C,,S])=>[C,S]),!0],[h.filter(([,C])=>!C).map(([C,,S])=>[C,S]),!1]].map(([C,S])=>[...b(!1,S,C.filter(([V])=>V.some(u=>u[0]===I.shortcutsNoMerge))),...b(!0,S,C.filter(([V])=>V.every(u=>u[0]!==I.shortcutsNoMerge)))])}).flat(2).filter(Boolean)))}isBlocked(e){return!e||this.config.blocklist.map(t=>Array.isArray(t)?t[0]:t).some(t=>typeof t=="function"?t(e):P(t)?t===e:t.test(e))}getBlocked(e){let t=this.config.blocklist.find(r=>{let s=Array.isArray(r)?r[0]:r;return typeof s=="function"?s(e):P(s)?s===e:s.test(e)});return t?Array.isArray(t)?t:[t,void 0]:void 0}};async function Me(n,e){return await ue.create(n,e)}var Pe=/\s\$\$\s+/g;function Ye(n){return Pe.test(n)}function qe(n,e){return Ye(n)?n.replace(Pe,e?` ${e} `:" "):e?`${e} ${n}`:n}var Ae=/^\[(.+?)(~?=)"(.*)"\]$/;function Ze(n){return Ae.test(n)?n.replace(Ae,(e,t,r,s)=>`[${Z(t)}${r}"${Z(s)}"]`):`.${Z(n)}`}function Je(n,e){return e(n)}function Qe(n){return n.replace(/-(\w)/g,(e,t)=>t?t.toUpperCase():"")}function Ue(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Ve(n){return n.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase()}var $e=["Webkit","Moz","ms"];function Oe(n){let e={};function t(r){let s=e[r];if(s)return s;let i=Qe(r);if(i!=="filter"&&i in n)return e[r]=Ve(i);i=Ue(i);for(let f=0;f<$e.length;f++){let p=`${$e[f]}${i}`;if(p in n)return e[r]=Ve(Ue(p))}return r}return({entries:r})=>r.forEach(s=>{s[0].startsWith("--")||(s[0]=t(s[0]))})}function je(n){return n.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<")}async function fe(n={}){if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let e=window,t=window.document,r=()=>t.documentElement,s=e.__unocss||{},i=Object.assign({},n,s.runtime),f=i.defaults||{},p=i.cloakAttribute??"un-cloak";i.autoPrefix&&(f.postprocess=U(f.postprocess)).unshift(Oe(t.createElement("div").style)),i.configResolved?.(s,f);let l=await Me(s,f),o=x=>i.inject?i.inject(x):r().prepend(x),a=()=>i.rootElement?i.rootElement():t.body,c=new Map,h=!0,y=new Set,R,v,b=[],$=()=>new Promise(x=>{b.push(x),v!=null&&clearTimeout(v),v=setTimeout(()=>V().then(()=>{let E=b;b=[],E.forEach(w=>w())}),0)});function C(x,E=!1){if(x.nodeType!==1)return;let w=x;w.hasAttribute(p)&&w.removeAttribute(p),E&&w.querySelectorAll(`[${p}]`).forEach(M=>{M.removeAttribute(p)})}function S(x,E){let w=c.get(x);if(!w)if(w=t.createElement("style"),w.setAttribute("data-unocss-runtime-layer",x),c.set(x,w),E==null)o(w);else{let M=S(E),O=M.parentNode;O?O.insertBefore(w,M.nextSibling):o(w)}return w}async function V(){let x=[...y],E=await l.generate(x);return E.layers.reduce((M,O)=>(S(O,M).innerHTML=E.getLayer(O)??"",O),void 0),x.filter(M=>!E.matched.has(M)).forEach(M=>y.delete(M)),{...E,getStyleElement:M=>c.get(M),getStyleElements:()=>c}}async function u(x){let E=y.size;await l.applyExtractors(x,void 0,y),E!==y.size&&await $()}async function T(x=a()){let E=x&&x.outerHTML;E&&(await u(`${E} ${je(E)}`),C(r()),C(x,!0))}let d=new MutationObserver(x=>{h||x.forEach(async E=>{if(E.target.nodeType!==1)return;let w=E.target;for(let M of c)if(w===M[1])return;if(E.type==="childList")E.addedNodes.forEach(async M=>{if(M.nodeType!==1)return;let O=M;R&&!R(O)||(await u(O.outerHTML),C(O))});else{if(R&&!R(w))return;if(E.attributeName!==p){let M=Array.from(w.attributes).map(A=>A.value?`${A.name}="${A.value}"`:A.name).join(" "),O=`<${w.tagName.toLowerCase()} ${M}>`;await u(O)}C(w)}})}),m=!1;function g(){if(m)return;let x=i.observer?.target?i.observer.target():a();x&&(d.observe(x,{childList:!0,subtree:!0,attributes:!0,attributeFilter:i.observer?.attributeFilter}),m=!0)}function j(){i.bypassDefined&&Xe(l.blocked),T(),g()}function k(){t.readyState==="loading"?e.addEventListener("DOMContentLoaded",j):j()}let L=e.__unocss_runtime=e.__unocss_runtime={version:l.version,uno:l,async extract(x){P(x)||(x.forEach(E=>y.add(E)),x=""),await u(x)},extractAll:T,inspect(x){R=x},toggleObserver(x){x===void 0?h=!h:h=!!x,!m&&!h&&k()},update:V,presets:e.__unocss_runtime?.presets??{}};i.ready?.(L)!==!1&&(h=!1,k())}function Xe(n=new Set){for(let e=0;e<document.styleSheets.length;e++){let t=document.styleSheets[e],r;try{if(r=t.cssRules||t.rules,!r)continue;Array.from(r).flatMap(s=>s.selectorText?.split(/,/g)||[]).forEach(s=>{s&&(s=s.trim(),s.startsWith(".")&&(s=s.slice(1)),n.add(s))})}catch{continue}}return n}fe();})();
|