@frontfriend/sdk 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
- var C=(i,r)=>()=>(r||i((r={exports:{}}).exports,r),r.exports);var Sr=C((Ff,wr)=>{wr.exports=br;br.sync=Fo;var yr=require("fs");function Vo(i,r){var n=r.pathExt!==void 0?r.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var o=0;o<n.length;o++){var h=n[o].toLowerCase();if(h&&i.substr(-h.length).toLowerCase()===h)return!0}return!1}function Er(i,r,n){return!i.isSymbolicLink()&&!i.isFile()?!1:Vo(r,n)}function br(i,r,n){yr.stat(i,function(o,h){n(o,o?!1:Er(h,i,r))})}function Fo(i,r){return Er(yr.statSync(i),i,r)}});var Ar=C(($f,_r)=>{_r.exports=Ir;Ir.sync=$o;var Cr=require("fs");function Ir(i,r,n){Cr.stat(i,function(o,h){n(o,o?!1:kr(h,r))})}function $o(i,r){return kr(Cr.statSync(i),r)}function kr(i,r){return i.isFile()&&Do(i,r)}function Do(i,r){var n=i.mode,o=i.uid,h=i.gid,l=r.uid!==void 0?r.uid:process.getuid&&process.getuid(),p=r.gid!==void 0?r.gid:process.getgid&&process.getgid(),m=parseInt("100",8),g=parseInt("010",8),x=parseInt("001",8),S=m|g,v=n&x||n&g&&h===p||n&m&&o===l||n&S&&l===0;return v}});var Tr=C((qf,Nr)=>{var Df=require("fs"),ht;process.platform==="win32"||global.TESTING_WINDOWS?ht=Sr():ht=Ar();Nr.exports=Mt;Mt.sync=qo;function Mt(i,r,n){if(typeof r=="function"&&(n=r,r={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,h){Mt(i,r||{},function(l,p){l?h(l):o(p)})})}ht(i,r||{},function(o,h){o&&(o.code==="EACCES"||r&&r.ignoreErrors)&&(o=null,h=!1),n(o,h)})}function qo(i,r){try{return ht.sync(i,r||{})}catch(n){if(r&&r.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var $r=C((jf,Fr)=>{var Re=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Rr=require("path"),jo=Re?";":":",Pr=Tr(),Lr=i=>Object.assign(new Error(`not found: ${i}`),{code:"ENOENT"}),Or=(i,r)=>{let n=r.colon||jo,o=i.match(/\//)||Re&&i.match(/\\/)?[""]:[...Re?[process.cwd()]:[],...(r.path||process.env.PATH||"").split(n)],h=Re?r.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",l=Re?h.split(n):[""];return Re&&i.indexOf(".")!==-1&&l[0]!==""&&l.unshift(""),{pathEnv:o,pathExt:l,pathExtExe:h}},Vr=(i,r,n)=>{typeof r=="function"&&(n=r,r={}),r||(r={});let{pathEnv:o,pathExt:h,pathExtExe:l}=Or(i,r),p=[],m=x=>new Promise((S,v)=>{if(x===o.length)return r.all&&p.length?S(p):v(Lr(i));let b=o[x],E=/^".*"$/.test(b)?b.slice(1,-1):b,N=Rr.join(E,i),q=!E&&/^\.[\\\/]/.test(i)?i.slice(0,2)+N:N;S(g(q,x,0))}),g=(x,S,v)=>new Promise((b,E)=>{if(v===h.length)return b(m(S+1));let N=h[v];Pr(x+N,{pathExt:l},(q,G)=>{if(!q&&G)if(r.all)p.push(x+N);else return b(x+N);return b(g(x,S,v+1))})});return n?m(0).then(x=>n(null,x),n):m(0)},Bo=(i,r)=>{r=r||{};let{pathEnv:n,pathExt:o,pathExtExe:h}=Or(i,r),l=[];for(let p=0;p<n.length;p++){let m=n[p],g=/^".*"$/.test(m)?m.slice(1,-1):m,x=Rr.join(g,i),S=!g&&/^\.[\\\/]/.test(i)?i.slice(0,2)+x:x;for(let v=0;v<o.length;v++){let b=S+o[v];try{if(Pr.sync(b,{pathExt:h}))if(r.all)l.push(b);else return b}catch{}}}if(r.all&&l.length)return l;if(r.nothrow)return null;throw Lr(i)};Fr.exports=Vr;Vr.sync=Bo});var qr=C((Bf,Gt)=>{"use strict";var Dr=(i={})=>{let r=i.env||process.env;return(i.platform||process.platform)!=="win32"?"PATH":Object.keys(r).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};Gt.exports=Dr;Gt.exports.default=Dr});var Mr=C((Uf,Ur)=>{"use strict";var jr=require("path"),Uo=$r(),Mo=qr();function Br(i,r){let n=i.options.env||process.env,o=process.cwd(),h=i.options.cwd!=null,l=h&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(i.options.cwd)}catch{}let p;try{p=Uo.sync(i.command,{path:n[Mo({env:n})],pathExt:r?jr.delimiter:void 0})}catch{}finally{l&&process.chdir(o)}return p&&(p=jr.resolve(h?i.options.cwd:"",p)),p}function Go(i){return Br(i)||Br(i,!0)}Ur.exports=Go});var Gr=C((Mf,Wt)=>{"use strict";var Ht=/([()\][%!^"`<>&|;, *?])/g;function Ho(i){return i=i.replace(Ht,"^$1"),i}function Wo(i,r){return i=`${i}`,i=i.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),i=i.replace(/(?=(\\+?)?)\1$/,"$1$1"),i=`"${i}"`,i=i.replace(Ht,"^$1"),r&&(i=i.replace(Ht,"^$1")),i}Wt.exports.command=Ho;Wt.exports.argument=Wo});var Wr=C((Gf,Hr)=>{"use strict";Hr.exports=/^#!(.*)/});var Xr=C((Hf,zr)=>{"use strict";var zo=Wr();zr.exports=(i="")=>{let r=i.match(zo);if(!r)return null;let[n,o]=r[0].replace(/#! ?/,"").split(" "),h=n.split("/").pop();return h==="env"?o:o?`${h} ${o}`:h}});var Yr=C((Wf,Kr)=>{"use strict";var zt=require("fs"),Xo=Xr();function Ko(i){let n=Buffer.alloc(150),o;try{o=zt.openSync(i,"r"),zt.readSync(o,n,0,150,0),zt.closeSync(o)}catch{}return Xo(n.toString())}Kr.exports=Ko});var es=C((zf,Zr)=>{"use strict";var Yo=require("path"),Jr=Mr(),Qr=Gr(),Jo=Yr(),Qo=process.platform==="win32",Zo=/\.(?:com|exe)$/i,eu=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function tu(i){i.file=Jr(i);let r=i.file&&Jo(i.file);return r?(i.args.unshift(i.file),i.command=r,Jr(i)):i.file}function iu(i){if(!Qo)return i;let r=tu(i),n=!Zo.test(r);if(i.options.forceShell||n){let o=eu.test(r);i.command=Yo.normalize(i.command),i.command=Qr.command(i.command),i.args=i.args.map(l=>Qr.argument(l,o));let h=[i.command].concat(i.args).join(" ");i.args=["/d","/s","/c",`"${h}"`],i.command=process.env.comspec||"cmd.exe",i.options.windowsVerbatimArguments=!0}return i}function ru(i,r,n){r&&!Array.isArray(r)&&(n=r,r=null),r=r?r.slice(0):[],n=Object.assign({},n);let o={command:i,args:r,options:n,file:void 0,original:{command:i,args:r}};return n.shell?o:iu(o)}Zr.exports=ru});var rs=C((Xf,is)=>{"use strict";var Xt=process.platform==="win32";function Kt(i,r){return Object.assign(new Error(`${r} ${i.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${i.command}`,path:i.command,spawnargs:i.args})}function su(i,r){if(!Xt)return;let n=i.emit;i.emit=function(o,h){if(o==="exit"){let l=ts(h,r);if(l)return n.call(i,"error",l)}return n.apply(i,arguments)}}function ts(i,r){return Xt&&i===1&&!r.file?Kt(r.original,"spawn"):null}function nu(i,r){return Xt&&i===1&&!r.file?Kt(r.original,"spawnSync"):null}is.exports={hookChildProcess:su,verifyENOENT:ts,verifyENOENTSync:nu,notFoundError:Kt}});var as=C((Kf,Pe)=>{"use strict";var ss=require("child_process"),Yt=es(),Jt=rs();function ns(i,r,n){let o=Yt(i,r,n),h=ss.spawn(o.command,o.args,o.options);return Jt.hookChildProcess(h,o),h}function au(i,r,n){let o=Yt(i,r,n),h=ss.spawnSync(o.command,o.args,o.options);return h.error=h.error||Jt.verifyENOENTSync(h.status,o),h}Pe.exports=ns;Pe.exports.spawn=ns;Pe.exports.sync=au;Pe.exports._parse=Yt;Pe.exports._enoent=Jt});var Le=C((Yf,os)=>{"use strict";var ou="2.0.0",uu=Number.MAX_SAFE_INTEGER||9007199254740991,cu=16,hu=250,lu=["major","premajor","minor","preminor","patch","prepatch","prerelease"];os.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:cu,MAX_SAFE_BUILD_LENGTH:hu,MAX_SAFE_INTEGER:uu,RELEASE_TYPES:lu,SEMVER_SPEC_VERSION:ou,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var He=C((Jf,us)=>{"use strict";var fu=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...i)=>console.error("SEMVER",...i):()=>{};us.exports=fu});var Oe=C((oe,cs)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Qt,MAX_SAFE_BUILD_LENGTH:pu,MAX_LENGTH:du}=Le(),mu=He();oe=cs.exports={};var xu=oe.re=[],gu=oe.safeRe=[],I=oe.src=[],vu=oe.safeSrc=[],k=oe.t={},yu=0,Zt="[a-zA-Z0-9-]",Eu=[["\\s",1],["\\d",du],[Zt,pu]],bu=i=>{for(let[r,n]of Eu)i=i.split(`${r}*`).join(`${r}{0,${n}}`).split(`${r}+`).join(`${r}{1,${n}}`);return i},P=(i,r,n)=>{let o=bu(r),h=yu++;mu(i,h,r),k[i]=h,I[h]=r,vu[h]=o,xu[h]=new RegExp(r,n?"g":void 0),gu[h]=new RegExp(o,n?"g":void 0)};P("NUMERICIDENTIFIER","0|[1-9]\\d*");P("NUMERICIDENTIFIERLOOSE","\\d+");P("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Zt}*`);P("MAINVERSION",`(${I[k.NUMERICIDENTIFIER]})\\.(${I[k.NUMERICIDENTIFIER]})\\.(${I[k.NUMERICIDENTIFIER]})`);P("MAINVERSIONLOOSE",`(${I[k.NUMERICIDENTIFIERLOOSE]})\\.(${I[k.NUMERICIDENTIFIERLOOSE]})\\.(${I[k.NUMERICIDENTIFIERLOOSE]})`);P("PRERELEASEIDENTIFIER",`(?:${I[k.NONNUMERICIDENTIFIER]}|${I[k.NUMERICIDENTIFIER]})`);P("PRERELEASEIDENTIFIERLOOSE",`(?:${I[k.NONNUMERICIDENTIFIER]}|${I[k.NUMERICIDENTIFIERLOOSE]})`);P("PRERELEASE",`(?:-(${I[k.PRERELEASEIDENTIFIER]}(?:\\.${I[k.PRERELEASEIDENTIFIER]})*))`);P("PRERELEASELOOSE",`(?:-?(${I[k.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${I[k.PRERELEASEIDENTIFIERLOOSE]})*))`);P("BUILDIDENTIFIER",`${Zt}+`);P("BUILD",`(?:\\+(${I[k.BUILDIDENTIFIER]}(?:\\.${I[k.BUILDIDENTIFIER]})*))`);P("FULLPLAIN",`v?${I[k.MAINVERSION]}${I[k.PRERELEASE]}?${I[k.BUILD]}?`);P("FULL",`^${I[k.FULLPLAIN]}$`);P("LOOSEPLAIN",`[v=\\s]*${I[k.MAINVERSIONLOOSE]}${I[k.PRERELEASELOOSE]}?${I[k.BUILD]}?`);P("LOOSE",`^${I[k.LOOSEPLAIN]}$`);P("GTLT","((?:<|>)?=?)");P("XRANGEIDENTIFIERLOOSE",`${I[k.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);P("XRANGEIDENTIFIER",`${I[k.NUMERICIDENTIFIER]}|x|X|\\*`);P("XRANGEPLAIN",`[v=\\s]*(${I[k.XRANGEIDENTIFIER]})(?:\\.(${I[k.XRANGEIDENTIFIER]})(?:\\.(${I[k.XRANGEIDENTIFIER]})(?:${I[k.PRERELEASE]})?${I[k.BUILD]}?)?)?`);P("XRANGEPLAINLOOSE",`[v=\\s]*(${I[k.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[k.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[k.XRANGEIDENTIFIERLOOSE]})(?:${I[k.PRERELEASELOOSE]})?${I[k.BUILD]}?)?)?`);P("XRANGE",`^${I[k.GTLT]}\\s*${I[k.XRANGEPLAIN]}$`);P("XRANGELOOSE",`^${I[k.GTLT]}\\s*${I[k.XRANGEPLAINLOOSE]}$`);P("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Qt}})(?:\\.(\\d{1,${Qt}}))?(?:\\.(\\d{1,${Qt}}))?`);P("COERCE",`${I[k.COERCEPLAIN]}(?:$|[^\\d])`);P("COERCEFULL",I[k.COERCEPLAIN]+`(?:${I[k.PRERELEASE]})?(?:${I[k.BUILD]})?(?:$|[^\\d])`);P("COERCERTL",I[k.COERCE],!0);P("COERCERTLFULL",I[k.COERCEFULL],!0);P("LONETILDE","(?:~>?)");P("TILDETRIM",`(\\s*)${I[k.LONETILDE]}\\s+`,!0);oe.tildeTrimReplace="$1~";P("TILDE",`^${I[k.LONETILDE]}${I[k.XRANGEPLAIN]}$`);P("TILDELOOSE",`^${I[k.LONETILDE]}${I[k.XRANGEPLAINLOOSE]}$`);P("LONECARET","(?:\\^)");P("CARETTRIM",`(\\s*)${I[k.LONECARET]}\\s+`,!0);oe.caretTrimReplace="$1^";P("CARET",`^${I[k.LONECARET]}${I[k.XRANGEPLAIN]}$`);P("CARETLOOSE",`^${I[k.LONECARET]}${I[k.XRANGEPLAINLOOSE]}$`);P("COMPARATORLOOSE",`^${I[k.GTLT]}\\s*(${I[k.LOOSEPLAIN]})$|^$`);P("COMPARATOR",`^${I[k.GTLT]}\\s*(${I[k.FULLPLAIN]})$|^$`);P("COMPARATORTRIM",`(\\s*)${I[k.GTLT]}\\s*(${I[k.LOOSEPLAIN]}|${I[k.XRANGEPLAIN]})`,!0);oe.comparatorTrimReplace="$1$2$3";P("HYPHENRANGE",`^\\s*(${I[k.XRANGEPLAIN]})\\s+-\\s+(${I[k.XRANGEPLAIN]})\\s*$`);P("HYPHENRANGELOOSE",`^\\s*(${I[k.XRANGEPLAINLOOSE]})\\s+-\\s+(${I[k.XRANGEPLAINLOOSE]})\\s*$`);P("STAR","(<|>)?=?\\s*\\*");P("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");P("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var lt=C((Qf,hs)=>{"use strict";var wu=Object.freeze({loose:!0}),Su=Object.freeze({}),Cu=i=>i?typeof i!="object"?wu:i:Su;hs.exports=Cu});var ei=C((Zf,ps)=>{"use strict";var ls=/^[0-9]+$/,fs=(i,r)=>{if(typeof i=="number"&&typeof r=="number")return i===r?0:i<r?-1:1;let n=ls.test(i),o=ls.test(r);return n&&o&&(i=+i,r=+r),i===r?0:n&&!o?-1:o&&!n?1:i<r?-1:1},Iu=(i,r)=>fs(r,i);ps.exports={compareIdentifiers:fs,rcompareIdentifiers:Iu}});var H=C((ep,ms)=>{"use strict";var ft=He(),{MAX_LENGTH:ds,MAX_SAFE_INTEGER:pt}=Le(),{safeRe:dt,t:mt}=Oe(),ku=lt(),{compareIdentifiers:ti}=ei(),_u=(i,r)=>{let n=r.split(".");if(n.length>i.length)return!1;for(let o=0;o<n.length;o++)if(ti(i[o],n[o])!==0)return!1;return!0},ii=class i{constructor(r,n){if(n=ku(n),r instanceof i){if(r.loose===!!n.loose&&r.includePrerelease===!!n.includePrerelease)return r;r=r.version}else if(typeof r!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof r}".`);if(r.length>ds)throw new TypeError(`version is longer than ${ds} characters`);ft("SemVer",r,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let o=r.trim().match(n.loose?dt[mt.LOOSE]:dt[mt.FULL]);if(!o)throw new TypeError(`Invalid Version: ${r}`);if(this.raw=r,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>pt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>pt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>pt||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(h=>{if(/^[0-9]+$/.test(h)){let l=+h;if(l>=0&&l<pt)return l}return h}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(r){if(ft("SemVer.compare",this.version,this.options,r),!(r instanceof i)){if(typeof r=="string"&&r===this.version)return 0;r=new i(r,this.options)}return r.version===this.version?0:this.compareMain(r)||this.comparePre(r)}compareMain(r){return r instanceof i||(r=new i(r,this.options)),this.major<r.major?-1:this.major>r.major?1:this.minor<r.minor?-1:this.minor>r.minor?1:this.patch<r.patch?-1:this.patch>r.patch?1:0}comparePre(r){if(r instanceof i||(r=new i(r,this.options)),this.prerelease.length&&!r.prerelease.length)return-1;if(!this.prerelease.length&&r.prerelease.length)return 1;if(!this.prerelease.length&&!r.prerelease.length)return 0;let n=0;do{let o=this.prerelease[n],h=r.prerelease[n];if(ft("prerelease compare",n,o,h),o===void 0&&h===void 0)return 0;if(h===void 0)return 1;if(o===void 0)return-1;if(o===h)continue;return ti(o,h)}while(++n)}compareBuild(r){r instanceof i||(r=new i(r,this.options));let n=0;do{let o=this.build[n],h=r.build[n];if(ft("build compare",n,o,h),o===void 0&&h===void 0)return 0;if(h===void 0)return 1;if(o===void 0)return-1;if(o===h)continue;return ti(o,h)}while(++n)}inc(r,n,o){if(r.startsWith("pre")){if(!n&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let h=`-${n}`.match(this.options.loose?dt[mt.PRERELEASELOOSE]:dt[mt.PRERELEASE]);if(!h||h[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(r){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,o),this.inc("pre",n,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,o),this.inc("pre",n,o);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let h=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[h];else{let l=this.prerelease.length;for(;--l>=0;)typeof this.prerelease[l]=="number"&&(this.prerelease[l]++,l=-2);if(l===-1){if(n===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(h)}}if(n){let l=[n,h];if(o===!1&&(l=[n]),_u(this.prerelease,n)){let p=this.prerelease[n.split(".").length];isNaN(p)&&(this.prerelease=l)}else this.prerelease=l}break}default:throw new Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};ms.exports=ii});var xe=C((tp,gs)=>{"use strict";var xs=H(),Au=(i,r,n=!1)=>{if(i instanceof xs)return i;try{return new xs(i,r)}catch(o){if(!n)return null;throw o}};gs.exports=Au});var ys=C((ip,vs)=>{"use strict";var Nu=xe(),Tu=(i,r)=>{let n=Nu(i,r);return n?n.version:null};vs.exports=Tu});var bs=C((rp,Es)=>{"use strict";var Ru=xe(),Pu=(i,r)=>{let n=Ru(i.trim().replace(/^[=v]+/,""),r);return n?n.version:null};Es.exports=Pu});var Cs=C((sp,Ss)=>{"use strict";var ws=H(),Lu=(i,r,n,o,h)=>{typeof n=="string"&&(h=o,o=n,n=void 0);try{return new ws(i instanceof ws?i.version:i,n).inc(r,o,h).version}catch{return null}};Ss.exports=Lu});var _s=C((np,ks)=>{"use strict";var Is=xe(),Ou=(i,r)=>{let n=Is(i,null,!0),o=Is(r,null,!0),h=n.compare(o);if(h===0)return null;let l=h>0,p=l?n:o,m=l?o:n,g=!!p.prerelease.length;if(!!m.prerelease.length&&!g){if(!m.patch&&!m.minor)return"major";if(m.compareMain(p)===0)return m.minor&&!m.patch?"minor":"patch"}let S=g?"pre":"";return n.major!==o.major?S+"major":n.minor!==o.minor?S+"minor":n.patch!==o.patch?S+"patch":"prerelease"};ks.exports=Ou});var Ns=C((ap,As)=>{"use strict";var Vu=H(),Fu=(i,r)=>new Vu(i,r).major;As.exports=Fu});var Rs=C((op,Ts)=>{"use strict";var $u=H(),Du=(i,r)=>new $u(i,r).minor;Ts.exports=Du});var Ls=C((up,Ps)=>{"use strict";var qu=H(),ju=(i,r)=>new qu(i,r).patch;Ps.exports=ju});var Vs=C((cp,Os)=>{"use strict";var Bu=xe(),Uu=(i,r)=>{let n=Bu(i,r);return n&&n.prerelease.length?n.prerelease:null};Os.exports=Uu});var ie=C((hp,$s)=>{"use strict";var Fs=H(),Mu=(i,r,n)=>new Fs(i,n).compare(new Fs(r,n));$s.exports=Mu});var qs=C((lp,Ds)=>{"use strict";var Gu=ie(),Hu=(i,r,n)=>Gu(r,i,n);Ds.exports=Hu});var Bs=C((fp,js)=>{"use strict";var Wu=ie(),zu=(i,r)=>Wu(i,r,!0);js.exports=zu});var xt=C((pp,Ms)=>{"use strict";var Us=H(),Xu=(i,r,n)=>{let o=new Us(i,n),h=new Us(r,n);return o.compare(h)||o.compareBuild(h)};Ms.exports=Xu});var Hs=C((dp,Gs)=>{"use strict";var Ku=xt(),Yu=(i,r)=>i.sort((n,o)=>Ku(n,o,r));Gs.exports=Yu});var zs=C((mp,Ws)=>{"use strict";var Ju=xt(),Qu=(i,r)=>i.sort((n,o)=>Ju(o,n,r));Ws.exports=Qu});var We=C((xp,Xs)=>{"use strict";var Zu=ie(),ec=(i,r,n)=>Zu(i,r,n)>0;Xs.exports=ec});var gt=C((gp,Ks)=>{"use strict";var tc=ie(),ic=(i,r,n)=>tc(i,r,n)<0;Ks.exports=ic});var ri=C((vp,Ys)=>{"use strict";var rc=ie(),sc=(i,r,n)=>rc(i,r,n)===0;Ys.exports=sc});var si=C((yp,Js)=>{"use strict";var nc=ie(),ac=(i,r,n)=>nc(i,r,n)!==0;Js.exports=ac});var vt=C((Ep,Qs)=>{"use strict";var oc=ie(),uc=(i,r,n)=>oc(i,r,n)>=0;Qs.exports=uc});var yt=C((bp,Zs)=>{"use strict";var cc=ie(),hc=(i,r,n)=>cc(i,r,n)<=0;Zs.exports=hc});var ni=C((wp,en)=>{"use strict";var lc=ri(),fc=si(),pc=We(),dc=vt(),mc=gt(),xc=yt(),gc=(i,r,n,o)=>{switch(r){case"===":return typeof i=="object"&&(i=i.version),typeof n=="object"&&(n=n.version),i===n;case"!==":return typeof i=="object"&&(i=i.version),typeof n=="object"&&(n=n.version),i!==n;case"":case"=":case"==":return lc(i,n,o);case"!=":return fc(i,n,o);case">":return pc(i,n,o);case">=":return dc(i,n,o);case"<":return mc(i,n,o);case"<=":return xc(i,n,o);default:throw new TypeError(`Invalid operator: ${r}`)}};en.exports=gc});var rn=C((Sp,tn)=>{"use strict";var vc=H(),yc=xe(),{safeRe:Et,t:bt}=Oe(),Ec=(i,r)=>{if(i instanceof vc)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;r=r||{};let n=null;if(!r.rtl)n=i.match(r.includePrerelease?Et[bt.COERCEFULL]:Et[bt.COERCE]);else{let g=r.includePrerelease?Et[bt.COERCERTLFULL]:Et[bt.COERCERTL],x;for(;(x=g.exec(i))&&(!n||n.index+n[0].length!==i.length);)(!n||x.index+x[0].length!==n.index+n[0].length)&&(n=x),g.lastIndex=x.index+x[1].length+x[2].length;g.lastIndex=-1}if(n===null)return null;let o=n[2],h=n[3]||"0",l=n[4]||"0",p=r.includePrerelease&&n[5]?`-${n[5]}`:"",m=r.includePrerelease&&n[6]?`+${n[6]}`:"";return yc(`${o}.${h}.${l}${p}${m}`,r)};tn.exports=Ec});var nn=C((Cp,sn)=>{"use strict";var bc=xe(),wc=Le(),Sc=H(),Cc=(i,r,n)=>{if(!wc.RELEASE_TYPES.includes(r))return null;let o=Ic(i,n);return o&&kc(o,r)},Ic=(i,r)=>{let n=i instanceof Sc?i.version:i;return bc(n,r)},kc=(i,r)=>{if(_c(r))return i.version;switch(i.prerelease=[],r){case"major":i.minor=0,i.patch=0;break;case"minor":i.patch=0;break}return i.format()},_c=i=>i.startsWith("pre");sn.exports=Cc});var on=C((Ip,an)=>{"use strict";var ai=class{constructor(){this.max=1e3,this.map=new Map}get(r){let n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){let h=this.map.keys().next().value;this.delete(h)}this.map.set(r,n)}return this}};an.exports=ai});var re=C((kp,ln)=>{"use strict";var Ac=/\s+/g,oi=class i{constructor(r,n){if(n=Tc(n),r instanceof i)return r.loose===!!n.loose&&r.includePrerelease===!!n.includePrerelease?r:new i(r.raw,n);if(r instanceof ui)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=r.trim().replace(Ac," "),this.set=this.raw.split("||").map(o=>this.parseRange(o.trim())).filter(o=>o.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let o=this.set[0];if(this.set=this.set.filter(h=>!cn(h[0])),this.set.length===0)this.set=[o];else if(this.set.length>1){for(let h of this.set)if(h.length===1&&qc(h[0])){this.set=[h];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let r=0;r<this.set.length;r++){r>0&&(this.formatted+="||");let n=this.set[r];for(let o=0;o<n.length;o++)o>0&&(this.formatted+=" "),this.formatted+=n[o].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(r){r=r.replace(Dc,"");let o=((this.options.includePrerelease&&Fc)|(this.options.loose&&$c))+":"+r,h=un.get(o);if(h)return h;let l=this.options.loose,p=l?Y[W.HYPHENRANGELOOSE]:Y[W.HYPHENRANGE];r=r.replace(p,Yc(this.options.includePrerelease)),D("hyphen replace",r),r=r.replace(Y[W.COMPARATORTRIM],Lc),D("comparator trim",r),r=r.replace(Y[W.TILDETRIM],Oc),D("tilde trim",r),r=r.replace(Y[W.CARETTRIM],Vc),D("caret trim",r);let m=r.split(" ").map(v=>jc(v,this.options)).join(" ").split(/\s+/).map(v=>Kc(v,this.options));l&&(m=m.filter(v=>(D("loose invalid filter",v,this.options),!!v.match(Y[W.COMPARATORLOOSE])))),D("range list",m);let g=new Map,x=m.map(v=>new ui(v,this.options));for(let v of x){if(cn(v))return[v];g.set(v.value,v)}g.size>1&&g.has("")&&g.delete("");let S=[...g.values()];return un.set(o,S),S}intersects(r,n){if(!(r instanceof i))throw new TypeError("a Range is required");return this.set.some(o=>hn(o,n)&&r.set.some(h=>hn(h,n)&&o.every(l=>h.every(p=>l.intersects(p,n)))))}test(r){if(!r)return!1;if(typeof r=="string")try{r=new Rc(r,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(Jc(this.set[n],r,this.options))return!0;return!1}};ln.exports=oi;var Nc=on(),un=new Nc,Tc=lt(),ui=ze(),D=He(),Rc=H(),{safeRe:Y,src:Pc,t:W,comparatorTrimReplace:Lc,tildeTrimReplace:Oc,caretTrimReplace:Vc}=Oe(),{FLAG_INCLUDE_PRERELEASE:Fc,FLAG_LOOSE:$c}=Le(),Dc=new RegExp(Pc[W.BUILD],"g"),cn=i=>i.value==="<0.0.0-0",qc=i=>i.value==="",hn=(i,r)=>{let n=!0,o=i.slice(),h=o.pop();for(;n&&o.length;)n=o.every(l=>h.intersects(l,r)),h=o.pop();return n},jc=(i,r)=>(i=i.replace(Y[W.BUILD],""),D("comp",i,r),i=Gc(i,r),D("caret",i),i=Uc(i,r),D("tildes",i),i=Wc(i,r),D("xrange",i),i=Xc(i,r),D("stars",i),i),U=i=>!i||i.toLowerCase()==="x"||i==="*",Bc=(i,r,n)=>U(i)&&!U(r)||U(r)&&n&&!U(n),Uc=(i,r)=>i.trim().split(/\s+/).map(n=>Mc(n,r)).join(" "),Mc=(i,r)=>{let n=r.loose?Y[W.TILDELOOSE]:Y[W.TILDE],o=r.includePrerelease?"-0":"";return i.replace(n,(h,l,p,m,g)=>{D("tilde",i,h,l,p,m,g);let x;return U(l)?x="":U(p)?x=`>=${l}.0.0${o} <${+l+1}.0.0-0`:U(m)?x=`>=${l}.${p}.0${o} <${l}.${+p+1}.0-0`:g?(D("replaceTilde pr",g),x=`>=${l}.${p}.${m}-${g} <${l}.${+p+1}.0-0`):x=`>=${l}.${p}.${m} <${l}.${+p+1}.0-0`,D("tilde return",x),x})},Gc=(i,r)=>i.trim().split(/\s+/).map(n=>Hc(n,r)).join(" "),Hc=(i,r)=>{D("caret",i,r);let n=r.loose?Y[W.CARETLOOSE]:Y[W.CARET],o=r.includePrerelease?"-0":"";return i.replace(n,(h,l,p,m,g)=>{D("caret",i,h,l,p,m,g);let x;return U(l)?x="":U(p)?x=`>=${l}.0.0${o} <${+l+1}.0.0-0`:U(m)?l==="0"?x=`>=${l}.${p}.0${o} <${l}.${+p+1}.0-0`:x=`>=${l}.${p}.0${o} <${+l+1}.0.0-0`:g?(D("replaceCaret pr",g),l==="0"?p==="0"?x=`>=${l}.${p}.${m}-${g} <${l}.${p}.${+m+1}-0`:x=`>=${l}.${p}.${m}-${g} <${l}.${+p+1}.0-0`:x=`>=${l}.${p}.${m}-${g} <${+l+1}.0.0-0`):(D("no pr"),l==="0"?p==="0"?x=`>=${l}.${p}.${m} <${l}.${p}.${+m+1}-0`:x=`>=${l}.${p}.${m} <${l}.${+p+1}.0-0`:x=`>=${l}.${p}.${m} <${+l+1}.0.0-0`),D("caret return",x),x})},Wc=(i,r)=>(D("replaceXRanges",i,r),i.split(/\s+/).map(n=>zc(n,r)).join(" ")),zc=(i,r)=>{i=i.trim();let n=r.loose?Y[W.XRANGELOOSE]:Y[W.XRANGE];return i.replace(n,(o,h,l,p,m,g)=>{if(D("xRange",i,o,h,l,p,m,g),Bc(l,p,m))return i;let x=U(l),S=x||U(p),v=S||U(m),b=v;return h==="="&&b&&(h=""),g=r.includePrerelease?"-0":"",x?h===">"||h==="<"?o="<0.0.0-0":o="*":h&&b?(S&&(p=0),m=0,h===">"?(h=">=",S?(l=+l+1,p=0,m=0):(p=+p+1,m=0)):h==="<="&&(h="<",S?l=+l+1:p=+p+1),h==="<"&&(g="-0"),o=`${h+l}.${p}.${m}${g}`):S?o=`>=${l}.0.0${g} <${+l+1}.0.0-0`:v&&(o=`>=${l}.${p}.0${g} <${l}.${+p+1}.0-0`),D("xRange return",o),o})},Xc=(i,r)=>(D("replaceStars",i,r),i.trim().replace(Y[W.STAR],"")),Kc=(i,r)=>(D("replaceGTE0",i,r),i.trim().replace(Y[r.includePrerelease?W.GTE0PRE:W.GTE0],"")),Yc=i=>(r,n,o,h,l,p,m,g,x,S,v,b)=>(U(o)?n="":U(h)?n=`>=${o}.0.0${i?"-0":""}`:U(l)?n=`>=${o}.${h}.0${i?"-0":""}`:p?n=`>=${n}`:n=`>=${n}${i?"-0":""}`,U(x)?g="":U(S)?g=`<${+x+1}.0.0-0`:U(v)?g=`<${x}.${+S+1}.0-0`:b?g=`<=${x}.${S}.${v}-${b}`:i?g=`<${x}.${S}.${+v+1}-0`:g=`<=${g}`,`${n} ${g}`.trim()),Jc=(i,r,n)=>{for(let o=0;o<i.length;o++)if(!i[o].test(r))return!1;if(r.prerelease.length&&!n.includePrerelease){for(let o=0;o<i.length;o++)if(D(i[o].semver),i[o].semver!==ui.ANY&&i[o].semver.prerelease.length>0){let h=i[o].semver;if(h.major===r.major&&h.minor===r.minor&&h.patch===r.patch)return!0}return!1}return!0}});var ze=C((_p,gn)=>{"use strict";var Xe=Symbol("SemVer ANY"),li=class i{static get ANY(){return Xe}constructor(r,n){if(n=fn(n),r instanceof i){if(r.loose===!!n.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),hi("comparator",r,n),this.options=n,this.loose=!!n.loose,this.parse(r),this.semver===Xe?this.value="":this.value=this.operator+this.semver.version,hi("comp",this)}parse(r){let n=this.options.loose?pn[dn.COMPARATORLOOSE]:pn[dn.COMPARATOR],o=r.match(n);if(!o)throw new TypeError(`Invalid comparator: ${r}`);this.operator=o[1]!==void 0?o[1]:"",this.operator==="="&&(this.operator=""),o[2]?this.semver=new mn(o[2],this.options.loose):this.semver=Xe}toString(){return this.value}test(r){if(hi("Comparator.test",r,this.options.loose),this.semver===Xe||r===Xe)return!0;if(typeof r=="string")try{r=new mn(r,this.options)}catch{return!1}return ci(r,this.operator,this.semver,this.options)}intersects(r,n){if(!(r instanceof i))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new xn(r.value,n).test(this.value):r.operator===""?r.value===""?!0:new xn(this.value,n).test(r.semver):(n=fn(n),n.includePrerelease&&(this.value==="<0.0.0-0"||r.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||r.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&r.operator.startsWith(">")||this.operator.startsWith("<")&&r.operator.startsWith("<")||this.semver.version===r.semver.version&&this.operator.includes("=")&&r.operator.includes("=")||ci(this.semver,"<",r.semver,n)&&this.operator.startsWith(">")&&r.operator.startsWith("<")||ci(this.semver,">",r.semver,n)&&this.operator.startsWith("<")&&r.operator.startsWith(">")))}};gn.exports=li;var fn=lt(),{safeRe:pn,t:dn}=Oe(),ci=ni(),hi=He(),mn=H(),xn=re()});var Ke=C((Ap,vn)=>{"use strict";var Qc=re(),Zc=(i,r,n)=>{try{r=new Qc(r,n)}catch{return!1}return r.test(i)};vn.exports=Zc});var En=C((Np,yn)=>{"use strict";var eh=re(),th=(i,r)=>new eh(i,r).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));yn.exports=th});var wn=C((Tp,bn)=>{"use strict";var ih=H(),rh=re(),sh=(i,r,n)=>{let o=null,h=null,l=null;try{l=new rh(r,n)}catch{return null}return i.forEach(p=>{l.test(p)&&(!o||h.compare(p)===-1)&&(o=p,h=new ih(o,n))}),o};bn.exports=sh});var Cn=C((Rp,Sn)=>{"use strict";var nh=H(),ah=re(),oh=(i,r,n)=>{let o=null,h=null,l=null;try{l=new ah(r,n)}catch{return null}return i.forEach(p=>{l.test(p)&&(!o||h.compare(p)===1)&&(o=p,h=new nh(o,n))}),o};Sn.exports=oh});var _n=C((Pp,kn)=>{"use strict";var fi=H(),uh=re(),In=We(),ch=(i,r)=>{i=new uh(i,r);let n=new fi("0.0.0");if(i.test(n)||(n=new fi("0.0.0-0"),i.test(n)))return n;n=null;for(let o=0;o<i.set.length;++o){let h=i.set[o],l=null;h.forEach(p=>{let m=new fi(p.semver.version);switch(p.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!l||In(m,l))&&(l=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${p.operator}`)}}),l&&(!n||In(n,l))&&(n=l)}return n&&i.test(n)?n:null};kn.exports=ch});var Nn=C((Lp,An)=>{"use strict";var hh=re(),lh=(i,r)=>{try{return new hh(i,r).range||"*"}catch{return null}};An.exports=lh});var wt=C((Op,Ln)=>{"use strict";var fh=H(),Pn=ze(),{ANY:ph}=Pn,dh=re(),mh=Ke(),Tn=We(),Rn=gt(),xh=yt(),gh=vt(),vh=(i,r,n,o)=>{i=new fh(i,o),r=new dh(r,o);let h,l,p,m,g;switch(n){case">":h=Tn,l=xh,p=Rn,m=">",g=">=";break;case"<":h=Rn,l=gh,p=Tn,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(mh(i,r,o))return!1;for(let x=0;x<r.set.length;++x){let S=r.set[x],v=null,b=null;if(S.forEach(E=>{E.semver===ph&&(E=new Pn(">=0.0.0")),v=v||E,b=b||E,h(E.semver,v.semver,o)?v=E:p(E.semver,b.semver,o)&&(b=E)}),v.operator===m||v.operator===g||(!b.operator||b.operator===m)&&l(i,b.semver))return!1;if(b.operator===g&&p(i,b.semver))return!1}return!0};Ln.exports=vh});var Vn=C((Vp,On)=>{"use strict";var yh=wt(),Eh=(i,r,n)=>yh(i,r,">",n);On.exports=Eh});var $n=C((Fp,Fn)=>{"use strict";var bh=wt(),wh=(i,r,n)=>bh(i,r,"<",n);Fn.exports=wh});var jn=C(($p,qn)=>{"use strict";var Dn=re(),Sh=(i,r,n)=>(i=new Dn(i,n),r=new Dn(r,n),i.intersects(r,n));qn.exports=Sh});var Un=C((Dp,Bn)=>{"use strict";var Ch=Ke(),Ih=ie();Bn.exports=(i,r,n)=>{let o=[],h=null,l=null,p=i.sort((S,v)=>Ih(S,v,n));for(let S of p)Ch(S,r,n)?(l=S,h||(h=S)):(l&&o.push([h,l]),l=null,h=null);h&&o.push([h,null]);let m=[];for(let[S,v]of o)S===v?m.push(S):!v&&S===p[0]?m.push("*"):v?S===p[0]?m.push(`<=${v}`):m.push(`${S} - ${v}`):m.push(`>=${S}`);let g=m.join(" || "),x=typeof r.raw=="string"?r.raw:String(r);return g.length<x.length?g:r}});var Xn=C((qp,zn)=>{"use strict";var Mn=re(),mi=ze(),{ANY:pi}=mi,di=Ke(),xi=ie(),kh=(i,r,n={})=>{if(i===r)return!0;i=new Mn(i,n),r=new Mn(r,n);let o=!1;e:for(let h of i.set){for(let l of r.set){let p=Ah(h,l,n);if(o=o||p!==null,p)continue e}if(o)return!1}return!0},_h=[new mi(">=0.0.0-0")],Gn=[new mi(">=0.0.0")],Ah=(i,r,n)=>{if(i===r)return!0;if(i.length===1&&i[0].semver===pi){if(r.length===1&&r[0].semver===pi)return!0;n.includePrerelease?i=_h:i=Gn}if(r.length===1&&r[0].semver===pi){if(n.includePrerelease)return!0;r=Gn}let o=new Set,h,l;for(let E of i)E.operator===">"||E.operator===">="?h=Hn(h,E,n):E.operator==="<"||E.operator==="<="?l=Wn(l,E,n):o.add(E.semver);if(o.size>1)return null;let p;if(h&&l){if(p=xi(h.semver,l.semver,n),p>0)return null;if(p===0&&(h.operator!==">="||l.operator!=="<="))return null}for(let E of o){if(h&&!di(E,String(h),n)||l&&!di(E,String(l),n))return null;for(let N of r)if(!di(E,String(N),n))return!1;return!0}let m,g,x,S,v=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1,b=h&&!n.includePrerelease&&h.semver.prerelease.length?h.semver:!1;v&&v.prerelease.length===1&&l.operator==="<"&&v.prerelease[0]===0&&(v=!1);for(let E of r){if(S=S||E.operator===">"||E.operator===">=",x=x||E.operator==="<"||E.operator==="<=",h){if(b&&E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===b.major&&E.semver.minor===b.minor&&E.semver.patch===b.patch&&(b=!1),E.operator===">"||E.operator===">="){if(m=Hn(h,E,n),m===E&&m!==h)return!1}else if(h.operator===">="&&!E.test(h.semver))return!1}if(l){if(v&&E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===v.major&&E.semver.minor===v.minor&&E.semver.patch===v.patch&&(v=!1),E.operator==="<"||E.operator==="<="){if(g=Wn(l,E,n),g===E&&g!==l)return!1}else if(l.operator==="<="&&!E.test(l.semver))return!1}if(!E.operator&&(l||h)&&p!==0)return!1}return!(h&&x&&!l&&p!==0||l&&S&&!h&&p!==0||b||v)},Hn=(i,r,n)=>{if(!i)return r;let o=xi(i.semver,r.semver,n);return o>0?i:o<0||r.operator===">"&&i.operator===">="?r:i},Wn=(i,r,n)=>{if(!i)return r;let o=xi(i.semver,r.semver,n);return o<0?i:o>0||r.operator==="<"&&i.operator==="<="?r:i};zn.exports=kh});var Qn=C((jp,Jn)=>{"use strict";var gi=Oe(),Kn=Le(),Nh=H(),Yn=ei(),Th=xe(),Rh=ys(),Ph=bs(),Lh=Cs(),Oh=_s(),Vh=Ns(),Fh=Rs(),$h=Ls(),Dh=Vs(),qh=ie(),jh=qs(),Bh=Bs(),Uh=xt(),Mh=Hs(),Gh=zs(),Hh=We(),Wh=gt(),zh=ri(),Xh=si(),Kh=vt(),Yh=yt(),Jh=ni(),Qh=rn(),Zh=nn(),el=ze(),tl=re(),il=Ke(),rl=En(),sl=wn(),nl=Cn(),al=_n(),ol=Nn(),ul=wt(),cl=Vn(),hl=$n(),ll=jn(),fl=Un(),pl=Xn();Jn.exports={parse:Th,valid:Rh,clean:Ph,inc:Lh,diff:Oh,major:Vh,minor:Fh,patch:$h,prerelease:Dh,compare:qh,rcompare:jh,compareLoose:Bh,compareBuild:Uh,sort:Mh,rsort:Gh,gt:Hh,lt:Wh,eq:zh,neq:Xh,gte:Kh,lte:Yh,cmp:Jh,coerce:Qh,truncate:Zh,Comparator:el,Range:tl,satisfies:il,toComparators:rl,maxSatisfying:sl,minSatisfying:nl,minVersion:al,validRange:ol,outside:ul,gtr:cl,ltr:hl,intersects:ll,simplifyRange:fl,subset:pl,SemVer:Nh,re:gi.re,src:gi.src,tokens:gi.t,SEMVER_SPEC_VERSION:Kn.SEMVER_SPEC_VERSION,RELEASE_TYPES:Kn.RELEASE_TYPES,compareIdentifiers:Yn.compareIdentifiers,rcompareIdentifiers:Yn.rcompareIdentifiers}});var St=C((Bp,Zn)=>{var dl="https://app.frontfriend.dev",ml=".cache/frontfriend",xl={JS:["tokens.js","variables.js","semanticVariables.js","semanticDarkVariables.js","keyframes.js","animations.js","safelist.js","custom.js"],JSON:["fonts.json","icons.json","components-config.json","iconLibrary.json","version.json","versionMetadata.json","metadata.json","base.json","nativeTokens.json"]},gl={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function vl(i){if(!i)return null;try{let r=new URL(i);return r.hostname.startsWith("app.")?`${r.protocol}//${r.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}Zn.exports={DEFAULT_API_URL:dl,CACHE_DIR_NAME:ml,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:xl,ENV_VARS:gl,deriveRegistryFromApiUrl:vl}});var _t=C((Up,ha)=>{var ge=require("fs"),se=require("path"),ta=as(),ne=Qn(),{DEFAULT_API_URL:yl}=St(),ia=["dependencies","devDependencies","optionalDependencies","peerDependencies"];function vi(i){let r=typeof i=="string"&&i.match(/^((?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*)(?:@([^\r\n]+))?$/);if(!r)throw new Error(`Invalid npm dependency: ${String(i)}`);return{name:r[1],version:r[2]}}function yi(i){let r=new Map;for(let n of i){let{name:o,version:h}=vi(n),l=r.get(o);r.set(o,l&&h?ra(o,l,h):h||l)}return r}function ra(i,r,n){if(r===n)return r;let o=ne.validRange(r),h=ne.validRange(n);if(o&&h)try{if(ne.subset(h,o))return n;if(ne.subset(o,h))return r}catch{}throw new Error(`Conflicting registry versions for ${i}: ${r} and ${n}`)}function El(i,r){let n=typeof i=="string"&&ne.validRange(i),o=ne.validRange(r);if(!n||!o)return!1;try{return ne.subset(n,o)}catch{return!1}}function It(i,r){if(El(i,r))return"satisfied";let n=typeof i=="string"&&ne.validRange(i),o=ne.validRange(r);if(!n||!o)return"incomparable";try{let h=ne.minVersion(n),l=ne.minVersion(o);return!h||!l?"incomparable":ne.lt(h,l)?"lower":"newer"}catch{return"incomparable"}}function Ct(i,r){let n=ia.find(o=>Object.hasOwn(i[o]||{},r));return n?{section:n,existing:i[n][r]}:null}function sa(i,r){let n=yi(r);if(n.size===0)return;let o=se.join(i,"package.json"),h=JSON.parse(ge.readFileSync(o,"utf8"));for(let[l,p]of n){let m=Ct(h,l),g=m?.section||"dependencies";h[g]||={};let x=m?.existing;h[g][l]=x===void 0?p||"latest":p&&It(x,p)==="lower"?p:x}ge.writeFileSync(o,`${JSON.stringify(h,null,2)}
1
+ var C=(i,r)=>()=>(r||i((r={exports:{}}).exports,r),r.exports);var Sr=C((Df,wr)=>{wr.exports=br;br.sync=Fo;var yr=require("fs");function Vo(i,r){var n=r.pathExt!==void 0?r.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var o=0;o<n.length;o++){var h=n[o].toLowerCase();if(h&&i.substr(-h.length).toLowerCase()===h)return!0}return!1}function Er(i,r,n){return!i.isSymbolicLink()&&!i.isFile()?!1:Vo(r,n)}function br(i,r,n){yr.stat(i,function(o,h){n(o,o?!1:Er(h,i,r))})}function Fo(i,r){return Er(yr.statSync(i),i,r)}});var Ar=C((qf,_r)=>{_r.exports=Ir;Ir.sync=$o;var Cr=require("fs");function Ir(i,r,n){Cr.stat(i,function(o,h){n(o,o?!1:kr(h,r))})}function $o(i,r){return kr(Cr.statSync(i),r)}function kr(i,r){return i.isFile()&&Do(i,r)}function Do(i,r){var n=i.mode,o=i.uid,h=i.gid,l=r.uid!==void 0?r.uid:process.getuid&&process.getuid(),p=r.gid!==void 0?r.gid:process.getgid&&process.getgid(),m=parseInt("100",8),g=parseInt("010",8),x=parseInt("001",8),S=m|g,v=n&x||n&g&&h===p||n&m&&o===l||n&S&&l===0;return v}});var Tr=C((Bf,Nr)=>{var jf=require("fs"),ht;process.platform==="win32"||global.TESTING_WINDOWS?ht=Sr():ht=Ar();Nr.exports=Mt;Mt.sync=qo;function Mt(i,r,n){if(typeof r=="function"&&(n=r,r={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,h){Mt(i,r||{},function(l,p){l?h(l):o(p)})})}ht(i,r||{},function(o,h){o&&(o.code==="EACCES"||r&&r.ignoreErrors)&&(o=null,h=!1),n(o,h)})}function qo(i,r){try{return ht.sync(i,r||{})}catch(n){if(r&&r.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var $r=C((Uf,Fr)=>{var Re=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Rr=require("path"),jo=Re?";":":",Pr=Tr(),Lr=i=>Object.assign(new Error(`not found: ${i}`),{code:"ENOENT"}),Or=(i,r)=>{let n=r.colon||jo,o=i.match(/\//)||Re&&i.match(/\\/)?[""]:[...Re?[process.cwd()]:[],...(r.path||process.env.PATH||"").split(n)],h=Re?r.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",l=Re?h.split(n):[""];return Re&&i.indexOf(".")!==-1&&l[0]!==""&&l.unshift(""),{pathEnv:o,pathExt:l,pathExtExe:h}},Vr=(i,r,n)=>{typeof r=="function"&&(n=r,r={}),r||(r={});let{pathEnv:o,pathExt:h,pathExtExe:l}=Or(i,r),p=[],m=x=>new Promise((S,v)=>{if(x===o.length)return r.all&&p.length?S(p):v(Lr(i));let b=o[x],E=/^".*"$/.test(b)?b.slice(1,-1):b,N=Rr.join(E,i),q=!E&&/^\.[\\\/]/.test(i)?i.slice(0,2)+N:N;S(g(q,x,0))}),g=(x,S,v)=>new Promise((b,E)=>{if(v===h.length)return b(m(S+1));let N=h[v];Pr(x+N,{pathExt:l},(q,G)=>{if(!q&&G)if(r.all)p.push(x+N);else return b(x+N);return b(g(x,S,v+1))})});return n?m(0).then(x=>n(null,x),n):m(0)},Bo=(i,r)=>{r=r||{};let{pathEnv:n,pathExt:o,pathExtExe:h}=Or(i,r),l=[];for(let p=0;p<n.length;p++){let m=n[p],g=/^".*"$/.test(m)?m.slice(1,-1):m,x=Rr.join(g,i),S=!g&&/^\.[\\\/]/.test(i)?i.slice(0,2)+x:x;for(let v=0;v<o.length;v++){let b=S+o[v];try{if(Pr.sync(b,{pathExt:h}))if(r.all)l.push(b);else return b}catch{}}}if(r.all&&l.length)return l;if(r.nothrow)return null;throw Lr(i)};Fr.exports=Vr;Vr.sync=Bo});var qr=C((Mf,Gt)=>{"use strict";var Dr=(i={})=>{let r=i.env||process.env;return(i.platform||process.platform)!=="win32"?"PATH":Object.keys(r).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};Gt.exports=Dr;Gt.exports.default=Dr});var Mr=C((Gf,Ur)=>{"use strict";var jr=require("path"),Uo=$r(),Mo=qr();function Br(i,r){let n=i.options.env||process.env,o=process.cwd(),h=i.options.cwd!=null,l=h&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(i.options.cwd)}catch{}let p;try{p=Uo.sync(i.command,{path:n[Mo({env:n})],pathExt:r?jr.delimiter:void 0})}catch{}finally{l&&process.chdir(o)}return p&&(p=jr.resolve(h?i.options.cwd:"",p)),p}function Go(i){return Br(i)||Br(i,!0)}Ur.exports=Go});var Gr=C((Hf,Wt)=>{"use strict";var Ht=/([()\][%!^"`<>&|;, *?])/g;function Ho(i){return i=i.replace(Ht,"^$1"),i}function Wo(i,r){return i=`${i}`,i=i.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),i=i.replace(/(?=(\\+?)?)\1$/,"$1$1"),i=`"${i}"`,i=i.replace(Ht,"^$1"),r&&(i=i.replace(Ht,"^$1")),i}Wt.exports.command=Ho;Wt.exports.argument=Wo});var Wr=C((Wf,Hr)=>{"use strict";Hr.exports=/^#!(.*)/});var Xr=C((zf,zr)=>{"use strict";var zo=Wr();zr.exports=(i="")=>{let r=i.match(zo);if(!r)return null;let[n,o]=r[0].replace(/#! ?/,"").split(" "),h=n.split("/").pop();return h==="env"?o:o?`${h} ${o}`:h}});var Yr=C((Xf,Kr)=>{"use strict";var zt=require("fs"),Xo=Xr();function Ko(i){let n=Buffer.alloc(150),o;try{o=zt.openSync(i,"r"),zt.readSync(o,n,0,150,0),zt.closeSync(o)}catch{}return Xo(n.toString())}Kr.exports=Ko});var es=C((Kf,Zr)=>{"use strict";var Yo=require("path"),Jr=Mr(),Qr=Gr(),Jo=Yr(),Qo=process.platform==="win32",Zo=/\.(?:com|exe)$/i,eu=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function tu(i){i.file=Jr(i);let r=i.file&&Jo(i.file);return r?(i.args.unshift(i.file),i.command=r,Jr(i)):i.file}function iu(i){if(!Qo)return i;let r=tu(i),n=!Zo.test(r);if(i.options.forceShell||n){let o=eu.test(r);i.command=Yo.normalize(i.command),i.command=Qr.command(i.command),i.args=i.args.map(l=>Qr.argument(l,o));let h=[i.command].concat(i.args).join(" ");i.args=["/d","/s","/c",`"${h}"`],i.command=process.env.comspec||"cmd.exe",i.options.windowsVerbatimArguments=!0}return i}function ru(i,r,n){r&&!Array.isArray(r)&&(n=r,r=null),r=r?r.slice(0):[],n=Object.assign({},n);let o={command:i,args:r,options:n,file:void 0,original:{command:i,args:r}};return n.shell?o:iu(o)}Zr.exports=ru});var rs=C((Yf,is)=>{"use strict";var Xt=process.platform==="win32";function Kt(i,r){return Object.assign(new Error(`${r} ${i.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${i.command}`,path:i.command,spawnargs:i.args})}function su(i,r){if(!Xt)return;let n=i.emit;i.emit=function(o,h){if(o==="exit"){let l=ts(h,r);if(l)return n.call(i,"error",l)}return n.apply(i,arguments)}}function ts(i,r){return Xt&&i===1&&!r.file?Kt(r.original,"spawn"):null}function nu(i,r){return Xt&&i===1&&!r.file?Kt(r.original,"spawnSync"):null}is.exports={hookChildProcess:su,verifyENOENT:ts,verifyENOENTSync:nu,notFoundError:Kt}});var as=C((Jf,Pe)=>{"use strict";var ss=require("child_process"),Yt=es(),Jt=rs();function ns(i,r,n){let o=Yt(i,r,n),h=ss.spawn(o.command,o.args,o.options);return Jt.hookChildProcess(h,o),h}function au(i,r,n){let o=Yt(i,r,n),h=ss.spawnSync(o.command,o.args,o.options);return h.error=h.error||Jt.verifyENOENTSync(h.status,o),h}Pe.exports=ns;Pe.exports.spawn=ns;Pe.exports.sync=au;Pe.exports._parse=Yt;Pe.exports._enoent=Jt});var Le=C((Qf,os)=>{"use strict";var ou="2.0.0",uu=Number.MAX_SAFE_INTEGER||9007199254740991,cu=16,hu=250,lu=["major","premajor","minor","preminor","patch","prepatch","prerelease"];os.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:cu,MAX_SAFE_BUILD_LENGTH:hu,MAX_SAFE_INTEGER:uu,RELEASE_TYPES:lu,SEMVER_SPEC_VERSION:ou,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var He=C((Zf,us)=>{"use strict";var fu=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...i)=>console.error("SEMVER",...i):()=>{};us.exports=fu});var Oe=C((oe,cs)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Qt,MAX_SAFE_BUILD_LENGTH:pu,MAX_LENGTH:du}=Le(),mu=He();oe=cs.exports={};var xu=oe.re=[],gu=oe.safeRe=[],I=oe.src=[],vu=oe.safeSrc=[],k=oe.t={},yu=0,Zt="[a-zA-Z0-9-]",Eu=[["\\s",1],["\\d",du],[Zt,pu]],bu=i=>{for(let[r,n]of Eu)i=i.split(`${r}*`).join(`${r}{0,${n}}`).split(`${r}+`).join(`${r}{1,${n}}`);return i},P=(i,r,n)=>{let o=bu(r),h=yu++;mu(i,h,r),k[i]=h,I[h]=r,vu[h]=o,xu[h]=new RegExp(r,n?"g":void 0),gu[h]=new RegExp(o,n?"g":void 0)};P("NUMERICIDENTIFIER","0|[1-9]\\d*");P("NUMERICIDENTIFIERLOOSE","\\d+");P("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Zt}*`);P("MAINVERSION",`(${I[k.NUMERICIDENTIFIER]})\\.(${I[k.NUMERICIDENTIFIER]})\\.(${I[k.NUMERICIDENTIFIER]})`);P("MAINVERSIONLOOSE",`(${I[k.NUMERICIDENTIFIERLOOSE]})\\.(${I[k.NUMERICIDENTIFIERLOOSE]})\\.(${I[k.NUMERICIDENTIFIERLOOSE]})`);P("PRERELEASEIDENTIFIER",`(?:${I[k.NONNUMERICIDENTIFIER]}|${I[k.NUMERICIDENTIFIER]})`);P("PRERELEASEIDENTIFIERLOOSE",`(?:${I[k.NONNUMERICIDENTIFIER]}|${I[k.NUMERICIDENTIFIERLOOSE]})`);P("PRERELEASE",`(?:-(${I[k.PRERELEASEIDENTIFIER]}(?:\\.${I[k.PRERELEASEIDENTIFIER]})*))`);P("PRERELEASELOOSE",`(?:-?(${I[k.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${I[k.PRERELEASEIDENTIFIERLOOSE]})*))`);P("BUILDIDENTIFIER",`${Zt}+`);P("BUILD",`(?:\\+(${I[k.BUILDIDENTIFIER]}(?:\\.${I[k.BUILDIDENTIFIER]})*))`);P("FULLPLAIN",`v?${I[k.MAINVERSION]}${I[k.PRERELEASE]}?${I[k.BUILD]}?`);P("FULL",`^${I[k.FULLPLAIN]}$`);P("LOOSEPLAIN",`[v=\\s]*${I[k.MAINVERSIONLOOSE]}${I[k.PRERELEASELOOSE]}?${I[k.BUILD]}?`);P("LOOSE",`^${I[k.LOOSEPLAIN]}$`);P("GTLT","((?:<|>)?=?)");P("XRANGEIDENTIFIERLOOSE",`${I[k.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);P("XRANGEIDENTIFIER",`${I[k.NUMERICIDENTIFIER]}|x|X|\\*`);P("XRANGEPLAIN",`[v=\\s]*(${I[k.XRANGEIDENTIFIER]})(?:\\.(${I[k.XRANGEIDENTIFIER]})(?:\\.(${I[k.XRANGEIDENTIFIER]})(?:${I[k.PRERELEASE]})?${I[k.BUILD]}?)?)?`);P("XRANGEPLAINLOOSE",`[v=\\s]*(${I[k.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[k.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[k.XRANGEIDENTIFIERLOOSE]})(?:${I[k.PRERELEASELOOSE]})?${I[k.BUILD]}?)?)?`);P("XRANGE",`^${I[k.GTLT]}\\s*${I[k.XRANGEPLAIN]}$`);P("XRANGELOOSE",`^${I[k.GTLT]}\\s*${I[k.XRANGEPLAINLOOSE]}$`);P("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Qt}})(?:\\.(\\d{1,${Qt}}))?(?:\\.(\\d{1,${Qt}}))?`);P("COERCE",`${I[k.COERCEPLAIN]}(?:$|[^\\d])`);P("COERCEFULL",I[k.COERCEPLAIN]+`(?:${I[k.PRERELEASE]})?(?:${I[k.BUILD]})?(?:$|[^\\d])`);P("COERCERTL",I[k.COERCE],!0);P("COERCERTLFULL",I[k.COERCEFULL],!0);P("LONETILDE","(?:~>?)");P("TILDETRIM",`(\\s*)${I[k.LONETILDE]}\\s+`,!0);oe.tildeTrimReplace="$1~";P("TILDE",`^${I[k.LONETILDE]}${I[k.XRANGEPLAIN]}$`);P("TILDELOOSE",`^${I[k.LONETILDE]}${I[k.XRANGEPLAINLOOSE]}$`);P("LONECARET","(?:\\^)");P("CARETTRIM",`(\\s*)${I[k.LONECARET]}\\s+`,!0);oe.caretTrimReplace="$1^";P("CARET",`^${I[k.LONECARET]}${I[k.XRANGEPLAIN]}$`);P("CARETLOOSE",`^${I[k.LONECARET]}${I[k.XRANGEPLAINLOOSE]}$`);P("COMPARATORLOOSE",`^${I[k.GTLT]}\\s*(${I[k.LOOSEPLAIN]})$|^$`);P("COMPARATOR",`^${I[k.GTLT]}\\s*(${I[k.FULLPLAIN]})$|^$`);P("COMPARATORTRIM",`(\\s*)${I[k.GTLT]}\\s*(${I[k.LOOSEPLAIN]}|${I[k.XRANGEPLAIN]})`,!0);oe.comparatorTrimReplace="$1$2$3";P("HYPHENRANGE",`^\\s*(${I[k.XRANGEPLAIN]})\\s+-\\s+(${I[k.XRANGEPLAIN]})\\s*$`);P("HYPHENRANGELOOSE",`^\\s*(${I[k.XRANGEPLAINLOOSE]})\\s+-\\s+(${I[k.XRANGEPLAINLOOSE]})\\s*$`);P("STAR","(<|>)?=?\\s*\\*");P("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");P("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var lt=C((ep,hs)=>{"use strict";var wu=Object.freeze({loose:!0}),Su=Object.freeze({}),Cu=i=>i?typeof i!="object"?wu:i:Su;hs.exports=Cu});var ei=C((tp,ps)=>{"use strict";var ls=/^[0-9]+$/,fs=(i,r)=>{if(typeof i=="number"&&typeof r=="number")return i===r?0:i<r?-1:1;let n=ls.test(i),o=ls.test(r);return n&&o&&(i=+i,r=+r),i===r?0:n&&!o?-1:o&&!n?1:i<r?-1:1},Iu=(i,r)=>fs(r,i);ps.exports={compareIdentifiers:fs,rcompareIdentifiers:Iu}});var H=C((ip,ms)=>{"use strict";var ft=He(),{MAX_LENGTH:ds,MAX_SAFE_INTEGER:pt}=Le(),{safeRe:dt,t:mt}=Oe(),ku=lt(),{compareIdentifiers:ti}=ei(),_u=(i,r)=>{let n=r.split(".");if(n.length>i.length)return!1;for(let o=0;o<n.length;o++)if(ti(i[o],n[o])!==0)return!1;return!0},ii=class i{constructor(r,n){if(n=ku(n),r instanceof i){if(r.loose===!!n.loose&&r.includePrerelease===!!n.includePrerelease)return r;r=r.version}else if(typeof r!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof r}".`);if(r.length>ds)throw new TypeError(`version is longer than ${ds} characters`);ft("SemVer",r,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let o=r.trim().match(n.loose?dt[mt.LOOSE]:dt[mt.FULL]);if(!o)throw new TypeError(`Invalid Version: ${r}`);if(this.raw=r,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>pt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>pt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>pt||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(h=>{if(/^[0-9]+$/.test(h)){let l=+h;if(l>=0&&l<pt)return l}return h}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(r){if(ft("SemVer.compare",this.version,this.options,r),!(r instanceof i)){if(typeof r=="string"&&r===this.version)return 0;r=new i(r,this.options)}return r.version===this.version?0:this.compareMain(r)||this.comparePre(r)}compareMain(r){return r instanceof i||(r=new i(r,this.options)),this.major<r.major?-1:this.major>r.major?1:this.minor<r.minor?-1:this.minor>r.minor?1:this.patch<r.patch?-1:this.patch>r.patch?1:0}comparePre(r){if(r instanceof i||(r=new i(r,this.options)),this.prerelease.length&&!r.prerelease.length)return-1;if(!this.prerelease.length&&r.prerelease.length)return 1;if(!this.prerelease.length&&!r.prerelease.length)return 0;let n=0;do{let o=this.prerelease[n],h=r.prerelease[n];if(ft("prerelease compare",n,o,h),o===void 0&&h===void 0)return 0;if(h===void 0)return 1;if(o===void 0)return-1;if(o===h)continue;return ti(o,h)}while(++n)}compareBuild(r){r instanceof i||(r=new i(r,this.options));let n=0;do{let o=this.build[n],h=r.build[n];if(ft("build compare",n,o,h),o===void 0&&h===void 0)return 0;if(h===void 0)return 1;if(o===void 0)return-1;if(o===h)continue;return ti(o,h)}while(++n)}inc(r,n,o){if(r.startsWith("pre")){if(!n&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let h=`-${n}`.match(this.options.loose?dt[mt.PRERELEASELOOSE]:dt[mt.PRERELEASE]);if(!h||h[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(r){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,o),this.inc("pre",n,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,o),this.inc("pre",n,o);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let h=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[h];else{let l=this.prerelease.length;for(;--l>=0;)typeof this.prerelease[l]=="number"&&(this.prerelease[l]++,l=-2);if(l===-1){if(n===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(h)}}if(n){let l=[n,h];if(o===!1&&(l=[n]),_u(this.prerelease,n)){let p=this.prerelease[n.split(".").length];isNaN(p)&&(this.prerelease=l)}else this.prerelease=l}break}default:throw new Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};ms.exports=ii});var xe=C((rp,gs)=>{"use strict";var xs=H(),Au=(i,r,n=!1)=>{if(i instanceof xs)return i;try{return new xs(i,r)}catch(o){if(!n)return null;throw o}};gs.exports=Au});var ys=C((sp,vs)=>{"use strict";var Nu=xe(),Tu=(i,r)=>{let n=Nu(i,r);return n?n.version:null};vs.exports=Tu});var bs=C((np,Es)=>{"use strict";var Ru=xe(),Pu=(i,r)=>{let n=Ru(i.trim().replace(/^[=v]+/,""),r);return n?n.version:null};Es.exports=Pu});var Cs=C((ap,Ss)=>{"use strict";var ws=H(),Lu=(i,r,n,o,h)=>{typeof n=="string"&&(h=o,o=n,n=void 0);try{return new ws(i instanceof ws?i.version:i,n).inc(r,o,h).version}catch{return null}};Ss.exports=Lu});var _s=C((op,ks)=>{"use strict";var Is=xe(),Ou=(i,r)=>{let n=Is(i,null,!0),o=Is(r,null,!0),h=n.compare(o);if(h===0)return null;let l=h>0,p=l?n:o,m=l?o:n,g=!!p.prerelease.length;if(!!m.prerelease.length&&!g){if(!m.patch&&!m.minor)return"major";if(m.compareMain(p)===0)return m.minor&&!m.patch?"minor":"patch"}let S=g?"pre":"";return n.major!==o.major?S+"major":n.minor!==o.minor?S+"minor":n.patch!==o.patch?S+"patch":"prerelease"};ks.exports=Ou});var Ns=C((up,As)=>{"use strict";var Vu=H(),Fu=(i,r)=>new Vu(i,r).major;As.exports=Fu});var Rs=C((cp,Ts)=>{"use strict";var $u=H(),Du=(i,r)=>new $u(i,r).minor;Ts.exports=Du});var Ls=C((hp,Ps)=>{"use strict";var qu=H(),ju=(i,r)=>new qu(i,r).patch;Ps.exports=ju});var Vs=C((lp,Os)=>{"use strict";var Bu=xe(),Uu=(i,r)=>{let n=Bu(i,r);return n&&n.prerelease.length?n.prerelease:null};Os.exports=Uu});var ie=C((fp,$s)=>{"use strict";var Fs=H(),Mu=(i,r,n)=>new Fs(i,n).compare(new Fs(r,n));$s.exports=Mu});var qs=C((pp,Ds)=>{"use strict";var Gu=ie(),Hu=(i,r,n)=>Gu(r,i,n);Ds.exports=Hu});var Bs=C((dp,js)=>{"use strict";var Wu=ie(),zu=(i,r)=>Wu(i,r,!0);js.exports=zu});var xt=C((mp,Ms)=>{"use strict";var Us=H(),Xu=(i,r,n)=>{let o=new Us(i,n),h=new Us(r,n);return o.compare(h)||o.compareBuild(h)};Ms.exports=Xu});var Hs=C((xp,Gs)=>{"use strict";var Ku=xt(),Yu=(i,r)=>i.sort((n,o)=>Ku(n,o,r));Gs.exports=Yu});var zs=C((gp,Ws)=>{"use strict";var Ju=xt(),Qu=(i,r)=>i.sort((n,o)=>Ju(o,n,r));Ws.exports=Qu});var We=C((vp,Xs)=>{"use strict";var Zu=ie(),ec=(i,r,n)=>Zu(i,r,n)>0;Xs.exports=ec});var gt=C((yp,Ks)=>{"use strict";var tc=ie(),ic=(i,r,n)=>tc(i,r,n)<0;Ks.exports=ic});var ri=C((Ep,Ys)=>{"use strict";var rc=ie(),sc=(i,r,n)=>rc(i,r,n)===0;Ys.exports=sc});var si=C((bp,Js)=>{"use strict";var nc=ie(),ac=(i,r,n)=>nc(i,r,n)!==0;Js.exports=ac});var vt=C((wp,Qs)=>{"use strict";var oc=ie(),uc=(i,r,n)=>oc(i,r,n)>=0;Qs.exports=uc});var yt=C((Sp,Zs)=>{"use strict";var cc=ie(),hc=(i,r,n)=>cc(i,r,n)<=0;Zs.exports=hc});var ni=C((Cp,en)=>{"use strict";var lc=ri(),fc=si(),pc=We(),dc=vt(),mc=gt(),xc=yt(),gc=(i,r,n,o)=>{switch(r){case"===":return typeof i=="object"&&(i=i.version),typeof n=="object"&&(n=n.version),i===n;case"!==":return typeof i=="object"&&(i=i.version),typeof n=="object"&&(n=n.version),i!==n;case"":case"=":case"==":return lc(i,n,o);case"!=":return fc(i,n,o);case">":return pc(i,n,o);case">=":return dc(i,n,o);case"<":return mc(i,n,o);case"<=":return xc(i,n,o);default:throw new TypeError(`Invalid operator: ${r}`)}};en.exports=gc});var rn=C((Ip,tn)=>{"use strict";var vc=H(),yc=xe(),{safeRe:Et,t:bt}=Oe(),Ec=(i,r)=>{if(i instanceof vc)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;r=r||{};let n=null;if(!r.rtl)n=i.match(r.includePrerelease?Et[bt.COERCEFULL]:Et[bt.COERCE]);else{let g=r.includePrerelease?Et[bt.COERCERTLFULL]:Et[bt.COERCERTL],x;for(;(x=g.exec(i))&&(!n||n.index+n[0].length!==i.length);)(!n||x.index+x[0].length!==n.index+n[0].length)&&(n=x),g.lastIndex=x.index+x[1].length+x[2].length;g.lastIndex=-1}if(n===null)return null;let o=n[2],h=n[3]||"0",l=n[4]||"0",p=r.includePrerelease&&n[5]?`-${n[5]}`:"",m=r.includePrerelease&&n[6]?`+${n[6]}`:"";return yc(`${o}.${h}.${l}${p}${m}`,r)};tn.exports=Ec});var nn=C((kp,sn)=>{"use strict";var bc=xe(),wc=Le(),Sc=H(),Cc=(i,r,n)=>{if(!wc.RELEASE_TYPES.includes(r))return null;let o=Ic(i,n);return o&&kc(o,r)},Ic=(i,r)=>{let n=i instanceof Sc?i.version:i;return bc(n,r)},kc=(i,r)=>{if(_c(r))return i.version;switch(i.prerelease=[],r){case"major":i.minor=0,i.patch=0;break;case"minor":i.patch=0;break}return i.format()},_c=i=>i.startsWith("pre");sn.exports=Cc});var on=C((_p,an)=>{"use strict";var ai=class{constructor(){this.max=1e3,this.map=new Map}get(r){let n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){let h=this.map.keys().next().value;this.delete(h)}this.map.set(r,n)}return this}};an.exports=ai});var re=C((Ap,ln)=>{"use strict";var Ac=/\s+/g,oi=class i{constructor(r,n){if(n=Tc(n),r instanceof i)return r.loose===!!n.loose&&r.includePrerelease===!!n.includePrerelease?r:new i(r.raw,n);if(r instanceof ui)return this.raw=r.value,this.set=[[r]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=r.trim().replace(Ac," "),this.set=this.raw.split("||").map(o=>this.parseRange(o.trim())).filter(o=>o.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let o=this.set[0];if(this.set=this.set.filter(h=>!cn(h[0])),this.set.length===0)this.set=[o];else if(this.set.length>1){for(let h of this.set)if(h.length===1&&qc(h[0])){this.set=[h];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let r=0;r<this.set.length;r++){r>0&&(this.formatted+="||");let n=this.set[r];for(let o=0;o<n.length;o++)o>0&&(this.formatted+=" "),this.formatted+=n[o].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(r){r=r.replace(Dc,"");let o=((this.options.includePrerelease&&Fc)|(this.options.loose&&$c))+":"+r,h=un.get(o);if(h)return h;let l=this.options.loose,p=l?Y[W.HYPHENRANGELOOSE]:Y[W.HYPHENRANGE];r=r.replace(p,Yc(this.options.includePrerelease)),D("hyphen replace",r),r=r.replace(Y[W.COMPARATORTRIM],Lc),D("comparator trim",r),r=r.replace(Y[W.TILDETRIM],Oc),D("tilde trim",r),r=r.replace(Y[W.CARETTRIM],Vc),D("caret trim",r);let m=r.split(" ").map(v=>jc(v,this.options)).join(" ").split(/\s+/).map(v=>Kc(v,this.options));l&&(m=m.filter(v=>(D("loose invalid filter",v,this.options),!!v.match(Y[W.COMPARATORLOOSE])))),D("range list",m);let g=new Map,x=m.map(v=>new ui(v,this.options));for(let v of x){if(cn(v))return[v];g.set(v.value,v)}g.size>1&&g.has("")&&g.delete("");let S=[...g.values()];return un.set(o,S),S}intersects(r,n){if(!(r instanceof i))throw new TypeError("a Range is required");return this.set.some(o=>hn(o,n)&&r.set.some(h=>hn(h,n)&&o.every(l=>h.every(p=>l.intersects(p,n)))))}test(r){if(!r)return!1;if(typeof r=="string")try{r=new Rc(r,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(Jc(this.set[n],r,this.options))return!0;return!1}};ln.exports=oi;var Nc=on(),un=new Nc,Tc=lt(),ui=ze(),D=He(),Rc=H(),{safeRe:Y,src:Pc,t:W,comparatorTrimReplace:Lc,tildeTrimReplace:Oc,caretTrimReplace:Vc}=Oe(),{FLAG_INCLUDE_PRERELEASE:Fc,FLAG_LOOSE:$c}=Le(),Dc=new RegExp(Pc[W.BUILD],"g"),cn=i=>i.value==="<0.0.0-0",qc=i=>i.value==="",hn=(i,r)=>{let n=!0,o=i.slice(),h=o.pop();for(;n&&o.length;)n=o.every(l=>h.intersects(l,r)),h=o.pop();return n},jc=(i,r)=>(i=i.replace(Y[W.BUILD],""),D("comp",i,r),i=Gc(i,r),D("caret",i),i=Uc(i,r),D("tildes",i),i=Wc(i,r),D("xrange",i),i=Xc(i,r),D("stars",i),i),U=i=>!i||i.toLowerCase()==="x"||i==="*",Bc=(i,r,n)=>U(i)&&!U(r)||U(r)&&n&&!U(n),Uc=(i,r)=>i.trim().split(/\s+/).map(n=>Mc(n,r)).join(" "),Mc=(i,r)=>{let n=r.loose?Y[W.TILDELOOSE]:Y[W.TILDE],o=r.includePrerelease?"-0":"";return i.replace(n,(h,l,p,m,g)=>{D("tilde",i,h,l,p,m,g);let x;return U(l)?x="":U(p)?x=`>=${l}.0.0${o} <${+l+1}.0.0-0`:U(m)?x=`>=${l}.${p}.0${o} <${l}.${+p+1}.0-0`:g?(D("replaceTilde pr",g),x=`>=${l}.${p}.${m}-${g} <${l}.${+p+1}.0-0`):x=`>=${l}.${p}.${m} <${l}.${+p+1}.0-0`,D("tilde return",x),x})},Gc=(i,r)=>i.trim().split(/\s+/).map(n=>Hc(n,r)).join(" "),Hc=(i,r)=>{D("caret",i,r);let n=r.loose?Y[W.CARETLOOSE]:Y[W.CARET],o=r.includePrerelease?"-0":"";return i.replace(n,(h,l,p,m,g)=>{D("caret",i,h,l,p,m,g);let x;return U(l)?x="":U(p)?x=`>=${l}.0.0${o} <${+l+1}.0.0-0`:U(m)?l==="0"?x=`>=${l}.${p}.0${o} <${l}.${+p+1}.0-0`:x=`>=${l}.${p}.0${o} <${+l+1}.0.0-0`:g?(D("replaceCaret pr",g),l==="0"?p==="0"?x=`>=${l}.${p}.${m}-${g} <${l}.${p}.${+m+1}-0`:x=`>=${l}.${p}.${m}-${g} <${l}.${+p+1}.0-0`:x=`>=${l}.${p}.${m}-${g} <${+l+1}.0.0-0`):(D("no pr"),l==="0"?p==="0"?x=`>=${l}.${p}.${m} <${l}.${p}.${+m+1}-0`:x=`>=${l}.${p}.${m} <${l}.${+p+1}.0-0`:x=`>=${l}.${p}.${m} <${+l+1}.0.0-0`),D("caret return",x),x})},Wc=(i,r)=>(D("replaceXRanges",i,r),i.split(/\s+/).map(n=>zc(n,r)).join(" ")),zc=(i,r)=>{i=i.trim();let n=r.loose?Y[W.XRANGELOOSE]:Y[W.XRANGE];return i.replace(n,(o,h,l,p,m,g)=>{if(D("xRange",i,o,h,l,p,m,g),Bc(l,p,m))return i;let x=U(l),S=x||U(p),v=S||U(m),b=v;return h==="="&&b&&(h=""),g=r.includePrerelease?"-0":"",x?h===">"||h==="<"?o="<0.0.0-0":o="*":h&&b?(S&&(p=0),m=0,h===">"?(h=">=",S?(l=+l+1,p=0,m=0):(p=+p+1,m=0)):h==="<="&&(h="<",S?l=+l+1:p=+p+1),h==="<"&&(g="-0"),o=`${h+l}.${p}.${m}${g}`):S?o=`>=${l}.0.0${g} <${+l+1}.0.0-0`:v&&(o=`>=${l}.${p}.0${g} <${l}.${+p+1}.0-0`),D("xRange return",o),o})},Xc=(i,r)=>(D("replaceStars",i,r),i.trim().replace(Y[W.STAR],"")),Kc=(i,r)=>(D("replaceGTE0",i,r),i.trim().replace(Y[r.includePrerelease?W.GTE0PRE:W.GTE0],"")),Yc=i=>(r,n,o,h,l,p,m,g,x,S,v,b)=>(U(o)?n="":U(h)?n=`>=${o}.0.0${i?"-0":""}`:U(l)?n=`>=${o}.${h}.0${i?"-0":""}`:p?n=`>=${n}`:n=`>=${n}${i?"-0":""}`,U(x)?g="":U(S)?g=`<${+x+1}.0.0-0`:U(v)?g=`<${x}.${+S+1}.0-0`:b?g=`<=${x}.${S}.${v}-${b}`:i?g=`<${x}.${S}.${+v+1}-0`:g=`<=${g}`,`${n} ${g}`.trim()),Jc=(i,r,n)=>{for(let o=0;o<i.length;o++)if(!i[o].test(r))return!1;if(r.prerelease.length&&!n.includePrerelease){for(let o=0;o<i.length;o++)if(D(i[o].semver),i[o].semver!==ui.ANY&&i[o].semver.prerelease.length>0){let h=i[o].semver;if(h.major===r.major&&h.minor===r.minor&&h.patch===r.patch)return!0}return!1}return!0}});var ze=C((Np,gn)=>{"use strict";var Xe=Symbol("SemVer ANY"),li=class i{static get ANY(){return Xe}constructor(r,n){if(n=fn(n),r instanceof i){if(r.loose===!!n.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),hi("comparator",r,n),this.options=n,this.loose=!!n.loose,this.parse(r),this.semver===Xe?this.value="":this.value=this.operator+this.semver.version,hi("comp",this)}parse(r){let n=this.options.loose?pn[dn.COMPARATORLOOSE]:pn[dn.COMPARATOR],o=r.match(n);if(!o)throw new TypeError(`Invalid comparator: ${r}`);this.operator=o[1]!==void 0?o[1]:"",this.operator==="="&&(this.operator=""),o[2]?this.semver=new mn(o[2],this.options.loose):this.semver=Xe}toString(){return this.value}test(r){if(hi("Comparator.test",r,this.options.loose),this.semver===Xe||r===Xe)return!0;if(typeof r=="string")try{r=new mn(r,this.options)}catch{return!1}return ci(r,this.operator,this.semver,this.options)}intersects(r,n){if(!(r instanceof i))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new xn(r.value,n).test(this.value):r.operator===""?r.value===""?!0:new xn(this.value,n).test(r.semver):(n=fn(n),n.includePrerelease&&(this.value==="<0.0.0-0"||r.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||r.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&r.operator.startsWith(">")||this.operator.startsWith("<")&&r.operator.startsWith("<")||this.semver.version===r.semver.version&&this.operator.includes("=")&&r.operator.includes("=")||ci(this.semver,"<",r.semver,n)&&this.operator.startsWith(">")&&r.operator.startsWith("<")||ci(this.semver,">",r.semver,n)&&this.operator.startsWith("<")&&r.operator.startsWith(">")))}};gn.exports=li;var fn=lt(),{safeRe:pn,t:dn}=Oe(),ci=ni(),hi=He(),mn=H(),xn=re()});var Ke=C((Tp,vn)=>{"use strict";var Qc=re(),Zc=(i,r,n)=>{try{r=new Qc(r,n)}catch{return!1}return r.test(i)};vn.exports=Zc});var En=C((Rp,yn)=>{"use strict";var eh=re(),th=(i,r)=>new eh(i,r).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));yn.exports=th});var wn=C((Pp,bn)=>{"use strict";var ih=H(),rh=re(),sh=(i,r,n)=>{let o=null,h=null,l=null;try{l=new rh(r,n)}catch{return null}return i.forEach(p=>{l.test(p)&&(!o||h.compare(p)===-1)&&(o=p,h=new ih(o,n))}),o};bn.exports=sh});var Cn=C((Lp,Sn)=>{"use strict";var nh=H(),ah=re(),oh=(i,r,n)=>{let o=null,h=null,l=null;try{l=new ah(r,n)}catch{return null}return i.forEach(p=>{l.test(p)&&(!o||h.compare(p)===1)&&(o=p,h=new nh(o,n))}),o};Sn.exports=oh});var _n=C((Op,kn)=>{"use strict";var fi=H(),uh=re(),In=We(),ch=(i,r)=>{i=new uh(i,r);let n=new fi("0.0.0");if(i.test(n)||(n=new fi("0.0.0-0"),i.test(n)))return n;n=null;for(let o=0;o<i.set.length;++o){let h=i.set[o],l=null;h.forEach(p=>{let m=new fi(p.semver.version);switch(p.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!l||In(m,l))&&(l=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${p.operator}`)}}),l&&(!n||In(n,l))&&(n=l)}return n&&i.test(n)?n:null};kn.exports=ch});var Nn=C((Vp,An)=>{"use strict";var hh=re(),lh=(i,r)=>{try{return new hh(i,r).range||"*"}catch{return null}};An.exports=lh});var wt=C((Fp,Ln)=>{"use strict";var fh=H(),Pn=ze(),{ANY:ph}=Pn,dh=re(),mh=Ke(),Tn=We(),Rn=gt(),xh=yt(),gh=vt(),vh=(i,r,n,o)=>{i=new fh(i,o),r=new dh(r,o);let h,l,p,m,g;switch(n){case">":h=Tn,l=xh,p=Rn,m=">",g=">=";break;case"<":h=Rn,l=gh,p=Tn,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(mh(i,r,o))return!1;for(let x=0;x<r.set.length;++x){let S=r.set[x],v=null,b=null;if(S.forEach(E=>{E.semver===ph&&(E=new Pn(">=0.0.0")),v=v||E,b=b||E,h(E.semver,v.semver,o)?v=E:p(E.semver,b.semver,o)&&(b=E)}),v.operator===m||v.operator===g||(!b.operator||b.operator===m)&&l(i,b.semver))return!1;if(b.operator===g&&p(i,b.semver))return!1}return!0};Ln.exports=vh});var Vn=C(($p,On)=>{"use strict";var yh=wt(),Eh=(i,r,n)=>yh(i,r,">",n);On.exports=Eh});var $n=C((Dp,Fn)=>{"use strict";var bh=wt(),wh=(i,r,n)=>bh(i,r,"<",n);Fn.exports=wh});var jn=C((qp,qn)=>{"use strict";var Dn=re(),Sh=(i,r,n)=>(i=new Dn(i,n),r=new Dn(r,n),i.intersects(r,n));qn.exports=Sh});var Un=C((jp,Bn)=>{"use strict";var Ch=Ke(),Ih=ie();Bn.exports=(i,r,n)=>{let o=[],h=null,l=null,p=i.sort((S,v)=>Ih(S,v,n));for(let S of p)Ch(S,r,n)?(l=S,h||(h=S)):(l&&o.push([h,l]),l=null,h=null);h&&o.push([h,null]);let m=[];for(let[S,v]of o)S===v?m.push(S):!v&&S===p[0]?m.push("*"):v?S===p[0]?m.push(`<=${v}`):m.push(`${S} - ${v}`):m.push(`>=${S}`);let g=m.join(" || "),x=typeof r.raw=="string"?r.raw:String(r);return g.length<x.length?g:r}});var Xn=C((Bp,zn)=>{"use strict";var Mn=re(),mi=ze(),{ANY:pi}=mi,di=Ke(),xi=ie(),kh=(i,r,n={})=>{if(i===r)return!0;i=new Mn(i,n),r=new Mn(r,n);let o=!1;e:for(let h of i.set){for(let l of r.set){let p=Ah(h,l,n);if(o=o||p!==null,p)continue e}if(o)return!1}return!0},_h=[new mi(">=0.0.0-0")],Gn=[new mi(">=0.0.0")],Ah=(i,r,n)=>{if(i===r)return!0;if(i.length===1&&i[0].semver===pi){if(r.length===1&&r[0].semver===pi)return!0;n.includePrerelease?i=_h:i=Gn}if(r.length===1&&r[0].semver===pi){if(n.includePrerelease)return!0;r=Gn}let o=new Set,h,l;for(let E of i)E.operator===">"||E.operator===">="?h=Hn(h,E,n):E.operator==="<"||E.operator==="<="?l=Wn(l,E,n):o.add(E.semver);if(o.size>1)return null;let p;if(h&&l){if(p=xi(h.semver,l.semver,n),p>0)return null;if(p===0&&(h.operator!==">="||l.operator!=="<="))return null}for(let E of o){if(h&&!di(E,String(h),n)||l&&!di(E,String(l),n))return null;for(let N of r)if(!di(E,String(N),n))return!1;return!0}let m,g,x,S,v=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1,b=h&&!n.includePrerelease&&h.semver.prerelease.length?h.semver:!1;v&&v.prerelease.length===1&&l.operator==="<"&&v.prerelease[0]===0&&(v=!1);for(let E of r){if(S=S||E.operator===">"||E.operator===">=",x=x||E.operator==="<"||E.operator==="<=",h){if(b&&E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===b.major&&E.semver.minor===b.minor&&E.semver.patch===b.patch&&(b=!1),E.operator===">"||E.operator===">="){if(m=Hn(h,E,n),m===E&&m!==h)return!1}else if(h.operator===">="&&!E.test(h.semver))return!1}if(l){if(v&&E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===v.major&&E.semver.minor===v.minor&&E.semver.patch===v.patch&&(v=!1),E.operator==="<"||E.operator==="<="){if(g=Wn(l,E,n),g===E&&g!==l)return!1}else if(l.operator==="<="&&!E.test(l.semver))return!1}if(!E.operator&&(l||h)&&p!==0)return!1}return!(h&&x&&!l&&p!==0||l&&S&&!h&&p!==0||b||v)},Hn=(i,r,n)=>{if(!i)return r;let o=xi(i.semver,r.semver,n);return o>0?i:o<0||r.operator===">"&&i.operator===">="?r:i},Wn=(i,r,n)=>{if(!i)return r;let o=xi(i.semver,r.semver,n);return o<0?i:o>0||r.operator==="<"&&i.operator==="<="?r:i};zn.exports=kh});var Qn=C((Up,Jn)=>{"use strict";var gi=Oe(),Kn=Le(),Nh=H(),Yn=ei(),Th=xe(),Rh=ys(),Ph=bs(),Lh=Cs(),Oh=_s(),Vh=Ns(),Fh=Rs(),$h=Ls(),Dh=Vs(),qh=ie(),jh=qs(),Bh=Bs(),Uh=xt(),Mh=Hs(),Gh=zs(),Hh=We(),Wh=gt(),zh=ri(),Xh=si(),Kh=vt(),Yh=yt(),Jh=ni(),Qh=rn(),Zh=nn(),el=ze(),tl=re(),il=Ke(),rl=En(),sl=wn(),nl=Cn(),al=_n(),ol=Nn(),ul=wt(),cl=Vn(),hl=$n(),ll=jn(),fl=Un(),pl=Xn();Jn.exports={parse:Th,valid:Rh,clean:Ph,inc:Lh,diff:Oh,major:Vh,minor:Fh,patch:$h,prerelease:Dh,compare:qh,rcompare:jh,compareLoose:Bh,compareBuild:Uh,sort:Mh,rsort:Gh,gt:Hh,lt:Wh,eq:zh,neq:Xh,gte:Kh,lte:Yh,cmp:Jh,coerce:Qh,truncate:Zh,Comparator:el,Range:tl,satisfies:il,toComparators:rl,maxSatisfying:sl,minSatisfying:nl,minVersion:al,validRange:ol,outside:ul,gtr:cl,ltr:hl,intersects:ll,simplifyRange:fl,subset:pl,SemVer:Nh,re:gi.re,src:gi.src,tokens:gi.t,SEMVER_SPEC_VERSION:Kn.SEMVER_SPEC_VERSION,RELEASE_TYPES:Kn.RELEASE_TYPES,compareIdentifiers:Yn.compareIdentifiers,rcompareIdentifiers:Yn.rcompareIdentifiers}});var St=C((Mp,Zn)=>{var dl="https://app.frontfriend.dev",ml=".cache/frontfriend",xl={JS:["tokens.js","variables.js","semanticVariables.js","semanticDarkVariables.js","keyframes.js","animations.js","safelist.js","custom.js"],JSON:["fonts.json","icons.json","components-config.json","iconLibrary.json","version.json","versionMetadata.json","metadata.json","base.json","nativeTokens.json"]},gl={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function vl(i){if(!i)return null;try{let r=new URL(i);return r.hostname.startsWith("app.")?`${r.protocol}//${r.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}Zn.exports={DEFAULT_API_URL:dl,CACHE_DIR_NAME:ml,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:xl,ENV_VARS:gl,deriveRegistryFromApiUrl:vl}});var _t=C((Gp,ha)=>{var ge=require("fs"),se=require("path"),ta=as(),ne=Qn(),{DEFAULT_API_URL:yl}=St(),ia=["dependencies","devDependencies","optionalDependencies","peerDependencies"];function vi(i){let r=typeof i=="string"&&i.match(/^((?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*)(?:@([^\r\n]+))?$/);if(!r)throw new Error(`Invalid npm dependency: ${String(i)}`);return{name:r[1],version:r[2]}}function yi(i){let r=new Map;for(let n of i){let{name:o,version:h}=vi(n),l=r.get(o);r.set(o,l&&h?ra(o,l,h):h||l)}return r}function ra(i,r,n){if(r===n)return r;let o=ne.validRange(r),h=ne.validRange(n);if(o&&h)try{if(ne.subset(h,o))return n;if(ne.subset(o,h))return r}catch{}throw new Error(`Conflicting registry versions for ${i}: ${r} and ${n}`)}function El(i,r){let n=typeof i=="string"&&ne.validRange(i),o=ne.validRange(r);if(!n||!o)return!1;try{return ne.subset(n,o)}catch{return!1}}function It(i,r){if(El(i,r))return"satisfied";let n=typeof i=="string"&&ne.validRange(i),o=ne.validRange(r);if(!n||!o)return"incomparable";try{let h=ne.minVersion(n),l=ne.minVersion(o);return!h||!l?"incomparable":ne.lt(h,l)?"lower":"newer"}catch{return"incomparable"}}function Ct(i,r){let n=ia.find(o=>Object.hasOwn(i[o]||{},r));return n?{section:n,existing:i[n][r]}:null}function sa(i,r){let n=yi(r);if(n.size===0)return;let o=se.join(i,"package.json"),h=JSON.parse(ge.readFileSync(o,"utf8"));for(let[l,p]of n){let m=Ct(h,l),g=m?.section||"dependencies";h[g]||={};let x=m?.existing;h[g][l]=x===void 0?p||"latest":p&&It(x,p)==="lower"?p:x}ge.writeFileSync(o,`${JSON.stringify(h,null,2)}
2
2
  `)}function kt(i){let r=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"]];for(let n=se.resolve(i);;n=se.dirname(n)){let o=se.join(n,"package.json");if(ge.existsSync(o)){let h=JSON.parse(ge.readFileSync(o,"utf8")),l=String(h.packageManager||"").split("@")[0];if(["npm","pnpm","yarn","bun"].includes(l))return l}for(let[h,l]of r)if(ge.existsSync(se.join(n,h)))return l;if(se.dirname(n)===n)return"npm"}}var ea={npm:"npx",pnpm:"pnpm exec",yarn:"yarn",bun:"bunx"};function na(i,r=process.cwd()){let n;try{n=kt(r)}catch{n="npm"}return`${ea[n]||ea.npm} frontfriend ${i}`}function bl(i,r=process.cwd()){let n=null;try{n=i?new URL(i).origin:null}catch{n=null}return na(n&&n!==new URL(yl).origin?`login --api-url ${n}`:"login",r)}function aa(i){return JSON.parse(ge.readFileSync(se.join(i,"package.json"),"utf8"))}function Ei(i,r){let n=yi(r);if(n.size===0)return[];let o=aa(i),h=[];for(let[l,p]of n){let m=Ct(o,l);m&&(!p||It(m.existing,p)!=="lower")||h.push(p?`${l}@${p}`:l)}return h}function wl(i,r){let n=r.filter(v=>v.required),o=yi(n.flatMap(v=>v.dependencies)),h=(v,b)=>b.filter(E=>E.dependencies.some(N=>vi(N).name===v)).map(E=>E.component).filter(Boolean),l=r.filter(v=>!v.required);if(o.size===0&&l.length===0)return{missing:[],kept:[],repair:[]};let p=aa(i),m=[],g=[];for(let[v,b]of o){let E=Ct(p,v);if(!E){m.push(b?`${v}@${b}`:v);continue}if(!b)continue;let N=It(E.existing,b);N==="lower"?m.push(`${v}@${b}`):N!=="satisfied"&&g.push({name:v,current:E.existing,declared:b,components:h(v,n)})}let x=new Map;for(let v of l.flatMap(b=>b.dependencies)){let{name:b,version:E}=vi(v);if(o.has(b)||Ct(p,b))continue;let N=x.get(b),q=E||N?.version;if(N?.version&&E&&N.version!==E)try{q=ra(b,N.version,E)}catch{q=N.version}x.set(b,{version:q})}let S=[...x].map(([v,{version:b}])=>({request:b?`${v}@${b}`:v,components:h(v,l)}));return{missing:m,kept:g,repair:S}}function oa(i,r){return[i==="npm"?"install":"add",...r]}function Sl(i){return/^[\w@/.:^~=+-]+$/.test(i)?i:`'${i.replace(/'/g,"'\\''")}'`}function ua(i,r){let n=kt(i);return[n,...oa(n,r)].map(Sl).join(" ")}function ca(i,r,{stdio:n="inherit"}={}){let o=Ei(i,r);if(o.length===0)return;let h=kt(i),l=ta.sync(h,oa(h,o),{cwd:i,stdio:n});if(l.error||l.status!==0)throw sa(i,r),l.error||new Error(`${h} dependency installation failed with status ${l.status}. Dependencies were saved; run ${h} install.`)}function Cl(i,r,{install:n=!0,stdio:o="inherit",log:h=console.log}={}){let l=Ei(i,r);if(l.length===0)return{missing:l,command:null,installed:!1};let p=ua(i,l);if(!n)return h(`\u{1F4E6} Component dependencies missing from package.json. Install them with:
3
3
  ${p}`),{missing:l,command:p,installed:!1};h(`\u{1F4E6} Installing component dependencies: ${p}`);try{return ca(i,l,{stdio:o}),{missing:l,command:p,installed:!0}}catch(m){return h(`\u26A0\uFE0F Component dependencies were not installed: ${m.message}
4
4
  Install them with:
5
5
  ${p}`),{missing:l,command:p,installed:!1,error:m.message}}}function Il(i,r){for(let n=se.resolve(i);;n=se.dirname(n)){if(ge.existsSync(se.join(n,"node_modules",r,"package.json")))return!0;if(se.dirname(n)===n)return!1}}function kl(i,r,{install:n=!0,stdio:o="inherit",log:h=console.log}={}){let l=JSON.parse(ge.readFileSync(se.join(i,"package.json"),"utf8"));if(!ia.some(v=>Object.hasOwn(l[v]||{},r))||Il(i,r))return{installed:!1,command:null};let m=kt(i),g=`${m} install`;if(!n)return h(`\u{1F4E6} ${r} is in package.json but not installed. Install it with:
6
6
  ${g}`),{installed:!1,command:g};h(`\u{1F4E6} Installing ${r}: ${g}`);let x=ta.sync(m,["install"],{cwd:i,stdio:o});if(!x.error&&x.status===0)return{installed:!0,command:g};let S=x.error?x.error.message:`${m} install failed with status ${x.status}`;return h(`\u26A0\uFE0F ${r} was not installed: ${S}
7
7
  Install it with:
8
- ${g}`),{installed:!1,command:g,error:S}}ha.exports={cliCommand:na,loginCommand:bl,installDeclaredPackage:kl,saveNpmDependencies:sa,installNpmDependencies:ca,installMissingNpmDependencies:Cl,missingNpmDependencies:Ei,npmInstallCommand:ua,planNpmDependencies:wl,requirementStatus:It}});var da=C((Mp,pa)=>{function fe(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}function bi(i,r){if(!fe(i)||!fe(r))return r===void 0?i:r;let n={...i};for(let[o,h]of Object.entries(r))n[o]=o in n?bi(n[o],h):h;return n}function wi(i,r,n=[],o=[]){if(i===void 0||r===void 0)return o;if(!fe(i)||!fe(r))return o.push(n.join(".")),o;for(let h of Object.keys(i))h in r&&wi(i[h],r[h],[...n,h],o);return o}function la(i){return fe(i)&&("styles"in i||"behavior"in i)}function fa(i,r="component"){if(!la(i)||!fe(i.styles)||i.behavior!==void 0&&!fe(i.behavior)||Object.keys(i).some(o=>!["styles","behavior"].includes(o)))throw new TypeError(`Component ${r} must use the styles/behavior envelope`);let n=wi(i.styles,i.behavior,[r]);if(n.length>0)throw new Error(`Component config styles/behavior conflict at ${n.join(", ")}`);return bi(i.styles||{},i.behavior||{})}function _l(i){if(!fe(i))return i;let r=!1,n={};for(let[o,h]of Object.entries(i))n[o]=fa(h,o),n[o]!==h&&(r=!0);return r?n:i}pa.exports={isPlainObject:fe,deepMerge:bi,findTreeConflicts:wi,isComponentEnvelope:la,toRuntimeComponentConfig:fa,toRuntimeComponentsConfig:_l}});var At=C((Gp,ma)=>{var B=require("fs");function Al(i){try{let r=B.readFileSync(i,"utf8");return JSON.parse(r)}catch(r){if(r.code==="ENOENT")return null;throw r}}function Nl(i){try{return B.readFileSync(i,"utf8").replace(/^\uFEFF/,"")}catch(r){if(r.code==="ENOENT")return null;throw r}}function Tl(i,r,n=2){let o=JSON.stringify(r,null,n);B.writeFileSync(i,o,"utf8")}function Rl(i,r){B.writeFileSync(i,r,"utf8")}function Pl(i,r){if(r==null||typeof r=="object"&&Object.keys(r).length===0||Array.isArray(r)&&r.length===0){let o=`module.exports = ${Array.isArray(r)?"[]":"{}"};`;B.writeFileSync(i,o,"utf8")}else{let n=`module.exports = ${JSON.stringify(r,null,2)};`;B.writeFileSync(i,n,"utf8")}}function Ll(i){return B.existsSync(i)}function Ol(i){B.mkdirSync(i,{recursive:!0})}function Vl(i){B.rmSync(i,{recursive:!0,force:!0})}function Fl(i){B.rmSync(i,{force:!0})}function $l(i,r){B.mkdirSync(require("path").dirname(i),{recursive:!0,mode:448});let n=`${i}.${process.pid}.${Date.now()}.tmp`;try{B.writeFileSync(n,`${JSON.stringify(r,null,2)}
9
- `,{mode:384}),B.renameSync(n,i);try{B.chmodSync(i,384)}catch{}}finally{B.rmSync(n,{force:!0})}}async function Dl(i,r,n){B.mkdirSync(require("path").dirname(i),{recursive:!0,mode:448});let o=`${i}.lock`,h=Date.now()+2e4,l;for(;l===void 0;)try{l=B.openSync(o,"wx",384),B.writeFileSync(l,String(process.pid))}catch(p){if(p.code!=="EEXIST")throw p;try{let m=Number(B.readFileSync(o,"utf8"));if(Number.isInteger(m)&&m>0)try{process.kill(m,0)}catch(g){if(g.code==="ESRCH"){B.unlinkSync(o);continue}}}catch(m){if(m.code==="ENOENT")continue}if(Date.now()>=h)throw n();await new Promise(m=>setTimeout(m,50))}try{return await r()}finally{B.closeSync(l),B.unlinkSync(o)}}ma.exports={writePrivateJsonFileAtomic:$l,withPrivateFileLock:Dl,readJsonFileSafe:Al,readFileSafe:Nl,writeJsonFile:Tl,writeTextFile:Rl,writeModuleExportsFile:Pl,fileExists:Ll,ensureDirectoryExists:Ol,removeDirectory:Vl,removeFile:Fl}});var Ci=C((Hp,Sa)=>{var{fileExists:ql,readJsonFileSafe:jl,removeFile:Bl,writePrivateJsonFileAtomic:Ul,withPrivateFileLock:Ml}=At(),xa=require("path"),Gl=require("os"),Hl=require("https"),Wl=require("http"),{URL:pe}=require("url"),{DEFAULT_API_URL:we}=St(),{cliCommand:ga,loginCommand:zl}=_t(),Xl=xa.join(Gl.homedir(),".frontfriend"),Fe=xa.join(Xl,"credentials");function Kl(){return Fe}function Nt(){try{return jl(Fe)}catch{return null}}function va(i){try{let r=JSON.parse(Buffer.from(String(i).split(".")[1],"base64url").toString("utf8"));return typeof r.email=="string"?r.email:null}catch{return null}}function Yl(){let i=Nt();if(!i||!i.accessToken)return null;let r=Number(i.refreshExpiresAt)||0;return{email:va(i.accessToken),apiUrl:i.ffApiUrl||null,expired:r>0&&r<Date.now()}}function ya(i){Ul(Fe,i)}function Jl(){return ql(Fe)?(Bl(Fe),!0):!1}function Si(i,r=60*1e3){return!i?.accessToken||!i.expiresAt||Date.now()+r>=i.expiresAt}function Ve(i,{apiUrl:r,login:n,next:o}={}){let h=o||`Run \`${n||zl(r)}\` to sign in, then run the command again.`,l=new Error(`${i}. ${h}`);return l.code="FF_AUTH_REFRESH_FAILED",l}function Ea(i,r,n){return new Promise((o,h)=>{let l=new pe(i);if(l.protocol!=="https:"&&!(l.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(l.hostname))){h(new Error("Frontfriend API URLs require HTTPS except on localhost"));return}let p=l.protocol==="https:"?Hl:Wl,m=JSON.stringify(r||{}),g=p.request({hostname:l.hostname,port:l.port,path:`${l.pathname}${l.search}`,method:"POST",headers:{"content-type":"application/json","content-length":Buffer.byteLength(m),...n?{authorization:`Bearer ${n}`}:{}}},x=>{let S="";x.on("data",v=>{S+=v}),x.on("end",()=>{if(x.statusCode>=300&&x.statusCode<400){let b=x.headers.location?` to ${x.headers.location}`:"",E=new Error(`HTTP ${x.statusCode}: redirected${b}`);E.statusCode=x.statusCode,E.body=S,h(E);return}let v=null;try{v=S?JSON.parse(S):null}catch{let E=x.headers["content-type"]||"unknown content-type",N=new Error(`Expected JSON from FrontFriend API at ${i}, but received ${E} (HTTP ${x.statusCode}). Check FF_API_URL or pass --api-url with the FrontFriend app URL.`);if(N.statusCode=x.statusCode,N.body=S,x.statusCode>=400){h(N);return}h(N);return}if(x.statusCode>=400){let b=new Error(v?.error_description||v?.error||`HTTP ${x.statusCode}`);b.statusCode=x.statusCode,b.body=v,h(b);return}o(v)})});g.setTimeout(15e3,()=>g.destroy(Object.assign(new Error("Frontfriend API request timed out"),{code:"ETIMEDOUT"}))),g.on("error",h),g.write(m),g.end()})}function ba(i,r){let n=new pe(i?.ffApiUrl||we).origin,o=new pe(r).origin;return Ve(`You are signed in to ${n}, but this command uses ${o}`,{login:ga(`login --api-url ${o}`)})}async function Ql(i){return Ml(Fe,i,()=>Ve("Another Frontfriend command is renewing your sign-in",{next:"Wait for it to finish, then run the command again."}))}async function wa(i,r=we){return Ql(async()=>{let n=Nt();if(n&&new pe(n.ffApiUrl||we).origin===new pe(r).origin){if(!Si(n))return n;i=n}return Zl(i,r)})}async function Zl(i,r=we){if(new pe(r).origin!==new pe(i.ffApiUrl||we).origin)throw ba(i,r);if(!i?.refreshToken||!i?.deviceId)throw Ve("Your Frontfriend sign-in has expired",{apiUrl:r});let n;try{n=await Ea(`${r}/api/plugin/token`,{grant_type:"refresh_token",refresh_token:i.refreshToken,device_id:i.deviceId})}catch(h){throw Object.assign(Ve(h?.message?`Could not renew your Frontfriend sign-in (${h.message})`:"Could not renew your Frontfriend sign-in",{apiUrl:r}),{cause:h})}if(!n?.access_token||!n?.refresh_token)throw Ve("Could not renew your Frontfriend sign-in",{apiUrl:r});let o={accessToken:n.access_token,refreshToken:n.refresh_token,deviceId:n.device_id||i.deviceId,expiresAt:Date.now()+(n.expires_in||900)*1e3,refreshExpiresAt:Date.now()+(n.refresh_expires_in||604800)*1e3,ffApiUrl:r};return ya(o),o}async function ef(i={}){if(i.envToken)return i.envToken;if(!i.skipCredentials){let r=Nt();if(r?.accessToken||r?.refreshToken){let n=i.baseURL||r.ffApiUrl||we;if(new pe(n).origin!==new pe(r.ffApiUrl||we).origin)throw ba(r,n);return r.accessToken&&!Si(r)?r.accessToken:(await wa(r,n)).accessToken}}return i.configuredToken?(i.silent||console.warn(`\u26A0\uFE0F auth-token in frontfriend.config.js is deprecated. Run \`${ga("login")}\` to keep your sign-in outside the repository.`),i.configuredToken):null}Sa.exports={accountEmail:va,signedInAccount:Yl,getCredentialsPath:Kl,readCredentials:Nt,writeCredentials:ya,deleteCredentials:Jl,isExpired:Si,postJson:Ea,refreshCredentials:wa,resolveAuthToken:ef,createAuthRefreshError:Ve}});var ka=C((Wp,Ia)=>{var ue=require("path"),{fileExists:Ii}=At();function Ca(i,r=process.cwd()){let n=r;for(;n!==ue.parse(n).root;){let o=ue.join(n,i);if(Ii(o))return o;n=ue.dirname(n)}return null}function tf(i,r=process.cwd(),n=null){let o=[],h=r,l=10;for(let p=0;p<l;p++){o.push(ue.join(h,i)),p<3&&o.push(ue.join(h,"../".repeat(p+1)+i));let m=ue.dirname(h);if(m===h)break;h=m}o.push(ue.join(__dirname,"../../../",i));for(let p of o)if(Ii(p)&&(!n||n(p)))return p;return null}function rf(i,r=process.cwd()){let n=i.map(o=>ue.isAbsolute(o)?o:ue.join(r,o));for(let o of n)if(Ii(o))return o;return null}function sf(i=process.cwd()){let r=Ca("frontfriend.config.js",i);return r?ue.dirname(r):i}Ia.exports={findFileUpward:Ca,findDirectoryUpward:tf,findDirectoryWithPaths:rf,resolveProjectRoot:sf}});var Aa=C((Tt,_a)=>{(function(i,r){typeof Tt=="object"&&typeof _a<"u"?r(Tt):typeof define=="function"&&define.amd?define(["exports"],r):(i=typeof globalThis<"u"?globalThis:i||self,r(i.acorn={}))})(Tt,function(i){"use strict";var r=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],o="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",h="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",l={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},p="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",m={5:p,"5module":p+" export import",6:p+" const class extends export import super"},g=/^in(stanceof)?$/,x=new RegExp("["+h+"]"),S=new RegExp("["+h+o+"]");function v(e,t){for(var s=65536,a=0;a<t.length;a+=2){if(s+=t[a],s>e)return!1;if(s+=t[a+1],s>=e)return!0}return!1}function b(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&x.test(String.fromCharCode(e)):t===!1?!1:v(e,n)}function E(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&S.test(String.fromCharCode(e)):t===!1?!1:v(e,n)||v(e,r)}var N=function(t,s){s===void 0&&(s={}),this.label=t,this.keyword=s.keyword,this.beforeExpr=!!s.beforeExpr,this.startsExpr=!!s.startsExpr,this.isLoop=!!s.isLoop,this.isAssign=!!s.isAssign,this.prefix=!!s.prefix,this.postfix=!!s.postfix,this.binop=s.binop||null,this.updateContext=null};function q(e,t){return new N(e,{beforeExpr:!0,binop:t})}var G={beforeExpr:!0},J={startsExpr:!0},Qe={};function V(e,t){return t===void 0&&(t={}),t.keyword=e,Qe[e]=new N(e,t)}var u={num:new N("num",J),regexp:new N("regexp",J),string:new N("string",J),name:new N("name",J),privateId:new N("privateId",J),eof:new N("eof"),bracketL:new N("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new N("]"),braceL:new N("{",{beforeExpr:!0,startsExpr:!0}),braceR:new N("}"),parenL:new N("(",{beforeExpr:!0,startsExpr:!0}),parenR:new N(")"),comma:new N(",",G),semi:new N(";",G),colon:new N(":",G),dot:new N("."),question:new N("?",G),questionDot:new N("?."),arrow:new N("=>",G),template:new N("template"),invalidTemplate:new N("invalidTemplate"),ellipsis:new N("...",G),backQuote:new N("`",J),dollarBraceL:new N("${",{beforeExpr:!0,startsExpr:!0}),eq:new N("=",{beforeExpr:!0,isAssign:!0}),assign:new N("_=",{beforeExpr:!0,isAssign:!0}),incDec:new N("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new N("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:q("||",1),logicalAND:q("&&",2),bitwiseOR:q("|",3),bitwiseXOR:q("^",4),bitwiseAND:q("&",5),equality:q("==/!=/===/!==",6),relational:q("</>/<=/>=",7),bitShift:q("<</>>/>>>",8),plusMin:new N("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:q("%",10),star:q("*",10),slash:q("/",10),starstar:new N("**",{beforeExpr:!0}),coalesce:q("??",1),_break:V("break"),_case:V("case",G),_catch:V("catch"),_continue:V("continue"),_debugger:V("debugger"),_default:V("default",G),_do:V("do",{isLoop:!0,beforeExpr:!0}),_else:V("else",G),_finally:V("finally"),_for:V("for",{isLoop:!0}),_function:V("function",J),_if:V("if"),_return:V("return",G),_switch:V("switch"),_throw:V("throw",G),_try:V("try"),_var:V("var"),_const:V("const"),_while:V("while",{isLoop:!0}),_with:V("with"),_new:V("new",{beforeExpr:!0,startsExpr:!0}),_this:V("this",J),_super:V("super",J),_class:V("class",J),_extends:V("extends",G),_export:V("export"),_import:V("import",J),_null:V("null",J),_true:V("true",J),_false:V("false",J),_in:V("in",{beforeExpr:!0,binop:7}),_instanceof:V("instanceof",{beforeExpr:!0,binop:7}),_typeof:V("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:V("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:V("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},K=/\r\n?|\n|\u2028|\u2029/,Oi=new RegExp(K.source,"g");function ve(e){return e===10||e===13||e===8232||e===8233}function Vi(e,t,s){s===void 0&&(s=e.length);for(var a=t;a<s;a++){var c=e.charCodeAt(a);if(ve(c))return a<s-1&&c===13&&e.charCodeAt(a+1)===10?a+2:a+1}return-1}var Lt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,M=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Fi=Object.prototype,eo=Fi.hasOwnProperty,to=Fi.toString,Ie=Object.hasOwn||function(e,t){return eo.call(e,t)},$i=Array.isArray||function(e){return to.call(e)==="[object Array]"},Di=Object.create(null);function de(e){return Di[e]||(Di[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ce(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var io=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ke=function(t,s){this.line=t,this.column=s};ke.prototype.offset=function(t){return new ke(this.line,this.column+t)};var qe=function(t,s,a){this.start=s,this.end=a,t.sourceFile!==null&&(this.source=t.sourceFile)};function Ot(e,t){for(var s=1,a=0;;){var c=Vi(e,a,t);if(c<0)return new ke(s,t-a);++s,a=c}}var Ze={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},qi=!1;function ro(e){var t={};for(var s in Ze)t[s]=e&&Ie(e,s)?e[s]:Ze[s];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!qi&&typeof console=="object"&&console.warn&&(qi=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
8
+ ${g}`),{installed:!1,command:g,error:S}}ha.exports={cliCommand:na,loginCommand:bl,installDeclaredPackage:kl,saveNpmDependencies:sa,installNpmDependencies:ca,installMissingNpmDependencies:Cl,missingNpmDependencies:Ei,npmInstallCommand:ua,planNpmDependencies:wl,requirementStatus:It}});var da=C((Hp,pa)=>{function fe(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}function bi(i,r){if(!fe(i)||!fe(r))return r===void 0?i:r;let n={...i};for(let[o,h]of Object.entries(r))n[o]=o in n?bi(n[o],h):h;return n}function wi(i,r,n=[],o=[]){if(i===void 0||r===void 0)return o;if(!fe(i)||!fe(r))return o.push(n.join(".")),o;for(let h of Object.keys(i))h in r&&wi(i[h],r[h],[...n,h],o);return o}function la(i){return fe(i)&&("styles"in i||"behavior"in i)}function fa(i,r="component"){if(!la(i)||!fe(i.styles)||i.behavior!==void 0&&!fe(i.behavior)||Object.keys(i).some(o=>!["styles","behavior"].includes(o)))throw new TypeError(`Component ${r} must use the styles/behavior envelope`);let n=wi(i.styles,i.behavior,[r]);if(n.length>0)throw new Error(`Component config styles/behavior conflict at ${n.join(", ")}`);return bi(i.styles||{},i.behavior||{})}function _l(i){if(!fe(i))return i;let r=!1,n={};for(let[o,h]of Object.entries(i))n[o]=fa(h,o),n[o]!==h&&(r=!0);return r?n:i}pa.exports={isPlainObject:fe,deepMerge:bi,findTreeConflicts:wi,isComponentEnvelope:la,toRuntimeComponentConfig:fa,toRuntimeComponentsConfig:_l}});var At=C((Wp,ma)=>{var B=require("fs");function Al(i){try{let r=B.readFileSync(i,"utf8");return JSON.parse(r)}catch(r){if(r.code==="ENOENT")return null;throw r}}function Nl(i){try{return B.readFileSync(i,"utf8").replace(/^\uFEFF/,"")}catch(r){if(r.code==="ENOENT")return null;throw r}}function Tl(i,r,n=2){let o=JSON.stringify(r,null,n);B.writeFileSync(i,o,"utf8")}function Rl(i,r){B.writeFileSync(i,r,"utf8")}function Pl(i,r){if(r==null||typeof r=="object"&&Object.keys(r).length===0||Array.isArray(r)&&r.length===0){let o=`module.exports = ${Array.isArray(r)?"[]":"{}"};`;B.writeFileSync(i,o,"utf8")}else{let n=`module.exports = ${JSON.stringify(r,null,2)};`;B.writeFileSync(i,n,"utf8")}}function Ll(i){return B.existsSync(i)}function Ol(i){B.mkdirSync(i,{recursive:!0})}function Vl(i){B.rmSync(i,{recursive:!0,force:!0})}function Fl(i){B.rmSync(i,{force:!0})}function $l(i,r){B.mkdirSync(require("path").dirname(i),{recursive:!0,mode:448});let n=`${i}.${process.pid}.${Date.now()}.tmp`;try{B.writeFileSync(n,`${JSON.stringify(r,null,2)}
9
+ `,{mode:384}),B.renameSync(n,i);try{B.chmodSync(i,384)}catch{}}finally{B.rmSync(n,{force:!0})}}async function Dl(i,r,n){B.mkdirSync(require("path").dirname(i),{recursive:!0,mode:448});let o=`${i}.lock`,h=Date.now()+2e4,l;for(;l===void 0;)try{l=B.openSync(o,"wx",384),B.writeFileSync(l,String(process.pid))}catch(p){if(p.code!=="EEXIST")throw p;try{let m=Number(B.readFileSync(o,"utf8"));if(Number.isInteger(m)&&m>0)try{process.kill(m,0)}catch(g){if(g.code==="ESRCH"){B.unlinkSync(o);continue}}}catch(m){if(m.code==="ENOENT")continue}if(Date.now()>=h)throw n();await new Promise(m=>setTimeout(m,50))}try{return await r()}finally{B.closeSync(l),B.unlinkSync(o)}}ma.exports={writePrivateJsonFileAtomic:$l,withPrivateFileLock:Dl,readJsonFileSafe:Al,readFileSafe:Nl,writeJsonFile:Tl,writeTextFile:Rl,writeModuleExportsFile:Pl,fileExists:Ll,ensureDirectoryExists:Ol,removeDirectory:Vl,removeFile:Fl}});var Ci=C((zp,Sa)=>{var{fileExists:ql,readJsonFileSafe:jl,removeFile:Bl,writePrivateJsonFileAtomic:Ul,withPrivateFileLock:Ml}=At(),xa=require("path"),Gl=require("os"),Hl=require("https"),Wl=require("http"),{URL:pe}=require("url"),{DEFAULT_API_URL:we}=St(),{cliCommand:ga,loginCommand:zl}=_t(),Xl=xa.join(Gl.homedir(),".frontfriend"),Fe=xa.join(Xl,"credentials");function Kl(){return Fe}function Nt(){try{return jl(Fe)}catch{return null}}function va(i){try{let r=JSON.parse(Buffer.from(String(i).split(".")[1],"base64url").toString("utf8"));return typeof r.email=="string"?r.email:null}catch{return null}}function Yl(){let i=Nt();if(!i||!i.accessToken)return null;let r=Number(i.refreshExpiresAt)||0;return{email:va(i.accessToken),apiUrl:i.ffApiUrl||null,expired:r>0&&r<Date.now()}}function ya(i){Ul(Fe,i)}function Jl(){return ql(Fe)?(Bl(Fe),!0):!1}function Si(i,r=60*1e3){return!i?.accessToken||!i.expiresAt||Date.now()+r>=i.expiresAt}function Ve(i,{apiUrl:r,login:n,next:o}={}){let h=o||`Run \`${n||zl(r)}\` to sign in, then run the command again.`,l=new Error(`${i}. ${h}`);return l.code="FF_AUTH_REFRESH_FAILED",l}function Ea(i,r,n){return new Promise((o,h)=>{let l=new pe(i);if(l.protocol!=="https:"&&!(l.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(l.hostname))){h(new Error("Frontfriend API URLs require HTTPS except on localhost"));return}let p=l.protocol==="https:"?Hl:Wl,m=JSON.stringify(r||{}),g=p.request({hostname:l.hostname,port:l.port,path:`${l.pathname}${l.search}`,method:"POST",headers:{"content-type":"application/json","content-length":Buffer.byteLength(m),...n?{authorization:`Bearer ${n}`}:{}}},x=>{let S="";x.on("data",v=>{S+=v}),x.on("end",()=>{if(x.statusCode>=300&&x.statusCode<400){let b=x.headers.location?` to ${x.headers.location}`:"",E=new Error(`HTTP ${x.statusCode}: redirected${b}`);E.statusCode=x.statusCode,E.body=S,h(E);return}let v=null;try{v=S?JSON.parse(S):null}catch{let E=x.headers["content-type"]||"unknown content-type",N=new Error(`Expected JSON from FrontFriend API at ${i}, but received ${E} (HTTP ${x.statusCode}). Check FF_API_URL or pass --api-url with the FrontFriend app URL.`);if(N.statusCode=x.statusCode,N.body=S,x.statusCode>=400){h(N);return}h(N);return}if(x.statusCode>=400){let b=new Error(v?.error_description||v?.error||`HTTP ${x.statusCode}`);b.statusCode=x.statusCode,b.body=v,h(b);return}o(v)})});g.setTimeout(15e3,()=>g.destroy(Object.assign(new Error("Frontfriend API request timed out"),{code:"ETIMEDOUT"}))),g.on("error",h),g.write(m),g.end()})}function ba(i,r){let n=new pe(i?.ffApiUrl||we).origin,o=new pe(r).origin;return Ve(`You are signed in to ${n}, but this command uses ${o}`,{login:ga(`login --api-url ${o}`)})}async function Ql(i){return Ml(Fe,i,()=>Ve("Another Frontfriend command is renewing your sign-in",{next:"Wait for it to finish, then run the command again."}))}async function wa(i,r=we){return Ql(async()=>{let n=Nt();if(n&&new pe(n.ffApiUrl||we).origin===new pe(r).origin){if(!Si(n))return n;i=n}return Zl(i,r)})}async function Zl(i,r=we){if(new pe(r).origin!==new pe(i.ffApiUrl||we).origin)throw ba(i,r);if(!i?.refreshToken||!i?.deviceId)throw Ve("Your Frontfriend sign-in has expired",{apiUrl:r});let n;try{n=await Ea(`${r}/api/plugin/token`,{grant_type:"refresh_token",refresh_token:i.refreshToken,device_id:i.deviceId})}catch(h){throw Object.assign(Ve(h?.message?`Could not renew your Frontfriend sign-in (${h.message})`:"Could not renew your Frontfriend sign-in",{apiUrl:r}),{cause:h})}if(!n?.access_token||!n?.refresh_token)throw Ve("Could not renew your Frontfriend sign-in",{apiUrl:r});let o={accessToken:n.access_token,refreshToken:n.refresh_token,deviceId:n.device_id||i.deviceId,expiresAt:Date.now()+(n.expires_in||900)*1e3,refreshExpiresAt:Date.now()+(n.refresh_expires_in||604800)*1e3,ffApiUrl:r};return ya(o),o}var ef="ffm_";function tf(i){return typeof i=="string"&&i.startsWith(ef)}async function rf(i={}){if(i.envToken)return i.envToken;if(!i.skipCredentials){let r=Nt();if(r?.accessToken||r?.refreshToken){let n=i.baseURL||r.ffApiUrl||we;if(new pe(n).origin!==new pe(r.ffApiUrl||we).origin)throw ba(r,n);return r.accessToken&&!Si(r)?r.accessToken:(await wa(r,n)).accessToken}}return i.configuredToken?(i.silent||console.warn(`\u26A0\uFE0F auth-token in frontfriend.config.js is deprecated. Run \`${ga("login")}\` to keep your sign-in outside the repository.`),i.configuredToken):null}Sa.exports={isMachineCredential:tf,accountEmail:va,signedInAccount:Yl,getCredentialsPath:Kl,readCredentials:Nt,writeCredentials:ya,deleteCredentials:Jl,isExpired:Si,postJson:Ea,refreshCredentials:wa,resolveAuthToken:rf,createAuthRefreshError:Ve}});var ka=C((Xp,Ia)=>{var ue=require("path"),{fileExists:Ii}=At();function Ca(i,r=process.cwd()){let n=r;for(;n!==ue.parse(n).root;){let o=ue.join(n,i);if(Ii(o))return o;n=ue.dirname(n)}return null}function sf(i,r=process.cwd(),n=null){let o=[],h=r,l=10;for(let p=0;p<l;p++){o.push(ue.join(h,i)),p<3&&o.push(ue.join(h,"../".repeat(p+1)+i));let m=ue.dirname(h);if(m===h)break;h=m}o.push(ue.join(__dirname,"../../../",i));for(let p of o)if(Ii(p)&&(!n||n(p)))return p;return null}function nf(i,r=process.cwd()){let n=i.map(o=>ue.isAbsolute(o)?o:ue.join(r,o));for(let o of n)if(Ii(o))return o;return null}function af(i=process.cwd()){let r=Ca("frontfriend.config.js",i);return r?ue.dirname(r):i}Ia.exports={findFileUpward:Ca,findDirectoryUpward:sf,findDirectoryWithPaths:nf,resolveProjectRoot:af}});var Aa=C((Tt,_a)=>{(function(i,r){typeof Tt=="object"&&typeof _a<"u"?r(Tt):typeof define=="function"&&define.amd?define(["exports"],r):(i=typeof globalThis<"u"?globalThis:i||self,r(i.acorn={}))})(Tt,function(i){"use strict";var r=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],o="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",h="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",l={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},p="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",m={5:p,"5module":p+" export import",6:p+" const class extends export import super"},g=/^in(stanceof)?$/,x=new RegExp("["+h+"]"),S=new RegExp("["+h+o+"]");function v(e,t){for(var s=65536,a=0;a<t.length;a+=2){if(s+=t[a],s>e)return!1;if(s+=t[a+1],s>=e)return!0}return!1}function b(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&x.test(String.fromCharCode(e)):t===!1?!1:v(e,n)}function E(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&S.test(String.fromCharCode(e)):t===!1?!1:v(e,n)||v(e,r)}var N=function(t,s){s===void 0&&(s={}),this.label=t,this.keyword=s.keyword,this.beforeExpr=!!s.beforeExpr,this.startsExpr=!!s.startsExpr,this.isLoop=!!s.isLoop,this.isAssign=!!s.isAssign,this.prefix=!!s.prefix,this.postfix=!!s.postfix,this.binop=s.binop||null,this.updateContext=null};function q(e,t){return new N(e,{beforeExpr:!0,binop:t})}var G={beforeExpr:!0},J={startsExpr:!0},Qe={};function V(e,t){return t===void 0&&(t={}),t.keyword=e,Qe[e]=new N(e,t)}var u={num:new N("num",J),regexp:new N("regexp",J),string:new N("string",J),name:new N("name",J),privateId:new N("privateId",J),eof:new N("eof"),bracketL:new N("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new N("]"),braceL:new N("{",{beforeExpr:!0,startsExpr:!0}),braceR:new N("}"),parenL:new N("(",{beforeExpr:!0,startsExpr:!0}),parenR:new N(")"),comma:new N(",",G),semi:new N(";",G),colon:new N(":",G),dot:new N("."),question:new N("?",G),questionDot:new N("?."),arrow:new N("=>",G),template:new N("template"),invalidTemplate:new N("invalidTemplate"),ellipsis:new N("...",G),backQuote:new N("`",J),dollarBraceL:new N("${",{beforeExpr:!0,startsExpr:!0}),eq:new N("=",{beforeExpr:!0,isAssign:!0}),assign:new N("_=",{beforeExpr:!0,isAssign:!0}),incDec:new N("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new N("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:q("||",1),logicalAND:q("&&",2),bitwiseOR:q("|",3),bitwiseXOR:q("^",4),bitwiseAND:q("&",5),equality:q("==/!=/===/!==",6),relational:q("</>/<=/>=",7),bitShift:q("<</>>/>>>",8),plusMin:new N("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:q("%",10),star:q("*",10),slash:q("/",10),starstar:new N("**",{beforeExpr:!0}),coalesce:q("??",1),_break:V("break"),_case:V("case",G),_catch:V("catch"),_continue:V("continue"),_debugger:V("debugger"),_default:V("default",G),_do:V("do",{isLoop:!0,beforeExpr:!0}),_else:V("else",G),_finally:V("finally"),_for:V("for",{isLoop:!0}),_function:V("function",J),_if:V("if"),_return:V("return",G),_switch:V("switch"),_throw:V("throw",G),_try:V("try"),_var:V("var"),_const:V("const"),_while:V("while",{isLoop:!0}),_with:V("with"),_new:V("new",{beforeExpr:!0,startsExpr:!0}),_this:V("this",J),_super:V("super",J),_class:V("class",J),_extends:V("extends",G),_export:V("export"),_import:V("import",J),_null:V("null",J),_true:V("true",J),_false:V("false",J),_in:V("in",{beforeExpr:!0,binop:7}),_instanceof:V("instanceof",{beforeExpr:!0,binop:7}),_typeof:V("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:V("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:V("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},K=/\r\n?|\n|\u2028|\u2029/,Oi=new RegExp(K.source,"g");function ve(e){return e===10||e===13||e===8232||e===8233}function Vi(e,t,s){s===void 0&&(s=e.length);for(var a=t;a<s;a++){var c=e.charCodeAt(a);if(ve(c))return a<s-1&&c===13&&e.charCodeAt(a+1)===10?a+2:a+1}return-1}var Lt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,M=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Fi=Object.prototype,eo=Fi.hasOwnProperty,to=Fi.toString,Ie=Object.hasOwn||function(e,t){return eo.call(e,t)},$i=Array.isArray||function(e){return to.call(e)==="[object Array]"},Di=Object.create(null);function de(e){return Di[e]||(Di[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ce(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var io=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ke=function(t,s){this.line=t,this.column=s};ke.prototype.offset=function(t){return new ke(this.line,this.column+t)};var qe=function(t,s,a){this.start=s,this.end=a,t.sourceFile!==null&&(this.source=t.sourceFile)};function Ot(e,t){for(var s=1,a=0;;){var c=Vi(e,a,t);if(c<0)return new ke(s,t-a);++s,a=c}}var Ze={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},qi=!1;function ro(e){var t={};for(var s in Ze)t[s]=e&&Ie(e,s)?e[s]:Ze[s];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!qi&&typeof console=="object"&&console.warn&&(qi=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
10
10
  Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),$i(t.onToken)){var a=t.onToken;t.onToken=function(c){return a.push(c)}}if($i(t.onComment)&&(t.onComment=so(t,t.onComment)),t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function so(e,t){return function(s,a,c,f,d,y){var w={type:s?"Block":"Line",value:a,start:c,end:f};e.locations&&(w.loc=new qe(this,d,y)),e.ranges&&(w.range=[c,f]),t.push(w)}}var ye=1,Ee=2,Vt=4,ji=8,Ft=16,Bi=32,et=64,Ui=128,be=256,je=512,Mi=1024,tt=ye|Ee|be;function $t(e,t){return Ee|(e?Vt:0)|(t?ji:0)}var it=0,Dt=1,he=2,Gi=3,Hi=4,Wi=5,j=function(t,s,a){this.options=t=ro(t),this.sourceFile=t.sourceFile,this.keywords=de(m[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var c="";t.allowReserved!==!0&&(c=l[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(c+=" await")),this.reservedWords=de(c);var f=(c?c+" ":"")+l.strict;this.reservedWordsStrict=de(f),this.reservedWordsStrictBind=de(f+" "+l.strictBind),this.input=String(s),this.containsEsc=!1,a?(this.pos=a,this.lineStart=this.input.lastIndexOf(`
11
11
  `,a-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(K).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=u.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||t.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?Ee:ye),this.regexpState=null,this.privateNameStack=[]},Q={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};j.prototype.parse=function(){var t=this,s=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return t.parseTopLevel(s)})},Q.inFunction.get=function(){return(this.currentVarScope().flags&Ee)>0},Q.inGenerator.get=function(){return(this.currentVarScope().flags&ji)>0},Q.inAsync.get=function(){return(this.currentVarScope().flags&Vt)>0},Q.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],s=t.flags;if(s&(be|je))return!1;if(s&Ee)return(s&Vt)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Q.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&ye)},Q.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&et)>0||this.options.allowSuperOutsideMethod},Q.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ui)>0},Q.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Q.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],s=t.flags;if(s&(be|je)||s&Ee&&!(s&Ft))return!0}return!1},Q.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;return!(t&Mi||!this.inModule&&t&ye)},Q.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&be)>0},j.extend=function(){for(var t=[],s=arguments.length;s--;)t[s]=arguments[s];for(var a=this,c=0;c<t.length;c++)a=t[c](a);return a},j.parse=function(t,s){return new this(s,t).parse()},j.parseExpressionAt=function(t,s,a){var c=new this(a,t,s);return c.nextToken(),c.parseExpression()},j.tokenizer=function(t,s){return new this(s,t)},Object.defineProperties(j.prototype,Q);var z=j.prototype,no=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;z.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){M.lastIndex=e,e+=M.exec(this.input)[0].length;var t=no.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){M.lastIndex=e+t[0].length;var s=M.exec(this.input),a=s.index+s[0].length,c=this.input.charAt(a);return c===";"||c==="}"||K.test(s[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(c)||c==="!"&&this.input.charAt(a+1)==="=")}e+=t[0].length,M.lastIndex=e,e+=M.exec(this.input)[0].length,this.input[e]===";"&&e++}},z.eat=function(e){return this.type===e?(this.next(),!0):!1},z.isContextual=function(e){return this.type===u.name&&this.value===e&&!this.containsEsc},z.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},z.catchStackOverflow=function(e){try{return e()}catch(t){if(t instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(t.message)||/\btoo much recursion\b/i.test(t.message)))this.raise(this.start,"Not enough stack space to parse input");else throw t}},z.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},z.canInsertSemicolon=function(){return this.type===u.eof||this.type===u.braceR||K.test(this.input.slice(this.lastTokEnd,this.start))},z.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},z.semicolon=function(){!this.eat(u.semi)&&!this.insertSemicolon()&&this.unexpected()},z.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},z.expect=function(e){this.eat(e)||this.unexpected()},z.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var rt=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};z.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var s=t?e.parenthesizedAssign:e.parenthesizedBind;s>-1&&this.raiseRecoverable(s,t?"Assigning to rvalue":"Parenthesized pattern")}},z.checkExpressionErrors=function(e,t){if(!e)return!1;var s=e.shorthandAssign,a=e.doubleProto;if(!t)return s>=0||a>=0;s>=0&&this.raise(s,"Shorthand property assignments are valid only in destructuring patterns"),a>=0&&this.raiseRecoverable(a,"Redefinition of __proto__ property")},z.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},z.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var A=j.prototype;A.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==u.eof;){var s=this.parseStatement(null,!0,t);e.body.push(s)}if(this.inModule)for(var a=0,c=Object.keys(this.undefinedExports);a<c.length;a+=1){var f=c[a];this.raiseRecoverable(this.undefinedExports[f].start,"Export '"+f+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var qt={kind:"loop"},ao={kind:"switch"};A.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;M.lastIndex=this.pos;var t=M.exec(this.input),s=this.pos+t[0].length,a=this.fullCharCodeAt(s);if(a===91||a===92)return!0;if(e)return!1;if(a===123)return!0;if(b(a)){var c=s;do s+=a<=65535?1:2;while(E(a=this.fullCharCodeAt(s)));if(a===92)return!0;var f=this.input.slice(c,s);if(!g.test(f))return!0}return!1},A.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;M.lastIndex=this.pos;var e=M.exec(this.input),t=this.pos+e[0].length,s;return!K.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(E(s=this.fullCharCodeAt(t+8))||s===92))},A.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;M.lastIndex=this.pos;var s=M.exec(this.input),a=this.pos+s[0].length;if(K.test(this.input.slice(this.pos,a)))return!1;if(e){var c=a+5,f;if(this.input.slice(a,c)!=="using"||c===this.input.length||E(f=this.fullCharCodeAt(c))||f===92)return!1;M.lastIndex=c;var d=M.exec(this.input);if(a=c+d[0].length,d&&K.test(this.input.slice(c,a)))return!1}var y=this.fullCharCodeAt(a);if(!b(y)&&y!==92)return!1;var w=a;do a+=y<=65535?1:2;while(E(y=this.fullCharCodeAt(a)));if(y===92)return!0;var T=this.input.slice(w,a);if(g.test(T))return!1;if(t&&!e&&T==="of"){M.lastIndex=a;var L=M.exec(this.input);if(a=a+L[0].length,this.input.charCodeAt(a)!==61||(y=this.input.charCodeAt(a+1))===61||y===62)return!1}return!0},A.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},A.isUsing=function(e){return this.isUsingKeyword(!1,e)},A.parseStatement=function(e,t,s){var a=this.type,c=this.startNode(),f;switch(this.isLet(e)&&(a=u._var,f="let"),a){case u._break:case u._continue:return this.parseBreakContinueStatement(c,a.keyword);case u._debugger:return this.parseDebuggerStatement(c);case u._do:return this.parseDoStatement(c);case u._for:return this.parseForStatement(c);case u._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(c,!1,!e);case u._class:return e&&this.unexpected(),this.parseClass(c,!0);case u._if:return this.parseIfStatement(c);case u._return:return this.parseReturnStatement(c);case u._switch:return this.parseSwitchStatement(c);case u._throw:return this.parseThrowStatement(c);case u._try:return this.parseTryStatement(c);case u._const:case u._var:return f=f||this.value,e&&f!=="var"&&this.unexpected(),this.parseVarStatement(c,f);case u._while:return this.parseWhileStatement(c);case u._with:return this.parseWithStatement(c);case u.braceL:return this.parseBlock(!0,c);case u.semi:return this.parseEmptyStatement(c);case u._export:case u._import:if(this.options.ecmaVersion>10&&a===u._import){M.lastIndex=this.pos;var d=M.exec(this.input),y=this.pos+d[0].length,w=this.input.charCodeAt(y);if(w===40||w===46)return this.parseExpressionStatement(c,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),a===u._import?this.parseImport(c):this.parseExport(c,s);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(c,!0,!e);var T=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(T)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),e&&this.raise(this.start,"Using declaration is not allowed in single-statement positions"),T==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(c,!1,T),this.semicolon(),this.finishNode(c,"VariableDeclaration");var L=this.value,$=this.parseExpression();return a===u.name&&$.type==="Identifier"&&this.eat(u.colon)?this.parseLabeledStatement(c,L,$,e):this.parseExpressionStatement(c,$)}},A.parseBreakContinueStatement=function(e,t){var s=t==="break";this.next(),this.eat(u.semi)||this.insertSemicolon()?e.label=null:this.type!==u.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var a=0;a<this.labels.length;++a){var c=this.labels[a];if((e.label==null||c.name===e.label.name)&&(c.kind!=null&&(s||c.kind==="loop")||e.label&&s))break}return a===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,s?"BreakStatement":"ContinueStatement")},A.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},A.parseDoStatement=function(e){return this.next(),this.labels.push(qt),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(u._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(u.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},A.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(qt),this.enterScope(0),this.expect(u.parenL),this.type===u.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var s=this.isLet();if(this.type===u._var||this.type===u._const||s){var a=this.startNode(),c=s?"let":this.value;return this.next(),this.parseVar(a,!0,c),this.finishNode(a,"VariableDeclaration"),this.parseForAfterInit(e,a,t)}var f=this.isContextual("let"),d=!1,y=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(y){var w=this.startNode();return this.next(),y==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(w,!0,y),this.finishNode(w,"VariableDeclaration"),this.parseForAfterInit(e,w,t)}var T=this.containsEsc,L=new rt,$=this.start,X=t>-1?this.parseExprSubscripts(L,"await"):this.parseExpression(!0,L);return this.type===u._in||(d=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===u._in&&this.unexpected(t),e.await=!0):d&&this.options.ecmaVersion>=8&&(X.start===$&&!T&&X.type==="Identifier"&&X.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),f&&d&&this.raise(X.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(X,!1,L),this.checkLValPattern(X),this.parseForIn(e,X)):(this.checkExpressionErrors(L,!0),t>-1&&this.unexpected(t),this.parseFor(e,X))},A.parseForAfterInit=function(e,t,s){return(this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.type===u._in?((t.kind==="using"||t.kind==="await using")&&!t.declarations[0].init&&this.raise(this.start,"Using declaration is not allowed in for-in loops"),this.options.ecmaVersion>=9&&s>-1&&this.unexpected(s)):this.options.ecmaVersion>=9&&(e.await=s>-1),this.parseForIn(e,t)):(s>-1&&this.unexpected(s),this.parseFor(e,t))},A.parseFunctionStatement=function(e,t,s){return this.next(),this.parseFunction(e,Be|(s?0:jt),!1,t)},A.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(u._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},A.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(u.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},A.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(u.braceL),this.labels.push(ao),this.enterScope(Mi);for(var t,s=!1;this.type!==u.braceR;)if(this.type===u._case||this.type===u._default){var a=this.type===u._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),a?t.test=this.parseExpression():(s&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),s=!0,t.test=null),this.expect(u.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},A.parseThrowStatement=function(e){return this.next(),K.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var oo=[];A.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Bi:0),this.checkLValPattern(e,t?Hi:he),this.expect(u.parenR),e},A.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===u._catch){var t=this.startNode();this.next(),this.eat(u.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(u._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},A.parseVarStatement=function(e,t,s){return this.next(),this.parseVar(e,!1,t,s),this.semicolon(),this.finishNode(e,"VariableDeclaration")},A.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(qt),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},A.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},A.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},A.parseLabeledStatement=function(e,t,s,a){for(var c=0,f=this.labels;c<f.length;c+=1){var d=f[c];d.name===t&&this.raise(s.start,"Label '"+t+"' is already declared")}for(var y=this.type.isLoop?"loop":this.type===u._switch?"switch":null,w=this.labels.length-1;w>=0;w--){var T=this.labels[w];if(T.statementStart===e.start)T.statementStart=this.start,T.kind=y;else break}return this.labels.push({name:t,kind:y,statementStart:this.start}),e.body=this.parseStatement(a?a.indexOf("label")===-1?a+"label":a:"label"),this.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")},A.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},A.parseBlock=function(e,t,s){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(u.braceL),e&&this.enterScope(0);this.type!==u.braceR;){var a=this.parseStatement(null);t.body.push(a)}return s&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},A.parseFor=function(e,t){return e.init=t,this.expect(u.semi),e.test=this.type===u.semi?null:this.parseExpression(),this.expect(u.semi),e.update=this.type===u.parenR?null:this.parseExpression(),this.expect(u.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},A.parseForIn=function(e,t){var s=this.type===u._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!s||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(s?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=s?this.parseExpression():this.parseMaybeAssign(),this.expect(u.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")},A.parseVar=function(e,t,s,a){for(e.declarations=[],e.kind=s;;){var c=this.startNode();if(this.parseVarId(c,s),this.eat(u.eq)?c.init=this.parseMaybeAssign(t):!a&&s==="const"&&!(this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!a&&(s==="using"||s==="await using")&&this.options.ecmaVersion>=17&&this.type!==u._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+s+" declaration"):!a&&c.id.type!=="Identifier"&&!(t&&(this.type===u._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):c.init=null,e.declarations.push(this.finishNode(c,"VariableDeclarator")),!this.eat(u.comma))break}return e},A.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Dt:he,!1)};var Be=1,jt=2,zi=4;A.parseFunction=function(e,t,s,a,c){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!a)&&(this.type===u.star&&t&jt&&this.unexpected(),e.generator=this.eat(u.star)),this.options.ecmaVersion>=8&&(e.async=!!a),t&Be&&(e.id=t&zi&&this.type!==u.name?null:this.parseIdent(),e.id&&!(t&jt)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Dt:he:Gi));var f=this.yieldPos,d=this.awaitPos,y=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope($t(e.async,e.generator)),t&Be||(e.id=this.type===u.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,s,!1,c),this.yieldPos=f,this.awaitPos=d,this.awaitIdentPos=y,this.finishNode(e,t&Be?"FunctionDeclaration":"FunctionExpression")},A.parseFunctionParams=function(e){this.expect(u.parenL),e.params=this.parseBindingList(u.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},A.parseClass=function(e,t){this.next();var s=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var a=this.enterClassBody(),c=this.startNode(),f=!1;for(c.body=[],this.expect(u.braceL);this.type!==u.braceR;){var d=this.parseClassElement(e.superClass!==null);d&&(c.body.push(d),d.type==="MethodDefinition"&&d.kind==="constructor"?(f&&this.raiseRecoverable(d.start,"Duplicate constructor in the same class"),f=!0):d.key&&d.key.type==="PrivateIdentifier"&&uo(a,d)&&this.raiseRecoverable(d.key.start,"Identifier '#"+d.key.name+"' has already been declared"))}return this.strict=s,this.next(),e.body=this.finishNode(c,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},A.parseClassElement=function(e){if(this.eat(u.semi))return null;var t=this.options.ecmaVersion,s=this.startNode(),a="",c=!1,f=!1,d="method",y=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(u.braceL))return this.parseClassStaticBlock(s),s;this.isClassElementNameStart()||this.type===u.star?y=!0:a="static"}if(s.static=y,!a&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===u.star)&&!this.canInsertSemicolon()?f=!0:a="async"),!a&&(t>=9||!f)&&this.eat(u.star)&&(c=!0),!a&&!f&&!c){var w=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?d=w:a=w)}if(a?(s.computed=!1,s.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),s.key.name=a,this.finishNode(s.key,"Identifier")):this.parseClassElementName(s),t<13||this.type===u.parenL||d!=="method"||c||f){var T=!s.static&&st(s,"constructor"),L=T&&e;T&&d!=="method"&&this.raise(s.key.start,"Constructor can't have get/set modifier"),s.kind=T?"constructor":d,this.parseClassMethod(s,c,f,L)}else this.parseClassField(s);return s},A.isClassElementNameStart=function(){return this.type===u.name||this.type===u.privateId||this.type===u.num||this.type===u.string||this.type===u.bracketL||this.type.keyword},A.parseClassElementName=function(e){this.type===u.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},A.parseClassMethod=function(e,t,s,a){var c=e.key;e.kind==="constructor"?(t&&this.raise(c.start,"Constructor can't be a generator"),s&&this.raise(c.start,"Constructor can't be an async method")):e.static&&st(e,"prototype")&&this.raise(c.start,"Classes may not have a static property named prototype");var f=e.value=this.parseMethod(t,s,a);return e.kind==="get"&&f.params.length!==0&&this.raiseRecoverable(f.start,"getter should have no params"),e.kind==="set"&&f.params.length!==1&&this.raiseRecoverable(f.start,"setter should have exactly one param"),e.kind==="set"&&f.params[0].type==="RestElement"&&this.raiseRecoverable(f.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},A.parseClassField=function(e){return st(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&st(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(u.eq)?(this.enterScope(je|et),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},A.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(be|et);this.type!==u.braceR;){var s=this.parseStatement(null);e.body.push(s)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},A.parseClassId=function(e,t){this.type===u.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,he,!1)):(t===!0&&this.unexpected(),e.id=null)},A.parseClassSuper=function(e){e.superClass=this.eat(u._extends)?this.parseExprSubscripts(null,!1):null},A.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},A.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,s=e.used;if(this.options.checkPrivateFields)for(var a=this.privateNameStack.length,c=a===0?null:this.privateNameStack[a-1],f=0;f<s.length;++f){var d=s[f];Ie(t,d.name)||(c?c.used.push(d):this.raiseRecoverable(d.start,"Private field '#"+d.name+"' must be declared in an enclosing class"))}};function uo(e,t){var s=t.key.name,a=e[s],c="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(c=(t.static?"s":"i")+t.kind),a==="iget"&&c==="iset"||a==="iset"&&c==="iget"||a==="sget"&&c==="sset"||a==="sset"&&c==="sget"?(e[s]="true",!1):a?!0:(e[s]=c,!1)}function st(e,t){var s=e.computed,a=e.key;return!s&&(a.type==="Identifier"&&a.name===t||a.type==="Literal"&&a.value===t)}A.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==u.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},A.parseExport=function(e,t){if(this.next(),this.eat(u.star))return this.parseExportAllDeclaration(e,t);if(this.eat(u._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==u.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var s=0,a=e.specifiers;s<a.length;s+=1){var c=a[s];this.checkUnreserved(c.local),this.checkLocalExport(c.local),c.local.type==="Literal"&&this.raise(c.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},A.parseExportDeclaration=function(e){return this.parseStatement(null)},A.parseExportDefaultDeclaration=function(){var e;if(this.type===u._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Be|zi,!1,e)}else if(this.type===u._class){var s=this.startNode();return this.parseClass(s,"nullableID")}else{var a=this.parseMaybeAssign();return this.semicolon(),a}},A.checkExport=function(e,t,s){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),Ie(e,t)&&this.raiseRecoverable(s,"Duplicate export '"+t+"'"),e[t]=!0)},A.checkPatternExport=function(e,t){var s=t.type;if(s==="Identifier")this.checkExport(e,t,t.start);else if(s==="ObjectPattern")for(var a=0,c=t.properties;a<c.length;a+=1){var f=c[a];this.checkPatternExport(e,f)}else if(s==="ArrayPattern")for(var d=0,y=t.elements;d<y.length;d+=1){var w=y[d];w&&this.checkPatternExport(e,w)}else s==="Property"?this.checkPatternExport(e,t.value):s==="AssignmentPattern"?this.checkPatternExport(e,t.left):s==="RestElement"&&this.checkPatternExport(e,t.argument)},A.checkVariableExport=function(e,t){if(e)for(var s=0,a=t;s<a.length;s+=1){var c=a[s];this.checkPatternExport(e,c.id)}},A.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},A.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},A.parseExportSpecifiers=function(e){var t=[],s=!0;for(this.expect(u.braceL);!this.eat(u.braceR);){if(s)s=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;t.push(this.parseExportSpecifier(e))}return t},A.parseImport=function(e){return this.next(),this.type===u.string?(e.specifiers=oo,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===u.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},A.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,he),this.finishNode(e,"ImportSpecifier")},A.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,he),this.finishNode(e,"ImportDefaultSpecifier")},A.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,he),this.finishNode(e,"ImportNamespaceSpecifier")},A.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===u.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(u.comma)))return e;if(this.type===u.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(u.braceL);!this.eat(u.braceR);){if(t)t=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;e.push(this.parseImportSpecifier())}return e},A.parseWithClause=function(){var e=[];if(!this.eat(u._with))return e;this.expect(u.braceL);for(var t={},s=!0;!this.eat(u.braceR);){if(s)s=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;var a=this.parseImportAttribute(),c=a.key.type==="Identifier"?a.key.name:a.key.value;Ie(t,c)&&this.raiseRecoverable(a.key.start,"Duplicate attribute key '"+c+"'"),t[c]=!0,e.push(a)}return e},A.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===u.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(u.colon),this.type!==u.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},A.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===u.string){var e=this.parseLiteral(this.value);return io.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},A.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},A.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Z=j.prototype;Z.toAssignable=function(e,t,s){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",s&&this.checkPatternErrors(s,!0);for(var a=0,c=e.properties;a<c.length;a+=1){var f=c[a];this.toAssignable(f,t),f.type==="RestElement"&&(f.argument.type==="ArrayPattern"||f.argument.type==="ObjectPattern")&&this.raise(f.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",s&&this.checkPatternErrors(s,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,s);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else s&&this.checkPatternErrors(s,!0);return e},Z.toAssignableList=function(e,t){for(var s=e.length,a=0;a<s;a++){var c=e[a];c&&this.toAssignable(c,t)}if(s){var f=e[s-1];this.options.ecmaVersion===6&&t&&f&&f.type==="RestElement"&&f.argument.type!=="Identifier"&&this.unexpected(f.argument.start)}return e},Z.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},Z.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==u.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},Z.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case u.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(u.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case u.braceL:return this.parseObj(!0)}return this.parseIdent()},Z.parseBindingList=function(e,t,s,a){for(var c=[],f=!0;!this.eat(e);)if(f?f=!1:this.expect(u.comma),t&&this.type===u.comma)c.push(null);else{if(s&&this.afterTrailingComma(e))break;if(this.type===u.ellipsis){var d=this.parseRestBinding();this.parseBindingListItem(d),c.push(d),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else c.push(this.parseAssignableListItem(a))}return c},Z.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},Z.parseBindingListItem=function(e){return e},Z.parseMaybeDefault=function(e,t,s){if(s=s||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(u.eq))return s;var a=this.startNodeAt(e,t);return a.left=s,a.right=this.parseMaybeAssign(),this.finishNode(a,"AssignmentPattern")},Z.checkLValSimple=function(e,t,s){t===void 0&&(t=it);var a=t!==it;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(a?"Binding ":"Assigning to ")+e.name+" in strict mode"),a&&(t===he&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),s&&(Ie(s,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),s[e.name]=!0),t!==Wi&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":a&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return a&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,s);default:this.raise(e.start,(a?"Binding":"Assigning to")+" rvalue")}},Z.checkLValPattern=function(e,t,s){switch(t===void 0&&(t=it),e.type){case"ObjectPattern":for(var a=0,c=e.properties;a<c.length;a+=1){var f=c[a];this.checkLValInnerPattern(f,t,s)}break;case"ArrayPattern":for(var d=0,y=e.elements;d<y.length;d+=1){var w=y[d];w&&this.checkLValInnerPattern(w,t,s)}break;default:this.checkLValSimple(e,t,s)}},Z.checkLValInnerPattern=function(e,t,s){switch(t===void 0&&(t=it),e.type){case"Property":this.checkLValInnerPattern(e.value,t,s);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,s);break;case"RestElement":this.checkLValPattern(e.argument,t,s);break;default:this.checkLValPattern(e,t,s)}};var ee=function(t,s,a,c,f){this.token=t,this.isExpr=!!s,this.preserveSpace=!!a,this.override=c,this.generator=!!f},F={b_stat:new ee("{",!1),b_expr:new ee("{",!0),b_tmpl:new ee("${",!1),p_stat:new ee("(",!1),p_expr:new ee("(",!0),q_tmpl:new ee("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new ee("function",!1),f_expr:new ee("function",!0),f_expr_gen:new ee("function",!0,!1,null,!0),f_gen:new ee("function",!1,!1,null,!0)},_e=j.prototype;_e.initialContext=function(){return[F.b_stat]},_e.curContext=function(){return this.context[this.context.length-1]},_e.braceIsBlock=function(e){var t=this.curContext();return t===F.f_expr||t===F.f_stat?!0:e===u.colon&&(t===F.b_stat||t===F.b_expr)?!t.isExpr:e===u._return||e===u.name&&this.exprAllowed?K.test(this.input.slice(this.lastTokEnd,this.start)):e===u._else||e===u.semi||e===u.eof||e===u.parenR||e===u.arrow?!0:e===u.braceL?t===F.b_stat:e===u._var||e===u._const||e===u.name?!1:!this.exprAllowed},_e.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1},_e.updateContext=function(e){var t,s=this.type;s.keyword&&e===u.dot?this.exprAllowed=!1:(t=s.updateContext)?t.call(this,e):this.exprAllowed=s.beforeExpr},_e.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},u.parenR.updateContext=u.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===F.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},u.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?F.b_stat:F.b_expr),this.exprAllowed=!0},u.dollarBraceL.updateContext=function(){this.context.push(F.b_tmpl),this.exprAllowed=!0},u.parenL.updateContext=function(e){var t=e===u._if||e===u._for||e===u._with||e===u._while;this.context.push(t?F.p_stat:F.p_expr),this.exprAllowed=!0},u.incDec.updateContext=function(){},u._function.updateContext=u._class.updateContext=function(e){e.beforeExpr&&e!==u._else&&!(e===u.semi&&this.curContext()!==F.p_stat)&&!(e===u._return&&K.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===u.colon||e===u.braceL)&&this.curContext()===F.b_stat)?this.context.push(F.f_expr):this.context.push(F.f_stat),this.exprAllowed=!1},u.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},u.backQuote.updateContext=function(){this.curContext()===F.q_tmpl?this.context.pop():this.context.push(F.q_tmpl),this.exprAllowed=!1},u.star.updateContext=function(e){if(e===u._function){var t=this.context.length-1;this.context[t]===F.f_expr?this.context[t]=F.f_expr_gen:this.context[t]=F.f_gen}this.exprAllowed=!0},u.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==u.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var R=j.prototype;R.checkPropClash=function(e,t,s){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var a=e.key,c;switch(a.type){case"Identifier":c=a.name;break;case"Literal":c=String(a.value);break;default:return}var f=e.kind;if(this.options.ecmaVersion>=6){c==="__proto__"&&f==="init"&&(t.proto&&(s?s.doubleProto<0&&(s.doubleProto=a.start):this.raiseRecoverable(a.start,"Redefinition of __proto__ property")),t.proto=!0);return}c="$"+c;var d=t[c];if(d){var y;f==="init"?y=this.strict&&d.init||d.get||d.set:y=d.init||d[f],y&&this.raiseRecoverable(a.start,"Redefinition of property")}else d=t[c]={init:!1,get:!1,set:!1};d[f]=!0}},R.parseExpression=function(e,t){var s=this;return this.catchStackOverflow(function(){var a=s.start,c=s.startLoc,f=s.parseMaybeAssign(e,t);if(s.type===u.comma){var d=s.startNodeAt(a,c);for(d.expressions=[f];s.eat(u.comma);)d.expressions.push(s.parseMaybeAssign(e,t));return s.finishNode(d,"SequenceExpression")}return f})},R.parseMaybeAssign=function(e,t,s){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var a=!1,c=-1,f=-1,d=-1;t?(c=t.parenthesizedAssign,f=t.trailingComma,d=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new rt,a=!0);var y=this.start,w=this.startLoc;(this.type===u.parenL||this.type===u.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var T=this.parseMaybeConditional(e,t);if(s&&(T=s.call(this,T,y,w)),this.type.isAssign){var L=this.startNodeAt(y,w);return L.operator=this.value,this.type===u.eq&&(T=this.toAssignable(T,!1,t)),a||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=T.start&&(t.shorthandAssign=-1),this.type===u.eq?this.checkLValPattern(T):this.checkLValSimple(T),L.left=T,this.next(),L.right=this.parseMaybeAssign(e),d>-1&&(t.doubleProto=d),this.finishNode(L,"AssignmentExpression")}else a&&this.checkExpressionErrors(t,!0);return c>-1&&(t.parenthesizedAssign=c),f>-1&&(t.trailingComma=f),T},R.parseMaybeConditional=function(e,t){var s=this.start,a=this.startLoc,c=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return c;if(!(c.type==="ArrowFunctionExpression"&&c.start===s)&&this.eat(u.question)){var f=this.startNodeAt(s,a);return f.test=c,f.consequent=this.parseMaybeAssign(),this.expect(u.colon),f.alternate=this.parseMaybeAssign(e),this.finishNode(f,"ConditionalExpression")}return c},R.parseExprOps=function(e,t){var s=this.start,a=this.startLoc,c=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||c.start===s&&c.type==="ArrowFunctionExpression"?c:this.parseExprOp(c,s,a,-1,e)},R.parseExprOp=function(e,t,s,a,c){var f=this.type.binop;if(f!=null&&(!c||this.type!==u._in)&&f>a){var d=this.type===u.logicalOR||this.type===u.logicalAND,y=this.type===u.coalesce;y&&(f=u.logicalAND.binop);var w=this.value;this.next();var T=this.start,L=this.startLoc,$=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,c),T,L,f,c),X=this.buildBinary(t,s,e,$,w,d||y);return(d&&this.type===u.coalesce||y&&(this.type===u.logicalOR||this.type===u.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(X,t,s,a,c)}return e},R.buildBinary=function(e,t,s,a,c,f){a.type==="PrivateIdentifier"&&this.raise(a.start,"Private identifier can only be left side of binary expression");var d=this.startNodeAt(e,t);return d.left=s,d.operator=c,d.right=a,this.finishNode(d,f?"LogicalExpression":"BinaryExpression")},R.parseMaybeUnary=function(e,t,s,a){var c=this.start,f=this.startLoc,d;if(this.isContextual("await")&&this.canAwait)d=this.parseAwait(a),t=!0;else if(this.type.prefix){var y=this.startNode(),w=this.type===u.incDec;y.operator=this.value,y.prefix=!0,this.next(),y.argument=this.parseMaybeUnary(null,!0,w,a),this.checkExpressionErrors(e,!0),w?this.checkLValSimple(y.argument):this.strict&&y.operator==="delete"&&Xi(y.argument)?this.raiseRecoverable(y.start,"Deleting local variable in strict mode"):y.operator==="delete"&&Bt(y.argument)?this.raiseRecoverable(y.start,"Private fields can not be deleted"):t=!0,d=this.finishNode(y,w?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===u.privateId)(a||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),d=this.parsePrivateIdent(),this.type!==u._in&&this.unexpected();else{if(d=this.parseExprSubscripts(e,a),this.checkExpressionErrors(e))return d;for(;this.type.postfix&&!this.canInsertSemicolon();){var T=this.startNodeAt(c,f);T.operator=this.value,T.prefix=!1,T.argument=d,this.checkLValSimple(d),this.next(),d=this.finishNode(T,"UpdateExpression")}}if(!s&&this.eat(u.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(c,f,d,this.parseMaybeUnary(null,!1,!1,a),"**",!1);else return d};function Xi(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Xi(e.expression)}function Bt(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Bt(e.expression)||e.type==="ParenthesizedExpression"&&Bt(e.expression)}R.parseExprSubscripts=function(e,t){var s=this.start,a=this.startLoc,c=this.parseExprAtom(e,t);if(c.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return c;var f=this.parseSubscripts(c,s,a,!1,t);return e&&f.type==="MemberExpression"&&(e.parenthesizedAssign>=f.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=f.start&&(e.parenthesizedBind=-1),e.trailingComma>=f.start&&(e.trailingComma=-1)),f},R.parseSubscripts=function(e,t,s,a,c){for(var f=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,d=!1;;){var y=this.parseSubscript(e,t,s,a,f,d,c);if(y.optional&&(d=!0),y===e||y.type==="ArrowFunctionExpression"){if(d){var w=this.startNodeAt(t,s);w.expression=y,y=this.finishNode(w,"ChainExpression")}return y}e=y}},R.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(u.arrow)},R.parseSubscriptAsyncArrow=function(e,t,s,a){return this.parseArrowExpression(this.startNodeAt(e,t),s,!0,a)},R.parseSubscript=function(e,t,s,a,c,f,d){var y=this.options.ecmaVersion>=11,w=y&&this.eat(u.questionDot);a&&w&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var T=this.eat(u.bracketL);if(T||w&&this.type!==u.parenL&&this.type!==u.backQuote||this.eat(u.dot)){var L=this.startNodeAt(t,s);L.object=e,T?(L.property=this.parseExpression(),this.expect(u.bracketR)):this.type===u.privateId&&e.type!=="Super"?L.property=this.parsePrivateIdent():L.property=this.parseIdent(this.options.allowReserved!=="never"),L.computed=!!T,y&&(L.optional=w),e=this.finishNode(L,"MemberExpression")}else if(!a&&this.eat(u.parenL)){var $=new rt,X=this.yieldPos,Ge=this.awaitPos,Ae=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var ct=this.parseExprList(u.parenR,this.options.ecmaVersion>=8,!1,$);if(c&&!w&&this.shouldParseAsyncArrow())return this.checkPatternErrors($,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=X,this.awaitPos=Ge,this.awaitIdentPos=Ae,this.parseSubscriptAsyncArrow(t,s,ct,d);this.checkExpressionErrors($,!0),this.yieldPos=X||this.yieldPos,this.awaitPos=Ge||this.awaitPos,this.awaitIdentPos=Ae||this.awaitIdentPos;var Ne=this.startNodeAt(t,s);Ne.callee=e,Ne.arguments=ct,y&&(Ne.optional=w),e=this.finishNode(Ne,"CallExpression")}else if(this.type===u.backQuote){(w||f)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Te=this.startNodeAt(t,s);Te.tag=e,Te.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(Te,"TaggedTemplateExpression")}return e},R.parseExprAtom=function(e,t,s){this.type===u.slash&&this.readRegexp();var a,c=this.potentialArrowAt===this.start;switch(this.type){case u._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),a=this.startNode(),this.next(),this.type===u.parenL&&!this.allowDirectSuper&&this.raise(a.start,"super() call outside constructor of a subclass"),this.type!==u.dot&&this.type!==u.bracketL&&this.type!==u.parenL&&this.unexpected(),this.finishNode(a,"Super");case u._this:return a=this.startNode(),this.next(),this.finishNode(a,"ThisExpression");case u.name:var f=this.start,d=this.startLoc,y=this.containsEsc,w=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!y&&w.name==="async"&&!this.canInsertSemicolon()&&this.eat(u._function))return this.overrideContext(F.f_expr),this.parseFunction(this.startNodeAt(f,d),0,!1,!0,t);if(c&&!this.canInsertSemicolon()){if(this.eat(u.arrow))return this.parseArrowExpression(this.startNodeAt(f,d),[w],!1,t);if(this.options.ecmaVersion>=8&&w.name==="async"&&this.type===u.name&&!y&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return w=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(u.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(f,d),[w],!0,t)}return w;case u.regexp:var T=this.value;return a=this.parseLiteral(T.value),a.regex={pattern:T.pattern,flags:T.flags},a;case u.num:case u.string:return this.parseLiteral(this.value);case u._null:case u._true:case u._false:return a=this.startNode(),a.value=this.type===u._null?null:this.type===u._true,a.raw=this.type.keyword,this.next(),this.finishNode(a,"Literal");case u.parenL:var L=this.start,$=this.parseParenAndDistinguishExpression(c,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget($)&&(e.parenthesizedAssign=L),e.parenthesizedBind<0&&(e.parenthesizedBind=L)),$;case u.bracketL:return a=this.startNode(),this.next(),a.elements=this.parseExprList(u.bracketR,!0,!0,e),this.finishNode(a,"ArrayExpression");case u.braceL:return this.overrideContext(F.b_expr),this.parseObj(!1,e);case u._function:return a=this.startNode(),this.next(),this.parseFunction(a,0);case u._class:return this.parseClass(this.startNode(),!1);case u._new:return this.parseNew();case u.backQuote:return this.parseTemplate();case u._import:return this.options.ecmaVersion>=11?this.parseExprImport(s):this.unexpected();default:return this.parseExprAtomDefault()}},R.parseExprAtomDefault=function(){this.unexpected()},R.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===u.parenL&&!e)return this.parseDynamicImport(t);if(this.type===u.dot){var s=this.startNodeAt(t.start,t.loc&&t.loc.start);return s.name="import",t.meta=this.finishNode(s,"Identifier"),this.parseImportMeta(t)}else this.unexpected()},R.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(u.parenR)?e.options=null:(this.expect(u.comma),this.afterTrailingComma(u.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(u.parenR)||(this.expect(u.comma),this.afterTrailingComma(u.parenR)||this.unexpected())));else if(!this.eat(u.parenR)){var t=this.start;this.eat(u.comma)&&this.eat(u.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},R.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},R.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},R.parseParenExpression=function(){this.expect(u.parenL);var e=this.parseExpression();return this.expect(u.parenR),e},R.shouldParseArrow=function(e){return!this.canInsertSemicolon()},R.parseParenAndDistinguishExpression=function(e,t){var s=this.start,a=this.startLoc,c,f=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var d=this.start,y=this.startLoc,w=[],T=!0,L=!1,$=new rt,X=this.yieldPos,Ge=this.awaitPos,Ae;for(this.yieldPos=0,this.awaitPos=0;this.type!==u.parenR;)if(T?T=!1:this.expect(u.comma),f&&this.afterTrailingComma(u.parenR,!0)){L=!0;break}else if(this.type===u.ellipsis){Ae=this.start,w.push(this.parseParenItem(this.parseRestBinding())),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else w.push(this.parseMaybeAssign(!1,$,this.parseParenItem));var ct=this.lastTokEnd,Ne=this.lastTokEndLoc;if(this.expect(u.parenR),e&&this.shouldParseArrow(w)&&this.eat(u.arrow))return this.checkPatternErrors($,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=X,this.awaitPos=Ge,this.parseParenArrowList(s,a,w,t);(!w.length||L)&&this.unexpected(this.lastTokStart),Ae&&this.unexpected(Ae),this.checkExpressionErrors($,!0),this.yieldPos=X||this.yieldPos,this.awaitPos=Ge||this.awaitPos,w.length>1?(c=this.startNodeAt(d,y),c.expressions=w,this.finishNodeAt(c,"SequenceExpression",ct,Ne)):c=w[0]}else c=this.parseParenExpression();if(this.options.preserveParens){var Te=this.startNodeAt(s,a);return Te.expression=c,this.finishNode(Te,"ParenthesizedExpression")}else return c},R.parseParenItem=function(e){return e},R.parseParenArrowList=function(e,t,s,a){return this.parseArrowExpression(this.startNodeAt(e,t),s,!1,a)};var co=[];R.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===u.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var s=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),s&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var a=this.start,c=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),a,c,!0,!1),e.callee.type==="Super"&&this.raiseRecoverable(a,"Invalid use of 'super'"),this.eat(u.parenL)?e.arguments=this.parseExprList(u.parenR,this.options.ecmaVersion>=8,!1):e.arguments=co,this.finishNode(e,"NewExpression")},R.parseTemplateElement=function(e){var t=e.isTagged,s=this.startNode();return this.type===u.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),s.value={raw:this.value.replace(/\r\n?/g,`
12
12
  `),cooked:null}):s.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
@@ -14,4 +14,4 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
14
14
  `;break;default:e+=String.fromCharCode(s);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},O.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(u.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
15
15
  `&&++this.pos;case`
16
16
  `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},O.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
17
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ce(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var s=this.pos-1;this.invalidStringToken(s,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var a=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],c=parseInt(a,8);return c>255&&(a=a.slice(0,-1),c=parseInt(a,8)),this.pos+=a.length-1,t=this.input.charCodeAt(this.pos),(a!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-a.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(c)}return ve(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},O.readHexChar=function(e){var t=this.pos,s=this.readInt(16,e);return s===null&&this.invalidStringToken(t,"Bad character escape sequence"),s},O.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,s=this.pos,a=this.options.ecmaVersion>=6;this.pos<this.input.length;){var c=this.fullCharCodeAtPos();if(E(c,a))this.pos+=c<=65535?1:2;else if(c===92){this.containsEsc=!0,e+=this.input.slice(s,this.pos);var f=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var d=this.readCodePoint();(t?b:E)(d,a)||this.invalidStringToken(f,"Invalid Unicode escape"),e+=ce(d),s=this.pos}else break;t=!1}return e+this.input.slice(s,this.pos)},O.readWord=function(){var e=this.readWord1(),t=u.name;return this.keywords.test(e)&&(t=Qe[e]),this.finishToken(t,e)};var vr="8.17.0";j.acorn={Parser:j,version:vr,defaultOptions:Ze,Position:ke,SourceLocation:qe,getLineInfo:Ot,Node:Ue,TokenType:N,tokTypes:u,keywordTypes:Qe,TokContext:ee,tokContexts:F,isIdentifierChar:E,isIdentifierStart:b,Token:ut,isNewLine:ve,lineBreak:K,lineBreakG:Oi,nonASCIIwhitespace:Lt};function Po(e,t){return j.parse(e,t)}function Lo(e,t,s){return j.parseExpressionAt(e,t,s)}function Oo(e,t){return j.tokenizer(e,t)}i.Node=Ue,i.Parser=j,i.Position=ke,i.SourceLocation=qe,i.TokContext=ee,i.Token=ut,i.TokenType=N,i.defaultOptions=Ze,i.getLineInfo=Ot,i.isIdentifierChar=E,i.isIdentifierStart=b,i.isNewLine=ve,i.keywordTypes=Qe,i.lineBreak=K,i.lineBreakG=Oi,i.nonASCIIwhitespace=Lt,i.parse=Po,i.parseExpressionAt=Lo,i.tokContexts=F,i.tokTypes=u,i.tokenizer=Oo,i.version=vr})});var Pa=C((zp,Ra)=>{var{parse:nf}=Aa();function $e(){let i=new Error("Configuration reads require a data-only object export. Remove executable statements from frontfriend.config.js.");return i.code="FRONTFRIEND_CONFIG_VALIDATION",i}function Ta(i){if(i.type!=="Property"||i.computed||i.method||i.kind!=="init")throw $e();let r=i.key.type==="Identifier"?i.key.name:i.key.value;if(typeof r!="string"||["__proto__","constructor","prototype"].includes(r))throw $e();return r}function Na(i){if(i.type==="ExportDefaultDeclaration")return i.declaration;let r=i.type==="ExpressionStatement"?i.expression:null;return r?.type==="AssignmentExpression"&&r.operator==="="&&r.left.type==="MemberExpression"&&!r.left.computed&&r.left.object.name==="module"&&r.left.property.name==="exports"?r.right:null}function af(i,r){if(i.type!=="VariableDeclaration"||i.declarations.length!==1)return null;let[n]=i.declarations;return n.id.type!=="Identifier"||r?.type!=="Identifier"||r.name!==n.id.name?null:n.init}function of(i){let n=nf(i,{ecmaVersion:"latest",sourceType:"module"}).body.filter(l=>l.type!=="EmptyStatement"&&!l.directive),o=n.length===1?Na(n[0]):n.length===2?af(n[0],Na(n[1])):null;if(o?.type!=="ObjectExpression")throw $e();function h(l,p=0){if(p>64)throw $e();if(l.type==="Literal"&&(l.value===null||["string","number","boolean"].includes(typeof l.value)))return l.value;if(l.type==="ArrayExpression")return l.elements.map(m=>{if(!m)throw $e();return h(m,p+1)});if(l.type==="ObjectExpression")return Object.fromEntries(l.properties.map(m=>[Ta(m),h(m.value,p+1)]));if(l.type==="UnaryExpression"&&["-","+"].includes(l.operator)&&l.argument.type==="Literal"&&typeof l.argument.value=="number")return l.operator==="-"?-l.argument.value:l.argument.value;if(l.type==="TemplateLiteral"&&l.expressions.length===0)return l.quasis[0].value.cooked;if(l.type==="MemberExpression"&&!l.computed&&l.object.type==="MemberExpression"&&!l.object.computed&&l.object.object.name==="process"&&l.object.property.name==="env")return process.env[l.property.name];if(l.type==="LogicalExpression"&&["||","??"].includes(l.operator)){let m=h(l.left,p+1);return l.operator==="||"?m||h(l.right,p+1):m??h(l.right,p+1)}throw $e()}return{config:h(o),expression:o}}Ra.exports={parseStaticConfig:of,propertyName:Ta}});var Va=C((Xp,Oa)=>{var{DEFAULT_API_URL:uf}=St();function cf(){try{return Ci().readCredentials()?.ffApiUrl||null}catch{return null}}function La(i=process.cwd()){try{let{findFileUpward:r}=ka(),{parseStaticConfig:n}=Pa(),{readFileSafe:o}=At(),h=r("frontfriend.config.js",i);return h?n(o(h)).config:null}catch{return null}}function hf({flag:i,config:r,startDir:n,env:o=process.env,loginUrl:h=cf}={}){r===void 0&&!i&&(r=La(n));let l=i||r?.["api-url"]||r?.apiUrl||o.FF_API_URL||(typeof h=="function"?h():h)||uf;return String(l).replace(/\/+$/,"")}Oa.exports={resolveApiUrl:hf,nearestConfig:La}});var qa=C((Kp,Da)=>{var{toRuntimeComponentConfig:lf}=da(),Fa='FrontFriend components configuration not found. Run "npx frontfriend init" or "npx frontfriend sync".',ff="FrontFriend components configuration was not returned by the SaaS app. The cache was not updated.";function ki(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}function $a(i,r=Fa){if(!ki(i)||Object.keys(i).length===0)throw new Error(r);for(let[n,o]of Object.entries(i))lf(o,n);return i}var Rt=class extends Error{constructor(r){super(r),this.name="Frontfriend",this.code="FF_SETUP_REQUIRED",this.stack=`${this.name}: ${r}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.stack}};function pf(){try{let i=Ci().signedInAccount();return!!(i&&!i.expired)}catch{return!1}}function df(i=process.cwd()){let{cliCommand:r,loginCommand:n}=_t(),o=`\`${r("init",i)}\``,h="The design system is not installed in this project yet.";if(pf())return`${h} Run ${o}, then start the app again.`;let l;try{l=Va().resolveApiUrl({startDir:i})}catch{l=void 0}return`${h} Sign in with \`${n(l,i)}\`, run ${o}, then start the app again.`}function _i(i){return new Rt(df(i))}function mf(i){let r=i.appRoot||process.cwd();if(!i.exists())throw _i(r);let n=i.load(),o=n?.componentsConfig;if(!ki(o)||Object.keys(o).length===0)throw _i(r);return{componentsConfig:$a(o),icons:ki(n.icons)?n.icons:{}}}Da.exports={CACHE_ERROR_MESSAGE:Fa,SAAS_ERROR_MESSAGE:ff,assertComponentsConfig:$a,loadCachedComponents:mf,SetupRequiredError:Rt,setupRequiredError:_i}});var Wa=C((Yp,Ha)=>{var{createHash:xf,createPublicKey:gf,sign:vf,verify:yf}=require("node:crypto"),{assertComponentsConfig:Ef}=qa(),ja=16*1024*1024;function Ye(i){let r=new URL(i).origin;return r==="https://app.v4.frontfriend.dev"?"https://app.frontfriend.dev":r}function Ai(i){return xf("sha256").update(i).digest("hex")}function Se(i){if(typeof i!="string"||!/^[a-zA-Z0-9_-][a-zA-Z0-9_.-]{0,199}$/.test(i))throw new Error("Invalid token artifact identity.");return i}function Je(i){return`sdk/1/${Se(i)}`}function bf(i,r){return`${Je(i)}/releases/${Se(r)}.json`}function wf(i,r){return`${Je(i)}/tags/${Se(r)}.json`}function Ba(i,r){if(!i||typeof i!="object"||Array.isArray(i))throw new Error("Invalid token payload.");if(r==="shadcn"){if(i.base!=="shadcn"||!i.nativeTokens||typeof i.nativeCss!="string"||!i.nativeCss.trim())throw new Error("The selected Release has no native shadcn token artifact.")}else if(r==="frontfriend"){Ef(i.componentsConfig);for(let n of["tokens","variables","semanticVariables","semanticDarkVariables"])if(!i[n]||typeof i[n]!="object"||Array.isArray(i[n]))throw new Error(`Missing token field: ${n}.`)}else throw new Error("Unsupported token base library.")}function Ua(i,r={}){if(!i||i.schemaVersion!==1||i.runtime!=="sdk"||i.colorFormat!=="oklch"||!["frontfriend","shadcn"].includes(i.baseLibrary)||!/^[a-f0-9]{64}$/.test(i.digest)||!Number.isSafeInteger(i.bytes)||i.bytes<=0||i.bytes>ja||!Number.isFinite(Date.parse(i.publishedAt))||typeof i.processorVersion!="string")throw new Error("Invalid token manifest.");if(Se(i.ffId),Se(i.releaseId),Se(i.tokenVersionId),new URL(i.apiOrigin).origin!==i.apiOrigin)throw new Error("Invalid token API origin.");if(i.artifactKey!==`${Je(i.ffId)}/artifacts/${i.digest}.json`)throw new Error("Invalid token artifact path.");for(let n of["apiOrigin","ffId","releaseId","tokenVersionId","baseLibrary"]){let o=n==="apiOrigin"&&r[n]?Ye(r[n]):r[n];if(o&&i[n]!==o)throw new Error(`Token manifest does not match ${n}.`)}return i}function Ma(i,r,n){if(Ua(i,n),r.length!==i.bytes||Ai(r)!==i.digest)throw new Error("Token artifact digest or size mismatch.");let o=JSON.parse(r.toString("utf8"));if(Ba(o,i.baseLibrary),o.metadata?.ffId!==i.ffId)throw new Error("Token payload belongs to another Design System.");return o}function Sf(i,r){Ba(r,i.baseLibrary);let n=Buffer.from(JSON.stringify(r)),o=Ai(n),h={schemaVersion:1,runtime:"sdk",colorFormat:"oklch",apiOrigin:Ye(i.apiOrigin),ffId:i.ffId,releaseId:i.releaseId,tokenVersionId:i.tokenVersionId,baseLibrary:i.baseLibrary,processorVersion:i.processorVersion,publishedAt:i.publishedAt,digest:o,bytes:n.length,artifactKey:`${Je(i.ffId)}/artifacts/${o}.json`};return Ma(h,n),{manifest:h,bytes:n}}var Ga={"https://app.frontfriend.dev":"MCowBQYDK2VwAyEAQNi4QA/eGZeq4jNgL4HfvlzuF6pTTOjsJYWYOmT9RMc=","https://app.dev.frontfriend.dev":"MCowBQYDK2VwAyEAEFTW/bfHgmUqTT1D12GkWv5uvDvo/Xl4+rbFrUTWy90="};function Cf(i,r){let n=Buffer.from(JSON.stringify({schemaVersion:1,capability:"tokens.offline",...i,apiOrigin:Ye(i.apiOrigin)}));return{payload:n.toString("base64"),signature:vf(null,n,r).toString("base64")}}function If(i,r,n){if(r[i])return r[i];let{hostname:o}=new URL(i);return["localhost","127.0.0.1","[::1]"].includes(o)?n.FF_OFFLINE_LICENSE_LOCAL_KEY:void 0}function kf(i,r,n=Ga,o=process.env){let h=Ye(r.apiOrigin),l=If(h,n,o);if(!l)throw new Error("This Frontfriend platform issues no offline licenses.");if(typeof i?.payload!="string"||typeof i?.signature!="string")throw new Error("Malformed offline license.");let p=Buffer.from(i.payload,"base64"),m=gf({key:Buffer.from(l,"base64"),format:"der",type:"spki"});if(!yf(null,p,m,Buffer.from(i.signature,"base64")))throw new Error("The offline license signature is invalid.");let g=JSON.parse(p.toString("utf8"));if(g.schemaVersion!==1||g.capability!=="tokens.offline"||g.ffId!==r.ffId||g.apiOrigin!==h)throw new Error("The offline license belongs to another Design System or platform.");return g}Ha.exports={OFFLINE_LICENSE_KEYS:Ga,signOfflineLicense:Cf,verifyOfflineLicense:kf,tokenApiOrigin:Ye,MAX_ARTIFACT_BYTES:ja,digest:Ai,segment:Se,prefix:Je,releaseKey:bf,tagKey:wf,assertManifest:Ua,validateArtifact:Ma,makeArtifact:Sf}});var Ce=require("node:fs"),De=require("node:path"),_f=require("node:http"),Af=require("node:https"),{randomUUID:Nf}=require("node:crypto"),{loginCommand:Xa}=_t(),{MAX_ARTIFACT_BYTES:Ka,tokenApiOrigin:Ya,digest:Ni,releaseKey:Ti,tagKey:Tf,assertManifest:Pt,validateArtifact:Rf,OFFLINE_LICENSE_KEYS:Pf,verifyOfflineLicense:za}=Wa();function Lf(i,r={},n=process.env){let o=r["token-cdn-url"]??n.FF_TOKEN_CDN_URL;if(o===!1||o==="disabled")return null;if(o)return String(o).replace(/\/+$/,"");let h=Ya(i);return h==="https://app.frontfriend.dev"?"https://tokens.frontfriend.dev":h==="https://app.dev.frontfriend.dev"?"https://tokens.dev.frontfriend.dev":null}function Pi(i){let r=new URL(i);if(r.username||r.password||r.hash||r.protocol!=="https:"&&!(r.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(r.hostname)))throw new Error("Token delivery requires HTTPS (HTTP is allowed only on localhost).");return r}function Ja(i,{timeoutMs:r=5e3,maxBytes:n=Ka,authToken:o}={}){let h=Pi(i);return new Promise((l,p)=>{let m=(h.protocol==="https:"?Af:_f).get(h,{headers:{accept:"application/json",...o?{authorization:`Bearer ${o}`}:{}}},x=>{if(x.statusCode!==200){x.resume();let b=Object.assign(new Error(x.statusCode===401?`Sign in with \`${Xa(h.origin)}\`, then run init again.`:x.statusCode===403?"You don't have access to this design system yet. Ask a workspace admin to invite you, accept the invitation from your email, then run init again.":`Token delivery returned HTTP ${x.statusCode}.`),{statusCode:x.statusCode,url:h.toString()});p(b),m.destroy();return}let S=0,v=[];x.on("data",b=>{S+=b.length,S>n?(p(new Error("Token response exceeds the size limit.")),m.destroy()):v.push(b)}),x.on("end",()=>l(Buffer.concat(v))),x.on("error",p),x.on("aborted",()=>p(Object.assign(new Error("Token response was interrupted."),{code:"ECONNRESET"})))}),g=setTimeout(()=>m.destroy(Object.assign(new Error("Token delivery timed out."),{code:"ETIMEDOUT"})),r);m.on("error",p),m.on("close",()=>clearTimeout(g))})}function Qa(i){return Object.assign(new Error(`Sign in with \`${Xa(i)}\`, then run init again. Tokens are delivered only to accounts with access to this Design System.`),{statusCode:401})}function Of(i){return Object.assign(new Error(`${i} Offline tokens are not enabled for this Workspace: ask your Frontfriend contact to enable them, then run init online once.`),{code:"FF_OFFLINE_TOKENS_UNAVAILABLE"})}function Za(i,r){return r==="cdn"&&i.statusCode===404?!0:i.statusCode?i.statusCode===408||i.statusCode>=500:["ECONNREFUSED","ECONNRESET","ETIMEDOUT","ENOTFOUND","EAI_AGAIN","EHOSTUNREACH","ENETUNREACH","EPIPE"].includes(i.code)}function Ri(i,r){Ce.mkdirSync(De.dirname(i),{recursive:!0});let n=`${i}.${Nf()}.tmp`;try{Ce.writeFileSync(n,JSON.stringify(r),{flag:"wx"}),Ce.renameSync(n,i)}finally{Ce.rmSync(n,{force:!0})}}var Li=class{constructor({ffId:r,apiUrl:n,cdnUrl:o,appRoot:h=process.cwd(),authToken:l,licenseKeys:p=Pf,read:m=Ja,studioTimeoutMs:g=3e3,cdnTimeoutMs:x=5e3}){this.ffId=r,this.apiUrl=Pi(n).origin,this.apiOrigin=Ya(this.apiUrl),this.cdnUrl=Pi(o).toString().replace(/\/+$/,""),this.appRoot=h,this.authToken=l,this.licenseKeys=p,this.root=De.join(h,".frontfriend","artifacts",Ni(`${this.apiOrigin}/${r}`)),this.licenseFile=De.join(this.root,"offline-license.json"),this.read=m,this.studioTimeoutMs=g,this.cdnTimeoutMs=x}offlineLicense(){try{return za(JSON.parse(Ce.readFileSync(this.licenseFile,"utf8")),{ffId:this.ffId,apiOrigin:this.apiOrigin},this.licenseKeys)}catch{return null}}acceptLicense(r){try{za(r,{ffId:this.ffId,apiOrigin:this.apiOrigin},this.licenseKeys)}catch{Ce.rmSync(this.licenseFile,{force:!0});return}Ri(this.licenseFile,r)}async fetch(r={}){if(r.offline){if(!this.offlineLicense())throw Of("Offline token restore needs an offline license.")}else if(!this.authToken)throw Qa(this.apiUrl);if(!r.release&&!r.tag)throw new Error("Choose a Release or tag for token delivery.");let n={ffId:this.ffId,apiOrigin:this.apiOrigin,releaseId:r.release,tokenVersionId:r.version,baseLibrary:r.baseLibrary},o=r.release?Ti(this.ffId,r.release):Tf(this.ffId,r.tag),h=De.join(this.root,`${Ni(o)}.json`),l=[],p,m=g=>{let x=Pt(g.manifest,n);if(p&&x.digest!==p.digest)throw new Error("Local tokens do not match the selected artifact.");let S=Buffer.from(g.payload,"base64");return{manifest:x,payload:Rf(x,S,n)}};if(!r.offline){let g=this.offlineLicense()?["studio","cdn"]:["studio"];for(let x of g)try{let S;if(x==="studio"){let b=new URL(`/api/design-systems/${encodeURIComponent(this.ffId)}/token-artifact`,this.apiUrl);b.searchParams.set(r.release?"release":"tag",r.release||r.tag),S=JSON.parse((await this.read(b.toString(),{timeoutMs:this.studioTimeoutMs,maxBytes:Ka*2,authToken:this.authToken})).toString("utf8")),p=Pt(S.manifest,n),n.releaseId=p.releaseId}else{let b=Date.now(),E=JSON.parse((await this.read(`${this.cdnUrl}/${o}`,{timeoutMs:this.cdnTimeoutMs,maxBytes:65536})).toString("utf8"));if(E.unavailable)throw Object.assign(new Error("The selected token release or tag is unavailable."),{statusCode:410});if(Pt(E,n),p=E,n.releaseId=E.releaseId,!r.release){let G=this.cdnTimeoutMs-(Date.now()-b);if(G<=0)throw Object.assign(new Error("Token delivery timed out."),{code:"ETIMEDOUT"});if(E=JSON.parse((await this.read(`${this.cdnUrl}/${Ti(this.ffId,E.releaseId)}`,{timeoutMs:G,maxBytes:65536})).toString("utf8")),E.unavailable)throw Object.assign(new Error("The selected token release is unavailable."),{statusCode:410});Pt(E,n)}let N=this.cdnTimeoutMs-(Date.now()-b);if(N<=0)throw Object.assign(new Error("Token delivery timed out."),{code:"ETIMEDOUT"});let q=await this.read(`${this.cdnUrl}/${E.artifactKey}`,{timeoutMs:N});S={manifest:E,payload:q.toString("base64")}}let v=m(S);return x==="studio"&&this.acceptLicense(S.offlineLicense),Ri(h,S),r.release||Ri(De.join(De.dirname(h),`${Ni(Ti(this.ffId,v.manifest.releaseId))}.json`),S),this.result(v,x,l)}catch(S){if(!Za(S,x))throw S;l.push(`${x}: ${S.message}`)}}try{return this.result(m(JSON.parse(Ce.readFileSync(h,"utf8"))),"local",l)}catch(g){throw new Error(`Selected token artifact unavailable. ${[...l,`local: ${g.message}`].join(" ")}`)}}result({manifest:r,payload:n},o,h){return{...n,versionMetadata:{...n.versionMetadata,versionId:r.tokenVersionId,releaseId:r.releaseId},tokenDelivery:{source:o,manifest:r,warnings:h,remoteWorkPending:!0}}}};module.exports={TokenArtifactClient:Li,cdnUrlFor:Lf,readPublicBytes:Ja,canFallback:Za,signInError:Qa};
17
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ce(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var s=this.pos-1;this.invalidStringToken(s,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var a=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],c=parseInt(a,8);return c>255&&(a=a.slice(0,-1),c=parseInt(a,8)),this.pos+=a.length-1,t=this.input.charCodeAt(this.pos),(a!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-a.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(c)}return ve(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},O.readHexChar=function(e){var t=this.pos,s=this.readInt(16,e);return s===null&&this.invalidStringToken(t,"Bad character escape sequence"),s},O.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,s=this.pos,a=this.options.ecmaVersion>=6;this.pos<this.input.length;){var c=this.fullCharCodeAtPos();if(E(c,a))this.pos+=c<=65535?1:2;else if(c===92){this.containsEsc=!0,e+=this.input.slice(s,this.pos);var f=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var d=this.readCodePoint();(t?b:E)(d,a)||this.invalidStringToken(f,"Invalid Unicode escape"),e+=ce(d),s=this.pos}else break;t=!1}return e+this.input.slice(s,this.pos)},O.readWord=function(){var e=this.readWord1(),t=u.name;return this.keywords.test(e)&&(t=Qe[e]),this.finishToken(t,e)};var vr="8.17.0";j.acorn={Parser:j,version:vr,defaultOptions:Ze,Position:ke,SourceLocation:qe,getLineInfo:Ot,Node:Ue,TokenType:N,tokTypes:u,keywordTypes:Qe,TokContext:ee,tokContexts:F,isIdentifierChar:E,isIdentifierStart:b,Token:ut,isNewLine:ve,lineBreak:K,lineBreakG:Oi,nonASCIIwhitespace:Lt};function Po(e,t){return j.parse(e,t)}function Lo(e,t,s){return j.parseExpressionAt(e,t,s)}function Oo(e,t){return j.tokenizer(e,t)}i.Node=Ue,i.Parser=j,i.Position=ke,i.SourceLocation=qe,i.TokContext=ee,i.Token=ut,i.TokenType=N,i.defaultOptions=Ze,i.getLineInfo=Ot,i.isIdentifierChar=E,i.isIdentifierStart=b,i.isNewLine=ve,i.keywordTypes=Qe,i.lineBreak=K,i.lineBreakG=Oi,i.nonASCIIwhitespace=Lt,i.parse=Po,i.parseExpressionAt=Lo,i.tokContexts=F,i.tokTypes=u,i.tokenizer=Oo,i.version=vr})});var Pa=C((Kp,Ra)=>{var{parse:of}=Aa();function $e(){let i=new Error("Configuration reads require a data-only object export. Remove executable statements from frontfriend.config.js.");return i.code="FRONTFRIEND_CONFIG_VALIDATION",i}function Ta(i){if(i.type!=="Property"||i.computed||i.method||i.kind!=="init")throw $e();let r=i.key.type==="Identifier"?i.key.name:i.key.value;if(typeof r!="string"||["__proto__","constructor","prototype"].includes(r))throw $e();return r}function Na(i){if(i.type==="ExportDefaultDeclaration")return i.declaration;let r=i.type==="ExpressionStatement"?i.expression:null;return r?.type==="AssignmentExpression"&&r.operator==="="&&r.left.type==="MemberExpression"&&!r.left.computed&&r.left.object.name==="module"&&r.left.property.name==="exports"?r.right:null}function uf(i,r){if(i.type!=="VariableDeclaration"||i.declarations.length!==1)return null;let[n]=i.declarations;return n.id.type!=="Identifier"||r?.type!=="Identifier"||r.name!==n.id.name?null:n.init}function cf(i){let n=of(i,{ecmaVersion:"latest",sourceType:"module"}).body.filter(l=>l.type!=="EmptyStatement"&&!l.directive),o=n.length===1?Na(n[0]):n.length===2?uf(n[0],Na(n[1])):null;if(o?.type!=="ObjectExpression")throw $e();function h(l,p=0){if(p>64)throw $e();if(l.type==="Literal"&&(l.value===null||["string","number","boolean"].includes(typeof l.value)))return l.value;if(l.type==="ArrayExpression")return l.elements.map(m=>{if(!m)throw $e();return h(m,p+1)});if(l.type==="ObjectExpression")return Object.fromEntries(l.properties.map(m=>[Ta(m),h(m.value,p+1)]));if(l.type==="UnaryExpression"&&["-","+"].includes(l.operator)&&l.argument.type==="Literal"&&typeof l.argument.value=="number")return l.operator==="-"?-l.argument.value:l.argument.value;if(l.type==="TemplateLiteral"&&l.expressions.length===0)return l.quasis[0].value.cooked;if(l.type==="MemberExpression"&&!l.computed&&l.object.type==="MemberExpression"&&!l.object.computed&&l.object.object.name==="process"&&l.object.property.name==="env")return process.env[l.property.name];if(l.type==="LogicalExpression"&&["||","??"].includes(l.operator)){let m=h(l.left,p+1);return l.operator==="||"?m||h(l.right,p+1):m??h(l.right,p+1)}throw $e()}return{config:h(o),expression:o}}Ra.exports={parseStaticConfig:cf,propertyName:Ta}});var Va=C((Yp,Oa)=>{var{DEFAULT_API_URL:hf}=St();function lf(){try{return Ci().readCredentials()?.ffApiUrl||null}catch{return null}}function La(i=process.cwd()){try{let{findFileUpward:r}=ka(),{parseStaticConfig:n}=Pa(),{readFileSafe:o}=At(),h=r("frontfriend.config.js",i);return h?n(o(h)).config:null}catch{return null}}function ff({flag:i,config:r,startDir:n,env:o=process.env,loginUrl:h=lf}={}){r===void 0&&!i&&(r=La(n));let l=i||r?.["api-url"]||r?.apiUrl||o.FF_API_URL||(typeof h=="function"?h():h)||hf;return String(l).replace(/\/+$/,"")}Oa.exports={resolveApiUrl:ff,nearestConfig:La}});var qa=C((Jp,Da)=>{var{toRuntimeComponentConfig:pf}=da(),Fa='FrontFriend components configuration not found. Run "npx frontfriend init" or "npx frontfriend sync".',df="FrontFriend components configuration was not returned by the SaaS app. The cache was not updated.";function ki(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}function $a(i,r=Fa){if(!ki(i)||Object.keys(i).length===0)throw new Error(r);for(let[n,o]of Object.entries(i))pf(o,n);return i}var Rt=class extends Error{constructor(r){super(r),this.name="Frontfriend",this.code="FF_SETUP_REQUIRED",this.stack=`${this.name}: ${r}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.stack}};function mf(){try{let i=Ci().signedInAccount();return!!(i&&!i.expired)}catch{return!1}}function xf(i=process.cwd()){let{cliCommand:r,loginCommand:n}=_t(),o=`\`${r("init",i)}\``,h="The design system is not installed in this project yet.";if(mf())return`${h} Run ${o}, then start the app again.`;let l;try{l=Va().resolveApiUrl({startDir:i})}catch{l=void 0}return`${h} Sign in with \`${n(l,i)}\`, run ${o}, then start the app again.`}function _i(i){return new Rt(xf(i))}function gf(i){let r=i.appRoot||process.cwd();if(!i.exists())throw _i(r);let n=i.load(),o=n?.componentsConfig;if(!ki(o)||Object.keys(o).length===0)throw _i(r);return{componentsConfig:$a(o),icons:ki(n.icons)?n.icons:{}}}Da.exports={CACHE_ERROR_MESSAGE:Fa,SAAS_ERROR_MESSAGE:df,assertComponentsConfig:$a,loadCachedComponents:gf,SetupRequiredError:Rt,setupRequiredError:_i}});var Wa=C((Qp,Ha)=>{var{createHash:vf,createPublicKey:yf,sign:Ef,verify:bf}=require("node:crypto"),{assertComponentsConfig:wf}=qa(),ja=16*1024*1024;function Ye(i){let r=new URL(i).origin;return r==="https://app.v4.frontfriend.dev"?"https://app.frontfriend.dev":r}function Ai(i){return vf("sha256").update(i).digest("hex")}function Se(i){if(typeof i!="string"||!/^[a-zA-Z0-9_-][a-zA-Z0-9_.-]{0,199}$/.test(i))throw new Error("Invalid token artifact identity.");return i}function Je(i){return`sdk/1/${Se(i)}`}function Sf(i,r){return`${Je(i)}/releases/${Se(r)}.json`}function Cf(i,r){return`${Je(i)}/tags/${Se(r)}.json`}function Ba(i,r){if(!i||typeof i!="object"||Array.isArray(i))throw new Error("Invalid token payload.");if(r==="shadcn"){if(i.base!=="shadcn"||!i.nativeTokens||typeof i.nativeCss!="string"||!i.nativeCss.trim())throw new Error("The selected Release has no native shadcn token artifact.")}else if(r==="frontfriend"){wf(i.componentsConfig);for(let n of["tokens","variables","semanticVariables","semanticDarkVariables"])if(!i[n]||typeof i[n]!="object"||Array.isArray(i[n]))throw new Error(`Missing token field: ${n}.`)}else throw new Error("Unsupported token base library.")}function Ua(i,r={}){if(!i||i.schemaVersion!==1||i.runtime!=="sdk"||i.colorFormat!=="oklch"||!["frontfriend","shadcn"].includes(i.baseLibrary)||!/^[a-f0-9]{64}$/.test(i.digest)||!Number.isSafeInteger(i.bytes)||i.bytes<=0||i.bytes>ja||!Number.isFinite(Date.parse(i.publishedAt))||typeof i.processorVersion!="string")throw new Error("Invalid token manifest.");if(Se(i.ffId),Se(i.releaseId),Se(i.tokenVersionId),new URL(i.apiOrigin).origin!==i.apiOrigin)throw new Error("Invalid token API origin.");if(i.artifactKey!==`${Je(i.ffId)}/artifacts/${i.digest}.json`)throw new Error("Invalid token artifact path.");for(let n of["apiOrigin","ffId","releaseId","tokenVersionId","baseLibrary"]){let o=n==="apiOrigin"&&r[n]?Ye(r[n]):r[n];if(o&&i[n]!==o)throw new Error(`Token manifest does not match ${n}.`)}return i}function Ma(i,r,n){if(Ua(i,n),r.length!==i.bytes||Ai(r)!==i.digest)throw new Error("Token artifact digest or size mismatch.");let o=JSON.parse(r.toString("utf8"));if(Ba(o,i.baseLibrary),o.metadata?.ffId!==i.ffId)throw new Error("Token payload belongs to another Design System.");return o}function If(i,r){Ba(r,i.baseLibrary);let n=Buffer.from(JSON.stringify(r)),o=Ai(n),h={schemaVersion:1,runtime:"sdk",colorFormat:"oklch",apiOrigin:Ye(i.apiOrigin),ffId:i.ffId,releaseId:i.releaseId,tokenVersionId:i.tokenVersionId,baseLibrary:i.baseLibrary,processorVersion:i.processorVersion,publishedAt:i.publishedAt,digest:o,bytes:n.length,artifactKey:`${Je(i.ffId)}/artifacts/${o}.json`};return Ma(h,n),{manifest:h,bytes:n}}var Ga={"https://app.frontfriend.dev":"MCowBQYDK2VwAyEAQNi4QA/eGZeq4jNgL4HfvlzuF6pTTOjsJYWYOmT9RMc=","https://app.dev.frontfriend.dev":"MCowBQYDK2VwAyEAEFTW/bfHgmUqTT1D12GkWv5uvDvo/Xl4+rbFrUTWy90="};function kf(i,r){let n=Buffer.from(JSON.stringify({schemaVersion:1,capability:"tokens.offline",...i,apiOrigin:Ye(i.apiOrigin)}));return{payload:n.toString("base64"),signature:Ef(null,n,r).toString("base64")}}function _f(i,r,n){if(r[i])return r[i];let{hostname:o}=new URL(i);return["localhost","127.0.0.1","[::1]"].includes(o)?n.FF_OFFLINE_LICENSE_LOCAL_KEY:void 0}function Af(i,r,n=Ga,o=process.env){let h=Ye(r.apiOrigin),l=_f(h,n,o);if(!l)throw new Error("This Frontfriend platform issues no offline licenses.");if(typeof i?.payload!="string"||typeof i?.signature!="string")throw new Error("Malformed offline license.");let p=Buffer.from(i.payload,"base64"),m=yf({key:Buffer.from(l,"base64"),format:"der",type:"spki"});if(!bf(null,p,m,Buffer.from(i.signature,"base64")))throw new Error("The offline license signature is invalid.");let g=JSON.parse(p.toString("utf8"));if(g.schemaVersion!==1||g.capability!=="tokens.offline"||g.ffId!==r.ffId||g.apiOrigin!==h)throw new Error("The offline license belongs to another Design System or platform.");return g}Ha.exports={OFFLINE_LICENSE_KEYS:Ga,signOfflineLicense:kf,verifyOfflineLicense:Af,tokenApiOrigin:Ye,MAX_ARTIFACT_BYTES:ja,digest:Ai,segment:Se,prefix:Je,releaseKey:Sf,tagKey:Cf,assertManifest:Ua,validateArtifact:Ma,makeArtifact:If}});var Ce=require("node:fs"),De=require("node:path"),Nf=require("node:http"),Tf=require("node:https"),{randomUUID:Rf}=require("node:crypto"),{loginCommand:Xa}=_t(),{MAX_ARTIFACT_BYTES:Ka,tokenApiOrigin:Ya,digest:Ni,releaseKey:Ti,tagKey:Pf,assertManifest:Pt,validateArtifact:Lf,OFFLINE_LICENSE_KEYS:Of,verifyOfflineLicense:za}=Wa();function Vf(i,r={},n=process.env){let o=r["token-cdn-url"]??n.FF_TOKEN_CDN_URL;if(o===!1||o==="disabled")return null;if(o)return String(o).replace(/\/+$/,"");let h=Ya(i);return h==="https://app.frontfriend.dev"?"https://tokens.frontfriend.dev":h==="https://app.dev.frontfriend.dev"?"https://tokens.dev.frontfriend.dev":null}function Pi(i){let r=new URL(i);if(r.username||r.password||r.hash||r.protocol!=="https:"&&!(r.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(r.hostname)))throw new Error("Token delivery requires HTTPS (HTTP is allowed only on localhost).");return r}function Ja(i,{timeoutMs:r=5e3,maxBytes:n=Ka,authToken:o}={}){let h=Pi(i);return new Promise((l,p)=>{let m=(h.protocol==="https:"?Tf:Nf).get(h,{headers:{accept:"application/json",...o?{authorization:`Bearer ${o}`}:{}}},x=>{if(x.statusCode!==200){x.resume();let b=Object.assign(new Error(x.statusCode===401?`Sign in with \`${Xa(h.origin)}\`, then run init again.`:x.statusCode===403?"You don't have access to this design system yet. Ask a workspace admin to invite you, accept the invitation from your email, then run init again.":`Token delivery returned HTTP ${x.statusCode}.`),{statusCode:x.statusCode,url:h.toString()});p(b),m.destroy();return}let S=0,v=[];x.on("data",b=>{S+=b.length,S>n?(p(new Error("Token response exceeds the size limit.")),m.destroy()):v.push(b)}),x.on("end",()=>l(Buffer.concat(v))),x.on("error",p),x.on("aborted",()=>p(Object.assign(new Error("Token response was interrupted."),{code:"ECONNRESET"})))}),g=setTimeout(()=>m.destroy(Object.assign(new Error("Token delivery timed out."),{code:"ETIMEDOUT"})),r);m.on("error",p),m.on("close",()=>clearTimeout(g))})}function Qa(i){return Object.assign(new Error(`Sign in with \`${Xa(i)}\`, then run init again. Tokens are delivered only to accounts with access to this Design System.`),{statusCode:401})}function Ff(i){return Object.assign(new Error(`${i} Offline tokens are not enabled for this Workspace: ask your Frontfriend contact to enable them, then run init online once.`),{code:"FF_OFFLINE_TOKENS_UNAVAILABLE"})}function Za(i,r){return r==="cdn"&&i.statusCode===404?!0:i.statusCode?i.statusCode===408||i.statusCode>=500:["ECONNREFUSED","ECONNRESET","ETIMEDOUT","ENOTFOUND","EAI_AGAIN","EHOSTUNREACH","ENETUNREACH","EPIPE"].includes(i.code)}function Ri(i,r){Ce.mkdirSync(De.dirname(i),{recursive:!0});let n=`${i}.${Rf()}.tmp`;try{Ce.writeFileSync(n,JSON.stringify(r),{flag:"wx"}),Ce.renameSync(n,i)}finally{Ce.rmSync(n,{force:!0})}}var Li=class{constructor({ffId:r,apiUrl:n,cdnUrl:o,appRoot:h=process.cwd(),authToken:l,licenseKeys:p=Of,read:m=Ja,studioTimeoutMs:g=3e3,cdnTimeoutMs:x=5e3}){this.ffId=r,this.apiUrl=Pi(n).origin,this.apiOrigin=Ya(this.apiUrl),this.cdnUrl=Pi(o).toString().replace(/\/+$/,""),this.appRoot=h,this.authToken=l,this.licenseKeys=p,this.root=De.join(h,".frontfriend","artifacts",Ni(`${this.apiOrigin}/${r}`)),this.licenseFile=De.join(this.root,"offline-license.json"),this.read=m,this.studioTimeoutMs=g,this.cdnTimeoutMs=x}offlineLicense(){try{return za(JSON.parse(Ce.readFileSync(this.licenseFile,"utf8")),{ffId:this.ffId,apiOrigin:this.apiOrigin},this.licenseKeys)}catch{return null}}acceptLicense(r){try{za(r,{ffId:this.ffId,apiOrigin:this.apiOrigin},this.licenseKeys)}catch{Ce.rmSync(this.licenseFile,{force:!0});return}Ri(this.licenseFile,r)}async fetch(r={}){if(r.offline){if(!this.offlineLicense())throw Ff("Offline token restore needs an offline license.")}else if(!this.authToken)throw Qa(this.apiUrl);if(!r.release&&!r.tag)throw new Error("Choose a Release or tag for token delivery.");let n={ffId:this.ffId,apiOrigin:this.apiOrigin,releaseId:r.release,tokenVersionId:r.version,baseLibrary:r.baseLibrary},o=r.release?Ti(this.ffId,r.release):Pf(this.ffId,r.tag),h=De.join(this.root,`${Ni(o)}.json`),l=[],p,m=g=>{let x=Pt(g.manifest,n);if(p&&x.digest!==p.digest)throw new Error("Local tokens do not match the selected artifact.");let S=Buffer.from(g.payload,"base64");return{manifest:x,payload:Lf(x,S,n)}};if(!r.offline){let g=this.offlineLicense()?["studio","cdn"]:["studio"];for(let x of g)try{let S;if(x==="studio"){let b=new URL(`/api/design-systems/${encodeURIComponent(this.ffId)}/token-artifact`,this.apiUrl);b.searchParams.set(r.release?"release":"tag",r.release||r.tag),S=JSON.parse((await this.read(b.toString(),{timeoutMs:this.studioTimeoutMs,maxBytes:Ka*2,authToken:this.authToken})).toString("utf8")),p=Pt(S.manifest,n),n.releaseId=p.releaseId}else{let b=Date.now(),E=JSON.parse((await this.read(`${this.cdnUrl}/${o}`,{timeoutMs:this.cdnTimeoutMs,maxBytes:65536})).toString("utf8"));if(E.unavailable)throw Object.assign(new Error("The selected token release or tag is unavailable."),{statusCode:410});if(Pt(E,n),p=E,n.releaseId=E.releaseId,!r.release){let G=this.cdnTimeoutMs-(Date.now()-b);if(G<=0)throw Object.assign(new Error("Token delivery timed out."),{code:"ETIMEDOUT"});if(E=JSON.parse((await this.read(`${this.cdnUrl}/${Ti(this.ffId,E.releaseId)}`,{timeoutMs:G,maxBytes:65536})).toString("utf8")),E.unavailable)throw Object.assign(new Error("The selected token release is unavailable."),{statusCode:410});Pt(E,n)}let N=this.cdnTimeoutMs-(Date.now()-b);if(N<=0)throw Object.assign(new Error("Token delivery timed out."),{code:"ETIMEDOUT"});let q=await this.read(`${this.cdnUrl}/${E.artifactKey}`,{timeoutMs:N});S={manifest:E,payload:q.toString("base64")}}let v=m(S);return x==="studio"&&this.acceptLicense(S.offlineLicense),Ri(h,S),r.release||Ri(De.join(De.dirname(h),`${Ni(Ti(this.ffId,v.manifest.releaseId))}.json`),S),this.result(v,x,l)}catch(S){if(!Za(S,x))throw S;l.push(`${x}: ${S.message}`)}}try{return this.result(m(JSON.parse(Ce.readFileSync(h,"utf8"))),"local",l)}catch(g){throw new Error(`Selected token artifact unavailable. ${[...l,`local: ${g.message}`].join(" ")}`)}}result({manifest:r,payload:n},o,h){return{...n,versionMetadata:{...n.versionMetadata,versionId:r.tokenVersionId,releaseId:r.releaseId},tokenDelivery:{source:o,manifest:r,warnings:h,remoteWorkPending:!0}}}};module.exports={TokenArtifactClient:Li,cdnUrlFor:Vf,readPublicBytes:Ja,canFallback:Za,signInError:Qa};