@builder.io/dev-tools 1.53.3-beta.202605061017.1167984 → 1.53.3-beta.202605061032.da67fc8
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/cli/index.cjs +42 -42
- package/cli/index.cjs.map +3 -3
- 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 +3 -3
- package/server/index.mjs +3 -3
- package/types/tsconfig.tsbuildinfo +1 -1
package/cli/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var vve=Object.create;var UB=Object.defineProperty;var xve=Object.getOwnPropertyDescriptor;var Fve=Object.getOwnPropertyNames;var kve=Object.getPrototypeOf,Rve=Object.prototype.hasOwnProperty;var L=(t,e)=>()=>(t&&(e=t(t=0)),e);var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),GB=(t,e)=>{for(var r in e)UB(t,r,{get:e[r],enumerable:!0})},IJ=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Fve(e))!Rve.call(t,i)&&i!==r&&UB(t,i,{get:()=>e[i],enumerable:!(n=xve(e,i))||n.enumerable});return t};var z=(t,e,r)=>(r=t!=null?vve(kve(t)):{},IJ(e||!t||!t.__esModule?UB(r,"default",{value:t,enumerable:!0}):r,t)),Kr=t=>IJ(UB({},"__esModule",{value:!0}),t);var h=L(()=>{(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"
|
|
1
|
+
var vve=Object.create;var UB=Object.defineProperty;var xve=Object.getOwnPropertyDescriptor;var Fve=Object.getOwnPropertyNames;var kve=Object.getPrototypeOf,Rve=Object.prototype.hasOwnProperty;var L=(t,e)=>()=>(t&&(e=t(t=0)),e);var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),GB=(t,e)=>{for(var r in e)UB(t,r,{get:e[r],enumerable:!0})},IJ=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Fve(e))!Rve.call(t,i)&&i!==r&&UB(t,i,{get:()=>e[i],enumerable:!(n=xve(e,i))||n.enumerable});return t};var z=(t,e,r)=>(r=t!=null?vve(kve(t)):{},IJ(e||!t||!t.__esModule?UB(r,"default",{value:t,enumerable:!0}):r,t)),Kr=t=>IJ(UB({},"__esModule",{value:!0}),t);var h=L(()=>{(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"da67fc8208b251275ac90d96fcd9b4dc09f780d7"}}catch{}})()});var BJ=R((TEt,EJ)=>{h();function EF(t){return t==null?[]:Array.isArray(t)?t:[t]}function Nve(t,e,r,n){var i,s=t[e],o=~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]=s==null?o:Array.isArray(s)?s.concat(o):[s,o]}EJ.exports=function(t,e){t=t||[],e=e||{};var r,n,i,s,o,a={_:[]},A=0,c=0,u=0,l=t.length;let d=e.alias!==void 0,g=e.unknown!==void 0,p=e.default!==void 0;if(e.alias=e.alias||{},e.string=EF(e.string),e.boolean=EF(e.boolean),d)for(r in e.alias)for(n=e.alias[r]=EF(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(s=typeof e.default[r],n=e.alias[r]=e.alias[r]||[],e[s]!==void 0)for(e[s].push(r),A=0;A<n.length;A++)e[s].push(n[A])}let f=g?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(s=i.substring(c+3),g&&!~f.indexOf(s))return e.unknown(i);a[s]=!1}else{for(u=c+1;u<i.length&&i.charCodeAt(u)!==61;u++);for(s=i.substring(c,u),o=i.substring(++u)||A+1===l||(""+t[A+1]).charCodeAt(0)===45||t[++A],n=c===2?[s]:s,u=0;u<n.length;u++){if(s=n[u],g&&!~f.indexOf(s))return e.unknown("-".repeat(c)+s);Nve(a,s,u+1<n.length||o,e)}}}if(p)for(r in e.default)a[r]===void 0&&(a[r]=e.default[r]);if(d)for(r in a)for(n=e.alias[r]||[];n.length>0;)a[n.shift()]=a[r];return a}});function Tve(){if(em!==void 0)return em;try{return em=require("prettier"),em}catch{return em=null,null}}function Mve(t){let e=[],r=Dl.default.dirname(t);for(;r!==Dl.default.dirname(r);){let n=Dl.default.join(r,".prettierignore");BF.default.existsSync(n)&&e.push(n);let i=Dl.default.join(r,".git");if(BF.default.existsSync(i))break;r=Dl.default.dirname(r)}return e}function Pve(t){if(t)try{let r=(0,yJ.createRequire)(t)("prettier");if(r)return r}catch{}return Tve()}async function FA(t,e,r,n){try{let i=Dl.default.resolve(t,n??"file.tsx"),s=Pve(i);if(!s)return e;if(n){let A=Mve(i);if((await s.getFileInfo(i,{ignorePath:A.length>0?A:void 0})).ignored)return e}let o=await s.resolveConfig(i);return await s.format(e,{...o,filepath:n,parser:r})}catch{return e}}var yJ,Dl,BF,em,yF=L(()=>{"use strict";h();yJ=require("node:module"),Dl=z(require("node:path"),1),BF=z(require("node:fs"),1)});var QF,yp,OB,KB,QJ,wl,DF,wF,bl,DJ,Qp=L(()=>{"use strict";h();QF="preview-url",yp="framework",OB="platform",KB="node",QJ="/~builder-connect",wl="/~builder-connected",DF="/~builder-dev-tools",wF="/~builder-dev-tools.js",bl="/~builder-dev-tools-close",DJ="/mappings"});var HB=R((GEt,wJ)=>{"use strict";h();var bF={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"},Lve={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},_ve={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?bF.up():"");return t&&(e+=bF.left),e}};wJ.exports={cursor:bF,scroll:Lve,erase:_ve,beep:"\x07"}});var pr=R((KEt,SF)=>{h();var YB=process||{},bJ=YB.argv||[],JB=YB.env||{},Uve=!(JB.NO_COLOR||bJ.includes("--no-color"))&&(!!JB.FORCE_COLOR||bJ.includes("--color")||YB.platform==="win32"||(YB.stdout||{}).isTTY&&JB.TERM!=="dumb"||!!JB.CI),Gve=(t,e,r=t)=>n=>{let i=""+n,s=i.indexOf(e,t.length);return~s?t+Ove(i,e,r,s)+e:t+i+e},Ove=(t,e,r,n)=>{let i="",s=0;do i+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return i+t.substring(s)},SJ=(t=Uve)=>{let e=t?Gve:()=>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")}};SF.exports=SJ();SF.exports.createColors=SJ});function Kve({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 _J(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Hve,"")}function UJ(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function tm(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=_J(t),t.length===0))return 0;t=t.replace(qve()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let s=i.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(Yve.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}function Wve(){let t=new Map;for(let[e,r]of Object.entries(vr)){for(let[n,i]of Object.entries(r))vr[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=vr[n],t.set(i[0],i[1]);Object.defineProperty(vr,e,{value:r,enumerable:!1})}return Object.defineProperty(vr,"codes",{value:t,enumerable:!1}),vr.color.close="\x1B[39m",vr.bgColor.close="\x1B[49m",vr.color.ansi=vJ(),vr.color.ansi256=xJ(),vr.color.ansi16m=FJ(),vr.bgColor.ansi=vJ(vF),vr.bgColor.ansi256=xJ(vF),vr.bgColor.ansi16m=FJ(vF),Object.defineProperties(vr,{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(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>vr.rgbToAnsi256(...vr.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 s=Math.max(r,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>vr.ansi256ToAnsi(vr.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>vr.ansi256ToAnsi(vr.hexToAnsi256(e)),enumerable:!1}}),vr}function NJ(t,e,r){return String(t).normalize().replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`).map(n=>rxe(n,e,r)).join(`
|
|
4
4
|
`)}function TF(t,e){if(typeof t=="string")return qB.aliases.get(t)===e;for(let r of t)if(r!==void 0&&TF(r,e))return!0;return!1}function ixe(t,e){if(t===e)return;let r=t.split(`
|
|
@@ -72,8 +72,8 @@ ${qJ}${n.trimStart()}`),r=3+(0,Sl.stripVTControlCharacters)(n.trimStart()).lengt
|
|
|
72
72
|
`):process.stdout.write(`${Q} ${a}
|
|
73
73
|
`),p(),i()};return{start:I,stop:B,message:(E="")=>{a=m(E??a)}}}});function Ht(t,e=""){return t.ts.createSourceFile("module.tsx",typeof e=="string"?e:"",t.ts.ScriptTarget.Latest,void 0)}function ey(t,e=""){let r=Ht(t,e?.trim());if(r.statements.length===0)throw new Error(`No statements found in code: ${e}`);return r.statements[0]}function vn(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
|
-
`}return""}var _r=L(()=>{"use strict";h()});var
|
|
76
|
-
`,getSourceFile:a=>{if(a=t.normalize(a),a.includes("node_modules")){let c=sm.get(a);if(c)return Ht(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=
|
|
75
|
+
`}return""}var _r=L(()=>{"use strict";h()});var tY=R((iBt,eY)=>{"use strict";h();eY.exports=function(){if(process.env.npm_config_user_agent)return Bxe(process.env.npm_config_user_agent)};function Bxe(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 _s(t){return t.endsWith(".mapper.tsx")||t.endsWith(".mapper.jsx")||t.endsWith(".mapper.ts")||t.endsWith(".mapper.js")||t.endsWith(".mapper.mjs")}function Jt(t,e,r){e=No(e),r=No(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=No(t.normalize(i)),i.startsWith(".")||(i="./"+i),i}function No(t){return t.startsWith("\\\\?\\")?t:t.replace(/\\/g,"/")}function xl(t,e){let r=t.extname(e),n=t.basename(e,r).split(/[\/\\]/),i=n[n.length-1];return rY(i==="index"?t.basename(t.dirname(e)):i)}function rY(t){return dr(t).replace(/ /g,"")}function Us(t,e){let r=t.extname(e),n=No(t.basename(e,r)).split("/").pop();return dr(n==="index"?t.basename(t.dirname(e)):n)}function fr(t,e){let r=No(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 er(t,e){let r=e,n=[];for(let i=0;i<2;i++){let s=t.basename(r);if(!s||s==="components")break;n.unshift(s),r=t.dirname(r)}return n.join("/")}function dr(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 qi(t){return t.sort((e,r)=>e.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function ur(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 iY(t){return(await t.hash(t.getAppRootDir())).substring(0,8)}function nm(t){return typeof t=="number"}function Sp(t){return typeof t=="boolean"}function Si(t){return typeof t=="string"}function vp(t){return typeof t=="string"?/^[A-Z][A-Za-z0-9]*$/.test(t):!1}function Is(t){return JSON.parse(JSON.stringify(t))}function ty(t,e,r){for(let n of e)if(t.dirname(r).includes(n))return!0;return!1}function sY(){try{let t=(0,nY.default)();if(t?.name)return t.name}catch{}return"npm"}function yxe(){return process.platform.startsWith("win")}function rt(){return process.pkg?"@builder.io/agent":yxe()?'"@builder.io/dev-tools"':"builder.io"}function GF(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_")}var nY,Qt=L(()=>{"use strict";h();nY=z(tY(),1)});function vi(t){let e=t.join(t.getAppRootDir(),"tsconfig.json");return t.exists(e)}async function $i(t,e){async function r(i,s){if(s>10)return;let o=await t.readdir(i);for(let a of o){if(Qxe.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,s+1);if(u)return u}}}}let n=await r(t.getAppRootDir(),0);if(!n){let s=`builder-registry.${await vi(t)?"ts":"js"}`;return t.join(e,s)}return n}async function To(t,e){let r=t.resolve("/");for(let n=0;n<20;n++){let i=t.join(e,"package.json"),s=await t.readFile(i);if(s)return JSON.parse(s);if(e===r)break;e=t.dirname(e)}return null}async function oY(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 im(t,e,r){let n=await t.readdir(e);return n.includes(r)?t.join(e,r):(await Promise.all(n.map(async s=>{if(s.startsWith(".")||s==="node_modules")return;let o=t.join(e,s);if((await t.stat(o)).isDirectory()){let A=await im(t,o,r);if(A)return A}}))).find(s=>typeof s=="string")}var Qxe,gi=L(()=>{"use strict";h();Qxe=["node_modules","dist","build","public"]});async function fn(t,e,r){if(!Array.isArray(e)||e.length===0)throw new Error(`createTsProgram() Invalid filePaths: ${e}`);let n=await oY(t,e[0]),i=t.join(n,"typescript","lib"),s=new Map,o={fileExists:a=>{if(a=t.normalize(a),a.includes("node_modules")){let A=sm.get(a);if(!A){try{t.statSync(a).isFile()?A={exists:!0,content:t.readFileSync(a)}:A={exists:!1}}catch{A={exists:!1}}sm.set(a,A)}return A.exists}if(!s.has(a))if(t.existsSync(a)){let c=t.statSync(a);s.set(a,c.isFile())}else s.set(a,!1);return s.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=sm.get(a);if(c)return Ht(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=AY.get(c),A==null&&typeof self<"u"&&typeof fetch=="function"))throw new ny(c)}return a.includes("node_modules")&&(A?sm.set(a,{exists:!0,content:A}):sm.set(a,{exists:!1})),Ht(t,A)},readFile:a=>{let A=t.readFileSync(a);return typeof A=="string"?A:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return Dxe(t,o,e,r)}catch(a){if(a instanceof ny){await wxe(t,a.libName);continue}throw t.Sentry?.captureException(a),new Error(`createTsProgram() Could not create program for: ${e[0]}`,{cause:a})}}function Dxe(t,e,r,n){let i={rootNames:[...r],host:e,options:{}},s=t.ts.findConfigFile(t.dirname(r[0]),o=>t.existsSync(o));if(s){let o=aY.get(s);if(!o){let a=t.ts.readConfigFile(s,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:s}}):(o=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(s),void 0,s).options,aY.set(s,o))}o&&(i.options=Is(o))}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 xp(t,e,r){r||(r=await fn(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 wxe(t,e){let r=`https://cdn.jsdelivr.net/npm/typescript@${t.ts.version}/lib/${e}`;ry.has(e)||ry.set(e,fetch(r).then(n=>n.text()).then(n=>{AY.set(e,n)})),await ry.get(e),ry.delete(e)}async function cY(t,e){let r=await t.readFile(e.filePath);return r==null?{diagnostics:[{messageText:`Error reading: ${e.filePath}`}],code:null,output:null}:OF(t,{code:r,filePath:e.filePath,compilerOptions:e.compilerOptions})}function OF(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 ny,AY,ry,sm,aY,Gs=L(()=>{"use strict";h();_r();Qt();gi();ny=class{libName;constructor(e){this.libName=e}};AY=new Map,ry=new Map,sm=new Map,aY=new Map});var bxe,ut,Hr=L(()=>{"use strict";h();bxe="1.53.3-beta.202605061032.da67fc8",ut=process.env.OVERRIDE_VERSION??bxe});async function Fl(t){let e=[],r=await To(t,t.getRepoRootDir());if(r){let n=await lY(r,t);e.push(...n)}return e}async function lY(t,e){let r=[];if(t&&typeof t=="object"){let n=new Set(Object.keys({...t.dependencies,...t.devDependencies}));for(let i of Sxe)if(n.has(i)&&!r.some(s=>s.name===i)){let s={name:i};uY.has(i)&&(s.version=await uY.get(i)(e)),r.push(s)}}return r}function KF(t){let e=parseInt(t);return Number.isNaN(e)?void 0:e}var uY,Sxe,kl=L(()=>{"use strict";h();gi();Qt();uY=new Map([["next",async t=>{if(!t.spawnSync)return;let e=sY(),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 s=i[0].split("Next.js v")[1],[o,a,A]=s.split(".");return{major:KF(o),minor:KF(a),patch:KF(A)}}]]),Sxe=["@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 Os(t){let e=gY(t),r=await t.readFile(e);return typeof r=="string"?JSON.parse(r):{}}async function Ks(t,e){e=typeof e=="object"&&e!=null?e:{};let r=gY(t);await t.writeFile(r,JSON.stringify(e??{},null,2))}function gY(t){let e=t.getAppRootDir();return t.join(e,"node_modules",".builder","builder-cache.json")}var Rl=L(()=>{"use strict";h()});async function Ba(t,e,r){let n={envKey:r,envValue:null,file:""};for(let i of e){let s=t.join(t.getAppRootDir(),i),o=await vxe(t,s);if(o){let a=o[r];if(typeof a=="string"&&a.length>0&&a!=="YOUR_API_KEY")return n.envValue=a,n.file=s,n}}return n.file=t.join(t.getAppRootDir(),e[e.length-1]),n}async function vxe(t,e){let r=await t.readFile(e);return typeof r=="string"?pY(r):null}function pY(t){let e={},r=t.replace(/\r\n?/gm,`
|
|
77
77
|
`),n;for(;(n=xxe.exec(r))!=null;){let i=n[1],s=n[2]||"";s=s.trim();let o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),o==='"'&&(s=s.replace(/\\n/g,`
|
|
78
78
|
`),s=s.replace(/\\r/g,"\r")),e[i]=s}return e}async function ya(t,e,r,n){let i="# https://www.builder.io/c/docs/using-your-api-key",s=await t.readFile(e);try{if(s)if(s.includes(r))if(s.includes(n))t.debug(`"${r}" with "${n}" already set in ${e}`);else return t.debug(`Replace "${r}" in ${e}`),s=s.replace(new RegExp(`${r}=.*`),`${r}=${n}`),await t.writeFile(e,s),"update";else return t.debug(`Append "${r}" to ${e}`),s+=`
|
|
79
79
|
|
|
@@ -81,7 +81,7 @@ ${i}
|
|
|
81
81
|
${r}=${n}
|
|
82
82
|
|
|
83
83
|
`,await t.writeFile(e,s),"update";else return t.debug(`Creating new .env file with "${r}" at ${e}`),s=[i,`${r}=${n}`,""].join(`
|
|
84
|
-
`),await t.writeFile(e,s),"create"}catch(o){if(o&&String(o).includes("EACCES"))return t.debug(`Permssion denied, failed to create or modify .env file with "${r}=${n}" at ${e}`),"permission-error";t.Sentry?.captureException(o)}return null}var xxe,Nl=L(()=>{"use strict";h();xxe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm});async function om(t){return await Ba(t,[".env.local",".env.development.local",".env.production.local",".env.development",".env.production",".env"],Qa)}async function d9(t,e){let r=await om(t),n=await ya(t,r.file,r.envKey,e);return{...r,modifiedType:n}}var Qa,am=L(()=>{"use strict";h();Nl();Qa="NEXT_PUBLIC_BUILDER_API_KEY"});var Ze,Am,xn=L(()=>{"use strict";h();Ze={gen1:"Gen 1",gen2:"Gen 2"},Am={CMS:"cms",VCP:"vcp",HYBRID:"hybrid"}});function Fp(t,e,r,n,i=!0){let s=e.properties.filter(a=>t.ts.isPropertyAssignment(a)),o=Fxe(t,e,r);return o>-1?n==null&&i?t.ts.factory.updateObjectLiteralExpression(e,s.filter((a,A)=>A!==o)):(s[o]=t.ts.factory.updatePropertyAssignment(s[o],s[o].name,cm(t,n)),t.ts.factory.updateObjectLiteralExpression(e,s)):(n!=null&&s.push(t.ts.factory.createPropertyAssignment(r,cm(t,n))),t.ts.factory.updateObjectLiteralExpression(e,s))}function Fxe(t,e,r){return e.properties.findIndex(n=>sr(t,n)===r)}function um(t,e){switch(e.kind){case t.ts.SyntaxKind.ArrayLiteralExpression:return Rxe(t,e);case t.ts.SyntaxKind.ObjectLiteralExpression:return kxe(t,e);case t.ts.SyntaxKind.StringLiteral:return e.text;case t.ts.SyntaxKind.NumericLiteral:return Number(e.text);case t.ts.SyntaxKind.NoSubstitutionTemplateLiteral:return e.text;case t.ts.SyntaxKind.TrueKeyword:return!0;case t.ts.SyntaxKind.FalseKeyword:return!1;case t.ts.SyntaxKind.Identifier:switch(e.escapedText){case"undefined":return;case"null":return null;case"String":return String;case"Number":return Number;case"Boolean":return Boolean;case"NaN":return NaN}}}function kxe(t,e){let r={};if(e&&t.ts.isObjectLiteralExpression(e)){for(let n of e.properties)if(t.ts.isPropertyAssignment(n)){let i=sr(t,n);i&&(r[i]=um(t,n.initializer))}}return r}function Rxe(t,e){return e&&t.ts.isArrayLiteralExpression(e)?e.elements.map(r=>um(t,r)):[]}function sr(t,e){if(e&&t.ts.isPropertyAssignment(e)){let r=e.name;switch(r.kind){case t.ts.SyntaxKind.Identifier:return r.text;case t.ts.SyntaxKind.StringLiteral:case t.ts.SyntaxKind.NumericLiteral:return r.text;case t.ts.SyntaxKind.ComputedPropertyName:let n=r.expression;if(t.ts.isStringLiteral(n)||t.ts.isNumericLiteral(n))return r.expression.text}}}function cm(t,e){return HF(t,e,new WeakSet)}function HF(t,e,r){return e===void 0?t.ts.factory.createIdentifier("undefined"):e===null?t.ts.factory.createIdentifier("null"):typeof e=="string"?t.ts.factory.createStringLiteral(e):typeof e=="number"?isNaN(e)?t.ts.factory.createIdentifier("NaN"):t.ts.factory.createNumericLiteral(e):e===!0?t.ts.factory.createTrue():e===!1?t.ts.factory.createFalse():e===String?t.ts.factory.createIdentifier("String"):e===Number?t.ts.factory.createIdentifier("Number"):e===Boolean?t.ts.factory.createIdentifier("Boolean"):Array.isArray(e)?Nxe(t,e,r):typeof e=="object"?Txe(t,e,r):t.ts.factory.createIdentifier(e)}function Nxe(t,e,r){let n=e.map(i=>HF(t,i,r));return t.ts.factory.createArrayLiteralExpression(n,!0)}function Txe(t,e,r){if(r.has(e))return t.ts.factory.createIdentifier("undefined");r.add(e);let n=Object.keys(e).map(i=>t.ts.factory.createPropertyAssignment(i,HF(t,e[i],r)));return t.ts.factory.createObjectLiteralExpression(n,!0)}var Da=L(()=>{"use strict";h()});function Tl(t,e,r){let n=[];if(!r)return n;let i=null;if(t.ts.isArrowFunction(r)||t.ts.isFunctionExpression(r)||t.ts.isFunctionDeclaration(r)){let s=r.parameters;if(s.length>0){let o=s[0],a=e.getTypeAtLocation(o);a.aliasTypeArguments&&a.aliasTypeArguments.length>0&&(a=a.aliasTypeArguments[0]),a.flags&t.ts.TypeFlags.Object&&(i=a.getProperties())}}else if(t.ts.isIdentifier(r)){let s=e.getTypeAtLocation(r),o=s.symbol?.valueDeclaration;if(o&&t.ts.isClassDeclaration(o)){let A=o.heritageClauses?.find(c=>c.token===t.ts.SyntaxKind.ExtendsKeyword)?.types;if(A){for(let c of A)if(e.getSymbolAtLocation(c.expression)?.name==="Component"){if(t.ts.isExpressionWithTypeArguments(c)){let l=c.typeArguments;if(l){let d=l[0];i=e.getTypeFromTypeNode(d).getProperties()}}break}}}if(!i){let a=s.getCallSignatures();if(a.length>0){let A=a[0].getParameters();A.length>0&&(i=e.getTypeOfSymbolAtLocation(A[0],r).getProperties())}}}else if(t.ts.isExportSpecifier(r)){let s=e.getSymbolAtLocation(r.name);if(s){let a=e.getTypeOfSymbolAtLocation(s,r).getCallSignatures();if(a.length>0){let A=a[0].getParameters();A.length>0&&(i=e.getTypeOfSymbolAtLocation(A[0],r).getProperties())}}}if(i)for(let s of i){let o=Mxe(t,e,s);o&&n.push(o)}return n=n.filter(h9),n.length>0?n:Pxe(t,r)}function Mxe(t,e,r){let n=r.valueDeclaration,i=r.getName();if(n||(n=r.getDeclarations()?.[0]),n&&t.ts.isPropertySignature(n)){if(i!=="children"&&n.getSourceFile().fileName.includes("node_modules/@types/"))return null;let s="string",o;if(n?.type){let A=e.getTypeFromTypeNode(n.type),c=e.typeToString(A),u=JF(c);u.knownType?s=u.builderType:_xe(c)||A.flags&t.ts.TypeFlags.StringLike?s="string":A.flags&t.ts.TypeFlags.NumberLike?s="number":A.flags&t.ts.TypeFlags.IndexedAccess?s="list":A.flags&t.ts.TypeFlags.Object||A.isUnion()&&A.types.every(l=>l.flags&t.ts.TypeFlags.Object)||A.isIntersection()&&A.types.some(l=>l.flags&t.ts.TypeFlags.Object)?s="object":s="string",c!==s&&(o=c)}let a={name:i,type:s,isRegistered:!1};if(o&&n.type){let A=Kxe(t,e,e.getTypeFromTypeNode(n.type));a.meta=a.meta||{},A&&A.length>0&&a.type==="string"&&A.every(Gxe)?a.enum=A.map(Oxe):a.meta.ts=o}return n.questionToken||(a.required=!0),a}return null}function Pxe(t,e){let r=[],n=t.ts.getJSDocCommentsAndTags(e);for(let i of n)if(!(!t.ts.isJSDoc(i)||!i.tags))for(let s of i.tags){if(!t.ts.isJSDocParameterTag(s)||s.tagName.text!=="param")continue;let a=s.typeExpression?.type;if(!a||!t.ts.isJSDocTypeLiteral(a))continue;let A=a.jsDocPropertyTags;if(A)for(let c of A){if(!t.ts.isJSDocPropertyLikeTag(c))continue;let u=c.name;if(!t.ts.isQualifiedName(u))continue;let l=c.typeExpression;if(!l)continue;let d="";switch(l.type.kind){case t.ts.SyntaxKind.StringKeyword:{d="string";break}case t.ts.SyntaxKind.NumberKeyword:{d="number";break}case t.ts.SyntaxKind.BooleanKeyword:{d="boolean";break}default:continue}let p={name:u.right.text,type:d,isRegistered:!1};r.push(p)}}return r.filter(h9)}function _xe(t){return typeof t!="string"?!1:!!Lxe.some(e=>t.includes(e))}function JF(t){return typeof t=="string"&&(t=t.trim(),Uxe.some(e=>e.value===t))?{builderType:t,knownType:!0}:{builderType:"string",knownType:!1}}function Gxe(t){return/^['"].*['"]$/.test(t)}function Oxe(t){return(t.startsWith('"')||t.startsWith("'"))&&(t.endsWith('"')||t.endsWith("'"))?t.slice(1,-1):t}function h9(t){let e=t?.name;if(typeof e!="string"||e===""||e.startsWith("aria")||e.startsWith("data-"))return!1;if(e.startsWith("on")&&e.length>2){let r=e.charAt(2);if(r.toUpperCase()===r)return!1}return!Jxe.has(e.toLowerCase())}var Lxe,Uxe,Kxe,Hxe,f9,Jxe,lm=L(()=>{"use strict";h();Lxe=["ClassicComponent","FunctionComponent","IntrinsicElements","JSX","ReactNode","ReactElement","ReactPortal"];Uxe=[{value:"boolean",text:"boolean"},{value:"color",text:"color (provides a color in hex or rgb)"},{value:"date",text:"date (same format as the Date constructor)"},{value:"email",text:"email"},{value:"file",text:"file (uploads a file and provides a url)"},{value:"list",text:"list (collection of items)"},{value:"longText",text:"longText (multiline text editor)"},{value:"number",text:"number"},{value:"object",text:"object (set of specific names and values)"},{value:"richText",text:"richText (provides value as html)"},{value:"string",text:"string"}];Kxe=(t,e,r)=>{let n=new Set;f9(t,e,r,n);let i=n.delete("true"),s=n.delete("false");(i||s)&&n.add("boolean");let o=Array.from(n.keys()).sort();if(o.length>1&&(o=o.map(a=>a.indexOf("=>")>=0?`(${a})`:a)),!(o.length>20))return o},Hxe=(t,e,r)=>{let n=t.ts.TypeFormatFlags.InElementType|t.ts.TypeFormatFlags.NoTruncation;return e.typeToString(r,void 0,n)},f9=(t,e,r,n)=>{if(r.isUnion())r.types.forEach(i=>{f9(t,e,i,n)});else if(r.isLiteral()){let i=Hxe(t,e,r);n.add(i)}};Jxe=new Set(["about","accessKey","accessKeyLabel","asChild","autoCapitalize","autoCorrect","autoFocus","autoSave","blur","contentEditable","contextMenu","dangerouslySetInnerHTML","datatype","defaultChecked","defaultValue","dir","draggable","enterKeyHint","focus","form","formAction","formEncType","formMethod","formNoValidate","formTarget","inlist","innerText","inputMode","is","isContentEditable","itemID","itemProp","itemRef","itemScope","itemType","lang","nonce","offsetHeight","offsetLeft","offsetTop","offsetWidth","outerText","prefix","property","radioGroup","rel","resource","results","rev","role","security","slot","spellCheck","suppressContentEditableWarning","suppressHydrationWarning","tabIndex","translate","typeof","unselectable","vocab"].map(t=>t.toLowerCase()))});function Vi(t,e,r){for(let n of r.properties){if(!t.ts.isPropertyAssignment(n))continue;let i=sr(t,n);if(i==="name"&&t.ts.isStringLiteral(n.initializer)){e.name=n.initializer.text;continue}if(i==="description"&&t.ts.isStringLiteral(n.initializer)){e.description=n.initializer.text;continue}if(i==="image"&&t.ts.isStringLiteral(n.initializer)){e.image=n.initializer.text;continue}if(i==="inputs"&&t.ts.isArrayLiteralExpression(n.initializer)){let s=Yxe(t,n.initializer);Es(e,s);continue}if(i==="meta"&&t.ts.isObjectLiteralExpression(n.initializer)){let s=um(t,n.initializer);s&&typeof s=="object"&&(e.meta=s);continue}}return e}function Yxe(t,e){let r=[];for(let n of e.elements)t.ts.isObjectLiteralExpression(n)&&r.push(jxe(t,n));return r}function jxe(t,e){let r=um(t,e),n=Zxe(r);return n.isRegistered=!0,n}function hn(t,e,r){let n=$xe(r);return e=Fp(t,e,"name",n.name,!1),e=Fp(t,e,"description",n.description),e=Fp(t,e,"image",n.image),e=Fp(t,e,"meta",n.meta),e=qxe(t,e,n),eFe(t,e)}function qxe(t,e,r){let n=null,i=e.properties.filter(a=>t.ts.isPropertyAssignment(a)&&t.ts.isIdentifier(a.name)),s=i.findIndex(a=>t.ts.isIdentifier(a.name)&&a.name.text==="inputs"),o=[...r.inputs??[]];if(s>-1){if(o.length===0)return Fp(t,e,"inputs",null);let a=i[s];t.ts.isPropertyAssignment(a)&&t.ts.isArrayLiteralExpression(a.initializer)&&(n=a.initializer)}return o.length===0?e:(n=Wxe(t,n||t.ts.factory.createArrayLiteralExpression(),o),s>-1?i[s]=t.ts.factory.updatePropertyAssignment(i[s],i[s].name,n):i.push(t.ts.factory.createPropertyAssignment("inputs",n)),t.ts.factory.updateObjectLiteralExpression(e,i))}function $xe(t){return{name:t.name,description:t.description,image:t.image,inputs:(t.inputs||[]).filter(r=>r.isRegistered).map(Vxe),...t.meta?{meta:{...t.meta}}:{}}}function Vxe(t){let e={name:t.name,type:t.type};return(Si(t.defaultValue)||nm(t.defaultValue)||Sp(t.defaultValue))&&(e.defaultValue=t.defaultValue),Si(t.friendlyName)&&(e.friendlyName=t.friendlyName),Si(t.helperText)&&(e.helperText=t.helperText),t.required===!0&&(e.required=!0),Array.isArray(t.enum)&&(e.enum=t.enum),t.hideFromUI===!0&&(e.hideFromUI=!0),typeof t.meta=="object"&&t.meta!=null&&Object.keys(t.meta).length>0&&(e.meta=t.meta),e}function Wxe(t,e,r){let n=e.elements.filter(i=>{if(!t.ts.isObjectLiteralExpression(i))return!1;let s=i.properties.find(a=>sr(t,a)==="name");if(!s)return!1;let o=s.initializer;return t.ts.isStringLiteral(o)?r.some(a=>a.name===o.text):!1});for(let i of r)n=zxe(t,n,i);return n.sort((i,s)=>{let o=i.properties.find(d=>sr(t,d)==="name"),a=s.properties.find(d=>sr(t,d)==="name"),A=o?.initializer,c=a?.initializer,u=A&&t.ts.isStringLiteral(A)?A.text:"zz",l=c&&t.ts.isStringLiteral(c)?c.text:"zz";return u.toLowerCase().localeCompare(l.toLowerCase())}),t.ts.factory.updateArrayLiteralExpression(e,n)}function zxe(t,e,r){let n=e.findIndex(i=>i.properties.some(s=>{let o=sr(t,s);return t.ts.isPropertyAssignment(s)&&o==="name"&&t.ts.isStringLiteral(s.initializer)&&s.initializer.text===r.name}));if(n>-1)e[n]=m9(t,e[n],r);else{let i=m9(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("name",t.ts.factory.createStringLiteral(r.name))],!0),r);e.push(i)}return e}function m9(t,e,r){let n=e.properties.filter(s=>t.ts.isPropertyAssignment(s)),i=Object.keys(r).filter(s=>s!=="isRegistered");for(let s of i)n=Xxe(t,n,r,s);return n=tFe(t,n.filter(s=>{let o=sr(t,s);return i.includes(o)})),t.ts.factory.updateObjectLiteralExpression(e,n)}function Xxe(t,e,r,n){let i=e.findIndex(s=>t.ts.isIdentifier(s.name)&&s.name.text===n);return i>-1?e[i]=t.ts.factory.updatePropertyAssignment(e[i],e[i].name,cm(t,r[n])):e.push(t.ts.factory.createPropertyAssignment(n,cm(t,r[n]))),e}function Es(t,e){for(let r of e){let n=t.inputs.findIndex(i=>i.name===r.name);n>-1?(r.isRegistered||!t.inputs[n].isRegistered)&&(t.inputs[n]=r):t.inputs.push(r)}t.acceptsChildren=YF(t)}function Zxe(t){let e=JF(t.type),r={name:t.name.trim(),type:e.builderType};return Si(t.friendlyName)&&t.friendlyName.trim()!==t.name.trim()&&(r.friendlyName=t.friendlyName),(Si(t.defaultValue)||nm(t.defaultValue)||Sp(t.defaultValue))&&(r.defaultValue=t.defaultValue),Si(t.helperText)&&(r.helperText=t.helperText),Sp(t.required)&&(r.required=t.required),typeof t.meta=="object"&&t.meta!=null&&Object.keys(t.meta).length>0&&(r.meta=t.meta),Array.isArray(t.enum)&&t.enum.length>0&&(r.enum=t.enum),t.hideFromUI===!0&&(r.hideFromUI=!0),jF(r)}function YF(t){let e=t.inputs.some(n=>n.name==="children"),r=t.inputs.some(n=>n.meta?.ts==="ReactNode");return!!(e||r||t.acceptsChildren===!0)}function jF(t){if(t.name==="children"&&(t.hideFromUI=!0,delete t.required),t.type==="object"&&t.defaultValue==null&&(t.hideFromUI=!0),t.type==="list"&&t.defaultValue==null&&(t.hideFromUI=!0),t.meta){let e=t.meta.ts;typeof e=="string"&&(e=e.trim(),e.endsWith("ReactNode")&&(e="ReactNode"),t.meta.ts=e,e==="ReactNode"&&(t.hideFromUI=!0))}return t}function eFe(t,e){let r=[...e.properties].sort((n,i)=>{let s=sr(t,n)||"zz",o=sr(t,i)||"zz";if(s==="inputs")return 1;let a=C9.indexOf(s),A=C9.indexOf(o);return a>-1?A>-1&&a>A?1:-1:A>-1?a>-1&&A<a?-1:1:s.localeCompare(o)});return t.ts.factory.updateObjectLiteralExpression(e,r)}function tFe(t,e){return[...e].sort((n,i)=>{let s=sr(t,n)||"zz",o=sr(t,i)||"zz",a=I9.indexOf(s),A=I9.indexOf(o);return a>-1?A>-1&&a>A?1:-1:A>-1?a>-1&&A<a?-1:1:s.localeCompare(o)})}function kp(t,e){for(let r of e.properties){if(!t.ts.isPropertyAssignment(r)||!t.ts.isIdentifier(r.name))continue;if(sr(t,r)==="canHaveChildren"){let{initializer:i}=r;return i.kind===t.ts.SyntaxKind.TrueKeyword}}return!1}var C9,I9,xi=L(()=>{"use strict";h();Da();lm();Qt();C9=["component","name","description"];I9=["name","type"]});function E9(t,e){let r=`Builder.registerComponent(
|
|
84
|
+
`),await t.writeFile(e,s),"create"}catch(o){if(o&&String(o).includes("EACCES"))return t.debug(`Permssion denied, failed to create or modify .env file with "${r}=${n}" at ${e}`),"permission-error";t.Sentry?.captureException(o)}return null}var xxe,Nl=L(()=>{"use strict";h();xxe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm});async function om(t){return await Ba(t,[".env.local",".env.development.local",".env.production.local",".env.development",".env.production",".env"],Qa)}async function dY(t,e){let r=await om(t),n=await ya(t,r.file,r.envKey,e);return{...r,modifiedType:n}}var Qa,am=L(()=>{"use strict";h();Nl();Qa="NEXT_PUBLIC_BUILDER_API_KEY"});var Ze,Am,xn=L(()=>{"use strict";h();Ze={gen1:"Gen 1",gen2:"Gen 2"},Am={CMS:"cms",VCP:"vcp",HYBRID:"hybrid"}});function Fp(t,e,r,n,i=!0){let s=e.properties.filter(a=>t.ts.isPropertyAssignment(a)),o=Fxe(t,e,r);return o>-1?n==null&&i?t.ts.factory.updateObjectLiteralExpression(e,s.filter((a,A)=>A!==o)):(s[o]=t.ts.factory.updatePropertyAssignment(s[o],s[o].name,cm(t,n)),t.ts.factory.updateObjectLiteralExpression(e,s)):(n!=null&&s.push(t.ts.factory.createPropertyAssignment(r,cm(t,n))),t.ts.factory.updateObjectLiteralExpression(e,s))}function Fxe(t,e,r){return e.properties.findIndex(n=>sr(t,n)===r)}function um(t,e){switch(e.kind){case t.ts.SyntaxKind.ArrayLiteralExpression:return Rxe(t,e);case t.ts.SyntaxKind.ObjectLiteralExpression:return kxe(t,e);case t.ts.SyntaxKind.StringLiteral:return e.text;case t.ts.SyntaxKind.NumericLiteral:return Number(e.text);case t.ts.SyntaxKind.NoSubstitutionTemplateLiteral:return e.text;case t.ts.SyntaxKind.TrueKeyword:return!0;case t.ts.SyntaxKind.FalseKeyword:return!1;case t.ts.SyntaxKind.Identifier:switch(e.escapedText){case"undefined":return;case"null":return null;case"String":return String;case"Number":return Number;case"Boolean":return Boolean;case"NaN":return NaN}}}function kxe(t,e){let r={};if(e&&t.ts.isObjectLiteralExpression(e)){for(let n of e.properties)if(t.ts.isPropertyAssignment(n)){let i=sr(t,n);i&&(r[i]=um(t,n.initializer))}}return r}function Rxe(t,e){return e&&t.ts.isArrayLiteralExpression(e)?e.elements.map(r=>um(t,r)):[]}function sr(t,e){if(e&&t.ts.isPropertyAssignment(e)){let r=e.name;switch(r.kind){case t.ts.SyntaxKind.Identifier:return r.text;case t.ts.SyntaxKind.StringLiteral:case t.ts.SyntaxKind.NumericLiteral:return r.text;case t.ts.SyntaxKind.ComputedPropertyName:let n=r.expression;if(t.ts.isStringLiteral(n)||t.ts.isNumericLiteral(n))return r.expression.text}}}function cm(t,e){return HF(t,e,new WeakSet)}function HF(t,e,r){return e===void 0?t.ts.factory.createIdentifier("undefined"):e===null?t.ts.factory.createIdentifier("null"):typeof e=="string"?t.ts.factory.createStringLiteral(e):typeof e=="number"?isNaN(e)?t.ts.factory.createIdentifier("NaN"):t.ts.factory.createNumericLiteral(e):e===!0?t.ts.factory.createTrue():e===!1?t.ts.factory.createFalse():e===String?t.ts.factory.createIdentifier("String"):e===Number?t.ts.factory.createIdentifier("Number"):e===Boolean?t.ts.factory.createIdentifier("Boolean"):Array.isArray(e)?Nxe(t,e,r):typeof e=="object"?Txe(t,e,r):t.ts.factory.createIdentifier(e)}function Nxe(t,e,r){let n=e.map(i=>HF(t,i,r));return t.ts.factory.createArrayLiteralExpression(n,!0)}function Txe(t,e,r){if(r.has(e))return t.ts.factory.createIdentifier("undefined");r.add(e);let n=Object.keys(e).map(i=>t.ts.factory.createPropertyAssignment(i,HF(t,e[i],r)));return t.ts.factory.createObjectLiteralExpression(n,!0)}var Da=L(()=>{"use strict";h()});function Tl(t,e,r){let n=[];if(!r)return n;let i=null;if(t.ts.isArrowFunction(r)||t.ts.isFunctionExpression(r)||t.ts.isFunctionDeclaration(r)){let s=r.parameters;if(s.length>0){let o=s[0],a=e.getTypeAtLocation(o);a.aliasTypeArguments&&a.aliasTypeArguments.length>0&&(a=a.aliasTypeArguments[0]),a.flags&t.ts.TypeFlags.Object&&(i=a.getProperties())}}else if(t.ts.isIdentifier(r)){let s=e.getTypeAtLocation(r),o=s.symbol?.valueDeclaration;if(o&&t.ts.isClassDeclaration(o)){let A=o.heritageClauses?.find(c=>c.token===t.ts.SyntaxKind.ExtendsKeyword)?.types;if(A){for(let c of A)if(e.getSymbolAtLocation(c.expression)?.name==="Component"){if(t.ts.isExpressionWithTypeArguments(c)){let l=c.typeArguments;if(l){let d=l[0];i=e.getTypeFromTypeNode(d).getProperties()}}break}}}if(!i){let a=s.getCallSignatures();if(a.length>0){let A=a[0].getParameters();A.length>0&&(i=e.getTypeOfSymbolAtLocation(A[0],r).getProperties())}}}else if(t.ts.isExportSpecifier(r)){let s=e.getSymbolAtLocation(r.name);if(s){let a=e.getTypeOfSymbolAtLocation(s,r).getCallSignatures();if(a.length>0){let A=a[0].getParameters();A.length>0&&(i=e.getTypeOfSymbolAtLocation(A[0],r).getProperties())}}}if(i)for(let s of i){let o=Mxe(t,e,s);o&&n.push(o)}return n=n.filter(hY),n.length>0?n:Pxe(t,r)}function Mxe(t,e,r){let n=r.valueDeclaration,i=r.getName();if(n||(n=r.getDeclarations()?.[0]),n&&t.ts.isPropertySignature(n)){if(i!=="children"&&n.getSourceFile().fileName.includes("node_modules/@types/"))return null;let s="string",o;if(n?.type){let A=e.getTypeFromTypeNode(n.type),c=e.typeToString(A),u=JF(c);u.knownType?s=u.builderType:_xe(c)||A.flags&t.ts.TypeFlags.StringLike?s="string":A.flags&t.ts.TypeFlags.NumberLike?s="number":A.flags&t.ts.TypeFlags.IndexedAccess?s="list":A.flags&t.ts.TypeFlags.Object||A.isUnion()&&A.types.every(l=>l.flags&t.ts.TypeFlags.Object)||A.isIntersection()&&A.types.some(l=>l.flags&t.ts.TypeFlags.Object)?s="object":s="string",c!==s&&(o=c)}let a={name:i,type:s,isRegistered:!1};if(o&&n.type){let A=Kxe(t,e,e.getTypeFromTypeNode(n.type));a.meta=a.meta||{},A&&A.length>0&&a.type==="string"&&A.every(Gxe)?a.enum=A.map(Oxe):a.meta.ts=o}return n.questionToken||(a.required=!0),a}return null}function Pxe(t,e){let r=[],n=t.ts.getJSDocCommentsAndTags(e);for(let i of n)if(!(!t.ts.isJSDoc(i)||!i.tags))for(let s of i.tags){if(!t.ts.isJSDocParameterTag(s)||s.tagName.text!=="param")continue;let a=s.typeExpression?.type;if(!a||!t.ts.isJSDocTypeLiteral(a))continue;let A=a.jsDocPropertyTags;if(A)for(let c of A){if(!t.ts.isJSDocPropertyLikeTag(c))continue;let u=c.name;if(!t.ts.isQualifiedName(u))continue;let l=c.typeExpression;if(!l)continue;let d="";switch(l.type.kind){case t.ts.SyntaxKind.StringKeyword:{d="string";break}case t.ts.SyntaxKind.NumberKeyword:{d="number";break}case t.ts.SyntaxKind.BooleanKeyword:{d="boolean";break}default:continue}let p={name:u.right.text,type:d,isRegistered:!1};r.push(p)}}return r.filter(hY)}function _xe(t){return typeof t!="string"?!1:!!Lxe.some(e=>t.includes(e))}function JF(t){return typeof t=="string"&&(t=t.trim(),Uxe.some(e=>e.value===t))?{builderType:t,knownType:!0}:{builderType:"string",knownType:!1}}function Gxe(t){return/^['"].*['"]$/.test(t)}function Oxe(t){return(t.startsWith('"')||t.startsWith("'"))&&(t.endsWith('"')||t.endsWith("'"))?t.slice(1,-1):t}function hY(t){let e=t?.name;if(typeof e!="string"||e===""||e.startsWith("aria")||e.startsWith("data-"))return!1;if(e.startsWith("on")&&e.length>2){let r=e.charAt(2);if(r.toUpperCase()===r)return!1}return!Jxe.has(e.toLowerCase())}var Lxe,Uxe,Kxe,Hxe,fY,Jxe,lm=L(()=>{"use strict";h();Lxe=["ClassicComponent","FunctionComponent","IntrinsicElements","JSX","ReactNode","ReactElement","ReactPortal"];Uxe=[{value:"boolean",text:"boolean"},{value:"color",text:"color (provides a color in hex or rgb)"},{value:"date",text:"date (same format as the Date constructor)"},{value:"email",text:"email"},{value:"file",text:"file (uploads a file and provides a url)"},{value:"list",text:"list (collection of items)"},{value:"longText",text:"longText (multiline text editor)"},{value:"number",text:"number"},{value:"object",text:"object (set of specific names and values)"},{value:"richText",text:"richText (provides value as html)"},{value:"string",text:"string"}];Kxe=(t,e,r)=>{let n=new Set;fY(t,e,r,n);let i=n.delete("true"),s=n.delete("false");(i||s)&&n.add("boolean");let o=Array.from(n.keys()).sort();if(o.length>1&&(o=o.map(a=>a.indexOf("=>")>=0?`(${a})`:a)),!(o.length>20))return o},Hxe=(t,e,r)=>{let n=t.ts.TypeFormatFlags.InElementType|t.ts.TypeFormatFlags.NoTruncation;return e.typeToString(r,void 0,n)},fY=(t,e,r,n)=>{if(r.isUnion())r.types.forEach(i=>{fY(t,e,i,n)});else if(r.isLiteral()){let i=Hxe(t,e,r);n.add(i)}};Jxe=new Set(["about","accessKey","accessKeyLabel","asChild","autoCapitalize","autoCorrect","autoFocus","autoSave","blur","contentEditable","contextMenu","dangerouslySetInnerHTML","datatype","defaultChecked","defaultValue","dir","draggable","enterKeyHint","focus","form","formAction","formEncType","formMethod","formNoValidate","formTarget","inlist","innerText","inputMode","is","isContentEditable","itemID","itemProp","itemRef","itemScope","itemType","lang","nonce","offsetHeight","offsetLeft","offsetTop","offsetWidth","outerText","prefix","property","radioGroup","rel","resource","results","rev","role","security","slot","spellCheck","suppressContentEditableWarning","suppressHydrationWarning","tabIndex","translate","typeof","unselectable","vocab"].map(t=>t.toLowerCase()))});function Vi(t,e,r){for(let n of r.properties){if(!t.ts.isPropertyAssignment(n))continue;let i=sr(t,n);if(i==="name"&&t.ts.isStringLiteral(n.initializer)){e.name=n.initializer.text;continue}if(i==="description"&&t.ts.isStringLiteral(n.initializer)){e.description=n.initializer.text;continue}if(i==="image"&&t.ts.isStringLiteral(n.initializer)){e.image=n.initializer.text;continue}if(i==="inputs"&&t.ts.isArrayLiteralExpression(n.initializer)){let s=Yxe(t,n.initializer);Es(e,s);continue}if(i==="meta"&&t.ts.isObjectLiteralExpression(n.initializer)){let s=um(t,n.initializer);s&&typeof s=="object"&&(e.meta=s);continue}}return e}function Yxe(t,e){let r=[];for(let n of e.elements)t.ts.isObjectLiteralExpression(n)&&r.push(jxe(t,n));return r}function jxe(t,e){let r=um(t,e),n=Zxe(r);return n.isRegistered=!0,n}function hn(t,e,r){let n=$xe(r);return e=Fp(t,e,"name",n.name,!1),e=Fp(t,e,"description",n.description),e=Fp(t,e,"image",n.image),e=Fp(t,e,"meta",n.meta),e=qxe(t,e,n),eFe(t,e)}function qxe(t,e,r){let n=null,i=e.properties.filter(a=>t.ts.isPropertyAssignment(a)&&t.ts.isIdentifier(a.name)),s=i.findIndex(a=>t.ts.isIdentifier(a.name)&&a.name.text==="inputs"),o=[...r.inputs??[]];if(s>-1){if(o.length===0)return Fp(t,e,"inputs",null);let a=i[s];t.ts.isPropertyAssignment(a)&&t.ts.isArrayLiteralExpression(a.initializer)&&(n=a.initializer)}return o.length===0?e:(n=Wxe(t,n||t.ts.factory.createArrayLiteralExpression(),o),s>-1?i[s]=t.ts.factory.updatePropertyAssignment(i[s],i[s].name,n):i.push(t.ts.factory.createPropertyAssignment("inputs",n)),t.ts.factory.updateObjectLiteralExpression(e,i))}function $xe(t){return{name:t.name,description:t.description,image:t.image,inputs:(t.inputs||[]).filter(r=>r.isRegistered).map(Vxe),...t.meta?{meta:{...t.meta}}:{}}}function Vxe(t){let e={name:t.name,type:t.type};return(Si(t.defaultValue)||nm(t.defaultValue)||Sp(t.defaultValue))&&(e.defaultValue=t.defaultValue),Si(t.friendlyName)&&(e.friendlyName=t.friendlyName),Si(t.helperText)&&(e.helperText=t.helperText),t.required===!0&&(e.required=!0),Array.isArray(t.enum)&&(e.enum=t.enum),t.hideFromUI===!0&&(e.hideFromUI=!0),typeof t.meta=="object"&&t.meta!=null&&Object.keys(t.meta).length>0&&(e.meta=t.meta),e}function Wxe(t,e,r){let n=e.elements.filter(i=>{if(!t.ts.isObjectLiteralExpression(i))return!1;let s=i.properties.find(a=>sr(t,a)==="name");if(!s)return!1;let o=s.initializer;return t.ts.isStringLiteral(o)?r.some(a=>a.name===o.text):!1});for(let i of r)n=zxe(t,n,i);return n.sort((i,s)=>{let o=i.properties.find(d=>sr(t,d)==="name"),a=s.properties.find(d=>sr(t,d)==="name"),A=o?.initializer,c=a?.initializer,u=A&&t.ts.isStringLiteral(A)?A.text:"zz",l=c&&t.ts.isStringLiteral(c)?c.text:"zz";return u.toLowerCase().localeCompare(l.toLowerCase())}),t.ts.factory.updateArrayLiteralExpression(e,n)}function zxe(t,e,r){let n=e.findIndex(i=>i.properties.some(s=>{let o=sr(t,s);return t.ts.isPropertyAssignment(s)&&o==="name"&&t.ts.isStringLiteral(s.initializer)&&s.initializer.text===r.name}));if(n>-1)e[n]=mY(t,e[n],r);else{let i=mY(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("name",t.ts.factory.createStringLiteral(r.name))],!0),r);e.push(i)}return e}function mY(t,e,r){let n=e.properties.filter(s=>t.ts.isPropertyAssignment(s)),i=Object.keys(r).filter(s=>s!=="isRegistered");for(let s of i)n=Xxe(t,n,r,s);return n=tFe(t,n.filter(s=>{let o=sr(t,s);return i.includes(o)})),t.ts.factory.updateObjectLiteralExpression(e,n)}function Xxe(t,e,r,n){let i=e.findIndex(s=>t.ts.isIdentifier(s.name)&&s.name.text===n);return i>-1?e[i]=t.ts.factory.updatePropertyAssignment(e[i],e[i].name,cm(t,r[n])):e.push(t.ts.factory.createPropertyAssignment(n,cm(t,r[n]))),e}function Es(t,e){for(let r of e){let n=t.inputs.findIndex(i=>i.name===r.name);n>-1?(r.isRegistered||!t.inputs[n].isRegistered)&&(t.inputs[n]=r):t.inputs.push(r)}t.acceptsChildren=YF(t)}function Zxe(t){let e=JF(t.type),r={name:t.name.trim(),type:e.builderType};return Si(t.friendlyName)&&t.friendlyName.trim()!==t.name.trim()&&(r.friendlyName=t.friendlyName),(Si(t.defaultValue)||nm(t.defaultValue)||Sp(t.defaultValue))&&(r.defaultValue=t.defaultValue),Si(t.helperText)&&(r.helperText=t.helperText),Sp(t.required)&&(r.required=t.required),typeof t.meta=="object"&&t.meta!=null&&Object.keys(t.meta).length>0&&(r.meta=t.meta),Array.isArray(t.enum)&&t.enum.length>0&&(r.enum=t.enum),t.hideFromUI===!0&&(r.hideFromUI=!0),jF(r)}function YF(t){let e=t.inputs.some(n=>n.name==="children"),r=t.inputs.some(n=>n.meta?.ts==="ReactNode");return!!(e||r||t.acceptsChildren===!0)}function jF(t){if(t.name==="children"&&(t.hideFromUI=!0,delete t.required),t.type==="object"&&t.defaultValue==null&&(t.hideFromUI=!0),t.type==="list"&&t.defaultValue==null&&(t.hideFromUI=!0),t.meta){let e=t.meta.ts;typeof e=="string"&&(e=e.trim(),e.endsWith("ReactNode")&&(e="ReactNode"),t.meta.ts=e,e==="ReactNode"&&(t.hideFromUI=!0))}return t}function eFe(t,e){let r=[...e.properties].sort((n,i)=>{let s=sr(t,n)||"zz",o=sr(t,i)||"zz";if(s==="inputs")return 1;let a=CY.indexOf(s),A=CY.indexOf(o);return a>-1?A>-1&&a>A?1:-1:A>-1?a>-1&&A<a?-1:1:s.localeCompare(o)});return t.ts.factory.updateObjectLiteralExpression(e,r)}function tFe(t,e){return[...e].sort((n,i)=>{let s=sr(t,n)||"zz",o=sr(t,i)||"zz",a=IY.indexOf(s),A=IY.indexOf(o);return a>-1?A>-1&&a>A?1:-1:A>-1?a>-1&&A<a?-1:1:s.localeCompare(o)})}function kp(t,e){for(let r of e.properties){if(!t.ts.isPropertyAssignment(r)||!t.ts.isIdentifier(r.name))continue;if(sr(t,r)==="canHaveChildren"){let{initializer:i}=r;return i.kind===t.ts.SyntaxKind.TrueKeyword}}return!1}var CY,IY,xi=L(()=>{"use strict";h();Da();lm();Qt();CY=["component","name","description"];IY=["name","type"]});function EY(t,e){let r=`Builder.registerComponent(
|
|
85
85
|
`;if(t.appDir)e.acceptsChildren?r+=` withChildren(${e.importName}),
|
|
86
86
|
`:r+=` ${e.importName},
|
|
87
87
|
`;else{let i=e.externalImportPath?e.externalImportPath:Jt(t,t.registryPath,e.filePath);e.exportName==="default"?e.acceptsChildren?r+=` withChildren(dynamic(() => import(${JSON.stringify(i)}))),
|
|
@@ -91,7 +91,7 @@ ${r}=${n}
|
|
|
91
91
|
`}r+=` {
|
|
92
92
|
name: "${e.name}",
|
|
93
93
|
}
|
|
94
|
-
`,r+=");";let n=ey(t,r);return qF(t,n,e)}function qF(t,e,r){if(!t.ts.isExpressionStatement(e))return e;let n=e.expression;if(!t.ts.isCallExpression(n))return e;let i=[...n.arguments];if(i.length<2)return e;r.acceptsChildren?t.ts.isCallExpression(i[0])&&t.ts.isIdentifier(i[0].expression)&&i[0].expression.text==="withChildren"||(i[0]=t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("withChildren"),void 0,[i[0]])):t.ts.isCallExpression(i[0])&&t.ts.isIdentifier(i[0].expression)&&i[0].expression.text==="withChildren"&&(i[0]=i[0].arguments[0]);let s=i[1];return t.ts.isObjectLiteralExpression(s)?(i[1]=hn(t,s,r),t.ts.factory.updateExpressionStatement(e,t.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):e}var B9=L(()=>{"use strict";h();_r();Qt();xi()});function qt(t,e,r,n="esm"){return Array.isArray(r.namedImports)&&r.namedImports.forEach(i=>{e=rFe(t,e,i,r.importPath,!!r.isTypeOnly,n)}),typeof r.defaultImport=="string"&&(e=nFe(t,e,r.defaultImport,r.importPath,n)),e}function rFe(t,e,r,n,i,s){return s==="cjs"?Q9(t,e,null,r,n):y9(t,e,null,r,n,i)}function nFe(t,e,r,n,i){return i==="cjs"?Q9(t,e,r,null,n):y9(t,e,r,null,n,!1)}function y9(t,e,r,n,i,s){let o=[...e.statements],a=0,A=!1,c=!1;for(let g=0;g<o.length;g++){let p=o[g];if(!t.ts.isImportDeclaration(p)||(a=g,!p.moduleSpecifier||!t.ts.isStringLiteral(p.moduleSpecifier))||p.moduleSpecifier.text!==i||!!p.importClause?.isTypeOnly!==s)continue;let f=[],m=p.importClause?.namedBindings;if(m&&t.ts.isNamedImports(m)&&m.elements&&f.push(...m.elements),typeof n=="string"){if(f.some(I=>I.name.text===n))return e;f.push(t.ts.factory.createImportSpecifier(!1,void 0,t.ts.factory.createIdentifier(n))),f.sort((I,B)=>I.name.text.localeCompare(B.name.text)),A=!0}let C=p.importClause?p.importClause.name:void 0;if(typeof r=="string"){if(C&&C.text===r)return e;C=t.ts.factory.createIdentifier(r),c=!0}if(A||c)return o[g]=t.ts.factory.updateImportDeclaration(p,void 0,t.ts.factory.createImportClause(s,C,t.ts.factory.createNamedImports(f)),p.moduleSpecifier,void 0),t.ts.factory.updateSourceFile(e,o)}let u,l;typeof r=="string"&&(u=t.ts.factory.createIdentifier(r)),typeof n=="string"&&(l=t.ts.factory.createNamedImports([t.ts.factory.createImportSpecifier(!1,void 0,t.ts.factory.createIdentifier(n))]));let d=t.ts.factory.createImportDeclaration(void 0,t.ts.factory.createImportClause(s,u,l),t.ts.factory.createStringLiteral(i));return o.splice(a,0,d),t.ts.factory.updateSourceFile(e,o)}function Q9(t,e,r,n,i){let s=[...e.statements],o=0;for(let a=0;a<s.length;a++){let A=s[a];if(t.ts.isVariableStatement(A))for(let c=0;c<A.declarationList.declarations.length;c++){let u=[...A.declarationList.declarations],l=u[c],d=l.initializer;if(!d||!t.ts.isCallExpression(d))continue;let g=d.expression;if(!t.ts.isIdentifier(g)||g.text!=="require"||d.arguments.length!==1)continue;let p=d.arguments[0];if(t.ts.isStringLiteral(p)&&(o=a,p.text===i)){if(t.ts.isIdentifier(l.name)&&typeof r=="string")return l.name.text===r?e:(u[c]=t.ts.factory.updateVariableDeclaration(l,t.ts.factory.createIdentifier(r),l.exclamationToken,l.type,l.initializer),s[a]=t.ts.factory.updateVariableStatement(A,A.modifiers,t.ts.factory.updateVariableDeclarationList(A.declarationList,u)),t.ts.factory.updateSourceFile(e,s));if(t.ts.isObjectBindingPattern(l.name)&&typeof n=="string"){let f=[...l.name.elements];return f.some(C=>!t.ts.isBindingElement(C)||!t.ts.isIdentifier(C.name)?!1:C.name.text===n)?e:(f.push(t.ts.factory.createBindingElement(void 0,void 0,n)),f.sort((C,I)=>!t.ts.isBindingElement(C)||!t.ts.isIdentifier(C.name)||!t.ts.isBindingElement(I)||!t.ts.isIdentifier(I.name)?0:C.name.text.localeCompare(I.name.text)),u[c]=t.ts.factory.updateVariableDeclaration(l,t.ts.factory.createObjectBindingPattern(f),l.exclamationToken,l.type,l.initializer),s[a]=t.ts.factory.updateVariableStatement(A,A.modifiers,t.ts.factory.updateVariableDeclarationList(A.declarationList,u)),t.ts.factory.updateSourceFile(e,s))}}}}if(typeof r=="string"){let a=t.ts.factory.createVariableStatement(void 0,t.ts.factory.createVariableDeclarationList([t.ts.factory.createVariableDeclaration(r,void 0,void 0,t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("require"),void 0,[t.ts.factory.createStringLiteral(i)]))],t.ts.NodeFlags.Const));return s.splice(o,0,a),t.ts.factory.updateSourceFile(e,s)}if(typeof n=="string"){let a=t.ts.factory.createVariableStatement(void 0,t.ts.factory.createVariableDeclarationList([t.ts.factory.createVariableDeclaration(t.ts.factory.createObjectBindingPattern([t.ts.factory.createBindingElement(void 0,void 0,n)]),void 0,void 0,t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("require"),void 0,[t.ts.factory.createStringLiteral(i)]))],t.ts.NodeFlags.Const));return s.splice(o,0,a),t.ts.factory.updateSourceFile(e,s)}return e}var Mo=L(()=>{"use strict";h()});function Ml(t,e,r="esm"){return r==="cjs"?sFe(t,e):iFe(t,e)}function iFe(t,e){let r=[];for(let n of e.statements){if(t.ts.isExportDeclaration(n)){if(n.exportClause&&t.ts.isNamedExports(n.exportClause)){for(let i of n.exportClause.elements)if(n.moduleSpecifier&&r.push({isDefaultExport:!1,statement:n,node:i}),t.ts.isIdentifier(i.name)){let s=i.name.text;for(let o of e.statements)if(t.ts.isVariableStatement(o))for(let a of o.declarationList.declarations)t.ts.isIdentifier(a.name)&&a.name.text===s&&r.push({isDefaultExport:!1,statement:o,node:o});else t.ts.isFunctionDeclaration(o)&&o.name&&o.name.text===s&&r.push({isDefaultExport:!1,statement:o,node:o})}}else!n.exportClause&&n.moduleSpecifier&&r.push({isDefaultExport:!1,statement:n,node:n});continue}if(t.ts.isExportAssignment(n)){let i=n.flags===t.ts.NodeFlags.None,s=n.expression;if(t.ts.isIdentifier(s)){let o=s.text;for(let a of e.statements){if(t.ts.isVariableStatement(a))for(let A of a.declarationList.declarations)t.ts.isIdentifier(A.name)&&A.name.text===o&&r.push({isDefaultExport:i,statement:a,node:a});t.ts.isFunctionDeclaration(a)&&a.name?.text===o&&r.push({isDefaultExport:i,statement:a,node:a})}}else(t.ts.isArrowFunction(s)||t.ts.isCallExpression(s)||t.ts.isFunctionDeclaration(s)||t.ts.isObjectLiteralExpression(s))&&r.push({isDefaultExport:i,statement:n,node:s});continue}if((t.ts.isVariableStatement(n)||t.ts.isFunctionDeclaration(n))&&n.modifiers&&n.modifiers.some(i=>i.kind===t.ts.SyntaxKind.ExportKeyword)){r.push({isDefaultExport:n.modifiers.some(i=>i.kind===t.ts.SyntaxKind.DefaultKeyword),statement:n,node:n});continue}}return r}function sFe(t,e){let r=[];for(let n of e.statements)if(t.ts.isExpressionStatement(n)&&t.ts.isBinaryExpression(n.expression)&&t.ts.isPropertyAccessExpression(n.expression.left)){let i=n.expression.left,s=n.expression.right;if(!t.ts.isIdentifier(i.expression))continue;if(i.expression.text==="module"&&i.name.text==="exports"){if(t.ts.isIdentifier(s)){let o=s.text;for(let a of e.statements)if(t.ts.isVariableStatement(a))for(let A of a.declarationList.declarations)t.ts.isIdentifier(A.name)&&A.name.text===o&&r.push({isDefaultExport:!0,statement:a,node:a});else t.ts.isFunctionDeclaration(a)&&a.name&&a.name.text===o&&r.push({isDefaultExport:!0,statement:a,node:a})}else r.push({isDefaultExport:!0,statement:n,node:s});continue}}return r}var Rp=L(()=>{"use strict";h()});function oFe(t,e,r){for(let n of e.statements)if(t.ts.isImportDeclaration(n)&&n.importClause){if(n.importClause.namedBindings&&t.ts.isNamedImports(n.importClause.namedBindings)){for(let i of n.importClause.namedBindings.elements)if(t.ts.isIdentifier(i.name)&&i.name.text===r&&t.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"named"}}if(n.importClause.name&&n.importClause.name.text===r&&t.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"default"}}return null}async function wa(t,e,r,n){let i=oFe(t,r,n);if(i){let s=await gm(t,t.normalize(t.resolve(t.dirname(e),i.importPath))),o=t.relative(t.getAppRootDir(),s);return{displayFilePath:er(t,s),filePath:s,relFilePath:o,importPath:i.importPath,exportType:i.exportType}}return null}function Np(t,e,r){for(let n=0;n<e.statements.length;n++){let i=e.statements[n];if(t.ts.isVariableStatement(i)){for(let s of i.declarationList.declarations)if(t.ts.isIdentifier(s.name)&&s.name.text===r)return{statement:i,statementIndex:n}}}return null}function An(t,e,r){let n=Np(t,e,r);if(n&&n.statement.declarationList.declarations.length>0){let i=n.statement.declarationList.declarations[0];if(i.initializer&&t.ts.isArrayLiteralExpression(i.initializer))return{statement:n.statement,statementIndex:n.statementIndex,variableDeclaration:i,arrayLiteralExp:i.initializer}}return null}function iy(t,e){if(e){if(aFe(t,e))return!0;let r=!1;if(e.forEachChild(n=>{iy(t,n)&&(r=!0)}),r)return!0}return!1}function aFe(t,e){return t.ts.isJsxElement(e)||t.ts.isJsxOpeningElement(e)||t.ts.isJsxOpeningFragment(e)||t.ts.isJsxSelfClosingElement(e)||t.ts.isJsxFragment(e)||t.ts.isJsxChild(e)}async function gm(t,e){let r=t.extname(e).toLowerCase();if(r===""||!$F.includes(r)){for(let n of $F){let i=e+n;if(await t.exists(i))return i}for(let n of $F){let i=t.join(e,"index"+n);if(await t.exists(i))return i}}return e}var $F,Wi=L(()=>{"use strict";h();Qt();$F=[".tsx",".jsx",".ts",".js"]});function Tp(t,e,r){if(!r||!e)return;let n=e.getSymbolAtLocation(r);if(!n)return;let i=n.valueDeclaration;if(!i)return;let s=i.getSourceFile().fileName,o=AFe(t,s);return o?[{name:o}]:void 0}function AFe(t,e){if(typeof e=="string"){e=t.normalize(No(e));let r=e.split("/"),n=r.lastIndexOf("node_modules");if(n>-1){let i=r.slice(n+1),s=i[0];if(s)return s.startsWith("@")&&i[1]&&(s+="/"+i[1]),s}}}function Hs(t){let e=[];for(let r of t)if(r.dependencies)for(let n of r.dependencies)e.some(i=>i.name===n.name)||e.push({...n});return e.sort((r,n)=>r.name.localeCompare(n.name))}var jc=L(()=>{"use strict";h();Qt()});function D9(t,e,r="esm"){return r==="cjs"?lFe(t,e):uFe(t,e)}function uFe(t,e){let r=[];for(let n of e.statements)if(t.ts.isImportDeclaration(n)&&t.ts.isLiteralExpression(n.moduleSpecifier)){if(!cFe.test(n.moduleSpecifier.text)||n.importClause?.isTypeOnly)continue;if(n.importClause&&n.importClause.namedBindings&&t.ts.isNamedImports(n.importClause.namedBindings))for(let i of n.importClause.namedBindings.elements)i.isTypeOnly||r.push({isDefaultExport:!1,statement:n,node:i.name});n.importClause&&n.importClause.name&&r.push({isDefaultExport:!0,statement:n,node:n.importClause.name})}return r}function lFe(t,e){return[]}var cFe,w9=L(()=>{"use strict";h();cFe=/^(@\w|\w)/});async function Mp(t,e){if(!e.some(o=>!o.isRegistered))return e;let n=await fn(t,e.map(o=>o.filePath)),i=n.getTypeChecker();return await Promise.all(e.map(async o=>{let a=n.getSourceFile(o.filePath);if(a){let c=(await qc(t,i,o.filePath,a,!1)).find(u=>u.cmpInfo.id===o.id);c&&(o.inputs=Tl(t,i,c.node.fnNode))}return o}))}async function Pp(t,e,r,n){if(e.node.fnNode){let{sourceFile:i,typeChecker:s}=await xp(t,e.cmpInfo.filePath,r),a=(await qc(t,s,e.cmpInfo.filePath,i,n)).find(A=>A.cmpInfo.id===e.cmpInfo.id);if(!a)throw new Error(`createComponentInputs() Could not find component ${e.cmpInfo.name} in ${e.cmpInfo.filePath}`);return Tl(t,s,a.node.fnNode)}return[]}async function S9(t,e,r){let n=t.extname(e).toLowerCase();if(n===".tsx"||n===".jsx"||n===".ts"||n===".js"){let i=await t.readFile(e);if(i)return gFe(t,e,i,r)}return null}function gFe(t,e,r,n=!1){let i=Ht(t,r);return qc(t,null,e,i,n)}async function qc(t,e,r,n,i){let s=[];for(let a of n.statements)if(t.ts.isExpressionStatement(a)&&t.ts.isStringLiteral(a.expression)&&a.expression.text==="use server")return s;let o=Ml(t,n);return i&&o.push(...D9(t,n)),r=t.normalize(r),await Promise.all(o.map(async a=>{let A=await pFe(t,e,r,a);s.push(...A)})),s}async function pFe(t,e,r,n){let i=[],s=t.relative(t.getAppRootDir(),r),o=fr(t,r);if(t.ts.isVariableStatement(n.node)){for(let a of n.node.declarationList.declarations){if(!t.ts.isIdentifier(a.name)||!vp(a.name.text))continue;let A=kA(t,e,a.initializer);if(A){let c=A.name||a.name.text,u=n.isDefaultExport?"default":c,l=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await ur(t,r,u),displayFilePath:er(t,r),name:dr(c),inputs:[],exportName:u,exportType:l,importName:c,filePath:r,relFilePath:s,importPath:o,dependencies:A.deps,framework:"react"},node:A})}}return i}if(t.ts.isArrowFunction(n.node)){let a=kA(t,e,n.node);if(a){let A=Us(t,r),c=n.isDefaultExport?"default":A,u=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await ur(t,r,c),displayFilePath:er(t,r),name:A,inputs:[],exportName:c,exportType:u,importName:xl(t,r),filePath:r,relFilePath:s,importPath:o,dependencies:a.deps,framework:"react"},node:a})}return i}if(t.ts.isFunctionExpression(n.node)||t.ts.isFunctionDeclaration(n.node)){let a=n.node.name?.text;if(a&&!vp(a))return i;let A=kA(t,e,n.node);if(A){let c=A.name||Us(t,r),u=n.isDefaultExport||!A.name?"default":A.name,l=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await ur(t,r,u),displayFilePath:er(t,r),name:c,inputs:[],exportName:u,exportType:l,importName:A.name||xl(t,r),filePath:r,relFilePath:s,importPath:o,dependencies:A.deps,framework:"react"},node:A})}return i}if((t.ts.isExportSpecifier(n.node)||t.ts.isIdentifier(n.node))&&vp(n.node.getText())){let a,A=kA(t,e,n.node);if(A){let c=A.name||Us(t,r),u=n.isDefaultExport||!A.name?"default":A.name,l=n.isDefaultExport?"default":"named",d=dFe(t,n.node)?.moduleSpecifier??fFe(t,n.node)?.moduleSpecifier;if(d&&t.ts.isStringLiteral(d)){let g=e?.getSymbolAtLocation(d);if(g&&g.declarations&&g.declarations.length>0){let p=g.declarations[0];(!t.ts.isSourceFile(p)||t.ts.isSourceFile(p)&&p.fileName.includes("node_modules"))&&(a=d.text)}}i.push({cmpInfo:{id:await ur(t,r,u,a),displayFilePath:er(t,r),name:c,inputs:[],exportName:u,exportType:l,importName:A.name||xl(t,r),filePath:r,relFilePath:s,importPath:a||o,externalImportPath:a,dependencies:A.deps,framework:"react"},node:A})}return i}if(t.ts.isExportDeclaration(n.node)&&n.node.exportClause===void 0){let a=n.node.moduleSpecifier;if(a&&t.ts.isStringLiteral(a)){let A=await mFe(t,e,r,a);i.push(...A)}return i}return i}function dFe(t,e){for(;e;){if(t.ts.isExportDeclaration(e))return e;e=e.parent}return null}function fFe(t,e){for(;e;){if(t.ts.isImportDeclaration(e))return e;e=e.parent}return null}function kA(t,e,r){if(!r)return null;if(t.ts.isArrowFunction(r))return iy(t,r.body)?{name:"",fnNode:r,deps:Tp(t,e,r)}:null;if(t.ts.isFunctionExpression(r)||t.ts.isFunctionDeclaration(r))return iy(t,r.body)?{name:r.name?.text||"",fnNode:r,deps:Tp(t,e,r)}:null;if(t.ts.isCallExpression(r)){let n=r.expression;if(t.ts.isPropertyAccessExpression(n)){let i=r.arguments;if(i.length===0)return null;let s=n.expression;if(!t.ts.isIdentifier(s)||s.text!=="React")return null;let o=n.name;return!t.ts.isIdentifier(o)||o.text!=="forwardRef"?null:kA(t,e,i[0])}else if(t.ts.isIdentifier(n)&&(n.text==="observer"||n.text==="forwardRef")){let i=r.arguments;return i.length===0?null:kA(t,e,i[0])}return null}if(!e)return null;if(t.ts.isPropertyAccessExpression(r)){let n=r.expression,i=r.name;if(!t.ts.isIdentifier(n)||!t.ts.isIdentifier(i)||!vp(i.text))return null;let o=e.getTypeAtLocation(i).getCallSignatures();if(o.length>0&&o[0].getParameters().length>0)return{name:"",fnNode:i,deps:Tp(t,e,i)}}if(t.ts.isExportSpecifier(r)){let n=r.name;return{name:n.text||"",fnNode:n,deps:Tp(t,e,n)}}if(t.ts.isIdentifier(r))return{name:r.text||"",fnNode:r,deps:Tp(t,e,r)};if(t.ts.isExpressionStatement(r)){let n=r.expression;if(t.ts.isAsExpression(n)&&t.ts.isIdentifier(n.type)&&n.type.text==="default")return kA(t,e,n.expression)}if(t.ts.isVariableStatement(r)){for(let n of r.declarationList.declarations)if(n.initializer&&t.ts.isAsExpression(n.initializer)){let i=n.initializer;if(t.ts.isIdentifier(i.type)&&i.type.text==="default"){let s=kA(t,e,i.expression);if(s&&t.ts.isIdentifier(n.name))return{name:n.name.text,fnNode:s.fnNode,deps:s.deps}}}}return null}async function v9(t,e){let r=[],n=e.getSourceFiles(),i=e.getTypeChecker();return await Promise.all(n.map(async s=>{let o=t.normalize(s.fileName);if(ty(t,hFe,s.fileName)||o===t.reactConfigPath||o===t.builderComponentPath)return;let a=await qc(t,i,o,s,o===t.registryPath);r.push(...a)})),r.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}async function mFe(t,e,r,n){let i=[],s=n.text;if(!e)return i;try{let o=e.getSymbolAtLocation(n);if(!o)return i;let a=e.getExportsOfModule(o);for(let A of a){let c=A.valueDeclaration||A.declarations?.[0];if(!c)continue;let u=A.name;if(!vp(u)&&u!=="default"||!x9(t,e,c))continue;let l=kA(t,e,c);if(l){let d=A.name,g=d==="default"?"default":"named",p=dr(d),f=d==="default"?xl(t,r):d;i.push({cmpInfo:{id:await ur(t,r,d,s),displayFilePath:er(t,r),name:p,inputs:[],exportName:d,exportType:g,importName:f,filePath:r,relFilePath:t.relative(t.getAppRootDir(),r),importPath:s,externalImportPath:s,dependencies:l.deps,framework:"react"},node:l})}}}catch(o){t.Sentry?.captureException(new Error(`Error processing module ${s}:`,{cause:o}),{extra:{modulePath:s,filePath:r}})}return i}function x9(t,e,r){if(t.ts.isInterfaceDeclaration(r)||t.ts.isTypeAliasDeclaration(r))return!1;if(t.ts.isExportSpecifier(r)){let n=e.getSymbolAtLocation(r.name);if(n){let s=e.getAliasedSymbol(n).declarations?.[0];if(s)return x9(t,e,s)}return!1}if(t.ts.isFunctionDeclaration(r)||t.ts.isArrowFunction(r)||t.ts.isFunctionExpression(r)){let n=e.getSignatureFromDeclaration(r);if(n){let i=e.getReturnTypeOfSignature(n);return b9(i,e)}}return t.ts.isClassDeclaration(r)?r.heritageClauses?.some(i=>i.types.some(s=>s.expression.getText()==="React.Component"||s.expression.getText()==="Component"))??!1:t.ts.isVariableDeclaration(r)?e.getTypeAtLocation(r).getCallSignatures().some(s=>b9(e.getReturnTypeOfSignature(s),e)):!1}function b9(t,e){let r=e.typeToString(t);return r==="JSX.Element"||r==="Element"||r.includes("ReactElement")||r.includes("React.ReactElement")||r.includes("ReactNode")}var hFe,$c=L(()=>{"use strict";h();_r();Qt();Rp();Wi();Gs();lm();jc();w9();hFe=new Set(["node_modules","dist"])});async function F9(t,e){let r=[],n=e.getSourceFiles(),i=e.getTypeChecker();return await Promise.all(n.map(async s=>{let o=t.basename(s.fileName);if(t.appDir&&CFe.has(o)||t.dirname(s.fileName).includes("node_modules"))return;let a=t.normalize(s.fileName);if(a===t.nextConfigPath||a===t.builderComponentPath)return;let A=await qc(t,i,a,s,a===t.registryPath||_s(a));r.push(...A)})),r.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var CFe,k9=L(()=>{"use strict";h();$c();Qt();CFe=new Set(["default.tsx","default.ts","default.jsx","default.js","error.tsx","error.ts","error.jsx","error.js","layout.tsx","layout.ts","layout.jsx","layout.js","loading.tsx","loading.ts","loading.jsx","loading.js","not-found.tsx","not-found.ts","not-found.jsx","not-found.js","page.tsx","page.ts","page.jsx","page.js","route.tsx","route.ts","route.jsx","route.js","template.tsx","template.ts","template.jsx","template.js"])});function ba(t,e){let r=[],n=[],i=[],s=[];for(let o of e.statements){if(t.ts.isImportDeclaration(o)){if(t.ts.isStringLiteral(o.moduleSpecifier)){let A=o.moduleSpecifier.text;if(!A.startsWith(".")&&!A.startsWith("/")){r.push(o);continue}}let a=o.importClause;if(a){if(a.namedBindings){n.push(o);continue}if(a.name){n.push(o);continue}}i.push(o);continue}s.push(o)}return t.ts.factory.updateSourceFile(e,[...VF(t,r),...VF(t,n),...VF(t,i),...s])}function Po(t){let e=t.split(`
|
|
94
|
+
`,r+=");";let n=ey(t,r);return qF(t,n,e)}function qF(t,e,r){if(!t.ts.isExpressionStatement(e))return e;let n=e.expression;if(!t.ts.isCallExpression(n))return e;let i=[...n.arguments];if(i.length<2)return e;r.acceptsChildren?t.ts.isCallExpression(i[0])&&t.ts.isIdentifier(i[0].expression)&&i[0].expression.text==="withChildren"||(i[0]=t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("withChildren"),void 0,[i[0]])):t.ts.isCallExpression(i[0])&&t.ts.isIdentifier(i[0].expression)&&i[0].expression.text==="withChildren"&&(i[0]=i[0].arguments[0]);let s=i[1];return t.ts.isObjectLiteralExpression(s)?(i[1]=hn(t,s,r),t.ts.factory.updateExpressionStatement(e,t.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):e}var BY=L(()=>{"use strict";h();_r();Qt();xi()});function qt(t,e,r,n="esm"){return Array.isArray(r.namedImports)&&r.namedImports.forEach(i=>{e=rFe(t,e,i,r.importPath,!!r.isTypeOnly,n)}),typeof r.defaultImport=="string"&&(e=nFe(t,e,r.defaultImport,r.importPath,n)),e}function rFe(t,e,r,n,i,s){return s==="cjs"?QY(t,e,null,r,n):yY(t,e,null,r,n,i)}function nFe(t,e,r,n,i){return i==="cjs"?QY(t,e,r,null,n):yY(t,e,r,null,n,!1)}function yY(t,e,r,n,i,s){let o=[...e.statements],a=0,A=!1,c=!1;for(let g=0;g<o.length;g++){let p=o[g];if(!t.ts.isImportDeclaration(p)||(a=g,!p.moduleSpecifier||!t.ts.isStringLiteral(p.moduleSpecifier))||p.moduleSpecifier.text!==i||!!p.importClause?.isTypeOnly!==s)continue;let f=[],m=p.importClause?.namedBindings;if(m&&t.ts.isNamedImports(m)&&m.elements&&f.push(...m.elements),typeof n=="string"){if(f.some(I=>I.name.text===n))return e;f.push(t.ts.factory.createImportSpecifier(!1,void 0,t.ts.factory.createIdentifier(n))),f.sort((I,B)=>I.name.text.localeCompare(B.name.text)),A=!0}let C=p.importClause?p.importClause.name:void 0;if(typeof r=="string"){if(C&&C.text===r)return e;C=t.ts.factory.createIdentifier(r),c=!0}if(A||c)return o[g]=t.ts.factory.updateImportDeclaration(p,void 0,t.ts.factory.createImportClause(s,C,t.ts.factory.createNamedImports(f)),p.moduleSpecifier,void 0),t.ts.factory.updateSourceFile(e,o)}let u,l;typeof r=="string"&&(u=t.ts.factory.createIdentifier(r)),typeof n=="string"&&(l=t.ts.factory.createNamedImports([t.ts.factory.createImportSpecifier(!1,void 0,t.ts.factory.createIdentifier(n))]));let d=t.ts.factory.createImportDeclaration(void 0,t.ts.factory.createImportClause(s,u,l),t.ts.factory.createStringLiteral(i));return o.splice(a,0,d),t.ts.factory.updateSourceFile(e,o)}function QY(t,e,r,n,i){let s=[...e.statements],o=0;for(let a=0;a<s.length;a++){let A=s[a];if(t.ts.isVariableStatement(A))for(let c=0;c<A.declarationList.declarations.length;c++){let u=[...A.declarationList.declarations],l=u[c],d=l.initializer;if(!d||!t.ts.isCallExpression(d))continue;let g=d.expression;if(!t.ts.isIdentifier(g)||g.text!=="require"||d.arguments.length!==1)continue;let p=d.arguments[0];if(t.ts.isStringLiteral(p)&&(o=a,p.text===i)){if(t.ts.isIdentifier(l.name)&&typeof r=="string")return l.name.text===r?e:(u[c]=t.ts.factory.updateVariableDeclaration(l,t.ts.factory.createIdentifier(r),l.exclamationToken,l.type,l.initializer),s[a]=t.ts.factory.updateVariableStatement(A,A.modifiers,t.ts.factory.updateVariableDeclarationList(A.declarationList,u)),t.ts.factory.updateSourceFile(e,s));if(t.ts.isObjectBindingPattern(l.name)&&typeof n=="string"){let f=[...l.name.elements];return f.some(C=>!t.ts.isBindingElement(C)||!t.ts.isIdentifier(C.name)?!1:C.name.text===n)?e:(f.push(t.ts.factory.createBindingElement(void 0,void 0,n)),f.sort((C,I)=>!t.ts.isBindingElement(C)||!t.ts.isIdentifier(C.name)||!t.ts.isBindingElement(I)||!t.ts.isIdentifier(I.name)?0:C.name.text.localeCompare(I.name.text)),u[c]=t.ts.factory.updateVariableDeclaration(l,t.ts.factory.createObjectBindingPattern(f),l.exclamationToken,l.type,l.initializer),s[a]=t.ts.factory.updateVariableStatement(A,A.modifiers,t.ts.factory.updateVariableDeclarationList(A.declarationList,u)),t.ts.factory.updateSourceFile(e,s))}}}}if(typeof r=="string"){let a=t.ts.factory.createVariableStatement(void 0,t.ts.factory.createVariableDeclarationList([t.ts.factory.createVariableDeclaration(r,void 0,void 0,t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("require"),void 0,[t.ts.factory.createStringLiteral(i)]))],t.ts.NodeFlags.Const));return s.splice(o,0,a),t.ts.factory.updateSourceFile(e,s)}if(typeof n=="string"){let a=t.ts.factory.createVariableStatement(void 0,t.ts.factory.createVariableDeclarationList([t.ts.factory.createVariableDeclaration(t.ts.factory.createObjectBindingPattern([t.ts.factory.createBindingElement(void 0,void 0,n)]),void 0,void 0,t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("require"),void 0,[t.ts.factory.createStringLiteral(i)]))],t.ts.NodeFlags.Const));return s.splice(o,0,a),t.ts.factory.updateSourceFile(e,s)}return e}var Mo=L(()=>{"use strict";h()});function Ml(t,e,r="esm"){return r==="cjs"?sFe(t,e):iFe(t,e)}function iFe(t,e){let r=[];for(let n of e.statements){if(t.ts.isExportDeclaration(n)){if(n.exportClause&&t.ts.isNamedExports(n.exportClause)){for(let i of n.exportClause.elements)if(n.moduleSpecifier&&r.push({isDefaultExport:!1,statement:n,node:i}),t.ts.isIdentifier(i.name)){let s=i.name.text;for(let o of e.statements)if(t.ts.isVariableStatement(o))for(let a of o.declarationList.declarations)t.ts.isIdentifier(a.name)&&a.name.text===s&&r.push({isDefaultExport:!1,statement:o,node:o});else t.ts.isFunctionDeclaration(o)&&o.name&&o.name.text===s&&r.push({isDefaultExport:!1,statement:o,node:o})}}else!n.exportClause&&n.moduleSpecifier&&r.push({isDefaultExport:!1,statement:n,node:n});continue}if(t.ts.isExportAssignment(n)){let i=n.flags===t.ts.NodeFlags.None,s=n.expression;if(t.ts.isIdentifier(s)){let o=s.text;for(let a of e.statements){if(t.ts.isVariableStatement(a))for(let A of a.declarationList.declarations)t.ts.isIdentifier(A.name)&&A.name.text===o&&r.push({isDefaultExport:i,statement:a,node:a});t.ts.isFunctionDeclaration(a)&&a.name?.text===o&&r.push({isDefaultExport:i,statement:a,node:a})}}else(t.ts.isArrowFunction(s)||t.ts.isCallExpression(s)||t.ts.isFunctionDeclaration(s)||t.ts.isObjectLiteralExpression(s))&&r.push({isDefaultExport:i,statement:n,node:s});continue}if((t.ts.isVariableStatement(n)||t.ts.isFunctionDeclaration(n))&&n.modifiers&&n.modifiers.some(i=>i.kind===t.ts.SyntaxKind.ExportKeyword)){r.push({isDefaultExport:n.modifiers.some(i=>i.kind===t.ts.SyntaxKind.DefaultKeyword),statement:n,node:n});continue}}return r}function sFe(t,e){let r=[];for(let n of e.statements)if(t.ts.isExpressionStatement(n)&&t.ts.isBinaryExpression(n.expression)&&t.ts.isPropertyAccessExpression(n.expression.left)){let i=n.expression.left,s=n.expression.right;if(!t.ts.isIdentifier(i.expression))continue;if(i.expression.text==="module"&&i.name.text==="exports"){if(t.ts.isIdentifier(s)){let o=s.text;for(let a of e.statements)if(t.ts.isVariableStatement(a))for(let A of a.declarationList.declarations)t.ts.isIdentifier(A.name)&&A.name.text===o&&r.push({isDefaultExport:!0,statement:a,node:a});else t.ts.isFunctionDeclaration(a)&&a.name&&a.name.text===o&&r.push({isDefaultExport:!0,statement:a,node:a})}else r.push({isDefaultExport:!0,statement:n,node:s});continue}}return r}var Rp=L(()=>{"use strict";h()});function oFe(t,e,r){for(let n of e.statements)if(t.ts.isImportDeclaration(n)&&n.importClause){if(n.importClause.namedBindings&&t.ts.isNamedImports(n.importClause.namedBindings)){for(let i of n.importClause.namedBindings.elements)if(t.ts.isIdentifier(i.name)&&i.name.text===r&&t.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"named"}}if(n.importClause.name&&n.importClause.name.text===r&&t.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"default"}}return null}async function wa(t,e,r,n){let i=oFe(t,r,n);if(i){let s=await gm(t,t.normalize(t.resolve(t.dirname(e),i.importPath))),o=t.relative(t.getAppRootDir(),s);return{displayFilePath:er(t,s),filePath:s,relFilePath:o,importPath:i.importPath,exportType:i.exportType}}return null}function Np(t,e,r){for(let n=0;n<e.statements.length;n++){let i=e.statements[n];if(t.ts.isVariableStatement(i)){for(let s of i.declarationList.declarations)if(t.ts.isIdentifier(s.name)&&s.name.text===r)return{statement:i,statementIndex:n}}}return null}function An(t,e,r){let n=Np(t,e,r);if(n&&n.statement.declarationList.declarations.length>0){let i=n.statement.declarationList.declarations[0];if(i.initializer&&t.ts.isArrayLiteralExpression(i.initializer))return{statement:n.statement,statementIndex:n.statementIndex,variableDeclaration:i,arrayLiteralExp:i.initializer}}return null}function iy(t,e){if(e){if(aFe(t,e))return!0;let r=!1;if(e.forEachChild(n=>{iy(t,n)&&(r=!0)}),r)return!0}return!1}function aFe(t,e){return t.ts.isJsxElement(e)||t.ts.isJsxOpeningElement(e)||t.ts.isJsxOpeningFragment(e)||t.ts.isJsxSelfClosingElement(e)||t.ts.isJsxFragment(e)||t.ts.isJsxChild(e)}async function gm(t,e){let r=t.extname(e).toLowerCase();if(r===""||!$F.includes(r)){for(let n of $F){let i=e+n;if(await t.exists(i))return i}for(let n of $F){let i=t.join(e,"index"+n);if(await t.exists(i))return i}}return e}var $F,Wi=L(()=>{"use strict";h();Qt();$F=[".tsx",".jsx",".ts",".js"]});function Tp(t,e,r){if(!r||!e)return;let n=e.getSymbolAtLocation(r);if(!n)return;let i=n.valueDeclaration;if(!i)return;let s=i.getSourceFile().fileName,o=AFe(t,s);return o?[{name:o}]:void 0}function AFe(t,e){if(typeof e=="string"){e=t.normalize(No(e));let r=e.split("/"),n=r.lastIndexOf("node_modules");if(n>-1){let i=r.slice(n+1),s=i[0];if(s)return s.startsWith("@")&&i[1]&&(s+="/"+i[1]),s}}}function Hs(t){let e=[];for(let r of t)if(r.dependencies)for(let n of r.dependencies)e.some(i=>i.name===n.name)||e.push({...n});return e.sort((r,n)=>r.name.localeCompare(n.name))}var jc=L(()=>{"use strict";h();Qt()});function DY(t,e,r="esm"){return r==="cjs"?lFe(t,e):uFe(t,e)}function uFe(t,e){let r=[];for(let n of e.statements)if(t.ts.isImportDeclaration(n)&&t.ts.isLiteralExpression(n.moduleSpecifier)){if(!cFe.test(n.moduleSpecifier.text)||n.importClause?.isTypeOnly)continue;if(n.importClause&&n.importClause.namedBindings&&t.ts.isNamedImports(n.importClause.namedBindings))for(let i of n.importClause.namedBindings.elements)i.isTypeOnly||r.push({isDefaultExport:!1,statement:n,node:i.name});n.importClause&&n.importClause.name&&r.push({isDefaultExport:!0,statement:n,node:n.importClause.name})}return r}function lFe(t,e){return[]}var cFe,wY=L(()=>{"use strict";h();cFe=/^(@\w|\w)/});async function Mp(t,e){if(!e.some(o=>!o.isRegistered))return e;let n=await fn(t,e.map(o=>o.filePath)),i=n.getTypeChecker();return await Promise.all(e.map(async o=>{let a=n.getSourceFile(o.filePath);if(a){let c=(await qc(t,i,o.filePath,a,!1)).find(u=>u.cmpInfo.id===o.id);c&&(o.inputs=Tl(t,i,c.node.fnNode))}return o}))}async function Pp(t,e,r,n){if(e.node.fnNode){let{sourceFile:i,typeChecker:s}=await xp(t,e.cmpInfo.filePath,r),a=(await qc(t,s,e.cmpInfo.filePath,i,n)).find(A=>A.cmpInfo.id===e.cmpInfo.id);if(!a)throw new Error(`createComponentInputs() Could not find component ${e.cmpInfo.name} in ${e.cmpInfo.filePath}`);return Tl(t,s,a.node.fnNode)}return[]}async function SY(t,e,r){let n=t.extname(e).toLowerCase();if(n===".tsx"||n===".jsx"||n===".ts"||n===".js"){let i=await t.readFile(e);if(i)return gFe(t,e,i,r)}return null}function gFe(t,e,r,n=!1){let i=Ht(t,r);return qc(t,null,e,i,n)}async function qc(t,e,r,n,i){let s=[];for(let a of n.statements)if(t.ts.isExpressionStatement(a)&&t.ts.isStringLiteral(a.expression)&&a.expression.text==="use server")return s;let o=Ml(t,n);return i&&o.push(...DY(t,n)),r=t.normalize(r),await Promise.all(o.map(async a=>{let A=await pFe(t,e,r,a);s.push(...A)})),s}async function pFe(t,e,r,n){let i=[],s=t.relative(t.getAppRootDir(),r),o=fr(t,r);if(t.ts.isVariableStatement(n.node)){for(let a of n.node.declarationList.declarations){if(!t.ts.isIdentifier(a.name)||!vp(a.name.text))continue;let A=kA(t,e,a.initializer);if(A){let c=A.name||a.name.text,u=n.isDefaultExport?"default":c,l=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await ur(t,r,u),displayFilePath:er(t,r),name:dr(c),inputs:[],exportName:u,exportType:l,importName:c,filePath:r,relFilePath:s,importPath:o,dependencies:A.deps,framework:"react"},node:A})}}return i}if(t.ts.isArrowFunction(n.node)){let a=kA(t,e,n.node);if(a){let A=Us(t,r),c=n.isDefaultExport?"default":A,u=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await ur(t,r,c),displayFilePath:er(t,r),name:A,inputs:[],exportName:c,exportType:u,importName:xl(t,r),filePath:r,relFilePath:s,importPath:o,dependencies:a.deps,framework:"react"},node:a})}return i}if(t.ts.isFunctionExpression(n.node)||t.ts.isFunctionDeclaration(n.node)){let a=n.node.name?.text;if(a&&!vp(a))return i;let A=kA(t,e,n.node);if(A){let c=A.name||Us(t,r),u=n.isDefaultExport||!A.name?"default":A.name,l=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await ur(t,r,u),displayFilePath:er(t,r),name:c,inputs:[],exportName:u,exportType:l,importName:A.name||xl(t,r),filePath:r,relFilePath:s,importPath:o,dependencies:A.deps,framework:"react"},node:A})}return i}if((t.ts.isExportSpecifier(n.node)||t.ts.isIdentifier(n.node))&&vp(n.node.getText())){let a,A=kA(t,e,n.node);if(A){let c=A.name||Us(t,r),u=n.isDefaultExport||!A.name?"default":A.name,l=n.isDefaultExport?"default":"named",d=dFe(t,n.node)?.moduleSpecifier??fFe(t,n.node)?.moduleSpecifier;if(d&&t.ts.isStringLiteral(d)){let g=e?.getSymbolAtLocation(d);if(g&&g.declarations&&g.declarations.length>0){let p=g.declarations[0];(!t.ts.isSourceFile(p)||t.ts.isSourceFile(p)&&p.fileName.includes("node_modules"))&&(a=d.text)}}i.push({cmpInfo:{id:await ur(t,r,u,a),displayFilePath:er(t,r),name:c,inputs:[],exportName:u,exportType:l,importName:A.name||xl(t,r),filePath:r,relFilePath:s,importPath:a||o,externalImportPath:a,dependencies:A.deps,framework:"react"},node:A})}return i}if(t.ts.isExportDeclaration(n.node)&&n.node.exportClause===void 0){let a=n.node.moduleSpecifier;if(a&&t.ts.isStringLiteral(a)){let A=await mFe(t,e,r,a);i.push(...A)}return i}return i}function dFe(t,e){for(;e;){if(t.ts.isExportDeclaration(e))return e;e=e.parent}return null}function fFe(t,e){for(;e;){if(t.ts.isImportDeclaration(e))return e;e=e.parent}return null}function kA(t,e,r){if(!r)return null;if(t.ts.isArrowFunction(r))return iy(t,r.body)?{name:"",fnNode:r,deps:Tp(t,e,r)}:null;if(t.ts.isFunctionExpression(r)||t.ts.isFunctionDeclaration(r))return iy(t,r.body)?{name:r.name?.text||"",fnNode:r,deps:Tp(t,e,r)}:null;if(t.ts.isCallExpression(r)){let n=r.expression;if(t.ts.isPropertyAccessExpression(n)){let i=r.arguments;if(i.length===0)return null;let s=n.expression;if(!t.ts.isIdentifier(s)||s.text!=="React")return null;let o=n.name;return!t.ts.isIdentifier(o)||o.text!=="forwardRef"?null:kA(t,e,i[0])}else if(t.ts.isIdentifier(n)&&(n.text==="observer"||n.text==="forwardRef")){let i=r.arguments;return i.length===0?null:kA(t,e,i[0])}return null}if(!e)return null;if(t.ts.isPropertyAccessExpression(r)){let n=r.expression,i=r.name;if(!t.ts.isIdentifier(n)||!t.ts.isIdentifier(i)||!vp(i.text))return null;let o=e.getTypeAtLocation(i).getCallSignatures();if(o.length>0&&o[0].getParameters().length>0)return{name:"",fnNode:i,deps:Tp(t,e,i)}}if(t.ts.isExportSpecifier(r)){let n=r.name;return{name:n.text||"",fnNode:n,deps:Tp(t,e,n)}}if(t.ts.isIdentifier(r))return{name:r.text||"",fnNode:r,deps:Tp(t,e,r)};if(t.ts.isExpressionStatement(r)){let n=r.expression;if(t.ts.isAsExpression(n)&&t.ts.isIdentifier(n.type)&&n.type.text==="default")return kA(t,e,n.expression)}if(t.ts.isVariableStatement(r)){for(let n of r.declarationList.declarations)if(n.initializer&&t.ts.isAsExpression(n.initializer)){let i=n.initializer;if(t.ts.isIdentifier(i.type)&&i.type.text==="default"){let s=kA(t,e,i.expression);if(s&&t.ts.isIdentifier(n.name))return{name:n.name.text,fnNode:s.fnNode,deps:s.deps}}}}return null}async function vY(t,e){let r=[],n=e.getSourceFiles(),i=e.getTypeChecker();return await Promise.all(n.map(async s=>{let o=t.normalize(s.fileName);if(ty(t,hFe,s.fileName)||o===t.reactConfigPath||o===t.builderComponentPath)return;let a=await qc(t,i,o,s,o===t.registryPath);r.push(...a)})),r.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}async function mFe(t,e,r,n){let i=[],s=n.text;if(!e)return i;try{let o=e.getSymbolAtLocation(n);if(!o)return i;let a=e.getExportsOfModule(o);for(let A of a){let c=A.valueDeclaration||A.declarations?.[0];if(!c)continue;let u=A.name;if(!vp(u)&&u!=="default"||!xY(t,e,c))continue;let l=kA(t,e,c);if(l){let d=A.name,g=d==="default"?"default":"named",p=dr(d),f=d==="default"?xl(t,r):d;i.push({cmpInfo:{id:await ur(t,r,d,s),displayFilePath:er(t,r),name:p,inputs:[],exportName:d,exportType:g,importName:f,filePath:r,relFilePath:t.relative(t.getAppRootDir(),r),importPath:s,externalImportPath:s,dependencies:l.deps,framework:"react"},node:l})}}}catch(o){t.Sentry?.captureException(new Error(`Error processing module ${s}:`,{cause:o}),{extra:{modulePath:s,filePath:r}})}return i}function xY(t,e,r){if(t.ts.isInterfaceDeclaration(r)||t.ts.isTypeAliasDeclaration(r))return!1;if(t.ts.isExportSpecifier(r)){let n=e.getSymbolAtLocation(r.name);if(n){let s=e.getAliasedSymbol(n).declarations?.[0];if(s)return xY(t,e,s)}return!1}if(t.ts.isFunctionDeclaration(r)||t.ts.isArrowFunction(r)||t.ts.isFunctionExpression(r)){let n=e.getSignatureFromDeclaration(r);if(n){let i=e.getReturnTypeOfSignature(n);return bY(i,e)}}return t.ts.isClassDeclaration(r)?r.heritageClauses?.some(i=>i.types.some(s=>s.expression.getText()==="React.Component"||s.expression.getText()==="Component"))??!1:t.ts.isVariableDeclaration(r)?e.getTypeAtLocation(r).getCallSignatures().some(s=>bY(e.getReturnTypeOfSignature(s),e)):!1}function bY(t,e){let r=e.typeToString(t);return r==="JSX.Element"||r==="Element"||r.includes("ReactElement")||r.includes("React.ReactElement")||r.includes("ReactNode")}var hFe,$c=L(()=>{"use strict";h();_r();Qt();Rp();Wi();Gs();lm();jc();wY();hFe=new Set(["node_modules","dist"])});async function FY(t,e){let r=[],n=e.getSourceFiles(),i=e.getTypeChecker();return await Promise.all(n.map(async s=>{let o=t.basename(s.fileName);if(t.appDir&&CFe.has(o)||t.dirname(s.fileName).includes("node_modules"))return;let a=t.normalize(s.fileName);if(a===t.nextConfigPath||a===t.builderComponentPath)return;let A=await qc(t,i,a,s,a===t.registryPath||_s(a));r.push(...A)})),r.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var CFe,kY=L(()=>{"use strict";h();$c();Qt();CFe=new Set(["default.tsx","default.ts","default.jsx","default.js","error.tsx","error.ts","error.jsx","error.js","layout.tsx","layout.ts","layout.jsx","layout.js","loading.tsx","loading.ts","loading.jsx","loading.js","not-found.tsx","not-found.ts","not-found.jsx","not-found.js","page.tsx","page.ts","page.jsx","page.js","route.tsx","route.ts","route.jsx","route.js","template.tsx","template.ts","template.jsx","template.js"])});function ba(t,e){let r=[],n=[],i=[],s=[];for(let o of e.statements){if(t.ts.isImportDeclaration(o)){if(t.ts.isStringLiteral(o.moduleSpecifier)){let A=o.moduleSpecifier.text;if(!A.startsWith(".")&&!A.startsWith("/")){r.push(o);continue}}let a=o.importClause;if(a){if(a.namedBindings){n.push(o);continue}if(a.name){n.push(o);continue}}i.push(o);continue}s.push(o)}return t.ts.factory.updateSourceFile(e,[...VF(t,r),...VF(t,n),...VF(t,i),...s])}function Po(t){let e=t.split(`
|
|
95
95
|
`).map(n=>n.trimEnd());t="";let r=!1;for(let n=e.length-1;n>=0;n--){let i=e[n];!r&&i.startsWith("import ")&&(r=!0,i=i+`
|
|
96
96
|
`),/^builder.init(.*)$/.test(i)&&(i=i+`
|
|
97
97
|
`),e[n-1]&&!e[n-1].includes("*/")&&(i.trim().startsWith("Builder.registerComponent")&&(i=`
|
|
@@ -100,8 +100,8 @@ ${r}=${n}
|
|
|
100
100
|
`+i),i.trim().startsWith("export ")&&(i=`
|
|
101
101
|
`+i)),t=i+`
|
|
102
102
|
`+t}return t.trim()+`
|
|
103
|
-
`}function VF(t,e){return e.sort((r,n)=>{let i=
|
|
104
|
-
${t}`),t}function M9(t,e){let r=e.statements.filter(n=>!(t.ts.isExpressionStatement(n)&&t.ts.isStringLiteral(n.expression)&&t.ts.isStringLiteral(n.expression)&&n.expression.text==="use client"));return t.ts.factory.updateSourceFile(e,r)}function Sa(t,e){return e.sort((r,n)=>{if(t.ts.isObjectLiteralExpression(r)&&t.ts.isObjectLiteralExpression(n)){let i=N9(t,r),s=N9(t,n);return i.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())}return 1})}function N9(t,e){let r=e.properties.find(n=>sr(t,n)==="name");return r&&t.ts.isPropertyAssignment(r)&&t.ts.isStringLiteral(r.initializer)?r.initializer.text:"zzzz"}var Pl=L(()=>{"use strict";h();Da()});async function P9(t){let e=await t.readFile(t.registryPath);return e?IFe(t,e):{components:[],sourceFile:Ht(t,"")}}async function IFe(t,e){let r=Ht(t,e);return t.sdkVersion===Ze.gen2?BFe(t,r):EFe(t,r)}async function EFe(t,e){let r=[];for(let n=0;n<e.statements.length;n++){let i=e.statements[n];if(!t.ts.isExpressionStatement(i))continue;let s=i.expression;if(!t.ts.isCallExpression(s))continue;let o=s.expression;if(!t.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!t.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let u=c[1];if(!t.ts.isObjectLiteralExpression(u))continue;let l=c[0];if(t.ts.isCallExpression(l)){let d=t.ts.isIdentifier(l.expression)&&l.expression.text;if(d==="withChildren"){let p=XF(t,l.arguments[0]);if(t.ts.isCallExpression(p)){let f=await WF(t,n,p,u,!0);f&&r.push(f)}else{let f=p;if(t.ts.isIdentifier(f)){let m=await zF(t,e,n,f,u,!0);m&&r.push(m)}}continue}if(d==="dynamic"){let p=await WF(t,n,l,u,!1);p&&r.push(p);continue}let g=XF(t,l.arguments[0]);if(t.ts.isCallExpression(g)&&t.ts.isIdentifier(g.expression)&&g.expression.text==="dynamic"){let p=await WF(t,n,g,u,!1);p&&r.push(p);continue}if(t.ts.isIdentifier(g)){let p=await zF(t,e,n,g,u,!1);p&&r.push(p);continue}continue}if(t.ts.isIdentifier(l)){let d=await zF(t,e,n,l,u,!1);d&&r.push(d);continue}}return{sourceFile:e,components:qi(r)}}function XF(t,e){return t.ts.isCallExpression(e)?(t.ts.isIdentifier(e.expression)&&e.expression.text)==="dynamic"?e:XF(t,e.arguments[0]):e}async function WF(t,e,r,n,i){let s={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:e,acceptsChildren:i,framework:"react"},o=r.arguments;if(o.length===0)return null;let a=o[0];if(!t.ts.isArrowFunction(a))return null;let A=a.body;if(t.ts.isCallExpression(A)){if(A.expression.kind!==t.ts.SyntaxKind.ImportKeyword||A.arguments.length!==1)return null;let u=A.arguments[0];if(!t.ts.isStringLiteral(u))return null;let l=u.text,d=await Lp(t,l);s.filePath=d,s.relFilePath=t.relative(t.getAppRootDir(),s.filePath),await t.exists(d)?s.importPath=fr(t,s.filePath):(s.externalImportPath=l,s.importPath=s.externalImportPath),s.name=Us(t,s.filePath),s.importName="default",s.exportName="default",s.exportType="default"}else if(t.ts.isPropertyAccessExpression(A)){let c=A.expression;if(!t.ts.isParenthesizedExpression(c))return null;let u=c.expression;if(!t.ts.isAwaitExpression(u))return null;let l=u.expression;if(!t.ts.isCallExpression(l)||l.expression.kind!==t.ts.SyntaxKind.ImportKeyword||l.arguments.length!==1)return null;let g=l.arguments[0];if(!t.ts.isStringLiteral(g)||!t.ts.isIdentifier(A.name))return null;let p=g.text,f=await Lp(t,p);s.filePath=f,s.relFilePath=t.relative(t.getAppRootDir(),s.filePath),await t.exists(f)?s.importPath=fr(t,s.filePath):(s.externalImportPath=p,s.importPath=s.externalImportPath),s.name=dr(A.name.text),s.importName=A.name.text,s.exportName=A.name.text,s.exportType="named"}else return null;return s=Vi(t,s,n),s.displayFilePath=er(t,s.filePath),s.filePath&&s.exportName&&(s.id=await ur(t,s.filePath,s.exportName,s.externalImportPath)),s}async function zF(t,e,r,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=e.statements.filter(c=>t.ts.isImportDeclaration(c)),A=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(A){let c=A.moduleSpecifier;if(!t.ts.isStringLiteral(c))return null;let u=await Lp(t,c.text);o.filePath=u,o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(u)?o.importPath=fr(t,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=Us(t,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!t.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(g=>g.name.text===n.text));if(!c)return null;let u=c.moduleSpecifier;if(!t.ts.isStringLiteral(u))return null;let l=await Lp(t,u.text);o.filePath=l,o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(l)?o.importPath=fr(t,o.filePath):(o.externalImportPath=u.text,o.importPath=o.externalImportPath),o.name=dr(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=Vi(t,o,i),o.displayFilePath=er(t,o.filePath),o.filePath&&o.exportName&&(o.id=await ur(t,o.filePath,o.exportName,o.externalImportPath)),o}function Lp(t,e){return gm(t,t.normalize(t.resolve(t.dirname(t.registryPath),e)))}function L9(t,e,r){let n=!1,i=0,s=[...e.statements];for(let c=0;c<s.length;c++){let u=s[c];if(t.ts.isImportDeclaration(u)){i=c;continue}if(!t.ts.isExpressionStatement(u))continue;let l=u.expression;if(!t.ts.isCallExpression(l))continue;let d=l.expression;if(!t.ts.isPropertyAccessExpression(d))continue;let g=d.expression;if(!t.ts.isIdentifier(g)||g.text!=="builder")continue;if(d.name.text=="init"){n=!0;break}else continue}if(n)return e;let o=t.ts.factory.createPropertyAccessExpression(t.ts.factory.createPropertyAccessExpression(t.ts.factory.createIdentifier("process"),t.ts.factory.createIdentifier("env")),t.ts.factory.createIdentifier(Qa)),a=r?t.ts.factory.createNonNullExpression(o):o,A=t.ts.factory.createExpressionStatement(t.ts.factory.createCallExpression(t.ts.factory.createPropertyAccessExpression(t.ts.factory.createIdentifier("builder"),t.ts.factory.createIdentifier("init")),void 0,[a]));return s.splice(i+1,0,A),t.ts.factory.updateSourceFile(e,s)}async function BFe(t,e){let r=[],n=An(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await ZF(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:qi(r)}}async function ZF(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};kp(t,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!t.ts.isPropertyAssignment(s)||!t.ts.isIdentifier(s.name))continue;if(sr(t,s)==="component"){let a,{initializer:A}=s;if(t.ts.isCallExpression(A)&&(t.ts.isIdentifier(A.expression)&&A.expression.text)==="dynamic"){let g=A.arguments;if(g.length===0)return null;let p=g[0];if(!t.ts.isArrowFunction(p))return null;let f=p.body;if(t.ts.isCallExpression(f)){if(f.expression.kind!==t.ts.SyntaxKind.ImportKeyword||f.arguments.length!==1)return null;let C=f.arguments[0];if(!t.ts.isStringLiteral(C))return null;let I=C.text,B=await Lp(t,I);n.filePath=B,n.relFilePath=t.relative(t.getAppRootDir(),n.filePath),await t.exists(B)?n.importPath=fr(t,n.filePath):(n.externalImportPath=I,n.importPath=n.externalImportPath),n.name=Us(t,n.filePath),n.importName="default",n.exportName="default",n.exportType="default"}else if(t.ts.isPropertyAccessExpression(f)){let m=f.expression;if(!t.ts.isParenthesizedExpression(m))return null;let C=m.expression;if(!t.ts.isAwaitExpression(C))return null;let I=C.expression;if(!t.ts.isCallExpression(I)||I.expression.kind!==t.ts.SyntaxKind.ImportKeyword||I.arguments.length!==1)return null;let E=I.arguments[0];if(!t.ts.isStringLiteral(E)||!t.ts.isIdentifier(f.name))return null;let y=E.text,Q=await Lp(t,y);n.filePath=Q,n.relFilePath=t.relative(t.getAppRootDir(),n.filePath),await t.exists(Q)?n.importPath=fr(t,n.filePath):(n.externalImportPath=y,n.importPath=n.externalImportPath),n.name=dr(f.name.text),n.importName=f.name.text,n.exportName=f.name.text,n.exportType="named"}else return null;return n=Vi(t,n,r),n.displayFilePath=er(t,n.filePath),n.filePath&&n.exportName&&(n.id=await ur(t,n.filePath,n.exportName,n.externalImportPath)),n}if(t.ts.isIdentifier(A)&&(a=A.text),!a)continue;n.name===""&&(n.name=dr(a)),n.importName=a;let c=await wa(t,t.registryPath,e,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await t.exists(c.filePath)?n.importPath=fr(t,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.importPath=fr(t,c.filePath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let u=e.statements.filter(d=>t.ts.isImportDeclaration(d)),l=u.find(d=>d.importClause&&d.importClause.name?.text===a);if(l){let d=l.moduleSpecifier;if(!t.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=u.find(p=>!p.importClause||!p.importClause.namedBindings||!t.ts.isNamedImports(p.importClause.namedBindings)?!1:p.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let g=d.moduleSpecifier;if(!t.ts.isStringLiteral(g))return null;n.exportName=a}continue}}return n=Vi(t,n,r),n.filePath&&n.exportName&&(n.id=await ur(t,n.filePath,n.exportName,n.externalImportPath)),n}var _9=L(()=>{"use strict";h();xn();_r();Wi();Qt();Da();xi();am()});function va(t,e){let r=[...e.statements],n=!1;for(let i=e.statements.length-1;i>=0;i--){let s=e.statements[i];if(t.ts.isImportDeclaration(s)&&s.importClause){let o=!1,a=s.importClause.namedBindings;if(a&&t.ts.isNamedImports(a)&&a.elements){let A=[...a.elements];for(let c=A.length-1;c>=0;c--){let u=A[c];if(t.ts.isImportSpecifier(u)){let l=u.name;if(l&&t.ts.isIdentifier(l)){let d=l.text;U9(t,e,d)||A.splice(c,1)}}}if(A.length===0)o=!0;else if(a.elements.length!==A.length){let c=t.ts.factory.updateImportClause(s.importClause,!1,s.importClause.name,t.ts.factory.createNamedImports(A)),u=t.ts.factory.updateImportDeclaration(s,void 0,c,s.moduleSpecifier,void 0);r[i]=u,n=!0}}else if(s.importClause.name&&t.ts.isIdentifier(s.importClause.name)){let A=s.importClause.name.text;U9(t,e,A)||(o=!0)}o&&(r.splice(i,1),n=!0)}}return n?t.ts.factory.updateSourceFile(e,r):e}function U9(t,e,r){let n=!1;function i(s){if(!t.ts.isImportDeclaration(s)){if(t.ts.isIdentifier(s)&&s.text===r){n=!0;return}t.ts.forEachChild(s,i)}}return t.ts.forEachChild(e,i),n}var _p=L(()=>{"use strict";h()});function xa(t,e,r,n,i,s,o){let a=null,A=null,c=null,u=-1;e=Is(e),r=Is(r);let l=e.find(g=>g.id===t),d=r.find(g=>g.id===t);if(n)d||(a={...Is(l),inputs:Is(l.inputs).map(g=>(g.isRegistered=!0,g))},u=r.length,r.push(a));else if(typeof d?.nodeIndex=="number"&&d.nodeIndex>-1){if(i)u=d.nodeIndex,A=Is(d),r=r.filter(g=>g.id!==t);else if(s!=null)yFe(d,s),u=d.nodeIndex,c=d;else if(o!=null){let g=d.inputs.find(p=>p.name===o.name);g&&(o.registerInput===!1?g.isRegistered=!1:(QFe(g,o),g.isRegistered=!0),c=d,u=d.nodeIndex)}}return{addCmpToRegistry:a,removeCmpFromRegistry:A,updateRegisteredCmp:c,nodeIndex:u,components:Lo(e,r)}}function Lo(t,e){let r=qi([...e.map(n=>(n.isRegistered=!0,n)),...t.filter(n=>!e.some(i=>i.id===n.id)).map(n=>(n.isRegistered=!1,n))]);return r.forEach(n=>{n.inputs=n.inputs.map(jF),n.inputs.sort((o,a)=>o.name.toLowerCase().localeCompare(a.name.toLowerCase()));let i=e.find(o=>o.id===n.id);i&&(i.acceptsChildren=YF(n));let s=t.find(o=>o.id===n.id&&o.externalImportPath);s&&(n.filePath=s.filePath,n.relFilePath=s.relFilePath)}),r}function yFe(t,e){Si(e.name)?t.name=e.name:e.name===null&&(t.name=t.importName),Si(e.description)?t.description=e.description:e.description===null&&delete t.description,Si(e.image)?t.image=e.image:e.image===null&&delete t.image}function QFe(t,e){Si(e.type)&&(t.type=e.type),Si(e.friendlyName)?t.friendlyName=e.friendlyName:e.friendlyName===null&&delete t.friendlyName,Si(e.defaultValue)||nm(e.defaultValue)||Sp(e.defaultValue)?t.defaultValue=e.defaultValue:e.defaultValue===null&&delete t.defaultValue,Si(e.helperText)?t.helperText=e.helperText:e.helperText===null&&delete t.helperText,e.required===!0?t.required=e.required:(e.required===null||e.required===!1)&&delete t.required}var Up=L(()=>{"use strict";h();Qt();xi()});async function Vc(t){let e=new Set,r=async i=>{let s=await t.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=t.join(i,o),A=t.extname(o).toLowerCase();if(A===".tsx"||A===".jsx"||A===".ts"||A===".js"){e.add(a);return}(await t.stat(a)).isDirectory()&&await r(a)}))};return await r(t.getAppRootDir()),await fn(t,[...e])}var pm=L(()=>{"use strict";h();Gs()});function Fa(t,e,r){return Np(t,e,r.variableName)?e:DFe(t,e,r)}function DFe(t,e,r){let n=typeof r.arrayType=="string"?t.ts.factory.createArrayTypeNode(t.ts.factory.createTypeReferenceNode(r.arrayType,void 0)):void 0,i=t.ts.factory.createArrayLiteralExpression([]),s=t.ts.factory.createVariableDeclaration(r.variableName,void 0,n,i),o=t.ts.factory.createVariableDeclarationList([s],t.ts.NodeFlags.Const),a=t.ts.factory.createModifier(t.ts.SyntaxKind.ExportKeyword),A=t.ts.factory.createVariableStatement([a],o),c=[...e.statements,A];return t.ts.factory.updateSourceFile(e,c)}var Gp=L(()=>{"use strict";h();Wi()});async function ka(t,e,r,n,i,s,o,a){let A=await Vc(t),[c,u,l,d]=await Promise.all([F9(t,A),P9(t),vi(t),om(t)]),g=c.map(B=>B.cmpInfo),p=u.components,f={components:Lo(g,p),registryPath:t.registryPath,registryDisplayPath:er(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Hs(g),publicApiKey:d.envValue??void 0,devToolsVersion:t.version};if(a)return f.components=await Mp(t,f.components),f;let m=!1,C=u.sourceFile,I=Array.isArray(e)?e:typeof e=="string"?[e]:[];if(I.length>0){let B=I.map(Q=>{let w=c.find(D=>D.cmpInfo.id===Q);if(!w)throw new Error(`Component ${Q} not found`);return w}),E=Array.from(new Set(B.map(Q=>Q.cmpInfo.filePath))),y=await fn(t,E);for(let Q of B){let w=f.components.find(v=>v.id===Q.cmpInfo.id),D=await Pp(t,Q,y,t.registryPath===Q.cmpInfo.filePath||_s(Q.cmpInfo.filePath));Es(w,D);let x=g.findIndex(v=>v.id===Q.cmpInfo.id);g[x].inputs=D;let S=xa(Q.cmpInfo.id,g,p,r,n,i,s);if(t.sdkVersion===Ze.gen2){let{elements:v,elmIndex:P,statementIndex:$,statement:H,variableDeclaration:M}=await SFe(t,C,Q);if(S.addCmpToRegistry)v.push(bFe(t,S.addCmpToRegistry)),m=!0;else if(S.removeCmpFromRegistry)v.splice(P,1),m=!0;else if(S.updateRegisteredCmp){let G=hn(t,v[P],S.updateRegisteredCmp);v[P]=t.ts.factory.updateObjectLiteralExpression(G,[O9(t,S.updateRegisteredCmp),...G.properties.slice(1)]),m=!0}if(m&&o){let G=[...C.statements];G[$]=t.ts.factory.updateVariableStatement(H,H.modifiers,t.ts.factory.updateVariableDeclarationList(H.declarationList,[t.ts.factory.updateVariableDeclaration(M,M.name,M.exclamationToken,M.type,t.ts.factory.createArrayLiteralExpression(Sa(t,v)))])),C=t.ts.factory.updateSourceFile(C,G),C=G9(t,S,C),C=qt(t,C,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),C=Fa(t,C,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=S.components,p=S.components.filter(Y=>Y.isRegistered)}}else{let v=[...C.statements];S.addCmpToRegistry?(v.push(E9(t,S.addCmpToRegistry)),m=!0):S.removeCmpFromRegistry?(v.splice(S.nodeIndex,1),m=!0):S.updateRegisteredCmp&&(v[S.nodeIndex]=qF(t,v[S.nodeIndex],S.updateRegisteredCmp),m=!0),m&&o&&(C=t.ts.factory.updateSourceFile(C,v),C=qt(t,C,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),C=L9(t,C,l),C=G9(t,S,C),w?.acceptsChildren&&(C=qt(t,C,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=S.components,p=S.components.filter(P=>P.isRegistered))}}}if(m&&o){C=va(t,C),C=ba(t,C),t.appDir&&(C=M9(t,C));let B=vn(t,C);B=Po(B),t.appDir&&(B=T9(B)),B=await t.formatCode(t.registryPath,B),await t.writeFile(t.registryPath,B)}return f}function O9(t,e){let r=t.ts.factory.createIdentifier(e.importName);return t.appDir?t.ts.factory.createPropertyAssignment("component",r):t.ts.factory.createPropertyAssignment("component",vFe(t,e))}function wFe(t){return t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())}function bFe(t,e){return hn(t,t.ts.factory.createObjectLiteralExpression([O9(t,e),...e.acceptsChildren?[wFe(t)]:[]],!0),e)}async function SFe(t,e,r){let n=An(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await ZF(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}function G9(t,e,r){if(t.appDir){let n=e.addCmpToRegistry||e.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:Jt(t,t.registryPath,n.filePath);n.exportType==="default"?r=qt(t,r,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(r=qt(t,r,{namedImports:[n.importName],importPath:i}))}}else r=qt(t,r,{defaultImport:"dynamic",importPath:"next/dynamic"});return r}function vFe(t,e){let r=e.externalImportPath?e.externalImportPath:Jt(t,t.registryPath,e.filePath),n=e.exportName!=="default",i;n?i=t.ts.factory.createPropertyAccessExpression(t.ts.factory.createAwaitExpression(t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("import"),void 0,[t.ts.factory.createStringLiteral(r)])),t.ts.factory.createIdentifier(e.exportName)):i=t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("import"),void 0,[t.ts.factory.createStringLiteral(r)]);let s=t.ts.factory.createArrowFunction(n?[t.ts.factory.createModifier(t.ts.SyntaxKind.AsyncKeyword)]:void 0,void 0,[],void 0,t.ts.factory.createToken(t.ts.SyntaxKind.EqualsGreaterThanToken),i);return t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("dynamic"),void 0,[s])}var ek=L(()=>{"use strict";h();xn();B9();Gs();Mo();_r();k9();Qt();Pl();_9();$c();_p();Up();xi();pm();jc();am();Wi();Gp();gi()});async function H9(t){let e=[],r=await NFe(t,e);return await $9(t,e,r),t.appDir?(t.debug(`ensure builder setup for next.js app ${t.appDir}`),await FFe(t,t.appDir,e)):t.pagesDir&&(t.debug(`ensure builder setup for next.js pages ${t.pagesDir}`),await kFe(t,t.pagesDir,e)),e}async function J9(t){let e=[];return await $9(t,e),t.appDir?(t.debug(`ensure figma-imports setup for next.js app ${t.appDir}`),await xFe(t,t.appDir,e)):t.pagesDir&&(t.debug(`ensure figma-imports setup for next.js pages ${t.pagesDir}`),await RFe(t,t.pagesDir,e)),e}async function xFe(t,e,r){let n=`page.${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,"figma-imports",n);if(!await t.exists(i)){let s=await t.formatCode(i,j9({sys:t,routePath:i,modelName:"figma-imports"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(!await t.exists(t.builderComponentPath)){let s=await t.formatCode(t.builderComponentPath,Y9(t));await t.writeFile(t.builderComponentPath,s),r.push({filePath:t.builderComponentPath,modifiedType:"create"})}}async function FFe(t,e,r){let n=`page.${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,"[...page]",n);if(!await t.exists(i)){let s=await t.formatCode(i,j9({sys:t,routePath:i,modelName:"page"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(!await t.exists(t.builderComponentPath)){let s=await t.formatCode(t.builderComponentPath,Y9(t));await t.writeFile(t.builderComponentPath,s),r.push({filePath:t.builderComponentPath,modifiedType:"create"})}}function Y9(t){let e=t.typescriptEnabled;return t.sdkVersion===Ze.gen2?`
|
|
103
|
+
`}function VF(t,e){return e.sort((r,n)=>{let i=RY(t,r),s=RY(t,n);return i.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())})}function RY(t,e){let r=e.importClause;if(r){let n=r.namedBindings;if(n&&t.ts.isNamedImports(n)&&n.elements.length>0)return n.elements[0].name.text;if(r.name)return r.name.text}return e.moduleSpecifier&&t.ts.isStringLiteral(e.moduleSpecifier)?e.moduleSpecifier.text:""}function TY(t){return typeof t=="string"&&!t.includes("'use client'")&&!t.includes(`"use client"'`)&&(t=`"use client"
|
|
104
|
+
${t}`),t}function MY(t,e){let r=e.statements.filter(n=>!(t.ts.isExpressionStatement(n)&&t.ts.isStringLiteral(n.expression)&&t.ts.isStringLiteral(n.expression)&&n.expression.text==="use client"));return t.ts.factory.updateSourceFile(e,r)}function Sa(t,e){return e.sort((r,n)=>{if(t.ts.isObjectLiteralExpression(r)&&t.ts.isObjectLiteralExpression(n)){let i=NY(t,r),s=NY(t,n);return i.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())}return 1})}function NY(t,e){let r=e.properties.find(n=>sr(t,n)==="name");return r&&t.ts.isPropertyAssignment(r)&&t.ts.isStringLiteral(r.initializer)?r.initializer.text:"zzzz"}var Pl=L(()=>{"use strict";h();Da()});async function PY(t){let e=await t.readFile(t.registryPath);return e?IFe(t,e):{components:[],sourceFile:Ht(t,"")}}async function IFe(t,e){let r=Ht(t,e);return t.sdkVersion===Ze.gen2?BFe(t,r):EFe(t,r)}async function EFe(t,e){let r=[];for(let n=0;n<e.statements.length;n++){let i=e.statements[n];if(!t.ts.isExpressionStatement(i))continue;let s=i.expression;if(!t.ts.isCallExpression(s))continue;let o=s.expression;if(!t.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!t.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let u=c[1];if(!t.ts.isObjectLiteralExpression(u))continue;let l=c[0];if(t.ts.isCallExpression(l)){let d=t.ts.isIdentifier(l.expression)&&l.expression.text;if(d==="withChildren"){let p=XF(t,l.arguments[0]);if(t.ts.isCallExpression(p)){let f=await WF(t,n,p,u,!0);f&&r.push(f)}else{let f=p;if(t.ts.isIdentifier(f)){let m=await zF(t,e,n,f,u,!0);m&&r.push(m)}}continue}if(d==="dynamic"){let p=await WF(t,n,l,u,!1);p&&r.push(p);continue}let g=XF(t,l.arguments[0]);if(t.ts.isCallExpression(g)&&t.ts.isIdentifier(g.expression)&&g.expression.text==="dynamic"){let p=await WF(t,n,g,u,!1);p&&r.push(p);continue}if(t.ts.isIdentifier(g)){let p=await zF(t,e,n,g,u,!1);p&&r.push(p);continue}continue}if(t.ts.isIdentifier(l)){let d=await zF(t,e,n,l,u,!1);d&&r.push(d);continue}}return{sourceFile:e,components:qi(r)}}function XF(t,e){return t.ts.isCallExpression(e)?(t.ts.isIdentifier(e.expression)&&e.expression.text)==="dynamic"?e:XF(t,e.arguments[0]):e}async function WF(t,e,r,n,i){let s={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:e,acceptsChildren:i,framework:"react"},o=r.arguments;if(o.length===0)return null;let a=o[0];if(!t.ts.isArrowFunction(a))return null;let A=a.body;if(t.ts.isCallExpression(A)){if(A.expression.kind!==t.ts.SyntaxKind.ImportKeyword||A.arguments.length!==1)return null;let u=A.arguments[0];if(!t.ts.isStringLiteral(u))return null;let l=u.text,d=await Lp(t,l);s.filePath=d,s.relFilePath=t.relative(t.getAppRootDir(),s.filePath),await t.exists(d)?s.importPath=fr(t,s.filePath):(s.externalImportPath=l,s.importPath=s.externalImportPath),s.name=Us(t,s.filePath),s.importName="default",s.exportName="default",s.exportType="default"}else if(t.ts.isPropertyAccessExpression(A)){let c=A.expression;if(!t.ts.isParenthesizedExpression(c))return null;let u=c.expression;if(!t.ts.isAwaitExpression(u))return null;let l=u.expression;if(!t.ts.isCallExpression(l)||l.expression.kind!==t.ts.SyntaxKind.ImportKeyword||l.arguments.length!==1)return null;let g=l.arguments[0];if(!t.ts.isStringLiteral(g)||!t.ts.isIdentifier(A.name))return null;let p=g.text,f=await Lp(t,p);s.filePath=f,s.relFilePath=t.relative(t.getAppRootDir(),s.filePath),await t.exists(f)?s.importPath=fr(t,s.filePath):(s.externalImportPath=p,s.importPath=s.externalImportPath),s.name=dr(A.name.text),s.importName=A.name.text,s.exportName=A.name.text,s.exportType="named"}else return null;return s=Vi(t,s,n),s.displayFilePath=er(t,s.filePath),s.filePath&&s.exportName&&(s.id=await ur(t,s.filePath,s.exportName,s.externalImportPath)),s}async function zF(t,e,r,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=e.statements.filter(c=>t.ts.isImportDeclaration(c)),A=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(A){let c=A.moduleSpecifier;if(!t.ts.isStringLiteral(c))return null;let u=await Lp(t,c.text);o.filePath=u,o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(u)?o.importPath=fr(t,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=Us(t,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!t.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(g=>g.name.text===n.text));if(!c)return null;let u=c.moduleSpecifier;if(!t.ts.isStringLiteral(u))return null;let l=await Lp(t,u.text);o.filePath=l,o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(l)?o.importPath=fr(t,o.filePath):(o.externalImportPath=u.text,o.importPath=o.externalImportPath),o.name=dr(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=Vi(t,o,i),o.displayFilePath=er(t,o.filePath),o.filePath&&o.exportName&&(o.id=await ur(t,o.filePath,o.exportName,o.externalImportPath)),o}function Lp(t,e){return gm(t,t.normalize(t.resolve(t.dirname(t.registryPath),e)))}function LY(t,e,r){let n=!1,i=0,s=[...e.statements];for(let c=0;c<s.length;c++){let u=s[c];if(t.ts.isImportDeclaration(u)){i=c;continue}if(!t.ts.isExpressionStatement(u))continue;let l=u.expression;if(!t.ts.isCallExpression(l))continue;let d=l.expression;if(!t.ts.isPropertyAccessExpression(d))continue;let g=d.expression;if(!t.ts.isIdentifier(g)||g.text!=="builder")continue;if(d.name.text=="init"){n=!0;break}else continue}if(n)return e;let o=t.ts.factory.createPropertyAccessExpression(t.ts.factory.createPropertyAccessExpression(t.ts.factory.createIdentifier("process"),t.ts.factory.createIdentifier("env")),t.ts.factory.createIdentifier(Qa)),a=r?t.ts.factory.createNonNullExpression(o):o,A=t.ts.factory.createExpressionStatement(t.ts.factory.createCallExpression(t.ts.factory.createPropertyAccessExpression(t.ts.factory.createIdentifier("builder"),t.ts.factory.createIdentifier("init")),void 0,[a]));return s.splice(i+1,0,A),t.ts.factory.updateSourceFile(e,s)}async function BFe(t,e){let r=[],n=An(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await ZF(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:qi(r)}}async function ZF(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};kp(t,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!t.ts.isPropertyAssignment(s)||!t.ts.isIdentifier(s.name))continue;if(sr(t,s)==="component"){let a,{initializer:A}=s;if(t.ts.isCallExpression(A)&&(t.ts.isIdentifier(A.expression)&&A.expression.text)==="dynamic"){let g=A.arguments;if(g.length===0)return null;let p=g[0];if(!t.ts.isArrowFunction(p))return null;let f=p.body;if(t.ts.isCallExpression(f)){if(f.expression.kind!==t.ts.SyntaxKind.ImportKeyword||f.arguments.length!==1)return null;let C=f.arguments[0];if(!t.ts.isStringLiteral(C))return null;let I=C.text,B=await Lp(t,I);n.filePath=B,n.relFilePath=t.relative(t.getAppRootDir(),n.filePath),await t.exists(B)?n.importPath=fr(t,n.filePath):(n.externalImportPath=I,n.importPath=n.externalImportPath),n.name=Us(t,n.filePath),n.importName="default",n.exportName="default",n.exportType="default"}else if(t.ts.isPropertyAccessExpression(f)){let m=f.expression;if(!t.ts.isParenthesizedExpression(m))return null;let C=m.expression;if(!t.ts.isAwaitExpression(C))return null;let I=C.expression;if(!t.ts.isCallExpression(I)||I.expression.kind!==t.ts.SyntaxKind.ImportKeyword||I.arguments.length!==1)return null;let E=I.arguments[0];if(!t.ts.isStringLiteral(E)||!t.ts.isIdentifier(f.name))return null;let y=E.text,Q=await Lp(t,y);n.filePath=Q,n.relFilePath=t.relative(t.getAppRootDir(),n.filePath),await t.exists(Q)?n.importPath=fr(t,n.filePath):(n.externalImportPath=y,n.importPath=n.externalImportPath),n.name=dr(f.name.text),n.importName=f.name.text,n.exportName=f.name.text,n.exportType="named"}else return null;return n=Vi(t,n,r),n.displayFilePath=er(t,n.filePath),n.filePath&&n.exportName&&(n.id=await ur(t,n.filePath,n.exportName,n.externalImportPath)),n}if(t.ts.isIdentifier(A)&&(a=A.text),!a)continue;n.name===""&&(n.name=dr(a)),n.importName=a;let c=await wa(t,t.registryPath,e,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await t.exists(c.filePath)?n.importPath=fr(t,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.importPath=fr(t,c.filePath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let u=e.statements.filter(d=>t.ts.isImportDeclaration(d)),l=u.find(d=>d.importClause&&d.importClause.name?.text===a);if(l){let d=l.moduleSpecifier;if(!t.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=u.find(p=>!p.importClause||!p.importClause.namedBindings||!t.ts.isNamedImports(p.importClause.namedBindings)?!1:p.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let g=d.moduleSpecifier;if(!t.ts.isStringLiteral(g))return null;n.exportName=a}continue}}return n=Vi(t,n,r),n.filePath&&n.exportName&&(n.id=await ur(t,n.filePath,n.exportName,n.externalImportPath)),n}var _Y=L(()=>{"use strict";h();xn();_r();Wi();Qt();Da();xi();am()});function va(t,e){let r=[...e.statements],n=!1;for(let i=e.statements.length-1;i>=0;i--){let s=e.statements[i];if(t.ts.isImportDeclaration(s)&&s.importClause){let o=!1,a=s.importClause.namedBindings;if(a&&t.ts.isNamedImports(a)&&a.elements){let A=[...a.elements];for(let c=A.length-1;c>=0;c--){let u=A[c];if(t.ts.isImportSpecifier(u)){let l=u.name;if(l&&t.ts.isIdentifier(l)){let d=l.text;UY(t,e,d)||A.splice(c,1)}}}if(A.length===0)o=!0;else if(a.elements.length!==A.length){let c=t.ts.factory.updateImportClause(s.importClause,!1,s.importClause.name,t.ts.factory.createNamedImports(A)),u=t.ts.factory.updateImportDeclaration(s,void 0,c,s.moduleSpecifier,void 0);r[i]=u,n=!0}}else if(s.importClause.name&&t.ts.isIdentifier(s.importClause.name)){let A=s.importClause.name.text;UY(t,e,A)||(o=!0)}o&&(r.splice(i,1),n=!0)}}return n?t.ts.factory.updateSourceFile(e,r):e}function UY(t,e,r){let n=!1;function i(s){if(!t.ts.isImportDeclaration(s)){if(t.ts.isIdentifier(s)&&s.text===r){n=!0;return}t.ts.forEachChild(s,i)}}return t.ts.forEachChild(e,i),n}var _p=L(()=>{"use strict";h()});function xa(t,e,r,n,i,s,o){let a=null,A=null,c=null,u=-1;e=Is(e),r=Is(r);let l=e.find(g=>g.id===t),d=r.find(g=>g.id===t);if(n)d||(a={...Is(l),inputs:Is(l.inputs).map(g=>(g.isRegistered=!0,g))},u=r.length,r.push(a));else if(typeof d?.nodeIndex=="number"&&d.nodeIndex>-1){if(i)u=d.nodeIndex,A=Is(d),r=r.filter(g=>g.id!==t);else if(s!=null)yFe(d,s),u=d.nodeIndex,c=d;else if(o!=null){let g=d.inputs.find(p=>p.name===o.name);g&&(o.registerInput===!1?g.isRegistered=!1:(QFe(g,o),g.isRegistered=!0),c=d,u=d.nodeIndex)}}return{addCmpToRegistry:a,removeCmpFromRegistry:A,updateRegisteredCmp:c,nodeIndex:u,components:Lo(e,r)}}function Lo(t,e){let r=qi([...e.map(n=>(n.isRegistered=!0,n)),...t.filter(n=>!e.some(i=>i.id===n.id)).map(n=>(n.isRegistered=!1,n))]);return r.forEach(n=>{n.inputs=n.inputs.map(jF),n.inputs.sort((o,a)=>o.name.toLowerCase().localeCompare(a.name.toLowerCase()));let i=e.find(o=>o.id===n.id);i&&(i.acceptsChildren=YF(n));let s=t.find(o=>o.id===n.id&&o.externalImportPath);s&&(n.filePath=s.filePath,n.relFilePath=s.relFilePath)}),r}function yFe(t,e){Si(e.name)?t.name=e.name:e.name===null&&(t.name=t.importName),Si(e.description)?t.description=e.description:e.description===null&&delete t.description,Si(e.image)?t.image=e.image:e.image===null&&delete t.image}function QFe(t,e){Si(e.type)&&(t.type=e.type),Si(e.friendlyName)?t.friendlyName=e.friendlyName:e.friendlyName===null&&delete t.friendlyName,Si(e.defaultValue)||nm(e.defaultValue)||Sp(e.defaultValue)?t.defaultValue=e.defaultValue:e.defaultValue===null&&delete t.defaultValue,Si(e.helperText)?t.helperText=e.helperText:e.helperText===null&&delete t.helperText,e.required===!0?t.required=e.required:(e.required===null||e.required===!1)&&delete t.required}var Up=L(()=>{"use strict";h();Qt();xi()});async function Vc(t){let e=new Set,r=async i=>{let s=await t.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=t.join(i,o),A=t.extname(o).toLowerCase();if(A===".tsx"||A===".jsx"||A===".ts"||A===".js"){e.add(a);return}(await t.stat(a)).isDirectory()&&await r(a)}))};return await r(t.getAppRootDir()),await fn(t,[...e])}var pm=L(()=>{"use strict";h();Gs()});function Fa(t,e,r){return Np(t,e,r.variableName)?e:DFe(t,e,r)}function DFe(t,e,r){let n=typeof r.arrayType=="string"?t.ts.factory.createArrayTypeNode(t.ts.factory.createTypeReferenceNode(r.arrayType,void 0)):void 0,i=t.ts.factory.createArrayLiteralExpression([]),s=t.ts.factory.createVariableDeclaration(r.variableName,void 0,n,i),o=t.ts.factory.createVariableDeclarationList([s],t.ts.NodeFlags.Const),a=t.ts.factory.createModifier(t.ts.SyntaxKind.ExportKeyword),A=t.ts.factory.createVariableStatement([a],o),c=[...e.statements,A];return t.ts.factory.updateSourceFile(e,c)}var Gp=L(()=>{"use strict";h();Wi()});async function ka(t,e,r,n,i,s,o,a){let A=await Vc(t),[c,u,l,d]=await Promise.all([FY(t,A),PY(t),vi(t),om(t)]),g=c.map(B=>B.cmpInfo),p=u.components,f={components:Lo(g,p),registryPath:t.registryPath,registryDisplayPath:er(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Hs(g),publicApiKey:d.envValue??void 0,devToolsVersion:t.version};if(a)return f.components=await Mp(t,f.components),f;let m=!1,C=u.sourceFile,I=Array.isArray(e)?e:typeof e=="string"?[e]:[];if(I.length>0){let B=I.map(Q=>{let w=c.find(D=>D.cmpInfo.id===Q);if(!w)throw new Error(`Component ${Q} not found`);return w}),E=Array.from(new Set(B.map(Q=>Q.cmpInfo.filePath))),y=await fn(t,E);for(let Q of B){let w=f.components.find(v=>v.id===Q.cmpInfo.id),D=await Pp(t,Q,y,t.registryPath===Q.cmpInfo.filePath||_s(Q.cmpInfo.filePath));Es(w,D);let x=g.findIndex(v=>v.id===Q.cmpInfo.id);g[x].inputs=D;let S=xa(Q.cmpInfo.id,g,p,r,n,i,s);if(t.sdkVersion===Ze.gen2){let{elements:v,elmIndex:P,statementIndex:$,statement:H,variableDeclaration:M}=await SFe(t,C,Q);if(S.addCmpToRegistry)v.push(bFe(t,S.addCmpToRegistry)),m=!0;else if(S.removeCmpFromRegistry)v.splice(P,1),m=!0;else if(S.updateRegisteredCmp){let G=hn(t,v[P],S.updateRegisteredCmp);v[P]=t.ts.factory.updateObjectLiteralExpression(G,[OY(t,S.updateRegisteredCmp),...G.properties.slice(1)]),m=!0}if(m&&o){let G=[...C.statements];G[$]=t.ts.factory.updateVariableStatement(H,H.modifiers,t.ts.factory.updateVariableDeclarationList(H.declarationList,[t.ts.factory.updateVariableDeclaration(M,M.name,M.exclamationToken,M.type,t.ts.factory.createArrayLiteralExpression(Sa(t,v)))])),C=t.ts.factory.updateSourceFile(C,G),C=GY(t,S,C),C=qt(t,C,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),C=Fa(t,C,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=S.components,p=S.components.filter(Y=>Y.isRegistered)}}else{let v=[...C.statements];S.addCmpToRegistry?(v.push(EY(t,S.addCmpToRegistry)),m=!0):S.removeCmpFromRegistry?(v.splice(S.nodeIndex,1),m=!0):S.updateRegisteredCmp&&(v[S.nodeIndex]=qF(t,v[S.nodeIndex],S.updateRegisteredCmp),m=!0),m&&o&&(C=t.ts.factory.updateSourceFile(C,v),C=qt(t,C,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),C=LY(t,C,l),C=GY(t,S,C),w?.acceptsChildren&&(C=qt(t,C,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=S.components,p=S.components.filter(P=>P.isRegistered))}}}if(m&&o){C=va(t,C),C=ba(t,C),t.appDir&&(C=MY(t,C));let B=vn(t,C);B=Po(B),t.appDir&&(B=TY(B)),B=await t.formatCode(t.registryPath,B),await t.writeFile(t.registryPath,B)}return f}function OY(t,e){let r=t.ts.factory.createIdentifier(e.importName);return t.appDir?t.ts.factory.createPropertyAssignment("component",r):t.ts.factory.createPropertyAssignment("component",vFe(t,e))}function wFe(t){return t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())}function bFe(t,e){return hn(t,t.ts.factory.createObjectLiteralExpression([OY(t,e),...e.acceptsChildren?[wFe(t)]:[]],!0),e)}async function SFe(t,e,r){let n=An(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await ZF(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}function GY(t,e,r){if(t.appDir){let n=e.addCmpToRegistry||e.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:Jt(t,t.registryPath,n.filePath);n.exportType==="default"?r=qt(t,r,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(r=qt(t,r,{namedImports:[n.importName],importPath:i}))}}else r=qt(t,r,{defaultImport:"dynamic",importPath:"next/dynamic"});return r}function vFe(t,e){let r=e.externalImportPath?e.externalImportPath:Jt(t,t.registryPath,e.filePath),n=e.exportName!=="default",i;n?i=t.ts.factory.createPropertyAccessExpression(t.ts.factory.createAwaitExpression(t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("import"),void 0,[t.ts.factory.createStringLiteral(r)])),t.ts.factory.createIdentifier(e.exportName)):i=t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("import"),void 0,[t.ts.factory.createStringLiteral(r)]);let s=t.ts.factory.createArrowFunction(n?[t.ts.factory.createModifier(t.ts.SyntaxKind.AsyncKeyword)]:void 0,void 0,[],void 0,t.ts.factory.createToken(t.ts.SyntaxKind.EqualsGreaterThanToken),i);return t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("dynamic"),void 0,[s])}var ek=L(()=>{"use strict";h();xn();BY();Gs();Mo();_r();kY();Qt();Pl();_Y();$c();_p();Up();xi();pm();jc();am();Wi();Gp();gi()});async function HY(t){let e=[],r=await NFe(t,e);return await $Y(t,e,r),t.appDir?(t.debug(`ensure builder setup for next.js app ${t.appDir}`),await FFe(t,t.appDir,e)):t.pagesDir&&(t.debug(`ensure builder setup for next.js pages ${t.pagesDir}`),await kFe(t,t.pagesDir,e)),e}async function JY(t){let e=[];return await $Y(t,e),t.appDir?(t.debug(`ensure figma-imports setup for next.js app ${t.appDir}`),await xFe(t,t.appDir,e)):t.pagesDir&&(t.debug(`ensure figma-imports setup for next.js pages ${t.pagesDir}`),await RFe(t,t.pagesDir,e)),e}async function xFe(t,e,r){let n=`page.${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,"figma-imports",n);if(!await t.exists(i)){let s=await t.formatCode(i,jY({sys:t,routePath:i,modelName:"figma-imports"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(!await t.exists(t.builderComponentPath)){let s=await t.formatCode(t.builderComponentPath,YY(t));await t.writeFile(t.builderComponentPath,s),r.push({filePath:t.builderComponentPath,modifiedType:"create"})}}async function FFe(t,e,r){let n=`page.${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,"[...page]",n);if(!await t.exists(i)){let s=await t.formatCode(i,jY({sys:t,routePath:i,modelName:"page"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(!await t.exists(t.builderComponentPath)){let s=await t.formatCode(t.builderComponentPath,YY(t));await t.writeFile(t.builderComponentPath,s),r.push({filePath:t.builderComponentPath,modifiedType:"create"})}}function YY(t){let e=t.typescriptEnabled;return t.sdkVersion===Ze.gen2?`
|
|
105
105
|
"use client";
|
|
106
106
|
import { ${e?"BuilderContent, ":""} isPreviewing, Content } from "@builder.io/sdk-react";
|
|
107
107
|
import DefaultErrorPage from "next/error";
|
|
@@ -160,7 +160,7 @@ export function RenderBuilderContent({ content, model }${e?": BuilderPageProps":
|
|
|
160
160
|
// DefaultErrorPage with a 404.
|
|
161
161
|
return <DefaultErrorPage statusCode={404} />;
|
|
162
162
|
}
|
|
163
|
-
`.trimStart()}function
|
|
163
|
+
`.trimStart()}function KY(t){return t.features.asyncParams?`
|
|
164
164
|
interface PageProps {
|
|
165
165
|
params: Promise<{
|
|
166
166
|
page: string[];
|
|
@@ -170,14 +170,14 @@ interface PageProps {
|
|
|
170
170
|
params: {
|
|
171
171
|
page: string[];
|
|
172
172
|
};
|
|
173
|
-
}`}function
|
|
173
|
+
}`}function jY({sys:t,routePath:e,modelName:r}){let n=t.typescriptEnabled,i=Jt(t,e,t.builderComponentPath);return t.sdkVersion===Ze.gen2?`
|
|
174
174
|
import { fetchOneEntry } from "@builder.io/sdk-react";
|
|
175
175
|
import { RenderBuilderContent } from ${JSON.stringify(i)};
|
|
176
176
|
|
|
177
177
|
// Builder Public API Key set in .env file
|
|
178
178
|
const PUBLIC_API_KEY = process.env.${Qa}${n?"!":""};
|
|
179
179
|
|
|
180
|
-
${n?
|
|
180
|
+
${n?KY(t):""}
|
|
181
181
|
|
|
182
182
|
export default async function Page(props${n?": PageProps":""}) {
|
|
183
183
|
const builderModelName = "${r}";
|
|
@@ -205,7 +205,7 @@ import { RenderBuilderContent } from ${JSON.stringify(i)};
|
|
|
205
205
|
|
|
206
206
|
// Builder Public API Key set in .env file
|
|
207
207
|
builder.init(process.env.${Qa}${n?"!":""});
|
|
208
|
-
${n?
|
|
208
|
+
${n?KY(t):""}
|
|
209
209
|
|
|
210
210
|
export default async function Page(props${n?": PageProps":""}) {
|
|
211
211
|
const builderModelName = "${r}";
|
|
@@ -228,7 +228,7 @@ export default async function Page(props${n?": PageProps":""}) {
|
|
|
228
228
|
</>
|
|
229
229
|
);
|
|
230
230
|
}
|
|
231
|
-
`.trimStart()}async function kFe(t,e,r){let n=`[...page].${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,n);if(!await t.exists(i)){let s=await t.formatCode(i,
|
|
231
|
+
`.trimStart()}async function kFe(t,e,r){let n=`[...page].${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,n);if(!await t.exists(i)){let s=await t.formatCode(i,qY({sys:t,routePath:i,modelName:"page"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}}async function RFe(t,e,r){let n=`figma-imports.${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(e,n);if(!await t.exists(i)){let s=await t.formatCode(i,qY({sys:t,routePath:i,modelName:"figma-imports"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}}function qY({sys:t,routePath:e,modelName:r}){let n=t.typescriptEnabled;return t.sdkVersion===Ze.gen2?`
|
|
232
232
|
import React from "react";
|
|
233
233
|
import { useRouter } from "next/router";
|
|
234
234
|
${n?'import type { BuilderContent } from "@builder.io/sdk-react";':""}
|
|
@@ -455,18 +455,18 @@ export default Counter;
|
|
|
455
455
|
font-size: 42px;
|
|
456
456
|
text-align: center;
|
|
457
457
|
}
|
|
458
|
-
`.trimStart();return{component:r,styles:n}}async function $
|
|
458
|
+
`.trimStart();return{component:r,styles:n}}async function $Y(t,e,r){if(!await t.exists(t.registryPath)){if(t.sdkVersion===Ze.gen2){let s=MFe(t);await t.writeFile(t.registryPath,s)}else await t.writeFile(t.registryPath,"");e.push({filePath:t.registryPath,modifiedType:"create"})}if(!r)return;let i=(await ka(t,null,!1,!1,null,null,!1,!1)).components.find(s=>s.filePath===r);i&&await ka(t,i.id,!0,!1,null,null,!0,!1)}function MFe(t){return t.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-react";
|
|
459
459
|
|
|
460
460
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
461
461
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
462
462
|
];
|
|
463
|
-
`}var
|
|
463
|
+
`}var VY=L(()=>{"use strict";h();xn();Qt();am();ek()});async function Op(t){let e=await To(t,t.getRepoRootDir());if(e&&typeof e=="object"){let r=new Set(Object.keys({...e.dependencies,...e.devDependencies}));if(r.has("@builder.io/sdk-react"))return Ze.gen2;if(r.has("@builder.io/react"))return Ze.gen1}return null}var sy=L(()=>{"use strict";h();xn();gi()});async function WY(t){let e=await PFe(t);return{builderPageOptions:async()=>({templateContentId:"3de2f13211234071a4b19a17b4fbc5a7",pathname:"/builder-demo",title:"Builder + Next.js Demo Page"}),ensureBuilderSetup:()=>HY(e),ensureFigmaImportPage:()=>JY(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>ka(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await ka(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>ka(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>ka(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>ka(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>ka(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>om(e),setPublicApiKey:n=>dY(e,n.publicApiKey),getDependencies:n=>n.sdkVersion===Ze.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Os(e),setCache:n=>Ks(e,n)}}async function PFe(t){let e=t.getAppRootDir(),r=t.join(e,"src"),n=await LFe(t),i=await vi(t),s=t.getFrameworks().find(c=>c.name==="next"),o={asyncParams:s?.version?.major!==void 0&&s.version.major>=15},a={},A={...t,addExternalPackage:c=>{a[t.join(e,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>a[c]??t.readFileSync(c),existsSync:c=>!!a[c]||t.existsSync(c),readdirSync:c=>{let u=t.readdirSync(c);return c===e?[...u,...Object.keys(a).map(l=>l.slice(e.length+1))]:u},readdir:async c=>{let u=await t.readdir(c);return c===e?[...u,...Object.keys(a).map(l=>l.slice(e.length+1))]:u},appDir:null,pagesDir:null,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",nextConfigPath:n,typescriptEnabled:i,features:o};if(t.sdkVersion?A.sdkVersion=t.sdkVersion:A.sdkVersion=await Op(A),await t.exists(r)){A.srcDir=r,A.componentsDir=t.join(r,"components");let c=t.join(r,"app");await t.exists(c)&&(A.appDir=c);let u=t.join(r,"pages");await t.exists(u)&&(A.pagesDir=u),A.registryPath=await $i(t,r)}else A.componentsDir=t.join(e,"components"),A.registryPath=await $i(t,e);if(A.builderComponentPath=t.join(A.componentsDir,`builder.${i?"tsx":"jsx"}`),!A.appDir){let c=t.join(e,"app");await t.exists(c)&&(A.appDir=c)}if(!A.pagesDir){let c=t.join(e,"pages");await t.exists(c)&&(A.pagesDir=c)}if(!A.appDir&&!A.pagesDir&&!t.ignoreMissingConfig)throw new Error(`Could not find Next.js "app" or "pages" directory. Searched in "${e}".`);return A}async function LFe(t){let e=t.join(t.getAppRootDir(),"next.config.ts");if(await t.exists(e))return e;let r=t.join(t.getAppRootDir(),"next.config.mjs");if(await t.exists(r))return r;let n=t.join(t.getAppRootDir(),"next.config.js");if(await t.exists(n))return n;throw new Error(`Could not find Next.js config file. Searched for "next.config.ts", "next.config.mjs" and "next.config.js" in "${t.getAppRootDir()}".`)}var zY=L(()=>{"use strict";h();Rl();am();ek();VY();xn();sy();gi()});async function dm(t){return await Ba(t,[".env"],ZY)}async function XY(t,e){_Fe(e);let r=await dm(t),n=await ya(t,r.file,r.envKey,e);return{...r,modifiedType:n}}function _Fe(t){typeof process<"u"&&(process.env[ZY]=t)}var ZY,tk=L(()=>{"use strict";h();Nl();ZY="PUBLIC_BUILDER_API_KEY"});function e9(t,e,r){if(r.length===0)return t;let n=t.split(`
|
|
464
464
|
`),i=n.findIndex(a=>a.includes(r));if(i===-1||n.some(a=>a.includes(e[0])))return t;let o=["/**",...e.map(a=>` * ${a.trim()}`)," */"];return n.splice(i,0,...o),n.join(`
|
|
465
|
-
`)}var
|
|
465
|
+
`)}var t9=L(()=>{"use strict";h()});async function n9(t,e){let r=[],n=e.getSourceFiles(),i=e.getTypeChecker();return await Promise.all(n.map(async s=>{let o=t.basename(s.fileName);if(o.startsWith(".")||OFe.has(o))return;let a=t.normalize(s.fileName);if(a===t.registryPath)return;let A=await oy(t,i,a,s);r.push(...A)})),r}async function i9(t,e){if(t.extname(e).toLowerCase()===".tsx"){let n=await t.readFile(e);if(n)return UFe(t,e,n)}return null}function UFe(t,e,r){let n=Ht(t,r);return oy(t,null,e,n)}async function oy(t,e,r,n){r=t.normalize(r);let i=[],s=Ml(t,n);return await Promise.all(s.map(async o=>{let a=await GFe(t,e,r,o);a&&i.push(a)})),i}async function GFe(t,e,r,n){let i=t.relative(t.getAppRootDir(),r),s=fr(t,r);if(t.ts.isVariableStatement(n.node))for(let o of n.node.declarationList.declarations){let a=r9(t,o.initializer);if(a&&t.ts.isIdentifier(o.name)){let A=o.name.text;return{cmpInfo:{id:await ur(t,r,A),displayFilePath:er(t,r),name:dr(A),inputs:[],exportName:n.isDefaultExport?"default":A,exportType:n.isDefaultExport?"default":"named",importName:A,filePath:r,relFilePath:i,importPath:s,framework:"qwik"},node:a}}}else if(t.ts.isCallExpression(n.node)){let o=r9(t,n.node);if(o)return{cmpInfo:{id:await ur(t,r,"default"),displayFilePath:er(t,r),name:Us(t,r),inputs:[],exportName:"default",exportType:"default",importName:xl(t,r),filePath:r,relFilePath:i,importPath:s,framework:"qwik"},node:o}}return null}function r9(t,e){if(e&&t.ts.isCallExpression(e)&&t.ts.isIdentifier(e.expression)&&e.expression.text==="component$"&&e.arguments.length>0){let r=e.arguments[0];if(t.ts.isArrowFunction(r)||t.ts.isFunctionExpression(r))return{callExpression:e,fnNode:r}}return null}var OFe,ay=L(()=>{"use strict";h();_r();Qt();Rp();OFe=new Set(["node_modules","layout.tsx","404.tsx","router-head.tsx"])});async function s9(t,e){let r=e.node.fnNode;if((t.ts.isArrowFunction(r)||t.ts.isFunctionExpression(r))&&r.parameters.length>0){let{sourceFile:i,typeChecker:s}=await xp(t,e.cmpInfo.filePath,null);if(!(await oy(t,s,e.cmpInfo.filePath,i)).find(A=>A.cmpInfo.id===e.cmpInfo.id))throw new Error(`createComponentInputs() Could not find component ${e.cmpInfo.name} in ${e.cmpInfo.filePath}`);return Tl(t,s,r)}return[]}var o9=L(()=>{"use strict";h();ay();Gs();lm()});async function a9(t){return rk(t)}async function rk(t){let e=[];return await t.exists(t.registryPath)||(await t.writeFile(t.registryPath,KFe),e.push({filePath:t.registryPath,modifiedType:"create"})),e}var KFe,nk=L(()=>{"use strict";h();KFe=`import type { RegisteredComponent } from "@builder.io/sdk-qwik";
|
|
466
466
|
|
|
467
467
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
468
468
|
];
|
|
469
|
-
`});async function AY(t){await rk(t);let e=await t.readFile(t.registryPath);return e?HFe(t,e):{components:[],sourceFile:Ht(t,"")}}async function HFe(t,e){let r=Ht(t,e);return JFe(t,r)}async function JFe(t,e){let r=[],n=An(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await ik(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:qi(r)}}async function ik(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"qwik"};for(let i of r.properties){if(!t.ts.isPropertyAssignment(i)||!t.ts.isIdentifier(i.name))continue;if(sr(t,i)==="component"&&t.ts.isIdentifier(i.initializer)){let o=i.initializer.text;n.name===""&&(n.name=dr(o)),n.importName=o;let a=await wa(t,t.registryPath,e,o);if(!a)continue;n.filePath=a.filePath,n.relFilePath=a.relFilePath,n.importPath=fr(t,a.filePath),n.displayFilePath=a.displayFilePath,n.exportType=a.exportType;let A=await iY(t,a.filePath);if(A&&A.length>0)if(A.length===1)n.exportName=A[0].cmpInfo.exportName;else{let c=A.find(u=>u.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}continue}}return n=Vi(t,n,r),n.filePath&&n.exportName&&(n.id=await ur(t,n.filePath,n.exportName)),n}var sk=L(()=>{"use strict";h();_r();Wi();Qt();ay();Da();xi();nk()});async function cY(t){let e=new Set,r=async i=>{let s=await t.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=t.join(i,o),A=t.extname(o).toLowerCase();if(A===".tsx"||A===".ts"){e.add(a);return}(await t.stat(a)).isDirectory()&&await r(a)}))};return await r(t.getAppRootDir()),await fn(t,[...e])}var uY=L(()=>{"use strict";h();Gs()});async function Ll(t,e,r,n,i,s,o,a){let A=await cY(t),[c,u,l]=await Promise.all([nY(t,A),AY(t),dm(t)]),d=c.map(f=>f.cmpInfo),g=u.components,p={components:Lo(d,g),registryPath:t.registryPath,registryDisplayPath:er(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Hs(d),publicApiKey:l.envValue??void 0,devToolsVersion:t.version};if(a)return p;if(e!=null){let f=c.find(S=>S.cmpInfo.id===e);if(!f)throw new Error(`Component ${e} not found`);let m=u.sourceFile,C=p.components.find(S=>S.id===e),I=await sY(t,f);Es(C,I),e=Array.isArray(e)?e[0]:e;let B=xa(e,d,g,r,n,i,s),{elements:E,elmIndex:y,statementIndex:Q,statement:w,variableDeclaration:D}=await jFe(t,m,f),x=!1;if(B.addCmpToRegistry?(E.push(YFe(t,B.addCmpToRegistry)),x=!0):B.removeCmpFromRegistry?(E.splice(y,1),x=!0):B.updateRegisteredCmp&&(E[y]=hn(t,E[y],B.updateRegisteredCmp),x=!0),x&&o){let S=[...m.statements];S[Q]=t.ts.factory.updateVariableStatement(w,w.modifiers,t.ts.factory.updateVariableDeclarationList(w.declarationList,[t.ts.factory.updateVariableDeclaration(D,D.name,D.exclamationToken,D.type,t.ts.factory.createArrayLiteralExpression(Sa(t,E)))])),m=t.ts.factory.updateSourceFile(m,S),C.exportType==="named"?m=qt(t,m,{namedImports:[C.importName],importPath:Jt(t,t.registryPath,C.filePath)}):m=qt(t,m,{defaultImport:C.importName,importPath:Jt(t,t.registryPath,C.filePath)}),m=qt(t,m,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),m=Fa(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m=va(t,m),m=ba(t,m);let v=vn(t,m);v=Po(v),v=eY(v,qFe,"CUSTOM_COMPONENTS"),v=await t.formatCode(t.registryPath,v),await t.writeFile(t.registryPath,v)}p.components=B.components}return p}function YFe(t,e){return hn(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("component",t.ts.factory.createIdentifier(e.importName))],!0),e)}async function jFe(t,e,r){let n=An(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await ik(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var qFe,lY=L(()=>{"use strict";h();tY();Mo();Gp();Wi();Qt();ay();Up();Pl();oY();sk();sk();_p();_r();xi();uY();jc();tk();qFe=["This array is used to integrate custom components within Builder.","https://www.builder.io/c/docs/custom-components-intro","",'These components will be found the "Custom Components"',"section of Builder's visual editor.",'You can also turn on "components only mode" to limit',"editing to only these components.","https://www.builder.io/c/docs/guides/components-only-mode"]});async function gY(t){let e=await $Fe(t);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>aY(e),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>e.registryPath,getRegistry:n=>Ll(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{},loadComponent:async n=>{let i=await Ll(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Ll(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Ll(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Ll(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Ll(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>dm(e),setPublicApiKey:n=>X9(e,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>Os(e),setCache:n=>Ks(e,n)}}async function $Fe(t){let e=await im(t,t.getAppRootDir(),"components");if(!e)throw new Error(`Could not find components directory within project: ${t.getAppRootDir()}`);let r=await $i(t,e),n=t.join(t.getAppRootDir(),".env");return{...t,componentsDir:e,registryPath:r,envPath:n}}var pY=L(()=>{"use strict";h();Rl();tk();lY();nk();gi()});async function fm(t){return await Ba(t,[".env"],hm)}async function dY(t,e){let r=await fm(t),n=await ya(t,r.file,r.envKey,e);return{...r,modifiedType:n}}var hm,Ay=L(()=>{"use strict";h();Nl();hm="PUBLIC_BUILDER_KEY"});async function fY(t,e){let r=[],n=e.getSourceFiles(),i=e.getTypeChecker(),s=t.join(t.getAppRootDir(),"build");return await Promise.all(n.map(async o=>{let a=t.basename(o.fileName);if(a.startsWith(".")||a==="node_modules"||ty(t,VFe,o.fileName)||WFe.has(a)||a.includes("$."))return;let A=t.normalize(o.fileName);if(A===t.remixConfigPath||A===s)return;let c=await qc(t,i,A,o,A===t.registryPath);r.push(...c)})),r}var VFe,WFe,hY=L(()=>{"use strict";h();$c();Qt();VFe=new Set(["dist","node_modules"]);WFe=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"])});async function mY(t){await cy(t);let e=await t.readFile(t.registryPath);return e?zFe(t,e):{components:[],sourceFile:Ht(t,"")}}async function zFe(t,e){let r=Ht(t,e);return XFe(t,r)}async function XFe(t,e){let r=[],n=An(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await ok(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:qi(r)}}async function ok(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};t.sdkVersion===Ze.gen2&&kp(t,r)&&(n.acceptsChildren=!0);for(let i of r.properties){if(!t.ts.isPropertyAssignment(i)||!t.ts.isIdentifier(i.name))continue;if(sr(t,i)==="component"){let o,{initializer:a}=i;if(t.ts.isIdentifier(a))o=a.text;else if(t.ts.isCallExpression(a)){(t.ts.isIdentifier(a.expression)&&a.expression.text)==="withChildren"&&(n.acceptsChildren=!0);let u=a.arguments[0];t.ts.isIdentifier(u)&&(o=u.text)}if(!o)continue;n.name===""&&(n.name=dr(o)),n.importName=o;let A=await wa(t,t.registryPath,e,o);if(!A)continue;if(n.filePath=A.filePath,n.relFilePath=A.relFilePath,await t.exists(A.filePath)?n.importPath=fr(t,A.filePath):(n.externalImportPath=A.importPath,n.importPath=n.externalImportPath),n.displayFilePath=A.displayFilePath,n.exportType=A.exportType,n.externalImportPath)n.exportName=o;else{let c=await S9(t,A.filePath,t.registryPath===A.filePath||_s(A.filePath));if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let u=c.find(l=>l.cmpInfo.exportName===o);u&&(n.exportName=u.cmpInfo.exportName)}}continue}}return n=Vi(t,n,r),n.filePath&&n.exportName&&(n.id=await ur(t,n.filePath,n.exportName,n.externalImportPath)),n}var CY=L(()=>{"use strict";h();xn();_r();Wi();Qt();Da();xi();ak();$c()});async function Ra(t,e,r,n,i,s,o,a){let A=await Vc(t),[c,u,l]=await Promise.all([fY(t,A),mY(t),fm(t)]),d=c.map(I=>I.cmpInfo),g=u.components,p={components:Lo(d,g),registryPath:t.registryPath,registryDisplayPath:er(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Hs(d),publicApiKey:l.envValue??void 0,devToolsVersion:t.version};if(a)return p.components=await Mp(t,p.components),p;let f=!1,m=u.sourceFile,C=Array.isArray(e)?e:typeof e=="string"?[e]:[];if(C.length>0){let I=C.map(y=>{let Q=c.find(w=>w.cmpInfo.id===y);if(!Q)throw new Error(`Component ${y} not found`);return Q}),B=Array.from(new Set(I.map(y=>y.cmpInfo.filePath))),E=await fn(t,B);for(let y of I){let Q=p.components.find(M=>M.id===y.cmpInfo.id),w=await Pp(t,y,E,t.registryPath===y.cmpInfo.filePath||_s(y.cmpInfo.filePath));Es(Q,w);let D=d.findIndex(M=>M.id===y.cmpInfo.id);d[D].inputs=w;let x=xa(y.cmpInfo.id,d,g,r,n,i,s),{elements:S,elmIndex:v,statementIndex:P,statement:$,variableDeclaration:H}=await eke(t,m,y);if(x.addCmpToRegistry)S.push(ZFe(t,x.addCmpToRegistry)),f=!0;else if(x.removeCmpFromRegistry)S.splice(v,1),f=!0;else if(x.updateRegisteredCmp){let M=hn(t,S[v],x.updateRegisteredCmp);S[v]=t.ts.factory.updateObjectLiteralExpression(M,[IY(t,x.updateRegisteredCmp),...M.properties.slice(1)]),f=!0}if(f&&o){let M=[...m.statements];M[P]=t.ts.factory.updateVariableStatement($,$.modifiers,t.ts.factory.updateVariableDeclarationList($.declarationList,[t.ts.factory.updateVariableDeclaration(H,H.name,H.exclamationToken,H.type,t.ts.factory.createArrayLiteralExpression(Sa(t,S)))])),m=t.ts.factory.updateSourceFile(m,M),Q.exportType==="named"?m=qt(t,m,{namedImports:[Q.importName],importPath:Q.externalImportPath?Q.externalImportPath:Jt(t,t.registryPath,Q.filePath)}):m=qt(t,m,{defaultImport:Q.importName,importPath:Q.externalImportPath?Q.externalImportPath:Jt(t,t.registryPath,Q.filePath)});let G=t.sdkVersion===Ze.gen2?"@builder.io/sdk-react":"@builder.io/react";m=qt(t,m,{namedImports:["RegisteredComponent"],importPath:G,isTypeOnly:!0}),Q.acceptsChildren&&t.sdkVersion!==Ze.gen2&&(m=qt(t,m,{namedImports:["withChildren"],importPath:"@builder.io/react"})),m=Fa(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),p.components=x.components,g=x.components.filter(Y=>Y.isRegistered)}}}if(f&&o){m=va(t,m),m=ba(t,m);let I=vn(t,m);I=Po(I),I=await t.formatCode(t.registryPath,I),await t.writeFile(t.registryPath,I)}return p}function IY(t,e){if(t.sdkVersion===Ze.gen2)return t.ts.factory.createPropertyAssignment("component",t.ts.factory.createIdentifier(e.importName));let r=t.ts.factory.createIdentifier(e.importName),n=e.acceptsChildren?t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("withChildren"),void 0,[r]):r;return t.ts.factory.createPropertyAssignment("component",n)}function ZFe(t,e){return hn(t,t.ts.factory.createObjectLiteralExpression([IY(t,e),...e.acceptsChildren&&t.sdkVersion===Ze.gen2?[t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())]:[]],!0),e)}async function eke(t,e,r){let n=An(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await ok(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var Ak=L(()=>{"use strict";h();xn();Gs();Mo();_r();hY();Qt();Pl();CY();_p();Up();xi();$c();Wi();Gp();pm();jc();Ay()});async function EY(t){let e=[],r=await nke(t,e);return e.push(...await cy(t)),await ske(t,r),await rke(t,e),e}async function BY(t){let e=[];return e.push(...await cy(t)),await tke(t,e),e}async function tke(t,e){let r=`figma-imports.${t.typescriptEnabled?"tsx":"jsx"}`;t.hasLocaleParam&&(t.debug("remixEnsureFigmaImportRoute, hasLocaleParam"),r=`($locale).${r}`);let n=t.join(t.routesDir,r),i=await t.exists(n);t.debug(`remixEnsureFigmaImportRoute, hasRoute: ${i}`);let s=await t.formatCode(n,yY({sys:t,routePath:n,modelName:"figma-imports"}));await t.writeFile(n,s),e.push({filePath:n,modifiedType:i?"update":"create"})}async function rke(t,e){let r=`$.${t.typescriptEnabled?"tsx":"jsx"}`;t.hasLocaleParam&&(t.debug("remixEnsureAppRoute, hasLocaleParam"),r=`($locale).${r}`),t.sdkVersion===Ze.gen2&&(r=`($slug)._index.${t.typescriptEnabled?"tsx":"jsx"}`);let n=t.join(t.routesDir,r),i=await t.exists(n);t.debug(`remixEnsureAppRoute, hasRoute: ${i}`);let s=await t.formatCode(n,yY({sys:t,routePath:n,modelName:"page"}));await t.writeFile(n,s),e.push({filePath:n,modifiedType:i?"update":"create"})}function yY({sys:t,routePath:e,modelName:r}){let n=t.typescriptEnabled,i=Jt(t,e,t.registryPath),s="",o="";n&&(s="import type { LoaderArgs } from '@remix-run/server-runtime';",o=": LoaderArgs");let a=`process.env.${hm}`,A="";return t.getFrameworks().some(c=>c.name==="@shopify/remix-oxygen")&&(a=`context.env.${hm}`,A=", context"),n&&(a+="!"),t.sdkVersion===Ze.gen2?`
|
|
469
|
+
`});async function A9(t){await rk(t);let e=await t.readFile(t.registryPath);return e?HFe(t,e):{components:[],sourceFile:Ht(t,"")}}async function HFe(t,e){let r=Ht(t,e);return JFe(t,r)}async function JFe(t,e){let r=[],n=An(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await ik(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:qi(r)}}async function ik(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"qwik"};for(let i of r.properties){if(!t.ts.isPropertyAssignment(i)||!t.ts.isIdentifier(i.name))continue;if(sr(t,i)==="component"&&t.ts.isIdentifier(i.initializer)){let o=i.initializer.text;n.name===""&&(n.name=dr(o)),n.importName=o;let a=await wa(t,t.registryPath,e,o);if(!a)continue;n.filePath=a.filePath,n.relFilePath=a.relFilePath,n.importPath=fr(t,a.filePath),n.displayFilePath=a.displayFilePath,n.exportType=a.exportType;let A=await i9(t,a.filePath);if(A&&A.length>0)if(A.length===1)n.exportName=A[0].cmpInfo.exportName;else{let c=A.find(u=>u.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}continue}}return n=Vi(t,n,r),n.filePath&&n.exportName&&(n.id=await ur(t,n.filePath,n.exportName)),n}var sk=L(()=>{"use strict";h();_r();Wi();Qt();ay();Da();xi();nk()});async function c9(t){let e=new Set,r=async i=>{let s=await t.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=t.join(i,o),A=t.extname(o).toLowerCase();if(A===".tsx"||A===".ts"){e.add(a);return}(await t.stat(a)).isDirectory()&&await r(a)}))};return await r(t.getAppRootDir()),await fn(t,[...e])}var u9=L(()=>{"use strict";h();Gs()});async function Ll(t,e,r,n,i,s,o,a){let A=await c9(t),[c,u,l]=await Promise.all([n9(t,A),A9(t),dm(t)]),d=c.map(f=>f.cmpInfo),g=u.components,p={components:Lo(d,g),registryPath:t.registryPath,registryDisplayPath:er(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Hs(d),publicApiKey:l.envValue??void 0,devToolsVersion:t.version};if(a)return p;if(e!=null){let f=c.find(S=>S.cmpInfo.id===e);if(!f)throw new Error(`Component ${e} not found`);let m=u.sourceFile,C=p.components.find(S=>S.id===e),I=await s9(t,f);Es(C,I),e=Array.isArray(e)?e[0]:e;let B=xa(e,d,g,r,n,i,s),{elements:E,elmIndex:y,statementIndex:Q,statement:w,variableDeclaration:D}=await jFe(t,m,f),x=!1;if(B.addCmpToRegistry?(E.push(YFe(t,B.addCmpToRegistry)),x=!0):B.removeCmpFromRegistry?(E.splice(y,1),x=!0):B.updateRegisteredCmp&&(E[y]=hn(t,E[y],B.updateRegisteredCmp),x=!0),x&&o){let S=[...m.statements];S[Q]=t.ts.factory.updateVariableStatement(w,w.modifiers,t.ts.factory.updateVariableDeclarationList(w.declarationList,[t.ts.factory.updateVariableDeclaration(D,D.name,D.exclamationToken,D.type,t.ts.factory.createArrayLiteralExpression(Sa(t,E)))])),m=t.ts.factory.updateSourceFile(m,S),C.exportType==="named"?m=qt(t,m,{namedImports:[C.importName],importPath:Jt(t,t.registryPath,C.filePath)}):m=qt(t,m,{defaultImport:C.importName,importPath:Jt(t,t.registryPath,C.filePath)}),m=qt(t,m,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),m=Fa(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m=va(t,m),m=ba(t,m);let v=vn(t,m);v=Po(v),v=e9(v,qFe,"CUSTOM_COMPONENTS"),v=await t.formatCode(t.registryPath,v),await t.writeFile(t.registryPath,v)}p.components=B.components}return p}function YFe(t,e){return hn(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("component",t.ts.factory.createIdentifier(e.importName))],!0),e)}async function jFe(t,e,r){let n=An(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await ik(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var qFe,l9=L(()=>{"use strict";h();t9();Mo();Gp();Wi();Qt();ay();Up();Pl();o9();sk();sk();_p();_r();xi();u9();jc();tk();qFe=["This array is used to integrate custom components within Builder.","https://www.builder.io/c/docs/custom-components-intro","",'These components will be found the "Custom Components"',"section of Builder's visual editor.",'You can also turn on "components only mode" to limit',"editing to only these components.","https://www.builder.io/c/docs/guides/components-only-mode"]});async function g9(t){let e=await $Fe(t);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>a9(e),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>e.registryPath,getRegistry:n=>Ll(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{},loadComponent:async n=>{let i=await Ll(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Ll(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Ll(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Ll(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Ll(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>dm(e),setPublicApiKey:n=>XY(e,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>Os(e),setCache:n=>Ks(e,n)}}async function $Fe(t){let e=await im(t,t.getAppRootDir(),"components");if(!e)throw new Error(`Could not find components directory within project: ${t.getAppRootDir()}`);let r=await $i(t,e),n=t.join(t.getAppRootDir(),".env");return{...t,componentsDir:e,registryPath:r,envPath:n}}var p9=L(()=>{"use strict";h();Rl();tk();l9();nk();gi()});async function fm(t){return await Ba(t,[".env"],hm)}async function d9(t,e){let r=await fm(t),n=await ya(t,r.file,r.envKey,e);return{...r,modifiedType:n}}var hm,Ay=L(()=>{"use strict";h();Nl();hm="PUBLIC_BUILDER_KEY"});async function f9(t,e){let r=[],n=e.getSourceFiles(),i=e.getTypeChecker(),s=t.join(t.getAppRootDir(),"build");return await Promise.all(n.map(async o=>{let a=t.basename(o.fileName);if(a.startsWith(".")||a==="node_modules"||ty(t,VFe,o.fileName)||WFe.has(a)||a.includes("$."))return;let A=t.normalize(o.fileName);if(A===t.remixConfigPath||A===s)return;let c=await qc(t,i,A,o,A===t.registryPath);r.push(...c)})),r}var VFe,WFe,h9=L(()=>{"use strict";h();$c();Qt();VFe=new Set(["dist","node_modules"]);WFe=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"])});async function m9(t){await cy(t);let e=await t.readFile(t.registryPath);return e?zFe(t,e):{components:[],sourceFile:Ht(t,"")}}async function zFe(t,e){let r=Ht(t,e);return XFe(t,r)}async function XFe(t,e){let r=[],n=An(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await ok(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:qi(r)}}async function ok(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};t.sdkVersion===Ze.gen2&&kp(t,r)&&(n.acceptsChildren=!0);for(let i of r.properties){if(!t.ts.isPropertyAssignment(i)||!t.ts.isIdentifier(i.name))continue;if(sr(t,i)==="component"){let o,{initializer:a}=i;if(t.ts.isIdentifier(a))o=a.text;else if(t.ts.isCallExpression(a)){(t.ts.isIdentifier(a.expression)&&a.expression.text)==="withChildren"&&(n.acceptsChildren=!0);let u=a.arguments[0];t.ts.isIdentifier(u)&&(o=u.text)}if(!o)continue;n.name===""&&(n.name=dr(o)),n.importName=o;let A=await wa(t,t.registryPath,e,o);if(!A)continue;if(n.filePath=A.filePath,n.relFilePath=A.relFilePath,await t.exists(A.filePath)?n.importPath=fr(t,A.filePath):(n.externalImportPath=A.importPath,n.importPath=n.externalImportPath),n.displayFilePath=A.displayFilePath,n.exportType=A.exportType,n.externalImportPath)n.exportName=o;else{let c=await SY(t,A.filePath,t.registryPath===A.filePath||_s(A.filePath));if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let u=c.find(l=>l.cmpInfo.exportName===o);u&&(n.exportName=u.cmpInfo.exportName)}}continue}}return n=Vi(t,n,r),n.filePath&&n.exportName&&(n.id=await ur(t,n.filePath,n.exportName,n.externalImportPath)),n}var C9=L(()=>{"use strict";h();xn();_r();Wi();Qt();Da();xi();ak();$c()});async function Ra(t,e,r,n,i,s,o,a){let A=await Vc(t),[c,u,l]=await Promise.all([f9(t,A),m9(t),fm(t)]),d=c.map(I=>I.cmpInfo),g=u.components,p={components:Lo(d,g),registryPath:t.registryPath,registryDisplayPath:er(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Hs(d),publicApiKey:l.envValue??void 0,devToolsVersion:t.version};if(a)return p.components=await Mp(t,p.components),p;let f=!1,m=u.sourceFile,C=Array.isArray(e)?e:typeof e=="string"?[e]:[];if(C.length>0){let I=C.map(y=>{let Q=c.find(w=>w.cmpInfo.id===y);if(!Q)throw new Error(`Component ${y} not found`);return Q}),B=Array.from(new Set(I.map(y=>y.cmpInfo.filePath))),E=await fn(t,B);for(let y of I){let Q=p.components.find(M=>M.id===y.cmpInfo.id),w=await Pp(t,y,E,t.registryPath===y.cmpInfo.filePath||_s(y.cmpInfo.filePath));Es(Q,w);let D=d.findIndex(M=>M.id===y.cmpInfo.id);d[D].inputs=w;let x=xa(y.cmpInfo.id,d,g,r,n,i,s),{elements:S,elmIndex:v,statementIndex:P,statement:$,variableDeclaration:H}=await eke(t,m,y);if(x.addCmpToRegistry)S.push(ZFe(t,x.addCmpToRegistry)),f=!0;else if(x.removeCmpFromRegistry)S.splice(v,1),f=!0;else if(x.updateRegisteredCmp){let M=hn(t,S[v],x.updateRegisteredCmp);S[v]=t.ts.factory.updateObjectLiteralExpression(M,[I9(t,x.updateRegisteredCmp),...M.properties.slice(1)]),f=!0}if(f&&o){let M=[...m.statements];M[P]=t.ts.factory.updateVariableStatement($,$.modifiers,t.ts.factory.updateVariableDeclarationList($.declarationList,[t.ts.factory.updateVariableDeclaration(H,H.name,H.exclamationToken,H.type,t.ts.factory.createArrayLiteralExpression(Sa(t,S)))])),m=t.ts.factory.updateSourceFile(m,M),Q.exportType==="named"?m=qt(t,m,{namedImports:[Q.importName],importPath:Q.externalImportPath?Q.externalImportPath:Jt(t,t.registryPath,Q.filePath)}):m=qt(t,m,{defaultImport:Q.importName,importPath:Q.externalImportPath?Q.externalImportPath:Jt(t,t.registryPath,Q.filePath)});let G=t.sdkVersion===Ze.gen2?"@builder.io/sdk-react":"@builder.io/react";m=qt(t,m,{namedImports:["RegisteredComponent"],importPath:G,isTypeOnly:!0}),Q.acceptsChildren&&t.sdkVersion!==Ze.gen2&&(m=qt(t,m,{namedImports:["withChildren"],importPath:"@builder.io/react"})),m=Fa(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),p.components=x.components,g=x.components.filter(Y=>Y.isRegistered)}}}if(f&&o){m=va(t,m),m=ba(t,m);let I=vn(t,m);I=Po(I),I=await t.formatCode(t.registryPath,I),await t.writeFile(t.registryPath,I)}return p}function I9(t,e){if(t.sdkVersion===Ze.gen2)return t.ts.factory.createPropertyAssignment("component",t.ts.factory.createIdentifier(e.importName));let r=t.ts.factory.createIdentifier(e.importName),n=e.acceptsChildren?t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("withChildren"),void 0,[r]):r;return t.ts.factory.createPropertyAssignment("component",n)}function ZFe(t,e){return hn(t,t.ts.factory.createObjectLiteralExpression([I9(t,e),...e.acceptsChildren&&t.sdkVersion===Ze.gen2?[t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())]:[]],!0),e)}async function eke(t,e,r){let n=An(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await ok(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var Ak=L(()=>{"use strict";h();xn();Gs();Mo();_r();h9();Qt();Pl();C9();_p();Up();xi();$c();Wi();Gp();pm();jc();Ay()});async function E9(t){let e=[],r=await nke(t,e);return e.push(...await cy(t)),await ske(t,r),await rke(t,e),e}async function B9(t){let e=[];return e.push(...await cy(t)),await tke(t,e),e}async function tke(t,e){let r=`figma-imports.${t.typescriptEnabled?"tsx":"jsx"}`;t.hasLocaleParam&&(t.debug("remixEnsureFigmaImportRoute, hasLocaleParam"),r=`($locale).${r}`);let n=t.join(t.routesDir,r),i=await t.exists(n);t.debug(`remixEnsureFigmaImportRoute, hasRoute: ${i}`);let s=await t.formatCode(n,y9({sys:t,routePath:n,modelName:"figma-imports"}));await t.writeFile(n,s),e.push({filePath:n,modifiedType:i?"update":"create"})}async function rke(t,e){let r=`$.${t.typescriptEnabled?"tsx":"jsx"}`;t.hasLocaleParam&&(t.debug("remixEnsureAppRoute, hasLocaleParam"),r=`($locale).${r}`),t.sdkVersion===Ze.gen2&&(r=`($slug)._index.${t.typescriptEnabled?"tsx":"jsx"}`);let n=t.join(t.routesDir,r),i=await t.exists(n);t.debug(`remixEnsureAppRoute, hasRoute: ${i}`);let s=await t.formatCode(n,y9({sys:t,routePath:n,modelName:"page"}));await t.writeFile(n,s),e.push({filePath:n,modifiedType:i?"update":"create"})}function y9({sys:t,routePath:e,modelName:r}){let n=t.typescriptEnabled,i=Jt(t,e,t.registryPath),s="",o="";n&&(s="import type { LoaderArgs } from '@remix-run/server-runtime';",o=": LoaderArgs");let a=`process.env.${hm}`,A="";return t.getFrameworks().some(c=>c.name==="@shopify/remix-oxygen")&&(a=`context.env.${hm}`,A=", context"),n&&(a+="!"),t.sdkVersion===Ze.gen2?`
|
|
470
470
|
|
|
471
471
|
import {
|
|
472
472
|
Content,
|
|
@@ -644,12 +644,12 @@ export default Counter;
|
|
|
644
644
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
645
645
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
646
646
|
];
|
|
647
|
-
`}var ak=L(()=>{"use strict";h();xn();Ak();Ay();Qt()});async function
|
|
647
|
+
`}var ak=L(()=>{"use strict";h();xn();Ak();Ay();Qt()});async function Q9(t){let e=await ake(t);return{builderPageOptions:async()=>{let n="/builder-demo",i=e.hasLocaleParam?`/en-us${n}`:void 0;return{templateContentId:"a5c9eef7909d4fc99554264a17de22c9",pathname:n,localePathname:i,title:"Builder + Remix Demo Page"}},ensureBuilderSetup:()=>E9(e),ensureFigmaImportPage:()=>B9(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Ra(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Ra(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Ra(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Ra(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Ra(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Ra(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>fm(e),setPublicApiKey:n=>d9(e,n.publicApiKey),getDependencies:n=>n.sdkVersion===Ze.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Os(e),setCache:n=>Ks(e,n)}}async function ake(t){let e=await cke(t),r=t.getAppRootDir(),n=await uke(t),i=t.dirname(n),s=t.join(i,"components"),o=await vi(t),a=await $i(t,i),A={},c={...t,registryPath:a,remixConfigPath:e,typescriptEnabled:o,appDir:i,componentsDir:s,routesDir:n,hasLocaleParam:await Ake(t,n),addExternalPackage:u=>{A[t.join(r,u,"index.ts")]=`export * from "${u}";`},readFileSync:u=>A[u]??t.readFileSync(u),existsSync:u=>!!A[u]||t.existsSync(u),readdirSync:u=>{let l=t.readdirSync(u);return u===r?[...l,...Object.keys(A).map(d=>d.slice(r.length+1))]:l},readdir:async u=>{let l=await t.readdir(u);return u===r?[...l,...Object.keys(A).map(d=>d.slice(r.length+1))]:l}};return t.sdkVersion?c.sdkVersion=t.sdkVersion:c.sdkVersion=await Op(c),c}async function Ake(t,e){return(await t.readdir(e)).some(n=>n.startsWith("($locale)."))}async function cke(t){let e=["remix.config.ts","remix.config.js","vite.config.ts","vite.config.js"];for(let r of e){let n=t.join(t.getAppRootDir(),r);if(await t.exists(n))return n}if(t.ignoreMissingConfig)return"";throw new Error(`Could not find Remix config file. Searched for ${e.join(", ")} in "${t.getAppRootDir()}".`)}async function uke(t){let e=await im(t,t.getAppRootDir(),"routes");if(e)return e;throw new Error(`Could not find Remix "routes" directory in "${t.getAppRootDir()}". Please ensure this command is ran from within your Remix project's directory.`)}var D9=L(()=>{"use strict";h();Rl();Ay();gi();ak();Ak();xn();sy()});async function mm(t){let e=[".env"],r=t.configType==="vite"?Cm:uy;return await Ba(t,e,r)}async function w9(t,e){let r=await mm(t),n=await ya(t,r.file,r.envKey,e);return{...r,modifiedType:n}}var Cm,uy,Im=L(()=>{"use strict";h();Nl();Cm="VITE_PUBLIC_BUILDER_KEY",uy="PUBLIC_BUILDER_KEY"});function b9(t,e){let r=`Builder.registerComponent(
|
|
648
648
|
`;r+=` ${e.importName},
|
|
649
649
|
`,r+=` {
|
|
650
650
|
name: "${e.name}",
|
|
651
651
|
}
|
|
652
|
-
`,r+=");";let n=ey(t,r);return ck(t,n,e)}function ck(t,e,r){if(!t.ts.isExpressionStatement(e))return e;let n=e.expression;if(!t.ts.isCallExpression(n))return e;let i=[...n.arguments];if(i.length<2)return e;let s=i[1];return t.ts.isObjectLiteralExpression(s)?(i[1]=hn(t,s,r),t.ts.factory.updateExpressionStatement(e,t.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):e}var
|
|
652
|
+
`,r+=");";let n=ey(t,r);return ck(t,n,e)}function ck(t,e,r){if(!t.ts.isExpressionStatement(e))return e;let n=e.expression;if(!t.ts.isCallExpression(n))return e;let i=[...n.arguments];if(i.length<2)return e;let s=i[1];return t.ts.isObjectLiteralExpression(s)?(i[1]=hn(t,s,r),t.ts.factory.updateExpressionStatement(e,t.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):e}var S9=L(()=>{"use strict";h();_r();xi()});async function v9(t){let e=await t.readFile(t.registryPath);return e?lke(t,e):{components:[],sourceFile:Ht(t,"")}}async function lke(t,e){let r=Ht(t,e);return t.sdkVersion===Ze.gen2?dke(t,r):gke(t,r)}async function gke(t,e){let r=[];for(let n=0;n<e.statements.length;n++){let i=e.statements[n];if(!t.ts.isExpressionStatement(i))continue;let s=i.expression;if(!t.ts.isCallExpression(s))continue;let o=s.expression;if(!t.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!t.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let u=c[1];if(!t.ts.isObjectLiteralExpression(u))continue;let l=c[0];if(t.ts.isIdentifier(l)){let d=await pke(t,e,n,l,u,!1);d&&r.push(d);continue}}return{sourceFile:e,components:qi(r)}}async function pke(t,e,r,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=e.statements.filter(c=>t.ts.isImportDeclaration(c)),A=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(A){let c=A.moduleSpecifier;if(!t.ts.isStringLiteral(c))return null;o.filePath=await uk(t,c.text),o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),o.importPath=fr(t,o.filePath),o.name=Us(t,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!t.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(g=>g.name.text===n.text));if(!c)return null;let u=c.moduleSpecifier;if(!t.ts.isStringLiteral(u))return null;let l=await uk(t,u.text);o.filePath=await uk(t,u.text),o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(l)?o.importPath=fr(t,o.filePath):(o.externalImportPath=u.text,o.importPath=o.externalImportPath),o.name=dr(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=Vi(t,o,i),o.displayFilePath=er(t,o.filePath),o.filePath&&o.exportName&&(o.id=await ur(t,o.filePath,o.exportName,o.externalImportPath)),o}function uk(t,e){return gm(t,t.normalize(t.resolve(t.dirname(t.registryPath),e)))}async function dke(t,e){let r=[],n=An(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await lk(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:qi(r)}}async function lk(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};kp(t,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!t.ts.isPropertyAssignment(s)||!t.ts.isIdentifier(s.name))continue;if(sr(t,s)==="component"){let a,{initializer:A}=s;if(t.ts.isIdentifier(A)&&(a=A.text),!a)continue;n.name===""&&(n.name=dr(a)),n.importName=a;let c=await wa(t,t.registryPath,e,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await t.exists(c.filePath)?n.importPath=fr(t,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let u=e.statements.filter(d=>t.ts.isImportDeclaration(d)),l=u.find(d=>d.importClause&&d.importClause.name?.text===a);if(l){let d=l.moduleSpecifier;if(!t.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=u.find(p=>!p.importClause||!p.importClause.namedBindings||!t.ts.isNamedImports(p.importClause.namedBindings)?!1:p.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let g=d.moduleSpecifier;if(!t.ts.isStringLiteral(g))return null;n.exportName=a}continue}}return n=Vi(t,n,r),n.filePath&&n.exportName&&(n.id=await ur(t,n.filePath,n.exportName,n.externalImportPath)),n}var x9=L(()=>{"use strict";h();xn();_r();Wi();Qt();Da();xi();Im()});async function Na(t,e,r,n,i,s,o,a){let A=await Vc(t),[c,u,l,d]=await Promise.all([vY(t,A),v9(t),vi(t),mm(t)]),g=c.map(B=>B.cmpInfo),p=u.components,f={components:Lo(g,p),registryPath:t.registryPath,registryDisplayPath:er(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Hs(g),publicApiKey:d.envValue??void 0,devToolsVersion:t.version};if(a)return f.components=await Mp(t,f.components),f;let m=!1,C=u.sourceFile,I=Array.isArray(e)?e:typeof e=="string"?[e]:[];if(I.length>0){let B=I.map(Q=>{let w=c.find(D=>D.cmpInfo.id===Q);if(!w)throw new Error(`Component ${Q} not found`);return w}),E=Array.from(new Set(B.map(Q=>Q.cmpInfo.filePath))),y=await fn(t,E);for(let Q of B){let w=f.components.find(v=>v.id===Q.cmpInfo.id),D=await Pp(t,Q,y,t.registryPath===Q.cmpInfo.filePath||_s(Q.cmpInfo.filePath));Es(w,D);let x=g.findIndex(v=>v.id===Q.cmpInfo.id);g[x].inputs=D;let S=xa(Q.cmpInfo.id,g,p,r,n,i,s);if(t.sdkVersion===Ze.gen2){let{elements:v,elmIndex:P,statementIndex:$,statement:H,variableDeclaration:M}=await fke(t,C,Q);if(S.addCmpToRegistry)v.push(hke(t,S.addCmpToRegistry)),m=!0;else if(S.removeCmpFromRegistry)v.splice(P,1),m=!0;else if(S.updateRegisteredCmp){let G=hn(t,v[P],S.updateRegisteredCmp),Y=t.ts.factory.createIdentifier(S.updateRegisteredCmp.importName);v[P]=t.ts.factory.updateObjectLiteralExpression(G,[t.ts.factory.createPropertyAssignment("component",Y),...G.properties.slice(1)]),m=!0}if(m&&o){let G=[...C.statements];G[$]=t.ts.factory.updateVariableStatement(H,H.modifiers,t.ts.factory.updateVariableDeclarationList(H.declarationList,[t.ts.factory.updateVariableDeclaration(M,M.name,M.exclamationToken,M.type,t.ts.factory.createArrayLiteralExpression(Sa(t,v)))])),C=t.ts.factory.updateSourceFile(C,G),C=F9(t,S,C),C=qt(t,C,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),C=Fa(t,C,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=S.components,p=S.components.filter(Y=>Y.isRegistered)}}else{let v=[...C.statements];S.addCmpToRegistry?(v.push(b9(t,S.addCmpToRegistry)),m=!0):S.removeCmpFromRegistry?(v.splice(S.nodeIndex,1),m=!0):S.updateRegisteredCmp&&(v[S.nodeIndex]=ck(t,v[S.nodeIndex],S.updateRegisteredCmp),m=!0),m&&o&&(C=t.ts.factory.updateSourceFile(C,v),C=qt(t,C,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),C=F9(t,S,C),w?.acceptsChildren&&(C=qt(t,C,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=S.components,p=S.components.filter(P=>P.isRegistered))}}}if(m&&o){C=va(t,C),C=ba(t,C);let B=vn(t,C);B=Po(B),B=await t.formatCode(t.registryPath,B),await t.writeFile(t.registryPath,B)}return f}async function fke(t,e,r){let n=An(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await lk(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}function hke(t,e){let r=t.ts.factory.createIdentifier(e.importName);return hn(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("component",r),...e.acceptsChildren?[t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())]:[]],!0),e)}function F9(t,e,r){let n=e.addCmpToRegistry||e.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:Jt(t,t.registryPath,n.filePath);n.exportType==="default"?r=qt(t,r,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(r=qt(t,r,{namedImports:[n.importName],importPath:i}))}return r}var gk=L(()=>{"use strict";h();xn();S9();Gs();Mo();_r();Wi();$c();Qt();Pl();x9();$c();_p();Up();xi();pm();jc();Im();Gp();gi()});async function k9(t){let e=[],r=await mke(t,e);if(await T9(t,e,r),!await t.exists(t.builderComponentPath)){let n=await t.formatCode(t.builderComponentPath,N9(t,t.builderComponentPath));await t.writeFile(t.builderComponentPath,n),e.push({filePath:t.builderComponentPath,modifiedType:"create"})}return e}async function R9(t){let e=[];await T9(t,e);let r=`figma-imports.${t.typescriptEnabled?"tsx":"jsx"}`,n=t.join(t.componentsDir,r);if(!await t.exists(n)){let i=await t.formatCode(n,N9(t,n,"figma-imports"));await t.writeFile(n,i),e.push({filePath:n,modifiedType:"create"})}return e}function N9(t,e,r="page"){let n=t.typescriptEnabled;return t.sdkVersion===Ze.gen2?`
|
|
653
653
|
import React from "react";
|
|
654
654
|
import {
|
|
655
655
|
Content,
|
|
@@ -759,7 +759,7 @@ export default function BuilderPage() {
|
|
|
759
759
|
</>
|
|
760
760
|
);
|
|
761
761
|
}
|
|
762
|
-
`.trimStart()}async function
|
|
762
|
+
`.trimStart()}async function T9(t,e,r){if(!await t.exists(t.registryPath)){if(t.sdkVersion===Ze.gen2){let s=Ike(t);await t.writeFile(t.registryPath,s)}else await t.writeFile(t.registryPath,"");e.push({filePath:t.registryPath,modifiedType:"create"})}if(!r)return;let i=(await Na(t,null,!1,!1,null,null,!1,!1)).components.find(s=>s.filePath===r);i&&await Na(t,i.id,!0,!1,null,null,!0,!1)}async function mke(t,e){let n=t.typescriptEnabled?"tsx":"jsx",i=t.join(t.componentsDir,"Counter"),s=t.join(i,`Counter.${n}`),o=t.join(i,"styles.module.css"),{component:a,styles:A}=Cke(t);if(!await t.exists(s)){let c=await t.formatCode(s,a);await t.writeFile(s,c),e.push({filePath:s,modifiedType:"create"})}return await t.exists(o)||(await t.writeFile(o,A),e.push({filePath:o,modifiedType:"create"})),s}function Cke(t){let e=t.typescriptEnabled,r=`
|
|
763
763
|
"use client"
|
|
764
764
|
import React, { useState } from "react";
|
|
765
765
|
import styles from "./styles.module.css";
|
|
@@ -827,21 +827,21 @@ export default Counter;
|
|
|
827
827
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
828
828
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
829
829
|
];
|
|
830
|
-
`}var
|
|
830
|
+
`}var M9=L(()=>{"use strict";h();xn();gk();Qt();Im()});async function pk(t){let e=await Eke(t);return{builderPageOptions:async()=>({templateContentId:"2e36438034894a8abf279ea9e6d3596f",pathname:"/builder-demo",title:"Builder + React Demo Page"}),ensureBuilderSetup:()=>k9(e),ensureFigmaImportPage:()=>R9(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Na(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Na(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Na(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Na(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Na(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Na(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>mm(e),setPublicApiKey:n=>w9(e,n.publicApiKey),getDependencies:n=>n.sdkVersion===Ze.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Os(e),setCache:n=>Ks(e,n)}}async function Eke(t){let e=await Bke(t),r=t.getAppRootDir(),n=t.join(r,"src"),i=await vi(t),s={},o={...t,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",reactConfigPath:e,typescriptEnabled:i,configType:"",addExternalPackage:a=>{s[t.join(r,a,"index.ts")]=`export * from "${a}";`},readFileSync:a=>s[a]??t.readFileSync(a),existsSync:a=>!!s[a]||t.existsSync(a),readdirSync:a=>{let A=t.readdirSync(a);return a===r?[...A,...Object.keys(s).map(c=>c.slice(r.length+1))]:A},readdir:async a=>{let A=await t.readdir(a);return a===r?[...A,...Object.keys(s).map(c=>c.slice(r.length+1))]:A}};return t.sdkVersion?o.sdkVersion=t.sdkVersion:o.sdkVersion=await Op(o),e.includes("webpack.config")&&(o.configType="webpack"),e.includes("vite.config")&&(o.configType="vite"),await t.exists(n)?(o.srcDir=n,o.componentsDir=t.join(n,"components"),o.registryPath=await $i(t,n),o.builderComponentPath=t.join(o.srcDir,`builder-page.${i?"tsx":"jsx"}`)):(o.componentsDir=t.join(r,"components"),o.registryPath=await $i(t,r),o.builderComponentPath=t.join(r,`builder-page.${i?"tsx":"jsx"}`)),o}async function Bke(t){let e=["vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts"];for(let r of e){let n=t.join(t.getAppRootDir(),r);if(await t.exists(n))return n}if(t.ignoreMissingConfig)return"";throw new Error(`Could not find React config file. Searched for ${e.join(", ")} in "${t.getAppRootDir()}".`)}var P9=L(()=>{"use strict";h();Rl();Im();gk();M9();xn();sy();gi()});async function Em(t){return await yke(t,["environment.ts"],ly)}async function L9(t,e){let r=await Em(t),n=await bke(t,r.file,r.envKey,e);return{...r,modifiedType:n}}async function yke(t,e,r){let n={envKey:r,envValue:null,file:""};for(let i of e){let s=t.join(t.getAppRootDir(),"src","environments",i),o=await Qke(t,s);if(typeof o=="string"&&o.length>0&&o!=="YOUR_API_KEY")return n.envValue=o,n.file=s,n}return n.file=t.join(t.getAppRootDir(),"src","environments",e[e.length-1]),n}async function Qke(t,e){let r=await t.readFile(e);return r?Dke(t,r):""}function Dke(t,e){let r=Ht(t,e),n="",s=Np(t,r,"environment");if(s&&s.statement.declarationList.declarations.length>0){let a=s.statement.declarationList.declarations[0].initializer;a&&t.ts.isObjectLiteralExpression(a)&&a.properties.forEach(A=>{t.ts.isPropertyAssignment(A)&&t.ts.isIdentifier(A.name)&&A.name.text===ly&&t.ts.isStringLiteral(A.initializer)&&(n=A.initializer.text)})}return n}async function wke(t,e,r,n){let i=Ht(t,e),o=Np(t,i,"environment");if(o&&o.statement.declarationList.declarations.length>0){let a=o.statement.declarationList,A=a.declarations[0],c=A.initializer;if(c&&t.ts.isObjectLiteralExpression(c)){let u=t.ts.factory.createPropertyAssignment(t.ts.factory.createIdentifier(r),t.ts.factory.createStringLiteral(n)),l=t.ts.factory.createNodeArray([...c.properties,u]),d=t.ts.factory.updateObjectLiteralExpression(c,l),g=t.ts.factory.updateVariableDeclaration(A,A.name,A.exclamationToken,A.type,d),p=t.ts.factory.updateVariableDeclarationList(a,[g]);return t.ts.factory.updateVariableStatement(o.statement,o.statement.modifiers,p)}return null}return null}async function bke(t,e,r,n){let i=await t.readFile(e);if(i)if(i.includes(r))t.debug(`"${r}" already set in ${e}`);else{t.debug(`Add "${r}" to ${e}`);let s=await wke(t,i,r,n);if(s){let o=vn(t,s),a=await t.formatCode(e,o);await t.writeFile(e,a)}return"update"}else{t.debug(`Creating new env file with "${r}" at ${e}`);let s=`
|
|
831
831
|
// https://www.builder.io/c/docs/using-your-api-key
|
|
832
832
|
export const environment = {
|
|
833
833
|
production: false,
|
|
834
834
|
builderApiKey: "${n}",
|
|
835
835
|
};
|
|
836
836
|
`.trimStart(),o=await t.formatCode(e,s);return await t.writeFile(e,o),"create"}return null}var ly,gy=L(()=>{"use strict";h();_r();Wi();ly="builderApiKey"});function Wc(t){let e=t[t.length-1];return e&&typeof e=="object"&&!(e instanceof Error)&&!Array.isArray(e)&&"loggerOptions"in e?{callArgs:t.slice(0,-1),options:e.loggerOptions}:{callArgs:t,options:{}}}function Ske(t,e){return`[${t.toUpperCase()}]`+e.map(r=>{if(r instanceof Error)return r.stack??r.message;if(typeof r=="object"&&r!==null)try{return JSON.stringify(r)}catch{return String(r)}return String(r)}).join(" ")}function vke(){let t=process.env.FUSION_ENVIRONMENT;return t==="cloud"||t==="cloud-v2"}function py(t,e,r,n){let i={severity:e,message:Ske(r,n),timestamp:new Date().toISOString()};r&&(i.context=r),t.write(JSON.stringify(i)+`
|
|
837
|
-
`)}function xke(t,e,r){return{debug(...n){if(!e())return;let{callArgs:i,options:s}=Wc(n);py(s.stderr?process.stderr:process.stdout,"DEBUG",r,i)},info(...n){if(t>zc.info)return;let{callArgs:i,options:s}=Wc(n);s.debug&&!e()||py(s.stderr?process.stderr:process.stdout,"INFO",r,i)},warn(...n){if(t>zc.warn)return;let{callArgs:i,options:s}=Wc(n);s.debug&&!e()||py(process.stderr,"WARNING",r,i)},error(...n){if(t>zc.error)return;let{callArgs:i,options:s}=Wc(n);s.debug&&!e()||py(process.stderr,"ERROR",r,i)}}}function Kp(t){return t?`[${t}]`:""}function Fke(t,e,r){return{debug(...n){if(!e())return;let{callArgs:i,options:s}=Wc(n);s.stderr?console.error(Kp(r),...i):console.debug(Kp(r),...i)},info(...n){if(zc.info<t)return;let{callArgs:i,options:s}=Wc(n);s.debug&&!e()||(s.stderr?console.error(Kp(r),...i):console.log(Kp(r),...i))},warn(...n){if(zc.warn<t)return;let{callArgs:i,options:s}=Wc(n);s.debug&&!e()||console.warn(Kp(r),...i)},error(...n){if(zc.error<t)return;let{callArgs:i,options:s}=Wc(n);s.debug&&!e()||console.error(Kp(r),...i)}}}function GY(t){UY=t}function Se(t,e){let r=typeof e?.debug=="function"?e.debug:e?.debug!==void 0?()=>e.debug:()=>UY||!!process.env.DEBUG,n=e?.level??process.env.LOG_LEVEL?.toLowerCase();return vke()?xke(_Y(n??"info"),r,t):Fke(_Y(n??"info"),r,t)}function _Y(t){return zc[t]??zc.info}var zc,UY,Dt=L(()=>{"use strict";h();zc={debug:0,info:1,warn:2,error:3};UY=!1});async function KY(t,e){let r=[],n=e.getSourceFiles(),i=e.getTypeChecker();return await Promise.all(n.map(async s=>{let o=t.basename(s.fileName);if(Tke(t,s.fileName)||o.startsWith(".")||o==="node_modules"||Rke.has(o))return;let a=t.normalize(s.fileName);if(a===t.registryPath)return;let A=await dy(t,i,a,s);r.push(...A)})),r.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}function Tke(t,e){for(let r of Nke)if(t.dirname(e).includes(r))return!0;return!1}async function HY(t,e){let r=t.extname(e).toLowerCase();if(r===".tsx"||r===".jsx"||r===".ts"||r===".js"){let n=await t.readFile(e);if(n)return Mke(t,e,n)}return null}function Mke(t,e,r){let n=Ht(t,r);return dy(t,null,e,n)}async function dy(t,e,r,n){let i=[],s={};r=t.normalize(r);let o=n.statements.filter(u=>t.ts.isClassDeclaration(u)&&Gke(t,u)),a=n.statements.find(u=>t.ts.isImportDeclaration(u)&&t.ts.isStringLiteral(u.moduleSpecifier)&&u.moduleSpecifier.text==="@angular/core");if(a&&t.ts.isImportDeclaration(a)){let u=a.importClause?.namedBindings;if(u&&t.ts.isNamedImports(u)){let l=u.elements.find(d=>(d.propertyName??d.name).text==="input");l&&(s.inputSignalImportName=l.name.text)}}let A=await Lke(t,e,r,n),c=Oke(t,n);return await Promise.all(o.map(async u=>{let l=await Pke(t,e,r,u,c,s);i.push(...l)})),i.push(...A),i}async function dk(t,e,r){if(e.node.fnNode){let{sourceFile:n,typeChecker:i}=await xp(t,e.cmpInfo.filePath,r),o=(await dy(t,i,e.cmpInfo.filePath,n)).find(a=>a.cmpInfo.id===e.cmpInfo.id);if(!o)throw new Error(`Could not find component ${e.cmpInfo.name} in ${e.cmpInfo.filePath}`);return o.cmpInfo.inputs}return[]}async function JY(t,e,r){let n=await fn(t,r.map(o=>o.filePath)),i=n.getTypeChecker();return await Promise.all(r.filter(o=>!(o.name.endsWith("Page")||o.name.endsWith("Module")||o.name==="AppComponent")).map(async o=>{if(!o.isRegistered){let a=n.getSourceFile(o.filePath);if(a){let c=(await dy(t,i,o.filePath,a)).find(u=>u.cmpInfo.id===o.id);if(c){o.inputs=Tl(t,i,c.node.fnNode);let u=e.find(l=>l.cmpInfo.id===o.id);if(u){let l=await dk(t,u,n);Es(o,l)}}}}return o}))}async function Pke(t,e,r,n,i,s){let o=[],a=t.relative(t.getAppRootDir(),r),A=fr(t,r),c=n.name?.text;if(!c)return o;let u=!1;n.modifiers&&(u=n.modifiers.some(p=>p.kind===t.ts.SyntaxKind.DefaultKeyword));let l=u?"default":c,d=u?"default":"named",g=[];return n.members.forEach(p=>{if(t.ts.isPropertyDeclaration(p)||t.ts.isGetAccessor(p)||t.ts.isSetAccessor(p)){let C=(t.ts.getDecorators(p)??[]).find(B=>_ke(t,B))!==void 0&&t.ts.isIdentifier(p.name),I=s?.inputSignalImportName!==void 0&&t.ts.isIdentifier(p.name)&&Uke(t,p,s.inputSignalImportName);if(C||I){let B="any";if(t.ts.isSetAccessor(p))B=OY(t,p.parameters[0].type);else if(p.type&&e){let y=e.getTypeAtLocation(p.type);B=e.typeToString(y)}else B=OY(t,p.type);let E={name:p.name.text,type:i[B]?"string":B};i[B]&&(E.enum=i[B]),g.push(E)}}}),o.push({cmpInfo:{id:await ur(t,r,c),displayFilePath:er(t,r),name:dr(c),inputs:g,exportName:l,exportType:d,importName:c,filePath:r,relFilePath:a,importPath:A,meta:{...Hke(t,n)},framework:"angular"},node:{name:c,fnNode:n,deps:void 0}}),o}async function Lke(t,e,r,n){let i=[],s=t.relative(t.getAppRootDir(),r),o=fr(t,r);for(let a of n.statements)if(t.ts.isExportDeclaration(a)&&a.exportClause&&t.ts.isNamedExports(a.exportClause))for(let A of a.exportClause.elements){let c=A.name?.text;if(!c)continue;let u=c,l="named",d=[];if(e){let f=e.getSymbolAtLocation(A.name);if(f){let m=e.getDeclaredTypeOfSymbol(f);e.getPropertiesOfType(m).forEach(I=>{let B=I.getDeclarations();B&&B.forEach(E=>{if(t.ts.isPropertyDeclaration(E)){let y=e.getTypeAtLocation(E),Q={name:I.getName(),type:Kke(t,e,y)};d.push(Q)}})})}}let g=t.ts.isExportSpecifier(A)&&A.parent?A.parent.parent:void 0,p;if(g){let f=g.moduleSpecifier;if(f&&t.ts.isStringLiteral(f)){let m=e?.getSymbolAtLocation(f);if(m&&m.declarations&&m.declarations.length>0){let C=m.declarations[0];(!t.ts.isSourceFile(C)||t.ts.isSourceFile(C)&&C.fileName.includes("node_modules"))&&(p=f.text)}}}i.push({cmpInfo:{id:await ur(t,r,c,p),displayFilePath:er(t,r),name:dr(c),inputs:d,exportName:u,exportType:l,importName:c,filePath:r,relFilePath:s,importPath:p||o,externalImportPath:p,framework:"angular"},node:{name:c,fnNode:A,deps:void 0}})}else if(t.ts.isExportDeclaration(a)&&!a.exportClause&&a.moduleSpecifier&&t.ts.isStringLiteral(a.moduleSpecifier)){let A=a.moduleSpecifier.text;if(e)try{let c=e.getSymbolAtLocation(a.moduleSpecifier);if(c&&c.exports){let u=e.getExportsOfModule(c);for(let l of u)if(l.flags&t.ts.SymbolFlags.Class){let d=l.getName();if(d.startsWith("_"))continue;i.push({cmpInfo:{id:await ur(t,r,d,A),displayFilePath:er(t,r),name:dr(d),inputs:[],exportName:d,exportType:"named",importName:d,filePath:r,relFilePath:s,importPath:A,externalImportPath:A,framework:"angular"},node:{name:d,fnNode:a,deps:void 0}})}}}catch(c){kke.warn(`Error processing star export from ${A}:`,c)}}return i}function _ke(t,e){return YY(t,e,"Input")}function Uke(t,e,r){return t.ts.isPropertyDeclaration(e)&&e.initializer!==void 0&&t.ts.isCallExpression(e.initializer)&&t.ts.isIdentifier(e.initializer.expression)&&e.initializer.expression.text===r}function YY(t,e,r){if(t.ts.isCallExpression(e.expression)){let n=e.expression;if(t.ts.isIdentifier(n.expression))return n.expression?.text===r}return!1}function Gke(t,e){return!!t.ts.getDecorators(e)?.some(i=>t.ts.isCallExpression(i.expression)&&t.ts.isIdentifier(i.expression.expression)&&i.expression.expression.text==="Component")}function OY(t,e){if(!e)return"any";let r="any";switch(e.kind){case t.ts.SyntaxKind.StringKeyword:r="string";break;case t.ts.SyntaxKind.NumberKeyword:r="number";break;case t.ts.SyntaxKind.BooleanKeyword:r="boolean";break;case t.ts.SyntaxKind.TypeReference:t.ts.isTypeReferenceNode(e)&&t.ts.isIdentifier(e.typeName)&&(r=e.typeName.text);break}return r.includes("|")?"string":r}function Oke(t,e){let r={};return t.ts.forEachChild(e,n=>{t.ts.isTypeAliasDeclaration(n)&&t.ts.isUnionTypeNode(n.type)&&n.type.types.every(i=>t.ts.isLiteralTypeNode(i)&&t.ts.isStringLiteral(i.literal))&&(r[n.name.text]=n.type.types.map(i=>i.literal.text))}),r}function Kke(t,e,r){let n=e.typeToString(r);if(n==="any"){let i=r.getSymbol();if(i){let s=i.getDeclarations();if(s&&s.length>0){let o=s[0];if(t.ts.isVariableDeclaration(o)){let a=o.type;a&&(n=e.typeToString(e.getTypeAtLocation(a)))}}}}return n}function Hke(t,e){let{getDecorators:r,isCallExpression:n,isIdentifier:i,isObjectLiteralExpression:s,isPropertyAssignment:o,isStringLiteral:a,SyntaxKind:A}=t.ts,c,u;return r(e)?.forEach(d=>{if(YY(t,d,"Component")){let{expression:g}=d;if(n(g)){let[p]=g.arguments;s(p)&&p.properties.forEach(f=>{o(f)&&i(f.name)&&(f.name.escapedText==="selector"&&a(f.initializer)&&(c=f.initializer.text),f.name.escapedText==="standalone"&&(u=f.initializer.kind===A.TrueKeyword))})}}}),{selector:c,standalone:u}}var kke,Rke,Nke,fy=L(()=>{"use strict";h();Dt();_r();Qt();Gs();lm();xi();kke=Se("AngularComponents");Rke=new Set([]),Nke=new Set(["node_modules"])});async function hy(t,e,r){let n=t.typescriptEnabled?".ts":".js",i=`app.module${n}`,s=t.join(t.appDir,i),o=await t.readFile(s);if(!o){t.Sentry?.captureException(new Error(`Unable to read app.module.${n} at ${s}`),{extra:{appModuleCode:o,appModulePath:s}});return}let a=await Jke(t,s,e,r,o);if(!a){t.Sentry?.captureException(new Error(`Unable to update app.module.${n} at ${s}`),{extra:{appModuleCode:o,appModulePath:s}});return}return await t.writeFile(s,a),s}async function Jke(t,e,r,n,i){let s=i,o=Ht(t,i),a=Jt(t,e,n);o=qt(t,o,{namedImports:[r],importPath:a}),o=qt(t,o,{namedImports:["Content"],importPath:"@builder.io/sdk-angular"});let A=[];for(let c of o.statements)if(t.ts.isClassDeclaration(c)&&c.name?.text==="AppModule"){let u=Yke(t,r,c);A.push(u)}else A.push(c);return o=t.ts.factory.updateSourceFile(o,A),s=vn(t,o),s}function Yke(t,e,r){let n=t.ts.getDecorators(r);if(n){for(let i of n)if(t.ts.isCallExpression(i.expression)&&t.ts.isIdentifier(i.expression.expression)&&i.expression.expression.text==="NgModule"){let s=i.expression.arguments;if(s.length===1&&t.ts.isObjectLiteralExpression(s[0])){let o=jY(t,s[0],"declarations",e);if(o){let a=jY(t,o,"imports","Content");if(a&&(o=a),o){let A=t.ts.factory.updateDecorator(i,t.ts.factory.updateCallExpression(i.expression,i.expression.expression,i.expression.typeArguments,[o])),u=[...n.map(l=>l===i?A:l),...t.ts.getModifiers(r)||[]];return t.ts.factory.updateClassDeclaration(r,u,r.name,r.typeParameters,r.heritageClauses,r.members)}}}}}return r}function jY(t,e,r,n){let i=[...e.properties],s=i.findIndex(a=>sr(t,a)===r);if(s>-1){let a=i[s];if(t.ts.isPropertyAssignment(a)&&a.initializer&&t.ts.isArrayLiteralExpression(a.initializer)){let A=qY(t,a.initializer,n);return A?(i[s]=t.ts.factory.updatePropertyAssignment(a,a.name,A),t.ts.factory.updateObjectLiteralExpression(e,i)):null}return null}let o=qY(t,t.ts.factory.createArrayLiteralExpression([],!0),n);return o?t.ts.factory.updateObjectLiteralExpression(e,[...i,t.ts.factory.createPropertyAssignment(r,o)]):null}function qY(t,e,r){return e.elements.some(i=>t.ts.isIdentifier(i)?i.text===r:!1)?null:t.ts.factory.updateArrayLiteralExpression(e,[...e.elements,t.ts.factory.createIdentifier(r)])}var $Y=L(()=>{"use strict";h();_r();Mo();Qt();Da()});async function fk(t,e,r,n){let s=`app.routes${t.typescriptEnabled?".ts":".js"}`,o=t.join(t.appDir,s);try{if(t.magicast){let a=await t.magicast.loadFile(o);Object.keys(a.exports).length===0&&(a.exports.routes=[]);let c=Object.keys(a.exports)[0],u=a.exports[c];if(u.find(d=>d.path===e))return;let l=t.magicast.builders.raw("{}");if(l.path=e,l.component=t.magicast.builders.raw(r),u.push(l),a.imports.$items.find(d=>d.imported===r))return;a.imports.$append({imported:r,from:n}),await t.magicast.writeFile(a,o)}}catch(a){let A=null;try{A=t.readFileSync(o)}catch(c){t.Sentry?.captureException(c,{level:"warning"})}t.Sentry?.captureException(a,{extra:{content:A,appRoutesPath:o,componentName:r,componentPath:n}})}}var VY=L(()=>{"use strict";h()});var WY=R((J0t,my)=>{h();my.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/;my.exports.ID_Start=/[\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\u0860-\u086A\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\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\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-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\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\uDF2D-\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\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\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\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\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\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;my.exports.ID_Continue=/[\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\u0860-\u086A\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\u09FC\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-\u0AFF\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\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\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-\u1CF9\u1D00-\u1DF9\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\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-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\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\uDF2D-\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\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\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\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\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\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/});var mk=R((j0t,zY)=>{h();var hk=WY();zY.exports={isSpaceSeparator(t){return typeof t=="string"&&hk.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||hk.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="\u200C"||t==="\u200D"||hk.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t=="string"&&/[0-9A-Fa-f]/.test(t)}}});var rj=R(($0t,tj)=>{h();var Fn=mk(),Ik,Fi,NA,Iy,Xc,_o,kn,yk,ym;tj.exports=function(e,r){Ik=String(e),Fi="start",NA=[],Iy=0,Xc=1,_o=0,kn=void 0,yk=void 0,ym=void 0;do kn=jke(),Vke[Fi]();while(kn.type!=="eof");return typeof r=="function"?Ek({"":ym},"",r):ym};function Ek(t,e,r){let n=t[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i<n.length;i++){let s=String(i),o=Ek(n,s,r);o===void 0?delete n[s]:Object.defineProperty(n,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(let i in n){let s=Ek(n,i,r);s===void 0?delete n[i]:Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0})}return r.call(t,e,n)}var Ct,gt,Bm,RA,Pt;function jke(){for(Ct="default",gt="",Bm=!1,RA=1;;){Pt=TA();let t=ZY[Ct]();if(t)return t}}function TA(){if(Ik[Iy])return String.fromCodePoint(Ik.codePointAt(Iy))}function Be(){let t=TA();return t===`
|
|
838
|
-
`?(Xc++,_o=0):t?_o+=t.length:_o++,t&&(Iy+=t.length),t}var
|
|
839
|
-
`:case"\r":case"\u2028":case"\u2029":Be();return;case"/":Be(),Ct="comment";return;case void 0:return Be(),Er("eof")}if(Fn.isSpaceSeparator(Pt)){Be();return}return
|
|
840
|
-
`:case"\r":case"\u2028":case"\u2029":Be(),Ct="default";return;case void 0:return Be(),Er("eof")}Be()},value(){switch(Pt){case"{":case"[":return Er("punctuator",Be());case"n":return Be(),_l("ull"),Er("null",null);case"t":return Be(),_l("rue"),Er("boolean",!0);case"f":return Be(),_l("alse"),Er("boolean",!1);case"-":case"+":Be()==="-"&&(RA=-1),Ct="sign";return;case".":gt=Be(),Ct="decimalPointLeading";return;case"0":gt=Be(),Ct="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":gt=Be(),Ct="decimalInteger";return;case"I":return Be(),_l("nfinity"),Er("numeric",1/0);case"N":return Be(),_l("aN"),Er("numeric",NaN);case'"':case"'":Bm=Be()==='"',gt="",Ct="string";return}throw Br(Be())},identifierNameStartEscape(){if(Pt!=="u")throw Br(Be());Be();let t=Bk();switch(t){case"$":case"_":break;default:if(!Fn.isIdStartChar(t))throw
|
|
837
|
+
`)}function xke(t,e,r){return{debug(...n){if(!e())return;let{callArgs:i,options:s}=Wc(n);py(s.stderr?process.stderr:process.stdout,"DEBUG",r,i)},info(...n){if(t>zc.info)return;let{callArgs:i,options:s}=Wc(n);s.debug&&!e()||py(s.stderr?process.stderr:process.stdout,"INFO",r,i)},warn(...n){if(t>zc.warn)return;let{callArgs:i,options:s}=Wc(n);s.debug&&!e()||py(process.stderr,"WARNING",r,i)},error(...n){if(t>zc.error)return;let{callArgs:i,options:s}=Wc(n);s.debug&&!e()||py(process.stderr,"ERROR",r,i)}}}function Kp(t){return t?`[${t}]`:""}function Fke(t,e,r){return{debug(...n){if(!e())return;let{callArgs:i,options:s}=Wc(n);s.stderr?console.error(Kp(r),...i):console.debug(Kp(r),...i)},info(...n){if(zc.info<t)return;let{callArgs:i,options:s}=Wc(n);s.debug&&!e()||(s.stderr?console.error(Kp(r),...i):console.log(Kp(r),...i))},warn(...n){if(zc.warn<t)return;let{callArgs:i,options:s}=Wc(n);s.debug&&!e()||console.warn(Kp(r),...i)},error(...n){if(zc.error<t)return;let{callArgs:i,options:s}=Wc(n);s.debug&&!e()||console.error(Kp(r),...i)}}}function G9(t){U9=t}function Se(t,e){let r=typeof e?.debug=="function"?e.debug:e?.debug!==void 0?()=>e.debug:()=>U9||!!process.env.DEBUG,n=e?.level??process.env.LOG_LEVEL?.toLowerCase();return vke()?xke(_9(n??"info"),r,t):Fke(_9(n??"info"),r,t)}function _9(t){return zc[t]??zc.info}var zc,U9,Dt=L(()=>{"use strict";h();zc={debug:0,info:1,warn:2,error:3};U9=!1});async function K9(t,e){let r=[],n=e.getSourceFiles(),i=e.getTypeChecker();return await Promise.all(n.map(async s=>{let o=t.basename(s.fileName);if(Tke(t,s.fileName)||o.startsWith(".")||o==="node_modules"||Rke.has(o))return;let a=t.normalize(s.fileName);if(a===t.registryPath)return;let A=await dy(t,i,a,s);r.push(...A)})),r.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}function Tke(t,e){for(let r of Nke)if(t.dirname(e).includes(r))return!0;return!1}async function H9(t,e){let r=t.extname(e).toLowerCase();if(r===".tsx"||r===".jsx"||r===".ts"||r===".js"){let n=await t.readFile(e);if(n)return Mke(t,e,n)}return null}function Mke(t,e,r){let n=Ht(t,r);return dy(t,null,e,n)}async function dy(t,e,r,n){let i=[],s={};r=t.normalize(r);let o=n.statements.filter(u=>t.ts.isClassDeclaration(u)&&Gke(t,u)),a=n.statements.find(u=>t.ts.isImportDeclaration(u)&&t.ts.isStringLiteral(u.moduleSpecifier)&&u.moduleSpecifier.text==="@angular/core");if(a&&t.ts.isImportDeclaration(a)){let u=a.importClause?.namedBindings;if(u&&t.ts.isNamedImports(u)){let l=u.elements.find(d=>(d.propertyName??d.name).text==="input");l&&(s.inputSignalImportName=l.name.text)}}let A=await Lke(t,e,r,n),c=Oke(t,n);return await Promise.all(o.map(async u=>{let l=await Pke(t,e,r,u,c,s);i.push(...l)})),i.push(...A),i}async function dk(t,e,r){if(e.node.fnNode){let{sourceFile:n,typeChecker:i}=await xp(t,e.cmpInfo.filePath,r),o=(await dy(t,i,e.cmpInfo.filePath,n)).find(a=>a.cmpInfo.id===e.cmpInfo.id);if(!o)throw new Error(`Could not find component ${e.cmpInfo.name} in ${e.cmpInfo.filePath}`);return o.cmpInfo.inputs}return[]}async function J9(t,e,r){let n=await fn(t,r.map(o=>o.filePath)),i=n.getTypeChecker();return await Promise.all(r.filter(o=>!(o.name.endsWith("Page")||o.name.endsWith("Module")||o.name==="AppComponent")).map(async o=>{if(!o.isRegistered){let a=n.getSourceFile(o.filePath);if(a){let c=(await dy(t,i,o.filePath,a)).find(u=>u.cmpInfo.id===o.id);if(c){o.inputs=Tl(t,i,c.node.fnNode);let u=e.find(l=>l.cmpInfo.id===o.id);if(u){let l=await dk(t,u,n);Es(o,l)}}}}return o}))}async function Pke(t,e,r,n,i,s){let o=[],a=t.relative(t.getAppRootDir(),r),A=fr(t,r),c=n.name?.text;if(!c)return o;let u=!1;n.modifiers&&(u=n.modifiers.some(p=>p.kind===t.ts.SyntaxKind.DefaultKeyword));let l=u?"default":c,d=u?"default":"named",g=[];return n.members.forEach(p=>{if(t.ts.isPropertyDeclaration(p)||t.ts.isGetAccessor(p)||t.ts.isSetAccessor(p)){let C=(t.ts.getDecorators(p)??[]).find(B=>_ke(t,B))!==void 0&&t.ts.isIdentifier(p.name),I=s?.inputSignalImportName!==void 0&&t.ts.isIdentifier(p.name)&&Uke(t,p,s.inputSignalImportName);if(C||I){let B="any";if(t.ts.isSetAccessor(p))B=O9(t,p.parameters[0].type);else if(p.type&&e){let y=e.getTypeAtLocation(p.type);B=e.typeToString(y)}else B=O9(t,p.type);let E={name:p.name.text,type:i[B]?"string":B};i[B]&&(E.enum=i[B]),g.push(E)}}}),o.push({cmpInfo:{id:await ur(t,r,c),displayFilePath:er(t,r),name:dr(c),inputs:g,exportName:l,exportType:d,importName:c,filePath:r,relFilePath:a,importPath:A,meta:{...Hke(t,n)},framework:"angular"},node:{name:c,fnNode:n,deps:void 0}}),o}async function Lke(t,e,r,n){let i=[],s=t.relative(t.getAppRootDir(),r),o=fr(t,r);for(let a of n.statements)if(t.ts.isExportDeclaration(a)&&a.exportClause&&t.ts.isNamedExports(a.exportClause))for(let A of a.exportClause.elements){let c=A.name?.text;if(!c)continue;let u=c,l="named",d=[];if(e){let f=e.getSymbolAtLocation(A.name);if(f){let m=e.getDeclaredTypeOfSymbol(f);e.getPropertiesOfType(m).forEach(I=>{let B=I.getDeclarations();B&&B.forEach(E=>{if(t.ts.isPropertyDeclaration(E)){let y=e.getTypeAtLocation(E),Q={name:I.getName(),type:Kke(t,e,y)};d.push(Q)}})})}}let g=t.ts.isExportSpecifier(A)&&A.parent?A.parent.parent:void 0,p;if(g){let f=g.moduleSpecifier;if(f&&t.ts.isStringLiteral(f)){let m=e?.getSymbolAtLocation(f);if(m&&m.declarations&&m.declarations.length>0){let C=m.declarations[0];(!t.ts.isSourceFile(C)||t.ts.isSourceFile(C)&&C.fileName.includes("node_modules"))&&(p=f.text)}}}i.push({cmpInfo:{id:await ur(t,r,c,p),displayFilePath:er(t,r),name:dr(c),inputs:d,exportName:u,exportType:l,importName:c,filePath:r,relFilePath:s,importPath:p||o,externalImportPath:p,framework:"angular"},node:{name:c,fnNode:A,deps:void 0}})}else if(t.ts.isExportDeclaration(a)&&!a.exportClause&&a.moduleSpecifier&&t.ts.isStringLiteral(a.moduleSpecifier)){let A=a.moduleSpecifier.text;if(e)try{let c=e.getSymbolAtLocation(a.moduleSpecifier);if(c&&c.exports){let u=e.getExportsOfModule(c);for(let l of u)if(l.flags&t.ts.SymbolFlags.Class){let d=l.getName();if(d.startsWith("_"))continue;i.push({cmpInfo:{id:await ur(t,r,d,A),displayFilePath:er(t,r),name:dr(d),inputs:[],exportName:d,exportType:"named",importName:d,filePath:r,relFilePath:s,importPath:A,externalImportPath:A,framework:"angular"},node:{name:d,fnNode:a,deps:void 0}})}}}catch(c){kke.warn(`Error processing star export from ${A}:`,c)}}return i}function _ke(t,e){return Y9(t,e,"Input")}function Uke(t,e,r){return t.ts.isPropertyDeclaration(e)&&e.initializer!==void 0&&t.ts.isCallExpression(e.initializer)&&t.ts.isIdentifier(e.initializer.expression)&&e.initializer.expression.text===r}function Y9(t,e,r){if(t.ts.isCallExpression(e.expression)){let n=e.expression;if(t.ts.isIdentifier(n.expression))return n.expression?.text===r}return!1}function Gke(t,e){return!!t.ts.getDecorators(e)?.some(i=>t.ts.isCallExpression(i.expression)&&t.ts.isIdentifier(i.expression.expression)&&i.expression.expression.text==="Component")}function O9(t,e){if(!e)return"any";let r="any";switch(e.kind){case t.ts.SyntaxKind.StringKeyword:r="string";break;case t.ts.SyntaxKind.NumberKeyword:r="number";break;case t.ts.SyntaxKind.BooleanKeyword:r="boolean";break;case t.ts.SyntaxKind.TypeReference:t.ts.isTypeReferenceNode(e)&&t.ts.isIdentifier(e.typeName)&&(r=e.typeName.text);break}return r.includes("|")?"string":r}function Oke(t,e){let r={};return t.ts.forEachChild(e,n=>{t.ts.isTypeAliasDeclaration(n)&&t.ts.isUnionTypeNode(n.type)&&n.type.types.every(i=>t.ts.isLiteralTypeNode(i)&&t.ts.isStringLiteral(i.literal))&&(r[n.name.text]=n.type.types.map(i=>i.literal.text))}),r}function Kke(t,e,r){let n=e.typeToString(r);if(n==="any"){let i=r.getSymbol();if(i){let s=i.getDeclarations();if(s&&s.length>0){let o=s[0];if(t.ts.isVariableDeclaration(o)){let a=o.type;a&&(n=e.typeToString(e.getTypeAtLocation(a)))}}}}return n}function Hke(t,e){let{getDecorators:r,isCallExpression:n,isIdentifier:i,isObjectLiteralExpression:s,isPropertyAssignment:o,isStringLiteral:a,SyntaxKind:A}=t.ts,c,u;return r(e)?.forEach(d=>{if(Y9(t,d,"Component")){let{expression:g}=d;if(n(g)){let[p]=g.arguments;s(p)&&p.properties.forEach(f=>{o(f)&&i(f.name)&&(f.name.escapedText==="selector"&&a(f.initializer)&&(c=f.initializer.text),f.name.escapedText==="standalone"&&(u=f.initializer.kind===A.TrueKeyword))})}}}),{selector:c,standalone:u}}var kke,Rke,Nke,fy=L(()=>{"use strict";h();Dt();_r();Qt();Gs();lm();xi();kke=Se("AngularComponents");Rke=new Set([]),Nke=new Set(["node_modules"])});async function hy(t,e,r){let n=t.typescriptEnabled?".ts":".js",i=`app.module${n}`,s=t.join(t.appDir,i),o=await t.readFile(s);if(!o){t.Sentry?.captureException(new Error(`Unable to read app.module.${n} at ${s}`),{extra:{appModuleCode:o,appModulePath:s}});return}let a=await Jke(t,s,e,r,o);if(!a){t.Sentry?.captureException(new Error(`Unable to update app.module.${n} at ${s}`),{extra:{appModuleCode:o,appModulePath:s}});return}return await t.writeFile(s,a),s}async function Jke(t,e,r,n,i){let s=i,o=Ht(t,i),a=Jt(t,e,n);o=qt(t,o,{namedImports:[r],importPath:a}),o=qt(t,o,{namedImports:["Content"],importPath:"@builder.io/sdk-angular"});let A=[];for(let c of o.statements)if(t.ts.isClassDeclaration(c)&&c.name?.text==="AppModule"){let u=Yke(t,r,c);A.push(u)}else A.push(c);return o=t.ts.factory.updateSourceFile(o,A),s=vn(t,o),s}function Yke(t,e,r){let n=t.ts.getDecorators(r);if(n){for(let i of n)if(t.ts.isCallExpression(i.expression)&&t.ts.isIdentifier(i.expression.expression)&&i.expression.expression.text==="NgModule"){let s=i.expression.arguments;if(s.length===1&&t.ts.isObjectLiteralExpression(s[0])){let o=j9(t,s[0],"declarations",e);if(o){let a=j9(t,o,"imports","Content");if(a&&(o=a),o){let A=t.ts.factory.updateDecorator(i,t.ts.factory.updateCallExpression(i.expression,i.expression.expression,i.expression.typeArguments,[o])),u=[...n.map(l=>l===i?A:l),...t.ts.getModifiers(r)||[]];return t.ts.factory.updateClassDeclaration(r,u,r.name,r.typeParameters,r.heritageClauses,r.members)}}}}}return r}function j9(t,e,r,n){let i=[...e.properties],s=i.findIndex(a=>sr(t,a)===r);if(s>-1){let a=i[s];if(t.ts.isPropertyAssignment(a)&&a.initializer&&t.ts.isArrayLiteralExpression(a.initializer)){let A=q9(t,a.initializer,n);return A?(i[s]=t.ts.factory.updatePropertyAssignment(a,a.name,A),t.ts.factory.updateObjectLiteralExpression(e,i)):null}return null}let o=q9(t,t.ts.factory.createArrayLiteralExpression([],!0),n);return o?t.ts.factory.updateObjectLiteralExpression(e,[...i,t.ts.factory.createPropertyAssignment(r,o)]):null}function q9(t,e,r){return e.elements.some(i=>t.ts.isIdentifier(i)?i.text===r:!1)?null:t.ts.factory.updateArrayLiteralExpression(e,[...e.elements,t.ts.factory.createIdentifier(r)])}var $9=L(()=>{"use strict";h();_r();Mo();Qt();Da()});async function fk(t,e,r,n){let s=`app.routes${t.typescriptEnabled?".ts":".js"}`,o=t.join(t.appDir,s);try{if(t.magicast){let a=await t.magicast.loadFile(o);Object.keys(a.exports).length===0&&(a.exports.routes=[]);let c=Object.keys(a.exports)[0],u=a.exports[c];if(u.find(d=>d.path===e))return;let l=t.magicast.builders.raw("{}");if(l.path=e,l.component=t.magicast.builders.raw(r),u.push(l),a.imports.$items.find(d=>d.imported===r))return;a.imports.$append({imported:r,from:n}),await t.magicast.writeFile(a,o)}}catch(a){let A=null;try{A=t.readFileSync(o)}catch(c){t.Sentry?.captureException(c,{level:"warning"})}t.Sentry?.captureException(a,{extra:{content:A,appRoutesPath:o,componentName:r,componentPath:n}})}}var V9=L(()=>{"use strict";h()});var W9=R((J0t,my)=>{h();my.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/;my.exports.ID_Start=/[\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\u0860-\u086A\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\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\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-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\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\uDF2D-\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\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\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\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\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\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;my.exports.ID_Continue=/[\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\u0860-\u086A\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\u09FC\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-\u0AFF\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\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\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-\u1CF9\u1D00-\u1DF9\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\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-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\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\uDF2D-\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\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\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\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\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\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/});var mk=R((j0t,z9)=>{h();var hk=W9();z9.exports={isSpaceSeparator(t){return typeof t=="string"&&hk.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||hk.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="\u200C"||t==="\u200D"||hk.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t=="string"&&/[0-9A-Fa-f]/.test(t)}}});var rj=R(($0t,tj)=>{h();var Fn=mk(),Ik,Fi,NA,Iy,Xc,_o,kn,yk,ym;tj.exports=function(e,r){Ik=String(e),Fi="start",NA=[],Iy=0,Xc=1,_o=0,kn=void 0,yk=void 0,ym=void 0;do kn=jke(),Vke[Fi]();while(kn.type!=="eof");return typeof r=="function"?Ek({"":ym},"",r):ym};function Ek(t,e,r){let n=t[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i<n.length;i++){let s=String(i),o=Ek(n,s,r);o===void 0?delete n[s]:Object.defineProperty(n,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(let i in n){let s=Ek(n,i,r);s===void 0?delete n[i]:Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0})}return r.call(t,e,n)}var Ct,gt,Bm,RA,Pt;function jke(){for(Ct="default",gt="",Bm=!1,RA=1;;){Pt=TA();let t=Z9[Ct]();if(t)return t}}function TA(){if(Ik[Iy])return String.fromCodePoint(Ik.codePointAt(Iy))}function Be(){let t=TA();return t===`
|
|
838
|
+
`?(Xc++,_o=0):t?_o+=t.length:_o++,t&&(Iy+=t.length),t}var Z9={default(){switch(Pt){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
|
|
839
|
+
`:case"\r":case"\u2028":case"\u2029":Be();return;case"/":Be(),Ct="comment";return;case void 0:return Be(),Er("eof")}if(Fn.isSpaceSeparator(Pt)){Be();return}return Z9[Fi]()},comment(){switch(Pt){case"*":Be(),Ct="multiLineComment";return;case"/":Be(),Ct="singleLineComment";return}throw Br(Be())},multiLineComment(){switch(Pt){case"*":Be(),Ct="multiLineCommentAsterisk";return;case void 0:throw Br(Be())}Be()},multiLineCommentAsterisk(){switch(Pt){case"*":Be();return;case"/":Be(),Ct="default";return;case void 0:throw Br(Be())}Be(),Ct="multiLineComment"},singleLineComment(){switch(Pt){case`
|
|
840
|
+
`:case"\r":case"\u2028":case"\u2029":Be(),Ct="default";return;case void 0:return Be(),Er("eof")}Be()},value(){switch(Pt){case"{":case"[":return Er("punctuator",Be());case"n":return Be(),_l("ull"),Er("null",null);case"t":return Be(),_l("rue"),Er("boolean",!0);case"f":return Be(),_l("alse"),Er("boolean",!1);case"-":case"+":Be()==="-"&&(RA=-1),Ct="sign";return;case".":gt=Be(),Ct="decimalPointLeading";return;case"0":gt=Be(),Ct="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":gt=Be(),Ct="decimalInteger";return;case"I":return Be(),_l("nfinity"),Er("numeric",1/0);case"N":return Be(),_l("aN"),Er("numeric",NaN);case'"':case"'":Bm=Be()==='"',gt="",Ct="string";return}throw Br(Be())},identifierNameStartEscape(){if(Pt!=="u")throw Br(Be());Be();let t=Bk();switch(t){case"$":case"_":break;default:if(!Fn.isIdStartChar(t))throw X9();break}gt+=t,Ct="identifierName"},identifierName(){switch(Pt){case"$":case"_":case"\u200C":case"\u200D":gt+=Be();return;case"\\":Be(),Ct="identifierNameEscape";return}if(Fn.isIdContinueChar(Pt)){gt+=Be();return}return Er("identifier",gt)},identifierNameEscape(){if(Pt!=="u")throw Br(Be());Be();let t=Bk();switch(t){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!Fn.isIdContinueChar(t))throw X9();break}gt+=t,Ct="identifierName"},sign(){switch(Pt){case".":gt=Be(),Ct="decimalPointLeading";return;case"0":gt=Be(),Ct="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":gt=Be(),Ct="decimalInteger";return;case"I":return Be(),_l("nfinity"),Er("numeric",RA*(1/0));case"N":return Be(),_l("aN"),Er("numeric",NaN)}throw Br(Be())},zero(){switch(Pt){case".":gt+=Be(),Ct="decimalPoint";return;case"e":case"E":gt+=Be(),Ct="decimalExponent";return;case"x":case"X":gt+=Be(),Ct="hexadecimal";return}return Er("numeric",RA*0)},decimalInteger(){switch(Pt){case".":gt+=Be(),Ct="decimalPoint";return;case"e":case"E":gt+=Be(),Ct="decimalExponent";return}if(Fn.isDigit(Pt)){gt+=Be();return}return Er("numeric",RA*Number(gt))},decimalPointLeading(){if(Fn.isDigit(Pt)){gt+=Be(),Ct="decimalFraction";return}throw Br(Be())},decimalPoint(){switch(Pt){case"e":case"E":gt+=Be(),Ct="decimalExponent";return}if(Fn.isDigit(Pt)){gt+=Be(),Ct="decimalFraction";return}return Er("numeric",RA*Number(gt))},decimalFraction(){switch(Pt){case"e":case"E":gt+=Be(),Ct="decimalExponent";return}if(Fn.isDigit(Pt)){gt+=Be();return}return Er("numeric",RA*Number(gt))},decimalExponent(){switch(Pt){case"+":case"-":gt+=Be(),Ct="decimalExponentSign";return}if(Fn.isDigit(Pt)){gt+=Be(),Ct="decimalExponentInteger";return}throw Br(Be())},decimalExponentSign(){if(Fn.isDigit(Pt)){gt+=Be(),Ct="decimalExponentInteger";return}throw Br(Be())},decimalExponentInteger(){if(Fn.isDigit(Pt)){gt+=Be();return}return Er("numeric",RA*Number(gt))},hexadecimal(){if(Fn.isHexDigit(Pt)){gt+=Be(),Ct="hexadecimalInteger";return}throw Br(Be())},hexadecimalInteger(){if(Fn.isHexDigit(Pt)){gt+=Be();return}return Er("numeric",RA*Number(gt))},string(){switch(Pt){case"\\":Be(),gt+=qke();return;case'"':if(Bm)return Be(),Er("string",gt);gt+=Be();return;case"'":if(!Bm)return Be(),Er("string",gt);gt+=Be();return;case`
|
|
841
841
|
`:case"\r":throw Br(Be());case"\u2028":case"\u2029":Wke(Pt);break;case void 0:throw Br(Be())}gt+=Be()},start(){switch(Pt){case"{":case"[":return Er("punctuator",Be())}Ct="value"},beforePropertyName(){switch(Pt){case"$":case"_":gt=Be(),Ct="identifierName";return;case"\\":Be(),Ct="identifierNameStartEscape";return;case"}":return Er("punctuator",Be());case'"':case"'":Bm=Be()==='"',Ct="string";return}if(Fn.isIdStartChar(Pt)){gt+=Be(),Ct="identifierName";return}throw Br(Be())},afterPropertyName(){if(Pt===":")return Er("punctuator",Be());throw Br(Be())},beforePropertyValue(){Ct="value"},afterPropertyValue(){switch(Pt){case",":case"}":return Er("punctuator",Be())}throw Br(Be())},beforeArrayValue(){if(Pt==="]")return Er("punctuator",Be());Ct="value"},afterArrayValue(){switch(Pt){case",":case"]":return Er("punctuator",Be())}throw Br(Be())},end(){throw Br(Be())}};function Er(t,e){return{type:t,value:e,line:Xc,column:_o}}function _l(t){for(let e of t){if(TA()!==e)throw Br(Be());Be()}}function qke(){switch(TA()){case"b":return Be(),"\b";case"f":return Be(),"\f";case"n":return Be(),`
|
|
842
842
|
`;case"r":return Be(),"\r";case"t":return Be()," ";case"v":return Be(),"\v";case"0":if(Be(),Fn.isDigit(TA()))throw Br(Be());return"\0";case"x":return Be(),$ke();case"u":return Be(),Bk();case`
|
|
843
843
|
`:case"\u2028":case"\u2029":return Be(),"";case"\r":return Be(),TA()===`
|
|
844
|
-
`&&Be(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Br(Be());case void 0:throw Br(Be())}return Be()}function $ke(){let t="",e=TA();if(!Fn.isHexDigit(e)||(t+=Be(),e=TA(),!Fn.isHexDigit(e)))throw Br(Be());return t+=Be(),String.fromCodePoint(parseInt(t,16))}function Bk(){let t="",e=4;for(;e-- >0;){let r=TA();if(!Fn.isHexDigit(r))throw Br(Be());t+=Be()}return String.fromCodePoint(parseInt(t,16))}var Vke={start(){if(kn.type==="eof")throw Ul();Ck()},beforePropertyName(){switch(kn.type){case"identifier":case"string":yk=kn.value,Fi="afterPropertyName";return;case"punctuator":Cy();return;case"eof":throw Ul()}},afterPropertyName(){if(kn.type==="eof")throw Ul();Fi="beforePropertyValue"},beforePropertyValue(){if(kn.type==="eof")throw Ul();Ck()},beforeArrayValue(){if(kn.type==="eof")throw Ul();if(kn.type==="punctuator"&&kn.value==="]"){Cy();return}Ck()},afterPropertyValue(){if(kn.type==="eof")throw Ul();switch(kn.value){case",":Fi="beforePropertyName";return;case"}":Cy()}},afterArrayValue(){if(kn.type==="eof")throw Ul();switch(kn.value){case",":Fi="beforeArrayValue";return;case"]":Cy()}},end(){}};function Ck(){let t;switch(kn.type){case"punctuator":switch(kn.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=kn.value;break}if(ym===void 0)ym=t;else{let e=NA[NA.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,yk,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")NA.push(t),Array.isArray(t)?Fi="beforeArrayValue":Fi="beforePropertyName";else{let e=NA[NA.length-1];e==null?Fi="end":Array.isArray(e)?Fi="afterArrayValue":Fi="afterPropertyValue"}}function Cy(){NA.pop();let t=NA[NA.length-1];t==null?Fi="end":Array.isArray(t)?Fi="afterArrayValue":Fi="afterPropertyValue"}function Br(t){return Ey(t===void 0?`JSON5: invalid end of input at ${Xc}:${_o}`:`JSON5: invalid character '${ej(t)}' at ${Xc}:${_o}`)}function Ul(){return Ey(`JSON5: invalid end of input at ${Xc}:${_o}`)}function
|
|
844
|
+
`&&Be(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Br(Be());case void 0:throw Br(Be())}return Be()}function $ke(){let t="",e=TA();if(!Fn.isHexDigit(e)||(t+=Be(),e=TA(),!Fn.isHexDigit(e)))throw Br(Be());return t+=Be(),String.fromCodePoint(parseInt(t,16))}function Bk(){let t="",e=4;for(;e-- >0;){let r=TA();if(!Fn.isHexDigit(r))throw Br(Be());t+=Be()}return String.fromCodePoint(parseInt(t,16))}var Vke={start(){if(kn.type==="eof")throw Ul();Ck()},beforePropertyName(){switch(kn.type){case"identifier":case"string":yk=kn.value,Fi="afterPropertyName";return;case"punctuator":Cy();return;case"eof":throw Ul()}},afterPropertyName(){if(kn.type==="eof")throw Ul();Fi="beforePropertyValue"},beforePropertyValue(){if(kn.type==="eof")throw Ul();Ck()},beforeArrayValue(){if(kn.type==="eof")throw Ul();if(kn.type==="punctuator"&&kn.value==="]"){Cy();return}Ck()},afterPropertyValue(){if(kn.type==="eof")throw Ul();switch(kn.value){case",":Fi="beforePropertyName";return;case"}":Cy()}},afterArrayValue(){if(kn.type==="eof")throw Ul();switch(kn.value){case",":Fi="beforeArrayValue";return;case"]":Cy()}},end(){}};function Ck(){let t;switch(kn.type){case"punctuator":switch(kn.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=kn.value;break}if(ym===void 0)ym=t;else{let e=NA[NA.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,yk,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")NA.push(t),Array.isArray(t)?Fi="beforeArrayValue":Fi="beforePropertyName";else{let e=NA[NA.length-1];e==null?Fi="end":Array.isArray(e)?Fi="afterArrayValue":Fi="afterPropertyValue"}}function Cy(){NA.pop();let t=NA[NA.length-1];t==null?Fi="end":Array.isArray(t)?Fi="afterArrayValue":Fi="afterPropertyValue"}function Br(t){return Ey(t===void 0?`JSON5: invalid end of input at ${Xc}:${_o}`:`JSON5: invalid character '${ej(t)}' at ${Xc}:${_o}`)}function Ul(){return Ey(`JSON5: invalid end of input at ${Xc}:${_o}`)}function X9(){return _o-=5,Ey(`JSON5: invalid identifier character at ${Xc}:${_o}`)}function Wke(t){console.warn(`JSON5: '${ej(t)}' in strings is not valid ECMAScript; consider escaping`)}function ej(t){let e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[t])return e[t];if(t<" "){let r=t.charCodeAt(0).toString(16);return"\\x"+("00"+r).substring(r.length)}return t}function Ey(t){let e=new SyntaxError(t);return e.lineNumber=Xc,e.columnNumber=_o,e}});var ij=R((W0t,nj)=>{h();var Qk=mk();nj.exports=function(e,r,n){let i=[],s="",o,a,A="",c;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(n=r.space,c=r.quote,r=r.replacer),typeof r=="function")a=r;else if(Array.isArray(r)){o=[];for(let f of r){let m;typeof f=="string"?m=f:(typeof f=="number"||f instanceof String||f instanceof Number)&&(m=String(f)),m!==void 0&&o.indexOf(m)<0&&o.push(m)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>0&&(n=Math.min(10,Math.floor(n)),A=" ".substr(0,n)):typeof n=="string"&&(A=n.substr(0,10)),u("",{"":e});function u(f,m){let C=m[f];switch(C!=null&&(typeof C.toJSON5=="function"?C=C.toJSON5(f):typeof C.toJSON=="function"&&(C=C.toJSON(f))),a&&(C=a.call(m,f,C)),C instanceof Number?C=Number(C):C instanceof String?C=String(C):C instanceof Boolean&&(C=C.valueOf()),C){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof C=="string")return l(C,!1);if(typeof C=="number")return String(C);if(typeof C=="object")return Array.isArray(C)?p(C):d(C)}function l(f){let m={"'":.1,'"':.2},C={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},I="";for(let E=0;E<f.length;E++){let y=f[E];switch(y){case"'":case'"':m[y]++,I+=y;continue;case"\0":if(Qk.isDigit(f[E+1])){I+="\\x00";continue}}if(C[y]){I+=C[y];continue}if(y<" "){let Q=y.charCodeAt(0).toString(16);I+="\\x"+("00"+Q).substring(Q.length);continue}I+=y}let B=c||Object.keys(m).reduce((E,y)=>m[E]<m[y]?E:y);return I=I.replace(new RegExp(B,"g"),C[B]),B+I+B}function d(f){if(i.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");i.push(f);let m=s;s=s+A;let C=o||Object.keys(f),I=[];for(let E of C){let y=u(E,f);if(y!==void 0){let Q=g(E)+":";A!==""&&(Q+=" "),Q+=y,I.push(Q)}}let B;if(I.length===0)B="{}";else{let E;if(A==="")E=I.join(","),B="{"+E+"}";else{let y=`,
|
|
845
845
|
`+s;E=I.join(y),B=`{
|
|
846
846
|
`+s+E+`,
|
|
847
847
|
`+m+"}"}}return i.pop(),s=m,B}function g(f){if(f.length===0)return l(f,!0);let m=String.fromCodePoint(f.codePointAt(0));if(!Qk.isIdStartChar(m))return l(f,!0);for(let C=m.length;C<f.length;C++)if(!Qk.isIdContinueChar(String.fromCodePoint(f.codePointAt(C))))return l(f,!0);return f}function p(f){if(i.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");i.push(f);let m=s;s=s+A;let C=[];for(let B=0;B<f.length;B++){let E=u(String(B),f);C.push(E!==void 0?E:"null")}let I;if(C.length===0)I="[]";else if(A==="")I="["+C.join(",")+"]";else{let B=`,
|
|
@@ -986,7 +986,7 @@ export class Counter {
|
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
988
|
|
|
989
|
-
`.trimStart()}var Dk=L(()=>{"use strict";h();wk();Qt();gy();$Y();VY();cj()});async function pj(t){await By(t);let e=await t.readFile(t.registryPath);return e?iRe(t,e):{components:[],sourceFile:Ht(t,"")}}async function iRe(t,e){let r=Ht(t,e);return sRe(t,r)}async function sRe(t,e){let r=[],n=An(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await bk(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:qi(r)}}async function bk(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"angular"};for(let i of r.properties){if(!t.ts.isPropertyAssignment(i)||!t.ts.isIdentifier(i.name))continue;if(sr(t,i)==="component"){let o,{initializer:a}=i;if(t.ts.isIdentifier(a))o=a.text;else if(t.ts.isCallExpression(a)){let c=a.arguments[0];t.ts.isIdentifier(c)&&(o=c.text)}if(!o)continue;n.name===""&&(n.name=dr(o)),n.importName=o;let A=await wa(t,t.registryPath,e,o);if(!A)continue;if(n.filePath=A.filePath,n.relFilePath=A.relFilePath,await t.exists(A.filePath)?n.importPath=fr(t,A.filePath):(n.externalImportPath=A.importPath,n.importPath=n.externalImportPath),n.displayFilePath=A.displayFilePath,n.exportType=A.exportType,n.externalImportPath)n.exportName=o;else{let c=await HY(t,A.filePath);if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let u=c.find(l=>l.cmpInfo.exportName===o);u&&(n.exportName=u.cmpInfo.exportName)}}continue}}return n=Vi(t,n,r),n.filePath&&n.exportName&&(n.id=await ur(t,n.filePath,n.exportName,n.externalImportPath)),n}var dj=L(()=>{"use strict";h();_r();Wi();Qt();Da();xi();Dk();fy()});async function Ta(t,e,r,n,i,s,o,a){let A=await Vc(t),[c,u,l]=await Promise.all([KY(t,A),pj(t),Em(t)]),d=c.map(I=>I.cmpInfo),g=u.components,p={components:Lo(d,g),registryPath:t.registryPath,registryDisplayPath:er(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Hs(d),publicApiKey:l.envValue??void 0,devToolsVersion:t.version};if(a)return p.components=await JY(t,c,p.components),p;let f=!1,m=u.sourceFile,C=Array.isArray(e)?e:typeof e=="string"?[e]:[];if(C.length>0){let I=C.map(y=>{let Q=c.find(w=>w.cmpInfo.id===y);if(!Q)throw new Error(`Component ${y} not found`);return Q}),B=Array.from(new Set(I.map(y=>y.cmpInfo.filePath))),E=await fn(t,B);for(let y of I){let Q=p.components.find(M=>M.id===y.cmpInfo.id),w=await dk(t,y,E);Es(Q,w);let D=d.findIndex(M=>M.id===y.cmpInfo.id);d[D].inputs=w;let x=xa(y.cmpInfo.id,d,g,r,n,i,s),{elements:S,elmIndex:v,statementIndex:P,statement:$,variableDeclaration:H}=await aRe(t,m,y);if(x.addCmpToRegistry)S.push(oRe(t,x.addCmpToRegistry)),f=!0;else if(x.removeCmpFromRegistry)S.splice(v,1),f=!0;else if(x.updateRegisteredCmp){let M=hn(t,S[v],x.updateRegisteredCmp);S[v]=t.ts.factory.updateObjectLiteralExpression(M,[fj(t,x.updateRegisteredCmp),...M.properties.slice(1)]),f=!0}if(f&&o){let M=[...m.statements];M[P]=t.ts.factory.updateVariableStatement($,$.modifiers,t.ts.factory.updateVariableDeclarationList($.declarationList,[t.ts.factory.updateVariableDeclaration(H,H.name,H.exclamationToken,H.type,t.ts.factory.createArrayLiteralExpression(Sa(t,S)))])),m=t.ts.factory.updateSourceFile(m,M),Q.exportType==="named"?m=qt(t,m,{namedImports:[Q.importName],importPath:Q.externalImportPath?Q.externalImportPath:Jt(t,t.registryPath,Q.filePath)}):m=qt(t,m,{defaultImport:Q.importName,importPath:Q.externalImportPath?Q.externalImportPath:Jt(t,t.registryPath,Q.filePath)}),m=qt(t,m,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-angular",isTypeOnly:!0}),m=Fa(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),p.components=x.components,g=x.components.filter(G=>G.isRegistered)}}}if(f&&o){m=va(t,m),m=ba(t,m);let I=vn(t,m);I=Po(I),I=await t.formatCode(t.registryPath,I),await t.writeFile(t.registryPath,I)}return p}function fj(t,e){let r=t.ts.factory.createIdentifier(e.importName);return t.ts.factory.createPropertyAssignment("component",r)}function oRe(t,e){return hn(t,t.ts.factory.createObjectLiteralExpression([fj(t,e)],!0),e)}async function aRe(t,e,r){let n=An(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await bk(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var wk=L(()=>{"use strict";h();Gs();Mo();_r();fy();Qt();Pl();dj();_p();Up();xi();fy();Wi();Gp();pm();jc();gy()});async function hj(t){let e=await ARe(t);return{builderPageOptions:async()=>({templateContentId:"f0b8016ac92e474699293211a268ebaa",pathname:"/builder-demo",title:"Builder + Angular Demo Page"}),ensureBuilderSetup:()=>uj(e),ensureFigmaImportPage:()=>lj(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Ta(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Ta(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Ta(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Ta(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Ta(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Ta(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Em(e),setPublicApiKey:n=>LY(e,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-angular"},{name:"concurrently"}],getDevRunCommand:()=>"builder-dev",getCache:()=>Os(e),setCache:n=>Ks(e,n)}}async function ARe(t){let e=await cRe(t),r=t.getAppRootDir(),n=t.join(r,"src"),i=await vi(t),s=t.join(n,"app"),o=await $i(t,s),a={},A={...t,srcDir:"",appDir:"",componentsDir:"",registryPath:o,angularConfigPath:e,typescriptEnabled:i,builderPageComponentPath:"",hasAppModule:!1,addExternalPackage:l=>{a[t.join(r,l,"index.ts")]=`export * from "${l}";`},readFileSync:l=>a[l]??t.readFileSync(l),existsSync:l=>!!a[l]||t.existsSync(l),readdirSync:l=>{let d=t.readdirSync(l);return l===r?[...d,...Object.keys(a).map(g=>g.slice(r.length+1))]:d},readdir:async l=>{let d=await t.readdir(l);return l===r?[...d,...Object.keys(a).map(g=>g.slice(r.length+1))]:d}};if(!await t.exists(n))throw new Error(`Could not find src directory. Searched for src in "${t.getAppRootDir()}".`);A.srcDir=n,A.appDir=s,A.componentsDir=t.join(A.appDir,"components"),A.builderPageComponentPath=t.join(A.componentsDir,`builder-page.component.${i?"ts":"js"}`);let c=`app.module.${i?"ts":"js"}`,u=t.join(A.appDir,c);return await t.exists(u)&&(A.hasAppModule=!0),A}async function cRe(t){let e=t.join(t.getAppRootDir(),"angular.json");if(await t.exists(e))return e;let r=t.join(t.getAppRootDir(),"project.json");if(await t.exists(r))return r;if(t.ignoreMissingConfig)return"";throw new Error(`Could not find Angular config file. Searched for angular.json & project.json in "${t.getAppRootDir()}".`)}var mj=L(()=>{"use strict";h();Rl();gy();wk();Dk();gi()});async function Qm(t){let e=t.configType==="vite"?uRe:lRe;return await Ba(t,[".env"],e)}async function Cj(t,e){let r=await Qm(t),n=await ya(t,r.file,r.envKey,e);return{...r,modifiedType:n}}var uRe,lRe,Sk=L(()=>{"use strict";h();Nl();uRe="VITE_PUBLIC_BUILDER_KEY",lRe="PUBLIC_BUILDER_KEY"});async function Ej(t,e,r){try{let n=await t.readFile(e);if(!n)return null;let i=t.relative(t.getAppRootDir(),e),s=e.split("/").pop()?.replace(".vue","")||"UnknownComponent",o=hRe(s),a=dRe(n,r),A=pRe(n);return{id:mRe(e),name:o,filePath:i,relFilePath:i,inputs:a,framework:"vue",exportType:"default",exportName:"default",importName:o,importPath:i,vueApiType:A}}catch(n){return gRe.warn(`Failed to parse Vue component ${e}:`,n),null}}function pRe(t){return/<script[^>]*\s+setup[^>]*>/.test(t)?"composition-setup":/import\s+\{[^}]*\b(ref|reactive|computed|watch|onMounted|defineComponent)\b[^}]*\}\s+from\s+['"]vue['"]/.test(t)||/setup\s*\([^)]*\)\s*\{/.test(t)?"composition":"options"}function dRe(t,e){if(!e)return[];let r=[],n=[/defineProps<\s*\{([^}]+)\}\s*>\s*\(\s*\)/g,/defineProps\s*\(\s*\{([^}]+)\}\s*\)/g,/defineProps\s*\(\s*\[([^\]]+)\]\s*\)/g];for(let A of n){let c;for(;(c=A.exec(t))!==null;){let u=c[1];u.includes(":")?r.push(...vk(u)):r.push(...Ij(u))}}let i=/props\s*:\s*(\{[^}]+\}|\[[^\]]+\])/g,s;for(;(s=i.exec(t))!==null;){let A=s[1];if(A.startsWith("{")){let c=A.slice(1,-1);r.push(...vk(c))}else{let c=A.slice(1,-1);r.push(...Ij(c))}}let o=/setup\s*\(\s*props\s*(?::\s*\{([^}]+)\})?\s*[,)]?/g,a;for(;(a=o.exec(t))!==null;)a[1]&&r.push(...vk(a[1]));return fRe(r)}function vk(t){let e=[],r=/(\w+)\s*:\s*([^,;]+)/g,n;for(;(n=r.exec(t))!==null;){let[,o,a]=n;e.push({name:o.trim(),type:xk(a.trim()),required:!a.includes("?")&&!a.includes("undefined")})}let i=/(\w+)\s*:\s*\{([^}]+)\}/g;for(;(n=i.exec(t))!==null;){let[,o,a]=n,A=a.match(/type\s*:\s*(\w+)/),c=a.match(/required\s*:\s*(true|false)/),u=a.match(/default\s*:\s*([^,}]+)/);e.push({name:o.trim(),type:A?xk(A[1]):"any",required:c?c[1]==="true":!1,defaultValue:u?u[1].trim():void 0})}let s=/(\w+)\s*:\s*(\w+)(?=\s*[,}])/g;for(;(n=s.exec(t))!==null;){let[,o,a]=n;e.some(A=>A.name===o.trim())||e.push({name:o.trim(),type:xk(a.trim()),required:!1})}return e}function Ij(t){let e=[],r=t.split(",").map(n=>n.trim().replace(/['"]/g,"")).filter(n=>n.length>0);for(let n of r)e.push({name:n,type:"any",required:!1});return e}function xk(t){let e={String:"string",Number:"number",Boolean:"boolean",Array:"any[]",Object:"object",Function:"function",Date:"Date",Symbol:"symbol",string:"string",number:"number",boolean:"boolean",object:"object",function:"function"},r=t.replace(/\s*\|\s*undefined/g,"").replace(/\?$/,"");return e[r]||r||"any"}function fRe(t){let e=new Set;return t.filter(r=>e.has(r.name)?!1:(e.add(r.name),!0))}function hRe(t){return t.replace(/[-_\s]+(.)?/g,(e,r)=>r?r.toUpperCase():"").replace(/^(.)/,(e,r)=>r?r.toUpperCase():"")}function mRe(t){return t.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}var gRe,Bj=L(()=>{"use strict";h();Dt();gRe=Se("VueComponents")});async function Gl(t,e){let r=await CRe(t,e.readAllInputTypes),n=await Qm(t);return{components:r,registryPath:t.registryPath,registryDisplayPath:t.relative(t.getAppRootDir(),t.registryPath),frameworks:t.getFrameworks(),dependencies:Hs(r),publicApiKey:n.envValue??void 0,devToolsVersion:t.version}}async function CRe(t,e){let r=[],n=await IRe(t,t.getAppRootDir());for(let i of n){let s=await Ej(t,i,e);s&&r.push(s)}return r}async function IRe(t,e){let r=[],n=async s=>{try{let o=await t.readdir(s);for(let a of o){let A=t.join(s,a);(await t.stat(A)).isDirectory()?!a.startsWith(".")&&a!=="node_modules"&&a!=="dist"&&a!=="build"&&a!==".nuxt"&&a!==".output"&&await n(A):a.endsWith(".vue")&&r.push(A)}}catch{}};await n(e);let i=["components","pages","layouts"];for(let s of i){let o=t.join(e,s);try{(await t.stat(o)).isDirectory()&&await n(o)}catch{}}return r}var yj=L(()=>{"use strict";h();Bj();Sk();jc()});async function Qj(t){let e={errors:[]};try{await wj(t)}catch(r){e.errors.push(r instanceof Error?r.message:String(r))}return e}async function Dj(t){let e=[];e.push(...await wj(t));let n=t.join(t.componentsDir,"FigmaImports.vue");if(!await t.exists(n)){let i=await t.formatCode(n,ERe(t,n,"figma-imports"));await t.writeFile(n,i),e.push({filePath:n,modifiedType:"create"})}return e}async function wj(t){let e=[];return await t.exists(t.registryPath)||(await t.writeFile(t.registryPath,yRe(t)),e.push({filePath:t.registryPath,modifiedType:"create"})),e}function ERe(t,e,r="page"){let n=Jt(t,e,t.registryPath),i=t.typescriptEnabled;return t.isNuxt?`<template>
|
|
989
|
+
`.trimStart()}var Dk=L(()=>{"use strict";h();wk();Qt();gy();$9();V9();cj()});async function pj(t){await By(t);let e=await t.readFile(t.registryPath);return e?iRe(t,e):{components:[],sourceFile:Ht(t,"")}}async function iRe(t,e){let r=Ht(t,e);return sRe(t,r)}async function sRe(t,e){let r=[],n=An(t,e,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await bk(t,e,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:e,components:qi(r)}}async function bk(t,e,r){if(!t.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"angular"};for(let i of r.properties){if(!t.ts.isPropertyAssignment(i)||!t.ts.isIdentifier(i.name))continue;if(sr(t,i)==="component"){let o,{initializer:a}=i;if(t.ts.isIdentifier(a))o=a.text;else if(t.ts.isCallExpression(a)){let c=a.arguments[0];t.ts.isIdentifier(c)&&(o=c.text)}if(!o)continue;n.name===""&&(n.name=dr(o)),n.importName=o;let A=await wa(t,t.registryPath,e,o);if(!A)continue;if(n.filePath=A.filePath,n.relFilePath=A.relFilePath,await t.exists(A.filePath)?n.importPath=fr(t,A.filePath):(n.externalImportPath=A.importPath,n.importPath=n.externalImportPath),n.displayFilePath=A.displayFilePath,n.exportType=A.exportType,n.externalImportPath)n.exportName=o;else{let c=await H9(t,A.filePath);if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let u=c.find(l=>l.cmpInfo.exportName===o);u&&(n.exportName=u.cmpInfo.exportName)}}continue}}return n=Vi(t,n,r),n.filePath&&n.exportName&&(n.id=await ur(t,n.filePath,n.exportName,n.externalImportPath)),n}var dj=L(()=>{"use strict";h();_r();Wi();Qt();Da();xi();Dk();fy()});async function Ta(t,e,r,n,i,s,o,a){let A=await Vc(t),[c,u,l]=await Promise.all([K9(t,A),pj(t),Em(t)]),d=c.map(I=>I.cmpInfo),g=u.components,p={components:Lo(d,g),registryPath:t.registryPath,registryDisplayPath:er(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Hs(d),publicApiKey:l.envValue??void 0,devToolsVersion:t.version};if(a)return p.components=await J9(t,c,p.components),p;let f=!1,m=u.sourceFile,C=Array.isArray(e)?e:typeof e=="string"?[e]:[];if(C.length>0){let I=C.map(y=>{let Q=c.find(w=>w.cmpInfo.id===y);if(!Q)throw new Error(`Component ${y} not found`);return Q}),B=Array.from(new Set(I.map(y=>y.cmpInfo.filePath))),E=await fn(t,B);for(let y of I){let Q=p.components.find(M=>M.id===y.cmpInfo.id),w=await dk(t,y,E);Es(Q,w);let D=d.findIndex(M=>M.id===y.cmpInfo.id);d[D].inputs=w;let x=xa(y.cmpInfo.id,d,g,r,n,i,s),{elements:S,elmIndex:v,statementIndex:P,statement:$,variableDeclaration:H}=await aRe(t,m,y);if(x.addCmpToRegistry)S.push(oRe(t,x.addCmpToRegistry)),f=!0;else if(x.removeCmpFromRegistry)S.splice(v,1),f=!0;else if(x.updateRegisteredCmp){let M=hn(t,S[v],x.updateRegisteredCmp);S[v]=t.ts.factory.updateObjectLiteralExpression(M,[fj(t,x.updateRegisteredCmp),...M.properties.slice(1)]),f=!0}if(f&&o){let M=[...m.statements];M[P]=t.ts.factory.updateVariableStatement($,$.modifiers,t.ts.factory.updateVariableDeclarationList($.declarationList,[t.ts.factory.updateVariableDeclaration(H,H.name,H.exclamationToken,H.type,t.ts.factory.createArrayLiteralExpression(Sa(t,S)))])),m=t.ts.factory.updateSourceFile(m,M),Q.exportType==="named"?m=qt(t,m,{namedImports:[Q.importName],importPath:Q.externalImportPath?Q.externalImportPath:Jt(t,t.registryPath,Q.filePath)}):m=qt(t,m,{defaultImport:Q.importName,importPath:Q.externalImportPath?Q.externalImportPath:Jt(t,t.registryPath,Q.filePath)}),m=qt(t,m,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-angular",isTypeOnly:!0}),m=Fa(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),p.components=x.components,g=x.components.filter(G=>G.isRegistered)}}}if(f&&o){m=va(t,m),m=ba(t,m);let I=vn(t,m);I=Po(I),I=await t.formatCode(t.registryPath,I),await t.writeFile(t.registryPath,I)}return p}function fj(t,e){let r=t.ts.factory.createIdentifier(e.importName);return t.ts.factory.createPropertyAssignment("component",r)}function oRe(t,e){return hn(t,t.ts.factory.createObjectLiteralExpression([fj(t,e)],!0),e)}async function aRe(t,e,r){let n=An(t,e,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await bk(t,e,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var wk=L(()=>{"use strict";h();Gs();Mo();_r();fy();Qt();Pl();dj();_p();Up();xi();fy();Wi();Gp();pm();jc();gy()});async function hj(t){let e=await ARe(t);return{builderPageOptions:async()=>({templateContentId:"f0b8016ac92e474699293211a268ebaa",pathname:"/builder-demo",title:"Builder + Angular Demo Page"}),ensureBuilderSetup:()=>uj(e),ensureFigmaImportPage:()=>lj(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Ta(e,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Ta(e,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Ta(e,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Ta(e,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Ta(e,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Ta(e,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Em(e),setPublicApiKey:n=>L9(e,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-angular"},{name:"concurrently"}],getDevRunCommand:()=>"builder-dev",getCache:()=>Os(e),setCache:n=>Ks(e,n)}}async function ARe(t){let e=await cRe(t),r=t.getAppRootDir(),n=t.join(r,"src"),i=await vi(t),s=t.join(n,"app"),o=await $i(t,s),a={},A={...t,srcDir:"",appDir:"",componentsDir:"",registryPath:o,angularConfigPath:e,typescriptEnabled:i,builderPageComponentPath:"",hasAppModule:!1,addExternalPackage:l=>{a[t.join(r,l,"index.ts")]=`export * from "${l}";`},readFileSync:l=>a[l]??t.readFileSync(l),existsSync:l=>!!a[l]||t.existsSync(l),readdirSync:l=>{let d=t.readdirSync(l);return l===r?[...d,...Object.keys(a).map(g=>g.slice(r.length+1))]:d},readdir:async l=>{let d=await t.readdir(l);return l===r?[...d,...Object.keys(a).map(g=>g.slice(r.length+1))]:d}};if(!await t.exists(n))throw new Error(`Could not find src directory. Searched for src in "${t.getAppRootDir()}".`);A.srcDir=n,A.appDir=s,A.componentsDir=t.join(A.appDir,"components"),A.builderPageComponentPath=t.join(A.componentsDir,`builder-page.component.${i?"ts":"js"}`);let c=`app.module.${i?"ts":"js"}`,u=t.join(A.appDir,c);return await t.exists(u)&&(A.hasAppModule=!0),A}async function cRe(t){let e=t.join(t.getAppRootDir(),"angular.json");if(await t.exists(e))return e;let r=t.join(t.getAppRootDir(),"project.json");if(await t.exists(r))return r;if(t.ignoreMissingConfig)return"";throw new Error(`Could not find Angular config file. Searched for angular.json & project.json in "${t.getAppRootDir()}".`)}var mj=L(()=>{"use strict";h();Rl();gy();wk();Dk();gi()});async function Qm(t){let e=t.configType==="vite"?uRe:lRe;return await Ba(t,[".env"],e)}async function Cj(t,e){let r=await Qm(t),n=await ya(t,r.file,r.envKey,e);return{...r,modifiedType:n}}var uRe,lRe,Sk=L(()=>{"use strict";h();Nl();uRe="VITE_PUBLIC_BUILDER_KEY",lRe="PUBLIC_BUILDER_KEY"});async function Ej(t,e,r){try{let n=await t.readFile(e);if(!n)return null;let i=t.relative(t.getAppRootDir(),e),s=e.split("/").pop()?.replace(".vue","")||"UnknownComponent",o=hRe(s),a=dRe(n,r),A=pRe(n);return{id:mRe(e),name:o,filePath:i,relFilePath:i,inputs:a,framework:"vue",exportType:"default",exportName:"default",importName:o,importPath:i,vueApiType:A}}catch(n){return gRe.warn(`Failed to parse Vue component ${e}:`,n),null}}function pRe(t){return/<script[^>]*\s+setup[^>]*>/.test(t)?"composition-setup":/import\s+\{[^}]*\b(ref|reactive|computed|watch|onMounted|defineComponent)\b[^}]*\}\s+from\s+['"]vue['"]/.test(t)||/setup\s*\([^)]*\)\s*\{/.test(t)?"composition":"options"}function dRe(t,e){if(!e)return[];let r=[],n=[/defineProps<\s*\{([^}]+)\}\s*>\s*\(\s*\)/g,/defineProps\s*\(\s*\{([^}]+)\}\s*\)/g,/defineProps\s*\(\s*\[([^\]]+)\]\s*\)/g];for(let A of n){let c;for(;(c=A.exec(t))!==null;){let u=c[1];u.includes(":")?r.push(...vk(u)):r.push(...Ij(u))}}let i=/props\s*:\s*(\{[^}]+\}|\[[^\]]+\])/g,s;for(;(s=i.exec(t))!==null;){let A=s[1];if(A.startsWith("{")){let c=A.slice(1,-1);r.push(...vk(c))}else{let c=A.slice(1,-1);r.push(...Ij(c))}}let o=/setup\s*\(\s*props\s*(?::\s*\{([^}]+)\})?\s*[,)]?/g,a;for(;(a=o.exec(t))!==null;)a[1]&&r.push(...vk(a[1]));return fRe(r)}function vk(t){let e=[],r=/(\w+)\s*:\s*([^,;]+)/g,n;for(;(n=r.exec(t))!==null;){let[,o,a]=n;e.push({name:o.trim(),type:xk(a.trim()),required:!a.includes("?")&&!a.includes("undefined")})}let i=/(\w+)\s*:\s*\{([^}]+)\}/g;for(;(n=i.exec(t))!==null;){let[,o,a]=n,A=a.match(/type\s*:\s*(\w+)/),c=a.match(/required\s*:\s*(true|false)/),u=a.match(/default\s*:\s*([^,}]+)/);e.push({name:o.trim(),type:A?xk(A[1]):"any",required:c?c[1]==="true":!1,defaultValue:u?u[1].trim():void 0})}let s=/(\w+)\s*:\s*(\w+)(?=\s*[,}])/g;for(;(n=s.exec(t))!==null;){let[,o,a]=n;e.some(A=>A.name===o.trim())||e.push({name:o.trim(),type:xk(a.trim()),required:!1})}return e}function Ij(t){let e=[],r=t.split(",").map(n=>n.trim().replace(/['"]/g,"")).filter(n=>n.length>0);for(let n of r)e.push({name:n,type:"any",required:!1});return e}function xk(t){let e={String:"string",Number:"number",Boolean:"boolean",Array:"any[]",Object:"object",Function:"function",Date:"Date",Symbol:"symbol",string:"string",number:"number",boolean:"boolean",object:"object",function:"function"},r=t.replace(/\s*\|\s*undefined/g,"").replace(/\?$/,"");return e[r]||r||"any"}function fRe(t){let e=new Set;return t.filter(r=>e.has(r.name)?!1:(e.add(r.name),!0))}function hRe(t){return t.replace(/[-_\s]+(.)?/g,(e,r)=>r?r.toUpperCase():"").replace(/^(.)/,(e,r)=>r?r.toUpperCase():"")}function mRe(t){return t.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}var gRe,Bj=L(()=>{"use strict";h();Dt();gRe=Se("VueComponents")});async function Gl(t,e){let r=await CRe(t,e.readAllInputTypes),n=await Qm(t);return{components:r,registryPath:t.registryPath,registryDisplayPath:t.relative(t.getAppRootDir(),t.registryPath),frameworks:t.getFrameworks(),dependencies:Hs(r),publicApiKey:n.envValue??void 0,devToolsVersion:t.version}}async function CRe(t,e){let r=[],n=await IRe(t,t.getAppRootDir());for(let i of n){let s=await Ej(t,i,e);s&&r.push(s)}return r}async function IRe(t,e){let r=[],n=async s=>{try{let o=await t.readdir(s);for(let a of o){let A=t.join(s,a);(await t.stat(A)).isDirectory()?!a.startsWith(".")&&a!=="node_modules"&&a!=="dist"&&a!=="build"&&a!==".nuxt"&&a!==".output"&&await n(A):a.endsWith(".vue")&&r.push(A)}}catch{}};await n(e);let i=["components","pages","layouts"];for(let s of i){let o=t.join(e,s);try{(await t.stat(o)).isDirectory()&&await n(o)}catch{}}return r}var yj=L(()=>{"use strict";h();Bj();Sk();jc()});async function Qj(t){let e={errors:[]};try{await wj(t)}catch(r){e.errors.push(r instanceof Error?r.message:String(r))}return e}async function Dj(t){let e=[];e.push(...await wj(t));let n=t.join(t.componentsDir,"FigmaImports.vue");if(!await t.exists(n)){let i=await t.formatCode(n,ERe(t,n,"figma-imports"));await t.writeFile(n,i),e.push({filePath:n,modifiedType:"create"})}return e}async function wj(t){let e=[];return await t.exists(t.registryPath)||(await t.writeFile(t.registryPath,yRe(t)),e.push({filePath:t.registryPath,modifiedType:"create"})),e}function ERe(t,e,r="page"){let n=Jt(t,e,t.registryPath),i=t.typescriptEnabled;return t.isNuxt?`<template>
|
|
990
990
|
<div>
|
|
991
991
|
<div v-if="pending">Loading...</div>
|
|
992
992
|
<div v-else-if="error">Error loading content</div>
|
|
@@ -1092,7 +1092,7 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
1092
1092
|
// ]
|
|
1093
1093
|
// }
|
|
1094
1094
|
];
|
|
1095
|
-
`}var bj=L(()=>{"use strict";h();Qt()});async function Sj(t){let e=await QRe(t);return{builderPageOptions:async()=>({templateContentId:"vue-demo-template-id",pathname:"/builder-demo",title:"Builder + Vue Demo Page"}),ensureBuilderSetup:async()=>(await Qj(e)).errors.length>0?[]:[],ensureFigmaImportPage:()=>Dj(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Gl(e,{readAllInputTypes:!!n?.readAllInputTypes}),addExternalPackage:n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Gl(e,{readAllInputTypes:!1}),s=i.components.find(o=>o.id===n.cmpId);return{...i,component:s}},registerComponent:async n=>Gl(e,{readAllInputTypes:!1}),setRegisteredComponentInfo:async n=>Gl(e,{readAllInputTypes:!1}),setRegisteredComponentInput:async n=>Gl(e,{readAllInputTypes:!1}),unregisterComponent:async n=>Gl(e,{readAllInputTypes:!1}),getPublicApiKey:()=>Qm(e),setPublicApiKey:n=>Cj(e,n.publicApiKey),getDependencies:n=>n.sdkVersion===Ze.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-vue"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/vue"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Os(e),setCache:n=>Ks(e,n)}}async function QRe(t){let e=await DRe(t),r=t.getAppRootDir(),n=t.join(r,"src"),i=await vi(t),s={},o={...t,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",vueConfigPath:e,typescriptEnabled:i,configType:"",isNuxt:await wRe(t),addExternalPackage:c=>{s[t.join(r,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>s[c]??t.readFileSync(c),existsSync:c=>!!s[c]||t.existsSync(c),readdirSync:c=>{let u=t.readdirSync(c);return c===r?[...u,...Object.keys(s).map(l=>l.slice(r.length+1))]:u},readdir:async c=>{let u=await t.readdir(c);return c===r?[...u,...Object.keys(s).map(l=>l.slice(r.length+1))]:u}};e.includes("webpack.config")&&(o.configType="webpack"),(e.includes("vite.config")||e.includes("nuxt.config"))&&(o.configType="vite");let a=await t.exists(n);o.srcDir=a?n:null;let A=[t.join(r,"components"),t.join(r,"src","components"),t.join(r,"app","components")];for(let c of A)if(await t.exists(c)){o.componentsDir=c;break}return o.componentsDir||(o.componentsDir=a?t.join(n,"components"):t.join(r,"components")),o.registryPath=await $i(t,o.componentsDir),o}async function DRe(t){let e=["nuxt.config.ts","nuxt.config.js","vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts","vue.config.js","vue.config.ts"];for(let r of e){let n=t.join(t.getAppRootDir(),r);if(await t.exists(n))return n}if(t.ignoreMissingConfig)return"";throw new Error(`Could not find Vue config file. Searched for ${e.join(", ")} in "${t.getAppRootDir()}".`)}async function wRe(t){let e=["nuxt.config.ts","nuxt.config.js"];for(let r of e){let n=t.join(t.getAppRootDir(),r);if(await t.exists(n))return!0}try{let r=t.join(t.getAppRootDir(),"package.json");if(await t.exists(r)){let n=JSON.parse(await t.readFile(r)||"{}"),i={...n.dependencies,...n.devDependencies};return!!(i.nuxt||i["@nuxt/kit"]||i.nuxt3)}}catch{}return!1}var vj=L(()=>{"use strict";h();Rl();Sk();yj();xn();gi();bj()});var Fk=R(Dm=>{"use strict";h();Object.defineProperty(Dm,"__esModule",{value:!0});Dm.getType=xj;Dm.throwUnknownDataType=bRe;Dm.throwUnsupportedData=SRe;function xj(t){return Object.prototype.toString.call(t)}function bRe(t){throw new TypeError("unsupported data type: "+xj(t))}function SRe(t){throw new TypeError("unsupported data type: "+t)}});var Qy=R(PA=>{"use strict";h();Object.defineProperty(PA,"__esModule",{value:!0});PA.s_to_int=Nk;PA.s_to_big_int=Fj;PA.int_to_s=Tk;PA.big_int_to_s=kj;PA.num_to_s=Nj;PA.int_str_to_s=yy;PA.s_to_num=Tj;var MA="";for(let t=0;t<10;t++){let e=String.fromCharCode(48+t);MA+=e}for(let t=0;t<26;t++){let e=String.fromCharCode(65+t);MA+=e}for(let t=0;t<26;t++){let e=String.fromCharCode(97+t);MA+=e}var Hp=MA.length,Rk={};for(let t=0;t<Hp;t++){let e=MA[t];Rk[e]=t}function Nk(t){let e=0,r=1;for(let n=t.length-1;n>=0;n--){let i=t[n],s=Rk[i];s*=r,e+=s,r*=Hp}return e}function Fj(t){let e=BigInt(0),r=BigInt(1),n=BigInt(Hp);for(let i=t.length-1;i>=0;i--){let s=t[i],o=BigInt(Rk[s]);o*=r,e+=o,r*=n}return e}function Tk(t){if(t===0)return MA[0];let e=[];for(;t!==0;){let r=t%Hp,n=MA[r];e.push(n),t-=r,t/=Hp}return e.reverse().join("")}function kj(t){let e=BigInt(0),r=BigInt(Hp);if(t===e)return MA[0];let n=[];for(;t!==e;){let i=t%r,s=MA[Number(i)];n.push(s),t/=r}return n.reverse().join("")}function Rj(t){return t.split("").reverse().join("")}function Nj(t){if(t<0)return"-"+Nj(-t);let[e,r]=t.toString().split(".");if(!r)if(e.includes("e")){let[s,o]=e.split("e");e=s,r="0e"+o}else return Tk(t);let n;r&&([r,n]=r.split("e")),e=yy(e),r=Rj(r),r=yy(r);let i=e+"."+r;if(n){switch(i+=".",n[0]){case"+":n=n.slice(1);break;case"-":i+="-",n=n.slice(1);break}n=yy(n),i+=n}return i}function yy(t){let e=+t;return e.toString()===t&&e+1!==e&&e-1!==e?Tk(e):":"+kj(BigInt(t))}function kk(t){return t[0]===":"?Fj(t.substring(1)).toString():Nk(t).toString()}function Tj(t){if(t[0]==="-")return-Tj(t.substr(1));let[e,r,n]=t.split(".");if(!r)return Nk(e);e=kk(e),r=kk(r),r=Rj(r);let i=e+"."+r;if(n){i+="e";let s=!1;n[0]==="-"&&(s=!0,n=n.slice(1)),n=kk(n),i+=s?-n:+n}return+i}});var Pk=R(LA=>{"use strict";h();Object.defineProperty(LA,"__esModule",{value:!0});LA.encodeNum=vRe;LA.decodeNum=xRe;LA.decodeKey=FRe;LA.encodeBool=kRe;LA.decodeBool=RRe;LA.encodeStr=NRe;LA.decodeStr=TRe;var Mk=Qy();function vRe(t){return t===1/0?"N|+":t===-1/0?"N|-":Number.isNaN(t)?"N|0":"n|"+(0,Mk.num_to_s)(t)}function xRe(t){if(t.length===3&&t[0]==="N"&&t[1]==="|")switch(t[2]){case"+":return 1/0;case"-":return-1/0;case"0":return NaN}return(0,Mk.s_to_num)(t.slice(2))}function FRe(t){return typeof t=="number"?t:(0,Mk.s_to_int)(t)}function kRe(t){return t?"b|T":"b|F"}function RRe(t){if(t.length===3&&t[0]==="b"&&t[1]==="|")switch(t[2]){case"T":return!0;case"F":return!1}return!!t}function NRe(t){if(t[1]==="|")switch(t[0]){case"b":case"o":case"n":case"a":case"s":return"s|"+t}return t}function TRe(t){return t[0]==="s"&&t[1]==="|"?t.substr(2):t}});var Lk=R(Dy=>{"use strict";h();Object.defineProperty(Dy,"__esModule",{value:!0});Dy.config=void 0;Dy.config={sort_key:!1,preserve_nan:!1,error_on_nan:!1,preserve_infinite:!1,error_on_infinite:!1}});var Uk=R(Kl=>{"use strict";h();Object.defineProperty(Kl,"__esModule",{value:!0});Kl.memToValues=PRe;Kl.makeInMemoryStore=Mj;Kl.makeInMemoryCache=Pj;Kl.makeInMemoryMemory=LRe;Kl.addValue=wm;var Ol=Lk(),wy=Fk(),_k=Pk(),MRe=Qy();function PRe(t){return t.store.toArray()}function Mj(){let t=[];return{forEach(e){for(let r=0;r<t.length;r++)if(e(t[r])==="break")return},add(e){t.push(e)},toArray(){return t}}}function Pj(){let t=Object.create(null),e=Object.create(null);return{getValue(r){return t[r]},getSchema(r){return e[r]},forEachValue(r){for(let[n,i]of Object.entries(t))if(r(n,i)==="break")return},forEachSchema(r){for(let[n,i]of Object.entries(e))if(r(n,i)==="break")return},setValue(r,n){t[r]=n},setSchema(r,n){e[r]=n},hasValue(r){return r in t},hasSchema(r){return r in e}}}function LRe(){return{store:Mj(),cache:Pj(),keyCount:0}}function Ma(t,e){if(t.cache.hasValue(e))return t.cache.getValue(e);let r=t.keyCount++,n=(0,MRe.num_to_s)(r);return t.store.add(e),t.cache.setValue(e,n),n}function _Re(t,e){Ol.config.sort_key&&e.sort();let r=e.join(",");if(t.cache.hasSchema(r))return t.cache.getSchema(r);let n=wm(t,e,void 0);return t.cache.setSchema(r,n),n}function wm(t,e,r){if(e===null)return"";switch(typeof e){case"undefined":if(Array.isArray(r))return wm(t,null,r);break;case"object":if(e===null)return Ma(t,null);if(Array.isArray(e)){let n="a";for(let i=0;i<e.length;i++){let s=e[i],o=s===null?"_":wm(t,s,e);n+="|"+o}return n==="a"&&(n="a|"),Ma(t,n)}else{let n=Object.keys(e);if(n.length===0)return Ma(t,"o|");let i="o",s=_Re(t,n);i+="|"+s;for(let o of n){let a=e[o],A=wm(t,a,e);i+="|"+A}return Ma(t,i)}case"boolean":return Ma(t,(0,_k.encodeBool)(e));case"number":return Number.isNaN(e)?Ol.config.preserve_nan?Ma(t,"N|0"):(Ol.config.error_on_nan&&(0,wy.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===e?Ol.config.preserve_infinite?Ma(t,"N|+"):(Ol.config.error_on_infinite&&(0,wy.throwUnsupportedData)("[number Infinity]"),""):Number.NEGATIVE_INFINITY===e?Ol.config.preserve_infinite?Ma(t,"N|-"):(Ol.config.error_on_infinite&&(0,wy.throwUnsupportedData)("[number -Infinity]"),""):Ma(t,(0,_k.encodeNum)(e));case"string":return Ma(t,(0,_k.encodeStr)(e))}return(0,wy.throwUnknownDataType)(e)}});var Kk=R(Sm=>{"use strict";h();Object.defineProperty(Sm,"__esModule",{value:!0});Sm.compress=GRe;Sm.decode=bm;Sm.decompress=HRe;var Gk=Fk(),Lj=Pk(),Ok=Uk(),URe=Qy();function GRe(t){let e=(0,Ok.makeInMemoryMemory)(),r=(0,Ok.addValue)(e,t,void 0);return[(0,Ok.memToValues)(e),r]}function ORe(t,e){if(e==="o|")return{};let r={},n=e.split("|"),i=n[1],s=bm(t,i),o=n.length;o-2===1&&!Array.isArray(s)&&(s=[s]);for(let a=2;a<o;a++){let A=s[a-2],c=n[a];c=bm(t,c),r[A]=c}return r}function KRe(t,e){if(e==="a|")return[];let r=e.split("|"),n=r.length-1,i=new Array(n);for(let s=0;s<n;s++){let o=r[s+1];o=bm(t,o),i[s]=o}return i}function bm(t,e){if(e===""||e==="_")return null;let r=(0,Lj.decodeKey)(e),n=t[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":if(n[1]==="|")switch(n[0]){case"b":switch(n[2]){case"T":return!0;case"F":return!1;default:return(0,Gk.throwUnknownDataType)(n)}case"o":return ORe(t,n);case"n":return(0,URe.s_to_num)(n.slice(2));case"N":switch(n[2]){case"+":return 1/0;case"-":return-1/0;case"0":return NaN;default:return(0,Gk.throwUnknownDataType)(n)}case"a":return KRe(t,n)}return(0,Lj.decodeStr)(n)}return(0,Gk.throwUnknownDataType)(n)}function HRe(t){let[e,r]=t;return bm(e,r)}});var Uj=R(by=>{"use strict";h();Object.defineProperty(by,"__esModule",{value:!0});by.trimUndefined=JRe;by.trimUndefinedRecursively=YRe;function JRe(t){for(let e in t)t[e]===void 0&&delete t[e]}function YRe(t){_j(t,new Set)}function _j(t,e){e.add(t);for(let r in t)if(t[r]===void 0)delete t[r];else{let n=t[r];n&&typeof n=="object"&&!e.has(n)&&_j(n,e)}}});var Kj=R(pi=>{"use strict";h();Object.defineProperty(pi,"__esModule",{value:!0});pi.config=pi.trimUndefinedRecursively=pi.trimUndefined=pi.addValue=pi.decode=pi.decompress=pi.compress=void 0;var Gj=Kk();Object.defineProperty(pi,"compress",{enumerable:!0,get:function(){return Gj.compress}});Object.defineProperty(pi,"decompress",{enumerable:!0,get:function(){return Gj.decompress}});var jRe=Kk();Object.defineProperty(pi,"decode",{enumerable:!0,get:function(){return jRe.decode}});var qRe=Uk();Object.defineProperty(pi,"addValue",{enumerable:!0,get:function(){return qRe.addValue}});var Oj=Uj();Object.defineProperty(pi,"trimUndefined",{enumerable:!0,get:function(){return Oj.trimUndefined}});Object.defineProperty(pi,"trimUndefinedRecursively",{enumerable:!0,get:function(){return Oj.trimUndefinedRecursively}});var $Re=Lk();Object.defineProperty(pi,"config",{enumerable:!0,get:function(){return $Re.config}})});async function Hj(t,e){let n={components:(await e.getRegistry()).components.filter(s=>s.isRegistered).map(s=>{let o={filePath:No(t.relative(t.getAppRootDir(),s.filePath)),name:s.name,image:s.image,description:s.description,exportName:s.exportName,inputs:Is(s.inputs)};return Is(o)}),version:1};t.debug("exporting registry components:",n.components.length);let i=(0,Sy.compress)(n);return btoa(JSON.stringify(i))}async function Jj(t,e,r){if(typeof r!="string")throw new Error("Invalid registry to import");let n=await e.getRegistry(),i=JSON.parse(atob(r)),s=(0,Sy.decompress)(i),o=Is(n);t.debug("importing registry components:",s.components.length);for(let a of s.components){let A=No(t.normalize(a.filePath)),c=n.components.find(l=>No(l.filePath).endsWith(A)&&l.exportName===a.exportName);if(!c){VRe.error(`Could not find component to register: ${a.filePath}, ${a.exportName}`);continue}t.debug(`register (${c.id})`,c.filePath),await e.registerComponent({cmpId:c.id});for(let l of a.inputs)t.debug(`set input (${c.id})`),await e.setRegisteredComponentInput({cmpId:c.id,name:l.name,type:l.type,required:l.required,defaultValue:l.defaultValue,friendlyName:l.friendlyName,helperText:l.helperText});t.debug(`set input (${c.id}) info`);let u=await e.setRegisteredComponentInfo({cmpId:c.id,name:a.name,image:a.image,description:a.description});o=Is(u)}return o}var Sy,VRe,Yj=L(()=>{"use strict";h();Qt();Dt();Sy=z(Kj(),1),VRe=Se("ImportExportRegistry")});var zi,NSt,jj=L(()=>{"use strict";h();xn();zi={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik",vue:"vue",native:"native"},NSt={[zi.react]:[{version:Ze.gen1,recommended:!0},{version:Ze.gen2,recommended:!1}],[zi.remix]:[{version:Ze.gen1,recommended:!1},{version:Ze.gen2,recommended:!0}],[zi.angular]:[{version:Ze.gen2,recommended:!0}],[zi.next]:[{version:Ze.gen1,recommended:!0},{version:Ze.gen2,recommended:!1}],[zi.qwik]:[{version:Ze.gen2,recommended:!0}],[zi.vue]:[{version:Ze.gen1,recommended:!0},{version:Ze.gen2,recommended:!1}]}});async function qj(t,e){let r=[],n=new Set;async function i(s){let o=t.join(s,"package.json");try{if(!await t.exists(o))return null;let A=await t.readFile(o);if(A===null)throw new Error(`Failed to read package.json at ${o}`);let c=JSON.parse(A);if(typeof c.name!="string"||c.name.trim()===""||n.has(c.name))return null;n.add(c.name);let u={name:c.name,subPackages:[]},l=await t.readdir(s);for(let d of l)d!=="node_modules"&&(await t.stat(t.join(s,d))).isDirectory()&&u.subPackages.push(d);return r.push(u),u}catch(a){return t.Sentry?.captureException(a,{level:"warning"}),null}}try{let s=t.join(e,"package.json");if(await t.exists(s)){let a=await t.readFile(s);if(a!==null){let A=JSON.parse(a),c={...A.dependencies,...A.devDependencies};for(let u of Object.keys(c)){let l=t.join(e,"node_modules",u);await i(l)}if(Array.isArray(A.workspaces))for(let u of A.workspaces){let l=await t.readdir(t.join(e,u));for(let d of l){let g=t.join(e,u,d);await i(g)}}}}}catch(s){t.Sentry?.captureException(s,{level:"warning"})}return r}var $j=L(()=>{"use strict";h()});async function Jp(t,e=!1){if(!t.ts)throw new Error("createDevTools() requires a TypeScript instance passed to the 'ts' option");if((!t.frameworks||t.frameworks.length===0)&&(t.frameworks=await Fl(t)),t.frameworks.length===0&&e&&t.frameworks.push({name:"native"}),t.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let r of t.frameworks){let n=WRe[r.name];if(n)try{let i=await n(t);return{...i,exportRegistry:()=>Hj(t,i),importRegistry:o=>Jj(t,i,o),framework:zRe[r.name],findAllDependencies:async()=>await qj(t,t.getRepoRootDir())}}catch(i){t.Sentry?.captureException(i,{level:"warning"})}}throw new Error(`Devtools framework not found for ${t.getAppRootDir()}, ${JSON.stringify(t.frameworks,null,2)}`)}var WRe,zRe,Vj=L(()=>{"use strict";h();kl();z9();pY();DY();PY();mj();vj();Yj();jj();$j();WRe={"@builder.io/qwik-city":gY,next:W9,"@remix-run/react":QY,react:pk,"@angular/core":hj,vue:Sj,native:pk},zRe={"@builder.io/qwik-city":zi.qwik,next:zi.next,"@remix-run/react":zi.remix,react:zi.react,"@angular/core":zi.angular,vue:zi.vue,native:zi.native}});var vm,Hk=L(()=>{"use strict";h();vm=class{connections=new Set;maxConnections=1e3;sys;healthCheckInterval=null;HEALTH_CHECK_INTERVAL_MS=3e4;constructor(e){this.sys=e,this.startHealthMonitoring()}addConnection(e,r){if(this.connections.size>=this.maxConnections){let n=`Max connections (${this.maxConnections}) reached, rejecting new connection`;return console.error(`[ConnectionTracker] ${n}`),this.sys.Sentry?.captureMessage(n,{level:"error",tags:{component:"ConnectionTracker",maxConnections:this.maxConnections.toString(),currentConnections:this.connections.size.toString(),requestUrl:r?.url||"unknown",requestMethod:r?.method||"unknown",userAgent:r?.headers?.["user-agent"]||"unknown",origin:r?.headers?.origin||"unknown",referer:r?.headers?.referer||"unknown"},extra:{connectionLimit:this.maxConnections,activeConnections:this.connections.size,requestHeaders:r?.headers||{},requestUrl:r?.url}}),!1}return this.connections.add(e),e.on("close",()=>{this.removeConnection(e)}),e.on("error",()=>{this.removeConnection(e)}),!0}removeConnection(e){this.connections.delete(e)}getConnectionCount(){return this.connections.size}cleanup(){for(let e of this.connections)e.writable&&e.write(`HTTP/1.1 503 Service Unavailable\r
|
|
1095
|
+
`}var bj=L(()=>{"use strict";h();Qt()});async function Sj(t){let e=await QRe(t);return{builderPageOptions:async()=>({templateContentId:"vue-demo-template-id",pathname:"/builder-demo",title:"Builder + Vue Demo Page"}),ensureBuilderSetup:async()=>(await Qj(e)).errors.length>0?[]:[],ensureFigmaImportPage:()=>Dj(e),getRegistryPath:()=>e.registryPath,getRegistry:n=>Gl(e,{readAllInputTypes:!!n?.readAllInputTypes}),addExternalPackage:n=>{e.addExternalPackage(n)},loadComponent:async n=>{let i=await Gl(e,{readAllInputTypes:!1}),s=i.components.find(o=>o.id===n.cmpId);return{...i,component:s}},registerComponent:async n=>Gl(e,{readAllInputTypes:!1}),setRegisteredComponentInfo:async n=>Gl(e,{readAllInputTypes:!1}),setRegisteredComponentInput:async n=>Gl(e,{readAllInputTypes:!1}),unregisterComponent:async n=>Gl(e,{readAllInputTypes:!1}),getPublicApiKey:()=>Qm(e),setPublicApiKey:n=>Cj(e,n.publicApiKey),getDependencies:n=>n.sdkVersion===Ze.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-vue"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/vue"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Os(e),setCache:n=>Ks(e,n)}}async function QRe(t){let e=await DRe(t),r=t.getAppRootDir(),n=t.join(r,"src"),i=await vi(t),s={},o={...t,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",vueConfigPath:e,typescriptEnabled:i,configType:"",isNuxt:await wRe(t),addExternalPackage:c=>{s[t.join(r,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>s[c]??t.readFileSync(c),existsSync:c=>!!s[c]||t.existsSync(c),readdirSync:c=>{let u=t.readdirSync(c);return c===r?[...u,...Object.keys(s).map(l=>l.slice(r.length+1))]:u},readdir:async c=>{let u=await t.readdir(c);return c===r?[...u,...Object.keys(s).map(l=>l.slice(r.length+1))]:u}};e.includes("webpack.config")&&(o.configType="webpack"),(e.includes("vite.config")||e.includes("nuxt.config"))&&(o.configType="vite");let a=await t.exists(n);o.srcDir=a?n:null;let A=[t.join(r,"components"),t.join(r,"src","components"),t.join(r,"app","components")];for(let c of A)if(await t.exists(c)){o.componentsDir=c;break}return o.componentsDir||(o.componentsDir=a?t.join(n,"components"):t.join(r,"components")),o.registryPath=await $i(t,o.componentsDir),o}async function DRe(t){let e=["nuxt.config.ts","nuxt.config.js","vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts","vue.config.js","vue.config.ts"];for(let r of e){let n=t.join(t.getAppRootDir(),r);if(await t.exists(n))return n}if(t.ignoreMissingConfig)return"";throw new Error(`Could not find Vue config file. Searched for ${e.join(", ")} in "${t.getAppRootDir()}".`)}async function wRe(t){let e=["nuxt.config.ts","nuxt.config.js"];for(let r of e){let n=t.join(t.getAppRootDir(),r);if(await t.exists(n))return!0}try{let r=t.join(t.getAppRootDir(),"package.json");if(await t.exists(r)){let n=JSON.parse(await t.readFile(r)||"{}"),i={...n.dependencies,...n.devDependencies};return!!(i.nuxt||i["@nuxt/kit"]||i.nuxt3)}}catch{}return!1}var vj=L(()=>{"use strict";h();Rl();Sk();yj();xn();gi();bj()});var Fk=R(Dm=>{"use strict";h();Object.defineProperty(Dm,"__esModule",{value:!0});Dm.getType=xj;Dm.throwUnknownDataType=bRe;Dm.throwUnsupportedData=SRe;function xj(t){return Object.prototype.toString.call(t)}function bRe(t){throw new TypeError("unsupported data type: "+xj(t))}function SRe(t){throw new TypeError("unsupported data type: "+t)}});var Qy=R(PA=>{"use strict";h();Object.defineProperty(PA,"__esModule",{value:!0});PA.s_to_int=Nk;PA.s_to_big_int=Fj;PA.int_to_s=Tk;PA.big_int_to_s=kj;PA.num_to_s=Nj;PA.int_str_to_s=yy;PA.s_to_num=Tj;var MA="";for(let t=0;t<10;t++){let e=String.fromCharCode(48+t);MA+=e}for(let t=0;t<26;t++){let e=String.fromCharCode(65+t);MA+=e}for(let t=0;t<26;t++){let e=String.fromCharCode(97+t);MA+=e}var Hp=MA.length,Rk={};for(let t=0;t<Hp;t++){let e=MA[t];Rk[e]=t}function Nk(t){let e=0,r=1;for(let n=t.length-1;n>=0;n--){let i=t[n],s=Rk[i];s*=r,e+=s,r*=Hp}return e}function Fj(t){let e=BigInt(0),r=BigInt(1),n=BigInt(Hp);for(let i=t.length-1;i>=0;i--){let s=t[i],o=BigInt(Rk[s]);o*=r,e+=o,r*=n}return e}function Tk(t){if(t===0)return MA[0];let e=[];for(;t!==0;){let r=t%Hp,n=MA[r];e.push(n),t-=r,t/=Hp}return e.reverse().join("")}function kj(t){let e=BigInt(0),r=BigInt(Hp);if(t===e)return MA[0];let n=[];for(;t!==e;){let i=t%r,s=MA[Number(i)];n.push(s),t/=r}return n.reverse().join("")}function Rj(t){return t.split("").reverse().join("")}function Nj(t){if(t<0)return"-"+Nj(-t);let[e,r]=t.toString().split(".");if(!r)if(e.includes("e")){let[s,o]=e.split("e");e=s,r="0e"+o}else return Tk(t);let n;r&&([r,n]=r.split("e")),e=yy(e),r=Rj(r),r=yy(r);let i=e+"."+r;if(n){switch(i+=".",n[0]){case"+":n=n.slice(1);break;case"-":i+="-",n=n.slice(1);break}n=yy(n),i+=n}return i}function yy(t){let e=+t;return e.toString()===t&&e+1!==e&&e-1!==e?Tk(e):":"+kj(BigInt(t))}function kk(t){return t[0]===":"?Fj(t.substring(1)).toString():Nk(t).toString()}function Tj(t){if(t[0]==="-")return-Tj(t.substr(1));let[e,r,n]=t.split(".");if(!r)return Nk(e);e=kk(e),r=kk(r),r=Rj(r);let i=e+"."+r;if(n){i+="e";let s=!1;n[0]==="-"&&(s=!0,n=n.slice(1)),n=kk(n),i+=s?-n:+n}return+i}});var Pk=R(LA=>{"use strict";h();Object.defineProperty(LA,"__esModule",{value:!0});LA.encodeNum=vRe;LA.decodeNum=xRe;LA.decodeKey=FRe;LA.encodeBool=kRe;LA.decodeBool=RRe;LA.encodeStr=NRe;LA.decodeStr=TRe;var Mk=Qy();function vRe(t){return t===1/0?"N|+":t===-1/0?"N|-":Number.isNaN(t)?"N|0":"n|"+(0,Mk.num_to_s)(t)}function xRe(t){if(t.length===3&&t[0]==="N"&&t[1]==="|")switch(t[2]){case"+":return 1/0;case"-":return-1/0;case"0":return NaN}return(0,Mk.s_to_num)(t.slice(2))}function FRe(t){return typeof t=="number"?t:(0,Mk.s_to_int)(t)}function kRe(t){return t?"b|T":"b|F"}function RRe(t){if(t.length===3&&t[0]==="b"&&t[1]==="|")switch(t[2]){case"T":return!0;case"F":return!1}return!!t}function NRe(t){if(t[1]==="|")switch(t[0]){case"b":case"o":case"n":case"a":case"s":return"s|"+t}return t}function TRe(t){return t[0]==="s"&&t[1]==="|"?t.substr(2):t}});var Lk=R(Dy=>{"use strict";h();Object.defineProperty(Dy,"__esModule",{value:!0});Dy.config=void 0;Dy.config={sort_key:!1,preserve_nan:!1,error_on_nan:!1,preserve_infinite:!1,error_on_infinite:!1}});var Uk=R(Kl=>{"use strict";h();Object.defineProperty(Kl,"__esModule",{value:!0});Kl.memToValues=PRe;Kl.makeInMemoryStore=Mj;Kl.makeInMemoryCache=Pj;Kl.makeInMemoryMemory=LRe;Kl.addValue=wm;var Ol=Lk(),wy=Fk(),_k=Pk(),MRe=Qy();function PRe(t){return t.store.toArray()}function Mj(){let t=[];return{forEach(e){for(let r=0;r<t.length;r++)if(e(t[r])==="break")return},add(e){t.push(e)},toArray(){return t}}}function Pj(){let t=Object.create(null),e=Object.create(null);return{getValue(r){return t[r]},getSchema(r){return e[r]},forEachValue(r){for(let[n,i]of Object.entries(t))if(r(n,i)==="break")return},forEachSchema(r){for(let[n,i]of Object.entries(e))if(r(n,i)==="break")return},setValue(r,n){t[r]=n},setSchema(r,n){e[r]=n},hasValue(r){return r in t},hasSchema(r){return r in e}}}function LRe(){return{store:Mj(),cache:Pj(),keyCount:0}}function Ma(t,e){if(t.cache.hasValue(e))return t.cache.getValue(e);let r=t.keyCount++,n=(0,MRe.num_to_s)(r);return t.store.add(e),t.cache.setValue(e,n),n}function _Re(t,e){Ol.config.sort_key&&e.sort();let r=e.join(",");if(t.cache.hasSchema(r))return t.cache.getSchema(r);let n=wm(t,e,void 0);return t.cache.setSchema(r,n),n}function wm(t,e,r){if(e===null)return"";switch(typeof e){case"undefined":if(Array.isArray(r))return wm(t,null,r);break;case"object":if(e===null)return Ma(t,null);if(Array.isArray(e)){let n="a";for(let i=0;i<e.length;i++){let s=e[i],o=s===null?"_":wm(t,s,e);n+="|"+o}return n==="a"&&(n="a|"),Ma(t,n)}else{let n=Object.keys(e);if(n.length===0)return Ma(t,"o|");let i="o",s=_Re(t,n);i+="|"+s;for(let o of n){let a=e[o],A=wm(t,a,e);i+="|"+A}return Ma(t,i)}case"boolean":return Ma(t,(0,_k.encodeBool)(e));case"number":return Number.isNaN(e)?Ol.config.preserve_nan?Ma(t,"N|0"):(Ol.config.error_on_nan&&(0,wy.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===e?Ol.config.preserve_infinite?Ma(t,"N|+"):(Ol.config.error_on_infinite&&(0,wy.throwUnsupportedData)("[number Infinity]"),""):Number.NEGATIVE_INFINITY===e?Ol.config.preserve_infinite?Ma(t,"N|-"):(Ol.config.error_on_infinite&&(0,wy.throwUnsupportedData)("[number -Infinity]"),""):Ma(t,(0,_k.encodeNum)(e));case"string":return Ma(t,(0,_k.encodeStr)(e))}return(0,wy.throwUnknownDataType)(e)}});var Kk=R(Sm=>{"use strict";h();Object.defineProperty(Sm,"__esModule",{value:!0});Sm.compress=GRe;Sm.decode=bm;Sm.decompress=HRe;var Gk=Fk(),Lj=Pk(),Ok=Uk(),URe=Qy();function GRe(t){let e=(0,Ok.makeInMemoryMemory)(),r=(0,Ok.addValue)(e,t,void 0);return[(0,Ok.memToValues)(e),r]}function ORe(t,e){if(e==="o|")return{};let r={},n=e.split("|"),i=n[1],s=bm(t,i),o=n.length;o-2===1&&!Array.isArray(s)&&(s=[s]);for(let a=2;a<o;a++){let A=s[a-2],c=n[a];c=bm(t,c),r[A]=c}return r}function KRe(t,e){if(e==="a|")return[];let r=e.split("|"),n=r.length-1,i=new Array(n);for(let s=0;s<n;s++){let o=r[s+1];o=bm(t,o),i[s]=o}return i}function bm(t,e){if(e===""||e==="_")return null;let r=(0,Lj.decodeKey)(e),n=t[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":if(n[1]==="|")switch(n[0]){case"b":switch(n[2]){case"T":return!0;case"F":return!1;default:return(0,Gk.throwUnknownDataType)(n)}case"o":return ORe(t,n);case"n":return(0,URe.s_to_num)(n.slice(2));case"N":switch(n[2]){case"+":return 1/0;case"-":return-1/0;case"0":return NaN;default:return(0,Gk.throwUnknownDataType)(n)}case"a":return KRe(t,n)}return(0,Lj.decodeStr)(n)}return(0,Gk.throwUnknownDataType)(n)}function HRe(t){let[e,r]=t;return bm(e,r)}});var Uj=R(by=>{"use strict";h();Object.defineProperty(by,"__esModule",{value:!0});by.trimUndefined=JRe;by.trimUndefinedRecursively=YRe;function JRe(t){for(let e in t)t[e]===void 0&&delete t[e]}function YRe(t){_j(t,new Set)}function _j(t,e){e.add(t);for(let r in t)if(t[r]===void 0)delete t[r];else{let n=t[r];n&&typeof n=="object"&&!e.has(n)&&_j(n,e)}}});var Kj=R(pi=>{"use strict";h();Object.defineProperty(pi,"__esModule",{value:!0});pi.config=pi.trimUndefinedRecursively=pi.trimUndefined=pi.addValue=pi.decode=pi.decompress=pi.compress=void 0;var Gj=Kk();Object.defineProperty(pi,"compress",{enumerable:!0,get:function(){return Gj.compress}});Object.defineProperty(pi,"decompress",{enumerable:!0,get:function(){return Gj.decompress}});var jRe=Kk();Object.defineProperty(pi,"decode",{enumerable:!0,get:function(){return jRe.decode}});var qRe=Uk();Object.defineProperty(pi,"addValue",{enumerable:!0,get:function(){return qRe.addValue}});var Oj=Uj();Object.defineProperty(pi,"trimUndefined",{enumerable:!0,get:function(){return Oj.trimUndefined}});Object.defineProperty(pi,"trimUndefinedRecursively",{enumerable:!0,get:function(){return Oj.trimUndefinedRecursively}});var $Re=Lk();Object.defineProperty(pi,"config",{enumerable:!0,get:function(){return $Re.config}})});async function Hj(t,e){let n={components:(await e.getRegistry()).components.filter(s=>s.isRegistered).map(s=>{let o={filePath:No(t.relative(t.getAppRootDir(),s.filePath)),name:s.name,image:s.image,description:s.description,exportName:s.exportName,inputs:Is(s.inputs)};return Is(o)}),version:1};t.debug("exporting registry components:",n.components.length);let i=(0,Sy.compress)(n);return btoa(JSON.stringify(i))}async function Jj(t,e,r){if(typeof r!="string")throw new Error("Invalid registry to import");let n=await e.getRegistry(),i=JSON.parse(atob(r)),s=(0,Sy.decompress)(i),o=Is(n);t.debug("importing registry components:",s.components.length);for(let a of s.components){let A=No(t.normalize(a.filePath)),c=n.components.find(l=>No(l.filePath).endsWith(A)&&l.exportName===a.exportName);if(!c){VRe.error(`Could not find component to register: ${a.filePath}, ${a.exportName}`);continue}t.debug(`register (${c.id})`,c.filePath),await e.registerComponent({cmpId:c.id});for(let l of a.inputs)t.debug(`set input (${c.id})`),await e.setRegisteredComponentInput({cmpId:c.id,name:l.name,type:l.type,required:l.required,defaultValue:l.defaultValue,friendlyName:l.friendlyName,helperText:l.helperText});t.debug(`set input (${c.id}) info`);let u=await e.setRegisteredComponentInfo({cmpId:c.id,name:a.name,image:a.image,description:a.description});o=Is(u)}return o}var Sy,VRe,Yj=L(()=>{"use strict";h();Qt();Dt();Sy=z(Kj(),1),VRe=Se("ImportExportRegistry")});var zi,NSt,jj=L(()=>{"use strict";h();xn();zi={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik",vue:"vue",native:"native"},NSt={[zi.react]:[{version:Ze.gen1,recommended:!0},{version:Ze.gen2,recommended:!1}],[zi.remix]:[{version:Ze.gen1,recommended:!1},{version:Ze.gen2,recommended:!0}],[zi.angular]:[{version:Ze.gen2,recommended:!0}],[zi.next]:[{version:Ze.gen1,recommended:!0},{version:Ze.gen2,recommended:!1}],[zi.qwik]:[{version:Ze.gen2,recommended:!0}],[zi.vue]:[{version:Ze.gen1,recommended:!0},{version:Ze.gen2,recommended:!1}]}});async function qj(t,e){let r=[],n=new Set;async function i(s){let o=t.join(s,"package.json");try{if(!await t.exists(o))return null;let A=await t.readFile(o);if(A===null)throw new Error(`Failed to read package.json at ${o}`);let c=JSON.parse(A);if(typeof c.name!="string"||c.name.trim()===""||n.has(c.name))return null;n.add(c.name);let u={name:c.name,subPackages:[]},l=await t.readdir(s);for(let d of l)d!=="node_modules"&&(await t.stat(t.join(s,d))).isDirectory()&&u.subPackages.push(d);return r.push(u),u}catch(a){return t.Sentry?.captureException(a,{level:"warning"}),null}}try{let s=t.join(e,"package.json");if(await t.exists(s)){let a=await t.readFile(s);if(a!==null){let A=JSON.parse(a),c={...A.dependencies,...A.devDependencies};for(let u of Object.keys(c)){let l=t.join(e,"node_modules",u);await i(l)}if(Array.isArray(A.workspaces))for(let u of A.workspaces){let l=await t.readdir(t.join(e,u));for(let d of l){let g=t.join(e,u,d);await i(g)}}}}}catch(s){t.Sentry?.captureException(s,{level:"warning"})}return r}var $j=L(()=>{"use strict";h()});async function Jp(t,e=!1){if(!t.ts)throw new Error("createDevTools() requires a TypeScript instance passed to the 'ts' option");if((!t.frameworks||t.frameworks.length===0)&&(t.frameworks=await Fl(t)),t.frameworks.length===0&&e&&t.frameworks.push({name:"native"}),t.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let r of t.frameworks){let n=WRe[r.name];if(n)try{let i=await n(t);return{...i,exportRegistry:()=>Hj(t,i),importRegistry:o=>Jj(t,i,o),framework:zRe[r.name],findAllDependencies:async()=>await qj(t,t.getRepoRootDir())}}catch(i){t.Sentry?.captureException(i,{level:"warning"})}}throw new Error(`Devtools framework not found for ${t.getAppRootDir()}, ${JSON.stringify(t.frameworks,null,2)}`)}var WRe,zRe,Vj=L(()=>{"use strict";h();kl();zY();p9();D9();P9();mj();vj();Yj();jj();$j();WRe={"@builder.io/qwik-city":g9,next:WY,"@remix-run/react":Q9,react:pk,"@angular/core":hj,vue:Sj,native:pk},zRe={"@builder.io/qwik-city":zi.qwik,next:zi.next,"@remix-run/react":zi.remix,react:zi.react,"@angular/core":zi.angular,vue:zi.vue,native:zi.native}});var vm,Hk=L(()=>{"use strict";h();vm=class{connections=new Set;maxConnections=1e3;sys;healthCheckInterval=null;HEALTH_CHECK_INTERVAL_MS=3e4;constructor(e){this.sys=e,this.startHealthMonitoring()}addConnection(e,r){if(this.connections.size>=this.maxConnections){let n=`Max connections (${this.maxConnections}) reached, rejecting new connection`;return console.error(`[ConnectionTracker] ${n}`),this.sys.Sentry?.captureMessage(n,{level:"error",tags:{component:"ConnectionTracker",maxConnections:this.maxConnections.toString(),currentConnections:this.connections.size.toString(),requestUrl:r?.url||"unknown",requestMethod:r?.method||"unknown",userAgent:r?.headers?.["user-agent"]||"unknown",origin:r?.headers?.origin||"unknown",referer:r?.headers?.referer||"unknown"},extra:{connectionLimit:this.maxConnections,activeConnections:this.connections.size,requestHeaders:r?.headers||{},requestUrl:r?.url}}),!1}return this.connections.add(e),e.on("close",()=>{this.removeConnection(e)}),e.on("error",()=>{this.removeConnection(e)}),!0}removeConnection(e){this.connections.delete(e)}getConnectionCount(){return this.connections.size}cleanup(){for(let e of this.connections)e.writable&&e.write(`HTTP/1.1 503 Service Unavailable\r
|
|
1096
1096
|
\r
|
|
1097
1097
|
`),e.destroy();this.connections.clear(),this.stopHealthMonitoring()}startHealthMonitoring(){this.healthCheckInterval||(this.healthCheckInterval=setInterval(()=>{this.performHealthCheck()},this.HEALTH_CHECK_INTERVAL_MS))}stopHealthMonitoring(){this.healthCheckInterval&&(clearInterval(this.healthCheckInterval),this.healthCheckInterval=null)}performHealthCheck(){let e=[];for(let r of this.connections)if(r.destroyed||!r.writable){e.push(r);continue}for(let r of e){this.removeConnection(r);try{r.destroy()}catch{}}}}});var Wj=L(()=>{"use strict";h()});var zj=L(()=>{"use strict";h();Hk();Wj();kl()});var gvt,Xj=L(()=>{"use strict";h();_r();Rp();Mo();kl();Dt();gvt=Se("NextConfig")});var Zj=L(()=>{"use strict";h();_r();Rp();Mo();Da()});var e6=L(()=>{"use strict";h();_r();Mo();Rp()});var t6=L(()=>{"use strict";h()});var r6=L(()=>{"use strict";h();Mo();_r()});var Jvt,n6=L(()=>{"use strict";h();kl();Pl();Xj();Zj();e6();t6();r6();Jvt=`
|
|
1098
1098
|
/** @type {import('next').NextConfig} */
|
|
@@ -1263,7 +1263,7 @@ ${A}`)}else n(`Request to ${t.url.href} failed with status ${o.statusCode}: ${a}
|
|
|
1263
1263
|
id
|
|
1264
1264
|
name
|
|
1265
1265
|
}
|
|
1266
|
-
}`};t.debug(`Get model id for model name "${e.model}"`);let s=(await Gd({url:r,method:"POST",headers:{Authorization:`Bearer ${e.privateAuthKey}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)})).data.models.find(A=>A.name===e.model);if(!s)return t.debug(`No model found for model name "${e.model}"`),!1;t.debug(`Data query, modelId: "${s.id}", urlPath: "${e.pageUrl}"`);let o=new URL("https://cdn.builder.io/api/v3/data");o.searchParams.set("limit","1"),o.searchParams.set("cachebust","true"),o.searchParams.set("collection","content"),o.searchParams.set("query.published.$ne","archived"),o.searchParams.set("query.query.$elemMatch.$and[0].property","urlPath"),o.searchParams.set("query.query.$elemMatch.$and[0].operator","is"),o.searchParams.set("query.query.$elemMatch.$and[0].value",e.pageUrl),o.searchParams.set("query.modelId",s.id),o.searchParams.set("apiKey",e.publicApiKey);let a=await Gd({url:o,method:"GET"});return t.debug(`Data results (${a.results.length}): ${o.href}`),a.results.length>0}async function xte(t,e){let r=new URL(`https://cdn.builder.io/api/v3/content/${e.model}`);r.searchParams.set("apiKey",e.publicApiKey),r.searchParams.set("cachebust","true"),r.searchParams.set("cb",Date.now().toString()),e.pageUrl&&(r.searchParams.set("url",e.pageUrl),t.debug(`get model: "${e.model}", pageUrl: "${e.pageUrl}":`,r.href)),e.id&&(r.searchParams.set("query.id",e.id),t.debug(`get model: "${e.model}", id: "${e.id}":`,r.href));let n=await Gd({url:r,method:"GET"});return t.debug(`get content results: ${n.results.length}`),n}async function Fte(t,e){let r=new URL(`https://cdn.builder.io/api/v1/write/${e.model}`);t.debug(`writing "${e.model}" content:`,r.href),await Gd({url:r,method:"POST",headers:{Authorization:`Bearer ${e.privateAuthKey}`},body:e.body})}var t1=L(()=>{"use strict";h();xn();bte()});var Od,kte,Rte,r1=L(()=>{"use strict";h();Od="page",kte="integration-welcome-screens",Rte="8d9ee72a33344b4b867918b442ebd0af"});async function Nte(t,e){let r=await xte(t,{model:kte,publicApiKey:Rte,id:e.templateContentId});if(!Array.isArray(r?.results)||r.results.length===0||!r.results[0].data?.blocks)throw new Error(`No Builder content found for id ${e.templateContentId}`);let n=JSON.stringify(r.results[0].data.blocks),i=UKe(e.publicApiKey,e.pathname,e.title,n);await Fte(t,{privateAuthKey:e.privateAuthKey,model:Od,body:i})}function UKe(t,e,r,n){return JSON.stringify({name:r,ownerId:t,published:"published",query:[{property:"urlPath",value:[e],operator:"is"}],data:{title:r,blocksString:n}})}var Tte=L(()=>{"use strict";h();t1();r1()});async function Mte(t,e,r,n){t.debug(`connect builder with public key: ${e}`),t.publicApiKey=e;let i=t.closeAppServer(),s=await t.setPublicApiKey({publicApiKey:e});if(s.modifiedType==="permission-error")return t.debug("permission error, failed to set public api key"),{success:!1,pathname:""};t.debug(`set public key: process.env.${s.envKey}=${e}`),process.env[s.envKey]=e;let o=await t.builderPageOptions();t.debug(`builder model: ${Od}, path: ${o.pathname}, template: ${o.templateContentId}`);let a=await vte(t,{model:Od,pageUrl:o.pathname,publicApiKey:e,privateAuthKey:r,kind:n});if(!a){await Nte(t,{templateContentId:o.templateContentId,pathname:o.pathname,title:o.title,publicApiKey:e,privateAuthKey:r});let u=5,l=0;for(;!a&&l<u;){await new Promise(g=>setTimeout(g,1e3));let d=await Ste({model:Od,pageUrl:o.pathname,publicApiKey:e,privateAuthKey:r});l++,d&&d.length>0&&(a=!0)}}await i,t.debug("ensure builder setup");let A=[];n===Am.VCP?A=await t.ensureFigmaImportPage():A=await t.ensureBuilderSetup(),s.modifiedType&&A.push({filePath:s.file,modifiedType:s.modifiedType}),A.forEach(u=>{u.displayFilePath=t.relative(t.getAppRootDir(),u.filePath)}),A.sort((u,l)=>u.filePath.localeCompare(l.filePath)),A.length>0?(t.debug(`modified files: ${A.map(u=>u.displayFilePath).join(", ")}`),await t.restartAppServer(),await new Promise(u=>setTimeout(u,500))):t.debug("no modified files");let c={success:!0,pathname:o.localePathname||o.pathname,modifiedFiles:A,platform:t.platform(),kind:n};return n===Am.VCP&&(c.pathname="/"),t.debug(`connected builder: ${c.pathname}`),c}async function Pte(t){let e=await t.builderPageOptions();t.debug(`validateBuilder, pathname: ${e.pathname}, localePathname: ${e.localePathname}, isValid: ${t.isValid}`);let r={isValid:t.isValid,pathname:e.localePathname||e.pathname,platform:t.platform()};if(t.isValid)return r;let n=await t.getPublicApiKey();return n.envValue?(t.debug(`public api key: ${n.envValue}, ${n.file}`),t.publicApiKey=n.envValue,t.debug("builder connection is valid"),r.isValid=!0,t.isValid=!0,r):(t.debug("missing public api key"),r)}var Lte=L(()=>{"use strict";h();xn();Tte();t1();r1()});async function _te(t,e){let r={type:e.type};switch(e.type){case"getCache":{r.data=await t.getCache();break}case"setCache":{await t.setCache(e.data);break}case"connectBuilder":{r.data=await Mte(t,e.data.publicApiKey,e.data.privateAuthKey,e.data.kind);break}case"enableDevTools":{r.data=KKe(t,e.data.enabled);break}case"getRegistry":{r.data=await t.getRegistry(e.data);break}case"launchEditor":{r.data=await t.launchEditor(e.data);break}case"validateBuilder":{r.data=await Pte(t);break}case"loadComponent":{r.data=await t.loadComponent(e.data);break}case"getAllProjectFiles":{t.getAllProjectFiles?r.data=await t.getAllProjectFiles():r.errors=["getAllProjectFiles not implemented"];break}case"registerComponent":{r.data=await t.registerComponent(e.data),t.serverShouldRestart=!0;break}case"setComponentInfo":{r.data=await t.setRegisteredComponentInfo(e.data),t.serverShouldRestart=!0;break}case"setComponentInput":{r.data=await t.setRegisteredComponentInput(e.data),t.serverShouldRestart=!0;break}case"unregisterComponent":{r.data=await t.unregisterComponent(e.data),t.serverShouldRestart=!0;break}case"getFrameworks":{r.data=t.getFrameworks();break}case"readdir":{n1(t,e.path)?r.data=await t.readdir(e.path,!0):r.errors=[`Invalid file request: ${e.path}`];break}case"readFile":{n1(t,e.path)?r.data=await t.readFile(e.path):r.errors=[`Invalid file request: ${e.path}`];break}case"writeFile":{n1(t,e.path)?await t.writeFile(e.path,e.content):r.errors=[`Invalid file request: ${e.path}`];break}case"ensureFigmaImportPage":{r.data=await t.ensureFigmaImportPage();break}case"transileFile":{r.data=await
|
|
1266
|
+
}`};t.debug(`Get model id for model name "${e.model}"`);let s=(await Gd({url:r,method:"POST",headers:{Authorization:`Bearer ${e.privateAuthKey}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)})).data.models.find(A=>A.name===e.model);if(!s)return t.debug(`No model found for model name "${e.model}"`),!1;t.debug(`Data query, modelId: "${s.id}", urlPath: "${e.pageUrl}"`);let o=new URL("https://cdn.builder.io/api/v3/data");o.searchParams.set("limit","1"),o.searchParams.set("cachebust","true"),o.searchParams.set("collection","content"),o.searchParams.set("query.published.$ne","archived"),o.searchParams.set("query.query.$elemMatch.$and[0].property","urlPath"),o.searchParams.set("query.query.$elemMatch.$and[0].operator","is"),o.searchParams.set("query.query.$elemMatch.$and[0].value",e.pageUrl),o.searchParams.set("query.modelId",s.id),o.searchParams.set("apiKey",e.publicApiKey);let a=await Gd({url:o,method:"GET"});return t.debug(`Data results (${a.results.length}): ${o.href}`),a.results.length>0}async function xte(t,e){let r=new URL(`https://cdn.builder.io/api/v3/content/${e.model}`);r.searchParams.set("apiKey",e.publicApiKey),r.searchParams.set("cachebust","true"),r.searchParams.set("cb",Date.now().toString()),e.pageUrl&&(r.searchParams.set("url",e.pageUrl),t.debug(`get model: "${e.model}", pageUrl: "${e.pageUrl}":`,r.href)),e.id&&(r.searchParams.set("query.id",e.id),t.debug(`get model: "${e.model}", id: "${e.id}":`,r.href));let n=await Gd({url:r,method:"GET"});return t.debug(`get content results: ${n.results.length}`),n}async function Fte(t,e){let r=new URL(`https://cdn.builder.io/api/v1/write/${e.model}`);t.debug(`writing "${e.model}" content:`,r.href),await Gd({url:r,method:"POST",headers:{Authorization:`Bearer ${e.privateAuthKey}`},body:e.body})}var t1=L(()=>{"use strict";h();xn();bte()});var Od,kte,Rte,r1=L(()=>{"use strict";h();Od="page",kte="integration-welcome-screens",Rte="8d9ee72a33344b4b867918b442ebd0af"});async function Nte(t,e){let r=await xte(t,{model:kte,publicApiKey:Rte,id:e.templateContentId});if(!Array.isArray(r?.results)||r.results.length===0||!r.results[0].data?.blocks)throw new Error(`No Builder content found for id ${e.templateContentId}`);let n=JSON.stringify(r.results[0].data.blocks),i=UKe(e.publicApiKey,e.pathname,e.title,n);await Fte(t,{privateAuthKey:e.privateAuthKey,model:Od,body:i})}function UKe(t,e,r,n){return JSON.stringify({name:r,ownerId:t,published:"published",query:[{property:"urlPath",value:[e],operator:"is"}],data:{title:r,blocksString:n}})}var Tte=L(()=>{"use strict";h();t1();r1()});async function Mte(t,e,r,n){t.debug(`connect builder with public key: ${e}`),t.publicApiKey=e;let i=t.closeAppServer(),s=await t.setPublicApiKey({publicApiKey:e});if(s.modifiedType==="permission-error")return t.debug("permission error, failed to set public api key"),{success:!1,pathname:""};t.debug(`set public key: process.env.${s.envKey}=${e}`),process.env[s.envKey]=e;let o=await t.builderPageOptions();t.debug(`builder model: ${Od}, path: ${o.pathname}, template: ${o.templateContentId}`);let a=await vte(t,{model:Od,pageUrl:o.pathname,publicApiKey:e,privateAuthKey:r,kind:n});if(!a){await Nte(t,{templateContentId:o.templateContentId,pathname:o.pathname,title:o.title,publicApiKey:e,privateAuthKey:r});let u=5,l=0;for(;!a&&l<u;){await new Promise(g=>setTimeout(g,1e3));let d=await Ste({model:Od,pageUrl:o.pathname,publicApiKey:e,privateAuthKey:r});l++,d&&d.length>0&&(a=!0)}}await i,t.debug("ensure builder setup");let A=[];n===Am.VCP?A=await t.ensureFigmaImportPage():A=await t.ensureBuilderSetup(),s.modifiedType&&A.push({filePath:s.file,modifiedType:s.modifiedType}),A.forEach(u=>{u.displayFilePath=t.relative(t.getAppRootDir(),u.filePath)}),A.sort((u,l)=>u.filePath.localeCompare(l.filePath)),A.length>0?(t.debug(`modified files: ${A.map(u=>u.displayFilePath).join(", ")}`),await t.restartAppServer(),await new Promise(u=>setTimeout(u,500))):t.debug("no modified files");let c={success:!0,pathname:o.localePathname||o.pathname,modifiedFiles:A,platform:t.platform(),kind:n};return n===Am.VCP&&(c.pathname="/"),t.debug(`connected builder: ${c.pathname}`),c}async function Pte(t){let e=await t.builderPageOptions();t.debug(`validateBuilder, pathname: ${e.pathname}, localePathname: ${e.localePathname}, isValid: ${t.isValid}`);let r={isValid:t.isValid,pathname:e.localePathname||e.pathname,platform:t.platform()};if(t.isValid)return r;let n=await t.getPublicApiKey();return n.envValue?(t.debug(`public api key: ${n.envValue}, ${n.file}`),t.publicApiKey=n.envValue,t.debug("builder connection is valid"),r.isValid=!0,t.isValid=!0,r):(t.debug("missing public api key"),r)}var Lte=L(()=>{"use strict";h();xn();Tte();t1();r1()});async function _te(t,e){let r={type:e.type};switch(e.type){case"getCache":{r.data=await t.getCache();break}case"setCache":{await t.setCache(e.data);break}case"connectBuilder":{r.data=await Mte(t,e.data.publicApiKey,e.data.privateAuthKey,e.data.kind);break}case"enableDevTools":{r.data=KKe(t,e.data.enabled);break}case"getRegistry":{r.data=await t.getRegistry(e.data);break}case"launchEditor":{r.data=await t.launchEditor(e.data);break}case"validateBuilder":{r.data=await Pte(t);break}case"loadComponent":{r.data=await t.loadComponent(e.data);break}case"getAllProjectFiles":{t.getAllProjectFiles?r.data=await t.getAllProjectFiles():r.errors=["getAllProjectFiles not implemented"];break}case"registerComponent":{r.data=await t.registerComponent(e.data),t.serverShouldRestart=!0;break}case"setComponentInfo":{r.data=await t.setRegisteredComponentInfo(e.data),t.serverShouldRestart=!0;break}case"setComponentInput":{r.data=await t.setRegisteredComponentInput(e.data),t.serverShouldRestart=!0;break}case"unregisterComponent":{r.data=await t.unregisterComponent(e.data),t.serverShouldRestart=!0;break}case"getFrameworks":{r.data=t.getFrameworks();break}case"readdir":{n1(t,e.path)?r.data=await t.readdir(e.path,!0):r.errors=[`Invalid file request: ${e.path}`];break}case"readFile":{n1(t,e.path)?r.data=await t.readFile(e.path):r.errors=[`Invalid file request: ${e.path}`];break}case"writeFile":{n1(t,e.path)?await t.writeFile(e.path,e.content):r.errors=[`Invalid file request: ${e.path}`];break}case"ensureFigmaImportPage":{r.data=await t.ensureFigmaImportPage();break}case"transileFile":{r.data=await cY(t,e);break}case"transileModule":{r.data=OF(t,e);break}case"getPastSyncInfo":{r.data=await t.getPastSyncInfo?.(e.data);break}case"resyncSnippet":{r.data=await t.resyncSnippet?.(e.data);break}case"localConfig":{r.data=await ld();break}default:r.errors=[`Unknown request type: ${JSON.stringify(e)}`]}return r}function n1(t,e){if(!e||e.includes(".."))return!1;e=e.replace(/\\/g,"/");let r=e.split("/"),n=r[r.length-1];if(n.length>0){let i=n.split(".").pop();if(i&&(i=`.${i}`.toLocaleLowerCase(),i=i.split("?")[0],!OKe.includes(i)))return!1}return GKe(t,e),!1}function GKe(t,e){if(!e)return!1;e=t.normalize(t.resolve(e));let r=t.getAppRootDir();return!(!e.startsWith(r)&&!e.includes("node_modules"))}function KKe(t,e){return!e&&t.serverShouldRestart&&setTimeout(()=>{console.log(`
|
|
1267
1267
|
Restarting server after Builder Devtools update...
|
|
1268
1268
|
`),t.restartAppServer()},10),t.enableAppWatch(!e),{enabled:e,platform:t.platform()}}var OKe,Ute=L(()=>{"use strict";h();Gs();oC();Lte();OKe=[".js",".jsx",".ts",".tsx",".json",".css",".scss",".sass",".less",".html",".htm",".xml",".svg",".png",".jpg",".jpeg",".gif",".ico",".webp",".woff",".woff2",".ttf",".eot",".mp4",".webm",".ogg",".md",".txt",".csv",".pdf"]});async function Gte(t){return Kte(t,`"use strict";(()=>{var fi=Object.create;var Bt=Object.defineProperty;var mi=Object.getOwnPropertyDescriptor;var vi=Object.getOwnPropertyNames;var gi=Object.getPrototypeOf,hi=Object.prototype.hasOwnProperty;var yi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),bi=(t,e)=>{for(var r in e)Bt(t,r,{get:e[r],enumerable:!0})},Ei=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vi(e))!hi.call(t,i)&&i!==r&&Bt(t,i,{get:()=>e[i],enumerable:!(n=mi(e,i))||n.enumerable});return t};var _i=(t,e,r)=>(r=t!=null?fi(gi(t)):{},Ei(e||!t||!t.__esModule?Bt(r,"default",{value:t,enumerable:!0}):r,t));var Gn=yi((Qe,Rt)=>{(function(t,e){"use strict";var r="0.7.33",n="",i="?",o="function",a="undefined",c="object",d="string",p="major",s="model",u="name",l="type",f="vendor",m="version",_="architecture",E="console",v="mobile",g="tablet",T="smarttv",L="wearable",k="embedded",w=350,C="Amazon",R="Apple",K="ASUS",z="BlackBerry",Q="Browser",P="Chrome",Ce="Edge",ce="Firefox",_e="Google",Me="Huawei",Re="LG",Oe="Microsoft",Be="Motorola",Te="Opera",we="Samsung",ke="Sharp",fe="Sony",me="Xiaomi",Ve="Zebra",U="Facebook",et=function(S,O){var I={};for(var q in S)O[q]&&O[q].length%2===0?I[q]=O[q].concat(S[q]):I[q]=S[q];return I},tt=function(S){for(var O={},I=0;I<S.length;I++)O[S[I].toUpperCase()]=S[I];return O},Cr=function(S,O){return typeof S===d?Fe(O).indexOf(Fe(S))!==-1:!1},Fe=function(S){return S.toLowerCase()},di=function(S){return typeof S===d?S.replace(/[^\\d\\.]/g,n).split(".")[0]:e},Ut=function(S,O){if(typeof S===d)return S=S.replace(/^\\s\\s*/,n),typeof O===a?S:S.substring(0,w)},He=function(S,O){for(var I=0,q,x,nt,D,qe,ie;I<O.length&&!qe;){var kr=O[I],Ar=O[I+1];for(q=x=0;q<kr.length&&!qe;)if(qe=kr[q++].exec(S),qe)for(nt=0;nt<Ar.length;nt++)ie=qe[++x],D=Ar[nt],typeof D===c&&D.length>0?D.length===2?typeof D[1]==o?this[D[0]]=D[1].call(this,ie):this[D[0]]=D[1]:D.length===3?typeof D[1]===o&&!(D[1].exec&&D[1].test)?this[D[0]]=ie?D[1].call(this,ie,D[2]):e:this[D[0]]=ie?ie.replace(D[1],D[2]):e:D.length===4&&(this[D[0]]=ie?D[3].call(this,ie.replace(D[1],D[2])):e):this[D]=ie||e;I+=2}},Mt=function(S,O){for(var I in O)if(typeof O[I]===c&&O[I].length>0){for(var q=0;q<O[I].length;q++)if(Cr(O[I][q],S))return I===i?e:I}else if(Cr(O[I],S))return I===i?e:I;return S},pi={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Rr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Or={browser:[[/\\b(?:crmo|crios)\\/([\\w\\.]+)/i],[m,[u,"Chrome"]],[/edg(?:e|ios|a)?\\/([\\w\\.]+)/i],[m,[u,"Edge"]],[/(opera mini)\\/([-\\w\\.]+)/i,/(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,/(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i],[u,m],[/opios[\\/ ]+([\\w\\.]+)/i],[m,[u,Te+" Mini"]],[/\\bopr\\/([\\w\\.]+)/i],[m,[u,Te]],[/(kindle)\\/([\\w\\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i,/(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i,/(?:ms|\\()(ie) ([\\w\\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,/(weibo)__([\\d\\.]+)/i],[u,m],[/(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i],[m,[u,"UC"+Q]],[/microm.+\\bqbcore\\/([\\w\\.]+)/i,/\\bqbcore\\/([\\w\\.]+).+microm/i],[m,[u,"WeChat(Win) Desktop"]],[/micromessenger\\/([\\w\\.]+)/i],[m,[u,"WeChat"]],[/konqueror\\/([\\w\\.]+)/i],[m,[u,"Konqueror"]],[/trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i],[m,[u,"IE"]],[/yabrowser\\/([\\w\\.]+)/i],[m,[u,"Yandex"]],[/(avast|avg)\\/([\\w\\.]+)/i],[[u,/(.+)/,"$1 Secure "+Q],m],[/\\bfocus\\/([\\w\\.]+)/i],[m,[u,ce+" Focus"]],[/\\bopt\\/([\\w\\.]+)/i],[m,[u,Te+" Touch"]],[/coc_coc\\w+\\/([\\w\\.]+)/i],[m,[u,"Coc Coc"]],[/dolfin\\/([\\w\\.]+)/i],[m,[u,"Dolphin"]],[/coast\\/([\\w\\.]+)/i],[m,[u,Te+" Coast"]],[/miuibrowser\\/([\\w\\.]+)/i],[m,[u,"MIUI "+Q]],[/fxios\\/([-\\w\\.]+)/i],[m,[u,ce]],[/\\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+Q]],[/(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i],[[u,/(.+)/,"$1 "+Q],m],[/(comodo_dragon)\\/([\\w\\.]+)/i],[[u,/_/g," "],m],[/(electron)\\/([\\w\\.]+) safari/i,/(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i],[u,m],[/(metasr)[\\/ ]?([\\w\\.]+)/i,/(lbbrowser)/i,/\\[(linkedin)app\\]/i],[u],[/((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i],[[u,U],m],[/safari (line)\\/([\\w\\.]+)/i,/\\b(line)\\/([\\w\\.]+)\\/iab/i,/(chromium|instagram)[\\/ ]([-\\w\\.]+)/i],[u,m],[/\\bgsa\\/([\\w\\.]+) .*safari\\//i],[m,[u,"GSA"]],[/headlesschrome(?:\\/([\\w\\.]+)| )/i],[m,[u,P+" Headless"]],[/ wv\\).+(chrome)\\/([\\w\\.]+)/i],[[u,P+" WebView"],m],[/droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i],[m,[u,"Android "+Q]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i],[u,m],[/version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i],[m,[u,"Mobile Safari"]],[/version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i],[m,u],[/webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i],[u,[m,Mt,pi]],[/(webkit|khtml)\\/([\\w\\.]+)/i],[u,m],[/(navigator|netscape\\d?)\\/([-\\w\\.]+)/i],[[u,"Netscape"],m],[/mobile vr; rv:([\\w\\.]+)\\).+firefox/i],[m,[u,ce+" Reality"]],[/ekiohf.+(flow)\\/([\\w\\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,/(firefox)\\/([\\w\\.]+)/i,/(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,/(links) \\(([\\w\\.]+)/i],[u,m],[/(cobalt)\\/([\\w\\.]+)/i],[u,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i],[[_,"amd64"]],[/(ia32(?=;))/i],[[_,Fe]],[/((?:i[346]|x)86)[;\\)]/i],[[_,"ia32"]],[/\\b(aarch64|arm(v?8e?l?|_?64))\\b/i],[[_,"arm64"]],[/\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i],[[_,"armhf"]],[/windows (ce|mobile); ppc;/i],[[_,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i],[[_,/ower/,n,Fe]],[/(sun4\\w)[;\\)]/i],[[_,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i],[[_,Fe]]],device:[[/\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i],[s,[f,we],[l,g]],[/\\b((?:s[cgp]h|gt|sm)-\\w+|galaxy nexus)/i,/samsung[- ]([-\\w]+)/i,/sec-(sgh\\w+)/i],[s,[f,we],[l,v]],[/((ipod|iphone)\\d+,\\d+)/i],[s,[f,R],[l,v]],[/(ipad\\d+,\\d+)/i],[s,[f,R],[l,g]],[/\\((ip(?:hone|od)[\\w ]*);/i],[s,[f,R],[l,v]],[/\\((ipad);[-\\w\\),; ]+apple/i,/applecoremedia\\/[\\w\\.]+ \\((ipad)/i,/\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i],[s,[f,R],[l,g]],[/(macintosh);/i],[s,[f,R]],[/\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i],[s,[f,Me],[l,g]],[/(?:huawei|honor)([-\\w ]+)[;\\)]/i,/\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i],[s,[f,Me],[l,v]],[/\\b(poco[\\w ]+)(?: bui|\\))/i,/\\b; (\\w+) build\\/hm\\1/i,/\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i,/\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i,/\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i],[[s,/_/g," "],[f,me],[l,v]],[/\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i],[[s,/_/g," "],[f,me],[l,g]],[/; (\\w+) bui.+ oppo/i,/\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i],[s,[f,"OPPO"],[l,v]],[/vivo (\\w+)(?: bui|\\))/i,/\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i],[s,[f,"Vivo"],[l,v]],[/\\b(rmx[12]\\d{3})(?: bui|;|\\))/i],[s,[f,"Realme"],[l,v]],[/\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,/\\bmot(?:orola)?[- ](\\w*)/i,/((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i],[s,[f,Be],[l,v]],[/\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i],[s,[f,Be],[l,g]],[/((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i],[s,[f,Re],[l,g]],[/(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,/\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,/\\blg-?([\\d\\w]+) bui/i],[s,[f,Re],[l,v]],[/(ideatab[-\\w ]+)/i,/lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i],[s,[f,"Lenovo"],[l,g]],[/(?:maemo|nokia).*(n900|lumia \\d+)/i,/nokia[-_ ]?([-\\w\\.]*)/i],[[s,/_/g," "],[f,"Nokia"],[l,v]],[/(pixel c)\\b/i],[s,[f,_e],[l,g]],[/droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i],[s,[f,_e],[l,v]],[/droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i],[s,[f,fe],[l,v]],[/sony tablet [ps]/i,/\\b(?:sony)?sgp\\w+(?: bui|\\))/i],[[s,"Xperia Tablet"],[f,fe],[l,g]],[/ (kb2005|in20[12]5|be20[12][59])\\b/i,/(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i],[s,[f,"OnePlus"],[l,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\\))/i,/(kf[a-z]+)( bui|\\)).+silk\\//i],[s,[f,C],[l,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i],[[s,/(.+)/g,"Fire Phone $1"],[f,C],[l,v]],[/(playbook);[-\\w\\),; ]+(rim)/i],[s,f,[l,g]],[/\\b((?:bb[a-f]|st[hv])100-\\d)/i,/\\(bb10; (\\w+)/i],[s,[f,z],[l,v]],[/(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i],[s,[f,K],[l,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i],[s,[f,K],[l,v]],[/(nexus 9)/i],[s,[f,"HTC"],[l,g]],[/(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,/(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\\w]*)/i],[f,[s,/_/g," "],[l,v]],[/droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i],[s,[f,"Acer"],[l,g]],[/droid.+; (m[1-5] note) bui/i,/\\bmz-([-\\w]{2,})/i],[s,[f,"Meizu"],[l,v]],[/\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i],[s,[f,ke],[l,v]],[/(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,/(hp) ([\\w ]+\\w)/i,/(asus)-?(\\w+)/i,/(microsoft); (lumia[\\w ]+)/i,/(lenovo)[-_ ]?([-\\w]+)/i,/(jolla)/i,/(oppo) ?([\\w ]+) bui/i],[f,s,[l,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\\/([\\w\\.]+)/i,/(nook)[\\w ]+build\\/(\\w+)/i,/(dell) (strea[kpr\\d ]*[\\dko])/i,/(le[- ]+pan)[- ]+(\\w{1,9}) bui/i,/(trinity)[- ]*(t\\d{3}) bui/i,/(gigaset)[- ]+(q\\w{1,9}) bui/i,/(vodafone) ([\\w ]+)(?:\\)| bui)/i],[f,s,[l,g]],[/(surface duo)/i],[s,[f,Oe],[l,g]],[/droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i],[s,[f,"Fairphone"],[l,v]],[/(u304aa)/i],[s,[f,"AT&T"],[l,v]],[/\\bsie-(\\w*)/i],[s,[f,"Siemens"],[l,v]],[/\\b(rct\\w+) b/i],[s,[f,"RCA"],[l,g]],[/\\b(venue[\\d ]{2,7}) b/i],[s,[f,"Dell"],[l,g]],[/\\b(q(?:mv|ta)\\w+) b/i],[s,[f,"Verizon"],[l,g]],[/\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i],[s,[f,"Barnes & Noble"],[l,g]],[/\\b(tm\\d{3}\\w+) b/i],[s,[f,"NuVision"],[l,g]],[/\\b(k88) b/i],[s,[f,"ZTE"],[l,g]],[/\\b(nx\\d{3}j) b/i],[s,[f,"ZTE"],[l,v]],[/\\b(gen\\d{3}) b.+49h/i],[s,[f,"Swiss"],[l,v]],[/\\b(zur\\d{3}) b/i],[s,[f,"Swiss"],[l,g]],[/\\b((zeki)?tb.*\\b) b/i],[s,[f,"Zeki"],[l,g]],[/\\b([yr]\\d{2}) b/i,/\\b(dragon[- ]+touch |dt)(\\w{5}) b/i],[[f,"Dragon Touch"],s,[l,g]],[/\\b(ns-?\\w{0,9}) b/i],[s,[f,"Insignia"],[l,g]],[/\\b((nxa|next)-?\\w{0,9}) b/i],[s,[f,"NextBook"],[l,g]],[/\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],s,[l,v]],[/\\b(lvtel\\-)?(v1[12]) b/i],[[f,"LvTel"],s,[l,v]],[/\\b(ph-1) /i],[s,[f,"Essential"],[l,v]],[/\\b(v(100md|700na|7011|917g).*\\b) b/i],[s,[f,"Envizen"],[l,g]],[/\\b(trio[-\\w\\. ]+) b/i],[s,[f,"MachSpeed"],[l,g]],[/\\btu_(1491) b/i],[s,[f,"Rotor"],[l,g]],[/(shield[\\w ]+) b/i],[s,[f,"Nvidia"],[l,g]],[/(sprint) (\\w+)/i],[f,s,[l,v]],[/(kin\\.[onetw]{3})/i],[[s,/\\./g," "],[f,Oe],[l,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i],[s,[f,Ve],[l,g]],[/droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i],[s,[f,Ve],[l,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,s,[l,E]],[/droid.+; (shield) bui/i],[s,[f,"Nvidia"],[l,E]],[/(playstation [345portablevi]+)/i],[s,[f,fe],[l,E]],[/\\b(xbox(?: one)?(?!; xbox))[\\); ]/i],[s,[f,Oe],[l,E]],[/smart-tv.+(samsung)/i],[f,[l,T]],[/hbbtv.+maple;(\\d+)/i],[[s,/^/,"SmartTV"],[f,we],[l,T]],[/(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i],[[f,Re],[l,T]],[/(apple) ?tv/i],[f,[s,R+" TV"],[l,T]],[/crkey/i],[[s,P+"cast"],[f,_e],[l,T]],[/droid.+aft(\\w)( bui|\\))/i],[s,[f,C],[l,T]],[/\\(dtv[\\);].+(aquos)/i,/(aquos-tv[\\w ]+)\\)/i],[s,[f,ke],[l,T]],[/(bravia[\\w ]+)( bui|\\))/i],[s,[f,fe],[l,T]],[/(mitv-\\w{5}) bui/i],[s,[f,me],[l,T]],[/\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,/hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w ]*; *(\\w[^;]*);([^;]*)/i],[[f,Ut],[s,Ut],[l,T]],[/\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i],[[l,T]],[/((pebble))app/i],[f,s,[l,L]],[/droid.+; (glass) \\d/i],[s,[f,_e],[l,L]],[/droid.+; (wt63?0{2,3})\\)/i],[s,[f,Ve],[l,L]],[/(quest( 2)?)/i],[s,[f,U],[l,L]],[/(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i],[f,[l,k]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i],[s,[l,v]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i],[s,[l,g]],[/\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i],[[l,g]],[/(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i],[[l,v]],[/(android[-\\w\\. ]{0,9});.+buil/i],[s,[f,"Generic"]]],engine:[[/windows.+ edge\\/([\\w\\.]+)/i],[m,[u,Ce+"HTML"]],[/webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i],[m,[u,"Blink"]],[/(presto)\\/([\\w\\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i,/ekioh(flow)\\/([\\w\\.]+)/i,/(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i,/(icab)[\\/ ]([23]\\.[\\d\\.]+)/i],[u,m],[/rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i],[m,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,m],[/(windows) nt 6\\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,/(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i],[u,[m,Mt,Rr]],[/(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i],[[u,"Windows"],[m,Mt,Rr]],[/ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,/cfnetwork\\/.+darwin/i],[[m,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\\w\\. ]*)/i,/(macintosh|mac_powerpc\\b)(?!.+haiku)/i],[[u,"Mac OS"],[m,/_/g,"."]],[/droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i],[m,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,/(blackberry)\\w*\\/([\\w\\.]*)/i,/(tizen|kaios)[\\/ ]([\\w\\.]+)/i,/\\((series40);/i],[u,m],[/\\(bb(10);/i],[m,[u,z]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i],[m,[u,"Symbian"]],[/mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i],[m,[u,ce+" OS"]],[/web0s;.+rt(tv)/i,/\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i],[m,[u,"webOS"]],[/crkey\\/([\\d\\.]+)/i],[m,[u,P+"cast"]],[/(cros) [\\w]+ ([\\w\\.]+\\w)/i],[[u,"Chromium OS"],m],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\\);]+)/i,/\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i,/(mint)[\\/\\(\\) ]?(\\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,/(hurd|linux) ?([\\w\\.]*)/i,/(gnu) ?([\\w\\.]*)/i,/\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i,/(haiku) (\\w+)/i],[u,m],[/(sunos) ?([\\w\\.\\d]*)/i],[[u,"Solaris"],m],[/((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,/(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,/\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\\w\\.]*)/i],[u,m]]},Z=function(S,O){if(typeof S===c&&(O=S,S=e),!(this instanceof Z))return new Z(S,O).getResult();var I=S||(typeof t!==a&&t.navigator&&t.navigator.userAgent?t.navigator.userAgent:n),q=O?et(Or,O):Or;return this.getBrowser=function(){var x={};return x[u]=e,x[m]=e,He.call(x,I,q.browser),x.major=di(x.version),x},this.getCPU=function(){var x={};return x[_]=e,He.call(x,I,q.cpu),x},this.getDevice=function(){var x={};return x[f]=e,x[s]=e,x[l]=e,He.call(x,I,q.device),x},this.getEngine=function(){var x={};return x[u]=e,x[m]=e,He.call(x,I,q.engine),x},this.getOS=function(){var x={};return x[u]=e,x[m]=e,He.call(x,I,q.os),x},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return I},this.setUA=function(x){return I=typeof x===d&&x.length>w?Ut(x,w):x,this},this.setUA(I),this};Z.VERSION=r,Z.BROWSER=tt([u,m,p]),Z.CPU=tt([_]),Z.DEVICE=tt([s,f,l,E,v,T,g,L,k]),Z.ENGINE=Z.OS=tt([u,m]),typeof Qe!==a?(typeof Rt!==a&&Rt.exports&&(Qe=Rt.exports=Z),Qe.UAParser=Z):typeof define===o&&define.amd?define(function(){return Z}):typeof t!==a&&(t.UAParser=Z);var Ae=typeof t!==a&&(t.jQuery||t.Zepto);if(Ae&&!Ae.ua){var rt=new Z;Ae.ua=rt.getResult(),Ae.ua.get=function(){return rt.getUA()},Ae.ua.set=function(S){rt.setUA(S);var O=rt.getResult();for(var I in O)Ae.ua[I]=O[I]}}})(typeof window=="object"?window:Qe)});var oe=(t,e)=>{Ft(t);let r=t.querySelector("aside");r.dataset.view=e,r.classList.remove("section-ready"),setTimeout(()=>{r.classList.add("section-ready")},200)},Dr=t=>{Array.from(t.querySelectorAll(".back-button")).forEach(e=>{e.addEventListener("click",r=>{Ft(t),r.preventDefault(),r.stopPropagation();let n=r.target;oe(t,n?.dataset.back||"nav-home")})})},Vt=(t,e)=>{Ft(t);let r=t.querySelector("aside"),n=document.createElement("div");n.className="ui-toast",n.innerHTML=e,r.appendChild(n),setTimeout(()=>{n.classList.add("ui-toast-show"),setTimeout(()=>{n.classList.remove("ui-toast-show"),setTimeout(()=>{n.remove()},500)},4e3)},30)},Ft=t=>{let e=t.querySelector("aside");Array.from(e.querySelectorAll(".ui-toast")).forEach(n=>{n.classList.remove("ui-toast-show")})},it=()=>{let t=Nr();return localStorage.getItem(t)!=="true"},Ht=t=>{let e=Nr();t?localStorage.removeItem(e):localStorage.setItem(e,"true")},Nr=()=>Ti("disableEdit"),Ti=t=>\`builder.__LOCAL_APP_ID__.\${t}\`,Ur=()=>{let e=document.body.querySelector("[builder-content-id]")?.getAttribute("builder-content-id");return je(e)},je=(t,e)=>{let r="/content";t&&(r+="/"+t+"/edit");let n=new URL(r,"https://builder.io");t&&e&&n.searchParams.set("selectedBlock",e);let i=new URL(location.pathname,location.href);return n.searchParams.set("overridePreviewUrl",i.href),n.href},ot="__DEV_TOOLS_URL__",G={components:[],registryPath:"",registryDisplayPath:"",frameworks:[],dependencies:[],publicApiKey:void 0,devToolsVersion:""},le=t=>{G.components=t.components,G.registryPath=t.registryPath,G.registryDisplayPath=t.registryDisplayPath,G.dependencies=t.dependencies,G.publicApiKey=t.publicApiKey};function Mr(t){let e=null,r=document.querySelector("builder-dev-tools-menu"),n=()=>{t.hide()},i=c=>{let d=c.target;if(!d){n();return}if(d.closest("builder-dev-tools-edit"))return;let p=d.closest("[builder-content-id]"),s=d.closest("[builder-id]");if(!p||!s){t.hide();return}let u=t.show(p,s);!u||u===e||(r.highlightOpener(),e=u)};document.addEventListener("pointerover",i,{passive:!0}),document.addEventListener("pointerleave",n,{passive:!0}),document.addEventListener("pointercancel",n,{passive:!0}),document.addEventListener("visibilitychange",n,{passive:!0}),window.addEventListener("popstate",n,{passive:!0});let o=history.pushState;history.pushState=function(...c){t.hide(),o.apply(this,c)};let a=history.replaceState;history.replaceState=function(...c){t.hide(),a.apply(this,c)}}var at=class extends HTMLElement{openInBuilder=null;block=null;constructor(){super()}connectedCallback(){this.setAttribute("aria-hidden","true");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)}:host{display:none;position:absolute;top:0;left:0;width:100%;height:100%;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}#content-highlight,#block{position:absolute}#content-highlight{border:3px solid var(--primary-color);background-color:var(--primary-color-alpha)}a{position:absolute;top:-33px;left:0;display:block;padding:5px 10px 8px;pointer-events:auto;z-index:100;text-decoration:none}a:hover{text-decoration:none}a span{display:block;padding:3px 6px;font-size:10px;font-weight:300;border-radius:3px;text-align:center;text-decoration:none;pointer-events:none;background-color:var(--edit-color);color:var(--text-color);white-space:nowrap}a:hover span{background-color:var(--edit-color-highlight)}a:hover~.outline{border-color:var(--edit-color-highlight)}#open-in-editor{display:none}.outline{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid var(--edit-color);background-color:var(--edit-color-alpha)}</style><div id="block"> <a id="open-in-builder" target="builder"><span>Open In Builder</span></a> <a id="open-in-editor" href="#open-in-editor"><span>Open In Editor</span></a> <div class="outline"></div> </div>',this.openInBuilder=e.getElementById("open-in-builder"),this.block=e.getElementById("block"),Mr(this)}show(e,r){if(!it())return this.hide(),null;let n=e.getAttribute("builder-content-id"),i=r.getAttribute("builder-id");if(!n||!i)return this.hide(),null;let o=this.block,a=this.openInBuilder,c=r.getBoundingClientRect();o.style.top=c.top+window.scrollY-1+"px",o.style.left=c.left+window.scrollX+"px",o.style.width=c.width+"px",o.style.height=c.height+1+"px";let d=a.getBoundingClientRect();if(d.width>c.width){let p=d.width-c.width;a.style.left=p/2*-1+"px"}else a.style.left="";return a.href=je(n,i),this.style.display="block",i}hide(){this.style.display=""}};var Br="preview-url";var Vr="_b-uid";var Fr="/~builder-connect";var Hr="/~builder-dev-tools";var qr="https://cdn.builder.io/api/v1/proxy-api?url=https://api2.amplitude.com/2/httpapi";var jr=()=>ae({type:"validateBuilder"}),De=t=>ae({type:"launchEditor",data:t}),Gr=t=>ae({type:"getRegistry",data:t}),Kr=t=>ae({type:"loadComponent",data:t}),Wr=t=>ae({type:"registerComponent",data:t}),$r=t=>ae({type:"setComponentInfo",data:t}),st=t=>ae({type:"setComponentInput",data:t}),Yr=t=>ae({type:"unregisterComponent",data:t}),zr=t=>ae({type:"enableDevTools",data:{enabled:t}}),Qr=()=>ae({type:"localConfig"}),ae=async t=>{let e=new URL(Hr,ot),r;try{r=await fetch(e,{method:"POST",body:JSON.stringify(t)})}catch(i){throw console.error(\`Devtools Fetch Error, \${e.href}\`,i),new Error("Builder Devtools Fetch Error")}if((r.headers.get("content-type")||"").includes("application/json")){let i=await r.json();if(r.ok)return i.data;if(Array.isArray(i.errors)&&i.errors.length>0)throw i.errors.forEach(o=>console.error(o)),new Error(\`Builder Devtools Fetch Error: \${i.errors[0]}\`)}throw new Error(\`Builder Devtools Fetch Error: \${r.status}, \${await r.text()}\`)};var Xr=[{value:"boolean",text:"boolean"},{value:"color",text:"color (provides a color in hex or rgb)"},{value:"date",text:"date (same format as the Date constructor)"},{value:"email",text:"email"},{value:"file",text:"file (uploads a file and provides a url)"},{value:"list",text:"list (collection of items)"},{value:"longText",text:"longText (multiline text editor)"},{value:"number",text:"number"},{value:"object",text:"object (set of specific names and values)"},{value:"richText",text:"richText (provides value as html)"},{value:"string",text:"string"}],ut=["color","date","email","file","longText","richText","string"],ct=["number"],lt=["boolean"],dt=["list"],pt=["object"];function ft(t){return ut.includes(t)?"string":ct.includes(t)?"number":lt.includes(t)?"boolean":dt.includes(t)?"array":pt.includes(t)?"object":"string"}var Io=new Set(["about","accessKey","accessKeyLabel","asChild","autoCapitalize","autoCorrect","autoFocus","autoSave","blur","contentEditable","contextMenu","dangerouslySetInnerHTML","datatype","defaultChecked","defaultValue","dir","draggable","enterKeyHint","focus","form","formAction","formEncType","formMethod","formNoValidate","formTarget","inlist","innerText","inputMode","is","isContentEditable","itemID","itemProp","itemRef","itemScope","itemType","lang","nonce","offsetHeight","offsetLeft","offsetTop","offsetWidth","outerText","prefix","property","radioGroup","rel","resource","results","rev","role","security","slot","spellCheck","suppressContentEditableWarning","suppressHydrationWarning","tabIndex","translate","typeof","unselectable","vocab"].map(t=>t.toLowerCase()));var qt=function(t,e){return qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},qt(t,e)};function se(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");qt(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var b=function(){return b=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},b.apply(this,arguments)};function Ge(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function h(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function c(s){try{p(n.next(s))}catch(u){a(u)}}function d(s){try{p(n.throw(s))}catch(u){a(u)}}function p(s){s.done?o(s.value):i(s.value).then(c,d)}p((n=n.apply(t,e||[])).next())})}function y(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(p){return function(s){return d([p,s])}}function d(p){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,p[0]&&(r=0)),r;)try{if(n=1,i&&(o=p[0]&2?i.return:p[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,p[1])).done)return o;switch(i=0,o&&(p=[p[0]&2,o.value]),p[0]){case 0:case 1:o=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,i=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!o||p[1]>o[0]&&p[1]<o[3])){r.label=p[1];break}if(p[0]===6&&r.label<o[1]){r.label=o[1],o=p;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(p);break}o[2]&&r.ops.pop(),r.trys.pop();continue}p=e.call(t,r)}catch(s){p=[6,s],i=0}finally{n=o=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function J(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function A(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function ee(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}var mt={};bi(mt,{IdentifyOperation:()=>B,LogLevel:()=>Y,PluginType:()=>N,RevenueProperty:()=>re,ServerZone:()=>Se,SpecialEventType:()=>de,Status:()=>M,TransportType:()=>Ie});var B;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(B||(B={}));var re;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE_CURRENCY="$currency",t.REVENUE="$revenue"})(re||(re={}));var de;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(de||(de={}));var Y;(function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"})(Y||(Y={}));var N;(function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"})(N||(N={}));var Se;(function(t){t.US="US",t.EU="EU",t.STAGING="STAGING"})(Se||(Se={}));var M;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(M||(M={}));var Ie;(function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"})(Ie||(Ie={}));var jt="-",xe="AMP",Gt="".concat(xe,"_unsent"),Kt="https://api2.amplitude.com/2/httpapi",Zr="https://api.eu.amplitude.com/2/httpapi",Jr="https://api2.amplitude.com/batch",en="https://api.eu.amplitude.com/batch";var wi=1e3,vt=function(t){if(Object.keys(t).length>wi)return!1;for(var e in t){var r=t[e];if(!Wt(e,r))return!1}return!0},Wt=function(t,e){var r,n;if(typeof t!="string")return!1;if(Array.isArray(e)){var i=!0;try{for(var o=J(e),a=o.next();!a.done;a=o.next()){var c=a.value;if(Array.isArray(c))return!1;if(typeof c=="object")i=i&&vt(c);else if(!["number","string"].includes(typeof c))return!1;if(!i)return!1}}catch(d){r={error:d}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(e==null)return!1;if(typeof e=="object")return vt(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0};var ne=(function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return b({},this._properties)},t.prototype.set=function(e,r){return this._safeSet(B.SET,e,r),this},t.prototype.setOnce=function(e,r){return this._safeSet(B.SET_ONCE,e,r),this},t.prototype.append=function(e,r){return this._safeSet(B.APPEND,e,r),this},t.prototype.prepend=function(e,r){return this._safeSet(B.PREPEND,e,r),this},t.prototype.postInsert=function(e,r){return this._safeSet(B.POSTINSERT,e,r),this},t.prototype.preInsert=function(e,r){return this._safeSet(B.PREINSERT,e,r),this},t.prototype.remove=function(e,r){return this._safeSet(B.REMOVE,e,r),this},t.prototype.add=function(e,r){return this._safeSet(B.ADD,e,r),this},t.prototype.unset=function(e){return this._safeSet(B.UNSET,e,jt),this},t.prototype.clearAll=function(){return this._properties={},this._properties[B.CLEAR_ALL]=jt,this},t.prototype._safeSet=function(e,r,n){if(this._validate(e,r,n)){var i=this._properties[e];return i===void 0&&(i={},this._properties[e]=i),i[r]=n,this._propertySet.add(r),!0}return!1},t.prototype._validate=function(e,r,n){return this._properties[B.CLEAR_ALL]!==void 0||this._propertySet.has(r)?!1:e===B.ADD?typeof n=="number":e!==B.UNSET&&e!==B.REMOVE?Wt(r,n):!0},t})();var tn=function(t,e,r){var n=typeof t=="string"?{event_type:t}:t;return b(b(b({},n),r),e&&{event_properties:e})},Ke=function(t,e){var r=b(b({},e),{event_type:de.IDENTIFY,user_properties:t.getUserProperties()});return r},rn=function(t,e,r,n){var i,o=b(b({},n),{event_type:de.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(i={},i[t]=e,i)});return o},nn=function(t,e,r){var n,i=new ne;i.set(t,e);var o=b(b({},r),{event_type:de.IDENTIFY,user_properties:i.getUserProperties(),groups:(n={},n[t]=e,n)});return o},on=function(t,e){return b(b({},e),{event_type:de.REVENUE,event_properties:t.getEventProperties()})};var ve=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=M.Unknown),{event:t,code:e,message:r}};var an=(function(){function t(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return t.prototype.register=function(e,r){return h(this,void 0,void 0,function(){return y(this,function(n){switch(n.label){case 0:return[4,e.setup(r,this.client)];case 1:return n.sent(),this.plugins.push(e),[2]}})})},t.prototype.deregister=function(e,r){var n;return h(this,void 0,void 0,function(){var i,o;return y(this,function(a){switch(a.label){case 0:return i=this.plugins.findIndex(function(c){return c.name===e}),i===-1?(r.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(o=this.plugins[i],this.plugins.splice(i,1),[4,(n=o.teardown)===null||n===void 0?void 0:n.call(o)]);case 1:return a.sent(),[2]}})})},t.prototype.reset=function(e){this.applying=!1;var r=this.plugins;r.map(function(n){var i;return(i=n.teardown)===null||i===void 0?void 0:i.call(n)}),this.plugins=[],this.client=e},t.prototype.push=function(e){var r=this;return new Promise(function(n){r.queue.push([e,n]),r.scheduleApply(0)})},t.prototype.scheduleApply=function(e){var r=this;this.applying||(this.applying=!0,setTimeout(function(){r.apply(r.queue.shift()).then(function(){r.applying=!1,r.queue.length>0&&r.scheduleApply(0)})},e))},t.prototype.apply=function(e){return h(this,void 0,void 0,function(){var r,n,i,o,a,c,d,f,m,p,s,u,l,f,m,_,E,v,g,T,L,k;return y(this,function(w){switch(w.label){case 0:if(!e)return[2];r=A(e,1),n=r[0],i=A(e,2),o=i[1],a=this.plugins.filter(function(C){return C.type===N.BEFORE}),w.label=1;case 1:w.trys.push([1,6,7,8]),c=J(a),d=c.next(),w.label=2;case 2:return d.done?[3,5]:(f=d.value,[4,f.execute(b({},n))]);case 3:if(m=w.sent(),m===null)return o({event:n,code:0,message:""}),[2];n=m,w.label=4;case 4:return d=c.next(),[3,2];case 5:return[3,8];case 6:return p=w.sent(),g={error:p},[3,8];case 7:try{d&&!d.done&&(T=c.return)&&T.call(c)}finally{if(g)throw g.error}return[7];case 8:s=this.plugins.filter(function(C){return C.type===N.ENRICHMENT}),w.label=9;case 9:w.trys.push([9,14,15,16]),u=J(s),l=u.next(),w.label=10;case 10:return l.done?[3,13]:(f=l.value,[4,f.execute(b({},n))]);case 11:if(m=w.sent(),m===null)return o({event:n,code:0,message:""}),[2];n=m,w.label=12;case 12:return l=u.next(),[3,10];case 13:return[3,16];case 14:return _=w.sent(),L={error:_},[3,16];case 15:try{l&&!l.done&&(k=u.return)&&k.call(u)}finally{if(L)throw L.error}return[7];case 16:return E=this.plugins.filter(function(C){return C.type===N.DESTINATION}),v=E.map(function(C){var R=b({},n);return C.execute(R).catch(function(K){return ve(R,0,String(K))})}),Promise.all(v).then(function(C){var R=A(C,1),K=R[0];o(K)}),[2]}})})},t.prototype.flush=function(){return h(this,void 0,void 0,function(){var e,r,n,i=this;return y(this,function(o){switch(o.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(a){return i.apply(a)}))];case 1:return o.sent(),r=this.plugins.filter(function(a){return a.type===N.DESTINATION}),n=r.map(function(a){return a.flush&&a.flush()}),[4,Promise.all(n)];case 2:return o.sent(),[2]}})})},t})();var sn="Event tracked successfully",un="Unexpected error occurred",cn="Event rejected due to exceeded retry count",ln="Event skipped due to optOut config",dn="Event rejected due to missing API key",pn="Invalid API key",fn="Client not initialized";var X=function(t){return{promise:t||Promise.resolve()}};var $t=(function(){function t(e){e===void 0&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new an(this),this.name=e}return t.prototype._init=function(e){return h(this,void 0,void 0,function(){return y(this,function(r){switch(r.label){case 0:return this.config=e,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return r.sent(),[2]}})})},t.prototype.runQueuedFunctions=function(e){return h(this,void 0,void 0,function(){var r,n,i,o,a,c,d;return y(this,function(p){switch(p.label){case 0:r=this[e],this[e]=[],p.label=1;case 1:p.trys.push([1,6,7,8]),n=J(r),i=n.next(),p.label=2;case 2:return i.done?[3,5]:(o=i.value,[4,o()]);case 3:p.sent(),p.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return a=p.sent(),c={error:a},[3,8];case 7:try{i&&!i.done&&(d=n.return)&&d.call(n)}finally{if(c)throw c.error}return[7];case 8:return[2]}})})},t.prototype.track=function(e,r,n){var i=tn(e,r,n);return X(this.dispatch(i))},t.prototype.identify=function(e,r){var n=Ke(e,r);return X(this.dispatch(n))},t.prototype.groupIdentify=function(e,r,n,i){var o=rn(e,r,n,i);return X(this.dispatch(o))},t.prototype.setGroup=function(e,r,n){var i=nn(e,r,n);return X(this.dispatch(i))},t.prototype.revenue=function(e,r){var n=on(e,r);return X(this.dispatch(n))},t.prototype.add=function(e){return this.config?X(this.timeline.register(e,this.config)):(this.q.push(this.add.bind(this,e)),X())},t.prototype.remove=function(e){return this.config?X(this.timeline.deregister(e,this.config)):(this.q.push(this.remove.bind(this,e)),X())},t.prototype.dispatchWithCallback=function(e,r){if(!this.config)return r(ve(e,0,fn));this.process(e).then(r)},t.prototype.dispatch=function(e){return h(this,void 0,void 0,function(){var r=this;return y(this,function(n){return this.config?[2,this.process(e)]:[2,new Promise(function(i){r.dispatchQ.push(r.dispatchWithCallback.bind(r,e,i))})]})})},t.prototype.process=function(e){return h(this,void 0,void 0,function(){var i,r,n,i;return y(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,ve(e,0,ln)]:[4,this.timeline.push(e)];case 1:return i=o.sent(),i.code===200?this.config.loggerProvider.log(i.message):this.config.loggerProvider.error(i.message),[2,i];case 2:return r=o.sent(),this.config.loggerProvider.error(r),n=String(r),i=ve(e,0,n),[2,i];case 3:return[2]}})})},t.prototype.setOptOut=function(e){if(!this.config){this.q.push(this.setOptOut.bind(this,!!e));return}this.config.optOut=!!e},t.prototype.flush=function(){return X(this.timeline.flush())},t})();var gt=(function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(e){return this.productId=e,this},t.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},t.prototype.setPrice=function(e){return this.price=e,this},t.prototype.setRevenueType=function(e){return this.revenueType=e,this},t.prototype.setCurrency=function(e){return this.currency=e,this},t.prototype.setRevenue=function(e){return this.revenue=e,this},t.prototype.setEventProperties=function(e){return vt(e)&&(this.properties=e),this},t.prototype.getEventProperties=function(){var e=this.properties?b({},this.properties):{};return e[re.REVENUE_PRODUCT_ID]=this.productId,e[re.REVENUE_QUANTITY]=this.quantity,e[re.REVENUE_PRICE]=this.price,e[re.REVENUE_TYPE]=this.revenueType,e[re.REVENUE_CURRENCY]=this.currency,e[re.REVENUE]=this.revenue,e},t})();var mn=function(t,e){var r=Math.max(e,1);return t.reduce(function(n,i,o){var a=Math.floor(o/r);return n[a]||(n[a]=[]),n[a].push(i),n},[])};var ht="Amplitude Logger ",vn=(function(){function t(){this.logLevel=Y.None}return t.prototype.disable=function(){this.logLevel=Y.None},t.prototype.enable=function(e){e===void 0&&(e=Y.Warn),this.logLevel=e},t.prototype.log=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Verbose||console.log("".concat(ht,"[Log]: ").concat(e.join(" ")))},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Warn||console.warn("".concat(ht,"[Warn]: ").concat(e.join(" ")))},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Error||console.error("".concat(ht,"[Error]: ").concat(e.join(" ")))},t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Debug||console.log("".concat(ht,"[Debug]: ").concat(e.join(" ")))},t})();var yt=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:Y.Warn,loggerProvider:new vn,optOut:!1,serverUrl:Kt,serverZone:Se.US,useBatch:!1}},Yt=(function(){function t(e){var r,n,i,o;this._optOut=!1;var a=yt();this.apiKey=e.apiKey,this.flushIntervalMillis=(r=e.flushIntervalMillis)!==null&&r!==void 0?r:a.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||a.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||a.flushQueueSize,this.instanceName=e.instanceName||a.instanceName,this.loggerProvider=e.loggerProvider||a.loggerProvider,this.logLevel=(n=e.logLevel)!==null&&n!==void 0?n:a.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=(i=e.optOut)!==null&&i!==void 0?i:a.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||a.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=(o=e.useBatch)!==null&&o!==void 0?o:a.useBatch,this.loggerProvider.enable(this.logLevel);var c=zt(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=c.serverZone,this.serverUrl=c.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),t})();var Si=function(t,e){return t===Se.EU?e?en:Zr:e?Jr:Kt},zt=function(t,e,r){if(t===void 0&&(t=""),e===void 0&&(e=yt().serverZone),r===void 0&&(r=yt().useBatch),t)return{serverUrl:t,serverZone:void 0};var n=["US","EU"].includes(e)?e:yt().serverZone;return{serverZone:n,serverUrl:Si(n,r)}};function Ii(t){return t instanceof Error?t.message:String(t)}function bt(t){var e="";try{"body"in t&&(e=JSON.stringify(t.body))}catch{}return e}var Qt=(function(){function t(){this.name="amplitude",this.type=N.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return t.prototype.setup=function(e){var r;return h(this,void 0,void 0,function(){var n,i=this;return y(this,function(o){switch(o.label){case 0:return this.config=e,this.storageKey="".concat(Gt,"_").concat(this.config.apiKey.substring(0,10)),[4,(r=this.config.storageProvider)===null||r===void 0?void 0:r.get(this.storageKey)];case 1:return n=o.sent(),this.saveEvents(),n&&n.length>0&&Promise.all(n.map(function(a){return i.execute(a)})).catch(),[2,Promise.resolve(void 0)]}})})},t.prototype.execute=function(e){var r=this;return new Promise(function(n){var i={event:e,attempts:0,callback:function(o){return n(o)},timeout:0};r.addToQueue(i)})},t.prototype.addToQueue=function(){for(var e=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r.filter(function(o){return o.attempts<e.config.flushMaxRetries?(o.attempts+=1,!0):(e.fulfillRequest([o],500,cn),!1)});i.forEach(function(o){if(e.queue=e.queue.concat(o),o.timeout===0){e.schedule(e.config.flushIntervalMillis);return}setTimeout(function(){o.timeout=0,e.schedule(0)},o.timeout)}),this.saveEvents()},t.prototype.schedule=function(e){var r=this;this.scheduled||(this.scheduled=setTimeout(function(){r.flush(!0).then(function(){r.queue.length>0&&r.schedule(e)})},e))},t.prototype.flush=function(e){return e===void 0&&(e=!1),h(this,void 0,void 0,function(){var r,n,i,o=this;return y(this,function(a){switch(a.label){case 0:return r=[],n=[],this.queue.forEach(function(c){return c.timeout===0?r.push(c):n.push(c)}),this.queue=n,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),i=mn(r,this.config.flushQueueSize),[4,Promise.all(i.map(function(c){return o.send(c,e)}))];case 1:return a.sent(),[2]}})})},t.prototype.send=function(e,r){return r===void 0&&(r=!0),h(this,void 0,void 0,function(){var n,i,o,a,c;return y(this,function(d){switch(d.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,dn)];n={api_key:this.config.apiKey,events:e.map(function(p){var s=p.event,u=s.extra,l=Ge(s,["extra"]);return l}),options:{min_id_length:this.config.minIdLength}},d.label=1;case 1:return d.trys.push([1,3,,4]),i=zt(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,n)];case 2:return o=d.sent(),o===null?(this.fulfillRequest(e,0,un),[2]):r?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(bt(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return a=d.sent(),this.config.loggerProvider.error(a),c=Ii(a),this.fulfillRequest(e,0,c),[3,4];case 4:return[2]}})})},t.prototype.handleResponse=function(e,r){var n=e.status;switch(n){case M.Success:{this.handleSuccessResponse(e,r);break}case M.Invalid:{this.handleInvalidResponse(e,r);break}case M.PayloadTooLarge:{this.handlePayloadTooLargeResponse(e,r);break}case M.RateLimit:{this.handleRateLimitResponse(e,r);break}default:{this.config.loggerProvider.warn(\`{code: 0, error: "Status '\`.concat(n,"' provided for ").concat(r.length,' events"}')),this.handleOtherResponse(r);break}}},t.prototype.handleSuccessResponse=function(e,r){this.fulfillRequest(r,e.statusCode,sn)},t.prototype.handleInvalidResponse=function(e,r){var n=this;if(e.body.missingField||e.body.error.startsWith(pn)){this.fulfillRequest(r,e.statusCode,e.body.error);return}var i=ee(ee(ee(ee([],A(Object.values(e.body.eventsWithInvalidFields)),!1),A(Object.values(e.body.eventsWithMissingFields)),!1),A(Object.values(e.body.eventsWithInvalidIdLengths)),!1),A(e.body.silencedEvents),!1).flat(),o=new Set(i),a=r.filter(function(c,d){if(o.has(d)){n.fulfillRequest([c],e.statusCode,e.body.error);return}return!0});a.length>0&&this.config.loggerProvider.warn(bt(e)),this.addToQueue.apply(this,ee([],A(a),!1))},t.prototype.handlePayloadTooLargeResponse=function(e,r){if(r.length===1){this.fulfillRequest(r,e.statusCode,e.body.error);return}this.config.loggerProvider.warn(bt(e)),this.config.flushQueueSize/=2,this.addToQueue.apply(this,ee([],A(r),!1))},t.prototype.handleRateLimitResponse=function(e,r){var n=this,i=Object.keys(e.body.exceededDailyQuotaUsers),o=Object.keys(e.body.exceededDailyQuotaDevices),a=e.body.throttledEvents,c=new Set(i),d=new Set(o),p=new Set(a),s=r.filter(function(u,l){if(u.event.user_id&&c.has(u.event.user_id)||u.event.device_id&&d.has(u.event.device_id)){n.fulfillRequest([u],e.statusCode,e.body.error);return}return p.has(l)&&(u.timeout=n.throttleTimeout),!0});s.length>0&&this.config.loggerProvider.warn(bt(e)),this.addToQueue.apply(this,ee([],A(s),!1))},t.prototype.handleOtherResponse=function(e){var r=this;this.addToQueue.apply(this,ee([],A(e.map(function(n){return n.timeout=n.attempts*r.retryTimeout,n})),!1))},t.prototype.fulfillRequest=function(e,r,n){this.saveEvents(),e.forEach(function(i){return i.callback(ve(i.event,r,n))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map(function(r){return r.event}));this.config.storageProvider.set(this.storageKey,e)}},t})();var xi=function(t){t===void 0&&(t=0);var e=new Error().stack||"";return e.split(\`
|
|
1269
1269
|
\`).slice(2+t).map(function(r){return r.trim()})},V=function(t){return function(){var e=b({},t.config),r=e.loggerProvider,n=e.logLevel;return{logger:r,logLevel:n}}},Li=function(t,e){var r,n;e=e.replace(/\\[(\\w+)\\]/g,".$1"),e=e.replace(/^\\./,"");try{for(var i=J(e.split(".")),o=i.next();!o.done;o=i.next()){var a=o.value;if(a in t)t=t[a];else return}}catch(c){r={error:c}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return t},F=function(t,e){return function(){var r,n,i={};try{for(var o=J(e),a=o.next();!a.done;a=o.next()){var c=a.value;i[c]=Li(t,c)}}catch(d){r={error:d}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},H=function(t,e,r,n,i){return i===void 0&&(i=null),function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var c=r(),d=c.logger,p=c.logLevel;if(p&&p<Y.Debug||!p||!d)return t.apply(i,o);var s={type:"invoke public method",name:e,args:o,stacktrace:xi(1),time:{start:new Date().toISOString()},states:{}};n&&s.states&&(s.states.before=n());var u=t.apply(i,o);return u&&u.promise?u.promise.then(function(){n&&s.states&&(s.states.after=n()),s.time&&(s.time.end=new Date().toISOString()),d.debug(JSON.stringify(s,null,2))}):(n&&s.states&&(s.states.after=n()),s.time&&(s.time.end=new Date().toISOString()),d.debug(JSON.stringify(s,null,2))),u}};var ge=function(t){return t?(t^Math.random()*16>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,ge)};var Et=(function(){function t(){this.memoryStorage=new Map}return t.prototype.isEnabled=function(){return h(this,void 0,void 0,function(){return y(this,function(e){return[2,!0]})})},t.prototype.get=function(e){return h(this,void 0,void 0,function(){return y(this,function(r){return[2,this.memoryStorage.get(e)]})})},t.prototype.getRaw=function(e){return h(this,void 0,void 0,function(){var r;return y(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return r=n.sent(),[2,r?JSON.stringify(r):void 0]}})})},t.prototype.set=function(e,r){return h(this,void 0,void 0,function(){return y(this,function(n){return this.memoryStorage.set(e,r),[2]})})},t.prototype.remove=function(e){return h(this,void 0,void 0,function(){return y(this,function(r){return this.memoryStorage.delete(e),[2]})})},t.prototype.reset=function(){return h(this,void 0,void 0,function(){return y(this,function(e){return this.memoryStorage.clear(),[2]})})},t})();var Le=(function(){function t(){}return t.prototype.send=function(e,r){return Promise.resolve(null)},t.prototype.buildResponse=function(e){var r,n,i,o,a,c,d,p,s,u,l,f,m,_,E,v,g,T,L,k,w,C;if(typeof e!="object")return null;var R=e.code||0,K=this.buildStatus(R);switch(K){case M.Success:return{status:K,statusCode:R,body:{eventsIngested:(r=e.events_ingested)!==null&&r!==void 0?r:0,payloadSizeBytes:(n=e.payload_size_bytes)!==null&&n!==void 0?n:0,serverUploadTime:(i=e.server_upload_time)!==null&&i!==void 0?i:0}};case M.Invalid:return{status:K,statusCode:R,body:{error:(o=e.error)!==null&&o!==void 0?o:"",missingField:(a=e.missing_field)!==null&&a!==void 0?a:"",eventsWithInvalidFields:(c=e.events_with_invalid_fields)!==null&&c!==void 0?c:{},eventsWithMissingFields:(d=e.events_with_missing_fields)!==null&&d!==void 0?d:{},eventsWithInvalidIdLengths:(p=e.events_with_invalid_id_lengths)!==null&&p!==void 0?p:{},epsThreshold:(s=e.eps_threshold)!==null&&s!==void 0?s:0,exceededDailyQuotaDevices:(u=e.exceeded_daily_quota_devices)!==null&&u!==void 0?u:{},silencedDevices:(l=e.silenced_devices)!==null&&l!==void 0?l:[],silencedEvents:(f=e.silenced_events)!==null&&f!==void 0?f:[],throttledDevices:(m=e.throttled_devices)!==null&&m!==void 0?m:{},throttledEvents:(_=e.throttled_events)!==null&&_!==void 0?_:[]}};case M.PayloadTooLarge:return{status:K,statusCode:R,body:{error:(E=e.error)!==null&&E!==void 0?E:""}};case M.RateLimit:return{status:K,statusCode:R,body:{error:(v=e.error)!==null&&v!==void 0?v:"",epsThreshold:(g=e.eps_threshold)!==null&&g!==void 0?g:0,throttledDevices:(T=e.throttled_devices)!==null&&T!==void 0?T:{},throttledUsers:(L=e.throttled_users)!==null&&L!==void 0?L:{},exceededDailyQuotaDevices:(k=e.exceeded_daily_quota_devices)!==null&&k!==void 0?k:{},exceededDailyQuotaUsers:(w=e.exceeded_daily_quota_users)!==null&&w!==void 0?w:{},throttledEvents:(C=e.throttled_events)!==null&&C!==void 0?C:[]}};case M.Timeout:default:return{status:K,statusCode:R}}},t.prototype.buildStatus=function(e){return e>=200&&e<300?M.Success:e===429?M.RateLimit:e===413?M.PayloadTooLarge:e===408?M.Timeout:e>=400&&e<500?M.Invalid:e>=500?M.Failed:M.Unknown},t})();var Pi=(function(){function t(){}return t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Ci(),platform:"Web",os:void 0,deviceModel:void 0}},t})(),Ci=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Ri=(function(){function t(){this.queue=[]}return t.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},t.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(r){e(r)}),this.queue=[])},t})(),he=function(){return he=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},he.apply(this,arguments)};function _t(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function gn(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}var Tt=function(t,e){var r,n,i=["string","number","boolean","undefined"],o=typeof t,a=typeof e;if(o!==a)return!1;try{for(var c=_t(i),d=c.next();!d.done;d=c.next()){var p=d.value;if(p===o)return t===e}}catch(E){r={error:E}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}if(t==null&&e==null)return!0;if(t==null||e==null||t.length!==e.length)return!1;var s=Array.isArray(t),u=Array.isArray(e);if(s!==u)return!1;if(s&&u){for(var l=0;l<t.length;l++)if(!Tt(t[l],e[l]))return!1}else{var f=Object.keys(t).sort(),m=Object.keys(e).sort();if(!Tt(f,m))return!1;var _=!0;return Object.keys(t).forEach(function(E){Tt(t[E],e[E])||(_=!1)}),_}return!0},Oi="$set",ki="$unset",Ai="$clearAll";Object.entries||(Object.entries=function(t){for(var e=Object.keys(t),r=e.length,n=new Array(r);r--;)n[r]=[e[r],t[e[r]]];return n});var Di=(function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return t.prototype.editIdentity=function(){var e=this,r=he({},this.identity.userProperties),n=he(he({},this.identity),{userProperties:r});return{setUserId:function(i){return n.userId=i,this},setDeviceId:function(i){return n.deviceId=i,this},setUserProperties:function(i){return n.userProperties=i,this},setOptOut:function(i){return n.optOut=i,this},updateUserProperties:function(i){var o,a,c,d,p,s,u=n.userProperties||{};try{for(var l=_t(Object.entries(i)),f=l.next();!f.done;f=l.next()){var m=gn(f.value,2),_=m[0],E=m[1];switch(_){case Oi:try{for(var v=(c=void 0,_t(Object.entries(E))),g=v.next();!g.done;g=v.next()){var T=gn(g.value,2),L=T[0],k=T[1];u[L]=k}}catch(R){c={error:R}}finally{try{g&&!g.done&&(d=v.return)&&d.call(v)}finally{if(c)throw c.error}}break;case ki:try{for(var w=(p=void 0,_t(Object.keys(E))),C=w.next();!C.done;C=w.next()){var L=C.value;delete u[L]}}catch(R){p={error:R}}finally{try{C&&!C.done&&(s=w.return)&&s.call(w)}finally{if(p)throw p.error}}break;case Ai:u={};break}}}catch(R){o={error:R}}finally{try{f&&!f.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}return n.userProperties=u,this},commit:function(){return e.setIdentity(n),this}}},t.prototype.getIdentity=function(){return he({},this.identity)},t.prototype.setIdentity=function(e){var r=he({},this.identity);this.identity=he({},e),Tt(r,this.identity)||this.listeners.forEach(function(n){n(e)})},t.prototype.addIdentityListener=function(e){this.listeners.add(e)},t.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},t})(),We=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,hn=(function(){function t(){this.identityStore=new Di,this.eventBridge=new Ri,this.applicationContextProvider=new Pi}return t.getInstance=function(e){return We.analyticsConnectorInstances||(We.analyticsConnectorInstances={}),We.analyticsConnectorInstances[e]||(We.analyticsConnectorInstances[e]=new t),We.analyticsConnectorInstances[e]},t})();var pe=function(t){return t===void 0&&(t="$default_instance"),hn.getInstance(t)},Xt=function(t,e){pe(e).identityStore.editIdentity().setUserId(t).commit()},Zt=function(t,e){pe(e).identityStore.editIdentity().setDeviceId(t).commit()},Jt=function(t,e){pe(e).identityStore.editIdentity().setOptOut(t).commit()};var $=function(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global};var Ne=function(){var t,e=$();if(!(!((t=e?.location)===null||t===void 0)&&t.search))return{};var r=e.location.search.substring(1).split("&").filter(Boolean),n=r.reduce(function(i,o){var a=o.split("=",2),c=yn(a[0]),d=yn(a[1]);return d&&(i[c]=d),i},{});return n},yn=function(t){t===void 0&&(t="");try{return decodeURIComponent(t)}catch{return""}};var bn="utm_campaign",En="utm_content",_n="utm_id",Tn="utm_medium",wn="utm_source",Sn="utm_term",er="dclid",tr="fbclid",rr="gbraid",nr="gclid",ir="ko_click_id",or="li_fat_id",ar="msclkid",sr="rtd_cid",ur="ttclid",cr="twclid",lr="wbraid";var Pe={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0};var $e=(function(){function t(){}return t.prototype.parse=function(){return h(this,void 0,void 0,function(){return y(this,function(e){return[2,b(b(b(b({},Pe),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},t.prototype.getUtmParam=function(){var e=Ne(),r=e[bn],n=e[En],i=e[_n],o=e[Tn],a=e[wn],c=e[Sn];return{utm_campaign:r,utm_content:n,utm_id:i,utm_medium:o,utm_source:a,utm_term:c}},t.prototype.getReferrer=function(){var e,r,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=(r=(e=n.referrer)===null||e===void 0?void 0:e.split("/")[2])!==null&&r!==void 0?r:void 0}catch{}return n},t.prototype.getClickIds=function(){var e,r=Ne();return e={},e[er]=r[er],e[tr]=r[tr],e[rr]=r[rr],e[nr]=r[nr],e[ir]=r[ir],e[or]=r[or],e[ar]=r[ar],e[sr]=r[sr],e[ur]=r[ur],e[cr]=r[cr],e[lr]=r[lr],e},t})();var Ye=function(t,e,r){return e===void 0&&(e=""),r===void 0&&(r=10),[xe,e,t.substring(0,r)].filter(Boolean).join("_")},dr=function(t){return"".concat(xe.toLowerCase(),"_").concat(t.substring(0,6))};var pr=function(t){return typeof t=="boolean"?t:!!t?.fileDownloads},fr=function(t){return typeof t=="boolean"?t:!!t?.formInteractions},In=function(t){return typeof t=="boolean"?t:!!(t?.pageViews===!0||t?.pageViews&&typeof t.pageViews=="object")},mr=function(t){return typeof t=="boolean"?t:!!t?.sessions},vr=function(t){var e,r=!((e=t.attribution)===null||e===void 0)&&e.trackPageViews?"attribution":function(){return!1},n=void 0,i="Page View",o=In(t.defaultTracking);return o&&(r=void 0,i=void 0,t.defaultTracking&&typeof t.defaultTracking=="object"&&t.defaultTracking.pageViews&&typeof t.defaultTracking.pageViews=="object"&&("trackOn"in t.defaultTracking.pageViews&&(r=t.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in t.defaultTracking.pageViews&&(n=t.defaultTracking.pageViews.trackHistoryChanges),"eventType"in t.defaultTracking.pageViews&&t.defaultTracking.pageViews.eventType&&(i=t.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:i}};var gr=function(){var t,e,r,n;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return(n=(r=(e=(t=navigator.languages)===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:navigator.language)!==null&&r!==void 0?r:i)!==null&&n!==void 0?n:""};var hr=(function(){function t(){this.name="identity",this.type=N.BEFORE,this.identityStore=pe().identityStore}return t.prototype.execute=function(e){return h(this,void 0,void 0,function(){var r;return y(this,function(n){return r=e.user_properties,r&&this.identityStore.editIdentity().updateUserProperties(r).commit(),[2,e]})})},t.prototype.setup=function(e){return h(this,void 0,void 0,function(){return y(this,function(r){return e.instanceName&&(this.identityStore=pe(e.instanceName).identityStore),[2]})})},t})();var ze=(function(){function t(e){this.options=b({},e)}return t.prototype.isEnabled=function(){return h(this,void 0,void 0,function(){var e,r,n,i;return y(this,function(o){switch(o.label){case 0:if(!$())return[2,!1];t.testValue=String(Date.now()),e=new t(this.options),r="AMP_TEST",o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,e.set(r,t.testValue)];case 2:return o.sent(),[4,e.get(r)];case 3:return n=o.sent(),[2,n===t.testValue];case 4:return i=o.sent(),[2,!1];case 5:return[4,e.remove(r)];case 6:return o.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return h(this,void 0,void 0,function(){var r;return y(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:if(r=n.sent(),!r)return[2,void 0];try{try{r=decodeURIComponent(atob(r))}catch{}return[2,JSON.parse(r)]}catch{return[2,void 0]}return[2]}})})},t.prototype.getRaw=function(e){var r;return h(this,void 0,void 0,function(){var n,i,o;return y(this,function(a){return n=$(),i=(r=n?.document.cookie.split("; "))!==null&&r!==void 0?r:[],o=i.find(function(c){return c.indexOf(e+"=")===0}),o?[2,o.substring(e.length+1)]:[2,void 0]})})},t.prototype.set=function(e,r){var n;return h(this,void 0,void 0,function(){var i,o,a,c,d,p;return y(this,function(s){try{i=(n=this.options.expirationDays)!==null&&n!==void 0?n:0,o=r!==null?i:-1,a=void 0,o&&(c=new Date,c.setTime(c.getTime()+o*24*60*60*1e3),a=c),d="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(r)))),a&&(d+="; expires=".concat(a.toUTCString())),d+="; path=/",this.options.domain&&(d+="; domain=".concat(this.options.domain)),this.options.secure&&(d+="; Secure"),this.options.sameSite&&(d+="; SameSite=".concat(this.options.sameSite)),p=$(),p&&(p.document.cookie=d)}catch{}return[2]})})},t.prototype.remove=function(e){return h(this,void 0,void 0,function(){return y(this,function(r){switch(r.label){case 0:return[4,this.set(e,null)];case 1:return r.sent(),[2]}})})},t.prototype.reset=function(){return h(this,void 0,void 0,function(){return y(this,function(e){return[2]})})},t})();var yr=(function(t){se(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.send=function(r,n){return h(this,void 0,void 0,function(){var i,o,a;return y(this,function(c){switch(c.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(n),method:"POST"},[4,fetch(r,i)];case 1:return o=c.sent(),[4,o.text()];case 2:a=c.sent();try{return[2,this.buildResponse(JSON.parse(a))]}catch{return[2,this.buildResponse({code:o.status})]}return[2]}})})},e})(Le);var xn=function(t){var e={};for(var r in t){var n=t[r];n&&(e[r]=n)}return e};var br=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r,n={},i=$(),o=void 0,a,c=A(t,2),d=c[0],p=c[1];d&&"init"in d?(r=d,p&&(n=p)):d&&(n=d);var s=function(){return h(void 0,void 0,void 0,function(){var E,v,g;return y(this,function(T){switch(T.label){case 0:return v={event_type:(g=n.eventType)!==null&&g!==void 0?g:"Page View"},E=[{}],[4,Ni()];case 1:return[2,(v.event_properties=b.apply(void 0,[b.apply(void 0,E.concat([T.sent()])),{page_domain:typeof location<"u"&&location.hostname||"",page_location:typeof location<"u"&&location.href||"",page_path:typeof location<"u"&&location.pathname||"",page_title:typeof document<"u"&&document.title||"",page_url:typeof location<"u"&&location.href.split("?")[0]||""}]),v)]}})})},u=function(){return typeof n.trackOn>"u"||typeof n.trackOn=="function"&&n.trackOn()},l=typeof location<"u"?location.href:null,f=function(){return h(void 0,void 0,void 0,function(){var E,v,g,T,L;return y(this,function(k){switch(k.label){case 0:return E=location.href,v=Mi(n.trackHistoryChanges,E,l||"")&&u(),l=E,v?(o?.log("Tracking page view event"),r!=null?[3,1]:(g=void 0,[3,3])):[3,4];case 1:return L=(T=r).track,[4,s()];case 2:g=L.apply(T,[k.sent()]),k.label=3;case 3:k.label=4;case 4:return[2]}})})},m=function(){f()},_={name:"page-view-tracking",type:N.ENRICHMENT,setup:function(E,v){return h(void 0,void 0,void 0,function(){var g,T,L,k,w;return y(this,function(C){switch(C.label){case 0:return r=r??v,r?(o=E.loggerProvider,o.log("Installing @amplitude/plugin-page-view-tracking-browser"),n.trackOn=!((k=E.attribution)===null||k===void 0)&&k.trackPageViews?"attribution":n.trackOn,!v&&(!((w=E.attribution)===null||w===void 0)&&w.trackPageViews)&&(o.warn("@amplitude/plugin-page-view-tracking-browser overrides page view tracking behavior defined in @amplitude/analytics-browser. Resolve by disabling page view tracking in @amplitude/analytics-browser."),E.attribution.trackPageViews=!1),n.trackHistoryChanges&&i&&(i.addEventListener("popstate",m),a=i.history.pushState,i.history.pushState=new Proxy(i.history.pushState,{apply:function(R,K,z){var Q=A(z,3),P=Q[0],Ce=Q[1],ce=Q[2];R.apply(K,[P,Ce,ce]),f()}})),u()?(o.log("Tracking page view event"),L=(T=r).track,[4,s()]):[3,2]):(g=d?"Options":"undefined",E.loggerProvider.error("Argument of type '".concat(g,"' is not assignable to parameter of type 'BrowserClient'.")),[2]);case 1:L.apply(T,[C.sent()]),C.label=2;case 2:return[2]}})})},execute:function(E){return h(void 0,void 0,void 0,function(){var v;return y(this,function(g){switch(g.label){case 0:return n.trackOn==="attribution"&&Ui(E)?(o?.log("Enriching campaign event to page view event with campaign parameters"),[4,s()]):[3,2];case 1:v=g.sent(),E.event_type=v.event_type,E.event_properties=b(b({},E.event_properties),v.event_properties),g.label=2;case 2:return[2,E]}})})},teardown:function(){return h(void 0,void 0,void 0,function(){return y(this,function(E){return i&&(i.removeEventListener("popstate",m),a&&(i.history.pushState=a)),[2]})})}};return _.__trackHistoryPageView=f,_},Ni=function(){return h(void 0,void 0,void 0,function(){var t;return y(this,function(e){switch(e.label){case 0:return t=xn,[4,new $e().parse()];case 1:return[2,t.apply(void 0,[e.sent()])]}})})},Ui=function(t){if(t.event_type==="$identify"&&t.user_properties){var e=t.user_properties,r=e[B.SET]||{},n=e[B.UNSET]||{},i=ee(ee([],A(Object.keys(r)),!1),A(Object.keys(n)),!1);return Object.keys(Pe).every(function(o){return i.includes(o)})}return!1},Mi=function(t,e,r){return t==="pathOnly"?e.split("?")[0]!==r.split("?")[0]:e!==r};var Pn=function(t,e,r){return e===void 0&&(e=""),r===void 0&&(r=10),[xe,e,t.substring(0,r)].filter(Boolean).join("_")},Ln=function(t){var e=t.split(".");return e.length<=2?t:e.slice(e.length-2,e.length).join(".")},Cn=function(t,e,r){var n,i=t.referrer,o=t.referring_domain,a=Ge(t,["referrer","referring_domain"]),c=e||{},d=c.referrer,p=c.referring_domain,s=Ge(c,["referrer","referring_domain"]);if(t.referring_domain&&(!((n=r.excludeReferrers)===null||n===void 0)&&n.includes(t.referring_domain)))return!1;var u=JSON.stringify(a)!==JSON.stringify(s),l=Ln(o||"")!==Ln(p||"");return!e||u||l},Rn=function(t,e){var r=b(b({},Pe),t),n=Object.entries(r).reduce(function(i,o){var a,c=A(o,2),d=c[0],p=c[1];return i.setOnce("initial_".concat(d),(a=p??e.initialEmptyValue)!==null&&a!==void 0?a:"EMPTY"),p?i.set(d,p):i.unset(d)},new ne);return Ke(n)};var Er=function(){for(var t=this,e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i,o={},a=A(r,2),c=a[0],d=a[1];c&&"init"in c?(i=c,d&&(o=d)):c&&(o=c);var p=(e=o.excludeReferrers)!==null&&e!==void 0?e:[];typeof location<"u"&&p.unshift(location.hostname),o=b(b({disabled:!1,initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1},o),{excludeReferrers:p});var s={name:"web-attribution",type:N.BEFORE,setup:function(u,l){var f;return h(this,void 0,void 0,function(){var m,_,E,v,g,T,L,k;return y(this,function(w){switch(w.label){case 0:return i=i??l,i?o.disabled?(u.loggerProvider.log("@amplitude/plugin-web-attribution-browser is disabled. Attribution is not tracked."),[2]):(u.loggerProvider.log("Installing @amplitude/plugin-web-attribution-browser."),!l&&!(!((f=u.attribution)===null||f===void 0)&&f.disabled)&&(u.loggerProvider.warn("@amplitude/plugin-web-attribution-browser overrides web attribution behavior defined in @amplitude/analytics-browser. Resolve by disabling web attribution tracking in @amplitude/analytics-browser."),u.attribution={disabled:!0}),_=u.cookieStorage,E=Pn(u.apiKey,"MKTG"),[4,Promise.all([new $e().parse(),_.get(E)])]):(m=c?"Options":"undefined",u.loggerProvider.error("Argument of type '".concat(m,"' is not assignable to parameter of type 'BrowserClient'.")),[2]);case 1:return v=A.apply(void 0,[w.sent(),2]),g=v[0],T=v[1],L=this.__pluginEnabledOverride,(L??Cn(g,T,o))&&(o.resetSessionOnNewCampaign&&(i.setSessionId(Date.now()),u.loggerProvider.log("Created a new session for new campaign.")),u.loggerProvider.log("Tracking attribution."),k=Rn(g,o),i.track(k),_.set(E,g)),[2]}})})},execute:function(u){return h(t,void 0,void 0,function(){return y(this,function(l){return[2,u]})})}};return s.__pluginEnabledOverride=void 0,s};var wt=1e3,_r=(function(){function t(e){this.loggerProvider=e?.loggerProvider}return t.prototype.isEnabled=function(){return h(this,void 0,void 0,function(){var e,r,n,i,o;return y(this,function(a){switch(a.label){case 0:if(!$())return[2,!1];e=String(Date.now()),r=new t,n="AMP_TEST",a.label=1;case 1:return a.trys.push([1,4,5,7]),[4,r.set(n,e)];case 2:return a.sent(),[4,r.get(n)];case 3:return i=a.sent(),[2,i===e];case 4:return o=a.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return a.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return h(this,void 0,void 0,function(){var r,n;return y(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return r=i.sent(),r?[2,JSON.parse(r)]:[2,void 0];case 2:return n=i.sent(),[2,void 0];case 3:return[2]}})})},t.prototype.getRaw=function(e){var r;return h(this,void 0,void 0,function(){return y(this,function(n){return[2,((r=$())===null||r===void 0?void 0:r.localStorage.getItem(e))||void 0]})})},t.prototype.set=function(e,r){var n,i;return h(this,void 0,void 0,function(){var o,a,c;return y(this,function(d){o=Array.isArray(r)&&r.length>wt;try{a=JSON.stringify(o?r.slice(0,wt):r),(n=$())===null||n===void 0||n.localStorage.setItem(e,a)}catch{}return o&&(c=r.length-wt,(i=this.loggerProvider)===null||i===void 0||i.error("Failed to save ".concat(c," events because the queue length exceeded ").concat(wt,"."))),[2]})})},t.prototype.remove=function(e){var r;return h(this,void 0,void 0,function(){return y(this,function(n){try{(r=$())===null||r===void 0||r.localStorage.removeItem(e)}catch{}return[2]})})},t.prototype.reset=function(){var e;return h(this,void 0,void 0,function(){return y(this,function(r){try{(e=$())===null||e===void 0||e.localStorage.clear()}catch{}return[2]})})},t})();var On=(function(t){se(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.state={done:4},r}return e.prototype.send=function(r,n){return h(this,void 0,void 0,function(){var i=this;return y(this,function(o){return[2,new Promise(function(a,c){typeof XMLHttpRequest>"u"&&c(new Error("XHRTransport is not supported."));var d=new XMLHttpRequest;d.open("POST",r,!0),d.onreadystatechange=function(){if(d.readyState===i.state.done){var p=d.responseText;try{a(i.buildResponse(JSON.parse(p)))}catch{a(i.buildResponse({code:d.status}))}}},d.setRequestHeader("Content-Type","application/json"),d.setRequestHeader("Accept","*/*"),d.send(JSON.stringify(n))})]})})},e})(Le);var kn=(function(t){se(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.send=function(r,n){return h(this,void 0,void 0,function(){var i=this;return y(this,function(o){return[2,new Promise(function(a,c){var d=$();if(!d?.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var p=JSON.stringify(n),s=d.navigator.sendBeacon(r,JSON.stringify(n));return a(s?i.buildResponse({code:200,events_ingested:n.events.length,payload_size_bytes:p.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(u){c(u)}})]})})},e})(Le);var St="1.14.0";var Ue=function(){var t=new Et,e={deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0};return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:t,cookieUpgrade:!0,disableCookies:!1,domain:"",sessionTimeout:1800*1e3,trackingOptions:e,transportProvider:new yr}},An=(function(t){se(e,t);function e(r,n){var i=this,o,a,c,d,p,s,u,l,f,m=Ue();return i=t.call(this,b(b({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30,transportProvider:m.transportProvider},n),{apiKey:r}))||this,i.version=St,i._optOut=!1,i.cookieStorage=(o=n?.cookieStorage)!==null&&o!==void 0?o:m.cookieStorage,i.deviceId=n?.deviceId,i.lastEventId=n?.lastEventId,i.lastEventTime=n?.lastEventTime,i.optOut=!!n?.optOut,i.sessionId=n?.sessionId,i.userId=n?.userId,i.appVersion=n?.appVersion,i.attribution=n?.attribution,i.cookieExpiration=(a=n?.cookieExpiration)!==null&&a!==void 0?a:m.cookieExpiration,i.cookieSameSite=(c=n?.cookieSameSite)!==null&&c!==void 0?c:m.cookieSameSite,i.cookieSecure=(d=n?.cookieSecure)!==null&&d!==void 0?d:m.cookieSecure,i.cookieUpgrade=(p=n?.cookieUpgrade)!==null&&p!==void 0?p:m.cookieUpgrade,i.defaultTracking=n?.defaultTracking,i.disableCookies=(s=n?.disableCookies)!==null&&s!==void 0?s:m.disableCookies,i.defaultTracking=n?.defaultTracking,i.domain=(u=n?.domain)!==null&&u!==void 0?u:m.domain,i.partnerId=n?.partnerId,i.sessionTimeout=(l=n?.sessionTimeout)!==null&&l!==void 0?l:m.sessionTimeout,i.trackingOptions=(f=n?.trackingOptions)!==null&&f!==void 0?f:m.trackingOptions,i}return Object.defineProperty(e.prototype,"deviceId",{get:function(){return this._deviceId},set:function(r){this._deviceId!==r&&(this._deviceId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._userId},set:function(r){this._userId!==r&&(this._userId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this._sessionId},set:function(r){this._sessionId!==r&&(this._sessionId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(r){this._optOut!==r&&(this._optOut=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(r){this._lastEventTime!==r&&(this._lastEventTime=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(r){this._lastEventId!==r&&(this._lastEventId=r,this.updateStorage())},enumerable:!1,configurable:!0}),e.prototype.updateStorage=function(){var r,n={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId};(r=this.cookieStorage)===null||r===void 0||r.set(Ye(this.apiKey),n)},e})(Yt);var Dn=function(t,e){return h(void 0,void 0,void 0,function(){var r,n,i,o,a,c,d,p,s,u,l,f,m,_,E;return y(this,function(v){switch(v.label){case 0:return r=Ue(),n=(_=e?.deviceId)!==null&&_!==void 0?_:ge(),i=e?.lastEventId,o=e?.lastEventTime,a=e?.optOut,c=e?.sessionId,d=e?.userId,p=e?.cookieStorage,s=e?.domain,u=An.bind,l=[void 0,t],f=[b({},e)],m={cookieStorage:p,deviceId:n,domain:s,lastEventId:i,lastEventTime:o,optOut:a,sessionId:c},[4,Vi(e)];case 1:return[2,new(u.apply(An,l.concat([b.apply(void 0,f.concat([(m.storageProvider=v.sent(),m.trackingOptions=b(b({},r.trackingOptions),e?.trackingOptions),m.transportProvider=(E=e?.transportProvider)!==null&&E!==void 0?E:Tr(e?.transport),m.userId=d,m)]))])))]}})})},It=function(t,e){return e===void 0&&(e=Ue()),h(void 0,void 0,void 0,function(){var r,n,i;return y(this,function(o){switch(o.label){case 0:return r=b(b({},e),t),n=t?.cookieStorage,i=!n,i?[3,2]:[4,n.isEnabled()];case 1:i=!o.sent(),o.label=2;case 2:return i?[2,Bi(r)]:[2,n]}})})},Bi=function(t){return h(void 0,void 0,void 0,function(){var e,r;return y(this,function(n){switch(n.label){case 0:return e=new ze({domain:t.domain,expirationDays:t.cookieExpiration,sameSite:t.cookieSameSite,secure:t.cookieSecure}),r=t.disableCookies,r?[3,2]:[4,e.isEnabled()];case 1:r=!n.sent(),n.label=2;case 2:return r?(e=new _r,[4,e.isEnabled()]):[3,4];case 3:n.sent()||(e=new Et),n.label=4;case 4:return[2,e]}})})},Vi=function(t){return h(void 0,void 0,void 0,function(){var e,r,n,i,o,a,c,d,p;return y(this,function(s){switch(s.label){case 0:if(e=t&&Object.prototype.hasOwnProperty.call(t,"storageProvider"),r=t&&t.loggerProvider,!(!e||t.storageProvider))return[3,9];s.label=1;case 1:s.trys.push([1,7,8,9]),n=J([t?.storageProvider,new _r({loggerProvider:r})]),i=n.next(),s.label=2;case 2:return i.done?[3,6]:(o=i.value,a=o,a?[4,o.isEnabled()]:[3,4]);case 3:a=s.sent(),s.label=4;case 4:if(a)return[2,o];s.label=5;case 5:return i=n.next(),[3,2];case 6:return[3,9];case 7:return c=s.sent(),d={error:c},[3,9];case 8:try{i&&!i.done&&(p=n.return)&&p.call(n)}finally{if(d)throw d.error}return[7];case 9:return[2,void 0]}})})},Tr=function(t){return t===Ie.XHR?new On:t===Ie.SendBeacon?new kn:Ue().transportProvider},Nn=function(t){return h(void 0,void 0,void 0,function(){var e,r,n,i,o,o,a,c,d,p;return y(this,function(s){switch(s.label){case 0:return[4,new ze().isEnabled()];case 1:if(!s.sent()||!t&&(typeof location>"u"||!location.hostname))return[2,""];for(e=t??location.hostname,r=e.split("."),n=[],i="AMP_TLDTEST",o=r.length-2;o>=0;--o)n.push(r.slice(o).join("."));o=0,s.label=2;case 2:return o<n.length?(a=n[o],c={domain:"."+a},d=new ze(c),[4,d.set(i,1)]):[3,7];case 3:return s.sent(),[4,d.get(i)];case 4:return p=s.sent(),p?[4,d.remove(i)]:[3,6];case 5:return s.sent(),[2,"."+a];case 6:return o++,[3,2];case 7:return[2,""]}})})};var W="[Amplitude]",xt="".concat(W," Page Viewed"),wr="".concat(W," Form Started"),Un="".concat(W," Form Submitted"),Mn="".concat(W," File Downloaded"),Sr="session_start",Ir="session_end",Bn="".concat(W," File Extension"),Vn="".concat(W," File Name"),Fn="".concat(W," Link ID"),Hn="".concat(W," Link Text"),qn="".concat(W," Link URL"),Lt="".concat(W," Form ID"),Pt="".concat(W," Form Name"),Ct="".concat(W," Form Destination");var jn=function(t,e){return h(void 0,void 0,void 0,function(){var r,n,i,o,a,c,d,p,s,u,l;return y(this,function(f){switch(f.label){case 0:return[4,It(e)];case 1:return r=f.sent(),n=dr(t),[4,r.getRaw(n)];case 2:return i=f.sent(),i?((l=e.cookieUpgrade)!==null&&l!==void 0?l:Ue().cookieUpgrade)?[4,r.remove(n)]:[3,4]:[2,{optOut:!1}];case 3:f.sent(),f.label=4;case 4:return o=A(i.split("."),6),a=o[0],c=o[1],d=o[2],p=o[3],s=o[4],u=o[5],[2,{deviceId:a,userId:Fi(c),sessionId:xr(p),lastEventId:xr(u),lastEventTime:xr(s),optOut:!!d}]}})})},xr=function(t){var e=parseInt(t,32);if(!isNaN(e))return e},Fi=function(t){if(!(!atob||!escape||!t))try{return decodeURIComponent(escape(atob(t)))}catch{return}};var Kn=_i(Gn());var Hi="Web",qi="$remote",Wn=(function(){function t(){this.name="context",this.type=N.BEFORE,this.library="amplitude-ts/".concat(St),typeof navigator<"u"&&(this.userAgent=navigator.userAgent),this.uaResult=new Kn.default(this.userAgent).getResult()}return t.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},t.prototype.execute=function(e){var r,n;return h(this,void 0,void 0,function(){var i,o,a,c,d,p,s,u;return y(this,function(l){return i=new Date().getTime(),o=this.uaResult.browser.name,a=this.uaResult.browser.version,c=this.uaResult.device.model||this.uaResult.os.name,d=this.uaResult.device.vendor,p=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1,s=(n=e.event_id)!==null&&n!==void 0?n:p+1,this.config.lastEventId=s,e.time||(this.config.lastEventTime=i),u=b(b(b(b(b(b(b(b(b(b(b(b({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:i},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:Hi}),this.config.trackingOptions.osName&&{os_name:o}),this.config.trackingOptions.osVersion&&{os_version:a}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:d}),this.config.trackingOptions.deviceModel&&{device_model:c}),this.config.trackingOptions.language&&{language:gr()}),this.config.trackingOptions.ipAddress&&{ip:qi}),{insert_id:ge(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:s,library:this.library,user_agent:this.userAgent}),[2,u]})})},t})();var ji={page_domain:"".concat(W," Page Domain"),page_location:"".concat(W," Page Location"),page_path:"".concat(W," Page Path"),page_title:"".concat(W," Page Title"),page_url:"".concat(W," Page URL")},$n=function(){var t="@amplitude/plugin-default-page-view-event-enrichment-browser",e=N.ENRICHMENT,r=function(){return h(void 0,void 0,void 0,function(){return y(this,function(i){return[2,void 0]})})},n=function(i){return h(void 0,void 0,void 0,function(){return y(this,function(o){return i.event_type===xt&&i.event_properties&&(i.event_properties=Object.entries(i.event_properties).reduce(function(a,c){var d=A(c,2),p=d[0],s=d[1],u=ji[p];return u?a[u]=s:a[p]=s,a},{})),[2,i]})})};return{name:t,type:e,setup:r,execute:n}};var Yn=function(){var t,e=[],r=function(p,s,u){p.addEventListener(s,u),e.push({element:p,type:s,handler:u})},n=function(){e.forEach(function(p){var s=p.element,u=p.type,l=p.handler;s?.removeEventListener(u,l)}),e=[]},i="@amplitude/plugin-file-download-tracking-browser",o=N.ENRICHMENT,a=function(p,s){return h(void 0,void 0,void 0,function(){var u,l,f;return y(this,function(m){return s?typeof document>"u"?[2]:(u=function(_){var E;try{E=new URL(_.href,window.location.href)}catch{return}var v=l.exec(E.href),g=v?.[1];g&&r(_,"click",function(){var T;g&&s.track(Mn,(T={},T[Bn]=g,T[Vn]=E.pathname,T[Fn]=_.id,T[Hn]=_.text,T[qn]=_.href,T))})},l=/\\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$/,f=Array.from(document.getElementsByTagName("a")),f.forEach(u),typeof MutationObserver<"u"&&(t=new MutationObserver(function(_){_.forEach(function(E){E.addedNodes.forEach(function(v){v.nodeName==="A"&&u(v),"querySelectorAll"in v&&typeof v.querySelectorAll=="function"&&Array.from(v.querySelectorAll("a")).map(u)})})}),t.observe(document.body,{subtree:!0,childList:!0})),[2]):(p.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked."),[2])})})},c=function(p){return h(void 0,void 0,void 0,function(){return y(this,function(s){return[2,p]})})},d=function(){return h(void 0,void 0,void 0,function(){return y(this,function(p){return t?.disconnect(),n(),[2]})})};return{name:i,type:o,setup:a,execute:c,teardown:d}};var zn=function(){var t,e=[],r=function(s,u,l){s.addEventListener(u,l),e.push({element:s,type:u,handler:l})},n=function(){e.forEach(function(s){var u=s.element,l=s.type,f=s.handler;u?.removeEventListener(l,f)}),e=[]},i=function(s){var u=s.getAttribute("action");try{u=new URL(encodeURI(u??""),window.location.href).href}catch{}return u},o="@amplitude/plugin-form-interaction-tracking-browser",a=N.ENRICHMENT,c=function(s,u){return h(void 0,void 0,void 0,function(){var l,f;return y(this,function(m){return u?typeof document>"u"?[2]:(l=function(_){var E=!1;r(_,"change",function(){var v;if(!E){var g=i(_);u.track(wr,(v={},v[Lt]=_.getAttribute("id"),v[Pt]=_.getAttribute("name"),v[Ct]=g,v))}E=!0}),r(_,"submit",function(){var v,g,T=i(_);E||u.track(wr,(v={},v[Lt]=_.getAttribute("id"),v[Pt]=_.getAttribute("name"),v[Ct]=T,v)),u.track(Un,(g={},g[Lt]=_.getAttribute("id"),g[Pt]=_.getAttribute("name"),g[Ct]=T,g)),E=!1})},f=Array.from(document.getElementsByTagName("form")),f.forEach(l),typeof MutationObserver<"u"&&(t=new MutationObserver(function(_){_.forEach(function(E){E.addedNodes.forEach(function(v){v.nodeName==="FORM"&&l(v),"querySelectorAll"in v&&typeof v.querySelectorAll=="function"&&Array.from(v.querySelectorAll("form")).map(l)})})}),t.observe(document.body,{subtree:!0,childList:!0})),[2]):(s.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked."),[2])})})},d=function(s){return h(void 0,void 0,void 0,function(){return y(this,function(u){return[2,s]})})},p=function(){return h(void 0,void 0,void 0,function(){return y(this,function(s){return t?.disconnect(),n(),[2]})})};return{name:o,type:a,setup:c,execute:d,teardown:p}};var Ot=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=n.name,o=n.args,a=n.resolve,c=t&&t[i];if(typeof c=="function"){var d=c.apply(t,o);typeof a=="function"&&a(d?.promise)}}return t},kt=function(t){var e=t;return e&&e._q!==void 0};var Qn=(function(t){se(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,n,i){return r===void 0&&(r=""),X(this._init(b(b({},i),{userId:n,apiKey:r})))},e.prototype._init=function(r){var n,i,o,a,c,d,p,s,u,l,f,m,_,E,v,g,T,L,k,w;return h(this,void 0,void 0,function(){var C,R,K,z,Q,P,Ce,ce,_e,Me,Re,Oe,Be,Te,we,ke,fe,me,Ve=this;return y(this,function(U){switch(U.label){case 0:return this.initializing?[2]:(this.initializing=!0,C=r,r.disableCookies?(R="",[3,5]):[3,1]);case 1:return(n=r.domain)!==null&&n!==void 0?(K=n,[3,4]):[3,2];case 2:return[4,Nn()];case 3:K=U.sent(),U.label=4;case 4:R=K,U.label=5;case 5:return C.domain=R,[4,jn(r.apiKey,r)];case 6:return z=U.sent(),[4,It(r)];case 7:return Q=U.sent(),[4,Q.get(Ye(r.apiKey))];case 8:return P=U.sent(),Ce=Ne(),ce=(a=(o=(i=r.deviceId)!==null&&i!==void 0?i:Ce.deviceId)!==null&&o!==void 0?o:P?.deviceId)!==null&&a!==void 0?a:z.deviceId,_e=(c=P?.sessionId)!==null&&c!==void 0?c:z.sessionId,Me=(p=(d=r.optOut)!==null&&d!==void 0?d:P?.optOut)!==null&&p!==void 0?p:z.optOut,Re=(s=P?.lastEventId)!==null&&s!==void 0?s:z.lastEventId,Oe=(u=P?.lastEventTime)!==null&&u!==void 0?u:z.lastEventTime,Be=(f=(l=r.userId)!==null&&l!==void 0?l:P?.userId)!==null&&f!==void 0?f:z.userId,this.previousSessionDeviceId=(m=P?.deviceId)!==null&&m!==void 0?m:z.deviceId,this.previousSessionUserId=(_=P?.userId)!==null&&_!==void 0?_:z.userId,[4,Dn(r.apiKey,b(b({},r),{deviceId:ce,sessionId:_e,optOut:Me,lastEventId:Re,lastEventTime:Oe,userId:Be,cookieStorage:Q}))];case 9:return Te=U.sent(),[4,t.prototype._init.call(this,Te)];case 10:return U.sent(),we=!1,(!this.config.lastEventTime||!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId((v=(E=r.sessionId)!==null&&E!==void 0?E:this.config.sessionId)!==null&&v!==void 0?v:Date.now()),we=!0),ke=pe(r.instanceName),ke.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new Qt).promise];case 11:return U.sent(),[4,this.add(new Wn).promise];case 12:return U.sent(),[4,this.add(new hr).promise];case 13:return U.sent(),pr(this.config.defaultTracking)?[4,this.add(Yn()).promise]:[3,15];case 14:U.sent(),U.label=15;case 15:return fr(this.config.defaultTracking)?[4,this.add(zn()).promise]:[3,17];case 16:U.sent(),U.label=17;case 17:return!((g=this.config.attribution)===null||g===void 0)&&g.disabled?[3,19]:(fe=Er({excludeReferrers:(T=this.config.attribution)===null||T===void 0?void 0:T.excludeReferrers,initialEmptyValue:(L=this.config.attribution)===null||L===void 0?void 0:L.initialEmptyValue,resetSessionOnNewCampaign:(k=this.config.attribution)===null||k===void 0?void 0:k.resetSessionOnNewCampaign}),fe.__pluginEnabledOverride=we||!((w=this.config.attribution)===null||w===void 0)&&w.trackNewCampaigns?void 0:!1,[4,this.add(fe).promise]);case 18:U.sent(),U.label=19;case 19:return me=vr(this.config),me.eventType=me.eventType||xt,[4,this.add(br(me)).promise];case 20:return U.sent(),[4,this.add($n()).promise];case 21:return U.sent(),this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 22:return U.sent(),ke.eventBridge.setEventReceiver(function(et){Ve.track(et.eventType,et.eventProperties)}),[2]}})})},e.prototype.getUserId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.userId},e.prototype.setUserId=function(r){if(!this.config){this.q.push(this.setUserId.bind(this,r));return}(r!==this.config.userId||r===void 0)&&(this.config.userId=r,Xt(r,this.config.instanceName))},e.prototype.getDeviceId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.deviceId},e.prototype.setDeviceId=function(r){if(!this.config){this.q.push(this.setDeviceId.bind(this,r));return}this.config.deviceId=r,Zt(r,this.config.instanceName)},e.prototype.setOptOut=function(r){Jt(r,this.config.instanceName),t.prototype.setOptOut.call(this,r)},e.prototype.reset=function(){this.setDeviceId(ge()),this.setUserId(void 0)},e.prototype.getSessionId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.sessionId},e.prototype.setSessionId=function(r){var n;if(!this.config){this.q.push(this.setSessionId.bind(this,r));return}if(r!==this.config.sessionId){var i=this.getSessionId(),o=this.config.lastEventTime,a=(n=this.config.lastEventId)!==null&&n!==void 0?n:-1;this.config.sessionId=r,this.config.lastEventTime=void 0,mr(this.config.defaultTracking)&&(i&&o&&this.track(Ir,void 0,{device_id:this.previousSessionDeviceId,event_id:++a,session_id:i,time:o+1,user_id:this.previousSessionUserId}),this.config.lastEventTime=this.config.sessionId,this.track(Sr,void 0,{event_id:++a,session_id:this.config.sessionId,time:this.config.lastEventTime})),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId}},e.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},e.prototype.setTransport=function(r){if(!this.config){this.q.push(this.setTransport.bind(this,r));return}this.config.transportProvider=Tr(r)},e.prototype.identify=function(r,n){if(kt(r)){var i=r._q;r._q=[],r=Ot(new ne,i)}return n?.user_id&&this.setUserId(n.user_id),n?.device_id&&this.setDeviceId(n.device_id),t.prototype.identify.call(this,r,n)},e.prototype.groupIdentify=function(r,n,i,o){if(kt(i)){var a=i._q;i._q=[],i=Ot(new ne,a)}return t.prototype.groupIdentify.call(this,r,n,i,o)},e.prototype.revenue=function(r,n){if(kt(r)){var i=r._q;r._q=[],r=Ot(new gt,i)}return t.prototype.revenue.call(this,r,n)},e.prototype.process=function(r){return h(this,void 0,void 0,function(){var n,i,o;return y(this,function(a){return n=Date.now(),i=this.config.lastEventTime||Date.now(),o=n-i,r.event_type!==Sr&&r.event_type!==Ir&&(!r.session_id||r.session_id===this.getSessionId())&&o>this.config.sessionTimeout&&this.setSessionId(n),[2,t.prototype.process.call(this,r)]})})},e})($t);var Gi=function(){var t=new Qn;return{init:H(t.init.bind(t),"init",V(t),F(t,["config"])),add:H(t.add.bind(t),"add",V(t),F(t,["config.apiKey","timeline.plugins"])),remove:H(t.remove.bind(t),"remove",V(t),F(t,["config.apiKey","timeline.plugins"])),track:H(t.track.bind(t),"track",V(t),F(t,["config.apiKey","timeline.queue.length"])),logEvent:H(t.logEvent.bind(t),"logEvent",V(t),F(t,["config.apiKey","timeline.queue.length"])),identify:H(t.identify.bind(t),"identify",V(t),F(t,["config.apiKey","timeline.queue.length"])),groupIdentify:H(t.groupIdentify.bind(t),"groupIdentify",V(t),F(t,["config.apiKey","timeline.queue.length"])),setGroup:H(t.setGroup.bind(t),"setGroup",V(t),F(t,["config.apiKey","timeline.queue.length"])),revenue:H(t.revenue.bind(t),"revenue",V(t),F(t,["config.apiKey","timeline.queue.length"])),flush:H(t.flush.bind(t),"flush",V(t),F(t,["config.apiKey","timeline.queue.length"])),getUserId:H(t.getUserId.bind(t),"getUserId",V(t),F(t,["config","config.userId"])),setUserId:H(t.setUserId.bind(t),"setUserId",V(t),F(t,["config","config.userId"])),getDeviceId:H(t.getDeviceId.bind(t),"getDeviceId",V(t),F(t,["config","config.deviceId"])),setDeviceId:H(t.setDeviceId.bind(t),"setDeviceId",V(t),F(t,["config","config.deviceId"])),reset:H(t.reset.bind(t),"reset",V(t),F(t,["config","config.userId","config.deviceId"])),getSessionId:H(t.getSessionId.bind(t),"getSessionId",V(t),F(t,["config"])),setSessionId:H(t.setSessionId.bind(t),"setSessionId",V(t),F(t,["config"])),extendSession:H(t.extendSession.bind(t),"extendSession",V(t),F(t,["config"])),setOptOut:H(t.setOptOut.bind(t),"setOptOut",V(t),F(t,["config"])),setTransport:H(t.setTransport.bind(t),"setTransport",V(t),F(t,["config"]))}},j=Gi();var lc=j.add,dc=j.extendSession,pc=j.flush,fc=j.getDeviceId,mc=j.getSessionId,vc=j.getUserId,gc=j.groupIdentify,Xn=j.identify,Zn=j.init,hc=j.logEvent,yc=j.remove,bc=j.reset,Ec=j.revenue,_c=j.setDeviceId,Tc=j.setGroup,wc=j.setOptOut,Sc=j.setSessionId,Ic=j.setTransport,xc=j.setUserId,ye=j.track;var te=t=>{window.dispatchEvent(new CustomEvent("builderdevtools",{detail:{eventName:t}}))};async function Ki(){return Qr()}var Jn=async()=>{let t=new URL(window.location.href),e=t.hash,r=\`#\${Vr}=\`,n=Math.random().toString(36).substring(2,15),i=await Ki();Zn("f1d2eb79aecd01b28c8a371ea5d1751c",i?.userId||n,{logLevel:mt.LogLevel.None,serverUrl:qr,flushIntervalMillis:500});let o=new ne;Xn(o,{device_id:i?.deviceId,user_id:i?.userId||n});let a="anonymous";e.startsWith(r)&&(a=e.slice(r.length),a&&(Wi(a),t.hash="",window.history.replaceState({},"",t.href))),te("init")};var Wi=t=>{if(typeof t=="string"&&t.length>0){let e=Ze();Xe({...e,builderUserId:t})}},Ze=()=>{let t=localStorage.getItem(ei);if(t)try{let e=JSON.parse(t);return(!e.ctas||typeof e.ctas!="object")&&(e=Xe({...e,ctas:{}})),e.menuOpenedTs&&(e=Xe({...e,ctas:{...e.ctas,menuOpened:e.menuOpenedTs}}),delete e.menuOpenedTs),e}catch(e){console.error(e)}return Xe({firstVisitTs:Date.now(),ctas:{},builderUserId:""})},Xe=t=>{try{localStorage.setItem(ei,JSON.stringify(t))}catch(e){console.error(e)}return t},Lr=t=>!!Ze().ctas[t],Pr=t=>{let e=Ze();return Xe({...e,ctas:{...e.ctas,[t]:Date.now()}})},ei="builderDevtools";function ti(t){$i(t),Yi(t),zi(t),Qi(t)}function $i(t){let e=t.getElementById("input-register");e.addEventListener("change",async r=>{r.stopPropagation();let n=t.getElementById("input-name"),i=t.querySelector(".nav-cmp-input");i.classList.add("input-loading"),i.classList.remove("input-enabled");let o=n.dataset.id,a=n.dataset.prop,c=await st({cmpId:o,name:a,registerInput:e.checked});te("registryUpdate"),le(c),Je(t,o,a),be(t,o),i.classList.remove("input-loading")})}function Yi(t){t.getElementById("input-open-source").addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let n=r.target,i=G.components.find(o=>o.id===n?.dataset.id);i&&De({filePath:i.filePath})})}function zi(t){let e=t.getElementById("input-name"),r=e.closest(".ui-text-input"),n="",i;e.addEventListener("focus",o=>{clearTimeout(i),r.classList.remove("saved"),o.stopPropagation(),n=e.value}),e.addEventListener("blur",async o=>{if(o.stopPropagation(),clearTimeout(i),r.classList.remove("saved"),e.value!==n){if(e.value.trim().length<3){e.value=n;return}r.classList.add("saved"),i=setTimeout(()=>{r.classList.remove("saved")},3e3);let a=e.dataset.id,c=e.dataset.prop,d=await st({cmpId:a,name:c,friendlyName:e.value});te("registryUpdate"),le(d),ue(t),be(t,a),Je(t,a,c)}}),e.addEventListener("keyup",o=>{o.stopPropagation(),clearTimeout(i),r.classList.remove("saved"),o.key==="Escape"?(e.value=n,e.blur()):o.key==="Enter"&&e.blur()})}function Qi(t){let e=t.getElementById("input-type");e.addEventListener("change",async r=>{r.stopPropagation();let n=e.dataset.id,i=e.dataset.prop,o=await st({cmpId:n,name:i,type:e.value});te("registryUpdate"),le(o),ue(t),be(t,n),Je(t,n,i)})}function Je(t,e,r){let n=G.components.find(l=>l.id===e);if(!n)return null;let i=n.inputs.find(l=>l.name===r);if(!i)return null;let o=t.querySelector(".nav-cmp-input");i.isRegistered?o.classList.add("input-enabled"):o.classList.remove("input-enabled");let a=t.getElementById("input-register");a.checked=!!i.isRegistered;let c=t.getElementById("cmp-input-title");c.innerText=n.name+": "+(i.friendlyName||i.name);let d=t.getElementById("input-open-source");d.innerText=\`Open \${n.displayFilePath}\`,d.dataset.id=n.id;let p=t.getElementById("cmp-prop-name");p.innerText=i.name;let s=t.getElementById("cmp-prop-type");s.innerText=ft(i.type);let u=t.getElementById("input-name");return u.dataset.id=n.id,u.dataset.prop=i.name,u.value=i.friendlyName||i.name,Xi(t,n,i),i}function Xi(t,e,r){let n=t.getElementById("input-type");n.dataset.id=e.id,n.dataset.prop=r.name,n.innerHTML="";let i=r.type,o=ut.includes(i),a=ct.includes(i),c=lt.includes(i),d=dt.includes(i),p=pt.includes(i);Xr.forEach(s=>{let u=document.createElement("option");u.value=s.value,u.innerText=s.text,u.disabled=ut.includes(s.value)&&!o||ct.includes(s.value)&&!a||lt.includes(s.value)&&!c||dt.includes(s.value)&&!d||pt.includes(s.value)&&!p,n.appendChild(u)}),n.value=i}function ri(t){Zi(t),Ji(t),eo(t),ro(t),to(t)}function Zi(t){t.getElementById("cmp-register").addEventListener("change",r=>{r.stopPropagation(),At(t,"update")})}async function At(t,e){let r=t.querySelector(".nav-cmp-detail"),n=t.getElementById("cmp-error"),i=t.getElementById("cmp-register"),o=i.closest(".ui-switch");r.classList.remove("cmp-enabled"),i.checked&&r.classList.add("cmp-loading");try{let a=i.dataset.id,c;e==="load"?c=await Kr({cmpId:a}):i.checked?(c=await Wr({cmpId:a}),te("registryUpdate"),ye("interaction",{type:"click",name:"register component",detail:a})):(c=await Yr({cmpId:a}),te("registryUpdate"),ye("interaction",{type:"click",name:"unregister component",detail:a})),le(c),ue(t);let d=be(t,a);e==="update"&&d&&(i.checked?(r.classList.add("cmp-enabled"),Vt(t,\`<strong>\${d.name}</strong> is now registered in <strong>\${G.registryDisplayPath}</strong> and available for use in the Builder Visual Editor\`)):Vt(t,\`<strong>\${d.name}</strong> has been unregistered from <strong>\${G.registryDisplayPath}</strong> and removed from the Builder Visual Editor\`))}catch(a){console.error(a),n.innerHTML=\`<p class="error">Error loading components</p><p class="error">\${a.message||a}</p>\`,o.style.display="none"}r.classList.remove("cmp-loading")}function Ji(t){let e=t.getElementById("cmp-name"),r=e.closest(".ui-text-input"),n="",i;e.addEventListener("focus",o=>{clearTimeout(i),r.classList.remove("saved"),o.stopPropagation(),n=e.value}),e.addEventListener("blur",async o=>{if(o.stopPropagation(),clearTimeout(i),r.classList.remove("saved"),e.value!==n){if(e.value.trim().length<3){e.value=n;return}r.classList.add("saved"),i=setTimeout(()=>{r.classList.remove("saved")},3e3);let a=e.dataset.id,c=await $r({cmpId:a,name:e.value});te("registryUpdate"),le(c),ue(t),be(t,a)}}),e.addEventListener("keyup",o=>{o.stopPropagation(),clearTimeout(i),r.classList.remove("saved"),o.key==="Escape"?(e.value=n,e.blur()):o.key==="Enter"&&e.blur()})}function be(t,e){let r=G.components.find(s=>s.id===e);if(!r)return null;let n=t.getElementById("cmp-register"),i=t.getElementById("cmp-error"),o=n.closest(".ui-switch");o.style.display="",i.innerHTML="",n.dataset.id=r.id,n.checked=!!r.isRegistered;let a=t.querySelector(".nav-cmp-detail");r.isRegistered?a.classList.add("cmp-enabled"):a.classList.remove("cmp-enabled");let c=t.getElementById("cmp-name");c.dataset.id=r.id,c.value=r.name;let d=t.getElementById("cmp-open-source");d.innerText=\`Open \${r.displayFilePath}\`,d.dataset.id=r.id;let p=t.getElementById("cmp-detail-title");return p.innerText=\`\${r.name} Component\`,no(t,r),r}function eo(t){t.getElementById("cmp-open-source").addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let n=r.target,i=G.components.find(o=>o.id===n?.dataset.id);i&&(De({filePath:i.filePath}),ye("interaction",{type:"click",name:"open component source file",detail:i.filePath}))})}function to(t){t.getElementById("btn-inputs-reload").addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),At(t,"load")})}function ro(t){t.getElementById("cmp-detail-inputs").addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let i=r.target?.closest("button"),o=i?.dataset.id,a=i?.dataset.propName;Je(t,o,a)&&oe(t,"nav-cmp-input")})}function no(t,e){let r=t.getElementById("cmp-detail-inputs"),n=e.inputs.filter(i=>!i.hideFromUI);n.length>0?(r.innerHTML="",n.forEach(i=>{r.appendChild(io(e,i))})):r.innerHTML=\`<p class="cmp-inputs-empty">\${e.name} component does not have any props</p>\`}function io(t,e){let r=document.createElement("button");r.dataset.id=t.id,r.dataset.propName=e.name,r.className="cmp-input-item nav-list-item",e.isRegistered||r.classList.add("cmp-input-item-unregistered");let n=document.createElement("span"),i=ft(e.type);n.className=\`nav-list-item-icon input-icon input-icon-\${i}\`,r.appendChild(n);let o=document.createElement("span");o.innerText=e.friendlyName||e.name,r.appendChild(o);let a=document.createElement("span");return a.className="nav-list-item-note",a.innerText=e.type,r.appendChild(a),r}function oi(t){t.getElementById("open-builder-registry").addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),De({filePath:G.registryPath,line:1,column:1})}),t.getElementById("cmp-list").addEventListener("click",o=>{o.preventDefault(),o.stopPropagation();let c=o.target?.dataset.id,d=G.components.find(p=>p.id===c);if(d){let p=t.querySelector(".nav-cmp-detail .section-content");p.scrollTop=0,be(t,d.id),oe(t,"nav-cmp-detail"),d.isRegistered&&At(t,"load")}});let n=t.getElementById("component-search"),i=t.getElementById("clear-search");n?.addEventListener("input",o=>{let a=o.target.value.toLowerCase(),c=a?G.components.filter(d=>d.name.toLowerCase().includes(a)||d.displayFilePath?.toLowerCase().includes(a)):G.components;ue(t,c),i.style.display=a?"flex":"none"}),i?.addEventListener("click",()=>{n.value="",ue(t),i.style.display="none"}),n?.addEventListener("keydown",o=>{o.key==="Escape"&&(n.value="",ue(t),i.style.display="none")})}function ai(t){let e=Gr();oo(t,e)}async function oo(t,e){let r=t.getElementById("cmp-list"),n=t.querySelector(".nav-cmp-list");n.classList.add("nav-loading");let i=t.getElementById("open-builder-registry");try{let o=await e;le(o),ue(t),G.registryDisplayPath?i.innerText="Open "+o.registryDisplayPath:i.innerText=""}catch(o){r.innerHTML=\`<p class="error">Error loading components</p><p class="error">\${o.message||o}</p>\`,console.error(o)}n.classList.remove("nav-loading")}function ue(t,e){let r=t.getElementById("cmp-list");r.innerHTML="";let n=e||G.components,i=n.filter(a=>a.isRegistered),o=n.filter(a=>!a.isRegistered);if(e&&e.length===0){let a=document.createElement("p");a.className="no-results",a.innerText="No matching components found",r.appendChild(a);return}ni(r,"Registered Components",i),ni(r,"Unregistered Components",o)}function ni(t,e,r){if(r.length>0){let n=document.createElement("h4");n.innerText=e,t.appendChild(n),r.forEach(i=>{t.appendChild(ao(i))})}}function ao(t){let e=document.getElementById("component-search")?.value.toLowerCase(),r=document.createElement("button");r.dataset.id=t.id,r.className="cmp-item nav-list-item",t.isRegistered&&r.classList.add("registered");let n=document.createElement("span");n.className="nav-list-item-icon",t.image&&(n.style.backgroundImage=\`url(\${t.image})\`),r.appendChild(n);let i=document.createElement("span");i.className="nav-list-item-name",i.innerHTML=ii(t.name,e),r.appendChild(i);let o=document.createElement("span");return o.className="nav-list-item-note",o.innerHTML=ii(t.displayFilePath||"",e),r.appendChild(o),r}function ii(t,e){if(!e)return t;let r=new RegExp(\`(\${e})\`,"gi");return t.replace(r,'<span class="search-highlight">$1</span>')}var si=t=>{t.querySelector(".menu-toggle").addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),Ee(t,!0)}),t.getElementById("close").addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),Ee(t,!1)}),t.getElementById("hit").addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),Ee(t,!1)}),Dr(t),t.addEventListener("click",e=>e.stopPropagation()),so(t)},Ee=(t,e)=>{e?(document.body.classList.add("builder-no-scroll"),t.host.classList.add("show-builder-menu"),te("menuOpen"),Pr("menuOpened"),ye("interaction",{type:"click",name:"open dev-tools menu"})):(document.body.classList.remove("builder-no-scroll"),t.host.classList.remove("show-builder-menu"),te("menuClose"),setTimeout(()=>{oe(t,"nav-home")},300)),zr(e)},so=t=>{if(!Lr("menuOpened")){uo(t);return}let e=Ze();if(!((Date.now()-e.firstVisitTs)/1e3/60<10)&&!Lr("feedback")){Pr("feedback"),co(t);return}},uo=t=>{let e=document.createElement("a");e.classList.add("menu-toggle-tooltip"),e.href="#open-dev-tools",e.innerHTML=\`
|
|
@@ -1276,7 +1276,7 @@ Restarting server after Builder Devtools update...
|
|
|
1276
1276
|
<h3>How's Devtools working for you?</h3>
|
|
1277
1277
|
<p>We'd love your feedback!</p>
|
|
1278
1278
|
</div>
|
|
1279
|
-
\`,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",a=>{a.preventDefault(),a.stopPropagation(),Ee(t,!1),window.open(Ur(),"builder")}),t.getElementById("components-link").addEventListener("click",a=>{a.preventDefault(),a.stopPropagation();let c=t.querySelector(".nav-cmp-list .section-content");c.scrollTop=0,oe(t,"nav-cmp-list"),ai(t)}),t.getElementById("settings-link").addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),oe(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),Ee(t,!1),window.open(je(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",a=>{a.preventDefault(),a.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(),Ht(e.checked)}),e.checked=it(),Ht(e.checked)}var Dt=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>\`,si(e),ui(e),oi(e),ri(e),ti(e),ci(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.53.3-beta.202605061017.1167984"}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)}
|
|
1279
|
+
\`,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",a=>{a.preventDefault(),a.stopPropagation(),Ee(t,!1),window.open(Ur(),"builder")}),t.getElementById("components-link").addEventListener("click",a=>{a.preventDefault(),a.stopPropagation();let c=t.querySelector(".nav-cmp-list .section-content");c.scrollTop=0,oe(t,"nav-cmp-list"),ai(t)}),t.getElementById("settings-link").addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),oe(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),Ee(t,!1),window.open(je(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",a=>{a.preventDefault(),a.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(),Ht(e.checked)}),e.checked=it(),Ht(e.checked)}var Dt=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>\`,si(e),ui(e),oi(e),ri(e),ti(e),ci(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.53.3-beta.202605061032.da67fc8"}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)}
|
|
1280
1280
|
</style>\`,Nt=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=lo+\`<main>
|
|
1281
1281
|
<aside>
|
|
1282
1282
|
<div class="logo"></div>
|
|
@@ -1315,7 +1315,7 @@ Restarting server after Builder Devtools update...
|
|
|
1315
1315
|
</nav>
|
|
1316
1316
|
</section>
|
|
1317
1317
|
</main>
|
|
1318
|
-
\`,po();let r=new URL(Fr,ot);r.searchParams.set(Br,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 jr()).isValid||fo()},fo=()=>{customElements.get("builder-dev-tools-overview")||customElements.define("builder-dev-tools-overview",Nt);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",at),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",Dt);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.53.3-beta.
|
|
1318
|
+
\`,po();let r=new URL(Fr,ot);r.searchParams.set(Br,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 jr()).isValid||fo()},fo=()=>{customElements.get("builder-dev-tools-overview")||customElements.define("builder-dev-tools-overview",Nt);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",at),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",Dt);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.53.3-beta.202605061032.da67fc8"),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.53.3-beta.202605061032.da67fc8"),mo());})();`)}async function Ote(t){return Kte(t,`<!doctype html>
|
|
1319
1319
|
<html lang="en" dir="ltr">
|
|
1320
1320
|
<head>
|
|
1321
1321
|
<meta charset="utf-8" />
|
|
@@ -1481,7 +1481,7 @@ Restarting server after Builder Devtools update...
|
|
|
1481
1481
|
</script>
|
|
1482
1482
|
</body>
|
|
1483
1483
|
</html>
|
|
1484
|
-
`)}async function Kte(t,e){let r=await
|
|
1484
|
+
`)}async function Kte(t,e){let r=await iY(t),n=t.getFrameworks();return e.replace(/__LOCAL_APP_ID__/g,r).replace(/__DEV_TOOLS_URL__/g,t.devToolsServerUrl).replace(/__CLIENT_ID__/g,t.getClientId()).replace(/__FRAMEWORK__/g,n.length?n[0].name:"")}var Hte=L(()=>{"use strict";h();Qt()});async function Yte(t,e){let r=new URL("/cli-auth","https://builder.io");r.searchParams.set("client_id",t.getClientId()),r.searchParams.set("host",await t.getDeviceId()),r.searchParams.set("response_type","code"),r.searchParams.set("cli","true");let n=new URL(wl,t.devToolsServerUrl);n.searchParams.set(OB,(0,Jte.platform)()),n.searchParams.set(KB,process.versions.node);let i=t.getFrameworks();return i.length>0&&(r.searchParams.set(yp,i[0].name),n.searchParams.set(yp,i[0].name)),r.searchParams.set("redirect_url",n.href),r.searchParams.set("preview_url",e),r.href}var Jte,jte=L(()=>{"use strict";h();Qp();Jte=require("node:os")});async function $te(t,e,r,n){try{if(!t)return Kd(r,n,400,"Builder context closed");let i=qKe(r);if(i.pathname===DF){if(r.method==="POST"){let s=await jKe(r);if(s)try{let o=await _te(t,JSON.parse(s));return qte(r,n,200,o)}catch(o){t.debug("Dev API Error",o.stack||o.message||o);let a={errors:[String(o.message||o)]};return qte(r,n,500,a)}}else if(r.method==="OPTIONS"){let s={"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Cache-Control, X-Builder-Devtools-Version, sentry-trace, baggage"},o=r.headers.origin;o&&o!=="null"?Vte(new URL(o))&&(s["Access-Control-Allow-Origin"]=o):s["Access-Control-Allow-Origin"]="*",n.writeHead(200,s),n.end();return}return Kd(r,n,405,`${DF} is an API endpoint used only during development by the Builder.io Devtools client-side script`)}if(i.pathname===wF)return HKe(r,n,200,await Gte(t));if(i.pathname===QJ){let s=i.searchParams.get(QF);return s?YKe(n,302,await Yte(t,s)):Kd(r,n,400,`Missing ${QF} querystring`)}if(i.pathname===wl)return JKe(r,n,200,await Ote(t));if(i.pathname===DJ){await $t(t,{_:[]},{});let s=await vC(t),{figmaBuilderLinks:o,diagnostics:a}=await i1({mappingFiles:s,sys:t});return SC(r,n,200,"application/json",JSON.stringify({figmaBuilderLinks:o,foundErrors:a.length>0,diagnostics:a,version:2,local:!0},null,2))}return i.pathname===bl?(t.debug(`Close Dev Tools Server Requested: ${i.href}`),setTimeout(()=>{try{e.close(s=>{t.debug(`Dev Tools Server Closed Error: ${s}`)})}catch(s){t.debug(`Error closing devtools server: ${s}`)}},20),Kd(r,n,200,"Closing Dev Tools Server")):Kd(r,n,404,"Not found")}catch(i){return t?.Sentry?.captureException(i),Kd(r,n,500,`Dev Server Error: ${i}`)}}function qte(t,e,r,n){SC(t,e,r,"application/json",JSON.stringify(n))}function HKe(t,e,r,n){SC(t,e,r,"application/javascript",n)}function JKe(t,e,r,n){SC(t,e,r,"text/html",n)}function Kd(t,e,r,n){SC(t,e,r,"text/plain",n)}function SC(t,e,r,n,i){let s={"Content-Type":`${n}; charset=utf-8`,"Cache-Control":"no-cache, no-store, must-revalidate","X-Builder-Devtools-Version":ut},o=t.headers.origin;o&&o!=="null"?Vte(new URL(o))&&(s["Access-Control-Allow-Origin"]=o):s["Access-Control-Allow-Origin"]="*",e.writeHead(r,s),e.end(i)}function Vte(t){return t.hostname==="localhost"||t.origin==="https://builder.io"||t.origin==="https://www.builder.io"||t.origin.endsWith(".builder.io")?!0:t.port===""?!1:t.port!=="80"&&t.port!=="443"}function YKe(t,e,r){t.writeHead(e,{Location:r}),t.end()}async function jKe(t){let e="";for await(let r of t)e+=r;return e}function qKe(t){let e=t.url||"/";return new URL(e,`http://${t.headers.host}`)}var Wte=L(()=>{"use strict";h();Qp();Ute();Hte();jte();Rr();xC();Hr()});async function zte(t){if(globalThis.__builderDevToolsServer)return t.debug("reusing existing devtools server"),globalThis.__builderDevToolsServer.setContext(t),globalThis.__builderDevToolsServer;let e=await $Ke(t),r=(0,Aw.createServer)((i,s)=>{$te(t,r,i,s)}),n=()=>new Promise((i,s)=>{r.listening?(t.debug(`closing devtools server on port ${e}`),r.close(o=>{t=null,o?(t.debug(`error closing devtools server on port ${e}`),s(o)):(t&&t.debug(`closed devtools server on port ${e}`),i())})):(t.debug(`devtools server on port ${e} not listening`),i())});return process.once("SIGTERM",n),process.once("SIGINT",n),process.env.CI!=="true"&&process.stdin.on("end",n),globalThis.__builderDevToolsServer={url:new URL(`http://localhost:${e}`).href,port:e,setContext:i=>{t.debug(`set devtools context on server ${e}`),t=i},close:async()=>{globalThis.__builderDevToolsServer=null,await n()}},new Promise(i=>{r.listen(e,()=>{t.debug(`started devtools server on port ${e}`),i(globalThis.__builderDevToolsServer)})})}function $Ke(t){return new Promise(e=>{let r=t.port;try{(0,Aw.request)({hostname:"localhost",port:r,path:bl,method:"GET"},i=>{i.on("end",()=>{t.debug(`${bl} - Response ended`),e(r)})}).on("error",i=>{t.debug(`${bl} - No response ${i}`),e(r)}).end()}catch(n){t.debug(`${bl} - Error ${n}`),e(r)}})}var Aw,Xte=L(()=>{"use strict";h();Aw=require("node:http");Wte();Qp()});async function s1(t){let e={...t,devToolsServerUrl:"",isValid:!1,serverShouldRestart:!1,publicApiKey:"",port:t.port||5273,ignoreMissingConfig:!1,getAllProjectFiles:t.getAllProjectFiles||(()=>Promise.resolve([]))},r=t.getFrameworks().map(s=>s.name).join(", ");e.debug(`create devtools ${ere} [${r}]`);let n=await zte(e);return e.devToolsServerUrl=n.url,e.port=n.port,{getUrl:()=>e.devToolsServerUrl}}var Zte=L(()=>{"use strict";h();Xte();o1()});var ere,o1=L(()=>{"use strict";h();Hr();Zte();ere=ut});async function tre(t){if(console.log(""),Zt((0,Iu.bgCyan)((0,Iu.bold)((0,Iu.white)(" add ")))+" "+(0,Iu.dim)(ut)),!t.path&&!process.stdout.isTTY&&process.env.FORCE_TTY!=="1")return Ue(`This command requires a TTY-enabled terminal.
|
|
1485
1485
|
If you are using Windows Git Bash, try a different terminal or wrap the command with winpty.`),await Ne(1);let e=t.snippetId;if(!e&&!t.snippet)return Ue("SnippetId expected. npx builder.io add <snippetId>"),await Ne(1);let r=ji(),n=t.snippet||null;if(!n&&e&&(r.start(`Fetching snippet ${e}`),n=await a1(e),r.stop(`Fetched snippet ${e}`)),!n)return Ue(`No snippet found for id ${e}`),await Ne(1);let i=process.cwd(),s=sC(i)??i;if(n.files?.length>0){let o=A1(s,n.framework||"react"),a=t.path||await or({message:"Where should we copy the files?",initialValue:o,validate(c){if(c.length===0)return"File path is required!";if(c[0]!==".")return"Please enter a relative path."}});if(He(a))return Ue("Cancelled sync"),await Ne(0);let A=await cw(s,n,n.files,a,!1);return q.success("All files have been written successfully."),{snippet:n,pathInput:a,writtenFiles:A,timeStamp:Date.now()}}else{let{code:o,suggestedName:a,framework:A}=n;A&&(a=await WKe(s,A,o)),a??="./src/components/MyComponent.jsx";let c=rre(n,VKe(n.code),n.framework);try{n.framework==="html"?c=await FA(s,c,"html",void 0):n.framework==="angular"?c=await FA(s,c,"angular",void 0):n.framework==="vue"?c=await FA(s,c,"vue",void 0):n.framework==="svelte"?c=await FA(s,c,"svelte",void 0):c=await FA(s,c,"typescript",void 0)}catch{}let u=t.path;if(!u){try{let g=(await vV({cwd:process.cwd()})).getFrameworks();if(g.length>0){let p;if(g.some(f=>f.name.includes("qwik"))?p="qwik":g.some(f=>f.name.includes("react"))?p="react":p=g[0].name,n.framework&&n.framework!==p){let f=await Ir({message:`This snippet is for ${n.framework}, but you are using ${p}. Continue?`,initialValue:!1});if(He(f)||!f)return console.log("Please go back to builder and change the output framework to match your project."),console.log(),await Ne(0)}}}catch{}if(u=await or({message:"Where should we copy the code?",initialValue:a?.startsWith("./")?a:`./${a}`,validate(d){if(d.length===0)return"File path is required!";if(d[0]!==".")return"Please enter a relative path."}}),He(u))return console.log(""),await Ne(0)}let l=(0,Wo.resolve)(s,u);q.info(`Writing code to ${l}`),(0,qn.mkdirSync)((0,Wo.dirname)(l),{recursive:!0}),(0,qn.writeFileSync)(l,c)}}function a1(t){return Fe(`https://cdn.builder.io/api/v1/snippet/${t}`).then(e=>e.status===404?null:e.json())}function VKe(t){return t.replace(/^```jsx\s?|\s?```$/g,"").trim()}function rre(t,e,r,n=!1){if(!r)return e;let i="This code was generated by Builder.io",s=n?`https://builder.io/content/${t.contentId}?codeSession=${t.sessionKey}&sid=${t.id}`:"",o=["vue","html","svelte"].includes(r.toLowerCase()),a=[i,s].filter(Boolean);return`${o?a.map(c=>`<!-- ${c} -->`).join(`
|
|
1486
1486
|
`):`/**
|
|
1487
1487
|
${a.map(c=>` * ${c}`).join(`
|
|
@@ -1745,8 +1745,8 @@ Stderr: ${B}`))})})}async#A(e,r,n,i,s,o,a){return new Promise((A,c)=>{let u=r.to
|
|
|
1745
1745
|
${m}`))}),f.on("close",I=>{yg.debug(`ffmpeg stdout:${C}`),I===0?A():c(new Error(`ffmpeg exited with code ${I}
|
|
1746
1746
|
Stderr: ${m}`))})})}async#i(){if(this.tmpDir)try{await VC.promises.rm(this.tmpDir,{recursive:!0,force:!0}),this.tmpDir=null}catch(e){yg.warn(`Failed to cleanup temporary directory: ${e}`)}}async cleanup(){await this.#i()}}});async function Wie(t,e,r,n){try{if(!(await fetch(`${_Je}?imageId=${encodeURIComponent(r)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:t,imageContentType:e}),signal:n})).ok)return null;let s=`assets/TEMP/${r}`;return`${UJe}/${encodeURIComponent(s)}`}catch{return null}}var _Je,UJe,zie=L(()=>{"use strict";h();_Je="https://builder.io/api/v1/stage-image",UJe="https://cdn.builder.io/api/v1/image"});var Bn,Jw,WC,GJe,IL,EL,BL,zC,Xie=L(()=>{"use strict";h();Bn=require("node:fs"),Jw=require("node:path");zie();Dt();WC=Se("TimelineCollector"),GJe={mcp__chrome__navigate_page:{labelFn:t=>`Navigating to ${t?.url||t?.path||"page"}`,category:"navigation"},mcp__chrome__take_screenshot:{labelFn:()=>"Checking page state",category:"observation"},mcp__chrome__click:{labelFn:t=>`Clicking '${t?.selector||t?.ref||"element"}'`,category:"interaction"},mcp__chrome__fill:{labelFn:t=>`Typing in '${t?.selector||t?.ref||"field"}'`,category:"interaction"},mcp__chrome__type:{labelFn:t=>`Typing '${(t?.text||"").substring(0,30)}'`,category:"interaction"},mcp__chrome__press_key:{labelFn:t=>`Pressing ${t?.key||"key"}`,category:"interaction"},mcp__chrome__evaluate_script:{labelFn:()=>"Running script on page",category:"interaction"},mcp__chrome__hover:{labelFn:t=>`Hovering over '${t?.selector||t?.ref||"element"}'`,category:"interaction"},mcp__chrome__scroll:{labelFn:()=>"Scrolling page",category:"interaction"},mcp__chrome__select_option:{labelFn:t=>`Selecting '${t?.value||"option"}' in '${t?.selector||"dropdown"}'`,category:"interaction"}},IL=500,EL=5e3,BL=2e3,zC=class{#n;#c;#s;#t;#A=[];#i=[];#e=null;#o=null;#B=0;#h=0;#M=Date.now();#k="";#S="";#v=!1;#a=[];#p=null;#r=[];#g;constructor(e,r){this.#n=e,this.#c=r.framesDir,this.#s=r.debug??!1,this.#t=r.enableCdnUpload??!0,this.#g=(0,Jw.join)(r.framesDir,`${e}-state.jsonl`)}setReplayUploader(e){this.#e=e}reset(){this.#A=[],this.#i=[],this.#o=null,this.#B=0,this.#h=0,this.#M=Date.now(),this.#k="",this.#S="",this.#a=[],this.#p=null,this.#r=[];try{(0,Bn.existsSync)(this.#g)&&(0,Bn.unlinkSync)(this.#g)}catch{}}onToolCall(e,r){let n=GJe[e];if(n){let i={};try{i=JSON.parse(r||"{}")}catch{}let s=n.labelFn(i);this.#k=s,this.#w({label:s,category:n.category,toolName:e,timestamp:Date.now()})}}onToolResult(e){if(e.tool_name!=="mcp__chrome__take_screenshot"||!Array.isArray(e.content))return;let r=e.content.find(n=>n.type==="image"&&n.source.type==="base64");r&&(this.#o=r)}onRecordFrame(e){let r=this.#o;if(!r)return;let n=e.title||"Untitled",i=e.category||"milestone";this.#k=n,this.#J(r,n,i,!0,void 0,e.description)}onThinking(e){!e||e.length===0||(this.#S=e.substring(0,300),this.#w({label:"AI thinking",category:"observation",thinking:e.substring(0,2e3),timestamp:Date.now()}))}getLastCapturedImage(){return this.#o}getExplicitFrames(){return this.#i.filter(e=>e.explicit).map(e=>({image:e.image,title:e.title}))}getExplicitImages(){return this.#i.filter(e=>e.explicit).map(e=>e.image)}getAllImages(){return this.#i.map(e=>e.image)}getLegacyMetadataFrames(){return this.#i.filter(e=>e.explicit).map(e=>({hasImage:!0,title:e.title}))}getExplicitFrameDurations(){let e=this.#i.filter(n=>n.explicit);if(e.length<=1)return[];let r=[];for(let n=0;n<e.length;n++)if(n<e.length-1){let i=e[n+1].timestamp-e[n].timestamp,s=Math.min(EL,Math.max(IL,i));r.push((s/1e3).toFixed(2))}else r.push((BL/1e3).toFixed(2));return r}getProgressSnapshot(){let e=this.#i[this.#i.length-1];return{eventCount:this.#A.length,frameCount:this.#i.length,lastLabel:this.#k,lastFrameFileName:e?.fileName,lastThinking:this.#S||void 0}}getEventCount(){return this.#A.length}getFrameCount(){return this.#i.length}getLastLabel(){return this.#k}hasExplicitFrames(){return this.#i.some(e=>e.explicit)}hasAnyFrames(){return this.#i.length>0}mergeChildTimeline(e,r,n){let i,s;for(let c of e.#A)(i===void 0||c.timestamp<i)&&(i=c.timestamp),(s===void 0||c.timestamp>s)&&(s=c.timestamp);let o=this.#w({label:`[${r}] Start`,category:"milestone",timestamp:i??Date.now()}),a=new Map;for(let c of e.#A){let u=this.#w({label:`[${r}] ${c.label}`,category:c.category,description:c.description,toolName:c.toolName,durationMs:c.durationMs,thinking:c.thinking,frameIndex:c.frameIndex!=null?c.frameIndex+this.#h:void 0,timestamp:c.timestamp});a.set(c.id,u.id)}for(let c of e.#i){let u=`${this.#n}-${r}-${String(this.#h).padStart(5,"0")}.${this.#P(c.image)}`,l={image:c.image,title:`[${r}] ${c.title}`,category:c.category,eventId:a.get(c.eventId)??o.id,explicit:c.explicit,timestamp:c.timestamp,fileName:u,imageUrl:c.imageUrl};c.uploadPromise&&(l.uploadPromise=c.uploadPromise.then(()=>{l.imageUrl=c.imageUrl})),this.#i.push(l),this.#h++,this.#R(c.image,u).catch(()=>{})}let A=this.#w({label:`[${r}] End${n?.summary?` \u2014 ${n.summary}`:""}`,category:"milestone",timestamp:s??Date.now()});return n?.sessionId&&this.#a.push({label:r,sessionId:n.sessionId,startEventId:o.id,endEventId:A.id,testCaseIds:n.testCaseIds,replayId:n.replayId}),this.mergeChildStateFile(e.getStateFilePath()),{startEventId:o.id,endEventId:A.id}}mergeTestPlan(e){if(!this.#p)this.#p={mode:e.mode,test_cases:[...e.test_cases]};else{let r=new Set(this.#p.test_cases.map(n=>n.id));for(let n of e.test_cases)r.has(n.id)||this.#p.test_cases.push(n)}}getMergedTestPlan(){return this.#p}mergeTestCaseResults(e){for(let r of e){let n=r.test_case_id;if(!n){this.#r.push(r);continue}let i=this.#r.findIndex(A=>A.test_case_id===n);if(i===-1){this.#r.push(r);continue}let s=this.#r[i],o=Number(s.timestamp??s.ts??0);Number(r.timestamp??r.ts??Date.now())>=o&&(this.#r[i]=r)}}getMergedTestCaseResults(){return this.#r}getStateFilePath(){return this.#g}onTestOutcome(e,r,n){this.#H({kind:"test_outcome",status:r,reason:n,...e})}mergeChildStateFile(e){try{if(!(0,Bn.existsSync)(e))return;this.#W(),(0,Bn.appendFileSync)(this.#g,(0,Bn.readFileSync)(e,"utf8"))}catch(r){this.#s&&WC.warn(`Failed to merge child state: ${e}`,r)}}readState(){try{if(!(0,Bn.existsSync)(this.#g))return[];let e=(0,Bn.readFileSync)(this.#g,"utf8"),r=[];for(let n of e.split(`
|
|
1747
1747
|
`))if(n)try{r.push(JSON.parse(n))}catch{}return r}catch{return[]}}#H(e){try{this.#W(),(0,Bn.appendFileSync)(this.#g,JSON.stringify({ts:Date.now(),agentId:this.#n,...e})+`
|
|
1748
|
-
`)}catch(r){this.#s&&WC.warn("Failed to append state entry",r)}}#W(){this.#v||((0,Bn.mkdirSync)(this.#c,{recursive:!0}),this.#v=!0)}getHighlightFrames(){if(this.#i.length===0)return[];let e=new Set;e.add(0),e.add(this.#i.length-1);for(let s=0;s<this.#i.length;s++)this.#i[s].explicit&&e.add(s);let r=new Set(this.#A.filter(s=>s.category==="navigation"&&s.frameIndex!=null).map(s=>s.frameIndex));for(let s=0;s<this.#i.length;s++)s>0&&r.has(s-1)&&e.add(s),r.has(s)&&e.add(s);for(let s of this.#A)s.frameIndex!=null&&(s.category==="milestone"||s.category==="assertion"||s.category==="error")&&e.add(s.frameIndex);let n=[...e].sort((s,o)=>s-o);n=n.filter((s,o)=>o===0||this.#i[s].title!==this.#i[n[o-1]].title);let i=15;if(n.length>i){let s=n[0],o=n[n.length-1],a=n.slice(1,-1),A=a.length/(i-2),c=[s];for(let u=0;u<i-2;u++)c.push(a[Math.round(u*A)]);c.push(o),n=c}return n.map(s=>this.#i[s])}getHighlightImages(){return this.getHighlightFrames().map(e=>e.image)}getHighlightMetadataFrames(){return this.getHighlightFrames().map(e=>({hasImage:!0,title:e.title}))}getHighlightFrameDurations(){let e=this.getHighlightFrames();if(e.length<=1)return[];let r=[];for(let n=0;n<e.length;n++)if(n<e.length-1){let i=e[n+1].timestamp-e[n].timestamp,s=Math.min(EL,Math.max(IL,i));r.push((s/1e3).toFixed(2))}else r.push((BL/1e3).toFixed(2));return r}async cleanupSessionFiles(){let e=this.#c;try{let n=(await Bn.promises.readdir(e)).filter(s=>s.startsWith(this.#n)),i=0;for(let s of n)try{await Bn.promises.unlink((0,Jw.join)(e,s)),i++}catch{}i>0&&WC.info(`Cleaned up ${i} local files for session ${this.#n}`)}catch{}}async finalize(){let e=this.#i.map(s=>s.uploadPromise).filter(Boolean);if(e.length>0){let s=new Promise(o=>setTimeout(o,3e4));await Promise.race([Promise.allSettled(e),s])}let r=Date.now(),n=this.#i.map((s,o)=>{let a=BL;if(o<this.#i.length-1){let A=this.#i[o+1].timestamp-s.timestamp;a=Math.min(EL,Math.max(IL,A))}return{index:o,timestamp:s.timestamp,title:s.title,category:s.category,eventId:s.eventId,explicit:s.explicit,displayDurationMs:a,fileName:s.fileName,image_url:s.imageUrl,cursorX:s.cursorX,cursorY:s.cursorY,viewportWidth:s.viewportWidth,viewportHeight:s.viewportHeight}}),i={version:1,sessionId:this.#n,startTime:this.#M,endTime:r,totalFrames:n.length,events:this.#A,frames:n,...this.#a.length>0&&{phases:this.#a}};return this.#t&&this.#i.length>0&&this.#i.every(s=>!!s.imageUrl)&&this.cleanupSessionFiles().catch(()=>{}),i}#w(e){let r={id:this.#B++,...e};return this.#A.push(r),r}#J(e,r,n,i,s,o,a){let A=this.#w({label:r,category:n,frameIndex:this.#h,durationMs:s,description:o,timestamp:Date.now()}),c=this.#P(e),u=`${this.#n}-frame-${String(this.#h).padStart(5,"0")}.${c}`,l={image:e,title:r,category:n,eventId:A.id,explicit:i,timestamp:Date.now(),fileName:u,cursorX:a?.x,cursorY:a?.y,viewportWidth:a?.viewportWidth,viewportHeight:a?.viewportHeight};if(this.#i.push(l),this.#h++,this.#R(e,u).catch(()=>{}),this.#t&&e.source.type==="base64"){let d=`${this.#n}-frame-${String(this.#h-1).padStart(5,"0")}`;l.uploadPromise=Wie(e.source.data,e.source.media_type,d).then(g=>{g&&(l.imageUrl=g),this.#e&&this.#e.recordCheckpoint(l.timestamp,l.title,l.imageUrl)})}}async#R(e,r){try{this.#v||(await Bn.promises.mkdir(this.#c,{recursive:!0}),this.#v=!0);let n=(0,Jw.join)(this.#c,r);if(e.source.type==="base64"){let i=Buffer.from(e.source.data,"base64");await Bn.promises.writeFile(n,new Uint8Array(i)),this.#s&&WC.info(`Saved frame: ${r}`)}}catch(n){this.#s&&WC.warn(`Failed to save frame: ${r}`,n)}}#P(e){if(e.source.type!=="base64")return"webp";switch(e.source.media_type){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/gif":return"gif";default:return"webp"}}}});function pn(t){return t.replace(/\\/g,"/").replace(/^\.\//,"")}var Yw=L(()=>{"use strict";h()});function tc(t){return Array.isArray?Array.isArray(t):ose(t)==="[object Array]"}function KJe(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-OJe?"-0":e}function HJe(t){return t==null?"":KJe(t)}function Za(t){return typeof t=="string"}function ise(t){return typeof t=="number"}function JJe(t){return t===!0||t===!1||YJe(t)&&ose(t)=="[object Boolean]"}function sse(t){return typeof t=="object"}function YJe(t){return sse(t)&&t!==null}function ks(t){return t!=null}function yL(t){return!t.trim().length}function ose(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ase(t){let e=null,r=null,n=null,i=1,s=null;if(Za(t)||tc(t))n=t,e=ese(t),r=DL(t);else{if(!Zie.call(t,"name"))throw new Error(VJe("name"));let o=t.name;if(n=o,Zie.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(WJe(o));e=ese(o),r=DL(o),s=t.getFn}return{path:e,id:r,weight:i,src:n,getFn:s}}function ese(t){return tc(t)?t:t.split(".")}function DL(t){return tc(t)?t.join("."):t}function zJe(t,e){let r=[],n=!1,i=(s,o,a)=>{if(ks(s))if(!o[a])r.push(s);else{let A=o[a],c=s[A];if(!ks(c))return;if(a===o.length-1&&(Za(c)||ise(c)||JJe(c)))r.push(HJe(c));else if(tc(c)){n=!0;for(let u=0,l=c.length;u<l;u+=1)i(c[u],o,a+1)}else o.length&&i(c,o,a+1)}};return i(t,Za(e)?e.split("."):e,0),n?r:r[0]}function n9e(t=1,e=3){let r=new Map,n=Math.pow(10,e);return{get(i){let s=i.match(r9e).length;if(r.has(s))return r.get(s);let o=1/Math.pow(s,.5*t),a=parseFloat(Math.round(o*n)/n);return r.set(s,a),a},clear(){r.clear()}}}function Ase(t,e,{getFn:r=nt.getFn,fieldNormWeight:n=nt.fieldNormWeight}={}){let i=new XC({getFn:r,fieldNormWeight:n});return i.setKeys(t.map(ase)),i.setSources(e),i.create(),i}function i9e(t,{getFn:e=nt.getFn,fieldNormWeight:r=nt.fieldNormWeight}={}){let{keys:n,records:i}=t,s=new XC({getFn:e,fieldNormWeight:r});return s.setKeys(n),s.setIndexRecords(i),s}function jw(t,{errors:e=0,currentLocation:r=0,expectedLocation:n=0,distance:i=nt.distance,ignoreLocation:s=nt.ignoreLocation}={}){let o=e/t.length;if(s)return o;let a=Math.abs(n-r);return i?o+a/i:a?1:o}function s9e(t=[],e=nt.minMatchCharLength){let r=[],n=-1,i=-1,s=0;for(let o=t.length;s<o;s+=1){let a=t[s];a&&n===-1?n=s:!a&&n!==-1&&(i=s-1,i-n+1>=e&&r.push([n,i]),n=-1)}return t[s-1]&&s-n>=e&&r.push([n,s-1]),r}function o9e(t,e,r,{location:n=nt.location,distance:i=nt.distance,threshold:s=nt.threshold,findAllMatches:o=nt.findAllMatches,minMatchCharLength:a=nt.minMatchCharLength,includeMatches:A=nt.includeMatches,ignoreLocation:c=nt.ignoreLocation}={}){if(e.length>Qg)throw new Error($Je(Qg));let u=e.length,l=t.length,d=Math.max(0,Math.min(n,l)),g=s,p=d,f=a>1||A,m=f?Array(l):[],C;for(;(C=t.indexOf(e,p))>-1;){let w=jw(e,{currentLocation:C,expectedLocation:d,distance:i,ignoreLocation:c});if(g=Math.min(w,g),p=C+u,f){let D=0;for(;D<u;)m[C+D]=1,D+=1}}p=-1;let I=[],B=1,E=u+l,y=1<<u-1;for(let w=0;w<u;w+=1){let D=0,x=E;for(;D<x;)jw(e,{errors:w,currentLocation:d+x,expectedLocation:d,distance:i,ignoreLocation:c})<=g?D=x:E=x,x=Math.floor((E-D)/2+D);E=x;let S=Math.max(1,d-x+1),v=o?l:Math.min(d+x,l)+u,P=Array(v+2);P[v+1]=(1<<w)-1;for(let H=v;H>=S;H-=1){let M=H-1,G=r[t.charAt(M)];if(f&&(m[M]=+!!G),P[H]=(P[H+1]<<1|1)&G,w&&(P[H]|=(I[H+1]|I[H])<<1|1|I[H+1]),P[H]&y&&(B=jw(e,{errors:w,currentLocation:M,expectedLocation:d,distance:i,ignoreLocation:c}),B<=g)){if(g=B,p=M,p<=d)break;S=Math.max(1,2*d-p)}}if(jw(e,{errors:w+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:c})>g)break;I=P}let Q={isMatch:p>=0,score:Math.max(.001,B)};if(f){let w=s9e(m,a);w.length?A&&(Q.indices=w):Q.isMatch=!1}return Q}function a9e(t){let e={};for(let r=0,n=t.length;r<n;r+=1){let i=t.charAt(r);e[i]=(e[i]||0)|1<<n-r-1}return e}function tse(t,e){let r=t.match(e);return r?r[1]:null}function u9e(t,e={}){return t.split(c9e).map(r=>{let n=r.trim().split(A9e).filter(s=>s&&!!s.trim()),i=[];for(let s=0,o=n.length;s<o;s+=1){let a=n[s],A=!1,c=-1;for(;!A&&++c<rse;){let u=kL[c],l=u.isMultiMatch(a);l&&(i.push(new u(l,e)),A=!0)}if(!A)for(c=-1;++c<rse;){let u=kL[c],l=u.isSingleMatch(a);if(l){i.push(new u(l,e));break}}}return i})}function g9e(...t){NL.push(...t)}function TL(t,e){for(let r=0,n=NL.length;r<n;r+=1){let i=NL[r];if(i.condition(t,e))return new i(t,e)}return new $w(t,e)}function cse(t,e,{auto:r=!0}={}){let n=i=>{let s=Object.keys(i),o=p9e(i);if(!o&&s.length>1&&!PL(i))return n(nse(i));if(d9e(i)){let A=o?i[ML.PATH]:s[0],c=o?i[ML.PATTERN]:i[A];if(!Za(c))throw new Error(qJe(A));let u={keyId:DL(A),pattern:c};return r&&(u.searcher=TL(c,e)),u}let a={children:[],operator:s[0]};return s.forEach(A=>{let c=i[A];tc(c)&&c.forEach(u=>{a.children.push(n(u))})}),a};return PL(t)||(t=nse(t)),n(t)}function f9e(t,{ignoreFieldNorm:e=nt.ignoreFieldNorm}){t.forEach(r=>{let n=1;r.matches.forEach(({key:i,norm:s,score:o})=>{let a=i?i.weight:null;n*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:s))}),r.score=n})}function h9e(t,e){let r=t.matches;e.matches=[],ks(r)&&r.forEach(n=>{if(!ks(n.indices)||!n.indices.length)return;let{indices:i,value:s}=n,o={indices:i,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),e.matches.push(o)})}function m9e(t,e){e.score=t.score}function C9e(t,e,{includeMatches:r=nt.includeMatches,includeScore:n=nt.includeScore}={}){let i=[];return r&&i.push(h9e),n&&i.push(m9e),t.map(s=>{let{idx:o}=s,a={item:e[o],refIndex:o};return i.length&&i.forEach(A=>{A(s,a)}),a})}var OJe,jJe,qJe,$Je,VJe,WJe,Zie,QL,XJe,ZJe,e9e,t9e,nt,r9e,XC,Qg,qw,$w,eA,wL,bL,SL,vL,xL,FL,Vw,Ww,kL,rse,A9e,c9e,l9e,RL,NL,zw,ML,PL,p9e,d9e,nse,rc,use=L(()=>{h();OJe=1/0;jJe="Incorrect 'index' type",qJe=t=>`Invalid value for key ${t}`,$Je=t=>`Pattern length exceeds max of ${t}.`,VJe=t=>`Missing ${t} property in key`,WJe=t=>`Property 'weight' in key '${t}' must be a positive integer`,Zie=Object.prototype.hasOwnProperty,QL=class{constructor(e){this._keys=[],this._keyMap={};let r=0;e.forEach(n=>{let i=ase(n);this._keys.push(i),this._keyMap[i.id]=i,r+=i.weight}),this._keys.forEach(n=>{n.weight/=r})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};XJe={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},ZJe={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},e9e={location:0,threshold:.6,distance:100},t9e={useExtendedSearch:!1,getFn:zJe,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},nt={...ZJe,...XJe,...e9e,...t9e},r9e=/[^ ]+/g;XC=class{constructor({getFn:e=nt.getFn,fieldNormWeight:r=nt.fieldNormWeight}={}){this.norm=n9e(r,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((r,n)=>{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Za(this.docs[0])?this.docs.forEach((e,r)=>{this._addString(e,r)}):this.docs.forEach((e,r)=>{this._addObject(e,r)}),this.norm.clear())}add(e){let r=this.size();Za(e)?this._addString(e,r):this._addObject(e,r)}removeAt(e){this.records.splice(e,1);for(let r=e,n=this.size();r<n;r+=1)this.records[r].i-=1}getValueForItemAtKeyId(e,r){return e[this._keysMap[r]]}size(){return this.records.length}_addString(e,r){if(!ks(e)||yL(e))return;let n={v:e,i:r,n:this.norm.get(e)};this.records.push(n)}_addObject(e,r){let n={i:r,$:{}};this.keys.forEach((i,s)=>{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(ks(o)){if(tc(o)){let a=[],A=[{nestedArrIndex:-1,value:o}];for(;A.length;){let{nestedArrIndex:c,value:u}=A.pop();if(ks(u))if(Za(u)&&!yL(u)){let l={v:u,i:c,n:this.norm.get(u)};a.push(l)}else tc(u)&&u.forEach((l,d)=>{A.push({nestedArrIndex:d,value:l})})}n.$[s]=a}else if(Za(o)&&!yL(o)){let a={v:o,n:this.norm.get(o)};n.$[s]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}};Qg=32;qw=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t),$w=class{constructor(e,{location:r=nt.location,threshold:n=nt.threshold,distance:i=nt.distance,includeMatches:s=nt.includeMatches,findAllMatches:o=nt.findAllMatches,minMatchCharLength:a=nt.minMatchCharLength,isCaseSensitive:A=nt.isCaseSensitive,ignoreDiacritics:c=nt.ignoreDiacritics,ignoreLocation:u=nt.ignoreLocation}={}){if(this.options={location:r,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:A,ignoreDiacritics:c,ignoreLocation:u},e=A?e:e.toLowerCase(),e=c?qw(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let l=(g,p)=>{this.chunks.push({pattern:g,alphabet:a9e(g),startIndex:p})},d=this.pattern.length;if(d>Qg){let g=0,p=d%Qg,f=d-p;for(;g<f;)l(this.pattern.substr(g,Qg),g),g+=Qg;if(p){let m=d-Qg;l(this.pattern.substr(m),m)}}else l(this.pattern,0)}searchIn(e){let{isCaseSensitive:r,ignoreDiacritics:n,includeMatches:i}=this.options;if(e=r?e:e.toLowerCase(),e=n?qw(e):e,this.pattern===e){let f={isMatch:!0,score:0};return i&&(f.indices=[[0,e.length-1]]),f}let{location:s,distance:o,threshold:a,findAllMatches:A,minMatchCharLength:c,ignoreLocation:u}=this.options,l=[],d=0,g=!1;this.chunks.forEach(({pattern:f,alphabet:m,startIndex:C})=>{let{isMatch:I,score:B,indices:E}=o9e(e,f,m,{location:s+C,distance:o,threshold:a,findAllMatches:A,minMatchCharLength:c,includeMatches:i,ignoreLocation:u});I&&(g=!0),d+=B,I&&E&&(l=[...l,...E])});let p={isMatch:g,score:g?d/this.chunks.length:1};return g&&i&&(p.indices=l),p}},eA=class{constructor(e){this.pattern=e}static isMultiMatch(e){return tse(e,this.multiRegex)}static isSingleMatch(e){return tse(e,this.singleRegex)}search(){}};wL=class extends eA{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let r=e===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}},bL=class extends eA{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}},SL=class extends eA{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let r=e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}},vL=class extends eA{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let r=!e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}},xL=class extends eA{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let r=e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},FL=class extends eA{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let r=!e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}},Vw=class extends eA{constructor(e,{location:r=nt.location,threshold:n=nt.threshold,distance:i=nt.distance,includeMatches:s=nt.includeMatches,findAllMatches:o=nt.findAllMatches,minMatchCharLength:a=nt.minMatchCharLength,isCaseSensitive:A=nt.isCaseSensitive,ignoreDiacritics:c=nt.ignoreDiacritics,ignoreLocation:u=nt.ignoreLocation}={}){super(e),this._bitapSearch=new $w(e,{location:r,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:A,ignoreDiacritics:c,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}},Ww=class extends eA{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let r=0,n,i=[],s=this.pattern.length;for(;(n=e.indexOf(this.pattern,r))>-1;)r=n+s,i.push([n,r-1]);let o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}},kL=[wL,Ww,SL,vL,FL,xL,bL,Vw],rse=kL.length,A9e=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,c9e="|";l9e=new Set([Vw.type,Ww.type]),RL=class{constructor(e,{isCaseSensitive:r=nt.isCaseSensitive,ignoreDiacritics:n=nt.ignoreDiacritics,includeMatches:i=nt.includeMatches,minMatchCharLength:s=nt.minMatchCharLength,ignoreLocation:o=nt.ignoreLocation,findAllMatches:a=nt.findAllMatches,location:A=nt.location,threshold:c=nt.threshold,distance:u=nt.distance}={}){this.query=null,this.options={isCaseSensitive:r,ignoreDiacritics:n,includeMatches:i,minMatchCharLength:s,findAllMatches:a,ignoreLocation:o,location:A,threshold:c,distance:u},e=r?e:e.toLowerCase(),e=n?qw(e):e,this.pattern=e,this.query=u9e(this.pattern,this.options)}static condition(e,r){return r.useExtendedSearch}searchIn(e){let r=this.query;if(!r)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:i,ignoreDiacritics:s}=this.options;e=i?e:e.toLowerCase(),e=s?qw(e):e;let o=0,a=[],A=0;for(let c=0,u=r.length;c<u;c+=1){let l=r[c];a.length=0,o=0;for(let d=0,g=l.length;d<g;d+=1){let p=l[d],{isMatch:f,indices:m,score:C}=p.search(e);if(f){if(o+=1,A+=C,n){let I=p.constructor.type;l9e.has(I)?a=[...a,...m]:a.push(m)}}else{A=0,o=0,a.length=0;break}}if(o){let d={isMatch:!0,score:A/o};return n&&(d.indices=a),d}}return{isMatch:!1,score:1}}},NL=[];zw={AND:"$and",OR:"$or"},ML={PATH:"$path",PATTERN:"$val"},PL=t=>!!(t[zw.AND]||t[zw.OR]),p9e=t=>!!t[ML.PATH],d9e=t=>!tc(t)&&sse(t)&&!PL(t),nse=t=>({[zw.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});rc=class{constructor(e,r={},n){this.options={...nt,...r},this.options.useExtendedSearch,this._keyStore=new QL(this.options.keys),this.setCollection(e,n)}setCollection(e,r){if(this._docs=e,r&&!(r instanceof XC))throw new Error(jJe);this._myIndex=r||Ase(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){ks(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let r=[];for(let n=0,i=this._docs.length;n<i;n+=1){let s=this._docs[n];e(s,n)&&(this.removeAt(n),n-=1,i-=1,r.push(s))}return r}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:r=-1}={}){let{includeMatches:n,includeScore:i,shouldSort:s,sortFn:o,ignoreFieldNorm:a}=this.options,A=Za(e)?Za(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return f9e(A,{ignoreFieldNorm:a}),s&&A.sort(o),ise(r)&&r>-1&&(A=A.slice(0,r)),C9e(A,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(e){let r=TL(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:s,i:o,n:a})=>{if(!ks(s))return;let{isMatch:A,score:c,indices:u}=r.searchIn(s);A&&i.push({item:s,idx:o,matches:[{score:c,value:s,norm:a,indices:u}]})}),i}_searchLogical(e){let r=cse(e,this.options),n=(a,A,c)=>{if(!a.children){let{keyId:l,searcher:d}=a,g=this._findMatches({key:this._keyStore.get(l),value:this._myIndex.getValueForItemAtKeyId(A,l),searcher:d});return g&&g.length?[{idx:c,item:A,matches:g}]:[]}let u=[];for(let l=0,d=a.children.length;l<d;l+=1){let g=a.children[l],p=n(g,A,c);if(p.length)u.push(...p);else if(a.operator===zw.AND)return[]}return u},i=this._myIndex.records,s={},o=[];return i.forEach(({$:a,i:A})=>{if(ks(a)){let c=n(r,a,A);c.length&&(s[A]||(s[A]={idx:A,item:a,matches:[]},o.push(s[A])),c.forEach(({matches:u})=>{s[A].matches.push(...u)}))}}),o}_searchObjectList(e){let r=TL(e,this.options),{keys:n,records:i}=this._myIndex,s=[];return i.forEach(({$:o,i:a})=>{if(!ks(o))return;let A=[];n.forEach((c,u)=>{A.push(...this._findMatches({key:c,value:o[u],searcher:r}))}),A.length&&s.push({idx:a,item:o,matches:A})}),s}_findMatches({key:e,value:r,searcher:n}){if(!ks(r))return[];let i=[];if(tc(r))r.forEach(({v:s,i:o,n:a})=>{if(!ks(s))return;let{isMatch:A,score:c,indices:u}=n.searchIn(s);A&&i.push({score:c,key:e,value:s,idx:o,norm:a,indices:u})});else{let{v:s,n:o}=r,{isMatch:a,score:A,indices:c}=n.searchIn(s);a&&i.push({score:A,key:e,value:s,norm:o,indices:c})}return i}};rc.version="7.1.0";rc.createIndex=Ase;rc.parseIndex=i9e;rc.config=nt;rc.parseQuery=cse;g9e(RL)});function E9e(t){return(0,lse.createHash)("sha256").update(t).digest("hex").slice(0,16)}function B9e(t){return t.join(gse.default.homedir(),".builder","history")}function pse(t,e){return t.join(B9e(t),`${E9e(e)}.json`)}async function LL(t,e){let r=pse(t,e);try{let n=await t.readFile(r);return n?JSON.parse(n):[]}catch{return[]}}async function dse(t,e,r){let n=pse(t,e);await t.writeFile(n,JSON.stringify(r,null,2))}async function fse(t,e,r,n){let i=await LL(t,e),s=i.findIndex(a=>a.sessionId===r),o=Date.now();s!==-1?i[s].lastActiveAt=o:i.unshift({sessionId:r,title:n,createdAt:o,lastActiveAt:o}),await dse(t,e,i.slice(0,I9e))}async function _L(t,e,r){let n=await LL(t,e),i=n.find(s=>s.sessionId===r);i&&(i.lastActiveAt=Date.now(),await dse(t,e,n))}async function Xw(t,e){return LL(t,e)}function hse(t){let r=t.replace(/<[^>]*>/g,"").trim().split(`
|
|
1749
|
-
`)[0].trim();return r.length>80?r.slice(0,77)+"...":r}var lse,gse,
|
|
1748
|
+
`)}catch(r){this.#s&&WC.warn("Failed to append state entry",r)}}#W(){this.#v||((0,Bn.mkdirSync)(this.#c,{recursive:!0}),this.#v=!0)}getHighlightFrames(){if(this.#i.length===0)return[];let e=new Set;e.add(0),e.add(this.#i.length-1);for(let s=0;s<this.#i.length;s++)this.#i[s].explicit&&e.add(s);let r=new Set(this.#A.filter(s=>s.category==="navigation"&&s.frameIndex!=null).map(s=>s.frameIndex));for(let s=0;s<this.#i.length;s++)s>0&&r.has(s-1)&&e.add(s),r.has(s)&&e.add(s);for(let s of this.#A)s.frameIndex!=null&&(s.category==="milestone"||s.category==="assertion"||s.category==="error")&&e.add(s.frameIndex);let n=[...e].sort((s,o)=>s-o);n=n.filter((s,o)=>o===0||this.#i[s].title!==this.#i[n[o-1]].title);let i=15;if(n.length>i){let s=n[0],o=n[n.length-1],a=n.slice(1,-1),A=a.length/(i-2),c=[s];for(let u=0;u<i-2;u++)c.push(a[Math.round(u*A)]);c.push(o),n=c}return n.map(s=>this.#i[s])}getHighlightImages(){return this.getHighlightFrames().map(e=>e.image)}getHighlightMetadataFrames(){return this.getHighlightFrames().map(e=>({hasImage:!0,title:e.title}))}getHighlightFrameDurations(){let e=this.getHighlightFrames();if(e.length<=1)return[];let r=[];for(let n=0;n<e.length;n++)if(n<e.length-1){let i=e[n+1].timestamp-e[n].timestamp,s=Math.min(EL,Math.max(IL,i));r.push((s/1e3).toFixed(2))}else r.push((BL/1e3).toFixed(2));return r}async cleanupSessionFiles(){let e=this.#c;try{let n=(await Bn.promises.readdir(e)).filter(s=>s.startsWith(this.#n)),i=0;for(let s of n)try{await Bn.promises.unlink((0,Jw.join)(e,s)),i++}catch{}i>0&&WC.info(`Cleaned up ${i} local files for session ${this.#n}`)}catch{}}async finalize(){let e=this.#i.map(s=>s.uploadPromise).filter(Boolean);if(e.length>0){let s=new Promise(o=>setTimeout(o,3e4));await Promise.race([Promise.allSettled(e),s])}let r=Date.now(),n=this.#i.map((s,o)=>{let a=BL;if(o<this.#i.length-1){let A=this.#i[o+1].timestamp-s.timestamp;a=Math.min(EL,Math.max(IL,A))}return{index:o,timestamp:s.timestamp,title:s.title,category:s.category,eventId:s.eventId,explicit:s.explicit,displayDurationMs:a,fileName:s.fileName,image_url:s.imageUrl,cursorX:s.cursorX,cursorY:s.cursorY,viewportWidth:s.viewportWidth,viewportHeight:s.viewportHeight}}),i={version:1,sessionId:this.#n,startTime:this.#M,endTime:r,totalFrames:n.length,events:this.#A,frames:n,...this.#a.length>0&&{phases:this.#a}};return this.#t&&this.#i.length>0&&this.#i.every(s=>!!s.imageUrl)&&this.cleanupSessionFiles().catch(()=>{}),i}#w(e){let r={id:this.#B++,...e};return this.#A.push(r),r}#J(e,r,n,i,s,o,a){let A=this.#w({label:r,category:n,frameIndex:this.#h,durationMs:s,description:o,timestamp:Date.now()}),c=this.#P(e),u=`${this.#n}-frame-${String(this.#h).padStart(5,"0")}.${c}`,l={image:e,title:r,category:n,eventId:A.id,explicit:i,timestamp:Date.now(),fileName:u,cursorX:a?.x,cursorY:a?.y,viewportWidth:a?.viewportWidth,viewportHeight:a?.viewportHeight};if(this.#i.push(l),this.#h++,this.#R(e,u).catch(()=>{}),this.#t&&e.source.type==="base64"){let d=`${this.#n}-frame-${String(this.#h-1).padStart(5,"0")}`;l.uploadPromise=Wie(e.source.data,e.source.media_type,d).then(g=>{g&&(l.imageUrl=g),this.#e&&this.#e.recordCheckpoint(l.timestamp,l.title,l.imageUrl)})}}async#R(e,r){try{this.#v||(await Bn.promises.mkdir(this.#c,{recursive:!0}),this.#v=!0);let n=(0,Jw.join)(this.#c,r);if(e.source.type==="base64"){let i=Buffer.from(e.source.data,"base64");await Bn.promises.writeFile(n,new Uint8Array(i)),this.#s&&WC.info(`Saved frame: ${r}`)}}catch(n){this.#s&&WC.warn(`Failed to save frame: ${r}`,n)}}#P(e){if(e.source.type!=="base64")return"webp";switch(e.source.media_type){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/gif":return"gif";default:return"webp"}}}});function pn(t){return t.replace(/\\/g,"/").replace(/^\.\//,"")}var Yw=L(()=>{"use strict";h()});function tc(t){return Array.isArray?Array.isArray(t):ose(t)==="[object Array]"}function KJe(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-OJe?"-0":e}function HJe(t){return t==null?"":KJe(t)}function Za(t){return typeof t=="string"}function ise(t){return typeof t=="number"}function JJe(t){return t===!0||t===!1||YJe(t)&&ose(t)=="[object Boolean]"}function sse(t){return typeof t=="object"}function YJe(t){return sse(t)&&t!==null}function ks(t){return t!=null}function yL(t){return!t.trim().length}function ose(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ase(t){let e=null,r=null,n=null,i=1,s=null;if(Za(t)||tc(t))n=t,e=ese(t),r=DL(t);else{if(!Zie.call(t,"name"))throw new Error(VJe("name"));let o=t.name;if(n=o,Zie.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(WJe(o));e=ese(o),r=DL(o),s=t.getFn}return{path:e,id:r,weight:i,src:n,getFn:s}}function ese(t){return tc(t)?t:t.split(".")}function DL(t){return tc(t)?t.join("."):t}function zJe(t,e){let r=[],n=!1,i=(s,o,a)=>{if(ks(s))if(!o[a])r.push(s);else{let A=o[a],c=s[A];if(!ks(c))return;if(a===o.length-1&&(Za(c)||ise(c)||JJe(c)))r.push(HJe(c));else if(tc(c)){n=!0;for(let u=0,l=c.length;u<l;u+=1)i(c[u],o,a+1)}else o.length&&i(c,o,a+1)}};return i(t,Za(e)?e.split("."):e,0),n?r:r[0]}function nYe(t=1,e=3){let r=new Map,n=Math.pow(10,e);return{get(i){let s=i.match(rYe).length;if(r.has(s))return r.get(s);let o=1/Math.pow(s,.5*t),a=parseFloat(Math.round(o*n)/n);return r.set(s,a),a},clear(){r.clear()}}}function Ase(t,e,{getFn:r=nt.getFn,fieldNormWeight:n=nt.fieldNormWeight}={}){let i=new XC({getFn:r,fieldNormWeight:n});return i.setKeys(t.map(ase)),i.setSources(e),i.create(),i}function iYe(t,{getFn:e=nt.getFn,fieldNormWeight:r=nt.fieldNormWeight}={}){let{keys:n,records:i}=t,s=new XC({getFn:e,fieldNormWeight:r});return s.setKeys(n),s.setIndexRecords(i),s}function jw(t,{errors:e=0,currentLocation:r=0,expectedLocation:n=0,distance:i=nt.distance,ignoreLocation:s=nt.ignoreLocation}={}){let o=e/t.length;if(s)return o;let a=Math.abs(n-r);return i?o+a/i:a?1:o}function sYe(t=[],e=nt.minMatchCharLength){let r=[],n=-1,i=-1,s=0;for(let o=t.length;s<o;s+=1){let a=t[s];a&&n===-1?n=s:!a&&n!==-1&&(i=s-1,i-n+1>=e&&r.push([n,i]),n=-1)}return t[s-1]&&s-n>=e&&r.push([n,s-1]),r}function oYe(t,e,r,{location:n=nt.location,distance:i=nt.distance,threshold:s=nt.threshold,findAllMatches:o=nt.findAllMatches,minMatchCharLength:a=nt.minMatchCharLength,includeMatches:A=nt.includeMatches,ignoreLocation:c=nt.ignoreLocation}={}){if(e.length>Qg)throw new Error($Je(Qg));let u=e.length,l=t.length,d=Math.max(0,Math.min(n,l)),g=s,p=d,f=a>1||A,m=f?Array(l):[],C;for(;(C=t.indexOf(e,p))>-1;){let w=jw(e,{currentLocation:C,expectedLocation:d,distance:i,ignoreLocation:c});if(g=Math.min(w,g),p=C+u,f){let D=0;for(;D<u;)m[C+D]=1,D+=1}}p=-1;let I=[],B=1,E=u+l,y=1<<u-1;for(let w=0;w<u;w+=1){let D=0,x=E;for(;D<x;)jw(e,{errors:w,currentLocation:d+x,expectedLocation:d,distance:i,ignoreLocation:c})<=g?D=x:E=x,x=Math.floor((E-D)/2+D);E=x;let S=Math.max(1,d-x+1),v=o?l:Math.min(d+x,l)+u,P=Array(v+2);P[v+1]=(1<<w)-1;for(let H=v;H>=S;H-=1){let M=H-1,G=r[t.charAt(M)];if(f&&(m[M]=+!!G),P[H]=(P[H+1]<<1|1)&G,w&&(P[H]|=(I[H+1]|I[H])<<1|1|I[H+1]),P[H]&y&&(B=jw(e,{errors:w,currentLocation:M,expectedLocation:d,distance:i,ignoreLocation:c}),B<=g)){if(g=B,p=M,p<=d)break;S=Math.max(1,2*d-p)}}if(jw(e,{errors:w+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:c})>g)break;I=P}let Q={isMatch:p>=0,score:Math.max(.001,B)};if(f){let w=sYe(m,a);w.length?A&&(Q.indices=w):Q.isMatch=!1}return Q}function aYe(t){let e={};for(let r=0,n=t.length;r<n;r+=1){let i=t.charAt(r);e[i]=(e[i]||0)|1<<n-r-1}return e}function tse(t,e){let r=t.match(e);return r?r[1]:null}function uYe(t,e={}){return t.split(cYe).map(r=>{let n=r.trim().split(AYe).filter(s=>s&&!!s.trim()),i=[];for(let s=0,o=n.length;s<o;s+=1){let a=n[s],A=!1,c=-1;for(;!A&&++c<rse;){let u=kL[c],l=u.isMultiMatch(a);l&&(i.push(new u(l,e)),A=!0)}if(!A)for(c=-1;++c<rse;){let u=kL[c],l=u.isSingleMatch(a);if(l){i.push(new u(l,e));break}}}return i})}function gYe(...t){NL.push(...t)}function TL(t,e){for(let r=0,n=NL.length;r<n;r+=1){let i=NL[r];if(i.condition(t,e))return new i(t,e)}return new $w(t,e)}function cse(t,e,{auto:r=!0}={}){let n=i=>{let s=Object.keys(i),o=pYe(i);if(!o&&s.length>1&&!PL(i))return n(nse(i));if(dYe(i)){let A=o?i[ML.PATH]:s[0],c=o?i[ML.PATTERN]:i[A];if(!Za(c))throw new Error(qJe(A));let u={keyId:DL(A),pattern:c};return r&&(u.searcher=TL(c,e)),u}let a={children:[],operator:s[0]};return s.forEach(A=>{let c=i[A];tc(c)&&c.forEach(u=>{a.children.push(n(u))})}),a};return PL(t)||(t=nse(t)),n(t)}function fYe(t,{ignoreFieldNorm:e=nt.ignoreFieldNorm}){t.forEach(r=>{let n=1;r.matches.forEach(({key:i,norm:s,score:o})=>{let a=i?i.weight:null;n*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:s))}),r.score=n})}function hYe(t,e){let r=t.matches;e.matches=[],ks(r)&&r.forEach(n=>{if(!ks(n.indices)||!n.indices.length)return;let{indices:i,value:s}=n,o={indices:i,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),e.matches.push(o)})}function mYe(t,e){e.score=t.score}function CYe(t,e,{includeMatches:r=nt.includeMatches,includeScore:n=nt.includeScore}={}){let i=[];return r&&i.push(hYe),n&&i.push(mYe),t.map(s=>{let{idx:o}=s,a={item:e[o],refIndex:o};return i.length&&i.forEach(A=>{A(s,a)}),a})}var OJe,jJe,qJe,$Je,VJe,WJe,Zie,QL,XJe,ZJe,eYe,tYe,nt,rYe,XC,Qg,qw,$w,eA,wL,bL,SL,vL,xL,FL,Vw,Ww,kL,rse,AYe,cYe,lYe,RL,NL,zw,ML,PL,pYe,dYe,nse,rc,use=L(()=>{h();OJe=1/0;jJe="Incorrect 'index' type",qJe=t=>`Invalid value for key ${t}`,$Je=t=>`Pattern length exceeds max of ${t}.`,VJe=t=>`Missing ${t} property in key`,WJe=t=>`Property 'weight' in key '${t}' must be a positive integer`,Zie=Object.prototype.hasOwnProperty,QL=class{constructor(e){this._keys=[],this._keyMap={};let r=0;e.forEach(n=>{let i=ase(n);this._keys.push(i),this._keyMap[i.id]=i,r+=i.weight}),this._keys.forEach(n=>{n.weight/=r})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};XJe={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},ZJe={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},eYe={location:0,threshold:.6,distance:100},tYe={useExtendedSearch:!1,getFn:zJe,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},nt={...ZJe,...XJe,...eYe,...tYe},rYe=/[^ ]+/g;XC=class{constructor({getFn:e=nt.getFn,fieldNormWeight:r=nt.fieldNormWeight}={}){this.norm=nYe(r,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((r,n)=>{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Za(this.docs[0])?this.docs.forEach((e,r)=>{this._addString(e,r)}):this.docs.forEach((e,r)=>{this._addObject(e,r)}),this.norm.clear())}add(e){let r=this.size();Za(e)?this._addString(e,r):this._addObject(e,r)}removeAt(e){this.records.splice(e,1);for(let r=e,n=this.size();r<n;r+=1)this.records[r].i-=1}getValueForItemAtKeyId(e,r){return e[this._keysMap[r]]}size(){return this.records.length}_addString(e,r){if(!ks(e)||yL(e))return;let n={v:e,i:r,n:this.norm.get(e)};this.records.push(n)}_addObject(e,r){let n={i:r,$:{}};this.keys.forEach((i,s)=>{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(ks(o)){if(tc(o)){let a=[],A=[{nestedArrIndex:-1,value:o}];for(;A.length;){let{nestedArrIndex:c,value:u}=A.pop();if(ks(u))if(Za(u)&&!yL(u)){let l={v:u,i:c,n:this.norm.get(u)};a.push(l)}else tc(u)&&u.forEach((l,d)=>{A.push({nestedArrIndex:d,value:l})})}n.$[s]=a}else if(Za(o)&&!yL(o)){let a={v:o,n:this.norm.get(o)};n.$[s]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}};Qg=32;qw=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t),$w=class{constructor(e,{location:r=nt.location,threshold:n=nt.threshold,distance:i=nt.distance,includeMatches:s=nt.includeMatches,findAllMatches:o=nt.findAllMatches,minMatchCharLength:a=nt.minMatchCharLength,isCaseSensitive:A=nt.isCaseSensitive,ignoreDiacritics:c=nt.ignoreDiacritics,ignoreLocation:u=nt.ignoreLocation}={}){if(this.options={location:r,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:A,ignoreDiacritics:c,ignoreLocation:u},e=A?e:e.toLowerCase(),e=c?qw(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let l=(g,p)=>{this.chunks.push({pattern:g,alphabet:aYe(g),startIndex:p})},d=this.pattern.length;if(d>Qg){let g=0,p=d%Qg,f=d-p;for(;g<f;)l(this.pattern.substr(g,Qg),g),g+=Qg;if(p){let m=d-Qg;l(this.pattern.substr(m),m)}}else l(this.pattern,0)}searchIn(e){let{isCaseSensitive:r,ignoreDiacritics:n,includeMatches:i}=this.options;if(e=r?e:e.toLowerCase(),e=n?qw(e):e,this.pattern===e){let f={isMatch:!0,score:0};return i&&(f.indices=[[0,e.length-1]]),f}let{location:s,distance:o,threshold:a,findAllMatches:A,minMatchCharLength:c,ignoreLocation:u}=this.options,l=[],d=0,g=!1;this.chunks.forEach(({pattern:f,alphabet:m,startIndex:C})=>{let{isMatch:I,score:B,indices:E}=oYe(e,f,m,{location:s+C,distance:o,threshold:a,findAllMatches:A,minMatchCharLength:c,includeMatches:i,ignoreLocation:u});I&&(g=!0),d+=B,I&&E&&(l=[...l,...E])});let p={isMatch:g,score:g?d/this.chunks.length:1};return g&&i&&(p.indices=l),p}},eA=class{constructor(e){this.pattern=e}static isMultiMatch(e){return tse(e,this.multiRegex)}static isSingleMatch(e){return tse(e,this.singleRegex)}search(){}};wL=class extends eA{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let r=e===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}},bL=class extends eA{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}},SL=class extends eA{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let r=e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}},vL=class extends eA{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let r=!e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}},xL=class extends eA{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let r=e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},FL=class extends eA{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let r=!e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}},Vw=class extends eA{constructor(e,{location:r=nt.location,threshold:n=nt.threshold,distance:i=nt.distance,includeMatches:s=nt.includeMatches,findAllMatches:o=nt.findAllMatches,minMatchCharLength:a=nt.minMatchCharLength,isCaseSensitive:A=nt.isCaseSensitive,ignoreDiacritics:c=nt.ignoreDiacritics,ignoreLocation:u=nt.ignoreLocation}={}){super(e),this._bitapSearch=new $w(e,{location:r,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:A,ignoreDiacritics:c,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}},Ww=class extends eA{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let r=0,n,i=[],s=this.pattern.length;for(;(n=e.indexOf(this.pattern,r))>-1;)r=n+s,i.push([n,r-1]);let o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}},kL=[wL,Ww,SL,vL,FL,xL,bL,Vw],rse=kL.length,AYe=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,cYe="|";lYe=new Set([Vw.type,Ww.type]),RL=class{constructor(e,{isCaseSensitive:r=nt.isCaseSensitive,ignoreDiacritics:n=nt.ignoreDiacritics,includeMatches:i=nt.includeMatches,minMatchCharLength:s=nt.minMatchCharLength,ignoreLocation:o=nt.ignoreLocation,findAllMatches:a=nt.findAllMatches,location:A=nt.location,threshold:c=nt.threshold,distance:u=nt.distance}={}){this.query=null,this.options={isCaseSensitive:r,ignoreDiacritics:n,includeMatches:i,minMatchCharLength:s,findAllMatches:a,ignoreLocation:o,location:A,threshold:c,distance:u},e=r?e:e.toLowerCase(),e=n?qw(e):e,this.pattern=e,this.query=uYe(this.pattern,this.options)}static condition(e,r){return r.useExtendedSearch}searchIn(e){let r=this.query;if(!r)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:i,ignoreDiacritics:s}=this.options;e=i?e:e.toLowerCase(),e=s?qw(e):e;let o=0,a=[],A=0;for(let c=0,u=r.length;c<u;c+=1){let l=r[c];a.length=0,o=0;for(let d=0,g=l.length;d<g;d+=1){let p=l[d],{isMatch:f,indices:m,score:C}=p.search(e);if(f){if(o+=1,A+=C,n){let I=p.constructor.type;lYe.has(I)?a=[...a,...m]:a.push(m)}}else{A=0,o=0,a.length=0;break}}if(o){let d={isMatch:!0,score:A/o};return n&&(d.indices=a),d}}return{isMatch:!1,score:1}}},NL=[];zw={AND:"$and",OR:"$or"},ML={PATH:"$path",PATTERN:"$val"},PL=t=>!!(t[zw.AND]||t[zw.OR]),pYe=t=>!!t[ML.PATH],dYe=t=>!tc(t)&&sse(t)&&!PL(t),nse=t=>({[zw.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});rc=class{constructor(e,r={},n){this.options={...nt,...r},this.options.useExtendedSearch,this._keyStore=new QL(this.options.keys),this.setCollection(e,n)}setCollection(e,r){if(this._docs=e,r&&!(r instanceof XC))throw new Error(jJe);this._myIndex=r||Ase(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){ks(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let r=[];for(let n=0,i=this._docs.length;n<i;n+=1){let s=this._docs[n];e(s,n)&&(this.removeAt(n),n-=1,i-=1,r.push(s))}return r}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:r=-1}={}){let{includeMatches:n,includeScore:i,shouldSort:s,sortFn:o,ignoreFieldNorm:a}=this.options,A=Za(e)?Za(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return fYe(A,{ignoreFieldNorm:a}),s&&A.sort(o),ise(r)&&r>-1&&(A=A.slice(0,r)),CYe(A,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(e){let r=TL(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:s,i:o,n:a})=>{if(!ks(s))return;let{isMatch:A,score:c,indices:u}=r.searchIn(s);A&&i.push({item:s,idx:o,matches:[{score:c,value:s,norm:a,indices:u}]})}),i}_searchLogical(e){let r=cse(e,this.options),n=(a,A,c)=>{if(!a.children){let{keyId:l,searcher:d}=a,g=this._findMatches({key:this._keyStore.get(l),value:this._myIndex.getValueForItemAtKeyId(A,l),searcher:d});return g&&g.length?[{idx:c,item:A,matches:g}]:[]}let u=[];for(let l=0,d=a.children.length;l<d;l+=1){let g=a.children[l],p=n(g,A,c);if(p.length)u.push(...p);else if(a.operator===zw.AND)return[]}return u},i=this._myIndex.records,s={},o=[];return i.forEach(({$:a,i:A})=>{if(ks(a)){let c=n(r,a,A);c.length&&(s[A]||(s[A]={idx:A,item:a,matches:[]},o.push(s[A])),c.forEach(({matches:u})=>{s[A].matches.push(...u)}))}}),o}_searchObjectList(e){let r=TL(e,this.options),{keys:n,records:i}=this._myIndex,s=[];return i.forEach(({$:o,i:a})=>{if(!ks(o))return;let A=[];n.forEach((c,u)=>{A.push(...this._findMatches({key:c,value:o[u],searcher:r}))}),A.length&&s.push({idx:a,item:o,matches:A})}),s}_findMatches({key:e,value:r,searcher:n}){if(!ks(r))return[];let i=[];if(tc(r))r.forEach(({v:s,i:o,n:a})=>{if(!ks(s))return;let{isMatch:A,score:c,indices:u}=n.searchIn(s);A&&i.push({score:c,key:e,value:s,idx:o,norm:a,indices:u})});else{let{v:s,n:o}=r,{isMatch:a,score:A,indices:c}=n.searchIn(s);a&&i.push({score:A,key:e,value:s,norm:o,indices:c})}return i}};rc.version="7.1.0";rc.createIndex=Ase;rc.parseIndex=iYe;rc.config=nt;rc.parseQuery=cse;gYe(RL)});function EYe(t){return(0,lse.createHash)("sha256").update(t).digest("hex").slice(0,16)}function BYe(t){return t.join(gse.default.homedir(),".builder","history")}function pse(t,e){return t.join(BYe(t),`${EYe(e)}.json`)}async function LL(t,e){let r=pse(t,e);try{let n=await t.readFile(r);return n?JSON.parse(n):[]}catch{return[]}}async function dse(t,e,r){let n=pse(t,e);await t.writeFile(n,JSON.stringify(r,null,2))}async function fse(t,e,r,n){let i=await LL(t,e),s=i.findIndex(a=>a.sessionId===r),o=Date.now();s!==-1?i[s].lastActiveAt=o:i.unshift({sessionId:r,title:n,createdAt:o,lastActiveAt:o}),await dse(t,e,i.slice(0,IYe))}async function _L(t,e,r){let n=await LL(t,e),i=n.find(s=>s.sessionId===r);i&&(i.lastActiveAt=Date.now(),await dse(t,e,n))}async function Xw(t,e){return LL(t,e)}function hse(t){let r=t.replace(/<[^>]*>/g,"").trim().split(`
|
|
1749
|
+
`)[0].trim();return r.length>80?r.slice(0,77)+"...":r}var lse,gse,IYe,UL=L(()=>{"use strict";h();lse=require("node:crypto"),gse=z(require("node:os"),1),IYe=50});function mse(t,e){t||(t="http://localhost:3000");let r=yYe(e);return`
|
|
1750
1750
|
|
|
1751
1751
|
<browser_automation_instructions>
|
|
1752
1752
|
Once all code changes are done, before calling success, use \`Agent("browser-test-planner", context)\` to verify your changes work in a real browser.
|
|
@@ -1790,22 +1790,22 @@ ${r}
|
|
|
1790
1790
|
|
|
1791
1791
|
**The planner resets any code changes after testing, so temporary modifications are safe.**
|
|
1792
1792
|
Make sure to plan for testing and account for that when using the TodoWrite tool.
|
|
1793
|
-
</browser_automation_instructions>`}function
|
|
1793
|
+
</browser_automation_instructions>`}function yYe(t){return t?`
|
|
1794
1794
|
IMPORTANT - Scope of browser testing: Only run browser automation tests when changes are inside the recommended project root: \`${t}\`
|
|
1795
1795
|
Changes outside this path (e.g., Docker files, CI/CD configs, monorepo root configs, unrelated packages) have no visual impact and do NOT require browser testing.
|
|
1796
1796
|
Before scheduling browser tests, check whether the modified files are inside \`${t}\`. If all changes are outside this path, skip browser testing entirely.
|
|
1797
|
-
`:""}var Cse=L(()=>{"use strict";h()});function
|
|
1798
|
-
`):[]}catch{return[]}}let Q=u;if(!a)throw new Error("Workspace is required for backup upload");if(await I())if(l)Cr.debug("There is an merge conflict, when attempting to backup, let's try to abort the merge"),await f(["merge","--abort"]);else throw new Error("Merge conflict detected, please resolve the conflict before continuing");await nc(i,t)||(Cr.debug("Uncommitted changes detected, staging and committing before backup"),await f(["add","-A","."]),await f(["commit","--quiet","--no-verify","-m","commit pending changes"]));let D=(d?a.folders.find(M=>(M.name??M.path)===d):a.folders.find(M=>M.enableGit))?.originalRepoUrl??g;if(!D)throw new Error("Original repo URL is required for backup upload");let x=u?"offline-full":A?void 0:"offline",S=await E();if(!S){let M=null;try{let G=await f(["rev-list","--all","--count"]);M=parseInt(G.trim(),10)}catch{}if(M===0){Cr.info("Repository has no commits (empty repo) \u2014 nothing to back up");let G={projectId:r,branchName:n,size:0,partial:!0,initialBranch:o,initialCommitHash:void 0,lastCommitHash:"",gitBranchName:s,empty:!0,status:"completed",version:"v2",repoUrl:D,forced:x,...d&&{folderName:d}};return{success:!0,empty:!0,lastCommitHash:"",partial:!0,repoUrl:D,backupRef:void 0,backupEntry:G}}throw new Error(M===null?"Failed to get current commit hash (git rev-list failed)":`Failed to get current commit hash (rev-list --all --count returned ${M})`)}let v=await m();if(!Q&&v!==s)throw new Error(`Current branch "${v}" is not the ai branch "${s}"`);let P=await D9e({sys:t,repoPath:i,featureBranch:o,debug:c,workspace:a,isConnectedToProvider:A,forcedFullBackup:u,credentials:e,projectId:r,folderName:d}),$=await y(P.initialBranch,10),H=await y(s,10);try{if(P.partial&&(P.initialCommitHash===S||await C(S,P.initialBranch))){Cr.debug(`No commits to backup. ${S}`);let X={projectId:r,branchName:n,size:0,partial:P.partial,initialBranch:P.initialBranch,initialCommitHash:P.initialCommitHash,lastCommitHash:S,gitBranchName:s,empty:!0,status:"completed",version:"v2",repoUrl:D,forced:x,...d&&{folderName:d},metadata:{initialCommitMeta:await B(P.initialCommitHash),lastCommitMeta:await B(S),rangeInRemote:$,rangeInLocal:H}};return{success:!0,empty:!0,lastCommitHash:S,partial:P.partial,repoUrl:D,backupRef:ZC({version:"v2",originalRepoUrl:D,commitHash:S}),backupEntry:X}}Cr.debug("Creating git bundle...");let M=Date.now(),G=Math.random().toString(36).substring(2,8),Y=`backup-${M}-${G}.bundle`,J="/tmp",O=t.join(J,Y);wu.default.mkdirSync(J,{recursive:!0}),await f(["bundle","create","--quiet",O,...P.partial?[`${P.initialCommitHash}..${s}`]:["--branches","--tags"]]),Cr.debug("Computing MD5 hash of bundle file...");let{contentMd5:U,size:K}=await S9e(O);Cr.debug("Verify bundle file integrity"),await f(["bundle","verify","--quiet",O]),Cr.debug(`Requesting signed upload URL for size: ${K} bytes`);let ne=await w9e(e,{projectId:r,branchName:n,size:K,partial:P.partial,contentMd5:U,...d&&{folderName:d},...g&&{repoUrl:g}},c);if(!ne)return Cr.info("Project/branch was removed, it's okay to skip backup"),{success:!1,reason:"project_removed"};let{signedUrl:ge}=ne;Cr.debug(`Uploading to URL: ${ge}`),await b9e(O,ge,K,U),Cr.debug("Uploaded successfully");let me={projectId:r,branchName:n,size:K,partial:P.partial,initialBranch:P.initialBranch,initialCommitHash:P.initialCommitHash,lastCommitHash:S,gitBranchName:s,empty:!1,status:"completed",contentMd5:U,version:"v2",repoUrl:D,forced:x,...d&&{folderName:d},metadata:{initialCommitMeta:await B(P.initialCommitHash),lastCommitMeta:await B(S),rangeInRemote:$,rangeInLocal:H}};try{wu.default.unlinkSync(O)}catch(Ae){t.Sentry?.captureException(Ae,{level:"warning",tags:{operation:"codegen-backup"}})}return Cr.debug("Everything is done"),{success:!0,empty:!1,lastCommitHash:S,partial:P.partial,repoUrl:D,backupRef:ZC({version:"v2",originalRepoUrl:D,commitHash:S}),backupEntry:me}}catch(M){let G=performance.now()-p,Y=M instanceof Error?M.message:String(M);try{await Bse(e,{elapsedTime:G,error:Y,backups:[]},c)}catch(J){Cr.error("Failed to record backup failure",J)}throw M}}async function D9e({sys:t,repoPath:e,featureBranch:r,debug:n,workspace:i,isConnectedToProvider:s,forcedFullBackup:o,credentials:a,projectId:A,folderName:c}){async function u(Q){return ea("git",Q,{cwd:e,sys:t})}async function l(Q){try{return(await u(["rev-parse",Q||"HEAD"])).trim()}catch{return null}}async function d(Q){try{return await u(["remote","get-url",Q]),!0}catch{return!1}}async function g(){try{let w=(await u(["remote","show","origin"])).match(/HEAD branch: (.+)/);if(w){let D=w[1].trim();if(D)return D}return null}catch(Q){let w=new Error("failed to get default remote branch",{cause:Q});throw t.Sentry?.captureException(w,{tags:{operation:"codegen-backup"}}),w}}async function p(Q){let w;try{w=(await u(["remote","get-url","origin"])).trim()}catch{}w!==Q&&(w?await u(["remote","set-url","origin",Q]):await u(["remote","add","origin",Q]))}let f=async()=>{if(i?.folders.length){let w=c?i.folders.find(D=>(D.name??D.path)===c):i.folders.find(D=>D.enableGit);if(!w?.repoName)throw new Error("Git workspace not found");return!RC.includes(w.repoName)}return!!await d("origin")};async function m(){let Q=!1;try{if(i?.folders?.length){let w=c?i.folders.find(D=>(D.name??D.path)===c):i.folders.find(D=>D.enableGit);if(w?.repoName&&A){let D=await of(a,A,n);if(D.success){let x=D.gitConfigs?.[w.repoName];x?.url?(Cr.info(`Refreshing origin remote URL to ${x.url}`),await p(x.url)):(Cr.warn("Config URL was not returned for repo",w.repoName),Q=!0)}else Cr.warn("Failed to fetch git configs",D.error instanceof Error?D.error.message:String(D.error)),Q=!0}}}catch(w){Cr.warn("Failed to refresh remote origin URL",w instanceof Error?w.message:String(w)),Q=!0}return Q}if(o){let Q=await l(r);return{initialBranch:r,initialCommitHash:Q??void 0,partial:!1,forcedFullBackup:o}}let C=await f();if(C){if(!s){Cr.info("Performing offline backup. Not attempting to fetch origin remote.");let Q=await l(r);if(!Q)throw new Error("Failed to get initial commit hash");return{initialBranch:r,initialCommitHash:Q,partial:C,forcedFullBackup:o}}}else{Cr.debug("No origin remote found. Partial backups are not supported.");let Q=await l(r);if(!Q)throw new Error("Failed to get initial commit hash");return{initialBranch:r,initialCommitHash:Q,partial:!1,forcedFullBackup:o}}Cr.debug("Re-fetching all branches");let I=await m();await u(["fetch","origin"]);let B=await g();if(!B)throw new Error("Failed to get default remote branch");if(B==="(unknown)"){Cr.info("Origin default branch is (unknown); performing full backup.");let Q=await l(r);if(!Q)throw new Error("Failed to get initial commit hash");return{initialBranch:r,initialCommitHash:Q,partial:!1,forcedFullBackup:o,tokenRefreshFailed:I}}let E=`refs/remotes/origin/${B}`,y=await l(E);if(!y)throw new Error("Failed to get initial commit hash");return{initialBranch:E,initialCommitHash:y,partial:C,forcedFullBackup:o,tokenRefreshFailed:I}}async function w9e(t,e,r){let n=new URL(`${ke}/projects/git-backup-upload-url`);t.builderPublicKey&&n.searchParams.set("apiKey",t.builderPublicKey),t.userId&&n.searchParams.set("userId",t.userId);let i=await Fe(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},body:JSON.stringify(e),signal:AbortSignal.timeout(1e4)},r);if(i.status===404||i.status===410)return null;if(!i.ok)throw new Error(`Failed to get upload URL: ${i.statusText}`);return await i.json()}async function Bse(t,e,r){let n=new URL(`${ke}/projects/git-backup-record`);t.builderPublicKey&&n.searchParams.set("apiKey",t.builderPublicKey),t.userId&&n.searchParams.set("userId",t.userId);let i=await Fe(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},signal:AbortSignal.timeout(1e4),body:JSON.stringify(e)},r);if(i.status===404||i.status===410)return{success:!0};if(!i.ok)throw new Error(`Failed to record backup: ${i.statusText}`);return await i.json()}async function t0(t,e,r,n){if(e.length===0)return;let i=e.map(a=>`${a.folderName||"code"} (${(a.size/1024/1024).toFixed(1)}MB, ${a.partial?"partial":"full"}${a.forced?", forced":""})`).join(", ");Cr.info(`Recording ${e.length} folder(s): ${i}`);let s=Date.now();if(!(await Bse(t,{backups:e,elapsedTime:r},n)).success)throw new Error("Commit(s) not found on remote when recording backup batch");Cr.info(`Recorded in ${Date.now()-s}ms \u2014 ${e.length} folder(s) committed`)}async function HL(t,e){try{if(e.check.backup.empty)return{success:!0,bundlePath:void 0,bundleSize:0,partial:e.check.backup.partial,gitBranchName:e.check.backup.gitBranchName,lastCommitHash:e.check.backup.lastCommitHash};if(!e.downloadUrl)throw new Error("No download URL found");let{signedUrl:r,partial:n}=e.downloadUrl,i=Date.now(),s=Math.random().toString(36).substring(2,8),o=`download-${i}-${s}.bundle`,a="/tmp",A=t.join(a,o);wu.default.mkdirSync(a,{recursive:!0});let c=await fetch(r);if(!c.ok){let d=await c.text();throw new Error(`Failed to download bundle: ${c.statusText}: ${d}`)}let u=await c.arrayBuffer();wu.default.writeFileSync(A,new Uint8Array(u));let l=await t.stat(A);return Cr.info(`Downloaded bundle: ${l.size} bytes`),{success:!0,bundlePath:A,bundleSize:l.size,partial:n,gitBranchName:e.check.backup.gitBranchName,lastCommitHash:e.check.backup.lastCommitHash}}catch(r){let n=new Error("Failed to download backup",{cause:r});return t.Sentry?.captureException(n,{tags:{operation:"codegen-backup"}}),{success:!1,error:n}}}async function b9e(t,e,r,n){let i=wu.default.createReadStream(t),s=await fetch(e,{method:"PUT",body:i,headers:{"Content-Type":"application/octet-stream","Content-Length":r.toString(),"Content-MD5":n},duplex:"half"}),o=await s.text();if(!s.ok)throw new Error(`Failed to upload bundle: ${s.statusText}: ${o}`);return Cr.info(`Uploaded bundle: ${o}`),s}async function S9e(t){let e=await wu.default.promises.stat(t);if(!e.isFile())throw new Error("Bundle file does not exist");let r=(0,Ese.createHash)("md5"),n=wu.default.createReadStream(t);return await new Promise((s,o)=>{n.on("error",o),n.on("data",a=>r.update(a)),n.on("end",s)}),{contentMd5:r.digest("base64"),size:e.size}}async function JL(t,e,r,n){try{let i=JSON.stringify(r),s=new URL(`${ke}/projects/set-runtime-status`);e.builderPublicKey&&s.searchParams.set("apiKey",e.builderPublicKey),e.userId&&s.searchParams.set("userId",e.userId);let o={"Content-Type":"application/json"};e.builderPrivateKey&&(o.Authorization=`Bearer ${e.builderPrivateKey}`);let a=await Fe(s,{method:"POST",body:i,keepalive:!0,headers:o,signal:AbortSignal.timeout(1e4)},n);return a.ok?await a.json():!1}catch(i){return t.Sentry?.captureException(i,{level:"warning",tags:{operation:"codegen-backup"}}),!1}}async function r0(t,e,r,n){let i=no(r.commits);if(!i)return;let s=Object.keys(r.commits).length;Cr.info(`Syncing snapshot (${s} folder(s)): ${i}`),await JL(t,e,{projectId:r.projectId,branchName:r.branchName,lastCommitHash:i,clearSecondaryVolumeId:!1},n)}function ZC(t){if(!(t.originalRepoUrl==null||t.commitHash==null))return`${t.version??"v1"}::${t.originalRepoUrl}::${t.commitHash}`}var wu,Ese,Cr,n0=L(()=>{"use strict";h();wu=z(require("node:fs"),1);yr();mr();Xs();Ese=require("node:crypto");ta();Dt();_C();KL();Cr=Se("Backup")});function ic(t){try{if((0,af.existsSync)(t)){let e=(0,af.readFileSync)(t,"utf-8");return JSON.parse(e)}}catch{}return null}function io(t){try{if((0,af.existsSync)(t))return(0,af.readFileSync)(t,"utf-8")}catch{}return null}function Af(t){let e=t.filter(r=>!r.includes("/"));return e.some(r=>r==="pnpm-lock.yaml")?{manager:"pnpm",setupCommand:"pnpm install"}:e.some(r=>r==="yarn.lock")?{manager:"yarn",setupCommand:"yarn"}:e.some(r=>r==="bun.lockb")?{manager:"bun",setupCommand:"bun install"}:e.some(r=>r==="package-lock.json")?{manager:"npm",setupCommand:"npm install"}:null}function yse(t,e){return t.some(r=>r===e)}function eI(t,e){return t.filter(n=>!n.includes("/")).some(e)}function cf(t,e){return t.some(r=>r.startsWith(`${e}/`))}var af,tI=L(()=>{"use strict";h();af=require("node:fs")});async function Dse(t,e){try{let r=Af(e);if(!r||!eI(e,A=>/^next\.config\.(js|ts|mjs)$/.test(A))||!cf(e,"app"))return null;let s=(0,Qse.join)(t,"package.json"),o=ic(s);if(!o?.scripts?.dev)return null;let a=o.scripts.dev;return a.includes("next dev")?{id:"nextjs",setupCommand:r.setupCommand,devCommand:a,setupDependencies:[{tool:"node",version:"22",key:"node",type:"mise"}],autoDetectDevServer:!0}:null}catch{return null}}var Qse,wse=L(()=>{"use strict";h();Qse=require("node:path");tI()});async function bse(t,e){try{let r=Af(e);if(!r)return null;let n=eI(e,d=>d==="vue.config.js"||d==="vue.config.ts"),i=eI(e,d=>/^vite\.config\.(js|ts|mjs)$/.test(d));if(!n&&!i)return null;if(i&&!n){let d=e.filter(g=>/^vite\.config\.(js|ts|mjs)$/.test(g));if(d.length>0){let g=(0,YL.join)(t,d[0]),p=io(g);if(!p||!p.includes("@vitejs/plugin-vue")&&!p.includes("vite-plugin-vue"))return null}}if(!cf(e,"src"))return null;let o=(0,YL.join)(t,"package.json"),a=ic(o);if(!a||!(a.dependencies?.vue||a.devDependencies?.vue)||!a.scripts?.dev)return null;let c=a.scripts.dev,u=c.includes("vite"),l=c.includes("vue-cli-service");return!u&&!l?null:{id:"vue-vite",setupCommand:r.setupCommand,devCommand:c,setupDependencies:[{tool:"node",version:"22",key:"node",type:"mise"}],autoDetectDevServer:!0}}catch{return null}}var YL,Sse=L(()=>{"use strict";h();YL=require("node:path");tI()});async function vse(t,e){try{let r=Af(e);if(!r||!yse(e,"svelte.config.js")||!cf(e,"src"))return null;let s=(0,jL.join)(t,"package.json"),o=ic(s);if(!o||!(o.dependencies?.svelte||o.devDependencies?.svelte))return null;let A=o.dependencies?.["@sveltejs/kit"]||o.devDependencies?.["@sveltejs/kit"],c=o.dependencies?.["@sveltejs/vite-plugin-svelte"]||o.devDependencies?.["@sveltejs/vite-plugin-svelte"];if(!A&&!c||!o.scripts?.dev)return null;let u=o.scripts.dev,l=u.includes("vite"),d=u.includes("svelte-kit");if(!l&&!d)return null;if(l&&!A){let g=e.filter(p=>/^vite\.config\.(js|ts|mjs)$/.test(p));if(g.length>0){let p=(0,jL.join)(t,g[0]),f=io(p);if(!f||!f.includes("@sveltejs/vite-plugin-svelte"))return null}}return{id:"svelte-vite",setupCommand:r.setupCommand,devCommand:u,setupDependencies:[{tool:"node",version:"22",key:"node",type:"mise"}],autoDetectDevServer:!0}}catch{return null}}var jL,xse=L(()=>{"use strict";h();jL=require("node:path");tI()});function v9e(t){let e=[".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".cs",".php",".swift",".kt",".scala",".vue",".svelte",".astro",".qwik"],r=["package.json","Cargo.toml","go.mod","pyproject.toml","requirements.txt","Gemfile","pom.xml","build.gradle","next.config.js","next.config.ts","next.config.mjs","nuxt.config.js","nuxt.config.ts","gatsby-config.js","gatsby-config.ts","svelte.config.js","vite.config.js","vite.config.ts","webpack.config.js","webpack.config.ts","rollup.config.js","astro.config.mjs","remix.config.js","angular.json","stencil.config.ts","stencil.config.js","web-dev-server.config.js","web-dev-server.config.mjs","custom-elements.json","hugo.toml","hugo.yaml","config.toml","config.yaml","_config.yml","jekyll-config.yml","docusaurus.config.js","mkdocs.yml","nest-cli.json","tsconfig.json","jsconfig.json","ios/Podfile","android/build.gradle","pubspec.yaml"],n=["src/","app/","pages/","components/","public/","static/","assets/","lib/","pkg/","cmd/","internal/","views/","templates/","content/","layouts/","archetypes/"];return!(t.some(a=>e.some(A=>a.toLowerCase().endsWith(A)))||t.some(a=>{let A=a.replace(/\\/g,"/"),c=A.split("/").pop()||"";return r.includes(c)||r.includes(A)})||t.some(a=>{let A=a.replace(/\\/g,"/");return n.some(c=>A.includes(c))}))}function tA(t){if(!t)return!1;let e=t.trim();if(e==="")return!1;let r=[">","<",">=","<=","^","~","=","*"];for(let n of r)if(e.includes(n))return!1;return!(e.includes(" ")||/\.x$/i.test(e)||/\.\*$/.test(e)||e.toLowerCase()==="latest")}async function x9e(t,e){try{let r=e.filter(A=>A.endsWith("package.json")),n=ic((0,Zr.join)(t,"package.json"));if(e.some(A=>A.includes("pnpm-workspace.yaml")))return{isMonorepo:!0,type:"pnpm-workspaces",possibleRoots:await rA(e)};if(n?.workspaces){let A=await rA(e);return e.some(l=>l.includes("yarn.lock"))?{isMonorepo:!0,type:"yarn-workspaces",possibleRoots:A}:e.some(l=>l.includes("bun.lock")||l.includes("bun.lockb"))?{isMonorepo:!0,type:"bun-workspaces",possibleRoots:A}:{isMonorepo:!0,type:"npm-workspaces",possibleRoots:A}}if(e.some(A=>A.includes("lerna.json")))return{isMonorepo:!0,type:"lerna",possibleRoots:await rA(e)};if(e.some(A=>A.includes("nx.json")))return{isMonorepo:!0,type:"nx",possibleRoots:await rA(e)};if(e.some(A=>A.includes("turbo.json")))return{isMonorepo:!0,type:"turborepo",possibleRoots:await rA(e)};if(e.some(A=>A.includes("rush.json")))return{isMonorepo:!0,type:"rush",possibleRoots:await rA(e)};if(e.some(A=>A.includes(".moon/workspace.yml")||A.includes(".moon/workspace.yaml")))return{isMonorepo:!0,type:"moon",possibleRoots:await rA(e)};if(io((0,Zr.join)(t,"Cargo.toml"))?.includes("[workspace]"))return{isMonorepo:!0,type:"cargo-workspaces",possibleRoots:await rA(e)};if(e.some(A=>A.endsWith("go.work")))return{isMonorepo:!0,type:"go-workspaces",possibleRoots:await rA(e)};let o=await rA(e);return o.length>=3?{isMonorepo:!0,type:"other",possibleRoots:o}:r.length>3?{isMonorepo:!0,type:"other",possibleRoots:o}:e.filter(A=>A.endsWith("Cargo.toml")).length>3?{isMonorepo:!0,type:"other",possibleRoots:o}:{isMonorepo:!1,possibleRoots:o.length>0?o:void 0}}catch{return{isMonorepo:!1}}}async function F9e(t,e){try{let r=[],n=e.filter(l=>l.endsWith("package.json")),i={};for(let l of n){let d=(0,Zr.join)(t,l),g=ic(d);g&&(Object.assign(i,g.dependencies||{}),Object.assign(i,g.devDependencies||{}))}let s={React:{deps:["react","react-dom"],files:["jsx","tsx"]},"Next.js":{deps:["next"],files:["pages/","app/"],configFiles:["next.config.js","next.config.mjs","next.config.ts"]},Vue:{deps:["vue"],files:["vue"]},Nuxt:{deps:["nuxt"],configFiles:["nuxt.config.js","nuxt.config.ts"]},Angular:{deps:["@angular/core"],configFiles:["angular.json"]},Svelte:{deps:["svelte"],files:["svelte"]},SvelteKit:{deps:["@sveltejs/kit"],configFiles:["svelte.config.js"]},Qwik:{deps:["@builder.io/qwik"],files:["qwik"]},Solid:{deps:["solid-js"]},Stencil:{deps:["@stencil/core"],configFiles:["stencil.config.ts","stencil.config.js"]},Lit:{deps:["lit","lit-element","lit-html"]},Polymer:{deps:["@polymer/polymer"]},"FAST (Microsoft)":{deps:["@microsoft/fast-element"]},Haunted:{deps:["haunted"]},Hybrids:{deps:["hybrids"]},Express:{deps:["express"]},Fastify:{deps:["fastify"]},NestJS:{deps:["@nestjs/core"],configFiles:["nest-cli.json"]},Remix:{deps:["@remix-run/react"],configFiles:["remix.config.js"]},Gatsby:{deps:["gatsby"],configFiles:["gatsby-config.js"]},Astro:{deps:["astro"],configFiles:["astro.config.mjs"]}};for(let[l,d]of Object.entries(s)){let g=[],p="low",f=d.deps.some(m=>i?.[m]);f&&(g.push(`dependency: ${d.deps.find(m=>i?.[m])}`),p="high"),d.configFiles&&d.configFiles.some(C=>e.some(I=>I.includes(C)))&&(g.push(`config: ${d.configFiles.find(C=>e.some(I=>I.includes(C)))}`),p="high"),d.files&&!f&&d.files.some(C=>e.some(I=>I.includes(C)))&&(g.push(`files: ${d.files.find(C=>e.some(I=>I.includes(C)))}`),p=p==="high"?"high":"medium"),g.length>0&&r.push({name:l,confidence:p,indicators:g})}let o={Django:{files:["manage.py","settings.py"],imports:["django"]},Flask:{files:["app.py"],imports:["flask"]},FastAPI:{files:[],imports:["fastapi"]}};for(let[l,d]of Object.entries(o)){let g=[],p="low";if(d.files.some(m=>e.some(C=>C.includes(m)))&&(g.push(`file: ${d.files.find(m=>e.some(C=>C.includes(m)))}`),p="high"),d.imports){let m=e.filter(I=>I.includes("requirements.txt")),C=e.filter(I=>I.includes("pyproject.toml"));for(let I of m){let B=io((0,Zr.join)(t,I));if(B&&d.imports.some(y=>B.includes(y))){g.push("requirements.txt"),p="high";break}}for(let I of C){let B=io((0,Zr.join)(t,I));if(B&&d.imports.some(y=>B.includes(y))){g.push("pyproject.toml"),p="high";break}}}g.length>0&&r.push({name:l,confidence:p,indicators:g})}let a=e.filter(l=>l.endsWith("Cargo.toml")),A=[{name:"Actix",dep:"actix-web"},{name:"Rocket",dep:"rocket"},{name:"Axum",dep:"axum"},{name:"Warp",dep:"warp"}];for(let l of a){let d=io((0,Zr.join)(t,l));if(d)for(let{name:g,dep:p}of A)d.includes(p)&&!r.some(f=>f.name===g)&&r.push({name:g,confidence:"high",indicators:[`Cargo.toml: ${p}`]})}let c=e.filter(l=>l.endsWith("go.mod")),u=[{name:"Gin",dep:"github.com/gin-gonic/gin"},{name:"Echo",dep:"github.com/labstack/echo"},{name:"Fiber",dep:"github.com/gofiber/fiber"}];for(let l of c){let d=io((0,Zr.join)(t,l));if(d)for(let{name:g,dep:p}of u)d.includes(p)&&!r.some(f=>f.name===g)&&r.push({name:g,confidence:"high",indicators:[`go.mod: ${p}`]})}return r}catch{return[]}}async function k9e(t,e){let r=[];try{let n=(0,Zr.join)(t,".npmrc");if((0,Nr.existsSync)(n)){r.push({tool:".npmrc"});let p=(0,Nr.readFileSync)(n,"utf-8");(p.includes("@")||p.includes("registry"))&&r.push({tool:"private-packages"})}e.some(p=>p.includes(".env")||p.includes(".env.example")||p.includes(".env.template"))&&r.push({tool:"env-file"});let s=(0,Zr.join)(t,".nvmrc"),o=(0,Zr.join)(t,".node-version");if((0,Nr.existsSync)(s)){let p=(0,Nr.readFileSync)(s,"utf-8").trim();tA(p)?r.push({tool:"node",version:p}):r.push({tool:"node"})}else if((0,Nr.existsSync)(o)){let p=(0,Nr.readFileSync)(o,"utf-8").trim();tA(p)?r.push({tool:"node",version:p}):r.push({tool:"node"})}else{let p=(0,Zr.join)(t,"package.json");if((0,Nr.existsSync)(p))try{let f=JSON.parse((0,Nr.readFileSync)(p,"utf-8"));if(f.engines?.node){let m=f.engines.node;tA(m)?r.push({tool:"node",version:m}):r.push({tool:"node"})}}catch{}}let a=(0,Zr.join)(t,"rust-toolchain"),A=(0,Zr.join)(t,"rust-toolchain.toml");if((0,Nr.existsSync)(a)){let p=(0,Nr.readFileSync)(a,"utf-8").trim();tA(p)?r.push({tool:"rust",version:p}):r.push({tool:"rust"})}else if((0,Nr.existsSync)(A)){let m=(0,Nr.readFileSync)(A,"utf-8").match(/channel\s*=\s*"(.+?)"/)?.[1];tA(m)?r.push({tool:"rust",version:m}):r.push({tool:"rust"})}let c=(0,Zr.join)(t,".python-version");if((0,Nr.existsSync)(c)){let p=(0,Nr.readFileSync)(c,"utf-8").trim();tA(p)?r.push({tool:"python",version:p}):r.push({tool:"python"})}else{let p=(0,Zr.join)(t,"pyproject.toml");if((0,Nr.existsSync)(p)){let m=(0,Nr.readFileSync)(p,"utf-8").match(/requires-python\s*=\s*"(.+?)"/);if(m){let C=m[1];tA(C)?r.push({tool:"python",version:C}):r.push({tool:"python"})}}}let u=(0,Zr.join)(t,".go-version");if((0,Nr.existsSync)(u)){let p=(0,Nr.readFileSync)(u,"utf-8").trim();tA(p)?r.push({tool:"go",version:p}):r.push({tool:"go"})}else{let p=(0,Zr.join)(t,"go.mod");if((0,Nr.existsSync)(p)){let m=(0,Nr.readFileSync)(p,"utf-8").match(/go\s+(\d+\.\d+)/);if(m){let C=m[1];tA(C)?r.push({tool:"go",version:C}):r.push({tool:"go"})}}}let l=(0,Zr.join)(t,".ruby-version");if((0,Nr.existsSync)(l)){let p=(0,Nr.readFileSync)(l,"utf-8").trim();tA(p)?r.push({tool:"ruby",version:p}):r.push({tool:"ruby"})}e.some(p=>p.includes("docker-compose.yml")||p.includes("docker-compose.yaml")||p.includes("compose.yml")||p.includes("compose.yaml"))&&r.push({tool:"docker-compose"});let g=[{type:"postgresql",indicators:["postgresql","postgres","psql"]},{type:"mysql",indicators:["mysql"]},{type:"mongodb",indicators:["mongodb","mongo"]},{type:"redis",indicators:["redis"]},{type:"sqlite",indicators:["sqlite"]}];for(let{type:p,indicators:f}of g)e.some(C=>f.some(I=>C.toLowerCase().includes(I)))&&r.push({tool:p});return r}catch{return[]}}async function R9e(t){try{let e=[];return t.some(r=>r.includes("package-lock.json"))&&e.push("npm"),t.some(r=>r.includes("yarn.lock"))&&e.push("yarn"),t.some(r=>r.includes("pnpm-lock.yaml"))&&e.push("pnpm"),t.some(r=>r.includes("bun.lockb"))&&e.push("bun"),t.some(r=>r.includes("Cargo.lock"))&&e.push("cargo"),t.some(r=>r.includes("go.sum"))&&e.push("go"),t.some(r=>r.includes("Gemfile.lock"))&&e.push("bundler"),t.some(r=>r.includes("requirements.txt")||r.includes("pyproject.toml"))&&e.push("pip/poetry"),e}catch{return[]}}async function N9e(t){try{let e=[],r=[{name:"Webpack",indicators:["webpack.config.js","webpack.config.ts"]},{name:"Vite",indicators:["vite.config.js","vite.config.ts"]},{name:"esbuild",indicators:["esbuild.config.js"]},{name:"Rollup",indicators:["rollup.config.js"]},{name:"Parcel",indicators:[".parcelrc"]},{name:"Turbopack",indicators:["turbo.json"]},{name:"Make",indicators:["Makefile"]},{name:"CMake",indicators:["CMakeLists.txt"]},{name:"Gradle",indicators:["build.gradle","build.gradle.kts"]},{name:"Maven",indicators:["pom.xml"]}];for(let{name:n,indicators:i}of r)i.some(o=>t.some(a=>a.includes(o)))&&e.push(n);return e}catch{return[]}}function T9e(t,e){let r=[],n=t.split(`
|
|
1799
|
-
`);for(let i of n){let s=i.trim();if(!s||s.startsWith("#"))continue;let o=s.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);if(o){let a=o[1],A=o[2].trim();(A.startsWith('"')&&A.endsWith('"')||A.startsWith("'")&&A.endsWith("'"))&&(A=A.slice(1,-1)),r.push({key:a,placeholderValue:A||void 0,source:e,type:"env"})}}return r}function
|
|
1797
|
+
`:""}var Cse=L(()=>{"use strict";h()});function QYe(t){let e=t.trim().replace(/\.git$/,"");return e.startsWith("git@")&&(e=e.replace(/^git@/,"").replace(/:([^/])/,"/$1")),e=e.replace(/^https?:\/\//,"").replace(/^[^@]+@/,""),e.toLowerCase()}async function Zw(t){if(!t)return;let e=QYe(t),n=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(i)).map(a=>a.toString(16).padStart(2,"0")).join("").slice(0,8)}var GL=L(()=>{"use strict";h()});var OL,Ise=L(()=>{"use strict";h();GL();OL="code"});function sf(t,e=OL){if(typeof t!="string"||!t.trim())return{};let r=t.trim();if(!r.includes(":"))return{[e]:r};let n={};for(let i of r.split(",")){let s=i.indexOf(":");if(s===-1)continue;let o;try{o=decodeURIComponent(i.substring(0,s))}catch{continue}let a=i.substring(s+1).trim();o&&a&&(n[o]=a)}return n}function no(t){return!t||Object.keys(t).length===0?"":Object.keys(t).sort().filter(r=>t[r]).map(r=>`${encodeURIComponent(r)}:${t[r]}`).join(",")}function Du(t,e,r=OL){return sf(t,r)[e]}var KL=L(()=>{"use strict";h();Xs();Ise()});async function e0({sys:t,credentials:e,projectId:r,branchName:n,repoPath:i,aiBranch:s,featureBranch:o,workspace:a,isConnectedToProvider:A,debug:c,forcedFullBackup:u,canAbortMerge:l,folderName:d,repoUrl:g}){let p=performance.now();async function f(M){return ea("git",M,{cwd:i,sys:t})}async function m(){return(await f(["branch","--show-current"])).trim()}async function C(M,G){try{return await f(["merge-base","--is-ancestor",M,G]),!0}catch{return!1}}async function I(){try{return await f(["rev-parse","-q","--verify","MERGE_HEAD"]),!0}catch{return!1}}async function B(M){if(M!=null)try{let G=await f(["--no-pager","show","-s","--format='%an%n%ad%n%B'",M]);return Yd(G.trim(),1e3)}catch{return}}async function E(){try{return(await f(["rev-parse","HEAD"])).trim()}catch{return null}}async function y(M,G){try{let J=(await f(["rev-list",M,`--max-count=${G}`])).trim();return J?J.split(`
|
|
1798
|
+
`):[]}catch{return[]}}let Q=u;if(!a)throw new Error("Workspace is required for backup upload");if(await I())if(l)Cr.debug("There is an merge conflict, when attempting to backup, let's try to abort the merge"),await f(["merge","--abort"]);else throw new Error("Merge conflict detected, please resolve the conflict before continuing");await nc(i,t)||(Cr.debug("Uncommitted changes detected, staging and committing before backup"),await f(["add","-A","."]),await f(["commit","--quiet","--no-verify","-m","commit pending changes"]));let D=(d?a.folders.find(M=>(M.name??M.path)===d):a.folders.find(M=>M.enableGit))?.originalRepoUrl??g;if(!D)throw new Error("Original repo URL is required for backup upload");let x=u?"offline-full":A?void 0:"offline",S=await E();if(!S){let M=null;try{let G=await f(["rev-list","--all","--count"]);M=parseInt(G.trim(),10)}catch{}if(M===0){Cr.info("Repository has no commits (empty repo) \u2014 nothing to back up");let G={projectId:r,branchName:n,size:0,partial:!0,initialBranch:o,initialCommitHash:void 0,lastCommitHash:"",gitBranchName:s,empty:!0,status:"completed",version:"v2",repoUrl:D,forced:x,...d&&{folderName:d}};return{success:!0,empty:!0,lastCommitHash:"",partial:!0,repoUrl:D,backupRef:void 0,backupEntry:G}}throw new Error(M===null?"Failed to get current commit hash (git rev-list failed)":`Failed to get current commit hash (rev-list --all --count returned ${M})`)}let v=await m();if(!Q&&v!==s)throw new Error(`Current branch "${v}" is not the ai branch "${s}"`);let P=await DYe({sys:t,repoPath:i,featureBranch:o,debug:c,workspace:a,isConnectedToProvider:A,forcedFullBackup:u,credentials:e,projectId:r,folderName:d}),$=await y(P.initialBranch,10),H=await y(s,10);try{if(P.partial&&(P.initialCommitHash===S||await C(S,P.initialBranch))){Cr.debug(`No commits to backup. ${S}`);let X={projectId:r,branchName:n,size:0,partial:P.partial,initialBranch:P.initialBranch,initialCommitHash:P.initialCommitHash,lastCommitHash:S,gitBranchName:s,empty:!0,status:"completed",version:"v2",repoUrl:D,forced:x,...d&&{folderName:d},metadata:{initialCommitMeta:await B(P.initialCommitHash),lastCommitMeta:await B(S),rangeInRemote:$,rangeInLocal:H}};return{success:!0,empty:!0,lastCommitHash:S,partial:P.partial,repoUrl:D,backupRef:ZC({version:"v2",originalRepoUrl:D,commitHash:S}),backupEntry:X}}Cr.debug("Creating git bundle...");let M=Date.now(),G=Math.random().toString(36).substring(2,8),Y=`backup-${M}-${G}.bundle`,J="/tmp",O=t.join(J,Y);wu.default.mkdirSync(J,{recursive:!0}),await f(["bundle","create","--quiet",O,...P.partial?[`${P.initialCommitHash}..${s}`]:["--branches","--tags"]]),Cr.debug("Computing MD5 hash of bundle file...");let{contentMd5:U,size:K}=await SYe(O);Cr.debug("Verify bundle file integrity"),await f(["bundle","verify","--quiet",O]),Cr.debug(`Requesting signed upload URL for size: ${K} bytes`);let ne=await wYe(e,{projectId:r,branchName:n,size:K,partial:P.partial,contentMd5:U,...d&&{folderName:d},...g&&{repoUrl:g}},c);if(!ne)return Cr.info("Project/branch was removed, it's okay to skip backup"),{success:!1,reason:"project_removed"};let{signedUrl:ge}=ne;Cr.debug(`Uploading to URL: ${ge}`),await bYe(O,ge,K,U),Cr.debug("Uploaded successfully");let me={projectId:r,branchName:n,size:K,partial:P.partial,initialBranch:P.initialBranch,initialCommitHash:P.initialCommitHash,lastCommitHash:S,gitBranchName:s,empty:!1,status:"completed",contentMd5:U,version:"v2",repoUrl:D,forced:x,...d&&{folderName:d},metadata:{initialCommitMeta:await B(P.initialCommitHash),lastCommitMeta:await B(S),rangeInRemote:$,rangeInLocal:H}};try{wu.default.unlinkSync(O)}catch(Ae){t.Sentry?.captureException(Ae,{level:"warning",tags:{operation:"codegen-backup"}})}return Cr.debug("Everything is done"),{success:!0,empty:!1,lastCommitHash:S,partial:P.partial,repoUrl:D,backupRef:ZC({version:"v2",originalRepoUrl:D,commitHash:S}),backupEntry:me}}catch(M){let G=performance.now()-p,Y=M instanceof Error?M.message:String(M);try{await Bse(e,{elapsedTime:G,error:Y,backups:[]},c)}catch(J){Cr.error("Failed to record backup failure",J)}throw M}}async function DYe({sys:t,repoPath:e,featureBranch:r,debug:n,workspace:i,isConnectedToProvider:s,forcedFullBackup:o,credentials:a,projectId:A,folderName:c}){async function u(Q){return ea("git",Q,{cwd:e,sys:t})}async function l(Q){try{return(await u(["rev-parse",Q||"HEAD"])).trim()}catch{return null}}async function d(Q){try{return await u(["remote","get-url",Q]),!0}catch{return!1}}async function g(){try{let w=(await u(["remote","show","origin"])).match(/HEAD branch: (.+)/);if(w){let D=w[1].trim();if(D)return D}return null}catch(Q){let w=new Error("failed to get default remote branch",{cause:Q});throw t.Sentry?.captureException(w,{tags:{operation:"codegen-backup"}}),w}}async function p(Q){let w;try{w=(await u(["remote","get-url","origin"])).trim()}catch{}w!==Q&&(w?await u(["remote","set-url","origin",Q]):await u(["remote","add","origin",Q]))}let f=async()=>{if(i?.folders.length){let w=c?i.folders.find(D=>(D.name??D.path)===c):i.folders.find(D=>D.enableGit);if(!w?.repoName)throw new Error("Git workspace not found");return!RC.includes(w.repoName)}return!!await d("origin")};async function m(){let Q=!1;try{if(i?.folders?.length){let w=c?i.folders.find(D=>(D.name??D.path)===c):i.folders.find(D=>D.enableGit);if(w?.repoName&&A){let D=await of(a,A,n);if(D.success){let x=D.gitConfigs?.[w.repoName];x?.url?(Cr.info(`Refreshing origin remote URL to ${x.url}`),await p(x.url)):(Cr.warn("Config URL was not returned for repo",w.repoName),Q=!0)}else Cr.warn("Failed to fetch git configs",D.error instanceof Error?D.error.message:String(D.error)),Q=!0}}}catch(w){Cr.warn("Failed to refresh remote origin URL",w instanceof Error?w.message:String(w)),Q=!0}return Q}if(o){let Q=await l(r);return{initialBranch:r,initialCommitHash:Q??void 0,partial:!1,forcedFullBackup:o}}let C=await f();if(C){if(!s){Cr.info("Performing offline backup. Not attempting to fetch origin remote.");let Q=await l(r);if(!Q)throw new Error("Failed to get initial commit hash");return{initialBranch:r,initialCommitHash:Q,partial:C,forcedFullBackup:o}}}else{Cr.debug("No origin remote found. Partial backups are not supported.");let Q=await l(r);if(!Q)throw new Error("Failed to get initial commit hash");return{initialBranch:r,initialCommitHash:Q,partial:!1,forcedFullBackup:o}}Cr.debug("Re-fetching all branches");let I=await m();await u(["fetch","origin"]);let B=await g();if(!B)throw new Error("Failed to get default remote branch");if(B==="(unknown)"){Cr.info("Origin default branch is (unknown); performing full backup.");let Q=await l(r);if(!Q)throw new Error("Failed to get initial commit hash");return{initialBranch:r,initialCommitHash:Q,partial:!1,forcedFullBackup:o,tokenRefreshFailed:I}}let E=`refs/remotes/origin/${B}`,y=await l(E);if(!y)throw new Error("Failed to get initial commit hash");return{initialBranch:E,initialCommitHash:y,partial:C,forcedFullBackup:o,tokenRefreshFailed:I}}async function wYe(t,e,r){let n=new URL(`${ke}/projects/git-backup-upload-url`);t.builderPublicKey&&n.searchParams.set("apiKey",t.builderPublicKey),t.userId&&n.searchParams.set("userId",t.userId);let i=await Fe(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},body:JSON.stringify(e),signal:AbortSignal.timeout(1e4)},r);if(i.status===404||i.status===410)return null;if(!i.ok)throw new Error(`Failed to get upload URL: ${i.statusText}`);return await i.json()}async function Bse(t,e,r){let n=new URL(`${ke}/projects/git-backup-record`);t.builderPublicKey&&n.searchParams.set("apiKey",t.builderPublicKey),t.userId&&n.searchParams.set("userId",t.userId);let i=await Fe(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},signal:AbortSignal.timeout(1e4),body:JSON.stringify(e)},r);if(i.status===404||i.status===410)return{success:!0};if(!i.ok)throw new Error(`Failed to record backup: ${i.statusText}`);return await i.json()}async function t0(t,e,r,n){if(e.length===0)return;let i=e.map(a=>`${a.folderName||"code"} (${(a.size/1024/1024).toFixed(1)}MB, ${a.partial?"partial":"full"}${a.forced?", forced":""})`).join(", ");Cr.info(`Recording ${e.length} folder(s): ${i}`);let s=Date.now();if(!(await Bse(t,{backups:e,elapsedTime:r},n)).success)throw new Error("Commit(s) not found on remote when recording backup batch");Cr.info(`Recorded in ${Date.now()-s}ms \u2014 ${e.length} folder(s) committed`)}async function HL(t,e){try{if(e.check.backup.empty)return{success:!0,bundlePath:void 0,bundleSize:0,partial:e.check.backup.partial,gitBranchName:e.check.backup.gitBranchName,lastCommitHash:e.check.backup.lastCommitHash};if(!e.downloadUrl)throw new Error("No download URL found");let{signedUrl:r,partial:n}=e.downloadUrl,i=Date.now(),s=Math.random().toString(36).substring(2,8),o=`download-${i}-${s}.bundle`,a="/tmp",A=t.join(a,o);wu.default.mkdirSync(a,{recursive:!0});let c=await fetch(r);if(!c.ok){let d=await c.text();throw new Error(`Failed to download bundle: ${c.statusText}: ${d}`)}let u=await c.arrayBuffer();wu.default.writeFileSync(A,new Uint8Array(u));let l=await t.stat(A);return Cr.info(`Downloaded bundle: ${l.size} bytes`),{success:!0,bundlePath:A,bundleSize:l.size,partial:n,gitBranchName:e.check.backup.gitBranchName,lastCommitHash:e.check.backup.lastCommitHash}}catch(r){let n=new Error("Failed to download backup",{cause:r});return t.Sentry?.captureException(n,{tags:{operation:"codegen-backup"}}),{success:!1,error:n}}}async function bYe(t,e,r,n){let i=wu.default.createReadStream(t),s=await fetch(e,{method:"PUT",body:i,headers:{"Content-Type":"application/octet-stream","Content-Length":r.toString(),"Content-MD5":n},duplex:"half"}),o=await s.text();if(!s.ok)throw new Error(`Failed to upload bundle: ${s.statusText}: ${o}`);return Cr.info(`Uploaded bundle: ${o}`),s}async function SYe(t){let e=await wu.default.promises.stat(t);if(!e.isFile())throw new Error("Bundle file does not exist");let r=(0,Ese.createHash)("md5"),n=wu.default.createReadStream(t);return await new Promise((s,o)=>{n.on("error",o),n.on("data",a=>r.update(a)),n.on("end",s)}),{contentMd5:r.digest("base64"),size:e.size}}async function JL(t,e,r,n){try{let i=JSON.stringify(r),s=new URL(`${ke}/projects/set-runtime-status`);e.builderPublicKey&&s.searchParams.set("apiKey",e.builderPublicKey),e.userId&&s.searchParams.set("userId",e.userId);let o={"Content-Type":"application/json"};e.builderPrivateKey&&(o.Authorization=`Bearer ${e.builderPrivateKey}`);let a=await Fe(s,{method:"POST",body:i,keepalive:!0,headers:o,signal:AbortSignal.timeout(1e4)},n);return a.ok?await a.json():!1}catch(i){return t.Sentry?.captureException(i,{level:"warning",tags:{operation:"codegen-backup"}}),!1}}async function r0(t,e,r,n){let i=no(r.commits);if(!i)return;let s=Object.keys(r.commits).length;Cr.info(`Syncing snapshot (${s} folder(s)): ${i}`),await JL(t,e,{projectId:r.projectId,branchName:r.branchName,lastCommitHash:i,clearSecondaryVolumeId:!1},n)}function ZC(t){if(!(t.originalRepoUrl==null||t.commitHash==null))return`${t.version??"v1"}::${t.originalRepoUrl}::${t.commitHash}`}var wu,Ese,Cr,n0=L(()=>{"use strict";h();wu=z(require("node:fs"),1);yr();mr();Xs();Ese=require("node:crypto");ta();Dt();_C();KL();Cr=Se("Backup")});function ic(t){try{if((0,af.existsSync)(t)){let e=(0,af.readFileSync)(t,"utf-8");return JSON.parse(e)}}catch{}return null}function io(t){try{if((0,af.existsSync)(t))return(0,af.readFileSync)(t,"utf-8")}catch{}return null}function Af(t){let e=t.filter(r=>!r.includes("/"));return e.some(r=>r==="pnpm-lock.yaml")?{manager:"pnpm",setupCommand:"pnpm install"}:e.some(r=>r==="yarn.lock")?{manager:"yarn",setupCommand:"yarn"}:e.some(r=>r==="bun.lockb")?{manager:"bun",setupCommand:"bun install"}:e.some(r=>r==="package-lock.json")?{manager:"npm",setupCommand:"npm install"}:null}function yse(t,e){return t.some(r=>r===e)}function eI(t,e){return t.filter(n=>!n.includes("/")).some(e)}function cf(t,e){return t.some(r=>r.startsWith(`${e}/`))}var af,tI=L(()=>{"use strict";h();af=require("node:fs")});async function Dse(t,e){try{let r=Af(e);if(!r||!eI(e,A=>/^next\.config\.(js|ts|mjs)$/.test(A))||!cf(e,"app"))return null;let s=(0,Qse.join)(t,"package.json"),o=ic(s);if(!o?.scripts?.dev)return null;let a=o.scripts.dev;return a.includes("next dev")?{id:"nextjs",setupCommand:r.setupCommand,devCommand:a,setupDependencies:[{tool:"node",version:"22",key:"node",type:"mise"}],autoDetectDevServer:!0}:null}catch{return null}}var Qse,wse=L(()=>{"use strict";h();Qse=require("node:path");tI()});async function bse(t,e){try{let r=Af(e);if(!r)return null;let n=eI(e,d=>d==="vue.config.js"||d==="vue.config.ts"),i=eI(e,d=>/^vite\.config\.(js|ts|mjs)$/.test(d));if(!n&&!i)return null;if(i&&!n){let d=e.filter(g=>/^vite\.config\.(js|ts|mjs)$/.test(g));if(d.length>0){let g=(0,YL.join)(t,d[0]),p=io(g);if(!p||!p.includes("@vitejs/plugin-vue")&&!p.includes("vite-plugin-vue"))return null}}if(!cf(e,"src"))return null;let o=(0,YL.join)(t,"package.json"),a=ic(o);if(!a||!(a.dependencies?.vue||a.devDependencies?.vue)||!a.scripts?.dev)return null;let c=a.scripts.dev,u=c.includes("vite"),l=c.includes("vue-cli-service");return!u&&!l?null:{id:"vue-vite",setupCommand:r.setupCommand,devCommand:c,setupDependencies:[{tool:"node",version:"22",key:"node",type:"mise"}],autoDetectDevServer:!0}}catch{return null}}var YL,Sse=L(()=>{"use strict";h();YL=require("node:path");tI()});async function vse(t,e){try{let r=Af(e);if(!r||!yse(e,"svelte.config.js")||!cf(e,"src"))return null;let s=(0,jL.join)(t,"package.json"),o=ic(s);if(!o||!(o.dependencies?.svelte||o.devDependencies?.svelte))return null;let A=o.dependencies?.["@sveltejs/kit"]||o.devDependencies?.["@sveltejs/kit"],c=o.dependencies?.["@sveltejs/vite-plugin-svelte"]||o.devDependencies?.["@sveltejs/vite-plugin-svelte"];if(!A&&!c||!o.scripts?.dev)return null;let u=o.scripts.dev,l=u.includes("vite"),d=u.includes("svelte-kit");if(!l&&!d)return null;if(l&&!A){let g=e.filter(p=>/^vite\.config\.(js|ts|mjs)$/.test(p));if(g.length>0){let p=(0,jL.join)(t,g[0]),f=io(p);if(!f||!f.includes("@sveltejs/vite-plugin-svelte"))return null}}return{id:"svelte-vite",setupCommand:r.setupCommand,devCommand:u,setupDependencies:[{tool:"node",version:"22",key:"node",type:"mise"}],autoDetectDevServer:!0}}catch{return null}}var jL,xse=L(()=>{"use strict";h();jL=require("node:path");tI()});function vYe(t){let e=[".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".cs",".php",".swift",".kt",".scala",".vue",".svelte",".astro",".qwik"],r=["package.json","Cargo.toml","go.mod","pyproject.toml","requirements.txt","Gemfile","pom.xml","build.gradle","next.config.js","next.config.ts","next.config.mjs","nuxt.config.js","nuxt.config.ts","gatsby-config.js","gatsby-config.ts","svelte.config.js","vite.config.js","vite.config.ts","webpack.config.js","webpack.config.ts","rollup.config.js","astro.config.mjs","remix.config.js","angular.json","stencil.config.ts","stencil.config.js","web-dev-server.config.js","web-dev-server.config.mjs","custom-elements.json","hugo.toml","hugo.yaml","config.toml","config.yaml","_config.yml","jekyll-config.yml","docusaurus.config.js","mkdocs.yml","nest-cli.json","tsconfig.json","jsconfig.json","ios/Podfile","android/build.gradle","pubspec.yaml"],n=["src/","app/","pages/","components/","public/","static/","assets/","lib/","pkg/","cmd/","internal/","views/","templates/","content/","layouts/","archetypes/"];return!(t.some(a=>e.some(A=>a.toLowerCase().endsWith(A)))||t.some(a=>{let A=a.replace(/\\/g,"/"),c=A.split("/").pop()||"";return r.includes(c)||r.includes(A)})||t.some(a=>{let A=a.replace(/\\/g,"/");return n.some(c=>A.includes(c))}))}function tA(t){if(!t)return!1;let e=t.trim();if(e==="")return!1;let r=[">","<",">=","<=","^","~","=","*"];for(let n of r)if(e.includes(n))return!1;return!(e.includes(" ")||/\.x$/i.test(e)||/\.\*$/.test(e)||e.toLowerCase()==="latest")}async function xYe(t,e){try{let r=e.filter(A=>A.endsWith("package.json")),n=ic((0,Zr.join)(t,"package.json"));if(e.some(A=>A.includes("pnpm-workspace.yaml")))return{isMonorepo:!0,type:"pnpm-workspaces",possibleRoots:await rA(e)};if(n?.workspaces){let A=await rA(e);return e.some(l=>l.includes("yarn.lock"))?{isMonorepo:!0,type:"yarn-workspaces",possibleRoots:A}:e.some(l=>l.includes("bun.lock")||l.includes("bun.lockb"))?{isMonorepo:!0,type:"bun-workspaces",possibleRoots:A}:{isMonorepo:!0,type:"npm-workspaces",possibleRoots:A}}if(e.some(A=>A.includes("lerna.json")))return{isMonorepo:!0,type:"lerna",possibleRoots:await rA(e)};if(e.some(A=>A.includes("nx.json")))return{isMonorepo:!0,type:"nx",possibleRoots:await rA(e)};if(e.some(A=>A.includes("turbo.json")))return{isMonorepo:!0,type:"turborepo",possibleRoots:await rA(e)};if(e.some(A=>A.includes("rush.json")))return{isMonorepo:!0,type:"rush",possibleRoots:await rA(e)};if(e.some(A=>A.includes(".moon/workspace.yml")||A.includes(".moon/workspace.yaml")))return{isMonorepo:!0,type:"moon",possibleRoots:await rA(e)};if(io((0,Zr.join)(t,"Cargo.toml"))?.includes("[workspace]"))return{isMonorepo:!0,type:"cargo-workspaces",possibleRoots:await rA(e)};if(e.some(A=>A.endsWith("go.work")))return{isMonorepo:!0,type:"go-workspaces",possibleRoots:await rA(e)};let o=await rA(e);return o.length>=3?{isMonorepo:!0,type:"other",possibleRoots:o}:r.length>3?{isMonorepo:!0,type:"other",possibleRoots:o}:e.filter(A=>A.endsWith("Cargo.toml")).length>3?{isMonorepo:!0,type:"other",possibleRoots:o}:{isMonorepo:!1,possibleRoots:o.length>0?o:void 0}}catch{return{isMonorepo:!1}}}async function FYe(t,e){try{let r=[],n=e.filter(l=>l.endsWith("package.json")),i={};for(let l of n){let d=(0,Zr.join)(t,l),g=ic(d);g&&(Object.assign(i,g.dependencies||{}),Object.assign(i,g.devDependencies||{}))}let s={React:{deps:["react","react-dom"],files:["jsx","tsx"]},"Next.js":{deps:["next"],files:["pages/","app/"],configFiles:["next.config.js","next.config.mjs","next.config.ts"]},Vue:{deps:["vue"],files:["vue"]},Nuxt:{deps:["nuxt"],configFiles:["nuxt.config.js","nuxt.config.ts"]},Angular:{deps:["@angular/core"],configFiles:["angular.json"]},Svelte:{deps:["svelte"],files:["svelte"]},SvelteKit:{deps:["@sveltejs/kit"],configFiles:["svelte.config.js"]},Qwik:{deps:["@builder.io/qwik"],files:["qwik"]},Solid:{deps:["solid-js"]},Stencil:{deps:["@stencil/core"],configFiles:["stencil.config.ts","stencil.config.js"]},Lit:{deps:["lit","lit-element","lit-html"]},Polymer:{deps:["@polymer/polymer"]},"FAST (Microsoft)":{deps:["@microsoft/fast-element"]},Haunted:{deps:["haunted"]},Hybrids:{deps:["hybrids"]},Express:{deps:["express"]},Fastify:{deps:["fastify"]},NestJS:{deps:["@nestjs/core"],configFiles:["nest-cli.json"]},Remix:{deps:["@remix-run/react"],configFiles:["remix.config.js"]},Gatsby:{deps:["gatsby"],configFiles:["gatsby-config.js"]},Astro:{deps:["astro"],configFiles:["astro.config.mjs"]}};for(let[l,d]of Object.entries(s)){let g=[],p="low",f=d.deps.some(m=>i?.[m]);f&&(g.push(`dependency: ${d.deps.find(m=>i?.[m])}`),p="high"),d.configFiles&&d.configFiles.some(C=>e.some(I=>I.includes(C)))&&(g.push(`config: ${d.configFiles.find(C=>e.some(I=>I.includes(C)))}`),p="high"),d.files&&!f&&d.files.some(C=>e.some(I=>I.includes(C)))&&(g.push(`files: ${d.files.find(C=>e.some(I=>I.includes(C)))}`),p=p==="high"?"high":"medium"),g.length>0&&r.push({name:l,confidence:p,indicators:g})}let o={Django:{files:["manage.py","settings.py"],imports:["django"]},Flask:{files:["app.py"],imports:["flask"]},FastAPI:{files:[],imports:["fastapi"]}};for(let[l,d]of Object.entries(o)){let g=[],p="low";if(d.files.some(m=>e.some(C=>C.includes(m)))&&(g.push(`file: ${d.files.find(m=>e.some(C=>C.includes(m)))}`),p="high"),d.imports){let m=e.filter(I=>I.includes("requirements.txt")),C=e.filter(I=>I.includes("pyproject.toml"));for(let I of m){let B=io((0,Zr.join)(t,I));if(B&&d.imports.some(y=>B.includes(y))){g.push("requirements.txt"),p="high";break}}for(let I of C){let B=io((0,Zr.join)(t,I));if(B&&d.imports.some(y=>B.includes(y))){g.push("pyproject.toml"),p="high";break}}}g.length>0&&r.push({name:l,confidence:p,indicators:g})}let a=e.filter(l=>l.endsWith("Cargo.toml")),A=[{name:"Actix",dep:"actix-web"},{name:"Rocket",dep:"rocket"},{name:"Axum",dep:"axum"},{name:"Warp",dep:"warp"}];for(let l of a){let d=io((0,Zr.join)(t,l));if(d)for(let{name:g,dep:p}of A)d.includes(p)&&!r.some(f=>f.name===g)&&r.push({name:g,confidence:"high",indicators:[`Cargo.toml: ${p}`]})}let c=e.filter(l=>l.endsWith("go.mod")),u=[{name:"Gin",dep:"github.com/gin-gonic/gin"},{name:"Echo",dep:"github.com/labstack/echo"},{name:"Fiber",dep:"github.com/gofiber/fiber"}];for(let l of c){let d=io((0,Zr.join)(t,l));if(d)for(let{name:g,dep:p}of u)d.includes(p)&&!r.some(f=>f.name===g)&&r.push({name:g,confidence:"high",indicators:[`go.mod: ${p}`]})}return r}catch{return[]}}async function kYe(t,e){let r=[];try{let n=(0,Zr.join)(t,".npmrc");if((0,Nr.existsSync)(n)){r.push({tool:".npmrc"});let p=(0,Nr.readFileSync)(n,"utf-8");(p.includes("@")||p.includes("registry"))&&r.push({tool:"private-packages"})}e.some(p=>p.includes(".env")||p.includes(".env.example")||p.includes(".env.template"))&&r.push({tool:"env-file"});let s=(0,Zr.join)(t,".nvmrc"),o=(0,Zr.join)(t,".node-version");if((0,Nr.existsSync)(s)){let p=(0,Nr.readFileSync)(s,"utf-8").trim();tA(p)?r.push({tool:"node",version:p}):r.push({tool:"node"})}else if((0,Nr.existsSync)(o)){let p=(0,Nr.readFileSync)(o,"utf-8").trim();tA(p)?r.push({tool:"node",version:p}):r.push({tool:"node"})}else{let p=(0,Zr.join)(t,"package.json");if((0,Nr.existsSync)(p))try{let f=JSON.parse((0,Nr.readFileSync)(p,"utf-8"));if(f.engines?.node){let m=f.engines.node;tA(m)?r.push({tool:"node",version:m}):r.push({tool:"node"})}}catch{}}let a=(0,Zr.join)(t,"rust-toolchain"),A=(0,Zr.join)(t,"rust-toolchain.toml");if((0,Nr.existsSync)(a)){let p=(0,Nr.readFileSync)(a,"utf-8").trim();tA(p)?r.push({tool:"rust",version:p}):r.push({tool:"rust"})}else if((0,Nr.existsSync)(A)){let m=(0,Nr.readFileSync)(A,"utf-8").match(/channel\s*=\s*"(.+?)"/)?.[1];tA(m)?r.push({tool:"rust",version:m}):r.push({tool:"rust"})}let c=(0,Zr.join)(t,".python-version");if((0,Nr.existsSync)(c)){let p=(0,Nr.readFileSync)(c,"utf-8").trim();tA(p)?r.push({tool:"python",version:p}):r.push({tool:"python"})}else{let p=(0,Zr.join)(t,"pyproject.toml");if((0,Nr.existsSync)(p)){let m=(0,Nr.readFileSync)(p,"utf-8").match(/requires-python\s*=\s*"(.+?)"/);if(m){let C=m[1];tA(C)?r.push({tool:"python",version:C}):r.push({tool:"python"})}}}let u=(0,Zr.join)(t,".go-version");if((0,Nr.existsSync)(u)){let p=(0,Nr.readFileSync)(u,"utf-8").trim();tA(p)?r.push({tool:"go",version:p}):r.push({tool:"go"})}else{let p=(0,Zr.join)(t,"go.mod");if((0,Nr.existsSync)(p)){let m=(0,Nr.readFileSync)(p,"utf-8").match(/go\s+(\d+\.\d+)/);if(m){let C=m[1];tA(C)?r.push({tool:"go",version:C}):r.push({tool:"go"})}}}let l=(0,Zr.join)(t,".ruby-version");if((0,Nr.existsSync)(l)){let p=(0,Nr.readFileSync)(l,"utf-8").trim();tA(p)?r.push({tool:"ruby",version:p}):r.push({tool:"ruby"})}e.some(p=>p.includes("docker-compose.yml")||p.includes("docker-compose.yaml")||p.includes("compose.yml")||p.includes("compose.yaml"))&&r.push({tool:"docker-compose"});let g=[{type:"postgresql",indicators:["postgresql","postgres","psql"]},{type:"mysql",indicators:["mysql"]},{type:"mongodb",indicators:["mongodb","mongo"]},{type:"redis",indicators:["redis"]},{type:"sqlite",indicators:["sqlite"]}];for(let{type:p,indicators:f}of g)e.some(C=>f.some(I=>C.toLowerCase().includes(I)))&&r.push({tool:p});return r}catch{return[]}}async function RYe(t){try{let e=[];return t.some(r=>r.includes("package-lock.json"))&&e.push("npm"),t.some(r=>r.includes("yarn.lock"))&&e.push("yarn"),t.some(r=>r.includes("pnpm-lock.yaml"))&&e.push("pnpm"),t.some(r=>r.includes("bun.lockb"))&&e.push("bun"),t.some(r=>r.includes("Cargo.lock"))&&e.push("cargo"),t.some(r=>r.includes("go.sum"))&&e.push("go"),t.some(r=>r.includes("Gemfile.lock"))&&e.push("bundler"),t.some(r=>r.includes("requirements.txt")||r.includes("pyproject.toml"))&&e.push("pip/poetry"),e}catch{return[]}}async function NYe(t){try{let e=[],r=[{name:"Webpack",indicators:["webpack.config.js","webpack.config.ts"]},{name:"Vite",indicators:["vite.config.js","vite.config.ts"]},{name:"esbuild",indicators:["esbuild.config.js"]},{name:"Rollup",indicators:["rollup.config.js"]},{name:"Parcel",indicators:[".parcelrc"]},{name:"Turbopack",indicators:["turbo.json"]},{name:"Make",indicators:["Makefile"]},{name:"CMake",indicators:["CMakeLists.txt"]},{name:"Gradle",indicators:["build.gradle","build.gradle.kts"]},{name:"Maven",indicators:["pom.xml"]}];for(let{name:n,indicators:i}of r)i.some(o=>t.some(a=>a.includes(o)))&&e.push(n);return e}catch{return[]}}function TYe(t,e){let r=[],n=t.split(`
|
|
1799
|
+
`);for(let i of n){let s=i.trim();if(!s||s.startsWith("#"))continue;let o=s.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);if(o){let a=o[1],A=o[2].trim();(A.startsWith('"')&&A.endsWith('"')||A.startsWith("'")&&A.endsWith("'"))&&(A=A.slice(1,-1)),r.push({key:a,placeholderValue:A||void 0,source:e,type:"env"})}}return r}function MYe(t,e){let r=[],n=/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,i,s=new Set;for(;(i=n.exec(t))!==null;){let o=i[1];s.has(o)||(s.add(o),r.push({key:o,source:e,type:"npmrc"}))}return r}async function PYe(t,e){try{let r=[],n=new Set,i=[".env.example",".env.template",".env.sample",".env.local.example",".env.development.example",".env.production.example",".env.test.example",".env.staging.example",".env",".env.local",".env.development",".env.production",".env.test",".env.staging"],s=[],o=new Set,a=[];for(let A of e){let c=A.replace(/\\/g,"/");(c===".npmrc"||c.endsWith("/.npmrc"))&&a.push(A)}for(let A of a){let c=(0,Zr.join)(t,A),u=io(c);if(u){let l=MYe(u,A);for(let d of l)n.has(d.key)||(n.add(d.key),r.push(d))}}for(let A of i)for(let c of e){let u=c.replace(/\\/g,"/");(u===A||u.endsWith(`/${A}`))&&!o.has(c)&&(o.add(c),s.push(c))}for(let A of s){let c=(0,Zr.join)(t,A),u=io(c);if(u){let l=TYe(u,A);for(let d of l)n.has(d.key)||(n.add(d.key),r.push(d))}}return r}catch{return[]}}async function LYe(t,e){try{let r=await Dse(t,e);if(r)return r;let n=await bse(t,e);if(n)return n;let i=await vse(t,e);return i||null}catch{return null}}async function rA(t){try{let e=new Set,r=["__tests__","__test__","__examples__","__example__","__fixtures__","__mocks__","test","tests","testing","spec","specs","example","examples","sample","samples","demo","demos","fixture","fixtures","mock","mocks",".test",".spec"],n=["package.json","tsconfig.json","jsconfig.json","pyproject.toml","setup.py","setup.cfg","Pipfile","requirements.txt","poetry.lock","go.mod","Cargo.toml","Gemfile","Rakefile","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","composer.json","mix.exs","Package.swift","pubspec.yaml","stack.yaml","cabal.project","build.sbt","project.clj","deps.edn","CMakeLists.txt","Makefile","Dockerfile",".storybook"],i=a=>a.split("/").some(c=>r.some(u=>c===u||c.startsWith(u+".")));for(let a of t){let A=a.replace(/\\/g,"/"),c=A.split("/").pop()||"";if(n.includes(c)){let u=A.substring(0,A.lastIndexOf("/"));if(u&&i(u))continue;u?e.add(u):e.add(".")}if(c.endsWith(".csproj")||c.endsWith(".fsproj")||c.endsWith(".vbproj")||c.endsWith(".sln")){let u=A.substring(0,A.lastIndexOf("/"));if(u&&i(u))continue;u?e.add(u):e.add(".")}}let s=Array.from(e).sort(),o=s.filter(a=>a!==".");return o.length>0?o:s}catch{return[]}}async function Fse(t,e){let r=[];try{let n=await bu({sys:t,basePath:e,globPattern:"**/*",dot:!0}),i=vYe(n),s=await xYe(e,n),o=await FYe(e,n),a=await kYe(e,n),A=await RYe(n),c=await NYe(n),u=await PYe(e,n),l=await LYe(e,n),d={languages:[],isEmpty:i,isMonorepo:s.isMonorepo,monorepoType:s.type,frameworks:o,setupRequirements:a,packageManagers:A,buildTools:c,environmentVariables:u.length>0?u:void 0,possibleMonorepoRoots:s.possibleRoots,guessedSettings:l||void 0};return r.length>0&&(d.errors=r),d}catch(n){return{languages:[],isEmpty:!1,isMonorepo:!1,frameworks:[],setupRequirements:[],packageManagers:[],buildTools:[],errors:[`Fatal error: ${n instanceof Error?n.message:String(n)}`]}}}var Nr,Zr,kse=L(()=>{"use strict";h();Dg();tI();wse();Sse();xse();Nr=require("node:fs"),Zr=require("node:path")});var Nse,so,i0,Rse,s0,Tse=L(()=>{"use strict";h();Nse=require("node:child_process"),so=z(require("node:path"),1),i0=z(require("node:fs"),1);zo();Dt();Rse=Se("TsServer"),s0=class t{#n=null;#c=0;#s=new Map;#t="";#A;#i=!1;#e=null;#o=new Set;#B=!1;#h=null;static REQUEST_TIMEOUT=3e4;constructor(e){this.#A=e}async start(){return this.#h?this.#h:(this.#h=this.#M(),this.#h)}async#M(){if(this.#n||this.#i)return;let e=this.#k();if(!e)throw new Error("Could not find tsserver. Ensure TypeScript is installed in the project.");this.#n=(0,Nse.spawn)("node",[e,"--useInferredProjectConfig"],{cwd:this.#A,stdio:["pipe","pipe","pipe"],env:{...process.env,TSS_LOG:void 0}}),gw.track(this.#n),this.#n.stdout.on("data",r=>{this.#S(r.toString("utf-8"))}),this.#n.stderr.on("data",r=>{Rse.debug("stderr",r.toString("utf-8"),{loggerOptions:{stderr:!0}})}),this.#n.on("exit",r=>{this.#n=null,this.#B=!1;for(let[,n]of this.#s)clearTimeout(n.timer),n.reject(new Error(`tsserver exited with code ${r}`));this.#s.clear()}),this.#n.on("error",r=>{Rse.error("Process error:",r.message)}),this.#B=!0,await this.#a("configure",{hostInfo:"fusion-editor",preferences:{providePrefixAndSuffixTextForRename:!0,allowRenameOfImportPath:!0,includeCompletionsForModuleExports:!0,includeCompletionsWithSnippetText:!0,includeAutomaticOptionalChainCompletions:!0,includeCompletionsWithInsertText:!0,includeCompletionsWithClassMemberSnippets:!0,includeCompletionsWithObjectLiteralMethodSnippets:!0,importModuleSpecifierPreference:"shortest",importModuleSpecifierEnding:"minimal",includeInlayParameterNameHints:"all",includeInlayParameterNameHintsWhenArgumentMatchesName:!1,includeInlayFunctionParameterTypeHints:!0,includeInlayVariableTypeHints:!0,includeInlayVariableTypeHintsWhenTypeMatchesName:!1,includeInlayPropertyDeclarationTypeHints:!0,includeInlayFunctionLikeReturnTypeHints:!0,includeInlayEnumMemberValueHints:!0}})}#k(){let e=so.default.join(this.#A,"node_modules","typescript","lib","tsserver.js");if(i0.default.existsSync(e))return e;let r=so.default.join(this.#A,"..","node_modules","typescript","lib","tsserver.js");if(i0.default.existsSync(r))return r;try{let n=require.resolve("typescript/lib/tsserver.js",{paths:[this.#A]});if(i0.default.existsSync(n))return n}catch{}return null}#S(e){for(this.#t+=e;;){let r=this.#t.match(/^Content-Length:\s*(\d+)\r?\n\r?\n/);if(r){let s=parseInt(r[1],10),o=r[0].length,a=o+s;if(this.#t.length>=a){let A=this.#t.substring(o,a);this.#t=this.#t.substring(a),this.#v(A);continue}break}let n=this.#t.indexOf(`
|
|
1800
1800
|
`);if(n===-1)break;let i=this.#t.substring(0,n).trim();this.#t=this.#t.substring(n+1),i.startsWith("{")&&this.#v(i)}}#v(e){let r;try{r=JSON.parse(e)}catch{return}if(r.type==="response"){let n=r,i=this.#s.get(n.request_seq);i&&(clearTimeout(i.timer),this.#s.delete(n.request_seq),i.resolve({success:n.success,body:n.body,message:n.message}))}else if(r.type==="event"){let n=r;this.#e?.(n)}}async#a(e,r){if(!this.#n||!this.#B)throw new Error("tsserver is not running");let n=++this.#c,i={seq:n,type:"request",command:e,arguments:r};return new Promise((s,o)=>{let a=setTimeout(()=>{this.#s.delete(n),o(new Error(`tsserver request "${e}" timed out`))},t.REQUEST_TIMEOUT);this.#s.set(n,{resolve:s,reject:o,timer:a});let A=JSON.stringify(i)+`
|
|
1801
|
-
`;this.#n.stdin.write(A)})}setEventHandler(e){this.#e=e}async openFile(e,r,n){await this.start();let i=so.default.isAbsolute(e)?e:so.default.resolve(this.#A,e);if(this.#o.has(i)){await this.changeFile(e,r);return}await this.#a("open",{file:i,fileContent:r,scriptKindName:this.#r(i),projectRootPath:n||this.#A}),this.#o.add(i)}async changeFile(e,r){if(!this.#B)return;let n=so.default.isAbsolute(e)?e:so.default.resolve(this.#A,e);if(!this.#o.has(n)){await this.openFile(e,r);return}await this.#a("open",{file:n,fileContent:r,scriptKindName:this.#r(n),projectRootPath:this.#A})}async closeFile(e){if(!this.#B)return;let r=so.default.isAbsolute(e)?e:so.default.resolve(this.#A,e);this.#o.has(r)&&(await this.#a("close",{file:r}),this.#o.delete(r))}async getCompletions(e,r,n,i){let s=this.#p(e);return this.#a("completionInfo",{file:s,line:r,offset:n,includeExternalModuleExports:i?.includeExternalModuleExports??!0,includeInsertTextCompletions:!0,triggerCharacter:i?.triggerCharacter,triggerKind:i?.triggerCharacter?2:1})}async getCompletionDetails(e,r,n,i){let s=this.#p(e);return this.#a("completionEntryDetails",{file:s,line:r,offset:n,entryNames:i})}async getDefinition(e,r,n){let i=this.#p(e);return this.#a("definition",{file:i,line:r,offset:n})}async getTypeDefinition(e,r,n){let i=this.#p(e);return this.#a("typeDefinition",{file:i,line:r,offset:n})}async getQuickInfo(e,r,n){let i=this.#p(e);return this.#a("quickinfo",{file:i,line:r,offset:n})}async getReferences(e,r,n){let i=this.#p(e);return this.#a("references",{file:i,line:r,offset:n})}async getSignatureHelp(e,r,n){let i=this.#p(e);return this.#a("signatureHelp",{file:i,line:r,offset:n})}async requestDiagnostics(e){let r=e.map(n=>this.#p(n));await this.#a("geterr",{files:r,delay:0}).catch(()=>{})}async getRenameLocations(e,r,n){let i=this.#p(e);return this.#a("rename",{file:i,line:r,offset:n,findInComments:!1,findInStrings:!1})}async getNavTree(e){let r=this.#p(e);return this.#a("navtree",{file:r})}async organizeImports(e){let r=this.#p(e);return this.#a("organizeImports",{scope:{type:"file",args:{file:r}}})}async getInlayHints(e){let r=this.#p(e);return this.#a("provideInlayHints",{file:r,start:0,length:2147483647})}async getCodeFixes(e,r,n,i,s,o){let a=this.#p(e);return this.#a("getCodeFixes",{file:a,startLine:r,startOffset:n,endLine:i,endOffset:s,errorCodes:o})}async getApplicableRefactors(e,r,n,i,s){let o=this.#p(e);return this.#a("getApplicableRefactors",{file:o,startLine:r,startOffset:n,endLine:i,endOffset:s})}async getEditsForRefactor(e,r,n,i,s,o,a){let A=this.#p(e);return this.#a("getEditsForRefactor",{file:A,startLine:r,startOffset:n,endLine:i,endOffset:s,refactor:o,action:a})}async getImplementation(e,r,n){let i=this.#p(e);return this.#a("implementation",{file:i,line:r,offset:n})}async getSelectionRange(e,r){let n=this.#p(e);return this.#a("selectionRange",{file:n,locations:r})}async getLinkedEditingRange(e,r,n){let i=this.#p(e);return this.#a("linkedEditingRange",{file:i,line:r,offset:n})}async getFormatRange(e,r,n,i,s){let o=this.#p(e);return this.#a("format",{file:o,line:r,offset:n,endLine:i,endOffset:s})}getCwd(){return this.#A}isRunning(){return this.#B&&this.#n!==null}dispose(){if(this.#i=!0,this.#B=!1,this.#n){try{this.#n.kill("SIGTERM")}catch{}gw.untrack(this.#n),this.#n=null}for(let[,e]of this.#s)clearTimeout(e.timer),e.reject(new Error("tsserver disposed"));this.#s.clear(),this.#o.clear(),this.#e=null}#p(e){return so.default.isAbsolute(e)?e:so.default.resolve(this.#A,e)}#r(e){switch(so.default.extname(e).toLowerCase()){case".tsx":return"TSX";case".ts":return"TS";case".jsx":return"JSX";case".js":case".mjs":case".cjs":return"JS";default:return"TS"}}}});function Su(t){if(!t)return;let e=t.toLowerCase();if(e!=="inherit")return _9e[e]??t}var _9e,o0=L(()=>{"use strict";h();_9e={"sonnet-4":"acs4",sonnet:"acs",opus:"aco",haiku:"ach",gpt5:"opa5","gpt5-5":"opa55","gpt5-codex":"opa5c.acs4",codex:"opa5c.acs4","gpt5-codex-mini":"opa5c-mini","gpt5-mini":"opa5-mini","gpt5-nano":"opa5-nano",gemini:"g.acs","gemini-flash":"gf.ach"}});function Mse(t,e){try{if(!t||!t.trim())return null;let r=Fd(t);if(!r.frontmatter||Object.keys(r.frontmatter).length===0)return{name:rI.default.basename(e,rI.default.extname(e)),systemPrompt:r.body||t.trim(),filePath:e};let n=r.body;if(!n)return null;let i=r.frontmatter.name||rI.default.basename(e,rI.default.extname(e)),s;r.frontmatter.tools&&(Array.isArray(r.frontmatter.tools)?s=r.frontmatter.tools.map(E=>E.trim()):typeof r.frontmatter.tools=="string"&&(s=r.frontmatter.tools.split(",").map(E=>E.trim())));let o=r.frontmatter.model?Su(r.frontmatter.model):void 0,a=r.frontmatter.mode,A=!!r.frontmatter.includeMemories,c=!!r.frontmatter.needDevServer,u=!!r.frontmatter.needValidation,l=!!r.frontmatter.resetAfterRun,d=["low","medium","high","minimal"],g=r.frontmatter.reasoning&&d.includes(r.frontmatter.reasoning)?r.frontmatter.reasoning:void 0,p=r.frontmatter.maxTimeoutMs,f=typeof p=="number"?p:typeof p=="string"?Number(p):void 0,m=f&&Number.isFinite(f)&&f>0?f:void 0,C=r.frontmatter.maxCompletions,I=typeof C=="number"?C:typeof C=="string"?Number(C):void 0,B=I&&Number.isFinite(I)&&I>0?Math.floor(I):void 0;return{name:i,description:r.frontmatter.description,systemPrompt:n,tools:s,model:o,mode:a,filePath:e,includeMemories:A,needDevServer:c,needValidation:u,resetAfterRun:l,maxTimeoutMs:m,maxCompletions:B,reasoning:g}}catch{return null}}var rI,Pse=L(()=>{"use strict";h();rI=z(require("node:path"),1);bD();o0()});async function Lse(t,e,r,n="",i,s){let o=[];try{if(!await t.exists(e))return o;let a=await t.readdir(e);for(let A of a){let c=t.join(e,A);if(i&&s){let l=t.relative(s,c);if(!l.startsWith("..")&&!l.startsWith("/")&&i(l))continue}let u=await t.stat(c).catch(()=>null);if(u)if(u.isDirectory()){let l=n?`${n}/${A}`:A,d=await Lse(t,c,r,l,i,s);o.push(...d)}else(A.endsWith(".mdc")||A.endsWith(".md")||A.endsWith(".yml")||A.endsWith(".yaml"))&&o.push(c)}}catch{}return o}async function G9e(t,e,r){try{if(!(await t.stat(e).catch(()=>null))?.isFile())return null;let i=await t.readFile(e);if(!i)return null;let s=t.relative(r,e);return Mse(i,s)}catch(n){return t.Sentry?.captureException(n),null}}async function _se({sys:t,projectDir:e,currentDir:r,rootDir:n}){let i=[],s=[".claude/agents",".builder/agents",".cursor/agents",".agents/agents"],o=await a0(e,t),a;do{try{for(let A of s){let c=t.resolve(r,A);if(await t.exists(c)){let u=await Lse(t,c,c,"",o,e);for(let l of u){let d=await G9e(t,l,e);d&&i.push(d)}}}}catch(A){U9e.debug(`Error reading ${r}:`,A)}if(a=r,r=t.dirname(r),r===a)break}while(a!==n);return i}var U9e,Use=L(()=>{"use strict";h();Pse();Dg();Dt();U9e=Se("AgentDiscovery")});function O9e(t){try{return JSON.stringify(t)}catch{return String(t)}}function Gse(t){let{filePath:e,forceWorkspace:r=!1,workspace:n,workingDirectory:i,sys:s,canCollapseWorkspace:o}=t;if(typeof e!="string")throw new TypeError(`resolveWorkspacePath: 'filePath' must be a string, received ${typeof e}: ${O9e(e)}`);let a=e;if(a.startsWith("/")?a=a.substring(1):a.startsWith("./")&&(a=a.substring(2)),!n?.folders?.length)return{resolvedPath:s.resolve(i,a)};if(n.folders.length===1&&n.folders[0].name==="."||o){let p=n.folders[0],f=s.resolve(i,p.path);return{resolvedPath:s.resolve(f,a),workspaceFolder:p}}let c=a.indexOf("/");if(c===-1){if(r){let p=n.folders[0],f=s.resolve(i,p.path);return{resolvedPath:s.resolve(f,a),workspaceFolder:p}}return{resolvedPath:s.resolve(i,a)}}let u=a.substring(0,c),l=a.substring(c+1),d=n.folders.find(p=>p.name?p.name===u:s.basename(p.path)===u);if(!d){if(!r)return{resolvedPath:s.resolve(i,a)};d=n.folders[0];let p=s.resolve(i,d.path);return{resolvedPath:s.resolve(p,a),workspaceFolder:d}}let g=s.resolve(i,d.path);return{resolvedPath:s.resolve(g,l),workspaceFolder:d}}function Ose(t){let{absolutePath:e,workspace:r,workingDirectory:n,sys:i,canCollapseWorkspace:s}=t;if(!r?.folders?.length)return;let o=pn(i.resolve(e));if(r.folders.length===1&&r.folders[0].name==="."){let A=r.folders[0],c=pn(i.resolve(n,A.path));if(o.startsWith(c)){let u=o.substring(c.length);return u.startsWith("/")&&(u=u.substring(1)),u}}if(s&&r.folders.length===1){let A=r.folders[0],c=pn(i.resolve(n,A.path));if(o.startsWith(c)){let u=o.substring(c.length);return u.startsWith("/")&&(u=u.substring(1)),u}}for(let A of r.folders){let c=pn(i.resolve(n,A.path));if(o.startsWith(c)){let u=o.substring(c.length);u.startsWith("/")&&(u=u.substring(1));let l=A.name||i.basename(A.path);if(l==="."&&r.folders.length>1)continue;return u?`${l}/${u}`:l}}if(s&&r.folders.length>0){let A=r.folders[0],c=pn(i.resolve(n,A.path));if(o.startsWith(c)){let u=o.substring(c.length);return u.startsWith("/")&&(u=u.substring(1)),u}}}function A0(t){let{resolvedPath:e,workingDirectory:r,workspace:n,sys:i}=t,s=i.normalize(e),o=i.normalize(r),a=o.includes("\\")?"\\":"/",A=c=>s.startsWith(c+a)||s===c;if(A(o))return!0;if(n?.folders)for(let c of n.folders){let u=i.normalize(i.resolve(r,c.path));if(A(u))return!0}return!1}var Kse=L(()=>{"use strict";h();Yw()});function vu(t){return!!t._zod}function Pi(t,e){return vu(t)?c0.safeParse(t,e):t.safeParse(e)}function uf(t){if(!t)return;let e;if(vu(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Hse(t){if(vu(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}var K9e,c0,nI=L(()=>{h();K9e=z(require("zod/v3"),1),c0=z(require("zod/v4-mini"),1)});var k,xu,l0,Fu,g0,$n,Jse,Yse,Y8t,H9e,J9e,$L,Rs,iI,jse,Vn,oo,ao,Wn,p0,qse,sI,$se,Vse,VL,wg,$e,WL,Wse,ku,j8t,sc,Y9e,d0,j9e,oI,lf,zse,q9e,$9e,V9e,W9e,z9e,X9e,zL,Z9e,XL,f0,Xse,h0,eYe,tYe,m0,rYe,aI,AI,nYe,cI,oc,iYe,uI,C0,I0,E0,q8t,B0,y0,Q0,Zse,eoe,toe,ZL,roe,lI,gf,noe,sYe,e_,t_,r_,n_,i_,oYe,s_,o_,a_,aYe,AYe,cYe,uYe,lYe,gYe,pYe,dYe,fYe,A_,hYe,mYe,c_,u_,l_,CYe,IYe,EYe,g_,BYe,p_,d_,yYe,QYe,ioe,f_,h_,Ru,$8t,DYe,gI,m_,soe,pI,wYe,C_,bYe,SYe,vYe,xYe,FYe,kYe,RYe,u0,NYe,TYe,I_,bg,dI,MYe,PYe,LYe,_Ye,UYe,GYe,OYe,KYe,HYe,JYe,YYe,jYe,qYe,$Ye,VYe,E_,WYe,zYe,Nu,XYe,ZYe,eje,tje,B_,rje,nje,y_,ije,V8t,W8t,z8t,X8t,Z8t,e3t,Ge,qL,ra=L(()=>{h();k=z(require("zod/v4"),1),xu="2025-11-25",l0=[xu,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Fu="io.modelcontextprotocol/related-task",g0="2.0",$n=k.custom(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Jse=k.union([k.string(),k.number().int()]),Yse=k.string(),Y8t=k.looseObject({ttl:k.union([k.number(),k.null()]).optional(),pollInterval:k.number().optional()}),H9e=k.object({ttl:k.number().optional()}),J9e=k.object({taskId:k.string()}),$L=k.looseObject({progressToken:Jse.optional(),[Fu]:J9e.optional()}),Rs=k.object({_meta:$L.optional()}),iI=Rs.extend({task:H9e.optional()}),jse=t=>iI.safeParse(t).success,Vn=k.object({method:k.string(),params:Rs.loose().optional()}),oo=k.object({_meta:$L.optional()}),ao=k.object({method:k.string(),params:oo.loose().optional()}),Wn=k.looseObject({_meta:$L.optional()}),p0=k.union([k.string(),k.number().int()]),qse=k.object({jsonrpc:k.literal(g0),id:p0,...Vn.shape}).strict(),sI=t=>qse.safeParse(t).success,$se=k.object({jsonrpc:k.literal(g0),...ao.shape}).strict(),Vse=t=>$se.safeParse(t).success,VL=k.object({jsonrpc:k.literal(g0),id:p0,result:Wn}).strict(),wg=t=>VL.safeParse(t).success;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})($e||($e={}));WL=k.object({jsonrpc:k.literal(g0),id:p0.optional(),error:k.object({code:k.number().int(),message:k.string(),data:k.unknown().optional()})}).strict(),Wse=t=>WL.safeParse(t).success,ku=k.union([qse,$se,VL,WL]),j8t=k.union([VL,WL]),sc=Wn.strict(),Y9e=oo.extend({requestId:p0.optional(),reason:k.string().optional()}),d0=ao.extend({method:k.literal("notifications/cancelled"),params:Y9e}),j9e=k.object({src:k.string(),mimeType:k.string().optional(),sizes:k.array(k.string()).optional(),theme:k.enum(["light","dark"]).optional()}),oI=k.object({icons:k.array(j9e).optional()}),lf=k.object({name:k.string(),title:k.string().optional()}),zse=lf.extend({...lf.shape,...oI.shape,version:k.string(),websiteUrl:k.string().optional(),description:k.string().optional()}),q9e=k.intersection(k.object({applyDefaults:k.boolean().optional()}),k.record(k.string(),k.unknown())),$9e=k.preprocess(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,k.intersection(k.object({form:q9e.optional(),url:$n.optional()}),k.record(k.string(),k.unknown()).optional())),V9e=k.looseObject({list:$n.optional(),cancel:$n.optional(),requests:k.looseObject({sampling:k.looseObject({createMessage:$n.optional()}).optional(),elicitation:k.looseObject({create:$n.optional()}).optional()}).optional()}),W9e=k.looseObject({list:$n.optional(),cancel:$n.optional(),requests:k.looseObject({tools:k.looseObject({call:$n.optional()}).optional()}).optional()}),z9e=k.object({experimental:k.record(k.string(),$n).optional(),sampling:k.object({context:$n.optional(),tools:$n.optional()}).optional(),elicitation:$9e.optional(),roots:k.object({listChanged:k.boolean().optional()}).optional(),tasks:V9e.optional()}),X9e=Rs.extend({protocolVersion:k.string(),capabilities:z9e,clientInfo:zse}),zL=Vn.extend({method:k.literal("initialize"),params:X9e}),Z9e=k.object({experimental:k.record(k.string(),$n).optional(),logging:$n.optional(),completions:$n.optional(),prompts:k.object({listChanged:k.boolean().optional()}).optional(),resources:k.object({subscribe:k.boolean().optional(),listChanged:k.boolean().optional()}).optional(),tools:k.object({listChanged:k.boolean().optional()}).optional(),tasks:W9e.optional()}),XL=Wn.extend({protocolVersion:k.string(),capabilities:Z9e,serverInfo:zse,instructions:k.string().optional()}),f0=ao.extend({method:k.literal("notifications/initialized"),params:oo.optional()}),Xse=t=>f0.safeParse(t).success,h0=Vn.extend({method:k.literal("ping"),params:Rs.optional()}),eYe=k.object({progress:k.number(),total:k.optional(k.number()),message:k.optional(k.string())}),tYe=k.object({...oo.shape,...eYe.shape,progressToken:Jse}),m0=ao.extend({method:k.literal("notifications/progress"),params:tYe}),rYe=Rs.extend({cursor:Yse.optional()}),aI=Vn.extend({params:rYe.optional()}),AI=Wn.extend({nextCursor:Yse.optional()}),nYe=k.enum(["working","input_required","completed","failed","cancelled"]),cI=k.object({taskId:k.string(),status:nYe,ttl:k.union([k.number(),k.null()]),createdAt:k.string(),lastUpdatedAt:k.string(),pollInterval:k.optional(k.number()),statusMessage:k.optional(k.string())}),oc=Wn.extend({task:cI}),iYe=oo.merge(cI),uI=ao.extend({method:k.literal("notifications/tasks/status"),params:iYe}),C0=Vn.extend({method:k.literal("tasks/get"),params:Rs.extend({taskId:k.string()})}),I0=Wn.merge(cI),E0=Vn.extend({method:k.literal("tasks/result"),params:Rs.extend({taskId:k.string()})}),q8t=Wn.loose(),B0=aI.extend({method:k.literal("tasks/list")}),y0=AI.extend({tasks:k.array(cI)}),Q0=Vn.extend({method:k.literal("tasks/cancel"),params:Rs.extend({taskId:k.string()})}),Zse=Wn.merge(cI),eoe=k.object({uri:k.string(),mimeType:k.optional(k.string()),_meta:k.record(k.string(),k.unknown()).optional()}),toe=eoe.extend({text:k.string()}),ZL=k.string().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),roe=eoe.extend({blob:ZL}),lI=k.enum(["user","assistant"]),gf=k.object({audience:k.array(lI).optional(),priority:k.number().min(0).max(1).optional(),lastModified:k.iso.datetime({offset:!0}).optional()}),noe=k.object({...lf.shape,...oI.shape,uri:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),annotations:gf.optional(),_meta:k.optional(k.looseObject({}))}),sYe=k.object({...lf.shape,...oI.shape,uriTemplate:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),annotations:gf.optional(),_meta:k.optional(k.looseObject({}))}),e_=aI.extend({method:k.literal("resources/list")}),t_=AI.extend({resources:k.array(noe)}),r_=aI.extend({method:k.literal("resources/templates/list")}),n_=AI.extend({resourceTemplates:k.array(sYe)}),i_=Rs.extend({uri:k.string()}),oYe=i_,s_=Vn.extend({method:k.literal("resources/read"),params:oYe}),o_=Wn.extend({contents:k.array(k.union([toe,roe]))}),a_=ao.extend({method:k.literal("notifications/resources/list_changed"),params:oo.optional()}),aYe=i_,AYe=Vn.extend({method:k.literal("resources/subscribe"),params:aYe}),cYe=i_,uYe=Vn.extend({method:k.literal("resources/unsubscribe"),params:cYe}),lYe=oo.extend({uri:k.string()}),gYe=ao.extend({method:k.literal("notifications/resources/updated"),params:lYe}),pYe=k.object({name:k.string(),description:k.optional(k.string()),required:k.optional(k.boolean())}),dYe=k.object({...lf.shape,...oI.shape,description:k.optional(k.string()),arguments:k.optional(k.array(pYe)),_meta:k.optional(k.looseObject({}))}),fYe=aI.extend({method:k.literal("prompts/list")}),A_=AI.extend({prompts:k.array(dYe)}),hYe=Rs.extend({name:k.string(),arguments:k.record(k.string(),k.string()).optional()}),mYe=Vn.extend({method:k.literal("prompts/get"),params:hYe}),c_=k.object({type:k.literal("text"),text:k.string(),annotations:gf.optional(),_meta:k.record(k.string(),k.unknown()).optional()}),u_=k.object({type:k.literal("image"),data:ZL,mimeType:k.string(),annotations:gf.optional(),_meta:k.record(k.string(),k.unknown()).optional()}),l_=k.object({type:k.literal("audio"),data:ZL,mimeType:k.string(),annotations:gf.optional(),_meta:k.record(k.string(),k.unknown()).optional()}),CYe=k.object({type:k.literal("tool_use"),name:k.string(),id:k.string(),input:k.record(k.string(),k.unknown()),_meta:k.record(k.string(),k.unknown()).optional()}),IYe=k.object({type:k.literal("resource"),resource:k.union([toe,roe]),annotations:gf.optional(),_meta:k.record(k.string(),k.unknown()).optional()}),EYe=noe.extend({type:k.literal("resource_link")}),g_=k.union([c_,u_,l_,EYe,IYe]),BYe=k.object({role:lI,content:g_}),p_=Wn.extend({description:k.string().optional(),messages:k.array(BYe)}),d_=ao.extend({method:k.literal("notifications/prompts/list_changed"),params:oo.optional()}),yYe=k.object({title:k.string().optional(),readOnlyHint:k.boolean().optional(),destructiveHint:k.boolean().optional(),idempotentHint:k.boolean().optional(),openWorldHint:k.boolean().optional()}),QYe=k.object({taskSupport:k.enum(["required","optional","forbidden"]).optional()}),ioe=k.object({...lf.shape,...oI.shape,description:k.string().optional(),inputSchema:k.object({type:k.literal("object"),properties:k.record(k.string(),$n).optional(),required:k.array(k.string()).optional()}).catchall(k.unknown()),outputSchema:k.object({type:k.literal("object"),properties:k.record(k.string(),$n).optional(),required:k.array(k.string()).optional()}).catchall(k.unknown()).optional(),annotations:yYe.optional(),execution:QYe.optional(),_meta:k.record(k.string(),k.unknown()).optional()}),f_=aI.extend({method:k.literal("tools/list")}),h_=AI.extend({tools:k.array(ioe)}),Ru=Wn.extend({content:k.array(g_).default([]),structuredContent:k.record(k.string(),k.unknown()).optional(),isError:k.boolean().optional()}),$8t=Ru.or(Wn.extend({toolResult:k.unknown()})),DYe=iI.extend({name:k.string(),arguments:k.record(k.string(),k.unknown()).optional()}),gI=Vn.extend({method:k.literal("tools/call"),params:DYe}),m_=ao.extend({method:k.literal("notifications/tools/list_changed"),params:oo.optional()}),soe=k.object({autoRefresh:k.boolean().default(!0),debounceMs:k.number().int().nonnegative().default(300)}),pI=k.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),wYe=Rs.extend({level:pI}),C_=Vn.extend({method:k.literal("logging/setLevel"),params:wYe}),bYe=oo.extend({level:pI,logger:k.string().optional(),data:k.unknown()}),SYe=ao.extend({method:k.literal("notifications/message"),params:bYe}),vYe=k.object({name:k.string().optional()}),xYe=k.object({hints:k.array(vYe).optional(),costPriority:k.number().min(0).max(1).optional(),speedPriority:k.number().min(0).max(1).optional(),intelligencePriority:k.number().min(0).max(1).optional()}),FYe=k.object({mode:k.enum(["auto","required","none"]).optional()}),kYe=k.object({type:k.literal("tool_result"),toolUseId:k.string().describe("The unique identifier for the corresponding tool call."),content:k.array(g_).default([]),structuredContent:k.object({}).loose().optional(),isError:k.boolean().optional(),_meta:k.record(k.string(),k.unknown()).optional()}),RYe=k.discriminatedUnion("type",[c_,u_,l_]),u0=k.discriminatedUnion("type",[c_,u_,l_,CYe,kYe]),NYe=k.object({role:lI,content:k.union([u0,k.array(u0)]),_meta:k.record(k.string(),k.unknown()).optional()}),TYe=iI.extend({messages:k.array(NYe),modelPreferences:xYe.optional(),systemPrompt:k.string().optional(),includeContext:k.enum(["none","thisServer","allServers"]).optional(),temperature:k.number().optional(),maxTokens:k.number().int(),stopSequences:k.array(k.string()).optional(),metadata:$n.optional(),tools:k.array(ioe).optional(),toolChoice:FYe.optional()}),I_=Vn.extend({method:k.literal("sampling/createMessage"),params:TYe}),bg=Wn.extend({model:k.string(),stopReason:k.optional(k.enum(["endTurn","stopSequence","maxTokens"]).or(k.string())),role:lI,content:RYe}),dI=Wn.extend({model:k.string(),stopReason:k.optional(k.enum(["endTurn","stopSequence","maxTokens","toolUse"]).or(k.string())),role:lI,content:k.union([u0,k.array(u0)])}),MYe=k.object({type:k.literal("boolean"),title:k.string().optional(),description:k.string().optional(),default:k.boolean().optional()}),PYe=k.object({type:k.literal("string"),title:k.string().optional(),description:k.string().optional(),minLength:k.number().optional(),maxLength:k.number().optional(),format:k.enum(["email","uri","date","date-time"]).optional(),default:k.string().optional()}),LYe=k.object({type:k.enum(["number","integer"]),title:k.string().optional(),description:k.string().optional(),minimum:k.number().optional(),maximum:k.number().optional(),default:k.number().optional()}),_Ye=k.object({type:k.literal("string"),title:k.string().optional(),description:k.string().optional(),enum:k.array(k.string()),default:k.string().optional()}),UYe=k.object({type:k.literal("string"),title:k.string().optional(),description:k.string().optional(),oneOf:k.array(k.object({const:k.string(),title:k.string()})),default:k.string().optional()}),GYe=k.object({type:k.literal("string"),title:k.string().optional(),description:k.string().optional(),enum:k.array(k.string()),enumNames:k.array(k.string()).optional(),default:k.string().optional()}),OYe=k.union([_Ye,UYe]),KYe=k.object({type:k.literal("array"),title:k.string().optional(),description:k.string().optional(),minItems:k.number().optional(),maxItems:k.number().optional(),items:k.object({type:k.literal("string"),enum:k.array(k.string())}),default:k.array(k.string()).optional()}),HYe=k.object({type:k.literal("array"),title:k.string().optional(),description:k.string().optional(),minItems:k.number().optional(),maxItems:k.number().optional(),items:k.object({anyOf:k.array(k.object({const:k.string(),title:k.string()}))}),default:k.array(k.string()).optional()}),JYe=k.union([KYe,HYe]),YYe=k.union([GYe,OYe,JYe]),jYe=k.union([YYe,MYe,PYe,LYe]),qYe=iI.extend({mode:k.literal("form").optional(),message:k.string(),requestedSchema:k.object({type:k.literal("object"),properties:k.record(k.string(),jYe),required:k.array(k.string()).optional()})}),$Ye=iI.extend({mode:k.literal("url"),message:k.string(),elicitationId:k.string(),url:k.string().url()}),VYe=k.union([qYe,$Ye]),E_=Vn.extend({method:k.literal("elicitation/create"),params:VYe}),WYe=oo.extend({elicitationId:k.string()}),zYe=ao.extend({method:k.literal("notifications/elicitation/complete"),params:WYe}),Nu=Wn.extend({action:k.enum(["accept","decline","cancel"]),content:k.preprocess(t=>t===null?void 0:t,k.record(k.string(),k.union([k.string(),k.number(),k.boolean(),k.array(k.string())])).optional())}),XYe=k.object({type:k.literal("ref/resource"),uri:k.string()}),ZYe=k.object({type:k.literal("ref/prompt"),name:k.string()}),eje=Rs.extend({ref:k.union([ZYe,XYe]),argument:k.object({name:k.string(),value:k.string()}),context:k.object({arguments:k.record(k.string(),k.string()).optional()}).optional()}),tje=Vn.extend({method:k.literal("completion/complete"),params:eje}),B_=Wn.extend({completion:k.looseObject({values:k.array(k.string()).max(100),total:k.optional(k.number().int()),hasMore:k.optional(k.boolean())})}),rje=k.object({uri:k.string().startsWith("file://"),name:k.string().optional(),_meta:k.record(k.string(),k.unknown()).optional()}),nje=Vn.extend({method:k.literal("roots/list"),params:Rs.optional()}),y_=Wn.extend({roots:k.array(rje)}),ije=ao.extend({method:k.literal("notifications/roots/list_changed"),params:oo.optional()}),V8t=k.union([h0,zL,tje,C_,mYe,fYe,e_,r_,s_,AYe,uYe,gI,f_,C0,E0,B0,Q0]),W8t=k.union([d0,m0,f0,ije,uI]),z8t=k.union([sc,bg,dI,Nu,y_,I0,y0,oc]),X8t=k.union([h0,I_,E_,nje,C0,E0,B0,Q0]),Z8t=k.union([d0,m0,SYe,gYe,a_,m_,d_,uI,zYe]),e3t=k.union([sc,XL,B_,p_,A_,t_,n_,o_,Ru,h_,I0,y0,oc]),Ge=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===$e.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new qL(i.elicitations,r)}return new t(e,r,n)}},qL=class extends Ge{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super($e.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}});function Tu(t){return t==="completed"||t==="failed"||t==="cancelled"}var ooe=L(()=>{h()});var D0=L(()=>{h()});var Q_=L(()=>{h();D0()});var Mu=L(()=>{h()});var w0=L(()=>{h()});var Ao=L(()=>{h();w0()});var oje,D_=L(()=>{h();oje=require("zod/v3");Mu();dn()});var w_=L(()=>{h();Mu()});var b_=L(()=>{h()});var b0=L(()=>{h();dn()});var S_=L(()=>{h();dn()});var v_=L(()=>{h();Mu()});var x_=L(()=>{h();dn()});var F_=L(()=>{h();dn();Ao()});var k_=L(()=>{h()});var R_=L(()=>{h();dn()});var N_=L(()=>{h()});var z3t,S0=L(()=>{h();Mu();z3t=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});var cje,v0=L(()=>{h();cje=require("zod/v3");dn();S0();b0();Ao()});var T_=L(()=>{h();dn();v0();Ao()});var M_=L(()=>{h()});var P_=L(()=>{h();Ao()});var L_=L(()=>{h()});var x0=L(()=>{h();dn()});var __=L(()=>{h();dn();x0()});var U_=L(()=>{h();Mu()});var G_=L(()=>{h();dn()});var O_=L(()=>{h();dn();Ao()});var K_=L(()=>{h();dn()});var H_=L(()=>{h();dn()});var J_=L(()=>{h();Mu();dn()});var Y_=L(()=>{h();dn()});var j_=L(()=>{h();Ao()});var q_=L(()=>{h();Ao()});var $_=L(()=>{h();dn()});var lje,V_=L(()=>{h();lje=require("zod/v3");Ao();D_();w_();b_();b0();S_();v_();x_();F_();k_();R_();N_();T_();M_();P_();L_();__();U_();G_();O_();K_();H_();v0();J_();S0();Y_();j_();x0();q_();$_()});var dn=L(()=>{h();D0();V_();w0();Ao()});var aoe=L(()=>{h()});var W_=L(()=>{h();dn();Q_();Ao()});var Aoe=L(()=>{h();D0();Q_();Mu();w0();dn();aoe();Ao();D_();w_();b_();b0();S_();v_();x_();F_();k_();R_();N_();T_();M_();P_();L_();__();U_();G_();O_();K_();H_();$_();v0();J_();S0();Y_();j_();x0();q_();V_();W_();W_()});function z_(t){let r=uf(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Hse(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function X_(t,e){let r=Pi(t,e);if(!r.success)throw r.error;return r.data}var pje,coe=L(()=>{h();pje=z(require("zod/v4-mini"),1);nI();Aoe()});function uoe(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function F0(t,e){let r={...t};for(let n in e){let i=n,s=e[i];if(s===void 0)continue;let o=r[i];uoe(o)&&uoe(s)?r[i]={...o,...s}:r[i]=s}return r}var dje,pf,Z_=L(()=>{h();nI();ra();ooe();coe();dje=6e4,pf=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(d0,r=>{this._oncancel(r)}),this.setNotificationHandler(m0,r=>{this._onprogress(r)}),this.setRequestHandler(h0,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(C0,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new Ge($e.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(E0,async(r,n)=>{let i=async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(a.type==="response"||a.type==="error"){let A=a.message,c=A.id,u=this._requestResolvers.get(c);if(u)if(this._requestResolvers.delete(c),a.type==="response")u(A);else{let l=A,d=new Ge(l.error.code,l.error.message,l.error.data);u(d)}else{let l=a.type==="response"?"Response":"Error";this._onerror(new Error(`${l} handler missing for request ${c}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let o=await this._taskStore.getTask(s,n.sessionId);if(!o)throw new Ge($e.InvalidParams,`Task not found: ${s}`);if(!Tu(o.status))return await this._waitForTaskUpdate(s,n.signal),await i();if(Tu(o.status)){let a=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[Fu]:{taskId:s}}}}return await i()};return await i()}),this.setRequestHandler(B0,async(r,n)=>{try{let{tasks:i,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:s,_meta:{}}}catch(i){throw new Ge($e.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(Q0,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new Ge($e.InvalidParams,`Task not found: ${r.params.taskId}`);if(Tu(i.status))throw new Ge($e.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new Ge($e.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(i){throw i instanceof Ge?i:new Ge($e.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,i,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),Ge.fromError($e.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let i=this._transport?.onmessage;this._transport.onmessage=(s,o)=>{i?.(s,o),wg(s)||Wse(s)?this._onresponse(s):sI(s)?this._onrequest(s,o):Vse(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=Ge.fromError($e.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,s=e.params?._meta?.[Fu]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:$e.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:u,timestamp:Date.now()},i?.sessionId).catch(l=>this._onerror(new Error(`Failed to enqueue error response: ${l}`))):i?.send(u).catch(l=>this._onerror(new Error(`Failed to send an error response: ${l}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);let a=jse(e.params)?e.params.task:void 0,A=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,c={signal:o.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{if(o.signal.aborted)return;let l={relatedRequestId:e.id};s&&(l.relatedTask={taskId:s}),await this.notification(u,l)},sendRequest:async(u,l,d)=>{if(o.signal.aborted)throw new Ge($e.ConnectionClosed,"Request was cancelled");let g={...d,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let p=g.relatedTask?.taskId??s;return p&&A&&await A.updateTaskStatus(p,"input_required"),await this.request(u,l,g)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:A,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async u=>{if(o.signal.aborted)return;let l={result:u,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:l,timestamp:Date.now()},i?.sessionId):await i?.send(l)},async u=>{if(o.signal.aborted)return;let l={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:$e.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:l,timestamp:Date.now()},i?.sessionId):await i?.send(l)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),s=this._progressHandlers.get(i);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let o=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&o&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(A){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),o(A);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),wg(e))n(e);else{let o=new Ge(e.error.code,e.error.message,e.error.data);n(o)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(wg(e)&&e.result&&typeof e.result=="object"){let o=e.result;if(o.task&&typeof o.task=="object"){let a=o.task;typeof a.taskId=="string"&&(s=!0,this._taskProgressTokens.set(a.taskId,r))}}if(s||this._progressHandlers.delete(r),wg(e))i(e);else{let o=Ge.fromError(e.error.code,e.error.message,e.error.data);i(o)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(e,r,n)}}catch(o){yield{type:"error",error:o instanceof Ge?o:new Ge($e.InternalError,String(o))}}return}let s;try{let o=await this.request(e,oc,n);if(o.task)s=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new Ge($e.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:a},Tu(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:a.status==="failed"?yield{type:"error",error:new Ge($e.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new Ge($e.InternalError,`Task ${s} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let A=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(c=>setTimeout(c,A)),n?.signal?.throwIfAborted()}}catch(o){yield{type:"error",error:o instanceof Ge?o:new Ge($e.InternalError,String(o))}}}request(e,r,n){let{relatedRequestId:i,resumptionToken:s,onresumptiontoken:o,task:a,relatedTask:A}=n??{};return new Promise((c,u)=>{let l=I=>{u(I)};if(!this._transport){l(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(I){l(I);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),a&&(g.params={...g.params,task:a}),A&&(g.params={...g.params,_meta:{...g.params?._meta||{},[Fu]:A}});let p=I=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(I)}},{relatedRequestId:i,resumptionToken:s,onresumptiontoken:o}).catch(E=>this._onerror(new Error(`Failed to send cancellation: ${E}`)));let B=I instanceof Ge?I:new Ge($e.RequestTimeout,String(I));u(B)};this._responseHandlers.set(d,I=>{if(!n?.signal?.aborted){if(I instanceof Error)return u(I);try{let B=Pi(r,I.result);B.success?c(B.data):u(B.error)}catch(B){u(B)}}}),n?.signal?.addEventListener("abort",()=>{p(n?.signal?.reason)});let f=n?.timeout??dje,m=()=>p(Ge.fromError($e.RequestTimeout,"Request timed out",{timeout:f}));this._setupTimeout(d,f,n?.maxTotalTimeout,m,n?.resetTimeoutOnProgress??!1);let C=A?.taskId;if(C){let I=B=>{let E=this._responseHandlers.get(d);E?E(B):this._onerror(new Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,I),this._enqueueTaskMessage(C,{type:"request",message:g,timestamp:Date.now()}).catch(B=>{this._cleanupTimeout(d),u(B)})}else this._transport.send(g,{relatedRequestId:i,resumptionToken:s,onresumptiontoken:o}).catch(I=>{this._cleanupTimeout(d),u(I)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},I0,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},y0,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},Zse,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Fu]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Fu]:r.relatedTask}}}),this._transport?.send(a,r).catch(A=>this._onerror(A))});return}let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[Fu]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=z_(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,s)=>{let o=X_(e,i);return Promise.resolve(r(o,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=z_(e);this._notificationHandlers.set(n,i=>{let s=X_(e,i);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,i)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let i of n)if(i.type==="request"&&sI(i.message)){let s=i.message.id,o=this._requestResolvers.get(s);o?(o(new Ge($e.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(e);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,s)=>{if(r.aborted){s(new Ge($e.InvalidRequest,"Request cancelled"));return}let o=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(o),s(new Ge($e.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!e)throw new Error("No request provided");return await n.createTask(i,e.id,{method:e.method,params:e.params},r)},getTask:async i=>{let s=await n.getTask(i,r);if(!s)throw new Ge($e.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(i,s,o)=>{await n.storeTaskResult(i,s,o,r);let a=await n.getTask(i,r);if(a){let A=uI.parse({method:"notifications/tasks/status",params:a});await this.notification(A),Tu(a.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,s,o)=>{let a=await n.getTask(i,r);if(!a)throw new Ge($e.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(Tu(a.status))throw new Ge($e.InvalidParams,`Cannot update task "${i}" from terminal status "${a.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,s,o,r);let A=await n.getTask(i,r);if(A){let c=uI.parse({method:"notifications/tasks/status",params:A});await this.notification(c),Tu(A.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}}});var CI=R(Vt=>{"use strict";h();Object.defineProperty(Vt,"__esModule",{value:!0});Vt.regexpCode=Vt.getEsmExportName=Vt.getProperty=Vt.safeStringify=Vt.stringify=Vt.strConcat=Vt.addCodeArg=Vt.str=Vt._=Vt.nil=Vt._Code=Vt.Name=Vt.IDENTIFIER=Vt._CodeOrName=void 0;var hI=class{};Vt._CodeOrName=hI;Vt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Sg=class extends hI{constructor(e){if(super(),!Vt.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Vt.Name=Sg;var co=class extends hI{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Sg&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Vt._Code=co;Vt.nil=new co("");function loe(t,...e){let r=[t[0]],n=0;for(;n<e.length;)tU(r,e[n]),r.push(t[++n]);return new co(r)}Vt._=loe;var eU=new co("+");function goe(t,...e){let r=[mI(t[0])],n=0;for(;n<e.length;)r.push(eU),tU(r,e[n]),r.push(eU,mI(t[++n]));return fje(r),new co(r)}Vt.str=goe;function tU(t,e){e instanceof co?t.push(...e._items):e instanceof Sg?t.push(e):t.push(Cje(e))}Vt.addCodeArg=tU;function fje(t){let e=1;for(;e<t.length-1;){if(t[e]===eU){let r=hje(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function hje(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Sg||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Sg))return`"${t}${e.slice(1)}`}function mje(t,e){return e.emptyStr()?t:t.emptyStr()?e:goe`${t}${e}`}Vt.strConcat=mje;function Cje(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:mI(Array.isArray(t)?t.join(","):t)}function Ije(t){return new co(mI(t))}Vt.stringify=Ije;function mI(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Vt.safeStringify=mI;function Eje(t){return typeof t=="string"&&Vt.IDENTIFIER.test(t)?new co(`.${t}`):loe`[${t}]`}Vt.getProperty=Eje;function Bje(t){if(typeof t=="string"&&Vt.IDENTIFIER.test(t))return new co(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Vt.getEsmExportName=Bje;function yje(t){return new co(t.toString())}Vt.regexpCode=yje});var iU=R(as=>{"use strict";h();Object.defineProperty(as,"__esModule",{value:!0});as.ValueScope=as.ValueScopeName=as.Scope=as.varKinds=as.UsedValueState=void 0;var os=CI(),rU=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},k0;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(k0||(as.UsedValueState=k0={}));as.varKinds={const:new os.Name("const"),let:new os.Name("let"),var:new os.Name("var")};var R0=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof os.Name?e:this.name(e)}name(e){return new os.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};as.Scope=R0;var N0=class extends os.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,os._)`.${new os.Name(r)}[${n}]`}};as.ValueScopeName=N0;var Qje=(0,os._)`\n`,nU=class extends R0{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Qje:os.nil}}get(){return this._scope}name(e){return new N0(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,i);let A=this._scope[s]||(this._scope[s]=[]),c=A.length;return A[c]=r.ref,i.setValue(r,{property:s,itemIndex:c}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,os._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=os.nil;for(let o in e){let a=e[o];if(!a)continue;let A=n[o]=n[o]||new Map;a.forEach(c=>{if(A.has(c))return;A.set(c,k0.Started);let u=r(c);if(u){let l=this.opts.es5?as.varKinds.var:as.varKinds.const;s=(0,os._)`${s}${l} ${c} = ${u};${this.opts._n}`}else if(u=i?.(c))s=(0,os._)`${s}${u}${this.opts._n}`;else throw new rU(c);A.set(c,k0.Completed)})}return s}};as.ValueScope=nU});var Et=R(bt=>{"use strict";h();Object.defineProperty(bt,"__esModule",{value:!0});bt.or=bt.and=bt.not=bt.CodeGen=bt.operators=bt.varKinds=bt.ValueScopeName=bt.ValueScope=bt.Scope=bt.Name=bt.regexpCode=bt.stringify=bt.getProperty=bt.nil=bt.strConcat=bt.str=bt._=void 0;var Ot=CI(),na=iU(),Pu=CI();Object.defineProperty(bt,"_",{enumerable:!0,get:function(){return Pu._}});Object.defineProperty(bt,"str",{enumerable:!0,get:function(){return Pu.str}});Object.defineProperty(bt,"strConcat",{enumerable:!0,get:function(){return Pu.strConcat}});Object.defineProperty(bt,"nil",{enumerable:!0,get:function(){return Pu.nil}});Object.defineProperty(bt,"getProperty",{enumerable:!0,get:function(){return Pu.getProperty}});Object.defineProperty(bt,"stringify",{enumerable:!0,get:function(){return Pu.stringify}});Object.defineProperty(bt,"regexpCode",{enumerable:!0,get:function(){return Pu.regexpCode}});Object.defineProperty(bt,"Name",{enumerable:!0,get:function(){return Pu.Name}});var L0=iU();Object.defineProperty(bt,"Scope",{enumerable:!0,get:function(){return L0.Scope}});Object.defineProperty(bt,"ValueScope",{enumerable:!0,get:function(){return L0.ValueScope}});Object.defineProperty(bt,"ValueScopeName",{enumerable:!0,get:function(){return L0.ValueScopeName}});Object.defineProperty(bt,"varKinds",{enumerable:!0,get:function(){return L0.varKinds}});bt.operators={GT:new Ot._Code(">"),GTE:new Ot._Code(">="),LT:new Ot._Code("<"),LTE:new Ot._Code("<="),EQ:new Ot._Code("==="),NEQ:new Ot._Code("!=="),NOT:new Ot._Code("!"),OR:new Ot._Code("||"),AND:new Ot._Code("&&"),ADD:new Ot._Code("+")};var Ac=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},sU=class extends Ac{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?na.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ff(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ot._CodeOrName?this.rhs.names:{}}},T0=class extends Ac{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Ot.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ff(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ot.Name?{}:{...this.lhs.names};return P0(e,this.rhs)}},oU=class extends T0{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},aU=class extends Ac{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},AU=class extends Ac{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},cU=class extends Ac{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},uU=class extends Ac{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ff(this.code,e,r),this}get names(){return this.code instanceof Ot._CodeOrName?this.code.names:{}}},II=class extends Ac{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(Dje(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Fg(e,r.names),{})}},cc=class extends II{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},lU=class extends II{},df=class extends cc{};df.kind="else";var vg=class t extends cc{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new df(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(poe(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ff(this.condition,e,r),this}get names(){let e=super.names;return P0(e,this.condition),this.else&&Fg(e,this.else.names),e}};vg.kind="if";var xg=class extends cc{};xg.kind="for";var gU=class extends xg{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ff(this.iteration,e,r),this}get names(){return Fg(super.names,this.iteration.names)}},pU=class extends xg{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?na.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=P0(super.names,this.from);return P0(e,this.to)}},M0=class extends xg{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ff(this.iterable,e,r),this}get names(){return Fg(super.names,this.iterable.names)}},EI=class extends cc{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};EI.kind="func";var BI=class extends II{render(e){return"return "+super.render(e)}};BI.kind="return";var dU=class extends cc{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Fg(e,this.catch.names),this.finally&&Fg(e,this.finally.names),e}},yI=class extends cc{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};yI.kind="catch";var QI=class extends cc{render(e){return"finally"+super.render(e)}};QI.kind="finally";var fU=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
1801
|
+
`;this.#n.stdin.write(A)})}setEventHandler(e){this.#e=e}async openFile(e,r,n){await this.start();let i=so.default.isAbsolute(e)?e:so.default.resolve(this.#A,e);if(this.#o.has(i)){await this.changeFile(e,r);return}await this.#a("open",{file:i,fileContent:r,scriptKindName:this.#r(i),projectRootPath:n||this.#A}),this.#o.add(i)}async changeFile(e,r){if(!this.#B)return;let n=so.default.isAbsolute(e)?e:so.default.resolve(this.#A,e);if(!this.#o.has(n)){await this.openFile(e,r);return}await this.#a("open",{file:n,fileContent:r,scriptKindName:this.#r(n),projectRootPath:this.#A})}async closeFile(e){if(!this.#B)return;let r=so.default.isAbsolute(e)?e:so.default.resolve(this.#A,e);this.#o.has(r)&&(await this.#a("close",{file:r}),this.#o.delete(r))}async getCompletions(e,r,n,i){let s=this.#p(e);return this.#a("completionInfo",{file:s,line:r,offset:n,includeExternalModuleExports:i?.includeExternalModuleExports??!0,includeInsertTextCompletions:!0,triggerCharacter:i?.triggerCharacter,triggerKind:i?.triggerCharacter?2:1})}async getCompletionDetails(e,r,n,i){let s=this.#p(e);return this.#a("completionEntryDetails",{file:s,line:r,offset:n,entryNames:i})}async getDefinition(e,r,n){let i=this.#p(e);return this.#a("definition",{file:i,line:r,offset:n})}async getTypeDefinition(e,r,n){let i=this.#p(e);return this.#a("typeDefinition",{file:i,line:r,offset:n})}async getQuickInfo(e,r,n){let i=this.#p(e);return this.#a("quickinfo",{file:i,line:r,offset:n})}async getReferences(e,r,n){let i=this.#p(e);return this.#a("references",{file:i,line:r,offset:n})}async getSignatureHelp(e,r,n){let i=this.#p(e);return this.#a("signatureHelp",{file:i,line:r,offset:n})}async requestDiagnostics(e){let r=e.map(n=>this.#p(n));await this.#a("geterr",{files:r,delay:0}).catch(()=>{})}async getRenameLocations(e,r,n){let i=this.#p(e);return this.#a("rename",{file:i,line:r,offset:n,findInComments:!1,findInStrings:!1})}async getNavTree(e){let r=this.#p(e);return this.#a("navtree",{file:r})}async organizeImports(e){let r=this.#p(e);return this.#a("organizeImports",{scope:{type:"file",args:{file:r}}})}async getInlayHints(e){let r=this.#p(e);return this.#a("provideInlayHints",{file:r,start:0,length:2147483647})}async getCodeFixes(e,r,n,i,s,o){let a=this.#p(e);return this.#a("getCodeFixes",{file:a,startLine:r,startOffset:n,endLine:i,endOffset:s,errorCodes:o})}async getApplicableRefactors(e,r,n,i,s){let o=this.#p(e);return this.#a("getApplicableRefactors",{file:o,startLine:r,startOffset:n,endLine:i,endOffset:s})}async getEditsForRefactor(e,r,n,i,s,o,a){let A=this.#p(e);return this.#a("getEditsForRefactor",{file:A,startLine:r,startOffset:n,endLine:i,endOffset:s,refactor:o,action:a})}async getImplementation(e,r,n){let i=this.#p(e);return this.#a("implementation",{file:i,line:r,offset:n})}async getSelectionRange(e,r){let n=this.#p(e);return this.#a("selectionRange",{file:n,locations:r})}async getLinkedEditingRange(e,r,n){let i=this.#p(e);return this.#a("linkedEditingRange",{file:i,line:r,offset:n})}async getFormatRange(e,r,n,i,s){let o=this.#p(e);return this.#a("format",{file:o,line:r,offset:n,endLine:i,endOffset:s})}getCwd(){return this.#A}isRunning(){return this.#B&&this.#n!==null}dispose(){if(this.#i=!0,this.#B=!1,this.#n){try{this.#n.kill("SIGTERM")}catch{}gw.untrack(this.#n),this.#n=null}for(let[,e]of this.#s)clearTimeout(e.timer),e.reject(new Error("tsserver disposed"));this.#s.clear(),this.#o.clear(),this.#e=null}#p(e){return so.default.isAbsolute(e)?e:so.default.resolve(this.#A,e)}#r(e){switch(so.default.extname(e).toLowerCase()){case".tsx":return"TSX";case".ts":return"TS";case".jsx":return"JSX";case".js":case".mjs":case".cjs":return"JS";default:return"TS"}}}});function Su(t){if(!t)return;let e=t.toLowerCase();if(e!=="inherit")return _Ye[e]??t}var _Ye,o0=L(()=>{"use strict";h();_Ye={"sonnet-4":"acs4",sonnet:"acs",opus:"aco",haiku:"ach",gpt5:"opa5","gpt5-5":"opa55","gpt5-codex":"opa5c.acs4",codex:"opa5c.acs4","gpt5-codex-mini":"opa5c-mini","gpt5-mini":"opa5-mini","gpt5-nano":"opa5-nano",gemini:"g.acs","gemini-flash":"gf.ach"}});function Mse(t,e){try{if(!t||!t.trim())return null;let r=Fd(t);if(!r.frontmatter||Object.keys(r.frontmatter).length===0)return{name:rI.default.basename(e,rI.default.extname(e)),systemPrompt:r.body||t.trim(),filePath:e};let n=r.body;if(!n)return null;let i=r.frontmatter.name||rI.default.basename(e,rI.default.extname(e)),s;r.frontmatter.tools&&(Array.isArray(r.frontmatter.tools)?s=r.frontmatter.tools.map(E=>E.trim()):typeof r.frontmatter.tools=="string"&&(s=r.frontmatter.tools.split(",").map(E=>E.trim())));let o=r.frontmatter.model?Su(r.frontmatter.model):void 0,a=r.frontmatter.mode,A=!!r.frontmatter.includeMemories,c=!!r.frontmatter.needDevServer,u=!!r.frontmatter.needValidation,l=!!r.frontmatter.resetAfterRun,d=["low","medium","high","minimal"],g=r.frontmatter.reasoning&&d.includes(r.frontmatter.reasoning)?r.frontmatter.reasoning:void 0,p=r.frontmatter.maxTimeoutMs,f=typeof p=="number"?p:typeof p=="string"?Number(p):void 0,m=f&&Number.isFinite(f)&&f>0?f:void 0,C=r.frontmatter.maxCompletions,I=typeof C=="number"?C:typeof C=="string"?Number(C):void 0,B=I&&Number.isFinite(I)&&I>0?Math.floor(I):void 0;return{name:i,description:r.frontmatter.description,systemPrompt:n,tools:s,model:o,mode:a,filePath:e,includeMemories:A,needDevServer:c,needValidation:u,resetAfterRun:l,maxTimeoutMs:m,maxCompletions:B,reasoning:g}}catch{return null}}var rI,Pse=L(()=>{"use strict";h();rI=z(require("node:path"),1);bD();o0()});async function Lse(t,e,r,n="",i,s){let o=[];try{if(!await t.exists(e))return o;let a=await t.readdir(e);for(let A of a){let c=t.join(e,A);if(i&&s){let l=t.relative(s,c);if(!l.startsWith("..")&&!l.startsWith("/")&&i(l))continue}let u=await t.stat(c).catch(()=>null);if(u)if(u.isDirectory()){let l=n?`${n}/${A}`:A,d=await Lse(t,c,r,l,i,s);o.push(...d)}else(A.endsWith(".mdc")||A.endsWith(".md")||A.endsWith(".yml")||A.endsWith(".yaml"))&&o.push(c)}}catch{}return o}async function GYe(t,e,r){try{if(!(await t.stat(e).catch(()=>null))?.isFile())return null;let i=await t.readFile(e);if(!i)return null;let s=t.relative(r,e);return Mse(i,s)}catch(n){return t.Sentry?.captureException(n),null}}async function _se({sys:t,projectDir:e,currentDir:r,rootDir:n}){let i=[],s=[".claude/agents",".builder/agents",".cursor/agents",".agents/agents"],o=await a0(e,t),a;do{try{for(let A of s){let c=t.resolve(r,A);if(await t.exists(c)){let u=await Lse(t,c,c,"",o,e);for(let l of u){let d=await GYe(t,l,e);d&&i.push(d)}}}}catch(A){UYe.debug(`Error reading ${r}:`,A)}if(a=r,r=t.dirname(r),r===a)break}while(a!==n);return i}var UYe,Use=L(()=>{"use strict";h();Pse();Dg();Dt();UYe=Se("AgentDiscovery")});function OYe(t){try{return JSON.stringify(t)}catch{return String(t)}}function Gse(t){let{filePath:e,forceWorkspace:r=!1,workspace:n,workingDirectory:i,sys:s,canCollapseWorkspace:o}=t;if(typeof e!="string")throw new TypeError(`resolveWorkspacePath: 'filePath' must be a string, received ${typeof e}: ${OYe(e)}`);let a=e;if(a.startsWith("/")?a=a.substring(1):a.startsWith("./")&&(a=a.substring(2)),!n?.folders?.length)return{resolvedPath:s.resolve(i,a)};if(n.folders.length===1&&n.folders[0].name==="."||o){let p=n.folders[0],f=s.resolve(i,p.path);return{resolvedPath:s.resolve(f,a),workspaceFolder:p}}let c=a.indexOf("/");if(c===-1){if(r){let p=n.folders[0],f=s.resolve(i,p.path);return{resolvedPath:s.resolve(f,a),workspaceFolder:p}}return{resolvedPath:s.resolve(i,a)}}let u=a.substring(0,c),l=a.substring(c+1),d=n.folders.find(p=>p.name?p.name===u:s.basename(p.path)===u);if(!d){if(!r)return{resolvedPath:s.resolve(i,a)};d=n.folders[0];let p=s.resolve(i,d.path);return{resolvedPath:s.resolve(p,a),workspaceFolder:d}}let g=s.resolve(i,d.path);return{resolvedPath:s.resolve(g,l),workspaceFolder:d}}function Ose(t){let{absolutePath:e,workspace:r,workingDirectory:n,sys:i,canCollapseWorkspace:s}=t;if(!r?.folders?.length)return;let o=pn(i.resolve(e));if(r.folders.length===1&&r.folders[0].name==="."){let A=r.folders[0],c=pn(i.resolve(n,A.path));if(o.startsWith(c)){let u=o.substring(c.length);return u.startsWith("/")&&(u=u.substring(1)),u}}if(s&&r.folders.length===1){let A=r.folders[0],c=pn(i.resolve(n,A.path));if(o.startsWith(c)){let u=o.substring(c.length);return u.startsWith("/")&&(u=u.substring(1)),u}}for(let A of r.folders){let c=pn(i.resolve(n,A.path));if(o.startsWith(c)){let u=o.substring(c.length);u.startsWith("/")&&(u=u.substring(1));let l=A.name||i.basename(A.path);if(l==="."&&r.folders.length>1)continue;return u?`${l}/${u}`:l}}if(s&&r.folders.length>0){let A=r.folders[0],c=pn(i.resolve(n,A.path));if(o.startsWith(c)){let u=o.substring(c.length);return u.startsWith("/")&&(u=u.substring(1)),u}}}function A0(t){let{resolvedPath:e,workingDirectory:r,workspace:n,sys:i}=t,s=i.normalize(e),o=i.normalize(r),a=o.includes("\\")?"\\":"/",A=c=>s.startsWith(c+a)||s===c;if(A(o))return!0;if(n?.folders)for(let c of n.folders){let u=i.normalize(i.resolve(r,c.path));if(A(u))return!0}return!1}var Kse=L(()=>{"use strict";h();Yw()});function vu(t){return!!t._zod}function Pi(t,e){return vu(t)?c0.safeParse(t,e):t.safeParse(e)}function uf(t){if(!t)return;let e;if(vu(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Hse(t){if(vu(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}var KYe,c0,nI=L(()=>{h();KYe=z(require("zod/v3"),1),c0=z(require("zod/v4-mini"),1)});var k,xu,l0,Fu,g0,$n,Jse,Yse,Y8t,HYe,JYe,$L,Rs,iI,jse,Vn,oo,ao,Wn,p0,qse,sI,$se,Vse,VL,wg,$e,WL,Wse,ku,j8t,sc,YYe,d0,jYe,oI,lf,zse,qYe,$Ye,VYe,WYe,zYe,XYe,zL,ZYe,XL,f0,Xse,h0,e9e,t9e,m0,r9e,aI,AI,n9e,cI,oc,i9e,uI,C0,I0,E0,q8t,B0,y0,Q0,Zse,eoe,toe,ZL,roe,lI,gf,noe,s9e,e_,t_,r_,n_,i_,o9e,s_,o_,a_,a9e,A9e,c9e,u9e,l9e,g9e,p9e,d9e,f9e,A_,h9e,m9e,c_,u_,l_,C9e,I9e,E9e,g_,B9e,p_,d_,y9e,Q9e,ioe,f_,h_,Ru,$8t,D9e,gI,m_,soe,pI,w9e,C_,b9e,S9e,v9e,x9e,F9e,k9e,R9e,u0,N9e,T9e,I_,bg,dI,M9e,P9e,L9e,_9e,U9e,G9e,O9e,K9e,H9e,J9e,Y9e,j9e,q9e,$9e,V9e,E_,W9e,z9e,Nu,X9e,Z9e,eje,tje,B_,rje,nje,y_,ije,V8t,W8t,z8t,X8t,Z8t,e3t,Ge,qL,ra=L(()=>{h();k=z(require("zod/v4"),1),xu="2025-11-25",l0=[xu,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Fu="io.modelcontextprotocol/related-task",g0="2.0",$n=k.custom(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Jse=k.union([k.string(),k.number().int()]),Yse=k.string(),Y8t=k.looseObject({ttl:k.union([k.number(),k.null()]).optional(),pollInterval:k.number().optional()}),HYe=k.object({ttl:k.number().optional()}),JYe=k.object({taskId:k.string()}),$L=k.looseObject({progressToken:Jse.optional(),[Fu]:JYe.optional()}),Rs=k.object({_meta:$L.optional()}),iI=Rs.extend({task:HYe.optional()}),jse=t=>iI.safeParse(t).success,Vn=k.object({method:k.string(),params:Rs.loose().optional()}),oo=k.object({_meta:$L.optional()}),ao=k.object({method:k.string(),params:oo.loose().optional()}),Wn=k.looseObject({_meta:$L.optional()}),p0=k.union([k.string(),k.number().int()]),qse=k.object({jsonrpc:k.literal(g0),id:p0,...Vn.shape}).strict(),sI=t=>qse.safeParse(t).success,$se=k.object({jsonrpc:k.literal(g0),...ao.shape}).strict(),Vse=t=>$se.safeParse(t).success,VL=k.object({jsonrpc:k.literal(g0),id:p0,result:Wn}).strict(),wg=t=>VL.safeParse(t).success;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})($e||($e={}));WL=k.object({jsonrpc:k.literal(g0),id:p0.optional(),error:k.object({code:k.number().int(),message:k.string(),data:k.unknown().optional()})}).strict(),Wse=t=>WL.safeParse(t).success,ku=k.union([qse,$se,VL,WL]),j8t=k.union([VL,WL]),sc=Wn.strict(),YYe=oo.extend({requestId:p0.optional(),reason:k.string().optional()}),d0=ao.extend({method:k.literal("notifications/cancelled"),params:YYe}),jYe=k.object({src:k.string(),mimeType:k.string().optional(),sizes:k.array(k.string()).optional(),theme:k.enum(["light","dark"]).optional()}),oI=k.object({icons:k.array(jYe).optional()}),lf=k.object({name:k.string(),title:k.string().optional()}),zse=lf.extend({...lf.shape,...oI.shape,version:k.string(),websiteUrl:k.string().optional(),description:k.string().optional()}),qYe=k.intersection(k.object({applyDefaults:k.boolean().optional()}),k.record(k.string(),k.unknown())),$Ye=k.preprocess(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,k.intersection(k.object({form:qYe.optional(),url:$n.optional()}),k.record(k.string(),k.unknown()).optional())),VYe=k.looseObject({list:$n.optional(),cancel:$n.optional(),requests:k.looseObject({sampling:k.looseObject({createMessage:$n.optional()}).optional(),elicitation:k.looseObject({create:$n.optional()}).optional()}).optional()}),WYe=k.looseObject({list:$n.optional(),cancel:$n.optional(),requests:k.looseObject({tools:k.looseObject({call:$n.optional()}).optional()}).optional()}),zYe=k.object({experimental:k.record(k.string(),$n).optional(),sampling:k.object({context:$n.optional(),tools:$n.optional()}).optional(),elicitation:$Ye.optional(),roots:k.object({listChanged:k.boolean().optional()}).optional(),tasks:VYe.optional()}),XYe=Rs.extend({protocolVersion:k.string(),capabilities:zYe,clientInfo:zse}),zL=Vn.extend({method:k.literal("initialize"),params:XYe}),ZYe=k.object({experimental:k.record(k.string(),$n).optional(),logging:$n.optional(),completions:$n.optional(),prompts:k.object({listChanged:k.boolean().optional()}).optional(),resources:k.object({subscribe:k.boolean().optional(),listChanged:k.boolean().optional()}).optional(),tools:k.object({listChanged:k.boolean().optional()}).optional(),tasks:WYe.optional()}),XL=Wn.extend({protocolVersion:k.string(),capabilities:ZYe,serverInfo:zse,instructions:k.string().optional()}),f0=ao.extend({method:k.literal("notifications/initialized"),params:oo.optional()}),Xse=t=>f0.safeParse(t).success,h0=Vn.extend({method:k.literal("ping"),params:Rs.optional()}),e9e=k.object({progress:k.number(),total:k.optional(k.number()),message:k.optional(k.string())}),t9e=k.object({...oo.shape,...e9e.shape,progressToken:Jse}),m0=ao.extend({method:k.literal("notifications/progress"),params:t9e}),r9e=Rs.extend({cursor:Yse.optional()}),aI=Vn.extend({params:r9e.optional()}),AI=Wn.extend({nextCursor:Yse.optional()}),n9e=k.enum(["working","input_required","completed","failed","cancelled"]),cI=k.object({taskId:k.string(),status:n9e,ttl:k.union([k.number(),k.null()]),createdAt:k.string(),lastUpdatedAt:k.string(),pollInterval:k.optional(k.number()),statusMessage:k.optional(k.string())}),oc=Wn.extend({task:cI}),i9e=oo.merge(cI),uI=ao.extend({method:k.literal("notifications/tasks/status"),params:i9e}),C0=Vn.extend({method:k.literal("tasks/get"),params:Rs.extend({taskId:k.string()})}),I0=Wn.merge(cI),E0=Vn.extend({method:k.literal("tasks/result"),params:Rs.extend({taskId:k.string()})}),q8t=Wn.loose(),B0=aI.extend({method:k.literal("tasks/list")}),y0=AI.extend({tasks:k.array(cI)}),Q0=Vn.extend({method:k.literal("tasks/cancel"),params:Rs.extend({taskId:k.string()})}),Zse=Wn.merge(cI),eoe=k.object({uri:k.string(),mimeType:k.optional(k.string()),_meta:k.record(k.string(),k.unknown()).optional()}),toe=eoe.extend({text:k.string()}),ZL=k.string().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),roe=eoe.extend({blob:ZL}),lI=k.enum(["user","assistant"]),gf=k.object({audience:k.array(lI).optional(),priority:k.number().min(0).max(1).optional(),lastModified:k.iso.datetime({offset:!0}).optional()}),noe=k.object({...lf.shape,...oI.shape,uri:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),annotations:gf.optional(),_meta:k.optional(k.looseObject({}))}),s9e=k.object({...lf.shape,...oI.shape,uriTemplate:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),annotations:gf.optional(),_meta:k.optional(k.looseObject({}))}),e_=aI.extend({method:k.literal("resources/list")}),t_=AI.extend({resources:k.array(noe)}),r_=aI.extend({method:k.literal("resources/templates/list")}),n_=AI.extend({resourceTemplates:k.array(s9e)}),i_=Rs.extend({uri:k.string()}),o9e=i_,s_=Vn.extend({method:k.literal("resources/read"),params:o9e}),o_=Wn.extend({contents:k.array(k.union([toe,roe]))}),a_=ao.extend({method:k.literal("notifications/resources/list_changed"),params:oo.optional()}),a9e=i_,A9e=Vn.extend({method:k.literal("resources/subscribe"),params:a9e}),c9e=i_,u9e=Vn.extend({method:k.literal("resources/unsubscribe"),params:c9e}),l9e=oo.extend({uri:k.string()}),g9e=ao.extend({method:k.literal("notifications/resources/updated"),params:l9e}),p9e=k.object({name:k.string(),description:k.optional(k.string()),required:k.optional(k.boolean())}),d9e=k.object({...lf.shape,...oI.shape,description:k.optional(k.string()),arguments:k.optional(k.array(p9e)),_meta:k.optional(k.looseObject({}))}),f9e=aI.extend({method:k.literal("prompts/list")}),A_=AI.extend({prompts:k.array(d9e)}),h9e=Rs.extend({name:k.string(),arguments:k.record(k.string(),k.string()).optional()}),m9e=Vn.extend({method:k.literal("prompts/get"),params:h9e}),c_=k.object({type:k.literal("text"),text:k.string(),annotations:gf.optional(),_meta:k.record(k.string(),k.unknown()).optional()}),u_=k.object({type:k.literal("image"),data:ZL,mimeType:k.string(),annotations:gf.optional(),_meta:k.record(k.string(),k.unknown()).optional()}),l_=k.object({type:k.literal("audio"),data:ZL,mimeType:k.string(),annotations:gf.optional(),_meta:k.record(k.string(),k.unknown()).optional()}),C9e=k.object({type:k.literal("tool_use"),name:k.string(),id:k.string(),input:k.record(k.string(),k.unknown()),_meta:k.record(k.string(),k.unknown()).optional()}),I9e=k.object({type:k.literal("resource"),resource:k.union([toe,roe]),annotations:gf.optional(),_meta:k.record(k.string(),k.unknown()).optional()}),E9e=noe.extend({type:k.literal("resource_link")}),g_=k.union([c_,u_,l_,E9e,I9e]),B9e=k.object({role:lI,content:g_}),p_=Wn.extend({description:k.string().optional(),messages:k.array(B9e)}),d_=ao.extend({method:k.literal("notifications/prompts/list_changed"),params:oo.optional()}),y9e=k.object({title:k.string().optional(),readOnlyHint:k.boolean().optional(),destructiveHint:k.boolean().optional(),idempotentHint:k.boolean().optional(),openWorldHint:k.boolean().optional()}),Q9e=k.object({taskSupport:k.enum(["required","optional","forbidden"]).optional()}),ioe=k.object({...lf.shape,...oI.shape,description:k.string().optional(),inputSchema:k.object({type:k.literal("object"),properties:k.record(k.string(),$n).optional(),required:k.array(k.string()).optional()}).catchall(k.unknown()),outputSchema:k.object({type:k.literal("object"),properties:k.record(k.string(),$n).optional(),required:k.array(k.string()).optional()}).catchall(k.unknown()).optional(),annotations:y9e.optional(),execution:Q9e.optional(),_meta:k.record(k.string(),k.unknown()).optional()}),f_=aI.extend({method:k.literal("tools/list")}),h_=AI.extend({tools:k.array(ioe)}),Ru=Wn.extend({content:k.array(g_).default([]),structuredContent:k.record(k.string(),k.unknown()).optional(),isError:k.boolean().optional()}),$8t=Ru.or(Wn.extend({toolResult:k.unknown()})),D9e=iI.extend({name:k.string(),arguments:k.record(k.string(),k.unknown()).optional()}),gI=Vn.extend({method:k.literal("tools/call"),params:D9e}),m_=ao.extend({method:k.literal("notifications/tools/list_changed"),params:oo.optional()}),soe=k.object({autoRefresh:k.boolean().default(!0),debounceMs:k.number().int().nonnegative().default(300)}),pI=k.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),w9e=Rs.extend({level:pI}),C_=Vn.extend({method:k.literal("logging/setLevel"),params:w9e}),b9e=oo.extend({level:pI,logger:k.string().optional(),data:k.unknown()}),S9e=ao.extend({method:k.literal("notifications/message"),params:b9e}),v9e=k.object({name:k.string().optional()}),x9e=k.object({hints:k.array(v9e).optional(),costPriority:k.number().min(0).max(1).optional(),speedPriority:k.number().min(0).max(1).optional(),intelligencePriority:k.number().min(0).max(1).optional()}),F9e=k.object({mode:k.enum(["auto","required","none"]).optional()}),k9e=k.object({type:k.literal("tool_result"),toolUseId:k.string().describe("The unique identifier for the corresponding tool call."),content:k.array(g_).default([]),structuredContent:k.object({}).loose().optional(),isError:k.boolean().optional(),_meta:k.record(k.string(),k.unknown()).optional()}),R9e=k.discriminatedUnion("type",[c_,u_,l_]),u0=k.discriminatedUnion("type",[c_,u_,l_,C9e,k9e]),N9e=k.object({role:lI,content:k.union([u0,k.array(u0)]),_meta:k.record(k.string(),k.unknown()).optional()}),T9e=iI.extend({messages:k.array(N9e),modelPreferences:x9e.optional(),systemPrompt:k.string().optional(),includeContext:k.enum(["none","thisServer","allServers"]).optional(),temperature:k.number().optional(),maxTokens:k.number().int(),stopSequences:k.array(k.string()).optional(),metadata:$n.optional(),tools:k.array(ioe).optional(),toolChoice:F9e.optional()}),I_=Vn.extend({method:k.literal("sampling/createMessage"),params:T9e}),bg=Wn.extend({model:k.string(),stopReason:k.optional(k.enum(["endTurn","stopSequence","maxTokens"]).or(k.string())),role:lI,content:R9e}),dI=Wn.extend({model:k.string(),stopReason:k.optional(k.enum(["endTurn","stopSequence","maxTokens","toolUse"]).or(k.string())),role:lI,content:k.union([u0,k.array(u0)])}),M9e=k.object({type:k.literal("boolean"),title:k.string().optional(),description:k.string().optional(),default:k.boolean().optional()}),P9e=k.object({type:k.literal("string"),title:k.string().optional(),description:k.string().optional(),minLength:k.number().optional(),maxLength:k.number().optional(),format:k.enum(["email","uri","date","date-time"]).optional(),default:k.string().optional()}),L9e=k.object({type:k.enum(["number","integer"]),title:k.string().optional(),description:k.string().optional(),minimum:k.number().optional(),maximum:k.number().optional(),default:k.number().optional()}),_9e=k.object({type:k.literal("string"),title:k.string().optional(),description:k.string().optional(),enum:k.array(k.string()),default:k.string().optional()}),U9e=k.object({type:k.literal("string"),title:k.string().optional(),description:k.string().optional(),oneOf:k.array(k.object({const:k.string(),title:k.string()})),default:k.string().optional()}),G9e=k.object({type:k.literal("string"),title:k.string().optional(),description:k.string().optional(),enum:k.array(k.string()),enumNames:k.array(k.string()).optional(),default:k.string().optional()}),O9e=k.union([_9e,U9e]),K9e=k.object({type:k.literal("array"),title:k.string().optional(),description:k.string().optional(),minItems:k.number().optional(),maxItems:k.number().optional(),items:k.object({type:k.literal("string"),enum:k.array(k.string())}),default:k.array(k.string()).optional()}),H9e=k.object({type:k.literal("array"),title:k.string().optional(),description:k.string().optional(),minItems:k.number().optional(),maxItems:k.number().optional(),items:k.object({anyOf:k.array(k.object({const:k.string(),title:k.string()}))}),default:k.array(k.string()).optional()}),J9e=k.union([K9e,H9e]),Y9e=k.union([G9e,O9e,J9e]),j9e=k.union([Y9e,M9e,P9e,L9e]),q9e=iI.extend({mode:k.literal("form").optional(),message:k.string(),requestedSchema:k.object({type:k.literal("object"),properties:k.record(k.string(),j9e),required:k.array(k.string()).optional()})}),$9e=iI.extend({mode:k.literal("url"),message:k.string(),elicitationId:k.string(),url:k.string().url()}),V9e=k.union([q9e,$9e]),E_=Vn.extend({method:k.literal("elicitation/create"),params:V9e}),W9e=oo.extend({elicitationId:k.string()}),z9e=ao.extend({method:k.literal("notifications/elicitation/complete"),params:W9e}),Nu=Wn.extend({action:k.enum(["accept","decline","cancel"]),content:k.preprocess(t=>t===null?void 0:t,k.record(k.string(),k.union([k.string(),k.number(),k.boolean(),k.array(k.string())])).optional())}),X9e=k.object({type:k.literal("ref/resource"),uri:k.string()}),Z9e=k.object({type:k.literal("ref/prompt"),name:k.string()}),eje=Rs.extend({ref:k.union([Z9e,X9e]),argument:k.object({name:k.string(),value:k.string()}),context:k.object({arguments:k.record(k.string(),k.string()).optional()}).optional()}),tje=Vn.extend({method:k.literal("completion/complete"),params:eje}),B_=Wn.extend({completion:k.looseObject({values:k.array(k.string()).max(100),total:k.optional(k.number().int()),hasMore:k.optional(k.boolean())})}),rje=k.object({uri:k.string().startsWith("file://"),name:k.string().optional(),_meta:k.record(k.string(),k.unknown()).optional()}),nje=Vn.extend({method:k.literal("roots/list"),params:Rs.optional()}),y_=Wn.extend({roots:k.array(rje)}),ije=ao.extend({method:k.literal("notifications/roots/list_changed"),params:oo.optional()}),V8t=k.union([h0,zL,tje,C_,m9e,f9e,e_,r_,s_,A9e,u9e,gI,f_,C0,E0,B0,Q0]),W8t=k.union([d0,m0,f0,ije,uI]),z8t=k.union([sc,bg,dI,Nu,y_,I0,y0,oc]),X8t=k.union([h0,I_,E_,nje,C0,E0,B0,Q0]),Z8t=k.union([d0,m0,S9e,g9e,a_,m_,d_,uI,z9e]),e3t=k.union([sc,XL,B_,p_,A_,t_,n_,o_,Ru,h_,I0,y0,oc]),Ge=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===$e.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new qL(i.elicitations,r)}return new t(e,r,n)}},qL=class extends Ge{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super($e.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}});function Tu(t){return t==="completed"||t==="failed"||t==="cancelled"}var ooe=L(()=>{h()});var D0=L(()=>{h()});var Q_=L(()=>{h();D0()});var Mu=L(()=>{h()});var w0=L(()=>{h()});var Ao=L(()=>{h();w0()});var oje,D_=L(()=>{h();oje=require("zod/v3");Mu();dn()});var w_=L(()=>{h();Mu()});var b_=L(()=>{h()});var b0=L(()=>{h();dn()});var S_=L(()=>{h();dn()});var v_=L(()=>{h();Mu()});var x_=L(()=>{h();dn()});var F_=L(()=>{h();dn();Ao()});var k_=L(()=>{h()});var R_=L(()=>{h();dn()});var N_=L(()=>{h()});var z3t,S0=L(()=>{h();Mu();z3t=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});var cje,v0=L(()=>{h();cje=require("zod/v3");dn();S0();b0();Ao()});var T_=L(()=>{h();dn();v0();Ao()});var M_=L(()=>{h()});var P_=L(()=>{h();Ao()});var L_=L(()=>{h()});var x0=L(()=>{h();dn()});var __=L(()=>{h();dn();x0()});var U_=L(()=>{h();Mu()});var G_=L(()=>{h();dn()});var O_=L(()=>{h();dn();Ao()});var K_=L(()=>{h();dn()});var H_=L(()=>{h();dn()});var J_=L(()=>{h();Mu();dn()});var Y_=L(()=>{h();dn()});var j_=L(()=>{h();Ao()});var q_=L(()=>{h();Ao()});var $_=L(()=>{h();dn()});var lje,V_=L(()=>{h();lje=require("zod/v3");Ao();D_();w_();b_();b0();S_();v_();x_();F_();k_();R_();N_();T_();M_();P_();L_();__();U_();G_();O_();K_();H_();v0();J_();S0();Y_();j_();x0();q_();$_()});var dn=L(()=>{h();D0();V_();w0();Ao()});var aoe=L(()=>{h()});var W_=L(()=>{h();dn();Q_();Ao()});var Aoe=L(()=>{h();D0();Q_();Mu();w0();dn();aoe();Ao();D_();w_();b_();b0();S_();v_();x_();F_();k_();R_();N_();T_();M_();P_();L_();__();U_();G_();O_();K_();H_();$_();v0();J_();S0();Y_();j_();x0();q_();V_();W_();W_()});function z_(t){let r=uf(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Hse(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function X_(t,e){let r=Pi(t,e);if(!r.success)throw r.error;return r.data}var pje,coe=L(()=>{h();pje=z(require("zod/v4-mini"),1);nI();Aoe()});function uoe(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function F0(t,e){let r={...t};for(let n in e){let i=n,s=e[i];if(s===void 0)continue;let o=r[i];uoe(o)&&uoe(s)?r[i]={...o,...s}:r[i]=s}return r}var dje,pf,Z_=L(()=>{h();nI();ra();ooe();coe();dje=6e4,pf=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(d0,r=>{this._oncancel(r)}),this.setNotificationHandler(m0,r=>{this._onprogress(r)}),this.setRequestHandler(h0,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(C0,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new Ge($e.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(E0,async(r,n)=>{let i=async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(a.type==="response"||a.type==="error"){let A=a.message,c=A.id,u=this._requestResolvers.get(c);if(u)if(this._requestResolvers.delete(c),a.type==="response")u(A);else{let l=A,d=new Ge(l.error.code,l.error.message,l.error.data);u(d)}else{let l=a.type==="response"?"Response":"Error";this._onerror(new Error(`${l} handler missing for request ${c}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let o=await this._taskStore.getTask(s,n.sessionId);if(!o)throw new Ge($e.InvalidParams,`Task not found: ${s}`);if(!Tu(o.status))return await this._waitForTaskUpdate(s,n.signal),await i();if(Tu(o.status)){let a=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[Fu]:{taskId:s}}}}return await i()};return await i()}),this.setRequestHandler(B0,async(r,n)=>{try{let{tasks:i,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:s,_meta:{}}}catch(i){throw new Ge($e.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(Q0,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new Ge($e.InvalidParams,`Task not found: ${r.params.taskId}`);if(Tu(i.status))throw new Ge($e.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new Ge($e.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(i){throw i instanceof Ge?i:new Ge($e.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,i,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),Ge.fromError($e.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let i=this._transport?.onmessage;this._transport.onmessage=(s,o)=>{i?.(s,o),wg(s)||Wse(s)?this._onresponse(s):sI(s)?this._onrequest(s,o):Vse(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=Ge.fromError($e.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,s=e.params?._meta?.[Fu]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:$e.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:u,timestamp:Date.now()},i?.sessionId).catch(l=>this._onerror(new Error(`Failed to enqueue error response: ${l}`))):i?.send(u).catch(l=>this._onerror(new Error(`Failed to send an error response: ${l}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);let a=jse(e.params)?e.params.task:void 0,A=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,c={signal:o.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{if(o.signal.aborted)return;let l={relatedRequestId:e.id};s&&(l.relatedTask={taskId:s}),await this.notification(u,l)},sendRequest:async(u,l,d)=>{if(o.signal.aborted)throw new Ge($e.ConnectionClosed,"Request was cancelled");let g={...d,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let p=g.relatedTask?.taskId??s;return p&&A&&await A.updateTaskStatus(p,"input_required"),await this.request(u,l,g)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:A,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async u=>{if(o.signal.aborted)return;let l={result:u,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:l,timestamp:Date.now()},i?.sessionId):await i?.send(l)},async u=>{if(o.signal.aborted)return;let l={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:$e.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:l,timestamp:Date.now()},i?.sessionId):await i?.send(l)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),s=this._progressHandlers.get(i);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let o=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&o&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(A){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),o(A);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),wg(e))n(e);else{let o=new Ge(e.error.code,e.error.message,e.error.data);n(o)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(wg(e)&&e.result&&typeof e.result=="object"){let o=e.result;if(o.task&&typeof o.task=="object"){let a=o.task;typeof a.taskId=="string"&&(s=!0,this._taskProgressTokens.set(a.taskId,r))}}if(s||this._progressHandlers.delete(r),wg(e))i(e);else{let o=Ge.fromError(e.error.code,e.error.message,e.error.data);i(o)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(e,r,n)}}catch(o){yield{type:"error",error:o instanceof Ge?o:new Ge($e.InternalError,String(o))}}return}let s;try{let o=await this.request(e,oc,n);if(o.task)s=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new Ge($e.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:a},Tu(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:a.status==="failed"?yield{type:"error",error:new Ge($e.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new Ge($e.InternalError,`Task ${s} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let A=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(c=>setTimeout(c,A)),n?.signal?.throwIfAborted()}}catch(o){yield{type:"error",error:o instanceof Ge?o:new Ge($e.InternalError,String(o))}}}request(e,r,n){let{relatedRequestId:i,resumptionToken:s,onresumptiontoken:o,task:a,relatedTask:A}=n??{};return new Promise((c,u)=>{let l=I=>{u(I)};if(!this._transport){l(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(I){l(I);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),a&&(g.params={...g.params,task:a}),A&&(g.params={...g.params,_meta:{...g.params?._meta||{},[Fu]:A}});let p=I=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(I)}},{relatedRequestId:i,resumptionToken:s,onresumptiontoken:o}).catch(E=>this._onerror(new Error(`Failed to send cancellation: ${E}`)));let B=I instanceof Ge?I:new Ge($e.RequestTimeout,String(I));u(B)};this._responseHandlers.set(d,I=>{if(!n?.signal?.aborted){if(I instanceof Error)return u(I);try{let B=Pi(r,I.result);B.success?c(B.data):u(B.error)}catch(B){u(B)}}}),n?.signal?.addEventListener("abort",()=>{p(n?.signal?.reason)});let f=n?.timeout??dje,m=()=>p(Ge.fromError($e.RequestTimeout,"Request timed out",{timeout:f}));this._setupTimeout(d,f,n?.maxTotalTimeout,m,n?.resetTimeoutOnProgress??!1);let C=A?.taskId;if(C){let I=B=>{let E=this._responseHandlers.get(d);E?E(B):this._onerror(new Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,I),this._enqueueTaskMessage(C,{type:"request",message:g,timestamp:Date.now()}).catch(B=>{this._cleanupTimeout(d),u(B)})}else this._transport.send(g,{relatedRequestId:i,resumptionToken:s,onresumptiontoken:o}).catch(I=>{this._cleanupTimeout(d),u(I)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},I0,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},y0,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},Zse,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Fu]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Fu]:r.relatedTask}}}),this._transport?.send(a,r).catch(A=>this._onerror(A))});return}let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[Fu]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=z_(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,s)=>{let o=X_(e,i);return Promise.resolve(r(o,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=z_(e);this._notificationHandlers.set(n,i=>{let s=X_(e,i);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,i)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let i of n)if(i.type==="request"&&sI(i.message)){let s=i.message.id,o=this._requestResolvers.get(s);o?(o(new Ge($e.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(e);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,s)=>{if(r.aborted){s(new Ge($e.InvalidRequest,"Request cancelled"));return}let o=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(o),s(new Ge($e.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!e)throw new Error("No request provided");return await n.createTask(i,e.id,{method:e.method,params:e.params},r)},getTask:async i=>{let s=await n.getTask(i,r);if(!s)throw new Ge($e.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(i,s,o)=>{await n.storeTaskResult(i,s,o,r);let a=await n.getTask(i,r);if(a){let A=uI.parse({method:"notifications/tasks/status",params:a});await this.notification(A),Tu(a.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,s,o)=>{let a=await n.getTask(i,r);if(!a)throw new Ge($e.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(Tu(a.status))throw new Ge($e.InvalidParams,`Cannot update task "${i}" from terminal status "${a.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,s,o,r);let A=await n.getTask(i,r);if(A){let c=uI.parse({method:"notifications/tasks/status",params:A});await this.notification(c),Tu(A.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}}});var CI=R(Vt=>{"use strict";h();Object.defineProperty(Vt,"__esModule",{value:!0});Vt.regexpCode=Vt.getEsmExportName=Vt.getProperty=Vt.safeStringify=Vt.stringify=Vt.strConcat=Vt.addCodeArg=Vt.str=Vt._=Vt.nil=Vt._Code=Vt.Name=Vt.IDENTIFIER=Vt._CodeOrName=void 0;var hI=class{};Vt._CodeOrName=hI;Vt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Sg=class extends hI{constructor(e){if(super(),!Vt.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Vt.Name=Sg;var co=class extends hI{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Sg&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Vt._Code=co;Vt.nil=new co("");function loe(t,...e){let r=[t[0]],n=0;for(;n<e.length;)tU(r,e[n]),r.push(t[++n]);return new co(r)}Vt._=loe;var eU=new co("+");function goe(t,...e){let r=[mI(t[0])],n=0;for(;n<e.length;)r.push(eU),tU(r,e[n]),r.push(eU,mI(t[++n]));return fje(r),new co(r)}Vt.str=goe;function tU(t,e){e instanceof co?t.push(...e._items):e instanceof Sg?t.push(e):t.push(Cje(e))}Vt.addCodeArg=tU;function fje(t){let e=1;for(;e<t.length-1;){if(t[e]===eU){let r=hje(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function hje(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Sg||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Sg))return`"${t}${e.slice(1)}`}function mje(t,e){return e.emptyStr()?t:t.emptyStr()?e:goe`${t}${e}`}Vt.strConcat=mje;function Cje(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:mI(Array.isArray(t)?t.join(","):t)}function Ije(t){return new co(mI(t))}Vt.stringify=Ije;function mI(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Vt.safeStringify=mI;function Eje(t){return typeof t=="string"&&Vt.IDENTIFIER.test(t)?new co(`.${t}`):loe`[${t}]`}Vt.getProperty=Eje;function Bje(t){if(typeof t=="string"&&Vt.IDENTIFIER.test(t))return new co(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Vt.getEsmExportName=Bje;function yje(t){return new co(t.toString())}Vt.regexpCode=yje});var iU=R(as=>{"use strict";h();Object.defineProperty(as,"__esModule",{value:!0});as.ValueScope=as.ValueScopeName=as.Scope=as.varKinds=as.UsedValueState=void 0;var os=CI(),rU=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},k0;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(k0||(as.UsedValueState=k0={}));as.varKinds={const:new os.Name("const"),let:new os.Name("let"),var:new os.Name("var")};var R0=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof os.Name?e:this.name(e)}name(e){return new os.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};as.Scope=R0;var N0=class extends os.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,os._)`.${new os.Name(r)}[${n}]`}};as.ValueScopeName=N0;var Qje=(0,os._)`\n`,nU=class extends R0{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Qje:os.nil}}get(){return this._scope}name(e){return new N0(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let u=a.get(o);if(u)return u}else a=this._values[s]=new Map;a.set(o,i);let A=this._scope[s]||(this._scope[s]=[]),c=A.length;return A[c]=r.ref,i.setValue(r,{property:s,itemIndex:c}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,os._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=os.nil;for(let o in e){let a=e[o];if(!a)continue;let A=n[o]=n[o]||new Map;a.forEach(c=>{if(A.has(c))return;A.set(c,k0.Started);let u=r(c);if(u){let l=this.opts.es5?as.varKinds.var:as.varKinds.const;s=(0,os._)`${s}${l} ${c} = ${u};${this.opts._n}`}else if(u=i?.(c))s=(0,os._)`${s}${u}${this.opts._n}`;else throw new rU(c);A.set(c,k0.Completed)})}return s}};as.ValueScope=nU});var Et=R(bt=>{"use strict";h();Object.defineProperty(bt,"__esModule",{value:!0});bt.or=bt.and=bt.not=bt.CodeGen=bt.operators=bt.varKinds=bt.ValueScopeName=bt.ValueScope=bt.Scope=bt.Name=bt.regexpCode=bt.stringify=bt.getProperty=bt.nil=bt.strConcat=bt.str=bt._=void 0;var Ot=CI(),na=iU(),Pu=CI();Object.defineProperty(bt,"_",{enumerable:!0,get:function(){return Pu._}});Object.defineProperty(bt,"str",{enumerable:!0,get:function(){return Pu.str}});Object.defineProperty(bt,"strConcat",{enumerable:!0,get:function(){return Pu.strConcat}});Object.defineProperty(bt,"nil",{enumerable:!0,get:function(){return Pu.nil}});Object.defineProperty(bt,"getProperty",{enumerable:!0,get:function(){return Pu.getProperty}});Object.defineProperty(bt,"stringify",{enumerable:!0,get:function(){return Pu.stringify}});Object.defineProperty(bt,"regexpCode",{enumerable:!0,get:function(){return Pu.regexpCode}});Object.defineProperty(bt,"Name",{enumerable:!0,get:function(){return Pu.Name}});var L0=iU();Object.defineProperty(bt,"Scope",{enumerable:!0,get:function(){return L0.Scope}});Object.defineProperty(bt,"ValueScope",{enumerable:!0,get:function(){return L0.ValueScope}});Object.defineProperty(bt,"ValueScopeName",{enumerable:!0,get:function(){return L0.ValueScopeName}});Object.defineProperty(bt,"varKinds",{enumerable:!0,get:function(){return L0.varKinds}});bt.operators={GT:new Ot._Code(">"),GTE:new Ot._Code(">="),LT:new Ot._Code("<"),LTE:new Ot._Code("<="),EQ:new Ot._Code("==="),NEQ:new Ot._Code("!=="),NOT:new Ot._Code("!"),OR:new Ot._Code("||"),AND:new Ot._Code("&&"),ADD:new Ot._Code("+")};var Ac=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},sU=class extends Ac{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?na.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ff(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ot._CodeOrName?this.rhs.names:{}}},T0=class extends Ac{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Ot.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ff(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ot.Name?{}:{...this.lhs.names};return P0(e,this.rhs)}},oU=class extends T0{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},aU=class extends Ac{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},AU=class extends Ac{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},cU=class extends Ac{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},uU=class extends Ac{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ff(this.code,e,r),this}get names(){return this.code instanceof Ot._CodeOrName?this.code.names:{}}},II=class extends Ac{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(Dje(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Fg(e,r.names),{})}},cc=class extends II{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},lU=class extends II{},df=class extends cc{};df.kind="else";var vg=class t extends cc{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new df(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(poe(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ff(this.condition,e,r),this}get names(){let e=super.names;return P0(e,this.condition),this.else&&Fg(e,this.else.names),e}};vg.kind="if";var xg=class extends cc{};xg.kind="for";var gU=class extends xg{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ff(this.iteration,e,r),this}get names(){return Fg(super.names,this.iteration.names)}},pU=class extends xg{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?na.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=P0(super.names,this.from);return P0(e,this.to)}},M0=class extends xg{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ff(this.iterable,e,r),this}get names(){return Fg(super.names,this.iterable.names)}},EI=class extends cc{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};EI.kind="func";var BI=class extends II{render(e){return"return "+super.render(e)}};BI.kind="return";var dU=class extends cc{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Fg(e,this.catch.names),this.finally&&Fg(e,this.finally.names),e}},yI=class extends cc{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};yI.kind="catch";var QI=class extends cc{render(e){return"finally"+super.render(e)}};QI.kind="finally";var fU=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
1802
1802
|
`:""},this._extScope=e,this._scope=new na.Scope({parent:e}),this._nodes=[new lU]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new sU(e,s,n)),s}const(e,r,n){return this._def(na.varKinds.const,e,r,n)}let(e,r,n){return this._def(na.varKinds.let,e,r,n)}var(e,r,n){return this._def(na.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new T0(e,r,n))}add(e,r){return this._leafNode(new oU(e,bt.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ot.nil&&this._leafNode(new uU(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Ot.addCodeArg)(r,i));return r.push("}"),new Ot._Code(r)}if(e,r,n){if(this._blockNode(new vg(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new vg(e))}else(){return this._elseNode(new df)}endIf(){return this._endBlockNode(vg,df)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new gU(e),r)}forRange(e,r,n,i,s=this.opts.es5?na.varKinds.var:na.varKinds.let){let o=this._scope.toName(e);return this._for(new pU(s,o,r,n),()=>i(o))}forOf(e,r,n,i=na.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof Ot.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ot._)`${o}.length`,a=>{this.var(s,(0,Ot._)`${o}[${a}]`),n(s)})}return this._for(new M0("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?na.varKinds.var:na.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ot._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new M0("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(xg)}label(e){return this._leafNode(new aU(e))}break(e){return this._leafNode(new AU(e))}return(e){let r=new BI;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(BI)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new dU;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new yI(s),r(s)}return n&&(this._currNode=i.finally=new QI,this.code(n)),this._endBlockNode(yI,QI)}throw(e){return this._leafNode(new cU(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Ot.nil,n,i){return this._blockNode(new EI(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(EI)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof vg))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};bt.CodeGen=fU;function Fg(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function P0(t,e){return e instanceof Ot._CodeOrName?Fg(t,e.names):t}function ff(t,e,r){if(t instanceof Ot.Name)return n(t);if(!i(t))return t;return new Ot._Code(t._items.reduce((s,o)=>(o instanceof Ot.Name&&(o=n(o)),o instanceof Ot._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof Ot._Code&&s._items.some(o=>o instanceof Ot.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function Dje(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function poe(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ot._)`!${hU(t)}`}bt.not=poe;var wje=doe(bt.operators.AND);function bje(...t){return t.reduce(wje)}bt.and=bje;var Sje=doe(bt.operators.OR);function vje(...t){return t.reduce(Sje)}bt.or=vje;function doe(t){return(e,r)=>e===Ot.nil?r:r===Ot.nil?e:(0,Ot._)`${hU(e)} ${t} ${hU(r)}`}function hU(t){return t instanceof Ot.Name?t:(0,Ot._)`(${t})`}});var Yt=R(Ft=>{"use strict";h();Object.defineProperty(Ft,"__esModule",{value:!0});Ft.checkStrictMode=Ft.getErrorPath=Ft.Type=Ft.useFunc=Ft.setEvaluated=Ft.evaluatedPropsToName=Ft.mergeEvaluated=Ft.eachItem=Ft.unescapeJsonPointer=Ft.escapeJsonPointer=Ft.escapeFragment=Ft.unescapeFragment=Ft.schemaRefOrVal=Ft.schemaHasRulesButRef=Ft.schemaHasRules=Ft.checkUnknownRules=Ft.alwaysValidSchema=Ft.toHash=void 0;var lr=Et(),xje=CI();function Fje(t){let e={};for(let r of t)e[r]=!0;return e}Ft.toHash=Fje;function kje(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(moe(t,e),!Coe(e,t.self.RULES.all))}Ft.alwaysValidSchema=kje;function moe(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||Boe(t,`unknown keyword: "${s}"`)}Ft.checkUnknownRules=moe;function Coe(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ft.schemaHasRules=Coe;function Rje(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Ft.schemaHasRulesButRef=Rje;function Nje({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,lr._)`${r}`}return(0,lr._)`${t}${e}${(0,lr.getProperty)(n)}`}Ft.schemaRefOrVal=Nje;function Tje(t){return Ioe(decodeURIComponent(t))}Ft.unescapeFragment=Tje;function Mje(t){return encodeURIComponent(CU(t))}Ft.escapeFragment=Mje;function CU(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ft.escapeJsonPointer=CU;function Ioe(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ft.unescapeJsonPointer=Ioe;function Pje(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ft.eachItem=Pje;function foe({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,a)=>{let A=o===void 0?s:o instanceof lr.Name?(s instanceof lr.Name?t(i,s,o):e(i,s,o),o):s instanceof lr.Name?(e(i,o,s),s):r(s,o);return a===lr.Name&&!(A instanceof lr.Name)?n(i,A):A}}Ft.mergeEvaluated={props:foe({mergeNames:(t,e,r)=>t.if((0,lr._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,lr._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,lr._)`${r} || {}`).code((0,lr._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,lr._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,lr._)`${r} || {}`),IU(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Eoe}),items:foe({mergeNames:(t,e,r)=>t.if((0,lr._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,lr._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,lr._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,lr._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Eoe(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,lr._)`{}`);return e!==void 0&&IU(t,r,e),r}Ft.evaluatedPropsToName=Eoe;function IU(t,e,r){Object.keys(r).forEach(n=>t.assign((0,lr._)`${e}${(0,lr.getProperty)(n)}`,!0))}Ft.setEvaluated=IU;var hoe={};function Lje(t,e){return t.scopeValue("func",{ref:e,code:hoe[e.code]||(hoe[e.code]=new xje._Code(e.code))})}Ft.useFunc=Lje;var mU;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(mU||(Ft.Type=mU={}));function _je(t,e,r){if(t instanceof lr.Name){let n=e===mU.Num;return r?n?(0,lr._)`"[" + ${t} + "]"`:(0,lr._)`"['" + ${t} + "']"`:n?(0,lr._)`"/" + ${t}`:(0,lr._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,lr.getProperty)(t).toString():"/"+CU(t)}Ft.getErrorPath=_je;function Boe(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Ft.checkStrictMode=Boe});var uc=R(EU=>{"use strict";h();Object.defineProperty(EU,"__esModule",{value:!0});var yi=Et(),Uje={data:new yi.Name("data"),valCxt:new yi.Name("valCxt"),instancePath:new yi.Name("instancePath"),parentData:new yi.Name("parentData"),parentDataProperty:new yi.Name("parentDataProperty"),rootData:new yi.Name("rootData"),dynamicAnchors:new yi.Name("dynamicAnchors"),vErrors:new yi.Name("vErrors"),errors:new yi.Name("errors"),this:new yi.Name("this"),self:new yi.Name("self"),scope:new yi.Name("scope"),json:new yi.Name("json"),jsonPos:new yi.Name("jsonPos"),jsonLen:new yi.Name("jsonLen"),jsonPart:new yi.Name("jsonPart")};EU.default=Uje});var DI=R(Qi=>{"use strict";h();Object.defineProperty(Qi,"__esModule",{value:!0});Qi.extendErrors=Qi.resetErrorsCount=Qi.reportExtraError=Qi.reportError=Qi.keyword$DataError=Qi.keywordError=void 0;var jt=Et(),_0=Yt(),Li=uc();Qi.keywordError={message:({keyword:t})=>(0,jt.str)`must pass "${t}" keyword validation`};Qi.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,jt.str)`"${t}" keyword must be ${e} ($data)`:(0,jt.str)`"${t}" keyword is invalid ($data)`};function Gje(t,e=Qi.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:a}=i,A=Doe(t,e,r);n??(o||a)?yoe(s,A):Qoe(i,(0,jt._)`[${A}]`)}Qi.reportError=Gje;function Oje(t,e=Qi.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,a=Doe(t,e,r);yoe(i,a),s||o||Qoe(n,Li.default.vErrors)}Qi.reportExtraError=Oje;function Kje(t,e){t.assign(Li.default.errors,e),t.if((0,jt._)`${Li.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,jt._)`${Li.default.vErrors}.length`,e),()=>t.assign(Li.default.vErrors,null)))}Qi.resetErrorsCount=Kje;function Hje({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,Li.default.errors,a=>{t.const(o,(0,jt._)`${Li.default.vErrors}[${a}]`),t.if((0,jt._)`${o}.instancePath === undefined`,()=>t.assign((0,jt._)`${o}.instancePath`,(0,jt.strConcat)(Li.default.instancePath,s.errorPath))),t.assign((0,jt._)`${o}.schemaPath`,(0,jt.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,jt._)`${o}.schema`,r),t.assign((0,jt._)`${o}.data`,n))})}Qi.extendErrors=Hje;function yoe(t,e){let r=t.const("err",e);t.if((0,jt._)`${Li.default.vErrors} === null`,()=>t.assign(Li.default.vErrors,(0,jt._)`[${r}]`),(0,jt._)`${Li.default.vErrors}.push(${r})`),t.code((0,jt._)`${Li.default.errors}++`)}function Qoe(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,jt._)`new ${t.ValidationError}(${e})`):(r.assign((0,jt._)`${n}.errors`,e),r.return(!1))}var kg={keyword:new jt.Name("keyword"),schemaPath:new jt.Name("schemaPath"),params:new jt.Name("params"),propertyName:new jt.Name("propertyName"),message:new jt.Name("message"),schema:new jt.Name("schema"),parentSchema:new jt.Name("parentSchema")};function Doe(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,jt._)`{}`:Jje(t,e,r)}function Jje(t,e,r={}){let{gen:n,it:i}=t,s=[Yje(i,r),jje(t,r)];return qje(t,e,s),n.object(...s)}function Yje({errorPath:t},{instancePath:e}){let r=e?(0,jt.str)`${t}${(0,_0.getErrorPath)(e,_0.Type.Str)}`:t;return[Li.default.instancePath,(0,jt.strConcat)(Li.default.instancePath,r)]}function jje({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,jt.str)`${e}/${t}`;return r&&(i=(0,jt.str)`${i}${(0,_0.getErrorPath)(r,_0.Type.Str)}`),[kg.schemaPath,i]}function qje(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:a}=t,{opts:A,propertyName:c,topSchemaRef:u,schemaPath:l}=a;n.push([kg.keyword,i],[kg.params,typeof e=="function"?e(t):e||(0,jt._)`{}`]),A.messages&&n.push([kg.message,typeof r=="function"?r(t):r]),A.verbose&&n.push([kg.schema,o],[kg.parentSchema,(0,jt._)`${u}${l}`],[Li.default.data,s]),c&&n.push([kg.propertyName,c])}});var boe=R(hf=>{"use strict";h();Object.defineProperty(hf,"__esModule",{value:!0});hf.boolOrEmptySchema=hf.topBoolOrEmptySchema=void 0;var $je=DI(),Vje=Et(),Wje=uc(),zje={message:"boolean schema is false"};function Xje(t){let{gen:e,schema:r,validateName:n}=t;r===!1?woe(t,!1):typeof r=="object"&&r.$async===!0?e.return(Wje.default.data):(e.assign((0,Vje._)`${n}.errors`,null),e.return(!0))}hf.topBoolOrEmptySchema=Xje;function Zje(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),woe(t)):r.var(e,!0)}hf.boolOrEmptySchema=Zje;function woe(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,$je.reportError)(i,zje,void 0,e)}});var BU=R(mf=>{"use strict";h();Object.defineProperty(mf,"__esModule",{value:!0});mf.getRules=mf.isJSONType=void 0;var e6e=["string","number","integer","boolean","null","object","array"],t6e=new Set(e6e);function r6e(t){return typeof t=="string"&&t6e.has(t)}mf.isJSONType=r6e;function n6e(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}mf.getRules=n6e});var yU=R(Lu=>{"use strict";h();Object.defineProperty(Lu,"__esModule",{value:!0});Lu.shouldUseRule=Lu.shouldUseGroup=Lu.schemaHasRulesForType=void 0;function i6e({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Soe(t,n)}Lu.schemaHasRulesForType=i6e;function Soe(t,e){return e.rules.some(r=>voe(t,r))}Lu.shouldUseGroup=Soe;function voe(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Lu.shouldUseRule=voe});var wI=R(Di=>{"use strict";h();Object.defineProperty(Di,"__esModule",{value:!0});Di.reportTypeError=Di.checkDataTypes=Di.checkDataType=Di.coerceAndCheckDataType=Di.getJSONTypes=Di.getSchemaTypes=Di.DataType=void 0;var s6e=BU(),o6e=yU(),a6e=DI(),ht=Et(),xoe=Yt(),Cf;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Cf||(Di.DataType=Cf={}));function A6e(t){let e=Foe(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Di.getSchemaTypes=A6e;function Foe(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(s6e.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Di.getJSONTypes=Foe;function c6e(t,e){let{gen:r,data:n,opts:i}=t,s=u6e(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,o6e.schemaHasRulesForType)(t,e[0]));if(o){let a=DU(e,n,i.strictNumbers,Cf.Wrong);r.if(a,()=>{s.length?l6e(t,e,s):wU(t)})}return o}Di.coerceAndCheckDataType=c6e;var koe=new Set(["string","number","integer","boolean","null"]);function u6e(t,e){return e?t.filter(r=>koe.has(r)||e==="array"&&r==="array"):[]}function l6e(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,ht._)`typeof ${i}`),a=n.let("coerced",(0,ht._)`undefined`);s.coerceTypes==="array"&&n.if((0,ht._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,ht._)`${i}[0]`).assign(o,(0,ht._)`typeof ${i}`).if(DU(e,i,s.strictNumbers),()=>n.assign(a,i))),n.if((0,ht._)`${a} !== undefined`);for(let c of r)(koe.has(c)||c==="array"&&s.coerceTypes==="array")&&A(c);n.else(),wU(t),n.endIf(),n.if((0,ht._)`${a} !== undefined`,()=>{n.assign(i,a),g6e(t,a)});function A(c){switch(c){case"string":n.elseIf((0,ht._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,ht._)`"" + ${i}`).elseIf((0,ht._)`${i} === null`).assign(a,(0,ht._)`""`);return;case"number":n.elseIf((0,ht._)`${o} == "boolean" || ${i} === null
|
|
1803
1803
|
|| (${o} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,ht._)`+${i}`);return;case"integer":n.elseIf((0,ht._)`${o} === "boolean" || ${i} === null
|
|
1804
1804
|
|| (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,ht._)`+${i}`);return;case"boolean":n.elseIf((0,ht._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,ht._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf((0,ht._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf((0,ht._)`${o} === "string" || ${o} === "number"
|
|
1805
|
-
|| ${o} === "boolean" || ${i} === null`).assign(a,(0,ht._)`[${i}]`)}}}function g6e({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,ht._)`${e} !== undefined`,()=>t.assign((0,ht._)`${e}[${r}]`,n))}function QU(t,e,r,n=Cf.Correct){let i=n===Cf.Correct?ht.operators.EQ:ht.operators.NEQ,s;switch(t){case"null":return(0,ht._)`${e} ${i} null`;case"array":s=(0,ht._)`Array.isArray(${e})`;break;case"object":s=(0,ht._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,ht._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,ht._)`typeof ${e} ${i} ${t}`}return n===Cf.Correct?s:(0,ht.not)(s);function o(a=ht.nil){return(0,ht.and)((0,ht._)`typeof ${e} == "number"`,a,r?(0,ht._)`isFinite(${e})`:ht.nil)}}Di.checkDataType=QU;function DU(t,e,r,n){if(t.length===1)return QU(t[0],e,r,n);let i,s=(0,xoe.toHash)(t);if(s.array&&s.object){let o=(0,ht._)`typeof ${e} != "object"`;i=s.null?o:(0,ht._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=ht.nil;s.number&&delete s.integer;for(let o in s)i=(0,ht.and)(i,QU(o,e,r,n));return i}Di.checkDataTypes=DU;var p6e={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,ht._)`{type: ${t}}`:(0,ht._)`{type: ${e}}`};function wU(t){let e=d6e(t);(0,a6e.reportError)(e,p6e)}Di.reportTypeError=wU;function d6e(t){let{gen:e,data:r,schema:n}=t,i=(0,xoe.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Noe=R(U0=>{"use strict";h();Object.defineProperty(U0,"__esModule",{value:!0});U0.assignDefaults=void 0;var If=Et(),f6e=Yt();function h6e(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)Roe(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>Roe(t,s,i.default))}U0.assignDefaults=h6e;function Roe(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let a=(0,If._)`${s}${(0,If.getProperty)(e)}`;if(i){(0,f6e.checkStrictMode)(t,`default is ignored for: ${a}`);return}let A=(0,If._)`${a} === undefined`;o.useDefaults==="empty"&&(A=(0,If._)`${A} || ${a} === null || ${a} === ""`),n.if(A,(0,If._)`${a} = ${(0,If.stringify)(r)}`)}});var uo=R(Ar=>{"use strict";h();Object.defineProperty(Ar,"__esModule",{value:!0});Ar.validateUnion=Ar.validateArray=Ar.usePattern=Ar.callValidateCode=Ar.schemaProperties=Ar.allSchemaProperties=Ar.noPropertyInData=Ar.propertyInData=Ar.isOwnProperty=Ar.hasPropFunc=Ar.reportMissingProp=Ar.checkMissingProp=Ar.checkReportMissingProp=void 0;var br=Et(),bU=Yt(),_u=uc(),m6e=Yt();function C6e(t,e){let{gen:r,data:n,it:i}=t;r.if(vU(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,br._)`${e}`},!0),t.error()})}Ar.checkReportMissingProp=C6e;function I6e({gen:t,data:e,it:{opts:r}},n,i){return(0,br.or)(...n.map(s=>(0,br.and)(vU(t,e,s,r.ownProperties),(0,br._)`${i} = ${s}`)))}Ar.checkMissingProp=I6e;function E6e(t,e){t.setParams({missingProperty:e},!0),t.error()}Ar.reportMissingProp=E6e;function Toe(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,br._)`Object.prototype.hasOwnProperty`})}Ar.hasPropFunc=Toe;function SU(t,e,r){return(0,br._)`${Toe(t)}.call(${e}, ${r})`}Ar.isOwnProperty=SU;function B6e(t,e,r,n){let i=(0,br._)`${e}${(0,br.getProperty)(r)} !== undefined`;return n?(0,br._)`${i} && ${SU(t,e,r)}`:i}Ar.propertyInData=B6e;function vU(t,e,r,n){let i=(0,br._)`${e}${(0,br.getProperty)(r)} === undefined`;return n?(0,br.or)(i,(0,br.not)(SU(t,e,r))):i}Ar.noPropertyInData=vU;function Moe(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Ar.allSchemaProperties=Moe;function y6e(t,e){return Moe(e).filter(r=>!(0,bU.alwaysValidSchema)(t,e[r]))}Ar.schemaProperties=y6e;function Q6e({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},a,A,c){let u=c?(0,br._)`${t}, ${e}, ${n}${i}`:e,l=[[_u.default.instancePath,(0,br.strConcat)(_u.default.instancePath,s)],[_u.default.parentData,o.parentData],[_u.default.parentDataProperty,o.parentDataProperty],[_u.default.rootData,_u.default.rootData]];o.opts.dynamicRef&&l.push([_u.default.dynamicAnchors,_u.default.dynamicAnchors]);let d=(0,br._)`${u}, ${r.object(...l)}`;return A!==br.nil?(0,br._)`${a}.call(${A}, ${d})`:(0,br._)`${a}(${d})`}Ar.callValidateCode=Q6e;var D6e=(0,br._)`new RegExp`;function w6e({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,br._)`${i.code==="new RegExp"?D6e:(0,m6e.useFunc)(t,i)}(${r}, ${n})`})}Ar.usePattern=w6e;function b6e(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(s,!0),o(()=>e.break()),s;function o(a){let A=e.const("len",(0,br._)`${r}.length`);e.forRange("i",0,A,c=>{t.subschema({keyword:n,dataProp:c,dataPropType:bU.Type.Num},s),e.if((0,br.not)(s),a)})}}Ar.validateArray=b6e;function S6e(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(A=>(0,bU.alwaysValidSchema)(i,A))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((A,c)=>{let u=t.subschema({keyword:n,schemaProp:c,compositeRule:!0},a);e.assign(o,(0,br._)`${o} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,br.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}Ar.validateUnion=S6e});var _oe=R(nA=>{"use strict";h();Object.defineProperty(nA,"__esModule",{value:!0});nA.validateKeywordUsage=nA.validSchemaType=nA.funcKeywordCode=nA.macroKeywordCode=void 0;var _i=Et(),Rg=uc(),v6e=uo(),x6e=DI();function F6e(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,a=e.macro.call(o.self,i,s,o),A=Loe(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let c=r.name("valid");t.subschema({schema:a,schemaPath:_i.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:A,compositeRule:!0},c),t.pass(c,()=>t.error(!0))}nA.macroKeywordCode=F6e;function k6e(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:a,it:A}=t;N6e(A,e);let c=!a&&e.compile?e.compile.call(A.self,s,o,A):e.validate,u=Loe(n,i,c),l=n.let("valid");t.block$data(l,d),t.ok((r=e.valid)!==null&&r!==void 0?r:l);function d(){if(e.errors===!1)f(),e.modifying&&Poe(t),m(()=>t.error());else{let C=e.async?g():p();e.modifying&&Poe(t),m(()=>R6e(t,C))}}function g(){let C=n.let("ruleErrs",null);return n.try(()=>f((0,_i._)`await `),I=>n.assign(l,!1).if((0,_i._)`${I} instanceof ${A.ValidationError}`,()=>n.assign(C,(0,_i._)`${I}.errors`),()=>n.throw(I))),C}function p(){let C=(0,_i._)`${u}.errors`;return n.assign(C,null),f(_i.nil),C}function f(C=e.async?(0,_i._)`await `:_i.nil){let I=A.opts.passContext?Rg.default.this:Rg.default.self,B=!("compile"in e&&!a||e.schema===!1);n.assign(l,(0,_i._)`${C}${(0,v6e.callValidateCode)(t,u,I,B)}`,e.modifying)}function m(C){var I;n.if((0,_i.not)((I=e.valid)!==null&&I!==void 0?I:l),C)}}nA.funcKeywordCode=k6e;function Poe(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,_i._)`${n.parentData}[${n.parentDataProperty}]`))}function R6e(t,e){let{gen:r}=t;r.if((0,_i._)`Array.isArray(${e})`,()=>{r.assign(Rg.default.vErrors,(0,_i._)`${Rg.default.vErrors} === null ? ${e} : ${Rg.default.vErrors}.concat(${e})`).assign(Rg.default.errors,(0,_i._)`${Rg.default.vErrors}.length`),(0,x6e.extendErrors)(t)},()=>t.error())}function N6e({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Loe(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,_i.stringify)(r)})}function T6e(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}nA.validSchemaType=T6e;function M6e({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let o=i.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let A=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(A);else throw new Error(A)}}nA.validateKeywordUsage=M6e});var Goe=R(Uu=>{"use strict";h();Object.defineProperty(Uu,"__esModule",{value:!0});Uu.extendSubschemaMode=Uu.extendSubschemaData=Uu.getSubschema=void 0;var iA=Et(),Uoe=Yt();function P6e(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,iA._)`${t.schemaPath}${(0,iA.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,iA._)`${t.schemaPath}${(0,iA.getProperty)(e)}${(0,iA.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Uoe.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Uu.getSubschema=P6e;function L6e(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:c,dataPathArr:u,opts:l}=e,d=a.let("data",(0,iA._)`${e.data}${(0,iA.getProperty)(r)}`,!0);A(d),t.errorPath=(0,iA.str)`${c}${(0,Uoe.getErrorPath)(r,n,l.jsPropertySyntax)}`,t.parentDataProperty=(0,iA._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let c=i instanceof iA.Name?i:a.let("data",i,!0);A(c),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function A(c){t.data=c,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,c]}}Uu.extendSubschemaData=L6e;function _6e(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}Uu.extendSubschemaMode=_6e});var xU=R((VJt,Ooe)=>{"use strict";h();Ooe.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var Hoe=R((zJt,Koe)=>{"use strict";h();var Gu=Koe.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};G0(e,n,i,t,"",t)};Gu.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Gu.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Gu.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Gu.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function G0(t,e,r,n,i,s,o,a,A,c){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,a,A,c);for(var u in n){var l=n[u];if(Array.isArray(l)){if(u in Gu.arrayKeywords)for(var d=0;d<l.length;d++)G0(t,e,r,l[d],i+"/"+u+"/"+d,s,i,u,n,d)}else if(u in Gu.propsKeywords){if(l&&typeof l=="object")for(var g in l)G0(t,e,r,l[g],i+"/"+u+"/"+U6e(g),s,i,u,n,g)}else(u in Gu.keywords||t.allKeys&&!(u in Gu.skipKeywords))&&G0(t,e,r,l,i+"/"+u,s,i,u,n)}r(n,i,s,o,a,A,c)}}function U6e(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var bI=R(As=>{"use strict";h();Object.defineProperty(As,"__esModule",{value:!0});As.getSchemaRefs=As.resolveUrl=As.normalizeId=As._getFullPath=As.getFullPath=As.inlineRef=void 0;var G6e=Yt(),O6e=xU(),K6e=Hoe(),H6e=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function J6e(t,e=!0){return typeof t=="boolean"?!0:e===!0?!FU(t):e?Joe(t)<=e:!1}As.inlineRef=J6e;var Y6e=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function FU(t){for(let e in t){if(Y6e.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(FU)||typeof r=="object"&&FU(r))return!0}return!1}function Joe(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!H6e.has(r)&&(typeof t[r]=="object"&&(0,G6e.eachItem)(t[r],n=>e+=Joe(n)),e===1/0))return 1/0}return e}function Yoe(t,e="",r){r!==!1&&(e=Ef(e));let n=t.parse(e);return joe(t,n)}As.getFullPath=Yoe;function joe(t,e){return t.serialize(e).split("#")[0]+"#"}As._getFullPath=joe;var j6e=/#\/?$/;function Ef(t){return t?t.replace(j6e,""):""}As.normalizeId=Ef;function q6e(t,e,r){return r=Ef(r),t.resolve(e,r)}As.resolveUrl=q6e;var $6e=/^[a-z_][-a-z0-9._]*$/i;function V6e(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Ef(t[r]||e),s={"":i},o=Yoe(n,i,!1),a={},A=new Set;return K6e(t,{allKeys:!0},(l,d,g,p)=>{if(p===void 0)return;let f=o+d,m=s[p];typeof l[r]=="string"&&(m=C.call(this,l[r])),I.call(this,l.$anchor),I.call(this,l.$dynamicAnchor),s[d]=m;function C(B){let E=this.opts.uriResolver.resolve;if(B=Ef(m?E(m,B):B),A.has(B))throw u(B);A.add(B);let y=this.refs[B];return typeof y=="string"&&(y=this.refs[y]),typeof y=="object"?c(l,y.schema,B):B!==Ef(f)&&(B[0]==="#"?(c(l,a[B],B),a[B]=l):this.refs[B]=f),B}function I(B){if(typeof B=="string"){if(!$6e.test(B))throw new Error(`invalid anchor "${B}"`);C.call(this,`#${B}`)}}}),a;function c(l,d,g){if(d!==void 0&&!O6e(l,d))throw u(g)}function u(l){return new Error(`reference "${l}" resolves to more than one schema`)}}As.getSchemaRefs=V6e});var xI=R(Ou=>{"use strict";h();Object.defineProperty(Ou,"__esModule",{value:!0});Ou.getData=Ou.KeywordCxt=Ou.validateFunctionCode=void 0;var zoe=boe(),qoe=wI(),RU=yU(),O0=wI(),W6e=Noe(),vI=_oe(),kU=Goe(),je=Et(),ot=uc(),z6e=bI(),lc=Yt(),SI=DI();function X6e(t){if(eae(t)&&(tae(t),Zoe(t))){tqe(t);return}Xoe(t,()=>(0,zoe.topBoolOrEmptySchema)(t))}Ou.validateFunctionCode=X6e;function Xoe({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,je._)`${ot.default.data}, ${ot.default.valCxt}`,n.$async,()=>{t.code((0,je._)`"use strict"; ${$oe(r,i)}`),eqe(t,i),t.code(s)}):t.func(e,(0,je._)`${ot.default.data}, ${Z6e(i)}`,n.$async,()=>t.code($oe(r,i)).code(s))}function Z6e(t){return(0,je._)`{${ot.default.instancePath}="", ${ot.default.parentData}, ${ot.default.parentDataProperty}, ${ot.default.rootData}=${ot.default.data}${t.dynamicRef?(0,je._)`, ${ot.default.dynamicAnchors}={}`:je.nil}}={}`}function eqe(t,e){t.if(ot.default.valCxt,()=>{t.var(ot.default.instancePath,(0,je._)`${ot.default.valCxt}.${ot.default.instancePath}`),t.var(ot.default.parentData,(0,je._)`${ot.default.valCxt}.${ot.default.parentData}`),t.var(ot.default.parentDataProperty,(0,je._)`${ot.default.valCxt}.${ot.default.parentDataProperty}`),t.var(ot.default.rootData,(0,je._)`${ot.default.valCxt}.${ot.default.rootData}`),e.dynamicRef&&t.var(ot.default.dynamicAnchors,(0,je._)`${ot.default.valCxt}.${ot.default.dynamicAnchors}`)},()=>{t.var(ot.default.instancePath,(0,je._)`""`),t.var(ot.default.parentData,(0,je._)`undefined`),t.var(ot.default.parentDataProperty,(0,je._)`undefined`),t.var(ot.default.rootData,ot.default.data),e.dynamicRef&&t.var(ot.default.dynamicAnchors,(0,je._)`{}`)})}function tqe(t){let{schema:e,opts:r,gen:n}=t;Xoe(t,()=>{r.$comment&&e.$comment&&nae(t),oqe(t),n.let(ot.default.vErrors,null),n.let(ot.default.errors,0),r.unevaluated&&rqe(t),rae(t),cqe(t)})}function rqe(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,je._)`${r}.evaluated`),e.if((0,je._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,je._)`${t.evaluated}.props`,(0,je._)`undefined`)),e.if((0,je._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,je._)`${t.evaluated}.items`,(0,je._)`undefined`))}function $oe(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,je._)`/*# sourceURL=${r} */`:je.nil}function nqe(t,e){if(eae(t)&&(tae(t),Zoe(t))){iqe(t,e);return}(0,zoe.boolOrEmptySchema)(t,e)}function Zoe({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function eae(t){return typeof t.schema!="boolean"}function iqe(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&nae(t),aqe(t),Aqe(t);let s=n.const("_errs",ot.default.errors);rae(t,s),n.var(e,(0,je._)`${s} === ${ot.default.errors}`)}function tae(t){(0,lc.checkUnknownRules)(t),sqe(t)}function rae(t,e){if(t.opts.jtd)return Voe(t,[],!1,e);let r=(0,qoe.getSchemaTypes)(t.schema),n=(0,qoe.coerceAndCheckDataType)(t,r);Voe(t,r,!n,e)}function sqe(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,lc.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function oqe(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,lc.checkStrictMode)(t,"default is ignored in the schema root")}function aqe(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,z6e.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Aqe(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function nae({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,je._)`${ot.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,je.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,je._)`${ot.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function cqe(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,je._)`${ot.default.errors} === 0`,()=>e.return(ot.default.data),()=>e.throw((0,je._)`new ${i}(${ot.default.vErrors})`)):(e.assign((0,je._)`${n}.errors`,ot.default.vErrors),s.unevaluated&&uqe(t),e.return((0,je._)`${ot.default.errors} === 0`))}function uqe({gen:t,evaluated:e,props:r,items:n}){r instanceof je.Name&&t.assign((0,je._)`${e}.props`,r),n instanceof je.Name&&t.assign((0,je._)`${e}.items`,n)}function Voe(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:a,opts:A,self:c}=t,{RULES:u}=c;if(s.$ref&&(A.ignoreKeywordsWithRef||!(0,lc.schemaHasRulesButRef)(s,u))){i.block(()=>sae(t,"$ref",u.all.$ref.definition));return}A.jtd||lqe(t,e),i.block(()=>{for(let d of u.rules)l(d);l(u.post)});function l(d){(0,RU.shouldUseGroup)(s,d)&&(d.type?(i.if((0,O0.checkDataType)(d.type,o,A.strictNumbers)),Woe(t,d),e.length===1&&e[0]===d.type&&r&&(i.else(),(0,O0.reportTypeError)(t)),i.endIf()):Woe(t,d),a||i.if((0,je._)`${ot.default.errors} === ${n||0}`))}}function Woe(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,W6e.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,RU.shouldUseRule)(n,s)&&sae(t,s.keyword,s.definition,e.type)})}function lqe(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(gqe(t,e),t.opts.allowUnionTypes||pqe(t,e),dqe(t,t.dataTypes))}function gqe(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{iae(t.dataTypes,r)||NU(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),hqe(t,e)}}function pqe(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&NU(t,"use allowUnionTypes to allow union type keyword")}function dqe(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,RU.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>fqe(e,o))&&NU(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function fqe(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function iae(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function hqe(t,e){let r=[];for(let n of t.dataTypes)iae(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function NU(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,lc.checkStrictMode)(t,e,t.opts.strictTypes)}var K0=class{constructor(e,r,n){if((0,vI.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,lc.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",oae(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,vI.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",ot.default.errors))}result(e,r,n){this.failResult((0,je.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,je.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,je._)`${r} !== undefined && (${(0,je.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?SI.reportExtraError:SI.reportError)(this,this.def.error,r)}$dataError(){(0,SI.reportError)(this,this.def.$dataError||SI.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,SI.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=je.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=je.nil,r=je.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,je.or)((0,je._)`${i} === undefined`,r)),e!==je.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==je.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,je.or)(o(),a());function o(){if(n.length){if(!(r instanceof je.Name))throw new Error("ajv implementation error");let A=Array.isArray(n)?n:[n];return(0,je._)`${(0,O0.checkDataTypes)(A,r,s.opts.strictNumbers,O0.DataType.Wrong)}`}return je.nil}function a(){if(i.validateSchema){let A=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,je._)`!${A}(${r})`}return je.nil}}subschema(e,r){let n=(0,kU.getSubschema)(this.it,e);(0,kU.extendSubschemaData)(n,this.it,e),(0,kU.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return nqe(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=lc.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=lc.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,je.Name)),!0}};Ou.KeywordCxt=K0;function sae(t,e,r,n){let i=new K0(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,vI.funcKeywordCode)(i,r):"macro"in r?(0,vI.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,vI.funcKeywordCode)(i,r)}var mqe=/^\/(?:[^~]|~0|~1)*$/,Cqe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oae(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return ot.default.rootData;if(t[0]==="/"){if(!mqe.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=ot.default.rootData}else{let c=Cqe.exec(t);if(!c)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+c[1];if(i=c[2],i==="#"){if(u>=e)throw new Error(A("property/index",u));return n[e-u]}if(u>e)throw new Error(A("data",u));if(s=r[e-u],!i)return s}let o=s,a=i.split("/");for(let c of a)c&&(s=(0,je._)`${s}${(0,je.getProperty)((0,lc.unescapeJsonPointer)(c))}`,o=(0,je._)`${o} && ${s}`);return o;function A(c,u){return`Cannot access ${c} ${u} levels up, current level is ${e}`}}Ou.getData=oae});var H0=R(MU=>{"use strict";h();Object.defineProperty(MU,"__esModule",{value:!0});var TU=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};MU.default=TU});var FI=R(_U=>{"use strict";h();Object.defineProperty(_U,"__esModule",{value:!0});var PU=bI(),LU=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,PU.resolveUrl)(e,r,n),this.missingSchema=(0,PU.normalizeId)((0,PU.getFullPath)(e,this.missingRef))}};_U.default=LU});var Y0=R(lo=>{"use strict";h();Object.defineProperty(lo,"__esModule",{value:!0});lo.resolveSchema=lo.getCompilingSchema=lo.resolveRef=lo.compileSchema=lo.SchemaEnv=void 0;var ia=Et(),Iqe=H0(),Ng=uc(),sa=bI(),aae=Yt(),Eqe=xI(),Bf=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,sa.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};lo.SchemaEnv=Bf;function GU(t){let e=Aae.call(this,t);if(e)return e;let r=(0,sa.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new ia.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),a;t.$async&&(a=o.scopeValue("Error",{ref:Iqe.default,code:(0,ia._)`require("ajv/dist/runtime/validation_error").default`}));let A=o.scopeName("validate");t.validateName=A;let c={gen:o,allErrors:this.opts.allErrors,data:Ng.default.data,parentData:Ng.default.parentData,parentDataProperty:Ng.default.parentDataProperty,dataNames:[Ng.default.data],dataPathArr:[ia.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,ia.stringify)(t.schema)}:{ref:t.schema}),validateName:A,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:ia.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ia._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,Eqe.validateFunctionCode)(c),o.optimize(this.opts.code.optimize);let l=o.toString();u=`${o.scopeRefs(Ng.default.scope)}return ${l}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let g=new Function(`${Ng.default.self}`,`${Ng.default.scope}`,u)(this,this.scope.get());if(this.scope.value(A,{ref:g}),g.errors=null,g.schema=t.schema,g.schemaEnv=t,t.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:A,validateCode:l,scopeValues:o._values}),this.opts.unevaluated){let{props:p,items:f}=c;g.evaluated={props:p instanceof ia.Name?void 0:p,items:f instanceof ia.Name?void 0:f,dynamicProps:p instanceof ia.Name,dynamicItems:f instanceof ia.Name},g.source&&(g.source.evaluated=(0,ia.stringify)(g.evaluated))}return t.validate=g,t}catch(l){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),l}finally{this._compilations.delete(t)}}lo.compileSchema=GU;function Bqe(t,e,r){var n;r=(0,sa.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=Dqe.call(this,t,r);if(s===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(s=new Bf({schema:o,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=yqe.call(this,s)}lo.resolveRef=Bqe;function yqe(t){return(0,sa.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:GU.call(this,t)}function Aae(t){for(let e of this._compilations)if(Qqe(e,t))return e}lo.getCompilingSchema=Aae;function Qqe(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Dqe(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||J0.call(this,t,e)}function J0(t,e){let r=this.opts.uriResolver.parse(e),n=(0,sa._getFullPath)(this.opts.uriResolver,r),i=(0,sa.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return UU.call(this,r,t);let s=(0,sa.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=J0.call(this,t,o);return typeof a?.schema!="object"?void 0:UU.call(this,r,a)}if(typeof o?.schema=="object"){if(o.validate||GU.call(this,o),s===(0,sa.normalizeId)(e)){let{schema:a}=o,{schemaId:A}=this.opts,c=a[A];return c&&(i=(0,sa.resolveUrl)(this.opts.uriResolver,i,c)),new Bf({schema:a,schemaId:A,root:t,baseId:i})}return UU.call(this,r,o)}}lo.resolveSchema=J0;var wqe=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function UU(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let A=r[(0,aae.unescapeFragment)(a)];if(A===void 0)return;r=A;let c=typeof r=="object"&&r[this.opts.schemaId];!wqe.has(a)&&c&&(e=(0,sa.resolveUrl)(this.opts.uriResolver,e,c))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,aae.schemaHasRulesButRef)(r,this.RULES)){let a=(0,sa.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=J0.call(this,n,a)}let{schemaId:o}=this.opts;if(s=s||new Bf({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var cae=R((c9t,bqe)=>{bqe.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var KU=R((u9t,pae)=>{"use strict";h();var Sqe=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),lae=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function OU(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var vqe=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function uae(t){return t.length=0,!0}function xqe(t,e,r){if(t.length){let n=OU(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function Fqe(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,a=xqe;for(let A=0;A<t.length;A++){let c=t[A];if(!(c==="["||c==="]"))if(c===":"){if(s===!0&&(o=!0),!a(i,n,r))break;if(++e>7){r.error=!0;break}A>0&&t[A-1]===":"&&(s=!0),n.push(":");continue}else if(c==="%"){if(!a(i,n,r))break;a=uae}else{i.push(c);continue}}return i.length&&(a===uae?r.zone=i.join(""):o?n.push(i.join("")):n.push(OU(i))),r.address=n.join(""),r}function gae(t){if(kqe(t,":")<2)return{host:t,isIPV6:!1};let e=Fqe(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function kqe(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function Rqe(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function Nqe(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function Tqe(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!lae(r)){let n=gae(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}pae.exports={nonSimpleDomain:vqe,recomposeAuthority:Tqe,normalizeComponentEncoding:Nqe,removeDotSegments:Rqe,isIPv4:lae,isUUID:Sqe,normalizeIPv6:gae,stringArrayToHexStripped:OU}});var Cae=R((g9t,mae)=>{"use strict";h();var{isUUID:Mqe}=KU(),Pqe=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Lqe=["http","https","ws","wss","urn","urn:uuid"];function _qe(t){return Lqe.indexOf(t)!==-1}function HU(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function dae(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function fae(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function Uqe(t){return t.secure=HU(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function Gqe(t){if((t.port===(HU(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function Oqe(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(Pqe);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=JU(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function Kqe(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=JU(i);s&&(t=s.serialize(t,e));let o=t,a=t.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function Hqe(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Mqe(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Jqe(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var hae={scheme:"http",domainHost:!0,parse:dae,serialize:fae},Yqe={scheme:"https",domainHost:hae.domainHost,parse:dae,serialize:fae},j0={scheme:"ws",domainHost:!0,parse:Uqe,serialize:Gqe},jqe={scheme:"wss",domainHost:j0.domainHost,parse:j0.parse,serialize:j0.serialize},qqe={scheme:"urn",parse:Oqe,serialize:Kqe,skipNormalize:!0},$qe={scheme:"urn:uuid",parse:Hqe,serialize:Jqe,skipNormalize:!0},q0={http:hae,https:Yqe,ws:j0,wss:jqe,urn:qqe,"urn:uuid":$qe};Object.setPrototypeOf(q0,null);function JU(t){return t&&(q0[t]||q0[t.toLowerCase()])||void 0}mae.exports={wsIsSecure:HU,SCHEMES:q0,isValidSchemeName:_qe,getSchemeHandler:JU}});var Bae=R((d9t,V0)=>{"use strict";h();var{normalizeIPv6:Vqe,removeDotSegments:kI,recomposeAuthority:Wqe,normalizeComponentEncoding:$0,isIPv4:zqe,nonSimpleDomain:Xqe}=KU(),{SCHEMES:Zqe,getSchemeHandler:Iae}=Cae();function e5e(t,e){return typeof t=="string"?t=sA(gc(t,e),e):typeof t=="object"&&(t=gc(sA(t,e),e)),t}function t5e(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Eae(gc(t,n),gc(e,n),n,!0);return n.skipEscape=!0,sA(i,n)}function Eae(t,e,r,n){let i={};return n||(t=gc(sA(t,r),r),e=gc(sA(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=kI(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=kI(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=kI(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=kI(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function r5e(t,e,r){return typeof t=="string"?(t=unescape(t),t=sA($0(gc(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=sA($0(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=sA($0(gc(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=sA($0(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function sA(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=Iae(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=Wqe(r);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=kI(a)),o===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var n5e=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function gc(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(n5e);if(s){if(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]),n.host)if(zqe(n.host)===!1){let A=Vqe(n.host);n.host=A.host.toLowerCase(),i=A.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let o=Iae(r.scheme||n.scheme);if(!r.unicodeSupport&&(!o||!o.unicodeSupport)&&n.host&&(r.domainHost||o&&o.domainHost)&&i===!1&&Xqe(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!o||o&&!o.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),o&&o.parse&&o.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var YU={SCHEMES:Zqe,normalize:e5e,resolve:t5e,resolveComponent:Eae,equal:r5e,serialize:sA,parse:gc};V0.exports=YU;V0.exports.default=YU;V0.exports.fastUri=YU});var Qae=R(jU=>{"use strict";h();Object.defineProperty(jU,"__esModule",{value:!0});var yae=Bae();yae.code='require("ajv/dist/runtime/uri").default';jU.default=yae});var kae=R(Xn=>{"use strict";h();Object.defineProperty(Xn,"__esModule",{value:!0});Xn.CodeGen=Xn.Name=Xn.nil=Xn.stringify=Xn.str=Xn._=Xn.KeywordCxt=void 0;var i5e=xI();Object.defineProperty(Xn,"KeywordCxt",{enumerable:!0,get:function(){return i5e.KeywordCxt}});var yf=Et();Object.defineProperty(Xn,"_",{enumerable:!0,get:function(){return yf._}});Object.defineProperty(Xn,"str",{enumerable:!0,get:function(){return yf.str}});Object.defineProperty(Xn,"stringify",{enumerable:!0,get:function(){return yf.stringify}});Object.defineProperty(Xn,"nil",{enumerable:!0,get:function(){return yf.nil}});Object.defineProperty(Xn,"Name",{enumerable:!0,get:function(){return yf.Name}});Object.defineProperty(Xn,"CodeGen",{enumerable:!0,get:function(){return yf.CodeGen}});var s5e=H0(),vae=FI(),o5e=BU(),RI=Y0(),a5e=Et(),NI=bI(),W0=wI(),$U=Yt(),Dae=cae(),A5e=Qae(),xae=(t,e)=>new RegExp(t,e);xae.code="new RegExp";var c5e=["removeAdditional","useDefaults","coerceTypes"],u5e=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),l5e={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g5e={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},wae=200;function p5e(t){var e,r,n,i,s,o,a,A,c,u,l,d,g,p,f,m,C,I,B,E,y,Q,w,D,x;let S=t.strict,v=(e=t.code)===null||e===void 0?void 0:e.optimize,P=v===!0||v===void 0?1:v||0,$=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:xae,H=(i=t.uriResolver)!==null&&i!==void 0?i:A5e.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:S)!==null&&o!==void 0?o:!0,strictNumbers:(A=(a=t.strictNumbers)!==null&&a!==void 0?a:S)!==null&&A!==void 0?A:!0,strictTypes:(u=(c=t.strictTypes)!==null&&c!==void 0?c:S)!==null&&u!==void 0?u:"log",strictTuples:(d=(l=t.strictTuples)!==null&&l!==void 0?l:S)!==null&&d!==void 0?d:"log",strictRequired:(p=(g=t.strictRequired)!==null&&g!==void 0?g:S)!==null&&p!==void 0?p:!1,code:t.code?{...t.code,optimize:P,regExp:$}:{optimize:P,regExp:$},loopRequired:(f=t.loopRequired)!==null&&f!==void 0?f:wae,loopEnum:(m=t.loopEnum)!==null&&m!==void 0?m:wae,meta:(C=t.meta)!==null&&C!==void 0?C:!0,messages:(I=t.messages)!==null&&I!==void 0?I:!0,inlineRefs:(B=t.inlineRefs)!==null&&B!==void 0?B:!0,schemaId:(E=t.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(y=t.addUsedSchema)!==null&&y!==void 0?y:!0,validateSchema:(Q=t.validateSchema)!==null&&Q!==void 0?Q:!0,validateFormats:(w=t.validateFormats)!==null&&w!==void 0?w:!0,unicodeRegExp:(D=t.unicodeRegExp)!==null&&D!==void 0?D:!0,int32range:(x=t.int32range)!==null&&x!==void 0?x:!0,uriResolver:H}}var TI=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...p5e(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new a5e.ValueScope({scope:{},prefixes:u5e,es5:r,lines:n}),this.logger=I5e(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o5e.getRules)(),bae.call(this,l5e,e,"NOT SUPPORTED"),bae.call(this,g5e,e,"DEPRECATED","warn"),this._metaOpts=m5e.call(this),e.formats&&f5e.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&h5e.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),d5e.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Dae;n==="id"&&(i={...Dae},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,l){await s.call(this,u.$schema);let d=this._addSchema(u,l);return d.validate||o.call(this,d)}async function s(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(l){if(!(l instanceof vae.default))throw l;return a.call(this,l),await A.call(this,l.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:l}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${l} cannot be resolved`)}async function A(u){let l=await c.call(this,u);this.refs[u]||await s.call(this,l.$schema),this.refs[u]||this.addSchema(l,u,r)}async function c(u){let l=this._loading[u];if(l)return l;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,NI.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=Sae.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new RI.SchemaEnv({schema:{},schemaId:n});if(r=RI.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Sae.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,NI.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(B5e.call(this,n,r),!r)return(0,$U.eachItem)(n,s=>qU.call(this,s)),this;Q5e.call(this,r);let i={...r,type:(0,W0.getJSONTypes)(r.type),schemaType:(0,W0.getJSONTypes)(r.schemaType)};return(0,$U.eachItem)(n,i.type.length===0?s=>qU.call(this,s,i):s=>i.type.forEach(o=>qU.call(this,s,i,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in n){let A=n[a];if(typeof A!="object")continue;let{$data:c}=A.definition,u=o[a];c&&u&&(o[a]=Fae(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let A=this._cache.get(e);if(A!==void 0)return A;n=(0,NI.normalizeId)(o||n);let c=NI.getSchemaRefs.call(this,e,n);return A=new RI.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:c}),this._cache.set(A.schema,A),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=A),i&&this.validateSchema(e,!0),A}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):RI.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{RI.compileSchema.call(this,e)}finally{this.opts=r}}};TI.ValidationError=s5e.default;TI.MissingRefError=vae.default;Xn.default=TI;function bae(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function Sae(t){return t=(0,NI.normalizeId)(t),this.schemas[t]||this.refs[t]}function d5e(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function f5e(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function h5e(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function m5e(){let t={...this.opts};for(let e of c5e)delete t[e];return t}var C5e={log(){},warn(){},error(){}};function I5e(t){if(t===!1)return C5e;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var E5e=/^[a-z_$][a-z0-9_$:-]*$/i;function B5e(t,e){let{RULES:r}=this;if((0,$U.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!E5e.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function qU(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:A})=>A===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,W0.getJSONTypes)(e.type),schemaType:(0,W0.getJSONTypes)(e.schemaType)}};e.before?y5e.call(this,o,a,e.before):o.rules.push(a),s.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(A=>this.addKeyword(A))}function y5e(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Q5e(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Fae(e)),t.validateSchema=this.compile(e,!0))}var D5e={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Fae(t){return{anyOf:[t,D5e]}}});var Rae=R(VU=>{"use strict";h();Object.defineProperty(VU,"__esModule",{value:!0});var w5e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};VU.default=w5e});var Pae=R(Tg=>{"use strict";h();Object.defineProperty(Tg,"__esModule",{value:!0});Tg.callRef=Tg.getValidate=void 0;var b5e=FI(),Nae=uo(),cs=Et(),Qf=uc(),Tae=Y0(),z0=Yt(),S5e={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:A}=n,{root:c}=s;if((r==="#"||r==="#/")&&i===c.baseId)return l();let u=Tae.resolveRef.call(A,c,i,r);if(u===void 0)throw new b5e.default(n.opts.uriResolver,i,r);if(u instanceof Tae.SchemaEnv)return d(u);return g(u);function l(){if(s===c)return X0(t,o,s,s.$async);let p=e.scopeValue("root",{ref:c});return X0(t,(0,cs._)`${p}.validate`,c,c.$async)}function d(p){let f=Mae(t,p);X0(t,f,p,p.$async)}function g(p){let f=e.scopeValue("schema",a.code.source===!0?{ref:p,code:(0,cs.stringify)(p)}:{ref:p}),m=e.name("valid"),C=t.subschema({schema:p,dataTypes:[],schemaPath:cs.nil,topSchemaRef:f,errSchemaPath:r},m);t.mergeEvaluated(C),t.ok(m)}}};function Mae(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,cs._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Tg.getValidate=Mae;function X0(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:a,opts:A}=s,c=A.passContext?Qf.default.this:cs.nil;n?u():l();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let p=i.let("valid");i.try(()=>{i.code((0,cs._)`await ${(0,Nae.callValidateCode)(t,e,c)}`),g(e),o||i.assign(p,!0)},f=>{i.if((0,cs._)`!(${f} instanceof ${s.ValidationError})`,()=>i.throw(f)),d(f),o||i.assign(p,!1)}),t.ok(p)}function l(){t.result((0,Nae.callValidateCode)(t,e,c),()=>g(e),()=>d(e))}function d(p){let f=(0,cs._)`${p}.errors`;i.assign(Qf.default.vErrors,(0,cs._)`${Qf.default.vErrors} === null ? ${f} : ${Qf.default.vErrors}.concat(${f})`),i.assign(Qf.default.errors,(0,cs._)`${Qf.default.vErrors}.length`)}function g(p){var f;if(!s.opts.unevaluated)return;let m=(f=r?.validate)===null||f===void 0?void 0:f.evaluated;if(s.props!==!0)if(m&&!m.dynamicProps)m.props!==void 0&&(s.props=z0.mergeEvaluated.props(i,m.props,s.props));else{let C=i.var("props",(0,cs._)`${p}.evaluated.props`);s.props=z0.mergeEvaluated.props(i,C,s.props,cs.Name)}if(s.items!==!0)if(m&&!m.dynamicItems)m.items!==void 0&&(s.items=z0.mergeEvaluated.items(i,m.items,s.items));else{let C=i.var("items",(0,cs._)`${p}.evaluated.items`);s.items=z0.mergeEvaluated.items(i,C,s.items,cs.Name)}}}Tg.callRef=X0;Tg.default=S5e});var Lae=R(WU=>{"use strict";h();Object.defineProperty(WU,"__esModule",{value:!0});var v5e=Rae(),x5e=Pae(),F5e=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",v5e.default,x5e.default];WU.default=F5e});var _ae=R(zU=>{"use strict";h();Object.defineProperty(zU,"__esModule",{value:!0});var Z0=Et(),Ku=Z0.operators,eb={maximum:{okStr:"<=",ok:Ku.LTE,fail:Ku.GT},minimum:{okStr:">=",ok:Ku.GTE,fail:Ku.LT},exclusiveMaximum:{okStr:"<",ok:Ku.LT,fail:Ku.GTE},exclusiveMinimum:{okStr:">",ok:Ku.GT,fail:Ku.LTE}},k5e={message:({keyword:t,schemaCode:e})=>(0,Z0.str)`must be ${eb[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Z0._)`{comparison: ${eb[t].okStr}, limit: ${e}}`},R5e={keyword:Object.keys(eb),type:"number",schemaType:"number",$data:!0,error:k5e,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Z0._)`${r} ${eb[e].fail} ${n} || isNaN(${r})`)}};zU.default=R5e});var Uae=R(XU=>{"use strict";h();Object.defineProperty(XU,"__esModule",{value:!0});var MI=Et(),N5e={message:({schemaCode:t})=>(0,MI.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,MI._)`{multipleOf: ${t}}`},T5e={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:N5e,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),a=s?(0,MI._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,MI._)`${o} !== parseInt(${o})`;t.fail$data((0,MI._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};XU.default=T5e});var Oae=R(ZU=>{"use strict";h();Object.defineProperty(ZU,"__esModule",{value:!0});function Gae(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}ZU.default=Gae;Gae.code='require("ajv/dist/runtime/ucs2length").default'});var Kae=R(e2=>{"use strict";h();Object.defineProperty(e2,"__esModule",{value:!0});var Mg=Et(),M5e=Yt(),P5e=Oae(),L5e={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Mg.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Mg._)`{limit: ${t}}`},_5e={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:L5e,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Mg.operators.GT:Mg.operators.LT,o=i.opts.unicode===!1?(0,Mg._)`${r}.length`:(0,Mg._)`${(0,M5e.useFunc)(t.gen,P5e.default)}(${r})`;t.fail$data((0,Mg._)`${o} ${s} ${n}`)}};e2.default=_5e});var Hae=R(t2=>{"use strict";h();Object.defineProperty(t2,"__esModule",{value:!0});var U5e=uo(),G5e=Yt(),Df=Et(),O5e={message:({schemaCode:t})=>(0,Df.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Df._)`{pattern: ${t}}`},K5e={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:O5e,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t,a=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:A}=o.opts.code,c=A.code==="new RegExp"?(0,Df._)`new RegExp`:(0,G5e.useFunc)(e,A),u=e.let("valid");e.try(()=>e.assign(u,(0,Df._)`${c}(${s}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Df._)`!${u}`)}else{let A=(0,U5e.usePattern)(t,i);t.fail$data((0,Df._)`!${A}.test(${r})`)}}};t2.default=K5e});var Jae=R(r2=>{"use strict";h();Object.defineProperty(r2,"__esModule",{value:!0});var PI=Et(),H5e={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,PI.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,PI._)`{limit: ${t}}`},J5e={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:H5e,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?PI.operators.GT:PI.operators.LT;t.fail$data((0,PI._)`Object.keys(${r}).length ${i} ${n}`)}};r2.default=J5e});var Yae=R(n2=>{"use strict";h();Object.defineProperty(n2,"__esModule",{value:!0});var LI=uo(),_I=Et(),Y5e=Yt(),j5e={message:({params:{missingProperty:t}})=>(0,_I.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,_I._)`{missingProperty: ${t}}`},q5e={keyword:"required",type:"object",schemaType:"array",$data:!0,error:j5e,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:o}=t,{opts:a}=o;if(!s&&r.length===0)return;let A=r.length>=a.loopRequired;if(o.allErrors?c():u(),a.strictRequired){let g=t.parentSchema.properties,{definedProperties:p}=t.it;for(let f of r)if(g?.[f]===void 0&&!p.has(f)){let m=o.schemaEnv.baseId+o.errSchemaPath,C=`required property "${f}" is not defined at "${m}" (strictRequired)`;(0,Y5e.checkStrictMode)(o,C,o.opts.strictRequired)}}function c(){if(A||s)t.block$data(_I.nil,l);else for(let g of r)(0,LI.checkReportMissingProp)(t,g)}function u(){let g=e.let("missing");if(A||s){let p=e.let("valid",!0);t.block$data(p,()=>d(g,p)),t.ok(p)}else e.if((0,LI.checkMissingProp)(t,r,g)),(0,LI.reportMissingProp)(t,g),e.else()}function l(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,LI.noPropertyInData)(e,i,g,a.ownProperties),()=>t.error())})}function d(g,p){t.setParams({missingProperty:g}),e.forOf(g,n,()=>{e.assign(p,(0,LI.propertyInData)(e,i,g,a.ownProperties)),e.if((0,_I.not)(p),()=>{t.error(),e.break()})},_I.nil)}}};n2.default=q5e});var jae=R(i2=>{"use strict";h();Object.defineProperty(i2,"__esModule",{value:!0});var UI=Et(),$5e={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,UI.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,UI._)`{limit: ${t}}`},V5e={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:$5e,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?UI.operators.GT:UI.operators.LT;t.fail$data((0,UI._)`${r}.length ${i} ${n}`)}};i2.default=V5e});var tb=R(s2=>{"use strict";h();Object.defineProperty(s2,"__esModule",{value:!0});var qae=xU();qae.code='require("ajv/dist/runtime/equal").default';s2.default=qae});var $ae=R(a2=>{"use strict";h();Object.defineProperty(a2,"__esModule",{value:!0});var o2=wI(),Zn=Et(),W5e=Yt(),z5e=tb(),X5e={message:({params:{i:t,j:e}})=>(0,Zn.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Zn._)`{i: ${t}, j: ${e}}`},Z5e={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:X5e,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:a}=t;if(!n&&!i)return;let A=e.let("valid"),c=s.items?(0,o2.getSchemaTypes)(s.items):[];t.block$data(A,u,(0,Zn._)`${o} === false`),t.ok(A);function u(){let p=e.let("i",(0,Zn._)`${r}.length`),f=e.let("j");t.setParams({i:p,j:f}),e.assign(A,!0),e.if((0,Zn._)`${p} > 1`,()=>(l()?d:g)(p,f))}function l(){return c.length>0&&!c.some(p=>p==="object"||p==="array")}function d(p,f){let m=e.name("item"),C=(0,o2.checkDataTypes)(c,m,a.opts.strictNumbers,o2.DataType.Wrong),I=e.const("indices",(0,Zn._)`{}`);e.for((0,Zn._)`;${p}--;`,()=>{e.let(m,(0,Zn._)`${r}[${p}]`),e.if(C,(0,Zn._)`continue`),c.length>1&&e.if((0,Zn._)`typeof ${m} == "string"`,(0,Zn._)`${m} += "_"`),e.if((0,Zn._)`typeof ${I}[${m}] == "number"`,()=>{e.assign(f,(0,Zn._)`${I}[${m}]`),t.error(),e.assign(A,!1).break()}).code((0,Zn._)`${I}[${m}] = ${p}`)})}function g(p,f){let m=(0,W5e.useFunc)(e,z5e.default),C=e.name("outer");e.label(C).for((0,Zn._)`;${p}--;`,()=>e.for((0,Zn._)`${f} = ${p}; ${f}--;`,()=>e.if((0,Zn._)`${m}(${r}[${p}], ${r}[${f}])`,()=>{t.error(),e.assign(A,!1).break(C)})))}}};a2.default=Z5e});var Vae=R(c2=>{"use strict";h();Object.defineProperty(c2,"__esModule",{value:!0});var A2=Et(),e$e=Yt(),t$e=tb(),r$e={message:"must be equal to constant",params:({schemaCode:t})=>(0,A2._)`{allowedValue: ${t}}`},n$e={keyword:"const",$data:!0,error:r$e,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,A2._)`!${(0,e$e.useFunc)(e,t$e.default)}(${r}, ${i})`):t.fail((0,A2._)`${s} !== ${r}`)}};c2.default=n$e});var Wae=R(u2=>{"use strict";h();Object.defineProperty(u2,"__esModule",{value:!0});var GI=Et(),i$e=Yt(),s$e=tb(),o$e={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,GI._)`{allowedValues: ${t}}`},a$e={keyword:"enum",schemaType:"array",$data:!0,error:o$e,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,A,c=()=>A??(A=(0,i$e.useFunc)(e,s$e.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,l);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let g=e.const("vSchema",s);u=(0,GI.or)(...i.map((p,f)=>d(g,f)))}t.pass(u);function l(){e.assign(u,!1),e.forOf("v",s,g=>e.if((0,GI._)`${c()}(${r}, ${g})`,()=>e.assign(u,!0).break()))}function d(g,p){let f=i[p];return typeof f=="object"&&f!==null?(0,GI._)`${c()}(${r}, ${g}[${p}])`:(0,GI._)`${r} === ${f}`}}};u2.default=a$e});var zae=R(l2=>{"use strict";h();Object.defineProperty(l2,"__esModule",{value:!0});var A$e=_ae(),c$e=Uae(),u$e=Kae(),l$e=Hae(),g$e=Jae(),p$e=Yae(),d$e=jae(),f$e=$ae(),h$e=Vae(),m$e=Wae(),C$e=[A$e.default,c$e.default,u$e.default,l$e.default,g$e.default,p$e.default,d$e.default,f$e.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},h$e.default,m$e.default];l2.default=C$e});var p2=R(OI=>{"use strict";h();Object.defineProperty(OI,"__esModule",{value:!0});OI.validateAdditionalItems=void 0;var Pg=Et(),g2=Yt(),I$e={message:({params:{len:t}})=>(0,Pg.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Pg._)`{limit: ${t}}`},E$e={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:I$e,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,g2.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Xae(t,n)}};function Xae(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let a=r.const("len",(0,Pg._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Pg._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,g2.alwaysValidSchema)(o,n)){let c=r.var("valid",(0,Pg._)`${a} <= ${e.length}`);r.if((0,Pg.not)(c),()=>A(c)),t.ok(c)}function A(c){r.forRange("i",e.length,a,u=>{t.subschema({keyword:s,dataProp:u,dataPropType:g2.Type.Num},c),o.allErrors||r.if((0,Pg.not)(c),()=>r.break())})}}OI.validateAdditionalItems=Xae;OI.default=E$e});var d2=R(KI=>{"use strict";h();Object.defineProperty(KI,"__esModule",{value:!0});KI.validateTuple=void 0;var Zae=Et(),rb=Yt(),B$e=uo(),y$e={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return eAe(t,"additionalItems",e);r.items=!0,!(0,rb.alwaysValidSchema)(r,e)&&t.ok((0,B$e.validateArray)(t))}};function eAe(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=rb.mergeEvaluated.items(n,r.length,a.items));let A=n.name("valid"),c=n.const("len",(0,Zae._)`${s}.length`);r.forEach((l,d)=>{(0,rb.alwaysValidSchema)(a,l)||(n.if((0,Zae._)`${c} > ${d}`,()=>t.subschema({keyword:o,schemaProp:d,dataProp:d},A)),t.ok(A))});function u(l){let{opts:d,errSchemaPath:g}=a,p=r.length,f=p===l.minItems&&(p===l.maxItems||l[e]===!1);if(d.strictTuples&&!f){let m=`"${o}" is ${p}-tuple, but minItems or maxItems/${e} are not specified or different at path "${g}"`;(0,rb.checkStrictMode)(a,m,d.strictTuples)}}}KI.validateTuple=eAe;KI.default=y$e});var tAe=R(f2=>{"use strict";h();Object.defineProperty(f2,"__esModule",{value:!0});var Q$e=d2(),D$e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Q$e.validateTuple)(t,"items")};f2.default=D$e});var nAe=R(h2=>{"use strict";h();Object.defineProperty(h2,"__esModule",{value:!0});var rAe=Et(),w$e=Yt(),b$e=uo(),S$e=p2(),v$e={message:({params:{len:t}})=>(0,rAe.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,rAe._)`{limit: ${t}}`},x$e={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:v$e,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,w$e.alwaysValidSchema)(n,e)&&(i?(0,S$e.validateAdditionalItems)(t,i):t.ok((0,b$e.validateArray)(t)))}};h2.default=x$e});var iAe=R(m2=>{"use strict";h();Object.defineProperty(m2,"__esModule",{value:!0});var go=Et(),nb=Yt(),F$e={message:({params:{min:t,max:e}})=>e===void 0?(0,go.str)`must contain at least ${t} valid item(s)`:(0,go.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,go._)`{minContains: ${t}}`:(0,go._)`{minContains: ${t}, maxContains: ${e}}`},k$e={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:F$e,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,a,{minContains:A,maxContains:c}=n;s.opts.next?(o=A===void 0?1:A,a=c):o=1;let u=e.const("len",(0,go._)`${i}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,nb.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,nb.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,nb.alwaysValidSchema)(s,r)){let f=(0,go._)`${u} >= ${o}`;a!==void 0&&(f=(0,go._)`${f} && ${u} <= ${a}`),t.pass(f);return}s.items=!0;let l=e.name("valid");a===void 0&&o===1?g(l,()=>e.if(l,()=>e.break())):o===0?(e.let(l,!0),a!==void 0&&e.if((0,go._)`${i}.length > 0`,d)):(e.let(l,!1),d()),t.result(l,()=>t.reset());function d(){let f=e.name("_valid"),m=e.let("count",0);g(f,()=>e.if(f,()=>p(m)))}function g(f,m){e.forRange("i",0,u,C=>{t.subschema({keyword:"contains",dataProp:C,dataPropType:nb.Type.Num,compositeRule:!0},f),m()})}function p(f){e.code((0,go._)`${f}++`),a===void 0?e.if((0,go._)`${f} >= ${o}`,()=>e.assign(l,!0).break()):(e.if((0,go._)`${f} > ${a}`,()=>e.assign(l,!1).break()),o===1?e.assign(l,!0):e.if((0,go._)`${f} >= ${o}`,()=>e.assign(l,!0)))}}};m2.default=k$e});var aAe=R(oA=>{"use strict";h();Object.defineProperty(oA,"__esModule",{value:!0});oA.validateSchemaDeps=oA.validatePropertyDeps=oA.error=void 0;var C2=Et(),R$e=Yt(),HI=uo();oA.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,C2.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,C2._)`{property: ${t},
|
|
1805
|
+
|| ${o} === "boolean" || ${i} === null`).assign(a,(0,ht._)`[${i}]`)}}}function g6e({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,ht._)`${e} !== undefined`,()=>t.assign((0,ht._)`${e}[${r}]`,n))}function QU(t,e,r,n=Cf.Correct){let i=n===Cf.Correct?ht.operators.EQ:ht.operators.NEQ,s;switch(t){case"null":return(0,ht._)`${e} ${i} null`;case"array":s=(0,ht._)`Array.isArray(${e})`;break;case"object":s=(0,ht._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,ht._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,ht._)`typeof ${e} ${i} ${t}`}return n===Cf.Correct?s:(0,ht.not)(s);function o(a=ht.nil){return(0,ht.and)((0,ht._)`typeof ${e} == "number"`,a,r?(0,ht._)`isFinite(${e})`:ht.nil)}}Di.checkDataType=QU;function DU(t,e,r,n){if(t.length===1)return QU(t[0],e,r,n);let i,s=(0,xoe.toHash)(t);if(s.array&&s.object){let o=(0,ht._)`typeof ${e} != "object"`;i=s.null?o:(0,ht._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=ht.nil;s.number&&delete s.integer;for(let o in s)i=(0,ht.and)(i,QU(o,e,r,n));return i}Di.checkDataTypes=DU;var p6e={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,ht._)`{type: ${t}}`:(0,ht._)`{type: ${e}}`};function wU(t){let e=d6e(t);(0,a6e.reportError)(e,p6e)}Di.reportTypeError=wU;function d6e(t){let{gen:e,data:r,schema:n}=t,i=(0,xoe.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Noe=R(U0=>{"use strict";h();Object.defineProperty(U0,"__esModule",{value:!0});U0.assignDefaults=void 0;var If=Et(),f6e=Yt();function h6e(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)Roe(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>Roe(t,s,i.default))}U0.assignDefaults=h6e;function Roe(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let a=(0,If._)`${s}${(0,If.getProperty)(e)}`;if(i){(0,f6e.checkStrictMode)(t,`default is ignored for: ${a}`);return}let A=(0,If._)`${a} === undefined`;o.useDefaults==="empty"&&(A=(0,If._)`${A} || ${a} === null || ${a} === ""`),n.if(A,(0,If._)`${a} = ${(0,If.stringify)(r)}`)}});var uo=R(Ar=>{"use strict";h();Object.defineProperty(Ar,"__esModule",{value:!0});Ar.validateUnion=Ar.validateArray=Ar.usePattern=Ar.callValidateCode=Ar.schemaProperties=Ar.allSchemaProperties=Ar.noPropertyInData=Ar.propertyInData=Ar.isOwnProperty=Ar.hasPropFunc=Ar.reportMissingProp=Ar.checkMissingProp=Ar.checkReportMissingProp=void 0;var br=Et(),bU=Yt(),_u=uc(),m6e=Yt();function C6e(t,e){let{gen:r,data:n,it:i}=t;r.if(vU(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,br._)`${e}`},!0),t.error()})}Ar.checkReportMissingProp=C6e;function I6e({gen:t,data:e,it:{opts:r}},n,i){return(0,br.or)(...n.map(s=>(0,br.and)(vU(t,e,s,r.ownProperties),(0,br._)`${i} = ${s}`)))}Ar.checkMissingProp=I6e;function E6e(t,e){t.setParams({missingProperty:e},!0),t.error()}Ar.reportMissingProp=E6e;function Toe(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,br._)`Object.prototype.hasOwnProperty`})}Ar.hasPropFunc=Toe;function SU(t,e,r){return(0,br._)`${Toe(t)}.call(${e}, ${r})`}Ar.isOwnProperty=SU;function B6e(t,e,r,n){let i=(0,br._)`${e}${(0,br.getProperty)(r)} !== undefined`;return n?(0,br._)`${i} && ${SU(t,e,r)}`:i}Ar.propertyInData=B6e;function vU(t,e,r,n){let i=(0,br._)`${e}${(0,br.getProperty)(r)} === undefined`;return n?(0,br.or)(i,(0,br.not)(SU(t,e,r))):i}Ar.noPropertyInData=vU;function Moe(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Ar.allSchemaProperties=Moe;function y6e(t,e){return Moe(e).filter(r=>!(0,bU.alwaysValidSchema)(t,e[r]))}Ar.schemaProperties=y6e;function Q6e({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},a,A,c){let u=c?(0,br._)`${t}, ${e}, ${n}${i}`:e,l=[[_u.default.instancePath,(0,br.strConcat)(_u.default.instancePath,s)],[_u.default.parentData,o.parentData],[_u.default.parentDataProperty,o.parentDataProperty],[_u.default.rootData,_u.default.rootData]];o.opts.dynamicRef&&l.push([_u.default.dynamicAnchors,_u.default.dynamicAnchors]);let d=(0,br._)`${u}, ${r.object(...l)}`;return A!==br.nil?(0,br._)`${a}.call(${A}, ${d})`:(0,br._)`${a}(${d})`}Ar.callValidateCode=Q6e;var D6e=(0,br._)`new RegExp`;function w6e({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,br._)`${i.code==="new RegExp"?D6e:(0,m6e.useFunc)(t,i)}(${r}, ${n})`})}Ar.usePattern=w6e;function b6e(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(s,!0),o(()=>e.break()),s;function o(a){let A=e.const("len",(0,br._)`${r}.length`);e.forRange("i",0,A,c=>{t.subschema({keyword:n,dataProp:c,dataPropType:bU.Type.Num},s),e.if((0,br.not)(s),a)})}}Ar.validateArray=b6e;function S6e(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(A=>(0,bU.alwaysValidSchema)(i,A))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((A,c)=>{let u=t.subschema({keyword:n,schemaProp:c,compositeRule:!0},a);e.assign(o,(0,br._)`${o} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,br.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}Ar.validateUnion=S6e});var _oe=R(nA=>{"use strict";h();Object.defineProperty(nA,"__esModule",{value:!0});nA.validateKeywordUsage=nA.validSchemaType=nA.funcKeywordCode=nA.macroKeywordCode=void 0;var _i=Et(),Rg=uc(),v6e=uo(),x6e=DI();function F6e(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,a=e.macro.call(o.self,i,s,o),A=Loe(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let c=r.name("valid");t.subschema({schema:a,schemaPath:_i.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:A,compositeRule:!0},c),t.pass(c,()=>t.error(!0))}nA.macroKeywordCode=F6e;function k6e(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:a,it:A}=t;N6e(A,e);let c=!a&&e.compile?e.compile.call(A.self,s,o,A):e.validate,u=Loe(n,i,c),l=n.let("valid");t.block$data(l,d),t.ok((r=e.valid)!==null&&r!==void 0?r:l);function d(){if(e.errors===!1)f(),e.modifying&&Poe(t),m(()=>t.error());else{let C=e.async?g():p();e.modifying&&Poe(t),m(()=>R6e(t,C))}}function g(){let C=n.let("ruleErrs",null);return n.try(()=>f((0,_i._)`await `),I=>n.assign(l,!1).if((0,_i._)`${I} instanceof ${A.ValidationError}`,()=>n.assign(C,(0,_i._)`${I}.errors`),()=>n.throw(I))),C}function p(){let C=(0,_i._)`${u}.errors`;return n.assign(C,null),f(_i.nil),C}function f(C=e.async?(0,_i._)`await `:_i.nil){let I=A.opts.passContext?Rg.default.this:Rg.default.self,B=!("compile"in e&&!a||e.schema===!1);n.assign(l,(0,_i._)`${C}${(0,v6e.callValidateCode)(t,u,I,B)}`,e.modifying)}function m(C){var I;n.if((0,_i.not)((I=e.valid)!==null&&I!==void 0?I:l),C)}}nA.funcKeywordCode=k6e;function Poe(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,_i._)`${n.parentData}[${n.parentDataProperty}]`))}function R6e(t,e){let{gen:r}=t;r.if((0,_i._)`Array.isArray(${e})`,()=>{r.assign(Rg.default.vErrors,(0,_i._)`${Rg.default.vErrors} === null ? ${e} : ${Rg.default.vErrors}.concat(${e})`).assign(Rg.default.errors,(0,_i._)`${Rg.default.vErrors}.length`),(0,x6e.extendErrors)(t)},()=>t.error())}function N6e({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Loe(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,_i.stringify)(r)})}function T6e(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}nA.validSchemaType=T6e;function M6e({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let o=i.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let A=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(A);else throw new Error(A)}}nA.validateKeywordUsage=M6e});var Goe=R(Uu=>{"use strict";h();Object.defineProperty(Uu,"__esModule",{value:!0});Uu.extendSubschemaMode=Uu.extendSubschemaData=Uu.getSubschema=void 0;var iA=Et(),Uoe=Yt();function P6e(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,iA._)`${t.schemaPath}${(0,iA.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,iA._)`${t.schemaPath}${(0,iA.getProperty)(e)}${(0,iA.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Uoe.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Uu.getSubschema=P6e;function L6e(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:c,dataPathArr:u,opts:l}=e,d=a.let("data",(0,iA._)`${e.data}${(0,iA.getProperty)(r)}`,!0);A(d),t.errorPath=(0,iA.str)`${c}${(0,Uoe.getErrorPath)(r,n,l.jsPropertySyntax)}`,t.parentDataProperty=(0,iA._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let c=i instanceof iA.Name?i:a.let("data",i,!0);A(c),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function A(c){t.data=c,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,c]}}Uu.extendSubschemaData=L6e;function _6e(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}Uu.extendSubschemaMode=_6e});var xU=R((VJt,Ooe)=>{"use strict";h();Ooe.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var Hoe=R((zJt,Koe)=>{"use strict";h();var Gu=Koe.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};G0(e,n,i,t,"",t)};Gu.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Gu.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Gu.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Gu.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function G0(t,e,r,n,i,s,o,a,A,c){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,a,A,c);for(var u in n){var l=n[u];if(Array.isArray(l)){if(u in Gu.arrayKeywords)for(var d=0;d<l.length;d++)G0(t,e,r,l[d],i+"/"+u+"/"+d,s,i,u,n,d)}else if(u in Gu.propsKeywords){if(l&&typeof l=="object")for(var g in l)G0(t,e,r,l[g],i+"/"+u+"/"+U6e(g),s,i,u,n,g)}else(u in Gu.keywords||t.allKeys&&!(u in Gu.skipKeywords))&&G0(t,e,r,l,i+"/"+u,s,i,u,n)}r(n,i,s,o,a,A,c)}}function U6e(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var bI=R(As=>{"use strict";h();Object.defineProperty(As,"__esModule",{value:!0});As.getSchemaRefs=As.resolveUrl=As.normalizeId=As._getFullPath=As.getFullPath=As.inlineRef=void 0;var G6e=Yt(),O6e=xU(),K6e=Hoe(),H6e=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function J6e(t,e=!0){return typeof t=="boolean"?!0:e===!0?!FU(t):e?Joe(t)<=e:!1}As.inlineRef=J6e;var Y6e=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function FU(t){for(let e in t){if(Y6e.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(FU)||typeof r=="object"&&FU(r))return!0}return!1}function Joe(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!H6e.has(r)&&(typeof t[r]=="object"&&(0,G6e.eachItem)(t[r],n=>e+=Joe(n)),e===1/0))return 1/0}return e}function Yoe(t,e="",r){r!==!1&&(e=Ef(e));let n=t.parse(e);return joe(t,n)}As.getFullPath=Yoe;function joe(t,e){return t.serialize(e).split("#")[0]+"#"}As._getFullPath=joe;var j6e=/#\/?$/;function Ef(t){return t?t.replace(j6e,""):""}As.normalizeId=Ef;function q6e(t,e,r){return r=Ef(r),t.resolve(e,r)}As.resolveUrl=q6e;var $6e=/^[a-z_][-a-z0-9._]*$/i;function V6e(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Ef(t[r]||e),s={"":i},o=Yoe(n,i,!1),a={},A=new Set;return K6e(t,{allKeys:!0},(l,d,g,p)=>{if(p===void 0)return;let f=o+d,m=s[p];typeof l[r]=="string"&&(m=C.call(this,l[r])),I.call(this,l.$anchor),I.call(this,l.$dynamicAnchor),s[d]=m;function C(B){let E=this.opts.uriResolver.resolve;if(B=Ef(m?E(m,B):B),A.has(B))throw u(B);A.add(B);let y=this.refs[B];return typeof y=="string"&&(y=this.refs[y]),typeof y=="object"?c(l,y.schema,B):B!==Ef(f)&&(B[0]==="#"?(c(l,a[B],B),a[B]=l):this.refs[B]=f),B}function I(B){if(typeof B=="string"){if(!$6e.test(B))throw new Error(`invalid anchor "${B}"`);C.call(this,`#${B}`)}}}),a;function c(l,d,g){if(d!==void 0&&!O6e(l,d))throw u(g)}function u(l){return new Error(`reference "${l}" resolves to more than one schema`)}}As.getSchemaRefs=V6e});var xI=R(Ou=>{"use strict";h();Object.defineProperty(Ou,"__esModule",{value:!0});Ou.getData=Ou.KeywordCxt=Ou.validateFunctionCode=void 0;var zoe=boe(),qoe=wI(),RU=yU(),O0=wI(),W6e=Noe(),vI=_oe(),kU=Goe(),je=Et(),ot=uc(),z6e=bI(),lc=Yt(),SI=DI();function X6e(t){if(eae(t)&&(tae(t),Zoe(t))){tqe(t);return}Xoe(t,()=>(0,zoe.topBoolOrEmptySchema)(t))}Ou.validateFunctionCode=X6e;function Xoe({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,je._)`${ot.default.data}, ${ot.default.valCxt}`,n.$async,()=>{t.code((0,je._)`"use strict"; ${$oe(r,i)}`),eqe(t,i),t.code(s)}):t.func(e,(0,je._)`${ot.default.data}, ${Z6e(i)}`,n.$async,()=>t.code($oe(r,i)).code(s))}function Z6e(t){return(0,je._)`{${ot.default.instancePath}="", ${ot.default.parentData}, ${ot.default.parentDataProperty}, ${ot.default.rootData}=${ot.default.data}${t.dynamicRef?(0,je._)`, ${ot.default.dynamicAnchors}={}`:je.nil}}={}`}function eqe(t,e){t.if(ot.default.valCxt,()=>{t.var(ot.default.instancePath,(0,je._)`${ot.default.valCxt}.${ot.default.instancePath}`),t.var(ot.default.parentData,(0,je._)`${ot.default.valCxt}.${ot.default.parentData}`),t.var(ot.default.parentDataProperty,(0,je._)`${ot.default.valCxt}.${ot.default.parentDataProperty}`),t.var(ot.default.rootData,(0,je._)`${ot.default.valCxt}.${ot.default.rootData}`),e.dynamicRef&&t.var(ot.default.dynamicAnchors,(0,je._)`${ot.default.valCxt}.${ot.default.dynamicAnchors}`)},()=>{t.var(ot.default.instancePath,(0,je._)`""`),t.var(ot.default.parentData,(0,je._)`undefined`),t.var(ot.default.parentDataProperty,(0,je._)`undefined`),t.var(ot.default.rootData,ot.default.data),e.dynamicRef&&t.var(ot.default.dynamicAnchors,(0,je._)`{}`)})}function tqe(t){let{schema:e,opts:r,gen:n}=t;Xoe(t,()=>{r.$comment&&e.$comment&&nae(t),oqe(t),n.let(ot.default.vErrors,null),n.let(ot.default.errors,0),r.unevaluated&&rqe(t),rae(t),cqe(t)})}function rqe(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,je._)`${r}.evaluated`),e.if((0,je._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,je._)`${t.evaluated}.props`,(0,je._)`undefined`)),e.if((0,je._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,je._)`${t.evaluated}.items`,(0,je._)`undefined`))}function $oe(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,je._)`/*# sourceURL=${r} */`:je.nil}function nqe(t,e){if(eae(t)&&(tae(t),Zoe(t))){iqe(t,e);return}(0,zoe.boolOrEmptySchema)(t,e)}function Zoe({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function eae(t){return typeof t.schema!="boolean"}function iqe(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&nae(t),aqe(t),Aqe(t);let s=n.const("_errs",ot.default.errors);rae(t,s),n.var(e,(0,je._)`${s} === ${ot.default.errors}`)}function tae(t){(0,lc.checkUnknownRules)(t),sqe(t)}function rae(t,e){if(t.opts.jtd)return Voe(t,[],!1,e);let r=(0,qoe.getSchemaTypes)(t.schema),n=(0,qoe.coerceAndCheckDataType)(t,r);Voe(t,r,!n,e)}function sqe(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,lc.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function oqe(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,lc.checkStrictMode)(t,"default is ignored in the schema root")}function aqe(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,z6e.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Aqe(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function nae({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,je._)`${ot.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,je.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,je._)`${ot.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function cqe(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,je._)`${ot.default.errors} === 0`,()=>e.return(ot.default.data),()=>e.throw((0,je._)`new ${i}(${ot.default.vErrors})`)):(e.assign((0,je._)`${n}.errors`,ot.default.vErrors),s.unevaluated&&uqe(t),e.return((0,je._)`${ot.default.errors} === 0`))}function uqe({gen:t,evaluated:e,props:r,items:n}){r instanceof je.Name&&t.assign((0,je._)`${e}.props`,r),n instanceof je.Name&&t.assign((0,je._)`${e}.items`,n)}function Voe(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:a,opts:A,self:c}=t,{RULES:u}=c;if(s.$ref&&(A.ignoreKeywordsWithRef||!(0,lc.schemaHasRulesButRef)(s,u))){i.block(()=>sae(t,"$ref",u.all.$ref.definition));return}A.jtd||lqe(t,e),i.block(()=>{for(let d of u.rules)l(d);l(u.post)});function l(d){(0,RU.shouldUseGroup)(s,d)&&(d.type?(i.if((0,O0.checkDataType)(d.type,o,A.strictNumbers)),Woe(t,d),e.length===1&&e[0]===d.type&&r&&(i.else(),(0,O0.reportTypeError)(t)),i.endIf()):Woe(t,d),a||i.if((0,je._)`${ot.default.errors} === ${n||0}`))}}function Woe(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,W6e.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,RU.shouldUseRule)(n,s)&&sae(t,s.keyword,s.definition,e.type)})}function lqe(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(gqe(t,e),t.opts.allowUnionTypes||pqe(t,e),dqe(t,t.dataTypes))}function gqe(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{iae(t.dataTypes,r)||NU(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),hqe(t,e)}}function pqe(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&NU(t,"use allowUnionTypes to allow union type keyword")}function dqe(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,RU.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>fqe(e,o))&&NU(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function fqe(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function iae(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function hqe(t,e){let r=[];for(let n of t.dataTypes)iae(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function NU(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,lc.checkStrictMode)(t,e,t.opts.strictTypes)}var K0=class{constructor(e,r,n){if((0,vI.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,lc.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",oae(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,vI.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",ot.default.errors))}result(e,r,n){this.failResult((0,je.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,je.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,je._)`${r} !== undefined && (${(0,je.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?SI.reportExtraError:SI.reportError)(this,this.def.error,r)}$dataError(){(0,SI.reportError)(this,this.def.$dataError||SI.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,SI.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=je.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=je.nil,r=je.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,je.or)((0,je._)`${i} === undefined`,r)),e!==je.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==je.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,je.or)(o(),a());function o(){if(n.length){if(!(r instanceof je.Name))throw new Error("ajv implementation error");let A=Array.isArray(n)?n:[n];return(0,je._)`${(0,O0.checkDataTypes)(A,r,s.opts.strictNumbers,O0.DataType.Wrong)}`}return je.nil}function a(){if(i.validateSchema){let A=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,je._)`!${A}(${r})`}return je.nil}}subschema(e,r){let n=(0,kU.getSubschema)(this.it,e);(0,kU.extendSubschemaData)(n,this.it,e),(0,kU.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return nqe(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=lc.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=lc.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,je.Name)),!0}};Ou.KeywordCxt=K0;function sae(t,e,r,n){let i=new K0(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,vI.funcKeywordCode)(i,r):"macro"in r?(0,vI.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,vI.funcKeywordCode)(i,r)}var mqe=/^\/(?:[^~]|~0|~1)*$/,Cqe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oae(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return ot.default.rootData;if(t[0]==="/"){if(!mqe.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=ot.default.rootData}else{let c=Cqe.exec(t);if(!c)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+c[1];if(i=c[2],i==="#"){if(u>=e)throw new Error(A("property/index",u));return n[e-u]}if(u>e)throw new Error(A("data",u));if(s=r[e-u],!i)return s}let o=s,a=i.split("/");for(let c of a)c&&(s=(0,je._)`${s}${(0,je.getProperty)((0,lc.unescapeJsonPointer)(c))}`,o=(0,je._)`${o} && ${s}`);return o;function A(c,u){return`Cannot access ${c} ${u} levels up, current level is ${e}`}}Ou.getData=oae});var H0=R(MU=>{"use strict";h();Object.defineProperty(MU,"__esModule",{value:!0});var TU=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};MU.default=TU});var FI=R(_U=>{"use strict";h();Object.defineProperty(_U,"__esModule",{value:!0});var PU=bI(),LU=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,PU.resolveUrl)(e,r,n),this.missingSchema=(0,PU.normalizeId)((0,PU.getFullPath)(e,this.missingRef))}};_U.default=LU});var Y0=R(lo=>{"use strict";h();Object.defineProperty(lo,"__esModule",{value:!0});lo.resolveSchema=lo.getCompilingSchema=lo.resolveRef=lo.compileSchema=lo.SchemaEnv=void 0;var ia=Et(),Iqe=H0(),Ng=uc(),sa=bI(),aae=Yt(),Eqe=xI(),Bf=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,sa.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};lo.SchemaEnv=Bf;function GU(t){let e=Aae.call(this,t);if(e)return e;let r=(0,sa.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new ia.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),a;t.$async&&(a=o.scopeValue("Error",{ref:Iqe.default,code:(0,ia._)`require("ajv/dist/runtime/validation_error").default`}));let A=o.scopeName("validate");t.validateName=A;let c={gen:o,allErrors:this.opts.allErrors,data:Ng.default.data,parentData:Ng.default.parentData,parentDataProperty:Ng.default.parentDataProperty,dataNames:[Ng.default.data],dataPathArr:[ia.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,ia.stringify)(t.schema)}:{ref:t.schema}),validateName:A,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:ia.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ia._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,Eqe.validateFunctionCode)(c),o.optimize(this.opts.code.optimize);let l=o.toString();u=`${o.scopeRefs(Ng.default.scope)}return ${l}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let g=new Function(`${Ng.default.self}`,`${Ng.default.scope}`,u)(this,this.scope.get());if(this.scope.value(A,{ref:g}),g.errors=null,g.schema=t.schema,g.schemaEnv=t,t.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:A,validateCode:l,scopeValues:o._values}),this.opts.unevaluated){let{props:p,items:f}=c;g.evaluated={props:p instanceof ia.Name?void 0:p,items:f instanceof ia.Name?void 0:f,dynamicProps:p instanceof ia.Name,dynamicItems:f instanceof ia.Name},g.source&&(g.source.evaluated=(0,ia.stringify)(g.evaluated))}return t.validate=g,t}catch(l){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),l}finally{this._compilations.delete(t)}}lo.compileSchema=GU;function Bqe(t,e,r){var n;r=(0,sa.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=Dqe.call(this,t,r);if(s===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(s=new Bf({schema:o,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=yqe.call(this,s)}lo.resolveRef=Bqe;function yqe(t){return(0,sa.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:GU.call(this,t)}function Aae(t){for(let e of this._compilations)if(Qqe(e,t))return e}lo.getCompilingSchema=Aae;function Qqe(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Dqe(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||J0.call(this,t,e)}function J0(t,e){let r=this.opts.uriResolver.parse(e),n=(0,sa._getFullPath)(this.opts.uriResolver,r),i=(0,sa.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return UU.call(this,r,t);let s=(0,sa.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=J0.call(this,t,o);return typeof a?.schema!="object"?void 0:UU.call(this,r,a)}if(typeof o?.schema=="object"){if(o.validate||GU.call(this,o),s===(0,sa.normalizeId)(e)){let{schema:a}=o,{schemaId:A}=this.opts,c=a[A];return c&&(i=(0,sa.resolveUrl)(this.opts.uriResolver,i,c)),new Bf({schema:a,schemaId:A,root:t,baseId:i})}return UU.call(this,r,o)}}lo.resolveSchema=J0;var wqe=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function UU(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let A=r[(0,aae.unescapeFragment)(a)];if(A===void 0)return;r=A;let c=typeof r=="object"&&r[this.opts.schemaId];!wqe.has(a)&&c&&(e=(0,sa.resolveUrl)(this.opts.uriResolver,e,c))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,aae.schemaHasRulesButRef)(r,this.RULES)){let a=(0,sa.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=J0.call(this,n,a)}let{schemaId:o}=this.opts;if(s=s||new Bf({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var cae=R((cYt,bqe)=>{bqe.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var KU=R((uYt,pae)=>{"use strict";h();var Sqe=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),lae=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function OU(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var vqe=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function uae(t){return t.length=0,!0}function xqe(t,e,r){if(t.length){let n=OU(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function Fqe(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,a=xqe;for(let A=0;A<t.length;A++){let c=t[A];if(!(c==="["||c==="]"))if(c===":"){if(s===!0&&(o=!0),!a(i,n,r))break;if(++e>7){r.error=!0;break}A>0&&t[A-1]===":"&&(s=!0),n.push(":");continue}else if(c==="%"){if(!a(i,n,r))break;a=uae}else{i.push(c);continue}}return i.length&&(a===uae?r.zone=i.join(""):o?n.push(i.join("")):n.push(OU(i))),r.address=n.join(""),r}function gae(t){if(kqe(t,":")<2)return{host:t,isIPV6:!1};let e=Fqe(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function kqe(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function Rqe(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function Nqe(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function Tqe(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!lae(r)){let n=gae(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}pae.exports={nonSimpleDomain:vqe,recomposeAuthority:Tqe,normalizeComponentEncoding:Nqe,removeDotSegments:Rqe,isIPv4:lae,isUUID:Sqe,normalizeIPv6:gae,stringArrayToHexStripped:OU}});var Cae=R((gYt,mae)=>{"use strict";h();var{isUUID:Mqe}=KU(),Pqe=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Lqe=["http","https","ws","wss","urn","urn:uuid"];function _qe(t){return Lqe.indexOf(t)!==-1}function HU(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function dae(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function fae(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function Uqe(t){return t.secure=HU(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function Gqe(t){if((t.port===(HU(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function Oqe(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(Pqe);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=JU(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function Kqe(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=JU(i);s&&(t=s.serialize(t,e));let o=t,a=t.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function Hqe(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Mqe(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Jqe(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var hae={scheme:"http",domainHost:!0,parse:dae,serialize:fae},Yqe={scheme:"https",domainHost:hae.domainHost,parse:dae,serialize:fae},j0={scheme:"ws",domainHost:!0,parse:Uqe,serialize:Gqe},jqe={scheme:"wss",domainHost:j0.domainHost,parse:j0.parse,serialize:j0.serialize},qqe={scheme:"urn",parse:Oqe,serialize:Kqe,skipNormalize:!0},$qe={scheme:"urn:uuid",parse:Hqe,serialize:Jqe,skipNormalize:!0},q0={http:hae,https:Yqe,ws:j0,wss:jqe,urn:qqe,"urn:uuid":$qe};Object.setPrototypeOf(q0,null);function JU(t){return t&&(q0[t]||q0[t.toLowerCase()])||void 0}mae.exports={wsIsSecure:HU,SCHEMES:q0,isValidSchemeName:_qe,getSchemeHandler:JU}});var Bae=R((dYt,V0)=>{"use strict";h();var{normalizeIPv6:Vqe,removeDotSegments:kI,recomposeAuthority:Wqe,normalizeComponentEncoding:$0,isIPv4:zqe,nonSimpleDomain:Xqe}=KU(),{SCHEMES:Zqe,getSchemeHandler:Iae}=Cae();function e5e(t,e){return typeof t=="string"?t=sA(gc(t,e),e):typeof t=="object"&&(t=gc(sA(t,e),e)),t}function t5e(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Eae(gc(t,n),gc(e,n),n,!0);return n.skipEscape=!0,sA(i,n)}function Eae(t,e,r,n){let i={};return n||(t=gc(sA(t,r),r),e=gc(sA(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=kI(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=kI(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=kI(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=kI(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function r5e(t,e,r){return typeof t=="string"?(t=unescape(t),t=sA($0(gc(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=sA($0(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=sA($0(gc(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=sA($0(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function sA(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=Iae(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=Wqe(r);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=kI(a)),o===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var n5e=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function gc(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(n5e);if(s){if(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]),n.host)if(zqe(n.host)===!1){let A=Vqe(n.host);n.host=A.host.toLowerCase(),i=A.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let o=Iae(r.scheme||n.scheme);if(!r.unicodeSupport&&(!o||!o.unicodeSupport)&&n.host&&(r.domainHost||o&&o.domainHost)&&i===!1&&Xqe(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}(!o||o&&!o.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),o&&o.parse&&o.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var YU={SCHEMES:Zqe,normalize:e5e,resolve:t5e,resolveComponent:Eae,equal:r5e,serialize:sA,parse:gc};V0.exports=YU;V0.exports.default=YU;V0.exports.fastUri=YU});var Qae=R(jU=>{"use strict";h();Object.defineProperty(jU,"__esModule",{value:!0});var yae=Bae();yae.code='require("ajv/dist/runtime/uri").default';jU.default=yae});var kae=R(Xn=>{"use strict";h();Object.defineProperty(Xn,"__esModule",{value:!0});Xn.CodeGen=Xn.Name=Xn.nil=Xn.stringify=Xn.str=Xn._=Xn.KeywordCxt=void 0;var i5e=xI();Object.defineProperty(Xn,"KeywordCxt",{enumerable:!0,get:function(){return i5e.KeywordCxt}});var yf=Et();Object.defineProperty(Xn,"_",{enumerable:!0,get:function(){return yf._}});Object.defineProperty(Xn,"str",{enumerable:!0,get:function(){return yf.str}});Object.defineProperty(Xn,"stringify",{enumerable:!0,get:function(){return yf.stringify}});Object.defineProperty(Xn,"nil",{enumerable:!0,get:function(){return yf.nil}});Object.defineProperty(Xn,"Name",{enumerable:!0,get:function(){return yf.Name}});Object.defineProperty(Xn,"CodeGen",{enumerable:!0,get:function(){return yf.CodeGen}});var s5e=H0(),vae=FI(),o5e=BU(),RI=Y0(),a5e=Et(),NI=bI(),W0=wI(),$U=Yt(),Dae=cae(),A5e=Qae(),xae=(t,e)=>new RegExp(t,e);xae.code="new RegExp";var c5e=["removeAdditional","useDefaults","coerceTypes"],u5e=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),l5e={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g5e={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},wae=200;function p5e(t){var e,r,n,i,s,o,a,A,c,u,l,d,g,p,f,m,C,I,B,E,y,Q,w,D,x;let S=t.strict,v=(e=t.code)===null||e===void 0?void 0:e.optimize,P=v===!0||v===void 0?1:v||0,$=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:xae,H=(i=t.uriResolver)!==null&&i!==void 0?i:A5e.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:S)!==null&&o!==void 0?o:!0,strictNumbers:(A=(a=t.strictNumbers)!==null&&a!==void 0?a:S)!==null&&A!==void 0?A:!0,strictTypes:(u=(c=t.strictTypes)!==null&&c!==void 0?c:S)!==null&&u!==void 0?u:"log",strictTuples:(d=(l=t.strictTuples)!==null&&l!==void 0?l:S)!==null&&d!==void 0?d:"log",strictRequired:(p=(g=t.strictRequired)!==null&&g!==void 0?g:S)!==null&&p!==void 0?p:!1,code:t.code?{...t.code,optimize:P,regExp:$}:{optimize:P,regExp:$},loopRequired:(f=t.loopRequired)!==null&&f!==void 0?f:wae,loopEnum:(m=t.loopEnum)!==null&&m!==void 0?m:wae,meta:(C=t.meta)!==null&&C!==void 0?C:!0,messages:(I=t.messages)!==null&&I!==void 0?I:!0,inlineRefs:(B=t.inlineRefs)!==null&&B!==void 0?B:!0,schemaId:(E=t.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(y=t.addUsedSchema)!==null&&y!==void 0?y:!0,validateSchema:(Q=t.validateSchema)!==null&&Q!==void 0?Q:!0,validateFormats:(w=t.validateFormats)!==null&&w!==void 0?w:!0,unicodeRegExp:(D=t.unicodeRegExp)!==null&&D!==void 0?D:!0,int32range:(x=t.int32range)!==null&&x!==void 0?x:!0,uriResolver:H}}var TI=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...p5e(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new a5e.ValueScope({scope:{},prefixes:u5e,es5:r,lines:n}),this.logger=I5e(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o5e.getRules)(),bae.call(this,l5e,e,"NOT SUPPORTED"),bae.call(this,g5e,e,"DEPRECATED","warn"),this._metaOpts=m5e.call(this),e.formats&&f5e.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&h5e.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),d5e.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Dae;n==="id"&&(i={...Dae},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,l){await s.call(this,u.$schema);let d=this._addSchema(u,l);return d.validate||o.call(this,d)}async function s(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(l){if(!(l instanceof vae.default))throw l;return a.call(this,l),await A.call(this,l.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:l}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${l} cannot be resolved`)}async function A(u){let l=await c.call(this,u);this.refs[u]||await s.call(this,l.$schema),this.refs[u]||this.addSchema(l,u,r)}async function c(u){let l=this._loading[u];if(l)return l;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,NI.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=Sae.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new RI.SchemaEnv({schema:{},schemaId:n});if(r=RI.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Sae.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,NI.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(B5e.call(this,n,r),!r)return(0,$U.eachItem)(n,s=>qU.call(this,s)),this;Q5e.call(this,r);let i={...r,type:(0,W0.getJSONTypes)(r.type),schemaType:(0,W0.getJSONTypes)(r.schemaType)};return(0,$U.eachItem)(n,i.type.length===0?s=>qU.call(this,s,i):s=>i.type.forEach(o=>qU.call(this,s,i,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),o=e;for(let a of s)o=o[a];for(let a in n){let A=n[a];if(typeof A!="object")continue;let{$data:c}=A.definition,u=o[a];c&&u&&(o[a]=Fae(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let A=this._cache.get(e);if(A!==void 0)return A;n=(0,NI.normalizeId)(o||n);let c=NI.getSchemaRefs.call(this,e,n);return A=new RI.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:c}),this._cache.set(A.schema,A),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=A),i&&this.validateSchema(e,!0),A}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):RI.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{RI.compileSchema.call(this,e)}finally{this.opts=r}}};TI.ValidationError=s5e.default;TI.MissingRefError=vae.default;Xn.default=TI;function bae(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function Sae(t){return t=(0,NI.normalizeId)(t),this.schemas[t]||this.refs[t]}function d5e(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function f5e(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function h5e(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function m5e(){let t={...this.opts};for(let e of c5e)delete t[e];return t}var C5e={log(){},warn(){},error(){}};function I5e(t){if(t===!1)return C5e;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var E5e=/^[a-z_$][a-z0-9_$:-]*$/i;function B5e(t,e){let{RULES:r}=this;if((0,$U.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!E5e.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function qU(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:A})=>A===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,W0.getJSONTypes)(e.type),schemaType:(0,W0.getJSONTypes)(e.schemaType)}};e.before?y5e.call(this,o,a,e.before):o.rules.push(a),s.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(A=>this.addKeyword(A))}function y5e(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Q5e(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Fae(e)),t.validateSchema=this.compile(e,!0))}var D5e={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Fae(t){return{anyOf:[t,D5e]}}});var Rae=R(VU=>{"use strict";h();Object.defineProperty(VU,"__esModule",{value:!0});var w5e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};VU.default=w5e});var Pae=R(Tg=>{"use strict";h();Object.defineProperty(Tg,"__esModule",{value:!0});Tg.callRef=Tg.getValidate=void 0;var b5e=FI(),Nae=uo(),cs=Et(),Qf=uc(),Tae=Y0(),z0=Yt(),S5e={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:A}=n,{root:c}=s;if((r==="#"||r==="#/")&&i===c.baseId)return l();let u=Tae.resolveRef.call(A,c,i,r);if(u===void 0)throw new b5e.default(n.opts.uriResolver,i,r);if(u instanceof Tae.SchemaEnv)return d(u);return g(u);function l(){if(s===c)return X0(t,o,s,s.$async);let p=e.scopeValue("root",{ref:c});return X0(t,(0,cs._)`${p}.validate`,c,c.$async)}function d(p){let f=Mae(t,p);X0(t,f,p,p.$async)}function g(p){let f=e.scopeValue("schema",a.code.source===!0?{ref:p,code:(0,cs.stringify)(p)}:{ref:p}),m=e.name("valid"),C=t.subschema({schema:p,dataTypes:[],schemaPath:cs.nil,topSchemaRef:f,errSchemaPath:r},m);t.mergeEvaluated(C),t.ok(m)}}};function Mae(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,cs._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Tg.getValidate=Mae;function X0(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:a,opts:A}=s,c=A.passContext?Qf.default.this:cs.nil;n?u():l();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let p=i.let("valid");i.try(()=>{i.code((0,cs._)`await ${(0,Nae.callValidateCode)(t,e,c)}`),g(e),o||i.assign(p,!0)},f=>{i.if((0,cs._)`!(${f} instanceof ${s.ValidationError})`,()=>i.throw(f)),d(f),o||i.assign(p,!1)}),t.ok(p)}function l(){t.result((0,Nae.callValidateCode)(t,e,c),()=>g(e),()=>d(e))}function d(p){let f=(0,cs._)`${p}.errors`;i.assign(Qf.default.vErrors,(0,cs._)`${Qf.default.vErrors} === null ? ${f} : ${Qf.default.vErrors}.concat(${f})`),i.assign(Qf.default.errors,(0,cs._)`${Qf.default.vErrors}.length`)}function g(p){var f;if(!s.opts.unevaluated)return;let m=(f=r?.validate)===null||f===void 0?void 0:f.evaluated;if(s.props!==!0)if(m&&!m.dynamicProps)m.props!==void 0&&(s.props=z0.mergeEvaluated.props(i,m.props,s.props));else{let C=i.var("props",(0,cs._)`${p}.evaluated.props`);s.props=z0.mergeEvaluated.props(i,C,s.props,cs.Name)}if(s.items!==!0)if(m&&!m.dynamicItems)m.items!==void 0&&(s.items=z0.mergeEvaluated.items(i,m.items,s.items));else{let C=i.var("items",(0,cs._)`${p}.evaluated.items`);s.items=z0.mergeEvaluated.items(i,C,s.items,cs.Name)}}}Tg.callRef=X0;Tg.default=S5e});var Lae=R(WU=>{"use strict";h();Object.defineProperty(WU,"__esModule",{value:!0});var v5e=Rae(),x5e=Pae(),F5e=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",v5e.default,x5e.default];WU.default=F5e});var _ae=R(zU=>{"use strict";h();Object.defineProperty(zU,"__esModule",{value:!0});var Z0=Et(),Ku=Z0.operators,eb={maximum:{okStr:"<=",ok:Ku.LTE,fail:Ku.GT},minimum:{okStr:">=",ok:Ku.GTE,fail:Ku.LT},exclusiveMaximum:{okStr:"<",ok:Ku.LT,fail:Ku.GTE},exclusiveMinimum:{okStr:">",ok:Ku.GT,fail:Ku.LTE}},k5e={message:({keyword:t,schemaCode:e})=>(0,Z0.str)`must be ${eb[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Z0._)`{comparison: ${eb[t].okStr}, limit: ${e}}`},R5e={keyword:Object.keys(eb),type:"number",schemaType:"number",$data:!0,error:k5e,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Z0._)`${r} ${eb[e].fail} ${n} || isNaN(${r})`)}};zU.default=R5e});var Uae=R(XU=>{"use strict";h();Object.defineProperty(XU,"__esModule",{value:!0});var MI=Et(),N5e={message:({schemaCode:t})=>(0,MI.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,MI._)`{multipleOf: ${t}}`},T5e={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:N5e,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),a=s?(0,MI._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,MI._)`${o} !== parseInt(${o})`;t.fail$data((0,MI._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};XU.default=T5e});var Oae=R(ZU=>{"use strict";h();Object.defineProperty(ZU,"__esModule",{value:!0});function Gae(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}ZU.default=Gae;Gae.code='require("ajv/dist/runtime/ucs2length").default'});var Kae=R(e2=>{"use strict";h();Object.defineProperty(e2,"__esModule",{value:!0});var Mg=Et(),M5e=Yt(),P5e=Oae(),L5e={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Mg.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Mg._)`{limit: ${t}}`},_5e={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:L5e,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Mg.operators.GT:Mg.operators.LT,o=i.opts.unicode===!1?(0,Mg._)`${r}.length`:(0,Mg._)`${(0,M5e.useFunc)(t.gen,P5e.default)}(${r})`;t.fail$data((0,Mg._)`${o} ${s} ${n}`)}};e2.default=_5e});var Hae=R(t2=>{"use strict";h();Object.defineProperty(t2,"__esModule",{value:!0});var U5e=uo(),G5e=Yt(),Df=Et(),O5e={message:({schemaCode:t})=>(0,Df.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Df._)`{pattern: ${t}}`},K5e={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:O5e,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t,a=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:A}=o.opts.code,c=A.code==="new RegExp"?(0,Df._)`new RegExp`:(0,G5e.useFunc)(e,A),u=e.let("valid");e.try(()=>e.assign(u,(0,Df._)`${c}(${s}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Df._)`!${u}`)}else{let A=(0,U5e.usePattern)(t,i);t.fail$data((0,Df._)`!${A}.test(${r})`)}}};t2.default=K5e});var Jae=R(r2=>{"use strict";h();Object.defineProperty(r2,"__esModule",{value:!0});var PI=Et(),H5e={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,PI.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,PI._)`{limit: ${t}}`},J5e={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:H5e,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?PI.operators.GT:PI.operators.LT;t.fail$data((0,PI._)`Object.keys(${r}).length ${i} ${n}`)}};r2.default=J5e});var Yae=R(n2=>{"use strict";h();Object.defineProperty(n2,"__esModule",{value:!0});var LI=uo(),_I=Et(),Y5e=Yt(),j5e={message:({params:{missingProperty:t}})=>(0,_I.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,_I._)`{missingProperty: ${t}}`},q5e={keyword:"required",type:"object",schemaType:"array",$data:!0,error:j5e,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:o}=t,{opts:a}=o;if(!s&&r.length===0)return;let A=r.length>=a.loopRequired;if(o.allErrors?c():u(),a.strictRequired){let g=t.parentSchema.properties,{definedProperties:p}=t.it;for(let f of r)if(g?.[f]===void 0&&!p.has(f)){let m=o.schemaEnv.baseId+o.errSchemaPath,C=`required property "${f}" is not defined at "${m}" (strictRequired)`;(0,Y5e.checkStrictMode)(o,C,o.opts.strictRequired)}}function c(){if(A||s)t.block$data(_I.nil,l);else for(let g of r)(0,LI.checkReportMissingProp)(t,g)}function u(){let g=e.let("missing");if(A||s){let p=e.let("valid",!0);t.block$data(p,()=>d(g,p)),t.ok(p)}else e.if((0,LI.checkMissingProp)(t,r,g)),(0,LI.reportMissingProp)(t,g),e.else()}function l(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,LI.noPropertyInData)(e,i,g,a.ownProperties),()=>t.error())})}function d(g,p){t.setParams({missingProperty:g}),e.forOf(g,n,()=>{e.assign(p,(0,LI.propertyInData)(e,i,g,a.ownProperties)),e.if((0,_I.not)(p),()=>{t.error(),e.break()})},_I.nil)}}};n2.default=q5e});var jae=R(i2=>{"use strict";h();Object.defineProperty(i2,"__esModule",{value:!0});var UI=Et(),$5e={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,UI.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,UI._)`{limit: ${t}}`},V5e={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:$5e,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?UI.operators.GT:UI.operators.LT;t.fail$data((0,UI._)`${r}.length ${i} ${n}`)}};i2.default=V5e});var tb=R(s2=>{"use strict";h();Object.defineProperty(s2,"__esModule",{value:!0});var qae=xU();qae.code='require("ajv/dist/runtime/equal").default';s2.default=qae});var $ae=R(a2=>{"use strict";h();Object.defineProperty(a2,"__esModule",{value:!0});var o2=wI(),Zn=Et(),W5e=Yt(),z5e=tb(),X5e={message:({params:{i:t,j:e}})=>(0,Zn.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Zn._)`{i: ${t}, j: ${e}}`},Z5e={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:X5e,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:a}=t;if(!n&&!i)return;let A=e.let("valid"),c=s.items?(0,o2.getSchemaTypes)(s.items):[];t.block$data(A,u,(0,Zn._)`${o} === false`),t.ok(A);function u(){let p=e.let("i",(0,Zn._)`${r}.length`),f=e.let("j");t.setParams({i:p,j:f}),e.assign(A,!0),e.if((0,Zn._)`${p} > 1`,()=>(l()?d:g)(p,f))}function l(){return c.length>0&&!c.some(p=>p==="object"||p==="array")}function d(p,f){let m=e.name("item"),C=(0,o2.checkDataTypes)(c,m,a.opts.strictNumbers,o2.DataType.Wrong),I=e.const("indices",(0,Zn._)`{}`);e.for((0,Zn._)`;${p}--;`,()=>{e.let(m,(0,Zn._)`${r}[${p}]`),e.if(C,(0,Zn._)`continue`),c.length>1&&e.if((0,Zn._)`typeof ${m} == "string"`,(0,Zn._)`${m} += "_"`),e.if((0,Zn._)`typeof ${I}[${m}] == "number"`,()=>{e.assign(f,(0,Zn._)`${I}[${m}]`),t.error(),e.assign(A,!1).break()}).code((0,Zn._)`${I}[${m}] = ${p}`)})}function g(p,f){let m=(0,W5e.useFunc)(e,z5e.default),C=e.name("outer");e.label(C).for((0,Zn._)`;${p}--;`,()=>e.for((0,Zn._)`${f} = ${p}; ${f}--;`,()=>e.if((0,Zn._)`${m}(${r}[${p}], ${r}[${f}])`,()=>{t.error(),e.assign(A,!1).break(C)})))}}};a2.default=Z5e});var Vae=R(c2=>{"use strict";h();Object.defineProperty(c2,"__esModule",{value:!0});var A2=Et(),e$e=Yt(),t$e=tb(),r$e={message:"must be equal to constant",params:({schemaCode:t})=>(0,A2._)`{allowedValue: ${t}}`},n$e={keyword:"const",$data:!0,error:r$e,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,A2._)`!${(0,e$e.useFunc)(e,t$e.default)}(${r}, ${i})`):t.fail((0,A2._)`${s} !== ${r}`)}};c2.default=n$e});var Wae=R(u2=>{"use strict";h();Object.defineProperty(u2,"__esModule",{value:!0});var GI=Et(),i$e=Yt(),s$e=tb(),o$e={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,GI._)`{allowedValues: ${t}}`},a$e={keyword:"enum",schemaType:"array",$data:!0,error:o$e,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,A,c=()=>A??(A=(0,i$e.useFunc)(e,s$e.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,l);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let g=e.const("vSchema",s);u=(0,GI.or)(...i.map((p,f)=>d(g,f)))}t.pass(u);function l(){e.assign(u,!1),e.forOf("v",s,g=>e.if((0,GI._)`${c()}(${r}, ${g})`,()=>e.assign(u,!0).break()))}function d(g,p){let f=i[p];return typeof f=="object"&&f!==null?(0,GI._)`${c()}(${r}, ${g}[${p}])`:(0,GI._)`${r} === ${f}`}}};u2.default=a$e});var zae=R(l2=>{"use strict";h();Object.defineProperty(l2,"__esModule",{value:!0});var A$e=_ae(),c$e=Uae(),u$e=Kae(),l$e=Hae(),g$e=Jae(),p$e=Yae(),d$e=jae(),f$e=$ae(),h$e=Vae(),m$e=Wae(),C$e=[A$e.default,c$e.default,u$e.default,l$e.default,g$e.default,p$e.default,d$e.default,f$e.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},h$e.default,m$e.default];l2.default=C$e});var p2=R(OI=>{"use strict";h();Object.defineProperty(OI,"__esModule",{value:!0});OI.validateAdditionalItems=void 0;var Pg=Et(),g2=Yt(),I$e={message:({params:{len:t}})=>(0,Pg.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Pg._)`{limit: ${t}}`},E$e={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:I$e,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,g2.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Xae(t,n)}};function Xae(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let a=r.const("len",(0,Pg._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Pg._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,g2.alwaysValidSchema)(o,n)){let c=r.var("valid",(0,Pg._)`${a} <= ${e.length}`);r.if((0,Pg.not)(c),()=>A(c)),t.ok(c)}function A(c){r.forRange("i",e.length,a,u=>{t.subschema({keyword:s,dataProp:u,dataPropType:g2.Type.Num},c),o.allErrors||r.if((0,Pg.not)(c),()=>r.break())})}}OI.validateAdditionalItems=Xae;OI.default=E$e});var d2=R(KI=>{"use strict";h();Object.defineProperty(KI,"__esModule",{value:!0});KI.validateTuple=void 0;var Zae=Et(),rb=Yt(),B$e=uo(),y$e={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return eAe(t,"additionalItems",e);r.items=!0,!(0,rb.alwaysValidSchema)(r,e)&&t.ok((0,B$e.validateArray)(t))}};function eAe(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=rb.mergeEvaluated.items(n,r.length,a.items));let A=n.name("valid"),c=n.const("len",(0,Zae._)`${s}.length`);r.forEach((l,d)=>{(0,rb.alwaysValidSchema)(a,l)||(n.if((0,Zae._)`${c} > ${d}`,()=>t.subschema({keyword:o,schemaProp:d,dataProp:d},A)),t.ok(A))});function u(l){let{opts:d,errSchemaPath:g}=a,p=r.length,f=p===l.minItems&&(p===l.maxItems||l[e]===!1);if(d.strictTuples&&!f){let m=`"${o}" is ${p}-tuple, but minItems or maxItems/${e} are not specified or different at path "${g}"`;(0,rb.checkStrictMode)(a,m,d.strictTuples)}}}KI.validateTuple=eAe;KI.default=y$e});var tAe=R(f2=>{"use strict";h();Object.defineProperty(f2,"__esModule",{value:!0});var Q$e=d2(),D$e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Q$e.validateTuple)(t,"items")};f2.default=D$e});var nAe=R(h2=>{"use strict";h();Object.defineProperty(h2,"__esModule",{value:!0});var rAe=Et(),w$e=Yt(),b$e=uo(),S$e=p2(),v$e={message:({params:{len:t}})=>(0,rAe.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,rAe._)`{limit: ${t}}`},x$e={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:v$e,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,w$e.alwaysValidSchema)(n,e)&&(i?(0,S$e.validateAdditionalItems)(t,i):t.ok((0,b$e.validateArray)(t)))}};h2.default=x$e});var iAe=R(m2=>{"use strict";h();Object.defineProperty(m2,"__esModule",{value:!0});var go=Et(),nb=Yt(),F$e={message:({params:{min:t,max:e}})=>e===void 0?(0,go.str)`must contain at least ${t} valid item(s)`:(0,go.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,go._)`{minContains: ${t}}`:(0,go._)`{minContains: ${t}, maxContains: ${e}}`},k$e={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:F$e,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,a,{minContains:A,maxContains:c}=n;s.opts.next?(o=A===void 0?1:A,a=c):o=1;let u=e.const("len",(0,go._)`${i}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,nb.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,nb.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,nb.alwaysValidSchema)(s,r)){let f=(0,go._)`${u} >= ${o}`;a!==void 0&&(f=(0,go._)`${f} && ${u} <= ${a}`),t.pass(f);return}s.items=!0;let l=e.name("valid");a===void 0&&o===1?g(l,()=>e.if(l,()=>e.break())):o===0?(e.let(l,!0),a!==void 0&&e.if((0,go._)`${i}.length > 0`,d)):(e.let(l,!1),d()),t.result(l,()=>t.reset());function d(){let f=e.name("_valid"),m=e.let("count",0);g(f,()=>e.if(f,()=>p(m)))}function g(f,m){e.forRange("i",0,u,C=>{t.subschema({keyword:"contains",dataProp:C,dataPropType:nb.Type.Num,compositeRule:!0},f),m()})}function p(f){e.code((0,go._)`${f}++`),a===void 0?e.if((0,go._)`${f} >= ${o}`,()=>e.assign(l,!0).break()):(e.if((0,go._)`${f} > ${a}`,()=>e.assign(l,!1).break()),o===1?e.assign(l,!0):e.if((0,go._)`${f} >= ${o}`,()=>e.assign(l,!0)))}}};m2.default=k$e});var aAe=R(oA=>{"use strict";h();Object.defineProperty(oA,"__esModule",{value:!0});oA.validateSchemaDeps=oA.validatePropertyDeps=oA.error=void 0;var C2=Et(),R$e=Yt(),HI=uo();oA.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,C2.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,C2._)`{property: ${t},
|
|
1806
1806
|
missingProperty: ${n},
|
|
1807
1807
|
depsCount: ${e},
|
|
1808
|
-
deps: ${r}}`};var N$e={keyword:"dependencies",type:"object",schemaType:"object",error:oA.error,code(t){let[e,r]=T$e(t);sAe(t,e),oAe(t,r)}};function T$e({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function sAe(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let A=(0,HI.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(A,()=>{for(let c of a)(0,HI.checkReportMissingProp)(t,c)}):(r.if((0,C2._)`${A} && (${(0,HI.checkMissingProp)(t,a,s)})`),(0,HI.reportMissingProp)(t,s),r.else())}}oA.validatePropertyDeps=sAe;function oAe(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let a in e)(0,R$e.alwaysValidSchema)(s,e[a])||(r.if((0,HI.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let A=t.subschema({keyword:i,schemaProp:a},o);t.mergeValidEvaluated(A,o)},()=>r.var(o,!0)),t.ok(o))}oA.validateSchemaDeps=oAe;oA.default=N$e});var cAe=R(I2=>{"use strict";h();Object.defineProperty(I2,"__esModule",{value:!0});var AAe=Et(),M$e=Yt(),P$e={message:"property name must be valid",params:({params:t})=>(0,AAe._)`{propertyName: ${t.propertyName}}`},L$e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:P$e,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,M$e.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,AAe.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};I2.default=L$e});var B2=R(E2=>{"use strict";h();Object.defineProperty(E2,"__esModule",{value:!0});var ib=uo(),oa=Et(),_$e=uc(),sb=Yt(),U$e={message:"must NOT have additional properties",params:({params:t})=>(0,oa._)`{additionalProperty: ${t.additionalProperty}}`},G$e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:U$e,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:A}=o;if(o.props=!0,A.removeAdditional!=="all"&&(0,sb.alwaysValidSchema)(o,r))return;let c=(0,ib.allSchemaProperties)(n.properties),u=(0,ib.allSchemaProperties)(n.patternProperties);l(),t.ok((0,oa._)`${s} === ${_$e.default.errors}`);function l(){e.forIn("key",i,m=>{!c.length&&!u.length?p(m):e.if(d(m),()=>p(m))})}function d(m){let C;if(c.length>8){let I=(0,sb.schemaRefOrVal)(o,n.properties,"properties");C=(0,ib.isOwnProperty)(e,I,m)}else c.length?C=(0,oa.or)(...c.map(I=>(0,oa._)`${m} === ${I}`)):C=oa.nil;return u.length&&(C=(0,oa.or)(C,...u.map(I=>(0,oa._)`${(0,ib.usePattern)(t,I)}.test(${m})`))),(0,oa.not)(C)}function g(m){e.code((0,oa._)`delete ${i}[${m}]`)}function p(m){if(A.removeAdditional==="all"||A.removeAdditional&&r===!1){g(m);return}if(r===!1){t.setParams({additionalProperty:m}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,sb.alwaysValidSchema)(o,r)){let C=e.name("valid");A.removeAdditional==="failing"?(f(m,C,!1),e.if((0,oa.not)(C),()=>{t.reset(),g(m)})):(f(m,C),a||e.if((0,oa.not)(C),()=>e.break()))}}function f(m,C,I){let B={keyword:"additionalProperties",dataProp:m,dataPropType:sb.Type.Str};I===!1&&Object.assign(B,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(B,C)}}};E2.default=G$e});var gAe=R(Q2=>{"use strict";h();Object.defineProperty(Q2,"__esModule",{value:!0});var O$e=xI(),uAe=uo(),y2=Yt(),lAe=B2(),K$e={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&lAe.default.code(new O$e.KeywordCxt(s,lAe.default,"additionalProperties"));let o=(0,uAe.allSchemaProperties)(r);for(let l of o)s.definedProperties.add(l);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=y2.mergeEvaluated.props(e,(0,y2.toHash)(o),s.props));let a=o.filter(l=>!(0,y2.alwaysValidSchema)(s,r[l]));if(a.length===0)return;let A=e.name("valid");for(let l of a)c(l)?u(l):(e.if((0,uAe.propertyInData)(e,i,l,s.opts.ownProperties)),u(l),s.allErrors||e.else().var(A,!0),e.endIf()),t.it.definedProperties.add(l),t.ok(A);function c(l){return s.opts.useDefaults&&!s.compositeRule&&r[l].default!==void 0}function u(l){t.subschema({keyword:"properties",schemaProp:l,dataProp:l},A)}}};Q2.default=K$e});var hAe=R(D2=>{"use strict";h();Object.defineProperty(D2,"__esModule",{value:!0});var pAe=uo(),ob=Et(),dAe=Yt(),fAe=Yt(),H$e={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:o}=s,a=(0,pAe.allSchemaProperties)(r),A=a.filter(f=>(0,dAe.alwaysValidSchema)(s,r[f]));if(a.length===0||A.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let c=o.strictSchema&&!o.allowMatchingProperties&&i.properties,u=e.name("valid");s.props!==!0&&!(s.props instanceof ob.Name)&&(s.props=(0,fAe.evaluatedPropsToName)(e,s.props));let{props:l}=s;d();function d(){for(let f of a)c&&g(f),s.allErrors?p(f):(e.var(u,!0),p(f),e.if(u))}function g(f){for(let m in c)new RegExp(f).test(m)&&(0,dAe.checkStrictMode)(s,`property ${m} matches pattern ${f} (use allowMatchingProperties)`)}function p(f){e.forIn("key",n,m=>{e.if((0,ob._)`${(0,pAe.usePattern)(t,f)}.test(${m})`,()=>{let C=A.includes(f);C||t.subschema({keyword:"patternProperties",schemaProp:f,dataProp:m,dataPropType:fAe.Type.Str},u),s.opts.unevaluated&&l!==!0?e.assign((0,ob._)`${l}[${m}]`,!0):!C&&!s.allErrors&&e.if((0,ob.not)(u),()=>e.break())})})}}};D2.default=H$e});var mAe=R(w2=>{"use strict";h();Object.defineProperty(w2,"__esModule",{value:!0});var J$e=Yt(),Y$e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,J$e.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};w2.default=Y$e});var CAe=R(b2=>{"use strict";h();Object.defineProperty(b2,"__esModule",{value:!0});var j$e=uo(),q$e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:j$e.validateUnion,error:{message:"must match a schema in anyOf"}};b2.default=q$e});var IAe=R(S2=>{"use strict";h();Object.defineProperty(S2,"__esModule",{value:!0});var ab=Et(),$$e=Yt(),V$e={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,ab._)`{passingSchemas: ${t.passing}}`},W$e={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:V$e,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=e.let("valid",!1),a=e.let("passing",null),A=e.name("_valid");t.setParams({passing:a}),e.block(c),t.result(o,()=>t.reset(),()=>t.error(!0));function c(){s.forEach((u,l)=>{let d;(0,$$e.alwaysValidSchema)(i,u)?e.var(A,!0):d=t.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},A),l>0&&e.if((0,ab._)`${A} && ${o}`).assign(o,!1).assign(a,(0,ab._)`[${a}, ${l}]`).else(),e.if(A,()=>{e.assign(o,!0),e.assign(a,l),d&&t.mergeEvaluated(d,ab.Name)})})}}};S2.default=W$e});var EAe=R(v2=>{"use strict";h();Object.defineProperty(v2,"__esModule",{value:!0});var z$e=Yt(),X$e={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,o)=>{if((0,z$e.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(a)})}};v2.default=X$e});var QAe=R(x2=>{"use strict";h();Object.defineProperty(x2,"__esModule",{value:!0});var Ab=Et(),yAe=Yt(),Z$e={message:({params:t})=>(0,Ab.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Ab._)`{failingKeyword: ${t.ifClause}}`},eVe={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Z$e,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,yAe.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=BAe(n,"then"),s=BAe(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),a=e.name("_valid");if(A(),t.reset(),i&&s){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,c("then",u),c("else",u))}else i?e.if(a,c("then")):e.if((0,Ab.not)(a),c("else"));t.pass(o,()=>t.error(!0));function A(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function c(u,l){return()=>{let d=t.subschema({keyword:u},a);e.assign(o,a),t.mergeValidEvaluated(d,o),l?e.assign(l,(0,Ab._)`${u}`):t.setParams({ifClause:u})}}}};function BAe(t,e){let r=t.schema[e];return r!==void 0&&!(0,yAe.alwaysValidSchema)(t,r)}x2.default=eVe});var DAe=R(F2=>{"use strict";h();Object.defineProperty(F2,"__esModule",{value:!0});var tVe=Yt(),rVe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,tVe.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};F2.default=rVe});var wAe=R(k2=>{"use strict";h();Object.defineProperty(k2,"__esModule",{value:!0});var nVe=p2(),iVe=tAe(),sVe=d2(),oVe=nAe(),aVe=iAe(),AVe=aAe(),cVe=cAe(),uVe=B2(),lVe=gAe(),gVe=hAe(),pVe=mAe(),dVe=CAe(),fVe=IAe(),hVe=EAe(),mVe=QAe(),CVe=DAe();function IVe(t=!1){let e=[pVe.default,dVe.default,fVe.default,hVe.default,mVe.default,CVe.default,cVe.default,uVe.default,AVe.default,lVe.default,gVe.default];return t?e.push(iVe.default,oVe.default):e.push(nVe.default,sVe.default),e.push(aVe.default),e}k2.default=IVe});var bAe=R(R2=>{"use strict";h();Object.defineProperty(R2,"__esModule",{value:!0});var en=Et(),EVe={message:({schemaCode:t})=>(0,en.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,en._)`{format: ${t}}`},BVe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:EVe,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:a}=t,{opts:A,errSchemaPath:c,schemaEnv:u,self:l}=a;if(!A.validateFormats)return;i?d():g();function d(){let p=r.scopeValue("formats",{ref:l.formats,code:A.code.formats}),f=r.const("fDef",(0,en._)`${p}[${o}]`),m=r.let("fType"),C=r.let("format");r.if((0,en._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>r.assign(m,(0,en._)`${f}.type || "string"`).assign(C,(0,en._)`${f}.validate`),()=>r.assign(m,(0,en._)`"string"`).assign(C,f)),t.fail$data((0,en.or)(I(),B()));function I(){return A.strictSchema===!1?en.nil:(0,en._)`${o} && !${C}`}function B(){let E=u.$async?(0,en._)`(${f}.async ? await ${C}(${n}) : ${C}(${n}))`:(0,en._)`${C}(${n})`,y=(0,en._)`(typeof ${C} == "function" ? ${E} : ${C}.test(${n}))`;return(0,en._)`${C} && ${C} !== true && ${m} === ${e} && !${y}`}}function g(){let p=l.formats[s];if(!p){I();return}if(p===!0)return;let[f,m,C]=B(p);f===e&&t.pass(E());function I(){if(A.strictSchema===!1){l.logger.warn(y());return}throw new Error(y());function y(){return`unknown format "${s}" ignored in schema at path "${c}"`}}function B(y){let Q=y instanceof RegExp?(0,en.regexpCode)(y):A.code.formats?(0,en._)`${A.code.formats}${(0,en.getProperty)(s)}`:void 0,w=r.scopeValue("formats",{key:s,ref:y,code:Q});return typeof y=="object"&&!(y instanceof RegExp)?[y.type||"string",y.validate,(0,en._)`${w}.validate`]:["string",y,w]}function E(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!u.$async)throw new Error("async format in sync schema");return(0,en._)`await ${C}(${n})`}return typeof m=="function"?(0,en._)`${C}(${n})`:(0,en._)`${C}.test(${n})`}}}};R2.default=BVe});var SAe=R(N2=>{"use strict";h();Object.defineProperty(N2,"__esModule",{value:!0});var yVe=bAe(),QVe=[yVe.default];N2.default=QVe});var vAe=R(wf=>{"use strict";h();Object.defineProperty(wf,"__esModule",{value:!0});wf.contentVocabulary=wf.metadataVocabulary=void 0;wf.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];wf.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var FAe=R(T2=>{"use strict";h();Object.defineProperty(T2,"__esModule",{value:!0});var DVe=Lae(),wVe=zae(),bVe=wAe(),SVe=SAe(),xAe=vAe(),vVe=[DVe.default,wVe.default,(0,bVe.default)(),SVe.default,xAe.metadataVocabulary,xAe.contentVocabulary];T2.default=vVe});var RAe=R(cb=>{"use strict";h();Object.defineProperty(cb,"__esModule",{value:!0});cb.DiscrError=void 0;var kAe;(function(t){t.Tag="tag",t.Mapping="mapping"})(kAe||(cb.DiscrError=kAe={}))});var TAe=R(P2=>{"use strict";h();Object.defineProperty(P2,"__esModule",{value:!0});var bf=Et(),M2=RAe(),NAe=Y0(),xVe=FI(),FVe=Yt(),kVe={message:({params:{discrError:t,tagName:e}})=>t===M2.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,bf._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},RVe={keyword:"discriminator",type:"object",schemaType:"object",error:kVe,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let A=e.let("valid",!1),c=e.const("tag",(0,bf._)`${r}${(0,bf.getProperty)(a)}`);e.if((0,bf._)`typeof ${c} == "string"`,()=>u(),()=>t.error(!1,{discrError:M2.DiscrError.Tag,tag:c,tagName:a})),t.ok(A);function u(){let g=d();e.if(!1);for(let p in g)e.elseIf((0,bf._)`${c} === ${p}`),e.assign(A,l(g[p]));e.else(),t.error(!1,{discrError:M2.DiscrError.Mapping,tag:c,tagName:a}),e.endIf()}function l(g){let p=e.name("valid"),f=t.subschema({keyword:"oneOf",schemaProp:g},p);return t.mergeEvaluated(f,bf.Name),p}function d(){var g;let p={},f=C(i),m=!0;for(let E=0;E<o.length;E++){let y=o[E];if(y?.$ref&&!(0,FVe.schemaHasRulesButRef)(y,s.self.RULES)){let w=y.$ref;if(y=NAe.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,w),y instanceof NAe.SchemaEnv&&(y=y.schema),y===void 0)throw new xVe.default(s.opts.uriResolver,s.baseId,w)}let Q=(g=y?.properties)===null||g===void 0?void 0:g[a];if(typeof Q!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);m=m&&(f||C(y)),I(Q,E)}if(!m)throw new Error(`discriminator: "${a}" must be required`);return p;function C({required:E}){return Array.isArray(E)&&E.includes(a)}function I(E,y){if(E.const)B(E.const,y);else if(E.enum)for(let Q of E.enum)B(Q,y);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function B(E,y){if(typeof E!="string"||E in p)throw new Error(`discriminator: "${a}" values must be unique strings`);p[E]=y}}}};P2.default=RVe});var MAe=R((JYt,NVe)=>{NVe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var _2=R((Sr,L2)=>{"use strict";h();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.MissingRefError=Sr.ValidationError=Sr.CodeGen=Sr.Name=Sr.nil=Sr.stringify=Sr.str=Sr._=Sr.KeywordCxt=Sr.Ajv=void 0;var TVe=kae(),MVe=FAe(),PVe=TAe(),PAe=MAe(),LVe=["/properties"],ub="http://json-schema.org/draft-07/schema",Sf=class extends TVe.default{_addVocabularies(){super._addVocabularies(),MVe.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(PVe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(PAe,LVe):PAe;this.addMetaSchema(e,ub,!1),this.refs["http://json-schema.org/schema"]=ub}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ub)?ub:void 0)}};Sr.Ajv=Sf;L2.exports=Sr=Sf;L2.exports.Ajv=Sf;Object.defineProperty(Sr,"__esModule",{value:!0});Sr.default=Sf;var _Ve=xI();Object.defineProperty(Sr,"KeywordCxt",{enumerable:!0,get:function(){return _Ve.KeywordCxt}});var vf=Et();Object.defineProperty(Sr,"_",{enumerable:!0,get:function(){return vf._}});Object.defineProperty(Sr,"str",{enumerable:!0,get:function(){return vf.str}});Object.defineProperty(Sr,"stringify",{enumerable:!0,get:function(){return vf.stringify}});Object.defineProperty(Sr,"nil",{enumerable:!0,get:function(){return vf.nil}});Object.defineProperty(Sr,"Name",{enumerable:!0,get:function(){return vf.Name}});Object.defineProperty(Sr,"CodeGen",{enumerable:!0,get:function(){return vf.CodeGen}});var UVe=H0();Object.defineProperty(Sr,"ValidationError",{enumerable:!0,get:function(){return UVe.default}});var GVe=FI();Object.defineProperty(Sr,"MissingRefError",{enumerable:!0,get:function(){return GVe.default}})});var JAe=R(AA=>{"use strict";h();Object.defineProperty(AA,"__esModule",{value:!0});AA.formatNames=AA.fastFormats=AA.fullFormats=void 0;function aA(t,e){return{validate:t,compare:e}}AA.fullFormats={date:aA(GAe,K2),time:aA(G2(!0),H2),"date-time":aA(LAe(!0),KAe),"iso-time":aA(G2(),OAe),"iso-date-time":aA(LAe(),HAe),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:jVe,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:ZVe,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:qVe,int32:{type:"number",validate:WVe},int64:{type:"number",validate:zVe},float:{type:"number",validate:UAe},double:{type:"number",validate:UAe},password:!0,binary:!0};AA.fastFormats={...AA.fullFormats,date:aA(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,K2),time:aA(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,H2),"date-time":aA(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,KAe),"iso-time":aA(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,OAe),"iso-date-time":aA(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,HAe),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};AA.formatNames=Object.keys(AA.fullFormats);function OVe(t){return t%4===0&&(t%100!==0||t%400===0)}var KVe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,HVe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function GAe(t){let e=KVe.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&OVe(r)?29:HVe[n])}function K2(t,e){if(t&&e)return t>e?1:t<e?-1:0}var U2=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function G2(t){return function(r){let n=U2.exec(r);if(!n)return!1;let i=+n[1],s=+n[2],o=+n[3],a=n[4],A=n[5]==="-"?-1:1,c=+(n[6]||0),u=+(n[7]||0);if(c>23||u>59||t&&!a)return!1;if(i<=23&&s<=59&&o<60)return!0;let l=s-u*A,d=i-c*A-(l<0?1:0);return(d===23||d===-1)&&(l===59||l===-1)&&o<61}}function H2(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function OAe(t,e){if(!(t&&e))return;let r=U2.exec(t),n=U2.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var O2=/t|\s/i;function LAe(t){let e=G2(t);return function(n){let i=n.split(O2);return i.length===2&&GAe(i[0])&&e(i[1])}}function KAe(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function HAe(t,e){if(!(t&&e))return;let[r,n]=t.split(O2),[i,s]=e.split(O2),o=K2(r,i);if(o!==void 0)return o||H2(n,s)}var JVe=/\/|:/,YVe=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function jVe(t){return JVe.test(t)&&YVe.test(t)}var _Ae=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function qVe(t){return _Ae.lastIndex=0,_Ae.test(t)}var $Ve=-(2**31),VVe=2**31-1;function WVe(t){return Number.isInteger(t)&&t<=VVe&&t>=$Ve}function zVe(t){return Number.isInteger(t)}function UAe(){return!0}var XVe=/[^\\]\\Z/;function ZVe(t){if(XVe.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var YAe=R(xf=>{"use strict";h();Object.defineProperty(xf,"__esModule",{value:!0});xf.formatLimitDefinition=void 0;var eWe=_2(),aa=Et(),Hu=aa.operators,lb={formatMaximum:{okStr:"<=",ok:Hu.LTE,fail:Hu.GT},formatMinimum:{okStr:">=",ok:Hu.GTE,fail:Hu.LT},formatExclusiveMaximum:{okStr:"<",ok:Hu.LT,fail:Hu.GTE},formatExclusiveMinimum:{okStr:">",ok:Hu.GT,fail:Hu.LTE}},tWe={message:({keyword:t,schemaCode:e})=>(0,aa.str)`should be ${lb[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,aa._)`{comparison: ${lb[t].okStr}, limit: ${e}}`};xf.formatLimitDefinition={keyword:Object.keys(lb),type:"string",schemaType:"string",$data:!0,error:tWe,code(t){let{gen:e,data:r,schemaCode:n,keyword:i,it:s}=t,{opts:o,self:a}=s;if(!o.validateFormats)return;let A=new eWe.KeywordCxt(s,a.RULES.all.format.definition,"format");A.$data?c():u();function c(){let d=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),g=e.const("fmt",(0,aa._)`${d}[${A.schemaCode}]`);t.fail$data((0,aa.or)((0,aa._)`typeof ${g} != "object"`,(0,aa._)`${g} instanceof RegExp`,(0,aa._)`typeof ${g}.compare != "function"`,l(g)))}function u(){let d=A.schema,g=a.formats[d];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${i}": format "${d}" does not define "compare" function`);let p=e.scopeValue("formats",{key:d,ref:g,code:o.code.formats?(0,aa._)`${o.code.formats}${(0,aa.getProperty)(d)}`:void 0});t.fail$data(l(p))}function l(d){return(0,aa._)`${d}.compare(${r}, ${n}) ${lb[i].fail} 0`}},dependencies:["format"]};var rWe=t=>(t.addKeyword(xf.formatLimitDefinition),t);xf.default=rWe});var VAe=R((JI,$Ae)=>{"use strict";h();Object.defineProperty(JI,"__esModule",{value:!0});var Ff=JAe(),nWe=YAe(),J2=Et(),jAe=new J2.Name("fullFormats"),iWe=new J2.Name("fastFormats"),Y2=(t,e={keywords:!0})=>{if(Array.isArray(e))return qAe(t,e,Ff.fullFormats,jAe),t;let[r,n]=e.mode==="fast"?[Ff.fastFormats,iWe]:[Ff.fullFormats,jAe],i=e.formats||Ff.formatNames;return qAe(t,i,r,n),e.keywords&&(0,nWe.default)(t),t};Y2.get=(t,e="full")=>{let n=(e==="fast"?Ff.fastFormats:Ff.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function qAe(t,e,r,n){var i,s;(i=(s=t.opts.code).formats)!==null&&i!==void 0||(s.formats=(0,J2._)`require("ajv-formats/dist/formats").${n}`);for(let o of e)t.addFormat(o,r[o])}$Ae.exports=JI=Y2;Object.defineProperty(JI,"__esModule",{value:!0});JI.default=Y2});function sWe(){let t=new WAe.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,zAe.default)(t),t}var WAe,zAe,kf,j2=L(()=>{h();WAe=z(_2(),1),zAe=z(VAe(),1);kf=class{constructor(e){this._ajv=e??sWe()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var gb,XAe=L(()=>{h();ra();gb=class{constructor(e){this._client=e}async*callToolStream(e,r=Ru,n){let i=this._client,s={...n,task:n?.task??(i.isToolTask(e.name)?{}:void 0)},o=i.requestStream({method:"tools/call",params:e},r,s),a=i.getToolOutputValidator(e.name);for await(let A of o){if(A.type==="result"&&a){let c=A.result;if(!c.structuredContent&&!c.isError){yield{type:"error",error:new Ge($e.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(c.structuredContent)try{let u=a(c.structuredContent);if(!u.valid){yield{type:"error",error:new Ge($e.InvalidParams,`Structured content does not match the tool's output schema: ${u.errorMessage}`)};return}}catch(u){if(u instanceof Ge){yield{type:"error",error:u};return}yield{type:"error",error:new Ge($e.InvalidParams,`Failed to validate structured content: ${u instanceof Error?u.message:String(u)}`)};return}}yield A}}async getTask(e,r){return this._client.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._client.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._client.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._client.cancelTask({taskId:e},r)}requestStream(e,r,n){return this._client.requestStream(e,r,n)}}});function pb(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function db(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var q2=L(()=>{h()});function fb(t,e){if(!(!t||e===null||typeof e!="object")){if(t.type==="object"&&t.properties&&typeof t.properties=="object"){let r=e,n=t.properties;for(let i of Object.keys(n)){let s=n[i];r[i]===void 0&&Object.prototype.hasOwnProperty.call(s,"default")&&(r[i]=s.default),r[i]!==void 0&&fb(s,r[i])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&fb(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&fb(r,e)}}function oWe(t){if(!t)return{supportsFormMode:!1,supportsUrlMode:!1};let e=t.form!==void 0,r=t.url!==void 0;return{supportsFormMode:e||!e&&!r,supportsUrlMode:r}}var YI,ZAe=L(()=>{h();Z_();ra();j2();nI();XAe();q2();YI=class extends pf{constructor(e,r){super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new kf,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",m_,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",d_,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",a_,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new gb(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=F0(this._capabilities,e)}setRequestHandler(e,r){let i=uf(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let s;if(vu(i)){let a=i;s=a._zod?.def?.value??a.value}else{let a=i;s=a._def?.value??a.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");let o=s;if(o==="elicitation/create"){let a=async(A,c)=>{let u=Pi(E_,A);if(!u.success){let I=u.error instanceof Error?u.error.message:String(u.error);throw new Ge($e.InvalidParams,`Invalid elicitation request: ${I}`)}let{params:l}=u.data;l.mode=l.mode??"form";let{supportsFormMode:d,supportsUrlMode:g}=oWe(this._capabilities.elicitation);if(l.mode==="form"&&!d)throw new Ge($e.InvalidParams,"Client does not support form-mode elicitation requests");if(l.mode==="url"&&!g)throw new Ge($e.InvalidParams,"Client does not support URL-mode elicitation requests");let p=await Promise.resolve(r(A,c));if(l.task){let I=Pi(oc,p);if(!I.success){let B=I.error instanceof Error?I.error.message:String(I.error);throw new Ge($e.InvalidParams,`Invalid task creation result: ${B}`)}return I.data}let f=Pi(Nu,p);if(!f.success){let I=f.error instanceof Error?f.error.message:String(f.error);throw new Ge($e.InvalidParams,`Invalid elicitation result: ${I}`)}let m=f.data,C=l.mode==="form"?l.requestedSchema:void 0;if(l.mode==="form"&&m.action==="accept"&&m.content&&C&&this._capabilities.elicitation?.form?.applyDefaults)try{fb(C,m.content)}catch{}return m};return super.setRequestHandler(e,a)}if(o==="sampling/createMessage"){let a=async(A,c)=>{let u=Pi(I_,A);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new Ge($e.InvalidParams,`Invalid sampling request: ${m}`)}let{params:l}=u.data,d=await Promise.resolve(r(A,c));if(l.task){let m=Pi(oc,d);if(!m.success){let C=m.error instanceof Error?m.error.message:String(m.error);throw new Ge($e.InvalidParams,`Invalid task creation result: ${C}`)}return m.data}let p=l.tools||l.toolChoice?dI:bg,f=Pi(p,d);if(!f.success){let m=f.error instanceof Error?f.error.message:String(f.error);throw new Ge($e.InvalidParams,`Invalid sampling result: ${m}`)}return f.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapability(e,r){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{let n=await this.request({method:"initialize",params:{protocolVersion:xu,capabilities:this._capabilities,clientInfo:this._clientInfo}},XL,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!l0.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break;case"ping":break}}assertTaskCapability(e){pb(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&db(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},sc,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},B_,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},sc,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},p_,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},A_,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},t_,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},n_,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},o_,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},sc,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},sc,r)}async callTool(e,r=Ru,n){if(this.isToolTaskRequired(e.name))throw new Ge($e.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let i=await this.request({method:"tools/call",params:e},r,n),s=this.getToolOutputValidator(e.name);if(s){if(!i.structuredContent&&!i.isError)throw new Ge($e.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(i.structuredContent)try{let o=s(i.structuredContent);if(!o.valid)throw new Ge($e.InvalidParams,`Structured content does not match the tool's output schema: ${o.errorMessage}`)}catch(o){throw o instanceof Ge?o:new Ge($e.InvalidParams,`Failed to validate structured content: ${o instanceof Error?o.message:String(o)}`)}}return i}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of e){if(r.outputSchema){let i=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,i)}let n=r.execution?.taskSupport;(n==="required"||n==="optional")&&this._cachedKnownTaskTools.add(r.name),n==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){let n=await this.request({method:"tools/list",params:e},h_,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,i){let s=soe.safeParse(n);if(!s.success)throw new Error(`Invalid ${e} listChanged options: ${s.error.message}`);if(typeof n.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:o,debounceMs:a}=s.data,{onChanged:A}=n,c=async()=>{if(!o){A(null,null);return}try{let l=await i();A(null,l)}catch(l){let d=l instanceof Error?l:new Error(String(l));A(d,null)}},u=()=>{if(a){let l=this._listChangedDebounceTimers.get(e);l&&clearTimeout(l);let d=setTimeout(c,a);this._listChangedDebounceTimers.set(e,d)}else c()};this.setNotificationHandler(r,u)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}});var ice=R((gjt,nce)=>{h();nce.exports=rce;rce.sync=AWe;var ece=require("fs");function aWe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function tce(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:aWe(e,r)}function rce(t,e,r){ece.stat(t,function(n,i){r(n,n?!1:tce(i,t,e))})}function AWe(t,e){return tce(ece.statSync(t),t,e)}});var cce=R((djt,Ace)=>{h();Ace.exports=oce;oce.sync=cWe;var sce=require("fs");function oce(t,e,r){sce.stat(t,function(n,i){r(n,n?!1:ace(i,e))})}function cWe(t,e){return ace(sce.statSync(t),e)}function ace(t,e){return t.isFile()&&uWe(t,e)}function uWe(t,e){var r=t.mode,n=t.uid,i=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),A=parseInt("010",8),c=parseInt("001",8),u=a|A,l=r&c||r&A&&i===o||r&a&&n===s||r&u&&s===0;return l}});var lce=R((mjt,uce)=>{h();var hjt=require("fs"),hb;process.platform==="win32"||global.TESTING_WINDOWS?hb=ice():hb=cce();uce.exports=$2;$2.sync=lWe;function $2(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){$2(t,e||{},function(s,o){s?i(s):n(o)})})}hb(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function lWe(t,e){try{return hb.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Cce=R((Ijt,mce)=>{h();var Rf=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",gce=require("path"),gWe=Rf?";":":",pce=lce(),dce=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),fce=(t,e)=>{let r=e.colon||gWe,n=t.match(/\//)||Rf&&t.match(/\\/)?[""]:[...Rf?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=Rf?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Rf?i.split(r):[""];return Rf&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:i}},hce=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:s}=fce(t,e),o=[],a=c=>new Promise((u,l)=>{if(c===n.length)return e.all&&o.length?u(o):l(dce(t));let d=n[c],g=/^".*"$/.test(d)?d.slice(1,-1):d,p=gce.join(g,t),f=!g&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;u(A(f,c,0))}),A=(c,u,l)=>new Promise((d,g)=>{if(l===i.length)return d(a(u+1));let p=i[l];pce(c+p,{pathExt:s},(f,m)=>{if(!f&&m)if(e.all)o.push(c+p);else return d(c+p);return d(A(c,u,l+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},pWe=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=fce(t,e),s=[];for(let o=0;o<r.length;o++){let a=r[o],A=/^".*"$/.test(a)?a.slice(1,-1):a,c=gce.join(A,t),u=!A&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let l=0;l<n.length;l++){let d=u+n[l];try{if(pce.sync(d,{pathExt:i}))if(e.all)s.push(d);else return d}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw dce(t)};mce.exports=hce;hce.sync=pWe});var Ece=R((Bjt,V2)=>{"use strict";h();var Ice=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};V2.exports=Ice;V2.exports.default=Ice});var Dce=R((Qjt,Qce)=>{"use strict";h();var Bce=require("path"),dWe=Cce(),fWe=Ece();function yce(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,s=i&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let o;try{o=dWe.sync(t.command,{path:r[fWe({env:r})],pathExt:e?Bce.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return o&&(o=Bce.resolve(i?t.options.cwd:"",o)),o}function hWe(t){return yce(t)||yce(t,!0)}Qce.exports=hWe});var wce=R((wjt,z2)=>{"use strict";h();var W2=/([()\][%!^"`<>&|;, *?])/g;function mWe(t){return t=t.replace(W2,"^$1"),t}function CWe(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(W2,"^$1"),e&&(t=t.replace(W2,"^$1")),t}z2.exports.command=mWe;z2.exports.argument=CWe});var Sce=R((Sjt,bce)=>{"use strict";h();bce.exports=/^#!(.*)/});var xce=R((xjt,vce)=>{"use strict";h();var IWe=Sce();vce.exports=(t="")=>{let e=t.match(IWe);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var kce=R((kjt,Fce)=>{"use strict";h();var X2=require("fs"),EWe=xce();function BWe(t){let r=Buffer.alloc(150),n;try{n=X2.openSync(t,"r"),X2.readSync(n,r,0,150,0),X2.closeSync(n)}catch{}return EWe(r.toString())}Fce.exports=BWe});var Mce=R((Njt,Tce)=>{"use strict";h();var yWe=require("path"),Rce=Dce(),Nce=wce(),QWe=kce(),DWe=process.platform==="win32",wWe=/\.(?:com|exe)$/i,bWe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function SWe(t){t.file=Rce(t);let e=t.file&&QWe(t.file);return e?(t.args.unshift(t.file),t.command=e,Rce(t)):t.file}function vWe(t){if(!DWe)return t;let e=SWe(t),r=!wWe.test(e);if(t.options.forceShell||r){let n=bWe.test(e);t.command=yWe.normalize(t.command),t.command=Nce.command(t.command),t.args=t.args.map(s=>Nce.argument(s,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function xWe(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:vWe(n)}Tce.exports=xWe});var _ce=R((Mjt,Lce)=>{"use strict";h();var Z2=process.platform==="win32";function eG(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function FWe(t,e){if(!Z2)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let s=Pce(i,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}function Pce(t,e){return Z2&&t===1&&!e.file?eG(e.original,"spawn"):null}function kWe(t,e){return Z2&&t===1&&!e.file?eG(e.original,"spawnSync"):null}Lce.exports={hookChildProcess:FWe,verifyENOENT:Pce,verifyENOENTSync:kWe,notFoundError:eG}});var nG=R((Ljt,Nf)=>{"use strict";h();var Uce=require("child_process"),tG=Mce(),rG=_ce();function Gce(t,e,r){let n=tG(t,e,r),i=Uce.spawn(n.command,n.args,n.options);return rG.hookChildProcess(i,n),i}function RWe(t,e,r){let n=tG(t,e,r),i=Uce.spawnSync(n.command,n.args,n.options);return i.error=i.error||rG.verifyENOENTSync(i.status,n),i}Nf.exports=Gce;Nf.exports.spawn=Gce;Nf.exports.sync=RWe;Nf.exports._parse=tG;Nf.exports._enoent=rG});function NWe(t){return ku.parse(JSON.parse(t))}function mb(t){return JSON.stringify(t)+`
|
|
1808
|
+
deps: ${r}}`};var N$e={keyword:"dependencies",type:"object",schemaType:"object",error:oA.error,code(t){let[e,r]=T$e(t);sAe(t,e),oAe(t,r)}};function T$e({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function sAe(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let A=(0,HI.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(A,()=>{for(let c of a)(0,HI.checkReportMissingProp)(t,c)}):(r.if((0,C2._)`${A} && (${(0,HI.checkMissingProp)(t,a,s)})`),(0,HI.reportMissingProp)(t,s),r.else())}}oA.validatePropertyDeps=sAe;function oAe(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let a in e)(0,R$e.alwaysValidSchema)(s,e[a])||(r.if((0,HI.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let A=t.subschema({keyword:i,schemaProp:a},o);t.mergeValidEvaluated(A,o)},()=>r.var(o,!0)),t.ok(o))}oA.validateSchemaDeps=oAe;oA.default=N$e});var cAe=R(I2=>{"use strict";h();Object.defineProperty(I2,"__esModule",{value:!0});var AAe=Et(),M$e=Yt(),P$e={message:"property name must be valid",params:({params:t})=>(0,AAe._)`{propertyName: ${t.propertyName}}`},L$e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:P$e,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,M$e.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,AAe.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};I2.default=L$e});var B2=R(E2=>{"use strict";h();Object.defineProperty(E2,"__esModule",{value:!0});var ib=uo(),oa=Et(),_$e=uc(),sb=Yt(),U$e={message:"must NOT have additional properties",params:({params:t})=>(0,oa._)`{additionalProperty: ${t.additionalProperty}}`},G$e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:U$e,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:A}=o;if(o.props=!0,A.removeAdditional!=="all"&&(0,sb.alwaysValidSchema)(o,r))return;let c=(0,ib.allSchemaProperties)(n.properties),u=(0,ib.allSchemaProperties)(n.patternProperties);l(),t.ok((0,oa._)`${s} === ${_$e.default.errors}`);function l(){e.forIn("key",i,m=>{!c.length&&!u.length?p(m):e.if(d(m),()=>p(m))})}function d(m){let C;if(c.length>8){let I=(0,sb.schemaRefOrVal)(o,n.properties,"properties");C=(0,ib.isOwnProperty)(e,I,m)}else c.length?C=(0,oa.or)(...c.map(I=>(0,oa._)`${m} === ${I}`)):C=oa.nil;return u.length&&(C=(0,oa.or)(C,...u.map(I=>(0,oa._)`${(0,ib.usePattern)(t,I)}.test(${m})`))),(0,oa.not)(C)}function g(m){e.code((0,oa._)`delete ${i}[${m}]`)}function p(m){if(A.removeAdditional==="all"||A.removeAdditional&&r===!1){g(m);return}if(r===!1){t.setParams({additionalProperty:m}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,sb.alwaysValidSchema)(o,r)){let C=e.name("valid");A.removeAdditional==="failing"?(f(m,C,!1),e.if((0,oa.not)(C),()=>{t.reset(),g(m)})):(f(m,C),a||e.if((0,oa.not)(C),()=>e.break()))}}function f(m,C,I){let B={keyword:"additionalProperties",dataProp:m,dataPropType:sb.Type.Str};I===!1&&Object.assign(B,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(B,C)}}};E2.default=G$e});var gAe=R(Q2=>{"use strict";h();Object.defineProperty(Q2,"__esModule",{value:!0});var O$e=xI(),uAe=uo(),y2=Yt(),lAe=B2(),K$e={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&lAe.default.code(new O$e.KeywordCxt(s,lAe.default,"additionalProperties"));let o=(0,uAe.allSchemaProperties)(r);for(let l of o)s.definedProperties.add(l);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=y2.mergeEvaluated.props(e,(0,y2.toHash)(o),s.props));let a=o.filter(l=>!(0,y2.alwaysValidSchema)(s,r[l]));if(a.length===0)return;let A=e.name("valid");for(let l of a)c(l)?u(l):(e.if((0,uAe.propertyInData)(e,i,l,s.opts.ownProperties)),u(l),s.allErrors||e.else().var(A,!0),e.endIf()),t.it.definedProperties.add(l),t.ok(A);function c(l){return s.opts.useDefaults&&!s.compositeRule&&r[l].default!==void 0}function u(l){t.subschema({keyword:"properties",schemaProp:l,dataProp:l},A)}}};Q2.default=K$e});var hAe=R(D2=>{"use strict";h();Object.defineProperty(D2,"__esModule",{value:!0});var pAe=uo(),ob=Et(),dAe=Yt(),fAe=Yt(),H$e={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:o}=s,a=(0,pAe.allSchemaProperties)(r),A=a.filter(f=>(0,dAe.alwaysValidSchema)(s,r[f]));if(a.length===0||A.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let c=o.strictSchema&&!o.allowMatchingProperties&&i.properties,u=e.name("valid");s.props!==!0&&!(s.props instanceof ob.Name)&&(s.props=(0,fAe.evaluatedPropsToName)(e,s.props));let{props:l}=s;d();function d(){for(let f of a)c&&g(f),s.allErrors?p(f):(e.var(u,!0),p(f),e.if(u))}function g(f){for(let m in c)new RegExp(f).test(m)&&(0,dAe.checkStrictMode)(s,`property ${m} matches pattern ${f} (use allowMatchingProperties)`)}function p(f){e.forIn("key",n,m=>{e.if((0,ob._)`${(0,pAe.usePattern)(t,f)}.test(${m})`,()=>{let C=A.includes(f);C||t.subschema({keyword:"patternProperties",schemaProp:f,dataProp:m,dataPropType:fAe.Type.Str},u),s.opts.unevaluated&&l!==!0?e.assign((0,ob._)`${l}[${m}]`,!0):!C&&!s.allErrors&&e.if((0,ob.not)(u),()=>e.break())})})}}};D2.default=H$e});var mAe=R(w2=>{"use strict";h();Object.defineProperty(w2,"__esModule",{value:!0});var J$e=Yt(),Y$e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,J$e.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};w2.default=Y$e});var CAe=R(b2=>{"use strict";h();Object.defineProperty(b2,"__esModule",{value:!0});var j$e=uo(),q$e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:j$e.validateUnion,error:{message:"must match a schema in anyOf"}};b2.default=q$e});var IAe=R(S2=>{"use strict";h();Object.defineProperty(S2,"__esModule",{value:!0});var ab=Et(),$$e=Yt(),V$e={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,ab._)`{passingSchemas: ${t.passing}}`},W$e={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:V$e,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=e.let("valid",!1),a=e.let("passing",null),A=e.name("_valid");t.setParams({passing:a}),e.block(c),t.result(o,()=>t.reset(),()=>t.error(!0));function c(){s.forEach((u,l)=>{let d;(0,$$e.alwaysValidSchema)(i,u)?e.var(A,!0):d=t.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},A),l>0&&e.if((0,ab._)`${A} && ${o}`).assign(o,!1).assign(a,(0,ab._)`[${a}, ${l}]`).else(),e.if(A,()=>{e.assign(o,!0),e.assign(a,l),d&&t.mergeEvaluated(d,ab.Name)})})}}};S2.default=W$e});var EAe=R(v2=>{"use strict";h();Object.defineProperty(v2,"__esModule",{value:!0});var z$e=Yt(),X$e={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,o)=>{if((0,z$e.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(a)})}};v2.default=X$e});var QAe=R(x2=>{"use strict";h();Object.defineProperty(x2,"__esModule",{value:!0});var Ab=Et(),yAe=Yt(),Z$e={message:({params:t})=>(0,Ab.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Ab._)`{failingKeyword: ${t.ifClause}}`},eVe={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Z$e,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,yAe.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=BAe(n,"then"),s=BAe(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),a=e.name("_valid");if(A(),t.reset(),i&&s){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,c("then",u),c("else",u))}else i?e.if(a,c("then")):e.if((0,Ab.not)(a),c("else"));t.pass(o,()=>t.error(!0));function A(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function c(u,l){return()=>{let d=t.subschema({keyword:u},a);e.assign(o,a),t.mergeValidEvaluated(d,o),l?e.assign(l,(0,Ab._)`${u}`):t.setParams({ifClause:u})}}}};function BAe(t,e){let r=t.schema[e];return r!==void 0&&!(0,yAe.alwaysValidSchema)(t,r)}x2.default=eVe});var DAe=R(F2=>{"use strict";h();Object.defineProperty(F2,"__esModule",{value:!0});var tVe=Yt(),rVe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,tVe.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};F2.default=rVe});var wAe=R(k2=>{"use strict";h();Object.defineProperty(k2,"__esModule",{value:!0});var nVe=p2(),iVe=tAe(),sVe=d2(),oVe=nAe(),aVe=iAe(),AVe=aAe(),cVe=cAe(),uVe=B2(),lVe=gAe(),gVe=hAe(),pVe=mAe(),dVe=CAe(),fVe=IAe(),hVe=EAe(),mVe=QAe(),CVe=DAe();function IVe(t=!1){let e=[pVe.default,dVe.default,fVe.default,hVe.default,mVe.default,CVe.default,cVe.default,uVe.default,AVe.default,lVe.default,gVe.default];return t?e.push(iVe.default,oVe.default):e.push(nVe.default,sVe.default),e.push(aVe.default),e}k2.default=IVe});var bAe=R(R2=>{"use strict";h();Object.defineProperty(R2,"__esModule",{value:!0});var en=Et(),EVe={message:({schemaCode:t})=>(0,en.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,en._)`{format: ${t}}`},BVe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:EVe,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:a}=t,{opts:A,errSchemaPath:c,schemaEnv:u,self:l}=a;if(!A.validateFormats)return;i?d():g();function d(){let p=r.scopeValue("formats",{ref:l.formats,code:A.code.formats}),f=r.const("fDef",(0,en._)`${p}[${o}]`),m=r.let("fType"),C=r.let("format");r.if((0,en._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>r.assign(m,(0,en._)`${f}.type || "string"`).assign(C,(0,en._)`${f}.validate`),()=>r.assign(m,(0,en._)`"string"`).assign(C,f)),t.fail$data((0,en.or)(I(),B()));function I(){return A.strictSchema===!1?en.nil:(0,en._)`${o} && !${C}`}function B(){let E=u.$async?(0,en._)`(${f}.async ? await ${C}(${n}) : ${C}(${n}))`:(0,en._)`${C}(${n})`,y=(0,en._)`(typeof ${C} == "function" ? ${E} : ${C}.test(${n}))`;return(0,en._)`${C} && ${C} !== true && ${m} === ${e} && !${y}`}}function g(){let p=l.formats[s];if(!p){I();return}if(p===!0)return;let[f,m,C]=B(p);f===e&&t.pass(E());function I(){if(A.strictSchema===!1){l.logger.warn(y());return}throw new Error(y());function y(){return`unknown format "${s}" ignored in schema at path "${c}"`}}function B(y){let Q=y instanceof RegExp?(0,en.regexpCode)(y):A.code.formats?(0,en._)`${A.code.formats}${(0,en.getProperty)(s)}`:void 0,w=r.scopeValue("formats",{key:s,ref:y,code:Q});return typeof y=="object"&&!(y instanceof RegExp)?[y.type||"string",y.validate,(0,en._)`${w}.validate`]:["string",y,w]}function E(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!u.$async)throw new Error("async format in sync schema");return(0,en._)`await ${C}(${n})`}return typeof m=="function"?(0,en._)`${C}(${n})`:(0,en._)`${C}.test(${n})`}}}};R2.default=BVe});var SAe=R(N2=>{"use strict";h();Object.defineProperty(N2,"__esModule",{value:!0});var yVe=bAe(),QVe=[yVe.default];N2.default=QVe});var vAe=R(wf=>{"use strict";h();Object.defineProperty(wf,"__esModule",{value:!0});wf.contentVocabulary=wf.metadataVocabulary=void 0;wf.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];wf.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var FAe=R(T2=>{"use strict";h();Object.defineProperty(T2,"__esModule",{value:!0});var DVe=Lae(),wVe=zae(),bVe=wAe(),SVe=SAe(),xAe=vAe(),vVe=[DVe.default,wVe.default,(0,bVe.default)(),SVe.default,xAe.metadataVocabulary,xAe.contentVocabulary];T2.default=vVe});var RAe=R(cb=>{"use strict";h();Object.defineProperty(cb,"__esModule",{value:!0});cb.DiscrError=void 0;var kAe;(function(t){t.Tag="tag",t.Mapping="mapping"})(kAe||(cb.DiscrError=kAe={}))});var TAe=R(P2=>{"use strict";h();Object.defineProperty(P2,"__esModule",{value:!0});var bf=Et(),M2=RAe(),NAe=Y0(),xVe=FI(),FVe=Yt(),kVe={message:({params:{discrError:t,tagName:e}})=>t===M2.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,bf._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},RVe={keyword:"discriminator",type:"object",schemaType:"object",error:kVe,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let A=e.let("valid",!1),c=e.const("tag",(0,bf._)`${r}${(0,bf.getProperty)(a)}`);e.if((0,bf._)`typeof ${c} == "string"`,()=>u(),()=>t.error(!1,{discrError:M2.DiscrError.Tag,tag:c,tagName:a})),t.ok(A);function u(){let g=d();e.if(!1);for(let p in g)e.elseIf((0,bf._)`${c} === ${p}`),e.assign(A,l(g[p]));e.else(),t.error(!1,{discrError:M2.DiscrError.Mapping,tag:c,tagName:a}),e.endIf()}function l(g){let p=e.name("valid"),f=t.subschema({keyword:"oneOf",schemaProp:g},p);return t.mergeEvaluated(f,bf.Name),p}function d(){var g;let p={},f=C(i),m=!0;for(let E=0;E<o.length;E++){let y=o[E];if(y?.$ref&&!(0,FVe.schemaHasRulesButRef)(y,s.self.RULES)){let w=y.$ref;if(y=NAe.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,w),y instanceof NAe.SchemaEnv&&(y=y.schema),y===void 0)throw new xVe.default(s.opts.uriResolver,s.baseId,w)}let Q=(g=y?.properties)===null||g===void 0?void 0:g[a];if(typeof Q!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);m=m&&(f||C(y)),I(Q,E)}if(!m)throw new Error(`discriminator: "${a}" must be required`);return p;function C({required:E}){return Array.isArray(E)&&E.includes(a)}function I(E,y){if(E.const)B(E.const,y);else if(E.enum)for(let Q of E.enum)B(Q,y);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function B(E,y){if(typeof E!="string"||E in p)throw new Error(`discriminator: "${a}" values must be unique strings`);p[E]=y}}}};P2.default=RVe});var MAe=R((J9t,NVe)=>{NVe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var _2=R((Sr,L2)=>{"use strict";h();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.MissingRefError=Sr.ValidationError=Sr.CodeGen=Sr.Name=Sr.nil=Sr.stringify=Sr.str=Sr._=Sr.KeywordCxt=Sr.Ajv=void 0;var TVe=kae(),MVe=FAe(),PVe=TAe(),PAe=MAe(),LVe=["/properties"],ub="http://json-schema.org/draft-07/schema",Sf=class extends TVe.default{_addVocabularies(){super._addVocabularies(),MVe.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(PVe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(PAe,LVe):PAe;this.addMetaSchema(e,ub,!1),this.refs["http://json-schema.org/schema"]=ub}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ub)?ub:void 0)}};Sr.Ajv=Sf;L2.exports=Sr=Sf;L2.exports.Ajv=Sf;Object.defineProperty(Sr,"__esModule",{value:!0});Sr.default=Sf;var _Ve=xI();Object.defineProperty(Sr,"KeywordCxt",{enumerable:!0,get:function(){return _Ve.KeywordCxt}});var vf=Et();Object.defineProperty(Sr,"_",{enumerable:!0,get:function(){return vf._}});Object.defineProperty(Sr,"str",{enumerable:!0,get:function(){return vf.str}});Object.defineProperty(Sr,"stringify",{enumerable:!0,get:function(){return vf.stringify}});Object.defineProperty(Sr,"nil",{enumerable:!0,get:function(){return vf.nil}});Object.defineProperty(Sr,"Name",{enumerable:!0,get:function(){return vf.Name}});Object.defineProperty(Sr,"CodeGen",{enumerable:!0,get:function(){return vf.CodeGen}});var UVe=H0();Object.defineProperty(Sr,"ValidationError",{enumerable:!0,get:function(){return UVe.default}});var GVe=FI();Object.defineProperty(Sr,"MissingRefError",{enumerable:!0,get:function(){return GVe.default}})});var JAe=R(AA=>{"use strict";h();Object.defineProperty(AA,"__esModule",{value:!0});AA.formatNames=AA.fastFormats=AA.fullFormats=void 0;function aA(t,e){return{validate:t,compare:e}}AA.fullFormats={date:aA(GAe,K2),time:aA(G2(!0),H2),"date-time":aA(LAe(!0),KAe),"iso-time":aA(G2(),OAe),"iso-date-time":aA(LAe(),HAe),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:jVe,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:ZVe,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:qVe,int32:{type:"number",validate:WVe},int64:{type:"number",validate:zVe},float:{type:"number",validate:UAe},double:{type:"number",validate:UAe},password:!0,binary:!0};AA.fastFormats={...AA.fullFormats,date:aA(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,K2),time:aA(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,H2),"date-time":aA(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,KAe),"iso-time":aA(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,OAe),"iso-date-time":aA(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,HAe),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};AA.formatNames=Object.keys(AA.fullFormats);function OVe(t){return t%4===0&&(t%100!==0||t%400===0)}var KVe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,HVe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function GAe(t){let e=KVe.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&OVe(r)?29:HVe[n])}function K2(t,e){if(t&&e)return t>e?1:t<e?-1:0}var U2=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function G2(t){return function(r){let n=U2.exec(r);if(!n)return!1;let i=+n[1],s=+n[2],o=+n[3],a=n[4],A=n[5]==="-"?-1:1,c=+(n[6]||0),u=+(n[7]||0);if(c>23||u>59||t&&!a)return!1;if(i<=23&&s<=59&&o<60)return!0;let l=s-u*A,d=i-c*A-(l<0?1:0);return(d===23||d===-1)&&(l===59||l===-1)&&o<61}}function H2(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function OAe(t,e){if(!(t&&e))return;let r=U2.exec(t),n=U2.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var O2=/t|\s/i;function LAe(t){let e=G2(t);return function(n){let i=n.split(O2);return i.length===2&&GAe(i[0])&&e(i[1])}}function KAe(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function HAe(t,e){if(!(t&&e))return;let[r,n]=t.split(O2),[i,s]=e.split(O2),o=K2(r,i);if(o!==void 0)return o||H2(n,s)}var JVe=/\/|:/,YVe=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function jVe(t){return JVe.test(t)&&YVe.test(t)}var _Ae=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function qVe(t){return _Ae.lastIndex=0,_Ae.test(t)}var $Ve=-(2**31),VVe=2**31-1;function WVe(t){return Number.isInteger(t)&&t<=VVe&&t>=$Ve}function zVe(t){return Number.isInteger(t)}function UAe(){return!0}var XVe=/[^\\]\\Z/;function ZVe(t){if(XVe.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var YAe=R(xf=>{"use strict";h();Object.defineProperty(xf,"__esModule",{value:!0});xf.formatLimitDefinition=void 0;var eWe=_2(),aa=Et(),Hu=aa.operators,lb={formatMaximum:{okStr:"<=",ok:Hu.LTE,fail:Hu.GT},formatMinimum:{okStr:">=",ok:Hu.GTE,fail:Hu.LT},formatExclusiveMaximum:{okStr:"<",ok:Hu.LT,fail:Hu.GTE},formatExclusiveMinimum:{okStr:">",ok:Hu.GT,fail:Hu.LTE}},tWe={message:({keyword:t,schemaCode:e})=>(0,aa.str)`should be ${lb[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,aa._)`{comparison: ${lb[t].okStr}, limit: ${e}}`};xf.formatLimitDefinition={keyword:Object.keys(lb),type:"string",schemaType:"string",$data:!0,error:tWe,code(t){let{gen:e,data:r,schemaCode:n,keyword:i,it:s}=t,{opts:o,self:a}=s;if(!o.validateFormats)return;let A=new eWe.KeywordCxt(s,a.RULES.all.format.definition,"format");A.$data?c():u();function c(){let d=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),g=e.const("fmt",(0,aa._)`${d}[${A.schemaCode}]`);t.fail$data((0,aa.or)((0,aa._)`typeof ${g} != "object"`,(0,aa._)`${g} instanceof RegExp`,(0,aa._)`typeof ${g}.compare != "function"`,l(g)))}function u(){let d=A.schema,g=a.formats[d];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${i}": format "${d}" does not define "compare" function`);let p=e.scopeValue("formats",{key:d,ref:g,code:o.code.formats?(0,aa._)`${o.code.formats}${(0,aa.getProperty)(d)}`:void 0});t.fail$data(l(p))}function l(d){return(0,aa._)`${d}.compare(${r}, ${n}) ${lb[i].fail} 0`}},dependencies:["format"]};var rWe=t=>(t.addKeyword(xf.formatLimitDefinition),t);xf.default=rWe});var VAe=R((JI,$Ae)=>{"use strict";h();Object.defineProperty(JI,"__esModule",{value:!0});var Ff=JAe(),nWe=YAe(),J2=Et(),jAe=new J2.Name("fullFormats"),iWe=new J2.Name("fastFormats"),Y2=(t,e={keywords:!0})=>{if(Array.isArray(e))return qAe(t,e,Ff.fullFormats,jAe),t;let[r,n]=e.mode==="fast"?[Ff.fastFormats,iWe]:[Ff.fullFormats,jAe],i=e.formats||Ff.formatNames;return qAe(t,i,r,n),e.keywords&&(0,nWe.default)(t),t};Y2.get=(t,e="full")=>{let n=(e==="fast"?Ff.fastFormats:Ff.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function qAe(t,e,r,n){var i,s;(i=(s=t.opts.code).formats)!==null&&i!==void 0||(s.formats=(0,J2._)`require("ajv-formats/dist/formats").${n}`);for(let o of e)t.addFormat(o,r[o])}$Ae.exports=JI=Y2;Object.defineProperty(JI,"__esModule",{value:!0});JI.default=Y2});function sWe(){let t=new WAe.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,zAe.default)(t),t}var WAe,zAe,kf,j2=L(()=>{h();WAe=z(_2(),1),zAe=z(VAe(),1);kf=class{constructor(e){this._ajv=e??sWe()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var gb,XAe=L(()=>{h();ra();gb=class{constructor(e){this._client=e}async*callToolStream(e,r=Ru,n){let i=this._client,s={...n,task:n?.task??(i.isToolTask(e.name)?{}:void 0)},o=i.requestStream({method:"tools/call",params:e},r,s),a=i.getToolOutputValidator(e.name);for await(let A of o){if(A.type==="result"&&a){let c=A.result;if(!c.structuredContent&&!c.isError){yield{type:"error",error:new Ge($e.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(c.structuredContent)try{let u=a(c.structuredContent);if(!u.valid){yield{type:"error",error:new Ge($e.InvalidParams,`Structured content does not match the tool's output schema: ${u.errorMessage}`)};return}}catch(u){if(u instanceof Ge){yield{type:"error",error:u};return}yield{type:"error",error:new Ge($e.InvalidParams,`Failed to validate structured content: ${u instanceof Error?u.message:String(u)}`)};return}}yield A}}async getTask(e,r){return this._client.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._client.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._client.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._client.cancelTask({taskId:e},r)}requestStream(e,r,n){return this._client.requestStream(e,r,n)}}});function pb(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function db(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var q2=L(()=>{h()});function fb(t,e){if(!(!t||e===null||typeof e!="object")){if(t.type==="object"&&t.properties&&typeof t.properties=="object"){let r=e,n=t.properties;for(let i of Object.keys(n)){let s=n[i];r[i]===void 0&&Object.prototype.hasOwnProperty.call(s,"default")&&(r[i]=s.default),r[i]!==void 0&&fb(s,r[i])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&fb(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&fb(r,e)}}function oWe(t){if(!t)return{supportsFormMode:!1,supportsUrlMode:!1};let e=t.form!==void 0,r=t.url!==void 0;return{supportsFormMode:e||!e&&!r,supportsUrlMode:r}}var YI,ZAe=L(()=>{h();Z_();ra();j2();nI();XAe();q2();YI=class extends pf{constructor(e,r){super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new kf,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",m_,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",d_,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",a_,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new gb(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=F0(this._capabilities,e)}setRequestHandler(e,r){let i=uf(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let s;if(vu(i)){let a=i;s=a._zod?.def?.value??a.value}else{let a=i;s=a._def?.value??a.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");let o=s;if(o==="elicitation/create"){let a=async(A,c)=>{let u=Pi(E_,A);if(!u.success){let I=u.error instanceof Error?u.error.message:String(u.error);throw new Ge($e.InvalidParams,`Invalid elicitation request: ${I}`)}let{params:l}=u.data;l.mode=l.mode??"form";let{supportsFormMode:d,supportsUrlMode:g}=oWe(this._capabilities.elicitation);if(l.mode==="form"&&!d)throw new Ge($e.InvalidParams,"Client does not support form-mode elicitation requests");if(l.mode==="url"&&!g)throw new Ge($e.InvalidParams,"Client does not support URL-mode elicitation requests");let p=await Promise.resolve(r(A,c));if(l.task){let I=Pi(oc,p);if(!I.success){let B=I.error instanceof Error?I.error.message:String(I.error);throw new Ge($e.InvalidParams,`Invalid task creation result: ${B}`)}return I.data}let f=Pi(Nu,p);if(!f.success){let I=f.error instanceof Error?f.error.message:String(f.error);throw new Ge($e.InvalidParams,`Invalid elicitation result: ${I}`)}let m=f.data,C=l.mode==="form"?l.requestedSchema:void 0;if(l.mode==="form"&&m.action==="accept"&&m.content&&C&&this._capabilities.elicitation?.form?.applyDefaults)try{fb(C,m.content)}catch{}return m};return super.setRequestHandler(e,a)}if(o==="sampling/createMessage"){let a=async(A,c)=>{let u=Pi(I_,A);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new Ge($e.InvalidParams,`Invalid sampling request: ${m}`)}let{params:l}=u.data,d=await Promise.resolve(r(A,c));if(l.task){let m=Pi(oc,d);if(!m.success){let C=m.error instanceof Error?m.error.message:String(m.error);throw new Ge($e.InvalidParams,`Invalid task creation result: ${C}`)}return m.data}let p=l.tools||l.toolChoice?dI:bg,f=Pi(p,d);if(!f.success){let m=f.error instanceof Error?f.error.message:String(f.error);throw new Ge($e.InvalidParams,`Invalid sampling result: ${m}`)}return f.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapability(e,r){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{let n=await this.request({method:"initialize",params:{protocolVersion:xu,capabilities:this._capabilities,clientInfo:this._clientInfo}},XL,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!l0.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break;case"ping":break}}assertTaskCapability(e){pb(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&db(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},sc,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},B_,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},sc,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},p_,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},A_,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},t_,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},n_,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},o_,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},sc,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},sc,r)}async callTool(e,r=Ru,n){if(this.isToolTaskRequired(e.name))throw new Ge($e.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let i=await this.request({method:"tools/call",params:e},r,n),s=this.getToolOutputValidator(e.name);if(s){if(!i.structuredContent&&!i.isError)throw new Ge($e.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(i.structuredContent)try{let o=s(i.structuredContent);if(!o.valid)throw new Ge($e.InvalidParams,`Structured content does not match the tool's output schema: ${o.errorMessage}`)}catch(o){throw o instanceof Ge?o:new Ge($e.InvalidParams,`Failed to validate structured content: ${o instanceof Error?o.message:String(o)}`)}}return i}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of e){if(r.outputSchema){let i=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,i)}let n=r.execution?.taskSupport;(n==="required"||n==="optional")&&this._cachedKnownTaskTools.add(r.name),n==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){let n=await this.request({method:"tools/list",params:e},h_,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,i){let s=soe.safeParse(n);if(!s.success)throw new Error(`Invalid ${e} listChanged options: ${s.error.message}`);if(typeof n.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:o,debounceMs:a}=s.data,{onChanged:A}=n,c=async()=>{if(!o){A(null,null);return}try{let l=await i();A(null,l)}catch(l){let d=l instanceof Error?l:new Error(String(l));A(d,null)}},u=()=>{if(a){let l=this._listChangedDebounceTimers.get(e);l&&clearTimeout(l);let d=setTimeout(c,a);this._listChangedDebounceTimers.set(e,d)}else c()};this.setNotificationHandler(r,u)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}});var ice=R((gjt,nce)=>{h();nce.exports=rce;rce.sync=AWe;var ece=require("fs");function aWe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function tce(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:aWe(e,r)}function rce(t,e,r){ece.stat(t,function(n,i){r(n,n?!1:tce(i,t,e))})}function AWe(t,e){return tce(ece.statSync(t),t,e)}});var cce=R((djt,Ace)=>{h();Ace.exports=oce;oce.sync=cWe;var sce=require("fs");function oce(t,e,r){sce.stat(t,function(n,i){r(n,n?!1:ace(i,e))})}function cWe(t,e){return ace(sce.statSync(t),e)}function ace(t,e){return t.isFile()&&uWe(t,e)}function uWe(t,e){var r=t.mode,n=t.uid,i=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),A=parseInt("010",8),c=parseInt("001",8),u=a|A,l=r&c||r&A&&i===o||r&a&&n===s||r&u&&s===0;return l}});var lce=R((mjt,uce)=>{h();var hjt=require("fs"),hb;process.platform==="win32"||global.TESTING_WINDOWS?hb=ice():hb=cce();uce.exports=$2;$2.sync=lWe;function $2(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){$2(t,e||{},function(s,o){s?i(s):n(o)})})}hb(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function lWe(t,e){try{return hb.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Cce=R((Ijt,mce)=>{h();var Rf=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",gce=require("path"),gWe=Rf?";":":",pce=lce(),dce=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),fce=(t,e)=>{let r=e.colon||gWe,n=t.match(/\//)||Rf&&t.match(/\\/)?[""]:[...Rf?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=Rf?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Rf?i.split(r):[""];return Rf&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:i}},hce=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:s}=fce(t,e),o=[],a=c=>new Promise((u,l)=>{if(c===n.length)return e.all&&o.length?u(o):l(dce(t));let d=n[c],g=/^".*"$/.test(d)?d.slice(1,-1):d,p=gce.join(g,t),f=!g&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;u(A(f,c,0))}),A=(c,u,l)=>new Promise((d,g)=>{if(l===i.length)return d(a(u+1));let p=i[l];pce(c+p,{pathExt:s},(f,m)=>{if(!f&&m)if(e.all)o.push(c+p);else return d(c+p);return d(A(c,u,l+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},pWe=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=fce(t,e),s=[];for(let o=0;o<r.length;o++){let a=r[o],A=/^".*"$/.test(a)?a.slice(1,-1):a,c=gce.join(A,t),u=!A&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let l=0;l<n.length;l++){let d=u+n[l];try{if(pce.sync(d,{pathExt:i}))if(e.all)s.push(d);else return d}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw dce(t)};mce.exports=hce;hce.sync=pWe});var Ece=R((Bjt,V2)=>{"use strict";h();var Ice=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};V2.exports=Ice;V2.exports.default=Ice});var Dce=R((Qjt,Qce)=>{"use strict";h();var Bce=require("path"),dWe=Cce(),fWe=Ece();function yce(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,s=i&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let o;try{o=dWe.sync(t.command,{path:r[fWe({env:r})],pathExt:e?Bce.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return o&&(o=Bce.resolve(i?t.options.cwd:"",o)),o}function hWe(t){return yce(t)||yce(t,!0)}Qce.exports=hWe});var wce=R((wjt,z2)=>{"use strict";h();var W2=/([()\][%!^"`<>&|;, *?])/g;function mWe(t){return t=t.replace(W2,"^$1"),t}function CWe(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(W2,"^$1"),e&&(t=t.replace(W2,"^$1")),t}z2.exports.command=mWe;z2.exports.argument=CWe});var Sce=R((Sjt,bce)=>{"use strict";h();bce.exports=/^#!(.*)/});var xce=R((xjt,vce)=>{"use strict";h();var IWe=Sce();vce.exports=(t="")=>{let e=t.match(IWe);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var kce=R((kjt,Fce)=>{"use strict";h();var X2=require("fs"),EWe=xce();function BWe(t){let r=Buffer.alloc(150),n;try{n=X2.openSync(t,"r"),X2.readSync(n,r,0,150,0),X2.closeSync(n)}catch{}return EWe(r.toString())}Fce.exports=BWe});var Mce=R((Njt,Tce)=>{"use strict";h();var yWe=require("path"),Rce=Dce(),Nce=wce(),QWe=kce(),DWe=process.platform==="win32",wWe=/\.(?:com|exe)$/i,bWe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function SWe(t){t.file=Rce(t);let e=t.file&&QWe(t.file);return e?(t.args.unshift(t.file),t.command=e,Rce(t)):t.file}function vWe(t){if(!DWe)return t;let e=SWe(t),r=!wWe.test(e);if(t.options.forceShell||r){let n=bWe.test(e);t.command=yWe.normalize(t.command),t.command=Nce.command(t.command),t.args=t.args.map(s=>Nce.argument(s,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function xWe(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:vWe(n)}Tce.exports=xWe});var _ce=R((Mjt,Lce)=>{"use strict";h();var Z2=process.platform==="win32";function eG(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function FWe(t,e){if(!Z2)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let s=Pce(i,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}function Pce(t,e){return Z2&&t===1&&!e.file?eG(e.original,"spawn"):null}function kWe(t,e){return Z2&&t===1&&!e.file?eG(e.original,"spawnSync"):null}Lce.exports={hookChildProcess:FWe,verifyENOENT:Pce,verifyENOENTSync:kWe,notFoundError:eG}});var nG=R((Ljt,Nf)=>{"use strict";h();var Uce=require("child_process"),tG=Mce(),rG=_ce();function Gce(t,e,r){let n=tG(t,e,r),i=Uce.spawn(n.command,n.args,n.options);return rG.hookChildProcess(i,n),i}function RWe(t,e,r){let n=tG(t,e,r),i=Uce.spawnSync(n.command,n.args,n.options);return i.error=i.error||rG.verifyENOENTSync(i.status,n),i}Nf.exports=Gce;Nf.exports.spawn=Gce;Nf.exports.sync=RWe;Nf.exports._parse=tG;Nf.exports._enoent=rG});function NWe(t){return ku.parse(JSON.parse(t))}function mb(t){return JSON.stringify(t)+`
|
|
1809
1809
|
`}var Tf,iG=L(()=>{h();ra();Tf=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
1810
1810
|
`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),NWe(r)}clear(){this._buffer=void 0}}});function MWe(){let t={};for(let e of TWe){let r=jI.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}function PWe(){return"type"in jI.default}var Oce,jI,Kce,TWe,Cb,Hce=L(()=>{h();Oce=z(nG(),1),jI=z(require("node:process"),1),Kce=require("node:stream");iG();TWe=jI.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];Cb=class{constructor(e){this._readBuffer=new Tf,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new Kce.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{this._process=(0,Oce.default)(this._serverParams.command,this._serverParams.args??[],{env:{...MWe(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:jI.default.platform==="win32"&&PWe(),cwd:this._serverParams.cwd}),this._process.on("error",n=>{r(n),this.onerror?.(n)}),this._process.on("spawn",()=>{e()}),this._process.on("close",n=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",n=>{this.onerror?.(n)}),this._process.stdout?.on("data",n=>{this._readBuffer.append(n),this.processReadBuffer()}),this._process.stdout?.on("error",n=>{this.onerror?.(n)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._process){let e=this._process;this._process=void 0;let r=new Promise(n=>{e.once("close",()=>{n()})});try{e.stdin?.end()}catch{}if(await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())]),e.exitCode===null){try{e.kill("SIGTERM")}catch{}await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())])}if(e.exitCode===null)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(r=>{if(!this._process?.stdin)throw new Error("Not connected");let n=mb(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}}});function sG(t){}function Eb(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=sG,onError:r=sG,onRetry:n=sG,onComment:i}=t,s="",o=!0,a,A="",c="";function u(f){let m=o?f.replace(/^\xEF\xBB\xBF/,""):f,[C,I]=LWe(`${s}${m}`);for(let B of C)l(B);s=I,o=!1}function l(f){if(f===""){g();return}if(f.startsWith(":")){i&&i(f.slice(f.startsWith(": ")?2:1));return}let m=f.indexOf(":");if(m!==-1){let C=f.slice(0,m),I=f[m+1]===" "?2:1,B=f.slice(m+I);d(C,B,f);return}d(f,"",f)}function d(f,m,C){switch(f){case"event":c=m;break;case"data":A=`${A}${m}
|
|
1811
1811
|
`;break;case"id":a=m.includes("\0")?void 0:m;break;case"retry":/^\d+$/.test(m)?n(parseInt(m,10)):r(new Ib(`Invalid \`retry\` value: "${m}"`,{type:"invalid-retry",value:m,line:C}));break;default:r(new Ib(`Unknown field "${f.length>20?`${f.slice(0,20)}\u2026`:f}"`,{type:"unknown-field",field:f,value:m,line:C}));break}}function g(){A.length>0&&e({id:a,event:c||void 0,data:A.endsWith(`
|
|
@@ -2813,7 +2813,7 @@ return fn.apply(this, arguments)
|
|
|
2813
2813
|
`)+`\r
|
|
2814
2814
|
\r
|
|
2815
2815
|
`+r)}function ap(t,e,r,n,i,s){if(t.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,ap),t.emit("wsClientError",o,r,e)}else aB(r,n,i,s)}});var aye=R((vsr,oye)=>{h();var a4=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],s=this.timeBuffer[r-1]-this.timeBuffer[r-n],o=i/s;this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);let a=Math.ceil(e/o/1e3);isNaN(a)?this.eta="NULL":isFinite(a)?a>1e7?this.eta="INF":a<0?this.eta=0:this.eta=a:this.eta="INF"}};oye.exports=a4});var c4=R((Fsr,Aye)=>{h();var cp=require("readline"),A4=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&&cp.cursorTo(this.stream,e,r)}cursorRelative(e=null,r=null){this.stream.isTTY&&(this.dy=this.dy+r,cp.moveCursor(this.stream,e,r))}cursorRelativeReset(){this.stream.isTTY&&(cp.moveCursor(this.stream,0,-this.dy),cp.cursorTo(this.stream,0,null),this.dy=0)}clearRight(){this.stream.isTTY&&cp.clearLine(this.stream,1)}clearLine(){this.stream.isTTY&&cp.clearLine(this.stream,0)}clearBottom(){this.stream.isTTY&&cp.clearScreenDown(this.stream)}newline(){this.stream.write(`
|
|
2816
|
-
`),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)}};Aye.exports=A4});var uye=R((Rsr,u4)=>{"use strict";h();var cye=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);u4.exports=cye;u4.exports.default=cye});var gye=R((Tsr,lye)=>{"use strict";h();lye.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 dye=R((Psr,l4)=>{"use strict";h();var zgt=v1(),Xgt=uye(),Zgt=gye(),pye=t=>{if(typeof t!="string"||t.length===0||(t=zgt(t),t.length===0))return 0;t=t.replace(Zgt()," ");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+=Xgt(n)?2:1)}return e};l4.exports=pye;l4.exports.default=pye});var g4=R((_sr,fye)=>{h();fye.exports=function(e,r,n){if(r.autopadding!==!0)return e;function i(s,o){return(r.autopaddingChar+s).slice(-o)}return n==="percentage"?i(e,3):e}});var p4=R((Gsr,hye)=>{h();hye.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 d4=R((Ksr,mye)=>{h();mye.exports=function(e,r,n){function i(o){return n?n*Math.round(o/n):o}function s(o){return(r.autopaddingChar+o).slice(-2)}return e>3600?s(Math.floor(e/3600))+"h"+s(i(e%3600/60))+"m":e>60?s(Math.floor(e/60))+"m"+s(i(e%60))+"s":e>10?s(i(e))+"s":s(e)+"s"}});var f4=R((Jsr,Cye)=>{h();var ept=dye(),tpt=g4(),rpt=p4(),npt=d4();Cye.exports=function(e,r,n){let i=e.format,s=e.formatTime||npt,o=e.formatValue||tpt,a=e.formatBar||rpt,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:o(A,e,"percentage"),total:o(r.total,e,"total"),value:o(r.value,e,"value"),eta:o(r.eta,e,"eta"),eta_formatted:s(r.eta,e,5),duration:o(u,e,"duration"),duration_formatted:s(u,e,1)});i=i.replace(/\{(\w+)\}/g,function(p,f){return typeof l[f]<"u"?l[f]:p});let d=Math.max(0,r.maxWidth-ept(i)-2),g=Math.floor(d/2);switch(e.align){case"right":i=d>0?" ".repeat(d)+i:i;break;case"center":i=g>0?" ".repeat(g)+i:i;break;default:break}return i}});var Mv=R((jsr,Iye)=>{h();function gr(t,e){return typeof t>"u"||t===null?e:t}Iye.exports={parse:function(e,r){let n={},i=Object.assign({},r,e);return n.throttleTime=1e3/gr(i.fps,10),n.stream=gr(i.stream,process.stderr),n.terminal=gr(i.terminal,null),n.clearOnComplete=gr(i.clearOnComplete,!1),n.stopOnComplete=gr(i.stopOnComplete,!1),n.barsize=gr(i.barsize,40),n.align=gr(i.align,"left"),n.hideCursor=gr(i.hideCursor,!1),n.linewrap=gr(i.linewrap,!1),n.barGlue=gr(i.barGlue,""),n.barCompleteChar=gr(i.barCompleteChar,"="),n.barIncompleteChar=gr(i.barIncompleteChar,"-"),n.format=gr(i.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),n.formatTime=gr(i.formatTime,null),n.formatValue=gr(i.formatValue,null),n.formatBar=gr(i.formatBar,null),n.etaBufferLength=gr(i.etaBuffer,10),n.etaAsynchronousUpdate=gr(i.etaAsynchronousUpdate,!1),n.progressCalculationRelative=gr(i.progressCalculationRelative,!1),n.synchronousUpdate=gr(i.synchronousUpdate,!0),n.noTTYOutput=gr(i.noTTYOutput,!1),n.notTTYSchedule=gr(i.notTTYSchedule,2e3),n.emptyOnZero=gr(i.emptyOnZero,!1),n.forceRedraw=gr(i.forceRedraw,!1),n.autopadding=gr(i.autopadding,!1),n.gracefulExit=gr(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?gr(e.autopaddingChar," "):"",e}}});var h4=R((Vsr,Bye)=>{h();var Eye=aye(),ipt=c4(),spt=f4(),opt=Mv(),apt=require("events");Bye.exports=class extends apt{constructor(e){super(),this.options=opt.assignDerivedOptions(e),this.terminal=this.options.terminal?this.options.terminal:new ipt(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 Eye(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter=typeof this.options.format=="function"?this.options.format:spt}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 Eye(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 Qye=R((Xsr,yye)=>{h();var Apt=h4(),cpt=Mv();yye.exports=class extends Apt{constructor(e,r){super(cpt.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 wye=R((tor,Dye)=>{h();var upt=c4(),lpt=h4(),gpt=Mv(),ppt=require("events");Dye.exports=class extends ppt{constructor(e,r){super(),this.bars=[],this.options=gpt.parse(e,r),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new upt(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 s=new lpt(Object.assign({},this.options,{terminal:this.terminal},i));return this.bars.push(s),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,s.start(e,r,n),this.emit("start")),s}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 Sye=R((nor,bye)=>{h();bye.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}});var xye=R((sor,vye)=>{h();vye.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var kye=R((aor,Fye)=>{h();Fye.exports={format:" \x1B[90m{bar}\x1B[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var Nye=R((cor,Rye)=>{h();Rye.exports={format:" {bar}\u25A0 {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u25A0",barIncompleteChar:" "}});var Mye=R((lor,Tye)=>{h();var dpt=Sye(),fpt=xye(),hpt=kye(),mpt=Nye();Tye.exports={legacy:dpt,shades_classic:fpt,shades_grey:hpt,rect:mpt}});var _ye=R((por,Lye)=>{h();var Pye=Qye(),Cpt=wye(),Ipt=Mye(),Ept=f4(),Bpt=g4(),ypt=p4(),Qpt=d4();Lye.exports={Bar:Pye,SingleBar:Pye,MultiBar:Cpt,Presets:Ipt,Format:{Formatter:Ept,BarFormat:ypt,ValueFormat:Bpt,TimeFormat:Qpt}}});var Yye=R((Lor,Jye)=>{h();Jye.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-\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-\uDED8\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\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\uDD3C-\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-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\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\uDE70]|\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\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 kEt={};GB(kEt,{default:()=>FEt});module.exports=Kr(kEt);h();h();(function(){try{var 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]="5cad8ba1-79be-4318-acfc-923387ef2710",t._sentryDebugIdIdentifier="sentry-dbid-5cad8ba1-79be-4318-acfc-923387ef2710")}catch{}})();h();var Qve=require("../core/index.cjs"),Dve=require("../node/index.cjs"),wve=require("../server/index.cjs"),bve=z(BJ(),1);h();h();var cS=require("fs/promises");yF();Rr();xC();Wt();var Mr=z(pr(),1),th=require("node:path");Bs();Ds();mr();Hr();Kf();var xet="https://cdn.builder.io",lpe=async(t,e)=>{console.log(""),Zt((0,Mr.bgCyan)((0,Mr.bold)((0,Mr.white)(" figma migrate ")))+" "+(0,Mr.dim)(ut));let{builderPrivateKey:r,builderPublicKey:n}=await $t(t,e,{forceSpaceId:e.spaceId,builderPrivateKey:!0,builderPublicKey:!0});await kt("figma publish started",{spaceId:n});let i=await vC(t);if(i.length>0){await kt("figma migrate with existing files",{spaceId:n}),q.warning(`${(0,Mr.yellow)("This repo already has figma mappings in:")}
|
|
2816
|
+
`),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)}};Aye.exports=A4});var uye=R((Rsr,u4)=>{"use strict";h();var cye=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);u4.exports=cye;u4.exports.default=cye});var gye=R((Tsr,lye)=>{"use strict";h();lye.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 dye=R((Psr,l4)=>{"use strict";h();var zgt=v1(),Xgt=uye(),Zgt=gye(),pye=t=>{if(typeof t!="string"||t.length===0||(t=zgt(t),t.length===0))return 0;t=t.replace(Zgt()," ");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+=Xgt(n)?2:1)}return e};l4.exports=pye;l4.exports.default=pye});var g4=R((_sr,fye)=>{h();fye.exports=function(e,r,n){if(r.autopadding!==!0)return e;function i(s,o){return(r.autopaddingChar+s).slice(-o)}return n==="percentage"?i(e,3):e}});var p4=R((Gsr,hye)=>{h();hye.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 d4=R((Ksr,mye)=>{h();mye.exports=function(e,r,n){function i(o){return n?n*Math.round(o/n):o}function s(o){return(r.autopaddingChar+o).slice(-2)}return e>3600?s(Math.floor(e/3600))+"h"+s(i(e%3600/60))+"m":e>60?s(Math.floor(e/60))+"m"+s(i(e%60))+"s":e>10?s(i(e))+"s":s(e)+"s"}});var f4=R((Jsr,Cye)=>{h();var ept=dye(),tpt=g4(),rpt=p4(),npt=d4();Cye.exports=function(e,r,n){let i=e.format,s=e.formatTime||npt,o=e.formatValue||tpt,a=e.formatBar||rpt,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:o(A,e,"percentage"),total:o(r.total,e,"total"),value:o(r.value,e,"value"),eta:o(r.eta,e,"eta"),eta_formatted:s(r.eta,e,5),duration:o(u,e,"duration"),duration_formatted:s(u,e,1)});i=i.replace(/\{(\w+)\}/g,function(p,f){return typeof l[f]<"u"?l[f]:p});let d=Math.max(0,r.maxWidth-ept(i)-2),g=Math.floor(d/2);switch(e.align){case"right":i=d>0?" ".repeat(d)+i:i;break;case"center":i=g>0?" ".repeat(g)+i:i;break;default:break}return i}});var Mv=R((jsr,Iye)=>{h();function gr(t,e){return typeof t>"u"||t===null?e:t}Iye.exports={parse:function(e,r){let n={},i=Object.assign({},r,e);return n.throttleTime=1e3/gr(i.fps,10),n.stream=gr(i.stream,process.stderr),n.terminal=gr(i.terminal,null),n.clearOnComplete=gr(i.clearOnComplete,!1),n.stopOnComplete=gr(i.stopOnComplete,!1),n.barsize=gr(i.barsize,40),n.align=gr(i.align,"left"),n.hideCursor=gr(i.hideCursor,!1),n.linewrap=gr(i.linewrap,!1),n.barGlue=gr(i.barGlue,""),n.barCompleteChar=gr(i.barCompleteChar,"="),n.barIncompleteChar=gr(i.barIncompleteChar,"-"),n.format=gr(i.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),n.formatTime=gr(i.formatTime,null),n.formatValue=gr(i.formatValue,null),n.formatBar=gr(i.formatBar,null),n.etaBufferLength=gr(i.etaBuffer,10),n.etaAsynchronousUpdate=gr(i.etaAsynchronousUpdate,!1),n.progressCalculationRelative=gr(i.progressCalculationRelative,!1),n.synchronousUpdate=gr(i.synchronousUpdate,!0),n.noTTYOutput=gr(i.noTTYOutput,!1),n.notTTYSchedule=gr(i.notTTYSchedule,2e3),n.emptyOnZero=gr(i.emptyOnZero,!1),n.forceRedraw=gr(i.forceRedraw,!1),n.autopadding=gr(i.autopadding,!1),n.gracefulExit=gr(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?gr(e.autopaddingChar," "):"",e}}});var h4=R((Vsr,Bye)=>{h();var Eye=aye(),ipt=c4(),spt=f4(),opt=Mv(),apt=require("events");Bye.exports=class extends apt{constructor(e){super(),this.options=opt.assignDerivedOptions(e),this.terminal=this.options.terminal?this.options.terminal:new ipt(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 Eye(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter=typeof this.options.format=="function"?this.options.format:spt}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 Eye(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 Qye=R((Xsr,yye)=>{h();var Apt=h4(),cpt=Mv();yye.exports=class extends Apt{constructor(e,r){super(cpt.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 wye=R((tor,Dye)=>{h();var upt=c4(),lpt=h4(),gpt=Mv(),ppt=require("events");Dye.exports=class extends ppt{constructor(e,r){super(),this.bars=[],this.options=gpt.parse(e,r),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new upt(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 s=new lpt(Object.assign({},this.options,{terminal:this.terminal},i));return this.bars.push(s),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,s.start(e,r,n),this.emit("start")),s}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 Sye=R((nor,bye)=>{h();bye.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}});var xye=R((sor,vye)=>{h();vye.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var kye=R((aor,Fye)=>{h();Fye.exports={format:" \x1B[90m{bar}\x1B[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var Nye=R((cor,Rye)=>{h();Rye.exports={format:" {bar}\u25A0 {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u25A0",barIncompleteChar:" "}});var Mye=R((lor,Tye)=>{h();var dpt=Sye(),fpt=xye(),hpt=kye(),mpt=Nye();Tye.exports={legacy:dpt,shades_classic:fpt,shades_grey:hpt,rect:mpt}});var _ye=R((por,Lye)=>{h();var Pye=Qye(),Cpt=wye(),Ipt=Mye(),Ept=f4(),Bpt=g4(),ypt=p4(),Qpt=d4();Lye.exports={Bar:Pye,SingleBar:Pye,MultiBar:Cpt,Presets:Ipt,Format:{Formatter:Ept,BarFormat:ypt,ValueFormat:Bpt,TimeFormat:Qpt}}});var Yye=R((Lor,Jye)=>{h();Jye.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-\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-\uDED8\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\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]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\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]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\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\uDD3C-\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-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\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\uDE70]|\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\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]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\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 kEt={};GB(kEt,{default:()=>FEt});module.exports=Kr(kEt);h();h();(function(){try{var 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]="c5b62f03-34aa-4332-ba22-3e8daacd12d7",t._sentryDebugIdIdentifier="sentry-dbid-c5b62f03-34aa-4332-ba22-3e8daacd12d7")}catch{}})();h();var Qve=require("../core/index.cjs"),Dve=require("../node/index.cjs"),wve=require("../server/index.cjs"),bve=z(BJ(),1);h();h();var cS=require("fs/promises");yF();Rr();xC();Wt();var Mr=z(pr(),1),th=require("node:path");Bs();Ds();mr();Hr();Kf();var xet="https://cdn.builder.io",lpe=async(t,e)=>{console.log(""),Zt((0,Mr.bgCyan)((0,Mr.bold)((0,Mr.white)(" figma migrate ")))+" "+(0,Mr.dim)(ut));let{builderPrivateKey:r,builderPublicKey:n}=await $t(t,e,{forceSpaceId:e.spaceId,builderPrivateKey:!0,builderPublicKey:!0});await kt("figma publish started",{spaceId:n});let i=await vC(t);if(i.length>0){await kt("figma migrate with existing files",{spaceId:n}),q.warning(`${(0,Mr.yellow)("This repo already has figma mappings in:")}
|
|
2817
2817
|
|
|
2818
2818
|
${i.map(c=>` - ${(0,th.relative)(t.getAppRootDir(),c)}`).join(`
|
|
2819
2819
|
`)}
|
|
@@ -6423,7 +6423,7 @@ ${t.markdown}`}return`==== [AGENT] ${r}
|
|
|
6423
6423
|
${t.markdown}`}function Mgt(t,e){fs.rmSync(e,{recursive:!0,force:!0});let r=new Map;for(let n of t){let i=n.channelId||"_no-channel";if(i.includes(".."))continue;let s=r.get(i);s||(s=[],r.set(i,s)),s.push(n)}for(let[n,i]of r){i.sort((a,A)=>a.createdAt-A.createdAt);let s=ds.join(e,n);fs.mkdirSync(s,{recursive:!0});let o=i.map(Tgt).join(`
|
|
6424
6424
|
|
|
6425
6425
|
`);fs.writeFileSync(ds.join(s,"thread.log"),o)}}function Pgt(t,e,r,n){let i=Date.now(),s=[];s.push(`# ${t.name}`),s.push(""),t.repoDescription&&(s.push(`> ${t.repoDescription}`),s.push("")),s.push("## Project Info"),s.push(""),s.push(`- **Project ID:** ${t.id}`),s.push(`- **Project Name:** ${t.name}`),t.repoFullName&&s.push(`- **Repository:** ${t.repoFullName}`),t.repoUrl&&s.push(`- **Repo URL:** ${t.repoUrl}`);let o=i4(t.createdBy,r);o&&s.push(`- **Created by:** ${o}`),s.push(`- **Active branches:** ${e}`),t.archived&&s.push("- **Status:** Archived");let a=t.settings?.folders;if(a&&a.length>0){s.push(""),s.push("## Connected Repositories"),s.push(""),s.push("This project has access to additional repositories. Each connected repo may be read-only or read/write depending on its git configuration."),s.push("");for(let d of a){let g=d.enableGit?"read/write":"read-only";s.push(`- **${d.name}** (${g})`),s.push(` - URL: ${d.remoteUrl}`),d.includePath&&s.push(` - Include path: ${d.includePath}`)}}t.repoFullName&&(s.push(""),s.push("## GitHub CLI"),s.push(""),s.push("This is a GitHub repository. You can use `gh` CLI for quick lookups:"),s.push(`- \`gh pr list --repo ${t.repoFullName}\` \u2014 open PRs`),s.push(`- \`gh pr list --repo ${t.repoFullName} --state merged --limit 5\` \u2014 recent merged PRs`),s.push(`- \`gh issue list --repo ${t.repoFullName}\` \u2014 open issues`)),s.push(""),s.push("## Full Project Data"),s.push(""),s.push("See `project.json` in this directory for complete project configuration and all branch details.");let A=new Map;for(let d of n)d.createdBy&&A.set(d.createdBy,(A.get(d.createdBy)??0)+1);let c=[...A.entries()].sort((d,g)=>g[1]-d[1]).slice(0,2);if(c.length>0){s.push(""),s.push("## Top Users"),s.push(""),s.push("| User | Branches |"),s.push("|------|----------|");for(let[d,g]of c){let p=i4(d,r)??d;s.push(`| ${p} | ${g} |`)}}let u=n.filter(d=>d.state==="active"&&typeof d.lastUpdatedAt=="number").sort((d,g)=>(g.lastUpdatedAt??0)-(d.lastUpdatedAt??0)).slice(0,5);if(u.length>0){s.push(""),s.push("## Recent Branches"),s.push("");for(let d of u){let g=s4(i-d.lastUpdatedAt),p=i4(d.createdBy,r),f=p?`, by ${p}`:"";s.push(`- \`${d.friendlyName??d.name}\` \u2014 "${d.name}" (${g}${f})`)}}let l=n.filter(d=>d.prStatus==="merged"&&typeof d.lastUpdatedAt=="number").sort((d,g)=>(g.lastUpdatedAt??0)-(d.lastUpdatedAt??0)).slice(0,5);if(l.length>0){s.push(""),s.push("## Recent Merged PRs"),s.push("");for(let d of l){let g=s4(i-d.lastUpdatedAt),p=d.friendlyName?` \u2014 "${d.friendlyName}"`:"";s.push(`- PR #${d.prNumber}: \`${d.name}\`${p} (merged ${g})`)}}return s.push(""),s.push("## Available Tools"),s.push(""),s.push('- **SpawnBranch** \u2014 Create a new branch for a coding task: `SpawnBranch({ projectId: "...", message: "..." })`'),s.push(""),s.join(`
|
|
6426
|
-
`)}async function xv(t){let{sys:e,ownerId:r,privateKey:n,outputDir:i}=t,s=ds.join(i,"org","projects"),o=ds.join(i,"org");fs.mkdirSync(s,{recursive:!0}),fs.mkdirSync(o,{recursive:!0});let a=new URL("/projects/org-tree",ke);a.searchParams.set("apiKey",r);let A=await fetch(a,{headers:{Authorization:`Bearer ${n}`}});if(!A.ok)throw new Error(`Failed to fetch org tree: ${A.status} ${A.statusText}`);let c=await A.json(),u=c.projects??[],l=c.branches??[],d=c.users??[],g=c.memories??[],p=c.messages??[];if(c.environmentVariables)for(let S of c.environmentVariables)process.env[S.key]=S.value;let f=new Map(d.map(S=>[S.userId,S])),m=new Map(u.map(S=>[S.id,S])),C=new Map;for(let S of l)S.state==="active"&&C.set(S.projectId,(C.get(S.projectId)??0)+1);function I(S){let v=S.repoFullName??S.id;return v.split("/").pop()===S.name?v:ds.join(v,S.name)}for(let S of u){let v=ds.join(s,I(S));fs.mkdirSync(v,{recursive:!0});let P=l.filter(M=>M.projectId===S.id).map(M=>Ngt(M,f));fs.writeFileSync(ds.join(v,"project.json"),JSON.stringify({...S,branches:P},null,2));let $=l.filter(M=>M.projectId===S.id);fs.writeFileSync(ds.join(v,"AGENTS.md"),Pgt(S,C.get(S.id)??0,f,$));let H=g.filter(M=>M.projectId===S.id);H.length>0&&await Mb(e,H,ds.join(v,"memories"))}let B=Date.now();function E(S){return{branchName:S.name,friendlyName:S.friendlyName,description:S.description,url:`https://builder.io/app/projects/${S.projectId}/${S.name}`,projectId:S.projectId,projectName:m.get(S.projectId)?.name,state:S.state,createdAt:typeof S.createdAt=="number"?S.createdAt:void 0,updatedAt:S.lastUpdatedAt,metadata:S.metadata,lastUpdatedAgo:s4(B-(typeof S.lastUpdatedAt=="number"?S.lastUpdatedAt:B)),createdBy:vv(S.createdBy,f,{omit:["jobFunctions"]}),deletedBy:vv(S.deletedBy,f,{omit:["jobFunctions"]}),deletedAt:S.deletedAt,archiveReason:S.archiveReason,pr:S.prNumber&&S.prUrl?{prNumber:S.prNumber,prUrl:S.prUrl,prStatus:S.prStatus,prStatusUpdatedAt:S.prStatusUpdatedAt}:void 0,prsByFolder:S.prInfoByFolder?Object.fromEntries(Object.entries(S.prInfoByFolder).map(([v,P])=>[v,{prNumber:P.prNumber,prUrl:P.prUrl,prStatus:P.status,updatedAt:P.updatedAt}])):void 0}}let y=B-10080*60*1e3,Q=l.filter(S=>S.state==="active"&&typeof S.lastUpdatedAt=="number"&&S.lastUpdatedAt>y).map(E);fs.writeFileSync(ds.join(o,"active-branches.json"),JSON.stringify(Q,null,2));let w=l.filter(S=>S.state==="deleted"||S.state==="archived").map(E);fs.writeFileSync(ds.join(o,"archived-branches.json"),JSON.stringify(w,null,2));let D=new Map;for(let S of l){let v=D.get(S.projectId)??[];v.push(S),D.set(S.projectId,v)}let x=u.map(S=>{let v=D.get(S.id)??[],P=new Map;for(let H of v)H.createdBy&&P.set(H.createdBy,(P.get(H.createdBy)??0)+1);let $=[...P.entries()].sort((H,M)=>M[1]-H[1]).map(([H,M])=>{let G=vv(H,f,{omit:["jobFunctions"]});return{...typeof G=="object"?G:{userId:G},branchCount:M}});return{projectId:S.id,projectName:S.name,repoUrl:S.repoUrl,description:S.description??S.repoDescription,branchCount:C.get(S.id)??0,url:`https://builder.io/app/projects/${S.id}`,moreInfoPath:`org/projects/${I(S)}/`,topUsers:$}}).sort((S,v)=>v.branchCount-S.branchCount||S.projectName.localeCompare(v.projectName));if(fs.writeFileSync(ds.join(o,"projects.json"),JSON.stringify(x,null,2)),p.length>0){let S=ds.join(i,"org","channels");Mgt(p,S)}}cO();TG();fi();NC();ta();var xe=Se("Launch"),Lgt=48752;async function _gt(t){return new Promise(e=>{let r=Tv.createServer();r.listen(t,()=>{r.once("close",()=>{e(!0)}),r.close()}),r.on("error",()=>{e(!1)})})}async function zBe(t){let e=t,r=100;for(let n=0;n<r;n++){if(await _gt(e))return e;e=Math.floor(Math.random()*16384)+49152}throw new Error(`Could not find an available port after ${r} attempts`)}async function Ugt(t,e){let r=parseInt(process.env.FUSION_SERVER_PORT??""),n=isNaN(r)?Lgt:r,i,s=t.fusionServerPort;if(s!==void 0)i=s,xe.info(`\u{1F50D} Using configured HTTP port: ${i}`);else{let a=e;i=n,a&&(i=await zBe(n),i!==n&&xe.info(`\u26A0\uFE0F Port ${n} is in use, using port ${i} instead`))}if(!t.https)return{httpPort:i};let o=t.httpsServerOptions?.port??await zBe(i+1);return{httpPort:i,httpsPort:o}}function XBe(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 Fo,Pc,Nv,pl=null,Fv,kv;function Ggt(t){let r=t.state==="initial"||t.state==="init-running"||t.state==="closing"||t.setupState==="installing"||t.activeOperations>0||Pc!=null&&!Pc.isIdle()?"busy":"idle";t.containerState!==r&&(t.containerState=r,t.containerStateTimestamp=Date.now())}function fa(t,e){t.launchPhase!==e&&(t.launchPhase=e,t.launchPhaseUpdatedAt=Date.now(),xe.info(`Launch phase: ${e}`))}function Rv({sys:t,sharedState:e,phase:r,operation:n,error:i}){fa(e,r);let s=i instanceof Error?i.message:String(i);e.state="init-error",e.isFinalState=!0,e.errorMessage=s,xe.error(`Launch error (${n}): ${s} ${JSON.stringify({processId:e.processId,launchPhase:e.launchPhase,state:e.state,editorReady:e.editorReady})}`),t.Sentry?.captureException(i,{level:"fatal",tags:{operation:n,launchPhase:r},extra:{processId:e.processId,state:e.state,editorReady:e.editorReady,editorReadyAt:e.editorReadyAt,editorReadySource:e.editorReadySource,launchPhaseUpdatedAt:e.launchPhaseUpdatedAt}})}async function sye({sys:t,args:e,existingSession:r}){r&&(Fo=Promise.resolve(r),Pc=r);let n=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;n&&(t.Sentry?.setContext("flyIo",n),t.Sentry?.getCurrentScope().setContext("flyIo",n));let i=await Zu(t,e);if(hge(t,i),e.fusionInit&&GY(!0),i.privacyMode?.encryptKey&&!await Fb(i.privacyMode.encryptKey))throw new Error("Invalid encryption key: key failed validation");await TBe(t,i);let s=await Ogt(t,e,i),o=performance.now(),a="initial",A=!1,c={status:"ok",get state(){return a},set state(Q){a!==Q&&i.projectId&&i.branchName&&JL(t,s,{projectId:i.projectId,branchName:i.branchName,lastServerVersion:ut,lastServerState:Q},!1),a=Q},isFinalState:!1,get editorReady(){return A},set editorReady(Q){if(A&&!Q){let w=new Error("Attempted to unset editorReady");xe.error(`Ignoring editorReady regression: ${JSON.stringify({processId:process.pid,launchPhase:c.launchPhase,state:c.state,editorReadyAt:c.editorReadyAt,editorReadySource:c.editorReadySource})}`),t.Sentry?.captureException(w,{tags:{operation:"editor-ready-regression"},extra:{processId:process.pid,launchPhase:c.launchPhase,state:c.state,editorReadyAt:c.editorReadyAt,editorReadySource:c.editorReadySource}});return}!A&&Q&&(c.editorReadyAt=Date.now(),c.editorReadySource=c.launchPhase,xe.info(`Editor ready: ${JSON.stringify({processId:process.pid,source:c.editorReadySource,upTime:performance.now()-o})}`)),A=Q},initState:void 0,setupState:void 0,devState:void 0,httpServerState:void 0,errorMessage:void 0,devToolsVersion:ut,lastRequestTime:o,startTime:o,processId:process.pid,launchPhase:"state-created",launchPhaseUpdatedAt:Date.now(),workingDirectory:process.cwd(),httpClients:0,containerState:"busy",containerStateTimestamp:Date.now(),activeOperations:0,detectedServerUrl:i.autoDetectDevServer?void 0:i.serverUrl,fusionEnvironment:process.env.FUSION_ENVIRONMENT==="cloud"||process.env.FUSION_ENVIRONMENT==="cloud-v2"?process.env.FUSION_ENVIRONMENT:"unknown"},u;fa(c,"server-starting");let l,d,g,p,f,m;try{({app:l,proxyUrl:d,server:g,httpsServer:p,httpsProxyUrl:f,customHttpsProxyUrl:m}=await Kgt(s,i,c,t,e))}catch(Q){throw Rv({sys:t,sharedState:c,phase:"server-error",operation:"setup-server",error:Q}),Q}fa(c,"server-listening"),pl||(pl=xBe(t,s,i,c)),pl&&pl.start(),setInterval(()=>{Ggt(c)},5e3);let C=$gt(t,i,n),I=!1,B=!1,E=!1,y=Q=>async()=>{if(xe.info(`Received ${Q} signal`),c.state==="init-running"){xe.info("Init is running, skipping"),E=!0;return}if(I){xe.info("Server already closing, skipping");return}c.state="closing",I=!0,setTimeout(()=>{I=!1},1e3),xe.info("Closing server gracefully");try{g.closeAllConnections(),p&&p.closeAllConnections(),C(),pl&&(pl.stop(),pl=null);let w=[new Promise(D=>g.close(D))];if(p&&w.push(new Promise(D=>p.close(D))),await Promise.race([Promise.all(w),new Promise(D=>setTimeout(D,1e3))]),u&&(await u.close(),u=void 0),!B&&c.initState?.success){B=!0;let D=await xo();c.state="closing",D&&(xe.info("Closing codeGenServer"),Fv&&(Fv(),Fv=void 0),kv&&(clearInterval(kv),kv=void 0),await D.close(!!i.autoBackupGit),Fo=void 0)}await t.Sentry?.flush(2e3),process.env.BUILDER_DISABLE_AMPLITUDE!=="true"&&await iye.flush().promise,process.exit(0)}catch(w){t.Sentry?.captureException(w);let D=w instanceof Error?w.message:String(w);xe.error(`\u274C FAILED TO CLOSE SERVER: ${D}`),process.exit(1)}};if(DBe(),process.on("SIGTERM",y("SIGTERM")),process.on("SIGINT",y("SIGINT")),e.fusionInit){c.state="init-running";let Q={operation:"fusion-init",mode:i.mode??""},w=new Fh({sys:t,fusionConfig:i,debug:!0,credentials:s,sentryTags:Q});c.initState=w.initState,c.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){xe.error("\u274C Initialization failed"),t.Sentry?.captureException(new Error("Initialization failed"),{level:"fatal",tags:Q,extra:{initState:w.initState}}),c.state="init-error",c.isFinalState=!0,c.errorMessage=w.initState.error,E&&await y("init-end")();return}if(xe.info("\u2705 Initialization completed successfully"),c.state="init-complete",E){await y("init-end")();return}if(i.mode==="backup"||i.mode==="backup-force-full"){await y("init-end")();return}i._attemptDryRunBackupGit&&kBe({sys:t,fusionConfig:i,debug:!0,credentials:s},w.initState).then(S=>{S&&(c._attemptDryRunBackupOutcome=S.success?"success":S.error)}).catch(S=>{t.Sentry?.captureException(S,{tags:{operation:"dry-run-backup-git",dryRunBackupGit:"true"}})})}try{u=Hgt(t,i,c,e,s)}catch(Q){throw Rv({sys:t,sharedState:c,phase:"dev-server-error",operation:"setup-dev-server-orchestrator",error:Q}),Q}if(fa(c,"dev-server-configured"),e.fusionInit&&u){let Q=i.nativeApp?3e5:2e3;fa(c,"setup-command-waiting");try{await Promise.race([u.ensureSetupCommand(),new Promise(w=>setTimeout(w,Q))])}catch(w){throw Rv({sys:t,sharedState:c,phase:"setup-command-error",operation:"ensure-setup-command",error:w}),w}}fa(c,"launch-server-setup"),await Jgt({sys:t,credentials:s,args:e,fusionConfig:i,proxyUrl:d,httpsProxyUrl:f,customHttpsProxyUrl:m,server:g,httpsServer:p,app:l,devServer:u,sharedState:c}),await kt("launch",{...i,dev:!!e.dev})}async function Ogt(t,e,r){let n;try{if(n=await $t(t,e,{builderPrivateKey:!0,builderPublicKey:!0}),!n.builderPublicKey||!n.builderPrivateKey){let i="You need to be logged in to use the fusion command.";return XBe(e,i),xe.error(i),Ue("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 s=new URL(`${ke}/fusion/cli-key`);s.searchParams.set("host",i),s.searchParams.set("apiKey",n.builderPublicKey);let o=await Fe(s.toString(),{headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.builderPrivateKey}`},method:"GET"});if(!o.ok){let c=await o.text();throw new Error(`Failed to fetch original private key: ${c}`)}let A=(await o.json())?.key;A&&(n.builderPrivateKey=A,n.timestamp=new Date().toISOString(),aS(t,n))}catch(s){t.Sentry?.captureException(new Error("Failed to fetch original private key, using existing credentials",{cause:s}))}}xe.info(`Logged in as space: ${n.spaceName||n.builderPublicKey}`)}catch(i){let s="Authentication failed.";return XBe(e,s,i instanceof Error?i.message:String(i)),xe.error(s),Ue("Please login first with: npx builder.io login"),await Ne(1)}return n}async function Kgt(t,e,r,n,i){let s=!!e.isLocal||!!i?.local,{httpPort:o,httpsPort:a}=await Ugt(e,s);e.nativeApp?xe.info(`\u{1F50D} Setting up Builder.io API server on port ${o} (Native App Mode)`):xe.info(`\u{1F50D} Setting up Builder.io server on port ${o}`);let A=(0,uB.default)();A.use((y,Q,w)=>{!s&&y.url?.startsWith(Bg)&&!y.url.includes("/status-v2")&&!y.url.includes("/editor-ready")&&xe.debug(`[HTTP]: ${y.url}`),y.query._skip_activity!=="true"&&(r.lastRequestTime=performance.now()),w()});let c=t.builderPrivateKey,u=e.authenticateProxy??!1;Tie({sys:n,app:A,validBuilderPrivateKey:c,authenticateProxy:u,isLocal:s,sharedState:r,fusionConfig:e,launchLogger:xe});let l=eye.createServer(A),d=1e3,g=60*d;l.keepAliveTimeout=1*g,l.headersTimeout=1*g+d;let p;if(e.https)try{let{port:y,...Q}=e.httpsServerOptions??{};p=tye.createServer(Q,A),xe.info(`\u{1F50D} Setting up HTTPS server on port ${a}`)}catch(y){xe.error(`\u274C Failed to create HTTPS server: ${y instanceof Error?y.message:String(y)}`),p=void 0}let f=e.localHttpsDomain,m=`http://localhost:${o}`,C=a?`https://localhost:${a}`:void 0,I=f&&a?`https://${f}:${a}`:void 0,B=[new Promise((y,Q)=>{l.listen(o,async()=>{xe.info(`\u{1F680} Builder.io HTTP server running at ${m}`),xe.info("Available server URLs:"),xe.info(` HTTP (localhost): ${m}`),y(!0)}),l.on("error",w=>{xe.error(`\u274C Failed to create HTTP server: ${w instanceof Error?w.message:String(w)}`),Q(w)})})];return p&&B.push(new Promise((y,Q)=>{p.listen(a,async()=>{xe.info(`\u{1F680} Builder.io HTTPS server running at ${C}`),xe.info(` HTTPS (localhost): ${C}`),I&&xe.info(` HTTPS (custom domain): ${I}`),y(!0)}),p.on("error",w=>{xe.error(`\u274C Failed to create HTTPS server: ${w instanceof Error?w.message:String(w)}`),Q(w)})})),await Promise.all(B),{app:A,proxyUrl:I||C||m,server:l,httpsServer:p,httpsProxyUrl:C,customHttpsProxyUrl:I}}function Hgt(t,e,r,n,i){if(e.nativeApp){e.devCommand?xe.info(`Running ${(0,AB.cyan)(e.devCommand)} in native app mode...`):xe.info("Native app mode: No dev command specified");let s=gL(t,e,n.fusionInit&&e.setupCommand?.trim()?"not-installed":"installed");return r.devState=s.devState,r.setupState=s.setupState,r.httpServerState="ok-2xx",s.emitter.on("devState",o=>{r.devState=o}),s.emitter.on("setupState",o=>{r.setupState=o}),s}if((n.serverUrl||n.chat)&&!n.command){n.chat||xe.info(`Proxying to existing dev server at ${(0,AB.cyan)(e.serverUrl)}...`),r.devState="running",r.setupState="installed",r.httpServerState="ok-2xx";return}else{e.devCommand&&xe.info(`Running ${(0,AB.cyan)(e.devCommand)} on host ${e.serverUrl?(0,AB.cyan)(e.serverUrl):"TBD"}...`);let s=gL(t,e,n.fusionInit?"not-installed":"installed");return r.devState=s.devState,r.setupState=s.setupState,r.httpServerState=s.httpServerState.state,s.emitter.on("devState",o=>{r.devState=o}),s.emitter.on("setupState",o=>{r.setupState=o}),s.emitter.on("httpServerState",o=>{r.httpServerState=o}),s.emitter.on("urlDetected",o=>{r.detectedServerUrl=o}),s.emitter.on("metrics",o=>{if(o.durations)for(let a of o.durations)process.env.DEBUG&&xe.debug(`[Metrics](${a.key}): ${a.ms}ms ${a.attributes?JSON.stringify(a.attributes):""}`);bv(t,i,o).catch(a=>{t.Sentry?.captureException(a,{tags:{operation:"push-metrics"}})})}),s}}async function Jgt({sys:t,credentials:e,args:r,fusionConfig:n,app:i,server:s,httpsServer:o,proxyUrl:a,httpsProxyUrl:A,customHttpsProxyUrl:c,devServer:u,sharedState:l}){async function d({force:p=!1,forcedFullBackup:f=!1}={}){xe.info(`\u{1F4E6} Attempting backup${p?" (forced)":""}${f?" (full)":""}...`);let m=await xo();if(!m)if(n.autoBackupGit&&l.initState?.success)m=await cB(t,e,n,u,void 0,l,void 0,n.privacyMode);else return xe.info("\u{1F51A} No active session"),{success:!0,message:"No active session",skipped:!0,reason:"no_active_session"};if(!(p||n.autoBackupGit))return xe.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(!m.isIdle())return xe.info("\u{1F51A} Not idle, skipping backup"),{success:!1,message:"Not idle, skipping backup",skipped:!0,reason:"not_idle"};if(!f&&!await m.needsBackup())return xe.info("\u2705 Already backed up after last request"),{success:!0,message:"Already backed up",skipped:!0,reason:"already_backed_up"};try{let B=await m.uploadBackup(f);return B.success&&xe.info("\u2705 Backup successful"),B}catch(B){let E=`Backup error: ${B instanceof Error?B.message:String(B)}`;return xe.error(`\u274C ${E}`),{success:!1,message:E,error:B instanceof Error?B:new Error(String(B))}}}async function g(p){xe.info(`\u{1F504} Attempting graceful shutdown: ${p}`);let f=()=>{n.autoShutdown&&(xe.info("\u{1F504} Shutting down process"),process.kill(process.pid,"SIGTERM"))},m=await d({force:!1});return m.success&&f(),m}try{let p=uB.default.Router();if(p.post("/generate",async(Q,w)=>{try{xe.debug("(generate): started");let{prompt:D,userMessage:x,canHandleTools:S,fireAndForget:v,context:{featureFlags:P}}=Q.body;if(!D&&!x)return w.status(400).json({error:"No prompt/userMessage provided"});w.socket?.setNoDelay(!0),w.setHeader("Content-Type","text/event-stream; charset=utf-8"),w.setHeader("Transfer-Encoding","chunked"),w.setHeader("X-Accel-Buffering","no"),w.setHeader("Cache-Control","no-cache"),w.setHeader("Connection","keep-alive"),P&&e4(P);let $=await cB(t,e,n,u,void 0,l,void 0,n.privacyMode);if(v){Array.isArray(S)&&S.length>0&&$.setSessionCanHandleTools(S),$.waitForEventLoop(),await $.sendMessage(D?{userPrompt:D}:x),w.status(200),w.write(JSON.stringify({type:"success",message:"Message sent"})+`
|
|
6426
|
+
`)}async function xv(t){let{sys:e,ownerId:r,privateKey:n,outputDir:i}=t,s=ds.join(i,"org","projects"),o=ds.join(i,"org");fs.mkdirSync(s,{recursive:!0}),fs.mkdirSync(o,{recursive:!0});let a=new URL("/projects/org-tree",ke);a.searchParams.set("apiKey",r);let A=await fetch(a,{headers:{Authorization:`Bearer ${n}`}});if(!A.ok)throw new Error(`Failed to fetch org tree: ${A.status} ${A.statusText}`);let c=await A.json(),u=c.projects??[],l=c.branches??[],d=c.users??[],g=c.memories??[],p=c.messages??[];if(c.environmentVariables)for(let S of c.environmentVariables)process.env[S.key]=S.value;let f=new Map(d.map(S=>[S.userId,S])),m=new Map(u.map(S=>[S.id,S])),C=new Map;for(let S of l)S.state==="active"&&C.set(S.projectId,(C.get(S.projectId)??0)+1);function I(S){let v=S.repoFullName??S.id;return v.split("/").pop()===S.name?v:ds.join(v,S.name)}for(let S of u){let v=ds.join(s,I(S));fs.mkdirSync(v,{recursive:!0});let P=l.filter(M=>M.projectId===S.id).map(M=>Ngt(M,f));fs.writeFileSync(ds.join(v,"project.json"),JSON.stringify({...S,branches:P},null,2));let $=l.filter(M=>M.projectId===S.id);fs.writeFileSync(ds.join(v,"AGENTS.md"),Pgt(S,C.get(S.id)??0,f,$));let H=g.filter(M=>M.projectId===S.id);H.length>0&&await Mb(e,H,ds.join(v,"memories"))}let B=Date.now();function E(S){return{branchName:S.name,friendlyName:S.friendlyName,description:S.description,url:`https://builder.io/app/projects/${S.projectId}/${S.name}`,projectId:S.projectId,projectName:m.get(S.projectId)?.name,state:S.state,createdAt:typeof S.createdAt=="number"?S.createdAt:void 0,updatedAt:S.lastUpdatedAt,metadata:S.metadata,lastUpdatedAgo:s4(B-(typeof S.lastUpdatedAt=="number"?S.lastUpdatedAt:B)),createdBy:vv(S.createdBy,f,{omit:["jobFunctions"]}),deletedBy:vv(S.deletedBy,f,{omit:["jobFunctions"]}),deletedAt:S.deletedAt,archiveReason:S.archiveReason,pr:S.prNumber&&S.prUrl?{prNumber:S.prNumber,prUrl:S.prUrl,prStatus:S.prStatus,prStatusUpdatedAt:S.prStatusUpdatedAt}:void 0,prsByFolder:S.prInfoByFolder?Object.fromEntries(Object.entries(S.prInfoByFolder).map(([v,P])=>[v,{prNumber:P.prNumber,prUrl:P.prUrl,prStatus:P.status,updatedAt:P.updatedAt}])):void 0}}let y=B-10080*60*1e3,Q=l.filter(S=>S.state==="active"&&typeof S.lastUpdatedAt=="number"&&S.lastUpdatedAt>y).map(E);fs.writeFileSync(ds.join(o,"active-branches.json"),JSON.stringify(Q,null,2));let w=l.filter(S=>S.state==="deleted"||S.state==="archived").map(E);fs.writeFileSync(ds.join(o,"archived-branches.json"),JSON.stringify(w,null,2));let D=new Map;for(let S of l){let v=D.get(S.projectId)??[];v.push(S),D.set(S.projectId,v)}let x=u.map(S=>{let v=D.get(S.id)??[],P=new Map;for(let H of v)H.createdBy&&P.set(H.createdBy,(P.get(H.createdBy)??0)+1);let $=[...P.entries()].sort((H,M)=>M[1]-H[1]).map(([H,M])=>{let G=vv(H,f,{omit:["jobFunctions"]});return{...typeof G=="object"?G:{userId:G},branchCount:M}});return{projectId:S.id,projectName:S.name,repoUrl:S.repoUrl,description:S.description??S.repoDescription,branchCount:C.get(S.id)??0,url:`https://builder.io/app/projects/${S.id}`,moreInfoPath:`org/projects/${I(S)}/`,topUsers:$}}).sort((S,v)=>v.branchCount-S.branchCount||S.projectName.localeCompare(v.projectName));if(fs.writeFileSync(ds.join(o,"projects.json"),JSON.stringify(x,null,2)),p.length>0){let S=ds.join(i,"org","channels");Mgt(p,S)}}cO();TG();fi();NC();ta();var xe=Se("Launch"),Lgt=48752;async function _gt(t){return new Promise(e=>{let r=Tv.createServer();r.listen(t,()=>{r.once("close",()=>{e(!0)}),r.close()}),r.on("error",()=>{e(!1)})})}async function zBe(t){let e=t,r=100;for(let n=0;n<r;n++){if(await _gt(e))return e;e=Math.floor(Math.random()*16384)+49152}throw new Error(`Could not find an available port after ${r} attempts`)}async function Ugt(t,e){let r=parseInt(process.env.FUSION_SERVER_PORT??""),n=isNaN(r)?Lgt:r,i,s=t.fusionServerPort;if(s!==void 0)i=s,xe.info(`\u{1F50D} Using configured HTTP port: ${i}`);else{let a=e;i=n,a&&(i=await zBe(n),i!==n&&xe.info(`\u26A0\uFE0F Port ${n} is in use, using port ${i} instead`))}if(!t.https)return{httpPort:i};let o=t.httpsServerOptions?.port??await zBe(i+1);return{httpPort:i,httpsPort:o}}function XBe(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 Fo,Pc,Nv,pl=null,Fv,kv;function Ggt(t){let r=t.state==="initial"||t.state==="init-running"||t.state==="closing"||t.setupState==="installing"||t.activeOperations>0||Pc!=null&&!Pc.isIdle()?"busy":"idle";t.containerState!==r&&(t.containerState=r,t.containerStateTimestamp=Date.now())}function fa(t,e){t.launchPhase!==e&&(t.launchPhase=e,t.launchPhaseUpdatedAt=Date.now(),xe.info(`Launch phase: ${e}`))}function Rv({sys:t,sharedState:e,phase:r,operation:n,error:i}){fa(e,r);let s=i instanceof Error?i.message:String(i);e.state="init-error",e.isFinalState=!0,e.errorMessage=s,xe.error(`Launch error (${n}): ${s} ${JSON.stringify({processId:e.processId,launchPhase:e.launchPhase,state:e.state,editorReady:e.editorReady})}`),t.Sentry?.captureException(i,{level:"fatal",tags:{operation:n,launchPhase:r},extra:{processId:e.processId,state:e.state,editorReady:e.editorReady,editorReadyAt:e.editorReadyAt,editorReadySource:e.editorReadySource,launchPhaseUpdatedAt:e.launchPhaseUpdatedAt}})}async function sye({sys:t,args:e,existingSession:r}){r&&(Fo=Promise.resolve(r),Pc=r);let n=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;n&&(t.Sentry?.setContext("flyIo",n),t.Sentry?.getCurrentScope().setContext("flyIo",n));let i=await Zu(t,e);if(hge(t,i),e.fusionInit&&G9(!0),i.privacyMode?.encryptKey&&!await Fb(i.privacyMode.encryptKey))throw new Error("Invalid encryption key: key failed validation");await TBe(t,i);let s=await Ogt(t,e,i),o=performance.now(),a="initial",A=!1,c={status:"ok",get state(){return a},set state(Q){a!==Q&&i.projectId&&i.branchName&&JL(t,s,{projectId:i.projectId,branchName:i.branchName,lastServerVersion:ut,lastServerState:Q},!1),a=Q},isFinalState:!1,get editorReady(){return A},set editorReady(Q){if(A&&!Q){let w=new Error("Attempted to unset editorReady");xe.error(`Ignoring editorReady regression: ${JSON.stringify({processId:process.pid,launchPhase:c.launchPhase,state:c.state,editorReadyAt:c.editorReadyAt,editorReadySource:c.editorReadySource})}`),t.Sentry?.captureException(w,{tags:{operation:"editor-ready-regression"},extra:{processId:process.pid,launchPhase:c.launchPhase,state:c.state,editorReadyAt:c.editorReadyAt,editorReadySource:c.editorReadySource}});return}!A&&Q&&(c.editorReadyAt=Date.now(),c.editorReadySource=c.launchPhase,xe.info(`Editor ready: ${JSON.stringify({processId:process.pid,source:c.editorReadySource,upTime:performance.now()-o})}`)),A=Q},initState:void 0,setupState:void 0,devState:void 0,httpServerState:void 0,errorMessage:void 0,devToolsVersion:ut,lastRequestTime:o,startTime:o,processId:process.pid,launchPhase:"state-created",launchPhaseUpdatedAt:Date.now(),workingDirectory:process.cwd(),httpClients:0,containerState:"busy",containerStateTimestamp:Date.now(),activeOperations:0,detectedServerUrl:i.autoDetectDevServer?void 0:i.serverUrl,fusionEnvironment:process.env.FUSION_ENVIRONMENT==="cloud"||process.env.FUSION_ENVIRONMENT==="cloud-v2"?process.env.FUSION_ENVIRONMENT:"unknown"},u;fa(c,"server-starting");let l,d,g,p,f,m;try{({app:l,proxyUrl:d,server:g,httpsServer:p,httpsProxyUrl:f,customHttpsProxyUrl:m}=await Kgt(s,i,c,t,e))}catch(Q){throw Rv({sys:t,sharedState:c,phase:"server-error",operation:"setup-server",error:Q}),Q}fa(c,"server-listening"),pl||(pl=xBe(t,s,i,c)),pl&&pl.start(),setInterval(()=>{Ggt(c)},5e3);let C=$gt(t,i,n),I=!1,B=!1,E=!1,y=Q=>async()=>{if(xe.info(`Received ${Q} signal`),c.state==="init-running"){xe.info("Init is running, skipping"),E=!0;return}if(I){xe.info("Server already closing, skipping");return}c.state="closing",I=!0,setTimeout(()=>{I=!1},1e3),xe.info("Closing server gracefully");try{g.closeAllConnections(),p&&p.closeAllConnections(),C(),pl&&(pl.stop(),pl=null);let w=[new Promise(D=>g.close(D))];if(p&&w.push(new Promise(D=>p.close(D))),await Promise.race([Promise.all(w),new Promise(D=>setTimeout(D,1e3))]),u&&(await u.close(),u=void 0),!B&&c.initState?.success){B=!0;let D=await xo();c.state="closing",D&&(xe.info("Closing codeGenServer"),Fv&&(Fv(),Fv=void 0),kv&&(clearInterval(kv),kv=void 0),await D.close(!!i.autoBackupGit),Fo=void 0)}await t.Sentry?.flush(2e3),process.env.BUILDER_DISABLE_AMPLITUDE!=="true"&&await iye.flush().promise,process.exit(0)}catch(w){t.Sentry?.captureException(w);let D=w instanceof Error?w.message:String(w);xe.error(`\u274C FAILED TO CLOSE SERVER: ${D}`),process.exit(1)}};if(DBe(),process.on("SIGTERM",y("SIGTERM")),process.on("SIGINT",y("SIGINT")),e.fusionInit){c.state="init-running";let Q={operation:"fusion-init",mode:i.mode??""},w=new Fh({sys:t,fusionConfig:i,debug:!0,credentials:s,sentryTags:Q});c.initState=w.initState,c.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){xe.error("\u274C Initialization failed"),t.Sentry?.captureException(new Error("Initialization failed"),{level:"fatal",tags:Q,extra:{initState:w.initState}}),c.state="init-error",c.isFinalState=!0,c.errorMessage=w.initState.error,E&&await y("init-end")();return}if(xe.info("\u2705 Initialization completed successfully"),c.state="init-complete",E){await y("init-end")();return}if(i.mode==="backup"||i.mode==="backup-force-full"){await y("init-end")();return}i._attemptDryRunBackupGit&&kBe({sys:t,fusionConfig:i,debug:!0,credentials:s},w.initState).then(S=>{S&&(c._attemptDryRunBackupOutcome=S.success?"success":S.error)}).catch(S=>{t.Sentry?.captureException(S,{tags:{operation:"dry-run-backup-git",dryRunBackupGit:"true"}})})}try{u=Hgt(t,i,c,e,s)}catch(Q){throw Rv({sys:t,sharedState:c,phase:"dev-server-error",operation:"setup-dev-server-orchestrator",error:Q}),Q}if(fa(c,"dev-server-configured"),e.fusionInit&&u){let Q=i.nativeApp?3e5:2e3;fa(c,"setup-command-waiting");try{await Promise.race([u.ensureSetupCommand(),new Promise(w=>setTimeout(w,Q))])}catch(w){throw Rv({sys:t,sharedState:c,phase:"setup-command-error",operation:"ensure-setup-command",error:w}),w}}fa(c,"launch-server-setup"),await Jgt({sys:t,credentials:s,args:e,fusionConfig:i,proxyUrl:d,httpsProxyUrl:f,customHttpsProxyUrl:m,server:g,httpsServer:p,app:l,devServer:u,sharedState:c}),await kt("launch",{...i,dev:!!e.dev})}async function Ogt(t,e,r){let n;try{if(n=await $t(t,e,{builderPrivateKey:!0,builderPublicKey:!0}),!n.builderPublicKey||!n.builderPrivateKey){let i="You need to be logged in to use the fusion command.";return XBe(e,i),xe.error(i),Ue("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 s=new URL(`${ke}/fusion/cli-key`);s.searchParams.set("host",i),s.searchParams.set("apiKey",n.builderPublicKey);let o=await Fe(s.toString(),{headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.builderPrivateKey}`},method:"GET"});if(!o.ok){let c=await o.text();throw new Error(`Failed to fetch original private key: ${c}`)}let A=(await o.json())?.key;A&&(n.builderPrivateKey=A,n.timestamp=new Date().toISOString(),aS(t,n))}catch(s){t.Sentry?.captureException(new Error("Failed to fetch original private key, using existing credentials",{cause:s}))}}xe.info(`Logged in as space: ${n.spaceName||n.builderPublicKey}`)}catch(i){let s="Authentication failed.";return XBe(e,s,i instanceof Error?i.message:String(i)),xe.error(s),Ue("Please login first with: npx builder.io login"),await Ne(1)}return n}async function Kgt(t,e,r,n,i){let s=!!e.isLocal||!!i?.local,{httpPort:o,httpsPort:a}=await Ugt(e,s);e.nativeApp?xe.info(`\u{1F50D} Setting up Builder.io API server on port ${o} (Native App Mode)`):xe.info(`\u{1F50D} Setting up Builder.io server on port ${o}`);let A=(0,uB.default)();A.use((y,Q,w)=>{!s&&y.url?.startsWith(Bg)&&!y.url.includes("/status-v2")&&!y.url.includes("/editor-ready")&&xe.debug(`[HTTP]: ${y.url}`),y.query._skip_activity!=="true"&&(r.lastRequestTime=performance.now()),w()});let c=t.builderPrivateKey,u=e.authenticateProxy??!1;Tie({sys:n,app:A,validBuilderPrivateKey:c,authenticateProxy:u,isLocal:s,sharedState:r,fusionConfig:e,launchLogger:xe});let l=eye.createServer(A),d=1e3,g=60*d;l.keepAliveTimeout=1*g,l.headersTimeout=1*g+d;let p;if(e.https)try{let{port:y,...Q}=e.httpsServerOptions??{};p=tye.createServer(Q,A),xe.info(`\u{1F50D} Setting up HTTPS server on port ${a}`)}catch(y){xe.error(`\u274C Failed to create HTTPS server: ${y instanceof Error?y.message:String(y)}`),p=void 0}let f=e.localHttpsDomain,m=`http://localhost:${o}`,C=a?`https://localhost:${a}`:void 0,I=f&&a?`https://${f}:${a}`:void 0,B=[new Promise((y,Q)=>{l.listen(o,async()=>{xe.info(`\u{1F680} Builder.io HTTP server running at ${m}`),xe.info("Available server URLs:"),xe.info(` HTTP (localhost): ${m}`),y(!0)}),l.on("error",w=>{xe.error(`\u274C Failed to create HTTP server: ${w instanceof Error?w.message:String(w)}`),Q(w)})})];return p&&B.push(new Promise((y,Q)=>{p.listen(a,async()=>{xe.info(`\u{1F680} Builder.io HTTPS server running at ${C}`),xe.info(` HTTPS (localhost): ${C}`),I&&xe.info(` HTTPS (custom domain): ${I}`),y(!0)}),p.on("error",w=>{xe.error(`\u274C Failed to create HTTPS server: ${w instanceof Error?w.message:String(w)}`),Q(w)})})),await Promise.all(B),{app:A,proxyUrl:I||C||m,server:l,httpsServer:p,httpsProxyUrl:C,customHttpsProxyUrl:I}}function Hgt(t,e,r,n,i){if(e.nativeApp){e.devCommand?xe.info(`Running ${(0,AB.cyan)(e.devCommand)} in native app mode...`):xe.info("Native app mode: No dev command specified");let s=gL(t,e,n.fusionInit&&e.setupCommand?.trim()?"not-installed":"installed");return r.devState=s.devState,r.setupState=s.setupState,r.httpServerState="ok-2xx",s.emitter.on("devState",o=>{r.devState=o}),s.emitter.on("setupState",o=>{r.setupState=o}),s}if((n.serverUrl||n.chat)&&!n.command){n.chat||xe.info(`Proxying to existing dev server at ${(0,AB.cyan)(e.serverUrl)}...`),r.devState="running",r.setupState="installed",r.httpServerState="ok-2xx";return}else{e.devCommand&&xe.info(`Running ${(0,AB.cyan)(e.devCommand)} on host ${e.serverUrl?(0,AB.cyan)(e.serverUrl):"TBD"}...`);let s=gL(t,e,n.fusionInit?"not-installed":"installed");return r.devState=s.devState,r.setupState=s.setupState,r.httpServerState=s.httpServerState.state,s.emitter.on("devState",o=>{r.devState=o}),s.emitter.on("setupState",o=>{r.setupState=o}),s.emitter.on("httpServerState",o=>{r.httpServerState=o}),s.emitter.on("urlDetected",o=>{r.detectedServerUrl=o}),s.emitter.on("metrics",o=>{if(o.durations)for(let a of o.durations)process.env.DEBUG&&xe.debug(`[Metrics](${a.key}): ${a.ms}ms ${a.attributes?JSON.stringify(a.attributes):""}`);bv(t,i,o).catch(a=>{t.Sentry?.captureException(a,{tags:{operation:"push-metrics"}})})}),s}}async function Jgt({sys:t,credentials:e,args:r,fusionConfig:n,app:i,server:s,httpsServer:o,proxyUrl:a,httpsProxyUrl:A,customHttpsProxyUrl:c,devServer:u,sharedState:l}){async function d({force:p=!1,forcedFullBackup:f=!1}={}){xe.info(`\u{1F4E6} Attempting backup${p?" (forced)":""}${f?" (full)":""}...`);let m=await xo();if(!m)if(n.autoBackupGit&&l.initState?.success)m=await cB(t,e,n,u,void 0,l,void 0,n.privacyMode);else return xe.info("\u{1F51A} No active session"),{success:!0,message:"No active session",skipped:!0,reason:"no_active_session"};if(!(p||n.autoBackupGit))return xe.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(!m.isIdle())return xe.info("\u{1F51A} Not idle, skipping backup"),{success:!1,message:"Not idle, skipping backup",skipped:!0,reason:"not_idle"};if(!f&&!await m.needsBackup())return xe.info("\u2705 Already backed up after last request"),{success:!0,message:"Already backed up",skipped:!0,reason:"already_backed_up"};try{let B=await m.uploadBackup(f);return B.success&&xe.info("\u2705 Backup successful"),B}catch(B){let E=`Backup error: ${B instanceof Error?B.message:String(B)}`;return xe.error(`\u274C ${E}`),{success:!1,message:E,error:B instanceof Error?B:new Error(String(B))}}}async function g(p){xe.info(`\u{1F504} Attempting graceful shutdown: ${p}`);let f=()=>{n.autoShutdown&&(xe.info("\u{1F504} Shutting down process"),process.kill(process.pid,"SIGTERM"))},m=await d({force:!1});return m.success&&f(),m}try{let p=uB.default.Router();if(p.post("/generate",async(Q,w)=>{try{xe.debug("(generate): started");let{prompt:D,userMessage:x,canHandleTools:S,fireAndForget:v,context:{featureFlags:P}}=Q.body;if(!D&&!x)return w.status(400).json({error:"No prompt/userMessage provided"});w.socket?.setNoDelay(!0),w.setHeader("Content-Type","text/event-stream; charset=utf-8"),w.setHeader("Transfer-Encoding","chunked"),w.setHeader("X-Accel-Buffering","no"),w.setHeader("Cache-Control","no-cache"),w.setHeader("Connection","keep-alive"),P&&e4(P);let $=await cB(t,e,n,u,void 0,l,void 0,n.privacyMode);if(v){Array.isArray(S)&&S.length>0&&$.setSessionCanHandleTools(S),$.waitForEventLoop(),await $.sendMessage(D?{userPrompt:D}:x),w.status(200),w.write(JSON.stringify({type:"success",message:"Message sent"})+`
|
|
6427
6427
|
`),w.end();return}let H=setInterval(async()=>{let G={type:"ping"};w.write(JSON.stringify(G)+`
|
|
6428
6428
|
`)},5e3),M=$.connectToEventLoop(!1,G=>{w.write(JSON.stringify(G)+`
|
|
6429
6429
|
`)},{canHandleTools:Array.isArray(S)?S:[]});try{await $.sendMessage(D?{userPrompt:D}:x),await $.waitUntilIdle()}catch(G){t.Sentry?.captureException(G);let Y=G instanceof Error?G.message:String(G);w.write(`${JSON.stringify({type:"error",message:`Error: ${Y}`})}
|