@zuplo/core 5.2389.0 → 5.2391.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/create.index.minified.js +1 -1
- package/index.minified.js +1 -1
- package/package.json +1 -1
package/index.minified.js
CHANGED
|
@@ -299,7 +299,7 @@ globstar while`,t,_,r,m,g),this.matchOne(t.slice(_),r.slice(m),n))return this.de
|
|
|
299
299
|
`)}s(jut,"generateRefs");function Mut(e,t,r,n,i,o,a){let u=[];u.push(`${r}: {`);let c=m1(e,t,n,i,o,a);return u.push(c),u.push("}"),u.join(`
|
|
300
300
|
`)}s(Mut,"getJsonEntry");function m1(e,t,r,n,i,o){let a=[];for(let u in r){let c=r[u];if(u==="$ref")return(0,Hm.chaseRefs)(e,t,(0,Hm.getFullyQualifiedRefName)(e,c),n,i,o),`$REF:${tae(t,o.get((0,Hm.getFullyQualifiedRefName)(e,c)))}`;switch(typeof c){case"string":{a.push(`"${u}": ${JSON.stringify(c)},`);break}case"number":case"boolean":{a.push(`"${u}":${c},`);break}default:if(Array.isArray(c))a.push(`"${u}":[`),c.forEach(l=>{if(typeof l=="object"){let f=m1(e,t,l,n,i,o);if(f.startsWith("$REF")){let d=f.split(":")[1];a.push(`${d},`)}else a.push("{"),a.push(f),a.push("},")}else a.push(`${JSON.stringify(l)},`)}),a.push("],");else{let l=m1(e,t,c,n,i,o);if(l.startsWith("$REF")){let f=l.split(":")[1];a.push(`${u}: ${f},`)}else a.push(`"${u}":{`),a.push(l),a.push("},")}}}return a.join(`
|
|
301
301
|
`)}s(m1,"processNode");function tae(e,t){return(0,Zoe.sanitizedIdentifierName)(e)+`_refsData_${t}`}s(tae,"getRefIdentifierName")});var iae=h(zm=>{"use strict";var g1=zm&&zm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zm,"__esModule",{value:!0});zm.runtimeConfigPlugin=void 0;var Uut=g1(gn()),xut=g1(require("fs/promises")),H2=g1(require("path")),qut=g1(_n()),_1="runtime-config",nae="runtime-config-plugin";function Fut(){return{name:_1,setup(e){e.onResolve({filter:/^\.\.\/modules\/zuplo.runtime.ts$/},t=>({namespace:nae,path:H2.default.isAbsolute(t.path)?t.path:H2.default.join(t.resolveDir,t.path),pluginName:_1})),e.onLoad({filter:/.*/,namespace:nae},async t=>qut.default.timeFn("Generating zuplo.runtime.ts data",async()=>{let r="export const runtimeInit = undefined;",n=[];return await Uut.default.fileExists(t.path)?(r=await xut.default.readFile(t.path,"utf-8"),{contents:r,loader:"ts",resolveDir:H2.default.dirname(t.path),errors:n,pluginName:_1,watchFiles:[t.path]}):{contents:r,loader:"ts",errors:n,pluginName:_1}}))}}}s(Fut,"runtimeConfigPlugin");zm.runtimeConfigPlugin=Fut});var lae=h(js=>{"use strict";var Fd=js&&js.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(js,"__esModule",{value:!0});js.isPolicyPresentInOperation=js.getPolicyNamesReferencingPolicyHandlers=js.schemaValidationSource=js.schemaValidationPlugin=void 0;var Km=Gf(),HE=require("@zuplo/runtime/internal"),sae=Fd(gn()),But=Fd(dU()),kut=Fd(pU()),y1=Fd(require("fs/promises")),Zc=Fd(require("path")),Gut=Fd(require("prettier")),z2=Bt(),Vut=Fd(Xs()),K2="schema-validation-plugin",oae="schema-validation",Hut="module.exports = {}";function zut(e){return{name:"schema-validation-plugin",setup(t){t.onResolve({filter:/ajv-schema.json$/},r=>({namespace:oae,path:r.path,pluginName:K2})),t.onLoad({filter:/.*/,namespace:oae},async r=>{let n=Zc.default.resolve(e.sourceDirectory,z2.USER_CONFIG_DIR_NAME,"policies.json");if(!e.isOpenApiBased||!await sae.default.fileExists(n))return{contents:Hut,loader:"js",resolveDir:Zc.default.dirname(r.path),pluginName:K2};let i=await Kut(e.sourceDirectory),o=Zc.default.resolve(e.sourceDirectory,z2.USER_CONFIG_DIR_NAME),a=await(0,Km.getOpenApiFilesByAlphabetical)(o),u=await Yut(a,i),c=await aae({oasFiles:a,routesWithSchemaValidation:u,sourceDirectory:e.sourceDirectory,logger:e.logger});if(Vut.default.DEBUG_BUILD_MODE&&c){let l=Zc.default.join(e.sourceDirectory,z2.BUILD_OUTPUT_DIR),f=Zc.default.resolve(l,"schema-validation.js");await sae.default.mkdirForFilePathIfNotExits(f);let d=await Gut.default.format(c,{parser:"babel"});await y1.default.writeFile(f,d,"utf-8")}return{contents:c,loader:"js",resolveDir:Zc.default.dirname(r.path),pluginName:K2}})}}}s(zut,"schemaValidationPlugin");js.schemaValidationPlugin=zut;async function aae({oasFiles:e,routesWithSchemaValidation:t,sourceDirectory:r,logger:n}){let i="",o=new Km.RefParser(r,n);if(t.length===0)return i;let a=new But.default({code:{source:!0},allErrors:!0,strict:!1,verbose:!0,meta:!0});for(let u of e){let c=await y1.default.readFile(u,"utf-8"),l=Zc.default.basename(u,".oas.json"),f=t.filter(y=>y.fileName===l),d=await o.resolve(u),_=JSON.parse(c),m=[],g=new Map;f.forEach(y=>{let b=_.paths[y.path][y.method];if(b.requestBody){let E;if(b.requestBody.$ref){let O=b.requestBody.$ref;E=d.get(O)?.content}else b.requestBody.content&&(E=b.requestBody.content);if(E)for(let O in E){let v=E[O].schema,P=(0,HE.getIdForRequestBodySchema)(y.path,y.method,O);v.$id=P,a.addSchema(v),W2(v,u,l,a,d,m,g)}}if(b.parameters)for(let E of b.parameters){let O=E.$ref?d.get(E.$ref):E,v=O.schema.$ref?d.get(O.schema.$ref):O.schema,P=(0,HE.getIdForParameterSchema)(y.path,y.method,O.in,O.name);v.$id=P,a.addSchema(v),W2(O,u,l,a,d,m,g)}});for(let y of m){let b=d.get(y),E=(0,HE.getIdForRefSchema)(l,y);a.addSchema(b,E)}}return i=(0,kut.default)(a),i}s(aae,"schemaValidationSource");js.schemaValidationSource=aae;function W2(e,t,r,n,i,o,a){for(let u in e){let c=e[u];if(u==="$ref"){let l=(0,HE.getIdForRefSchema)(r,(0,Km.getFullyQualifiedRefName)(t,c));e[u]=l,(0,Km.chaseRefs)(t,r,(0,Km.getFullyQualifiedRefName)(t,c),i,o,a,(f,d)=>(0,HE.getIdForRefSchema)(f,(0,Km.getFullyQualifiedRefName)(t,d)))}else typeof c=="object"&&W2(c,t,r,n,i,o,a)}}s(W2,"addRefsToSchema");async function Kut(e){let t=new Set(["RequestValidationInboundPolicy"]),r=await y1.default.readFile(`${e}/config/policies.json`,"utf-8"),n=JSON.parse(r);return uae(n,t)}s(Kut,"getPolicyNamesUsingSchemaValidationPolicies");function uae(e,t){let r=new Set;e.policies?.forEach(i=>{i.handler?.export&&t.has(i.handler.export)&&i.handler.module==="$import(@zuplo/runtime)"&&r.add(i.name)});let n=Wut(e,r);return new Set([...r,...n])}s(uae,"getPolicyNamesReferencingPolicyHandlers");js.getPolicyNamesReferencingPolicyHandlers=uae;function Wut(e,t){let r=new Set;return e.policies?.forEach(n=>{n.handler?.export==="CompositeInboundPolicy"&&n.handler?.options?.policies?.forEach(i=>{t.has(i)&&r.add(n.name)})}),r}s(Wut,"getCompositePoliciesContainingPolicy");function cae(e,t){if(!e["x-zuplo-route"]||!e["x-zuplo-route"].policies)return!1;let r=e["x-zuplo-route"].policies.inbound;if(r){for(let i of r)if(t.has(i))return!0}let n=e["x-zuplo-route"].policies.outbound;if(n){for(let i of n)if(t.has(i))return!0}return!1}s(cae,"isPolicyPresentInOperation");js.isPolicyPresentInOperation=cae;async function Yut(e,t){let r=[];for(let n of e){let i=await y1.default.readFile(n,"utf-8"),a=JSON.parse(i).paths;for(let u in a){let c=a[u];for(let l in c){let f=c[l];cae(f,t)&&r.push({fileName:Zc.default.basename(n,".oas.json"),path:u,method:l})}}}return r}s(Yut,"getRoutesContainingPolicies")});var Y2=h(Qc=>{"use strict";var Jut=Qc&&Qc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qc,"__esModule",{value:!0});Qc.BUILD_CONDITIONS=void 0;var Xut=R9(),E1=Jut(require("path")),Zut=Bt(),Qut=C9(),ect=j9(),tct=q9(),rct=XX(),nct=eZ(),ict=Yoe(),sct=rae(),oct=iae(),act=lae(),uct=(0,Xut.debug)("zuplo:core:build");Qc.BUILD_CONDITIONS=["workerd","worker","browser"];var fae=[...process.env.GLOBAL_MODULE_LOCATION?[process.env.GLOBAL_MODULE_LOCATION]:[],E1.default.resolve(__dirname,"..","..","..","node_modules"),E1.default.resolve(__dirname,"..","..","..","..","..","node_modules"),...require.main?.paths??[]];async function cct({dev:e=!1,systemDirectory:t,outputDirectory:r,sourceDirectory:n,logger:i,flags:o}){let a=E1.default.join(t,Zut.WORKER_ENTRY_NAME);uct(`Building with node paths: ${fae.join(", ")}`);let u=e===!1?{minify:!0}:{minify:!1,keepNames:!0,metafile:!0},c={platform:"browser",target:"es2022",outfile:E1.default.join(r,"worker.js")};return{format:o?.esmWorker===!0?"esm":"iife",banner:{js:`'use strict';
|
|
302
|
-
`},nodePaths:fae,entryPoints:[a],...c,sourcemap:"linked",legalComments:"linked",treeShaking:!0,bundle:!0,...u,external:[],logLevel:"silent",conditions:Qc.BUILD_CONDITIONS,plugins:[(0,tct.environmentPlugin)({sourceDirectory:n}),(0,Qut.blockRemoteModulePlugin)({logger:i}),(0,ict.openApiRoutesPlugin)({sourceDirectory:n,outputDirectory:r}),(0,sct.rawRoutePlugin)({sourceDirectory:n,logger:i}),(0,act.schemaValidationPlugin)({sourceDirectory:n,logger:i,isOpenApiBased:!0}),(0,oct.runtimeConfigPlugin)(),(0,ect.devPortalConfigPlugin)({sourceDirectory:n}),(0,rct.jsonSchemaPlugin)({sourceDirectory:n,outputDirectory:r}),(0,nct.nodejsCompatPlugin)({nodeCompatEnabled:o?.esmWorker===!0,sourceDirectory:n})]}}s(cct,"getBaseESBuildConfig");Qc.default=cct});var S1=h(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.formatBuildResult=Ms.BUILD_TASK_PLUGIN_NAME=Ms.ESBUILD_PLUGIN_NAME=void 0;Ms.ESBUILD_PLUGIN_NAME="run-esbuild";Ms.BUILD_TASK_PLUGIN_NAME="build-task";var lct=s((e,t)=>{let r=t;if(t.includes(e)){let n=new RegExp(`.*(${e})`,"g");r=t.replace(n,"")}return r.match(/^(\/)?(\.\.(\/)?)+/)&&(r=r.replace(/^(\/)?(\.\.(\/)?)+/,"/")),r},"removePrefixFromString"),fct=s((e,t)=>{let r=t;if(r.includes(e)){let n=new RegExp(`[a-zA-Z0-9-_.\\/]+(${e})`,"g");r=r.replace(n,"")}return r},"cleanFilePathsInMessage"),b1=s((e,t,r)=>{if(!e||e.length<=0)return e;let n=e.filter(i=>i.message!=='Could not resolve "@zuplo/runtime"');return n&&n.length>0&&n.forEach(i=>{i.location&&i.location.file&&(i.location.file=lct(t,i.location.file)),i.location&&i.location.lineText&&i.location.lineText.includes("@zuplo/core/index.minified.js")&&(i.location.lineText=i.location.lineText.substring(0,200)+"...<Truncated>"),i.message=fct(t,i.message),i.notes&&i.notes.length>0&&delete i.notes,i.text&&delete i.text,i.pluginName===""&&(i.pluginName=r)}),n},"cleanDataOnBuildIssue");function dct(e,t,r){try{e.buildTaskResult&&(e.buildTaskResult.errors&&(e.buildTaskResult.errors=b1(e.buildTaskResult.errors,t,Ms.BUILD_TASK_PLUGIN_NAME)),e.buildTaskResult.warnings&&(e.buildTaskResult.warnings=b1(e.buildTaskResult.warnings,t,Ms.BUILD_TASK_PLUGIN_NAME))),e.compilerResult&&(e.compilerResult.errors&&(e.compilerResult.errors=b1(e.compilerResult.errors,t,Ms.ESBUILD_PLUGIN_NAME)),e.compilerResult.warnings&&(e.compilerResult.warnings=b1(e.compilerResult.warnings,t,Ms.ESBUILD_PLUGIN_NAME)))}catch(n){r.error("Error while formatting buildResult. Err: ",n)}return e}s(dct,"formatBuildResult");Ms.formatBuildResult=dct});var hae=h(Us=>{"use strict";var pct=Us&&Us.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return t[r]},"get")}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),hct=Us&&Us.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),mct=Us&&Us.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&pct(t,e,r);return hct(t,e),t},pae=Us&&Us.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Us,"__esModule",{value:!0});Us.getRunEsBuildPlugin=void 0;var _ct=Gf(),dae=Yo(),gct=mct(require("esbuild")),yct=pae(_n()),Ect=CI(),bct=pae(Y2()),J2=S1(),Sct=s(function(e){return s(async function({systemDirectory:r,outputDirectory:n,sourceDirectory:i,dev:o,generateSourceMaps:a,buildId:u,logger:c,config:l}){return yct.default.timeFn("Running esbuild",async()=>{c.info(`Running build_id: ${u}`);let f=await(0,bct.default)({systemDirectory:r,outputDirectory:n,generateSourceMaps:a,sourceDirectory:i,dev:o,logger:c,flags:l.flags}),d,_=new Date;try{if(!await(0,_ct.oasFileInProject)(i))throw new Error("Failed to build project because no open-api file was found on the 'config' folder");d=await gct.build(f)}catch(g){if(c.error(g),g.errors||g.warnings)d=g;else if(g.message.includes("Failed to build project because no open-api file was found on the 'config' folder"))d={warnings:[],errors:[{id:"missing-open-api-file",text:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:J2.ESBUILD_PLUGIN_NAME,location:null,notes:[],detail:"Failed to build project because no open-api file was found on the 'config' folder"}],outputFiles:void 0,metafile:void 0,mangleCache:void 0};else throw g}let m=new Date;if(e(new Ect.CompilerResult(d,{endBuildTime:m,startBuildTime:_,buildId:u??""})),d.errors.length>0){d.errors.length>1&&(d.errors.length=1);let g=d.errors[0];c.debug(g)}return{warnings:[...d.warnings.map(g=>({message:g.text,pluginName:J2.ESBUILD_PLUGIN_NAME,severity:dae.WARNING_SEVERITY}))],errors:[...d.errors.map(g=>({message:g.text,pluginName:J2.ESBUILD_PLUGIN_NAME,severity:dae.ERROR_SEVERITY}))]}})},"runEsbuild")},"getRunEsBuildPlugin");Us.getRunEsBuildPlugin=Sct});var Z2=h(Ym=>{"use strict";var _ae=Ym&&Ym.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ym,"__esModule",{value:!0});Ym.build=void 0;var Wm=Yo(),Oct=require("crypto"),vct=require("fs"),zE=_ae(require("path")),mae=Bt(),Ict=rc(),Pct=_ae(_n()),wct=HH(),Tct=KH(),Nct=WH(),Act=YH(),Rct=QH(),Cct=ez(),$ct=iz(),Dct=h9(),Lct=_9(),jct=hae(),X2=S1(),O1;try{let e=(0,vct.readFileSync)(zE.default.resolve(__dirname,"../../package.json"),"utf-8");O1=JSON.parse(e).version}catch{O1="0.0.0"}async function Mct({sourceDirectory:e,deploymentName:t=zE.default.basename(e),dev:r,entitlements:n,environmentType:i,generateSourceMaps:o=!1,logger:a,noCompile:u=!1,postBuildTasks:c,projectId:l,publicZuploEnvironmentVariables:f={}}){let d=(0,Oct.randomUUID)(),_=a.child({buildId:d});return Pct.default.timeFn(`Run build with build_id: ${d}`,async()=>{let m=await(0,wct.getZuploConfig)(e),g=zE.default.join(e,mae.BUILD_OUTPUT_DIR),y;if("errors"in m)y={status:"Failed",flags:void 0,compatibilityDate:void 0,runtimeVersion:O1,outputPath:g,buildTaskResult:{buildTime:"",buildTimeMs:0,status:Wm.FAILURE_STATUS,buildId:d,warnings:[],errors:m.errors}};else{let E={dev:r,generateSourceMaps:o,deploymentName:t,sourceDirectory:e,outputDirectory:g,systemDirectory:zE.default.join(e,mae.GENERATED_SOURCE_DIR_NAME),buildId:d,logger:_,config:m.config,publicZuploEnvironmentVariables:f,projectId:l,entitlements:n,environmentType:i},O=[];O.push(Tct.cleanOutput),O.push(Nct.createSystemDir),O.push(Act.checkForDeprecations),O.push(Rct.generateBuildData),O.push($ct.validateDevPortalJSON),O.push(Dct.validateOpenAPIFiles),O.push(Cct.generateWorker);let v,P=s(K=>{v=K},"compileCallback");u||O.push((0,jct.getRunEsBuildPlugin)(P)),O.push(Lct.verifyWorkerOutput),c&&O.push(...c);let w=await(0,Ict.runPlugins)(O,E),j=w.errors.length>0?Wm.FAILURE_STATUS:w.warnings.length>0?Wm.WARNING_STATUS:Wm.GOOD_STATUS;y={status:j==="Failed"||v===void 0||v.status==="Failed"?"Failed":j==="Warnings"||v.status==="Warnings"?"Warnings":"Good",compatibilityDate:m.config.compatibilityDate,runtimeVersion:O1,outputPath:g,compilerResult:v,buildTaskResult:{buildTime:"",buildTimeMs:0,status:j,buildId:d,warnings:w.warnings,errors:w.errors},flags:m.config.flags}}if(y.buildTaskResult.warnings.length>0){y.buildTaskResult.warnings.forEach(O=>{_.warn(O)});let E=y.buildTaskResult.warnings.filter(O=>O.pluginName!=="runEsbuild"&&O.pluginName!==X2.ESBUILD_PLUGIN_NAME);E.length>0&&(y.buildTaskResult.warnings=E),y.buildTaskResult.status=Wm.WARNING_STATUS}if(y.buildTaskResult.errors.length>0){y.buildTaskResult.errors.forEach(O=>{_.error(O)});let E=y.buildTaskResult.errors.filter(O=>O.pluginName!=="runEsbuild"&&O.pluginName!==X2.ESBUILD_PLUGIN_NAME);E.length>0&&(y.buildTaskResult.errors=E),y.buildTaskResult.status=Wm.FAILURE_STATUS}if(_.debug(`Build ${y.compilerResult?.buildId??d} completed ${u?"on watch mode":"with compiler status "+y.compilerResult?.status} and build task status ${y.buildTaskResult.status}`),y.compilerResult){let{metafile:E,...O}=y.compilerResult;_.debug(`Compiler results for build ${y.compilerResult?.buildId??d}`,O)}_.debug(`Build task results for build ${y.buildTaskResult?.buildId??d}`,y.buildTaskResult);let b=zE.default.basename(e);return(0,X2.formatBuildResult)(y,b,_)})}s(Mct,"build");Ym.build=Mct});var I1=h(xs=>{"use strict";var Uct=xs&&xs.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return t[r]},"get")}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),xct=xs&&xs.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),qct=xs&&xs.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Uct(t,e,r);return xct(t,e),t},v1=xs&&xs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xs,"__esModule",{value:!0});xs.BuildWatcher=void 0;var gae=Yo(),Fct=v1(require("chokidar")),Bct=qct(require("esbuild")),yae=require("crypto"),kct=v1(require("events")),KE=v1(require("path")),Eae=Bt(),Gct=Z2(),bae=CI(),Vct=v1(Y2()),Sae=S1(),Q2=class extends kct.default{static{s(this,"WatchEmitter")}},eB=class{static{s(this,"BuildWatcher")}esbuildContext;emitter=new Q2;envFilesWatcher;outputDirectory;sourceDirectory;dev;generateSourceMaps;logger;publicZuploEnvironmentVariables;projectName;constructor({sourceDirectory:t,dev:r,generateSourceMaps:n,logger:i,publicZuploEnvironmentVariables:o={}}){this.sourceDirectory=t,this.dev=r,this.outputDirectory=KE.default.join(t,Eae.BUILD_OUTPUT_DIR),this.generateSourceMaps=n??!1,this.logger=i,this.publicZuploEnvironmentVariables=o,this.projectName=KE.default.basename(t),this.envFilesWatcher=Fct.default.watch([KE.default.join(t,".env"),KE.default.join(t,".env.zuplo")])}watchEnvFiles(){this.envFilesWatcher.on("change",async()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("add",async()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("unlink",async()=>{this.emitter.emit("reload",null,null)})}onReload=s(t=>{this.emitter.on("reload",t)},"onReload");async start(){let{sourceDirectory:t}=this;if(this.esbuildContext!==void 0)throw new Error("Watcher cannot be started more than once");let r=await(0,Gct.build)({sourceDirectory:t,noCompile:!0,dev:this.dev,generateSourceMaps:this.generateSourceMaps,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger}),n=await(0,Vct.default)({systemDirectory:KE.default.join(t,Eae.GENERATED_SOURCE_DIR_NAME),outputDirectory:this.outputDirectory,sourceDirectory:t,dev:this.dev,generateSourceMaps:this.generateSourceMaps,logger:this.logger,flags:r.flags}),i=this;n.plugins?.push({name:"on-end",setup(o){o.onEnd(a=>{i.logger.debug("Watcher (build) reloaded");let u;if(a)if(u=new bae.CompilerResult(a),u.errors.length>0){let c={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:gae.FAILURE_STATUS,buildId:(0,yae.randomUUID)(),warnings:[],errors:[]}};c.compilerResult=u,(0,Sae.formatBuildResult)(c,i.projectName,i.logger),i.logger.error(c.compilerResult.errors,"Build errors")}else i.logger.debug(`Successfully rebuilt watched project. Build id ${u.buildId}`);i.emitter.emit("reload",r,null,u)})}}),this.esbuildContext=await Bct.context(n);try{let o=await this.esbuildContext.rebuild();if(o.errors.length>0){let a={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:gae.FAILURE_STATUS,buildId:(0,yae.randomUUID)(),warnings:[],errors:[]}};a.compilerResult=new bae.CompilerResult(o),(0,Sae.formatBuildResult)(a,this.projectName,this.logger),this.logger.error(a.compilerResult.errors,"Build errors")}}catch(o){throw await this.close(),o}await this.esbuildContext.watch()}async close(){try{await this.envFilesWatcher.close(),this.esbuildContext&&(await this.esbuildContext.dispose(),this.logger.debug("ESBuild watcher closed"))}catch(t){this.logger.error(t)}}};xs.BuildWatcher=eB});var tB=h(P1=>{"use strict";Object.defineProperty(P1,"__esModule",{value:!0});P1.HttpStatusCode=void 0;var Oae;(function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(Oae||(P1.HttpStatusCode=Oae={}))});var vae=h(w1=>{"use strict";Object.defineProperty(w1,"__esModule",{value:!0});w1.getSourceControlProviderLabel=void 0;function Hct(e){let t="";switch(e){case"GITLAB":t="GitLab";break;case"GITHUB":t="GitHub";break;case"BITBUCKET":t="BitBucket";break;default:t=e;break}return t}s(Hct,"getSourceControlProviderLabel");w1.getSourceControlProviderLabel=Hct});var Pae=h(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.DEPLOYMENT_NO_ACCESS=S.INVALID_SOURCE_REPO_URL=S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED=S.PROJECT_MUST_HAVE_ONE_MEMBER=S.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS=S.PROJECT_MEMBER_ALREADY_EXISTS=S.PROJECT_MEMBER_NOT_FOUND=S.INVALID_TEMPLATE_REPOSITORY=S.INCORRECT_PROJECT_TEMPLATE=S.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS=S.PROJECT_NOT_FOUND=S.PROJECT_NOT_FOUND_FOR_SOURCE_REPO=S.PROJECT_SHARING_DISABLED_ON_ACCOUNT=S.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED=S.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED=S.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE=S.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER=S.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND=S.ACCOUNT_MEMBER_INVITE_INVALID=S.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST=S.ACCOUNT_MEMBER_DOES_NOT_EXIST=S.ACCOUNT_MEMBER_INFO_MISSING=S.ACCOUNT_MEMBER_ALREADY_EXISTS=S.ACCOUNT_UPDATE_INFO_MISSING=S.ACCOUNT_INFO_MISSING=S.ACCOUNT_DOES_NOT_EXISTS=S.INVALID_ACCOUNT_LABEL_ENDING=S.INVALID_ACCOUNT_NAME_ENDING=S.ACCOUNT_NAME_ALREADY_IN_USE=S.INVALID_ACCOUNT_LABEL=S.INVALID_ACCOUNT_NAME=S.ACCOUNT_LABEL_LENGTH_LIMIT_REACHED=S.ACCOUNT_NAME_LENGTH_LIMIT_REACHED=S.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD=S.ACCOUNT_NAME_USES_RESERVED_KEYWORD=S.ACCOUNT_ALREADY_EXISTS=S.ACCOUNT_NOT_FOUND=S.USER_IS_NOT_SERVICE_ACCOUNT=S.USER_REMOVE_NOT_MEMBER_ACCOUNT=S.USER_HAS_NO_ACCESS_TO_ACCOUNT=S.USER_DETAILS_CANNOT_BE_FOUND=S.USER_ALREADY_EXISTS=S.CLIENT_NOT_FOUND=S.FORBIDDEN=S.UNAUTHORIZED=S.METHOD_NOT_ALLOWED=S.NOT_FOUND=S.CONFLICT=S.BAD_REQUEST=S.INTERNAL_SERVER_ERROR=void 0;S.GITHUB_INTEGRATION_ALREADY_EXISTS=S.FEATURE_FLAGS_NOT_FOUND=S.MAX_ALLOWED_PROJECTS_LIMIT_REACHED=S.PROJECT_ALREADY_HAS_REPO=S.PROJECT_INVALID_NAME=S.FAILED_TO_REVOKE_GH_TOKEN=S.USER_ACCOUNT_NOT_FS_MIGRATED=S.USER_NO_ACCESS_GITLAB_REPO=S.USER_NO_ACCESS_BITBUCKET_REPO=S.GITHUB_APP_CONFIGURATION_NOT_FOUND=S.GITHUB_APP_NO_USER_ACCESS_=S.GITHUB_APP_NO_NAMESPACE_ACCESS=S.GENERIC_GITHUB_BRANCH_INFO_ERROR=S.GITHUB_USER_NO_READ_ACCESS_REPO=S.USER_NO_PULL_ACCESS_GITHUB_REPO=S.USER_NO_ACCESS_GITHUB_REPO=S.PROJECT_SHARING_REQUIRES_GIT_REPO=S.PROJECT_INVALID_GIT_REPO=S.PROJECT_INVALID_GIT_CLONE=S.USER_IS_PROJECT_MEMBER=S.USER_HAS_NO_ACCESS_TO_PROJECT=S.RUNTIME_FLAG_KEY_NOT_VALID=S.RUNTIME_FLAG_NOT_FOUND=S.RUNTIME_FLAG_ALREADY_EXISTS=S.PROJECT_NO_MEMBERS=S.PROJECT_ALREADY_EXISTS=S.SERVICE_CONFIGURATION_FAILED_DECRYPTION=S.WORKING_COPY_SERVICE_NOT_CREATED=S.WORKING_COPY_SERVICE_NOT_DELETED=S.WORKING_COPY_SERVICE_NOT_FOUND=S.SERVICE_CONFIGURATION_NOT_FOUND=S.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE=S.DEPLOYMENT_INCORRECT_STATUS_PAUSE=S.DEPLOYMENT_NOT_WORKING_COPY=S.DEPLOYMENT_LOG_NOT_FOUND=S.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT=S.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED=S.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE=S.DEPLOYMENT_DELETE_ERROR=S.DEPLOYMENT_CANNOT_DELETE_INSTANCE=S.DEPLOYMENT_INVALID_MULTI_PART=S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=S.DEPLOYMENT_DIR_DOES_NOT_EXISTS=S.DEPLOYMENT_FILE_DOES_NOT_EXISTS=S.DEPLOYMENT_NOT_FOUND=S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=void 0;S.THIRD_PARTY_APP_CONNECTION_NOT_FOUND=S.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND=S.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR=S.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR=S.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST=S.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR=S.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED=S.SOURCE_CONTROL_REMOTE_BRANCH_EXISTS=S.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND=S.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION=S.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING=S.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING=S.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS=S.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS=S.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED=S.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS=S.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND=S.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND=S.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE=S.SOURCE_CONTROL_REPO_OPERATION_ERROR=S.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE=S.SOURCE_CONTROL_REPO_NOT_FOUND=S.SOURCE_CONTROL_AUTHENTICATION_FAILED=S.EXTERNAL_SERVICE_GENERIC_ERROR=S.API_USER_NO_ACCESS=S.EXTERNAL_USER_NOT_CONFIGURED=S.EXTERNAL_USER_NO_ACCESS=S.API_KEY_CANNOT_BE_CREATED=S.CONSUMER_CANNOT_BE_CREATED=S.CONSUMER_DOES_NOT_EXIST=S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=S.GITLAB_DUPLICATE_REPO=S.GITLAB_FAILED_DURING_REPO_CREATION=S.GITLAB_QUERY_USER_INFO_FAILED=S.BITBUCKET_FAILED_DURING_REPO_CREATION=S.BITBUCKET_WORKSPACE_MISCONFIGURATION=S.BITBUCKET_QUERY_USER_INFO_FAILED=S.GITHUB_INTEGRATION_INVALID_REPO=S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=S.GITHUB_INTEGRATION_DUPLICATE_REPO=S.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED=S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED=S.GITHUB_INTEGRATION_BRANCH_BEHIND=S.GITHUB_INTEGRATION_NOT_FOUND=S.GITHUB_REPOSITORY_NOT_FOUND=S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=void 0;S.RBACCONFIGURATION_REQUIRE_ENVIRONMENTS=S.RBACCONFIGURATION_DOES_NOT_EXISTS=S.RBAC_INVALID_EXPIRATION_DATE=S.ACCOUNT_RBAC_DISABLED=S.METERING_BUCKET_CREATION_FAILED=S.UNABLE_UPGRADE_PLAN=S.BUCKET_NOT_FOUND=S.BUCKET_API_KEY_SERVICE_CONFLICT=S.DIRECTORY_DELETE_FAILED=S.FILE_DELETE_FAILED=S.CANNOT_DELETE_SOLE_OPEN_API_FILE=S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=S.CANNOT_DELETE_ESSENTIAL_FILE=S.FILE_WRITE_FAILED=S.FILE_RENAME_FAILED=S.FILE_RENAME_FILE_ALREADY_EXISTS=S.FILE_RENAME_CANNOT_CHANGE_EXTENSION=S.FILE_RENAME_PATHS_MATCH=S.DIRECTORY_CREATION_FAILED=S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=S.DIRECTORY_DOES_NOT_EXIST=S.DIRECTORY_ALREADY_EXISTS=S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=S.FAILED_DOWNLOAD_FROM_STORAGE=S.CANNOT_FIND_SRC_DIRECTORY=S.CANNOT_READ_PACKAGE_JSON=S.PACKAGE_JSON_NOT_FOUND=S.RUNTIME_VERSION_INCORRECT_FORMAT=S.MIGRATIONS_ONLY_ON_WORKING_COPY=S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=S.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR=S.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2=S.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE=S.NO_GLOBAL_SYMBOLS=S.NO_ZUPLO_PREFIXED_VARIABLES=S.NON_EMPTY_TARGETS_REQUIRED=S.CONFLICTING_TYPES=S.OVERLAPPING_TARGETS=S.INVALID_BRANCH_NAME=S.TARGET_BRANCH_ONLY_FOR_PREVIEW=S.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY=S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE=S.DEPLOYMENT_NAME_MISSING=S.NON_EXISTENT_ENVIRONMENT_VARIABLE=S.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE=S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR=S.DUPLICATE_ENVIRONMENT_VARIABLE=S.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION=void 0;S.ACCOUNT_MISCONFIGURED_FOR_RBAC=S.ACCOUNT_ALREADY_RBAC_ENABLED=S.MISCONFIGURED_ENV_VAR=S.USER_HAS_NO_DEVELOPER_ENV_VAR_ACCESS=S.USER_HAS_NO_PROD_ENV_VAR_ACCESS=S.ACCOUNT_ADMIN_INVALID_PROJECT_ROLE_DOWNGRADE=S.USER_HAS_NO_DEPLOY_ACCESS_TO_PROJECT_ENVIRONMENT=S.USER_HAS_NO_ACCESS_TO_PROJECT_ENVIRONMENT=S.USER_CANNOT_EDIT_OWN_ROLE=S.USER_DOES_NOT_EXIST=S.INVALID_USER_ROLE=S.USER_HAS_NO_ACCESS_TO_CONSUMER=S.RBACCONFIGURATION_CONSUMER_LOCKED=S.RBACCONFIGURATION_MISCONFIGURATION=S.RBACCONFIGURATION_DELETE_MISCONFIGURATION=S.RBACCONFIGURATION_INVALID_OPENFGA_CONFIG=S.RBACCONFIGURATION_INVALID_PROJECT_PROVIDED=S.RBACCONFIGURATION_ACCOUNT_HAS_NO_PROJECTS=S.RBACCONFIGURATION_REQUIRE_PROJECTS=S.RBACCONFIGURATION_INVALID_ENVIRONMENTS=void 0;var T=tB(),Iae=vae(),zct="https://github.com/apps/zuplo/installations/new";S.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:T.HttpStatusCode.BAD_REQUEST};S.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:T.HttpStatusCode.CONFLICT};S.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:T.HttpStatusCode.NOT_FOUND};S.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:T.HttpStatusCode.METHOD_NOT_ALLOWED};S.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:T.HttpStatusCode.UNAUTHORIZED};S.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:T.HttpStatusCode.FORBIDDEN};S.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:T.HttpStatusCode.NOT_FOUND};S.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:T.HttpStatusCode.CONFLICT};S.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Forbidden",detail:"You are not authorized to access the account resource.",status:T.HttpStatusCode.FORBIDDEN};S.USER_REMOVE_NOT_MEMBER_ACCOUNT={type:"https://zup.fail/removed-user-not-account-member",title:"The user being removed is not a member of the account",status:T.HttpStatusCode.BAD_REQUEST};S.USER_IS_NOT_SERVICE_ACCOUNT={type:"https://zup.fail/user-not-service-account",title:"User is not a service account",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:T.HttpStatusCode.CONFLICT};S.ACCOUNT_NAME_USES_RESERVED_KEYWORD={type:"https://zup.fail/account-name-reserved-keyword",title:"The account name can not use reserved keyword 'zuplo'",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD={type:"https://zup.fail/account-use-reserved-keyword",title:"The account name can not start with a reserved keyword",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_LENGTH_LIMIT_REACHED={type:"https://zup.fail/account-name-length-limit",title:"The account name exceeds the 200 character limit",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_LABEL_LENGTH_LIMIT_REACHED={type:"https://zup.fail/account-label-length-limit",title:"The account label exceeds the 200 character limit",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_NAME={type:"https://zup.fail/invalid-account-name",title:"The account name can only contain lower-cased characters, numbers, dashes and underscores",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_LABEL={type:"https://zup.fail/invalid-account-label",title:"The account label can only contain alpha-numeric characters, spaces, dashes and underscores",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_ALREADY_IN_USE={type:"https://zup.fail/account-name-in-use",title:"The account name is already taken. Please try again using a different name.",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_NAME_ENDING={type:"https://zup.fail/invalid-account-name-ending",title:"The account name can not end with a dash or underscore character",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_LABEL_ENDING={type:"https://zup.fail/invalid-account-label-ending",title:"The account label can not end with a dash or underscore character",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"Not Found",detail:"The account does not exist.",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_UPDATE_INFO_MISSING={type:"https://zup.fail/account-update-info-missing",title:"Account information is insufficient for this operation.",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_DOES_NOT_EXIST={type:"https://zup.fail/account-member-does-not-exists",title:"Account member information cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST={type:"https://zup.fail/account-member-invite-does-not-exist",title:"Account member invite cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND={type:"https://zup.fail/account-member-invite-failed-send",title:"We were not able to send the account member invite. Please try again or contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER={type:"https://zup.fail/account-member-cannot-be-invited",title:"The user is already part of the account.",status:T.HttpStatusCode.BAD_REQUEST};S.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE={type:"https://zup.fail/existing-pending-account-member-invites",title:"The user has a pending invitation to this account.",status:T.HttpStatusCode.BAD_REQUEST};S.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED={type:"https://zup.fail/no-multi-account-members",title:"Account is not configured for multiple members",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED={type:"https://zup.fail/account-members-limit-reached",title:"This account has reached the limit of users allowed by its current billing plan.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_SHARING_DISABLED_ON_ACCOUNT={type:"https://zup.fail/project-sharing-disabled-on-account",title:"Project sharing is not enabled on account",status:T.HttpStatusCode.FORBIDDEN};S.PROJECT_NOT_FOUND_FOR_SOURCE_REPO={type:"https://zup.fail/project-not-found-for-source-repo",title:"Project not found for provided repository",status:T.HttpStatusCode.NOT_FOUND};S.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:T.HttpStatusCode.NOT_FOUND};S.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS={type:"https://zup.fail/project-cannot-be-deleted-protected-deployments-exists",title:"Project cannot be deleted because it has protected deployments",detail:"Project has protected deployments. Make sure to remove the use of custom domains before trying to delete the project.",status:T.HttpStatusCode.FORBIDDEN};S.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:T.HttpStatusCode.BAD_REQUEST};var Kct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:`The repository '${e} is not a valid Zuplo template repository`,status:T.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");S.INVALID_TEMPLATE_REPOSITORY=Kct;S.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:T.HttpStatusCode.NOT_FOUND};S.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:T.HttpStatusCode.BAD_REQUEST};S.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS={type:"https://zup.fail/cannt-delete-your-own-project-member",title:"Can not delete your own Project Member record",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_MUST_HAVE_ONE_MEMBER={type:"https://zup.fail/project-must-have-one-member",title:"Project must have at least one member",status:T.HttpStatusCode.BAD_REQUEST};S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_SOURCE_REPO_URL={type:"https://zup.fail/invalid-source-repo-url",title:"Project is not connected to source control, a sourceRepoUrl property must be specified and valid",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH={type:"https://zup.fail/deployment-branch-does-not-exist",title:"A deployment record cannot be found for the provided branch.",detail:"You can only update a project's default branch to one that has been deployed.",status:T.HttpStatusCode.FORBIDDEN};S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST={type:"https://zup.fail/default-deployment-does-not-exist",title:"A default deployment record cannot be found for the project.",detail:"You can only update a project's default branch to one that has been deployed.",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_DIR_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-dir-does-not-exists",title:"NOT FOUND",detail:"Deployment directory was not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART={type:"https://zup.fail/deployment-request-is-not-multi-part",title:"Request is not multipart.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INVALID_MULTI_PART={type:"https://zup.fail/deployment-invalid-multi-part",title:"Invalid request format. Must be multi-part file upload.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_CANNOT_DELETE_INSTANCE={type:"https://zup.fail/deployment-cannot-delete-instance",title:"Cannot delete instance of the deployment. Invalid account or project.",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE={type:"https://zup.fail/deployment-invalid-environment-to-delete",title:"Invalid environment to delete deployment",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED={type:"https://zup.fail/deployment-is-protected-cannot-be-deleted",title:"Deployment is protected and cannot be deleted",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid account",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid project name",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid user sub",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY={type:"https://zup.fail/deployment-cannot-be-deleted",title:"Deployment cannot be deleted since is a working copy",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:"Deployment is not working copy.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INCORRECT_STATUS_PAUSE={type:"https://zup.fail/deployment-incorrect-status-pause",title:"Deployment is not in a state to be paused.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE={type:"https://zup.fail/deployment-incorrect-status-unpause",title:"Deployment is not in a state to be unpaused.",status:T.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:T.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:T.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_DELETED={type:"https://zup.fail/working-copy-service-not-deleted",title:"Working Copy service failed to be deleted.",status:T.HttpStatusCode.BAD_REQUEST};S.WORKING_COPY_SERVICE_NOT_CREATED={type:"https://zup.fail/working-copy-service-not-created",title:"Working Copy service failed to be created.",status:T.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:T.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:T.HttpStatusCode.BAD_REQUEST};S.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:T.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_KEY_NOT_VALID={type:"https://zup.fail/runtime-flag-key-not-valid",title:"RuntimeFlag key must be snake case",status:T.HttpStatusCode.BAD_REQUEST};S.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Forbidden",detail:"You are not a member of the project",status:T.HttpStatusCode.FORBIDDEN};S.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_INVALID_GIT_CLONE={type:"https://zup.fail/project-invalid-git-clone",title:"Project requires defaultBranch & sourceRepoUrl for creation from a GitHub repository.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_INVALID_GIT_REPO={type:"https://zup.fail/project-invalid-git-repo",title:"The current source control repository is already in use by a Zuplo project",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_SHARING_REQUIRES_GIT_REPO={type:"https://zup.fail/project-sharing-requires-git-repo",title:"The current project is not connected to a source control repository.",status:T.HttpStatusCode.BAD_REQUEST};var Wct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-repo",title:"You do not have access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");S.USER_NO_ACCESS_GITHUB_REPO=Wct;var Yct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-repo",title:"You do not have pull access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");S.USER_NO_PULL_ACCESS_GITHUB_REPO=Yct;var Jct=s(({repositoryUrl:e})=>({type:"https://zup.fail/no-read-access-github-repo",title:"You do not have read access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");S.GITHUB_USER_NO_READ_ACCESS_REPO=Jct;S.GENERIC_GITHUB_BRANCH_INFO_ERROR={type:"https://zup.fail/gh-branch-info-error",title:"There was an error getting branch information for the GitHub repository associated to the project.",status:T.HttpStatusCode.BAD_REQUEST};S.GITHUB_APP_NO_NAMESPACE_ACCESS={type:"https://zup.fail/no-namespace-access-github-app",title:"The Zuplo GitHub app does not have access to the repositories under the namespace provided. Make sure to configure the GitHub Zuplo App on the repository.",status:T.HttpStatusCode.FORBIDDEN};var Xct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:"The Zuplo GitHub app does not have access to the repository. Make sure to configure the GitHub Zuplo App on the repository.",detail:`The Zuplo GitHub app has not been granted access to the repository '${e}'. Go to '${zct}' to add the repository.`,status:T.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");S.GITHUB_APP_NO_USER_ACCESS_=Xct;S.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:T.HttpStatusCode.NOT_FOUND};var Zct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-bitbucket-repo",title:"You do not have access to the Bitbucket repository associated to the project. Ask your Bitbucket admin for access and try again.",detail:`User does not have access to the Bitbucket repository associated to the project. Update the user permissions in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");S.USER_NO_ACCESS_BITBUCKET_REPO=Zct;var Qct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-gitlab-repo",title:"You do not have access to the GitLab repository associated to the project. Ask your GitLab admin for access and try again.",detail:`User does not have access to the GitLab repository associated to the project. Update the user permissions in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");S.USER_NO_ACCESS_GITLAB_REPO=Qct;S.USER_ACCOUNT_NOT_FS_MIGRATED={type:"https://zup.fail/user-account-not-fs-migrated",title:"User account is in a plan that does not allow project sharing. Please contact your account admin.",status:T.HttpStatusCode.FORBIDDEN};S.FAILED_TO_REVOKE_GH_TOKEN={type:"https://zup.fail/failed-to-revoke-gh-token",title:"Failed to revoke GitHub token for the user",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.PROJECT_INVALID_NAME={type:"https://zup.fail/project-invalid-name",title:"Project name is invalid, it only can contain letter, number and dashes.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_HAS_REPO={type:"https://zup.fail/project-already-has-repo",title:"The current project has been previously linked to a source control repository",status:T.HttpStatusCode.BAD_REQUEST};S.MAX_ALLOWED_PROJECTS_LIMIT_REACHED={type:"https://zup.fail/max-allowed-projects-limit-reached",title:"Your account has reached the maximum number of projects allowed.",status:T.HttpStatusCode.BAD_REQUEST};S.FEATURE_FLAGS_NOT_FOUND={type:"https://zup.fail/feature-flags-not-found",title:"Error trying to retrieve feature flags for this user",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.GITHUB_INTEGRATION_ALREADY_EXISTS={type:"https://zup.fail/github-integration-already-exists",title:"Error trying to create GitHub Integration, already exists.",status:T.HttpStatusCode.BAD_REQUEST};var elt=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:T.HttpStatusCode.CONFLICT,detail:`The repository ${e} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=elt;var tlt=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:T.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${e} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");S.GITHUB_REPOSITORY_NOT_FOUND=tlt;S.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:T.HttpStatusCode.NOT_FOUND,detail:"The project does not have a GitHub integration configured."};S.GITHUB_INTEGRATION_BRANCH_BEHIND={type:"https://zup.fail/github-integration-branch-behind",title:"The current branch is behind, sync with remote repo for avoid conflicts.",status:T.HttpStatusCode.BAD_REQUEST};S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:T.HttpStatusCode.FORBIDDEN};S.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED={type:"https://zup.fail/github-integration-query-user-info-failed",title:"Failed while requesting basic user info from GitHub",status:T.HttpStatusCode.FORBIDDEN};var rlt=s(({repositoryName:e,orgName:t})=>({type:"https://zup.fail/github-integration-duplicate-repo",title:"A repository with that name already exists in GitHub",details:`A repository named '${e}' already exists on GitHub org '${t}'.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");S.GITHUB_INTEGRATION_DUPLICATE_REPO=rlt;var nlt=s(({repositoryName:e,details:t})=>({type:"https://zup.fail/github-integration-failed-repo-creation",title:"Failed to create a new repository in GitHub",details:t,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=nlt;var ilt=s(({repositoryUrl:e})=>({type:"https://zup.fail/create-project-invalid-empty-repo",title:"The repository is empty and we can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.",details:`Repository '${e}' is empty and we can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=ilt;var slt=s(({repositoryUrl:e})=>({type:"https://zup.fail/create-project-invalid-git-repo",title:"We can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.",details:`Repository '${e}' is not a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=slt;var olt=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-invalid-repo",title:"We can only connect to an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.",details:`Repository '${e}' is not an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");S.GITHUB_INTEGRATION_INVALID_REPO=olt;S.BITBUCKET_QUERY_USER_INFO_FAILED={type:"https://zup.fail/bitbucket-query-user-info-failed",title:"Failed while requesting basic user info from Bitbucket",status:T.HttpStatusCode.FORBIDDEN};S.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:T.HttpStatusCode.FORBIDDEN};var alt=s(({details:e})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:e,status:T.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");S.BITBUCKET_FAILED_DURING_REPO_CREATION=alt;S.GITLAB_QUERY_USER_INFO_FAILED={type:"https://zup.fail/gitlab-query-user-info-failed",title:"Failed while requesting basic user info from GitLab",status:T.HttpStatusCode.FORBIDDEN};var ult=s(({details:e})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");S.GITLAB_FAILED_DURING_REPO_CREATION=ult;var clt=s(({repositoryName:e,orgName:t})=>({type:"https://zup.fail/gitlab-duplicate-repo",title:"A repository with that name already exists in GitLab",details:`A repository named '${e}' already exists in GitLab team '${t}'.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");S.GITLAB_DUPLICATE_REPO=clt;var llt=s(({orgName:e})=>({type:"https://zup.fail/gitlab-create-repo-perm",title:"The user's GitLab group access level does not allow for repository creation.",details:"The user's GitLab group access level does not allow for repository creation.",instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=llt;var flt=s(({namespaceLabel:e})=>({type:"https://zup.fail/gitlab-insufficient-namespace-access",title:`The user's GitLab access level does not allow the use of namespace '${e}'.`,details:`The user's GitLab access level does not allow the use of namespace '${e}'.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=flt;var dlt=s(({orgName:e})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=dlt;S.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist or cannot be accessed.",status:T.HttpStatusCode.NOT_FOUND};S.CONSUMER_CANNOT_BE_CREATED={type:"https://zup.fail/consumer-not-created",title:"Failed to create consumer",status:T.HttpStatusCode.BAD_GATEWAY};S.API_KEY_CANNOT_BE_CREATED={type:"https://zup.fail/api-key-not-created",title:"Failed to create api key",status:T.HttpStatusCode.BAD_GATEWAY};S.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:T.HttpStatusCode.UNAUTHORIZED};S.EXTERNAL_USER_NOT_CONFIGURED={type:"https://zup.fail/external-user-not-configured",title:"User is not setup as an External User (Key Manager)",status:T.HttpStatusCode.FORBIDDEN};S.API_USER_NO_ACCESS={type:"https://zup.fail/api-user-no-access",title:"Api user does not have access to this endpoint.",status:T.HttpStatusCode.FORBIDDEN};S.EXTERNAL_SERVICE_GENERIC_ERROR={type:"https://zup.fail/external-service-generic-error",title:"Unable to complete API request for External Service.",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};var plt=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${(0,Iae.getSourceControlProviderLabel)(e)}`,status:T.HttpStatusCode.UNAUTHORIZED}),"SOURCE_CONTROL_AUTHENTICATION_FAILED");S.SOURCE_CONTROL_AUTHENTICATION_FAILED=plt;var hlt=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-repo-not-found",title:"We cannot connect to the repository associated to the project, verify your source control access configuration and try again.",detail:`Could not connect to ${(0,Iae.getSourceControlProviderLabel)(e)} repository`,status:T.HttpStatusCode.NOT_FOUND}),"SOURCE_CONTROL_REPO_NOT_FOUND");S.SOURCE_CONTROL_REPO_NOT_FOUND=hlt;S.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE={type:"https://zup.fail/source-control-empty-commit",title:"Commit operation failed because you provided an empty message. Please try again by providing a commit message.",status:T.HttpStatusCode.BAD_REQUEST};var mlt=s(({repoURL:e,operation:t})=>({type:`https://zup.fail/source-control-repo-${t}-error`,title:`Failed on ${t} operation to repository '${e}'. Verify you have read & write access to the repository and try again.`,detail:"Verify your source control configuration and make sure you have been granted read & write access to the repository",status:T.HttpStatusCode.FORBIDDEN}),"SOURCE_CONTROL_REPO_OPERATION_ERROR");S.SOURCE_CONTROL_REPO_OPERATION_ERROR=mlt;S.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE={type:"https://zup.fail/source-control-write-access-issue",title:"You do not have write access to the repository, verify your source control access configuration and try again.",detail:"Verify your source control configuration and make sure you have been granted access to the repository",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/source-control-configuration-not-found",title:"Source control configuration not found for this account.",status:T.HttpStatusCode.NOT_FOUND};S.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND={type:"https://zup.fail/source-control-credentials-not-found",title:"Source control credentials not found for this user. Verify your user's source control connection and try again.",status:T.HttpStatusCode.NOT_FOUND};S.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS={type:"https://zup.fail/failed-to-refresh-source-control-credentials",title:"Failed to refresh Source Control credentials. Verify your user's source control connection and try again.",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED={type:"https://zup.fail/new-gh-config-required",title:"Current Source Control credentials are using the previous Zuplo GitHup App. Re-authenticate using the latest Zuplo GitHup App via Profile UI and try again.",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS={type:"https://zup.fail/gh-app-revoked-access",title:"Current Source Control credentials are invalid. Re-authenticate to GitHub via Profile UI and try again.",status:T.HttpStatusCode.UNAUTHORIZED};S.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS={type:"https://zup.fail/failed-to-revoke-source-control-credentials",title:"Failed to revoke Source Control access token for the user",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING={type:"https://zup.fail/source-control-configuration-info-missing",title:"Source Control Configuration information is insufficient for this operation.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING={type:"https://zup.fail/source-control-configuration-bb-workspace-missing",title:"Source Control Configuration for Bitbucket must include a workspace configuration (additionalMetadata).",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION={type:"https://zup.fail/preexisiting-source-control-configuration-on-account",title:"This account already has a Source Control Configuration for this provider.",detail:"This account has a pre-existing Source Control Configuration for this provider. Delete or update the existing configuration.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND={type:"https://zup.fail/source-control-integration-branch-behind",title:"The current branch is behind, sync with remote repo for avoid conflicts.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_REMOTE_BRANCH_EXISTS={type:"https://zup.fail/source-control-integration-branch-behind",title:"The branch exists in the remote repository. Please try again with a different branch name.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/source-control-integration-authentication-failed",title:"Source control integration: Authentication failed",status:T.HttpStatusCode.FORBIDDEN};S.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR={type:"https://zup.fail/third-party-app-auth0-clients-endpoint-error",title:"Error Creating an Auth0 Client through tenant api",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST={type:"https://zup.fail/third-party-app-auth0-config-does-not-exist",title:"Auth0 Configuration does not exist for account and environment",status:T.HttpStatusCode.NOT_FOUND};S.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR={type:"https://zup.fail/third-party-app-auth0-client-not-found-error",title:"Third Party App Not Found",status:T.HttpStatusCode.NOT_FOUND};S.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR={type:"https://zup.fail/third-party-app-auth-scope-config-error",title:"API Scope configuration at Auth0 end Error",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND={type:"https://zup.fail/third-party-app-connections-not-found",title:"Cannot find auth0 tenant connections",status:T.HttpStatusCode.FAILED_DEPENDENCY};S.THIRD_PARTY_APP_CONNECTION_NOT_FOUND={type:"https://zup.fail/third-party-app-connection-not-found",title:"Cannot find connection with the given name",status:T.HttpStatusCode.FAILED_DEPENDENCY};S.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION={type:"https://zup.fail/third-party-app-cannot-link-tpa-to-connection",title:"Cannot link a connection to a third party app",status:T.HttpStatusCode.FAILED_DEPENDENCY};S.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:T.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:T.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE={type:"https://zup.fail/environment-variables-cannot-be-retrieved-invalid-env-type",title:"Env vars will not be retrieved since the deployment is from non valid environment type",status:T.HttpStatusCode.BAD_REQUEST};S.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:T.HttpStatusCode.BAD_REQUEST};S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:T.HttpStatusCode.BAD_REQUEST};S.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY={type:"https://zup.fail/personal-override-only-for-working-copy",title:"A personal override can only be used for a working-copy environment variable",status:T.HttpStatusCode.BAD_REQUEST};S.TARGET_BRANCH_ONLY_FOR_PREVIEW={type:"https://zup.fail/target-branch-only-for-preview",title:"A target branch can only be used for preview environment variables",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:T.HttpStatusCode.BAD_REQUEST};S.OVERLAPPING_TARGETS={type:"https://zup.fail/overlapping-targets",title:"The environments of this environment variable overlaps with an existing environment variable",status:T.HttpStatusCode.BAD_REQUEST};S.CONFLICTING_TYPES={type:"https://zup.fail/conflicting-types",title:"The type of this environment variable conflicts with an existing environment variable with the same name",status:T.HttpStatusCode.BAD_REQUEST};S.NON_EMPTY_TARGETS_REQUIRED={type:"https://zup.fail/non-empty-targets-required",title:"The environment targets for this environment variable cannot be empty.",status:T.HttpStatusCode.BAD_REQUEST};S.NO_ZUPLO_PREFIXED_VARIABLES={type:"https://zup.fail/no-zuplo-prefixed-variables",title:"Environment variables should not start with the reserved prefix of ZUPLO or __ZUPLO",status:T.HttpStatusCode.BAD_REQUEST};S.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE={type:"https://zup.fail/deployer-non-valid-deployment-environment-type",title:"Deployment cannot be different than preview or production",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2={type:"https://zup.fail/deployer-cannot-deploy-using-env-vars-v2",title:"Deployer was not able to deploy zup using environment variables v2",status:T.HttpStatusCode.FORBIDDEN};S.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR={type:"https://zup.fail/deleting-zuplo-environment-variables-error",title:"Problems deleting ZUPLO environment variables for deployment",status:T.HttpStatusCode.NOT_FOUND};var _lt=s(({operation:e,path:t})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify file on read-only environment",detail:`Cannot ${e} file ${t} for a read-only environment. Read-only environments cannot be edited.`,status:T.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=_lt;var glt=s(()=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify files on read-only environment",detail:"Cannot save files on a read-only environment. Read-only environments cannot be edited.",status:T.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=glt;S.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:"Migrations can only run on working copies.",status:T.HttpStatusCode.BAD_REQUEST};S.RUNTIME_VERSION_INCORRECT_FORMAT={type:"https://zup.fail/migration-incorrect-runtime-version-format",title:"Runtime version is in an incorrect format.",status:T.HttpStatusCode.BAD_REQUEST};S.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:"No package.json file found.",status:T.HttpStatusCode.NOT_FOUND};S.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:"Cannot read package.json file.",status:T.HttpStatusCode.BAD_REQUEST};S.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:"Cannot find source directory.",status:T.HttpStatusCode.BAD_REQUEST};S.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:"Failed to download content from storage.",status:T.HttpStatusCode.BAD_REQUEST};var ylt=s(({path:e})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot create directory on read-only environment",detail:`Cannot create folder ${e} for a read-only environment. Read-only environments cannot be edited.`,status:T.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=ylt;var Elt=s(({path:e})=>({type:"https://zup.fail/directory-creation-in-non-allowed-location",title:"Directory creation attempted in non allowed location",detail:`Directory creation in ${e} is not allowed.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=Elt;var blt=s(({path:e})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:T.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${e}.`}),"DIRECTORY_ALREADY_EXISTS");S.DIRECTORY_ALREADY_EXISTS=blt;var Slt=s(({path:e})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:T.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${e}`}),"DIRECTORY_DOES_NOT_EXIST");S.DIRECTORY_DOES_NOT_EXIST=Slt;var Olt=s(({path:e})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:T.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${e}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=Olt;var vlt=s(({path:e})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${e}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");S.DIRECTORY_CREATION_FAILED=vlt;var Ilt=s(({path:e})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:T.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the old path ${e} matched the provided new path. Please choose a different name.`}),"FILE_RENAME_PATHS_MATCH");S.FILE_RENAME_PATHS_MATCH=Ilt;var Plt=s(({oldExtension:e,newExtension:t})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:T.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the new extension ${t} must match the old extension ${e}.`}),"FILE_RENAME_CANNOT_CHANGE_EXTENSION");S.FILE_RENAME_CANNOT_CHANGE_EXTENSION=Plt;var wlt=s(({path:e})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:T.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, there already exists a file at ${e}. Please choose a different name.`}),"FILE_RENAME_FILE_ALREADY_EXISTS");S.FILE_RENAME_FILE_ALREADY_EXISTS=wlt;var Tlt=s(({path:e})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${e}. Please try again or contact support.`}),"FILE_RENAME_FAILED");S.FILE_RENAME_FAILED=Tlt;var Nlt=s(({path:e})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${e}. Please try again or contact support.`}),"FILE_WRITE_FAILED");S.FILE_WRITE_FAILED=Nlt;var Alt=s(({path:e})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:T.HttpStatusCode.BAD_REQUEST,detail:`File '${e}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");S.CANNOT_DELETE_ESSENTIAL_FILE=Alt;var Rlt=s(({path:e})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:T.HttpStatusCode.BAD_REQUEST,detail:`Directory '${e}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=Rlt;var Clt=s(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:T.HttpStatusCode.BAD_REQUEST,detail:"Your project must have at least 1 OpenAPI file."}),"CANNOT_DELETE_SOLE_OPEN_API_FILE");S.CANNOT_DELETE_SOLE_OPEN_API_FILE=Clt;var $lt=s(({path:e})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${e}. Please try again or contact support.`}),"FILE_DELETE_FAILED");S.FILE_DELETE_FAILED=$lt;var Dlt=s(({path:e})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${e}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");S.DIRECTORY_DELETE_FAILED=Dlt;S.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:T.HttpStatusCode.CONFLICT};S.BUCKET_NOT_FOUND={type:"https://zup.fail/bucket-not-found",title:"Bucket cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:T.HttpStatusCode.BAD_REQUEST};S.METERING_BUCKET_CREATION_FAILED={type:"https://zup.fail/metering-bucket-creation-failed",title:"Failed to create metering buckets for project",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.ACCOUNT_RBAC_DISABLED={type:"https://zup.fail/account_rbac_disabled",title:"Forbidden",detail:"Your account does not have fine-grained RBAC feature enabled. Please contact support to enable this feature.",status:T.HttpStatusCode.FORBIDDEN};S.RBAC_INVALID_EXPIRATION_DATE={type:"https://zup.fail/rbac_invalid_expiration_date",title:"Bad Request",detail:"The expiration date provided cannot be in the past. Please provide a valid expiration date.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_DOES_NOT_EXISTS={type:"https://zup.fail/rbacconfiguration-does-not-exists",title:"Bad Request",detail:"The api key configuration does not exist or you don't have access to it.",status:T.HttpStatusCode.NOT_FOUND};S.RBACCONFIGURATION_REQUIRE_ENVIRONMENTS={type:"https://zup.fail/rbacconfiguration-required-environments",title:"Bad Request",detail:"Please provide at least one environment value. Valid options include 'production', 'preview' and 'development'.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_ENVIRONMENTS={type:"https://zup.fail/rbacconfiguration-invalid-environments",title:"Bad Request",detail:"Please provide at least one environment value. Valid options include 'production', 'preview' and 'development'.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_REQUIRE_PROJECTS={type:"https://zup.fail/rbacconfiguration-required-projects",title:"Bad Request",detail:"Please provide at least one project to configure access for.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_ACCOUNT_HAS_NO_PROJECTS={type:"https://zup.fail/rbacconfiguration-no-projects",title:"Bad Request",detail:"The account does not have any projects to configure. Please create at least one project before configuring api key access.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_PROJECT_PROVIDED={type:"https://zup.fail/rbacconfiguration-invalid-project",title:"Bad Request",detail:"One or more of the projects provided is not part of the account or does not exist. Make sure all the projects are valid and try again.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_OPENFGA_CONFIG={type:"https://zup.fail/rbacconfiguration-invalid-openfga-config",title:"Bad Gateway",detail:"The provided configuration caused an unexpected error. Please contact support.",status:T.HttpStatusCode.BAD_GATEWAY};S.RBACCONFIGURATION_DELETE_MISCONFIGURATION={type:"https://zup.fail/rbacconfiguration-delete-misconfiguration",title:"Bad Request",detail:"The provided configuration was not correctly created and cannot be deleted. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_MISCONFIGURATION={type:"https://zup.fail/rbacconfiguration-misconfiguration",title:"Bad Request",detail:"The provided configuration was not correctly created and cannot be used. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_CONSUMER_LOCKED={type:"https://zup.fail/rbacconfiguration-consumer-locked",title:"Forbidden",detail:"The provided consumer is locked and can't be modified or deleted.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_ACCESS_TO_CONSUMER={type:"https://zup.fail/forbidden",title:"Forbidden",detail:"You are not authorized to access the consumer resource.",status:T.HttpStatusCode.FORBIDDEN};S.INVALID_USER_ROLE={type:"https://zup.fail/invalid-user-role",title:"Bad Request",detail:"You provided an invalid user role. Valid options include 'admin', 'developer' and 'member'.",status:T.HttpStatusCode.BAD_REQUEST};S.USER_DOES_NOT_EXIST={type:"https://zup.fail/user-does-not-exist",title:"Forbidden",detail:"You are not authorized to access the user resource.",status:T.HttpStatusCode.FORBIDDEN};S.USER_CANNOT_EDIT_OWN_ROLE={type:"https://zup.fail/user-edit-itself",title:"Forbidden",detail:"You are not authorized to edit your own access role.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_ACCESS_TO_PROJECT_ENVIRONMENT={type:"https://zup.fail/user-has-no-access-to-project-env",title:"Forbidden",detail:"You are not authorized to access this project environment.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_DEPLOY_ACCESS_TO_PROJECT_ENVIRONMENT={type:"https://zup.fail/user-has-no-deploy-access-to-project-env",title:"Forbidden",detail:"You are not authorized to access to deploy this project environment.",status:T.HttpStatusCode.FORBIDDEN};S.ACCOUNT_ADMIN_INVALID_PROJECT_ROLE_DOWNGRADE={type:"https://zup.fail/account-admin-invalid-project-role-downgrade",title:"Bad Request",detail:"An account administrator cannot be downgraded to a non-administrator role in a project.",status:T.HttpStatusCode.BAD_REQUEST};S.USER_HAS_NO_PROD_ENV_VAR_ACCESS={type:"https://zup.fail/user-no-prod-env-var-access",title:"Forbidden",detail:"You are not authorized to modify or create the project's production environment variables.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_DEVELOPER_ENV_VAR_ACCESS={type:"https://zup.fail/user-no-dev-env-var-access",title:"Forbidden",detail:"You are not authorized to modify or create the project's preview and development environment variables.",status:T.HttpStatusCode.FORBIDDEN};S.MISCONFIGURED_ENV_VAR={type:"https://zup.fail/misconfigured-env-var",title:"Bad Request",detail:"The environment variable is not correctly configured on any environment. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_ALREADY_RBAC_ENABLED={type:"https://zup.fail/misconfigured-env-var",title:"Bad Request",detail:"The account has been previously migrated to use RBAC.",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MISCONFIGURED_FOR_RBAC={type:"https://zup.fail/misconfigured-env-var",title:"Bad Request",detail:"This account has conflicting account roles and cannot be self-migrated to use RBAC. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST}});var Tae=h(wi=>{"use strict";var Llt=wi&&wi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return t[r]},"get")}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),jlt=wi&&wi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Mlt=wi&&wi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Llt(t,e,r);return jlt(t,e),t};Object.defineProperty(wi,"__esModule",{value:!0});wi.ApiNotFoundError=wi.ApiError=wi.Problems=void 0;var wae=Mlt(Pae());wi.Problems=wae;var T1=class extends Error{static{s(this,"ApiError")}type;status;detail;instance;constructor(t){if(super(t.title),!t.type.startsWith("https://zup.fail/"))throw new Error(`Invalid 'type' specified on ApiError, must be a URI starting with 'https://zup.fail/'. Type was set to ${t.type}`);this.name="ApiProblemError",this.type=t.type,this.status=t.status,this.detail=t.detail,this.instance=t.instance}};wi.ApiError=T1;var rB=class extends T1{static{s(this,"ApiNotFoundError")}constructor(t={}){super({...t,...wae.NOT_FOUND}),this.name="ApiNotFoundProblemError"}};wi.ApiNotFoundError=rB});var Nae=h(Pu=>{"use strict";var Ult=Pu&&Pu.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return t[r]},"get")}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),xlt=Pu&&Pu.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Ult(t,e,r)};Object.defineProperty(Pu,"__esModule",{value:!0});Pu.HttpStatusCode=void 0;xlt(Tae(),Pu);var qlt=tB();Object.defineProperty(Pu,"HttpStatusCode",{enumerable:!0,get:s(function(){return qlt.HttpStatusCode},"get")})});var Rae=h((Q2t,Aae)=>{"use strict";function Flt(e){return e>=55296&&e<=56319}s(Flt,"isHighSurrogate");function Blt(e){return e>=56320&&e<=57343}s(Blt,"isLowSurrogate");Aae.exports=s(function(t,r,n){if(typeof r!="string")throw new Error("Input must be string");for(var i=r.length,o=0,a,u,c=0;c<i;c+=1){if(a=r.charCodeAt(c),u=r[c],Flt(a)&&Blt(r.charCodeAt(c+1))&&(c+=1,u+=r[c]),o+=t(u),o===n)return r.slice(0,c+1);if(o>n)return r.slice(0,c-u.length+1)}return r},"truncate")});var $ae=h((tBt,Cae)=>{"use strict";var klt=Rae(),Glt=Buffer.byteLength.bind(Buffer);Cae.exports=klt.bind(null,Glt)});var nB=h(Jm=>{"use strict";var Vlt=Jm&&Jm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jm,"__esModule",{value:!0});Jm.sanitize=void 0;var Hlt=Vlt($ae()),zlt=/[/?<>\\:*|"]/g,Klt=/[\x00-\x1f\x80-\x9f]/g,Wlt=/^\.+$/,Ylt=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,Jlt=/[. ]+$/;function Xlt(e,t=""){if(typeof e!="string")throw new Error("Input must be string");let r=e.replace(zlt,t).replace(Klt,t).replace(Wlt,t).replace(Ylt,t).replace(Jlt,t);return(0,Hlt.default)(r,255)}s(Xlt,"sanitize");Jm.sanitize=Xlt});var Mae=h(Xm=>{"use strict";var jae=Xm&&Xm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xm,"__esModule",{value:!0});Xm.createProjectDirs=void 0;var Dae=jae(require("fs/promises")),Zlt=jae(require("path")),WE=Bt(),Lae=rc(),Qlt=s(async function({sourceDirectory:e,logger:t}){t.debug("Creating project directories");let r=[WE.USER_MODULES_DIR_NAME,WE.USER_CONFIG_DIR_NAME,WE.USER_TEST_DIR_NAME,WE.USER_SCHEMAS_DIR_NAME,WE.USER_DOCS_DIR_NAME,".vscode"];try{await Dae.default.mkdir(e);for(let n of r)await Dae.default.mkdir(Zlt.default.join(e,n),{recursive:!0})}catch(n){return t.error(n),new Lae.PluginResult({message:`Cannot create project directory tree at ${e}`,pluginName:"create-project-dirs",severity:"error"})}return new Lae.PluginResult},"createProjectDirs");Xm.createProjectDirs=Qlt});var Fae=h(Zm=>{"use strict";var qae=Zm&&Zm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zm,"__esModule",{value:!0});Zm.generateFromTemplate=void 0;var eft=require("fs"),Uae=qae(require("fs/promises")),xae=qae(require("path"));async function tft(e){let t=xae.default.resolve(__dirname,"..","templates",e);if((0,eft.existsSync)(t))return await Uae.default.readFile(t,"utf-8");{let r=xae.default.resolve(__dirname,"templates",e);return await Uae.default.readFile(r,"utf-8")}}s(tft,"generateFromTemplate");Zm.generateFromTemplate=tft});var Ti=h(Qm=>{"use strict";var N1=Qm&&Qm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qm,"__esModule",{value:!0});Qm.generateFileFromTemplate=void 0;var rft=N1(gn()),nft=N1(require("fs/promises")),ift=N1(require("path")),sft=N1(_n()),oft=Fae(),aft=s(function(e,t){return async({sourceDirectory:r,logger:n})=>sft.default.timeFn(`Generating ${e}`,async()=>{n.debug(`Generating ${e}`);let i=ift.default.join(r,e);return await rft.default.fileExists(i)?(n.debug({sourceDirectory:r},`${e} already exists, skipping`),{warnings:[],errors:[]}):uft(i,t,n)})},"generateFileFromTemplate");Qm.generateFileFromTemplate=aft;async function uft(e,t,r){let n=await(0,oft.generateFromTemplate)(t);try{await nft.default.writeFile(e,n,"utf-8"),r.debug(`File written to ${e}`)}catch(i){r.error(i);let o={message:`Error creating file at ${e}`,pluginName:"generate-file",severity:"error"};return{warnings:[],errors:[o]}}return{warnings:[],errors:[]}}s(uft,"writeTemplate")});var kae=h(e_=>{"use strict";var cft=e_&&e_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e_,"__esModule",{value:!0});e_.generateDefaultDocsMarkdown=void 0;var lft=cft(require("path")),Bae=Bt(),fft=Ti();e_.generateDefaultDocsMarkdown=(0,fft.generateFileFromTemplate)(lft.default.join(Bae.USER_DOCS_DIR_NAME,Bae.DEFAULT_DOCS_MARKDOWN_FILE),"markdown.template.md")});var Vae=h(t_=>{"use strict";var dft=t_&&t_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t_,"__esModule",{value:!0});t_.generateDefaultDocsSidebar=void 0;var pft=dft(require("path")),Gae=Bt(),hft=Ti();t_.generateDefaultDocsSidebar=(0,hft.generateFileFromTemplate)(pft.default.join(Gae.USER_DOCS_DIR_NAME,Gae.DOCS_SIDEBAR_FILE),"sidebar.template.json")});var zae=h(r_=>{"use strict";var mft=r_&&r_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r_,"__esModule",{value:!0});r_.generateDefaultDocsTheme=void 0;var _ft=mft(require("path")),Hae=Bt(),gft=Ti();r_.generateDefaultDocsTheme=(0,gft.generateFileFromTemplate)(_ft.default.join(Hae.USER_DOCS_DIR_NAME,Hae.DOCS_THEME_FILE),"dev-portal.theme.template.css")});var Wae=h(n_=>{"use strict";var yft=n_&&n_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n_,"__esModule",{value:!0});n_.generateDefaultModule=void 0;var Eft=yft(require("path")),Kae=Bt(),bft=Ti();n_.generateDefaultModule=(0,bft.generateFileFromTemplate)(Eft.default.join(Kae.USER_MODULES_DIR_NAME,Kae.DEFAULT_MODULE_FILE),"hello-world.template.ts")});var Jae=h(i_=>{"use strict";var Sft=i_&&i_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i_,"__esModule",{value:!0});i_.generateDevPortalConfigJson=void 0;var Oft=Sft(require("path")),Yae=Bt(),vft=Ti();i_.generateDevPortalConfigJson=(0,vft.generateFileFromTemplate)(Oft.default.join(Yae.USER_CONFIG_DIR_NAME,Yae.DEV_PORTAL_CONFIG_FILE),"dev-portal.template.json")});var Xae=h(A1=>{"use strict";Object.defineProperty(A1,"__esModule",{value:!0});A1.generateEnvironment=void 0;var Ift=Ti();A1.generateEnvironment=(0,Ift.generateFileFromTemplate)(".env","env.template")});var Zae=h(R1=>{"use strict";Object.defineProperty(R1,"__esModule",{value:!0});R1.generateESLint=void 0;var Pft=Ti();R1.generateESLint=(0,Pft.generateFileFromTemplate)(".eslintrc.js","eslintrc.template.js")});var Qae=h(C1=>{"use strict";Object.defineProperty(C1,"__esModule",{value:!0});C1.generateGitignore=void 0;var wft=Ti();C1.generateGitignore=(0,wft.generateFileFromTemplate)(".gitignore","gitignore.template.ignore")});var eue=h(s_=>{"use strict";var Tft=s_&&s_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s_,"__esModule",{value:!0});s_.generateLaunchJson=void 0;var Nft=Tft(require("path")),Aft=Ti();s_.generateLaunchJson=(0,Aft.generateFileFromTemplate)(Nft.default.join(".vscode","launch.json"),"launch.template.jsonc")});var rue=h(o_=>{"use strict";var Rft=o_&&o_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o_,"__esModule",{value:!0});o_.generateRouteOasConfig=void 0;var Cft=Rft(require("path")),tue=Bt(),$ft=Ti();o_.generateRouteOasConfig=(0,$ft.generateFileFromTemplate)(Cft.default.join(tue.USER_CONFIG_DIR_NAME,tue.ROUTES_OAS_CONFIG_FILE),"routes.oas.template.json")});var sue=h(qs=>{"use strict";var iB=qs&&qs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qs,"__esModule",{value:!0});qs.updateProjectPackageJson=qs.getProjectPackageJson=qs.getPackageOverrides=qs.generateDefaultPackageJson=void 0;var nue=iB(require("fs/promises")),sB=iB(require("path")),Dft=iB(Xs());async function Lft(e,t=Dft.default.USE_MONOREPO_PACKAGES){let r={name:e,version:"1.0.0",author:"",copyright:"",scripts:{dev:"zup dev",test:"zup test"},dependencies:{zuplo:"latest"}};if(t){let n=iue();r.overrides=n,r.dependencies["@zuplo/runtime"]=n["@zuplo/runtime"],r.devDependencies&&"@zuplo/core"in r.devDependencies&&(r.devDependencies["@zuplo/core"]=n["@zuplo/core"]),"@zuplo/core"in r.dependencies&&(r.dependencies["@zuplo/core"]=n["@zuplo/core"])}return r}s(Lft,"generateDefaultPackageJson");qs.generateDefaultPackageJson=Lft;function iue(){let e=sB.default.resolve(__dirname,"..","..");return{"@zuplo/core":`file:${e}/core`,"@zuplo/runtime":`file:${e}/runtime`,"@zuplo/debug":`file:${e}/debug`,"@zuplo/errors":`file:${e}/errors`}}s(iue,"getPackageOverrides");qs.getPackageOverrides=iue;async function jft(e){let t=sB.default.join(e,"package.json"),r=await nue.default.readFile(t,"utf-8");return JSON.parse(r)}s(jft,"getProjectPackageJson");qs.getProjectPackageJson=jft;async function Mft(e,t){let r=sB.default.join(e,"package.json"),n=JSON.stringify(t,void 0,2);await nue.default.writeFile(r,n,"utf-8")}s(Mft,"updateProjectPackageJson");qs.updateProjectPackageJson=Mft});var uue=h($1=>{"use strict";Object.defineProperty($1,"__esModule",{value:!0});$1.generatePackageJson=void 0;var oue=sue(),aue=rc(),Uft=s(async function({sourceDirectory:e,name:t,logger:r}){let n=await(0,oue.generateDefaultPackageJson)(t);try{await(0,oue.updateProjectPackageJson)(e,n)}catch(i){return r.error(i),new aue.PluginResult({message:"Error creating package.json",pluginName:"generate-package-json",severity:"error"})}return new aue.PluginResult},"generatePackageJson");$1.generatePackageJson=Uft});var lue=h(a_=>{"use strict";var xft=a_&&a_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a_,"__esModule",{value:!0});a_.generatePoliciesConfig=void 0;var qft=xft(require("path")),cue=Bt(),Fft=Ti();a_.generatePoliciesConfig=(0,Fft.generateFileFromTemplate)(qft.default.join(cue.USER_CONFIG_DIR_NAME,cue.POLICIES_CONFIG_FILE),"policies.template.json")});var fue=h(u_=>{"use strict";var Bft=u_&&u_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(u_,"__esModule",{value:!0});u_.generateSettingsJson=void 0;var kft=Bft(require("path")),Gft=Ti();u_.generateSettingsJson=(0,Gft.generateFileFromTemplate)(kft.default.join(".vscode","settings.json"),"settings.template.jsonc")});var due=h(D1=>{"use strict";Object.defineProperty(D1,"__esModule",{value:!0});D1.generateTSConfig=void 0;var Vft=Ti();D1.generateTSConfig=(0,Vft.generateFileFromTemplate)("tsconfig.json","tsconfig.template.json")});var hue=h(c_=>{"use strict";var Hft=c_&&c_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(c_,"__esModule",{value:!0});c_.generateZuploJson=void 0;var zft=Yo(),Kft=require("fs/promises"),Wft=Hft(require("path")),Yft=Bt(),pue=rc(),Jft=s(async function({name:e,sourceDirectory:t,logger:r}){let n={version:1,project:e,compatibilityDate:zft.DEFAULT_COMPATIBILITY_DATE},i=Wft.default.join(t,Yft.ZUPLO_PREFERRED_JSON_FILE),o=JSON.stringify(n,null,2);try{await(0,Kft.writeFile)(i,o,"utf-8")}catch(a){return r.error(a),new pue.PluginResult({message:"Error creating zuplo.jsonc",pluginName:"generate-zuplo-json",severity:"error"})}return new pue.PluginResult},"generateZuploJson");c_.generateZuploJson=Jft});var yue=h(l_=>{"use strict";var gue=l_&&l_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l_,"__esModule",{value:!0});l_.create=void 0;var mue=Nae(),Xft=gue(gn()),Zft=require("fs/promises"),Qft=gue(require("path")),edt=rc(),_ue=nB(),tdt=Mae(),rdt=kae(),ndt=Vae(),idt=zae(),sdt=Wae(),odt=Jae(),adt=Xae(),udt=Zae(),cdt=Qae(),ldt=eue(),fdt=rue(),ddt=uue(),pdt=lue(),hdt=fue(),mdt=due(),_dt=hue();async function gdt({name:e,accountName:t="",rootDirectory:r,logger:n}){let i=(0,_ue.sanitize)(e),o=(0,_ue.sanitize)(t),a=Qft.default.join(r,o,i),u={name:e,sourceDirectory:a,logger:n},c=[];if(await Xft.default.dirExists(a))throw new mue.ApiError({type:"https://zup.fail/project-already-exists-at-directory",title:"The project already exists in the specified directory",status:mue.HttpStatusCode.BAD_REQUEST,detail:`Project already exists at ${a}`});c.push(tdt.createProjectDirs,fdt.generateRouteOasConfig,_dt.generateZuploJson,odt.generateDevPortalConfigJson,sdt.generateDefaultModule,ndt.generateDefaultDocsSidebar,rdt.generateDefaultDocsMarkdown,idt.generateDefaultDocsTheme,pdt.generatePoliciesConfig),c.push(mdt.generateTSConfig,cdt.generateGitignore,ddt.generatePackageJson,adt.generateEnvironment,udt.generateESLint,ldt.generateLaunchJson,hdt.generateSettingsJson);let{errors:l,warnings:f}=await(0,edt.runPlugins)(c,u);if(f.length>0&&f.forEach(_=>{n.warn(_)}),l.length>0){await(0,Zft.rm)(a,{recursive:!0,force:!0});let _=l[0];throw _ instanceof Error?_:new Error(_.message)}return{sourceDirectory:a,projectName:e}}s(gdt,"create");l_.create=gdt});var Eue=h(oB=>{"use strict";Object.defineProperty(oB,"__esModule",{value:!0});function ydt(e){if(e.length>=255)throw new TypeError("Alphabet too long");let t=new Uint8Array(256);for(let l=0;l<t.length;l++)t[l]=255;for(let l=0;l<e.length;l++){let f=e.charAt(l),d=f.charCodeAt(0);if(t[d]!==255)throw new TypeError(f+" is ambiguous");t[d]=l}let r=e.length,n=e.charAt(0),i=Math.log(r)/Math.log(256),o=Math.log(256)/Math.log(r);function a(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";let f=0,d=0,_=0,m=l.length;for(;_!==m&&l[_]===0;)_++,f++;let g=(m-_)*o+1>>>0,y=new Uint8Array(g);for(;_!==m;){let O=l[_],v=0;for(let P=g-1;(O!==0||v<d)&&P!==-1;P--,v++)O+=256*y[P]>>>0,y[P]=O%r>>>0,O=O/r>>>0;if(O!==0)throw new Error("Non-zero carry");d=v,_++}let b=g-d;for(;b!==g&&y[b]===0;)b++;let E=n.repeat(f);for(;b<g;++b)E+=e.charAt(y[b]);return E}s(a,"encode");function u(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;let f=0,d=0,_=0;for(;l[f]===n;)d++,f++;let m=(l.length-f)*i+1>>>0,g=new Uint8Array(m);for(;l[f];){let O=t[l.charCodeAt(f)];if(O===255)return;let v=0;for(let P=m-1;(O!==0||v<_)&&P!==-1;P--,v++)O+=r*g[P]>>>0,g[P]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");_=v,f++}let y=m-_;for(;y!==m&&g[y]===0;)y++;let b=new Uint8Array(d+(m-y)),E=d;for(;y!==m;)b[E++]=g[y++];return b}s(u,"decodeUnsafe");function c(l){let f=u(l);if(f)return f;throw new Error("Non-base"+r+" character")}return s(c,"decode"),{encode:a,decodeUnsafe:u,decode:c}}s(ydt,"base");oB.default=ydt});var bue=h(YE=>{"use strict";var Edt=YE&&YE.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(YE,"__esModule",{value:!0});var bdt=Edt(Eue()),Sdt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";YE.default=(0,bdt.default)(Sdt)});var Pue=h((LBt,Iue)=>{Iue.exports=vue;vue.sync=vdt;var Sue=require("fs");function Odt(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}s(Odt,"checkPathExt");function Oue(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:Odt(t,r)}s(Oue,"checkStat");function vue(e,t,r){Sue.stat(e,function(n,i){r(n,n?!1:Oue(i,e,t))})}s(vue,"isexe");function vdt(e,t){return Oue(Sue.statSync(e),e,t)}s(vdt,"sync")});var Rue=h((MBt,Aue)=>{Aue.exports=Tue;Tue.sync=Idt;var wue=require("fs");function Tue(e,t,r){wue.stat(e,function(n,i){r(n,n?!1:Nue(i,t))})}s(Tue,"isexe");function Idt(e,t){return Nue(wue.statSync(e),t)}s(Idt,"sync");function Nue(e,t){return e.isFile()&&Pdt(e,t)}s(Nue,"checkStat");function Pdt(e,t){var r=e.mode,n=e.uid,i=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),u=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),f=u|c,d=r&l||r&c&&i===a||r&u&&n===o||r&f&&o===0;return d}s(Pdt,"checkMode")});var $ue=h((qBt,Cue)=>{var xBt=require("fs"),L1;process.platform==="win32"||global.TESTING_WINDOWS?L1=Pue():L1=Rue();Cue.exports=aB;aB.sync=wdt;function aB(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){aB(e,t||{},function(o,a){o?i(o):n(a)})})}L1(e,t||{},function(n,i){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,i=!1),r(n,i)})}s(aB,"isexe");function wdt(e,t){try{return L1.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}s(wdt,"sync")});var que=h((BBt,xue)=>{var f_=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Due=require("path"),Tdt=f_?";":":",Lue=$ue(),jue=s(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),Mue=s((e,t)=>{let r=t.colon||Tdt,n=e.match(/\//)||f_&&e.match(/\\/)?[""]:[...f_?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],i=f_?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=f_?i.split(r):[""];return f_&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},"getPathInfo"),Uue=s((e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:o}=Mue(e,t),a=[],u=s(l=>new Promise((f,d)=>{if(l===n.length)return t.all&&a.length?f(a):d(jue(e));let _=n[l],m=/^".*"$/.test(_)?_.slice(1,-1):_,g=Due.join(m,e),y=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;f(c(y,l,0))}),"step"),c=s((l,f,d)=>new Promise((_,m)=>{if(d===i.length)return _(u(f+1));let g=i[d];Lue(l+g,{pathExt:o},(y,b)=>{if(!y&&b)if(t.all)a.push(l+g);else return _(l+g);return _(c(l,f,d+1))})}),"subStep");return r?u(0).then(l=>r(null,l),r):u(0)},"which"),Ndt=s((e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=Mue(e,t),o=[];for(let a=0;a<r.length;a++){let u=r[a],c=/^".*"$/.test(u)?u.slice(1,-1):u,l=Due.join(c,e),f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let d=0;d<n.length;d++){let _=f+n[d];try{if(Lue.sync(_,{pathExt:i}))if(t.all)o.push(_);else return _}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw jue(e)},"whichSync");xue.exports=Uue;Uue.sync=Ndt});var cB=h((GBt,uB)=>{"use strict";var Fue=s((e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");uB.exports=Fue;uB.exports.default=Fue});var Vue=h((HBt,Gue)=>{"use strict";var Bue=require("path"),Adt=que(),Rdt=cB();function kue(e,t){let r=e.options.env||process.env,n=process.cwd(),i=e.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let a;try{a=Adt.sync(e.command,{path:r[Rdt({env:r})],pathExt:t?Bue.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return a&&(a=Bue.resolve(i?e.options.cwd:"",a)),a}s(kue,"resolveCommandAttempt");function Cdt(e){return kue(e)||kue(e,!0)}s(Cdt,"resolveCommand");Gue.exports=Cdt});var Hue=h((KBt,fB)=>{"use strict";var lB=/([()\][%!^"`<>&|;, *?])/g;function $dt(e){return e=e.replace(lB,"^$1"),e}s($dt,"escapeCommand");function Ddt(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(lB,"^$1"),t&&(e=e.replace(lB,"^$1")),e}s(Ddt,"escapeArgument");fB.exports.command=$dt;fB.exports.argument=Ddt});var Kue=h((YBt,zue)=>{"use strict";zue.exports=/^#!(.*)/});var Yue=h((JBt,Wue)=>{"use strict";var Ldt=Kue();Wue.exports=(e="")=>{let t=e.match(Ldt);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var Xue=h((XBt,Jue)=>{"use strict";var dB=require("fs"),jdt=Yue();function Mdt(e){let r=Buffer.alloc(150),n;try{n=dB.openSync(e,"r"),dB.readSync(n,r,0,150,0),dB.closeSync(n)}catch{}return jdt(r.toString())}s(Mdt,"readShebang");Jue.exports=Mdt});var tce=h((QBt,ece)=>{"use strict";var Udt=require("path"),Zue=Vue(),Que=Hue(),xdt=Xue(),qdt=process.platform==="win32",Fdt=/\.(?:com|exe)$/i,Bdt=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function kdt(e){e.file=Zue(e);let t=e.file&&xdt(e.file);return t?(e.args.unshift(e.file),e.command=t,Zue(e)):e.file}s(kdt,"detectShebang");function Gdt(e){if(!qdt)return e;let t=kdt(e),r=!Fdt.test(t);if(e.options.forceShell||r){let n=Bdt.test(t);e.command=Udt.normalize(e.command),e.command=Que.command(e.command),e.args=e.args.map(o=>Que.argument(o,n));let i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}s(Gdt,"parseNonShell");function Vdt(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:Gdt(n)}s(Vdt,"parse");ece.exports=Vdt});var ice=h((tkt,nce)=>{"use strict";var pB=process.platform==="win32";function hB(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}s(hB,"notFoundError");function Hdt(e,t){if(!pB)return;let r=e.emit;e.emit=function(n,i){if(n==="exit"){let o=rce(i,t,"spawn");if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}s(Hdt,"hookChildProcess");function rce(e,t){return pB&&e===1&&!t.file?hB(t.original,"spawn"):null}s(rce,"verifyENOENT");function zdt(e,t){return pB&&e===1&&!t.file?hB(t.original,"spawnSync"):null}s(zdt,"verifyENOENTSync");nce.exports={hookChildProcess:Hdt,verifyENOENT:rce,verifyENOENTSync:zdt,notFoundError:hB}});var ace=h((nkt,d_)=>{"use strict";var sce=require("child_process"),mB=tce(),_B=ice();function oce(e,t,r){let n=mB(e,t,r),i=sce.spawn(n.command,n.args,n.options);return _B.hookChildProcess(i,n),i}s(oce,"spawn");function Kdt(e,t,r){let n=mB(e,t,r),i=sce.spawnSync(n.command,n.args,n.options);return i.error=i.error||_B.verifyENOENTSync(i.status,n),i}s(Kdt,"spawnSync");d_.exports=oce;d_.exports.spawn=oce;d_.exports.sync=Kdt;d_.exports._parse=mB;d_.exports._enoent=_B});var cce=h((skt,uce)=>{"use strict";uce.exports=e=>{let t=typeof e=="string"?`
|
|
302
|
+
`},nodePaths:fae,entryPoints:[a],...c,sourcemap:"linked",legalComments:"linked",treeShaking:!0,bundle:!0,...u,external:[],logLevel:"silent",conditions:Qc.BUILD_CONDITIONS,plugins:[(0,tct.environmentPlugin)({sourceDirectory:n}),(0,Qut.blockRemoteModulePlugin)({logger:i}),(0,ict.openApiRoutesPlugin)({sourceDirectory:n,outputDirectory:r}),(0,sct.rawRoutePlugin)({sourceDirectory:n,logger:i}),(0,act.schemaValidationPlugin)({sourceDirectory:n,logger:i,isOpenApiBased:!0}),(0,oct.runtimeConfigPlugin)(),(0,ect.devPortalConfigPlugin)({sourceDirectory:n}),(0,rct.jsonSchemaPlugin)({sourceDirectory:n,outputDirectory:r}),(0,nct.nodejsCompatPlugin)({nodeCompatEnabled:o?.esmWorker===!0,sourceDirectory:n})]}}s(cct,"getBaseESBuildConfig");Qc.default=cct});var S1=h(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.formatBuildResult=Ms.BUILD_TASK_PLUGIN_NAME=Ms.ESBUILD_PLUGIN_NAME=void 0;Ms.ESBUILD_PLUGIN_NAME="run-esbuild";Ms.BUILD_TASK_PLUGIN_NAME="build-task";var lct=s((e,t)=>{let r=t;if(t.includes(e)){let n=new RegExp(`.*(${e})`,"g");r=t.replace(n,"")}return r.match(/^(\/)?(\.\.(\/)?)+/)&&(r=r.replace(/^(\/)?(\.\.(\/)?)+/,"/")),r},"removePrefixFromString"),fct=s((e,t)=>{let r=t;if(r.includes(e)){let n=new RegExp(`[a-zA-Z0-9-_.\\/]+(${e})`,"g");r=r.replace(n,"")}return r},"cleanFilePathsInMessage"),b1=s((e,t,r)=>{if(!e||e.length<=0)return e;let n=e.filter(i=>i.message!=='Could not resolve "@zuplo/runtime"');return n&&n.length>0&&n.forEach(i=>{i.location&&i.location.file&&(i.location.file=lct(t,i.location.file)),i.location&&i.location.lineText&&i.location.lineText.includes("@zuplo/core/index.minified.js")&&(i.location.lineText=i.location.lineText.substring(0,200)+"...<Truncated>"),i.message=fct(t,i.message),i.notes&&i.notes.length>0&&delete i.notes,i.text&&delete i.text,i.pluginName===""&&(i.pluginName=r)}),n},"cleanDataOnBuildIssue");function dct(e,t,r){try{e.buildTaskResult&&(e.buildTaskResult.errors&&(e.buildTaskResult.errors=b1(e.buildTaskResult.errors,t,Ms.BUILD_TASK_PLUGIN_NAME)),e.buildTaskResult.warnings&&(e.buildTaskResult.warnings=b1(e.buildTaskResult.warnings,t,Ms.BUILD_TASK_PLUGIN_NAME))),e.compilerResult&&(e.compilerResult.errors&&(e.compilerResult.errors=b1(e.compilerResult.errors,t,Ms.ESBUILD_PLUGIN_NAME)),e.compilerResult.warnings&&(e.compilerResult.warnings=b1(e.compilerResult.warnings,t,Ms.ESBUILD_PLUGIN_NAME)))}catch(n){r.error("Error while formatting buildResult. Err: ",n)}return e}s(dct,"formatBuildResult");Ms.formatBuildResult=dct});var hae=h(Us=>{"use strict";var pct=Us&&Us.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return t[r]},"get")}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),hct=Us&&Us.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),mct=Us&&Us.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&pct(t,e,r);return hct(t,e),t},pae=Us&&Us.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Us,"__esModule",{value:!0});Us.getRunEsBuildPlugin=void 0;var _ct=Gf(),dae=Yo(),gct=mct(require("esbuild")),yct=pae(_n()),Ect=CI(),bct=pae(Y2()),J2=S1(),Sct=s(function(e){return s(async function({systemDirectory:r,outputDirectory:n,sourceDirectory:i,dev:o,generateSourceMaps:a,buildId:u,logger:c,config:l}){return yct.default.timeFn("Running esbuild",async()=>{c.info(`Running build_id: ${u}`);let f=await(0,bct.default)({systemDirectory:r,outputDirectory:n,generateSourceMaps:a,sourceDirectory:i,dev:o,logger:c,flags:l.flags}),d,_=new Date;try{if(!await(0,_ct.oasFileInProject)(i))throw new Error("Failed to build project because no open-api file was found on the 'config' folder");d=await gct.build(f)}catch(g){if(c.error(g),g.errors||g.warnings)d=g;else if(g.message.includes("Failed to build project because no open-api file was found on the 'config' folder"))d={warnings:[],errors:[{id:"missing-open-api-file",text:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:J2.ESBUILD_PLUGIN_NAME,location:null,notes:[],detail:"Failed to build project because no open-api file was found on the 'config' folder"}],outputFiles:void 0,metafile:void 0,mangleCache:void 0};else throw g}let m=new Date;if(e(new Ect.CompilerResult(d,{endBuildTime:m,startBuildTime:_,buildId:u??""})),d.errors.length>0){d.errors.length>1&&(d.errors.length=1);let g=d.errors[0];c.debug(g)}return{warnings:[...d.warnings.map(g=>({message:g.text,pluginName:J2.ESBUILD_PLUGIN_NAME,severity:dae.WARNING_SEVERITY}))],errors:[...d.errors.map(g=>({message:g.text,pluginName:J2.ESBUILD_PLUGIN_NAME,severity:dae.ERROR_SEVERITY}))]}})},"runEsbuild")},"getRunEsBuildPlugin");Us.getRunEsBuildPlugin=Sct});var Z2=h(Ym=>{"use strict";var _ae=Ym&&Ym.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ym,"__esModule",{value:!0});Ym.build=void 0;var Wm=Yo(),Oct=require("crypto"),vct=require("fs"),zE=_ae(require("path")),mae=Bt(),Ict=rc(),Pct=_ae(_n()),wct=HH(),Tct=KH(),Nct=WH(),Act=YH(),Rct=QH(),Cct=ez(),$ct=iz(),Dct=h9(),Lct=_9(),jct=hae(),X2=S1(),O1;try{let e=(0,vct.readFileSync)(zE.default.resolve(__dirname,"../../package.json"),"utf-8");O1=JSON.parse(e).version}catch{O1="0.0.0"}async function Mct({sourceDirectory:e,deploymentName:t=zE.default.basename(e),dev:r,entitlements:n,environmentType:i,generateSourceMaps:o=!1,logger:a,noCompile:u=!1,postBuildTasks:c,projectId:l,publicZuploEnvironmentVariables:f={}}){let d=(0,Oct.randomUUID)(),_=a.child({buildId:d});return Pct.default.timeFn(`Run build with build_id: ${d}`,async()=>{let m=await(0,wct.getZuploConfig)(e),g=zE.default.join(e,mae.BUILD_OUTPUT_DIR),y;if("errors"in m)y={status:"Failed",flags:void 0,compatibilityDate:void 0,runtimeVersion:O1,outputPath:g,buildTaskResult:{buildTime:"",buildTimeMs:0,status:Wm.FAILURE_STATUS,buildId:d,warnings:[],errors:m.errors}};else{let E={dev:r,generateSourceMaps:o,deploymentName:t,sourceDirectory:e,outputDirectory:g,systemDirectory:zE.default.join(e,mae.GENERATED_SOURCE_DIR_NAME),buildId:d,logger:_,config:m.config,publicZuploEnvironmentVariables:f,projectId:l,entitlements:n,environmentType:i},O=[];O.push(Tct.cleanOutput),O.push(Nct.createSystemDir),O.push(Act.checkForDeprecations),O.push(Rct.generateBuildData),O.push($ct.validateDevPortalJSON),O.push(Dct.validateOpenAPIFiles),O.push(Cct.generateWorker);let v,P=s(K=>{v=K},"compileCallback");u||O.push((0,jct.getRunEsBuildPlugin)(P)),O.push(Lct.verifyWorkerOutput),c&&O.push(...c);let w=await(0,Ict.runPlugins)(O,E),j=w.errors.length>0?Wm.FAILURE_STATUS:w.warnings.length>0?Wm.WARNING_STATUS:Wm.GOOD_STATUS;y={status:j==="Failed"||v===void 0||v.status==="Failed"?"Failed":j==="Warnings"||v.status==="Warnings"?"Warnings":"Good",compatibilityDate:m.config.compatibilityDate,runtimeVersion:O1,outputPath:g,compilerResult:v,buildTaskResult:{buildTime:"",buildTimeMs:0,status:j,buildId:d,warnings:w.warnings,errors:w.errors},flags:m.config.flags}}if(y.buildTaskResult.warnings.length>0){y.buildTaskResult.warnings.forEach(O=>{_.warn(O)});let E=y.buildTaskResult.warnings.filter(O=>O.pluginName!=="runEsbuild"&&O.pluginName!==X2.ESBUILD_PLUGIN_NAME);E.length>0&&(y.buildTaskResult.warnings=E),y.buildTaskResult.status=Wm.WARNING_STATUS}if(y.buildTaskResult.errors.length>0){y.buildTaskResult.errors.forEach(O=>{_.error(O)});let E=y.buildTaskResult.errors.filter(O=>O.pluginName!=="runEsbuild"&&O.pluginName!==X2.ESBUILD_PLUGIN_NAME);E.length>0&&(y.buildTaskResult.errors=E),y.buildTaskResult.status=Wm.FAILURE_STATUS}if(_.debug(`Build ${y.compilerResult?.buildId??d} completed ${u?"on watch mode":"with compiler status "+y.compilerResult?.status} and build task status ${y.buildTaskResult.status}`),y.compilerResult){let{metafile:E,...O}=y.compilerResult;_.debug(`Compiler results for build ${y.compilerResult?.buildId??d}`,O)}_.debug(`Build task results for build ${y.buildTaskResult?.buildId??d}`,y.buildTaskResult);let b=zE.default.basename(e);return(0,X2.formatBuildResult)(y,b,_)})}s(Mct,"build");Ym.build=Mct});var I1=h(xs=>{"use strict";var Uct=xs&&xs.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return t[r]},"get")}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),xct=xs&&xs.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),qct=xs&&xs.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Uct(t,e,r);return xct(t,e),t},v1=xs&&xs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xs,"__esModule",{value:!0});xs.BuildWatcher=void 0;var gae=Yo(),Fct=v1(require("chokidar")),Bct=qct(require("esbuild")),yae=require("crypto"),kct=v1(require("events")),KE=v1(require("path")),Eae=Bt(),Gct=Z2(),bae=CI(),Vct=v1(Y2()),Sae=S1(),Q2=class extends kct.default{static{s(this,"WatchEmitter")}},eB=class{static{s(this,"BuildWatcher")}esbuildContext;emitter=new Q2;envFilesWatcher;outputDirectory;sourceDirectory;dev;generateSourceMaps;logger;publicZuploEnvironmentVariables;projectName;constructor({sourceDirectory:t,dev:r,generateSourceMaps:n,logger:i,publicZuploEnvironmentVariables:o={}}){this.sourceDirectory=t,this.dev=r,this.outputDirectory=KE.default.join(t,Eae.BUILD_OUTPUT_DIR),this.generateSourceMaps=n??!1,this.logger=i,this.publicZuploEnvironmentVariables=o,this.projectName=KE.default.basename(t),this.envFilesWatcher=Fct.default.watch([KE.default.join(t,".env"),KE.default.join(t,".env.zuplo")])}watchEnvFiles(){this.envFilesWatcher.on("change",async()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("add",async()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("unlink",async()=>{this.emitter.emit("reload",null,null)})}onReload=s(t=>{this.emitter.on("reload",t)},"onReload");async start(){let{sourceDirectory:t}=this;if(this.esbuildContext!==void 0)throw new Error("Watcher cannot be started more than once");let r=await(0,Gct.build)({sourceDirectory:t,noCompile:!0,dev:this.dev,generateSourceMaps:this.generateSourceMaps,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger}),n=await(0,Vct.default)({systemDirectory:KE.default.join(t,Eae.GENERATED_SOURCE_DIR_NAME),outputDirectory:this.outputDirectory,sourceDirectory:t,dev:this.dev,generateSourceMaps:this.generateSourceMaps,logger:this.logger,flags:r.flags}),i=this;n.plugins?.push({name:"on-end",setup(o){o.onEnd(a=>{i.logger.debug("Watcher (build) reloaded");let u;if(a)if(u=new bae.CompilerResult(a),u.errors.length>0){let c={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:gae.FAILURE_STATUS,buildId:(0,yae.randomUUID)(),warnings:[],errors:[]}};c.compilerResult=u,(0,Sae.formatBuildResult)(c,i.projectName,i.logger),i.logger.error(c.compilerResult.errors,"Build errors")}else i.logger.debug(`Successfully rebuilt watched project. Build id ${u.buildId}`);i.emitter.emit("reload",r,null,u)})}}),this.esbuildContext=await Bct.context(n);try{let o=await this.esbuildContext.rebuild();if(o.errors.length>0){let a={status:"Failed",runtimeVersion:"0.0.0",buildTaskResult:{buildTime:"",buildTimeMs:0,status:gae.FAILURE_STATUS,buildId:(0,yae.randomUUID)(),warnings:[],errors:[]}};a.compilerResult=new bae.CompilerResult(o),(0,Sae.formatBuildResult)(a,this.projectName,this.logger),this.logger.error(a.compilerResult.errors,"Build errors")}}catch(o){throw await this.close(),o}await this.esbuildContext.watch()}async close(){try{await this.envFilesWatcher.close(),this.esbuildContext&&(await this.esbuildContext.dispose(),this.logger.debug("ESBuild watcher closed"))}catch(t){this.logger.error(t)}}};xs.BuildWatcher=eB});var tB=h(P1=>{"use strict";Object.defineProperty(P1,"__esModule",{value:!0});P1.HttpStatusCode=void 0;var Oae;(function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(Oae||(P1.HttpStatusCode=Oae={}))});var vae=h(w1=>{"use strict";Object.defineProperty(w1,"__esModule",{value:!0});w1.getSourceControlProviderLabel=void 0;function Hct(e){let t="";switch(e){case"GITLAB":t="GitLab";break;case"GITHUB":t="GitHub";break;case"BITBUCKET":t="BitBucket";break;default:t=e;break}return t}s(Hct,"getSourceControlProviderLabel");w1.getSourceControlProviderLabel=Hct});var Pae=h(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.DEPLOYMENT_NO_ACCESS=S.INVALID_SOURCE_REPO_URL=S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED=S.PROJECT_MUST_HAVE_ONE_MEMBER=S.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS=S.PROJECT_MEMBER_ALREADY_EXISTS=S.PROJECT_MEMBER_NOT_FOUND=S.INVALID_TEMPLATE_REPOSITORY=S.INCORRECT_PROJECT_TEMPLATE=S.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS=S.PROJECT_NOT_FOUND=S.PROJECT_NOT_FOUND_FOR_SOURCE_REPO=S.PROJECT_SHARING_DISABLED_ON_ACCOUNT=S.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED=S.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED=S.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE=S.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER=S.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND=S.ACCOUNT_MEMBER_INVITE_INVALID=S.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST=S.ACCOUNT_MEMBER_DOES_NOT_EXIST=S.ACCOUNT_MEMBER_INFO_MISSING=S.ACCOUNT_MEMBER_ALREADY_EXISTS=S.ACCOUNT_UPDATE_INFO_MISSING=S.ACCOUNT_INFO_MISSING=S.ACCOUNT_DOES_NOT_EXISTS=S.INVALID_ACCOUNT_LABEL_ENDING=S.INVALID_ACCOUNT_NAME_ENDING=S.ACCOUNT_NAME_ALREADY_IN_USE=S.INVALID_ACCOUNT_LABEL=S.INVALID_ACCOUNT_NAME=S.ACCOUNT_LABEL_LENGTH_LIMIT_REACHED=S.ACCOUNT_NAME_LENGTH_LIMIT_REACHED=S.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD=S.ACCOUNT_NAME_USES_RESERVED_KEYWORD=S.ACCOUNT_ALREADY_EXISTS=S.ACCOUNT_NOT_FOUND=S.USER_IS_NOT_SERVICE_ACCOUNT=S.USER_REMOVE_NOT_MEMBER_ACCOUNT=S.USER_HAS_NO_ACCESS_TO_ACCOUNT=S.USER_DETAILS_CANNOT_BE_FOUND=S.USER_ALREADY_EXISTS=S.CLIENT_NOT_FOUND=S.FORBIDDEN=S.UNAUTHORIZED=S.METHOD_NOT_ALLOWED=S.NOT_FOUND=S.CONFLICT=S.BAD_REQUEST=S.INTERNAL_SERVER_ERROR=void 0;S.GITHUB_INTEGRATION_ALREADY_EXISTS=S.FEATURE_FLAGS_NOT_FOUND=S.MAX_ALLOWED_PROJECTS_LIMIT_REACHED=S.PROJECT_ALREADY_HAS_REPO=S.PROJECT_INVALID_NAME=S.FAILED_TO_REVOKE_GH_TOKEN=S.USER_ACCOUNT_NOT_FS_MIGRATED=S.USER_NO_ACCESS_GITLAB_REPO=S.USER_NO_ACCESS_BITBUCKET_REPO=S.GITHUB_APP_CONFIGURATION_NOT_FOUND=S.GITHUB_APP_NO_USER_ACCESS_=S.GITHUB_APP_NO_NAMESPACE_ACCESS=S.GENERIC_GITHUB_BRANCH_INFO_ERROR=S.GITHUB_USER_NO_READ_ACCESS_REPO=S.USER_NO_PULL_ACCESS_GITHUB_REPO=S.USER_NO_ACCESS_GITHUB_REPO=S.PROJECT_SHARING_REQUIRES_GIT_REPO=S.PROJECT_INVALID_GIT_REPO=S.PROJECT_INVALID_GIT_CLONE=S.USER_IS_PROJECT_MEMBER=S.USER_HAS_NO_ACCESS_TO_PROJECT=S.RUNTIME_FLAG_KEY_NOT_VALID=S.RUNTIME_FLAG_NOT_FOUND=S.RUNTIME_FLAG_ALREADY_EXISTS=S.PROJECT_NO_MEMBERS=S.PROJECT_ALREADY_EXISTS=S.SERVICE_CONFIGURATION_FAILED_DECRYPTION=S.WORKING_COPY_SERVICE_NOT_CREATED=S.WORKING_COPY_SERVICE_NOT_DELETED=S.WORKING_COPY_SERVICE_NOT_FOUND=S.SERVICE_CONFIGURATION_NOT_FOUND=S.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE=S.DEPLOYMENT_INCORRECT_STATUS_PAUSE=S.DEPLOYMENT_NOT_WORKING_COPY=S.DEPLOYMENT_LOG_NOT_FOUND=S.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT=S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT=S.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED=S.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE=S.DEPLOYMENT_DELETE_ERROR=S.DEPLOYMENT_CANNOT_DELETE_INSTANCE=S.DEPLOYMENT_INVALID_MULTI_PART=S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART=S.DEPLOYMENT_DIR_DOES_NOT_EXISTS=S.DEPLOYMENT_FILE_DOES_NOT_EXISTS=S.DEPLOYMENT_NOT_FOUND=S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST=S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH=void 0;S.THIRD_PARTY_APP_CONNECTION_NOT_FOUND=S.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND=S.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR=S.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR=S.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST=S.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR=S.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED=S.SOURCE_CONTROL_REMOTE_BRANCH_EXISTS=S.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND=S.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION=S.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING=S.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING=S.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS=S.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS=S.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED=S.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS=S.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND=S.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND=S.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE=S.SOURCE_CONTROL_REPO_OPERATION_ERROR=S.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE=S.SOURCE_CONTROL_REPO_NOT_FOUND=S.SOURCE_CONTROL_AUTHENTICATION_FAILED=S.EXTERNAL_SERVICE_GENERIC_ERROR=S.API_USER_NO_ACCESS=S.EXTERNAL_USER_NOT_CONFIGURED=S.EXTERNAL_USER_NO_ACCESS=S.API_KEY_CANNOT_BE_CREATED=S.CONSUMER_CANNOT_BE_CREATED=S.CONSUMER_DOES_NOT_EXIST=S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=S.GITLAB_DUPLICATE_REPO=S.GITLAB_FAILED_DURING_REPO_CREATION=S.GITLAB_QUERY_USER_INFO_FAILED=S.BITBUCKET_FAILED_DURING_REPO_CREATION=S.BITBUCKET_WORKSPACE_MISCONFIGURATION=S.BITBUCKET_QUERY_USER_INFO_FAILED=S.GITHUB_INTEGRATION_INVALID_REPO=S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=S.GITHUB_INTEGRATION_DUPLICATE_REPO=S.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED=S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED=S.GITHUB_INTEGRATION_BRANCH_BEHIND=S.GITHUB_INTEGRATION_NOT_FOUND=S.GITHUB_REPOSITORY_NOT_FOUND=S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=void 0;S.RBACCONFIGURATION_DOES_NOT_EXISTS=S.RBAC_INVALID_EXPIRATION_DATE=S.ACCOUNT_RBAC_DISABLED=S.METERING_BUCKET_CREATION_FAILED=S.UNABLE_UPGRADE_PLAN=S.BUCKET_NOT_FOUND=S.BUCKET_API_KEY_SERVICE_CONFLICT=S.DIRECTORY_DELETE_FAILED=S.FILE_DELETE_FAILED=S.CANNOT_DELETE_SOLE_OPEN_API_FILE=S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=S.CANNOT_DELETE_ESSENTIAL_FILE=S.FILE_WRITE_FAILED=S.FILE_RENAME_FAILED=S.FILE_RENAME_FILE_ALREADY_EXISTS=S.FILE_RENAME_CANNOT_CHANGE_EXTENSION=S.FILE_RENAME_PATHS_MATCH=S.DIRECTORY_CREATION_FAILED=S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=S.DIRECTORY_DOES_NOT_EXIST=S.DIRECTORY_ALREADY_EXISTS=S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=S.FAILED_DOWNLOAD_FROM_STORAGE=S.CANNOT_FIND_SRC_DIRECTORY=S.CANNOT_READ_PACKAGE_JSON=S.PACKAGE_JSON_NOT_FOUND=S.RUNTIME_VERSION_INCORRECT_FORMAT=S.MIGRATIONS_ONLY_ON_WORKING_COPY=S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=S.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR=S.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2=S.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE=S.NO_GLOBAL_SYMBOLS=S.NO_ZUPLO_PREFIXED_VARIABLES=S.NON_EMPTY_TARGETS_REQUIRED=S.CONFLICTING_TYPES=S.OVERLAPPING_TARGETS=S.INVALID_BRANCH_NAME=S.ENV_VAR_MAX_SIZE_LIMIT=S.TARGET_BRANCH_ONLY_FOR_PREVIEW=S.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY=S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE=S.DEPLOYMENT_NAME_MISSING=S.NON_EXISTENT_ENVIRONMENT_VARIABLE=S.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE=S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR=S.DUPLICATE_ENVIRONMENT_VARIABLE=S.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION=void 0;S.ACCOUNT_MISCONFIGURED_FOR_RBAC=S.ACCOUNT_ALREADY_RBAC_ENABLED=S.MISCONFIGURED_ENV_VAR=S.USER_HAS_NO_DEVELOPER_ENV_VAR_ACCESS=S.USER_HAS_NO_PROD_ENV_VAR_ACCESS=S.ACCOUNT_ADMIN_INVALID_PROJECT_ROLE_DOWNGRADE=S.USER_HAS_NO_DEPLOY_ACCESS_TO_PROJECT_ENVIRONMENT=S.USER_HAS_NO_ACCESS_TO_PROJECT_ENVIRONMENT=S.USER_CANNOT_EDIT_OWN_ROLE=S.USER_DOES_NOT_EXIST=S.INVALID_USER_ROLE=S.USER_HAS_NO_ACCESS_TO_CONSUMER=S.RBACCONFIGURATION_CONSUMER_LOCKED=S.RBACCONFIGURATION_MISCONFIGURATION=S.RBACCONFIGURATION_DELETE_MISCONFIGURATION=S.RBACCONFIGURATION_INVALID_OPENFGA_CONFIG=S.RBACCONFIGURATION_INVALID_PROJECT_PROVIDED=S.RBACCONFIGURATION_ACCOUNT_HAS_NO_PROJECTS=S.RBACCONFIGURATION_REQUIRE_PROJECTS=S.RBACCONFIGURATION_INVALID_ENVIRONMENTS=S.RBACCONFIGURATION_REQUIRE_ENVIRONMENTS=void 0;var T=tB(),Iae=vae(),zct="https://github.com/apps/zuplo/installations/new";S.INTERNAL_SERVER_ERROR={type:"https://zup.fail/http-status/500",title:"Internal Server Error",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.BAD_REQUEST={type:"https://zup.fail/http-status/400",title:"Bad Request",status:T.HttpStatusCode.BAD_REQUEST};S.CONFLICT={type:"https://zup.fail/http-status/409",title:"Conflict",status:T.HttpStatusCode.CONFLICT};S.NOT_FOUND={type:"https://zup.fail/http-status/404",title:"Not Found",status:T.HttpStatusCode.NOT_FOUND};S.METHOD_NOT_ALLOWED={type:"https://zup.fail/http-status/405",title:"Method Not Allowed",status:T.HttpStatusCode.METHOD_NOT_ALLOWED};S.UNAUTHORIZED={type:"https://zup.fail/http-status/401",title:"Unauthorized",status:T.HttpStatusCode.UNAUTHORIZED};S.FORBIDDEN={type:"https://zup.fail/http-status/403",title:"Forbidden",status:T.HttpStatusCode.FORBIDDEN};S.CLIENT_NOT_FOUND={type:"https://zup.fail/client-not-found",title:"Client not found",status:T.HttpStatusCode.NOT_FOUND};S.USER_ALREADY_EXISTS={type:"https://zup.fail/user-already-exists",title:"User already exists",status:T.HttpStatusCode.CONFLICT};S.USER_DETAILS_CANNOT_BE_FOUND={type:"https://zup.fail/user-details-cannot-be-found",title:"User cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.USER_HAS_NO_ACCESS_TO_ACCOUNT={type:"https://zup.fail/user-has-no-access-to-account",title:"Forbidden",detail:"You are not authorized to access the account resource.",status:T.HttpStatusCode.FORBIDDEN};S.USER_REMOVE_NOT_MEMBER_ACCOUNT={type:"https://zup.fail/removed-user-not-account-member",title:"The user being removed is not a member of the account",status:T.HttpStatusCode.BAD_REQUEST};S.USER_IS_NOT_SERVICE_ACCOUNT={type:"https://zup.fail/user-not-service-account",title:"User is not a service account",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NOT_FOUND={type:"https://zup.fail/account-not-found",title:"Account not found",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_ALREADY_EXISTS={type:"https://zup.fail/account-already-exists",title:"Account already exists",status:T.HttpStatusCode.CONFLICT};S.ACCOUNT_NAME_USES_RESERVED_KEYWORD={type:"https://zup.fail/account-name-reserved-keyword",title:"The account name can not use reserved keyword 'zuplo'",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_STARTS_WITH_RESERVED_KEYWORD={type:"https://zup.fail/account-use-reserved-keyword",title:"The account name can not start with a reserved keyword",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_LENGTH_LIMIT_REACHED={type:"https://zup.fail/account-name-length-limit",title:"The account name exceeds the 200 character limit",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_LABEL_LENGTH_LIMIT_REACHED={type:"https://zup.fail/account-label-length-limit",title:"The account label exceeds the 200 character limit",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_NAME={type:"https://zup.fail/invalid-account-name",title:"The account name can only contain lower-cased characters, numbers, dashes and underscores",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_LABEL={type:"https://zup.fail/invalid-account-label",title:"The account label can only contain alpha-numeric characters, spaces, dashes and underscores",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_NAME_ALREADY_IN_USE={type:"https://zup.fail/account-name-in-use",title:"The account name is already taken. Please try again using a different name.",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_NAME_ENDING={type:"https://zup.fail/invalid-account-name-ending",title:"The account name can not end with a dash or underscore character",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_ACCOUNT_LABEL_ENDING={type:"https://zup.fail/invalid-account-label-ending",title:"The account label can not end with a dash or underscore character",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_DOES_NOT_EXISTS={type:"https://zup.fail/account-does-not-exists",title:"Not Found",detail:"The account does not exist.",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_INFO_MISSING={type:"https://zup.fail/account-info-missing",title:"Account information is required",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_UPDATE_INFO_MISSING={type:"https://zup.fail/account-update-info-missing",title:"Account information is insufficient for this operation.",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/account-member-already-exists",title:"Account member already exists",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INFO_MISSING={type:"https://zup.fail/account-member-info-missing",title:"Account member information is required",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_DOES_NOT_EXIST={type:"https://zup.fail/account-member-does-not-exists",title:"Account member information cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_DOES_NOT_EXIST={type:"https://zup.fail/account-member-invite-does-not-exist",title:"Account member invite cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.ACCOUNT_MEMBER_INVITE_INVALID={type:"https://zup.fail/account-member-invite-invalid",title:"Account member invite is invalid",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBER_INVITE_FAILED_TO_SEND={type:"https://zup.fail/account-member-invite-failed-send",title:"We were not able to send the account member invite. Please try again or contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.CANNOT_INVITE_EXISTING_ACCOUNT_MEMBER={type:"https://zup.fail/account-member-cannot-be-invited",title:"The user is already part of the account.",status:T.HttpStatusCode.BAD_REQUEST};S.EXISTING_PENDING_ACCOUNT_MEMBER_INVITE={type:"https://zup.fail/existing-pending-account-member-invites",title:"The user has a pending invitation to this account.",status:T.HttpStatusCode.BAD_REQUEST};S.MULTIPLE_ACCOUNT_MEMBERS_NOT_ALLOWED={type:"https://zup.fail/no-multi-account-members",title:"Account is not configured for multiple members",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MEMBERS_ALLOWED_LIMIT_REACHED={type:"https://zup.fail/account-members-limit-reached",title:"This account has reached the limit of users allowed by its current billing plan.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_SHARING_DISABLED_ON_ACCOUNT={type:"https://zup.fail/project-sharing-disabled-on-account",title:"Project sharing is not enabled on account",status:T.HttpStatusCode.FORBIDDEN};S.PROJECT_NOT_FOUND_FOR_SOURCE_REPO={type:"https://zup.fail/project-not-found-for-source-repo",title:"Project not found for provided repository",status:T.HttpStatusCode.NOT_FOUND};S.PROJECT_NOT_FOUND={type:"https://zup.fail/project-not-found",title:"Project not found",status:T.HttpStatusCode.NOT_FOUND};S.PROJECT_CANNOT_BE_DELETED_PROTECTED_DEPLOYMENTS_EXISTS={type:"https://zup.fail/project-cannot-be-deleted-protected-deployments-exists",title:"Project cannot be deleted because it has protected deployments",detail:"Project has protected deployments. Make sure to remove the use of custom domains before trying to delete the project.",status:T.HttpStatusCode.FORBIDDEN};S.INCORRECT_PROJECT_TEMPLATE={type:"https://zup.fail/incorrect-project-template",title:"Incorrect project template name",status:T.HttpStatusCode.BAD_REQUEST};var Kct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:`The repository '${e} is not a valid Zuplo template repository`,status:T.HttpStatusCode.FORBIDDEN}),"INVALID_TEMPLATE_REPOSITORY");S.INVALID_TEMPLATE_REPOSITORY=Kct;S.PROJECT_MEMBER_NOT_FOUND={type:"https://zup.fail/project-member-not-found",title:"Project Member not found",status:T.HttpStatusCode.NOT_FOUND};S.PROJECT_MEMBER_ALREADY_EXISTS={type:"https://zup.fail/project-member-already-exists",title:"Project Member already exists",status:T.HttpStatusCode.BAD_REQUEST};S.CAN_NOT_DELETE_YOUR_OWN_PROJECT_MEMBERS={type:"https://zup.fail/cannt-delete-your-own-project-member",title:"Can not delete your own Project Member record",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_MUST_HAVE_ONE_MEMBER={type:"https://zup.fail/project-must-have-one-member",title:"Project must have at least one member",status:T.HttpStatusCode.BAD_REQUEST};S.SHARED_PROJECT_PREVIOUSLY_INITIALIZED={type:"https://zup.fail/project-previously-initialized",title:"Project was previously initialized",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_SOURCE_REPO_URL={type:"https://zup.fail/invalid-source-repo-url",title:"Project is not connected to source control, a sourceRepoUrl property must be specified and valid",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_NO_ACCESS={type:"https://zup.fail/deployment-no-access",title:"User does not have access to deployment",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_DOES_NOT_EXIST_FOR_BRANCH={type:"https://zup.fail/deployment-branch-does-not-exist",title:"A deployment record cannot be found for the provided branch.",detail:"You can only update a project's default branch to one that has been deployed.",status:T.HttpStatusCode.FORBIDDEN};S.DEFAULT_DEPLOYMENT_DOES_NOT_EXIST={type:"https://zup.fail/default-deployment-does-not-exist",title:"A default deployment record cannot be found for the project.",detail:"You can only update a project's default branch to one that has been deployed.",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_NOT_FOUND={type:"https://zup.fail/deployment-not-found",title:"Deployment was not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_FILE_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-file-does-not-exists",title:"Files were not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_DIR_DOES_NOT_EXISTS={type:"https://zup.fail/deployment-dir-does-not-exists",title:"NOT FOUND",detail:"Deployment directory was not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_REQUEST_IS_NOT_MULTI_PART={type:"https://zup.fail/deployment-request-is-not-multi-part",title:"Request is not multipart.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INVALID_MULTI_PART={type:"https://zup.fail/deployment-invalid-multi-part",title:"Invalid request format. Must be multi-part file upload.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_CANNOT_DELETE_INSTANCE={type:"https://zup.fail/deployment-cannot-delete-instance",title:"Cannot delete instance of the deployment. Invalid account or project.",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_DELETE_ERROR={type:"https://zup.fail/deployment-delete-error",title:"Error deleting deployment instance.",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_INVALID_ENVIRONMENT_TO_DELETE={type:"https://zup.fail/deployment-invalid-environment-to-delete",title:"Invalid environment to delete deployment",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_IS_PROTECTED_CANNOT_BE_DELETED={type:"https://zup.fail/deployment-is-protected-cannot-be-deleted",title:"Deployment is protected and cannot be deleted",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_ACCOUNT={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid account",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_PROJECT={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid project name",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_REDEPLOYED_DUE_TO_USER_SUB={type:"https://zup.fail/deployment-log-not-found",title:"Deployment cannot be redeployed due to invalid user sub",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_CANNOT_BE_DELETED_DUE_WORKING_COPY={type:"https://zup.fail/deployment-cannot-be-deleted",title:"Deployment cannot be deleted since is a working copy",status:T.HttpStatusCode.FORBIDDEN};S.DEPLOYMENT_LOG_NOT_FOUND={type:"https://zup.fail/deployment-log-not-found",title:"DeploymentLog was not found",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NOT_WORKING_COPY={type:"https://zup.fail/deployment-not-working-copy",title:"Deployment is not working copy.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INCORRECT_STATUS_PAUSE={type:"https://zup.fail/deployment-incorrect-status-pause",title:"Deployment is not in a state to be paused.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYMENT_INCORRECT_STATUS_UNPAUSE={type:"https://zup.fail/deployment-incorrect-status-unpause",title:"Deployment is not in a state to be unpaused.",status:T.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Service configuration not found.",status:T.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_FOUND={type:"https://zup.fail/service-config-not-found",title:"Working Copy service not found.",status:T.HttpStatusCode.NOT_FOUND};S.WORKING_COPY_SERVICE_NOT_DELETED={type:"https://zup.fail/working-copy-service-not-deleted",title:"Working Copy service failed to be deleted.",status:T.HttpStatusCode.BAD_REQUEST};S.WORKING_COPY_SERVICE_NOT_CREATED={type:"https://zup.fail/working-copy-service-not-created",title:"Working Copy service failed to be created.",status:T.HttpStatusCode.BAD_REQUEST};S.SERVICE_CONFIGURATION_FAILED_DECRYPTION={type:"https://zup.fail/service-config-not-decrypted",title:"Service configuration failed to decrypt.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_EXISTS={type:"https://zup.fail/project-already-exists",title:"Project already exists.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_NO_MEMBERS={type:"https://zup.fail/project-no-members",title:"Cannot find project members.",status:T.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_ALREADY_EXISTS={type:"https://zup.fail/runtime-flag-already-exists",title:"RuntimeFlag already exists.",status:T.HttpStatusCode.BAD_REQUEST};S.RUNTIME_FLAG_NOT_FOUND={type:"https://zup.fail/runtime-flag-not-found",title:"RuntimeFlag was not found.",status:T.HttpStatusCode.NOT_FOUND};S.RUNTIME_FLAG_KEY_NOT_VALID={type:"https://zup.fail/runtime-flag-key-not-valid",title:"RuntimeFlag key must be snake case",status:T.HttpStatusCode.BAD_REQUEST};S.USER_HAS_NO_ACCESS_TO_PROJECT={type:"https://zup.fail/user-has-no-access-to-project",title:"Forbidden",detail:"You are not a member of the project",status:T.HttpStatusCode.FORBIDDEN};S.USER_IS_PROJECT_MEMBER={type:"https://zup.fail/user-is-project-member",title:"The user is already a project member.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_INVALID_GIT_CLONE={type:"https://zup.fail/project-invalid-git-clone",title:"Project requires defaultBranch & sourceRepoUrl for creation from a GitHub repository.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_INVALID_GIT_REPO={type:"https://zup.fail/project-invalid-git-repo",title:"The current source control repository is already in use by a Zuplo project",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_SHARING_REQUIRES_GIT_REPO={type:"https://zup.fail/project-sharing-requires-git-repo",title:"The current project is not connected to a source control repository.",status:T.HttpStatusCode.BAD_REQUEST};var Wct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-repo",title:"You do not have access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITHUB_REPO");S.USER_NO_ACCESS_GITHUB_REPO=Wct;var Yct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-repo",title:"You do not have pull access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_PULL_ACCESS_GITHUB_REPO");S.USER_NO_PULL_ACCESS_GITHUB_REPO=Yct;var Jct=s(({repositoryUrl:e})=>({type:"https://zup.fail/no-read-access-github-repo",title:"You do not have read access to the GitHub repository associated to the project. Ask your GitHub admin for access and try again.",detail:`User does not have access to the GitHub repository associated to the project. Go to Settings > Access > Collaborators in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"GITHUB_USER_NO_READ_ACCESS_REPO");S.GITHUB_USER_NO_READ_ACCESS_REPO=Jct;S.GENERIC_GITHUB_BRANCH_INFO_ERROR={type:"https://zup.fail/gh-branch-info-error",title:"There was an error getting branch information for the GitHub repository associated to the project.",status:T.HttpStatusCode.BAD_REQUEST};S.GITHUB_APP_NO_NAMESPACE_ACCESS={type:"https://zup.fail/no-namespace-access-github-app",title:"The Zuplo GitHub app does not have access to the repositories under the namespace provided. Make sure to configure the GitHub Zuplo App on the repository.",status:T.HttpStatusCode.FORBIDDEN};var Xct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-github-app-repo",title:"The Zuplo GitHub app does not have access to the repository. Make sure to configure the GitHub Zuplo App on the repository.",detail:`The Zuplo GitHub app has not been granted access to the repository '${e}'. Go to '${zct}' to add the repository.`,status:T.HttpStatusCode.FORBIDDEN}),"GITHUB_APP_NO_USER_ACCESS_");S.GITHUB_APP_NO_USER_ACCESS_=Xct;S.GITHUB_APP_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/gh-app-not-found",title:"Global GitHub App configuration not found",status:T.HttpStatusCode.NOT_FOUND};var Zct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-bitbucket-repo",title:"You do not have access to the Bitbucket repository associated to the project. Ask your Bitbucket admin for access and try again.",detail:`User does not have access to the Bitbucket repository associated to the project. Update the user permissions in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_BITBUCKET_REPO");S.USER_NO_ACCESS_BITBUCKET_REPO=Zct;var Qct=s(({repositoryUrl:e})=>({type:"https://zup.fail/user-no-access-gitlab-repo",title:"You do not have access to the GitLab repository associated to the project. Ask your GitLab admin for access and try again.",detail:`User does not have access to the GitLab repository associated to the project. Update the user permissions in '${e}' to add a new collaborator.`,status:T.HttpStatusCode.FORBIDDEN}),"USER_NO_ACCESS_GITLAB_REPO");S.USER_NO_ACCESS_GITLAB_REPO=Qct;S.USER_ACCOUNT_NOT_FS_MIGRATED={type:"https://zup.fail/user-account-not-fs-migrated",title:"User account is in a plan that does not allow project sharing. Please contact your account admin.",status:T.HttpStatusCode.FORBIDDEN};S.FAILED_TO_REVOKE_GH_TOKEN={type:"https://zup.fail/failed-to-revoke-gh-token",title:"Failed to revoke GitHub token for the user",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.PROJECT_INVALID_NAME={type:"https://zup.fail/project-invalid-name",title:"Project name is invalid, it only can contain letter, number and dashes.",status:T.HttpStatusCode.BAD_REQUEST};S.PROJECT_ALREADY_HAS_REPO={type:"https://zup.fail/project-already-has-repo",title:"The current project has been previously linked to a source control repository",status:T.HttpStatusCode.BAD_REQUEST};S.MAX_ALLOWED_PROJECTS_LIMIT_REACHED={type:"https://zup.fail/max-allowed-projects-limit-reached",title:"Your account has reached the maximum number of projects allowed.",status:T.HttpStatusCode.BAD_REQUEST};S.FEATURE_FLAGS_NOT_FOUND={type:"https://zup.fail/feature-flags-not-found",title:"Error trying to retrieve feature flags for this user",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.GITHUB_INTEGRATION_ALREADY_EXISTS={type:"https://zup.fail/github-integration-already-exists",title:"Error trying to create GitHub Integration, already exists.",status:T.HttpStatusCode.BAD_REQUEST};var elt=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-not-found",title:"Cannot find a project configured for this repository",status:T.HttpStatusCode.CONFLICT,detail:`The repository ${e} does not have a GitHub configured project.`}),"GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND");S.GITHUB_INTEGRATION_REPOSITORY_NOT_FOUND=elt;var tlt=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-repo-not-found",title:"Cannot find a provided GitHub repository",status:T.HttpStatusCode.CONFLICT,detail:`The GitHub repository ${e} was not found.`}),"GITHUB_REPOSITORY_NOT_FOUND");S.GITHUB_REPOSITORY_NOT_FOUND=tlt;S.GITHUB_INTEGRATION_NOT_FOUND={type:"https://zup.fail/github-integration-not-found",title:"Project is not integrated with GitHub",status:T.HttpStatusCode.NOT_FOUND,detail:"The project does not have a GitHub integration configured."};S.GITHUB_INTEGRATION_BRANCH_BEHIND={type:"https://zup.fail/github-integration-branch-behind",title:"The current branch is behind, sync with remote repo for avoid conflicts.",status:T.HttpStatusCode.BAD_REQUEST};S.GITHUB_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/github-integration-authentication-failed",title:"GitHub integration: Authentication failed",status:T.HttpStatusCode.FORBIDDEN};S.GITHUB_INTEGRATION_QUERY_USER_INFO_FAILED={type:"https://zup.fail/github-integration-query-user-info-failed",title:"Failed while requesting basic user info from GitHub",status:T.HttpStatusCode.FORBIDDEN};var rlt=s(({repositoryName:e,orgName:t})=>({type:"https://zup.fail/github-integration-duplicate-repo",title:"A repository with that name already exists in GitHub",details:`A repository named '${e}' already exists on GitHub org '${t}'.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_DUPLICATE_REPO");S.GITHUB_INTEGRATION_DUPLICATE_REPO=rlt;var nlt=s(({repositoryName:e,details:t})=>({type:"https://zup.fail/github-integration-failed-repo-creation",title:"Failed to create a new repository in GitHub",details:t,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION");S.GITHUB_INTEGRATION_FAILED_DURING_REPO_CREATION=nlt;var ilt=s(({repositoryUrl:e})=>({type:"https://zup.fail/create-project-invalid-empty-repo",title:"The repository is empty and we can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.",details:`Repository '${e}' is empty and we can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_EMPTY_REPO");S.GIT_CREATE_PROJECT_WITH_EMPTY_REPO=ilt;var slt=s(({repositoryUrl:e})=>({type:"https://zup.fail/create-project-invalid-git-repo",title:"We can only create a project using a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.",details:`Repository '${e}' is not a repository containing a valid Zuplo project. Try again with a Git repository containing a Zuplo project.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GIT_CREATE_PROJECT_WITH_INVALID_REPO");S.GIT_CREATE_PROJECT_WITH_INVALID_REPO=slt;var olt=s(({repositoryUrl:e})=>({type:"https://zup.fail/github-integration-invalid-repo",title:"We can only connect to an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.",details:`Repository '${e}' is not an empty repository or a repository containing a valid Zuplo project. Try again with an empty GitHub repository.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITHUB_INTEGRATION_INVALID_REPO");S.GITHUB_INTEGRATION_INVALID_REPO=olt;S.BITBUCKET_QUERY_USER_INFO_FAILED={type:"https://zup.fail/bitbucket-query-user-info-failed",title:"Failed while requesting basic user info from Bitbucket",status:T.HttpStatusCode.FORBIDDEN};S.BITBUCKET_WORKSPACE_MISCONFIGURATION={type:"https://zup.fail/bitbucket-workspace-misconfiguration",title:"Bitbucket source control configuration is missing workspace information",status:T.HttpStatusCode.FORBIDDEN};var alt=s(({details:e})=>({type:"https://zup.fail/bitbucket-failed-repo-creation",title:"Failed to create a new repository in Bitbucket",details:e,status:T.HttpStatusCode.BAD_REQUEST}),"BITBUCKET_FAILED_DURING_REPO_CREATION");S.BITBUCKET_FAILED_DURING_REPO_CREATION=alt;S.GITLAB_QUERY_USER_INFO_FAILED={type:"https://zup.fail/gitlab-query-user-info-failed",title:"Failed while requesting basic user info from GitLab",status:T.HttpStatusCode.FORBIDDEN};var ult=s(({details:e})=>({type:"https://zup.fail/gitlab-failed-repo-creation",title:"Failed to create a new repository in GitLab",details:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_FAILED_DURING_REPO_CREATION");S.GITLAB_FAILED_DURING_REPO_CREATION=ult;var clt=s(({repositoryName:e,orgName:t})=>({type:"https://zup.fail/gitlab-duplicate-repo",title:"A repository with that name already exists in GitLab",details:`A repository named '${e}' already exists in GitLab team '${t}'.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_DUPLICATE_REPO");S.GITLAB_DUPLICATE_REPO=clt;var llt=s(({orgName:e})=>({type:"https://zup.fail/gitlab-create-repo-perm",title:"The user's GitLab group access level does not allow for repository creation.",details:"The user's GitLab group access level does not allow for repository creation.",instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_PERM_CREATE_REPO");S.GITLAB_INSUFFICIENT_PERM_CREATE_REPO=llt;var flt=s(({namespaceLabel:e})=>({type:"https://zup.fail/gitlab-insufficient-namespace-access",title:`The user's GitLab access level does not allow the use of namespace '${e}'.`,details:`The user's GitLab access level does not allow the use of namespace '${e}'.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_INSUFFICIENT_NAMESPACE_ACCESS");S.GITLAB_INSUFFICIENT_NAMESPACE_ACCESS=flt;var dlt=s(({orgName:e})=>({type:"https://zup.fail/gitlab-access-check-fail",title:"Failed to verify user's GitLab group access level",instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"GITLAB_ACCESS_LEVEL_CHECK_FAIL");S.GITLAB_ACCESS_LEVEL_CHECK_FAIL=dlt;S.CONSUMER_DOES_NOT_EXIST={type:"https://zup.fail/consumer-does-not-exist",title:"Consumer does not exist or cannot be accessed.",status:T.HttpStatusCode.NOT_FOUND};S.CONSUMER_CANNOT_BE_CREATED={type:"https://zup.fail/consumer-not-created",title:"Failed to create consumer",status:T.HttpStatusCode.BAD_GATEWAY};S.API_KEY_CANNOT_BE_CREATED={type:"https://zup.fail/api-key-not-created",title:"Failed to create api key",status:T.HttpStatusCode.BAD_GATEWAY};S.EXTERNAL_USER_NO_ACCESS={type:"https://zup.fail/external-user-no-access",title:"User does not have access to this external user.",status:T.HttpStatusCode.UNAUTHORIZED};S.EXTERNAL_USER_NOT_CONFIGURED={type:"https://zup.fail/external-user-not-configured",title:"User is not setup as an External User (Key Manager)",status:T.HttpStatusCode.FORBIDDEN};S.API_USER_NO_ACCESS={type:"https://zup.fail/api-user-no-access",title:"Api user does not have access to this endpoint.",status:T.HttpStatusCode.FORBIDDEN};S.EXTERNAL_SERVICE_GENERIC_ERROR={type:"https://zup.fail/external-service-generic-error",title:"Unable to complete API request for External Service.",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};var plt=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-authentication-failed",title:"Source provider authentication failed",detail:`Could not authenticate to ${(0,Iae.getSourceControlProviderLabel)(e)}`,status:T.HttpStatusCode.UNAUTHORIZED}),"SOURCE_CONTROL_AUTHENTICATION_FAILED");S.SOURCE_CONTROL_AUTHENTICATION_FAILED=plt;var hlt=s(({sourceControlProvider:e})=>({type:"https://zup.fail/source-control-repo-not-found",title:"We cannot connect to the repository associated to the project, verify your source control access configuration and try again.",detail:`Could not connect to ${(0,Iae.getSourceControlProviderLabel)(e)} repository`,status:T.HttpStatusCode.NOT_FOUND}),"SOURCE_CONTROL_REPO_NOT_FOUND");S.SOURCE_CONTROL_REPO_NOT_FOUND=hlt;S.SOURCE_CONTROL_EMPTY_COMMIT_MESSAGE={type:"https://zup.fail/source-control-empty-commit",title:"Commit operation failed because you provided an empty message. Please try again by providing a commit message.",status:T.HttpStatusCode.BAD_REQUEST};var mlt=s(({repoURL:e,operation:t})=>({type:`https://zup.fail/source-control-repo-${t}-error`,title:`Failed on ${t} operation to repository '${e}'. Verify you have read & write access to the repository and try again.`,detail:"Verify your source control configuration and make sure you have been granted read & write access to the repository",status:T.HttpStatusCode.FORBIDDEN}),"SOURCE_CONTROL_REPO_OPERATION_ERROR");S.SOURCE_CONTROL_REPO_OPERATION_ERROR=mlt;S.SOURCE_CONTROL_REPO_WRITE_ACCESS_ISSUE={type:"https://zup.fail/source-control-write-access-issue",title:"You do not have write access to the repository, verify your source control access configuration and try again.",detail:"Verify your source control configuration and make sure you have been granted access to the repository",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_CONFIGURATION_NOT_FOUND={type:"https://zup.fail/source-control-configuration-not-found",title:"Source control configuration not found for this account.",status:T.HttpStatusCode.NOT_FOUND};S.SOURCE_CONTROL_CREDENTIALS_NOT_FOUND={type:"https://zup.fail/source-control-credentials-not-found",title:"Source control credentials not found for this user. Verify your user's source control connection and try again.",status:T.HttpStatusCode.NOT_FOUND};S.FAILED_TO_REFRESH_SOURCE_CONTROL_CREDENTIALS={type:"https://zup.fail/failed-to-refresh-source-control-credentials",title:"Failed to refresh Source Control credentials. Verify your user's source control connection and try again.",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED={type:"https://zup.fail/new-gh-config-required",title:"Current Source Control credentials are using the previous Zuplo GitHup App. Re-authenticate using the latest Zuplo GitHup App via Profile UI and try again.",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS={type:"https://zup.fail/gh-app-revoked-access",title:"Current Source Control credentials are invalid. Re-authenticate to GitHub via Profile UI and try again.",status:T.HttpStatusCode.UNAUTHORIZED};S.FAILED_TO_REVOKE_SOURCE_CONTROL_CREDENTIALS={type:"https://zup.fail/failed-to-revoke-source-control-credentials",title:"Failed to revoke Source Control access token for the user",status:T.HttpStatusCode.FORBIDDEN};S.SOURCE_CONTROL_CONFIGURATION_INFO_MISSING={type:"https://zup.fail/source-control-configuration-info-missing",title:"Source Control Configuration information is insufficient for this operation.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_CONFIGURATION_BITBUCKET_WORKSPACE_MISSING={type:"https://zup.fail/source-control-configuration-bb-workspace-missing",title:"Source Control Configuration for Bitbucket must include a workspace configuration (additionalMetadata).",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_HAS_PREEXISTING_SOURCE_CONTROL_CONFIGURATION={type:"https://zup.fail/preexisiting-source-control-configuration-on-account",title:"This account already has a Source Control Configuration for this provider.",detail:"This account has a pre-existing Source Control Configuration for this provider. Delete or update the existing configuration.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_INTEGRATION_BRANCH_BEHIND={type:"https://zup.fail/source-control-integration-branch-behind",title:"The current branch is behind, sync with remote repo for avoid conflicts.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_REMOTE_BRANCH_EXISTS={type:"https://zup.fail/source-control-integration-branch-behind",title:"The branch exists in the remote repository. Please try again with a different branch name.",status:T.HttpStatusCode.BAD_REQUEST};S.SOURCE_CONTROL_INTEGRATION_AUTHENTICATION_FAILED={type:"https://zup.fail/source-control-integration-authentication-failed",title:"Source control integration: Authentication failed",status:T.HttpStatusCode.FORBIDDEN};S.THIRD_PARTY_APP_AUTH0_CLIENTS_ENDPOINT_ERROR={type:"https://zup.fail/third-party-app-auth0-clients-endpoint-error",title:"Error Creating an Auth0 Client through tenant api",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.THIRD_PARTY_APP_AUTH0_CONFIG_DOES_NOT_EXIST={type:"https://zup.fail/third-party-app-auth0-config-does-not-exist",title:"Auth0 Configuration does not exist for account and environment",status:T.HttpStatusCode.NOT_FOUND};S.THIRD_PARTY_APP_AUTH0_CLIENT_NOT_FOUND_ERROR={type:"https://zup.fail/third-party-app-auth0-client-not-found-error",title:"Third Party App Not Found",status:T.HttpStatusCode.NOT_FOUND};S.THIRD_PARTY_APP_AUTH_SCOPE_CONFIG_ERROR={type:"https://zup.fail/third-party-app-auth-scope-config-error",title:"API Scope configuration at Auth0 end Error",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.THIRD_PARTY_APP_CONNECTIONS_NOT_FOUND={type:"https://zup.fail/third-party-app-connections-not-found",title:"Cannot find auth0 tenant connections",status:T.HttpStatusCode.FAILED_DEPENDENCY};S.THIRD_PARTY_APP_CONNECTION_NOT_FOUND={type:"https://zup.fail/third-party-app-connection-not-found",title:"Cannot find connection with the given name",status:T.HttpStatusCode.FAILED_DEPENDENCY};S.THIRD_PARTY_APP_CANNOT_LINK_TPA_TO_CONNECTION={type:"https://zup.fail/third-party-app-cannot-link-tpa-to-connection",title:"Cannot link a connection to a third party app",status:T.HttpStatusCode.FAILED_DEPENDENCY};S.DUPLICATE_ENVIRONMENT_VARIABLE={type:"https://zup.fail/duplicate-environment-variable",title:"Duplicate environment variable",status:T.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_VALIDATION_ERROR={type:"https://zup.fail/environment-variables-validation-error",title:"Environment variable configuration is invalid",status:T.HttpStatusCode.BAD_REQUEST};S.ENVIRONMENT_VARIABLE_INVALID_ENVIRONMENT_TYPE={type:"https://zup.fail/environment-variables-cannot-be-retrieved-invalid-env-type",title:"Env vars will not be retrieved since the deployment is from non valid environment type",status:T.HttpStatusCode.BAD_REQUEST};S.NON_EXISTENT_ENVIRONMENT_VARIABLE={type:"https://zup.fail/non-existent-environment-variable",title:"Environment variable doesn't exist",status:T.HttpStatusCode.NOT_FOUND};S.DEPLOYMENT_NAME_MISSING={type:"https://zup.fail/deployment-name-missing",title:"Deployment name missing",status:T.HttpStatusCode.BAD_REQUEST};S.INVALIDLY_NAMED_ENVIRONMENT_VARIABLE={type:"https://zup.fail/invalidly-named-environment-variable",title:"Environment variable needs a valid name",status:T.HttpStatusCode.BAD_REQUEST};S.PERSONAL_OVERRIDE_ONLY_FOR_WORKING_COPY={type:"https://zup.fail/personal-override-only-for-working-copy",title:"A personal override can only be used for a working-copy environment variable",status:T.HttpStatusCode.BAD_REQUEST};S.TARGET_BRANCH_ONLY_FOR_PREVIEW={type:"https://zup.fail/target-branch-only-for-preview",title:"A target branch can only be used for preview environment variables",status:T.HttpStatusCode.BAD_REQUEST};S.ENV_VAR_MAX_SIZE_LIMIT={type:"https://zup.fail/environment-variable-maximum-size-limit",title:"Environment variables cannot exceed 5KB in size",status:T.HttpStatusCode.BAD_REQUEST};S.INVALID_BRANCH_NAME={type:"https://zup.fail/invalid-branch-name",title:"Branch name is invalid",status:T.HttpStatusCode.BAD_REQUEST};S.OVERLAPPING_TARGETS={type:"https://zup.fail/overlapping-targets",title:"The environments of this environment variable overlaps with an existing environment variable",status:T.HttpStatusCode.BAD_REQUEST};S.CONFLICTING_TYPES={type:"https://zup.fail/conflicting-types",title:"The type of this environment variable conflicts with an existing environment variable with the same name",status:T.HttpStatusCode.BAD_REQUEST};S.NON_EMPTY_TARGETS_REQUIRED={type:"https://zup.fail/non-empty-targets-required",title:"The environment targets for this environment variable cannot be empty.",status:T.HttpStatusCode.BAD_REQUEST};S.NO_ZUPLO_PREFIXED_VARIABLES={type:"https://zup.fail/no-zuplo-prefixed-variables",title:"Environment variables should not start with the reserved prefix of ZUPLO or __ZUPLO",status:T.HttpStatusCode.BAD_REQUEST};S.NO_GLOBAL_SYMBOLS={type:"https://zup.fail/no-global-symbols",title:"Environment variables cannot be named after global variables.",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYER_NON_VALID_DEPLOYMENT_ENVIRONMENT_TYPE={type:"https://zup.fail/deployer-non-valid-deployment-environment-type",title:"Deployment cannot be different than preview or production",status:T.HttpStatusCode.BAD_REQUEST};S.DEPLOYER_CANNOT_DEPLOY_USING_ENV_VARS_V2={type:"https://zup.fail/deployer-cannot-deploy-using-env-vars-v2",title:"Deployer was not able to deploy zup using environment variables v2",status:T.HttpStatusCode.FORBIDDEN};S.DELETING_ZUPLO_ENVIRONMENT_VARIABLES_ERROR={type:"https://zup.fail/deleting-zuplo-environment-variables-error",title:"Problems deleting ZUPLO environment variables for deployment",status:T.HttpStatusCode.NOT_FOUND};var _lt=s(({operation:e,path:t})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify file on read-only environment",detail:`Cannot ${e} file ${t} for a read-only environment. Read-only environments cannot be edited.`,status:T.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_MODIFY_FILE_ON_READ_ONLY_ENVIRONMENT=_lt;var glt=s(()=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot modify files on read-only environment",detail:"Cannot save files on a read-only environment. Read-only environments cannot be edited.",status:T.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_SAVE_FILES_ON_READ_ONLY_ENVIRONMENT=glt;S.MIGRATIONS_ONLY_ON_WORKING_COPY={type:"https://zup.fail/migration-only-on-working-copy",title:"Migrations can only run on working copies.",status:T.HttpStatusCode.BAD_REQUEST};S.RUNTIME_VERSION_INCORRECT_FORMAT={type:"https://zup.fail/migration-incorrect-runtime-version-format",title:"Runtime version is in an incorrect format.",status:T.HttpStatusCode.BAD_REQUEST};S.PACKAGE_JSON_NOT_FOUND={type:"https://zup.fail/no-pkg-file-found",title:"No package.json file found.",status:T.HttpStatusCode.NOT_FOUND};S.CANNOT_READ_PACKAGE_JSON={type:"https://zup.fail/cannot-read-pkg-file",title:"Cannot read package.json file.",status:T.HttpStatusCode.BAD_REQUEST};S.CANNOT_FIND_SRC_DIRECTORY={type:"https://zup.fail/cannot-find-src-dir",title:"Cannot find source directory.",status:T.HttpStatusCode.BAD_REQUEST};S.FAILED_DOWNLOAD_FROM_STORAGE={type:"https://zup.fail/failed-download-storage",title:"Failed to download content from storage.",status:T.HttpStatusCode.BAD_REQUEST};var ylt=s(({path:e})=>({type:"https://zup.fail/cannot-modify-file-on-read-only-environment",title:"Cannot create directory on read-only environment",detail:`Cannot create folder ${e} for a read-only environment. Read-only environments cannot be edited.`,status:T.HttpStatusCode.METHOD_NOT_ALLOWED}),"CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT");S.CANNOT_CREATE_DIRECTORY_ON_READ_ONLY_ENVIRONMENT=ylt;var Elt=s(({path:e})=>({type:"https://zup.fail/directory-creation-in-non-allowed-location",title:"Directory creation attempted in non allowed location",detail:`Directory creation in ${e} is not allowed.`,instance:e,status:T.HttpStatusCode.BAD_REQUEST}),"CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION");S.CANNOT_CREATE_DIRECTORY_IN_NON_ALLOWED_LOCATION=Elt;var blt=s(({path:e})=>({type:"https://zup.fail/directory-already-exists",title:"Directory already exists",status:T.HttpStatusCode.BAD_REQUEST,detail:`Directory already exists at ${e}.`}),"DIRECTORY_ALREADY_EXISTS");S.DIRECTORY_ALREADY_EXISTS=blt;var Slt=s(({path:e})=>({type:"https://zup.fail/directory-does-not-exist",title:"Directory does not exist",status:T.HttpStatusCode.BAD_REQUEST,detail:`No directory at ${e}`}),"DIRECTORY_DOES_NOT_EXIST");S.DIRECTORY_DOES_NOT_EXIST=Slt;var Olt=s(({path:e})=>({type:"https://zup.fail/directory-or-file-does-not-exist",title:"Directory or File does not exist",status:T.HttpStatusCode.BAD_REQUEST,detail:`No file/directory at ${e}`}),"DIRECTORY_OR_FILE_DOES_NOT_EXIST");S.DIRECTORY_OR_FILE_DOES_NOT_EXIST=Olt;var vlt=s(({path:e})=>({type:"https://zup.fail/directory-creation-failure",title:"Directory creation failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to create directory at ${e}. Please try again or contact support.`}),"DIRECTORY_CREATION_FAILED");S.DIRECTORY_CREATION_FAILED=vlt;var Ilt=s(({path:e})=>({type:"https://zup.fail/file-rename-paths-match",title:"New file name matches old file name",status:T.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the old path ${e} matched the provided new path. Please choose a different name.`}),"FILE_RENAME_PATHS_MATCH");S.FILE_RENAME_PATHS_MATCH=Ilt;var Plt=s(({oldExtension:e,newExtension:t})=>({type:"https://zup.fail/file-rename-cannot-change-extension",title:"Cannot change extension of renamed file",status:T.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, the new extension ${t} must match the old extension ${e}.`}),"FILE_RENAME_CANNOT_CHANGE_EXTENSION");S.FILE_RENAME_CANNOT_CHANGE_EXTENSION=Plt;var wlt=s(({path:e})=>({type:"https://zup.fail/file-rename-file-exists",title:"File already exists",status:T.HttpStatusCode.BAD_REQUEST,detail:`Failed to rename file, there already exists a file at ${e}. Please choose a different name.`}),"FILE_RENAME_FILE_ALREADY_EXISTS");S.FILE_RENAME_FILE_ALREADY_EXISTS=wlt;var Tlt=s(({path:e})=>({type:"https://zup.fail/file-rename-failure",title:"File rename failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to rename file ${e}. Please try again or contact support.`}),"FILE_RENAME_FAILED");S.FILE_RENAME_FAILED=Tlt;var Nlt=s(({path:e})=>({type:"https://zup.fail/file-write-failure",title:"File write failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to write file ${e}. Please try again or contact support.`}),"FILE_WRITE_FAILED");S.FILE_WRITE_FAILED=Nlt;var Alt=s(({path:e})=>({type:"https://zup.fail/essential-file-deletion",title:"Cannot delete essential file",status:T.HttpStatusCode.BAD_REQUEST,detail:`File '${e}' cannot be deleted. It is an essential file.`}),"CANNOT_DELETE_ESSENTIAL_FILE");S.CANNOT_DELETE_ESSENTIAL_FILE=Alt;var Rlt=s(({path:e})=>({type:"https://zup.fail/essential-directory-deletion",title:"Cannot delete essential file",status:T.HttpStatusCode.BAD_REQUEST,detail:`Directory '${e}' cannot be deleted. It is an essential directory.`}),"CANNOT_DELETE_ESSENTIAL_DIRECTORY");S.CANNOT_DELETE_ESSENTIAL_DIRECTORY=Rlt;var Clt=s(()=>({type:"https://zup.fail/sole-open-api-file-deletion",title:"Cannot delete sole OpenAPI file",status:T.HttpStatusCode.BAD_REQUEST,detail:"Your project must have at least 1 OpenAPI file."}),"CANNOT_DELETE_SOLE_OPEN_API_FILE");S.CANNOT_DELETE_SOLE_OPEN_API_FILE=Clt;var $lt=s(({path:e})=>({type:"https://zup.fail/file-delete-failure",title:"File deletion failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete file ${e}. Please try again or contact support.`}),"FILE_DELETE_FAILED");S.FILE_DELETE_FAILED=$lt;var Dlt=s(({path:e})=>({type:"https://zup.fail/directory-delete-failure",title:"Directory deletion failed",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR,detail:`Failed to delete directory ${e}. Please try again or contact support.`}),"DIRECTORY_DELETE_FAILED");S.DIRECTORY_DELETE_FAILED=Dlt;S.BUCKET_API_KEY_SERVICE_CONFLICT={type:"https://zup.fail/bucket-api-key-service-error",title:"Bucket name conflicts",status:T.HttpStatusCode.CONFLICT};S.BUCKET_NOT_FOUND={type:"https://zup.fail/bucket-not-found",title:"Bucket cannot be found",status:T.HttpStatusCode.NOT_FOUND};S.UNABLE_UPGRADE_PLAN={type:"https://zup.fail/cant-upgrade-plan",title:"Can't upgrade to selected plan",status:T.HttpStatusCode.BAD_REQUEST};S.METERING_BUCKET_CREATION_FAILED={type:"https://zup.fail/metering-bucket-creation-failed",title:"Failed to create metering buckets for project",status:T.HttpStatusCode.INTERNAL_SERVER_ERROR};S.ACCOUNT_RBAC_DISABLED={type:"https://zup.fail/account_rbac_disabled",title:"Forbidden",detail:"Your account does not have fine-grained RBAC feature enabled. Please contact support to enable this feature.",status:T.HttpStatusCode.FORBIDDEN};S.RBAC_INVALID_EXPIRATION_DATE={type:"https://zup.fail/rbac_invalid_expiration_date",title:"Bad Request",detail:"The expiration date provided cannot be in the past. Please provide a valid expiration date.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_DOES_NOT_EXISTS={type:"https://zup.fail/rbacconfiguration-does-not-exists",title:"Bad Request",detail:"The api key configuration does not exist or you don't have access to it.",status:T.HttpStatusCode.NOT_FOUND};S.RBACCONFIGURATION_REQUIRE_ENVIRONMENTS={type:"https://zup.fail/rbacconfiguration-required-environments",title:"Bad Request",detail:"Please provide at least one environment value. Valid options include 'production', 'preview' and 'development'.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_ENVIRONMENTS={type:"https://zup.fail/rbacconfiguration-invalid-environments",title:"Bad Request",detail:"Please provide at least one environment value. Valid options include 'production', 'preview' and 'development'.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_REQUIRE_PROJECTS={type:"https://zup.fail/rbacconfiguration-required-projects",title:"Bad Request",detail:"Please provide at least one project to configure access for.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_ACCOUNT_HAS_NO_PROJECTS={type:"https://zup.fail/rbacconfiguration-no-projects",title:"Bad Request",detail:"The account does not have any projects to configure. Please create at least one project before configuring api key access.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_PROJECT_PROVIDED={type:"https://zup.fail/rbacconfiguration-invalid-project",title:"Bad Request",detail:"One or more of the projects provided is not part of the account or does not exist. Make sure all the projects are valid and try again.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_INVALID_OPENFGA_CONFIG={type:"https://zup.fail/rbacconfiguration-invalid-openfga-config",title:"Bad Gateway",detail:"The provided configuration caused an unexpected error. Please contact support.",status:T.HttpStatusCode.BAD_GATEWAY};S.RBACCONFIGURATION_DELETE_MISCONFIGURATION={type:"https://zup.fail/rbacconfiguration-delete-misconfiguration",title:"Bad Request",detail:"The provided configuration was not correctly created and cannot be deleted. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_MISCONFIGURATION={type:"https://zup.fail/rbacconfiguration-misconfiguration",title:"Bad Request",detail:"The provided configuration was not correctly created and cannot be used. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.RBACCONFIGURATION_CONSUMER_LOCKED={type:"https://zup.fail/rbacconfiguration-consumer-locked",title:"Forbidden",detail:"The provided consumer is locked and can't be modified or deleted.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_ACCESS_TO_CONSUMER={type:"https://zup.fail/forbidden",title:"Forbidden",detail:"You are not authorized to access the consumer resource.",status:T.HttpStatusCode.FORBIDDEN};S.INVALID_USER_ROLE={type:"https://zup.fail/invalid-user-role",title:"Bad Request",detail:"You provided an invalid user role. Valid options include 'admin', 'developer' and 'member'.",status:T.HttpStatusCode.BAD_REQUEST};S.USER_DOES_NOT_EXIST={type:"https://zup.fail/user-does-not-exist",title:"Forbidden",detail:"You are not authorized to access the user resource.",status:T.HttpStatusCode.FORBIDDEN};S.USER_CANNOT_EDIT_OWN_ROLE={type:"https://zup.fail/user-edit-itself",title:"Forbidden",detail:"You are not authorized to edit your own access role.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_ACCESS_TO_PROJECT_ENVIRONMENT={type:"https://zup.fail/user-has-no-access-to-project-env",title:"Forbidden",detail:"You are not authorized to access this project environment.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_DEPLOY_ACCESS_TO_PROJECT_ENVIRONMENT={type:"https://zup.fail/user-has-no-deploy-access-to-project-env",title:"Forbidden",detail:"You are not authorized to access to deploy this project environment.",status:T.HttpStatusCode.FORBIDDEN};S.ACCOUNT_ADMIN_INVALID_PROJECT_ROLE_DOWNGRADE={type:"https://zup.fail/account-admin-invalid-project-role-downgrade",title:"Bad Request",detail:"An account administrator cannot be downgraded to a non-administrator role in a project.",status:T.HttpStatusCode.BAD_REQUEST};S.USER_HAS_NO_PROD_ENV_VAR_ACCESS={type:"https://zup.fail/user-no-prod-env-var-access",title:"Forbidden",detail:"You are not authorized to modify or create the project's production environment variables.",status:T.HttpStatusCode.FORBIDDEN};S.USER_HAS_NO_DEVELOPER_ENV_VAR_ACCESS={type:"https://zup.fail/user-no-dev-env-var-access",title:"Forbidden",detail:"You are not authorized to modify or create the project's preview and development environment variables.",status:T.HttpStatusCode.FORBIDDEN};S.MISCONFIGURED_ENV_VAR={type:"https://zup.fail/misconfigured-env-var",title:"Bad Request",detail:"The environment variable is not correctly configured on any environment. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_ALREADY_RBAC_ENABLED={type:"https://zup.fail/misconfigured-env-var",title:"Bad Request",detail:"The account has been previously migrated to use RBAC.",status:T.HttpStatusCode.BAD_REQUEST};S.ACCOUNT_MISCONFIGURED_FOR_RBAC={type:"https://zup.fail/misconfigured-env-var",title:"Bad Request",detail:"This account has conflicting account roles and cannot be self-migrated to use RBAC. Please contact support.",status:T.HttpStatusCode.BAD_REQUEST}});var Tae=h(wi=>{"use strict";var Llt=wi&&wi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return t[r]},"get")}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),jlt=wi&&wi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Mlt=wi&&wi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Llt(t,e,r);return jlt(t,e),t};Object.defineProperty(wi,"__esModule",{value:!0});wi.ApiNotFoundError=wi.ApiError=wi.Problems=void 0;var wae=Mlt(Pae());wi.Problems=wae;var T1=class extends Error{static{s(this,"ApiError")}type;status;detail;instance;constructor(t){if(super(t.title),!t.type.startsWith("https://zup.fail/"))throw new Error(`Invalid 'type' specified on ApiError, must be a URI starting with 'https://zup.fail/'. Type was set to ${t.type}`);this.name="ApiProblemError",this.type=t.type,this.status=t.status,this.detail=t.detail,this.instance=t.instance}};wi.ApiError=T1;var rB=class extends T1{static{s(this,"ApiNotFoundError")}constructor(t={}){super({...t,...wae.NOT_FOUND}),this.name="ApiNotFoundProblemError"}};wi.ApiNotFoundError=rB});var Nae=h(Pu=>{"use strict";var Ult=Pu&&Pu.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return t[r]},"get")}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),xlt=Pu&&Pu.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Ult(t,e,r)};Object.defineProperty(Pu,"__esModule",{value:!0});Pu.HttpStatusCode=void 0;xlt(Tae(),Pu);var qlt=tB();Object.defineProperty(Pu,"HttpStatusCode",{enumerable:!0,get:s(function(){return qlt.HttpStatusCode},"get")})});var Rae=h((Q2t,Aae)=>{"use strict";function Flt(e){return e>=55296&&e<=56319}s(Flt,"isHighSurrogate");function Blt(e){return e>=56320&&e<=57343}s(Blt,"isLowSurrogate");Aae.exports=s(function(t,r,n){if(typeof r!="string")throw new Error("Input must be string");for(var i=r.length,o=0,a,u,c=0;c<i;c+=1){if(a=r.charCodeAt(c),u=r[c],Flt(a)&&Blt(r.charCodeAt(c+1))&&(c+=1,u+=r[c]),o+=t(u),o===n)return r.slice(0,c+1);if(o>n)return r.slice(0,c-u.length+1)}return r},"truncate")});var $ae=h((tBt,Cae)=>{"use strict";var klt=Rae(),Glt=Buffer.byteLength.bind(Buffer);Cae.exports=klt.bind(null,Glt)});var nB=h(Jm=>{"use strict";var Vlt=Jm&&Jm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jm,"__esModule",{value:!0});Jm.sanitize=void 0;var Hlt=Vlt($ae()),zlt=/[/?<>\\:*|"]/g,Klt=/[\x00-\x1f\x80-\x9f]/g,Wlt=/^\.+$/,Ylt=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,Jlt=/[. ]+$/;function Xlt(e,t=""){if(typeof e!="string")throw new Error("Input must be string");let r=e.replace(zlt,t).replace(Klt,t).replace(Wlt,t).replace(Ylt,t).replace(Jlt,t);return(0,Hlt.default)(r,255)}s(Xlt,"sanitize");Jm.sanitize=Xlt});var Mae=h(Xm=>{"use strict";var jae=Xm&&Xm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xm,"__esModule",{value:!0});Xm.createProjectDirs=void 0;var Dae=jae(require("fs/promises")),Zlt=jae(require("path")),WE=Bt(),Lae=rc(),Qlt=s(async function({sourceDirectory:e,logger:t}){t.debug("Creating project directories");let r=[WE.USER_MODULES_DIR_NAME,WE.USER_CONFIG_DIR_NAME,WE.USER_TEST_DIR_NAME,WE.USER_SCHEMAS_DIR_NAME,WE.USER_DOCS_DIR_NAME,".vscode"];try{await Dae.default.mkdir(e);for(let n of r)await Dae.default.mkdir(Zlt.default.join(e,n),{recursive:!0})}catch(n){return t.error(n),new Lae.PluginResult({message:`Cannot create project directory tree at ${e}`,pluginName:"create-project-dirs",severity:"error"})}return new Lae.PluginResult},"createProjectDirs");Xm.createProjectDirs=Qlt});var Fae=h(Zm=>{"use strict";var qae=Zm&&Zm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zm,"__esModule",{value:!0});Zm.generateFromTemplate=void 0;var eft=require("fs"),Uae=qae(require("fs/promises")),xae=qae(require("path"));async function tft(e){let t=xae.default.resolve(__dirname,"..","templates",e);if((0,eft.existsSync)(t))return await Uae.default.readFile(t,"utf-8");{let r=xae.default.resolve(__dirname,"templates",e);return await Uae.default.readFile(r,"utf-8")}}s(tft,"generateFromTemplate");Zm.generateFromTemplate=tft});var Ti=h(Qm=>{"use strict";var N1=Qm&&Qm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qm,"__esModule",{value:!0});Qm.generateFileFromTemplate=void 0;var rft=N1(gn()),nft=N1(require("fs/promises")),ift=N1(require("path")),sft=N1(_n()),oft=Fae(),aft=s(function(e,t){return async({sourceDirectory:r,logger:n})=>sft.default.timeFn(`Generating ${e}`,async()=>{n.debug(`Generating ${e}`);let i=ift.default.join(r,e);return await rft.default.fileExists(i)?(n.debug({sourceDirectory:r},`${e} already exists, skipping`),{warnings:[],errors:[]}):uft(i,t,n)})},"generateFileFromTemplate");Qm.generateFileFromTemplate=aft;async function uft(e,t,r){let n=await(0,oft.generateFromTemplate)(t);try{await nft.default.writeFile(e,n,"utf-8"),r.debug(`File written to ${e}`)}catch(i){r.error(i);let o={message:`Error creating file at ${e}`,pluginName:"generate-file",severity:"error"};return{warnings:[],errors:[o]}}return{warnings:[],errors:[]}}s(uft,"writeTemplate")});var kae=h(e_=>{"use strict";var cft=e_&&e_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e_,"__esModule",{value:!0});e_.generateDefaultDocsMarkdown=void 0;var lft=cft(require("path")),Bae=Bt(),fft=Ti();e_.generateDefaultDocsMarkdown=(0,fft.generateFileFromTemplate)(lft.default.join(Bae.USER_DOCS_DIR_NAME,Bae.DEFAULT_DOCS_MARKDOWN_FILE),"markdown.template.md")});var Vae=h(t_=>{"use strict";var dft=t_&&t_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t_,"__esModule",{value:!0});t_.generateDefaultDocsSidebar=void 0;var pft=dft(require("path")),Gae=Bt(),hft=Ti();t_.generateDefaultDocsSidebar=(0,hft.generateFileFromTemplate)(pft.default.join(Gae.USER_DOCS_DIR_NAME,Gae.DOCS_SIDEBAR_FILE),"sidebar.template.json")});var zae=h(r_=>{"use strict";var mft=r_&&r_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r_,"__esModule",{value:!0});r_.generateDefaultDocsTheme=void 0;var _ft=mft(require("path")),Hae=Bt(),gft=Ti();r_.generateDefaultDocsTheme=(0,gft.generateFileFromTemplate)(_ft.default.join(Hae.USER_DOCS_DIR_NAME,Hae.DOCS_THEME_FILE),"dev-portal.theme.template.css")});var Wae=h(n_=>{"use strict";var yft=n_&&n_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n_,"__esModule",{value:!0});n_.generateDefaultModule=void 0;var Eft=yft(require("path")),Kae=Bt(),bft=Ti();n_.generateDefaultModule=(0,bft.generateFileFromTemplate)(Eft.default.join(Kae.USER_MODULES_DIR_NAME,Kae.DEFAULT_MODULE_FILE),"hello-world.template.ts")});var Jae=h(i_=>{"use strict";var Sft=i_&&i_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i_,"__esModule",{value:!0});i_.generateDevPortalConfigJson=void 0;var Oft=Sft(require("path")),Yae=Bt(),vft=Ti();i_.generateDevPortalConfigJson=(0,vft.generateFileFromTemplate)(Oft.default.join(Yae.USER_CONFIG_DIR_NAME,Yae.DEV_PORTAL_CONFIG_FILE),"dev-portal.template.json")});var Xae=h(A1=>{"use strict";Object.defineProperty(A1,"__esModule",{value:!0});A1.generateEnvironment=void 0;var Ift=Ti();A1.generateEnvironment=(0,Ift.generateFileFromTemplate)(".env","env.template")});var Zae=h(R1=>{"use strict";Object.defineProperty(R1,"__esModule",{value:!0});R1.generateESLint=void 0;var Pft=Ti();R1.generateESLint=(0,Pft.generateFileFromTemplate)(".eslintrc.js","eslintrc.template.js")});var Qae=h(C1=>{"use strict";Object.defineProperty(C1,"__esModule",{value:!0});C1.generateGitignore=void 0;var wft=Ti();C1.generateGitignore=(0,wft.generateFileFromTemplate)(".gitignore","gitignore.template.ignore")});var eue=h(s_=>{"use strict";var Tft=s_&&s_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s_,"__esModule",{value:!0});s_.generateLaunchJson=void 0;var Nft=Tft(require("path")),Aft=Ti();s_.generateLaunchJson=(0,Aft.generateFileFromTemplate)(Nft.default.join(".vscode","launch.json"),"launch.template.jsonc")});var rue=h(o_=>{"use strict";var Rft=o_&&o_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o_,"__esModule",{value:!0});o_.generateRouteOasConfig=void 0;var Cft=Rft(require("path")),tue=Bt(),$ft=Ti();o_.generateRouteOasConfig=(0,$ft.generateFileFromTemplate)(Cft.default.join(tue.USER_CONFIG_DIR_NAME,tue.ROUTES_OAS_CONFIG_FILE),"routes.oas.template.json")});var sue=h(qs=>{"use strict";var iB=qs&&qs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qs,"__esModule",{value:!0});qs.updateProjectPackageJson=qs.getProjectPackageJson=qs.getPackageOverrides=qs.generateDefaultPackageJson=void 0;var nue=iB(require("fs/promises")),sB=iB(require("path")),Dft=iB(Xs());async function Lft(e,t=Dft.default.USE_MONOREPO_PACKAGES){let r={name:e,version:"1.0.0",author:"",copyright:"",scripts:{dev:"zup dev",test:"zup test"},dependencies:{zuplo:"latest"}};if(t){let n=iue();r.overrides=n,r.dependencies["@zuplo/runtime"]=n["@zuplo/runtime"],r.devDependencies&&"@zuplo/core"in r.devDependencies&&(r.devDependencies["@zuplo/core"]=n["@zuplo/core"]),"@zuplo/core"in r.dependencies&&(r.dependencies["@zuplo/core"]=n["@zuplo/core"])}return r}s(Lft,"generateDefaultPackageJson");qs.generateDefaultPackageJson=Lft;function iue(){let e=sB.default.resolve(__dirname,"..","..");return{"@zuplo/core":`file:${e}/core`,"@zuplo/runtime":`file:${e}/runtime`,"@zuplo/debug":`file:${e}/debug`,"@zuplo/errors":`file:${e}/errors`}}s(iue,"getPackageOverrides");qs.getPackageOverrides=iue;async function jft(e){let t=sB.default.join(e,"package.json"),r=await nue.default.readFile(t,"utf-8");return JSON.parse(r)}s(jft,"getProjectPackageJson");qs.getProjectPackageJson=jft;async function Mft(e,t){let r=sB.default.join(e,"package.json"),n=JSON.stringify(t,void 0,2);await nue.default.writeFile(r,n,"utf-8")}s(Mft,"updateProjectPackageJson");qs.updateProjectPackageJson=Mft});var uue=h($1=>{"use strict";Object.defineProperty($1,"__esModule",{value:!0});$1.generatePackageJson=void 0;var oue=sue(),aue=rc(),Uft=s(async function({sourceDirectory:e,name:t,logger:r}){let n=await(0,oue.generateDefaultPackageJson)(t);try{await(0,oue.updateProjectPackageJson)(e,n)}catch(i){return r.error(i),new aue.PluginResult({message:"Error creating package.json",pluginName:"generate-package-json",severity:"error"})}return new aue.PluginResult},"generatePackageJson");$1.generatePackageJson=Uft});var lue=h(a_=>{"use strict";var xft=a_&&a_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a_,"__esModule",{value:!0});a_.generatePoliciesConfig=void 0;var qft=xft(require("path")),cue=Bt(),Fft=Ti();a_.generatePoliciesConfig=(0,Fft.generateFileFromTemplate)(qft.default.join(cue.USER_CONFIG_DIR_NAME,cue.POLICIES_CONFIG_FILE),"policies.template.json")});var fue=h(u_=>{"use strict";var Bft=u_&&u_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(u_,"__esModule",{value:!0});u_.generateSettingsJson=void 0;var kft=Bft(require("path")),Gft=Ti();u_.generateSettingsJson=(0,Gft.generateFileFromTemplate)(kft.default.join(".vscode","settings.json"),"settings.template.jsonc")});var due=h(D1=>{"use strict";Object.defineProperty(D1,"__esModule",{value:!0});D1.generateTSConfig=void 0;var Vft=Ti();D1.generateTSConfig=(0,Vft.generateFileFromTemplate)("tsconfig.json","tsconfig.template.json")});var hue=h(c_=>{"use strict";var Hft=c_&&c_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(c_,"__esModule",{value:!0});c_.generateZuploJson=void 0;var zft=Yo(),Kft=require("fs/promises"),Wft=Hft(require("path")),Yft=Bt(),pue=rc(),Jft=s(async function({name:e,sourceDirectory:t,logger:r}){let n={version:1,project:e,compatibilityDate:zft.DEFAULT_COMPATIBILITY_DATE},i=Wft.default.join(t,Yft.ZUPLO_PREFERRED_JSON_FILE),o=JSON.stringify(n,null,2);try{await(0,Kft.writeFile)(i,o,"utf-8")}catch(a){return r.error(a),new pue.PluginResult({message:"Error creating zuplo.jsonc",pluginName:"generate-zuplo-json",severity:"error"})}return new pue.PluginResult},"generateZuploJson");c_.generateZuploJson=Jft});var yue=h(l_=>{"use strict";var gue=l_&&l_.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l_,"__esModule",{value:!0});l_.create=void 0;var mue=Nae(),Xft=gue(gn()),Zft=require("fs/promises"),Qft=gue(require("path")),edt=rc(),_ue=nB(),tdt=Mae(),rdt=kae(),ndt=Vae(),idt=zae(),sdt=Wae(),odt=Jae(),adt=Xae(),udt=Zae(),cdt=Qae(),ldt=eue(),fdt=rue(),ddt=uue(),pdt=lue(),hdt=fue(),mdt=due(),_dt=hue();async function gdt({name:e,accountName:t="",rootDirectory:r,logger:n}){let i=(0,_ue.sanitize)(e),o=(0,_ue.sanitize)(t),a=Qft.default.join(r,o,i),u={name:e,sourceDirectory:a,logger:n},c=[];if(await Xft.default.dirExists(a))throw new mue.ApiError({type:"https://zup.fail/project-already-exists-at-directory",title:"The project already exists in the specified directory",status:mue.HttpStatusCode.BAD_REQUEST,detail:`Project already exists at ${a}`});c.push(tdt.createProjectDirs,fdt.generateRouteOasConfig,_dt.generateZuploJson,odt.generateDevPortalConfigJson,sdt.generateDefaultModule,ndt.generateDefaultDocsSidebar,rdt.generateDefaultDocsMarkdown,idt.generateDefaultDocsTheme,pdt.generatePoliciesConfig),c.push(mdt.generateTSConfig,cdt.generateGitignore,ddt.generatePackageJson,adt.generateEnvironment,udt.generateESLint,ldt.generateLaunchJson,hdt.generateSettingsJson);let{errors:l,warnings:f}=await(0,edt.runPlugins)(c,u);if(f.length>0&&f.forEach(_=>{n.warn(_)}),l.length>0){await(0,Zft.rm)(a,{recursive:!0,force:!0});let _=l[0];throw _ instanceof Error?_:new Error(_.message)}return{sourceDirectory:a,projectName:e}}s(gdt,"create");l_.create=gdt});var Eue=h(oB=>{"use strict";Object.defineProperty(oB,"__esModule",{value:!0});function ydt(e){if(e.length>=255)throw new TypeError("Alphabet too long");let t=new Uint8Array(256);for(let l=0;l<t.length;l++)t[l]=255;for(let l=0;l<e.length;l++){let f=e.charAt(l),d=f.charCodeAt(0);if(t[d]!==255)throw new TypeError(f+" is ambiguous");t[d]=l}let r=e.length,n=e.charAt(0),i=Math.log(r)/Math.log(256),o=Math.log(256)/Math.log(r);function a(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";let f=0,d=0,_=0,m=l.length;for(;_!==m&&l[_]===0;)_++,f++;let g=(m-_)*o+1>>>0,y=new Uint8Array(g);for(;_!==m;){let O=l[_],v=0;for(let P=g-1;(O!==0||v<d)&&P!==-1;P--,v++)O+=256*y[P]>>>0,y[P]=O%r>>>0,O=O/r>>>0;if(O!==0)throw new Error("Non-zero carry");d=v,_++}let b=g-d;for(;b!==g&&y[b]===0;)b++;let E=n.repeat(f);for(;b<g;++b)E+=e.charAt(y[b]);return E}s(a,"encode");function u(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;let f=0,d=0,_=0;for(;l[f]===n;)d++,f++;let m=(l.length-f)*i+1>>>0,g=new Uint8Array(m);for(;l[f];){let O=t[l.charCodeAt(f)];if(O===255)return;let v=0;for(let P=m-1;(O!==0||v<_)&&P!==-1;P--,v++)O+=r*g[P]>>>0,g[P]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");_=v,f++}let y=m-_;for(;y!==m&&g[y]===0;)y++;let b=new Uint8Array(d+(m-y)),E=d;for(;y!==m;)b[E++]=g[y++];return b}s(u,"decodeUnsafe");function c(l){let f=u(l);if(f)return f;throw new Error("Non-base"+r+" character")}return s(c,"decode"),{encode:a,decodeUnsafe:u,decode:c}}s(ydt,"base");oB.default=ydt});var bue=h(YE=>{"use strict";var Edt=YE&&YE.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(YE,"__esModule",{value:!0});var bdt=Edt(Eue()),Sdt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";YE.default=(0,bdt.default)(Sdt)});var Pue=h((LBt,Iue)=>{Iue.exports=vue;vue.sync=vdt;var Sue=require("fs");function Odt(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}s(Odt,"checkPathExt");function Oue(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:Odt(t,r)}s(Oue,"checkStat");function vue(e,t,r){Sue.stat(e,function(n,i){r(n,n?!1:Oue(i,e,t))})}s(vue,"isexe");function vdt(e,t){return Oue(Sue.statSync(e),e,t)}s(vdt,"sync")});var Rue=h((MBt,Aue)=>{Aue.exports=Tue;Tue.sync=Idt;var wue=require("fs");function Tue(e,t,r){wue.stat(e,function(n,i){r(n,n?!1:Nue(i,t))})}s(Tue,"isexe");function Idt(e,t){return Nue(wue.statSync(e),t)}s(Idt,"sync");function Nue(e,t){return e.isFile()&&Pdt(e,t)}s(Nue,"checkStat");function Pdt(e,t){var r=e.mode,n=e.uid,i=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),a=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),u=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),f=u|c,d=r&l||r&c&&i===a||r&u&&n===o||r&f&&o===0;return d}s(Pdt,"checkMode")});var $ue=h((qBt,Cue)=>{var xBt=require("fs"),L1;process.platform==="win32"||global.TESTING_WINDOWS?L1=Pue():L1=Rue();Cue.exports=aB;aB.sync=wdt;function aB(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){aB(e,t||{},function(o,a){o?i(o):n(a)})})}L1(e,t||{},function(n,i){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,i=!1),r(n,i)})}s(aB,"isexe");function wdt(e,t){try{return L1.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}s(wdt,"sync")});var que=h((BBt,xue)=>{var f_=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Due=require("path"),Tdt=f_?";":":",Lue=$ue(),jue=s(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),Mue=s((e,t)=>{let r=t.colon||Tdt,n=e.match(/\//)||f_&&e.match(/\\/)?[""]:[...f_?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],i=f_?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=f_?i.split(r):[""];return f_&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},"getPathInfo"),Uue=s((e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:o}=Mue(e,t),a=[],u=s(l=>new Promise((f,d)=>{if(l===n.length)return t.all&&a.length?f(a):d(jue(e));let _=n[l],m=/^".*"$/.test(_)?_.slice(1,-1):_,g=Due.join(m,e),y=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;f(c(y,l,0))}),"step"),c=s((l,f,d)=>new Promise((_,m)=>{if(d===i.length)return _(u(f+1));let g=i[d];Lue(l+g,{pathExt:o},(y,b)=>{if(!y&&b)if(t.all)a.push(l+g);else return _(l+g);return _(c(l,f,d+1))})}),"subStep");return r?u(0).then(l=>r(null,l),r):u(0)},"which"),Ndt=s((e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=Mue(e,t),o=[];for(let a=0;a<r.length;a++){let u=r[a],c=/^".*"$/.test(u)?u.slice(1,-1):u,l=Due.join(c,e),f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let d=0;d<n.length;d++){let _=f+n[d];try{if(Lue.sync(_,{pathExt:i}))if(t.all)o.push(_);else return _}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw jue(e)},"whichSync");xue.exports=Uue;Uue.sync=Ndt});var cB=h((GBt,uB)=>{"use strict";var Fue=s((e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");uB.exports=Fue;uB.exports.default=Fue});var Vue=h((HBt,Gue)=>{"use strict";var Bue=require("path"),Adt=que(),Rdt=cB();function kue(e,t){let r=e.options.env||process.env,n=process.cwd(),i=e.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let a;try{a=Adt.sync(e.command,{path:r[Rdt({env:r})],pathExt:t?Bue.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return a&&(a=Bue.resolve(i?e.options.cwd:"",a)),a}s(kue,"resolveCommandAttempt");function Cdt(e){return kue(e)||kue(e,!0)}s(Cdt,"resolveCommand");Gue.exports=Cdt});var Hue=h((KBt,fB)=>{"use strict";var lB=/([()\][%!^"`<>&|;, *?])/g;function $dt(e){return e=e.replace(lB,"^$1"),e}s($dt,"escapeCommand");function Ddt(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(lB,"^$1"),t&&(e=e.replace(lB,"^$1")),e}s(Ddt,"escapeArgument");fB.exports.command=$dt;fB.exports.argument=Ddt});var Kue=h((YBt,zue)=>{"use strict";zue.exports=/^#!(.*)/});var Yue=h((JBt,Wue)=>{"use strict";var Ldt=Kue();Wue.exports=(e="")=>{let t=e.match(Ldt);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var Xue=h((XBt,Jue)=>{"use strict";var dB=require("fs"),jdt=Yue();function Mdt(e){let r=Buffer.alloc(150),n;try{n=dB.openSync(e,"r"),dB.readSync(n,r,0,150,0),dB.closeSync(n)}catch{}return jdt(r.toString())}s(Mdt,"readShebang");Jue.exports=Mdt});var tce=h((QBt,ece)=>{"use strict";var Udt=require("path"),Zue=Vue(),Que=Hue(),xdt=Xue(),qdt=process.platform==="win32",Fdt=/\.(?:com|exe)$/i,Bdt=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function kdt(e){e.file=Zue(e);let t=e.file&&xdt(e.file);return t?(e.args.unshift(e.file),e.command=t,Zue(e)):e.file}s(kdt,"detectShebang");function Gdt(e){if(!qdt)return e;let t=kdt(e),r=!Fdt.test(t);if(e.options.forceShell||r){let n=Bdt.test(t);e.command=Udt.normalize(e.command),e.command=Que.command(e.command),e.args=e.args.map(o=>Que.argument(o,n));let i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}s(Gdt,"parseNonShell");function Vdt(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:Gdt(n)}s(Vdt,"parse");ece.exports=Vdt});var ice=h((tkt,nce)=>{"use strict";var pB=process.platform==="win32";function hB(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}s(hB,"notFoundError");function Hdt(e,t){if(!pB)return;let r=e.emit;e.emit=function(n,i){if(n==="exit"){let o=rce(i,t,"spawn");if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}s(Hdt,"hookChildProcess");function rce(e,t){return pB&&e===1&&!t.file?hB(t.original,"spawn"):null}s(rce,"verifyENOENT");function zdt(e,t){return pB&&e===1&&!t.file?hB(t.original,"spawnSync"):null}s(zdt,"verifyENOENTSync");nce.exports={hookChildProcess:Hdt,verifyENOENT:rce,verifyENOENTSync:zdt,notFoundError:hB}});var ace=h((nkt,d_)=>{"use strict";var sce=require("child_process"),mB=tce(),_B=ice();function oce(e,t,r){let n=mB(e,t,r),i=sce.spawn(n.command,n.args,n.options);return _B.hookChildProcess(i,n),i}s(oce,"spawn");function Kdt(e,t,r){let n=mB(e,t,r),i=sce.spawnSync(n.command,n.args,n.options);return i.error=i.error||_B.verifyENOENTSync(i.status,n),i}s(Kdt,"spawnSync");d_.exports=oce;d_.exports.spawn=oce;d_.exports.sync=Kdt;d_.exports._parse=mB;d_.exports._enoent=_B});var cce=h((skt,uce)=>{"use strict";uce.exports=e=>{let t=typeof e=="string"?`
|
|
303
303
|
`:10,r=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===r&&(e=e.slice(0,e.length-1)),e}});var dce=h((okt,XE)=>{"use strict";var JE=require("path"),lce=cB(),fce=s(e=>{e={cwd:process.cwd(),path:process.env[lce()],execPath:process.execPath,...e};let t,r=JE.resolve(e.cwd),n=[];for(;t!==r;)n.push(JE.join(r,"node_modules/.bin")),t=r,r=JE.resolve(r,"..");let i=JE.resolve(e.cwd,e.execPath,"..");return n.push(i),n.concat(e.path).join(JE.delimiter)},"npmRunPath");XE.exports=fce;XE.exports.default=fce;XE.exports.env=e=>{e={env:process.env,...e};let t={...e.env},r=lce({env:t});return e.path=t[r],t[r]=XE.exports(e),t}});var hce=h((ukt,gB)=>{"use strict";var pce=s((e,t)=>{for(let r of Reflect.ownKeys(t))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e},"mimicFn");gB.exports=pce;gB.exports.default=pce});var _ce=h((lkt,M1)=>{"use strict";var Wdt=hce(),j1=new WeakMap,mce=s((e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0,i=e.displayName||e.name||"<anonymous>",o=s(function(...a){if(j1.set(o,++n),n===1)r=e.apply(this,a),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return r},"onetime");return Wdt(o,e),j1.set(o,n),o},"onetime");M1.exports=mce;M1.exports.default=mce;M1.exports.callCount=e=>{if(!j1.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return j1.get(e)}});var gce=h(U1=>{"use strict";Object.defineProperty(U1,"__esModule",{value:!0});U1.SIGNALS=void 0;var Ydt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];U1.SIGNALS=Ydt});var yB=h(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});p_.SIGRTMAX=p_.getRealtimeSignals=void 0;var Jdt=s(function(){let e=Ece-yce+1;return Array.from({length:e},Xdt)},"getRealtimeSignals");p_.getRealtimeSignals=Jdt;var Xdt=s(function(e,t){return{name:`SIGRT${t+1}`,number:yce+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},"getRealtimeSignal"),yce=34,Ece=64;p_.SIGRTMAX=Ece});var bce=h(x1=>{"use strict";Object.defineProperty(x1,"__esModule",{value:!0});x1.getSignals=void 0;var Zdt=require("os"),Qdt=gce(),ept=yB(),tpt=s(function(){let e=(0,ept.getRealtimeSignals)();return[...Qdt.SIGNALS,...e].map(rpt)},"getSignals");x1.getSignals=tpt;var rpt=s(function({name:e,number:t,description:r,action:n,forced:i=!1,standard:o}){let{signals:{[e]:a}}=Zdt.constants,u=a!==void 0;return{name:e,number:u?a:t,description:r,supported:u,action:n,forced:i,standard:o}},"normalizeSignal")});var Oce=h(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});h_.signalsByNumber=h_.signalsByName=void 0;var npt=require("os"),Sce=bce(),ipt=yB(),spt=s(function(){return(0,Sce.getSignals)().reduce(opt,{})},"getSignalsByName"),opt=s(function(e,{name:t,number:r,description:n,supported:i,action:o,forced:a,standard:u}){return{...e,[t]:{name:t,number:r,description:n,supported:i,action:o,forced:a,standard:u}}},"getSignalByName"),apt=spt();h_.signalsByName=apt;var upt=s(function(){let e=(0,Sce.getSignals)(),t=ipt.SIGRTMAX+1,r=Array.from({length:t},(n,i)=>cpt(i,e));return Object.assign({},...r)},"getSignalsByNumber"),cpt=s(function(e,t){let r=lpt(e,t);if(r===void 0)return{};let{name:n,description:i,supported:o,action:a,forced:u,standard:c}=r;return{[e]:{name:n,number:e,description:i,supported:o,action:a,forced:u,standard:c}}},"getSignalByNumber"),lpt=s(function(e,t){let r=t.find(({name:n})=>npt.constants.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},"findSignalByNumber"),fpt=upt();h_.signalsByNumber=fpt});var Ice=h((Ekt,vce)=>{"use strict";var{signalsByName:dpt}=Oce(),ppt=s(({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:i,exitCode:o,isCanceled:a})=>e?`timed out after ${t} milliseconds`:a?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${i})`:o!==void 0?`failed with exit code ${o}`:"failed","getErrorPrefix"),hpt=s(({stdout:e,stderr:t,all:r,error:n,signal:i,exitCode:o,command:a,escapedCommand:u,timedOut:c,isCanceled:l,killed:f,parsed:{options:{timeout:d}}})=>{o=o===null?void 0:o,i=i===null?void 0:i;let _=i===void 0?void 0:dpt[i].description,m=n&&n.code,y=`Command ${ppt({timedOut:c,timeout:d,errorCode:m,signal:i,signalDescription:_,exitCode:o,isCanceled:l})}: ${a}`,b=Object.prototype.toString.call(n)==="[object Error]",E=b?`${y}
|
|
304
304
|
${n.message}`:y,O=[E,t,e].filter(Boolean).join(`
|
|
305
305
|
`);return b?(n.originalMessage=n.message,n.message=O):n=new Error(O),n.shortMessage=E,n.command=a,n.escapedCommand=u,n.exitCode=o,n.signal=i,n.signalDescription=_,n.stdout=e,n.stderr=t,r!==void 0&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!c,n.isCanceled=l,n.killed=f&&!c,n},"makeError");vce.exports=hpt});var wce=h((Skt,EB)=>{"use strict";var q1=["stdin","stdout","stderr"],mpt=s(e=>q1.some(t=>e[t]!==void 0),"hasAlias"),Pce=s(e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return q1.map(n=>e[n]);if(mpt(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${q1.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,q1.length);return Array.from({length:r},(n,i)=>t[i])},"normalizeStdio");EB.exports=Pce;EB.exports.node=e=>{let t=Pce(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]}});var Tce=h((vkt,F1)=>{F1.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&F1.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&F1.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var $ce=h((Ikt,g_)=>{var Wt=global.process,Bd=s(function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"},"processOk");Bd(Wt)?(Nce=require("assert"),m_=Tce(),Ace=/^win/i.test(Wt.platform),ZE=require("events"),typeof ZE!="function"&&(ZE=ZE.EventEmitter),Wt.__signal_exit_emitter__?Gr=Wt.__signal_exit_emitter__:(Gr=Wt.__signal_exit_emitter__=new ZE,Gr.count=0,Gr.emitted={}),Gr.infinite||(Gr.setMaxListeners(1/0),Gr.infinite=!0),g_.exports=function(e,t){if(!Bd(global.process))return function(){};Nce.equal(typeof e,"function","a callback must be provided for exit handler"),__===!1&&bB();var r="exit";t&&t.alwaysLast&&(r="afterexit");var n=s(function(){Gr.removeListener(r,e),Gr.listeners("exit").length===0&&Gr.listeners("afterexit").length===0&&B1()},"remove");return Gr.on(r,e),n},B1=s(function(){!__||!Bd(global.process)||(__=!1,m_.forEach(function(t){try{Wt.removeListener(t,k1[t])}catch{}}),Wt.emit=G1,Wt.reallyExit=SB,Gr.count-=1)},"unload"),g_.exports.unload=B1,kd=s(function(t,r,n){Gr.emitted[t]||(Gr.emitted[t]=!0,Gr.emit(t,r,n))},"emit"),k1={},m_.forEach(function(e){k1[e]=s(function(){if(Bd(global.process)){var r=Wt.listeners(e);r.length===Gr.count&&(B1(),kd("exit",null,e),kd("afterexit",null,e),Ace&&e==="SIGHUP"&&(e="SIGINT"),Wt.kill(Wt.pid,e))}},"listener")}),g_.exports.signals=function(){return m_},__=!1,bB=s(function(){__||!Bd(global.process)||(__=!0,Gr.count+=1,m_=m_.filter(function(t){try{return Wt.on(t,k1[t]),!0}catch{return!1}}),Wt.emit=Cce,Wt.reallyExit=Rce)},"load"),g_.exports.load=bB,SB=Wt.reallyExit,Rce=s(function(t){Bd(global.process)&&(Wt.exitCode=t||0,kd("exit",Wt.exitCode,null),kd("afterexit",Wt.exitCode,null),SB.call(Wt,Wt.exitCode))},"processReallyExit"),G1=Wt.emit,Cce=s(function(t,r){if(t==="exit"&&Bd(global.process)){r!==void 0&&(Wt.exitCode=r);var n=G1.apply(this,arguments);return kd("exit",Wt.exitCode,null),kd("afterexit",Wt.exitCode,null),n}else return G1.apply(this,arguments)},"processEmit")):g_.exports=function(){return function(){}};var Nce,m_,Ace,ZE,Gr,B1,kd,k1,__,bB,SB,Rce,G1,Cce});var Lce=h((wkt,Dce)=>{"use strict";var _pt=require("os"),gpt=$ce(),ypt=1e3*5,Ept=s((e,t="SIGTERM",r={})=>{let n=e(t);return bpt(e,t,r,n),n},"spawnedKill"),bpt=s((e,t,r,n)=>{if(!Spt(t,r,n))return;let i=vpt(r),o=setTimeout(()=>{e("SIGKILL")},i);o.unref&&o.unref()},"setKillTimeout"),Spt=s((e,{forceKillAfterTimeout:t},r)=>Opt(e)&&t!==!1&&r,"shouldForceKill"),Opt=s(e=>e===_pt.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM","isSigterm"),vpt=s(({forceKillAfterTimeout:e=!0})=>{if(e===!0)return ypt;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},"getForceKillAfterTimeout"),Ipt=s((e,t)=>{e.kill()&&(t.isCanceled=!0)},"spawnedCancel"),Ppt=s((e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},"timeoutKill"),wpt=s((e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let i,o=new Promise((u,c)=>{i=setTimeout(()=>{Ppt(e,r,c)},t)}),a=n.finally(()=>{clearTimeout(i)});return Promise.race([o,a])},"setupTimeout"),Tpt=s(({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},"validateTimeout"),Npt=s(async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let i=gpt(()=>{e.kill()});return n.finally(()=>{i()})},"setExitHandler");Dce.exports={spawnedKill:Ept,spawnedCancel:Ipt,setupTimeout:wpt,validateTimeout:Tpt,setExitHandler:Npt}});var Mce=h((Nkt,jce)=>{"use strict";var Pa=s(e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function","isStream");Pa.writable=e=>Pa(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";Pa.readable=e=>Pa(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";Pa.duplex=e=>Pa.writable(e)&&Pa.readable(e);Pa.transform=e=>Pa.duplex(e)&&typeof e._transform=="function";jce.exports=Pa});var xce=h((Rkt,Uce)=>{"use strict";var{PassThrough:Apt}=require("stream");Uce.exports=e=>{e={...e};let{array:t}=e,{encoding:r}=e,n=r==="buffer",i=!1;t?i=!(r||n):r=r||"utf8",n&&(r=null);let o=new Apt({objectMode:i});r&&o.setEncoding(r);let a=0,u=[];return o.on("data",c=>{u.push(c),i?a=u.length:a+=c.length}),o.getBufferedValue=()=>t?u:n?Buffer.concat(u,a):u.join(""),o.getBufferedLength=()=>a,o}});var qce=h((Ckt,QE)=>{"use strict";var{constants:Rpt}=require("buffer"),Cpt=require("stream"),{promisify:$pt}=require("util"),Dpt=xce(),Lpt=$pt(Cpt.pipeline),V1=class extends Error{static{s(this,"MaxBufferError")}constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function OB(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:r}=t,n=Dpt(t);return await new Promise((i,o)=>{let a=s(u=>{u&&n.getBufferedLength()<=Rpt.MAX_LENGTH&&(u.bufferedData=n.getBufferedValue()),o(u)},"rejectPromise");(async()=>{try{await Lpt(e,n),i()}catch(u){a(u)}})(),n.on("data",()=>{n.getBufferedLength()>r&&a(new V1)})}),n.getBufferedValue()}s(OB,"getStream");QE.exports=OB;QE.exports.buffer=(e,t)=>OB(e,{...t,encoding:"buffer"});QE.exports.array=(e,t)=>OB(e,{...t,array:!0});QE.exports.MaxBufferError=V1});var Bce=h((Dkt,Fce)=>{"use strict";var{PassThrough:jpt}=require("stream");Fce.exports=function(){var e=[],t=new jpt({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=n,t.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(r),t;function r(o){return Array.isArray(o)?(o.forEach(r),this):(e.push(o),o.once("end",i.bind(null,o)),o.once("error",t.emit.bind(t,"error")),o.pipe(t,{end:!1}),this)}s(r,"add");function n(){return e.length==0}s(n,"isEmpty");function i(o){e=e.filter(function(a){return a!==o}),!e.length&&t.readable&&t.end()}s(i,"remove")}});var Hce=h((jkt,Vce)=>{"use strict";var Gce=Mce(),kce=qce(),Mpt=Bce(),Upt=s((e,t)=>{t===void 0||e.stdin===void 0||(Gce(t)?t.pipe(e.stdin):e.stdin.end(t))},"handleInput"),xpt=s((e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=Mpt();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},"makeAllStream"),vB=s(async(e,t)=>{if(e){e.destroy();try{return await t}catch(r){return r.bufferedData}}},"getBufferedData"),IB=s((e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!(!e||!r))return t?kce(e,{encoding:t,maxBuffer:n}):kce.buffer(e,{maxBuffer:n})},"getStreamPromise"),qpt=s(async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:o},a)=>{let u=IB(e,{encoding:n,buffer:i,maxBuffer:o}),c=IB(t,{encoding:n,buffer:i,maxBuffer:o}),l=IB(r,{encoding:n,buffer:i,maxBuffer:o*2});try{return await Promise.all([a,u,c,l])}catch(f){return Promise.all([{error:f,signal:f.signal,timedOut:f.timedOut},vB(e,u),vB(t,c),vB(r,l)])}},"getSpawnedResult"),Fpt=s(({input:e})=>{if(Gce(e))throw new TypeError("The `input` option cannot be a stream in sync mode")},"validateInputSync");Vce.exports={handleInput:Upt,makeAllStream:xpt,getSpawnedResult:qpt,validateInputSync:Fpt}});var Kce=h((Ukt,zce)=>{"use strict";var Bpt=(async()=>{})().constructor.prototype,kpt=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Bpt,e)]),Gpt=s((e,t)=>{for(let[r,n]of kpt){let i=typeof t=="function"?(...o)=>Reflect.apply(n.value,t(),o):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i})}return e},"mergePromise"),Vpt=s(e=>new Promise((t,r)=>{e.on("exit",(n,i)=>{t({exitCode:n,signal:i})}),e.on("error",n=>{r(n)}),e.stdin&&e.stdin.on("error",n=>{r(n)})}),"getSpawnedPromise");zce.exports={mergePromise:Gpt,getSpawnedPromise:Vpt}});var Jce=h((qkt,Yce)=>{"use strict";var Wce=s((e,t=[])=>Array.isArray(t)?[e,...t]:[e],"normalizeArgs"),Hpt=/^[\w.-]+$/,zpt=/"/g,Kpt=s(e=>typeof e!="string"||Hpt.test(e)?e:`"${e.replace(zpt,'\\"')}"`,"escapeArg"),Wpt=s((e,t)=>Wce(e,t).join(" "),"joinCommand"),Ypt=s((e,t)=>Wce(e,t).map(r=>Kpt(r)).join(" "),"getEscapedCommand"),Jpt=/ +/g,Xpt=s(e=>{let t=[];for(let r of e.trim().split(Jpt)){let n=t[t.length-1];n&&n.endsWith("\\")?t[t.length-1]=`${n.slice(0,-1)} ${r}`:t.push(r)}return t},"parseCommand");Yce.exports={joinCommand:Wpt,getEscapedCommand:Ypt,parseCommand:Xpt}});var nle=h((Bkt,y_)=>{"use strict";var Zpt=require("path"),PB=require("child_process"),Qpt=ace(),eht=cce(),tht=dce(),rht=_ce(),H1=Ice(),Zce=wce(),{spawnedKill:nht,spawnedCancel:iht,setupTimeout:sht,validateTimeout:oht,setExitHandler:aht}=Lce(),{handleInput:uht,getSpawnedResult:cht,makeAllStream:lht,validateInputSync:fht}=Hce(),{mergePromise:Xce,getSpawnedPromise:dht}=Kce(),{joinCommand:Qce,parseCommand:ele,getEscapedCommand:tle}=Jce(),pht=1e3*1e3*100,hht=s(({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:i})=>{let o=t?{...process.env,...e}:e;return r?tht.env({env:o,cwd:n,execPath:i}):o},"getEnv"),rle=s((e,t,r={})=>{let n=Qpt._parse(e,t,r);return e=n.command,t=n.args,r=n.options,r={maxBuffer:pht,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...r},r.env=hht(r),r.stdio=Zce(r),process.platform==="win32"&&Zpt.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n}},"handleArguments"),eb=s((e,t,r)=>typeof t!="string"&&!Buffer.isBuffer(t)?r===void 0?void 0:"":e.stripFinalNewline?eht(t):t,"handleOutput"),z1=s((e,t,r)=>{let n=rle(e,t,r),i=Qce(e,t),o=tle(e,t);oht(n.options);let a;try{a=PB.spawn(n.file,n.args,n.options)}catch(m){let g=new PB.ChildProcess,y=Promise.reject(H1({error:m,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return Xce(g,y)}let u=dht(a),c=sht(a,n.options,u),l=aht(a,n.options,c),f={isCanceled:!1};a.kill=nht.bind(null,a.kill.bind(a)),a.cancel=iht.bind(null,a,f);let _=rht(s(async()=>{let[{error:m,exitCode:g,signal:y,timedOut:b},E,O,v]=await cht(a,n.options,l),P=eb(n.options,E),w=eb(n.options,O),j=eb(n.options,v);if(m||g!==0||y!==null){let F=H1({error:m,exitCode:g,signal:y,stdout:P,stderr:w,all:j,command:i,escapedCommand:o,parsed:n,timedOut:b,isCanceled:f.isCanceled,killed:a.killed});if(!n.options.reject)return F;throw F}return{command:i,escapedCommand:o,exitCode:0,stdout:P,stderr:w,all:j,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},"handlePromise"));return uht(a,n.options.input),a.all=lht(a,n.options),Xce(a,_)},"execa");y_.exports=z1;y_.exports.sync=(e,t,r)=>{let n=rle(e,t,r),i=Qce(e,t),o=tle(e,t);fht(n.options);let a;try{a=PB.spawnSync(n.file,n.args,n.options)}catch(l){throw H1({error:l,stdout:"",stderr:"",all:"",command:i,escapedCommand:o,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let u=eb(n.options,a.stdout,a.error),c=eb(n.options,a.stderr,a.error);if(a.error||a.status!==0||a.signal!==null){let l=H1({stdout:u,stderr:c,error:a.error,signal:a.signal,exitCode:a.status,command:i,escapedCommand:o,parsed:n,timedOut:a.error&&a.error.code==="ETIMEDOUT",isCanceled:!1,killed:a.signal!==null});if(!n.options.reject)return l;throw l}return{command:i,escapedCommand:o,exitCode:0,stdout:u,stderr:c,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};y_.exports.command=(e,t)=>{let[r,...n]=ele(e);return z1(r,n,t)};y_.exports.commandSync=(e,t)=>{let[r,...n]=ele(e);return z1.sync(r,n,t)};y_.exports.node=(e,t,r={})=>{t&&!Array.isArray(t)&&typeof t=="object"&&(r=t,t=[]);let n=Zce.node(r),i=process.execArgv.filter(u=>!u.startsWith("--inspect")),{nodePath:o=process.execPath,nodeOptions:a=i}=r;return z1(o,[...a,e,...Array.isArray(t)?t:[]],{...r,stdin:void 0,stdout:void 0,stderr:void 0,stdio:n,shell:!1})}});var wB=h(el=>{"use strict";var Y1=el&&el.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(el,"__esModule",{value:!0});el.setEnvironment=el.loadEnvironment=void 0;var mht=Y1(bue()),ile=Y1(DA()),_ht=Y1(nle()),K1=require("fs"),W1=Y1(require("path"));async function ght(e){return sle(process.env,e)}s(ght,"loadEnvironment");el.loadEnvironment=ght;async function sle(e,t){if(e.__ZUPLO_LOG_LEVEL=process.env.__ZUPLO_LOG_LEVEL??process.env.LOG_LEVEL,e.__ZUPLO_LOG_FORMAT=process.env.__ZUPLO_LOG_FORMAT??process.env.LOG_FORMAT,e.LOG_LEVEL=process.env.LOG_LEVEL??process.env.LOG_LEVEL,e.LOG_FORMAT=process.env.LOG_FORMAT??process.env.LOG_FORMAT,e.GIT_SHA=process.env.GIT_SHA??await yht(t),process.env.__ZUPLO_CONFIG&&(e.__ZUPLO_CONFIG=process.env.__ZUPLO_CONFIG),(0,K1.existsSync)(W1.default.join(t,".env.zuplo"))){let r=(0,K1.readFileSync)(W1.default.join(t,".env.zuplo"),"utf8"),n=ile.default.parse(r);for(let i of Object.keys(n))if(e[i]=n[i],i==="ZUPLO_SYSTEM_CONFIGURATIONS"){let o=Buffer.from(mht.default.decode(n[i])).toString(),a=JSON.parse(o);for(let u of Object.keys(a))e[u]=a[u]}}if((0,K1.existsSync)(W1.default.join(t,".env"))){let r=(0,K1.readFileSync)(W1.default.join(t,".env"),"utf8"),n=ile.default.parse(r);for(let i of Object.keys(n))e[i]=n[i]}for(let r of Object.keys(e))e[r]===void 0&&delete e[r];return e}s(sle,"setEnvironment");el.setEnvironment=sle;async function yht(e){let t="unknown";try{let{stdout:r}=await(0,_ht.default)("git",["rev-parse","HEAD"],{cwd:e});r.trim().length===40&&(t=r.trim())}catch{}return t}s(yht,"getGitSha")});var ot={};dhe(ot,{__addDisposableResource:()=>wle,__assign:()=>J1,__asyncDelegator:()=>yle,__asyncGenerator:()=>gle,__asyncValues:()=>Ele,__await:()=>E_,__awaiter:()=>fle,__classPrivateFieldGet:()=>vle,__classPrivateFieldIn:()=>Ple,__classPrivateFieldSet:()=>Ile,__createBinding:()=>Z1,__decorate:()=>ule,__disposeResources:()=>Tle,__esDecorate:()=>Eht,__exportStar:()=>ple,__extends:()=>ole,__generator:()=>dle,__importDefault:()=>Ole,__importStar:()=>Sle,__makeTemplateObject:()=>ble,__metadata:()=>lle,__param:()=>cle,__propKey:()=>Sht,__read:()=>NB,__rest:()=>ale,__runInitializers:()=>bht,__setFunctionName:()=>Oht,__spread:()=>hle,__spreadArray:()=>_le,__spreadArrays:()=>mle,__values:()=>X1,default:()=>Pht});function ole(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");TB(e,t);function r(){this.constructor=e}s(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function ale(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function ule(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(a=e[u])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function cle(e,t){return function(r,n){t(r,n,e)}}function Eht(e,t,r,n,i,o){function a(E){if(E!==void 0&&typeof E!="function")throw new TypeError("Function expected");return E}s(a,"accept");for(var u=n.kind,c=u==="getter"?"get":u==="setter"?"set":"value",l=!t&&e?n.static?e:e.prototype:null,f=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d,_=!1,m=r.length-1;m>=0;m--){var g={};for(var y in n)g[y]=y==="access"?{}:n[y];for(var y in n.access)g.access[y]=n.access[y];g.addInitializer=function(E){if(_)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(E||null))};var b=(0,r[m])(u==="accessor"?{get:f.get,set:f.set}:f[c],g);if(u==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(d=a(b.get))&&(f.get=d),(d=a(b.set))&&(f.set=d),(d=a(b.init))&&i.unshift(d)}else(d=a(b))&&(u==="field"?i.unshift(d):f[c]=d)}l&&Object.defineProperty(l,n.name,f),_=!0}function bht(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function Sht(e){return typeof e=="symbol"?e:"".concat(e)}function Oht(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function lle(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function fle(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return s(i,"adopt"),new(r||(r=Promise))(function(o,a){function u(f){try{l(n.next(f))}catch(d){a(d)}}s(u,"fulfilled");function c(f){try{l(n.throw(f))}catch(d){a(d)}}s(c,"rejected");function l(f){f.done?o(f.value):i(f.value).then(u,c)}s(l,"step"),l((n=n.apply(e,t||[])).next())})}function dle(e,t){var r={label:0,sent:s(function(){if(o[0]&1)throw o[1];return o[1]},"sent"),trys:[],ops:[]},n,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(l){return function(f){return c([l,f])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(f){l=[6,f],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function ple(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Z1(t,e,r)}function X1(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:s(function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}},"next")};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function NB(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(u){a={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function hle(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(NB(arguments[t]));return e}function mle(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],a=0,u=o.length;a<u;a++,i++)n[i]=o[a];return n}function _le(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function E_(e){return this instanceof E_?(this.v=e,this):new E_(e)}function gle(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(_){n[_]&&(i[_]=function(m){return new Promise(function(g,y){o.push([_,m,g,y])>1||u(_,m)})})}function u(_,m){try{c(n[_](m))}catch(g){d(o[0][3],g)}}function c(_){_.value instanceof E_?Promise.resolve(_.value.v).then(l,f):d(o[0][2],_)}function l(_){u("next",_)}function f(_){u("throw",_)}function d(_,m){_(m),o.shift(),o.length&&u(o[0][0],o[0][1])}}function yle(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(a){return(r=!r)?{value:E_(e[i](a)),done:!1}:o?o(a):a}:o}}function Ele(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof X1=="function"?X1(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(a){return new Promise(function(u,c){a=e[o](a),i(u,c,a.done,a.value)})}}function i(o,a,u,c){Promise.resolve(c).then(function(l){o({value:l,done:u})},a)}}function ble(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Sle(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Z1(t,e,r);return vht(t,e),t}function Ole(e){return e&&e.__esModule?e:{default:e}}function vle(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Ile(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}function Ple(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function wle(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}function Tle(e){function t(n){e.error=e.hasError?new Iht(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}s(t,"fail");function r(){for(;e.stack.length;){var n=e.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return t(o),r()})}catch(o){t(o)}}if(e.hasError)throw e.error}return s(r,"next"),r()}var TB,J1,Z1,vht,Iht,Pht,at=fhe(()=>{TB=s(function(e,t){return TB=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])},TB(e,t)},"extendStatics");s(ole,"__extends");J1=s(function(){return J1=Object.assign||s(function(t){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)&&(t[o]=r[o])}return t},"__assign"),J1.apply(this,arguments)},"__assign");s(ale,"__rest");s(ule,"__decorate");s(cle,"__param");s(Eht,"__esDecorate");s(bht,"__runInitializers");s(Sht,"__propKey");s(Oht,"__setFunctionName");s(lle,"__metadata");s(fle,"__awaiter");s(dle,"__generator");Z1=Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return t[r]},"get")}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]};s(ple,"__exportStar");s(X1,"__values");s(NB,"__read");s(hle,"__spread");s(mle,"__spreadArrays");s(_le,"__spreadArray");s(E_,"__await");s(gle,"__asyncGenerator");s(yle,"__asyncDelegator");s(Ele,"__asyncValues");s(ble,"__makeTemplateObject");vht=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};s(Sle,"__importStar");s(Ole,"__importDefault");s(vle,"__classPrivateFieldGet");s(Ile,"__classPrivateFieldSet");s(Ple,"__classPrivateFieldIn");s(wle,"__addDisposableResource");Iht=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};s(Tle,"__disposeResources");Pht={__extends:ole,__assign:J1,__rest:ale,__decorate:ule,__param:cle,__metadata:lle,__awaiter:fle,__generator:dle,__createBinding:Z1,__exportStar:ple,__values:X1,__read:NB,__spread:hle,__spreadArrays:mle,__spreadArray:_le,__await:E_,__asyncGenerator:gle,__asyncDelegator:yle,__asyncValues:Ele,__makeTemplateObject:ble,__importStar:Sle,__importDefault:Ole,__classPrivateFieldGet:vle,__classPrivateFieldSet:Ile,__classPrivateFieldIn:Ple,__addDisposableResource:wle,__disposeResources:Tle}});var Ale=h((zkt,Nle)=>{var b_=1e3,S_=b_*60,O_=S_*60,Gd=O_*24,wht=Gd*7,Tht=Gd*365.25;Nle.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Nht(e);if(r==="number"&&isFinite(e))return t.long?Rht(e):Aht(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Nht(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Tht;case"weeks":case"week":case"w":return r*wht;case"days":case"day":case"d":return r*Gd;case"hours":case"hour":case"hrs":case"hr":case"h":return r*O_;case"minutes":case"minute":case"mins":case"min":case"m":return r*S_;case"seconds":case"second":case"secs":case"sec":case"s":return r*b_;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}s(Nht,"parse");function Aht(e){var t=Math.abs(e);return t>=Gd?Math.round(e/Gd)+"d":t>=O_?Math.round(e/O_)+"h":t>=S_?Math.round(e/S_)+"m":t>=b_?Math.round(e/b_)+"s":e+"ms"}s(Aht,"fmtShort");function Rht(e){var t=Math.abs(e);return t>=Gd?Q1(e,t,Gd,"day"):t>=O_?Q1(e,t,O_,"hour"):t>=S_?Q1(e,t,S_,"minute"):t>=b_?Q1(e,t,b_,"second"):e+" ms"}s(Rht,"fmtLong");function Q1(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}s(Q1,"plural")});var AB=h((Wkt,Rle)=>{function Cht(e){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=a,r.humanize=Ale(),r.destroy=l,Object.keys(e).forEach(f=>{r[f]=e[f]}),r.names=[],r.skips=[],r.formatters={};function t(f){let d=0;for(let _=0;_<f.length;_++)d=(d<<5)-d+f.charCodeAt(_),d|=0;return r.colors[Math.abs(d)%r.colors.length]}s(t,"selectColor"),r.selectColor=t;function r(f){let d,_=null,m,g;function y(...b){if(!y.enabled)return;let E=y,O=Number(new Date),v=O-(d||O);E.diff=v,E.prev=d,E.curr=O,d=O,b[0]=r.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let P=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(j,F)=>{if(j==="%%")return"%";P++;let K=r.formatters[F];if(typeof K=="function"){let z=b[P];j=K.call(E,z),b.splice(P,1),P--}return j}),r.formatArgs.call(E,b),(E.log||r.log).apply(E,b)}return s(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:s(()=>_!==null?_:(m!==r.namespaces&&(m=r.namespaces,g=r.enabled(f)),g),"get"),set:s(b=>{_=b},"set")}),typeof r.init=="function"&&r.init(y),y}s(r,"createDebug");function n(f,d){let _=r(this.namespace+(typeof d>"u"?":":d)+f);return _.log=this.log,_}s(n,"extend");function i(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let d,_=(typeof f=="string"?f:"").split(/[\s,]+/),m=_.length;for(d=0;d<m;d++)_[d]&&(f=_[d].replace(/\*/g,".*?"),f[0]==="-"?r.skips.push(new RegExp("^"+f.slice(1)+"$")):r.names.push(new RegExp("^"+f+"$")))}s(i,"enable");function o(){let f=[...r.names.map(u),...r.skips.map(u).map(d=>"-"+d)].join(",");return r.enable(""),f}s(o,"disable");function a(f){if(f[f.length-1]==="*")return!0;let d,_;for(d=0,_=r.skips.length;d<_;d++)if(r.skips[d].test(f))return!1;for(d=0,_=r.names.length;d<_;d++)if(r.names[d].test(f))return!0;return!1}s(a,"enabled");function u(f){return f.toString().substring(2,f.toString().length-2).replace(/\.\*\?$/,"*")}s(u,"toNamespace");function c(f){return f instanceof Error?f.stack||f.message:f}s(c,"coerce");function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s(l,"destroy"),r.enable(r.load()),r}s(Cht,"setup");Rle.exports=Cht});var Cle=h((Yi,eN)=>{Yi.formatArgs=Dht;Yi.save=Lht;Yi.load=jht;Yi.useColors=$ht;Yi.storage=Mht();Yi.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Yi.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function $ht(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}s($ht,"useColors");function Dht(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+eN.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),e.splice(n,0,t)}s(Dht,"formatArgs");Yi.log=console.debug||console.log||(()=>{});function Lht(e){try{e?Yi.storage.setItem("debug",e):Yi.storage.removeItem("debug")}catch{}}s(Lht,"save");function jht(){let e;try{e=Yi.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}s(jht,"load");function Mht(){try{return localStorage}catch{}}s(Mht,"localstorage");eN.exports=AB()(Yi);var{formatters:Uht}=eN.exports;Uht.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Dle=h((Xkt,$le)=>{"use strict";$le.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var Mle=h((Zkt,jle)=>{"use strict";var xht=require("os"),Lle=require("tty"),Fs=Dle(),{env:Vr}=process,tN;Fs("no-color")||Fs("no-colors")||Fs("color=false")||Fs("color=never")?tN=0:(Fs("color")||Fs("colors")||Fs("color=true")||Fs("color=always"))&&(tN=1);function qht(){if("FORCE_COLOR"in Vr)return Vr.FORCE_COLOR==="true"?1:Vr.FORCE_COLOR==="false"?0:Vr.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Vr.FORCE_COLOR,10),3)}s(qht,"envForceColor");function Fht(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}s(Fht,"translateLevel");function Bht(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=qht();n!==void 0&&(tN=n);let i=r?tN:n;if(i===0)return 0;if(r){if(Fs("color=16m")||Fs("color=full")||Fs("color=truecolor"))return 3;if(Fs("color=256"))return 2}if(e&&!t&&i===void 0)return 0;let o=i||0;if(Vr.TERM==="dumb")return o;if(process.platform==="win32"){let a=xht.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Vr)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(a=>a in Vr)||Vr.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in Vr)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Vr.TEAMCITY_VERSION)?1:0;if(Vr.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Vr){let a=Number.parseInt((Vr.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Vr.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Vr.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Vr.TERM)||"COLORTERM"in Vr?1:o}s(Bht,"supportsColor");function RB(e,t={}){let r=Bht(e,{streamIsTTY:e&&e.isTTY,...t});return Fht(r)}s(RB,"getSupportLevel");jle.exports={supportsColor:RB,stdout:RB({isTTY:Lle.isatty(1)}),stderr:RB({isTTY:Lle.isatty(2)})}});var xle=h((cn,nN)=>{var kht=require("tty"),rN=require("util");cn.init=Yht;cn.log=zht;cn.formatArgs=Vht;cn.save=Kht;cn.load=Wht;cn.useColors=Ght;cn.destroy=rN.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");cn.colors=[6,2,3,4,5,1];try{let e=Mle();e&&(e.stderr||e).level>=2&&(cn.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}cn.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function Ght(){return"colors"in cn.inspectOpts?!!cn.inspectOpts.colors:kht.isatty(process.stderr.fd)}s(Ght,"useColors");function Vht(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${t} \x1B[0m`;e[0]=o+e[0].split(`
|