@stacksjs/ts-css 0.3.14 → 0.3.15
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/dist/bin/cli.js +1 -1
- package/dist/bin/cssx.js +1 -1
- package/dist/chunk-1kmkypmr.js +3 -0
- package/dist/chunk-2wsah70r.js +2 -0
- package/dist/chunk-9ep6bwwb.js +2 -0
- package/dist/chunk-edwg811g.js +2 -0
- package/dist/chunk-thy3p95k.js +3 -0
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -29,5 +29,5 @@ Received ${n}, cleaning up...`),e)try{await e()}catch(r){console.error("Error du
|
|
|
29
29
|
`)),this.enableDidYouMean){let t=[];for(let r of this.commands){if(r.displayName)t.push(r.displayName);if(r.aliasNames)t.push(...r.aliasNames)}let n=qe(e,t);if(n.length>0)console.log(J.yellow("Did you mean one of these?")),n.forEach((r)=>console.log(` ${J.dim("\u2022")} ${this.name} ${r}`)),console.log("")}console.log(J.dim("Run"),`${this.name} --help`,J.dim("to see all available commands")),V.exit(1)}async parse(e=Ue,t={}){let{run:n=!0,exitOnError:r=!1}=t;if(r)try{return await this.parse(e,{run:n})}catch(o){throw this.handleUsageError(o),o}if(this.rawArgs=e,!this.name)this.name=e[1]?Tt(e[1]):"cli";let s=!0,i=e.slice(2),l=i[0];if(l&&!l.startsWith("-")){for(let o of this.commands)if(o.isMatched(l)){let c=this.mri(i,o);s=!1;let h={...c,args:c.args.slice(1)};this.setParsedInfo(h,o,l),this.emit(`command:${l}`,o);break}if(s){let o=i[1];if(o&&!o.startsWith("-")){let c=`${l}:${o}`;for(let h of this.commands)if(h.isMatched(c)){let u=this.mri(i,h);s=!1;let d={...u,args:u.args.slice(2)};this.setParsedInfo(d,h,c),this.emit(`command:${c}`,h);break}}}}if(s){for(let o of this.commands)if(o.name===""){s=!1;let c=this.mri(i,o);this.setParsedInfo(c,o),this.emit("command:!",o);break}}if(s){let o=this.mri(e.slice(2));this.setParsedInfo(o)}if(this.options.verbose)this.isVerbose=!0;if(this.options.quiet)this.isQuiet=!0;if(this.options.debug)this.isDebug=!0;if(this.options.noInteraction||this.options.interaction===!1)this.isNoInteraction=!0;if(this.options.env)this.environment=String(this.options.env);if(this.options.dryRun)this.isDryRun=!0;if(this.options.force)this.isForce=!0;if(this.options.noEmoji||this.options.emoji===!1)this.useEmoji=!1;if(this.options.theme)this.theme=String(this.options.theme);if(this.options.noCache||this.options.cache===!1)this.isNoCache=!0;if(this.options.help&&this.showHelpOnExit)this.outputHelp(),n=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),n=!1,this.unsetMatchedCommand();let a={args:this.args,options:this.options};if(n)await this.runMatchedCommand();if(!this.matchedCommand&&this.args[0]){if(this.emit("command:*"),!(this.listenerCount("command:*")>0))this.showCommandNotFound(this.args[0])}return a}mri(e,t){let n=[...this.globalCommand.options,...t?t.options:[]],r=xt(n),s=[],i=e.indexOf("--");if(i>-1)s=e.slice(i+1),e=e.slice(0,i);let l=Et(e,r),a={_:l._};for(let d of Object.keys(l))if(d!=="_")a[Z(d)]=l[d];let o=a._,c={"--":s},h=t&&t.config.ignoreOptionDefaultValue?t.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,u=Object.create(null);for(let d of n){if(!h&&d.config.default!==void 0)for(let b of d.names)c[b]=d.config.default;if(Array.isArray(d.config.type)){if(u[d.name]===void 0)u[d.name]={shouldTransform:!0,transformFunction:d.config.type[0]}}}for(let d of Object.keys(a))if(d!=="_"){let b=d.split(".");St(c,b,a[d]),kt(c,u)}for(let d of n){if(!d.variadic)continue;for(let b of d.names){let p=c[b];if(p===void 0||Array.isArray(p))continue;if(d.config.default!==void 0&&p===d.config.default)continue;c[b]=[p]}}return{args:o,options:c}}async run(e=Ue){return this.parse(e,{run:!0,exitOnError:!0})}handleUsageError(e){if(!At(e)||e.isUsageError===!1)return;let t=e.message||"command-line error",n=this.name?`${this.name}: `:"",r=/--help/.test(t)?"":e.usage?`
|
|
30
30
|
Usage: ${e.usage}`:`
|
|
31
31
|
Run \`${this.name??"cli"} --help\` for usage.`;V.stderr.write(`${n}${t}${r}
|
|
32
|
-
`),V.exit(e.exitCode??2)}async runMatchedCommand(){let{args:e,options:t,matchedCommand:n}=this;if(!n||!n.commandAction)return;n.checkUnknownOptions(),n.checkOptionValue(),n.checkRequiredArgs();let r=[];n.args.forEach((a,o)=>{if(a.variadic)r.push(e.slice(o));else r.push(e[o])}),r.push(t);let s={command:n,args:r,options:t};for(let a of n.beforeHooks)await a(s);let i,l=async()=>{let a=n.commandAction.apply(this,r);if(a instanceof Promise)i=await a;else i=a;return i};if(n.middleware.length>0){let a=0,o=async()=>{if(a<n.middleware.length){let c=n.middleware[a++];await c({...s,next:o})}else await l()};await o()}else await l();for(let a of n.afterHooks)await a(s);return i}removeSignalHandlers(){if(!this.signalHandlersSet)return this;return V.removeAllListeners("SIGINT"),V.removeAllListeners("SIGTERM"),this.signalHandlersSet=!1,this}destroy(){this.removeSignalHandlers(),this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.matchedCommand=void 0,this.matchedCommandName=void 0,this.removeAllListeners()}}class Ke{cache;enabled;cleanupInterval=null;hits=0;misses=0;constructor(){this.cache=new Map,this.enabled=!0,this.startCleanupInterval()}startCleanupInterval(){if(this.cleanupInterval)return;this.cleanupInterval=setInterval(()=>{this.cleanup()},30000),this.cleanupInterval.unref()}stopCleanup(){if(this.cleanupInterval)clearInterval(this.cleanupInterval),this.cleanupInterval=null}isEnabled(){return this.enabled}get(e){if(!this.enabled){this.misses++;return}let t=this.cache.get(e);if(!t){this.misses++;return}if(Date.now()-t.timestamp>t.ttl){this.cache.delete(e),this.misses++;return}return this.hits++,t.value}set(e,t,n=5000){if(!this.enabled)return;this.cache.set(e,{value:t,timestamp:Date.now(),ttl:n})}has(e){if(!this.enabled)return!1;let t=this.cache.get(e);if(!t)return!1;if(Date.now()-t.timestamp>t.ttl)return this.cache.delete(e),!1;return!0}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}disable(){this.enabled=!1,this.clear()}enable(){this.enabled=!0}stats(){return{size:this.cache.size,enabled:this.enabled,hits:this.hits,misses:this.misses}}resetStats(){this.hits=0,this.misses=0}keys(){return Array.from(this.cache.keys())}cleanup(){let e=Date.now();for(let[t,n]of this.cache.entries())if(e-n.timestamp>n.ttl)this.cache.delete(t)}destroy(){this.stopCleanup(),this.clear(),this.resetStats()}}var hr=new Ke;function Bt(){if("FORCE_COLOR"in X.env)return X.env.FORCE_COLOR!=="0";if("NO_COLOR"in X.env||X.env.TERM==="dumb")return!1;if(X.platform==="win32")return!0;return ze.isatty(1)&&ze.isatty(2)}var Ye=Bt();function v(e,t){if(!Ye)return(n)=>n;return(n)=>e+n+t}var Dt=v("\x1B[0m","\x1B[0m"),Mt=v("\x1B[31m","\x1B[39m"),Vt=v("\x1B[32m","\x1B[39m"),jt=v("\x1B[33m","\x1B[39m"),Wt=v("\x1B[34m","\x1B[39m"),Ft=v("\x1B[35m","\x1B[39m"),Ut=v("\x1B[36m","\x1B[39m"),zt=v("\x1B[37m","\x1B[39m"),Ht=v("\x1B[90m","\x1B[39m"),qt=v("\x1B[1m","\x1B[22m"),Gt=v("\x1B[3m","\x1B[23m"),Kt=v("\x1B[4m","\x1B[24m"),Yt=v("\x1B[2m","\x1B[22m"),Qt=v("\x1B[7m","\x1B[27m"),Jt=v("\x1B[8m","\x1B[28m"),Xt=v("\x1B[9m","\x1B[29m"),Zt=v("\x1B[41m","\x1B[49m"),en=v("\x1B[42m","\x1B[49m"),tn=v("\x1B[43m","\x1B[49m"),nn=v("\x1B[44m","\x1B[49m"),rn=v("\x1B[45m","\x1B[49m"),sn=v("\x1B[46m","\x1B[49m"),on=v("\x1B[47m","\x1B[49m"),an=Ye,ln={reset:Dt,red:Mt,green:Vt,yellow:jt,blue:Wt,magenta:Ft,cyan:Ut,white:zt,gray:Ht,bold:qt,italic:Gt,underline:Kt,dim:Yt,inverse:Qt,hidden:Jt,strikethrough:Xt,bgRed:Zt,bgGreen:en,bgYellow:tn,bgBlue:nn,bgMagenta:rn,bgCyan:sn,bgWhite:on,isColorSupported:an},cn=ln,hn=["up","down","left","right","space","enter","cancel"],yr={actions:new Set(hn),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};var br=un.platform.startsWith("win"),Cr=Symbol("clapp:cancel");var dn=Nt();var C=(e,t)=>dn?e:t,vr=C("\u25C6","*"),wr=C("\u25A0","x"),$r=C("\u25B2","x"),xr=C("\u25C7","o"),Sr=C("\u250C","T"),mn=C("\u2502","|"),kr=C("\u2514","\u2014"),Tr=C("\u25CF",">"),Ar=C("\u25CB"," "),Nr=C("\u25FB","[\u2022]"),Ir=C("\u25FC","[+]"),Er=C("\u25FB","[ ]"),Or=C("\u25AA","\u2022"),Lr=C("\u2500","-"),Pr=C("\u256E","+"),Rr=C("\u251C","+"),_r=C("\u256F","+"),Br=C("\u25CF","\u2022"),Dr=C("\u25C6","*"),Mr=C("\u25B2","!"),Vr=C("\u25A0","x");var jr={light:C("\u2500","-"),heavy:C("\u2501","="),block:C("\u2588","#")};function fn(){return`${cn.gray(mn)} `}var Wr=fn();class Qe{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let e=He.homedir(),t=fe.join(e,".config","clapp");this.configPath=fe.join(t,"telemetry.json")}async isEnabled(){if(W.env.DO_NOT_TRACK==="1"||W.env.DO_NOT_TRACK==="true")return!1;if(W.env.NO_TELEMETRY==="1"||W.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let e=await this.loadConfig();if(e.enabled=!0,!e.userId)e.userId=this.generateUserId();await this.saveConfig(e)}async disable(){let e=await this.loadConfig();e.enabled=!1,await this.saveConfig(e)}async track(e,t){if(!await this.isEnabled())return;let r={event:e,...t,timestamp:Date.now(),platform:He.platform(),nodeVersion:W.version};if(this.events.push(r),this.events.length>=10)await this.send()}async trackCommand(e,t){await this.track("command",{command:e,duration:t})}async trackError(e,t){await this.track("error",{error:e,command:t})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let t=await this.loadConfig();return t.lastSent=Date.now(),await this.saveConfig(t),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let t=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep(t),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep(e){return new Promise((t)=>setTimeout(t,e))}async status(){let e=await this.loadConfig();return{enabled:e.enabled,doNotTrack:W.env.DO_NOT_TRACK==="1"||W.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:e.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(pn(this.configPath)){let e=await me.readFile(this.configPath,"utf-8");return this.config=JSON.parse(e),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig(e){this.config=e;try{let t=fe.dirname(this.configPath);await me.mkdir(t,{recursive:!0}),await me.writeFile(this.configPath,JSON.stringify(e,null,2),"utf-8")}catch{}}generateUserId(){let e=Math.random().toString(36).substring(2,15),t=Date.now().toString(36);return`${e}-${t}`}}var Gr=new Qe;import{existsSync as er,readFileSync as tr}from"fs";function B(e){return{prev:null,next:null,data:e}}class L{head=null;tail=null;cursors=[];allocateCursor(e,t){let n={prev:e,next:t};return this.cursors.push(n),n}releaseCursor(){this.cursors.pop()}updateCursors(e,t,n,r){for(let s of this.cursors){if(s.prev===e)s.prev=t;if(s.next===n)s.next=r}}static createItem(e){return B(e)}createItem(e){return B(e)}get isEmpty(){return this.head===null}get first(){return this.head?.data??null}get last(){return this.tail?.data??null}*[Symbol.iterator](){for(let e=this.head;e!=null;e=e.next)yield e.data}fromArray(e){let t=null;this.head=null;for(let n of e){let r=B(n);if(r.prev=t,t)t.next=r;else this.head=r;t=r}return this.tail=t,this}toArray(){let e=[];for(let t=this.head;t!=null;t=t.next)e.push(t.data);return e}toJSON(){return this.toArray()}forEach(e,t){let n=this.allocateCursor(null,this.head);while(n.next!==null){let r=n.next;n.prev=r,n.next=r.next,e.call(t,r.data,r,this)}this.releaseCursor()}forEachRight(e,t){let n=this.allocateCursor(this.tail,null);while(n.prev!==null){let r=n.prev;n.next=r,n.prev=r.prev,e.call(t,r.data,r,this)}this.releaseCursor()}reduce(e,t){let n=t,r=0;for(let s=this.head;s!=null;s=s.next)n=e(n,s.data,r++,this);return n}some(e){let t=0;for(let n=this.head;n!=null;n=n.next)if(e(n.data,t++,this))return!0;return!1}map(e){let t=new L,n=null,r=0;for(let s=this.head;s!=null;s=s.next){let i=B(e(s.data,r++,this));if(i.prev=n,n)n.next=i;else t.head=i;n=i}return t.tail=n,t}filter(e){let t=new L,n=null,r=0;for(let s=this.head;s!=null;s=s.next)if(e(s.data,r++,this)){let i=B(s.data);if(i.prev=n,n)n.next=i;else t.head=i;n=i}return t.tail=n,t}clear(){let e=this.head;while(e){let t=e.next;e.prev=null,e.next=null,e=t}this.head=null,this.tail=null}copy(){let e=new L,t=null;for(let n=this.head;n!=null;n=n.next){let r=B(n.data);if(r.prev=t,t)t.next=r;else e.head=r;t=r}return e.tail=t,e}prepend(e){return this.insert(e,this.head)}prependData(e){return this.insert(B(e),this.head)}append(e){return this.insert(e,null)}appendData(e){return this.insert(B(e),null)}insert(e,t=null){if(t!=null)if(this.updateCursors(t.prev,e,t,e),t.prev===null){if(this.head!==t)throw Error("before doesn't belong to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e,null,null)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else if(this.updateCursors(this.tail,e,null,e),this.tail!==null)this.tail.next=e,e.prev=this.tail,this.tail=e;else this.head=e,this.tail=e;return this}insertData(e,t=null){return this.insert(B(e),t)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),e.prev!==null)e.prev.next=e.next;else if(this.head===e)this.head=e.next;else throw Error("item doesn't belong to list");if(e.next!==null)e.next.prev=e.prev;else if(this.tail===e)this.tail=e.prev;else throw Error("item doesn't belong to list");return e.prev=null,e.next=null,e}push(e){this.insert(B(e),null)}pop(){if(this.tail===null)return null;return this.remove(this.tail)}unshift(e){this.prependData(e)}shift(){if(this.head===null)return null;return this.remove(this.head)}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e,null)}insertList(e,t=null){if(e.head===null)return this;if(t!==null){if(this.updateCursors(t.prev,e.tail,t,e.head),t.prev!==null)t.prev.next=e.head,e.head.prev=t.prev;else this.head=e.head;t.prev=e.tail,e.tail.next=t}else{if(this.updateCursors(this.tail,e.tail,null,e.head),this.tail!==null)this.tail.next=e.head,e.head.prev=this.tail;else this.head=e.head;this.tail=e.tail}return e.head=null,e.tail=null,this}replace(e,t){if(t instanceof L)this.insertList(t,e),this.remove(e);else this.insert(t,e),this.remove(e)}}function k(e){switch(e.type){case"StyleSheet":return O(e.children,"");case"Rule":return`${k(e.prelude)}{${k(e.block)}}`;case"Block":return gn(e.children);case"Atrule":{let t=`@${e.name}`;if(e.prelude){let n=k(e.prelude);if(n)t+=` ${n}`}if(e.block)t+=`{${k(e.block)}}`;else t+=";";return t}case"AtrulePrelude":return O(e.children,"");case"SelectorList":return O(e.children,",");case"Selector":return O(e.children,"");case"TypeSelector":return e.name;case"IdSelector":return`#${e.name}`;case"ClassSelector":return`.${e.name}`;case"NestingSelector":return"&";case"AttributeSelector":{let t=`[${e.name.name}`;if(e.matcher&&e.value)if(t+=e.matcher,e.value.type==="String")t+=`"${ve(e.value.value)}"`;else t+=e.value.name;if(e.flags)t+=` ${e.flags}`;return t+="]",t}case"PseudoClassSelector":return e.children?`:${e.name}(${O(e.children,"")})`:`:${e.name}`;case"PseudoElementSelector":return e.children?`::${e.name}(${O(e.children,"")})`:`::${e.name}`;case"Combinator":return e.name===" "?" ":e.name;case"Declaration":return`${e.property}:${k(e.value)}${e.important?"!important":""}`;case"DeclarationList":return O(e.children,";");case"Value":return O(e.children,"");case"Identifier":return e.name;case"Number":return e.value;case"Percentage":return`${e.value}%`;case"Dimension":return e.value+e.unit;case"String":return`"${ve(e.value)}"`;case"Url":return/[\s"'()\\\u0000-\u001F\u007F]/.test(e.value)?`url("${ve(e.value)}")`:`url(${e.value})`;case"Hash":return`#${e.name}`;case"Operator":return e.value;case"Function":return`${e.name}(${O(e.children,"")})`;case"Parentheses":return`(${O(e.children,"")})`;case"Brackets":return`[${O(e.children,"")}]`;case"Raw":return e.value;case"Comment":return e.value.startsWith("!")?`/*${e.value}*/`:"";case"WhiteSpace":return" ";case"CDO":return"<!--";case"CDC":return"-->";case"AnPlusB":{let t=e.a??"",n=e.b??"";if(t&&n){let r=Number(n);return`${t==="1"?"":t==="-1"?"-":t}n${r>=0?`+${n}`:n}`}if(t)return`${t==="1"?"":t==="-1"?"-":t}n`;return n}case"Ratio":return`${e.left.value}/${e.right.value}`;case"UnicodeRange":return e.value;case"Nth":return e.selector?`${k(e.nth)} of ${k(e.selector)}`:k(e.nth);case"MediaQueryList":return O(e.children,",");case"MediaQuery":return O(e.children,"");case"MediaFeature":{let t=`(${e.name}`;if(e.value)t+=`:${k(e.value)}`;return t+=")",t}}return""}function O(e,t){let n="",r=!0,s=null,i=e.head;while(i!=null){let l=i.data;if(l.type==="WhiteSpace"){let o=i.next?i.next.data:null;if(Je(s)||Je(o)){i=i.next;continue}}let a=k(l);if(!a){i=i.next;continue}if(!r&&t&&!bn(s))n+=t;r=!1,n+=a,s=l,i=i.next}return n}function gn(e){let t="",n=null,r=e.head;while(r!=null){let s=r.data,i=k(s);if(!i){r=r.next;continue}if(n&&yn(n,s))t+=";";t+=i,n=s,r=r.next}return t}function yn(e,t){return e.type==="Declaration"&&t.type!=="Comment"}function Je(e){if(!e||e.type!=="Operator")return!1;let t=e.value;return t===":"||t===","||t==="/"}function bn(e){if(!e)return!1;return e.type==="Operator"||e.type==="Combinator"}function ve(e){let t="";for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===92)t+="\\\\";else if(r===34)t+="\\\"";else if(r<32||r===127){let s=r.toString(16),i=n+1<e.length?e.charCodeAt(n+1):-1,l=i===32||i===9||i===10||i===12||i===13||i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102;t+=`\\${s}${l?" ":""}`}else t+=e[n]}return t}var U=(()=>{let e=new Uint8Array(128);for(let t=0;t<128;t++){let n=0;if(t===32||t===9||t===10||t===12||t===13)n|=1;if(t>=48&&t<=57)n|=2;if(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)n|=4;if(t>=65&&t<=90||t>=97&&t<=122||t===95)n|=8;if(t===10||t===12||t===13)n|=16;e[t]=n}return e})();function P(e){return e<128&&(U[e]&2)!==0}function te(e){return e<128&&(U[e]&4)!==0}function Xe(e){return e>=128||e<128&&(U[e]&8)!==0}function Cn(e){return e===45||e>=128||e<128&&(U[e]&10)!==0}function vn(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function $e(e){return e<128&&(U[e]&16)!==0}function M(e){return e<128&&(U[e]&1)!==0}function F(e,t){if(e!==92)return!1;if($e(t))return!1;return!0}function we(e,t,n){if(e===45)return Xe(t)||t===45||F(t,n);if(Xe(e))return!0;if(e===92)return F(e,t);return!1}function wn(e,t,n){if(e===43||e===45){if(P(t))return!0;if(t===46&&P(n))return!0;return!1}if(e===46)return P(t);return P(e)}class ie{source;offset=0;types;starts;ends;count=0;_tokens=null;_lineStarts=null;constructor(e){this.source=e;let t=Math.max(64,Math.ceil(e.length/3));this.types=new Uint8Array(t),this.starts=new Uint32Array(t),this.ends=new Uint32Array(t),this.tokenize()}get lineStarts(){if(this._lineStarts==null)this._lineStarts=$n(this.source);return this._lineStarts}get tokens(){if(this._tokens!=null)return this._tokens;let e=Array.from({length:this.count});for(let t=0;t<this.count;t++)e[t]={type:this.types[t],start:this.starts[t],end:this.ends[t]};return this._tokens=e,e}addToken(e,t,n){if(this.count>=this.types.length)this.grow();this.types[this.count]=e,this.starts[this.count]=t,this.ends[this.count]=n,this.count++}grow(){let t=this.types.length*2,n=new Uint8Array(t);n.set(this.types),this.types=n;let r=new Uint32Array(t);r.set(this.starts),this.starts=r;let s=new Uint32Array(t);s.set(this.ends),this.ends=s}tokenize(){let e=this.source,t=0,n=e.length;while(t<n){let r=e.charCodeAt(t);if(r===47&&e.charCodeAt(t+1)===42){let l=t;t+=2;while(t<n&&!(e.charCodeAt(t)===42&&e.charCodeAt(t+1)===47))t++;t=t<n?t+2:n,this.addToken(25,l,t);continue}if(M(r)){let l=t;while(t<n&&M(e.charCodeAt(t)))t++;this.addToken(13,l,t);continue}if(r===34||r===39){t=this.consumeString(r,t);continue}if(r===35){if(t+1<n&&(Cn(e.charCodeAt(t+1))||F(e.charCodeAt(t+1),e.charCodeAt(t+2)))){let l=t;t++,t=this.consumeName(t),this.addToken(4,l,t);continue}this.addToken(9,t,t+1),t++;continue}switch(r){case 40:this.addToken(21,t,t+1),t++;continue;case 41:this.addToken(22,t,t+1),t++;continue;case 91:this.addToken(19,t,t+1),t++;continue;case 93:this.addToken(20,t,t+1),t++;continue;case 123:this.addToken(23,t,t+1),t++;continue;case 125:this.addToken(24,t,t+1),t++;continue;case 44:this.addToken(18,t,t+1),t++;continue;case 58:this.addToken(16,t,t+1),t++;continue;case 59:this.addToken(17,t,t+1),t++;continue}if(r===60&&e.startsWith("!--",t+1)){this.addToken(14,t,t+4),t+=4;continue}if(r===45&&e.startsWith("->",t+1)){this.addToken(15,t,t+3),t+=3;continue}if(r===64){let l=e.charCodeAt(t+1),a=e.charCodeAt(t+2),o=e.charCodeAt(t+3);if(we(l,a,o)){let c=t;t++,t=this.consumeName(t),this.addToken(3,c,t);continue}this.addToken(9,t,t+1),t++;continue}let s=e.charCodeAt(t+1),i=e.charCodeAt(t+2);if(wn(r,s,i)){t=this.consumeNumeric(t);continue}if(we(r,s,i)){t=this.consumeIdentLike(t);continue}if(r===92){if(F(r,s)){t=this.consumeIdentLike(t);continue}this.addToken(9,t,t+1),t++;continue}this.addToken(9,t,t+1),t++}this.addToken(0,n,n)}consumeString(e,t){let n=this.source,r=n.length,s=t+1;while(s<r){let i=n.charCodeAt(s);if(i===e)return s++,this.addToken(5,t,s),s;if($e(i))return this.addToken(6,t,s),s;if(i===92){let l=n.charCodeAt(s+1);if($e(l)){s+=2;continue}if(s+1<r){s=this.consumeEscapeSkip(s+1);continue}}s++}return this.addToken(5,t,s),s}consumeEscapeSkip(e){let t=this.source;if(e>=t.length)return e;let n=t.charCodeAt(e);if(te(n)){let r=1;e++;while(r<6&&e<t.length&&te(t.charCodeAt(e)))e++,r++;if(e<t.length&&M(t.charCodeAt(e)))e++;return e}return e+1}consumeName(e){let t=this.source,n=t.length,r=e;while(r<n){let s=t.charCodeAt(r);if(s<128&&(U[s]&10)!==0){r++;continue}if(s===45){r++;continue}if(s>=128){r++;continue}if(s===92&&F(s,t.charCodeAt(r+1))){r=this.consumeEscapeSkip(r+1);continue}break}return r}consumeNumber(e){let t=this.source,n=e;if(t.charCodeAt(n)===43||t.charCodeAt(n)===45)n++;while(n<t.length&&P(t.charCodeAt(n)))n++;if(t.charCodeAt(n)===46&&P(t.charCodeAt(n+1))){n+=2;while(n<t.length&&P(t.charCodeAt(n)))n++}let r=t.charCodeAt(n);if(r===69||r===101){let s=t.charCodeAt(n+1),i=t.charCodeAt(n+2);if(P(s)){n+=2;while(n<t.length&&P(t.charCodeAt(n)))n++}else if((s===43||s===45)&&P(i)){n+=3;while(n<t.length&&P(t.charCodeAt(n)))n++}}return n}consumeNumeric(e){let t=this.source,n=this.consumeNumber(e),r=t.charCodeAt(n),s=t.charCodeAt(n+1),i=t.charCodeAt(n+2);if(we(r,s,i)){let l=this.consumeName(n);return this.addToken(12,e,l),l}if(r===37)return this.addToken(11,e,n+1),n+1;return this.addToken(10,e,n),n}consumeIdentLike(e){let t=this.source,n=this.consumeName(e),r=t.charCodeAt(n);if(r===40&&n-e===3){let s=t.charCodeAt(e)|32,i=t.charCodeAt(e+1)|32,l=t.charCodeAt(e+2)|32;if(s===117&&i===114&&l===108){let a=n+1;while(a<t.length&&M(t.charCodeAt(a)))a++;let o=t.charCodeAt(a);if(o===34||o===39)return this.addToken(2,e,n+1),n+1;return this.consumeUrl(e,n)}}if(r===40)return this.addToken(2,e,n+1),n+1;return this.addToken(1,e,n),n}consumeUrl(e,t){let n=this.source,r=n.length,s=t+1;while(s<r&&M(n.charCodeAt(s)))s++;while(s<r){let i=n.charCodeAt(s);if(i===41)return s++,this.addToken(7,e,s),s;if(M(i)){let l=s;while(s<r&&M(n.charCodeAt(s)))s++;if(s>=r)return this.addToken(7,e,s),s;if(n.charCodeAt(s)===41)return s++,this.addToken(7,e,s),s;return this.consumeBadUrl(e,l)}if(i===34||i===39||i===40||vn(i))return this.consumeBadUrl(e,s);if(i===92){if(F(i,n.charCodeAt(s+1))){s=this.consumeEscapeSkip(s+1);continue}return this.consumeBadUrl(e,s)}s++}return this.addToken(7,e,s),s}consumeBadUrl(e,t){let n=this.source,r=t;while(r<n.length){let s=n.charCodeAt(r);if(s===41){r++;break}if(s===92&&F(s,n.charCodeAt(r+1))){r=this.consumeEscapeSkip(r+1);continue}r++}return this.addToken(8,e,r),r}locate(e){let t=this.lineStarts,n=0,r=t.length-1;while(n<r){let i=n+r+1>>1;if(t[i]<=e)n=i;else r=i-1}let s=t[n];return{line:n+1,column:e-s+1}}}function $n(e){let t=[0],n=e.length;for(let r=0;r<n;r++){let s=e.charCodeAt(r);if(s===10)t.push(r+1);else if(s===13){if(e.charCodeAt(r+1)!==10)t.push(r+1)}}return t}function xe(e,t,n){for(let r=t;r<n;r++)if(e.charCodeAt(r)===92)return xn(e,t,n,r);return e.slice(t,n)}function xn(e,t,n,r){let s=e.slice(t,r),i=r;while(i<n){if(e.charCodeAt(i)!==92){s+=e[i],i++;continue}if(i+1>=n){i++;continue}let a=e.charCodeAt(i+1);if(a===10){i+=2;continue}if(a===13){i+=e.charCodeAt(i+2)===10?3:2;continue}if(te(a)){let o=i+1,c="";while(c.length<6&&o<n&&te(e.charCodeAt(o)))c+=e[o],o++;let h=Number.parseInt(c,16);if(o<n&&M(e.charCodeAt(o)))o++;s+=h===0||h>=55296&&h<=57343||h>1114111?String.fromCodePoint(65533):String.fromCodePoint(h),i=o;continue}s+=e[i+1],i+=2}return s}function Se(e,t,n){for(let r=t;r<n;r++)if(e.charCodeAt(r)===92)return Sn(e,t,n,r);return e.slice(t,n)}function Sn(e,t,n,r){let s=e.slice(t,r),i=r;while(i<n){if(e.charCodeAt(i)!==92){s+=e[i],i++;continue}let a=i+1,o="";while(o.length<6&&a<n&&te(e.charCodeAt(a)))o+=e[a],a++;if(o.length>0){let c=Number.parseInt(o,16);if(a<n&&M(e.charCodeAt(a)))a++;s+=c===0||c>=55296&&c<=57343||c>1114111?String.fromCodePoint(65533):String.fromCodePoint(c),i=a;continue}if(a<n){s+=e[a],i=a+1;continue}s+=String.fromCodePoint(65533),i=a}return s}function it(e,t){let n=new ie(e);return{source:e,types:n.types,starts:n.starts,ends:n.ends,count:n.count,end:n.count,pos:0,positions:t.positions??!1,filename:t.filename,parseValue:t.parseValue??!0,parseAtrulePrelude:t.parseAtrulePrelude??!0,parseCustomProperty:t.parseCustomProperty??!1,parseRulePrelude:t.parseRulePrelude??!0,onParseError:t.onParseError,tokenizer:n}}function m(e){return e.pos<e.end?e.types[e.pos]:0}function f(e){let t=e.pos;if(t>=e.end)return{type:0,start:e.starts[t]??e.source.length,end:e.ends[t]??e.source.length};return{type:e.types[t],start:e.starts[t],end:e.ends[t]}}function g(e){let t=e.pos++;if(t>=e.end)return{type:0,start:e.starts[t]??e.source.length,end:e.ends[t]??e.source.length};return{type:e.types[t],start:e.starts[t],end:e.ends[t]}}function D(e,t){return e.source.slice(t.start,t.end)}function R(e){let{types:t,end:n}=e;while(e.pos<n){let r=t[e.pos];if(r===13||r===25)e.pos++;else break}}function Ze(e){let{types:t,end:n}=e;while(e.pos<n&&t[e.pos]===13)e.pos++}function y(e,t,n){if(!e.positions)return null;let r=e.tokenizer.locate(t.start),s=e.tokenizer.locate(n.end);return{source:e.filename??"<unknown>",start:{offset:t.start,line:r.line,column:r.column},end:{offset:n.end,line:s.line,column:s.column}}}function ot(e){if(!e.positions)return null;let t=f(e),n=e.tokenizer.locate(t.start);return{source:e.filename??"<unknown>",start:{offset:t.start,line:n.line,column:n.column},end:{offset:t.start,line:n.line,column:n.column}}}function oe(e,t,n,r){return{type:"Raw",value:e,loc:y(r,t,n)}}function N(){return new L}function ke(e,t,n,r){if(e.onParseError){let{line:s,column:i}=e.tokenizer.locate(n.start),l=SyntaxError(`${e.filename??"<input>"}:${s}:${i}: ${t}`);l.line=s,l.column=i,l.offset=n.start,e.onParseError(l,r)}return r}function z(e,t={}){let n=it(e,t);switch(t.context??"stylesheet"){case"stylesheet":return nt(n);case"atrule":return le(n)??et(n);case"atrulePrelude":return Nn(n);case"mediaQuery":case"mediaQueryList":return tt(n);case"rule":return Ae(n);case"selectorList":return Ee(n);case"selector":return ut(n);case"block":return Ne(n);case"declarationList":return On(n);case"declaration":return Ie(n)??et(n);case"value":return Ln(n);case"raw":return tt(n);default:return nt(n)}}function et(e){return{type:"StyleSheet",children:N(),loc:ot(e)}}function tt(e){let t=f(e),n=t;while(m(e)!==0)n=g(e);return{type:"Raw",value:e.source.slice(t.start,n.end),loc:y(e,t,n)}}function nt(e){let t=f(e),n=N(),{types:r,end:s}=e;while(e.pos<s){let a=r[e.pos];if(a===13){e.pos++;continue}if(a===25){let h={type:25,start:e.starts[e.pos],end:e.ends[e.pos]},u=Te(e,h);e.pos++,n.appendData(u);continue}if(a===0)break;if(a===14||a===15){e.pos++;continue}if(a===3){let h=le(e);if(h)n.appendData(h);continue}if(a===24){e.pos++;continue}let o=e.pos,c=Ae(e);if(n.appendData(c),e.pos===o)e.pos++}let i=e.end-1,l=i>=0?{type:e.types[i],start:e.starts[i],end:e.ends[i]}:{type:0,start:0,end:0};return{type:"StyleSheet",children:n,loc:y(e,t,l)}}function Te(e,t){return{type:"Comment",value:e.source.slice(t.start+2,t.end-2),loc:y(e,t,t)}}function le(e){let t=f(e);if(t.type!==3)return null;e.pos++;let n=ae(e.source,t.start+1,t.end);R(e);let r=e.pos,s=f(e),{types:i,end:l}=e,a=r,o=r;while(a<l){let u=i[a];if(u===0||u===17||u===23)break;if(u!==13&&u!==25)o=a+1;a++}let c=null;if(o>r){let u=e.starts[r],d=e.ends[o-1],b={type:i[o-1],start:e.starts[o-1],end:d},p=e.source.slice(u,d).trim();if(p.length>0)if(e.parseAtrulePrelude)try{let _=e.end;e.end=o,e.pos=r;let T=N();while(m(e)!==0){let K=H(e);if(K)T.appendData(K)}if(lt(T),e.end=_,e.pos=a,T.isEmpty)c=oe(p,s,b,e);else c={type:"AtrulePrelude",children:T,loc:null}}catch(_){let T=oe(p,s,b,e);ke(e,`Failed to parse @${n} prelude: ${_.message}`,s,T),c=T,e.pos=a}else c=oe(p,s,b,e),e.pos=a;else e.pos=a}else e.pos=a;let h=null;if(m(e)===17)g(e);else if(m(e)===23)h=Ne(e,An.has(n));return{type:"Atrule",name:n,prelude:c,block:h,loc:y(e,t,f(e))}}var Tn=new Set(["is","not","where","has","matches","-moz-any","-webkit-any"]),An=new Set(["media","supports","document","layer","container","scope","starting-style","-moz-document","keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes"]);function Nn(e){let t=f(e),n=N();while(m(e)!==0){if(f(e).type===13){e.pos++;continue}let s=H(e);if(s)n.appendData(s)}return{type:"AtrulePrelude",children:n,loc:y(e,t,f(e))}}function Ae(e){let t=f(e),n;if(e.parseRulePrelude)n=Ee(e);else{let s=f(e),i=s;while(m(e)!==0&&m(e)!==23)i=g(e);let l=e.source.slice(s.start,i.end).trim();n=oe(l,s,i,e)}let r=Ne(e,!0);return{type:"Rule",prelude:n,block:r,loc:y(e,t,f(e))}}function Ne(e,t=!1){let n=f(e);if(m(e)!==23)return{type:"Block",children:N(),loc:ot(e)};e.pos++;let r=N(),{types:s,end:i}=e;while(e.pos<i){let l=s[e.pos];if(l===24||l===0)break;if(l===13){e.pos++;continue}if(l===25){let o={type:25,start:e.starts[e.pos],end:e.ends[e.pos]};e.pos++,r.appendData(Te(e,o));continue}if(l===3){let o=le(e);if(o)r.appendData(o);continue}if(t&&In(e,En)){let o=Ae(e);r.appendData(o);continue}let a=Ie(e);if(a)r.appendData(a);if(e.pos<i&&s[e.pos]===17)e.pos++}if(m(e)===24)e.pos++;return{type:"Block",children:r,loc:y(e,n,f(e))}}function In(e,t){let n=e.pos,r=t(e);return e.pos=n,r}function En(e){let{types:t,end:n}=e;while(e.pos<n){let r=t[e.pos];if(r===23)return!0;if(r===17||r===24||r===0)return!1;e.pos++}return!1}function On(e){let t=f(e),n=N();while(m(e)!==0&&m(e)!==24){let r=f(e);if(r.type===13){e.pos++;continue}if(r.type===25){n.appendData(Te(e,g(e)));continue}if(r.type===17){e.pos++;continue}if(r.type===3){let i=le(e);if(i)n.appendData(i);continue}let s=Ie(e);if(s)n.appendData(s);if(m(e)===17)g(e)}return{type:"DeclarationList",children:n,loc:y(e,t,f(e))}}function Ie(e){R(e);let t=f(e);if(t.type!==1&&t.type!==4&&!(t.type===9&&e.source[t.start]==="*"&&e.source[t.start+1]===" "))if(t.type===9&&e.source[t.start]==="*")e.pos++;else{ke(e,"Expected property name",t,{type:"Raw",value:"",loc:null});let{types:I,end:E}=e;while(e.pos<E){let S=I[e.pos];if(S===0||S===17||S===24)break;e.pos++}return null}let n=e.starts[e.pos],r=e.ends[e.pos];e.pos++;let s=e.source.slice(n,r);if(Ze(e),m(e)!==16){ke(e,`Expected ':' after property "${s}"`,f(e),{type:"Raw",value:"",loc:null});let{types:I,end:E}=e;while(e.pos<E){let S=I[e.pos];if(S===0||S===17||S===24)break;e.pos++}return null}e.pos++,Ze(e);let{types:i,starts:l,end:a,pos:o}=e,c=o,h=o,u=-1,d=-1;while(c<a){let I=i[c];if(I===0||I===17||I===24)break;if(I===9&&e.source.charCodeAt(l[c])===33){let E=c+1;while(E<a&&i[E]===13)E++;if(E<a&&i[E]===1){let S=l[E];if(e.ends[E]-S===9&&(e.source.charCodeAt(S)|32)===105&&(e.source.charCodeAt(S+1)|32)===109&&(e.source.charCodeAt(S+2)|32)===112&&(e.source.charCodeAt(S+3)|32)===111&&(e.source.charCodeAt(S+4)|32)===114&&(e.source.charCodeAt(S+5)|32)===116&&(e.source.charCodeAt(S+6)|32)===97&&(e.source.charCodeAt(S+7)|32)===110&&(e.source.charCodeAt(S+8)|32)===116){d=c,u=E,c=E+1;continue}}}if(I!==13&&I!==25)h=c+1;c++}let b=h,p=u>=0?{type:1,start:l[u],end:e.ends[u]}:null,_=s.startsWith("--"),T,K=l[o],Me=b>o?e.ends[b-1]:K,he={type:i[o],start:K,end:e.ends[o]},Ve=b>o?{type:i[b-1],start:l[b-1],end:Me}:he;if(_&&!e.parseCustomProperty||!e.parseValue)T={type:"Raw",value:e.source.slice(K,Me).trim(),loc:y(e,he,Ve)};else if(b===o)T={type:"Value",children:N(),loc:y(e,he,Ve)};else{let I=e.end;e.end=b,e.pos=o,T=at(e),e.end=I}return e.pos=c,{type:"Declaration",property:s,important:p?!0:!1,value:T,loc:y(e,t,f(e))}}function Ln(e){return at(e)}function at(e){let t=f(e),n=N();while(m(e)!==0&&m(e)!==17&&m(e)!==24&&m(e)!==22&&m(e)!==20){let r=H(e);if(r)n.appendData(r)}return ct(n),{type:"Value",children:n,loc:y(e,t,f(e))}}function lt(e){for(let t of e)if("children"in t&&t.children instanceof L)lt(t.children);ct(e)}function ct(e){let t=e.head;while(t){if(t.data.type==="Number"){let n=t.next;while(n&&n.data.type==="WhiteSpace")n=n.next;if(n&&n.data.type==="Operator"&&n.data.value==="/"){let r=n.next;while(r&&r.data.type==="WhiteSpace")r=r.next;if(r&&r.data.type==="Number"){let s={type:"Ratio",left:t.data,right:r.data,loc:null},i=t.next;while(i&&i!==r.next){let l=i.next;e.remove(i),i=l}e.replace(t,e.createItem(s)),t=e.head;continue}}}t=t.next}}function H(e){let t=e.pos;if(t>=e.end)return null;let n=e.types[t],r=e.starts[t],s=e.ends[t],i=e.source;switch(n){case 13:return e.pos++,e.positions?{type:"WhiteSpace",value:" ",loc:A(e,r,s)}:{type:"WhiteSpace",value:" ",loc:null};case 25:return e.pos++,{type:"Comment",value:i.slice(r+2,s-2),loc:e.positions?A(e,r,s):null};case 10:return e.pos++,{type:"Number",value:i.slice(r,s),loc:e.positions?A(e,r,s):null};case 11:return e.pos++,{type:"Percentage",value:i.slice(r,s-1),loc:e.positions?A(e,r,s):null};case 12:{e.pos++;let l=r,a=i.charCodeAt(l);if(a===43||a===45)l++;let o=!1;while(l<s){let h=i.charCodeAt(l);if(h>=48&&h<=57){l++;continue}if(h===46&&!o){o=!0,l++;continue}break}let c=i.charCodeAt(l);if(c===69||c===101){let h=l+1,u=i.charCodeAt(h);if(u===43||u===45)h++;let d=!1;while(h<s){let b=i.charCodeAt(h);if(b>=48&&b<=57){h++,d=!0;continue}break}if(d)l=h}return{type:"Dimension",value:i.slice(r,l),unit:i.slice(l,s),loc:e.positions?A(e,r,s):null}}case 1:return e.pos++,{type:"Identifier",name:Se(i,r,s),loc:e.positions?A(e,r,s):null};case 5:{e.pos++;let l=r+1,o=s-r>=2&&i.charCodeAt(s-1)===i.charCodeAt(r)?s-1:s;return{type:"String",value:xe(i,l,o),loc:e.positions?A(e,r,s):null}}case 7:{e.pos++;let l=r+4;while(l<s&&rt(i.charCodeAt(l)))l++;let a=s;if(a>l&&i.charCodeAt(a-1)===41)a--;while(a>l&&rt(i.charCodeAt(a-1)))a--;let o;if(a-l>=2){let c=i.charCodeAt(l),h=i.charCodeAt(a-1);if((c===34||c===39)&&c===h)o=i.slice(l+1,a-1);else o=i.slice(l,a)}else o=i.slice(l,a);return{type:"Url",value:o,loc:e.positions?A(e,r,s):null}}case 4:return e.pos++,{type:"Hash",name:i.slice(r+1,s),loc:e.positions?A(e,r,s):null};case 2:return Rn(e);case 21:return _n(e);case 18:return e.pos++,{type:"Operator",value:",",loc:e.positions?A(e,r,s):null};case 16:return e.pos++,{type:"Operator",value:":",loc:e.positions?A(e,r,s):null};case 9:{e.pos++;let l=i.charCodeAt(r),a=i[r];if(Pn(l))return{type:"Operator",value:a,loc:e.positions?A(e,r,s):null};return{type:"Identifier",name:a,loc:e.positions?A(e,r,s):null}}case 19:{e.pos++;let l=N();while(m(e)!==0&&m(e)!==20){let o=H(e);if(o)l.appendData(o)}let a=e.pos<e.end?e.ends[e.pos]:s;if(m(e)===20)e.pos++;return{type:"Brackets",children:l,loc:e.positions?A(e,r,a):null}}case 3:case 23:case 24:case 22:case 20:case 17:case 0:case 14:case 15:case 6:case 8:return e.pos++,{type:"Raw",value:i.slice(r,s),loc:e.positions?A(e,r,s):null}}return e.pos++,null}function rt(e){return e===32||e===9||e===10||e===12||e===13}function Pn(e){return e===47||e===43||e===45||e===42||e===61||e===62||e===60||e===126||e===124||e===36||e===94||e===33||e===38}function ae(e,t,n){for(let r=t;r<n;r++){let s=e.charCodeAt(r);if(s>=65&&s<=90)return e.slice(t,n).toLowerCase()}return e.slice(t,n)}function A(e,t,n){let r=e.tokenizer.locate(t),s=e.tokenizer.locate(n);return{source:e.filename??"<unknown>",start:{offset:t,line:r.line,column:r.column},end:{offset:n,line:s.line,column:s.column}}}function Rn(e){let t=g(e),n=ae(e.source,t.start,t.end-1),r=N();while(m(e)!==0&&m(e)!==22){let s=H(e);if(s)r.appendData(s)}if(m(e)===22)g(e);if(n==="url"){for(let s=r.head;s!=null;s=s.next)if(s.data.type==="String")return{type:"Url",value:s.data.value,loc:y(e,t,f(e))}}return{type:"Function",name:n,children:r,loc:y(e,t,f(e))}}function _n(e){let t=g(e),n=N();while(m(e)!==0&&m(e)!==22){let r=H(e);if(r)n.appendData(r)}if(m(e)===22)g(e);return{type:"Parentheses",children:n,loc:y(e,t,f(e))}}function Ee(e){let t=f(e),n=N();while(m(e)!==0){if(R(e),m(e)===0||m(e)===23)break;let r=ut(e);if(r.children.head!==null)n.appendData(r);if(R(e),m(e)===18){g(e);continue}break}return{type:"SelectorList",children:n,loc:y(e,t,f(e))}}function ut(e){let t=f(e),n=N(),r=!0;while(m(e)!==0&&m(e)!==18&&m(e)!==23){let s=f(e);if(s.type===13){if(g(e),!r&&m(e)!==0&&m(e)!==18&&m(e)!==23&&!st(e)&&!Bn(e)){let l={type:"Combinator",name:" ",loc:y(e,s,s)};n.appendData(l),r=!0}continue}if(s.type===9&&e.source.charCodeAt(s.start)===124&&e.types[e.pos+1]===9&&e.source.charCodeAt(e.starts[e.pos+1])===124){let l=f(e);g(e);let a=g(e),o={type:"Combinator",name:"||",loc:y(e,l,a)};n.appendData(o),r=!0,R(e);continue}if(st(e)){let l=g(e),o={type:"Combinator",name:e.source[l.start],loc:y(e,l,l)};n.appendData(o),r=!0,R(e);continue}let i=Dn(e);if(!i)break;n.appendData(i),r=!1}while(n.tail&&n.tail.data.type==="Combinator")n.remove(n.tail);return{type:"Selector",children:n,loc:y(e,t,f(e))}}function st(e){let t=f(e);if(t.type!==9)return!1;let n=e.source[t.start];return n===">"||n==="+"||n==="~"}function Bn(e){if(e.types[e.pos]!==9)return!1;if(e.source.charCodeAt(e.starts[e.pos])!==124)return!1;if(e.types[e.pos+1]!==9)return!1;return e.source.charCodeAt(e.starts[e.pos+1])===124}function Dn(e){let t=f(e);switch(t.type){case 1:{if(g(e),m(e)===9&&e.source[f(e).start]==="|"&&e.source[f(e).start+1]!=="="&&!(e.types[e.pos+1]===9&&e.source.charCodeAt(e.starts[e.pos+1])===124)){if(g(e),m(e)===1){let r=g(e);return{type:"TypeSelector",name:`${D(e,t)}|${D(e,r)}`,loc:y(e,t,r)}}if(m(e)===9&&e.source[f(e).start]==="*"){let r=g(e);return{type:"TypeSelector",name:`${D(e,t)}|*`,loc:y(e,t,r)}}}return{type:"TypeSelector",name:D(e,t),loc:y(e,t,t)}}case 11:return g(e),{type:"TypeSelector",name:D(e,t),loc:y(e,t,t)};case 10:return g(e),{type:"TypeSelector",name:D(e,t),loc:y(e,t,t)};case 9:{let n=e.source[t.start];if(n==="*")return g(e),{type:"TypeSelector",name:"*",loc:y(e,t,t)};if(n==="."){if(g(e),m(e)===1){let r=g(e);return{type:"ClassSelector",name:D(e,r),loc:y(e,t,r)}}return null}if(n==="&")return g(e),{type:"NestingSelector",loc:y(e,t,t)};return g(e),null}case 4:return g(e),{type:"IdSelector",name:e.source.slice(t.start+1,t.end),loc:y(e,t,t)};case 16:{g(e);let n=m(e)===16;if(n)g(e);return Mn(e,n,t)}case 19:return Vn(e)}return null}function Mn(e,t,n){let r=f(e);if(r.type===1){g(e);let s=ae(e.source,r.start,r.end);return t?{type:"PseudoElementSelector",name:s,children:null,loc:y(e,n,r)}:{type:"PseudoClassSelector",name:s,children:null,loc:y(e,n,r)}}if(r.type===2){g(e);let s=ae(e.source,r.start,r.end-1),i=N();if(!t&&Tn.has(s)){let o=f(e),c=o,h=1;while(m(e)!==0&&h>0){if(m(e)===21||m(e)===2)h++;else if(m(e)===22){if(h--,h===0)break}c=g(e)}if(m(e)===22)g(e);let u=e.source.slice(o.start,c.end).trim();if(u.length>0){let d=it(u,{positions:!1}),b=Ee(d);i.appendData(b)}}else{while(m(e)!==0&&m(e)!==22){let o=H(e);if(o)i.appendData(o)}if(m(e)===22)g(e)}if(t)return{type:"PseudoElementSelector",name:s,children:i,loc:y(e,n,f(e))};return{type:"PseudoClassSelector",name:s,children:i,loc:y(e,n,f(e))}}return null}function Vn(e){let t=g(e);R(e);let n=f(e);if(n.type!==1)return null;g(e);let r={type:"Identifier",name:D(e,n),loc:y(e,n,n)};R(e);let s=null,i=null,l=null,a=f(e);if(a.type===9){let c=e.source[a.start],h=e.source[a.start+1];if(c==="=")s="=",g(e);else if((c==="~"||c==="|"||c==="^"||c==="$"||c==="*")&&h==="="){g(e);let b=f(e);if(b.type===9&&e.source[b.start]==="=")g(e),s=`${c}=`}R(e);let u=f(e);if(u.type===5){g(e);let b=u.end-u.start>=2&&e.source.charCodeAt(u.end-1)===e.source.charCodeAt(u.start);i={type:"String",value:xe(e.source,u.start+1,b?u.end-1:u.end),loc:y(e,u,u)}}else if(u.type===1)g(e),i={type:"Identifier",name:D(e,u),loc:y(e,u,u)};R(e);let d=f(e);if(d.type===1)g(e),l=D(e,d)}R(e);let o=f(e);if(m(e)===20)o=g(e);return{type:"AttributeSelector",name:r,matcher:s,value:i,flags:l,loc:y(e,t,o)}}var ht=Symbol("walkSkip"),x=Symbol("walkStop");function jn(e){return{root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null}}function Wn(e,t){let n=jn(e),r=typeof t==="function"?t:t.enter,s=typeof t==="function"?null:t.leave??null,i=typeof t==="function"?null:t.visit??null,l=typeof t==="function"?!1:t.reverse??!1;function a(o,c,h){let u=null,d;switch(o.type){case"StyleSheet":u="stylesheet",d=n.stylesheet,n.stylesheet=o;break;case"Atrule":u="atrule",d=n.atrule,n.atrule=o;break;case"AtrulePrelude":u="atrulePrelude",d=n.atrulePrelude,n.atrulePrelude=o;break;case"Rule":u="rule",d=n.rule,n.rule=o;break;case"Selector":u="selector",d=n.selector,n.selector=o;break;case"Block":u="block",d=n.block,n.block=o;break;case"Declaration":u="declaration",d=n.declaration,n.declaration=o;break;case"Function":u="function",d=n.function,n.function=o;break}let b;if((i===null||i===o.type)&&r){let p=r.call(n,o,c,h);if(p===ht){if(u)n[u]=d;return}if(p===x){if(u)n[u]=d;return x}}if(b=Fn(o,l,a),b===x){if(u)n[u]=d;return x}if((i===null||i===o.type)&&s){if(s.call(n,o,c,h)===x){if(u)n[u]=d;return x}}if(u)n[u]=d;return}return a(e,null,null)}var q=Object.assign(Wn,{skip:ht,stop:x});function Fn(e,t,n){if("children"in e&&e.children instanceof L)return Un(e.children,t,n);if(e.type==="Rule"){if(n(e.prelude,null,null)===x)return x;if(n(e.block,null,null)===x)return x;return}if(e.type==="Atrule"){if(e.prelude){if(n(e.prelude,null,null)===x)return x}if(e.block){if(n(e.block,null,null)===x)return x}return}if(e.type==="Declaration")return n(e.value,null,null);if(e.type==="AttributeSelector"){if(n(e.name,null,null)===x)return x;if(e.value)return n(e.value,null,null);return}return}function Un(e,t,n){let r;if(t)e.forEachRight((s,i,l)=>{if(r)return;if(n(s,i,l)===x)r=x});else e.forEach((s,i,l)=>{if(r)return;if(n(s,i,l)===x)r=x});return r}function Y(e,t={}){let n=t.exclamation??!1,r=!1;q(e,(s,i,l)=>{if(s.type!=="Comment")return;let a=s.value.startsWith("!");if(n===!0&&a)return;if(n==="first-exclamation"&&a&&!r){r=!0;return}if(i&&l)l.remove(i)})}function ce(e){q(e,(t)=>{if(t.type!=="Block"&&t.type!=="DeclarationList")return;if(!("children"in t)||!t.children)return;let n=t.children,r=n.head;if(r==null||r.next==null)return;let s=0;for(let a=r;a!=null;a=a.next)if(a.data.type==="Declaration"){if(s++,s>=2)break}if(s<2)return;let i=new Map,l=[];for(let a=r;a!=null;a=a.next){let o=a.data;if(o.type!=="Declaration")continue;let c=o.property,h=i.get(c);if(h){let u=!!h.decl.important,d=!!o.important;if(d||u===d)l.push(h.item),i.set(c,{item:a,decl:o});else l.push(a)}else i.set(c,{item:a,decl:o})}for(let a of l)n.remove(a)})}var zn={black:"#000",fuchsia:"#f0f",white:"#fff",red:"#f00",cyan:"#0ff",blue:"#00f",yellow:"#ff0",magenta:"#f0f",lime:"#0f0",silver:"#c0c0c0",gray:"#808080",maroon:"#800000",olive:"#808000",green:"#008000",purple:"#800080",teal:"#008080",navy:"#000080"},Hn={"#f00":"red","#ff0000":"red","#000080":"navy","#008080":"teal"};function Le(e){if(!e.startsWith("#"))return e;let t=e.slice(1);if(t.length===6){if(t[0]===t[1]&&t[2]===t[3]&&t[4]===t[5])return`#${t[0]}${t[2]}${t[4]}`}if(t.length===8){if(t[0]===t[1]&&t[2]===t[3]&&t[4]===t[5]&&t[6]===t[7])return`#${t[0]}${t[2]}${t[4]}${t[6]}`}return e}function dt(e){let t=e.toLowerCase();return zn[t]??null}function mt(e){let t=e.toLowerCase();return Hn[t]??null}function qn(e,t,n){let r=(e<<16|t<<8|n).toString(16).padStart(6,"0");return Le(`#${r}`)}var Gn=/^rgba?\(\s*([+-]?\d*\.?\d+%?)\s*[,\s]\s*([+-]?\d*\.?\d+%?)\s*[,\s]\s*([+-]?\d*\.?\d+%?)\s*(?:[,/]\s*([+-]?\d*\.?\d+%?)\s*)?\)$/;function ft(e){let t=Gn.exec(e.trim());if(!t)return e;let n=Oe(t[1]),r=Oe(t[2]),s=Oe(t[3]);if(t[4]!==void 0&&!Kn(t[4]))return e;return qn(n,r,s)}function Kn(e){if(e.endsWith("%"))return Number.parseFloat(e)>=100;return Number.parseFloat(e)>=1}function Oe(e){if(e.endsWith("%"))return Math.max(0,Math.min(255,Math.round(Number.parseFloat(e)*2.55)));return Math.max(0,Math.min(255,Math.round(Number.parseFloat(e))))}var Yn=new Set(["px","pt","pc","in","cm","mm","q","em","rem","ex","ch","cap","ic","lh","rlh","vw","vh","vi","vb","vmin","vmax","svw","svh","svi","svb","svmin","svmax","lvw","lvh","lvi","lvb","lvmin","lvmax","dvw","dvh","dvi","dvb","dvmin","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"]);function ue(e){if(e.charCodeAt(0)===43)e=e.slice(1);if(e.includes(".")){let t=e.replace(/(\.\d*?)0+($|[eE])/,"$1$2");t=t.replace(/\.($|[eE])/,"$1"),e=t}if(e.startsWith("0.")&&e.length>2)e=e.slice(1);else if(e.startsWith("-0.")&&e.length>3)e=`-${e.slice(2)}`;if(e==="-0"||e==="-.0"||e==="-0.0")e="0";return e}function pt(e,t){let n=ue(e);if((n==="0"||n==="-0")&&Yn.has(t.toLowerCase()))return{value:"0",unit:""};return{value:n,unit:t}}function gt(e){return ue(e)}function yt(e,t){let n=Number.parseFloat(e);if(!Number.isFinite(n))return e;let r=t<0?0:t;return n.toFixed(r)}var bt=new Set(["color","background","background-color","border","border-color","border-top","border-top-color","border-right","border-right-color","border-bottom","border-bottom-color","border-left","border-left-color","border-block","border-block-color","border-block-start-color","border-block-end-color","border-inline","border-inline-color","border-inline-start-color","border-inline-end-color","outline","outline-color","caret-color","fill","stroke","flood-color","lighting-color","stop-color","column-rule","column-rule-color","text-decoration","text-decoration-color","text-emphasis","text-emphasis-color","text-shadow","box-shadow","accent-color","scrollbar-color"]);function Ct(e){if(!e||e.type!=="Operator")return!1;let t=e.value;return t===":"||t===","||t==="/"}function Qn(e){let t=e.children;if(!t)return;while(t.head&&t.head.data.type==="WhiteSpace")t.remove(t.head);while(t.tail&&t.tail.data.type==="WhiteSpace")t.remove(t.tail);let n=t.head;while(n){let r=n.next;if(n.data.type==="WhiteSpace"){let s=n.prev&&Ct(n.prev.data),i=r&&Ct(r.data);if(s||i)t.remove(n)}n=r}}function Pe(e,t={}){let n=t.floatPrecision??null,r=n===null?null:(s)=>yt(s,n);q(e,{enter(s,i,l){switch(s.type){case"Number":{let a=r?r(s.value):s.value;s.value=ue(a);return}case"Percentage":{let a=r?r(s.value):s.value;s.value=gt(a);return}case"Dimension":{let a=r?r(s.value):s.value,o=pt(a,s.unit);s.value=o.value,s.unit=o.unit;return}case"Hash":{let a=Le(`#${s.name}`).slice(1);if(s.name=a,i&&l&&this.declaration&&bt.has(this.declaration.property.toLowerCase())){let o=mt(`#${a}`);if(o&&o.length<a.length+1){let c={type:"Identifier",name:o,loc:s.loc};l.replace(i,l.createItem(c))}}return}case"Identifier":{if(!i||!l||!this.declaration)return;if(!bt.has(this.declaration.property.toLowerCase()))return;let a=dt(s.name);if(a&&a.length<s.name.length){let o={type:"Hash",name:a.slice(1),loc:s.loc};l.replace(i,l.createItem(o))}return}case"Url":return;case"Function":{let a=s.name.toLowerCase();if((a==="rgb"||a==="rgba")&&i&&l)s.__rgbReplaceCandidate=!0}}},leave(s,i,l){if(s.type==="Parentheses"||s.type==="Function"||s.type==="Value")Qn(s);if(s.type==="Function"&&s.__rgbReplaceCandidate&&i&&l){let a=k(s),o=ft(a);if(o!==a&&o.startsWith("#")){let c={type:"Hash",name:o.slice(1),loc:s.loc};l.replace(i,l.createItem(c))}}}})}function Re(e,t={}){let n=z(e,{context:"stylesheet"});return vt(n,t)}function _e(e,t={}){let n=z(e,{context:"declarationList"});return vt(n,t)}function vt(e,t){if(t.comments===!1)Y(e,{exclamation:!1});else if(t.comments==="first-exclamation")Y(e,{exclamation:"first-exclamation"});else Y(e,{exclamation:!0});return Pe(e,{floatPrecision:t.floatPrecision??null}),ce(e),{css:k(e),ast:e}}var Be="0.3.14";function De(e){if(!er(e))process.stderr.write(`ts-css: file not found: ${e}
|
|
32
|
+
`),V.exit(e.exitCode??2)}async runMatchedCommand(){let{args:e,options:t,matchedCommand:n}=this;if(!n||!n.commandAction)return;n.checkUnknownOptions(),n.checkOptionValue(),n.checkRequiredArgs();let r=[];n.args.forEach((a,o)=>{if(a.variadic)r.push(e.slice(o));else r.push(e[o])}),r.push(t);let s={command:n,args:r,options:t};for(let a of n.beforeHooks)await a(s);let i,l=async()=>{let a=n.commandAction.apply(this,r);if(a instanceof Promise)i=await a;else i=a;return i};if(n.middleware.length>0){let a=0,o=async()=>{if(a<n.middleware.length){let c=n.middleware[a++];await c({...s,next:o})}else await l()};await o()}else await l();for(let a of n.afterHooks)await a(s);return i}removeSignalHandlers(){if(!this.signalHandlersSet)return this;return V.removeAllListeners("SIGINT"),V.removeAllListeners("SIGTERM"),this.signalHandlersSet=!1,this}destroy(){this.removeSignalHandlers(),this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.matchedCommand=void 0,this.matchedCommandName=void 0,this.removeAllListeners()}}class Ke{cache;enabled;cleanupInterval=null;hits=0;misses=0;constructor(){this.cache=new Map,this.enabled=!0,this.startCleanupInterval()}startCleanupInterval(){if(this.cleanupInterval)return;this.cleanupInterval=setInterval(()=>{this.cleanup()},30000),this.cleanupInterval.unref()}stopCleanup(){if(this.cleanupInterval)clearInterval(this.cleanupInterval),this.cleanupInterval=null}isEnabled(){return this.enabled}get(e){if(!this.enabled){this.misses++;return}let t=this.cache.get(e);if(!t){this.misses++;return}if(Date.now()-t.timestamp>t.ttl){this.cache.delete(e),this.misses++;return}return this.hits++,t.value}set(e,t,n=5000){if(!this.enabled)return;this.cache.set(e,{value:t,timestamp:Date.now(),ttl:n})}has(e){if(!this.enabled)return!1;let t=this.cache.get(e);if(!t)return!1;if(Date.now()-t.timestamp>t.ttl)return this.cache.delete(e),!1;return!0}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}disable(){this.enabled=!1,this.clear()}enable(){this.enabled=!0}stats(){return{size:this.cache.size,enabled:this.enabled,hits:this.hits,misses:this.misses}}resetStats(){this.hits=0,this.misses=0}keys(){return Array.from(this.cache.keys())}cleanup(){let e=Date.now();for(let[t,n]of this.cache.entries())if(e-n.timestamp>n.ttl)this.cache.delete(t)}destroy(){this.stopCleanup(),this.clear(),this.resetStats()}}var hr=new Ke;function Bt(){if("FORCE_COLOR"in X.env)return X.env.FORCE_COLOR!=="0";if("NO_COLOR"in X.env||X.env.TERM==="dumb")return!1;if(X.platform==="win32")return!0;return ze.isatty(1)&&ze.isatty(2)}var Ye=Bt();function v(e,t){if(!Ye)return(n)=>n;return(n)=>e+n+t}var Dt=v("\x1B[0m","\x1B[0m"),Mt=v("\x1B[31m","\x1B[39m"),Vt=v("\x1B[32m","\x1B[39m"),jt=v("\x1B[33m","\x1B[39m"),Wt=v("\x1B[34m","\x1B[39m"),Ft=v("\x1B[35m","\x1B[39m"),Ut=v("\x1B[36m","\x1B[39m"),zt=v("\x1B[37m","\x1B[39m"),Ht=v("\x1B[90m","\x1B[39m"),qt=v("\x1B[1m","\x1B[22m"),Gt=v("\x1B[3m","\x1B[23m"),Kt=v("\x1B[4m","\x1B[24m"),Yt=v("\x1B[2m","\x1B[22m"),Qt=v("\x1B[7m","\x1B[27m"),Jt=v("\x1B[8m","\x1B[28m"),Xt=v("\x1B[9m","\x1B[29m"),Zt=v("\x1B[41m","\x1B[49m"),en=v("\x1B[42m","\x1B[49m"),tn=v("\x1B[43m","\x1B[49m"),nn=v("\x1B[44m","\x1B[49m"),rn=v("\x1B[45m","\x1B[49m"),sn=v("\x1B[46m","\x1B[49m"),on=v("\x1B[47m","\x1B[49m"),an=Ye,ln={reset:Dt,red:Mt,green:Vt,yellow:jt,blue:Wt,magenta:Ft,cyan:Ut,white:zt,gray:Ht,bold:qt,italic:Gt,underline:Kt,dim:Yt,inverse:Qt,hidden:Jt,strikethrough:Xt,bgRed:Zt,bgGreen:en,bgYellow:tn,bgBlue:nn,bgMagenta:rn,bgCyan:sn,bgWhite:on,isColorSupported:an},cn=ln,hn=["up","down","left","right","space","enter","cancel"],yr={actions:new Set(hn),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};var br=un.platform.startsWith("win"),Cr=Symbol("clapp:cancel");var dn=Nt();var C=(e,t)=>dn?e:t,vr=C("\u25C6","*"),wr=C("\u25A0","x"),$r=C("\u25B2","x"),xr=C("\u25C7","o"),Sr=C("\u250C","T"),mn=C("\u2502","|"),kr=C("\u2514","\u2014"),Tr=C("\u25CF",">"),Ar=C("\u25CB"," "),Nr=C("\u25FB","[\u2022]"),Ir=C("\u25FC","[+]"),Er=C("\u25FB","[ ]"),Or=C("\u25AA","\u2022"),Lr=C("\u2500","-"),Pr=C("\u256E","+"),Rr=C("\u251C","+"),_r=C("\u256F","+"),Br=C("\u25CF","\u2022"),Dr=C("\u25C6","*"),Mr=C("\u25B2","!"),Vr=C("\u25A0","x");var jr={light:C("\u2500","-"),heavy:C("\u2501","="),block:C("\u2588","#")};function fn(){return`${cn.gray(mn)} `}var Wr=fn();class Qe{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let e=He.homedir(),t=fe.join(e,".config","clapp");this.configPath=fe.join(t,"telemetry.json")}async isEnabled(){if(W.env.DO_NOT_TRACK==="1"||W.env.DO_NOT_TRACK==="true")return!1;if(W.env.NO_TELEMETRY==="1"||W.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let e=await this.loadConfig();if(e.enabled=!0,!e.userId)e.userId=this.generateUserId();await this.saveConfig(e)}async disable(){let e=await this.loadConfig();e.enabled=!1,await this.saveConfig(e)}async track(e,t){if(!await this.isEnabled())return;let r={event:e,...t,timestamp:Date.now(),platform:He.platform(),nodeVersion:W.version};if(this.events.push(r),this.events.length>=10)await this.send()}async trackCommand(e,t){await this.track("command",{command:e,duration:t})}async trackError(e,t){await this.track("error",{error:e,command:t})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let t=await this.loadConfig();return t.lastSent=Date.now(),await this.saveConfig(t),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let t=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep(t),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep(e){return new Promise((t)=>setTimeout(t,e))}async status(){let e=await this.loadConfig();return{enabled:e.enabled,doNotTrack:W.env.DO_NOT_TRACK==="1"||W.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:e.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(pn(this.configPath)){let e=await me.readFile(this.configPath,"utf-8");return this.config=JSON.parse(e),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig(e){this.config=e;try{let t=fe.dirname(this.configPath);await me.mkdir(t,{recursive:!0}),await me.writeFile(this.configPath,JSON.stringify(e,null,2),"utf-8")}catch{}}generateUserId(){let e=Math.random().toString(36).substring(2,15),t=Date.now().toString(36);return`${e}-${t}`}}var Gr=new Qe;import{existsSync as er,readFileSync as tr}from"fs";function B(e){return{prev:null,next:null,data:e}}class L{head=null;tail=null;cursors=[];allocateCursor(e,t){let n={prev:e,next:t};return this.cursors.push(n),n}releaseCursor(){this.cursors.pop()}updateCursors(e,t,n,r){for(let s of this.cursors){if(s.prev===e)s.prev=t;if(s.next===n)s.next=r}}static createItem(e){return B(e)}createItem(e){return B(e)}get isEmpty(){return this.head===null}get first(){return this.head?.data??null}get last(){return this.tail?.data??null}*[Symbol.iterator](){for(let e=this.head;e!=null;e=e.next)yield e.data}fromArray(e){let t=null;this.head=null;for(let n of e){let r=B(n);if(r.prev=t,t)t.next=r;else this.head=r;t=r}return this.tail=t,this}toArray(){let e=[];for(let t=this.head;t!=null;t=t.next)e.push(t.data);return e}toJSON(){return this.toArray()}forEach(e,t){let n=this.allocateCursor(null,this.head);while(n.next!==null){let r=n.next;n.prev=r,n.next=r.next,e.call(t,r.data,r,this)}this.releaseCursor()}forEachRight(e,t){let n=this.allocateCursor(this.tail,null);while(n.prev!==null){let r=n.prev;n.next=r,n.prev=r.prev,e.call(t,r.data,r,this)}this.releaseCursor()}reduce(e,t){let n=t,r=0;for(let s=this.head;s!=null;s=s.next)n=e(n,s.data,r++,this);return n}some(e){let t=0;for(let n=this.head;n!=null;n=n.next)if(e(n.data,t++,this))return!0;return!1}map(e){let t=new L,n=null,r=0;for(let s=this.head;s!=null;s=s.next){let i=B(e(s.data,r++,this));if(i.prev=n,n)n.next=i;else t.head=i;n=i}return t.tail=n,t}filter(e){let t=new L,n=null,r=0;for(let s=this.head;s!=null;s=s.next)if(e(s.data,r++,this)){let i=B(s.data);if(i.prev=n,n)n.next=i;else t.head=i;n=i}return t.tail=n,t}clear(){let e=this.head;while(e){let t=e.next;e.prev=null,e.next=null,e=t}this.head=null,this.tail=null}copy(){let e=new L,t=null;for(let n=this.head;n!=null;n=n.next){let r=B(n.data);if(r.prev=t,t)t.next=r;else e.head=r;t=r}return e.tail=t,e}prepend(e){return this.insert(e,this.head)}prependData(e){return this.insert(B(e),this.head)}append(e){return this.insert(e,null)}appendData(e){return this.insert(B(e),null)}insert(e,t=null){if(t!=null)if(this.updateCursors(t.prev,e,t,e),t.prev===null){if(this.head!==t)throw Error("before doesn't belong to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e,null,null)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else if(this.updateCursors(this.tail,e,null,e),this.tail!==null)this.tail.next=e,e.prev=this.tail,this.tail=e;else this.head=e,this.tail=e;return this}insertData(e,t=null){return this.insert(B(e),t)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),e.prev!==null)e.prev.next=e.next;else if(this.head===e)this.head=e.next;else throw Error("item doesn't belong to list");if(e.next!==null)e.next.prev=e.prev;else if(this.tail===e)this.tail=e.prev;else throw Error("item doesn't belong to list");return e.prev=null,e.next=null,e}push(e){this.insert(B(e),null)}pop(){if(this.tail===null)return null;return this.remove(this.tail)}unshift(e){this.prependData(e)}shift(){if(this.head===null)return null;return this.remove(this.head)}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e,null)}insertList(e,t=null){if(e.head===null)return this;if(t!==null){if(this.updateCursors(t.prev,e.tail,t,e.head),t.prev!==null)t.prev.next=e.head,e.head.prev=t.prev;else this.head=e.head;t.prev=e.tail,e.tail.next=t}else{if(this.updateCursors(this.tail,e.tail,null,e.head),this.tail!==null)this.tail.next=e.head,e.head.prev=this.tail;else this.head=e.head;this.tail=e.tail}return e.head=null,e.tail=null,this}replace(e,t){if(t instanceof L)this.insertList(t,e),this.remove(e);else this.insert(t,e),this.remove(e)}}function k(e){switch(e.type){case"StyleSheet":return O(e.children,"");case"Rule":return`${k(e.prelude)}{${k(e.block)}}`;case"Block":return gn(e.children);case"Atrule":{let t=`@${e.name}`;if(e.prelude){let n=k(e.prelude);if(n)t+=` ${n}`}if(e.block)t+=`{${k(e.block)}}`;else t+=";";return t}case"AtrulePrelude":return O(e.children,"");case"SelectorList":return O(e.children,",");case"Selector":return O(e.children,"");case"TypeSelector":return e.name;case"IdSelector":return`#${e.name}`;case"ClassSelector":return`.${e.name}`;case"NestingSelector":return"&";case"AttributeSelector":{let t=`[${e.name.name}`;if(e.matcher&&e.value)if(t+=e.matcher,e.value.type==="String")t+=`"${ve(e.value.value)}"`;else t+=e.value.name;if(e.flags)t+=` ${e.flags}`;return t+="]",t}case"PseudoClassSelector":return e.children?`:${e.name}(${O(e.children,"")})`:`:${e.name}`;case"PseudoElementSelector":return e.children?`::${e.name}(${O(e.children,"")})`:`::${e.name}`;case"Combinator":return e.name===" "?" ":e.name;case"Declaration":return`${e.property}:${k(e.value)}${e.important?"!important":""}`;case"DeclarationList":return O(e.children,";");case"Value":return O(e.children,"");case"Identifier":return e.name;case"Number":return e.value;case"Percentage":return`${e.value}%`;case"Dimension":return e.value+e.unit;case"String":return`"${ve(e.value)}"`;case"Url":return/[\s"'()\\\u0000-\u001F\u007F]/.test(e.value)?`url("${ve(e.value)}")`:`url(${e.value})`;case"Hash":return`#${e.name}`;case"Operator":return e.value;case"Function":return`${e.name}(${O(e.children,"")})`;case"Parentheses":return`(${O(e.children,"")})`;case"Brackets":return`[${O(e.children,"")}]`;case"Raw":return e.value;case"Comment":return e.value.startsWith("!")?`/*${e.value}*/`:"";case"WhiteSpace":return" ";case"CDO":return"<!--";case"CDC":return"-->";case"AnPlusB":{let t=e.a??"",n=e.b??"";if(t&&n){let r=Number(n);return`${t==="1"?"":t==="-1"?"-":t}n${r>=0?`+${n}`:n}`}if(t)return`${t==="1"?"":t==="-1"?"-":t}n`;return n}case"Ratio":return`${e.left.value}/${e.right.value}`;case"UnicodeRange":return e.value;case"Nth":return e.selector?`${k(e.nth)} of ${k(e.selector)}`:k(e.nth);case"MediaQueryList":return O(e.children,",");case"MediaQuery":return O(e.children,"");case"MediaFeature":{let t=`(${e.name}`;if(e.value)t+=`:${k(e.value)}`;return t+=")",t}}return""}function O(e,t){let n="",r=!0,s=null,i=e.head;while(i!=null){let l=i.data;if(l.type==="WhiteSpace"){let o=i.next?i.next.data:null;if(Je(s)||Je(o)){i=i.next;continue}}let a=k(l);if(!a){i=i.next;continue}if(!r&&t&&!bn(s))n+=t;r=!1,n+=a,s=l,i=i.next}return n}function gn(e){let t="",n=null,r=e.head;while(r!=null){let s=r.data,i=k(s);if(!i){r=r.next;continue}if(n&&yn(n,s))t+=";";t+=i,n=s,r=r.next}return t}function yn(e,t){return e.type==="Declaration"&&t.type!=="Comment"}function Je(e){if(!e||e.type!=="Operator")return!1;let t=e.value;return t===":"||t===","||t==="/"}function bn(e){if(!e)return!1;return e.type==="Operator"||e.type==="Combinator"}function ve(e){let t="";for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===92)t+="\\\\";else if(r===34)t+="\\\"";else if(r<32||r===127){let s=r.toString(16),i=n+1<e.length?e.charCodeAt(n+1):-1,l=i===32||i===9||i===10||i===12||i===13||i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102;t+=`\\${s}${l?" ":""}`}else t+=e[n]}return t}var U=(()=>{let e=new Uint8Array(128);for(let t=0;t<128;t++){let n=0;if(t===32||t===9||t===10||t===12||t===13)n|=1;if(t>=48&&t<=57)n|=2;if(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)n|=4;if(t>=65&&t<=90||t>=97&&t<=122||t===95)n|=8;if(t===10||t===12||t===13)n|=16;e[t]=n}return e})();function P(e){return e<128&&(U[e]&2)!==0}function te(e){return e<128&&(U[e]&4)!==0}function Xe(e){return e>=128||e<128&&(U[e]&8)!==0}function Cn(e){return e===45||e>=128||e<128&&(U[e]&10)!==0}function vn(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function $e(e){return e<128&&(U[e]&16)!==0}function M(e){return e<128&&(U[e]&1)!==0}function F(e,t){if(e!==92)return!1;if($e(t))return!1;return!0}function we(e,t,n){if(e===45)return Xe(t)||t===45||F(t,n);if(Xe(e))return!0;if(e===92)return F(e,t);return!1}function wn(e,t,n){if(e===43||e===45){if(P(t))return!0;if(t===46&&P(n))return!0;return!1}if(e===46)return P(t);return P(e)}class ie{source;offset=0;types;starts;ends;count=0;_tokens=null;_lineStarts=null;constructor(e){this.source=e;let t=Math.max(64,Math.ceil(e.length/3));this.types=new Uint8Array(t),this.starts=new Uint32Array(t),this.ends=new Uint32Array(t),this.tokenize()}get lineStarts(){if(this._lineStarts==null)this._lineStarts=$n(this.source);return this._lineStarts}get tokens(){if(this._tokens!=null)return this._tokens;let e=Array.from({length:this.count});for(let t=0;t<this.count;t++)e[t]={type:this.types[t],start:this.starts[t],end:this.ends[t]};return this._tokens=e,e}addToken(e,t,n){if(this.count>=this.types.length)this.grow();this.types[this.count]=e,this.starts[this.count]=t,this.ends[this.count]=n,this.count++}grow(){let t=this.types.length*2,n=new Uint8Array(t);n.set(this.types),this.types=n;let r=new Uint32Array(t);r.set(this.starts),this.starts=r;let s=new Uint32Array(t);s.set(this.ends),this.ends=s}tokenize(){let e=this.source,t=0,n=e.length;while(t<n){let r=e.charCodeAt(t);if(r===47&&e.charCodeAt(t+1)===42){let l=t;t+=2;while(t<n&&!(e.charCodeAt(t)===42&&e.charCodeAt(t+1)===47))t++;t=t<n?t+2:n,this.addToken(25,l,t);continue}if(M(r)){let l=t;while(t<n&&M(e.charCodeAt(t)))t++;this.addToken(13,l,t);continue}if(r===34||r===39){t=this.consumeString(r,t);continue}if(r===35){if(t+1<n&&(Cn(e.charCodeAt(t+1))||F(e.charCodeAt(t+1),e.charCodeAt(t+2)))){let l=t;t++,t=this.consumeName(t),this.addToken(4,l,t);continue}this.addToken(9,t,t+1),t++;continue}switch(r){case 40:this.addToken(21,t,t+1),t++;continue;case 41:this.addToken(22,t,t+1),t++;continue;case 91:this.addToken(19,t,t+1),t++;continue;case 93:this.addToken(20,t,t+1),t++;continue;case 123:this.addToken(23,t,t+1),t++;continue;case 125:this.addToken(24,t,t+1),t++;continue;case 44:this.addToken(18,t,t+1),t++;continue;case 58:this.addToken(16,t,t+1),t++;continue;case 59:this.addToken(17,t,t+1),t++;continue}if(r===60&&e.startsWith("!--",t+1)){this.addToken(14,t,t+4),t+=4;continue}if(r===45&&e.startsWith("->",t+1)){this.addToken(15,t,t+3),t+=3;continue}if(r===64){let l=e.charCodeAt(t+1),a=e.charCodeAt(t+2),o=e.charCodeAt(t+3);if(we(l,a,o)){let c=t;t++,t=this.consumeName(t),this.addToken(3,c,t);continue}this.addToken(9,t,t+1),t++;continue}let s=e.charCodeAt(t+1),i=e.charCodeAt(t+2);if(wn(r,s,i)){t=this.consumeNumeric(t);continue}if(we(r,s,i)){t=this.consumeIdentLike(t);continue}if(r===92){if(F(r,s)){t=this.consumeIdentLike(t);continue}this.addToken(9,t,t+1),t++;continue}this.addToken(9,t,t+1),t++}this.addToken(0,n,n)}consumeString(e,t){let n=this.source,r=n.length,s=t+1;while(s<r){let i=n.charCodeAt(s);if(i===e)return s++,this.addToken(5,t,s),s;if($e(i))return this.addToken(6,t,s),s;if(i===92){let l=n.charCodeAt(s+1);if($e(l)){s+=2;continue}if(s+1<r){s=this.consumeEscapeSkip(s+1);continue}}s++}return this.addToken(5,t,s),s}consumeEscapeSkip(e){let t=this.source;if(e>=t.length)return e;let n=t.charCodeAt(e);if(te(n)){let r=1;e++;while(r<6&&e<t.length&&te(t.charCodeAt(e)))e++,r++;if(e<t.length&&M(t.charCodeAt(e)))e++;return e}return e+1}consumeName(e){let t=this.source,n=t.length,r=e;while(r<n){let s=t.charCodeAt(r);if(s<128&&(U[s]&10)!==0){r++;continue}if(s===45){r++;continue}if(s>=128){r++;continue}if(s===92&&F(s,t.charCodeAt(r+1))){r=this.consumeEscapeSkip(r+1);continue}break}return r}consumeNumber(e){let t=this.source,n=e;if(t.charCodeAt(n)===43||t.charCodeAt(n)===45)n++;while(n<t.length&&P(t.charCodeAt(n)))n++;if(t.charCodeAt(n)===46&&P(t.charCodeAt(n+1))){n+=2;while(n<t.length&&P(t.charCodeAt(n)))n++}let r=t.charCodeAt(n);if(r===69||r===101){let s=t.charCodeAt(n+1),i=t.charCodeAt(n+2);if(P(s)){n+=2;while(n<t.length&&P(t.charCodeAt(n)))n++}else if((s===43||s===45)&&P(i)){n+=3;while(n<t.length&&P(t.charCodeAt(n)))n++}}return n}consumeNumeric(e){let t=this.source,n=this.consumeNumber(e),r=t.charCodeAt(n),s=t.charCodeAt(n+1),i=t.charCodeAt(n+2);if(we(r,s,i)){let l=this.consumeName(n);return this.addToken(12,e,l),l}if(r===37)return this.addToken(11,e,n+1),n+1;return this.addToken(10,e,n),n}consumeIdentLike(e){let t=this.source,n=this.consumeName(e),r=t.charCodeAt(n);if(r===40&&n-e===3){let s=t.charCodeAt(e)|32,i=t.charCodeAt(e+1)|32,l=t.charCodeAt(e+2)|32;if(s===117&&i===114&&l===108){let a=n+1;while(a<t.length&&M(t.charCodeAt(a)))a++;let o=t.charCodeAt(a);if(o===34||o===39)return this.addToken(2,e,n+1),n+1;return this.consumeUrl(e,n)}}if(r===40)return this.addToken(2,e,n+1),n+1;return this.addToken(1,e,n),n}consumeUrl(e,t){let n=this.source,r=n.length,s=t+1;while(s<r&&M(n.charCodeAt(s)))s++;while(s<r){let i=n.charCodeAt(s);if(i===41)return s++,this.addToken(7,e,s),s;if(M(i)){let l=s;while(s<r&&M(n.charCodeAt(s)))s++;if(s>=r)return this.addToken(7,e,s),s;if(n.charCodeAt(s)===41)return s++,this.addToken(7,e,s),s;return this.consumeBadUrl(e,l)}if(i===34||i===39||i===40||vn(i))return this.consumeBadUrl(e,s);if(i===92){if(F(i,n.charCodeAt(s+1))){s=this.consumeEscapeSkip(s+1);continue}return this.consumeBadUrl(e,s)}s++}return this.addToken(7,e,s),s}consumeBadUrl(e,t){let n=this.source,r=t;while(r<n.length){let s=n.charCodeAt(r);if(s===41){r++;break}if(s===92&&F(s,n.charCodeAt(r+1))){r=this.consumeEscapeSkip(r+1);continue}r++}return this.addToken(8,e,r),r}locate(e){let t=this.lineStarts,n=0,r=t.length-1;while(n<r){let i=n+r+1>>1;if(t[i]<=e)n=i;else r=i-1}let s=t[n];return{line:n+1,column:e-s+1}}}function $n(e){let t=[0],n=e.length;for(let r=0;r<n;r++){let s=e.charCodeAt(r);if(s===10)t.push(r+1);else if(s===13){if(e.charCodeAt(r+1)!==10)t.push(r+1)}}return t}function xe(e,t,n){for(let r=t;r<n;r++)if(e.charCodeAt(r)===92)return xn(e,t,n,r);return e.slice(t,n)}function xn(e,t,n,r){let s=e.slice(t,r),i=r;while(i<n){if(e.charCodeAt(i)!==92){s+=e[i],i++;continue}if(i+1>=n){i++;continue}let a=e.charCodeAt(i+1);if(a===10){i+=2;continue}if(a===13){i+=e.charCodeAt(i+2)===10?3:2;continue}if(te(a)){let o=i+1,c="";while(c.length<6&&o<n&&te(e.charCodeAt(o)))c+=e[o],o++;let h=Number.parseInt(c,16);if(o<n&&M(e.charCodeAt(o)))o++;s+=h===0||h>=55296&&h<=57343||h>1114111?String.fromCodePoint(65533):String.fromCodePoint(h),i=o;continue}s+=e[i+1],i+=2}return s}function Se(e,t,n){for(let r=t;r<n;r++)if(e.charCodeAt(r)===92)return Sn(e,t,n,r);return e.slice(t,n)}function Sn(e,t,n,r){let s=e.slice(t,r),i=r;while(i<n){if(e.charCodeAt(i)!==92){s+=e[i],i++;continue}let a=i+1,o="";while(o.length<6&&a<n&&te(e.charCodeAt(a)))o+=e[a],a++;if(o.length>0){let c=Number.parseInt(o,16);if(a<n&&M(e.charCodeAt(a)))a++;s+=c===0||c>=55296&&c<=57343||c>1114111?String.fromCodePoint(65533):String.fromCodePoint(c),i=a;continue}if(a<n){s+=e[a],i=a+1;continue}s+=String.fromCodePoint(65533),i=a}return s}function it(e,t){let n=new ie(e);return{source:e,types:n.types,starts:n.starts,ends:n.ends,count:n.count,end:n.count,pos:0,positions:t.positions??!1,filename:t.filename,parseValue:t.parseValue??!0,parseAtrulePrelude:t.parseAtrulePrelude??!0,parseCustomProperty:t.parseCustomProperty??!1,parseRulePrelude:t.parseRulePrelude??!0,onParseError:t.onParseError,tokenizer:n}}function m(e){return e.pos<e.end?e.types[e.pos]:0}function f(e){let t=e.pos;if(t>=e.end)return{type:0,start:e.starts[t]??e.source.length,end:e.ends[t]??e.source.length};return{type:e.types[t],start:e.starts[t],end:e.ends[t]}}function g(e){let t=e.pos++;if(t>=e.end)return{type:0,start:e.starts[t]??e.source.length,end:e.ends[t]??e.source.length};return{type:e.types[t],start:e.starts[t],end:e.ends[t]}}function D(e,t){return e.source.slice(t.start,t.end)}function R(e){let{types:t,end:n}=e;while(e.pos<n){let r=t[e.pos];if(r===13||r===25)e.pos++;else break}}function Ze(e){let{types:t,end:n}=e;while(e.pos<n&&t[e.pos]===13)e.pos++}function y(e,t,n){if(!e.positions)return null;let r=e.tokenizer.locate(t.start),s=e.tokenizer.locate(n.end);return{source:e.filename??"<unknown>",start:{offset:t.start,line:r.line,column:r.column},end:{offset:n.end,line:s.line,column:s.column}}}function ot(e){if(!e.positions)return null;let t=f(e),n=e.tokenizer.locate(t.start);return{source:e.filename??"<unknown>",start:{offset:t.start,line:n.line,column:n.column},end:{offset:t.start,line:n.line,column:n.column}}}function oe(e,t,n,r){return{type:"Raw",value:e,loc:y(r,t,n)}}function N(){return new L}function ke(e,t,n,r){if(e.onParseError){let{line:s,column:i}=e.tokenizer.locate(n.start),l=SyntaxError(`${e.filename??"<input>"}:${s}:${i}: ${t}`);l.line=s,l.column=i,l.offset=n.start,e.onParseError(l,r)}return r}function z(e,t={}){let n=it(e,t);switch(t.context??"stylesheet"){case"stylesheet":return nt(n);case"atrule":return le(n)??et(n);case"atrulePrelude":return Nn(n);case"mediaQuery":case"mediaQueryList":return tt(n);case"rule":return Ae(n);case"selectorList":return Ee(n);case"selector":return ut(n);case"block":return Ne(n);case"declarationList":return On(n);case"declaration":return Ie(n)??et(n);case"value":return Ln(n);case"raw":return tt(n);default:return nt(n)}}function et(e){return{type:"StyleSheet",children:N(),loc:ot(e)}}function tt(e){let t=f(e),n=t;while(m(e)!==0)n=g(e);return{type:"Raw",value:e.source.slice(t.start,n.end),loc:y(e,t,n)}}function nt(e){let t=f(e),n=N(),{types:r,end:s}=e;while(e.pos<s){let a=r[e.pos];if(a===13){e.pos++;continue}if(a===25){let h={type:25,start:e.starts[e.pos],end:e.ends[e.pos]},u=Te(e,h);e.pos++,n.appendData(u);continue}if(a===0)break;if(a===14||a===15){e.pos++;continue}if(a===3){let h=le(e);if(h)n.appendData(h);continue}if(a===24){e.pos++;continue}let o=e.pos,c=Ae(e);if(n.appendData(c),e.pos===o)e.pos++}let i=e.end-1,l=i>=0?{type:e.types[i],start:e.starts[i],end:e.ends[i]}:{type:0,start:0,end:0};return{type:"StyleSheet",children:n,loc:y(e,t,l)}}function Te(e,t){return{type:"Comment",value:e.source.slice(t.start+2,t.end-2),loc:y(e,t,t)}}function le(e){let t=f(e);if(t.type!==3)return null;e.pos++;let n=ae(e.source,t.start+1,t.end);R(e);let r=e.pos,s=f(e),{types:i,end:l}=e,a=r,o=r;while(a<l){let u=i[a];if(u===0||u===17||u===23)break;if(u!==13&&u!==25)o=a+1;a++}let c=null;if(o>r){let u=e.starts[r],d=e.ends[o-1],b={type:i[o-1],start:e.starts[o-1],end:d},p=e.source.slice(u,d).trim();if(p.length>0)if(e.parseAtrulePrelude)try{let _=e.end;e.end=o,e.pos=r;let T=N();while(m(e)!==0){let K=H(e);if(K)T.appendData(K)}if(lt(T),e.end=_,e.pos=a,T.isEmpty)c=oe(p,s,b,e);else c={type:"AtrulePrelude",children:T,loc:null}}catch(_){let T=oe(p,s,b,e);ke(e,`Failed to parse @${n} prelude: ${_.message}`,s,T),c=T,e.pos=a}else c=oe(p,s,b,e),e.pos=a;else e.pos=a}else e.pos=a;let h=null;if(m(e)===17)g(e);else if(m(e)===23)h=Ne(e,An.has(n));return{type:"Atrule",name:n,prelude:c,block:h,loc:y(e,t,f(e))}}var Tn=new Set(["is","not","where","has","matches","-moz-any","-webkit-any"]),An=new Set(["media","supports","document","layer","container","scope","starting-style","-moz-document","keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes"]);function Nn(e){let t=f(e),n=N();while(m(e)!==0){if(f(e).type===13){e.pos++;continue}let s=H(e);if(s)n.appendData(s)}return{type:"AtrulePrelude",children:n,loc:y(e,t,f(e))}}function Ae(e){let t=f(e),n;if(e.parseRulePrelude)n=Ee(e);else{let s=f(e),i=s;while(m(e)!==0&&m(e)!==23)i=g(e);let l=e.source.slice(s.start,i.end).trim();n=oe(l,s,i,e)}let r=Ne(e,!0);return{type:"Rule",prelude:n,block:r,loc:y(e,t,f(e))}}function Ne(e,t=!1){let n=f(e);if(m(e)!==23)return{type:"Block",children:N(),loc:ot(e)};e.pos++;let r=N(),{types:s,end:i}=e;while(e.pos<i){let l=s[e.pos];if(l===24||l===0)break;if(l===13){e.pos++;continue}if(l===25){let o={type:25,start:e.starts[e.pos],end:e.ends[e.pos]};e.pos++,r.appendData(Te(e,o));continue}if(l===3){let o=le(e);if(o)r.appendData(o);continue}if(t&&In(e,En)){let o=Ae(e);r.appendData(o);continue}let a=Ie(e);if(a)r.appendData(a);if(e.pos<i&&s[e.pos]===17)e.pos++}if(m(e)===24)e.pos++;return{type:"Block",children:r,loc:y(e,n,f(e))}}function In(e,t){let n=e.pos,r=t(e);return e.pos=n,r}function En(e){let{types:t,end:n}=e;while(e.pos<n){let r=t[e.pos];if(r===23)return!0;if(r===17||r===24||r===0)return!1;e.pos++}return!1}function On(e){let t=f(e),n=N();while(m(e)!==0&&m(e)!==24){let r=f(e);if(r.type===13){e.pos++;continue}if(r.type===25){n.appendData(Te(e,g(e)));continue}if(r.type===17){e.pos++;continue}if(r.type===3){let i=le(e);if(i)n.appendData(i);continue}let s=Ie(e);if(s)n.appendData(s);if(m(e)===17)g(e)}return{type:"DeclarationList",children:n,loc:y(e,t,f(e))}}function Ie(e){R(e);let t=f(e);if(t.type!==1&&t.type!==4&&!(t.type===9&&e.source[t.start]==="*"&&e.source[t.start+1]===" "))if(t.type===9&&e.source[t.start]==="*")e.pos++;else{ke(e,"Expected property name",t,{type:"Raw",value:"",loc:null});let{types:I,end:E}=e;while(e.pos<E){let S=I[e.pos];if(S===0||S===17||S===24)break;e.pos++}return null}let n=e.starts[e.pos],r=e.ends[e.pos];e.pos++;let s=e.source.slice(n,r);if(Ze(e),m(e)!==16){ke(e,`Expected ':' after property "${s}"`,f(e),{type:"Raw",value:"",loc:null});let{types:I,end:E}=e;while(e.pos<E){let S=I[e.pos];if(S===0||S===17||S===24)break;e.pos++}return null}e.pos++,Ze(e);let{types:i,starts:l,end:a,pos:o}=e,c=o,h=o,u=-1,d=-1;while(c<a){let I=i[c];if(I===0||I===17||I===24)break;if(I===9&&e.source.charCodeAt(l[c])===33){let E=c+1;while(E<a&&i[E]===13)E++;if(E<a&&i[E]===1){let S=l[E];if(e.ends[E]-S===9&&(e.source.charCodeAt(S)|32)===105&&(e.source.charCodeAt(S+1)|32)===109&&(e.source.charCodeAt(S+2)|32)===112&&(e.source.charCodeAt(S+3)|32)===111&&(e.source.charCodeAt(S+4)|32)===114&&(e.source.charCodeAt(S+5)|32)===116&&(e.source.charCodeAt(S+6)|32)===97&&(e.source.charCodeAt(S+7)|32)===110&&(e.source.charCodeAt(S+8)|32)===116){d=c,u=E,c=E+1;continue}}}if(I!==13&&I!==25)h=c+1;c++}let b=h,p=u>=0?{type:1,start:l[u],end:e.ends[u]}:null,_=s.startsWith("--"),T,K=l[o],Me=b>o?e.ends[b-1]:K,he={type:i[o],start:K,end:e.ends[o]},Ve=b>o?{type:i[b-1],start:l[b-1],end:Me}:he;if(_&&!e.parseCustomProperty||!e.parseValue)T={type:"Raw",value:e.source.slice(K,Me).trim(),loc:y(e,he,Ve)};else if(b===o)T={type:"Value",children:N(),loc:y(e,he,Ve)};else{let I=e.end;e.end=b,e.pos=o,T=at(e),e.end=I}return e.pos=c,{type:"Declaration",property:s,important:p?!0:!1,value:T,loc:y(e,t,f(e))}}function Ln(e){return at(e)}function at(e){let t=f(e),n=N();while(m(e)!==0&&m(e)!==17&&m(e)!==24&&m(e)!==22&&m(e)!==20){let r=H(e);if(r)n.appendData(r)}return ct(n),{type:"Value",children:n,loc:y(e,t,f(e))}}function lt(e){for(let t of e)if("children"in t&&t.children instanceof L)lt(t.children);ct(e)}function ct(e){let t=e.head;while(t){if(t.data.type==="Number"){let n=t.next;while(n&&n.data.type==="WhiteSpace")n=n.next;if(n&&n.data.type==="Operator"&&n.data.value==="/"){let r=n.next;while(r&&r.data.type==="WhiteSpace")r=r.next;if(r&&r.data.type==="Number"){let s={type:"Ratio",left:t.data,right:r.data,loc:null},i=t.next;while(i&&i!==r.next){let l=i.next;e.remove(i),i=l}e.replace(t,e.createItem(s)),t=e.head;continue}}}t=t.next}}function H(e){let t=e.pos;if(t>=e.end)return null;let n=e.types[t],r=e.starts[t],s=e.ends[t],i=e.source;switch(n){case 13:return e.pos++,e.positions?{type:"WhiteSpace",value:" ",loc:A(e,r,s)}:{type:"WhiteSpace",value:" ",loc:null};case 25:return e.pos++,{type:"Comment",value:i.slice(r+2,s-2),loc:e.positions?A(e,r,s):null};case 10:return e.pos++,{type:"Number",value:i.slice(r,s),loc:e.positions?A(e,r,s):null};case 11:return e.pos++,{type:"Percentage",value:i.slice(r,s-1),loc:e.positions?A(e,r,s):null};case 12:{e.pos++;let l=r,a=i.charCodeAt(l);if(a===43||a===45)l++;let o=!1;while(l<s){let h=i.charCodeAt(l);if(h>=48&&h<=57){l++;continue}if(h===46&&!o){o=!0,l++;continue}break}let c=i.charCodeAt(l);if(c===69||c===101){let h=l+1,u=i.charCodeAt(h);if(u===43||u===45)h++;let d=!1;while(h<s){let b=i.charCodeAt(h);if(b>=48&&b<=57){h++,d=!0;continue}break}if(d)l=h}return{type:"Dimension",value:i.slice(r,l),unit:i.slice(l,s),loc:e.positions?A(e,r,s):null}}case 1:return e.pos++,{type:"Identifier",name:Se(i,r,s),loc:e.positions?A(e,r,s):null};case 5:{e.pos++;let l=r+1,o=s-r>=2&&i.charCodeAt(s-1)===i.charCodeAt(r)?s-1:s;return{type:"String",value:xe(i,l,o),loc:e.positions?A(e,r,s):null}}case 7:{e.pos++;let l=r+4;while(l<s&&rt(i.charCodeAt(l)))l++;let a=s;if(a>l&&i.charCodeAt(a-1)===41)a--;while(a>l&&rt(i.charCodeAt(a-1)))a--;let o;if(a-l>=2){let c=i.charCodeAt(l),h=i.charCodeAt(a-1);if((c===34||c===39)&&c===h)o=i.slice(l+1,a-1);else o=i.slice(l,a)}else o=i.slice(l,a);return{type:"Url",value:o,loc:e.positions?A(e,r,s):null}}case 4:return e.pos++,{type:"Hash",name:i.slice(r+1,s),loc:e.positions?A(e,r,s):null};case 2:return Rn(e);case 21:return _n(e);case 18:return e.pos++,{type:"Operator",value:",",loc:e.positions?A(e,r,s):null};case 16:return e.pos++,{type:"Operator",value:":",loc:e.positions?A(e,r,s):null};case 9:{e.pos++;let l=i.charCodeAt(r),a=i[r];if(Pn(l))return{type:"Operator",value:a,loc:e.positions?A(e,r,s):null};return{type:"Identifier",name:a,loc:e.positions?A(e,r,s):null}}case 19:{e.pos++;let l=N();while(m(e)!==0&&m(e)!==20){let o=H(e);if(o)l.appendData(o)}let a=e.pos<e.end?e.ends[e.pos]:s;if(m(e)===20)e.pos++;return{type:"Brackets",children:l,loc:e.positions?A(e,r,a):null}}case 3:case 23:case 24:case 22:case 20:case 17:case 0:case 14:case 15:case 6:case 8:return e.pos++,{type:"Raw",value:i.slice(r,s),loc:e.positions?A(e,r,s):null}}return e.pos++,null}function rt(e){return e===32||e===9||e===10||e===12||e===13}function Pn(e){return e===47||e===43||e===45||e===42||e===61||e===62||e===60||e===126||e===124||e===36||e===94||e===33||e===38}function ae(e,t,n){for(let r=t;r<n;r++){let s=e.charCodeAt(r);if(s>=65&&s<=90)return e.slice(t,n).toLowerCase()}return e.slice(t,n)}function A(e,t,n){let r=e.tokenizer.locate(t),s=e.tokenizer.locate(n);return{source:e.filename??"<unknown>",start:{offset:t,line:r.line,column:r.column},end:{offset:n,line:s.line,column:s.column}}}function Rn(e){let t=g(e),n=ae(e.source,t.start,t.end-1),r=N();while(m(e)!==0&&m(e)!==22){let s=H(e);if(s)r.appendData(s)}if(m(e)===22)g(e);if(n==="url"){for(let s=r.head;s!=null;s=s.next)if(s.data.type==="String")return{type:"Url",value:s.data.value,loc:y(e,t,f(e))}}return{type:"Function",name:n,children:r,loc:y(e,t,f(e))}}function _n(e){let t=g(e),n=N();while(m(e)!==0&&m(e)!==22){let r=H(e);if(r)n.appendData(r)}if(m(e)===22)g(e);return{type:"Parentheses",children:n,loc:y(e,t,f(e))}}function Ee(e){let t=f(e),n=N();while(m(e)!==0){if(R(e),m(e)===0||m(e)===23)break;let r=ut(e);if(r.children.head!==null)n.appendData(r);if(R(e),m(e)===18){g(e);continue}break}return{type:"SelectorList",children:n,loc:y(e,t,f(e))}}function ut(e){let t=f(e),n=N(),r=!0;while(m(e)!==0&&m(e)!==18&&m(e)!==23){let s=f(e);if(s.type===13){if(g(e),!r&&m(e)!==0&&m(e)!==18&&m(e)!==23&&!st(e)&&!Bn(e)){let l={type:"Combinator",name:" ",loc:y(e,s,s)};n.appendData(l),r=!0}continue}if(s.type===9&&e.source.charCodeAt(s.start)===124&&e.types[e.pos+1]===9&&e.source.charCodeAt(e.starts[e.pos+1])===124){let l=f(e);g(e);let a=g(e),o={type:"Combinator",name:"||",loc:y(e,l,a)};n.appendData(o),r=!0,R(e);continue}if(st(e)){let l=g(e),o={type:"Combinator",name:e.source[l.start],loc:y(e,l,l)};n.appendData(o),r=!0,R(e);continue}let i=Dn(e);if(!i)break;n.appendData(i),r=!1}while(n.tail&&n.tail.data.type==="Combinator")n.remove(n.tail);return{type:"Selector",children:n,loc:y(e,t,f(e))}}function st(e){let t=f(e);if(t.type!==9)return!1;let n=e.source[t.start];return n===">"||n==="+"||n==="~"}function Bn(e){if(e.types[e.pos]!==9)return!1;if(e.source.charCodeAt(e.starts[e.pos])!==124)return!1;if(e.types[e.pos+1]!==9)return!1;return e.source.charCodeAt(e.starts[e.pos+1])===124}function Dn(e){let t=f(e);switch(t.type){case 1:{if(g(e),m(e)===9&&e.source[f(e).start]==="|"&&e.source[f(e).start+1]!=="="&&!(e.types[e.pos+1]===9&&e.source.charCodeAt(e.starts[e.pos+1])===124)){if(g(e),m(e)===1){let r=g(e);return{type:"TypeSelector",name:`${D(e,t)}|${D(e,r)}`,loc:y(e,t,r)}}if(m(e)===9&&e.source[f(e).start]==="*"){let r=g(e);return{type:"TypeSelector",name:`${D(e,t)}|*`,loc:y(e,t,r)}}}return{type:"TypeSelector",name:D(e,t),loc:y(e,t,t)}}case 11:return g(e),{type:"TypeSelector",name:D(e,t),loc:y(e,t,t)};case 10:return g(e),{type:"TypeSelector",name:D(e,t),loc:y(e,t,t)};case 9:{let n=e.source[t.start];if(n==="*")return g(e),{type:"TypeSelector",name:"*",loc:y(e,t,t)};if(n==="."){if(g(e),m(e)===1){let r=g(e);return{type:"ClassSelector",name:D(e,r),loc:y(e,t,r)}}return null}if(n==="&")return g(e),{type:"NestingSelector",loc:y(e,t,t)};return g(e),null}case 4:return g(e),{type:"IdSelector",name:e.source.slice(t.start+1,t.end),loc:y(e,t,t)};case 16:{g(e);let n=m(e)===16;if(n)g(e);return Mn(e,n,t)}case 19:return Vn(e)}return null}function Mn(e,t,n){let r=f(e);if(r.type===1){g(e);let s=ae(e.source,r.start,r.end);return t?{type:"PseudoElementSelector",name:s,children:null,loc:y(e,n,r)}:{type:"PseudoClassSelector",name:s,children:null,loc:y(e,n,r)}}if(r.type===2){g(e);let s=ae(e.source,r.start,r.end-1),i=N();if(!t&&Tn.has(s)){let o=f(e),c=o,h=1;while(m(e)!==0&&h>0){if(m(e)===21||m(e)===2)h++;else if(m(e)===22){if(h--,h===0)break}c=g(e)}if(m(e)===22)g(e);let u=e.source.slice(o.start,c.end).trim();if(u.length>0){let d=it(u,{positions:!1}),b=Ee(d);i.appendData(b)}}else{while(m(e)!==0&&m(e)!==22){let o=H(e);if(o)i.appendData(o)}if(m(e)===22)g(e)}if(t)return{type:"PseudoElementSelector",name:s,children:i,loc:y(e,n,f(e))};return{type:"PseudoClassSelector",name:s,children:i,loc:y(e,n,f(e))}}return null}function Vn(e){let t=g(e);R(e);let n=f(e);if(n.type!==1)return null;g(e);let r={type:"Identifier",name:D(e,n),loc:y(e,n,n)};R(e);let s=null,i=null,l=null,a=f(e);if(a.type===9){let c=e.source[a.start],h=e.source[a.start+1];if(c==="=")s="=",g(e);else if((c==="~"||c==="|"||c==="^"||c==="$"||c==="*")&&h==="="){g(e);let b=f(e);if(b.type===9&&e.source[b.start]==="=")g(e),s=`${c}=`}R(e);let u=f(e);if(u.type===5){g(e);let b=u.end-u.start>=2&&e.source.charCodeAt(u.end-1)===e.source.charCodeAt(u.start);i={type:"String",value:xe(e.source,u.start+1,b?u.end-1:u.end),loc:y(e,u,u)}}else if(u.type===1)g(e),i={type:"Identifier",name:D(e,u),loc:y(e,u,u)};R(e);let d=f(e);if(d.type===1)g(e),l=D(e,d)}R(e);let o=f(e);if(m(e)===20)o=g(e);return{type:"AttributeSelector",name:r,matcher:s,value:i,flags:l,loc:y(e,t,o)}}var ht=Symbol("walkSkip"),x=Symbol("walkStop");function jn(e){return{root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null}}function Wn(e,t){let n=jn(e),r=typeof t==="function"?t:t.enter,s=typeof t==="function"?null:t.leave??null,i=typeof t==="function"?null:t.visit??null,l=typeof t==="function"?!1:t.reverse??!1;function a(o,c,h){let u=null,d;switch(o.type){case"StyleSheet":u="stylesheet",d=n.stylesheet,n.stylesheet=o;break;case"Atrule":u="atrule",d=n.atrule,n.atrule=o;break;case"AtrulePrelude":u="atrulePrelude",d=n.atrulePrelude,n.atrulePrelude=o;break;case"Rule":u="rule",d=n.rule,n.rule=o;break;case"Selector":u="selector",d=n.selector,n.selector=o;break;case"Block":u="block",d=n.block,n.block=o;break;case"Declaration":u="declaration",d=n.declaration,n.declaration=o;break;case"Function":u="function",d=n.function,n.function=o;break}let b;if((i===null||i===o.type)&&r){let p=r.call(n,o,c,h);if(p===ht){if(u)n[u]=d;return}if(p===x){if(u)n[u]=d;return x}}if(b=Fn(o,l,a),b===x){if(u)n[u]=d;return x}if((i===null||i===o.type)&&s){if(s.call(n,o,c,h)===x){if(u)n[u]=d;return x}}if(u)n[u]=d;return}return a(e,null,null)}var q=Object.assign(Wn,{skip:ht,stop:x});function Fn(e,t,n){if("children"in e&&e.children instanceof L)return Un(e.children,t,n);if(e.type==="Rule"){if(n(e.prelude,null,null)===x)return x;if(n(e.block,null,null)===x)return x;return}if(e.type==="Atrule"){if(e.prelude){if(n(e.prelude,null,null)===x)return x}if(e.block){if(n(e.block,null,null)===x)return x}return}if(e.type==="Declaration")return n(e.value,null,null);if(e.type==="AttributeSelector"){if(n(e.name,null,null)===x)return x;if(e.value)return n(e.value,null,null);return}return}function Un(e,t,n){let r;if(t)e.forEachRight((s,i,l)=>{if(r)return;if(n(s,i,l)===x)r=x});else e.forEach((s,i,l)=>{if(r)return;if(n(s,i,l)===x)r=x});return r}function Y(e,t={}){let n=t.exclamation??!1,r=!1;q(e,(s,i,l)=>{if(s.type!=="Comment")return;let a=s.value.startsWith("!");if(n===!0&&a)return;if(n==="first-exclamation"&&a&&!r){r=!0;return}if(i&&l)l.remove(i)})}function ce(e){q(e,(t)=>{if(t.type!=="Block"&&t.type!=="DeclarationList")return;if(!("children"in t)||!t.children)return;let n=t.children,r=n.head;if(r==null||r.next==null)return;let s=0;for(let a=r;a!=null;a=a.next)if(a.data.type==="Declaration"){if(s++,s>=2)break}if(s<2)return;let i=new Map,l=[];for(let a=r;a!=null;a=a.next){let o=a.data;if(o.type!=="Declaration")continue;let c=o.property,h=i.get(c);if(h){let u=!!h.decl.important,d=!!o.important;if(d||u===d)l.push(h.item),i.set(c,{item:a,decl:o});else l.push(a)}else i.set(c,{item:a,decl:o})}for(let a of l)n.remove(a)})}var zn={black:"#000",fuchsia:"#f0f",white:"#fff",red:"#f00",cyan:"#0ff",blue:"#00f",yellow:"#ff0",magenta:"#f0f",lime:"#0f0",silver:"#c0c0c0",gray:"#808080",maroon:"#800000",olive:"#808000",green:"#008000",purple:"#800080",teal:"#008080",navy:"#000080"},Hn={"#f00":"red","#ff0000":"red","#000080":"navy","#008080":"teal"};function Le(e){if(!e.startsWith("#"))return e;let t=e.slice(1);if(t.length===6){if(t[0]===t[1]&&t[2]===t[3]&&t[4]===t[5])return`#${t[0]}${t[2]}${t[4]}`}if(t.length===8){if(t[0]===t[1]&&t[2]===t[3]&&t[4]===t[5]&&t[6]===t[7])return`#${t[0]}${t[2]}${t[4]}${t[6]}`}return e}function dt(e){let t=e.toLowerCase();return zn[t]??null}function mt(e){let t=e.toLowerCase();return Hn[t]??null}function qn(e,t,n){let r=(e<<16|t<<8|n).toString(16).padStart(6,"0");return Le(`#${r}`)}var Gn=/^rgba?\(\s*([+-]?\d*\.?\d+%?)\s*[,\s]\s*([+-]?\d*\.?\d+%?)\s*[,\s]\s*([+-]?\d*\.?\d+%?)\s*(?:[,/]\s*([+-]?\d*\.?\d+%?)\s*)?\)$/;function ft(e){let t=Gn.exec(e.trim());if(!t)return e;let n=Oe(t[1]),r=Oe(t[2]),s=Oe(t[3]);if(t[4]!==void 0&&!Kn(t[4]))return e;return qn(n,r,s)}function Kn(e){if(e.endsWith("%"))return Number.parseFloat(e)>=100;return Number.parseFloat(e)>=1}function Oe(e){if(e.endsWith("%"))return Math.max(0,Math.min(255,Math.round(Number.parseFloat(e)*2.55)));return Math.max(0,Math.min(255,Math.round(Number.parseFloat(e))))}var Yn=new Set(["px","pt","pc","in","cm","mm","q","em","rem","ex","ch","cap","ic","lh","rlh","vw","vh","vi","vb","vmin","vmax","svw","svh","svi","svb","svmin","svmax","lvw","lvh","lvi","lvb","lvmin","lvmax","dvw","dvh","dvi","dvb","dvmin","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"]);function ue(e){if(e.charCodeAt(0)===43)e=e.slice(1);if(e.includes(".")){let t=e.replace(/(\.\d*?)0+($|[eE])/,"$1$2");t=t.replace(/\.($|[eE])/,"$1"),e=t}if(e.startsWith("0.")&&e.length>2)e=e.slice(1);else if(e.startsWith("-0.")&&e.length>3)e=`-${e.slice(2)}`;if(e==="-0"||e==="-.0"||e==="-0.0")e="0";return e}function pt(e,t){let n=ue(e);if((n==="0"||n==="-0")&&Yn.has(t.toLowerCase()))return{value:"0",unit:""};return{value:n,unit:t}}function gt(e){return ue(e)}function yt(e,t){let n=Number.parseFloat(e);if(!Number.isFinite(n))return e;let r=t<0?0:t;return n.toFixed(r)}var bt=new Set(["color","background","background-color","border","border-color","border-top","border-top-color","border-right","border-right-color","border-bottom","border-bottom-color","border-left","border-left-color","border-block","border-block-color","border-block-start-color","border-block-end-color","border-inline","border-inline-color","border-inline-start-color","border-inline-end-color","outline","outline-color","caret-color","fill","stroke","flood-color","lighting-color","stop-color","column-rule","column-rule-color","text-decoration","text-decoration-color","text-emphasis","text-emphasis-color","text-shadow","box-shadow","accent-color","scrollbar-color"]);function Ct(e){if(!e||e.type!=="Operator")return!1;let t=e.value;return t===":"||t===","||t==="/"}function Qn(e){let t=e.children;if(!t)return;while(t.head&&t.head.data.type==="WhiteSpace")t.remove(t.head);while(t.tail&&t.tail.data.type==="WhiteSpace")t.remove(t.tail);let n=t.head;while(n){let r=n.next;if(n.data.type==="WhiteSpace"){let s=n.prev&&Ct(n.prev.data),i=r&&Ct(r.data);if(s||i)t.remove(n)}n=r}}function Pe(e,t={}){let n=t.floatPrecision??null,r=n===null?null:(s)=>yt(s,n);q(e,{enter(s,i,l){switch(s.type){case"Number":{let a=r?r(s.value):s.value;s.value=ue(a);return}case"Percentage":{let a=r?r(s.value):s.value;s.value=gt(a);return}case"Dimension":{let a=r?r(s.value):s.value,o=pt(a,s.unit);s.value=o.value,s.unit=o.unit;return}case"Hash":{let a=Le(`#${s.name}`).slice(1);if(s.name=a,i&&l&&this.declaration&&bt.has(this.declaration.property.toLowerCase())){let o=mt(`#${a}`);if(o&&o.length<a.length+1){let c={type:"Identifier",name:o,loc:s.loc};l.replace(i,l.createItem(c))}}return}case"Identifier":{if(!i||!l||!this.declaration)return;if(!bt.has(this.declaration.property.toLowerCase()))return;let a=dt(s.name);if(a&&a.length<s.name.length){let o={type:"Hash",name:a.slice(1),loc:s.loc};l.replace(i,l.createItem(o))}return}case"Url":return;case"Function":{let a=s.name.toLowerCase();if((a==="rgb"||a==="rgba")&&i&&l)s.__rgbReplaceCandidate=!0}}},leave(s,i,l){if(s.type==="Parentheses"||s.type==="Function"||s.type==="Value")Qn(s);if(s.type==="Function"&&s.__rgbReplaceCandidate&&i&&l){let a=k(s),o=ft(a);if(o!==a&&o.startsWith("#")){let c={type:"Hash",name:o.slice(1),loc:s.loc};l.replace(i,l.createItem(c))}}}})}function Re(e,t={}){let n=z(e,{context:"stylesheet"});return vt(n,t)}function _e(e,t={}){let n=z(e,{context:"declarationList"});return vt(n,t)}function vt(e,t){if(t.comments===!1)Y(e,{exclamation:!1});else if(t.comments==="first-exclamation")Y(e,{exclamation:"first-exclamation"});else Y(e,{exclamation:!0});return Pe(e,{floatPrecision:t.floatPrecision??null}),ce(e),{css:k(e),ast:e}}var Be="0.3.15";function De(e){if(!er(e))process.stderr.write(`ts-css: file not found: ${e}
|
|
33
33
|
`),process.exit(1);return tr(e,"utf8")}var G=new Ce("ts-css");G.command("minify <file>","Minify a CSS file").option("--no-comments","Strip /*!*/ comments too").option("--block",'Treat input as a declarationList (style="\u2026" body)').action(async(e,t)=>{let n=De(e),r={comments:t.comments===!1?!1:"exclamation"},s=t.block?_e(n,r):Re(n,r);process.stdout.write(s.css)});G.command("parse <file>","Parse a CSS file and print its AST as JSON").option("--positions","Include source locations on every node").action(async(e,t)=>{let n=De(e),r=z(n,{positions:t.positions});process.stdout.write(JSON.stringify(r,null,2))});G.command("format <file>","Round-trip CSS through parser/generator (deterministic single-line output)").action(async(e)=>{let t=De(e),n=z(t);process.stdout.write(k(n))});G.command("version","Show the version of the CLI").action(()=>{console.log(Be)});G.version(Be);G.help();G.parse();
|
package/dist/bin/cssx.js
CHANGED
|
@@ -88,7 +88,7 @@ Received ${r}, cleaning up...`),e)try{await e()}catch(n){console.error("Error du
|
|
|
88
88
|
`)),this.enableDidYouMean){let t=[];for(let n of this.commands){if(n.displayName)t.push(n.displayName);if(n.aliasNames)t.push(...n.aliasNames)}let r=Di(e,t);if(r.length>0)console.log(xt.yellow("Did you mean one of these?")),r.forEach((n)=>console.log(` ${xt.dim("\u2022")} ${this.name} ${n}`)),console.log("")}console.log(xt.dim("Run"),`${this.name} --help`,xt.dim("to see all available commands")),Ie.exit(1)}async parse(e=Li,t={}){let{run:r=!0,exitOnError:n=!1}=t;if(n)try{return await this.parse(e,{run:r})}catch(a){throw this.handleUsageError(a),a}if(this.rawArgs=e,!this.name)this.name=e[1]?$c(e[1]):"cli";let i=!0,o=e.slice(2),s=o[0];if(s&&!s.startsWith("-")){for(let a of this.commands)if(a.isMatched(s)){let l=this.mri(o,a);i=!1;let u={...l,args:l.args.slice(1)};this.setParsedInfo(u,a,s),this.emit(`command:${s}`,a);break}if(i){let a=o[1];if(a&&!a.startsWith("-")){let l=`${s}:${a}`;for(let u of this.commands)if(u.isMatched(l)){let f=this.mri(o,u);i=!1;let d={...f,args:f.args.slice(2)};this.setParsedInfo(d,u,l),this.emit(`command:${l}`,u);break}}}}if(i){for(let a of this.commands)if(a.name===""){i=!1;let l=this.mri(o,a);this.setParsedInfo(l,a),this.emit("command:!",a);break}}if(i){let a=this.mri(e.slice(2));this.setParsedInfo(a)}if(this.options.verbose)this.isVerbose=!0;if(this.options.quiet)this.isQuiet=!0;if(this.options.debug)this.isDebug=!0;if(this.options.noInteraction||this.options.interaction===!1)this.isNoInteraction=!0;if(this.options.env)this.environment=String(this.options.env);if(this.options.dryRun)this.isDryRun=!0;if(this.options.force)this.isForce=!0;if(this.options.noEmoji||this.options.emoji===!1)this.useEmoji=!1;if(this.options.theme)this.theme=String(this.options.theme);if(this.options.noCache||this.options.cache===!1)this.isNoCache=!0;if(this.options.help&&this.showHelpOnExit)this.outputHelp(),r=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),r=!1,this.unsetMatchedCommand();let c={args:this.args,options:this.options};if(r)await this.runMatchedCommand();if(!this.matchedCommand&&this.args[0]){if(this.emit("command:*"),!(this.listenerCount("command:*")>0))this.showCommandNotFound(this.args[0])}return c}mri(e,t){let r=[...this.globalCommand.options,...t?t.options:[]],n=xc(r),i=[],o=e.indexOf("--");if(o>-1)i=e.slice(o+1),e=e.slice(0,o);let s=Sc(e,n),c={_:s._};for(let d of Object.keys(s))if(d!=="_")c[wt(d)]=s[d];let a=c._,l={"--":i},u=t&&t.config.ignoreOptionDefaultValue?t.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,f=Object.create(null);for(let d of r){if(!u&&d.config.default!==void 0)for(let h of d.names)l[h]=d.config.default;if(Array.isArray(d.config.type)){if(f[d.name]===void 0)f[d.name]={shouldTransform:!0,transformFunction:d.config.type[0]}}}for(let d of Object.keys(c))if(d!=="_"){let h=d.split(".");vc(l,h,c[d]),wc(l,f)}for(let d of r){if(!d.variadic)continue;for(let h of d.names){let m=l[h];if(m===void 0||Array.isArray(m))continue;if(d.config.default!==void 0&&m===d.config.default)continue;l[h]=[m]}}return{args:a,options:l}}async run(e=Li){return this.parse(e,{run:!0,exitOnError:!0})}handleUsageError(e){if(!Cc(e)||e.isUsageError===!1)return;let t=e.message||"command-line error",r=this.name?`${this.name}: `:"",n=/--help/.test(t)?"":e.usage?`
|
|
89
89
|
Usage: ${e.usage}`:`
|
|
90
90
|
Run \`${this.name??"cli"} --help\` for usage.`;Ie.stderr.write(`${r}${t}${n}
|
|
91
|
-
`),Ie.exit(e.exitCode??2)}async runMatchedCommand(){let{args:e,options:t,matchedCommand:r}=this;if(!r||!r.commandAction)return;r.checkUnknownOptions(),r.checkOptionValue(),r.checkRequiredArgs();let n=[];r.args.forEach((c,a)=>{if(c.variadic)n.push(e.slice(a));else n.push(e[a])}),n.push(t);let i={command:r,args:n,options:t};for(let c of r.beforeHooks)await c(i);let o,s=async()=>{let c=r.commandAction.apply(this,n);if(c instanceof Promise)o=await c;else o=c;return o};if(r.middleware.length>0){let c=0,a=async()=>{if(c<r.middleware.length){let l=r.middleware[c++];await l({...i,next:a})}else await s()};await a()}else await s();for(let c of r.afterHooks)await c(i);return o}removeSignalHandlers(){if(!this.signalHandlersSet)return this;return Ie.removeAllListeners("SIGINT"),Ie.removeAllListeners("SIGTERM"),this.signalHandlersSet=!1,this}destroy(){this.removeSignalHandlers(),this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.matchedCommand=void 0,this.matchedCommandName=void 0,this.removeAllListeners()}}class Bi{cache;enabled;cleanupInterval=null;hits=0;misses=0;constructor(){this.cache=new Map,this.enabled=!0,this.startCleanupInterval()}startCleanupInterval(){if(this.cleanupInterval)return;this.cleanupInterval=setInterval(()=>{this.cleanup()},30000),this.cleanupInterval.unref()}stopCleanup(){if(this.cleanupInterval)clearInterval(this.cleanupInterval),this.cleanupInterval=null}isEnabled(){return this.enabled}get(e){if(!this.enabled){this.misses++;return}let t=this.cache.get(e);if(!t){this.misses++;return}if(Date.now()-t.timestamp>t.ttl){this.cache.delete(e),this.misses++;return}return this.hits++,t.value}set(e,t,r=5000){if(!this.enabled)return;this.cache.set(e,{value:t,timestamp:Date.now(),ttl:r})}has(e){if(!this.enabled)return!1;let t=this.cache.get(e);if(!t)return!1;if(Date.now()-t.timestamp>t.ttl)return this.cache.delete(e),!1;return!0}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}disable(){this.enabled=!1,this.clear()}enable(){this.enabled=!0}stats(){return{size:this.cache.size,enabled:this.enabled,hits:this.hits,misses:this.misses}}resetStats(){this.hits=0,this.misses=0}keys(){return Array.from(this.cache.keys())}cleanup(){let e=Date.now();for(let[t,r]of this.cache.entries())if(e-r.timestamp>r.ttl)this.cache.delete(t)}destroy(){this.stopCleanup(),this.clear(),this.resetStats()}}var hx=new Bi;function Ic(){if("FORCE_COLOR"in vt.env)return vt.env.FORCE_COLOR!=="0";if("NO_COLOR"in vt.env||vt.env.TERM==="dumb")return!1;if(vt.platform==="win32")return!0;return Mi.isatty(1)&&Mi.isatty(2)}var Ui=Ic();function M(e,t){if(!Ui)return(r)=>r;return(r)=>e+r+t}var Pc=M("\x1B[0m","\x1B[0m"),_c=M("\x1B[31m","\x1B[39m"),Lc=M("\x1B[32m","\x1B[39m"),Mc=M("\x1B[33m","\x1B[39m"),Fc=M("\x1B[34m","\x1B[39m"),Dc=M("\x1B[35m","\x1B[39m"),jc=M("\x1B[36m","\x1B[39m"),Bc=M("\x1B[37m","\x1B[39m"),Uc=M("\x1B[90m","\x1B[39m"),Vc=M("\x1B[1m","\x1B[22m"),Wc=M("\x1B[3m","\x1B[23m"),zc=M("\x1B[4m","\x1B[24m"),Kc=M("\x1B[2m","\x1B[22m"),Hc=M("\x1B[7m","\x1B[27m"),Gc=M("\x1B[8m","\x1B[28m"),qc=M("\x1B[9m","\x1B[29m"),Yc=M("\x1B[41m","\x1B[49m"),Jc=M("\x1B[42m","\x1B[49m"),Xc=M("\x1B[43m","\x1B[49m"),Zc=M("\x1B[44m","\x1B[49m"),Qc=M("\x1B[45m","\x1B[49m"),eu=M("\x1B[46m","\x1B[49m"),tu=M("\x1B[47m","\x1B[49m"),ru=Ui,nu={reset:Pc,red:_c,green:Lc,yellow:Mc,blue:Fc,magenta:Dc,cyan:jc,white:Bc,gray:Uc,bold:Vc,italic:Wc,underline:zc,dim:Kc,inverse:Hc,hidden:Gc,strikethrough:qc,bgRed:Yc,bgGreen:Jc,bgYellow:Xc,bgBlue:Zc,bgMagenta:Qc,bgCyan:eu,bgWhite:tu,isColorSupported:ru},iu=nu,su=["up","down","left","right","space","enter","cancel"],xx={actions:new Set(su),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};var vx=ou.platform.startsWith("win"),wx=Symbol("clapp:cancel");var au=Rc();var _=(e,t)=>au?e:t,$x=_("\u25C6","*"),Cx=_("\u25A0","x"),Rx=_("\u25B2","x"),kx=_("\u25C7","o"),Sx=_("\u250C","T"),lu=_("\u2502","|"),Ax=_("\u2514","\u2014"),Ex=_("\u25CF",">"),Tx=_("\u25CB"," "),Nx=_("\u25FB","[\u2022]"),Ox=_("\u25FC","[+]"),Ix=_("\u25FB","[ ]"),Px=_("\u25AA","\u2022"),_x=_("\u2500","-"),Lx=_("\u256E","+"),Mx=_("\u251C","+"),Fx=_("\u256F","+"),Dx=_("\u25CF","\u2022"),jx=_("\u25C6","*"),Bx=_("\u25B2","!"),Ux=_("\u25A0","x");var Vx={light:_("\u2500","-"),heavy:_("\u2501","="),block:_("\u2588","#")};function cu(){return`${iu.gray(lu)} `}var Wx=cu();class Vi{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let e=Fi.homedir(),t=Yr.join(e,".config","clapp");this.configPath=Yr.join(t,"telemetry.json")}async isEnabled(){if(Ue.env.DO_NOT_TRACK==="1"||Ue.env.DO_NOT_TRACK==="true")return!1;if(Ue.env.NO_TELEMETRY==="1"||Ue.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let e=await this.loadConfig();if(e.enabled=!0,!e.userId)e.userId=this.generateUserId();await this.saveConfig(e)}async disable(){let e=await this.loadConfig();e.enabled=!1,await this.saveConfig(e)}async track(e,t){if(!await this.isEnabled())return;let n={event:e,...t,timestamp:Date.now(),platform:Fi.platform(),nodeVersion:Ue.version};if(this.events.push(n),this.events.length>=10)await this.send()}async trackCommand(e,t){await this.track("command",{command:e,duration:t})}async trackError(e,t){await this.track("error",{error:e,command:t})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let t=await this.loadConfig();return t.lastSent=Date.now(),await this.saveConfig(t),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let t=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep(t),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep(e){return new Promise((t)=>setTimeout(t,e))}async status(){let e=await this.loadConfig();return{enabled:e.enabled,doNotTrack:Ue.env.DO_NOT_TRACK==="1"||Ue.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:e.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(uu(this.configPath)){let e=await qr.readFile(this.configPath,"utf-8");return this.config=JSON.parse(e),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig(e){this.config=e;try{let t=Yr.dirname(this.configPath);await qr.mkdir(t,{recursive:!0}),await qr.writeFile(this.configPath,JSON.stringify(e,null,2),"utf-8")}catch{}}generateUserId(){let e=Math.random().toString(36).substring(2,15),t=Date.now().toString(36);return`${e}-${t}`}}var Yx=new Vi;var tn="0.3.14";function be(e){return{prev:null,next:null,data:e}}class le{head=null;tail=null;cursors=[];allocateCursor(e,t){let r={prev:e,next:t};return this.cursors.push(r),r}releaseCursor(){this.cursors.pop()}updateCursors(e,t,r,n){for(let i of this.cursors){if(i.prev===e)i.prev=t;if(i.next===r)i.next=n}}static createItem(e){return be(e)}createItem(e){return be(e)}get isEmpty(){return this.head===null}get first(){return this.head?.data??null}get last(){return this.tail?.data??null}*[Symbol.iterator](){for(let e=this.head;e!=null;e=e.next)yield e.data}fromArray(e){let t=null;this.head=null;for(let r of e){let n=be(r);if(n.prev=t,t)t.next=n;else this.head=n;t=n}return this.tail=t,this}toArray(){let e=[];for(let t=this.head;t!=null;t=t.next)e.push(t.data);return e}toJSON(){return this.toArray()}forEach(e,t){let r=this.allocateCursor(null,this.head);while(r.next!==null){let n=r.next;r.prev=n,r.next=n.next,e.call(t,n.data,n,this)}this.releaseCursor()}forEachRight(e,t){let r=this.allocateCursor(this.tail,null);while(r.prev!==null){let n=r.prev;r.next=n,r.prev=n.prev,e.call(t,n.data,n,this)}this.releaseCursor()}reduce(e,t){let r=t,n=0;for(let i=this.head;i!=null;i=i.next)r=e(r,i.data,n++,this);return r}some(e){let t=0;for(let r=this.head;r!=null;r=r.next)if(e(r.data,t++,this))return!0;return!1}map(e){let t=new le,r=null,n=0;for(let i=this.head;i!=null;i=i.next){let o=be(e(i.data,n++,this));if(o.prev=r,r)r.next=o;else t.head=o;r=o}return t.tail=r,t}filter(e){let t=new le,r=null,n=0;for(let i=this.head;i!=null;i=i.next)if(e(i.data,n++,this)){let o=be(i.data);if(o.prev=r,r)r.next=o;else t.head=o;r=o}return t.tail=r,t}clear(){let e=this.head;while(e){let t=e.next;e.prev=null,e.next=null,e=t}this.head=null,this.tail=null}copy(){let e=new le,t=null;for(let r=this.head;r!=null;r=r.next){let n=be(r.data);if(n.prev=t,t)t.next=n;else e.head=n;t=n}return e.tail=t,e}prepend(e){return this.insert(e,this.head)}prependData(e){return this.insert(be(e),this.head)}append(e){return this.insert(e,null)}appendData(e){return this.insert(be(e),null)}insert(e,t=null){if(t!=null)if(this.updateCursors(t.prev,e,t,e),t.prev===null){if(this.head!==t)throw Error("before doesn't belong to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e,null,null)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else if(this.updateCursors(this.tail,e,null,e),this.tail!==null)this.tail.next=e,e.prev=this.tail,this.tail=e;else this.head=e,this.tail=e;return this}insertData(e,t=null){return this.insert(be(e),t)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),e.prev!==null)e.prev.next=e.next;else if(this.head===e)this.head=e.next;else throw Error("item doesn't belong to list");if(e.next!==null)e.next.prev=e.prev;else if(this.tail===e)this.tail=e.prev;else throw Error("item doesn't belong to list");return e.prev=null,e.next=null,e}push(e){this.insert(be(e),null)}pop(){if(this.tail===null)return null;return this.remove(this.tail)}unshift(e){this.prependData(e)}shift(){if(this.head===null)return null;return this.remove(this.head)}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e,null)}insertList(e,t=null){if(e.head===null)return this;if(t!==null){if(this.updateCursors(t.prev,e.tail,t,e.head),t.prev!==null)t.prev.next=e.head,e.head.prev=t.prev;else this.head=e.head;t.prev=e.tail,e.tail.next=t}else{if(this.updateCursors(this.tail,e.tail,null,e.head),this.tail!==null)this.tail.next=e.head,e.head.prev=this.tail;else this.head=e.head;this.tail=e.tail}return e.head=null,e.tail=null,this}replace(e,t){if(t instanceof le)this.insertList(t,e),this.remove(e);else this.insert(t,e),this.remove(e)}}function Q(e){switch(e.type){case"StyleSheet":return oe(e.children,"");case"Rule":return`${Q(e.prelude)}{${Q(e.block)}}`;case"Block":return du(e.children);case"Atrule":{let t=`@${e.name}`;if(e.prelude){let r=Q(e.prelude);if(r)t+=` ${r}`}if(e.block)t+=`{${Q(e.block)}}`;else t+=";";return t}case"AtrulePrelude":return oe(e.children,"");case"SelectorList":return oe(e.children,",");case"Selector":return oe(e.children,"");case"TypeSelector":return e.name;case"IdSelector":return`#${e.name}`;case"ClassSelector":return`.${e.name}`;case"NestingSelector":return"&";case"AttributeSelector":{let t=`[${e.name.name}`;if(e.matcher&&e.value)if(t+=e.matcher,e.value.type==="String")t+=`"${rn(e.value.value)}"`;else t+=e.value.name;if(e.flags)t+=` ${e.flags}`;return t+="]",t}case"PseudoClassSelector":return e.children?`:${e.name}(${oe(e.children,"")})`:`:${e.name}`;case"PseudoElementSelector":return e.children?`::${e.name}(${oe(e.children,"")})`:`::${e.name}`;case"Combinator":return e.name===" "?" ":e.name;case"Declaration":return`${e.property}:${Q(e.value)}${e.important?"!important":""}`;case"DeclarationList":return oe(e.children,";");case"Value":return oe(e.children,"");case"Identifier":return e.name;case"Number":return e.value;case"Percentage":return`${e.value}%`;case"Dimension":return e.value+e.unit;case"String":return`"${rn(e.value)}"`;case"Url":return/[\s"'()\\\u0000-\u001F\u007F]/.test(e.value)?`url("${rn(e.value)}")`:`url(${e.value})`;case"Hash":return`#${e.name}`;case"Operator":return e.value;case"Function":return`${e.name}(${oe(e.children,"")})`;case"Parentheses":return`(${oe(e.children,"")})`;case"Brackets":return`[${oe(e.children,"")}]`;case"Raw":return e.value;case"Comment":return e.value.startsWith("!")?`/*${e.value}*/`:"";case"WhiteSpace":return" ";case"CDO":return"<!--";case"CDC":return"-->";case"AnPlusB":{let t=e.a??"",r=e.b??"";if(t&&r){let n=Number(r);return`${t==="1"?"":t==="-1"?"-":t}n${n>=0?`+${r}`:r}`}if(t)return`${t==="1"?"":t==="-1"?"-":t}n`;return r}case"Ratio":return`${e.left.value}/${e.right.value}`;case"UnicodeRange":return e.value;case"Nth":return e.selector?`${Q(e.nth)} of ${Q(e.selector)}`:Q(e.nth);case"MediaQueryList":return oe(e.children,",");case"MediaQuery":return oe(e.children,"");case"MediaFeature":{let t=`(${e.name}`;if(e.value)t+=`:${Q(e.value)}`;return t+=")",t}}return""}function oe(e,t){let r="",n=!0,i=null,o=e.head;while(o!=null){let s=o.data;if(s.type==="WhiteSpace"){let a=o.next?o.next.data:null;if(Wi(i)||Wi(a)){o=o.next;continue}}let c=Q(s);if(!c){o=o.next;continue}if(!n&&t&&!gu(i))r+=t;n=!1,r+=c,i=s,o=o.next}return r}function du(e){let t="",r=null,n=e.head;while(n!=null){let i=n.data,o=Q(i);if(!o){n=n.next;continue}if(r&&hu(r,i))t+=";";t+=o,r=i,n=n.next}return t}function hu(e,t){return e.type==="Declaration"&&t.type!=="Comment"}function Wi(e){if(!e||e.type!=="Operator")return!1;let t=e.value;return t===":"||t===","||t==="/"}function gu(e){if(!e)return!1;return e.type==="Operator"||e.type==="Combinator"}function rn(e){let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n===92)t+="\\\\";else if(n===34)t+="\\\"";else if(n<32||n===127){let i=n.toString(16),o=r+1<e.length?e.charCodeAt(r+1):-1,s=o===32||o===9||o===10||o===12||o===13||o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102;t+=`\\${i}${s?" ":""}`}else t+=e[r]}return t}var We=(()=>{let e=new Uint8Array(128);for(let t=0;t<128;t++){let r=0;if(t===32||t===9||t===10||t===12||t===13)r|=1;if(t>=48&&t<=57)r|=2;if(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)r|=4;if(t>=65&&t<=90||t>=97&&t<=122||t===95)r|=8;if(t===10||t===12||t===13)r|=16;e[t]=r}return e})();function fe(e){return e<128&&(We[e]&2)!==0}function Ct(e){return e<128&&(We[e]&4)!==0}function zi(e){return e>=128||e<128&&(We[e]&8)!==0}function mu(e){return e===45||e>=128||e<128&&(We[e]&10)!==0}function pu(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function on(e){return e<128&&(We[e]&16)!==0}function Re(e){return e<128&&(We[e]&1)!==0}function Ve(e,t){if(e!==92)return!1;if(on(t))return!1;return!0}function nn(e,t,r){if(e===45)return zi(t)||t===45||Ve(t,r);if(zi(e))return!0;if(e===92)return Ve(e,t);return!1}function yu(e,t,r){if(e===43||e===45){if(fe(t))return!0;if(t===46&&fe(r))return!0;return!1}if(e===46)return fe(t);return fe(e)}class Ft{source;offset=0;types;starts;ends;count=0;_tokens=null;_lineStarts=null;constructor(e){this.source=e;let t=Math.max(64,Math.ceil(e.length/3));this.types=new Uint8Array(t),this.starts=new Uint32Array(t),this.ends=new Uint32Array(t),this.tokenize()}get lineStarts(){if(this._lineStarts==null)this._lineStarts=bu(this.source);return this._lineStarts}get tokens(){if(this._tokens!=null)return this._tokens;let e=Array.from({length:this.count});for(let t=0;t<this.count;t++)e[t]={type:this.types[t],start:this.starts[t],end:this.ends[t]};return this._tokens=e,e}addToken(e,t,r){if(this.count>=this.types.length)this.grow();this.types[this.count]=e,this.starts[this.count]=t,this.ends[this.count]=r,this.count++}grow(){let t=this.types.length*2,r=new Uint8Array(t);r.set(this.types),this.types=r;let n=new Uint32Array(t);n.set(this.starts),this.starts=n;let i=new Uint32Array(t);i.set(this.ends),this.ends=i}tokenize(){let e=this.source,t=0,r=e.length;while(t<r){let n=e.charCodeAt(t);if(n===47&&e.charCodeAt(t+1)===42){let s=t;t+=2;while(t<r&&!(e.charCodeAt(t)===42&&e.charCodeAt(t+1)===47))t++;t=t<r?t+2:r,this.addToken(25,s,t);continue}if(Re(n)){let s=t;while(t<r&&Re(e.charCodeAt(t)))t++;this.addToken(13,s,t);continue}if(n===34||n===39){t=this.consumeString(n,t);continue}if(n===35){if(t+1<r&&(mu(e.charCodeAt(t+1))||Ve(e.charCodeAt(t+1),e.charCodeAt(t+2)))){let s=t;t++,t=this.consumeName(t),this.addToken(4,s,t);continue}this.addToken(9,t,t+1),t++;continue}switch(n){case 40:this.addToken(21,t,t+1),t++;continue;case 41:this.addToken(22,t,t+1),t++;continue;case 91:this.addToken(19,t,t+1),t++;continue;case 93:this.addToken(20,t,t+1),t++;continue;case 123:this.addToken(23,t,t+1),t++;continue;case 125:this.addToken(24,t,t+1),t++;continue;case 44:this.addToken(18,t,t+1),t++;continue;case 58:this.addToken(16,t,t+1),t++;continue;case 59:this.addToken(17,t,t+1),t++;continue}if(n===60&&e.startsWith("!--",t+1)){this.addToken(14,t,t+4),t+=4;continue}if(n===45&&e.startsWith("->",t+1)){this.addToken(15,t,t+3),t+=3;continue}if(n===64){let s=e.charCodeAt(t+1),c=e.charCodeAt(t+2),a=e.charCodeAt(t+3);if(nn(s,c,a)){let l=t;t++,t=this.consumeName(t),this.addToken(3,l,t);continue}this.addToken(9,t,t+1),t++;continue}let i=e.charCodeAt(t+1),o=e.charCodeAt(t+2);if(yu(n,i,o)){t=this.consumeNumeric(t);continue}if(nn(n,i,o)){t=this.consumeIdentLike(t);continue}if(n===92){if(Ve(n,i)){t=this.consumeIdentLike(t);continue}this.addToken(9,t,t+1),t++;continue}this.addToken(9,t,t+1),t++}this.addToken(0,r,r)}consumeString(e,t){let r=this.source,n=r.length,i=t+1;while(i<n){let o=r.charCodeAt(i);if(o===e)return i++,this.addToken(5,t,i),i;if(on(o))return this.addToken(6,t,i),i;if(o===92){let s=r.charCodeAt(i+1);if(on(s)){i+=2;continue}if(i+1<n){i=this.consumeEscapeSkip(i+1);continue}}i++}return this.addToken(5,t,i),i}consumeEscapeSkip(e){let t=this.source;if(e>=t.length)return e;let r=t.charCodeAt(e);if(Ct(r)){let n=1;e++;while(n<6&&e<t.length&&Ct(t.charCodeAt(e)))e++,n++;if(e<t.length&&Re(t.charCodeAt(e)))e++;return e}return e+1}consumeName(e){let t=this.source,r=t.length,n=e;while(n<r){let i=t.charCodeAt(n);if(i<128&&(We[i]&10)!==0){n++;continue}if(i===45){n++;continue}if(i>=128){n++;continue}if(i===92&&Ve(i,t.charCodeAt(n+1))){n=this.consumeEscapeSkip(n+1);continue}break}return n}consumeNumber(e){let t=this.source,r=e;if(t.charCodeAt(r)===43||t.charCodeAt(r)===45)r++;while(r<t.length&&fe(t.charCodeAt(r)))r++;if(t.charCodeAt(r)===46&&fe(t.charCodeAt(r+1))){r+=2;while(r<t.length&&fe(t.charCodeAt(r)))r++}let n=t.charCodeAt(r);if(n===69||n===101){let i=t.charCodeAt(r+1),o=t.charCodeAt(r+2);if(fe(i)){r+=2;while(r<t.length&&fe(t.charCodeAt(r)))r++}else if((i===43||i===45)&&fe(o)){r+=3;while(r<t.length&&fe(t.charCodeAt(r)))r++}}return r}consumeNumeric(e){let t=this.source,r=this.consumeNumber(e),n=t.charCodeAt(r),i=t.charCodeAt(r+1),o=t.charCodeAt(r+2);if(nn(n,i,o)){let s=this.consumeName(r);return this.addToken(12,e,s),s}if(n===37)return this.addToken(11,e,r+1),r+1;return this.addToken(10,e,r),r}consumeIdentLike(e){let t=this.source,r=this.consumeName(e),n=t.charCodeAt(r);if(n===40&&r-e===3){let i=t.charCodeAt(e)|32,o=t.charCodeAt(e+1)|32,s=t.charCodeAt(e+2)|32;if(i===117&&o===114&&s===108){let c=r+1;while(c<t.length&&Re(t.charCodeAt(c)))c++;let a=t.charCodeAt(c);if(a===34||a===39)return this.addToken(2,e,r+1),r+1;return this.consumeUrl(e,r)}}if(n===40)return this.addToken(2,e,r+1),r+1;return this.addToken(1,e,r),r}consumeUrl(e,t){let r=this.source,n=r.length,i=t+1;while(i<n&&Re(r.charCodeAt(i)))i++;while(i<n){let o=r.charCodeAt(i);if(o===41)return i++,this.addToken(7,e,i),i;if(Re(o)){let s=i;while(i<n&&Re(r.charCodeAt(i)))i++;if(i>=n)return this.addToken(7,e,i),i;if(r.charCodeAt(i)===41)return i++,this.addToken(7,e,i),i;return this.consumeBadUrl(e,s)}if(o===34||o===39||o===40||pu(o))return this.consumeBadUrl(e,i);if(o===92){if(Ve(o,r.charCodeAt(i+1))){i=this.consumeEscapeSkip(i+1);continue}return this.consumeBadUrl(e,i)}i++}return this.addToken(7,e,i),i}consumeBadUrl(e,t){let r=this.source,n=t;while(n<r.length){let i=r.charCodeAt(n);if(i===41){n++;break}if(i===92&&Ve(i,r.charCodeAt(n+1))){n=this.consumeEscapeSkip(n+1);continue}n++}return this.addToken(8,e,n),n}locate(e){let t=this.lineStarts,r=0,n=t.length-1;while(r<n){let o=r+n+1>>1;if(t[o]<=e)r=o;else n=o-1}let i=t[r];return{line:r+1,column:e-i+1}}}function bu(e){let t=[0],r=e.length;for(let n=0;n<r;n++){let i=e.charCodeAt(n);if(i===10)t.push(n+1);else if(i===13){if(e.charCodeAt(n+1)!==10)t.push(n+1)}}return t}function sn(e,t,r){for(let n=t;n<r;n++)if(e.charCodeAt(n)===92)return xu(e,t,r,n);return e.slice(t,r)}function xu(e,t,r,n){let i=e.slice(t,n),o=n;while(o<r){if(e.charCodeAt(o)!==92){i+=e[o],o++;continue}if(o+1>=r){o++;continue}let c=e.charCodeAt(o+1);if(c===10){o+=2;continue}if(c===13){o+=e.charCodeAt(o+2)===10?3:2;continue}if(Ct(c)){let a=o+1,l="";while(l.length<6&&a<r&&Ct(e.charCodeAt(a)))l+=e[a],a++;let u=Number.parseInt(l,16);if(a<r&&Re(e.charCodeAt(a)))a++;i+=u===0||u>=55296&&u<=57343||u>1114111?String.fromCodePoint(65533):String.fromCodePoint(u),o=a;continue}i+=e[o+1],o+=2}return i}function an(e,t,r){for(let n=t;n<r;n++)if(e.charCodeAt(n)===92)return vu(e,t,r,n);return e.slice(t,r)}function vu(e,t,r,n){let i=e.slice(t,n),o=n;while(o<r){if(e.charCodeAt(o)!==92){i+=e[o],o++;continue}let c=o+1,a="";while(a.length<6&&c<r&&Ct(e.charCodeAt(c)))a+=e[c],c++;if(a.length>0){let l=Number.parseInt(a,16);if(c<r&&Re(e.charCodeAt(c)))c++;i+=l===0||l>=55296&&l<=57343||l>1114111?String.fromCodePoint(65533):String.fromCodePoint(l),o=c;continue}if(c<r){i+=e[c],o=c+1;continue}i+=String.fromCodePoint(65533),o=c}return i}function Xi(e,t){let r=new Ft(e);return{source:e,types:r.types,starts:r.starts,ends:r.ends,count:r.count,end:r.count,pos:0,positions:t.positions??!1,filename:t.filename,parseValue:t.parseValue??!0,parseAtrulePrelude:t.parseAtrulePrelude??!0,parseCustomProperty:t.parseCustomProperty??!1,parseRulePrelude:t.parseRulePrelude??!0,onParseError:t.onParseError,tokenizer:r}}function b(e){return e.pos<e.end?e.types[e.pos]:0}function v(e){let t=e.pos;if(t>=e.end)return{type:0,start:e.starts[t]??e.source.length,end:e.ends[t]??e.source.length};return{type:e.types[t],start:e.starts[t],end:e.ends[t]}}function C(e){let t=e.pos++;if(t>=e.end)return{type:0,start:e.starts[t]??e.source.length,end:e.ends[t]??e.source.length};return{type:e.types[t],start:e.starts[t],end:e.ends[t]}}function xe(e,t){return e.source.slice(t.start,t.end)}function de(e){let{types:t,end:r}=e;while(e.pos<r){let n=t[e.pos];if(n===13||n===25)e.pos++;else break}}function Ki(e){let{types:t,end:r}=e;while(e.pos<r&&t[e.pos]===13)e.pos++}function R(e,t,r){if(!e.positions)return null;let n=e.tokenizer.locate(t.start),i=e.tokenizer.locate(r.end);return{source:e.filename??"<unknown>",start:{offset:t.start,line:n.line,column:n.column},end:{offset:r.end,line:i.line,column:i.column}}}function Zi(e){if(!e.positions)return null;let t=v(e),r=e.tokenizer.locate(t.start);return{source:e.filename??"<unknown>",start:{offset:t.start,line:r.line,column:r.column},end:{offset:t.start,line:r.line,column:r.column}}}function Dt(e,t,r,n){return{type:"Raw",value:e,loc:R(n,t,r)}}function te(){return new le}function ln(e,t,r,n){if(e.onParseError){let{line:i,column:o}=e.tokenizer.locate(r.start),s=SyntaxError(`${e.filename??"<input>"}:${i}:${o}: ${t}`);s.line=i,s.column=o,s.offset=r.start,e.onParseError(s,n)}return n}function Bt(e,t={}){let r=Xi(e,t);switch(t.context??"stylesheet"){case"stylesheet":return qi(r);case"atrule":return Ut(r)??Hi(r);case"atrulePrelude":return Ru(r);case"mediaQuery":case"mediaQueryList":return Gi(r);case"rule":return un(r);case"selectorList":return hn(r);case"selector":return ro(r);case"block":return fn(r);case"declarationList":return Au(r);case"declaration":return dn(r)??Hi(r);case"value":return Eu(r);case"raw":return Gi(r);default:return qi(r)}}function Hi(e){return{type:"StyleSheet",children:te(),loc:Zi(e)}}function Gi(e){let t=v(e),r=t;while(b(e)!==0)r=C(e);return{type:"Raw",value:e.source.slice(t.start,r.end),loc:R(e,t,r)}}function qi(e){let t=v(e),r=te(),{types:n,end:i}=e;while(e.pos<i){let c=n[e.pos];if(c===13){e.pos++;continue}if(c===25){let u={type:25,start:e.starts[e.pos],end:e.ends[e.pos]},f=cn(e,u);e.pos++,r.appendData(f);continue}if(c===0)break;if(c===14||c===15){e.pos++;continue}if(c===3){let u=Ut(e);if(u)r.appendData(u);continue}if(c===24){e.pos++;continue}let a=e.pos,l=un(e);if(r.appendData(l),e.pos===a)e.pos++}let o=e.end-1,s=o>=0?{type:e.types[o],start:e.starts[o],end:e.ends[o]}:{type:0,start:0,end:0};return{type:"StyleSheet",children:r,loc:R(e,t,s)}}function cn(e,t){return{type:"Comment",value:e.source.slice(t.start+2,t.end-2),loc:R(e,t,t)}}function Ut(e){let t=v(e);if(t.type!==3)return null;e.pos++;let r=jt(e.source,t.start+1,t.end);de(e);let n=e.pos,i=v(e),{types:o,end:s}=e,c=n,a=n;while(c<s){let f=o[c];if(f===0||f===17||f===23)break;if(f!==13&&f!==25)a=c+1;c++}let l=null;if(a>n){let f=e.starts[n],d=e.ends[a-1],h={type:o[a-1],start:e.starts[a-1],end:d},m=e.source.slice(f,d).trim();if(m.length>0)if(e.parseAtrulePrelude)try{let g=e.end;e.end=a,e.pos=n;let p=te();while(b(e)!==0){let y=ze(e);if(y)p.appendData(y)}if(eo(p),e.end=g,e.pos=c,p.isEmpty)l=Dt(m,i,h,e);else l={type:"AtrulePrelude",children:p,loc:null}}catch(g){let p=Dt(m,i,h,e);ln(e,`Failed to parse @${r} prelude: ${g.message}`,i,p),l=p,e.pos=c}else l=Dt(m,i,h,e),e.pos=c;else e.pos=c}else e.pos=c;let u=null;if(b(e)===17)C(e);else if(b(e)===23)u=fn(e,Cu.has(r));return{type:"Atrule",name:r,prelude:l,block:u,loc:R(e,t,v(e))}}var $u=new Set(["is","not","where","has","matches","-moz-any","-webkit-any"]),Cu=new Set(["media","supports","document","layer","container","scope","starting-style","-moz-document","keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes"]);function Ru(e){let t=v(e),r=te();while(b(e)!==0){if(v(e).type===13){e.pos++;continue}let i=ze(e);if(i)r.appendData(i)}return{type:"AtrulePrelude",children:r,loc:R(e,t,v(e))}}function un(e){let t=v(e),r;if(e.parseRulePrelude)r=hn(e);else{let i=v(e),o=i;while(b(e)!==0&&b(e)!==23)o=C(e);let s=e.source.slice(i.start,o.end).trim();r=Dt(s,i,o,e)}let n=fn(e,!0);return{type:"Rule",prelude:r,block:n,loc:R(e,t,v(e))}}function fn(e,t=!1){let r=v(e);if(b(e)!==23)return{type:"Block",children:te(),loc:Zi(e)};e.pos++;let n=te(),{types:i,end:o}=e;while(e.pos<o){let s=i[e.pos];if(s===24||s===0)break;if(s===13){e.pos++;continue}if(s===25){let a={type:25,start:e.starts[e.pos],end:e.ends[e.pos]};e.pos++,n.appendData(cn(e,a));continue}if(s===3){let a=Ut(e);if(a)n.appendData(a);continue}if(t&&ku(e,Su)){let a=un(e);n.appendData(a);continue}let c=dn(e);if(c)n.appendData(c);if(e.pos<o&&i[e.pos]===17)e.pos++}if(b(e)===24)e.pos++;return{type:"Block",children:n,loc:R(e,r,v(e))}}function ku(e,t){let r=e.pos,n=t(e);return e.pos=r,n}function Su(e){let{types:t,end:r}=e;while(e.pos<r){let n=t[e.pos];if(n===23)return!0;if(n===17||n===24||n===0)return!1;e.pos++}return!1}function Au(e){let t=v(e),r=te();while(b(e)!==0&&b(e)!==24){let n=v(e);if(n.type===13){e.pos++;continue}if(n.type===25){r.appendData(cn(e,C(e)));continue}if(n.type===17){e.pos++;continue}if(n.type===3){let o=Ut(e);if(o)r.appendData(o);continue}let i=dn(e);if(i)r.appendData(i);if(b(e)===17)C(e)}return{type:"DeclarationList",children:r,loc:R(e,t,v(e))}}function dn(e){de(e);let t=v(e);if(t.type!==1&&t.type!==4&&!(t.type===9&&e.source[t.start]==="*"&&e.source[t.start+1]===" "))if(t.type===9&&e.source[t.start]==="*")e.pos++;else{ln(e,"Expected property name",t,{type:"Raw",value:"",loc:null});let{types:S,end:j}=e;while(e.pos<j){let G=S[e.pos];if(G===0||G===17||G===24)break;e.pos++}return null}let r=e.starts[e.pos],n=e.ends[e.pos];e.pos++;let i=e.source.slice(r,n);if(Ki(e),b(e)!==16){ln(e,`Expected ':' after property "${i}"`,v(e),{type:"Raw",value:"",loc:null});let{types:S,end:j}=e;while(e.pos<j){let G=S[e.pos];if(G===0||G===17||G===24)break;e.pos++}return null}e.pos++,Ki(e);let{types:o,starts:s,end:c,pos:a}=e,l=a,u=a,f=-1,d=-1;while(l<c){let S=o[l];if(S===0||S===17||S===24)break;if(S===9&&e.source.charCodeAt(s[l])===33){let j=l+1;while(j<c&&o[j]===13)j++;if(j<c&&o[j]===1){let G=s[j];if(e.ends[j]-G===9&&(e.source.charCodeAt(G)|32)===105&&(e.source.charCodeAt(G+1)|32)===109&&(e.source.charCodeAt(G+2)|32)===112&&(e.source.charCodeAt(G+3)|32)===111&&(e.source.charCodeAt(G+4)|32)===114&&(e.source.charCodeAt(G+5)|32)===116&&(e.source.charCodeAt(G+6)|32)===97&&(e.source.charCodeAt(G+7)|32)===110&&(e.source.charCodeAt(G+8)|32)===116){d=l,f=j,l=j+1;continue}}}if(S!==13&&S!==25)u=l+1;l++}let h=u,m=f>=0?{type:1,start:s[f],end:e.ends[f]}:null,g=i.startsWith("--"),p,y=s[a],x=h>a?e.ends[h-1]:y,w={type:o[a],start:y,end:e.ends[a]},T=h>a?{type:o[h-1],start:s[h-1],end:x}:w;if(g&&!e.parseCustomProperty||!e.parseValue)p={type:"Raw",value:e.source.slice(y,x).trim(),loc:R(e,w,T)};else if(h===a)p={type:"Value",children:te(),loc:R(e,w,T)};else{let S=e.end;e.end=h,e.pos=a,p=Qi(e),e.end=S}return e.pos=l,{type:"Declaration",property:i,important:m?!0:!1,value:p,loc:R(e,t,v(e))}}function Eu(e){return Qi(e)}function Qi(e){let t=v(e),r=te();while(b(e)!==0&&b(e)!==17&&b(e)!==24&&b(e)!==22&&b(e)!==20){let n=ze(e);if(n)r.appendData(n)}return to(r),{type:"Value",children:r,loc:R(e,t,v(e))}}function eo(e){for(let t of e)if("children"in t&&t.children instanceof le)eo(t.children);to(e)}function to(e){let t=e.head;while(t){if(t.data.type==="Number"){let r=t.next;while(r&&r.data.type==="WhiteSpace")r=r.next;if(r&&r.data.type==="Operator"&&r.data.value==="/"){let n=r.next;while(n&&n.data.type==="WhiteSpace")n=n.next;if(n&&n.data.type==="Number"){let i={type:"Ratio",left:t.data,right:n.data,loc:null},o=t.next;while(o&&o!==n.next){let s=o.next;e.remove(o),o=s}e.replace(t,e.createItem(i)),t=e.head;continue}}}t=t.next}}function ze(e){let t=e.pos;if(t>=e.end)return null;let r=e.types[t],n=e.starts[t],i=e.ends[t],o=e.source;switch(r){case 13:return e.pos++,e.positions?{type:"WhiteSpace",value:" ",loc:ee(e,n,i)}:{type:"WhiteSpace",value:" ",loc:null};case 25:return e.pos++,{type:"Comment",value:o.slice(n+2,i-2),loc:e.positions?ee(e,n,i):null};case 10:return e.pos++,{type:"Number",value:o.slice(n,i),loc:e.positions?ee(e,n,i):null};case 11:return e.pos++,{type:"Percentage",value:o.slice(n,i-1),loc:e.positions?ee(e,n,i):null};case 12:{e.pos++;let s=n,c=o.charCodeAt(s);if(c===43||c===45)s++;let a=!1;while(s<i){let u=o.charCodeAt(s);if(u>=48&&u<=57){s++;continue}if(u===46&&!a){a=!0,s++;continue}break}let l=o.charCodeAt(s);if(l===69||l===101){let u=s+1,f=o.charCodeAt(u);if(f===43||f===45)u++;let d=!1;while(u<i){let h=o.charCodeAt(u);if(h>=48&&h<=57){u++,d=!0;continue}break}if(d)s=u}return{type:"Dimension",value:o.slice(n,s),unit:o.slice(s,i),loc:e.positions?ee(e,n,i):null}}case 1:return e.pos++,{type:"Identifier",name:an(o,n,i),loc:e.positions?ee(e,n,i):null};case 5:{e.pos++;let s=n+1,a=i-n>=2&&o.charCodeAt(i-1)===o.charCodeAt(n)?i-1:i;return{type:"String",value:sn(o,s,a),loc:e.positions?ee(e,n,i):null}}case 7:{e.pos++;let s=n+4;while(s<i&&Yi(o.charCodeAt(s)))s++;let c=i;if(c>s&&o.charCodeAt(c-1)===41)c--;while(c>s&&Yi(o.charCodeAt(c-1)))c--;let a;if(c-s>=2){let l=o.charCodeAt(s),u=o.charCodeAt(c-1);if((l===34||l===39)&&l===u)a=o.slice(s+1,c-1);else a=o.slice(s,c)}else a=o.slice(s,c);return{type:"Url",value:a,loc:e.positions?ee(e,n,i):null}}case 4:return e.pos++,{type:"Hash",name:o.slice(n+1,i),loc:e.positions?ee(e,n,i):null};case 2:return Nu(e);case 21:return Ou(e);case 18:return e.pos++,{type:"Operator",value:",",loc:e.positions?ee(e,n,i):null};case 16:return e.pos++,{type:"Operator",value:":",loc:e.positions?ee(e,n,i):null};case 9:{e.pos++;let s=o.charCodeAt(n),c=o[n];if(Tu(s))return{type:"Operator",value:c,loc:e.positions?ee(e,n,i):null};return{type:"Identifier",name:c,loc:e.positions?ee(e,n,i):null}}case 19:{e.pos++;let s=te();while(b(e)!==0&&b(e)!==20){let a=ze(e);if(a)s.appendData(a)}let c=e.pos<e.end?e.ends[e.pos]:i;if(b(e)===20)e.pos++;return{type:"Brackets",children:s,loc:e.positions?ee(e,n,c):null}}case 3:case 23:case 24:case 22:case 20:case 17:case 0:case 14:case 15:case 6:case 8:return e.pos++,{type:"Raw",value:o.slice(n,i),loc:e.positions?ee(e,n,i):null}}return e.pos++,null}function Yi(e){return e===32||e===9||e===10||e===12||e===13}function Tu(e){return e===47||e===43||e===45||e===42||e===61||e===62||e===60||e===126||e===124||e===36||e===94||e===33||e===38}function jt(e,t,r){for(let n=t;n<r;n++){let i=e.charCodeAt(n);if(i>=65&&i<=90)return e.slice(t,r).toLowerCase()}return e.slice(t,r)}function ee(e,t,r){let n=e.tokenizer.locate(t),i=e.tokenizer.locate(r);return{source:e.filename??"<unknown>",start:{offset:t,line:n.line,column:n.column},end:{offset:r,line:i.line,column:i.column}}}function Nu(e){let t=C(e),r=jt(e.source,t.start,t.end-1),n=te();while(b(e)!==0&&b(e)!==22){let i=ze(e);if(i)n.appendData(i)}if(b(e)===22)C(e);if(r==="url"){for(let i=n.head;i!=null;i=i.next)if(i.data.type==="String")return{type:"Url",value:i.data.value,loc:R(e,t,v(e))}}return{type:"Function",name:r,children:n,loc:R(e,t,v(e))}}function Ou(e){let t=C(e),r=te();while(b(e)!==0&&b(e)!==22){let n=ze(e);if(n)r.appendData(n)}if(b(e)===22)C(e);return{type:"Parentheses",children:r,loc:R(e,t,v(e))}}function hn(e){let t=v(e),r=te();while(b(e)!==0){if(de(e),b(e)===0||b(e)===23)break;let n=ro(e);if(n.children.head!==null)r.appendData(n);if(de(e),b(e)===18){C(e);continue}break}return{type:"SelectorList",children:r,loc:R(e,t,v(e))}}function ro(e){let t=v(e),r=te(),n=!0;while(b(e)!==0&&b(e)!==18&&b(e)!==23){let i=v(e);if(i.type===13){if(C(e),!n&&b(e)!==0&&b(e)!==18&&b(e)!==23&&!Ji(e)&&!Iu(e)){let s={type:"Combinator",name:" ",loc:R(e,i,i)};r.appendData(s),n=!0}continue}if(i.type===9&&e.source.charCodeAt(i.start)===124&&e.types[e.pos+1]===9&&e.source.charCodeAt(e.starts[e.pos+1])===124){let s=v(e);C(e);let c=C(e),a={type:"Combinator",name:"||",loc:R(e,s,c)};r.appendData(a),n=!0,de(e);continue}if(Ji(e)){let s=C(e),a={type:"Combinator",name:e.source[s.start],loc:R(e,s,s)};r.appendData(a),n=!0,de(e);continue}let o=Pu(e);if(!o)break;r.appendData(o),n=!1}while(r.tail&&r.tail.data.type==="Combinator")r.remove(r.tail);return{type:"Selector",children:r,loc:R(e,t,v(e))}}function Ji(e){let t=v(e);if(t.type!==9)return!1;let r=e.source[t.start];return r===">"||r==="+"||r==="~"}function Iu(e){if(e.types[e.pos]!==9)return!1;if(e.source.charCodeAt(e.starts[e.pos])!==124)return!1;if(e.types[e.pos+1]!==9)return!1;return e.source.charCodeAt(e.starts[e.pos+1])===124}function Pu(e){let t=v(e);switch(t.type){case 1:{if(C(e),b(e)===9&&e.source[v(e).start]==="|"&&e.source[v(e).start+1]!=="="&&!(e.types[e.pos+1]===9&&e.source.charCodeAt(e.starts[e.pos+1])===124)){if(C(e),b(e)===1){let n=C(e);return{type:"TypeSelector",name:`${xe(e,t)}|${xe(e,n)}`,loc:R(e,t,n)}}if(b(e)===9&&e.source[v(e).start]==="*"){let n=C(e);return{type:"TypeSelector",name:`${xe(e,t)}|*`,loc:R(e,t,n)}}}return{type:"TypeSelector",name:xe(e,t),loc:R(e,t,t)}}case 11:return C(e),{type:"TypeSelector",name:xe(e,t),loc:R(e,t,t)};case 10:return C(e),{type:"TypeSelector",name:xe(e,t),loc:R(e,t,t)};case 9:{let r=e.source[t.start];if(r==="*")return C(e),{type:"TypeSelector",name:"*",loc:R(e,t,t)};if(r==="."){if(C(e),b(e)===1){let n=C(e);return{type:"ClassSelector",name:xe(e,n),loc:R(e,t,n)}}return null}if(r==="&")return C(e),{type:"NestingSelector",loc:R(e,t,t)};return C(e),null}case 4:return C(e),{type:"IdSelector",name:e.source.slice(t.start+1,t.end),loc:R(e,t,t)};case 16:{C(e);let r=b(e)===16;if(r)C(e);return _u(e,r,t)}case 19:return Lu(e)}return null}function _u(e,t,r){let n=v(e);if(n.type===1){C(e);let i=jt(e.source,n.start,n.end);return t?{type:"PseudoElementSelector",name:i,children:null,loc:R(e,r,n)}:{type:"PseudoClassSelector",name:i,children:null,loc:R(e,r,n)}}if(n.type===2){C(e);let i=jt(e.source,n.start,n.end-1),o=te();if(!t&&$u.has(i)){let a=v(e),l=a,u=1;while(b(e)!==0&&u>0){if(b(e)===21||b(e)===2)u++;else if(b(e)===22){if(u--,u===0)break}l=C(e)}if(b(e)===22)C(e);let f=e.source.slice(a.start,l.end).trim();if(f.length>0){let d=Xi(f,{positions:!1}),h=hn(d);o.appendData(h)}}else{while(b(e)!==0&&b(e)!==22){let a=ze(e);if(a)o.appendData(a)}if(b(e)===22)C(e)}if(t)return{type:"PseudoElementSelector",name:i,children:o,loc:R(e,r,v(e))};return{type:"PseudoClassSelector",name:i,children:o,loc:R(e,r,v(e))}}return null}function Lu(e){let t=C(e);de(e);let r=v(e);if(r.type!==1)return null;C(e);let n={type:"Identifier",name:xe(e,r),loc:R(e,r,r)};de(e);let i=null,o=null,s=null,c=v(e);if(c.type===9){let l=e.source[c.start],u=e.source[c.start+1];if(l==="=")i="=",C(e);else if((l==="~"||l==="|"||l==="^"||l==="$"||l==="*")&&u==="="){C(e);let h=v(e);if(h.type===9&&e.source[h.start]==="=")C(e),i=`${l}=`}de(e);let f=v(e);if(f.type===5){C(e);let h=f.end-f.start>=2&&e.source.charCodeAt(f.end-1)===e.source.charCodeAt(f.start);o={type:"String",value:sn(e.source,f.start+1,h?f.end-1:f.end),loc:R(e,f,f)}}else if(f.type===1)C(e),o={type:"Identifier",name:xe(e,f),loc:R(e,f,f)};de(e);let d=v(e);if(d.type===1)C(e),s=xe(e,d)}de(e);let a=v(e);if(b(e)===20)a=C(e);return{type:"AttributeSelector",name:n,matcher:i,value:o,flags:s,loc:R(e,t,a)}}var no=Symbol("walkSkip"),U=Symbol("walkStop");function Mu(e){return{root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null}}function Fu(e,t){let r=Mu(e),n=typeof t==="function"?t:t.enter,i=typeof t==="function"?null:t.leave??null,o=typeof t==="function"?null:t.visit??null,s=typeof t==="function"?!1:t.reverse??!1;function c(a,l,u){let f=null,d;switch(a.type){case"StyleSheet":f="stylesheet",d=r.stylesheet,r.stylesheet=a;break;case"Atrule":f="atrule",d=r.atrule,r.atrule=a;break;case"AtrulePrelude":f="atrulePrelude",d=r.atrulePrelude,r.atrulePrelude=a;break;case"Rule":f="rule",d=r.rule,r.rule=a;break;case"Selector":f="selector",d=r.selector,r.selector=a;break;case"Block":f="block",d=r.block,r.block=a;break;case"Declaration":f="declaration",d=r.declaration,r.declaration=a;break;case"Function":f="function",d=r.function,r.function=a;break}let h;if((o===null||o===a.type)&&n){let m=n.call(r,a,l,u);if(m===no){if(f)r[f]=d;return}if(m===U){if(f)r[f]=d;return U}}if(h=Du(a,s,c),h===U){if(f)r[f]=d;return U}if((o===null||o===a.type)&&i){if(i.call(r,a,l,u)===U){if(f)r[f]=d;return U}}if(f)r[f]=d;return}return c(e,null,null)}var Ke=Object.assign(Fu,{skip:no,stop:U});function Du(e,t,r){if("children"in e&&e.children instanceof le)return ju(e.children,t,r);if(e.type==="Rule"){if(r(e.prelude,null,null)===U)return U;if(r(e.block,null,null)===U)return U;return}if(e.type==="Atrule"){if(e.prelude){if(r(e.prelude,null,null)===U)return U}if(e.block){if(r(e.block,null,null)===U)return U}return}if(e.type==="Declaration")return r(e.value,null,null);if(e.type==="AttributeSelector"){if(r(e.name,null,null)===U)return U;if(e.value)return r(e.value,null,null);return}return}function ju(e,t,r){let n;if(t)e.forEachRight((i,o,s)=>{if(n)return;if(r(i,o,s)===U)n=U});else e.forEach((i,o,s)=>{if(n)return;if(r(i,o,s)===U)n=U});return n}function Qe(e,t={}){let r=t.exclamation??!1,n=!1;Ke(e,(i,o,s)=>{if(i.type!=="Comment")return;let c=i.value.startsWith("!");if(r===!0&&c)return;if(r==="first-exclamation"&&c&&!n){n=!0;return}if(o&&s)s.remove(o)})}function Vt(e){Ke(e,(t)=>{if(t.type!=="Block"&&t.type!=="DeclarationList")return;if(!("children"in t)||!t.children)return;let r=t.children,n=r.head;if(n==null||n.next==null)return;let i=0;for(let c=n;c!=null;c=c.next)if(c.data.type==="Declaration"){if(i++,i>=2)break}if(i<2)return;let o=new Map,s=[];for(let c=n;c!=null;c=c.next){let a=c.data;if(a.type!=="Declaration")continue;let l=a.property,u=o.get(l);if(u){let f=!!u.decl.important,d=!!a.important;if(d||f===d)s.push(u.item),o.set(l,{item:c,decl:a});else s.push(c)}else o.set(l,{item:c,decl:a})}for(let c of s)r.remove(c)})}var Bu={black:"#000",fuchsia:"#f0f",white:"#fff",red:"#f00",cyan:"#0ff",blue:"#00f",yellow:"#ff0",magenta:"#f0f",lime:"#0f0",silver:"#c0c0c0",gray:"#808080",maroon:"#800000",olive:"#808000",green:"#008000",purple:"#800080",teal:"#008080",navy:"#000080"},Uu={"#f00":"red","#ff0000":"red","#000080":"navy","#008080":"teal"};function mn(e){if(!e.startsWith("#"))return e;let t=e.slice(1);if(t.length===6){if(t[0]===t[1]&&t[2]===t[3]&&t[4]===t[5])return`#${t[0]}${t[2]}${t[4]}`}if(t.length===8){if(t[0]===t[1]&&t[2]===t[3]&&t[4]===t[5]&&t[6]===t[7])return`#${t[0]}${t[2]}${t[4]}${t[6]}`}return e}function io(e){let t=e.toLowerCase();return Bu[t]??null}function oo(e){let t=e.toLowerCase();return Uu[t]??null}function Vu(e,t,r){let n=(e<<16|t<<8|r).toString(16).padStart(6,"0");return mn(`#${n}`)}var Wu=/^rgba?\(\s*([+-]?\d*\.?\d+%?)\s*[,\s]\s*([+-]?\d*\.?\d+%?)\s*[,\s]\s*([+-]?\d*\.?\d+%?)\s*(?:[,/]\s*([+-]?\d*\.?\d+%?)\s*)?\)$/;function so(e){let t=Wu.exec(e.trim());if(!t)return e;let r=gn(t[1]),n=gn(t[2]),i=gn(t[3]);if(t[4]!==void 0&&!zu(t[4]))return e;return Vu(r,n,i)}function zu(e){if(e.endsWith("%"))return Number.parseFloat(e)>=100;return Number.parseFloat(e)>=1}function gn(e){if(e.endsWith("%"))return Math.max(0,Math.min(255,Math.round(Number.parseFloat(e)*2.55)));return Math.max(0,Math.min(255,Math.round(Number.parseFloat(e))))}var Ku=new Set(["px","pt","pc","in","cm","mm","q","em","rem","ex","ch","cap","ic","lh","rlh","vw","vh","vi","vb","vmin","vmax","svw","svh","svi","svb","svmin","svmax","lvw","lvh","lvi","lvb","lvmin","lvmax","dvw","dvh","dvi","dvb","dvmin","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"]);function Wt(e){if(e.charCodeAt(0)===43)e=e.slice(1);if(e.includes(".")){let t=e.replace(/(\.\d*?)0+($|[eE])/,"$1$2");t=t.replace(/\.($|[eE])/,"$1"),e=t}if(e.startsWith("0.")&&e.length>2)e=e.slice(1);else if(e.startsWith("-0.")&&e.length>3)e=`-${e.slice(2)}`;if(e==="-0"||e==="-.0"||e==="-0.0")e="0";return e}function ao(e,t){let r=Wt(e);if((r==="0"||r==="-0")&&Ku.has(t.toLowerCase()))return{value:"0",unit:""};return{value:r,unit:t}}function lo(e){return Wt(e)}function co(e,t){let r=Number.parseFloat(e);if(!Number.isFinite(r))return e;let n=t<0?0:t;return r.toFixed(n)}var uo=new Set(["color","background","background-color","border","border-color","border-top","border-top-color","border-right","border-right-color","border-bottom","border-bottom-color","border-left","border-left-color","border-block","border-block-color","border-block-start-color","border-block-end-color","border-inline","border-inline-color","border-inline-start-color","border-inline-end-color","outline","outline-color","caret-color","fill","stroke","flood-color","lighting-color","stop-color","column-rule","column-rule-color","text-decoration","text-decoration-color","text-emphasis","text-emphasis-color","text-shadow","box-shadow","accent-color","scrollbar-color"]);function fo(e){if(!e||e.type!=="Operator")return!1;let t=e.value;return t===":"||t===","||t==="/"}function Hu(e){let t=e.children;if(!t)return;while(t.head&&t.head.data.type==="WhiteSpace")t.remove(t.head);while(t.tail&&t.tail.data.type==="WhiteSpace")t.remove(t.tail);let r=t.head;while(r){let n=r.next;if(r.data.type==="WhiteSpace"){let i=r.prev&&fo(r.prev.data),o=n&&fo(n.data);if(i||o)t.remove(r)}r=n}}function pn(e,t={}){let r=t.floatPrecision??null,n=r===null?null:(i)=>co(i,r);Ke(e,{enter(i,o,s){switch(i.type){case"Number":{let c=n?n(i.value):i.value;i.value=Wt(c);return}case"Percentage":{let c=n?n(i.value):i.value;i.value=lo(c);return}case"Dimension":{let c=n?n(i.value):i.value,a=ao(c,i.unit);i.value=a.value,i.unit=a.unit;return}case"Hash":{let c=mn(`#${i.name}`).slice(1);if(i.name=c,o&&s&&this.declaration&&uo.has(this.declaration.property.toLowerCase())){let a=oo(`#${c}`);if(a&&a.length<c.length+1){let l={type:"Identifier",name:a,loc:i.loc};s.replace(o,s.createItem(l))}}return}case"Identifier":{if(!o||!s||!this.declaration)return;if(!uo.has(this.declaration.property.toLowerCase()))return;let c=io(i.name);if(c&&c.length<i.name.length){let a={type:"Hash",name:c.slice(1),loc:i.loc};s.replace(o,s.createItem(a))}return}case"Url":return;case"Function":{let c=i.name.toLowerCase();if((c==="rgb"||c==="rgba")&&o&&s)i.__rgbReplaceCandidate=!0}}},leave(i,o,s){if(i.type==="Parentheses"||i.type==="Function"||i.type==="Value")Hu(i);if(i.type==="Function"&&i.__rgbReplaceCandidate&&o&&s){let c=Q(i),a=so(c);if(a!==c&&a.startsWith("#")){let l={type:"Hash",name:a.slice(1),loc:i.loc};s.replace(o,s.createItem(l))}}}})}function Gu(e,t={}){let r=Bt(e,{context:"stylesheet"});return ho(r,t)}function yn(e,t={}){let r=Bt(e,{context:"declarationList"});return ho(r,t)}function ho(e,t){if(t.comments===!1)Qe(e,{exclamation:!1});else if(t.comments==="first-exclamation")Qe(e,{exclamation:"first-exclamation"});else Qe(e,{exclamation:!0});return pn(e,{floatPrecision:t.floatPrecision??null}),Vt(e),{css:Q(e),ast:e}}function Le(e,t,r){if(e.size>=1e4){let n=e.keys().next().value;if(n!==void 0)e.delete(n)}return e.set(t,r),r}var go=new Map,_e=new Map;var bn={col:"col",row:"row",jc:"justify",ji:"justify-items",js:"justify-self",ai:"items",ac:"content",as:"self",wrap:"wrap",nowrap:"nowrap",c:"center",s:"start",e:"end",sb:"between",sa:"around",se:"evenly",st:"stretch",thin:"thin",extralight:"extralight",light:"light",normal:"normal",medium:"medium",semibold:"semibold",bold:"bold",extrabold:"extrabold",black:"black",t:"top",r:"right",b:"bottom",l:"left"},Ju=/[%#()]/,Xu=/^\d+(?:\.\d+)?(?:px|rem|em|vh|vw|dvh|dvw|svh|svw|lvh|lvw|ch|ex|lh|cap|ic|rlh|vi|vb|vmin|vmax|cqw|cqh|cqi|cqb|cqmin|cqmax|cm|mm|in|pt|pc|Q)$/,$o=["calc","min","max","clamp","mod","rem","sin","cos","tan","asin","acos","atan","atan2","pow","sqrt","hypot","log","exp","round"],Zu=new Set($o);function se(e){return Ju.test(e)||Xu.test(e)}function mo(e){if(!$o.some((o)=>e.includes(`${o}(`)))return e;let t="",r=[],n=null,i=null;for(let o=0;o<e.length;o++){let s=e.charCodeAt(o);if(s>=48&&s<=57)n=o;else if(n!==null&&(s===37||s>=97&&s<=122||s>=65&&s<=90))n=o;else i=n,n=null;if(s===40){t+=e[o];let a=o;for(let u=o-1;u>=0;u--){let f=e.charCodeAt(u);if(f>=48&&f<=57||f>=97&&f<=122)a=u;else break}let l=e.slice(a,o);if(Zu.has(l))r.unshift(!0);else if(r[0]&&l==="")r.unshift(!0);else r.unshift(!1);continue}if(s===41){t+=e[o],r.shift();continue}if(s===44&&r[0]){t+=", ";continue}if(s===32&&r[0]&&t.charCodeAt(t.length-1)===32)continue;if((s===43||s===45||s===42||s===47)&&r[0]){let a=t.trimEnd(),l=a.charCodeAt(a.length-1),u=a.charCodeAt(a.length-2),f=e.charCodeAt(o+1),d=l===43||l===45||l===42||l===47,h=f===43||f===45||f===42||f===47;if((l===101||l===69)&&u>=48&&u<=57)t+=e[o];else if(d||l===40||l===44)t+=e[o];else if(e.charCodeAt(o-1)===32)t+=`${e[o]} `;else if(l>=48&&l<=57||f>=48&&f<=57||l===41||f===40||h||i!==null&&i===o-1)t+=` ${e[o]} `;else t+=e[o];continue}t+=e[o]}return t}function zt(e){if(!e.includes("_"))return mo(e);let t="",r=0;while(r<e.length){let n=e[r];if(n==="\\"&&e[r+1]==="_"){t+="_",r+=2;continue}if(n==="u"&&e.slice(r,r+4)==="url("){let i=r,o=1;r+=4;while(r<e.length&&o>0){if(e[r]==="(")o++;else if(e[r]===")")o--;r++}t+=e.slice(i,r);continue}t+=n==="_"?" ":n,r++}return mo(t)}function po(e,t){if(t.length!==2)return null;let[r,n]=t;if(r!=="min"&&r!=="max")return null;return[se(n)?`${r}-${e}-[${n}]`:`${r}-${e}-${n}`]}var Qu={flex:{expand:(e,t)=>{let r=t[e]||e;if(["col","row","col-reverse","row-reverse","wrap","nowrap","wrap-reverse"].includes(r))return`flex-${r}`;let n=e.match(/^(jc|ji|js|ai|ac|as)-(.+)$/);if(n){let i=t[n[1]]||n[1],o=t[n[2]]||n[2];return`${i}-${o}`}if(/^\d+$/.test(r)||["grow","shrink","auto","initial","none"].includes(r))return`flex-${r}`;return null}},grid:{expand:(e,t)=>{let r=t[e]||e;if(e.startsWith("cols-")||e.startsWith("rows-"))return`grid-${e}`;if(e.startsWith("flow-"))return`grid-${e}`;if(e.startsWith("gap-"))return e;return null}},text:{expand:(e,t)=>{let r=t[e]||e;if(se(r))return`text-[${r}]`;if(/^\d{3}$/.test(r))return{"100":"font-thin","200":"font-extralight","300":"font-light","400":"font-normal","500":"font-medium","600":"font-semibold","700":"font-bold","800":"font-extrabold","900":"font-black"}[r]||`font-[${r}]`;if(/^[a-z-]+$/i.test(r)&&!["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(r)){if(["white","black","inherit","current","transparent"].includes(r.toLowerCase()))return`text-${r}`;if(["red","blue","green","yellow","purple","pink","gray","slate","zinc","neutral","stone","orange","amber","lime","emerald","teal","cyan","sky","indigo","violet","fuchsia","rose"].includes(r.toLowerCase()))return`text-${r}-500`;return`font-[${r}]`}return`text-${r}`}},font:{expand:(e,t)=>{let r=t[e]||e,n=["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],i=["sans","serif","mono"];if(n.includes(r)||i.includes(r))return`font-${r}`;if(/^\d{3}$/.test(r))return{"100":"font-thin","200":"font-extralight","300":"font-light","400":"font-normal","500":"font-medium","600":"font-semibold","700":"font-bold","800":"font-extrabold","900":"font-black"}[r]||`font-[${r}]`;return`font-[${r}]`}},bg:{expand:(e,t)=>`bg-${t[e]||e}`},w:{expand:(e,t)=>{let r=t[e]||e;if(se(r))return`w-[${r}]`;return`w-${r}`},multiValue:(e)=>po("w",e)},h:{expand:(e,t)=>{let r=t[e]||e;if(se(r))return`h-[${r}]`;return`h-${r}`},multiValue:(e)=>po("h",e)},p:{expand:(e)=>`p-${e}`},px:{expand:(e)=>`px-${e}`},py:{expand:(e)=>`py-${e}`},pt:{expand:(e)=>`pt-${e}`},pr:{expand:(e)=>`pr-${e}`},pb:{expand:(e)=>`pb-${e}`},pl:{expand:(e)=>`pl-${e}`},m:{expand:(e)=>`m-${e}`},mx:{expand:(e)=>`mx-${e}`},my:{expand:(e)=>`my-${e}`},mt:{expand:(e)=>`mt-${e}`},mr:{expand:(e)=>`mr-${e}`},mb:{expand:(e)=>`mb-${e}`},ml:{expand:(e)=>`ml-${e}`},scroll:{expand:(e)=>{if(["x","y"].includes(e))return null;if(["auto","hidden","scroll","visible"].includes(e))return`overflow-${e}`;return null},multiValue:(e)=>{if(e.length===2){let[t,r]=e;if(["x","y"].includes(t)&&["auto","hidden","scroll","visible"].includes(r))return[`overflow-${t}-${r}`]}return null}},overflow:{expand:(e)=>`overflow-${e}`,multiValue:(e)=>{if(e.length===2){let[t,r]=e;if(["x","y"].includes(t))return[`overflow-${t}-${r}`]}return null}},border:{expand:(e)=>`border-${e}`},rounded:{expand:(e)=>`rounded-${e}`},shadow:{expand:(e)=>`shadow-${e}`},gap:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-"))return`gap-${e}`;return`gap-${e}`}},space:{expand:(e)=>`space-${e}`},opacity:{expand:(e)=>`opacity-${e}`},z:{expand:(e)=>`z-${e}`},inset:{expand:(e,t)=>{let r=t[e]||e;if(r.startsWith("x-")||r.startsWith("y-"))return`inset-${r}`;if(se(r))return`inset-[${r}]`;return`inset-${r}`}},top:{expand:(e)=>se(e)?`top-[${e}]`:`top-${e}`},right:{expand:(e)=>se(e)?`right-[${e}]`:`right-${e}`},bottom:{expand:(e)=>se(e)?`bottom-[${e}]`:`bottom-${e}`},left:{expand:(e)=>se(e)?`left-[${e}]`:`left-${e}`},duration:{expand:(e)=>`duration-${e}`},delay:{expand:(e)=>`delay-${e}`},ease:{expand:(e)=>`ease-${e}`},transition:{expand:(e)=>{if(["all","none","colors","opacity","shadow","transform"].includes(e))return`transition-${e}`;if(/^\d+$/.test(e))return`duration-${e}`;if(["linear","in","out","in-out","ease-linear","ease-in","ease-out","ease-in-out"].includes(e))return e.startsWith("ease-")?e:`ease-${e}`;return`transition-${e}`}},translate:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-")||e.startsWith("z-"))return`translate-${e}`;return`translate-${e}`}},rotate:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-")||e.startsWith("z-"))return`rotate-${e}`;return`rotate-${e}`}},scale:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-")||e.startsWith("z-"))return`scale-${e}`;return`scale-${e}`}},skew:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-"))return`skew-${e}`;return`skew-${e}`}},origin:{expand:(e)=>`origin-${e}`},cursor:{expand:(e)=>`cursor-${e}`},select:{expand:(e)=>`select-${e}`},resize:{expand:(e)=>`resize-${e}`},appearance:{expand:(e)=>`appearance-${e}`},pointer:{expand:(e)=>`pointer-events-${e}`},outline:{expand:(e)=>`outline-${e}`},ring:{expand:(e)=>`ring-${e}`},blur:{expand:(e)=>`blur-${e}`},brightness:{expand:(e)=>`brightness-${e}`},contrast:{expand:(e)=>`contrast-${e}`},grayscale:{expand:(e)=>`grayscale-${e}`},saturate:{expand:(e)=>`saturate-${e}`},sepia:{expand:(e)=>`sepia-${e}`},backdrop:{expand:(e)=>`backdrop-${e}`},aspect:{expand:(e)=>`aspect-${e}`},columns:{expand:(e)=>`columns-${e}`},break:{expand:(e)=>`break-${e}`},object:{expand:(e)=>`object-${e}`},overscroll:{expand:(e)=>`overscroll-${e}`},place:{expand:(e)=>`place-${e}`},items:{expand:(e)=>`items-${e}`},justify:{expand:(e)=>`justify-${e}`},content:{expand:(e)=>`content-${e}`},self:{expand:(e)=>`self-${e}`},order:{expand:(e)=>`order-${e}`},col:{expand:(e)=>`col-${e}`},row:{expand:(e)=>`row-${e}`},tracking:{expand:(e)=>`tracking-${e}`},leading:{expand:(e)=>`leading-${e}`},list:{expand:(e)=>`list-${e}`},decoration:{expand:(e)=>`decoration-${e}`},underline:{expand:(e)=>`underline-${e}`},accent:{expand:(e)=>`accent-${e}`},caret:{expand:(e)=>`caret-${e}`},"scroll-m":{expand:(e)=>`scroll-m-${e}`},"scroll-p":{expand:(e)=>`scroll-p-${e}`},snap:{expand:(e)=>`snap-${e}`},touch:{expand:(e)=>`touch-${e}`},will:{expand:(e)=>`will-change-${e}`},fill:{expand:(e)=>`fill-${e}`},stroke:{expand:(e)=>`stroke-${e}`},sr:{expand:(e)=>`sr-${e}`},invert:{expand:(e)=>`invert-${e}`},"hue-rotate":{expand:(e)=>se(e)?`hue-rotate-[${e}]`:`hue-rotate-${e}`},"drop-shadow":{expand:(e)=>`drop-shadow-${e}`},"backdrop-invert":{expand:(e)=>`backdrop-invert-${e}`},"backdrop-hue-rotate":{expand:(e)=>se(e)?`backdrop-hue-rotate-[${e}]`:`backdrop-hue-rotate-${e}`},animate:{expand:(e)=>`animate-${e}`},"forced-colors":{expand:(e)=>`forced-colors-${e}`}},Rt=new Set(["sm","md","lg","xl","2xl","hover","focus","active","visited","disabled","enabled","focus-within","focus-visible","group-hover","group-focus","peer-hover","peer-focus","*","**","dark","first","last","odd","even","only","first-of-type","last-of-type","only-of-type","checked","indeterminate","default","required","valid","invalid","in-range","out-of-range","placeholder-shown","autofill","read-only","user-valid","user-invalid","inert","empty","before","after","selection","marker","file","first-letter","first-line","backdrop","details-content","print","motion-safe","motion-reduce","pointer-none","pointer-coarse","pointer-fine","any-pointer-none","any-pointer-coarse","any-pointer-fine","inverted-colors","noscript","starting","contrast-more","contrast-less","rtl","ltr","portrait","landscape","@sm","@md","@lg","@xl","@2xl"]),yo=new WeakMap,bo=new WeakMap;function ef(e){if(!e)return bn;let t=yo.get(e);if(!t)t=e.aliases?{...bn,...e.aliases}:bn,yo.set(e,t);return t}function tf(e){if(!e?.aliases)return"";let t=bo.get(e);if(t===void 0)t=JSON.stringify(e.aliases),bo.set(e,t);return t}function xo(e){let t=[],r="",n=0;for(let i=0;i<e.length;i++){let o=e[i];if(o==="[")n++;else if(o==="]")n--;if(o===":"&&n===0)t.push(r),r="";else r+=o}return t.push(r),t}function rf(e,t){let r=`${e}:${t?.colonSyntax}:${tf(t)}`,n=_e.get(r);if(n)return n;let i=ef(t);if(t?.colonSyntax===!0){let g=e.match(/^([a-z][a-z0-9-]*):([^[\]:]+)$/i);if(g){let[,p,y]=g;if(!Rt.has(p)){if(se(y)){let w=[`${p}-[${y}]`];return Le(_e,r,w),w}let x=y.startsWith("-")?[`-${p}-${y.slice(1)}`]:[`${p}-${y}`];return Le(_e,r,x),x}}}let o="",s=e,c=!1;if(s.startsWith("-"))c=!0,s=s.slice(1);let a=s.match(/^((?:[a-z@][a-z0-9-]*:)+)(.+)$/i);if(a){if(a[1].slice(0,-1).split(":").every((y)=>Rt.has(y)))o=a[1],s=a[2]}let l=s.match(/^([a-z][a-z0-9-]*)\[([^\]]*)\]$/i);if(!l||s.includes("-[")){let g=[e];return Le(_e,r,g),g}let[,u,f]=l,d=f.split(/\s+/).filter(Boolean);if(d.length===0)return Le(_e,r,[]),[];let h=Qu[u.toLowerCase()];if(h?.multiValue){let g=h.multiValue(d,i);if(g){let p=g.map((y)=>`${o}${c?"-":""}${y}`);return Le(_e,r,p),p}}if(!h){let g=[];for(let p of d){let y=p.match(/^([a-z@][a-z0-9-]*):(.+)$/i),x="",w=p;if(y&&Rt.has(y[1]))x=`${y[1]}:`,w=y[2];let T="";if(w.startsWith("-"))T="-",w=w.slice(1);let S="";if(w.endsWith("!"))S="!",w=w.slice(0,-1);let j=c?"-":"";if(se(w))g.push(`${o}${x}${S}${j}${T}${u}-[${w}]`);else g.push(`${o}${x}${S}${j}${T}${u}-${w}`)}return Le(_e,r,g),g}let m=[];for(let g of d){let p=g.match(/^([a-z@][a-z0-9-]*):(.+)$/i),y="",x=g;if(p&&Rt.has(p[1]))y=`${p[1]}:`,x=p[2];let w="";if(x.startsWith("-"))w="-",x=x.slice(1);let T="";if(x.endsWith("!"))T="!",x=x.slice(0,-1);let S=h.expand(x,i);if(S){let j=c?"-":"";m.push(`${o}${y}${T}${j}${w}${S}`)}}return Le(_e,r,m),m}function nf(e,t){let r=new Set;if(!t?.enabled)return r;let n=t.prefix??"tc-",i=["class","className","style","id","name","type","value","href","src","alt","title","role","for","action","method","target","rel","placeholder","disabled","checked","selected","readonly","required","maxlength","minlength","pattern","autocomplete","autofocus","tabindex","contenteditable","draggable","spellcheck","lang","dir","hidden","slot","part","is","key","ref"],o=t.ignoreAttributes||i,s=(l)=>{let u=l.includes(":")?l.split(":").pop():l;for(let f of o)if(f.endsWith("*")){if(u.startsWith(f.slice(0,-1)))return!0}else if(u===f)return!0;if(u.startsWith("on"))return!0;if(u.startsWith("data-")||u.startsWith("aria-"))return!0;return!1},c=/<([a-z][a-z0-9-]*)\s([^>]*)>/gi,a;while((a=c.exec(e))!==null){let l=a[2],u=/([a-z][a-z0-9-:]*)(?:=["']([^"']*)["'])?(?=\s|$|\/?>)/gi,f;while((f=u.exec(l))!==null){let d=f[1],h=f[2];if(n){if(!d.startsWith(n))continue;d=d.slice(n.length)}if(s(d))continue;let m="",g=d,p=d.match(/^((?:[a-z@][a-z0-9-]*:)+)([a-z][a-z0-9-]*)$/i);if(p){if(p[1].slice(0,-1).split(":").every((w)=>Rt.has(w)))m=p[1],g=p[2]}if(h!==void 0){let y=h.split(/\s+/).filter(Boolean);for(let x of y){let w=`${m}${g}-${x}`;if(vo(w.replace(/^(?:[a-z@][a-z0-9-]*:)+/gi,"")))r.add(w)}}else{let y=`${m}${g}`;if(vo(g))r.add(y)}}}return r}function vo(e){if(!e||e.length===0)return!1;return/^[a-z][a-z0-9-/]*(?:-\[[^\]]+\])?$/i.test(e)}function Co(e){let t=go.get(e);if(t)return t;let r=cf(e);return r.base=lf(r),Le(go,e,r),r}var of=new Set(["bg","text","border","ring","placeholder","divide","accent","caret","fill","stroke","outline","decoration","shadow","ring-offset","from","via","to"]),sf=/^(.+?)\/(\d+|\[\d*\.?\d+\])$/,af=/^(\d+)\/(\d+)$/;function wo(e){let t=!1;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n===45){if(!t||r+1>=e.length)return;return[e.slice(0,r),e.slice(r+1)]}if(n>=97&&n<=122){t=!0;continue}return}return}function lf(e){let t=e.raw;for(let r of e.variants)if(t.startsWith(`${r}:`))t=t.slice(r.length+1);if(e.important){if(t.charCodeAt(0)===33)t=t.slice(1);else if(t.charCodeAt(t.length-1)===33)t=t.slice(0,-1)}return t}function cf(e){let t=!1,r=e;if(e.startsWith("!"))t=!0,r=e.slice(1);else if(e.endsWith("!")&&e.length>1)t=!0,r=e.slice(0,-1);{let h=xo(r),m=h[h.length-1],g=!1;if(m.charCodeAt(0)===33&&m.length>1)g=!0,m=m.slice(1);let p=m.match(/^\[([a-z-]+):(.+)\]$/);if(p)return{raw:e,variants:h.slice(0,-1),utility:p[1],value:zt(p[2]),important:t||g,arbitrary:!0}}let n=r.match(/^((?:[a-z-]+:)*)(-?[a-z-]+?)-\[([^\]]+)\]\/\[([^\]]+)\]$/);if(n){let[,h,m,g,p]=n,y=h?h.split(":").filter(Boolean):[],x=m.startsWith("-"),w=x?m.slice(1):m,T=zt(g);if(x)T=T.startsWith("-")?T:`-${T}`;return{raw:e,variants:y,utility:w,value:`${T}/${p}`,important:t,arbitrary:!0,modifierArbitrary:!0}}let i=r.match(/^((?:[a-z-]+:)*)(-?[a-z-]+?)-\[(.+)\]$/);if(i){let h=i[1],m=h?h.split(":").filter(Boolean):[],g=i[2],p=g.startsWith("-");if(p)g=g.slice(1);let y=zt(i[3]),x,w=y.match(/^(color|length|url|number|percentage|position|line-width|absolute-size|relative-size|image|angle|time|flex|string|family-name):(.*)/i);if(w)x=w[1].toLowerCase(),y=w[2];if(p)y=y.startsWith("-")?y:`-${y}`;return{raw:e,variants:m,utility:g,value:y,important:t,arbitrary:!0,typeHint:x}}let o=xo(r),s=o[o.length-1],c=o.slice(0,-1);if(s.startsWith("!")&&s.length>1)t=!0,s=s.slice(1);else if(s.endsWith("!")&&s.length>1)t=!0,s=s.slice(0,-1);if(c.length>0)r=`${c.join(":")}:${s}`;else r=s;if(["inline-block","inline-flex","inline-grid","flex-row","flex-row-reverse","flex-col","flex-col-reverse","flex-wrap","flex-wrap-reverse","flex-nowrap","flex-1","flex-auto","flex-initial","flex-none","flex-grow","flex-shrink"].includes(s))return{raw:e,variants:c,utility:s,value:void 0,important:t,arbitrary:!1};let l=s.match(/^([a-z-]+?)-\[(.+?)\]$/);if(l){let h=zt(l[2]),m,g=h.match(/^(color|length|url|number|percentage|position|line-width|absolute-size|relative-size|image|angle|time|flex|string|family-name):(.*)/i);if(g)m=g[1].toLowerCase(),h=g[2];return{raw:e,variants:c,utility:l[1],value:h,important:t,arbitrary:!0,typeHint:m}}let u=["inset-x","inset-y","border-t","border-r","border-b","border-l","border-x","border-y","border-s","border-e","grid-cols","grid-rows","grid-flow","auto-cols","auto-rows","col-span","row-span","col-start","col-end","row-start","row-end","translate-x","translate-y","translate-z","scale-x","scale-y","scale-z","rotate-x","rotate-y","rotate-z","skew-x","skew-y","scroll-m","scroll-mx","scroll-my","scroll-mt","scroll-mr","scroll-mb","scroll-ml","scroll-p","scroll-px","scroll-py","scroll-pt","scroll-pr","scroll-pb","scroll-pl","gap-x","gap-y","overflow-x","overflow-y","min-w","max-w","min-h","max-h","space-x","space-y","ring-offset","underline-offset","outline-offset","backdrop-blur","backdrop-brightness","backdrop-contrast","backdrop-grayscale","backdrop-invert","backdrop-saturate","backdrop-sepia","hue-rotate","drop-shadow","mask-clip","flex-grow","flex-shrink","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","perspective-origin","justify-self","form-input","form-textarea","form-select","form-multiselect","form-checkbox","form-radio","mix-blend","bg-blend","line-clamp","border-spacing","border-spacing-x","border-spacing-y","rounded-s","rounded-e","rounded-ss","rounded-se","rounded-es","rounded-ee","rounded-t","rounded-r","rounded-b","rounded-l","rounded-tl","rounded-tr","rounded-bl","rounded-br","border-opacity","ring-opacity","stroke-dasharray","stroke-dashoffset","animate-iteration","animate-duration","animate-delay","text-emphasis-color","text-emphasis","text-shadow","word-spacing","column-gap","column-rule","font-stretch","list-image"];if(s==="divide-x"||s==="divide-y")return{raw:e,variants:c,utility:s,value:void 0,important:t,arbitrary:!1};let f=s.match(/^(divide-[xy])-(.+)$/);if(f)return{raw:e,variants:c,utility:f[1],value:f[2],important:t,arbitrary:!1};for(let h of u)if(s.startsWith(`${h}-`))return{raw:e,variants:c,utility:h,value:s.slice(h.length+1),important:t,arbitrary:!1};if(s.startsWith("-")){let h=s.slice(1);for(let g of u)if(h.startsWith(`${g}-`))return{raw:e,variants:c,utility:g,value:`-${h.slice(g.length+1)}`,important:t,arbitrary:!1};let m=wo(h);if(m)return{raw:e,variants:c,utility:m[0],value:`-${m[1]}`,important:t,arbitrary:!1};return{raw:e,variants:c,utility:h,value:void 0,important:t,arbitrary:!1}}let d=wo(s);if(d){let[h,m]=d,g=m.match(sf);if(g&&of.has(h))return{raw:e,variants:c,utility:h,value:`${g[1]}/${g[2]}`,important:t,arbitrary:!1};let p=m.match(af);if(p)return{raw:e,variants:c,utility:h,value:`${p[1]}/${p[2]}`,important:t,arbitrary:!1};return{raw:e,variants:c,utility:h,value:m,important:t,arbitrary:!1}}return{raw:e,variants:c,utility:s,value:void 0,important:t,arbitrary:!1}}function Ro(e,t){if(!e||e.length===0)return!1;if(/^\[[a-z-]+:[^\]]+\]$/i.test(e))return!0;if(t?.enabled&&/^[a-z]+\[[^\]]+\]$/i.test(e))return!0;if(t?.colonSyntax&&/^[a-z]+:[^[\]:]+$/i.test(e))return!0;let r=String.raw`!?-?[a-z][a-z0-9.-]*(?:-\[[^\]]+\])?(?:\/(?:[\w.]+|\[[^\]]+\]))?`;return new RegExp(`^${r}(?::${r})*$`,"i").test(e)}function Ht(e){let t=[],r="",n=0;for(let i of e)if(i==="[")n++,r+=i;else if(i==="]")n--,r+=i;else if(/\s/.test(i)&&n===0){if(r)t.push(r),r=""}else r+=i;if(r)t.push(r);return t}function Gt(e,t){let r=new Set,n=[/class(?:Name)?=["']([^"']+)["']/g,/class(?:Name)?=\{["']([^"']+)["']\}/g,/class(?:Name)?=\{`([^`]+)`\}/g];for(let o of n){let s;while((s=o.exec(e))!==null){let c=s[1],a=c.match(/["']([^"']+)["']/g);if(a)for(let f of a){let d=f.replace(/["']/g,""),h=Ht(d);for(let m of h)Kt(r,m,t)}let l=c.replace(/["'`]/g," ").replace(/\$\{[^}]+\}/g," "),u=Ht(l).filter((f)=>Ro(f,t?.bracketSyntax));for(let f of u)Kt(r,f,t)}}let i=[/class(?:Name|:list)?=\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,/:class="([^"]*)"/g,/:class='([^']*)'/g,/\bx-class="([^"]*)"/g,/\bx-class='([^']*)'/g];for(let o of i){let s;while((s=o.exec(e))!==null){let c=s[1].match(/["'`]([^"'`]+)["'`]/g);if(c)for(let a of c){let l=a.replace(/["'`]/g,"").replace(/\$\{[^}]+\}/g," ");for(let u of Ht(l))Kt(r,u,t)}}}if(t?.codeStrings?.enabled!==!1)for(let o of ff(e,t?.bracketSyntax))Kt(r,o,t);if(t?.attributify?.enabled){let o=nf(e,t.attributify);for(let s of o)r.add(s)}return r}function uf(e,t){if(!/[-:/[]/.test(e))return!1;if(e.startsWith("-")&&!/^-[a-z]/i.test(e))return!1;return Ro(e,t)}function ff(e,t){let r=new Set,n=e.length,i=0,o="";while(i<n){let s=e[i];if(s==="/"&&e[i+1]==="/"){let d=e.indexOf(`
|
|
91
|
+
`),Ie.exit(e.exitCode??2)}async runMatchedCommand(){let{args:e,options:t,matchedCommand:r}=this;if(!r||!r.commandAction)return;r.checkUnknownOptions(),r.checkOptionValue(),r.checkRequiredArgs();let n=[];r.args.forEach((c,a)=>{if(c.variadic)n.push(e.slice(a));else n.push(e[a])}),n.push(t);let i={command:r,args:n,options:t};for(let c of r.beforeHooks)await c(i);let o,s=async()=>{let c=r.commandAction.apply(this,n);if(c instanceof Promise)o=await c;else o=c;return o};if(r.middleware.length>0){let c=0,a=async()=>{if(c<r.middleware.length){let l=r.middleware[c++];await l({...i,next:a})}else await s()};await a()}else await s();for(let c of r.afterHooks)await c(i);return o}removeSignalHandlers(){if(!this.signalHandlersSet)return this;return Ie.removeAllListeners("SIGINT"),Ie.removeAllListeners("SIGTERM"),this.signalHandlersSet=!1,this}destroy(){this.removeSignalHandlers(),this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.matchedCommand=void 0,this.matchedCommandName=void 0,this.removeAllListeners()}}class Bi{cache;enabled;cleanupInterval=null;hits=0;misses=0;constructor(){this.cache=new Map,this.enabled=!0,this.startCleanupInterval()}startCleanupInterval(){if(this.cleanupInterval)return;this.cleanupInterval=setInterval(()=>{this.cleanup()},30000),this.cleanupInterval.unref()}stopCleanup(){if(this.cleanupInterval)clearInterval(this.cleanupInterval),this.cleanupInterval=null}isEnabled(){return this.enabled}get(e){if(!this.enabled){this.misses++;return}let t=this.cache.get(e);if(!t){this.misses++;return}if(Date.now()-t.timestamp>t.ttl){this.cache.delete(e),this.misses++;return}return this.hits++,t.value}set(e,t,r=5000){if(!this.enabled)return;this.cache.set(e,{value:t,timestamp:Date.now(),ttl:r})}has(e){if(!this.enabled)return!1;let t=this.cache.get(e);if(!t)return!1;if(Date.now()-t.timestamp>t.ttl)return this.cache.delete(e),!1;return!0}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}disable(){this.enabled=!1,this.clear()}enable(){this.enabled=!0}stats(){return{size:this.cache.size,enabled:this.enabled,hits:this.hits,misses:this.misses}}resetStats(){this.hits=0,this.misses=0}keys(){return Array.from(this.cache.keys())}cleanup(){let e=Date.now();for(let[t,r]of this.cache.entries())if(e-r.timestamp>r.ttl)this.cache.delete(t)}destroy(){this.stopCleanup(),this.clear(),this.resetStats()}}var hx=new Bi;function Ic(){if("FORCE_COLOR"in vt.env)return vt.env.FORCE_COLOR!=="0";if("NO_COLOR"in vt.env||vt.env.TERM==="dumb")return!1;if(vt.platform==="win32")return!0;return Mi.isatty(1)&&Mi.isatty(2)}var Ui=Ic();function M(e,t){if(!Ui)return(r)=>r;return(r)=>e+r+t}var Pc=M("\x1B[0m","\x1B[0m"),_c=M("\x1B[31m","\x1B[39m"),Lc=M("\x1B[32m","\x1B[39m"),Mc=M("\x1B[33m","\x1B[39m"),Fc=M("\x1B[34m","\x1B[39m"),Dc=M("\x1B[35m","\x1B[39m"),jc=M("\x1B[36m","\x1B[39m"),Bc=M("\x1B[37m","\x1B[39m"),Uc=M("\x1B[90m","\x1B[39m"),Vc=M("\x1B[1m","\x1B[22m"),Wc=M("\x1B[3m","\x1B[23m"),zc=M("\x1B[4m","\x1B[24m"),Kc=M("\x1B[2m","\x1B[22m"),Hc=M("\x1B[7m","\x1B[27m"),Gc=M("\x1B[8m","\x1B[28m"),qc=M("\x1B[9m","\x1B[29m"),Yc=M("\x1B[41m","\x1B[49m"),Jc=M("\x1B[42m","\x1B[49m"),Xc=M("\x1B[43m","\x1B[49m"),Zc=M("\x1B[44m","\x1B[49m"),Qc=M("\x1B[45m","\x1B[49m"),eu=M("\x1B[46m","\x1B[49m"),tu=M("\x1B[47m","\x1B[49m"),ru=Ui,nu={reset:Pc,red:_c,green:Lc,yellow:Mc,blue:Fc,magenta:Dc,cyan:jc,white:Bc,gray:Uc,bold:Vc,italic:Wc,underline:zc,dim:Kc,inverse:Hc,hidden:Gc,strikethrough:qc,bgRed:Yc,bgGreen:Jc,bgYellow:Xc,bgBlue:Zc,bgMagenta:Qc,bgCyan:eu,bgWhite:tu,isColorSupported:ru},iu=nu,su=["up","down","left","right","space","enter","cancel"],xx={actions:new Set(su),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};var vx=ou.platform.startsWith("win"),wx=Symbol("clapp:cancel");var au=Rc();var _=(e,t)=>au?e:t,$x=_("\u25C6","*"),Cx=_("\u25A0","x"),Rx=_("\u25B2","x"),kx=_("\u25C7","o"),Sx=_("\u250C","T"),lu=_("\u2502","|"),Ax=_("\u2514","\u2014"),Ex=_("\u25CF",">"),Tx=_("\u25CB"," "),Nx=_("\u25FB","[\u2022]"),Ox=_("\u25FC","[+]"),Ix=_("\u25FB","[ ]"),Px=_("\u25AA","\u2022"),_x=_("\u2500","-"),Lx=_("\u256E","+"),Mx=_("\u251C","+"),Fx=_("\u256F","+"),Dx=_("\u25CF","\u2022"),jx=_("\u25C6","*"),Bx=_("\u25B2","!"),Ux=_("\u25A0","x");var Vx={light:_("\u2500","-"),heavy:_("\u2501","="),block:_("\u2588","#")};function cu(){return`${iu.gray(lu)} `}var Wx=cu();class Vi{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let e=Fi.homedir(),t=Yr.join(e,".config","clapp");this.configPath=Yr.join(t,"telemetry.json")}async isEnabled(){if(Ue.env.DO_NOT_TRACK==="1"||Ue.env.DO_NOT_TRACK==="true")return!1;if(Ue.env.NO_TELEMETRY==="1"||Ue.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let e=await this.loadConfig();if(e.enabled=!0,!e.userId)e.userId=this.generateUserId();await this.saveConfig(e)}async disable(){let e=await this.loadConfig();e.enabled=!1,await this.saveConfig(e)}async track(e,t){if(!await this.isEnabled())return;let n={event:e,...t,timestamp:Date.now(),platform:Fi.platform(),nodeVersion:Ue.version};if(this.events.push(n),this.events.length>=10)await this.send()}async trackCommand(e,t){await this.track("command",{command:e,duration:t})}async trackError(e,t){await this.track("error",{error:e,command:t})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let t=await this.loadConfig();return t.lastSent=Date.now(),await this.saveConfig(t),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let t=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep(t),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep(e){return new Promise((t)=>setTimeout(t,e))}async status(){let e=await this.loadConfig();return{enabled:e.enabled,doNotTrack:Ue.env.DO_NOT_TRACK==="1"||Ue.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:e.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(uu(this.configPath)){let e=await qr.readFile(this.configPath,"utf-8");return this.config=JSON.parse(e),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig(e){this.config=e;try{let t=Yr.dirname(this.configPath);await qr.mkdir(t,{recursive:!0}),await qr.writeFile(this.configPath,JSON.stringify(e,null,2),"utf-8")}catch{}}generateUserId(){let e=Math.random().toString(36).substring(2,15),t=Date.now().toString(36);return`${e}-${t}`}}var Yx=new Vi;var tn="0.3.15";function be(e){return{prev:null,next:null,data:e}}class le{head=null;tail=null;cursors=[];allocateCursor(e,t){let r={prev:e,next:t};return this.cursors.push(r),r}releaseCursor(){this.cursors.pop()}updateCursors(e,t,r,n){for(let i of this.cursors){if(i.prev===e)i.prev=t;if(i.next===r)i.next=n}}static createItem(e){return be(e)}createItem(e){return be(e)}get isEmpty(){return this.head===null}get first(){return this.head?.data??null}get last(){return this.tail?.data??null}*[Symbol.iterator](){for(let e=this.head;e!=null;e=e.next)yield e.data}fromArray(e){let t=null;this.head=null;for(let r of e){let n=be(r);if(n.prev=t,t)t.next=n;else this.head=n;t=n}return this.tail=t,this}toArray(){let e=[];for(let t=this.head;t!=null;t=t.next)e.push(t.data);return e}toJSON(){return this.toArray()}forEach(e,t){let r=this.allocateCursor(null,this.head);while(r.next!==null){let n=r.next;r.prev=n,r.next=n.next,e.call(t,n.data,n,this)}this.releaseCursor()}forEachRight(e,t){let r=this.allocateCursor(this.tail,null);while(r.prev!==null){let n=r.prev;r.next=n,r.prev=n.prev,e.call(t,n.data,n,this)}this.releaseCursor()}reduce(e,t){let r=t,n=0;for(let i=this.head;i!=null;i=i.next)r=e(r,i.data,n++,this);return r}some(e){let t=0;for(let r=this.head;r!=null;r=r.next)if(e(r.data,t++,this))return!0;return!1}map(e){let t=new le,r=null,n=0;for(let i=this.head;i!=null;i=i.next){let o=be(e(i.data,n++,this));if(o.prev=r,r)r.next=o;else t.head=o;r=o}return t.tail=r,t}filter(e){let t=new le,r=null,n=0;for(let i=this.head;i!=null;i=i.next)if(e(i.data,n++,this)){let o=be(i.data);if(o.prev=r,r)r.next=o;else t.head=o;r=o}return t.tail=r,t}clear(){let e=this.head;while(e){let t=e.next;e.prev=null,e.next=null,e=t}this.head=null,this.tail=null}copy(){let e=new le,t=null;for(let r=this.head;r!=null;r=r.next){let n=be(r.data);if(n.prev=t,t)t.next=n;else e.head=n;t=n}return e.tail=t,e}prepend(e){return this.insert(e,this.head)}prependData(e){return this.insert(be(e),this.head)}append(e){return this.insert(e,null)}appendData(e){return this.insert(be(e),null)}insert(e,t=null){if(t!=null)if(this.updateCursors(t.prev,e,t,e),t.prev===null){if(this.head!==t)throw Error("before doesn't belong to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e,null,null)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else if(this.updateCursors(this.tail,e,null,e),this.tail!==null)this.tail.next=e,e.prev=this.tail,this.tail=e;else this.head=e,this.tail=e;return this}insertData(e,t=null){return this.insert(be(e),t)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),e.prev!==null)e.prev.next=e.next;else if(this.head===e)this.head=e.next;else throw Error("item doesn't belong to list");if(e.next!==null)e.next.prev=e.prev;else if(this.tail===e)this.tail=e.prev;else throw Error("item doesn't belong to list");return e.prev=null,e.next=null,e}push(e){this.insert(be(e),null)}pop(){if(this.tail===null)return null;return this.remove(this.tail)}unshift(e){this.prependData(e)}shift(){if(this.head===null)return null;return this.remove(this.head)}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e,null)}insertList(e,t=null){if(e.head===null)return this;if(t!==null){if(this.updateCursors(t.prev,e.tail,t,e.head),t.prev!==null)t.prev.next=e.head,e.head.prev=t.prev;else this.head=e.head;t.prev=e.tail,e.tail.next=t}else{if(this.updateCursors(this.tail,e.tail,null,e.head),this.tail!==null)this.tail.next=e.head,e.head.prev=this.tail;else this.head=e.head;this.tail=e.tail}return e.head=null,e.tail=null,this}replace(e,t){if(t instanceof le)this.insertList(t,e),this.remove(e);else this.insert(t,e),this.remove(e)}}function Q(e){switch(e.type){case"StyleSheet":return oe(e.children,"");case"Rule":return`${Q(e.prelude)}{${Q(e.block)}}`;case"Block":return du(e.children);case"Atrule":{let t=`@${e.name}`;if(e.prelude){let r=Q(e.prelude);if(r)t+=` ${r}`}if(e.block)t+=`{${Q(e.block)}}`;else t+=";";return t}case"AtrulePrelude":return oe(e.children,"");case"SelectorList":return oe(e.children,",");case"Selector":return oe(e.children,"");case"TypeSelector":return e.name;case"IdSelector":return`#${e.name}`;case"ClassSelector":return`.${e.name}`;case"NestingSelector":return"&";case"AttributeSelector":{let t=`[${e.name.name}`;if(e.matcher&&e.value)if(t+=e.matcher,e.value.type==="String")t+=`"${rn(e.value.value)}"`;else t+=e.value.name;if(e.flags)t+=` ${e.flags}`;return t+="]",t}case"PseudoClassSelector":return e.children?`:${e.name}(${oe(e.children,"")})`:`:${e.name}`;case"PseudoElementSelector":return e.children?`::${e.name}(${oe(e.children,"")})`:`::${e.name}`;case"Combinator":return e.name===" "?" ":e.name;case"Declaration":return`${e.property}:${Q(e.value)}${e.important?"!important":""}`;case"DeclarationList":return oe(e.children,";");case"Value":return oe(e.children,"");case"Identifier":return e.name;case"Number":return e.value;case"Percentage":return`${e.value}%`;case"Dimension":return e.value+e.unit;case"String":return`"${rn(e.value)}"`;case"Url":return/[\s"'()\\\u0000-\u001F\u007F]/.test(e.value)?`url("${rn(e.value)}")`:`url(${e.value})`;case"Hash":return`#${e.name}`;case"Operator":return e.value;case"Function":return`${e.name}(${oe(e.children,"")})`;case"Parentheses":return`(${oe(e.children,"")})`;case"Brackets":return`[${oe(e.children,"")}]`;case"Raw":return e.value;case"Comment":return e.value.startsWith("!")?`/*${e.value}*/`:"";case"WhiteSpace":return" ";case"CDO":return"<!--";case"CDC":return"-->";case"AnPlusB":{let t=e.a??"",r=e.b??"";if(t&&r){let n=Number(r);return`${t==="1"?"":t==="-1"?"-":t}n${n>=0?`+${r}`:r}`}if(t)return`${t==="1"?"":t==="-1"?"-":t}n`;return r}case"Ratio":return`${e.left.value}/${e.right.value}`;case"UnicodeRange":return e.value;case"Nth":return e.selector?`${Q(e.nth)} of ${Q(e.selector)}`:Q(e.nth);case"MediaQueryList":return oe(e.children,",");case"MediaQuery":return oe(e.children,"");case"MediaFeature":{let t=`(${e.name}`;if(e.value)t+=`:${Q(e.value)}`;return t+=")",t}}return""}function oe(e,t){let r="",n=!0,i=null,o=e.head;while(o!=null){let s=o.data;if(s.type==="WhiteSpace"){let a=o.next?o.next.data:null;if(Wi(i)||Wi(a)){o=o.next;continue}}let c=Q(s);if(!c){o=o.next;continue}if(!n&&t&&!gu(i))r+=t;n=!1,r+=c,i=s,o=o.next}return r}function du(e){let t="",r=null,n=e.head;while(n!=null){let i=n.data,o=Q(i);if(!o){n=n.next;continue}if(r&&hu(r,i))t+=";";t+=o,r=i,n=n.next}return t}function hu(e,t){return e.type==="Declaration"&&t.type!=="Comment"}function Wi(e){if(!e||e.type!=="Operator")return!1;let t=e.value;return t===":"||t===","||t==="/"}function gu(e){if(!e)return!1;return e.type==="Operator"||e.type==="Combinator"}function rn(e){let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n===92)t+="\\\\";else if(n===34)t+="\\\"";else if(n<32||n===127){let i=n.toString(16),o=r+1<e.length?e.charCodeAt(r+1):-1,s=o===32||o===9||o===10||o===12||o===13||o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102;t+=`\\${i}${s?" ":""}`}else t+=e[r]}return t}var We=(()=>{let e=new Uint8Array(128);for(let t=0;t<128;t++){let r=0;if(t===32||t===9||t===10||t===12||t===13)r|=1;if(t>=48&&t<=57)r|=2;if(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)r|=4;if(t>=65&&t<=90||t>=97&&t<=122||t===95)r|=8;if(t===10||t===12||t===13)r|=16;e[t]=r}return e})();function fe(e){return e<128&&(We[e]&2)!==0}function Ct(e){return e<128&&(We[e]&4)!==0}function zi(e){return e>=128||e<128&&(We[e]&8)!==0}function mu(e){return e===45||e>=128||e<128&&(We[e]&10)!==0}function pu(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function on(e){return e<128&&(We[e]&16)!==0}function Re(e){return e<128&&(We[e]&1)!==0}function Ve(e,t){if(e!==92)return!1;if(on(t))return!1;return!0}function nn(e,t,r){if(e===45)return zi(t)||t===45||Ve(t,r);if(zi(e))return!0;if(e===92)return Ve(e,t);return!1}function yu(e,t,r){if(e===43||e===45){if(fe(t))return!0;if(t===46&&fe(r))return!0;return!1}if(e===46)return fe(t);return fe(e)}class Ft{source;offset=0;types;starts;ends;count=0;_tokens=null;_lineStarts=null;constructor(e){this.source=e;let t=Math.max(64,Math.ceil(e.length/3));this.types=new Uint8Array(t),this.starts=new Uint32Array(t),this.ends=new Uint32Array(t),this.tokenize()}get lineStarts(){if(this._lineStarts==null)this._lineStarts=bu(this.source);return this._lineStarts}get tokens(){if(this._tokens!=null)return this._tokens;let e=Array.from({length:this.count});for(let t=0;t<this.count;t++)e[t]={type:this.types[t],start:this.starts[t],end:this.ends[t]};return this._tokens=e,e}addToken(e,t,r){if(this.count>=this.types.length)this.grow();this.types[this.count]=e,this.starts[this.count]=t,this.ends[this.count]=r,this.count++}grow(){let t=this.types.length*2,r=new Uint8Array(t);r.set(this.types),this.types=r;let n=new Uint32Array(t);n.set(this.starts),this.starts=n;let i=new Uint32Array(t);i.set(this.ends),this.ends=i}tokenize(){let e=this.source,t=0,r=e.length;while(t<r){let n=e.charCodeAt(t);if(n===47&&e.charCodeAt(t+1)===42){let s=t;t+=2;while(t<r&&!(e.charCodeAt(t)===42&&e.charCodeAt(t+1)===47))t++;t=t<r?t+2:r,this.addToken(25,s,t);continue}if(Re(n)){let s=t;while(t<r&&Re(e.charCodeAt(t)))t++;this.addToken(13,s,t);continue}if(n===34||n===39){t=this.consumeString(n,t);continue}if(n===35){if(t+1<r&&(mu(e.charCodeAt(t+1))||Ve(e.charCodeAt(t+1),e.charCodeAt(t+2)))){let s=t;t++,t=this.consumeName(t),this.addToken(4,s,t);continue}this.addToken(9,t,t+1),t++;continue}switch(n){case 40:this.addToken(21,t,t+1),t++;continue;case 41:this.addToken(22,t,t+1),t++;continue;case 91:this.addToken(19,t,t+1),t++;continue;case 93:this.addToken(20,t,t+1),t++;continue;case 123:this.addToken(23,t,t+1),t++;continue;case 125:this.addToken(24,t,t+1),t++;continue;case 44:this.addToken(18,t,t+1),t++;continue;case 58:this.addToken(16,t,t+1),t++;continue;case 59:this.addToken(17,t,t+1),t++;continue}if(n===60&&e.startsWith("!--",t+1)){this.addToken(14,t,t+4),t+=4;continue}if(n===45&&e.startsWith("->",t+1)){this.addToken(15,t,t+3),t+=3;continue}if(n===64){let s=e.charCodeAt(t+1),c=e.charCodeAt(t+2),a=e.charCodeAt(t+3);if(nn(s,c,a)){let l=t;t++,t=this.consumeName(t),this.addToken(3,l,t);continue}this.addToken(9,t,t+1),t++;continue}let i=e.charCodeAt(t+1),o=e.charCodeAt(t+2);if(yu(n,i,o)){t=this.consumeNumeric(t);continue}if(nn(n,i,o)){t=this.consumeIdentLike(t);continue}if(n===92){if(Ve(n,i)){t=this.consumeIdentLike(t);continue}this.addToken(9,t,t+1),t++;continue}this.addToken(9,t,t+1),t++}this.addToken(0,r,r)}consumeString(e,t){let r=this.source,n=r.length,i=t+1;while(i<n){let o=r.charCodeAt(i);if(o===e)return i++,this.addToken(5,t,i),i;if(on(o))return this.addToken(6,t,i),i;if(o===92){let s=r.charCodeAt(i+1);if(on(s)){i+=2;continue}if(i+1<n){i=this.consumeEscapeSkip(i+1);continue}}i++}return this.addToken(5,t,i),i}consumeEscapeSkip(e){let t=this.source;if(e>=t.length)return e;let r=t.charCodeAt(e);if(Ct(r)){let n=1;e++;while(n<6&&e<t.length&&Ct(t.charCodeAt(e)))e++,n++;if(e<t.length&&Re(t.charCodeAt(e)))e++;return e}return e+1}consumeName(e){let t=this.source,r=t.length,n=e;while(n<r){let i=t.charCodeAt(n);if(i<128&&(We[i]&10)!==0){n++;continue}if(i===45){n++;continue}if(i>=128){n++;continue}if(i===92&&Ve(i,t.charCodeAt(n+1))){n=this.consumeEscapeSkip(n+1);continue}break}return n}consumeNumber(e){let t=this.source,r=e;if(t.charCodeAt(r)===43||t.charCodeAt(r)===45)r++;while(r<t.length&&fe(t.charCodeAt(r)))r++;if(t.charCodeAt(r)===46&&fe(t.charCodeAt(r+1))){r+=2;while(r<t.length&&fe(t.charCodeAt(r)))r++}let n=t.charCodeAt(r);if(n===69||n===101){let i=t.charCodeAt(r+1),o=t.charCodeAt(r+2);if(fe(i)){r+=2;while(r<t.length&&fe(t.charCodeAt(r)))r++}else if((i===43||i===45)&&fe(o)){r+=3;while(r<t.length&&fe(t.charCodeAt(r)))r++}}return r}consumeNumeric(e){let t=this.source,r=this.consumeNumber(e),n=t.charCodeAt(r),i=t.charCodeAt(r+1),o=t.charCodeAt(r+2);if(nn(n,i,o)){let s=this.consumeName(r);return this.addToken(12,e,s),s}if(n===37)return this.addToken(11,e,r+1),r+1;return this.addToken(10,e,r),r}consumeIdentLike(e){let t=this.source,r=this.consumeName(e),n=t.charCodeAt(r);if(n===40&&r-e===3){let i=t.charCodeAt(e)|32,o=t.charCodeAt(e+1)|32,s=t.charCodeAt(e+2)|32;if(i===117&&o===114&&s===108){let c=r+1;while(c<t.length&&Re(t.charCodeAt(c)))c++;let a=t.charCodeAt(c);if(a===34||a===39)return this.addToken(2,e,r+1),r+1;return this.consumeUrl(e,r)}}if(n===40)return this.addToken(2,e,r+1),r+1;return this.addToken(1,e,r),r}consumeUrl(e,t){let r=this.source,n=r.length,i=t+1;while(i<n&&Re(r.charCodeAt(i)))i++;while(i<n){let o=r.charCodeAt(i);if(o===41)return i++,this.addToken(7,e,i),i;if(Re(o)){let s=i;while(i<n&&Re(r.charCodeAt(i)))i++;if(i>=n)return this.addToken(7,e,i),i;if(r.charCodeAt(i)===41)return i++,this.addToken(7,e,i),i;return this.consumeBadUrl(e,s)}if(o===34||o===39||o===40||pu(o))return this.consumeBadUrl(e,i);if(o===92){if(Ve(o,r.charCodeAt(i+1))){i=this.consumeEscapeSkip(i+1);continue}return this.consumeBadUrl(e,i)}i++}return this.addToken(7,e,i),i}consumeBadUrl(e,t){let r=this.source,n=t;while(n<r.length){let i=r.charCodeAt(n);if(i===41){n++;break}if(i===92&&Ve(i,r.charCodeAt(n+1))){n=this.consumeEscapeSkip(n+1);continue}n++}return this.addToken(8,e,n),n}locate(e){let t=this.lineStarts,r=0,n=t.length-1;while(r<n){let o=r+n+1>>1;if(t[o]<=e)r=o;else n=o-1}let i=t[r];return{line:r+1,column:e-i+1}}}function bu(e){let t=[0],r=e.length;for(let n=0;n<r;n++){let i=e.charCodeAt(n);if(i===10)t.push(n+1);else if(i===13){if(e.charCodeAt(n+1)!==10)t.push(n+1)}}return t}function sn(e,t,r){for(let n=t;n<r;n++)if(e.charCodeAt(n)===92)return xu(e,t,r,n);return e.slice(t,r)}function xu(e,t,r,n){let i=e.slice(t,n),o=n;while(o<r){if(e.charCodeAt(o)!==92){i+=e[o],o++;continue}if(o+1>=r){o++;continue}let c=e.charCodeAt(o+1);if(c===10){o+=2;continue}if(c===13){o+=e.charCodeAt(o+2)===10?3:2;continue}if(Ct(c)){let a=o+1,l="";while(l.length<6&&a<r&&Ct(e.charCodeAt(a)))l+=e[a],a++;let u=Number.parseInt(l,16);if(a<r&&Re(e.charCodeAt(a)))a++;i+=u===0||u>=55296&&u<=57343||u>1114111?String.fromCodePoint(65533):String.fromCodePoint(u),o=a;continue}i+=e[o+1],o+=2}return i}function an(e,t,r){for(let n=t;n<r;n++)if(e.charCodeAt(n)===92)return vu(e,t,r,n);return e.slice(t,r)}function vu(e,t,r,n){let i=e.slice(t,n),o=n;while(o<r){if(e.charCodeAt(o)!==92){i+=e[o],o++;continue}let c=o+1,a="";while(a.length<6&&c<r&&Ct(e.charCodeAt(c)))a+=e[c],c++;if(a.length>0){let l=Number.parseInt(a,16);if(c<r&&Re(e.charCodeAt(c)))c++;i+=l===0||l>=55296&&l<=57343||l>1114111?String.fromCodePoint(65533):String.fromCodePoint(l),o=c;continue}if(c<r){i+=e[c],o=c+1;continue}i+=String.fromCodePoint(65533),o=c}return i}function Xi(e,t){let r=new Ft(e);return{source:e,types:r.types,starts:r.starts,ends:r.ends,count:r.count,end:r.count,pos:0,positions:t.positions??!1,filename:t.filename,parseValue:t.parseValue??!0,parseAtrulePrelude:t.parseAtrulePrelude??!0,parseCustomProperty:t.parseCustomProperty??!1,parseRulePrelude:t.parseRulePrelude??!0,onParseError:t.onParseError,tokenizer:r}}function b(e){return e.pos<e.end?e.types[e.pos]:0}function v(e){let t=e.pos;if(t>=e.end)return{type:0,start:e.starts[t]??e.source.length,end:e.ends[t]??e.source.length};return{type:e.types[t],start:e.starts[t],end:e.ends[t]}}function C(e){let t=e.pos++;if(t>=e.end)return{type:0,start:e.starts[t]??e.source.length,end:e.ends[t]??e.source.length};return{type:e.types[t],start:e.starts[t],end:e.ends[t]}}function xe(e,t){return e.source.slice(t.start,t.end)}function de(e){let{types:t,end:r}=e;while(e.pos<r){let n=t[e.pos];if(n===13||n===25)e.pos++;else break}}function Ki(e){let{types:t,end:r}=e;while(e.pos<r&&t[e.pos]===13)e.pos++}function R(e,t,r){if(!e.positions)return null;let n=e.tokenizer.locate(t.start),i=e.tokenizer.locate(r.end);return{source:e.filename??"<unknown>",start:{offset:t.start,line:n.line,column:n.column},end:{offset:r.end,line:i.line,column:i.column}}}function Zi(e){if(!e.positions)return null;let t=v(e),r=e.tokenizer.locate(t.start);return{source:e.filename??"<unknown>",start:{offset:t.start,line:r.line,column:r.column},end:{offset:t.start,line:r.line,column:r.column}}}function Dt(e,t,r,n){return{type:"Raw",value:e,loc:R(n,t,r)}}function te(){return new le}function ln(e,t,r,n){if(e.onParseError){let{line:i,column:o}=e.tokenizer.locate(r.start),s=SyntaxError(`${e.filename??"<input>"}:${i}:${o}: ${t}`);s.line=i,s.column=o,s.offset=r.start,e.onParseError(s,n)}return n}function Bt(e,t={}){let r=Xi(e,t);switch(t.context??"stylesheet"){case"stylesheet":return qi(r);case"atrule":return Ut(r)??Hi(r);case"atrulePrelude":return Ru(r);case"mediaQuery":case"mediaQueryList":return Gi(r);case"rule":return un(r);case"selectorList":return hn(r);case"selector":return ro(r);case"block":return fn(r);case"declarationList":return Au(r);case"declaration":return dn(r)??Hi(r);case"value":return Eu(r);case"raw":return Gi(r);default:return qi(r)}}function Hi(e){return{type:"StyleSheet",children:te(),loc:Zi(e)}}function Gi(e){let t=v(e),r=t;while(b(e)!==0)r=C(e);return{type:"Raw",value:e.source.slice(t.start,r.end),loc:R(e,t,r)}}function qi(e){let t=v(e),r=te(),{types:n,end:i}=e;while(e.pos<i){let c=n[e.pos];if(c===13){e.pos++;continue}if(c===25){let u={type:25,start:e.starts[e.pos],end:e.ends[e.pos]},f=cn(e,u);e.pos++,r.appendData(f);continue}if(c===0)break;if(c===14||c===15){e.pos++;continue}if(c===3){let u=Ut(e);if(u)r.appendData(u);continue}if(c===24){e.pos++;continue}let a=e.pos,l=un(e);if(r.appendData(l),e.pos===a)e.pos++}let o=e.end-1,s=o>=0?{type:e.types[o],start:e.starts[o],end:e.ends[o]}:{type:0,start:0,end:0};return{type:"StyleSheet",children:r,loc:R(e,t,s)}}function cn(e,t){return{type:"Comment",value:e.source.slice(t.start+2,t.end-2),loc:R(e,t,t)}}function Ut(e){let t=v(e);if(t.type!==3)return null;e.pos++;let r=jt(e.source,t.start+1,t.end);de(e);let n=e.pos,i=v(e),{types:o,end:s}=e,c=n,a=n;while(c<s){let f=o[c];if(f===0||f===17||f===23)break;if(f!==13&&f!==25)a=c+1;c++}let l=null;if(a>n){let f=e.starts[n],d=e.ends[a-1],h={type:o[a-1],start:e.starts[a-1],end:d},m=e.source.slice(f,d).trim();if(m.length>0)if(e.parseAtrulePrelude)try{let g=e.end;e.end=a,e.pos=n;let p=te();while(b(e)!==0){let y=ze(e);if(y)p.appendData(y)}if(eo(p),e.end=g,e.pos=c,p.isEmpty)l=Dt(m,i,h,e);else l={type:"AtrulePrelude",children:p,loc:null}}catch(g){let p=Dt(m,i,h,e);ln(e,`Failed to parse @${r} prelude: ${g.message}`,i,p),l=p,e.pos=c}else l=Dt(m,i,h,e),e.pos=c;else e.pos=c}else e.pos=c;let u=null;if(b(e)===17)C(e);else if(b(e)===23)u=fn(e,Cu.has(r));return{type:"Atrule",name:r,prelude:l,block:u,loc:R(e,t,v(e))}}var $u=new Set(["is","not","where","has","matches","-moz-any","-webkit-any"]),Cu=new Set(["media","supports","document","layer","container","scope","starting-style","-moz-document","keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes"]);function Ru(e){let t=v(e),r=te();while(b(e)!==0){if(v(e).type===13){e.pos++;continue}let i=ze(e);if(i)r.appendData(i)}return{type:"AtrulePrelude",children:r,loc:R(e,t,v(e))}}function un(e){let t=v(e),r;if(e.parseRulePrelude)r=hn(e);else{let i=v(e),o=i;while(b(e)!==0&&b(e)!==23)o=C(e);let s=e.source.slice(i.start,o.end).trim();r=Dt(s,i,o,e)}let n=fn(e,!0);return{type:"Rule",prelude:r,block:n,loc:R(e,t,v(e))}}function fn(e,t=!1){let r=v(e);if(b(e)!==23)return{type:"Block",children:te(),loc:Zi(e)};e.pos++;let n=te(),{types:i,end:o}=e;while(e.pos<o){let s=i[e.pos];if(s===24||s===0)break;if(s===13){e.pos++;continue}if(s===25){let a={type:25,start:e.starts[e.pos],end:e.ends[e.pos]};e.pos++,n.appendData(cn(e,a));continue}if(s===3){let a=Ut(e);if(a)n.appendData(a);continue}if(t&&ku(e,Su)){let a=un(e);n.appendData(a);continue}let c=dn(e);if(c)n.appendData(c);if(e.pos<o&&i[e.pos]===17)e.pos++}if(b(e)===24)e.pos++;return{type:"Block",children:n,loc:R(e,r,v(e))}}function ku(e,t){let r=e.pos,n=t(e);return e.pos=r,n}function Su(e){let{types:t,end:r}=e;while(e.pos<r){let n=t[e.pos];if(n===23)return!0;if(n===17||n===24||n===0)return!1;e.pos++}return!1}function Au(e){let t=v(e),r=te();while(b(e)!==0&&b(e)!==24){let n=v(e);if(n.type===13){e.pos++;continue}if(n.type===25){r.appendData(cn(e,C(e)));continue}if(n.type===17){e.pos++;continue}if(n.type===3){let o=Ut(e);if(o)r.appendData(o);continue}let i=dn(e);if(i)r.appendData(i);if(b(e)===17)C(e)}return{type:"DeclarationList",children:r,loc:R(e,t,v(e))}}function dn(e){de(e);let t=v(e);if(t.type!==1&&t.type!==4&&!(t.type===9&&e.source[t.start]==="*"&&e.source[t.start+1]===" "))if(t.type===9&&e.source[t.start]==="*")e.pos++;else{ln(e,"Expected property name",t,{type:"Raw",value:"",loc:null});let{types:S,end:j}=e;while(e.pos<j){let G=S[e.pos];if(G===0||G===17||G===24)break;e.pos++}return null}let r=e.starts[e.pos],n=e.ends[e.pos];e.pos++;let i=e.source.slice(r,n);if(Ki(e),b(e)!==16){ln(e,`Expected ':' after property "${i}"`,v(e),{type:"Raw",value:"",loc:null});let{types:S,end:j}=e;while(e.pos<j){let G=S[e.pos];if(G===0||G===17||G===24)break;e.pos++}return null}e.pos++,Ki(e);let{types:o,starts:s,end:c,pos:a}=e,l=a,u=a,f=-1,d=-1;while(l<c){let S=o[l];if(S===0||S===17||S===24)break;if(S===9&&e.source.charCodeAt(s[l])===33){let j=l+1;while(j<c&&o[j]===13)j++;if(j<c&&o[j]===1){let G=s[j];if(e.ends[j]-G===9&&(e.source.charCodeAt(G)|32)===105&&(e.source.charCodeAt(G+1)|32)===109&&(e.source.charCodeAt(G+2)|32)===112&&(e.source.charCodeAt(G+3)|32)===111&&(e.source.charCodeAt(G+4)|32)===114&&(e.source.charCodeAt(G+5)|32)===116&&(e.source.charCodeAt(G+6)|32)===97&&(e.source.charCodeAt(G+7)|32)===110&&(e.source.charCodeAt(G+8)|32)===116){d=l,f=j,l=j+1;continue}}}if(S!==13&&S!==25)u=l+1;l++}let h=u,m=f>=0?{type:1,start:s[f],end:e.ends[f]}:null,g=i.startsWith("--"),p,y=s[a],x=h>a?e.ends[h-1]:y,w={type:o[a],start:y,end:e.ends[a]},T=h>a?{type:o[h-1],start:s[h-1],end:x}:w;if(g&&!e.parseCustomProperty||!e.parseValue)p={type:"Raw",value:e.source.slice(y,x).trim(),loc:R(e,w,T)};else if(h===a)p={type:"Value",children:te(),loc:R(e,w,T)};else{let S=e.end;e.end=h,e.pos=a,p=Qi(e),e.end=S}return e.pos=l,{type:"Declaration",property:i,important:m?!0:!1,value:p,loc:R(e,t,v(e))}}function Eu(e){return Qi(e)}function Qi(e){let t=v(e),r=te();while(b(e)!==0&&b(e)!==17&&b(e)!==24&&b(e)!==22&&b(e)!==20){let n=ze(e);if(n)r.appendData(n)}return to(r),{type:"Value",children:r,loc:R(e,t,v(e))}}function eo(e){for(let t of e)if("children"in t&&t.children instanceof le)eo(t.children);to(e)}function to(e){let t=e.head;while(t){if(t.data.type==="Number"){let r=t.next;while(r&&r.data.type==="WhiteSpace")r=r.next;if(r&&r.data.type==="Operator"&&r.data.value==="/"){let n=r.next;while(n&&n.data.type==="WhiteSpace")n=n.next;if(n&&n.data.type==="Number"){let i={type:"Ratio",left:t.data,right:n.data,loc:null},o=t.next;while(o&&o!==n.next){let s=o.next;e.remove(o),o=s}e.replace(t,e.createItem(i)),t=e.head;continue}}}t=t.next}}function ze(e){let t=e.pos;if(t>=e.end)return null;let r=e.types[t],n=e.starts[t],i=e.ends[t],o=e.source;switch(r){case 13:return e.pos++,e.positions?{type:"WhiteSpace",value:" ",loc:ee(e,n,i)}:{type:"WhiteSpace",value:" ",loc:null};case 25:return e.pos++,{type:"Comment",value:o.slice(n+2,i-2),loc:e.positions?ee(e,n,i):null};case 10:return e.pos++,{type:"Number",value:o.slice(n,i),loc:e.positions?ee(e,n,i):null};case 11:return e.pos++,{type:"Percentage",value:o.slice(n,i-1),loc:e.positions?ee(e,n,i):null};case 12:{e.pos++;let s=n,c=o.charCodeAt(s);if(c===43||c===45)s++;let a=!1;while(s<i){let u=o.charCodeAt(s);if(u>=48&&u<=57){s++;continue}if(u===46&&!a){a=!0,s++;continue}break}let l=o.charCodeAt(s);if(l===69||l===101){let u=s+1,f=o.charCodeAt(u);if(f===43||f===45)u++;let d=!1;while(u<i){let h=o.charCodeAt(u);if(h>=48&&h<=57){u++,d=!0;continue}break}if(d)s=u}return{type:"Dimension",value:o.slice(n,s),unit:o.slice(s,i),loc:e.positions?ee(e,n,i):null}}case 1:return e.pos++,{type:"Identifier",name:an(o,n,i),loc:e.positions?ee(e,n,i):null};case 5:{e.pos++;let s=n+1,a=i-n>=2&&o.charCodeAt(i-1)===o.charCodeAt(n)?i-1:i;return{type:"String",value:sn(o,s,a),loc:e.positions?ee(e,n,i):null}}case 7:{e.pos++;let s=n+4;while(s<i&&Yi(o.charCodeAt(s)))s++;let c=i;if(c>s&&o.charCodeAt(c-1)===41)c--;while(c>s&&Yi(o.charCodeAt(c-1)))c--;let a;if(c-s>=2){let l=o.charCodeAt(s),u=o.charCodeAt(c-1);if((l===34||l===39)&&l===u)a=o.slice(s+1,c-1);else a=o.slice(s,c)}else a=o.slice(s,c);return{type:"Url",value:a,loc:e.positions?ee(e,n,i):null}}case 4:return e.pos++,{type:"Hash",name:o.slice(n+1,i),loc:e.positions?ee(e,n,i):null};case 2:return Nu(e);case 21:return Ou(e);case 18:return e.pos++,{type:"Operator",value:",",loc:e.positions?ee(e,n,i):null};case 16:return e.pos++,{type:"Operator",value:":",loc:e.positions?ee(e,n,i):null};case 9:{e.pos++;let s=o.charCodeAt(n),c=o[n];if(Tu(s))return{type:"Operator",value:c,loc:e.positions?ee(e,n,i):null};return{type:"Identifier",name:c,loc:e.positions?ee(e,n,i):null}}case 19:{e.pos++;let s=te();while(b(e)!==0&&b(e)!==20){let a=ze(e);if(a)s.appendData(a)}let c=e.pos<e.end?e.ends[e.pos]:i;if(b(e)===20)e.pos++;return{type:"Brackets",children:s,loc:e.positions?ee(e,n,c):null}}case 3:case 23:case 24:case 22:case 20:case 17:case 0:case 14:case 15:case 6:case 8:return e.pos++,{type:"Raw",value:o.slice(n,i),loc:e.positions?ee(e,n,i):null}}return e.pos++,null}function Yi(e){return e===32||e===9||e===10||e===12||e===13}function Tu(e){return e===47||e===43||e===45||e===42||e===61||e===62||e===60||e===126||e===124||e===36||e===94||e===33||e===38}function jt(e,t,r){for(let n=t;n<r;n++){let i=e.charCodeAt(n);if(i>=65&&i<=90)return e.slice(t,r).toLowerCase()}return e.slice(t,r)}function ee(e,t,r){let n=e.tokenizer.locate(t),i=e.tokenizer.locate(r);return{source:e.filename??"<unknown>",start:{offset:t,line:n.line,column:n.column},end:{offset:r,line:i.line,column:i.column}}}function Nu(e){let t=C(e),r=jt(e.source,t.start,t.end-1),n=te();while(b(e)!==0&&b(e)!==22){let i=ze(e);if(i)n.appendData(i)}if(b(e)===22)C(e);if(r==="url"){for(let i=n.head;i!=null;i=i.next)if(i.data.type==="String")return{type:"Url",value:i.data.value,loc:R(e,t,v(e))}}return{type:"Function",name:r,children:n,loc:R(e,t,v(e))}}function Ou(e){let t=C(e),r=te();while(b(e)!==0&&b(e)!==22){let n=ze(e);if(n)r.appendData(n)}if(b(e)===22)C(e);return{type:"Parentheses",children:r,loc:R(e,t,v(e))}}function hn(e){let t=v(e),r=te();while(b(e)!==0){if(de(e),b(e)===0||b(e)===23)break;let n=ro(e);if(n.children.head!==null)r.appendData(n);if(de(e),b(e)===18){C(e);continue}break}return{type:"SelectorList",children:r,loc:R(e,t,v(e))}}function ro(e){let t=v(e),r=te(),n=!0;while(b(e)!==0&&b(e)!==18&&b(e)!==23){let i=v(e);if(i.type===13){if(C(e),!n&&b(e)!==0&&b(e)!==18&&b(e)!==23&&!Ji(e)&&!Iu(e)){let s={type:"Combinator",name:" ",loc:R(e,i,i)};r.appendData(s),n=!0}continue}if(i.type===9&&e.source.charCodeAt(i.start)===124&&e.types[e.pos+1]===9&&e.source.charCodeAt(e.starts[e.pos+1])===124){let s=v(e);C(e);let c=C(e),a={type:"Combinator",name:"||",loc:R(e,s,c)};r.appendData(a),n=!0,de(e);continue}if(Ji(e)){let s=C(e),a={type:"Combinator",name:e.source[s.start],loc:R(e,s,s)};r.appendData(a),n=!0,de(e);continue}let o=Pu(e);if(!o)break;r.appendData(o),n=!1}while(r.tail&&r.tail.data.type==="Combinator")r.remove(r.tail);return{type:"Selector",children:r,loc:R(e,t,v(e))}}function Ji(e){let t=v(e);if(t.type!==9)return!1;let r=e.source[t.start];return r===">"||r==="+"||r==="~"}function Iu(e){if(e.types[e.pos]!==9)return!1;if(e.source.charCodeAt(e.starts[e.pos])!==124)return!1;if(e.types[e.pos+1]!==9)return!1;return e.source.charCodeAt(e.starts[e.pos+1])===124}function Pu(e){let t=v(e);switch(t.type){case 1:{if(C(e),b(e)===9&&e.source[v(e).start]==="|"&&e.source[v(e).start+1]!=="="&&!(e.types[e.pos+1]===9&&e.source.charCodeAt(e.starts[e.pos+1])===124)){if(C(e),b(e)===1){let n=C(e);return{type:"TypeSelector",name:`${xe(e,t)}|${xe(e,n)}`,loc:R(e,t,n)}}if(b(e)===9&&e.source[v(e).start]==="*"){let n=C(e);return{type:"TypeSelector",name:`${xe(e,t)}|*`,loc:R(e,t,n)}}}return{type:"TypeSelector",name:xe(e,t),loc:R(e,t,t)}}case 11:return C(e),{type:"TypeSelector",name:xe(e,t),loc:R(e,t,t)};case 10:return C(e),{type:"TypeSelector",name:xe(e,t),loc:R(e,t,t)};case 9:{let r=e.source[t.start];if(r==="*")return C(e),{type:"TypeSelector",name:"*",loc:R(e,t,t)};if(r==="."){if(C(e),b(e)===1){let n=C(e);return{type:"ClassSelector",name:xe(e,n),loc:R(e,t,n)}}return null}if(r==="&")return C(e),{type:"NestingSelector",loc:R(e,t,t)};return C(e),null}case 4:return C(e),{type:"IdSelector",name:e.source.slice(t.start+1,t.end),loc:R(e,t,t)};case 16:{C(e);let r=b(e)===16;if(r)C(e);return _u(e,r,t)}case 19:return Lu(e)}return null}function _u(e,t,r){let n=v(e);if(n.type===1){C(e);let i=jt(e.source,n.start,n.end);return t?{type:"PseudoElementSelector",name:i,children:null,loc:R(e,r,n)}:{type:"PseudoClassSelector",name:i,children:null,loc:R(e,r,n)}}if(n.type===2){C(e);let i=jt(e.source,n.start,n.end-1),o=te();if(!t&&$u.has(i)){let a=v(e),l=a,u=1;while(b(e)!==0&&u>0){if(b(e)===21||b(e)===2)u++;else if(b(e)===22){if(u--,u===0)break}l=C(e)}if(b(e)===22)C(e);let f=e.source.slice(a.start,l.end).trim();if(f.length>0){let d=Xi(f,{positions:!1}),h=hn(d);o.appendData(h)}}else{while(b(e)!==0&&b(e)!==22){let a=ze(e);if(a)o.appendData(a)}if(b(e)===22)C(e)}if(t)return{type:"PseudoElementSelector",name:i,children:o,loc:R(e,r,v(e))};return{type:"PseudoClassSelector",name:i,children:o,loc:R(e,r,v(e))}}return null}function Lu(e){let t=C(e);de(e);let r=v(e);if(r.type!==1)return null;C(e);let n={type:"Identifier",name:xe(e,r),loc:R(e,r,r)};de(e);let i=null,o=null,s=null,c=v(e);if(c.type===9){let l=e.source[c.start],u=e.source[c.start+1];if(l==="=")i="=",C(e);else if((l==="~"||l==="|"||l==="^"||l==="$"||l==="*")&&u==="="){C(e);let h=v(e);if(h.type===9&&e.source[h.start]==="=")C(e),i=`${l}=`}de(e);let f=v(e);if(f.type===5){C(e);let h=f.end-f.start>=2&&e.source.charCodeAt(f.end-1)===e.source.charCodeAt(f.start);o={type:"String",value:sn(e.source,f.start+1,h?f.end-1:f.end),loc:R(e,f,f)}}else if(f.type===1)C(e),o={type:"Identifier",name:xe(e,f),loc:R(e,f,f)};de(e);let d=v(e);if(d.type===1)C(e),s=xe(e,d)}de(e);let a=v(e);if(b(e)===20)a=C(e);return{type:"AttributeSelector",name:n,matcher:i,value:o,flags:s,loc:R(e,t,a)}}var no=Symbol("walkSkip"),U=Symbol("walkStop");function Mu(e){return{root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null}}function Fu(e,t){let r=Mu(e),n=typeof t==="function"?t:t.enter,i=typeof t==="function"?null:t.leave??null,o=typeof t==="function"?null:t.visit??null,s=typeof t==="function"?!1:t.reverse??!1;function c(a,l,u){let f=null,d;switch(a.type){case"StyleSheet":f="stylesheet",d=r.stylesheet,r.stylesheet=a;break;case"Atrule":f="atrule",d=r.atrule,r.atrule=a;break;case"AtrulePrelude":f="atrulePrelude",d=r.atrulePrelude,r.atrulePrelude=a;break;case"Rule":f="rule",d=r.rule,r.rule=a;break;case"Selector":f="selector",d=r.selector,r.selector=a;break;case"Block":f="block",d=r.block,r.block=a;break;case"Declaration":f="declaration",d=r.declaration,r.declaration=a;break;case"Function":f="function",d=r.function,r.function=a;break}let h;if((o===null||o===a.type)&&n){let m=n.call(r,a,l,u);if(m===no){if(f)r[f]=d;return}if(m===U){if(f)r[f]=d;return U}}if(h=Du(a,s,c),h===U){if(f)r[f]=d;return U}if((o===null||o===a.type)&&i){if(i.call(r,a,l,u)===U){if(f)r[f]=d;return U}}if(f)r[f]=d;return}return c(e,null,null)}var Ke=Object.assign(Fu,{skip:no,stop:U});function Du(e,t,r){if("children"in e&&e.children instanceof le)return ju(e.children,t,r);if(e.type==="Rule"){if(r(e.prelude,null,null)===U)return U;if(r(e.block,null,null)===U)return U;return}if(e.type==="Atrule"){if(e.prelude){if(r(e.prelude,null,null)===U)return U}if(e.block){if(r(e.block,null,null)===U)return U}return}if(e.type==="Declaration")return r(e.value,null,null);if(e.type==="AttributeSelector"){if(r(e.name,null,null)===U)return U;if(e.value)return r(e.value,null,null);return}return}function ju(e,t,r){let n;if(t)e.forEachRight((i,o,s)=>{if(n)return;if(r(i,o,s)===U)n=U});else e.forEach((i,o,s)=>{if(n)return;if(r(i,o,s)===U)n=U});return n}function Qe(e,t={}){let r=t.exclamation??!1,n=!1;Ke(e,(i,o,s)=>{if(i.type!=="Comment")return;let c=i.value.startsWith("!");if(r===!0&&c)return;if(r==="first-exclamation"&&c&&!n){n=!0;return}if(o&&s)s.remove(o)})}function Vt(e){Ke(e,(t)=>{if(t.type!=="Block"&&t.type!=="DeclarationList")return;if(!("children"in t)||!t.children)return;let r=t.children,n=r.head;if(n==null||n.next==null)return;let i=0;for(let c=n;c!=null;c=c.next)if(c.data.type==="Declaration"){if(i++,i>=2)break}if(i<2)return;let o=new Map,s=[];for(let c=n;c!=null;c=c.next){let a=c.data;if(a.type!=="Declaration")continue;let l=a.property,u=o.get(l);if(u){let f=!!u.decl.important,d=!!a.important;if(d||f===d)s.push(u.item),o.set(l,{item:c,decl:a});else s.push(c)}else o.set(l,{item:c,decl:a})}for(let c of s)r.remove(c)})}var Bu={black:"#000",fuchsia:"#f0f",white:"#fff",red:"#f00",cyan:"#0ff",blue:"#00f",yellow:"#ff0",magenta:"#f0f",lime:"#0f0",silver:"#c0c0c0",gray:"#808080",maroon:"#800000",olive:"#808000",green:"#008000",purple:"#800080",teal:"#008080",navy:"#000080"},Uu={"#f00":"red","#ff0000":"red","#000080":"navy","#008080":"teal"};function mn(e){if(!e.startsWith("#"))return e;let t=e.slice(1);if(t.length===6){if(t[0]===t[1]&&t[2]===t[3]&&t[4]===t[5])return`#${t[0]}${t[2]}${t[4]}`}if(t.length===8){if(t[0]===t[1]&&t[2]===t[3]&&t[4]===t[5]&&t[6]===t[7])return`#${t[0]}${t[2]}${t[4]}${t[6]}`}return e}function io(e){let t=e.toLowerCase();return Bu[t]??null}function oo(e){let t=e.toLowerCase();return Uu[t]??null}function Vu(e,t,r){let n=(e<<16|t<<8|r).toString(16).padStart(6,"0");return mn(`#${n}`)}var Wu=/^rgba?\(\s*([+-]?\d*\.?\d+%?)\s*[,\s]\s*([+-]?\d*\.?\d+%?)\s*[,\s]\s*([+-]?\d*\.?\d+%?)\s*(?:[,/]\s*([+-]?\d*\.?\d+%?)\s*)?\)$/;function so(e){let t=Wu.exec(e.trim());if(!t)return e;let r=gn(t[1]),n=gn(t[2]),i=gn(t[3]);if(t[4]!==void 0&&!zu(t[4]))return e;return Vu(r,n,i)}function zu(e){if(e.endsWith("%"))return Number.parseFloat(e)>=100;return Number.parseFloat(e)>=1}function gn(e){if(e.endsWith("%"))return Math.max(0,Math.min(255,Math.round(Number.parseFloat(e)*2.55)));return Math.max(0,Math.min(255,Math.round(Number.parseFloat(e))))}var Ku=new Set(["px","pt","pc","in","cm","mm","q","em","rem","ex","ch","cap","ic","lh","rlh","vw","vh","vi","vb","vmin","vmax","svw","svh","svi","svb","svmin","svmax","lvw","lvh","lvi","lvb","lvmin","lvmax","dvw","dvh","dvi","dvb","dvmin","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"]);function Wt(e){if(e.charCodeAt(0)===43)e=e.slice(1);if(e.includes(".")){let t=e.replace(/(\.\d*?)0+($|[eE])/,"$1$2");t=t.replace(/\.($|[eE])/,"$1"),e=t}if(e.startsWith("0.")&&e.length>2)e=e.slice(1);else if(e.startsWith("-0.")&&e.length>3)e=`-${e.slice(2)}`;if(e==="-0"||e==="-.0"||e==="-0.0")e="0";return e}function ao(e,t){let r=Wt(e);if((r==="0"||r==="-0")&&Ku.has(t.toLowerCase()))return{value:"0",unit:""};return{value:r,unit:t}}function lo(e){return Wt(e)}function co(e,t){let r=Number.parseFloat(e);if(!Number.isFinite(r))return e;let n=t<0?0:t;return r.toFixed(n)}var uo=new Set(["color","background","background-color","border","border-color","border-top","border-top-color","border-right","border-right-color","border-bottom","border-bottom-color","border-left","border-left-color","border-block","border-block-color","border-block-start-color","border-block-end-color","border-inline","border-inline-color","border-inline-start-color","border-inline-end-color","outline","outline-color","caret-color","fill","stroke","flood-color","lighting-color","stop-color","column-rule","column-rule-color","text-decoration","text-decoration-color","text-emphasis","text-emphasis-color","text-shadow","box-shadow","accent-color","scrollbar-color"]);function fo(e){if(!e||e.type!=="Operator")return!1;let t=e.value;return t===":"||t===","||t==="/"}function Hu(e){let t=e.children;if(!t)return;while(t.head&&t.head.data.type==="WhiteSpace")t.remove(t.head);while(t.tail&&t.tail.data.type==="WhiteSpace")t.remove(t.tail);let r=t.head;while(r){let n=r.next;if(r.data.type==="WhiteSpace"){let i=r.prev&&fo(r.prev.data),o=n&&fo(n.data);if(i||o)t.remove(r)}r=n}}function pn(e,t={}){let r=t.floatPrecision??null,n=r===null?null:(i)=>co(i,r);Ke(e,{enter(i,o,s){switch(i.type){case"Number":{let c=n?n(i.value):i.value;i.value=Wt(c);return}case"Percentage":{let c=n?n(i.value):i.value;i.value=lo(c);return}case"Dimension":{let c=n?n(i.value):i.value,a=ao(c,i.unit);i.value=a.value,i.unit=a.unit;return}case"Hash":{let c=mn(`#${i.name}`).slice(1);if(i.name=c,o&&s&&this.declaration&&uo.has(this.declaration.property.toLowerCase())){let a=oo(`#${c}`);if(a&&a.length<c.length+1){let l={type:"Identifier",name:a,loc:i.loc};s.replace(o,s.createItem(l))}}return}case"Identifier":{if(!o||!s||!this.declaration)return;if(!uo.has(this.declaration.property.toLowerCase()))return;let c=io(i.name);if(c&&c.length<i.name.length){let a={type:"Hash",name:c.slice(1),loc:i.loc};s.replace(o,s.createItem(a))}return}case"Url":return;case"Function":{let c=i.name.toLowerCase();if((c==="rgb"||c==="rgba")&&o&&s)i.__rgbReplaceCandidate=!0}}},leave(i,o,s){if(i.type==="Parentheses"||i.type==="Function"||i.type==="Value")Hu(i);if(i.type==="Function"&&i.__rgbReplaceCandidate&&o&&s){let c=Q(i),a=so(c);if(a!==c&&a.startsWith("#")){let l={type:"Hash",name:a.slice(1),loc:i.loc};s.replace(o,s.createItem(l))}}}})}function Gu(e,t={}){let r=Bt(e,{context:"stylesheet"});return ho(r,t)}function yn(e,t={}){let r=Bt(e,{context:"declarationList"});return ho(r,t)}function ho(e,t){if(t.comments===!1)Qe(e,{exclamation:!1});else if(t.comments==="first-exclamation")Qe(e,{exclamation:"first-exclamation"});else Qe(e,{exclamation:!0});return pn(e,{floatPrecision:t.floatPrecision??null}),Vt(e),{css:Q(e),ast:e}}function Le(e,t,r){if(e.size>=1e4){let n=e.keys().next().value;if(n!==void 0)e.delete(n)}return e.set(t,r),r}var go=new Map,_e=new Map;var bn={col:"col",row:"row",jc:"justify",ji:"justify-items",js:"justify-self",ai:"items",ac:"content",as:"self",wrap:"wrap",nowrap:"nowrap",c:"center",s:"start",e:"end",sb:"between",sa:"around",se:"evenly",st:"stretch",thin:"thin",extralight:"extralight",light:"light",normal:"normal",medium:"medium",semibold:"semibold",bold:"bold",extrabold:"extrabold",black:"black",t:"top",r:"right",b:"bottom",l:"left"},Ju=/[%#()]/,Xu=/^\d+(?:\.\d+)?(?:px|rem|em|vh|vw|dvh|dvw|svh|svw|lvh|lvw|ch|ex|lh|cap|ic|rlh|vi|vb|vmin|vmax|cqw|cqh|cqi|cqb|cqmin|cqmax|cm|mm|in|pt|pc|Q)$/,$o=["calc","min","max","clamp","mod","rem","sin","cos","tan","asin","acos","atan","atan2","pow","sqrt","hypot","log","exp","round"],Zu=new Set($o);function se(e){return Ju.test(e)||Xu.test(e)}function mo(e){if(!$o.some((o)=>e.includes(`${o}(`)))return e;let t="",r=[],n=null,i=null;for(let o=0;o<e.length;o++){let s=e.charCodeAt(o);if(s>=48&&s<=57)n=o;else if(n!==null&&(s===37||s>=97&&s<=122||s>=65&&s<=90))n=o;else i=n,n=null;if(s===40){t+=e[o];let a=o;for(let u=o-1;u>=0;u--){let f=e.charCodeAt(u);if(f>=48&&f<=57||f>=97&&f<=122)a=u;else break}let l=e.slice(a,o);if(Zu.has(l))r.unshift(!0);else if(r[0]&&l==="")r.unshift(!0);else r.unshift(!1);continue}if(s===41){t+=e[o],r.shift();continue}if(s===44&&r[0]){t+=", ";continue}if(s===32&&r[0]&&t.charCodeAt(t.length-1)===32)continue;if((s===43||s===45||s===42||s===47)&&r[0]){let a=t.trimEnd(),l=a.charCodeAt(a.length-1),u=a.charCodeAt(a.length-2),f=e.charCodeAt(o+1),d=l===43||l===45||l===42||l===47,h=f===43||f===45||f===42||f===47;if((l===101||l===69)&&u>=48&&u<=57)t+=e[o];else if(d||l===40||l===44)t+=e[o];else if(e.charCodeAt(o-1)===32)t+=`${e[o]} `;else if(l>=48&&l<=57||f>=48&&f<=57||l===41||f===40||h||i!==null&&i===o-1)t+=` ${e[o]} `;else t+=e[o];continue}t+=e[o]}return t}function zt(e){if(!e.includes("_"))return mo(e);let t="",r=0;while(r<e.length){let n=e[r];if(n==="\\"&&e[r+1]==="_"){t+="_",r+=2;continue}if(n==="u"&&e.slice(r,r+4)==="url("){let i=r,o=1;r+=4;while(r<e.length&&o>0){if(e[r]==="(")o++;else if(e[r]===")")o--;r++}t+=e.slice(i,r);continue}t+=n==="_"?" ":n,r++}return mo(t)}function po(e,t){if(t.length!==2)return null;let[r,n]=t;if(r!=="min"&&r!=="max")return null;return[se(n)?`${r}-${e}-[${n}]`:`${r}-${e}-${n}`]}var Qu={flex:{expand:(e,t)=>{let r=t[e]||e;if(["col","row","col-reverse","row-reverse","wrap","nowrap","wrap-reverse"].includes(r))return`flex-${r}`;let n=e.match(/^(jc|ji|js|ai|ac|as)-(.+)$/);if(n){let i=t[n[1]]||n[1],o=t[n[2]]||n[2];return`${i}-${o}`}if(/^\d+$/.test(r)||["grow","shrink","auto","initial","none"].includes(r))return`flex-${r}`;return null}},grid:{expand:(e,t)=>{let r=t[e]||e;if(e.startsWith("cols-")||e.startsWith("rows-"))return`grid-${e}`;if(e.startsWith("flow-"))return`grid-${e}`;if(e.startsWith("gap-"))return e;return null}},text:{expand:(e,t)=>{let r=t[e]||e;if(se(r))return`text-[${r}]`;if(/^\d{3}$/.test(r))return{"100":"font-thin","200":"font-extralight","300":"font-light","400":"font-normal","500":"font-medium","600":"font-semibold","700":"font-bold","800":"font-extrabold","900":"font-black"}[r]||`font-[${r}]`;if(/^[a-z-]+$/i.test(r)&&!["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(r)){if(["white","black","inherit","current","transparent"].includes(r.toLowerCase()))return`text-${r}`;if(["red","blue","green","yellow","purple","pink","gray","slate","zinc","neutral","stone","orange","amber","lime","emerald","teal","cyan","sky","indigo","violet","fuchsia","rose"].includes(r.toLowerCase()))return`text-${r}-500`;return`font-[${r}]`}return`text-${r}`}},font:{expand:(e,t)=>{let r=t[e]||e,n=["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],i=["sans","serif","mono"];if(n.includes(r)||i.includes(r))return`font-${r}`;if(/^\d{3}$/.test(r))return{"100":"font-thin","200":"font-extralight","300":"font-light","400":"font-normal","500":"font-medium","600":"font-semibold","700":"font-bold","800":"font-extrabold","900":"font-black"}[r]||`font-[${r}]`;return`font-[${r}]`}},bg:{expand:(e,t)=>`bg-${t[e]||e}`},w:{expand:(e,t)=>{let r=t[e]||e;if(se(r))return`w-[${r}]`;return`w-${r}`},multiValue:(e)=>po("w",e)},h:{expand:(e,t)=>{let r=t[e]||e;if(se(r))return`h-[${r}]`;return`h-${r}`},multiValue:(e)=>po("h",e)},p:{expand:(e)=>`p-${e}`},px:{expand:(e)=>`px-${e}`},py:{expand:(e)=>`py-${e}`},pt:{expand:(e)=>`pt-${e}`},pr:{expand:(e)=>`pr-${e}`},pb:{expand:(e)=>`pb-${e}`},pl:{expand:(e)=>`pl-${e}`},m:{expand:(e)=>`m-${e}`},mx:{expand:(e)=>`mx-${e}`},my:{expand:(e)=>`my-${e}`},mt:{expand:(e)=>`mt-${e}`},mr:{expand:(e)=>`mr-${e}`},mb:{expand:(e)=>`mb-${e}`},ml:{expand:(e)=>`ml-${e}`},scroll:{expand:(e)=>{if(["x","y"].includes(e))return null;if(["auto","hidden","scroll","visible"].includes(e))return`overflow-${e}`;return null},multiValue:(e)=>{if(e.length===2){let[t,r]=e;if(["x","y"].includes(t)&&["auto","hidden","scroll","visible"].includes(r))return[`overflow-${t}-${r}`]}return null}},overflow:{expand:(e)=>`overflow-${e}`,multiValue:(e)=>{if(e.length===2){let[t,r]=e;if(["x","y"].includes(t))return[`overflow-${t}-${r}`]}return null}},border:{expand:(e)=>`border-${e}`},rounded:{expand:(e)=>`rounded-${e}`},shadow:{expand:(e)=>`shadow-${e}`},gap:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-"))return`gap-${e}`;return`gap-${e}`}},space:{expand:(e)=>`space-${e}`},opacity:{expand:(e)=>`opacity-${e}`},z:{expand:(e)=>`z-${e}`},inset:{expand:(e,t)=>{let r=t[e]||e;if(r.startsWith("x-")||r.startsWith("y-"))return`inset-${r}`;if(se(r))return`inset-[${r}]`;return`inset-${r}`}},top:{expand:(e)=>se(e)?`top-[${e}]`:`top-${e}`},right:{expand:(e)=>se(e)?`right-[${e}]`:`right-${e}`},bottom:{expand:(e)=>se(e)?`bottom-[${e}]`:`bottom-${e}`},left:{expand:(e)=>se(e)?`left-[${e}]`:`left-${e}`},duration:{expand:(e)=>`duration-${e}`},delay:{expand:(e)=>`delay-${e}`},ease:{expand:(e)=>`ease-${e}`},transition:{expand:(e)=>{if(["all","none","colors","opacity","shadow","transform"].includes(e))return`transition-${e}`;if(/^\d+$/.test(e))return`duration-${e}`;if(["linear","in","out","in-out","ease-linear","ease-in","ease-out","ease-in-out"].includes(e))return e.startsWith("ease-")?e:`ease-${e}`;return`transition-${e}`}},translate:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-")||e.startsWith("z-"))return`translate-${e}`;return`translate-${e}`}},rotate:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-")||e.startsWith("z-"))return`rotate-${e}`;return`rotate-${e}`}},scale:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-")||e.startsWith("z-"))return`scale-${e}`;return`scale-${e}`}},skew:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-"))return`skew-${e}`;return`skew-${e}`}},origin:{expand:(e)=>`origin-${e}`},cursor:{expand:(e)=>`cursor-${e}`},select:{expand:(e)=>`select-${e}`},resize:{expand:(e)=>`resize-${e}`},appearance:{expand:(e)=>`appearance-${e}`},pointer:{expand:(e)=>`pointer-events-${e}`},outline:{expand:(e)=>`outline-${e}`},ring:{expand:(e)=>`ring-${e}`},blur:{expand:(e)=>`blur-${e}`},brightness:{expand:(e)=>`brightness-${e}`},contrast:{expand:(e)=>`contrast-${e}`},grayscale:{expand:(e)=>`grayscale-${e}`},saturate:{expand:(e)=>`saturate-${e}`},sepia:{expand:(e)=>`sepia-${e}`},backdrop:{expand:(e)=>`backdrop-${e}`},aspect:{expand:(e)=>`aspect-${e}`},columns:{expand:(e)=>`columns-${e}`},break:{expand:(e)=>`break-${e}`},object:{expand:(e)=>`object-${e}`},overscroll:{expand:(e)=>`overscroll-${e}`},place:{expand:(e)=>`place-${e}`},items:{expand:(e)=>`items-${e}`},justify:{expand:(e)=>`justify-${e}`},content:{expand:(e)=>`content-${e}`},self:{expand:(e)=>`self-${e}`},order:{expand:(e)=>`order-${e}`},col:{expand:(e)=>`col-${e}`},row:{expand:(e)=>`row-${e}`},tracking:{expand:(e)=>`tracking-${e}`},leading:{expand:(e)=>`leading-${e}`},list:{expand:(e)=>`list-${e}`},decoration:{expand:(e)=>`decoration-${e}`},underline:{expand:(e)=>`underline-${e}`},accent:{expand:(e)=>`accent-${e}`},caret:{expand:(e)=>`caret-${e}`},"scroll-m":{expand:(e)=>`scroll-m-${e}`},"scroll-p":{expand:(e)=>`scroll-p-${e}`},snap:{expand:(e)=>`snap-${e}`},touch:{expand:(e)=>`touch-${e}`},will:{expand:(e)=>`will-change-${e}`},fill:{expand:(e)=>`fill-${e}`},stroke:{expand:(e)=>`stroke-${e}`},sr:{expand:(e)=>`sr-${e}`},invert:{expand:(e)=>`invert-${e}`},"hue-rotate":{expand:(e)=>se(e)?`hue-rotate-[${e}]`:`hue-rotate-${e}`},"drop-shadow":{expand:(e)=>`drop-shadow-${e}`},"backdrop-invert":{expand:(e)=>`backdrop-invert-${e}`},"backdrop-hue-rotate":{expand:(e)=>se(e)?`backdrop-hue-rotate-[${e}]`:`backdrop-hue-rotate-${e}`},animate:{expand:(e)=>`animate-${e}`},"forced-colors":{expand:(e)=>`forced-colors-${e}`}},Rt=new Set(["sm","md","lg","xl","2xl","hover","focus","active","visited","disabled","enabled","focus-within","focus-visible","group-hover","group-focus","peer-hover","peer-focus","*","**","dark","first","last","odd","even","only","first-of-type","last-of-type","only-of-type","checked","indeterminate","default","required","valid","invalid","in-range","out-of-range","placeholder-shown","autofill","read-only","user-valid","user-invalid","inert","empty","before","after","selection","marker","file","first-letter","first-line","backdrop","details-content","print","motion-safe","motion-reduce","pointer-none","pointer-coarse","pointer-fine","any-pointer-none","any-pointer-coarse","any-pointer-fine","inverted-colors","noscript","starting","contrast-more","contrast-less","rtl","ltr","portrait","landscape","@sm","@md","@lg","@xl","@2xl"]),yo=new WeakMap,bo=new WeakMap;function ef(e){if(!e)return bn;let t=yo.get(e);if(!t)t=e.aliases?{...bn,...e.aliases}:bn,yo.set(e,t);return t}function tf(e){if(!e?.aliases)return"";let t=bo.get(e);if(t===void 0)t=JSON.stringify(e.aliases),bo.set(e,t);return t}function xo(e){let t=[],r="",n=0;for(let i=0;i<e.length;i++){let o=e[i];if(o==="[")n++;else if(o==="]")n--;if(o===":"&&n===0)t.push(r),r="";else r+=o}return t.push(r),t}function rf(e,t){let r=`${e}:${t?.colonSyntax}:${tf(t)}`,n=_e.get(r);if(n)return n;let i=ef(t);if(t?.colonSyntax===!0){let g=e.match(/^([a-z][a-z0-9-]*):([^[\]:]+)$/i);if(g){let[,p,y]=g;if(!Rt.has(p)){if(se(y)){let w=[`${p}-[${y}]`];return Le(_e,r,w),w}let x=y.startsWith("-")?[`-${p}-${y.slice(1)}`]:[`${p}-${y}`];return Le(_e,r,x),x}}}let o="",s=e,c=!1;if(s.startsWith("-"))c=!0,s=s.slice(1);let a=s.match(/^((?:[a-z@][a-z0-9-]*:)+)(.+)$/i);if(a){if(a[1].slice(0,-1).split(":").every((y)=>Rt.has(y)))o=a[1],s=a[2]}let l=s.match(/^([a-z][a-z0-9-]*)\[([^\]]*)\]$/i);if(!l||s.includes("-[")){let g=[e];return Le(_e,r,g),g}let[,u,f]=l,d=f.split(/\s+/).filter(Boolean);if(d.length===0)return Le(_e,r,[]),[];let h=Qu[u.toLowerCase()];if(h?.multiValue){let g=h.multiValue(d,i);if(g){let p=g.map((y)=>`${o}${c?"-":""}${y}`);return Le(_e,r,p),p}}if(!h){let g=[];for(let p of d){let y=p.match(/^([a-z@][a-z0-9-]*):(.+)$/i),x="",w=p;if(y&&Rt.has(y[1]))x=`${y[1]}:`,w=y[2];let T="";if(w.startsWith("-"))T="-",w=w.slice(1);let S="";if(w.endsWith("!"))S="!",w=w.slice(0,-1);let j=c?"-":"";if(se(w))g.push(`${o}${x}${S}${j}${T}${u}-[${w}]`);else g.push(`${o}${x}${S}${j}${T}${u}-${w}`)}return Le(_e,r,g),g}let m=[];for(let g of d){let p=g.match(/^([a-z@][a-z0-9-]*):(.+)$/i),y="",x=g;if(p&&Rt.has(p[1]))y=`${p[1]}:`,x=p[2];let w="";if(x.startsWith("-"))w="-",x=x.slice(1);let T="";if(x.endsWith("!"))T="!",x=x.slice(0,-1);let S=h.expand(x,i);if(S){let j=c?"-":"";m.push(`${o}${y}${T}${j}${w}${S}`)}}return Le(_e,r,m),m}function nf(e,t){let r=new Set;if(!t?.enabled)return r;let n=t.prefix??"tc-",i=["class","className","style","id","name","type","value","href","src","alt","title","role","for","action","method","target","rel","placeholder","disabled","checked","selected","readonly","required","maxlength","minlength","pattern","autocomplete","autofocus","tabindex","contenteditable","draggable","spellcheck","lang","dir","hidden","slot","part","is","key","ref"],o=t.ignoreAttributes||i,s=(l)=>{let u=l.includes(":")?l.split(":").pop():l;for(let f of o)if(f.endsWith("*")){if(u.startsWith(f.slice(0,-1)))return!0}else if(u===f)return!0;if(u.startsWith("on"))return!0;if(u.startsWith("data-")||u.startsWith("aria-"))return!0;return!1},c=/<([a-z][a-z0-9-]*)\s([^>]*)>/gi,a;while((a=c.exec(e))!==null){let l=a[2],u=/([a-z][a-z0-9-:]*)(?:=["']([^"']*)["'])?(?=\s|$|\/?>)/gi,f;while((f=u.exec(l))!==null){let d=f[1],h=f[2];if(n){if(!d.startsWith(n))continue;d=d.slice(n.length)}if(s(d))continue;let m="",g=d,p=d.match(/^((?:[a-z@][a-z0-9-]*:)+)([a-z][a-z0-9-]*)$/i);if(p){if(p[1].slice(0,-1).split(":").every((w)=>Rt.has(w)))m=p[1],g=p[2]}if(h!==void 0){let y=h.split(/\s+/).filter(Boolean);for(let x of y){let w=`${m}${g}-${x}`;if(vo(w.replace(/^(?:[a-z@][a-z0-9-]*:)+/gi,"")))r.add(w)}}else{let y=`${m}${g}`;if(vo(g))r.add(y)}}}return r}function vo(e){if(!e||e.length===0)return!1;return/^[a-z][a-z0-9-/]*(?:-\[[^\]]+\])?$/i.test(e)}function Co(e){let t=go.get(e);if(t)return t;let r=cf(e);return r.base=lf(r),Le(go,e,r),r}var of=new Set(["bg","text","border","ring","placeholder","divide","accent","caret","fill","stroke","outline","decoration","shadow","ring-offset","from","via","to"]),sf=/^(.+?)\/(\d+|\[\d*\.?\d+\])$/,af=/^(\d+)\/(\d+)$/;function wo(e){let t=!1;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n===45){if(!t||r+1>=e.length)return;return[e.slice(0,r),e.slice(r+1)]}if(n>=97&&n<=122){t=!0;continue}return}return}function lf(e){let t=e.raw;for(let r of e.variants)if(t.startsWith(`${r}:`))t=t.slice(r.length+1);if(e.important){if(t.charCodeAt(0)===33)t=t.slice(1);else if(t.charCodeAt(t.length-1)===33)t=t.slice(0,-1)}return t}function cf(e){let t=!1,r=e;if(e.startsWith("!"))t=!0,r=e.slice(1);else if(e.endsWith("!")&&e.length>1)t=!0,r=e.slice(0,-1);{let h=xo(r),m=h[h.length-1],g=!1;if(m.charCodeAt(0)===33&&m.length>1)g=!0,m=m.slice(1);let p=m.match(/^\[([a-z-]+):(.+)\]$/);if(p)return{raw:e,variants:h.slice(0,-1),utility:p[1],value:zt(p[2]),important:t||g,arbitrary:!0}}let n=r.match(/^((?:[a-z-]+:)*)(-?[a-z-]+?)-\[([^\]]+)\]\/\[([^\]]+)\]$/);if(n){let[,h,m,g,p]=n,y=h?h.split(":").filter(Boolean):[],x=m.startsWith("-"),w=x?m.slice(1):m,T=zt(g);if(x)T=T.startsWith("-")?T:`-${T}`;return{raw:e,variants:y,utility:w,value:`${T}/${p}`,important:t,arbitrary:!0,modifierArbitrary:!0}}let i=r.match(/^((?:[a-z-]+:)*)(-?[a-z-]+?)-\[(.+)\]$/);if(i){let h=i[1],m=h?h.split(":").filter(Boolean):[],g=i[2],p=g.startsWith("-");if(p)g=g.slice(1);let y=zt(i[3]),x,w=y.match(/^(color|length|url|number|percentage|position|line-width|absolute-size|relative-size|image|angle|time|flex|string|family-name):(.*)/i);if(w)x=w[1].toLowerCase(),y=w[2];if(p)y=y.startsWith("-")?y:`-${y}`;return{raw:e,variants:m,utility:g,value:y,important:t,arbitrary:!0,typeHint:x}}let o=xo(r),s=o[o.length-1],c=o.slice(0,-1);if(s.startsWith("!")&&s.length>1)t=!0,s=s.slice(1);else if(s.endsWith("!")&&s.length>1)t=!0,s=s.slice(0,-1);if(c.length>0)r=`${c.join(":")}:${s}`;else r=s;if(["inline-block","inline-flex","inline-grid","flex-row","flex-row-reverse","flex-col","flex-col-reverse","flex-wrap","flex-wrap-reverse","flex-nowrap","flex-1","flex-auto","flex-initial","flex-none","flex-grow","flex-shrink"].includes(s))return{raw:e,variants:c,utility:s,value:void 0,important:t,arbitrary:!1};let l=s.match(/^([a-z-]+?)-\[(.+?)\]$/);if(l){let h=zt(l[2]),m,g=h.match(/^(color|length|url|number|percentage|position|line-width|absolute-size|relative-size|image|angle|time|flex|string|family-name):(.*)/i);if(g)m=g[1].toLowerCase(),h=g[2];return{raw:e,variants:c,utility:l[1],value:h,important:t,arbitrary:!0,typeHint:m}}let u=["inset-x","inset-y","border-t","border-r","border-b","border-l","border-x","border-y","border-s","border-e","grid-cols","grid-rows","grid-flow","auto-cols","auto-rows","col-span","row-span","col-start","col-end","row-start","row-end","translate-x","translate-y","translate-z","scale-x","scale-y","scale-z","rotate-x","rotate-y","rotate-z","skew-x","skew-y","scroll-m","scroll-mx","scroll-my","scroll-mt","scroll-mr","scroll-mb","scroll-ml","scroll-p","scroll-px","scroll-py","scroll-pt","scroll-pr","scroll-pb","scroll-pl","gap-x","gap-y","overflow-x","overflow-y","min-w","max-w","min-h","max-h","space-x","space-y","ring-offset","underline-offset","outline-offset","backdrop-blur","backdrop-brightness","backdrop-contrast","backdrop-grayscale","backdrop-invert","backdrop-saturate","backdrop-sepia","hue-rotate","drop-shadow","mask-clip","flex-grow","flex-shrink","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","perspective-origin","justify-self","form-input","form-textarea","form-select","form-multiselect","form-checkbox","form-radio","mix-blend","bg-blend","line-clamp","border-spacing","border-spacing-x","border-spacing-y","rounded-s","rounded-e","rounded-ss","rounded-se","rounded-es","rounded-ee","rounded-t","rounded-r","rounded-b","rounded-l","rounded-tl","rounded-tr","rounded-bl","rounded-br","border-opacity","ring-opacity","stroke-dasharray","stroke-dashoffset","animate-iteration","animate-duration","animate-delay","text-emphasis-color","text-emphasis","text-shadow","word-spacing","column-gap","column-rule","font-stretch","list-image"];if(s==="divide-x"||s==="divide-y")return{raw:e,variants:c,utility:s,value:void 0,important:t,arbitrary:!1};let f=s.match(/^(divide-[xy])-(.+)$/);if(f)return{raw:e,variants:c,utility:f[1],value:f[2],important:t,arbitrary:!1};for(let h of u)if(s.startsWith(`${h}-`))return{raw:e,variants:c,utility:h,value:s.slice(h.length+1),important:t,arbitrary:!1};if(s.startsWith("-")){let h=s.slice(1);for(let g of u)if(h.startsWith(`${g}-`))return{raw:e,variants:c,utility:g,value:`-${h.slice(g.length+1)}`,important:t,arbitrary:!1};let m=wo(h);if(m)return{raw:e,variants:c,utility:m[0],value:`-${m[1]}`,important:t,arbitrary:!1};return{raw:e,variants:c,utility:h,value:void 0,important:t,arbitrary:!1}}let d=wo(s);if(d){let[h,m]=d,g=m.match(sf);if(g&&of.has(h))return{raw:e,variants:c,utility:h,value:`${g[1]}/${g[2]}`,important:t,arbitrary:!1};let p=m.match(af);if(p)return{raw:e,variants:c,utility:h,value:`${p[1]}/${p[2]}`,important:t,arbitrary:!1};return{raw:e,variants:c,utility:h,value:m,important:t,arbitrary:!1}}return{raw:e,variants:c,utility:s,value:void 0,important:t,arbitrary:!1}}function Ro(e,t){if(!e||e.length===0)return!1;if(/^\[[a-z-]+:[^\]]+\]$/i.test(e))return!0;if(t?.enabled&&/^[a-z]+\[[^\]]+\]$/i.test(e))return!0;if(t?.colonSyntax&&/^[a-z]+:[^[\]:]+$/i.test(e))return!0;let r=String.raw`!?-?[a-z][a-z0-9.-]*(?:-\[[^\]]+\])?(?:\/(?:[\w.]+|\[[^\]]+\]))?`;return new RegExp(`^${r}(?::${r})*$`,"i").test(e)}function Ht(e){let t=[],r="",n=0;for(let i of e)if(i==="[")n++,r+=i;else if(i==="]")n--,r+=i;else if(/\s/.test(i)&&n===0){if(r)t.push(r),r=""}else r+=i;if(r)t.push(r);return t}function Gt(e,t){let r=new Set,n=[/class(?:Name)?=["']([^"']+)["']/g,/class(?:Name)?=\{["']([^"']+)["']\}/g,/class(?:Name)?=\{`([^`]+)`\}/g];for(let o of n){let s;while((s=o.exec(e))!==null){let c=s[1],a=c.match(/["']([^"']+)["']/g);if(a)for(let f of a){let d=f.replace(/["']/g,""),h=Ht(d);for(let m of h)Kt(r,m,t)}let l=c.replace(/["'`]/g," ").replace(/\$\{[^}]+\}/g," "),u=Ht(l).filter((f)=>Ro(f,t?.bracketSyntax));for(let f of u)Kt(r,f,t)}}let i=[/class(?:Name|:list)?=\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,/:class="([^"]*)"/g,/:class='([^']*)'/g,/\bx-class="([^"]*)"/g,/\bx-class='([^']*)'/g];for(let o of i){let s;while((s=o.exec(e))!==null){let c=s[1].match(/["'`]([^"'`]+)["'`]/g);if(c)for(let a of c){let l=a.replace(/["'`]/g,"").replace(/\$\{[^}]+\}/g," ");for(let u of Ht(l))Kt(r,u,t)}}}if(t?.codeStrings?.enabled!==!1)for(let o of ff(e,t?.bracketSyntax))Kt(r,o,t);if(t?.attributify?.enabled){let o=nf(e,t.attributify);for(let s of o)r.add(s)}return r}function uf(e,t){if(!/[-:/[]/.test(e))return!1;if(e.startsWith("-")&&!/^-[a-z]/i.test(e))return!1;return Ro(e,t)}function ff(e,t){let r=new Set,n=e.length,i=0,o="";while(i<n){let s=e[i];if(s==="/"&&e[i+1]==="/"){let d=e.indexOf(`
|
|
92
92
|
`,i);i=d===-1?n:d;continue}if(s==="/"&&e[i+1]==="*"){let d=e.indexOf("*/",i+2);i=d===-1?n:d+2;continue}if(s==="/"&&!/[\w$)\]]/.test(o)){let d=df(e,i);if(d!==-1){i=d,o=")";continue}}if(s!=='"'&&s!=="'"&&s!=="`"){if(!/\s/.test(s))o=s;i++;continue}o=")";let c=hf(e,i),a=s==="`",l=i+1,u="",f=!1;while(l<n){let d=e[l];if(d==="\\"){u+=e[l+1]??"",l+=2;continue}if(d===s){f=!0,l++;break}if(!a&&d===`
|
|
93
93
|
`)break;if(a&&d==="$"&&e[l+1]==="{"){let h=1;l+=2;while(l<n&&h>0){if(e[l]==="{")h++;else if(e[l]==="}")h--;l++}u+=" ";continue}u+=d,l++}if(f){if(c){i=l;continue}for(let d of Ht(u))if(uf(d,t))r.add(d);i=l}else i++}return r}function df(e,t){let r=!1;for(let n=t+1;n<e.length;n++){let i=e[n];if(i===`
|
|
94
94
|
`)return-1;if(i==="\\"){n++;continue}if(i==="[")r=!0;else if(i==="]")r=!1;else if(i==="/"&&!r){let o=n+1;while(o<e.length&&/[a-z]/i.test(e[o]))o++;return o}}return-1}function hf(e,t){let r=e.lastIndexOf("<",t),n=e.lastIndexOf(">",t);if(r<=n)return!1;let i=e[r+1];if(!i||!/[A-Za-z!/]/.test(i))return!1;let o=t-1;while(o>r&&/\s/.test(e[o]))o--;if(e[o]==="=")return!0;if(e[o]==="{"){o--;while(o>r&&/\s/.test(e[o]))o--;return e[o]==="="}return!1}function Kt(e,t,r){if(r?.bracketSyntax?.enabled){let n=/^[a-z]+\[[^\]]+\]$/i.test(t),i=r.bracketSyntax.colonSyntax&&/^[a-z]+:[^[\]]+$/i.test(t);if(n||i){let o=rf(t,r.bracketSyntax);for(let s of o)e.add(s);return}}e.add(t)}var qt={getCSS:()=>`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{F as k}from"./chunk-1kmkypmr.js";var a={};k(a,{stringify:()=>O,parse:()=>W,isTraversal:()=>E,IgnoreCaseMode:()=>N});var w=/(?:\\(?:[\dA-Fa-f]{1,6} ?|[^])|[\w\-\u00B0-\uFFFF])+/y,b=/\\([\dA-Fa-f]{1,6} ?|[^])/g;function S(z){return z.replace(b,(X,Z)=>{if(Z.length>1&&/^[\dA-Fa-f]/.test(Z)){let Q=Number.parseInt(Z,16);if(Q>=55296&&Q<=57343)return"\uFFFD";return String.fromCodePoint(Q)}return Z})}function R(z){return z.indexOf("\\")<0?z:S(z)}var T=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function x(z){switch(z){case 126:return"element";case 94:return"start";case 36:return"end";case 42:return"any";case 33:return"not";case 124:return"hyphen";default:return null}}function P(z){return z===32||z===9||z===10||z===13||z===12}function W(z,X={}){let Z=[],Q=_(Z,z,X,0);if(Q<z.length)throw Error(`Unmatched selector: ${z.slice(Q)}`);return Z}function Y(z,X){w.lastIndex=X;let Z=w.exec(z);if(!Z)throw Error(`Expected name, found ${z.slice(X)}`);return{value:R(Z[0]),end:X+Z[0].length}}function L(z,X){while(X<z.length&&P(z.charCodeAt(X)))X++;return X}function _(z,X,Z,Q){let H=[],J=L(X,Q),G=X.length,B=Z.xmlMode===!0,D=Z.lowerCaseAttributeNames!==!1&&!B,V=Z.lowerCaseTags!==!1;while(J<G){let U=X.charCodeAt(J);if(P(U)){let $=J+1;while($<G&&P(X.charCodeAt($)))$++;if(H.length===0)return $;J=$,h(H,"descendant");continue}if(U===62||U===60||U===126||U===43||U===124){let $=J+1;while($<G&&P(X.charCodeAt($)))$++;switch(J=$,U){case 62:h(H,"child");break;case 60:h(H,"parent");break;case 126:h(H,"sibling");break;case 43:h(H,"adjacent");break;case 124:if(J<G&&X.charCodeAt(J)===124)J++,J=L(X,J),h(H,"column-combinator");else H.push({type:"tag",name:"",namespace:""});break}continue}if(U===44){if(H.length===0)throw Error("Empty sub-selector");z.push(H),H=[],J=L(X,J+1);continue}if(U===47&&X.charCodeAt(J+1)===42){let $=X.indexOf("*/",J+2);if($<0)throw Error("Unmatched comment");J=L(X,$+2);continue}if(U===42){J++,H.push({type:"universal",namespace:null});continue}if(U===35){let $=Y(X,J+1);J=$.end,H.push({type:"attribute",name:"id",action:"equals",value:$.value,namespace:null,ignoreCase:!1});continue}if(U===46){let $=Y(X,J+1);J=$.end,H.push({type:"attribute",name:"class",action:"element",value:$.value,namespace:null,ignoreCase:!1});continue}if(U===91){J=g(X,J,H,Z,B,D);continue}if(U===58){J=I(X,J,H,Z);continue}if(U===124){J++;let $=Y(X,J);J=$.end,H.push({type:"tag",name:V?$.value.toLowerCase():$.value,namespace:""});continue}{let $=Y(X,J);if(J=$.end,J<G&&X.charCodeAt(J)===124&&X.charCodeAt(J+1)!==61){J++;let j=Y(X,J);J=j.end,H.push({type:"tag",name:V?j.value.toLowerCase():j.value,namespace:$.value})}else H.push({type:"tag",name:V?$.value.toLowerCase():$.value,namespace:null})}}if(H.length>0)z.push(H);return J}function g(z,X,Z,Q,H,J){let G=X+1,B=z.length,D;if(z.charCodeAt(G)===124)throw Error("Empty namespace not supported");if(z.charCodeAt(G)===42&&z.charCodeAt(G+1)===124){G+=2;let K=Y(z,G);G=K.end,D=K.value}else{let K=Y(z,G);if(G=K.end,D=K.value,z.charCodeAt(G)===124&&z.charCodeAt(G+1)!==61){G++;let F=Y(z,G);G=F.end,D=F.value}}G=L(z,G);let V="exists",U="",$=null,j=z.charCodeAt(G);if(j===61)V="equals",G++;else if(j===33&&z.charCodeAt(G+1)===61)V="not",G+=2;else{let K=x(j);if(K!==null&&z.charCodeAt(G+1)===61)V=K,G+=2}if(V!=="exists"){G=L(z,G);let K=z.charCodeAt(G);if(K===34||K===39){let q=A(z,G+1,K);U=R(z.slice(G+1,q)),G=q+1}else{let q=Y(z,G);U=q.value,G=q.end}G=L(z,G);let F=z.charCodeAt(G);if(F===105||F===73)$=!0,G++;else if(F===115||F===83)$=!1,G++}if(z.charCodeAt(G)!==93)throw Error("Expected ]");if(G++,$===null&&!H&&T.has(D.toLowerCase()))$="quirks";return Z.push({type:"attribute",name:J?D.toLowerCase():D,action:V,value:U,namespace:null,ignoreCase:$}),G}function I(z,X,Z,Q){if(z.charCodeAt(X+1)===58){let B=X+2,D=Y(z,B);B=D.end;let V=D.value.toLowerCase(),U=null;if(z.charCodeAt(B)===40){let $=v(z,B);U=z.slice(B+1,$).trim(),B=$+1}return Z.push({type:"pseudo-element",name:V,data:U}),B}let H=X+1,J=Y(z,H);H=J.end;let G=J.value.toLowerCase();if(z.charCodeAt(H)===40){let B=v(z,H),D=z.slice(H+1,B);if(H=B+1,G==="is"||G==="not"||G==="where"||G==="has"||G==="matches"||G==="-moz-any"||G==="-webkit-any"){let V=[];_(V,D.trim(),Q,0),Z.push({type:"pseudo",name:G,data:V})}else Z.push({type:"pseudo",name:G,data:D.trim()})}else Z.push({type:"pseudo",name:G,data:null});return H}function h(z,X){if(z.length>0&&z[z.length-1].type==="descendant"&&X!=="descendant")z.pop();if(z.length>0&&z[z.length-1].type===X)return;z.push({type:X})}function A(z,X,Z){let Q=X,H=z.length;while(Q<H){let J=z.charCodeAt(Q);if(J===92){Q+=2;continue}if(J===Z)return Q;Q++}throw Error("Unterminated string")}function v(z,X){let Z=1,Q=X+1,H=z.length;while(Q<H){let J=z.charCodeAt(Q);if(J===92){Q+=2;continue}if(J===34||J===39){Q=A(z,Q+1,J)+1;continue}if(J===40)Z++;else if(J===41){if(Z--,Z===0)return Q}Q++}throw Error("Unterminated parenthesis")}var f={child:" > ",parent:" < ",sibling:" ~ ",adjacent:" + ",descendant:" ","column-combinator":" || "};function O(z){return z.map(u).join(", ")}function u(z){return z.map((X,Z)=>C(X,z[Z-1])).join("")}function C(z,X){switch(z.type){case"tag":return`${M(z.namespace)}${y(z.name)}`;case"universal":return`${M(z.namespace)}*`;case"attribute":{if(z.name==="id"&&z.action==="equals"&&!z.ignoreCase&&!z.namespace)return`#${y(z.value)}`;if(z.name==="class"&&z.action==="element"&&!z.ignoreCase&&!z.namespace)return`.${y(z.value)}`;let Z=`[${M(z.namespace)}${y(z.name)}`;if(z.action!=="exists"){let Q=p[z.action]??"=";if(Z+=Q,Z+=`"${z.value.replace(/"/g,"\\\"")}"`,z.ignoreCase===!0)Z+=" i";else if(z.ignoreCase===!1)Z+=" s"}return Z+="]",Z}case"pseudo":if(z.data===null)return`:${z.name}`;if(typeof z.data==="string")return`:${z.name}(${z.data})`;return`:${z.name}(${O(z.data)})`;case"pseudo-element":return z.data===null?`::${z.name}`:`::${z.name}(${z.data})`;case"descendant":case"child":case"parent":case"sibling":case"adjacent":case"column-combinator":return f[z.type]??" "}return""}var p={equals:"=",element:"~=",start:"^=",end:"$=",any:"*=",not:"!=",hyphen:"|="};function M(z){if(z===null)return"";if(z==="")return"|";return`${y(z)}|`}var m=/[^\w\u00B0-\uFFFF-]/g;function y(z){if(z==="")return"";return z.replace(m,(X)=>`\\${X}`)}var d=new Set(["adjacent","child","descendant","parent","sibling","column-combinator"]);function E(z){return d.has(z.type)}var N={Unknown:null,QuirksMode:"quirks",IgnoreCase:!0,CaseSensitive:!1};export{W as A,O as B,E as C,N as D,a as E};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{F as eM}from"./chunk-1kmkypmr.js";var MQ={};eM(MQ,{walk:()=>wM,parse:()=>WM,makeList:()=>$M,generate:()=>g,decodeName:()=>a,clone:()=>FM,Tokenizer:()=>T,TokenType:()=>p,List:()=>j});function f(M){return{prev:null,next:null,data:M}}class j{head=null;tail=null;cursors=[];allocateCursor(M,Q){let G={prev:M,next:Q};return this.cursors.push(G),G}releaseCursor(){this.cursors.pop()}updateCursors(M,Q,G,J){for(let X of this.cursors){if(X.prev===M)X.prev=Q;if(X.next===G)X.next=J}}static createItem(M){return f(M)}createItem(M){return f(M)}get isEmpty(){return this.head===null}get first(){return this.head?.data??null}get last(){return this.tail?.data??null}*[Symbol.iterator](){for(let M=this.head;M!=null;M=M.next)yield M.data}fromArray(M){let Q=null;this.head=null;for(let G of M){let J=f(G);if(J.prev=Q,Q)Q.next=J;else this.head=J;Q=J}return this.tail=Q,this}toArray(){let M=[];for(let Q=this.head;Q!=null;Q=Q.next)M.push(Q.data);return M}toJSON(){return this.toArray()}forEach(M,Q){let G=this.allocateCursor(null,this.head);while(G.next!==null){let J=G.next;G.prev=J,G.next=J.next,M.call(Q,J.data,J,this)}this.releaseCursor()}forEachRight(M,Q){let G=this.allocateCursor(this.tail,null);while(G.prev!==null){let J=G.prev;G.next=J,G.prev=J.prev,M.call(Q,J.data,J,this)}this.releaseCursor()}reduce(M,Q){let G=Q,J=0;for(let X=this.head;X!=null;X=X.next)G=M(G,X.data,J++,this);return G}some(M){let Q=0;for(let G=this.head;G!=null;G=G.next)if(M(G.data,Q++,this))return!0;return!1}map(M){let Q=new j,G=null,J=0;for(let X=this.head;X!=null;X=X.next){let Y=f(M(X.data,J++,this));if(Y.prev=G,G)G.next=Y;else Q.head=Y;G=Y}return Q.tail=G,Q}filter(M){let Q=new j,G=null,J=0;for(let X=this.head;X!=null;X=X.next)if(M(X.data,J++,this)){let Y=f(X.data);if(Y.prev=G,G)G.next=Y;else Q.head=Y;G=Y}return Q.tail=G,Q}clear(){let M=this.head;while(M){let Q=M.next;M.prev=null,M.next=null,M=Q}this.head=null,this.tail=null}copy(){let M=new j,Q=null;for(let G=this.head;G!=null;G=G.next){let J=f(G.data);if(J.prev=Q,Q)Q.next=J;else M.head=J;Q=J}return M.tail=Q,M}prepend(M){return this.insert(M,this.head)}prependData(M){return this.insert(f(M),this.head)}append(M){return this.insert(M,null)}appendData(M){return this.insert(f(M),null)}insert(M,Q=null){if(Q!=null)if(this.updateCursors(Q.prev,M,Q,M),Q.prev===null){if(this.head!==Q)throw Error("before doesn't belong to list");this.head=M,Q.prev=M,M.next=Q,this.updateCursors(null,M,null,null)}else Q.prev.next=M,M.prev=Q.prev,Q.prev=M,M.next=Q;else if(this.updateCursors(this.tail,M,null,M),this.tail!==null)this.tail.next=M,M.prev=this.tail,this.tail=M;else this.head=M,this.tail=M;return this}insertData(M,Q=null){return this.insert(f(M),Q)}remove(M){if(this.updateCursors(M,M.prev,M,M.next),M.prev!==null)M.prev.next=M.next;else if(this.head===M)this.head=M.next;else throw Error("item doesn't belong to list");if(M.next!==null)M.next.prev=M.prev;else if(this.tail===M)this.tail=M.prev;else throw Error("item doesn't belong to list");return M.prev=null,M.next=null,M}push(M){this.insert(f(M),null)}pop(){if(this.tail===null)return null;return this.remove(this.tail)}unshift(M){this.prependData(M)}shift(){if(this.head===null)return null;return this.remove(this.head)}prependList(M){return this.insertList(M,this.head)}appendList(M){return this.insertList(M,null)}insertList(M,Q=null){if(M.head===null)return this;if(Q!==null){if(this.updateCursors(Q.prev,M.tail,Q,M.head),Q.prev!==null)Q.prev.next=M.head,M.head.prev=Q.prev;else this.head=M.head;Q.prev=M.tail,M.tail.next=Q}else{if(this.updateCursors(this.tail,M.tail,null,M.head),this.tail!==null)this.tail.next=M.head,M.head.prev=this.tail;else this.head=M.head;this.tail=M.tail}return M.head=null,M.tail=null,this}replace(M,Q){if(Q instanceof j)this.insertList(Q,M),this.remove(M);else this.insert(Q,M),this.remove(M)}}function $M(){return new j}function FM(M){return k(M)}function k(M){if(M===null||typeof M!=="object")return M;if(M instanceof j){let G=new j;for(let J of M)G.appendData(k(J));return G}if(Array.isArray(M))return M.map(k);if("type"in M&&typeof M.type==="string"){let G={type:M.type};for(let J of Object.keys(M)){if(J==="type")continue;G[J]=k(M[J])}return G}let Q={};for(let G of Object.keys(M))Q[G]=k(M[G]);return Q}function g(M){switch(M.type){case"StyleSheet":return I(M.children,"");case"Rule":return`${g(M.prelude)}{${g(M.block)}}`;case"Block":return IM(M.children);case"Atrule":{let Q=`@${M.name}`;if(M.prelude){let G=g(M.prelude);if(G)Q+=` ${G}`}if(M.block)Q+=`{${g(M.block)}}`;else Q+=";";return Q}case"AtrulePrelude":return I(M.children,"");case"SelectorList":return I(M.children,",");case"Selector":return I(M.children,"");case"TypeSelector":return M.name;case"IdSelector":return`#${M.name}`;case"ClassSelector":return`.${M.name}`;case"NestingSelector":return"&";case"AttributeSelector":{let Q=`[${M.name.name}`;if(M.matcher&&M.value)if(Q+=M.matcher,M.value.type==="String")Q+=`"${n(M.value.value)}"`;else Q+=M.value.name;if(M.flags)Q+=` ${M.flags}`;return Q+="]",Q}case"PseudoClassSelector":return M.children?`:${M.name}(${I(M.children,"")})`:`:${M.name}`;case"PseudoElementSelector":return M.children?`::${M.name}(${I(M.children,"")})`:`::${M.name}`;case"Combinator":return M.name===" "?" ":M.name;case"Declaration":return`${M.property}:${g(M.value)}${M.important?"!important":""}`;case"DeclarationList":return I(M.children,";");case"Value":return I(M.children,"");case"Identifier":return M.name;case"Number":return M.value;case"Percentage":return`${M.value}%`;case"Dimension":return M.value+M.unit;case"String":return`"${n(M.value)}"`;case"Url":return/[\s"'()\\\u0000-\u001F\u007F]/.test(M.value)?`url("${n(M.value)}")`:`url(${M.value})`;case"Hash":return`#${M.name}`;case"Operator":return M.value;case"Function":return`${M.name}(${I(M.children,"")})`;case"Parentheses":return`(${I(M.children,"")})`;case"Brackets":return`[${I(M.children,"")}]`;case"Raw":return M.value;case"Comment":return M.value.startsWith("!")?`/*${M.value}*/`:"";case"WhiteSpace":return" ";case"CDO":return"<!--";case"CDC":return"-->";case"AnPlusB":{let Q=M.a??"",G=M.b??"";if(Q&&G){let J=Number(G);return`${Q==="1"?"":Q==="-1"?"-":Q}n${J>=0?`+${G}`:G}`}if(Q)return`${Q==="1"?"":Q==="-1"?"-":Q}n`;return G}case"Ratio":return`${M.left.value}/${M.right.value}`;case"UnicodeRange":return M.value;case"Nth":return M.selector?`${g(M.nth)} of ${g(M.selector)}`:g(M.nth);case"MediaQueryList":return I(M.children,",");case"MediaQuery":return I(M.children,"");case"MediaFeature":{let Q=`(${M.name}`;if(M.value)Q+=`:${g(M.value)}`;return Q+=")",Q}}return""}function I(M,Q){let G="",J=!0,X=null,Y=M.head;while(Y!=null){let Z=Y.data;if(Z.type==="WhiteSpace"){let $=Y.next?Y.next.data:null;if(UM(X)||UM($)){Y=Y.next;continue}}let F=g(Z);if(!F){Y=Y.next;continue}if(!J&&Q&&!CM(X))G+=Q;J=!1,G+=F,X=Z,Y=Y.next}return G}function IM(M){let Q="",G=null,J=M.head;while(J!=null){let X=J.data,Y=g(X);if(!Y){J=J.next;continue}if(G&&gM(G,X))Q+=";";Q+=Y,G=X,J=J.next}return Q}function gM(M,Q){return M.type==="Declaration"&&Q.type!=="Comment"}function UM(M){if(!M||M.type!=="Operator")return!1;let Q=M.value;return Q===":"||Q===","||Q==="/"}function CM(M){if(!M)return!1;return M.type==="Operator"||M.type==="Combinator"}function n(M){let Q="";for(let G=0;G<M.length;G++){let J=M.charCodeAt(G);if(J===92)Q+="\\\\";else if(J===34)Q+="\\\"";else if(J<32||J===127){let X=J.toString(16),Y=G+1<M.length?M.charCodeAt(G+1):-1,Z=Y===32||Y===9||Y===10||Y===12||Y===13||Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102;Q+=`\\${X}${Z?" ":""}`}else Q+=M[G]}return Q}var p;((K)=>{K[K.EOF=0]="EOF";K[K.Ident=1]="Ident";K[K.Function=2]="Function";K[K.AtKeyword=3]="AtKeyword";K[K.Hash=4]="Hash";K[K.String=5]="String";K[K.BadString=6]="BadString";K[K.Url=7]="Url";K[K.BadUrl=8]="BadUrl";K[K.Delim=9]="Delim";K[K.Number=10]="Number";K[K.Percentage=11]="Percentage";K[K.Dimension=12]="Dimension";K[K.WhiteSpace=13]="WhiteSpace";K[K.CDO=14]="CDO";K[K.CDC=15]="CDC";K[K.Colon=16]="Colon";K[K.Semicolon=17]="Semicolon";K[K.Comma=18]="Comma";K[K.LeftSquareBracket=19]="LeftSquareBracket";K[K.RightSquareBracket=20]="RightSquareBracket";K[K.LeftParenthesis=21]="LeftParenthesis";K[K.RightParenthesis=22]="RightParenthesis";K[K.LeftCurlyBracket=23]="LeftCurlyBracket";K[K.RightCurlyBracket=24]="RightCurlyBracket";K[K.Comment=25]="Comment"})(p||={});var h=(()=>{let M=new Uint8Array(128);for(let Q=0;Q<128;Q++){let G=0;if(Q===32||Q===9||Q===10||Q===12||Q===13)G|=1;if(Q>=48&&Q<=57)G|=2;if(Q>=48&&Q<=57||Q>=65&&Q<=70||Q>=97&&Q<=102)G|=4;if(Q>=65&&Q<=90||Q>=97&&Q<=122||Q===95)G|=8;if(Q===10||Q===12||Q===13)G|=16;M[Q]=G}return M})();function P(M){return M<128&&(h[M]&2)!==0}function l(M){return M<128&&(h[M]&4)!==0}function KM(M){return M>=128||M<128&&(h[M]&8)!==0}function xM(M){return M===45||M>=128||M<128&&(h[M]&10)!==0}function PM(M){return M>=0&&M<=8||M===11||M>=14&&M<=31||M===127}function t(M){return M<128&&(h[M]&16)!==0}function S(M){return M<128&&(h[M]&1)!==0}function v(M,Q){if(M!==92)return!1;if(t(Q))return!1;return!0}function o(M,Q,G){if(M===45)return KM(Q)||Q===45||v(Q,G);if(KM(M))return!0;if(M===92)return v(M,Q);return!1}function bM(M,Q,G){if(M===43||M===45){if(P(Q))return!0;if(Q===46&&P(G))return!0;return!1}if(M===46)return P(Q);return P(M)}class T{source;offset=0;types;starts;ends;count=0;_tokens=null;_lineStarts=null;constructor(M){this.source=M;let Q=Math.max(64,Math.ceil(M.length/3));this.types=new Uint8Array(Q),this.starts=new Uint32Array(Q),this.ends=new Uint32Array(Q),this.tokenize()}get lineStarts(){if(this._lineStarts==null)this._lineStarts=fM(this.source);return this._lineStarts}get tokens(){if(this._tokens!=null)return this._tokens;let M=Array.from({length:this.count});for(let Q=0;Q<this.count;Q++)M[Q]={type:this.types[Q],start:this.starts[Q],end:this.ends[Q]};return this._tokens=M,M}addToken(M,Q,G){if(this.count>=this.types.length)this.grow();this.types[this.count]=M,this.starts[this.count]=Q,this.ends[this.count]=G,this.count++}grow(){let Q=this.types.length*2,G=new Uint8Array(Q);G.set(this.types),this.types=G;let J=new Uint32Array(Q);J.set(this.starts),this.starts=J;let X=new Uint32Array(Q);X.set(this.ends),this.ends=X}tokenize(){let M=this.source,Q=0,G=M.length;while(Q<G){let J=M.charCodeAt(Q);if(J===47&&M.charCodeAt(Q+1)===42){let Z=Q;Q+=2;while(Q<G&&!(M.charCodeAt(Q)===42&&M.charCodeAt(Q+1)===47))Q++;Q=Q<G?Q+2:G,this.addToken(25,Z,Q);continue}if(S(J)){let Z=Q;while(Q<G&&S(M.charCodeAt(Q)))Q++;this.addToken(13,Z,Q);continue}if(J===34||J===39){Q=this.consumeString(J,Q);continue}if(J===35){if(Q+1<G&&(xM(M.charCodeAt(Q+1))||v(M.charCodeAt(Q+1),M.charCodeAt(Q+2)))){let Z=Q;Q++,Q=this.consumeName(Q),this.addToken(4,Z,Q);continue}this.addToken(9,Q,Q+1),Q++;continue}switch(J){case 40:this.addToken(21,Q,Q+1),Q++;continue;case 41:this.addToken(22,Q,Q+1),Q++;continue;case 91:this.addToken(19,Q,Q+1),Q++;continue;case 93:this.addToken(20,Q,Q+1),Q++;continue;case 123:this.addToken(23,Q,Q+1),Q++;continue;case 125:this.addToken(24,Q,Q+1),Q++;continue;case 44:this.addToken(18,Q,Q+1),Q++;continue;case 58:this.addToken(16,Q,Q+1),Q++;continue;case 59:this.addToken(17,Q,Q+1),Q++;continue}if(J===60&&M.startsWith("!--",Q+1)){this.addToken(14,Q,Q+4),Q+=4;continue}if(J===45&&M.startsWith("->",Q+1)){this.addToken(15,Q,Q+3),Q+=3;continue}if(J===64){let Z=M.charCodeAt(Q+1),F=M.charCodeAt(Q+2),$=M.charCodeAt(Q+3);if(o(Z,F,$)){let z=Q;Q++,Q=this.consumeName(Q),this.addToken(3,z,Q);continue}this.addToken(9,Q,Q+1),Q++;continue}let X=M.charCodeAt(Q+1),Y=M.charCodeAt(Q+2);if(bM(J,X,Y)){Q=this.consumeNumeric(Q);continue}if(o(J,X,Y)){Q=this.consumeIdentLike(Q);continue}if(J===92){if(v(J,X)){Q=this.consumeIdentLike(Q);continue}this.addToken(9,Q,Q+1),Q++;continue}this.addToken(9,Q,Q+1),Q++}this.addToken(0,G,G)}consumeString(M,Q){let G=this.source,J=G.length,X=Q+1;while(X<J){let Y=G.charCodeAt(X);if(Y===M)return X++,this.addToken(5,Q,X),X;if(t(Y))return this.addToken(6,Q,X),X;if(Y===92){let Z=G.charCodeAt(X+1);if(t(Z)){X+=2;continue}if(X+1<J){X=this.consumeEscapeSkip(X+1);continue}}X++}return this.addToken(5,Q,X),X}consumeEscapeSkip(M){let Q=this.source;if(M>=Q.length)return M;let G=Q.charCodeAt(M);if(l(G)){let J=1;M++;while(J<6&&M<Q.length&&l(Q.charCodeAt(M)))M++,J++;if(M<Q.length&&S(Q.charCodeAt(M)))M++;return M}return M+1}consumeName(M){let Q=this.source,G=Q.length,J=M;while(J<G){let X=Q.charCodeAt(J);if(X<128&&(h[X]&10)!==0){J++;continue}if(X===45){J++;continue}if(X>=128){J++;continue}if(X===92&&v(X,Q.charCodeAt(J+1))){J=this.consumeEscapeSkip(J+1);continue}break}return J}consumeNumber(M){let Q=this.source,G=M;if(Q.charCodeAt(G)===43||Q.charCodeAt(G)===45)G++;while(G<Q.length&&P(Q.charCodeAt(G)))G++;if(Q.charCodeAt(G)===46&&P(Q.charCodeAt(G+1))){G+=2;while(G<Q.length&&P(Q.charCodeAt(G)))G++}let J=Q.charCodeAt(G);if(J===69||J===101){let X=Q.charCodeAt(G+1),Y=Q.charCodeAt(G+2);if(P(X)){G+=2;while(G<Q.length&&P(Q.charCodeAt(G)))G++}else if((X===43||X===45)&&P(Y)){G+=3;while(G<Q.length&&P(Q.charCodeAt(G)))G++}}return G}consumeNumeric(M){let Q=this.source,G=this.consumeNumber(M),J=Q.charCodeAt(G),X=Q.charCodeAt(G+1),Y=Q.charCodeAt(G+2);if(o(J,X,Y)){let Z=this.consumeName(G);return this.addToken(12,M,Z),Z}if(J===37)return this.addToken(11,M,G+1),G+1;return this.addToken(10,M,G),G}consumeIdentLike(M){let Q=this.source,G=this.consumeName(M),J=Q.charCodeAt(G);if(J===40&&G-M===3){let X=Q.charCodeAt(M)|32,Y=Q.charCodeAt(M+1)|32,Z=Q.charCodeAt(M+2)|32;if(X===117&&Y===114&&Z===108){let F=G+1;while(F<Q.length&&S(Q.charCodeAt(F)))F++;let $=Q.charCodeAt(F);if($===34||$===39)return this.addToken(2,M,G+1),G+1;return this.consumeUrl(M,G)}}if(J===40)return this.addToken(2,M,G+1),G+1;return this.addToken(1,M,G),G}consumeUrl(M,Q){let G=this.source,J=G.length,X=Q+1;while(X<J&&S(G.charCodeAt(X)))X++;while(X<J){let Y=G.charCodeAt(X);if(Y===41)return X++,this.addToken(7,M,X),X;if(S(Y)){let Z=X;while(X<J&&S(G.charCodeAt(X)))X++;if(X>=J)return this.addToken(7,M,X),X;if(G.charCodeAt(X)===41)return X++,this.addToken(7,M,X),X;return this.consumeBadUrl(M,Z)}if(Y===34||Y===39||Y===40||PM(Y))return this.consumeBadUrl(M,X);if(Y===92){if(v(Y,G.charCodeAt(X+1))){X=this.consumeEscapeSkip(X+1);continue}return this.consumeBadUrl(M,X)}X++}return this.addToken(7,M,X),X}consumeBadUrl(M,Q){let G=this.source,J=Q;while(J<G.length){let X=G.charCodeAt(J);if(X===41){J++;break}if(X===92&&v(X,G.charCodeAt(J+1))){J=this.consumeEscapeSkip(J+1);continue}J++}return this.addToken(8,M,J),J}locate(M){let Q=this.lineStarts,G=0,J=Q.length-1;while(G<J){let Y=G+J+1>>1;if(Q[Y]<=M)G=Y;else J=Y-1}let X=Q[G];return{line:G+1,column:M-X+1}}}function fM(M){let Q=[0],G=M.length;for(let J=0;J<G;J++){let X=M.charCodeAt(J);if(X===10)Q.push(J+1);else if(X===13){if(M.charCodeAt(J+1)!==10)Q.push(J+1)}}return Q}function s(M,Q,G){for(let J=Q;J<G;J++)if(M.charCodeAt(J)===92)return EM(M,Q,G,J);return M.slice(Q,G)}function EM(M,Q,G,J){let X=M.slice(Q,J),Y=J;while(Y<G){if(M.charCodeAt(Y)!==92){X+=M[Y],Y++;continue}if(Y+1>=G){Y++;continue}let F=M.charCodeAt(Y+1);if(F===10){Y+=2;continue}if(F===13){Y+=M.charCodeAt(Y+2)===10?3:2;continue}if(l(F)){let $=Y+1,z="";while(z.length<6&&$<G&&l(M.charCodeAt($)))z+=M[$],$++;let V=Number.parseInt(z,16);if($<G&&S(M.charCodeAt($)))$++;X+=V===0||V>=55296&&V<=57343||V>1114111?String.fromCodePoint(65533):String.fromCodePoint(V),Y=$;continue}X+=M[Y+1],Y+=2}return X}function a(M,Q,G){for(let J=Q;J<G;J++)if(M.charCodeAt(J)===92)return SM(M,Q,G,J);return M.slice(Q,G)}function SM(M,Q,G,J){let X=M.slice(Q,J),Y=J;while(Y<G){if(M.charCodeAt(Y)!==92){X+=M[Y],Y++;continue}let F=Y+1,$="";while($.length<6&&F<G&&l(M.charCodeAt(F)))$+=M[F],F++;if($.length>0){let z=Number.parseInt($,16);if(F<G&&S(M.charCodeAt(F)))F++;X+=z===0||z>=55296&&z<=57343||z>1114111?String.fromCodePoint(65533):String.fromCodePoint(z),Y=F;continue}if(F<G){X+=M[F],Y=F+1;continue}X+=String.fromCodePoint(65533),Y=F}return X}function DM(M,Q){let G=new T(M);return{source:M,types:G.types,starts:G.starts,ends:G.ends,count:G.count,end:G.count,pos:0,positions:Q.positions??!1,filename:Q.filename,parseValue:Q.parseValue??!0,parseAtrulePrelude:Q.parseAtrulePrelude??!0,parseCustomProperty:Q.parseCustomProperty??!1,parseRulePrelude:Q.parseRulePrelude??!0,onParseError:Q.onParseError,tokenizer:G}}function q(M){return M.pos<M.end?M.types[M.pos]:0}function H(M){let Q=M.pos;if(Q>=M.end)return{type:0,start:M.starts[Q]??M.source.length,end:M.ends[Q]??M.source.length};return{type:M.types[Q],start:M.starts[Q],end:M.ends[Q]}}function _(M){let Q=M.pos++;if(Q>=M.end)return{type:0,start:M.starts[Q]??M.source.length,end:M.ends[Q]??M.source.length};return{type:M.types[Q],start:M.starts[Q],end:M.ends[Q]}}function E(M,Q){return M.source.slice(Q.start,Q.end)}function b(M){let{types:Q,end:G}=M;while(M.pos<G){let J=Q[M.pos];if(J===13||J===25)M.pos++;else break}}function zM(M){let{types:Q,end:G}=M;while(M.pos<G&&Q[M.pos]===13)M.pos++}function B(M,Q,G){if(!M.positions)return null;let J=M.tokenizer.locate(Q.start),X=M.tokenizer.locate(G.end);return{source:M.filename??"<unknown>",start:{offset:Q.start,line:J.line,column:J.column},end:{offset:G.end,line:X.line,column:X.column}}}function NM(M){if(!M.positions)return null;let Q=H(M),G=M.tokenizer.locate(Q.start);return{source:M.filename??"<unknown>",start:{offset:Q.start,line:G.line,column:G.column},end:{offset:Q.start,line:G.line,column:G.column}}}function d(M,Q,G,J){return{type:"Raw",value:M,loc:B(J,Q,G)}}function O(){return new j}function e(M,Q,G,J){if(M.onParseError){let{line:X,column:Y}=M.tokenizer.locate(G.start),Z=SyntaxError(`${M.filename??"<input>"}:${X}:${Y}: ${Q}`);Z.line=X,Z.column=Y,Z.offset=G.start,M.onParseError(Z,J)}return J}function WM(M,Q={}){let G=DM(M,Q);switch(Q.context??"stylesheet"){case"stylesheet":return _M(G);case"atrule":return r(G)??qM(G);case"atrulePrelude":return mM(G);case"mediaQuery":case"mediaQueryList":return HM(G);case"rule":return QM(G);case"selectorList":return XM(G);case"selector":return OM(G);case"block":return GM(G);case"declarationList":return kM(G);case"declaration":return JM(G)??qM(G);case"value":return lM(G);case"raw":return HM(G);default:return _M(G)}}function qM(M){return{type:"StyleSheet",children:O(),loc:NM(M)}}function HM(M){let Q=H(M),G=Q;while(q(M)!==0)G=_(M);return{type:"Raw",value:M.source.slice(Q.start,G.end),loc:B(M,Q,G)}}function _M(M){let Q=H(M),G=O(),J=M.types,X=M.end;while(M.pos<X){let F=J[M.pos];if(F===13){M.pos++;continue}if(F===25){let V={type:25,start:M.starts[M.pos],end:M.ends[M.pos]},U=MM(M,V);M.pos++,G.appendData(U);continue}if(F===0)break;if(F===14||F===15){M.pos++;continue}if(F===3){let V=r(M);if(V)G.appendData(V);continue}if(F===24){M.pos++;continue}let $=M.pos,z=QM(M);if(G.appendData(z),M.pos===$)M.pos++}let Y=M.end-1,Z=Y>=0?{type:M.types[Y],start:M.starts[Y],end:M.ends[Y]}:{type:0,start:0,end:0};return{type:"StyleSheet",children:G,loc:B(M,Q,Z)}}function MM(M,Q){return{type:"Comment",value:M.source.slice(Q.start+2,Q.end-2),loc:B(M,Q,Q)}}function r(M){let Q=H(M);if(Q.type!==3)return null;M.pos++;let G=c(M.source,Q.start+1,Q.end);b(M);let J=M.pos,X=H(M),Y=M.types,Z=M.end,F=J,$=J;while(F<Z){let U=Y[F];if(U===0||U===17||U===23)break;if(U!==13&&U!==25)$=F+1;F++}let z=null;if($>J){let U=M.starts[J],D=M.ends[$-1],N={type:Y[$-1],start:M.starts[$-1],end:D},x=M.source.slice(U,D).trim();if(x.length>0)if(M.parseAtrulePrelude)try{let u=M.end;M.end=$,M.pos=J;let C=O();while(q(M)!==0){let y=m(M);if(y)C.appendData(y)}if(jM(C),M.end=u,M.pos=F,C.isEmpty)z=d(x,X,N,M);else z={type:"AtrulePrelude",children:C,loc:null}}catch(u){let C=d(x,X,N,M);e(M,`Failed to parse @${G} prelude: ${u.message}`,X,C),z=C,M.pos=F}else z=d(x,X,N,M),M.pos=F;else M.pos=F}else M.pos=F;let V=null;if(q(M)===17)_(M);else if(q(M)===23)V=GM(M,hM.has(G));return{type:"Atrule",name:G,prelude:z,block:V,loc:B(M,Q,H(M))}}var vM=new Set(["is","not","where","has","matches","-moz-any","-webkit-any"]),hM=new Set(["media","supports","document","layer","container","scope","starting-style","-moz-document","keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes"]);function mM(M){let Q=H(M),G=O();while(q(M)!==0){if(H(M).type===13){M.pos++;continue}let X=m(M);if(X)G.appendData(X)}return{type:"AtrulePrelude",children:G,loc:B(M,Q,H(M))}}function QM(M){let Q=H(M),G;if(M.parseRulePrelude)G=XM(M);else{let X=H(M),Y=X;while(q(M)!==0&&q(M)!==23)Y=_(M);let Z=M.source.slice(X.start,Y.end).trim();G=d(Z,X,Y,M)}let J=GM(M,!0);return{type:"Rule",prelude:G,block:J,loc:B(M,Q,H(M))}}function GM(M,Q=!1){let G=H(M);if(q(M)!==23)return{type:"Block",children:O(),loc:NM(M)};M.pos++;let J=O(),X=M.types,Y=M.end;while(M.pos<Y){let Z=X[M.pos];if(Z===24||Z===0)break;if(Z===13){M.pos++;continue}if(Z===25){let $={type:25,start:M.starts[M.pos],end:M.ends[M.pos]};M.pos++,J.appendData(MM(M,$));continue}if(Z===3){let $=r(M);if($)J.appendData($);continue}if(Q&&yM(M,uM)){let $=QM(M);J.appendData($);continue}let F=JM(M);if(F)J.appendData(F);if(M.pos<Y&&X[M.pos]===17)M.pos++}if(q(M)===24)M.pos++;return{type:"Block",children:J,loc:B(M,G,H(M))}}function yM(M,Q){let G=M.pos,J=Q(M);return M.pos=G,J}function uM(M){let{types:Q,end:G}=M;while(M.pos<G){let J=Q[M.pos];if(J===23)return!0;if(J===17||J===24||J===0)return!1;M.pos++}return!1}function kM(M){let Q=H(M),G=O();while(q(M)!==0&&q(M)!==24){let J=H(M);if(J.type===13){M.pos++;continue}if(J.type===25){G.appendData(MM(M,_(M)));continue}if(J.type===17){M.pos++;continue}if(J.type===3){let Y=r(M);if(Y)G.appendData(Y);continue}let X=JM(M);if(X)G.appendData(X);if(q(M)===17)_(M)}return{type:"DeclarationList",children:G,loc:B(M,Q,H(M))}}function JM(M){b(M);let Q=H(M);if(Q.type!==1&&Q.type!==4&&!(Q.type===9&&M.source[Q.start]==="*"&&M.source[Q.start+1]===" "))if(Q.type===9&&M.source[Q.start]==="*")M.pos++;else{e(M,"Expected property name",Q,{type:"Raw",value:"",loc:null});let{types:L,end:w}=M;while(M.pos<w){let A=L[M.pos];if(A===0||A===17||A===24)break;M.pos++}return null}let G=M.starts[M.pos],J=M.ends[M.pos];M.pos++;let X=M.source.slice(G,J);if(zM(M),q(M)!==16){e(M,`Expected ':' after property "${X}"`,H(M),{type:"Raw",value:"",loc:null});let{types:L,end:w}=M;while(M.pos<w){let A=L[M.pos];if(A===0||A===17||A===24)break;M.pos++}return null}M.pos++,zM(M);let{types:Y,starts:Z,end:F,pos:$}=M,z=$,V=$,U=-1,D=-1;while(z<F){let L=Y[z];if(L===0||L===17||L===24)break;if(L===9&&M.source.charCodeAt(Z[z])===33){let w=z+1;while(w<F&&Y[w]===13)w++;if(w<F&&Y[w]===1){let A=Z[w];if(M.ends[w]-A===9&&(M.source.charCodeAt(A)|32)===105&&(M.source.charCodeAt(A+1)|32)===109&&(M.source.charCodeAt(A+2)|32)===112&&(M.source.charCodeAt(A+3)|32)===111&&(M.source.charCodeAt(A+4)|32)===114&&(M.source.charCodeAt(A+5)|32)===116&&(M.source.charCodeAt(A+6)|32)===97&&(M.source.charCodeAt(A+7)|32)===110&&(M.source.charCodeAt(A+8)|32)===116){D=z,U=w,z=w+1;continue}}}if(L!==13&&L!==25)V=z+1;z++}let N=V,x=U>=0?{type:1,start:Z[U],end:M.ends[U]}:null,u=X.startsWith("--"),C,y=Z[$],YM=N>$?M.ends[N-1]:y,i={type:Y[$],start:y,end:M.ends[$]},ZM=N>$?{type:Y[N-1],start:Z[N-1],end:YM}:i;if(u&&!M.parseCustomProperty||!M.parseValue)C={type:"Raw",value:M.source.slice(y,YM).trim(),loc:B(M,i,ZM)};else if(N===$)C={type:"Value",children:O(),loc:B(M,i,ZM)};else{let L=M.end;M.end=N,M.pos=$,C=AM(M),M.end=L}return M.pos=z,{type:"Declaration",property:X,important:x?!0:!1,value:C,loc:B(M,Q,H(M))}}function lM(M){return AM(M)}function AM(M){let Q=H(M),G=O();while(q(M)!==0&&q(M)!==17&&q(M)!==24&&q(M)!==22&&q(M)!==20){let J=m(M);if(J)G.appendData(J)}return RM(G),{type:"Value",children:G,loc:B(M,Q,H(M))}}function jM(M){for(let Q of M)if("children"in Q&&Q.children instanceof j)jM(Q.children);RM(M)}function RM(M){let Q=M.head;while(Q){if(Q.data.type==="Number"){let G=Q.next;while(G&&G.data.type==="WhiteSpace")G=G.next;if(G&&G.data.type==="Operator"&&G.data.value==="/"){let J=G.next;while(J&&J.data.type==="WhiteSpace")J=J.next;if(J&&J.data.type==="Number"){let X={type:"Ratio",left:Q.data,right:J.data,loc:null},Y=Q.next;while(Y&&Y!==J.next){let Z=Y.next;M.remove(Y),Y=Z}M.replace(Q,M.createItem(X)),Q=M.head;continue}}}Q=Q.next}}function m(M){let Q=M.pos;if(Q>=M.end)return null;let G=M.types[Q],J=M.starts[Q],X=M.ends[Q],Y=M.source;switch(G){case 13:return M.pos++,M.positions?{type:"WhiteSpace",value:" ",loc:R(M,J,X)}:{type:"WhiteSpace",value:" ",loc:null};case 25:return M.pos++,{type:"Comment",value:Y.slice(J+2,X-2),loc:M.positions?R(M,J,X):null};case 10:return M.pos++,{type:"Number",value:Y.slice(J,X),loc:M.positions?R(M,J,X):null};case 11:return M.pos++,{type:"Percentage",value:Y.slice(J,X-1),loc:M.positions?R(M,J,X):null};case 12:{M.pos++;let Z=J,F=Y.charCodeAt(Z);if(F===43||F===45)Z++;let $=!1;while(Z<X){let V=Y.charCodeAt(Z);if(V>=48&&V<=57){Z++;continue}if(V===46&&!$){$=!0,Z++;continue}break}let z=Y.charCodeAt(Z);if(z===69||z===101){let V=Z+1,U=Y.charCodeAt(V);if(U===43||U===45)V++;let D=!1;while(V<X){let N=Y.charCodeAt(V);if(N>=48&&N<=57){V++,D=!0;continue}break}if(D)Z=V}return{type:"Dimension",value:Y.slice(J,Z),unit:Y.slice(Z,X),loc:M.positions?R(M,J,X):null}}case 1:return M.pos++,{type:"Identifier",name:a(Y,J,X),loc:M.positions?R(M,J,X):null};case 5:{M.pos++;let Z=J+1,$=X-J>=2&&Y.charCodeAt(X-1)===Y.charCodeAt(J)?X-1:X;return{type:"String",value:s(Y,Z,$),loc:M.positions?R(M,J,X):null}}case 7:{M.pos++;let Z=J+4;while(Z<X&&VM(Y.charCodeAt(Z)))Z++;let F=X;if(F>Z&&Y.charCodeAt(F-1)===41)F--;while(F>Z&&VM(Y.charCodeAt(F-1)))F--;let $;if(F-Z>=2){let z=Y.charCodeAt(Z),V=Y.charCodeAt(F-1);if((z===34||z===39)&&z===V)$=Y.slice(Z+1,F-1);else $=Y.slice(Z,F)}else $=Y.slice(Z,F);return{type:"Url",value:$,loc:M.positions?R(M,J,X):null}}case 4:return M.pos++,{type:"Hash",name:Y.slice(J+1,X),loc:M.positions?R(M,J,X):null};case 2:return pM(M);case 21:return aM(M);case 18:return M.pos++,{type:"Operator",value:",",loc:M.positions?R(M,J,X):null};case 16:return M.pos++,{type:"Operator",value:":",loc:M.positions?R(M,J,X):null};case 9:{M.pos++;let Z=Y.charCodeAt(J),F=Y[J];if(TM(Z))return{type:"Operator",value:F,loc:M.positions?R(M,J,X):null};return{type:"Identifier",name:F,loc:M.positions?R(M,J,X):null}}case 19:{M.pos++;let Z=O();while(q(M)!==0&&q(M)!==20){let $=m(M);if($)Z.appendData($)}let F=M.pos<M.end?M.ends[M.pos]:X;if(q(M)===20)M.pos++;return{type:"Brackets",children:Z,loc:M.positions?R(M,J,F):null}}case 3:case 23:case 24:case 22:case 20:case 17:case 0:case 14:case 15:case 6:case 8:return M.pos++,{type:"Raw",value:Y.slice(J,X),loc:M.positions?R(M,J,X):null}}return M.pos++,null}function VM(M){return M===32||M===9||M===10||M===12||M===13}function TM(M){return M===47||M===43||M===45||M===42||M===61||M===62||M===60||M===126||M===124||M===36||M===94||M===33||M===38}function c(M,Q,G){for(let J=Q;J<G;J++){let X=M.charCodeAt(J);if(X>=65&&X<=90)return M.slice(Q,G).toLowerCase()}return M.slice(Q,G)}function R(M,Q,G){let J=M.tokenizer.locate(Q),X=M.tokenizer.locate(G);return{source:M.filename??"<unknown>",start:{offset:Q,line:J.line,column:J.column},end:{offset:G,line:X.line,column:X.column}}}function pM(M){let Q=_(M),G=c(M.source,Q.start,Q.end-1),J=O();while(q(M)!==0&&q(M)!==22){let X=m(M);if(X)J.appendData(X)}if(q(M)===22)_(M);if(G==="url"){for(let X=J.head;X!=null;X=X.next)if(X.data.type==="String")return{type:"Url",value:X.data.value,loc:B(M,Q,H(M))}}return{type:"Function",name:G,children:J,loc:B(M,Q,H(M))}}function aM(M){let Q=_(M),G=O();while(q(M)!==0&&q(M)!==22){let J=m(M);if(J)G.appendData(J)}if(q(M)===22)_(M);return{type:"Parentheses",children:G,loc:B(M,Q,H(M))}}function XM(M){let Q=H(M),G=O();while(q(M)!==0){if(b(M),q(M)===0||q(M)===23)break;let J=OM(M);if(J.children.head!==null)G.appendData(J);if(b(M),q(M)===18){_(M);continue}break}return{type:"SelectorList",children:G,loc:B(M,Q,H(M))}}function OM(M){let Q=H(M),G=O(),J=!0;while(q(M)!==0&&q(M)!==18&&q(M)!==23){let X=H(M);if(X.type===13){if(_(M),!J&&q(M)!==0&&q(M)!==18&&q(M)!==23&&!BM(M)&&!dM(M)){let Z={type:"Combinator",name:" ",loc:B(M,X,X)};G.appendData(Z),J=!0}continue}if(X.type===9&&M.source.charCodeAt(X.start)===124&&M.types[M.pos+1]===9&&M.source.charCodeAt(M.starts[M.pos+1])===124){let Z=H(M);_(M);let F=_(M),$={type:"Combinator",name:"||",loc:B(M,Z,F)};G.appendData($),J=!0,b(M);continue}if(BM(M)){let Z=_(M),$={type:"Combinator",name:M.source[Z.start],loc:B(M,Z,Z)};G.appendData($),J=!0,b(M);continue}let Y=cM(M);if(!Y)break;G.appendData(Y),J=!1}while(G.tail&&G.tail.data.type==="Combinator")G.remove(G.tail);return{type:"Selector",children:G,loc:B(M,Q,H(M))}}function BM(M){let Q=H(M);if(Q.type!==9)return!1;let G=M.source[Q.start];return G===">"||G==="+"||G==="~"}function dM(M){if(M.types[M.pos]!==9)return!1;if(M.source.charCodeAt(M.starts[M.pos])!==124)return!1;if(M.types[M.pos+1]!==9)return!1;return M.source.charCodeAt(M.starts[M.pos+1])===124}function cM(M){let Q=H(M);switch(Q.type){case 1:{if(_(M),q(M)===9&&M.source[H(M).start]==="|"&&M.source[H(M).start+1]!=="="&&!(M.types[M.pos+1]===9&&M.source.charCodeAt(M.starts[M.pos+1])===124)){if(_(M),q(M)===1){let J=_(M);return{type:"TypeSelector",name:`${E(M,Q)}|${E(M,J)}`,loc:B(M,Q,J)}}if(q(M)===9&&M.source[H(M).start]==="*"){let J=_(M);return{type:"TypeSelector",name:`${E(M,Q)}|*`,loc:B(M,Q,J)}}}return{type:"TypeSelector",name:E(M,Q),loc:B(M,Q,Q)}}case 11:return _(M),{type:"TypeSelector",name:E(M,Q),loc:B(M,Q,Q)};case 10:return _(M),{type:"TypeSelector",name:E(M,Q),loc:B(M,Q,Q)};case 9:{let G=M.source[Q.start];if(G==="*")return _(M),{type:"TypeSelector",name:"*",loc:B(M,Q,Q)};if(G==="."){if(_(M),q(M)===1){let J=_(M);return{type:"ClassSelector",name:E(M,J),loc:B(M,Q,J)}}return null}if(G==="&")return _(M),{type:"NestingSelector",loc:B(M,Q,Q)};return _(M),null}case 4:return _(M),{type:"IdSelector",name:M.source.slice(Q.start+1,Q.end),loc:B(M,Q,Q)};case 16:{_(M);let G=q(M)===16;if(G)_(M);return rM(M,G,Q)}case 19:return iM(M)}return null}function rM(M,Q,G){let J=H(M);if(J.type===1){_(M);let X=c(M.source,J.start,J.end);return Q?{type:"PseudoElementSelector",name:X,children:null,loc:B(M,G,J)}:{type:"PseudoClassSelector",name:X,children:null,loc:B(M,G,J)}}if(J.type===2){_(M);let X=c(M.source,J.start,J.end-1),Y=O();if(!Q&&vM.has(X)){let $=H(M),z=$,V=1;while(q(M)!==0&&V>0){if(q(M)===21||q(M)===2)V++;else if(q(M)===22){if(V--,V===0)break}z=_(M)}if(q(M)===22)_(M);let U=M.source.slice($.start,z.end).trim();if(U.length>0){let D=DM(U,{positions:!1}),N=XM(D);Y.appendData(N)}}else{while(q(M)!==0&&q(M)!==22){let $=m(M);if($)Y.appendData($)}if(q(M)===22)_(M)}if(Q)return{type:"PseudoElementSelector",name:X,children:Y,loc:B(M,G,H(M))};return{type:"PseudoClassSelector",name:X,children:Y,loc:B(M,G,H(M))}}return null}function iM(M){let Q=_(M);b(M);let G=H(M);if(G.type!==1)return null;_(M);let J={type:"Identifier",name:E(M,G),loc:B(M,G,G)};b(M);let X=null,Y=null,Z=null,F=H(M);if(F.type===9){let z=M.source[F.start],V=M.source[F.start+1];if(z==="=")X="=",_(M);else if((z==="~"||z==="|"||z==="^"||z==="$"||z==="*")&&V==="="){_(M);let N=H(M);if(N.type===9&&M.source[N.start]==="=")_(M),X=`${z}=`}b(M);let U=H(M);if(U.type===5){_(M);let N=U.end-U.start>=2&&M.source.charCodeAt(U.end-1)===M.source.charCodeAt(U.start);Y={type:"String",value:s(M.source,U.start+1,N?U.end-1:U.end),loc:B(M,U,U)}}else if(U.type===1)_(M),Y={type:"Identifier",name:E(M,U),loc:B(M,U,U)};b(M);let D=H(M);if(D.type===1)_(M),Z=E(M,D)}b(M);let $=H(M);if(q(M)===20)$=_(M);return{type:"AttributeSelector",name:J,matcher:X,value:Y,flags:Z,loc:B(M,Q,$)}}var LM=Symbol("walkSkip"),W=Symbol("walkStop");function nM(M){return{root:M,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null}}function oM(M,Q){let G=nM(M),J=typeof Q==="function"?Q:Q.enter,X=typeof Q==="function"?null:Q.leave??null,Y=typeof Q==="function"?null:Q.visit??null,Z=typeof Q==="function"?!1:Q.reverse??!1;function F($,z,V){let U=null,D;switch($.type){case"StyleSheet":U="stylesheet",D=G.stylesheet,G.stylesheet=$;break;case"Atrule":U="atrule",D=G.atrule,G.atrule=$;break;case"AtrulePrelude":U="atrulePrelude",D=G.atrulePrelude,G.atrulePrelude=$;break;case"Rule":U="rule",D=G.rule,G.rule=$;break;case"Selector":U="selector",D=G.selector,G.selector=$;break;case"Block":U="block",D=G.block,G.block=$;break;case"Declaration":U="declaration",D=G.declaration,G.declaration=$;break;case"Function":U="function",D=G.function,G.function=$;break}let N;if((Y===null||Y===$.type)&&J){let x=J.call(G,$,z,V);if(x===LM){if(U)G[U]=D;return}if(x===W){if(U)G[U]=D;return W}}if(N=tM($,Z,F),N===W){if(U)G[U]=D;return W}if((Y===null||Y===$.type)&&X){if(X.call(G,$,z,V)===W){if(U)G[U]=D;return W}}if(U)G[U]=D;return}return F(M,null,null)}var wM=Object.assign(oM,{skip:LM,stop:W});function tM(M,Q,G){if("children"in M&&M.children instanceof j)return sM(M.children,Q,G);if(M.type==="Rule"){if(G(M.prelude,null,null)===W)return W;if(G(M.block,null,null)===W)return W;return}if(M.type==="Atrule"){if(M.prelude){if(G(M.prelude,null,null)===W)return W}if(M.block){if(G(M.block,null,null)===W)return W}return}if(M.type==="Declaration")return G(M.value,null,null);if(M.type==="AttributeSelector"){if(G(M.name,null,null)===W)return W;if(M.value)return G(M.value,null,null);return}return}function sM(M,Q,G){let J;if(Q)M.forEachRight((X,Y,Z)=>{if(J)return;if(G(X,Y,Z)===W)J=W});else M.forEach((X,Y,Z)=>{if(J)return;if(G(X,Y,Z)===W)J=W});return J}export{j as q,$M as r,FM as s,g as t,p as u,T as v,a as w,WM as x,wM as y,MQ as z};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{A as M}from"./chunk-2wsah70r.js";import{F as l}from"./chunk-1kmkypmr.js";var n={};l(n,{selectOne:()=>s,selectAll:()=>p,parseAndCompile:()=>Y,is:()=>o,compile:()=>O,clearSelectorCache:()=>r});function E(V,K,z,Z){let $=[],j=[K],J=[0];for(;;){if(J[0]>=j[0].length){if(j.length===1)return $;j.shift(),J.shift();continue}let X=j[0][J[0]++];if(!z.isTag(X))continue;if(V(X))$.push(X);if(Z||z.getName(X)!=="template"){let Q=z.getChildren(X);if(Q.length>0)j.unshift(Q),J.unshift(0)}}}function L(V,K,z,Z){let $=[K],j=[0];for(;;){if(j[0]>=$[0].length){if($.length===1)return null;$.shift(),j.shift();continue}let J=$[0][j[0]++];if(!z.isTag(J))continue;if(V(J))return J;if(Z||z.getName(J)!=="template"){let X=z.getChildren(J);if(X.length>0)$.unshift(X),j.unshift(0)}}}function W(V,K){if(Array.isArray(V))return K.removeSubsets(V);return K.getChildren(V)}var D=(V)=>{return!0};function _(V){return V===32||V===9||V===10||V===12||V===13}function I(V,K){let z=K.length,Z=V.length;if(z===0||z>Z)return!1;let $=V.indexOf(K);while($>=0){let j=$===0||_(V.charCodeAt($-1)),J=$+z,X=J===Z||_(V.charCodeAt(J));if(j&&X)return!0;$=V.indexOf(K,$+1)}return!1}function S(V,K,z){if(K.ignoreCase===!0)return!0;if(K.ignoreCase===!1)return!1;if(K.ignoreCase==="quirks")return!z.xmlMode;return!1}function w(V,K,z){let Z=K.adapter,$=V.action,j=V.name,J=V.value,X=S(J,V,K);if(X)J=J.toLowerCase();return g($,j,J,X,Z,z)}function g(V,K,z,Z,$,j){let J=j===D;switch(V){case"exists":if(J)return(X)=>$.hasAttrib(X,K);return(X)=>$.hasAttrib(X,K)&&j(X);case"equals":if(!Z){if(J)return(X)=>$.getAttributeValue(X,K)===z;return(X)=>$.getAttributeValue(X,K)===z&&j(X)}if(J)return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return Q.toLowerCase()===z};return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return Q.toLowerCase()===z&&j(X)};case"not":return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return j(X);return(Z?Q.toLowerCase():Q)!==z&&j(X)};case"start":if(z==="")return()=>!1;if(J)return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return(Z?Q.toLowerCase():Q).startsWith(z)};return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return(Z?Q.toLowerCase():Q).startsWith(z)&&j(X)};case"end":if(z==="")return()=>!1;if(J)return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return(Z?Q.toLowerCase():Q).endsWith(z)};return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return(Z?Q.toLowerCase():Q).endsWith(z)&&j(X)};case"any":{if(z==="")return()=>!1;if(Z){if(J)return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return Q.toLowerCase().indexOf(z)>=0};return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return Q.toLowerCase().indexOf(z)>=0&&j(X)}}if(J)return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return Q.indexOf(z)>=0};return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return Q.indexOf(z)>=0&&j(X)}}case"element":{if(z===""||/\s/.test(z))return()=>!1;if(Z){if(J)return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return I(Q.toLowerCase(),z)};return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return I(Q.toLowerCase(),z)&&j(X)}}if(J)return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return I(Q,z)};return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;return I(Q,z)&&j(X)}}case"hyphen":if(J)return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;let H=Z?Q.toLowerCase():Q;if(H===z)return!0;if(H.startsWith(z)&&H.charAt(z.length)==="-")return!0;return!1};return(X)=>{let Q=$.getAttributeValue(X,K);if(Q==null)return!1;let H=Z?Q.toLowerCase():Q;if(H===z)return j(X);if(H.startsWith(z)&&H.charAt(z.length)==="-")return j(X);return!1}}return(X)=>{return!1}}var b=new Set(["link","any-link","visited","hover","active","focus","focus-visible","focus-within","target","target-within","enabled","disabled","checked","required","optional","valid","invalid","selected","placeholder-shown","read-only","read-write","in-range","out-of-range","default","indeterminate"]),f=new Set(["is","where","matches","-moz-any","-webkit-any"]),k=new Set(["nth-child","nth-last-child","nth-of-type","nth-last-of-type"]);function y(V,K,z){let Z=K.adapter,$=V.name,j=V.data;if(V.type==="pseudo"&&f.has($)){if(!Array.isArray(j))return z;let J=j.map((X)=>Y(X,K));if(J.length===1){let X=J[0];return(Q)=>X(Q)&&z(Q)}return(X)=>{for(let Q of J)if(Q(X))return z(X);return!1}}if(V.type==="pseudo"&&$==="not"){if(!Array.isArray(j))return z;let J=j.map((X)=>Y(X,K));if(J.length===1){let X=J[0];return(Q)=>!X(Q)&&z(Q)}return(X)=>{for(let Q of J)if(Q(X))return!1;return z(X)}}if(V.type==="pseudo"&&$==="has"){if(!Array.isArray(j))return z;let J=j.map((Q)=>Y(Q,K)),X=J.length===1?J[0]:(Q)=>{for(let H of J)if(H(Q))return!0;return!1};return(Q)=>{let H=Z.getChildren(Q).slice();while(H.length>0){let B=H.pop();if(!Z.isTag(B))continue;if(X(B))return z(Q);let N=Z.getChildren(B);for(let F=0;F<N.length;F++)H.push(N[F])}return!1}}if(V.type==="pseudo"&&k.has($)){let J=u(typeof j==="string"?j:"",$,K);return(X)=>J(X)&&z(X)}if(V.type==="pseudo"&&$==="first-child")return(J)=>{let X=Z.getSiblings(J);for(let Q of X){if(!Z.isTag(Q))continue;return Q===J&&z(J)}return!1};if(V.type==="pseudo"&&$==="last-child")return(J)=>{let X=Z.getSiblings(J);for(let Q=X.length-1;Q>=0;Q--){let H=X[Q];if(!Z.isTag(H))continue;return H===J&&z(J)}return!1};if(V.type==="pseudo"&&$==="first-of-type")return(J)=>{let X=Z.getName(J),Q=Z.getSiblings(J);for(let H of Q){if(!Z.isTag(H)||Z.getName(H)!==X)continue;return H===J&&z(J)}return!1};if(V.type==="pseudo"&&$==="last-of-type")return(J)=>{let X=Z.getName(J),Q=Z.getSiblings(J);for(let H=Q.length-1;H>=0;H--){let B=Q[H];if(!Z.isTag(B)||Z.getName(B)!==X)continue;return B===J&&z(J)}return!1};if(V.type==="pseudo"&&$==="only-child")return(J)=>{let X=Z.getSiblings(J),Q=0,H=!1;for(let B of X){if(!Z.isTag(B))continue;if(Q++,Q>1)return!1;if(B===J)H=!0}return Q===1&&H&&z(J)};if(V.type==="pseudo"&&$==="only-of-type")return(J)=>{let X=Z.getName(J),Q=Z.getSiblings(J),H=0,B=!1;for(let N of Q){if(!Z.isTag(N)||Z.getName(N)!==X)continue;if(H++,H>1)return!1;if(N===J)B=!0}return H===1&&B&&z(J)};if(V.type==="pseudo"&&$==="empty")return(J)=>Z.getChildren(J).length===0&&z(J);if(V.type==="pseudo"&&$==="root")return(J)=>{let X=Z.getParent(J);return(X==null||!Z.isTag(X))&&z(J)};if(V.type==="pseudo"&&$==="scope"){if(K.context&&Array.isArray(K.context)){let J=new Set(K.context);return(X)=>J.has(X)&&z(X)}if(K.context){let J=K.context;return(X)=>X===J&&z(X)}return(J)=>{let X=Z.getParent(J);return(X==null||!Z.isTag(X))&&z(J)}}if(V.type==="pseudo"&&b.has($)){if(K.pseudos&&K.pseudos[$]){let J=K.pseudos[$];if(typeof J==="function")return(X)=>J(X,void 0)&&z(X)}return(J)=>{return!1}}if(V.type==="pseudo-element")return z;if(K.pseudos&&K.pseudos[$]){let J=K.pseudos[$];if(typeof J==="function")return(X)=>J(X,typeof j==="string"?j:void 0)&&z(X);if(typeof J==="string"){let X=M(J),Q=G(X,K);return(H)=>Q(H)&&z(H)}}return(J)=>{return!1}}function v(V){let K=V.trim();if(K==="odd")return{a:2,b:1};if(K==="even")return{a:2,b:0};let z=/^([+-]?\d*)n([+-]\d+)?$/.exec(K.replace(/\s+/g,""));if(z){let $=z[1]===""||z[1]==="+"?1:z[1]==="-"?-1:Number(z[1]),j=z[2]?Number(z[2]):0;return{a:$,b:j}}let Z=Number(K);if(!Number.isNaN(Z))return{a:0,b:Z};return null}function u(V,K,z){let Z=v(V);if(!Z)return()=>!1;let{a:$,b:j}=Z,J=z.adapter,X=K==="nth-of-type"||K==="nth-last-of-type",Q=K==="nth-last-child"||K==="nth-last-of-type";return(H)=>{let B=J.getSiblings(H),N=X?J.getName(H):"",F=0,P=0;for(let U of B){if(!J.isTag(U))continue;if(X&&J.getName(U)!==N)continue;if(P++,U===H)F=P}if(F===0)return!1;let R=Q?P-F+1:F;if($===0)return R===j;return(R-j)/$>=0&&(R-j)%$===0}}function A(V,K,z){let Z=K.adapter,$=z===D;switch(V.type){case"tag":{let j=K.lowerCaseTags!==!1&&!K.xmlMode?V.name.toLowerCase():V.name;if($)return(J)=>Z.getName(J)===j;return(J)=>Z.getName(J)===j&&z(J)}case"universal":return z;case"attribute":return w(V,K,z);case"pseudo":case"pseudo-element":return y(V,K,z);case"descendant":case"child":case"parent":case"sibling":case"adjacent":case"column-combinator":return z}return(j)=>{return!1}}var x={universal:50,tag:30,attribute:1,pseudo:0,"pseudo-element":0},m={exists:10,equals:8,not:7,start:6,end:6,hyphen:5,any:4,element:3};function T(V){let K=x[V.type]??0;if(V.type==="attribute")return K+(m[V.action]??0);return K}function G(V,K){if(V.length===1)return Y(V[0],K);let z=V.map((Z)=>Y(Z,K));return(Z)=>z.some(($)=>$(Z))}function Y(V,K){let z=K.adapter,Z=[[]],$=[];for(let J of V)if(J.type==="descendant"||J.type==="child"||J.type==="sibling"||J.type==="adjacent"||J.type==="parent"||J.type==="column-combinator")$.push(J),Z.push([]);else Z[Z.length-1].push(J);let j=D;for(let J=0;J<Z.length;J++){let X=Z[J].slice().sort((Q,H)=>T(Q)-T(H));for(let Q of X)j=A(Q,K,j);if(J<$.length)j=c($[J],j,z)}return j}function c(V,K,z){switch(V.type){case"descendant":case"column-combinator":return(Z)=>{let $=z.getParent(Z);while($){if(z.isTag($)&&K($))return!0;$=z.getParent($)}return!1};case"child":return(Z)=>{let $=z.getParent(Z);return $!=null&&z.isTag($)&&K($)};case"sibling":return(Z)=>{let $=z.getSiblings(Z);for(let j of $){if(j===Z)return!1;if(z.isTag(j)&&K(j))return!0}return!1};case"adjacent":return(Z)=>{let $=z.getSiblings(Z),j=null;for(let J of $){if(J===Z)return j!=null&&z.isTag(j)&&K(j);j=J}return!1};case"parent":return(Z)=>z.existsOne(K,z.getChildren(Z))}return(Z)=>{return!1}}function h(V){if(!V||!V.adapter)throw Error("css-select: adapter is required");return V.adapter}var q=new WeakMap;function d(V){return(V.xmlMode?1:0)<<0|(V.lowerCaseAttributeNames===!1?1:0)<<1|(V.lowerCaseTags===!1?1:0)<<2}function i(V,K){let z=q.get(V);if(!z)z=[],q.set(V,z);let Z=z[K];if(!Z)Z=new Map,z[K]=Z;return Z}function C(V,K){let z=M(V,{xmlMode:K.xmlMode,lowerCaseAttributeNames:K.lowerCaseAttributeNames,lowerCaseTags:K.lowerCaseTags});return G(z,K)}function O(V,K){if(typeof V!=="string")return G(V,K);if(K.cacheResults===!1||!K.adapter)return C(V,K);let z=i(K.adapter,d(K)),Z=z.get(V);if(Z!==void 0)return Z;return Z=C(V,K),z.set(V,Z),Z}function r(V,K){if(K===void 0){q.delete(V);return}let z=q.get(V);if(!z)return;for(let Z of z)if(Z)Z.delete(K)}function p(V,K,z){let Z=h(z),$=typeof V==="function"?V:O(V,z),j=W(K,Z);return E($,j,Z,z.xmlMode===!0)}function s(V,K,z){let Z=h(z),$=typeof V==="function"?V:O(V,z),j=W(K,Z);return L($,j,Z,z.xmlMode===!0)}function o(V,K,z){return(typeof K==="function"?K:O(K,z))(V)}export{Y as a,O as b,r as c,p as d,s as e,o as f,n as g};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{t as q,x as K,y as E}from"./chunk-9ep6bwwb.js";import{A as R}from"./chunk-2wsah70r.js";import{F as i}from"./chunk-1kmkypmr.js";var n={};i(n,{syntax:()=>l,specificityToString:()=>I,specificity:()=>h,removeComments:()=>B,minifyBlock:()=>W,minify:()=>N,dedupeDeclarations:()=>L,compressTree:()=>w});function B(g,f={}){let b=f.exclamation??!1,H=!1;E(g,($,A,F)=>{if($.type!=="Comment")return;let M=$.value.startsWith("!");if(b===!0&&M)return;if(b==="first-exclamation"&&M&&!H){H=!0;return}if(A&&F)F.remove(A)})}function L(g){E(g,(f)=>{if(f.type!=="Block"&&f.type!=="DeclarationList")return;if(!("children"in f)||!f.children)return;let b=f.children,H=b.head;if(H==null||H.next==null)return;let $=0;for(let M=H;M!=null;M=M.next)if(M.data.type==="Declaration"){if($++,$>=2)break}if($<2)return;let A=new Map,F=[];for(let M=H;M!=null;M=M.next){let X=M.data;if(X.type!=="Declaration")continue;let _=X.property,y=A.get(_);if(y){let c=!!y.decl.important,S=!!X.important;if(S||c===S)F.push(y.item),A.set(_,{item:M,decl:X});else F.push(M)}else A.set(_,{item:M,decl:X})}for(let M of F)b.remove(M)})}var r={black:"#000",fuchsia:"#f0f",white:"#fff",red:"#f00",cyan:"#0ff",blue:"#00f",yellow:"#ff0",magenta:"#f0f",lime:"#0f0",silver:"#c0c0c0",gray:"#808080",maroon:"#800000",olive:"#808000",green:"#008000",purple:"#800080",teal:"#008080",navy:"#000080"},m={"#f00":"red","#ff0000":"red","#000080":"navy","#008080":"teal"};function J(g){if(!g.startsWith("#"))return g;let f=g.slice(1);if(f.length===6){if(f[0]===f[1]&&f[2]===f[3]&&f[4]===f[5])return`#${f[0]}${f[2]}${f[4]}`}if(f.length===8){if(f[0]===f[1]&&f[2]===f[3]&&f[4]===f[5]&&f[6]===f[7])return`#${f[0]}${f[2]}${f[4]}${f[6]}`}return g}function T(g){let f=g.toLowerCase();return r[f]??null}function V(g){let f=g.toLowerCase();return m[f]??null}function v(g,f,b){let H=(g<<16|f<<8|b).toString(16).padStart(6,"0");return J(`#${H}`)}var p=/^rgba?\(\s*([+-]?\d*\.?\d+%?)\s*[,\s]\s*([+-]?\d*\.?\d+%?)\s*[,\s]\s*([+-]?\d*\.?\d+%?)\s*(?:[,/]\s*([+-]?\d*\.?\d+%?)\s*)?\)$/;function Y(g){let f=p.exec(g.trim());if(!f)return g;let b=D(f[1]),H=D(f[2]),$=D(f[3]);if(f[4]!==void 0&&!d(f[4]))return g;return v(b,H,$)}function d(g){if(g.endsWith("%"))return Number.parseFloat(g)>=100;return Number.parseFloat(g)>=1}function D(g){if(g.endsWith("%"))return Math.max(0,Math.min(255,Math.round(Number.parseFloat(g)*2.55)));return Math.max(0,Math.min(255,Math.round(Number.parseFloat(g))))}var u=new Set(["px","pt","pc","in","cm","mm","q","em","rem","ex","ch","cap","ic","lh","rlh","vw","vh","vi","vb","vmin","vmax","svw","svh","svi","svb","svmin","svmax","lvw","lvh","lvi","lvb","lvmin","lvmax","dvw","dvh","dvi","dvb","dvmin","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"]);function j(g){if(g.charCodeAt(0)===43)g=g.slice(1);if(g.includes(".")){let f=g.replace(/(\.\d*?)0+($|[eE])/,"$1$2");f=f.replace(/\.($|[eE])/,"$1"),g=f}if(g.startsWith("0.")&&g.length>2)g=g.slice(1);else if(g.startsWith("-0.")&&g.length>3)g=`-${g.slice(2)}`;if(g==="-0"||g==="-.0"||g==="-0.0")g="0";return g}function z(g,f){let b=j(g);if((b==="0"||b==="-0")&&u.has(f.toLowerCase()))return{value:"0",unit:""};return{value:b,unit:f}}function C(g){return j(g)}function U(g,f){let b=Number.parseFloat(g);if(!Number.isFinite(b))return g;let H=f<0?0:f;return b.toFixed(H)}var Z=new Set(["color","background","background-color","border","border-color","border-top","border-top-color","border-right","border-right-color","border-bottom","border-bottom-color","border-left","border-left-color","border-block","border-block-color","border-block-start-color","border-block-end-color","border-inline","border-inline-color","border-inline-start-color","border-inline-end-color","outline","outline-color","caret-color","fill","stroke","flood-color","lighting-color","stop-color","column-rule","column-rule-color","text-decoration","text-decoration-color","text-emphasis","text-emphasis-color","text-shadow","box-shadow","accent-color","scrollbar-color"]);function G(g){if(!g||g.type!=="Operator")return!1;let f=g.value;return f===":"||f===","||f==="/"}function a(g){let f=g.children;if(!f)return;while(f.head&&f.head.data.type==="WhiteSpace")f.remove(f.head);while(f.tail&&f.tail.data.type==="WhiteSpace")f.remove(f.tail);let b=f.head;while(b){let H=b.next;if(b.data.type==="WhiteSpace"){let $=b.prev&&G(b.prev.data),A=H&&G(H.data);if($||A)f.remove(b)}b=H}}function w(g,f={}){let b=f.floatPrecision??null,H=b===null?null:($)=>U($,b);E(g,{enter($,A,F){switch($.type){case"Number":{let M=H?H($.value):$.value;$.value=j(M);return}case"Percentage":{let M=H?H($.value):$.value;$.value=C(M);return}case"Dimension":{let M=H?H($.value):$.value,X=z(M,$.unit);$.value=X.value,$.unit=X.unit;return}case"Hash":{let M=J(`#${$.name}`).slice(1);if($.name=M,A&&F&&this.declaration&&Z.has(this.declaration.property.toLowerCase())){let X=V(`#${M}`);if(X&&X.length<M.length+1){let _={type:"Identifier",name:X,loc:$.loc};F.replace(A,F.createItem(_))}}return}case"Identifier":{if(!A||!F||!this.declaration)return;if(!Z.has(this.declaration.property.toLowerCase()))return;let M=T($.name);if(M&&M.length<$.name.length){let X={type:"Hash",name:M.slice(1),loc:$.loc};F.replace(A,F.createItem(X))}return}case"Url":return;case"Function":{let M=$.name.toLowerCase();if((M==="rgb"||M==="rgba")&&A&&F)$.__rgbReplaceCandidate=!0}}},leave($,A,F){if($.type==="Parentheses"||$.type==="Function"||$.type==="Value")a($);if($.type==="Function"&&$.__rgbReplaceCandidate&&A&&F){let M=q($),X=Y(M);if(X!==M&&X.startsWith("#")){let _={type:"Hash",name:X.slice(1),loc:$.loc};F.replace(A,F.createItem(_))}}}})}function N(g,f={}){let b=K(g,{context:"stylesheet"});return k(b,f)}function W(g,f={}){let b=K(g,{context:"declarationList"});return k(b,f)}function k(g,f){if(f.comments===!1)B(g,{exclamation:!1});else if(f.comments==="first-exclamation")B(g,{exclamation:"first-exclamation"});else B(g,{exclamation:!0});return w(g,{floatPrecision:f.floatPrecision??null}),L(g),{css:q(g),ast:g}}function h(g){let f=[0,0,0];if(typeof g==="string"){let b=R(g);return x(b,f),f}if(Array.isArray(g)){if(g.length===0)return f;if(Array.isArray(g[0]))x(g,f);else Q(g,f);return f}return O(g,f),f}function O(g,f){switch(g.type){case"IdSelector":f[0]++;return;case"ClassSelector":case"AttributeSelector":f[1]++;return;case"TypeSelector":if(g.name!=="*")f[2]++;return;case"PseudoClassSelector":{let b=g.name.toLowerCase();if(b==="is"||b==="matches"||b==="-moz-any"||b==="-webkit-any"||b==="not"||b==="has"){if(g.children){let H=[];for(let A of g.children)if(A.type==="SelectorList"&&"children"in A&&A.children)for(let F of A.children)H.push(F);else if(A.type==="Selector")H.push(A);let $=[0,0,0];for(let A of H){let F=h(A);if(P(F,$)>0)$=F}f[0]+=$[0],f[1]+=$[1],f[2]+=$[2]}return}if(b==="where")return;f[1]++;return}case"PseudoElementSelector":f[2]++;return;case"Selector":case"SelectorList":case"AtrulePrelude":if("children"in g&&g.children)for(let b of g.children)O(b,f);return;case"NestingSelector":return}}function x(g,f){for(let b of g)Q(b,f)}function Q(g,f){for(let b of g)switch(b.type){case"tag":if(b.name!=="*")f[2]++;break;case"attribute":if(b.name==="id"&&b.action==="equals")f[0]++;else f[1]++;break;case"pseudo":{let H=b.name.toLowerCase();if(H==="is"||H==="matches"||H==="not"||H==="has"||H==="-moz-any"||H==="-webkit-any"){if(Array.isArray(b.data)){let $=[0,0,0];for(let A of b.data){let F=[0,0,0];if(Q(A,F),P(F,$)>0)$=F}f[0]+=$[0],f[1]+=$[1],f[2]+=$[2]}break}if(H==="where")break;f[1]++;break}case"pseudo-element":f[2]++;break}}function P(g,f){for(let b=0;b<3;b++)if(g[b]!==f[b])return g[b]-f[b];return 0}function I(g){return g.join(",")}var l={specificity:h};
|
|
3
|
+
export{B as h,L as i,w as j,N as k,W as l,h as m,I as n,l as o,n as p};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/ts-css",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.15",
|
|
5
5
|
"description": "Pure-TypeScript CSS toolkit and utility-first CSS engine for Bun/Node — parser, walker, generator, selector engine, minifier, and a Tailwind-compatible utility engine. Zero runtime deps.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|