@frontfriend/sdk 1.0.0 → 1.1.0
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 +14 -3
- package/dist/cli.js +154 -154
- package/dist/lib/core/adoption.js +1 -1
- package/dist/lib/core/api-client.js +1 -1
- package/dist/lib/core/application-adoption.js +1 -1
- package/dist/lib/core/credentials.js +2 -2
- package/dist/lib/core/token-artifact-client.js +6 -6
- package/dist/lib/core/token-artifact.d.ts +12 -0
- package/dist/lib/core/token-artifact.js +1 -1
- package/dist/mcp.cjs +3 -3
- package/dist/next.js +1 -1
- package/dist/package.json +1 -1
- package/dist/vite.js +1 -1
- package/package.json +13 -15
|
@@ -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.
|
|
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.1.0"}});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"),i=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 o=n.includes("components")?2:n.includes("tokens")?1:0;return g.slice(0,o+1)}function _(n){for(let[e,o]of Object.entries(k)){let t=o.find(s=>u.existsSync(i.join(n,s)));if(!t)continue;let r=u.readFileSync(i.join(n,t),"utf8");return{buildTool:e,present:r.includes(`${m}/${e}`)}}return{buildTool:null,present:!1}}function v(n){let e=[i.join(n,"components","ui"),i.join(n,"src","components","ui"),i.join(n,"app","components","ui")].filter(r=>u.existsSync(r)),o=new Set;function t(r){for(let s of u.readdirSync(r,{withFileTypes:!0})){let c=i.join(r,s.name);if(s.isDirectory())t(c);else if(/\.(js|jsx|ts|tsx|vue)$/.test(s.name)){if(!u.readFileSync(c,"utf8").includes(m))continue;let a=i.basename(s.name,i.extname(s.name));o.add(a.toLowerCase()==="index"?i.basename(r):a.toLowerCase())}}}return e.forEach(t),[...o].sort()}function P(n){let e=A(i.join(n,"package.json")),o={...e.dependencies||{},...e.devDependencies||{}},t=o.tailwindcss||null,s=[A(i.join(n,"components.json"))?.tailwind?.css,...T].filter(Boolean).find(a=>u.existsSync(i.join(n,a))),c=s?u.readFileSync(i.join(n,s),"utf8"):"",l=I.filter(a=>o[a]);return!l.length&&/:root[\s\S]*--(?:color|spacing|font|radius)-[\w-]+\s*:/.test(c)&&!c.includes(`${m}/theme.css`)&&l.push("css-custom-properties"),{nativeTokens:{present:c.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(i.join(n,"components.json")),themeImport:{present:c.includes(`${m}/theme.css`)||/@import\s+["'][^"']*node_modules\/\.cache\/frontfriend\/theme\.css["']/.test(c),file:s||null},plugin:_(n),frontfriendComponents:v(n),foreignComponentLibraries:x.filter(a=>o[a]),foreignTokenSystems:l}}function D(n,e){let o=h(n)||g,t=o.includes("tokens"),r=o.includes("components"),s=[];return t&&!e.themeImport.present&&!e.nativeTokens?.present&&s.push("Config adopts tokens, but the Frontfriend theme import was not observed."),!t&&e.themeImport.present&&s.push("Frontfriend tokens are present in CSS but are not adopted in config."),r&&!e.componentsJson&&s.push("Config adopts components, but components.json was not observed."),!r&&e.frontfriendComponents.length>0&&s.push("Frontfriend components are installed but are not adopted in config."),s}function L({apiUrl:n,token:e,ffId:o,name:t,adopt:r,observed:s,framework:c,primitive:l}){if(!n||!e||!o||!t||!c||l===void 0)return Promise.resolve({reported:!1,unavailable:!0});let a=new URL("/api/apps/sync",n),y=JSON.stringify({ffId:o,name:t,adopt:h(r),observed:s,runtime:"sdk",framework:c,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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var W=m((Ha,st)=>{var pn="https://app.frontfriend.dev",mn=".cache/frontfriend",En={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"]},gn={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function $n(t){if(!t)return null;try{let e=new URL(t);return e.hostname.startsWith("app.")?`${e.protocol}//${e.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}st.exports={DEFAULT_API_URL:pn,CACHE_DIR_NAME:mn,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:En,ENV_VARS:gn,deriveRegistryFromApiUrl:$n}});var we=m((Va,nt)=>{var me=class extends Error{constructor(e,r,s){super(e),this.name="APIError",this.statusCode=r,this.url=s,this.code=`API_${r}`}},Ee=class extends Error{constructor(e,r){super(e),this.name="CacheError",this.operation=r,this.code=`CACHE_${r.toUpperCase()}`}},ge=class extends Error{constructor(e,r){super(e),this.name="ConfigError",this.field=r,this.code=r?`CONFIG_${String(r).toUpperCase()}`:"CONFIG_ERROR"}},$e=class extends Error{constructor(e,r){super(e),this.name="ProcessingError",this.token=r,this.code="PROCESSING_ERROR"}};nt.exports={APIError:me,CacheError:Ee,ConfigError:ge,ProcessingError:$e}});var ot=m((Xa,it)=>{var R=require("fs");function wn(t){try{let e=R.readFileSync(t,"utf8");return JSON.parse(e)}catch(e){if(e.code==="ENOENT")return null;throw e}}function Rn(t){try{return R.readFileSync(t,"utf8").replace(/^\uFEFF/,"")}catch(e){if(e.code==="ENOENT")return null;throw e}}function In(t,e,r=2){let s=JSON.stringify(e,null,r);R.writeFileSync(t,s,"utf8")}function Sn(t,e){R.writeFileSync(t,e,"utf8")}function yn(t,e){if(e==null||typeof e=="object"&&Object.keys(e).length===0||Array.isArray(e)&&e.length===0){let s=`module.exports = ${Array.isArray(e)?"[]":"{}"};`;R.writeFileSync(t,s,"utf8")}else{let r=`module.exports = ${JSON.stringify(e,null,2)};`;R.writeFileSync(t,r,"utf8")}}function Tn(t){return R.existsSync(t)}function Nn(t){R.mkdirSync(t,{recursive:!0})}function An(t){R.rmSync(t,{recursive:!0,force:!0})}function Ln(t){R.rmSync(t,{force:!0})}function On(t,e){R.mkdirSync(require("path").dirname(t),{recursive:!0,mode:448});let r=`${t}.${process.pid}.${Date.now()}.tmp`;try{R.writeFileSync(r,`${JSON.stringify(e,null,2)}
|
|
2
|
-
`,{mode:384}),R.renameSync(r,t);try{R.chmodSync(t,384)}catch{}}finally{R.rmSync(r,{force:!0})}}async function Cn(t,e,r){R.mkdirSync(require("path").dirname(t),{recursive:!0,mode:448});let s=`${t}.lock`,n=Date.now()+2e4,i;for(;i===void 0;)try{i=R.openSync(s,"wx",384),R.writeFileSync(i,String(process.pid))}catch(o){if(o.code!=="EEXIST")throw o;try{let a=Number(R.readFileSync(s,"utf8"));if(Number.isInteger(a)&&a>0)try{process.kill(a,0)}catch(c){if(c.code==="ESRCH"){R.unlinkSync(s);continue}}}catch(a){if(a.code==="ENOENT")continue}if(Date.now()>=n)throw r();await new Promise(a=>setTimeout(a,50))}try{return await e()}finally{R.closeSync(i),R.unlinkSync(s)}}it.exports={writePrivateJsonFileAtomic:On,withPrivateFileLock:Cn,readJsonFileSafe:wn,readFileSafe:Rn,writeJsonFile:In,writeTextFile:Sn,writeModuleExportsFile:yn,fileExists:Tn,ensureDirectoryExists:Nn,removeDirectory:An,removeFile:Ln}});var dt=m((Ja,ht)=>{var{fileExists:vn,readJsonFileSafe:qn,removeFile:xn,writePrivateJsonFileAtomic:Pn,withPrivateFileLock:Fn}=ot(),ct=require("path"),kn=require("os"),Dn=require("https"),_n=require("http"),{URL:F}=require("url"),{DEFAULT_API_URL:D}=W(),Un=ct.join(kn.homedir(),".frontfriend"),_=ct.join(Un,"credentials");function bn(){return _}function z(){try{return qn(_)}catch{return null}}function at(t){try{let e=JSON.parse(Buffer.from(String(t).split(".")[1],"base64url").toString("utf8"));return typeof e.email=="string"?e.email:null}catch{return null}}function jn(){let t=z();if(!t||!t.accessToken)return null;let e=Number(t.refreshExpiresAt)||0;return{email:at(t.accessToken),apiUrl:t.ffApiUrl||null,expired:e>0&&e<Date.now()}}function ut(t){Pn(_,t)}function Gn(){return vn(_)?(xn(_),!0):!1}function Re(t,e=60*1e3){return!t?.accessToken||!t.expiresAt||Date.now()+e>=t.expiresAt}function P(t){let e=new Error(`${t}. Run \`frontfriend login\` to re-authenticate.`);return e.code="FF_AUTH_REFRESH_FAILED",e}function lt(t,e,r){return new Promise((s,n)=>{let i=new F(t);if(i.protocol!=="https:"&&!(i.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(i.hostname))){n(new Error("Frontfriend API URLs require HTTPS except on localhost"));return}let o=i.protocol==="https:"?Dn:_n,a=JSON.stringify(e||{}),c=o.request({hostname:i.hostname,port:i.port,path:`${i.pathname}${i.search}`,method:"POST",headers:{"content-type":"application/json","content-length":Buffer.byteLength(a),...r?{authorization:`Bearer ${r}`}:{}}},u=>{let l="";u.on("data",h=>{l+=h}),u.on("end",()=>{if(u.statusCode>=300&&u.statusCode<400){let E=u.headers.location?` to ${u.headers.location}`:"",f=new Error(`HTTP ${u.statusCode}: redirected${E}`);f.statusCode=u.statusCode,f.body=l,n(f);return}let h=null;try{h=l?JSON.parse(l):null}catch{let f=u.headers["content-type"]||"unknown content-type",I=new Error(`Expected JSON from FrontFriend API at ${t}, but received ${f} (HTTP ${u.statusCode}). Check FF_API_URL or pass --api-url with the FrontFriend app URL.`);if(I.statusCode=u.statusCode,I.body=l,u.statusCode>=400){n(I);return}n(I);return}if(u.statusCode>=400){let E=new Error(h?.error_description||h?.error||`HTTP ${u.statusCode}`);E.statusCode=u.statusCode,E.body=h,n(E);return}s(h)})});c.setTimeout(15e3,()=>c.destroy(new Error("Frontfriend API request timed out"))),c.on("error",n),c.write(a),c.end()})}async function Mn(t){return Fn(_,t,()=>P("Another process is refreshing the session"))}async function ft(t,e=D){return Mn(async()=>{let r=z();if(r&&new F(r.ffApiUrl||D).origin===new F(e).origin){if(!Re(r))return r;t=r}return Hn(t,e)})}async function Hn(t,e=D){if(new F(e).origin!==new F(t.ffApiUrl||D).origin)throw P("The stored session belongs to a different API origin");if(!t?.refreshToken||!t?.deviceId)throw P("FrontFriend session expired");let r;try{r=await lt(`${e}/api/plugin/token`,{grant_type:"refresh_token",refresh_token:t.refreshToken,device_id:t.deviceId})}catch(n){throw P(n?.message||"Could not refresh FrontFriend session")}if(!r?.access_token||!r?.refresh_token)throw P("Could not refresh FrontFriend session");let s={accessToken:r.access_token,refreshToken:r.refresh_token,deviceId:r.device_id||t.deviceId,expiresAt:Date.now()+(r.expires_in||900)*1e3,refreshExpiresAt:Date.now()+(r.refresh_expires_in||604800)*1e3,ffApiUrl:e};return ut(s),s}async function Vn(t={}){if(t.envToken)return t.envToken;if(!t.skipCredentials){let e=z();if(e?.accessToken||e?.refreshToken){let r=t.baseURL||e.ffApiUrl||D;if(new F(r).origin!==new F(e.ffApiUrl||D).origin)throw P("The stored session belongs to a different API origin");return e.accessToken&&!Re(e)?e.accessToken:(await ft(e,r)).accessToken}}return t.configuredToken?(t.silent||console.warn("\u26A0\uFE0F auth-token in frontfriend.config.js is deprecated. Run `frontfriend login` to store credentials outside the repo."),t.configuredToken):null}ht.exports={accountEmail:at,signedInAccount:jn,getCredentialsPath:bn,readCredentials:z,writeCredentials:ut,deleteCredentials:Gn,isExpired:Re,postJson:lt,refreshCredentials:ft,resolveAuthToken:Vn,createAuthRefreshError:P}});var Rt=m((Ba,wt)=>{var{ConfigError:Xn}=we(),{DEFAULT_API_URL:Jn}=W(),pt="DESIGN_SYSTEM_REQUIRED",Ie="DESIGN_SYSTEM_NOT_FOUND",mt="DESIGN_SYSTEM_FORBIDDEN",Et="DESIGN_SYSTEM_OPERATION_DENIED",Bn=new Set(["TENANT_MISMATCH","RESOURCE_MISMATCH","UNAUTHENTICATED"]);function gt(t){return String(t||Jn).replace(/\/+$/,"")}function Yn({apiUrl:t,flagHint:e}){return[` 1. Create a Design System at ${gt(t)} (or open an existing one) and copy its ff-id.`," 2. Connect it to this project:"," npx frontfriend login"," npx frontfriend setup --ff-id <ff-id>",` or add "ff-id": "<ff-id>" to frontfriend.config.js${e?`, ${e}`:""}.`]}function $t({command:t,apiUrl:e,flagHint:r,reportOnly:s=!1}={}){return["\u{1F517} No Design System connected to this project.",` ${t?`\`frontfriend ${t}\` works`:"Frontfriend works"} on a Design System (ff-id), and frontfriend.config.js has none yet.`," Connect one first:",...Yn({apiUrl:e,flagHint:r}),...s?[]:[" Nothing in this project was changed."]]}var K=class extends Xn{constructor({command:e,apiUrl:r,flagHint:s}={}){let n=$t({command:e,apiUrl:r,flagHint:s});super(n.join(`
|
|
2
|
+
`,{mode:384}),R.renameSync(r,t);try{R.chmodSync(t,384)}catch{}}finally{R.rmSync(r,{force:!0})}}async function Cn(t,e,r){R.mkdirSync(require("path").dirname(t),{recursive:!0,mode:448});let s=`${t}.lock`,n=Date.now()+2e4,i;for(;i===void 0;)try{i=R.openSync(s,"wx",384),R.writeFileSync(i,String(process.pid))}catch(o){if(o.code!=="EEXIST")throw o;try{let a=Number(R.readFileSync(s,"utf8"));if(Number.isInteger(a)&&a>0)try{process.kill(a,0)}catch(c){if(c.code==="ESRCH"){R.unlinkSync(s);continue}}}catch(a){if(a.code==="ENOENT")continue}if(Date.now()>=n)throw r();await new Promise(a=>setTimeout(a,50))}try{return await e()}finally{R.closeSync(i),R.unlinkSync(s)}}it.exports={writePrivateJsonFileAtomic:On,withPrivateFileLock:Cn,readJsonFileSafe:wn,readFileSafe:Rn,writeJsonFile:In,writeTextFile:Sn,writeModuleExportsFile:yn,fileExists:Tn,ensureDirectoryExists:Nn,removeDirectory:An,removeFile:Ln}});var dt=m((Ja,ht)=>{var{fileExists:vn,readJsonFileSafe:qn,removeFile:xn,writePrivateJsonFileAtomic:Pn,withPrivateFileLock:Fn}=ot(),ct=require("path"),kn=require("os"),Dn=require("https"),_n=require("http"),{URL:F}=require("url"),{DEFAULT_API_URL:D}=W(),Un=ct.join(kn.homedir(),".frontfriend"),_=ct.join(Un,"credentials");function bn(){return _}function z(){try{return qn(_)}catch{return null}}function at(t){try{let e=JSON.parse(Buffer.from(String(t).split(".")[1],"base64url").toString("utf8"));return typeof e.email=="string"?e.email:null}catch{return null}}function jn(){let t=z();if(!t||!t.accessToken)return null;let e=Number(t.refreshExpiresAt)||0;return{email:at(t.accessToken),apiUrl:t.ffApiUrl||null,expired:e>0&&e<Date.now()}}function ut(t){Pn(_,t)}function Gn(){return vn(_)?(xn(_),!0):!1}function Re(t,e=60*1e3){return!t?.accessToken||!t.expiresAt||Date.now()+e>=t.expiresAt}function P(t){let e=new Error(`${t}. Run \`frontfriend login\` to re-authenticate.`);return e.code="FF_AUTH_REFRESH_FAILED",e}function lt(t,e,r){return new Promise((s,n)=>{let i=new F(t);if(i.protocol!=="https:"&&!(i.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(i.hostname))){n(new Error("Frontfriend API URLs require HTTPS except on localhost"));return}let o=i.protocol==="https:"?Dn:_n,a=JSON.stringify(e||{}),c=o.request({hostname:i.hostname,port:i.port,path:`${i.pathname}${i.search}`,method:"POST",headers:{"content-type":"application/json","content-length":Buffer.byteLength(a),...r?{authorization:`Bearer ${r}`}:{}}},u=>{let l="";u.on("data",h=>{l+=h}),u.on("end",()=>{if(u.statusCode>=300&&u.statusCode<400){let E=u.headers.location?` to ${u.headers.location}`:"",f=new Error(`HTTP ${u.statusCode}: redirected${E}`);f.statusCode=u.statusCode,f.body=l,n(f);return}let h=null;try{h=l?JSON.parse(l):null}catch{let f=u.headers["content-type"]||"unknown content-type",I=new Error(`Expected JSON from FrontFriend API at ${t}, but received ${f} (HTTP ${u.statusCode}). Check FF_API_URL or pass --api-url with the FrontFriend app URL.`);if(I.statusCode=u.statusCode,I.body=l,u.statusCode>=400){n(I);return}n(I);return}if(u.statusCode>=400){let E=new Error(h?.error_description||h?.error||`HTTP ${u.statusCode}`);E.statusCode=u.statusCode,E.body=h,n(E);return}s(h)})});c.setTimeout(15e3,()=>c.destroy(Object.assign(new Error("Frontfriend API request timed out"),{code:"ETIMEDOUT"}))),c.on("error",n),c.write(a),c.end()})}async function Mn(t){return Fn(_,t,()=>P("Another process is refreshing the session"))}async function ft(t,e=D){return Mn(async()=>{let r=z();if(r&&new F(r.ffApiUrl||D).origin===new F(e).origin){if(!Re(r))return r;t=r}return Hn(t,e)})}async function Hn(t,e=D){if(new F(e).origin!==new F(t.ffApiUrl||D).origin)throw P("The stored session belongs to a different API origin");if(!t?.refreshToken||!t?.deviceId)throw P("FrontFriend session expired");let r;try{r=await lt(`${e}/api/plugin/token`,{grant_type:"refresh_token",refresh_token:t.refreshToken,device_id:t.deviceId})}catch(n){throw Object.assign(P(n?.message||"Could not refresh FrontFriend session"),{cause:n})}if(!r?.access_token||!r?.refresh_token)throw P("Could not refresh FrontFriend session");let s={accessToken:r.access_token,refreshToken:r.refresh_token,deviceId:r.device_id||t.deviceId,expiresAt:Date.now()+(r.expires_in||900)*1e3,refreshExpiresAt:Date.now()+(r.refresh_expires_in||604800)*1e3,ffApiUrl:e};return ut(s),s}async function Vn(t={}){if(t.envToken)return t.envToken;if(!t.skipCredentials){let e=z();if(e?.accessToken||e?.refreshToken){let r=t.baseURL||e.ffApiUrl||D;if(new F(r).origin!==new F(e.ffApiUrl||D).origin)throw P("The stored session belongs to a different API origin");return e.accessToken&&!Re(e)?e.accessToken:(await ft(e,r)).accessToken}}return t.configuredToken?(t.silent||console.warn("\u26A0\uFE0F auth-token in frontfriend.config.js is deprecated. Run `frontfriend login` to store credentials outside the repo."),t.configuredToken):null}ht.exports={accountEmail:at,signedInAccount:jn,getCredentialsPath:bn,readCredentials:z,writeCredentials:ut,deleteCredentials:Gn,isExpired:Re,postJson:lt,refreshCredentials:ft,resolveAuthToken:Vn,createAuthRefreshError:P}});var Rt=m((Ba,wt)=>{var{ConfigError:Xn}=we(),{DEFAULT_API_URL:Jn}=W(),pt="DESIGN_SYSTEM_REQUIRED",Ie="DESIGN_SYSTEM_NOT_FOUND",mt="DESIGN_SYSTEM_FORBIDDEN",Et="DESIGN_SYSTEM_OPERATION_DENIED",Bn=new Set(["TENANT_MISMATCH","RESOURCE_MISMATCH","UNAUTHENTICATED"]);function gt(t){return String(t||Jn).replace(/\/+$/,"")}function Yn({apiUrl:t,flagHint:e}){return[` 1. Create a Design System at ${gt(t)} (or open an existing one) and copy its ff-id.`," 2. Connect it to this project:"," npx frontfriend login"," npx frontfriend setup --ff-id <ff-id>",` or add "ff-id": "<ff-id>" to frontfriend.config.js${e?`, ${e}`:""}.`]}function $t({command:t,apiUrl:e,flagHint:r,reportOnly:s=!1}={}){return["\u{1F517} No Design System connected to this project.",` ${t?`\`frontfriend ${t}\` works`:"Frontfriend works"} on a Design System (ff-id), and frontfriend.config.js has none yet.`," Connect one first:",...Yn({apiUrl:e,flagHint:r}),...s?[]:[" Nothing in this project was changed."]]}var K=class extends Xn{constructor({command:e,apiUrl:r,flagHint:s}={}){let n=$t({command:e,apiUrl:r,flagHint:s});super(n.join(`
|
|
3
3
|
`),"ff-id"),this.name="DesignSystemRequiredError",this.code=pt,this.command=e,this.lines=n}};function Wn(t,{command:e,apiUrl:r,flagHint:s}={}){if(t&&typeof t.ffId=="string"&&t.ffId.trim())return t.ffId;throw new K({command:e,apiUrl:r,flagHint:s})}function zn(t){if(!t)return null;try{let e=new URL(t),r=e.pathname.match(/\/design-systems\/([^/]+)/);return r?decodeURIComponent(r[1]):e.searchParams.get("ffId")}catch{return null}}function Kn(t){try{return new URL(t).origin}catch{return null}}function Qn(t,{ffId:e,apiUrl:r}={}){if(!t||typeof t!="object")return null;let s=t.statusCode,n=`${t.message||""} ${t.serverMessage||""}`,i=e||zn(t.url),o=i?`"${i}"`:"configured in frontfriend.config.js",a=gt(r||Kn(t.url));if(s===404&&(t.serverCode===Ie||/design system not found/i.test(n)))return{code:Ie,lines:[`\u{1F517} Design System ${o} was not found on ${a}.`," The ff-id in frontfriend.config.js does not match any Design System there."," Copy the ff-id again from the Design System in Frontfriend, or connect another one:"," npx frontfriend setup --ff-id <ff-id>"]};let c=/\/design-systems\/|[?&]ffId=/.test(t.url||"");return s===403&&c&&t.serverCode&&!Bn.has(t.serverCode)?{code:Et,lines:[`\u{1F512} Frontfriend denied this operation on Design System ${o}.`,` ${t.serverMessage||"The operation is not allowed."} (${t.serverCode})`," Your login reaches this Design System: check your workspace role and plan, or ask a workspace admin."]}:s===403&&c?{code:mt,lines:[`\u{1F512} Design System ${o} is not accessible with your current Frontfriend login or permissions.`," Sign in with an account that belongs to its workspace (npx frontfriend login),"," or ask the workspace administrator to invite your sign-in email. For help, contact support@frontfriend.dev."," or connect a Design System you can access:"," npx frontfriend setup --ff-id <ff-id>"]}:null}wt.exports={DESIGN_SYSTEM_REQUIRED:pt,DESIGN_SYSTEM_NOT_FOUND:Ie,DESIGN_SYSTEM_FORBIDDEN:mt,DESIGN_SYSTEM_OPERATION_DENIED:Et,DesignSystemRequiredError:K,missingDesignSystemLines:$t,requireDesignSystem:Wn,describeDesignSystemAccessError:Qn}});var Nt=m((Ya,Tt)=>{Tt.exports=yt;yt.sync=ei;var It=require("fs");function Zn(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var s=0;s<r.length;s++){var n=r[s].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return!0}return!1}function St(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:Zn(e,r)}function yt(t,e,r){It.stat(t,function(s,n){r(s,s?!1:St(n,t,e))})}function ei(t,e){return St(It.statSync(t),t,e)}});var vt=m((Wa,Ct)=>{Ct.exports=Lt;Lt.sync=ti;var At=require("fs");function Lt(t,e,r){At.stat(t,function(s,n){r(s,s?!1:Ot(n,e))})}function ti(t,e){return Ot(At.statSync(t),e)}function Ot(t,e){return t.isFile()&&ri(t,e)}function ri(t,e){var r=t.mode,s=t.uid,n=t.gid,i=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,h=r&u||r&c&&n===o||r&a&&s===i||r&l&&i===0;return h}});var xt=m((Ka,qt)=>{var za=require("fs"),Q;process.platform==="win32"||global.TESTING_WINDOWS?Q=Nt():Q=vt();qt.exports=Se;Se.sync=si;function Se(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,n){Se(t,e||{},function(i,o){i?n(i):s(o)})})}Q(t,e||{},function(s,n){s&&(s.code==="EACCES"||e&&e.ignoreErrors)&&(s=null,n=!1),r(s,n)})}function si(t,e){try{return Q.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var bt=m((Qa,Ut)=>{var U=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Pt=require("path"),ni=U?";":":",Ft=xt(),kt=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Dt=(t,e)=>{let r=e.colon||ni,s=t.match(/\//)||U&&t.match(/\\/)?[""]:[...U?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],n=U?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=U?n.split(r):[""];return U&&t.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:s,pathExt:i,pathExtExe:n}},_t=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:s,pathExt:n,pathExtExe:i}=Dt(t,e),o=[],a=u=>new Promise((l,h)=>{if(u===s.length)return e.all&&o.length?l(o):h(kt(t));let E=s[u],f=/^".*"$/.test(E)?E.slice(1,-1):E,I=Pt.join(f,t),v=!f&&/^\.[\\\/]/.test(t)?t.slice(0,2)+I:I;l(c(v,u,0))}),c=(u,l,h)=>new Promise((E,f)=>{if(h===n.length)return E(a(l+1));let I=n[h];Ft(u+I,{pathExt:i},(v,dn)=>{if(!v&&dn)if(e.all)o.push(u+I);else return E(u+I);return E(c(u,l,h+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},ii=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:s,pathExtExe:n}=Dt(t,e),i=[];for(let o=0;o<r.length;o++){let a=r[o],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=Pt.join(c,t),l=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let h=0;h<s.length;h++){let E=l+s[h];try{if(Ft.sync(E,{pathExt:n}))if(e.all)i.push(E);else return E}catch{}}}if(e.all&&i.length)return i;if(e.nothrow)return null;throw kt(t)};Ut.exports=_t;_t.sync=ii});var Gt=m((Za,ye)=>{"use strict";var jt=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(s=>s.toUpperCase()==="PATH")||"Path"};ye.exports=jt;ye.exports.default=jt});var Xt=m((eu,Vt)=>{"use strict";var Mt=require("path"),oi=bt(),ci=Gt();function Ht(t,e){let r=t.options.env||process.env,s=process.cwd(),n=t.options.cwd!=null,i=n&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(t.options.cwd)}catch{}let o;try{o=oi.sync(t.command,{path:r[ci({env:r})],pathExt:e?Mt.delimiter:void 0})}catch{}finally{i&&process.chdir(s)}return o&&(o=Mt.resolve(n?t.options.cwd:"",o)),o}function ai(t){return Ht(t)||Ht(t,!0)}Vt.exports=ai});var Jt=m((tu,Ne)=>{"use strict";var Te=/([()\][%!^"`<>&|;, *?])/g;function ui(t){return t=t.replace(Te,"^$1"),t}function li(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Te,"^$1"),e&&(t=t.replace(Te,"^$1")),t}Ne.exports.command=ui;Ne.exports.argument=li});var Yt=m((ru,Bt)=>{"use strict";Bt.exports=/^#!(.*)/});var zt=m((su,Wt)=>{"use strict";var fi=Yt();Wt.exports=(t="")=>{let e=t.match(fi);if(!e)return null;let[r,s]=e[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?s:s?`${n} ${s}`:n}});var Qt=m((nu,Kt)=>{"use strict";var Ae=require("fs"),hi=zt();function di(t){let r=Buffer.alloc(150),s;try{s=Ae.openSync(t,"r"),Ae.readSync(s,r,0,150,0),Ae.closeSync(s)}catch{}return hi(r.toString())}Kt.exports=di});var rr=m((iu,tr)=>{"use strict";var pi=require("path"),Zt=Xt(),er=Jt(),mi=Qt(),Ei=process.platform==="win32",gi=/\.(?:com|exe)$/i,$i=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function wi(t){t.file=Zt(t);let e=t.file&&mi(t.file);return e?(t.args.unshift(t.file),t.command=e,Zt(t)):t.file}function Ri(t){if(!Ei)return t;let e=wi(t),r=!gi.test(e);if(t.options.forceShell||r){let s=$i.test(e);t.command=pi.normalize(t.command),t.command=er.command(t.command),t.args=t.args.map(i=>er.argument(i,s));let n=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${n}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function Ii(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let s={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?s:Ri(s)}tr.exports=Ii});var ir=m((ou,nr)=>{"use strict";var Le=process.platform==="win32";function Oe(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function Si(t,e){if(!Le)return;let r=t.emit;t.emit=function(s,n){if(s==="exit"){let i=sr(n,e);if(i)return r.call(t,"error",i)}return r.apply(t,arguments)}}function sr(t,e){return Le&&t===1&&!e.file?Oe(e.original,"spawn"):null}function yi(t,e){return Le&&t===1&&!e.file?Oe(e.original,"spawnSync"):null}nr.exports={hookChildProcess:Si,verifyENOENT:sr,verifyENOENTSync:yi,notFoundError:Oe}});var ar=m((cu,b)=>{"use strict";var or=require("child_process"),Ce=rr(),ve=ir();function cr(t,e,r){let s=Ce(t,e,r),n=or.spawn(s.command,s.args,s.options);return ve.hookChildProcess(n,s),n}function Ti(t,e,r){let s=Ce(t,e,r),n=or.spawnSync(s.command,s.args,s.options);return n.error=n.error||ve.verifyENOENTSync(n.status,s),n}b.exports=cr;b.exports.spawn=cr;b.exports.sync=Ti;b.exports._parse=Ce;b.exports._enoent=ve});var j=m((au,ur)=>{"use strict";var Ni="2.0.0",Ai=Number.MAX_SAFE_INTEGER||9007199254740991,Li=16,Oi=250,Ci=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ur.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Li,MAX_SAFE_BUILD_LENGTH:Oi,MAX_SAFE_INTEGER:Ai,RELEASE_TYPES:Ci,SEMVER_SPEC_VERSION:Ni,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var V=m((uu,lr)=>{"use strict";var vi=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};lr.exports=vi});var G=m((C,fr)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:qe,MAX_SAFE_BUILD_LENGTH:qi,MAX_LENGTH:xi}=j(),Pi=V();C=fr.exports={};var Fi=C.re=[],ki=C.safeRe=[],d=C.src=[],Di=C.safeSrc=[],p=C.t={},_i=0,xe="[a-zA-Z0-9-]",Ui=[["\\s",1],["\\d",xi],[xe,qi]],bi=t=>{for(let[e,r]of Ui)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},g=(t,e,r)=>{let s=bi(e),n=_i++;Pi(t,n,e),p[t]=n,d[n]=e,Di[n]=s,Fi[n]=new RegExp(e,r?"g":void 0),ki[n]=new RegExp(s,r?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*");g("NUMERICIDENTIFIERLOOSE","\\d+");g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${xe}*`);g("MAINVERSION",`(${d[p.NUMERICIDENTIFIER]})\\.(${d[p.NUMERICIDENTIFIER]})\\.(${d[p.NUMERICIDENTIFIER]})`);g("MAINVERSIONLOOSE",`(${d[p.NUMERICIDENTIFIERLOOSE]})\\.(${d[p.NUMERICIDENTIFIERLOOSE]})\\.(${d[p.NUMERICIDENTIFIERLOOSE]})`);g("PRERELEASEIDENTIFIER",`(?:${d[p.NONNUMERICIDENTIFIER]}|${d[p.NUMERICIDENTIFIER]})`);g("PRERELEASEIDENTIFIERLOOSE",`(?:${d[p.NONNUMERICIDENTIFIER]}|${d[p.NUMERICIDENTIFIERLOOSE]})`);g("PRERELEASE",`(?:-(${d[p.PRERELEASEIDENTIFIER]}(?:\\.${d[p.PRERELEASEIDENTIFIER]})*))`);g("PRERELEASELOOSE",`(?:-?(${d[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[p.PRERELEASEIDENTIFIERLOOSE]})*))`);g("BUILDIDENTIFIER",`${xe}+`);g("BUILD",`(?:\\+(${d[p.BUILDIDENTIFIER]}(?:\\.${d[p.BUILDIDENTIFIER]})*))`);g("FULLPLAIN",`v?${d[p.MAINVERSION]}${d[p.PRERELEASE]}?${d[p.BUILD]}?`);g("FULL",`^${d[p.FULLPLAIN]}$`);g("LOOSEPLAIN",`[v=\\s]*${d[p.MAINVERSIONLOOSE]}${d[p.PRERELEASELOOSE]}?${d[p.BUILD]}?`);g("LOOSE",`^${d[p.LOOSEPLAIN]}$`);g("GTLT","((?:<|>)?=?)");g("XRANGEIDENTIFIERLOOSE",`${d[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);g("XRANGEIDENTIFIER",`${d[p.NUMERICIDENTIFIER]}|x|X|\\*`);g("XRANGEPLAIN",`[v=\\s]*(${d[p.XRANGEIDENTIFIER]})(?:\\.(${d[p.XRANGEIDENTIFIER]})(?:\\.(${d[p.XRANGEIDENTIFIER]})(?:${d[p.PRERELEASE]})?${d[p.BUILD]}?)?)?`);g("XRANGEPLAINLOOSE",`[v=\\s]*(${d[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[p.XRANGEIDENTIFIERLOOSE]})(?:${d[p.PRERELEASELOOSE]})?${d[p.BUILD]}?)?)?`);g("XRANGE",`^${d[p.GTLT]}\\s*${d[p.XRANGEPLAIN]}$`);g("XRANGELOOSE",`^${d[p.GTLT]}\\s*${d[p.XRANGEPLAINLOOSE]}$`);g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${qe}})(?:\\.(\\d{1,${qe}}))?(?:\\.(\\d{1,${qe}}))?`);g("COERCE",`${d[p.COERCEPLAIN]}(?:$|[^\\d])`);g("COERCEFULL",d[p.COERCEPLAIN]+`(?:${d[p.PRERELEASE]})?(?:${d[p.BUILD]})?(?:$|[^\\d])`);g("COERCERTL",d[p.COERCE],!0);g("COERCERTLFULL",d[p.COERCEFULL],!0);g("LONETILDE","(?:~>?)");g("TILDETRIM",`(\\s*)${d[p.LONETILDE]}\\s+`,!0);C.tildeTrimReplace="$1~";g("TILDE",`^${d[p.LONETILDE]}${d[p.XRANGEPLAIN]}$`);g("TILDELOOSE",`^${d[p.LONETILDE]}${d[p.XRANGEPLAINLOOSE]}$`);g("LONECARET","(?:\\^)");g("CARETTRIM",`(\\s*)${d[p.LONECARET]}\\s+`,!0);C.caretTrimReplace="$1^";g("CARET",`^${d[p.LONECARET]}${d[p.XRANGEPLAIN]}$`);g("CARETLOOSE",`^${d[p.LONECARET]}${d[p.XRANGEPLAINLOOSE]}$`);g("COMPARATORLOOSE",`^${d[p.GTLT]}\\s*(${d[p.LOOSEPLAIN]})$|^$`);g("COMPARATOR",`^${d[p.GTLT]}\\s*(${d[p.FULLPLAIN]})$|^$`);g("COMPARATORTRIM",`(\\s*)${d[p.GTLT]}\\s*(${d[p.LOOSEPLAIN]}|${d[p.XRANGEPLAIN]})`,!0);C.comparatorTrimReplace="$1$2$3";g("HYPHENRANGE",`^\\s*(${d[p.XRANGEPLAIN]})\\s+-\\s+(${d[p.XRANGEPLAIN]})\\s*$`);g("HYPHENRANGELOOSE",`^\\s*(${d[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[p.XRANGEPLAINLOOSE]})\\s*$`);g("STAR","(<|>)?=?\\s*\\*");g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Z=m((lu,hr)=>{"use strict";var ji=Object.freeze({loose:!0}),Gi=Object.freeze({}),Mi=t=>t?typeof t!="object"?ji:t:Gi;hr.exports=Mi});var Pe=m((fu,mr)=>{"use strict";var dr=/^[0-9]+$/,pr=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=dr.test(t),s=dr.test(e);return r&&s&&(t=+t,e=+e),t===e?0:r&&!s?-1:s&&!r?1:t<e?-1:1},Hi=(t,e)=>pr(e,t);mr.exports={compareIdentifiers:pr,rcompareIdentifiers:Hi}});var y=m((hu,gr)=>{"use strict";var ee=V(),{MAX_LENGTH:Er,MAX_SAFE_INTEGER:te}=j(),{safeRe:re,t:se}=G(),Vi=Z(),{compareIdentifiers:Fe}=Pe(),Xi=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let s=0;s<r.length;s++)if(Fe(t[s],r[s])!==0)return!1;return!0},ke=class t{constructor(e,r){if(r=Vi(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Er)throw new TypeError(`version is longer than ${Er} characters`);ee("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let s=e.trim().match(r.loose?re[se.LOOSE]:re[se.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>te||this.major<0)throw new TypeError("Invalid major version");if(this.minor>te||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>te||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<te)return i}return n}):this.prerelease=[],this.build=s[5]?s[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(e){if(ee("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let s=this.prerelease[r],n=e.prerelease[r];if(ee("prerelease compare",r,s,n),s===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(s===void 0)return-1;if(s===n)continue;return Fe(s,n)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let s=this.build[r],n=e.build[r];if(ee("build compare",r,s,n),s===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(s===void 0)return-1;if(s===n)continue;return Fe(s,n)}while(++r)}inc(e,r,s){if(e.startsWith("pre")){if(!r&&s===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let n=`-${r}`.match(this.options.loose?re[se.PRERELEASELOOSE]:re[se.PRERELEASE]);if(!n||n[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,s),this.inc("pre",r,s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,s),this.inc("pre",r,s);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(s)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let i=[r,n];if(s===!1&&(i=[r]),Xi(this.prerelease,r)){let o=this.prerelease[r.split(".").length];isNaN(o)&&(this.prerelease=i)}else this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};gr.exports=ke});var q=m((du,wr)=>{"use strict";var $r=y(),Ji=(t,e,r=!1)=>{if(t instanceof $r)return t;try{return new $r(t,e)}catch(s){if(!r)return null;throw s}};wr.exports=Ji});var Ir=m((pu,Rr)=>{"use strict";var Bi=q(),Yi=(t,e)=>{let r=Bi(t,e);return r?r.version:null};Rr.exports=Yi});var yr=m((mu,Sr)=>{"use strict";var Wi=q(),zi=(t,e)=>{let r=Wi(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};Sr.exports=zi});var Ar=m((Eu,Nr)=>{"use strict";var Tr=y(),Ki=(t,e,r,s,n)=>{typeof r=="string"&&(n=s,s=r,r=void 0);try{return new Tr(t instanceof Tr?t.version:t,r).inc(e,s,n).version}catch{return null}};Nr.exports=Ki});var Cr=m((gu,Or)=>{"use strict";var Lr=q(),Qi=(t,e)=>{let r=Lr(t,null,!0),s=Lr(e,null,!0),n=r.compare(s);if(n===0)return null;let i=n>0,o=i?r:s,a=i?s:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return r.major!==s.major?l+"major":r.minor!==s.minor?l+"minor":r.patch!==s.patch?l+"patch":"prerelease"};Or.exports=Qi});var qr=m(($u,vr)=>{"use strict";var Zi=y(),eo=(t,e)=>new Zi(t,e).major;vr.exports=eo});var Pr=m((wu,xr)=>{"use strict";var to=y(),ro=(t,e)=>new to(t,e).minor;xr.exports=ro});var kr=m((Ru,Fr)=>{"use strict";var so=y(),no=(t,e)=>new so(t,e).patch;Fr.exports=no});var _r=m((Iu,Dr)=>{"use strict";var io=q(),oo=(t,e)=>{let r=io(t,e);return r&&r.prerelease.length?r.prerelease:null};Dr.exports=oo});var A=m((Su,br)=>{"use strict";var Ur=y(),co=(t,e,r)=>new Ur(t,r).compare(new Ur(e,r));br.exports=co});var Gr=m((yu,jr)=>{"use strict";var ao=A(),uo=(t,e,r)=>ao(e,t,r);jr.exports=uo});var Hr=m((Tu,Mr)=>{"use strict";var lo=A(),fo=(t,e)=>lo(t,e,!0);Mr.exports=fo});var ne=m((Nu,Xr)=>{"use strict";var Vr=y(),ho=(t,e,r)=>{let s=new Vr(t,r),n=new Vr(e,r);return s.compare(n)||s.compareBuild(n)};Xr.exports=ho});var Br=m((Au,Jr)=>{"use strict";var po=ne(),mo=(t,e)=>t.sort((r,s)=>po(r,s,e));Jr.exports=mo});var Wr=m((Lu,Yr)=>{"use strict";var Eo=ne(),go=(t,e)=>t.sort((r,s)=>Eo(s,r,e));Yr.exports=go});var X=m((Ou,zr)=>{"use strict";var $o=A(),wo=(t,e,r)=>$o(t,e,r)>0;zr.exports=wo});var ie=m((Cu,Kr)=>{"use strict";var Ro=A(),Io=(t,e,r)=>Ro(t,e,r)<0;Kr.exports=Io});var De=m((vu,Qr)=>{"use strict";var So=A(),yo=(t,e,r)=>So(t,e,r)===0;Qr.exports=yo});var _e=m((qu,Zr)=>{"use strict";var To=A(),No=(t,e,r)=>To(t,e,r)!==0;Zr.exports=No});var oe=m((xu,es)=>{"use strict";var Ao=A(),Lo=(t,e,r)=>Ao(t,e,r)>=0;es.exports=Lo});var ce=m((Pu,ts)=>{"use strict";var Oo=A(),Co=(t,e,r)=>Oo(t,e,r)<=0;ts.exports=Co});var Ue=m((Fu,rs)=>{"use strict";var vo=De(),qo=_e(),xo=X(),Po=oe(),Fo=ie(),ko=ce(),Do=(t,e,r,s)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return vo(t,r,s);case"!=":return qo(t,r,s);case">":return xo(t,r,s);case">=":return Po(t,r,s);case"<":return Fo(t,r,s);case"<=":return ko(t,r,s);default:throw new TypeError(`Invalid operator: ${e}`)}};rs.exports=Do});var ns=m((ku,ss)=>{"use strict";var _o=y(),Uo=q(),{safeRe:ae,t:ue}=G(),bo=(t,e)=>{if(t instanceof _o)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?ae[ue.COERCEFULL]:ae[ue.COERCE]);else{let c=e.includePrerelease?ae[ue.COERCERTLFULL]:ae[ue.COERCERTL],u;for(;(u=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;let s=r[2],n=r[3]||"0",i=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Uo(`${s}.${n}.${i}${o}${a}`,e)};ss.exports=bo});var os=m((Du,is)=>{"use strict";var jo=q(),Go=j(),Mo=y(),Ho=(t,e,r)=>{if(!Go.RELEASE_TYPES.includes(e))return null;let s=Vo(t,r);return s&&Xo(s,e)},Vo=(t,e)=>{let r=t instanceof Mo?t.version:t;return jo(r,e)},Xo=(t,e)=>{if(Jo(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},Jo=t=>t.startsWith("pre");is.exports=Ho});var as=m((_u,cs)=>{"use strict";var be=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,r)}return this}};cs.exports=be});var L=m((Uu,hs)=>{"use strict";var Bo=/\s+/g,je=class t{constructor(e,r){if(r=Wo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Ge)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Bo," "),this.set=this.raw.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(n=>!ls(n[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&nc(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let s=0;s<r.length;s++)s>0&&(this.formatted+=" "),this.formatted+=r[s].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(sc,"");let s=((this.options.includePrerelease&&tc)|(this.options.loose&&rc))+":"+e,n=us.get(s);if(n)return n;let i=this.options.loose,o=i?N[T.HYPHENRANGELOOSE]:N[T.HYPHENRANGE];e=e.replace(o,mc(this.options.includePrerelease)),w("hyphen replace",e),e=e.replace(N[T.COMPARATORTRIM],Qo),w("comparator trim",e),e=e.replace(N[T.TILDETRIM],Zo),w("tilde trim",e),e=e.replace(N[T.CARETTRIM],ec),w("caret trim",e);let a=e.split(" ").map(h=>ic(h,this.options)).join(" ").split(/\s+/).map(h=>pc(h,this.options));i&&(a=a.filter(h=>(w("loose invalid filter",h,this.options),!!h.match(N[T.COMPARATORLOOSE])))),w("range list",a);let c=new Map,u=a.map(h=>new Ge(h,this.options));for(let h of u){if(ls(h))return[h];c.set(h.value,h)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return us.set(s,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(s=>fs(s,r)&&e.set.some(n=>fs(n,r)&&s.every(i=>n.every(o=>i.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new zo(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Ec(this.set[r],e,this.options))return!0;return!1}};hs.exports=je;var Yo=as(),us=new Yo,Wo=Z(),Ge=J(),w=V(),zo=y(),{safeRe:N,src:Ko,t:T,comparatorTrimReplace:Qo,tildeTrimReplace:Zo,caretTrimReplace:ec}=G(),{FLAG_INCLUDE_PRERELEASE:tc,FLAG_LOOSE:rc}=j(),sc=new RegExp(Ko[T.BUILD],"g"),ls=t=>t.value==="<0.0.0-0",nc=t=>t.value==="",fs=(t,e)=>{let r=!0,s=t.slice(),n=s.pop();for(;r&&s.length;)r=s.every(i=>n.intersects(i,e)),n=s.pop();return r},ic=(t,e)=>(t=t.replace(N[T.BUILD],""),w("comp",t,e),t=uc(t,e),w("caret",t),t=cc(t,e),w("tildes",t),t=fc(t,e),w("xrange",t),t=dc(t,e),w("stars",t),t),S=t=>!t||t.toLowerCase()==="x"||t==="*",oc=(t,e,r)=>S(t)&&!S(e)||S(e)&&r&&!S(r),cc=(t,e)=>t.trim().split(/\s+/).map(r=>ac(r,e)).join(" "),ac=(t,e)=>{let r=e.loose?N[T.TILDELOOSE]:N[T.TILDE],s=e.includePrerelease?"-0":"";return t.replace(r,(n,i,o,a,c)=>{w("tilde",t,n,i,o,a,c);let u;return S(i)?u="":S(o)?u=`>=${i}.0.0${s} <${+i+1}.0.0-0`:S(a)?u=`>=${i}.${o}.0${s} <${i}.${+o+1}.0-0`:c?(w("replaceTilde pr",c),u=`>=${i}.${o}.${a}-${c} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${a} <${i}.${+o+1}.0-0`,w("tilde return",u),u})},uc=(t,e)=>t.trim().split(/\s+/).map(r=>lc(r,e)).join(" "),lc=(t,e)=>{w("caret",t,e);let r=e.loose?N[T.CARETLOOSE]:N[T.CARET],s=e.includePrerelease?"-0":"";return t.replace(r,(n,i,o,a,c)=>{w("caret",t,n,i,o,a,c);let u;return S(i)?u="":S(o)?u=`>=${i}.0.0${s} <${+i+1}.0.0-0`:S(a)?i==="0"?u=`>=${i}.${o}.0${s} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.0${s} <${+i+1}.0.0-0`:c?(w("replaceCaret pr",c),i==="0"?o==="0"?u=`>=${i}.${o}.${a}-${c} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a}-${c} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a}-${c} <${+i+1}.0.0-0`):(w("no pr"),i==="0"?o==="0"?u=`>=${i}.${o}.${a} <${i}.${o}.${+a+1}-0`:u=`>=${i}.${o}.${a} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${a} <${+i+1}.0.0-0`),w("caret return",u),u})},fc=(t,e)=>(w("replaceXRanges",t,e),t.split(/\s+/).map(r=>hc(r,e)).join(" ")),hc=(t,e)=>{t=t.trim();let r=e.loose?N[T.XRANGELOOSE]:N[T.XRANGE];return t.replace(r,(s,n,i,o,a,c)=>{if(w("xRange",t,s,n,i,o,a,c),oc(i,o,a))return t;let u=S(i),l=u||S(o),h=l||S(a),E=h;return n==="="&&E&&(n=""),c=e.includePrerelease?"-0":"",u?n===">"||n==="<"?s="<0.0.0-0":s="*":n&&E?(l&&(o=0),a=0,n===">"?(n=">=",l?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):n==="<="&&(n="<",l?i=+i+1:o=+o+1),n==="<"&&(c="-0"),s=`${n+i}.${o}.${a}${c}`):l?s=`>=${i}.0.0${c} <${+i+1}.0.0-0`:h&&(s=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),w("xRange return",s),s})},dc=(t,e)=>(w("replaceStars",t,e),t.trim().replace(N[T.STAR],"")),pc=(t,e)=>(w("replaceGTE0",t,e),t.trim().replace(N[e.includePrerelease?T.GTE0PRE:T.GTE0],"")),mc=t=>(e,r,s,n,i,o,a,c,u,l,h,E)=>(S(s)?r="":S(n)?r=`>=${s}.0.0${t?"-0":""}`:S(i)?r=`>=${s}.${n}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,S(u)?c="":S(l)?c=`<${+u+1}.0.0-0`:S(h)?c=`<${u}.${+l+1}.0-0`:E?c=`<=${u}.${l}.${h}-${E}`:t?c=`<${u}.${l}.${+h+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Ec=(t,e,r)=>{for(let s=0;s<t.length;s++)if(!t[s].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let s=0;s<t.length;s++)if(w(t[s].semver),t[s].semver!==Ge.ANY&&t[s].semver.prerelease.length>0){let n=t[s].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var J=m((bu,$s)=>{"use strict";var B=Symbol("SemVer ANY"),Ve=class t{static get ANY(){return B}constructor(e,r){if(r=ds(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),He("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===B?this.value="":this.value=this.operator+this.semver.version,He("comp",this)}parse(e){let r=this.options.loose?ps[ms.COMPARATORLOOSE]:ps[ms.COMPARATOR],s=e.match(r);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new Es(s[2],this.options.loose):this.semver=B}toString(){return this.value}test(e){if(He("Comparator.test",e,this.options.loose),this.semver===B||e===B)return!0;if(typeof e=="string")try{e=new Es(e,this.options)}catch{return!1}return Me(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new gs(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new gs(this.value,r).test(e.semver):(r=ds(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Me(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Me(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};$s.exports=Ve;var ds=Z(),{safeRe:ps,t:ms}=G(),Me=Ue(),He=V(),Es=y(),gs=L()});var Y=m((ju,ws)=>{"use strict";var gc=L(),$c=(t,e,r)=>{try{e=new gc(e,r)}catch{return!1}return e.test(t)};ws.exports=$c});var Is=m((Gu,Rs)=>{"use strict";var wc=L(),Rc=(t,e)=>new wc(t,e).set.map(r=>r.map(s=>s.value).join(" ").trim().split(" "));Rs.exports=Rc});var ys=m((Mu,Ss)=>{"use strict";var Ic=y(),Sc=L(),yc=(t,e,r)=>{let s=null,n=null,i=null;try{i=new Sc(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!s||n.compare(o)===-1)&&(s=o,n=new Ic(s,r))}),s};Ss.exports=yc});var Ns=m((Hu,Ts)=>{"use strict";var Tc=y(),Nc=L(),Ac=(t,e,r)=>{let s=null,n=null,i=null;try{i=new Nc(e,r)}catch{return null}return t.forEach(o=>{i.test(o)&&(!s||n.compare(o)===1)&&(s=o,n=new Tc(s,r))}),s};Ts.exports=Ac});var Os=m((Vu,Ls)=>{"use strict";var Xe=y(),Lc=L(),As=X(),Oc=(t,e)=>{t=new Lc(t,e);let r=new Xe("0.0.0");if(t.test(r)||(r=new Xe("0.0.0-0"),t.test(r)))return r;r=null;for(let s=0;s<t.set.length;++s){let n=t.set[s],i=null;n.forEach(o=>{let a=new Xe(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||As(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||As(r,i))&&(r=i)}return r&&t.test(r)?r:null};Ls.exports=Oc});var vs=m((Xu,Cs)=>{"use strict";var Cc=L(),vc=(t,e)=>{try{return new Cc(t,e).range||"*"}catch{return null}};Cs.exports=vc});var le=m((Ju,Fs)=>{"use strict";var qc=y(),Ps=J(),{ANY:xc}=Ps,Pc=L(),Fc=Y(),qs=X(),xs=ie(),kc=ce(),Dc=oe(),_c=(t,e,r,s)=>{t=new qc(t,s),e=new Pc(e,s);let n,i,o,a,c;switch(r){case">":n=qs,i=kc,o=xs,a=">",c=">=";break;case"<":n=xs,i=Dc,o=qs,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Fc(t,e,s))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],h=null,E=null;if(l.forEach(f=>{f.semver===xc&&(f=new Ps(">=0.0.0")),h=h||f,E=E||f,n(f.semver,h.semver,s)?h=f:o(f.semver,E.semver,s)&&(E=f)}),h.operator===a||h.operator===c||(!E.operator||E.operator===a)&&i(t,E.semver))return!1;if(E.operator===c&&o(t,E.semver))return!1}return!0};Fs.exports=_c});var Ds=m((Bu,ks)=>{"use strict";var Uc=le(),bc=(t,e,r)=>Uc(t,e,">",r);ks.exports=bc});var Us=m((Yu,_s)=>{"use strict";var jc=le(),Gc=(t,e,r)=>jc(t,e,"<",r);_s.exports=Gc});var Gs=m((Wu,js)=>{"use strict";var bs=L(),Mc=(t,e,r)=>(t=new bs(t,r),e=new bs(e,r),t.intersects(e,r));js.exports=Mc});var Hs=m((zu,Ms)=>{"use strict";var Hc=Y(),Vc=A();Ms.exports=(t,e,r)=>{let s=[],n=null,i=null,o=t.sort((l,h)=>Vc(l,h,r));for(let l of o)Hc(l,e,r)?(i=l,n||(n=l)):(i&&s.push([n,i]),i=null,n=null);n&&s.push([n,null]);let a=[];for(let[l,h]of s)l===h?a.push(l):!h&&l===o[0]?a.push("*"):h?l===o[0]?a.push(`<=${h}`):a.push(`${l} - ${h}`):a.push(`>=${l}`);let c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e}});var Ws=m((Ku,Ys)=>{"use strict";var Vs=L(),Ye=J(),{ANY:Je}=Ye,Be=Y(),We=A(),Xc=(t,e,r={})=>{if(t===e)return!0;t=new Vs(t,r),e=new Vs(e,r);let s=!1;e:for(let n of t.set){for(let i of e.set){let o=Bc(n,i,r);if(s=s||o!==null,o)continue e}if(s)return!1}return!0},Jc=[new Ye(">=0.0.0-0")],Xs=[new Ye(">=0.0.0")],Bc=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Je){if(e.length===1&&e[0].semver===Je)return!0;r.includePrerelease?t=Jc:t=Xs}if(e.length===1&&e[0].semver===Je){if(r.includePrerelease)return!0;e=Xs}let s=new Set,n,i;for(let f of t)f.operator===">"||f.operator===">="?n=Js(n,f,r):f.operator==="<"||f.operator==="<="?i=Bs(i,f,r):s.add(f.semver);if(s.size>1)return null;let o;if(n&&i){if(o=We(n.semver,i.semver,r),o>0)return null;if(o===0&&(n.operator!==">="||i.operator!=="<="))return null}for(let f of s){if(n&&!Be(f,String(n),r)||i&&!Be(f,String(i),r))return null;for(let I of e)if(!Be(f,String(I),r))return!1;return!0}let a,c,u,l,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,E=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1;h&&h.prerelease.length===1&&i.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let f of e){if(l=l||f.operator===">"||f.operator===">=",u=u||f.operator==="<"||f.operator==="<=",n){if(E&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===E.major&&f.semver.minor===E.minor&&f.semver.patch===E.patch&&(E=!1),f.operator===">"||f.operator===">="){if(a=Js(n,f,r),a===f&&a!==n)return!1}else if(n.operator===">="&&!f.test(n.semver))return!1}if(i){if(h&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===h.major&&f.semver.minor===h.minor&&f.semver.patch===h.patch&&(h=!1),f.operator==="<"||f.operator==="<="){if(c=Bs(i,f,r),c===f&&c!==i)return!1}else if(i.operator==="<="&&!f.test(i.semver))return!1}if(!f.operator&&(i||n)&&o!==0)return!1}return!(n&&u&&!i&&o!==0||i&&l&&!n&&o!==0||E||h)},Js=(t,e,r)=>{if(!t)return e;let s=We(t.semver,e.semver,r);return s>0?t:s<0||e.operator===">"&&t.operator===">="?e:t},Bs=(t,e,r)=>{if(!t)return e;let s=We(t.semver,e.semver,r);return s<0?t:s>0||e.operator==="<"&&t.operator==="<="?e:t};Ys.exports=Xc});var Zs=m((Qu,Qs)=>{"use strict";var ze=G(),zs=j(),Yc=y(),Ks=Pe(),Wc=q(),zc=Ir(),Kc=yr(),Qc=Ar(),Zc=Cr(),ea=qr(),ta=Pr(),ra=kr(),sa=_r(),na=A(),ia=Gr(),oa=Hr(),ca=ne(),aa=Br(),ua=Wr(),la=X(),fa=ie(),ha=De(),da=_e(),pa=oe(),ma=ce(),Ea=Ue(),ga=ns(),$a=os(),wa=J(),Ra=L(),Ia=Y(),Sa=Is(),ya=ys(),Ta=Ns(),Na=Os(),Aa=vs(),La=le(),Oa=Ds(),Ca=Us(),va=Gs(),qa=Hs(),xa=Ws();Qs.exports={parse:Wc,valid:zc,clean:Kc,inc:Qc,diff:Zc,major:ea,minor:ta,patch:ra,prerelease:sa,compare:na,rcompare:ia,compareLoose:oa,compareBuild:ca,sort:aa,rsort:ua,gt:la,lt:fa,eq:ha,neq:da,gte:pa,lte:ma,cmp:Ea,coerce:ga,truncate:$a,Comparator:wa,Range:Ra,satisfies:Ia,toComparators:Sa,maxSatisfying:ya,minSatisfying:Ta,minVersion:Na,validRange:Aa,outside:La,gtr:Oa,ltr:Ca,intersects:va,simplifyRange:qa,subset:xa,SemVer:Yc,re:ze.re,src:ze.src,tokens:ze.t,SEMVER_SPEC_VERSION:zs.SEMVER_SPEC_VERSION,RELEASE_TYPES:zs.RELEASE_TYPES,compareIdentifiers:Ks.compareIdentifiers,rcompareIdentifiers:Ks.rcompareIdentifiers}});var ln=m((Zu,un)=>{var x=require("fs"),O=require("path"),tn=ar(),k=Zs(),Ke=["dependencies","devDependencies","optionalDependencies","peerDependencies"];function rn(t){let e=new Map;for(let r of t){let s=typeof r=="string"&&r.match(/^((?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*)(?:@([^\r\n]+))?$/);if(!s)throw new Error(`Invalid npm dependency: ${String(r)}`);let[,n,i]=s,o=e.get(n);e.set(n,o&&i?Pa(n,o,i):i||o)}return e}function Pa(t,e,r){if(e===r)return e;let s=k.validRange(e),n=k.validRange(r);if(s&&n)try{if(k.subset(n,s))return r;if(k.subset(s,n))return e}catch{}throw new Error(`Conflicting registry versions for ${t}: ${e} and ${r}`)}function sn(t,e){let r=typeof t=="string"&&k.validRange(t),s=k.validRange(e);if(!r||!s)return!1;try{return k.subset(r,s)}catch{return!1}}function nn(t,e){let r=rn(e);if(r.size===0)return;let s=O.join(t,"package.json"),n=JSON.parse(x.readFileSync(s,"utf8"));for(let[i,o]of r){let a=Ke.find(u=>Object.hasOwn(n[u]||{},i))||"dependencies";n[a]||={};let c=n[a][i];n[a][i]=o?sn(c,o)?c:o:c||"latest"}x.writeFileSync(s,`${JSON.stringify(n,null,2)}
|
|
4
4
|
`)}function fe(t){let e=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["bun.lock","bun"],["bun.lockb","bun"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"]];for(let r=O.resolve(t);;r=O.dirname(r)){let s=O.join(r,"package.json");if(x.existsSync(s)){let n=JSON.parse(x.readFileSync(s,"utf8")),i=String(n.packageManager||"").split("@")[0];if(["npm","pnpm","yarn","bun"].includes(i))return i}for(let[n,i]of e)if(x.existsSync(O.join(r,n)))return i;if(O.dirname(r)===r)return"npm"}}var en={npm:"npx",pnpm:"pnpm exec",yarn:"yarn",bun:"bunx"};function Fa(t,e=process.cwd()){let r;try{r=fe(e)}catch{r="npm"}return`${en[r]||en.npm} frontfriend ${t}`}function Qe(t,e){let r=rn(e);if(r.size===0)return[];let s=JSON.parse(x.readFileSync(O.join(t,"package.json"),"utf8")),n=[];for(let[i,o]of r){let a=Ke.find(c=>Object.hasOwn(s[c]||{},i));a&&(!o||sn(s[a][i],o))||n.push(o?`${i}@${o}`:i)}return n}function on(t,e){return[t==="npm"?"install":"add",...e]}function ka(t){return/^[\w@/.:^~=+-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}function cn(t,e){let r=fe(t);return[r,...on(r,e)].map(ka).join(" ")}function an(t,e,{stdio:r="inherit"}={}){let s=Qe(t,e);if(s.length===0)return;let n=fe(t),i=tn.sync(n,on(n,s),{cwd:t,stdio:r});if(i.error||i.status!==0)throw nn(t,e),i.error||new Error(`${n} dependency installation failed with status ${i.status}. Dependencies were saved; run ${n} install.`)}function Da(t,e,{install:r=!0,stdio:s="inherit",log:n=console.log}={}){let i=Qe(t,e);if(i.length===0)return{missing:i,command:null,installed:!1};let o=cn(t,i);if(!r)return n(`\u{1F4E6} Component dependencies missing from package.json. Install them with:
|
|
5
5
|
${o}`),{missing:i,command:o,installed:!1};n(`\u{1F4E6} Installing component dependencies: ${o}`);try{return an(t,i,{stdio:s}),{missing:i,command:o,installed:!0}}catch(a){return n(`\u26A0\uFE0F Component dependencies were not installed: ${a.message}
|
|
@@ -3,7 +3,7 @@ var ws=Object.create;var St=Object.defineProperty;var Ss=Object.getOwnPropertyDe
|
|
|
3
3
|
`)?r.body.slice(0,-1):r.body;return["<!-- frontfriend design mirror \u2014 DO NOT EDIT (overwritten by `frontfriend design sync`)",`slug: ${r.slug}`,`maturity: ${r.maturity}`,`implemented: ${r.implemented}`,`implementation: ${r.implementation||"unknown"}`,`version: ${r.version}`,"-->","",n,""].join(`
|
|
4
4
|
`)}function Qt(r){return[`# Frontfriend design mirror \u2014 ${r.name}`,"","This directory is a READ-ONLY mirror of the Design System design contracts",`(Design System "${r.name}", ff-id \`${r.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 rr({design_system:r,contracts:n}){let c=[...n].filter(l=>at(l.slug)).sort((l,p)=>l.kind.localeCompare(p.kind)||l.slug.localeCompare(p.slug)),u={"README.md":Qt(r)};for(let l of c)u[l.slug]=Kt(l);return u}function Jt(r,n){let c={};for(let[l,p]of Object.entries(r))n[l]!==p&&(c[l]=p);let u=Object.keys(n).filter(l=>!(l in r)).sort();return{writes:c,deletes:u}}var Yt=r=>ir("sha256").update(r).digest("hex");function js(r){return Object.fromEntries(Object.entries(r).filter(([n])=>n!=="README.md"&&at(n)).map(([n,c])=>[n,Yt(c)]))}function Vs(r,n){let c=()=>{throw new Error("Invalid or incomplete mirror response. No local files were changed; retry sync.")};(!r||typeof r.design_system?.ff_id!="string"||typeof r.design_system?.name!="string"||!Array.isArray(r.contracts))&&c();let u=new Map;for(let h of r.contracts)(!h||!at(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||u.has(h.slug))&&c(),u.set(h.slug,Kt(h));if(r.protocol===void 0)return r.manifest!==void 0&&c(),Jt(rr(r),n);(r.protocol!==1||!Array.isArray(r.manifest))&&c();let l={"README.md":Qt(r.design_system)},p=new Set;for(let h of r.manifest){(!h||!at(h.slug)||h.slug==="README.md"||!/^[a-f0-9]{64}$/.test(h.hash)||p.has(h.slug))&&c(),p.add(h.slug);let f=u.get(h.slug)??n[h.slug];(typeof f!="string"||Yt(f)!==h.hash)&&c(),Object.defineProperty(l,h.slug,{value:f,enumerable:!0})}return[...u.keys()].some(h=>!p.has(h))&&c(),Jt(l,n)}function Fs(r){let n={};if(!Le.existsSync(r))return n;let c=u=>{for(let l of Le.readdirSync(u,{withFileTypes:!0})){let p=Ee.join(u,l.name);if(l.isDirectory())c(p);else if(l.isFile()){let h=Ee.relative(r,p).split(Ee.sep).join("/");n[h]=Le.readFileSync(p,"utf8")}}};return c(r),n}function Ds(r,n){for(let[c,u]of Object.entries(n.writes)){let l=Ee.join(r,...c.split("/"));Le.mkdirSync(Ee.dirname(l),{recursive:!0}),Le.writeFileSync(l,u)}for(let c of n.deletes){let u=Ee.join(r,...c.split("/"));Le.rmSync(u,{force:!0});let l=Ee.dirname(u),p=Ee.resolve(r);for(;Ee.resolve(l)!==p&&Le.existsSync(l)&&Le.readdirSync(l).length===0;)Le.rmdirSync(l),l=Ee.dirname(l)}}function Ms(r,n,c){if(!n||r.contract_selection!==1||r.selection?.design_snapshot_id!==n.snapshotId||r.selection?.digest!==n.snapshotDigest||r.app?.id!==n.appId||r.design_system?.ff_id!==c)throw new Error("Contract mirror does not match the selected App snapshot.");let u=[...n.sharedContracts,...n.contracts],l=r.manifest??r.contracts,p=new Map(u.map(h=>[h.slug,h]));if(!Array.isArray(l)||!Array.isArray(r.contracts)||l.length!==u.length||new Set(l.map(h=>h.slug)).size!==u.length||l.some(h=>!p.has(h.slug)))throw new Error("Contract mirror inventory does not match the snapshot.");for(let h of r.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 g={appId:n.contracts.some(w=>w.slug===f.slug)?n.appId:null,body:h.body,designSystemId:n.designSystemId,kind:h.kind,maturity:h.maturity,slug:h.slug,title:h.title};if(ir("sha256").update(JSON.stringify(g)).digest("hex")!==f.digest)throw new Error("Contract content does not match its immutable digest.")}return u}sr.exports={validatePinnedMirror:Ms,MIRROR_DIR:Ts,FRONTFRIEND_GITIGNORE_PATH:Ls,renderFrontfriendGitignore:Os,isSafeSlug:at,renderContractFile:Kt,renderMirrorReadme:Qt,buildMirrorTree:rr,planMirrorSync:Jt,hashMirrorFile:Yt,knownMirrorHashes:js,planMirrorResponse:Vs,readMirrorTree:Fs,applyMirrorPlan:Ds}});var ti=Se((ta,lr)=>{var ei=require("fs"),ce=require("path");function ar(r,n="JSON"){let c="",u=0,l=r.charCodeAt(0)===65279?r.slice(1):r;for(;u<l.length;){let h=l[u];if(h==='"'){let f=u+1;for(;f<l.length&&l[f]!=='"';)f+=l[f]==="\\"?2:1;c+=l.slice(u,f+1),u=f+1}else if(h==="/"&&l[u+1]==="/")for(;u<l.length&&l[u]!==`
|
|
6
|
-
`;)u+=1;else if(h==="/"&&l[u+1]==="*"){let f=l.indexOf("*/",u+2);if(f===-1)throw new Error(`Cannot read ${n}: unterminated comment.`);c+=l.slice(u,f+2).replace(/[^\n]/g," "),u=f+2}else c+=h,u+=1}let p="";for(let h=0;h<c.length;h+=1){let f=c[h];if(f==='"'){let g=h+1;for(;g<c.length&&c[g]!=='"';)g+=c[g]==="\\"?2:1;p+=c.slice(h,g+1),h=g;continue}if(f===","){let g=h+1;for(;g<c.length&&/\s/.test(c[g]);)g+=1;if(c[g]==="}"||c[g]==="]")continue}p+=f}try{return p.trim()?JSON.parse(p):{}}catch(h){throw new Error(`Cannot read ${n}: ${h.message}`)}}function or(r){return ar(ei.readFileSync(r,"utf8"),r)}var _t=r=>{try{return ei.statSync(r).isFile()}catch{return!1}};function cr(r,n){if(typeof r!="string"||!r)throw new Error('tsconfig "extends" must be a non-empty string.');let c=u=>_t(u)?u:!u.endsWith(".json")&&_t(`${u}.json`)?`${u}.json`:null;if(r.startsWith(".")||ce.isAbsolute(r)){let u=c(ce.resolve(n,r));if(u)return u;throw new Error(`File '${r}' not found (tsconfig extends, from ${n}).`)}for(let u=n;;u=ce.dirname(u)){let l=ce.join(u,"node_modules",r),p=c(l);if(p)return p;let h=null;try{h=JSON.parse(ei.readFileSync(ce.join(l,"package.json"),"utf8"))}catch{h=null}if(h&&typeof h.tsconfig=="string"&&_t(ce.join(l,h.tsconfig)))return ce.join(l,h.tsconfig);if(_t(ce.join(l,"tsconfig.json")))return ce.join(l,"tsconfig.json");if(ce.dirname(u)===u)break}for(let u of[r,`${r}/tsconfig.json`,`${r}.json`])try{return require.resolve(u,{paths:[n]})}catch{}throw new Error(`File '${r}' not found (tsconfig extends, from ${n}).`)}function ur(r,n,c=new Set){let u=ce.resolve(r);if(c.has(u))throw new Error(`Circularity detected while resolving configuration: ${u}`);let l=new Set(c).add(u),p=or(u),h=ce.dirname(u),f={},g=p.extends===void 0?[]:Array.isArray(p.extends)?p.extends:[p.extends];for(let C of g)f={...f,...ur(cr(C,h),n,l)};let b=p.compilerOptions&&typeof p.compilerOptions=="object"?p.compilerOptions:{},w=C=>typeof C=="string"?C.replace(/\$\{configDir\}/g,n):C;return typeof b.baseUrl=="string"&&(f.baseUrl=ce.resolve(h,w(b.baseUrl))),b.paths&&typeof b.paths=="object"&&(f.paths=Object.fromEntries(Object.entries(b.paths).map(([C,I])=>[C,Array.isArray(I)?I.map(w):I])),f.pathsBasePath=h),f}function $s(r){let n=ur(r,ce.dirname(ce.resolve(r)));return n.paths?{base:n.baseUrl||n.pathsBasePath||ce.dirname(r),paths:n.paths}:null}lr.exports={parseJsonc:ar,readJsonc:or,resolveExtends:cr,readConfigPaths:$s}});var Pt={};zt(Pt,{materializeInstallationPath:()=>ri,readProjectPaths:()=>pr,resolveCanonicalUiDirectory:()=>fr,resolveConfiguredAlias:()=>Et});function hr(r){try{return JSON.parse(Ke.default.readFileSync(r,"utf8"))}catch{return null}}function pr(r){for(let n of["tsconfig.json","tsconfig.app.json","jsconfig.json"]){let c=ue.default.join(r,n);if(!Ke.default.existsSync(c))continue;let u=Us(c);if(u)return u}return{base:r,paths:{"@/*":[Ke.default.existsSync(ue.default.join(r,"src"))?"src/*":"*"]}}}function Et(r,n,c=pr(r)){for(let[u,l]of Object.entries(c.paths)){if(!Array.isArray(l)||typeof l[0]!="string")continue;let[p,h=""]=u.split("*");if(!n.startsWith(p)||!n.endsWith(h)||!u.includes("*")&&n!==u)continue;let f=n.slice(p.length,h?-h.length:void 0);return ue.default.resolve(c.base,l[0].replace("*",f))}return n.startsWith("@/")?ue.default.resolve(r,Ke.default.existsSync(ue.default.join(r,"src"))?"src":".",n.slice(2)):ue.default.resolve(r,n)}function ii(r,n){let c=ue.default.relative(r,n).replace(/\\/g,"/");if(!c||c===".."||c.startsWith("../")||ue.default.posix.isAbsolute(c))throw new Error("The canonical ui alias must stay inside the Application root.");return c}function fr(r,n){if(n)return ii(r,Et(r,n));let u=hr(ue.default.join(r,"components.json"))?.aliases?.ui;return typeof u=="string"&&u?ii(r,Et(r,u)):Ke.default.existsSync(ue.default.join(r,"src"))?"src/components/ui":"components/ui"}function ri(r){if(r.installationLayout==="shadcn"&&/^(?:lib|hooks|components)\//.test(r.path)){let u=hr(ue.default.join(r.root,"components.json"))?.aliases||{},l=/^lib\/utils\.[^.]+$/.test(r.path),p=r.path.split("/")[0],h=l&&u.utils?u.utils:u[p]||`@/${p}`,f=Et(r.root,h);return ii(r.root,l&&u.utils?f+ue.default.extname(r.path):ue.default.join(f,r.path.slice(p.length+1)))}if(r.source!=="canonical"&&r.installationLayout!=="shadcn"||!r.path.startsWith("ui/"))return r.path;let n=r.path.slice(3);return ue.default.posix.join(fr(r.root,r.configuredUiPath),n)}var Ke,ue,Us,ot=Ji(()=>{Ke=Je(require("node:fs")),ue=Je(require("node:path")),{readConfigPaths:Us}=ti()});var mr=Se((ra,Hs)=>{Hs.exports={name:"@frontfriend/sdk",version:"1.0.0"}});var vr=Se((sa,gr)=>{var{name:zs}=mr();gr.exports={PACKAGE_NAME:zs}});var ni=Se((na,yr)=>{var{PACKAGE_NAME:Rt}=vr(),Oe=require("fs"),Gs=require("http"),Js=require("https"),me=require("path"),Nt=["contracts","tokens","components"],Ks=["app/globals.css","src/app/globals.css","styles/globals.css","src/styles/globals.css","src/styles.css","src/index.css","src/style.css"],Qs={next:["next.config.js","next.config.mjs","next.config.ts"],vite:["vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"]},Ys=["primereact","@mui/material","antd","@chakra-ui/react","@mantine/core","@fluentui/react"],Xs=["style-dictionary","@tokens-studio/sd-transforms","@vanilla-extract/css","styled-components","@emotion/react"];function xr(r){try{return JSON.parse(Oe.readFileSync(r,"utf8"))}catch{return{}}}function si(r){if(r===void 0)return null;if(!Array.isArray(r)){let u=new Error("`adopt` in frontfriend.config.js must be an array.");throw u.code="FRONTFRIEND_CONFIG_VALIDATION",u}let n=r.filter(u=>!Nt.includes(u));if(n.length>0){let u=new Error(`Unknown Frontfriend adoption level: ${n.join(", ")}.`);throw u.code="FRONTFRIEND_CONFIG_VALIDATION",u}let c=r.includes("components")?2:r.includes("tokens")?1:0;return Nt.slice(0,c+1)}function Zs(r){for(let[n,c]of Object.entries(Qs)){let u=c.find(p=>Oe.existsSync(me.join(r,p)));if(!u)continue;let l=Oe.readFileSync(me.join(r,u),"utf8");return{buildTool:n,present:l.includes(`${Rt}/${n}`)}}return{buildTool:null,present:!1}}function en(r){let n=[me.join(r,"components","ui"),me.join(r,"src","components","ui"),me.join(r,"app","components","ui")].filter(l=>Oe.existsSync(l)),c=new Set;function u(l){for(let p of Oe.readdirSync(l,{withFileTypes:!0})){let h=me.join(l,p.name);if(p.isDirectory())u(h);else if(/\.(js|jsx|ts|tsx|vue)$/.test(p.name)){if(!Oe.readFileSync(h,"utf8").includes(Rt))continue;let g=me.basename(p.name,me.extname(p.name));c.add(g.toLowerCase()==="index"?me.basename(l):g.toLowerCase())}}}return n.forEach(u),[...c].sort()}function tn(r){let n=xr(me.join(r,"package.json")),c={...n.dependencies||{},...n.devDependencies||{}},u=c.tailwindcss||null,p=[xr(me.join(r,"components.json"))?.tailwind?.css,...Ks].filter(Boolean).find(g=>Oe.existsSync(me.join(r,g))),h=p?Oe.readFileSync(me.join(r,p),"utf8"):"",f=Xs.filter(g=>c[g]);return!f.length&&/:root[\s\S]*--(?:color|spacing|font|radius)-[\w-]+\s*:/.test(h)&&!h.includes(`${Rt}/theme.css`)&&f.push("css-custom-properties"),{nativeTokens:{present:h.includes("/* Frontfriend managed native tokens: start */"),file:p||null},tailwind:{present:!!u,version:u,major:u&&Number((String(u).match(/\d+/)||[])[0])||null},componentsJson:Oe.existsSync(me.join(r,"components.json")),themeImport:{present:h.includes(`${Rt}/theme.css`)||/@import\s+["'][^"']*node_modules\/\.cache\/frontfriend\/theme\.css["']/.test(h),file:p||null},plugin:Zs(r),frontfriendComponents:en(r),foreignComponentLibraries:Ys.filter(g=>c[g]),foreignTokenSystems:f}}function rn(r,n){let c=si(r)||Nt,u=c.includes("tokens"),l=c.includes("components"),p=[];return u&&!n.themeImport.present&&!n.nativeTokens?.present&&p.push("Config adopts tokens, but the Frontfriend theme import was not observed."),!u&&n.themeImport.present&&p.push("Frontfriend tokens are present in CSS but are not adopted in config."),l&&!n.componentsJson&&p.push("Config adopts components, but components.json was not observed."),!l&&n.frontfriendComponents.length>0&&p.push("Frontfriend components are installed but are not adopted in config."),p}function sn({apiUrl:r,token:n,ffId:c,name:u,adopt:l,observed:p,framework:h,primitive:f}){if(!r||!n||!c||!u||!h||f===void 0)return Promise.resolve({reported:!1,unavailable:!0});let g=new URL("/api/apps/sync",r),b=JSON.stringify({ffId:c,name:u,adopt:si(l),observed:p,runtime:"sdk",framework:h,primitive:f}),w=g.protocol==="https:"?Js:Gs;return new Promise(C=>{let I=w.request(g,{method:"POST",headers:{authorization:`Bearer ${n}`,"content-type":"application/json","content-length":Buffer.byteLength(b)}},E=>{E.resume(),E.on("end",()=>{E.statusCode>=200&&E.statusCode<300?C({reported:!0,unavailable:!1}):C({reported:!1,unavailable:!0})})});I.on("error",()=>C({reported:!1,unavailable:!0})),I.setTimeout(1500,()=>{I.destroy(),C({reported:!1,unavailable:!0})}),I.end(b)})}yr.exports={ADOPTION_LEVELS:Nt,normalizeAdopt:si,probeAdoption:tn,adoptionWarnings:rn,reportAdoption:sn}});var wr=Se((Tt,br)=>{(function(r,n){typeof Tt=="object"&&typeof br<"u"?n(Tt):typeof define=="function"&&define.amd?define(["exports"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.acorn={}))})(Tt,function(r){"use strict";var n=[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],c=[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],u="\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"},g=/^in(stanceof)?$/,b=new RegExp("["+l+"]"),w=new RegExp("["+l+u+"]");function C(e,t){for(var i=65536,s=0;s<t.length;s+=2){if(i+=t[s],i>e)return!1;if(i+=t[s+1],i>=e)return!0}return!1}function I(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&b.test(String.fromCharCode(e)):t===!1?!1:C(e,c)}function E(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&w.test(String.fromCharCode(e)):t===!1?!1:C(e,c)||C(e,n)}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 O(e,t){return new _(e,{beforeExpr:!0,binop:t})}var N={beforeExpr:!0},B={startsExpr:!0},Z={};function V(e,t){return t===void 0&&(t={}),t.keyword=e,Z[e]=new _(e,t)}var a={num:new _("num",B),regexp:new _("regexp",B),string:new _("string",B),name:new _("name",B),privateId:new _("privateId",B),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 _(",",N),semi:new _(";",N),colon:new _(":",N),dot:new _("."),question:new _("?",N),questionDot:new _("?."),arrow:new _("=>",N),template:new _("template"),invalidTemplate:new _("invalidTemplate"),ellipsis:new _("...",N),backQuote:new _("`",B),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:O("||",1),logicalAND:O("&&",2),bitwiseOR:O("|",3),bitwiseXOR:O("^",4),bitwiseAND:O("&",5),equality:O("==/!=/===/!==",6),relational:O("</>/<=/>=",7),bitShift:O("<</>>/>>>",8),plusMin:new _("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:O("%",10),star:O("*",10),slash:O("/",10),starstar:new _("**",{beforeExpr:!0}),coalesce:O("??",1),_break:V("break"),_case:V("case",N),_catch:V("catch"),_continue:V("continue"),_debugger:V("debugger"),_default:V("default",N),_do:V("do",{isLoop:!0,beforeExpr:!0}),_else:V("else",N),_finally:V("finally"),_for:V("for",{isLoop:!0}),_function:V("function",B),_if:V("if"),_return:V("return",N),_switch:V("switch"),_throw:V("throw",N),_try:V("try"),_var:V("var"),_const:V("const"),_while:V("while",{isLoop:!0}),_with:V("with"),_new:V("new",{beforeExpr:!0,startsExpr:!0}),_this:V("this",B),_super:V("super",B),_class:V("class",B),_extends:V("extends",N),_export:V("export"),_import:V("import",B),_null:V("null",B),_true:V("true",B),_false:V("false",B),_in:V("in",{beforeExpr:!0,binop:7}),_instanceof:V("instanceof",{beforeExpr:!0,binop:7}),_typeof:V("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:V("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:V("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,P=new RegExp(x.source,"g");function $(e){return e===10||e===13||e===8232||e===8233}function H(e,t,i){i===void 0&&(i=e.length);for(var s=t;s<i;s++){var o=e.charCodeAt(s);if($(o))return s<i-1&&o===13&&e.charCodeAt(s+1)===10?s+2:s+1}return-1}var ee=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,G=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,te=Object.prototype,Ie=te.hasOwnProperty,A=te.toString,T=Object.hasOwn||function(e,t){return Ie.call(e,t)},ie=Array.isArray||function(e){return A.call(e)==="[object Array]"},Ae=Object.create(null);function ge(e){return Ae[e]||(Ae[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function q(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Q=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,W=function(t,i){this.line=t,this.column=i};W.prototype.offset=function(t){return new W(this.line,this.column+t)};var re=function(t,i,s){this.start=i,this.end=s,t.sourceFile!==null&&(this.source=t.sourceFile)};function pe(e,t){for(var i=1,s=0;;){var o=H(e,s,t);if(o<0)return new W(i,t-s);++i,s=o}}var je={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},Ue=!1;function ke(e){var t={};for(var i in je)t[i]=e&&T(e,i)?e[i]:je[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Ue&&typeof console=="object"&&console.warn&&(Ue=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
6
|
+
`;)u+=1;else if(h==="/"&&l[u+1]==="*"){let f=l.indexOf("*/",u+2);if(f===-1)throw new Error(`Cannot read ${n}: unterminated comment.`);c+=l.slice(u,f+2).replace(/[^\n]/g," "),u=f+2}else c+=h,u+=1}let p="";for(let h=0;h<c.length;h+=1){let f=c[h];if(f==='"'){let g=h+1;for(;g<c.length&&c[g]!=='"';)g+=c[g]==="\\"?2:1;p+=c.slice(h,g+1),h=g;continue}if(f===","){let g=h+1;for(;g<c.length&&/\s/.test(c[g]);)g+=1;if(c[g]==="}"||c[g]==="]")continue}p+=f}try{return p.trim()?JSON.parse(p):{}}catch(h){throw new Error(`Cannot read ${n}: ${h.message}`)}}function or(r){return ar(ei.readFileSync(r,"utf8"),r)}var _t=r=>{try{return ei.statSync(r).isFile()}catch{return!1}};function cr(r,n){if(typeof r!="string"||!r)throw new Error('tsconfig "extends" must be a non-empty string.');let c=u=>_t(u)?u:!u.endsWith(".json")&&_t(`${u}.json`)?`${u}.json`:null;if(r.startsWith(".")||ce.isAbsolute(r)){let u=c(ce.resolve(n,r));if(u)return u;throw new Error(`File '${r}' not found (tsconfig extends, from ${n}).`)}for(let u=n;;u=ce.dirname(u)){let l=ce.join(u,"node_modules",r),p=c(l);if(p)return p;let h=null;try{h=JSON.parse(ei.readFileSync(ce.join(l,"package.json"),"utf8"))}catch{h=null}if(h&&typeof h.tsconfig=="string"&&_t(ce.join(l,h.tsconfig)))return ce.join(l,h.tsconfig);if(_t(ce.join(l,"tsconfig.json")))return ce.join(l,"tsconfig.json");if(ce.dirname(u)===u)break}for(let u of[r,`${r}/tsconfig.json`,`${r}.json`])try{return require.resolve(u,{paths:[n]})}catch{}throw new Error(`File '${r}' not found (tsconfig extends, from ${n}).`)}function ur(r,n,c=new Set){let u=ce.resolve(r);if(c.has(u))throw new Error(`Circularity detected while resolving configuration: ${u}`);let l=new Set(c).add(u),p=or(u),h=ce.dirname(u),f={},g=p.extends===void 0?[]:Array.isArray(p.extends)?p.extends:[p.extends];for(let C of g)f={...f,...ur(cr(C,h),n,l)};let b=p.compilerOptions&&typeof p.compilerOptions=="object"?p.compilerOptions:{},w=C=>typeof C=="string"?C.replace(/\$\{configDir\}/g,n):C;return typeof b.baseUrl=="string"&&(f.baseUrl=ce.resolve(h,w(b.baseUrl))),b.paths&&typeof b.paths=="object"&&(f.paths=Object.fromEntries(Object.entries(b.paths).map(([C,I])=>[C,Array.isArray(I)?I.map(w):I])),f.pathsBasePath=h),f}function $s(r){let n=ur(r,ce.dirname(ce.resolve(r)));return n.paths?{base:n.baseUrl||n.pathsBasePath||ce.dirname(r),paths:n.paths}:null}lr.exports={parseJsonc:ar,readJsonc:or,resolveExtends:cr,readConfigPaths:$s}});var Pt={};zt(Pt,{materializeInstallationPath:()=>ri,readProjectPaths:()=>pr,resolveCanonicalUiDirectory:()=>fr,resolveConfiguredAlias:()=>Et});function hr(r){try{return JSON.parse(Ke.default.readFileSync(r,"utf8"))}catch{return null}}function pr(r){for(let n of["tsconfig.json","tsconfig.app.json","jsconfig.json"]){let c=ue.default.join(r,n);if(!Ke.default.existsSync(c))continue;let u=Us(c);if(u)return u}return{base:r,paths:{"@/*":[Ke.default.existsSync(ue.default.join(r,"src"))?"src/*":"*"]}}}function Et(r,n,c=pr(r)){for(let[u,l]of Object.entries(c.paths)){if(!Array.isArray(l)||typeof l[0]!="string")continue;let[p,h=""]=u.split("*");if(!n.startsWith(p)||!n.endsWith(h)||!u.includes("*")&&n!==u)continue;let f=n.slice(p.length,h?-h.length:void 0);return ue.default.resolve(c.base,l[0].replace("*",f))}return n.startsWith("@/")?ue.default.resolve(r,Ke.default.existsSync(ue.default.join(r,"src"))?"src":".",n.slice(2)):ue.default.resolve(r,n)}function ii(r,n){let c=ue.default.relative(r,n).replace(/\\/g,"/");if(!c||c===".."||c.startsWith("../")||ue.default.posix.isAbsolute(c))throw new Error("The canonical ui alias must stay inside the Application root.");return c}function fr(r,n){if(n)return ii(r,Et(r,n));let u=hr(ue.default.join(r,"components.json"))?.aliases?.ui;return typeof u=="string"&&u?ii(r,Et(r,u)):Ke.default.existsSync(ue.default.join(r,"src"))?"src/components/ui":"components/ui"}function ri(r){if(r.installationLayout==="shadcn"&&/^(?:lib|hooks|components)\//.test(r.path)){let u=hr(ue.default.join(r.root,"components.json"))?.aliases||{},l=/^lib\/utils\.[^.]+$/.test(r.path),p=r.path.split("/")[0],h=l&&u.utils?u.utils:u[p]||`@/${p}`,f=Et(r.root,h);return ii(r.root,l&&u.utils?f+ue.default.extname(r.path):ue.default.join(f,r.path.slice(p.length+1)))}if(r.source!=="canonical"&&r.installationLayout!=="shadcn"||!r.path.startsWith("ui/"))return r.path;let n=r.path.slice(3);return ue.default.posix.join(fr(r.root,r.configuredUiPath),n)}var Ke,ue,Us,ot=Ji(()=>{Ke=Je(require("node:fs")),ue=Je(require("node:path")),{readConfigPaths:Us}=ti()});var mr=Se((ra,Hs)=>{Hs.exports={name:"@frontfriend/sdk",version:"1.1.0"}});var vr=Se((sa,gr)=>{var{name:zs}=mr();gr.exports={PACKAGE_NAME:zs}});var ni=Se((na,yr)=>{var{PACKAGE_NAME:Rt}=vr(),Oe=require("fs"),Gs=require("http"),Js=require("https"),me=require("path"),Nt=["contracts","tokens","components"],Ks=["app/globals.css","src/app/globals.css","styles/globals.css","src/styles/globals.css","src/styles.css","src/index.css","src/style.css"],Qs={next:["next.config.js","next.config.mjs","next.config.ts"],vite:["vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs"]},Ys=["primereact","@mui/material","antd","@chakra-ui/react","@mantine/core","@fluentui/react"],Xs=["style-dictionary","@tokens-studio/sd-transforms","@vanilla-extract/css","styled-components","@emotion/react"];function xr(r){try{return JSON.parse(Oe.readFileSync(r,"utf8"))}catch{return{}}}function si(r){if(r===void 0)return null;if(!Array.isArray(r)){let u=new Error("`adopt` in frontfriend.config.js must be an array.");throw u.code="FRONTFRIEND_CONFIG_VALIDATION",u}let n=r.filter(u=>!Nt.includes(u));if(n.length>0){let u=new Error(`Unknown Frontfriend adoption level: ${n.join(", ")}.`);throw u.code="FRONTFRIEND_CONFIG_VALIDATION",u}let c=r.includes("components")?2:r.includes("tokens")?1:0;return Nt.slice(0,c+1)}function Zs(r){for(let[n,c]of Object.entries(Qs)){let u=c.find(p=>Oe.existsSync(me.join(r,p)));if(!u)continue;let l=Oe.readFileSync(me.join(r,u),"utf8");return{buildTool:n,present:l.includes(`${Rt}/${n}`)}}return{buildTool:null,present:!1}}function en(r){let n=[me.join(r,"components","ui"),me.join(r,"src","components","ui"),me.join(r,"app","components","ui")].filter(l=>Oe.existsSync(l)),c=new Set;function u(l){for(let p of Oe.readdirSync(l,{withFileTypes:!0})){let h=me.join(l,p.name);if(p.isDirectory())u(h);else if(/\.(js|jsx|ts|tsx|vue)$/.test(p.name)){if(!Oe.readFileSync(h,"utf8").includes(Rt))continue;let g=me.basename(p.name,me.extname(p.name));c.add(g.toLowerCase()==="index"?me.basename(l):g.toLowerCase())}}}return n.forEach(u),[...c].sort()}function tn(r){let n=xr(me.join(r,"package.json")),c={...n.dependencies||{},...n.devDependencies||{}},u=c.tailwindcss||null,p=[xr(me.join(r,"components.json"))?.tailwind?.css,...Ks].filter(Boolean).find(g=>Oe.existsSync(me.join(r,g))),h=p?Oe.readFileSync(me.join(r,p),"utf8"):"",f=Xs.filter(g=>c[g]);return!f.length&&/:root[\s\S]*--(?:color|spacing|font|radius)-[\w-]+\s*:/.test(h)&&!h.includes(`${Rt}/theme.css`)&&f.push("css-custom-properties"),{nativeTokens:{present:h.includes("/* Frontfriend managed native tokens: start */"),file:p||null},tailwind:{present:!!u,version:u,major:u&&Number((String(u).match(/\d+/)||[])[0])||null},componentsJson:Oe.existsSync(me.join(r,"components.json")),themeImport:{present:h.includes(`${Rt}/theme.css`)||/@import\s+["'][^"']*node_modules\/\.cache\/frontfriend\/theme\.css["']/.test(h),file:p||null},plugin:Zs(r),frontfriendComponents:en(r),foreignComponentLibraries:Ys.filter(g=>c[g]),foreignTokenSystems:f}}function rn(r,n){let c=si(r)||Nt,u=c.includes("tokens"),l=c.includes("components"),p=[];return u&&!n.themeImport.present&&!n.nativeTokens?.present&&p.push("Config adopts tokens, but the Frontfriend theme import was not observed."),!u&&n.themeImport.present&&p.push("Frontfriend tokens are present in CSS but are not adopted in config."),l&&!n.componentsJson&&p.push("Config adopts components, but components.json was not observed."),!l&&n.frontfriendComponents.length>0&&p.push("Frontfriend components are installed but are not adopted in config."),p}function sn({apiUrl:r,token:n,ffId:c,name:u,adopt:l,observed:p,framework:h,primitive:f}){if(!r||!n||!c||!u||!h||f===void 0)return Promise.resolve({reported:!1,unavailable:!0});let g=new URL("/api/apps/sync",r),b=JSON.stringify({ffId:c,name:u,adopt:si(l),observed:p,runtime:"sdk",framework:h,primitive:f}),w=g.protocol==="https:"?Js:Gs;return new Promise(C=>{let I=w.request(g,{method:"POST",headers:{authorization:`Bearer ${n}`,"content-type":"application/json","content-length":Buffer.byteLength(b)}},E=>{E.resume(),E.on("end",()=>{E.statusCode>=200&&E.statusCode<300?C({reported:!0,unavailable:!1}):C({reported:!1,unavailable:!0})})});I.on("error",()=>C({reported:!1,unavailable:!0})),I.setTimeout(1500,()=>{I.destroy(),C({reported:!1,unavailable:!0})}),I.end(b)})}yr.exports={ADOPTION_LEVELS:Nt,normalizeAdopt:si,probeAdoption:tn,adoptionWarnings:rn,reportAdoption:sn}});var wr=Se((Tt,br)=>{(function(r,n){typeof Tt=="object"&&typeof br<"u"?n(Tt):typeof define=="function"&&define.amd?define(["exports"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.acorn={}))})(Tt,function(r){"use strict";var n=[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],c=[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],u="\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"},g=/^in(stanceof)?$/,b=new RegExp("["+l+"]"),w=new RegExp("["+l+u+"]");function C(e,t){for(var i=65536,s=0;s<t.length;s+=2){if(i+=t[s],i>e)return!1;if(i+=t[s+1],i>=e)return!0}return!1}function I(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&b.test(String.fromCharCode(e)):t===!1?!1:C(e,c)}function E(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&w.test(String.fromCharCode(e)):t===!1?!1:C(e,c)||C(e,n)}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 O(e,t){return new _(e,{beforeExpr:!0,binop:t})}var N={beforeExpr:!0},B={startsExpr:!0},Z={};function V(e,t){return t===void 0&&(t={}),t.keyword=e,Z[e]=new _(e,t)}var a={num:new _("num",B),regexp:new _("regexp",B),string:new _("string",B),name:new _("name",B),privateId:new _("privateId",B),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 _(",",N),semi:new _(";",N),colon:new _(":",N),dot:new _("."),question:new _("?",N),questionDot:new _("?."),arrow:new _("=>",N),template:new _("template"),invalidTemplate:new _("invalidTemplate"),ellipsis:new _("...",N),backQuote:new _("`",B),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:O("||",1),logicalAND:O("&&",2),bitwiseOR:O("|",3),bitwiseXOR:O("^",4),bitwiseAND:O("&",5),equality:O("==/!=/===/!==",6),relational:O("</>/<=/>=",7),bitShift:O("<</>>/>>>",8),plusMin:new _("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:O("%",10),star:O("*",10),slash:O("/",10),starstar:new _("**",{beforeExpr:!0}),coalesce:O("??",1),_break:V("break"),_case:V("case",N),_catch:V("catch"),_continue:V("continue"),_debugger:V("debugger"),_default:V("default",N),_do:V("do",{isLoop:!0,beforeExpr:!0}),_else:V("else",N),_finally:V("finally"),_for:V("for",{isLoop:!0}),_function:V("function",B),_if:V("if"),_return:V("return",N),_switch:V("switch"),_throw:V("throw",N),_try:V("try"),_var:V("var"),_const:V("const"),_while:V("while",{isLoop:!0}),_with:V("with"),_new:V("new",{beforeExpr:!0,startsExpr:!0}),_this:V("this",B),_super:V("super",B),_class:V("class",B),_extends:V("extends",N),_export:V("export"),_import:V("import",B),_null:V("null",B),_true:V("true",B),_false:V("false",B),_in:V("in",{beforeExpr:!0,binop:7}),_instanceof:V("instanceof",{beforeExpr:!0,binop:7}),_typeof:V("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:V("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:V("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,P=new RegExp(x.source,"g");function $(e){return e===10||e===13||e===8232||e===8233}function H(e,t,i){i===void 0&&(i=e.length);for(var s=t;s<i;s++){var o=e.charCodeAt(s);if($(o))return s<i-1&&o===13&&e.charCodeAt(s+1)===10?s+2:s+1}return-1}var ee=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,G=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,te=Object.prototype,Ie=te.hasOwnProperty,A=te.toString,T=Object.hasOwn||function(e,t){return Ie.call(e,t)},ie=Array.isArray||function(e){return A.call(e)==="[object Array]"},Ae=Object.create(null);function ge(e){return Ae[e]||(Ae[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function q(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Q=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,W=function(t,i){this.line=t,this.column=i};W.prototype.offset=function(t){return new W(this.line,this.column+t)};var re=function(t,i,s){this.start=i,this.end=s,t.sourceFile!==null&&(this.source=t.sourceFile)};function pe(e,t){for(var i=1,s=0;;){var o=H(e,s,t);if(o<0)return new W(i,t-s);++i,s=o}}var je={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},Ue=!1;function ke(e){var t={};for(var i in je)t[i]=e&&T(e,i)?e[i]:je[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Ue&&typeof console=="object"&&console.warn&&(Ue=!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),ie(t.onToken)){var s=t.onToken;t.onToken=function(o){return s.push(o)}}if(ie(t.onComment)&&(t.onComment=Xe(t,t.onComment)),t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function Xe(e,t){return function(i,s,o,d,m,v){var y={type:i?"Block":"Line",value:s,start:o,end:d};e.locations&&(y.loc=new re(this,m,v)),e.ranges&&(y.range=[o,d]),t.push(y)}}var se=1,Ce=2,fe=4,ne=8,qe=16,ht=32,pt=64,vi=128,Be=256,Ze=512,xi=1024,ft=se|Ce|Be;function Bt(e,t){return Ce|(e?fe:0)|(t?ne:0)}var dt=0,$t=1,Re=2,yi=3,bi=4,wi=5,Y=function(t,i,s){this.options=t=ke(t),this.sourceFile=t.sourceFile,this.keywords=ge(f[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var o="";t.allowReserved!==!0&&(o=p[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(o+=" await")),this.reservedWords=ge(o);var d=(o?o+" ":"")+p.strict;this.reservedWordsStrict=ge(d),this.reservedWordsStrictBind=ge(d+" "+p.strictBind),this.input=String(i),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(`
|
|
8
8
|
`,s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(x).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"?Ce:se),this.regexpState=null,this.privateNameStack=[]},xe={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}};Y.prototype.parse=function(){var t=this,i=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return t.parseTopLevel(i)})},xe.inFunction.get=function(){return(this.currentVarScope().flags&Ce)>0},xe.inGenerator.get=function(){return(this.currentVarScope().flags&ne)>0},xe.inAsync.get=function(){return(this.currentVarScope().flags&fe)>0},xe.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(Be|Ze))return!1;if(i&Ce)return(i&fe)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},xe.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&se)},xe.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&pt)>0||this.options.allowSuperOutsideMethod},xe.allowDirectSuper.get=function(){return(this.currentThisScope().flags&vi)>0},xe.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},xe.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(Be|Ze)||i&Ce&&!(i&qe))return!0}return!1},xe.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;return!(t&xi||!this.inModule&&t&se)},xe.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Be)>0},Y.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var s=this,o=0;o<t.length;o++)s=t[o](s);return s},Y.parse=function(t,i){return new this(i,t).parse()},Y.parseExpressionAt=function(t,i,s){var o=new this(s,t,i);return o.nextToken(),o.parseExpression()},Y.tokenizer=function(t,i){return new this(i,t)},Object.defineProperties(Y.prototype,xe);var ae=Y.prototype,zr=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;ae.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){G.lastIndex=e,e+=G.exec(this.input)[0].length;var t=zr.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){G.lastIndex=e+t[0].length;var i=G.exec(this.input),s=i.index+i[0].length,o=this.input.charAt(s);return o===";"||o==="}"||x.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(o)||o==="!"&&this.input.charAt(s+1)==="=")}e+=t[0].length,G.lastIndex=e,e+=G.exec(this.input)[0].length,this.input[e]===";"&&e++}},ae.eat=function(e){return this.type===e?(this.next(),!0):!1},ae.isContextual=function(e){return this.type===a.name&&this.value===e&&!this.containsEsc},ae.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},ae.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}},ae.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},ae.canInsertSemicolon=function(){return this.type===a.eof||this.type===a.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},ae.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},ae.semicolon=function(){!this.eat(a.semi)&&!this.insertSemicolon()&&this.unexpected()},ae.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},ae.expect=function(e){this.eat(e)||this.unexpected()},ae.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var mt=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ae.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")}},ae.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,s=e.doubleProto;if(!t)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")},ae.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")},ae.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var k=Y.prototype;k.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 s=0,o=Object.keys(this.undefinedExports);s<o.length;s+=1){var d=o[s];this.raiseRecoverable(this.undefinedExports[d].start,"Export '"+d+"' 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 Ut={kind:"loop"},Gr={kind:"switch"};k.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;G.lastIndex=this.pos;var t=G.exec(this.input),i=this.pos+t[0].length,s=this.fullCharCodeAt(i);if(s===91||s===92)return!0;if(e)return!1;if(s===123)return!0;if(I(s)){var o=i;do i+=s<=65535?1:2;while(E(s=this.fullCharCodeAt(i)));if(s===92)return!0;var d=this.input.slice(o,i);if(!g.test(d))return!0}return!1},k.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;G.lastIndex=this.pos;var e=G.exec(this.input),t=this.pos+e[0].length,i;return!x.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(E(i=this.fullCharCodeAt(t+8))||i===92))},k.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;G.lastIndex=this.pos;var i=G.exec(this.input),s=this.pos+i[0].length;if(x.test(this.input.slice(this.pos,s)))return!1;if(e){var o=s+5,d;if(this.input.slice(s,o)!=="using"||o===this.input.length||E(d=this.fullCharCodeAt(o))||d===92)return!1;G.lastIndex=o;var m=G.exec(this.input);if(s=o+m[0].length,m&&x.test(this.input.slice(o,s)))return!1}var v=this.fullCharCodeAt(s);if(!I(v)&&v!==92)return!1;var y=s;do s+=v<=65535?1:2;while(E(v=this.fullCharCodeAt(s)));if(v===92)return!0;var L=this.input.slice(y,s);if(g.test(L))return!1;if(t&&!e&&L==="of"){G.lastIndex=s;var M=G.exec(this.input);if(s=s+M[0].length,this.input.charCodeAt(s)!==61||(v=this.input.charCodeAt(s+1))===61||v===62)return!1}return!0},k.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},k.isUsing=function(e){return this.isUsingKeyword(!1,e)},k.parseStatement=function(e,t,i){var s=this.type,o=this.startNode(),d;switch(this.isLet(e)&&(s=a._var,d="let"),s){case a._break:case a._continue:return this.parseBreakContinueStatement(o,s.keyword);case a._debugger:return this.parseDebuggerStatement(o);case a._do:return this.parseDoStatement(o);case a._for:return this.parseForStatement(o);case a._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(o,!1,!e);case a._class:return e&&this.unexpected(),this.parseClass(o,!0);case a._if:return this.parseIfStatement(o);case a._return:return this.parseReturnStatement(o);case a._switch:return this.parseSwitchStatement(o);case a._throw:return this.parseThrowStatement(o);case a._try:return this.parseTryStatement(o);case a._const:case a._var:return d=d||this.value,e&&d!=="var"&&this.unexpected(),this.parseVarStatement(o,d);case a._while:return this.parseWhileStatement(o);case a._with:return this.parseWithStatement(o);case a.braceL:return this.parseBlock(!0,o);case a.semi:return this.parseEmptyStatement(o);case a._export:case a._import:if(this.options.ecmaVersion>10&&s===a._import){G.lastIndex=this.pos;var m=G.exec(this.input),v=this.pos+m[0].length,y=this.input.charCodeAt(v);if(y===40||y===46)return this.parseExpressionStatement(o,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'")),s===a._import?this.parseImport(o):this.parseExport(o,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(o,!0,!e);var L=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(L)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"),L==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(o,!1,L),this.semicolon(),this.finishNode(o,"VariableDeclaration");var M=this.value,K=this.parseExpression();return s===a.name&&K.type==="Identifier"&&this.eat(a.colon)?this.parseLabeledStatement(o,M,K,e):this.parseExpressionStatement(o,K)}},k.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 s=0;s<this.labels.length;++s){var o=this.labels[s];if((e.label==null||o.name===e.label.name)&&(o.kind!=null&&(i||o.kind==="loop")||e.label&&i))break}return s===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")},k.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},k.parseDoStatement=function(e){return this.next(),this.labels.push(Ut),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")},k.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ut),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 s=this.startNode(),o=i?"let":this.value;return this.next(),this.parseVar(s,!0,o),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(e,s,t)}var d=this.isContextual("let"),m=!1,v=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(v){var y=this.startNode();return this.next(),v==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(y,!0,v),this.finishNode(y,"VariableDeclaration"),this.parseForAfterInit(e,y,t)}var L=this.containsEsc,M=new mt,K=this.start,oe=t>-1?this.parseExprSubscripts(M,"await"):this.parseExpression(!0,M);return this.type===a._in||(m=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===a._in&&this.unexpected(t),e.await=!0):m&&this.options.ecmaVersion>=8&&(oe.start===K&&!L&&oe.type==="Identifier"&&oe.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),d&&m&&this.raise(oe.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(oe,!1,M),this.checkLValPattern(oe),this.parseForIn(e,oe)):(this.checkExpressionErrors(M,!0),t>-1&&this.unexpected(t),this.parseFor(e,oe))},k.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))},k.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,et|(i?0:qt),!1,t)},k.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")},k.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")},k.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(a.braceL),this.labels.push(Gr),this.enterScope(xi);for(var t,i=!1;this.type!==a.braceR;)if(this.type===a._case||this.type===a._default){var s=this.type===a._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?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")},k.parseThrowStatement=function(e){return this.next(),x.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 Jr=[];k.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?ht:0),this.checkLValPattern(e,t?bi:Re),this.expect(a.parenR),e},k.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")},k.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")},k.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ut),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},k.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")},k.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},k.parseLabeledStatement=function(e,t,i,s){for(var o=0,d=this.labels;o<d.length;o+=1){var m=d[o];m.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var v=this.type.isLoop?"loop":this.type===a._switch?"switch":null,y=this.labels.length-1;y>=0;y--){var L=this.labels[y];if(L.statementStart===e.start)L.statementStart=this.start,L.kind=v;else break}return this.labels.push({name:t,kind:v,statementStart:this.start}),e.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")},k.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},k.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 s=this.parseStatement(null);t.body.push(s)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},k.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")},k.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")},k.parseVar=function(e,t,i,s){for(e.declarations=[],e.kind=i;;){var o=this.startNode();if(this.parseVarId(o,i),this.eat(a.eq)?o.init=this.parseMaybeAssign(t):!s&&i==="const"&&!(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&(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"):!s&&o.id.type!=="Identifier"&&!(t&&(this.type===a._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):o.init=null,e.declarations.push(this.finishNode(o,"VariableDeclarator")),!this.eat(a.comma))break}return e},k.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?$t:Re,!1)};var et=1,qt=2,Si=4;k.parseFunction=function(e,t,i,s,o){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===a.star&&t&qt&&this.unexpected(),e.generator=this.eat(a.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&et&&(e.id=t&Si&&this.type!==a.name?null:this.parseIdent(),e.id&&!(t&qt)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?$t:Re:yi));var d=this.yieldPos,m=this.awaitPos,v=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Bt(e.async,e.generator)),t&et||(e.id=this.type===a.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,o),this.yieldPos=d,this.awaitPos=m,this.awaitIdentPos=v,this.finishNode(e,t&et?"FunctionDeclaration":"FunctionExpression")},k.parseFunctionParams=function(e){this.expect(a.parenL),e.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},k.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var s=this.enterClassBody(),o=this.startNode(),d=!1;for(o.body=[],this.expect(a.braceL);this.type!==a.braceR;){var m=this.parseClassElement(e.superClass!==null);m&&(o.body.push(m),m.type==="MethodDefinition"&&m.kind==="constructor"?(d&&this.raiseRecoverable(m.start,"Duplicate constructor in the same class"),d=!0):m.key&&m.key.type==="PrivateIdentifier"&&Kr(s,m)&&this.raiseRecoverable(m.key.start,"Identifier '#"+m.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(o,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},k.parseClassElement=function(e){if(this.eat(a.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),s="",o=!1,d=!1,m="method",v=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(a.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===a.star?v=!0:s="static"}if(i.static=v,!s&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===a.star)&&!this.canInsertSemicolon()?d=!0:s="async"),!s&&(t>=9||!d)&&this.eat(a.star)&&(o=!0),!s&&!d&&!o){var y=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?m=y:s=y)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===a.parenL||m!=="method"||o||d){var L=!i.static&>(i,"constructor"),M=L&&e;L&&m!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=L?"constructor":m,this.parseClassMethod(i,o,d,M)}else this.parseClassField(i);return i},k.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},k.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)},k.parseClassMethod=function(e,t,i,s){var o=e.key;e.kind==="constructor"?(t&&this.raise(o.start,"Constructor can't be a generator"),i&&this.raise(o.start,"Constructor can't be an async method")):e.static&>(e,"prototype")&&this.raise(o.start,"Classes may not have a static property named prototype");var d=e.value=this.parseMethod(t,i,s);return e.kind==="get"&&d.params.length!==0&&this.raiseRecoverable(d.start,"getter should have no params"),e.kind==="set"&&d.params.length!==1&&this.raiseRecoverable(d.start,"setter should have exactly one param"),e.kind==="set"&&d.params[0].type==="RestElement"&&this.raiseRecoverable(d.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},k.parseClassField=function(e){return gt(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&>(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(a.eq)?(this.enterScope(Ze|pt),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},k.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Be|pt);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")},k.parseClassId=function(e,t){this.type===a.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Re,!1)):(t===!0&&this.unexpected(),e.id=null)},k.parseClassSuper=function(e){e.superClass=this.eat(a._extends)?this.parseExprSubscripts(null,!1):null},k.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},k.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var s=this.privateNameStack.length,o=s===0?null:this.privateNameStack[s-1],d=0;d<i.length;++d){var m=i[d];T(t,m.name)||(o?o.used.push(m):this.raiseRecoverable(m.start,"Private field '#"+m.name+"' must be declared in an enclosing class"))}};function Kr(e,t){var i=t.key.name,s=e[i],o="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(o=(t.static?"s":"i")+t.kind),s==="iget"&&o==="iset"||s==="iset"&&o==="iget"||s==="sget"&&o==="sset"||s==="sset"&&o==="sget"?(e[i]="true",!1):s?!0:(e[i]=o,!1)}function gt(e,t){var i=e.computed,s=e.key;return!i&&(s.type==="Identifier"&&s.name===t||s.type==="Literal"&&s.value===t)}k.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")},k.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,s=e.specifiers;i<s.length;i+=1){var o=s[i];this.checkUnreserved(o.local),this.checkLocalExport(o.local),o.local.type==="Literal"&&this.raise(o.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")},k.parseExportDeclaration=function(e){return this.parseStatement(null)},k.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,et|Si,!1,e)}else if(this.type===a._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var s=this.parseMaybeAssign();return this.semicolon(),s}},k.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),T(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)},k.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var s=0,o=t.properties;s<o.length;s+=1){var d=o[s];this.checkPatternExport(e,d)}else if(i==="ArrayPattern")for(var m=0,v=t.elements;m<v.length;m+=1){var y=v[m];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)},k.checkVariableExport=function(e,t){if(e)for(var i=0,s=t;i<s.length;i+=1){var o=s[i];this.checkPatternExport(e,o.id)}},k.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},k.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")},k.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},k.parseImport=function(e){return this.next(),this.type===a.string?(e.specifiers=Jr,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")},k.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,Re),this.finishNode(e,"ImportSpecifier")},k.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Re),this.finishNode(e,"ImportDefaultSpecifier")},k.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,Re),this.finishNode(e,"ImportNamespaceSpecifier")},k.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},k.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 s=this.parseImportAttribute(),o=s.key.type==="Identifier"?s.key.name:s.key.value;T(t,o)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+o+"'"),t[o]=!0,e.push(s)}return e},k.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")},k.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===a.string){var e=this.parseLiteral(this.value);return Q.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},k.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)},k.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 ye=Y.prototype;ye.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 s=0,o=e.properties;s<o.length;s+=1){var d=o[s];this.toAssignable(d,t),d.type==="RestElement"&&(d.argument.type==="ArrayPattern"||d.argument.type==="ObjectPattern")&&this.raise(d.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},ye.toAssignableList=function(e,t){for(var i=e.length,s=0;s<i;s++){var o=e[s];o&&this.toAssignable(o,t)}if(i){var d=e[i-1];this.options.ecmaVersion===6&&t&&d&&d.type==="RestElement"&&d.argument.type!=="Identifier"&&this.unexpected(d.argument.start)}return e},ye.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},ye.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")},ye.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()},ye.parseBindingList=function(e,t,i,s){for(var o=[],d=!0;!this.eat(e);)if(d?d=!1:this.expect(a.comma),t&&this.type===a.comma)o.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===a.ellipsis){var m=this.parseRestBinding();this.parseBindingListItem(m),o.push(m),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else o.push(this.parseAssignableListItem(s))}return o},ye.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},ye.parseBindingListItem=function(e){return e},ye.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(a.eq))return i;var s=this.startNodeAt(e,t);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")},ye.checkLValSimple=function(e,t,i){t===void 0&&(t=dt);var s=t!==dt;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(s?"Binding ":"Assigning to ")+e.name+" in strict mode"),s&&(t===Re&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(T(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==wi&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":s&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(s?"Binding":"Assigning to")+" rvalue")}},ye.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=dt),e.type){case"ObjectPattern":for(var s=0,o=e.properties;s<o.length;s+=1){var d=o[s];this.checkLValInnerPattern(d,t,i)}break;case"ArrayPattern":for(var m=0,v=e.elements;m<v.length;m+=1){var y=v[m];y&&this.checkLValInnerPattern(y,t,i)}break;default:this.checkLValSimple(e,t,i)}},ye.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=dt),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 be=function(t,i,s,o,d){this.token=t,this.isExpr=!!i,this.preserveSpace=!!s,this.override=o,this.generator=!!d},J={b_stat:new be("{",!1),b_expr:new be("{",!0),b_tmpl:new be("${",!1),p_stat:new be("(",!1),p_expr:new be("(",!0),q_tmpl:new be("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new be("function",!1),f_expr:new be("function",!0),f_expr_gen:new be("function",!0,!1,null,!0),f_gen:new be("function",!1,!1,null,!0)},We=Y.prototype;We.initialContext=function(){return[J.b_stat]},We.curContext=function(){return this.context[this.context.length-1]},We.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?x.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},We.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},We.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},We.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&&x.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 j=Y.prototype;j.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var s=e.key,o;switch(s.type){case"Identifier":o=s.name;break;case"Literal":o=String(s.value);break;default:return}var d=e.kind;if(this.options.ecmaVersion>=6){o==="__proto__"&&d==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),t.proto=!0);return}o="$"+o;var m=t[o];if(m){var v;d==="init"?v=this.strict&&m.init||m.get||m.set:v=m.init||m[d],v&&this.raiseRecoverable(s.start,"Redefinition of property")}else m=t[o]={init:!1,get:!1,set:!1};m[d]=!0}},j.parseExpression=function(e,t){var i=this;return this.catchStackOverflow(function(){var s=i.start,o=i.startLoc,d=i.parseMaybeAssign(e,t);if(i.type===a.comma){var m=i.startNodeAt(s,o);for(m.expressions=[d];i.eat(a.comma);)m.expressions.push(i.parseMaybeAssign(e,t));return i.finishNode(m,"SequenceExpression")}return d})},j.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var s=!1,o=-1,d=-1,m=-1;t?(o=t.parenthesizedAssign,d=t.trailingComma,m=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new mt,s=!0);var v=this.start,y=this.startLoc;(this.type===a.parenL||this.type===a.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var L=this.parseMaybeConditional(e,t);if(i&&(L=i.call(this,L,v,y)),this.type.isAssign){var M=this.startNodeAt(v,y);return M.operator=this.value,this.type===a.eq&&(L=this.toAssignable(L,!1,t)),s||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=L.start&&(t.shorthandAssign=-1),this.type===a.eq?this.checkLValPattern(L):this.checkLValSimple(L),M.left=L,this.next(),M.right=this.parseMaybeAssign(e),m>-1&&(t.doubleProto=m),this.finishNode(M,"AssignmentExpression")}else s&&this.checkExpressionErrors(t,!0);return o>-1&&(t.parenthesizedAssign=o),d>-1&&(t.trailingComma=d),L},j.parseMaybeConditional=function(e,t){var i=this.start,s=this.startLoc,o=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return o;if(!(o.type==="ArrowFunctionExpression"&&o.start===i)&&this.eat(a.question)){var d=this.startNodeAt(i,s);return d.test=o,d.consequent=this.parseMaybeAssign(),this.expect(a.colon),d.alternate=this.parseMaybeAssign(e),this.finishNode(d,"ConditionalExpression")}return o},j.parseExprOps=function(e,t){var i=this.start,s=this.startLoc,o=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||o.start===i&&o.type==="ArrowFunctionExpression"?o:this.parseExprOp(o,i,s,-1,e)},j.parseExprOp=function(e,t,i,s,o){var d=this.type.binop;if(d!=null&&(!o||this.type!==a._in)&&d>s){var m=this.type===a.logicalOR||this.type===a.logicalAND,v=this.type===a.coalesce;v&&(d=a.logicalAND.binop);var y=this.value;this.next();var L=this.start,M=this.startLoc,K=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,o),L,M,d,o),oe=this.buildBinary(t,i,e,K,y,m||v);return(m&&this.type===a.coalesce||v&&(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(oe,t,i,s,o)}return e},j.buildBinary=function(e,t,i,s,o,d){s.type==="PrivateIdentifier"&&this.raise(s.start,"Private identifier can only be left side of binary expression");var m=this.startNodeAt(e,t);return m.left=i,m.operator=o,m.right=s,this.finishNode(m,d?"LogicalExpression":"BinaryExpression")},j.parseMaybeUnary=function(e,t,i,s){var o=this.start,d=this.startLoc,m;if(this.isContextual("await")&&this.canAwait)m=this.parseAwait(s),t=!0;else if(this.type.prefix){var v=this.startNode(),y=this.type===a.incDec;v.operator=this.value,v.prefix=!0,this.next(),v.argument=this.parseMaybeUnary(null,!0,y,s),this.checkExpressionErrors(e,!0),y?this.checkLValSimple(v.argument):this.strict&&v.operator==="delete"&&ki(v.argument)?this.raiseRecoverable(v.start,"Deleting local variable in strict mode"):v.operator==="delete"&&Wt(v.argument)?this.raiseRecoverable(v.start,"Private fields can not be deleted"):t=!0,m=this.finishNode(v,y?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===a.privateId)(s||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),m=this.parsePrivateIdent(),this.type!==a._in&&this.unexpected();else{if(m=this.parseExprSubscripts(e,s),this.checkExpressionErrors(e))return m;for(;this.type.postfix&&!this.canInsertSemicolon();){var L=this.startNodeAt(o,d);L.operator=this.value,L.prefix=!1,L.argument=m,this.checkLValSimple(m),this.next(),m=this.finishNode(L,"UpdateExpression")}}if(!i&&this.eat(a.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(o,d,m,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return m};function ki(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&ki(e.expression)}function Wt(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Wt(e.expression)||e.type==="ParenthesizedExpression"&&Wt(e.expression)}j.parseExprSubscripts=function(e,t){var i=this.start,s=this.startLoc,o=this.parseExprAtom(e,t);if(o.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return o;var d=this.parseSubscripts(o,i,s,!1,t);return e&&d.type==="MemberExpression"&&(e.parenthesizedAssign>=d.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=d.start&&(e.parenthesizedBind=-1),e.trailingComma>=d.start&&(e.trailingComma=-1)),d},j.parseSubscripts=function(e,t,i,s,o){for(var d=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,m=!1;;){var v=this.parseSubscript(e,t,i,s,d,m,o);if(v.optional&&(m=!0),v===e||v.type==="ArrowFunctionExpression"){if(m){var y=this.startNodeAt(t,i);y.expression=v,v=this.finishNode(y,"ChainExpression")}return v}e=v}},j.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(a.arrow)},j.parseSubscriptAsyncArrow=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,s)},j.parseSubscript=function(e,t,i,s,o,d,m){var v=this.options.ecmaVersion>=11,y=v&&this.eat(a.questionDot);s&&y&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var L=this.eat(a.bracketL);if(L||y&&this.type!==a.parenL&&this.type!==a.backQuote||this.eat(a.dot)){var M=this.startNodeAt(t,i);M.object=e,L?(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=!!L,v&&(M.optional=y),e=this.finishNode(M,"MemberExpression")}else if(!s&&this.eat(a.parenL)){var K=new mt,oe=this.yieldPos,rt=this.awaitPos,He=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var wt=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1,K);if(o&&!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=oe,this.awaitPos=rt,this.awaitIdentPos=He,this.parseSubscriptAsyncArrow(t,i,wt,m);this.checkExpressionErrors(K,!0),this.yieldPos=oe||this.yieldPos,this.awaitPos=rt||this.awaitPos,this.awaitIdentPos=He||this.awaitIdentPos;var ze=this.startNodeAt(t,i);ze.callee=e,ze.arguments=wt,v&&(ze.optional=y),e=this.finishNode(ze,"CallExpression")}else if(this.type===a.backQuote){(y||d)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Ge=this.startNodeAt(t,i);Ge.tag=e,Ge.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(Ge,"TaggedTemplateExpression")}return e},j.parseExprAtom=function(e,t,i){this.type===a.slash&&this.readRegexp();var s,o=this.potentialArrowAt===this.start;switch(this.type){case a._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type===a.parenL&&!this.allowDirectSuper&&this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==a.dot&&this.type!==a.bracketL&&this.type!==a.parenL&&this.unexpected(),this.finishNode(s,"Super");case a._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case a.name:var d=this.start,m=this.startLoc,v=this.containsEsc,y=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!v&&y.name==="async"&&!this.canInsertSemicolon()&&this.eat(a._function))return this.overrideContext(J.f_expr),this.parseFunction(this.startNodeAt(d,m),0,!1,!0,t);if(o&&!this.canInsertSemicolon()){if(this.eat(a.arrow))return this.parseArrowExpression(this.startNodeAt(d,m),[y],!1,t);if(this.options.ecmaVersion>=8&&y.name==="async"&&this.type===a.name&&!v&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return y=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(a.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(d,m),[y],!0,t)}return y;case a.regexp:var L=this.value;return s=this.parseLiteral(L.value),s.regex={pattern:L.pattern,flags:L.flags},s;case a.num:case a.string:return this.parseLiteral(this.value);case a._null:case a._true:case a._false:return s=this.startNode(),s.value=this.type===a._null?null:this.type===a._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case a.parenL:var M=this.start,K=this.parseParenAndDistinguishExpression(o,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(K)&&(e.parenthesizedAssign=M),e.parenthesizedBind<0&&(e.parenthesizedBind=M)),K;case a.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(a.bracketR,!0,!0,e),this.finishNode(s,"ArrayExpression");case a.braceL:return this.overrideContext(J.b_expr),this.parseObj(!1,e);case a._function:return s=this.startNode(),this.next(),this.parseFunction(s,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()}},j.parseExprAtomDefault=function(){this.unexpected()},j.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()},j.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")},j.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")},j.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")},j.parseParenExpression=function(){this.expect(a.parenL);var e=this.parseExpression();return this.expect(a.parenR),e},j.shouldParseArrow=function(e){return!this.canInsertSemicolon()},j.parseParenAndDistinguishExpression=function(e,t){var i=this.start,s=this.startLoc,o,d=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var m=this.start,v=this.startLoc,y=[],L=!0,M=!1,K=new mt,oe=this.yieldPos,rt=this.awaitPos,He;for(this.yieldPos=0,this.awaitPos=0;this.type!==a.parenR;)if(L?L=!1:this.expect(a.comma),d&&this.afterTrailingComma(a.parenR,!0)){M=!0;break}else if(this.type===a.ellipsis){He=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 wt=this.lastTokEnd,ze=this.lastTokEndLoc;if(this.expect(a.parenR),e&&this.shouldParseArrow(y)&&this.eat(a.arrow))return this.checkPatternErrors(K,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=oe,this.awaitPos=rt,this.parseParenArrowList(i,s,y,t);(!y.length||M)&&this.unexpected(this.lastTokStart),He&&this.unexpected(He),this.checkExpressionErrors(K,!0),this.yieldPos=oe||this.yieldPos,this.awaitPos=rt||this.awaitPos,y.length>1?(o=this.startNodeAt(m,v),o.expressions=y,this.finishNodeAt(o,"SequenceExpression",wt,ze)):o=y[0]}else o=this.parseParenExpression();if(this.options.preserveParens){var Ge=this.startNodeAt(i,s);return Ge.expression=o,this.finishNode(Ge,"ParenthesizedExpression")}else return o},j.parseParenItem=function(e){return e},j.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,s)};var Qr=[];j.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 s=this.start,o=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,o,!0,!1),e.callee.type==="Super"&&this.raiseRecoverable(s,"Invalid use of 'super'"),this.eat(a.parenL)?e.arguments=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Qr,this.finishNode(e,"NewExpression")},j.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,`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var C=_((fe,S)=>{var n=require("fs");function
|
|
2
|
-
`,{mode:384}),n.renameSync(t,e);try{n.chmodSync(e,384)}catch{}}finally{n.rmSync(t,{force:!0})}}async function q(e,r,t){n.mkdirSync(require("path").dirname(e),{recursive:!0,mode:448});let i=`${e}.lock`,c=Date.now()+2e4,s;for(;s===void 0;)try{s=n.openSync(i,"wx",384),n.writeFileSync(s,String(process.pid))}catch(w){if(w.code!=="EEXIST")throw w;try{let u=Number(n.readFileSync(i,"utf8"));if(Number.isInteger(u)&&u>0)try{process.kill(u,0)}catch(a){if(a.code==="ESRCH"){n.unlinkSync(i);continue}}}catch(u){if(u.code==="ENOENT")continue}if(Date.now()>=c)throw t();await new Promise(u=>setTimeout(u,50))}try{return await r()}finally{n.closeSync(s),n.unlinkSync(i)}}S.exports={writePrivateJsonFileAtomic:J,withPrivateFileLock:q,readJsonFileSafe:
|
|
1
|
+
var _=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var C=_((fe,S)=>{var n=require("fs");function L(e){try{let r=n.readFileSync(e,"utf8");return JSON.parse(r)}catch(r){if(r.code==="ENOENT")return null;throw r}}function P(e){try{return n.readFileSync(e,"utf8").replace(/^\uFEFF/,"")}catch(r){if(r.code==="ENOENT")return null;throw r}}function R(e,r,t=2){let i=JSON.stringify(r,null,t);n.writeFileSync(e,i,"utf8")}function U(e,r){n.writeFileSync(e,r,"utf8")}function O(e,r){if(r==null||typeof r=="object"&&Object.keys(r).length===0||Array.isArray(r)&&r.length===0){let i=`module.exports = ${Array.isArray(r)?"[]":"{}"};`;n.writeFileSync(e,i,"utf8")}else{let t=`module.exports = ${JSON.stringify(r,null,2)};`;n.writeFileSync(e,t,"utf8")}}function b(e){return n.existsSync(e)}function $(e){n.mkdirSync(e,{recursive:!0})}function j(e){n.rmSync(e,{recursive:!0,force:!0})}function H(e){n.rmSync(e,{force:!0})}function J(e,r){n.mkdirSync(require("path").dirname(e),{recursive:!0,mode:448});let t=`${e}.${process.pid}.${Date.now()}.tmp`;try{n.writeFileSync(t,`${JSON.stringify(r,null,2)}
|
|
2
|
+
`,{mode:384}),n.renameSync(t,e);try{n.chmodSync(e,384)}catch{}}finally{n.rmSync(t,{force:!0})}}async function q(e,r,t){n.mkdirSync(require("path").dirname(e),{recursive:!0,mode:448});let i=`${e}.lock`,c=Date.now()+2e4,s;for(;s===void 0;)try{s=n.openSync(i,"wx",384),n.writeFileSync(s,String(process.pid))}catch(w){if(w.code!=="EEXIST")throw w;try{let u=Number(n.readFileSync(i,"utf8"));if(Number.isInteger(u)&&u>0)try{process.kill(u,0)}catch(a){if(a.code==="ESRCH"){n.unlinkSync(i);continue}}}catch(u){if(u.code==="ENOENT")continue}if(Date.now()>=c)throw t();await new Promise(u=>setTimeout(u,50))}try{return await r()}finally{n.closeSync(s),n.unlinkSync(i)}}S.exports={writePrivateJsonFileAtomic:J,withPrivateFileLock:q,readJsonFileSafe:L,readFileSafe:P,writeJsonFile:R,writeTextFile:U,writeModuleExportsFile:O,fileExists:b,ensureDirectoryExists:$,removeDirectory:j,removeFile:H}});var g=_((le,k)=>{var M="https://app.frontfriend.dev",K=".cache/frontfriend",V={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"]},B={FF_ID:"FF_ID",FF_API_URL:"FF_API_URL",FF_AUTH_TOKEN:"FF_AUTH_TOKEN",FF_MACHINE_TOKEN:"FRONTFRIEND_MACHINE_TOKEN"};function Y(e){if(!e)return null;try{let r=new URL(e);return r.hostname.startsWith("app.")?`${r.protocol}//${r.hostname.replace(/^app\./,"registry.")}`:null}catch{return null}}k.exports={DEFAULT_API_URL:M,CACHE_DIR_NAME:K,CACHE_TTL_DAYS:7,CACHE_TTL_MS:6048e5,CACHE_FILES:V,ENV_VARS:B,deriveRegistryFromApiUrl:Y}});var{fileExists:z,readJsonFileSafe:W,removeFile:X,writePrivateJsonFileAtomic:G,withPrivateFileLock:Q}=C(),N=require("path"),Z=require("os"),ee=require("https"),re=require("http"),{URL:d}=require("url"),{DEFAULT_API_URL:y}=g(),te=N.join(Z.homedir(),".frontfriend"),p=N.join(te,"credentials");function ne(){return p}function A(){try{return W(p)}catch{return null}}function I(e){try{let r=JSON.parse(Buffer.from(String(e).split(".")[1],"base64url").toString("utf8"));return typeof r.email=="string"?r.email:null}catch{return null}}function oe(){let e=A();if(!e||!e.accessToken)return null;let r=Number(e.refreshExpiresAt)||0;return{email:I(e.accessToken),apiUrl:e.ffApiUrl||null,expired:r>0&&r<Date.now()}}function v(e){G(p,e)}function ie(){return z(p)?(X(p),!0):!1}function E(e,r=60*1e3){return!e?.accessToken||!e.expiresAt||Date.now()+r>=e.expiresAt}function l(e){let r=new Error(`${e}. Run \`frontfriend login\` to re-authenticate.`);return r.code="FF_AUTH_REFRESH_FAILED",r}function x(e,r,t){return new Promise((i,c)=>{let s=new d(e);if(s.protocol!=="https:"&&!(s.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(s.hostname))){c(new Error("Frontfriend API URLs require HTTPS except on localhost"));return}let w=s.protocol==="https:"?ee:re,u=JSON.stringify(r||{}),a=w.request({hostname:s.hostname,port:s.port,path:`${s.pathname}${s.search}`,method:"POST",headers:{"content-type":"application/json","content-length":Buffer.byteLength(u),...t?{authorization:`Bearer ${t}`}:{}}},o=>{let F="";o.on("data",f=>{F+=f}),o.on("end",()=>{if(o.statusCode>=300&&o.statusCode<400){let h=o.headers.location?` to ${o.headers.location}`:"",T=new Error(`HTTP ${o.statusCode}: redirected${h}`);T.statusCode=o.statusCode,T.body=F,c(T);return}let f=null;try{f=F?JSON.parse(F):null}catch{let T=o.headers["content-type"]||"unknown content-type",m=new Error(`Expected JSON from FrontFriend API at ${e}, but received ${T} (HTTP ${o.statusCode}). Check FF_API_URL or pass --api-url with the FrontFriend app URL.`);if(m.statusCode=o.statusCode,m.body=F,o.statusCode>=400){c(m);return}c(m);return}if(o.statusCode>=400){let h=new Error(f?.error_description||f?.error||`HTTP ${o.statusCode}`);h.statusCode=o.statusCode,h.body=f,c(h);return}i(f)})});a.setTimeout(15e3,()=>a.destroy(Object.assign(new Error("Frontfriend API request timed out"),{code:"ETIMEDOUT"}))),a.on("error",c),a.write(u),a.end()})}async function se(e){return Q(p,e,()=>l("Another process is refreshing the session"))}async function D(e,r=y){return se(async()=>{let t=A();if(t&&new d(t.ffApiUrl||y).origin===new d(r).origin){if(!E(t))return t;e=t}return ce(e,r)})}async function ce(e,r=y){if(new d(r).origin!==new d(e.ffApiUrl||y).origin)throw l("The stored session belongs to a different API origin");if(!e?.refreshToken||!e?.deviceId)throw l("FrontFriend session expired");let t;try{t=await x(`${r}/api/plugin/token`,{grant_type:"refresh_token",refresh_token:e.refreshToken,device_id:e.deviceId})}catch(c){throw Object.assign(l(c?.message||"Could not refresh FrontFriend session"),{cause:c})}if(!t?.access_token||!t?.refresh_token)throw l("Could not refresh FrontFriend session");let i={accessToken:t.access_token,refreshToken:t.refresh_token,deviceId:t.device_id||e.deviceId,expiresAt:Date.now()+(t.expires_in||900)*1e3,refreshExpiresAt:Date.now()+(t.refresh_expires_in||604800)*1e3,ffApiUrl:r};return v(i),i}async function ue(e={}){if(e.envToken)return e.envToken;if(!e.skipCredentials){let r=A();if(r?.accessToken||r?.refreshToken){let t=e.baseURL||r.ffApiUrl||y;if(new d(t).origin!==new d(r.ffApiUrl||y).origin)throw l("The stored session belongs to a different API origin");return r.accessToken&&!E(r)?r.accessToken:(await D(r,t)).accessToken}}return e.configuredToken?(e.silent||console.warn("\u26A0\uFE0F auth-token in frontfriend.config.js is deprecated. Run `frontfriend login` to store credentials outside the repo."),e.configuredToken):null}module.exports={accountEmail:I,signedInAccount:oe,getCredentialsPath:ne,readCredentials:A,writeCredentials:v,deleteCredentials:ie,isExpired:E,postJson:x,refreshCredentials:D,resolveAuthToken:ue,createAuthRefreshError:l};
|