@builder.io/dev-tools 1.26.3 → 1.26.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/cli/index.cjs +25 -25
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +1 -1
- package/core/index.mjs +1 -1
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +1 -1
- package/server/index.cjs +4 -4
- package/server/index.mjs +4 -4
- package/types/cli/codegen.d.ts +1 -1
- package/types/cli/track.d.ts +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
package/cli/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var hDe=Object.create;var sB=Object.defineProperty;var mDe=Object.getOwnPropertyDescriptor;var IDe=Object.getOwnPropertyNames;var EDe=Object.getPrototypeOf,BDe=Object.prototype.hasOwnProperty;var M=(t,e)=>()=>(t&&(e=t(t=0)),e);var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Yu=(t,e)=>{for(var r in e)sB(t,r,{get:e[r],enumerable:!0})},E3=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of IDe(e))!BDe.call(t,i)&&i!==r&&sB(t,i,{get:()=>e[i],enumerable:!(n=mDe(e,i))||n.enumerable});return t};var ie=(t,e,r)=>(r=t!=null?hDe(EDe(t)):{},E3(e||!t||!t.__esModule?sB(r,"default",{value:t,enumerable:!0}):r,t)),en=t=>E3(sB({},"__esModule",{value:!0}),t);var C=M(()=>{{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"
|
|
1
|
+
var hDe=Object.create;var sB=Object.defineProperty;var mDe=Object.getOwnPropertyDescriptor;var IDe=Object.getOwnPropertyNames;var EDe=Object.getPrototypeOf,BDe=Object.prototype.hasOwnProperty;var M=(t,e)=>()=>(t&&(e=t(t=0)),e);var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Yu=(t,e)=>{for(var r in e)sB(t,r,{get:e[r],enumerable:!0})},E3=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of IDe(e))!BDe.call(t,i)&&i!==r&&sB(t,i,{get:()=>e[i],enumerable:!(n=mDe(e,i))||n.enumerable});return t};var ie=(t,e,r)=>(r=t!=null?hDe(EDe(t)):{},E3(e||!t||!t.__esModule?sB(r,"default",{value:t,enumerable:!0}):r,t)),en=t=>E3(sB({},"__esModule",{value:!0}),t);var C=M(()=>{{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"2f3758d2fcfb3674a7c35ffe0e42bba96e039bc0"}}});var Q3=v((dAt,B3)=>{C();function tx(t){return t==null?[]:Array.isArray(t)?t:[t]}function QDe(t,e,r,n){var i,o=t[e],s=~n.string.indexOf(e)?r==null||r===!0?"":String(r):typeof r=="boolean"?r:~n.boolean.indexOf(e)?r==="false"?!1:r==="true"||(t._.push((i=+r,i*0===0?i:r)),!!r):(i=+r,i*0===0?i:r);t[e]=o==null?s:Array.isArray(o)?o.concat(s):[o,s]}B3.exports=function(t,e){t=t||[],e=e||{};var r,n,i,o,s,a={_:[]},A=0,c=0,u=0,l=t.length;let g=e.alias!==void 0,d=e.unknown!==void 0,p=e.default!==void 0;if(e.alias=e.alias||{},e.string=tx(e.string),e.boolean=tx(e.boolean),g)for(r in e.alias)for(n=e.alias[r]=tx(e.alias[r]),A=0;A<n.length;A++)(e.alias[n[A]]=n.concat(r)).splice(A,1);for(A=e.boolean.length;A-- >0;)for(n=e.alias[e.boolean[A]]||[],c=n.length;c-- >0;)e.boolean.push(n[c]);for(A=e.string.length;A-- >0;)for(n=e.alias[e.string[A]]||[],c=n.length;c-- >0;)e.string.push(n[c]);if(p){for(r in e.default)if(o=typeof e.default[r],n=e.alias[r]=e.alias[r]||[],e[o]!==void 0)for(e[o].push(r),A=0;A<n.length;A++)e[o].push(n[A])}let f=d?Object.keys(e.alias):[];for(A=0;A<l;A++){if(i=t[A],i==="--"){a._=a._.concat(t.slice(++A));break}for(c=0;c<i.length&&i.charCodeAt(c)===45;c++);if(c===0)a._.push(i);else if(i.substring(c,c+3)==="no-"){if(o=i.substring(c+3),d&&!~f.indexOf(o))return e.unknown(i);a[o]=!1}else{for(u=c+1;u<i.length&&i.charCodeAt(u)!==61;u++);for(o=i.substring(c,u),s=i.substring(++u)||A+1===l||(""+t[A+1]).charCodeAt(0)===45||t[++A],n=c===2?[o]:o,u=0;u<n.length;u++){if(o=n[u],d&&!~f.indexOf(o))return e.unknown("-".repeat(c)+o);QDe(a,o,u+1<n.length||s,e)}}}if(p)for(r in e.default)a[r]===void 0&&(a[r]=e.default[r]);if(g)for(r in a)for(n=e.alias[r]||[];n.length>0;)a[n.shift()]=a[r];return a}});function DDe(){if(hC!==void 0)return hC;try{return hC=require("prettier"),hC}catch{return hC=null,null}}function yDe(t){let e=[],r=ju.default.dirname(t);for(;r!==ju.default.dirname(r);){let n=ju.default.join(r,".prettierignore");rx.default.existsSync(n)&&e.push(n);let i=ju.default.join(r,".git");if(rx.default.existsSync(i))break;r=ju.default.dirname(r)}return e}function wDe(t){if(t)try{let r=(0,D3.createRequire)(t)("prettier");if(r)return r}catch{}return DDe()}async function _o(t,e,r,n){try{let i=ju.default.resolve(t,n??"file.tsx"),o=wDe(i);if(!o)return e;if(n){let A=yDe(i);if((await o.getFileInfo(i,{ignorePath:A.length>0?A:void 0})).ignored)return e}let s=await o.resolveConfig(i);return await o.format(e,{...s,filepath:n,parser:r})}catch{return e}}var D3,ju,rx,hC,mC=M(()=>{"use strict";C();D3=require("node:module"),ju=ie(require("node:path"),1),rx=ie(require("node:fs"),1)});var nx,Og,aB,AB,y3,$u,ix,ox,qu,w3,Kg=M(()=>{"use strict";C();nx="preview-url",Og="framework",aB="platform",AB="node",y3="/~builder-connect",$u="/~builder-connected",ix="/~builder-dev-tools",ox="/~builder-dev-tools.js",qu="/~builder-dev-tools-close",w3="/mappings"});var cB=v((EAt,b3)=>{"use strict";C();var sx={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},bDe={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},vDe={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?sx.up():"");return t&&(e+=sx.left),e}};b3.exports={cursor:sx,scroll:bDe,erase:vDe,beep:"\x07"}});var Pr=v((QAt,ax)=>{C();var lB=process||{},v3=lB.argv||[],uB=lB.env||{},xDe=!(uB.NO_COLOR||v3.includes("--no-color"))&&(!!uB.FORCE_COLOR||v3.includes("--color")||lB.platform==="win32"||(lB.stdout||{}).isTTY&&uB.TERM!=="dumb"||!!uB.CI),SDe=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+FDe(i,e,r,o)+e:t+i+e},FDe=(t,e,r,n)=>{let i="",o=0;do i+=t.substring(o,n)+r,o=n+e.length,n=t.indexOf(e,o);while(~n);return i+t.substring(o)},x3=(t=xDe)=>{let e=t?SDe:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};ax.exports=x3();ax.exports.createColors=x3});function kDe({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function U3(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(RDe,"")}function G3(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function IC(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=U3(t),t.length===0))return 0;t=t.replace(PDe()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let o=i.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(MDe.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}function UDe(){let t=new Map;for(let[e,r]of Object.entries(Lr)){for(let[n,i]of Object.entries(r))Lr[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Lr[n],t.set(i[0],i[1]);Object.defineProperty(Lr,e,{value:r,enumerable:!1})}return Object.defineProperty(Lr,"codes",{value:t,enumerable:!1}),Lr.color.close="\x1B[39m",Lr.bgColor.close="\x1B[49m",Lr.color.ansi=S3(),Lr.color.ansi256=F3(),Lr.color.ansi16m=k3(),Lr.bgColor.ansi=S3(Ax),Lr.bgColor.ansi256=F3(Ax),Lr.bgColor.ansi16m=k3(Ax),Object.defineProperties(Lr,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Lr.rgbToAnsi256(...Lr.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Lr.ansi256ToAnsi(Lr.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Lr.ansi256ToAnsi(Lr.hexToAnsi256(e)),enumerable:!1}}),Lr}function M3(t,e,r){return String(t).normalize().replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`).map(n=>YDe(n,e,r)).join(`
|
|
4
4
|
`)}function dx(t,e){if(typeof t=="string")return pB.aliases.get(t)===e;for(let r of t)if(r!==void 0&&dx(r,e))return!0;return!1}function $De(t,e){if(t===e)return;let r=t.split(`
|
|
@@ -73,7 +73,7 @@ ${q3}${n.trimStart()}`),r=3+(0,Vu.stripVTControlCharacters)(n.trimStart()).lengt
|
|
|
73
73
|
`),p(),i()};return{start:I,stop:E,message:(B="")=>{a=h(B??a)}}}});function Pt(t,e=""){return t.ts.createSourceFile("module.tsx",typeof e=="string"?e:"",t.ts.ScriptTarget.Latest,void 0)}function EB(t,e=""){let r=Pt(t,e?.trim());if(r.statements.length===0)throw new Error(`No statements found in code: ${e}`);return r.statements[0]}function _n(t,e,r){if(e){let n=t.ts.createPrinter({newLine:t.ts.NewLineKind.LineFeed,removeComments:r});return t.ts.isSourceFile(e)?n.printFile(e).trim()+`
|
|
74
74
|
`:n.printNode(t.ts.EmitHint.Unspecified,e,t.ts.createSourceFile("module.tsx","",t.ts.ScriptTarget.Latest)).trim()+`
|
|
75
75
|
`}return""}var zr=M(()=>{"use strict";C()});var rK=v((_At,tK)=>{"use strict";C();tK.exports=function(){if(process.env.npm_config_user_agent)return uye(process.env.npm_config_user_agent)};function uye(t){let e=t.split(" ")[0],r=e.lastIndexOf("/"),n=e.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:e.substring(r+1)}}});function Ui(t){return t.endsWith(".mapper.tsx")||t.endsWith(".mapper.jsx")||t.endsWith(".mapper.ts")||t.endsWith(".mapper.js")||t.endsWith(".mapper.mjs")}function Lt(t,e,r){e=Os(e),r=Os(r),e=t.dirname(e);let n=t.basename(r,t.extname(r));r=t.dirname(r);let i;return n==="index"?i=t.relative(e,r):i=t.relative(e,t.join(r,n)),i=Os(t.normalize(i)),i.startsWith(".")||(i="./"+i),i}function Os(t){return t.startsWith("\\\\?\\")?t:t.replace(/\\/g,"/")}function Wu(t,e){let r=t.extname(e),n=t.basename(e,r).split(/[\/\\]/),i=n[n.length-1];return nK(i==="index"?t.basename(t.dirname(e)):i)}function nK(t){return Er(t).replace(/ /g,"")}function is(t,e){let r=t.extname(e),n=Os(t.basename(e,r)).split("/").pop();return Er(n==="index"?t.basename(t.dirname(e)):n)}function Br(t,e){let r=Os(t.relative(t.getAppRootDir(),e));r=r.split("/").filter(i=>i!=="."&&i!==".."&&i!=="").join("/"),r.endsWith(".tsx")||r.endsWith(".jsx")?r=r.slice(0,-4):(r.endsWith(".ts")||r.endsWith(".js"))&&(r=r.slice(0,-3));let n=t.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(i=>i.name.includes("next"))?"@/"+r:"~/"+r}function Zt(t,e){let r=e,n=[];for(let i=0;i<2;i++){let o=t.basename(r);if(!o||o==="components")break;n.unshift(o),r=t.dirname(r)}return n.join("/")}function Er(t){for(t=t.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();t.includes(" ");)t=t.replace(/ /g," ");return t.split(" ").map(e=>e.length>2?e[0].toUpperCase()+e.slice(1):e).join("").trim()}function lo(t){return t.sort((e,r)=>e.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function fr(t,e,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${e}`);return n&&(e=n),e=t.normalize(e),(await t.hash(e+"#"+r)).substring(0,8)}async function oK(t){return(await t.hash(t.getAppRootDir())).substring(0,8)}function BC(t){return typeof t=="number"}function Yg(t){return typeof t=="boolean"}function Gi(t){return typeof t=="string"}function jg(t){return typeof t=="string"?/^[A-Z][A-Za-z0-9]*$/.test(t):!1}function Go(t){return JSON.parse(JSON.stringify(t))}function BB(t,e,r){for(let n of e)if(t.dirname(r).includes(n))return!0;return!1}function sK(){try{let t=(0,iK.default)();if(t?.name)return t.name}catch{}return"npm"}function lye(){return process.platform.startsWith("win")}function cr(){return process.pkg?"@builder.io/agent":lye()?'"@builder.io/dev-tools"':"builder.io"}function Ex(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_")}var iK,Ft=M(()=>{"use strict";C();iK=ie(rK(),1)});function Oi(t){let e=t.join(t.getAppRootDir(),"tsconfig.json");return t.exists(e)}async function go(t,e){async function r(i,o){if(o>10)return;let s=await t.readdir(i);for(let a of s){if(gye.includes(a))continue;let A=t.join(i,a),c=await t.stat(A);if(c){if(c.isFile()&&a.startsWith("builder-registry."))return A;if(c.isDirectory()){let u=await r(A,o+1);if(u)return u}}}}let n=await r(t.getAppRootDir(),0);if(!n){let o=`builder-registry.${await Oi(t)?"ts":"js"}`;return t.join(e,o)}return n}async function Ks(t,e){let r=t.resolve("/");for(let n=0;n<20;n++){let i=t.join(e,"package.json"),o=await t.readFile(i);if(o)return JSON.parse(o);if(e===r)break;e=t.dirname(e)}return null}async function aK(t,e){for(let r=0;r<20;r++){let n=t.dirname(e),i=t.join(n,"node_modules");if(await t.exists(i))return i;if(e===t.getAppRootDir())break;e=t.dirname(e)}return t.join(t.getAppRootDir(),"node_modules")}async function QC(t,e,r){let n=await t.readdir(e);return n.includes(r)?t.join(e,r):(await Promise.all(n.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let s=t.join(e,o);if((await t.stat(s)).isDirectory()){let A=await QC(t,s,r);if(A)return A}}))).find(o=>typeof o=="string")}var gye,Ii=M(()=>{"use strict";C();gye=["node_modules","dist","build","public"]});async function Sn(t,e,r){if(!Array.isArray(e)||e.length===0)throw new Error(`createTsProgram() Invalid filePaths: ${e}`);let n=await aK(t,e[0]),i=t.join(n,"typescript","lib"),o=new Map,s={fileExists:a=>{if(a=t.normalize(a),a.includes("node_modules")){let A=DC.get(a);if(!A){try{t.statSync(a).isFile()?A={exists:!0,content:t.readFileSync(a)}:A={exists:!1}}catch{A={exists:!1}}DC.set(a,A)}return A.exists}if(!o.has(a))if(t.existsSync(a)){let c=t.statSync(a);o.set(a,c.isFile())}else o.set(a,!1);return o.get(a)},getCanonicalFileName:a=>t.normalize(a),getCurrentDirectory:()=>t.cwd(),getDefaultLibFileName:()=>t.join(i,"lib.d.ts"),getDefaultLibLocation:()=>i,getNewLine:()=>`
|
|
76
|
-
`,getSourceFile:a=>{if(a=t.normalize(a),a.includes("node_modules")){let c=DC.get(a);if(c)return Pt(t,c.content)}let A;try{A=t.readFileSync(a)}catch{console.error(`Could not read: ${a}`),A==null}if(A==null){let c=t.basename(a),u=t.extname(c).toLowerCase();if(a.startsWith(i)&&u===".ts"&&(A=cK.get(c),A==null&&typeof self<"u"&&typeof fetch=="function"))throw new DB(c)}return a.includes("node_modules")&&(A?DC.set(a,{exists:!0,content:A}):DC.set(a,{exists:!1})),Pt(t,A)},readFile:a=>{let A=t.readFileSync(a);return typeof A=="string"?A:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return pye(t,s,e,r)}catch(a){if(a instanceof DB){await dye(t,a.libName);continue}throw t.Sentry?.captureException(a),new Error(`createTsProgram() Could not create program for: ${e[0]}`,{cause:a})}}function pye(t,e,r,n){let i={rootNames:[...r],host:e,options:{}},o=t.ts.findConfigFile(t.dirname(r[0]),s=>t.existsSync(s));if(o){let s=AK.get(o);if(!s){let a=t.ts.readConfigFile(o,A=>{let c=t.readFileSync(A);return typeof c=="string"?c:void 0});a.error?t.Sentry?.captureException(new Error("Error reading tsconfig for createTsProgram"),{extra:{error:a.error,tsConfigPath:o}}):(s=t.ts.parseJsonConfigFileContent(a.config,t.ts.sys||{useCaseSensitiveFileNames:!1,readDirectory:(c,u)=>t.readdirSync(c),fileExists:c=>t.existsSync(c),readFile:c=>t.readFileSync(c)||void 0},t.dirname(o),void 0,o).options,AK.set(o,s))}s&&(i.options=Go(s))}return i.options.noEmit=!0,i.options.isolatedModules=!1,i.options.strict=!1,i.options.jsx=t.ts.JsxEmit.Preserve,i.options.allowJs=!0,Object.assign(i.options,n),t.ts.createProgram(i)}async function $g(t,e,r){r||(r=await Sn(t,[e]));let n=r.getSourceFile(e);if(!n)throw new Error(`getTypeChecker() Could not find source file: ${e}`);return{typeChecker:r.getTypeChecker(),sourceFile:n}}async function dye(t,e){let r=`https://cdn.jsdelivr.net/npm/typescript@${t.ts.version}/lib/${e}`;QB.has(e)||QB.set(e,fetch(r).then(n=>n.text()).then(n=>{cK.set(e,n)})),await QB.get(e),QB.delete(e)}async function uK(t,e){let r=await t.readFile(e.filePath);return r==null?{diagnostics:[{messageText:`Error reading: ${e.filePath}`}],code:null,output:null}:Bx(t,{code:r,filePath:e.filePath,compilerOptions:e.compilerOptions})}function Bx(t,e){let r={diagnostics:[],code:e.code,output:null};try{let n=t.ts.transpileModule(e.code,{compilerOptions:e.compilerOptions,fileName:e.filePath??"module.tsx",reportDiagnostics:!0});n.diagnostics?.forEach(i=>{r.diagnostics.push({messageText:String(i.messageText)})}),r.output=n.outputText}catch(n){console.error("transpileModule",n),r.diagnostics.push({messageText:String(n)})}return r}var DB,cK,QB,DC,AK,os=M(()=>{"use strict";C();zr();Ft();Ii();DB=class{libName;constructor(e){this.libName=e}};cK=new Map,QB=new Map,DC=new Map,AK=new Map});var fye,pt,un=M(()=>{"use strict";C();fye="1.26.
|
|
76
|
+
`,getSourceFile:a=>{if(a=t.normalize(a),a.includes("node_modules")){let c=DC.get(a);if(c)return Pt(t,c.content)}let A;try{A=t.readFileSync(a)}catch{console.error(`Could not read: ${a}`),A==null}if(A==null){let c=t.basename(a),u=t.extname(c).toLowerCase();if(a.startsWith(i)&&u===".ts"&&(A=cK.get(c),A==null&&typeof self<"u"&&typeof fetch=="function"))throw new DB(c)}return a.includes("node_modules")&&(A?DC.set(a,{exists:!0,content:A}):DC.set(a,{exists:!1})),Pt(t,A)},readFile:a=>{let A=t.readFileSync(a);return typeof A=="string"?A:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return pye(t,s,e,r)}catch(a){if(a instanceof DB){await dye(t,a.libName);continue}throw t.Sentry?.captureException(a),new Error(`createTsProgram() Could not create program for: ${e[0]}`,{cause:a})}}function pye(t,e,r,n){let i={rootNames:[...r],host:e,options:{}},o=t.ts.findConfigFile(t.dirname(r[0]),s=>t.existsSync(s));if(o){let s=AK.get(o);if(!s){let a=t.ts.readConfigFile(o,A=>{let c=t.readFileSync(A);return typeof c=="string"?c:void 0});a.error?t.Sentry?.captureException(new Error("Error reading tsconfig for createTsProgram"),{extra:{error:a.error,tsConfigPath:o}}):(s=t.ts.parseJsonConfigFileContent(a.config,t.ts.sys||{useCaseSensitiveFileNames:!1,readDirectory:(c,u)=>t.readdirSync(c),fileExists:c=>t.existsSync(c),readFile:c=>t.readFileSync(c)||void 0},t.dirname(o),void 0,o).options,AK.set(o,s))}s&&(i.options=Go(s))}return i.options.noEmit=!0,i.options.isolatedModules=!1,i.options.strict=!1,i.options.jsx=t.ts.JsxEmit.Preserve,i.options.allowJs=!0,Object.assign(i.options,n),t.ts.createProgram(i)}async function $g(t,e,r){r||(r=await Sn(t,[e]));let n=r.getSourceFile(e);if(!n)throw new Error(`getTypeChecker() Could not find source file: ${e}`);return{typeChecker:r.getTypeChecker(),sourceFile:n}}async function dye(t,e){let r=`https://cdn.jsdelivr.net/npm/typescript@${t.ts.version}/lib/${e}`;QB.has(e)||QB.set(e,fetch(r).then(n=>n.text()).then(n=>{cK.set(e,n)})),await QB.get(e),QB.delete(e)}async function uK(t,e){let r=await t.readFile(e.filePath);return r==null?{diagnostics:[{messageText:`Error reading: ${e.filePath}`}],code:null,output:null}:Bx(t,{code:r,filePath:e.filePath,compilerOptions:e.compilerOptions})}function Bx(t,e){let r={diagnostics:[],code:e.code,output:null};try{let n=t.ts.transpileModule(e.code,{compilerOptions:e.compilerOptions,fileName:e.filePath??"module.tsx",reportDiagnostics:!0});n.diagnostics?.forEach(i=>{r.diagnostics.push({messageText:String(i.messageText)})}),r.output=n.outputText}catch(n){console.error("transpileModule",n),r.diagnostics.push({messageText:String(n)})}return r}var DB,cK,QB,DC,AK,os=M(()=>{"use strict";C();zr();Ft();Ii();DB=class{libName;constructor(e){this.libName=e}};cK=new Map,QB=new Map,DC=new Map,AK=new Map});var fye,pt,un=M(()=>{"use strict";C();fye="1.26.4",pt=process.env.OVERRIDE_VERSION??fye});async function Zu(t){let e=[],r=await Ks(t,t.getRepoRootDir());if(r){let n=await gK(r,t);e.push(...n)}return e}async function gK(t,e){let r=[];if(t&&typeof t=="object"){let n=new Set(Object.keys({...t.dependencies,...t.devDependencies}));for(let i of Cye)if(n.has(i)&&!r.some(o=>o.name===i)){let o={name:i};lK.has(i)&&(o.version=await lK.get(i)(e)),r.push(o)}}return r}function Qx(t){let e=parseInt(t);return Number.isNaN(e)?void 0:e}var lK,Cye,Xu=M(()=>{"use strict";C();Ii();Ft();lK=new Map([["next",async t=>{if(!t.spawnSync)return;let e=sK(),r=e==="npm"?"npx":e,{stdout:n}=t.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let i=n.match(/(Next.js v)([\d.]+)/g);if(!i)return;let o=i[0].split("Next.js v")[1],[s,a,A]=o.split(".");return{major:Qx(s),minor:Qx(a),patch:Qx(A)}}]]),Cye=["@shopify/remix-oxygen","@shopify/hydrogen","@builder.io/qwik-city","@remix-run/react","@sveltejs/kit","astro","gatsby","next","nuxt","@builder.io/qwik","@angular/core","react","solid-js","svelte","vue"]});async function ss(t){let e=pK(t),r=await t.readFile(e);return typeof r=="string"?JSON.parse(r):{}}async function as(t,e){e=typeof e=="object"&&e!=null?e:{};let r=pK(t);await t.writeFile(r,JSON.stringify(e??{},null,2))}function pK(t){let e=t.getAppRootDir();return t.join(e,"node_modules",".builder","builder-cache.json")}var el=M(()=>{"use strict";C()});async function wa(t,e,r){let n={envKey:r,envValue:null,file:""};for(let i of e){let o=t.join(t.getAppRootDir(),i),s=await hye(t,o);if(s){let a=s[r];if(typeof a=="string"&&a.length>0&&a!=="YOUR_API_KEY")return n.envValue=a,n.file=o,n}}return n.file=t.join(t.getAppRootDir(),e[e.length-1]),n}async function hye(t,e){let r=await t.readFile(e);return typeof r=="string"?dK(r):null}function dK(t){let e={},r=t.replace(/\r\n?/gm,`
|
|
77
77
|
`),n;for(;(n=mye.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
|
|
78
78
|
`),o=o.replace(/\\r/g,"\r")),e[i]=o}return e}async function ba(t,e,r,n){let i="# https://www.builder.io/c/docs/using-your-api-key",o=await t.readFile(e);try{if(o)if(o.includes(r))if(o.includes(n))t.debug(`"${r}" with "${n}" already set in ${e}`);else return t.debug(`Replace "${r}" in ${e}`),o=o.replace(new RegExp(`${r}=.*`),`${r}=${n}`),await t.writeFile(e,o),"update";else return t.debug(`Append "${r}" to ${e}`),o+=`
|
|
79
79
|
|
|
@@ -1106,7 +1106,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),P=H,O=Z),V===void 0&&(
|
|
|
1106
1106
|
`:`
|
|
1107
1107
|
`)+r,i=n+1,n=t.indexOf(`
|
|
1108
1108
|
`,i)}while(n!==-1);return o+=t.slice(i),o}var b9=M(()=>{C()});function VC(t){return F9(t)}var v9,x9,KS,pp,qC,S9,dp,cxe,iQ,F9,HS,uxe,lxe,JS,oQ,gxe,lEt,gEt,k9=M(()=>{C();I9();D9();b9();({stdout:v9,stderr:x9}=Q9),KS=Symbol("GENERATOR"),pp=Symbol("STYLER"),qC=Symbol("IS_EMPTY"),S9=["ansi","ansi","ansi256","ansi16m"],dp=Object.create(null),cxe=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=v9?v9.level:0;t.level=e.level===void 0?r:e.level},iQ=class{constructor(e){return F9(e)}},F9=t=>{let e=(...r)=>r.join(" ");return cxe(e,t),Object.setPrototypeOf(e,VC.prototype),e};Object.setPrototypeOf(VC.prototype,Function.prototype);for(let[t,e]of Object.entries($s))dp[t]={get(){let r=oQ(this,JS(e.open,e.close,this[pp]),this[qC]);return Object.defineProperty(this,t,{value:r}),r}};dp.visible={get(){let t=oQ(this,this[pp],!0);return Object.defineProperty(this,"visible",{value:t}),t}};HS=(t,e,r,...n)=>t==="rgb"?e==="ansi16m"?$s[r].ansi16m(...n):e==="ansi256"?$s[r].ansi256($s.rgbToAnsi256(...n)):$s[r].ansi($s.rgbToAnsi(...n)):t==="hex"?HS("rgb",e,r,...$s.hexToRgb(...n)):$s[r][t](...n),uxe=["rgb","hex","ansi256"];for(let t of uxe){dp[t]={get(){let{level:r}=this;return function(...n){let i=JS(HS(t,S9[r],"color",...n),$s.color.close,this[pp]);return oQ(this,i,this[qC])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);dp[e]={get(){let{level:r}=this;return function(...n){let i=JS(HS(t,S9[r],"bgColor",...n),$s.bgColor.close,this[pp]);return oQ(this,i,this[qC])}}}}lxe=Object.defineProperties(()=>{},{...dp,level:{enumerable:!0,get(){return this[KS].level},set(t){this[KS].level=t}}}),JS=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},oQ=(t,e,r)=>{let n=(...i)=>gxe(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,lxe),n[KS]=t,n[pp]=e,n[qC]=r,n},gxe=(t,e)=>{if(t.level<=0||!e)return t[qC]?"":e;let r=t[pp];if(r===void 0)return e;let{openAll:n,closeAll:i}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=y9(e,r.close,r.open),r=r.parent;let o=e.indexOf(`
|
|
1109
|
-
`);return o!==-1&&(e=w9(e,i,n,o)),n+e+i};Object.defineProperties(VC.prototype,dp);lEt=VC(),gEt=VC({level:x9?x9.level:0})});function zC(t){let e=US(t);return{highlight:r,highlightAuto:n,listLanguages:e.listLanguages,register:e.register,registerAlias:e.registerAlias,registered:e.registered};function r(i,o,s){let a=e.highlight(i,o),A=a.data;return{language:A.language,relevance:A.relevance,value:YS(s||R9,a)}}function n(i,o){let s,a;if(o&&("subset"in o||"sheet"in o)){let u=o;a={subset:u.subset},s=u.sheet}else s=o;let A=e.highlightAuto(i,a),c=A.data;return{language:c.language,relevance:c.relevance,value:YS(s||R9,A)}}}function YS(t,e){let r=new Set(e.type==="element"&&Array.isArray(e.properties.className)?e.properties.className.map(function(a){return String(a).replace(/^hljs-/,"")}):[]),n={},i,o="",s;for(s in t)if(Object.hasOwn(t,s)){let a=s.split(" "),A=t[s];r.has(a[0])?a.length===1?i=A:n[a.slice(1).join(" ")]=A:n[s]=A}return"value"in e?o=e.value:"children"in e&&(o=pxe(n,e.children)),i&&(o=i(o)),o}function pxe(t,e){let r=[],n=-1;for(;++n<e.length;)r.push(YS(t,e[n]));return r.join("")}var Rt,R9,N9=M(()=>{C();k9();GS();Rt=new iQ({level:2}),R9={comment:Rt.gray,quote:Rt.gray,keyword:Rt.green,"selector-tag":Rt.green,addition:Rt.green,number:Rt.cyan,string:Rt.cyan,"meta meta-string":Rt.cyan,literal:Rt.cyan,doctag:Rt.cyan,regexp:Rt.cyan,title:Rt.blue,section:Rt.blue,name:Rt.blue,"selector-id":Rt.blue,"selector-class":Rt.blue,attribute:Rt.yellow,attr:Rt.yellow,variable:Rt.yellow,"template-variable":Rt.yellow,"class title":Rt.yellow,type:Rt.yellow,symbol:Rt.magenta,bullet:Rt.magenta,subst:Rt.magenta,meta:Rt.magenta,"meta keyword":Rt.magenta,"selector-attr":Rt.magenta,"selector-pseudo":Rt.magenta,link:Rt.magenta,built_in:Rt.red,deletion:Rt.red,emphasis:Rt.italic,strong:Rt.bold,formula:Rt.inverse}});var jS=M(()=>{C();GS();N9()});async function Ne(t){if(process.env.NODE_ENV!=="test")try{await Promise.allSettled([M9.flush(2e3),T9.flush().promise])}catch(e){console.error(e)}process.exit(t)}var M9,T9,ls=M(()=>{"use strict";C();M9=ie(require("@sentry/node"),1),T9=ie(require("@amplitude/analytics-node"),1)});var Xe,mn=M(()=>{"use strict";C();Xe=process.env.AIR_HOST||process.env.BUILDER_HOST||"https://api.builder.io"});var L9,P9=M(()=>{L9="1.26.3"});var U9=v($S=>{C();var _9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");$S.encode=function(t){if(0<=t&&t<_9.length)return _9[t];throw new TypeError("Must be between 0 and 63: "+t)};$S.decode=function(t){var e=65,r=90,n=97,i=122,o=48,s=57,a=43,A=47,c=26,u=52;return e<=t&&t<=r?t-e:n<=t&&t<=i?t-n+c:o<=t&&t<=s?t-o+u:t==a?62:t==A?63:-1}});var zS=v(VS=>{C();var G9=U9(),qS=5,O9=1<<qS,K9=O9-1,H9=O9;function fxe(t){return t<0?(-t<<1)+1:(t<<1)+0}function Cxe(t){var e=(t&1)===1,r=t>>1;return e?-r:r}VS.encode=function(e){var r="",n,i=fxe(e);do n=i&K9,i>>>=qS,i>0&&(n|=H9),r+=G9.encode(n);while(i>0);return r};VS.decode=function(e,r,n){var i=e.length,o=0,s=0,a,A;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(A=G9.decode(e.charCodeAt(r++)),A===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));a=!!(A&H9),A&=K9,o=o+(A<<s),s+=qS}while(a);n.value=Cxe(o),n.rest=r}});var Cp=v(Kn=>{C();function hxe(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}Kn.getArg=hxe;var J9=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,mxe=/^data:.+\,.+$/;function WC(t){var e=t.match(J9);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}Kn.urlParse=WC;function fp(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}Kn.urlGenerate=fp;var Ixe=32;function Exe(t){var e=[];return function(r){for(var n=0;n<e.length;n++)if(e[n].input===r){var i=e[0];return e[0]=e[n],e[n]=i,e[0].result}var o=t(r);return e.unshift({input:r,result:o}),e.length>Ixe&&e.pop(),o}}var WS=Exe(function(e){var r=e,n=WC(e);if(n){if(!n.path)return e;r=n.path}for(var i=Kn.isAbsolute(r),o=[],s=0,a=0;;)if(s=a,a=r.indexOf("/",s),a===-1){o.push(r.slice(s));break}else for(o.push(r.slice(s,a));a<r.length&&r[a]==="/";)a++;for(var A,c=0,a=o.length-1;a>=0;a--)A=o[a],A==="."?o.splice(a,1):A===".."?c++:c>0&&(A===""?(o.splice(a+1,c),c=0):(o.splice(a,2),c--));return r=o.join("/"),r===""&&(r=i?"/":"."),n?(n.path=r,fp(n)):r});Kn.normalize=WS;function Y9(t,e){t===""&&(t="."),e===""&&(e=".");var r=WC(e),n=WC(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),fp(r);if(r||e.match(mxe))return e;if(n&&!n.host&&!n.path)return n.host=e,fp(n);var i=e.charAt(0)==="/"?e:WS(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,fp(n)):i}Kn.join=Y9;Kn.isAbsolute=function(t){return t.charAt(0)==="/"||J9.test(t)};function Bxe(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}Kn.relative=Bxe;var j9=(function(){var t=Object.create(null);return!("__proto__"in t)})();function $9(t){return t}function Qxe(t){return q9(t)?"$"+t:t}Kn.toSetString=j9?$9:Qxe;function Dxe(t){return q9(t)?t.slice(1):t}Kn.fromSetString=j9?$9:Dxe;function q9(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function yxe(t,e,r){var n=kA(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:kA(t.name,e.name)}Kn.compareByOriginalPositions=yxe;function wxe(t,e,r){var n;return n=t.originalLine-e.originalLine,n!==0||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:kA(t.name,e.name)}Kn.compareByOriginalPositionsNoSource=wxe;function bxe(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=kA(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:kA(t.name,e.name)}Kn.compareByGeneratedPositionsDeflated=bxe;function vxe(t,e,r){var n=t.generatedColumn-e.generatedColumn;return n!==0||r||(n=kA(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:kA(t.name,e.name)}Kn.compareByGeneratedPositionsDeflatedNoLine=vxe;function kA(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function xxe(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=kA(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:kA(t.name,e.name)}Kn.compareByGeneratedPositionsInflated=xxe;function Sxe(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}Kn.parseSourceMapInput=Sxe;function Fxe(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=WC(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}e=Y9(fp(n),e)}return WS(e)}Kn.computeSourceURL=Fxe});var eF=v(V9=>{C();var ZS=Cp(),XS=Object.prototype.hasOwnProperty,gl=typeof Map<"u";function RA(){this._array=[],this._set=gl?new Map:Object.create(null)}RA.fromArray=function(e,r){for(var n=new RA,i=0,o=e.length;i<o;i++)n.add(e[i],r);return n};RA.prototype.size=function(){return gl?this._set.size:Object.getOwnPropertyNames(this._set).length};RA.prototype.add=function(e,r){var n=gl?e:ZS.toSetString(e),i=gl?this.has(e):XS.call(this._set,n),o=this._array.length;(!i||r)&&this._array.push(e),i||(gl?this._set.set(e,o):this._set[n]=o)};RA.prototype.has=function(e){if(gl)return this._set.has(e);var r=ZS.toSetString(e);return XS.call(this._set,r)};RA.prototype.indexOf=function(e){if(gl){var r=this._set.get(e);if(r>=0)return r}else{var n=ZS.toSetString(e);if(XS.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};RA.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};RA.prototype.toArray=function(){return this._array.slice()};V9.ArraySet=RA});var Z9=v(W9=>{C();var z9=Cp();function kxe(t,e){var r=t.generatedLine,n=e.generatedLine,i=t.generatedColumn,o=e.generatedColumn;return n>r||n==r&&o>=i||z9.compareByGeneratedPositionsInflated(t,e)<=0}function sQ(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}sQ.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};sQ.prototype.add=function(e){kxe(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};sQ.prototype.toArray=function(){return this._sorted||(this._array.sort(z9.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};W9.MappingList=sQ});var tF=v(X9=>{C();var ZC=zS(),ln=Cp(),aQ=eF().ArraySet,Rxe=Z9().MappingList;function gs(t){t||(t={}),this._file=ln.getArg(t,"file",null),this._sourceRoot=ln.getArg(t,"sourceRoot",null),this._skipValidation=ln.getArg(t,"skipValidation",!1),this._ignoreInvalidMapping=ln.getArg(t,"ignoreInvalidMapping",!1),this._sources=new aQ,this._names=new aQ,this._mappings=new Rxe,this._sourcesContents=null}gs.prototype._version=3;gs.fromSourceMap=function(e,r){var n=e.sourceRoot,i=new gs(Object.assign(r||{},{file:e.file,sourceRoot:n}));return e.eachMapping(function(o){var s={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(s.source=o.source,n!=null&&(s.source=ln.relative(n,s.source)),s.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(s.name=o.name)),i.addMapping(s)}),e.sources.forEach(function(o){var s=o;n!==null&&(s=ln.relative(n,o)),i._sources.has(s)||i._sources.add(s);var a=e.sourceContentFor(o);a!=null&&i.setSourceContent(o,a)}),i};gs.prototype.addMapping=function(e){var r=ln.getArg(e,"generated"),n=ln.getArg(e,"original",null),i=ln.getArg(e,"source",null),o=ln.getArg(e,"name",null);!this._skipValidation&&this._validateMapping(r,n,i,o)===!1||(i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:o}))};gs.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=ln.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[ln.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[ln.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};gs.prototype.applySourceMap=function(e,r,n){var i=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var o=this._sourceRoot;o!=null&&(i=ln.relative(o,i));var s=new aQ,a=new aQ;this._mappings.unsortedForEach(function(A){if(A.source===i&&A.originalLine!=null){var c=e.originalPositionFor({line:A.originalLine,column:A.originalColumn});c.source!=null&&(A.source=c.source,n!=null&&(A.source=ln.join(n,A.source)),o!=null&&(A.source=ln.relative(o,A.source)),A.originalLine=c.line,A.originalColumn=c.column,c.name!=null&&(A.name=c.name))}var u=A.source;u!=null&&!s.has(u)&&s.add(u);var l=A.name;l!=null&&!a.has(l)&&a.add(l)},this),this._sources=s,this._names=a,e.sources.forEach(function(A){var c=e.sourceContentFor(A);c!=null&&(n!=null&&(A=ln.join(n,A)),o!=null&&(A=ln.relative(o,A)),this.setSourceContent(A,c))},this)};gs.prototype._validateMapping=function(e,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number"){var o="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(o),!1;throw new Error(o)}if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!i)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;var o="Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:i});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(o),!1;throw new Error(o)}};gs.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,i=0,o=0,s=0,a="",A,c,u,l,g=this._mappings.toArray(),d=0,p=g.length;d<p;d++){if(c=g[d],A="",c.generatedLine!==r)for(e=0;c.generatedLine!==r;)A+=";",r++;else if(d>0){if(!ln.compareByGeneratedPositionsInflated(c,g[d-1]))continue;A+=","}A+=ZC.encode(c.generatedColumn-e),e=c.generatedColumn,c.source!=null&&(l=this._sources.indexOf(c.source),A+=ZC.encode(l-s),s=l,A+=ZC.encode(c.originalLine-1-i),i=c.originalLine-1,A+=ZC.encode(c.originalColumn-n),n=c.originalColumn,c.name!=null&&(u=this._names.indexOf(c.name),A+=ZC.encode(u-o),o=u)),a+=A}return a};gs.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=ln.relative(r,n));var i=ln.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};gs.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};gs.prototype.toString=function(){return JSON.stringify(this.toJSON())};X9.SourceMapGenerator=gs});var e6=v(pl=>{C();pl.GREATEST_LOWER_BOUND=1;pl.LEAST_UPPER_BOUND=2;function rF(t,e,r,n,i,o){var s=Math.floor((e-t)/2)+t,a=i(r,n[s],!0);return a===0?s:a>0?e-s>1?rF(s,e,r,n,i,o):o==pl.LEAST_UPPER_BOUND?e<n.length?e:-1:s:s-t>1?rF(t,s,r,n,i,o):o==pl.LEAST_UPPER_BOUND?s:t<0?-1:t}pl.search=function(e,r,n,i){if(r.length===0)return-1;var o=rF(-1,r.length,e,r,n,i||pl.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&n(r[o],r[o-1],!0)===0;)--o;return o}});var n6=v(r6=>{C();function Nxe(t){function e(i,o,s){var a=i[o];i[o]=i[s],i[s]=a}function r(i,o){return Math.round(i+Math.random()*(o-i))}function n(i,o,s,a){if(s<a){var A=r(s,a),c=s-1;e(i,A,a);for(var u=i[a],l=s;l<a;l++)o(i[l],u,!1)<=0&&(c+=1,e(i,c,l));e(i,c+1,l);var g=c+1;n(i,o,s,g-1),n(i,o,g+1,a)}}return n}function Mxe(t){let e=Nxe.toString();return new Function(`return ${e}`)()(t)}var t6=new WeakMap;r6.quickSort=function(t,e,r=0){let n=t6.get(e);n===void 0&&(n=Mxe(e),t6.set(e,n)),n(t,e,r,t.length-1)}});var s6=v(AQ=>{C();var Ue=Cp(),iF=e6(),hp=eF().ArraySet,Txe=zS(),XC=n6().quickSort;function Sr(t,e){var r=t;return typeof t=="string"&&(r=Ue.parseSourceMapInput(t)),r.sections!=null?new qs(r,e):new ii(r,e)}Sr.fromSourceMap=function(t,e){return ii.fromSourceMap(t,e)};Sr.prototype._version=3;Sr.prototype.__generatedMappings=null;Object.defineProperty(Sr.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Sr.prototype.__originalMappings=null;Object.defineProperty(Sr.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Sr.prototype._charIsMappingSeparator=function(e,r){var n=e.charAt(r);return n===";"||n===","};Sr.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")};Sr.GENERATED_ORDER=1;Sr.ORIGINAL_ORDER=2;Sr.GREATEST_LOWER_BOUND=1;Sr.LEAST_UPPER_BOUND=2;Sr.prototype.eachMapping=function(e,r,n){var i=r||null,o=n||Sr.GENERATED_ORDER,s;switch(o){case Sr.GENERATED_ORDER:s=this._generatedMappings;break;case Sr.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var a=this.sourceRoot,A=e.bind(i),c=this._names,u=this._sources,l=this._sourceMapURL,g=0,d=s.length;g<d;g++){var p=s[g],f=p.source===null?null:u.at(p.source);f!==null&&(f=Ue.computeSourceURL(a,f,l)),A({source:f,generatedLine:p.generatedLine,generatedColumn:p.generatedColumn,originalLine:p.originalLine,originalColumn:p.originalColumn,name:p.name===null?null:c.at(p.name)})}};Sr.prototype.allGeneratedPositionsFor=function(e){var r=Ue.getArg(e,"line"),n={source:Ue.getArg(e,"source"),originalLine:r,originalColumn:Ue.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Ue.compareByOriginalPositions,iF.LEAST_UPPER_BOUND);if(o>=0){var s=this._originalMappings[o];if(e.column===void 0)for(var a=s.originalLine;s&&s.originalLine===a;)i.push({line:Ue.getArg(s,"generatedLine",null),column:Ue.getArg(s,"generatedColumn",null),lastColumn:Ue.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o];else for(var A=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==A;)i.push({line:Ue.getArg(s,"generatedLine",null),column:Ue.getArg(s,"generatedColumn",null),lastColumn:Ue.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o]}return i};AQ.SourceMapConsumer=Sr;function ii(t,e){var r=t;typeof t=="string"&&(r=Ue.parseSourceMapInput(t));var n=Ue.getArg(r,"version"),i=Ue.getArg(r,"sources"),o=Ue.getArg(r,"names",[]),s=Ue.getArg(r,"sourceRoot",null),a=Ue.getArg(r,"sourcesContent",null),A=Ue.getArg(r,"mappings"),c=Ue.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=Ue.normalize(s)),i=i.map(String).map(Ue.normalize).map(function(u){return s&&Ue.isAbsolute(s)&&Ue.isAbsolute(u)?Ue.relative(s,u):u}),this._names=hp.fromArray(o.map(String),!0),this._sources=hp.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(u){return Ue.computeSourceURL(s,u,e)}),this.sourceRoot=s,this.sourcesContent=a,this._mappings=A,this._sourceMapURL=e,this.file=c}ii.prototype=Object.create(Sr.prototype);ii.prototype.consumer=Sr;ii.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Ue.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return-1};ii.fromSourceMap=function(e,r){var n=Object.create(ii.prototype),i=n._names=hp.fromArray(e._names.toArray(),!0),o=n._sources=hp.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(d){return Ue.computeSourceURL(n.sourceRoot,d,r)});for(var s=e._mappings.toArray().slice(),a=n.__generatedMappings=[],A=n.__originalMappings=[],c=0,u=s.length;c<u;c++){var l=s[c],g=new o6;g.generatedLine=l.generatedLine,g.generatedColumn=l.generatedColumn,l.source&&(g.source=o.indexOf(l.source),g.originalLine=l.originalLine,g.originalColumn=l.originalColumn,l.name&&(g.name=i.indexOf(l.name)),A.push(g)),a.push(g)}return XC(n.__originalMappings,Ue.compareByOriginalPositions),n};ii.prototype._version=3;Object.defineProperty(ii.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function o6(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var nF=Ue.compareByGeneratedPositionsDeflatedNoLine;function i6(t,e){let r=t.length,n=t.length-e;if(!(n<=1))if(n==2){let i=t[e],o=t[e+1];nF(i,o)>0&&(t[e]=o,t[e+1]=i)}else if(n<20)for(let i=e;i<r;i++)for(let o=i;o>e;o--){let s=t[o-1],a=t[o];if(nF(s,a)<=0)break;t[o-1]=a,t[o]=s}else XC(t,nF,e)}ii.prototype._parseMappings=function(e,r){var n=1,i=0,o=0,s=0,a=0,A=0,c=e.length,u=0,l={},g={},d=[],p=[],f,h,m,I,E;let B=0;for(;u<c;)if(e.charAt(u)===";")n++,u++,i=0,i6(p,B),B=p.length;else if(e.charAt(u)===",")u++;else{for(f=new o6,f.generatedLine=n,I=u;I<c&&!this._charIsMappingSeparator(e,I);I++);for(h=e.slice(u,I),m=[];u<I;)Txe.decode(e,u,g),E=g.value,u=g.rest,m.push(E);if(m.length===2)throw new Error("Found a source, but no line and column");if(m.length===3)throw new Error("Found a source and line, but no column");if(f.generatedColumn=i+m[0],i=f.generatedColumn,m.length>1&&(f.source=a+m[1],a+=m[1],f.originalLine=o+m[2],o=f.originalLine,f.originalLine+=1,f.originalColumn=s+m[3],s=f.originalColumn,m.length>4&&(f.name=A+m[4],A+=m[4])),p.push(f),typeof f.originalLine=="number"){let w=f.source;for(;d.length<=w;)d.push(null);d[w]===null&&(d[w]=[]),d[w].push(f)}}i6(p,B),this.__generatedMappings=p;for(var Q=0;Q<d.length;Q++)d[Q]!=null&&XC(d[Q],Ue.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...d)};ii.prototype._findMapping=function(e,r,n,i,o,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return iF.search(e,r,o,s)};ii.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};ii.prototype.originalPositionFor=function(e){var r={generatedLine:Ue.getArg(e,"line"),generatedColumn:Ue.getArg(e,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",Ue.compareByGeneratedPositionsDeflated,Ue.getArg(e,"bias",Sr.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var o=Ue.getArg(i,"source",null);o!==null&&(o=this._sources.at(o),o=Ue.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var s=Ue.getArg(i,"name",null);return s!==null&&(s=this._names.at(s)),{source:o,line:Ue.getArg(i,"originalLine",null),column:Ue.getArg(i,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};ii.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};ii.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=Ue.relative(this.sourceRoot,i));var o;if(this.sourceRoot!=null&&(o=Ue.urlParse(this.sourceRoot))){var s=i.replace(/^file:\/\//,"");if(o.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!o.path||o.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')};ii.prototype.generatedPositionFor=function(e){var r=Ue.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:Ue.getArg(e,"line"),originalColumn:Ue.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Ue.compareByOriginalPositions,Ue.getArg(e,"bias",Sr.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===n.source)return{line:Ue.getArg(o,"generatedLine",null),column:Ue.getArg(o,"generatedColumn",null),lastColumn:Ue.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};AQ.BasicSourceMapConsumer=ii;function qs(t,e){var r=t;typeof t=="string"&&(r=Ue.parseSourceMapInput(t));var n=Ue.getArg(r,"version"),i=Ue.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new hp,this._names=new hp;var o={line:-1,column:0};this._sections=i.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var a=Ue.getArg(s,"offset"),A=Ue.getArg(a,"line"),c=Ue.getArg(a,"column");if(A<o.line||A===o.line&&c<o.column)throw new Error("Section offsets must be ordered and non-overlapping.");return o=a,{generatedOffset:{generatedLine:A+1,generatedColumn:c+1},consumer:new Sr(Ue.getArg(s,"map"),e)}})}qs.prototype=Object.create(Sr.prototype);qs.prototype.constructor=Sr;qs.prototype._version=3;Object.defineProperty(qs.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)t.push(this._sections[e].consumer.sources[r]);return t}});qs.prototype.originalPositionFor=function(e){var r={generatedLine:Ue.getArg(e,"line"),generatedColumn:Ue.getArg(e,"column")},n=iF.search(r,this._sections,function(o,s){var a=o.generatedLine-s.generatedOffset.generatedLine;return a||o.generatedColumn-s.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};qs.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};qs.prototype.sourceContentFor=function(e,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],o=i.consumer.sourceContentFor(e,!0);if(o||o==="")return o}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')};qs.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(Ue.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var o={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}};qs.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],o=i.consumer._generatedMappings,s=0;s<o.length;s++){var a=o[s],A=i.consumer._sources.at(a.source);A!==null&&(A=Ue.computeSourceURL(i.consumer.sourceRoot,A,this._sourceMapURL)),this._sources.add(A),A=this._sources.indexOf(A);var c=null;a.name&&(c=i.consumer._names.at(a.name),this._names.add(c),c=this._names.indexOf(c));var u={source:A,generatedLine:a.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(i.generatedOffset.generatedLine===a.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:c};this.__generatedMappings.push(u),typeof u.originalLine=="number"&&this.__originalMappings.push(u)}XC(this.__generatedMappings,Ue.compareByGeneratedPositionsDeflated),XC(this.__originalMappings,Ue.compareByOriginalPositions)};AQ.IndexedSourceMapConsumer=qs});var A6=v(a6=>{C();var Pxe=tF().SourceMapGenerator,cQ=Cp(),Lxe=/(\r?\n)/,_xe=10,mp="$$$isSourceNode$$$";function Ko(t,e,r,n,i){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=i??null,this[mp]=!0,n!=null&&this.add(n)}Ko.fromStringWithSourceMap=function(e,r,n){var i=new Ko,o=e.split(Lxe),s=0,a=function(){var g=p(),d=p()||"";return g+d;function p(){return s<o.length?o[s++]:void 0}},A=1,c=0,u=null;return r.eachMapping(function(g){if(u!==null)if(A<g.generatedLine)l(u,a()),A++,c=0;else{var d=o[s]||"",p=d.substr(0,g.generatedColumn-c);o[s]=d.substr(g.generatedColumn-c),c=g.generatedColumn,l(u,p),u=g;return}for(;A<g.generatedLine;)i.add(a()),A++;if(c<g.generatedColumn){var d=o[s]||"";i.add(d.substr(0,g.generatedColumn)),o[s]=d.substr(g.generatedColumn),c=g.generatedColumn}u=g},this),s<o.length&&(u&&l(u,a()),i.add(o.splice(s).join(""))),r.sources.forEach(function(g){var d=r.sourceContentFor(g);d!=null&&(n!=null&&(g=cQ.join(n,g)),i.setSourceContent(g,d))}),i;function l(g,d){if(g===null||g.source===void 0)i.add(d);else{var p=n?cQ.join(n,g.source):g.source;i.add(new Ko(g.originalLine,g.originalColumn,p,d,g.name))}}};Ko.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[mp]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Ko.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[mp]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Ko.prototype.walk=function(e){for(var r,n=0,i=this.children.length;n<i;n++)r=this.children[n],r[mp]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})};Ko.prototype.join=function(e){var r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(e);r.push(this.children[n]),this.children=r}return this};Ko.prototype.replaceRight=function(e,r){var n=this.children[this.children.length-1];return n[mp]?n.replaceRight(e,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,r):this.children.push("".replace(e,r)),this};Ko.prototype.setSourceContent=function(e,r){this.sourceContents[cQ.toSetString(e)]=r};Ko.prototype.walkSourceContents=function(e){for(var r=0,n=this.children.length;r<n;r++)this.children[r][mp]&&this.children[r].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)e(cQ.fromSetString(i[r]),this.sourceContents[i[r]])};Ko.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e};Ko.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},n=new Pxe(e),i=!1,o=null,s=null,a=null,A=null;return this.walk(function(c,u){r.code+=c,u.source!==null&&u.line!==null&&u.column!==null?((o!==u.source||s!==u.line||a!==u.column||A!==u.name)&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:r.line,column:r.column},name:u.name}),o=u.source,s=u.line,a=u.column,A=u.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),o=null,i=!1);for(var l=0,g=c.length;l<g;l++)c.charCodeAt(l)===_xe?(r.line++,r.column=0,l+1===g?(o=null,i=!1):i&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:r.line,column:r.column},name:u.name})):r.column++}),this.walkSourceContents(function(c,u){n.setSourceContent(c,u)}),{code:r.code,map:n}};a6.SourceNode=Ko});var c6=v(uQ=>{C();uQ.SourceMapGenerator=tF().SourceMapGenerator;uQ.SourceMapConsumer=s6().SourceMapConsumer;uQ.SourceNode=A6().SourceNode});var G6=v(ch=>{"use strict";C();Object.defineProperty(ch,"__esModule",{value:!0});function Uxe(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}var Ga=class{constructor(e,r,n){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=r,this.index=n}},Dp=class{constructor(e,r){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=r}};function Yi(t,e){let{line:r,column:n,index:i}=t;return new Ga(r,n+e,i+e)}var u6="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Gxe={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:u6},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:u6}},l6={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},pQ=t=>t.type==="UpdateExpression"?l6.UpdateExpression[`${t.prefix}`]:l6[t.type],Oxe={AccessorIsGenerator:({kind:t})=>`A ${t}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:t})=>`Missing initializer in ${t} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:t})=>`'import.${t}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
1109
|
+
`);return o!==-1&&(e=w9(e,i,n,o)),n+e+i};Object.defineProperties(VC.prototype,dp);lEt=VC(),gEt=VC({level:x9?x9.level:0})});function zC(t){let e=US(t);return{highlight:r,highlightAuto:n,listLanguages:e.listLanguages,register:e.register,registerAlias:e.registerAlias,registered:e.registered};function r(i,o,s){let a=e.highlight(i,o),A=a.data;return{language:A.language,relevance:A.relevance,value:YS(s||R9,a)}}function n(i,o){let s,a;if(o&&("subset"in o||"sheet"in o)){let u=o;a={subset:u.subset},s=u.sheet}else s=o;let A=e.highlightAuto(i,a),c=A.data;return{language:c.language,relevance:c.relevance,value:YS(s||R9,A)}}}function YS(t,e){let r=new Set(e.type==="element"&&Array.isArray(e.properties.className)?e.properties.className.map(function(a){return String(a).replace(/^hljs-/,"")}):[]),n={},i,o="",s;for(s in t)if(Object.hasOwn(t,s)){let a=s.split(" "),A=t[s];r.has(a[0])?a.length===1?i=A:n[a.slice(1).join(" ")]=A:n[s]=A}return"value"in e?o=e.value:"children"in e&&(o=pxe(n,e.children)),i&&(o=i(o)),o}function pxe(t,e){let r=[],n=-1;for(;++n<e.length;)r.push(YS(t,e[n]));return r.join("")}var Rt,R9,N9=M(()=>{C();k9();GS();Rt=new iQ({level:2}),R9={comment:Rt.gray,quote:Rt.gray,keyword:Rt.green,"selector-tag":Rt.green,addition:Rt.green,number:Rt.cyan,string:Rt.cyan,"meta meta-string":Rt.cyan,literal:Rt.cyan,doctag:Rt.cyan,regexp:Rt.cyan,title:Rt.blue,section:Rt.blue,name:Rt.blue,"selector-id":Rt.blue,"selector-class":Rt.blue,attribute:Rt.yellow,attr:Rt.yellow,variable:Rt.yellow,"template-variable":Rt.yellow,"class title":Rt.yellow,type:Rt.yellow,symbol:Rt.magenta,bullet:Rt.magenta,subst:Rt.magenta,meta:Rt.magenta,"meta keyword":Rt.magenta,"selector-attr":Rt.magenta,"selector-pseudo":Rt.magenta,link:Rt.magenta,built_in:Rt.red,deletion:Rt.red,emphasis:Rt.italic,strong:Rt.bold,formula:Rt.inverse}});var jS=M(()=>{C();GS();N9()});async function Ne(t){if(process.env.NODE_ENV!=="test")try{let e=process.env.BUILDER_DISABLE_AMPLITUDE==="true",r=[M9.flush(2e3)];e||r.push(T9.flush().promise),await Promise.allSettled(r)}catch(e){console.error(e)}process.exit(t)}var M9,T9,ls=M(()=>{"use strict";C();M9=ie(require("@sentry/node"),1),T9=ie(require("@amplitude/analytics-node"),1)});var Xe,mn=M(()=>{"use strict";C();Xe=process.env.AIR_HOST||process.env.BUILDER_HOST||"https://api.builder.io"});var L9,P9=M(()=>{L9="1.26.4"});var U9=v($S=>{C();var _9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");$S.encode=function(t){if(0<=t&&t<_9.length)return _9[t];throw new TypeError("Must be between 0 and 63: "+t)};$S.decode=function(t){var e=65,r=90,n=97,i=122,o=48,s=57,a=43,A=47,c=26,u=52;return e<=t&&t<=r?t-e:n<=t&&t<=i?t-n+c:o<=t&&t<=s?t-o+u:t==a?62:t==A?63:-1}});var zS=v(VS=>{C();var G9=U9(),qS=5,O9=1<<qS,K9=O9-1,H9=O9;function fxe(t){return t<0?(-t<<1)+1:(t<<1)+0}function Cxe(t){var e=(t&1)===1,r=t>>1;return e?-r:r}VS.encode=function(e){var r="",n,i=fxe(e);do n=i&K9,i>>>=qS,i>0&&(n|=H9),r+=G9.encode(n);while(i>0);return r};VS.decode=function(e,r,n){var i=e.length,o=0,s=0,a,A;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(A=G9.decode(e.charCodeAt(r++)),A===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));a=!!(A&H9),A&=K9,o=o+(A<<s),s+=qS}while(a);n.value=Cxe(o),n.rest=r}});var Cp=v(Kn=>{C();function hxe(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}Kn.getArg=hxe;var J9=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,mxe=/^data:.+\,.+$/;function WC(t){var e=t.match(J9);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}Kn.urlParse=WC;function fp(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}Kn.urlGenerate=fp;var Ixe=32;function Exe(t){var e=[];return function(r){for(var n=0;n<e.length;n++)if(e[n].input===r){var i=e[0];return e[0]=e[n],e[n]=i,e[0].result}var o=t(r);return e.unshift({input:r,result:o}),e.length>Ixe&&e.pop(),o}}var WS=Exe(function(e){var r=e,n=WC(e);if(n){if(!n.path)return e;r=n.path}for(var i=Kn.isAbsolute(r),o=[],s=0,a=0;;)if(s=a,a=r.indexOf("/",s),a===-1){o.push(r.slice(s));break}else for(o.push(r.slice(s,a));a<r.length&&r[a]==="/";)a++;for(var A,c=0,a=o.length-1;a>=0;a--)A=o[a],A==="."?o.splice(a,1):A===".."?c++:c>0&&(A===""?(o.splice(a+1,c),c=0):(o.splice(a,2),c--));return r=o.join("/"),r===""&&(r=i?"/":"."),n?(n.path=r,fp(n)):r});Kn.normalize=WS;function Y9(t,e){t===""&&(t="."),e===""&&(e=".");var r=WC(e),n=WC(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),fp(r);if(r||e.match(mxe))return e;if(n&&!n.host&&!n.path)return n.host=e,fp(n);var i=e.charAt(0)==="/"?e:WS(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,fp(n)):i}Kn.join=Y9;Kn.isAbsolute=function(t){return t.charAt(0)==="/"||J9.test(t)};function Bxe(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}Kn.relative=Bxe;var j9=(function(){var t=Object.create(null);return!("__proto__"in t)})();function $9(t){return t}function Qxe(t){return q9(t)?"$"+t:t}Kn.toSetString=j9?$9:Qxe;function Dxe(t){return q9(t)?t.slice(1):t}Kn.fromSetString=j9?$9:Dxe;function q9(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function yxe(t,e,r){var n=kA(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:kA(t.name,e.name)}Kn.compareByOriginalPositions=yxe;function wxe(t,e,r){var n;return n=t.originalLine-e.originalLine,n!==0||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:kA(t.name,e.name)}Kn.compareByOriginalPositionsNoSource=wxe;function bxe(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=kA(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:kA(t.name,e.name)}Kn.compareByGeneratedPositionsDeflated=bxe;function vxe(t,e,r){var n=t.generatedColumn-e.generatedColumn;return n!==0||r||(n=kA(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:kA(t.name,e.name)}Kn.compareByGeneratedPositionsDeflatedNoLine=vxe;function kA(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function xxe(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=kA(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:kA(t.name,e.name)}Kn.compareByGeneratedPositionsInflated=xxe;function Sxe(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}Kn.parseSourceMapInput=Sxe;function Fxe(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=WC(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}e=Y9(fp(n),e)}return WS(e)}Kn.computeSourceURL=Fxe});var eF=v(V9=>{C();var ZS=Cp(),XS=Object.prototype.hasOwnProperty,gl=typeof Map<"u";function RA(){this._array=[],this._set=gl?new Map:Object.create(null)}RA.fromArray=function(e,r){for(var n=new RA,i=0,o=e.length;i<o;i++)n.add(e[i],r);return n};RA.prototype.size=function(){return gl?this._set.size:Object.getOwnPropertyNames(this._set).length};RA.prototype.add=function(e,r){var n=gl?e:ZS.toSetString(e),i=gl?this.has(e):XS.call(this._set,n),o=this._array.length;(!i||r)&&this._array.push(e),i||(gl?this._set.set(e,o):this._set[n]=o)};RA.prototype.has=function(e){if(gl)return this._set.has(e);var r=ZS.toSetString(e);return XS.call(this._set,r)};RA.prototype.indexOf=function(e){if(gl){var r=this._set.get(e);if(r>=0)return r}else{var n=ZS.toSetString(e);if(XS.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};RA.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};RA.prototype.toArray=function(){return this._array.slice()};V9.ArraySet=RA});var Z9=v(W9=>{C();var z9=Cp();function kxe(t,e){var r=t.generatedLine,n=e.generatedLine,i=t.generatedColumn,o=e.generatedColumn;return n>r||n==r&&o>=i||z9.compareByGeneratedPositionsInflated(t,e)<=0}function sQ(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}sQ.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};sQ.prototype.add=function(e){kxe(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};sQ.prototype.toArray=function(){return this._sorted||(this._array.sort(z9.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};W9.MappingList=sQ});var tF=v(X9=>{C();var ZC=zS(),ln=Cp(),aQ=eF().ArraySet,Rxe=Z9().MappingList;function gs(t){t||(t={}),this._file=ln.getArg(t,"file",null),this._sourceRoot=ln.getArg(t,"sourceRoot",null),this._skipValidation=ln.getArg(t,"skipValidation",!1),this._ignoreInvalidMapping=ln.getArg(t,"ignoreInvalidMapping",!1),this._sources=new aQ,this._names=new aQ,this._mappings=new Rxe,this._sourcesContents=null}gs.prototype._version=3;gs.fromSourceMap=function(e,r){var n=e.sourceRoot,i=new gs(Object.assign(r||{},{file:e.file,sourceRoot:n}));return e.eachMapping(function(o){var s={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(s.source=o.source,n!=null&&(s.source=ln.relative(n,s.source)),s.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(s.name=o.name)),i.addMapping(s)}),e.sources.forEach(function(o){var s=o;n!==null&&(s=ln.relative(n,o)),i._sources.has(s)||i._sources.add(s);var a=e.sourceContentFor(o);a!=null&&i.setSourceContent(o,a)}),i};gs.prototype.addMapping=function(e){var r=ln.getArg(e,"generated"),n=ln.getArg(e,"original",null),i=ln.getArg(e,"source",null),o=ln.getArg(e,"name",null);!this._skipValidation&&this._validateMapping(r,n,i,o)===!1||(i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:o}))};gs.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=ln.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[ln.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[ln.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};gs.prototype.applySourceMap=function(e,r,n){var i=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var o=this._sourceRoot;o!=null&&(i=ln.relative(o,i));var s=new aQ,a=new aQ;this._mappings.unsortedForEach(function(A){if(A.source===i&&A.originalLine!=null){var c=e.originalPositionFor({line:A.originalLine,column:A.originalColumn});c.source!=null&&(A.source=c.source,n!=null&&(A.source=ln.join(n,A.source)),o!=null&&(A.source=ln.relative(o,A.source)),A.originalLine=c.line,A.originalColumn=c.column,c.name!=null&&(A.name=c.name))}var u=A.source;u!=null&&!s.has(u)&&s.add(u);var l=A.name;l!=null&&!a.has(l)&&a.add(l)},this),this._sources=s,this._names=a,e.sources.forEach(function(A){var c=e.sourceContentFor(A);c!=null&&(n!=null&&(A=ln.join(n,A)),o!=null&&(A=ln.relative(o,A)),this.setSourceContent(A,c))},this)};gs.prototype._validateMapping=function(e,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number"){var o="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(o),!1;throw new Error(o)}if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!i)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;var o="Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:i});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(o),!1;throw new Error(o)}};gs.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,i=0,o=0,s=0,a="",A,c,u,l,g=this._mappings.toArray(),d=0,p=g.length;d<p;d++){if(c=g[d],A="",c.generatedLine!==r)for(e=0;c.generatedLine!==r;)A+=";",r++;else if(d>0){if(!ln.compareByGeneratedPositionsInflated(c,g[d-1]))continue;A+=","}A+=ZC.encode(c.generatedColumn-e),e=c.generatedColumn,c.source!=null&&(l=this._sources.indexOf(c.source),A+=ZC.encode(l-s),s=l,A+=ZC.encode(c.originalLine-1-i),i=c.originalLine-1,A+=ZC.encode(c.originalColumn-n),n=c.originalColumn,c.name!=null&&(u=this._names.indexOf(c.name),A+=ZC.encode(u-o),o=u)),a+=A}return a};gs.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=ln.relative(r,n));var i=ln.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};gs.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};gs.prototype.toString=function(){return JSON.stringify(this.toJSON())};X9.SourceMapGenerator=gs});var e6=v(pl=>{C();pl.GREATEST_LOWER_BOUND=1;pl.LEAST_UPPER_BOUND=2;function rF(t,e,r,n,i,o){var s=Math.floor((e-t)/2)+t,a=i(r,n[s],!0);return a===0?s:a>0?e-s>1?rF(s,e,r,n,i,o):o==pl.LEAST_UPPER_BOUND?e<n.length?e:-1:s:s-t>1?rF(t,s,r,n,i,o):o==pl.LEAST_UPPER_BOUND?s:t<0?-1:t}pl.search=function(e,r,n,i){if(r.length===0)return-1;var o=rF(-1,r.length,e,r,n,i||pl.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&n(r[o],r[o-1],!0)===0;)--o;return o}});var n6=v(r6=>{C();function Nxe(t){function e(i,o,s){var a=i[o];i[o]=i[s],i[s]=a}function r(i,o){return Math.round(i+Math.random()*(o-i))}function n(i,o,s,a){if(s<a){var A=r(s,a),c=s-1;e(i,A,a);for(var u=i[a],l=s;l<a;l++)o(i[l],u,!1)<=0&&(c+=1,e(i,c,l));e(i,c+1,l);var g=c+1;n(i,o,s,g-1),n(i,o,g+1,a)}}return n}function Mxe(t){let e=Nxe.toString();return new Function(`return ${e}`)()(t)}var t6=new WeakMap;r6.quickSort=function(t,e,r=0){let n=t6.get(e);n===void 0&&(n=Mxe(e),t6.set(e,n)),n(t,e,r,t.length-1)}});var s6=v(AQ=>{C();var Ue=Cp(),iF=e6(),hp=eF().ArraySet,Txe=zS(),XC=n6().quickSort;function Sr(t,e){var r=t;return typeof t=="string"&&(r=Ue.parseSourceMapInput(t)),r.sections!=null?new qs(r,e):new ii(r,e)}Sr.fromSourceMap=function(t,e){return ii.fromSourceMap(t,e)};Sr.prototype._version=3;Sr.prototype.__generatedMappings=null;Object.defineProperty(Sr.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Sr.prototype.__originalMappings=null;Object.defineProperty(Sr.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Sr.prototype._charIsMappingSeparator=function(e,r){var n=e.charAt(r);return n===";"||n===","};Sr.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")};Sr.GENERATED_ORDER=1;Sr.ORIGINAL_ORDER=2;Sr.GREATEST_LOWER_BOUND=1;Sr.LEAST_UPPER_BOUND=2;Sr.prototype.eachMapping=function(e,r,n){var i=r||null,o=n||Sr.GENERATED_ORDER,s;switch(o){case Sr.GENERATED_ORDER:s=this._generatedMappings;break;case Sr.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var a=this.sourceRoot,A=e.bind(i),c=this._names,u=this._sources,l=this._sourceMapURL,g=0,d=s.length;g<d;g++){var p=s[g],f=p.source===null?null:u.at(p.source);f!==null&&(f=Ue.computeSourceURL(a,f,l)),A({source:f,generatedLine:p.generatedLine,generatedColumn:p.generatedColumn,originalLine:p.originalLine,originalColumn:p.originalColumn,name:p.name===null?null:c.at(p.name)})}};Sr.prototype.allGeneratedPositionsFor=function(e){var r=Ue.getArg(e,"line"),n={source:Ue.getArg(e,"source"),originalLine:r,originalColumn:Ue.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Ue.compareByOriginalPositions,iF.LEAST_UPPER_BOUND);if(o>=0){var s=this._originalMappings[o];if(e.column===void 0)for(var a=s.originalLine;s&&s.originalLine===a;)i.push({line:Ue.getArg(s,"generatedLine",null),column:Ue.getArg(s,"generatedColumn",null),lastColumn:Ue.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o];else for(var A=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==A;)i.push({line:Ue.getArg(s,"generatedLine",null),column:Ue.getArg(s,"generatedColumn",null),lastColumn:Ue.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o]}return i};AQ.SourceMapConsumer=Sr;function ii(t,e){var r=t;typeof t=="string"&&(r=Ue.parseSourceMapInput(t));var n=Ue.getArg(r,"version"),i=Ue.getArg(r,"sources"),o=Ue.getArg(r,"names",[]),s=Ue.getArg(r,"sourceRoot",null),a=Ue.getArg(r,"sourcesContent",null),A=Ue.getArg(r,"mappings"),c=Ue.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=Ue.normalize(s)),i=i.map(String).map(Ue.normalize).map(function(u){return s&&Ue.isAbsolute(s)&&Ue.isAbsolute(u)?Ue.relative(s,u):u}),this._names=hp.fromArray(o.map(String),!0),this._sources=hp.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(u){return Ue.computeSourceURL(s,u,e)}),this.sourceRoot=s,this.sourcesContent=a,this._mappings=A,this._sourceMapURL=e,this.file=c}ii.prototype=Object.create(Sr.prototype);ii.prototype.consumer=Sr;ii.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Ue.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return-1};ii.fromSourceMap=function(e,r){var n=Object.create(ii.prototype),i=n._names=hp.fromArray(e._names.toArray(),!0),o=n._sources=hp.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(d){return Ue.computeSourceURL(n.sourceRoot,d,r)});for(var s=e._mappings.toArray().slice(),a=n.__generatedMappings=[],A=n.__originalMappings=[],c=0,u=s.length;c<u;c++){var l=s[c],g=new o6;g.generatedLine=l.generatedLine,g.generatedColumn=l.generatedColumn,l.source&&(g.source=o.indexOf(l.source),g.originalLine=l.originalLine,g.originalColumn=l.originalColumn,l.name&&(g.name=i.indexOf(l.name)),A.push(g)),a.push(g)}return XC(n.__originalMappings,Ue.compareByOriginalPositions),n};ii.prototype._version=3;Object.defineProperty(ii.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function o6(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var nF=Ue.compareByGeneratedPositionsDeflatedNoLine;function i6(t,e){let r=t.length,n=t.length-e;if(!(n<=1))if(n==2){let i=t[e],o=t[e+1];nF(i,o)>0&&(t[e]=o,t[e+1]=i)}else if(n<20)for(let i=e;i<r;i++)for(let o=i;o>e;o--){let s=t[o-1],a=t[o];if(nF(s,a)<=0)break;t[o-1]=a,t[o]=s}else XC(t,nF,e)}ii.prototype._parseMappings=function(e,r){var n=1,i=0,o=0,s=0,a=0,A=0,c=e.length,u=0,l={},g={},d=[],p=[],f,h,m,I,E;let B=0;for(;u<c;)if(e.charAt(u)===";")n++,u++,i=0,i6(p,B),B=p.length;else if(e.charAt(u)===",")u++;else{for(f=new o6,f.generatedLine=n,I=u;I<c&&!this._charIsMappingSeparator(e,I);I++);for(h=e.slice(u,I),m=[];u<I;)Txe.decode(e,u,g),E=g.value,u=g.rest,m.push(E);if(m.length===2)throw new Error("Found a source, but no line and column");if(m.length===3)throw new Error("Found a source and line, but no column");if(f.generatedColumn=i+m[0],i=f.generatedColumn,m.length>1&&(f.source=a+m[1],a+=m[1],f.originalLine=o+m[2],o=f.originalLine,f.originalLine+=1,f.originalColumn=s+m[3],s=f.originalColumn,m.length>4&&(f.name=A+m[4],A+=m[4])),p.push(f),typeof f.originalLine=="number"){let w=f.source;for(;d.length<=w;)d.push(null);d[w]===null&&(d[w]=[]),d[w].push(f)}}i6(p,B),this.__generatedMappings=p;for(var Q=0;Q<d.length;Q++)d[Q]!=null&&XC(d[Q],Ue.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...d)};ii.prototype._findMapping=function(e,r,n,i,o,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return iF.search(e,r,o,s)};ii.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};ii.prototype.originalPositionFor=function(e){var r={generatedLine:Ue.getArg(e,"line"),generatedColumn:Ue.getArg(e,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",Ue.compareByGeneratedPositionsDeflated,Ue.getArg(e,"bias",Sr.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var o=Ue.getArg(i,"source",null);o!==null&&(o=this._sources.at(o),o=Ue.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var s=Ue.getArg(i,"name",null);return s!==null&&(s=this._names.at(s)),{source:o,line:Ue.getArg(i,"originalLine",null),column:Ue.getArg(i,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};ii.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};ii.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=Ue.relative(this.sourceRoot,i));var o;if(this.sourceRoot!=null&&(o=Ue.urlParse(this.sourceRoot))){var s=i.replace(/^file:\/\//,"");if(o.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!o.path||o.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')};ii.prototype.generatedPositionFor=function(e){var r=Ue.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:Ue.getArg(e,"line"),originalColumn:Ue.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Ue.compareByOriginalPositions,Ue.getArg(e,"bias",Sr.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===n.source)return{line:Ue.getArg(o,"generatedLine",null),column:Ue.getArg(o,"generatedColumn",null),lastColumn:Ue.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};AQ.BasicSourceMapConsumer=ii;function qs(t,e){var r=t;typeof t=="string"&&(r=Ue.parseSourceMapInput(t));var n=Ue.getArg(r,"version"),i=Ue.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new hp,this._names=new hp;var o={line:-1,column:0};this._sections=i.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var a=Ue.getArg(s,"offset"),A=Ue.getArg(a,"line"),c=Ue.getArg(a,"column");if(A<o.line||A===o.line&&c<o.column)throw new Error("Section offsets must be ordered and non-overlapping.");return o=a,{generatedOffset:{generatedLine:A+1,generatedColumn:c+1},consumer:new Sr(Ue.getArg(s,"map"),e)}})}qs.prototype=Object.create(Sr.prototype);qs.prototype.constructor=Sr;qs.prototype._version=3;Object.defineProperty(qs.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)t.push(this._sections[e].consumer.sources[r]);return t}});qs.prototype.originalPositionFor=function(e){var r={generatedLine:Ue.getArg(e,"line"),generatedColumn:Ue.getArg(e,"column")},n=iF.search(r,this._sections,function(o,s){var a=o.generatedLine-s.generatedOffset.generatedLine;return a||o.generatedColumn-s.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};qs.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};qs.prototype.sourceContentFor=function(e,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],o=i.consumer.sourceContentFor(e,!0);if(o||o==="")return o}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')};qs.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(Ue.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var o={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}};qs.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],o=i.consumer._generatedMappings,s=0;s<o.length;s++){var a=o[s],A=i.consumer._sources.at(a.source);A!==null&&(A=Ue.computeSourceURL(i.consumer.sourceRoot,A,this._sourceMapURL)),this._sources.add(A),A=this._sources.indexOf(A);var c=null;a.name&&(c=i.consumer._names.at(a.name),this._names.add(c),c=this._names.indexOf(c));var u={source:A,generatedLine:a.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(i.generatedOffset.generatedLine===a.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:c};this.__generatedMappings.push(u),typeof u.originalLine=="number"&&this.__originalMappings.push(u)}XC(this.__generatedMappings,Ue.compareByGeneratedPositionsDeflated),XC(this.__originalMappings,Ue.compareByOriginalPositions)};AQ.IndexedSourceMapConsumer=qs});var A6=v(a6=>{C();var Pxe=tF().SourceMapGenerator,cQ=Cp(),Lxe=/(\r?\n)/,_xe=10,mp="$$$isSourceNode$$$";function Ko(t,e,r,n,i){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=i??null,this[mp]=!0,n!=null&&this.add(n)}Ko.fromStringWithSourceMap=function(e,r,n){var i=new Ko,o=e.split(Lxe),s=0,a=function(){var g=p(),d=p()||"";return g+d;function p(){return s<o.length?o[s++]:void 0}},A=1,c=0,u=null;return r.eachMapping(function(g){if(u!==null)if(A<g.generatedLine)l(u,a()),A++,c=0;else{var d=o[s]||"",p=d.substr(0,g.generatedColumn-c);o[s]=d.substr(g.generatedColumn-c),c=g.generatedColumn,l(u,p),u=g;return}for(;A<g.generatedLine;)i.add(a()),A++;if(c<g.generatedColumn){var d=o[s]||"";i.add(d.substr(0,g.generatedColumn)),o[s]=d.substr(g.generatedColumn),c=g.generatedColumn}u=g},this),s<o.length&&(u&&l(u,a()),i.add(o.splice(s).join(""))),r.sources.forEach(function(g){var d=r.sourceContentFor(g);d!=null&&(n!=null&&(g=cQ.join(n,g)),i.setSourceContent(g,d))}),i;function l(g,d){if(g===null||g.source===void 0)i.add(d);else{var p=n?cQ.join(n,g.source):g.source;i.add(new Ko(g.originalLine,g.originalColumn,p,d,g.name))}}};Ko.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[mp]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Ko.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[mp]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Ko.prototype.walk=function(e){for(var r,n=0,i=this.children.length;n<i;n++)r=this.children[n],r[mp]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})};Ko.prototype.join=function(e){var r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(e);r.push(this.children[n]),this.children=r}return this};Ko.prototype.replaceRight=function(e,r){var n=this.children[this.children.length-1];return n[mp]?n.replaceRight(e,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,r):this.children.push("".replace(e,r)),this};Ko.prototype.setSourceContent=function(e,r){this.sourceContents[cQ.toSetString(e)]=r};Ko.prototype.walkSourceContents=function(e){for(var r=0,n=this.children.length;r<n;r++)this.children[r][mp]&&this.children[r].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)e(cQ.fromSetString(i[r]),this.sourceContents[i[r]])};Ko.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e};Ko.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},n=new Pxe(e),i=!1,o=null,s=null,a=null,A=null;return this.walk(function(c,u){r.code+=c,u.source!==null&&u.line!==null&&u.column!==null?((o!==u.source||s!==u.line||a!==u.column||A!==u.name)&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:r.line,column:r.column},name:u.name}),o=u.source,s=u.line,a=u.column,A=u.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),o=null,i=!1);for(var l=0,g=c.length;l<g;l++)c.charCodeAt(l)===_xe?(r.line++,r.column=0,l+1===g?(o=null,i=!1):i&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:r.line,column:r.column},name:u.name})):r.column++}),this.walkSourceContents(function(c,u){n.setSourceContent(c,u)}),{code:r.code,map:n}};a6.SourceNode=Ko});var c6=v(uQ=>{C();uQ.SourceMapGenerator=tF().SourceMapGenerator;uQ.SourceMapConsumer=s6().SourceMapConsumer;uQ.SourceNode=A6().SourceNode});var G6=v(ch=>{"use strict";C();Object.defineProperty(ch,"__esModule",{value:!0});function Uxe(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}var Ga=class{constructor(e,r,n){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=r,this.index=n}},Dp=class{constructor(e,r){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=r}};function Yi(t,e){let{line:r,column:n,index:i}=t;return new Ga(r,n+e,i+e)}var u6="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Gxe={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:u6},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:u6}},l6={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},pQ=t=>t.type==="UpdateExpression"?l6.UpdateExpression[`${t.prefix}`]:l6[t.type],Oxe={AccessorIsGenerator:({kind:t})=>`A ${t}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:t})=>`Missing initializer in ${t} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:t})=>`'import.${t}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
1110
1110
|
- Did you mean \`export { '${t}' as '${e}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:t})=>`'${t==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:t})=>`Unsyntactic ${t==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.",ImportBindingIsString:({importName:t})=>`A string literal cannot be used as an imported binding.
|
|
1111
1111
|
- Did you mean \`import { "${t}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:t})=>`\`import()\` requires exactly ${t===1?"one argument":"one or two arguments"}.`,ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:t})=>`Expected number in radix ${t}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:t})=>`Escape sequence in keyword ${t}.`,InvalidIdentifier:({identifierName:t})=>`Invalid identifier ${t}.`,InvalidLhs:({ancestor:t})=>`Invalid left-hand side in ${pQ(t)}.`,InvalidLhsBinding:({ancestor:t})=>`Binding invalid left-hand side in ${pQ(t)}.`,InvalidLhsOptionalChaining:({ancestor:t})=>`Invalid optional chaining in the left-hand side of ${pQ(t)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:t})=>`Unexpected character '${t}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:t})=>`Private name #${t} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:t})=>`Label '${t}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:t})=>`This experimental syntax requires enabling the parser plugin: ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:t})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:t})=>`Duplicate key "${t}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:t})=>`An export name cannot include a lone surrogate, found '\\u${t.toString(16)}'.`,ModuleExportUndefined:({localName:t})=>`Export '${t}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:t})=>`Private names are only allowed in property accesses (\`obj.#${t}\`) or in \`in\` expressions (\`#${t} in obj\`).`,PrivateNameRedeclaration:({identifierName:t})=>`Duplicate private name #${t}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:t})=>`Unexpected keyword '${t}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:t})=>`Unexpected reserved word '${t}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:t,unexpected:e})=>`Unexpected token${e?` '${e}'.`:""}${t?`, expected "${t}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:t,onlyValidPropertyName:e})=>`The only valid meta property for ${t} is ${t}.${e}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:t})=>`Identifier '${t}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},Kxe={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:t})=>`Assigning to '${t}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:t})=>`Binding '${t}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Hxe=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Jxe={PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:t})=>`Invalid topic token ${t}. In order to use ${t} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${t}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:t})=>`Hack-style pipe body cannot be an unparenthesized ${pQ({type:t})}; please wrap it in parentheses.`,PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'},Yxe=["message"];function g6(t,e,r){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,value:r})}function jxe({toMessage:t,code:e,reasonCode:r,syntaxPlugin:n}){let i=r==="MissingPlugin"||r==="MissingOneOfPlugins";{let o={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};o[r]&&(r=o[r])}return function o(s,a){let A=new SyntaxError;return A.code=e,A.reasonCode=r,A.loc=s,A.pos=s.index,A.syntaxPlugin=n,i&&(A.missingPlugin=a.missingPlugin),g6(A,"clone",function(u={}){var l;let{line:g,column:d,index:p}=(l=u.loc)!=null?l:s;return o(new Ga(g,d,p),Object.assign({},a,u.details))}),g6(A,"details",a),Object.defineProperty(A,"message",{configurable:!0,get(){let c=`${t(a)} (${s.line}:${s.column})`;return this.message=c,c},set(c){Object.defineProperty(this,"message",{value:c,writable:!0})}}),A}}function PA(t,e){if(Array.isArray(t))return n=>PA(n,t[0]);let r={};for(let n of Object.keys(t)){let i=t[n],o=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:s}=o,a=Uxe(o,Yxe),A=typeof s=="string"?()=>s:s;r[n]=jxe(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:n,toMessage:A},e?{syntaxPlugin:e}:{},a))}return r}var J=Object.assign({},PA(Gxe),PA(Oxe),PA(Kxe),PA`pipelineOperator`(Jxe)),{defineProperty:$xe}=Object,p6=(t,e)=>{t&&$xe(t,e,{enumerable:!1,value:t[e]})};function eh(t){return p6(t.loc.start,"index"),p6(t.loc.end,"index"),t}var qxe=t=>class extends t{parse(){let r=eh(super.parse());return this.options.tokens&&(r.tokens=r.tokens.map(eh)),r}parseRegExpLiteral({pattern:r,flags:n}){let i=null;try{i=new RegExp(r,n)}catch{}let o=this.estreeParseLiteral(i);return o.regex={pattern:r,flags:n},o}parseBigIntLiteral(r){let n;try{n=BigInt(r)}catch{n=null}let i=this.estreeParseLiteral(n);return i.bigint=String(i.value||r),i}parseDecimalLiteral(r){let i=this.estreeParseLiteral(null);return i.decimal=String(i.value||r),i}estreeParseLiteral(r){return this.parseLiteral(r,"Literal")}parseStringLiteral(r){return this.estreeParseLiteral(r)}parseNumericLiteral(r){return this.estreeParseLiteral(r)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(r){return this.estreeParseLiteral(r)}directiveToStmt(r){let n=r.value;delete r.value,n.type="Literal",n.raw=n.extra.raw,n.value=n.extra.expressionValue;let i=r;return i.type="ExpressionStatement",i.expression=n,i.directive=n.extra.rawValue,delete n.extra,i}initFunction(r,n){super.initFunction(r,n),r.expression=!1}checkDeclaration(r){r!=null&&this.isObjectProperty(r)?this.checkDeclaration(r.value):super.checkDeclaration(r)}getObjectOrClassMethodParams(r){return r.value.params}isValidDirective(r){var n;return r.type==="ExpressionStatement"&&r.expression.type==="Literal"&&typeof r.expression.value=="string"&&!((n=r.expression.extra)!=null&&n.parenthesized)}parseBlockBody(r,n,i,o,s){super.parseBlockBody(r,n,i,o,s);let a=r.directives.map(A=>this.directiveToStmt(A));r.body=a.concat(r.body),delete r.directives}pushClassMethod(r,n,i,o,s,a){this.parseMethod(n,i,o,s,a,"ClassMethod",!0),n.typeParameters&&(n.value.typeParameters=n.typeParameters,delete n.typeParameters),r.body.push(n)}parsePrivateName(){let r=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(r):r}convertPrivateNameToPrivateIdentifier(r){let n=super.getPrivateNameSV(r);return r=r,delete r.id,r.name=n,r.type="PrivateIdentifier",r}isPrivateName(r){return this.getPluginOption("estree","classFeatures")?r.type==="PrivateIdentifier":super.isPrivateName(r)}getPrivateNameSV(r){return this.getPluginOption("estree","classFeatures")?r.name:super.getPrivateNameSV(r)}parseLiteral(r,n){let i=super.parseLiteral(r,n);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(r,n,i=!1){super.parseFunctionBody(r,n,i),r.expression=r.body.type!=="BlockStatement"}parseMethod(r,n,i,o,s,a,A=!1){let c=this.startNode();return c.kind=r.kind,c=super.parseMethod(c,n,i,o,s,a,A),c.type="FunctionExpression",delete c.kind,r.value=c,a==="ClassPrivateMethod"&&(r.computed=!1),this.finishNode(r,"MethodDefinition")}nameIsConstructor(r){return r.type==="Literal"?r.value==="constructor":super.nameIsConstructor(r)}parseClassProperty(...r){let n=super.parseClassProperty(...r);return this.getPluginOption("estree","classFeatures")&&(n.type="PropertyDefinition"),n}parseClassPrivateProperty(...r){let n=super.parseClassPrivateProperty(...r);return this.getPluginOption("estree","classFeatures")&&(n.type="PropertyDefinition",n.computed=!1),n}parseObjectMethod(r,n,i,o,s){let a=super.parseObjectMethod(r,n,i,o,s);return a&&(a.type="Property",a.kind==="method"&&(a.kind="init"),a.shorthand=!1),a}parseObjectProperty(r,n,i,o){let s=super.parseObjectProperty(r,n,i,o);return s&&(s.kind="init",s.type="Property"),s}isValidLVal(r,n,i){return r==="Property"?"value":super.isValidLVal(r,n,i)}isAssignable(r,n){return r!=null&&this.isObjectProperty(r)?this.isAssignable(r.value,n):super.isAssignable(r,n)}toAssignable(r,n=!1){if(r!=null&&this.isObjectProperty(r)){let{key:i,value:o}=r;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(o,n)}else super.toAssignable(r,n)}toAssignableObjectExpressionProp(r,n,i){r.type==="Property"&&(r.kind==="get"||r.kind==="set")?this.raise(J.PatternHasAccessor,r.key):r.type==="Property"&&r.method?this.raise(J.PatternHasMethod,r.key):super.toAssignableObjectExpressionProp(r,n,i)}finishCallExpression(r,n){let i=super.finishCallExpression(r,n);if(i.callee.type==="Import"){if(i.type="ImportExpression",i.source=i.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var o,s;i.options=(o=i.arguments[1])!=null?o:null,i.attributes=(s=i.arguments[1])!=null?s:null}delete i.arguments,delete i.callee}return i}toReferencedArguments(r){r.type!=="ImportExpression"&&super.toReferencedArguments(r)}parseExport(r,n){let i=this.state.lastTokStartLoc,o=super.parseExport(r,n);switch(o.type){case"ExportAllDeclaration":o.exported=null;break;case"ExportNamedDeclaration":o.specifiers.length===1&&o.specifiers[0].type==="ExportNamespaceSpecifier"&&(o.type="ExportAllDeclaration",o.exported=o.specifiers[0].exported,delete o.specifiers);case"ExportDefaultDeclaration":{var s;let{declaration:a}=o;a?.type==="ClassDeclaration"&&((s=a.decorators)==null?void 0:s.length)>0&&a.start===o.start&&this.resetStartLocation(o,i)}break}return o}parseSubscript(r,n,i,o){let s=super.parseSubscript(r,n,i,o);if(o.optionalChainMember){if((s.type==="OptionalMemberExpression"||s.type==="OptionalCallExpression")&&(s.type=s.type.substring(8)),o.stop){let a=this.startNodeAtNode(s);return a.expression=s,this.finishNode(a,"ChainExpression")}}else(s.type==="MemberExpression"||s.type==="CallExpression")&&(s.optional=!1);return s}isOptionalMemberExpression(r){return r.type==="ChainExpression"?r.expression.type==="MemberExpression":super.isOptionalMemberExpression(r)}hasPropertyAsPrivateName(r){return r.type==="ChainExpression"&&(r=r.expression),super.hasPropertyAsPrivateName(r)}isObjectProperty(r){return r.type==="Property"&&r.kind==="init"&&!r.method}isObjectMethod(r){return r.type==="Property"&&(r.method||r.kind==="get"||r.kind==="set")}finishNodeAt(r,n,i){return eh(super.finishNodeAt(r,n,i))}resetStartLocation(r,n){super.resetStartLocation(r,n),eh(r)}resetEndLocation(r,n=this.state.lastTokEndLoc){super.resetEndLocation(r,n),eh(r)}},fl=class{constructor(e,r){this.token=void 0,this.preserveSpace=void 0,this.token=e,this.preserveSpace=!!r}},ar={brace:new fl("{"),j_oTag:new fl("<tag"),j_cTag:new fl("</tag"),j_expr:new fl("<tag>...</tag>",!0)};ar.template=new fl("`",!0);var Bt=!0,ke=!0,oF=!0,th=!0,Rc=!0,Vxe=!0,CQ=class{constructor(e,r={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=e,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.rightAssociative=!!r.rightAssociative,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop!=null?r.binop:null,this.updateContext=null}},kF=new Map;function Nt(t,e={}){e.keyword=t;let r=je(t,e);return kF.set(t,r),r}function Ji(t,e){return je(t,{beforeExpr:Bt,binop:e})}var oh=-1,MA=[],RF=[],NF=[],MF=[],TF=[],PF=[];function je(t,e={}){var r,n,i,o;return++oh,RF.push(t),NF.push((r=e.binop)!=null?r:-1),MF.push((n=e.beforeExpr)!=null?n:!1),TF.push((i=e.startsExpr)!=null?i:!1),PF.push((o=e.prefix)!=null?o:!1),MA.push(new CQ(t,e)),oh}function Et(t,e={}){var r,n,i,o;return++oh,kF.set(t,oh),RF.push(t),NF.push((r=e.binop)!=null?r:-1),MF.push((n=e.beforeExpr)!=null?n:!1),TF.push((i=e.startsExpr)!=null?i:!1),PF.push((o=e.prefix)!=null?o:!1),MA.push(new CQ("name",e)),oh}var zxe={bracketL:je("[",{beforeExpr:Bt,startsExpr:ke}),bracketHashL:je("#[",{beforeExpr:Bt,startsExpr:ke}),bracketBarL:je("[|",{beforeExpr:Bt,startsExpr:ke}),bracketR:je("]"),bracketBarR:je("|]"),braceL:je("{",{beforeExpr:Bt,startsExpr:ke}),braceBarL:je("{|",{beforeExpr:Bt,startsExpr:ke}),braceHashL:je("#{",{beforeExpr:Bt,startsExpr:ke}),braceR:je("}"),braceBarR:je("|}"),parenL:je("(",{beforeExpr:Bt,startsExpr:ke}),parenR:je(")"),comma:je(",",{beforeExpr:Bt}),semi:je(";",{beforeExpr:Bt}),colon:je(":",{beforeExpr:Bt}),doubleColon:je("::",{beforeExpr:Bt}),dot:je("."),question:je("?",{beforeExpr:Bt}),questionDot:je("?."),arrow:je("=>",{beforeExpr:Bt}),template:je("template"),ellipsis:je("...",{beforeExpr:Bt}),backQuote:je("`",{startsExpr:ke}),dollarBraceL:je("${",{beforeExpr:Bt,startsExpr:ke}),templateTail:je("...`",{startsExpr:ke}),templateNonTail:je("...${",{beforeExpr:Bt,startsExpr:ke}),at:je("@"),hash:je("#",{startsExpr:ke}),interpreterDirective:je("#!..."),eq:je("=",{beforeExpr:Bt,isAssign:th}),assign:je("_=",{beforeExpr:Bt,isAssign:th}),slashAssign:je("_=",{beforeExpr:Bt,isAssign:th}),xorAssign:je("_=",{beforeExpr:Bt,isAssign:th}),moduloAssign:je("_=",{beforeExpr:Bt,isAssign:th}),incDec:je("++/--",{prefix:Rc,postfix:Vxe,startsExpr:ke}),bang:je("!",{beforeExpr:Bt,prefix:Rc,startsExpr:ke}),tilde:je("~",{beforeExpr:Bt,prefix:Rc,startsExpr:ke}),doubleCaret:je("^^",{startsExpr:ke}),doubleAt:je("@@",{startsExpr:ke}),pipeline:Ji("|>",0),nullishCoalescing:Ji("??",1),logicalOR:Ji("||",1),logicalAND:Ji("&&",2),bitwiseOR:Ji("|",3),bitwiseXOR:Ji("^",4),bitwiseAND:Ji("&",5),equality:Ji("==/!=/===/!==",6),lt:Ji("</>/<=/>=",7),gt:Ji("</>/<=/>=",7),relational:Ji("</>/<=/>=",7),bitShift:Ji("<</>>/>>>",8),bitShiftL:Ji("<</>>/>>>",8),bitShiftR:Ji("<</>>/>>>",8),plusMin:je("+/-",{beforeExpr:Bt,binop:9,prefix:Rc,startsExpr:ke}),modulo:je("%",{binop:10,startsExpr:ke}),star:je("*",{binop:10}),slash:Ji("/",10),exponent:je("**",{beforeExpr:Bt,binop:11,rightAssociative:!0}),_in:Nt("in",{beforeExpr:Bt,binop:7}),_instanceof:Nt("instanceof",{beforeExpr:Bt,binop:7}),_break:Nt("break"),_case:Nt("case",{beforeExpr:Bt}),_catch:Nt("catch"),_continue:Nt("continue"),_debugger:Nt("debugger"),_default:Nt("default",{beforeExpr:Bt}),_else:Nt("else",{beforeExpr:Bt}),_finally:Nt("finally"),_function:Nt("function",{startsExpr:ke}),_if:Nt("if"),_return:Nt("return",{beforeExpr:Bt}),_switch:Nt("switch"),_throw:Nt("throw",{beforeExpr:Bt,prefix:Rc,startsExpr:ke}),_try:Nt("try"),_var:Nt("var"),_const:Nt("const"),_with:Nt("with"),_new:Nt("new",{beforeExpr:Bt,startsExpr:ke}),_this:Nt("this",{startsExpr:ke}),_super:Nt("super",{startsExpr:ke}),_class:Nt("class",{startsExpr:ke}),_extends:Nt("extends",{beforeExpr:Bt}),_export:Nt("export"),_import:Nt("import",{startsExpr:ke}),_null:Nt("null",{startsExpr:ke}),_true:Nt("true",{startsExpr:ke}),_false:Nt("false",{startsExpr:ke}),_typeof:Nt("typeof",{beforeExpr:Bt,prefix:Rc,startsExpr:ke}),_void:Nt("void",{beforeExpr:Bt,prefix:Rc,startsExpr:ke}),_delete:Nt("delete",{beforeExpr:Bt,prefix:Rc,startsExpr:ke}),_do:Nt("do",{isLoop:oF,beforeExpr:Bt}),_for:Nt("for",{isLoop:oF}),_while:Nt("while",{isLoop:oF}),_as:Et("as",{startsExpr:ke}),_assert:Et("assert",{startsExpr:ke}),_async:Et("async",{startsExpr:ke}),_await:Et("await",{startsExpr:ke}),_defer:Et("defer",{startsExpr:ke}),_from:Et("from",{startsExpr:ke}),_get:Et("get",{startsExpr:ke}),_let:Et("let",{startsExpr:ke}),_meta:Et("meta",{startsExpr:ke}),_of:Et("of",{startsExpr:ke}),_sent:Et("sent",{startsExpr:ke}),_set:Et("set",{startsExpr:ke}),_source:Et("source",{startsExpr:ke}),_static:Et("static",{startsExpr:ke}),_using:Et("using",{startsExpr:ke}),_yield:Et("yield",{startsExpr:ke}),_asserts:Et("asserts",{startsExpr:ke}),_checks:Et("checks",{startsExpr:ke}),_exports:Et("exports",{startsExpr:ke}),_global:Et("global",{startsExpr:ke}),_implements:Et("implements",{startsExpr:ke}),_intrinsic:Et("intrinsic",{startsExpr:ke}),_infer:Et("infer",{startsExpr:ke}),_is:Et("is",{startsExpr:ke}),_mixins:Et("mixins",{startsExpr:ke}),_proto:Et("proto",{startsExpr:ke}),_require:Et("require",{startsExpr:ke}),_satisfies:Et("satisfies",{startsExpr:ke}),_keyof:Et("keyof",{startsExpr:ke}),_readonly:Et("readonly",{startsExpr:ke}),_unique:Et("unique",{startsExpr:ke}),_abstract:Et("abstract",{startsExpr:ke}),_declare:Et("declare",{startsExpr:ke}),_enum:Et("enum",{startsExpr:ke}),_module:Et("module",{startsExpr:ke}),_namespace:Et("namespace",{startsExpr:ke}),_interface:Et("interface",{startsExpr:ke}),_type:Et("type",{startsExpr:ke}),_opaque:Et("opaque",{startsExpr:ke}),name:je("name",{startsExpr:ke}),string:je("string",{startsExpr:ke}),num:je("num",{startsExpr:ke}),bigint:je("bigint",{startsExpr:ke}),decimal:je("decimal",{startsExpr:ke}),regexp:je("regexp",{startsExpr:ke}),privateName:je("#name",{startsExpr:ke}),eof:je("eof"),jsxName:je("jsxName"),jsxText:je("jsxText",{beforeExpr:!0}),jsxTagStart:je("jsxTagStart",{startsExpr:!0}),jsxTagEnd:je("jsxTagEnd"),placeholder:je("%%",{startsExpr:!0})};function jt(t){return t>=93&&t<=132}function Wxe(t){return t<=92}function Vs(t){return t>=58&&t<=132}function w6(t){return t>=58&&t<=136}function Zxe(t){return MF[t]}function lF(t){return TF[t]}function Xxe(t){return t>=29&&t<=33}function d6(t){return t>=129&&t<=131}function eSe(t){return t>=90&&t<=92}function LF(t){return t>=58&&t<=92}function tSe(t){return t>=39&&t<=59}function rSe(t){return t===34}function nSe(t){return PF[t]}function iSe(t){return t>=121&&t<=123}function oSe(t){return t>=124&&t<=130}function Mc(t){return RF[t]}function dQ(t){return NF[t]}function sSe(t){return t===57}function hQ(t){return t>=24&&t<=25}function NA(t){return MA[t]}MA[8].updateContext=t=>{t.pop()},MA[5].updateContext=MA[7].updateContext=MA[23].updateContext=t=>{t.push(ar.brace)},MA[22].updateContext=t=>{t[t.length-1]===ar.template?t.pop():t.push(ar.template)},MA[142].updateContext=t=>{t.push(ar.j_expr,ar.j_oTag)};var _F="\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-\u088E\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\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\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",b6="\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\u0898-\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-\u1ACE\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",aSe=new RegExp("["+_F+"]"),ASe=new RegExp("["+_F+b6+"]");_F=b6=null;var v6=[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,68,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,71,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,349,41,7,1,79,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,159,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,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,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,757,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,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],cSe=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,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,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,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,406,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,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,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,983,6,110,6,6,9,4759,9,787719,239];function gF(t,e){let r=65536;for(let n=0,i=e.length;n<i;n+=2){if(r+=e[n],r>t)return!1;if(r+=e[n+1],r>=t)return!0}return!1}function TA(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&aSe.test(String.fromCharCode(t)):gF(t,v6)}function Ep(t){return t<48?t===36:t<58?!0:t<65?!1:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&ASe.test(String.fromCharCode(t)):gF(t,v6)||gF(t,cSe)}var UF={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},uSe=new Set(UF.keyword),lSe=new Set(UF.strict),gSe=new Set(UF.strictBind);function x6(t,e){return e&&t==="await"||t==="enum"}function S6(t,e){return x6(t,e)||lSe.has(t)}function F6(t){return gSe.has(t)}function k6(t,e){return S6(t,e)||F6(t)}function pSe(t){return uSe.has(t)}function dSe(t,e,r){return t===64&&e===64&&TA(r)}var fSe=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function CSe(t){return fSe.has(t)}var sh=class{constructor(e){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=e}},ah=class{constructor(e,r){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=e,this.inModule=r}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let e=this.currentThisScopeFlags();return(e&64)>0&&(e&2)===0}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){let{flags:r}=this.scopeStack[e];if(r&128)return!0;if(r&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new sh(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return!!(e.flags&130||!this.parser.inModule&&e.flags&1)}declareName(e,r,n){let i=this.currentScope();if(r&8||r&16){this.checkRedeclarationInScope(i,e,r,n);let o=i.names.get(e)||0;r&16?o=o|4:(i.firstLexicalName||(i.firstLexicalName=e),o=o|2),i.names.set(e,o),r&8&&this.maybeExportDefined(i,e)}else if(r&4)for(let o=this.scopeStack.length-1;o>=0&&(i=this.scopeStack[o],this.checkRedeclarationInScope(i,e,r,n),i.names.set(e,(i.names.get(e)||0)|1),this.maybeExportDefined(i,e),!(i.flags&387));--o);this.parser.inModule&&i.flags&1&&this.undefinedExports.delete(e)}maybeExportDefined(e,r){this.parser.inModule&&e.flags&1&&this.undefinedExports.delete(r)}checkRedeclarationInScope(e,r,n,i){this.isRedeclaredInScope(e,r,n)&&this.parser.raise(J.VarRedeclaration,i,{identifierName:r})}isRedeclaredInScope(e,r,n){if(!(n&1))return!1;if(n&8)return e.names.has(r);let i=e.names.get(r);return n&16?(i&2)>0||!this.treatFunctionsAsVarInScope(e)&&(i&1)>0:(i&2)>0&&!(e.flags&8&&e.firstLexicalName===r)||!this.treatFunctionsAsVarInScope(e)&&(i&4)>0}checkLocalExport(e){let{name:r}=e;this.scopeStack[0].names.has(r)||this.undefinedExports.set(r,e.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:r}=this.scopeStack[e];if(r&387)return r}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:r}=this.scopeStack[e];if(r&451&&!(r&4))return r}}},pF=class extends sh{constructor(...e){super(...e),this.declareFunctions=new Set}},dF=class extends ah{createScope(e){return new pF(e)}declareName(e,r,n){let i=this.currentScope();if(r&2048){this.checkRedeclarationInScope(i,e,r,n),this.maybeExportDefined(i,e),i.declareFunctions.add(e);return}super.declareName(e,r,n)}isRedeclaredInScope(e,r,n){if(super.isRedeclaredInScope(e,r,n))return!0;if(n&2048&&!e.declareFunctions.has(r)){let i=e.names.get(r);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e)}},fF=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(e){if(typeof e=="string")return this.plugins.has(e);{let[r,n]=e;if(!this.hasPlugin(r))return!1;let i=this.plugins.get(r);for(let o of Object.keys(n))if(i?.[o]!==n[o])return!1;return!0}}getPluginOption(e,r){var n;return(n=this.plugins.get(e))==null?void 0:n[r]}};function R6(t,e){t.trailingComments===void 0?t.trailingComments=e:t.trailingComments.unshift(...e)}function hSe(t,e){t.leadingComments===void 0?t.leadingComments=e:t.leadingComments.unshift(...e)}function Ah(t,e){t.innerComments===void 0?t.innerComments=e:t.innerComments.unshift(...e)}function rh(t,e,r){let n=null,i=e.length;for(;n===null&&i>0;)n=e[--i];n===null||n.start>r.start?Ah(t,r.comments):R6(n,r.comments)}var CF=class extends fF{addComment(e){this.filename&&(e.loc.filename=this.filename);let{commentsLen:r}=this.state;this.comments.length!==r&&(this.comments.length=r),this.comments.push(e),this.state.commentsLen++}processComment(e){let{commentStack:r}=this.state,n=r.length;if(n===0)return;let i=n-1,o=r[i];o.start===e.end&&(o.leadingNode=e,i--);let{start:s}=e;for(;i>=0;i--){let a=r[i],A=a.end;if(A>s)a.containingNode=e,this.finalizeComment(a),r.splice(i,1);else{A===s&&(a.trailingNode=e);break}}}finalizeComment(e){let{comments:r}=e;if(e.leadingNode!==null||e.trailingNode!==null)e.leadingNode!==null&&R6(e.leadingNode,r),e.trailingNode!==null&&hSe(e.trailingNode,r);else{let{containingNode:n,start:i}=e;if(this.input.charCodeAt(i-1)===44)switch(n.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":rh(n,n.properties,e);break;case"CallExpression":case"OptionalCallExpression":rh(n,n.arguments,e);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":rh(n,n.params,e);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":rh(n,n.elements,e);break;case"ExportNamedDeclaration":case"ImportDeclaration":rh(n,n.specifiers,e);break;default:Ah(n,r)}else Ah(n,r)}}finalizeRemainingComments(){let{commentStack:e}=this.state;for(let r=e.length-1;r>=0;r--)this.finalizeComment(e[r]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(e){let{commentStack:r}=this.state,{length:n}=r;if(n===0)return;let i=r[n-1];i.leadingNode===e&&(i.leadingNode=null)}resetPreviousIdentifierLeadingComments(e){let{commentStack:r}=this.state,{length:n}=r;n!==0&&(r[n-1].trailingNode===e?r[n-1].trailingNode=null:n>=2&&r[n-2].trailingNode===e&&(r[n-2].trailingNode=null))}takeSurroundingComments(e,r,n){let{commentStack:i}=this.state,o=i.length;if(o===0)return;let s=o-1;for(;s>=0;s--){let a=i[s],A=a.end;if(a.start===n)a.leadingNode=e;else if(A===r)a.trailingNode=e;else if(A<r)break}}},mSe=/\r\n|[\r\n\u2028\u2029]/,lQ=new RegExp(mSe.source,"g");function Bp(t){switch(t){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function f6(t,e,r){for(let n=e;n<r;n++)if(Bp(t.charCodeAt(n)))return!0;return!1}var sF=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,aF=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function ISe(t){switch(t){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var hF=class t{constructor(){this.flags=1024,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=139,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[ar.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(e){e?this.flags|=1:this.flags&=-2}init({strictMode:e,sourceType:r,startLine:n,startColumn:i}){this.strict=e===!1?!1:e===!0?!0:r==="module",this.curLine=n,this.lineStart=-i,this.startLoc=this.endLoc=new Ga(n,i,0)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(e){e?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(e){e?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(e){e?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(e){e?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(e){e?this.flags|=4096:this.flags&=-4097}curPosition(){return new Ga(this.curLine,this.pos-this.lineStart,this.pos)}clone(){let e=new t;return e.flags=this.flags,e.curLine=this.curLine,e.lineStart=this.lineStart,e.startLoc=this.startLoc,e.endLoc=this.endLoc,e.errors=this.errors.slice(),e.potentialArrowAt=this.potentialArrowAt,e.noArrowAt=this.noArrowAt.slice(),e.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),e.topicContext=this.topicContext,e.labels=this.labels.slice(),e.commentsLen=this.commentsLen,e.commentStack=this.commentStack.slice(),e.pos=this.pos,e.type=this.type,e.value=this.value,e.start=this.start,e.end=this.end,e.lastTokEndLoc=this.lastTokEndLoc,e.lastTokStartLoc=this.lastTokStartLoc,e.context=this.context.slice(),e.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,e.strictErrors=this.strictErrors,e.tokensLength=this.tokensLength,e}},ESe=function(e){return e>=48&&e<=57},C6={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},gQ={bin:t=>t===48||t===49,oct:t=>t>=48&&t<=55,dec:t=>t>=48&&t<=57,hex:t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102};function h6(t,e,r,n,i,o){let s=r,a=n,A=i,c="",u=null,l=r,{length:g}=e;for(;;){if(r>=g){o.unterminated(s,a,A),c+=e.slice(l,r);break}let d=e.charCodeAt(r);if(BSe(t,d,e,r)){c+=e.slice(l,r);break}if(d===92){c+=e.slice(l,r);let p=QSe(e,r,n,i,t==="template",o);p.ch===null&&!u?u={pos:r,lineStart:n,curLine:i}:c+=p.ch,{pos:r,lineStart:n,curLine:i}=p,l=r}else d===8232||d===8233?(++r,++i,n=r):d===10||d===13?t==="template"?(c+=e.slice(l,r)+`
|
|
1112
1112
|
`,++r,d===13&&e.charCodeAt(r)===10&&++r,++i,l=n=r):o.unterminated(s,a,A):++r}return{pos:r,str:c,firstInvalidLoc:u,lineStart:n,curLine:i,containsInvalid:!!u}}function BSe(t,e,r,n){return t==="template"?e===96||e===36&&r.charCodeAt(n+1)===123:e===(t==="double"?34:39)}function QSe(t,e,r,n,i,o){let s=!i;e++;let a=c=>({pos:e,ch:c,lineStart:r,curLine:n}),A=t.charCodeAt(e++);switch(A){case 110:return a(`
|
|
@@ -1211,7 +1211,7 @@ ${A.join(`
|
|
|
1211
1211
|
`)}
|
|
1212
1212
|
`}this.message=e}},fke=new Set(["Literal","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","BigIntLiteral"]),Rj=new Set(["string","number","boolean","bigint","symbol","undefined"]),In=Np;nk="__magicast_proxy";mke={enumerable:!0,configurable:!0};Ho=Np,KF=new WeakMap;Dke=Np;HF=new WeakMap;fh=Np;bQ=Np,Rke={functionCall(t,...e){let r=bQ.callExpression(bQ.identifier(t),e.map(n=>qi(n)));return Nj(r)},newExpression(t,...e){let r=bQ.newExpression(bQ.identifier(t),e.map(n=>qi(n)));return Mj(r)},literal(t){return qi(t)},raw(t){return Lj(t)}}});function Nke(){if(Dh!==void 0)return Dh;try{return Dh=require("prettier"),Dh}catch{return Dh=null,null}}async function Kj(t,e){let r=await(0,Hn.readdir)(t,{withFileTypes:!0}),n=[];for(let i of r){let o=Mt.default.join(t,i.name);if(i.isDirectory()){if(!e.has(i.name))try{let s=await Kj(o,e);n.push(...s)}catch(s){Lc.captureException(s,{tags:{errorType:"filesystem_permission",component:"readdirRecursive"},extra:{directory:o,errorCode:s.code}})}}else n.push(o)}return n}async function Hj(t){let e=new Set,r=(...c)=>{if(process.env.DEBUG){let u=new Date,l=`${String(u.getMinutes()).padStart(2,"0")}:${String(u.getSeconds()).padStart(2,"0")}.${String(u.getMilliseconds()).padStart(3,"0")}`;console.debug(l,"[builder-dev-tools]",...c)}},n=async c=>{let u=(0,Uj.createHash)("md5");return u.update(c),u.digest("hex")},i=Mt.default.normalize(Mt.default.resolve(process.cwd(),t.cwd)),o=Ak(Mt.default.normalize(t.cwd))??i,s=wh(Mt.default.normalize(t.cwd))??o,a={...Mt.default,getCwdDir:()=>i,getRepoRootDir:()=>o,getAppRootDir:()=>s,cwd:()=>process.cwd(),exists:async c=>{try{return await(0,Hn.access)(c),!0}catch{return!1}},magicast:ok,existsSync:c=>(0,Qr.existsSync)(c),readdir:async(c,u)=>{let l=await(0,Hn.readdir)(c);return u?l.map(g=>Mt.default.join(c,g)):l},readdirRecursive:async(c,u)=>Kj(c,new Set(u)),readdirSync:c=>(0,Qr.readdirSync)(c),readFile:async c=>{try{return await(0,Hn.readFile)(c,"utf-8")}catch(u){if(u.code==="ENOENT")return null;throw r(u,c),u}},readFileSync(c){try{return(0,Qr.readFileSync)(c,"utf-8")}catch(u){if(u.code==="ENOENT")return null;throw r(u,c),u}},readFileSyncBuffer(c){try{return new Uint8Array((0,Qr.readFileSync)(c,{encoding:null}))}catch(u){if(u.code==="ENOENT")return null;throw r(u,c),u}},spawnSync:El.spawnSync,stat:async c=>await(0,Hn.stat)(c),statSync:c=>(0,Qr.statSync)(c),unlinkSync:c=>{(0,Qr.unlinkSync)(c)},unlink:async c=>{await(0,Hn.unlink)(c)},writeFile:async(c,u)=>{c=Mt.default.normalize(c);let l={path:c,basename:Mt.default.basename(c),dirname:Mt.default.dirname(c),extname:Mt.default.extname(c)};await(0,Hn.mkdir)(Mt.default.dirname(c),{recursive:!0}),await(0,Hn.writeFile)(c,u);for(let g of e)await g(l)},hash:n,getDeviceId:()=>n(`${(0,yh.hostname)()}:${(0,yh.homedir)()}`),formatCode:async(c,u)=>{let l=Nke();if(!l)return u;let g=null;try{g=await l.resolveConfig(c)}catch{}try{return l.format(u,{...g,filepath:c})}catch{}return u},on:(c,u)=>{c==="change"&&e.add(u)},off:(c,u)=>{c==="change"&&e.delete(u)},debug:r,launchEditor:async c=>new Promise(u=>{try{let l=c.filePath;typeof c.line=="number"&&(l+=`:${c.line}`,typeof c.column=="number"&&(l+=`:${c.column}`)),(0,Oj.default)(l,void 0,(g,d)=>{let p=new Error(`Failed to launch editor for ${d}`);u({success:!1,message:p.message})}),setTimeout(()=>{u({success:!0})},100)}catch{u({success:!1,message:"Failed to launch editor"})}}),platform:()=>({runtime:"node",os:process.platform}),getRepoInfo:async c=>{let u=Mt.default.normalize(c??t.cwd);return{hasGit:Pke(u),remoteUrl:Mke(u),defaultBranch:Tke(u),commit:Lke(u),currentBranch:_ke(u)}},getFrameworks:()=>[],ts:Gj.default,Sentry:Lc,connectionTracker:null,version:pt,sdkVersion:null,ignoreMissingConfig:t.ignoreMissingConfig,kind:null};a.connectionTracker=new JC(a);let A=await Zu(a);return a.getFrameworks=()=>A,a}function Jj(){let t=(0,yh.homedir)();return Mt.default.join(t,".config","builder","dev-tools.json")}function sk(t,e){return typeof t=="object"&&t!=null&&e in t}async function Mp(){let t=Jj();try{let e=await(0,Hn.readFile)(t,"utf-8");if(typeof e=="string")return JSON.parse(e)}catch(e){if(e.code==="ENOENT")return null}return null}async function ak(t){let e=Jj();t=typeof t=="object"&&t!=null?t:{},await(0,Hn.mkdir)(Mt.default.dirname(e),{recursive:!0}),await(0,Hn.writeFile)(e,JSON.stringify(t??{},null,2))}function Mke(t){try{return((0,El.spawnSync)("git",["config","--get","remote.origin.url"],{cwd:t}).stdout||"").toString().trim()}catch(e){return Lc.captureException(new Error("Error getting git remote URL:",{cause:e})),""}}function Tke(t){let e="master";try{let r=(0,El.spawnSync)("git",["branch","-r"],{cwd:t});return r.stdout&&r.stdout.toString().trim().split(`
|
|
1213
1213
|
`).map(i=>i.trim()).includes("origin/main")?"main":e}catch(r){return Lc.captureException(new Error("Error getting git default branch name:",{cause:r})),e}}function Pke(t){try{return((0,El.spawnSync)("git",["rev-parse","--is-inside-work-tree"],{cwd:t}).stdout||"").toString().trim()==="true"}catch(e){return Lc.captureException(new Error("Error getting git commit:",{cause:e})),!1}}function Lke(t){try{return((0,El.spawnSync)("git",["rev-parse","HEAD"],{cwd:t}).stdout||"").toString().trim()}catch(e){return Lc.captureException(new Error("Error getting git commit:",{cause:e})),""}}function _ke(t){try{return((0,El.spawnSync)("git",["branch","--show-current"],{cwd:t}).stdout||"").toString().trim()}catch(e){return Lc.captureException(new Error("Error getting current branch name:",{cause:e})),""}}function Ak(t){let e=Mt.default.resolve("/");for(let r=0;r<20;r++){let n=Mt.default.join(t,"package.json");if((0,Qr.existsSync)(n))return t;if(t===e)break;t=Mt.default.dirname(t)}return null}function wh(t){let e=Mt.default.resolve("/");for(let r=0;r<20;r++){if((0,Qr.existsSync)(Mt.default.join(t,"builder.config.json"))||(0,Qr.existsSync)(Mt.default.join(t,"fusion.config.json"))||(0,Qr.existsSync)(Mt.default.join(t,"package.json"))||(0,Qr.existsSync)(Mt.default.join(t,"remix.config.js"))||(0,Qr.existsSync)(Mt.default.join(t,"remix.config.mjs"))||(0,Qr.existsSync)(Mt.default.join(t,"remix.config.ts"))||(0,Qr.existsSync)(Mt.default.join(t,"vite.config.js"))||(0,Qr.existsSync)(Mt.default.join(t,"vite.config.ts"))||(0,Qr.existsSync)(Mt.default.join(t,"vite.config.mjs"))||(0,Qr.existsSync)(Mt.default.join(t,"next.config.js"))||(0,Qr.existsSync)(Mt.default.join(t,"next.config.ts"))||(0,Qr.existsSync)(Mt.default.join(t,"angular.json"))||(0,Qr.existsSync)(Mt.default.join(t,"project.json"))||(0,Qr.existsSync)(Mt.default.join(t,"tsconfig.json")))return t;if(t===e)break;t=Mt.default.dirname(t)}return null}var Hn,Uj,Qr,yh,Mt,Gj,Oj,El,Lc,Dh,bh=M(()=>{"use strict";C();wS();Hn=require("node:fs/promises"),Uj=require("node:crypto"),Qr=require("node:fs"),yh=require("node:os"),Mt=ie(require("node:path"),1),Gj=ie(require("typescript"),1),Oj=ie(require("launch-editor"),1);Xu();El=require("node:child_process");_j();Lc=ie(require("@sentry/node"),1);un()});function Yj(t,e=0){return(oi[t[e+0]]+oi[t[e+1]]+oi[t[e+2]]+oi[t[e+3]]+"-"+oi[t[e+4]]+oi[t[e+5]]+"-"+oi[t[e+6]]+oi[t[e+7]]+"-"+oi[t[e+8]]+oi[t[e+9]]+"-"+oi[t[e+10]]+oi[t[e+11]]+oi[t[e+12]]+oi[t[e+13]]+oi[t[e+14]]+oi[t[e+15]]).toLowerCase()}var oi,jj=M(()=>{C();oi=[];for(let t=0;t<256;++t)oi.push((t+256).toString(16).slice(1))});function ck(){return OQ>KQ.length-16&&($j.default.randomFillSync(KQ),OQ=0),KQ.slice(OQ,OQ+=16)}var $j,KQ,OQ,qj=M(()=>{C();$j=ie(require("node:crypto")),KQ=new Uint8Array(256),OQ=KQ.length});var Vj,uk,zj=M(()=>{C();Vj=ie(require("node:crypto")),uk={randomUUID:Vj.default.randomUUID}});function Uke(t,e,r){if(uk.randomUUID&&!e&&!t)return uk.randomUUID();t=t||{};let n=t.random||(t.rng||ck)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=n[i];return e}return Yj(n)}var lk,Wj=M(()=>{C();zj();qj();jj();lk=Uke});var Zj=M(()=>{C();Wj()});function Oke(t){return HQ?`tracert ${t}`:`traceroute ${t}`}function Kke(){return Gke?"sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder":HQ?"ipconfig /flushdns":"sudo systemd-resolve --flush-caches"}function Hke(t,e){return HQ?`Test-NetConnection -ComputerName ${t} -Port ${e}`:`nc -zv ${t} ${e}`}function Jke(t){return HQ?`nslookup ${t}`:`dig ${t}`}function Yke(t,e){return`openssl s_client -connect ${t}:${e} -showcerts`}function gk(t,e,r){let n=t.code,i=`${e}${r?`:${r}`:""}`;if(n==="ECONNREFUSED"){let o=r||443;return new tt({type:"connection_refused",cause:t,message:`Connection refused to ${i}. The server may be down or not accepting connections on this port.`,suggestions:["Verify the server is running and accepting connections",`Test if the port is reachable: ${Hke(e,o)}`,"Check if a firewall is blocking the connection","Ensure the correct port number is being used","If using a proxy, verify proxy settings are correct","Try again in a few minutes - the service may be temporarily unavailable"],hostname:e,port:r,errorCode:n})}if(n==="ECONNRESET")return new tt({type:"connection_reset",cause:t,message:`Connection to ${i} was reset. The server closed the connection unexpectedly.`,suggestions:["The server may have restarted or timed out - try again","Check if a proxy or firewall is terminating connections","If behind a corporate network, the connection may be blocked","Verify network stability - intermittent connectivity can cause resets","If using keep-alive connections, the server may have closed an idle connection"],hostname:e,port:r,errorCode:n});if(n==="ECONNABORTED")return new tt({type:"connection_aborted",cause:t,message:`Connection to ${i} was aborted before completing.`,suggestions:["The request may have been interrupted - try again","Check for network instability or packet loss","If using a proxy, verify the proxy is functioning correctly","The server may have terminated the connection early"],hostname:e,port:r,errorCode:n});if(n==="ETIMEDOUT"||n==="ESOCKETTIMEDOUT"||n==="ERR_SOCKET_CONNECTION_TIMEOUT"||n==="ERR_HTTP_REQUEST_TIMEOUT")return new tt({type:"connection_timeout",cause:t,message:`Connection to ${i} timed out. The server did not respond in time.`,suggestions:["Check your internet connection speed and stability","The server may be overloaded - try again in a few minutes","If behind a proxy, ensure the proxy is not causing delays","Corporate firewalls may be slowing or blocking the connection","Try using a different network (e.g., mobile hotspot) to isolate the issue"],hostname:e,port:r,errorCode:n});if(n==="ENOTFOUND"||n==="EAI_AGAIN")return new tt({type:"dns_not_found",cause:t,message:`Cannot resolve hostname '${e}'. DNS lookup failed.`,suggestions:["Check your internet connection","Verify the hostname is spelled correctly",`Test DNS resolution: ${Jke(e)}`,"Try using a different DNS server (e.g., 8.8.8.8 or 1.1.1.1)","If on a VPN, try disconnecting and reconnecting",`Flush your DNS cache: ${Kke()}`],hostname:e,errorCode:n});if(n&&jke.has(n)){let o=r||443;return new tt({type:"ssl_self_signed",cause:t,message:`SSL certificate error: The server at ${i} is using a self-signed certificate that is not trusted.`,suggestions:["If on a corporate network, add your company's CA certificate:"," \u2192 npm config set cafile /path/to/company-cert.pem"," \u2192 Or set NODE_EXTRA_CA_CERTS=/path/to/company-cert.pem","For Node.js 22+, use --use-system-ca flag if the CA is installed in your system",`Inspect the certificate: ${Yke(e,o)}`,"Contact your IT department to get the corporate root CA certificate","If this is your server, consider using Let's Encrypt for free valid certificates","\u26A0\uFE0F Temporary workaround (not secure): npm config set strict-ssl false"],hostname:e,port:r,errorCode:n})}if(n&&qke.has(n))return new tt({type:"ssl_certificate_expired",cause:t,message:`SSL certificate error: The certificate for ${i} has expired.`,suggestions:["Contact the server administrator to renew the SSL certificate","Check if your system clock is set correctly - incorrect time can cause certificate errors","If this is your server, renew the certificate immediately","This may indicate a security issue - proceed with caution"],hostname:e,port:r,errorCode:n});if(n&&Vke.has(n))return new tt({type:"ssl_certificate_not_yet_valid",cause:t,message:`SSL certificate error: The certificate for ${i} is not yet valid. The certificate's validity period has not started yet.`,suggestions:["Check if your system clock is set correctly - this is the most common cause","Verify your system date and time are accurate","If the clock is correct, wait until the certificate becomes valid","Contact the server administrator - they may have deployed a certificate too early"],hostname:e,port:r,errorCode:n});if(n&&zke.has(n)){let o=n==="CRL_HAS_EXPIRED",s=n==="CRL_NOT_YET_VALID";return new tt({type:"ssl_certificate_invalid",cause:t,message:`SSL error: The Certificate Revocation List (CRL) for ${i} ${o?"has expired":s?"is not yet valid":"has invalid date fields"}. This means the revocation list is stale, not that the certificate itself has expired.`,suggestions:["This is often a server-side configuration issue - the server needs to update its CRL","Check if your system clock is set correctly - incorrect time can cause CRL validation errors","If behind a corporate proxy, the proxy may be caching an outdated CRL","Try again later - the server administrator may need to refresh the CRL","If on a corporate network, contact your IT department","\u26A0\uFE0F Temporary workaround (not secure): npm config set strict-ssl false"],hostname:e,port:r,errorCode:n})}if(n&&$ke.has(n))return new tt({type:"ssl_certificate_invalid",cause:t,message:`SSL certificate error: The certificate for ${i} could not be verified. ${rRe(n)}`,suggestions:["If on a corporate network, add your company's CA certificate:"," \u2192 npm config set cafile /path/to/company-cert.pem"," \u2192 Or set NODE_EXTRA_CA_CERTS=/path/to/company-cert.pem","For Node.js 22+, use --use-system-ca flag if certificates are installed in your system","The server may be missing intermediate certificates in its chain","If behind a corporate proxy, contact IT for the proxy's root CA certificate","Verify you're connecting to the correct server (check for DNS hijacking)","\u26A0\uFE0F Temporary workaround (not secure): npm config set strict-ssl false"],hostname:e,port:r,errorCode:n});if(n&&Zke.has(n))return new tt({type:"ssl_handshake_failed",cause:t,message:`SSL/TLS handshake with ${i} failed. Could not establish a secure connection.`,suggestions:["The server may be temporarily unavailable - try again","Check if a proxy or firewall is intercepting HTTPS traffic","Your corporate network may require specific certificates to be installed","The server may require a specific TLS version your client doesn't support","Try connecting from a different network to isolate the issue"],hostname:e,port:r,errorCode:n});if(n&&Xke.has(n)){let o=n==="CRYPT_E_REVOCATION_OFFLINE";return new tt({type:"ssl_certificate_invalid",cause:t,message:`Certificate revocation check failed for ${i}. ${o?"The revocation server is offline.":"Unable to verify certificate revocation status."}`,suggestions:["This is often a temporary issue - try again in a few minutes","The certificate revocation server (CRL/OCSP) may be unreachable","If on a corporate network, add your company's CA certificate:"," \u2192 npm config set cafile /path/to/company-cert.pem","Check if a firewall or proxy is blocking access to revocation servers","Contact your IT department for assistance with certificate configuration","\u26A0\uFE0F Temporary workaround (not secure): npm config set strict-ssl false"],hostname:e,port:r,errorCode:n})}return n&&Wke.has(n)?new tt({type:"ssl_protocol_error",cause:t,message:`SSL/TLS protocol error connecting to ${i}. ${nRe(n)}`,suggestions:["The server may require a different TLS version (try TLS 1.2 or 1.3)","If behind a proxy, it may not support modern TLS protocols","Corporate firewalls sometimes downgrade TLS - contact your IT department","The server's SSL configuration may be outdated or misconfigured","Try updating Node.js to get the latest TLS support"],hostname:e,port:r,errorCode:n}):n&&eRe.has(n)?new tt({type:"proxy_error",cause:t,message:`Proxy error while connecting to ${i}. The proxy server could not establish a tunnel.`,suggestions:["Verify your proxy settings (HTTP_PROXY, HTTPS_PROXY environment variables)","Check if the proxy server is running and accessible","Ensure the proxy allows connections to the target host","Try bypassing the proxy by adding the host to NO_PROXY","Corporate proxies may require authentication - check credentials","The proxy may be blocking this specific destination"],hostname:e,port:r,errorCode:n}):n&&tRe.has(n)?new tt({type:"network_unreachable",cause:t,message:`Cannot reach ${i}. ${n==="EHOSTUNREACH"?"The host":"The network"} is unreachable.`,suggestions:["Check your internet connection is active","If on WiFi, try reconnecting to the network","VPN connection may have dropped - reconnect if using VPN","The destination network may be down or unreachable from your location","Check if a firewall is blocking outbound connections",`Diagnose the route: ${Oke(e)}`],hostname:e,port:r,errorCode:n}):n==="EPIPE"?new tt({type:"connection_reset",cause:t,message:`Broken pipe to ${i}. The connection was closed while data was being sent.`,suggestions:["The server closed the connection unexpectedly - try again","Check if the request payload is too large","Network instability may have caused the connection to drop","If using keep-alive, the server may have closed an idle connection"],hostname:e,port:r,errorCode:n}):n==="ERR_SOCKET_BAD_PORT"?new tt({type:"socket_error",cause:t,message:`Invalid port number for ${e}. Port must be a number between 1 and 65535.`,suggestions:["Check your configuration for the correct port number","Ensure the port is a valid integer (1-65535)","Common ports: HTTP (80), HTTPS (443), custom services typically use 3000-9999","If using environment variables, verify they are set correctly"],hostname:e,port:r,errorCode:n}):n==="ERR_SOCKET_CLOSED"||n==="ERR_SOCKET_CLOSED_BEFORE_CONNECTION"?new tt({type:"socket_error",cause:t,message:`Socket closed unexpectedly while connecting to ${i}.`,suggestions:["The connection was closed unexpectedly - try again","Check for network instability","The server may have rejected the connection"],hostname:e,port:r,errorCode:n}):new tt({type:"unknown",cause:t,errorCode:n,message:`Network error connecting to ${i}: ${n?`[${n}] `:""}${t.message}`,suggestions:["Check your internet connection","If behind a proxy, verify proxy settings are correct","Try connecting from a different network","Check if a firewall or antivirus is blocking the connection","Try again in a few minutes - the service may be temporarily unavailable"],hostname:e,port:r})}function rRe(t){return{UNABLE_TO_GET_ISSUER_CERT:"The certificate issuer could not be found.",UNABLE_TO_GET_ISSUER_CERT_LOCALLY:"The certificate issuer is not in the local trusted store.",UNABLE_TO_VERIFY_LEAF_SIGNATURE:"The first certificate in the chain could not be verified.",INVALID_CA:"The CA certificate is invalid.",CERT_SIGNATURE_FAILURE:"The certificate signature is invalid.",CERT_REVOKED:"The certificate has been revoked.",CERT_REJECTED:"The certificate was rejected.",CERT_UNTRUSTED:"The certificate is not trusted.",HOSTNAME_MISMATCH:"The certificate hostname does not match the requested hostname.",ERR_TLS_CERT_ALTNAME_INVALID:"The hostname is not in the certificate's subject alternative names."}[t]||""}function nRe(t){return{ERR_TLS_INVALID_PROTOCOL_VERSION:"The TLS protocol version is not supported.",ERR_TLS_INVALID_PROTOCOL_METHOD:"The TLS protocol method is invalid.",ERR_TLS_PROTOCOL_VERSION_CONFLICT:"There is a conflict between TLS protocol versions.",EPROTO:"A protocol error occurred during the SSL/TLS handshake.",ERR_SSL_WRONG_VERSION_NUMBER:"SSL version number mismatch.",ERR_TLS_DH_PARAM_SIZE:"The Diffie-Hellman parameters are too small (insecure)."}[t]||""}function En(t){L.error("\u{1F534} Network Error Details:"),L.error(t.message),t.suggestions.length>0&&(L.info("\u{1F4A1} Troubleshooting suggestions:"),t.suggestions.forEach((e,r)=>{L.info(` ${r+1}. ${e}`)})),t.hostname&&L.info(`\u{1F4CD} Target: ${t.hostname}${t.port?`:${t.port}`:""}`),t.statusCode&&L.info(`\u{1F4CA} HTTP Status: ${t.statusCode}`),t.errorCode&&L.info(`\u{1F527} Error Code: ${t.errorCode}`),console.log(`
|
|
1214
|
-
`)}var _t,tt,HQ,Gke,jke,$ke,qke,Vke,zke,Wke,Zke,Xke,eRe,tRe,Vi=M(()=>{"use strict";C();or();_t=class extends Error{},tt=class extends _t{constructor({type:e,cause:r,message:n,suggestions:i=[],hostname:o,port:s,statusCode:a,errorCode:A}){super(n,{cause:r}),this.name="NetworkError",this.type=e,this.suggestions=i,this.hostname=o,this.port=s,this.statusCode=a,this.errorCode=A}type;suggestions;hostname;port;statusCode;errorCode},HQ=process.platform==="win32",Gke=process.platform==="darwin";jke=new Set(["DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN"]),$ke=new Set(["UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","INVALID_CA","CERT_SIGNATURE_FAILURE","CERT_REVOKED","CERT_REJECTED","CERT_UNTRUSTED","CERT_CHAIN_TOO_LONG","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","UNABLE_TO_DECRYPT_CERT_SIGNATURE","HOSTNAME_MISMATCH","ERR_TLS_CERT_ALTNAME_INVALID"]),qke=new Set(["CERT_HAS_EXPIRED","ERROR_IN_CERT_NOT_AFTER_FIELD"]),Vke=new Set(["CERT_NOT_YET_VALID","ERROR_IN_CERT_NOT_BEFORE_FIELD"]),zke=new Set(["CRL_HAS_EXPIRED","CRL_NOT_YET_VALID","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD"]),Wke=new Set(["ERR_TLS_INVALID_PROTOCOL_VERSION","ERR_TLS_INVALID_PROTOCOL_METHOD","ERR_TLS_PROTOCOL_VERSION_CONFLICT","ERR_TLS_INVALID_STATE","ERR_TLS_INVALID_CONTEXT","ERR_TLS_RENEGOTIATION_DISABLED","ERR_TLS_REQUIRED_SERVER_NAME","ERR_TLS_SESSION_ATTACK","ERR_TLS_SNI_FROM_SERVER","ERR_TLS_DH_PARAM_SIZE","ERR_SSL_WRONG_VERSION_NUMBER","EPROTO"]),Zke=new Set(["ERR_TLS_HANDSHAKE_TIMEOUT","ERR_SSL_HANDSHAKE_FAILURE"]),Xke=new Set(["CRYPT_E_NO_REVOCATION_CHECK","CRYPT_E_REVOCATION_OFFLINE","CRYPT_E_NO_REVOCATION_DLL","CRYPT_E_NOT_IN_REVOCATION_DATABASE","UNABLE_TO_GET_CRL","CRL_SIGNATURE_FAILURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE"]),eRe=new Set(["ERR_PROXY_INVALID_CONFIG","ERR_PROXY_TUNNEL","ERR_TUNNEL_CONNECTION_FAILED"]),tRe=new Set(["ENETUNREACH","EHOSTUNREACH","ENETDOWN","ENONET"])});async function e$(t){let e=process.env.NODE_ENV!=="test",r=await n$(),n=await r$();Ka.init(e?"2532be1b0436a18cb938b21fc7fa9faf":"",{logLevel:Ka.Types.LogLevel.None,flushIntervalMillis:500});let i=new Ka.Identify;return await Ka.identify(i,{device_id:r,user_id:n,platform:dk.default.type(),os_name:process.platform,os_version:dk.default.release()}).promise,Xs.init({dsn:"https://3252dddc08dbb5bf406dc33bf3c13633@o117565.ingest.us.sentry.io/4505630794448896",tracesSampleRate:0,release:L9,environment:process.env.NODE_ENV,enabled:e,registerEsmLoaderHooks:!1,normalizeDepth:5,maxValueLength:1500,integrations:[Xs.nativeNodeFetchIntegration(),Xs.httpIntegration(),Xs.extraErrorDataIntegration()],beforeSend:(o,s)=>{let a=s.originalException??s.syntheticException;return!(a instanceof _t)&&(t||o.level!=="warning")&&console.error((0,Xj.red)(`ERROR ID: ${o.event_id}`),a),o},tracePropagationTargets:[]}),Xs.setUser({username:process.env.USER||process.env.USERNAME||"unknown"}),Xs}async function ct(t,e){let r={...e,app:"dev-tools-cli",package:"cli"},n=await r$(),i=await n$();return await Ka.track(t,r,{user_id:n,device_id:i}).promise}async function t$(t){JQ=t;let e=await Mp();await ak({...e,userId:t})}async function r$(){if(JQ)return JQ;let t=await Mp(),e;return sk(t,"userId")&&(e=t.userId),JQ=e,e}async function n$(){if(pk)return pk;let t=await Mp(),e=lk();return sk(t,"deviceId")?e=t.deviceId:await ak({...t,deviceId:e}),pk=e,e}var Ka,Xs,dk,Xj,JQ,pk,mo=M(()=>{"use strict";C();Ka=ie(require("@amplitude/analytics-node"),1),Xs=ie(require("@sentry/node"),1);P9();bh();Zj();dk=ie(require("node:os"),1),Xj=ie(Pr(),1);Vi()});var o$=v(i$=>{C();(function t(e){"use strict";var r,n,i,o,s,a;function A(B){var Q={},w,D;for(w in B)B.hasOwnProperty(w)&&(D=B[w],typeof D=="object"&&D!==null?Q[w]=A(D):Q[w]=D);return Q}function c(B,Q){var w,D,b,S;for(D=B.length,b=0;D;)w=D>>>1,S=b+w,Q(B[S])?D=w:(b=S+1,D-=w+1);return b}r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},i={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},o={},s={},a={},n={Break:o,Skip:s,Remove:a};function u(B,Q){this.parent=B,this.key=Q}u.prototype.replace=function(Q){this.parent[this.key]=Q},u.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)};function l(B,Q,w,D){this.node=B,this.path=Q,this.wrap=w,this.ref=D}function g(){}g.prototype.path=function(){var Q,w,D,b,S,k;function F(K,z){if(Array.isArray(z))for(D=0,b=z.length;D<b;++D)K.push(z[D]);else K.push(z)}if(!this.__current.path)return null;for(S=[],Q=2,w=this.__leavelist.length;Q<w;++Q)k=this.__leavelist[Q],F(S,k.path);return F(S,this.__current.path),S},g.prototype.type=function(){var B=this.current();return B.type||this.__current.wrap},g.prototype.parents=function(){var Q,w,D;for(D=[],Q=1,w=this.__leavelist.length;Q<w;++Q)D.push(this.__leavelist[Q].node);return D},g.prototype.current=function(){return this.__current.node},g.prototype.__execute=function(Q,w){var D,b;return b=void 0,D=this.__current,this.__current=w,this.__state=null,Q&&(b=Q.call(this,w.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=D,b},g.prototype.notify=function(Q){this.__state=Q},g.prototype.skip=function(){this.notify(s)},g.prototype.break=function(){this.notify(o)},g.prototype.remove=function(){this.notify(a)},g.prototype.__initialize=function(B,Q){this.visitor=Q,this.root=B,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,Q.fallback==="iteration"?this.__fallback=Object.keys:typeof Q.fallback=="function"&&(this.__fallback=Q.fallback),this.__keys=i,Q.keys&&(this.__keys=Object.assign(Object.create(this.__keys),Q.keys))};function d(B){return B==null?!1:typeof B=="object"&&typeof B.type=="string"}function p(B,Q){return(B===r.ObjectExpression||B===r.ObjectPattern)&&Q==="properties"}function f(B,Q){for(var w=B.length-1;w>=0;--w)if(B[w].node===Q)return!0;return!1}g.prototype.traverse=function(Q,w){var D,b,S,k,F,K,z,q,T,U,H,Z;for(this.__initialize(Q,w),Z={},D=this.__worklist,b=this.__leavelist,D.push(new l(Q,null,null,null)),b.push(new l(null,null,null,null));D.length;){if(S=D.pop(),S===Z){if(S=b.pop(),K=this.__execute(w.leave,S),this.__state===o||K===o)return;continue}if(S.node){if(K=this.__execute(w.enter,S),this.__state===o||K===o)return;if(D.push(Z),b.push(S),this.__state===s||K===s)continue;if(k=S.node,F=k.type||S.wrap,U=this.__keys[F],!U)if(this.__fallback)U=this.__fallback(k);else throw new Error("Unknown node type "+F+".");for(q=U.length;(q-=1)>=0;)if(z=U[q],H=k[z],!!H){if(Array.isArray(H)){for(T=H.length;(T-=1)>=0;)if(H[T]&&!f(b,H[T])){if(p(F,U[q]))S=new l(H[T],[z,T],"Property",null);else if(d(H[T]))S=new l(H[T],[z,T],null,null);else continue;D.push(S)}}else if(d(H)){if(f(b,H))continue;D.push(new l(H,z,null,null))}}}}},g.prototype.replace=function(Q,w){var D,b,S,k,F,K,z,q,T,U,H,Z,V;function O(P){var re,Ae,Ie,Be;if(P.ref.remove()){for(Ae=P.ref.key,Be=P.ref.parent,re=D.length;re--;)if(Ie=D[re],Ie.ref&&Ie.ref.parent===Be){if(Ie.ref.key<Ae)break;--Ie.ref.key}}}for(this.__initialize(Q,w),H={},D=this.__worklist,b=this.__leavelist,Z={root:Q},K=new l(Q,null,null,new u(Z,"root")),D.push(K),b.push(K);D.length;){if(K=D.pop(),K===H){if(K=b.pop(),F=this.__execute(w.leave,K),F!==void 0&&F!==o&&F!==s&&F!==a&&K.ref.replace(F),(this.__state===a||F===a)&&O(K),this.__state===o||F===o)return Z.root;continue}if(F=this.__execute(w.enter,K),F!==void 0&&F!==o&&F!==s&&F!==a&&(K.ref.replace(F),K.node=F),(this.__state===a||F===a)&&(O(K),K.node=null),this.__state===o||F===o)return Z.root;if(S=K.node,!!S&&(D.push(H),b.push(K),!(this.__state===s||F===s))){if(k=S.type||K.wrap,T=this.__keys[k],!T)if(this.__fallback)T=this.__fallback(S);else throw new Error("Unknown node type "+k+".");for(z=T.length;(z-=1)>=0;)if(V=T[z],U=S[V],!!U)if(Array.isArray(U)){for(q=U.length;(q-=1)>=0;)if(U[q]){if(p(k,T[z]))K=new l(U[q],[V,q],"Property",new u(U,q));else if(d(U[q]))K=new l(U[q],[V,q],null,new u(U,q));else continue;D.push(K)}}else d(U)&&D.push(new l(U,V,null,new u(S,V)))}}return Z.root};function h(B,Q){var w=new g;return w.traverse(B,Q)}function m(B,Q){var w=new g;return w.replace(B,Q)}function I(B,Q){var w;return w=c(Q,function(b){return b.range[0]>B.range[0]}),B.extendedRange=[B.range[0],B.range[1]],w!==Q.length&&(B.extendedRange[1]=Q[w].range[0]),w-=1,w>=0&&(B.extendedRange[0]=Q[w].range[1]),B}function E(B,Q,w){var D=[],b,S,k,F;if(!B.range)throw new Error("attachComments needs range information");if(!w.length){if(Q.length){for(k=0,S=Q.length;k<S;k+=1)b=A(Q[k]),b.extendedRange=[0,B.range[0]],D.push(b);B.leadingComments=D}return B}for(k=0,S=Q.length;k<S;k+=1)D.push(I(A(Q[k]),w));return F=0,h(B,{enter:function(K){for(var z;F<D.length&&(z=D[F],!(z.extendedRange[1]>K.range[0]));)z.extendedRange[1]===K.range[0]?(K.leadingComments||(K.leadingComments=[]),K.leadingComments.push(z),D.splice(F,1)):F+=1;if(F===D.length)return n.Break;if(D[F].extendedRange[0]>K.range[1])return n.Skip}}),F=0,h(B,{leave:function(K){for(var z;F<D.length&&(z=D[F],!(K.range[1]<z.extendedRange[0]));)K.range[1]===z.extendedRange[0]?(K.trailingComments||(K.trailingComments=[]),K.trailingComments.push(z),D.splice(F,1)):F+=1;if(F===D.length)return n.Break;if(D[F].extendedRange[0]>K.range[1])return n.Skip}}),B}return e.Syntax=r,e.traverse=h,e.replace=m,e.attachComments=E,e.VisitorKeys=i,e.VisitorOption=n,e.Controller=g,e.cloneEnvironment=function(){return t({})},e})(i$)});var a$=v(($Bt,s$)=>{C();(function(){"use strict";function t(s){if(s==null)return!1;switch(s.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return!0}return!1}function e(s){if(s==null)return!1;switch(s.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1}function r(s){if(s==null)return!1;switch(s.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return!0}return!1}function n(s){return r(s)||s!=null&&s.type==="FunctionDeclaration"}function i(s){switch(s.type){case"IfStatement":return s.alternate!=null?s.alternate:s.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return s.body}return null}function o(s){var a;if(s.type!=="IfStatement"||s.alternate==null)return!1;a=s.consequent;do{if(a.type==="IfStatement"&&a.alternate==null)return!0;a=i(a)}while(a);return!1}s$.exports={isExpression:t,isStatement:r,isIterationStatement:e,isSourceElement:n,isProblematicIfStatement:o,trailingStatement:i}})()});var fk=v((VBt,A$)=>{C();(function(){"use strict";var t,e,r,n,i,o;e={NonAsciiIdentifierStart:/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]/,NonAsciiIdentifierPart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/},t={NonAsciiIdentifierStart:/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};function s(h){return 48<=h&&h<=57}function a(h){return 48<=h&&h<=57||97<=h&&h<=102||65<=h&&h<=70}function A(h){return h>=48&&h<=55}r=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function c(h){return h===32||h===9||h===11||h===12||h===160||h>=5760&&r.indexOf(h)>=0}function u(h){return h===10||h===13||h===8232||h===8233}function l(h){if(h<=65535)return String.fromCharCode(h);var m=String.fromCharCode(Math.floor((h-65536)/1024)+55296),I=String.fromCharCode((h-65536)%1024+56320);return m+I}for(n=new Array(128),o=0;o<128;++o)n[o]=o>=97&&o<=122||o>=65&&o<=90||o===36||o===95;for(i=new Array(128),o=0;o<128;++o)i[o]=o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===36||o===95;function g(h){return h<128?n[h]:e.NonAsciiIdentifierStart.test(l(h))}function d(h){return h<128?i[h]:e.NonAsciiIdentifierPart.test(l(h))}function p(h){return h<128?n[h]:t.NonAsciiIdentifierStart.test(l(h))}function f(h){return h<128?i[h]:t.NonAsciiIdentifierPart.test(l(h))}A$.exports={isDecimalDigit:s,isHexDigit:a,isOctalDigit:A,isWhiteSpace:c,isLineTerminator:u,isIdentifierStartES5:g,isIdentifierPartES5:d,isIdentifierStartES6:p,isIdentifierPartES6:f}})()});var u$=v((WBt,c$)=>{C();(function(){"use strict";var t=fk();function e(g){switch(g){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}function r(g,d){return!d&&g==="yield"?!1:n(g,d)}function n(g,d){if(d&&e(g))return!0;switch(g.length){case 2:return g==="if"||g==="in"||g==="do";case 3:return g==="var"||g==="for"||g==="new"||g==="try";case 4:return g==="this"||g==="else"||g==="case"||g==="void"||g==="with"||g==="enum";case 5:return g==="while"||g==="break"||g==="catch"||g==="throw"||g==="const"||g==="yield"||g==="class"||g==="super";case 6:return g==="return"||g==="typeof"||g==="delete"||g==="switch"||g==="export"||g==="import";case 7:return g==="default"||g==="finally"||g==="extends";case 8:return g==="function"||g==="continue"||g==="debugger";case 10:return g==="instanceof";default:return!1}}function i(g,d){return g==="null"||g==="true"||g==="false"||r(g,d)}function o(g,d){return g==="null"||g==="true"||g==="false"||n(g,d)}function s(g){return g==="eval"||g==="arguments"}function a(g){var d,p,f;if(g.length===0||(f=g.charCodeAt(0),!t.isIdentifierStartES5(f)))return!1;for(d=1,p=g.length;d<p;++d)if(f=g.charCodeAt(d),!t.isIdentifierPartES5(f))return!1;return!0}function A(g,d){return(g-55296)*1024+(d-56320)+65536}function c(g){var d,p,f,h,m;if(g.length===0)return!1;for(m=t.isIdentifierStartES6,d=0,p=g.length;d<p;++d){if(f=g.charCodeAt(d),55296<=f&&f<=56319){if(++d,d>=p||(h=g.charCodeAt(d),!(56320<=h&&h<=57343)))return!1;f=A(f,h)}if(!m(f))return!1;m=t.isIdentifierPartES6}return!0}function u(g,d){return a(g)&&!i(g,d)}function l(g,d){return c(g)&&!o(g,d)}c$.exports={isKeywordES5:r,isKeywordES6:n,isReservedWordES5:i,isReservedWordES6:o,isRestrictedWord:s,isIdentifierNameES5:a,isIdentifierNameES6:c,isIdentifierES5:u,isIdentifierES6:l}})()});var l$=v(YQ=>{C();(function(){"use strict";YQ.ast=a$(),YQ.code=fk(),YQ.keyword=u$()})()});var p$=v(Ck=>{C();var g$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Ck.encode=function(t){if(0<=t&&t<g$.length)return g$[t];throw new TypeError("Must be between 0 and 63: "+t)};Ck.decode=function(t){var e=65,r=90,n=97,i=122,o=48,s=57,a=43,A=47,c=26,u=52;return e<=t&&t<=r?t-e:n<=t&&t<=i?t-n+c:o<=t&&t<=s?t-o+u:t==a?62:t==A?63:-1}});var Ik=v(mk=>{C();var d$=p$(),hk=5,f$=1<<hk,C$=f$-1,h$=f$;function iRe(t){return t<0?(-t<<1)+1:(t<<1)+0}function oRe(t){var e=(t&1)===1,r=t>>1;return e?-r:r}mk.encode=function(e){var r="",n,i=iRe(e);do n=i&C$,i>>>=hk,i>0&&(n|=h$),r+=d$.encode(n);while(i>0);return r};mk.decode=function(e,r,n){var i=e.length,o=0,s=0,a,A;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(A=d$.decode(e.charCodeAt(r++)),A===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));a=!!(A&h$),A&=C$,o=o+(A<<s),s+=hk}while(a);n.value=oRe(o),n.rest=r}});var Lp=v(wi=>{C();function sRe(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}wi.getArg=sRe;var m$=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,aRe=/^data:.+\,.+$/;function vh(t){var e=t.match(m$);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}wi.urlParse=vh;function Tp(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}wi.urlGenerate=Tp;function Ek(t){var e=t,r=vh(t);if(r){if(!r.path)return t;e=r.path}for(var n=wi.isAbsolute(e),i=e.split(/\/+/),o,s=0,a=i.length-1;a>=0;a--)o=i[a],o==="."?i.splice(a,1):o===".."?s++:s>0&&(o===""?(i.splice(a+1,s),s=0):(i.splice(a,2),s--));return e=i.join("/"),e===""&&(e=n?"/":"."),r?(r.path=e,Tp(r)):e}wi.normalize=Ek;function I$(t,e){t===""&&(t="."),e===""&&(e=".");var r=vh(e),n=vh(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Tp(r);if(r||e.match(aRe))return e;if(n&&!n.host&&!n.path)return n.host=e,Tp(n);var i=e.charAt(0)==="/"?e:Ek(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,Tp(n)):i}wi.join=I$;wi.isAbsolute=function(t){return t.charAt(0)==="/"||m$.test(t)};function ARe(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}wi.relative=ARe;var E$=(function(){var t=Object.create(null);return!("__proto__"in t)})();function B$(t){return t}function cRe(t){return Q$(t)?"$"+t:t}wi.toSetString=E$?B$:cRe;function uRe(t){return Q$(t)?t.slice(1):t}wi.fromSetString=E$?B$:uRe;function Q$(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function lRe(t,e,r){var n=Pp(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:Pp(t.name,e.name)}wi.compareByOriginalPositions=lRe;function gRe(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=Pp(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:Pp(t.name,e.name)}wi.compareByGeneratedPositionsDeflated=gRe;function Pp(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function pRe(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=Pp(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:Pp(t.name,e.name)}wi.compareByGeneratedPositionsInflated=pRe;function dRe(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}wi.parseSourceMapInput=dRe;function fRe(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=vh(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}e=I$(Tp(n),e)}return Ek(e)}wi.computeSourceURL=fRe});var Dk=v(D$=>{C();var Bk=Lp(),Qk=Object.prototype.hasOwnProperty,Bl=typeof Map<"u";function UA(){this._array=[],this._set=Bl?new Map:Object.create(null)}UA.fromArray=function(e,r){for(var n=new UA,i=0,o=e.length;i<o;i++)n.add(e[i],r);return n};UA.prototype.size=function(){return Bl?this._set.size:Object.getOwnPropertyNames(this._set).length};UA.prototype.add=function(e,r){var n=Bl?e:Bk.toSetString(e),i=Bl?this.has(e):Qk.call(this._set,n),o=this._array.length;(!i||r)&&this._array.push(e),i||(Bl?this._set.set(e,o):this._set[n]=o)};UA.prototype.has=function(e){if(Bl)return this._set.has(e);var r=Bk.toSetString(e);return Qk.call(this._set,r)};UA.prototype.indexOf=function(e){if(Bl){var r=this._set.get(e);if(r>=0)return r}else{var n=Bk.toSetString(e);if(Qk.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};UA.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};UA.prototype.toArray=function(){return this._array.slice()};D$.ArraySet=UA});var b$=v(w$=>{C();var y$=Lp();function CRe(t,e){var r=t.generatedLine,n=e.generatedLine,i=t.generatedColumn,o=e.generatedColumn;return n>r||n==r&&o>=i||y$.compareByGeneratedPositionsInflated(t,e)<=0}function jQ(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}jQ.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};jQ.prototype.add=function(e){CRe(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};jQ.prototype.toArray=function(){return this._sorted||(this._array.sort(y$.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};w$.MappingList=jQ});var yk=v(v$=>{C();var xh=Ik(),Bn=Lp(),$Q=Dk().ArraySet,hRe=b$().MappingList;function fs(t){t||(t={}),this._file=Bn.getArg(t,"file",null),this._sourceRoot=Bn.getArg(t,"sourceRoot",null),this._skipValidation=Bn.getArg(t,"skipValidation",!1),this._sources=new $Q,this._names=new $Q,this._mappings=new hRe,this._sourcesContents=null}fs.prototype._version=3;fs.fromSourceMap=function(e){var r=e.sourceRoot,n=new fs({file:e.file,sourceRoot:r});return e.eachMapping(function(i){var o={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(o.source=i.source,r!=null&&(o.source=Bn.relative(r,o.source)),o.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(o.name=i.name)),n.addMapping(o)}),e.sources.forEach(function(i){var o=i;r!==null&&(o=Bn.relative(r,i)),n._sources.has(o)||n._sources.add(o);var s=e.sourceContentFor(i);s!=null&&n.setSourceContent(i,s)}),n};fs.prototype.addMapping=function(e){var r=Bn.getArg(e,"generated"),n=Bn.getArg(e,"original",null),i=Bn.getArg(e,"source",null),o=Bn.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,i,o),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:o})};fs.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=Bn.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Bn.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Bn.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};fs.prototype.applySourceMap=function(e,r,n){var i=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var o=this._sourceRoot;o!=null&&(i=Bn.relative(o,i));var s=new $Q,a=new $Q;this._mappings.unsortedForEach(function(A){if(A.source===i&&A.originalLine!=null){var c=e.originalPositionFor({line:A.originalLine,column:A.originalColumn});c.source!=null&&(A.source=c.source,n!=null&&(A.source=Bn.join(n,A.source)),o!=null&&(A.source=Bn.relative(o,A.source)),A.originalLine=c.line,A.originalColumn=c.column,c.name!=null&&(A.name=c.name))}var u=A.source;u!=null&&!s.has(u)&&s.add(u);var l=A.name;l!=null&&!a.has(l)&&a.add(l)},this),this._sources=s,this._names=a,e.sources.forEach(function(A){var c=e.sourceContentFor(A);c!=null&&(n!=null&&(A=Bn.join(n,A)),o!=null&&(A=Bn.relative(o,A)),this.setSourceContent(A,c))},this)};fs.prototype._validateMapping=function(e,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!i)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:i}))}};fs.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,i=0,o=0,s=0,a="",A,c,u,l,g=this._mappings.toArray(),d=0,p=g.length;d<p;d++){if(c=g[d],A="",c.generatedLine!==r)for(e=0;c.generatedLine!==r;)A+=";",r++;else if(d>0){if(!Bn.compareByGeneratedPositionsInflated(c,g[d-1]))continue;A+=","}A+=xh.encode(c.generatedColumn-e),e=c.generatedColumn,c.source!=null&&(l=this._sources.indexOf(c.source),A+=xh.encode(l-s),s=l,A+=xh.encode(c.originalLine-1-i),i=c.originalLine-1,A+=xh.encode(c.originalColumn-n),n=c.originalColumn,c.name!=null&&(u=this._names.indexOf(c.name),A+=xh.encode(u-o),o=u)),a+=A}return a};fs.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Bn.relative(r,n));var i=Bn.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};fs.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};fs.prototype.toString=function(){return JSON.stringify(this.toJSON())};v$.SourceMapGenerator=fs});var x$=v(Ql=>{C();Ql.GREATEST_LOWER_BOUND=1;Ql.LEAST_UPPER_BOUND=2;function wk(t,e,r,n,i,o){var s=Math.floor((e-t)/2)+t,a=i(r,n[s],!0);return a===0?s:a>0?e-s>1?wk(s,e,r,n,i,o):o==Ql.LEAST_UPPER_BOUND?e<n.length?e:-1:s:s-t>1?wk(t,s,r,n,i,o):o==Ql.LEAST_UPPER_BOUND?s:t<0?-1:t}Ql.search=function(e,r,n,i){if(r.length===0)return-1;var o=wk(-1,r.length,e,r,n,i||Ql.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&n(r[o],r[o-1],!0)===0;)--o;return o}});var F$=v(S$=>{C();function bk(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function mRe(t,e){return Math.round(t+Math.random()*(e-t))}function vk(t,e,r,n){if(r<n){var i=mRe(r,n),o=r-1;bk(t,i,n);for(var s=t[n],a=r;a<n;a++)e(t[a],s)<=0&&(o+=1,bk(t,o,a));bk(t,o+1,a);var A=o+1;vk(t,e,r,A-1),vk(t,e,A+1,n)}}S$.quickSort=function(t,e){vk(t,e,0,t.length-1)}});var R$=v(qQ=>{C();var Ge=Lp(),xk=x$(),_p=Dk().ArraySet,IRe=Ik(),Sh=F$().quickSort;function kr(t,e){var r=t;return typeof t=="string"&&(r=Ge.parseSourceMapInput(t)),r.sections!=null?new ea(r,e):new si(r,e)}kr.fromSourceMap=function(t,e){return si.fromSourceMap(t,e)};kr.prototype._version=3;kr.prototype.__generatedMappings=null;Object.defineProperty(kr.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});kr.prototype.__originalMappings=null;Object.defineProperty(kr.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});kr.prototype._charIsMappingSeparator=function(e,r){var n=e.charAt(r);return n===";"||n===","};kr.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")};kr.GENERATED_ORDER=1;kr.ORIGINAL_ORDER=2;kr.GREATEST_LOWER_BOUND=1;kr.LEAST_UPPER_BOUND=2;kr.prototype.eachMapping=function(e,r,n){var i=r||null,o=n||kr.GENERATED_ORDER,s;switch(o){case kr.GENERATED_ORDER:s=this._generatedMappings;break;case kr.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;s.map(function(A){var c=A.source===null?null:this._sources.at(A.source);return c=Ge.computeSourceURL(a,c,this._sourceMapURL),{source:c,generatedLine:A.generatedLine,generatedColumn:A.generatedColumn,originalLine:A.originalLine,originalColumn:A.originalColumn,name:A.name===null?null:this._names.at(A.name)}},this).forEach(e,i)};kr.prototype.allGeneratedPositionsFor=function(e){var r=Ge.getArg(e,"line"),n={source:Ge.getArg(e,"source"),originalLine:r,originalColumn:Ge.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Ge.compareByOriginalPositions,xk.LEAST_UPPER_BOUND);if(o>=0){var s=this._originalMappings[o];if(e.column===void 0)for(var a=s.originalLine;s&&s.originalLine===a;)i.push({line:Ge.getArg(s,"generatedLine",null),column:Ge.getArg(s,"generatedColumn",null),lastColumn:Ge.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o];else for(var A=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==A;)i.push({line:Ge.getArg(s,"generatedLine",null),column:Ge.getArg(s,"generatedColumn",null),lastColumn:Ge.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o]}return i};qQ.SourceMapConsumer=kr;function si(t,e){var r=t;typeof t=="string"&&(r=Ge.parseSourceMapInput(t));var n=Ge.getArg(r,"version"),i=Ge.getArg(r,"sources"),o=Ge.getArg(r,"names",[]),s=Ge.getArg(r,"sourceRoot",null),a=Ge.getArg(r,"sourcesContent",null),A=Ge.getArg(r,"mappings"),c=Ge.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=Ge.normalize(s)),i=i.map(String).map(Ge.normalize).map(function(u){return s&&Ge.isAbsolute(s)&&Ge.isAbsolute(u)?Ge.relative(s,u):u}),this._names=_p.fromArray(o.map(String),!0),this._sources=_p.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(u){return Ge.computeSourceURL(s,u,e)}),this.sourceRoot=s,this.sourcesContent=a,this._mappings=A,this._sourceMapURL=e,this.file=c}si.prototype=Object.create(kr.prototype);si.prototype.consumer=kr;si.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Ge.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return-1};si.fromSourceMap=function(e,r){var n=Object.create(si.prototype),i=n._names=_p.fromArray(e._names.toArray(),!0),o=n._sources=_p.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(d){return Ge.computeSourceURL(n.sourceRoot,d,r)});for(var s=e._mappings.toArray().slice(),a=n.__generatedMappings=[],A=n.__originalMappings=[],c=0,u=s.length;c<u;c++){var l=s[c],g=new k$;g.generatedLine=l.generatedLine,g.generatedColumn=l.generatedColumn,l.source&&(g.source=o.indexOf(l.source),g.originalLine=l.originalLine,g.originalColumn=l.originalColumn,l.name&&(g.name=i.indexOf(l.name)),A.push(g)),a.push(g)}return Sh(n.__originalMappings,Ge.compareByOriginalPositions),n};si.prototype._version=3;Object.defineProperty(si.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function k$(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}si.prototype._parseMappings=function(e,r){for(var n=1,i=0,o=0,s=0,a=0,A=0,c=e.length,u=0,l={},g={},d=[],p=[],f,h,m,I,E;u<c;)if(e.charAt(u)===";")n++,u++,i=0;else if(e.charAt(u)===",")u++;else{for(f=new k$,f.generatedLine=n,I=u;I<c&&!this._charIsMappingSeparator(e,I);I++);if(h=e.slice(u,I),m=l[h],m)u+=h.length;else{for(m=[];u<I;)IRe.decode(e,u,g),E=g.value,u=g.rest,m.push(E);if(m.length===2)throw new Error("Found a source, but no line and column");if(m.length===3)throw new Error("Found a source and line, but no column");l[h]=m}f.generatedColumn=i+m[0],i=f.generatedColumn,m.length>1&&(f.source=a+m[1],a+=m[1],f.originalLine=o+m[2],o=f.originalLine,f.originalLine+=1,f.originalColumn=s+m[3],s=f.originalColumn,m.length>4&&(f.name=A+m[4],A+=m[4])),p.push(f),typeof f.originalLine=="number"&&d.push(f)}Sh(p,Ge.compareByGeneratedPositionsDeflated),this.__generatedMappings=p,Sh(d,Ge.compareByOriginalPositions),this.__originalMappings=d};si.prototype._findMapping=function(e,r,n,i,o,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return xk.search(e,r,o,s)};si.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};si.prototype.originalPositionFor=function(e){var r={generatedLine:Ge.getArg(e,"line"),generatedColumn:Ge.getArg(e,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",Ge.compareByGeneratedPositionsDeflated,Ge.getArg(e,"bias",kr.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var o=Ge.getArg(i,"source",null);o!==null&&(o=this._sources.at(o),o=Ge.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var s=Ge.getArg(i,"name",null);return s!==null&&(s=this._names.at(s)),{source:o,line:Ge.getArg(i,"originalLine",null),column:Ge.getArg(i,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};si.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};si.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=Ge.relative(this.sourceRoot,i));var o;if(this.sourceRoot!=null&&(o=Ge.urlParse(this.sourceRoot))){var s=i.replace(/^file:\/\//,"");if(o.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!o.path||o.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')};si.prototype.generatedPositionFor=function(e){var r=Ge.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:Ge.getArg(e,"line"),originalColumn:Ge.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Ge.compareByOriginalPositions,Ge.getArg(e,"bias",kr.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===n.source)return{line:Ge.getArg(o,"generatedLine",null),column:Ge.getArg(o,"generatedColumn",null),lastColumn:Ge.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};qQ.BasicSourceMapConsumer=si;function ea(t,e){var r=t;typeof t=="string"&&(r=Ge.parseSourceMapInput(t));var n=Ge.getArg(r,"version"),i=Ge.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new _p,this._names=new _p;var o={line:-1,column:0};this._sections=i.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var a=Ge.getArg(s,"offset"),A=Ge.getArg(a,"line"),c=Ge.getArg(a,"column");if(A<o.line||A===o.line&&c<o.column)throw new Error("Section offsets must be ordered and non-overlapping.");return o=a,{generatedOffset:{generatedLine:A+1,generatedColumn:c+1},consumer:new kr(Ge.getArg(s,"map"),e)}})}ea.prototype=Object.create(kr.prototype);ea.prototype.constructor=kr;ea.prototype._version=3;Object.defineProperty(ea.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)t.push(this._sections[e].consumer.sources[r]);return t}});ea.prototype.originalPositionFor=function(e){var r={generatedLine:Ge.getArg(e,"line"),generatedColumn:Ge.getArg(e,"column")},n=xk.search(r,this._sections,function(o,s){var a=o.generatedLine-s.generatedOffset.generatedLine;return a||o.generatedColumn-s.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};ea.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};ea.prototype.sourceContentFor=function(e,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],o=i.consumer.sourceContentFor(e,!0);if(o)return o}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')};ea.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(Ge.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var o={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}};ea.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],o=i.consumer._generatedMappings,s=0;s<o.length;s++){var a=o[s],A=i.consumer._sources.at(a.source);A=Ge.computeSourceURL(i.consumer.sourceRoot,A,this._sourceMapURL),this._sources.add(A),A=this._sources.indexOf(A);var c=null;a.name&&(c=i.consumer._names.at(a.name),this._names.add(c),c=this._names.indexOf(c));var u={source:A,generatedLine:a.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(i.generatedOffset.generatedLine===a.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:c};this.__generatedMappings.push(u),typeof u.originalLine=="number"&&this.__originalMappings.push(u)}Sh(this.__generatedMappings,Ge.compareByGeneratedPositionsDeflated),Sh(this.__originalMappings,Ge.compareByOriginalPositions)};qQ.IndexedSourceMapConsumer=ea});var M$=v(N$=>{C();var ERe=yk().SourceMapGenerator,VQ=Lp(),BRe=/(\r?\n)/,QRe=10,Up="$$$isSourceNode$$$";function Yo(t,e,r,n,i){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=i??null,this[Up]=!0,n!=null&&this.add(n)}Yo.fromStringWithSourceMap=function(e,r,n){var i=new Yo,o=e.split(BRe),s=0,a=function(){var g=p(),d=p()||"";return g+d;function p(){return s<o.length?o[s++]:void 0}},A=1,c=0,u=null;return r.eachMapping(function(g){if(u!==null)if(A<g.generatedLine)l(u,a()),A++,c=0;else{var d=o[s]||"",p=d.substr(0,g.generatedColumn-c);o[s]=d.substr(g.generatedColumn-c),c=g.generatedColumn,l(u,p),u=g;return}for(;A<g.generatedLine;)i.add(a()),A++;if(c<g.generatedColumn){var d=o[s]||"";i.add(d.substr(0,g.generatedColumn)),o[s]=d.substr(g.generatedColumn),c=g.generatedColumn}u=g},this),s<o.length&&(u&&l(u,a()),i.add(o.splice(s).join(""))),r.sources.forEach(function(g){var d=r.sourceContentFor(g);d!=null&&(n!=null&&(g=VQ.join(n,g)),i.setSourceContent(g,d))}),i;function l(g,d){if(g===null||g.source===void 0)i.add(d);else{var p=n?VQ.join(n,g.source):g.source;i.add(new Yo(g.originalLine,g.originalColumn,p,d,g.name))}}};Yo.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[Up]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Yo.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[Up]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Yo.prototype.walk=function(e){for(var r,n=0,i=this.children.length;n<i;n++)r=this.children[n],r[Up]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})};Yo.prototype.join=function(e){var r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(e);r.push(this.children[n]),this.children=r}return this};Yo.prototype.replaceRight=function(e,r){var n=this.children[this.children.length-1];return n[Up]?n.replaceRight(e,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,r):this.children.push("".replace(e,r)),this};Yo.prototype.setSourceContent=function(e,r){this.sourceContents[VQ.toSetString(e)]=r};Yo.prototype.walkSourceContents=function(e){for(var r=0,n=this.children.length;r<n;r++)this.children[r][Up]&&this.children[r].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)e(VQ.fromSetString(i[r]),this.sourceContents[i[r]])};Yo.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e};Yo.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},n=new ERe(e),i=!1,o=null,s=null,a=null,A=null;return this.walk(function(c,u){r.code+=c,u.source!==null&&u.line!==null&&u.column!==null?((o!==u.source||s!==u.line||a!==u.column||A!==u.name)&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:r.line,column:r.column},name:u.name}),o=u.source,s=u.line,a=u.column,A=u.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),o=null,i=!1);for(var l=0,g=c.length;l<g;l++)c.charCodeAt(l)===QRe?(r.line++,r.column=0,l+1===g?(o=null,i=!1):i&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:r.line,column:r.column},name:u.name})):r.column++}),this.walkSourceContents(function(c,u){n.setSourceContent(c,u)}),{code:r.code,map:n}};N$.SourceNode=Yo});var T$=v(zQ=>{C();zQ.SourceMapGenerator=yk().SourceMapGenerator;zQ.SourceMapConsumer=R$().SourceMapConsumer;zQ.SourceNode=M$().SourceNode});var P$=v((DQt,DRe)=>{DRe.exports={name:"escodegen",description:"ECMAScript code generator",homepage:"http://github.com/estools/escodegen",main:"escodegen.js",bin:{esgenerate:"./bin/esgenerate.js",escodegen:"./bin/escodegen.js"},files:["LICENSE.BSD","README.md","bin","escodegen.js","package.json"],version:"2.1.0",engines:{node:">=6.0"},maintainers:[{name:"Yusuke Suzuki",email:"utatane.tea@gmail.com",web:"http://github.com/Constellation"}],repository:{type:"git",url:"http://github.com/estools/escodegen.git"},dependencies:{estraverse:"^5.2.0",esutils:"^2.0.2",esprima:"^4.0.1"},optionalDependencies:{"source-map":"~0.6.1"},devDependencies:{acorn:"^8.0.4",bluebird:"^3.4.7","bower-registry-client":"^1.0.0",chai:"^4.2.0","chai-exclude":"^2.0.2","commonjs-everywhere":"^0.9.7",gulp:"^4.0.2","gulp-eslint":"^6.0.0","gulp-mocha":"^7.0.2",minimist:"^1.2.5",optionator:"^0.9.1",semver:"^7.3.4"},license:"BSD-2-Clause",scripts:{test:"gulp travis","unit-test":"gulp test",lint:"gulp lint",release:"node tools/release.js","build-min":"./node_modules/.bin/cjsify -ma path: tools/entry-point.js > escodegen.browser.min.js",build:"./node_modules/.bin/cjsify -a path: tools/entry-point.js > escodegen.browser.js"}}});var L$=v(GA=>{C();(function(){"use strict";var t,e,r,n,i,o,s,a,A,c,u,l,g,d,p,f,h,m,I,E,B,Q,w,D,b,S;i=o$(),o=l$(),t=i.Syntax;function k(y){return ye.Expression.hasOwnProperty(y.type)}function F(y){return ye.Statement.hasOwnProperty(y.type)}e={Sequence:0,Yield:1,Assignment:1,Conditional:2,ArrowFunction:2,Coalesce:3,LogicalOR:4,LogicalAND:5,BitwiseOR:6,BitwiseXOR:7,BitwiseAND:8,Equality:9,Relational:10,BitwiseSHIFT:11,Additive:12,Multiplicative:13,Exponentiation:14,Await:15,Unary:15,Postfix:16,OptionalChaining:17,Call:18,New:19,TaggedTemplate:20,Member:21,Primary:22},r={"??":e.Coalesce,"||":e.LogicalOR,"&&":e.LogicalAND,"|":e.BitwiseOR,"^":e.BitwiseXOR,"&":e.BitwiseAND,"==":e.Equality,"!=":e.Equality,"===":e.Equality,"!==":e.Equality,is:e.Equality,isnt:e.Equality,"<":e.Relational,">":e.Relational,"<=":e.Relational,">=":e.Relational,in:e.Relational,instanceof:e.Relational,"<<":e.BitwiseSHIFT,">>":e.BitwiseSHIFT,">>>":e.BitwiseSHIFT,"+":e.Additive,"-":e.Additive,"*":e.Multiplicative,"%":e.Multiplicative,"/":e.Multiplicative,"**":e.Exponentiation};var K=1,z=2,q=4,T=8,U=16,H=32,Z=64,V=z|q,O=K|z,P=K|z|q,re=K,Ae=q,Ie=K|q,Be=K,X=K|H,Te=0,ht=K|U,Ee=K|T;function Ke(){return{indent:null,base:null,parse:null,comment:!1,format:{indent:{style:" ",base:0,adjustMultilineComment:!1},newline:`
|
|
1214
|
+
`)}var _t,tt,HQ,Gke,jke,$ke,qke,Vke,zke,Wke,Zke,Xke,eRe,tRe,Vi=M(()=>{"use strict";C();or();_t=class extends Error{},tt=class extends _t{constructor({type:e,cause:r,message:n,suggestions:i=[],hostname:o,port:s,statusCode:a,errorCode:A}){super(n,{cause:r}),this.name="NetworkError",this.type=e,this.suggestions=i,this.hostname=o,this.port=s,this.statusCode=a,this.errorCode=A}type;suggestions;hostname;port;statusCode;errorCode},HQ=process.platform==="win32",Gke=process.platform==="darwin";jke=new Set(["DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN"]),$ke=new Set(["UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","INVALID_CA","CERT_SIGNATURE_FAILURE","CERT_REVOKED","CERT_REJECTED","CERT_UNTRUSTED","CERT_CHAIN_TOO_LONG","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","UNABLE_TO_DECRYPT_CERT_SIGNATURE","HOSTNAME_MISMATCH","ERR_TLS_CERT_ALTNAME_INVALID"]),qke=new Set(["CERT_HAS_EXPIRED","ERROR_IN_CERT_NOT_AFTER_FIELD"]),Vke=new Set(["CERT_NOT_YET_VALID","ERROR_IN_CERT_NOT_BEFORE_FIELD"]),zke=new Set(["CRL_HAS_EXPIRED","CRL_NOT_YET_VALID","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD"]),Wke=new Set(["ERR_TLS_INVALID_PROTOCOL_VERSION","ERR_TLS_INVALID_PROTOCOL_METHOD","ERR_TLS_PROTOCOL_VERSION_CONFLICT","ERR_TLS_INVALID_STATE","ERR_TLS_INVALID_CONTEXT","ERR_TLS_RENEGOTIATION_DISABLED","ERR_TLS_REQUIRED_SERVER_NAME","ERR_TLS_SESSION_ATTACK","ERR_TLS_SNI_FROM_SERVER","ERR_TLS_DH_PARAM_SIZE","ERR_SSL_WRONG_VERSION_NUMBER","EPROTO"]),Zke=new Set(["ERR_TLS_HANDSHAKE_TIMEOUT","ERR_SSL_HANDSHAKE_FAILURE"]),Xke=new Set(["CRYPT_E_NO_REVOCATION_CHECK","CRYPT_E_REVOCATION_OFFLINE","CRYPT_E_NO_REVOCATION_DLL","CRYPT_E_NOT_IN_REVOCATION_DATABASE","UNABLE_TO_GET_CRL","CRL_SIGNATURE_FAILURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE"]),eRe=new Set(["ERR_PROXY_INVALID_CONFIG","ERR_PROXY_TUNNEL","ERR_TUNNEL_CONNECTION_FAILED"]),tRe=new Set(["ENETUNREACH","EHOSTUNREACH","ENETDOWN","ENONET"])});async function e$(t){let e=process.env.BUILDER_DISABLE_AMPLITUDE==="true",r=process.env.NODE_ENV!=="test",n=r&&!e,i=await n$(),o=await r$();if(Ka.init(n?"2532be1b0436a18cb938b21fc7fa9faf":"",{logLevel:Ka.Types.LogLevel.None,flushIntervalMillis:500}),n){let s=new Ka.Identify;await Ka.identify(s,{device_id:i,user_id:o,platform:dk.default.type(),os_name:process.platform,os_version:dk.default.release()}).promise}return Xs.init({dsn:"https://3252dddc08dbb5bf406dc33bf3c13633@o117565.ingest.us.sentry.io/4505630794448896",tracesSampleRate:0,release:L9,environment:process.env.NODE_ENV,enabled:r,registerEsmLoaderHooks:!1,normalizeDepth:5,maxValueLength:1500,integrations:[Xs.nativeNodeFetchIntegration(),Xs.httpIntegration(),Xs.extraErrorDataIntegration()],beforeSend:(s,a)=>{let A=a.originalException??a.syntheticException;return!(A instanceof _t)&&(t||s.level!=="warning")&&console.error((0,Xj.red)(`ERROR ID: ${s.event_id}`),A),s},tracePropagationTargets:[]}),Xs.setUser({username:process.env.USER||process.env.USERNAME||"unknown"}),Xs}async function ct(t,e){if(process.env.BUILDER_DISABLE_AMPLITUDE==="true")return Promise.resolve();let n={...e,app:"dev-tools-cli",package:"cli"},i=await r$(),o=await n$();return await Ka.track(t,n,{user_id:i,device_id:o}).promise}async function t$(t){JQ=t;let e=await Mp();await ak({...e,userId:t})}async function r$(){if(JQ)return JQ;let t=await Mp(),e;return sk(t,"userId")&&(e=t.userId),JQ=e,e}async function n$(){if(pk)return pk;let t=await Mp(),e=lk();return sk(t,"deviceId")?e=t.deviceId:await ak({...t,deviceId:e}),pk=e,e}var Ka,Xs,dk,Xj,JQ,pk,mo=M(()=>{"use strict";C();Ka=ie(require("@amplitude/analytics-node"),1),Xs=ie(require("@sentry/node"),1);P9();bh();Zj();dk=ie(require("node:os"),1),Xj=ie(Pr(),1);Vi()});var o$=v(i$=>{C();(function t(e){"use strict";var r,n,i,o,s,a;function A(B){var Q={},w,D;for(w in B)B.hasOwnProperty(w)&&(D=B[w],typeof D=="object"&&D!==null?Q[w]=A(D):Q[w]=D);return Q}function c(B,Q){var w,D,b,S;for(D=B.length,b=0;D;)w=D>>>1,S=b+w,Q(B[S])?D=w:(b=S+1,D-=w+1);return b}r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},i={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},o={},s={},a={},n={Break:o,Skip:s,Remove:a};function u(B,Q){this.parent=B,this.key=Q}u.prototype.replace=function(Q){this.parent[this.key]=Q},u.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)};function l(B,Q,w,D){this.node=B,this.path=Q,this.wrap=w,this.ref=D}function g(){}g.prototype.path=function(){var Q,w,D,b,S,k;function F(K,z){if(Array.isArray(z))for(D=0,b=z.length;D<b;++D)K.push(z[D]);else K.push(z)}if(!this.__current.path)return null;for(S=[],Q=2,w=this.__leavelist.length;Q<w;++Q)k=this.__leavelist[Q],F(S,k.path);return F(S,this.__current.path),S},g.prototype.type=function(){var B=this.current();return B.type||this.__current.wrap},g.prototype.parents=function(){var Q,w,D;for(D=[],Q=1,w=this.__leavelist.length;Q<w;++Q)D.push(this.__leavelist[Q].node);return D},g.prototype.current=function(){return this.__current.node},g.prototype.__execute=function(Q,w){var D,b;return b=void 0,D=this.__current,this.__current=w,this.__state=null,Q&&(b=Q.call(this,w.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=D,b},g.prototype.notify=function(Q){this.__state=Q},g.prototype.skip=function(){this.notify(s)},g.prototype.break=function(){this.notify(o)},g.prototype.remove=function(){this.notify(a)},g.prototype.__initialize=function(B,Q){this.visitor=Q,this.root=B,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,Q.fallback==="iteration"?this.__fallback=Object.keys:typeof Q.fallback=="function"&&(this.__fallback=Q.fallback),this.__keys=i,Q.keys&&(this.__keys=Object.assign(Object.create(this.__keys),Q.keys))};function d(B){return B==null?!1:typeof B=="object"&&typeof B.type=="string"}function p(B,Q){return(B===r.ObjectExpression||B===r.ObjectPattern)&&Q==="properties"}function f(B,Q){for(var w=B.length-1;w>=0;--w)if(B[w].node===Q)return!0;return!1}g.prototype.traverse=function(Q,w){var D,b,S,k,F,K,z,q,T,U,H,Z;for(this.__initialize(Q,w),Z={},D=this.__worklist,b=this.__leavelist,D.push(new l(Q,null,null,null)),b.push(new l(null,null,null,null));D.length;){if(S=D.pop(),S===Z){if(S=b.pop(),K=this.__execute(w.leave,S),this.__state===o||K===o)return;continue}if(S.node){if(K=this.__execute(w.enter,S),this.__state===o||K===o)return;if(D.push(Z),b.push(S),this.__state===s||K===s)continue;if(k=S.node,F=k.type||S.wrap,U=this.__keys[F],!U)if(this.__fallback)U=this.__fallback(k);else throw new Error("Unknown node type "+F+".");for(q=U.length;(q-=1)>=0;)if(z=U[q],H=k[z],!!H){if(Array.isArray(H)){for(T=H.length;(T-=1)>=0;)if(H[T]&&!f(b,H[T])){if(p(F,U[q]))S=new l(H[T],[z,T],"Property",null);else if(d(H[T]))S=new l(H[T],[z,T],null,null);else continue;D.push(S)}}else if(d(H)){if(f(b,H))continue;D.push(new l(H,z,null,null))}}}}},g.prototype.replace=function(Q,w){var D,b,S,k,F,K,z,q,T,U,H,Z,V;function O(P){var re,Ae,Ie,Be;if(P.ref.remove()){for(Ae=P.ref.key,Be=P.ref.parent,re=D.length;re--;)if(Ie=D[re],Ie.ref&&Ie.ref.parent===Be){if(Ie.ref.key<Ae)break;--Ie.ref.key}}}for(this.__initialize(Q,w),H={},D=this.__worklist,b=this.__leavelist,Z={root:Q},K=new l(Q,null,null,new u(Z,"root")),D.push(K),b.push(K);D.length;){if(K=D.pop(),K===H){if(K=b.pop(),F=this.__execute(w.leave,K),F!==void 0&&F!==o&&F!==s&&F!==a&&K.ref.replace(F),(this.__state===a||F===a)&&O(K),this.__state===o||F===o)return Z.root;continue}if(F=this.__execute(w.enter,K),F!==void 0&&F!==o&&F!==s&&F!==a&&(K.ref.replace(F),K.node=F),(this.__state===a||F===a)&&(O(K),K.node=null),this.__state===o||F===o)return Z.root;if(S=K.node,!!S&&(D.push(H),b.push(K),!(this.__state===s||F===s))){if(k=S.type||K.wrap,T=this.__keys[k],!T)if(this.__fallback)T=this.__fallback(S);else throw new Error("Unknown node type "+k+".");for(z=T.length;(z-=1)>=0;)if(V=T[z],U=S[V],!!U)if(Array.isArray(U)){for(q=U.length;(q-=1)>=0;)if(U[q]){if(p(k,T[z]))K=new l(U[q],[V,q],"Property",new u(U,q));else if(d(U[q]))K=new l(U[q],[V,q],null,new u(U,q));else continue;D.push(K)}}else d(U)&&D.push(new l(U,V,null,new u(S,V)))}}return Z.root};function h(B,Q){var w=new g;return w.traverse(B,Q)}function m(B,Q){var w=new g;return w.replace(B,Q)}function I(B,Q){var w;return w=c(Q,function(b){return b.range[0]>B.range[0]}),B.extendedRange=[B.range[0],B.range[1]],w!==Q.length&&(B.extendedRange[1]=Q[w].range[0]),w-=1,w>=0&&(B.extendedRange[0]=Q[w].range[1]),B}function E(B,Q,w){var D=[],b,S,k,F;if(!B.range)throw new Error("attachComments needs range information");if(!w.length){if(Q.length){for(k=0,S=Q.length;k<S;k+=1)b=A(Q[k]),b.extendedRange=[0,B.range[0]],D.push(b);B.leadingComments=D}return B}for(k=0,S=Q.length;k<S;k+=1)D.push(I(A(Q[k]),w));return F=0,h(B,{enter:function(K){for(var z;F<D.length&&(z=D[F],!(z.extendedRange[1]>K.range[0]));)z.extendedRange[1]===K.range[0]?(K.leadingComments||(K.leadingComments=[]),K.leadingComments.push(z),D.splice(F,1)):F+=1;if(F===D.length)return n.Break;if(D[F].extendedRange[0]>K.range[1])return n.Skip}}),F=0,h(B,{leave:function(K){for(var z;F<D.length&&(z=D[F],!(K.range[1]<z.extendedRange[0]));)K.range[1]===z.extendedRange[0]?(K.trailingComments||(K.trailingComments=[]),K.trailingComments.push(z),D.splice(F,1)):F+=1;if(F===D.length)return n.Break;if(D[F].extendedRange[0]>K.range[1])return n.Skip}}),B}return e.Syntax=r,e.traverse=h,e.replace=m,e.attachComments=E,e.VisitorKeys=i,e.VisitorOption=n,e.Controller=g,e.cloneEnvironment=function(){return t({})},e})(i$)});var a$=v(($Bt,s$)=>{C();(function(){"use strict";function t(s){if(s==null)return!1;switch(s.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return!0}return!1}function e(s){if(s==null)return!1;switch(s.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1}function r(s){if(s==null)return!1;switch(s.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return!0}return!1}function n(s){return r(s)||s!=null&&s.type==="FunctionDeclaration"}function i(s){switch(s.type){case"IfStatement":return s.alternate!=null?s.alternate:s.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return s.body}return null}function o(s){var a;if(s.type!=="IfStatement"||s.alternate==null)return!1;a=s.consequent;do{if(a.type==="IfStatement"&&a.alternate==null)return!0;a=i(a)}while(a);return!1}s$.exports={isExpression:t,isStatement:r,isIterationStatement:e,isSourceElement:n,isProblematicIfStatement:o,trailingStatement:i}})()});var fk=v((VBt,A$)=>{C();(function(){"use strict";var t,e,r,n,i,o;e={NonAsciiIdentifierStart:/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]/,NonAsciiIdentifierPart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/},t={NonAsciiIdentifierStart:/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};function s(h){return 48<=h&&h<=57}function a(h){return 48<=h&&h<=57||97<=h&&h<=102||65<=h&&h<=70}function A(h){return h>=48&&h<=55}r=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function c(h){return h===32||h===9||h===11||h===12||h===160||h>=5760&&r.indexOf(h)>=0}function u(h){return h===10||h===13||h===8232||h===8233}function l(h){if(h<=65535)return String.fromCharCode(h);var m=String.fromCharCode(Math.floor((h-65536)/1024)+55296),I=String.fromCharCode((h-65536)%1024+56320);return m+I}for(n=new Array(128),o=0;o<128;++o)n[o]=o>=97&&o<=122||o>=65&&o<=90||o===36||o===95;for(i=new Array(128),o=0;o<128;++o)i[o]=o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===36||o===95;function g(h){return h<128?n[h]:e.NonAsciiIdentifierStart.test(l(h))}function d(h){return h<128?i[h]:e.NonAsciiIdentifierPart.test(l(h))}function p(h){return h<128?n[h]:t.NonAsciiIdentifierStart.test(l(h))}function f(h){return h<128?i[h]:t.NonAsciiIdentifierPart.test(l(h))}A$.exports={isDecimalDigit:s,isHexDigit:a,isOctalDigit:A,isWhiteSpace:c,isLineTerminator:u,isIdentifierStartES5:g,isIdentifierPartES5:d,isIdentifierStartES6:p,isIdentifierPartES6:f}})()});var u$=v((WBt,c$)=>{C();(function(){"use strict";var t=fk();function e(g){switch(g){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}function r(g,d){return!d&&g==="yield"?!1:n(g,d)}function n(g,d){if(d&&e(g))return!0;switch(g.length){case 2:return g==="if"||g==="in"||g==="do";case 3:return g==="var"||g==="for"||g==="new"||g==="try";case 4:return g==="this"||g==="else"||g==="case"||g==="void"||g==="with"||g==="enum";case 5:return g==="while"||g==="break"||g==="catch"||g==="throw"||g==="const"||g==="yield"||g==="class"||g==="super";case 6:return g==="return"||g==="typeof"||g==="delete"||g==="switch"||g==="export"||g==="import";case 7:return g==="default"||g==="finally"||g==="extends";case 8:return g==="function"||g==="continue"||g==="debugger";case 10:return g==="instanceof";default:return!1}}function i(g,d){return g==="null"||g==="true"||g==="false"||r(g,d)}function o(g,d){return g==="null"||g==="true"||g==="false"||n(g,d)}function s(g){return g==="eval"||g==="arguments"}function a(g){var d,p,f;if(g.length===0||(f=g.charCodeAt(0),!t.isIdentifierStartES5(f)))return!1;for(d=1,p=g.length;d<p;++d)if(f=g.charCodeAt(d),!t.isIdentifierPartES5(f))return!1;return!0}function A(g,d){return(g-55296)*1024+(d-56320)+65536}function c(g){var d,p,f,h,m;if(g.length===0)return!1;for(m=t.isIdentifierStartES6,d=0,p=g.length;d<p;++d){if(f=g.charCodeAt(d),55296<=f&&f<=56319){if(++d,d>=p||(h=g.charCodeAt(d),!(56320<=h&&h<=57343)))return!1;f=A(f,h)}if(!m(f))return!1;m=t.isIdentifierPartES6}return!0}function u(g,d){return a(g)&&!i(g,d)}function l(g,d){return c(g)&&!o(g,d)}c$.exports={isKeywordES5:r,isKeywordES6:n,isReservedWordES5:i,isReservedWordES6:o,isRestrictedWord:s,isIdentifierNameES5:a,isIdentifierNameES6:c,isIdentifierES5:u,isIdentifierES6:l}})()});var l$=v(YQ=>{C();(function(){"use strict";YQ.ast=a$(),YQ.code=fk(),YQ.keyword=u$()})()});var p$=v(Ck=>{C();var g$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Ck.encode=function(t){if(0<=t&&t<g$.length)return g$[t];throw new TypeError("Must be between 0 and 63: "+t)};Ck.decode=function(t){var e=65,r=90,n=97,i=122,o=48,s=57,a=43,A=47,c=26,u=52;return e<=t&&t<=r?t-e:n<=t&&t<=i?t-n+c:o<=t&&t<=s?t-o+u:t==a?62:t==A?63:-1}});var Ik=v(mk=>{C();var d$=p$(),hk=5,f$=1<<hk,C$=f$-1,h$=f$;function iRe(t){return t<0?(-t<<1)+1:(t<<1)+0}function oRe(t){var e=(t&1)===1,r=t>>1;return e?-r:r}mk.encode=function(e){var r="",n,i=iRe(e);do n=i&C$,i>>>=hk,i>0&&(n|=h$),r+=d$.encode(n);while(i>0);return r};mk.decode=function(e,r,n){var i=e.length,o=0,s=0,a,A;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(A=d$.decode(e.charCodeAt(r++)),A===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));a=!!(A&h$),A&=C$,o=o+(A<<s),s+=hk}while(a);n.value=oRe(o),n.rest=r}});var Lp=v(wi=>{C();function sRe(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}wi.getArg=sRe;var m$=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,aRe=/^data:.+\,.+$/;function vh(t){var e=t.match(m$);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}wi.urlParse=vh;function Tp(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}wi.urlGenerate=Tp;function Ek(t){var e=t,r=vh(t);if(r){if(!r.path)return t;e=r.path}for(var n=wi.isAbsolute(e),i=e.split(/\/+/),o,s=0,a=i.length-1;a>=0;a--)o=i[a],o==="."?i.splice(a,1):o===".."?s++:s>0&&(o===""?(i.splice(a+1,s),s=0):(i.splice(a,2),s--));return e=i.join("/"),e===""&&(e=n?"/":"."),r?(r.path=e,Tp(r)):e}wi.normalize=Ek;function I$(t,e){t===""&&(t="."),e===""&&(e=".");var r=vh(e),n=vh(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Tp(r);if(r||e.match(aRe))return e;if(n&&!n.host&&!n.path)return n.host=e,Tp(n);var i=e.charAt(0)==="/"?e:Ek(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,Tp(n)):i}wi.join=I$;wi.isAbsolute=function(t){return t.charAt(0)==="/"||m$.test(t)};function ARe(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}wi.relative=ARe;var E$=(function(){var t=Object.create(null);return!("__proto__"in t)})();function B$(t){return t}function cRe(t){return Q$(t)?"$"+t:t}wi.toSetString=E$?B$:cRe;function uRe(t){return Q$(t)?t.slice(1):t}wi.fromSetString=E$?B$:uRe;function Q$(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function lRe(t,e,r){var n=Pp(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:Pp(t.name,e.name)}wi.compareByOriginalPositions=lRe;function gRe(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=Pp(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:Pp(t.name,e.name)}wi.compareByGeneratedPositionsDeflated=gRe;function Pp(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function pRe(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=Pp(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:Pp(t.name,e.name)}wi.compareByGeneratedPositionsInflated=pRe;function dRe(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}wi.parseSourceMapInput=dRe;function fRe(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=vh(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}e=I$(Tp(n),e)}return Ek(e)}wi.computeSourceURL=fRe});var Dk=v(D$=>{C();var Bk=Lp(),Qk=Object.prototype.hasOwnProperty,Bl=typeof Map<"u";function UA(){this._array=[],this._set=Bl?new Map:Object.create(null)}UA.fromArray=function(e,r){for(var n=new UA,i=0,o=e.length;i<o;i++)n.add(e[i],r);return n};UA.prototype.size=function(){return Bl?this._set.size:Object.getOwnPropertyNames(this._set).length};UA.prototype.add=function(e,r){var n=Bl?e:Bk.toSetString(e),i=Bl?this.has(e):Qk.call(this._set,n),o=this._array.length;(!i||r)&&this._array.push(e),i||(Bl?this._set.set(e,o):this._set[n]=o)};UA.prototype.has=function(e){if(Bl)return this._set.has(e);var r=Bk.toSetString(e);return Qk.call(this._set,r)};UA.prototype.indexOf=function(e){if(Bl){var r=this._set.get(e);if(r>=0)return r}else{var n=Bk.toSetString(e);if(Qk.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};UA.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};UA.prototype.toArray=function(){return this._array.slice()};D$.ArraySet=UA});var b$=v(w$=>{C();var y$=Lp();function CRe(t,e){var r=t.generatedLine,n=e.generatedLine,i=t.generatedColumn,o=e.generatedColumn;return n>r||n==r&&o>=i||y$.compareByGeneratedPositionsInflated(t,e)<=0}function jQ(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}jQ.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};jQ.prototype.add=function(e){CRe(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};jQ.prototype.toArray=function(){return this._sorted||(this._array.sort(y$.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};w$.MappingList=jQ});var yk=v(v$=>{C();var xh=Ik(),Bn=Lp(),$Q=Dk().ArraySet,hRe=b$().MappingList;function fs(t){t||(t={}),this._file=Bn.getArg(t,"file",null),this._sourceRoot=Bn.getArg(t,"sourceRoot",null),this._skipValidation=Bn.getArg(t,"skipValidation",!1),this._sources=new $Q,this._names=new $Q,this._mappings=new hRe,this._sourcesContents=null}fs.prototype._version=3;fs.fromSourceMap=function(e){var r=e.sourceRoot,n=new fs({file:e.file,sourceRoot:r});return e.eachMapping(function(i){var o={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(o.source=i.source,r!=null&&(o.source=Bn.relative(r,o.source)),o.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(o.name=i.name)),n.addMapping(o)}),e.sources.forEach(function(i){var o=i;r!==null&&(o=Bn.relative(r,i)),n._sources.has(o)||n._sources.add(o);var s=e.sourceContentFor(i);s!=null&&n.setSourceContent(i,s)}),n};fs.prototype.addMapping=function(e){var r=Bn.getArg(e,"generated"),n=Bn.getArg(e,"original",null),i=Bn.getArg(e,"source",null),o=Bn.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,i,o),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:o})};fs.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=Bn.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Bn.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Bn.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};fs.prototype.applySourceMap=function(e,r,n){var i=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var o=this._sourceRoot;o!=null&&(i=Bn.relative(o,i));var s=new $Q,a=new $Q;this._mappings.unsortedForEach(function(A){if(A.source===i&&A.originalLine!=null){var c=e.originalPositionFor({line:A.originalLine,column:A.originalColumn});c.source!=null&&(A.source=c.source,n!=null&&(A.source=Bn.join(n,A.source)),o!=null&&(A.source=Bn.relative(o,A.source)),A.originalLine=c.line,A.originalColumn=c.column,c.name!=null&&(A.name=c.name))}var u=A.source;u!=null&&!s.has(u)&&s.add(u);var l=A.name;l!=null&&!a.has(l)&&a.add(l)},this),this._sources=s,this._names=a,e.sources.forEach(function(A){var c=e.sourceContentFor(A);c!=null&&(n!=null&&(A=Bn.join(n,A)),o!=null&&(A=Bn.relative(o,A)),this.setSourceContent(A,c))},this)};fs.prototype._validateMapping=function(e,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!i)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:i}))}};fs.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,i=0,o=0,s=0,a="",A,c,u,l,g=this._mappings.toArray(),d=0,p=g.length;d<p;d++){if(c=g[d],A="",c.generatedLine!==r)for(e=0;c.generatedLine!==r;)A+=";",r++;else if(d>0){if(!Bn.compareByGeneratedPositionsInflated(c,g[d-1]))continue;A+=","}A+=xh.encode(c.generatedColumn-e),e=c.generatedColumn,c.source!=null&&(l=this._sources.indexOf(c.source),A+=xh.encode(l-s),s=l,A+=xh.encode(c.originalLine-1-i),i=c.originalLine-1,A+=xh.encode(c.originalColumn-n),n=c.originalColumn,c.name!=null&&(u=this._names.indexOf(c.name),A+=xh.encode(u-o),o=u)),a+=A}return a};fs.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Bn.relative(r,n));var i=Bn.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};fs.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};fs.prototype.toString=function(){return JSON.stringify(this.toJSON())};v$.SourceMapGenerator=fs});var x$=v(Ql=>{C();Ql.GREATEST_LOWER_BOUND=1;Ql.LEAST_UPPER_BOUND=2;function wk(t,e,r,n,i,o){var s=Math.floor((e-t)/2)+t,a=i(r,n[s],!0);return a===0?s:a>0?e-s>1?wk(s,e,r,n,i,o):o==Ql.LEAST_UPPER_BOUND?e<n.length?e:-1:s:s-t>1?wk(t,s,r,n,i,o):o==Ql.LEAST_UPPER_BOUND?s:t<0?-1:t}Ql.search=function(e,r,n,i){if(r.length===0)return-1;var o=wk(-1,r.length,e,r,n,i||Ql.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&n(r[o],r[o-1],!0)===0;)--o;return o}});var F$=v(S$=>{C();function bk(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function mRe(t,e){return Math.round(t+Math.random()*(e-t))}function vk(t,e,r,n){if(r<n){var i=mRe(r,n),o=r-1;bk(t,i,n);for(var s=t[n],a=r;a<n;a++)e(t[a],s)<=0&&(o+=1,bk(t,o,a));bk(t,o+1,a);var A=o+1;vk(t,e,r,A-1),vk(t,e,A+1,n)}}S$.quickSort=function(t,e){vk(t,e,0,t.length-1)}});var R$=v(qQ=>{C();var Ge=Lp(),xk=x$(),_p=Dk().ArraySet,IRe=Ik(),Sh=F$().quickSort;function kr(t,e){var r=t;return typeof t=="string"&&(r=Ge.parseSourceMapInput(t)),r.sections!=null?new ea(r,e):new si(r,e)}kr.fromSourceMap=function(t,e){return si.fromSourceMap(t,e)};kr.prototype._version=3;kr.prototype.__generatedMappings=null;Object.defineProperty(kr.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});kr.prototype.__originalMappings=null;Object.defineProperty(kr.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});kr.prototype._charIsMappingSeparator=function(e,r){var n=e.charAt(r);return n===";"||n===","};kr.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")};kr.GENERATED_ORDER=1;kr.ORIGINAL_ORDER=2;kr.GREATEST_LOWER_BOUND=1;kr.LEAST_UPPER_BOUND=2;kr.prototype.eachMapping=function(e,r,n){var i=r||null,o=n||kr.GENERATED_ORDER,s;switch(o){case kr.GENERATED_ORDER:s=this._generatedMappings;break;case kr.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;s.map(function(A){var c=A.source===null?null:this._sources.at(A.source);return c=Ge.computeSourceURL(a,c,this._sourceMapURL),{source:c,generatedLine:A.generatedLine,generatedColumn:A.generatedColumn,originalLine:A.originalLine,originalColumn:A.originalColumn,name:A.name===null?null:this._names.at(A.name)}},this).forEach(e,i)};kr.prototype.allGeneratedPositionsFor=function(e){var r=Ge.getArg(e,"line"),n={source:Ge.getArg(e,"source"),originalLine:r,originalColumn:Ge.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Ge.compareByOriginalPositions,xk.LEAST_UPPER_BOUND);if(o>=0){var s=this._originalMappings[o];if(e.column===void 0)for(var a=s.originalLine;s&&s.originalLine===a;)i.push({line:Ge.getArg(s,"generatedLine",null),column:Ge.getArg(s,"generatedColumn",null),lastColumn:Ge.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o];else for(var A=s.originalColumn;s&&s.originalLine===r&&s.originalColumn==A;)i.push({line:Ge.getArg(s,"generatedLine",null),column:Ge.getArg(s,"generatedColumn",null),lastColumn:Ge.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++o]}return i};qQ.SourceMapConsumer=kr;function si(t,e){var r=t;typeof t=="string"&&(r=Ge.parseSourceMapInput(t));var n=Ge.getArg(r,"version"),i=Ge.getArg(r,"sources"),o=Ge.getArg(r,"names",[]),s=Ge.getArg(r,"sourceRoot",null),a=Ge.getArg(r,"sourcesContent",null),A=Ge.getArg(r,"mappings"),c=Ge.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=Ge.normalize(s)),i=i.map(String).map(Ge.normalize).map(function(u){return s&&Ge.isAbsolute(s)&&Ge.isAbsolute(u)?Ge.relative(s,u):u}),this._names=_p.fromArray(o.map(String),!0),this._sources=_p.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(u){return Ge.computeSourceURL(s,u,e)}),this.sourceRoot=s,this.sourcesContent=a,this._mappings=A,this._sourceMapURL=e,this.file=c}si.prototype=Object.create(kr.prototype);si.prototype.consumer=kr;si.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Ge.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return-1};si.fromSourceMap=function(e,r){var n=Object.create(si.prototype),i=n._names=_p.fromArray(e._names.toArray(),!0),o=n._sources=_p.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(d){return Ge.computeSourceURL(n.sourceRoot,d,r)});for(var s=e._mappings.toArray().slice(),a=n.__generatedMappings=[],A=n.__originalMappings=[],c=0,u=s.length;c<u;c++){var l=s[c],g=new k$;g.generatedLine=l.generatedLine,g.generatedColumn=l.generatedColumn,l.source&&(g.source=o.indexOf(l.source),g.originalLine=l.originalLine,g.originalColumn=l.originalColumn,l.name&&(g.name=i.indexOf(l.name)),A.push(g)),a.push(g)}return Sh(n.__originalMappings,Ge.compareByOriginalPositions),n};si.prototype._version=3;Object.defineProperty(si.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function k$(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}si.prototype._parseMappings=function(e,r){for(var n=1,i=0,o=0,s=0,a=0,A=0,c=e.length,u=0,l={},g={},d=[],p=[],f,h,m,I,E;u<c;)if(e.charAt(u)===";")n++,u++,i=0;else if(e.charAt(u)===",")u++;else{for(f=new k$,f.generatedLine=n,I=u;I<c&&!this._charIsMappingSeparator(e,I);I++);if(h=e.slice(u,I),m=l[h],m)u+=h.length;else{for(m=[];u<I;)IRe.decode(e,u,g),E=g.value,u=g.rest,m.push(E);if(m.length===2)throw new Error("Found a source, but no line and column");if(m.length===3)throw new Error("Found a source and line, but no column");l[h]=m}f.generatedColumn=i+m[0],i=f.generatedColumn,m.length>1&&(f.source=a+m[1],a+=m[1],f.originalLine=o+m[2],o=f.originalLine,f.originalLine+=1,f.originalColumn=s+m[3],s=f.originalColumn,m.length>4&&(f.name=A+m[4],A+=m[4])),p.push(f),typeof f.originalLine=="number"&&d.push(f)}Sh(p,Ge.compareByGeneratedPositionsDeflated),this.__generatedMappings=p,Sh(d,Ge.compareByOriginalPositions),this.__originalMappings=d};si.prototype._findMapping=function(e,r,n,i,o,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return xk.search(e,r,o,s)};si.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};si.prototype.originalPositionFor=function(e){var r={generatedLine:Ge.getArg(e,"line"),generatedColumn:Ge.getArg(e,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",Ge.compareByGeneratedPositionsDeflated,Ge.getArg(e,"bias",kr.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var o=Ge.getArg(i,"source",null);o!==null&&(o=this._sources.at(o),o=Ge.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var s=Ge.getArg(i,"name",null);return s!==null&&(s=this._names.at(s)),{source:o,line:Ge.getArg(i,"originalLine",null),column:Ge.getArg(i,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};si.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};si.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=Ge.relative(this.sourceRoot,i));var o;if(this.sourceRoot!=null&&(o=Ge.urlParse(this.sourceRoot))){var s=i.replace(/^file:\/\//,"");if(o.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!o.path||o.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')};si.prototype.generatedPositionFor=function(e){var r=Ge.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:Ge.getArg(e,"line"),originalColumn:Ge.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Ge.compareByOriginalPositions,Ge.getArg(e,"bias",kr.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===n.source)return{line:Ge.getArg(o,"generatedLine",null),column:Ge.getArg(o,"generatedColumn",null),lastColumn:Ge.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};qQ.BasicSourceMapConsumer=si;function ea(t,e){var r=t;typeof t=="string"&&(r=Ge.parseSourceMapInput(t));var n=Ge.getArg(r,"version"),i=Ge.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new _p,this._names=new _p;var o={line:-1,column:0};this._sections=i.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var a=Ge.getArg(s,"offset"),A=Ge.getArg(a,"line"),c=Ge.getArg(a,"column");if(A<o.line||A===o.line&&c<o.column)throw new Error("Section offsets must be ordered and non-overlapping.");return o=a,{generatedOffset:{generatedLine:A+1,generatedColumn:c+1},consumer:new kr(Ge.getArg(s,"map"),e)}})}ea.prototype=Object.create(kr.prototype);ea.prototype.constructor=kr;ea.prototype._version=3;Object.defineProperty(ea.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)t.push(this._sections[e].consumer.sources[r]);return t}});ea.prototype.originalPositionFor=function(e){var r={generatedLine:Ge.getArg(e,"line"),generatedColumn:Ge.getArg(e,"column")},n=xk.search(r,this._sections,function(o,s){var a=o.generatedLine-s.generatedOffset.generatedLine;return a||o.generatedColumn-s.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};ea.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};ea.prototype.sourceContentFor=function(e,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],o=i.consumer.sourceContentFor(e,!0);if(o)return o}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')};ea.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(Ge.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var o={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}};ea.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],o=i.consumer._generatedMappings,s=0;s<o.length;s++){var a=o[s],A=i.consumer._sources.at(a.source);A=Ge.computeSourceURL(i.consumer.sourceRoot,A,this._sourceMapURL),this._sources.add(A),A=this._sources.indexOf(A);var c=null;a.name&&(c=i.consumer._names.at(a.name),this._names.add(c),c=this._names.indexOf(c));var u={source:A,generatedLine:a.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(i.generatedOffset.generatedLine===a.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:c};this.__generatedMappings.push(u),typeof u.originalLine=="number"&&this.__originalMappings.push(u)}Sh(this.__generatedMappings,Ge.compareByGeneratedPositionsDeflated),Sh(this.__originalMappings,Ge.compareByOriginalPositions)};qQ.IndexedSourceMapConsumer=ea});var M$=v(N$=>{C();var ERe=yk().SourceMapGenerator,VQ=Lp(),BRe=/(\r?\n)/,QRe=10,Up="$$$isSourceNode$$$";function Yo(t,e,r,n,i){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=i??null,this[Up]=!0,n!=null&&this.add(n)}Yo.fromStringWithSourceMap=function(e,r,n){var i=new Yo,o=e.split(BRe),s=0,a=function(){var g=p(),d=p()||"";return g+d;function p(){return s<o.length?o[s++]:void 0}},A=1,c=0,u=null;return r.eachMapping(function(g){if(u!==null)if(A<g.generatedLine)l(u,a()),A++,c=0;else{var d=o[s]||"",p=d.substr(0,g.generatedColumn-c);o[s]=d.substr(g.generatedColumn-c),c=g.generatedColumn,l(u,p),u=g;return}for(;A<g.generatedLine;)i.add(a()),A++;if(c<g.generatedColumn){var d=o[s]||"";i.add(d.substr(0,g.generatedColumn)),o[s]=d.substr(g.generatedColumn),c=g.generatedColumn}u=g},this),s<o.length&&(u&&l(u,a()),i.add(o.splice(s).join(""))),r.sources.forEach(function(g){var d=r.sourceContentFor(g);d!=null&&(n!=null&&(g=VQ.join(n,g)),i.setSourceContent(g,d))}),i;function l(g,d){if(g===null||g.source===void 0)i.add(d);else{var p=n?VQ.join(n,g.source):g.source;i.add(new Yo(g.originalLine,g.originalColumn,p,d,g.name))}}};Yo.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[Up]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Yo.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[Up]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};Yo.prototype.walk=function(e){for(var r,n=0,i=this.children.length;n<i;n++)r=this.children[n],r[Up]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})};Yo.prototype.join=function(e){var r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(e);r.push(this.children[n]),this.children=r}return this};Yo.prototype.replaceRight=function(e,r){var n=this.children[this.children.length-1];return n[Up]?n.replaceRight(e,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,r):this.children.push("".replace(e,r)),this};Yo.prototype.setSourceContent=function(e,r){this.sourceContents[VQ.toSetString(e)]=r};Yo.prototype.walkSourceContents=function(e){for(var r=0,n=this.children.length;r<n;r++)this.children[r][Up]&&this.children[r].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)e(VQ.fromSetString(i[r]),this.sourceContents[i[r]])};Yo.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e};Yo.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},n=new ERe(e),i=!1,o=null,s=null,a=null,A=null;return this.walk(function(c,u){r.code+=c,u.source!==null&&u.line!==null&&u.column!==null?((o!==u.source||s!==u.line||a!==u.column||A!==u.name)&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:r.line,column:r.column},name:u.name}),o=u.source,s=u.line,a=u.column,A=u.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),o=null,i=!1);for(var l=0,g=c.length;l<g;l++)c.charCodeAt(l)===QRe?(r.line++,r.column=0,l+1===g?(o=null,i=!1):i&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:r.line,column:r.column},name:u.name})):r.column++}),this.walkSourceContents(function(c,u){n.setSourceContent(c,u)}),{code:r.code,map:n}};N$.SourceNode=Yo});var T$=v(zQ=>{C();zQ.SourceMapGenerator=yk().SourceMapGenerator;zQ.SourceMapConsumer=R$().SourceMapConsumer;zQ.SourceNode=M$().SourceNode});var P$=v((DQt,DRe)=>{DRe.exports={name:"escodegen",description:"ECMAScript code generator",homepage:"http://github.com/estools/escodegen",main:"escodegen.js",bin:{esgenerate:"./bin/esgenerate.js",escodegen:"./bin/escodegen.js"},files:["LICENSE.BSD","README.md","bin","escodegen.js","package.json"],version:"2.1.0",engines:{node:">=6.0"},maintainers:[{name:"Yusuke Suzuki",email:"utatane.tea@gmail.com",web:"http://github.com/Constellation"}],repository:{type:"git",url:"http://github.com/estools/escodegen.git"},dependencies:{estraverse:"^5.2.0",esutils:"^2.0.2",esprima:"^4.0.1"},optionalDependencies:{"source-map":"~0.6.1"},devDependencies:{acorn:"^8.0.4",bluebird:"^3.4.7","bower-registry-client":"^1.0.0",chai:"^4.2.0","chai-exclude":"^2.0.2","commonjs-everywhere":"^0.9.7",gulp:"^4.0.2","gulp-eslint":"^6.0.0","gulp-mocha":"^7.0.2",minimist:"^1.2.5",optionator:"^0.9.1",semver:"^7.3.4"},license:"BSD-2-Clause",scripts:{test:"gulp travis","unit-test":"gulp test",lint:"gulp lint",release:"node tools/release.js","build-min":"./node_modules/.bin/cjsify -ma path: tools/entry-point.js > escodegen.browser.min.js",build:"./node_modules/.bin/cjsify -a path: tools/entry-point.js > escodegen.browser.js"}}});var L$=v(GA=>{C();(function(){"use strict";var t,e,r,n,i,o,s,a,A,c,u,l,g,d,p,f,h,m,I,E,B,Q,w,D,b,S;i=o$(),o=l$(),t=i.Syntax;function k(y){return ye.Expression.hasOwnProperty(y.type)}function F(y){return ye.Statement.hasOwnProperty(y.type)}e={Sequence:0,Yield:1,Assignment:1,Conditional:2,ArrowFunction:2,Coalesce:3,LogicalOR:4,LogicalAND:5,BitwiseOR:6,BitwiseXOR:7,BitwiseAND:8,Equality:9,Relational:10,BitwiseSHIFT:11,Additive:12,Multiplicative:13,Exponentiation:14,Await:15,Unary:15,Postfix:16,OptionalChaining:17,Call:18,New:19,TaggedTemplate:20,Member:21,Primary:22},r={"??":e.Coalesce,"||":e.LogicalOR,"&&":e.LogicalAND,"|":e.BitwiseOR,"^":e.BitwiseXOR,"&":e.BitwiseAND,"==":e.Equality,"!=":e.Equality,"===":e.Equality,"!==":e.Equality,is:e.Equality,isnt:e.Equality,"<":e.Relational,">":e.Relational,"<=":e.Relational,">=":e.Relational,in:e.Relational,instanceof:e.Relational,"<<":e.BitwiseSHIFT,">>":e.BitwiseSHIFT,">>>":e.BitwiseSHIFT,"+":e.Additive,"-":e.Additive,"*":e.Multiplicative,"%":e.Multiplicative,"/":e.Multiplicative,"**":e.Exponentiation};var K=1,z=2,q=4,T=8,U=16,H=32,Z=64,V=z|q,O=K|z,P=K|z|q,re=K,Ae=q,Ie=K|q,Be=K,X=K|H,Te=0,ht=K|U,Ee=K|T;function Ke(){return{indent:null,base:null,parse:null,comment:!1,format:{indent:{style:" ",base:0,adjustMultilineComment:!1},newline:`
|
|
1215
1215
|
`,space:" ",json:!1,renumber:!1,hexadecimal:!1,quotes:"single",escapeless:!1,compact:!1,parentheses:!0,semicolons:!0,safeConcatenation:!1,preserveBlankLines:!1},moz:{comprehensionExpressionStartsWithAssignment:!1,starlessGenerator:!1},sourceMap:null,sourceMapRoot:null,sourceMapWithCode:!1,directive:!1,raw:!0,verbatim:null,sourceCode:null}}function ge(y,R){var x="";for(R|=0;R>0;R>>>=1,y+=y)R&1&&(x+=y);return x}function Pe(y){return/[\r\n]/g.test(y)}function be(y){var R=y.length;return R&&o.code.isLineTerminator(y.charCodeAt(R-1))}function lt(y,R){var x;for(x in R)R.hasOwnProperty(x)&&(y[x]=R[x]);return y}function at(y,R){var x,N;function _(ce){return typeof ce=="object"&&ce instanceof Object&&!(ce instanceof RegExp)}for(x in R)R.hasOwnProperty(x)&&(N=R[x],_(N)?_(y[x])?at(y[x],N):y[x]=at({},N):y[x]=N);return y}function zt(y){var R,x,N,_,ce;if(y!==y)throw new Error("Numeric literal whose value is NaN");if(y<0||y===0&&1/y<0)throw new Error("Numeric literal whose value is negative");if(y===1/0)return A?"null":c?"1e400":"1e+400";if(R=""+y,!c||R.length<3)return R;for(x=R.indexOf("."),!A&&R.charCodeAt(0)===48&&x===1&&(x=0,R=R.slice(1)),N=R,R=R.replace("e+","e"),_=0,(ce=N.indexOf("e"))>0&&(_=+N.slice(ce+1),N=N.slice(0,ce)),x>=0&&(_-=N.length-x-1,N=+(N.slice(0,x)+N.slice(x+1))+""),ce=0;N.charCodeAt(N.length+ce-1)===48;)--ce;return ce!==0&&(_-=ce,N=N.slice(0,ce)),_!==0&&(N+="e"+_),(N.length<R.length||u&&y>1e12&&Math.floor(y)===y&&(N="0x"+y.toString(16)).length<R.length)&&+N===y&&(R=N),R}function vn(y,R){return(y&-2)===8232?(R?"u":"\\u")+(y===8232?"2028":"2029"):y===10||y===13?(R?"":"\\")+(y===10?"n":"r"):String.fromCharCode(y)}function Xr(y){var R,x,N,_,ce,fe,me,Se;if(x=y.toString(),y.source){if(R=x.match(/\/([^/]*)$/),!R)return x;for(N=R[1],x="",me=!1,Se=!1,_=0,ce=y.source.length;_<ce;++_)fe=y.source.charCodeAt(_),Se?(x+=vn(fe,Se),Se=!1):(me?fe===93&&(me=!1):fe===47?x+="\\":fe===91&&(me=!0),x+=vn(fe,Se),Se=fe===92);return"/"+x+"/"+N}return x}function Ve(y,R){var x;return y===8?"\\b":y===12?"\\f":y===9?"\\t":(x=y.toString(16).toUpperCase(),A||y>255?"\\u"+"0000".slice(x.length)+x:y===0&&!o.code.isDecimalDigit(R)?"\\0":y===11?"\\x0B":"\\x"+"00".slice(x.length)+x)}function uo(y){if(y===92)return"\\\\";if(y===10)return"\\n";if(y===13)return"\\r";if(y===8232)return"\\u2028";if(y===8233)return"\\u2029";throw new Error("Incorrectly classified character")}function Jt(y){var R,x,N,_;for(_=l==="double"?'"':"'",R=0,x=y.length;R<x;++R)if(N=y.charCodeAt(R),N===39){_='"';break}else if(N===34){_="'";break}else N===92&&++R;return _+y+_}function xt(y){var R="",x,N,_,ce=0,fe=0,me,Se;for(x=0,N=y.length;x<N;++x){if(_=y.charCodeAt(x),_===39)++ce;else if(_===34)++fe;else if(_===47&&A)R+="\\";else if(o.code.isLineTerminator(_)||_===92){R+=uo(_);continue}else if(!o.code.isIdentifierPartES5(_)&&(A&&_<32||!A&&!g&&(_<32||_>126))){R+=Ve(_,y.charCodeAt(x+1));continue}R+=String.fromCharCode(_)}if(me=!(l==="double"||l==="auto"&&fe<ce),Se=me?"'":'"',!(me?ce:fe))return Se+R+Se;for(y=R,R=Se,x=0,N=y.length;x<N;++x)_=y.charCodeAt(x),(_===39&&me||_===34&&!me)&&(R+="\\"),R+=String.fromCharCode(_);return R+Se}function ni(y){var R,x,N,_="";for(R=0,x=y.length;R<x;++R)N=y[R],_+=Array.isArray(N)?ni(N):N;return _}function nt(y,R){if(!Q)return Array.isArray(y)?ni(y):y;if(R==null){if(y instanceof n)return y;R={}}return R.loc==null?new n(null,null,Q,y,R.name||null):new n(R.loc.start.line,R.loc.start.column,Q===!0?R.loc.source||null:Q,y,R.name||null)}function Yt(){return p||" "}function Oe(y,R){var x,N,_,ce;return x=nt(y).toString(),x.length===0?[R]:(N=nt(R).toString(),N.length===0?[y]:(_=x.charCodeAt(x.length-1),ce=N.charCodeAt(0),(_===43||_===45)&&_===ce||o.code.isIdentifierPartES5(_)&&o.code.isIdentifierPartES5(ce)||_===47&&ce===105?[y,Yt(),R]:o.code.isWhiteSpace(_)||o.code.isLineTerminator(_)||o.code.isWhiteSpace(ce)||o.code.isLineTerminator(ce)?[y,R]:[y,p,R]))}function De(y){return[s,y]}function he(y){var R;R=s,s+=a,y(s),s=R}function G(y){var R;for(R=y.length-1;R>=0&&!o.code.isLineTerminator(y.charCodeAt(R));--R);return y.length-1-R}function W(y,R){var x,N,_,ce,fe,me,Se,gt;for(x=y.split(/\r\n|[\r\n]/),me=Number.MAX_VALUE,N=1,_=x.length;N<_;++N){for(ce=x[N],fe=0;fe<ce.length&&o.code.isWhiteSpace(ce.charCodeAt(fe));)++fe;me>fe&&(me=fe)}for(typeof R<"u"?(Se=s,x[1][me]==="*"&&(R+=" "),s=R):(me&1&&--me,Se=s),N=1,_=x.length;N<_;++N)gt=nt(De(x[N].slice(me))),x[N]=Q?gt.join(""):gt;return s=Se,x.join(`
|
|
1216
1216
|
`)}function oe(y,R){if(y.type==="Line"){if(be(y.value))return"//"+y.value;var x="//"+y.value;return D||(x+=`
|
|
1217
1217
|
`),x}return E.format.indent.adjustMultilineComment&&/[\n\r]/.test(y.value)?W("/*"+y.value+"*/",R):"/*"+y.value+"*/"}function Ce(y,R){var x,N,_,ce,fe,me,Se,gt,xn,Ju,Gg,m3,I3,Da;if(y.leadingComments&&y.leadingComments.length>0){if(ce=R,D){for(_=y.leadingComments[0],R=[],gt=_.extendedRange,xn=_.range,Gg=w.substring(gt[0],xn[0]),Da=(Gg.match(/\n/g)||[]).length,Da>0?(R.push(ge(`
|
|
@@ -1284,7 +1284,7 @@ Restarting server after Builder Devtools update...
|
|
|
1284
1284
|
<h3>How's Devtools working for you?</h3>
|
|
1285
1285
|
<p>We'd love your feedback!</p>
|
|
1286
1286
|
</div>
|
|
1287
|
-
\`,t.appendChild(e),setTimeout(()=>{e.classList.add("menu-toggle-tooltip-show"),e.addEventListener("click",()=>{e.classList.remove("menu-toggle-tooltip-show")})},1e3)};function ui(t){t.getElementById("go-to-builder").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(Nr(),"builder")}),t.getElementById("components-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();let u=t.querySelector(".nav-cmp-list .section-content");u.scrollTop=0,oe(t,"nav-cmp-list"),si(t)}),t.getElementById("settings-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),oe(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(je(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open("https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more")})}function ci(t){let e=t.getElementById("enable-edit");e.addEventListener("change",r=>{r.stopPropagation(),Ft(e.checked)}),e.checked=it(),Ft(e.checked)}var At=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=\`<style>*,*:before,*:after{box-sizing:border-box}:host{--background-color: rgba(40, 40, 40, 1);--primary-color: rgba(72, 161, 255, 1);--primary-color-subdued: rgb(72, 161, 255, .6);--primary-color-highlight: rgb(126, 188, 255);--primary-contrast-color: white;--edit-color: #1d74e2;--edit-color-highlight: #1c6bd1;--edit-color-alpha: rgb(72, 161, 255, .15);--error-color: #ff2b55;--text-color: white;--text-color-highlight: white;--border-color: #454545;--button-background-color-hover: rgba(255, 255, 255, .1);--menu-width: 320px;--transition-time: .15s;--font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-family:var(--font-family);line-height:1.6}button{cursor:pointer;color:var(--text-color);-webkit-tap-highlight-color:transparent}input,select,button{font-family:var(--font-family)}.menu-toggle{position:absolute;right:0;bottom:0;pointer-events:auto;padding:8px;background:transparent;border:none;appearance:none}.menu-toggle div{position:relative;width:64px;height:64px;pointer-events:none;border-radius:50%;background:#000;border:1px solid white;box-shadow:#00000054 0 0 8px}.menu-toggle:hover div{background-color:var(--background-color);border:1px solid rgb(220,220,220)}.menu-toggle svg{position:absolute;top:15px;left:15px;width:33px;height:32px}div.highlight-bg{position:absolute;top:-1px;left:-1px;background-color:#1a1a1a;pointer-events:none;transition:all .4s ease-out;opacity:0}.menu-toggle-highlight-no-transition div.highlight-bg{transition:none}.menu-toggle-highlight div.highlight-bg{opacity:1}.menu-toggle-tooltip{position:absolute;bottom:0;right:0;width:382px;height:72px;padding:0;text-align:left;appearance:none;background-color:transparent;border:none;pointer-events:none;transform:translate3d(320px,0,0);opacity:0;transition:all .15s ease-in-out;color:#fff}.menu-toggle-tooltip.menu-toggle-tooltip-show{pointer-events:auto;opacity:1;transform:translateZ(0)}.menu-toggle-tooltip-content{position:absolute;inset:0 95px 10px 0;padding:8px 12px;background-color:var(--primary-color);box-shadow:#00000054 0 0 20px;border-radius:2px}.menu-toggle-tooltip-content:before{content:"";position:absolute;bottom:15px;right:-6px;width:30px;height:30px;background-color:var(--primary-color);transform:rotate(45deg)}.menu-toggle-tooltip:hover .menu-toggle-tooltip-content,.menu-toggle-tooltip:hover .menu-toggle-tooltip-content:before{background-color:var(--primary-color-highlight)}.menu-toggle-tooltip-content h3{margin:0;font-size:16px}.menu-toggle-tooltip-content p{margin:0;font-size:12px}section{position:absolute;display:grid;grid-template-rows:64px auto 64px;top:0;left:0;width:100%;height:100%;padding:0;pointer-events:none}.section-content{margin:0;padding:0 0 10px;font-weight:300;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;overflow-y:auto}.section-content .error{color:var(--error-color);font-weight:700}section a{text-decoration:none;color:var(--text-color)}section h3,section p{margin-left:16px;margin-right:16px}.info{font-size:12px}ul.list{list-style:none;padding:0;margin:0}ul.list li{display:block;padding:0;margin:0}ul.list a,ul.list button{display:grid;grid-template-columns:24px auto;grid-gap:16px;padding:12px;margin:8px 0;border:none;background:transparent;appearance:none;width:100%;font-weight:300;text-align:left;text-decoration:none;color:var(--text-color)}ul.list a:hover,ul.list button:hover{text-decoration:none;color:var(--text-color);background-color:var(--button-background-color-hover)}ul.list a span,ul.list button span{display:block;font-size:16px;font-weight:500;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}header{position:relative;display:grid;grid-template-columns:44px 1fr;gap:8px;padding-left:8px;border-bottom:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}header>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-home header>div{margin-right:56px}header h2{margin:7px 0 0;font-size:18px;font-weight:500;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p{margin:2px 0 0;font-size:12px;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button{display:block;margin:0;padding:0;width:100%;font-size:12px;font-weight:300;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button:hover{text-decoration:underline;color:var(--primary-color)}.builder-logo{margin:12px 0 0 8px}#close{display:block;position:absolute;appearance:none;background:transparent;border:none;border-radius:50%;margin:0;padding:0;right:4px;top:8px;width:48px;height:48px;z-index:1;opacity:.7}#close:hover{opacity:1;background-color:var(--button-background-color-hover)}#close svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}.back-button{position:relative;display:block;margin:7px 0 0 -2px;width:48px;height:48px;background:transparent;border:none;appearance:none;border-radius:50%}.back-button:hover{background-color:var(--button-background-color-hover)}.back-button svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}footer{border-top:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}section.nav-cmp-list{grid-template-rows:64px auto 120px}footer a{text-decoration:underline;color:var(--primary-color)}footer a:hover{color:var(--primary-color);text-decoration:none}.nav-list{padding:2px 0}.nav-loading{pointer-events:none}.nav-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.nav-loading .nav-loading-icon{opacity:.5}.nav-list h4{margin:8px 8px 8px 10px;font-size:14px;font-weight:600}.nav-list .nav-list-item+h4{margin-top:30px}.nav-list-item{display:grid;grid-template-columns:1fr 1fr;gap:8px;position:relative;margin:2px 0;padding:8px 28px 8px 46px;width:100%;font-size:14px;font-weight:300;text-align:left;border:none;background:transparent;appearance:none}.nav-list-item:hover{background-color:var(--button-background-color-hover)}.nav-list-item-icon{position:absolute;top:4px;left:10px;width:24px;height:24px;object-fit:contain;filter:invert(100%);background-size:24px 24px;background-repeat:no-repeat;background-position:center center}.nav-list-item span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}.nav-list-item:after{display:block;position:absolute;content:"";background-image:url('data:image/svg+xml,<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L7 7L1 13" stroke="%23F2F2F2" stroke-opacity="0.5" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');background-repeat:no-repeat;background-position:12px 9px;top:0;right:0;width:32px;height:32px;pointer-events:none}.nav-list-item-note{opacity:0;font-size:12px;padding-top:1px;text-align:right}.nav-list-item:hover .nav-list-item-note{opacity:.5}.ui-select{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-select h3{margin:0;font-size:14px;font-weight:500}.ui-select p{margin:8px 0;font-size:12px;font-weight:300}.ui-select .select{position:relative;margin:8px 0;border-radius:4px;padding:0;line-height:1.1;overflow:hidden;border:1px solid var(--border-color)}.ui-select select{appearance:none;background-color:transparent;border:none;outline:none;padding:8px 32px 8px 8px;margin:0;width:100%;font-size:14px;cursor:pointer;text-overflow:ellipsis;opacity:.6;color:var(--text-color)}.ui-select .select:after{content:"";top:6px;right:5px;width:24px;height:24px;position:absolute;background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="%23F2F2F2" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>');background-repeat:no-repeat;background-position:center;pointer-events:none;opacity:.6}.ui-select .select:hover{border-color:var(--primary-color-subdued)}.ui-text-input .select:focus-within{border-color:var(--primary-color)}.ui-text-input .select:focus-within select{opacity:1}.spinner:after{content:" ";display:block;width:32px;height:32px;margin:0 auto;pointer-events:auto;border-radius:50%;border:3px solid var(--text-color);border-color:var(--text-color) transparent var(--text-color) transparent;animation:spinner .75s linear infinite}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ui-switch{display:grid;grid-template-columns:auto 48px;grid-gap:20px;margin:8px 0 16px;padding:8px 0 8px 16px;cursor:pointer}.ui-switch>*{pointer-events:none}.ui-switch input{display:none;visibility:hidden}.ui-switch .switcher{display:inline-block;border-radius:100px;width:35px;height:14px;background-color:#ccc;position:relative;top:6px;vertical-align:middle;cursor:pointer}.ui-switch input[type=checkbox]:checked+.switcher{background-color:var(--primary-color-subdued)}.ui-switch .switcher:before{content:"";display:block;width:20px;height:20px;background-color:var(--text-color);box-shadow:0 1px 3px #0009;border-radius:50%;position:absolute;top:-3px;left:0;margin-right:0;transition:all .15s}.ui-switch input[type=checkbox]:checked+.switcher:before{left:100%;margin-left:-20px;background-color:var(--primary-color)}.ui-switch h3{margin:0;font-size:14px;font-weight:500}.ui-switch p{margin:4px 0 0;font-size:12px;font-weight:300}.ui-text-input{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-text-input h3{margin:0;font-size:14px;font-weight:500}.ui-text-input p{margin:8px 0;font-size:12px;font-weight:300}.ui-text-input .input{position:relative;margin:8px 0;border:1px solid var(--border-color);border-radius:4px;background:transparent;padding:2px;overflow:hidden}.ui-text-input input{display:block;width:235px;font-size:14px;border:none;background:transparent;padding:6px;appearance:none;color:var(--text-color);opacity:.6;outline:none}.ui-text-input .input:hover{border-color:var(--primary-color-subdued)}.ui-text-input .input:focus-within{border-color:var(--primary-color)}.ui-text-input .input:focus-within input{opacity:1}.ui-text-input .input:after{content:"";position:absolute;top:5px;right:14px;width:8px;height:17px;border:2px solid rgba(51,181,51,1);border-top:none;border-left:none;transform:rotate(45deg);opacity:0;transition:opacity 80ms ease-in-out;pointer-events:none}.ui-text-input.saved .input:after{opacity:1}.ui-toast{position:fixed;bottom:8px;left:8px;right:8px;padding:6px 12px;font-size:14px;border-radius:4px;transform:translate3d(0,150%,0);opacity:0;transition:all var(--transition-time) ease-in-out;background-color:var(--primary-color-subdued);color:var(--text-color);pointer-events:none}.ui-toast.ui-toast-show{transform:translateZ(0);opacity:1;pointer-events:auto}[data-view=nav-home] .nav-home .section-content,[data-view=nav-cmp-list] .nav-cmp-list .section-content,[data-view=nav-cmp-detail] .nav-cmp-detail .section-content,[data-view=nav-cmp-input] .nav-cmp-input .section-content,[data-view=nav-settings] .nav-settings .section-content{transform:translateZ(0);pointer-events:auto}[data-view=nav-home] .nav-home header,[data-view=nav-home] .nav-home footer,[data-view=nav-cmp-list] .nav-cmp-list header,[data-view=nav-cmp-list] .nav-cmp-list footer,[data-view=nav-cmp-detail] .nav-cmp-detail header,[data-view=nav-cmp-detail] .nav-cmp-detail footer,[data-view=nav-cmp-input] .nav-cmp-input header,[data-view=nav-cmp-input] .nav-cmp-input footer,[data-view=nav-settings] .nav-settings header,[data-view=nav-settings] .nav-settings footer{opacity:1;pointer-events:auto}[data-view=nav-cmp-list] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-home .section-content,[data-view=nav-cmp-input] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-cmp-detail .section-content,[data-view=nav-settings] .nav-home .section-content{transform:translate3d(-105%,0,0)}.cmp-item .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.83 16.809C20.94 16.561 21 16.289 21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L7.988 3.99001M5.441 5.44801L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L18.544 18.56" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.532 10.538L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.27002 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 3L21 21" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');opacity:.3}.cmp-item.registered .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>');opacity:.8}.search-highlight{background-color:var(--primary-color-alpha);padding:0 2px;border-radius:2px;font-weight:500}.search-container{position:sticky;top:0;z-index:10;padding:12px 16px;background:var(--background-color);border-bottom:1px solid var(--border-color)}.search-input-wrapper{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:12px;color:var(--text-color-secondary);pointer-events:none}.component-search-input{width:100%;height:36px;padding:8px 36px;border:1px solid var(--border-color);border-radius:6px;background:var(--input-background);color:var(--text-color);font-size:14px;transition:border-color .2s,box-shadow .2s}.component-search-input:focus{outline:none;border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color-alpha)}.component-search-input::placeholder{color:var(--text-color-tertiary)}.clear-search-button{position:absolute;right:8px;padding:4px;color:var(--text-color-secondary);border:none;background:transparent;border-radius:4px;cursor:pointer;opacity:0;transition:opacity .2s,background-color .2s;display:flex;align-items:center;justify-content:center}.clear-search-button:hover{background-color:var(--hover-color)}.component-search-input:not(:placeholder-shown)+.clear-search-button{opacity:1}.no-results{padding:32px 16px;text-align:center;color:var(--text-color-secondary);font-size:14px}#cmp-detail{position:relative}.cmp-loading{pointer-events:none!important}.cmp-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.cmp-loading .cmp-loading-icon{opacity:.5}.cmp-cover{position:absolute;top:160px;left:0;width:100%;height:100vh;background:var(--background-color);transform:translateZ(0);pointer-events:none;display:none}[data-view=nav-cmp-detail] .cmp-cover{display:block;pointer-events:auto}.cmp-enabled .cmp-cover{transform:translate3d(0,105%,0);pointer-events:none}.section-ready .cmp-cover{transition:all var(--transition-time) ease-in-out}.cmp-detail-inputs-container{margin:8px 0 16px;padding:0}.cmp-detail-inputs-container h3{margin:0 0 6px;padding-left:16px;padding-right:8px;font-size:14px;font-weight:500;display:flex;justify-content:space-between;align-items:center}.cmp-detail-inputs-reload{font-weight:300;font-size:.9em;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmp-detail-inputs-reload:hover{text-decoration:underline;color:var(--primary-color)}.cmp-detail-inputs-container .cmp-inputs-empty{padding:0;margin-top:12px;font-size:12px;font-weight:300;opacity:.5;font-style:italic}.cmp-detail-inputs-container .nav-list-item-icon{opacity:.8;background-size:20px 20px;background-position:4px center}.input-icon{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>')}.input-icon-array{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-6a2 2 0 1 1 4 0v6"></path> <path d="M10 13h4"></path></svg>')}.input-icon-boolean{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16h2a2 2 0 1 0 0 -4h-2h2a2 2 0 1 0 0 -4h-2v8z"></path></svg>')}.input-icon-number{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-8l4 8v-8"></path></svg>')}.input-icon-object{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path></svg>')}.input-icon-string{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path></svg>')}.cmp-input-item-unregistered{opacity:.4}.cmp-input-item-unregistered .input-icon:after{content:"";position:absolute;top:11px;left:4px;width:20px;height:2px;background-color:#000;transform:rotate(-45deg)}.cmp-prop-info{border-bottom:1px solid var(--border-color)}.cmp-input-readonly{margin:16px 0;padding:0 16px;display:grid;grid-template-columns:50% 50%;gap:12px}.cmp-input-readonly h3{margin:0;font-size:14px;font-weight:500}.cmp-input-readonly span{margin-top:2px;font-size:12px;font-weight:300;opacity:.8}.cmp-input-detail{margin:16px 0}.cmp-input-detail a{color:var(--primary-color);text-decoration:none}.cmp-input-detail a:hover{text-decoration:underline}.input-cover{position:absolute;top:175px;left:0;width:100%;height:100%;background:var(--background-color);transform:translateZ(0);transition:all var(--transition-time) ease-in-out;pointer-events:auto}.input-enabled .input-cover{transform:translate3d(0,105%,0);pointer-events:none}.input-loading-icon{position:absolute;display:inline-block;top:190px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.input-loading .input-loading-icon{opacity:.5}:host{position:fixed;inset:0;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}aside{position:absolute;top:0;right:0;width:var(--menu-width);height:100%;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;background:var(--background-color);box-shadow:#000000c9 5px 0 20px;overflow:hidden;z-index:1}:host(.show-builder-menu) aside{pointer-events:auto;transform:translateZ(0)}#hit{position:absolute;inset:0;display:none}:host(.show-builder-menu) #hit{display:block;pointer-events:auto}#version{position:absolute;bottom:6px;right:6px;font-size:8px;color:#9b9b9b}</style><div id="hit"></div> <aside data-view="nav-home"> <section class="nav-home"> <header> <svg class="builder-logo" viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> <div> <h2 class="builder-home-title">Builder Devtools</h2> <p><button id="go-to-builder">Go to Builder</button></p> </div> <button id="close" aria-label="Close Menu"> <svg viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M18 6l-12 12" /> <path d="M6 6l12 12" /> </svg> </button> </header> <div class="section-content"> <ul class="list"> <li> <button id="components-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Components</span> </button> </li> <li> <button id="settings-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M10.325 4.317C10.751 2.561 13.249 2.561 13.675 4.317C13.7389 4.5808 13.8642 4.82578 14.0407 5.032C14.2172 5.23822 14.4399 5.39985 14.6907 5.50375C14.9414 5.60764 15.2132 5.65085 15.4838 5.62987C15.7544 5.60889 16.0162 5.5243 16.248 5.383C17.791 4.443 19.558 6.209 18.618 7.753C18.4769 7.98466 18.3924 8.24634 18.3715 8.51677C18.3506 8.78721 18.3938 9.05877 18.4975 9.30938C18.6013 9.55999 18.7627 9.78258 18.9687 9.95905C19.1747 10.1355 19.4194 10.2609 19.683 10.325C21.439 10.751 21.439 13.249 19.683 13.675C19.4192 13.7389 19.1742 13.8642 18.968 14.0407C18.7618 14.2172 18.6001 14.4399 18.4963 14.6907C18.3924 14.9414 18.3491 15.2132 18.3701 15.4838C18.3911 15.7544 18.4757 16.0162 18.617 16.248C19.557 17.791 17.791 19.558 16.247 18.618C16.0153 18.4769 15.7537 18.3924 15.4832 18.3715C15.2128 18.3506 14.9412 18.3938 14.6906 18.4975C14.44 18.6013 14.2174 18.7627 14.0409 18.9687C13.8645 19.1747 13.7391 19.4194 13.675 19.683C13.249 21.439 10.751 21.439 10.325 19.683C10.2611 19.4192 10.1358 19.1742 9.95929 18.968C9.7828 18.7618 9.56011 18.6001 9.30935 18.4963C9.05859 18.3924 8.78683 18.3491 8.51621 18.3701C8.24559 18.3911 7.98375 18.4757 7.752 18.617C6.209 19.557 4.442 17.791 5.382 16.247C5.5231 16.0153 5.60755 15.7537 5.62848 15.4832C5.64942 15.2128 5.60624 14.9412 5.50247 14.6906C5.3987 14.44 5.23726 14.2174 5.03127 14.0409C4.82529 13.8645 4.58056 13.7391 4.317 13.675C2.561 13.249 2.561 10.751 4.317 10.325C4.5808 10.2611 4.82578 10.1358 5.032 9.95929C5.23822 9.7828 5.39985 9.56011 5.50375 9.30935C5.60764 9.05859 5.65085 8.78683 5.62987 8.51621C5.60889 8.24559 5.5243 7.98375 5.383 7.752C4.443 6.209 6.209 4.442 7.753 5.382C8.753 5.99 10.049 5.452 10.325 4.317Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 12C9 12.7956 9.31607 13.5587 9.87868 14.1213C10.4413 14.6839 11.2044 15 12 15C12.7956 15 13.5587 14.6839 14.1213 14.1213C14.6839 13.5587 15 12.7956 15 12C15 11.2044 14.6839 10.4413 14.1213 9.87868C13.5587 9.31607 12.7956 9 12 9C11.2044 9 10.4413 9.31607 9.87868 9.87868C9.31607 10.4413 9 11.2044 9 12Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Settings</span> </button> </li> <li> <button id="add-page-link"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M14 3v4a1 1 0 0 0 1 1h4" /> <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /> <path d="M12 11l0 6" /> <path d="M9 14l6 0" /> </svg> <span>Add Builder Page</span> </button> </li> <li> <button id="import-from-figma"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-figma" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M15 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M6 3m0 3a3 3 0 0 1 3 -3h6a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-6a3 3 0 0 1 -3 -3z" /> <path d="M9 9a3 3 0 0 0 0 6h3m-3 0a3 3 0 1 0 3 3v-15" /> </svg> <span>Import From Figma</span> </button> </li> </ul> </div> <footer> <ul class="list"> <li> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform" target="_blank" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M11.013 17.0114L10.013 18.0114L2.513 10.5834C2.0183 10.102 1.62864 9.52342 1.36854 8.88404C1.10845 8.24466 0.983558 7.55836 1.00173 6.86834C1.01991 6.17832 1.18076 5.49954 1.47415 4.87474C1.76755 4.24994 2.18713 3.69266 2.70648 3.23799C3.22583 2.78331 3.8337 2.4411 4.49181 2.23289C5.14991 2.02468 5.844 1.95499 6.53036 2.02821C7.21673 2.10143 7.8805 2.31596 8.47987 2.65831C9.07925 3.00066 9.60124 3.46341 10.013 4.01741C10.8086 2.95654 11.9931 2.2552 13.3059 2.06766C14.6186 1.88012 15.9521 2.22176 17.013 3.01741C18.0739 3.81306 18.7752 4.99755 18.9627 6.3103C19.1503 7.62305 18.8086 8.95654 18.013 10.0174" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> <path d="M18.2006 19.8175L16.0286 20.9555C15.9642 20.989 15.8917 21.004 15.8192 20.9987C15.7467 20.9934 15.6771 20.9681 15.6182 20.9256C15.5593 20.8831 15.5134 20.825 15.4855 20.7579C15.4577 20.6907 15.4491 20.6172 15.4606 20.5455L15.8756 18.1345L14.1186 16.4275C14.0662 16.3768 14.0291 16.3123 14.0115 16.2416C13.9939 16.1708 13.9966 16.0965 14.0192 16.0271C14.0418 15.9578 14.0835 15.8962 14.1394 15.8494C14.1954 15.8026 14.2634 15.7725 14.3356 15.7625L16.7636 15.4105L17.8496 13.2175C17.8821 13.1521 17.9322 13.0972 17.9942 13.0588C18.0562 13.0204 18.1277 13 18.2006 13C18.2736 13 18.3451 13.0204 18.4071 13.0588C18.4691 13.0972 18.5191 13.1521 18.5516 13.2175L19.6376 15.4105L22.0656 15.7625C22.1377 15.7728 22.2054 15.8031 22.2611 15.85C22.3168 15.8968 22.3583 15.9583 22.3809 16.0275C22.4034 16.0967 22.4062 16.1708 22.3888 16.2415C22.3715 16.3122 22.3347 16.3766 22.2826 16.4275L20.5256 18.1345L20.9396 20.5445C20.9521 20.6163 20.9441 20.6902 20.9166 20.7578C20.8891 20.8254 20.8433 20.8839 20.7842 20.9267C20.7252 20.9695 20.6553 20.9949 20.5825 21C20.5098 21.005 20.4371 20.9896 20.3726 20.9555L18.2006 19.8175Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Give Feedback</span> </a> </li> </ul> <div id="version"></div> </footer> </section> <section class="nav-cmp-list"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div class="search-container"> <div class="search-input-wrapper"> <svg class="search-icon" viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M15.5 15.5L20 20M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z" /> </svg> <input type="text" id="component-search" class="component-search-input" placeholder="Search components..." autocomplete="off" spellcheck="false" /> <button id="clear-search" class="clear-search-button" type="button" aria-label="Clear search" > <svg viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M6 6l12 12M6 18L18 6" /> </svg> </button> </div> </div> <div> <h2>Custom Components</h2> <p> <button id="open-builder-registry"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-list" class="cmp-list nav-list"></div> </div> <div class="nav-loading-icon spinner"></div> <footer> <p class="info"> Expand on Builder's selection of built-in blocks by <a target="_blank" href="https://www.builder.io/c/docs/custom-components-intro" >registering components</a > from your codebase. This way, teammates can drag and drop your components within Builder's Visual Editor just like any other block. </p> </footer> </section> <section class="nav-cmp-detail"> <header> <button class="back-button" data-back="nav-cmp-list"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-detail-title"></h2> <p> <button id="cmp-open-source"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-error"></div> <label class="ui-switch"> <div> <h3>Register Component</h3> <p> Registers this component so it can be used within Builder Visual CMS </p> </div> <input type="checkbox" role="switch" id="cmp-register" /> <span class="switcher"></span> </label> <div id="cmp-detail"> <label class="ui-text-input"> <h3>Component Name</h3> <div class="input"> <input type="text" id="cmp-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="2" maxlength="30" required placeholder="e.g. My Counter" /> </div> <p> Unique name to identify this custom component within Builder. Press ESC to cancel </p> </label> <div class="cmp-detail-inputs-container"> <h3> <span>Builder Inputs (Props)</span> <button class="cmp-detail-inputs-reload" id="btn-inputs-reload"> Reload </button> </h3> <div id="cmp-detail-inputs"></div> </div> </div> </div> <div class="cmp-cover"></div> <div class="cmp-loading-icon spinner"></div> </section> <section class="nav-cmp-input"> <header> <button class="back-button" data-back="nav-cmp-detail"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-input-title"></h2> <p> <button id="input-open-source"></button> </p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable Input</h3> <p>Add this component prop as a Builder input</p> </div> <input type="checkbox" role="switch" id="input-register" /> <span class="switcher"></span> </label> <div class="cmp-prop-info"> <div class="cmp-input-readonly"> <h3>Prop Name</h3> <span id="cmp-prop-name"></span> </div> <div class="cmp-input-readonly"> <h3>Prop Type</h3> <span id="cmp-prop-type"></span> </div> </div> <div class="cmp-input-detail"> <label class="ui-text-input"> <h3>Builder Input Name</h3> <div class="input"> <input type="text" id="input-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="1" maxlength="30" required placeholder="e.g. Text" /> </div> <p> Friendly name to identify this component prop as a Builder input. Press ESC to cancel </p> </label> <label class="ui-select"> <h3>Builder Input Type</h3> <div class="select"> <select id="input-type"></select> </div> <p> Correlate to what editing UI is appropriate for this Builder input. <a href="https://www.builder.io/c/docs/custom-components-input-types" target="_blank" >Read more about input types.</a > </p> </label> </div> <div class="input-cover"></div> <div class="input-loading-icon spinner"></div> </div> </section> <section class="nav-settings"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2>Settings</h2> <p>Configure Builder's Devtools</p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable edit button in UI</h3> <p>Enables the edit button so you can edit content in Builder</p> </div> <input type="checkbox" role="switch" id="enable-edit" /> <span class="switcher"></span> </label> </div> </section> <div class="ui-toast" id="toast"></div> </aside> <button class="menu-toggle" aria-label="Toggle Builder Devtools"> <div> <div class="highlight-bg"></div> <svg viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> </div> </button>\`,ai(e),ui(e),oi(e),ri(e),ti(e),ci(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.26.3"}highlightOpener(){let e=this.shadowRoot.querySelector(".menu-toggle");e.classList.add("menu-toggle-highlight"),e.classList.add("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight")},20)},20)}};var lo=\`<style>*,*:before,*:after{box-sizing:border-box}html,body,:host{position:fixed;top:0;left:0;width:100%;height:100vh;z-index:2147483646;margin:0;padding:0;line-height:1.8;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background-color:#252525;color:#fff;transition:opacity .25s ease-in-out}:host([aria-hidden="true"]){opacity:0;pointer-events:none}main{position:absolute;top:0;left:0;width:100%;height:100vh}h1{margin-top:0;font-size:24px;font-weight:300;line-height:1.4}p{margin:20px 0;font-weight:300}button{cursor:pointer}aside{position:absolute;top:0;left:0;width:350px;height:100vh;padding:60px 0 0 50px;background-color:#121212}aside ul{margin:30px 0 0;padding:0;list-style:none}aside li{position:relative;margin:0;padding:20px 10px;font-weight:300}aside li.highlight{color:#48a1ff}aside li.active{font-weight:700}aside li .circle{position:absolute;top:20px;left:10px;width:24px;height:24px;border:3px solid white;border-radius:50%;font-size:14px}aside li.highlight .circle{border-color:#48a1ff}aside li.active .circle:after{content:"";position:absolute;top:3px;left:3px;width:12px;height:12px;border-radius:50%;background-color:#48a1ff}aside li.completed .circle{background-color:#48a1ff}aside li.completed .circle:after{content:"";position:absolute;top:2px;left:6px;width:6px;height:13px;border:3px solid black;border-top:none;border-left:none;transform:rotate(45deg)}aside li .line{position:absolute;top:44px;left:21px;width:3px;height:45px;background-color:#fff}aside li.completed .line{background-color:#48a1ff}aside li span{display:block;margin-left:44px}nav{margin-top:30px}section{position:absolute;top:135px;left:350px;padding:0 80px 0 140px;transition:opacity .15s ease-in-out}section[aria-hidden=true]{pointer-events:none;opacity:0}section h1,section p{min-width:300px;max-width:600px}.button{position:relative;display:inline-block;color:#fff;background-color:#48a1ff;border-radius:4px;text-decoration:none;padding:10px 40px 10px 20px;white-space:nowrap}.button:hover{background-color:#48a1ffd9}#button-icon{position:absolute;top:1px;right:5px;bottom:0;width:30px;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>');background-repeat:no-repeat;background-position:center;background-size:24px 24px}.button[aria-disabled=true]{opacity:.9;background-color:#ffffff4d;pointer-events:none;padding-right:60px}.button[aria-disabled=true] #button-icon{top:21px;right:29px;width:8px;height:8px;border-radius:4px;background:#fff;color:#fff;animation:dot-flashing .5s infinite linear alternate;animation-delay:.25s}.button[aria-disabled=true] #button-icon:before,.button[aria-disabled=true] #button-icon:after{content:"";display:inline-block;position:absolute;top:0}.button[aria-disabled=true] #button-icon:before{left:-12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:0s}.button[aria-disabled=true] #button-icon:after{left:12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:.5s}@keyframes dot-flashing{0%{background-color:#fff}50%,to{background-color:#ffffff4d}}.logo{margin-left:9px;background:url('data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>');background-repeat:no-repeat;width:150px;height:32px}@media (max-width: 840px){aside{width:250px;padding:60px 0 0 20px}section{left:250px;padding:0 80px}}@media (max-width: 590px){aside{width:230px;padding:60px 0 0 10px}section{left:230px;padding:0 40px}}#modified-files-message a{color:#cbcbcb;font-weight:300;text-decoration:underline}#modified-files-message a:hover{color:#fff;text-decoration:none}#restart-warning{border-radius:4px;padding:8px 16px;border:1px solid #fd6b3c;background:#fd6b3c1a}#react-router-steps{margin:0 0 5px;padding:0 20px}#need-help{color:#48a1ff;text-decoration:none}#router-message{border-radius:4px;padding:16px;border:1px solid #48a1ff}#router-finish-button{margin-top:12px}#router-checkbox-div{display:flex;align-items:center}#router-checkbox{margin-right:10px;width:15px;height:15px}#success-title{display:flex;align-items:center;gap:10px}#success-title .check-icon{display:inline-block;width:24px;height:24px;border:2px solid #28a745;border-radius:50%;position:relative}#success-title .check-icon:before{content:"";position:absolute;top:50%;left:50%;width:6px;height:12px;border:solid #28a745;border-width:0 2px 2px 0;transform:translate(-50%,-60%) rotate(45deg)}
|
|
1287
|
+
\`,t.appendChild(e),setTimeout(()=>{e.classList.add("menu-toggle-tooltip-show"),e.addEventListener("click",()=>{e.classList.remove("menu-toggle-tooltip-show")})},1e3)};function ui(t){t.getElementById("go-to-builder").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(Nr(),"builder")}),t.getElementById("components-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();let u=t.querySelector(".nav-cmp-list .section-content");u.scrollTop=0,oe(t,"nav-cmp-list"),si(t)}),t.getElementById("settings-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),oe(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(je(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open("https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more")})}function ci(t){let e=t.getElementById("enable-edit");e.addEventListener("change",r=>{r.stopPropagation(),Ft(e.checked)}),e.checked=it(),Ft(e.checked)}var At=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=\`<style>*,*:before,*:after{box-sizing:border-box}:host{--background-color: rgba(40, 40, 40, 1);--primary-color: rgba(72, 161, 255, 1);--primary-color-subdued: rgb(72, 161, 255, .6);--primary-color-highlight: rgb(126, 188, 255);--primary-contrast-color: white;--edit-color: #1d74e2;--edit-color-highlight: #1c6bd1;--edit-color-alpha: rgb(72, 161, 255, .15);--error-color: #ff2b55;--text-color: white;--text-color-highlight: white;--border-color: #454545;--button-background-color-hover: rgba(255, 255, 255, .1);--menu-width: 320px;--transition-time: .15s;--font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-family:var(--font-family);line-height:1.6}button{cursor:pointer;color:var(--text-color);-webkit-tap-highlight-color:transparent}input,select,button{font-family:var(--font-family)}.menu-toggle{position:absolute;right:0;bottom:0;pointer-events:auto;padding:8px;background:transparent;border:none;appearance:none}.menu-toggle div{position:relative;width:64px;height:64px;pointer-events:none;border-radius:50%;background:#000;border:1px solid white;box-shadow:#00000054 0 0 8px}.menu-toggle:hover div{background-color:var(--background-color);border:1px solid rgb(220,220,220)}.menu-toggle svg{position:absolute;top:15px;left:15px;width:33px;height:32px}div.highlight-bg{position:absolute;top:-1px;left:-1px;background-color:#1a1a1a;pointer-events:none;transition:all .4s ease-out;opacity:0}.menu-toggle-highlight-no-transition div.highlight-bg{transition:none}.menu-toggle-highlight div.highlight-bg{opacity:1}.menu-toggle-tooltip{position:absolute;bottom:0;right:0;width:382px;height:72px;padding:0;text-align:left;appearance:none;background-color:transparent;border:none;pointer-events:none;transform:translate3d(320px,0,0);opacity:0;transition:all .15s ease-in-out;color:#fff}.menu-toggle-tooltip.menu-toggle-tooltip-show{pointer-events:auto;opacity:1;transform:translateZ(0)}.menu-toggle-tooltip-content{position:absolute;inset:0 95px 10px 0;padding:8px 12px;background-color:var(--primary-color);box-shadow:#00000054 0 0 20px;border-radius:2px}.menu-toggle-tooltip-content:before{content:"";position:absolute;bottom:15px;right:-6px;width:30px;height:30px;background-color:var(--primary-color);transform:rotate(45deg)}.menu-toggle-tooltip:hover .menu-toggle-tooltip-content,.menu-toggle-tooltip:hover .menu-toggle-tooltip-content:before{background-color:var(--primary-color-highlight)}.menu-toggle-tooltip-content h3{margin:0;font-size:16px}.menu-toggle-tooltip-content p{margin:0;font-size:12px}section{position:absolute;display:grid;grid-template-rows:64px auto 64px;top:0;left:0;width:100%;height:100%;padding:0;pointer-events:none}.section-content{margin:0;padding:0 0 10px;font-weight:300;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;overflow-y:auto}.section-content .error{color:var(--error-color);font-weight:700}section a{text-decoration:none;color:var(--text-color)}section h3,section p{margin-left:16px;margin-right:16px}.info{font-size:12px}ul.list{list-style:none;padding:0;margin:0}ul.list li{display:block;padding:0;margin:0}ul.list a,ul.list button{display:grid;grid-template-columns:24px auto;grid-gap:16px;padding:12px;margin:8px 0;border:none;background:transparent;appearance:none;width:100%;font-weight:300;text-align:left;text-decoration:none;color:var(--text-color)}ul.list a:hover,ul.list button:hover{text-decoration:none;color:var(--text-color);background-color:var(--button-background-color-hover)}ul.list a span,ul.list button span{display:block;font-size:16px;font-weight:500;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}header{position:relative;display:grid;grid-template-columns:44px 1fr;gap:8px;padding-left:8px;border-bottom:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}header>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-home header>div{margin-right:56px}header h2{margin:7px 0 0;font-size:18px;font-weight:500;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p{margin:2px 0 0;font-size:12px;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button{display:block;margin:0;padding:0;width:100%;font-size:12px;font-weight:300;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button:hover{text-decoration:underline;color:var(--primary-color)}.builder-logo{margin:12px 0 0 8px}#close{display:block;position:absolute;appearance:none;background:transparent;border:none;border-radius:50%;margin:0;padding:0;right:4px;top:8px;width:48px;height:48px;z-index:1;opacity:.7}#close:hover{opacity:1;background-color:var(--button-background-color-hover)}#close svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}.back-button{position:relative;display:block;margin:7px 0 0 -2px;width:48px;height:48px;background:transparent;border:none;appearance:none;border-radius:50%}.back-button:hover{background-color:var(--button-background-color-hover)}.back-button svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}footer{border-top:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}section.nav-cmp-list{grid-template-rows:64px auto 120px}footer a{text-decoration:underline;color:var(--primary-color)}footer a:hover{color:var(--primary-color);text-decoration:none}.nav-list{padding:2px 0}.nav-loading{pointer-events:none}.nav-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.nav-loading .nav-loading-icon{opacity:.5}.nav-list h4{margin:8px 8px 8px 10px;font-size:14px;font-weight:600}.nav-list .nav-list-item+h4{margin-top:30px}.nav-list-item{display:grid;grid-template-columns:1fr 1fr;gap:8px;position:relative;margin:2px 0;padding:8px 28px 8px 46px;width:100%;font-size:14px;font-weight:300;text-align:left;border:none;background:transparent;appearance:none}.nav-list-item:hover{background-color:var(--button-background-color-hover)}.nav-list-item-icon{position:absolute;top:4px;left:10px;width:24px;height:24px;object-fit:contain;filter:invert(100%);background-size:24px 24px;background-repeat:no-repeat;background-position:center center}.nav-list-item span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}.nav-list-item:after{display:block;position:absolute;content:"";background-image:url('data:image/svg+xml,<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L7 7L1 13" stroke="%23F2F2F2" stroke-opacity="0.5" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');background-repeat:no-repeat;background-position:12px 9px;top:0;right:0;width:32px;height:32px;pointer-events:none}.nav-list-item-note{opacity:0;font-size:12px;padding-top:1px;text-align:right}.nav-list-item:hover .nav-list-item-note{opacity:.5}.ui-select{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-select h3{margin:0;font-size:14px;font-weight:500}.ui-select p{margin:8px 0;font-size:12px;font-weight:300}.ui-select .select{position:relative;margin:8px 0;border-radius:4px;padding:0;line-height:1.1;overflow:hidden;border:1px solid var(--border-color)}.ui-select select{appearance:none;background-color:transparent;border:none;outline:none;padding:8px 32px 8px 8px;margin:0;width:100%;font-size:14px;cursor:pointer;text-overflow:ellipsis;opacity:.6;color:var(--text-color)}.ui-select .select:after{content:"";top:6px;right:5px;width:24px;height:24px;position:absolute;background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="%23F2F2F2" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>');background-repeat:no-repeat;background-position:center;pointer-events:none;opacity:.6}.ui-select .select:hover{border-color:var(--primary-color-subdued)}.ui-text-input .select:focus-within{border-color:var(--primary-color)}.ui-text-input .select:focus-within select{opacity:1}.spinner:after{content:" ";display:block;width:32px;height:32px;margin:0 auto;pointer-events:auto;border-radius:50%;border:3px solid var(--text-color);border-color:var(--text-color) transparent var(--text-color) transparent;animation:spinner .75s linear infinite}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ui-switch{display:grid;grid-template-columns:auto 48px;grid-gap:20px;margin:8px 0 16px;padding:8px 0 8px 16px;cursor:pointer}.ui-switch>*{pointer-events:none}.ui-switch input{display:none;visibility:hidden}.ui-switch .switcher{display:inline-block;border-radius:100px;width:35px;height:14px;background-color:#ccc;position:relative;top:6px;vertical-align:middle;cursor:pointer}.ui-switch input[type=checkbox]:checked+.switcher{background-color:var(--primary-color-subdued)}.ui-switch .switcher:before{content:"";display:block;width:20px;height:20px;background-color:var(--text-color);box-shadow:0 1px 3px #0009;border-radius:50%;position:absolute;top:-3px;left:0;margin-right:0;transition:all .15s}.ui-switch input[type=checkbox]:checked+.switcher:before{left:100%;margin-left:-20px;background-color:var(--primary-color)}.ui-switch h3{margin:0;font-size:14px;font-weight:500}.ui-switch p{margin:4px 0 0;font-size:12px;font-weight:300}.ui-text-input{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-text-input h3{margin:0;font-size:14px;font-weight:500}.ui-text-input p{margin:8px 0;font-size:12px;font-weight:300}.ui-text-input .input{position:relative;margin:8px 0;border:1px solid var(--border-color);border-radius:4px;background:transparent;padding:2px;overflow:hidden}.ui-text-input input{display:block;width:235px;font-size:14px;border:none;background:transparent;padding:6px;appearance:none;color:var(--text-color);opacity:.6;outline:none}.ui-text-input .input:hover{border-color:var(--primary-color-subdued)}.ui-text-input .input:focus-within{border-color:var(--primary-color)}.ui-text-input .input:focus-within input{opacity:1}.ui-text-input .input:after{content:"";position:absolute;top:5px;right:14px;width:8px;height:17px;border:2px solid rgba(51,181,51,1);border-top:none;border-left:none;transform:rotate(45deg);opacity:0;transition:opacity 80ms ease-in-out;pointer-events:none}.ui-text-input.saved .input:after{opacity:1}.ui-toast{position:fixed;bottom:8px;left:8px;right:8px;padding:6px 12px;font-size:14px;border-radius:4px;transform:translate3d(0,150%,0);opacity:0;transition:all var(--transition-time) ease-in-out;background-color:var(--primary-color-subdued);color:var(--text-color);pointer-events:none}.ui-toast.ui-toast-show{transform:translateZ(0);opacity:1;pointer-events:auto}[data-view=nav-home] .nav-home .section-content,[data-view=nav-cmp-list] .nav-cmp-list .section-content,[data-view=nav-cmp-detail] .nav-cmp-detail .section-content,[data-view=nav-cmp-input] .nav-cmp-input .section-content,[data-view=nav-settings] .nav-settings .section-content{transform:translateZ(0);pointer-events:auto}[data-view=nav-home] .nav-home header,[data-view=nav-home] .nav-home footer,[data-view=nav-cmp-list] .nav-cmp-list header,[data-view=nav-cmp-list] .nav-cmp-list footer,[data-view=nav-cmp-detail] .nav-cmp-detail header,[data-view=nav-cmp-detail] .nav-cmp-detail footer,[data-view=nav-cmp-input] .nav-cmp-input header,[data-view=nav-cmp-input] .nav-cmp-input footer,[data-view=nav-settings] .nav-settings header,[data-view=nav-settings] .nav-settings footer{opacity:1;pointer-events:auto}[data-view=nav-cmp-list] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-home .section-content,[data-view=nav-cmp-input] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-cmp-detail .section-content,[data-view=nav-settings] .nav-home .section-content{transform:translate3d(-105%,0,0)}.cmp-item .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.83 16.809C20.94 16.561 21 16.289 21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L7.988 3.99001M5.441 5.44801L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L18.544 18.56" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.532 10.538L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.27002 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 3L21 21" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');opacity:.3}.cmp-item.registered .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>');opacity:.8}.search-highlight{background-color:var(--primary-color-alpha);padding:0 2px;border-radius:2px;font-weight:500}.search-container{position:sticky;top:0;z-index:10;padding:12px 16px;background:var(--background-color);border-bottom:1px solid var(--border-color)}.search-input-wrapper{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:12px;color:var(--text-color-secondary);pointer-events:none}.component-search-input{width:100%;height:36px;padding:8px 36px;border:1px solid var(--border-color);border-radius:6px;background:var(--input-background);color:var(--text-color);font-size:14px;transition:border-color .2s,box-shadow .2s}.component-search-input:focus{outline:none;border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color-alpha)}.component-search-input::placeholder{color:var(--text-color-tertiary)}.clear-search-button{position:absolute;right:8px;padding:4px;color:var(--text-color-secondary);border:none;background:transparent;border-radius:4px;cursor:pointer;opacity:0;transition:opacity .2s,background-color .2s;display:flex;align-items:center;justify-content:center}.clear-search-button:hover{background-color:var(--hover-color)}.component-search-input:not(:placeholder-shown)+.clear-search-button{opacity:1}.no-results{padding:32px 16px;text-align:center;color:var(--text-color-secondary);font-size:14px}#cmp-detail{position:relative}.cmp-loading{pointer-events:none!important}.cmp-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.cmp-loading .cmp-loading-icon{opacity:.5}.cmp-cover{position:absolute;top:160px;left:0;width:100%;height:100vh;background:var(--background-color);transform:translateZ(0);pointer-events:none;display:none}[data-view=nav-cmp-detail] .cmp-cover{display:block;pointer-events:auto}.cmp-enabled .cmp-cover{transform:translate3d(0,105%,0);pointer-events:none}.section-ready .cmp-cover{transition:all var(--transition-time) ease-in-out}.cmp-detail-inputs-container{margin:8px 0 16px;padding:0}.cmp-detail-inputs-container h3{margin:0 0 6px;padding-left:16px;padding-right:8px;font-size:14px;font-weight:500;display:flex;justify-content:space-between;align-items:center}.cmp-detail-inputs-reload{font-weight:300;font-size:.9em;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmp-detail-inputs-reload:hover{text-decoration:underline;color:var(--primary-color)}.cmp-detail-inputs-container .cmp-inputs-empty{padding:0;margin-top:12px;font-size:12px;font-weight:300;opacity:.5;font-style:italic}.cmp-detail-inputs-container .nav-list-item-icon{opacity:.8;background-size:20px 20px;background-position:4px center}.input-icon{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>')}.input-icon-array{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-6a2 2 0 1 1 4 0v6"></path> <path d="M10 13h4"></path></svg>')}.input-icon-boolean{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16h2a2 2 0 1 0 0 -4h-2h2a2 2 0 1 0 0 -4h-2v8z"></path></svg>')}.input-icon-number{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-8l4 8v-8"></path></svg>')}.input-icon-object{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path></svg>')}.input-icon-string{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path></svg>')}.cmp-input-item-unregistered{opacity:.4}.cmp-input-item-unregistered .input-icon:after{content:"";position:absolute;top:11px;left:4px;width:20px;height:2px;background-color:#000;transform:rotate(-45deg)}.cmp-prop-info{border-bottom:1px solid var(--border-color)}.cmp-input-readonly{margin:16px 0;padding:0 16px;display:grid;grid-template-columns:50% 50%;gap:12px}.cmp-input-readonly h3{margin:0;font-size:14px;font-weight:500}.cmp-input-readonly span{margin-top:2px;font-size:12px;font-weight:300;opacity:.8}.cmp-input-detail{margin:16px 0}.cmp-input-detail a{color:var(--primary-color);text-decoration:none}.cmp-input-detail a:hover{text-decoration:underline}.input-cover{position:absolute;top:175px;left:0;width:100%;height:100%;background:var(--background-color);transform:translateZ(0);transition:all var(--transition-time) ease-in-out;pointer-events:auto}.input-enabled .input-cover{transform:translate3d(0,105%,0);pointer-events:none}.input-loading-icon{position:absolute;display:inline-block;top:190px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.input-loading .input-loading-icon{opacity:.5}:host{position:fixed;inset:0;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}aside{position:absolute;top:0;right:0;width:var(--menu-width);height:100%;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;background:var(--background-color);box-shadow:#000000c9 5px 0 20px;overflow:hidden;z-index:1}:host(.show-builder-menu) aside{pointer-events:auto;transform:translateZ(0)}#hit{position:absolute;inset:0;display:none}:host(.show-builder-menu) #hit{display:block;pointer-events:auto}#version{position:absolute;bottom:6px;right:6px;font-size:8px;color:#9b9b9b}</style><div id="hit"></div> <aside data-view="nav-home"> <section class="nav-home"> <header> <svg class="builder-logo" viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> <div> <h2 class="builder-home-title">Builder Devtools</h2> <p><button id="go-to-builder">Go to Builder</button></p> </div> <button id="close" aria-label="Close Menu"> <svg viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M18 6l-12 12" /> <path d="M6 6l12 12" /> </svg> </button> </header> <div class="section-content"> <ul class="list"> <li> <button id="components-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Components</span> </button> </li> <li> <button id="settings-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M10.325 4.317C10.751 2.561 13.249 2.561 13.675 4.317C13.7389 4.5808 13.8642 4.82578 14.0407 5.032C14.2172 5.23822 14.4399 5.39985 14.6907 5.50375C14.9414 5.60764 15.2132 5.65085 15.4838 5.62987C15.7544 5.60889 16.0162 5.5243 16.248 5.383C17.791 4.443 19.558 6.209 18.618 7.753C18.4769 7.98466 18.3924 8.24634 18.3715 8.51677C18.3506 8.78721 18.3938 9.05877 18.4975 9.30938C18.6013 9.55999 18.7627 9.78258 18.9687 9.95905C19.1747 10.1355 19.4194 10.2609 19.683 10.325C21.439 10.751 21.439 13.249 19.683 13.675C19.4192 13.7389 19.1742 13.8642 18.968 14.0407C18.7618 14.2172 18.6001 14.4399 18.4963 14.6907C18.3924 14.9414 18.3491 15.2132 18.3701 15.4838C18.3911 15.7544 18.4757 16.0162 18.617 16.248C19.557 17.791 17.791 19.558 16.247 18.618C16.0153 18.4769 15.7537 18.3924 15.4832 18.3715C15.2128 18.3506 14.9412 18.3938 14.6906 18.4975C14.44 18.6013 14.2174 18.7627 14.0409 18.9687C13.8645 19.1747 13.7391 19.4194 13.675 19.683C13.249 21.439 10.751 21.439 10.325 19.683C10.2611 19.4192 10.1358 19.1742 9.95929 18.968C9.7828 18.7618 9.56011 18.6001 9.30935 18.4963C9.05859 18.3924 8.78683 18.3491 8.51621 18.3701C8.24559 18.3911 7.98375 18.4757 7.752 18.617C6.209 19.557 4.442 17.791 5.382 16.247C5.5231 16.0153 5.60755 15.7537 5.62848 15.4832C5.64942 15.2128 5.60624 14.9412 5.50247 14.6906C5.3987 14.44 5.23726 14.2174 5.03127 14.0409C4.82529 13.8645 4.58056 13.7391 4.317 13.675C2.561 13.249 2.561 10.751 4.317 10.325C4.5808 10.2611 4.82578 10.1358 5.032 9.95929C5.23822 9.7828 5.39985 9.56011 5.50375 9.30935C5.60764 9.05859 5.65085 8.78683 5.62987 8.51621C5.60889 8.24559 5.5243 7.98375 5.383 7.752C4.443 6.209 6.209 4.442 7.753 5.382C8.753 5.99 10.049 5.452 10.325 4.317Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 12C9 12.7956 9.31607 13.5587 9.87868 14.1213C10.4413 14.6839 11.2044 15 12 15C12.7956 15 13.5587 14.6839 14.1213 14.1213C14.6839 13.5587 15 12.7956 15 12C15 11.2044 14.6839 10.4413 14.1213 9.87868C13.5587 9.31607 12.7956 9 12 9C11.2044 9 10.4413 9.31607 9.87868 9.87868C9.31607 10.4413 9 11.2044 9 12Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Settings</span> </button> </li> <li> <button id="add-page-link"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M14 3v4a1 1 0 0 0 1 1h4" /> <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /> <path d="M12 11l0 6" /> <path d="M9 14l6 0" /> </svg> <span>Add Builder Page</span> </button> </li> <li> <button id="import-from-figma"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-figma" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M15 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M6 3m0 3a3 3 0 0 1 3 -3h6a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-6a3 3 0 0 1 -3 -3z" /> <path d="M9 9a3 3 0 0 0 0 6h3m-3 0a3 3 0 1 0 3 3v-15" /> </svg> <span>Import From Figma</span> </button> </li> </ul> </div> <footer> <ul class="list"> <li> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform" target="_blank" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M11.013 17.0114L10.013 18.0114L2.513 10.5834C2.0183 10.102 1.62864 9.52342 1.36854 8.88404C1.10845 8.24466 0.983558 7.55836 1.00173 6.86834C1.01991 6.17832 1.18076 5.49954 1.47415 4.87474C1.76755 4.24994 2.18713 3.69266 2.70648 3.23799C3.22583 2.78331 3.8337 2.4411 4.49181 2.23289C5.14991 2.02468 5.844 1.95499 6.53036 2.02821C7.21673 2.10143 7.8805 2.31596 8.47987 2.65831C9.07925 3.00066 9.60124 3.46341 10.013 4.01741C10.8086 2.95654 11.9931 2.2552 13.3059 2.06766C14.6186 1.88012 15.9521 2.22176 17.013 3.01741C18.0739 3.81306 18.7752 4.99755 18.9627 6.3103C19.1503 7.62305 18.8086 8.95654 18.013 10.0174" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> <path d="M18.2006 19.8175L16.0286 20.9555C15.9642 20.989 15.8917 21.004 15.8192 20.9987C15.7467 20.9934 15.6771 20.9681 15.6182 20.9256C15.5593 20.8831 15.5134 20.825 15.4855 20.7579C15.4577 20.6907 15.4491 20.6172 15.4606 20.5455L15.8756 18.1345L14.1186 16.4275C14.0662 16.3768 14.0291 16.3123 14.0115 16.2416C13.9939 16.1708 13.9966 16.0965 14.0192 16.0271C14.0418 15.9578 14.0835 15.8962 14.1394 15.8494C14.1954 15.8026 14.2634 15.7725 14.3356 15.7625L16.7636 15.4105L17.8496 13.2175C17.8821 13.1521 17.9322 13.0972 17.9942 13.0588C18.0562 13.0204 18.1277 13 18.2006 13C18.2736 13 18.3451 13.0204 18.4071 13.0588C18.4691 13.0972 18.5191 13.1521 18.5516 13.2175L19.6376 15.4105L22.0656 15.7625C22.1377 15.7728 22.2054 15.8031 22.2611 15.85C22.3168 15.8968 22.3583 15.9583 22.3809 16.0275C22.4034 16.0967 22.4062 16.1708 22.3888 16.2415C22.3715 16.3122 22.3347 16.3766 22.2826 16.4275L20.5256 18.1345L20.9396 20.5445C20.9521 20.6163 20.9441 20.6902 20.9166 20.7578C20.8891 20.8254 20.8433 20.8839 20.7842 20.9267C20.7252 20.9695 20.6553 20.9949 20.5825 21C20.5098 21.005 20.4371 20.9896 20.3726 20.9555L18.2006 19.8175Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Give Feedback</span> </a> </li> </ul> <div id="version"></div> </footer> </section> <section class="nav-cmp-list"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div class="search-container"> <div class="search-input-wrapper"> <svg class="search-icon" viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M15.5 15.5L20 20M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z" /> </svg> <input type="text" id="component-search" class="component-search-input" placeholder="Search components..." autocomplete="off" spellcheck="false" /> <button id="clear-search" class="clear-search-button" type="button" aria-label="Clear search" > <svg viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M6 6l12 12M6 18L18 6" /> </svg> </button> </div> </div> <div> <h2>Custom Components</h2> <p> <button id="open-builder-registry"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-list" class="cmp-list nav-list"></div> </div> <div class="nav-loading-icon spinner"></div> <footer> <p class="info"> Expand on Builder's selection of built-in blocks by <a target="_blank" href="https://www.builder.io/c/docs/custom-components-intro" >registering components</a > from your codebase. This way, teammates can drag and drop your components within Builder's Visual Editor just like any other block. </p> </footer> </section> <section class="nav-cmp-detail"> <header> <button class="back-button" data-back="nav-cmp-list"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-detail-title"></h2> <p> <button id="cmp-open-source"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-error"></div> <label class="ui-switch"> <div> <h3>Register Component</h3> <p> Registers this component so it can be used within Builder Visual CMS </p> </div> <input type="checkbox" role="switch" id="cmp-register" /> <span class="switcher"></span> </label> <div id="cmp-detail"> <label class="ui-text-input"> <h3>Component Name</h3> <div class="input"> <input type="text" id="cmp-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="2" maxlength="30" required placeholder="e.g. My Counter" /> </div> <p> Unique name to identify this custom component within Builder. Press ESC to cancel </p> </label> <div class="cmp-detail-inputs-container"> <h3> <span>Builder Inputs (Props)</span> <button class="cmp-detail-inputs-reload" id="btn-inputs-reload"> Reload </button> </h3> <div id="cmp-detail-inputs"></div> </div> </div> </div> <div class="cmp-cover"></div> <div class="cmp-loading-icon spinner"></div> </section> <section class="nav-cmp-input"> <header> <button class="back-button" data-back="nav-cmp-detail"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-input-title"></h2> <p> <button id="input-open-source"></button> </p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable Input</h3> <p>Add this component prop as a Builder input</p> </div> <input type="checkbox" role="switch" id="input-register" /> <span class="switcher"></span> </label> <div class="cmp-prop-info"> <div class="cmp-input-readonly"> <h3>Prop Name</h3> <span id="cmp-prop-name"></span> </div> <div class="cmp-input-readonly"> <h3>Prop Type</h3> <span id="cmp-prop-type"></span> </div> </div> <div class="cmp-input-detail"> <label class="ui-text-input"> <h3>Builder Input Name</h3> <div class="input"> <input type="text" id="input-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="1" maxlength="30" required placeholder="e.g. Text" /> </div> <p> Friendly name to identify this component prop as a Builder input. Press ESC to cancel </p> </label> <label class="ui-select"> <h3>Builder Input Type</h3> <div class="select"> <select id="input-type"></select> </div> <p> Correlate to what editing UI is appropriate for this Builder input. <a href="https://www.builder.io/c/docs/custom-components-input-types" target="_blank" >Read more about input types.</a > </p> </label> </div> <div class="input-cover"></div> <div class="input-loading-icon spinner"></div> </div> </section> <section class="nav-settings"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2>Settings</h2> <p>Configure Builder's Devtools</p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable edit button in UI</h3> <p>Enables the edit button so you can edit content in Builder</p> </div> <input type="checkbox" role="switch" id="enable-edit" /> <span class="switcher"></span> </label> </div> </section> <div class="ui-toast" id="toast"></div> </aside> <button class="menu-toggle" aria-label="Toggle Builder Devtools"> <div> <div class="highlight-bg"></div> <svg viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> </div> </button>\`,ai(e),ui(e),oi(e),ri(e),ti(e),ci(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.26.4"}highlightOpener(){let e=this.shadowRoot.querySelector(".menu-toggle");e.classList.add("menu-toggle-highlight"),e.classList.add("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight")},20)},20)}};var lo=\`<style>*,*:before,*:after{box-sizing:border-box}html,body,:host{position:fixed;top:0;left:0;width:100%;height:100vh;z-index:2147483646;margin:0;padding:0;line-height:1.8;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background-color:#252525;color:#fff;transition:opacity .25s ease-in-out}:host([aria-hidden="true"]){opacity:0;pointer-events:none}main{position:absolute;top:0;left:0;width:100%;height:100vh}h1{margin-top:0;font-size:24px;font-weight:300;line-height:1.4}p{margin:20px 0;font-weight:300}button{cursor:pointer}aside{position:absolute;top:0;left:0;width:350px;height:100vh;padding:60px 0 0 50px;background-color:#121212}aside ul{margin:30px 0 0;padding:0;list-style:none}aside li{position:relative;margin:0;padding:20px 10px;font-weight:300}aside li.highlight{color:#48a1ff}aside li.active{font-weight:700}aside li .circle{position:absolute;top:20px;left:10px;width:24px;height:24px;border:3px solid white;border-radius:50%;font-size:14px}aside li.highlight .circle{border-color:#48a1ff}aside li.active .circle:after{content:"";position:absolute;top:3px;left:3px;width:12px;height:12px;border-radius:50%;background-color:#48a1ff}aside li.completed .circle{background-color:#48a1ff}aside li.completed .circle:after{content:"";position:absolute;top:2px;left:6px;width:6px;height:13px;border:3px solid black;border-top:none;border-left:none;transform:rotate(45deg)}aside li .line{position:absolute;top:44px;left:21px;width:3px;height:45px;background-color:#fff}aside li.completed .line{background-color:#48a1ff}aside li span{display:block;margin-left:44px}nav{margin-top:30px}section{position:absolute;top:135px;left:350px;padding:0 80px 0 140px;transition:opacity .15s ease-in-out}section[aria-hidden=true]{pointer-events:none;opacity:0}section h1,section p{min-width:300px;max-width:600px}.button{position:relative;display:inline-block;color:#fff;background-color:#48a1ff;border-radius:4px;text-decoration:none;padding:10px 40px 10px 20px;white-space:nowrap}.button:hover{background-color:#48a1ffd9}#button-icon{position:absolute;top:1px;right:5px;bottom:0;width:30px;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>');background-repeat:no-repeat;background-position:center;background-size:24px 24px}.button[aria-disabled=true]{opacity:.9;background-color:#ffffff4d;pointer-events:none;padding-right:60px}.button[aria-disabled=true] #button-icon{top:21px;right:29px;width:8px;height:8px;border-radius:4px;background:#fff;color:#fff;animation:dot-flashing .5s infinite linear alternate;animation-delay:.25s}.button[aria-disabled=true] #button-icon:before,.button[aria-disabled=true] #button-icon:after{content:"";display:inline-block;position:absolute;top:0}.button[aria-disabled=true] #button-icon:before{left:-12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:0s}.button[aria-disabled=true] #button-icon:after{left:12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:.5s}@keyframes dot-flashing{0%{background-color:#fff}50%,to{background-color:#ffffff4d}}.logo{margin-left:9px;background:url('data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>');background-repeat:no-repeat;width:150px;height:32px}@media (max-width: 840px){aside{width:250px;padding:60px 0 0 20px}section{left:250px;padding:0 80px}}@media (max-width: 590px){aside{width:230px;padding:60px 0 0 10px}section{left:230px;padding:0 40px}}#modified-files-message a{color:#cbcbcb;font-weight:300;text-decoration:underline}#modified-files-message a:hover{color:#fff;text-decoration:none}#restart-warning{border-radius:4px;padding:8px 16px;border:1px solid #fd6b3c;background:#fd6b3c1a}#react-router-steps{margin:0 0 5px;padding:0 20px}#need-help{color:#48a1ff;text-decoration:none}#router-message{border-radius:4px;padding:16px;border:1px solid #48a1ff}#router-finish-button{margin-top:12px}#router-checkbox-div{display:flex;align-items:center}#router-checkbox{margin-right:10px;width:15px;height:15px}#success-title{display:flex;align-items:center;gap:10px}#success-title .check-icon{display:inline-block;width:24px;height:24px;border:2px solid #28a745;border-radius:50%;position:relative}#success-title .check-icon:before{content:"";position:absolute;top:50%;left:50%;width:6px;height:12px;border:solid #28a745;border-width:0 2px 2px 0;transform:translate(-50%,-60%) rotate(45deg)}
|
|
1288
1288
|
</style>\`,Dt=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=lo+\`<main>
|
|
1289
1289
|
<aside>
|
|
1290
1290
|
<div class="logo"></div>
|
|
@@ -1323,7 +1323,7 @@ Restarting server after Builder Devtools update...
|
|
|
1323
1323
|
</nav>
|
|
1324
1324
|
</section>
|
|
1325
1325
|
</main>
|
|
1326
|
-
\`,po();let r=new URL(Vr,ot);r.searchParams.set(Mr,location.href);let n=e.querySelectorAll(".next-step");for(let i of n)i.setAttribute("href",r.href);ye("overview step viewed")}},po=()=>{let t=document.head.querySelector("link[rel='icon'], link[rel='icon shortcut']");t?(t.href="https://cdn.builder.io/favicon.ico",t.removeAttribute("type")):(t=document.createElement("link"),t.rel="icon",t.href="https://cdn.builder.io/favicon.ico",document.head.appendChild(t))};var li=async()=>{(await qr()).isValid||fo()},fo=()=>{customElements.get("builder-dev-tools-overview")||customElements.define("builder-dev-tools-overview",Dt);let t=document.querySelector("builder-dev-tools-overview");t||(t=document.createElement("builder-dev-tools-overview"),t.setAttribute("aria-hidden","true"),document.body.appendChild(t)),setTimeout(()=>{t.removeAttribute("aria-hidden")},32)};var mo=()=>{try{customElements.get("builder-dev-tools-edit")||customElements.define("builder-dev-tools-edit",st),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",At);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.26.
|
|
1326
|
+
\`,po();let r=new URL(Vr,ot);r.searchParams.set(Mr,location.href);let n=e.querySelectorAll(".next-step");for(let i of n)i.setAttribute("href",r.href);ye("overview step viewed")}},po=()=>{let t=document.head.querySelector("link[rel='icon'], link[rel='icon shortcut']");t?(t.href="https://cdn.builder.io/favicon.ico",t.removeAttribute("type")):(t=document.createElement("link"),t.rel="icon",t.href="https://cdn.builder.io/favicon.ico",document.head.appendChild(t))};var li=async()=>{(await qr()).isValid||fo()},fo=()=>{customElements.get("builder-dev-tools-overview")||customElements.define("builder-dev-tools-overview",Dt);let t=document.querySelector("builder-dev-tools-overview");t||(t=document.createElement("builder-dev-tools-overview"),t.setAttribute("aria-hidden","true"),document.body.appendChild(t)),setTimeout(()=>{t.removeAttribute("aria-hidden")},32)};var mo=()=>{try{customElements.get("builder-dev-tools-edit")||customElements.define("builder-dev-tools-edit",st),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",At);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.26.4"),document.body.appendChild(t));let e=document.querySelector("builder-dev-tools-edit");e||(e=document.createElement("builder-dev-tools-edit"),document.body.appendChild(e));let r=document.getElementById("builder-dev-tools-style");r||(r=document.createElement("style"),r.id="builder-dev-tools-style",r.innerHTML=".builder-no-scroll{overflow:hidden !important}",document.head.appendChild(r)),li(),Jn()}catch(t){console.error("Builder Devtools:",t)}};window.location===window.parent.location&&(console.debug("Builder.io Devtools v1.26.4"),mo());})();`)}async function aZ(t){return AZ(t,`<!doctype html>
|
|
1327
1327
|
<html lang="en" dir="ltr">
|
|
1328
1328
|
<head>
|
|
1329
1329
|
<meta charset="utf-8" />
|
|
@@ -1811,9 +1811,9 @@ ${e}`.toLowerCase();return r.some(i=>i.test(n))}});async function l0({sys:t,cred
|
|
|
1811
1811
|
`):void 0,oldContent:u.length>0?u.join(`
|
|
1812
1812
|
`):void 0})}let f=p.substring(4).split(" ")[0],h=b$e(f);p.startsWith("--- ")?(o=h,i=h,a=0,A=0,c=[],u=[],s=null,l=f==="/dev/null",g=!1):p.startsWith("+++ ")&&(g=f==="/dev/null",f==="/dev/null"?i=o:i=h);continue}else{if(p.startsWith("@@"))continue;p.startsWith("+")?(a++,c.push(p.substring(1)),s===null&&(s="update")):p.startsWith("-")?(A++,u.push(p.substring(1)),s===null&&(s="update")):(p.startsWith(" ")||p==="")&&(c.push(p.substring(1)),u.push(p.substring(1)))}}if(i&&s){let d;l?d="create":g?d="delete":d="update";let p=d==="delete"&&o?o:i;r.push({filePath:p,addedLines:a,removedLines:A,action:d,content:c.length>0?c.join(`
|
|
1813
1813
|
`):void 0,oldContent:u.length>0?u.join(`
|
|
1814
|
-
`):void 0})}return r}var sue=M(()=>{"use strict";C()});var wu,aue=M(()=>{"use strict";C();wu=(...t)=>{typeof process<"u"&&process.env.DEBUG==="true"&&console.debug("[DEBUG] ",...t)}});var x$e,If,Aue,S$e,F$e,k$e,tb,IU=M(()=>{"use strict";C();aue();x$e=()=>{if(typeof globalThis<"u"&&globalThis.crypto)return globalThis.crypto;if(typeof require<"u")try{let t=require("crypto");if(t.webcrypto)return t.webcrypto}catch{}throw new Error("Web Crypto API is not available. Requires Node.js 15+ or a browser environment.")},If=x$e(),Aue=async()=>{let t=await If.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),e=await If.subtle.exportKey("jwk",t);return JSON.stringify(e)},S$e=async()=>If.getRandomValues(new Uint8Array(16)),F$e=async(t,e,r)=>{let n=await If.subtle.encrypt({name:"AES-GCM",iv:e,tagLength:128},t,typeof r=="string"?new TextEncoder().encode(r):r);return Buffer.from(n)},k$e=async(t,e,r)=>{let n=await If.subtle.decrypt({name:"AES-GCM",iv:e,tagLength:128},t,r);return new TextDecoder().decode(n)},tb=async t=>{try{wu("validateEncryptionKey: Validating encryption key");let e=JSON.parse(t);wu("validateEncryptionKey: Parsed JWK");let r=await If.subtle.importKey("jwk",e,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]);wu("validateEncryptionKey: Imported crypto key");let n="test",i=await S$e();wu("validateEncryptionKey: Generated test IV",i);let o=await F$e(r,i,n);wu("validateEncryptionKey: Encrypted test data",o);let s=new Uint8Array(o);wu("validateEncryptionKey: Encrypted test data array",s);let a=await k$e(r,i,s);return wu("validateEncryptionKey: Decrypted test data",a),a===n}catch(e){return console.error("Could not validate encryption key:",e),!1}}});function R$e(){if(GI!==void 0)return GI;try{return GI=require("prettier"),GI}catch{return GI=null,null}}var gg,uue,lue,ib,nb,gue,GI,cue,N$e,pA,rb,Bf=M(()=>{"use strict";C();Nl();Jee();Dn();mo();mn();Qn();gg=ie(require("node:fs"),1);B1();$ee();Q1();uue=ie(require("node:os"),1);Vi();Vee();g0();Bte();Dte();lue=ie(require("chokidar"),1);EU();xte();sT();or();ib=ie(require("node:events"),1);mC();em();nb=require("node:crypto");Bm();Tte();xT();Gy();Gh();oue();Cm();sue();gue=require("node:fs/promises");IU();Oy();lm();eu();eA();Hy();tT();F1();cue=["ask-to-continue","credits-limit-daily","credits-limit-monthly","credits-limit-other","invalid-last-message"],N$e=["initial-with-url","initial-without-url","success"],pA=class t{#g;#B;#I;#c=[];#f;#e;#a;#
|
|
1814
|
+
`):void 0})}return r}var sue=M(()=>{"use strict";C()});var wu,aue=M(()=>{"use strict";C();wu=(...t)=>{typeof process<"u"&&process.env.DEBUG==="true"&&console.debug("[DEBUG] ",...t)}});var x$e,If,Aue,S$e,F$e,k$e,tb,IU=M(()=>{"use strict";C();aue();x$e=()=>{if(typeof globalThis<"u"&&globalThis.crypto)return globalThis.crypto;if(typeof require<"u")try{let t=require("crypto");if(t.webcrypto)return t.webcrypto}catch{}throw new Error("Web Crypto API is not available. Requires Node.js 15+ or a browser environment.")},If=x$e(),Aue=async()=>{let t=await If.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),e=await If.subtle.exportKey("jwk",t);return JSON.stringify(e)},S$e=async()=>If.getRandomValues(new Uint8Array(16)),F$e=async(t,e,r)=>{let n=await If.subtle.encrypt({name:"AES-GCM",iv:e,tagLength:128},t,typeof r=="string"?new TextEncoder().encode(r):r);return Buffer.from(n)},k$e=async(t,e,r)=>{let n=await If.subtle.decrypt({name:"AES-GCM",iv:e,tagLength:128},t,r);return new TextDecoder().decode(n)},tb=async t=>{try{wu("validateEncryptionKey: Validating encryption key");let e=JSON.parse(t);wu("validateEncryptionKey: Parsed JWK");let r=await If.subtle.importKey("jwk",e,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]);wu("validateEncryptionKey: Imported crypto key");let n="test",i=await S$e();wu("validateEncryptionKey: Generated test IV",i);let o=await F$e(r,i,n);wu("validateEncryptionKey: Encrypted test data",o);let s=new Uint8Array(o);wu("validateEncryptionKey: Encrypted test data array",s);let a=await k$e(r,i,s);return wu("validateEncryptionKey: Decrypted test data",a),a===n}catch(e){return console.error("Could not validate encryption key:",e),!1}}});function R$e(){if(GI!==void 0)return GI;try{return GI=require("prettier"),GI}catch{return GI=null,null}}var gg,uue,lue,ib,nb,gue,GI,cue,N$e,pA,rb,Bf=M(()=>{"use strict";C();Nl();Jee();Dn();mo();mn();Qn();gg=ie(require("node:fs"),1);B1();$ee();Q1();uue=ie(require("node:os"),1);Vi();Vee();g0();Bte();Dte();lue=ie(require("chokidar"),1);EU();xte();sT();or();ib=ie(require("node:events"),1);mC();em();nb=require("node:crypto");Bm();Tte();xT();Gy();Gh();oue();Cm();sue();gue=require("node:fs/promises");IU();Oy();lm();eu();eA();Hy();tT();F1();cue=["ask-to-continue","credits-limit-daily","credits-limit-monthly","credits-limit-other","invalid-last-message"],N$e=["initial-with-url","initial-without-url","success"],pA=class t{#g;#B;#I;#c=[];#f;#e;#a;#Qe;#y;#Le;#Z;#O;#n=process.env.FUSION_DEBUG==="true";#o=new ib.default;#w;#K;#X;#ce=[];#De=void 0;#_e=Promise.resolve(void 0);#x=[];#E;#b=[];#ee;#H=new Map;#Ue=[];#J;#it=0;#Y;#S;#r;#s;#Ge;#ye;#ue=!1;#te;#re=void 0;#we;#be;#le;#j;#u;#i=[];#h;#Oe;#A;#ve;#ne;#ge=0;#$;#C;#t;#m;#T;#Ke;#P;#pe=!1;#He=0;#q=0;#L=!1;#Q=!1;#de;#fe;#V;#Je;#z=[];#Ce=[];#ie;#F={};#xe=new Set;#he;#k;#me=!0;#Se=[];#oe=null;#Ye=void 0;#p=new Map;#l={watcher:null,listeners:new Set,debounceMs:300,pendingEvents:[]};#je=!1;get#d(){return this.#i[0]?.path||this.#u}#se(e){if(!e)return this.#d;let r=this.#i.find(n=>n.folderName===e);if(!r)throw new Error(`Folder "${e}" not found in git-enabled folders`);return r.path}#Fe(e,r){if(r)return{repoPath:this.#se(r),relativePath:e};for(let n of this.#i){let i=`${n.folderName}/`;if(e.startsWith(i))return{repoPath:n.path,relativePath:e.slice(i.length)}}return{repoPath:this.#d,relativePath:e}}constructor(e){if(this.#e=e.sys,this.#P=e.modelOverride,this.#a=e.credentials,"initialUrl"in e){let n=OZ(e.initialUrl).id;n?this.#S=n:this.#Qe=e.initialUrl}typeof e.autoImportLocalMCPs=="boolean"&&(this.#je=e.autoImportLocalMCPs),"sessionOrCompletionId"in e?this.#S=e.sessionOrCompletionId:this.#S=e.fusionConfig?.sessionId;let r=e.workingDirectory??e.fusionConfig?.workingDirectory;if(this.#u=r?e.sys.resolve(e.sys.cwd(),r):e.sys.getCwdDir(),this.#Le=e.skipFileDiff??!0,this.#y=e.position,this.#w=e.mode,this.#E=e.privacyMode??e.fusionConfig?.privacyMode,this.#r=e.devServerOrchestrator,this.#s=e.git??!1,this.#Ge=e.gitAutoInit??!1,this.#t=e.fusionConfig,this.#m=e.fusionConfig?.projectId,this.#T=e.fusionConfig?.branchName,this.#K=e.fusionConfig?.featureBranch,this.#X=e.fusionConfig?.aiBranch,this.#de=e.fusionConfig?.proxyOrigin,process.env.FUSION_ENV_ORIGIN&&(this.#V=process.env.FUSION_ENV_ORIGIN),this.#fe=e.agentType,e.enabledTools)this.#C=rb(this.#t,e.enabledTools);else if(this.#w==="quality-v3"){let n=["write_file","search_replace_file","view_path","get_rule","get_style_inspiration","grep_search","web_search","find_media",process.platform==="win32"?"powershell":"bash"];this.#r&&n.push("dev_server_control"),this.#C=rb(this.#t,n)}else if(this.#w==="quality-v4"){let n=["Write","Edit","Read","MultiEdit","Grep","Glob","ReadRule","TodoRead","TodoWrite","Agent","Media","WebFetch","AskUserQuestion","ExitPlanMode",process.platform==="win32"?"PowerShell":"Bash"],i=!!(this.#E?.enabled||this.#E?.redactUserMessages||this.#E?.redactLLMMessages);i||n.push("WebSearch"),this.#m&&!i&&this.getCommitMode()!=="commits"&&n.push("SearchMemories"),this.#s&&!i&&n.push("Revert"),this.#V&&!i&&n.push("GetScreenshot"),this.#r&&n.push("DevServerControl"),this.#C=rb(this.#t,n)}if(this.#Oe=e.maxTokens,this.#we=e.builtInCustomInstructions??[],this.#be=e.builtInCustomAgents??[],this.#le=e.builtInMCPServerConfig??{},this.#j=e.systemPromptOverride,this.#A=e.fusionConfig?.workspace,this.#ve=e.mcpServers??!1,this.#h=this.#u,this.#i=[],this.#A?.folders.length){let n=this.#A.folders.filter(o=>o.enableGit);this.#i=n.map(o=>({folderName:o.name||o.path,path:this.#e.resolve(this.#u,o.path),branchName:o.branchName||"main",repoUrl:o.repoUrl,repoName:o.repoName}));let i=n[0];if(i){let o=i.backupMetadata?.check.backup;this.#ie=hm({version:o?.version,originalRepoUrl:o?.repoUrl,commitHash:o?.lastCommitHash})}}this.#i.length===0&&(this.#i=[{folderName:"code",path:this.#u,branchName:"main"}]),this.#he=eX(this.#A),this.#A?.folders[0]&&this.#D()&&(this.#h=this.#e.resolve(this.#u,this.#A.folders[0].path))}get fusionConfig(){return this.#t}get gitEnabledFolder(){return this.#A?.folders.find(e=>e.enableGit)}get gitEnabledFolders(){return this.#A?.folders.filter(e=>e.enableGit)||[]}get gitRepoContexts(){return this.#i}get workingDirectory(){return this.#u}getSessionMode(){return this.#g?.sessionMode??"normal"}async switchSessionMode(e){let r=this.getSessionContext();r.sessionMode!==e&&(r.sessionMode=e,this.#Q=!1,await this.#Ae())}removeSystemReminder(e){let r=this.#b.findIndex(n=>n.tag===e);r!==-1&&this.#b.splice(r,1)}queueSystemReminder(e){let r=e.tag?this.#b.findIndex(n=>n.tag===e.tag):-1;return r!==-1?e.text?(this.#b[r]=e,{operation:"update"}):(this.#b.splice(r,1),{operation:"delete"}):e.text?(this.#b.push(e),{operation:"add"}):{operation:"noop"}}async setPrivacyMode(e){if(e&&e.enabled){if(!e.encryptKey&&!this.#ee)this.#ee=await Aue();else if(e.encryptKey){if(!await tb(e.encryptKey))throw new Error("Invalid encryption key: key failed validation");this.#ee=e.encryptKey}}else this.#ee=void 0;this.#E=e}async initializeSession(e={}){return this.#ye||(this.#ye=this.#at(e)),await this.#ye}async loadHistory(){let e=this.getSessionContext(),r=await Ly(this.#e,this.#a,e.sessionId,!1),n=new Set;for(let o of r.turns)o.beforeCommit&&n.add(o.beforeCommit),o.afterCommit&&n.add(o.afterCommit),o.lastCommit&&n.add(o.lastCommit);if(n.size>0)try{let s=(await this.git(["cat-file","--batch-check","--buffer"],{sys:this.#e,cwd:this.#d,stdin:Array.from(n).map(a=>`${a}^{commit}`).join(`
|
|
1815
1815
|
`)})).trim().split(`
|
|
1816
|
-
`);for(let a of s)if(a.includes("missing")){let A=a.split(/\s+/)[0].replace("^{commit}","");n.delete(A)}}catch(o){this.#e.Sentry?.captureException(o)}let i=r.turns.filter(o=>!(o.beforeCommit&&!n.has(o.beforeCommit)||o.afterCommit&&!n.has(o.afterCommit)||o.lastCommit&&!n.has(o.lastCommit)));return{sessionId:e.sessionId,title:e.title,beforeCommit:e.beforeCommit,createdUnixTime:e.createdUnixTime,updatedUnixTime:e.updatedUnixTime,turns:i}}async loadWholeSession(e={}){let{getAll:r=!0}=e,n=this.getSessionContext(),i=0;for(;n.canLoadMore&&n.canLoadMore;){let o=await this.loadMoreTurns();i+=o.length}return{sessionId:n.sessionId,title:n.title,beforeCommit:n.beforeCommit,createdUnixTime:n.createdUnixTime,updatedUnixTime:n.updatedUnixTime,addedTurns:i,turns:r?n.turns:n.turns.slice(0,i)}}async loadMoreTurns(){return this.#te||(this.#te=this.#ot().then(e=>(this.#te=void 0,e))),this.#te}async#ot(){let e=this.getSessionContext();if(e.canLoadMore){let r=e.turns[0]?.completionId,n=await Ly(this.#e,this.#a,e.sessionId,!0,r);return n.turns.length>0&&e.turns.unshift(...n.turns),e.canLoadMore=n.canLoadMore,n.turns}return[]}async#st(){try{let e=R$e();if(!e)return null;let r=this.#e.join(this.#d,"file.tsx");return await e.resolveConfig(r)}catch{return null}}async setCustomInstructions(e){this.#
|
|
1816
|
+
`);for(let a of s)if(a.includes("missing")){let A=a.split(/\s+/)[0].replace("^{commit}","");n.delete(A)}}catch(o){this.#e.Sentry?.captureException(o)}let i=r.turns.filter(o=>!(o.beforeCommit&&!n.has(o.beforeCommit)||o.afterCommit&&!n.has(o.afterCommit)||o.lastCommit&&!n.has(o.lastCommit)));return{sessionId:e.sessionId,title:e.title,beforeCommit:e.beforeCommit,createdUnixTime:e.createdUnixTime,updatedUnixTime:e.updatedUnixTime,turns:i}}async loadWholeSession(e={}){let{getAll:r=!0}=e,n=this.getSessionContext(),i=0;for(;n.canLoadMore&&n.canLoadMore;){let o=await this.loadMoreTurns();i+=o.length}return{sessionId:n.sessionId,title:n.title,beforeCommit:n.beforeCommit,createdUnixTime:n.createdUnixTime,updatedUnixTime:n.updatedUnixTime,addedTurns:i,turns:r?n.turns:n.turns.slice(0,i)}}async loadMoreTurns(){return this.#te||(this.#te=this.#ot().then(e=>(this.#te=void 0,e))),this.#te}async#ot(){let e=this.getSessionContext();if(e.canLoadMore){let r=e.turns[0]?.completionId,n=await Ly(this.#e,this.#a,e.sessionId,!0,r);return n.turns.length>0&&e.turns.unshift(...n.turns),e.canLoadMore=n.canLoadMore,n.turns}return[]}async#st(){try{let e=R$e();if(!e)return null;let r=this.#e.join(this.#d,"file.tsx");return await e.resolveConfig(r)}catch{return null}}async setCustomInstructions(e){this.#we=e,this.#g&&(this.#g.customInstructions=await this.#Ie())}async setCustomAgents(e){this.#be=e,this.#g&&(this.#g.customAgents=await this.#Ee())}async#Ie(){let r=(await Promise.all(this.#i.map(n=>oT({sys:this.#e,projectDir:this.#u,currentDir:n.path,rootDir:"/"})))).flat();return aT(this.#we??[],r)}async#Ee(){if(!this.#C?.includes("Agent"))return[];let r=(await Promise.all(this.#i.map(n=>vte({sys:this.#e,projectDir:this.#u,currentDir:n.path,rootDir:"/"})))).flat();return aT(this.#be??[],r)}async#at(e){try{if(this.#pe)throw new Error("Code session already closed");if(this.#g)throw new Error("Session context already initialized");this.#n&&console.log(`\u{1F4C1} Current AI working directory: ${this.#u}`),await this.setPrivacyMode(this.#E);let r=await this.#ct(),n=await this.#st();r&&(this.#k=r.currentCommitHash);let i=this.#i[0]?.repoUrl;this.#Ke=await Qte(i);let o,s;this.#S||(this.#S=r?.sessionId),this.#S?e.skipSessionLoading?o=this.#S:(s=await Ly(this.#e,this.#a,this.#S,!0,void 0,e.signal),o=s.sessionId,this.#n&&console.log("SESSION recovered",o,s.turns.length)):o=(0,nb.randomUUID)(),this.#K||(this.#K=r?.featureBranch?.trim());let a={turns:s?.turns??[],sessionId:o,customInstructions:await this.#Ie(),customAgents:await this.#Ee(),title:s?.title,beforeCommit:s?.beforeCommit,createdUnixTime:s?.createdUnixTime??Date.now(),updatedUnixTime:s?.updatedUnixTime??Date.now(),userContext:await _y(this.#e,this.#d),prettierConfig:n,canLoadMore:s?.canLoadMore??!1,state:s?.turns.length?"success":this.#Qe?"initial-with-url":"initial-without-url",sessionMode:s?.sessionMode??"normal"};if(this.#F=s?.metadata??{},s){let c=Za(s.turns);c?.completionId!==s.lastCompletionId&&this.#e.Sentry?.captureException(new Error("Last completion id mismatch"),{tags:{operation:"codegen-initialize-session"},extra:{lastTurn:c,sessionMetadata:s}})}this.#n&&this.#o.on("step",c=>{c.type!=="delta"&&console.log(`Event: ${JSON.stringify(c)}`)}),await this.#lt(a),this.#g=a;try{let c=await iue(this.#e,this.#d,this.#le,this.#je,this.#n,e.signal);c.length>0?(this.#n&&console.log(`\u{1F50C} Initializing ${c.length} local MCP server(s)...`),this.#ne=await nue(c,this.#e,this.#d,this.#n,e.signal)):this.#n&&console.log(`No local MCP servers found in: ${this.#d}`)}catch(c){this.#n&&console.error("Failed to initialize local MCP servers:",c)}let A=this.#r;if(A){let c=()=>{this.#o.emit("step",fT(A,this.#t))},u=()=>{this.#o.emit("step",fT(A,this.#t)),this.#Ae()},l=g=>{g==="ok-2xx"&&this.requestRefresh()};A.emitter.on("setupState",u),A.emitter.on("devState",u),A.emitter.on("httpServerData",u),A.emitter.on("httpServerState",l),A.emitter.on("validateState",c),this.#Ue.push(()=>{A.emitter.off("setupState",u),A.emitter.off("devState",u),A.emitter.off("httpServerData",u),A.emitter.off("httpServerState",l),A.emitter.off("validateState",c)})}if(this.#fe){let c=await this.getNamedAgentConfig(this.#fe,this.getSessionId(),e.signal);c.success?(this.#Z=c.options.includeMemories,this.#C=c.options.enabledTools,this.#P=c.options.modelOverride,this.#w=c.options.mode,this.#j=c.options.systemPromptOverride,this.#y=c.options.position,this.#le={...this.#le,...c.options.builtInMCPServerConfig},c.options.mcpServers&&(this.#ve=c.options.mcpServers)):console.error(c.response)}}catch(r){throw console.error(r),this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-initialize-session"}}),r}}async#ke(e,r){let n="reminder:health";this.removeSystemReminder(n);let i=this.#r;if(!i)return;e&&await i.waitUntilIdle(500,500);let o=this.getSessionContext(),s=i.setupState,a=await this.#qe(),A=i.devCommand,c=i.devState,u=i.state,l=i.setupCommand,g=await i.getOpenPorts(),d=i.proxyTarget,p=i.httpServerState.state,f=i.lastServerStatus,h=p==="error-fetch",m=!1;this.#s&&(m=await this.getCurrentBranch()!==this.getAiBranch());let I=p==="error-5xx"||p==="error-4xx"&&f!==401&&f!==404,E="",B=!1,Q=!1;u==="install-failed"||u==="install-aborted"?E=i.getSetupOutput():(E=i.getCheckpoints(1,c!=="running"?"err":"all"),B=jZ(E??""));let w="",D="",b="error",S="Try to fix",k="repair-unknown";if(u==="not-installed"||u==="install-failed"||u==="install-aborted"||u==="failed"||u==="unset"||m||h||I||B||a.length>0){if(m&&(k="repair-bad-branch",D+=`- The current git branch is not the AI branch (${this.getAiBranch()}).
|
|
1817
1817
|
`,D+=`- Please switch to the AI branch using the 'git' tool.
|
|
1818
1818
|
`,w=`The current branch is not the AI branch (${this.getAiBranch()}).`),a.length>0)k="repair-merge-conflict",S="Resolve conflict",w="Merge conflict detected - changes from different sources need to be combined",D+=`Merge conflict detected.The following files contain merge conflicts and they must be resolved:
|
|
1819
1819
|
${a.join(`
|
|
@@ -1870,17 +1870,17 @@ ${i.getSetupOutput().slice(-8e3)}
|
|
|
1870
1870
|
`:E&&(D+=`<dev_logs>
|
|
1871
1871
|
${E}
|
|
1872
1872
|
</dev_logs>
|
|
1873
|
-
`)}(r==="all"||r==="critical"&&!Q)&&this.queueSystemReminder({text:nm(D,2e3),tag:n});let F={devServerState:c,setupState:s,httpServerState:p,proxyServer:d,devCommand:A,setupCommand:l,hasMergeConflict:a.length>0,hasConfigurationIssue:Q,logs:E,prompt:"Debug and fix the issue before continuing.",message:w},K=this.#c.length===0&&N$e.includes(o.state);return{actionButtonText:S,type:"build-error",level:b,canAutoApply:K,healthStatus:F,message:F.message,userMessage:{userPrompt:F.prompt,repair:!0,category:k,displayPrompt:F.message}}}}async#At(e,r){let n=await this.#ke(!1,"critical"),i=!!(n&&!n.healthStatus.hasConfigurationIssue),o=e;return i?(o++,this.#r?.addCheckpoint()):r&&(o=0),{hasHealthIssue:i,newCount:o}}async#ct(){let e;if(this.#s)try{if(L.info("\u{1F504} Initializing Fusion session for AI side-car branch workflow..."),e=await this.#e.getRepoInfo(this.#d),!e.hasGit)if(this.#Ge){L.warn("\u{1F6E0}\uFE0F No git repository detected. Initializing a new git repository...");try{await this.git(["init"]),await this.git(["add","."]),await this.git(["branch","-M","main"]),await this.git(["commit","--allow-empty","--quiet","--no-verify","--no-gpg-sign","-m","Initial commit for Fusion workflow"]),L.info("\u2705 Successfully initialized a new git repository")}catch(r){console.error("\u274C Failed to initialize git repository:",r);return}}else{L.error("\u274C Error: Not in a git repository. Fusion requires a git repository.");return}return await f0({sys:this.#e,gitWorkingDirectory:this.#d,strict:!0})}catch(r){L.error(`\u274C Error initializing Fusion session: ${r}`);let n=new Error("Initialize Git failed",{cause:r});throw this.#e.Sentry?.captureException(n,{level:"fatal",tags:{operation:"codegen-initialize-session"},extra:{repoInfo:e}}),n}}async#ut(e,r){try{await this.git(["checkout",e],{cwd:r})}catch{await this.git(["checkout","-b",e],{cwd:r})}}async#lt(e){if(!this.#s)return;if(!this.#X){let o=Rte(this.getFeatureBranch(),e.sessionId);this.#X=o}let r=this.getAiBranch();await this.#N(async o=>{await this.getCurrentBranch(o.path)!==r&&await this.#ut(r,o.path);try{await this.git(["branch","--set-upstream-to",`refs/remotes/origin/${this.#z(o)}`],{cwd:o.path})}catch{}});let n=Za(e.turns),i=n?.afterCommit??n?.lastCommit;if(i){let o=await this.getCurrentCommitHash();o!==i&&this.#e.Sentry?.captureException(new Error("Init: After commit mismatch"),{tags:{operation:"codegen-initialize-session"},extra:{sessionId:e.sessionId,targetCommit:i,lastTurn:n,currentCommitHash:o}})}if(e.beforeCommit)try{await this.git(["rev-parse","--quiet","--verify",e.beforeCommit])}catch(o){this.#e.Sentry?.captureException(new Error("Init: Before commit not found",{cause:o}),{tags:{operation:"codegen-initialize-session"},extra:{sessionId:e.sessionId,beforeCommit:e.beforeCommit,turnStates:e.turns.length,lastCompletionId:Za(e.turns)?.completionId}})}}async#gt(e,r){let n;try{n=(await this.git(["remote","get-url","origin"],r)).trim()}catch{}let{url:i,token:o,provider:s}=e;try{new URL(i)}catch{throw this.#e.Sentry?.captureException(new Error("Provided remote url is invalid"),{tags:{operation:"codegen-git"},extra:{url:i,currentOriginUrl:n}}),new Error("Provided remote url is invalid")}n!==i&&(this.#ie=void 0,n?await this.git(["remote","set-url","origin",i],r):await this.git(["remote","add","origin",i],r),s==="github"&&o&&(process.env.GH_TOKEN=o))}async pushRepoV2(e){return await this.#M(this.#Ee({pullFirst:!1,updateRepo:e,refreshRemote:!0}),!0)}async#$e(){let e;try{let r=this.gitEnabledFolders;if(r.length===0)throw new Error("No git-enabled repos found");let n=r.filter(o=>!o.initializationCommand&&!o.repoUrl?.startsWith("ssh://"));if(n.length===0)return{success:!0,message:"Git remote URLs update not needed"};if(!this.#m)throw new Error("Project ID is required to update git URLs");let i=await xd(this.#a,this.#m);if(!i.success)throw i.error;e=i.gitConfigs;for(let o of n){if(!o.repoName)continue;let s=e?.[o.repoName];if(s?.url){let a=this.#e.resolve(this.#u,o.path);await this.#gt(s,a)}}return await this.emitGitStatus(),{success:!0,message:"Git remote URLs updated"}}catch(r){let n=`Failed to update git remote URLs: ${Ml(r)}`;return this.#n&&console.error(n),this.#o.emit("step",{type:"error",message:n,code:"git-update-error"}),this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-git",endpoint:"updateGitUrls"},extra:{projectId:this.#m,workspaceFolders:this.#A?.folders,gitConfigs:e}}),{success:!1,message:n,error:r instanceof Error?r:new Error(n)}}}async zipFolder(e){let{resolvedPath:r}=this.resolveWorkspacePath(e,!1),n=Date.now(),i=Math.random().toString(36).substring(2,8),o=`zip-${n}-${i}.zip`,s="/tmp",a=this.#e.join(s,o);return gg.default.mkdirSync(s,{recursive:!0}),await jA("zip",["-r",a,".","-x","**/node_modules/**"],{cwd:r,debug:this.#n,sys:this.#e}),a}async archiveProject(){if(!this.#s)throw new Error("Can not archive project in non git mode");try{let e=Date.now(),r=Math.random().toString(36).substring(2,8),n=`project-${e}-${r}.zip`,i="/tmp",o=this.#e.join(i,n);return gg.default.mkdirSync(i,{recursive:!0}),await this.git(["archive","--format=zip","-o",o,"HEAD"]),o}catch(e){throw new Error("Failed to archive project",{cause:e})}}isIdle(){let e=this.getSessionContext(),r=["generating","replay"];return!this.#j&&!r.includes(e.state)&&this.#V.length===0}async needsBackup(){if(!this.#s||this.#i.length>1||!this.#m||!this.#T)return!1;let e=await this.getCurrentCommitHash();if(!e)return!1;let r=this.gitEnabledFolder?.originalRepoUrl;if(!r)return!1;let n=hm({version:"v2",originalRepoUrl:r,commitHash:e});return this.#ie!==n}async uploadBackup(e=!1){try{await this.waitUntilBlockingPendingPromises(),await this.#W();let r=this.#m,n=this.#T;if(!this.#s)throw new Error("Cannot upload backup in non-git mode");if(this.#i.length>1)throw new Error("Backups not supported for multi-repo setups");if(!r)throw new Error("Project ID is required for backup upload");if(!n)throw new Error("Branch ID is required for backup upload");let i=this.getAiBranch(),o=this.getFeatureBranch(),s=await this.#We(()=>l0({sys:this.#e,credentials:this.#a,projectId:r,branchName:n,repoPath:this.#d,aiBranch:i,featureBranch:o,workspace:this.#A,debug:this.#n,isConnectedToProvider:!0,forcedFullBackup:e,canAbortMerge:this.#pe}));return s.success&&(this.#ie=s.backupRef),s}catch(r){if(console.error("Failed to upload backup",r),this.#ie=void 0,this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-backup",backupError:""}}),r instanceof Error&&r.message.includes("Commit(s) not found on remote"))throw r instanceof Error?r:new Error(String(r));return{success:!1,error:r instanceof Error?r:new Error(String(r))}}}getCommitMode(){return this.#t?.commitMode??"prs"}#z(e){return this.getCommitMode()==="commits"?`${e?.branchName||this.getFeatureBranch()}`:`${this.getAiBranch()}`}async#pt(e,r){let n=this.getCommitMode(),i=this.#z(r),o=await this.getCurrentBranch(r?.path);return n==="commits"?["push","--no-verify","--set-upstream",...e?["-f"]:[],"origin",`${o}:${i}`]:["push","--no-verify","--set-upstream",...e?["-f"]:[],"origin",i]}async#dt(){try{let e=this.getSessionContext(),r=Array.from(this.#ve);if(this.#ve.clear(),r.length===0||!e.prettierConfig||this.#xe)return!1;for(let n of r){let i=await this.#e.readFile(n);if(!i)continue;let o=await _o(this.#u,i,void 0,n);await this.#e.writeFile(n,o)}if(this.#s){if(await this.isCleanWorkTree())return!1;await this.manualCommit({add:".",commitMessage:"Prettier format pending files"})}return!0}catch(e){return this.#e.Sentry?.captureException(new Error("Failed to format pending files",{cause:e})),!1}}async pushChanges(e){return this.#M(this.#Ee(e),!0)}async#Ee(e){let{pullFirst:r,updateRepo:n,actor:i,refreshRemote:o,forcePush:s,folderName:a,requireFastForward:A,abortOnMergeConflict:c}=WZ(e);try{if(!this.#s)throw new Error("Can not push changes in non-git mode");if(this.#t?.isFork)throw new Error("Cannot push changes to fork PRs. Fork PRs are read-only. You can only review and validate changes locally.");if(n){let p=this.#A?.folders.find(f=>f.enableGit);p&&(p.repoName=n.repoFullName,p.originalRepoUrl=n.repoUrl)}if(o||n){let p=await this.#$e();if(!p.success)throw p.error}let u=a?this.#i.find(p=>p.folderName===a):this.#i[0];if(!u)throw new Error(a?`Folder "${a}" not found in workspace`:"No git repos configured");if(A&&await this.#ft(u),r){let p=await this.#Ct({requestRefresh:!1,abortOnMergeConflict:c,ctx:u});if(!p.success)throw p.error??new Error(p.message)}if((await this.#R(u.path)).length>0)throw new Error(`Merge conflict detected in ${u.folderName}, please resolve before pushing`);await this.#dt();let g=await this.#pt(s??!1,u);await this.git(g,{cwd:u.path});let d=await this.emitGitStatus();return await this.#_({lastCommit:d?.currentCommit}),this.queueGitStatusReminder({trigger:"push-success",pushedToRemote:!0}),{success:!0}}catch(u){this.#e.Sentry?.captureException(u,{tags:{operation:"codegen-git",endpoint:"pushChanges",actor:i},extra:{pullFirst:r,forcePush:s,requireFastForward:A,abortOnMergeConflict:c,commitMode:this.getCommitMode(),updateRepo:n,refreshRemote:o}});let l=Ml(u);return{success:!1,message:l,error:u instanceof Error?u:new Error(l)}}}async#ft(e){let r=this.#z(e);await this.git(["fetch","origin",r],{cwd:e.path});let i=this.getCommitMode()==="commits"?await this.getCurrentBranch(e.path):r;try{await this.git(["merge-base","--is-ancestor",`origin/${r}`,i],{cwd:e.path})}catch{throw new Error("[GIT_PUSH_ERROR] Cannot push: remote has diverged from local branch. Fast-forward push is not possible. Please pull the latest changes first or use a different push mode.")}}async#Ct(e){if(e?.abortOnMergeConflict){let n=e.ctx??this.#i[0];if(!n)return{success:!1,message:"No git repos configured",error:new Error("No git repos configured")};try{let i=this.#z(n);await this.git(["fetch","origin",i],{cwd:n.path});try{await this.git(["merge",`origin/${i}`],{cwd:n.path})}catch(o){if((await this.#R(n.path)).length>0){try{await this.git(["merge","--abort"],{cwd:n.path})}catch(a){this.#e.Sentry?.captureException(a,{tags:{operation:"codegen-git",endpoint:"pullLatestFromRemote-abort-merge-conflict"}})}throw new Error("[GIT_PUSH_ERROR] Cannot push: merge conflict detected when pulling latest changes. The merge has been aborted. Please resolve conflicts manually.")}throw o}return{success:!0}}catch(i){this.#e.Sentry?.captureException(i,{tags:{operation:"codegen-git",endpoint:"pullLatestFromRemote"}});let o=Ml(i);return{success:!1,message:o,error:i instanceof Error?i:new Error(o)}}}return await this.#M(this.#Ve({branches:[],allowUnrelatedHistory:!1,canPush:!1,uncommittedChanges:"commit",fastForward:"auto",requestRefresh:e?.requestRefresh??!0,syncRemoteBranch:!0}),!0)}async abortMerge(e=!0){try{let r=await this.#N(async n=>{try{return await this.git(["merge","--abort"],{cwd:n.path}),!0}catch{return!1}});return e&&r.results.some(n=>n.result===!0)&&(await this.emitGitStatus(),await this.#Ae(),this.requestRefresh()),r.success?{success:!0,message:"Merge aborted"}:{success:!1,message:`Failed to abort merge in: ${r.results.filter(i=>!i.success).map(i=>i.folderName).join(", ")}`,error:new Error("Merge abort failed in some repositories")}}catch(r){await this.emitGitStatus();let n=Ml(r);return{success:!1,message:n,error:r instanceof Error?r:new Error(n)}}}async syncChangesFromRemote(e){let r=[],n=e?.remoteBranches??"both";return n==="both"?r.push(this.getAiBranch(),this.getFeatureBranch()):n==="main"?r.push(this.getFeatureBranch()):n==="ai"&&r.push(this.getAiBranch()),await this.#M(this.#Ve({branches:r,allowUnrelatedHistory:e?.allowUnrelatedHistory??!0,canPush:e?.canPush??!1,uncommittedChanges:e?.uncommittedChanges??"commit",requestRefresh:e?.requestRefresh,fastForward:e?.fastForward??"auto"}),!0)}async#R(e){try{return(await this.git(["--no-pager","diff","--name-only","--diff-filter=U"],{cwd:e})).trim().split(`
|
|
1873
|
+
`)}(r==="all"||r==="critical"&&!Q)&&this.queueSystemReminder({text:nm(D,2e3),tag:n});let F={devServerState:c,setupState:s,httpServerState:p,proxyServer:d,devCommand:A,setupCommand:l,hasMergeConflict:a.length>0,hasConfigurationIssue:Q,logs:E,prompt:"Debug and fix the issue before continuing.",message:w},K=this.#c.length===0&&N$e.includes(o.state);return{actionButtonText:S,type:"build-error",level:b,canAutoApply:K,healthStatus:F,message:F.message,userMessage:{userPrompt:F.prompt,repair:!0,category:k,displayPrompt:F.message}}}}async#At(e,r){let n=await this.#ke(!1,"critical"),i=!!(n&&!n.healthStatus.hasConfigurationIssue),o=e;return i?(o++,this.#r?.addCheckpoint()):r&&(o=0),{hasHealthIssue:i,newCount:o}}async#ct(){let e;if(this.#s)try{if(L.info("\u{1F504} Initializing Fusion session for AI side-car branch workflow..."),e=await this.#e.getRepoInfo(this.#d),!e.hasGit)if(this.#Ge){L.warn("\u{1F6E0}\uFE0F No git repository detected. Initializing a new git repository...");try{await this.git(["init"]),await this.git(["add","."]),await this.git(["branch","-M","main"]),await this.git(["commit","--allow-empty","--quiet","--no-verify","--no-gpg-sign","-m","Initial commit for Fusion workflow"]),L.info("\u2705 Successfully initialized a new git repository")}catch(r){console.error("\u274C Failed to initialize git repository:",r);return}}else{L.error("\u274C Error: Not in a git repository. Fusion requires a git repository.");return}return await f0({sys:this.#e,gitWorkingDirectory:this.#d,strict:!0})}catch(r){L.error(`\u274C Error initializing Fusion session: ${r}`);let n=new Error("Initialize Git failed",{cause:r});throw this.#e.Sentry?.captureException(n,{level:"fatal",tags:{operation:"codegen-initialize-session"},extra:{repoInfo:e}}),n}}async#ut(e,r){try{await this.git(["checkout",e],{cwd:r})}catch{await this.git(["checkout","-b",e],{cwd:r})}}async#lt(e){if(!this.#s)return;if(!this.#X){let o=Rte(this.getFeatureBranch(),e.sessionId);this.#X=o}let r=this.getAiBranch();await this.#N(async o=>{await this.getCurrentBranch(o.path)!==r&&await this.#ut(r,o.path);try{await this.git(["branch","--set-upstream-to",`refs/remotes/origin/${this.#W(o)}`],{cwd:o.path})}catch{}});let n=Za(e.turns),i=n?.afterCommit??n?.lastCommit;if(i){let o=await this.getCurrentCommitHash();o!==i&&this.#e.Sentry?.captureException(new Error("Init: After commit mismatch"),{tags:{operation:"codegen-initialize-session"},extra:{sessionId:e.sessionId,targetCommit:i,lastTurn:n,currentCommitHash:o}})}if(e.beforeCommit)try{await this.git(["rev-parse","--quiet","--verify",e.beforeCommit])}catch(o){this.#e.Sentry?.captureException(new Error("Init: Before commit not found",{cause:o}),{tags:{operation:"codegen-initialize-session"},extra:{sessionId:e.sessionId,beforeCommit:e.beforeCommit,turnStates:e.turns.length,lastCompletionId:Za(e.turns)?.completionId}})}}async#gt(e,r){let n;try{n=(await this.git(["remote","get-url","origin"],r)).trim()}catch{}let{url:i,token:o,provider:s}=e;try{new URL(i)}catch{throw this.#e.Sentry?.captureException(new Error("Provided remote url is invalid"),{tags:{operation:"codegen-git"},extra:{url:i,currentOriginUrl:n}}),new Error("Provided remote url is invalid")}n!==i&&(this.#ie=void 0,n?await this.git(["remote","set-url","origin",i],r):await this.git(["remote","add","origin",i],r),s==="github"&&o&&(process.env.GH_TOKEN=o))}async pushRepoV2(e){return await this.#M(this.#Be({pullFirst:!1,updateRepo:e,refreshRemote:!0}),!0)}async#$e(){let e;try{let r=this.gitEnabledFolders;if(r.length===0)throw new Error("No git-enabled repos found");let n=r.filter(o=>!o.initializationCommand&&!o.repoUrl?.startsWith("ssh://"));if(n.length===0)return{success:!0,message:"Git remote URLs update not needed"};if(!this.#m)throw new Error("Project ID is required to update git URLs");let i=await xd(this.#a,this.#m);if(!i.success)throw i.error;e=i.gitConfigs;for(let o of n){if(!o.repoName)continue;let s=e?.[o.repoName];if(s?.url){let a=this.#e.resolve(this.#u,o.path);await this.#gt(s,a)}}return await this.emitGitStatus(),{success:!0,message:"Git remote URLs updated"}}catch(r){let n=`Failed to update git remote URLs: ${Ml(r)}`;return this.#n&&console.error(n),this.#o.emit("step",{type:"error",message:n,code:"git-update-error"}),this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-git",endpoint:"updateGitUrls"},extra:{projectId:this.#m,workspaceFolders:this.#A?.folders,gitConfigs:e}}),{success:!1,message:n,error:r instanceof Error?r:new Error(n)}}}async zipFolder(e){let{resolvedPath:r}=this.resolveWorkspacePath(e,!1),n=Date.now(),i=Math.random().toString(36).substring(2,8),o=`zip-${n}-${i}.zip`,s="/tmp",a=this.#e.join(s,o);return gg.default.mkdirSync(s,{recursive:!0}),await jA("zip",["-r",a,".","-x","**/node_modules/**"],{cwd:r,debug:this.#n,sys:this.#e}),a}async archiveProject(){if(!this.#s)throw new Error("Can not archive project in non git mode");try{let e=Date.now(),r=Math.random().toString(36).substring(2,8),n=`project-${e}-${r}.zip`,i="/tmp",o=this.#e.join(i,n);return gg.default.mkdirSync(i,{recursive:!0}),await this.git(["archive","--format=zip","-o",o,"HEAD"]),o}catch(e){throw new Error("Failed to archive project",{cause:e})}}isIdle(){let e=this.getSessionContext(),r=["generating","replay"];return!this.#$&&!r.includes(e.state)&&this.#z.length===0}async needsBackup(){if(!this.#s||this.#i.length>1||!this.#m||!this.#T)return!1;let e=await this.getCurrentCommitHash();if(!e)return!1;let r=this.gitEnabledFolder?.originalRepoUrl;if(!r)return!1;let n=hm({version:"v2",originalRepoUrl:r,commitHash:e});return this.#ie!==n}async uploadBackup(e=!1){try{await this.waitUntilBlockingPendingPromises(),await this.#U();let r=this.#m,n=this.#T;if(!this.#s)throw new Error("Cannot upload backup in non-git mode");if(this.#i.length>1)throw new Error("Backups not supported for multi-repo setups");if(!r)throw new Error("Project ID is required for backup upload");if(!n)throw new Error("Branch ID is required for backup upload");let i=this.getAiBranch(),o=this.getFeatureBranch(),s=await this.#We(()=>l0({sys:this.#e,credentials:this.#a,projectId:r,branchName:n,repoPath:this.#d,aiBranch:i,featureBranch:o,workspace:this.#A,debug:this.#n,isConnectedToProvider:!0,forcedFullBackup:e,canAbortMerge:this.#pe}));return s.success&&(this.#ie=s.backupRef),s}catch(r){if(console.error("Failed to upload backup",r),this.#ie=void 0,this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-backup",backupError:""}}),r instanceof Error&&r.message.includes("Commit(s) not found on remote"))throw r instanceof Error?r:new Error(String(r));return{success:!1,error:r instanceof Error?r:new Error(String(r))}}}getCommitMode(){return this.#t?.commitMode??"prs"}#W(e){return this.getCommitMode()==="commits"?`${e?.branchName||this.getFeatureBranch()}`:`${this.getAiBranch()}`}async#pt(e,r){let n=this.getCommitMode(),i=this.#W(r),o=await this.getCurrentBranch(r?.path);return n==="commits"?["push","--no-verify","--set-upstream",...e?["-f"]:[],"origin",`${o}:${i}`]:["push","--no-verify","--set-upstream",...e?["-f"]:[],"origin",i]}async#dt(){try{let e=this.getSessionContext(),r=Array.from(this.#xe);if(this.#xe.clear(),r.length===0||!e.prettierConfig||this.#me)return!1;for(let n of r){let i=await this.#e.readFile(n);if(!i)continue;let o=await _o(this.#u,i,void 0,n);await this.#e.writeFile(n,o)}if(this.#s){if(await this.isCleanWorkTree())return!1;await this.manualCommit({add:".",commitMessage:"Prettier format pending files"})}return!0}catch(e){return this.#e.Sentry?.captureException(new Error("Failed to format pending files",{cause:e})),!1}}async pushChanges(e){return this.#M(this.#Be(e),!0)}async#Be(e){let{pullFirst:r,updateRepo:n,actor:i,refreshRemote:o,forcePush:s,folderName:a,requireFastForward:A,abortOnMergeConflict:c}=WZ(e);try{if(!this.#s)throw new Error("Can not push changes in non-git mode");if(this.#t?.isFork)throw new Error("Cannot push changes to fork PRs. Fork PRs are read-only. You can only review and validate changes locally.");if(n){let p=this.#A?.folders.find(f=>f.enableGit);p&&(p.repoName=n.repoFullName,p.originalRepoUrl=n.repoUrl)}if(o||n){let p=await this.#$e();if(!p.success)throw p.error}let u=a?this.#i.find(p=>p.folderName===a):this.#i[0];if(!u)throw new Error(a?`Folder "${a}" not found in workspace`:"No git repos configured");if(A&&await this.#ft(u),r){let p=await this.#Ct({requestRefresh:!1,abortOnMergeConflict:c,ctx:u});if(!p.success)throw p.error??new Error(p.message)}if((await this.#R(u.path)).length>0)throw new Error(`Merge conflict detected in ${u.folderName}, please resolve before pushing`);await this.#dt();let g=await this.#pt(s??!1,u);await this.git(g,{cwd:u.path});let d=await this.emitGitStatus();return await this.#_({lastCommit:d?.currentCommit}),this.queueGitStatusReminder({trigger:"push-success",pushedToRemote:!0}),{success:!0}}catch(u){this.#e.Sentry?.captureException(u,{tags:{operation:"codegen-git",endpoint:"pushChanges",actor:i},extra:{pullFirst:r,forcePush:s,requireFastForward:A,abortOnMergeConflict:c,commitMode:this.getCommitMode(),updateRepo:n,refreshRemote:o}});let l=Ml(u);return{success:!1,message:l,error:u instanceof Error?u:new Error(l)}}}async#ft(e){let r=this.#W(e);await this.git(["fetch","origin",r],{cwd:e.path});let i=this.getCommitMode()==="commits"?await this.getCurrentBranch(e.path):r;try{await this.git(["merge-base","--is-ancestor",`origin/${r}`,i],{cwd:e.path})}catch{throw new Error("[GIT_PUSH_ERROR] Cannot push: remote has diverged from local branch. Fast-forward push is not possible. Please pull the latest changes first or use a different push mode.")}}async#Ct(e){if(e?.abortOnMergeConflict){let n=e.ctx??this.#i[0];if(!n)return{success:!1,message:"No git repos configured",error:new Error("No git repos configured")};try{let i=this.#W(n);await this.git(["fetch","origin",i],{cwd:n.path});try{await this.git(["merge",`origin/${i}`],{cwd:n.path})}catch(o){if((await this.#R(n.path)).length>0){try{await this.git(["merge","--abort"],{cwd:n.path})}catch(a){this.#e.Sentry?.captureException(a,{tags:{operation:"codegen-git",endpoint:"pullLatestFromRemote-abort-merge-conflict"}})}throw new Error("[GIT_PUSH_ERROR] Cannot push: merge conflict detected when pulling latest changes. The merge has been aborted. Please resolve conflicts manually.")}throw o}return{success:!0}}catch(i){this.#e.Sentry?.captureException(i,{tags:{operation:"codegen-git",endpoint:"pullLatestFromRemote"}});let o=Ml(i);return{success:!1,message:o,error:i instanceof Error?i:new Error(o)}}}return await this.#M(this.#Ve({branches:[],allowUnrelatedHistory:!1,canPush:!1,uncommittedChanges:"commit",fastForward:"auto",requestRefresh:e?.requestRefresh??!0,syncRemoteBranch:!0}),!0)}async abortMerge(e=!0){try{let r=await this.#N(async n=>{try{return await this.git(["merge","--abort"],{cwd:n.path}),!0}catch{return!1}});return e&&r.results.some(n=>n.result===!0)&&(await this.emitGitStatus(),await this.#Ae(),this.requestRefresh()),r.success?{success:!0,message:"Merge aborted"}:{success:!1,message:`Failed to abort merge in: ${r.results.filter(i=>!i.success).map(i=>i.folderName).join(", ")}`,error:new Error("Merge abort failed in some repositories")}}catch(r){await this.emitGitStatus();let n=Ml(r);return{success:!1,message:n,error:r instanceof Error?r:new Error(n)}}}async syncChangesFromRemote(e){let r=[],n=e?.remoteBranches??"both";return n==="both"?r.push(this.getAiBranch(),this.getFeatureBranch()):n==="main"?r.push(this.getFeatureBranch()):n==="ai"&&r.push(this.getAiBranch()),await this.#M(this.#Ve({branches:r,allowUnrelatedHistory:e?.allowUnrelatedHistory??!0,canPush:e?.canPush??!1,uncommittedChanges:e?.uncommittedChanges??"commit",requestRefresh:e?.requestRefresh,fastForward:e?.fastForward??"auto"}),!0)}async#R(e){try{return(await this.git(["--no-pager","diff","--name-only","--diff-filter=U"],{cwd:e})).trim().split(`
|
|
1874
1874
|
`).filter(i=>i.length>0)}catch{return[]}}async#qe(){return(await this.#N(async r=>{let n=await this.#R(r.path);return this.#D()?n:n.map(i=>this.#e.join(r.path,i))})).results.flatMap(r=>r.success?r.result??[]:[])}async#ht(e){let r=n=>n.split(`
|
|
1875
|
-
`).map(i=>i.trim()).filter(i=>i.length>0).slice(0,20);try{let n=this.#
|
|
1875
|
+
`).map(i=>i.trim()).filter(i=>i.length>0).slice(0,20);try{let n=this.#K||"main",i=await this.git(["log",n,"-n","20","--format=%s"],{cwd:e});return r(i)}catch{try{let n=await this.git(["log","-n","20","--format=%s"],{cwd:e});return r(n)}catch{return[]}}}async#Ve({branches:e,allowUnrelatedHistory:r,canPush:n,fastForward:i,uncommittedChanges:o,requestRefresh:s=!1,syncRemoteBranch:a=!1}){try{if(!this.#s)throw new Error("Can not pull changes in non-git mode");if(!a&&!e.length)throw new Error("At least one branch name is required");let A=this.getAiBranch(),c=this.getFeatureBranch();await this.#U();let l=(await this.#N(async g=>{let d=g.path,p;a?p=[this.#W(g)]:p=e.map(B=>B===c?g.branchName:B);let f=await this.getCurrentBranch(d);if(f!==A)throw new Error(`Repo ${g.folderName} not on AI branch: ${f} != ${A}`);let h=await this.#R(d);if(h.length>0)throw new Error(`Merge conflict in ${g.folderName}:
|
|
1876
1876
|
${h.join(`
|
|
1877
1877
|
`)}`);if(!await this.isCleanWorkTree(d))switch(o){case"stash":await this.git(["stash","--include-untracked"],{cwd:d});break;case"commit":await this.git(["add","-A","."],{cwd:d}),await this.git(["commit","--no-gpg-sign","-m","Commit unstaged changes"],{cwd:d});break;default:throw new Error(`Uncommitted changes in ${g.folderName}`)}await this.git(["fetch","origin","--prune"],{cwd:d});let I=await this.git(["for-each-ref","refs/remotes/origin"],{cwd:d}),E=p.filter(B=>I.includes(`refs/remotes/origin/${B}`));for(let B of E){B!==A&&!B.startsWith("ai_")&&await this.git(["update-ref",`refs/heads/${B}`,`refs/remotes/origin/${B}`],{cwd:d}),await this.git(["merge",...i==="never"?["--no-ff"]:[],...i==="required"?["--ff-only"]:[],...i==="auto"?["--ff"]:[],...r?["--allow-unrelated-histories"]:[],`refs/remotes/origin/${B}`],{cwd:d});let Q=await this.#R(d);if(Q.length>0)throw new Error(`Merge conflict in ${g.folderName} after merging ${B}:
|
|
1878
1878
|
${Q.join(`
|
|
1879
|
-
`)}`)}})).results.filter(g=>!g.success||g.error);if(l.length>0){let g=l.map(d=>d.error?.message||`${d.folderName} failed`).join("; ");throw new Error(`Sync failed: ${g}`)}if(n){let g=await this.#
|
|
1879
|
+
`)}`)}})).results.filter(g=>!g.success||g.error);if(l.length>0){let g=l.map(d=>d.error?.message||`${d.folderName} failed`).join("; ");throw new Error(`Sync failed: ${g}`)}if(n){let g=await this.#Be(!1);if(!g.success)throw g.error}else{let g=await this.emitGitStatus();this.#k=g?.currentCommit,await this.#_({lastCommit:g?.currentCommit}),this.queueGitStatusReminder({trigger:"pull-success",syncedBranches:e})}return s&&this.requestRefresh(),{success:!0,message:`Successfully merged ${e.join(", ")} in all repos`}}catch(A){let c=await this.emitGitStatus();this.#k=c?.currentCommit,this.#e.Sentry?.captureException(A,{tags:{operation:"codegen-git",endpoint:"syncChangesFromBranches"},extra:{branches:e,allowUnrelatedHistory:r}});let u=Ml(A);return{success:!1,message:u,error:A instanceof Error?A:new Error(u)}}}async getCurrentCommitHash(e="HEAD",r){if(this.#s)try{let n=["rev-parse",e];return(await this.git(n,{sys:this.#e,cwd:r})).trim()}catch{return}}async getCurrentBranch(e){return(await this.git(["branch","--show-current"],{cwd:e})).trim()}getFeatureBranch(){if(!this.#K)throw new Error("Feature branch is missing");return this.#K}getAiBranch(){if(!this.#X)throw new Error("AI branch is missing");return this.#X}async git(e,r){if(!this.#s)throw new Error("Can not execute git command in non-git mode.");let n=e[0],i=n==="push"||n==="fetch"||n==="pull",o=Date.now(),s=o-this.#He,A=1e3*60;i&&s>10*A&&(this.#He=o,await this.#$e());let c=typeof r=="object"?{sys:this.#e,...r}:r;return await this.#We(()=>this.#It(e,c))}async#N(e){if(this.#i.length===0)return{success:!0,partialSuccess:!1,results:[]};let n=(await Promise.allSettled(this.#i.map(s=>e(s)))).map((s,a)=>({folderName:this.#i[a].folderName,success:s.status==="fulfilled",result:s.status==="fulfilled"?s.value:void 0,error:s.status==="rejected"?s.reason:void 0,message:s.status==="rejected"?s.reason?.message:void 0})),i=n.filter(s=>s.success),o=n.filter(s=>!s.success);return{success:o.length===0,partialSuccess:i.length>0&&o.length>0,results:n}}#ze(e){let r=zo(e),n=this.#i.find(a=>{let A=zo(a.folderName);return r.startsWith(A+"/")||r===A});if(n)return n;let i=e.startsWith("/")||e.includes(":")?e:this.#e.resolve(this.#u,e),o=zo(i);return this.#i.find(a=>{let A=zo(a.path);return o.startsWith(A+"/")||o===A})}#mt(e){let r=new Map;for(let n of e){let i=this.#ze(n);if(i){let o=r.get(i.folderName)||[];o.push(n),r.set(i.folderName,o)}}return r}#We(e){let r=this.#_e.then(()=>e());return this.#_e=r.catch(()=>{}),r}async#It(e,r){if(!this.#s)throw new Error(`Can not execute git command in non-git mode: git ${e.join(" ")}`);let n=`git ${e.join(" ")}`;this.#$&&this.#e.Sentry?.captureException(new Error(`currentGitCommand is not finished yet. Current command: ${this.#$}, New command Received: ${n}`),{tags:{operation:"codegen-git"},extra:{oldCommand:this.#$,newCommand:n}});try{this.#$=n;let i=typeof r=="object"?r:void 0,o=typeof r=="string"?r:i?.cwd??this.#d;return await jA("git",e,{...i,cwd:o,debug:this.#n,sys:this.#e,timeout:60*1e3})}finally{this.#$=void 0}}setDebug(e){this.#n=e}async createTerminal(e){let r=this.#r,n=e?.terminalId||`pty_${Date.now()}_${(0,nb.randomUUID)()}`,i=this.#Re().find(E=>E.terminalId===n),o=new Set,s=new Set;if(i&&e?.terminalId){if(!e?.force)return i;let E=this.#p.get(e.terminalId);if(!E)return i;E.onDataListeners.forEach(B=>{o.add(B)}),E.onExitListeners.forEach(B=>{s.add(B)}),this.disposeTerminal({terminalId:n,emitTerminals:!1})}let a=e?.shell||(process.platform==="win32"?"powershell.exe":process.env.SHELL||"/bin/bash"),A=e?.cols??120,c=e?.rows??30,u={...process.env,...r?.envVars,...e?.env};e?.inheritCredentials&&(u.BUILDER_USER_ID=e.createdBy??this.#a.userId,u.BUILDER_PUBLIC_KEY=this.#a.builderPublicKey,u.BUILDER_PRIVATE_KEY=this.#a.builderPrivateKey);let l=[],g=E=>{for(let B of o)B(E)},d=({exitCode:E,error:B})=>{let Q=this.#p.get(n);Q&&(Q.state=B?"error":"exited",Q.exitCode=E);for(let w of s)w(E);this.#p.delete(n),l.forEach(w=>w())},p=e?.cwd||this.#h,f,h;if(e?.readonly){f="starting";let E=sa(a,e?.initialCommand??"true",{cwd:p,env:u,stdio:["ignore","pipe","pipe"]});E.on("spawn",()=>{let B=this.#p.get(n);B&&(B.state="running")}),E.stdout.on("data",B=>{g(B.toString())}),E.stderr.on("data",B=>{g(B.toString())}),E.on("error",B=>{d({exitCode:1,error:B})}),E.on("exit",B=>{d({exitCode:B??0})}),l.push(()=>{try{E.removeAllListeners()}catch{}E.kill()}),h=E}else{f="running";let E=C1(this.#e);if(!E)throw new Error("Could not import node-pty");let B=a.includes("bash")||a.includes("zsh"),Q=a.includes("zsh")?"%~ $ ":"\\w $ ",w=E.spawn(a,[],{name:"xterm-color",cwd:p,cols:A,rows:c,env:B?{...u,PS1:Q}:u}),D=w.onData(g);l.push(()=>{try{D?.dispose?.()}catch{}});let b=w.onExit(d);l.push(()=>{try{b?.dispose?.()}catch{}});let S=e?.initialCommand;S&&(S.endsWith(`
|
|
1880
1880
|
`)||(S+=`
|
|
1881
1881
|
`),w.write(S)),h=w}let m=Date.now(),I={terminalId:n,title:e?.title||`Terminal ${this.#p.size+1}`,cwd:p,createdAt:m,lastWrittenAt:m,createdBy:e?.createdBy||"unknown",readonly:e?.readonly??!1,initialCommand:e?.initialCommand,builtIn:!1,state:f,exitCode:void 0};return this.#p.set(n,{...I,pty:h,onDataListeners:o,onExitListeners:s,disposeFns:l,env:e?.env,shell:a,inheritCredentials:e?.inheritCredentials}),(e?.emitTerminals??!0)&&this.emitTerminals(),I}#Re(){let e=this.getSessionContext(),r=Array.from(this.#p.values()).map(o=>({terminalId:o.terminalId,title:o.title,cwd:o.cwd,createdAt:o.createdAt,lastWrittenAt:o.lastWrittenAt,createdBy:o.createdBy,readonly:o.readonly,builtIn:o.builtIn,exitCode:o.exitCode,state:o.state})),n=[];this.#C?.includes("Bash")&&n.push({terminalId:"bash-tools",title:"Bash",cwd:this.#h,createdAt:e.createdUnixTime,lastWrittenAt:Date.now(),createdBy:"fusion",readonly:!0,builtIn:!0,exitCode:void 0,state:"running"});let i=this.#r;if(i){let o=Date.now();if(i.devState!=="unset"&&n.push({terminalId:"dev-command",title:"Dev Command",cwd:this.#h,createdAt:e.createdUnixTime,lastWrittenAt:o,createdBy:"fusion",readonly:!i.devCommandProcess?.write,builtIn:!0,state:i.devState==="running"?"running":"exited",exitCode:void 0}),i.setupCommand&&n.push({terminalId:"setup-command",title:"Setup Command",cwd:this.#h,createdAt:e.createdUnixTime,lastWrittenAt:o,createdBy:"fusion",readonly:!0,builtIn:!0,state:i.setupState==="installing"?"running":"exited",exitCode:void 0}),i.validateCommandState!=="unset"){let s;switch(i.validateCommandState){case"running":s="running";break;case"success":s="exited";break;case"failure":s="error";break;case"stopped":s="exited";break}n.unshift({terminalId:"validate-command",title:"Validate Command",cwd:this.#h,createdAt:e.createdUnixTime,lastWrittenAt:o,createdBy:"fusion",readonly:!0,builtIn:!0,state:s,exitCode:void 0})}}return n.push(...r),n}emitTerminals(){this.#o.emit("step",{type:"terminals",terminals:this.#Re()})}updateTerminal({terminalId:e,cols:r,rows:n,title:i}){if(e==="dev-command"){if(r||n){let s=this.#r;if(s?.devCommandProcess?.resize)return s.devCommandProcess.resize(r,n),!0}return!1}let o=this.#p.get(e);return o?("resize"in o.pty&&(r||n)&&o.pty.resize(r??o.pty.cols,n??o.pty.rows),i&&(o.title=i,this.emitTerminals()),!0):!1}writeTerminal({terminalId:e,data:r}){if(e==="dev-command"){let i=this.#r;return i?.devCommandProcess?.write?(i.devCommandProcess.write(r),!0):!1}let n=this.#p.get(e);return!n||n.readonly?!1:("write"in n.pty&&n.pty.write(r),n.lastWrittenAt=Date.now(),!0)}signalTerminal({terminalId:e,signal:r}){if(e==="dev-command"){let i=this.#r;return i?.devCommandProcess?.kill?(i.devCommandProcess.kill(r),!0):!1}let n=this.#p.get(e);if(!n||n.readonly)return!1;try{"write"in n.pty?process.platform==="win32"?n.pty.kill():(r==="SIGINT"&&n.pty.write(""),n.pty.kill(r)):n.pty.kill(r)}catch{}return!0}disposeTerminal({terminalId:e,emitTerminals:r=!0}){let n=this.#p.get(e);if(!n)return!1;try{n.pty.kill()}catch{}return n.disposeFns.forEach(i=>{try{i()}catch{}}),n.onDataListeners.clear(),n.onExitListeners.clear(),n.disposeFns=[],this.#p.delete(e),r&&this.emitTerminals(),!0}async restartTerminal({terminalId:e}){if(e==="dev-command"){let i=this.#r;if(i)try{return await i.restart(),!0}catch(o){return this.#e.Sentry?.captureException(o),!1}return!1}if(e==="setup-command"){let i=this.#r;if(i)try{return await i.runSetupCommand(),!0}catch(o){return this.#e.Sentry?.captureException(o),!1}return!1}if(e==="validate-command"){if(this.#r)try{return await this.#tt(),!0}catch(o){return this.#e.Sentry?.captureException(o),!1}return!1}if(e==="bash-tools")return!1;let r=this.#p.get(e);return r?(await this.createTerminal({terminalId:e,title:r.title,cwd:r.cwd,env:r.env,shell:r.shell,cols:"cols"in r.pty?r.pty.cols:void 0,rows:"rows"in r.pty?r.pty.rows:void 0,createdBy:r.createdBy,emitTerminals:!1,initialCommand:r.initialCommand,readonly:r.readonly,inheritCredentials:r.inheritCredentials,force:!0}),this.#p.get(e)?(this.emitTerminals(),!0):!1):!1}subscribeTerminal({terminalId:e,onData:r,onExit:n}){if(e==="dev-command"){let i=this.#r;if(i){let o=i.getDevWrite();return o&&r(o),i.emitter.on("stdout",r),i.emitter.on("stderr",r),()=>{i.emitter.off("stdout",r),i.emitter.off("stderr",r)}}}else if(e==="setup-command"){let i=this.#r;if(i){let o=i.getSetupOutput();return o&&r(o),i.emitter.on("installStdout",r),i.emitter.on("installStderr",r),()=>{i.emitter.off("installStdout",r),i.emitter.off("installStderr",r)}}}else if(e==="validate-command"){let i=this.#r;if(i){let o=i.getValidateOutput();return o&&r(o),i.emitter.on("validateStdout",r),i.emitter.on("validateStderr",r),()=>{i.emitter.off("validateStdout",r),i.emitter.off("validateStderr",r)}}}else if(e==="bash-tools"){let i=o=>{o.type==="stdio"&&o.source==="tool-command"&&r(o.content)};return this.#o.on("step",i),()=>{this.#o.off("step",i)}}else{let i=this.#p.get(e);if(!i)throw new Error("Terminal not found");return i.onDataListeners.add(r),n&&i.onExitListeners.add(n),()=>{i.onDataListeners.delete(r),n&&i.onExitListeners.delete(n)}}}async getAllFiles(e={}){let{getDotFiles:r=!1,globbyPattern:n="**/*",includePattern:i,gitignore:o,deep:s,truncate:a,maxFiles:A=5e4,onlyFiles:c=!0}=e,u=this.#t?.accessControl,l=u?.entries?.filter(f=>f.action==="allow"&&f.permissions.includes("list")).map(f=>(f.resource.startsWith("/")?f.resource.slice(1):f.resource)||".")??[];if(!this.#A?.folders?.length){let f=await Jl({basePath:this.#u,globPattern:[i??n,...l],extraIgnorePatterns:Ky(u).deny,dot:r,gitignore:o,sys:this.#e,deep:s,onlyFiles:c,maxFiles:A});return vT(f,a)}let g=[],d=await this.#e.readdir(this.#u);for(let f of d)gT(f)&&g.push(f);!g.includes("AGENTS.md")&&this.#A.agentsMD&&g.push("AGENTS.md");for(let f of this.#A.folders){let h=this.#e.resolve(this.#u,f.path),m=await Jl({basePath:h,globPattern:[n,...l],dot:r,gitignore:o,sys:this.#e,deep:s,onlyFiles:c,maxFiles:A}),I=this.#D()?".":f.name||this.#e.basename(h);for(let E of m)I!=="."?g.push(this.#e.join(I,E)):g.push(E)}let p=fd({files:g,policy:u,filterPattern:i,getDotFiles:r});return vT(p,a)}async searchFiles(e){let{query:r,caseInsensitive:n=!0,includeGlob:i,excludeGlob:o,maxResults:s=1e3,contextBefore:a=0,contextAfter:A=0}=e,c=await Ef(this.#e),u=["--path-separator","/","--json","--line-number","--column","--max-columns","500"];return n&&u.push("-i"),a>0&&u.push("-B",a.toString()),A>0&&u.push("-A",A.toString()),i&&u.push("--glob",i),o&&u.push("--glob",`!${o}`),u.push("--ignore-file",".builderignore"),u.push("--",r),new Promise(l=>{let g=Xa({command:c,args:u,options:{env:process.env,cwd:this.#h,stdio:["ignore","pipe","pipe"]}}),d=new Yn(5e4);g.stdout.on("data",p=>{d.write(p.toString())}),g.on("error",()=>{l({matches:[],totalMatches:0,filesWithMatches:0,truncated:!1})}),g.on("close",p=>{if(p!==0)l({matches:[],totalMatches:0,filesWithMatches:0,truncated:!1});else{let f=[],h=new Set,I=d.getContent().split(`
|
|
1882
1882
|
`),E=[],B=null;for(let w of I)if(w.trim())try{let D=JSON.parse(w);if(D.type==="match"){let b=D.data.path.text,S=D.data.line_number,k=D.data.lines.text.trimEnd(),F=D.data.submatches||[],K,z;F.length>0&&(K=F[0].start,z=F[0].end),h.add(b);let q={filePath:b,lineNumber:S,lineContent:k,columnStart:K,columnEnd:z,contextBefore:E,contextAfter:[]};if(E=[],B=q,f.push(q),f.length>=s)break}else if(D.type==="context"){let b=D.data.line_number,S=D.data.lines.text.trimEnd();B&&b>B.lineNumber?B.contextAfter.push(S):E.push(S)}}catch{continue}let Q=f.length>=s;l({matches:f,totalMatches:f.length,filesWithMatches:h.size,truncated:Q})}})})}async searchFileTree(e){let{query:r,excludeGlob:n,maxResults:i=100}=e,o=await Ef(this.#e),s=["--files","--path-separator","/"],a=this.#Qt(r);a&&s.push("--glob",a),n&&s.push("--glob",`!${n}`);let A=this.#t?.accessControl,c=Ky(A).deny;for(let l of c)s.push("--glob",`!${l}`);s.push("--ignore-file",".builderignore");let u=r.toLowerCase();return new Promise(l=>{let g=Xa({command:o,args:s,options:{env:process.env,cwd:this.#h,stdio:["ignore","pipe","pipe"]}}),d=new Yn(1e5);g.stdout.on("data",p=>{d.write(p.toString())}),g.on("error",()=>{l({matches:[],totalMatches:0,truncated:!1})}),g.on("close",p=>{if(p!==0&&p!==1){l({matches:[],totalMatches:0,truncated:!1});return}let f=d.getContent(),h=[...new Set(f.split(`
|
|
1883
|
-
`).filter(E=>E.trim()))];h=fd({files:h,policy:A,getDotFiles:!0});let m=[];for(let E of h){let B=E.lastIndexOf("/"),Q=B>=0?E.slice(B+1):E,w=B>=0?E.slice(0,B):"",D=this.#Et(u,E.toLowerCase()),b=this.#Bt(u,E,D);m.push({filePath:E,fileName:Q,parentPath:w,matchIndices:D,score:b})}m.sort((E,B)=>B.score-E.score);let I=m.slice(0,i).map(({score:E,...B})=>B);l({matches:I,totalMatches:h.length,truncated:h.length>i})})})}#Et(e,r){let n=e.toLowerCase(),i=r.toLowerCase(),o=r.lastIndexOf("/"),s=o>=0?o+1:0;if(e.includes("/")){let A=i.indexOf(n);return A>=0?Array.from({length:n.length},(c,u)=>A+u):this.#ae(n,i,0,r.length)}let a=this.#ae(n,i,s,r.length);if(a.length===n.length)return a;if(a.length>0){let A=a.length,c=n.slice(0,n.length-A),u=this.#ae(c,i,0,s);if(u.length+A===n.length){let l=n.slice(u.length),g=this.#ae(l,i,s,r.length);return[...u,...g]}}return this.#ae(n,i,0,r.length)}#ae(e,r,n,i){let o=[],s=0;for(let a=n;a<i&&s<e.length;a++){let A=e[s];r[a]===A?(o.push(a),s++):/[a-zA-Z0-9.\-_]/.test(A)||(s++,a--)}for(;s<e.length&&!/[a-zA-Z0-9.\-_]/.test(e[s]);)s++;return o}#Bt(e,r,n){if(n.length===0)return 0;let i=0,o=e.toLowerCase(),s=r.toLowerCase(),a=r.lastIndexOf("/"),A=a>=0?a+1:0,u=s.slice(A).replace(/\.[^.]+$/,"");if(u===o)i+=200;else if(u.startsWith(o)){let p=o.length/u.length;p>=.9?i+=150:p>=.7?i+=120:i+=100}else u.includes(o)&&(i+=50);let l=n.filter(p=>p>=A);if(l.length===n.length&&(i+=30),l.length>0){let p=l.length/u.length;p>=.9?i+=60:p>=.7?i+=40:p>=.5&&(i+=20)}let g=0;for(let p=1;p<n.length;p++)n[p]===n[p-1]+1&&(g+=10);i+=g;let d=new Set(["/","-","_","."]);for(let p of n)(p===0||d.has(s[p-1]))&&(i+=5);if(i+=l.length*3,n[0]===A&&(i+=20),i-=Math.floor(r.length/20),n.length>1){let p=n[n.length-1]-n[0],f=n.length-1,h=p-f;i-=Math.floor(h/5)}return i}#Qt(e){if(!e)return"";let r=e.lastIndexOf("/");if(r===-1)return"**/"+this.#Ne(e,!0)+"*";let n=e.slice(0,r),i=e.slice(r+1),o="**/",s=n.split("/");for(let a=0;a<s.length;a++){let A=s[a];A&&(o+=this.#Ne(A,!1)),o+="/**/"}return i?o+=this.#Ne(i,!0)+"*":o+="*",o}#Ne(e,r){let n="";for(let i=0;i<e.length;i++){let o=e[i];/[a-zA-Z]/.test(o)?(n+=`[${o.toLowerCase()}${o.toUpperCase()}]`,r&&(n+="*")):/[0-9]/.test(o)||o==="."||o==="-"||o==="_"?(n+=o,r&&(n+="*")):["*","?","[","]","{","}"].includes(o)?n+=`[${o}]`:n+="*"}return n}async collectRepoMetrics(e={}){let r=this.#se(e.folderName);return e.rootPath&&(r=this.#e.join(r,e.rootPath)),Ete(this.#e,r)}getSessionId(){return this.getSessionContext().sessionId}getSpaceId(){return this.#a.builderPublicKey}async revertToCommitHash(e){this.#Q=!1,await this.waitUntilBlockingPendingPromises(),await this.abortMerge(!1),await this.#W(),await this.git(["revert","--no-commit",`${e}..HEAD`]),await this.git(["commit","--allow-empty","--quiet","--no-verify","--no-gpg-sign","-m","Revert changes"]);let n=(await this.emitGitStatus())?.currentCommit;if(this.#k=n,!n){this.#e.Sentry?.captureException(new Error("Failed to get current commit hash after revert"),{tags:{operation:"codegen-git",endpoint:"revertToCommitHash"}});return}this.requestRefresh(),await this.#_({lastCommit:n})}async resetToCommitHash(e,r=!0){this.#Q=!1,await this.waitUntilBlockingPendingPromises(),await this.abortMerge(!1),await this.#W(),await this.git(["reset","--quiet","--hard",e]),await this.git(["clean","-fd"]);let i=(await this.emitGitStatus())?.currentCommit;if(this.#k=i,i!==e)throw new Error("Failed to reset commit hash");r&&this.requestRefresh()}async restore({location:e,predicate:r,revert:n=!1,dryRun:i=!1,forceReplay:o=!1,debug:s}){let a=this.getSessionContext(),A=a.turns.length,c=null;for(let p=A-1;p>=-1;p--)if(r(p>=0?a.turns[p]:null,p)){c=p;break}if(c===null)return{undone:null,message:"Could not find the target to restore to, the completion id could be wrong"};n||await this.abort({cleanCurrentMessage:!0});let u=new Map,l=!!this.#s,g=a.turns,d=Math.max(0,e==="before"?c:c+1);for(let p=g.length-1;p>=d;p--){let f=g[p];for(let h of f.applyResults)u.set(h.filePath,h.oldContent??"")}if(!i){let p;if(l){c===-1?a.beforeCommit?p=a.beforeCommit:g.length>0&&(p=g[0].beforeCommit):c<g.length&&(e==="after"?(p=g[c].afterCommit,!p&&c+1<g.length&&(p=g[c+1].beforeCommit)):p=g[c].beforeCommit);let I={commitHash:p,sessionId:a.sessionId,sessionBeforeCommit:a.beforeCommit,turnsLength:g.length,targetIndex:c,currentTurn:g[g.length-1],targetTurn:g[c],targetTurnNext:g[c+1],location:e,forceReplay:o,dryRun:i,debug:s};if(!p)return this.#e.Sentry?.captureException(new Error("No commit hash found for restore"),{tags:{operation:"codegen-git",endpoint:"revertToCommitHash"},contexts:{restore:I}}),{undone:null,message:"Could not find the target to restore to, the git history is missing"};try{n?await this.revertToCommitHash(p):await this.resetToCommitHash(p)}catch(E){return this.#e.Sentry?.captureException(new Error("Error resetting git",{cause:E}),{tags:{operation:"codegen-git",endpoint:"resetToCommitHash"},contexts:{restore:I}}),{undone:null,message:"Failed to reset/restore, the file history is missing"}}}else for(let[I,E]of u.entries())try{E?await this.writeFile(I,E):await this.deleteFile(I)}catch{}if(n)return{undone:[],message:"The revert operation was successful"};let f=g.splice(d,g.length-d),h=Za(g);h&&h?.afterCommit!==p&&(this.#e.Sentry?.captureException(new Error("Reset After commit hash mismatch"),{tags:{operation:"codegen-git",endpoint:"resetToCommitHash"},extra:{lastTurn:h,commitHash:p}}),h.lastCommit=p,await this.#_({completionId:h.completionId,lastCommit:p}));let m=h?.completionId;if(f.length>0&&(await lT(this.#e,this.#a,{lastCompletionId:m,sessionId:a.sessionId},!!this.#n),a.updatedUnixTime=Date.now()),o){let I=a.state;this.#o.emit("step",{type:"batch",steps:[{type:"state",newState:"replay",abortable:!1,previousState:I},...this.#et(),{type:"restore",files:Array.from(u.keys()),lastCompletionId:m,location:e},{type:"state",newState:I,abortable:!1,previousState:"replay"}]})}else f.length>0&&this.#o.emit("step",{type:"restore",files:Array.from(u.keys()),lastCompletionId:m,location:e})}return await this.#Ze(),{undone:Array.from(u.keys()),message:"The restore operation was successful"}}async#Ze(e){return await this.#r?.ensureDevCommand(e)}async restoreFromCompletionId({location:e,completionId:r,forceReplay:n}){let i=this.getSessionContext();return i.turns.find(s=>s.completionId===r)?this.restore({location:e,predicate:s=>s?.completionId===r,forceReplay:n,debug:`restore to: ${r}`}):(await this.#te,i.turns=[],i.canLoadMore=!0,await lT(this.#e,this.#a,{sessionId:i.sessionId,lastCompletionId:r},!!this.#n),await this.loadMoreTurns(),this.restore({location:e,predicate:()=>!0,forceReplay:!0,debug:"restore after history"}))}async restoreBeforeCompletionId(e){return this.restoreFromCompletionId({location:"before",completionId:e,forceReplay:!1})}async undoLastUserMessage(e=!1){return this.restore({location:"before",predicate:r=>r?.user.role==="user",dryRun:e})}getLastUserCompletionId(){let e=this.getSessionContext();return PZ(e)?.completionId}getLastCompletionId(){let e=this.getSessionContext();return AT(e)?.completionId}getCurrentState(){return this.getSessionContext().state}getLastApplyResultsTurn(){let e=this.getSessionContext();return LZ(e)}getLastTurn(){let e=this.getSessionContext();return AT(e)}getNextUrl(){return this.getLastTurn()?.nextUrl}async sendFeedback(e){if(process.env.NODE_ENV==="test")return;if(e.feedbackSentiment){let n=e.feedbackSentiment==="positive"?`User provided positive feedback (thumbs up) on the previous completion.${e.feedbackText??""}`:`User provided negative feedback (thumbs down) on the previous completion.${e.feedbackText??""}`;await this.queueSystemReminder({text:n,tag:"reminder:user-feedback"})}ct("quality code feedback given",{spaceId:this.#a.builderPublicKey,sentiment:e.feedbackSentiment,mode:"cli"});let r=e.id??this.getLastCompletionId();r&&await this.#Dt({...e,id:r})}#_(e){let r=e.completionId;if(!r){let i=this.getLastTurn();i&&e.lastCommit&&(i.lastCommit=e.lastCommit),r=i?.completionId}let n=cT(this.#e,this.#a,"/codegen/finalize",{completionId:r,projectId:this.#t?.projectId,branchName:this.#t?.branchName,userCompletionId:this.getLastUserCompletionId(),sessionId:this.getSessionId(),metadata:this.#F,...e});return this.#M(n)}#Dt(e){let r=cT(this.#e,this.#a,"/codegen/feedback",e);return this.#M(r)}#M(e,r=!1){return this.#V.push(e),r&&this.#Ce.push(e),e.finally(()=>{let n=this.#Ce.indexOf(e);n!==-1&&this.#Ce.splice(n,1);let i=this.#V.indexOf(e);i!==-1&&this.#V.splice(i,1)})}async lastTurnHasChanges(){let e=await this.undoLastUserMessage(!0);return e.undone?e.undone.length>0:!1}#v(e){let r=this.getSessionContext(),n=r.state;n!==e&&(r.state=e,this.#o.emit("step",{type:"state",abortable:e==="generating",previousState:n,newState:e}))}waitUntilState(e,r=1e4){return new Promise(n=>{if(this.getSessionContext().state===e){n();return}let o,s=a=>{a.type==="state"&&a.newState===e&&(clearTimeout(o),this.#o.removeListener("step",s),n())};o=setTimeout(()=>{this.#o.removeListener("step",s),n()},r),this.#o.on("step",s)})}getProxyOrigin(){let e=this.#r;return this.#de??e?.serverUrl?.origin}getProxyDestination(){return this.#q}async clearSession(){let e=this.getSessionContext();e.turns=[],e.customInstructions=await this.#me(),e.customAgents=await this.#Ie(),this.#b.length=0,this.#Q=!1,this.#F={},this.#ue=!1,this.clearMessageQueue(),this.queueGitStatusReminder({trigger:"session-start"})}async clearMessageQueue(e=!1){let r=[];if(e)for(let n of this.#c)n.user&&r.push({type:"user",displayPrompt:n.displayPrompt,user:n.user,role:n.user.role,compacting:!1,idempotencyKey:n.idempotencyKey});this.#c.length=0,this.#Me(),r.length>0&&this.#o.emit("step",{type:"batch",steps:r})}updateMessage(e){if(e.type==="delete"){let r=this.#c.findIndex(n=>n.idempotencyKey===e.idempotencyKey);r>=0&&this.#c.splice(r,1)}else if(e.type==="move"){let r=this.#c.findIndex(n=>n.idempotencyKey===e.idempotencyKey);r>=0&&XZ(this.#c,r,r+e.delta)}this.#Me()}async flushMessageQueue(){await this.abort({cleanCurrentMessage:!1,flushMessageQueue:!0}),this.#I&&this.#I()}#Xe(e){let r=e.idempotencyKey;if(r){let n=this.#c.findIndex(i=>i.idempotencyKey===r);if(n>=0)return this.#c[n]=e,!1}else e.idempotencyKey=(0,nb.randomUUID)();return e.userPrompt==="___BROWSER_AUTOMATION_PROMPT___"&&(e.userPrompt=qee(this.getProxyOrigin())),this.#c.push(e),!0}async sendMessage(e){this.#ue=!1;let r=!1;if(Array.isArray(e))for(let i of e)r=this.#Xe(i)||r;else r=this.#Xe(e);if(!r)return null;this.#Me();let n=this.#c[this.#c.length-1];return n?(this.#Q=!1,this.cancelAllPendingToolFulfilments(),n.queue?this.#I&&this.#I():await this.flushMessageQueue(),await Zc(),n.idempotencyKey):null}#yt(){let e=this.#c;if(e.length!==0){for(let r of e)if(r.systemReminders)for(let n of r.systemReminders)this.queueSystemReminder(n);return this.#f=pT(e),this.clearMessageQueue(!0),this.#f}}#wt(){let e=this.#c.length===0||this.#ue,r=new Promise(n=>{e?this.#I=n:n()}).then(()=>{let n=this.#c;if(n.length===0)return;for(let o of n)if(o.systemReminders)for(let s of o.systemReminders)this.queueSystemReminder(s);let i=pT(n);if(!i.dropAbortedPrompt&&this.#f){let o=i.idempotencyKey;i=dT(this.#f,i),i.idempotencyKey=o}return this.clearMessageQueue(!0),this.#f=i,i});return{shouldWait:e,promise:r}}#Me(){this.#o.emit("step",{type:"message-queue",queue:this.#c.map(e=>({idempotencyKey:e.idempotencyKey,displayPrompt:e.displayPrompt,user:e.user}))})}#bt(e,r=!1){r&&(this.#F={}),Object.assign(this.#F,e),this.#o.emit("step",{type:"metadata",...this.#F})}async waitForSetupCommand(e){let r=this.#r;if(!r)return{state:"installed",shouldProceed:!0};if(r.setupState==="installing")try{await Xc(r.setupCommandPromise,e)}catch{}let n=r.setupState;return n==="not-installed"||n==="install-failed"||n==="install-aborted"?{state:n,shouldProceed:!0}:{state:"installed",shouldProceed:!0}}async waitForDevServer(e){if(!this.#r&&this.#t?.serverUrl)return{shouldProceed:!0,message:"Dev server is ready.",serverUrl:this.#t.serverUrl};let r=await this.waitForSetupCommand(e);if(!r.shouldProceed)return{shouldProceed:!1,message:`Project setup command did not completed. State: ${r.state}`};let n=this.#r;if(n){await n.ensureDevCommand(e);let i=await n.waitUntilServer(e);return i.ok?{shouldProceed:!0,message:"Dev server is ready.",serverUrl:n.serverUrl?.toString()}:{shouldProceed:!1,message:i.message,serverUrl:void 0}}return{shouldProceed:!1,message:"Dev server is not ready.",serverUrl:void 0}}async getNamedAgentConfig(e,r,n){let i=this.getSessionContext().customAgents,o=e?i.find(D=>D.name.toLowerCase()===e.toLowerCase()):void 0,s=o?.name??"explorer",{mcpServers:a=!1,model:A,mode:c="quality-v4-agent",systemPrompt:u,subagent_type:l,includeMemories:g,needDevServer:d,needValidation:p,resetAfterRun:f=!1}={subagent_type:s,systemPrompt:o?.systemPrompt,model:o?.model,mode:o?.mode,includeMemories:o?.includeMemories??s==="explorer",needDevServer:o?.needDevServer,needValidation:o?.needValidation,resetAfterRun:o?.resetAfterRun},h=["Read","Glob","ReadRule","Grep","WebSearch","SearchMemories"].filter(D=>this.#C?this.#C.includes(D):!0);h.push("ExplorationMetadata");let m=rb(this.#t,o?.tools??h),I=A===void 0?l==="explorer"?"opa5-mini":void 0:A,E=this.#r;if(d&&n){if(!E)return{success:!1,response:`The ${l} agent can not be used on this session. Do no try again.`};if(E.httpServerState.state==="stopped"||E.httpServerState.state==="connecting"||E.httpServerState.state==="error-fetch")try{if(E.state==="not-installed")throw new Error(`The ${l} agent can not be used until the setupCommand finish successfully. However, the dev server is not installed.`);if(E.state==="install-failed")throw new Error(`The ${l} agent can not be used until the setupCommand finish successfully. However, last time we try to run the install script, it failed.`);if(E.state==="install-aborted")throw new Error(`The ${l} agent can not be used until the setupCommand finish successfully. However, last time we try to run the install script, it was aborted.`);await this.waitForSetupCommand(n),await E.ensureDevCommand(n)}catch(b){return{success:!1,response:b instanceof Error?b.message:String(b)}}if(p&&E.hasValidateCommand&&this.#L){let b=await E.runValidateCommand(void 0,n);if(b.status==="failure")return{success:!1,response:`The Agent could not start yet, because the validate command failed:
|
|
1883
|
+
`).filter(E=>E.trim()))];h=fd({files:h,policy:A,getDotFiles:!0});let m=[];for(let E of h){let B=E.lastIndexOf("/"),Q=B>=0?E.slice(B+1):E,w=B>=0?E.slice(0,B):"",D=this.#Et(u,E.toLowerCase()),b=this.#Bt(u,E,D);m.push({filePath:E,fileName:Q,parentPath:w,matchIndices:D,score:b})}m.sort((E,B)=>B.score-E.score);let I=m.slice(0,i).map(({score:E,...B})=>B);l({matches:I,totalMatches:h.length,truncated:h.length>i})})})}#Et(e,r){let n=e.toLowerCase(),i=r.toLowerCase(),o=r.lastIndexOf("/"),s=o>=0?o+1:0;if(e.includes("/")){let A=i.indexOf(n);return A>=0?Array.from({length:n.length},(c,u)=>A+u):this.#ae(n,i,0,r.length)}let a=this.#ae(n,i,s,r.length);if(a.length===n.length)return a;if(a.length>0){let A=a.length,c=n.slice(0,n.length-A),u=this.#ae(c,i,0,s);if(u.length+A===n.length){let l=n.slice(u.length),g=this.#ae(l,i,s,r.length);return[...u,...g]}}return this.#ae(n,i,0,r.length)}#ae(e,r,n,i){let o=[],s=0;for(let a=n;a<i&&s<e.length;a++){let A=e[s];r[a]===A?(o.push(a),s++):/[a-zA-Z0-9.\-_]/.test(A)||(s++,a--)}for(;s<e.length&&!/[a-zA-Z0-9.\-_]/.test(e[s]);)s++;return o}#Bt(e,r,n){if(n.length===0)return 0;let i=0,o=e.toLowerCase(),s=r.toLowerCase(),a=r.lastIndexOf("/"),A=a>=0?a+1:0,u=s.slice(A).replace(/\.[^.]+$/,"");if(u===o)i+=200;else if(u.startsWith(o)){let p=o.length/u.length;p>=.9?i+=150:p>=.7?i+=120:i+=100}else u.includes(o)&&(i+=50);let l=n.filter(p=>p>=A);if(l.length===n.length&&(i+=30),l.length>0){let p=l.length/u.length;p>=.9?i+=60:p>=.7?i+=40:p>=.5&&(i+=20)}let g=0;for(let p=1;p<n.length;p++)n[p]===n[p-1]+1&&(g+=10);i+=g;let d=new Set(["/","-","_","."]);for(let p of n)(p===0||d.has(s[p-1]))&&(i+=5);if(i+=l.length*3,n[0]===A&&(i+=20),i-=Math.floor(r.length/20),n.length>1){let p=n[n.length-1]-n[0],f=n.length-1,h=p-f;i-=Math.floor(h/5)}return i}#Qt(e){if(!e)return"";let r=e.lastIndexOf("/");if(r===-1)return"**/"+this.#Ne(e,!0)+"*";let n=e.slice(0,r),i=e.slice(r+1),o="**/",s=n.split("/");for(let a=0;a<s.length;a++){let A=s[a];A&&(o+=this.#Ne(A,!1)),o+="/**/"}return i?o+=this.#Ne(i,!0)+"*":o+="*",o}#Ne(e,r){let n="";for(let i=0;i<e.length;i++){let o=e[i];/[a-zA-Z]/.test(o)?(n+=`[${o.toLowerCase()}${o.toUpperCase()}]`,r&&(n+="*")):/[0-9]/.test(o)||o==="."||o==="-"||o==="_"?(n+=o,r&&(n+="*")):["*","?","[","]","{","}"].includes(o)?n+=`[${o}]`:n+="*"}return n}async collectRepoMetrics(e={}){let r=this.#se(e.folderName);return e.rootPath&&(r=this.#e.join(r,e.rootPath)),Ete(this.#e,r)}getSessionId(){return this.getSessionContext().sessionId}getSpaceId(){return this.#a.builderPublicKey}async revertToCommitHash(e){this.#Q=!1,await this.waitUntilBlockingPendingPromises(),await this.abortMerge(!1),await this.#U(),await this.git(["revert","--no-commit",`${e}..HEAD`]),await this.git(["commit","--allow-empty","--quiet","--no-verify","--no-gpg-sign","-m","Revert changes"]);let n=(await this.emitGitStatus())?.currentCommit;if(this.#k=n,!n){this.#e.Sentry?.captureException(new Error("Failed to get current commit hash after revert"),{tags:{operation:"codegen-git",endpoint:"revertToCommitHash"}});return}this.requestRefresh(),await this.#_({lastCommit:n})}async resetToCommitHash(e,r=!0){this.#Q=!1,await this.waitUntilBlockingPendingPromises(),await this.abortMerge(!1),await this.#U(),await this.git(["reset","--quiet","--hard",e]),await this.git(["clean","-fd"]);let i=(await this.emitGitStatus())?.currentCommit;if(this.#k=i,i!==e)throw new Error("Failed to reset commit hash");r&&this.requestRefresh()}async restore({location:e,predicate:r,revert:n=!1,dryRun:i=!1,forceReplay:o=!1,debug:s}){let a=this.getSessionContext(),A=a.turns.length,c=null;for(let p=A-1;p>=-1;p--)if(r(p>=0?a.turns[p]:null,p)){c=p;break}if(c===null)return{undone:null,message:"Could not find the target to restore to, the completion id could be wrong"};n||await this.abort({cleanCurrentMessage:!0});let u=new Map,l=!!this.#s,g=a.turns,d=Math.max(0,e==="before"?c:c+1);for(let p=g.length-1;p>=d;p--){let f=g[p];for(let h of f.applyResults)u.set(h.filePath,h.oldContent??"")}if(!i){let p;if(l){c===-1?a.beforeCommit?p=a.beforeCommit:g.length>0&&(p=g[0].beforeCommit):c<g.length&&(e==="after"?(p=g[c].afterCommit,!p&&c+1<g.length&&(p=g[c+1].beforeCommit)):p=g[c].beforeCommit);let I={commitHash:p,sessionId:a.sessionId,sessionBeforeCommit:a.beforeCommit,turnsLength:g.length,targetIndex:c,currentTurn:g[g.length-1],targetTurn:g[c],targetTurnNext:g[c+1],location:e,forceReplay:o,dryRun:i,debug:s};if(!p)return this.#e.Sentry?.captureException(new Error("No commit hash found for restore"),{tags:{operation:"codegen-git",endpoint:"revertToCommitHash"},contexts:{restore:I}}),{undone:null,message:"Could not find the target to restore to, the git history is missing"};try{n?await this.revertToCommitHash(p):await this.resetToCommitHash(p)}catch(E){return this.#e.Sentry?.captureException(new Error("Error resetting git",{cause:E}),{tags:{operation:"codegen-git",endpoint:"resetToCommitHash"},contexts:{restore:I}}),{undone:null,message:"Failed to reset/restore, the file history is missing"}}}else for(let[I,E]of u.entries())try{E?await this.writeFile(I,E):await this.deleteFile(I)}catch{}if(n)return{undone:[],message:"The revert operation was successful"};let f=g.splice(d,g.length-d),h=Za(g);h&&h?.afterCommit!==p&&(this.#e.Sentry?.captureException(new Error("Reset After commit hash mismatch"),{tags:{operation:"codegen-git",endpoint:"resetToCommitHash"},extra:{lastTurn:h,commitHash:p}}),h.lastCommit=p,await this.#_({completionId:h.completionId,lastCommit:p}));let m=h?.completionId;if(f.length>0&&(await lT(this.#e,this.#a,{lastCompletionId:m,sessionId:a.sessionId},!!this.#n),a.updatedUnixTime=Date.now()),o){let I=a.state;this.#o.emit("step",{type:"batch",steps:[{type:"state",newState:"replay",abortable:!1,previousState:I},...this.#et(),{type:"restore",files:Array.from(u.keys()),lastCompletionId:m,location:e},{type:"state",newState:I,abortable:!1,previousState:"replay"}]})}else f.length>0&&this.#o.emit("step",{type:"restore",files:Array.from(u.keys()),lastCompletionId:m,location:e})}return await this.#Ze(),{undone:Array.from(u.keys()),message:"The restore operation was successful"}}async#Ze(e){return await this.#r?.ensureDevCommand(e)}async restoreFromCompletionId({location:e,completionId:r,forceReplay:n}){let i=this.getSessionContext();return i.turns.find(s=>s.completionId===r)?this.restore({location:e,predicate:s=>s?.completionId===r,forceReplay:n,debug:`restore to: ${r}`}):(await this.#te,i.turns=[],i.canLoadMore=!0,await lT(this.#e,this.#a,{sessionId:i.sessionId,lastCompletionId:r},!!this.#n),await this.loadMoreTurns(),this.restore({location:e,predicate:()=>!0,forceReplay:!0,debug:"restore after history"}))}async restoreBeforeCompletionId(e){return this.restoreFromCompletionId({location:"before",completionId:e,forceReplay:!1})}async undoLastUserMessage(e=!1){return this.restore({location:"before",predicate:r=>r?.user.role==="user",dryRun:e})}getLastUserCompletionId(){let e=this.getSessionContext();return PZ(e)?.completionId}getLastCompletionId(){let e=this.getSessionContext();return AT(e)?.completionId}getCurrentState(){return this.getSessionContext().state}getLastApplyResultsTurn(){let e=this.getSessionContext();return LZ(e)}getLastTurn(){let e=this.getSessionContext();return AT(e)}getNextUrl(){return this.getLastTurn()?.nextUrl}async sendFeedback(e){if(process.env.NODE_ENV==="test")return;if(e.feedbackSentiment){let n=e.feedbackSentiment==="positive"?`User provided positive feedback (thumbs up) on the previous completion.${e.feedbackText??""}`:`User provided negative feedback (thumbs down) on the previous completion.${e.feedbackText??""}`;await this.queueSystemReminder({text:n,tag:"reminder:user-feedback"})}ct("quality code feedback given",{spaceId:this.#a.builderPublicKey,sentiment:e.feedbackSentiment,mode:"cli"});let r=e.id??this.getLastCompletionId();r&&await this.#Dt({...e,id:r})}#_(e){let r=e.completionId;if(!r){let i=this.getLastTurn();i&&e.lastCommit&&(i.lastCommit=e.lastCommit),r=i?.completionId}let n=cT(this.#e,this.#a,"/codegen/finalize",{completionId:r,projectId:this.#t?.projectId,branchName:this.#t?.branchName,userCompletionId:this.getLastUserCompletionId(),sessionId:this.getSessionId(),metadata:this.#F,...e});return this.#M(n)}#Dt(e){let r=cT(this.#e,this.#a,"/codegen/feedback",e);return this.#M(r)}#M(e,r=!1){return this.#z.push(e),r&&this.#Ce.push(e),e.finally(()=>{let n=this.#Ce.indexOf(e);n!==-1&&this.#Ce.splice(n,1);let i=this.#z.indexOf(e);i!==-1&&this.#z.splice(i,1)})}async lastTurnHasChanges(){let e=await this.undoLastUserMessage(!0);return e.undone?e.undone.length>0:!1}#v(e){let r=this.getSessionContext(),n=r.state;n!==e&&(r.state=e,this.#o.emit("step",{type:"state",abortable:e==="generating",previousState:n,newState:e}))}waitUntilState(e,r=1e4){return new Promise(n=>{if(this.getSessionContext().state===e){n();return}let o,s=a=>{a.type==="state"&&a.newState===e&&(clearTimeout(o),this.#o.removeListener("step",s),n())};o=setTimeout(()=>{this.#o.removeListener("step",s),n()},r),this.#o.on("step",s)})}getProxyOrigin(){let e=this.#r;return this.#de??e?.serverUrl?.origin}getProxyDestination(){return this.#V}async clearSession(){let e=this.getSessionContext();e.turns=[],e.customInstructions=await this.#Ie(),e.customAgents=await this.#Ee(),this.#b.length=0,this.#Q=!1,this.#F={},this.#ue=!1,this.clearMessageQueue(),this.queueGitStatusReminder({trigger:"session-start"})}async clearMessageQueue(e=!1){let r=[];if(e)for(let n of this.#c)n.user&&r.push({type:"user",displayPrompt:n.displayPrompt,user:n.user,role:n.user.role,compacting:!1,idempotencyKey:n.idempotencyKey});this.#c.length=0,this.#Me(),r.length>0&&this.#o.emit("step",{type:"batch",steps:r})}updateMessage(e){if(e.type==="delete"){let r=this.#c.findIndex(n=>n.idempotencyKey===e.idempotencyKey);r>=0&&this.#c.splice(r,1)}else if(e.type==="move"){let r=this.#c.findIndex(n=>n.idempotencyKey===e.idempotencyKey);r>=0&&XZ(this.#c,r,r+e.delta)}this.#Me()}async flushMessageQueue(){await this.abort({cleanCurrentMessage:!1,flushMessageQueue:!0}),this.#I&&this.#I()}#Xe(e){let r=e.idempotencyKey;if(r){let n=this.#c.findIndex(i=>i.idempotencyKey===r);if(n>=0)return this.#c[n]=e,!1}else e.idempotencyKey=(0,nb.randomUUID)();return e.userPrompt==="___BROWSER_AUTOMATION_PROMPT___"&&(e.userPrompt=qee(this.getProxyOrigin())),this.#c.push(e),!0}async sendMessage(e){this.#ue=!1;let r=!1;if(Array.isArray(e))for(let i of e)r=this.#Xe(i)||r;else r=this.#Xe(e);if(!r)return null;this.#Me();let n=this.#c[this.#c.length-1];return n?(this.#Q=!1,this.cancelAllPendingToolFulfilments(),n.queue?this.#I&&this.#I():await this.flushMessageQueue(),await Zc(),n.idempotencyKey):null}#yt(){let e=this.#c;if(e.length!==0){for(let r of e)if(r.systemReminders)for(let n of r.systemReminders)this.queueSystemReminder(n);return this.#f=pT(e),this.clearMessageQueue(!0),this.#f}}#wt(){let e=this.#c.length===0||this.#ue,r=new Promise(n=>{e?this.#I=n:n()}).then(()=>{let n=this.#c;if(n.length===0)return;for(let o of n)if(o.systemReminders)for(let s of o.systemReminders)this.queueSystemReminder(s);let i=pT(n);if(!i.dropAbortedPrompt&&this.#f){let o=i.idempotencyKey;i=dT(this.#f,i),i.idempotencyKey=o}return this.clearMessageQueue(!0),this.#f=i,i});return{shouldWait:e,promise:r}}#Me(){this.#o.emit("step",{type:"message-queue",queue:this.#c.map(e=>({idempotencyKey:e.idempotencyKey,displayPrompt:e.displayPrompt,user:e.user}))})}#bt(e,r=!1){r&&(this.#F={}),Object.assign(this.#F,e),this.#o.emit("step",{type:"metadata",...this.#F})}async waitForSetupCommand(e){let r=this.#r;if(!r)return{state:"installed",shouldProceed:!0};if(r.setupState==="installing")try{await Xc(r.setupCommandPromise,e)}catch{}let n=r.setupState;return n==="not-installed"||n==="install-failed"||n==="install-aborted"?{state:n,shouldProceed:!0}:{state:"installed",shouldProceed:!0}}async waitForDevServer(e){if(!this.#r&&this.#t?.serverUrl)return{shouldProceed:!0,message:"Dev server is ready.",serverUrl:this.#t.serverUrl};let r=await this.waitForSetupCommand(e);if(!r.shouldProceed)return{shouldProceed:!1,message:`Project setup command did not completed. State: ${r.state}`};let n=this.#r;if(n){await n.ensureDevCommand(e);let i=await n.waitUntilServer(e);return i.ok?{shouldProceed:!0,message:"Dev server is ready.",serverUrl:n.serverUrl?.toString()}:{shouldProceed:!1,message:i.message,serverUrl:void 0}}return{shouldProceed:!1,message:"Dev server is not ready.",serverUrl:void 0}}async getNamedAgentConfig(e,r,n){let i=this.getSessionContext().customAgents,o=e?i.find(D=>D.name.toLowerCase()===e.toLowerCase()):void 0,s=o?.name??"explorer",{mcpServers:a=!1,model:A,mode:c="quality-v4-agent",systemPrompt:u,subagent_type:l,includeMemories:g,needDevServer:d,needValidation:p,resetAfterRun:f=!1}={subagent_type:s,systemPrompt:o?.systemPrompt,model:o?.model,mode:o?.mode,includeMemories:o?.includeMemories??s==="explorer",needDevServer:o?.needDevServer,needValidation:o?.needValidation,resetAfterRun:o?.resetAfterRun},h=["Read","Glob","ReadRule","Grep","WebSearch","SearchMemories"].filter(D=>this.#C?this.#C.includes(D):!0);h.push("ExplorationMetadata");let m=rb(this.#t,o?.tools??h),I=A===void 0?l==="explorer"?"opa5-mini":void 0:A,E=this.#r;if(d&&n){if(!E)return{success:!1,response:`The ${l} agent can not be used on this session. Do no try again.`};if(E.httpServerState.state==="stopped"||E.httpServerState.state==="connecting"||E.httpServerState.state==="error-fetch")try{if(E.state==="not-installed")throw new Error(`The ${l} agent can not be used until the setupCommand finish successfully. However, the dev server is not installed.`);if(E.state==="install-failed")throw new Error(`The ${l} agent can not be used until the setupCommand finish successfully. However, last time we try to run the install script, it failed.`);if(E.state==="install-aborted")throw new Error(`The ${l} agent can not be used until the setupCommand finish successfully. However, last time we try to run the install script, it was aborted.`);await this.waitForSetupCommand(n),await E.ensureDevCommand(n)}catch(b){return{success:!1,response:b instanceof Error?b.message:String(b)}}if(p&&E.hasValidateCommand&&this.#L){let b=await E.runValidateCommand(void 0,n);if(b.status==="failure")return{success:!1,response:`The Agent could not start yet, because the validate command failed:
|
|
1884
1884
|
<command>
|
|
1885
1885
|
${b.command}
|
|
1886
1886
|
</command>
|
|
@@ -1888,16 +1888,16 @@ ${b.command}
|
|
|
1888
1888
|
${b.output}
|
|
1889
1889
|
</logs>
|
|
1890
1890
|
|
|
1891
|
-
Make the necessary changes and try again.`};if(b.status==="aborted")return{success:!1,response:"The Agent could not start yet, because the validate command was aborted by the user."};this.#L=!1}let D=await this.waitForDevServer(n);if(!D.shouldProceed)return{success:!1,response:D.message}}let B=this.#y.replace(/-agent$/,""),Q={};if(m.includes("mcp:chrome")){let D=await this.#vt(r,n);if(!D)return{success:!1,response:"Failed to get Chrome WebSocket server URL"};Q.chrome={command:"npx",args:["-y","chrome-devtools-mcp@latest","--wsEndpoint",D,"--categoryEmulation=false"]}}let w=u?aa(u,{FUSION_TEST_PROMPT:this.#t?.browserAutomationInstructions??"",...E?.envVars??process.env}):void 0;return{success:!0,subagent_type:l,resetAfterRun:f,options:{sys:this.#e,credentials:this.#a,position:o?.position??`${B}-agent`,mode:c,includeMemories:g,modelOverride:p0(I)??this.#Je??this.#P,sessionOrCompletionId:r,workingDirectory:this.#u,mcpServers:a,autoImportLocalMCPs:!1,fusionConfig:this.#t,privacyMode:this.#E,enabledTools:m,builtInMCPServerConfig:Q,systemPromptOverride:w,devServerOrchestrator:m.includes("ServerLogs")?this.#r:void 0}}}async spawnNamedAgent(e,r){let n=r.resume??r.sessionId,i=await this.getNamedAgentConfig(e,n,r.signal);if(!i.success)return{success:!1,response:i.response};await this.waitUntilBlockingPendingPromises(),await this.#
|
|
1891
|
+
Make the necessary changes and try again.`};if(b.status==="aborted")return{success:!1,response:"The Agent could not start yet, because the validate command was aborted by the user."};this.#L=!1}let D=await this.waitForDevServer(n);if(!D.shouldProceed)return{success:!1,response:D.message}}let B=this.#y.replace(/-agent$/,""),Q={};if(m.includes("mcp:chrome")){let D=await this.#vt(r,n);if(!D)return{success:!1,response:"Failed to get Chrome WebSocket server URL"};Q.chrome={command:"npx",args:["-y","chrome-devtools-mcp@latest","--wsEndpoint",D,"--categoryEmulation=false"]}}let w=u?aa(u,{FUSION_TEST_PROMPT:this.#t?.browserAutomationInstructions??"",...E?.envVars??process.env}):void 0;return{success:!0,subagent_type:l,resetAfterRun:f,options:{sys:this.#e,credentials:this.#a,position:o?.position??`${B}-agent`,mode:c,includeMemories:g,modelOverride:p0(I)??this.#Je??this.#P,sessionOrCompletionId:r,workingDirectory:this.#u,mcpServers:a,autoImportLocalMCPs:!1,fusionConfig:this.#t,privacyMode:this.#E,enabledTools:m,builtInMCPServerConfig:Q,systemPromptOverride:w,devServerOrchestrator:m.includes("ServerLogs")?this.#r:void 0}}}async spawnNamedAgent(e,r){let n=r.resume??r.sessionId,i=await this.getNamedAgentConfig(e,n,r.signal);if(!i.success)return{success:!1,response:i.response};await this.waitUntilBlockingPendingPromises(),await this.#U();let o;if(i.resetAfterRun){if(this.#s&&!await this.isCleanWorkTree())return{success:!1,response:`Cannot run browser automation with uncommitted changes. The "${i.subagent_type}" agent modifies code during testing and automatically resets changes afterward. Your uncommitted changes would be permanently lost.
|
|
1892
1892
|
|
|
1893
1893
|
Please commit or stash your changes first, then try again.`};o=(await this.emitGitStatus())?.currentCommit}let s=i.subagent_type,a=new t(i.options);await a.initializeSession({skipSessionLoading:!r.resume,signal:r.signal}),r.resume&&i.options.builtInMCPServerConfig?.chrome&&a.queueSystemReminder({text:"The connected browser might have restarted. This means cookies and open pages might have been cleared."});let A=a.getSessionId(),c={important_files:[]},u=null,l=[],g=[],d=r.maxCompletions,p=a.connectToEventLoop(!1,m=>{try{if(m.type==="tool_result"&&m.result.tool_name==="ExplorationMetadata"&&typeof m.result.content=="string"?c=JSON.parse(m.result.content):(m.type==="done"&&(d--,d<10&&a.queueSystemReminder({text:`The agent has been working for a while. Please try to wrap up soon because soon it will be interrupted. T-minus ${d} turns.`})),this.#o.emit("step",{type:"agent",id:A,step:m,subagent_type:s})),m.type==="tool_result"){let I=m.result.content;if(Array.isArray(I)){let E=I.filter(B=>B.type==="image"&&B.source.type==="base64");E.length>0&&(u=E[E.length-1])}if(m.result.tool_name==="RecordFrame")try{let E=JSON.parse(m.result.tool_input||"{}");l.push({image:u,title:E.title||"Untitled"})}catch{l.push({image:u,title:"Untitled"})}if(m.result.tool_name==="ReportUIIssue")try{let E=JSON.parse(m.result.tool_input||"{}");E.title&&E.description&&g.push({title:E.title,description:E.description,debugInfo:E.debugInfo})}catch{}}}catch{}}),f=async()=>{p(),await a.close(!1)};if(r.signal?.aborted)return await f(),{success:!1,response:"Agent task aborted"};let h=async()=>{await f()};r.signal&&r.signal.addEventListener("abort",h);try{await a.sendMessage({userPrompt:r.prompt,user:r.user,maxCompletions:r.maxCompletions,category:"background-subagent",includeRelevantMemories:i.options.includeMemories}),await a.waitUntilIdle(r.signal);let m=a.getLastTurn();if(!m)return{success:!1,response:"Agent task failed"};let I=m.actions.filter(E=>E.type==="text").map(E=>E.content).join(`
|
|
1894
1894
|
`);if(g.length>0&&(I=`<browser_automation_ui_issues>${JSON.stringify(g,null,2)}</browser_automation_ui_issues><browser_automation_summary>${I}</browser_automation_summary>`),l.length>0)try{let E=l.map(k=>({hasImage:!!k.image,title:k.title})),B=l.map(k=>k.image).filter(k=>k!==null),Q=`${a.getSessionId()}.webp`,w=`${a.getSessionId()}.json`,D=this.#e.join(uue.default.homedir(),".builder","recordings"),b=this.#e.join(D,Q),S=this.#e.join(D,w);if(await gg.default.promises.mkdir(D,{recursive:!0}),await gg.default.promises.writeFile(S,JSON.stringify(E,null,2)),B.length>0&&await jee(B,{duration:"1",outputPath:b,cleanup:!1,sys:this.#e,debug:this.#n,signal:r.signal})){if(c.gif_id=Q??void 0,this.#n&&console.log(`[${s}] Generated GIF from ${l.length} recorded frames: ${Q}`),Q){let F=E.map(K=>K.title);I=`<browser_automation_gif_id>${Q}</browser_automation_gif_id>
|
|
1895
1895
|
<browser_automation_recorded_frames>${JSON.stringify(F)}</browser_automation_recorded_frames>
|
|
1896
1896
|
|
|
1897
|
-
${I}`}this.#bt({gif_id:Q,gif_frames:E},!1)}}catch(E){console.warn(`[${s}] Failed to generate GIF (non-critical): ${E instanceof Error?E.message:String(E)}`),this.#e.Sentry?.captureException(E,{level:"warning",tags:{component:"gif-generator",operation:"generateGifFromImages",subagent_type:s},extra:{sessionId:a.getSessionId(),recordedFramesCount:l.length}})}return{success:!0,response:I,metadata:c,sessionId:A,lastTurn:m}}catch(m){return{success:!1,response:`Agent task failed: ${m instanceof Error?m.message:String(m)}`,metadata:{important_files:[]}}}finally{r.signal?.removeEventListener("abort",h);try{await f()}catch(m){console.warn(`[${s}] Cleanup failed: ${m instanceof Error?m.message:String(m)}`)}if(i.resetAfterRun&&o)try{await this.resetToCommitHash(o,!1)}catch(m){console.warn(`[${s}] Failed to reset changes: ${m instanceof Error?m.message:String(m)}`)}}}setProxyOrigin(e){e!==this.#de&&(this.#de=e,this.getProxyOrigin()&&this.#
|
|
1898
|
-
${tX(r.environmentVariables)}`,tag:"reminder:environment-variables"})),e.proxyServer?i.push(r?.setProxyServer(e.proxyServer).then(o=>{n.proxyServer=o.updatedProxyServer,n.hosts=o.updatedHosts})):e.proxyPort&&i.push(r?.setPort(e.proxyPort).then(o=>n.proxyServer=o)),e.setupCommand!==void 0||e.setupDependencies!==void 0?i.push(r.setSetupCommand({setupDependencies:e.setupDependencies,setupCommand:e.setupCommand,forceRestart:e.forceSetupCommand}).then(o=>{n.setupCommand=!!o,n.setupResult=o??void 0})):(e.forceSetupCommand||n.env&&r.setupState!=="installed")&&i.push(r?.runSetupCommand().then(o=>{n.setupCommand=!!o,n.setupResult=o??void 0})),e.devCommand!==void 0?i.push(r.setDevCommand(e.devCommand??void 0,e.forceDevCommand).then(o=>{n.devCommand=o.status==="success",n.devResult=o??void 0})):(e.forceDevCommand||n.env)&&i.push(r?.restart().then(o=>{n.devCommand=!0,n.devResult=o??void 0})),e.autoDetectDevServer!==void 0&&i.push(r.setAutoDetectSettings(e.autoDetectDevServer,e.autoDetectDevServerPatterns).then(o=>n.proxyServer=n.proxyServer||o)),e.validateCommand!==void 0&&i.push(r.runValidateCommand(e.validateCommand).then(o=>n.validateResult=o)),await Promise.allSettled(i)}return n}#xt(){for(let e of Array.from(this.#p.keys()))try{this.disposeTerminal({terminalId:e})}catch{}this.#p.clear()}async#Te(){if(this.#l.debounceTimer&&clearTimeout(this.#l.debounceTimer),this.#l.pendingEvents=[],this.#l.listeners.clear(),this.#l.watcher){try{await this.#l.watcher.close()}catch{}this.#l.watcher=null}}#St(){if(this.#l.watcher)return;let e=this.#i.map(A=>A.path),r=new Map;for(let A of this.#i)r.set(A.path,BU(A.path));let n=A=>{for(let c of this.#i)if(A.startsWith(c.path+"/")||A===c.path)return c.path;return null},i=A=>{let c=n(A);if(!c)return!1;let u=this.#e.relative(c,A).replace(/\\/g,"/");if(!u)return!1;if(this.#nt(u))return!0;let l=r.get(c);return l?l(u):!1},o,s=!1;try{o=lue.default.watch(e,{ignored:i,ignoreInitial:!0,persistent:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:100},ignorePermissionErrors:!0,followSymlinks:!1,usePolling:!0,interval:1e3,binaryInterval:3e5,atomic:!0})}catch(A){this.#e.Sentry?.captureException(A,{tags:{operation:"global-file-watch-init"}}),console.error(`\u26A0\uFE0F Failed to initialize file watcher: ${A instanceof Error?A.message:String(A)}`),console.error(" File watching will be disabled. Code generation will still work but may not detect all changes automatically.");return}let a=(A,c)=>{let u=n(c),l=u?this.#e.relative(u,c).replace(/\\/g,"/"):this.#e.relative(this.#d,c).replace(/\\/g,"/");if(this.#i.length>1&&u){let d=this.#i.find(p=>p.path===u);d&&!this.#D()&&(l=`${d.folderName}/${l}`)}let g={type:"folder-watch",watchId:"global",event:A,path:l,timestamp:Date.now()};this.#l.pendingEvents.push(g),this.#l.debounceTimer&&clearTimeout(this.#l.debounceTimer),this.#l.debounceTimer=setTimeout(()=>{let d=this.#l.pendingEvents;this.#l.pendingEvents=[];for(let p of d)for(let f of this.#l.listeners)try{f(p)}catch(h){this.#e.Sentry?.captureException(h)}},this.#l.debounceMs)};o.on("add",A=>a("add",A)).on("change",A=>a("change",A)).on("unlink",A=>a("unlink",A)).on("addDir",A=>a("addDir",A)).on("unlinkDir",A=>a("unlinkDir",A)).on("error",A=>{s||(s=!0,this.#e.Sentry?.captureException(A,{tags:{operation:"global-file-watch"}}),console.error(`\u26A0\uFE0F File watcher error: ${A instanceof Error?A.message:String(A)}`),console.error(" Closing file watcher to prevent further errors. File watching will be disabled."),this.#Te().catch(()=>{}))}),this.#l.watcher=o,this.#n&&console.log(`\u{1F4C2} Initialized global file watcher on: ${e.join(", ")}`)}subscribeToFileChanges(e){return this.#l.listeners.size===0&&this.#St(),this.#l.listeners.add(e),this.#n&&console.log(`\u{1F4C2} Subscribed to file changes(${this.#l.listeners.size} active listeners)`),async()=>{this.#l.listeners.delete(e),this.#n&&console.log(`\u{1F4C2} Unsubscribed from file changes(${this.#l.listeners.size} remaining listeners)`),this.#l.listeners.size===0&&this.#l.watcher&&(await this.#Te(),this.#n&&console.log("\u{1F4C2} Closed global file watcher (no more listeners)"))}}async close(e=!1){if(!this.#pe){if(this.#pe=!0,this.#Ue.forEach(r=>r()),this.#xt(),await this.#Te(),this.#ne)try{this.#n&&console.log("\u{1F50C} Cleaning up local MCP servers..."),await this.#ne.cleanup()}catch(r){this.#e.Sentry?.captureException(r,{level:"warning",tags:{operation:"local-mcp-cleanup"}})}if(await this.stopEventLoop(),await this.waitUntilState("close",5e3),this.#o.removeAllListeners(),await Promise.allSettled(this.#
|
|
1897
|
+
${I}`}this.#bt({gif_id:Q,gif_frames:E},!1)}}catch(E){console.warn(`[${s}] Failed to generate GIF (non-critical): ${E instanceof Error?E.message:String(E)}`),this.#e.Sentry?.captureException(E,{level:"warning",tags:{component:"gif-generator",operation:"generateGifFromImages",subagent_type:s},extra:{sessionId:a.getSessionId(),recordedFramesCount:l.length}})}return{success:!0,response:I,metadata:c,sessionId:A,lastTurn:m}}catch(m){return{success:!1,response:`Agent task failed: ${m instanceof Error?m.message:String(m)}`,metadata:{important_files:[]}}}finally{r.signal?.removeEventListener("abort",h);try{await f()}catch(m){console.warn(`[${s}] Cleanup failed: ${m instanceof Error?m.message:String(m)}`)}if(i.resetAfterRun&&o)try{await this.resetToCommitHash(o,!1)}catch(m){console.warn(`[${s}] Failed to reset changes: ${m instanceof Error?m.message:String(m)}`)}}}setProxyOrigin(e){e!==this.#de&&(this.#de=e,this.getProxyOrigin()&&this.#V&&e&&this.queueSystemReminder({text:`The dev server is running at ${e}. e.g. for taking screenshots of a "/foo" route take a screenshot of ${e}/foo`,tag:"reminder:url"}))}async#vt(e,r){let n=this.getProxyOrigin();if(n&&!this.#V)return;let i=await uT(this.#a,"/codegen/get-browser-connection",{sessionId:e,projectId:this.#m,branchName:this.#T,proxyOrigin:n,proxyDst:this.#V},{signal:r});return typeof i?.wsUrl=="string"?i.wsUrl:void 0}getTurns(){let e=this.getSessionContext();return structuredClone(e.turns)}getSessionContext(){if(!this.#g)throw new Error("Session context not initialized");return this.#g}async runSetupCommand(){return await this.#r?.runSetupCommand()}abortSetupCommand(){return this.#r?.abortSetupCommand()}abortValidateCommand(){return this.#r?.abortValidateCommand()}toolsRunning(){return this.#x.length>0}abortAllTools(){for(let e of this.#x)e.abortController.abort()}toolFullfilment(e,r){return typeof r=="string"&&(r={toolResult:r,isError:!1}),this.fulfillToolCall(e,r)}cancelAllPendingToolFulfilments(){for(let e of Array.from(this.#H.keys()))this.fulfillToolCall(e,{toolResult:"Aborted by the user. So the task could not be completed.",isError:!0,title:"Aborted by the user."});this.#H.clear()}fulfillToolCall(e,r){let n=this.#H.get(e);return n?(n(r),this.#H.delete(e),!0):!1}abortToolCall(e,r){let n=this.#x.find(o=>o.id===e),i=sn(r??"The user manually aborted the tool call.");if(n)return n.abortController.abort(i),!0;if(this.#x.length===0){let o=new AbortController;return o.abort(i),this.#x.push({id:e,abortController:o,input:{id:e},name:"bash"}),!0}return!1}async acceptCode(){if(this.#rt()){let e=this.getLinesStats();await this.sendFeedback({position:this.#y,acceptedLines:e.net,linesOfCodeAdded:e.added,linesOfCodeRemoved:e.removed})}}async abort(e){let r=!1,n=!0;return typeof e=="boolean"?r=e:(r=e?.cleanCurrentMessage??!1,n=e?.flushMessageQueue??!0),r&&(this.#f=void 0,this.clearMessageQueue()),this.#ue=!n,this.#q=0,this.#B?(this.#B.abort(),this.#B=void 0,!0):!1}async stopEventLoop(){await this.abort({cleanCurrentMessage:!0}),this.#O?.abort(),this.#O=void 0,this.#I&&this.#I()}requestRefresh(){this.#o.emit("step",{type:"builder-action",action:"refresh",metadata:{}})}async configureDevOrchestrator(e){let r=this.#r,n={devCommand:!1,hosts:!1,setupCommand:!1,proxyServer:!1,validateCommand:!1,env:!1,setupResult:void 0,devResult:void 0,validateResult:void 0};if(r){let i=[];e.env&&(e.replaceEnvs&&r.clearEnvVariables(),Object.entries(e.env).forEach(([o,s])=>{r.setEnvVariable(o,s??void 0)&&(n.env=!0)}),this.queueSystemReminder({text:`The system has the following environment variables:
|
|
1898
|
+
${tX(r.environmentVariables)}`,tag:"reminder:environment-variables"})),e.proxyServer?i.push(r?.setProxyServer(e.proxyServer).then(o=>{n.proxyServer=o.updatedProxyServer,n.hosts=o.updatedHosts})):e.proxyPort&&i.push(r?.setPort(e.proxyPort).then(o=>n.proxyServer=o)),e.setupCommand!==void 0||e.setupDependencies!==void 0?i.push(r.setSetupCommand({setupDependencies:e.setupDependencies,setupCommand:e.setupCommand,forceRestart:e.forceSetupCommand}).then(o=>{n.setupCommand=!!o,n.setupResult=o??void 0})):(e.forceSetupCommand||n.env&&r.setupState!=="installed")&&i.push(r?.runSetupCommand().then(o=>{n.setupCommand=!!o,n.setupResult=o??void 0})),e.devCommand!==void 0?i.push(r.setDevCommand(e.devCommand??void 0,e.forceDevCommand).then(o=>{n.devCommand=o.status==="success",n.devResult=o??void 0})):(e.forceDevCommand||n.env)&&i.push(r?.restart().then(o=>{n.devCommand=!0,n.devResult=o??void 0})),e.autoDetectDevServer!==void 0&&i.push(r.setAutoDetectSettings(e.autoDetectDevServer,e.autoDetectDevServerPatterns).then(o=>n.proxyServer=n.proxyServer||o)),e.validateCommand!==void 0&&i.push(r.runValidateCommand(e.validateCommand).then(o=>n.validateResult=o)),await Promise.allSettled(i)}return n}#xt(){for(let e of Array.from(this.#p.keys()))try{this.disposeTerminal({terminalId:e})}catch{}this.#p.clear()}async#Te(){if(this.#l.debounceTimer&&clearTimeout(this.#l.debounceTimer),this.#l.pendingEvents=[],this.#l.listeners.clear(),this.#l.watcher){try{await this.#l.watcher.close()}catch{}this.#l.watcher=null}}#St(){if(this.#l.watcher)return;let e=this.#i.map(A=>A.path),r=new Map;for(let A of this.#i)r.set(A.path,BU(A.path));let n=A=>{for(let c of this.#i)if(A.startsWith(c.path+"/")||A===c.path)return c.path;return null},i=A=>{let c=n(A);if(!c)return!1;let u=this.#e.relative(c,A).replace(/\\/g,"/");if(!u)return!1;if(this.#nt(u))return!0;let l=r.get(c);return l?l(u):!1},o,s=!1;try{o=lue.default.watch(e,{ignored:i,ignoreInitial:!0,persistent:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:100},ignorePermissionErrors:!0,followSymlinks:!1,usePolling:!0,interval:1e3,binaryInterval:3e5,atomic:!0})}catch(A){this.#e.Sentry?.captureException(A,{tags:{operation:"global-file-watch-init"}}),console.error(`\u26A0\uFE0F Failed to initialize file watcher: ${A instanceof Error?A.message:String(A)}`),console.error(" File watching will be disabled. Code generation will still work but may not detect all changes automatically.");return}let a=(A,c)=>{let u=n(c),l=u?this.#e.relative(u,c).replace(/\\/g,"/"):this.#e.relative(this.#d,c).replace(/\\/g,"/");if(this.#i.length>1&&u){let d=this.#i.find(p=>p.path===u);d&&!this.#D()&&(l=`${d.folderName}/${l}`)}let g={type:"folder-watch",watchId:"global",event:A,path:l,timestamp:Date.now()};this.#l.pendingEvents.push(g),this.#l.debounceTimer&&clearTimeout(this.#l.debounceTimer),this.#l.debounceTimer=setTimeout(()=>{let d=this.#l.pendingEvents;this.#l.pendingEvents=[];for(let p of d)for(let f of this.#l.listeners)try{f(p)}catch(h){this.#e.Sentry?.captureException(h)}},this.#l.debounceMs)};o.on("add",A=>a("add",A)).on("change",A=>a("change",A)).on("unlink",A=>a("unlink",A)).on("addDir",A=>a("addDir",A)).on("unlinkDir",A=>a("unlinkDir",A)).on("error",A=>{s||(s=!0,this.#e.Sentry?.captureException(A,{tags:{operation:"global-file-watch"}}),console.error(`\u26A0\uFE0F File watcher error: ${A instanceof Error?A.message:String(A)}`),console.error(" Closing file watcher to prevent further errors. File watching will be disabled."),this.#Te().catch(()=>{}))}),this.#l.watcher=o,this.#n&&console.log(`\u{1F4C2} Initialized global file watcher on: ${e.join(", ")}`)}subscribeToFileChanges(e){return this.#l.listeners.size===0&&this.#St(),this.#l.listeners.add(e),this.#n&&console.log(`\u{1F4C2} Subscribed to file changes(${this.#l.listeners.size} active listeners)`),async()=>{this.#l.listeners.delete(e),this.#n&&console.log(`\u{1F4C2} Unsubscribed from file changes(${this.#l.listeners.size} remaining listeners)`),this.#l.listeners.size===0&&this.#l.watcher&&(await this.#Te(),this.#n&&console.log("\u{1F4C2} Closed global file watcher (no more listeners)"))}}async close(e=!1){if(!this.#pe){if(this.#pe=!0,this.#Ue.forEach(r=>r()),this.#xt(),await this.#Te(),this.#ne)try{this.#n&&console.log("\u{1F50C} Cleaning up local MCP servers..."),await this.#ne.cleanup()}catch(r){this.#e.Sentry?.captureException(r,{level:"warning",tags:{operation:"local-mcp-cleanup"}})}if(await this.stopEventLoop(),await this.waitUntilState("close",5e3),this.#o.removeAllListeners(),await Promise.allSettled(this.#z),e){let r=await this.needsBackup();this.#n&&console.log(`\u{1F50D} Closing code gen server: ${JSON.stringify({uploadGitBackup:e,needsBackup:r})}`),r&&await this.uploadBackup()}else this.#n&&console.log(`\u{1F50D} Closing code gen server: ${JSON.stringify({uploadGitBackup:e})}`)}}async emitGitStatus(){if(!this.#s||this.#i.length===0)return null;let r=(await this.#N(async i=>this.#kt(i))).results.filter(i=>i.success&&i.result).map(i=>i.result);if(r.length===0)return null;for(let i of r)this.#o.emit("step",i);return this.#ce=r,await this.#Ft(r),r.some(i=>i.hasMergeConflict)&&await this.#Ae(),r[0]}async#Ft(e){if(!this.#m||!this.#T||!this.#a.builderPublicKey||!this.#a.userId||!this.#a.builderPrivateKey)return;let r=e.some(n=>n.ahead>0||n.isSessionDirty);try{let n=new URL(`/projects/branches?projectId=${encodeURIComponent(this.#m)}&branchName=${encodeURIComponent(this.#T)}`,Xe);n.searchParams.set("apiKey",this.#a.builderPublicKey),n.searchParams.set("userId",this.#a.userId);let i=await We(n,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.#a.builderPrivateKey}`},body:JSON.stringify({hasUnpushedChanges:r}),signal:AbortSignal.timeout(1e4)});!i.ok&&this.#n&&console.error(`Failed to update branch unpushed status: ${i.status} ${i.statusText}`)}catch(n){this.#n&&console.error("Failed to update branch unpushed status:",n)}}queueGitStatusReminder(e){if(this.#ce.length===0)return;let r=this.#ce.map(n=>rX(n,this.gitEnabledFolders,e));this.queueSystemReminder({text:r.join(`
|
|
1899
1899
|
|
|
1900
|
-
`),tag:"reminder:git-status"})}async manualCommit(e){if(!this.#s)return!1;let r=this.getSessionContext();if(!r.beforeCommit){let s=await this.getCurrentCommitHash();s&&(r.beforeCommit=s)}let{repoPath:n,relativePath:i}=this.#Fe(e.add,e.folderName);await this.git(["add",i],{cwd:n}),await this.git(["commit","--quiet","--no-verify","--no-gpg-sign","-m",e.commitMessage],{cwd:n});let o=await this.getCurrentCommitHash("HEAD",n);return await this.#_({lastCommit:o}),await this.emitGitStatus(),!0}getLastSuggestedAction(){return this.#J}async#Ae(){let e=this.getSessionContext();if(e.state==="generating"||e.state==="close")return this.#J=void 0,!1;let r=await this.#ke(!0,"all");return e=this.getSessionContext(),e.state!=="generating"&&e.state!=="close"?(this.#J=r,this.#o.emit("step",{type:"wait-for-input",state:e.state,suggestion:r,sessionMode:e.sessionMode,hasPlanToApply:this.#Q}),!0):!1}async#kt(e){if(!this.#s)return null;this.#ge++;let r=this.getCommitMode(),n=this.getFeatureBranch(),i=this.#z(e),o=e.path,s=e.folderName===this.#i[0]?.folderName,a=this.getSessionContext(),A=!1,c=!1,u="",l=null;try{let E=await this.git(["rev-parse","--absolute-git-dir"],{cwd:o});l=this.#e.join(E.trim(),"FETCH_HEAD"),gg.default.existsSync(l)&&gg.default.unlinkSync(l)}catch(E){this.#e.Sentry?.captureException(E,{tags:{operation:"codegen-git",endpoint:"getGitStatus"},extra:{fetchHeadFilePath:l,isCheckingGitStatus:this.#ge,folderName:e.folderName}}),l=null}try{u=await this.git(["fetch","--no-tags","origin",i],{cwd:o}),A=!0}catch{A=!1}let g=await this.#e.getRepoInfo(o),d;!s&&!e.initialCommit&&g.commit&&(e.initialCommit=g.commit);let p=s?a.beforeCommit:e.initialCommit;if(this.gitRepoContexts.length>1){let E=a.turns.some(Q=>Q.applyResults.some(w=>this.#ze(w.filePath)?.folderName===e.folderName)),B=p&&p!==g.commit;d=E||!!B}else d=this.#rt();let f=d?1:0,h=0;if(A){if(n!==i)try{await this.git(["--no-pager","diff","--quiet",`refs/remotes/origin/${n}...refs/remotes/origin/${i}`],{cwd:o}),c=!1}catch{c=!0}else c=!0;try{let E=VZ(await this.git(["rev-list","--left-right","--count","HEAD...FETCH_HEAD"],{cwd:o}));f=E.ahead,h=E.behind}catch(E){let B=null;if(l)try{B=await this.#e.readFile(this.#e.join(o,".git/FETCH_HEAD")),B=`FETCH_HEAD: ${B} `}catch(Q){B=`FETCH_HEAD FAILED: ${String(Q)} `}else B="FETCH_HEAD MISSING";this.#e.Sentry?.captureException(E,{tags:{operation:"codegen-git",endpoint:"getGitStatus"},extra:{fetchOutput:u,fetchHead:B,remoteBranch:i,currentBranch:g.currentBranch,currentCommit:g.commit,isCheckingGitStatus:this.#ge,folderName:e.folderName}})}}else!A&&r!=="commits"&&p&&p!==g.commit&&(f=Math.max(f,1));let m=await this.#R(o),I=m.length>0;return this.#ge--,{type:"git",folderName:e.folderName,remoteBranchExists:A,remoteBranchHasChanges:c,hasGeneratingPlaceholder:await this.#_t(),isSessionDirty:d||!!p&&p!==g.commit,canSync:(f>0||h>0)&&!I,canPush:(f>0||h>0)&&!I,canPull:h>0&&A,ahead:f,hasMergeConflict:I,commitMode:r,behind:h,currentCommit:g.commit,currentBranch:g.currentBranch,pendingValidation:this.#L,remoteBranch:i,unmergedFiles:m}}#et(){let e=this.getSessionContext(),r=e.turns,n=[];n.push({type:"session",title:e.title,beforeCommit:e.beforeCommit,createdUnixTime:e.createdUnixTime,updatedUnixTime:e.updatedUnixTime,turns:e.turns.length,id:e.sessionId,lastCompletionId:this.getLastCompletionId(),sessionMode:e.sessionMode,fusionConfig:d0(this.#t),hasBrowserAutomation:e.customAgents.some(i=>i.name==="browser-testing"),customInstructions:e.customInstructions.filter(i=>!i.hideUI).map(i=>({name:i.name,description:i.description??"",type:i.type??"always",glob:i.glob}))}),Object.keys(this.#F).length>0&&n.push({type:"metadata",...this.#F}),this.#c.length>0&&n.push({type:"message-queue",queue:this.#c.map(i=>({idempotencyKey:i.idempotencyKey,displayPrompt:i.displayPrompt,user:i.user}))});for(let i of r){n.push({type:"user",displayPrompt:i.userMessage?i.userMessage.displayPrompt??i.userMessage.userPrompt:void 0,attachments:i.userMessage?.attachments,id:i.completionId,user:i.user,role:i.user.role,compacting:!1,idempotencyKey:i.userMessage?.idempotencyKey??""});for(let o of i.actions)(o.type==="tool"||o.type==="text"||o.type==="thinking")&&(n.push({type:"start",name:o.type,content:"",id:o.id??"",filePath:o.filePath??"",title:o.actionTitle??o.artifactTitle??o.filePath??""}),n.push({type:"delta",name:o.type,delta:o.content}),o.type==="tool"?n.push({type:o.type,id:o.id,name:o.filePath,content:o.content}):o.type==="thinking"?n.push({type:"planning",content:o.content}):o.type==="text"&&n.push({type:"text",content:o.content}))}return n}connectToEventLoop(e,r){if(e){let n=[],i=this.getSessionContext();n.push({type:"state",newState:"replay",abortable:!1,previousState:i.state}),this.#Qe&&n.push(this.#Qe),n.push(...this.#ce),n.push(...this.#et());let o=this.#re?Za(this.#re):void 0;if(o)switch(o.type){case"file":case"diff":case"text":case"thinking":case"suggestion":case"tool":n.push({type:"start",id:o.id,name:o.type,filePath:o.filePath??"",title:o.actionTitle??o.artifactTitle??"",content:""}),n.push({type:"delta",name:o.type,delta:o.content});break}n.push({type:"terminals",terminals:this.#Re()});let s=this.#r;s?(n.push({type:"dev-server",devServerState:s.devState,setupState:s.setupState,httpServerState:s.httpServerState.state,devCommand:s.devCommand,setupCommand:s.setupCommand,proxyServer:s.proxyTarget,proxyServerSelection:s.proxyServerSelection,remoteAddress:s.httpServerState.remoteAddress,remotePort:s.httpServerState.remotePort,proxyServerReachable:!!this.#t?.isLocal,validateState:s.validateCommandState}),s.setupState!=="installed"&&n.push({type:"stdio",id:"setupCommand",command:s.setupCommand??"",content:s.getSetupWrite(),source:"run-command",stream:"stdout"}),n.push({type:"stdio",id:"devServer",command:s.devCommand,content:s.getDevWrite(),source:"run-command",stream:"stdout"})):r({type:"dev-server",devServerState:"running",setupState:"installed",httpServerState:"ok-2xx",devCommand:this.#t?.devCommand,setupCommand:this.#t?.setupCommand,proxyServer:this.#t?.serverUrl,proxyServerSelection:"hardcoded",remoteAddress:void 0,remotePort:void 0,proxyServerReachable:!!this.#t?.isLocal,validateState:"unset"}),n.push({type:"state",newState:i.state,abortable:i.state==="generating",previousState:"replay"}),this.#H&&i.state!=="generating"&&n.push({type:"wait-for-input",state:i.state,suggestion:this.#J,sessionMode:i.sessionMode,hasPlanToApply:this.#Q}),r({type:"batch",steps:n})}return this.#o.on("step",r),this.waitForEventLoop(),()=>{this.#o.off("step",r)}}waitUntilPendingPromises(e){return Xc(Promise.allSettled(this.#V),e).then(()=>Zc())}waitUntilBlockingPendingPromises(e){return Xc(Promise.allSettled(this.#Ce),e).then(()=>Zc())}waitUntilIdle(e){return this.waitForEventLoop(),Xc(Zc().then(()=>this.waitUntilPendingPromises()).then(()=>{let r=this.getSessionContext();return this.#n&&console.log(`waitUntilIdle: starting in ${r.state} `),r.state==="generating"?(0,ib.once)(this.#o,"idle"):Promise.resolve(void 0)}).then(()=>this.waitUntilPendingPromises()).then(()=>{this.#n&&console.log(`waitUntilIdle: idle reached in ${this.getSessionContext().state} `)}),e)}async#tt(e){let r=this.#r;if(!r)throw new Error("Dev server not found");this.#n&&console.log("[agent] running validate command");let n=await r.runValidateCommand(void 0,e);return n.status==="success"&&(this.#L=!1,this.#s&&(await this.#qe()).length===0&&(await this.isCleanWorkTree()||await this.manualCommit({add:".",commitMessage:"Validate command fixes"}))),n}waitForEventLoop(){return this.#H?this.#H:this.#H=this.#Rt()}async#Rt(){if(this.#H||this.#G)throw new Error("Event loop already started");let e=qZ(),r=a=>{a.type==="error"&&this.#$>0&&(cue.includes(a.code)||(a.restoreCredits=this.#$,this.#$=0,UZ(this.#e,this.#a,o.sessionId,a.restoreCredits).catch(A=>{this.#e.Sentry?.captureException(A)}))),this.#o.emit("step",a)};this.#G=new AbortController;let n=this.#G.signal,i=this.#r,o=this.getSessionContext(),s=()=>this.getLastCompletionId();this.#e.Sentry?.setContext("codeGen",{sessionId:o.sessionId,get completionId(){return s()}}),await this.#M(this.emitGitStatus()),this.queueGitStatusReminder({trigger:"session-start"}),i?.setupState==="not-installed"&&this.runSetupCommand();try{for(;!n.aborted;){this.#B=void 0;let a=this.#wt();if(a.shouldWait){await this.#Ze();let u=await this.#Ae();if(n.aborted)break;u&&ZZ(a.promise,500).then(l=>{l&&(this.#n&&console.log("emit: idle (next message)"),this.#o.emit("idle"))})}let A=await a.promise;if(n.aborted)break;if(!A)continue;this.#B=new AbortController;let c=Ai([n,this.#B.signal]);try{if(this.#J=void 0,A.logsCheckpoint&&i?.addCheckpoint(),c?.aborted)throw sn(c.reason);this.#v("generating"),A.syncChanges&&(await this.syncChangesFromRemote(A.syncChanges),await this.#ke(!1,"critical")),A.sessionMode&&A.sessionMode!==o.sessionMode&&this.switchSessionMode(A.sessionMode),await this.#Nt(A,c,r),this.#v("success");let u=A.autoPush??"none";if(u!=="none"){let l=(()=>{switch(u){case"force-push":return{actor:"agent",forcePush:!0,pullFirst:!1};case"merge-push":return{actor:"agent",pullFirst:!0,forcePush:!1};case"ff-push":return{actor:"agent",requireFastForward:!0,pullFirst:!1};case"safe-push":return{actor:"agent",pullFirst:!0,abortOnMergeConflict:!0};default:return{actor:"agent"}}})();await this.#Ee(l)}this.#J=void 0}catch(u){u instanceof Error?u.name==="AbortError"?(r({type:"user-abort",hasContinueMessage:this.#c.length>0}),this.#v("abort")):u instanceof tt?(this.#f=void 0,r({type:"error",code:"cli-network-error",message:u.message}),this.#e.Sentry?.captureException(u,{tags:{operation:"codegen-stream"}}),this.#v("error")):u instanceof _t?(this.#f=void 0,r({type:"error",code:"unknown",message:"An internal error occurred. Please try again."}),this.#e.Sentry?.captureException(u,{tags:{operation:"codegen-stream"}}),this.#v("error")):u instanceof ms?(this.#f=void 0,r({type:"error",code:u.code,message:u.message}),cue.includes(u.code)||this.#e.Sentry?.captureException(u,{tags:{operation:"codegen-stream"}}),this.#v("error")):(this.#f=void 0,r({type:"error",code:"cli-genetic-error",message:u.message,metadata:{error:u}}),this.#e.Sentry?.captureException(u,{tags:{operation:"codegen-stream"}}),this.#v("error")):this.#v("error")}this.#it++}}catch(a){throw this.#e.Sentry?.captureException(a,{level:"fatal"}),a}finally{this.#G=void 0,this.#H=void 0,e()}this.#n&&console.log("emit: idle (close)"),this.#o.emit("idle"),this.#v("close")}async#Nt(e,r,n){this.#$=0,this.#L=!1;let i=this.getSessionContext(),o=e.displayPrompt||e.userPrompt||"";o&&this.#Se.push(o);let s;if(e.agentType&&e.agentType!==this.#fe){let I=await this.getNamedAgentConfig(e.agentType,this.getSessionId(),r);I.success&&(s={enabledTools:this.#C,modelOverride:this.#P,mode:this.#w,systemPromptOverride:this.#Y,position:this.#y,includeMemories:this.#Z},this.#C=I.options.enabledTools,this.#P=I.options.modelOverride,this.#w=I.options.mode,this.#Y=I.options.systemPromptOverride,this.#y=I.options.position,this.#Z=I.options.includeMemories)}let a=e.maxCompletions??Py,A=0,c=0,u=0,l=!0,g=!1,d=!1,p,f=0,h=0;try{for(;;){if(u>=a){n({type:"error",code:"ask-to-continue",message:"The agent has been working for a while. Do you want to continue?"});break}if(r?.aborted)throw sn(r.reason);try{if(p||(p=await this.#Pt(e,l,r,n),p.modelOverride=e.modelOverride),p.user.role==="user"){let I=p.files.filter(E=>(E.importance??0)>2.5&&E.content).map(E=>({filePath:E.filePath,size:E.content?.length??0,isCustomInstruction:!1,wasIncluded:E.wasIncluded}));i.customInstructions.forEach(E=>{E.filePath&&E.type==="always"&&I.push({filePath:E.filePath,size:E.content?.length??0,isCustomInstruction:!0,wasIncluded:!0})}),n({type:"user-input",prompt:p.userMessage?.displayPrompt??p.userPrompt,files:I})}try{let{shouldContinue:I,completions:E,filesChanged:B}=await this.#Mt(i,p,r,n);if(l=!1,p=void 0,c=0,A++,g||=B,d||=B,u+=E,this.#L||=B,this.#f=void 0,B&&this.#r?.addCheckpoint(),d&&(await this.emitGitStatus(),d=!1),r?.aborted)throw sn(r.reason);let Q=this.#yt();Q?.syncChanges&&await this.syncChangesFromRemote(Q.syncChanges);let{newCount:w,hasHealthIssue:D}=await this.#At(h,!0);if(h=w,Q){l=!0,e=Q,u=0;continue}if(!I){if(r?.aborted)throw sn(r.reason);if(this.getSessionMode()!=="normal"&&!this.#Q&&h<3){this.#n&&console.log("[agent] adding reminder for missing plan"),h++,this.queueSystemReminder({text:"Remember to always write the plan file and call the ExitPlanMode tool before finishing. Also, prefer using AskUserQuestion tool to ask questions to the user."});continue}if(D&&h<3)continue;if(this.#r?.hasValidateCommand&&e.runValidateCommand&&f<2&&this.#L){d=!0,f++,n({type:"start",name:"validate-command",id:"validate-command",title:"Validate Command",content:""});let S=e.autoPush;this.#tt(r).then(k=>{this.#n&&console.log(`[agent] validate command ${k.status}`),k.status==="failure"&&k.code&&this.sendMessage({user:e.user,maxCompletions:e.maxCompletions,runValidateCommand:!0,userPrompt:`The validate command failed with code ${k.code}):
|
|
1900
|
+
`),tag:"reminder:git-status"})}async manualCommit(e){if(!this.#s)return!1;let r=this.getSessionContext();if(!r.beforeCommit){let n=await this.getCurrentCommitHash();n&&(r.beforeCommit=n)}if(this.#me)await this.commitWorkInProgress(e.commitMessage,[e.add]),await this.#U();else{let{repoPath:n,relativePath:i}=this.#Fe(e.add,e.folderName);await this.git(["add",i],{cwd:n}),await this.git(["commit","--quiet","--no-verify","--no-gpg-sign","-m",e.commitMessage],{cwd:n});let s=(await this.emitGitStatus())?.currentCommit;await this.#_({lastCommit:s})}return!0}getLastSuggestedAction(){return this.#Y}async#Ae(){let e=this.getSessionContext();if(e.state==="generating"||e.state==="close")return this.#Y=void 0,!1;let r=await this.#ke(!0,"all");return e=this.getSessionContext(),e.state!=="generating"&&e.state!=="close"?(this.#Y=r,this.#o.emit("step",{type:"wait-for-input",state:e.state,suggestion:r,sessionMode:e.sessionMode,hasPlanToApply:this.#Q}),!0):!1}async#kt(e){if(!this.#s)return null;this.#ge++;let r=this.getCommitMode(),n=this.getFeatureBranch(),i=this.#W(e),o=e.path,s=e.folderName===this.#i[0]?.folderName,a=this.getSessionContext(),A=!1,c=!1,u="",l=null;try{let E=await this.git(["rev-parse","--absolute-git-dir"],{cwd:o});l=this.#e.join(E.trim(),"FETCH_HEAD"),gg.default.existsSync(l)&&gg.default.unlinkSync(l)}catch(E){this.#e.Sentry?.captureException(E,{tags:{operation:"codegen-git",endpoint:"getGitStatus"},extra:{fetchHeadFilePath:l,isCheckingGitStatus:this.#ge,folderName:e.folderName}}),l=null}try{u=await this.git(["fetch","--no-tags","origin",i],{cwd:o}),A=!0}catch{A=!1}let g=await this.#e.getRepoInfo(o),d;!s&&!e.initialCommit&&g.commit&&(e.initialCommit=g.commit);let p=s?a.beforeCommit:e.initialCommit;if(this.gitRepoContexts.length>1){let E=a.turns.some(Q=>Q.applyResults.some(w=>this.#ze(w.filePath)?.folderName===e.folderName)),B=p&&p!==g.commit;d=E||!!B}else d=this.#rt();let f=d?1:0,h=0;if(A){if(n!==i)try{await this.git(["--no-pager","diff","--quiet",`refs/remotes/origin/${n}...refs/remotes/origin/${i}`],{cwd:o}),c=!1}catch{c=!0}else c=!0;try{let E=VZ(await this.git(["rev-list","--left-right","--count","HEAD...FETCH_HEAD"],{cwd:o}));f=E.ahead,h=E.behind}catch(E){let B=null;if(l)try{B=await this.#e.readFile(this.#e.join(o,".git/FETCH_HEAD")),B=`FETCH_HEAD: ${B} `}catch(Q){B=`FETCH_HEAD FAILED: ${String(Q)} `}else B="FETCH_HEAD MISSING";this.#e.Sentry?.captureException(E,{tags:{operation:"codegen-git",endpoint:"getGitStatus"},extra:{fetchOutput:u,fetchHead:B,remoteBranch:i,currentBranch:g.currentBranch,currentCommit:g.commit,isCheckingGitStatus:this.#ge,folderName:e.folderName}})}}else!A&&r!=="commits"&&p&&p!==g.commit&&(f=Math.max(f,1));let m=await this.#R(o),I=m.length>0;return this.#ge--,{type:"git",folderName:e.folderName,remoteBranchExists:A,remoteBranchHasChanges:c,hasGeneratingPlaceholder:await this.#_t(),isSessionDirty:d||!!p&&p!==g.commit,canSync:(f>0||h>0)&&!I,canPush:(f>0||h>0)&&!I,canPull:h>0&&A,ahead:f,hasMergeConflict:I,commitMode:r,behind:h,currentCommit:g.commit,currentBranch:g.currentBranch,pendingValidation:this.#L,remoteBranch:i,unmergedFiles:m}}#et(){let e=this.getSessionContext(),r=e.turns,n=[];n.push({type:"session",title:e.title,beforeCommit:e.beforeCommit,createdUnixTime:e.createdUnixTime,updatedUnixTime:e.updatedUnixTime,turns:e.turns.length,id:e.sessionId,lastCompletionId:this.getLastCompletionId(),sessionMode:e.sessionMode,fusionConfig:d0(this.#t),hasBrowserAutomation:e.customAgents.some(i=>i.name==="browser-testing"),customInstructions:e.customInstructions.filter(i=>!i.hideUI).map(i=>({name:i.name,description:i.description??"",type:i.type??"always",glob:i.glob}))}),Object.keys(this.#F).length>0&&n.push({type:"metadata",...this.#F}),this.#c.length>0&&n.push({type:"message-queue",queue:this.#c.map(i=>({idempotencyKey:i.idempotencyKey,displayPrompt:i.displayPrompt,user:i.user}))});for(let i of r){n.push({type:"user",displayPrompt:i.userMessage?i.userMessage.displayPrompt??i.userMessage.userPrompt:void 0,attachments:i.userMessage?.attachments,id:i.completionId,user:i.user,role:i.user.role,compacting:!1,idempotencyKey:i.userMessage?.idempotencyKey??""});for(let o of i.actions)(o.type==="tool"||o.type==="text"||o.type==="thinking")&&(n.push({type:"start",name:o.type,content:"",id:o.id??"",filePath:o.filePath??"",title:o.actionTitle??o.artifactTitle??o.filePath??""}),n.push({type:"delta",name:o.type,delta:o.content}),o.type==="tool"?n.push({type:o.type,id:o.id,name:o.filePath,content:o.content}):o.type==="thinking"?n.push({type:"planning",content:o.content}):o.type==="text"&&n.push({type:"text",content:o.content}))}return n}connectToEventLoop(e,r){if(e){let n=[],i=this.getSessionContext();n.push({type:"state",newState:"replay",abortable:!1,previousState:i.state}),this.#De&&n.push(this.#De),n.push(...this.#ce),n.push(...this.#et());let o=this.#re?Za(this.#re):void 0;if(o)switch(o.type){case"file":case"diff":case"text":case"thinking":case"suggestion":case"tool":n.push({type:"start",id:o.id,name:o.type,filePath:o.filePath??"",title:o.actionTitle??o.artifactTitle??"",content:""}),n.push({type:"delta",name:o.type,delta:o.content});break}n.push({type:"terminals",terminals:this.#Re()});let s=this.#r;s?(n.push({type:"dev-server",devServerState:s.devState,setupState:s.setupState,httpServerState:s.httpServerState.state,devCommand:s.devCommand,setupCommand:s.setupCommand,proxyServer:s.proxyTarget,proxyServerSelection:s.proxyServerSelection,remoteAddress:s.httpServerState.remoteAddress,remotePort:s.httpServerState.remotePort,proxyServerReachable:!!this.#t?.isLocal,validateState:s.validateCommandState}),s.setupState!=="installed"&&n.push({type:"stdio",id:"setupCommand",command:s.setupCommand??"",content:s.getSetupWrite(),source:"run-command",stream:"stdout"}),n.push({type:"stdio",id:"devServer",command:s.devCommand,content:s.getDevWrite(),source:"run-command",stream:"stdout"})):r({type:"dev-server",devServerState:"running",setupState:"installed",httpServerState:"ok-2xx",devCommand:this.#t?.devCommand,setupCommand:this.#t?.setupCommand,proxyServer:this.#t?.serverUrl,proxyServerSelection:"hardcoded",remoteAddress:void 0,remotePort:void 0,proxyServerReachable:!!this.#t?.isLocal,validateState:"unset"}),n.push({type:"state",newState:i.state,abortable:i.state==="generating",previousState:"replay"}),this.#J&&i.state!=="generating"&&n.push({type:"wait-for-input",state:i.state,suggestion:this.#Y,sessionMode:i.sessionMode,hasPlanToApply:this.#Q}),r({type:"batch",steps:n})}return this.#o.on("step",r),this.waitForEventLoop(),()=>{this.#o.off("step",r)}}waitUntilPendingPromises(e){return Xc(Promise.allSettled(this.#z),e).then(()=>Zc())}waitUntilBlockingPendingPromises(e){return Xc(Promise.allSettled(this.#Ce),e).then(()=>Zc())}waitUntilIdle(e){return this.waitForEventLoop(),Xc(Zc().then(()=>this.waitUntilPendingPromises()).then(()=>{let r=this.getSessionContext();return this.#n&&console.log(`waitUntilIdle: starting in ${r.state} `),r.state==="generating"?(0,ib.once)(this.#o,"idle"):Promise.resolve(void 0)}).then(()=>this.waitUntilPendingPromises()).then(()=>{this.#n&&console.log(`waitUntilIdle: idle reached in ${this.getSessionContext().state} `)}),e)}async#tt(e){let r=this.#r;if(!r)throw new Error("Dev server not found");this.#n&&console.log("[agent] running validate command");let n=await r.runValidateCommand(void 0,e);return n.status==="success"&&(this.#L=!1,this.#s&&(await this.#qe()).length===0&&(await this.isCleanWorkTree()||await this.manualCommit({add:".",commitMessage:"Validate command fixes"}))),n}waitForEventLoop(){return this.#J?this.#J:this.#J=this.#Rt()}async#Rt(){if(this.#J||this.#O)throw new Error("Event loop already started");let e=qZ(),r=a=>{a.type==="error"&&this.#q>0&&(cue.includes(a.code)||(a.restoreCredits=this.#q,this.#q=0,UZ(this.#e,this.#a,o.sessionId,a.restoreCredits).catch(A=>{this.#e.Sentry?.captureException(A)}))),this.#o.emit("step",a)};this.#O=new AbortController;let n=this.#O.signal,i=this.#r,o=this.getSessionContext(),s=()=>this.getLastCompletionId();this.#e.Sentry?.setContext("codeGen",{sessionId:o.sessionId,get completionId(){return s()}}),await this.#M(this.emitGitStatus()),this.queueGitStatusReminder({trigger:"session-start"}),i?.setupState==="not-installed"&&this.runSetupCommand();try{for(;!n.aborted;){this.#B=void 0;let a=this.#wt();if(a.shouldWait){await this.#Ze();let u=await this.#Ae();if(n.aborted)break;u&&ZZ(a.promise,500).then(l=>{l&&(this.#n&&console.log("emit: idle (next message)"),this.#o.emit("idle"))})}let A=await a.promise;if(n.aborted)break;if(!A)continue;this.#B=new AbortController;let c=Ai([n,this.#B.signal]);try{if(this.#Y=void 0,A.logsCheckpoint&&i?.addCheckpoint(),c?.aborted)throw sn(c.reason);this.#v("generating"),A.syncChanges&&(await this.syncChangesFromRemote(A.syncChanges),await this.#ke(!1,"critical")),A.sessionMode&&A.sessionMode!==o.sessionMode&&this.switchSessionMode(A.sessionMode),await this.#Nt(A,c,r),this.#v("success");let u=A.autoPush??"none";if(u!=="none"){await this.waitUntilBlockingPendingPromises();let l=(()=>{switch(u){case"force-push":return{actor:"agent",forcePush:!0,pullFirst:!1};case"merge-push":return{actor:"agent",pullFirst:!0,forcePush:!1};case"ff-push":return{actor:"agent",requireFastForward:!0,pullFirst:!1};case"safe-push":return{actor:"agent",pullFirst:!0,abortOnMergeConflict:!0};default:return{actor:"agent"}}})();await this.#Be(l)}this.#Y=void 0}catch(u){u instanceof Error?u.name==="AbortError"?(r({type:"user-abort",hasContinueMessage:this.#c.length>0}),this.#v("abort")):u instanceof tt?(this.#f=void 0,r({type:"error",code:"cli-network-error",message:u.message}),this.#e.Sentry?.captureException(u,{tags:{operation:"codegen-stream"}}),this.#v("error")):u instanceof _t?(this.#f=void 0,r({type:"error",code:"unknown",message:"An internal error occurred. Please try again."}),this.#e.Sentry?.captureException(u,{tags:{operation:"codegen-stream"}}),this.#v("error")):u instanceof ms?(this.#f=void 0,r({type:"error",code:u.code,message:u.message}),cue.includes(u.code)||this.#e.Sentry?.captureException(u,{tags:{operation:"codegen-stream"}}),this.#v("error")):(this.#f=void 0,r({type:"error",code:"cli-genetic-error",message:u.message,metadata:{error:u}}),this.#e.Sentry?.captureException(u,{tags:{operation:"codegen-stream"}}),this.#v("error")):this.#v("error")}this.#it++}}catch(a){throw this.#e.Sentry?.captureException(a,{level:"fatal"}),a}finally{this.#O=void 0,this.#J=void 0,e()}this.#n&&console.log("emit: idle (close)"),this.#o.emit("idle"),this.#v("close")}async#Nt(e,r,n){this.#q=0,this.#L=!1;let i=this.getSessionContext(),o=e.displayPrompt||e.userPrompt||"";o&&this.#Se.push(o);let s;if(e.agentType&&e.agentType!==this.#fe){let I=await this.getNamedAgentConfig(e.agentType,this.getSessionId(),r);I.success&&(s={enabledTools:this.#C,modelOverride:this.#P,mode:this.#w,systemPromptOverride:this.#j,position:this.#y,includeMemories:this.#Z},this.#C=I.options.enabledTools,this.#P=I.options.modelOverride,this.#w=I.options.mode,this.#j=I.options.systemPromptOverride,this.#y=I.options.position,this.#Z=I.options.includeMemories)}let a=e.maxCompletions??Py,A=0,c=0,u=0,l=!0,g=!1,d=!1,p,f=0,h=0;try{for(;;){if(u>=a){n({type:"error",code:"ask-to-continue",message:"The agent has been working for a while. Do you want to continue?"});break}if(r?.aborted)throw sn(r.reason);try{if(p||(p=await this.#Pt(e,l,r,n),p.modelOverride=e.modelOverride),p.user.role==="user"){let I=p.files.filter(E=>(E.importance??0)>2.5&&E.content).map(E=>({filePath:E.filePath,size:E.content?.length??0,isCustomInstruction:!1,wasIncluded:E.wasIncluded}));i.customInstructions.forEach(E=>{E.filePath&&E.type==="always"&&I.push({filePath:E.filePath,size:E.content?.length??0,isCustomInstruction:!0,wasIncluded:!0})}),n({type:"user-input",prompt:p.userMessage?.displayPrompt??p.userPrompt,files:I})}try{let{shouldContinue:I,completions:E,filesChanged:B}=await this.#Mt(i,p,r,n);if(l=!1,p=void 0,c=0,A++,g||=B,d||=B,u+=E,this.#L||=B,this.#f=void 0,B&&this.#r?.addCheckpoint(),d&&(await this.emitGitStatus(),d=!1),r?.aborted)throw sn(r.reason);let Q=this.#yt();Q?.syncChanges&&await this.syncChangesFromRemote(Q.syncChanges);let{newCount:w,hasHealthIssue:D}=await this.#At(h,!0);if(h=w,Q){l=!0,e=Q,u=0;continue}if(!I){if(r?.aborted)throw sn(r.reason);if(this.getSessionMode()!=="normal"&&!this.#Q&&h<3){this.#n&&console.log("[agent] adding reminder for missing plan"),h++,this.queueSystemReminder({text:"Remember to always write the plan file and call the ExitPlanMode tool before finishing. Also, prefer using AskUserQuestion tool to ask questions to the user."});continue}if(D&&h<3)continue;if(this.#r?.hasValidateCommand&&e.runValidateCommand&&f<2&&this.#L){d=!0,f++,n({type:"start",name:"validate-command",id:"validate-command",title:"Validate Command",content:""});let S=e.autoPush;this.#tt(r).then(k=>{this.#n&&console.log(`[agent] validate command ${k.status}`),k.status==="failure"&&k.code&&this.sendMessage({user:e.user,maxCompletions:e.maxCompletions,runValidateCommand:!0,userPrompt:`The validate command failed with code ${k.code}):
|
|
1901
1901
|
<validate_command>
|
|
1902
1902
|
${k.command}
|
|
1903
1903
|
</validate_command>
|
|
@@ -1906,11 +1906,11 @@ ${k.command}
|
|
|
1906
1906
|
${k.output}
|
|
1907
1907
|
</output>
|
|
1908
1908
|
|
|
1909
|
-
failed with code ${k.code}`,dropAbortedPrompt:!0,attachments:void 0,displayPrompt:`The validation command ${k.command} failed with code ${k.code}.`,queue:!0,category:"repair-validate-command",syncChanges:void 0,autoPush:S})})}break}}catch(I){throw await this.emitGitStatus(),I}}catch(I){let E=function(B){return!!(B instanceof ms&&B.code==="abrupt-end"||B instanceof Error&&B.name==="HTTPStreamBroke"||B instanceof tt&&[502,503].includes(B.statusCode??0))};var m=E;if(c<3&&E(I)){await Zh(c,r),c++;continue}throw I}finally{_Z(i.turns)}}}finally{s&&(this.#C=s.enabledTools,this.#P=s.modelOverride,this.#w=s.mode,this.#
|
|
1910
|
-
${I.completionId}`,k);K?(F=!0,this.#k=K,S.afterCommit=K,c=K,s=!0,this.#_({completionId:S.completionId,beforeCommit:S.beforeCommit,afterCommit:S.afterCommit,commitFailed:!1})):F&&(s=!0),i({type:"done",stopReason:b.stopReason,id:b.id,applyResults:S.applyResults,actions:b.actions??[],creditsUsed:b.creditsUsed,sessionUsage:b.sessionUsage,contextWindow:b.contextWindow,model:b.model,usage:b.usage,url:b.nextUrl,promptVersion:b.promptVersion,hasChanges:F})}else{if(b.type==="continue")return E=b.autoContinue,B=!0,i({type:"continue",id:b.id,url:b.nextUrl,autoContinue:b.autoContinue}),!0;b.type==="thinking"&&(b.actionTitle="Planning"),"content"in b&&b.type!=="delta"&&i({type:"start",name:b.type,filePath:b.filePath??"",id:"id"in b?b.id:void 0,title:b.actionTitle??b.artifactTitle??b.filePath??"",content:b.content??""})}}return!1},w=b=>{b.type==="thinking"&&i({type:"planning",content:b.content}),b.type==="server_tool_result"&&i({type:"server_tool_result",content:JSON.parse(b.content),title:b.actionTitle??b.artifactTitle??"Server Tool Result",id:b.id}),b.type==="file"&&b.filePath&&!b.synthetic&&i({type:"file",filePath:b.filePath,content:b.content,title:b.actionTitle??b.artifactTitle??"Created",id:b.id,errors:b.errors}),b.type==="diff"&&b.filePath&&!b.synthetic&&i({type:"diff",filePath:b.filePath,title:b.actionTitle??b.artifactTitle??"Updated",content:b.content,id:b.id,errors:b.errors}),b.type==="tool"&&b.filePath?i({type:"tool",name:b.filePath,id:b.id,content:b.content}):b.type==="text"&&i({type:"text",content:b.content})},D=(b,S)=>{i({type:"delta",name:b.type,delta:S})};for await(let b of m){if(b.type==="ping"){this.#n&&console.log("generateCompletion: Ping");continue}if(b.type==="delta"){let S=b.content,k=Za(A);k&&"content"in k&&(k.content+=S,D(k,S))}else{let S=Za(A);if(b.type==="thinking"&&S?.type==="thinking")continue;if(S&&"content"in S&&(S.incomplete=!1,w(S)),A.push(b),await Q(b))break}}if(!B)throw new ms("Completion stream ended abruptly","abrupt-end");return I?{completions:a,filesChanged:s,shouldContinue:E||I.actions.some(b=>b.type==="tool")||I.autoContinue}:{completions:a,filesChanged:s,shouldContinue:!1}}finally{this.#re=void 0}}async commitWorkInProgress(e,r){if(!this.#s
|
|
1911
|
-
${e}`:this.#oe=e
|
|
1912
|
-
`).flatMap(a=>["-m",a]);return(await this.#N(async a=>{let A=a.path,c=n.get(a.folderName)||[],l=(await this.#R(A)).length>0;if(c.length===0&&!l)return null;try{return await this.git(["commit","--allow-empty","--quiet","--no-verify","--no-gpg-sign",...i],{cwd:A}),await this.getCurrentCommitHash("HEAD",A)}catch(g){return this.#e.Sentry?.captureException(new Error(`Error committing work in progress to ${a.folderName}`,{cause:g}),{tags:{operation:"codegen-git",folderName:a.folderName}}),null}})).results.find(a=>a.result)?.result
|
|
1913
|
-
`).flatMap(
|
|
1909
|
+
failed with code ${k.code}`,dropAbortedPrompt:!0,attachments:void 0,displayPrompt:`The validation command ${k.command} failed with code ${k.code}.`,queue:!0,category:"repair-validate-command",syncChanges:void 0,autoPush:S})})}break}}catch(I){throw await this.emitGitStatus(),I}}catch(I){let E=function(B){return!!(B instanceof ms&&B.code==="abrupt-end"||B instanceof Error&&B.name==="HTTPStreamBroke"||B instanceof tt&&[502,503].includes(B.statusCode??0))};var m=E;if(c<3&&E(I)){await Zh(c,r),c++;continue}throw I}finally{_Z(i.turns)}}}finally{s&&(this.#C=s.enabledTools,this.#P=s.modelOverride,this.#w=s.mode,this.#j=s.systemPromptOverride,this.#y=s.position,this.#Z=s.includeMemories),d&&await this.emitGitStatus(),this.#U();let I=this.#t?.refreshPreview??!0;g&&I&&this.requestRefresh()}}async#Mt(e,r,n,i){if(n.aborted)throw sn(n.reason);if(this.#re)throw new Error("generateCompletion already started");let o=this.getLastTurn()?.nextUrl??this.#Qe,s=!1,a=0;i({type:"start",id:"",name:"thinking",title:"Thinking",content:""});try{let A=this.#re=[],c=await this.getCurrentCommitHash();!e.beforeCommit&&c&&(e.beforeCommit=c);let u=this.#ve;u&&this.#E?.enabled&&(u=!!this.#E.mcpServers);let l=r.userMessage?.uiContextPrompt;if(l&&!this.#D()){let b=this.#t?.workspace?.folders.find(S=>S.enableGit);b?.path&&(l=`Relative file paths are relative to: ${b.path}/`)}let g=this.#C;(r.userMessage?.enableQAReviewTool||e.userContext?.enableQAReviewTool)&&this.#w==="quality-v4"&&(g?.includes("SubmitPRReview")||(g=[...g||[],"SubmitPRReview","SubmitRecording","ResolveQAComments"]));let p={...e.userContext,fullstoryUrl:r.userMessage?.metadata?.fullstoryUrl,prNumber:r.userMessage?.metadata?.PR_NUMBER??e.userContext?.prNumber,prHeadSha:r.userMessage?.metadata?.PR_HEAD_SHA??e.userContext?.prHeadSha,repoFullName:r.userMessage?.metadata?.REPO_FULL_NAME??e.userContext?.repoFullName,hostname:r.userMessage?.metadata?.HOSTNAME??e.userContext?.hostname,enableQAReviewTool:r.userMessage?.enableQAReviewTool??e.userContext?.enableQAReviewTool,containerUrl:process.env.FUSION_ENV_ORIGIN??e.userContext?.containerUrl};e.userContext=p,this.#Je=r.modelOverride;let f=this.#ne?.listTools(),h={url:o,position:this.#y,eventName:"cli code",maxPages:2,autoContinue:1,codeGenMode:this.#w,userContext:p,systemReminders:r.systemReminders,files:r.files,skipFileDiff:this.#Le,maxTokens:this.#Oe,aclPolicy:this.#t?.accessControl,repoIndexingConfig:this.#t?.repoIndexingConfig,recommendedRoot:this.#he,attachments:r.attachments,customInstructions:e.customInstructions,customAgents:e.customAgents.map(b=>({name:b.name,description:b.description})),systemPromptOverride:this.#j,sessionId:e.sessionId,userPrompt:r.userPrompt,metadata:{...p.prNumber&&{PR_NUMBER:p.prNumber},...p.prHeadSha&&{PR_HEAD_SHA:p.prHeadSha},...p.repoFullName&&{REPO_FULL_NAME:p.repoFullName},...p.hostname&&{HOSTNAME:p.hostname},...p.containerUrl&&{CONTAINER_URL:p.containerUrl},...r.userMessage?.metadata},ephemeralUserPrompt:r.userMessage?.ephemeralUserPrompt,uiContextPrompt:r.userMessage?.uiContextPrompt,displayUserPrompt:r.userMessage?.displayPrompt,isManualContinue:r.userMessage?.isManualContinue,sessionMode:this.getSessionMode(),includeRelevantMemories:r.userMessage?r.userMessage.includeRelevantMemories??this.#Z:void 0,projectId:this.#m,branchName:this.#T,repoHash:this.#Ke,pingEvents:!0,workingDirectory:this.#h,beforeCommit:c,toolResults:r.toolResults,role:r.user.role,user:r.user,repair:r.repair,category:r.category,enabledTools:g,enabledMCPs:u?r.enabledMCPs:void 0,localMCPTools:f,isLocal:this.#t?.isLocal,searchResponse:r.searchResponse,encryptKey:this.#ee,maxAgentTiming:180*1e3,mcpServers:u,environmentVariables:zZ(this.#t?.environmentVariables??[],this.#r?.environmentVariables??[]),redactUserMessages:this.#E?.redactUserMessages,redactLLMMessages:this.#E?.redactLLMMessages,modelOverride:r.modelOverride??this.#P},m=GZ(this.#e,this.#a,h,n),I,E=!1,B=!1,Q=async b=>{if(b.type==="user"){let S=I={state:"running",unixTime:Date.now(),title:"",sentiment:void 0,userMessage:r.userMessage,afterCommit:c,beforeCommit:c,lastCommit:void 0,creditsUsed:0,actions:[],applyResults:[],completionId:b.id??"",nextUrl:void 0,user:b.user,autoContinue:!1};I=S,e.turns.push(S),b.compacting&&(e.customInstructions=await this.#Ie(),e.customAgents=await this.#Ee()),i({type:"user",displayPrompt:b.displayPrompt,id:b.id,user:b.user,role:b.user.role,compacting:b.compacting,idempotencyKey:r.userMessage?.idempotencyKey})}else if(b.type==="mcp-status")this.#De=b,i(b);else{if(b.type==="mcp-auth-required")return B=!0,i(b),!0;if(b.type==="error")return B=!0,i(b),!0;if(b.type==="done"){a++,this.#b.length=0,this.#q+=b.creditsUsed;let S=I=await this.#Lt(e,b,I,c);for(let z of b.actions??[])z.type==="tool_result"&&(z.filePath==="ExitPlanMode"&&(this.#Q=!0),i({type:"tool_result",result:{content:z.content,tool_use_id:z.id,type:"tool_result",title:z.actionTitle,tool_name:z.filePath,is_error:!!z.errors?.length}}));await this.waitUntilBlockingPendingPromises(n);let k=await this.#Gt(this.#e,S),F=k.length>0,K=await this.commitWorkInProgress(`${I.title}
|
|
1910
|
+
${I.completionId}`,k);K?(F=!0,this.#k=K,S.afterCommit=K,c=K,s=!0,this.#_({completionId:S.completionId,beforeCommit:S.beforeCommit,afterCommit:S.afterCommit,commitFailed:!1})):F&&(s=!0),i({type:"done",stopReason:b.stopReason,id:b.id,applyResults:S.applyResults,actions:b.actions??[],creditsUsed:b.creditsUsed,sessionUsage:b.sessionUsage,contextWindow:b.contextWindow,model:b.model,usage:b.usage,url:b.nextUrl,promptVersion:b.promptVersion,hasChanges:F})}else{if(b.type==="continue")return E=b.autoContinue,B=!0,i({type:"continue",id:b.id,url:b.nextUrl,autoContinue:b.autoContinue}),!0;b.type==="thinking"&&(b.actionTitle="Planning"),"content"in b&&b.type!=="delta"&&i({type:"start",name:b.type,filePath:b.filePath??"",id:"id"in b?b.id:void 0,title:b.actionTitle??b.artifactTitle??b.filePath??"",content:b.content??""})}}return!1},w=b=>{b.type==="thinking"&&i({type:"planning",content:b.content}),b.type==="server_tool_result"&&i({type:"server_tool_result",content:JSON.parse(b.content),title:b.actionTitle??b.artifactTitle??"Server Tool Result",id:b.id}),b.type==="file"&&b.filePath&&!b.synthetic&&i({type:"file",filePath:b.filePath,content:b.content,title:b.actionTitle??b.artifactTitle??"Created",id:b.id,errors:b.errors}),b.type==="diff"&&b.filePath&&!b.synthetic&&i({type:"diff",filePath:b.filePath,title:b.actionTitle??b.artifactTitle??"Updated",content:b.content,id:b.id,errors:b.errors}),b.type==="tool"&&b.filePath?i({type:"tool",name:b.filePath,id:b.id,content:b.content}):b.type==="text"&&i({type:"text",content:b.content})},D=(b,S)=>{i({type:"delta",name:b.type,delta:S})};for await(let b of m){if(b.type==="ping"){this.#n&&console.log("generateCompletion: Ping");continue}if(b.type==="delta"){let S=b.content,k=Za(A);k&&"content"in k&&(k.content+=S,D(k,S))}else{let S=Za(A);if(b.type==="thinking"&&S?.type==="thinking")continue;if(S&&"content"in S&&(S.incomplete=!1,w(S)),A.push(b),await Q(b))break}}if(!B)throw new ms("Completion stream ended abruptly","abrupt-end");return I?{completions:a,filesChanged:s,shouldContinue:E||I.actions.some(b=>b.type==="tool")||I.autoContinue}:{completions:a,filesChanged:s,shouldContinue:!1}}finally{this.#re=void 0}}async commitWorkInProgress(e,r){if(!this.#s)return null;let n=this.#mt(r);if(await this.#N(async a=>{let A=n.get(a.folderName)||[],c=await this.#R(a.path);try{c.length>0?A.length>0&&await this.git(["add",...A],{cwd:a.path}):await this.git(["add","-A","."],{cwd:a.path})}catch(u){this.#e.Sentry?.captureException(new Error(`Error staging files in ${a.folderName}: ${u}`),{tags:{operation:"codegen-git-stage"}})}return null}),this.#me)return typeof this.#oe=="string"?this.#oe+=`
|
|
1911
|
+
${e}`:this.#oe=e,null;let i=e.split(`
|
|
1912
|
+
`).flatMap(a=>["-m",a]);return(await this.#N(async a=>{let A=a.path,c=n.get(a.folderName)||[],l=(await this.#R(A)).length>0;if(c.length===0&&!l)return null;try{return await this.git(["commit","--allow-empty","--quiet","--no-verify","--no-gpg-sign",...i],{cwd:A}),await this.getCurrentCommitHash("HEAD",A)}catch(g){return this.#e.Sentry?.captureException(new Error(`Error committing work in progress to ${a.folderName}`,{cause:g}),{tags:{operation:"codegen-git",folderName:a.folderName}}),null}})).results.find(a=>a.result)?.result||null}async#U(){if(!this.#s||!this.#me)return;let e=this.#oe,r=this.#Se,n=this.getLastTurn(),i=n?.completionId;this.#oe=null,this.#Se=[];let s=(async()=>{if(await this.#Ye,!!e)try{await this.#N(async c=>{let u="";try{await this.git(["--no-pager","diff","--cached","--quiet"],{cwd:c.path});return}catch{try{if(u=await this.git(["--no-pager","diff","--cached","--no-color"],{cwd:c.path}),!u.trim())return}catch{return}}let l=await this.#ht(c.path),g=e,h=((await uT(this.#a,"/codegen/commit-message",{diff:im(u,1e3),userMessages:r,recentCommits:l,projectId:this.#m},{signal:AbortSignal.timeout(2e4)}))?.message||g).split(`
|
|
1913
|
+
`).flatMap(m=>["-m",m]);try{await this.git(["commit","--quiet","--no-verify","--no-gpg-sign",...h],{cwd:c.path})}catch(m){this.#e.Sentry?.captureException(new Error(`Error in batch commit for ${c.folderName}: ${m}`),{tags:{operation:"codegen-git-batch-commit"}})}});let A=(await this.emitGitStatus())?.currentCommit;A&&(this.#k=A,n&&(n.afterCommit=A,n.lastCommit=A),this.#_({completionId:i,beforeCommit:n?.beforeCommit,afterCommit:A,lastCommit:A,commitFailed:!1}));return}catch(a){this.#e.Sentry?.captureException(new Error(`Error in #commitAccumulatedChanges: ${a}`),{tags:{operation:"codegen-git-batch-commit"}});return}})();return this.#Ye=s,this.#M(s,!0)}async#Tt(e,r,n,i){let o=r.actions.filter(s=>s.type==="tool"&&s.id).map(s=>{let a=s.content.trim(),A={};try{A=a?JSON.parse(a):{}}catch{A={}}return{id:s.id,name:s.filePath,input:A,abortController:this.#x.find(c=>c.id===s.id)?.abortController??new AbortController}})??[];if(o.length>0){this.#x=o;try{let s={sys:this.#e,credentials:this.#a,files:e.files,user:e.user,position:this.#y,fusionConfig:this.#t,enabledTools:this.#C??[],sessionMode:this.getSessionMode(),switchSessionMode:A=>this.switchSessionMode(A),signal:n,canCollapseWorkspace:this.#D(),emitter:this.#o,session:this,filterText:A=>(A=W5(A,this.#h),this.#t?.accessControl?.secrets&&(A=Z5(A,this.#t.accessControl.secrets)),A),allowedCommands:uX(this.#t?.allowedCommands??[]),getAllFiles:A=>this.getAllFiles({getDotFiles:A.getDotFiles,includePattern:A.pattern,gitignore:!0,maxFiles:A.maxFiles}),workingDirectory:this.#u,bashWorkingDirectory:this.#h,workspaceFolders:this.#A?.folders??[],restore:A=>this.restore(A),patchFusionConfig:A=>{e.patchFusionConfig||(e.patchFusionConfig={});let c=e.patchFusionConfig.envVariables;Object.assign(e.patchFusionConfig,A),e.patchFusionConfig.envVariables={...c,...A.envVariables}},readFile:A=>this.readFile(A),writeFile:(A,c)=>this.writeFile(A,c),deleteFile:A=>this.deleteFile(A),fileExists:A=>this.fileExists(A),listDir:A=>this.listDir(A),evaluateAccess:(A,c)=>tA(A,c,this.#t?.accessControl,this.#G()),stat:A=>this.stat(A),localMCPManager:this.#ne,passThrough:(A,c)=>{let u={toolResult:"Aborted by the user. So the task could not be completed.",isError:!0,title:"Aborted by the user."};return new Promise(l=>{if(!(this.#e.connectionTracker.getConnectionCount()>0)){l({toolResult:"The user is currently not present in the chat. Ie, he is not able to respond to the request",isError:!0});return}let d=()=>{c.removeEventListener("abort",p),this.#H.delete(A.id)},p=()=>{d(),l(u)};if(c.aborted){p();return}c.addEventListener("abort",p,{once:!0}),this.#H.set(A.id,f=>{d(),l(f)}),this.#o.emit("step",{type:"tool-call-request",id:A.id,name:A.name,input:A.input})})},resolveWorkspacePath:(A,c)=>this.resolveWorkspacePath(A,c),absolutePathToWorkspaceUrl:A=>this.absolutePathToWorkspaceUrl(A),setHasPlanToApply:A=>{this.#Q=A},devServerOrchestrator:this.#r},a=await pue(s,o,r.cachedToolResults,i);if(r.cachedToolResults=a,s.signal?.aborted)throw sn(s.signal.reason);e.patchFusionConfig&&this.#o.emit("step",{type:"fusion-config-patch",patch:e.patchFusionConfig}),e.files=s.files,e.toolResults=a}finally{this.#x=[]}}}async#Pt(e,r,n,i){let o=this.getSessionContext(),s=Za(o.turns),a=structuredClone(e.user??s?.user??{source:"agent",role:"agent"}),A={userMessage:void 0,userPrompt:"",systemReminders:this.#b.slice(),files:[],attachments:[],searchResponse:null,rerankFiles:0,mostRelevantFile:null,toolResults:[],user:a,modelOverride:e.modelOverride,repair:e.repair,category:e.category,enabledMCPs:e.enabledMCPs},c=!!this.getLastTurn()?.nextUrl,u=o.turns.length<2||!c;if(r){let l=null;if(u){let g=due(await this.getAllFiles({getDotFiles:!1,gitignore:!0,deep:4,truncate:2e4})),d=new Set,p=new Set;if(e.files)for(let E of e.files)d.add(q5(E));let f=e.includeBaseFiles??o.turns.length===0,h=Array.from(d),m=E=>f&&YZ(E,this.#he)?10:f&&JZ(E,this.#he)?5:p.has(E)||h.some(B=>E.toLowerCase().startsWith(B.toLowerCase()))?2:0,I=n.aborted?[]:g.map(E=>{let B=m(E);if(B===0)return{filePath:E};let Q=null;try{if(Q=this.readFileSync(E),!Q)return{filePath:E}}catch{return{filePath:E}}let w=Q.length<3e4;return{filePath:E,content:Q,importance:w?B:2}});A.files=I,A.attachments=e.attachments??[]}if(this.#s){let g,d=await this.getChangesReport();if(d){for(let p of d.files)if(!A.files.some(f=>f.filePath===p))try{let f=await this.readFile(p);A.files.push({filePath:p,importance:0,content:f??void 0})}catch{A.files.push({filePath:p,importance:0})}d.diff.length<3e4?g=d.diff:g=d.files.map(p=>`- ${p}`).join(`
|
|
1914
1914
|
`).trim().slice(0,3e4),g&&A.systemReminders.push({text:`
|
|
1915
1915
|
Since last time, some files were changed by the user or tools (formatting for example):
|
|
1916
1916
|
<modified-files-context>
|
|
@@ -1923,7 +1923,7 @@ ${g}
|
|
|
1923
1923
|
${l}`):r.push(l))}catch(a){this.#e.Sentry?.captureException(a,{tags:{operation:"codegen-git",folderName:i.folderName}})}}if(e.length===0)return{files:[],diff:""};let n="";if(!this.#D()&&r.length>0)if(this.#i.length>1)n=`Notice: This is a multi-repo workspace with folders: ${this.#i.map(o=>o.folderName).join(", ")}. File paths are prefixed with their folder names when using Read/Write/Edit tools.
|
|
1924
1924
|
`;else{let i=this.gitEnabledFolder;i&&(n=`Notice that all the relative paths, are inside "${i.name}/", remember that when using Read/Write/Edit tools:
|
|
1925
1925
|
`)}return{files:e,diff:nm(`${n}${r.join(`
|
|
1926
|
-
`)}`,1e4)}}catch(e){this.#e.Sentry?.captureException(e,{tags:{operation:"codegen-git"}});return}}#Ut(){return["status","--porcelain=v1","-z","--ignore-submodules=dirty"]}async isCleanWorkTree(e){try{let r=this.#Ut();return(await this.git(r,{cwd:e})).trim().length===0}catch{return!1}}async#Gt(e,r){let n=r.applyResults,i=[];for(let o of n)try{if(o.action==="delete"){let s=await this.deleteFile(o.filePath);s&&i.push(s)}else if(o.content){let s=await this.writeFile(o.filePath,o.content);s&&(this.#ve.add(s),i.push(s))}}catch(s){e.Sentry?.captureException(s)}return i}#D(){return this.#A?.folders?.length===1||!this.#A?.folders?.length}resolveWorkspacePath(e,r){return Nte({filePath:e,forceWorkspace:r,workspace:this.#A,workingDirectory:this.#u,sys:this.#e,canCollapseWorkspace:this.#D()})}#U(){try{let e=this.getSessionContext();return Za(e.turns)?.user.principals}catch{return}}absolutePathToWorkspaceUrl(e){return Mte({absolutePath:e,workspace:this.#A,workingDirectory:this.#u,sys:this.#e,canCollapseWorkspace:this.#D()})}async launchEditor(e={}){let r,n,i;return e.filePath?(r=this.resolveWorkspacePath(e.filePath,!1).resolvedPath,n=e.line??void 0,i=e.column??void 0):r=this.#d,await this.#e.exists(r)?await this.#e.launchEditor({filePath:r,line:n,column:i}):{success:!1,message:`File not found: ${r}`}}async readFile(e,r){if(!r){let n=tA(e,"read",this.#t?.accessControl,this.#U());if(!n.allowed)throw new _t(`ACL denied: ${n.message}`)}try{if(e==="AGENTS.md"&&this.#A?.agentsMD)return this.#A.agentsMD;let{resolvedPath:n}=this.resolveWorkspacePath(e,!!r);if(await this.#e.exists(n))return await this.#e.readFile(n);if({resolvedPath:n}=this.resolveWorkspacePath(e,!0),await this.#e.exists(n))return await this.#e.readFile(n)}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return null}async#Pe(e){let r;e?r=this.#i.find(o=>o.path===e)?.branchName:r=this.gitEnabledFolder?.branchName;let n=r?r.startsWith("origin/")?r:`origin/${r}`:await this.getDefaultBranch(e);if(!n)throw new Error("Could not find parent branch");return n}async getFileAtRef(e,r,n){if(!this.#s)return null;try{let i,o;if(n)i=n,e.startsWith(i)?(o=e.substring(i.length),o.startsWith("/")&&(o=o.substring(1))):o=e;else{let{resolvedPath:A,workspaceFolder:c}=this.resolveWorkspacePath(e,!0);i=c?.path||this.#u,o=e,i&&A.startsWith(i)&&(o=A.substring(i.length),o.startsWith("/")&&(o=o.substring(1)))}let s=r;if(!s){let A=await this.#Pe(i);try{s=(await this.git(["merge-base",A,"HEAD"],{cwd:i})).trim()}catch{s=A}}return await this.git(["show",`${s}:${o}`],{cwd:i})}catch{return null}}async getSingleFileDiff(e){let r=typeof e=="string"?{path:e}:e,{repoPath:n,relativePath:i}=this.#Fe(r.path,r.folderName),o=this.#e.join(n,i),s=null;try{await this.#e.exists(o)&&(s=await this.#e.readFile(o))}catch{s=null}let a=await this.getFileAtRef(i,void 0,n),A;return a===null&&s!==null?A="create":a!==null&&s===null?A="delete":A="update",{oldContent:a,newContent:s,action:A}}async discardFileChanges(e){let r=typeof e=="string"?{filePath:e}:e;if(!this.#s)return{success:!1,error:"Git not configured"};try{let{repoPath:n,relativePath:i}=this.#Fe(r.filePath,r.folderName),o=this.#e.join(n,i),s=await this.#Pe(n),a;try{a=(await this.git(["merge-base",s,"HEAD"],{cwd:n})).trim()}catch{a=s}let A=await this.getFileAtRef(i,a,n),u=(await this.git(["--no-pager","diff",`${a}`,"HEAD","--",i],{cwd:n})).trim().length>0,g=(await this.git(["status","--porcelain","--",i],{cwd:n})).trim().length>0;if(!u&&!g)return{success:!0};if(A===null){try{await this.#e.exists(o)&&await this.#e.unlink(o)}catch{}let f=this.#e.dirname(i);if(f&&f!==".")try{await this.git(["clean","-fd",f],{cwd:n})}catch{}}else try{await this.git(["restore",`--source=${a}`,"--",i],{cwd:n})}catch(f){return{success:!1,error:`Failed to restore file: ${f}`}}await this.git(["add","--",i],{cwd:n});let d=`Discard changes to ${i}`;await this.git(["commit","--no-gpg-sign","-m",d],{cwd:n});let p=(await this.git(["rev-parse","HEAD"],{cwd:n})).trim();try{await this.emitGitStatus()}catch(f){this.#e.Sentry?.captureException(f,{tags:{operation:"discard-file-changes",step:"emit-git-status"}})}return{success:!0,commitHash:p}}catch(n){return{success:!1,error:n instanceof Error?n.message:String(n)}}}async revertDiscard(e){let{commitHash:r,folderName:n}=e;if(!this.#s)return{success:!1,error:"Git not configured"};try{let i=this.#se(n);await this.git(["revert","--no-edit",r],{cwd:i});try{await this.emitGitStatus()}catch(o){this.#e.Sentry?.captureException(o,{tags:{operation:"revert-discard",step:"emit-git-status"}})}return{success:!0}}catch(i){return{success:!1,error:i instanceof Error?i.message:String(i)}}}async fileExists(e){let r=n=>n.startsWith(this.#u)?this.#e.relative(this.#u,n):n;try{if(e==="AGENTS.md"&&this.#A?.agentsMD)return{absolutePath:e,recommendedPath:void 0,workspaceFolder:void 0,virtual:!0};let{resolvedPath:n,workspaceFolder:i}=this.resolveWorkspacePath(e,!1);return await this.#e.exists(n)?{absolutePath:n,recommendedPath:void 0,workspaceFolder:i,virtual:!1}:i?{absolutePath:void 0,recommendedPath:void 0,workspaceFolder:i,virtual:!1}:({resolvedPath:n,workspaceFolder:i}=this.resolveWorkspacePath(e,!0),await this.#e.exists(n)?{absolutePath:n,recommendedPath:r(n),workspaceFolder:i,virtual:!1}:{absolutePath:void 0,recommendedPath:r(n),workspaceFolder:i,virtual:!1})}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return{absolutePath:void 0,recommendedPath:void 0,workspaceFolder:void 0,virtual:!1}}readFileSync(e,r){if(!r){let n=tA(e,"read",this.#t?.accessControl,this.#U());if(!n.allowed)throw new _t(`ACL denied: ${n.message}`)}try{if(e==="AGENTS.md"&&this.#A?.agentsMD)return this.#A.agentsMD;let{resolvedPath:n}=this.resolveWorkspacePath(e,!1);if(this.#e.existsSync(n))return this.#e.readFileSync(n);if({resolvedPath:n}=this.resolveWorkspacePath(e,!0),this.#e.existsSync(n))return this.#e.readFileSync(n)}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return null}async writeFile(e,r,n){if(!n){let i=tA(e,"write",this.#t?.accessControl,this.#U());if(!i.allowed)throw new _t(`ACL denied: ${i.message}`)}try{let{resolvedPath:i}=this.resolveWorkspacePath(e,!!n);return await this.#e.writeFile(i,r),i}catch(i){return this.#e.Sentry?.captureException(i,{extra:{filePath:e}}),null}}async listDir(e){let r=tA(e,"list",this.#t?.accessControl,this.#U());if(!r.allowed)throw new _t(`ACL denied: ${r.message}`);try{let{resolvedPath:n,workspaceFolder:i}=this.resolveWorkspacePath(e,!1),o=this.#e.normalize(n),s=this.#e.normalize(this.#u),a=s.includes("\\")?"\\":"/";if(!o.startsWith(s+a)&&o!==s)throw new _t("Access denied: path outside working directory");if(!await this.#e.exists(n))return[];let c=(await(0,gue.readdir)(n,{withFileTypes:!0})).map(u=>u.name+(u.isDirectory()?"/":""));if(this.#D())return fd({files:c.map(u=>zo(this.#e.join(e,u))),policy:this.#t?.accessControl,getDotFiles:!0});if(i&&this.#A?.folders){let u=i.name||i.path,l=e;return e.startsWith(u+"/")?l=e.substring(u.length+1):e===u&&(l=""),fd({files:c.map(g=>{let d=l?this.#e.join(l,g):g,p=zo(d);return`${u}/${p}`}),policy:this.#t?.accessControl,getDotFiles:!0})}return fd({files:c,policy:this.#t?.accessControl,getDotFiles:!0})}catch(n){return this.#e.Sentry?.captureException(n,{extra:{dirPath:e}}),[]}}async stat(e,r){if(!r){let n=tA(e,"read",this.#t?.accessControl,this.#U());if(!n.allowed)throw new _t(`ACL denied: ${n.message}`)}try{let{resolvedPath:n}=this.resolveWorkspacePath(e,!1);if(await this.#e.exists(n))return await this.#e.stat(n)}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return null}async deleteFile(e,r){if(!r){let n=tA(e,"write",this.#t?.accessControl,this.#U());if(!n.allowed)throw new _t(`ACL denied: ${n.message}`)}try{let{resolvedPath:n}=this.resolveWorkspacePath(e,!!r);return await this.#e.exists(n)?(await this.#e.unlink(n),n):null}catch(n){return this.#e.Sentry?.captureException(n,{extra:{filePath:e}}),null}}getLinesStats(){let e=this.#g?.turns.reduce((r,n)=>{let i=n.applyResults.reduce((o,s)=>({added:o.added+s.addedLines,removed:o.removed+s.removedLines}),{added:0,removed:0});return{added:r.added+i.added,removed:r.removed+i.removed}},{added:0,removed:0})??{added:0,removed:0};return{...e,net:e.added-e.removed}}async getDiffFromRemote({numberOfContextLines:e,includeFilesOnly:r,filePaths:n,folderName:i}){if(!this.#s)return[];let o=this.#se(i);try{let s=(await this.git(["branch","--show-current"],{cwd:o})).trim();if(!s)throw new Error("Could not determine current branch");let a=!1;try{a=(await this.git(["remote"],{cwd:o})).includes("origin")}catch(g){throw console.warn("No git remotes configured, cannot get diff from remote"),g}if(!a){console.warn("Origin remote not found, trying to get diff from main branch");try{return await this.getDiffFromParentBranch({numberOfContextLines:e,includeFilesOnly:r,filePaths:n,folderName:i})}catch(g){throw console.warn("Failed to get diff from main branch:",g),g}}let A=!1,c;try{let g=`origin/${s}`;if(A=(await this.git(["ls-remote","--heads","origin",s],{cwd:o})).trim().length>0,A)c=g;else return await this.getDiffFromParentBranch({numberOfContextLines:e,includeFilesOnly:r,filePaths:n,folderName:i})}catch(g){throw console.warn("Failed to check remote branches:",g),g}let u=["diff",c];r?u.push("--raw","--numstat","--no-renames"):e!==void 0&&u.push(`-U${e}`),u.push("--"),n&&n.length>0&&u.push(...n);let l=await this.git(u,{cwd:o});return!l||l.trim()===""?[]:mU(l,r)}catch(s){throw console.error("getDiffFromRemote error:",s),s}}async getDiff({mode:e="remote-parent-branch",numberOfContextLines:r,includeFilesOnly:n,filePaths:i,folderName:o}){if(!this.#s)return{state:"error",error:new Error("Git not configured")};try{switch(e){case"remote-parent-branch":return{state:"success",diff:await this.getDiffFromParentBranch({numberOfContextLines:r,includeFilesOnly:n,filePaths:i,folderName:o})};case"remote-current-branch":return{state:"success",diff:await this.getDiffFromRemote({numberOfContextLines:r,includeFilesOnly:n,filePaths:i,folderName:o})};default:throw new Error(`Unknown diff mode: ${e}`)}}catch(s){return console.error(`getDiff error for mode '${e}':`,s),this.#e.Sentry?.captureException(s),{state:"error",error:s instanceof Error?s:new Error(String(s))}}}async getDefaultBranch(e){try{let n=(await this.git(["remote","show","origin"],{cwd:e})).match(/HEAD branch: (.+)/);if(n)return`origin/${n[1].trim()}`}catch{}try{if((await this.git(["ls-remote","--heads","origin","main"],{cwd:e})).trim().length>0)return"origin/main"}catch{}try{if((await this.git(["ls-remote","--heads","origin","master"],{cwd:e})).trim().length>0)return"origin/master"}catch{}try{let n=(await this.git(["ls-remote","--heads","origin"],{cwd:e})).trim().split(`
|
|
1926
|
+
`)}`,1e4)}}catch(e){this.#e.Sentry?.captureException(e,{tags:{operation:"codegen-git"}});return}}#Ut(){return["status","--porcelain=v1","-z","--ignore-submodules=dirty"]}async isCleanWorkTree(e){try{let r=this.#Ut();return(await this.git(r,{cwd:e})).trim().length===0}catch{return!1}}async#Gt(e,r){let n=r.applyResults,i=[];for(let o of n)try{if(o.action==="delete"){let s=await this.deleteFile(o.filePath);s&&i.push(s)}else if(o.content){let s=await this.writeFile(o.filePath,o.content);s&&(this.#xe.add(s),i.push(s))}}catch(s){e.Sentry?.captureException(s)}return i}#D(){return this.#A?.folders?.length===1||!this.#A?.folders?.length}resolveWorkspacePath(e,r){return Nte({filePath:e,forceWorkspace:r,workspace:this.#A,workingDirectory:this.#u,sys:this.#e,canCollapseWorkspace:this.#D()})}#G(){try{let e=this.getSessionContext();return Za(e.turns)?.user.principals}catch{return}}absolutePathToWorkspaceUrl(e){return Mte({absolutePath:e,workspace:this.#A,workingDirectory:this.#u,sys:this.#e,canCollapseWorkspace:this.#D()})}async launchEditor(e={}){let r,n,i;return e.filePath?(r=this.resolveWorkspacePath(e.filePath,!1).resolvedPath,n=e.line??void 0,i=e.column??void 0):r=this.#d,await this.#e.exists(r)?await this.#e.launchEditor({filePath:r,line:n,column:i}):{success:!1,message:`File not found: ${r}`}}async readFile(e,r){if(!r){let n=tA(e,"read",this.#t?.accessControl,this.#G());if(!n.allowed)throw new _t(`ACL denied: ${n.message}`)}try{if(e==="AGENTS.md"&&this.#A?.agentsMD)return this.#A.agentsMD;let{resolvedPath:n}=this.resolveWorkspacePath(e,!!r);if(await this.#e.exists(n))return await this.#e.readFile(n);if({resolvedPath:n}=this.resolveWorkspacePath(e,!0),await this.#e.exists(n))return await this.#e.readFile(n)}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return null}async#Pe(e){let r;e?r=this.#i.find(o=>o.path===e)?.branchName:r=this.gitEnabledFolder?.branchName;let n=r?r.startsWith("origin/")?r:`origin/${r}`:await this.getDefaultBranch(e);if(!n)throw new Error("Could not find parent branch");return n}async getFileAtRef(e,r,n){if(!this.#s)return null;try{let i,o;if(n)i=n,e.startsWith(i)?(o=e.substring(i.length),o.startsWith("/")&&(o=o.substring(1))):o=e;else{let{resolvedPath:A,workspaceFolder:c}=this.resolveWorkspacePath(e,!0);i=c?.path||this.#u,o=e,i&&A.startsWith(i)&&(o=A.substring(i.length),o.startsWith("/")&&(o=o.substring(1)))}let s=r;if(!s){let A=await this.#Pe(i);try{s=(await this.git(["merge-base",A,"HEAD"],{cwd:i})).trim()}catch{s=A}}return await this.git(["show",`${s}:${o}`],{cwd:i})}catch{return null}}async getSingleFileDiff(e){let r=typeof e=="string"?{path:e}:e,{repoPath:n,relativePath:i}=this.#Fe(r.path,r.folderName),o=this.#e.join(n,i),s=null;try{await this.#e.exists(o)&&(s=await this.#e.readFile(o))}catch{s=null}let a=await this.getFileAtRef(i,void 0,n),A;return a===null&&s!==null?A="create":a!==null&&s===null?A="delete":A="update",{oldContent:a,newContent:s,action:A}}async discardFileChanges(e){let r=typeof e=="string"?{filePath:e}:e;if(!this.#s)return{success:!1,error:"Git not configured"};try{let{repoPath:n,relativePath:i}=this.#Fe(r.filePath,r.folderName),o=this.#e.join(n,i),s=await this.#Pe(n),a;try{a=(await this.git(["merge-base",s,"HEAD"],{cwd:n})).trim()}catch{a=s}let A=await this.getFileAtRef(i,a,n),u=(await this.git(["--no-pager","diff",`${a}`,"HEAD","--",i],{cwd:n})).trim().length>0,g=(await this.git(["status","--porcelain","--",i],{cwd:n})).trim().length>0;if(!u&&!g)return{success:!0};if(A===null){try{await this.#e.exists(o)&&await this.#e.unlink(o)}catch{}let f=this.#e.dirname(i);if(f&&f!==".")try{await this.git(["clean","-fd",f],{cwd:n})}catch{}}else try{await this.git(["restore",`--source=${a}`,"--",i],{cwd:n})}catch(f){return{success:!1,error:`Failed to restore file: ${f}`}}await this.git(["add","--",i],{cwd:n});let d=`Discard changes to ${i}`;await this.git(["commit","--no-gpg-sign","-m",d],{cwd:n});let p=(await this.git(["rev-parse","HEAD"],{cwd:n})).trim();try{await this.emitGitStatus()}catch(f){this.#e.Sentry?.captureException(f,{tags:{operation:"discard-file-changes",step:"emit-git-status"}})}return{success:!0,commitHash:p}}catch(n){return{success:!1,error:n instanceof Error?n.message:String(n)}}}async revertDiscard(e){let{commitHash:r,folderName:n}=e;if(!this.#s)return{success:!1,error:"Git not configured"};try{let i=this.#se(n);await this.git(["revert","--no-edit",r],{cwd:i});try{await this.emitGitStatus()}catch(o){this.#e.Sentry?.captureException(o,{tags:{operation:"revert-discard",step:"emit-git-status"}})}return{success:!0}}catch(i){return{success:!1,error:i instanceof Error?i.message:String(i)}}}async fileExists(e){let r=n=>n.startsWith(this.#u)?this.#e.relative(this.#u,n):n;try{if(e==="AGENTS.md"&&this.#A?.agentsMD)return{absolutePath:e,recommendedPath:void 0,workspaceFolder:void 0,virtual:!0};let{resolvedPath:n,workspaceFolder:i}=this.resolveWorkspacePath(e,!1);return await this.#e.exists(n)?{absolutePath:n,recommendedPath:void 0,workspaceFolder:i,virtual:!1}:i?{absolutePath:void 0,recommendedPath:void 0,workspaceFolder:i,virtual:!1}:({resolvedPath:n,workspaceFolder:i}=this.resolveWorkspacePath(e,!0),await this.#e.exists(n)?{absolutePath:n,recommendedPath:r(n),workspaceFolder:i,virtual:!1}:{absolutePath:void 0,recommendedPath:r(n),workspaceFolder:i,virtual:!1})}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return{absolutePath:void 0,recommendedPath:void 0,workspaceFolder:void 0,virtual:!1}}readFileSync(e,r){if(!r){let n=tA(e,"read",this.#t?.accessControl,this.#G());if(!n.allowed)throw new _t(`ACL denied: ${n.message}`)}try{if(e==="AGENTS.md"&&this.#A?.agentsMD)return this.#A.agentsMD;let{resolvedPath:n}=this.resolveWorkspacePath(e,!1);if(this.#e.existsSync(n))return this.#e.readFileSync(n);if({resolvedPath:n}=this.resolveWorkspacePath(e,!0),this.#e.existsSync(n))return this.#e.readFileSync(n)}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return null}async writeFile(e,r,n){if(!n){let i=tA(e,"write",this.#t?.accessControl,this.#G());if(!i.allowed)throw new _t(`ACL denied: ${i.message}`)}try{let{resolvedPath:i}=this.resolveWorkspacePath(e,!!n);return await this.#e.writeFile(i,r),i}catch(i){return this.#e.Sentry?.captureException(i,{extra:{filePath:e}}),null}}async listDir(e){let r=tA(e,"list",this.#t?.accessControl,this.#G());if(!r.allowed)throw new _t(`ACL denied: ${r.message}`);try{let{resolvedPath:n,workspaceFolder:i}=this.resolveWorkspacePath(e,!1),o=this.#e.normalize(n),s=this.#e.normalize(this.#u),a=s.includes("\\")?"\\":"/";if(!o.startsWith(s+a)&&o!==s)throw new _t("Access denied: path outside working directory");if(!await this.#e.exists(n))return[];let c=(await(0,gue.readdir)(n,{withFileTypes:!0})).map(u=>u.name+(u.isDirectory()?"/":""));if(this.#D())return fd({files:c.map(u=>zo(this.#e.join(e,u))),policy:this.#t?.accessControl,getDotFiles:!0});if(i&&this.#A?.folders){let u=i.name||i.path,l=e;return e.startsWith(u+"/")?l=e.substring(u.length+1):e===u&&(l=""),fd({files:c.map(g=>{let d=l?this.#e.join(l,g):g,p=zo(d);return`${u}/${p}`}),policy:this.#t?.accessControl,getDotFiles:!0})}return fd({files:c,policy:this.#t?.accessControl,getDotFiles:!0})}catch(n){return this.#e.Sentry?.captureException(n,{extra:{dirPath:e}}),[]}}async stat(e,r){if(!r){let n=tA(e,"read",this.#t?.accessControl,this.#G());if(!n.allowed)throw new _t(`ACL denied: ${n.message}`)}try{let{resolvedPath:n}=this.resolveWorkspacePath(e,!1);if(await this.#e.exists(n))return await this.#e.stat(n)}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return null}async deleteFile(e,r){if(!r){let n=tA(e,"write",this.#t?.accessControl,this.#G());if(!n.allowed)throw new _t(`ACL denied: ${n.message}`)}try{let{resolvedPath:n}=this.resolveWorkspacePath(e,!!r);return await this.#e.exists(n)?(await this.#e.unlink(n),n):null}catch(n){return this.#e.Sentry?.captureException(n,{extra:{filePath:e}}),null}}getLinesStats(){let e=this.#g?.turns.reduce((r,n)=>{let i=n.applyResults.reduce((o,s)=>({added:o.added+s.addedLines,removed:o.removed+s.removedLines}),{added:0,removed:0});return{added:r.added+i.added,removed:r.removed+i.removed}},{added:0,removed:0})??{added:0,removed:0};return{...e,net:e.added-e.removed}}async getDiffFromRemote({numberOfContextLines:e,includeFilesOnly:r,filePaths:n,folderName:i}){if(!this.#s)return[];let o=this.#se(i);try{let s=(await this.git(["branch","--show-current"],{cwd:o})).trim();if(!s)throw new Error("Could not determine current branch");let a=!1;try{a=(await this.git(["remote"],{cwd:o})).includes("origin")}catch(g){throw console.warn("No git remotes configured, cannot get diff from remote"),g}if(!a){console.warn("Origin remote not found, trying to get diff from main branch");try{return await this.getDiffFromParentBranch({numberOfContextLines:e,includeFilesOnly:r,filePaths:n,folderName:i})}catch(g){throw console.warn("Failed to get diff from main branch:",g),g}}let A=!1,c;try{let g=`origin/${s}`;if(A=(await this.git(["ls-remote","--heads","origin",s],{cwd:o})).trim().length>0,A)c=g;else return await this.getDiffFromParentBranch({numberOfContextLines:e,includeFilesOnly:r,filePaths:n,folderName:i})}catch(g){throw console.warn("Failed to check remote branches:",g),g}let u=["diff",c];r?u.push("--raw","--numstat","--no-renames"):e!==void 0&&u.push(`-U${e}`),u.push("--"),n&&n.length>0&&u.push(...n);let l=await this.git(u,{cwd:o});return!l||l.trim()===""?[]:mU(l,r)}catch(s){throw console.error("getDiffFromRemote error:",s),s}}async getDiff({mode:e="remote-parent-branch",numberOfContextLines:r,includeFilesOnly:n,filePaths:i,folderName:o}){if(!this.#s)return{state:"error",error:new Error("Git not configured")};try{switch(e){case"remote-parent-branch":return{state:"success",diff:await this.getDiffFromParentBranch({numberOfContextLines:r,includeFilesOnly:n,filePaths:i,folderName:o})};case"remote-current-branch":return{state:"success",diff:await this.getDiffFromRemote({numberOfContextLines:r,includeFilesOnly:n,filePaths:i,folderName:o})};default:throw new Error(`Unknown diff mode: ${e}`)}}catch(s){return console.error(`getDiff error for mode '${e}':`,s),this.#e.Sentry?.captureException(s),{state:"error",error:s instanceof Error?s:new Error(String(s))}}}async getDefaultBranch(e){try{let n=(await this.git(["remote","show","origin"],{cwd:e})).match(/HEAD branch: (.+)/);if(n)return`origin/${n[1].trim()}`}catch{}try{if((await this.git(["ls-remote","--heads","origin","main"],{cwd:e})).trim().length>0)return"origin/main"}catch{}try{if((await this.git(["ls-remote","--heads","origin","master"],{cwd:e})).trim().length>0)return"origin/master"}catch{}try{let n=(await this.git(["ls-remote","--heads","origin"],{cwd:e})).trim().split(`
|
|
1927
1927
|
`).map(i=>i.split(" ")[1]).filter(i=>i&&!i.includes("HEAD"));if(n.length>0)return`origin/${n[0].replace("refs/heads/","")}`}catch{}throw new Error("Could not determine default branch. No remote branches found.")}async getDiffFromParentBranch({numberOfContextLines:e,includeFilesOnly:r,filePaths:n,folderName:i}){let o=this.#se(i);try{if(!(await this.git(["branch","--show-current"],{cwd:o})).trim())throw new Error("Could not determine current branch");let A=["--no-pager","diff",`${await this.#Pe(o)}...HEAD`];r?A.push("--raw","--numstat","--no-renames"):e!==void 0&&A.push(`-U${e}`),A.push("--"),n&&n.length>0&&A.push(...n);let c=await this.git(A,{cwd:o});return!c||c.trim()===""?[]:mU(c,r)}catch(s){throw console.error("getDiffFromParentBranch error:",s),s}}},rb=(t,e)=>e.filter(r=>!t?.disabledTools?.includes(r))});function fue(t){return t instanceof Error?t.message:String(t)}function OI(t,e){if(QU(e).test(t))return!0;if(e.toLowerCase().includes("localhost")){let n=e.replace(/localhost/gi,"127.0.0.1");if(QU(n).test(t))return!0}else if(e.includes("127.0.0.1")){let n=e.replace(/127\.0\.0\.1/g,"localhost");if(QU(n).test(t))return!0}return!1}function QU(t){return t=String(t).replace(/\./g,"\\.").replace(/\?/g,".").replace(/\*/g,".*"),new RegExp(`^${t}$`,"i")}var ob,Cue=M(()=>{"use strict";C();ob=class{logger;currentOrigin=null;currentOriginPattern=null;currentDestination=null;currentOriginHost=null;constructor(e){this.logger=e}getCurrentOrigin(){return this.currentOrigin}getCurrentDestination(){return this.currentDestination}clearMapping(){this.currentOrigin=null,this.currentOriginPattern=null,this.currentDestination=null,this.currentOriginHost=null,this.logger?.info("[UrlMapper] Mapping cleared")}setMapping(e,r){if(e.includes("*")||!e.startsWith("https://")&&!e.startsWith("http://")){this.currentOriginPattern=e,this.currentOriginHost=null,this.currentOrigin=e;try{let i=new URL(r);this.currentDestination=`${i.protocol}//${i.hostname}${i.port?":"+i.port:""}`}catch(i){this.logger?.error(`[UrlMapper] Failed to parse destination URL: ${fue(i)}`),this.currentDestination=r}this.logger?.info(`[UrlMapper] Set mapping (PATTERN): ${e} \u2192 ${r}`)}else{this.currentOriginPattern=null;try{let i=new URL(e),o=i.protocol==="https:"?"443":"80",s=i.port||o;this.currentOriginHost=`${i.hostname}:${s}`,this.currentOrigin=`${i.protocol}//${i.hostname}${i.port?":"+i.port:""}`;let a=new URL(r);this.currentDestination=`${a.protocol}//${a.hostname}${a.port?":"+a.port:""}`,this.logger?.info(`[UrlMapper] Set mapping (EXACT): ${e} \u2192 ${r}`),this.logger?.debug(`[UrlMapper] Normalized origin: ${this.currentOrigin} (host: ${this.currentOriginHost})`),this.logger?.debug(`[UrlMapper] Normalized destination: ${this.currentDestination}`)}catch(i){this.logger?.error(`[UrlMapper] Failed to parse origin/destination URL: ${fue(i)}`),this.currentOriginHost=null,this.currentOrigin=e,this.currentDestination=r}}}getUpstream(e){if(!this.currentDestination)return null;if(this.currentOriginPattern){let r=this.currentOriginPattern.replace(/^https?:\/\//g,""),n=r.split(":")[0],i=e.split(":")[0];return OI(i,n)?(this.logger?.debug(`[UrlMapper] PATTERN MATCH FOUND getUpstream(${e}) matched hostname: ${n} -> ${this.currentDestination}`),this.currentDestination):OI(e,r)?(this.logger?.debug(`[UrlMapper] PATTERN MATCH FOUND getUpstream(${e}) matched host: ${r} -> ${this.currentDestination}`),this.currentDestination):(this.logger?.debug(`[UrlMapper] NO PATTERN MATCH getUpstream(${e}) !== ${r}`),null)}return this.currentOriginHost?OI(e,this.currentOriginHost)?(this.logger?.debug(`[UrlMapper] MATCH FOUND getUpstream(${e}) -> ${this.currentDestination}`),this.currentDestination):OI(`${e}:80`,this.currentOriginHost)?(this.logger?.debug(`[UrlMapper] MATCH FOUND getUpstream(${e}) (HTTP) -> ${this.currentDestination}`),this.currentDestination):OI(`${e}:443`,this.currentOriginHost)?(this.logger?.debug(`[UrlMapper] MATCH FOUND getUpstream(${e}) (TLS) -> ${this.currentDestination}`),this.currentDestination):(this.logger?.debug(`[UrlMapper] NO MATCH getUpstream(${e}) !== ${this.currentOriginHost}`),null):null}buildUpstreamUrl(e,r="/"){let n=r||"/";n=n.replace(/^\/+/,"/");let i=new URL(n,e),o=new URL(e);return o.pathname=i.pathname.replace(/\/+/g,"/"),o.search=i.search,o.hash=i.hash,o}mapUrl(e){let r=e.host,n=this.getUpstream(r);if(!n)return e;let i=e.pathname+e.search+e.hash;return this.buildUpstreamUrl(n,i)}isOriginHttps(e=443){let r=this.currentOrigin?.split("://")[0];return r==="http"||r==="https"?r==="https":e===443}}});var hue,DU,mue=M(()=>{"use strict";C();hue=ie(require("node:os"),1),DU=(t,e)=>{try{hue.default.setPriority(t,e)}catch(r){console.error(`Failed to set priority to ${e}: ${r}`)}}});async function pue(t,e,r,n){let i=[],o=s=>{let a=s instanceof Promise?s:Promise.resolve(s);i.push(a),a.then(A=>{n({type:"tool_result",result:{...A,content:A.structured_result?JSON.stringify(A.structured_result):A.content}})}).catch(A=>{sb.captureException(new Error("Unhandled tool call error",{cause:A}))})};for(let s of e){let a=Ai([s.abortController.signal,t.signal]),A=r?.find(c=>c.tool_use_id===s.id);if(A){i.push(A);continue}if(a.aborted)o({type:"tool_result",tool_use_id:s.id,tool_name:s.name,tool_input:JSON.stringify(s.input),content:"Aborted by the user. So the task could not be completed.",is_error:!0,title:"Aborted by the user."});else try{let c=await M$e(s,{...t,signal:a});o(typeof c=="function"?c().then(u=>Iue(s,u)):Iue(s,c))}catch(c){o({type:"tool_result",tool_name:s.name,tool_input:JSON.stringify(s.input),tool_use_id:s.id,content:c instanceof Error?c.message:"Unknown error",is_error:!0,title:`Error calling tool "${s.name}"`})}}return Promise.all(i)}function Iue(t,e){return{type:"tool_result",tool_use_id:t.id,tool_name:t.name,tool_input:JSON.stringify(t.input),content:e.toolResult,is_error:e.isError,title:e.title,structured_result:e.structuredResult}}function M$e(t,e){if(t.name.startsWith("mcp__")&&e.localMCPManager)return T$e(e,t);switch(t.name){case"view_path":return G$e(e,t.input);case"Write":case"Edit":case"MultiEdit":return P$e(e,t.input);case"Read":return O$e(e,t.input);case"LS":return K$e(e,t.input);case"glob_search":case"Glob":return Eue(e,t.input);case"grep_search":case"Grep":return z$e(e,t.input);case"dev_server_control":case"DevServerControl":return _$e(e,t.input);case"ServerLogs":return U$e(e);case"bash":case"Bash":return X$e(e,t.input,t.id);case"powershell":case"PowerShell":return eqe(e,t.input,t.id);case"AskUserQuestion":return e.passThrough(t,e.signal);case"Agent":return tqe(e,t.input,t.id);case"Revert":return L$e(e,t.input);case"ExitPlanMode":return H$e(e,t.input);case"RecordFrame":return j$e(e,t.input);case"GetScreenshot":return $$e(e,t.input);case"ProposeConfig":return J$e(e,t.input);case"UpdateSetupValue":return Y$e(e,t.input);case"ReportUIIssue":return rqe(e,t.input);case"VerifyInstallCommand":return nqe(e,t.input);case"VerifyDevServer":return iqe(e,t.input);case"VerifyValidationScript":return oqe(e,t.input);case"VerifyRuntimeDependency":return sqe(e,t.input);default:throw new Error("Unknown tool call. Do not use this tool anymore.")}}async function T$e({localMCPManager:t,signal:e},r){if(!t)return{isError:!0,toolResult:`Local MCP tool "${r.name}" not available`,title:"Local MCP Tool Error"};try{let n=await t.callTool(r.name,r.input,e);return{isError:n.isError??!1,toolResult:n.content,title:`Local MCP: ${r.name}`}}catch(n){return{isError:!0,toolResult:n instanceof Error?n.message:"Unknown error",title:`Local MCP Tool Error: ${r.name}`}}}async function P$e({fileExists:t,evaluateAccess:e},r){let{file_path:n}=r;if(!n)return{isError:!0,toolResult:"No file path provided"};let i=await t(n);if(i.recommendedPath)return i.recommendedPath===n?{isError:!0,toolResult:`File not found: ${JSON.stringify(n)}.`}:{isError:!0,toolResult:`File not found: ${JSON.stringify(n)}, use ${JSON.stringify(i.recommendedPath)} instead.`};let o=e(n,"write");return o.allowed?{isError:!0,toolResult:`ACL policy violation. You do not have permission to write to ${n}.`}:{isError:!0,toolResult:`ACL policy violation when writing to ${n}.
|
|
1928
1928
|
${o.message}`}}async function L$e(t,{checkpoint_id:e}){if(!e)return{isError:!0,toolResult:"No checkpoint_id provided",title:"Revert failed"};let r=await t.restore({location:"before",predicate:n=>n?.completionId.startsWith(e)??!1,revert:!0,dryRun:!1,forceReplay:!1});return r.undone?{isError:!1,toolResult:`Reverted to checkpoint ${e} successfully`,title:"Reverted to checkpoint"}:{isError:!0,toolResult:`Failed to revert to checkpoint ${e}. ${r.message}`,title:"Revert failed"}}async function _$e({devServerOrchestrator:t,patchFusionConfig:e,emitter:r,signal:n,user:i},{restart:o,get_logs:s,set_proxy_port:a,set_dev_command:A,set_and_run_setup_command:c,set_env_variable:u}){let l="You do not have permission to change settings (e.g. environment variables, dev server command, etc). Do not try to workaround this limitation. Communicate to the user that this task is not possible.";if(!t)return{isError:!0,toolResult:"Seems like the 'DevServerControl' tool is not available. Please suggest the user to either restore or try to fix the issue themself.",title:"Getting debug output"};let g=!1,d="";if(u){if(i.permissions&&!i.permissions.includes("modifyProjectSettings"))return{isError:!0,toolResult:l,title:"Changing project setting not allowed"};let[I,E]=u;return t.setEnvVariable(I,E),e({envVariables:{[I]:E}}),{isError:!1,toolResult:`Environment variable "${u[0]}" was set to "${u[1]}".
|
|
1929
1929
|
|
|
@@ -2564,7 +2564,7 @@ Please see the 3.x to 4.x migration guide for details on how to update your app.
|
|
|
2564
2564
|
`)+`\r
|
|
2565
2565
|
\r
|
|
2566
2566
|
`+r)}function Ng(t,e,r,n,i,o){if(t.listenerCount("wsClientError")){let s=new Error(i);Error.captureStackTrace(s,Ng),t.emit("wsClientError",s,r,e)}else XE(r,n,i,o)}});var $Ee=v((xqt,jEe)=>{C();var OO=class{constructor(e,r,n){this.etaBufferLength=e||100,this.valueBuffer=[n],this.timeBuffer=[r],this.eta="0"}update(e,r,n){this.valueBuffer.push(r),this.timeBuffer.push(e),this.calculate(n-r)}getTime(){return this.eta}calculate(e){let r=this.valueBuffer.length,n=Math.min(this.etaBufferLength,r),i=this.valueBuffer[r-1]-this.valueBuffer[r-n],o=this.timeBuffer[r-1]-this.timeBuffer[r-n],s=i/o;this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);let a=Math.ceil(e/s/1e3);isNaN(a)?this.eta="NULL":isFinite(a)?a>1e7?this.eta="INF":a<0?this.eta=0:this.eta=a:this.eta="INF"}};jEe.exports=OO});var HO=v((Fqt,qEe)=>{C();var Mg=require("readline"),KO=class{constructor(e){this.stream=e,this.linewrap=!0,this.dy=0}cursorSave(){this.stream.isTTY&&this.stream.write("\x1B7")}cursorRestore(){this.stream.isTTY&&this.stream.write("\x1B8")}cursor(e){this.stream.isTTY&&(e?this.stream.write("\x1B[?25h"):this.stream.write("\x1B[?25l"))}cursorTo(e=null,r=null){this.stream.isTTY&&Mg.cursorTo(this.stream,e,r)}cursorRelative(e=null,r=null){this.stream.isTTY&&(this.dy=this.dy+r,Mg.moveCursor(this.stream,e,r))}cursorRelativeReset(){this.stream.isTTY&&(Mg.moveCursor(this.stream,0,-this.dy),Mg.cursorTo(this.stream,0,null),this.dy=0)}clearRight(){this.stream.isTTY&&Mg.clearLine(this.stream,1)}clearLine(){this.stream.isTTY&&Mg.clearLine(this.stream,0)}clearBottom(){this.stream.isTTY&&Mg.clearScreenDown(this.stream)}newline(){this.stream.write(`
|
|
2567
|
-
`),this.dy++}write(e,r=!1){this.linewrap===!0&&r===!1?this.stream.write(e.substr(0,this.getWidth())):this.stream.write(e)}lineWrapping(e){this.stream.isTTY&&(this.linewrap=e,e?this.stream.write("\x1B[?7h"):this.stream.write("\x1B[?7l"))}isTTY(){return this.stream.isTTY===!0}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}};qEe.exports=KO});var zEe=v((Rqt,VEe)=>{"use strict";C();VEe.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var ZEe=v((Mqt,WEe)=>{"use strict";C();var Tst=zEe();WEe.exports=t=>typeof t=="string"?t.replace(Tst(),""):t});var eBe=v((Pqt,JO)=>{"use strict";C();var XEe=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);JO.exports=XEe;JO.exports.default=XEe});var rBe=v((_qt,tBe)=>{"use strict";C();tBe.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var iBe=v((Gqt,YO)=>{"use strict";C();var Pst=ZEe(),Lst=eBe(),_st=rBe(),nBe=t=>{if(typeof t!="string"||t.length===0||(t=Pst(t),t.length===0))return 0;t=t.replace(_st()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=Lst(n)?2:1)}return e};YO.exports=nBe;YO.exports.default=nBe});var jO=v((Kqt,oBe)=>{C();oBe.exports=function(e,r,n){if(r.autopadding!==!0)return e;function i(o,s){return(r.autopaddingChar+o).slice(-s)}switch(n){case"percentage":return i(e,3);default:return e}}});var $O=v((Jqt,sBe)=>{C();sBe.exports=function(e,r){let n=Math.round(e*r.barsize),i=r.barsize-n;return r.barCompleteString.substr(0,n)+r.barGlue+r.barIncompleteString.substr(0,i)}});var qO=v((jqt,aBe)=>{C();aBe.exports=function(e,r,n){function i(s){return n?n*Math.round(s/n):s}function o(s){return(r.autopaddingChar+s).slice(-2)}return e>3600?o(Math.floor(e/3600))+"h"+o(i(e%3600/60))+"m":e>60?o(Math.floor(e/60))+"m"+o(i(e%60))+"s":e>10?o(i(e))+"s":o(e)+"s"}});var VO=v((qqt,ABe)=>{C();var Ust=iBe(),Gst=jO(),Ost=$O(),Kst=qO();ABe.exports=function(e,r,n){let i=e.format,o=e.formatTime||Kst,s=e.formatValue||Gst,a=e.formatBar||Ost,A=Math.floor(r.progress*100)+"",c=r.stopTime||Date.now(),u=Math.round((c-r.startTime)/1e3),l=Object.assign({},n,{bar:a(r.progress,e),percentage:s(A,e,"percentage"),total:s(r.total,e,"total"),value:s(r.value,e,"value"),eta:s(r.eta,e,"eta"),eta_formatted:o(r.eta,e,5),duration:s(u,e,"duration"),duration_formatted:o(u,e,1)});i=i.replace(/\{(\w+)\}/g,function(p,f){return typeof l[f]<"u"?l[f]:p});let g=Math.max(0,r.maxWidth-Ust(i)-2),d=Math.floor(g/2);switch(e.align){case"right":i=g>0?" ".repeat(g)+i:i;break;case"center":i=d>0?" ".repeat(d)+i:i;break;case"left":default:break}return i}});var Ov=v((zqt,cBe)=>{C();function Ir(t,e){return typeof t>"u"||t===null?e:t}cBe.exports={parse:function(e,r){let n={},i=Object.assign({},r,e);return n.throttleTime=1e3/Ir(i.fps,10),n.stream=Ir(i.stream,process.stderr),n.terminal=Ir(i.terminal,null),n.clearOnComplete=Ir(i.clearOnComplete,!1),n.stopOnComplete=Ir(i.stopOnComplete,!1),n.barsize=Ir(i.barsize,40),n.align=Ir(i.align,"left"),n.hideCursor=Ir(i.hideCursor,!1),n.linewrap=Ir(i.linewrap,!1),n.barGlue=Ir(i.barGlue,""),n.barCompleteChar=Ir(i.barCompleteChar,"="),n.barIncompleteChar=Ir(i.barIncompleteChar,"-"),n.format=Ir(i.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),n.formatTime=Ir(i.formatTime,null),n.formatValue=Ir(i.formatValue,null),n.formatBar=Ir(i.formatBar,null),n.etaBufferLength=Ir(i.etaBuffer,10),n.etaAsynchronousUpdate=Ir(i.etaAsynchronousUpdate,!1),n.progressCalculationRelative=Ir(i.progressCalculationRelative,!1),n.synchronousUpdate=Ir(i.synchronousUpdate,!0),n.noTTYOutput=Ir(i.noTTYOutput,!1),n.notTTYSchedule=Ir(i.notTTYSchedule,2e3),n.emptyOnZero=Ir(i.emptyOnZero,!1),n.forceRedraw=Ir(i.forceRedraw,!1),n.autopadding=Ir(i.autopadding,!1),n.gracefulExit=Ir(i.gracefulExit,!1),n},assignDerivedOptions:function(e){return e.barCompleteString=e.barCompleteChar.repeat(e.barsize+1),e.barIncompleteString=e.barIncompleteChar.repeat(e.barsize+1),e.autopaddingChar=e.autopadding?Ir(e.autopaddingChar," "):"",e}}});var zO=v((Xqt,lBe)=>{C();var uBe=$Ee(),Hst=HO(),Jst=VO(),Yst=Ov(),jst=require("events");lBe.exports=class extends jst{constructor(e){super(),this.options=Yst.assignDerivedOptions(e),this.terminal=this.options.terminal?this.options.terminal:new Hst(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new uBe(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter=typeof this.options.format=="function"?this.options.format:Jst}render(e=!1){let r={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();let n=this.formatter(this.options,r,this.payload);(e||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=n)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(n),this.terminal.clearRight(),this.lastDrawnString=n,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(e,r,n){this.value=r||0,this.total=typeof e<"u"&&e>=0?e:100,this.startValue=r||0,this.payload=n||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new uBe(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",e,r)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,r={}){typeof e=="number"&&(this.value=e,this.eta.update(Date.now(),e,this.total));let n=(typeof e=="object"?e:r)||{};this.emit("update",this.total,this.value);for(let i in n)this.payload[i]=n[i];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}getProgress(){let e=this.value/this.total;return this.options.progressCalculationRelative&&(e=(this.value-this.startValue)/(this.total-this.startValue)),isNaN(e)&&(e=this.options&&this.options.emptyOnZero?0:1),e=Math.min(Math.max(e,0),1),e}increment(e=1,r={}){typeof e=="object"?this.update(this.value+1,e):this.update(this.value+e,r)}getTotal(){return this.total}setTotal(e){typeof e<"u"&&e>=0&&(this.total=e)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}}});var pBe=v((r5t,gBe)=>{C();var $st=zO(),qst=Ov();gBe.exports=class extends $st{constructor(e,r){super(qst.parse(e,r)),this.timer=null,this.options.noTTYOutput&&this.terminal.isTTY()===!1&&(this.options.synchronousUpdate=!1),this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){this.timer&&(clearTimeout(this.timer),this.timer=null),super.render(),this.options.noTTYOutput&&this.terminal.isTTY()===!1&&this.terminal.newline(),this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(e,r){this.timer&&(super.update(e,r),this.options.synchronousUpdate&&this.lastRedraw+this.options.throttleTime*2<Date.now()&&this.render())}start(e,r,n){this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1||(this.sigintCallback===null&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.terminal.cursorSave(),this.options.hideCursor===!0&&this.terminal.cursor(!1),this.options.linewrap===!1&&this.terminal.lineWrapping(!1),super.start(e,r,n),this.render())}stop(){this.timer&&(this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,this.options.hideCursor===!0&&this.terminal.cursor(!0),this.options.linewrap===!1&&this.terminal.lineWrapping(!0),this.terminal.cursorRestore(),this.options.clearOnComplete?(this.terminal.cursorTo(0,null),this.terminal.clearLine()):this.terminal.newline())}}});var fBe=v((o5t,dBe)=>{C();var Vst=HO(),zst=zO(),Wst=Ov(),Zst=require("events");dBe.exports=class extends Zst{constructor(e,r){super(),this.bars=[],this.options=Wst.parse(e,r),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new Vst(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(e,r,n,i={}){let o=new zst(Object.assign({},this.options,{terminal:this.terminal},i));return this.bars.push(o),this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1||(this.sigintCallback===null&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.isActive||(this.options.hideCursor===!0&&this.terminal.cursor(!1),this.options.linewrap===!1&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,o.start(e,r,n),this.emit("start")),o}remove(e){let r=this.bars.indexOf(e);return r<0?!1:(this.bars.splice(r,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0)}update(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0)for(this.terminal.clearLine();this.loggingBuffer.length>0;)this.terminal.write(this.loggingBuffer.shift(),!0);for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render();this.emit("redraw-post"),this.options.noTTYOutput&&this.terminal.isTTY()===!1&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find(e=>e.isActive)&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.isActive=!1,this.options.hideCursor===!0&&this.terminal.cursor(!0),this.options.linewrap===!1&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render(),this.bars[e].stop();this.terminal.newline()}this.emit("stop")}log(e){this.loggingBuffer.push(e)}}});var hBe=v((a5t,CBe)=>{C();CBe.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}});var IBe=v((c5t,mBe)=>{C();mBe.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var BBe=v((l5t,EBe)=>{C();EBe.exports={format:" \x1B[90m{bar}\x1B[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var DBe=v((p5t,QBe)=>{C();QBe.exports={format:" {bar}\u25A0 {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u25A0",barIncompleteChar:" "}});var wBe=v((f5t,yBe)=>{C();var Xst=hBe(),eat=IBe(),tat=BBe(),rat=DBe();yBe.exports={legacy:Xst,shades_classic:eat,shades_grey:tat,rect:rat}});var xBe=v((h5t,vBe)=>{C();var bBe=pBe(),nat=fBe(),iat=wBe(),oat=VO(),sat=jO(),aat=$O(),Aat=qO();vBe.exports={Bar:bBe,SingleBar:bBe,MultiBar:nat,Presets:iat,Format:{Formatter:oat,BarFormat:aat,ValueFormat:sat,TimeFormat:Aat}}});var MBe=v((w5t,NBe)=>{C();NBe.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var lAt={};Yu(lAt,{default:()=>uAt});module.exports=en(lAt);C();C();try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="8c8065f0-d78b-402f-a622-5314debed667",t._sentryDebugIdIdentifier="sentry-dbid-8c8065f0-d78b-402f-a622-5314debed667")}catch{}C();var gDe=require("../core/index.cjs"),pDe=require("../node/index.cjs"),dDe=require("../server/index.cjs"),fDe=ie(Q3(),1);C();C();var Cb=require("fs/promises");mC();Dn();gd();or();var Yr=ie(Pr(),1),xf=require("node:path");ls();mo();Qn();un();bl();var qqe="https://cdn.builder.io",Xue=async(t,e)=>{console.log(""),Gt((0,Yr.bgCyan)((0,Yr.bold)((0,Yr.white)(" figma migrate ")))+" "+(0,Yr.dim)(pt));let{builderPrivateKey:r,builderPublicKey:n}=await gr(t,e,{forceSpaceId:e.spaceId,builderPrivateKey:!0,builderPublicKey:!0});await ct("figma publish started",{spaceId:n});let i=await Rl(t);if(i.length>0){await ct("figma migrate with existing files",{spaceId:n}),L.warning(`${(0,Yr.yellow)("This repo already has figma mappings in:")}
|
|
2567
|
+
`),this.dy++}write(e,r=!1){this.linewrap===!0&&r===!1?this.stream.write(e.substr(0,this.getWidth())):this.stream.write(e)}lineWrapping(e){this.stream.isTTY&&(this.linewrap=e,e?this.stream.write("\x1B[?7h"):this.stream.write("\x1B[?7l"))}isTTY(){return this.stream.isTTY===!0}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}};qEe.exports=KO});var zEe=v((Rqt,VEe)=>{"use strict";C();VEe.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var ZEe=v((Mqt,WEe)=>{"use strict";C();var Tst=zEe();WEe.exports=t=>typeof t=="string"?t.replace(Tst(),""):t});var eBe=v((Pqt,JO)=>{"use strict";C();var XEe=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);JO.exports=XEe;JO.exports.default=XEe});var rBe=v((_qt,tBe)=>{"use strict";C();tBe.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var iBe=v((Gqt,YO)=>{"use strict";C();var Pst=ZEe(),Lst=eBe(),_st=rBe(),nBe=t=>{if(typeof t!="string"||t.length===0||(t=Pst(t),t.length===0))return 0;t=t.replace(_st()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=Lst(n)?2:1)}return e};YO.exports=nBe;YO.exports.default=nBe});var jO=v((Kqt,oBe)=>{C();oBe.exports=function(e,r,n){if(r.autopadding!==!0)return e;function i(o,s){return(r.autopaddingChar+o).slice(-s)}switch(n){case"percentage":return i(e,3);default:return e}}});var $O=v((Jqt,sBe)=>{C();sBe.exports=function(e,r){let n=Math.round(e*r.barsize),i=r.barsize-n;return r.barCompleteString.substr(0,n)+r.barGlue+r.barIncompleteString.substr(0,i)}});var qO=v((jqt,aBe)=>{C();aBe.exports=function(e,r,n){function i(s){return n?n*Math.round(s/n):s}function o(s){return(r.autopaddingChar+s).slice(-2)}return e>3600?o(Math.floor(e/3600))+"h"+o(i(e%3600/60))+"m":e>60?o(Math.floor(e/60))+"m"+o(i(e%60))+"s":e>10?o(i(e))+"s":o(e)+"s"}});var VO=v((qqt,ABe)=>{C();var Ust=iBe(),Gst=jO(),Ost=$O(),Kst=qO();ABe.exports=function(e,r,n){let i=e.format,o=e.formatTime||Kst,s=e.formatValue||Gst,a=e.formatBar||Ost,A=Math.floor(r.progress*100)+"",c=r.stopTime||Date.now(),u=Math.round((c-r.startTime)/1e3),l=Object.assign({},n,{bar:a(r.progress,e),percentage:s(A,e,"percentage"),total:s(r.total,e,"total"),value:s(r.value,e,"value"),eta:s(r.eta,e,"eta"),eta_formatted:o(r.eta,e,5),duration:s(u,e,"duration"),duration_formatted:o(u,e,1)});i=i.replace(/\{(\w+)\}/g,function(p,f){return typeof l[f]<"u"?l[f]:p});let g=Math.max(0,r.maxWidth-Ust(i)-2),d=Math.floor(g/2);switch(e.align){case"right":i=g>0?" ".repeat(g)+i:i;break;case"center":i=d>0?" ".repeat(d)+i:i;break;case"left":default:break}return i}});var Ov=v((zqt,cBe)=>{C();function Ir(t,e){return typeof t>"u"||t===null?e:t}cBe.exports={parse:function(e,r){let n={},i=Object.assign({},r,e);return n.throttleTime=1e3/Ir(i.fps,10),n.stream=Ir(i.stream,process.stderr),n.terminal=Ir(i.terminal,null),n.clearOnComplete=Ir(i.clearOnComplete,!1),n.stopOnComplete=Ir(i.stopOnComplete,!1),n.barsize=Ir(i.barsize,40),n.align=Ir(i.align,"left"),n.hideCursor=Ir(i.hideCursor,!1),n.linewrap=Ir(i.linewrap,!1),n.barGlue=Ir(i.barGlue,""),n.barCompleteChar=Ir(i.barCompleteChar,"="),n.barIncompleteChar=Ir(i.barIncompleteChar,"-"),n.format=Ir(i.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),n.formatTime=Ir(i.formatTime,null),n.formatValue=Ir(i.formatValue,null),n.formatBar=Ir(i.formatBar,null),n.etaBufferLength=Ir(i.etaBuffer,10),n.etaAsynchronousUpdate=Ir(i.etaAsynchronousUpdate,!1),n.progressCalculationRelative=Ir(i.progressCalculationRelative,!1),n.synchronousUpdate=Ir(i.synchronousUpdate,!0),n.noTTYOutput=Ir(i.noTTYOutput,!1),n.notTTYSchedule=Ir(i.notTTYSchedule,2e3),n.emptyOnZero=Ir(i.emptyOnZero,!1),n.forceRedraw=Ir(i.forceRedraw,!1),n.autopadding=Ir(i.autopadding,!1),n.gracefulExit=Ir(i.gracefulExit,!1),n},assignDerivedOptions:function(e){return e.barCompleteString=e.barCompleteChar.repeat(e.barsize+1),e.barIncompleteString=e.barIncompleteChar.repeat(e.barsize+1),e.autopaddingChar=e.autopadding?Ir(e.autopaddingChar," "):"",e}}});var zO=v((Xqt,lBe)=>{C();var uBe=$Ee(),Hst=HO(),Jst=VO(),Yst=Ov(),jst=require("events");lBe.exports=class extends jst{constructor(e){super(),this.options=Yst.assignDerivedOptions(e),this.terminal=this.options.terminal?this.options.terminal:new Hst(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new uBe(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter=typeof this.options.format=="function"?this.options.format:Jst}render(e=!1){let r={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();let n=this.formatter(this.options,r,this.payload);(e||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=n)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(n),this.terminal.clearRight(),this.lastDrawnString=n,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(e,r,n){this.value=r||0,this.total=typeof e<"u"&&e>=0?e:100,this.startValue=r||0,this.payload=n||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new uBe(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",e,r)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,r={}){typeof e=="number"&&(this.value=e,this.eta.update(Date.now(),e,this.total));let n=(typeof e=="object"?e:r)||{};this.emit("update",this.total,this.value);for(let i in n)this.payload[i]=n[i];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}getProgress(){let e=this.value/this.total;return this.options.progressCalculationRelative&&(e=(this.value-this.startValue)/(this.total-this.startValue)),isNaN(e)&&(e=this.options&&this.options.emptyOnZero?0:1),e=Math.min(Math.max(e,0),1),e}increment(e=1,r={}){typeof e=="object"?this.update(this.value+1,e):this.update(this.value+e,r)}getTotal(){return this.total}setTotal(e){typeof e<"u"&&e>=0&&(this.total=e)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}}});var pBe=v((r5t,gBe)=>{C();var $st=zO(),qst=Ov();gBe.exports=class extends $st{constructor(e,r){super(qst.parse(e,r)),this.timer=null,this.options.noTTYOutput&&this.terminal.isTTY()===!1&&(this.options.synchronousUpdate=!1),this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){this.timer&&(clearTimeout(this.timer),this.timer=null),super.render(),this.options.noTTYOutput&&this.terminal.isTTY()===!1&&this.terminal.newline(),this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(e,r){this.timer&&(super.update(e,r),this.options.synchronousUpdate&&this.lastRedraw+this.options.throttleTime*2<Date.now()&&this.render())}start(e,r,n){this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1||(this.sigintCallback===null&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.terminal.cursorSave(),this.options.hideCursor===!0&&this.terminal.cursor(!1),this.options.linewrap===!1&&this.terminal.lineWrapping(!1),super.start(e,r,n),this.render())}stop(){this.timer&&(this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,this.options.hideCursor===!0&&this.terminal.cursor(!0),this.options.linewrap===!1&&this.terminal.lineWrapping(!0),this.terminal.cursorRestore(),this.options.clearOnComplete?(this.terminal.cursorTo(0,null),this.terminal.clearLine()):this.terminal.newline())}}});var fBe=v((o5t,dBe)=>{C();var Vst=HO(),zst=zO(),Wst=Ov(),Zst=require("events");dBe.exports=class extends Zst{constructor(e,r){super(),this.bars=[],this.options=Wst.parse(e,r),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new Vst(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(e,r,n,i={}){let o=new zst(Object.assign({},this.options,{terminal:this.terminal},i));return this.bars.push(o),this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1||(this.sigintCallback===null&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.isActive||(this.options.hideCursor===!0&&this.terminal.cursor(!1),this.options.linewrap===!1&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,o.start(e,r,n),this.emit("start")),o}remove(e){let r=this.bars.indexOf(e);return r<0?!1:(this.bars.splice(r,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0)}update(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0)for(this.terminal.clearLine();this.loggingBuffer.length>0;)this.terminal.write(this.loggingBuffer.shift(),!0);for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render();this.emit("redraw-post"),this.options.noTTYOutput&&this.terminal.isTTY()===!1&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find(e=>e.isActive)&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.isActive=!1,this.options.hideCursor===!0&&this.terminal.cursor(!0),this.options.linewrap===!1&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render(),this.bars[e].stop();this.terminal.newline()}this.emit("stop")}log(e){this.loggingBuffer.push(e)}}});var hBe=v((a5t,CBe)=>{C();CBe.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}});var IBe=v((c5t,mBe)=>{C();mBe.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var BBe=v((l5t,EBe)=>{C();EBe.exports={format:" \x1B[90m{bar}\x1B[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var DBe=v((p5t,QBe)=>{C();QBe.exports={format:" {bar}\u25A0 {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u25A0",barIncompleteChar:" "}});var wBe=v((f5t,yBe)=>{C();var Xst=hBe(),eat=IBe(),tat=BBe(),rat=DBe();yBe.exports={legacy:Xst,shades_classic:eat,shades_grey:tat,rect:rat}});var xBe=v((h5t,vBe)=>{C();var bBe=pBe(),nat=fBe(),iat=wBe(),oat=VO(),sat=jO(),aat=$O(),Aat=qO();vBe.exports={Bar:bBe,SingleBar:bBe,MultiBar:nat,Presets:iat,Format:{Formatter:oat,BarFormat:aat,ValueFormat:sat,TimeFormat:Aat}}});var MBe=v((w5t,NBe)=>{C();NBe.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var lAt={};Yu(lAt,{default:()=>uAt});module.exports=en(lAt);C();C();try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="3149975a-e5e1-4134-97eb-dc43607b9c2f",t._sentryDebugIdIdentifier="sentry-dbid-3149975a-e5e1-4134-97eb-dc43607b9c2f")}catch{}C();var gDe=require("../core/index.cjs"),pDe=require("../node/index.cjs"),dDe=require("../server/index.cjs"),fDe=ie(Q3(),1);C();C();var Cb=require("fs/promises");mC();Dn();gd();or();var Yr=ie(Pr(),1),xf=require("node:path");ls();mo();Qn();un();bl();var qqe="https://cdn.builder.io",Xue=async(t,e)=>{console.log(""),Gt((0,Yr.bgCyan)((0,Yr.bold)((0,Yr.white)(" figma migrate ")))+" "+(0,Yr.dim)(pt));let{builderPrivateKey:r,builderPublicKey:n}=await gr(t,e,{forceSpaceId:e.spaceId,builderPrivateKey:!0,builderPublicKey:!0});await ct("figma publish started",{spaceId:n});let i=await Rl(t);if(i.length>0){await ct("figma migrate with existing files",{spaceId:n}),L.warning(`${(0,Yr.yellow)("This repo already has figma mappings in:")}
|
|
2568
2568
|
|
|
2569
2569
|
${i.map(c=>` - ${(0,xf.relative)(t.getAppRootDir(),c)}`).join(`
|
|
2570
2570
|
`)}
|
|
@@ -4281,7 +4281,7 @@ Skipped ${h} components
|
|
|
4281
4281
|
- ${d.length} empty (no inputs and no JSX)
|
|
4282
4282
|
- ${p.length} hidden (name starts with _ or .)`:""}`)};function v5e(t){return t.name.startsWith("_")||t.name.startsWith(".")}function x5e(t){return t?t.inputs.length===0&&t.jsx==="":!0}var ule=async(t,e,r)=>{if(e==="migrate")await Xue(t,r);else if(e==="publish"||e==="p")await Yue(t,r);else if(e==="add"||e==="generate"||e==="gen"||e==="g")await nle(t,r);else if(e==="report")await cle(t,r);else if(e==="auth"){console.log(""),Gt((0,Ts.bgCyan)((0,Ts.bold)((0,Ts.white)(" figma auth ")))+" "+(0,Ts.dim)(pt));let{builderPublicKey:n}=await gr(t,r,{requireFigmaAuth:"always",builderPrivateKey:!0,builderPublicKey:!0,force:!0});await ct("figma auth",{spaceId:n}),Vr((0,Ts.bgGreen)((0,Ts.bold)((0,Ts.white)(" Done! \u{1F389} "))))}else e==="help"&&ha(r._[2]||"figma")};or();Vi();Ft();XM();C();function YU(t,e){return{cwd:t,command:e[0],snippetId:e[1],path:e[2]}}Nl();ls();mo();Df();pb();C();var tB=ie(Kme(),1),OEe=ie(require("http"),1),KEe=ie(require("https"),1),Gv=ie(require("net"),1),HEe=ie(require("node:os"),1),JEe=ie(require("@amplitude/analytics-node"),1),ts=ie(Pr(),1);Dn();ls();mo();C();var fEe=ie(require("node:stream"),1),CEe=require("node:crypto");C();var ost=ie(oEe(),1),sst=ie(wO(),1),ast=ie(xO(),1),Ast=ie(Tv(),1),PO=ie(dEe(),1);function hEe(t){let e=!1,r="2.0",n=new PO.default(t),i=new fEe.default.EventEmitter,o={clients:new Map,events:new Map,methods:new Map},s=new Map([["rpc.on",g],["rpc.off",d]]);function a(B){return JSON.stringify({jsonrpc:r,id:B?.id,notification:B?.notification,result:B?.result,params:B?.params,error:B?.error})}function A(){n.on("listening",()=>{e=!0,i.emit("listening"),n.on("connection",(B,Q)=>{let w=Q.url||"/",D=(0,CEe.randomUUID)();o.clients.set(D,B),i.emit("connection",B,D),u(B,D,w),B.on("error",b=>i.emit("socket-error",D,b)),B.on("close",()=>{o.clients.delete(D),i.emit("disconnection",D)})}),n.on("error",B=>i.emit("error",B))})}function c(B){return!!B.params&&Array.isArray(B.params)&&B.params.length>0}function u(B,Q,w="/"){B.on("message",async D=>{let b={};try{D instanceof ArrayBuffer&&(b.binary=!0,D=Buffer.from(D).toString())}catch{return B.send(a({id:null,error:{code:-32700,message:"Parse error"}}))}let S;try{S=JSON.parse(D)}catch{return B.send(a({id:null,error:{code:-32700,message:"Parse error"}}))}try{let k=o;if(s.has(S.method)){let F=s.get(S.method);return B.send(F(k,S,Q),b)}if(!k.methods.has(S.method))return B.send(a({id:S.id,error:{code:-32601,message:"Method not found"}}),b);try{let K=await k.methods.get(S.method)(S.params,Q);return B.send(a({id:S.id,result:K||void 0}),b)}catch(F){return B.send(a({id:S.id,error:{code:-32e3,message:F?.message||"Internal error",data:F?.data}}),b)}}catch{return B.send(a({id:S?.id||null,error:{code:-32603,message:"Internal error"}}),b)}})}function l(B,Q,...w){let b=[...o.clients.entries()].filter(([S])=>Q.has(S)).map(([S,k])=>k);for(let S of b)S.send(a({notification:B,params:w}))}function g(B,Q,w){if(!c(Q))return a({id:Q.id,error:{code:-32602,message:"Invalid params"}});if(!B.events.has(Q.params[0]))return a({id:Q.id,error:{code:-32602,message:"Invalid params"}});let D=Q.params[0];return B.events.get(D).add(w),a({id:Q.id,result:{[D]:!0}})}function d(B,Q,w){if(!c(Q))return a({id:Q.id,error:{code:-32602,message:"Invalid params"}});if(!B.events.has(Q.params[0]))return a({id:Q.id,error:{code:-32602,message:"Invalid params"}});let D=Q.params[0];return B.events.get(D).delete(w),a({id:Q.id,result:{[D]:!1}})}function p(B,Q,w="/"){o.methods.set(B,Q)}function f(B,Q){i.on(B,Q)}function h(B,Q="/"){let w=o;w.events.has(B)||w.events.set(B,new Set)}function m(B,Q="/",...w){let D=o;if(!D.events.has(B))return;let b=D.events.get(B);l(B,b,Q,...w)}async function I(B,Q,w,D){n.handleUpgrade(B,Q,w,b=>{e||n.emit("listening"),n.emit("connection",b,B),D&&D(b,B)})}function E(){return new Promise((B,Q)=>{try{n.close(),i.emit("close"),B(null)}catch(w){Q(w)}})}return A(),{on:f,event:B=>h(B),handleUpgrade:I,clients:()=>o.clients||new Map,register:(B,Q)=>p(B,Q),emit:(B,...Q)=>m(B,"/",...Q),notify:(B,Q,...w)=>l(B,new Set([Q]),...w),close:E}}Bf();or();l1();YI();ub();C();var ri=ie(require("fs"),1),_i=ie(require("fs/promises"),1),Ci=ie(require("path"),1);eA();ou();var LO=ie(require("dns/promises"),1),IEe=ie(require("net"),1),Lv=require("undici");g0();Cm();Bm();Cm();var cst=t=>!!(t.name&&t.path),mEe=t=>!!(t.name&&t.path&&t.repoName&&t.repoUrl),gC=class{logIdCounter=0;initStatusLogs=[];sys;config;debug=!0;initState={isRunning:!1,isComplete:!1,success:!1,currentStep:"initial",error:void 0,repos:[]};constructor(e){this.sys=e.sys,this.config=e,this.debug=e.debug??!0}async checkout(e,r,n){try{await this.git(["checkout",e],n)}catch{return await this.git(["checkout","-b",e,r],n,1),!0}return await this.git(["reset","--hard",r],n),!1}async execAsync(e,r,n,i){return jA(e,r,{cwd:n,debug:this.debug,sys:this.sys,retry:i})}async git(e,r,n,i){return jA("git",e,{cwd:r,debug:this.debug,sys:this.sys,retry:n,timeout:i??(e[0].includes("clone")?600*1e3:60*1e3)})}async performBackup({sys:e,credentials:r,fusionConfig:n,volumePath:i,repositories:o,isConnectedToProvider:s,forcedFullBackup:a}){try{console.log("\u{1F50D} Performing backup operation");let A=o.filter(p=>p.enableGit);if(A.length===0)throw new Error("No repository with git enabled found for backup");if(A.length>1)throw new Error("Backups not supported for multi-repo setups");let c=A[0],u=Ci.join(i,c.path);if(!ri.existsSync(u))throw new Error(`Backup mode: Repository directory does not exist at ${u}`);if(!ri.existsSync(Ci.join(u,".git")))throw new Error(`Backup mode: Git repository not initialized at ${u}`);if(!n.branchName)throw new Error("Backup mode: No branch name found");if(!n.projectId)throw new Error("Backup mode: No project ID found");let{featureBranch:l,currentBranch:g}=await f0({sys:e,gitWorkingDirectory:u,strict:!a});console.log(`\u{1F50D} Creating backup for AI branch: ${g}`);let d=await l0({sys:e,credentials:r,projectId:n.projectId,branchName:n.branchName,repoPath:u,aiBranch:g,featureBranch:l,workspace:n.workspace,isConnectedToProvider:s,forcedFullBackup:a,debug:!0,canAbortMerge:!1});if(d.success)console.log("\u2705 Backup uploaded successfully");else{let p=`Backup upload failed: ${d.reason||"Unknown error"}`;throw new Error(p)}}catch(A){let c=new Error("Failed to perform git backup",{cause:A});throw this.config.sys.Sentry?.captureException(c,{tags:{launchMode:this.config.fusionConfig.mode,forcedFullBackup:a,isConnectedToProvider:s}}),c}}async performRegularBackup(e){await this.performBackup({...e,isConnectedToProvider:!0,forcedFullBackup:!1})}async performOfflineBackup(e){await this.performBackup({...e,isConnectedToProvider:!1,forcedFullBackup:!1})}async performForcedFullBackup(e){await this.performBackup({...e,isConnectedToProvider:!1,forcedFullBackup:!0})}async init(){let e=this.config;this.clearInitLogs(),this.initState.isRunning=!0,this.initState.isComplete=!1;let r=e.fusionConfig.workspace?.folders?.filter(cst)??[];this.addInitLog("log",`Starting initialization with ${r.length} repositories`,{step:"init"});try{if(!r.length){let i="At least one repository must be configured";throw new Error(i)}if(!e.sys){let i="DevToolsSys is required in config";throw this.addInitLog("error",i,{step:"validation",error:i}),new Error(i)}let n=kte(e.fusionConfig);switch(e.fusionConfig.mode){case"backup":{try{await this.performRegularBackup({sys:e.sys,credentials:e.credentials,fusionConfig:e.fusionConfig,volumePath:n,repositories:r})}catch(i){console.log(`\u{1F50D} Online backup failed: ${i}. Attempting offline backup...`),await this.performOfflineBackup({sys:e.sys,credentials:e.credentials,fusionConfig:e.fusionConfig,volumePath:n,repositories:r})}break}case"backup-force-full":{try{await this.performRegularBackup({sys:e.sys,credentials:e.credentials,fusionConfig:e.fusionConfig,volumePath:n,repositories:r})}catch(i){console.log(`\u{1F50D} Online backup failed: ${i}. Attempting offline backup...`);try{await this.performOfflineBackup({sys:e.sys,credentials:e.credentials,fusionConfig:e.fusionConfig,volumePath:n,repositories:r})}catch(o){console.log(`\u{1F50D} Offline backup failed: ${o}. Attempting forced full offline backup...`),await this.performForcedFullBackup({sys:e.sys,credentials:e.credentials,fusionConfig:e.fusionConfig,volumePath:n,repositories:r})}}break}case"init-and-launch":{await this.step1CheckDirectories(n,r),this.addInitLog("log","Directories checked",{step:"check-directories"}),await this.step2ConfigureGitRepositories(n,r),this.addInitLog("log","Git repositories configured",{step:"configure-git-repos"}),await this.step3ConfigureGitUser(n,r),this.addInitLog("log","Git user configured",{step:"configure-git-user"}),await this.step4CollectRepoInfo(e,n,r),this.addInitLog("log","Repo info collected",{step:"collect-repo-info"});break}default:throw new Error(`Invalid mode: ${e.fusionConfig.mode}`)}return this.addInitLog("complete","Initialization completed successfully",{step:"init-success",success:!0}),!0}catch(n){let i=n instanceof Error?n.message:String(n),o=this.initStatusLogs.some(s=>s.type==="error"&&s.step&&s.step!=="init-failed");return this.addInitLog("complete",`Initialization failed with error: ${i}`,{step:o?void 0:"init-failed",success:!1,error:i}),e.sys.Sentry?.captureException(n,{tags:{operation:"init",...e.sentryTags}}),!1}}addInitLog(e,r,n){let i={id:++this.logIdCounter,timestamp:new Date().toISOString(),type:e,message:r,...n};this.debug&&console.log(`[DEBUG] ${i.timestamp} ${i.type} ${i.message}`),this.initStatusLogs.push(i),this.initStatusLogs.length>1e3&&this.initStatusLogs.splice(0,this.initStatusLogs.length-1e3),n?.step&&(this.initState.currentStep=n.step),e==="complete"&&(this.initState.isComplete=!0,this.initState.isRunning=!1,this.initState.success=n?.success??!1,this.initState.error=n?.error),e==="error"&&n?.error&&(this.initState.error=n.error)}clearInitLogs(){this.initStatusLogs.length=0,this.logIdCounter=0,this.initState.isRunning=!1,this.initState.isComplete=!1,this.initState.success=!1,this.initState.currentStep="initial",this.initState.error=void 0}async hasFilesButNoGit(e){if(ri.existsSync(e))try{let n=(await _i.readdir(e)).length>0,i=ri.existsSync(Ci.join(e,".git"));return n&&!i}catch{return!1}return!1}async step1CheckDirectories(e,r){this.addInitLog("log","Checking directories",{step:"check-directories"}),ri.existsSync(e)||await _i.mkdir(e,{recursive:!0}),e.startsWith("/root")&&ust("root"),this.addInitLog("log",`Volume directory exists: ${e}`,{step:"check-directories"});for(let n of r){let i=Ci.join(e,n.path);if(ri.existsSync(i))this.addInitLog("log",`Directory already exists: ${i}`,{step:"check-directories"});else{this.addInitLog("log",`Creating directory: ${i}`,{step:"create-directories"});try{await _i.mkdir(i,{recursive:!0})}catch(o){let s=`Failed to create directory for ${n.repoName} at ${i}: ${o}`;throw this.addInitLog("error",s,{step:"create-directories",error:s}),new Error(s,{cause:o})}}}}async step2ConfigureGitRepositories(e,r){this.addInitLog("log","Configuring git repositories",{step:"configure-git-repos"});let n=Ci.join(e,"temp-cloning"),i=async()=>{ri.existsSync(n)&&(this.addInitLog("log",`Removing temp cloning directory: ${n}`,{step:"configure-git-repos"}),await _i.rm(n,{recursive:!0,force:!0}))};await i(),this.addInitLog("log",`Creating temp cloning path: ${n}`,{step:"configure-git-repos"}),await _i.mkdir(n,{recursive:!0});try{for(let o of r){let s=Ci.join(e,o.path);if(this.addInitLog("log",`Processing repository: ${o.repoName}`,{step:"configure-git-repos"}),await this.isGitConfigured(s)){o.enableGit&&await this.refreshRepoConfig(o),await this.cleanupLockFiles(s);try{o.enableGit?(this.addInitLog("log",`Git already configured for ${o.repoName}, validating repo`,{step:"check-existing-git"}),await this.validateGitRepo(s)):this.addInitLog("log",`Git already configured for ${o.repoName}, skipping validation because it's not main repo`,{step:"check-existing-git"})}catch(c){let u=`Failed to validate git repo for ${o.repoName}: ${c}`;throw this.addInitLog("error",u,{step:"check-existing-git",error:u}),c}if(this.addInitLog("log","Git repo is in good state, checking remote URL",{step:"check-existing-git"}),o.initializationCommand){this.addInitLog("log","Skipping remote URL update because it has an initialization command",{step:"update-remote-url"});continue}if(!mEe(o))throw new Error("Remote URL update failed because repoUrl is undefined");let A=await this.getGitRemoteUrl(s);if(A){let c=this.sanitizeGitRemoteUrl(A),u=this.sanitizeGitRemoteUrl(o.repoUrl);if(c!==u){this.addInitLog("log",`Updating remote URL for ${o.repoName}`,{step:"update-remote-url"});try{await this.git(["remote","set-url","origin",o.repoUrl],s)}catch(l){let g=`Failed to update git remote URL for ${o.repoName}: ${l}`;throw this.addInitLog("error",g,{step:"update-remote-url",error:g}),new Error(g)}}}else{this.addInitLog("log",`Adding remote origin for ${o.repoName}`,{step:"check-existing-git"});try{await this.git(["remote","add","origin",o.repoUrl],s)}catch(c){let u=`Failed to add git remote origin for ${o.repoName}: ${c}`;throw this.addInitLog("error",u,{step:"check-existing-git",error:u}),new Error(u)}}}else{if(await this.hasFilesButNoGit(s)){let g="Code directory already exists but is not a git repo";throw this.addInitLog("error",g,{step:"check-existing-git",error:g}),new Error(g)}let c=o.backupMetadata?await lte(this.config.sys,o.backupMetadata):void 0;if(c&&!c.success)throw this.addInitLog("error",`Failed to download backup for ${o.repoName}: ${c.error}`,{step:"clone-repo",error:c.error.message}),c.error;c?.success&&this.sys.Sentry?.setTag("backup",c.partial?"partial":"full");let u=Ci.join(n,o.path),l=!1;if(o.initializationCommand){this.addInitLog("log","Running initialization command.",{step:"init-command"});let g=await this.runInitializationCommand({repo:o,tempCloningDir:n,repoPath:u,initCommand:o.initializationCommand});if(l=g.outcome,l)this.addInitLog("log",`Successfully initialized ${o.repoName}`,{step:"init-command"});else{let d=g.error?.message||"Failed to run initialization command.";throw this.addInitLog("error",d,{step:"init-command",error:d}),new Error(d)}}else{if(!mEe(o))throw new Error("repoUrl or repoName is undefined");if(this.addInitLog("log",`Cloning repository: ${o.repoName}`,{step:"clone-repo"}),l=await this.cloneRepository({repo:o,repoPath:u,backupResult:c}),l)this.addInitLog("log",`Successfully cloned ${o.repoName}`,{step:"clone-repo"});else{let g=`Failed to clone repository ${o.repoName}`;throw this.addInitLog("error",g,{step:"clone-repo",error:g}),new Error(g)}}if(c&&c.success&&c.partial)try{await this.restoreFromPartialBackup({repo:o,repoPath:u,backupResult:c})}catch(g){throw g}if(process.platform==="win32"&&ri.existsSync(s)){if((await _i.readdir(s)).length>0){let d=`Target directory ${s} already exists and is not empty. Cannot safely rename.`;throw this.addInitLog("error",d,{step:"configure-git-repos",error:d}),new Error(d)}this.addInitLog("log",`Removing empty directory before rename (Windows workaround): ${s}`,{step:"configure-git-repos"}),await _i.rm(s,{recursive:!0,force:!0})}await _i.rename(u,s),await this.markGitSafe(s)}}}catch(o){throw this.addInitLog("error",`Failed to configure git repositories: ${o}`,{step:"configure-git-repos",error:String(o)}),o}finally{await i()}}async step3ConfigureGitUser(e,r){this.addInitLog("log","Configuring git user",{step:"configure-git-user"});for(let n of r){let i=Ci.join(e,n.path);this.addInitLog("log",`Setting git user for ${n.repoName}`,{step:"configure-git-user"});try{await this.git(["config","user.email","builder-bot@builder.io"],i),await this.git(["config","user.name","Builder.io"],i)}catch(o){let s=`Failed to configure git user for ${n.repoName}: ${o}`;throw this.addInitLog("error",s,{step:"configure-git-user",error:s}),new Error(s)}}}async step4CollectRepoInfo(e,r,n){this.addInitLog("log","Collecting repo info",{step:"collect-repo-info"}),this.initState.repos=[];for(let i of n){let o=Ci.join(r,i.path);try{let s=await this.git(["rev-parse","HEAD"],o),a=await this.git(["branch","--show-current"],o),A={repoName:i.repoName||i.path,enabledGit:!!i.enableGit,lastCommitHash:s.trim(),branch:a.trim()};this.initState.repos.push(A),this.addInitLog("log",`Collected repo info: ${JSON.stringify(A)}`,{step:"collect-repo-info"})}catch(s){e.sys.Sentry?.captureException(s,{tags:{operation:"init",...e.sentryTags}})}}}async isGitConfigured(e){try{return await this.git(["rev-parse","--is-inside-work-tree"],e),!0}catch{return!1}}async getGitRemoteUrl(e){try{return(await this.git(["config","--get","remote.origin.url"],e)).trim()}catch{return null}}sanitizeGitRemoteUrl(e){return e.replace(/https:\/\/[^@]+@/,"https://")}isStandardGitHost(e){let r=["github.com","gitlab.com","bitbucket.org"];try{let n=new URL(e);return r.some(i=>n.hostname===i||n.hostname.endsWith(`.${i}`))}catch{return!1}}async checkHostConnectivity(e){try{let r=e.startsWith("git@")||e.startsWith("ssh://"),n,i;if(r){let o=e.match(/^(?:ssh:\/\/)?(?:[^@]+@)?([^/:]+)(?::|\/)/);if(!o)return{reachable:!1,error:"Invalid SSH repository URL format"};n=o[1],i=22}else{let o=e.match(/^https?:\/\/(?:[^@]+@)?([^/:?#]+)/);if(!o)return{reachable:!1,error:"Invalid repository URL format"};n=o[1],i=443}this.addInitLog("log",`Checking connectivity to host: ${n}:${i}`,{step:"clone-repo"});try{let o=[];try{o=await LO.default.resolve4(n),o.length>0&&this.addInitLog("log",`DNS resolved ${n} to IPv4: ${o.join(", ")}`,{step:"clone-repo"})}catch{o=await LO.default.resolve6(n),o.length>0&&this.addInitLog("log",`DNS resolved ${n} to IPv6: ${o.join(", ")}`,{step:"clone-repo"})}if(o.length===0)return{reachable:!1,hostname:n,error:`DNS resolution failed: no addresses found for ${n}`}}catch(o){let s=o instanceof Error?o.message:String(o);return{reachable:!1,hostname:n,error:`DNS resolution failed for ${n}: ${s}`}}try{let o=await this.checkConnectivityDirect(n,i);if(o.reachable)return o;let s=process.env.HTTP_PROXY||process.env.http_proxy;return s?(this.addInitLog("log",`Direct connection failed, trying proxy: ${s}`,{step:"clone-repo"}),await this.checkConnectivityViaProxy(n,i,s)):o}catch(o){let s=o instanceof Error?o.message:String(o);return{reachable:!1,hostname:n,error:`Connection attempt failed: ${s}`}}}catch(r){return{reachable:!1,error:`Unexpected error during connectivity check: ${r instanceof Error?r.message:String(r)}`}}}async checkConnectivityDirect(e,r){let i=IEe.default.createConnection({host:e,port:r,timeout:5e3});return await new Promise(o=>{i.on("connect",()=>{i.destroy(),this.addInitLog("log",`Successfully connected to ${e}:${r}`,{step:"clone-repo"}),o({reachable:!0,hostname:e})}),i.on("error",s=>{i.destroy(),this.addInitLog("error",`Connection failed to ${e}:${r}: ${s.message}`,{step:"clone-repo",error:s.message}),o({reachable:!1,hostname:e,error:`Cannot connect to ${e}:${r}: ${s.message}`})}),i.on("timeout",()=>{i.destroy(),this.addInitLog("error",`Connection timeout to ${e}:${r} (${5e3/1e3}s)`,{step:"clone-repo",error:`Connection timeout to ${e}:${r} after ${5e3/1e3} seconds`}),o({reachable:!1,hostname:e,error:`Connection timeout to ${e}:${r} after ${5e3/1e3} seconds`})})})}async checkConnectivityViaProxy(e,r,n){try{this.addInitLog("log",`Attempting proxy connection to ${e}:${r} via proxy`,{step:"clone-repo"});let i=new URL(n),o=`${i.protocol}//${i.host}`,s=new Lv.ProxyAgent({uri:o,token:i.username&&i.password?`Basic ${Buffer.from(`${i.username}:${i.password}`).toString("base64")}`:void 0}),a=`http://${e}:${r}`;return await(0,Lv.fetch)(a,{dispatcher:s,signal:AbortSignal.timeout(3e4)}),this.addInitLog("log",`Successfully connected via proxy to ${e}:${r}`,{step:"clone-repo"}),{reachable:!0,hostname:e}}catch(i){return{reachable:!1,hostname:e,error:`Proxy connection failed: ${i instanceof Error?i.message:String(i)}`}}}async ensureParentDirExists(e){let r=Ci.dirname(e);return await _i.mkdir(r,{recursive:!0}),r}async cleanupLockFiles(e){let r=Ci.join(e,".git");try{let i=(await _i.readdir(r)).filter(s=>s.endsWith(".lock"));if(i.length===0)return;let o=[];for(let s of i){let a=Ci.join(r,s);try{await _i.unlink(a),o.push(s)}catch(A){this.config.sys.Sentry?.captureException(new Error(`Failed to remove ${s} for ${e}: ${A}`),{tags:{operation:"init",...this.config.sentryTags}})}}o.length>0&&this.config.sys.Sentry?.captureMessage(`Lock files found for ${e} and removed: ${o.join(", ")}`,{tags:{operation:"init",...this.config.sentryTags}})}catch(n){this.config.sys.Sentry?.captureException(new Error(`Failed to cleanup lock files for ${e}: ${n}`),{tags:{operation:"init",...this.config.sentryTags}})}}async validateGitRepo(e){try{await this.git(["fsck","--connectivity-only"],e)}catch(r){throw new Error("Git repo is in bad state",{cause:r})}}async restoreFromPartialBackup({repo:e,repoPath:r,backupResult:n}){try{this.addInitLog("log",`Checking for git backup for ${e.repoName}`,{step:"apply-partial-backup"});let i=async()=>{try{await this.git(["remote","remove","backup"],r)}catch(o){this.addInitLog("error",`Failed to cleanup restore: ${o}`,{step:"apply-partial-backup",error:String(o)})}};if(!n.bundlePath){try{this.addInitLog("log",`Found empty git backup, applying it to ${e.repoName}`,{step:"apply-partial-backup"});let o=this.config.fusionConfig.aiBranch||n.gitBranchName;await this.checkout(o,n.lastCommitHash,r)}catch(o){throw this.addInitLog("error",`Failed to checkout backup branch: ${o}`,{step:"apply-partial-backup",error:String(o)}),o}return}try{this.addInitLog("log",`Found git backup, applying it to ${e.repoName}`,{step:"apply-partial-backup"}),await this.git(["remote","add","backup",n.bundlePath],r),await this.git(["fetch","backup"],r);let o=n.gitBranchName,s=this.config.fusionConfig.aiBranch||o;s!==o?(this.addInitLog("log",`Creating new branch ${s} from backup/${o}`,{step:"apply-partial-backup"}),await this.git(["branch",s,`backup/${o}`],r),await this.git(["checkout",s],r)):await this.checkout(o,`backup/${o}`,r),this.addInitLog("log",`Successfully restored from backup to branch ${s}`,{step:"apply-partial-backup"}),await i(),this.addInitLog("log",`Cleaned up backup for ${e.repoName}`,{step:"apply-partial-backup"})}catch(o){throw await i(),this.addInitLog("error",String(o),{step:"apply-partial-backup",error:String(o)}),o}}catch(i){let o=new Error(`Failed to check git backup for ${e.repoName}. Cannot proceed without backup recovery.`,{cause:i});throw this.addInitLog("error",o.message,{step:"apply-partial-backup",error:String(i)}),o}}async initializeGitRepo(e,r){await this.git(["init"],e),await this.git(["add","."],e),await this.git(["branch","-M","main"],e),await this.git([...r?["-c","user.email=team@builder.io","-c","user.name=Builder.io"]:[],"commit","-m","Initial setup"],e)}async refreshRepoConfig(e){try{if(this.config.fusionConfig.projectId){let r=await xd(this.config.credentials,this.config.fusionConfig.projectId);if(r.success){if(Object.keys(r.gitConfigs).length===0){console.log("Git configs gave an empty result. Nothing to update.");return}let n=Object.values(r.gitConfigs)[0];if(n?.url){let i=this.config.fusionConfig.workspace?.folders.find(o=>o.enableGit);i&&(i.repoUrl=n.url,i.repoName=Object.keys(r.gitConfigs)[0],n.provider==="github"&&n.token&&(process.env.GH_TOKEN=n.token))}}else this.config.sys.Sentry?.captureException(r.error,{tags:{operation:"init",endpoint:"fetch-git-configs",...this.config.sentryTags}})}}catch(r){this.config.sys.Sentry?.captureException(new Error("Failed to fetch git configs in InitStateMachine",{cause:r instanceof Error?r:new Error(String(r))}),{tags:{operation:"init",endpoint:"fetch-git-configs",...this.config.sentryTags},extra:{repo:e}})}}async runInitializationCommand({repo:e,tempCloningDir:r,repoPath:n,initCommand:i}){this.addInitLog("log",`Init command paths args: tempCloningDir: ${r} repoPath: ${n}`,{step:"init-command"});try{this.addInitLog("log",`Executing initialization command in ${r}`,{step:"init-command"});let o=process.env.SHELL||process.env.COMSPEC||"/bin/sh";try{let s=sa(o,i,{stdio:["ignore","pipe","pipe"],cwd:r,env:{...process.env,TERM:"dumb"}}),a=[],A=[];s.stdout?.on("data",c=>{a.push(c);let u=c.toString().trim();u&&this.addInitLog("log",u,{step:"init-command"})}),s.stderr?.on("data",c=>{A.push(c);let u=c.toString().trim();u&&this.addInitLog("error",u,{step:"init-command"})}),await new Promise((c,u)=>{s.on("error",l=>{u(l)}),s.on("close",l=>{if(l===0)c();else{let g=Buffer.concat(a).toString().trim(),d=Buffer.concat(A).toString().trim(),p=[`Command exited with code ${l}`,d&&`stderr: ${d}`,g&&`stdout: ${g}`].filter(Boolean).join(`
|
|
4283
4283
|
`);u(new Error(p))}})})}catch(s){let a=new Error("Failed to execute initCommand.",{cause:s});return this.addInitLog("error",a.message+`: ${s}`,{step:"init-command",error:String(s)}),{outcome:!1,error:a}}return{outcome:!0}}catch(o){return this.addInitLog("error",`Failed to run initialization command: ${o}`,{step:"init-command",error:String(o)}),{outcome:!1,error:o instanceof Error?o:new Error(String(o))}}}async cloneRepository({repo:e,repoPath:r,backupResult:n}){let i=[e.branchName??"main",null,"main","master"];if(n&&n.success&&!n.partial){if(!n.bundlePath)throw new Error("Full backups must have a bundle path");this.addInitLog("log",`Downloaded full git backup, cloning it to ${r}`,{step:"clone-repo"});try{let s=await this.ensureParentDirExists(r);await this.git(["clone",n.bundlePath,r],s,void 0,600*1e3),await this.markGitSafe(r);for(let c of i)if(c)try{await this.git(["checkout",c],r)}catch{continue}await this.checkout(n.gitBranchName,n.lastCommitHash,r);let a=(await this.git(["branch","--show-current"],r)).trim(),A=(await this.git(["rev-parse","HEAD"],r)).trim();if(a!==n.gitBranchName)throw new Error(`Backup branch ${n.gitBranchName} does not match local branch ${a}`);if(A!==n.lastCommitHash)throw new Error(`Backup commit hash ${n.lastCommitHash} does not match local commit hash ${A}`);return!0}catch(s){throw this.addInitLog("error",`Failed to clone git backup for ${e.repoName}: ${s}`,{step:"clone-repo",error:String(s)}),s}}let o=process.env.TEST_NEEDS_GIT_INIT==="1";if(!this.isStandardGitHost(e.repoUrl)){this.addInitLog("log",`Non-standard git host detected, checking connectivity to ${e.repoUrl}`,{step:"clone-repo"});let s=await this.checkHostConnectivity(e.repoUrl);if(!s.reachable){let a=`Git host unreachable: ${s.hostname||"unknown host"}. ${s.error||"Network connectivity check failed"}. This host may be behind a firewall or VPN.`;throw this.addInitLog("error",a,{step:"clone-repo",error:a}),this.config.sys.Sentry?.captureException(new Error("Git host unreachable"),{tags:{operation:"init",...this.config.sentryTags},extra:{repo:e,connectivityResult:s}}),new Error(a)}this.addInitLog("log",`Host connectivity verified for ${s.hostname}`,{step:"clone-repo"})}for(let s of i)try{let a=process.env.FUSION_TEMPLATE_DIR&&process.env.FUSION_TEMPLATE_DIR.trim().length>0?process.env.FUSION_TEMPLATE_DIR:"/template";if(ri.existsSync(a)&&e.repoName===bd){if(this.addInitLog("log",`Starting copy of template to ${r}`,{step:"clone-repo"}),await this.execAsync("rm",["-rf",r],"/"),await this.execAsync("cp",["-a",a,r],"/"),this.addInitLog("log",`Copied from template for ${e.repoName}`,{step:"clone-repo"}),o)try{await this.initializeGitRepo(r,o)}catch(A){let c=`Failed to initialize git repo for ${e.repoName} after template copy: ${A}`;throw this.addInitLog("error",c,{step:"clone-repo",error:String(A)}),new Error(c)}return!0}else{let A=["clone"];s&&A.push("-b",s),A.push(e.repoUrl,r),this.addInitLog("log",`Cloning repository: ${e.repoName} with branch: ${s||"default"}`,{step:"clone-repo"});let c=await this.ensureParentDirExists(r);if(await this.git(A,c,void 0,600*1e3),await this.markGitSafe(r),this.config.fusionConfig.isFork&&this.config.fusionConfig.prNumber){let d=this.config.fusionConfig.prNumber,p=this.config.fusionConfig.featureBranch||`pr-${d}`;this.addInitLog("log",`Fork PR detected - fetching PR #${d} using refs/pulls/${d}/head into branch ${p}`,{step:"clone-repo"});try{await this.git(["fetch","origin",`pull/${d}/head:${p}`],r),await this.git(["switch",p],r),this.addInitLog("log",`Successfully checked out fork PR #${d} on branch ${p}`,{step:"clone-repo"})}catch(f){let h=`Failed to fetch fork PR #${d}: ${f}`;throw this.addInitLog("error",h,{step:"clone-repo",error:String(f)}),new Error(h)}}let u=e.resetGit!==void 0?e.resetGit:w1.includes(e.repoName),l=n&&n.success&&n.partial,g=this.config.fusionConfig.isFork&&this.config.fusionConfig.prNumber;return u&&e.enableGit&&!l&&!g&&(ri.rmSync(Ci.join(r,".git"),{recursive:!0,force:!0}),await this.initializeGitRepo(r,o),this.addInitLog("log",`Cleared git history for ${e.repoName}`,{step:"clone-repo"})),!0}}catch(a){this.addInitLog("error",`Clone failed for branch ${s||"default"}: ${a}`,{step:"clone-repo",error:String(a)});continue}return!1}async markGitSafe(e){try{let r=await this.git(["config","--global","--get-all","safe.directory"],e);if(r.trim().split(`
|
|
4284
|
-
`).includes(e))return r}catch{}return this.git(["config","--global","--add","safe.directory",e],e)}};function ust(t){let e=[".npm",".local",".cache"];try{let r=`/${t}`,n=`/${t}-backup`;if(ri.existsSync(n)){let i=ri.readdirSync(n);for(let o of i)if(!e.includes(o)){let s=Ci.join(r,o);if(!ri.existsSync(s))try{ri.cpSync(Ci.join(n,o),s,{recursive:!0,force:!0})}catch(a){console.error(`Failed to restore ${o} for ${t}: ${a}`)}}}}catch(r){console.error(`Failed to restore ${t} backup: ${r}`)}}lm();p1();mn();Qn();C();var EEe=ie(require("@sentry/node"),1),BEe=ie(require("@amplitude/analytics-node"),1),_v=async()=>{
|
|
4284
|
+
`).includes(e))return r}catch{}return this.git(["config","--global","--add","safe.directory",e],e)}};function ust(t){let e=[".npm",".local",".cache"];try{let r=`/${t}`,n=`/${t}-backup`;if(ri.existsSync(n)){let i=ri.readdirSync(n);for(let o of i)if(!e.includes(o)){let s=Ci.join(r,o);if(!ri.existsSync(s))try{ri.cpSync(Ci.join(n,o),s,{recursive:!0,force:!0})}catch(a){console.error(`Failed to restore ${o} for ${t}: ${a}`)}}}}catch(r){console.error(`Failed to restore ${t} backup: ${r}`)}}lm();p1();mn();Qn();C();var EEe=ie(require("@sentry/node"),1),BEe=ie(require("@amplitude/analytics-node"),1),_v=async()=>{let t=process.env.BUILDER_DISABLE_AMPLITUDE==="true",e=[EEe.flush()];t||e.push(BEe.flush().promise),await Promise.allSettled(e),process.exit(0)};function QEe(){process.on("SIGINT",_v),process.on("SIGTERM",_v)}function DEe(){process.removeListener("SIGINT",_v),process.removeListener("SIGTERM",_v)}un();C();mn();Qn();Bm();C();function yEe(){let t,e=[],n=performance.now();return{consumeDelays:()=>{let i=[...e];return e.length=0,i},start:()=>{t||(n=performance.now(),t=setInterval(()=>{try{let i=performance.now(),o=i-n,s=Math.max(0,o-5e3);e.push(s),n=i}catch(i){console.error("[EventLoopMonitor] Error sampling:",i)}},5e3),t.unref())},stop:()=>{t&&(clearInterval(t),t=void 0)}}}C();var wEe=ie(require("v8"),1);function bEe(){let t=process.constrainedMemory?.();if(t){let{rss:r}=process.memoryUsage();return Math.min(1,r/t)}let e=wEe.getHeapStatistics();return Math.min(1,1-e.total_available_size/e.heap_size_limit)}var Ou=ie(require("os"),1);function vEe(t,e,r,n){let i=null,o=yEe(),s=async()=>{try{let a=new URL(`${Xe}/projects/machine-status`);e.builderPublicKey&&a.searchParams.set("apiKey",e.builderPublicKey),e.userId&&a.searchParams.set("userId",e.userId);let A=Fte(),c;A&&r.machine?c={...r.machine,environment:n.fusionEnvironment}:A||(c={cpus:Ou.cpus().length,memory:Math.round(Ou.totalmem()/(1024*1024*1024)),platform:Ou.platform(),arch:Ou.arch(),environment:"local"});let u=o.consumeDelays(),l=bEe(),g={status:"ok",state:n.state,setupState:n.setupState,devState:n.devState,editorReady:n.editorReady,httpServerState:n.httpServerState,initState:n.initState,errorMessage:n.errorMessage,devToolsVersion:n.devToolsVersion,idleTime:performance.now()-n.lastRequestTime,upTime:performance.now()-n.startTime,machine:c,projectId:r.projectId,detectedServerUrl:n.detectedServerUrl,_attemptDryRunBackupOutcome:n._attemptDryRunBackupOutcome,workingDirectory:n.workingDirectory,fusionEnvironment:n.fusionEnvironment,wsClients:t.connectionTracker.getConnectionCount(),httpClients:n.httpClients,eventLoopDelays:u.length>0?u:void 0,memoryPressure:l},d={"Content-Type":"application/json"};e.builderPrivateKey&&(d.Authorization=`Bearer ${e.builderPrivateKey}`),await We(a,{method:"POST",body:JSON.stringify(g),headers:d,keepalive:!0,signal:AbortSignal.timeout(5e3)})}catch{}};return{start:()=>{if(i)return;o.start(),s();let a=30*1e3;i=setInterval(s,a)},stop:()=>{i&&(clearInterval(i),i=null),o.stop()}}}C();var hc=require("fs"),SEe=require("fs/promises");C();mn();Qn();async function xEe(t,e,r){try{let n=new URL(`${Xe}/projects/metrics`);e.builderPublicKey&&n.searchParams.set("apiKey",e.builderPublicKey),e.userId&&n.searchParams.set("userId",e.userId);let i={"Content-Type":"application/json"};e.builderPrivateKey&&(i.Authorization=`Bearer ${e.builderPrivateKey}`),await We(n,{method:"POST",body:JSON.stringify(r),headers:i,keepalive:!0,signal:AbortSignal.timeout(5e3)})}catch(n){t.Sentry?.captureException(new Error("Failed to push metrics",{cause:n}))}}or();un();var Uv="/app-backup-test",_O="/app/.mark",UO={operation:"dry-run-backup-git",dryRunBackupGit:"true"},FEe=async(t,e)=>{let r=await lst(t,e);return r&&(r.success?L.success("\u2705 Dry run backup git succeeded"):(L.error(`\u274C Dry run backup git failed: ${r.error}`),t.sys.Sentry?.captureException(new Error(`Attempted dry run backup failed: ${r.error}`),{tags:UO})),xEe(t.sys,t.credentials,{counters:[{key:"projects_backup_dry_run_ended",value:1,attributes:{outcome:r.success?"success":r.error??"unknown",version:pt}}]}),r)},lst=async({sys:t,fusionConfig:e,credentials:r},n)=>{function i(o){let s=e.workspace?.folders.find(c=>c.backupMetadata)?.backupMetadata?.check,a=n.repos.find(c=>c.enabledGit),A=o.initState.repos.find(c=>c.enabledGit);return JSON.stringify({backupCheck:s,mainRepo:a,backupMainRepo:A},null,2)}try{let o=process.env.FLY_MACHINE_ID??"unknown";if((0,hc.existsSync)(_O)&&(0,hc.readFileSync)(_O,"utf8")===o)return null;if((0,hc.writeFileSync)(_O,o),L.info("Attempting dry run backup git"),n.currentStep!=="init-success")return{success:!1,error:"main-init-failed"};(0,hc.existsSync)(Uv)&&await(0,SEe.rm)(Uv,{recursive:!0,force:!0}),(0,hc.mkdirSync)(Uv,{recursive:!0});let s=new gC({sys:t,fusionConfig:{...e,_attemptDryRunBackupGit:!1,workingDirectory:Uv},debug:!0,credentials:r,sentryTags:UO}),a=await s.init(),A=i(s);if(!a)return console.error(`\u274C Backup failed: ${s.initState.currentStep}
|
|
4285
4285
|
${A}`),{success:!1,error:`backup-failed:${s.initState.currentStep}`};let c=s.initState.repos.find(g=>g.enabledGit);if(!c)return console.error(`\u274C Backup repo not found
|
|
4286
4286
|
${A}`),{success:!1,error:"backup-repo-not-found"};let u=n.repos.find(g=>g.enabledGit);if(!u)return console.error(`\u274C Main repo not found
|
|
4287
4287
|
${A}`),{success:!1,error:"main-repo-not-found"};if(c.branch!==u.branch)return console.error(`\u274C Backup branch mismatch: ${c.branch} !== ${u.branch}
|
|
@@ -4579,7 +4579,7 @@ Your ONLY job is to detect and report the current configuration values. Report w
|
|
|
4579
4579
|
## FINAL REMINDER
|
|
4580
4580
|
Do NOT write any text output. Your ONLY action should be calling ProposeConfig with your analysis.
|
|
4581
4581
|
Immediately after reading project files, call ProposeConfig. No markdown, no explanations, just the tool call.
|
|
4582
|
-
`;var Ist="project-configuration",Est="Analyzes project structure to determine optimal setup configuration for Builder.io Fusion. Runs automatically to detect framework, package manager, environment variables, and dev server settings.",Bst=["Read","Glob","Grep","LS","Bash","ProposeConfig","UpdateSetupValue","VerifyInstallCommand","VerifyDevServer","VerifyValidationScript","VerifyRuntimeDependency"],Qst="sonnet",PEe={name:Ist,description:Est,tools:Bst,systemPrompt:TEe,model:Qst,position:"setup-analyzer",needDevServer:!1,includeMemories:!1,needValidation:!1};IU();Vi();var Dst=48752;async function yst(t){return new Promise(e=>{let r=Gv.createServer();r.listen(t,()=>{r.once("close",()=>{e(!0)}),r.close()}),r.on("error",()=>{e(!1)})})}async function LEe(t){let e=t,r=100;for(let n=0;n<r;n++){if(await yst(e))return e;e=Math.floor(Math.random()*16384)+49152}throw new Error(`Could not find an available port after ${r} attempts`)}async function wst(t,e){let r=parseInt(process.env.FUSION_SERVER_PORT??""),n=isNaN(r)?Dst:r,i,o=t.fusionServerPort;if(o!==void 0)i=o,L.info(`\u{1F50D} Using configured HTTP port: ${i}`);else{let a=e;i=n,a&&(i=await LEe(n),i!==n&&L.info(`\u26A0\uFE0F Port ${n} is in use, using port ${i} instead`))}if(!t.https)return{httpPort:i};let s=t.httpsServerOptions?.port??await LEe(i+1);return{httpPort:i,httpsPort:s}}function _Ee(t,e,r){if(t.jsonOutput){let n={type:"server_error",data:{error:e,details:r,timestamp:Date.now()}};console.log(JSON.stringify(n))}}var pC;async function YEe({sys:t,args:e}){let r=process.env.FLY_APP_NAME?{flyAppName:process.env.FLY_APP_NAME,flyMachineId:process.env.FLY_MACHINE_ID,flyRegion:process.env.FLY_REGION,flyPublicIp:process.env.FLY_PUBLIC_IP,flyVmMemoryMb:process.env.FLY_VM_MEMORY_MB,flyPrimaryRegion:process.env.PRIMARY_REGION}:void 0;r&&(t.Sentry?.setContext("flyIo",r),t.Sentry?.getCurrentScope().setContext("flyIo",r)),Gt((0,ts.bgCyan)((0,ts.bold)((0,ts.white)(" fusion ")))+" "+(0,ts.dim)(pt));let n=await wf(t,e);if(Fue(t,n),n.privacyMode?.encryptKey&&!await tb(n.privacyMode.encryptKey))throw new Error("Invalid encryption key: key failed validation");await REe(t,n);let i=await bst(t,e,n),o=performance.now(),s="initial",a={status:"ok",get state(){return s},set state(Q){s!==Q&&n.projectId&&n.branchName&&v1(t,i,{projectId:n.projectId,branchName:n.branchName,lastServerVersion:pt,lastServerState:Q}),s=Q},isFinalState:!1,editorReady:!1,initState:void 0,setupState:void 0,devState:void 0,httpServerState:void 0,errorMessage:void 0,devToolsVersion:pt,lastRequestTime:o,startTime:o,workingDirectory:process.cwd(),httpClients:0,detectedServerUrl:n.autoDetectDevServer?void 0:n.serverUrl,fusionEnvironment:process.env.FUSION_ENVIRONMENT==="cloud"||process.env.FUSION_ENVIRONMENT==="cloud-v2"?process.env.FUSION_ENVIRONMENT:"unknown"},A,{app:c,proxyUrl:u,server:l,httpsServer:g,httpsProxyUrl:d,customHttpsProxyUrl:p}=await vst(i,n,a,t,e),f=vEe(t,i,n,a);f&&f.start();let h=Rst(t,n,r),m=!1,I=!1,E=!1,B=Q=>async()=>{if(console.log(`\u{1F50D} Received ${Q} signal`),a.state==="init-running"){console.log("\u{1F50D} Init is running, skipping"),E=!0;return}if(m){console.log("\u{1F50D} Server already closing, skipping");return}a.state="closing",m=!0,setTimeout(()=>{m=!1},1e3),console.log("\u{1F50D} Closing server gracefully");try{l.closeAllConnections(),g&&g.closeAllConnections(),h(),f&&(f.stop(),f=null);let w=[new Promise(D=>l.close(D))];if(g&&w.push(new Promise(D=>g.close(D))),await Promise.race([Promise.all(w),new Promise(D=>setTimeout(D,1e3))]),A&&(await A.close(),A=void 0),!I&&a.initState?.success){I=!0;let D=await mc();a.state="closing",D&&(console.log("\u{1F50D} Closing codeGenServer"),await D.close(!!n.autoBackupGit),pC=void 0)}await t.Sentry?.flush(2e3),await JEe.flush().promise,process.exit(0)}catch(w){t.Sentry?.captureException(w);let D=w instanceof Error?w.message:String(w);L.error(`\u274C FAILED TO CLOSE SERVER: ${D}`),process.exit(1)}};if(DEe(),process.on("SIGTERM",B("SIGTERM")),process.on("SIGINT",B("SIGINT")),e.fusionInit){a.state="init-running";let Q={operation:"fusion-init",mode:n.mode??""},w=new gC({sys:t,fusionConfig:n,debug:!0,credentials:i,sentryTags:Q});a.initState=w.initState,a.initStatusLogs=w.initStatusLogs;let D=await w.init();if(String(process.env.DEVTOOLS_SKIP_POST_INIT||"").toLowerCase().match(/^(1|true|yes)$/)&&process.exit(0),!D){L.error("\u274C Initialization failed"),t.Sentry?.captureException(new Error("Initialization failed"),{level:"fatal",tags:Q,extra:{initState:w.initState}}),a.state="init-error",a.isFinalState=!0,a.errorMessage=w.initState.error,E&&await B("init-end")();return}if(L.success("\u2705 Initialization completed successfully"),a.state="init-complete",E){await B("init-end")();return}if(n.mode==="backup"||n.mode==="backup-force-full"){await B("init-end")();return}n._attemptDryRunBackupGit&&FEe({sys:t,fusionConfig:n,debug:!0,credentials:i},w.initState).then(S=>{S&&(a._attemptDryRunBackupOutcome=S.success?"success":S.error)}).catch(S=>{t.Sentry?.captureException(S,{tags:{operation:"dry-run-backup-git",dryRunBackupGit:"true"}})})}if(A=await xst(t,n,a,e),e.fusionInit&&A){let Q=n.nativeApp?3e5:2e3;await Promise.race([A.ensureSetupCommand(),new Promise(w=>setTimeout(w,Q))])}await Sst({sys:t,credentials:i,args:e,fusionConfig:n,proxyUrl:u,httpsProxyUrl:d,customHttpsProxyUrl:p,server:l,httpsServer:g,app:c,devServer:A,sharedState:a}),await ct("launch",{...n,dev:!!e.dev})}async function bst(t,e,r){let n;try{if(n=await gr(t,e,{builderPrivateKey:!0,builderPublicKey:!0}),!n.builderPublicKey||!n.builderPrivateKey){let i="You need to be logged in to use the fusion command.";return _Ee(e,i),L.error(i),Le("Please login first with: npx builder.io login"),await Ne(1)}if(!n.timestamp&&!r.projectId){let i=await t.getDeviceId();if(i)try{let o=new URL(`${Xe}/fusion/cli-key`);o.searchParams.set("host",i),o.searchParams.set("apiKey",n.builderPublicKey);let s=await We(o.toString(),{headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.builderPrivateKey}`},method:"GET"});if(!s.ok){let c=await s.text();throw new Error(`Failed to fetch original private key: ${c}`)}let A=(await s.json())?.key;A&&(n.builderPrivateKey=A,n.timestamp=new Date().toISOString(),fb(t,n))}catch(o){t.Sentry?.captureException(new Error("Failed to fetch original private key, using existing credentials",{cause:o}))}}L.success(`Logged in as space: ${n.spaceName||n.builderPublicKey}`)}catch(i){let o="Authentication failed.";return _Ee(e,o,i instanceof Error?i.message:String(i)),L.error(o),Le("Please login first with: npx builder.io login"),await Ne(1)}return n}async function vst(t,e,r,n,i){let o=!!e.isLocal||!!i?.local,{httpPort:s,httpsPort:a}=await wst(e,o);e.nativeApp?L.info(`\u{1F50D} Setting up Builder.io API server on port ${s} (Native App Mode)`):L.info(`\u{1F50D} Setting up Builder.io server on port ${s}`);let A=(0,tB.default)();A.use((E,B,Q)=>{o||console.log("HTTP request: ",E.url),E.query._skip_activity!=="true"?r.lastRequestTime=performance.now():L.info(`\u23F0 Request ignored at ${performance.now()}`),Q()});let c=t.builderPrivateKey,u=e.authenticateProxy??!1;Mee({sys:n,app:A,validBuilderPrivateKey:c,authenticateProxy:u,isLocal:o,sharedState:r});let l=OEe.createServer(A),g;if(e.https)try{let{port:E,...B}=e.httpsServerOptions??{};g=KEe.createServer(B,A),L.info(`\u{1F50D} Setting up HTTPS server on port ${a}`)}catch(E){L.error(`\u274C Failed to create HTTPS server: ${E instanceof Error?E.message:String(E)}`),g=void 0}let d=e.localHttpsDomain,p=`http://localhost:${s}`,f=a?`https://localhost:${a}`:void 0,h=d&&a?`https://${d}:${a}`:void 0,m=[new Promise((E,B)=>{l.listen(s,async()=>{L.success(`\u{1F680} Builder.io HTTP server running at ${p}`),L.info("Available server URLs:"),L.info(` HTTP (localhost): ${p}`),E(!0)}),l.on("error",Q=>{L.error(`\u274C Failed to create HTTP server: ${Q instanceof Error?Q.message:String(Q)}`),B(Q)})})];return g&&m.push(new Promise((E,B)=>{g.listen(a,async()=>{L.success(`\u{1F680} Builder.io HTTPS server running at ${f}`),L.info(` HTTPS (localhost): ${f}`),h&&L.info(` HTTPS (custom domain): ${h}`),E(!0)}),g.on("error",Q=>{L.error(`\u274C Failed to create HTTPS server: ${Q instanceof Error?Q.message:String(Q)}`),B(Q)})})),await Promise.all(m),{app:A,proxyUrl:h||f||p,server:l,httpsServer:g,httpsProxyUrl:f,customHttpsProxyUrl:h}}async function xst(t,e,r,n){if(e.nativeApp){e.devCommand?L.info(`Running ${(0,ts.cyan)(e.devCommand)} in native app mode...`):L.info("Native app mode: No dev command specified");let i=await h1(t,e,n.fusionInit&&e.setupCommand?.trim()?"not-installed":"installed");return r.devState=i.devState,r.setupState=i.setupState,r.httpServerState="ok-2xx",i.emitter.on("devState",o=>{r.devState=o}),i.emitter.on("setupState",o=>{r.setupState=o}),i}if((n.serverUrl||n.chat)&&!n.command){n.chat||L.info(`Proxying to existing dev server at ${(0,ts.cyan)(e.serverUrl)}...`),r.devState="running",r.setupState="installed",r.httpServerState="ok-2xx";return}else{L.info(`Running ${(0,ts.cyan)(e.devCommand)} on host ${e.serverUrl?(0,ts.cyan)(e.serverUrl):"TBD"}...`);let i=await h1(t,e,n.fusionInit?"not-installed":"installed");return r.devState=i.devState,r.setupState=i.setupState,r.httpServerState=i.httpServerState.state,i.emitter.on("devState",o=>{r.devState=o}),i.emitter.on("setupState",o=>{r.setupState=o}),i.emitter.on("httpServerState",o=>{r.httpServerState=o}),i.emitter.on("urlDetected",o=>{r.detectedServerUrl=o}),i}}async function Sst({sys:t,credentials:e,args:r,fusionConfig:n,app:i,server:o,httpsServer:s,proxyUrl:a,httpsProxyUrl:A,customHttpsProxyUrl:c,devServer:u,sharedState:l}){async function g({force:p=!1,forcedFullBackup:f=!1}={}){L.info(`\u{1F4E6} Attempting backup${p?" (forced)":""}${f?" (full)":""}...`);let h=await mc();if(!h)if(n.autoBackupGit&&l.initState?.success)h=await eB(t,e,n,u,void 0,l,void 0,n.privacyMode);else return L.info("\u{1F51A} No active session"),{success:!0,message:"No active session",skipped:!0,reason:"no_active_session"};if(!(p||n.autoBackupGit))return L.info("\u{1F51A} Auto backup git is disabled, skipping backup"),{success:!0,message:"Auto backup git is disabled, skipping backup",skipped:!0,reason:"auto_backup_git_disabled"};if(!h.isIdle())return L.info("\u{1F51A} Not idle, skipping backup"),{success:!1,message:"Not idle, skipping backup",skipped:!0,reason:"not_idle"};if(h.gitRepoContexts.length>1)return L.info("\u{1F51A} Backups not supported for multi-repo setups"),{success:!1,message:"Backups not supported for multi-repo setups",skipped:!0,reason:"multi_repo_unsupported"};if(!f&&!await h.needsBackup())return L.info("\u2705 Already backed up after last request"),{success:!0,message:"Already backed up",skipped:!0,reason:"already_backed_up"};try{let E=await h.uploadBackup(f);return E.success&&L.info("\u2705 Backup successful"),E}catch(E){let B=`Backup error: ${E instanceof Error?E.message:String(E)}`;return L.error(`\u274C ${B}`),{success:!1,message:B,error:E instanceof Error?E:new Error(String(E))}}}async function d(p){L.info(`\u{1F504} Attempting graceful shutdown: ${p}`);let f=()=>{n.autoShutdown&&(L.info("\u{1F504} Shutting down process"),process.kill(process.pid,"SIGTERM"))},h=await g({force:!1});return h.success&&f(),h}try{let p=tB.default.Router();if(p.post("/generate",async(w,D)=>{try{console.log("api/generate started");let{prompt:b,userMessage:S,context:{featureFlags:k}}=w.body;if(!b&&!S)return D.status(400).json({error:"No prompt/userMessage provided"});D.socket?.setNoDelay(!0),D.setHeader("Content-Type","application/jsonl; charset=utf-8"),D.setHeader("Transfer-Encoding","chunked"),D.setHeader("Cache-Control","no-cache"),D.setHeader("Connection","close"),k&&GO(k);let F=await eB(t,e,n,u,void 0,l,void 0,n.privacyMode),K=setInterval(async()=>{let q={type:"ping"};D.write(JSON.stringify(q)+`
|
|
4582
|
+
`;var Ist="project-configuration",Est="Analyzes project structure to determine optimal setup configuration for Builder.io Fusion. Runs automatically to detect framework, package manager, environment variables, and dev server settings.",Bst=["Read","Glob","Grep","LS","Bash","ProposeConfig","UpdateSetupValue","VerifyInstallCommand","VerifyDevServer","VerifyValidationScript","VerifyRuntimeDependency"],Qst="sonnet",PEe={name:Ist,description:Est,tools:Bst,systemPrompt:TEe,model:Qst,position:"setup-analyzer",needDevServer:!1,includeMemories:!1,needValidation:!1};IU();Vi();var Dst=48752;async function yst(t){return new Promise(e=>{let r=Gv.createServer();r.listen(t,()=>{r.once("close",()=>{e(!0)}),r.close()}),r.on("error",()=>{e(!1)})})}async function LEe(t){let e=t,r=100;for(let n=0;n<r;n++){if(await yst(e))return e;e=Math.floor(Math.random()*16384)+49152}throw new Error(`Could not find an available port after ${r} attempts`)}async function wst(t,e){let r=parseInt(process.env.FUSION_SERVER_PORT??""),n=isNaN(r)?Dst:r,i,o=t.fusionServerPort;if(o!==void 0)i=o,L.info(`\u{1F50D} Using configured HTTP port: ${i}`);else{let a=e;i=n,a&&(i=await LEe(n),i!==n&&L.info(`\u26A0\uFE0F Port ${n} is in use, using port ${i} instead`))}if(!t.https)return{httpPort:i};let s=t.httpsServerOptions?.port??await LEe(i+1);return{httpPort:i,httpsPort:s}}function _Ee(t,e,r){if(t.jsonOutput){let n={type:"server_error",data:{error:e,details:r,timestamp:Date.now()}};console.log(JSON.stringify(n))}}var pC;async function YEe({sys:t,args:e}){let r=process.env.FLY_APP_NAME?{flyAppName:process.env.FLY_APP_NAME,flyMachineId:process.env.FLY_MACHINE_ID,flyRegion:process.env.FLY_REGION,flyPublicIp:process.env.FLY_PUBLIC_IP,flyVmMemoryMb:process.env.FLY_VM_MEMORY_MB,flyPrimaryRegion:process.env.PRIMARY_REGION}:void 0;r&&(t.Sentry?.setContext("flyIo",r),t.Sentry?.getCurrentScope().setContext("flyIo",r)),Gt((0,ts.bgCyan)((0,ts.bold)((0,ts.white)(" fusion ")))+" "+(0,ts.dim)(pt));let n=await wf(t,e);if(Fue(t,n),n.privacyMode?.encryptKey&&!await tb(n.privacyMode.encryptKey))throw new Error("Invalid encryption key: key failed validation");await REe(t,n);let i=await bst(t,e,n),o=performance.now(),s="initial",a={status:"ok",get state(){return s},set state(Q){s!==Q&&n.projectId&&n.branchName&&v1(t,i,{projectId:n.projectId,branchName:n.branchName,lastServerVersion:pt,lastServerState:Q}),s=Q},isFinalState:!1,editorReady:!1,initState:void 0,setupState:void 0,devState:void 0,httpServerState:void 0,errorMessage:void 0,devToolsVersion:pt,lastRequestTime:o,startTime:o,workingDirectory:process.cwd(),httpClients:0,detectedServerUrl:n.autoDetectDevServer?void 0:n.serverUrl,fusionEnvironment:process.env.FUSION_ENVIRONMENT==="cloud"||process.env.FUSION_ENVIRONMENT==="cloud-v2"?process.env.FUSION_ENVIRONMENT:"unknown"},A,{app:c,proxyUrl:u,server:l,httpsServer:g,httpsProxyUrl:d,customHttpsProxyUrl:p}=await vst(i,n,a,t,e),f=vEe(t,i,n,a);f&&f.start();let h=Rst(t,n,r),m=!1,I=!1,E=!1,B=Q=>async()=>{if(console.log(`\u{1F50D} Received ${Q} signal`),a.state==="init-running"){console.log("\u{1F50D} Init is running, skipping"),E=!0;return}if(m){console.log("\u{1F50D} Server already closing, skipping");return}a.state="closing",m=!0,setTimeout(()=>{m=!1},1e3),console.log("\u{1F50D} Closing server gracefully");try{l.closeAllConnections(),g&&g.closeAllConnections(),h(),f&&(f.stop(),f=null);let w=[new Promise(D=>l.close(D))];if(g&&w.push(new Promise(D=>g.close(D))),await Promise.race([Promise.all(w),new Promise(D=>setTimeout(D,1e3))]),A&&(await A.close(),A=void 0),!I&&a.initState?.success){I=!0;let D=await mc();a.state="closing",D&&(console.log("\u{1F50D} Closing codeGenServer"),await D.close(!!n.autoBackupGit),pC=void 0)}await t.Sentry?.flush(2e3),process.env.BUILDER_DISABLE_AMPLITUDE!=="true"&&await JEe.flush().promise,process.exit(0)}catch(w){t.Sentry?.captureException(w);let D=w instanceof Error?w.message:String(w);L.error(`\u274C FAILED TO CLOSE SERVER: ${D}`),process.exit(1)}};if(DEe(),process.on("SIGTERM",B("SIGTERM")),process.on("SIGINT",B("SIGINT")),e.fusionInit){a.state="init-running";let Q={operation:"fusion-init",mode:n.mode??""},w=new gC({sys:t,fusionConfig:n,debug:!0,credentials:i,sentryTags:Q});a.initState=w.initState,a.initStatusLogs=w.initStatusLogs;let D=await w.init();if(String(process.env.DEVTOOLS_SKIP_POST_INIT||"").toLowerCase().match(/^(1|true|yes)$/)&&process.exit(0),!D){L.error("\u274C Initialization failed"),t.Sentry?.captureException(new Error("Initialization failed"),{level:"fatal",tags:Q,extra:{initState:w.initState}}),a.state="init-error",a.isFinalState=!0,a.errorMessage=w.initState.error,E&&await B("init-end")();return}if(L.success("\u2705 Initialization completed successfully"),a.state="init-complete",E){await B("init-end")();return}if(n.mode==="backup"||n.mode==="backup-force-full"){await B("init-end")();return}n._attemptDryRunBackupGit&&FEe({sys:t,fusionConfig:n,debug:!0,credentials:i},w.initState).then(S=>{S&&(a._attemptDryRunBackupOutcome=S.success?"success":S.error)}).catch(S=>{t.Sentry?.captureException(S,{tags:{operation:"dry-run-backup-git",dryRunBackupGit:"true"}})})}if(A=await xst(t,n,a,e),e.fusionInit&&A){let Q=n.nativeApp?3e5:2e3;await Promise.race([A.ensureSetupCommand(),new Promise(w=>setTimeout(w,Q))])}await Sst({sys:t,credentials:i,args:e,fusionConfig:n,proxyUrl:u,httpsProxyUrl:d,customHttpsProxyUrl:p,server:l,httpsServer:g,app:c,devServer:A,sharedState:a}),await ct("launch",{...n,dev:!!e.dev})}async function bst(t,e,r){let n;try{if(n=await gr(t,e,{builderPrivateKey:!0,builderPublicKey:!0}),!n.builderPublicKey||!n.builderPrivateKey){let i="You need to be logged in to use the fusion command.";return _Ee(e,i),L.error(i),Le("Please login first with: npx builder.io login"),await Ne(1)}if(!n.timestamp&&!r.projectId){let i=await t.getDeviceId();if(i)try{let o=new URL(`${Xe}/fusion/cli-key`);o.searchParams.set("host",i),o.searchParams.set("apiKey",n.builderPublicKey);let s=await We(o.toString(),{headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.builderPrivateKey}`},method:"GET"});if(!s.ok){let c=await s.text();throw new Error(`Failed to fetch original private key: ${c}`)}let A=(await s.json())?.key;A&&(n.builderPrivateKey=A,n.timestamp=new Date().toISOString(),fb(t,n))}catch(o){t.Sentry?.captureException(new Error("Failed to fetch original private key, using existing credentials",{cause:o}))}}L.success(`Logged in as space: ${n.spaceName||n.builderPublicKey}`)}catch(i){let o="Authentication failed.";return _Ee(e,o,i instanceof Error?i.message:String(i)),L.error(o),Le("Please login first with: npx builder.io login"),await Ne(1)}return n}async function vst(t,e,r,n,i){let o=!!e.isLocal||!!i?.local,{httpPort:s,httpsPort:a}=await wst(e,o);e.nativeApp?L.info(`\u{1F50D} Setting up Builder.io API server on port ${s} (Native App Mode)`):L.info(`\u{1F50D} Setting up Builder.io server on port ${s}`);let A=(0,tB.default)();A.use((E,B,Q)=>{o||console.log("HTTP request: ",E.url),E.query._skip_activity!=="true"?r.lastRequestTime=performance.now():L.info(`\u23F0 Request ignored at ${performance.now()}`),Q()});let c=t.builderPrivateKey,u=e.authenticateProxy??!1;Mee({sys:n,app:A,validBuilderPrivateKey:c,authenticateProxy:u,isLocal:o,sharedState:r});let l=OEe.createServer(A),g;if(e.https)try{let{port:E,...B}=e.httpsServerOptions??{};g=KEe.createServer(B,A),L.info(`\u{1F50D} Setting up HTTPS server on port ${a}`)}catch(E){L.error(`\u274C Failed to create HTTPS server: ${E instanceof Error?E.message:String(E)}`),g=void 0}let d=e.localHttpsDomain,p=`http://localhost:${s}`,f=a?`https://localhost:${a}`:void 0,h=d&&a?`https://${d}:${a}`:void 0,m=[new Promise((E,B)=>{l.listen(s,async()=>{L.success(`\u{1F680} Builder.io HTTP server running at ${p}`),L.info("Available server URLs:"),L.info(` HTTP (localhost): ${p}`),E(!0)}),l.on("error",Q=>{L.error(`\u274C Failed to create HTTP server: ${Q instanceof Error?Q.message:String(Q)}`),B(Q)})})];return g&&m.push(new Promise((E,B)=>{g.listen(a,async()=>{L.success(`\u{1F680} Builder.io HTTPS server running at ${f}`),L.info(` HTTPS (localhost): ${f}`),h&&L.info(` HTTPS (custom domain): ${h}`),E(!0)}),g.on("error",Q=>{L.error(`\u274C Failed to create HTTPS server: ${Q instanceof Error?Q.message:String(Q)}`),B(Q)})})),await Promise.all(m),{app:A,proxyUrl:h||f||p,server:l,httpsServer:g,httpsProxyUrl:f,customHttpsProxyUrl:h}}async function xst(t,e,r,n){if(e.nativeApp){e.devCommand?L.info(`Running ${(0,ts.cyan)(e.devCommand)} in native app mode...`):L.info("Native app mode: No dev command specified");let i=await h1(t,e,n.fusionInit&&e.setupCommand?.trim()?"not-installed":"installed");return r.devState=i.devState,r.setupState=i.setupState,r.httpServerState="ok-2xx",i.emitter.on("devState",o=>{r.devState=o}),i.emitter.on("setupState",o=>{r.setupState=o}),i}if((n.serverUrl||n.chat)&&!n.command){n.chat||L.info(`Proxying to existing dev server at ${(0,ts.cyan)(e.serverUrl)}...`),r.devState="running",r.setupState="installed",r.httpServerState="ok-2xx";return}else{L.info(`Running ${(0,ts.cyan)(e.devCommand)} on host ${e.serverUrl?(0,ts.cyan)(e.serverUrl):"TBD"}...`);let i=await h1(t,e,n.fusionInit?"not-installed":"installed");return r.devState=i.devState,r.setupState=i.setupState,r.httpServerState=i.httpServerState.state,i.emitter.on("devState",o=>{r.devState=o}),i.emitter.on("setupState",o=>{r.setupState=o}),i.emitter.on("httpServerState",o=>{r.httpServerState=o}),i.emitter.on("urlDetected",o=>{r.detectedServerUrl=o}),i}}async function Sst({sys:t,credentials:e,args:r,fusionConfig:n,app:i,server:o,httpsServer:s,proxyUrl:a,httpsProxyUrl:A,customHttpsProxyUrl:c,devServer:u,sharedState:l}){async function g({force:p=!1,forcedFullBackup:f=!1}={}){L.info(`\u{1F4E6} Attempting backup${p?" (forced)":""}${f?" (full)":""}...`);let h=await mc();if(!h)if(n.autoBackupGit&&l.initState?.success)h=await eB(t,e,n,u,void 0,l,void 0,n.privacyMode);else return L.info("\u{1F51A} No active session"),{success:!0,message:"No active session",skipped:!0,reason:"no_active_session"};if(!(p||n.autoBackupGit))return L.info("\u{1F51A} Auto backup git is disabled, skipping backup"),{success:!0,message:"Auto backup git is disabled, skipping backup",skipped:!0,reason:"auto_backup_git_disabled"};if(!h.isIdle())return L.info("\u{1F51A} Not idle, skipping backup"),{success:!1,message:"Not idle, skipping backup",skipped:!0,reason:"not_idle"};if(h.gitRepoContexts.length>1)return L.info("\u{1F51A} Backups not supported for multi-repo setups"),{success:!1,message:"Backups not supported for multi-repo setups",skipped:!0,reason:"multi_repo_unsupported"};if(!f&&!await h.needsBackup())return L.info("\u2705 Already backed up after last request"),{success:!0,message:"Already backed up",skipped:!0,reason:"already_backed_up"};try{let E=await h.uploadBackup(f);return E.success&&L.info("\u2705 Backup successful"),E}catch(E){let B=`Backup error: ${E instanceof Error?E.message:String(E)}`;return L.error(`\u274C ${B}`),{success:!1,message:B,error:E instanceof Error?E:new Error(String(E))}}}async function d(p){L.info(`\u{1F504} Attempting graceful shutdown: ${p}`);let f=()=>{n.autoShutdown&&(L.info("\u{1F504} Shutting down process"),process.kill(process.pid,"SIGTERM"))},h=await g({force:!1});return h.success&&f(),h}try{let p=tB.default.Router();if(p.post("/generate",async(w,D)=>{try{console.log("api/generate started");let{prompt:b,userMessage:S,context:{featureFlags:k}}=w.body;if(!b&&!S)return D.status(400).json({error:"No prompt/userMessage provided"});D.socket?.setNoDelay(!0),D.setHeader("Content-Type","application/jsonl; charset=utf-8"),D.setHeader("Transfer-Encoding","chunked"),D.setHeader("Cache-Control","no-cache"),D.setHeader("Connection","close"),k&&GO(k);let F=await eB(t,e,n,u,void 0,l,void 0,n.privacyMode),K=setInterval(async()=>{let q={type:"ping"};D.write(JSON.stringify(q)+`
|
|
4583
4583
|
`)},5e3),z=F.connectToEventLoop(!1,q=>{D.write(JSON.stringify(q)+`
|
|
4584
4584
|
`)});try{let q=F.getLastSuggestedAction(),T=[];q&&q.healthStatus.hasMergeConflict&&T.push(q.userMessage),T.push(b?{userPrompt:b}:S),await F.sendMessage(T),await F.waitUntilIdle()}catch(q){t.Sentry?.captureException(q);let T=q instanceof Error?q.message:String(q);D.write(`${JSON.stringify({type:"error",message:`Error: ${T}`})}
|
|
4585
4585
|
`)}finally{clearInterval(K),z()}D.end()}catch(b){t.Sentry?.captureException(b);let S=b instanceof Error?b.message:String(b);D.headersSent?(D.write(`data: ${JSON.stringify({type:"error",message:`Fatal error: ${S}`})}
|