@frontfriend/sdk 1.2.5 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/next.js CHANGED
@@ -1,4 +1,4 @@
1
- var w=(r,i)=>()=>(i||r((i={exports:{}}).exports,i),i.exports);var gr=w((Lf,Oo)=>{Oo.exports={name:"@frontfriend/sdk",version:"1.2.5"}});var yr=w((Of,vr)=>{var{name:Vo}=gr();vr.exports={PACKAGE_NAME:Vo}});var Me=w((Vf,Er)=>{var Fo="https://app.frontfriend.dev",Do=".cache/frontfriend",$o={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"]},qo={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function jo(r){if(!r)return null;try{let i=new URL(r);return i.hostname.startsWith("app.")?`${i.protocol}//${i.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}Er.exports={DEFAULT_API_URL:Fo,CACHE_DIR_NAME:Do,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:$o,ENV_VARS:qo,deriveRegistryFromApiUrl:jo}});var Sr=w((Ff,br)=>{var qt=class extends Error{constructor(i,n,o){super(i),this.name="APIError",this.statusCode=n,this.url=o,this.code=`API_${n}`}},jt=class extends Error{constructor(i,n){super(i),this.name="CacheError",this.operation=n,this.code=`CACHE_${n.toUpperCase()}`}},Bt=class extends Error{constructor(i,n){super(i),this.name="ConfigError",this.field=n,this.code=n?`CONFIG_${String(n).toUpperCase()}`:"CONFIG_ERROR"}},Ut=class extends Error{constructor(i,n){super(i),this.name="ProcessingError",this.token=n,this.code="PROCESSING_ERROR"}};br.exports={APIError:qt,CacheError:jt,ConfigError:Bt,ProcessingError:Ut}});var Ge=w((Df,wr)=>{var j=require("fs");function Bo(r){try{let i=j.readFileSync(r,"utf8");return JSON.parse(i)}catch(i){if(i.code==="ENOENT")return null;throw i}}function Uo(r){try{return j.readFileSync(r,"utf8").replace(/^\uFEFF/,"")}catch(i){if(i.code==="ENOENT")return null;throw i}}function Mo(r,i,n=2){let o=JSON.stringify(i,null,n);j.writeFileSync(r,o,"utf8")}function Go(r,i){j.writeFileSync(r,i,"utf8")}function Ho(r,i){if(i==null||typeof i=="object"&&Object.keys(i).length===0||Array.isArray(i)&&i.length===0){let o=`module.exports = ${Array.isArray(i)?"[]":"{}"};`;j.writeFileSync(r,o,"utf8")}else{let n=`module.exports = ${JSON.stringify(i,null,2)};`;j.writeFileSync(r,n,"utf8")}}function Wo(r){return j.existsSync(r)}function Xo(r){j.mkdirSync(r,{recursive:!0})}function zo(r){j.rmSync(r,{recursive:!0,force:!0})}function Ko(r){j.rmSync(r,{force:!0})}function Yo(r,i){j.mkdirSync(require("path").dirname(r),{recursive:!0,mode:448});let n=`${r}.${process.pid}.${Date.now()}.tmp`;try{j.writeFileSync(n,`${JSON.stringify(i,null,2)}
1
+ var w=(r,i)=>()=>(i||r((i={exports:{}}).exports,i),i.exports);var gr=w((Lf,Oo)=>{Oo.exports={name:"@frontfriend/sdk",version:"1.2.6"}});var yr=w((Of,vr)=>{var{name:Vo}=gr();vr.exports={PACKAGE_NAME:Vo}});var Me=w((Vf,Er)=>{var Fo="https://app.frontfriend.dev",Do=".cache/frontfriend",$o={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"]},qo={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function jo(r){if(!r)return null;try{let i=new URL(r);return i.hostname.startsWith("app.")?`${i.protocol}//${i.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}Er.exports={DEFAULT_API_URL:Fo,CACHE_DIR_NAME:Do,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:$o,ENV_VARS:qo,deriveRegistryFromApiUrl:jo}});var Sr=w((Ff,br)=>{var qt=class extends Error{constructor(i,n,o){super(i),this.name="APIError",this.statusCode=n,this.url=o,this.code=`API_${n}`}},jt=class extends Error{constructor(i,n){super(i),this.name="CacheError",this.operation=n,this.code=`CACHE_${n.toUpperCase()}`}},Bt=class extends Error{constructor(i,n){super(i),this.name="ConfigError",this.field=n,this.code=n?`CONFIG_${String(n).toUpperCase()}`:"CONFIG_ERROR"}},Ut=class extends Error{constructor(i,n){super(i),this.name="ProcessingError",this.token=n,this.code="PROCESSING_ERROR"}};br.exports={APIError:qt,CacheError:jt,ConfigError:Bt,ProcessingError:Ut}});var Ge=w((Df,wr)=>{var j=require("fs");function Bo(r){try{let i=j.readFileSync(r,"utf8");return JSON.parse(i)}catch(i){if(i.code==="ENOENT")return null;throw i}}function Uo(r){try{return j.readFileSync(r,"utf8").replace(/^\uFEFF/,"")}catch(i){if(i.code==="ENOENT")return null;throw i}}function Mo(r,i,n=2){let o=JSON.stringify(i,null,n);j.writeFileSync(r,o,"utf8")}function Go(r,i){j.writeFileSync(r,i,"utf8")}function Ho(r,i){if(i==null||typeof i=="object"&&Object.keys(i).length===0||Array.isArray(i)&&i.length===0){let o=`module.exports = ${Array.isArray(i)?"[]":"{}"};`;j.writeFileSync(r,o,"utf8")}else{let n=`module.exports = ${JSON.stringify(i,null,2)};`;j.writeFileSync(r,n,"utf8")}}function Wo(r){return j.existsSync(r)}function Xo(r){j.mkdirSync(r,{recursive:!0})}function zo(r){j.rmSync(r,{recursive:!0,force:!0})}function Ko(r){j.rmSync(r,{force:!0})}function Yo(r,i){j.mkdirSync(require("path").dirname(r),{recursive:!0,mode:448});let n=`${r}.${process.pid}.${Date.now()}.tmp`;try{j.writeFileSync(n,`${JSON.stringify(i,null,2)}
2
2
  `,{mode:384}),j.renameSync(n,r);try{j.chmodSync(r,384)}catch{}}finally{j.rmSync(n,{force:!0})}}async function Jo(r,i,n){j.mkdirSync(require("path").dirname(r),{recursive:!0,mode:448});let o=`${r}.lock`,l=Date.now()+2e4,h;for(;h===void 0;)try{h=j.openSync(o,"wx",384),j.writeFileSync(h,String(process.pid))}catch(f){if(f.code!=="EEXIST")throw f;try{let m=Number(j.readFileSync(o,"utf8"));if(Number.isInteger(m)&&m>0)try{process.kill(m,0)}catch(y){if(y.code==="ESRCH"){j.unlinkSync(o);continue}}}catch(m){if(m.code==="ENOENT")continue}if(Date.now()>=l)throw n();await new Promise(m=>setTimeout(m,50))}try{return await i()}finally{j.closeSync(h),j.unlinkSync(o)}}wr.exports={writePrivateJsonFileAtomic:Yo,withPrivateFileLock:Jo,readJsonFileSafe:Bo,readFileSafe:Uo,writeJsonFile:Mo,writeTextFile:Go,writeModuleExportsFile:Ho,fileExists:Wo,ensureDirectoryExists:Xo,removeDirectory:zo,removeFile:Ko}});var _r=w(($f,Cr)=>{var Qo="classes.txt",Zo="classes.css";Cr.exports={CLASSES_SOURCE_FILE:Qo,CSS_CLASSES_SOURCE_FILE:Zo}});var Pr=w((qf,Rr)=>{var Q=require("path"),{CACHE_DIR_NAME:eu,CACHE_TTL_MS:tu,CACHE_FILES:Ir}=Me(),{CacheError:Mt}=Sr(),{readJsonFileSafe:ut,readFileSafe:iu,writeJsonFile:kr,writeTextFile:Ar,writeModuleExportsFile:Nr,fileExists:Gt,ensureDirectoryExists:ru,removeDirectory:su,removeFile:nu}=Ge(),{CLASSES_SOURCE_FILE:au,CSS_CLASSES_SOURCE_FILE:ou}=_r(),Ht=class r{constructor(i=process.cwd()){this.appRoot=i,this.cacheDir=Q.join(i,"node_modules",eu),this.metadataFile=Q.join(this.cacheDir,"metadata.json"),this.maxAge=tu}getCacheDir(){return this.cacheDir}isLocalOnly(){return ut(this.metadataFile)?.version==="local-components"}getIconLibrary(){let i=Q.join(this.cacheDir,"iconLibrary.json");return Gt(i)?ut(i):null}exists(){return Gt(this.cacheDir)}isValid(){if(!this.exists())return!1;try{let i=ut(this.metadataFile);if(!i)return!1;let n=new Date(i.timestamp).getTime();return Date.now()-n<this.maxAge}catch{return!1}}load(){if(!this.exists())return null;try{let i={};for(let n of Ir.JS){let o=Q.join(this.cacheDir,n);if(Gt(o)){let l=n.replace(".js","");try{let h=iu(o);if(h!==null){let f={},m={exports:f};new Function("module","exports",h)(m,f),i[l]=m.exports}}catch(h){console.warn(`[Frontfriend] Failed to load ${n}: ${h.message}`),(h.message.includes("Unexpected token")||h.message.includes("Invalid character"))&&console.warn("[Frontfriend] This might be a BOM or encoding issue. Try deleting node_modules/.cache/frontfriend and running `npx frontfriend init` again.")}}}for(let n of Ir.JSON){let o=Q.join(this.cacheDir,n),l=n.replace(".json",""),h=ut(o);h!==null&&(i[l]=h)}return i["components-config"]&&(i.componentsConfig=i["components-config"],delete i["components-config"]),i.cls&&!i.safelist&&(i.safelist=i.cls,delete i.cls),i}catch(i){throw new Mt(`Failed to load cache: ${i.message}`,"read")}}save(i){try{ru(this.cacheDir);let n={timestamp:new Date().toISOString(),version:i.metadata?.version||"2.0.0",ffId:i.metadata?.ffId},o=["tokens","variables","semanticVariables","semanticDarkVariables","keyframes","animations","safelist","custom"];for(let h of o)if(i[h]!==void 0){let f=Q.join(this.cacheDir,`${h}.js`);Nr(f,i[h])}if(i.safelist&&Array.isArray(i.safelist)){let h=Q.join(this.cacheDir,"safelist.js");Nr(h,i.safelist)}let l={fonts:i.fonts,icons:i.icons||i.iconSet,"components-config":i.componentsConfig,iconLibrary:i.iconLibrary,version:i.version,versionMetadata:i.versionMetadata,base:i.base,nativeTokens:i.nativeTokens};for(let[h,f]of Object.entries(l))if(f!==void 0){let m=Q.join(this.cacheDir,`${h}.json`);kr(m,f)}i.themeCSS!==void 0&&Ar(Q.join(this.cacheDir,"theme.css"),i.themeCSS),i.classesContent!==void 0&&(Ar(Q.join(this.cacheDir,au),i.classesContent),nu(Q.join(this.cacheDir,ou))),kr(this.metadataFile,n)}catch(n){throw new Mt(`Failed to save cache: ${n.message}`,"write")}}saveAtomic(i,n=()=>{}){let o=require("node:fs"),{randomUUID:l}=require("node:crypto");o.mkdirSync(Q.dirname(this.cacheDir),{recursive:!0});let h=`${this.cacheDir}.write-lock`,f;try{f=o.openSync(h,"wx")}catch(x){if(x.code!=="EEXIST")throw x;let I=Number(o.readFileSync(h,"utf8")),g=!0;if(I>0)try{process.kill(I,0)}catch(S){g=S.code!=="ESRCH"}if(g)throw new Mt("Another process is installing tokens. Retry after it completes.","write");o.unlinkSync(h),f=o.openSync(h,"wx")}let m=`${this.cacheDir}.previous`,y=`${this.cacheDir}.${l()}.pending`;try{o.writeFileSync(f,String(process.pid)),!o.existsSync(this.cacheDir)&&o.existsSync(m)&&o.renameSync(m,this.cacheDir);let x=new r(this.appRoot);x.cacheDir=y,x.metadataFile=Q.join(y,"metadata.json"),x.save(i),o.existsSync(m)&&o.rmSync(m,{recursive:!0}),o.existsSync(this.cacheDir)&&o.renameSync(this.cacheDir,m);try{o.renameSync(y,this.cacheDir),n()}catch(I){throw o.rmSync(this.cacheDir,{recursive:!0,force:!0}),o.existsSync(m)&&o.renameSync(m,this.cacheDir),I}o.rmSync(m,{recursive:!0,force:!0})}finally{o.rmSync(y,{recursive:!0,force:!0}),o.closeSync(f),o.rmSync(h,{force:!0})}}clear(){this.exists()&&su(this.cacheDir)}};Rr.exports=Ht});var Vr=w((jf,Or)=>{function pe(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Wt(r,i){if(!pe(r)||!pe(i))return i===void 0?r:i;let n={...r};for(let[o,l]of Object.entries(i))n[o]=o in n?Wt(n[o],l):l;return n}function Xt(r,i,n=[],o=[]){if(r===void 0||i===void 0)return o;if(!pe(r)||!pe(i))return o.push(n.join(".")),o;for(let l of Object.keys(r))l in i&&Xt(r[l],i[l],[...n,l],o);return o}function Tr(r){return pe(r)&&("styles"in r||"behavior"in r)}function Lr(r,i="component"){if(!Tr(r)||!pe(r.styles)||r.behavior!==void 0&&!pe(r.behavior)||Object.keys(r).some(o=>!["styles","behavior"].includes(o)))throw new TypeError(`Component ${i} must use the styles/behavior envelope`);let n=Xt(r.styles,r.behavior,[i]);if(n.length>0)throw new Error(`Component config styles/behavior conflict at ${n.join(", ")}`);return Wt(r.styles||{},r.behavior||{})}function uu(r){if(!pe(r))return r;let i=!1,n={};for(let[o,l]of Object.entries(r))n[o]=Lr(l,o),n[o]!==l&&(i=!0);return i?n:r}Or.exports={isPlainObject:pe,deepMerge:Wt,findTreeConflicts:Xt,isComponentEnvelope:Tr,toRuntimeComponentConfig:Lr,toRuntimeComponentsConfig:uu}});var jr=w((Bf,qr)=>{qr.exports=$r;$r.sync=hu;var Fr=require("fs");function cu(r,i){var n=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var o=0;o<n.length;o++){var l=n[o].toLowerCase();if(l&&r.substr(-l.length).toLowerCase()===l)return!0}return!1}function Dr(r,i,n){return!r.isSymbolicLink()&&!r.isFile()?!1:cu(i,n)}function $r(r,i,n){Fr.stat(r,function(o,l){n(o,o?!1:Dr(l,r,i))})}function hu(r,i){return Dr(Fr.statSync(r),r,i)}});var Hr=w((Uf,Gr)=>{Gr.exports=Ur;Ur.sync=lu;var Br=require("fs");function Ur(r,i,n){Br.stat(r,function(o,l){n(o,o?!1:Mr(l,i))})}function lu(r,i){return Mr(Br.statSync(r),i)}function Mr(r,i){return r.isFile()&&fu(r,i)}function fu(r,i){var n=r.mode,o=r.uid,l=r.gid,h=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),f=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),m=parseInt("100",8),y=parseInt("010",8),x=parseInt("001",8),I=m|y,g=n&x||n&y&&l===f||n&m&&o===h||n&I&&h===0;return g}});var Xr=w((Gf,Wr)=>{var Mf=require("fs"),ct;process.platform==="win32"||global.TESTING_WINDOWS?ct=jr():ct=Hr();Wr.exports=zt;zt.sync=pu;function zt(r,i,n){if(typeof i=="function"&&(n=i,i={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,l){zt(r,i||{},function(h,f){h?l(h):o(f)})})}ct(r,i||{},function(o,l){o&&(o.code==="EACCES"||i&&i.ignoreErrors)&&(o=null,l=!1),n(o,l)})}function pu(r,i){try{return ct.sync(r,i||{})}catch(n){if(i&&i.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var es=w((Hf,Zr)=>{var Re=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",zr=require("path"),du=Re?";":":",Kr=Xr(),Yr=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),Jr=(r,i)=>{let n=i.colon||du,o=r.match(/\//)||Re&&r.match(/\\/)?[""]:[...Re?[process.cwd()]:[],...(i.path||process.env.PATH||"").split(n)],l=Re?i.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",h=Re?l.split(n):[""];return Re&&r.indexOf(".")!==-1&&h[0]!==""&&h.unshift(""),{pathEnv:o,pathExt:h,pathExtExe:l}},Qr=(r,i,n)=>{typeof i=="function"&&(n=i,i={}),i||(i={});let{pathEnv:o,pathExt:l,pathExtExe:h}=Jr(r,i),f=[],m=x=>new Promise((I,g)=>{if(x===o.length)return i.all&&f.length?I(f):g(Yr(r));let S=o[x],E=/^".*"$/.test(S)?S.slice(1,-1):S,N=zr.join(E,r),B=!E&&/^\.[\\\/]/.test(r)?r.slice(0,2)+N:N;I(y(B,x,0))}),y=(x,I,g)=>new Promise((S,E)=>{if(g===l.length)return S(m(I+1));let N=l[g];Kr(x+N,{pathExt:h},(B,Y)=>{if(!B&&Y)if(i.all)f.push(x+N);else return S(x+N);return S(y(x,I,g+1))})});return n?m(0).then(x=>n(null,x),n):m(0)},mu=(r,i)=>{i=i||{};let{pathEnv:n,pathExt:o,pathExtExe:l}=Jr(r,i),h=[];for(let f=0;f<n.length;f++){let m=n[f],y=/^".*"$/.test(m)?m.slice(1,-1):m,x=zr.join(y,r),I=!y&&/^\.[\\\/]/.test(r)?r.slice(0,2)+x:x;for(let g=0;g<o.length;g++){let S=I+o[g];try{if(Kr.sync(S,{pathExt:l}))if(i.all)h.push(S);else return S}catch{}}}if(i.all&&h.length)return h;if(i.nothrow)return null;throw Yr(r)};Zr.exports=Qr;Qr.sync=mu});var is=w((Wf,Kt)=>{"use strict";var ts=(r={})=>{let i=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(i).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};Kt.exports=ts;Kt.exports.default=ts});var as=w((Xf,ns)=>{"use strict";var rs=require("path"),xu=es(),gu=is();function ss(r,i){let n=r.options.env||process.env,o=process.cwd(),l=r.options.cwd!=null,h=l&&process.chdir!==void 0&&!process.chdir.disabled;if(h)try{process.chdir(r.options.cwd)}catch{}let f;try{f=xu.sync(r.command,{path:n[gu({env:n})],pathExt:i?rs.delimiter:void 0})}catch{}finally{h&&process.chdir(o)}return f&&(f=rs.resolve(l?r.options.cwd:"",f)),f}function vu(r){return ss(r)||ss(r,!0)}ns.exports=vu});var os=w((zf,Jt)=>{"use strict";var Yt=/([()\][%!^"`<>&|;, *?])/g;function yu(r){return r=r.replace(Yt,"^$1"),r}function Eu(r,i){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(Yt,"^$1"),i&&(r=r.replace(Yt,"^$1")),r}Jt.exports.command=yu;Jt.exports.argument=Eu});var cs=w((Kf,us)=>{"use strict";us.exports=/^#!(.*)/});var ls=w((Yf,hs)=>{"use strict";var bu=cs();hs.exports=(r="")=>{let i=r.match(bu);if(!i)return null;let[n,o]=i[0].replace(/#! ?/,"").split(" "),l=n.split("/").pop();return l==="env"?o:o?`${l} ${o}`:l}});var ps=w((Jf,fs)=>{"use strict";var Qt=require("fs"),Su=ls();function wu(r){let n=Buffer.alloc(150),o;try{o=Qt.openSync(r,"r"),Qt.readSync(o,n,0,150,0),Qt.closeSync(o)}catch{}return Su(n.toString())}fs.exports=wu});var gs=w((Qf,xs)=>{"use strict";var Cu=require("path"),ds=as(),ms=os(),_u=ps(),Iu=process.platform==="win32",ku=/\.(?:com|exe)$/i,Au=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Nu(r){r.file=ds(r);let i=r.file&&_u(r.file);return i?(r.args.unshift(r.file),r.command=i,ds(r)):r.file}function Ru(r){if(!Iu)return r;let i=Nu(r),n=!ku.test(i);if(r.options.forceShell||n){let o=Au.test(i);r.command=Cu.normalize(r.command),r.command=ms.command(r.command),r.args=r.args.map(h=>ms.argument(h,o));let l=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${l}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function Pu(r,i,n){i&&!Array.isArray(i)&&(n=i,i=null),i=i?i.slice(0):[],n=Object.assign({},n);let o={command:r,args:i,options:n,file:void 0,original:{command:r,args:i}};return n.shell?o:Ru(o)}xs.exports=Pu});var Es=w((Zf,ys)=>{"use strict";var Zt=process.platform==="win32";function ei(r,i){return Object.assign(new Error(`${i} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${i} ${r.command}`,path:r.command,spawnargs:r.args})}function Tu(r,i){if(!Zt)return;let n=r.emit;r.emit=function(o,l){if(o==="exit"){let h=vs(l,i);if(h)return n.call(r,"error",h)}return n.apply(r,arguments)}}function vs(r,i){return Zt&&r===1&&!i.file?ei(i.original,"spawn"):null}function Lu(r,i){return Zt&&r===1&&!i.file?ei(i.original,"spawnSync"):null}ys.exports={hookChildProcess:Tu,verifyENOENT:vs,verifyENOENTSync:Lu,notFoundError:ei}});var ws=w((ep,Pe)=>{"use strict";var bs=require("child_process"),ti=gs(),ii=Es();function Ss(r,i,n){let o=ti(r,i,n),l=bs.spawn(o.command,o.args,o.options);return ii.hookChildProcess(l,o),l}function Ou(r,i,n){let o=ti(r,i,n),l=bs.spawnSync(o.command,o.args,o.options);return l.error=l.error||ii.verifyENOENTSync(l.status,o),l}Pe.exports=Ss;Pe.exports.spawn=Ss;Pe.exports.sync=Ou;Pe.exports._parse=ti;Pe.exports._enoent=ii});var Te=w((tp,Cs)=>{"use strict";var Vu="2.0.0",Fu=Number.MAX_SAFE_INTEGER||9007199254740991,Du=16,$u=250,qu=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Cs.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Du,MAX_SAFE_BUILD_LENGTH:$u,MAX_SAFE_INTEGER:Fu,RELEASE_TYPES:qu,SEMVER_SPEC_VERSION:Vu,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var He=w((ip,_s)=>{"use strict";var ju=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};_s.exports=ju});var Le=w((ue,Is)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ri,MAX_SAFE_BUILD_LENGTH:Bu,MAX_LENGTH:Uu}=Te(),Mu=He();ue=Is.exports={};var Gu=ue.re=[],Hu=ue.safeRe=[],C=ue.src=[],Wu=ue.safeSrc=[],_=ue.t={},Xu=0,si="[a-zA-Z0-9-]",zu=[["\\s",1],["\\d",Uu],[si,Bu]],Ku=r=>{for(let[i,n]of zu)r=r.split(`${i}*`).join(`${i}{0,${n}}`).split(`${i}+`).join(`${i}{1,${n}}`);return r},T=(r,i,n)=>{let o=Ku(i),l=Xu++;Mu(r,l,i),_[r]=l,C[l]=i,Wu[l]=o,Gu[l]=new RegExp(i,n?"g":void 0),Hu[l]=new RegExp(o,n?"g":void 0)};T("NUMERICIDENTIFIER","0|[1-9]\\d*");T("NUMERICIDENTIFIERLOOSE","\\d+");T("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${si}*`);T("MAINVERSION",`(${C[_.NUMERICIDENTIFIER]})\\.(${C[_.NUMERICIDENTIFIER]})\\.(${C[_.NUMERICIDENTIFIER]})`);T("MAINVERSIONLOOSE",`(${C[_.NUMERICIDENTIFIERLOOSE]})\\.(${C[_.NUMERICIDENTIFIERLOOSE]})\\.(${C[_.NUMERICIDENTIFIERLOOSE]})`);T("PRERELEASEIDENTIFIER",`(?:${C[_.NONNUMERICIDENTIFIER]}|${C[_.NUMERICIDENTIFIER]})`);T("PRERELEASEIDENTIFIERLOOSE",`(?:${C[_.NONNUMERICIDENTIFIER]}|${C[_.NUMERICIDENTIFIERLOOSE]})`);T("PRERELEASE",`(?:-(${C[_.PRERELEASEIDENTIFIER]}(?:\\.${C[_.PRERELEASEIDENTIFIER]})*))`);T("PRERELEASELOOSE",`(?:-?(${C[_.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${C[_.PRERELEASEIDENTIFIERLOOSE]})*))`);T("BUILDIDENTIFIER",`${si}+`);T("BUILD",`(?:\\+(${C[_.BUILDIDENTIFIER]}(?:\\.${C[_.BUILDIDENTIFIER]})*))`);T("FULLPLAIN",`v?${C[_.MAINVERSION]}${C[_.PRERELEASE]}?${C[_.BUILD]}?`);T("FULL",`^${C[_.FULLPLAIN]}$`);T("LOOSEPLAIN",`[v=\\s]*${C[_.MAINVERSIONLOOSE]}${C[_.PRERELEASELOOSE]}?${C[_.BUILD]}?`);T("LOOSE",`^${C[_.LOOSEPLAIN]}$`);T("GTLT","((?:<|>)?=?)");T("XRANGEIDENTIFIERLOOSE",`${C[_.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);T("XRANGEIDENTIFIER",`${C[_.NUMERICIDENTIFIER]}|x|X|\\*`);T("XRANGEPLAIN",`[v=\\s]*(${C[_.XRANGEIDENTIFIER]})(?:\\.(${C[_.XRANGEIDENTIFIER]})(?:\\.(${C[_.XRANGEIDENTIFIER]})(?:${C[_.PRERELEASE]})?${C[_.BUILD]}?)?)?`);T("XRANGEPLAINLOOSE",`[v=\\s]*(${C[_.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[_.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[_.XRANGEIDENTIFIERLOOSE]})(?:${C[_.PRERELEASELOOSE]})?${C[_.BUILD]}?)?)?`);T("XRANGE",`^${C[_.GTLT]}\\s*${C[_.XRANGEPLAIN]}$`);T("XRANGELOOSE",`^${C[_.GTLT]}\\s*${C[_.XRANGEPLAINLOOSE]}$`);T("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ri}})(?:\\.(\\d{1,${ri}}))?(?:\\.(\\d{1,${ri}}))?`);T("COERCE",`${C[_.COERCEPLAIN]}(?:$|[^\\d])`);T("COERCEFULL",C[_.COERCEPLAIN]+`(?:${C[_.PRERELEASE]})?(?:${C[_.BUILD]})?(?:$|[^\\d])`);T("COERCERTL",C[_.COERCE],!0);T("COERCERTLFULL",C[_.COERCEFULL],!0);T("LONETILDE","(?:~>?)");T("TILDETRIM",`(\\s*)${C[_.LONETILDE]}\\s+`,!0);ue.tildeTrimReplace="$1~";T("TILDE",`^${C[_.LONETILDE]}${C[_.XRANGEPLAIN]}$`);T("TILDELOOSE",`^${C[_.LONETILDE]}${C[_.XRANGEPLAINLOOSE]}$`);T("LONECARET","(?:\\^)");T("CARETTRIM",`(\\s*)${C[_.LONECARET]}\\s+`,!0);ue.caretTrimReplace="$1^";T("CARET",`^${C[_.LONECARET]}${C[_.XRANGEPLAIN]}$`);T("CARETLOOSE",`^${C[_.LONECARET]}${C[_.XRANGEPLAINLOOSE]}$`);T("COMPARATORLOOSE",`^${C[_.GTLT]}\\s*(${C[_.LOOSEPLAIN]})$|^$`);T("COMPARATOR",`^${C[_.GTLT]}\\s*(${C[_.FULLPLAIN]})$|^$`);T("COMPARATORTRIM",`(\\s*)${C[_.GTLT]}\\s*(${C[_.LOOSEPLAIN]}|${C[_.XRANGEPLAIN]})`,!0);ue.comparatorTrimReplace="$1$2$3";T("HYPHENRANGE",`^\\s*(${C[_.XRANGEPLAIN]})\\s+-\\s+(${C[_.XRANGEPLAIN]})\\s*$`);T("HYPHENRANGELOOSE",`^\\s*(${C[_.XRANGEPLAINLOOSE]})\\s+-\\s+(${C[_.XRANGEPLAINLOOSE]})\\s*$`);T("STAR","(<|>)?=?\\s*\\*");T("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");T("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ht=w((rp,ks)=>{"use strict";var Yu=Object.freeze({loose:!0}),Ju=Object.freeze({}),Qu=r=>r?typeof r!="object"?Yu:r:Ju;ks.exports=Qu});var ni=w((sp,Rs)=>{"use strict";var As=/^[0-9]+$/,Ns=(r,i)=>{if(typeof r=="number"&&typeof i=="number")return r===i?0:r<i?-1:1;let n=As.test(r),o=As.test(i);return n&&o&&(r=+r,i=+i),r===i?0:n&&!o?-1:o&&!n?1:r<i?-1:1},Zu=(r,i)=>Ns(i,r);Rs.exports={compareIdentifiers:Ns,rcompareIdentifiers:Zu}});var G=w((np,Ts)=>{"use strict";var lt=He(),{MAX_LENGTH:Ps,MAX_SAFE_INTEGER:ft}=Te(),{safeRe:pt,t:dt}=Le(),ec=ht(),{compareIdentifiers:ai}=ni(),tc=(r,i)=>{let n=i.split(".");if(n.length>r.length)return!1;for(let o=0;o<n.length;o++)if(ai(r[o],n[o])!==0)return!1;return!0},oi=class r{constructor(i,n){if(n=ec(n),i instanceof r){if(i.loose===!!n.loose&&i.includePrerelease===!!n.includePrerelease)return i;i=i.version}else if(typeof i!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof i}".`);if(i.length>Ps)throw new TypeError(`version is longer than ${Ps} characters`);lt("SemVer",i,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let o=i.trim().match(n.loose?pt[dt.LOOSE]:pt[dt.FULL]);if(!o)throw new TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>ft||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ft||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ft||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(l=>{if(/^[0-9]+$/.test(l)){let h=+l;if(h>=0&&h<ft)return h}return l}):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(i){if(lt("SemVer.compare",this.version,this.options,i),!(i instanceof r)){if(typeof i=="string"&&i===this.version)return 0;i=new r(i,this.options)}return i.version===this.version?0:this.compareMain(i)||this.comparePre(i)}compareMain(i){return i instanceof r||(i=new r(i,this.options)),this.major<i.major?-1:this.major>i.major?1:this.minor<i.minor?-1:this.minor>i.minor?1:this.patch<i.patch?-1:this.patch>i.patch?1:0}comparePre(i){if(i instanceof r||(i=new r(i,this.options)),this.prerelease.length&&!i.prerelease.length)return-1;if(!this.prerelease.length&&i.prerelease.length)return 1;if(!this.prerelease.length&&!i.prerelease.length)return 0;let n=0;do{let o=this.prerelease[n],l=i.prerelease[n];if(lt("prerelease compare",n,o,l),o===void 0&&l===void 0)return 0;if(l===void 0)return 1;if(o===void 0)return-1;if(o===l)continue;return ai(o,l)}while(++n)}compareBuild(i){i instanceof r||(i=new r(i,this.options));let n=0;do{let o=this.build[n],l=i.build[n];if(lt("build compare",n,o,l),o===void 0&&l===void 0)return 0;if(l===void 0)return 1;if(o===void 0)return-1;if(o===l)continue;return ai(o,l)}while(++n)}inc(i,n,o){if(i.startsWith("pre")){if(!n&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let l=`-${n}`.match(this.options.loose?pt[dt.PRERELEASELOOSE]:pt[dt.PRERELEASE]);if(!l||l[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(i){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 l=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[l];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(n===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(l)}}if(n){let h=[n,l];if(o===!1&&(h=[n]),tc(this.prerelease,n)){let f=this.prerelease[n.split(".").length];isNaN(f)&&(this.prerelease=h)}else this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${i}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Ts.exports=oi});var ge=w((ap,Os)=>{"use strict";var Ls=G(),ic=(r,i,n=!1)=>{if(r instanceof Ls)return r;try{return new Ls(r,i)}catch(o){if(!n)return null;throw o}};Os.exports=ic});var Fs=w((op,Vs)=>{"use strict";var rc=ge(),sc=(r,i)=>{let n=rc(r,i);return n?n.version:null};Vs.exports=sc});var $s=w((up,Ds)=>{"use strict";var nc=ge(),ac=(r,i)=>{let n=nc(r.trim().replace(/^[=v]+/,""),i);return n?n.version:null};Ds.exports=ac});var Bs=w((cp,js)=>{"use strict";var qs=G(),oc=(r,i,n,o,l)=>{typeof n=="string"&&(l=o,o=n,n=void 0);try{return new qs(r instanceof qs?r.version:r,n).inc(i,o,l).version}catch{return null}};js.exports=oc});var Gs=w((hp,Ms)=>{"use strict";var Us=ge(),uc=(r,i)=>{let n=Us(r,null,!0),o=Us(i,null,!0),l=n.compare(o);if(l===0)return null;let h=l>0,f=h?n:o,m=h?o:n,y=!!f.prerelease.length;if(!!m.prerelease.length&&!y){if(!m.patch&&!m.minor)return"major";if(m.compareMain(f)===0)return m.minor&&!m.patch?"minor":"patch"}let I=y?"pre":"";return n.major!==o.major?I+"major":n.minor!==o.minor?I+"minor":n.patch!==o.patch?I+"patch":"prerelease"};Ms.exports=uc});var Ws=w((lp,Hs)=>{"use strict";var cc=G(),hc=(r,i)=>new cc(r,i).major;Hs.exports=hc});var zs=w((fp,Xs)=>{"use strict";var lc=G(),fc=(r,i)=>new lc(r,i).minor;Xs.exports=fc});var Ys=w((pp,Ks)=>{"use strict";var pc=G(),dc=(r,i)=>new pc(r,i).patch;Ks.exports=dc});var Qs=w((dp,Js)=>{"use strict";var mc=ge(),xc=(r,i)=>{let n=mc(r,i);return n&&n.prerelease.length?n.prerelease:null};Js.exports=xc});var re=w((mp,en)=>{"use strict";var Zs=G(),gc=(r,i,n)=>new Zs(r,n).compare(new Zs(i,n));en.exports=gc});var rn=w((xp,tn)=>{"use strict";var vc=re(),yc=(r,i,n)=>vc(i,r,n);tn.exports=yc});var nn=w((gp,sn)=>{"use strict";var Ec=re(),bc=(r,i)=>Ec(r,i,!0);sn.exports=bc});var mt=w((vp,on)=>{"use strict";var an=G(),Sc=(r,i,n)=>{let o=new an(r,n),l=new an(i,n);return o.compare(l)||o.compareBuild(l)};on.exports=Sc});var cn=w((yp,un)=>{"use strict";var wc=mt(),Cc=(r,i)=>r.sort((n,o)=>wc(n,o,i));un.exports=Cc});var ln=w((Ep,hn)=>{"use strict";var _c=mt(),Ic=(r,i)=>r.sort((n,o)=>_c(o,n,i));hn.exports=Ic});var We=w((bp,fn)=>{"use strict";var kc=re(),Ac=(r,i,n)=>kc(r,i,n)>0;fn.exports=Ac});var xt=w((Sp,pn)=>{"use strict";var Nc=re(),Rc=(r,i,n)=>Nc(r,i,n)<0;pn.exports=Rc});var ui=w((wp,dn)=>{"use strict";var Pc=re(),Tc=(r,i,n)=>Pc(r,i,n)===0;dn.exports=Tc});var ci=w((Cp,mn)=>{"use strict";var Lc=re(),Oc=(r,i,n)=>Lc(r,i,n)!==0;mn.exports=Oc});var gt=w((_p,xn)=>{"use strict";var Vc=re(),Fc=(r,i,n)=>Vc(r,i,n)>=0;xn.exports=Fc});var vt=w((Ip,gn)=>{"use strict";var Dc=re(),$c=(r,i,n)=>Dc(r,i,n)<=0;gn.exports=$c});var hi=w((kp,vn)=>{"use strict";var qc=ui(),jc=ci(),Bc=We(),Uc=gt(),Mc=xt(),Gc=vt(),Hc=(r,i,n,o)=>{switch(i){case"===":return typeof r=="object"&&(r=r.version),typeof n=="object"&&(n=n.version),r===n;case"!==":return typeof r=="object"&&(r=r.version),typeof n=="object"&&(n=n.version),r!==n;case"":case"=":case"==":return qc(r,n,o);case"!=":return jc(r,n,o);case">":return Bc(r,n,o);case">=":return Uc(r,n,o);case"<":return Mc(r,n,o);case"<=":return Gc(r,n,o);default:throw new TypeError(`Invalid operator: ${i}`)}};vn.exports=Hc});var En=w((Ap,yn)=>{"use strict";var Wc=G(),Xc=ge(),{safeRe:yt,t:Et}=Le(),zc=(r,i)=>{if(r instanceof Wc)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;i=i||{};let n=null;if(!i.rtl)n=r.match(i.includePrerelease?yt[Et.COERCEFULL]:yt[Et.COERCE]);else{let y=i.includePrerelease?yt[Et.COERCERTLFULL]:yt[Et.COERCERTL],x;for(;(x=y.exec(r))&&(!n||n.index+n[0].length!==r.length);)(!n||x.index+x[0].length!==n.index+n[0].length)&&(n=x),y.lastIndex=x.index+x[1].length+x[2].length;y.lastIndex=-1}if(n===null)return null;let o=n[2],l=n[3]||"0",h=n[4]||"0",f=i.includePrerelease&&n[5]?`-${n[5]}`:"",m=i.includePrerelease&&n[6]?`+${n[6]}`:"";return Xc(`${o}.${l}.${h}${f}${m}`,i)};yn.exports=zc});var Sn=w((Np,bn)=>{"use strict";var Kc=ge(),Yc=Te(),Jc=G(),Qc=(r,i,n)=>{if(!Yc.RELEASE_TYPES.includes(i))return null;let o=Zc(r,n);return o&&eh(o,i)},Zc=(r,i)=>{let n=r instanceof Jc?r.version:r;return Kc(n,i)},eh=(r,i)=>{if(th(i))return r.version;switch(r.prerelease=[],i){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},th=r=>r.startsWith("pre");bn.exports=Qc});var Cn=w((Rp,wn)=>{"use strict";var li=class{constructor(){this.max=1e3,this.map=new Map}get(i){let n=this.map.get(i);if(n!==void 0)return this.map.delete(i),this.map.set(i,n),n}delete(i){return this.map.delete(i)}set(i,n){if(!this.delete(i)&&n!==void 0){if(this.map.size>=this.max){let l=this.map.keys().next().value;this.delete(l)}this.map.set(i,n)}return this}};wn.exports=li});var se=w((Pp,An)=>{"use strict";var ih=/\s+/g,fi=class r{constructor(i,n){if(n=sh(n),i instanceof r)return i.loose===!!n.loose&&i.includePrerelease===!!n.includePrerelease?i:new r(i.raw,n);if(i instanceof pi)return this.raw=i.value,this.set=[[i]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=i.trim().replace(ih," "),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(l=>!In(l[0])),this.set.length===0)this.set=[o];else if(this.set.length>1){for(let l of this.set)if(l.length===1&&ph(l[0])){this.set=[l];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let i=0;i<this.set.length;i++){i>0&&(this.formatted+="||");let n=this.set[i];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(i){i=i.replace(fh,"");let o=((this.options.includePrerelease&&hh)|(this.options.loose&&lh))+":"+i,l=_n.get(o);if(l)return l;let h=this.options.loose,f=h?K[H.HYPHENRANGELOOSE]:K[H.HYPHENRANGE];i=i.replace(f,Ch(this.options.includePrerelease)),$("hyphen replace",i),i=i.replace(K[H.COMPARATORTRIM],oh),$("comparator trim",i),i=i.replace(K[H.TILDETRIM],uh),$("tilde trim",i),i=i.replace(K[H.CARETTRIM],ch),$("caret trim",i);let m=i.split(" ").map(g=>dh(g,this.options)).join(" ").split(/\s+/).map(g=>wh(g,this.options));h&&(m=m.filter(g=>($("loose invalid filter",g,this.options),!!g.match(K[H.COMPARATORLOOSE])))),$("range list",m);let y=new Map,x=m.map(g=>new pi(g,this.options));for(let g of x){if(In(g))return[g];y.set(g.value,g)}y.size>1&&y.has("")&&y.delete("");let I=[...y.values()];return _n.set(o,I),I}intersects(i,n){if(!(i instanceof r))throw new TypeError("a Range is required");return this.set.some(o=>kn(o,n)&&i.set.some(l=>kn(l,n)&&o.every(h=>l.every(f=>h.intersects(f,n)))))}test(i){if(!i)return!1;if(typeof i=="string")try{i=new nh(i,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(_h(this.set[n],i,this.options))return!0;return!1}};An.exports=fi;var rh=Cn(),_n=new rh,sh=ht(),pi=Xe(),$=He(),nh=G(),{safeRe:K,src:ah,t:H,comparatorTrimReplace:oh,tildeTrimReplace:uh,caretTrimReplace:ch}=Le(),{FLAG_INCLUDE_PRERELEASE:hh,FLAG_LOOSE:lh}=Te(),fh=new RegExp(ah[H.BUILD],"g"),In=r=>r.value==="<0.0.0-0",ph=r=>r.value==="",kn=(r,i)=>{let n=!0,o=r.slice(),l=o.pop();for(;n&&o.length;)n=o.every(h=>l.intersects(h,i)),l=o.pop();return n},dh=(r,i)=>(r=r.replace(K[H.BUILD],""),$("comp",r,i),r=vh(r,i),$("caret",r),r=xh(r,i),$("tildes",r),r=Eh(r,i),$("xrange",r),r=Sh(r,i),$("stars",r),r),U=r=>!r||r.toLowerCase()==="x"||r==="*",mh=(r,i,n)=>U(r)&&!U(i)||U(i)&&n&&!U(n),xh=(r,i)=>r.trim().split(/\s+/).map(n=>gh(n,i)).join(" "),gh=(r,i)=>{let n=i.loose?K[H.TILDELOOSE]:K[H.TILDE],o=i.includePrerelease?"-0":"";return r.replace(n,(l,h,f,m,y)=>{$("tilde",r,l,h,f,m,y);let x;return U(h)?x="":U(f)?x=`>=${h}.0.0${o} <${+h+1}.0.0-0`:U(m)?x=`>=${h}.${f}.0${o} <${h}.${+f+1}.0-0`:y?($("replaceTilde pr",y),x=`>=${h}.${f}.${m}-${y} <${h}.${+f+1}.0-0`):x=`>=${h}.${f}.${m} <${h}.${+f+1}.0-0`,$("tilde return",x),x})},vh=(r,i)=>r.trim().split(/\s+/).map(n=>yh(n,i)).join(" "),yh=(r,i)=>{$("caret",r,i);let n=i.loose?K[H.CARETLOOSE]:K[H.CARET],o=i.includePrerelease?"-0":"";return r.replace(n,(l,h,f,m,y)=>{$("caret",r,l,h,f,m,y);let x;return U(h)?x="":U(f)?x=`>=${h}.0.0${o} <${+h+1}.0.0-0`:U(m)?h==="0"?x=`>=${h}.${f}.0${o} <${h}.${+f+1}.0-0`:x=`>=${h}.${f}.0${o} <${+h+1}.0.0-0`:y?($("replaceCaret pr",y),h==="0"?f==="0"?x=`>=${h}.${f}.${m}-${y} <${h}.${f}.${+m+1}-0`:x=`>=${h}.${f}.${m}-${y} <${h}.${+f+1}.0-0`:x=`>=${h}.${f}.${m}-${y} <${+h+1}.0.0-0`):($("no pr"),h==="0"?f==="0"?x=`>=${h}.${f}.${m} <${h}.${f}.${+m+1}-0`:x=`>=${h}.${f}.${m} <${h}.${+f+1}.0-0`:x=`>=${h}.${f}.${m} <${+h+1}.0.0-0`),$("caret return",x),x})},Eh=(r,i)=>($("replaceXRanges",r,i),r.split(/\s+/).map(n=>bh(n,i)).join(" ")),bh=(r,i)=>{r=r.trim();let n=i.loose?K[H.XRANGELOOSE]:K[H.XRANGE];return r.replace(n,(o,l,h,f,m,y)=>{if($("xRange",r,o,l,h,f,m,y),mh(h,f,m))return r;let x=U(h),I=x||U(f),g=I||U(m),S=g;return l==="="&&S&&(l=""),y=i.includePrerelease?"-0":"",x?l===">"||l==="<"?o="<0.0.0-0":o="*":l&&S?(I&&(f=0),m=0,l===">"?(l=">=",I?(h=+h+1,f=0,m=0):(f=+f+1,m=0)):l==="<="&&(l="<",I?h=+h+1:f=+f+1),l==="<"&&(y="-0"),o=`${l+h}.${f}.${m}${y}`):I?o=`>=${h}.0.0${y} <${+h+1}.0.0-0`:g&&(o=`>=${h}.${f}.0${y} <${h}.${+f+1}.0-0`),$("xRange return",o),o})},Sh=(r,i)=>($("replaceStars",r,i),r.trim().replace(K[H.STAR],"")),wh=(r,i)=>($("replaceGTE0",r,i),r.trim().replace(K[i.includePrerelease?H.GTE0PRE:H.GTE0],"")),Ch=r=>(i,n,o,l,h,f,m,y,x,I,g,S)=>(U(o)?n="":U(l)?n=`>=${o}.0.0${r?"-0":""}`:U(h)?n=`>=${o}.${l}.0${r?"-0":""}`:f?n=`>=${n}`:n=`>=${n}${r?"-0":""}`,U(x)?y="":U(I)?y=`<${+x+1}.0.0-0`:U(g)?y=`<${x}.${+I+1}.0-0`:S?y=`<=${x}.${I}.${g}-${S}`:r?y=`<${x}.${I}.${+g+1}-0`:y=`<=${y}`,`${n} ${y}`.trim()),_h=(r,i,n)=>{for(let o=0;o<r.length;o++)if(!r[o].test(i))return!1;if(i.prerelease.length&&!n.includePrerelease){for(let o=0;o<r.length;o++)if($(r[o].semver),r[o].semver!==pi.ANY&&r[o].semver.prerelease.length>0){let l=r[o].semver;if(l.major===i.major&&l.minor===i.minor&&l.patch===i.patch)return!0}return!1}return!0}});var Xe=w((Tp,On)=>{"use strict";var ze=Symbol("SemVer ANY"),xi=class r{static get ANY(){return ze}constructor(i,n){if(n=Nn(n),i instanceof r){if(i.loose===!!n.loose)return i;i=i.value}i=i.trim().split(/\s+/).join(" "),mi("comparator",i,n),this.options=n,this.loose=!!n.loose,this.parse(i),this.semver===ze?this.value="":this.value=this.operator+this.semver.version,mi("comp",this)}parse(i){let n=this.options.loose?Rn[Pn.COMPARATORLOOSE]:Rn[Pn.COMPARATOR],o=i.match(n);if(!o)throw new TypeError(`Invalid comparator: ${i}`);this.operator=o[1]!==void 0?o[1]:"",this.operator==="="&&(this.operator=""),o[2]?this.semver=new Tn(o[2],this.options.loose):this.semver=ze}toString(){return this.value}test(i){if(mi("Comparator.test",i,this.options.loose),this.semver===ze||i===ze)return!0;if(typeof i=="string")try{i=new Tn(i,this.options)}catch{return!1}return di(i,this.operator,this.semver,this.options)}intersects(i,n){if(!(i instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Ln(i.value,n).test(this.value):i.operator===""?i.value===""?!0:new Ln(this.value,n).test(i.semver):(n=Nn(n),n.includePrerelease&&(this.value==="<0.0.0-0"||i.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||i.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&i.operator.startsWith(">")||this.operator.startsWith("<")&&i.operator.startsWith("<")||this.semver.version===i.semver.version&&this.operator.includes("=")&&i.operator.includes("=")||di(this.semver,"<",i.semver,n)&&this.operator.startsWith(">")&&i.operator.startsWith("<")||di(this.semver,">",i.semver,n)&&this.operator.startsWith("<")&&i.operator.startsWith(">")))}};On.exports=xi;var Nn=ht(),{safeRe:Rn,t:Pn}=Le(),di=hi(),mi=He(),Tn=G(),Ln=se()});var Ke=w((Lp,Vn)=>{"use strict";var Ih=se(),kh=(r,i,n)=>{try{i=new Ih(i,n)}catch{return!1}return i.test(r)};Vn.exports=kh});var Dn=w((Op,Fn)=>{"use strict";var Ah=se(),Nh=(r,i)=>new Ah(r,i).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));Fn.exports=Nh});var qn=w((Vp,$n)=>{"use strict";var Rh=G(),Ph=se(),Th=(r,i,n)=>{let o=null,l=null,h=null;try{h=new Ph(i,n)}catch{return null}return r.forEach(f=>{h.test(f)&&(!o||l.compare(f)===-1)&&(o=f,l=new Rh(o,n))}),o};$n.exports=Th});var Bn=w((Fp,jn)=>{"use strict";var Lh=G(),Oh=se(),Vh=(r,i,n)=>{let o=null,l=null,h=null;try{h=new Oh(i,n)}catch{return null}return r.forEach(f=>{h.test(f)&&(!o||l.compare(f)===1)&&(o=f,l=new Lh(o,n))}),o};jn.exports=Vh});var Gn=w((Dp,Mn)=>{"use strict";var gi=G(),Fh=se(),Un=We(),Dh=(r,i)=>{r=new Fh(r,i);let n=new gi("0.0.0");if(r.test(n)||(n=new gi("0.0.0-0"),r.test(n)))return n;n=null;for(let o=0;o<r.set.length;++o){let l=r.set[o],h=null;l.forEach(f=>{let m=new gi(f.semver.version);switch(f.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!h||Un(m,h))&&(h=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${f.operator}`)}}),h&&(!n||Un(n,h))&&(n=h)}return n&&r.test(n)?n:null};Mn.exports=Dh});var Wn=w(($p,Hn)=>{"use strict";var $h=se(),qh=(r,i)=>{try{return new $h(r,i).range||"*"}catch{return null}};Hn.exports=qh});var bt=w((qp,Yn)=>{"use strict";var jh=G(),Kn=Xe(),{ANY:Bh}=Kn,Uh=se(),Mh=Ke(),Xn=We(),zn=xt(),Gh=vt(),Hh=gt(),Wh=(r,i,n,o)=>{r=new jh(r,o),i=new Uh(i,o);let l,h,f,m,y;switch(n){case">":l=Xn,h=Gh,f=zn,m=">",y=">=";break;case"<":l=zn,h=Hh,f=Xn,m="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Mh(r,i,o))return!1;for(let x=0;x<i.set.length;++x){let I=i.set[x],g=null,S=null;if(I.forEach(E=>{E.semver===Bh&&(E=new Kn(">=0.0.0")),g=g||E,S=S||E,l(E.semver,g.semver,o)?g=E:f(E.semver,S.semver,o)&&(S=E)}),g.operator===m||g.operator===y||(!S.operator||S.operator===m)&&h(r,S.semver))return!1;if(S.operator===y&&f(r,S.semver))return!1}return!0};Yn.exports=Wh});var Qn=w((jp,Jn)=>{"use strict";var Xh=bt(),zh=(r,i,n)=>Xh(r,i,">",n);Jn.exports=zh});var ea=w((Bp,Zn)=>{"use strict";var Kh=bt(),Yh=(r,i,n)=>Kh(r,i,"<",n);Zn.exports=Yh});var ra=w((Up,ia)=>{"use strict";var ta=se(),Jh=(r,i,n)=>(r=new ta(r,n),i=new ta(i,n),r.intersects(i,n));ia.exports=Jh});var na=w((Mp,sa)=>{"use strict";var Qh=Ke(),Zh=re();sa.exports=(r,i,n)=>{let o=[],l=null,h=null,f=r.sort((I,g)=>Zh(I,g,n));for(let I of f)Qh(I,i,n)?(h=I,l||(l=I)):(h&&o.push([l,h]),h=null,l=null);l&&o.push([l,null]);let m=[];for(let[I,g]of o)I===g?m.push(I):!g&&I===f[0]?m.push("*"):g?I===f[0]?m.push(`<=${g}`):m.push(`${I} - ${g}`):m.push(`>=${I}`);let y=m.join(" || "),x=typeof i.raw=="string"?i.raw:String(i);return y.length<x.length?y:i}});var la=w((Gp,ha)=>{"use strict";var aa=se(),Ei=Xe(),{ANY:vi}=Ei,yi=Ke(),bi=re(),el=(r,i,n={})=>{if(r===i)return!0;r=new aa(r,n),i=new aa(i,n);let o=!1;e:for(let l of r.set){for(let h of i.set){let f=il(l,h,n);if(o=o||f!==null,f)continue e}if(o)return!1}return!0},tl=[new Ei(">=0.0.0-0")],oa=[new Ei(">=0.0.0")],il=(r,i,n)=>{if(r===i)return!0;if(r.length===1&&r[0].semver===vi){if(i.length===1&&i[0].semver===vi)return!0;n.includePrerelease?r=tl:r=oa}if(i.length===1&&i[0].semver===vi){if(n.includePrerelease)return!0;i=oa}let o=new Set,l,h;for(let E of r)E.operator===">"||E.operator===">="?l=ua(l,E,n):E.operator==="<"||E.operator==="<="?h=ca(h,E,n):o.add(E.semver);if(o.size>1)return null;let f;if(l&&h){if(f=bi(l.semver,h.semver,n),f>0)return null;if(f===0&&(l.operator!==">="||h.operator!=="<="))return null}for(let E of o){if(l&&!yi(E,String(l),n)||h&&!yi(E,String(h),n))return null;for(let N of i)if(!yi(E,String(N),n))return!1;return!0}let m,y,x,I,g=h&&!n.includePrerelease&&h.semver.prerelease.length?h.semver:!1,S=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1;g&&g.prerelease.length===1&&h.operator==="<"&&g.prerelease[0]===0&&(g=!1);for(let E of i){if(I=I||E.operator===">"||E.operator===">=",x=x||E.operator==="<"||E.operator==="<=",l){if(S&&E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===S.major&&E.semver.minor===S.minor&&E.semver.patch===S.patch&&(S=!1),E.operator===">"||E.operator===">="){if(m=ua(l,E,n),m===E&&m!==l)return!1}else if(l.operator===">="&&!E.test(l.semver))return!1}if(h){if(g&&E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===g.major&&E.semver.minor===g.minor&&E.semver.patch===g.patch&&(g=!1),E.operator==="<"||E.operator==="<="){if(y=ca(h,E,n),y===E&&y!==h)return!1}else if(h.operator==="<="&&!E.test(h.semver))return!1}if(!E.operator&&(h||l)&&f!==0)return!1}return!(l&&x&&!h&&f!==0||h&&I&&!l&&f!==0||S||g)},ua=(r,i,n)=>{if(!r)return i;let o=bi(r.semver,i.semver,n);return o>0?r:o<0||i.operator===">"&&r.operator===">="?i:r},ca=(r,i,n)=>{if(!r)return i;let o=bi(r.semver,i.semver,n);return o<0?r:o>0||i.operator==="<"&&r.operator==="<="?i:r};ha.exports=el});var ma=w((Hp,da)=>{"use strict";var Si=Le(),fa=Te(),rl=G(),pa=ni(),sl=ge(),nl=Fs(),al=$s(),ol=Bs(),ul=Gs(),cl=Ws(),hl=zs(),ll=Ys(),fl=Qs(),pl=re(),dl=rn(),ml=nn(),xl=mt(),gl=cn(),vl=ln(),yl=We(),El=xt(),bl=ui(),Sl=ci(),wl=gt(),Cl=vt(),_l=hi(),Il=En(),kl=Sn(),Al=Xe(),Nl=se(),Rl=Ke(),Pl=Dn(),Tl=qn(),Ll=Bn(),Ol=Gn(),Vl=Wn(),Fl=bt(),Dl=Qn(),$l=ea(),ql=ra(),jl=na(),Bl=la();da.exports={parse:sl,valid:nl,clean:al,inc:ol,diff:ul,major:cl,minor:hl,patch:ll,prerelease:fl,compare:pl,rcompare:dl,compareLoose:ml,compareBuild:xl,sort:gl,rsort:vl,gt:yl,lt:El,eq:bl,neq:Sl,gte:wl,lte:Cl,cmp:_l,coerce:Il,truncate:kl,Comparator:Al,Range:Nl,satisfies:Rl,toComparators:Pl,maxSatisfying:Tl,minSatisfying:Ll,minVersion:Ol,validRange:Vl,outside:Fl,gtr:Dl,ltr:$l,intersects:ql,simplifyRange:jl,subset:Bl,SemVer:rl,re:Si.re,src:Si.src,tokens:Si.t,SEMVER_SPEC_VERSION:fa.SEMVER_SPEC_VERSION,RELEASE_TYPES:fa.RELEASE_TYPES,compareIdentifiers:pa.compareIdentifiers,rcompareIdentifiers:pa.rcompareIdentifiers}});var Ii=w((Wp,Ia)=>{var ve=require("fs"),ne=require("path"),ga=ws(),ae=ma(),{DEFAULT_API_URL:Ul}=Me(),va=["dependencies","devDependencies","optionalDependencies","peerDependencies"];function wi(r){let i=typeof r=="string"&&r.match(/^((?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*)(?:@([^\r\n]+))?$/);if(!i)throw new Error(`Invalid npm dependency: ${String(r)}`);return{name:i[1],version:i[2]}}function Ci(r){let i=new Map;for(let n of r){let{name:o,version:l}=wi(n),h=i.get(o);i.set(o,h&&l?ya(o,h,l):l||h)}return i}function ya(r,i,n){if(i===n)return i;let o=ae.validRange(i),l=ae.validRange(n);if(o&&l)try{if(ae.subset(l,o))return n;if(ae.subset(o,l))return i}catch{}throw new Error(`Conflicting registry versions for ${r}: ${i} and ${n}`)}function Ml(r,i){let n=typeof r=="string"&&ae.validRange(r),o=ae.validRange(i);if(!n||!o)return!1;try{return ae.subset(n,o)}catch{return!1}}function wt(r,i){if(Ml(r,i))return"satisfied";let n=typeof r=="string"&&ae.validRange(r),o=ae.validRange(i);if(!n||!o)return"incomparable";try{let l=ae.minVersion(n),h=ae.minVersion(o);return!l||!h?"incomparable":ae.lt(l,h)?"lower":"newer"}catch{return"incomparable"}}function St(r,i){let n=va.find(o=>Object.hasOwn(r[o]||{},i));return n?{section:n,existing:r[n][i]}:null}function Ea(r,i){let n=Ci(i);if(n.size===0)return;let o=ne.join(r,"package.json"),l=JSON.parse(ve.readFileSync(o,"utf8"));for(let[h,f]of n){let m=St(l,h),y=m?.section||"dependencies";l[y]||={};let x=m?.existing;l[y][h]=x===void 0?f||"latest":f&&wt(x,f)==="lower"?f:x}ve.writeFileSync(o,`${JSON.stringify(l,null,2)}
3
3
  `)}function Ct(r){let i=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"]];for(let n=ne.resolve(r);;n=ne.dirname(n)){let o=ne.join(n,"package.json");if(ve.existsSync(o)){let l=JSON.parse(ve.readFileSync(o,"utf8")),h=String(l.packageManager||"").split("@")[0];if(["npm","pnpm","yarn","bun"].includes(h))return h}for(let[l,h]of i)if(ve.existsSync(ne.join(n,l)))return h;if(ne.dirname(n)===n)return"npm"}}var xa={npm:"npx",pnpm:"pnpm exec",yarn:"yarn",bun:"bunx"};function ba(r,i=process.cwd()){let n;try{n=Ct(i)}catch{n="npm"}return`${xa[n]||xa.npm} frontfriend ${r}`}function Gl(r,i=process.cwd()){let n=null;try{n=r?new URL(r).origin:null}catch{n=null}return ba(n&&n!==new URL(Ul).origin?`login --api-url ${n}`:"login",i)}function Sa(r){return JSON.parse(ve.readFileSync(ne.join(r,"package.json"),"utf8"))}function _i(r,i){let n=Ci(i);if(n.size===0)return[];let o=Sa(r),l=[];for(let[h,f]of n){let m=St(o,h);m&&(!f||wt(m.existing,f)!=="lower")||l.push(f?`${h}@${f}`:h)}return l}function Hl(r,i){let n=i.filter(g=>g.required),o=Ci(n.flatMap(g=>g.dependencies)),l=(g,S)=>S.filter(E=>E.dependencies.some(N=>wi(N).name===g)).map(E=>E.component).filter(Boolean),h=i.filter(g=>!g.required);if(o.size===0&&h.length===0)return{missing:[],kept:[],repair:[]};let f=Sa(r),m=[],y=[];for(let[g,S]of o){let E=St(f,g);if(!E){m.push(S?`${g}@${S}`:g);continue}if(!S)continue;let N=wt(E.existing,S);N==="lower"?m.push(`${g}@${S}`):N!=="satisfied"&&y.push({name:g,current:E.existing,declared:S,components:l(g,n)})}let x=new Map;for(let g of h.flatMap(S=>S.dependencies)){let{name:S,version:E}=wi(g);if(o.has(S)||St(f,S))continue;let N=x.get(S),B=E||N?.version;if(N?.version&&E&&N.version!==E)try{B=ya(S,N.version,E)}catch{B=N.version}x.set(S,{version:B})}let I=[...x].map(([g,{version:S}])=>({request:S?`${g}@${S}`:g,components:l(g,h)}));return{missing:m,kept:y,repair:I}}function wa(r,i){return[r==="npm"?"install":"add",...i]}function Wl(r){return/^[\w@/.:^~=+-]+$/.test(r)?r:`'${r.replace(/'/g,"'\\''")}'`}function Ca(r,i){let n=Ct(r);return[n,...wa(n,i)].map(Wl).join(" ")}function _a(r,i,{stdio:n="inherit"}={}){let o=_i(r,i);if(o.length===0)return;let l=Ct(r),h=ga.sync(l,wa(l,o),{cwd:r,stdio:n});if(h.error||h.status!==0)throw Ea(r,i),h.error||new Error(`${l} dependency installation failed with status ${h.status}. Dependencies were saved; run ${l} install.`)}function Xl(r,i,{install:n=!0,stdio:o="inherit",log:l=console.log}={}){let h=_i(r,i);if(h.length===0)return{missing:h,command:null,installed:!1};let f=Ca(r,h);if(!n)return l(`\u{1F4E6} Component dependencies missing from package.json. Install them with:
4
4
  ${f}`),{missing:h,command:f,installed:!1};l(`\u{1F4E6} Installing component dependencies: ${f}`);try{return _a(r,h,{stdio:o}),{missing:h,command:f,installed:!0}}catch(m){return l(`\u26A0\uFE0F Component dependencies were not installed: ${m.message}
package/dist/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@frontfriend/sdk",
3
- "version": "1.2.5"
3
+ "version": "1.2.6"
4
4
  }
package/dist/vite.js CHANGED
@@ -1,4 +1,4 @@
1
- var C=(r,i)=>()=>(i||r((i={exports:{}}).exports,i),i.exports);var Er=C(($f,Oo)=>{Oo.exports={name:"@frontfriend/sdk",version:"1.2.5"}});var Sr=C((qf,br)=>{var{name:Fo}=Er();br.exports={PACKAGE_NAME:Fo}});var Ge=C((jf,wr)=>{var Vo="https://app.frontfriend.dev",Do=".cache/frontfriend",$o={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"]},qo={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function jo(r){if(!r)return null;try{let i=new URL(r);return i.hostname.startsWith("app.")?`${i.protocol}//${i.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}wr.exports={DEFAULT_API_URL:Vo,CACHE_DIR_NAME:Do,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:$o,ENV_VARS:qo,deriveRegistryFromApiUrl:jo}});var _r=C((Bf,Cr)=>{var Bt=class extends Error{constructor(i,n,o){super(i),this.name="APIError",this.statusCode=n,this.url=o,this.code=`API_${n}`}},Ut=class extends Error{constructor(i,n){super(i),this.name="CacheError",this.operation=n,this.code=`CACHE_${n.toUpperCase()}`}},Mt=class extends Error{constructor(i,n){super(i),this.name="ConfigError",this.field=n,this.code=n?`CONFIG_${String(n).toUpperCase()}`:"CONFIG_ERROR"}},Gt=class extends Error{constructor(i,n){super(i),this.name="ProcessingError",this.token=n,this.code="PROCESSING_ERROR"}};Cr.exports={APIError:Bt,CacheError:Ut,ConfigError:Mt,ProcessingError:Gt}});var He=C((Uf,Ir)=>{var j=require("fs");function Bo(r){try{let i=j.readFileSync(r,"utf8");return JSON.parse(i)}catch(i){if(i.code==="ENOENT")return null;throw i}}function Uo(r){try{return j.readFileSync(r,"utf8").replace(/^\uFEFF/,"")}catch(i){if(i.code==="ENOENT")return null;throw i}}function Mo(r,i,n=2){let o=JSON.stringify(i,null,n);j.writeFileSync(r,o,"utf8")}function Go(r,i){j.writeFileSync(r,i,"utf8")}function Ho(r,i){if(i==null||typeof i=="object"&&Object.keys(i).length===0||Array.isArray(i)&&i.length===0){let o=`module.exports = ${Array.isArray(i)?"[]":"{}"};`;j.writeFileSync(r,o,"utf8")}else{let n=`module.exports = ${JSON.stringify(i,null,2)};`;j.writeFileSync(r,n,"utf8")}}function Wo(r){return j.existsSync(r)}function Xo(r){j.mkdirSync(r,{recursive:!0})}function zo(r){j.rmSync(r,{recursive:!0,force:!0})}function Ko(r){j.rmSync(r,{force:!0})}function Yo(r,i){j.mkdirSync(require("path").dirname(r),{recursive:!0,mode:448});let n=`${r}.${process.pid}.${Date.now()}.tmp`;try{j.writeFileSync(n,`${JSON.stringify(i,null,2)}
1
+ var C=(r,i)=>()=>(i||r((i={exports:{}}).exports,i),i.exports);var Er=C(($f,Oo)=>{Oo.exports={name:"@frontfriend/sdk",version:"1.2.6"}});var Sr=C((qf,br)=>{var{name:Fo}=Er();br.exports={PACKAGE_NAME:Fo}});var Ge=C((jf,wr)=>{var Vo="https://app.frontfriend.dev",Do=".cache/frontfriend",$o={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"]},qo={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function jo(r){if(!r)return null;try{let i=new URL(r);return i.hostname.startsWith("app.")?`${i.protocol}//${i.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}wr.exports={DEFAULT_API_URL:Vo,CACHE_DIR_NAME:Do,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:$o,ENV_VARS:qo,deriveRegistryFromApiUrl:jo}});var _r=C((Bf,Cr)=>{var Bt=class extends Error{constructor(i,n,o){super(i),this.name="APIError",this.statusCode=n,this.url=o,this.code=`API_${n}`}},Ut=class extends Error{constructor(i,n){super(i),this.name="CacheError",this.operation=n,this.code=`CACHE_${n.toUpperCase()}`}},Mt=class extends Error{constructor(i,n){super(i),this.name="ConfigError",this.field=n,this.code=n?`CONFIG_${String(n).toUpperCase()}`:"CONFIG_ERROR"}},Gt=class extends Error{constructor(i,n){super(i),this.name="ProcessingError",this.token=n,this.code="PROCESSING_ERROR"}};Cr.exports={APIError:Bt,CacheError:Ut,ConfigError:Mt,ProcessingError:Gt}});var He=C((Uf,Ir)=>{var j=require("fs");function Bo(r){try{let i=j.readFileSync(r,"utf8");return JSON.parse(i)}catch(i){if(i.code==="ENOENT")return null;throw i}}function Uo(r){try{return j.readFileSync(r,"utf8").replace(/^\uFEFF/,"")}catch(i){if(i.code==="ENOENT")return null;throw i}}function Mo(r,i,n=2){let o=JSON.stringify(i,null,n);j.writeFileSync(r,o,"utf8")}function Go(r,i){j.writeFileSync(r,i,"utf8")}function Ho(r,i){if(i==null||typeof i=="object"&&Object.keys(i).length===0||Array.isArray(i)&&i.length===0){let o=`module.exports = ${Array.isArray(i)?"[]":"{}"};`;j.writeFileSync(r,o,"utf8")}else{let n=`module.exports = ${JSON.stringify(i,null,2)};`;j.writeFileSync(r,n,"utf8")}}function Wo(r){return j.existsSync(r)}function Xo(r){j.mkdirSync(r,{recursive:!0})}function zo(r){j.rmSync(r,{recursive:!0,force:!0})}function Ko(r){j.rmSync(r,{force:!0})}function Yo(r,i){j.mkdirSync(require("path").dirname(r),{recursive:!0,mode:448});let n=`${r}.${process.pid}.${Date.now()}.tmp`;try{j.writeFileSync(n,`${JSON.stringify(i,null,2)}
2
2
  `,{mode:384}),j.renameSync(n,r);try{j.chmodSync(r,384)}catch{}}finally{j.rmSync(n,{force:!0})}}async function Jo(r,i,n){j.mkdirSync(require("path").dirname(r),{recursive:!0,mode:448});let o=`${r}.lock`,l=Date.now()+2e4,h;for(;h===void 0;)try{h=j.openSync(o,"wx",384),j.writeFileSync(h,String(process.pid))}catch(f){if(f.code!=="EEXIST")throw f;try{let m=Number(j.readFileSync(o,"utf8"));if(Number.isInteger(m)&&m>0)try{process.kill(m,0)}catch(y){if(y.code==="ESRCH"){j.unlinkSync(o);continue}}}catch(m){if(m.code==="ENOENT")continue}if(Date.now()>=l)throw n();await new Promise(m=>setTimeout(m,50))}try{return await i()}finally{j.closeSync(h),j.unlinkSync(o)}}Ir.exports={writePrivateJsonFileAtomic:Yo,withPrivateFileLock:Jo,readJsonFileSafe:Bo,readFileSafe:Uo,writeJsonFile:Mo,writeTextFile:Go,writeModuleExportsFile:Ho,fileExists:Wo,ensureDirectoryExists:Xo,removeDirectory:zo,removeFile:Ko}});var Ht=C((Mf,kr)=>{var Qo="classes.txt",Zo="classes.css";kr.exports={CLASSES_SOURCE_FILE:Qo,CSS_CLASSES_SOURCE_FILE:Zo}});var Lr=C((Gf,Tr)=>{var Q=require("path"),{CACHE_DIR_NAME:eu,CACHE_TTL_MS:tu,CACHE_FILES:Ar}=Ge(),{CacheError:Wt}=_r(),{readJsonFileSafe:ht,readFileSafe:iu,writeJsonFile:Nr,writeTextFile:Rr,writeModuleExportsFile:Pr,fileExists:Xt,ensureDirectoryExists:ru,removeDirectory:su,removeFile:nu}=He(),{CLASSES_SOURCE_FILE:au,CSS_CLASSES_SOURCE_FILE:ou}=Ht(),zt=class r{constructor(i=process.cwd()){this.appRoot=i,this.cacheDir=Q.join(i,"node_modules",eu),this.metadataFile=Q.join(this.cacheDir,"metadata.json"),this.maxAge=tu}getCacheDir(){return this.cacheDir}isLocalOnly(){return ht(this.metadataFile)?.version==="local-components"}getIconLibrary(){let i=Q.join(this.cacheDir,"iconLibrary.json");return Xt(i)?ht(i):null}exists(){return Xt(this.cacheDir)}isValid(){if(!this.exists())return!1;try{let i=ht(this.metadataFile);if(!i)return!1;let n=new Date(i.timestamp).getTime();return Date.now()-n<this.maxAge}catch{return!1}}load(){if(!this.exists())return null;try{let i={};for(let n of Ar.JS){let o=Q.join(this.cacheDir,n);if(Xt(o)){let l=n.replace(".js","");try{let h=iu(o);if(h!==null){let f={},m={exports:f};new Function("module","exports",h)(m,f),i[l]=m.exports}}catch(h){console.warn(`[Frontfriend] Failed to load ${n}: ${h.message}`),(h.message.includes("Unexpected token")||h.message.includes("Invalid character"))&&console.warn("[Frontfriend] This might be a BOM or encoding issue. Try deleting node_modules/.cache/frontfriend and running `npx frontfriend init` again.")}}}for(let n of Ar.JSON){let o=Q.join(this.cacheDir,n),l=n.replace(".json",""),h=ht(o);h!==null&&(i[l]=h)}return i["components-config"]&&(i.componentsConfig=i["components-config"],delete i["components-config"]),i.cls&&!i.safelist&&(i.safelist=i.cls,delete i.cls),i}catch(i){throw new Wt(`Failed to load cache: ${i.message}`,"read")}}save(i){try{ru(this.cacheDir);let n={timestamp:new Date().toISOString(),version:i.metadata?.version||"2.0.0",ffId:i.metadata?.ffId},o=["tokens","variables","semanticVariables","semanticDarkVariables","keyframes","animations","safelist","custom"];for(let h of o)if(i[h]!==void 0){let f=Q.join(this.cacheDir,`${h}.js`);Pr(f,i[h])}if(i.safelist&&Array.isArray(i.safelist)){let h=Q.join(this.cacheDir,"safelist.js");Pr(h,i.safelist)}let l={fonts:i.fonts,icons:i.icons||i.iconSet,"components-config":i.componentsConfig,iconLibrary:i.iconLibrary,version:i.version,versionMetadata:i.versionMetadata,base:i.base,nativeTokens:i.nativeTokens};for(let[h,f]of Object.entries(l))if(f!==void 0){let m=Q.join(this.cacheDir,`${h}.json`);Nr(m,f)}i.themeCSS!==void 0&&Rr(Q.join(this.cacheDir,"theme.css"),i.themeCSS),i.classesContent!==void 0&&(Rr(Q.join(this.cacheDir,au),i.classesContent),nu(Q.join(this.cacheDir,ou))),Nr(this.metadataFile,n)}catch(n){throw new Wt(`Failed to save cache: ${n.message}`,"write")}}saveAtomic(i,n=()=>{}){let o=require("node:fs"),{randomUUID:l}=require("node:crypto");o.mkdirSync(Q.dirname(this.cacheDir),{recursive:!0});let h=`${this.cacheDir}.write-lock`,f;try{f=o.openSync(h,"wx")}catch(x){if(x.code!=="EEXIST")throw x;let w=Number(o.readFileSync(h,"utf8")),g=!0;if(w>0)try{process.kill(w,0)}catch(S){g=S.code!=="ESRCH"}if(g)throw new Wt("Another process is installing tokens. Retry after it completes.","write");o.unlinkSync(h),f=o.openSync(h,"wx")}let m=`${this.cacheDir}.previous`,y=`${this.cacheDir}.${l()}.pending`;try{o.writeFileSync(f,String(process.pid)),!o.existsSync(this.cacheDir)&&o.existsSync(m)&&o.renameSync(m,this.cacheDir);let x=new r(this.appRoot);x.cacheDir=y,x.metadataFile=Q.join(y,"metadata.json"),x.save(i),o.existsSync(m)&&o.rmSync(m,{recursive:!0}),o.existsSync(this.cacheDir)&&o.renameSync(this.cacheDir,m);try{o.renameSync(y,this.cacheDir),n()}catch(w){throw o.rmSync(this.cacheDir,{recursive:!0,force:!0}),o.existsSync(m)&&o.renameSync(m,this.cacheDir),w}o.rmSync(m,{recursive:!0,force:!0})}finally{o.rmSync(y,{recursive:!0,force:!0}),o.closeSync(f),o.rmSync(h,{force:!0})}}clear(){this.exists()&&su(this.cacheDir)}};Tr.exports=zt});var Dr=C((Hf,Vr)=>{function de(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Kt(r,i){if(!de(r)||!de(i))return i===void 0?r:i;let n={...r};for(let[o,l]of Object.entries(i))n[o]=o in n?Kt(n[o],l):l;return n}function Yt(r,i,n=[],o=[]){if(r===void 0||i===void 0)return o;if(!de(r)||!de(i))return o.push(n.join(".")),o;for(let l of Object.keys(r))l in i&&Yt(r[l],i[l],[...n,l],o);return o}function Or(r){return de(r)&&("styles"in r||"behavior"in r)}function Fr(r,i="component"){if(!Or(r)||!de(r.styles)||r.behavior!==void 0&&!de(r.behavior)||Object.keys(r).some(o=>!["styles","behavior"].includes(o)))throw new TypeError(`Component ${i} must use the styles/behavior envelope`);let n=Yt(r.styles,r.behavior,[i]);if(n.length>0)throw new Error(`Component config styles/behavior conflict at ${n.join(", ")}`);return Kt(r.styles||{},r.behavior||{})}function uu(r){if(!de(r))return r;let i=!1,n={};for(let[o,l]of Object.entries(r))n[o]=Fr(l,o),n[o]!==l&&(i=!0);return i?n:r}Vr.exports={isPlainObject:de,deepMerge:Kt,findTreeConflicts:Yt,isComponentEnvelope:Or,toRuntimeComponentConfig:Fr,toRuntimeComponentsConfig:uu}});var Ur=C((Wf,Br)=>{Br.exports=jr;jr.sync=hu;var $r=require("fs");function cu(r,i){var n=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var o=0;o<n.length;o++){var l=n[o].toLowerCase();if(l&&r.substr(-l.length).toLowerCase()===l)return!0}return!1}function qr(r,i,n){return!r.isSymbolicLink()&&!r.isFile()?!1:cu(i,n)}function jr(r,i,n){$r.stat(r,function(o,l){n(o,o?!1:qr(l,r,i))})}function hu(r,i){return qr($r.statSync(r),r,i)}});var Xr=C((Xf,Wr)=>{Wr.exports=Gr;Gr.sync=lu;var Mr=require("fs");function Gr(r,i,n){Mr.stat(r,function(o,l){n(o,o?!1:Hr(l,i))})}function lu(r,i){return Hr(Mr.statSync(r),i)}function Hr(r,i){return r.isFile()&&fu(r,i)}function fu(r,i){var n=r.mode,o=r.uid,l=r.gid,h=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),f=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),m=parseInt("100",8),y=parseInt("010",8),x=parseInt("001",8),w=m|y,g=n&x||n&y&&l===f||n&m&&o===h||n&w&&h===0;return g}});var Kr=C((Kf,zr)=>{var zf=require("fs"),lt;process.platform==="win32"||global.TESTING_WINDOWS?lt=Ur():lt=Xr();zr.exports=Jt;Jt.sync=pu;function Jt(r,i,n){if(typeof i=="function"&&(n=i,i={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,l){Jt(r,i||{},function(h,f){h?l(h):o(f)})})}lt(r,i||{},function(o,l){o&&(o.code==="EACCES"||i&&i.ignoreErrors)&&(o=null,l=!1),n(o,l)})}function pu(r,i){try{return lt.sync(r,i||{})}catch(n){if(i&&i.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var is=C((Yf,ts)=>{var Pe=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Yr=require("path"),du=Pe?";":":",Jr=Kr(),Qr=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),Zr=(r,i)=>{let n=i.colon||du,o=r.match(/\//)||Pe&&r.match(/\\/)?[""]:[...Pe?[process.cwd()]:[],...(i.path||process.env.PATH||"").split(n)],l=Pe?i.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",h=Pe?l.split(n):[""];return Pe&&r.indexOf(".")!==-1&&h[0]!==""&&h.unshift(""),{pathEnv:o,pathExt:h,pathExtExe:l}},es=(r,i,n)=>{typeof i=="function"&&(n=i,i={}),i||(i={});let{pathEnv:o,pathExt:l,pathExtExe:h}=Zr(r,i),f=[],m=x=>new Promise((w,g)=>{if(x===o.length)return i.all&&f.length?w(f):g(Qr(r));let S=o[x],E=/^".*"$/.test(S)?S.slice(1,-1):S,k=Yr.join(E,r),B=!E&&/^\.[\\\/]/.test(r)?r.slice(0,2)+k:k;w(y(B,x,0))}),y=(x,w,g)=>new Promise((S,E)=>{if(g===l.length)return S(m(w+1));let k=l[g];Jr(x+k,{pathExt:h},(B,Y)=>{if(!B&&Y)if(i.all)f.push(x+k);else return S(x+k);return S(y(x,w,g+1))})});return n?m(0).then(x=>n(null,x),n):m(0)},mu=(r,i)=>{i=i||{};let{pathEnv:n,pathExt:o,pathExtExe:l}=Zr(r,i),h=[];for(let f=0;f<n.length;f++){let m=n[f],y=/^".*"$/.test(m)?m.slice(1,-1):m,x=Yr.join(y,r),w=!y&&/^\.[\\\/]/.test(r)?r.slice(0,2)+x:x;for(let g=0;g<o.length;g++){let S=w+o[g];try{if(Jr.sync(S,{pathExt:l}))if(i.all)h.push(S);else return S}catch{}}}if(i.all&&h.length)return h;if(i.nothrow)return null;throw Qr(r)};ts.exports=es;es.sync=mu});var ss=C((Jf,Qt)=>{"use strict";var rs=(r={})=>{let i=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(i).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};Qt.exports=rs;Qt.exports.default=rs});var us=C((Qf,os)=>{"use strict";var ns=require("path"),xu=is(),gu=ss();function as(r,i){let n=r.options.env||process.env,o=process.cwd(),l=r.options.cwd!=null,h=l&&process.chdir!==void 0&&!process.chdir.disabled;if(h)try{process.chdir(r.options.cwd)}catch{}let f;try{f=xu.sync(r.command,{path:n[gu({env:n})],pathExt:i?ns.delimiter:void 0})}catch{}finally{h&&process.chdir(o)}return f&&(f=ns.resolve(l?r.options.cwd:"",f)),f}function vu(r){return as(r)||as(r,!0)}os.exports=vu});var cs=C((Zf,ei)=>{"use strict";var Zt=/([()\][%!^"`<>&|;, *?])/g;function yu(r){return r=r.replace(Zt,"^$1"),r}function Eu(r,i){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(Zt,"^$1"),i&&(r=r.replace(Zt,"^$1")),r}ei.exports.command=yu;ei.exports.argument=Eu});var ls=C((ep,hs)=>{"use strict";hs.exports=/^#!(.*)/});var ps=C((tp,fs)=>{"use strict";var bu=ls();fs.exports=(r="")=>{let i=r.match(bu);if(!i)return null;let[n,o]=i[0].replace(/#! ?/,"").split(" "),l=n.split("/").pop();return l==="env"?o:o?`${l} ${o}`:l}});var ms=C((ip,ds)=>{"use strict";var ti=require("fs"),Su=ps();function wu(r){let n=Buffer.alloc(150),o;try{o=ti.openSync(r,"r"),ti.readSync(o,n,0,150,0),ti.closeSync(o)}catch{}return Su(n.toString())}ds.exports=wu});var ys=C((rp,vs)=>{"use strict";var Cu=require("path"),xs=us(),gs=cs(),_u=ms(),Iu=process.platform==="win32",ku=/\.(?:com|exe)$/i,Au=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Nu(r){r.file=xs(r);let i=r.file&&_u(r.file);return i?(r.args.unshift(r.file),r.command=i,xs(r)):r.file}function Ru(r){if(!Iu)return r;let i=Nu(r),n=!ku.test(i);if(r.options.forceShell||n){let o=Au.test(i);r.command=Cu.normalize(r.command),r.command=gs.command(r.command),r.args=r.args.map(h=>gs.argument(h,o));let l=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${l}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function Pu(r,i,n){i&&!Array.isArray(i)&&(n=i,i=null),i=i?i.slice(0):[],n=Object.assign({},n);let o={command:r,args:i,options:n,file:void 0,original:{command:r,args:i}};return n.shell?o:Ru(o)}vs.exports=Pu});var Ss=C((sp,bs)=>{"use strict";var ii=process.platform==="win32";function ri(r,i){return Object.assign(new Error(`${i} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${i} ${r.command}`,path:r.command,spawnargs:r.args})}function Tu(r,i){if(!ii)return;let n=r.emit;r.emit=function(o,l){if(o==="exit"){let h=Es(l,i);if(h)return n.call(r,"error",h)}return n.apply(r,arguments)}}function Es(r,i){return ii&&r===1&&!i.file?ri(i.original,"spawn"):null}function Lu(r,i){return ii&&r===1&&!i.file?ri(i.original,"spawnSync"):null}bs.exports={hookChildProcess:Tu,verifyENOENT:Es,verifyENOENTSync:Lu,notFoundError:ri}});var _s=C((np,Te)=>{"use strict";var ws=require("child_process"),si=ys(),ni=Ss();function Cs(r,i,n){let o=si(r,i,n),l=ws.spawn(o.command,o.args,o.options);return ni.hookChildProcess(l,o),l}function Ou(r,i,n){let o=si(r,i,n),l=ws.spawnSync(o.command,o.args,o.options);return l.error=l.error||ni.verifyENOENTSync(l.status,o),l}Te.exports=Cs;Te.exports.spawn=Cs;Te.exports.sync=Ou;Te.exports._parse=si;Te.exports._enoent=ni});var Le=C((ap,Is)=>{"use strict";var Fu="2.0.0",Vu=Number.MAX_SAFE_INTEGER||9007199254740991,Du=16,$u=250,qu=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Is.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Du,MAX_SAFE_BUILD_LENGTH:$u,MAX_SAFE_INTEGER:Vu,RELEASE_TYPES:qu,SEMVER_SPEC_VERSION:Fu,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var We=C((op,ks)=>{"use strict";var ju=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};ks.exports=ju});var Oe=C((ce,As)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ai,MAX_SAFE_BUILD_LENGTH:Bu,MAX_LENGTH:Uu}=Le(),Mu=We();ce=As.exports={};var Gu=ce.re=[],Hu=ce.safeRe=[],_=ce.src=[],Wu=ce.safeSrc=[],I=ce.t={},Xu=0,oi="[a-zA-Z0-9-]",zu=[["\\s",1],["\\d",Uu],[oi,Bu]],Ku=r=>{for(let[i,n]of zu)r=r.split(`${i}*`).join(`${i}{0,${n}}`).split(`${i}+`).join(`${i}{1,${n}}`);return r},T=(r,i,n)=>{let o=Ku(i),l=Xu++;Mu(r,l,i),I[r]=l,_[l]=i,Wu[l]=o,Gu[l]=new RegExp(i,n?"g":void 0),Hu[l]=new RegExp(o,n?"g":void 0)};T("NUMERICIDENTIFIER","0|[1-9]\\d*");T("NUMERICIDENTIFIERLOOSE","\\d+");T("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${oi}*`);T("MAINVERSION",`(${_[I.NUMERICIDENTIFIER]})\\.(${_[I.NUMERICIDENTIFIER]})\\.(${_[I.NUMERICIDENTIFIER]})`);T("MAINVERSIONLOOSE",`(${_[I.NUMERICIDENTIFIERLOOSE]})\\.(${_[I.NUMERICIDENTIFIERLOOSE]})\\.(${_[I.NUMERICIDENTIFIERLOOSE]})`);T("PRERELEASEIDENTIFIER",`(?:${_[I.NONNUMERICIDENTIFIER]}|${_[I.NUMERICIDENTIFIER]})`);T("PRERELEASEIDENTIFIERLOOSE",`(?:${_[I.NONNUMERICIDENTIFIER]}|${_[I.NUMERICIDENTIFIERLOOSE]})`);T("PRERELEASE",`(?:-(${_[I.PRERELEASEIDENTIFIER]}(?:\\.${_[I.PRERELEASEIDENTIFIER]})*))`);T("PRERELEASELOOSE",`(?:-?(${_[I.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${_[I.PRERELEASEIDENTIFIERLOOSE]})*))`);T("BUILDIDENTIFIER",`${oi}+`);T("BUILD",`(?:\\+(${_[I.BUILDIDENTIFIER]}(?:\\.${_[I.BUILDIDENTIFIER]})*))`);T("FULLPLAIN",`v?${_[I.MAINVERSION]}${_[I.PRERELEASE]}?${_[I.BUILD]}?`);T("FULL",`^${_[I.FULLPLAIN]}$`);T("LOOSEPLAIN",`[v=\\s]*${_[I.MAINVERSIONLOOSE]}${_[I.PRERELEASELOOSE]}?${_[I.BUILD]}?`);T("LOOSE",`^${_[I.LOOSEPLAIN]}$`);T("GTLT","((?:<|>)?=?)");T("XRANGEIDENTIFIERLOOSE",`${_[I.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);T("XRANGEIDENTIFIER",`${_[I.NUMERICIDENTIFIER]}|x|X|\\*`);T("XRANGEPLAIN",`[v=\\s]*(${_[I.XRANGEIDENTIFIER]})(?:\\.(${_[I.XRANGEIDENTIFIER]})(?:\\.(${_[I.XRANGEIDENTIFIER]})(?:${_[I.PRERELEASE]})?${_[I.BUILD]}?)?)?`);T("XRANGEPLAINLOOSE",`[v=\\s]*(${_[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_[I.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_[I.XRANGEIDENTIFIERLOOSE]})(?:${_[I.PRERELEASELOOSE]})?${_[I.BUILD]}?)?)?`);T("XRANGE",`^${_[I.GTLT]}\\s*${_[I.XRANGEPLAIN]}$`);T("XRANGELOOSE",`^${_[I.GTLT]}\\s*${_[I.XRANGEPLAINLOOSE]}$`);T("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ai}})(?:\\.(\\d{1,${ai}}))?(?:\\.(\\d{1,${ai}}))?`);T("COERCE",`${_[I.COERCEPLAIN]}(?:$|[^\\d])`);T("COERCEFULL",_[I.COERCEPLAIN]+`(?:${_[I.PRERELEASE]})?(?:${_[I.BUILD]})?(?:$|[^\\d])`);T("COERCERTL",_[I.COERCE],!0);T("COERCERTLFULL",_[I.COERCEFULL],!0);T("LONETILDE","(?:~>?)");T("TILDETRIM",`(\\s*)${_[I.LONETILDE]}\\s+`,!0);ce.tildeTrimReplace="$1~";T("TILDE",`^${_[I.LONETILDE]}${_[I.XRANGEPLAIN]}$`);T("TILDELOOSE",`^${_[I.LONETILDE]}${_[I.XRANGEPLAINLOOSE]}$`);T("LONECARET","(?:\\^)");T("CARETTRIM",`(\\s*)${_[I.LONECARET]}\\s+`,!0);ce.caretTrimReplace="$1^";T("CARET",`^${_[I.LONECARET]}${_[I.XRANGEPLAIN]}$`);T("CARETLOOSE",`^${_[I.LONECARET]}${_[I.XRANGEPLAINLOOSE]}$`);T("COMPARATORLOOSE",`^${_[I.GTLT]}\\s*(${_[I.LOOSEPLAIN]})$|^$`);T("COMPARATOR",`^${_[I.GTLT]}\\s*(${_[I.FULLPLAIN]})$|^$`);T("COMPARATORTRIM",`(\\s*)${_[I.GTLT]}\\s*(${_[I.LOOSEPLAIN]}|${_[I.XRANGEPLAIN]})`,!0);ce.comparatorTrimReplace="$1$2$3";T("HYPHENRANGE",`^\\s*(${_[I.XRANGEPLAIN]})\\s+-\\s+(${_[I.XRANGEPLAIN]})\\s*$`);T("HYPHENRANGELOOSE",`^\\s*(${_[I.XRANGEPLAINLOOSE]})\\s+-\\s+(${_[I.XRANGEPLAINLOOSE]})\\s*$`);T("STAR","(<|>)?=?\\s*\\*");T("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");T("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ft=C((up,Ns)=>{"use strict";var Yu=Object.freeze({loose:!0}),Ju=Object.freeze({}),Qu=r=>r?typeof r!="object"?Yu:r:Ju;Ns.exports=Qu});var ui=C((cp,Ts)=>{"use strict";var Rs=/^[0-9]+$/,Ps=(r,i)=>{if(typeof r=="number"&&typeof i=="number")return r===i?0:r<i?-1:1;let n=Rs.test(r),o=Rs.test(i);return n&&o&&(r=+r,i=+i),r===i?0:n&&!o?-1:o&&!n?1:r<i?-1:1},Zu=(r,i)=>Ps(i,r);Ts.exports={compareIdentifiers:Ps,rcompareIdentifiers:Zu}});var G=C((hp,Os)=>{"use strict";var pt=We(),{MAX_LENGTH:Ls,MAX_SAFE_INTEGER:dt}=Le(),{safeRe:mt,t:xt}=Oe(),ec=ft(),{compareIdentifiers:ci}=ui(),tc=(r,i)=>{let n=i.split(".");if(n.length>r.length)return!1;for(let o=0;o<n.length;o++)if(ci(r[o],n[o])!==0)return!1;return!0},hi=class r{constructor(i,n){if(n=ec(n),i instanceof r){if(i.loose===!!n.loose&&i.includePrerelease===!!n.includePrerelease)return i;i=i.version}else if(typeof i!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof i}".`);if(i.length>Ls)throw new TypeError(`version is longer than ${Ls} characters`);pt("SemVer",i,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let o=i.trim().match(n.loose?mt[xt.LOOSE]:mt[xt.FULL]);if(!o)throw new TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>dt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>dt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>dt||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(l=>{if(/^[0-9]+$/.test(l)){let h=+l;if(h>=0&&h<dt)return h}return l}):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(i){if(pt("SemVer.compare",this.version,this.options,i),!(i instanceof r)){if(typeof i=="string"&&i===this.version)return 0;i=new r(i,this.options)}return i.version===this.version?0:this.compareMain(i)||this.comparePre(i)}compareMain(i){return i instanceof r||(i=new r(i,this.options)),this.major<i.major?-1:this.major>i.major?1:this.minor<i.minor?-1:this.minor>i.minor?1:this.patch<i.patch?-1:this.patch>i.patch?1:0}comparePre(i){if(i instanceof r||(i=new r(i,this.options)),this.prerelease.length&&!i.prerelease.length)return-1;if(!this.prerelease.length&&i.prerelease.length)return 1;if(!this.prerelease.length&&!i.prerelease.length)return 0;let n=0;do{let o=this.prerelease[n],l=i.prerelease[n];if(pt("prerelease compare",n,o,l),o===void 0&&l===void 0)return 0;if(l===void 0)return 1;if(o===void 0)return-1;if(o===l)continue;return ci(o,l)}while(++n)}compareBuild(i){i instanceof r||(i=new r(i,this.options));let n=0;do{let o=this.build[n],l=i.build[n];if(pt("build compare",n,o,l),o===void 0&&l===void 0)return 0;if(l===void 0)return 1;if(o===void 0)return-1;if(o===l)continue;return ci(o,l)}while(++n)}inc(i,n,o){if(i.startsWith("pre")){if(!n&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let l=`-${n}`.match(this.options.loose?mt[xt.PRERELEASELOOSE]:mt[xt.PRERELEASE]);if(!l||l[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(i){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 l=Number(o)?1:0;if(this.prerelease.length===0)this.prerelease=[l];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(n===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(l)}}if(n){let h=[n,l];if(o===!1&&(h=[n]),tc(this.prerelease,n)){let f=this.prerelease[n.split(".").length];isNaN(f)&&(this.prerelease=h)}else this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${i}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Os.exports=hi});var ve=C((lp,Vs)=>{"use strict";var Fs=G(),ic=(r,i,n=!1)=>{if(r instanceof Fs)return r;try{return new Fs(r,i)}catch(o){if(!n)return null;throw o}};Vs.exports=ic});var $s=C((fp,Ds)=>{"use strict";var rc=ve(),sc=(r,i)=>{let n=rc(r,i);return n?n.version:null};Ds.exports=sc});var js=C((pp,qs)=>{"use strict";var nc=ve(),ac=(r,i)=>{let n=nc(r.trim().replace(/^[=v]+/,""),i);return n?n.version:null};qs.exports=ac});var Ms=C((dp,Us)=>{"use strict";var Bs=G(),oc=(r,i,n,o,l)=>{typeof n=="string"&&(l=o,o=n,n=void 0);try{return new Bs(r instanceof Bs?r.version:r,n).inc(i,o,l).version}catch{return null}};Us.exports=oc});var Ws=C((mp,Hs)=>{"use strict";var Gs=ve(),uc=(r,i)=>{let n=Gs(r,null,!0),o=Gs(i,null,!0),l=n.compare(o);if(l===0)return null;let h=l>0,f=h?n:o,m=h?o:n,y=!!f.prerelease.length;if(!!m.prerelease.length&&!y){if(!m.patch&&!m.minor)return"major";if(m.compareMain(f)===0)return m.minor&&!m.patch?"minor":"patch"}let w=y?"pre":"";return n.major!==o.major?w+"major":n.minor!==o.minor?w+"minor":n.patch!==o.patch?w+"patch":"prerelease"};Hs.exports=uc});var zs=C((xp,Xs)=>{"use strict";var cc=G(),hc=(r,i)=>new cc(r,i).major;Xs.exports=hc});var Ys=C((gp,Ks)=>{"use strict";var lc=G(),fc=(r,i)=>new lc(r,i).minor;Ks.exports=fc});var Qs=C((vp,Js)=>{"use strict";var pc=G(),dc=(r,i)=>new pc(r,i).patch;Js.exports=dc});var en=C((yp,Zs)=>{"use strict";var mc=ve(),xc=(r,i)=>{let n=mc(r,i);return n&&n.prerelease.length?n.prerelease:null};Zs.exports=xc});var re=C((Ep,rn)=>{"use strict";var tn=G(),gc=(r,i,n)=>new tn(r,n).compare(new tn(i,n));rn.exports=gc});var nn=C((bp,sn)=>{"use strict";var vc=re(),yc=(r,i,n)=>vc(i,r,n);sn.exports=yc});var on=C((Sp,an)=>{"use strict";var Ec=re(),bc=(r,i)=>Ec(r,i,!0);an.exports=bc});var gt=C((wp,cn)=>{"use strict";var un=G(),Sc=(r,i,n)=>{let o=new un(r,n),l=new un(i,n);return o.compare(l)||o.compareBuild(l)};cn.exports=Sc});var ln=C((Cp,hn)=>{"use strict";var wc=gt(),Cc=(r,i)=>r.sort((n,o)=>wc(n,o,i));hn.exports=Cc});var pn=C((_p,fn)=>{"use strict";var _c=gt(),Ic=(r,i)=>r.sort((n,o)=>_c(o,n,i));fn.exports=Ic});var Xe=C((Ip,dn)=>{"use strict";var kc=re(),Ac=(r,i,n)=>kc(r,i,n)>0;dn.exports=Ac});var vt=C((kp,mn)=>{"use strict";var Nc=re(),Rc=(r,i,n)=>Nc(r,i,n)<0;mn.exports=Rc});var li=C((Ap,xn)=>{"use strict";var Pc=re(),Tc=(r,i,n)=>Pc(r,i,n)===0;xn.exports=Tc});var fi=C((Np,gn)=>{"use strict";var Lc=re(),Oc=(r,i,n)=>Lc(r,i,n)!==0;gn.exports=Oc});var yt=C((Rp,vn)=>{"use strict";var Fc=re(),Vc=(r,i,n)=>Fc(r,i,n)>=0;vn.exports=Vc});var Et=C((Pp,yn)=>{"use strict";var Dc=re(),$c=(r,i,n)=>Dc(r,i,n)<=0;yn.exports=$c});var pi=C((Tp,En)=>{"use strict";var qc=li(),jc=fi(),Bc=Xe(),Uc=yt(),Mc=vt(),Gc=Et(),Hc=(r,i,n,o)=>{switch(i){case"===":return typeof r=="object"&&(r=r.version),typeof n=="object"&&(n=n.version),r===n;case"!==":return typeof r=="object"&&(r=r.version),typeof n=="object"&&(n=n.version),r!==n;case"":case"=":case"==":return qc(r,n,o);case"!=":return jc(r,n,o);case">":return Bc(r,n,o);case">=":return Uc(r,n,o);case"<":return Mc(r,n,o);case"<=":return Gc(r,n,o);default:throw new TypeError(`Invalid operator: ${i}`)}};En.exports=Hc});var Sn=C((Lp,bn)=>{"use strict";var Wc=G(),Xc=ve(),{safeRe:bt,t:St}=Oe(),zc=(r,i)=>{if(r instanceof Wc)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;i=i||{};let n=null;if(!i.rtl)n=r.match(i.includePrerelease?bt[St.COERCEFULL]:bt[St.COERCE]);else{let y=i.includePrerelease?bt[St.COERCERTLFULL]:bt[St.COERCERTL],x;for(;(x=y.exec(r))&&(!n||n.index+n[0].length!==r.length);)(!n||x.index+x[0].length!==n.index+n[0].length)&&(n=x),y.lastIndex=x.index+x[1].length+x[2].length;y.lastIndex=-1}if(n===null)return null;let o=n[2],l=n[3]||"0",h=n[4]||"0",f=i.includePrerelease&&n[5]?`-${n[5]}`:"",m=i.includePrerelease&&n[6]?`+${n[6]}`:"";return Xc(`${o}.${l}.${h}${f}${m}`,i)};bn.exports=zc});var Cn=C((Op,wn)=>{"use strict";var Kc=ve(),Yc=Le(),Jc=G(),Qc=(r,i,n)=>{if(!Yc.RELEASE_TYPES.includes(i))return null;let o=Zc(r,n);return o&&eh(o,i)},Zc=(r,i)=>{let n=r instanceof Jc?r.version:r;return Kc(n,i)},eh=(r,i)=>{if(th(i))return r.version;switch(r.prerelease=[],i){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},th=r=>r.startsWith("pre");wn.exports=Qc});var In=C((Fp,_n)=>{"use strict";var di=class{constructor(){this.max=1e3,this.map=new Map}get(i){let n=this.map.get(i);if(n!==void 0)return this.map.delete(i),this.map.set(i,n),n}delete(i){return this.map.delete(i)}set(i,n){if(!this.delete(i)&&n!==void 0){if(this.map.size>=this.max){let l=this.map.keys().next().value;this.delete(l)}this.map.set(i,n)}return this}};_n.exports=di});var se=C((Vp,Rn)=>{"use strict";var ih=/\s+/g,mi=class r{constructor(i,n){if(n=sh(n),i instanceof r)return i.loose===!!n.loose&&i.includePrerelease===!!n.includePrerelease?i:new r(i.raw,n);if(i instanceof xi)return this.raw=i.value,this.set=[[i]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=i.trim().replace(ih," "),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(l=>!An(l[0])),this.set.length===0)this.set=[o];else if(this.set.length>1){for(let l of this.set)if(l.length===1&&ph(l[0])){this.set=[l];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let i=0;i<this.set.length;i++){i>0&&(this.formatted+="||");let n=this.set[i];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(i){i=i.replace(fh,"");let o=((this.options.includePrerelease&&hh)|(this.options.loose&&lh))+":"+i,l=kn.get(o);if(l)return l;let h=this.options.loose,f=h?K[H.HYPHENRANGELOOSE]:K[H.HYPHENRANGE];i=i.replace(f,Ch(this.options.includePrerelease)),$("hyphen replace",i),i=i.replace(K[H.COMPARATORTRIM],oh),$("comparator trim",i),i=i.replace(K[H.TILDETRIM],uh),$("tilde trim",i),i=i.replace(K[H.CARETTRIM],ch),$("caret trim",i);let m=i.split(" ").map(g=>dh(g,this.options)).join(" ").split(/\s+/).map(g=>wh(g,this.options));h&&(m=m.filter(g=>($("loose invalid filter",g,this.options),!!g.match(K[H.COMPARATORLOOSE])))),$("range list",m);let y=new Map,x=m.map(g=>new xi(g,this.options));for(let g of x){if(An(g))return[g];y.set(g.value,g)}y.size>1&&y.has("")&&y.delete("");let w=[...y.values()];return kn.set(o,w),w}intersects(i,n){if(!(i instanceof r))throw new TypeError("a Range is required");return this.set.some(o=>Nn(o,n)&&i.set.some(l=>Nn(l,n)&&o.every(h=>l.every(f=>h.intersects(f,n)))))}test(i){if(!i)return!1;if(typeof i=="string")try{i=new nh(i,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(_h(this.set[n],i,this.options))return!0;return!1}};Rn.exports=mi;var rh=In(),kn=new rh,sh=ft(),xi=ze(),$=We(),nh=G(),{safeRe:K,src:ah,t:H,comparatorTrimReplace:oh,tildeTrimReplace:uh,caretTrimReplace:ch}=Oe(),{FLAG_INCLUDE_PRERELEASE:hh,FLAG_LOOSE:lh}=Le(),fh=new RegExp(ah[H.BUILD],"g"),An=r=>r.value==="<0.0.0-0",ph=r=>r.value==="",Nn=(r,i)=>{let n=!0,o=r.slice(),l=o.pop();for(;n&&o.length;)n=o.every(h=>l.intersects(h,i)),l=o.pop();return n},dh=(r,i)=>(r=r.replace(K[H.BUILD],""),$("comp",r,i),r=vh(r,i),$("caret",r),r=xh(r,i),$("tildes",r),r=Eh(r,i),$("xrange",r),r=Sh(r,i),$("stars",r),r),U=r=>!r||r.toLowerCase()==="x"||r==="*",mh=(r,i,n)=>U(r)&&!U(i)||U(i)&&n&&!U(n),xh=(r,i)=>r.trim().split(/\s+/).map(n=>gh(n,i)).join(" "),gh=(r,i)=>{let n=i.loose?K[H.TILDELOOSE]:K[H.TILDE],o=i.includePrerelease?"-0":"";return r.replace(n,(l,h,f,m,y)=>{$("tilde",r,l,h,f,m,y);let x;return U(h)?x="":U(f)?x=`>=${h}.0.0${o} <${+h+1}.0.0-0`:U(m)?x=`>=${h}.${f}.0${o} <${h}.${+f+1}.0-0`:y?($("replaceTilde pr",y),x=`>=${h}.${f}.${m}-${y} <${h}.${+f+1}.0-0`):x=`>=${h}.${f}.${m} <${h}.${+f+1}.0-0`,$("tilde return",x),x})},vh=(r,i)=>r.trim().split(/\s+/).map(n=>yh(n,i)).join(" "),yh=(r,i)=>{$("caret",r,i);let n=i.loose?K[H.CARETLOOSE]:K[H.CARET],o=i.includePrerelease?"-0":"";return r.replace(n,(l,h,f,m,y)=>{$("caret",r,l,h,f,m,y);let x;return U(h)?x="":U(f)?x=`>=${h}.0.0${o} <${+h+1}.0.0-0`:U(m)?h==="0"?x=`>=${h}.${f}.0${o} <${h}.${+f+1}.0-0`:x=`>=${h}.${f}.0${o} <${+h+1}.0.0-0`:y?($("replaceCaret pr",y),h==="0"?f==="0"?x=`>=${h}.${f}.${m}-${y} <${h}.${f}.${+m+1}-0`:x=`>=${h}.${f}.${m}-${y} <${h}.${+f+1}.0-0`:x=`>=${h}.${f}.${m}-${y} <${+h+1}.0.0-0`):($("no pr"),h==="0"?f==="0"?x=`>=${h}.${f}.${m} <${h}.${f}.${+m+1}-0`:x=`>=${h}.${f}.${m} <${h}.${+f+1}.0-0`:x=`>=${h}.${f}.${m} <${+h+1}.0.0-0`),$("caret return",x),x})},Eh=(r,i)=>($("replaceXRanges",r,i),r.split(/\s+/).map(n=>bh(n,i)).join(" ")),bh=(r,i)=>{r=r.trim();let n=i.loose?K[H.XRANGELOOSE]:K[H.XRANGE];return r.replace(n,(o,l,h,f,m,y)=>{if($("xRange",r,o,l,h,f,m,y),mh(h,f,m))return r;let x=U(h),w=x||U(f),g=w||U(m),S=g;return l==="="&&S&&(l=""),y=i.includePrerelease?"-0":"",x?l===">"||l==="<"?o="<0.0.0-0":o="*":l&&S?(w&&(f=0),m=0,l===">"?(l=">=",w?(h=+h+1,f=0,m=0):(f=+f+1,m=0)):l==="<="&&(l="<",w?h=+h+1:f=+f+1),l==="<"&&(y="-0"),o=`${l+h}.${f}.${m}${y}`):w?o=`>=${h}.0.0${y} <${+h+1}.0.0-0`:g&&(o=`>=${h}.${f}.0${y} <${h}.${+f+1}.0-0`),$("xRange return",o),o})},Sh=(r,i)=>($("replaceStars",r,i),r.trim().replace(K[H.STAR],"")),wh=(r,i)=>($("replaceGTE0",r,i),r.trim().replace(K[i.includePrerelease?H.GTE0PRE:H.GTE0],"")),Ch=r=>(i,n,o,l,h,f,m,y,x,w,g,S)=>(U(o)?n="":U(l)?n=`>=${o}.0.0${r?"-0":""}`:U(h)?n=`>=${o}.${l}.0${r?"-0":""}`:f?n=`>=${n}`:n=`>=${n}${r?"-0":""}`,U(x)?y="":U(w)?y=`<${+x+1}.0.0-0`:U(g)?y=`<${x}.${+w+1}.0-0`:S?y=`<=${x}.${w}.${g}-${S}`:r?y=`<${x}.${w}.${+g+1}-0`:y=`<=${y}`,`${n} ${y}`.trim()),_h=(r,i,n)=>{for(let o=0;o<r.length;o++)if(!r[o].test(i))return!1;if(i.prerelease.length&&!n.includePrerelease){for(let o=0;o<r.length;o++)if($(r[o].semver),r[o].semver!==xi.ANY&&r[o].semver.prerelease.length>0){let l=r[o].semver;if(l.major===i.major&&l.minor===i.minor&&l.patch===i.patch)return!0}return!1}return!0}});var ze=C((Dp,Vn)=>{"use strict";var Ke=Symbol("SemVer ANY"),yi=class r{static get ANY(){return Ke}constructor(i,n){if(n=Pn(n),i instanceof r){if(i.loose===!!n.loose)return i;i=i.value}i=i.trim().split(/\s+/).join(" "),vi("comparator",i,n),this.options=n,this.loose=!!n.loose,this.parse(i),this.semver===Ke?this.value="":this.value=this.operator+this.semver.version,vi("comp",this)}parse(i){let n=this.options.loose?Tn[Ln.COMPARATORLOOSE]:Tn[Ln.COMPARATOR],o=i.match(n);if(!o)throw new TypeError(`Invalid comparator: ${i}`);this.operator=o[1]!==void 0?o[1]:"",this.operator==="="&&(this.operator=""),o[2]?this.semver=new On(o[2],this.options.loose):this.semver=Ke}toString(){return this.value}test(i){if(vi("Comparator.test",i,this.options.loose),this.semver===Ke||i===Ke)return!0;if(typeof i=="string")try{i=new On(i,this.options)}catch{return!1}return gi(i,this.operator,this.semver,this.options)}intersects(i,n){if(!(i instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Fn(i.value,n).test(this.value):i.operator===""?i.value===""?!0:new Fn(this.value,n).test(i.semver):(n=Pn(n),n.includePrerelease&&(this.value==="<0.0.0-0"||i.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||i.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&i.operator.startsWith(">")||this.operator.startsWith("<")&&i.operator.startsWith("<")||this.semver.version===i.semver.version&&this.operator.includes("=")&&i.operator.includes("=")||gi(this.semver,"<",i.semver,n)&&this.operator.startsWith(">")&&i.operator.startsWith("<")||gi(this.semver,">",i.semver,n)&&this.operator.startsWith("<")&&i.operator.startsWith(">")))}};Vn.exports=yi;var Pn=ft(),{safeRe:Tn,t:Ln}=Oe(),gi=pi(),vi=We(),On=G(),Fn=se()});var Ye=C(($p,Dn)=>{"use strict";var Ih=se(),kh=(r,i,n)=>{try{i=new Ih(i,n)}catch{return!1}return i.test(r)};Dn.exports=kh});var qn=C((qp,$n)=>{"use strict";var Ah=se(),Nh=(r,i)=>new Ah(r,i).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));$n.exports=Nh});var Bn=C((jp,jn)=>{"use strict";var Rh=G(),Ph=se(),Th=(r,i,n)=>{let o=null,l=null,h=null;try{h=new Ph(i,n)}catch{return null}return r.forEach(f=>{h.test(f)&&(!o||l.compare(f)===-1)&&(o=f,l=new Rh(o,n))}),o};jn.exports=Th});var Mn=C((Bp,Un)=>{"use strict";var Lh=G(),Oh=se(),Fh=(r,i,n)=>{let o=null,l=null,h=null;try{h=new Oh(i,n)}catch{return null}return r.forEach(f=>{h.test(f)&&(!o||l.compare(f)===1)&&(o=f,l=new Lh(o,n))}),o};Un.exports=Fh});var Wn=C((Up,Hn)=>{"use strict";var Ei=G(),Vh=se(),Gn=Xe(),Dh=(r,i)=>{r=new Vh(r,i);let n=new Ei("0.0.0");if(r.test(n)||(n=new Ei("0.0.0-0"),r.test(n)))return n;n=null;for(let o=0;o<r.set.length;++o){let l=r.set[o],h=null;l.forEach(f=>{let m=new Ei(f.semver.version);switch(f.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!h||Gn(m,h))&&(h=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${f.operator}`)}}),h&&(!n||Gn(n,h))&&(n=h)}return n&&r.test(n)?n:null};Hn.exports=Dh});var zn=C((Mp,Xn)=>{"use strict";var $h=se(),qh=(r,i)=>{try{return new $h(r,i).range||"*"}catch{return null}};Xn.exports=qh});var wt=C((Gp,Qn)=>{"use strict";var jh=G(),Jn=ze(),{ANY:Bh}=Jn,Uh=se(),Mh=Ye(),Kn=Xe(),Yn=vt(),Gh=Et(),Hh=yt(),Wh=(r,i,n,o)=>{r=new jh(r,o),i=new Uh(i,o);let l,h,f,m,y;switch(n){case">":l=Kn,h=Gh,f=Yn,m=">",y=">=";break;case"<":l=Yn,h=Hh,f=Kn,m="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Mh(r,i,o))return!1;for(let x=0;x<i.set.length;++x){let w=i.set[x],g=null,S=null;if(w.forEach(E=>{E.semver===Bh&&(E=new Jn(">=0.0.0")),g=g||E,S=S||E,l(E.semver,g.semver,o)?g=E:f(E.semver,S.semver,o)&&(S=E)}),g.operator===m||g.operator===y||(!S.operator||S.operator===m)&&h(r,S.semver))return!1;if(S.operator===y&&f(r,S.semver))return!1}return!0};Qn.exports=Wh});var ea=C((Hp,Zn)=>{"use strict";var Xh=wt(),zh=(r,i,n)=>Xh(r,i,">",n);Zn.exports=zh});var ia=C((Wp,ta)=>{"use strict";var Kh=wt(),Yh=(r,i,n)=>Kh(r,i,"<",n);ta.exports=Yh});var na=C((Xp,sa)=>{"use strict";var ra=se(),Jh=(r,i,n)=>(r=new ra(r,n),i=new ra(i,n),r.intersects(i,n));sa.exports=Jh});var oa=C((zp,aa)=>{"use strict";var Qh=Ye(),Zh=re();aa.exports=(r,i,n)=>{let o=[],l=null,h=null,f=r.sort((w,g)=>Zh(w,g,n));for(let w of f)Qh(w,i,n)?(h=w,l||(l=w)):(h&&o.push([l,h]),h=null,l=null);l&&o.push([l,null]);let m=[];for(let[w,g]of o)w===g?m.push(w):!g&&w===f[0]?m.push("*"):g?w===f[0]?m.push(`<=${g}`):m.push(`${w} - ${g}`):m.push(`>=${w}`);let y=m.join(" || "),x=typeof i.raw=="string"?i.raw:String(i);return y.length<x.length?y:i}});var pa=C((Kp,fa)=>{"use strict";var ua=se(),wi=ze(),{ANY:bi}=wi,Si=Ye(),Ci=re(),el=(r,i,n={})=>{if(r===i)return!0;r=new ua(r,n),i=new ua(i,n);let o=!1;e:for(let l of r.set){for(let h of i.set){let f=il(l,h,n);if(o=o||f!==null,f)continue e}if(o)return!1}return!0},tl=[new wi(">=0.0.0-0")],ca=[new wi(">=0.0.0")],il=(r,i,n)=>{if(r===i)return!0;if(r.length===1&&r[0].semver===bi){if(i.length===1&&i[0].semver===bi)return!0;n.includePrerelease?r=tl:r=ca}if(i.length===1&&i[0].semver===bi){if(n.includePrerelease)return!0;i=ca}let o=new Set,l,h;for(let E of r)E.operator===">"||E.operator===">="?l=ha(l,E,n):E.operator==="<"||E.operator==="<="?h=la(h,E,n):o.add(E.semver);if(o.size>1)return null;let f;if(l&&h){if(f=Ci(l.semver,h.semver,n),f>0)return null;if(f===0&&(l.operator!==">="||h.operator!=="<="))return null}for(let E of o){if(l&&!Si(E,String(l),n)||h&&!Si(E,String(h),n))return null;for(let k of i)if(!Si(E,String(k),n))return!1;return!0}let m,y,x,w,g=h&&!n.includePrerelease&&h.semver.prerelease.length?h.semver:!1,S=l&&!n.includePrerelease&&l.semver.prerelease.length?l.semver:!1;g&&g.prerelease.length===1&&h.operator==="<"&&g.prerelease[0]===0&&(g=!1);for(let E of i){if(w=w||E.operator===">"||E.operator===">=",x=x||E.operator==="<"||E.operator==="<=",l){if(S&&E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===S.major&&E.semver.minor===S.minor&&E.semver.patch===S.patch&&(S=!1),E.operator===">"||E.operator===">="){if(m=ha(l,E,n),m===E&&m!==l)return!1}else if(l.operator===">="&&!E.test(l.semver))return!1}if(h){if(g&&E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===g.major&&E.semver.minor===g.minor&&E.semver.patch===g.patch&&(g=!1),E.operator==="<"||E.operator==="<="){if(y=la(h,E,n),y===E&&y!==h)return!1}else if(h.operator==="<="&&!E.test(h.semver))return!1}if(!E.operator&&(h||l)&&f!==0)return!1}return!(l&&x&&!h&&f!==0||h&&w&&!l&&f!==0||S||g)},ha=(r,i,n)=>{if(!r)return i;let o=Ci(r.semver,i.semver,n);return o>0?r:o<0||i.operator===">"&&r.operator===">="?i:r},la=(r,i,n)=>{if(!r)return i;let o=Ci(r.semver,i.semver,n);return o<0?r:o>0||i.operator==="<"&&r.operator==="<="?i:r};fa.exports=el});var ga=C((Yp,xa)=>{"use strict";var _i=Oe(),da=Le(),rl=G(),ma=ui(),sl=ve(),nl=$s(),al=js(),ol=Ms(),ul=Ws(),cl=zs(),hl=Ys(),ll=Qs(),fl=en(),pl=re(),dl=nn(),ml=on(),xl=gt(),gl=ln(),vl=pn(),yl=Xe(),El=vt(),bl=li(),Sl=fi(),wl=yt(),Cl=Et(),_l=pi(),Il=Sn(),kl=Cn(),Al=ze(),Nl=se(),Rl=Ye(),Pl=qn(),Tl=Bn(),Ll=Mn(),Ol=Wn(),Fl=zn(),Vl=wt(),Dl=ea(),$l=ia(),ql=na(),jl=oa(),Bl=pa();xa.exports={parse:sl,valid:nl,clean:al,inc:ol,diff:ul,major:cl,minor:hl,patch:ll,prerelease:fl,compare:pl,rcompare:dl,compareLoose:ml,compareBuild:xl,sort:gl,rsort:vl,gt:yl,lt:El,eq:bl,neq:Sl,gte:wl,lte:Cl,cmp:_l,coerce:Il,truncate:kl,Comparator:Al,Range:Nl,satisfies:Rl,toComparators:Pl,maxSatisfying:Tl,minSatisfying:Ll,minVersion:Ol,validRange:Fl,outside:Vl,gtr:Dl,ltr:$l,intersects:ql,simplifyRange:jl,subset:Bl,SemVer:rl,re:_i.re,src:_i.src,tokens:_i.t,SEMVER_SPEC_VERSION:da.SEMVER_SPEC_VERSION,RELEASE_TYPES:da.RELEASE_TYPES,compareIdentifiers:ma.compareIdentifiers,rcompareIdentifiers:ma.rcompareIdentifiers}});var Ni=C((Jp,Aa)=>{var ye=require("fs"),ne=require("path"),ya=_s(),ae=ga(),{DEFAULT_API_URL:Ul}=Ge(),Ea=["dependencies","devDependencies","optionalDependencies","peerDependencies"];function Ii(r){let i=typeof r=="string"&&r.match(/^((?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*)(?:@([^\r\n]+))?$/);if(!i)throw new Error(`Invalid npm dependency: ${String(r)}`);return{name:i[1],version:i[2]}}function ki(r){let i=new Map;for(let n of r){let{name:o,version:l}=Ii(n),h=i.get(o);i.set(o,h&&l?ba(o,h,l):l||h)}return i}function ba(r,i,n){if(i===n)return i;let o=ae.validRange(i),l=ae.validRange(n);if(o&&l)try{if(ae.subset(l,o))return n;if(ae.subset(o,l))return i}catch{}throw new Error(`Conflicting registry versions for ${r}: ${i} and ${n}`)}function Ml(r,i){let n=typeof r=="string"&&ae.validRange(r),o=ae.validRange(i);if(!n||!o)return!1;try{return ae.subset(n,o)}catch{return!1}}function _t(r,i){if(Ml(r,i))return"satisfied";let n=typeof r=="string"&&ae.validRange(r),o=ae.validRange(i);if(!n||!o)return"incomparable";try{let l=ae.minVersion(n),h=ae.minVersion(o);return!l||!h?"incomparable":ae.lt(l,h)?"lower":"newer"}catch{return"incomparable"}}function Ct(r,i){let n=Ea.find(o=>Object.hasOwn(r[o]||{},i));return n?{section:n,existing:r[n][i]}:null}function Sa(r,i){let n=ki(i);if(n.size===0)return;let o=ne.join(r,"package.json"),l=JSON.parse(ye.readFileSync(o,"utf8"));for(let[h,f]of n){let m=Ct(l,h),y=m?.section||"dependencies";l[y]||={};let x=m?.existing;l[y][h]=x===void 0?f||"latest":f&&_t(x,f)==="lower"?f:x}ye.writeFileSync(o,`${JSON.stringify(l,null,2)}
3
3
  `)}function It(r){let i=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"]];for(let n=ne.resolve(r);;n=ne.dirname(n)){let o=ne.join(n,"package.json");if(ye.existsSync(o)){let l=JSON.parse(ye.readFileSync(o,"utf8")),h=String(l.packageManager||"").split("@")[0];if(["npm","pnpm","yarn","bun"].includes(h))return h}for(let[l,h]of i)if(ye.existsSync(ne.join(n,l)))return h;if(ne.dirname(n)===n)return"npm"}}var va={npm:"npx",pnpm:"pnpm exec",yarn:"yarn",bun:"bunx"};function wa(r,i=process.cwd()){let n;try{n=It(i)}catch{n="npm"}return`${va[n]||va.npm} frontfriend ${r}`}function Gl(r,i=process.cwd()){let n=null;try{n=r?new URL(r).origin:null}catch{n=null}return wa(n&&n!==new URL(Ul).origin?`login --api-url ${n}`:"login",i)}function Ca(r){return JSON.parse(ye.readFileSync(ne.join(r,"package.json"),"utf8"))}function Ai(r,i){let n=ki(i);if(n.size===0)return[];let o=Ca(r),l=[];for(let[h,f]of n){let m=Ct(o,h);m&&(!f||_t(m.existing,f)!=="lower")||l.push(f?`${h}@${f}`:h)}return l}function Hl(r,i){let n=i.filter(g=>g.required),o=ki(n.flatMap(g=>g.dependencies)),l=(g,S)=>S.filter(E=>E.dependencies.some(k=>Ii(k).name===g)).map(E=>E.component).filter(Boolean),h=i.filter(g=>!g.required);if(o.size===0&&h.length===0)return{missing:[],kept:[],repair:[]};let f=Ca(r),m=[],y=[];for(let[g,S]of o){let E=Ct(f,g);if(!E){m.push(S?`${g}@${S}`:g);continue}if(!S)continue;let k=_t(E.existing,S);k==="lower"?m.push(`${g}@${S}`):k!=="satisfied"&&y.push({name:g,current:E.existing,declared:S,components:l(g,n)})}let x=new Map;for(let g of h.flatMap(S=>S.dependencies)){let{name:S,version:E}=Ii(g);if(o.has(S)||Ct(f,S))continue;let k=x.get(S),B=E||k?.version;if(k?.version&&E&&k.version!==E)try{B=ba(S,k.version,E)}catch{B=k.version}x.set(S,{version:B})}let w=[...x].map(([g,{version:S}])=>({request:S?`${g}@${S}`:g,components:l(g,h)}));return{missing:m,kept:y,repair:w}}function _a(r,i){return[r==="npm"?"install":"add",...i]}function Wl(r){return/^[\w@/.:^~=+-]+$/.test(r)?r:`'${r.replace(/'/g,"'\\''")}'`}function Ia(r,i){let n=It(r);return[n,..._a(n,i)].map(Wl).join(" ")}function ka(r,i,{stdio:n="inherit"}={}){let o=Ai(r,i);if(o.length===0)return;let l=It(r),h=ya.sync(l,_a(l,o),{cwd:r,stdio:n});if(h.error||h.status!==0)throw Sa(r,i),h.error||new Error(`${l} dependency installation failed with status ${h.status}. Dependencies were saved; run ${l} install.`)}function Xl(r,i,{install:n=!0,stdio:o="inherit",log:l=console.log}={}){let h=Ai(r,i);if(h.length===0)return{missing:h,command:null,installed:!1};let f=Ia(r,h);if(!n)return l(`\u{1F4E6} Component dependencies missing from package.json. Install them with:
4
4
  ${f}`),{missing:h,command:f,installed:!1};l(`\u{1F4E6} Installing component dependencies: ${f}`);try{return ka(r,h,{stdio:o}),{missing:h,command:f,installed:!0}}catch(m){return l(`\u26A0\uFE0F Component dependencies were not installed: ${m.message}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontfriend/sdk",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Frontfriend SDK: design contracts, tokens, components, CLI and MCP integrations",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/types/index.d.ts",