@stacksjs/ts-css 0.1.3 โ 0.1.4
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/CHANGELOG.md +14 -0
- package/dist/bin/cli.js +42 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
[Compare changes](https://github.com/stacksjs/ts-css/compare/v0.1.3...v0.1.4)
|
|
2
|
+
|
|
3
|
+
## ๐ Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **build**: build the CLI the bin field points at ([61d4584](https://github.com/stacksjs/ts-css/commit/61d4584)) _(by Chris <chrisbreuer93@gmail.com>)_
|
|
6
|
+
|
|
7
|
+
## ๐งน Chores
|
|
8
|
+
|
|
9
|
+
- release v0.1.4 ([5c4ca3d](https://github.com/stacksjs/ts-css/commit/5c4ca3d)) _(by Chris <chrisbreuer93@gmail.com>)_
|
|
10
|
+
|
|
11
|
+
## Contributors
|
|
12
|
+
|
|
13
|
+
- _Chris <chrisbreuer93@gmail.com>_
|
|
14
|
+
|
|
1
15
|
[Compare changes](https://github.com/stacksjs/ts-css/compare/v0.1.2...v0.1.3)
|
|
2
16
|
|
|
3
17
|
## โก Performance Improvements
|
package/dist/bin/cli.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
import{existsSync as E6}from"fs";import j0 from"fs/promises";import p0 from"os";import V0 from"path";import u from"process";import{EventEmitter as I6}from"events";import k from"process";import c0 from"process";import L0 from"process";import J0 from"process";import s from"process";import n0 from"tty";import D4,{stdin as yz,stdout as fz}from"process";import r0,{stdin as w4,stdout as N4}from"process";import B4 from"readline";class t0{configPath;config=null;events=[];retryCount=0;maxRetries=3;retryDelayMs=1000;constructor(){let z=p0.homedir(),$=V0.join(z,".config","clapp");this.configPath=V0.join($,"telemetry.json")}async isEnabled(){if(u.env.DO_NOT_TRACK==="1"||u.env.DO_NOT_TRACK==="true")return!1;if(u.env.NO_TELEMETRY==="1"||u.env.NO_TELEMETRY==="true")return!1;return(await this.loadConfig()).enabled}async enable(){let z=await this.loadConfig();if(z.enabled=!0,!z.userId)z.userId=this.generateUserId();await this.saveConfig(z)}async disable(){let z=await this.loadConfig();z.enabled=!1,await this.saveConfig(z)}async track(z,$){if(!await this.isEnabled())return;let Q={event:z,...$,timestamp:Date.now(),platform:p0.platform(),nodeVersion:u.version};if(this.events.push(Q),this.events.length>=10)await this.send()}async trackCommand(z,$){await this.track("command",{command:z,duration:$})}async trackError(z,$){await this.track("error",{error:z,command:$})}async send(){if(!await this.isEnabled()||this.events.length===0)return!0;try{this.events=[],this.retryCount=0;let $=await this.loadConfig();return $.lastSent=Date.now(),await this.saveConfig($),!0}catch{if(this.retryCount<this.maxRetries){this.retryCount++;let $=this.retryDelayMs*2**(this.retryCount-1);return await this.sleep($),this.send()}return this.events=[],this.retryCount=0,!1}}async flush(){if(this.events.length===0)return!0;return this.send()}sleep(z){return new Promise(($)=>setTimeout($,z))}async status(){let z=await this.loadConfig();return{enabled:z.enabled,doNotTrack:u.env.DO_NOT_TRACK==="1"||u.env.DO_NOT_TRACK==="true",eventsQueued:this.events.length,lastSent:z.lastSent}}async loadConfig(){if(this.config)return this.config;try{if(E6(this.configPath)){let z=await j0.readFile(this.configPath,"utf-8");return this.config=JSON.parse(z),this.config}}catch{}return this.config={enabled:!1},this.config}async saveConfig(z){this.config=z;try{let $=V0.dirname(this.configPath);await j0.mkdir($,{recursive:!0}),await j0.writeFile(this.configPath,JSON.stringify(z,null,2),"utf-8")}catch{}}generateUserId(){let z=Math.random().toString(36).substring(2,15),$=Date.now().toString(36);return`${z}-${$}`}}var Az=new t0;function C6(z,$={}){let J={_:[]},Q=$.alias||{},Z=new Set($.boolean||[]),Y={};for(let X of Object.keys(Q))for(let U of Q[X])Y[U]=X;for(let X of Z)if(Q[X])for(let U of Q[X])Z.add(U);function q(X,U){let F=Y[X]||X;if(J[F]=U,Q[F])for(let H of Q[F])J[H]=U;if(Y[X]&&Q[Y[X]])for(let H of Q[Y[X]])J[H]=U;J[X]=U}for(let X=0;X<z.length;X++){let U=z[X];if(U==="--"){J._.push(...z.slice(X+1));break}if(U.startsWith("--")){let F=U.indexOf("=");if(F!==-1){let H=U.slice(2,F),G=U.slice(F+1);q(H,G)}else{let H=U.slice(2);if(H.startsWith("no-")){let K=H.slice(3);q(K,!1);continue}let G=Y[H]||H;if(Z.has(G)||Z.has(H))q(H,!0);else{let K=z[X+1];if(K!==void 0&&!K.startsWith("-"))q(H,K),X++;else q(H,!0)}}}else if(U.startsWith("-")&&U.length>1){let F=U.slice(1);for(let H=0;H<F.length;H++){let G=F[H],K=Y[G]||G;if(H===F.length-1&&!Z.has(K)&&!Z.has(G)){let V=z[X+1];if(V!==void 0&&!V.startsWith("-"))q(G,V),X++;else q(G,!0)}else q(G,!0)}}else J._.push(U)}return J}function W0(z){return z.replace(/[<[].+/,"").trim()}function h6(z){let $=/<([^>]+)>/g,J=/\[([^\]]+)\]/g,Q=[],Z=(X)=>{let U=!1,F=X[1];if(F.startsWith("..."))F=F.slice(3),U=!0;return{required:X[0].startsWith("<"),value:F,variadic:U}},Y;while(Y=$.exec(z))Q.push(Z(Y));let q;while(q=J.exec(z))Q.push(Z(q));return Q}function S6(z){let $={alias:{},boolean:[]};for(let[J,Q]of z.entries()){if(Q.names.length>1)$.alias[Q.names[0]]=Q.names.slice(1);if(Q.isBoolean)if(Q.negated){if(!z.some((Y,q)=>{return q!==J&&Y.names.some((X)=>Q.names.includes(X))&&typeof Y.required==="boolean"}))$.boolean.push(Q.names[0])}else $.boolean.push(Q.names[0])}return $}function l0(z){return z.reduce(($,J)=>$.length>=J.length?$:J,"")}function M0(z,$){return z.length>=$?z:`${z}${" ".repeat($-z.length)}`}function g6(z){return z.replace(/([a-z])-([a-z])/g,($,J,Q)=>{return J+Q.toUpperCase()})}function v6(z,$,J){let Q=0,Z=$.length,Y=z,q;for(;Q<Z;++Q)q=Y[$[Q]],Y=Y[$[Q]]=Q===Z-1?J:q!=null?q:!!~$[Q+1].indexOf(".")||!(+$[Q+1]>-1)?{}:[]}function _6(z,$){for(let J of Object.keys($)){let Q=$[J];if(Q.shouldTransform){if(z[J]=Array.prototype.concat.call([],z[J]),typeof Q.transformFunction==="function")z[J]=z[J].map(Q.transformFunction)}}}function y6(z){let $=/([^\\/]+)$/.exec(z);return $?$[1]:""}function s0(z){return z.split(".").map(($,J)=>{return J===0?g6($):$}).join(".")}class $0 extends Error{exitCode=2;isUsageError=!0;constructor(z){super(z);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(z).stack}format(z=!1){if(z&&this.stack)return`${this.message}
|
|
4
|
+
|
|
5
|
+
Stack trace:
|
|
6
|
+
${this.stack}`;return this.message}}function f6(){let{env:z}=c0,{TERM:$,TERM_PROGRAM:J}=z;if(c0.platform!=="win32")return $!=="linux";return Boolean(z.WT_SESSION)||Boolean(z.TERMINUS_SUBLIME)||z.ConEmuTask==="{cmd::Cmder}"||J==="Terminus-Sublime"||J==="vscode"||$==="xterm-256color"||$==="alacritty"||$==="rxvt-unicode"||$==="rxvt-unicode-256color"||z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Y0="\x1B",N=`${Y0}[`;var y={to(z,$){if(!$)return`${N}${z+1}G`;return`${N}${$+1};${z+1}H`},move(z,$){let J="";if(z<0)J+=`${N}${-z}D`;else if(z>0)J+=`${N}${z}C`;if($<0)J+=`${N}${-$}A`;else if($>0)J+=`${N}${$}B`;return J},up:(z=1)=>`${N}${z}A`,down:(z=1)=>`${N}${z}B`,forward:(z=1)=>`${N}${z}C`,backward:(z=1)=>`${N}${z}D`,nextLine:(z=1)=>`${N}E`.repeat(z),prevLine:(z=1)=>`${N}F`.repeat(z),left:`${N}G`,hide:`${N}?25l`,show:`${N}?25h`,save:`${Y0}7`,restore:`${Y0}8`};var D0={screen:`${N}2J`,up:(z=1)=>`${N}1J`.repeat(z),down:(z=1)=>`${N}J`.repeat(z),line:`${N}2K`,lineEnd:`${N}K`,lineStart:`${N}1K`,lines(z){let $="";for(let J=0;J<z;J++)$+=this.line+(J<z-1?y.up():"");if(z)$+=y.left;return $}},Ez={screen:`${Y0}c`};function T6(z,$){let J=[];for(let Q=0;Q<=$.length;Q++)J[Q]=[Q];for(let Q=0;Q<=z.length;Q++)J[0][Q]=Q;for(let Q=1;Q<=$.length;Q++)for(let Z=1;Z<=z.length;Z++)if($.charAt(Q-1)===z.charAt(Z-1))J[Q][Z]=J[Q-1][Z-1];else J[Q][Z]=Math.min(J[Q-1][Z-1]+1,J[Q][Z-1]+1,J[Q-1][Z]+1);return J[$.length][z.length]}function e0(z,$,J=2,Q=3){return $.map((Z)=>({cmd:Z,distance:T6(z,Z)})).filter(({distance:Z})=>Z<=J).sort((Z,Y)=>Z.distance-Y.distance).slice(0,Q).map(({cmd:Z})=>Z)}class z6{rawName;description;name;names;isBoolean;required;config;negated;constructor(z,$,J){if(this.rawName=z,this.description=$,this.config=Object.assign({},J),z=z.replace(/\.\*/g,""),this.negated=!1,this.names=W0(z).split(",").map((Q)=>{let Z=Q.trim().replace(/^-{1,2}/,"");if(Z.startsWith("no-"))this.negated=!0,Z=Z.replace(/^no-/,"");return s0(Z)}).sort((Q,Z)=>Q.length>Z.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(z.includes("<"))this.required=!0;else if(z.includes("["))this.required=!1;else this.isBoolean=!0}}var Cz=L0.argv,k6=`${L0.platform}-${L0.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,i0=J0.argv,m6=`${J0.platform}-${J0.arch} node-${J0.version}`;class w0{rawName;description;config;cli;options;aliasNames;name;namespace;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;beforeHooks;afterHooks;middleware;constructor(z,$,J,Q){this.rawName=z,this.description=$,this.config=J,this.cli=Q,this.options=[],this.aliasNames=[],this.name=W0(z);let Z=W0(z),Y=Z.indexOf(":");if(Y>0)this.namespace=Z.substring(0,Y),this.name=Z.substring(Y+1);if(this.args=h6(z),this.examples=[],this.beforeHooks=[],this.afterHooks=[],this.middleware=[],!J)this.config={}}usage(z){return this.usageText=z,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(z,$="-v, --version"){return this.versionNumber=z,this.option($,"Display version number"),this}example(z){return this.examples.push(z),this}option(z,$,J){let Q=new z6(z,$,J);return this.options.push(Q),this}alias(z){return this.aliasNames.push(z),this}action(z){return this.commandAction=z,this}before(z){return this.beforeHooks.push(z),this}after(z){return this.afterHooks.push(z),this}use(z){return this.middleware.push(z),this}isMatched(z){if(this.aliasNames.includes(z))return!0;if(this.namespace)return`${this.namespace}:${this.name}`===z;return this.name===z}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof N0}get displayName(){return this.namespace?`${this.namespace}:${this.name}`:this.name}hasOption(z){return z=z.split(".")[0],!!this.options.find(($)=>{return $.names.includes(z)})}outputHelp(){let{name:z,commands:$}=this.cli,{versionNumber:J,options:Q,helpCallback:Z}=this.cli.globalCommand,Y=[{body:`${z}${J?`/${J}`:""}`}];if(Y.push({title:"Usage",body:` $ ${z} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&$.length>0){let U=l0($.map((V)=>V.rawName)),F=new Map,H=[];for(let V of $)if(V.namespace){if(!F.has(V.namespace))F.set(V.namespace,[]);F.get(V.namespace).push(V)}else H.push(V);let G="";if(H.length>0)G+=H.map((V)=>{return` ${M0(V.rawName,U.length)} ${V.description}`}).join(`
|
|
7
|
+
`);let K=Array.from(F.keys()).sort();for(let V of K){let b=F.get(V);if(G.length>0)G+=`
|
|
8
|
+
|
|
9
|
+
`;G+=` ${V}:
|
|
10
|
+
`,G+=b.map((T)=>{return` ${M0(T.rawName,U.length-2)} ${T.description}`}).join(`
|
|
11
|
+
`)}Y.push({title:"Commands",body:G}),Y.push({title:"For more info, run any command with the `--help` flag",body:$.map((V)=>` $ ${z}${V.displayName===""?"":` ${V.displayName}`} --help`).join(`
|
|
12
|
+
`)})}let X=this.isGlobalCommand?Q:[...this.options,...Q||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand)X=X.filter((U)=>U.name!=="version");if(X.length>0){let U=l0(X.map((F)=>F.rawName));Y.push({title:"Options",body:X.map((F)=>{return` ${M0(F.rawName,U.length)} ${F.description} ${F.config.default===void 0?"":`(default: ${F.config.default})`}`}).join(`
|
|
13
|
+
`)})}if(this.examples.length>0)Y.push({title:"Examples",body:this.examples.map((U)=>{if(typeof U==="function")return U(z);return U}).join(`
|
|
14
|
+
`)});if(Z)Y=Z(Y)||Y;console.log(Y.map((U)=>{return U.title?`${U.title}:
|
|
15
|
+
${U.body}`:U.body}).join(`
|
|
16
|
+
|
|
17
|
+
`))}outputVersion(){let{name:z}=this.cli,{versionNumber:$}=this.cli.globalCommand;if($)console.log(`${z}/${$} ${typeof Bun<"u"?k6:m6}`)}checkRequiredArgs(){let z=this.args.filter(($)=>$.required).length;if(this.cli.args.length<z){let J=this.args.filter((Z)=>Z.required).slice(this.cli.args.length),Q=J.map((Z)=>`<${Z.value}>`).join(" ");throw new $0(`Missing required argument${J.length>1?"s":""}: ${Q}
|
|
18
|
+
|
|
19
|
+
Run \`${this.cli.name} ${this.rawName} --help\` for usage information.`)}}checkUnknownOptions(){let{options:z,globalCommand:$}=this.cli;if(!this.config.allowUnknownOptions){for(let J of Object.keys(z))if(J!=="--"&&!this.hasOption(J)&&!$.hasOption(J)){let Z=[...$.options,...this.options].flatMap((U)=>U.names),Y=J.length>1?`--${J}`:`-${J}`,q=e0(J,Z),X=`Unknown option \`${Y}\``;if(q.length>0)X+=`
|
|
20
|
+
|
|
21
|
+
Did you mean one of these?`,q.forEach((U)=>{let F=U.length>1?`--${U}`:`-${U}`;X+=`
|
|
22
|
+
\u2022 ${F}`});throw X+=`
|
|
23
|
+
|
|
24
|
+
Run \`${this.cli.name} ${this.rawName} --help\` to see available options.`,new $0(X)}}}checkOptionValue(){let{options:z,globalCommand:$}=this.cli,J=[...$.options,...this.options];for(let Q of J){let Z=z[Q.name.split(".")[0]];if(Q.required){let Y=J.some((q)=>q.negated&&q.names.includes(Q.name));if(Z===!0||Z===!1&&!Y)throw new $0(`Option \`${Q.rawName}\` requires a value.
|
|
25
|
+
|
|
26
|
+
Example: ${this.cli.name} ${this.rawName} ${Q.rawName} <value>`)}}}}class N0 extends w0{constructor(z){super("@@global@@","",{},z)}}var u6=w0,m={red:["\x1B[31m","\x1B[39m"],green:["\x1B[32m","\x1B[39m"],blue:["\x1B[34m","\x1B[39m"],yellow:["\x1B[33m","\x1B[39m"],cyan:["\x1B[36m","\x1B[39m"],magenta:["\x1B[35m","\x1B[39m"],white:["\x1B[37m","\x1B[39m"],gray:["\x1B[90m","\x1B[39m"],bgRed:["\x1B[41m","\x1B[49m"],bgGreen:["\x1B[42m","\x1B[49m"],bgBlue:["\x1B[44m","\x1B[49m"],bgYellow:["\x1B[43m","\x1B[49m"],bgCyan:["\x1B[46m","\x1B[49m"],bgMagenta:["\x1B[45m","\x1B[49m"],bold:["\x1B[1m","\x1B[22m"],italic:["\x1B[3m","\x1B[23m"],underline:["\x1B[4m","\x1B[24m"],dim:["\x1B[2m","\x1B[22m"],inverse:["\x1B[7m","\x1B[27m"],hidden:["\x1B[8m","\x1B[28m"],strikethrough:["\x1B[9m","\x1B[29m"]};var o={primary:"blue",secondary:"cyan",success:"green",warning:"yellow",error:"red",info:"magenta",muted:"gray"};function d6(){return!0}function p6(){let z={};z.supportsColor=d6();function $(Q,Z=[]){let Y=Q===""?[]:[...Z,Q],q=function(U){if(!z.supportsColor)return U;let F="",H="";for(let G of Y)if(G in o&&o[G]in m){let K=o[G];F+=m[K][0],H=m[K][1]+H}else if(G in m)F+=m[G][0],H=m[G][1]+H;return F+U+H},X=[...Object.keys(m),...Object.keys(o)];for(let U of X)if(!(U in q))Object.defineProperty(q,U,{get(){return $(U,Y)}});return q}let J=[...Object.keys(m),...Object.keys(o)];for(let Q of J)if(!(Q in z))Object.defineProperty(z,Q,{get(){return $(Q)}});return z}var t=p6();class B0 extends I6{name;commands;globalCommand;matchedCommand;matchedCommandName;rawArgs;args;options;showHelpOnExit;showVersionOnExit;enableDidYouMean=!0;signalHandlersSet=!1;isVerbose=!1;isQuiet=!1;isDebug=!1;isNoInteraction=!1;environment;isDryRun=!1;isForce=!1;useEmoji=!0;theme;isNoCache=!1;constructor(z=""){super();this.name=z,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new N0(this),this.globalCommand.usage("<command> [options]")}handleSignals(z){if(this.signalHandlersSet)return this;let $=async(J)=>{if(console.log(`
|
|
27
|
+
|
|
28
|
+
Received ${J}, cleaning up...`),z)try{await z()}catch(Q){console.error("Error during cleanup:",Q)}k.exit(0)};return k.on("SIGINT",()=>$("SIGINT")),k.on("SIGTERM",()=>$("SIGTERM")),this.signalHandlersSet=!0,this}didYouMean(z=!0){return this.enableDidYouMean=z,this}verbose(){return this.globalCommand.option("-v, --verbose","Enable verbose output"),this}quiet(){return this.globalCommand.option("-q, --quiet","Suppress non-essential output"),this}debug(){return this.globalCommand.option("--debug","Enable debug mode with detailed error information"),this}noInteraction(){return this.globalCommand.option("-n, --no-interaction","Do not ask any interactive questions (for CI/CD)"),this}env(){return this.globalCommand.option("--env <environment>","Target environment (e.g., production, staging, local)"),this}dryRun(){return this.globalCommand.option("--dry-run","Preview actions without executing them"),this}force(){return this.globalCommand.option("-f, --force","Skip confirmation prompts"),this}emoji(){return this.globalCommand.option("--no-emoji","Disable emoji in output"),this}themes(){return this.globalCommand.option("--theme <theme>","Color theme (default, dracula, nord, solarized, monokai)"),this}cache(){return this.globalCommand.option("--no-cache","Disable caching"),this}usage(z){return this.globalCommand.usage(z),this}command(z,$,J){if(!J)J={};let Q=new u6(z,$||"",J,this);return Q.globalCommand=this.globalCommand,this.commands.push(Q),Q}option(z,$,J){return this.globalCommand.option(z,$,J),this}help(z){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=z,this.showHelpOnExit=!0,this}version(z,$="-v, --version"){return this.globalCommand.version(z,$),this.showVersionOnExit=!0,this}example(z){return this.globalCommand.example(z),this}outputHelp(){if(this.matchedCommand)this.matchedCommand.outputHelp();else this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:z,options:$},J,Q){if(this.args=z,this.options=$,J)this.matchedCommand=J;if(Q)this.matchedCommandName=Q;return this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}showCommandNotFound(z){if(console.log(t.red(`
|
|
29
|
+
\u2717 Command "${z}" not found.
|
|
30
|
+
`)),this.enableDidYouMean){let $=[];for(let Q of this.commands){if(Q.displayName)$.push(Q.displayName);if(Q.aliasNames)$.push(...Q.aliasNames)}let J=e0(z,$);if(J.length>0)console.log(t.yellow("Did you mean one of these?")),J.forEach((Q)=>console.log(` ${t.dim("\u2022")} ${this.name} ${Q}`)),console.log("")}console.log(t.dim("Run"),`${this.name} --help`,t.dim("to see all available commands")),k.exit(1)}async parse(z=i0,$={}){let{run:J=!0,exitOnError:Q=!1}=$;if(Q)try{return await this.parse(z,{run:J})}catch(U){throw this.handleUsageError(U),U}if(this.rawArgs=z,!this.name)this.name=z[1]?y6(z[1]):"cli";let Z=!0,Y=z.slice(2),q=Y[0];if(q&&!q.startsWith("-")){for(let U of this.commands)if(U.isMatched(q)){let F=this.mri(Y,U);Z=!1;let H={...F,args:F.args.slice(1)};this.setParsedInfo(H,U,q),this.emit(`command:${q}`,U);break}}if(Z){for(let U of this.commands)if(U.name===""){Z=!1;let F=this.mri(Y,U);this.setParsedInfo(F,U),this.emit("command:!",U);break}}if(Z){let U=this.mri(z.slice(2));this.setParsedInfo(U)}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.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!==void 0)this.useEmoji=!this.options.noEmoji;if(this.options.theme)this.theme=String(this.options.theme);if(this.options.noCache!==void 0)this.isNoCache=Boolean(this.options.noCache);if(this.options.help&&this.showHelpOnExit)this.outputHelp(),J=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),J=!1,this.unsetMatchedCommand();let X={args:this.args,options:this.options};if(J)await this.runMatchedCommand();if(!this.matchedCommand&&this.args[0]){if(this.emit("command:*"),!(this.listenerCount("command:*")>0))this.showCommandNotFound(this.args[0])}return X}mri(z,$){let J=[...this.globalCommand.options,...$?$.options:[]],Q=S6(J),Z=[],Y=z.indexOf("--");if(Y>-1)Z=z.slice(Y+1),z=z.slice(0,Y);let q=C6(z,Q),X={_:q._};for(let K of Object.keys(q))if(K!=="_")X[s0(K)]=q[K];let U=X._,F={"--":Z},H=$&&$.config.ignoreOptionDefaultValue?$.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,G=Object.create(null);for(let K of J){if(!H&&K.config.default!==void 0)for(let V of K.names)F[V]=K.config.default;if(Array.isArray(K.config.type)){if(G[K.name]===void 0)G[K.name]={shouldTransform:!0,transformFunction:K.config.type[0]}}}for(let K of Object.keys(X))if(K!=="_"){let V=K.split(".");v6(F,V,X[K]),_6(F,G)}return{args:U,options:F}}async run(z=i0){return this.parse(z,{run:!0,exitOnError:!0})}handleUsageError(z){if(!(!!z&&typeof z==="object"&&z.name==="ClappError"&&z.isUsageError!==!1))return;let Q=z,Z=Q.message??"command-line error",Y=this.name?`${this.name}: `:"",q=/--help/.test(Z)?"":`
|
|
31
|
+
Run \`${this.name??"cli"} --help\` for usage.`;k.stderr.write(`${Y}${Z}${q}
|
|
32
|
+
`),k.exit(Q.exitCode??2)}async runMatchedCommand(){let{args:z,options:$,matchedCommand:J}=this;if(!J||!J.commandAction)return;J.checkUnknownOptions(),J.checkOptionValue(),J.checkRequiredArgs();let Q=[];J.args.forEach((X,U)=>{if(X.variadic)Q.push(z.slice(U));else Q.push(z[U])}),Q.push($);let Z={command:J,args:Q,options:$};for(let X of J.beforeHooks)await X(Z);let Y,q=async()=>{let X=J.commandAction.apply(this,Q);if(X instanceof Promise)Y=await X;else Y=X;return Y};if(J.middleware.length>0){let X=0,U=async()=>{if(X<J.middleware.length){let F=J.middleware[X++];await F({...Z,next:U})}else await q()};await U()}else await q();for(let X of J.afterHooks)await X(Z);return Y}removeSignalHandlers(){if(!this.signalHandlersSet)return this;return k.removeAllListeners("SIGINT"),k.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 $6{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(z){if(!this.enabled){this.misses++;return}let $=this.cache.get(z);if(!$){this.misses++;return}if(Date.now()-$.timestamp>$.ttl){this.cache.delete(z),this.misses++;return}return this.hits++,$.value}set(z,$,J=5000){if(!this.enabled)return;this.cache.set(z,{value:$,timestamp:Date.now(),ttl:J})}has(z){if(!this.enabled)return!1;let $=this.cache.get(z);if(!$)return!1;if(Date.now()-$.timestamp>$.ttl)return this.cache.delete(z),!1;return!0}delete(z){this.cache.delete(z)}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 z=Date.now();for(let[$,J]of this.cache.entries())if(z-J.timestamp>J.ttl)this.cache.delete($)}destroy(){this.stopCleanup(),this.clear(),this.resetStats()}}var Sz=new $6;function c6(){if("FORCE_COLOR"in s.env)return s.env.FORCE_COLOR!=="0";if("NO_COLOR"in s.env||s.env.TERM==="dumb")return!1;if(s.platform==="win32")return!0;return n0.isatty(1)&&n0.isatty(2)}var J6=c6();function w(z,$){if(!J6)return(J)=>J;return(J)=>z+J+$}var l6=w("\x1B[0m","\x1B[0m"),i6=w("\x1B[31m","\x1B[39m"),n6=w("\x1B[32m","\x1B[39m"),a6=w("\x1B[33m","\x1B[39m"),r6=w("\x1B[34m","\x1B[39m"),o6=w("\x1B[35m","\x1B[39m"),t6=w("\x1B[36m","\x1B[39m"),s6=w("\x1B[37m","\x1B[39m"),e6=w("\x1B[90m","\x1B[39m"),z4=w("\x1B[1m","\x1B[22m"),$4=w("\x1B[3m","\x1B[23m"),J4=w("\x1B[4m","\x1B[24m"),Q4=w("\x1B[2m","\x1B[22m"),Z4=w("\x1B[7m","\x1B[27m"),Y4=w("\x1B[8m","\x1B[28m"),X4=w("\x1B[9m","\x1B[29m"),U4=w("\x1B[41m","\x1B[49m"),q4=w("\x1B[42m","\x1B[49m"),F4=w("\x1B[43m","\x1B[49m"),G4=w("\x1B[44m","\x1B[49m"),H4=w("\x1B[45m","\x1B[49m"),K4=w("\x1B[46m","\x1B[49m"),j4=w("\x1B[47m","\x1B[49m"),V4=J6,M4={reset:l6,red:i6,green:n6,yellow:a6,blue:r6,magenta:o6,cyan:t6,white:s6,gray:e6,bold:z4,italic:$4,underline:J4,dim:Q4,inverse:Z4,hidden:Y4,strikethrough:X4,bgRed:U4,bgGreen:q4,bgYellow:F4,bgBlue:G4,bgMagenta:H4,bgCyan:K4,bgWhite:j4,isColorSupported:V4},Q0=M4,W4=["up","down","left","right","space","enter","cancel"],Z0={actions:new Set(W4),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};function Q6(z,$){if(typeof z==="string")return Z0.aliases.get(z)===$;for(let J of z){if(J===void 0)continue;if(Q6(J,$))return!0}return!1}function L4(z,$){if(z===$)return[];let J=z.split(`
|
|
33
|
+
`),Q=$.split(`
|
|
34
|
+
`),Z=[];for(let Y=0;Y<Math.max(J.length,Q.length);Y++)if(J[Y]!==Q[Y])Z.push(Y);return Z}var Tz=D4.platform.startsWith("win"),a0=Symbol("clapp:cancel");function z0(z,$){let J=z;if(J.isTTY)J.setRawMode($)}function O4(z){return z.replace(/\x1b\[[0-9;]*m/g,"")}function P4(z){return O4(z).length}function o0(z,$,J){if(!$||$<1)return z;let Q=J?.hard??!1,Z=J?.trim??!0,Y=z.split(`
|
|
35
|
+
`),q=[];for(let X of Y){if(P4(X)<=$){q.push(Z?X.trimEnd():X);continue}if(Q){let U="",F=0,H=0;while(H<X.length){let G=X.slice(H).match(/^\x1b\[[0-9;]*m/);if(G){U+=G[0],H+=G[0].length;continue}if(F>=$)q.push(Z?U.trimEnd():U),U="",F=0;U+=X[H],F++,H++}if(U)q.push(Z?U.trimEnd():U)}else q.push(Z?X.trimEnd():X)}return q.join(`
|
|
36
|
+
`)}class O0{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;_manualLine="";state="initial";error="";value;userInput="";constructor(z,$=!0){let{input:J=w4,output:Q=N4,render:Z,signal:Y,...q}=z;this.opts=q,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=Z.bind(this),this._track=$,this._abortSignal=Y,this.input=J,this.output=Q}unsubscribe(){this._subscribers.clear()}setSubscriber(z,$){let J=this._subscribers.get(z)??[];J.push($),this._subscribers.set(z,J)}on(z,$){return this.setSubscriber(z,{cb:$}),this}once(z,$){return this.setSubscriber(z,{cb:$,once:!0}),this}emit(z,...$){let J=this._subscribers.get(z)??[],Q=[];for(let Z of J)if(Z.cb(...$),Z.once)Q.push(()=>J.splice(J.indexOf(Z),1));for(let Z of Q)Z();return this}prompt(){return new Promise((z)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),z(a0);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}if(this.rl=B4.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0)this._setUserInput(this.opts.initialUserInput,!0);this.input.on("keypress",this.onKeypress),z0(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(y.show),this.output.off("resize",this.render),z0(this.input,!1),z(this.value)}),this.once("cancel",()=>{this.output.write(y.show),this.output.off("resize",this.render),z0(this.input,!1),z(a0)})})}_isActionKey(z,$){return z==="\t"}_setValue(z){this.value=z,this.emit("value",this.value)}_setUserInput(z,$){if(this.userInput=z??"",this.emit("userInput",this.userInput),$&&this._track&&this.rl)this.rl.write(this.userInput),this._cursor=this.rl.cursor}onKeypress(z,$){if(this._track&&$.name!=="return"){if($.name&&this._isActionKey(z,$))this.rl?.write(null,{ctrl:!0,name:"h"});this._cursor=this.rl?.cursor??0;let J=$.name==="tab"||$.name==="escape"||$.name==="backspace"||$.name==="delete"||$.name==="enter"||$.name==="return"||$.name&&["up","down","left","right"].includes($.name);if(z&&!J&&z.length===1&&z>=" ")this._manualLine+=z;else if($.name==="backspace"&&this._manualLine.length>0)this._manualLine=this._manualLine.slice(0,-1);let Q=this._manualLine.length>=(this.rl?.line?.length||0)?this._manualLine:this.rl?.line;this._setUserInput(Q)}if(this.state==="error")this.state="active",this.error="";if($?.name){if(!this._track&&Z0.aliases.has($.name))this.emit("cursor",Z0.aliases.get($.name));if(Z0.actions.has($.name))this.emit("cursor",$.name)}if(z&&(z.toLowerCase()==="y"||z.toLowerCase()==="n"))this.emit("confirm",z.toLowerCase()==="y");if(this.emit("key",z?.toLowerCase(),$),$?.name==="return"){if(this.opts.validate){let J=this.opts.validate(this.value);if(J)this.error=J instanceof Error?J.message:J,this.state="error"}if(this.state!=="error")this.state="submit"}if(Q6([z,$?.name,$?.sequence],"cancel"))this.state="cancel";if(this.state==="submit"||this.state==="cancel")this.emit("finalize");if(this.render(),this.state==="submit"||this.state==="cancel")this.close()}close(){if(this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
37
|
+
`),z0(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.state==="cancel")setTimeout(()=>{this.unsubscribe()},10);else this.unsubscribe()}restoreCursor(){let z=o0(this._prevFrame,r0.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
38
|
+
`).length-1;this.output.write(y.move(-999,z*-1))}render(){let z=o0(this._render(this)??"",r0.stdout.columns,{hard:!0,trim:!1});if(z===this._prevFrame)return;if(this.state==="initial")this.output.write(y.hide);else{let $=L4(this._prevFrame,z);if(this.restoreCursor(),$&&$?.length===1){let J=$[0];this.output.write(y.move(0,J)),this.output.write(D0.lines(1));let Q=z.split(`
|
|
39
|
+
`);this.output.write(Q[J]),this._prevFrame=z,this.output.write(y.move(0,Q.length-J-1));return}if($&&$?.length>1){let J=$[0];this.output.write(y.move(0,J)),this.output.write(D0.down());let Z=z.split(`
|
|
40
|
+
`).slice(J);this.output.write(Z.join(`
|
|
41
|
+
`)),this._prevFrame=z;return}this.output.write(D0.down())}if(this.output.write(z),this.state==="initial")this.state="active";this._prevFrame=z}}function A4(z,$){if(z===void 0)return 0;if($.length===0)return 0;let Q=$.findIndex((Z)=>Z.value===z);return Q!==-1?Q:0}function x4(z,$){return($.label??String($.value)).toLowerCase().includes(z.toLowerCase())}function b4(z,$){if(!$)return;if(z)return $;return $[0]}class R4 extends O0{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#z=0;#J="";#Q;#$;get cursor(){return this.#z}get userInputWithCursor(){if(!this.userInput)return Q0.inverse(Q0.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;let z=this.userInput.slice(0,this._cursor),[$,...J]=this.userInput.slice(this._cursor);return`${z}${Q0.inverse($)}${J.join("")}`}get options(){if(typeof this.#$==="function")return this.#$();return this.#$}constructor(z){super(z);this.#$=z.options;let $=this.options;this.filteredOptions=[...$],this.multiple=z.multiple===!0,this.#Q=z.filter??x4;let J;if(z.initialValue&&Array.isArray(z.initialValue))if(this.multiple)J=z.initialValue;else J=z.initialValue.slice(0,1);else if(!this.multiple&&this.options.length>0)J=[this.options[0].value];if(J)for(let Q of J){let Z=$.findIndex((Y)=>Y.value===Q);if(Z!==-1)this.toggleSelected(Q),this.#z=Z}this.focusedValue=this.options[this.#z]?.value,this.on("key",(Q,Z)=>this.#Z(Q,Z)),this.on("userInput",(Q)=>this.#Y(Q))}_isActionKey(z,$){return z==="\t"||this.multiple&&this.isNavigating&&$.name==="space"&&z!==void 0&&z!==""}#Z(z,$){let J=$.name==="up",Q=$.name==="down",Z=$.name==="return";if(J||Q){if(this.#z=Math.max(0,Math.min(this.#z+(J?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#z]?.value,!this.multiple)this.selectedValues=[this.focusedValue];this.isNavigating=!0}else if(Z)this.value=b4(this.multiple,this.selectedValues);else if(this.multiple)if(this.focusedValue!==void 0&&($.name==="tab"||this.isNavigating&&$.name==="space"))this.toggleSelected(this.focusedValue);else this.isNavigating=!1;else{if(this.focusedValue)this.selectedValues=[this.focusedValue];this.isNavigating=!1}}deselectAll(){this.selectedValues=[]}toggleSelected(z){if(this.filteredOptions.length===0)return;if(this.multiple)if(this.selectedValues.includes(z))this.selectedValues=this.selectedValues.filter(($)=>$!==z);else this.selectedValues=[...this.selectedValues,z];else this.selectedValues=[z]}#Y(z){if(z!==this.#J){this.#J=z;let $=this.options;if(z)this.filteredOptions=$.filter((J)=>this.#Q(z,J));else this.filteredOptions=[...$];if(this.#z=A4(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#z]?.value,!this.multiple)if(this.focusedValue!==void 0)this.toggleSelected(this.focusedValue);else this.deselectAll()}}}class E4 extends O0{options;cursor=0;#z;getGroupItems(z){return this.options.filter(($)=>$.group===z)}isGroupSelected(z){let $=this.getGroupItems(z),J=this.value;if(J===void 0)return!1;return $.every((Q)=>J.includes(Q.value))}toggleValue(){let z=this.options[this.cursor];if(this.value===void 0)this.value=[];if(z.group===!0){let $=String(z.value),J=this.getGroupItems($);if(this.isGroupSelected($))this.value=this.value.filter((Q)=>J.findIndex((Z)=>Z.value===Q)===-1);else this.value=[...this.value,...J.map((Q)=>Q.value)];this.value=Array.from(new Set(this.value))}else{let $=this.value.includes(z.value);this.value=$?this.value.filter((J)=>J!==z.value):[...this.value,z.value]}}constructor(z){super(z,!1);let{options:$}=z;this.#z=z.selectableGroups!==!1,this.options=Object.entries($).flatMap(([J,Q])=>[{value:J,group:!0,label:J},...Q.map((Z)=>({...Z,group:J}))]),this.value=[...z.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:J})=>J===z.cursorAt),this.#z?0:1),this.on("cursor",(J)=>{switch(J){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let Q=this.options[this.cursor]?.group===!0;if(!this.#z&&Q)this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let Q=this.options[this.cursor]?.group===!0;if(!this.#z&&Q)this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}case"space":this.toggleValue();break}})}}var I4=f6();var L=(z,$)=>I4?z:$,uz=L("\u25C6","*"),dz=L("\u25A0","x"),pz=L("\u25B2","x"),cz=L("\u25C7","o"),lz=L("\u250C","T"),C4=L("\u2502","|"),iz=L("\u2514","\u2014"),nz=L("\u25CF",">"),az=L("\u25CB"," "),rz=L("\u25FB","[\u2022]"),oz=L("\u25FC","[+]"),tz=L("\u25FB","[ ]"),sz=L("\u25AA","\u2022"),ez=L("\u2500","-"),z$=L("\u256E","+"),$$=L("\u251C","+"),J$=L("\u256F","+"),Q$=L("\u25CF","\u2022"),Z$=L("\u25C6","*"),Y$=L("\u25B2","!"),X$=L("\u25A0","x");var U$={light:L("\u2500","-"),heavy:L("\u2501","="),block:L("\u2588","#")};function h4(){return`${Q0.gray(C4)} `}var q$=h4();import{existsSync as Dz,readFileSync as Wz}from"fs";function v(z){return{prev:null,next:null,data:z}}class h{head=null;tail=null;cursors=[];allocateCursor(z,$){let J={prev:z,next:$};return this.cursors.push(J),J}releaseCursor(){this.cursors.pop()}updateCursors(z,$,J,Q){for(let Z of this.cursors){if(Z.prev===z)Z.prev=$;if(Z.next===J)Z.next=Q}}static createItem(z){return v(z)}createItem(z){return v(z)}get isEmpty(){return this.head===null}get first(){return this.head?.data??null}get last(){return this.tail?.data??null}*[Symbol.iterator](){for(let z=this.head;z!=null;z=z.next)yield z.data}fromArray(z){let $=null;this.head=null;for(let J of z){let Q=v(J);if(Q.prev=$,$)$.next=Q;else this.head=Q;$=Q}return this.tail=$,this}toArray(){let z=[];for(let $=this.head;$!=null;$=$.next)z.push($.data);return z}toJSON(){return this.toArray()}forEach(z,$){let J=this.allocateCursor(null,this.head);while(J.next!==null){let Q=J.next;J.prev=Q,J.next=Q.next,z.call($,Q.data,Q,this)}this.releaseCursor()}forEachRight(z,$){let J=this.allocateCursor(this.tail,null);while(J.prev!==null){let Q=J.prev;J.next=Q,J.prev=Q.prev,z.call($,Q.data,Q,this)}this.releaseCursor()}reduce(z,$){let J=$,Q=0;for(let Z=this.head;Z!=null;Z=Z.next)J=z(J,Z.data,Q++,this);return J}some(z){let $=0;for(let J=this.head;J!=null;J=J.next)if(z(J.data,$++,this))return!0;return!1}map(z){let $=new h,J=null,Q=0;for(let Z=this.head;Z!=null;Z=Z.next){let Y=v(z(Z.data,Q++,this));if(Y.prev=J,J)J.next=Y;else $.head=Y;J=Y}return $.tail=J,$}filter(z){let $=new h,J=null,Q=0;for(let Z=this.head;Z!=null;Z=Z.next)if(z(Z.data,Q++,this)){let Y=v(Z.data);if(Y.prev=J,J)J.next=Y;else $.head=Y;J=Y}return $.tail=J,$}clear(){let z=this.head;while(z){let $=z.next;z.prev=null,z.next=null,z=$}this.head=null,this.tail=null}copy(){let z=new h,$=null;for(let J=this.head;J!=null;J=J.next){let Q=v(J.data);if(Q.prev=$,$)$.next=Q;else z.head=Q;$=Q}return z.tail=$,z}prepend(z){return this.insert(z,this.head)}prependData(z){return this.insert(v(z),this.head)}append(z){return this.insert(z,null)}appendData(z){return this.insert(v(z),null)}insert(z,$=null){if($!=null)if(this.updateCursors($.prev,z,$,z),$.prev===null){if(this.head!==$)throw Error("before doesn't belong to list");this.head=z,$.prev=z,z.next=$,this.updateCursors(null,z,null,null)}else $.prev.next=z,z.prev=$.prev,$.prev=z,z.next=$;else if(this.updateCursors(this.tail,z,null,z),this.tail!==null)this.tail.next=z,z.prev=this.tail,this.tail=z;else this.head=z,this.tail=z;return this}insertData(z,$=null){return this.insert(v(z),$)}remove(z){if(this.updateCursors(z,z.prev,z,z.next),z.prev!==null)z.prev.next=z.next;else if(this.head===z)this.head=z.next;else throw Error("item doesn't belong to list");if(z.next!==null)z.next.prev=z.prev;else if(this.tail===z)this.tail=z.prev;else throw Error("item doesn't belong to list");return z.prev=null,z.next=null,z}push(z){this.insert(v(z),null)}pop(){if(this.tail===null)return null;return this.remove(this.tail)}unshift(z){this.prependData(z)}shift(){if(this.head===null)return null;return this.remove(this.head)}prependList(z){return this.insertList(z,this.head)}appendList(z){return this.insertList(z,null)}insertList(z,$=null){if(z.head===null)return this;if($!==null){if(this.updateCursors($.prev,z.tail,$,z.head),$.prev!==null)$.prev.next=z.head,z.head.prev=$.prev;else this.head=z.head;$.prev=z.tail,z.tail.next=$}else{if(this.updateCursors(this.tail,z.tail,null,z.head),this.tail!==null)this.tail.next=z.head,z.head.prev=this.tail;else this.head=z.head;this.tail=z.tail}return z.head=null,z.tail=null,this}replace(z,$){if($ instanceof h)this.insertList($,z),this.remove(z);else this.insert($,z),this.remove(z)}}function P(z){switch(z.type){case"StyleSheet":return I(z.children,"");case"Rule":return`${P(z.prelude)}{${P(z.block)}}`;case"Block":return S4(z.children);case"Atrule":{let $=`@${z.name}`;if(z.prelude){let J=P(z.prelude);if(J)$+=` ${J}`}if(z.block)$+=`{${P(z.block)}}`;else $+=";";return $}case"AtrulePrelude":return I(z.children,"");case"SelectorList":return I(z.children,",");case"Selector":return I(z.children,"");case"TypeSelector":return z.name;case"IdSelector":return`#${z.name}`;case"ClassSelector":return`.${z.name}`;case"NestingSelector":return"&";case"AttributeSelector":{let $=`[${z.name.name}`;if(z.matcher&&z.value)if($+=z.matcher,z.value.type==="String")$+=`"${P0(z.value.value)}"`;else $+=z.value.name;if(z.flags)$+=` ${z.flags}`;return $+="]",$}case"PseudoClassSelector":return z.children?`:${z.name}(${I(z.children,"")})`:`:${z.name}`;case"PseudoElementSelector":return z.children?`::${z.name}(${I(z.children,"")})`:`::${z.name}`;case"Combinator":return z.name===" "?" ":z.name;case"Declaration":return`${z.property}:${P(z.value)}${z.important?"!important":""}`;case"DeclarationList":return I(z.children,";");case"Value":return I(z.children,"");case"Identifier":return z.name;case"Number":return z.value;case"Percentage":return`${z.value}%`;case"Dimension":return z.value+z.unit;case"String":return`"${P0(z.value)}"`;case"Url":return/[\s"'()\\\u0000-\u001F\u007F]/.test(z.value)?`url("${P0(z.value)}")`:`url(${z.value})`;case"Hash":return`#${z.name}`;case"Operator":return z.value;case"Function":return`${z.name}(${I(z.children,"")})`;case"Parentheses":return`(${I(z.children,"")})`;case"Brackets":return`[${I(z.children,"")}]`;case"Raw":return z.value;case"Comment":return z.value.startsWith("!")?`/*${z.value}*/`:"";case"WhiteSpace":return" ";case"CDO":return"<!--";case"CDC":return"-->";case"AnPlusB":{let $=z.a??"",J=z.b??"";if($&&J){let Q=Number(J);return`${$==="1"?"":$==="-1"?"-":$}n${Q>=0?`+${J}`:J}`}if($)return`${$==="1"?"":$==="-1"?"-":$}n`;return J}case"Ratio":return`${z.left.value}/${z.right.value}`;case"UnicodeRange":return z.value;case"Nth":return z.selector?`${P(z.nth)} of ${P(z.selector)}`:P(z.nth);case"MediaQueryList":return I(z.children,",");case"MediaQuery":return I(z.children,"");case"MediaFeature":{let $=`(${z.name}`;if(z.value)$+=`:${P(z.value)}`;return $+=")",$}}return""}function I(z,$){let J="",Q=!0,Z=null,Y=z.head;while(Y!=null){let q=Y.data;if(q.type==="WhiteSpace"){let U=Y.next?Y.next.data:null;if(Z6(Z)||Z6(U)){Y=Y.next;continue}}let X=P(q);if(!X){Y=Y.next;continue}if(!Q&&$&&!v4(Z))J+=$;Q=!1,J+=X,Z=q,Y=Y.next}return J}function S4(z){let $="",J=null,Q=z.head;while(Q!=null){let Z=Q.data,Y=P(Z);if(!Y){Q=Q.next;continue}if(J&&g4(J,Z))$+=";";$+=Y,J=Z,Q=Q.next}return $}function g4(z,$){return z.type==="Declaration"&&$.type!=="Comment"}function Z6(z){if(!z||z.type!=="Operator")return!1;let $=z.value;return $===":"||$===","||$==="/"}function v4(z){if(!z)return!1;return z.type==="Operator"||z.type==="Combinator"}function P0(z){let $="";for(let J=0;J<z.length;J++){let Q=z.charCodeAt(J);if(Q===92)$+="\\\\";else if(Q===34)$+="\\\"";else if(Q<32||Q===127){let Z=Q.toString(16),Y=J+1<z.length?z.charCodeAt(J+1):-1,q=Y===32||Y===9||Y===10||Y===12||Y===13||Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102;$+=`\\${Z}${q?" ":""}`}else $+=z[J]}return $}var p=(()=>{let z=new Uint8Array(128);for(let $=0;$<128;$++){let J=0;if($===32||$===9||$===10||$===12||$===13)J|=1;if($>=48&&$<=57)J|=2;if($>=48&&$<=57||$>=65&&$<=70||$>=97&&$<=102)J|=4;if($>=65&&$<=90||$>=97&&$<=122||$===95)J|=8;if($===10||$===12||$===13)J|=16;z[$]=J}return z})();function S(z){return z<128&&(p[z]&2)!==0}function e(z){return z<128&&(p[z]&4)!==0}function Y6(z){return z>=128||z<128&&(p[z]&8)!==0}function _4(z){return z===45||z>=128||z<128&&(p[z]&10)!==0}function y4(z){return z>=0&&z<=8||z===11||z>=14&&z<=31||z===127}function x0(z){return z<128&&(p[z]&16)!==0}function f(z){return z<128&&(p[z]&1)!==0}function d(z,$){if(z!==92)return!1;if(x0($))return!1;return!0}function A0(z,$,J){if(z===45)return Y6($)||$===45||d($,J);if(Y6(z))return!0;if(z===92)return d(z,$);return!1}function f4(z,$,J){if(z===43||z===45){if(S($))return!0;if($===46&&S(J))return!0;return!1}if(z===46)return S($);return S(z)}class X0{source;offset=0;types;starts;ends;count=0;_tokens=null;_lineStarts=null;constructor(z){this.source=z;let $=Math.max(64,Math.ceil(z.length/3));this.types=new Uint8Array($),this.starts=new Uint32Array($),this.ends=new Uint32Array($),this.tokenize()}get lineStarts(){if(this._lineStarts==null)this._lineStarts=T4(this.source);return this._lineStarts}get tokens(){if(this._tokens!=null)return this._tokens;let z=Array.from({length:this.count});for(let $=0;$<this.count;$++)z[$]={type:this.types[$],start:this.starts[$],end:this.ends[$]};return this._tokens=z,z}addToken(z,$,J){if(this.count>=this.types.length)this.grow();this.types[this.count]=z,this.starts[this.count]=$,this.ends[this.count]=J,this.count++}grow(){let $=this.types.length*2,J=new Uint8Array($);J.set(this.types),this.types=J;let Q=new Uint32Array($);Q.set(this.starts),this.starts=Q;let Z=new Uint32Array($);Z.set(this.ends),this.ends=Z}tokenize(){let z=this.source,$=0,J=z.length;while($<J){let Q=z.charCodeAt($);if(Q===47&&z.charCodeAt($+1)===42){let q=$;$+=2;while($<J&&!(z.charCodeAt($)===42&&z.charCodeAt($+1)===47))$++;$=$<J?$+2:J,this.addToken(25,q,$);continue}if(f(Q)){let q=$;while($<J&&f(z.charCodeAt($)))$++;this.addToken(13,q,$);continue}if(Q===34||Q===39){$=this.consumeString(Q,$);continue}if(Q===35){if($+1<J&&(_4(z.charCodeAt($+1))||d(z.charCodeAt($+1),z.charCodeAt($+2)))){let q=$;$++,$=this.consumeName($),this.addToken(4,q,$);continue}this.addToken(9,$,$+1),$++;continue}switch(Q){case 40:this.addToken(21,$,$+1),$++;continue;case 41:this.addToken(22,$,$+1),$++;continue;case 91:this.addToken(19,$,$+1),$++;continue;case 93:this.addToken(20,$,$+1),$++;continue;case 123:this.addToken(23,$,$+1),$++;continue;case 125:this.addToken(24,$,$+1),$++;continue;case 44:this.addToken(18,$,$+1),$++;continue;case 58:this.addToken(16,$,$+1),$++;continue;case 59:this.addToken(17,$,$+1),$++;continue}if(Q===60&&z.startsWith("!--",$+1)){this.addToken(14,$,$+4),$+=4;continue}if(Q===45&&z.startsWith("->",$+1)){this.addToken(15,$,$+3),$+=3;continue}if(Q===64){let q=z.charCodeAt($+1),X=z.charCodeAt($+2),U=z.charCodeAt($+3);if(A0(q,X,U)){let F=$;$++,$=this.consumeName($),this.addToken(3,F,$);continue}this.addToken(9,$,$+1),$++;continue}let Z=z.charCodeAt($+1),Y=z.charCodeAt($+2);if(f4(Q,Z,Y)){$=this.consumeNumeric($);continue}if(A0(Q,Z,Y)){$=this.consumeIdentLike($);continue}if(Q===92){if(d(Q,Z)){$=this.consumeIdentLike($);continue}this.addToken(9,$,$+1),$++;continue}this.addToken(9,$,$+1),$++}this.addToken(0,J,J)}consumeString(z,$){let J=this.source,Q=J.length,Z=$+1;while(Z<Q){let Y=J.charCodeAt(Z);if(Y===z)return Z++,this.addToken(5,$,Z),Z;if(x0(Y))return this.addToken(6,$,Z),Z;if(Y===92){let q=J.charCodeAt(Z+1);if(x0(q)){Z+=2;continue}if(Z+1<Q){Z=this.consumeEscapeSkip(Z+1);continue}}Z++}return this.addToken(5,$,Z),Z}consumeEscapeSkip(z){let $=this.source;if(z>=$.length)return z;let J=$.charCodeAt(z);if(e(J)){let Q=1;z++;while(Q<6&&z<$.length&&e($.charCodeAt(z)))z++,Q++;if(z<$.length&&f($.charCodeAt(z)))z++;return z}return z+1}consumeName(z){let $=this.source,J=$.length,Q=z;while(Q<J){let Z=$.charCodeAt(Q);if(Z<128&&(p[Z]&10)!==0){Q++;continue}if(Z===45){Q++;continue}if(Z>=128){Q++;continue}if(Z===92&&d(Z,$.charCodeAt(Q+1))){Q=this.consumeEscapeSkip(Q+1);continue}break}return Q}consumeNumber(z){let $=this.source,J=z;if($.charCodeAt(J)===43||$.charCodeAt(J)===45)J++;while(J<$.length&&S($.charCodeAt(J)))J++;if($.charCodeAt(J)===46&&S($.charCodeAt(J+1))){J+=2;while(J<$.length&&S($.charCodeAt(J)))J++}let Q=$.charCodeAt(J);if(Q===69||Q===101){let Z=$.charCodeAt(J+1),Y=$.charCodeAt(J+2);if(S(Z)){J+=2;while(J<$.length&&S($.charCodeAt(J)))J++}else if((Z===43||Z===45)&&S(Y)){J+=3;while(J<$.length&&S($.charCodeAt(J)))J++}}return J}consumeNumeric(z){let $=this.source,J=this.consumeNumber(z),Q=$.charCodeAt(J),Z=$.charCodeAt(J+1),Y=$.charCodeAt(J+2);if(A0(Q,Z,Y)){let q=this.consumeName(J);return this.addToken(12,z,q),q}if(Q===37)return this.addToken(11,z,J+1),J+1;return this.addToken(10,z,J),J}consumeIdentLike(z){let $=this.source,J=this.consumeName(z),Q=$.charCodeAt(J);if(Q===40&&J-z===3){let Z=$.charCodeAt(z)|32,Y=$.charCodeAt(z+1)|32,q=$.charCodeAt(z+2)|32;if(Z===117&&Y===114&&q===108){let X=J+1;while(X<$.length&&f($.charCodeAt(X)))X++;let U=$.charCodeAt(X);if(U===34||U===39)return this.addToken(2,z,J+1),J+1;return this.consumeUrl(z,J)}}if(Q===40)return this.addToken(2,z,J+1),J+1;return this.addToken(1,z,J),J}consumeUrl(z,$){let J=this.source,Q=J.length,Z=$+1;while(Z<Q&&f(J.charCodeAt(Z)))Z++;while(Z<Q){let Y=J.charCodeAt(Z);if(Y===41)return Z++,this.addToken(7,z,Z),Z;if(f(Y)){let q=Z;while(Z<Q&&f(J.charCodeAt(Z)))Z++;if(Z>=Q)return this.addToken(7,z,Z),Z;if(J.charCodeAt(Z)===41)return Z++,this.addToken(7,z,Z),Z;return this.consumeBadUrl(z,q)}if(Y===34||Y===39||Y===40||y4(Y))return this.consumeBadUrl(z,Z);if(Y===92){if(d(Y,J.charCodeAt(Z+1))){Z=this.consumeEscapeSkip(Z+1);continue}return this.consumeBadUrl(z,Z)}Z++}return this.addToken(7,z,Z),Z}consumeBadUrl(z,$){let J=this.source,Q=$;while(Q<J.length){let Z=J.charCodeAt(Q);if(Z===41){Q++;break}if(Z===92&&d(Z,J.charCodeAt(Q+1))){Q=this.consumeEscapeSkip(Q+1);continue}Q++}return this.addToken(8,z,Q),Q}locate(z){let $=this.lineStarts,J=0,Q=$.length-1;while(J<Q){let Y=J+Q+1>>1;if($[Y]<=z)J=Y;else Q=Y-1}let Z=$[J];return{line:J+1,column:z-Z+1}}}function T4(z){let $=[0],J=z.length;for(let Q=0;Q<J;Q++){let Z=z.charCodeAt(Q);if(Z===10)$.push(Q+1);else if(Z===13){if(z.charCodeAt(Q+1)!==10)$.push(Q+1)}}return $}function b0(z,$,J){for(let Q=$;Q<J;Q++)if(z.charCodeAt(Q)===92)return k4(z,$,J,Q);return z.slice($,J)}function k4(z,$,J,Q){let Z=z.slice($,Q),Y=Q;while(Y<J){if(z.charCodeAt(Y)!==92){Z+=z[Y],Y++;continue}if(Y+1>=J){Y++;continue}let X=z.charCodeAt(Y+1);if(X===10){Y+=2;continue}if(X===13){Y+=z.charCodeAt(Y+2)===10?3:2;continue}if(e(X)){let U=Y+1,F="";while(F.length<6&&U<J&&e(z.charCodeAt(U)))F+=z[U],U++;let H=Number.parseInt(F,16);if(U<J&&f(z.charCodeAt(U)))U++;Z+=H===0||H>=55296&&H<=57343||H>1114111?String.fromCodePoint(65533):String.fromCodePoint(H),Y=U;continue}Z+=z[Y+1],Y+=2}return Z}function R0(z,$,J){for(let Q=$;Q<J;Q++)if(z.charCodeAt(Q)===92)return m4(z,$,J,Q);return z.slice($,J)}function m4(z,$,J,Q){let Z=z.slice($,Q),Y=Q;while(Y<J){if(z.charCodeAt(Y)!==92){Z+=z[Y],Y++;continue}let X=Y+1,U="";while(U.length<6&&X<J&&e(z.charCodeAt(X)))U+=z[X],X++;if(U.length>0){let F=Number.parseInt(U,16);if(X<J&&f(z.charCodeAt(X)))X++;Z+=F===0||F>=55296&&F<=57343||F>1114111?String.fromCodePoint(65533):String.fromCodePoint(F),Y=X;continue}if(X<J){Z+=z[X],Y=X+1;continue}Z+=String.fromCodePoint(65533),Y=X}return Z}function K6(z,$){let J=new X0(z);return{source:z,types:J.types,starts:J.starts,ends:J.ends,count:J.count,end:J.count,pos:0,positions:$.positions??!1,filename:$.filename,parseValue:$.parseValue??!0,parseAtrulePrelude:$.parseAtrulePrelude??!0,parseCustomProperty:$.parseCustomProperty??!1,parseRulePrelude:$.parseRulePrelude??!0,onParseError:$.onParseError,tokenizer:J}}function j(z){return z.pos<z.end?z.types[z.pos]:0}function M(z){let $=z.pos;if($>=z.end)return{type:0,start:z.starts[$]??z.source.length,end:z.ends[$]??z.source.length};return{type:z.types[$],start:z.starts[$],end:z.ends[$]}}function D(z){let $=z.pos++;if($>=z.end)return{type:0,start:z.starts[$]??z.source.length,end:z.ends[$]??z.source.length};return{type:z.types[$],start:z.starts[$],end:z.ends[$]}}function _(z,$){return z.source.slice($.start,$.end)}function g(z){let{types:$,end:J}=z;while(z.pos<J){let Q=$[z.pos];if(Q===13||Q===25)z.pos++;else break}}function X6(z){let{types:$,end:J}=z;while(z.pos<J&&$[z.pos]===13)z.pos++}function W(z,$,J){if(!z.positions)return null;let Q=z.tokenizer.locate($.start),Z=z.tokenizer.locate(J.end);return{source:z.filename??"<unknown>",start:{offset:$.start,line:Q.line,column:Q.column},end:{offset:J.end,line:Z.line,column:Z.column}}}function j6(z){if(!z.positions)return null;let $=M(z),J=z.tokenizer.locate($.start);return{source:z.filename??"<unknown>",start:{offset:$.start,line:J.line,column:J.column},end:{offset:$.start,line:J.line,column:J.column}}}function U0(z,$,J,Q){return{type:"Raw",value:z,loc:W(Q,$,J)}}function x(){return new h}function E0(z,$,J,Q){if(z.onParseError){let{line:Z,column:Y}=z.tokenizer.locate(J.start),q=SyntaxError(`${z.filename??"<input>"}:${Z}:${Y}: ${$}`);q.line=Z,q.column=Y,q.offset=J.start,z.onParseError(q,Q)}return Q}function c(z,$={}){let J=K6(z,$);switch($.context??"stylesheet"){case"stylesheet":return F6(J);case"atrule":return F0(J)??U6(J);case"atrulePrelude":return c4(J);case"mediaQuery":case"mediaQueryList":return q6(J);case"rule":return C0(J);case"selectorList":return g0(J);case"selector":return W6(J);case"block":return h0(J);case"declarationList":return n4(J);case"declaration":return S0(J)??U6(J);case"value":return a4(J);case"raw":return q6(J);default:return F6(J)}}function U6(z){return{type:"StyleSheet",children:x(),loc:j6(z)}}function q6(z){let $=M(z),J=$;while(j(z)!==0)J=D(z);return{type:"Raw",value:z.source.slice($.start,J.end),loc:W(z,$,J)}}function F6(z){let $=M(z),J=x(),Q=z.types,Z=z.end;while(z.pos<Z){let X=Q[z.pos];if(X===13){z.pos++;continue}if(X===25){let H={type:25,start:z.starts[z.pos],end:z.ends[z.pos]},G=I0(z,H);z.pos++,J.appendData(G);continue}if(X===0)break;if(X===14||X===15){z.pos++;continue}if(X===3){let H=F0(z);if(H)J.appendData(H);continue}if(X===24){z.pos++;continue}let U=z.pos,F=C0(z);if(J.appendData(F),z.pos===U)z.pos++}let Y=z.end-1,q=Y>=0?{type:z.types[Y],start:z.starts[Y],end:z.ends[Y]}:{type:0,start:0,end:0};return{type:"StyleSheet",children:J,loc:W(z,$,q)}}function I0(z,$){return{type:"Comment",value:z.source.slice($.start+2,$.end-2),loc:W(z,$,$)}}function F0(z){let $=M(z);if($.type!==3)return null;z.pos++;let J=q0(z.source,$.start+1,$.end);g(z);let Q=z.pos,Z=M(z),Y=z.types,q=z.end,X=Q,U=Q;while(X<q){let G=Y[X];if(G===0||G===17||G===23)break;if(G!==13&&G!==25)U=X+1;X++}let F=null;if(U>Q){let G=z.starts[Q],K=z.ends[U-1],V={type:Y[U-1],start:z.starts[U-1],end:K},b=z.source.slice(G,K).trim();if(b.length>0)if(z.parseAtrulePrelude)try{let T=z.end;z.end=U,z.pos=Q;let C=x();while(j(z)!==0){let a=l(z);if(a)C.appendData(a)}if(M6(C),z.end=T,z.pos=X,C.isEmpty)F=U0(b,Z,V,z);else F={type:"AtrulePrelude",children:C,loc:null}}catch(T){let C=U0(b,Z,V,z);E0(z,`Failed to parse @${J} prelude: ${T.message}`,Z,C),F=C,z.pos=X}else F=U0(b,Z,V,z),z.pos=X;else z.pos=X}else z.pos=X;let H=null;if(j(z)===17)D(z);else if(j(z)===23)H=h0(z,p4.has(J));return{type:"Atrule",name:J,prelude:F,block:H,loc:W(z,$,M(z))}}var d4=new Set(["is","not","where","has","matches","-moz-any","-webkit-any"]),p4=new Set(["media","supports","document","layer","container","scope","starting-style","-moz-document","keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes"]);function c4(z){let $=M(z),J=x();while(j(z)!==0){if(M(z).type===13){z.pos++;continue}let Z=l(z);if(Z)J.appendData(Z)}return{type:"AtrulePrelude",children:J,loc:W(z,$,M(z))}}function C0(z){let $=M(z),J;if(z.parseRulePrelude)J=g0(z);else{let Z=M(z),Y=Z;while(j(z)!==0&&j(z)!==23)Y=D(z);let q=z.source.slice(Z.start,Y.end).trim();J=U0(q,Z,Y,z)}let Q=h0(z,!0);return{type:"Rule",prelude:J,block:Q,loc:W(z,$,M(z))}}function h0(z,$=!1){let J=M(z);if(j(z)!==23)return{type:"Block",children:x(),loc:j6(z)};z.pos++;let Q=x(),Z=z.types,Y=z.end;while(z.pos<Y){let q=Z[z.pos];if(q===24||q===0)break;if(q===13){z.pos++;continue}if(q===25){let U={type:25,start:z.starts[z.pos],end:z.ends[z.pos]};z.pos++,Q.appendData(I0(z,U));continue}if(q===3){let U=F0(z);if(U)Q.appendData(U);continue}if($&&l4(z,i4)){let U=C0(z);Q.appendData(U);continue}let X=S0(z);if(X)Q.appendData(X);if(z.pos<Y&&Z[z.pos]===17)z.pos++}if(j(z)===24)z.pos++;return{type:"Block",children:Q,loc:W(z,J,M(z))}}function l4(z,$){let J=z.pos,Q=$(z);return z.pos=J,Q}function i4(z){let{types:$,end:J}=z;while(z.pos<J){let Q=$[z.pos];if(Q===23)return!0;if(Q===17||Q===24||Q===0)return!1;z.pos++}return!1}function n4(z){let $=M(z),J=x();while(j(z)!==0&&j(z)!==24){let Q=M(z);if(Q.type===13){z.pos++;continue}if(Q.type===25){J.appendData(I0(z,D(z)));continue}if(Q.type===17){z.pos++;continue}if(Q.type===3){let Y=F0(z);if(Y)J.appendData(Y);continue}let Z=S0(z);if(Z)J.appendData(Z);if(j(z)===17)D(z)}return{type:"DeclarationList",children:J,loc:W(z,$,M(z))}}function S0(z){g(z);let $=M(z);if($.type!==1&&$.type!==4&&!($.type===9&&z.source[$.start]==="*"&&z.source[$.start+1]===" "))if($.type===9&&z.source[$.start]==="*")z.pos++;else{E0(z,"Expected property name",$,{type:"Raw",value:"",loc:null});let{types:R,end:E}=z;while(z.pos<E){let O=R[z.pos];if(O===0||O===17||O===24)break;z.pos++}return null}let J=z.starts[z.pos],Q=z.ends[z.pos];z.pos++;let Z=z.source.slice(J,Q);if(X6(z),j(z)!==16){E0(z,`Expected ':' after property "${Z}"`,M(z),{type:"Raw",value:"",loc:null});let{types:R,end:E}=z;while(z.pos<E){let O=R[z.pos];if(O===0||O===17||O===24)break;z.pos++}return null}z.pos++,X6(z);let{types:Y,starts:q,end:X,pos:U}=z,F=U,H=U,G=-1,K=-1;while(F<X){let R=Y[F];if(R===0||R===17||R===24)break;if(R===9&&z.source.charCodeAt(q[F])===33){let E=F+1;while(E<X&&Y[E]===13)E++;if(E<X&&Y[E]===1){let O=q[E];if(z.ends[E]-O===9&&(z.source.charCodeAt(O)|32)===105&&(z.source.charCodeAt(O+1)|32)===109&&(z.source.charCodeAt(O+2)|32)===112&&(z.source.charCodeAt(O+3)|32)===111&&(z.source.charCodeAt(O+4)|32)===114&&(z.source.charCodeAt(O+5)|32)===116&&(z.source.charCodeAt(O+6)|32)===97&&(z.source.charCodeAt(O+7)|32)===110&&(z.source.charCodeAt(O+8)|32)===116){K=F,G=E,F=E+1;continue}}}if(R!==13&&R!==25)H=F+1;F++}let V=H,b=G>=0?{type:1,start:q[G],end:z.ends[G]}:null,T=Z.startsWith("--"),C,a=q[U],u0=V>U?z.ends[V-1]:a,K0={type:Y[U],start:a,end:z.ends[U]},d0=V>U?{type:Y[V-1],start:q[V-1],end:u0}:K0;if(T&&!z.parseCustomProperty||!z.parseValue)C={type:"Raw",value:z.source.slice(a,u0).trim(),loc:W(z,K0,d0)};else if(V===U)C={type:"Value",children:x(),loc:W(z,K0,d0)};else{let R=z.end;z.end=V,z.pos=U,C=V6(z),z.end=R}return z.pos=F,{type:"Declaration",property:Z,important:b?!0:!1,value:C,loc:W(z,$,M(z))}}function a4(z){return V6(z)}function V6(z){let $=M(z),J=x();while(j(z)!==0&&j(z)!==17&&j(z)!==24&&j(z)!==22&&j(z)!==20){let Q=l(z);if(Q)J.appendData(Q)}return D6(J),{type:"Value",children:J,loc:W(z,$,M(z))}}function M6(z){for(let $ of z)if("children"in $&&$.children instanceof h)M6($.children);D6(z)}function D6(z){let $=z.head;while($){if($.data.type==="Number"){let J=$.next;while(J&&J.data.type==="WhiteSpace")J=J.next;if(J&&J.data.type==="Operator"&&J.data.value==="/"){let Q=J.next;while(Q&&Q.data.type==="WhiteSpace")Q=Q.next;if(Q&&Q.data.type==="Number"){let Z={type:"Ratio",left:$.data,right:Q.data,loc:null},Y=$.next;while(Y&&Y!==Q.next){let q=Y.next;z.remove(Y),Y=q}z.replace($,z.createItem(Z)),$=z.head;continue}}}$=$.next}}function l(z){let $=z.pos;if($>=z.end)return null;let J=z.types[$],Q=z.starts[$],Z=z.ends[$],Y=z.source;switch(J){case 13:return z.pos++,z.positions?{type:"WhiteSpace",value:" ",loc:A(z,Q,Z)}:{type:"WhiteSpace",value:" ",loc:null};case 25:return z.pos++,{type:"Comment",value:Y.slice(Q+2,Z-2),loc:z.positions?A(z,Q,Z):null};case 10:return z.pos++,{type:"Number",value:Y.slice(Q,Z),loc:z.positions?A(z,Q,Z):null};case 11:return z.pos++,{type:"Percentage",value:Y.slice(Q,Z-1),loc:z.positions?A(z,Q,Z):null};case 12:{z.pos++;let q=Q,X=Y.charCodeAt(q);if(X===43||X===45)q++;let U=!1;while(q<Z){let H=Y.charCodeAt(q);if(H>=48&&H<=57){q++;continue}if(H===46&&!U){U=!0,q++;continue}break}let F=Y.charCodeAt(q);if(F===69||F===101){let H=q+1,G=Y.charCodeAt(H);if(G===43||G===45)H++;let K=!1;while(H<Z){let V=Y.charCodeAt(H);if(V>=48&&V<=57){H++,K=!0;continue}break}if(K)q=H}return{type:"Dimension",value:Y.slice(Q,q),unit:Y.slice(q,Z),loc:z.positions?A(z,Q,Z):null}}case 1:return z.pos++,{type:"Identifier",name:R0(Y,Q,Z),loc:z.positions?A(z,Q,Z):null};case 5:{z.pos++;let q=Q+1,U=Z-Q>=2&&Y.charCodeAt(Z-1)===Y.charCodeAt(Q)?Z-1:Z;return{type:"String",value:b0(Y,q,U),loc:z.positions?A(z,Q,Z):null}}case 7:{z.pos++;let q=Q+4;while(q<Z&&G6(Y.charCodeAt(q)))q++;let X=Z;if(X>q&&Y.charCodeAt(X-1)===41)X--;while(X>q&&G6(Y.charCodeAt(X-1)))X--;let U;if(X-q>=2){let F=Y.charCodeAt(q),H=Y.charCodeAt(X-1);if((F===34||F===39)&&F===H)U=Y.slice(q+1,X-1);else U=Y.slice(q,X)}else U=Y.slice(q,X);return{type:"Url",value:U,loc:z.positions?A(z,Q,Z):null}}case 4:return z.pos++,{type:"Hash",name:Y.slice(Q+1,Z),loc:z.positions?A(z,Q,Z):null};case 2:return o4(z);case 21:return t4(z);case 18:return z.pos++,{type:"Operator",value:",",loc:z.positions?A(z,Q,Z):null};case 16:return z.pos++,{type:"Operator",value:":",loc:z.positions?A(z,Q,Z):null};case 9:{z.pos++;let q=Y.charCodeAt(Q),X=Y[Q];if(r4(q))return{type:"Operator",value:X,loc:z.positions?A(z,Q,Z):null};return{type:"Identifier",name:X,loc:z.positions?A(z,Q,Z):null}}case 19:{z.pos++;let q=x();while(j(z)!==0&&j(z)!==20){let U=l(z);if(U)q.appendData(U)}let X=z.pos<z.end?z.ends[z.pos]:Z;if(j(z)===20)z.pos++;return{type:"Brackets",children:q,loc:z.positions?A(z,Q,X):null}}case 3:case 23:case 24:case 22:case 20:case 17:case 0:case 14:case 15:case 6:case 8:return z.pos++,{type:"Raw",value:Y.slice(Q,Z),loc:z.positions?A(z,Q,Z):null}}return z.pos++,null}function G6(z){return z===32||z===9||z===10||z===12||z===13}function r4(z){return z===47||z===43||z===45||z===42||z===61||z===62||z===60||z===126||z===124||z===36||z===94||z===33||z===38}function q0(z,$,J){for(let Q=$;Q<J;Q++){let Z=z.charCodeAt(Q);if(Z>=65&&Z<=90)return z.slice($,J).toLowerCase()}return z.slice($,J)}function A(z,$,J){let Q=z.tokenizer.locate($),Z=z.tokenizer.locate(J);return{source:z.filename??"<unknown>",start:{offset:$,line:Q.line,column:Q.column},end:{offset:J,line:Z.line,column:Z.column}}}function o4(z){let $=D(z),J=q0(z.source,$.start,$.end-1),Q=x();while(j(z)!==0&&j(z)!==22){let Z=l(z);if(Z)Q.appendData(Z)}if(j(z)===22)D(z);if(J==="url"){for(let Z=Q.head;Z!=null;Z=Z.next)if(Z.data.type==="String")return{type:"Url",value:Z.data.value,loc:W(z,$,M(z))}}return{type:"Function",name:J,children:Q,loc:W(z,$,M(z))}}function t4(z){let $=D(z),J=x();while(j(z)!==0&&j(z)!==22){let Q=l(z);if(Q)J.appendData(Q)}if(j(z)===22)D(z);return{type:"Parentheses",children:J,loc:W(z,$,M(z))}}function g0(z){let $=M(z),J=x();while(j(z)!==0){if(g(z),j(z)===0||j(z)===23)break;let Q=W6(z);if(Q.children.head!==null)J.appendData(Q);if(g(z),j(z)===18){D(z);continue}break}return{type:"SelectorList",children:J,loc:W(z,$,M(z))}}function W6(z){let $=M(z),J=x(),Q=!0;while(j(z)!==0&&j(z)!==18&&j(z)!==23){let Z=M(z);if(Z.type===13){if(D(z),!Q&&j(z)!==0&&j(z)!==18&&j(z)!==23&&!H6(z)&&!s4(z)){let q={type:"Combinator",name:" ",loc:W(z,Z,Z)};J.appendData(q),Q=!0}continue}if(Z.type===9&&z.source.charCodeAt(Z.start)===124&&z.types[z.pos+1]===9&&z.source.charCodeAt(z.starts[z.pos+1])===124){let q=M(z);D(z);let X=D(z),U={type:"Combinator",name:"||",loc:W(z,q,X)};J.appendData(U),Q=!0,g(z);continue}if(H6(z)){let q=D(z),U={type:"Combinator",name:z.source[q.start],loc:W(z,q,q)};J.appendData(U),Q=!0,g(z);continue}let Y=e4(z);if(!Y)break;J.appendData(Y),Q=!1}while(J.tail&&J.tail.data.type==="Combinator")J.remove(J.tail);return{type:"Selector",children:J,loc:W(z,$,M(z))}}function H6(z){let $=M(z);if($.type!==9)return!1;let J=z.source[$.start];return J===">"||J==="+"||J==="~"}function s4(z){if(z.types[z.pos]!==9)return!1;if(z.source.charCodeAt(z.starts[z.pos])!==124)return!1;if(z.types[z.pos+1]!==9)return!1;return z.source.charCodeAt(z.starts[z.pos+1])===124}function e4(z){let $=M(z);switch($.type){case 1:{if(D(z),j(z)===9&&z.source[M(z).start]==="|"&&z.source[M(z).start+1]!=="="&&!(z.types[z.pos+1]===9&&z.source.charCodeAt(z.starts[z.pos+1])===124)){if(D(z),j(z)===1){let Q=D(z);return{type:"TypeSelector",name:`${_(z,$)}|${_(z,Q)}`,loc:W(z,$,Q)}}if(j(z)===9&&z.source[M(z).start]==="*"){let Q=D(z);return{type:"TypeSelector",name:`${_(z,$)}|*`,loc:W(z,$,Q)}}}return{type:"TypeSelector",name:_(z,$),loc:W(z,$,$)}}case 11:return D(z),{type:"TypeSelector",name:_(z,$),loc:W(z,$,$)};case 10:return D(z),{type:"TypeSelector",name:_(z,$),loc:W(z,$,$)};case 9:{let J=z.source[$.start];if(J==="*")return D(z),{type:"TypeSelector",name:"*",loc:W(z,$,$)};if(J==="."){if(D(z),j(z)===1){let Q=D(z);return{type:"ClassSelector",name:_(z,Q),loc:W(z,$,Q)}}return null}if(J==="&")return D(z),{type:"NestingSelector",loc:W(z,$,$)};return D(z),null}case 4:return D(z),{type:"IdSelector",name:z.source.slice($.start+1,$.end),loc:W(z,$,$)};case 16:{D(z);let J=j(z)===16;if(J)D(z);return zz(z,J,$)}case 19:return $z(z)}return null}function zz(z,$,J){let Q=M(z);if(Q.type===1){D(z);let Z=q0(z.source,Q.start,Q.end);return $?{type:"PseudoElementSelector",name:Z,children:null,loc:W(z,J,Q)}:{type:"PseudoClassSelector",name:Z,children:null,loc:W(z,J,Q)}}if(Q.type===2){D(z);let Z=q0(z.source,Q.start,Q.end-1),Y=x();if(!$&&d4.has(Z)){let U=M(z),F=U,H=1;while(j(z)!==0&&H>0){if(j(z)===21||j(z)===2)H++;else if(j(z)===22){if(H--,H===0)break}F=D(z)}if(j(z)===22)D(z);let G=z.source.slice(U.start,F.end).trim();if(G.length>0){let K=K6(G,{positions:!1}),V=g0(K);Y.appendData(V)}}else{while(j(z)!==0&&j(z)!==22){let U=l(z);if(U)Y.appendData(U)}if(j(z)===22)D(z)}if($)return{type:"PseudoElementSelector",name:Z,children:Y,loc:W(z,J,M(z))};return{type:"PseudoClassSelector",name:Z,children:Y,loc:W(z,J,M(z))}}return null}function $z(z){let $=D(z);g(z);let J=M(z);if(J.type!==1)return null;D(z);let Q={type:"Identifier",name:_(z,J),loc:W(z,J,J)};g(z);let Z=null,Y=null,q=null,X=M(z);if(X.type===9){let F=z.source[X.start],H=z.source[X.start+1];if(F==="=")Z="=",D(z);else if((F==="~"||F==="|"||F==="^"||F==="$"||F==="*")&&H==="="){D(z);let V=M(z);if(V.type===9&&z.source[V.start]==="=")D(z),Z=`${F}=`}g(z);let G=M(z);if(G.type===5){D(z);let V=G.end-G.start>=2&&z.source.charCodeAt(G.end-1)===z.source.charCodeAt(G.start);Y={type:"String",value:b0(z.source,G.start+1,V?G.end-1:G.end),loc:W(z,G,G)}}else if(G.type===1)D(z),Y={type:"Identifier",name:_(z,G),loc:W(z,G,G)};g(z);let K=M(z);if(K.type===1)D(z),q=_(z,K)}g(z);let U=M(z);if(j(z)===20)U=D(z);return{type:"AttributeSelector",name:Q,matcher:Z,value:Y,flags:q,loc:W(z,$,U)}}var L6=Symbol("walkSkip"),B=Symbol("walkStop");function Jz(z){return{root:z,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null}}function Qz(z,$){let J=Jz(z),Q=typeof $==="function"?$:$.enter,Z=typeof $==="function"?null:$.leave??null,Y=typeof $==="function"?null:$.visit??null,q=typeof $==="function"?!1:$.reverse??!1;function X(U,F,H){let G=null,K;switch(U.type){case"StyleSheet":G="stylesheet",K=J.stylesheet,J.stylesheet=U;break;case"Atrule":G="atrule",K=J.atrule,J.atrule=U;break;case"AtrulePrelude":G="atrulePrelude",K=J.atrulePrelude,J.atrulePrelude=U;break;case"Rule":G="rule",K=J.rule,J.rule=U;break;case"Selector":G="selector",K=J.selector,J.selector=U;break;case"Block":G="block",K=J.block,J.block=U;break;case"Declaration":G="declaration",K=J.declaration,J.declaration=U;break;case"Function":G="function",K=J.function,J.function=U;break}let V;if((Y===null||Y===U.type)&&Q){let b=Q.call(J,U,F,H);if(b===L6){if(G)J[G]=K;return}if(b===B){if(G)J[G]=K;return B}}if(V=Zz(U,q,X),V===B){if(G)J[G]=K;return B}if((Y===null||Y===U.type)&&Z){if(Z.call(J,U,F,H)===B){if(G)J[G]=K;return B}}if(G)J[G]=K;return}return X(z,null,null)}var i=Object.assign(Qz,{skip:L6,stop:B});function Zz(z,$,J){if("children"in z&&z.children instanceof h)return Yz(z.children,$,J);if(z.type==="Rule"){if(J(z.prelude,null,null)===B)return B;if(J(z.block,null,null)===B)return B;return}if(z.type==="Atrule"){if(z.prelude){if(J(z.prelude,null,null)===B)return B}if(z.block){if(J(z.block,null,null)===B)return B}return}if(z.type==="Declaration")return J(z.value,null,null);if(z.type==="AttributeSelector"){if(J(z.name,null,null)===B)return B;if(z.value)return J(z.value,null,null);return}return}function Yz(z,$,J){let Q;if($)z.forEachRight((Z,Y,q)=>{if(Q)return;if(J(Z,Y,q)===B)Q=B});else z.forEach((Z,Y,q)=>{if(Q)return;if(J(Z,Y,q)===B)Q=B});return Q}function r(z,$={}){let J=$.exclamation??!1,Q=!1;i(z,(Z,Y,q)=>{if(Z.type!=="Comment")return;let X=Z.value.startsWith("!");if(J===!0&&X)return;if(J==="first-exclamation"&&X&&!Q){Q=!0;return}if(Y&&q)q.remove(Y)})}function G0(z){i(z,($)=>{if($.type!=="Block"&&$.type!=="DeclarationList")return;if(!("children"in $)||!$.children)return;let J=$.children,Q=J.head;if(Q==null||Q.next==null)return;let Z=0;for(let X=Q;X!=null;X=X.next)if(X.data.type==="Declaration"){if(Z++,Z>=2)break}if(Z<2)return;let Y=new Map,q=[];for(let X=Q;X!=null;X=X.next){let U=X.data;if(U.type!=="Declaration")continue;let F=U.property,H=Y.get(F);if(H){let G=!!H.decl.important,K=!!U.important;if(K||G===K)q.push(H.item),Y.set(F,{item:X,decl:U});else q.push(X)}else Y.set(F,{item:X,decl:U})}for(let X of q)J.remove(X)})}var Xz={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"},Uz={"#f00":"red","#ff0000":"red","#000080":"navy","#008080":"teal"};function _0(z){if(!z.startsWith("#"))return z;let $=z.slice(1);if($.length===6){if($[0]===$[1]&&$[2]===$[3]&&$[4]===$[5])return`#${$[0]}${$[2]}${$[4]}`}if($.length===8){if($[0]===$[1]&&$[2]===$[3]&&$[4]===$[5]&&$[6]===$[7])return`#${$[0]}${$[2]}${$[4]}${$[6]}`}return z}function w6(z){let $=z.toLowerCase();return Xz[$]??null}function N6(z){let $=z.toLowerCase();return Uz[$]??null}function qz(z,$,J){let Q=(z<<16|$<<8|J).toString(16).padStart(6,"0");return _0(`#${Q}`)}var Fz=/^rgba?\(\s*([+-]?\d*\.?\d+%?)\s*[,\s]\s*([+-]?\d*\.?\d+%?)\s*[,\s]\s*([+-]?\d*\.?\d+%?)\s*(?:[,/]\s*([+-]?\d*\.?\d+%?)\s*)?\)$/;function B6(z){let $=Fz.exec(z.trim());if(!$)return z;let J=v0($[1]),Q=v0($[2]),Z=v0($[3]);if($[4]!==void 0&&!Gz($[4]))return z;return qz(J,Q,Z)}function Gz(z){if(z.endsWith("%"))return Number.parseFloat(z)>=100;return Number.parseFloat(z)>=1}function v0(z){if(z.endsWith("%"))return Math.max(0,Math.min(255,Math.round(Number.parseFloat(z)*2.55)));return Math.max(0,Math.min(255,Math.round(Number.parseFloat(z))))}var Hz=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 H0(z){if(z.charCodeAt(0)===43)z=z.slice(1);if(z.includes(".")){let $=z.replace(/(\.\d*?)0+($|[eE])/,"$1$2");$=$.replace(/\.($|[eE])/,"$1"),z=$}if(z.startsWith("0.")&&z.length>2)z=z.slice(1);else if(z.startsWith("-0.")&&z.length>3)z=`-${z.slice(2)}`;if(z==="-0"||z==="-.0"||z==="-0.0")z="0";return z}function O6(z,$){let J=H0(z);if((J==="0"||J==="-0")&&Hz.has($.toLowerCase()))return{value:"0",unit:""};return{value:J,unit:$}}function P6(z){return H0(z)}function A6(z,$){let J=Number.parseFloat(z);if(!Number.isFinite(J))return z;let Q=$<0?0:$;return J.toFixed(Q)}var x6=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 b6(z){if(!z||z.type!=="Operator")return!1;let $=z.value;return $===":"||$===","||$==="/"}function Kz(z){let $=z.children;if(!$)return;while($.head&&$.head.data.type==="WhiteSpace")$.remove($.head);while($.tail&&$.tail.data.type==="WhiteSpace")$.remove($.tail);let J=$.head;while(J){let Q=J.next;if(J.data.type==="WhiteSpace"){let Z=J.prev&&b6(J.prev.data),Y=Q&&b6(Q.data);if(Z||Y)$.remove(J)}J=Q}}function y0(z,$={}){let J=$.floatPrecision??null,Q=J===null?null:(Z)=>A6(Z,J);i(z,{enter(Z,Y,q){switch(Z.type){case"Number":{let X=Q?Q(Z.value):Z.value;Z.value=H0(X);return}case"Percentage":{let X=Q?Q(Z.value):Z.value;Z.value=P6(X);return}case"Dimension":{let X=Q?Q(Z.value):Z.value,U=O6(X,Z.unit);Z.value=U.value,Z.unit=U.unit;return}case"Hash":{let X=_0(`#${Z.name}`).slice(1);if(Z.name=X,Y&&q&&this.declaration&&x6.has(this.declaration.property.toLowerCase())){let U=N6(`#${X}`);if(U&&U.length<X.length+1){let F={type:"Identifier",name:U,loc:Z.loc};q.replace(Y,q.createItem(F))}}return}case"Identifier":{if(!Y||!q||!this.declaration)return;if(!x6.has(this.declaration.property.toLowerCase()))return;let X=w6(Z.name);if(X&&X.length<Z.name.length){let U={type:"Hash",name:X.slice(1),loc:Z.loc};q.replace(Y,q.createItem(U))}return}case"Url":return;case"Function":{let X=Z.name.toLowerCase();if((X==="rgb"||X==="rgba")&&Y&&q)Z.__rgbReplaceCandidate=!0}}},leave(Z,Y,q){if(Z.type==="Parentheses"||Z.type==="Function"||Z.type==="Value")Kz(Z);if(Z.type==="Function"&&Z.__rgbReplaceCandidate&&Y&&q){let X=P(Z),U=B6(X);if(U!==X&&U.startsWith("#")){let F={type:"Hash",name:U.slice(1),loc:Z.loc};q.replace(Y,q.createItem(F))}}}})}function f0(z,$={}){let J=c(z,{context:"stylesheet"});return R6(J,$)}function T0(z,$={}){let J=c(z,{context:"declarationList"});return R6(J,$)}function R6(z,$){if($.comments===!1)r(z,{exclamation:!1});else if($.comments==="first-exclamation")r(z,{exclamation:"first-exclamation"});else r(z,{exclamation:!0});return y0(z,{floatPrecision:$.floatPrecision??null}),G0(z),{css:P(z),ast:z}}var k0="0.1.4";function m0(z){if(!Dz(z))process.stderr.write(`ts-css: file not found: ${z}
|
|
42
|
+
`),process.exit(1);return Wz(z,"utf8")}var n=new B0("ts-css");n.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(z,$)=>{let J=m0(z),Q={comments:$.comments===!1?!1:"exclamation"},Z=$.block?T0(J,Q):f0(J,Q);process.stdout.write(Z.css)});n.command("parse <file>","Parse a CSS file and print its AST as JSON").option("--positions","Include source locations on every node").action(async(z,$)=>{let J=m0(z),Q=c(J,{positions:$.positions});process.stdout.write(JSON.stringify(Q,null,2))});n.command("format <file>","Round-trip CSS through parser/generator (deterministic single-line output)").action(async(z)=>{let $=m0(z),J=c($);process.stdout.write(P(J))});n.command("version","Show the version of the CLI").action(()=>{console.log(k0)});n.version(k0);n.help();n.parse();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/ts-css",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.4",
|
|
5
5
|
"description": "Pure-TypeScript CSS toolkit for Bun/Node โ parser, walker, generator, selector engine, and minifier. Zero runtime deps.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|