@unocss/runtime 0.53.5 → 0.54.0

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,9 @@
1
- "use strict";(()=>{function Ee(t){let e=t.length,r=-1,n,s="",i=t.charCodeAt(0);for(;++r<e;){if(n=t.charCodeAt(r),n===0){s+="\uFFFD";continue}if(n===44){s+="\\,";continue}if(n>=1&&n<=31||n===127||r===0&&n>=48&&n<=57||r===1&&n>=48&&n<=57&&i===45){s+=`\\${n.toString(16)} `;continue}if(r===0&&e===1&&n===45){s+=`\\${t.charAt(r)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){s+=t.charAt(r);continue}s+=`\\${t.charAt(r)}`}return s}var H=Ee;function A(t=[]){return Array.isArray(t)?t:[t]}function P(t){return Array.from(new Set(t))}function E(t){return typeof t=="string"}function L(t){return E(t)?t:(Array.isArray(t)?t:Object.entries(t)).filter(e=>e[1]!=null)}function ee(t){return Array.isArray(t)?t.find(e=>!Array.isArray(e)||Array.isArray(e[0]))?t.map(e=>L(e)):[t]:[L(t)]}function Re(t){return t.filter(([e,r],n)=>{if(e.startsWith("$$"))return!1;for(let s=n-1;s>=0;s--)if(t[s][0]===e&&t[s][1]===r)return!1;return!0})}function F(t){return t==null?"":Re(t).map(([e,r])=>r!=null?`${e}:${r};`:void 0).filter(Boolean).join("")}function G(t){return t&&typeof t=="object"&&!Array.isArray(t)}function Y(t,e,r=!1){let n=t,s=e;if(Array.isArray(s))return r&&Array.isArray(s)?[...n,...s]:[...s];let i={...n};return G(n)&&G(s)&&Object.keys(s).forEach(o=>{G(n[o])&&G(s[o])||Array.isArray(n[o])&&Array.isArray(s[o])?i[o]=Y(n[o],s[o],r):Object.assign(i,{[o]:s[o]})}),i}function k(t){let e,r,n;if(Array.isArray(t)){for(r=Array(e=t.length);e--;)r[e]=(n=t[e])&&typeof n=="object"?k(n):n;return r}if(Object.prototype.toString.call(t)==="[object Object]"){r={};for(e in t)e==="__proto__"?Object.defineProperty(r,e,{value:k(t[e]),configurable:!0,enumerable:!0,writable:!0}):r[e]=(n=t[e])&&typeof n=="object"?k(n):n;return r}return t}function te(t){return E(t[0])}function re(t){return E(t[0])}var q="$$shortcut-no-merge";function ne(t){return typeof t=="function"?{match:t}:t}function Z(t){return t.length===3}function se(t){return t!=null}function ie(){}var B=class{_map=new Map;get(e,r){let n=this._map.get(e);if(n)return n.get(r)}getFallback(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.has(r)||s.set(r,n),s.get(r)}set(e,r,n){let s=this._map.get(e);return s||(s=new Map,this._map.set(e,s)),s.set(r,n),this}has(e,r){return this._map.get(e)?.has(r)}delete(e,r){return this._map.get(e)?.delete(r)||!1}deleteTop(e){return this._map.delete(e)}map(e){return Array.from(this._map.entries()).flatMap(([r,n])=>Array.from(n.entries()).map(([s,i])=>e(i,r,s)))}};var I={};function ve(t=["-",":"]){let e=t.join("|");return I[e]||(I[e]=new RegExp(`((?:[!@<~\\w+:_/-]|\\[&?>?:?\\S*\\])+?)(${e})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[.*?\\])+?)\\)(?!\\s*?=>)`,"gm")),I[e].lastIndex=0,I[e]}function we(t,e=["-",":"],r=5){let n=ve(e),s=!1,i=t.toString(),o=new Set;do{let l=i;i=i.replace(n,(f,u,a,d)=>e.includes(a)?(o.add(u+a),d.split(/\s/g).filter(Boolean).map(y=>y==="~"?u:y.replace(/^(!?)(.*)/,`$1${u}${a}$2`)).join(" ")):f),s=i!==l,r-=1}while(s&&r);return{prefixes:Array.from(o),expanded:i,hasChanged:s}}function oe(t,e=["-",":"],r=5){let{expanded:n}=we(t.toString(),e,r);return typeof t=="string"?n:t.length()?t.overwrite(0,t.original.length,n):t}var ae=new Set;function ce(t){ae.has(t)||(console.warn("[unocss]",t),ae.add(t))}var le=/[\\:]?[\s'"`;{}]+/g;function Ae(t){return[...new Set(t.split(le))]}var z={name:"@unocss/core/extractor-split",order:0,extract({code:t}){return Ae(t)}};function ue(){return{events:{},emit(t,...e){(this.events[t]||[]).forEach(r=>r(...e))},on(t,e){return(this.events[t]=this.events[t]||[]).push(e),()=>this.events[t]=(this.events[t]||[]).filter(r=>r!==e)}}}var N="default",W="preflights",Ue="shortcuts",fe={[W]:-100,[Ue]:-10,[N]:0};function de(t){return A(t).flatMap(e=>Array.isArray(e)?[e]:Object.entries(e))}var pe="_uno_resolved";function Me(t){if(pe in t)return t;t={...t},Object.defineProperty(t,pe,{value:!0,enumerable:!1});let e=t.shortcuts?de(t.shortcuts):void 0;if(t.shortcuts=e,t.prefix||t.layer){let r=n=>{n[2]||(n[2]={});let s=n[2];s.prefix==null&&t.prefix&&(s.prefix=A(t.prefix)),s.layer==null&&t.layer&&(s.layer=t.layer)};e?.forEach(r),t.rules?.forEach(r)}return t}function he(t){let e=Me(t);if(!e.presets)return[e];let r=(e.presets||[]).flatMap(A).flatMap(he);return[e,...r]}function J(t={},e={}){let r=Object.assign({},e,t),n=P((r.presets||[]).flatMap(A).flatMap(he)),s=[...n.filter(c=>c.enforce==="pre"),...n.filter(c=>!c.enforce),...n.filter(c=>c.enforce==="post")],i=[...s,r],o=[...i].reverse(),l=Object.assign({},fe,...i.map(c=>c.layers));function f(c){return P(i.flatMap(x=>A(x[c]||[])))}let u=f("extractors"),a=o.find(c=>c.extractorDefault!==void 0)?.extractorDefault;a===void 0&&(a=z),a&&!u.includes(a)&&u.unshift(a),u.sort((c,x)=>(c.order||0)-(x.order||0));let d=f("rules"),y={},C=d.length,v=d.map((c,x)=>{if(te(c)){A(c[2]?.prefix||"").forEach(U=>{y[U+c[0]]=[x,c[1],c[2],c]});return}return[x,...c]}).filter(Boolean).reverse(),w=Ve(i.map(c=>c.theme)),S=f("extendTheme");for(let c of S)w=c(w)||w;let b={templates:P(i.flatMap(c=>A(c.autocomplete?.templates))),extractors:i.flatMap(c=>A(c.autocomplete?.extractors)).sort((c,x)=>(c.order||0)-(x.order||0))},T=f("separators");T.length||(T=[":","-"]);let h={mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:c=>c,...r,presets:s,envMode:r.envMode||"build",shortcutsLayer:r.shortcutsLayer||"shortcuts",layers:l,theme:w,rulesSize:C,rulesDynamic:v,rulesStaticMap:y,preprocess:f("preprocess"),postprocess:f("postprocess"),preflights:f("preflights"),autocomplete:b,variants:f("variants").map(ne).sort((c,x)=>(c.order||0)-(x.order||0)),shortcuts:de(f("shortcuts")).reverse(),extractors:u,safelist:f("safelist"),separators:T};for(let c of i)c?.configResolved?.(h);return h}function Ve(t){return t.map(e=>e?k(e):{}).reduce((e,r)=>Y(e,r),{})}var me="0.53.5";var Q=class{constructor(e={},r={}){this.userConfig=e;this.defaults=r;this.config=J(e,r),this.events.emit("config",this.config)}version=me;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=ue();setConfig(e,r){e&&(r&&(this.defaults=r),this.userConfig=e,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=J(e,this.defaults),this.events.emit("config",this.config))}async applyExtractors(e,r,n=new Set){let s={original:e,code:e,id:r,extracted:n};for(let i of this.config.extractors){let o=await i.extract?.(s);if(o)for(let l of o)n.add(l)}return n}makeContext(e,r){let n={rawSelector:e,currentSelector:r[1],theme:this.config.theme,generator:this,variantHandlers:r[2],constructCSS:(...s)=>this.constructCustomCSS(n,...s),variantMatch:r};return n}async parseToken(e,r){if(this.blocked.has(e))return;let n=`${e}${r?` ${r}`:""}`;if(this._cache.has(n))return this._cache.get(n);let s=e;for(let u of this.config.preprocess)s=u(e);if(this.isBlocked(s)){this.blocked.add(e),this._cache.set(n,null);return}let i=await this.matchVariants(e,s);if(!i||this.isBlocked(i[1])){this.blocked.add(e),this._cache.set(n,null);return}let o=this.makeContext(e,[r||i[0],i[1],i[2],i[3]]);this.config.details&&(o.variants=[...i[3]]);let l=await this.expandShortcut(o.currentSelector,o),f=l?await this.stringifyShortcuts(o.variantMatch,o,l[0],l[1]):(await this.parseUtil(o.variantMatch,o))?.map(u=>this.stringifyUtil(u,o)).filter(se);if(f?.length)return this._cache.set(n,f),f;this._cache.set(n,null)}async generate(e,r={}){let{id:n,scope:s,preflights:i=!0,safelist:o=!0,minify:l=!1}=r,f=E(e)?await this.applyExtractors(e,n):Array.isArray(e)?new Set(e):e;o&&this.config.safelist.forEach(h=>f.add(h));let u=l?"":`
2
- `,a=new Set([N]),d=new Set,y=new Map,C={},v=Array.from(f).map(async h=>{if(d.has(h))return;let c=await this.parseToken(h);if(c!=null){d.add(h);for(let x of c){let R=x[3]||"",U=x[4]?.layer;y.has(R)||y.set(R,[]),y.get(R).push(x),U&&a.add(U)}}});await Promise.all(v),await(async()=>{if(!i)return;let h={generator:this,theme:this.config.theme},c=new Set([]);this.config.preflights.forEach(({layer:x=W})=>{a.add(x),c.add(x)}),C=Object.fromEntries(await Promise.all(Array.from(c).map(async x=>{let U=(await Promise.all(this.config.preflights.filter(_=>(_.layer||W)===x).map(async _=>await _.getCSS(h)))).filter(Boolean).join(u);return[x,U]})))})();let w=this.config.sortLayers(Array.from(a).sort((h,c)=>(this.config.layers[h]??0)-(this.config.layers[c]??0)||h.localeCompare(c))),S={},b=h=>{if(S[h])return S[h];let c=Array.from(y).sort((R,U)=>(this.parentOrders.get(R[0])??0)-(this.parentOrders.get(U[0])??0)||R[0]?.localeCompare(U[0]||"")||0).map(([R,U])=>{let _=U.length,D=U.filter(p=>(p[4]?.layer||N)===h).sort((p,g)=>p[0]-g[0]||(p[4]?.sort||0)-(g[4]?.sort||0)||p[5]?.currentSelector?.localeCompare(g[5]?.currentSelector??"")||p[1]?.localeCompare(g[1]||"")||p[2]?.localeCompare(g[2]||"")||0).map(([,p,g,,M,,V])=>[[[(p&&Oe(p,s))??"",M?.sort??0]],g,!!(V??M?.noMerge)]);if(!D.length)return;let K=D.reverse().map(([p,g,M],V)=>{if(!M&&this.config.mergeSelectors)for(let O=V+1;O<_;O++){let $=D[O];if($&&!$[2]&&(p&&$[0]||p==null&&$[0]==null)&&$[1]===g)return p&&$[0]&&$[0].push(...p),null}let j=p?P(p.sort((O,$)=>O[1]-$[1]||O[0]?.localeCompare($[0]||"")||0).map(O=>O[0]).filter(Boolean)):[];return j.length?`${j.join(`,${u}`)}{${g}}`:g}).filter(Boolean).reverse().join(u);if(!R)return K;let m=R.split(" $$ ");return`${m.join("{")}{${u}${K}${u}}${m.map(p=>"").join("}")}`}).filter(Boolean).join(u);i&&(c=[C[h],c].filter(Boolean).join(u));let x=l?"":`/* layer: ${h} */${u}`;return S[h]=c?x+c:""},T=(h=w,c)=>h.filter(x=>!c?.includes(x)).map(x=>b(x)||"").filter(Boolean).join(u);return{get css(){return T()},layers:w,matched:d,getLayers:T,getLayer:b}}async matchVariants(e,r){let n=new Set,s=[],i=r||e,o=!1,l={rawSelector:e,theme:this.config.theme,generator:this};for(;;){o=!1;for(let f of this.config.variants){if(!f.multiPass&&n.has(f))continue;let u=await f.match(i,l);if(u){E(u)&&(u={matcher:u}),i=u.matcher,s.unshift(u),n.add(f),o=!0;break}}if(!o)break;if(s.length>500)throw new Error(`Too many variants applied to "${e}"`)}return[e,i,s,n]}applyVariants(e,r=e[4],n=e[1]){let i=r.slice().sort((u,a)=>(u.order||0)-(a.order||0)).reduceRight((u,a)=>d=>{let y=a.body?.(d.entries)||d.entries,C=Array.isArray(a.parent)?a.parent:[a.parent,void 0];return(a.handle??De)({...d,entries:y,selector:a.selector?.(d.selector,y)||d.selector,parent:C[0]||d.parent,parentOrder:C[1]||d.parentOrder,layer:a.layer||d.layer,sort:a.sort||d.sort},u)},u=>u)({prefix:"",selector:Pe(n),pseudo:"",entries:e[2]}),{parent:o,parentOrder:l}=i;o!=null&&l!=null&&this.parentOrders.set(o,l);let f={selector:[i.prefix,i.selector,i.pseudo].join(""),entries:i.entries,parent:o,layer:i.layer,sort:i.sort,noMerge:i.noMerge};for(let u of this.config.postprocess)u(f);return f}constructCustomCSS(e,r,n){let s=L(r);if(E(s))return s;let{selector:i,entries:o,parent:l}=this.applyVariants([0,n||e.rawSelector,s,void 0,e.variantHandlers]),f=`${i}{${F(o)}}`;return l?`${l}{${f}}`:f}async parseUtil(e,r,n=!1,s){let[i,o,l]=E(e)?await this.matchVariants(e):e;this.config.details&&(r.rules=r.rules??[]);let f=this.config.rulesStaticMap[o];if(f&&f[1]&&(n||!f[2]?.internal)){this.config.details&&r.rules.push(f[3]);let a=f[0],d=L(f[1]),y=f[2];return E(d)?[[a,d,y]]:[[a,i,d,y,l]]}r.variantHandlers=l;let{rulesDynamic:u}=this.config;for(let[a,d,y,C]of u){if(C?.internal&&!n)continue;let v=o;if(C?.prefix){let T=A(C.prefix);if(s){let h=A(s);if(!T.some(c=>h.includes(c)))continue}else{let h=T.find(c=>o.startsWith(c));if(h==null)continue;v=o.slice(h.length)}}let w=v.match(d);if(!w)continue;let S=await y(w,r);if(!S)continue;this.config.details&&r.rules.push([d,y,C]);let b=ee(S).filter(T=>T.length);if(b.length)return b.map(T=>E(T)?[a,T,C]:[a,i,T,C,l])}}stringifyUtil(e,r){if(!e)return;if(Z(e))return[e[0],void 0,e[1],void 0,e[2],this.config.details?r:void 0,void 0];let{selector:n,entries:s,parent:i,layer:o,sort:l,noMerge:f}=this.applyVariants(e),u=F(s);if(!u)return;let{layer:a,sort:d,...y}=e[3]??{},C={...y,layer:o??a,sort:l??d};return[e[0],n,u,i,C,this.config.details?r:void 0,f]}async expandShortcut(e,r,n=5){if(n===0)return;let s=this.config.details?l=>{r.shortcuts=r.shortcuts??[],r.shortcuts.push(l)}:ie,i,o;for(let l of this.config.shortcuts){let f=e;if(l[2]?.prefix){let a=A(l[2].prefix).find(d=>e.startsWith(d));if(a==null)continue;f=e.slice(a.length)}if(re(l)){if(l[0]===f){i=i||l[2],o=l[1],s(l);break}}else{let u=f.match(l[0]);if(u&&(o=l[1](u,r)),o){i=i||l[2],s(l);break}}}if(E(o)&&(o=oe(o.trim()).split(/\s+/g)),!o){let[l,f]=E(e)?await this.matchVariants(e):e;if(l!==f){let u=await this.expandShortcut(f,r,n-1);u&&(o=u[0].map(a=>E(a)?l.replace(f,a):a))}}if(o)return[(await Promise.all(o.map(async l=>(E(l)?(await this.expandShortcut(l,r,n-1))?.[0]:void 0)||[l]))).flat(1).filter(Boolean),i]}async stringifyShortcuts(e,r,n,s={layer:this.config.shortcutsLayer}){let i=new B,o=(await Promise.all(P(n).map(async a=>{let d=E(a)?await this.parseUtil(a,r,!0,s.prefix):[[Number.POSITIVE_INFINITY,"{inline}",L(a),void 0,[]]];return d||ce(`unmatched utility "${a}" in shortcut "${e[1]}"`),d||[]}))).flat(1).filter(Boolean).sort((a,d)=>a[0]-d[0]),[l,,f]=e,u=[];for(let a of o){if(Z(a)){u.push([a[0],void 0,a[1],void 0,a[2],r,void 0]);continue}let{selector:d,entries:y,parent:C,sort:v,noMerge:w}=this.applyVariants(a,[...a[4],...f],l);i.getFallback(d,C,[[],a[0]])[0].push([y,!!(w??a[3]?.noMerge),v??0])}return u.concat(i.map(([a,d],y,C)=>{let v=(S,b,T)=>{let h=Math.max(...T.map(x=>x[1])),c=T.map(x=>x[0]);return(S?[c.flat(1)]:c).map(x=>{let R=F(x);if(R)return[d,y,R,C,{...s,noMerge:b,sort:h},r,void 0]})};return[[a.filter(([,S])=>S).map(([S,,b])=>[S,b]),!0],[a.filter(([,S])=>!S).map(([S,,b])=>[S,b]),!1]].map(([S,b])=>[...v(!1,b,S.filter(([T])=>T.some(h=>h[0]===q))),...v(!0,b,S.filter(([T])=>T.every(h=>h[0]!==q)))])}).flat(2).filter(Boolean))}isBlocked(e){return!e||this.config.blocklist.some(r=>E(r)?r===e:r.test(e))}};function xe(t,e){return new Q(t,e)}var _e=/\s\$\$\s+/g;function je(t){return t.match(/\s\$\$\s/)}function Oe(t,e){return je(t)?t.replace(_e,e?` ${e} `:" "):e?`${e} ${t}`:t}var ge=/^\[(.+?)(~?=)"(.*)"\]$/;function Pe(t){return ge.test(t)?t.replace(ge,(e,r,n,s)=>`[${H(r)}${n}"${H(s)}"]`):`.${H(t)}`}function De(t,e){return e(t)}function Le(t){return t.replace(/-(\w)/g,(e,r)=>r?r.toUpperCase():"")}function ye(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Se(t){return t.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase()}var Te=["Webkit","Moz","ms"];function Ce(t){let e={};function r(n){let s=e[n];if(s)return s;let i=Le(n);if(i!=="filter"&&i in t)return e[n]=Se(i);i=ye(i);for(let o=0;o<Te.length;o++){let l=`${Te[o]}${i}`;if(l in t)return e[n]=Se(ye(l))}return n}return({entries:n})=>n.forEach(s=>{s[0].startsWith("--")||(s[0]=r(s[0]))})}function be(t){return t.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")}function X(t={}){if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let e=window,r=window.document,n=()=>r.documentElement,s=e.__unocss||{},i=Object.assign({},t,s.runtime),o=i.defaults||{},l=i.cloakAttribute??"un-cloak";i.autoPrefix&&(o.postprocess=A(o.postprocess)).unshift(Ce(r.createElement("div").style)),i.configResolved?.(s,o);let f=xe(s,o),u=new Map,a=!0,d=new Set,y,C,v=[],w=()=>new Promise(m=>{v.push(m),C!=null&&clearTimeout(C),C=setTimeout(()=>T().then(()=>{let p=v;v=[],p.forEach(g=>g())}),0)});function S(m){if(m.nodeType!==1)return;let p=m;p.hasAttribute(l)&&p.removeAttribute(l),p.querySelectorAll(`[${l}]`).forEach(g=>{g.removeAttribute(l)})}function b(m,p){let g=u.get(m);if(!g)if(g=r.createElement("style"),g.setAttribute("data-unocss-runtime-layer",m),u.set(m,g),p==null)n().prepend(g);else{let M=b(p),V=M.parentNode;V?V.insertBefore(g,M.nextSibling):n().prepend(g)}return g}async function T(){let m=await f.generate(d);return m.layers.reduce((p,g)=>(b(g,p).innerHTML=m.getLayer(g)??"",g),void 0),d=m.matched,{...m,getStyleElement:p=>u.get(p),getStyleElements:()=>u}}async function h(m){let p=d.size;await f.applyExtractors(m,void 0,d),p!==d.size&&await w()}async function c(){let m=r.body,p=m&&m.outerHTML;p&&(await h(`${p} ${be(p)}`),S(n()),S(m))}let x=new MutationObserver(m=>{a||m.forEach(async p=>{if(p.target.nodeType!==1)return;let g=p.target;for(let M of u)if(g===M[1])return;if(p.type==="childList")p.addedNodes.forEach(async M=>{if(M.nodeType!==1)return;let V=M;y&&!y(V)||(await h(V.outerHTML),S(V))});else{if(y&&!y(g))return;if(p.attributeName!==l){let M=Array.from(g.attributes).map(j=>j.value?`${j.name}="${j.value}"`:j.name).join(" "),V=`<${g.tagName.toLowerCase()} ${M}>`;await h(V)}g.hasAttribute(l)&&g.removeAttribute(l)}})}),R=!1;function U(){if(R)return;let m=n()||r.body;m&&(x.observe(m,{childList:!0,subtree:!0,attributes:!0}),R=!0)}function _(){i.bypassDefined&&ke(f.blocked),c(),U()}function D(){r.readyState==="loading"?e.addEventListener("DOMContentLoaded",_):_()}let K=e.__unocss_runtime=e.__unocss_runtime={version:f.version,uno:f,async extract(m){E(m)||(m.forEach(p=>d.add(p)),m=""),await h(m)},extractAll:c,inspect(m){y=m},toggleObserver(m){m===void 0?a=!a:a=!!m,!R&&!a&&D()},update:T};i.ready?.(K)!==!1&&(a=!1,D())}function ke(t=new Set){for(let e=0;e<document.styleSheets.length;e++){let r=document.styleSheets[e],n;try{if(n=r.cssRules||r.rules,!n)continue;Array.from(n).flatMap(s=>s.selectorText?.split(/,/g)||[]).forEach(s=>{s&&(s=s.trim(),s.startsWith(".")&&(s=s.slice(1)),t.add(s))})}catch{continue}}return t}X();})();
1
+ "use strict";(()=>{function Vt(i){let t=i.length,e=-1,n,r="",s=i.charCodeAt(0);for(;++e<t;){if(n=i.charCodeAt(e),n===0){r+="\uFFFD";continue}if(n===44){r+="\\,";continue}if(n>=1&&n<=31||n===127||e===0&&n>=48&&n<=57||e===1&&n>=48&&n<=57&&s===45){r+=`\\${n.toString(16)} `;continue}if(e===0&&t===1&&n===45){r+=`\\${i.charAt(e)}`;continue}if(n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122){r+=i.charAt(e);continue}r+=`\\${i.charAt(e)}`}return r}var G=Vt;function A(i=[]){return Array.isArray(i)?i:[i]}function j(i){return Array.from(new Set(i))}function E(i){return typeof i=="string"}function P(i){return E(i)?i:(Array.isArray(i)?i:Object.entries(i)).filter(t=>t[1]!=null)}function ct(i){return Array.isArray(i)?i.find(t=>!Array.isArray(t)||Array.isArray(t[0]))?i.map(t=>P(t)):[i]:[P(i)]}function Pt(i){return i.filter(([t,e],n)=>{if(t.startsWith("$$"))return!1;for(let r=n-1;r>=0;r--)if(i[r][0]===t&&i[r][1]===e)return!1;return!0})}function F(i){return i==null?"":Pt(i).map(([t,e])=>e!=null?`${t}:${e};`:void 0).filter(Boolean).join("")}function K(i){return i&&typeof i=="object"&&!Array.isArray(i)}function tt(i,t,e=!1){let n=i,r=t;if(Array.isArray(r))return e&&Array.isArray(r)?[...n,...r]:[...r];let s={...n};return K(n)&&K(r)&&Object.keys(r).forEach(o=>{K(n[o])&&K(r[o])||Array.isArray(n[o])&&Array.isArray(r[o])?s[o]=tt(n[o],r[o],e):Object.assign(s,{[o]:r[o]})}),s}function I(i){let t,e,n;if(Array.isArray(i)){for(e=Array(t=i.length);t--;)e[t]=(n=i[t])&&typeof n=="object"?I(n):n;return e}if(Object.prototype.toString.call(i)==="[object Object]"){e={};for(t in i)t==="__proto__"?Object.defineProperty(e,t,{value:I(i[t]),configurable:!0,enumerable:!0,writable:!0}):e[t]=(n=i[t])&&typeof n=="object"?I(n):n;return e}return i}function ut(i){return E(i[0])}function ht(i){return E(i[0])}var et="$$shortcut-no-merge";function ft(i){return typeof i=="function"?{match:i}:i}function nt(i){return i.length===3}function dt(i){return i!=null}function gt(){}var q=class{_map=new Map;get(t,e){let n=this._map.get(t);if(n)return n.get(e)}getFallback(t,e,n){let r=this._map.get(t);return r||(r=new Map,this._map.set(t,r)),r.has(e)||r.set(e,n),r.get(e)}set(t,e,n){let r=this._map.get(t);return r||(r=new Map,this._map.set(t,r)),r.set(e,n),this}has(t,e){return this._map.get(t)?.has(e)}delete(t,e){return this._map.get(t)?.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(([r,s])=>t(s,e,r)))}};var Dt=",".charCodeAt(0),It=";".charCodeAt(0),pt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mt=new Uint8Array(64),Nt=new Uint8Array(128);for(let i=0;i<pt.length;i++){let t=pt.charCodeAt(i);mt[i]=t,Nt[t]=i}var rt=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(i){return Buffer.from(i.buffer,i.byteOffset,i.byteLength).toString()}}:{decode(i){let t="";for(let e=0;e<i.length;e++)t+=String.fromCharCode(i[e]);return t}};function xt(i){let t=new Int32Array(5),e=1024*16,n=e-36,r=new Uint8Array(e),s=r.subarray(0,n),o=0,a="";for(let l=0;l<i.length;l++){let c=i[l];if(l>0&&(o===e&&(a+=rt.decode(r),o=0),r[o++]=It),c.length!==0){t[0]=0;for(let u=0;u<c.length;u++){let f=c[u];o>n&&(a+=rt.decode(s),r.copyWithin(0,n,o),o-=n),u>0&&(r[o++]=Dt),o=N(r,o,t,f,0),f.length!==1&&(o=N(r,o,t,f,1),o=N(r,o,t,f,2),o=N(r,o,t,f,3),f.length!==4&&(o=N(r,o,t,f,4)))}}}return a+rt.decode(r.subarray(0,o))}function N(i,t,e,n,r){let s=n[r],o=s-e[r];e[r]=s,o=o<0?-o<<1|1:o<<1;do{let a=o&31;o>>>=5,o>0&&(a|=32),i[t++]=mt[a]}while(o>0);return t}var z=class i{constructor(t){this.bits=t instanceof i?t.bits.slice():[]}add(t){this.bits[t>>5]|=1<<(t&31)}has(t){return!!(this.bits[t>>5]&1<<(t&31))}},W=class i{constructor(t,e,n){this.start=t,this.end=e,this.original=n,this.intro="",this.outro="",this.content=n,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(t){this.outro+=t}appendRight(t){this.intro=this.intro+t}clone(){let t=new i(this.start,this.end,this.original);return t.intro=this.intro,t.outro=this.outro,t.content=this.content,t.storeName=this.storeName,t.edited=this.edited,t}contains(t){return this.start<t&&t<this.end}eachNext(t){let e=this;for(;e;)t(e),e=e.next}eachPrevious(t){let e=this;for(;e;)t(e),e=e.previous}edit(t,e,n){return this.content=t,n||(this.intro="",this.outro=""),this.storeName=e,this.edited=!0,this}prependLeft(t){this.outro=t+this.outro}prependRight(t){this.intro=t+this.intro}split(t){let e=t-this.start,n=this.original.slice(0,e),r=this.original.slice(e);this.original=n;let s=new i(t,this.end,r);return s.outro=this.outro,this.outro="",this.end=t,this.edited?(s.edit("",!1),this.content=""):this.content=n,s.next=this.next,s.next&&(s.next.previous=s),s.previous=this,this.next=s,s}toString(){return this.intro+this.content+this.outro}trimEnd(t){if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;let e=this.content.replace(t,"");if(e.length)return e!==this.content&&this.split(this.start+e.length).edit("",void 0,!0),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(t,""),this.intro.length)return!0}trimStart(t){if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;let e=this.content.replace(t,"");if(e.length)return e!==this.content&&(this.split(this.end-e.length),this.edit("",void 0,!0)),!0;if(this.edit("",void 0,!0),this.outro=this.outro.replace(t,""),this.outro.length)return!0}};function Ht(){return typeof window<"u"&&typeof window.btoa=="function"?i=>window.btoa(unescape(encodeURIComponent(i))):typeof Buffer=="function"?i=>Buffer.from(i,"utf-8").toString("base64"):()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}var Bt=Ht(),it=class{constructor(t){this.version=3,this.file=t.file,this.sources=t.sources,this.sourcesContent=t.sourcesContent,this.names=t.names,this.mappings=xt(t.mappings),typeof t.x_google_ignoreList<"u"&&(this.x_google_ignoreList=t.x_google_ignoreList)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+Bt(this.toString())}};function Gt(i){let t=i.split(`
2
+ `),e=t.filter(s=>/^\t+/.test(s)),n=t.filter(s=>/^ {2,}/.test(s));if(e.length===0&&n.length===0)return null;if(e.length>=n.length)return" ";let r=n.reduce((s,o)=>{let a=/^ +/.exec(o)[0].length;return Math.min(a,s)},1/0);return new Array(r+1).join(" ")}function Kt(i,t){let e=i.split(/[/\\]/),n=t.split(/[/\\]/);for(e.pop();e[0]===n[0];)e.shift(),n.shift();if(e.length){let r=e.length;for(;r--;)e[r]=".."}return e.concat(n).join("/")}var Ft=Object.prototype.toString;function qt(i){return Ft.call(i)==="[object Object]"}function yt(i){let t=i.split(`
3
+ `),e=[];for(let n=0,r=0;n<t.length;n++)e.push(r),r+=t[n].length+1;return function(r){let s=0,o=e.length;for(;s<o;){let c=s+o>>1;r<e[c]?o=c:s=c+1}let a=s-1,l=r-e[a];return{line:a,column:l}}}var st=class{constructor(t){this.hires=t,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(t,e,n,r){if(e.length){let s=[this.generatedCodeColumn,t,n.line,n.column];r>=0&&s.push(r),this.rawSegments.push(s)}else this.pending&&this.rawSegments.push(this.pending);this.advance(e),this.pending=null}addUneditedChunk(t,e,n,r,s){let o=e.start,a=!0;for(;o<e.end;)(this.hires||a||s.has(o))&&this.rawSegments.push([this.generatedCodeColumn,t,r.line,r.column]),n[o]===`
4
+ `?(r.line+=1,r.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,a=!0):(r.column+=1,this.generatedCodeColumn+=1,a=!1),o+=1;this.pending=null}advance(t){if(!t)return;let e=t.split(`
5
+ `);if(e.length>1){for(let n=0;n<e.length-1;n++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=e[e.length-1].length}},H=`
6
+ `,D={insertLeft:!1,insertRight:!1,storeName:!1},Y=class i{constructor(t,e={}){let n=new W(0,t.length,t);Object.defineProperties(this,{original:{writable:!0,value:t},outro:{writable:!0,value:""},intro:{writable:!0,value:""},firstChunk:{writable:!0,value:n},lastChunk:{writable:!0,value:n},lastSearchedChunk:{writable:!0,value:n},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:e.filename},indentExclusionRanges:{writable:!0,value:e.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new z},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:e.ignoreList}}),this.byStart[0]=n,this.byEnd[t.length]=n}addSourcemapLocation(t){this.sourcemapLocations.add(t)}append(t){if(typeof t!="string")throw new TypeError("outro content must be a string");return this.outro+=t,this}appendLeft(t,e){if(typeof e!="string")throw new TypeError("inserted content must be a string");this._split(t);let n=this.byEnd[t];return n?n.appendLeft(e):this.intro+=e,this}appendRight(t,e){if(typeof e!="string")throw new TypeError("inserted content must be a string");this._split(t);let n=this.byStart[t];return n?n.appendRight(e):this.outro+=e,this}clone(){let t=new i(this.original,{filename:this.filename}),e=this.firstChunk,n=t.firstChunk=t.lastSearchedChunk=e.clone();for(;e;){t.byStart[n.start]=n,t.byEnd[n.end]=n;let r=e.next,s=r&&r.clone();s&&(n.next=s,s.previous=n,n=s),e=r}return t.lastChunk=n,this.indentExclusionRanges&&(t.indentExclusionRanges=this.indentExclusionRanges.slice()),t.sourcemapLocations=new z(this.sourcemapLocations),t.intro=this.intro,t.outro=this.outro,t}generateDecodedMap(t){t=t||{};let e=0,n=Object.keys(this.storedNames),r=new st(t.hires),s=yt(this.original);return this.intro&&r.advance(this.intro),this.firstChunk.eachNext(o=>{let a=s(o.start);o.intro.length&&r.advance(o.intro),o.edited?r.addEdit(e,o.content,a,o.storeName?n.indexOf(o.original):-1):r.addUneditedChunk(e,o,this.original,a,this.sourcemapLocations),o.outro.length&&r.advance(o.outro)}),{file:t.file?t.file.split(/[/\\]/).pop():void 0,sources:[t.source?Kt(t.file||"",t.source):t.file||""],sourcesContent:t.includeContent?[this.original]:void 0,names:n,mappings:r.raw,x_google_ignoreList:this.ignoreList?[e]:void 0}}generateMap(t){return new it(this.generateDecodedMap(t))}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=Gt(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?" ":this.indentStr}indent(t,e){let n=/^[^\r\n]/gm;if(qt(t)&&(e=t,t=void 0),t===void 0&&(this._ensureindentStr(),t=this.indentStr||" "),t==="")return this;e=e||{};let r={};e.exclude&&(typeof e.exclude[0]=="number"?[e.exclude]:e.exclude).forEach(u=>{for(let f=u[0];f<u[1];f+=1)r[f]=!0});let s=e.indentStart!==!1,o=c=>s?`${t}${c}`:(s=!0,c);this.intro=this.intro.replace(n,o);let a=0,l=this.firstChunk;for(;l;){let c=l.end;if(l.edited)r[a]||(l.content=l.content.replace(n,o),l.content.length&&(s=l.content[l.content.length-1]===`
7
+ `));else for(a=l.start;a<c;){if(!r[a]){let u=this.original[a];u===`
8
+ `?s=!0:u!=="\r"&&s&&(s=!1,a===l.start||(this._splitChunk(l,a),l=l.next),l.prependRight(t))}a+=1}a=l.end,l=l.next}return this.outro=this.outro.replace(n,o),this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(t,e){return D.insertLeft||(console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),D.insertLeft=!0),this.appendLeft(t,e)}insertRight(t,e){return D.insertRight||(console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),D.insertRight=!0),this.prependRight(t,e)}move(t,e,n){if(n>=t&&n<=e)throw new Error("Cannot move a selection inside itself");this._split(t),this._split(e),this._split(n);let r=this.byStart[t],s=this.byEnd[e],o=r.previous,a=s.next,l=this.byStart[n];if(!l&&s===this.lastChunk)return this;let c=l?l.previous:this.lastChunk;return o&&(o.next=a),a&&(a.previous=o),c&&(c.next=r),l&&(l.previous=s),r.previous||(this.firstChunk=s.next),s.next||(this.lastChunk=r.previous,this.lastChunk.next=null),r.previous=c,s.next=l||null,c||(this.firstChunk=r),l||(this.lastChunk=s),this}overwrite(t,e,n,r){return r=r||{},this.update(t,e,n,{...r,overwrite:!r.contentOnly})}update(t,e,n,r){if(typeof n!="string")throw new TypeError("replacement content must be a string");for(;t<0;)t+=this.original.length;for(;e<0;)e+=this.original.length;if(e>this.original.length)throw new Error("end is out of bounds");if(t===e)throw new Error("Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead");this._split(t),this._split(e),r===!0&&(D.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),D.storeName=!0),r={storeName:!0});let s=r!==void 0?r.storeName:!1,o=r!==void 0?r.overwrite:!1;if(s){let c=this.original.slice(t,e);Object.defineProperty(this.storedNames,c,{writable:!0,value:!0,enumerable:!0})}let a=this.byStart[t],l=this.byEnd[e];if(a){let c=a;for(;c!==l;){if(c.next!==this.byStart[c.end])throw new Error("Cannot overwrite across a split point");c=c.next,c.edit("",!1)}a.edit(n,s,!o)}else{let c=new W(t,e,"").edit(n,s);l.next=c,c.previous=l}return this}prepend(t){if(typeof t!="string")throw new TypeError("outro content must be a string");return this.intro=t+this.intro,this}prependLeft(t,e){if(typeof e!="string")throw new TypeError("inserted content must be a string");this._split(t);let n=this.byEnd[t];return n?n.prependLeft(e):this.intro=e+this.intro,this}prependRight(t,e){if(typeof e!="string")throw new TypeError("inserted content must be a string");this._split(t);let n=this.byStart[t];return n?n.prependRight(e):this.outro=e+this.outro,this}remove(t,e){for(;t<0;)t+=this.original.length;for(;e<0;)e+=this.original.length;if(t===e)return this;if(t<0||e>this.original.length)throw new Error("Character is out of bounds");if(t>e)throw new Error("end must be greater than start");this._split(t),this._split(e);let n=this.byStart[t];for(;n;)n.intro="",n.outro="",n.edit(""),n=e>n.end?this.byStart[n.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let t=this.lastChunk;do{if(t.outro.length)return t.outro[t.outro.length-1];if(t.content.length)return t.content[t.content.length-1];if(t.intro.length)return t.intro[t.intro.length-1]}while(t=t.previous);return this.intro.length?this.intro[this.intro.length-1]:""}lastLine(){let t=this.outro.lastIndexOf(H);if(t!==-1)return this.outro.substr(t+1);let e=this.outro,n=this.lastChunk;do{if(n.outro.length>0){if(t=n.outro.lastIndexOf(H),t!==-1)return n.outro.substr(t+1)+e;e=n.outro+e}if(n.content.length>0){if(t=n.content.lastIndexOf(H),t!==-1)return n.content.substr(t+1)+e;e=n.content+e}if(n.intro.length>0){if(t=n.intro.lastIndexOf(H),t!==-1)return n.intro.substr(t+1)+e;e=n.intro+e}}while(n=n.previous);return t=this.intro.lastIndexOf(H),t!==-1?this.intro.substr(t+1)+e:this.intro+e}slice(t=0,e=this.original.length){for(;t<0;)t+=this.original.length;for(;e<0;)e+=this.original.length;let n="",r=this.firstChunk;for(;r&&(r.start>t||r.end<=t);){if(r.start<e&&r.end>=e)return n;r=r.next}if(r&&r.edited&&r.start!==t)throw new Error(`Cannot use replaced character ${t} as slice start anchor.`);let s=r;for(;r;){r.intro&&(s!==r||r.start===t)&&(n+=r.intro);let o=r.start<e&&r.end>=e;if(o&&r.edited&&r.end!==e)throw new Error(`Cannot use replaced character ${e} as slice end anchor.`);let a=s===r?t-r.start:0,l=o?r.content.length+e-r.end:r.content.length;if(n+=r.content.slice(a,l),r.outro&&(!o||r.end===e)&&(n+=r.outro),o)break;r=r.next}return n}snip(t,e){let n=this.clone();return n.remove(0,t),n.remove(e,n.original.length),n}_split(t){if(this.byStart[t]||this.byEnd[t])return;let e=this.lastSearchedChunk,n=t>e.end;for(;e;){if(e.contains(t))return this._splitChunk(e,t);e=n?this.byStart[e.end]:this.byEnd[e.start]}}_splitChunk(t,e){if(t.edited&&t.content.length){let r=yt(this.original)(e);throw new Error(`Cannot split a chunk that has already been edited (${r.line}:${r.column} \u2013 "${t.original}")`)}let n=t.split(e);return this.byEnd[e]=t,this.byStart[e]=n,this.byEnd[n.end]=n,t===this.lastChunk&&(this.lastChunk=n),this.lastSearchedChunk=t,!0}toString(){let t=this.intro,e=this.firstChunk;for(;e;)t+=e.toString(),e=e.next;return t+this.outro}isEmpty(){let t=this.firstChunk;do if(t.intro.length&&t.intro.trim()||t.content.length&&t.content.trim()||t.outro.length&&t.outro.trim())return!1;while(t=t.next);return!0}length(){let t=this.firstChunk,e=0;do e+=t.intro.length+t.content.length+t.outro.length;while(t=t.next);return e}trimLines(){return this.trim("[\\r\\n]")}trim(t){return this.trimStart(t).trimEnd(t)}trimEndAborted(t){let e=new RegExp((t||"\\s")+"+$");if(this.outro=this.outro.replace(e,""),this.outro.length)return!0;let n=this.lastChunk;do{let r=n.end,s=n.trimEnd(e);if(n.end!==r&&(this.lastChunk===n&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),s)return!0;n=n.previous}while(n);return!1}trimEnd(t){return this.trimEndAborted(t),this}trimStartAborted(t){let e=new RegExp("^"+(t||"\\s")+"+");if(this.intro=this.intro.replace(e,""),this.intro.length)return!0;let n=this.firstChunk;do{let r=n.end,s=n.trimStart(e);if(n.end!==r&&(n===this.lastChunk&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),s)return!0;n=n.next}while(n);return!1}trimStart(t){return this.trimStartAborted(t),this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(t,e){function n(s,o){return typeof e=="string"?e.replace(/\$(\$|&|\d+)/g,(a,l)=>l==="$"?"$":l==="&"?s[0]:+l<s.length?s[+l]:`$${l}`):e(...s,s.index,o,s.groups)}function r(s,o){let a,l=[];for(;a=s.exec(o);)l.push(a);return l}if(t.global)r(t,this.original).forEach(o=>{o.index!=null&&this.overwrite(o.index,o.index+o[0].length,n(o,this.original))});else{let s=this.original.match(t);s&&s.index!=null&&this.overwrite(s.index,s.index+s[0].length,n(s,this.original))}return this}_replaceString(t,e){let{original:n}=this,r=n.indexOf(t);return r!==-1&&this.overwrite(r,r+t.length,e),this}replace(t,e){return typeof t=="string"?this._replaceString(t,e):this._replaceRegexp(t,e)}_replaceAllString(t,e){let{original:n}=this,r=t.length;for(let s=n.indexOf(t);s!==-1;s=n.indexOf(t,s+r))this.overwrite(s,s+r,e);return this}replaceAll(t,e){if(typeof t=="string")return this._replaceAllString(t,e);if(!t.global)throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");return this._replaceRegexp(t,e)}};var J={};function zt(i=["-",":"]){let t=i.join("|");return J[t]||(J[t]=new RegExp(`((?:[!@<~\\w+:_/-]|\\[&?>?:?\\S*\\])+?)(${t})\\(((?:[~!<>\\w\\s:/\\\\,%#.$?-]|\\[.*?\\])+?)\\)(?!\\s*?=>)`,"gm")),J[t].lastIndex=0,J[t]}function Wt(i,t=["-",":"],e=5){let n=zt(t),r,s=i.toString(),o=new Set,a=new Map;do r=!1,s=s.replace(n,(c,u,f,y,w)=>{if(!t.includes(f))return c;r=!0,o.add(u+f);let T=w+u.length+f.length+1,v={length:c.length,items:[]};a.set(w,v);for(let S of[...y.matchAll(/\S+/g)]){let C=T+S.index,b=a.get(C)?.items;b?a.delete(C):b=[{offset:C,length:S[0].length,className:S[0]}];for(let g of b)g.className=g.className==="~"?u:g.className.replace(/^(!?)(.*)/,`$1${u}${f}$2`),v.items.push(g)}return"$".repeat(c.length)}),e-=1;while(r&&e);let l=typeof i=="string"?new Y(i):i;for(let[c,u]of a)l.overwrite(c,c+u.length,u.items.map(f=>f.className).join(" "));return{prefixes:Array.from(o),hasChanged:r,groupsByOffset:a,get expanded(){return l.toString()}}}function St(i,t=["-",":"],e=5){let n=Wt(i,t,e);return typeof i=="string"?n.expanded:i}var bt=new Set;function wt(i){bt.has(i)||(console.warn("[unocss]",i),bt.add(i))}var Ct=/[\\:]?[\s'"`;{}]+/g;function Yt(i){return[...new Set(i.split(Ct))]}var Z={name:"@unocss/core/extractor-split",order:0,extract({code:i}){return Yt(i)}};function Et(){return{events:{},emit(i,...t){(this.events[i]||[]).forEach(e=>e(...t))},on(i,t){return(this.events[i]=this.events[i]||[]).push(t),()=>this.events[i]=(this.events[i]||[]).filter(e=>e!==t)}}}var Q="default",X="preflights",Jt="shortcuts",vt={[X]:-100,[Jt]:-10,[Q]:0};function Tt(i){return A(i).flatMap(t=>Array.isArray(t)?[t]:Object.entries(t))}var Rt="_uno_resolved";function Zt(i){if(Rt in i)return i;i={...i},Object.defineProperty(i,Rt,{value:!0,enumerable:!1});let t=i.shortcuts?Tt(i.shortcuts):void 0;if(i.shortcuts=t,i.prefix||i.layer){let e=n=>{n[2]||(n[2]={});let r=n[2];r.prefix==null&&i.prefix&&(r.prefix=A(i.prefix)),r.layer==null&&i.layer&&(r.layer=i.layer)};t?.forEach(e),i.rules?.forEach(e)}return i}function At(i){let t=Zt(i);if(!t.presets)return[t];let e=(t.presets||[]).flatMap(A).flatMap(At);return[t,...e]}function ot(i={},t={}){let e=Object.assign({},t,i),n=j((e.presets||[]).flatMap(A).flatMap(At)),r=[...n.filter(h=>h.enforce==="pre"),...n.filter(h=>!h.enforce),...n.filter(h=>h.enforce==="post")],s=[...r,e],o=[...s].reverse(),a=Object.assign({},vt,...s.map(h=>h.layers));function l(h){return j(s.flatMap(x=>A(x[h]||[])))}let c=l("extractors"),u=o.find(h=>h.extractorDefault!==void 0)?.extractorDefault;u===void 0&&(u=Z),u&&!c.includes(u)&&c.unshift(u),c.sort((h,x)=>(h.order||0)-(x.order||0));let f=l("rules"),y={},w=f.length,T=f.map((h,x)=>{if(ut(h)){A(h[2]?.prefix||"").forEach(_=>{y[_+h[0]]=[x,h[1],h[2],h]});return}return[x,...h]}).filter(Boolean).reverse(),v=Qt(s.map(h=>h.theme)),S=l("extendTheme");for(let h of S)v=h(v)||v;let C={templates:j(s.flatMap(h=>A(h.autocomplete?.templates))),extractors:s.flatMap(h=>A(h.autocomplete?.extractors)).sort((h,x)=>(h.order||0)-(x.order||0))},b=l("separators");b.length||(b=[":","-"]);let g={mergeSelectors:!0,warn:!0,blocklist:[],sortLayers:h=>h,...e,presets:r,envMode:e.envMode||"build",shortcutsLayer:e.shortcutsLayer||"shortcuts",layers:a,theme:v,rulesSize:w,rulesDynamic:T,rulesStaticMap:y,preprocess:l("preprocess"),postprocess:l("postprocess"),preflights:l("preflights"),autocomplete:C,variants:l("variants").map(ft).sort((h,x)=>(h.order||0)-(x.order||0)),shortcuts:Tt(l("shortcuts")).reverse(),extractors:c,safelist:l("safelist"),separators:b};for(let h of s)h?.configResolved?.(g);return g}function Qt(i){return i.map(t=>t?I(t):{}).reduce((t,e)=>tt(t,e),{})}var _t="0.54.0";var at=class{constructor(t={},e={}){this.userConfig=t;this.defaults=e;this.config=ot(t,e),this.events.emit("config",this.config)}version=_t;_cache=new Map;config;blocked=new Set;parentOrders=new Map;events=Et();setConfig(t,e){t&&(e&&(this.defaults=e),this.userConfig=t,this.blocked.clear(),this.parentOrders.clear(),this._cache.clear(),this.config=ot(t,this.defaults),this.events.emit("config",this.config))}async applyExtractors(t,e,n=new Set){let r={original:t,code:t,id:e,extracted:n};for(let s of this.config.extractors){let o=await s.extract?.(r);if(o)for(let a of o)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:(...r)=>this.constructCustomCSS(n,...r),variantMatch:e};return n}async parseToken(t,e){if(this.blocked.has(t))return;let n=`${t}${e?` ${e}`:""}`;if(this._cache.has(n))return this._cache.get(n);let r=t;for(let c of this.config.preprocess)r=c(t);if(this.isBlocked(r)){this.blocked.add(t),this._cache.set(n,null);return}let s=await this.matchVariants(t,r);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]]);this.config.details&&(o.variants=[...s[3]]);let a=await this.expandShortcut(o.currentSelector,o),l=a?await this.stringifyShortcuts(o.variantMatch,o,a[0],a[1]):(await this.parseUtil(o.variantMatch,o))?.map(c=>this.stringifyUtil(c,o)).filter(dt);if(l?.length)return this._cache.set(n,l),l;this._cache.set(n,null)}async generate(t,e={}){let{id:n,scope:r,preflights:s=!0,safelist:o=!0,minify:a=!1}=e,l=E(t)?await this.applyExtractors(t,n):Array.isArray(t)?new Set(t):t;o&&this.config.safelist.forEach(g=>l.add(g));let c=a?"":`
9
+ `,u=new Set([Q]),f=new Set,y=new Map,w={},T=Array.from(l).map(async g=>{if(f.has(g))return;let h=await this.parseToken(g);if(h!=null){f.add(g);for(let x of h){let R=x[3]||"",_=x[4]?.layer;y.has(R)||y.set(R,[]),y.get(R).push(x),_&&u.add(_)}}});await Promise.all(T),await(async()=>{if(!s)return;let g={generator:this,theme:this.config.theme},h=new Set([]);this.config.preflights.forEach(({layer:x=X})=>{u.add(x),h.add(x)}),w=Object.fromEntries(await Promise.all(Array.from(h).map(async x=>{let _=(await Promise.all(this.config.preflights.filter(k=>(k.layer||X)===x).map(async k=>await k.getCSS(g)))).filter(Boolean).join(c);return[x,_]})))})();let v=this.config.sortLayers(Array.from(u).sort((g,h)=>(this.config.layers[g]??0)-(this.config.layers[h]??0)||g.localeCompare(h))),S={},C=g=>{if(S[g])return S[g];let h=Array.from(y).sort((R,_)=>(this.parentOrders.get(R[0])??0)-(this.parentOrders.get(_[0])??0)||R[0]?.localeCompare(_[0]||"")||0).map(([R,_])=>{let k=_.length,V=_.filter(d=>(d[4]?.layer||Q)===g).sort((d,m)=>d[0]-m[0]||(d[4]?.sort||0)-(m[4]?.sort||0)||d[5]?.currentSelector?.localeCompare(m[5]?.currentSelector??"")||d[1]?.localeCompare(m[1]||"")||d[2]?.localeCompare(m[2]||"")||0).map(([,d,m,,L,,U])=>[[[(d&&ne(d,r))??"",L?.sort??0]],m,!!(U??L?.noMerge)]);if(!V.length)return;let B=V.reverse().map(([d,m,L],U)=>{if(!L&&this.config.mergeSelectors)for(let $=U+1;$<k;$++){let O=V[$];if(O&&!O[2]&&(d&&O[0]||d==null&&O[0]==null)&&O[1]===m)return d&&O[0]&&O[0].push(...d),null}let M=d?j(d.sort(($,O)=>$[1]-O[1]||$[0]?.localeCompare(O[0]||"")||0).map($=>$[0]).filter(Boolean)):[];return M.length?`${M.join(`,${c}`)}{${m}}`:m}).filter(Boolean).reverse().join(c);if(!R)return B;let p=R.split(" $$ ");return`${p.join("{")}{${c}${B}${c}}${p.map(d=>"").join("}")}`}).filter(Boolean).join(c);s&&(h=[w[g],h].filter(Boolean).join(c));let x=a?"":`/* layer: ${g} */${c}`;return S[g]=h?x+h:""},b=(g=v,h)=>g.filter(x=>!h?.includes(x)).map(x=>C(x)||"").filter(Boolean).join(c);return{get css(){return b()},layers:v,matched:f,getLayers:b,getLayer:C}}async matchVariants(t,e){let n=new Set,r=[],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 c=await l.match(s,a);if(c){if(E(c)){if(c===s)continue;c={matcher:c}}s=c.matcher,r.unshift(c),n.add(l),o=!0;break}}if(!o)break;if(r.length>500)throw new Error(`Too many variants applied to "${t}"`)}return[t,s,r,n]}applyVariants(t,e=t[4],n=t[1]){let s=e.slice().sort((c,u)=>(c.order||0)-(u.order||0)).reduceRight((c,u)=>f=>{let y=u.body?.(f.entries)||f.entries,w=Array.isArray(u.parent)?u.parent:[u.parent,void 0];return(u.handle??ie)({...f,entries:y,selector:u.selector?.(f.selector,y)||f.selector,parent:w[0]||f.parent,parentOrder:w[1]||f.parentOrder,layer:u.layer||f.layer,sort:u.sort||f.sort},c)},c=>c)({prefix:"",selector:re(n),pseudo:"",entries:t[2]}),{parent:o,parentOrder:a}=s;o!=null&&a!=null&&this.parentOrders.set(o,a);let l={selector:[s.prefix,s.selector,s.pseudo].join(""),entries:s.entries,parent:o,layer:s.layer,sort:s.sort,noMerge:s.noMerge};for(let c of this.config.postprocess)c(l);return l}constructCustomCSS(t,e,n){let r=P(e);if(E(r))return r;let{selector:s,entries:o,parent:a}=this.applyVariants([0,n||t.rawSelector,r,void 0,t.variantHandlers]),l=`${s}{${F(o)}}`;return a?`${a}{${l}}`:l}async parseUtil(t,e,n=!1,r){let[s,o,a]=E(t)?await this.matchVariants(t):t;this.config.details&&(e.rules=e.rules??[]);let l=this.config.rulesStaticMap[o];if(l&&l[1]&&(n||!l[2]?.internal)){this.config.details&&e.rules.push(l[3]);let u=l[0],f=P(l[1]),y=l[2];return E(f)?[[u,f,y]]:[[u,s,f,y,a]]}e.variantHandlers=a;let{rulesDynamic:c}=this.config;for(let[u,f,y,w]of c){if(w?.internal&&!n)continue;let T=o;if(w?.prefix){let b=A(w.prefix);if(r){let g=A(r);if(!b.some(h=>g.includes(h)))continue}else{let g=b.find(h=>o.startsWith(h));if(g==null)continue;T=o.slice(g.length)}}let v=T.match(f);if(!v)continue;let S=await y(v,e);if(!S)continue;this.config.details&&e.rules.push([f,y,w]);let C=ct(S).filter(b=>b.length);if(C.length)return C.map(b=>E(b)?[u,b,w]:[u,s,b,w,a])}}stringifyUtil(t,e){if(!t)return;if(nt(t))return[t[0],void 0,t[1],void 0,t[2],this.config.details?e:void 0,void 0];let{selector:n,entries:r,parent:s,layer:o,sort:a,noMerge:l}=this.applyVariants(t),c=F(r);if(!c)return;let{layer:u,sort:f,...y}=t[3]??{},w={...y,layer:o??u,sort:a??f};return[t[0],n,c,s,w,this.config.details?e:void 0,l]}async expandShortcut(t,e,n=5){if(n===0)return;let r=this.config.details?a=>{e.shortcuts=e.shortcuts??[],e.shortcuts.push(a)}:gt,s,o;for(let a of this.config.shortcuts){let l=t;if(a[2]?.prefix){let u=A(a[2].prefix).find(f=>t.startsWith(f));if(u==null)continue;l=t.slice(u.length)}if(ht(a)){if(a[0]===l){s=s||a[2],o=a[1],r(a);break}}else{let c=l.match(a[0]);if(c&&(o=a[1](c,e)),o){s=s||a[2],r(a);break}}}if(E(o)&&(o=St(o.trim()).split(/\s+/g)),!o){let[a,l]=E(t)?await this.matchVariants(t):t;if(a!==l){let c=await this.expandShortcut(l,e,n-1);c&&(o=c[0].map(u=>E(u)?a.replace(l,u):u))}}if(o)return[(await Promise.all(o.map(async a=>(E(a)?(await this.expandShortcut(a,e,n-1))?.[0]:void 0)||[a]))).flat(1).filter(Boolean),s]}async stringifyShortcuts(t,e,n,r={layer:this.config.shortcutsLayer}){let s=new q,o=(await Promise.all(j(n).map(async u=>{let f=E(u)?await this.parseUtil(u,e,!0,r.prefix):[[Number.POSITIVE_INFINITY,"{inline}",P(u),void 0,[]]];return f||wt(`unmatched utility "${u}" in shortcut "${t[1]}"`),f||[]}))).flat(1).filter(Boolean).sort((u,f)=>u[0]-f[0]),[a,,l]=t,c=[];for(let u of o){if(nt(u)){c.push([u[0],void 0,u[1],void 0,u[2],e,void 0]);continue}let{selector:f,entries:y,parent:w,sort:T,noMerge:v}=this.applyVariants(u,[...u[4],...l],a);s.getFallback(f,w,[[],u[0]])[0].push([y,!!(v??u[3]?.noMerge),T??0])}return c.concat(s.map(([u,f],y,w)=>{let T=(S,C,b)=>{let g=Math.max(...b.map(x=>x[1])),h=b.map(x=>x[0]);return(S?[h.flat(1)]:h).map(x=>{let R=F(x);if(R)return[f,y,R,w,{...r,noMerge:C,sort:g},e,void 0]})};return[[u.filter(([,S])=>S).map(([S,,C])=>[S,C]),!0],[u.filter(([,S])=>!S).map(([S,,C])=>[S,C]),!1]].map(([S,C])=>[...T(!1,C,S.filter(([b])=>b.some(g=>g[0]===et))),...T(!0,C,S.filter(([b])=>b.every(g=>g[0]!==et)))])}).flat(2).filter(Boolean))}isBlocked(t){return!t||this.config.blocklist.some(e=>E(e)?e===t:e.test(t))}};function Ut(i,t){return new at(i,t)}var te=/\s\$\$\s+/g;function ee(i){return i.match(/\s\$\$\s/)}function ne(i,t){return ee(i)?i.replace(te,t?` ${t} `:" "):t?`${t} ${i}`:i}var Lt=/^\[(.+?)(~?=)"(.*)"\]$/;function re(i){return Lt.test(i)?i.replace(Lt,(t,e,n,r)=>`[${G(e)}${n}"${G(r)}"]`):`.${G(i)}`}function ie(i,t){return t(i)}function se(i){return i.replace(/-(\w)/g,(t,e)=>e?e.toUpperCase():"")}function Ot(i){return i.charAt(0).toUpperCase()+i.slice(1)}function kt(i){return i.replace(/(?:^|\B)([A-Z])/g,"-$1").toLowerCase()}var Mt=["Webkit","Moz","ms"];function $t(i){let t={};function e(n){let r=t[n];if(r)return r;let s=se(n);if(s!=="filter"&&s in i)return t[n]=kt(s);s=Ot(s);for(let o=0;o<Mt.length;o++){let a=`${Mt[o]}${s}`;if(a in i)return t[n]=kt(Ot(a))}return n}return({entries:n})=>n.forEach(r=>{r[0].startsWith("--")||(r[0]=e(r[0]))})}function jt(i){return i.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")}function lt(i={}){if(typeof window>"u"){console.warn("@unocss/runtime been used in non-browser environment, skipped.");return}let t=window,e=window.document,n=()=>e.documentElement,r=t.__unocss||{},s=Object.assign({},i,r.runtime),o=s.defaults||{},a=s.cloakAttribute??"un-cloak";s.autoPrefix&&(o.postprocess=A(o.postprocess)).unshift($t(e.createElement("div").style)),s.configResolved?.(r,o);let l=Ut(r,o),c=new Map,u=!0,f=new Set,y,w,T=[],v=()=>new Promise(p=>{T.push(p),w!=null&&clearTimeout(w),w=setTimeout(()=>b().then(()=>{let d=T;T=[],d.forEach(m=>m())}),0)});function S(p){if(p.nodeType!==1)return;let d=p;d.hasAttribute(a)&&d.removeAttribute(a),d.querySelectorAll(`[${a}]`).forEach(m=>{m.removeAttribute(a)})}function C(p,d){let m=c.get(p);if(!m)if(m=e.createElement("style"),m.setAttribute("data-unocss-runtime-layer",p),c.set(p,m),d==null)n().prepend(m);else{let L=C(d),U=L.parentNode;U?U.insertBefore(m,L.nextSibling):n().prepend(m)}return m}async function b(){let p=await l.generate(f);return p.layers.reduce((d,m)=>(C(m,d).innerHTML=p.getLayer(m)??"",m),void 0),f=p.matched,{...p,getStyleElement:d=>c.get(d),getStyleElements:()=>c}}async function g(p){let d=f.size;await l.applyExtractors(p,void 0,f),d!==f.size&&await v()}async function h(){let p=e.body,d=p&&p.outerHTML;d&&(await g(`${d} ${jt(d)}`),S(n()),S(p))}let x=new MutationObserver(p=>{u||p.forEach(async d=>{if(d.target.nodeType!==1)return;let m=d.target;for(let L of c)if(m===L[1])return;if(d.type==="childList")d.addedNodes.forEach(async L=>{if(L.nodeType!==1)return;let U=L;y&&!y(U)||(await g(U.outerHTML),S(U))});else{if(y&&!y(m))return;if(d.attributeName!==a){let L=Array.from(m.attributes).map(M=>M.value?`${M.name}="${M.value}"`:M.name).join(" "),U=`<${m.tagName.toLowerCase()} ${L}>`;await g(U)}m.hasAttribute(a)&&m.removeAttribute(a)}})}),R=!1;function _(){if(R)return;let p=n()||e.body;p&&(x.observe(p,{childList:!0,subtree:!0,attributes:!0}),R=!0)}function k(){s.bypassDefined&&oe(l.blocked),h(),_()}function V(){e.readyState==="loading"?t.addEventListener("DOMContentLoaded",k):k()}let B=t.__unocss_runtime=t.__unocss_runtime={version:l.version,uno:l,async extract(p){E(p)||(p.forEach(d=>f.add(d)),p=""),await g(p)},extractAll:h,inspect(p){y=p},toggleObserver(p){p===void 0?u=!u:u=!!p,!R&&!u&&V()},update:b};s.ready?.(B)!==!1&&(u=!1,V())}function oe(i=new Set){for(let t=0;t<document.styleSheets.length;t++){let e=document.styleSheets[t],n;try{if(n=e.cssRules||e.rules,!n)continue;Array.from(n).flatMap(r=>r.selectorText?.split(/,/g)||[]).forEach(r=>{r&&(r=r.trim(),r.startsWith(".")&&(r=r.slice(1)),i.add(r))})}catch{continue}}return i}lt();})();