@frontfriend/sdk 1.2.7 → 1.2.8
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/README.md +13 -355
- package/dist/cli.js +1 -1
- package/dist/lib/core/adoption.js +1 -1
- package/dist/lib/core/application-adoption.js +1 -1
- package/dist/mcp.cjs +1 -1
- package/dist/next.js +1 -1
- package/dist/package.json +1 -1
- package/dist/vite.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var g9=Object.create;var up=Object.defineProperty;var y9=Object.getOwnPropertyDescriptor;var v9=Object.getOwnPropertyNames;var _9=Object.getPrototypeOf,b9=Object.prototype.hasOwnProperty;var Ve=(e,t)=>()=>(e&&(t=e(e=0)),t);var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bo=(e,t)=>{for(var r in t)up(e,r,{get:t[r],enumerable:!0})},VE=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of v9(t))!b9.call(e,n)&&n!==r&&up(e,n,{get:()=>t[n],enumerable:!(i=y9(t,n))||i.enumerable});return e};var Bi=(e,t,r)=>(r=e!=null?g9(_9(e)):{},VE(t||!e||!e.__esModule?up(r,"default",{value:e,enumerable:!0}):r,e)),Mr=e=>VE(up({},"__esModule",{value:!0}),e);var xa=B((VIe,S9)=>{S9.exports={name:"@frontfriend/sdk",version:"1.2.7"}});var So=B((JIe,JE)=>{var{name:w9}=xa();JE.exports={PACKAGE_NAME:w9}});var fa=B((BIe,BE)=>{var $9="https://app.frontfriend.dev",R9=".cache/frontfriend",E9={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"]},P9={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function O9(e){if(!e)return null;try{let t=new URL(e);return t.hostname.startsWith("app.")?`${t.protocol}//${t.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}BE.exports={DEFAULT_API_URL:$9,CACHE_DIR_NAME:R9,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:E9,ENV_VARS:P9,deriveRegistryFromApiUrl:O9}});var WE=B((HIe,GE)=>{GE.exports=KE;KE.sync=C9;var HE=require("fs");function I9(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function ZE(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:I9(t,r)}function KE(e,t,r){HE.stat(e,function(i,n){r(i,i?!1:ZE(n,e,t))})}function C9(e,t){return ZE(HE.statSync(e),e,t)}});var tP=B((ZIe,eP)=>{eP.exports=XE;XE.sync=k9;var YE=require("fs");function XE(e,t,r){YE.stat(e,function(i,n){r(i,i?!1:QE(n,t))})}function k9(e,t){return QE(YE.statSync(e),t)}function QE(e,t){return e.isFile()&&T9(e,t)}function T9(e,t){var r=e.mode,i=e.uid,n=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,f=r&l||r&c&&n===s||r&a&&i===o||r&u&&o===0;return f}});var nP=B((GIe,rP)=>{var KIe=require("fs"),dp;process.platform==="win32"||global.TESTING_WINDOWS?dp=WE():dp=tP();rP.exports=Qv;Qv.sync=j9;function Qv(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){Qv(e,t||{},function(o,s){o?n(o):i(s)})})}dp(e,t||{},function(i,n){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,n=!1),r(i,n)})}function j9(e,t){try{return dp.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var uP=B((WIe,lP)=>{var sl=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",iP=require("path"),A9=sl?";":":",oP=nP(),sP=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),aP=(e,t)=>{let r=t.colon||A9,i=e.match(/\//)||sl&&e.match(/\\/)?[""]:[...sl?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=sl?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=sl?n.split(r):[""];return sl&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:n}},cP=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:i,pathExt:n,pathExtExe:o}=aP(e,t),s=[],a=l=>new Promise((u,f)=>{if(l===i.length)return t.all&&s.length?u(s):f(sP(e));let p=i[l],g=/^".*"$/.test(p)?p.slice(1,-1):p,h=iP.join(g,e),v=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;u(c(v,l,0))}),c=(l,u,f)=>new Promise((p,g)=>{if(f===n.length)return p(a(u+1));let h=n[f];oP(l+h,{pathExt:o},(v,y)=>{if(!v&&y)if(t.all)s.push(l+h);else return p(l+h);return p(c(l,u,f+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},N9=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=aP(e,t),o=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,l=iP.join(c,e),u=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let f=0;f<i.length;f++){let p=u+i[f];try{if(oP.sync(p,{pathExt:n}))if(t.all)o.push(p);else return p}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw sP(e)};lP.exports=cP;cP.sync=N9});var fP=B((YIe,e_)=>{"use strict";var dP=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};e_.exports=dP;e_.exports.default=dP});var gP=B((XIe,mP)=>{"use strict";var pP=require("path"),x9=uP(),M9=fP();function hP(e,t){let r=e.options.env||process.env,i=process.cwd(),n=e.options.cwd!=null,o=n&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let s;try{s=x9.sync(e.command,{path:r[M9({env:r})],pathExt:t?pP.delimiter:void 0})}catch{}finally{o&&process.chdir(i)}return s&&(s=pP.resolve(n?e.options.cwd:"",s)),s}function q9(e){return hP(e)||hP(e,!0)}mP.exports=q9});var yP=B((QIe,r_)=>{"use strict";var t_=/([()\][%!^"`<>&|;, *?])/g;function L9(e){return e=e.replace(t_,"^$1"),e}function D9(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(t_,"^$1"),t&&(e=e.replace(t_,"^$1")),e}r_.exports.command=L9;r_.exports.argument=D9});var _P=B((eCe,vP)=>{"use strict";vP.exports=/^#!(.*)/});var SP=B((tCe,bP)=>{"use strict";var U9=_P();bP.exports=(e="")=>{let t=e.match(U9);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var $P=B((rCe,wP)=>{"use strict";var n_=require("fs"),z9=SP();function F9(e){let r=Buffer.alloc(150),i;try{i=n_.openSync(e,"r"),n_.readSync(i,r,0,150,0),n_.closeSync(i)}catch{}return z9(r.toString())}wP.exports=F9});var OP=B((nCe,PP)=>{"use strict";var V9=require("path"),RP=gP(),EP=yP(),J9=$P(),B9=process.platform==="win32",H9=/\.(?:com|exe)$/i,Z9=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function K9(e){e.file=RP(e);let t=e.file&&J9(e.file);return t?(e.args.unshift(e.file),e.command=t,RP(e)):e.file}function G9(e){if(!B9)return e;let t=K9(e),r=!H9.test(t);if(e.options.forceShell||r){let i=Z9.test(t);e.command=V9.normalize(e.command),e.command=EP.command(e.command),e.args=e.args.map(o=>EP.argument(o,i));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function W9(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let i={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?i:G9(i)}PP.exports=W9});var kP=B((iCe,CP)=>{"use strict";var i_=process.platform==="win32";function o_(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Y9(e,t){if(!i_)return;let r=e.emit;e.emit=function(i,n){if(i==="exit"){let o=IP(n,t);if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}function IP(e,t){return i_&&e===1&&!t.file?o_(t.original,"spawn"):null}function X9(e,t){return i_&&e===1&&!t.file?o_(t.original,"spawnSync"):null}CP.exports={hookChildProcess:Y9,verifyENOENT:IP,verifyENOENTSync:X9,notFoundError:o_}});var c_=B((oCe,al)=>{"use strict";var TP=require("child_process"),s_=OP(),a_=kP();function jP(e,t,r){let i=s_(e,t,r),n=TP.spawn(i.command,i.args,i.options);return a_.hookChildProcess(n,i),n}function Q9(e,t,r){let i=s_(e,t,r),n=TP.spawnSync(i.command,i.args,i.options);return n.error=n.error||a_.verifyENOENTSync(n.status,i),n}al.exports=jP;al.exports.spawn=jP;al.exports.sync=Q9;al.exports._parse=s_;al.exports._enoent=a_});var cl=B((sCe,AP)=>{"use strict";var eB="2.0.0",tB=Number.MAX_SAFE_INTEGER||9007199254740991,rB=16,nB=250,iB=["major","premajor","minor","preminor","patch","prepatch","prerelease"];AP.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:rB,MAX_SAFE_BUILD_LENGTH:nB,MAX_SAFE_INTEGER:tB,RELEASE_TYPES:iB,SEMVER_SPEC_VERSION:eB,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Fu=B((aCe,NP)=>{"use strict";var oB=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};NP.exports=oB});var ll=B((Bo,xP)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:l_,MAX_SAFE_BUILD_LENGTH:sB,MAX_LENGTH:aB}=cl(),cB=Fu();Bo=xP.exports={};var lB=Bo.re=[],uB=Bo.safeRe=[],Ze=Bo.src=[],dB=Bo.safeSrc=[],Ke=Bo.t={},fB=0,u_="[a-zA-Z0-9-]",pB=[["\\s",1],["\\d",aB],[u_,sB]],hB=e=>{for(let[t,r]of pB)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},St=(e,t,r)=>{let i=hB(t),n=fB++;cB(e,n,t),Ke[e]=n,Ze[n]=t,dB[n]=i,lB[n]=new RegExp(t,r?"g":void 0),uB[n]=new RegExp(i,r?"g":void 0)};St("NUMERICIDENTIFIER","0|[1-9]\\d*");St("NUMERICIDENTIFIERLOOSE","\\d+");St("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u_}*`);St("MAINVERSION",`(${Ze[Ke.NUMERICIDENTIFIER]})\\.(${Ze[Ke.NUMERICIDENTIFIER]})\\.(${Ze[Ke.NUMERICIDENTIFIER]})`);St("MAINVERSIONLOOSE",`(${Ze[Ke.NUMERICIDENTIFIERLOOSE]})\\.(${Ze[Ke.NUMERICIDENTIFIERLOOSE]})\\.(${Ze[Ke.NUMERICIDENTIFIERLOOSE]})`);St("PRERELEASEIDENTIFIER",`(?:${Ze[Ke.NONNUMERICIDENTIFIER]}|${Ze[Ke.NUMERICIDENTIFIER]})`);St("PRERELEASEIDENTIFIERLOOSE",`(?:${Ze[Ke.NONNUMERICIDENTIFIER]}|${Ze[Ke.NUMERICIDENTIFIERLOOSE]})`);St("PRERELEASE",`(?:-(${Ze[Ke.PRERELEASEIDENTIFIER]}(?:\\.${Ze[Ke.PRERELEASEIDENTIFIER]})*))`);St("PRERELEASELOOSE",`(?:-?(${Ze[Ke.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Ze[Ke.PRERELEASEIDENTIFIERLOOSE]})*))`);St("BUILDIDENTIFIER",`${u_}+`);St("BUILD",`(?:\\+(${Ze[Ke.BUILDIDENTIFIER]}(?:\\.${Ze[Ke.BUILDIDENTIFIER]})*))`);St("FULLPLAIN",`v?${Ze[Ke.MAINVERSION]}${Ze[Ke.PRERELEASE]}?${Ze[Ke.BUILD]}?`);St("FULL",`^${Ze[Ke.FULLPLAIN]}$`);St("LOOSEPLAIN",`[v=\\s]*${Ze[Ke.MAINVERSIONLOOSE]}${Ze[Ke.PRERELEASELOOSE]}?${Ze[Ke.BUILD]}?`);St("LOOSE",`^${Ze[Ke.LOOSEPLAIN]}$`);St("GTLT","((?:<|>)?=?)");St("XRANGEIDENTIFIERLOOSE",`${Ze[Ke.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);St("XRANGEIDENTIFIER",`${Ze[Ke.NUMERICIDENTIFIER]}|x|X|\\*`);St("XRANGEPLAIN",`[v=\\s]*(${Ze[Ke.XRANGEIDENTIFIER]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIER]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIER]})(?:${Ze[Ke.PRERELEASE]})?${Ze[Ke.BUILD]}?)?)?`);St("XRANGEPLAINLOOSE",`[v=\\s]*(${Ze[Ke.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIERLOOSE]})(?:${Ze[Ke.PRERELEASELOOSE]})?${Ze[Ke.BUILD]}?)?)?`);St("XRANGE",`^${Ze[Ke.GTLT]}\\s*${Ze[Ke.XRANGEPLAIN]}$`);St("XRANGELOOSE",`^${Ze[Ke.GTLT]}\\s*${Ze[Ke.XRANGEPLAINLOOSE]}$`);St("COERCEPLAIN",`(^|[^\\d])(\\d{1,${l_}})(?:\\.(\\d{1,${l_}}))?(?:\\.(\\d{1,${l_}}))?`);St("COERCE",`${Ze[Ke.COERCEPLAIN]}(?:$|[^\\d])`);St("COERCEFULL",Ze[Ke.COERCEPLAIN]+`(?:${Ze[Ke.PRERELEASE]})?(?:${Ze[Ke.BUILD]})?(?:$|[^\\d])`);St("COERCERTL",Ze[Ke.COERCE],!0);St("COERCERTLFULL",Ze[Ke.COERCEFULL],!0);St("LONETILDE","(?:~>?)");St("TILDETRIM",`(\\s*)${Ze[Ke.LONETILDE]}\\s+`,!0);Bo.tildeTrimReplace="$1~";St("TILDE",`^${Ze[Ke.LONETILDE]}${Ze[Ke.XRANGEPLAIN]}$`);St("TILDELOOSE",`^${Ze[Ke.LONETILDE]}${Ze[Ke.XRANGEPLAINLOOSE]}$`);St("LONECARET","(?:\\^)");St("CARETTRIM",`(\\s*)${Ze[Ke.LONECARET]}\\s+`,!0);Bo.caretTrimReplace="$1^";St("CARET",`^${Ze[Ke.LONECARET]}${Ze[Ke.XRANGEPLAIN]}$`);St("CARETLOOSE",`^${Ze[Ke.LONECARET]}${Ze[Ke.XRANGEPLAINLOOSE]}$`);St("COMPARATORLOOSE",`^${Ze[Ke.GTLT]}\\s*(${Ze[Ke.LOOSEPLAIN]})$|^$`);St("COMPARATOR",`^${Ze[Ke.GTLT]}\\s*(${Ze[Ke.FULLPLAIN]})$|^$`);St("COMPARATORTRIM",`(\\s*)${Ze[Ke.GTLT]}\\s*(${Ze[Ke.LOOSEPLAIN]}|${Ze[Ke.XRANGEPLAIN]})`,!0);Bo.comparatorTrimReplace="$1$2$3";St("HYPHENRANGE",`^\\s*(${Ze[Ke.XRANGEPLAIN]})\\s+-\\s+(${Ze[Ke.XRANGEPLAIN]})\\s*$`);St("HYPHENRANGELOOSE",`^\\s*(${Ze[Ke.XRANGEPLAINLOOSE]})\\s+-\\s+(${Ze[Ke.XRANGEPLAINLOOSE]})\\s*$`);St("STAR","(<|>)?=?\\s*\\*");St("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");St("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var fp=B((cCe,MP)=>{"use strict";var mB=Object.freeze({loose:!0}),gB=Object.freeze({}),yB=e=>e?typeof e!="object"?mB:e:gB;MP.exports=yB});var d_=B((lCe,DP)=>{"use strict";var qP=/^[0-9]+$/,LP=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=qP.test(e),i=qP.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},vB=(e,t)=>LP(t,e);DP.exports={compareIdentifiers:LP,rcompareIdentifiers:vB}});var Sn=B((uCe,zP)=>{"use strict";var pp=Fu(),{MAX_LENGTH:UP,MAX_SAFE_INTEGER:hp}=cl(),{safeRe:mp,t:gp}=ll(),_B=fp(),{compareIdentifiers:f_}=d_(),bB=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let i=0;i<r.length;i++)if(f_(e[i],r[i])!==0)return!1;return!0},p_=class e{constructor(t,r){if(r=_B(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>UP)throw new TypeError(`version is longer than ${UP} characters`);pp("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=t.trim().match(r.loose?mp[gp.LOOSE]:mp[gp.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>hp||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hp||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hp||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let o=+n;if(o>=0&&o<hp)return o}return n}):this.prerelease=[],this.build=i[5]?i[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(t){if(pp("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let i=this.prerelease[r],n=t.prerelease[r];if(pp("prerelease compare",r,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return f_(i,n)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let i=this.build[r],n=t.build[r];if(pp("build compare",r,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return f_(i,n)}while(++r)}inc(t,r,i){if(t.startsWith("pre")){if(!r&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let n=`-${r}`.match(this.options.loose?mp[gp.PRERELEASELOOSE]:mp[gp.PRERELEASE]);if(!n||n[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,i),this.inc("pre",r,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,i),this.inc("pre",r,i);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 n=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let o=[r,n];if(i===!1&&(o=[r]),bB(this.prerelease,r)){let s=this.prerelease[r.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};zP.exports=p_});var Ma=B((dCe,VP)=>{"use strict";var FP=Sn(),SB=(e,t,r=!1)=>{if(e instanceof FP)return e;try{return new FP(e,t)}catch(i){if(!r)return null;throw i}};VP.exports=SB});var BP=B((fCe,JP)=>{"use strict";var wB=Ma(),$B=(e,t)=>{let r=wB(e,t);return r?r.version:null};JP.exports=$B});var ZP=B((pCe,HP)=>{"use strict";var RB=Ma(),EB=(e,t)=>{let r=RB(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};HP.exports=EB});var WP=B((hCe,GP)=>{"use strict";var KP=Sn(),PB=(e,t,r,i,n)=>{typeof r=="string"&&(n=i,i=r,r=void 0);try{return new KP(e instanceof KP?e.version:e,r).inc(t,i,n).version}catch{return null}};GP.exports=PB});var QP=B((mCe,XP)=>{"use strict";var YP=Ma(),OB=(e,t)=>{let r=YP(e,null,!0),i=YP(t,null,!0),n=r.compare(i);if(n===0)return null;let o=n>0,s=o?r:i,a=o?i:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"};XP.exports=OB});var tO=B((gCe,eO)=>{"use strict";var IB=Sn(),CB=(e,t)=>new IB(e,t).major;eO.exports=CB});var nO=B((yCe,rO)=>{"use strict";var kB=Sn(),TB=(e,t)=>new kB(e,t).minor;rO.exports=TB});var oO=B((vCe,iO)=>{"use strict";var jB=Sn(),AB=(e,t)=>new jB(e,t).patch;iO.exports=AB});var aO=B((_Ce,sO)=>{"use strict";var NB=Ma(),xB=(e,t)=>{let r=NB(e,t);return r&&r.prerelease.length?r.prerelease:null};sO.exports=xB});var Hi=B((bCe,lO)=>{"use strict";var cO=Sn(),MB=(e,t,r)=>new cO(e,r).compare(new cO(t,r));lO.exports=MB});var dO=B((SCe,uO)=>{"use strict";var qB=Hi(),LB=(e,t,r)=>qB(t,e,r);uO.exports=LB});var pO=B((wCe,fO)=>{"use strict";var DB=Hi(),UB=(e,t)=>DB(e,t,!0);fO.exports=UB});var yp=B(($Ce,mO)=>{"use strict";var hO=Sn(),zB=(e,t,r)=>{let i=new hO(e,r),n=new hO(t,r);return i.compare(n)||i.compareBuild(n)};mO.exports=zB});var yO=B((RCe,gO)=>{"use strict";var FB=yp(),VB=(e,t)=>e.sort((r,i)=>FB(r,i,t));gO.exports=VB});var _O=B((ECe,vO)=>{"use strict";var JB=yp(),BB=(e,t)=>e.sort((r,i)=>JB(i,r,t));vO.exports=BB});var Vu=B((PCe,bO)=>{"use strict";var HB=Hi(),ZB=(e,t,r)=>HB(e,t,r)>0;bO.exports=ZB});var vp=B((OCe,SO)=>{"use strict";var KB=Hi(),GB=(e,t,r)=>KB(e,t,r)<0;SO.exports=GB});var h_=B((ICe,wO)=>{"use strict";var WB=Hi(),YB=(e,t,r)=>WB(e,t,r)===0;wO.exports=YB});var m_=B((CCe,$O)=>{"use strict";var XB=Hi(),QB=(e,t,r)=>XB(e,t,r)!==0;$O.exports=QB});var _p=B((kCe,RO)=>{"use strict";var eH=Hi(),tH=(e,t,r)=>eH(e,t,r)>=0;RO.exports=tH});var bp=B((TCe,EO)=>{"use strict";var rH=Hi(),nH=(e,t,r)=>rH(e,t,r)<=0;EO.exports=nH});var g_=B((jCe,PO)=>{"use strict";var iH=h_(),oH=m_(),sH=Vu(),aH=_p(),cH=vp(),lH=bp(),uH=(e,t,r,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return iH(e,r,i);case"!=":return oH(e,r,i);case">":return sH(e,r,i);case">=":return aH(e,r,i);case"<":return cH(e,r,i);case"<=":return lH(e,r,i);default:throw new TypeError(`Invalid operator: ${t}`)}};PO.exports=uH});var IO=B((ACe,OO)=>{"use strict";var dH=Sn(),fH=Ma(),{safeRe:Sp,t:wp}=ll(),pH=(e,t)=>{if(e instanceof dH)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Sp[wp.COERCEFULL]:Sp[wp.COERCE]);else{let c=t.includePrerelease?Sp[wp.COERCERTLFULL]:Sp[wp.COERCERTL],l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let i=r[2],n=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return fH(`${i}.${n}.${o}${s}${a}`,t)};OO.exports=pH});var kO=B((NCe,CO)=>{"use strict";var hH=Ma(),mH=cl(),gH=Sn(),yH=(e,t,r)=>{if(!mH.RELEASE_TYPES.includes(t))return null;let i=vH(e,r);return i&&_H(i,t)},vH=(e,t)=>{let r=e instanceof gH?e.version:e;return hH(r,t)},_H=(e,t)=>{if(bH(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},bH=e=>e.startsWith("pre");CO.exports=yH});var jO=B((xCe,TO)=>{"use strict";var y_=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(t,r)}return this}};TO.exports=y_});var Zi=B((MCe,MO)=>{"use strict";var SH=/\s+/g,v_=class e{constructor(t,r){if(r=$H(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof __)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(SH," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!NO(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&jH(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let i=0;i<r.length;i++)i>0&&(this.formatted+=" "),this.formatted+=r[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(TH,"");let i=((this.options.includePrerelease&&CH)|(this.options.loose&&kH))+":"+t,n=AO.get(i);if(n)return n;let o=this.options.loose,s=o?Bn[wn.HYPHENRANGELOOSE]:Bn[wn.HYPHENRANGE];t=t.replace(s,VH(this.options.includePrerelease)),dr("hyphen replace",t),t=t.replace(Bn[wn.COMPARATORTRIM],PH),dr("comparator trim",t),t=t.replace(Bn[wn.TILDETRIM],OH),dr("tilde trim",t),t=t.replace(Bn[wn.CARETTRIM],IH),dr("caret trim",t);let a=t.split(" ").map(f=>AH(f,this.options)).join(" ").split(/\s+/).map(f=>FH(f,this.options));o&&(a=a.filter(f=>(dr("loose invalid filter",f,this.options),!!f.match(Bn[wn.COMPARATORLOOSE])))),dr("range list",a);let c=new Map,l=a.map(f=>new __(f,this.options));for(let f of l){if(NO(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return AO.set(i,u),u}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(i=>xO(i,r)&&t.set.some(n=>xO(n,r)&&i.every(o=>n.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new RH(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(JH(this.set[r],t,this.options))return!0;return!1}};MO.exports=v_;var wH=jO(),AO=new wH,$H=fp(),__=Ju(),dr=Fu(),RH=Sn(),{safeRe:Bn,src:EH,t:wn,comparatorTrimReplace:PH,tildeTrimReplace:OH,caretTrimReplace:IH}=ll(),{FLAG_INCLUDE_PRERELEASE:CH,FLAG_LOOSE:kH}=cl(),TH=new RegExp(EH[wn.BUILD],"g"),NO=e=>e.value==="<0.0.0-0",jH=e=>e.value==="",xO=(e,t)=>{let r=!0,i=e.slice(),n=i.pop();for(;r&&i.length;)r=i.every(o=>n.intersects(o,t)),n=i.pop();return r},AH=(e,t)=>(e=e.replace(Bn[wn.BUILD],""),dr("comp",e,t),e=qH(e,t),dr("caret",e),e=xH(e,t),dr("tildes",e),e=DH(e,t),dr("xrange",e),e=zH(e,t),dr("stars",e),e),Wr=e=>!e||e.toLowerCase()==="x"||e==="*",NH=(e,t,r)=>Wr(e)&&!Wr(t)||Wr(t)&&r&&!Wr(r),xH=(e,t)=>e.trim().split(/\s+/).map(r=>MH(r,t)).join(" "),MH=(e,t)=>{let r=t.loose?Bn[wn.TILDELOOSE]:Bn[wn.TILDE],i=t.includePrerelease?"-0":"";return e.replace(r,(n,o,s,a,c)=>{dr("tilde",e,n,o,s,a,c);let l;return Wr(o)?l="":Wr(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Wr(a)?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:c?(dr("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,dr("tilde return",l),l})},qH=(e,t)=>e.trim().split(/\s+/).map(r=>LH(r,t)).join(" "),LH=(e,t)=>{dr("caret",e,t);let r=t.loose?Bn[wn.CARETLOOSE]:Bn[wn.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,(n,o,s,a,c)=>{dr("caret",e,n,o,s,a,c);let l;return Wr(o)?l="":Wr(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Wr(a)?o==="0"?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:c?(dr("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(dr("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),dr("caret return",l),l})},DH=(e,t)=>(dr("replaceXRanges",e,t),e.split(/\s+/).map(r=>UH(r,t)).join(" ")),UH=(e,t)=>{e=e.trim();let r=t.loose?Bn[wn.XRANGELOOSE]:Bn[wn.XRANGE];return e.replace(r,(i,n,o,s,a,c)=>{if(dr("xRange",e,i,n,o,s,a,c),NH(o,s,a))return e;let l=Wr(o),u=l||Wr(s),f=u||Wr(a),p=f;return n==="="&&p&&(n=""),c=t.includePrerelease?"-0":"",l?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&p?(u&&(s=0),a=0,n===">"?(n=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):n==="<="&&(n="<",u?o=+o+1:s=+s+1),n==="<"&&(c="-0"),i=`${n+o}.${s}.${a}${c}`):u?i=`>=${o}.0.0${c} <${+o+1}.0.0-0`:f&&(i=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),dr("xRange return",i),i})},zH=(e,t)=>(dr("replaceStars",e,t),e.trim().replace(Bn[wn.STAR],"")),FH=(e,t)=>(dr("replaceGTE0",e,t),e.trim().replace(Bn[t.includePrerelease?wn.GTE0PRE:wn.GTE0],"")),VH=e=>(t,r,i,n,o,s,a,c,l,u,f,p)=>(Wr(i)?r="":Wr(n)?r=`>=${i}.0.0${e?"-0":""}`:Wr(o)?r=`>=${i}.${n}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,Wr(l)?c="":Wr(u)?c=`<${+l+1}.0.0-0`:Wr(f)?c=`<${l}.${+u+1}.0-0`:p?c=`<=${l}.${u}.${f}-${p}`:e?c=`<${l}.${u}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),JH=(e,t,r)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let i=0;i<e.length;i++)if(dr(e[i].semver),e[i].semver!==__.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}});var Ju=B((qCe,FO)=>{"use strict";var Bu=Symbol("SemVer ANY"),w_=class e{static get ANY(){return Bu}constructor(t,r){if(r=qO(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),S_("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Bu?this.value="":this.value=this.operator+this.semver.version,S_("comp",this)}parse(t){let r=this.options.loose?LO[DO.COMPARATORLOOSE]:LO[DO.COMPARATOR],i=t.match(r);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new UO(i[2],this.options.loose):this.semver=Bu}toString(){return this.value}test(t){if(S_("Comparator.test",t,this.options.loose),this.semver===Bu||t===Bu)return!0;if(typeof t=="string")try{t=new UO(t,this.options)}catch{return!1}return b_(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new zO(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new zO(this.value,r).test(t.semver):(r=qO(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||b_(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||b_(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};FO.exports=w_;var qO=fp(),{safeRe:LO,t:DO}=ll(),b_=g_(),S_=Fu(),UO=Sn(),zO=Zi()});var Hu=B((LCe,VO)=>{"use strict";var BH=Zi(),HH=(e,t,r)=>{try{t=new BH(t,r)}catch{return!1}return t.test(e)};VO.exports=HH});var BO=B((DCe,JO)=>{"use strict";var ZH=Zi(),KH=(e,t)=>new ZH(e,t).set.map(r=>r.map(i=>i.value).join(" ").trim().split(" "));JO.exports=KH});var ZO=B((UCe,HO)=>{"use strict";var GH=Sn(),WH=Zi(),YH=(e,t,r)=>{let i=null,n=null,o=null;try{o=new WH(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||n.compare(s)===-1)&&(i=s,n=new GH(i,r))}),i};HO.exports=YH});var GO=B((zCe,KO)=>{"use strict";var XH=Sn(),QH=Zi(),eZ=(e,t,r)=>{let i=null,n=null,o=null;try{o=new QH(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||n.compare(s)===1)&&(i=s,n=new XH(i,r))}),i};KO.exports=eZ});var XO=B((FCe,YO)=>{"use strict";var $_=Sn(),tZ=Zi(),WO=Vu(),rZ=(e,t)=>{e=new tZ(e,t);let r=new $_("0.0.0");if(e.test(r)||(r=new $_("0.0.0-0"),e.test(r)))return r;r=null;for(let i=0;i<e.set.length;++i){let n=e.set[i],o=null;n.forEach(s=>{let a=new $_(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||WO(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||WO(r,o))&&(r=o)}return r&&e.test(r)?r:null};YO.exports=rZ});var eI=B((VCe,QO)=>{"use strict";var nZ=Zi(),iZ=(e,t)=>{try{return new nZ(e,t).range||"*"}catch{return null}};QO.exports=iZ});var $p=B((JCe,iI)=>{"use strict";var oZ=Sn(),nI=Ju(),{ANY:sZ}=nI,aZ=Zi(),cZ=Hu(),tI=Vu(),rI=vp(),lZ=bp(),uZ=_p(),dZ=(e,t,r,i)=>{e=new oZ(e,i),t=new aZ(t,i);let n,o,s,a,c;switch(r){case">":n=tI,o=lZ,s=rI,a=">",c=">=";break;case"<":n=rI,o=uZ,s=tI,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(cZ(e,t,i))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],f=null,p=null;if(u.forEach(g=>{g.semver===sZ&&(g=new nI(">=0.0.0")),f=f||g,p=p||g,n(g.semver,f.semver,i)?f=g:s(g.semver,p.semver,i)&&(p=g)}),f.operator===a||f.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0};iI.exports=dZ});var sI=B((BCe,oI)=>{"use strict";var fZ=$p(),pZ=(e,t,r)=>fZ(e,t,">",r);oI.exports=pZ});var cI=B((HCe,aI)=>{"use strict";var hZ=$p(),mZ=(e,t,r)=>hZ(e,t,"<",r);aI.exports=mZ});var dI=B((ZCe,uI)=>{"use strict";var lI=Zi(),gZ=(e,t,r)=>(e=new lI(e,r),t=new lI(t,r),e.intersects(t,r));uI.exports=gZ});var pI=B((KCe,fI)=>{"use strict";var yZ=Hu(),vZ=Hi();fI.exports=(e,t,r)=>{let i=[],n=null,o=null,s=e.sort((u,f)=>vZ(u,f,r));for(let u of s)yZ(u,t,r)?(o=u,n||(n=u)):(o&&i.push([n,o]),o=null,n=null);n&&i.push([n,null]);let a=[];for(let[u,f]of i)u===f?a.push(u):!f&&u===s[0]?a.push("*"):f?u===s[0]?a.push(`<=${f}`):a.push(`${u} - ${f}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t}});var _I=B((GCe,vI)=>{"use strict";var hI=Zi(),P_=Ju(),{ANY:R_}=P_,E_=Hu(),O_=Hi(),_Z=(e,t,r={})=>{if(e===t)return!0;e=new hI(e,r),t=new hI(t,r);let i=!1;e:for(let n of e.set){for(let o of t.set){let s=SZ(n,o,r);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},bZ=[new P_(">=0.0.0-0")],mI=[new P_(">=0.0.0")],SZ=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===R_){if(t.length===1&&t[0].semver===R_)return!0;r.includePrerelease?e=bZ:e=mI}if(t.length===1&&t[0].semver===R_){if(r.includePrerelease)return!0;t=mI}let i=new Set,n,o;for(let g of e)g.operator===">"||g.operator===">="?n=gI(n,g,r):g.operator==="<"||g.operator==="<="?o=yI(o,g,r):i.add(g.semver);if(i.size>1)return null;let s;if(n&&o){if(s=O_(n.semver,o.semver,r),s>0)return null;if(s===0&&(n.operator!==">="||o.operator!=="<="))return null}for(let g of i){if(n&&!E_(g,String(n),r)||o&&!E_(g,String(o),r))return null;for(let h of t)if(!E_(g,String(h),r))return!1;return!0}let a,c,l,u,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let g of t){if(u=u||g.operator===">"||g.operator===">=",l=l||g.operator==="<"||g.operator==="<=",n){if(p&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===p.major&&g.semver.minor===p.minor&&g.semver.patch===p.patch&&(p=!1),g.operator===">"||g.operator===">="){if(a=gI(n,g,r),a===g&&a!==n)return!1}else if(n.operator===">="&&!g.test(n.semver))return!1}if(o){if(f&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===f.major&&g.semver.minor===f.minor&&g.semver.patch===f.patch&&(f=!1),g.operator==="<"||g.operator==="<="){if(c=yI(o,g,r),c===g&&c!==o)return!1}else if(o.operator==="<="&&!g.test(o.semver))return!1}if(!g.operator&&(o||n)&&s!==0)return!1}return!(n&&l&&!o&&s!==0||o&&u&&!n&&s!==0||p||f)},gI=(e,t,r)=>{if(!e)return t;let i=O_(e.semver,t.semver,r);return i>0?e:i<0||t.operator===">"&&e.operator===">="?t:e},yI=(e,t,r)=>{if(!e)return t;let i=O_(e.semver,t.semver,r);return i<0?e:i>0||t.operator==="<"&&e.operator==="<="?t:e};vI.exports=_Z});var $I=B((WCe,wI)=>{"use strict";var I_=ll(),bI=cl(),wZ=Sn(),SI=d_(),$Z=Ma(),RZ=BP(),EZ=ZP(),PZ=WP(),OZ=QP(),IZ=tO(),CZ=nO(),kZ=oO(),TZ=aO(),jZ=Hi(),AZ=dO(),NZ=pO(),xZ=yp(),MZ=yO(),qZ=_O(),LZ=Vu(),DZ=vp(),UZ=h_(),zZ=m_(),FZ=_p(),VZ=bp(),JZ=g_(),BZ=IO(),HZ=kO(),ZZ=Ju(),KZ=Zi(),GZ=Hu(),WZ=BO(),YZ=ZO(),XZ=GO(),QZ=XO(),e3=eI(),t3=$p(),r3=sI(),n3=cI(),i3=dI(),o3=pI(),s3=_I();wI.exports={parse:$Z,valid:RZ,clean:EZ,inc:PZ,diff:OZ,major:IZ,minor:CZ,patch:kZ,prerelease:TZ,compare:jZ,rcompare:AZ,compareLoose:NZ,compareBuild:xZ,sort:MZ,rsort:qZ,gt:LZ,lt:DZ,eq:UZ,neq:zZ,gte:FZ,lte:VZ,cmp:JZ,coerce:BZ,truncate:HZ,Comparator:ZZ,Range:KZ,satisfies:GZ,toComparators:WZ,maxSatisfying:YZ,minSatisfying:XZ,minVersion:QZ,validRange:e3,outside:t3,gtr:r3,ltr:n3,intersects:i3,simplifyRange:o3,subset:s3,SemVer:wZ,re:I_.re,src:I_.src,tokens:I_.t,SEMVER_SPEC_VERSION:bI.SEMVER_SPEC_VERSION,RELEASE_TYPES:bI.RELEASE_TYPES,compareIdentifiers:SI.compareIdentifiers,rcompareIdentifiers:SI.rcompareIdentifiers}});var pa=B((YCe,NI)=>{var qa=require("fs"),Ki=require("path"),EI=c_(),Gi=$I(),{DEFAULT_API_URL:a3}=fa(),PI=["dependencies","devDependencies","optionalDependencies","peerDependencies"];function C_(e){let t=typeof e=="string"&&e.match(/^((?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*)(?:@([^\r\n]+))?$/);if(!t)throw new Error(`Invalid npm dependency: ${String(e)}`);return{name:t[1],version:t[2]}}function k_(e){let t=new Map;for(let r of e){let{name:i,version:n}=C_(r),o=t.get(i);t.set(i,o&&n?OI(i,o,n):n||o)}return t}function OI(e,t,r){if(t===r)return t;let i=Gi.validRange(t),n=Gi.validRange(r);if(i&&n)try{if(Gi.subset(n,i))return r;if(Gi.subset(i,n))return t}catch{}throw new Error(`Conflicting registry versions for ${e}: ${t} and ${r}`)}function c3(e,t){let r=typeof e=="string"&&Gi.validRange(e),i=Gi.validRange(t);if(!r||!i)return!1;try{return Gi.subset(r,i)}catch{return!1}}function Ep(e,t){if(c3(e,t))return"satisfied";let r=typeof e=="string"&&Gi.validRange(e),i=Gi.validRange(t);if(!r||!i)return"incomparable";try{let n=Gi.minVersion(r),o=Gi.minVersion(i);return!n||!o?"incomparable":Gi.lt(n,o)?"lower":"newer"}catch{return"incomparable"}}function Rp(e,t){let r=PI.find(i=>Object.hasOwn(e[i]||{},t));return r?{section:r,existing:e[r][t]}:null}function II(e,t){let r=k_(t);if(r.size===0)return;let i=Ki.join(e,"package.json"),n=JSON.parse(qa.readFileSync(i,"utf8"));for(let[o,s]of r){let a=Rp(n,o),c=a?.section||"dependencies";n[c]||={};let l=a?.existing;n[c][o]=l===void 0?s||"latest":s&&Ep(l,s)==="lower"?s:l}qa.writeFileSync(i,`${JSON.stringify(n,null,2)}
|
|
2
|
+
var g9=Object.create;var up=Object.defineProperty;var y9=Object.getOwnPropertyDescriptor;var v9=Object.getOwnPropertyNames;var _9=Object.getPrototypeOf,b9=Object.prototype.hasOwnProperty;var Ve=(e,t)=>()=>(e&&(t=e(e=0)),t);var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bo=(e,t)=>{for(var r in t)up(e,r,{get:t[r],enumerable:!0})},VE=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of v9(t))!b9.call(e,n)&&n!==r&&up(e,n,{get:()=>t[n],enumerable:!(i=y9(t,n))||i.enumerable});return e};var Bi=(e,t,r)=>(r=e!=null?g9(_9(e)):{},VE(t||!e||!e.__esModule?up(r,"default",{value:e,enumerable:!0}):r,e)),Mr=e=>VE(up({},"__esModule",{value:!0}),e);var xa=B((VIe,S9)=>{S9.exports={name:"@frontfriend/sdk",version:"1.2.8"}});var So=B((JIe,JE)=>{var{name:w9}=xa();JE.exports={PACKAGE_NAME:w9}});var fa=B((BIe,BE)=>{var $9="https://app.frontfriend.dev",R9=".cache/frontfriend",E9={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"]},P9={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function O9(e){if(!e)return null;try{let t=new URL(e);return t.hostname.startsWith("app.")?`${t.protocol}//${t.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}BE.exports={DEFAULT_API_URL:$9,CACHE_DIR_NAME:R9,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:E9,ENV_VARS:P9,deriveRegistryFromApiUrl:O9}});var WE=B((HIe,GE)=>{GE.exports=KE;KE.sync=C9;var HE=require("fs");function I9(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function ZE(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:I9(t,r)}function KE(e,t,r){HE.stat(e,function(i,n){r(i,i?!1:ZE(n,e,t))})}function C9(e,t){return ZE(HE.statSync(e),e,t)}});var tP=B((ZIe,eP)=>{eP.exports=XE;XE.sync=k9;var YE=require("fs");function XE(e,t,r){YE.stat(e,function(i,n){r(i,i?!1:QE(n,t))})}function k9(e,t){return QE(YE.statSync(e),t)}function QE(e,t){return e.isFile()&&T9(e,t)}function T9(e,t){var r=e.mode,i=e.uid,n=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,f=r&l||r&c&&n===s||r&a&&i===o||r&u&&o===0;return f}});var nP=B((GIe,rP)=>{var KIe=require("fs"),dp;process.platform==="win32"||global.TESTING_WINDOWS?dp=WE():dp=tP();rP.exports=Qv;Qv.sync=j9;function Qv(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){Qv(e,t||{},function(o,s){o?n(o):i(s)})})}dp(e,t||{},function(i,n){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,n=!1),r(i,n)})}function j9(e,t){try{return dp.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var uP=B((WIe,lP)=>{var sl=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",iP=require("path"),A9=sl?";":":",oP=nP(),sP=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),aP=(e,t)=>{let r=t.colon||A9,i=e.match(/\//)||sl&&e.match(/\\/)?[""]:[...sl?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=sl?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=sl?n.split(r):[""];return sl&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:n}},cP=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:i,pathExt:n,pathExtExe:o}=aP(e,t),s=[],a=l=>new Promise((u,f)=>{if(l===i.length)return t.all&&s.length?u(s):f(sP(e));let p=i[l],g=/^".*"$/.test(p)?p.slice(1,-1):p,h=iP.join(g,e),v=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;u(c(v,l,0))}),c=(l,u,f)=>new Promise((p,g)=>{if(f===n.length)return p(a(u+1));let h=n[f];oP(l+h,{pathExt:o},(v,y)=>{if(!v&&y)if(t.all)s.push(l+h);else return p(l+h);return p(c(l,u,f+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},N9=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=aP(e,t),o=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,l=iP.join(c,e),u=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let f=0;f<i.length;f++){let p=u+i[f];try{if(oP.sync(p,{pathExt:n}))if(t.all)o.push(p);else return p}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw sP(e)};lP.exports=cP;cP.sync=N9});var fP=B((YIe,e_)=>{"use strict";var dP=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};e_.exports=dP;e_.exports.default=dP});var gP=B((XIe,mP)=>{"use strict";var pP=require("path"),x9=uP(),M9=fP();function hP(e,t){let r=e.options.env||process.env,i=process.cwd(),n=e.options.cwd!=null,o=n&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let s;try{s=x9.sync(e.command,{path:r[M9({env:r})],pathExt:t?pP.delimiter:void 0})}catch{}finally{o&&process.chdir(i)}return s&&(s=pP.resolve(n?e.options.cwd:"",s)),s}function q9(e){return hP(e)||hP(e,!0)}mP.exports=q9});var yP=B((QIe,r_)=>{"use strict";var t_=/([()\][%!^"`<>&|;, *?])/g;function L9(e){return e=e.replace(t_,"^$1"),e}function D9(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(t_,"^$1"),t&&(e=e.replace(t_,"^$1")),e}r_.exports.command=L9;r_.exports.argument=D9});var _P=B((eCe,vP)=>{"use strict";vP.exports=/^#!(.*)/});var SP=B((tCe,bP)=>{"use strict";var U9=_P();bP.exports=(e="")=>{let t=e.match(U9);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var $P=B((rCe,wP)=>{"use strict";var n_=require("fs"),z9=SP();function F9(e){let r=Buffer.alloc(150),i;try{i=n_.openSync(e,"r"),n_.readSync(i,r,0,150,0),n_.closeSync(i)}catch{}return z9(r.toString())}wP.exports=F9});var OP=B((nCe,PP)=>{"use strict";var V9=require("path"),RP=gP(),EP=yP(),J9=$P(),B9=process.platform==="win32",H9=/\.(?:com|exe)$/i,Z9=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function K9(e){e.file=RP(e);let t=e.file&&J9(e.file);return t?(e.args.unshift(e.file),e.command=t,RP(e)):e.file}function G9(e){if(!B9)return e;let t=K9(e),r=!H9.test(t);if(e.options.forceShell||r){let i=Z9.test(t);e.command=V9.normalize(e.command),e.command=EP.command(e.command),e.args=e.args.map(o=>EP.argument(o,i));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function W9(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let i={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?i:G9(i)}PP.exports=W9});var kP=B((iCe,CP)=>{"use strict";var i_=process.platform==="win32";function o_(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Y9(e,t){if(!i_)return;let r=e.emit;e.emit=function(i,n){if(i==="exit"){let o=IP(n,t);if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}function IP(e,t){return i_&&e===1&&!t.file?o_(t.original,"spawn"):null}function X9(e,t){return i_&&e===1&&!t.file?o_(t.original,"spawnSync"):null}CP.exports={hookChildProcess:Y9,verifyENOENT:IP,verifyENOENTSync:X9,notFoundError:o_}});var c_=B((oCe,al)=>{"use strict";var TP=require("child_process"),s_=OP(),a_=kP();function jP(e,t,r){let i=s_(e,t,r),n=TP.spawn(i.command,i.args,i.options);return a_.hookChildProcess(n,i),n}function Q9(e,t,r){let i=s_(e,t,r),n=TP.spawnSync(i.command,i.args,i.options);return n.error=n.error||a_.verifyENOENTSync(n.status,i),n}al.exports=jP;al.exports.spawn=jP;al.exports.sync=Q9;al.exports._parse=s_;al.exports._enoent=a_});var cl=B((sCe,AP)=>{"use strict";var eB="2.0.0",tB=Number.MAX_SAFE_INTEGER||9007199254740991,rB=16,nB=250,iB=["major","premajor","minor","preminor","patch","prepatch","prerelease"];AP.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:rB,MAX_SAFE_BUILD_LENGTH:nB,MAX_SAFE_INTEGER:tB,RELEASE_TYPES:iB,SEMVER_SPEC_VERSION:eB,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Fu=B((aCe,NP)=>{"use strict";var oB=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};NP.exports=oB});var ll=B((Bo,xP)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:l_,MAX_SAFE_BUILD_LENGTH:sB,MAX_LENGTH:aB}=cl(),cB=Fu();Bo=xP.exports={};var lB=Bo.re=[],uB=Bo.safeRe=[],Ze=Bo.src=[],dB=Bo.safeSrc=[],Ke=Bo.t={},fB=0,u_="[a-zA-Z0-9-]",pB=[["\\s",1],["\\d",aB],[u_,sB]],hB=e=>{for(let[t,r]of pB)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},St=(e,t,r)=>{let i=hB(t),n=fB++;cB(e,n,t),Ke[e]=n,Ze[n]=t,dB[n]=i,lB[n]=new RegExp(t,r?"g":void 0),uB[n]=new RegExp(i,r?"g":void 0)};St("NUMERICIDENTIFIER","0|[1-9]\\d*");St("NUMERICIDENTIFIERLOOSE","\\d+");St("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u_}*`);St("MAINVERSION",`(${Ze[Ke.NUMERICIDENTIFIER]})\\.(${Ze[Ke.NUMERICIDENTIFIER]})\\.(${Ze[Ke.NUMERICIDENTIFIER]})`);St("MAINVERSIONLOOSE",`(${Ze[Ke.NUMERICIDENTIFIERLOOSE]})\\.(${Ze[Ke.NUMERICIDENTIFIERLOOSE]})\\.(${Ze[Ke.NUMERICIDENTIFIERLOOSE]})`);St("PRERELEASEIDENTIFIER",`(?:${Ze[Ke.NONNUMERICIDENTIFIER]}|${Ze[Ke.NUMERICIDENTIFIER]})`);St("PRERELEASEIDENTIFIERLOOSE",`(?:${Ze[Ke.NONNUMERICIDENTIFIER]}|${Ze[Ke.NUMERICIDENTIFIERLOOSE]})`);St("PRERELEASE",`(?:-(${Ze[Ke.PRERELEASEIDENTIFIER]}(?:\\.${Ze[Ke.PRERELEASEIDENTIFIER]})*))`);St("PRERELEASELOOSE",`(?:-?(${Ze[Ke.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Ze[Ke.PRERELEASEIDENTIFIERLOOSE]})*))`);St("BUILDIDENTIFIER",`${u_}+`);St("BUILD",`(?:\\+(${Ze[Ke.BUILDIDENTIFIER]}(?:\\.${Ze[Ke.BUILDIDENTIFIER]})*))`);St("FULLPLAIN",`v?${Ze[Ke.MAINVERSION]}${Ze[Ke.PRERELEASE]}?${Ze[Ke.BUILD]}?`);St("FULL",`^${Ze[Ke.FULLPLAIN]}$`);St("LOOSEPLAIN",`[v=\\s]*${Ze[Ke.MAINVERSIONLOOSE]}${Ze[Ke.PRERELEASELOOSE]}?${Ze[Ke.BUILD]}?`);St("LOOSE",`^${Ze[Ke.LOOSEPLAIN]}$`);St("GTLT","((?:<|>)?=?)");St("XRANGEIDENTIFIERLOOSE",`${Ze[Ke.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);St("XRANGEIDENTIFIER",`${Ze[Ke.NUMERICIDENTIFIER]}|x|X|\\*`);St("XRANGEPLAIN",`[v=\\s]*(${Ze[Ke.XRANGEIDENTIFIER]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIER]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIER]})(?:${Ze[Ke.PRERELEASE]})?${Ze[Ke.BUILD]}?)?)?`);St("XRANGEPLAINLOOSE",`[v=\\s]*(${Ze[Ke.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Ze[Ke.XRANGEIDENTIFIERLOOSE]})(?:${Ze[Ke.PRERELEASELOOSE]})?${Ze[Ke.BUILD]}?)?)?`);St("XRANGE",`^${Ze[Ke.GTLT]}\\s*${Ze[Ke.XRANGEPLAIN]}$`);St("XRANGELOOSE",`^${Ze[Ke.GTLT]}\\s*${Ze[Ke.XRANGEPLAINLOOSE]}$`);St("COERCEPLAIN",`(^|[^\\d])(\\d{1,${l_}})(?:\\.(\\d{1,${l_}}))?(?:\\.(\\d{1,${l_}}))?`);St("COERCE",`${Ze[Ke.COERCEPLAIN]}(?:$|[^\\d])`);St("COERCEFULL",Ze[Ke.COERCEPLAIN]+`(?:${Ze[Ke.PRERELEASE]})?(?:${Ze[Ke.BUILD]})?(?:$|[^\\d])`);St("COERCERTL",Ze[Ke.COERCE],!0);St("COERCERTLFULL",Ze[Ke.COERCEFULL],!0);St("LONETILDE","(?:~>?)");St("TILDETRIM",`(\\s*)${Ze[Ke.LONETILDE]}\\s+`,!0);Bo.tildeTrimReplace="$1~";St("TILDE",`^${Ze[Ke.LONETILDE]}${Ze[Ke.XRANGEPLAIN]}$`);St("TILDELOOSE",`^${Ze[Ke.LONETILDE]}${Ze[Ke.XRANGEPLAINLOOSE]}$`);St("LONECARET","(?:\\^)");St("CARETTRIM",`(\\s*)${Ze[Ke.LONECARET]}\\s+`,!0);Bo.caretTrimReplace="$1^";St("CARET",`^${Ze[Ke.LONECARET]}${Ze[Ke.XRANGEPLAIN]}$`);St("CARETLOOSE",`^${Ze[Ke.LONECARET]}${Ze[Ke.XRANGEPLAINLOOSE]}$`);St("COMPARATORLOOSE",`^${Ze[Ke.GTLT]}\\s*(${Ze[Ke.LOOSEPLAIN]})$|^$`);St("COMPARATOR",`^${Ze[Ke.GTLT]}\\s*(${Ze[Ke.FULLPLAIN]})$|^$`);St("COMPARATORTRIM",`(\\s*)${Ze[Ke.GTLT]}\\s*(${Ze[Ke.LOOSEPLAIN]}|${Ze[Ke.XRANGEPLAIN]})`,!0);Bo.comparatorTrimReplace="$1$2$3";St("HYPHENRANGE",`^\\s*(${Ze[Ke.XRANGEPLAIN]})\\s+-\\s+(${Ze[Ke.XRANGEPLAIN]})\\s*$`);St("HYPHENRANGELOOSE",`^\\s*(${Ze[Ke.XRANGEPLAINLOOSE]})\\s+-\\s+(${Ze[Ke.XRANGEPLAINLOOSE]})\\s*$`);St("STAR","(<|>)?=?\\s*\\*");St("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");St("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var fp=B((cCe,MP)=>{"use strict";var mB=Object.freeze({loose:!0}),gB=Object.freeze({}),yB=e=>e?typeof e!="object"?mB:e:gB;MP.exports=yB});var d_=B((lCe,DP)=>{"use strict";var qP=/^[0-9]+$/,LP=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=qP.test(e),i=qP.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},vB=(e,t)=>LP(t,e);DP.exports={compareIdentifiers:LP,rcompareIdentifiers:vB}});var Sn=B((uCe,zP)=>{"use strict";var pp=Fu(),{MAX_LENGTH:UP,MAX_SAFE_INTEGER:hp}=cl(),{safeRe:mp,t:gp}=ll(),_B=fp(),{compareIdentifiers:f_}=d_(),bB=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let i=0;i<r.length;i++)if(f_(e[i],r[i])!==0)return!1;return!0},p_=class e{constructor(t,r){if(r=_B(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>UP)throw new TypeError(`version is longer than ${UP} characters`);pp("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=t.trim().match(r.loose?mp[gp.LOOSE]:mp[gp.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>hp||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hp||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hp||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let o=+n;if(o>=0&&o<hp)return o}return n}):this.prerelease=[],this.build=i[5]?i[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(t){if(pp("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let i=this.prerelease[r],n=t.prerelease[r];if(pp("prerelease compare",r,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return f_(i,n)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let i=this.build[r],n=t.build[r];if(pp("build compare",r,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return f_(i,n)}while(++r)}inc(t,r,i){if(t.startsWith("pre")){if(!r&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let n=`-${r}`.match(this.options.loose?mp[gp.PRERELEASELOOSE]:mp[gp.PRERELEASE]);if(!n||n[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,i),this.inc("pre",r,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,i),this.inc("pre",r,i);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 n=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let o=[r,n];if(i===!1&&(o=[r]),bB(this.prerelease,r)){let s=this.prerelease[r.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};zP.exports=p_});var Ma=B((dCe,VP)=>{"use strict";var FP=Sn(),SB=(e,t,r=!1)=>{if(e instanceof FP)return e;try{return new FP(e,t)}catch(i){if(!r)return null;throw i}};VP.exports=SB});var BP=B((fCe,JP)=>{"use strict";var wB=Ma(),$B=(e,t)=>{let r=wB(e,t);return r?r.version:null};JP.exports=$B});var ZP=B((pCe,HP)=>{"use strict";var RB=Ma(),EB=(e,t)=>{let r=RB(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};HP.exports=EB});var WP=B((hCe,GP)=>{"use strict";var KP=Sn(),PB=(e,t,r,i,n)=>{typeof r=="string"&&(n=i,i=r,r=void 0);try{return new KP(e instanceof KP?e.version:e,r).inc(t,i,n).version}catch{return null}};GP.exports=PB});var QP=B((mCe,XP)=>{"use strict";var YP=Ma(),OB=(e,t)=>{let r=YP(e,null,!0),i=YP(t,null,!0),n=r.compare(i);if(n===0)return null;let o=n>0,s=o?r:i,a=o?i:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"};XP.exports=OB});var tO=B((gCe,eO)=>{"use strict";var IB=Sn(),CB=(e,t)=>new IB(e,t).major;eO.exports=CB});var nO=B((yCe,rO)=>{"use strict";var kB=Sn(),TB=(e,t)=>new kB(e,t).minor;rO.exports=TB});var oO=B((vCe,iO)=>{"use strict";var jB=Sn(),AB=(e,t)=>new jB(e,t).patch;iO.exports=AB});var aO=B((_Ce,sO)=>{"use strict";var NB=Ma(),xB=(e,t)=>{let r=NB(e,t);return r&&r.prerelease.length?r.prerelease:null};sO.exports=xB});var Hi=B((bCe,lO)=>{"use strict";var cO=Sn(),MB=(e,t,r)=>new cO(e,r).compare(new cO(t,r));lO.exports=MB});var dO=B((SCe,uO)=>{"use strict";var qB=Hi(),LB=(e,t,r)=>qB(t,e,r);uO.exports=LB});var pO=B((wCe,fO)=>{"use strict";var DB=Hi(),UB=(e,t)=>DB(e,t,!0);fO.exports=UB});var yp=B(($Ce,mO)=>{"use strict";var hO=Sn(),zB=(e,t,r)=>{let i=new hO(e,r),n=new hO(t,r);return i.compare(n)||i.compareBuild(n)};mO.exports=zB});var yO=B((RCe,gO)=>{"use strict";var FB=yp(),VB=(e,t)=>e.sort((r,i)=>FB(r,i,t));gO.exports=VB});var _O=B((ECe,vO)=>{"use strict";var JB=yp(),BB=(e,t)=>e.sort((r,i)=>JB(i,r,t));vO.exports=BB});var Vu=B((PCe,bO)=>{"use strict";var HB=Hi(),ZB=(e,t,r)=>HB(e,t,r)>0;bO.exports=ZB});var vp=B((OCe,SO)=>{"use strict";var KB=Hi(),GB=(e,t,r)=>KB(e,t,r)<0;SO.exports=GB});var h_=B((ICe,wO)=>{"use strict";var WB=Hi(),YB=(e,t,r)=>WB(e,t,r)===0;wO.exports=YB});var m_=B((CCe,$O)=>{"use strict";var XB=Hi(),QB=(e,t,r)=>XB(e,t,r)!==0;$O.exports=QB});var _p=B((kCe,RO)=>{"use strict";var eH=Hi(),tH=(e,t,r)=>eH(e,t,r)>=0;RO.exports=tH});var bp=B((TCe,EO)=>{"use strict";var rH=Hi(),nH=(e,t,r)=>rH(e,t,r)<=0;EO.exports=nH});var g_=B((jCe,PO)=>{"use strict";var iH=h_(),oH=m_(),sH=Vu(),aH=_p(),cH=vp(),lH=bp(),uH=(e,t,r,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return iH(e,r,i);case"!=":return oH(e,r,i);case">":return sH(e,r,i);case">=":return aH(e,r,i);case"<":return cH(e,r,i);case"<=":return lH(e,r,i);default:throw new TypeError(`Invalid operator: ${t}`)}};PO.exports=uH});var IO=B((ACe,OO)=>{"use strict";var dH=Sn(),fH=Ma(),{safeRe:Sp,t:wp}=ll(),pH=(e,t)=>{if(e instanceof dH)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Sp[wp.COERCEFULL]:Sp[wp.COERCE]);else{let c=t.includePrerelease?Sp[wp.COERCERTLFULL]:Sp[wp.COERCERTL],l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let i=r[2],n=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return fH(`${i}.${n}.${o}${s}${a}`,t)};OO.exports=pH});var kO=B((NCe,CO)=>{"use strict";var hH=Ma(),mH=cl(),gH=Sn(),yH=(e,t,r)=>{if(!mH.RELEASE_TYPES.includes(t))return null;let i=vH(e,r);return i&&_H(i,t)},vH=(e,t)=>{let r=e instanceof gH?e.version:e;return hH(r,t)},_H=(e,t)=>{if(bH(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},bH=e=>e.startsWith("pre");CO.exports=yH});var jO=B((xCe,TO)=>{"use strict";var y_=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(t,r)}return this}};TO.exports=y_});var Zi=B((MCe,MO)=>{"use strict";var SH=/\s+/g,v_=class e{constructor(t,r){if(r=$H(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof __)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(SH," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!NO(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&jH(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let i=0;i<r.length;i++)i>0&&(this.formatted+=" "),this.formatted+=r[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(TH,"");let i=((this.options.includePrerelease&&CH)|(this.options.loose&&kH))+":"+t,n=AO.get(i);if(n)return n;let o=this.options.loose,s=o?Bn[wn.HYPHENRANGELOOSE]:Bn[wn.HYPHENRANGE];t=t.replace(s,VH(this.options.includePrerelease)),dr("hyphen replace",t),t=t.replace(Bn[wn.COMPARATORTRIM],PH),dr("comparator trim",t),t=t.replace(Bn[wn.TILDETRIM],OH),dr("tilde trim",t),t=t.replace(Bn[wn.CARETTRIM],IH),dr("caret trim",t);let a=t.split(" ").map(f=>AH(f,this.options)).join(" ").split(/\s+/).map(f=>FH(f,this.options));o&&(a=a.filter(f=>(dr("loose invalid filter",f,this.options),!!f.match(Bn[wn.COMPARATORLOOSE])))),dr("range list",a);let c=new Map,l=a.map(f=>new __(f,this.options));for(let f of l){if(NO(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return AO.set(i,u),u}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(i=>xO(i,r)&&t.set.some(n=>xO(n,r)&&i.every(o=>n.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new RH(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(JH(this.set[r],t,this.options))return!0;return!1}};MO.exports=v_;var wH=jO(),AO=new wH,$H=fp(),__=Ju(),dr=Fu(),RH=Sn(),{safeRe:Bn,src:EH,t:wn,comparatorTrimReplace:PH,tildeTrimReplace:OH,caretTrimReplace:IH}=ll(),{FLAG_INCLUDE_PRERELEASE:CH,FLAG_LOOSE:kH}=cl(),TH=new RegExp(EH[wn.BUILD],"g"),NO=e=>e.value==="<0.0.0-0",jH=e=>e.value==="",xO=(e,t)=>{let r=!0,i=e.slice(),n=i.pop();for(;r&&i.length;)r=i.every(o=>n.intersects(o,t)),n=i.pop();return r},AH=(e,t)=>(e=e.replace(Bn[wn.BUILD],""),dr("comp",e,t),e=qH(e,t),dr("caret",e),e=xH(e,t),dr("tildes",e),e=DH(e,t),dr("xrange",e),e=zH(e,t),dr("stars",e),e),Wr=e=>!e||e.toLowerCase()==="x"||e==="*",NH=(e,t,r)=>Wr(e)&&!Wr(t)||Wr(t)&&r&&!Wr(r),xH=(e,t)=>e.trim().split(/\s+/).map(r=>MH(r,t)).join(" "),MH=(e,t)=>{let r=t.loose?Bn[wn.TILDELOOSE]:Bn[wn.TILDE],i=t.includePrerelease?"-0":"";return e.replace(r,(n,o,s,a,c)=>{dr("tilde",e,n,o,s,a,c);let l;return Wr(o)?l="":Wr(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Wr(a)?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:c?(dr("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,dr("tilde return",l),l})},qH=(e,t)=>e.trim().split(/\s+/).map(r=>LH(r,t)).join(" "),LH=(e,t)=>{dr("caret",e,t);let r=t.loose?Bn[wn.CARETLOOSE]:Bn[wn.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,(n,o,s,a,c)=>{dr("caret",e,n,o,s,a,c);let l;return Wr(o)?l="":Wr(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Wr(a)?o==="0"?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:c?(dr("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(dr("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),dr("caret return",l),l})},DH=(e,t)=>(dr("replaceXRanges",e,t),e.split(/\s+/).map(r=>UH(r,t)).join(" ")),UH=(e,t)=>{e=e.trim();let r=t.loose?Bn[wn.XRANGELOOSE]:Bn[wn.XRANGE];return e.replace(r,(i,n,o,s,a,c)=>{if(dr("xRange",e,i,n,o,s,a,c),NH(o,s,a))return e;let l=Wr(o),u=l||Wr(s),f=u||Wr(a),p=f;return n==="="&&p&&(n=""),c=t.includePrerelease?"-0":"",l?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&p?(u&&(s=0),a=0,n===">"?(n=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):n==="<="&&(n="<",u?o=+o+1:s=+s+1),n==="<"&&(c="-0"),i=`${n+o}.${s}.${a}${c}`):u?i=`>=${o}.0.0${c} <${+o+1}.0.0-0`:f&&(i=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),dr("xRange return",i),i})},zH=(e,t)=>(dr("replaceStars",e,t),e.trim().replace(Bn[wn.STAR],"")),FH=(e,t)=>(dr("replaceGTE0",e,t),e.trim().replace(Bn[t.includePrerelease?wn.GTE0PRE:wn.GTE0],"")),VH=e=>(t,r,i,n,o,s,a,c,l,u,f,p)=>(Wr(i)?r="":Wr(n)?r=`>=${i}.0.0${e?"-0":""}`:Wr(o)?r=`>=${i}.${n}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,Wr(l)?c="":Wr(u)?c=`<${+l+1}.0.0-0`:Wr(f)?c=`<${l}.${+u+1}.0-0`:p?c=`<=${l}.${u}.${f}-${p}`:e?c=`<${l}.${u}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),JH=(e,t,r)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let i=0;i<e.length;i++)if(dr(e[i].semver),e[i].semver!==__.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}});var Ju=B((qCe,FO)=>{"use strict";var Bu=Symbol("SemVer ANY"),w_=class e{static get ANY(){return Bu}constructor(t,r){if(r=qO(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),S_("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Bu?this.value="":this.value=this.operator+this.semver.version,S_("comp",this)}parse(t){let r=this.options.loose?LO[DO.COMPARATORLOOSE]:LO[DO.COMPARATOR],i=t.match(r);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new UO(i[2],this.options.loose):this.semver=Bu}toString(){return this.value}test(t){if(S_("Comparator.test",t,this.options.loose),this.semver===Bu||t===Bu)return!0;if(typeof t=="string")try{t=new UO(t,this.options)}catch{return!1}return b_(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new zO(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new zO(this.value,r).test(t.semver):(r=qO(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||b_(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||b_(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};FO.exports=w_;var qO=fp(),{safeRe:LO,t:DO}=ll(),b_=g_(),S_=Fu(),UO=Sn(),zO=Zi()});var Hu=B((LCe,VO)=>{"use strict";var BH=Zi(),HH=(e,t,r)=>{try{t=new BH(t,r)}catch{return!1}return t.test(e)};VO.exports=HH});var BO=B((DCe,JO)=>{"use strict";var ZH=Zi(),KH=(e,t)=>new ZH(e,t).set.map(r=>r.map(i=>i.value).join(" ").trim().split(" "));JO.exports=KH});var ZO=B((UCe,HO)=>{"use strict";var GH=Sn(),WH=Zi(),YH=(e,t,r)=>{let i=null,n=null,o=null;try{o=new WH(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||n.compare(s)===-1)&&(i=s,n=new GH(i,r))}),i};HO.exports=YH});var GO=B((zCe,KO)=>{"use strict";var XH=Sn(),QH=Zi(),eZ=(e,t,r)=>{let i=null,n=null,o=null;try{o=new QH(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||n.compare(s)===1)&&(i=s,n=new XH(i,r))}),i};KO.exports=eZ});var XO=B((FCe,YO)=>{"use strict";var $_=Sn(),tZ=Zi(),WO=Vu(),rZ=(e,t)=>{e=new tZ(e,t);let r=new $_("0.0.0");if(e.test(r)||(r=new $_("0.0.0-0"),e.test(r)))return r;r=null;for(let i=0;i<e.set.length;++i){let n=e.set[i],o=null;n.forEach(s=>{let a=new $_(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||WO(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||WO(r,o))&&(r=o)}return r&&e.test(r)?r:null};YO.exports=rZ});var eI=B((VCe,QO)=>{"use strict";var nZ=Zi(),iZ=(e,t)=>{try{return new nZ(e,t).range||"*"}catch{return null}};QO.exports=iZ});var $p=B((JCe,iI)=>{"use strict";var oZ=Sn(),nI=Ju(),{ANY:sZ}=nI,aZ=Zi(),cZ=Hu(),tI=Vu(),rI=vp(),lZ=bp(),uZ=_p(),dZ=(e,t,r,i)=>{e=new oZ(e,i),t=new aZ(t,i);let n,o,s,a,c;switch(r){case">":n=tI,o=lZ,s=rI,a=">",c=">=";break;case"<":n=rI,o=uZ,s=tI,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(cZ(e,t,i))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],f=null,p=null;if(u.forEach(g=>{g.semver===sZ&&(g=new nI(">=0.0.0")),f=f||g,p=p||g,n(g.semver,f.semver,i)?f=g:s(g.semver,p.semver,i)&&(p=g)}),f.operator===a||f.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0};iI.exports=dZ});var sI=B((BCe,oI)=>{"use strict";var fZ=$p(),pZ=(e,t,r)=>fZ(e,t,">",r);oI.exports=pZ});var cI=B((HCe,aI)=>{"use strict";var hZ=$p(),mZ=(e,t,r)=>hZ(e,t,"<",r);aI.exports=mZ});var dI=B((ZCe,uI)=>{"use strict";var lI=Zi(),gZ=(e,t,r)=>(e=new lI(e,r),t=new lI(t,r),e.intersects(t,r));uI.exports=gZ});var pI=B((KCe,fI)=>{"use strict";var yZ=Hu(),vZ=Hi();fI.exports=(e,t,r)=>{let i=[],n=null,o=null,s=e.sort((u,f)=>vZ(u,f,r));for(let u of s)yZ(u,t,r)?(o=u,n||(n=u)):(o&&i.push([n,o]),o=null,n=null);n&&i.push([n,null]);let a=[];for(let[u,f]of i)u===f?a.push(u):!f&&u===s[0]?a.push("*"):f?u===s[0]?a.push(`<=${f}`):a.push(`${u} - ${f}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t}});var _I=B((GCe,vI)=>{"use strict";var hI=Zi(),P_=Ju(),{ANY:R_}=P_,E_=Hu(),O_=Hi(),_Z=(e,t,r={})=>{if(e===t)return!0;e=new hI(e,r),t=new hI(t,r);let i=!1;e:for(let n of e.set){for(let o of t.set){let s=SZ(n,o,r);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},bZ=[new P_(">=0.0.0-0")],mI=[new P_(">=0.0.0")],SZ=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===R_){if(t.length===1&&t[0].semver===R_)return!0;r.includePrerelease?e=bZ:e=mI}if(t.length===1&&t[0].semver===R_){if(r.includePrerelease)return!0;t=mI}let i=new Set,n,o;for(let g of e)g.operator===">"||g.operator===">="?n=gI(n,g,r):g.operator==="<"||g.operator==="<="?o=yI(o,g,r):i.add(g.semver);if(i.size>1)return null;let s;if(n&&o){if(s=O_(n.semver,o.semver,r),s>0)return null;if(s===0&&(n.operator!==">="||o.operator!=="<="))return null}for(let g of i){if(n&&!E_(g,String(n),r)||o&&!E_(g,String(o),r))return null;for(let h of t)if(!E_(g,String(h),r))return!1;return!0}let a,c,l,u,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let g of t){if(u=u||g.operator===">"||g.operator===">=",l=l||g.operator==="<"||g.operator==="<=",n){if(p&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===p.major&&g.semver.minor===p.minor&&g.semver.patch===p.patch&&(p=!1),g.operator===">"||g.operator===">="){if(a=gI(n,g,r),a===g&&a!==n)return!1}else if(n.operator===">="&&!g.test(n.semver))return!1}if(o){if(f&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===f.major&&g.semver.minor===f.minor&&g.semver.patch===f.patch&&(f=!1),g.operator==="<"||g.operator==="<="){if(c=yI(o,g,r),c===g&&c!==o)return!1}else if(o.operator==="<="&&!g.test(o.semver))return!1}if(!g.operator&&(o||n)&&s!==0)return!1}return!(n&&l&&!o&&s!==0||o&&u&&!n&&s!==0||p||f)},gI=(e,t,r)=>{if(!e)return t;let i=O_(e.semver,t.semver,r);return i>0?e:i<0||t.operator===">"&&e.operator===">="?t:e},yI=(e,t,r)=>{if(!e)return t;let i=O_(e.semver,t.semver,r);return i<0?e:i>0||t.operator==="<"&&e.operator==="<="?t:e};vI.exports=_Z});var $I=B((WCe,wI)=>{"use strict";var I_=ll(),bI=cl(),wZ=Sn(),SI=d_(),$Z=Ma(),RZ=BP(),EZ=ZP(),PZ=WP(),OZ=QP(),IZ=tO(),CZ=nO(),kZ=oO(),TZ=aO(),jZ=Hi(),AZ=dO(),NZ=pO(),xZ=yp(),MZ=yO(),qZ=_O(),LZ=Vu(),DZ=vp(),UZ=h_(),zZ=m_(),FZ=_p(),VZ=bp(),JZ=g_(),BZ=IO(),HZ=kO(),ZZ=Ju(),KZ=Zi(),GZ=Hu(),WZ=BO(),YZ=ZO(),XZ=GO(),QZ=XO(),e3=eI(),t3=$p(),r3=sI(),n3=cI(),i3=dI(),o3=pI(),s3=_I();wI.exports={parse:$Z,valid:RZ,clean:EZ,inc:PZ,diff:OZ,major:IZ,minor:CZ,patch:kZ,prerelease:TZ,compare:jZ,rcompare:AZ,compareLoose:NZ,compareBuild:xZ,sort:MZ,rsort:qZ,gt:LZ,lt:DZ,eq:UZ,neq:zZ,gte:FZ,lte:VZ,cmp:JZ,coerce:BZ,truncate:HZ,Comparator:ZZ,Range:KZ,satisfies:GZ,toComparators:WZ,maxSatisfying:YZ,minSatisfying:XZ,minVersion:QZ,validRange:e3,outside:t3,gtr:r3,ltr:n3,intersects:i3,simplifyRange:o3,subset:s3,SemVer:wZ,re:I_.re,src:I_.src,tokens:I_.t,SEMVER_SPEC_VERSION:bI.SEMVER_SPEC_VERSION,RELEASE_TYPES:bI.RELEASE_TYPES,compareIdentifiers:SI.compareIdentifiers,rcompareIdentifiers:SI.rcompareIdentifiers}});var pa=B((YCe,NI)=>{var qa=require("fs"),Ki=require("path"),EI=c_(),Gi=$I(),{DEFAULT_API_URL:a3}=fa(),PI=["dependencies","devDependencies","optionalDependencies","peerDependencies"];function C_(e){let t=typeof e=="string"&&e.match(/^((?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*)(?:@([^\r\n]+))?$/);if(!t)throw new Error(`Invalid npm dependency: ${String(e)}`);return{name:t[1],version:t[2]}}function k_(e){let t=new Map;for(let r of e){let{name:i,version:n}=C_(r),o=t.get(i);t.set(i,o&&n?OI(i,o,n):n||o)}return t}function OI(e,t,r){if(t===r)return t;let i=Gi.validRange(t),n=Gi.validRange(r);if(i&&n)try{if(Gi.subset(n,i))return r;if(Gi.subset(i,n))return t}catch{}throw new Error(`Conflicting registry versions for ${e}: ${t} and ${r}`)}function c3(e,t){let r=typeof e=="string"&&Gi.validRange(e),i=Gi.validRange(t);if(!r||!i)return!1;try{return Gi.subset(r,i)}catch{return!1}}function Ep(e,t){if(c3(e,t))return"satisfied";let r=typeof e=="string"&&Gi.validRange(e),i=Gi.validRange(t);if(!r||!i)return"incomparable";try{let n=Gi.minVersion(r),o=Gi.minVersion(i);return!n||!o?"incomparable":Gi.lt(n,o)?"lower":"newer"}catch{return"incomparable"}}function Rp(e,t){let r=PI.find(i=>Object.hasOwn(e[i]||{},t));return r?{section:r,existing:e[r][t]}:null}function II(e,t){let r=k_(t);if(r.size===0)return;let i=Ki.join(e,"package.json"),n=JSON.parse(qa.readFileSync(i,"utf8"));for(let[o,s]of r){let a=Rp(n,o),c=a?.section||"dependencies";n[c]||={};let l=a?.existing;n[c][o]=l===void 0?s||"latest":s&&Ep(l,s)==="lower"?s:l}qa.writeFileSync(i,`${JSON.stringify(n,null,2)}
|
|
3
3
|
`)}function Pp(e){let t=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"]];for(let r=Ki.resolve(e);;r=Ki.dirname(r)){let i=Ki.join(r,"package.json");if(qa.existsSync(i)){let n=JSON.parse(qa.readFileSync(i,"utf8")),o=String(n.packageManager||"").split("@")[0];if(["npm","pnpm","yarn","bun"].includes(o))return o}for(let[n,o]of t)if(qa.existsSync(Ki.join(r,n)))return o;if(Ki.dirname(r)===r)return"npm"}}var RI={npm:"npx",pnpm:"pnpm exec",yarn:"yarn",bun:"bunx"};function CI(e,t=process.cwd()){let r;try{r=Pp(t)}catch{r="npm"}return`${RI[r]||RI.npm} frontfriend ${e}`}function l3(e,t=process.cwd()){let r=null;try{r=e?new URL(e).origin:null}catch{r=null}return CI(r&&r!==new URL(a3).origin?`login --api-url ${r}`:"login",t)}function kI(e){return JSON.parse(qa.readFileSync(Ki.join(e,"package.json"),"utf8"))}function T_(e,t){let r=k_(t);if(r.size===0)return[];let i=kI(e),n=[];for(let[o,s]of r){let a=Rp(i,o);a&&(!s||Ep(a.existing,s)!=="lower")||n.push(s?`${o}@${s}`:o)}return n}function u3(e,t){let r=t.filter(f=>f.required),i=k_(r.flatMap(f=>f.dependencies)),n=(f,p)=>p.filter(g=>g.dependencies.some(h=>C_(h).name===f)).map(g=>g.component).filter(Boolean),o=t.filter(f=>!f.required);if(i.size===0&&o.length===0)return{missing:[],kept:[],repair:[]};let s=kI(e),a=[],c=[];for(let[f,p]of i){let g=Rp(s,f);if(!g){a.push(p?`${f}@${p}`:f);continue}if(!p)continue;let h=Ep(g.existing,p);h==="lower"?a.push(`${f}@${p}`):h!=="satisfied"&&c.push({name:f,current:g.existing,declared:p,components:n(f,r)})}let l=new Map;for(let f of o.flatMap(p=>p.dependencies)){let{name:p,version:g}=C_(f);if(i.has(p)||Rp(s,p))continue;let h=l.get(p),v=g||h?.version;if(h?.version&&g&&h.version!==g)try{v=OI(p,h.version,g)}catch{v=h.version}l.set(p,{version:v})}let u=[...l].map(([f,{version:p}])=>({request:p?`${f}@${p}`:f,components:n(f,o)}));return{missing:a,kept:c,repair:u}}function TI(e,t){return[e==="npm"?"install":"add",...t]}function d3(e){return/^[\w@/.:^~=+-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function jI(e,t){let r=Pp(e);return[r,...TI(r,t)].map(d3).join(" ")}function AI(e,t,{stdio:r="inherit"}={}){let i=T_(e,t);if(i.length===0)return;let n=Pp(e),o=EI.sync(n,TI(n,i),{cwd:e,stdio:r});if(o.error||o.status!==0)throw II(e,t),o.error||new Error(`${n} dependency installation failed with status ${o.status}. Dependencies were saved; run ${n} install.`)}function f3(e,t,{install:r=!0,stdio:i="inherit",log:n=console.log}={}){let o=T_(e,t);if(o.length===0)return{missing:o,command:null,installed:!1};let s=jI(e,o);if(!r)return n(`\u{1F4E6} Component dependencies missing from package.json. Install them with:
|
|
4
4
|
${s}`),{missing:o,command:s,installed:!1};n(`\u{1F4E6} Installing component dependencies: ${s}`);try{return AI(e,o,{stdio:i}),{missing:o,command:s,installed:!0}}catch(a){return n(`\u26A0\uFE0F Component dependencies were not installed: ${a.message}
|
|
5
5
|
Install them with:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var j=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var S=j((q,F)=>{F.exports={name:"@frontfriend/sdk",version:"1.2.
|
|
1
|
+
var j=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var S=j((q,F)=>{F.exports={name:"@frontfriend/sdk",version:"1.2.8"}});var C=j(($,b)=>{var{name:w}=S();b.exports={PACKAGE_NAME:w}});var{PACKAGE_NAME:m}=C(),u=require("fs"),E=require("http"),O=require("https"),r=require("path"),g=["contracts","tokens","components"],T=["app/globals.css","src/app/globals.css","styles/globals.css","src/styles/globals.css","src/styles.css","src/index.css","src/style.css"],k={next:["next.config.js","next.config.mjs","next.config.ts"],vite:["vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"]},x=["primereact","@mui/material","antd","@chakra-ui/react","@mantine/core","@fluentui/react"],I=["style-dictionary","@tokens-studio/sd-transforms","@vanilla-extract/css","styled-components","@emotion/react"];function A(n){try{return JSON.parse(u.readFileSync(n,"utf8"))}catch{return{}}}function h(n){if(n===void 0)return null;if(!Array.isArray(n)){let t=new Error("`adopt` in frontfriend.config.js must be an array.");throw t.code="FRONTFRIEND_CONFIG_VALIDATION",t}let e=n.filter(t=>!g.includes(t));if(e.length>0){let t=new Error(`Unknown Frontfriend adoption level: ${e.join(", ")}.`);throw t.code="FRONTFRIEND_CONFIG_VALIDATION",t}let i=n.includes("components")?2:n.includes("tokens")?1:0;return g.slice(0,i+1)}function _(n){for(let[e,i]of Object.entries(k)){let t=i.find(s=>u.existsSync(r.join(n,s)));if(!t)continue;let c=u.readFileSync(r.join(n,t),"utf8");return{buildTool:e,present:c.includes(`${m}/${e}`)}}return{buildTool:null,present:!1}}function v(n){let e=[r.join(n,"components","ui"),r.join(n,"src","components","ui"),r.join(n,"app","components","ui")].filter(c=>u.existsSync(c)),i=new Set;function t(c){for(let s of u.readdirSync(c,{withFileTypes:!0})){let o=r.join(c,s.name);if(s.isDirectory())t(o);else if(/\.(js|jsx|ts|tsx|vue)$/.test(s.name)){if(!u.readFileSync(o,"utf8").includes(m))continue;let a=r.basename(s.name,r.extname(s.name));i.add(a.toLowerCase()==="index"?r.basename(c):a.toLowerCase())}}}return e.forEach(t),[...i].sort()}function P(n){let e=A(r.join(n,"package.json")),i={...e.dependencies||{},...e.devDependencies||{}},t=i.tailwindcss||null,s=[A(r.join(n,"components.json"))?.tailwind?.css,...T].filter(Boolean).find(a=>u.existsSync(r.join(n,a))),o=s?u.readFileSync(r.join(n,s),"utf8"):"",l=I.filter(a=>i[a]);return!l.length&&/:root[\s\S]*--(?:color|spacing|font|radius)-[\w-]+\s*:/.test(o)&&!o.includes(`${m}/theme.css`)&&l.push("css-custom-properties"),{nativeTokens:{present:o.includes("/* Frontfriend managed native tokens: start */"),file:s||null},tailwind:{present:!!t,version:t,major:t&&Number((String(t).match(/\d+/)||[])[0])||null},componentsJson:u.existsSync(r.join(n,"components.json")),themeImport:{present:o.includes(`${m}/theme.css`)||/@import\s+["'][^"']*node_modules\/\.cache\/frontfriend\/theme\.css["']/.test(o),file:s||null},plugin:_(n),frontfriendComponents:v(n),foreignComponentLibraries:x.filter(a=>i[a]),foreignTokenSystems:l}}function D(n,e,{baseLibrary:i}={}){let t=h(n)||g,c=t.includes("tokens"),s=t.includes("components"),o=[];return c&&!e.themeImport.present&&!e.nativeTokens?.present&&o.push("Config adopts tokens, but the Frontfriend theme import was not observed."),!c&&e.themeImport.present&&o.push("Frontfriend tokens are present in CSS but are not adopted in config."),s&&i==="shadcn"&&!e.componentsJson&&o.push("Config adopts components, but components.json was not observed."),!s&&e.frontfriendComponents.length>0&&o.push("Frontfriend components are installed but are not adopted in config."),o}function L({apiUrl:n,token:e,ffId:i,name:t,adopt:c,observed:s,framework:o,primitive:l}){if(!n||!e||!i||!t||!o||l===void 0)return Promise.resolve({reported:!1,unavailable:!0});let a=new URL("/api/apps/sync",n),y=JSON.stringify({ffId:i,name:t,adopt:h(c),observed:s,runtime:"sdk",framework:o,primitive:l}),N=a.protocol==="https:"?O:E;return new Promise(d=>{let f=N.request(a,{method:"POST",headers:{authorization:`Bearer ${e}`,"content-type":"application/json","content-length":Buffer.byteLength(y)}},p=>{p.resume(),p.on("end",()=>{p.statusCode>=200&&p.statusCode<300?d({reported:!0,unavailable:!1}):d({reported:!1,unavailable:!0})})});f.on("error",()=>d({reported:!1,unavailable:!0})),f.setTimeout(1500,()=>{f.destroy(),d({reported:!1,unavailable:!0})}),f.end(y)})}module.exports={ADOPTION_LEVELS:g,normalizeAdopt:h,probeAdoption:P,adoptionWarnings:D,reportAdoption:L};
|
|
@@ -3,7 +3,7 @@ var Rr=Object.create;var Pt=Object.defineProperty;var Nr=Object.getOwnPropertyDe
|
|
|
3
3
|
`)?s.body.slice(0,-1):s.body;return["<!-- frontfriend design mirror \u2014 DO NOT EDIT (overwritten by `frontfriend design sync`)",`slug: ${s.slug}`,`maturity: ${s.maturity}`,`implemented: ${s.implemented}`,`implementation: ${s.implementation||"unknown"}`,`version: ${s.version}`,"-->","",r,""].join(`
|
|
4
4
|
`)}function ti(s){return[`# Frontfriend design mirror \u2014 ${s.name}`,"","This directory is a READ-ONLY mirror of the Design System design contracts",`(Design System "${s.name}", ff-id \`${s.ff_id}\`) managed on the Frontfriend platform.`,"","Every file here is overwritten by `frontfriend design sync`. Do not edit by","hand: local changes are discarded on the next sync, and files whose contract","was removed upstream are deleted. Edit contracts on the platform instead.",""].join(`
|
|
5
5
|
`)}function cs({design_system:s,contracts:r}){let o=[...r].filter(l=>ft(l.slug)).sort((l,p)=>l.kind.localeCompare(p.kind)||l.slug.localeCompare(p.slug)),c={"README.md":ti(s)};for(let l of o)c[l.slug]=ei(l);return c}function Zt(s,r){let o={};for(let[l,p]of Object.entries(s))r[l]!==p&&(o[l]=p);let c=Object.keys(r).filter(l=>!(l in s)).sort();return{writes:o,deletes:c}}var ii=s=>os("sha256").update(s).digest("hex");function Wr(s){return Object.fromEntries(Object.entries(s).filter(([r])=>r!=="README.md"&&ft(r)).map(([r,o])=>[r,ii(o)]))}function Hr(s,r){let o=()=>{throw new Error("Invalid or incomplete mirror response. No local files were changed; retry sync.")};(!s||typeof s.design_system?.ff_id!="string"||typeof s.design_system?.name!="string"||!Array.isArray(s.contracts))&&o();let c=new Map;for(let h of s.contracts)(!h||!ft(h.slug)||h.slug==="README.md"||typeof h.body!="string"||typeof h.kind!="string"||typeof h.maturity!="string"||typeof h.implemented!="boolean"||!Number.isSafeInteger(h.version)||h.version<1||c.has(h.slug))&&o(),c.set(h.slug,ei(h));if(s.protocol===void 0)return s.manifest!==void 0&&o(),Zt(cs(s),r);(s.protocol!==1||!Array.isArray(s.manifest))&&o();let l={"README.md":ti(s.design_system)},p=new Set;for(let h of s.manifest){(!h||!ft(h.slug)||h.slug==="README.md"||!/^[a-f0-9]{64}$/.test(h.hash)||p.has(h.slug))&&o(),p.add(h.slug);let f=c.get(h.slug)??r[h.slug];(typeof f!="string"||ii(f)!==h.hash)&&o(),Object.defineProperty(l,h.slug,{value:f,enumerable:!0})}return[...c.keys()].some(h=>!p.has(h))&&o(),Zt(l,r)}function zr(s){let r={};if(!Me.existsSync(s))return r;let o=c=>{for(let l of Me.readdirSync(c,{withFileTypes:!0})){let p=Te.join(c,l.name);if(l.isDirectory())o(p);else if(l.isFile()){let h=Te.relative(s,p).split(Te.sep).join("/");r[h]=Me.readFileSync(p,"utf8")}}};return o(s),r}function Gr(s,r){for(let[o,c]of Object.entries(r.writes)){let l=Te.join(s,...o.split("/"));Me.mkdirSync(Te.dirname(l),{recursive:!0}),Me.writeFileSync(l,c)}for(let o of r.deletes){let c=Te.join(s,...o.split("/"));Me.rmSync(c,{force:!0});let l=Te.dirname(c),p=Te.resolve(s);for(;Te.resolve(l)!==p&&Me.existsSync(l)&&Me.readdirSync(l).length===0;)Me.rmdirSync(l),l=Te.dirname(l)}}function Jr(s,r,o){if(!r||s.contract_selection!==1||s.selection?.design_snapshot_id!==r.snapshotId||s.selection?.digest!==r.snapshotDigest||s.app?.id!==r.appId||s.design_system?.ff_id!==o)throw new Error("Contract mirror does not match the selected App snapshot.");let c=[...r.sharedContracts,...r.contracts],l=s.manifest??s.contracts,p=new Map(c.map(h=>[h.slug,h]));if(!Array.isArray(l)||!Array.isArray(s.contracts)||l.length!==c.length||new Set(l.map(h=>h.slug)).size!==c.length||l.some(h=>!p.has(h.slug)))throw new Error("Contract mirror inventory does not match the snapshot.");for(let h of s.contracts){let f=p.get(h.slug);if(!f||h.revision_id!==f.revisionId||h.digest!==f.digest||h.version!==f.version||h.kind!==f.kind)throw new Error("Contract body identity does not match its snapshot pin.");let d={appId:r.contracts.some(w=>w.slug===f.slug)?r.appId:null,body:h.body,designSystemId:r.designSystemId,kind:h.kind,maturity:h.maturity,slug:h.slug,title:h.title};if(os("sha256").update(JSON.stringify(d)).digest("hex")!==f.digest)throw new Error("Contract content does not match its immutable digest.")}return c}us.exports={validatePinnedMirror:Jr,MIRROR_DIR:$r,FRONTFRIEND_GITIGNORE_PATH:Ur,renderFrontfriendGitignore:qr,isSafeSlug:ft,renderContractFile:ei,renderMirrorReadme:ti,buildMirrorTree:cs,planMirrorSync:Zt,hashMirrorFile:ii,knownMirrorHashes:Wr,planMirrorResponse:Hr,readMirrorTree:zr,applyMirrorPlan:Gr}});var ci=Ee((ga,vs)=>{var oi=require("fs"),fe=require("path");function fs(s,r="JSON"){let o="",c=0,l=s.charCodeAt(0)===65279?s.slice(1):s;for(;c<l.length;){let h=l[c];if(h==='"'){let f=c+1;for(;f<l.length&&l[f]!=='"';)f+=l[f]==="\\"?2:1;o+=l.slice(c,f+1),c=f+1}else if(h==="/"&&l[c+1]==="/")for(;c<l.length&&l[c]!==`
|
|
6
|
-
`;)c+=1;else if(h==="/"&&l[c+1]==="*"){let f=l.indexOf("*/",c+2);if(f===-1)throw new Error(`Cannot read ${r}: unterminated comment.`);o+=l.slice(c,f+2).replace(/[^\n]/g," "),c=f+2}else o+=h,c+=1}let p="";for(let h=0;h<o.length;h+=1){let f=o[h];if(f==='"'){let d=h+1;for(;d<o.length&&o[d]!=='"';)d+=o[d]==="\\"?2:1;p+=o.slice(h,d+1),h=d;continue}if(f===","){let d=h+1;for(;d<o.length&&/\s/.test(o[d]);)d+=1;if(o[d]==="}"||o[d]==="]")continue}p+=f}try{return p.trim()?JSON.parse(p):{}}catch(h){throw new Error(`Cannot read ${r}: ${h.message}`)}}function ds(s){return fs(oi.readFileSync(s,"utf8"),s)}var Tt=s=>{try{return oi.statSync(s).isFile()}catch{return!1}};function ms(s,r){if(typeof s!="string"||!s)throw new Error('tsconfig "extends" must be a non-empty string.');let o=c=>Tt(c)?c:!c.endsWith(".json")&&Tt(`${c}.json`)?`${c}.json`:null;if(s.startsWith(".")||fe.isAbsolute(s)){let c=o(fe.resolve(r,s));if(c)return c;throw new Error(`File '${s}' not found (tsconfig extends, from ${r}).`)}for(let c=r;;c=fe.dirname(c)){let l=fe.join(c,"node_modules",s),p=o(l);if(p)return p;let h=null;try{h=JSON.parse(oi.readFileSync(fe.join(l,"package.json"),"utf8"))}catch{h=null}if(h&&typeof h.tsconfig=="string"&&Tt(fe.join(l,h.tsconfig)))return fe.join(l,h.tsconfig);if(Tt(fe.join(l,"tsconfig.json")))return fe.join(l,"tsconfig.json");if(fe.dirname(c)===c)break}for(let c of[s,`${s}/tsconfig.json`,`${s}.json`])try{return require.resolve(c,{paths:[r]})}catch{}throw new Error(`File '${s}' not found (tsconfig extends, from ${r}).`)}function gs(s,r,o=new Set){let c=fe.resolve(s);if(o.has(c))throw new Error(`Circularity detected while resolving configuration: ${c}`);let l=new Set(o).add(c),p=ds(c),h=fe.dirname(c),f={},d=p.extends===void 0?[]:Array.isArray(p.extends)?p.extends:[p.extends];for(let I of d)f={...f,...gs(ms(I,h),r,l)};let v=p.compilerOptions&&typeof p.compilerOptions=="object"?p.compilerOptions:{},w=I=>typeof I=="string"?I.replace(/\$\{configDir\}/g,r):I;return typeof v.baseUrl=="string"&&(f.baseUrl=fe.resolve(h,w(v.baseUrl))),v.paths&&typeof v.paths=="object"&&(f.paths=Object.fromEntries(Object.entries(v.paths).map(([I,A])=>[I,Array.isArray(A)?A.map(w):A])),f.pathsBasePath=h),f}function Zr(s){let r=gs(s,fe.dirname(fe.resolve(s)));return r.paths?{base:r.baseUrl||r.pathsBasePath||fe.dirname(s),paths:r.paths}:null}vs.exports={parseJsonc:fs,readJsonc:ds,resolveExtends:ms,readConfigPaths:Zr}});var Ot={};Yt(Ot,{materializeInstallationPath:()=>li,readProjectPaths:()=>ys,resolveCanonicalUiDirectory:()=>bs,resolveConfiguredAlias:()=>Lt});function xs(s){try{return JSON.parse(tt.default.readFileSync(s,"utf8"))}catch{return null}}function ys(s){for(let r of["tsconfig.json","tsconfig.app.json","jsconfig.json"]){let o=me.default.join(s,r);if(!tt.default.existsSync(o))continue;let c=en(o);if(c)return c}return{base:s,paths:{"@/*":[tt.default.existsSync(me.default.join(s,"src"))?"src/*":"*"]}}}function Lt(s,r,o=ys(s)){for(let[c,l]of Object.entries(o.paths)){if(!Array.isArray(l)||typeof l[0]!="string")continue;let[p,h=""]=c.split("*");if(!r.startsWith(p)||!r.endsWith(h)||!c.includes("*")&&r!==c)continue;let f=r.slice(p.length,h?-h.length:void 0);return me.default.resolve(o.base,l[0].replace("*",f))}return r.startsWith("@/")?me.default.resolve(s,tt.default.existsSync(me.default.join(s,"src"))?"src":".",r.slice(2)):me.default.resolve(s,r)}function ui(s,r){let o=me.default.relative(s,r).replace(/\\/g,"/");if(!o||o===".."||o.startsWith("../")||me.default.posix.isAbsolute(o))throw new Error("The canonical ui alias must stay inside the Application root.");return o}function bs(s,r){if(r)return ui(s,Lt(s,r));let c=xs(me.default.join(s,"components.json"))?.aliases?.ui;return typeof c=="string"&&c?ui(s,Lt(s,c)):tt.default.existsSync(me.default.join(s,"src"))?"src/components/ui":"components/ui"}function li(s){if(s.installationLayout==="shadcn"&&/^(?:lib|hooks|components)\//.test(s.path)){let c=xs(me.default.join(s.root,"components.json"))?.aliases||{},l=/^lib\/utils\.[^.]+$/.test(s.path),p=s.path.split("/")[0],h=l&&c.utils?c.utils:c[p]||`@/${p}`,f=Lt(s.root,h);return ui(s.root,l&&c.utils?f+me.default.extname(s.path):me.default.join(f,s.path.slice(p.length+1)))}if(s.source!=="canonical"&&s.installationLayout!=="shadcn"||!s.path.startsWith("ui/"))return s.path;let r=s.path.slice(3);return me.default.posix.join(bs(s.root,s.configuredUiPath),r)}var tt,me,en,mt=Zi(()=>{tt=Ze(require("node:fs")),me=Ze(require("node:path")),{readConfigPaths:en}=ci()});var Ss=Ee((xa,rn)=>{rn.exports={name:"@frontfriend/sdk",version:"1.2.7"}});var Cs=Ee((ya,ks)=>{var{name:nn}=Ss();ks.exports={PACKAGE_NAME:nn}});var pi=Ee((ba,As)=>{var{PACKAGE_NAME:jt}=Cs(),$e=require("fs"),an=require("http"),on=require("https"),ye=require("path"),Vt=["contracts","tokens","components"],cn=["app/globals.css","src/app/globals.css","styles/globals.css","src/styles/globals.css","src/styles.css","src/index.css","src/style.css"],un={next:["next.config.js","next.config.mjs","next.config.ts"],vite:["vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"]},ln=["primereact","@mui/material","antd","@chakra-ui/react","@mantine/core","@fluentui/react"],hn=["style-dictionary","@tokens-studio/sd-transforms","@vanilla-extract/css","styled-components","@emotion/react"];function Is(s){try{return JSON.parse($e.readFileSync(s,"utf8"))}catch{return{}}}function hi(s){if(s===void 0)return null;if(!Array.isArray(s)){let c=new Error("`adopt` in frontfriend.config.js must be an array.");throw c.code="FRONTFRIEND_CONFIG_VALIDATION",c}let r=s.filter(c=>!Vt.includes(c));if(r.length>0){let c=new Error(`Unknown Frontfriend adoption level: ${r.join(", ")}.`);throw c.code="FRONTFRIEND_CONFIG_VALIDATION",c}let o=s.includes("components")?2:s.includes("tokens")?1:0;return Vt.slice(0,o+1)}function pn(s){for(let[r,o]of Object.entries(un)){let c=o.find(p=>$e.existsSync(ye.join(s,p)));if(!c)continue;let l=$e.readFileSync(ye.join(s,c),"utf8");return{buildTool:r,present:l.includes(`${jt}/${r}`)}}return{buildTool:null,present:!1}}function fn(s){let r=[ye.join(s,"components","ui"),ye.join(s,"src","components","ui"),ye.join(s,"app","components","ui")].filter(l=>$e.existsSync(l)),o=new Set;function c(l){for(let p of $e.readdirSync(l,{withFileTypes:!0})){let h=ye.join(l,p.name);if(p.isDirectory())c(h);else if(/\.(js|jsx|ts|tsx|vue)$/.test(p.name)){if(!$e.readFileSync(h,"utf8").includes(jt))continue;let d=ye.basename(p.name,ye.extname(p.name));o.add(d.toLowerCase()==="index"?ye.basename(l):d.toLowerCase())}}}return r.forEach(c),[...o].sort()}function dn(s){let r=Is(ye.join(s,"package.json")),o={...r.dependencies||{},...r.devDependencies||{}},c=o.tailwindcss||null,p=[Is(ye.join(s,"components.json"))?.tailwind?.css,...cn].filter(Boolean).find(d=>$e.existsSync(ye.join(s,d))),h=p?$e.readFileSync(ye.join(s,p),"utf8"):"",f=hn.filter(d=>o[d]);return!f.length&&/:root[\s\S]*--(?:color|spacing|font|radius)-[\w-]+\s*:/.test(h)&&!h.includes(`${jt}/theme.css`)&&f.push("css-custom-properties"),{nativeTokens:{present:h.includes("/* Frontfriend managed native tokens: start */"),file:p||null},tailwind:{present:!!c,version:c,major:c&&Number((String(c).match(/\d+/)||[])[0])||null},componentsJson:$e.existsSync(ye.join(s,"components.json")),themeImport:{present:h.includes(`${jt}/theme.css`)||/@import\s+["'][^"']*node_modules\/\.cache\/frontfriend\/theme\.css["']/.test(h),file:p||null},plugin:pn(s),frontfriendComponents:fn(s),foreignComponentLibraries:ln.filter(d=>o[d]),foreignTokenSystems:f}}function mn(s,r,{baseLibrary:o}={}){let c=hi(s)||Vt,l=c.includes("tokens"),p=c.includes("components"),h=[];return l&&!r.themeImport.present&&!r.nativeTokens?.present&&h.push("Config adopts tokens, but the Frontfriend theme import was not observed."),!l&&r.themeImport.present&&h.push("Frontfriend tokens are present in CSS but are not adopted in config."),p&&o==="shadcn"&&!r.componentsJson&&h.push("Config adopts components, but components.json was not observed."),!p&&r.frontfriendComponents.length>0&&h.push("Frontfriend components are installed but are not adopted in config."),h}function gn({apiUrl:s,token:r,ffId:o,name:c,adopt:l,observed:p,framework:h,primitive:f}){if(!s||!r||!o||!c||!h||f===void 0)return Promise.resolve({reported:!1,unavailable:!0});let d=new URL("/api/apps/sync",s),v=JSON.stringify({ffId:o,name:c,adopt:hi(l),observed:p,runtime:"sdk",framework:h,primitive:f}),w=d.protocol==="https:"?on:an;return new Promise(I=>{let A=w.request(d,{method:"POST",headers:{authorization:`Bearer ${r}`,"content-type":"application/json","content-length":Buffer.byteLength(v)}},B=>{B.resume(),B.on("end",()=>{B.statusCode>=200&&B.statusCode<300?I({reported:!0,unavailable:!1}):I({reported:!1,unavailable:!0})})});A.on("error",()=>I({reported:!1,unavailable:!0})),A.setTimeout(1500,()=>{A.destroy(),I({reported:!1,unavailable:!0})}),A.end(v)})}As.exports={ADOPTION_LEVELS:Vt,normalizeAdopt:hi,probeAdoption:dn,adoptionWarnings:mn,reportAdoption:gn}});var Es=Ee((Ft,_s)=>{(function(s,r){typeof Ft=="object"&&typeof _s<"u"?r(Ft):typeof define=="function"&&define.amd?define(["exports"],r):(s=typeof globalThis<"u"?globalThis:s||self,r(s.acorn={}))})(Ft,function(s){"use strict";var r=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],o=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],c="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",l="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",p={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},h="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",f={5:h,"5module":h+" export import",6:h+" const class extends export import super"},d=/^in(stanceof)?$/,v=new RegExp("["+l+"]"),w=new RegExp("["+l+c+"]");function I(e,t){for(var i=65536,n=0;n<t.length;n+=2){if(i+=t[n],i>e)return!1;if(i+=t[n+1],i>=e)return!0}return!1}function A(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&v.test(String.fromCharCode(e)):t===!1?!1:I(e,o)}function B(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&w.test(String.fromCharCode(e)):t===!1?!1:I(e,o)||I(e,r)}var _=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function T(e,t){return new _(e,{beforeExpr:!0,binop:t})}var R={beforeExpr:!0},E={startsExpr:!0},oe={};function O(e,t){return t===void 0&&(t={}),t.keyword=e,oe[e]=new _(e,t)}var a={num:new _("num",E),regexp:new _("regexp",E),string:new _("string",E),name:new _("name",E),privateId:new _("privateId",E),eof:new _("eof"),bracketL:new _("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new _("]"),braceL:new _("{",{beforeExpr:!0,startsExpr:!0}),braceR:new _("}"),parenL:new _("(",{beforeExpr:!0,startsExpr:!0}),parenR:new _(")"),comma:new _(",",R),semi:new _(";",R),colon:new _(":",R),dot:new _("."),question:new _("?",R),questionDot:new _("?."),arrow:new _("=>",R),template:new _("template"),invalidTemplate:new _("invalidTemplate"),ellipsis:new _("...",R),backQuote:new _("`",E),dollarBraceL:new _("${",{beforeExpr:!0,startsExpr:!0}),eq:new _("=",{beforeExpr:!0,isAssign:!0}),assign:new _("_=",{beforeExpr:!0,isAssign:!0}),incDec:new _("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new _("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:T("||",1),logicalAND:T("&&",2),bitwiseOR:T("|",3),bitwiseXOR:T("^",4),bitwiseAND:T("&",5),equality:T("==/!=/===/!==",6),relational:T("</>/<=/>=",7),bitShift:T("<</>>/>>>",8),plusMin:new _("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:T("%",10),star:T("*",10),slash:T("/",10),starstar:new _("**",{beforeExpr:!0}),coalesce:T("??",1),_break:O("break"),_case:O("case",R),_catch:O("catch"),_continue:O("continue"),_debugger:O("debugger"),_default:O("default",R),_do:O("do",{isLoop:!0,beforeExpr:!0}),_else:O("else",R),_finally:O("finally"),_for:O("for",{isLoop:!0}),_function:O("function",E),_if:O("if"),_return:O("return",R),_switch:O("switch"),_throw:O("throw",R),_try:O("try"),_var:O("var"),_const:O("const"),_while:O("while",{isLoop:!0}),_with:O("with"),_new:O("new",{beforeExpr:!0,startsExpr:!0}),_this:O("this",E),_super:O("super",E),_class:O("class",E),_extends:O("extends",R),_export:O("export"),_import:O("import",E),_null:O("null",E),_true:O("true",E),_false:O("false",E),_in:O("in",{beforeExpr:!0,binop:7}),_instanceof:O("instanceof",{beforeExpr:!0,binop:7}),_typeof:O("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:O("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:O("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},b=/\r\n?|\n|\u2028|\u2029/,j=new RegExp(b.source,"g");function V(e){return e===10||e===13||e===8232||e===8233}function W(e,t,i){i===void 0&&(i=e.length);for(var n=t;n<i;n++){var u=e.charCodeAt(n);if(V(u))return n<i-1&&u===13&&e.charCodeAt(n+1)===10?n+2:n+1}return-1}var Y=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,q=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ee=Object.prototype,xe=ee.hasOwnProperty,nt=ee.toString,re=Object.hasOwn||function(e,t){return xe.call(e,t)},bt=Array.isArray||function(e){return nt.call(e)==="[object Array]"},zt=Object.create(null);function Re(e){return zt[e]||(zt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ue(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var wt=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,S=function(t,i){this.line=t,this.column=i};S.prototype.offset=function(t){return new S(this.line,this.column+t)};var $=function(t,i,n){this.start=i,this.end=n,t.sourceFile!==null&&(this.source=t.sourceFile)};function te(e,t){for(var i=1,n=0;;){var u=W(e,n,t);if(u<0)return new S(i,t-n);++i,n=u}}var Se={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Oe=!1;function ne(e){var t={};for(var i in Se)t[i]=e&&re(e,i)?e[i]:Se[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Oe&&typeof console=="object"&&console.warn&&(Oe=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
6
|
+
`;)c+=1;else if(h==="/"&&l[c+1]==="*"){let f=l.indexOf("*/",c+2);if(f===-1)throw new Error(`Cannot read ${r}: unterminated comment.`);o+=l.slice(c,f+2).replace(/[^\n]/g," "),c=f+2}else o+=h,c+=1}let p="";for(let h=0;h<o.length;h+=1){let f=o[h];if(f==='"'){let d=h+1;for(;d<o.length&&o[d]!=='"';)d+=o[d]==="\\"?2:1;p+=o.slice(h,d+1),h=d;continue}if(f===","){let d=h+1;for(;d<o.length&&/\s/.test(o[d]);)d+=1;if(o[d]==="}"||o[d]==="]")continue}p+=f}try{return p.trim()?JSON.parse(p):{}}catch(h){throw new Error(`Cannot read ${r}: ${h.message}`)}}function ds(s){return fs(oi.readFileSync(s,"utf8"),s)}var Tt=s=>{try{return oi.statSync(s).isFile()}catch{return!1}};function ms(s,r){if(typeof s!="string"||!s)throw new Error('tsconfig "extends" must be a non-empty string.');let o=c=>Tt(c)?c:!c.endsWith(".json")&&Tt(`${c}.json`)?`${c}.json`:null;if(s.startsWith(".")||fe.isAbsolute(s)){let c=o(fe.resolve(r,s));if(c)return c;throw new Error(`File '${s}' not found (tsconfig extends, from ${r}).`)}for(let c=r;;c=fe.dirname(c)){let l=fe.join(c,"node_modules",s),p=o(l);if(p)return p;let h=null;try{h=JSON.parse(oi.readFileSync(fe.join(l,"package.json"),"utf8"))}catch{h=null}if(h&&typeof h.tsconfig=="string"&&Tt(fe.join(l,h.tsconfig)))return fe.join(l,h.tsconfig);if(Tt(fe.join(l,"tsconfig.json")))return fe.join(l,"tsconfig.json");if(fe.dirname(c)===c)break}for(let c of[s,`${s}/tsconfig.json`,`${s}.json`])try{return require.resolve(c,{paths:[r]})}catch{}throw new Error(`File '${s}' not found (tsconfig extends, from ${r}).`)}function gs(s,r,o=new Set){let c=fe.resolve(s);if(o.has(c))throw new Error(`Circularity detected while resolving configuration: ${c}`);let l=new Set(o).add(c),p=ds(c),h=fe.dirname(c),f={},d=p.extends===void 0?[]:Array.isArray(p.extends)?p.extends:[p.extends];for(let I of d)f={...f,...gs(ms(I,h),r,l)};let v=p.compilerOptions&&typeof p.compilerOptions=="object"?p.compilerOptions:{},w=I=>typeof I=="string"?I.replace(/\$\{configDir\}/g,r):I;return typeof v.baseUrl=="string"&&(f.baseUrl=fe.resolve(h,w(v.baseUrl))),v.paths&&typeof v.paths=="object"&&(f.paths=Object.fromEntries(Object.entries(v.paths).map(([I,A])=>[I,Array.isArray(A)?A.map(w):A])),f.pathsBasePath=h),f}function Zr(s){let r=gs(s,fe.dirname(fe.resolve(s)));return r.paths?{base:r.baseUrl||r.pathsBasePath||fe.dirname(s),paths:r.paths}:null}vs.exports={parseJsonc:fs,readJsonc:ds,resolveExtends:ms,readConfigPaths:Zr}});var Ot={};Yt(Ot,{materializeInstallationPath:()=>li,readProjectPaths:()=>ys,resolveCanonicalUiDirectory:()=>bs,resolveConfiguredAlias:()=>Lt});function xs(s){try{return JSON.parse(tt.default.readFileSync(s,"utf8"))}catch{return null}}function ys(s){for(let r of["tsconfig.json","tsconfig.app.json","jsconfig.json"]){let o=me.default.join(s,r);if(!tt.default.existsSync(o))continue;let c=en(o);if(c)return c}return{base:s,paths:{"@/*":[tt.default.existsSync(me.default.join(s,"src"))?"src/*":"*"]}}}function Lt(s,r,o=ys(s)){for(let[c,l]of Object.entries(o.paths)){if(!Array.isArray(l)||typeof l[0]!="string")continue;let[p,h=""]=c.split("*");if(!r.startsWith(p)||!r.endsWith(h)||!c.includes("*")&&r!==c)continue;let f=r.slice(p.length,h?-h.length:void 0);return me.default.resolve(o.base,l[0].replace("*",f))}return r.startsWith("@/")?me.default.resolve(s,tt.default.existsSync(me.default.join(s,"src"))?"src":".",r.slice(2)):me.default.resolve(s,r)}function ui(s,r){let o=me.default.relative(s,r).replace(/\\/g,"/");if(!o||o===".."||o.startsWith("../")||me.default.posix.isAbsolute(o))throw new Error("The canonical ui alias must stay inside the Application root.");return o}function bs(s,r){if(r)return ui(s,Lt(s,r));let c=xs(me.default.join(s,"components.json"))?.aliases?.ui;return typeof c=="string"&&c?ui(s,Lt(s,c)):tt.default.existsSync(me.default.join(s,"src"))?"src/components/ui":"components/ui"}function li(s){if(s.installationLayout==="shadcn"&&/^(?:lib|hooks|components)\//.test(s.path)){let c=xs(me.default.join(s.root,"components.json"))?.aliases||{},l=/^lib\/utils\.[^.]+$/.test(s.path),p=s.path.split("/")[0],h=l&&c.utils?c.utils:c[p]||`@/${p}`,f=Lt(s.root,h);return ui(s.root,l&&c.utils?f+me.default.extname(s.path):me.default.join(f,s.path.slice(p.length+1)))}if(s.source!=="canonical"&&s.installationLayout!=="shadcn"||!s.path.startsWith("ui/"))return s.path;let r=s.path.slice(3);return me.default.posix.join(bs(s.root,s.configuredUiPath),r)}var tt,me,en,mt=Zi(()=>{tt=Ze(require("node:fs")),me=Ze(require("node:path")),{readConfigPaths:en}=ci()});var Ss=Ee((xa,rn)=>{rn.exports={name:"@frontfriend/sdk",version:"1.2.8"}});var Cs=Ee((ya,ks)=>{var{name:nn}=Ss();ks.exports={PACKAGE_NAME:nn}});var pi=Ee((ba,As)=>{var{PACKAGE_NAME:jt}=Cs(),$e=require("fs"),an=require("http"),on=require("https"),ye=require("path"),Vt=["contracts","tokens","components"],cn=["app/globals.css","src/app/globals.css","styles/globals.css","src/styles/globals.css","src/styles.css","src/index.css","src/style.css"],un={next:["next.config.js","next.config.mjs","next.config.ts"],vite:["vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"]},ln=["primereact","@mui/material","antd","@chakra-ui/react","@mantine/core","@fluentui/react"],hn=["style-dictionary","@tokens-studio/sd-transforms","@vanilla-extract/css","styled-components","@emotion/react"];function Is(s){try{return JSON.parse($e.readFileSync(s,"utf8"))}catch{return{}}}function hi(s){if(s===void 0)return null;if(!Array.isArray(s)){let c=new Error("`adopt` in frontfriend.config.js must be an array.");throw c.code="FRONTFRIEND_CONFIG_VALIDATION",c}let r=s.filter(c=>!Vt.includes(c));if(r.length>0){let c=new Error(`Unknown Frontfriend adoption level: ${r.join(", ")}.`);throw c.code="FRONTFRIEND_CONFIG_VALIDATION",c}let o=s.includes("components")?2:s.includes("tokens")?1:0;return Vt.slice(0,o+1)}function pn(s){for(let[r,o]of Object.entries(un)){let c=o.find(p=>$e.existsSync(ye.join(s,p)));if(!c)continue;let l=$e.readFileSync(ye.join(s,c),"utf8");return{buildTool:r,present:l.includes(`${jt}/${r}`)}}return{buildTool:null,present:!1}}function fn(s){let r=[ye.join(s,"components","ui"),ye.join(s,"src","components","ui"),ye.join(s,"app","components","ui")].filter(l=>$e.existsSync(l)),o=new Set;function c(l){for(let p of $e.readdirSync(l,{withFileTypes:!0})){let h=ye.join(l,p.name);if(p.isDirectory())c(h);else if(/\.(js|jsx|ts|tsx|vue)$/.test(p.name)){if(!$e.readFileSync(h,"utf8").includes(jt))continue;let d=ye.basename(p.name,ye.extname(p.name));o.add(d.toLowerCase()==="index"?ye.basename(l):d.toLowerCase())}}}return r.forEach(c),[...o].sort()}function dn(s){let r=Is(ye.join(s,"package.json")),o={...r.dependencies||{},...r.devDependencies||{}},c=o.tailwindcss||null,p=[Is(ye.join(s,"components.json"))?.tailwind?.css,...cn].filter(Boolean).find(d=>$e.existsSync(ye.join(s,d))),h=p?$e.readFileSync(ye.join(s,p),"utf8"):"",f=hn.filter(d=>o[d]);return!f.length&&/:root[\s\S]*--(?:color|spacing|font|radius)-[\w-]+\s*:/.test(h)&&!h.includes(`${jt}/theme.css`)&&f.push("css-custom-properties"),{nativeTokens:{present:h.includes("/* Frontfriend managed native tokens: start */"),file:p||null},tailwind:{present:!!c,version:c,major:c&&Number((String(c).match(/\d+/)||[])[0])||null},componentsJson:$e.existsSync(ye.join(s,"components.json")),themeImport:{present:h.includes(`${jt}/theme.css`)||/@import\s+["'][^"']*node_modules\/\.cache\/frontfriend\/theme\.css["']/.test(h),file:p||null},plugin:pn(s),frontfriendComponents:fn(s),foreignComponentLibraries:ln.filter(d=>o[d]),foreignTokenSystems:f}}function mn(s,r,{baseLibrary:o}={}){let c=hi(s)||Vt,l=c.includes("tokens"),p=c.includes("components"),h=[];return l&&!r.themeImport.present&&!r.nativeTokens?.present&&h.push("Config adopts tokens, but the Frontfriend theme import was not observed."),!l&&r.themeImport.present&&h.push("Frontfriend tokens are present in CSS but are not adopted in config."),p&&o==="shadcn"&&!r.componentsJson&&h.push("Config adopts components, but components.json was not observed."),!p&&r.frontfriendComponents.length>0&&h.push("Frontfriend components are installed but are not adopted in config."),h}function gn({apiUrl:s,token:r,ffId:o,name:c,adopt:l,observed:p,framework:h,primitive:f}){if(!s||!r||!o||!c||!h||f===void 0)return Promise.resolve({reported:!1,unavailable:!0});let d=new URL("/api/apps/sync",s),v=JSON.stringify({ffId:o,name:c,adopt:hi(l),observed:p,runtime:"sdk",framework:h,primitive:f}),w=d.protocol==="https:"?on:an;return new Promise(I=>{let A=w.request(d,{method:"POST",headers:{authorization:`Bearer ${r}`,"content-type":"application/json","content-length":Buffer.byteLength(v)}},B=>{B.resume(),B.on("end",()=>{B.statusCode>=200&&B.statusCode<300?I({reported:!0,unavailable:!1}):I({reported:!1,unavailable:!0})})});A.on("error",()=>I({reported:!1,unavailable:!0})),A.setTimeout(1500,()=>{A.destroy(),I({reported:!1,unavailable:!0})}),A.end(v)})}As.exports={ADOPTION_LEVELS:Vt,normalizeAdopt:hi,probeAdoption:dn,adoptionWarnings:mn,reportAdoption:gn}});var Es=Ee((Ft,_s)=>{(function(s,r){typeof Ft=="object"&&typeof _s<"u"?r(Ft):typeof define=="function"&&define.amd?define(["exports"],r):(s=typeof globalThis<"u"?globalThis:s||self,r(s.acorn={}))})(Ft,function(s){"use strict";var r=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],o=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],c="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",l="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",p={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},h="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",f={5:h,"5module":h+" export import",6:h+" const class extends export import super"},d=/^in(stanceof)?$/,v=new RegExp("["+l+"]"),w=new RegExp("["+l+c+"]");function I(e,t){for(var i=65536,n=0;n<t.length;n+=2){if(i+=t[n],i>e)return!1;if(i+=t[n+1],i>=e)return!0}return!1}function A(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&v.test(String.fromCharCode(e)):t===!1?!1:I(e,o)}function B(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&w.test(String.fromCharCode(e)):t===!1?!1:I(e,o)||I(e,r)}var _=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function T(e,t){return new _(e,{beforeExpr:!0,binop:t})}var R={beforeExpr:!0},E={startsExpr:!0},oe={};function O(e,t){return t===void 0&&(t={}),t.keyword=e,oe[e]=new _(e,t)}var a={num:new _("num",E),regexp:new _("regexp",E),string:new _("string",E),name:new _("name",E),privateId:new _("privateId",E),eof:new _("eof"),bracketL:new _("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new _("]"),braceL:new _("{",{beforeExpr:!0,startsExpr:!0}),braceR:new _("}"),parenL:new _("(",{beforeExpr:!0,startsExpr:!0}),parenR:new _(")"),comma:new _(",",R),semi:new _(";",R),colon:new _(":",R),dot:new _("."),question:new _("?",R),questionDot:new _("?."),arrow:new _("=>",R),template:new _("template"),invalidTemplate:new _("invalidTemplate"),ellipsis:new _("...",R),backQuote:new _("`",E),dollarBraceL:new _("${",{beforeExpr:!0,startsExpr:!0}),eq:new _("=",{beforeExpr:!0,isAssign:!0}),assign:new _("_=",{beforeExpr:!0,isAssign:!0}),incDec:new _("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new _("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:T("||",1),logicalAND:T("&&",2),bitwiseOR:T("|",3),bitwiseXOR:T("^",4),bitwiseAND:T("&",5),equality:T("==/!=/===/!==",6),relational:T("</>/<=/>=",7),bitShift:T("<</>>/>>>",8),plusMin:new _("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:T("%",10),star:T("*",10),slash:T("/",10),starstar:new _("**",{beforeExpr:!0}),coalesce:T("??",1),_break:O("break"),_case:O("case",R),_catch:O("catch"),_continue:O("continue"),_debugger:O("debugger"),_default:O("default",R),_do:O("do",{isLoop:!0,beforeExpr:!0}),_else:O("else",R),_finally:O("finally"),_for:O("for",{isLoop:!0}),_function:O("function",E),_if:O("if"),_return:O("return",R),_switch:O("switch"),_throw:O("throw",R),_try:O("try"),_var:O("var"),_const:O("const"),_while:O("while",{isLoop:!0}),_with:O("with"),_new:O("new",{beforeExpr:!0,startsExpr:!0}),_this:O("this",E),_super:O("super",E),_class:O("class",E),_extends:O("extends",R),_export:O("export"),_import:O("import",E),_null:O("null",E),_true:O("true",E),_false:O("false",E),_in:O("in",{beforeExpr:!0,binop:7}),_instanceof:O("instanceof",{beforeExpr:!0,binop:7}),_typeof:O("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:O("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:O("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},b=/\r\n?|\n|\u2028|\u2029/,j=new RegExp(b.source,"g");function V(e){return e===10||e===13||e===8232||e===8233}function W(e,t,i){i===void 0&&(i=e.length);for(var n=t;n<i;n++){var u=e.charCodeAt(n);if(V(u))return n<i-1&&u===13&&e.charCodeAt(n+1)===10?n+2:n+1}return-1}var Y=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,q=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ee=Object.prototype,xe=ee.hasOwnProperty,nt=ee.toString,re=Object.hasOwn||function(e,t){return xe.call(e,t)},bt=Array.isArray||function(e){return nt.call(e)==="[object Array]"},zt=Object.create(null);function Re(e){return zt[e]||(zt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ue(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var wt=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,S=function(t,i){this.line=t,this.column=i};S.prototype.offset=function(t){return new S(this.line,this.column+t)};var $=function(t,i,n){this.start=i,this.end=n,t.sourceFile!==null&&(this.source=t.sourceFile)};function te(e,t){for(var i=1,n=0;;){var u=W(e,n,t);if(u<0)return new S(i,t-n);++i,n=u}}var Se={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Oe=!1;function ne(e){var t={};for(var i in Se)t[i]=e&&re(e,i)?e[i]:Se[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Oe&&typeof console=="object"&&console.warn&&(Oe=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
7
7
|
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),bt(t.onToken)){var n=t.onToken;t.onToken=function(u){return n.push(u)}}if(bt(t.onComment)&&(t.onComment=Ue(t,t.onComment)),t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function Ue(e,t){return function(i,n,u,m,g,x){var y={type:i?"Block":"Line",value:n,start:u,end:m};e.locations&&(y.loc=new $(this,g,x)),e.ranges&&(y.range=[u,m]),t.push(y)}}var de=1,Q=2,G=4,H=8,be=16,Pe=32,qe=64,Je=128,ae=256,je=512,le=1024,ie=de|Q|ae;function ce(e,t){return Q|(e?G:0)|(t?H:0)}var ke=0,at=1,Ve=2,Ci=3,Ii=4,Ai=5,X=function(t,i,n){this.options=t=ne(t),this.sourceFile=t.sourceFile,this.keywords=Re(f[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var u="";t.allowReserved!==!0&&(u=p[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(u+=" await")),this.reservedWords=Re(u);var m=(u?u+" ":"")+p.strict;this.reservedWordsStrict=Re(m),this.reservedWordsStrictBind=Re(m+" "+p.strictBind),this.input=String(i),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
|
|
8
8
|
`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(b).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=a.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||t.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?Q:de),this.regexpState=null,this.privateNameStack=[]},Ce={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};X.prototype.parse=function(){var t=this,i=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return t.parseTopLevel(i)})},Ce.inFunction.get=function(){return(this.currentVarScope().flags&Q)>0},Ce.inGenerator.get=function(){return(this.currentVarScope().flags&H)>0},Ce.inAsync.get=function(){return(this.currentVarScope().flags&G)>0},Ce.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(ae|je))return!1;if(i&Q)return(i&G)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Ce.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&de)},Ce.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&qe)>0||this.options.allowSuperOutsideMethod},Ce.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Je)>0},Ce.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ce.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(ae|je)||i&Q&&!(i&be))return!0}return!1},Ce.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;return!(t&le||!this.inModule&&t&de)},Ce.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&ae)>0},X.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var n=this,u=0;u<t.length;u++)n=t[u](n);return n},X.parse=function(t,i){return new this(i,t).parse()},X.parseExpressionAt=function(t,i,n){var u=new this(n,t,i);return u.nextToken(),u.parseExpression()},X.tokenizer=function(t,i){return new this(i,t)},Object.defineProperties(X.prototype,Ce);var he=X.prototype,tr=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;he.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){q.lastIndex=e,e+=q.exec(this.input)[0].length;var t=tr.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){q.lastIndex=e+t[0].length;var i=q.exec(this.input),n=i.index+i[0].length,u=this.input.charAt(n);return u===";"||u==="}"||b.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(u)||u==="!"&&this.input.charAt(n+1)==="=")}e+=t[0].length,q.lastIndex=e,e+=q.exec(this.input)[0].length,this.input[e]===";"&&e++}},he.eat=function(e){return this.type===e?(this.next(),!0):!1},he.isContextual=function(e){return this.type===a.name&&this.value===e&&!this.containsEsc},he.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},he.catchStackOverflow=function(e){try{return e()}catch(t){if(t instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(t.message)||/\btoo much recursion\b/i.test(t.message)))this.raise(this.start,"Not enough stack space to parse input");else throw t}},he.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},he.canInsertSemicolon=function(){return this.type===a.eof||this.type===a.braceR||b.test(this.input.slice(this.lastTokEnd,this.start))},he.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},he.semicolon=function(){!this.eat(a.semi)&&!this.insertSemicolon()&&this.unexpected()},he.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},he.expect=function(e){this.eat(e)||this.unexpected()},he.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var St=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};he.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}},he.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,n=e.doubleProto;if(!t)return i>=0||n>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},he.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},he.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var C=X.prototype;C.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==a.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var n=0,u=Object.keys(this.undefinedExports);n<u.length;n+=1){var m=u[n];this.raiseRecoverable(this.undefinedExports[m].start,"Export '"+m+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var Gt={kind:"loop"},ir={kind:"switch"};C.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;q.lastIndex=this.pos;var t=q.exec(this.input),i=this.pos+t[0].length,n=this.fullCharCodeAt(i);if(n===91||n===92)return!0;if(e)return!1;if(n===123)return!0;if(A(n)){var u=i;do i+=n<=65535?1:2;while(B(n=this.fullCharCodeAt(i)));if(n===92)return!0;var m=this.input.slice(u,i);if(!d.test(m))return!0}return!1},C.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;q.lastIndex=this.pos;var e=q.exec(this.input),t=this.pos+e[0].length,i;return!b.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(B(i=this.fullCharCodeAt(t+8))||i===92))},C.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;q.lastIndex=this.pos;var i=q.exec(this.input),n=this.pos+i[0].length;if(b.test(this.input.slice(this.pos,n)))return!1;if(e){var u=n+5,m;if(this.input.slice(n,u)!=="using"||u===this.input.length||B(m=this.fullCharCodeAt(u))||m===92)return!1;q.lastIndex=u;var g=q.exec(this.input);if(n=u+g[0].length,g&&b.test(this.input.slice(u,n)))return!1}var x=this.fullCharCodeAt(n);if(!A(x)&&x!==92)return!1;var y=n;do n+=x<=65535?1:2;while(B(x=this.fullCharCodeAt(n)));if(x===92)return!0;var N=this.input.slice(y,n);if(d.test(N))return!1;if(t&&!e&&N==="of"){q.lastIndex=n;var M=q.exec(this.input);if(n=n+M[0].length,this.input.charCodeAt(n)!==61||(x=this.input.charCodeAt(n+1))===61||x===62)return!1}return!0},C.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},C.isUsing=function(e){return this.isUsingKeyword(!1,e)},C.parseStatement=function(e,t,i){var n=this.type,u=this.startNode(),m;switch(this.isLet(e)&&(n=a._var,m="let"),n){case a._break:case a._continue:return this.parseBreakContinueStatement(u,n.keyword);case a._debugger:return this.parseDebuggerStatement(u);case a._do:return this.parseDoStatement(u);case a._for:return this.parseForStatement(u);case a._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(u,!1,!e);case a._class:return e&&this.unexpected(),this.parseClass(u,!0);case a._if:return this.parseIfStatement(u);case a._return:return this.parseReturnStatement(u);case a._switch:return this.parseSwitchStatement(u);case a._throw:return this.parseThrowStatement(u);case a._try:return this.parseTryStatement(u);case a._const:case a._var:return m=m||this.value,e&&m!=="var"&&this.unexpected(),this.parseVarStatement(u,m);case a._while:return this.parseWhileStatement(u);case a._with:return this.parseWithStatement(u);case a.braceL:return this.parseBlock(!0,u);case a.semi:return this.parseEmptyStatement(u);case a._export:case a._import:if(this.options.ecmaVersion>10&&n===a._import){q.lastIndex=this.pos;var g=q.exec(this.input),x=this.pos+g[0].length,y=this.input.charCodeAt(x);if(y===40||y===46)return this.parseExpressionStatement(u,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===a._import?this.parseImport(u):this.parseExport(u,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(u,!0,!e);var N=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(N)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),e&&this.raise(this.start,"Using declaration is not allowed in single-statement positions"),N==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(u,!1,N),this.semicolon(),this.finishNode(u,"VariableDeclaration");var M=this.value,K=this.parseExpression();return n===a.name&&K.type==="Identifier"&&this.eat(a.colon)?this.parseLabeledStatement(u,M,K,e):this.parseExpressionStatement(u,K)}},C.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(a.semi)||this.insertSemicolon()?e.label=null:this.type!==a.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n<this.labels.length;++n){var u=this.labels[n];if((e.label==null||u.name===e.label.name)&&(u.kind!=null&&(i||u.kind==="loop")||e.label&&i))break}return n===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")},C.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},C.parseDoStatement=function(e){return this.next(),this.labels.push(Gt),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(a._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(a.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},C.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Gt),this.enterScope(0),this.expect(a.parenL),this.type===a.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===a._var||this.type===a._const||i){var n=this.startNode(),u=i?"let":this.value;return this.next(),this.parseVar(n,!0,u),this.finishNode(n,"VariableDeclaration"),this.parseForAfterInit(e,n,t)}var m=this.isContextual("let"),g=!1,x=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(x){var y=this.startNode();return this.next(),x==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(y,!0,x),this.finishNode(y,"VariableDeclaration"),this.parseForAfterInit(e,y,t)}var N=this.containsEsc,M=new St,K=this.start,pe=t>-1?this.parseExprSubscripts(M,"await"):this.parseExpression(!0,M);return this.type===a._in||(g=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===a._in&&this.unexpected(t),e.await=!0):g&&this.options.ecmaVersion>=8&&(pe.start===K&&!N&&pe.type==="Identifier"&&pe.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),m&&g&&this.raise(pe.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(pe,!1,M),this.checkLValPattern(pe),this.parseForIn(e,pe)):(this.checkExpressionErrors(M,!0),t>-1&&this.unexpected(t),this.parseFor(e,pe))},C.parseForAfterInit=function(e,t,i){return(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.type===a._in?((t.kind==="using"||t.kind==="await using")&&!t.declarations[0].init&&this.raise(this.start,"Using declaration is not allowed in for-in loops"),this.options.ecmaVersion>=9&&i>-1&&this.unexpected(i)):this.options.ecmaVersion>=9&&(e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))},C.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,ot|(i?0:Jt),!1,t)},C.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(a._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},C.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(a.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},C.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(a.braceL),this.labels.push(ir),this.enterScope(le);for(var t,i=!1;this.type!==a.braceR;)if(this.type===a._case||this.type===a._default){var n=this.type===a._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(a.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},C.parseThrowStatement=function(e){return this.next(),b.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var sr=[];C.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Pe:0),this.checkLValPattern(e,t?Ii:Ve),this.expect(a.parenR),e},C.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===a._catch){var t=this.startNode();this.next(),this.eat(a.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(a._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},C.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")},C.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Gt),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},C.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},C.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},C.parseLabeledStatement=function(e,t,i,n){for(var u=0,m=this.labels;u<m.length;u+=1){var g=m[u];g.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var x=this.type.isLoop?"loop":this.type===a._switch?"switch":null,y=this.labels.length-1;y>=0;y--){var N=this.labels[y];if(N.statementStart===e.start)N.statementStart=this.start,N.kind=x;else break}return this.labels.push({name:t,kind:x,statementStart:this.start}),e.body=this.parseStatement(n?n.indexOf("label")===-1?n+"label":n:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},C.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},C.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(a.braceL),e&&this.enterScope(0);this.type!==a.braceR;){var n=this.parseStatement(null);t.body.push(n)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},C.parseFor=function(e,t){return e.init=t,this.expect(a.semi),e.test=this.type===a.semi?null:this.parseExpression(),this.expect(a.semi),e.update=this.type===a.parenR?null:this.parseExpression(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},C.parseForIn=function(e,t){var i=this.type===a._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")},C.parseVar=function(e,t,i,n){for(e.declarations=[],e.kind=i;;){var u=this.startNode();if(this.parseVarId(u,i),this.eat(a.eq)?u.init=this.parseMaybeAssign(t):!n&&i==="const"&&!(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!n&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==a._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):!n&&u.id.type!=="Identifier"&&!(t&&(this.type===a._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):u.init=null,e.declarations.push(this.finishNode(u,"VariableDeclarator")),!this.eat(a.comma))break}return e},C.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?at:Ve,!1)};var ot=1,Jt=2,_i=4;C.parseFunction=function(e,t,i,n,u){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===a.star&&t&Jt&&this.unexpected(),e.generator=this.eat(a.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&ot&&(e.id=t&_i&&this.type!==a.name?null:this.parseIdent(),e.id&&!(t&Jt)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?at:Ve:Ci));var m=this.yieldPos,g=this.awaitPos,x=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ce(e.async,e.generator)),t&ot||(e.id=this.type===a.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,u),this.yieldPos=m,this.awaitPos=g,this.awaitIdentPos=x,this.finishNode(e,t&ot?"FunctionDeclaration":"FunctionExpression")},C.parseFunctionParams=function(e){this.expect(a.parenL),e.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},C.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.enterClassBody(),u=this.startNode(),m=!1;for(u.body=[],this.expect(a.braceL);this.type!==a.braceR;){var g=this.parseClassElement(e.superClass!==null);g&&(u.body.push(g),g.type==="MethodDefinition"&&g.kind==="constructor"?(m&&this.raiseRecoverable(g.start,"Duplicate constructor in the same class"),m=!0):g.key&&g.key.type==="PrivateIdentifier"&&rr(n,g)&&this.raiseRecoverable(g.key.start,"Identifier '#"+g.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(u,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},C.parseClassElement=function(e){if(this.eat(a.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),n="",u=!1,m=!1,g="method",x=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(a.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===a.star?x=!0:n="static"}if(i.static=x,!n&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===a.star)&&!this.canInsertSemicolon()?m=!0:n="async"),!n&&(t>=9||!m)&&this.eat(a.star)&&(u=!0),!n&&!m&&!u){var y=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?g=y:n=y)}if(n?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=n,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===a.parenL||g!=="method"||u||m){var N=!i.static&&kt(i,"constructor"),M=N&&e;N&&g!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=N?"constructor":g,this.parseClassMethod(i,u,m,M)}else this.parseClassField(i);return i},C.isClassElementNameStart=function(){return this.type===a.name||this.type===a.privateId||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword},C.parseClassElementName=function(e){this.type===a.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},C.parseClassMethod=function(e,t,i,n){var u=e.key;e.kind==="constructor"?(t&&this.raise(u.start,"Constructor can't be a generator"),i&&this.raise(u.start,"Constructor can't be an async method")):e.static&&kt(e,"prototype")&&this.raise(u.start,"Classes may not have a static property named prototype");var m=e.value=this.parseMethod(t,i,n);return e.kind==="get"&&m.params.length!==0&&this.raiseRecoverable(m.start,"getter should have no params"),e.kind==="set"&&m.params.length!==1&&this.raiseRecoverable(m.start,"setter should have exactly one param"),e.kind==="set"&&m.params[0].type==="RestElement"&&this.raiseRecoverable(m.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},C.parseClassField=function(e){return kt(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&kt(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(a.eq)?(this.enterScope(je|qe),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},C.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ae|qe);this.type!==a.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},C.parseClassId=function(e,t){this.type===a.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Ve,!1)):(t===!0&&this.unexpected(),e.id=null)},C.parseClassSuper=function(e){e.superClass=this.eat(a._extends)?this.parseExprSubscripts(null,!1):null},C.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},C.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var n=this.privateNameStack.length,u=n===0?null:this.privateNameStack[n-1],m=0;m<i.length;++m){var g=i[m];re(t,g.name)||(u?u.used.push(g):this.raiseRecoverable(g.start,"Private field '#"+g.name+"' must be declared in an enclosing class"))}};function rr(e,t){var i=t.key.name,n=e[i],u="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(u=(t.static?"s":"i")+t.kind),n==="iget"&&u==="iset"||n==="iset"&&u==="iget"||n==="sget"&&u==="sset"||n==="sset"&&u==="sget"?(e[i]="true",!1):n?!0:(e[i]=u,!1)}function kt(e,t){var i=e.computed,n=e.key;return!i&&(n.type==="Identifier"&&n.name===t||n.type==="Literal"&&n.value===t)}C.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},C.parseExport=function(e,t){if(this.next(),this.eat(a.star))return this.parseExportAllDeclaration(e,t);if(this.eat(a._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==a.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,n=e.specifiers;i<n.length;i+=1){var u=n[i];this.checkUnreserved(u.local),this.checkLocalExport(u.local),u.local.type==="Literal"&&this.raise(u.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},C.parseExportDeclaration=function(e){return this.parseStatement(null)},C.parseExportDefaultDeclaration=function(){var e;if(this.type===a._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,ot|_i,!1,e)}else if(this.type===a._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var n=this.parseMaybeAssign();return this.semicolon(),n}},C.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),re(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)},C.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var n=0,u=t.properties;n<u.length;n+=1){var m=u[n];this.checkPatternExport(e,m)}else if(i==="ArrayPattern")for(var g=0,x=t.elements;g<x.length;g+=1){var y=x[g];y&&this.checkPatternExport(e,y)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument)},C.checkVariableExport=function(e,t){if(e)for(var i=0,n=t;i<n.length;i+=1){var u=n[i];this.checkPatternExport(e,u.id)}},C.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},C.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},C.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(a.braceL);!this.eat(a.braceR);){if(i)i=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;t.push(this.parseExportSpecifier(e))}return t},C.parseImport=function(e){return this.next(),this.type===a.string?(e.specifiers=sr,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===a.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},C.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,Ve),this.finishNode(e,"ImportSpecifier")},C.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Ve),this.finishNode(e,"ImportDefaultSpecifier")},C.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,Ve),this.finishNode(e,"ImportNamespaceSpecifier")},C.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===a.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(a.comma)))return e;if(this.type===a.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(a.braceL);!this.eat(a.braceR);){if(t)t=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;e.push(this.parseImportSpecifier())}return e},C.parseWithClause=function(){var e=[];if(!this.eat(a._with))return e;this.expect(a.braceL);for(var t={},i=!0;!this.eat(a.braceR);){if(i)i=!1;else if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break;var n=this.parseImportAttribute(),u=n.key.type==="Identifier"?n.key.name:n.key.value;re(t,u)&&this.raiseRecoverable(n.key.start,"Duplicate attribute key '"+u+"'"),t[u]=!0,e.push(n)}return e},C.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(a.colon),this.type!==a.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},C.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===a.string){var e=this.parseLiteral(this.value);return wt.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},C.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},C.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Ie=X.prototype;Ie.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var n=0,u=e.properties;n<u.length;n+=1){var m=u[n];this.toAssignable(m,t),m.type==="RestElement"&&(m.argument.type==="ArrayPattern"||m.argument.type==="ObjectPattern")&&this.raise(m.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e},Ie.toAssignableList=function(e,t){for(var i=e.length,n=0;n<i;n++){var u=e[n];u&&this.toAssignable(u,t)}if(i){var m=e[i-1];this.options.ecmaVersion===6&&t&&m&&m.type==="RestElement"&&m.argument.type!=="Identifier"&&this.unexpected(m.argument.start)}return e},Ie.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},Ie.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==a.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},Ie.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case a.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(a.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case a.braceL:return this.parseObj(!0)}return this.parseIdent()},Ie.parseBindingList=function(e,t,i,n){for(var u=[],m=!0;!this.eat(e);)if(m?m=!1:this.expect(a.comma),t&&this.type===a.comma)u.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===a.ellipsis){var g=this.parseRestBinding();this.parseBindingListItem(g),u.push(g),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else u.push(this.parseAssignableListItem(n))}return u},Ie.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},Ie.parseBindingListItem=function(e){return e},Ie.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(a.eq))return i;var n=this.startNodeAt(e,t);return n.left=i,n.right=this.parseMaybeAssign(),this.finishNode(n,"AssignmentPattern")},Ie.checkLValSimple=function(e,t,i){t===void 0&&(t=ke);var n=t!==ke;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(n?"Binding ":"Assigning to ")+e.name+" in strict mode"),n&&(t===Ve&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(re(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==Ai&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":n&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return n&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(n?"Binding":"Assigning to")+" rvalue")}},Ie.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=ke),e.type){case"ObjectPattern":for(var n=0,u=e.properties;n<u.length;n+=1){var m=u[n];this.checkLValInnerPattern(m,t,i)}break;case"ArrayPattern":for(var g=0,x=e.elements;g<x.length;g+=1){var y=x[g];y&&this.checkLValInnerPattern(y,t,i)}break;default:this.checkLValSimple(e,t,i)}},Ie.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=ke),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var Ae=function(t,i,n,u,m){this.token=t,this.isExpr=!!i,this.preserveSpace=!!n,this.override=u,this.generator=!!m},J={b_stat:new Ae("{",!1),b_expr:new Ae("{",!0),b_tmpl:new Ae("${",!1),p_stat:new Ae("(",!1),p_expr:new Ae("(",!0),q_tmpl:new Ae("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Ae("function",!1),f_expr:new Ae("function",!0),f_expr_gen:new Ae("function",!0,!1,null,!0),f_gen:new Ae("function",!1,!1,null,!0)},Ke=X.prototype;Ke.initialContext=function(){return[J.b_stat]},Ke.curContext=function(){return this.context[this.context.length-1]},Ke.braceIsBlock=function(e){var t=this.curContext();return t===J.f_expr||t===J.f_stat?!0:e===a.colon&&(t===J.b_stat||t===J.b_expr)?!t.isExpr:e===a._return||e===a.name&&this.exprAllowed?b.test(this.input.slice(this.lastTokEnd,this.start)):e===a._else||e===a.semi||e===a.eof||e===a.parenR||e===a.arrow?!0:e===a.braceL?t===J.b_stat:e===a._var||e===a._const||e===a.name?!1:!this.exprAllowed},Ke.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1},Ke.updateContext=function(e){var t,i=this.type;i.keyword&&e===a.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr},Ke.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},a.parenR.updateContext=a.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===J.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},a.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?J.b_stat:J.b_expr),this.exprAllowed=!0},a.dollarBraceL.updateContext=function(){this.context.push(J.b_tmpl),this.exprAllowed=!0},a.parenL.updateContext=function(e){var t=e===a._if||e===a._for||e===a._with||e===a._while;this.context.push(t?J.p_stat:J.p_expr),this.exprAllowed=!0},a.incDec.updateContext=function(){},a._function.updateContext=a._class.updateContext=function(e){e.beforeExpr&&e!==a._else&&!(e===a.semi&&this.curContext()!==J.p_stat)&&!(e===a._return&&b.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===a.colon||e===a.braceL)&&this.curContext()===J.b_stat)?this.context.push(J.f_expr):this.context.push(J.f_stat),this.exprAllowed=!1},a.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},a.backQuote.updateContext=function(){this.curContext()===J.q_tmpl?this.context.pop():this.context.push(J.q_tmpl),this.exprAllowed=!1},a.star.updateContext=function(e){if(e===a._function){var t=this.context.length-1;this.context[t]===J.f_expr?this.context[t]=J.f_expr_gen:this.context[t]=J.f_gen}this.exprAllowed=!0},a.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==a.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var L=X.prototype;L.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var n=e.key,u;switch(n.type){case"Identifier":u=n.name;break;case"Literal":u=String(n.value);break;default:return}var m=e.kind;if(this.options.ecmaVersion>=6){u==="__proto__"&&m==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=n.start):this.raiseRecoverable(n.start,"Redefinition of __proto__ property")),t.proto=!0);return}u="$"+u;var g=t[u];if(g){var x;m==="init"?x=this.strict&&g.init||g.get||g.set:x=g.init||g[m],x&&this.raiseRecoverable(n.start,"Redefinition of property")}else g=t[u]={init:!1,get:!1,set:!1};g[m]=!0}},L.parseExpression=function(e,t){var i=this;return this.catchStackOverflow(function(){var n=i.start,u=i.startLoc,m=i.parseMaybeAssign(e,t);if(i.type===a.comma){var g=i.startNodeAt(n,u);for(g.expressions=[m];i.eat(a.comma);)g.expressions.push(i.parseMaybeAssign(e,t));return i.finishNode(g,"SequenceExpression")}return m})},L.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var n=!1,u=-1,m=-1,g=-1;t?(u=t.parenthesizedAssign,m=t.trailingComma,g=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new St,n=!0);var x=this.start,y=this.startLoc;(this.type===a.parenL||this.type===a.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var N=this.parseMaybeConditional(e,t);if(i&&(N=i.call(this,N,x,y)),this.type.isAssign){var M=this.startNodeAt(x,y);return M.operator=this.value,this.type===a.eq&&(N=this.toAssignable(N,!1,t)),n||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=N.start&&(t.shorthandAssign=-1),this.type===a.eq?this.checkLValPattern(N):this.checkLValSimple(N),M.left=N,this.next(),M.right=this.parseMaybeAssign(e),g>-1&&(t.doubleProto=g),this.finishNode(M,"AssignmentExpression")}else n&&this.checkExpressionErrors(t,!0);return u>-1&&(t.parenthesizedAssign=u),m>-1&&(t.trailingComma=m),N},L.parseMaybeConditional=function(e,t){var i=this.start,n=this.startLoc,u=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return u;if(!(u.type==="ArrowFunctionExpression"&&u.start===i)&&this.eat(a.question)){var m=this.startNodeAt(i,n);return m.test=u,m.consequent=this.parseMaybeAssign(),this.expect(a.colon),m.alternate=this.parseMaybeAssign(e),this.finishNode(m,"ConditionalExpression")}return u},L.parseExprOps=function(e,t){var i=this.start,n=this.startLoc,u=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||u.start===i&&u.type==="ArrowFunctionExpression"?u:this.parseExprOp(u,i,n,-1,e)},L.parseExprOp=function(e,t,i,n,u){var m=this.type.binop;if(m!=null&&(!u||this.type!==a._in)&&m>n){var g=this.type===a.logicalOR||this.type===a.logicalAND,x=this.type===a.coalesce;x&&(m=a.logicalAND.binop);var y=this.value;this.next();var N=this.start,M=this.startLoc,K=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,u),N,M,m,u),pe=this.buildBinary(t,i,e,K,y,g||x);return(g&&this.type===a.coalesce||x&&(this.type===a.logicalOR||this.type===a.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(pe,t,i,n,u)}return e},L.buildBinary=function(e,t,i,n,u,m){n.type==="PrivateIdentifier"&&this.raise(n.start,"Private identifier can only be left side of binary expression");var g=this.startNodeAt(e,t);return g.left=i,g.operator=u,g.right=n,this.finishNode(g,m?"LogicalExpression":"BinaryExpression")},L.parseMaybeUnary=function(e,t,i,n){var u=this.start,m=this.startLoc,g;if(this.isContextual("await")&&this.canAwait)g=this.parseAwait(n),t=!0;else if(this.type.prefix){var x=this.startNode(),y=this.type===a.incDec;x.operator=this.value,x.prefix=!0,this.next(),x.argument=this.parseMaybeUnary(null,!0,y,n),this.checkExpressionErrors(e,!0),y?this.checkLValSimple(x.argument):this.strict&&x.operator==="delete"&&Ei(x.argument)?this.raiseRecoverable(x.start,"Deleting local variable in strict mode"):x.operator==="delete"&&Kt(x.argument)?this.raiseRecoverable(x.start,"Private fields can not be deleted"):t=!0,g=this.finishNode(x,y?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===a.privateId)(n||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),g=this.parsePrivateIdent(),this.type!==a._in&&this.unexpected();else{if(g=this.parseExprSubscripts(e,n),this.checkExpressionErrors(e))return g;for(;this.type.postfix&&!this.canInsertSemicolon();){var N=this.startNodeAt(u,m);N.operator=this.value,N.prefix=!1,N.argument=g,this.checkLValSimple(g),this.next(),g=this.finishNode(N,"UpdateExpression")}}if(!i&&this.eat(a.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(u,m,g,this.parseMaybeUnary(null,!1,!1,n),"**",!1);else return g};function Ei(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Ei(e.expression)}function Kt(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Kt(e.expression)||e.type==="ParenthesizedExpression"&&Kt(e.expression)}L.parseExprSubscripts=function(e,t){var i=this.start,n=this.startLoc,u=this.parseExprAtom(e,t);if(u.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return u;var m=this.parseSubscripts(u,i,n,!1,t);return e&&m.type==="MemberExpression"&&(e.parenthesizedAssign>=m.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=m.start&&(e.parenthesizedBind=-1),e.trailingComma>=m.start&&(e.trailingComma=-1)),m},L.parseSubscripts=function(e,t,i,n,u){for(var m=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,g=!1;;){var x=this.parseSubscript(e,t,i,n,m,g,u);if(x.optional&&(g=!0),x===e||x.type==="ArrowFunctionExpression"){if(g){var y=this.startNodeAt(t,i);y.expression=x,x=this.finishNode(y,"ChainExpression")}return x}e=x}},L.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(a.arrow)},L.parseSubscriptAsyncArrow=function(e,t,i,n){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,n)},L.parseSubscript=function(e,t,i,n,u,m,g){var x=this.options.ecmaVersion>=11,y=x&&this.eat(a.questionDot);n&&y&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var N=this.eat(a.bracketL);if(N||y&&this.type!==a.parenL&&this.type!==a.backQuote||this.eat(a.dot)){var M=this.startNodeAt(t,i);M.object=e,N?(M.property=this.parseExpression(),this.expect(a.bracketR)):this.type===a.privateId&&e.type!=="Super"?M.property=this.parsePrivateIdent():M.property=this.parseIdent(this.options.allowReserved!=="never"),M.computed=!!N,x&&(M.optional=y),e=this.finishNode(M,"MemberExpression")}else if(!n&&this.eat(a.parenL)){var K=new St,pe=this.yieldPos,lt=this.awaitPos,Qe=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Et=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1,K);if(u&&!y&&this.shouldParseAsyncArrow())return this.checkPatternErrors(K,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=pe,this.awaitPos=lt,this.awaitIdentPos=Qe,this.parseSubscriptAsyncArrow(t,i,Et,g);this.checkExpressionErrors(K,!0),this.yieldPos=pe||this.yieldPos,this.awaitPos=lt||this.awaitPos,this.awaitIdentPos=Qe||this.awaitIdentPos;var Ye=this.startNodeAt(t,i);Ye.callee=e,Ye.arguments=Et,x&&(Ye.optional=y),e=this.finishNode(Ye,"CallExpression")}else if(this.type===a.backQuote){(y||m)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Xe=this.startNodeAt(t,i);Xe.tag=e,Xe.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(Xe,"TaggedTemplateExpression")}return e},L.parseExprAtom=function(e,t,i){this.type===a.slash&&this.readRegexp();var n,u=this.potentialArrowAt===this.start;switch(this.type){case a._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),n=this.startNode(),this.next(),this.type===a.parenL&&!this.allowDirectSuper&&this.raise(n.start,"super() call outside constructor of a subclass"),this.type!==a.dot&&this.type!==a.bracketL&&this.type!==a.parenL&&this.unexpected(),this.finishNode(n,"Super");case a._this:return n=this.startNode(),this.next(),this.finishNode(n,"ThisExpression");case a.name:var m=this.start,g=this.startLoc,x=this.containsEsc,y=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!x&&y.name==="async"&&!this.canInsertSemicolon()&&this.eat(a._function))return this.overrideContext(J.f_expr),this.parseFunction(this.startNodeAt(m,g),0,!1,!0,t);if(u&&!this.canInsertSemicolon()){if(this.eat(a.arrow))return this.parseArrowExpression(this.startNodeAt(m,g),[y],!1,t);if(this.options.ecmaVersion>=8&&y.name==="async"&&this.type===a.name&&!x&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return y=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(a.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(m,g),[y],!0,t)}return y;case a.regexp:var N=this.value;return n=this.parseLiteral(N.value),n.regex={pattern:N.pattern,flags:N.flags},n;case a.num:case a.string:return this.parseLiteral(this.value);case a._null:case a._true:case a._false:return n=this.startNode(),n.value=this.type===a._null?null:this.type===a._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case a.parenL:var M=this.start,K=this.parseParenAndDistinguishExpression(u,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(K)&&(e.parenthesizedAssign=M),e.parenthesizedBind<0&&(e.parenthesizedBind=M)),K;case a.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(a.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case a.braceL:return this.overrideContext(J.b_expr),this.parseObj(!1,e);case a._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case a._class:return this.parseClass(this.startNode(),!1);case a._new:return this.parseNew();case a.backQuote:return this.parseTemplate();case a._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}},L.parseExprAtomDefault=function(){this.unexpected()},L.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===a.parenL&&!e)return this.parseDynamicImport(t);if(this.type===a.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected()},L.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(a.parenR)?e.options=null:(this.expect(a.comma),this.afterTrailingComma(a.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(a.parenR)||(this.expect(a.comma),this.afterTrailingComma(a.parenR)||this.unexpected())));else if(!this.eat(a.parenR)){var t=this.start;this.eat(a.comma)&&this.eat(a.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},L.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},L.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},L.parseParenExpression=function(){this.expect(a.parenL);var e=this.parseExpression();return this.expect(a.parenR),e},L.shouldParseArrow=function(e){return!this.canInsertSemicolon()},L.parseParenAndDistinguishExpression=function(e,t){var i=this.start,n=this.startLoc,u,m=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var g=this.start,x=this.startLoc,y=[],N=!0,M=!1,K=new St,pe=this.yieldPos,lt=this.awaitPos,Qe;for(this.yieldPos=0,this.awaitPos=0;this.type!==a.parenR;)if(N?N=!1:this.expect(a.comma),m&&this.afterTrailingComma(a.parenR,!0)){M=!0;break}else if(this.type===a.ellipsis){Qe=this.start,y.push(this.parseParenItem(this.parseRestBinding())),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else y.push(this.parseMaybeAssign(!1,K,this.parseParenItem));var Et=this.lastTokEnd,Ye=this.lastTokEndLoc;if(this.expect(a.parenR),e&&this.shouldParseArrow(y)&&this.eat(a.arrow))return this.checkPatternErrors(K,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=pe,this.awaitPos=lt,this.parseParenArrowList(i,n,y,t);(!y.length||M)&&this.unexpected(this.lastTokStart),Qe&&this.unexpected(Qe),this.checkExpressionErrors(K,!0),this.yieldPos=pe||this.yieldPos,this.awaitPos=lt||this.awaitPos,y.length>1?(u=this.startNodeAt(g,x),u.expressions=y,this.finishNodeAt(u,"SequenceExpression",Et,Ye)):u=y[0]}else u=this.parseParenExpression();if(this.options.preserveParens){var Xe=this.startNodeAt(i,n);return Xe.expression=u,this.finishNode(Xe,"ParenthesizedExpression")}else return u},L.parseParenItem=function(e){return e},L.parseParenArrowList=function(e,t,i,n){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,n)};var nr=[];L.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===a.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,u=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,u,!0,!1),e.callee.type==="Super"&&this.raiseRecoverable(n,"Invalid use of 'super'"),this.eat(a.parenL)?e.arguments=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1):e.arguments=nr,this.finishNode(e,"NewExpression")},L.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===a.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
|
|
9
9
|
`),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|