@catladder/cli 1.163.2 → 1.164.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.
@@ -1,4 +1,4 @@
1
- (()=>{var __webpack_modules__={6965:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});var i=r(5264);var o=r(4975);var s=r(4770);var p=r(8800);var l=r(603);t["default"]=function(e){return a(void 0,void 0,void 0,(function(){var t;return n(this,(function(r){switch(r.label){case 0:return[4,(0,i.getProjectConfig)()];case 1:t=r.sent();if(!t){return[2]}return[4,Promise.all([t.pipelineType?(0,l.generatePipelineFiles)(t,t.pipelineType,"local"):undefined,(0,s.writeDotEnvFiles)(t,e),(0,p.writeDTsFiles)(t,e),(0,o.printVariables)(t,e)])];case 2:r.sent();return[2]}}))}))}},4975:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.printVariables=void 0;var s=r(5264);var p=r(4560);var getAllVariablesToPrint=function(e,t){return n(void 0,void 0,void 0,(function(){var r,l,d;return i(this,(function(c){switch(c.label){case 0:return[4,(0,p.getCurrentComponentAndEnvFromChoice)(e,t)];case 1:r=c.sent(),l=r.env,d=r.currentComponent;if(!d)return[3,3];if(e.components[d].dotEnv){return[2,{}]}return[4,(0,s.getEnvVarsResolved)(null,l,d)];case 2:return[2,c.sent()];case 3:return[4,Object.keys(e.components).reduce((function(t,r){return n(void 0,void 0,void 0,(function(){var n,d;return i(this,(function(i){switch(i.label){case 0:if(!e.components[r].dotEnv)return[3,2];return[4,t];case 1:return[2,i.sent()];case 2:return[4,(0,s.getEnvVarsResolved)(null,l,r)];case 3:n=i.sent();delete n["_ALL_ENV_VAR_KEYS"];d=[{}];return[4,t];case 4:return[2,a.apply(void 0,[a.apply(void 0,[a.apply(void 0,d.concat([i.sent()])),n]),Object.fromEntries(Object.entries(n).map((function(e){var t=o(e,2),a=t[0],n=t[1];return["".concat((0,p.sanitizeEnvVarName)(r.toUpperCase()),"_").concat(a),n]})))])]}}))}))}),Promise.resolve({}))];case 4:return[2,c.sent()]}}))}))};var printVariables=function(e,t){return n(void 0,void 0,void 0,(function(){var r;return i(this,(function(a){switch(a.label){case 0:return[4,getAllVariablesToPrint(e,t)];case 1:r=a.sent();console.log(makeExportKeyValuestring(r));return[2]}}))}))};t.printVariables=printVariables;var makeExportKeyValuestring=function(e){return(0,p.makeKeyValueString)(e,"export ")}},4560:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.sanitizeEnvVarName=t.sanitizeMultiLine=t.makeKeyValueString=t.getCurrentComponentAndEnvFromChoice=t.getComponentFullPath=void 0;var o=r(1017);var s=r(9011);var getComponentFullPath=function(e,t,r){return(0,o.join)(e,t.components[r].dir)};t.getComponentFullPath=getComponentFullPath;var getCurrentComponentName=function(e){return a(void 0,void 0,void 0,(function(){var r,a;return n(this,(function(n){switch(n.label){case 0:return[4,(0,s.getGitRoot)()];case 1:r=n.sent();a=process.cwd();return[2,Object.keys(e.components).find((function(n){return a.startsWith((0,t.getComponentFullPath)(r,e,n))}))]}}))}))};var getCurrentComponentAndEnvFromChoice=function(e,t){return a(void 0,void 0,void 0,(function(){var r,a,i;var o,s;return n(this,(function(n){switch(n.label){case 0:r=(o=t===null||t===void 0?void 0:t.env)!==null&&o!==void 0?o:"local";if(!((s=t===null||t===void 0?void 0:t.componentName)!==null&&s!==void 0))return[3,1];i=s;return[3,3];case 1:return[4,getCurrentComponentName(e)];case 2:i=n.sent();n.label=3;case 3:a=i;return[2,{currentComponent:a,env:r}]}}))}))};t.getCurrentComponentAndEnvFromChoice=getCurrentComponentAndEnvFromChoice;var makeKeyValueString=function(e,t){if(t===void 0){t=""}return Object.entries(e).map((function(e){var r=i(e,2),a=r[0],n=r[1];return"".concat(t).concat(a,"='").concat(n,"'")})).join("\n")};t.makeKeyValueString=makeKeyValueString;var sanitizeMultiLine=function(e){return Object.fromEntries(Object.entries(e).map((function(e){var t=i(e,2),r=t[0],a=t[1];return[r,a.replaceAll("\n","\\n")]})))};t.sanitizeMultiLine=sanitizeMultiLine;var sanitizeEnvVarName=function(e){return e.replace(/[\s\-.]+/g,"_")};t.sanitizeEnvVarName=sanitizeEnvVarName},4770:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__values||function(e){var t=typeof Symbol==="function"&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&a>=e.length)e=void 0;return{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:true});t.writeDotEnvFiles=void 0;var s=r(603);var p=r(1017);var l=r(5264);var d=r(9011);var c=r(4560);var writeDotEnvFiles=function(e,t){return a(void 0,void 0,void 0,(function(){var r,a,u,f,m,h,v,y,b,g,w,_,S,O;var A,N;return n(this,(function(n){switch(n.label){case 0:return[4,(0,c.getCurrentComponentAndEnvFromChoice)(e,t)];case 1:r=n.sent(),a=r.env,u=r.currentComponent;f=Object.entries(e.components).filter((function(e){var t=i(e,2),r=t[1];return r===null||r===void 0?void 0:r.dotEnv})).map((function(e){var t=i(e,1),r=t[0];return r}));m=u?f.includes(u)?[u]:[]:f;return[4,(0,d.getGitRoot)()];case 2:h=n.sent();n.label=3;case 3:n.trys.push([3,9,10,11]);v=o(m),y=v.next();n.label=4;case 4:if(!!y.done)return[3,8];b=y.value;return[4,(0,l.getEnvVarsResolved)(null,a,b)];case 5:g=n.sent();delete g["_ALL_ENV_VAR_KEYS"];w=(0,c.getComponentFullPath)(h,e,b);_=(0,p.join)(w,".env");S=(0,c.sanitizeMultiLine)(g);return[4,(0,s.writeGeneratedFile)(_,(0,c.makeKeyValueString)(S),{commentChar:"#"})];case 6:n.sent();n.label=7;case 7:y=v.next();return[3,4];case 8:return[3,11];case 9:O=n.sent();A={error:O};return[3,11];case 10:try{if(y&&!y.done&&(N=v.return))N.call(v)}finally{if(A)throw A.error}return[7];case 11:return[2]}}))}))};t.writeDotEnvFiles=writeDotEnvFiles},8800:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__values||function(e){var t=typeof Symbol==="function"&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&a>=e.length)e=void 0;return{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:true});t.writeDTsFiles=void 0;var s=r(603);var p=r(1017);var l=r(5264);var d=r(9011);var c=r(4560);var writeDTsFiles=function(e,t){return a(void 0,void 0,void 0,(function(){var r,a,l,u,f,m,h,v,y,b,g,w,_,S;var O,A;return n(this,(function(n){switch(n.label){case 0:return[4,(0,c.getCurrentComponentAndEnvFromChoice)(e,t)];case 1:r=n.sent(),a=r.env,l=r.currentComponent;u=Object.entries(e.components).filter((function(e){var t=i(e,2),r=t[1];return r===null||r===void 0?void 0:r.envDTs})).map((function(e){var t=i(e,1),r=t[0];return r}));f=l?u.includes(l)?[l]:[]:u;return[4,(0,d.getGitRoot)()];case 2:m=n.sent();n.label=3;case 3:n.trys.push([3,9,10,11]);h=o(f),v=h.next();n.label=4;case 4:if(!!v.done)return[3,8];y=v.value;return[4,getEnvsForDTs(a,y)];case 5:b=n.sent();g=createEnvDTsContent(b);w=(0,c.getComponentFullPath)(m,e,y);_=(0,p.join)(w,"env.d.ts");return[4,(0,s.writeGeneratedFile)(_,g,{commentChar:"//"})];case 6:n.sent();n.label=7;case 7:v=h.next();return[3,4];case 8:return[3,11];case 9:S=n.sent();O={error:S};return[3,11];case 10:try{if(v&&!v.done&&(A=h.return))A.call(h)}finally{if(O)throw O.error}return[7];case 11:return[2]}}))}))};t.writeDTsFiles=writeDTsFiles;function getEnvsForDTs(e,t){return a(this,void 0,void 0,(function(){var r,a,i,o;return n(this,(function(n){switch(n.label){case 0:return[4,(0,l.getEnvironment)(e,t)];case 1:r=n.sent();a=Object.keys(r.envVars);i=new Set(r.secretEnvVarKeys.filter((function(e){return e.hidden})).map((function(e){return e.key})).concat(["_ALL_ENV_VAR_KEYS"]));o=a.filter((function(e){return!i.has(e)}));return[2,o]}}))}))}function createEnvDTsContent(e){return"/* tslint:disable prettier/prettier */\n/* eslint-disable prettier/prettier */\n/* prettier-ignore */\n\nexport {}\n\ndeclare global {\n namespace NodeJS {\n interface ProcessEnv {\n".concat(e.map((function(e){return" ".concat(e,": string")})).join("\n"),"\n }\n }\n}\n")}},8900:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});var n=a(r(6965));var i=r(3941);var o=process.argv.slice(2);var s=["--help","-h","help"];if(o.some((function(e){return s.includes(e)}))){var p="https://git.panter.ch/catladder/catladder/-/blob/main/docs/1_VARS.md";console.log("\nUsage: catenv [env|env:component]\n\nEnv variable and catenv documentation:\n".concat(p));process.exit(0)}(0,n.default)(o[0]?(0,i.parseChoice)(o[0]):null).then((function(){process.exit()}))},5264:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.getJobOnlyEnvVarsResolved=t.getEnvVarsResolved=t.getGitlabVar=t.getEnvironment=t.getAllPipelineContexts=t.getAllComponentsWithAllEnvsHierarchical=t.getAllComponentsWithAllEnvsFlat=t.getPipelineContextByChoice=t.getProjectComponents=t.getProjectConfig=t.parseChoice=void 0;var o=r(603);var s=r(2927);var p=r(9011);var l=r(7147);var d=r(3941);Object.defineProperty(t,"parseChoice",{enumerable:true,get:function(){return d.parseChoice}});var c=null;var reloadConfigAndObserve=function(){return a(void 0,void 0,void 0,(function(){var e,t,r,a,i;return n(this,(function(n){switch(n.label){case 0:return[4,(0,p.getGitRoot)()];case 1:e=n.sent();if(!e){return[2]}return[4,(0,o.readConfig)(e)];case 2:t=n.sent();if(!t){return[2]}r=t.config,a=t.path;i=(0,l.watch)(a,(function(){i.close();reloadConfigAndObserve()}));c=r;return[2]}}))}))};var getProjectConfig=function(){return a(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:if(!!c)return[3,2];return[4,reloadConfigAndObserve()];case 1:e.sent();e.label=2;case 2:return[2,c]}}))}))};t.getProjectConfig=getProjectConfig;var getProjectComponents=function(){return a(void 0,void 0,void 0,(function(){var e;return n(this,(function(r){switch(r.label){case 0:return[4,(0,t.getProjectConfig)()];case 1:e=r.sent();if(!e)return[2,[]];return[2,Object.keys(e.components)]}}))}))};t.getProjectComponents=getProjectComponents;var getPipelineContextByChoice=function(e,r){return a(void 0,void 0,void 0,(function(){var a;return n(this,(function(n){switch(n.label){case 0:return[4,(0,t.getProjectConfig)()];case 1:a=n.sent();return[4,(0,o.createComponentContext)({config:a,componentName:r,env:e})];case 2:return[2,n.sent()]}}))}))};t.getPipelineContextByChoice=getPipelineContextByChoice;var getAllComponentsWithAllEnvsFlat=function(){return a(void 0,void 0,void 0,(function(){var e;return n(this,(function(r){switch(r.label){case 0:return[4,(0,t.getProjectConfig)()];case 1:e=r.sent();if(!e){return[2,[]]}return[2,Object.keys(e.components).flatMap((function(t){return(0,o.getAllEnvs)(e,t).map((function(e){return{env:e,componentName:t}}))}))]}}))}))};t.getAllComponentsWithAllEnvsFlat=getAllComponentsWithAllEnvsFlat;var getAllComponentsWithAllEnvsHierarchical=function(){return a(void 0,void 0,void 0,(function(){var e;return n(this,(function(r){switch(r.label){case 0:return[4,(0,t.getProjectConfig)()];case 1:e=r.sent();if(!e){return[2,{}]}return[2,Object.fromEntries(Object.keys(e.components).map((function(t){return[t,(0,o.getAllEnvs)(e,t)]})))]}}))}))};t.getAllComponentsWithAllEnvsHierarchical=getAllComponentsWithAllEnvsHierarchical;var getAllPipelineContexts=function(){return a(void 0,void 0,void 0,(function(){var e,r;return n(this,(function(a){switch(a.label){case 0:r=(e=Promise).all;return[4,(0,t.getAllComponentsWithAllEnvsFlat)()];case 1:return[2,r.apply(e,[a.sent().filter((function(e){return e.env!=="local"})).map((function(e){var r=e.env,a=e.componentName;return(0,t.getPipelineContextByChoice)(r,a)}))])]}}))}))};t.getAllPipelineContexts=getAllPipelineContexts;var getEnvironment=function(e,r){return a(void 0,void 0,void 0,(function(){var a;return n(this,(function(n){switch(n.label){case 0:return[4,(0,t.getProjectConfig)()];case 1:a=n.sent();return[2,(0,o.getEnvironment)({config:a,componentName:r,env:e})]}}))}))};t.getEnvironment=getEnvironment;var getGitlabVar=function(e,t,r,i){return a(void 0,void 0,void 0,(function(){var a;return n(this,(function(n){switch(n.label){case 0:a=(0,o.getSecretVarName)(t,r,i);return[4,(0,s.getVariableValueByRawName)(e,a)];case 1:return[2,n.sent()]}}))}))};t.getGitlabVar=getGitlabVar;var resolveSecrets=function(e,t){return a(void 0,void 0,void 0,(function(){var r;return n(this,(function(a){switch(a.label){case 0:return[4,(0,s.getAllVariables)(e)];case 1:r=a.sent();return[2,Object.fromEntries(t.flatMap((function(e){var t=e.envVars,a=e.secretEnvVarKeys;return Object.entries(t).filter((function(e){var t;var r=i(e,2),n=r[0],o=r[1];return o!==undefined&&o!==null&&!((t=a.find((function(e){return e.key===n})))===null||t===void 0?void 0:t.hidden)})).map((function(e){var t=i(e,2),a=t[0],n=t[1];return[a,r.reduce((function(e,t){return e.replace(new RegExp("\\$"+t.key,"g"),t.value)}),"".concat(n))]}))})))]}}))}))};var getEnvVarsResolved=function(e,r,i){return a(void 0,void 0,void 0,(function(){var a,o;return n(this,(function(n){switch(n.label){case 0:if(!i){return[2,{}]}n.label=1;case 1:n.trys.push([1,3,,4]);return[4,(0,t.getEnvironment)(r,i)];case 2:a=n.sent();return[2,resolveSecrets(e,[{envVars:a.envVars,secretEnvVarKeys:a.secretEnvVarKeys}])];case 3:o=n.sent();return[2,{}];case 4:return[2]}}))}))};t.getEnvVarsResolved=getEnvVarsResolved;var getJobOnlyEnvVarsResolved=function(e,r,i){return a(void 0,void 0,void 0,(function(){var a,o;return n(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,(0,t.getEnvironment)(r,i)];case 1:a=n.sent();return[2,resolveSecrets(e,[a.jobOnlyVars.build,a.jobOnlyVars.deploy])];case 2:o=n.sent();return[2,{}];case 3:return[2]}}))}))};t.getJobOnlyEnvVarsResolved=getJobOnlyEnvVarsResolved},3941:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.parseChoice=void 0;var parseChoice=function(e){var t=r(e.split(":").map((function(e){return e||null})),2),a=t[0],n=t[1];return{env:a,componentName:n}};t.parseChoice=parseChoice},9863:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.readFileOrError=void 0;var o=i(r(5501));var readFile=function(e){return a(void 0,void 0,void 0,(function(){return n(this,(function(t){return[2,o.default.readFile(e,{encoding:"utf-8"})]}))}))};var readFileOrError=function(e){return a(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);return[4,readFile(e)];case 1:t=a.sent();return[2,[null,t]];case 2:r=a.sent();return[2,[r]];case 3:return[2]}}))}))};t.readFileOrError=readFileOrError},2927:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var s=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};var p=this&&this.__values||function(e){var t=typeof Symbol==="function"&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&a>=e.length)e=void 0;return{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.upsertAllVariables=t.clearBackups=t.getVariableValueByRawName=t.getAllVariables=t.getProjectInfo=t.doGitlabRequest=t.getGitlabToken=t.setupGitlabToken=t.hasGitlabToken=void 0;var d=r(603);var c=r(5763);var u=r(3255);var f=l(r(5839));var m=l(r(6372));var h=l(r(4247));var v=r(2636);var y="gitlab-personal-access-token";var hasGitlabToken=function(){return n(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,(0,v.hasPreference)(y)];case 1:return[2,e.sent()]}}))}))};t.hasGitlabToken=hasGitlabToken;var setupGitlabToken=function(e){return n(void 0,void 0,void 0,(function(){var t,r;return i(this,(function(a){switch(a.label){case 0:e.log("");e.log("☝ in order to access the api, we need a personal access token");e.log("Its best to create one specifically for catladder");e.log("");e.log("☝ we open up the settings page for you!");e.log("");return[4,e.prompt({default:true,message:"Ok",name:"shouldContinue",type:"prompt"})];case 1:t=a.sent().shouldContinue;(0,h.default)("https://git.panter.ch/-/profile/personal_access_tokens");e.log("Please type in gitlab's personal access token");return[4,e.prompt({type:"string",name:"personalToken",default:"",message:"Your personal access token "})];case 2:r=a.sent().personalToken;if(!r)return[3,4];return[4,(0,v.setPreference)(y,r)];case 3:a.sent();a.label=4;case 4:return[2]}}))}))};t.setupGitlabToken=setupGitlabToken;var getGitlabToken=function(e){return n(void 0,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,(0,t.hasGitlabToken)()];case 1:if(!!r.sent())return[3,3];if(!e){console.error("⚠️ gitlab token missing, please run catladder to set it up");process.exit(1)}return[4,(0,t.setupGitlabToken)(e)];case 2:r.sent();r.label=3;case 3:return[2,(0,v.getPreference)(y)]}}))}))};t.getGitlabToken=getGitlabToken;var doGitlabRequest=function(e,r){var a=[];for(var p=2;p<arguments.length;p++){a[p-2]=arguments[p]}return n(void 0,s([e,r],o(a),false),void 0,(function(e,r,a,n){var o,s,p,l,d,c,u;if(a===void 0){a=undefined}if(n===void 0){n="GET"}return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.getGitlabToken)(e)];case 1:o=i.sent();return[4,(0,m.default)("https://git.panter.ch/api/v4/".concat(r),{method:n,headers:{"Content-Type":"application/json","Private-Token":o},body:a?JSON.stringify(a):undefined})];case 2:s=i.sent();if(s.status>=200&&s.status<400){if(s.headers.get("content-type")==="application/json"){return[2,s.json()]}return[2,null]}if(s.status===404){throw new Error("not found")}p=Error.bind;d=(l="Could not send request to gitlab api ".concat(r,": ").concat(s.status,' "').concat(s.statusText,'".\nResponse: ')).concat;u=(c=JSON).stringify;return[4,s.json()];case 3:throw new(p.apply(Error,[void 0,d.apply(l,[u.apply(c,[i.sent(),null,2])])]))}}))}))};t.doGitlabRequest=doGitlabRequest;var getProjectInfo=function(e){return n(void 0,void 0,void 0,(function(){var r,a,n;return i(this,(function(i){switch(i.label){case 0:return[4,(0,c.exec)("git config --get remote.origin.url")];case 1:r=i.sent().stdout.trim();a=/(https:\/\/|git@)git\.panter\.ch[:/]([^.]*)(\.git)?/g.exec(r);return[4,(0,t.doGitlabRequest)(e,"projects/".concat(encodeURIComponent(a[2])))];case 2:n=i.sent();return[2,n]}}))}))};t.getProjectInfo=getProjectInfo;t.getAllVariables=(0,f.default)((function(e){var r=[];for(var a=1;a<arguments.length;a++){r[a-1]=arguments[a]}return n(void 0,s([e],o(r),false),void 0,(function(e,r){var a,n,p,l,d;if(r===void 0){r=5}return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.getProjectInfo)(e)];case 1:a=i.sent().id;n=[];p=[];l=1;i.label=2;case 2:d=Array.from({length:r},(function(r,n){return(0,t.doGitlabRequest)(e,"projects/".concat(a,"/variables?per_page=100&page=").concat(l+n))}));return[4,Promise.all(d)];case 3:p=i.sent();l+=r;n=s(s([],o(n),false),o(p.flat()),false);i.label=4;case 4:if(p.length>0&&p[p.length-1].length>0)return[3,2];i.label=5;case 5:return[2,n]}}))}))}),{promise:true});var getVariableValueByRawName=function(e,r){return n(void 0,void 0,void 0,(function(){var a;var n;return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.getAllVariables)(e)];case 1:a=i.sent();return[2,(n=a.find((function(e){return e.key===r})))===null||n===void 0?void 0:n.value]}}))}))};t.getVariableValueByRawName=getVariableValueByRawName;var b=new RegExp("^[a-zA-Z0-9_+=/@:.~-]{8,}$");var isMaskable=function(e){return b.test(e)};var createVariable=function(e,r,a,p){var l=[];for(var d=4;d<arguments.length;d++){l[d-4]=arguments[d]}return n(void 0,s([e,r,a,p],o(l),false),void 0,(function(e,r,a,n,o,s){if(o===void 0){o=true}if(s===void 0){s="*"}return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.doGitlabRequest)(e,"projects/".concat(r,"/variables"),{key:a,value:n,masked:o&&isMaskable(n),environment_scope:s},"POST")];case 1:return[2,i.sent()]}}))}))};var updateVariable=function(e,r,a,p){var l=[];for(var d=4;d<arguments.length;d++){l[d-4]=arguments[d]}return n(void 0,s([e,r,a,p],o(l),false),void 0,(function(e,r,a,n,o){if(o===void 0){o=true}return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.doGitlabRequest)(e,"projects/".concat(r,"/variables/").concat(a),{value:n,masked:o&&isMaskable(n)},"PUT")];case 1:return[2,i.sent()]}}))}))};var deleteVariable=function(e,r,a){return n(void 0,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,(0,t.doGitlabRequest)(e,"projects/".concat(r,"/variables/").concat(a),undefined,"DELETE")];case 1:return[2,n.sent()]}}))}))};var getAllCatladderEnvVarsInGitlab=function(e){return n(void 0,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,(0,t.getAllVariables)(e).then((function(e){return e.reduce((function(e,t){var r,n;var i,p,l,d;var c=t.key;if(c.startsWith("CL_")){var u=c.match(/(CL_.*)_backup_([0-9]+)/);if(u){var f=u[1];var m=Number(u[2]);var h=s(s([],o((p=(i=e[f])===null||i===void 0?void 0:i.backups)!==null&&p!==void 0?p:[]),false),[m],false);return a(a({},e),(r={},r[f]=a(a({},(l=e[f])!==null&&l!==void 0?l:{}),{backups:h}),r))}return a(a({},e),(n={},n[c]=a(a({backups:[]},(d=e[c])!==null&&d!==void 0?d:{}),{value:t.value}),n))}return e}),{})}))];case 1:r=n.sent();return[2,r]}}))}))};var getBackupKey=function(e,t){return"".concat(e,"_backup_").concat(t)};var clearBackups=function(e,r){return n(void 0,void 0,void 0,(function(){var a,n,s,l,d,c,u,f,m,h,v,y,b,g;var w,_,S,O;return i(this,(function(i){switch(i.label){case 0:return[4,getAllCatladderEnvVarsInGitlab(e)];case 1:a=i.sent();return[4,(0,t.getProjectInfo)(e)];case 2:n=i.sent().id;i.label=3;case 3:i.trys.push([3,14,15,16]);s=p(Object.entries(a)),l=s.next();i.label=4;case 4:if(!!l.done)return[3,13];d=o(l.value,2),c=d[0],u=d[1].backups;f=u.sort((function(e,t){return t-e}));m=f.slice(r);i.label=5;case 5:i.trys.push([5,10,11,12]);h=(S=void 0,p(m)),v=h.next();i.label=6;case 6:if(!!v.done)return[3,9];y=v.value;return[4,deleteVariable(e,n,getBackupKey(c,y))];case 7:i.sent();i.label=8;case 8:v=h.next();return[3,6];case 9:return[3,12];case 10:b=i.sent();S={error:b};return[3,12];case 11:try{if(v&&!v.done&&(O=h.return))O.call(h)}finally{if(S)throw S.error}return[7];case 12:l=s.next();return[3,4];case 13:return[3,16];case 14:g=i.sent();w={error:g};return[3,16];case 15:try{if(l&&!l.done&&(_=s.return))_.call(s)}finally{if(w)throw w.error}return[7];case 16:return[2]}}))}))};t.clearBackups=clearBackups;var upsertAllVariables=function(e,r,a,l){var c=[];for(var f=4;f<arguments.length;f++){c[f-4]=arguments[f]}return n(void 0,s([e,r,a,l],o(c),false),void 0,(function(e,r,a,n,s,l){var c,f,m,h,v,y,b,g,w,_,S,O,A;var N,C;var k;if(s===void 0){s=true}if(l===void 0){l=true}return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.getProjectInfo)(e)];case 1:c=i.sent().id;return[4,getAllCatladderEnvVarsInGitlab(e)];case 2:f=i.sent();i.label=3;case 3:i.trys.push([3,14,15,16]);m=p(Object.entries(r!==null&&r!==void 0?r:{})),h=m.next();i.label=4;case 4:if(!!h.done)return[3,13];v=o(h.value,2),y=v[0],b=v[1];g=(0,d.getSecretVarName)(a,n,y);w=(0,u.isObject)(b)?JSON.stringify(b):"".concat(b);_=(0,u.has)(f,g);S=(k=f[g])===null||k===void 0?void 0:k.value;O=S!==w;if(!O)return[3,11];if(!_)return[3,8];e.log("changed: ".concat(y));return[4,updateVariable(e,c,g,w,l)];case 5:i.sent();if(!s)return[3,7];return[4,createVariable(e,c,getBackupKey(g,(new Date).getTime()),S,l,"_backup")];case 6:i.sent();i.label=7;case 7:return[3,10];case 8:e.log("new : ".concat(y));return[4,createVariable(e,c,g,w,l)];case 9:i.sent();i.label=10;case 10:return[3,12];case 11:e.log("skip : ".concat(y));i.label=12;case 12:h=m.next();return[3,4];case 13:return[3,16];case 14:A=i.sent();N={error:A};return[3,16];case 15:try{if(h&&!h.done&&(C=m.return))C.call(m)}finally{if(N)throw N.error}return[7];case 16:t.getAllVariables.clear();return[2]}}))}))};t.upsertAllVariables=upsertAllVariables},2636:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.setPreference=t.getPreference=t.hasPreference=void 0;var s=o(r(5501));var p=r(2037);var l=r(8033);var d="".concat((0,p.homedir)(),"/.catladder");var c="".concat(d,"/preferences.yml");var getPreferences=function(){return n(void 0,void 0,void 0,(function(){var e;var t;return i(this,(function(r){switch(r.label){case 0:return[4,s.default.pathExists(c)];case 1:if(!!r.sent())return[3,3];return[4,s.default.createFile(c)];case 2:r.sent();r.label=3;case 3:e=l.parse;return[4,s.default.readFile(c,{encoding:"utf-8"})];case 4:return[2,(t=e.apply(void 0,[r.sent()]))!==null&&t!==void 0?t:{}]}}))}))};var hasPreference=function(e){return n(void 0,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,getPreferences()];case 1:t=r.sent();return[2,e in t]}}))}))};t.hasPreference=hasPreference;var getPreference=function(e){return n(void 0,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,getPreferences()];case 1:t=r.sent();return[2,t[e]]}}))}))};t.getPreference=getPreference;var setPreference=function(e,t){return n(void 0,void 0,void 0,(function(){var r,n;var o;return i(this,(function(i){switch(i.label){case 0:return[4,getPreferences()];case 1:r=i.sent();n=a(a({},r),(o={},o[e]=t,o));return[4,s.default.writeFile(c,(0,l.stringify)(n))];case 2:i.sent();return[2]}}))}))};t.setPreference=setPreference},9011:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.getProjectNamespace=t.hasGitlabCiFile=t.readRootGitlabCiFile=t.getRootGitlabCiFile=t.getGitRoot=void 0;var o=r(1017);var s=r(5264);var p=r(9863);var l=r(5763);var getGitRoot=function(){return a(void 0,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,l.exec)("git rev-parse --show-toplevel")];case 1:return[2,t.sent().stdout.trim()];case 2:e=t.sent();return[2,null];case 3:return[2]}}))}))};t.getGitRoot=getGitRoot;var getRootGitlabCiFile=function(){return a(void 0,void 0,void 0,(function(){var e;return n(this,(function(r){switch(r.label){case 0:return[4,(0,t.getGitRoot)()];case 1:e=r.sent();return[2,(0,o.join)(e,".gitlab-ci.yml")]}}))}))};t.getRootGitlabCiFile=getRootGitlabCiFile;var readRootGitlabCiFile=function(){return a(void 0,void 0,void 0,(function(){var e;return n(this,(function(r){switch(r.label){case 0:e=p.readFileOrError;return[4,(0,t.getRootGitlabCiFile)()];case 1:return[2,e.apply(void 0,[r.sent()])]}}))}))};t.readRootGitlabCiFile=readRootGitlabCiFile;var hasGitlabCiFile=function(){return a(void 0,void 0,void 0,(function(){var e,r,a;return n(this,(function(n){switch(n.label){case 0:return[4,(0,t.readRootGitlabCiFile)()];case 1:e=i.apply(void 0,[n.sent(),2]),r=e[0],a=e[1];if(r){return[2,false]}return[2,true]}}))}))};t.hasGitlabCiFile=hasGitlabCiFile;var getProjectNamespace=function(e){return a(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(a){switch(a.label){case 0:t=(0,s.parseChoice)(e).env;return[4,(0,s.getProjectConfig)()];case 1:r=a.sent();return[2,"".concat(r.customerName,"-").concat(r.appName,"-").concat(t)]}}))}))};t.getProjectNamespace=getProjectNamespace},2376:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var a=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.bashEscape=t.joinBashExpressions=t.getBashVariable=t.BashExpression=void 0;var n=function(){function BashExpression(e){this.value=e}BashExpression.prototype.toJSON=function(){return this.toString()};BashExpression.prototype.toString=function(){return this.value.toString()};BashExpression.prototype.toLowerCase=function(){return this.transformWithCommand("awk '{print tolower($0)}'")};BashExpression.prototype.concat=function(){var e;var t=[];for(var n=0;n<arguments.length;n++){t[n]=arguments[n]}return new BashExpression((e=this.toString()).concat.apply(e,a([],r(t.map((function(e){return e.toString()}))),false)))};BashExpression.prototype.transformWithCommand=function(e){return new BashExpression('$(printf %s "'.concat(this.toString(),'" | ').concat(e,")"))};return BashExpression}();t.BashExpression=n;var getBashVariable=function(e){return new n("$".concat(e))};t.getBashVariable=getBashVariable;var joinBashExpressions=function(e,t){if(t===void 0){t=""}var r=e.some((function(e){return e instanceof n}));if(r){return new n(e.map((function(e){return e instanceof n?e.toString():e})).join(t))}else{return e.join(t)}};t.joinBashExpressions=joinBashExpressions;var bashEscape=function(e){if(e instanceof n){return e.toString()}if(typeof e==="string")return e.replace(/"/g,'\\"');return e};t.bashEscape=bashEscape},612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getBashExpressionPerPipelineType=void 0;var getBashExpressionPerPipelineType=function(e,t){if(!t)return e.default;return e[t]||e.default};t.getBashExpressionPerPipelineType=getBashExpressionPerPipelineType},4660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeBashYamlToFileScript=t.yamlBashString=void 0;var a=r(8033);var n=r(2376);var i={tag:"",resolve:function(e){return new n.BashExpression(e)},stringify:function(e,t){return"|-\n"+e.value.transformWithCommand("sed 's/^/".concat(t.indent,"/'"))},identify:function(e){return e instanceof n.BashExpression}};var yamlBashString=function(e){return(0,a.stringify)(e,{defaultStringType:"BLOCK_LITERAL",defaultKeyType:"PLAIN",customTags:[i],aliasDuplicateObjects:false,lineWidth:0})};t.yamlBashString=yamlBashString;var writeBashYamlToFileScript=function(e,r){return["cat > ".concat(r," <<EOF\n").concat((0,t.yamlBashString)(e),"\nEOF\n")]};t.writeBashYamlToFileScript=writeBashYamlToFileScript},8133:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.getInjectVarsScript=void 0;var n=r(3255);var i=r(2376);var getInjectVarsScript=function(e){if(!e)return[];return Object.entries(e).filter((function(e){var t=a(e,2),r=t[1];return!(0,n.isNil)(r)})).map((function(e){var t=a(e,2),r=t[0],n=t[1];return"export ".concat(r,'="').concat(n?(0,i.bashEscape)(n):"",'"')}))};t.getInjectVarsScript=getInjectVarsScript},2233:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});var i=r(2376);function replaceAsync(e,t,r){return a(this,void 0,void 0,(function(){var a,o,s,p,l,d;return n(this,(function(n){switch(n.label){case 0:a=e instanceof i.BashExpression;n.label=1;case 1:n.trys.push([1,3,,4]);o=[];String.prototype.replace.call(e.toString(),t,(function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}var a=r.apply(undefined,e);o.push(a);return""}));return[4,Promise.all(o)];case 2:s=n.sent();p=s.some((function(e){return e instanceof i.BashExpression}));l=String.prototype.replace.call(e.toString(),t,(function(){var e,t;return(t=(e=s.shift())===null||e===void 0?void 0:e.toString())!==null&&t!==void 0?t:""}));if(a||p){return[2,new i.BashExpression(l)]}else{return[2,l]}return[3,4];case 3:d=n.sent();return[2,Promise.reject(d)];case 4:return[2]}}))}))}t["default"]=replaceAsync},8774:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createBuildJobArtifacts=void 0;var o=r(1017);var s=r(1853);var p=r(3255);var l=r(8052);var createBuildJobArtifacts=function(e){var t,r;var n=e.type==="workspace"?e.components.flatMap((function(e){return getArtifactsPathForComponent(e)})):getArtifactsPathForComponent(e,["__build_info.json"]);var i=e.type==="workspace"?e.components.flatMap((function(e){return getDotEnvPathsForComponent(e)})):getDotEnvPathsForComponent(e);return a(a({paths:(0,p.uniq)(n).sort((function(e,t){return e.localeCompare(t)}))},i.length>0?{exclude:i}:{}),{expire_in:"1 day",when:"always",reports:e.type==="component"&&(0,s.componentContextIsStandaloneBuild)(e)?{junit:(r=(t=e.build.config.artifactsReports)===null||t===void 0?void 0:t.junit)===null||r===void 0?void 0:r.map((function(t){return(0,o.join)(e.build.dir,t)}))}:{}})};t.createBuildJobArtifacts=createBuildJobArtifacts;var getArtifactsPathForComponent=function(e,t){var r,a;return(a=i(i([],n((r=e.build.config.artifactsPaths)!==null&&r!==void 0?r:[]),false),n(t!==null&&t!==void 0?t:[]),false))===null||a===void 0?void 0:a.flatMap((function(t){return e.build.getComponentDirs("all").flatMap((function(e){return(0,o.join)(e,t)}))}))};var getDotEnvPathsForComponent=function(e){if((0,l.componentContextNeedsBuildTimeDotEnv)(e)){return[(0,o.join)(e.build.dir,".env")]}return[]}},2786:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.RUNNER_BUILD_RESOURCE_VARIABLES=t.APP_BUILD_JOB_NAME=void 0;t.APP_BUILD_JOB_NAME="🔨 app";t.RUNNER_BUILD_RESOURCE_VARIABLES={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"}},7801:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createAppBuildJob=void 0;var s=r(3255);var p=r(603);var l=r(2497);var d=r(8774);var c=r(5043);var u=r(2786);var f=r(9578);var m=r(8052);var createAppBuildJob=function(e,t){var r,h,v;var y=t.script,b=t.variables,g=t.runnerVariables,w=n(t,["script","variables","runnerVariables"]);return(0,s.merge)({name:u.APP_BUILD_JOB_NAME,envMode:"jobPerEnv",stage:"build",image:(0,p.getRunnerImage)("jobs-default"),needs:[],cache:[],variables:a(a({},b!==null&&b!==void 0?b:{}),e.type==="component"?a(a(a({},e.environment.envVars),e.environment.jobOnlyVars.build.envVars),(r=e.build.config.extraVars)!==null&&r!==void 0?r:{}):{}),runnerVariables:a(a(a({},u.RUNNER_BUILD_RESOURCE_VARIABLES),g!==null&&g!==void 0?g:{}),(h=e.build.config.runnerVariables)!==null&&h!==void 0?h:{}),script:o(o(o(o(o([],i(e.type==="component"?(0,m.componentContextNeedsBuildTimeDotEnv)(e)?(0,m.writeDotEnv)(e):[]:e.type==="workspace"?e.components.filter((function(e){return(0,m.componentContextNeedsBuildTimeDotEnv)(e)})).flatMap((function(e){return(0,m.writeDotEnv)(e)})):[]),false),i(e.type==="component"?(0,f.writeBuildInfo)(e):[]),false),i((0,c.ensureNodeVersion)(e)),false),["cd ".concat(e.build.dir)],false),i((v=(0,l.ensureArray)(y))!==null&&v!==void 0?v:[]),false),artifacts:(0,d.createBuildJobArtifacts)(e)},w)};t.createAppBuildJob=createAppBuildJob},2820:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createArtifactsConfig=void 0;var o=r(1017);var createArtifactsConfig=function(e,t,r){var s,p,l,d;return t||r?{artifacts:a(a({paths:[]},r),{reports:a(a({},r===null||r===void 0?void 0:r.reports),{junit:[t===null||t===void 0?void 0:t.junit,Array.isArray((s=r===null||r===void 0?void 0:r.reports)===null||s===void 0?void 0:s.junit)&&((p=r===null||r===void 0?void 0:r.reports)===null||p===void 0?void 0:p.junit),typeof((l=r===null||r===void 0?void 0:r.reports)===null||l===void 0?void 0:l.junit)==="string"&&[(d=r===null||r===void 0?void 0:r.reports)===null||d===void 0?void 0:d.junit]].filter(Array.isArray).reduce((function(t,r){return i(i([],n(t),false),n(r.map((function(t){return(0,o.join)(e,t)}))),false)}),[])})})}:undefined};t.createArtifactsConfig=createArtifactsConfig},9366:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createWorkspaceBuildJobs=t.createComponentBuildJobs=void 0;var o=r(4986);var s=r(1724);var p=r(9641);var l=r(7038);var d=r(2786);var c=r(7801);var createComponentBuildJobs=function(e,t){var r;return i(i(i([],n(t.appBuild&&(0,s.componentContextIsStandaloneBuild)(e)?[(0,c.createAppBuildJob)(e,t.appBuild)]:[]),false),n((0,p.requiresDockerBuild)(e)?[(0,p.createDockerBuildJobBase)(e,a(a({},t.dockerBuild),{needs:i(i([],n((r=t.dockerBuild.needs)!==null&&r!==void 0?r:[]),false),n(t.appBuild&&(0,s.componentContextIsStandaloneBuild)(e)?[d.APP_BUILD_JOB_NAME]:(0,s.componentContextHasWorkspaceBuild)(e)?[{job:d.APP_BUILD_JOB_NAME,artifacts:true,workspaceName:e.build.workspaceName}]:[]),false)}))]:[]),false),n((0,o.sbomDeactivated)(e)?[]:[(0,l.createSbomBuildJob)(e)]),false)};t.createComponentBuildJobs=createComponentBuildJobs;var createWorkspaceBuildJobs=function(e,t){return t.appBuild?[(0,c.createAppBuildJob)(e,t.appBuild)]:[]};t.createWorkspaceBuildJobs=createWorkspaceBuildJobs},9578:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeBuildInfo=void 0;var writeBuildInfo=function(e){return['echo \'{"id":"'.concat(e.environment.envVars.BUILD_INFO_BUILD_ID,'","time":"').concat(e.environment.envVars.BUILD_INFO_BUILD_TIME,"\"}' > ").concat(e.build.dir,"/__build_info.json")]};t.writeBuildInfo=writeBuildInfo},8052:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.componentContextNeedsBuildTimeDotEnv=t.writeDotEnv=void 0;var n=r(3255);var i=r(8490);var o=r(7827);var writeDotEnv=function(e){var t=e.environment.envVars;var r=Object.entries(t).filter((function(e){var t=a(e,2),r=t[1];return!(0,n.isNil)(r)})).filter((function(e){var t=a(e,1),r=t[0];return!o.ALL_BUILD_VARIABLES.includes(r)})).map((function(e){var t=a(e,2),r=t[0],n=t[1];return"".concat(r,"=").concat(n===null||n===void 0?void 0:n.toString().replaceAll("\n","\\n"))})).join("\n");return(0,i.collapseableSection)("write-dotenv-"+e.name,"write dot env")(["cat <<EOF > ".concat(e.build.dir,"/.env\n").concat(r,"\nEOF")])};t.writeDotEnv=writeDotEnv;var componentContextNeedsBuildTimeDotEnv=function(e){return e.componentConfig.dotEnv===true};t.componentContextNeedsBuildTimeDotEnv=componentContextNeedsBuildTimeDotEnv},1637:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createCustomBuildJobs=void 0;var i=r(2497);var o=r(9641);var s=r(4466);var p=r(9366);var l={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"};var createCustomBuildJobs=function(e){var t;var r=e.build.config;if(!(0,s.isOfBuildType)(r,"custom")){throw new Error("deploy config is not custom")}return(0,p.createComponentBuildJobs)(e,{appBuild:r.buildCommand!==null?{image:r.jobImage,runnerVariables:l,cache:r.jobCache,services:r.jobServices,script:n([],a((t=(0,i.ensureArray)(r.buildCommand))!==null&&t!==void 0?t:[]),false)}:undefined,dockerBuild:{script:(0,o.getDockerBuildScriptWithBuiltInDockerFile)(e),variables:{}}})};t.createCustomBuildJobs=createCustomBuildJobs},1183:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createCustomJobs=void 0;var i=r(1637);var o=r(390);var createCustomJobs=function(e){return n(n([],a((0,o.createCustomTestJobs)(e)),false),a((0,i.createCustomBuildJobs)(e)),false)};t.createCustomJobs=createCustomJobs},390:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createCustomTestJobs=void 0;var o=r(2497);var s=r(4466);var p=r(2820);var l={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"};var createCustomTestJobs=function(e){var t,r,d,c,u,f,m,h,v,y,b,g,w,_,S,O,A,N,C;if(e.trigger==="taggedRelease"){return[]}var k=e.build.config;if(!(0,s.isOfBuildType)(k,"custom")){throw new Error("deploy config is not custom")}var T={variables:a(a({APP_PATH:e.build.dir},e.environment.jobOnlyVars.build.envVars),(t=k.extraVars)!==null&&t!==void 0?t:{}),runnerVariables:l,services:k.jobServices,cache:k.jobCache,stage:"test",needs:[],envMode:"none"};var D=k.audit?a(a(a({name:"🛡 audit"},T),{image:(d=(r=k.audit)===null||r===void 0?void 0:r.jobImage)!==null&&d!==void 0?d:k.jobImage,cache:undefined,script:i([],n((u=(0,o.ensureArray)((c=k.audit)===null||c===void 0?void 0:c.command))!==null&&u!==void 0?u:[]),false),allow_failure:true}),(0,p.createArtifactsConfig)(e.build.dir,(f=k.audit)===null||f===void 0?void 0:f.artifactsReports,(m=k.audit)===null||m===void 0?void 0:m.artifacts)):null;var I=k.lint?a(a(a({name:"👮 lint"},T),{image:(v=(h=k.lint)===null||h===void 0?void 0:h.jobImage)!==null&&v!==void 0?v:k.jobImage,script:i([],n((b=(0,o.ensureArray)((y=k.lint)===null||y===void 0?void 0:y.command))!==null&&b!==void 0?b:[]),false)}),(0,p.createArtifactsConfig)(e.build.dir,(g=k.lint)===null||g===void 0?void 0:g.artifactsReports,(w=k.lint)===null||w===void 0?void 0:w.artifacts)):null;var x=k.test?a(a(a({name:"🧪 test"},T),{image:(S=(_=k.test)===null||_===void 0?void 0:_.jobImage)!==null&&S!==void 0?S:k.jobImage,script:i([],n((A=(0,o.ensureArray)((O=k.test)===null||O===void 0?void 0:O.command))!==null&&A!==void 0?A:[]),false)}),(0,p.createArtifactsConfig)(e.build.dir,(N=k.test)===null||N===void 0?void 0:N.artifactsReports,(C=k.test)===null||C===void 0?void 0:C.artifacts)):null;return[D,I,x].filter(o.notNil)};t.createCustomTestJobs=createCustomTestJobs},9641:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.hasDockerfile=t.getDockerBuildDefaultScript=t.getDockerBuildScriptWithBuiltInDockerFile=t.gitlabDockerLogin=t.createDockerBuildJobBase=t.getDockerJobBaseProps=t.DOCKER_BUILD_JOB_NAME=t.getDockerBuildVariables=t.requiresDockerBuild=t.getDockerImageVariables=void 0;var p=r(7147);var l=r(3255);var d=s(r(1017));var c=r(8483);var u=r(4963);var f=r(6320);var m=r(4058);var h=r(8490);var v={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"2Gi"};var getDockerImageVariables=function(e){var t;var r=(t=e.deploy)===null||t===void 0?void 0:t.config;return a(a({},(0,c.isOfDeployType)(r,"google-cloudrun")?{DOCKER_REGISTRY:(0,u.getArtifactsRegistryHost)(e),DOCKER_IMAGE:(0,u.getArtifactsRegistryImageName)(e),DOCKER_CACHE_IMAGE:(0,u.getArtifactsRegistryBuildCacheImage)(e)}:{DOCKER_REGISTRY:"$CI_REGISTRY",DOCKER_CACHE_IMAGE:"$CI_REGISTRY_IMAGE/caches/"+e.name,DOCKER_IMAGE_NAME:e.env+"/"+e.name,DOCKER_IMAGE:"$CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME"}),{DOCKER_IMAGE_TAG:"$CI_COMMIT_SHA"})};t.getDockerImageVariables=getDockerImageVariables;var requiresDockerBuild=function(e){var t;var r=(t=e.deploy)===null||t===void 0?void 0:t.config;return(0,c.isOfDeployType)(r,"kubernetes","google-cloudrun","dockerTag")||(0,c.isOfDeployType)(r,"custom")&&r.requiresDocker};t.requiresDockerBuild=requiresDockerBuild;var getDockerBuildRunnerVariables=function(){return{DOCKER_HOST:"tcp://0.0.0.0:2375",DOCKER_TLS_CERTDIR:"",DOCKER_DRIVER:"overlay2",DOCKER_BUILDKIT:"1"}};var getDockerAdditions=function(e){var t,r;if(!("docker"in e))return{};if(!e.docker)return{};return{DOCKERFILE_ADDITIONS:"additionsBegin"in e.docker?(t=e.docker.additionsBegin)===null||t===void 0?void 0:t.join("\n"):undefined,DOCKERFILE_ADDITIONS_END:"additionsEnd"in e.docker?(r=e.docker.additionsEnd)===null||r===void 0?void 0:r.join("\n"):undefined}};var getDockerBuildVariables=function(e){var r;return a(a(a({},getDockerAdditions(e.build.config)),{APP_DIR:e.build.dir,DOCKER_BUILD_CONTEXT:"docker"in e.build.config&&e.build.config.docker&&"buildContextLocation"in e.build.config.docker&&((r=e.build.config.docker)===null||r===void 0?void 0:r.buildContextLocation)==="component"?e.build.dir:"."}),(0,t.getDockerImageVariables)(e))};t.getDockerBuildVariables=getDockerBuildVariables;t.DOCKER_BUILD_JOB_NAME="🔨 docker";var getDockerJobBaseProps=function(){return{image:(0,m.getRunnerImage)("docker-build"),services:[{name:"docker:24.0.6-dind",command:["--tls=false"]}],variables:{},runnerVariables:getDockerBuildRunnerVariables()}};t.getDockerJobBaseProps=getDockerJobBaseProps;var createDockerBuildJobBase=function(e,r){var i=r.script,o=n(r,["script"]);return(0,l.merge)(a(a({name:t.DOCKER_BUILD_JOB_NAME,envMode:"jobPerEnv",stage:"build"},(0,t.getDockerJobBaseProps)()),{script:i||[]}),{variables:(0,t.getDockerBuildVariables)(e),runnerVariables:a(a({},v),getDockerBuildRunnerVariables())},o)};t.createDockerBuildJobBase=createDockerBuildJobBase;var gitlabDockerLogin=function(e){return e.deploy&&(0,c.isOfDeployType)(e.deploy.config,"google-cloudrun")?o(o([],i((0,f.gcloudServiceAccountLoginCommands)(e)),false),["gcloud auth configure-docker ".concat((0,u.getArtifactsRegistryHost)(e))],false):["docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY"]};t.gitlabDockerLogin=gitlabDockerLogin;var y={meteor:"ensureMeteorDockerfile",node:"ensureNodeDockerfile",nginx:"ensureNginxDockerfile",custom:null};var getDockerBuildScriptWithBuiltInDockerFile=function(e,r){var a;var n="docker"in e.build.config&&e.build.config.docker&&"type"in e.build.config.docker?(a=e.build.config.docker)===null||a===void 0?void 0:a.type:r;return(0,t.getDockerBuildDefaultScript)(e,n?y[n]:null)};t.getDockerBuildScriptWithBuiltInDockerFile=getDockerBuildScriptWithBuiltInDockerFile;var getDockerBuildDefaultScript=function(e,r){return o(o(o([r!==null&&r!==void 0?r:undefined],i((0,h.collapseableSection)("docker-login","Docker Login")((0,t.gitlabDockerLogin)(e))),false),i((0,h.collapseableSection)("docker-build","Docker build")(["docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile $DOCKER_BUILD_CONTEXT --build-arg BUILDKIT_INLINE_CACHE=1"])),false),i((0,h.collapseableSection)("docker-push","Docker push and tag")(["docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG","docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE","docker push $DOCKER_CACHE_IMAGE"])),false).filter(Boolean)};t.getDockerBuildDefaultScript=getDockerBuildDefaultScript;var hasDockerfile=function(e){return(0,p.existsSync)(d.default.join(e.build.dir,"Dockerfile"))};t.hasDockerfile=hasDockerfile},7862:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});t.WORKSPACE_BUILD_TYPES=t.BUILD_TYPES=void 0;var i=r(1183);var o=r(5734);var s=r(8513);n(r(5734),t);n(r(4466),t);t.BUILD_TYPES={node:{jobs:o.createNodeJobs,defaults:function(){return{buildCommand:"yarn build",startCommand:"yarn start",artifactsPaths:["dist",".next"]}}},"node-static":{jobs:o.createNodeJobs,defaults:function(){return{buildCommand:"yarn build",artifactsPaths:["dist"]}}},storybook:{jobs:o.createStorybookJobs,defaults:function(){return{buildCommand:["yarn build-storybook --quiet -o ./dist"],artifactsPaths:["dist"]}}},meteor:{jobs:o.createMeteorJobs,defaults:function(){return{startCommand:"node main.js",artifactsPaths:["dist"]}}},custom:{jobs:i.createCustomJobs,defaults:function(){return{artifactsPaths:["dist"]}}},rails:{jobs:s.createRailsJobs,defaults:function(){return{startCommand:"/cnb/process/web",cnbBuilder:{image:"heroku/builder:22",packVersion:"0.32.1"}}}}};t.WORKSPACE_BUILD_TYPES={node:{jobs:o.createNodeJobs,defaults:function(){return{buildCommand:"yarn build",lint:{command:"yarn lint"},test:{command:"yarn test"}}}}}},8530:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createNodeDockerJobDefinition=t.createNodeBuildJobDefinition=t.createNodeBuildJobs=void 0;var i=r(4058);var o=r(1724);var s=r(2497);var p=r(9366);var l=r(9641);var d=r(4466);var c=r(2026);var u=r(1765);var f=r(5043);var createNodeBuildJobs=function(e){if(e.type==="workspace"){return(0,p.createWorkspaceBuildJobs)(e,{appBuild:(0,t.createNodeBuildJobDefinition)(e)})}return(0,p.createComponentBuildJobs)(e,{appBuild:(0,o.componentContextIsStandaloneBuild)(e)?(0,t.createNodeBuildJobDefinition)(e):undefined,dockerBuild:(0,t.createNodeDockerJobDefinition)(e)})};t.createNodeBuildJobs=createNodeBuildJobs;var createNodeBuildJobDefinition=function(e){var t,r,o;var p=e.build.config;if(!(0,d.isOfBuildType)(p,"node","node-static","storybook")){throw new Error("deploy config is not node, node-static or storybook")}if(p.buildCommand===null)return undefined;var l=(0,i.getRunnerImage)("jobs-default");var m=(0,f.getYarnInstall)(e);return{image:(t=p.jobImage)!==null&&t!==void 0?t:l,runnerVariables:u.NODE_RUNNER_BUILD_VARIABLES,cache:n(n(n([],a((r=(0,s.ensureArray)(p.jobCache))!==null&&r!==void 0?r:[]),false),a((0,c.getNodeCache)(e)),false),a((0,c.getNextCache)(e)),false),script:n(n([],a(m),false),a((o=(0,s.ensureArray)(p.buildCommand))!==null&&o!==void 0?o:[]),false),jobTags:p.jobTags}};t.createNodeBuildJobDefinition=createNodeBuildJobDefinition;var createNodeDockerJobDefinition=function(e){var t,r;var i=e.build.buildType==="node-static"||e.build.buildType==="storybook"?"nginx":"node";return{script:(0,l.getDockerBuildScriptWithBuiltInDockerFile)(e,i),cache:n([],a((0,c.getYarnCache)(e,"pull")),false),variables:{DOCKER_COPY_AND_INSTALL_APP:(0,f.getDockerAppCopyAndBuildScript)(e),DOCKER_COPY_WORKSPACE_FILES:(r=(t=e.packageManagerInfo)===null||t===void 0?void 0:t.pathsToCopyInDocker.map((function(e){return"COPY --chown=node:node ".concat(e," /app/").concat(e)})))===null||r===void 0?void 0:r.join("\n")}}};t.createNodeDockerJobDefinition=createNodeDockerJobDefinition},2026:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getWorkspaceDefaultCaches=t.getNextCache=t.getNodeCache=t.getNodeModulesCache=t.getYarnCache=void 0;var o=r(3255);var s=r(1017);var p=i(r(4035));var getYarnCache=function(e,t){if(t===void 0){t="pull-push"}var r=e.type==="component"&&e.packageManagerInfo.componentIsInWorkspace;return[r?{key:"yarn",policy:t,paths:[".yarn"]}:{key:(0,p.default)(e.build.dir)+"-yarn",policy:t,paths:[(0,s.join)(e.build.dir,".yarn")]}]};t.getYarnCache=getYarnCache;var getNodeModulesCache=function(e,t){var r;if(t===void 0){t="pull-push"}var i=e.type==="component"&&e.packageManagerInfo.componentIsInWorkspace;return[{key:i?"node-modules-workspace":(0,p.default)(e.build.dir)+"-node-modules",policy:t,paths:n([],a(i?(0,o.uniq)(n(["node_modules"],a((r=e.packageManagerInfo.workspaces.map((function(e){return(0,s.join)(e.location,"node_modules")})))!==null&&r!==void 0?r:[]),false)):[(0,s.join)(e.build.dir,"node_modules")]),false)}]};t.getNodeModulesCache=getNodeModulesCache;var getNodeCache=function(e,r){if(r===void 0){r="pull-push"}return n(n(n([],a((0,t.getYarnCache)(e,r)),false),a((0,t.getNodeModulesCache)(e,r)),false),a(e.type==="workspace"?(0,t.getWorkspaceDefaultCaches)(e):[]),false)};t.getNodeCache=getNodeCache;var getNextCache=function(e){var t=e.name+"-next-cache";var r=e.build.getComponentDirs("direct").map((function(e){return(0,s.join)(e,".next/cache")}));return[{key:t,policy:"pull-push",paths:r}]};t.getNextCache=getNextCache;var getWorkspaceDefaultCaches=function(e){return[{key:e.name+"-turbo",policy:"pull-push",paths:[(0,s.join)(e.build.dir,".turbo")]}]};t.getWorkspaceDefaultCaches=getWorkspaceDefaultCaches},1765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.NODE_RUNNER_BUILD_VARIABLES=void 0;t.NODE_RUNNER_BUILD_VARIABLES={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"}},5734:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createMeteorJobs=t.createStorybookJobs=t.createNodeJobs=void 0;var i=r(8530);var o=r(1089);var s=r(8630);var createNodeJobs=function(e){return n(n([],a((0,s.createNodeTestJobs)(e)),false),a((0,i.createNodeBuildJobs)(e)),false)};t.createNodeJobs=createNodeJobs;var createStorybookJobs=function(e){return n([],a((0,i.createNodeBuildJobs)(e)),false)};t.createStorybookJobs=createStorybookJobs;var createMeteorJobs=function(e){return n(n([],a((0,s.createNodeTestJobs)(e)),false),a((0,o.createMeteorBuildJobs)(e)),false)};t.createMeteorJobs=createMeteorJobs},1089:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createMeteorBuildJobs=void 0;var i=r(1017);var o=r(4058);var s=r(9366);var p=r(9641);var l=r(4466);var d=r(2026);var c=r(5043);var getMeteorCache=function(e){return[{key:e.name+"meteor-build-cache",policy:"pull-push",paths:[(0,i.join)(e.build.dir,".meteor/local/resolver-result-cache.json"),(0,i.join)(e.build.dir,".meteor/local/plugin-cache"),(0,i.join)(e.build.dir,".meteor/local/isopacks"),(0,i.join)(e.build.dir,".meteor/local/bundler-cache/scanner")]}]};var createMeteorBuildJobs=function(e){var t=e.build.config;if(!(0,l.isOfBuildType)(t,"meteor")){throw new Error("deploy config is not meteor")}var r=(0,c.getYarnInstall)(e);return(0,s.createComponentBuildJobs)(e,{appBuild:t.buildCommand!==null?{cache:n(n([],a((0,d.getNodeCache)(e)),false),a(getMeteorCache(e)),false),image:(0,o.getRunnerImage)("jobs-meteor"),variables:{METEOR_DISABLE_OPTIMISTIC_CACHING:"1"},script:n(n([],a(r),false),['echo "add healthcheck package"',"meteor add panter:healthroute --allow-superuser","meteor add qualia:prod-shell --allow-superuser",'TOOL_NODE_FLAGS="--max_old_space_size=3584 --min_semi_space_size=8 --max_semi_space_size=256 --optimize_for_size" meteor build ./dist --architecture os.linux.x86_64 --allow-superuser --server-only --directory',"cp ./__build_info.json ./dist/bundle/programs/server"],false)}:undefined,dockerBuild:{script:(0,p.getDockerBuildScriptWithBuiltInDockerFile)(e,"meteor"),variables:{METEOR_INSTALL_SCRIPTS:t.installScripts?"true":""}}})};t.createMeteorBuildJobs=createMeteorBuildJobs},8630:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createNodeTestJobs=void 0;var o=r(4058);var s=r(1724);var p=r(2497);var l=r(2820);var d=r(2026);var c=r(1765);var u=r(5043);var createNodeTestJobs=function(e){var t,r,f,m,h,v,y,b,g,w,_,S,O,A,N,C,k,T,D;if(e.trigger==="taggedRelease"){return[]}if(e.type==="component"&&!(0,s.componentContextIsStandaloneBuild)(e)){return[]}var I=(0,o.getRunnerImage)("jobs-default");var x={variables:a({APP_PATH:e.build.dir},e.type==="component"?a(a({},e.environment.jobOnlyVars.build.envVars),(t=e.build.config.extraVars)!==null&&t!==void 0?t:{}):{}),runnerVariables:c.NODE_RUNNER_BUILD_VARIABLES,stage:"test",needs:[],envMode:"none"};var P=e.build.config;var j=(0,u.getYarnInstall)(e);var L=P.audit!==false?a(a(a({name:"🛡 audit"},x),{image:(f=(r=P.audit)===null||r===void 0?void 0:r.jobImage)!==null&&f!==void 0?f:I,cache:undefined,script:i(["cd ".concat(e.build.dir)],n((h=(0,p.ensureArray)((m=P.audit)===null||m===void 0?void 0:m.command))!==null&&h!==void 0?h:[e.packageManagerInfo.isClassic?"yarn audit":"yarn npm audit --environment production"]),false),allow_failure:true}),(0,l.createArtifactsConfig)(e.build.dir,(v=P.audit)===null||v===void 0?void 0:v.artifactsReports,(y=P.audit)===null||y===void 0?void 0:y.artifacts)):null;var R=P.lint!==false?a(a(a({name:"👮 lint"},x),{image:(g=(b=P.lint)===null||b===void 0?void 0:b.jobImage)!==null&&g!==void 0?g:I,cache:(0,d.getNodeCache)(e),script:i(i(i(i([],n((0,u.ensureNodeVersion)(e)),false),["cd ".concat(e.build.dir)],false),n(j),false),n((_=(0,p.ensureArray)((w=P.lint)===null||w===void 0?void 0:w.command))!==null&&_!==void 0?_:["yarn lint"]),false)}),(0,l.createArtifactsConfig)(e.build.dir,(S=P.lint)===null||S===void 0?void 0:S.artifactsReports,(O=P.lint)===null||O===void 0?void 0:O.artifacts)):null;var B=P.test!==false?a(a(a({name:"🧪 test"},x),{image:(N=(A=P.test)===null||A===void 0?void 0:A.jobImage)!==null&&N!==void 0?N:(0,o.getRunnerImage)("jobs-testing-chrome"),cache:(0,d.getNodeCache)(e),script:i(i(i(i([],n((0,u.ensureNodeVersion)(e)),false),["cd ".concat(e.build.dir)],false),n(j),false),n((k=(0,p.ensureArray)((C=P.test)===null||C===void 0?void 0:C.command))!==null&&k!==void 0?k:["yarn test"]),false)}),(0,l.createArtifactsConfig)(e.build.dir,(T=P.test)===null||T===void 0?void 0:T.artifactsReports,(D=P.test)===null||D===void 0?void 0:D.artifacts)):null;return[L,R,B].filter(p.notNil)};t.createNodeTestJobs=createNodeTestJobs},5043:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getDockerAppCopyAndBuildScript=t.getYarnInstall=t.ensureNodeVersion=void 0;var i=r(2376);var o=r(2497);var s=r(8490);var p="yarn install --frozen-lockfile";var l="yarn workspaces focus --production && yarn rebuild";var getYarnInstallCommand=function(e){if(e.packageManagerInfo.isClassic){return p}return"yarn install --immutable"};var ensureNodeVersion=function(e){return(0,s.collapseableSection)("nodeinstall","Ensure node version")(["if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi","if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi"])};t.ensureNodeVersion=ensureNodeVersion;var getYarnInstall=function(e,r){var i;var p=e.type!=="workspace"&&"postInstall"in e.build.config?e.build.config.postInstall:null;return n(n(n([],a((0,t.ensureNodeVersion)(e)),false),a((0,s.collapseableSection)("yarninstall","Yarn install")([getYarnInstallCommand(e)])),false),a(p&&!(r===null||r===void 0?void 0:r.noCustomPostInstall)?(0,s.collapseableSection)("postinstall","Custom post install")((i=(0,o.ensureArray)(p))!==null&&i!==void 0?i:[]):[]),false)};t.getYarnInstall=getYarnInstall;var d="COPY --chown=node:node $APP_DIR .";var getDockerAppCopyAndBuildScript=function(e){if(e.packageManagerInfo.isClassic){return new i.BashExpression("\nRUN ".concat(p," --production --ignore-scripts\n").concat(d,"\nRUN ").concat(p," --production \n ").trim())}var t=["2","3"].some((function(t){return e.packageManagerInfo.version.startsWith(t)}));var r=t?"RUN yarn plugin import workspace-tools":"";return new i.BashExpression("\n".concat(d,"\n").concat(r,"\nRUN ").concat(l,"\n\n ").trim())};t.getDockerAppCopyAndBuildScript=getDockerAppCopyAndBuildScript},7261:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createRailsBuildJobs=void 0;var o=r(603);var s=r(9366);var p=r(9641);var l=r(4466);var createRailsBuildJobs=function(e){var t,r,d;var c=e.build.config;if(!(0,l.isOfBuildType)(c,"rails")){throw new Error("build type is not rails")}if(!(0,o.componentContextIsStandaloneBuild)(e)){throw new Error("workspace builds are not supported for rails apps")}if((0,p.hasDockerfile)(e)){return(0,s.createComponentBuildJobs)(e,{appBuild:undefined,dockerBuild:{script:(0,p.getDockerBuildDefaultScript)(e),variables:{}}})}var u=c.cnbBuilder;var f=Object.entries((t=u===null||u===void 0?void 0:u.buildVars)!==null&&t!==void 0?t:{}).map((function(e){var t=n(e,2),r=t[0],a=t[1];return"--env '".concat(r).concat(a?"=".concat(a):"","'")})).join(" ");return(0,s.createComponentBuildJobs)(e,{appBuild:undefined,dockerBuild:{variables:a(a({},e.environment.jobOnlyVars.build.envVars),e.build.config.extraVars),script:i(i([],n((0,p.gitlabDockerLogin)(e)),false),["cd ".concat(e.build.dir),"docker pull $DOCKER_CACHE_IMAGE || true","wget --output-document=- https://github.com/buildpacks/pack/releases/download/v".concat(u===null||u===void 0?void 0:u.packVersion,"/pack-v").concat(u===null||u===void 0?void 0:u.packVersion,"-linux.tgz | tar -zx --directory /usr/local/bin pack"),"chmod +x /usr/local/bin/pack","sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock",'pack build "$DOCKER_IMAGE:$DOCKER_IMAGE_TAG" --builder \''.concat(u===null||u===void 0?void 0:u.image,'\' --publish --cache-image "$DOCKER_CACHE_IMAGE" ').concat(f," ").concat((d=(r=u===null||u===void 0?void 0:u.packExtraArgs)===null||r===void 0?void 0:r.join(" "))!==null&&d!==void 0?d:"")],false)}})};t.createRailsBuildJobs=createRailsBuildJobs},8513:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createRailsJobs=void 0;var i=r(7261);var o=r(7910);var createRailsJobs=function(e){return n(n([],a((0,o.createRailsTestJobs)(e)),false),a((0,i.createRailsBuildJobs)(e)),false)};t.createRailsJobs=createRailsJobs},7910:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createRailsTestJobs=void 0;var o=r(603);var s=r(2497);var createRailsTestJobs=function(e){var t,r,p,l,d,c,u,f,m,h,v,y,b,g,w,_;if(e.trigger==="taggedRelease"){return[]}if(!(0,o.componentContextIsStandaloneBuild)(e)){return[]}var S=e.build.config;var O={variables:a(a({},e.environment.jobOnlyVars.build.envVars),(t=S.extraVars)!==null&&t!==void 0?t:{}),stage:"test",needs:[],envMode:"none"};var A="docker.io/ruby";var N="tmp/cache";var C=["bundle config set path '".concat(N,"'"),"bundle install -j $(nproc)"];var k={key:{files:["Gemfile.lock"],prefix:"$CI_JOB_IMAGE"},paths:[N]};var T=S.audit!==false?a(a({name:"🛡 audit"},O),{cache:undefined,image:(l=(p=(r=S.audit)===null||r===void 0?void 0:r.jobImage)!==null&&p!==void 0?p:S.jobImage)!==null&&l!==void 0?l:A,script:i(["cd ".concat(e.build.dir)],n((c=(0,s.ensureArray)((d=S.audit)===null||d===void 0?void 0:d.command))!==null&&c!==void 0?c:["gem install bundler-audit","bundle audit check"]),false),allow_failure:true}):null;var D=S.lint!==false?a(a({name:"👮 lint"},O),{cache:k,image:(m=(f=(u=S.lint)===null||u===void 0?void 0:u.jobImage)!==null&&f!==void 0?f:S.jobImage)!==null&&m!==void 0?m:A,script:i(i(["cd ".concat(e.build.dir)],n(C),false),n((v=(0,s.ensureArray)((h=S.lint)===null||h===void 0?void 0:h.command))!==null&&v!==void 0?v:["bundle exec rubocop"]),false)}):null;var I=S.test!==false?a(a({name:"🧪 test"},O),{cache:k,image:(g=(b=(y=S.test)===null||y===void 0?void 0:y.jobImage)!==null&&b!==void 0?b:S.jobImage)!==null&&g!==void 0?g:A,script:i(i(["cd ".concat(e.build.dir)],n(C),false),n((_=(0,s.ensureArray)((w=S.test)===null||w===void 0?void 0:w.command))!==null&&_!==void 0?_:["bundle exec rspec"]),false)}):null;return[T,D,I].filter(s.notNil)};t.createRailsTestJobs=createRailsTestJobs},7038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createSbomBuildJob=t.SBOM_FILE=t.SBOM_BUILD_JOB_NAME=void 0;var a=r(7862);var n=r(2497);t.SBOM_BUILD_JOB_NAME="🧾 sbom";t.SBOM_FILE="__sbom.json";var createSbomBuildJob=function(e){var r,i,o,s;var p=e.build.config;var l="aquasec/trivy:0.38.3";var d=['trivy fs --quiet --format cyclonedx --output "'.concat(t.SBOM_FILE,'" ').concat(e.packageManagerInfo.componentIsInWorkspace?".":e.build.dir)];var c=(0,a.isStandaloneBuildConfig)(p)&&p.type==="custom"&&p.sbom!==false?(i=(r=p.sbom)===null||r===void 0?void 0:r.jobImage)!==null&&i!==void 0?i:l:l;var u=(0,a.isStandaloneBuildConfig)(p)&&p.type==="custom"&&p.sbom!==false?(s=(0,n.ensureArray)((o=p.sbom)===null||o===void 0?void 0:o.command))!==null&&s!==void 0?s:d:d;return{name:t.SBOM_BUILD_JOB_NAME,stage:"build",envMode:"jobPerEnv",variables:{},cache:undefined,image:c,script:u,allow_failure:true,artifacts:{paths:[t.SBOM_FILE]}}};t.createSbomBuildJob=createSbomBuildJob},4466:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isOfBuildType=t.isStandaloneBuildConfig=void 0;var isStandaloneBuildConfig=function(e){if(!e)return false;return!("from"in e)};t.isStandaloneBuildConfig=isStandaloneBuildConfig;var isOfBuildType=function(e){var r=[];for(var a=1;a<arguments.length;a++){r[a-1]=arguments[a]}if(!(0,t.isStandaloneBuildConfig)(e))return false;return r.includes(e.type)};t.isOfBuildType=isOfBuildType},9609:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getAllEnvsByTrigger=t.getAllEnvsInAllComponents=t.getAllEnvs=void 0;var i=r(1853);var getConfiguredAndDefaultEnvs=function(e,t,r){var i,o;var s=(i=e.components[t].env)!==null&&i!==void 0?i:{};var p=r.filter((function(e){return s[e]!==false}));var l=Object.entries((o=e.components[t].env)!==null&&o!==void 0?o:{}).filter((function(e){var t=a(e,2),n=t[1];return n&&"type"in n&&n.type&&r.includes(n.type)})).map((function(e){var t=a(e,1),r=t[0];return r}));return n([],a(new Set(n(n([],a(p),false),a(l),false))),false)};var getAllEnvs=function(e,t){return getConfiguredAndDefaultEnvs(e,t,i.DEFAULT_ENV_TYPES)};t.getAllEnvs=getAllEnvs;var getAllEnvsInAllComponents=function(e){return n([],a(new Set(Object.keys(e.components).flatMap((function(r){return(0,t.getAllEnvs)(e,r)})))),false)};t.getAllEnvsInAllComponents=getAllEnvsInAllComponents;var getAllEnvsByTrigger=function(e,t,r){var a=(0,i.getEnvTypesByTrigger)(r);return getConfiguredAndDefaultEnvs(e,t,a)};t.getAllEnvsByTrigger=getAllEnvsByTrigger},3352:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});n(r(9609),t);n(r(501),t)},501:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.readConfig=void 0;var s=r(7147);var p=r(8186);var l=r(8033);var fullPath=function(e,t){return e+"/catladder."+t};var readConfig=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return a(void 0,o([],i(e),false),void 0,(function(e){var t,r,a,i;if(e===void 0){e=process.cwd()}return n(this,(function(n){switch(n.label){case 0:t=["ts","js","yml","yaml"].find((function(t){return(0,s.existsSync)(fullPath(e,t))}));if(!t)return[3,3];r=fullPath(e,t);if(!(t==="ts"||t==="js"))return[3,2];return[4,p.require(r,e)];case 1:a=n.sent();i=a.default.default||a.default;return[2,{path:r,ext:t,config:i}];case 2:return[2,{path:r,ext:t,config:(0,l.parse)((0,s.readFileSync)(r,{encoding:"utf-8"}))}];case 3:return[2,null]}}))}))};t.readConfig=readConfig},2898:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DOCKER_REGISTRY=t.PIPELINE_IMAGE_TAG=void 0;t.PIPELINE_IMAGE_TAG=process.env.INLINE_PIPELINE_IMAGE_TAG||"latest";t.DOCKER_REGISTRY=process.env.INLINE_DOCKER_REGISTRY||"git.panter.ch:5001/catladder/catladder"},8375:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});t.createAllComponentsContext=void 0;var i=r(9609);var o=r(2775);var createAllComponentsContext=function(e){return a(void 0,[e],void 0,(function(e){var t=e.config,r=e.trigger,s=e.pipelineType;return n(this,(function(e){switch(e.label){case 0:return[4,Promise.all(Object.keys(t.components).flatMap((function(e){var p=(0,i.getAllEnvsByTrigger)(t,e,r);return p.map((function(i){return a(void 0,void 0,void 0,(function(){return n(this,(function(a){switch(a.label){case 0:return[4,(0,o.createComponentContext)({config:t,componentName:e,env:i,trigger:r,pipelineType:s})];case 1:return[2,a.sent()]}}))}))}))})))];case 1:return[2,e.sent()]}}))}))};t.createAllComponentsContext=createAllComponentsContext},2775:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var s=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createComponentContext=void 0;var p=r(3255);var l=r(7862);var d=r(8483);var c=r(6451);var u=r(2497);var f=r(5699);var m=r(3663);var createComponentContext=function(e){return n(void 0,void 0,void 0,(function(){var t,r,n,h,v,y,b,g,w,_,S,O,A,N,C,k;var T;return i(this,(function(i){switch(i.label){case 0:if(!/^[a-z0-9-]+$/.test(e.componentName)){throw new Error("componentName may only contain lower case letters, numbers and -")}return[4,(0,c.getPackageManagerInfoForComponent)(e.config,e.componentName)];case 1:t=i.sent();r=(0,m.getEnvironmentContext)(e);n=r.envConfigRaw;h=(0,l.isStandaloneBuildConfig)(n.build)?n.build.type:(T=e.config.builds)===null||T===void 0?void 0:T[n.build.from].type;if(!h){throw new Error("build type not found, is the build config correct?")}v=n.deploy?{build:l.BUILD_TYPES[h].defaults(r),deploy:d.DEPLOY_TYPES[n.deploy.type].defaults(r)}:{build:l.BUILD_TYPES[h].defaults(r),deploy:{}};y=(0,u.mergeWithMergingArrays)(v,n);return[4,(0,f.getEnvironment)(e)];case 2:b=i.sent();g=y.deploy,w=y.build,_=y.customJobs,S=y.dir;O=function(e){var r;return s([S],o(e==="all"?(r=t.currentWorkspaceDependencies)!==null&&r!==void 0?r:[]:[]),false)};A=function(){var t;if((0,l.isStandaloneBuildConfig)(w)){return{dir:S,getComponentDirs:O,config:w,buildType:w.type,type:"standalone"}}var r=(t=e.config.builds)===null||t===void 0?void 0:t[w.from];if(!r){throw new Error("build.from not found in config")}return{dir:S,getComponentDirs:O,config:w,workspaceBuildConfig:r,workspaceName:w.from,buildType:r.type,type:"fromWorkspace"}};N=A();C={type:"component",name:e.componentName,componentName:e.componentName,env:e.env,fullConfig:e.config,componentConfig:y,build:N,deploy:g?{config:g}:null,environment:b,packageManagerInfo:t,pipelineType:e.pipelineType,trigger:e.trigger};k=(0,p.isFunction)(_)?_(C):_;return[2,a(a({},C),{customJobs:k})]}}))}))};t.createComponentContext=createComponentContext},6558:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});t.createWorkspaceContext=void 0;var i=r(603);var o=r(6451);var s=r(2497);var p=r(3255);function createWorkspaceContext(e){return a(this,arguments,void 0,(function(e){var t,r,a;var l;var d,c;var u=e.env,f=e.components,m=e.workspaceName,h=e.config,v=e.pipelineType,y=e.trigger;return n(this,(function(e){switch(e.label){case 0:t=(d=h.builds)===null||d===void 0?void 0:d[m];if(!t){throw new Error("Workspace ".concat(m," not found in config"))}r=i.WORKSPACE_BUILD_TYPES[t.type].defaults();a=(0,s.mergeWithMergingArrays)(r,t);l={name:m,pipelineType:v,trigger:y,type:"workspace",workspaceConfig:a,env:u,components:f,fullConfig:h};return[4,(0,o.getPackageManagerInfoBase)()];case 1:return[2,(l.packageManagerInfo=e.sent(),l.build={type:"workspace",dir:(c=a.dir)!==null&&c!==void 0?c:".",getComponentDirs:function(e){return(0,p.uniq)(f.flatMap((function(t){return t.build.getComponentDirs(e)})))},buildType:a.type,config:a},l)]}}))}))}t.createWorkspaceContext=createWorkspaceContext},7827:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.getBuildInfoVariables=t.ALL_BUILD_VARIABLES=void 0;var n=r(2376);var i=r(612);var o={BUILD_INFO_BUILD_ID:{default:new n.BashExpression("$(git describe --tags 2>/dev/null || git rev-parse HEAD)")},BUILD_INFO_BUILD_TIME:{default:"unknown-build-time",gitlab:new n.BashExpression("$CI_JOB_STARTED_AT")},BUILD_INFO_CURRENT_VERSION:{default:new n.BashExpression('$(tag=$(git ls-remote origin "refs/tags/v*[0-9]" 2>/dev/null | cut -f 2- | sort -V | tail -1 | sed \'s/refs\\/tags\\/v//\'); [ -z "$tag" ] && echo "0.0.0" || echo "$tag")')}};t.ALL_BUILD_VARIABLES=Object.keys(o);var getBuildInfoVariables=function(e){var t=e.pipelineType;return Object.fromEntries(Object.entries(o).map((function(e){var r=a(e,2),n=r[0],o=r[1];return[n,(0,i.getBashExpressionPerPipelineType)(o,t)]})))};t.getBuildInfoVariables=getBuildInfoVariables},6476:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvConfig=void 0;var a=r(2497);var getEnvConfig=function(e,t,r){var n,i;var o=e.components[t];if(!o){throw new Error("unknown component "+t)}var s=(i=(n=o.env)===null||n===void 0?void 0:n[r])!==null&&i!==void 0?i:{};if(s===false){throw new Error("env is disabled: "+r+":"+t)}return(0,a.mergeWithMergingArrays)(o,s)};t.getEnvConfig=getEnvConfig},1593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvType=void 0;var a=r(1853);var getEnvType=function(e,t){if(t.type)return t.type;if((0,a.isKnowEnvType)(e)){return e}throw new Error("unknown env type: "+e)};t.getEnvType=getEnvType},5699:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});t.getEnvironment=void 0;var o=r(3663);var s=r(5133);var getEnvironment=function(e){return n(void 0,void 0,void 0,(function(){var t,r,n,p;return i(this,(function(i){switch(i.label){case 0:t=e.env;return[4,(0,s.getEnvironmentVariables)(e)];case 1:r=i.sent();n=(0,o.getEnvironmentContext)(e);p=n.envType;return[2,a({envType:p,fullName:n.fullName,slugPrefix:n.environmentSlugPrefix,reviewSlug:n.reviewSlug,slug:n.environmentSlug,shortName:t},r)]}}))}))};t.getEnvironment=getEnvironment},3663:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvironmentContext=void 0;var a=r(2376);var n=r(6476);var i=r(1593);var o=r(4993);var getEnvironmentSlugPrefix=function(e,t){if(t){return(0,a.joinBashExpressions)([e,t],"-")}return e};var getEnvironmentContext=function(e){var t=e.env,r=e.componentName,s=e.config,p=e.pipelineType;var l=(0,n.getEnvConfig)(s,r,t);var d=(0,i.getEnvType)(t,l);var c=(0,o.getReviewSlug)(l,t,p);var u=getEnvironmentSlugPrefix(t,c);var f=u.concat("-".concat(r));var m=(0,a.joinBashExpressions)([s.customerName,s.appName,f],"-");return{envConfigRaw:l,deployConfigRaw:l.deploy,buildConfigRaw:l.build,environmentSlugPrefix:u,environmentSlug:f,reviewSlug:c,pipelineType:p,fullName:m,envType:d,componentName:r,env:t,fullConfig:s}};t.getEnvironmentContext=getEnvironmentContext},5133:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var s=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getSecretVarNameForContext=t.getSecretVarName=t.getEnvironmentVariables=void 0;var p=r(3255);var l=r(8483);var d=r(2376);var c=r(4466);var u=r(7827);var f=r(3663);var m=r(3115);var h=r(1552);var v=r(6296);var getBasePredefinedVariables=function(e){return a({ENV_SHORT:e.env,APP_DIR:e.envConfigRaw.dir,ENV_TYPE:e.envType},e.envType!=="local"?(0,u.getBuildInfoVariables)(e):{})};var getEnvironmentVariables=function(e){var r=[];for(var u=1;u<arguments.length;u++){r[u-1]=arguments[u]}return n(void 0,s([e],o(r),false),void 0,(function(e,r){var u,y,b,g,w,_,S,O,A,N,C,k,T,D,I,x,P,j,L,R,B,M,V,U,$;var q,W;var K,G,J,Y,z,H,Q,X,Z;if(r===void 0){r={}}return i(this,(function(ee){switch(ee.label){case 0:u=(0,f.getEnvironmentContext)(e);y=e.config,b=e.env,g=e.componentName;w=u.envConfigRaw,_=u.deployConfigRaw,S=u.buildConfigRaw,O=u.envType;A=getBasePredefinedVariables(u);if(O==="local"){T=w;D=(K=T.port)!==null&&K!==void 0?K:3e3;C="localhost:"+D.toString();k="http://"+C;N=a(a(a(a({},A),{ENV_SHORT:"local",ROOT_URL:k}),(0,c.isStandaloneBuildConfig)(S)&&S.type==="rails"?{}:{HOST:C}),{HOST_INTERNAL:C,ROOT_URL_INTERNAL:"http://"+C,PORT:D.toString()})}else{I=_?l.DEPLOY_TYPES[_.type].getAdditionalEnvVars(u):{};x=(G=I.HOST_INTERNAL)!==null&&G!==void 0?G:"unknown-host.example.com";C=(J=w===null||w===void 0?void 0:w.host)!==null&&J!==void 0?J:x;k=(0,d.joinBashExpressions)(["https://",C]);N=a(a(a(a({},A),(0,c.isStandaloneBuildConfig)(S)&&S.type==="rails"?{}:{HOST:C}),{ROOT_URL:k,HOST_INTERNAL:x,HOST_CANONICAL:x,ROOT_URL_INTERNAL:(0,d.joinBashExpressions)(["https://",x])}),I)}P=(z=(Y=w.vars)===null||Y===void 0?void 0:Y.public)!==null&&z!==void 0?z:{};j=_?l.DEPLOY_TYPES[_.type].additionalSecretKeys(u):[];L=s(s([],o((0,v.stringListToSecreteEnvVarList)((Q=(H=w.vars)===null||H===void 0?void 0:H.secret)!==null&&Q!==void 0?Q:[])),false),o(j),false);R=(0,v.makeSecretEnvVarMapping)(b,g,L);B=(Z=(X=w.vars)===null||X===void 0?void 0:X.fromComponents)!==null&&Z!==void 0?Z:{};M=(0,p.merge)({},(0,m.translateLegacyFromComponents)(B),P);V=(0,v.stringifyValues)(M);U=addIndexVar(a(a(a({},N),R),V));return[4,(0,m.resolveReferences)(U,(function(r,o){return n(void 0,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.getEnvironmentVariables)(a(a({},e),{componentName:r}),o)];case 1:n=i.sent().envVars;return[2,n]}}))}))}),r)];case 1:$=ee.sent();q={envVars:$,secretEnvVarKeys:L};W={};return[4,(0,h.transformJobOnlyVars)(b,g,S&&(0,c.isStandaloneBuildConfig)(S)&&S.jobVars||null)];case 2:W.build=ee.sent();return[4,(0,h.transformJobOnlyVars)(b,g,_&&_.jobVars||null)];case 3:return[2,(q.jobOnlyVars=(W.deploy=ee.sent(),W),q.host=C,q.url=k,q)]}}))}))};t.getEnvironmentVariables=getEnvironmentVariables;var sanitizeForEnVar=function(e){return e.replace(/-/g,"_")};var getSecretVarName=function(e,t,r){return"CL_".concat(sanitizeForEnVar(e),"_").concat(sanitizeForEnVar(t),"_").concat(r)};t.getSecretVarName=getSecretVarName;var addIndexVar=function(e){return a(a({},e),{_ALL_ENV_VAR_KEYS:JSON.stringify(Object.keys(e))})};var getSecretVarNameForContext=function(e,r){return(0,t.getSecretVarName)(e.env,e.name,r)};t.getSecretVarNameForContext=getSecretVarNameForContext},920:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getLabels=void 0;var i=n(r(4035));var sanitize=function(e){if(!e)return e;return(0,i.default)(e).toLowerCase()};var getLabels=function(e){var t,r;var n=a({"customer-name":sanitize(e.fullConfig.customerName),"component-name":sanitize(e.name),"app-name":sanitize(e.fullConfig.appName),"env-type":sanitize(e.environment.envType),"env-name":sanitize(e.env),"build-type":sanitize(e.build.buildType)},(r=(t=e.fullConfig.meta)===null||t===void 0?void 0:t.labels)!==null&&r!==void 0?r:{});return n};t.getLabels=getLabels},4993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getReviewSlug=void 0;var a=r(2376);var n=r(612);var i=r(1593);var o={default:"unknown-review-slug",gitlab:new a.BashExpression('$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })')};var getReviewSlug=function(e,t,r){var a=(0,i.getEnvType)(t,e);if(a==="review"){return(0,n.getBashExpressionPerPipelineType)(o,r)}return null};t.getReviewSlug=getReviewSlug},5875:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});n(r(2775),t);n(r(5699),t);n(r(5133),t)},3115:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.translateLegacyFromComponents=t.resolveReferences=void 0;var p=r(3255);var l=s(r(2233));var d=/\$\{(([^:}]+):)?([^}]+)}/gm;var resolveReferences=function(e,t){var r=[];for(var s=2;s<arguments.length;s++){r[s-2]=arguments[s]}return a(void 0,o([e,t],i(r),false),void 0,(function(e,t,r){var s,c,u;if(r===void 0){r={}}return n(this,(function(f){switch(f.label){case 0:s=function(c){var u=[];for(var f=1;f<arguments.length;f++){u[f-1]=arguments[f]}return a(void 0,o([c],i(u),false),void 0,(function(i,o){if(o===void 0){o=r}return n(this,(function(r){switch(r.label){case 0:if(!d.test(i.toString()))return[3,2];return[4,(0,l.default)(i,d,(function(r,i,l,d){return a(void 0,void 0,void 0,(function(){var a,i,c,u,f;var m,h;var v,y;return n(this,(function(n){switch(n.label){case 0:if((v=o[l])===null||v===void 0?void 0:v[d]){return[2,r]}a=(0,p.merge)({},o,(m={},m[l]=(h={},h[d]=true,h),m));if(!l)return[3,2];return[4,t===null||t===void 0?void 0:t(l,a).then((function(e){return e===null||e===void 0?void 0:e[d]}))];case 1:c=(y=n.sent())!==null&&y!==void 0?y:null;return[3,3];case 2:c=e[d];n.label=3;case 3:i=c;if(!(i!==null&&i!==undefined))return[3,5];return[4,s(i,a)];case 4:f=n.sent();return[3,6];case 5:f=r;n.label=6;case 6:u=f;return[2,u]}}))}))}))];case 1:return[2,r.sent()];case 2:return[2,i]}}))}))};u=(c=Object).fromEntries;return[4,Promise.all(Object.entries(e).map((function(e){return a(void 0,[e],void 0,(function(e){var t,r;var a=i(e,2),o=a[0],p=a[1];return n(this,(function(e){switch(e.label){case 0:if(p===null||p===undefined){return[2,[o,null]]}t=[o];if(!(p!==null&&p!==undefined))return[3,2];return[4,s(p)];case 1:r=e.sent();return[3,3];case 2:r=null;e.label=3;case 3:return[2,t.concat([r])]}}))}))})))];case 1:return[2,u.apply(c,[f.sent()])]}}))}))};t.resolveReferences=resolveReferences;var translateLegacyFromComponents=function(e){return Object.fromEntries(Object.entries(e).flatMap((function(e){var t=i(e,2),r=t[0],a=t[1];return Object.entries(a).map((function(e){var t=i(e,2),a=t[0],n=t[1];return[a,"${"+r+":"+n+"}"]}))})))};t.translateLegacyFromComponents=translateLegacyFromComponents},1552:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});t.transformJobOnlyVars=void 0;var o=r(6296);var transformJobOnlyVars=function(e,t,r){return n(void 0,void 0,void 0,(function(){var n,s,p,l;var d,c;return i(this,(function(i){if(!r){return[2,{envVars:{},secretEnvVarKeys:[]}]}n=(0,o.stringifyValues)((d=r===null||r===void 0?void 0:r.public)!==null&&d!==void 0?d:{});s=(0,o.stringListToSecreteEnvVarList)((c=r===null||r===void 0?void 0:r.secret)!==null&&c!==void 0?c:[]);p=(r===null||r===void 0?void 0:r.secret)?(0,o.makeSecretEnvVarMapping)(e,t,s):{};l=a(a({},p),n);return[2,{envVars:l,secretEnvVarKeys:s}]}))}))};t.transformJobOnlyVars=transformJobOnlyVars},6296:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.makeSecretEnvVarMapping=t.stringListToSecreteEnvVarList=t.stringifyValues=void 0;var n=r(3255);var i=r(5133);var o=r(2376);var stringifyValues=function(e){return Object.fromEntries(Object.entries(e).map((function(e){var t=a(e,2),r=t[0],i=t[1];return[r,(0,n.isObject)(i)?JSON.stringify(i):"".concat(i)]})))};t.stringifyValues=stringifyValues;var stringListToSecreteEnvVarList=function(e){return e.map((function(e){return{key:e}}))};t.stringListToSecreteEnvVarList=stringListToSecreteEnvVarList;var makeSecretEnvVarMapping=function(e,t,r){return Object.fromEntries(r.map((function(r){var a=r.key;return[a,(0,o.getBashVariable)((0,i.getSecretVarName)(e,t,a))]})))};t.makeSecretEnvVarMapping=makeSecretEnvVarMapping},6484:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BASE_RETRY=void 0;t.BASE_RETRY={max:2,when:["runner_system_failure","stuck_or_timeout_failure"]}},1421:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createDeployJob=t.DEPLOY_JOB_NAME=void 0;var o=r(9641);var s=r(7038);var p=r(1724);var l=r(4986);var d=r(6054);var c=r(2846);var u=r(2422);t.DEPLOY_JOB_NAME="🚀 Deploy";var createDeployJob=function(e,r){var f,m,h,v,y,b,g;var w=(0,o.requiresDockerBuild)(e);var _=(0,d.contextIsStoppable)(e);var S=e.environment.envType==="review"?"1 week":e.environment.envType==="dev"?"4 weeks":undefined;var O=(f=e.deploy)===null||f===void 0?void 0:f.config;var A=O&&O.when?O.when:undefined;var N=e.environment.envType!=="prod"?"auto":((m=e.componentConfig.env)===null||m===void 0?void 0:m.stage)===false?"auto":"manual";var C=A?A:N;return{name:t.DEPLOY_JOB_NAME,script:r.script,image:r.image,cache:r.cache,artifacts:r.artifacts,services:r.services,envMode:"stagePerEnv",needs:i(i([],n((0,l.sbomDeactivated)(e)?[]:[{job:s.SBOM_BUILD_JOB_NAME,artifacts:true}]),false),n(O?(v=(h=O.waitFor)===null||h===void 0?void 0:h.map((function(e){return{componentName:e,job:t.DEPLOY_JOB_NAME,artifacts:false}})))!==null&&v!==void 0?v:[]:[]),false),needsStages:i(i([],n((0,p.componentContextHasWorkspaceBuild)(e)?w?[{stage:"build",artifacts:false}]:[{stage:"build",artifacts:true,workspaceName:e.build.workspaceName}]:[{stage:"build",artifacts:w?false:true}]),false),[{stage:"test",artifacts:false,workspaceName:(0,p.componentContextHasWorkspaceBuild)(e)?e.build.workspaceName:undefined}],false),when:C==="auto"?"on_success":"manual",allow_failure:C==="manual"?true:false,stage:"deploy",variables:a(a(a(a(a({},e.environment.envVars),w?(0,o.getDockerImageVariables)(e):{}),e.environment.jobOnlyVars.deploy.envVars),O?(y=O.extraVars)!==null&&y!==void 0?y:{}:{}),r.variables),runnerVariables:a(a(a({},u.DEPLOY_RUNNER_VARIABLES),(b=r.runnerVariables)!==null&&b!==void 0?b:{}),O?(g=O.runnerVariables)!==null&&g!==void 0?g:{}:{}),environment:_?{on_stop:c.STOP_JOB_NAME,auto_stop_in:S}:undefined,jobTags:O?O.jobTags:undefined}};t.createDeployJob=createDeployJob},2024:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createDeployementJobs=void 0;var i=r(1421);var o=r(9756);var s=r(2846);var createDeployementJobs=function(e,t){return n(n([(0,i.createDeployJob)(e,t.deploy)],a(t.stop?[(0,s.createStopJob)(e,t.stop)]:[]),false),a(t.rollback?[(0,o.createRollbackJob)(e,t.rollback)]:[]),false)};t.createDeployementJobs=createDeployementJobs},9756:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.createRollbackJob=t.ROLLBACK_JOB_NAME=void 0;var n=r(2422);t.ROLLBACK_JOB_NAME="↩️ Rollback ⚠️";var createRollbackJob=function(e,r){var i;return{name:t.ROLLBACK_JOB_NAME,image:r.image,envMode:"stagePerEnv",needs:[],allow_failure:true,when:"manual",variables:a(a({},e.environment.jobOnlyVars.deploy.envVars),r.variables),runnerVariables:a(a(a({},n.DEPLOY_RUNNER_VARIABLES),{GIT_STRATEGY:"none"}),(i=r.runnerVariables)!==null&&i!==void 0?i:{}),stage:"rollback",environment:{action:"access"},script:r.script}};t.createRollbackJob=createRollbackJob},2846:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.createStopJob=t.STOP_JOB_NAME=void 0;var n=r(2422);t.STOP_JOB_NAME="🛑 Stop ⚠️";var createStopJob=function(e,r){return{name:t.STOP_JOB_NAME,image:r.image,envMode:"stagePerEnv",needs:[],allow_failure:true,when:"manual",rules:[{if:"$CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/",when:"on_success"}],variables:a(a({},e.environment.jobOnlyVars.deploy.envVars),r.variables),runnerVariables:a(a(a({},n.DEPLOY_RUNNER_VARIABLES),{GIT_STRATEGY:"none"}),r.runnerVariables),stage:"stop",environment:{action:"stop"},script:r.script}};t.createStopJob=createStopJob},2422:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DEPLOY_RUNNER_VARIABLES=void 0;t.DEPLOY_RUNNER_VARIABLES={KUBERNETES_CPU_REQUEST:"0.22",KUBERNETES_MEMORY_REQUEST:"200Mi",KUBERNETES_MEMORY_LIMIT:"400Mi"}},4963:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getDeleteUnusedImagesCommands=t.getArtifactsRegistryImage=t.getArtifactsRegistryBuildCacheImage=t.getArtifactsRegistryImageName=t.getArtifactsRegistryDockerUrl=t.getArtifactsRegistryHost=void 0;var i=r(2376);var o=r(8490);var s=r(5781);var p=r(4398);var getArtifactsRegistryHost=function(e){var t;if(!(0,s.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"google-cloudrun")){throw new Error("deploy config is wrong")}return"".concat(e.deploy.config.region,"-docker.pkg.dev")};t.getArtifactsRegistryHost=getArtifactsRegistryHost;var getArtifactsRegistryDockerUrl=function(e){var r;var a=(r=e.deploy)===null||r===void 0?void 0:r.config;if(!(0,s.isOfDeployType)(a,"google-cloudrun")){throw new Error("deploy config is wrong")}var n="".concat(e.fullConfig.customerName,"-").concat(e.fullConfig.appName);return"".concat((0,t.getArtifactsRegistryHost)(e),"/").concat(a.projectId,"/catladder-deploy/").concat(n)};t.getArtifactsRegistryDockerUrl=getArtifactsRegistryDockerUrl;var getArtifactsRegistryImageName=function(e,r){if(r===void 0){r=false}if(r&&e.environment.envType!=="review"){throw new Error("lecacyReviewImageName is only allowed for review app")}var o=(0,t.getArtifactsRegistryDockerUrl)(e);var s=n([o,e.env,e.name],a(e.environment.reviewSlug&&!r?[e.environment.reviewSlug]:[]),false);return(0,i.joinBashExpressions)(s,"/")};t.getArtifactsRegistryImageName=getArtifactsRegistryImageName;var getArtifactsRegistryBuildCacheImage=function(e){var r=(0,t.getArtifactsRegistryDockerUrl)(e);var a=[r,"caches",e.name];return a.join("/")};t.getArtifactsRegistryBuildCacheImage=getArtifactsRegistryBuildCacheImage;var getArtifactsRegistryImage=function(e){return"".concat((0,t.getArtifactsRegistryImageName)(e),":$DOCKER_IMAGE_TAG")};t.getArtifactsRegistryImage=getArtifactsRegistryImage;var getDeleteImageCommands=function(e,t){if(t===void 0){t=0}if(t===0){return["gcloud artifacts docker images delete ".concat(e," --quiet --delete-tags")]}var r="gcloud artifacts docker images list ".concat(e,' --sort-by=~CREATE_TIME --format="value(version)"');var a=(0,p.removeFirstLinesFromCommandOutput)(r,t);var n="gcloud artifacts docker images delete ".concat(e,"@$version --quiet --delete-tags");var i="".concat(a," | while read -r version; do ").concat(n,"; done");return[i]};var getDeleteUnusedImagesCommands=function(e,r){var i;if(r===void 0){r=0}var p=(i=e.deploy)===null||i===void 0?void 0:i.config;if(!(0,s.isOfDeployType)(p,"google-cloudrun")){throw new Error("deploy config is wrong")}var l=(0,t.getArtifactsRegistryImageName)(e);var d=(0,t.getArtifactsRegistryBuildCacheImage)(e);return n(n(n([],a(getDeleteImageCommands(l,r)),false),a(getDeleteImageCommands(d,1)),false),a(e.environment.envType==="review"?(0,o.allowFailureInScripts)(getDeleteImageCommands((0,t.getArtifactsRegistryImageName)(e,true),0)):[]),false)};t.getDeleteUnusedImagesCommands=getDeleteUnusedImagesCommands},7888:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getRemoveOldRevisionsAndImagesCommand=void 0;var i=r(4963);var o=r(9067);var getRemoveOldRevisionsAndImagesCommand=function(e,t){if(t==="onStop"){return(0,i.getDeleteUnusedImagesCommands)(e)}var r=e.environment.envType==="prod"?5:0;var s=r+1;var p=(0,o.getDeleteUnusedRevisionsCommands)(e,r);var l=(0,i.getDeleteUnusedImagesCommands)(e,s);return n(n([],a(p),false),a(l),false)};t.getRemoveOldRevisionsAndImagesCommand=getRemoveOldRevisionsAndImagesCommand},9067:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.getDeleteUnusedRevisionsCommands=void 0;var n=r(5781);var i=r(9598);var o=r(8128);var s=r(4398);var getListRevisionsCommand=function(e,t){var r;var s=(0,o.getServiceName)(e);var p=(r=e.deploy)===null||r===void 0?void 0:r.config;if(!p||!(0,n.isOfDeployType)(p,"google-cloudrun")){throw new Error("deploy config is wrong")}var l=a({project:p.projectId,region:p.region,service:s,limit:"unlimited","sort-by":"metadata.creationTimestamp"},t);return"gcloud run revisions list ".concat((0,i.createArgsString)(l))};var getDeleteUnusedRevisionsCommands=function(e,t){var r;var a=(r=e.deploy)===null||r===void 0?void 0:r.config;if(!(0,n.isOfDeployType)(a,"google-cloudrun")){throw new Error("deploy config is wrong")}var o=getListRevisionsCommand(e,{format:'"value(name)"',filter:"'(status.conditions.status=False OR status.conditions.status=Unknown)'"});var p=(0,s.removeFirstLinesFromCommandOutput)(o,t);var l="gcloud run revisions delete ".concat((0,i.createArgsString)({project:a.projectId,region:a.region,quiet:true})," $revisionname ");var d="".concat(p," | while read -r revisionname; do ").concat(l,"; done");return[d]};t.getDeleteUnusedRevisionsCommands=getDeleteUnusedRevisionsCommands},1224:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getCreateScheduleScripts=t.getJobCreateScripts=t.getJobRunScripts=t.getDeleteJobsScripts=t.getDeleteSchedulesScripts=void 0;var o=r(8490);var s=r(9598);var p=r(9626);var l=r(3325);var d=r(920);var c=r(847);var u=r(8865);var getJobRunScriptForJob=function(e,t,r){var a=(0,l.getCommonCloudRunArgs)(e);var n=(0,s.createArgsString)(a);return"".concat((0,l.gcloudRunCmd)()," jobs execute ").concat(t.toString()," ").concat(n).concat(r?" --wait":"")};var getDeleteSchedulesScripts=function(e){var t=(0,l.getCloudRunDeployConfig)(e);var r=getCloudRunJobsWithSchedule(e);var a=(0,s.createArgsString)({project:t.projectId,location:t.region});return r.map((function(e){var t=e.schedulerName;return["".concat((0,l.gcloudSchedulerCmd)()," jobs delete ").concat(t," ").concat(a)]})).flat()};t.getDeleteSchedulesScripts=getDeleteSchedulesScripts;var getDeleteJobsScripts=function(e){var t=(0,l.getCommonCloudRunArgs)(e);var r=(0,s.createArgsString)(t);var a=getCloudRunJobsWithNames(e);return a.flatMap((function(e){var t=e.jobName;return["".concat((0,l.gcloudRunCmd)()," jobs executions list ").concat(r," --job ").concat(t,' --format="value(name)" | xargs -I {} ').concat((0,l.gcloudRunCmd)()," jobs executions delete {} --quiet ").concat(r),"".concat((0,l.gcloudRunCmd)()," jobs delete ").concat(t," ").concat(r)]}))};t.getDeleteJobsScripts=getDeleteJobsScripts;var getJobRunScripts=function(e,t){var r=getCloudRunJobsWithNames(e);return r.filter((function(e){var r=e.job;return r.when===t})).map((function(r){var a=r.jobName;return getJobRunScriptForJob(e,a,["preStop","postStop"].includes(t))}))};t.getJobRunScripts=getJobRunScripts;var getJobCreateScripts=function(e){var t=getCloudRunJobsWithNames(e);return t.map((function(t){var r=t.job,a=t.jobName;return getJobCreateScriptsForJob(e,a,r)})).flat()};t.getJobCreateScripts=getJobCreateScripts;var getJobCreateScriptsForJob=function(e,t,r){var p=(0,l.getCommonDeployArgs)(e);var f=Array.isArray(r.command)?r.command:r.command.split(" ");var m=(0,s.createArgsString)(a(a({command:'"'+f.join(",")+'"'},p),{labels:(0,l.makeLabelString)(a(a({},(0,d.getLabels)(e)),{"cloud-run-job-name":t.toString()})),image:r.image||p.image,cpu:r===null||r===void 0?void 0:r.cpu,memory:r.memory||"512Mi","task-timeout":r.timeout||"10m",parallelism:r.parallelism||1,"env-vars-file":u.ENV_VARS_FILENAME,"max-retries":0}));var h=(r===null||r===void 0?void 0:r.volumes)&&Object.keys(r===null||r===void 0?void 0:r.volumes).length>0;var v="".concat(t," ").concat(m);return i(i([],n((0,o.allowFailureInScripts)(["".concat((0,l.gcloudRunCmd)()," jobs create ").concat(v)])),false),["".concat((0,l.gcloudRunCmd)(h?"beta":undefined)," jobs update ").concat(v," ").concat(s.createArgsString.apply(void 0,i([],n((0,c.createVolumeConfig)(r===null||r===void 0?void 0:r.volumes,"job")),false)))],false)};var getCreateScheduleScripts=function(e){var t=getCloudRunJobsWithSchedule(e);var r=(0,l.getCloudRunDeployConfig)(e);return t.map((function(e){var t;var a=e.job,p=e.jobName,d=e.schedulerName;var c=(0,s.createArgsString)({project:r.projectId,location:r.region,schedule:'"'.concat(a.schedule,'"'),"max-retry-attempts":(t=a.maxRetryAttempts)!==null&&t!==void 0?t:0,uri:'"https://'.concat(r.region,"-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(r.projectId,"/jobs/").concat(p,':run"'),"http-method":"POST","oauth-service-account-email":"$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com"});var u="http ".concat(d," ").concat(c);return i(i([],n((0,o.allowFailureInScripts)(["".concat((0,l.gcloudSchedulerCmd)()," jobs create ").concat(u)])),false),["".concat((0,l.gcloudSchedulerCmd)()," jobs update ").concat(u)],false)})).flat()};t.getCreateScheduleScripts=getCreateScheduleScripts;var getCloudRunJobsWithSchedule=function(e){var t=getCloudRunJobsWithNames(e);return t.filter((function(e){return e.job.when==="schedule"})).map((function(e){var t=e.job,r=e.jobName;return{job:t,jobName:r,schedulerName:r.concat("-scheduler")}}))};var getCloudRunJobsWithNames=function(e){var t;var r=(0,l.getCloudRunDeployConfig)(e);var getFullJobName=function(t){return(0,p.getCloudRunJobName)(e.environment.fullName,t)};var a=Object.entries((t=r.jobs)!==null&&t!==void 0?t:{}).filter((function(e){return Boolean(e[1])})).map((function(e){var t=n(e,2),r=t[0],a=t[1];return{jobName:getFullJobName(r),job:a}}));return a}},7334:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getServiceDeleteScript=t.getServiceDeployScript=void 0;var o=r(920);var s=r(9598);var p=r(8128);var l=r(3325);var d=r(8865);var c=r(847);var getServiceDeployScript=function(e,t,r){var u,f,m,h,v;var y=(0,l.getCommonDeployArgs)(e);var b=(0,p.getServiceName)(e);var g=t!==true?t:undefined;var w=t!==true?(u=t===null||t===void 0?void 0:t.command)!==null&&u!==void 0?u:e.build.config.startCommand:undefined;var _=w?Array.isArray(w)?w:w.split(" "):undefined;var S=b.concat(r!==null&&r!==void 0?r:"");var O=s.createArgsString.apply(void 0,i([a(a({command:_?'"'+_.join(",")+'"':'""'},y),{labels:(0,l.makeLabelString)(a(a({},(0,o.getLabels)(e)),{"cloud-run-service-name":S})),"env-vars-file":d.ENV_VARS_FILENAME,"min-instances":(f=g===null||g===void 0?void 0:g.minInstances)!==null&&f!==void 0?f:0,"max-instances":(m=g===null||g===void 0?void 0:g.maxInstances)!==null&&m!==void 0?m:100,"cpu-throttling":(g===null||g===void 0?void 0:g.noCpuThrottling)!==true,cpu:g===null||g===void 0?void 0:g.cpu,memory:g===null||g===void 0?void 0:g.memory,timeout:g===null||g===void 0?void 0:g.timeout,"allow-unauthenticated":(h=g===null||g===void 0?void 0:g.allowUnauthenticated)!==null&&h!==void 0?h:true,ingress:(v=g===null||g===void 0?void 0:g.ingress)!==null&&v!==void 0?v:"all","cpu-boost":true,"execution-environment":g===null||g===void 0?void 0:g.executionEnvironment})],n((0,c.createVolumeConfig)(g===null||g===void 0?void 0:g.volumes,"service")),false));var A=(g===null||g===void 0?void 0:g.volumes)&&Object.keys(g===null||g===void 0?void 0:g.volumes).length>0;return"".concat((0,l.gcloudRunCmd)(A?"beta":undefined)," deploy ").concat(S," ").concat(O)};t.getServiceDeployScript=getServiceDeployScript;var getServiceDeleteScript=function(e,t){var r=(0,l.getCommonCloudRunArgs)(e);var a=(0,s.createArgsString)(r);var n=(0,p.getServiceName)(e);var i=t?"".concat(n,"-").concat(t):n;return["".concat((0,l.gcloudRunCmd)()," services delete ").concat(i," ").concat(a)]};t.getServiceDeleteScript=getServiceDeleteScript},3325:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.getCommonDeployArgs=t.getCommonCloudRunArgs=t.getCloudRunDeployConfig=t.makeLabelString=t.setGoogleProjectNumberScript=t.gcloudSchedulerCmd=t.gcloudRunCmd=t.gcloudCmd=void 0;var i=r(5781);var o=r(4963);var gcloudCmd=function(e){return e?"gcloud ".concat(e):"gcloud"};t.gcloudCmd=gcloudCmd;var gcloudRunCmd=function(e){return"".concat((0,t.gcloudCmd)(e)," run")};t.gcloudRunCmd=gcloudRunCmd;var gcloudSchedulerCmd=function(e){return"".concat((0,t.gcloudCmd)(e)," scheduler")};t.gcloudSchedulerCmd=gcloudSchedulerCmd;var setGoogleProjectNumberScript=function(e){return["export GCLOUD_PROJECT_NUMBER=$(".concat((0,t.gcloudCmd)()," projects describe ").concat(e.projectId,' --format="value(projectNumber)")'),'echo "GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER"']};t.setGoogleProjectNumberScript=setGoogleProjectNumberScript;var makeLabelString=function(e){return Object.entries(e).map((function(e){var t=n(e,2),r=t[0],a=t[1];return"".concat(r,"=").concat(a)})).join(",")};t.makeLabelString=makeLabelString;var getCloudRunDeployConfig=function(e){var t;var r=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,i.isOfDeployType)(r,"google-cloudrun")){throw new Error("deploy config is wrong")}return r};t.getCloudRunDeployConfig=getCloudRunDeployConfig;function getCommonCloudRunArgs(e){var r=(0,t.getCloudRunDeployConfig)(e);return{project:r.projectId,region:r.region}}t.getCommonCloudRunArgs=getCommonCloudRunArgs;function getCommonDeployArgs(e){var r=getCommonCloudRunArgs(e);var n=(0,t.getCloudRunDeployConfig)(e);return a(a({image:(0,o.getArtifactsRegistryImage)(e)},r),{"set-cloudsql-instances":n.cloudSql?n.cloudSql.instanceConnectionName:undefined})}t.getCommonDeployArgs=getCommonDeployArgs},8865:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ENV_VARS_FILENAME=void 0;t.ENV_VARS_FILENAME="____envvars.yaml"},3695:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunDeployScripts=void 0;var i=r(3255);var o=r(8490);var s=r(4986);var p=r(7888);var l=r(8206);var d=r(6320);var c=r(1224);var u=r(7334);var f=r(3325);var m=r(2674);var h=r(8865);var v=r(4660);function getCloudRunDeployScripts(e){var t;var r=(0,f.getCloudRunDeployConfig)(e);var y=(0,i.omit)(e.environment.envVars,m.GCLOUD_DEPLOY_CREDENTIALS_KEY);return n(n(n(n(n([],a((0,o.collapseableSection)("prepare","Prepare...")(n(n([],a((0,d.gcloudServiceAccountLoginCommands)(e)),false),a((0,f.setGoogleProjectNumberScript)(r)),false))),false),a((0,o.collapseableSection)("writeenvvars","Write env vars to file")((0,v.writeBashYamlToFileScript)(y,h.ENV_VARS_FILENAME))),false),a((0,o.collapseableSection)("deploy","Deploy to cloud run")(n(n(n(n(n(n(n([],a(r.cloudSql?(0,l.getDatabaseCreateScript)(e,r):[]),false),a((0,c.getCreateScheduleScripts)(e)),false),a((0,c.getJobCreateScripts)(e)),false),a((0,c.getJobRunScripts)(e,"preDeploy")),false),a(r.service!==false?[(0,u.getServiceDeployScript)(e,r.service)]:[]),false),a(Object.entries((t=r.additionalServices)!==null&&t!==void 0?t:{}).map((function(t){var r=a(t,2),n=r[0],i=r[1];return(0,u.getServiceDeployScript)(e,i,"-"+n)}))),false),a((0,c.getJobRunScripts)(e,"postDeploy")),false))),false),a((0,o.collapseableSection)("cleanup","Cleanup")((0,p.getRemoveOldRevisionsAndImagesCommand)(e,"postDeploy"))),false),a((0,s.getDependencyTrackUploadScript)(e)),false)}t.getCloudRunDeployScripts=getCloudRunDeployScripts},3747:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunStopScripts=void 0;var i=r(4986);var o=r(7888);var s=r(8206);var p=r(6320);var l=r(1224);var d=r(7334);var c=r(3325);function getCloudRunStopScripts(e){var t;var r=(0,c.getCloudRunDeployConfig)(e);return n(n(n(n(n(n(n(n(n(n([],a((0,p.gcloudServiceAccountLoginCommands)(e)),false),a((0,l.getJobRunScripts)(e,"preStop")),false),a(r.service!==false?(0,d.getServiceDeleteScript)(e):[]),false),a(Object.entries((t=r.additionalServices)!==null&&t!==void 0?t:{}).flatMap((function(t){var r=a(t,1),n=r[0];return(0,d.getServiceDeleteScript)(e,n)}))),false),a((0,l.getJobRunScripts)(e,"postStop")),false),a((0,l.getDeleteSchedulesScripts)(e)),false),a((0,l.getDeleteJobsScripts)(e)),false),a(r.cloudSql&&r.cloudSql.deleteDatabaseOnStop?(0,s.getDatabaseDeleteScript)(e,r):[]),false),a((0,o.getRemoveOldRevisionsAndImagesCommand)(e,"onStop")),false),a((0,i.getDependencyTrackDeleteScript)(e)),false)}t.getCloudRunStopScripts=getCloudRunStopScripts},4069:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.createGoogleCloudRunDeployJobs=void 0;var n=r(4058);var i=r(8490);var o=r(2024);var s=r(5781);var p=r(8865);var l=r(3695);var d=r(3747);var createGoogleCloudRunDeployJobs=function(e){var t;var r=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,s.isOfDeployType)(r,"google-cloudrun")){throw new Error("deploy config is wrong")}var c=(0,l.getCloudRunDeployScripts)(e);var u=(0,d.getCloudRunStopScripts)(e);return(0,o.createDeployementJobs)(e,{deploy:a(a({variables:{CLOUDSDK_CORE_DISABLE_PROMPTS:"1"}},r.debug?{artifacts:{paths:[p.ENV_VARS_FILENAME],when:"always"}}:{}),{image:(0,n.getRunnerImage)("gcloud"),script:c}),stop:{image:(0,n.getRunnerImage)("gcloud"),variables:{CLOUDSDK_CORE_DISABLE_PROMPTS:"1"},script:(0,i.allowFailureInScripts)(u)}})};t.createGoogleCloudRunDeployJobs=createGoogleCloudRunDeployJobs},847:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var a=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createVolumeConfig=void 0;var createVolumeConfig=function(e,t){if(!e){return[]}return a(a([],r(Object.entries(e).map((function(e){var t=r(e,2),a=t[0],n=t[1],i=n.type,o=n.bucket,s=n.mountPath,p=n.readonly;return{"add-volume":"name=".concat(a,",type=").concat(i,",bucket=").concat(o).concat(p?",readonly=true":""),"add-volume-mount":"volume=".concat(a,",mount-path=").concat(s)}}))),false),[t==="service"?{"execution-environment":"gen2"}:{}],false)};t.createVolumeConfig=createVolumeConfig},2674:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.GCLOUD_RUN_DEPLOY_TYPE=t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX=t.GCLOUD_DEPLOY_CREDENTIALS_KEY=void 0;var o=r(2376);var s=r(5875);var p=r(8490);var l=r(2089);var d=r(4069);var c=r(8206);var u=r(9626);t.GCLOUD_DEPLOY_CREDENTIALS_KEY="GCLOUD_DEPLOY_credentialsKey";t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX="GCLOUD_RUN_canonicalHostSuffix";var getCloudSqlVariables=function(e){var t,r;var a=e.deployConfigRaw,i=e.environmentSlugPrefix,o=e.env,p=e.componentName,d=e.fullConfig;if(a&&a.cloudSql){var u=(0,l.getFullDbName)(a.cloudSql,d,i,p);var f=Object.entries((t=a.cloudSql.dbAdditionalQueryParams)!==null&&t!==void 0?t:{}).map((function(e){var t=n(e,2),r=t[0],a=t[1];return"&".concat(r,"=").concat(a)})).join("");return{CLOUD_SQL_INSTANCE_CONNECTION_NAME:a.cloudSql.instanceConnectionName,DB_NAME:u,DB_USER:(r=a.cloudSql.dbUser)!==null&&r!==void 0?r:"postgres",DB_PASSWORD:"$"+(0,s.getSecretVarName)(o,p,"DB_PASSWORD"),DATABASE_URL:"".concat((0,c.getDatabaseConnectionString)(a.cloudSql)).concat(f),DATABASE_JDBC_URL:c.DATABASE_JDBC_URL}}return{}};t.GCLOUD_RUN_DEPLOY_TYPE={jobs:d.createGoogleCloudRunDeployJobs,defaults:function(e){var t=e.deployConfigRaw,r=e.envType;if(t&&t.cloudSql){return{cloudSql:{deleteDatabaseOnStop:r==="review"}}}return{}},additionalSecretKeys:function(e){return i([{key:t.GCLOUD_DEPLOY_CREDENTIALS_KEY,hidden:true},{key:t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX,hidden:true}],n(e.deployConfigRaw&&e.deployConfigRaw.cloudSql?[{key:"DB_PASSWORD"}]:[]),false)},getAdditionalEnvVars:function(e){var r=e.fullName,i=e.env,l=e.componentName,d=e.deployConfigRaw;var c=(0,o.joinBashExpressions)([r,(0,o.getBashVariable)((0,s.getSecretVarName)(i,l,t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX))],"-").toLowerCase();var f=d&&d.jobs?Object.fromEntries(Object.entries(d.jobs).map((function(e){var t=n(e,2),a=t[0],i=t[1];return["CLOUD_RUN_JOB_TRIGGER_URL_"+(0,p.sanitizeForBashVariable)(a),"https://".concat(d.region,"-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(d.projectId,"/jobs/").concat((0,u.getCloudRunJobName)(r,a),":run")]}))):{};return a(a(a({HOST_INTERNAL:c},getCloudSqlVariables(e)),f),{DEPLOY_CLOUD_RUN_PROJECT_ID:d?d.projectId:undefined,DEPLOY_CLOUD_RUN_REGION:d?d.region:undefined})}}},9598:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.createArgsString=void 0;var n=r(3255);var createArgsString=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e.map((function(e){return Object.entries(e).filter((function(e){var t=a(e,2),r=t[1];return!(0,n.isNil)(r)})).map((function(e){var t=a(e,2),r=t[0],n=t[1];if(n===true){return"--".concat(r)}else if(n===false){return"--no-".concat(r)}return"--".concat(r,"=").concat(n)}))})).flat().join(" ")};t.createArgsString=createArgsString},8206:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.getDatabaseConnectionString=t.DATABASE_JDBC_URL=t.getDatabaseCreateScript=t.getDatabaseDeleteScript=void 0;var n=r(8490);var getDatabaseDeleteScript=function(e,t){if(!t.cloudSql||!t.cloudSql.deleteDatabaseOnStop){throw new Error("not possible")}var r=e.environment.envVars["DB_NAME"];if(!r){throw new Error("error: env vars did not specify DB_NAME")}var i=a(t.cloudSql.instanceConnectionName.split(":"),3),o=i[0],s=i[1],p=i[2];return['echo "deleting database '.concat(r,'..."'),'echo "👆 this can take multiple attemps (3-5min), because google cloud run may still have a connection to the database after the cloud run service is shut down"',(0,n.repeatOnFailure)("gcloud sql databases delete ".concat(r," --instance=").concat(p," --project ").concat(o),{pauseInSeconds:10})]};t.getDatabaseDeleteScript=getDatabaseDeleteScript;var getDatabaseCreateScript=function(e,t){if(!t.cloudSql){throw new Error("not possible")}var r=e.environment.envVars["DB_NAME"];if(!r){throw new Error("error: env vars did not specify DB_NAME")}var i=a(t.cloudSql.instanceConnectionName.split(":"),3),o=i[0],s=i[1],p=i[2];return(0,n.allowFailureInScripts)(['echo "ensuring Database..."',"gcloud sql databases create ".concat(r," --instance=").concat(p," --project ").concat(o)])};t.getDatabaseCreateScript=getDatabaseCreateScript;t.DATABASE_JDBC_URL="jdbc:postgresql:///$DB_NAME?cloudSqlInstance=$CLOUD_SQL_INSTANCE_CONNECTION_NAME&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=$DB_USER&password=$DB_PASSWORD";var getDatabaseConnectionString=function(e){switch(e.dbConnectionStringFormat){case"jdbc":return t.DATABASE_JDBC_URL;case"rails":return"postgresql://$DB_USER:$DB_PASSWORD@".concat(encodeURIComponent("/cloudsql/".concat(e.instanceConnectionName)),"/$DB_NAME?");default:return"postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME"}};t.getDatabaseConnectionString=getDatabaseConnectionString},6320:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gcloudServiceAccountLoginCommands=void 0;var a=r(2674);var n=r(5875);var gcloudServiceAccountLoginCommands=function(e){return['gcloud auth activate-service-account --key-file=<(echo "$'.concat((0,n.getSecretVarNameForContext)(e,a.GCLOUD_DEPLOY_CREDENTIALS_KEY),'")')]};t.gcloudServiceAccountLoginCommands=gcloudServiceAccountLoginCommands},8128:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getServiceName=void 0;var getServiceName=function(e){return e.environment.fullName.toLowerCase()};t.getServiceName=getServiceName},9626:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunJobName=void 0;var getCloudRunJobName=function(e,t){return e.toLowerCase().concat("-"+t.toLowerCase())};t.getCloudRunJobName=getCloudRunJobName},4398:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.removeFirstLinesFromCommandOutput=void 0;var removeFirstLinesFromCommandOutput=function(e,t){return t===0?e:"".concat(e," | tail -n +").concat(t+1)};t.removeFirstLinesFromCommandOutput=removeFirstLinesFromCommandOutput},2089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getFullDbName=void 0;var a=r(2376);var getFullDbName=function(e,t,r,n){var i,o;return(0,a.joinBashExpressions)([(i=e.dbNamePrefix)!==null&&i!==void 0?i:"".concat(t.customerName,"-").concat(t.appName),r,(o=e.dbBaseName)!==null&&o!==void 0?o:n].flatMap((function(e){return e?[e]:[]})),"-")};t.getFullDbName=getFullDbName},4910:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createCustomDeployJobs=void 0;var i=r(5043);var o=r(4058);var s=r(2024);var p=r(4986);var l=r(5781);var createCustomDeployJobs=function(e){var t,r,d,c;var u=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,l.isOfDeployType)(u,"custom")){throw new Error("deploy config is not custom")}var f=(0,i.getYarnInstall)(e,{noCustomPostInstall:true});return(0,s.createDeployementJobs)(e,{deploy:{image:(r=u.jobImage)!==null&&r!==void 0?r:(0,o.getRunnerImage)("jobs-default"),cache:(d=u.jobCache)!==null&&d!==void 0?d:[],script:n(n(n(["cd ".concat(e.build.dir)],a(u.requiresYarnInstall?f:[]),false),a(u.script),false),a((0,p.getDependencyTrackUploadScript)(e)),false),variables:{}},stop:u.stopScript?{image:(c=u.jobImage)!==null&&c!==void 0?c:(0,o.getRunnerImage)("jobs-default"),script:n(n([],a(u.stopScript),false),a((0,p.getDependencyTrackDeleteScript)(e)),false),variables:{}}:undefined})};t.createCustomDeployJobs=createCustomDeployJobs},2819:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CUSTOM_DEPLOY_TYPE=void 0;var a=r(4910);t.CUSTOM_DEPLOY_TYPE={jobs:a.createCustomDeployJobs,defaults:function(){return{}},additionalSecretKeys:function(){return[]},getAdditionalEnvVars:function(){return{}}}},6794:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createDockerTagDeployJobs=void 0;var o=r(9641);var s=r(2024);var p=r(5781);var createDockerTagDeployJobs=function(e){var t;var r=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,p.isOfDeployType)(r,"dockerTag")){throw new Error("deploy config is not dockerTag")}var l=r.tag;return(0,s.createDeployementJobs)(e,{deploy:a(a({},(0,o.getDockerJobBaseProps)()),{script:i(i([],n((0,o.gitlabDockerLogin)(e)),false),["docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG","docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_IMAGE:".concat(l),"docker push $DOCKER_IMAGE:".concat(l),'echo "pushed as $DOCKER_IMAGE:'.concat(l,'"')],false)})})};t.createDockerTagDeployJobs=createDockerTagDeployJobs},4511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DOCKER_TAG_DEPLOY_TYPE=void 0;var a=r(6794);t.DOCKER_TAG_DEPLOY_TYPE={jobs:a.createDockerTagDeployJobs,defaults:function(){return{}},additionalSecretKeys:function(){return[]},getAdditionalEnvVars:function(){return{}}}},8483:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});t.DEPLOY_TYPES=void 0;var i=r(2674);var o=r(2819);var s=r(4511);var p=r(3397);n(r(2674),t);n(r(3397),t);n(r(5781),t);n(r(6054),t);t.DEPLOY_TYPES={kubernetes:p.KUBERNETES_DEPLOY_TYPE,custom:o.CUSTOM_DEPLOY_TYPE,dockerTag:s.DOCKER_TAG_DEPLOY_TYPE,"google-cloudrun":i.GCLOUD_RUN_DEPLOY_TYPE}},436:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.additionalKubernetesSecretKeys=void 0;var additionalKubernetesSecretKeys=function(e){var t,r,a,n;var i=e.deployConfigRaw;if(!i){return[]}var o=[];if((r=(t=i.values)===null||t===void 0?void 0:t.mongodb)===null||r===void 0?void 0:r.enabled){o.push("MONGODB_ROOT_PASSWORD");if(i.values.mongodb.architecture==="replicaset"){o.push("MONGODB_REPLICASET_KEY")}}if((n=(a=i.values)===null||a===void 0?void 0:a.cloudsql)===null||n===void 0?void 0:n.enabled){o.push("POSTGRESQL_PASSWORD");o.push("cloudsqlProxyCredentials")}return o.map((function(e){return{key:e}}))};t.additionalKubernetesSecretKeys=additionalKubernetesSecretKeys},5129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createKubernetesCloudsqlBaseValues=t.hasKubernetesCloudSQL=void 0;var a=r(5875);var n=r(2089);var i=r(5781);var hasKubernetesCloudSQL=function(e){var t,r,a;var n=(t=e.deploy)===null||t===void 0?void 0:t.config;if((0,i.isOfDeployType)(n,"kubernetes")){return(a=(r=n.values)===null||r===void 0?void 0:r.cloudsql)===null||a===void 0?void 0:a.enabled}return false};t.hasKubernetesCloudSQL=hasKubernetesCloudSQL;var createKubernetesCloudsqlBaseValues=function(e){var t,r,o,s,p,l,d;var c=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,i.isOfDeployType)(c,"kubernetes")){throw new Error("cannot get cloud sql config")}var u=(r=c.values)===null||r===void 0?void 0:r.cloudsql;if(!u){throw new Error("cannot get cloud sql config")}var f="$".concat((0,a.getSecretVarNameForContext)(e,"cloudsqlProxyCredentials"));if((u===null||u===void 0?void 0:u.type)!=="unmanaged"){var m="".concat((o=u.projectId)!==null&&o!==void 0?o:"skynet-164509",":").concat((s=u.region)!==null&&s!==void 0?s:"europe-west6",":").concat((p=u.instanceId)!==null&&p!==void 0?p:e.environment.envVars.KUBE_NAMESPACE);return{cloudsql:{enabled:u.enabled,dbUser:"postgres",instanceConnectionName:m,proxyCredentials:f,fullDbName:(l=e.environment.envVars.KUBE_APP_NAME)!==null&&l!==void 0?l:""}}}else if(u.type==="unmanaged"){return{cloudsql:{enabled:u.enabled,dbUser:(d=u.dbUser)!==null&&d!==void 0?d:"postgres",instanceConnectionName:u.instanceConnectionName,proxyCredentials:f,fullDbName:(0,n.getFullDbName)(u,e.fullConfig,e.environment.slugPrefix,e.name)}}}else{throw new Error("unknonw type")}};t.createKubernetesCloudsqlBaseValues=createKubernetesCloudsqlBaseValues},9139:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createKubernetesDeployJobs=void 0;var o=r(5133);var s=r(4058);var p=r(2024);var l=r(4986);var d=r(5781);var c=r(8772);var u=r(4660);var f=r(8490);var m="__all_values.yml";var createKubernetesDeployJobs=function(e){var t,r,h;var v=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,d.isOfDeployType)(v,"kubernetes")){throw new Error("deploy config is not kubernetes")}var y=a(a({image:(0,s.getRunnerImage)("kubernetes")},v.debug?{artifacts:{paths:[m],when:"always"}}:{}),{variables:a(a({},e.environment.envVars),{RELEASE_NAME:e.environment.fullName,HELM_EXPERIMENTAL_OCI:"1",KUBE_DOCKER_IMAGE_PULL_SECRET:"gitlab-registry-".concat(e.name),HELM_GITLAB_CHART_NAME:(r=v.chartName)!==null&&r!==void 0?r:"/helm-charts/the-panter-chart",HELM_ARGS:i(i([],n(v.debug?["--debug"]:[]),false),n((h=v.additionalHelmArgs)!==null&&h!==void 0?h:[]),false).join(" "),COMPONENT_NAME:e.name,BUILD_ID:e.environment.envVars.BUILD_INFO_BUILD_ID})});var b="kube-".concat(e.environment.fullName);var g=['kubectl config set-cluster "'.concat(b,'" --server="$').concat((0,o.getSecretVarNameForContext)(e,"KUBE_URL"),'" --certificate-authority <(echo $').concat((0,o.getSecretVarNameForContext)(e,"KUBE_CA_PEM")," | base64 -d) --embed-certs=true"),'kubectl config set-credentials "'.concat(b,'" --token="$').concat((0,o.getSecretVarNameForContext)(e,"KUBE_TOKEN"),'"'),'kubectl config set-context "'.concat(b,'" --cluster="').concat(b,'" --user="').concat(b,'" --namespace="').concat(e.environment.envVars.KUBE_NAMESPACE,'"'),'kubectl config use-context "'.concat(b,'"')];return(0,p.createDeployementJobs)(e,{deploy:a(a({},y),{script:i(i(i(i(i([],n(g),false),n((0,f.collapseableSection)("writeallvalues","Write "+m+" for helm deployment")((0,u.writeBashYamlToFileScript)((0,c.createKubeValues)(e),m))),false),["kubernetesCreateSecret","kubernetesDeploy"],false),n((0,l.getDependencyTrackUploadScript)(e)),false),["echo deployment successful 😻"],false)}),stop:a(a({},y),{script:i(i(i([],n(g),false),["kubernetesDelete"],false),n((0,l.getDependencyTrackDeleteScript)(e)),false)}),rollback:a(a({},y),{script:i(i([],n(g),false),["kubernetesRollback"],false)})})};t.createKubernetesDeployJobs=createKubernetesDeployJobs},3397:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.KUBERNETES_DEPLOY_TYPE=void 0;var p=s(r(4035));var l=r(8483);var d=r(2376);var c=r(436);var u=r(9139);n(r(5129),t);t.KUBERNETES_DEPLOY_TYPE={jobs:u.createKubernetesDeployJobs,defaults:function(){return{}},additionalSecretKeys:c.additionalKubernetesSecretKeys,getAdditionalEnvVars:function(e){var t;var r=e.componentName,a=e.fullConfig,n=e.deployConfigRaw,s=e.env,c=e.reviewSlug,u=e.envType;var f=u==="review"&&c?c.concat("-"):"";var m=f.concat(r);var h=(0,l.getKubernetesNamespace)(a,s);var v=(0,p.default)(r);var y=n&&((t=n.cluster)===null||t===void 0?void 0:t.domainCanonical)||a.domainCanonical||"panter.cloud";var b=(0,d.joinBashExpressions)(o(o([v],i(u==="review"&&c?[c]:[]),false),[s,a.appName,a.customerName,y],false),".");return{KUBE_NAMESPACE:h,KUBE_APP_NAME:m,KUBE_APP_NAME_PREFIX:f,HOST_INTERNAL:b}}}},6769:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.createKubeEnv=void 0;var i=r(5781);var shouldGoIntoSecrets=function(e,t){var r;if(!t)return false;if((r=String(t))===null||r===void 0?void 0:r.includes("$CL_")){return true}return false};var createKubeEnv=function(e){var t;if(!(0,i.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"kubernetes")){throw new Error("deploy config is not kubernetes")}var r=e.environment.envVars;var o=Object.entries(r).reduce((function(e,t){var r,i;var o=n(t,2),s=o[0],p=o[1];if(shouldGoIntoSecrets(s,p===null||p===void 0?void 0:p.toString())){e.secret=a(a({},e.secret),(r={},r[s]=p!==null&&p!==void 0?p:"",r));return e}e.public=a(a({},e.public),(i={},i[s]=p!==null&&p!==void 0?p:"",i));return e}),{secret:{},public:{}});return o};t.createKubeEnv=createKubeEnv},8772:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.createKubeValues=void 0;var o=r(3255);var s=r(2497);var p=r(5781);var l=r(5129);var d=r(6769);var c=r(4139);var u=r(6089);var createAppConfig=function(e,t){if(t===false){return{enabled:false}}var r=t!==null&&t!==void 0?t:{},a=r.healthRoute,i=r.command,o=n(r,["healthRoute","command"]);return(0,s.mergeWithMergingArrays)({host:e.environment.host,command:i!==null&&i!==void 0?i:e.build.config.startCommand,livenessProbe:{httpGet:{path:a!==null&&a!==void 0?a:"__health"}},readinessProbe:{httpGet:{path:a!==null&&a!==void 0?a:"__health"}},startupProbe:{httpGet:{path:a!==null&&a!==void 0?a:"__health"}}},o)};var removeFalsy=function(e){if(!e)return undefined;return Object.fromEntries(Object.entries(e).filter((function(e){var t=i(e,2),r=t[1];return r!==false})))};var createKubeValues=function(e){var t,r,i;var f=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!f){return[]}if(!(0,p.isOfDeployType)(f,"kubernetes")){throw new Error("deploy config is not kubernetes")}var m=f.values;var h=m!==null&&m!==void 0?m:{},v=h.application,y=h.jobs,b=h.cronjobs,g=n(h,["application","jobs","cronjobs"]);var w=(0,d.createKubeEnv)(e);var _=(0,o.merge)({env:w,application:createAppConfig(e,v)},(0,l.hasKubernetesCloudSQL)(e)?(0,l.createKubernetesCloudsqlBaseValues)(e):{},((i=(r=f.values)===null||r===void 0?void 0:r.mongodb)===null||i===void 0?void 0:i.enabled)?(0,c.createMongodbBaseConfig)(e):{});var S=(0,u.processSecretsAsFiles)((0,s.mergeWithMergingArrays)(_,a({jobs:removeFalsy(y),cronjobs:removeFalsy(b)},g)));return S};t.createKubeValues=createKubeValues},4139:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.createMongodbBaseConfig=void 0;var n=r(3255);var i=r(5133);var o=r(5781);var getCredentialString=function(e){return"root:$".concat((0,i.getSecretVarNameForContext)(e,"MONGODB_ROOT_PASSWORD"),"@")};var getMongodbHost=function(e,t){var r=e.environment.envVars.KUBE_NAMESPACE;return"".concat(t,".").concat(r,".svc.cluster.local:27017")};var getMongodbStandaloneHost=function(e){var t=e.environment.envVars.KUBE_APP_NAME;return getMongodbHost(e,"".concat(t,"-mongodb"))};var getMongodbReplicasetHost=function(e,t){var r=e.environment.envVars.KUBE_APP_NAME;return getMongodbHost(e,"".concat(r,"-mongodb-").concat(t,".").concat(r,"-mongodb-headless"))};var createMongodbUrl=function(e,t){var r,a,i,s;if(!(0,o.isOfDeployType)((r=e.deploy)===null||r===void 0?void 0:r.config,"kubernetes")){throw new Error("can only createMongodbUrl on supported deploys")}var p=(i=(a=e.deploy)===null||a===void 0?void 0:a.config.values)===null||i===void 0?void 0:i.mongodb;var l=undefined;var d="";if((p===null||p===void 0?void 0:p.architecture)==="replicaset"){d=(0,n.range)(0,(s=p===null||p===void 0?void 0:p.replicaCount)!==null&&s!==void 0?s:2).map((function(t){return getMongodbReplicasetHost(e,t)})).join(",");l="replicaSet=rs0&authSource=admin"}else{d=getMongodbStandaloneHost(e);l="authSource=admin"}return"mongodb://".concat(getCredentialString(e)).concat(d,"/").concat(t).concat(l?"?".concat(l):"")};var createMongoBackupDefaultConfig=function(e){var t,r,a;if(!(0,o.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"kubernetes")){throw new Error("can only create mongodb base config on supported deploys")}var n=(a=(r=e.deploy)===null||r===void 0?void 0:r.config.values)===null||a===void 0?void 0:a.mongodb;var i=e.environment.envVars.KUBE_APP_NAME;var s=["prod","stage"].includes(e.environment.envType);var p;var l;if((n===null||n===void 0?void 0:n.architecture)==="replicaset"){var d=(n===null||n===void 0?void 0:n.architecture)==="replicaset"&&n.replicaCount&&n.replicaCount>1?1:0;p=getMongodbReplicasetHost(e,d);l="datadir-".concat(i,"-mongodb-").concat(d)}else{p=getMongodbStandaloneHost(e);l="".concat(i,"-mongodb")}return{enabled:s,hostToBackup:p,pvcToBackup:l,image:"mrelite/kubectlmongoshell:v1.0",schedule:"0 4 * * *",volumeSnapshotClass:"snapshotclass"}};var createMongodbBaseConfig=function(e){var t,r,n,s;if(!(0,o.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"kubernetes")){throw new Error("can only create mongodb base config on supported deploys")}var p=(n=(r=e.deploy)===null||r===void 0?void 0:r.config.values)===null||n===void 0?void 0:n.mongodb;return{mongodb:{enabled:true,auth:{enabled:true,rootPassword:"$"+(0,i.getSecretVarNameForContext)(e,"MONGODB_ROOT_PASSWORD"),replicaSetKey:"$"+(0,i.getSecretVarNameForContext)(e,"MONGODB_REPLICASET_KEY")},persistence:{storageClass:"standard-rwo"},backup:createMongoBackupDefaultConfig(e)},env:{secret:a({MONGO_URL:createMongodbUrl(e,(s=p===null||p===void 0?void 0:p.dbName)!==null&&s!==void 0?s:"app")},(p===null||p===void 0?void 0:p.architecture)==="replicaset"?{MONGO_OPLOG_URL:createMongodbUrl(e,"local")}:{})}}};t.createMongodbBaseConfig=createMongodbBaseConfig},6089:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.processSecretsAsFiles=void 0;var n=r(3255);var processSecretsAsFiles=function(e){if(!e.secretsAsFile||e.secretsAsFile.length===0){return e}return a(a({},e),{env:a(a({},e.env),{secret:a(a({},(0,n.omit)(e.env.secret,e.secretsAsFile)),Object.fromEntries(e.secretsAsFile.map((function(t){return[t+"_content",e.env.secret[t]]}))))})})};t.processSecretsAsFiles=processSecretsAsFiles},4986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDependencyTrackDeleteScript=t.getDependencyTrackUploadScript=t.sbomDeactivated=void 0;var a=r(7038);var n=r(1724);var sbomDeactivated=function(e){return(0,n.componentContextIsStandaloneBuild)(e)&&e.build.config.type==="custom"&&e.build.config.sbom===false};t.sbomDeactivated=sbomDeactivated;var getDependencyTrackUploadScript=function(e){return(0,t.sbomDeactivated)(e)?[]:["echo 'Uploading SBOM to Dependency Track'",'/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "'.concat(e.fullConfig.customerName,"-").concat(e.fullConfig.appName,"/").concat(e.name,'" "').concat(e.environment.url,'" "').concat(a.SBOM_FILE,'" vex.json || true')]};t.getDependencyTrackUploadScript=getDependencyTrackUploadScript;var getDependencyTrackDeleteScript=function(e){return(0,t.sbomDeactivated)(e)?[]:["echo 'Disabling component in Dependency Track'",'/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" disable "'.concat(e.fullConfig.customerName,"-").concat(e.fullConfig.appName,"/").concat(e.name,'" "').concat(e.environment.url,'" || true')]};t.getDependencyTrackDeleteScript=getDependencyTrackDeleteScript},461:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},6938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},5781:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});t.isOfDeployType=void 0;n(r(461),t);n(r(6938),t);n(r(835),t);n(r(282),t);var isOfDeployType=function(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}return e&&t.includes(e.type)?true:false};t.isOfDeployType=isOfDeployType},835:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},6054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.contextIsStoppable=t.getKubernetesNamespace=t.getFullKubernetesClusterName=void 0;var a=r(5781);var getFullKubernetesClusterName=function(e){if(e.type==="gcloud"){return"gke_".concat(e.projectId,"_").concat(e.region,"_").concat(e.name)}};t.getFullKubernetesClusterName=getFullKubernetesClusterName;var getKubernetesNamespace=function(e,t){return"".concat(e.customerName,"-").concat(e.appName,"-").concat(t)};t.getKubernetesNamespace=getKubernetesNamespace;var contextIsStoppable=function(e){var t;var r=(t=e.deploy)===null||t===void 0?void 0:t.config;if((0,a.isOfDeployType)(r,"kubernetes")){return true}if((0,a.isOfDeployType)(r,"google-cloudrun")){return true}if((0,a.isOfDeployType)(r,"custom")&&r.stopScript){return true}return false};t.contextIsStoppable=contextIsStoppable},603:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});n(r(7752),t);n(r(1853),t);n(r(7551),t);n(r(4058),t);n(r(3352),t);n(r(5875),t);n(r(7862),t);n(r(8483),t);n(r(2228),t)},1792:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:true});var a={version:"0.0.0"};try{var n=((r=require.main)===null||r===void 0?void 0:r.path)+"/../package.json";a=require(n)}catch(e){}t["default"]=a},3579:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createAllJobs=void 0;var s=r(8375);var p=r(6558);var l=r(1853);var d=r(2321);var c=r(803);var createAllJobs=function(e){return a(void 0,[e],void 0,(function(e){var t;var r;var u;var f=e.config,m=e.trigger,h=e.pipelineType;return n(this,(function(e){switch(e.label){case 0:return[4,(0,s.createAllComponentsContext)({config:f,trigger:m,pipelineType:h})];case 1:t=e.sent();r={};return[4,Promise.all(Object.keys((u=f.builds)!==null&&u!==void 0?u:{}).map((function(e){return a(void 0,void 0,void 0,(function(){var r,s;return n(this,(function(d){switch(d.label){case 0:r=t.filter((function(t){return(0,l.componentContextHasWorkspaceBuild)(t)&&t.build.workspaceName===e}));s=o([],i(new Set(r.map((function(e){var t=e.env;return t})))),false);return[4,Promise.all(s.map((function(t){return a(void 0,void 0,void 0,(function(){var a;return n(this,(function(n){switch(n.label){case 0:return[4,(0,p.createWorkspaceContext)({components:r.filter((function(e){var r=e.env;return r===t})),workspaceName:e,config:f,trigger:m,pipelineType:h,env:t})];case 1:a=n.sent();return[2,{context:a,jobs:(0,c.createJobsForWorkspace)(a)}]}}))}))})))];case 1:return[2,d.sent()]}}))}))}))).then((function(e){return e.flat()}))];case 2:return[2,(r.workspaces=e.sent(),r.components=t.map((function(e){return{context:e,jobs:(0,d.createJobsForComponentContext)(e)}})),r)]}}))}))};t.createAllJobs=createAllJobs},5139:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});t.createChildPipeline=void 0;var i=r(7551);var o=r(3579);var s=r(7585);var p=r(8862);var l=r(6551);var createChildPipeline=function(e,t,r){return a(void 0,void 0,void 0,(function(){var a,d,c;return n(this,(function(n){switch(n.label){case 0:return[4,(0,o.createAllJobs)({config:r,trigger:t,pipelineType:e})];case 1:a=n.sent();d=(0,s.getPipelineStages)(r);if(!(e==="gitlab"))return[3,3];return[4,(0,p.createGitlabJobs)(a)];case 2:c=n.sent();return[2,(0,l.createGitlabPipelineWithDefaults)({workflow:{rules:i.RULES_ALWAYS},stages:d,jobs:Object.fromEntries(c.map((function(e){var t=e.gitlabJob,r=e.name;return[r,t]}))),variables:r.runnerVariables})];case 3:throw new Error("".concat(e," is not supported"))}}))}))};t.createChildPipeline=createChildPipeline},2321:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createJobsForComponentContext=void 0;var s=r(7862);var p=r(8483);var injectDefaultVarsInCustomJobs=function(e,t){return t.map((function(t){var r;var i=t.variables,o=n(t,["variables"]);return a({variables:a(a({},(r=e.environment.envVars)!==null&&r!==void 0?r:{}),i!==null&&i!==void 0?i:{})},o)}))};var getCustomJobs=function(e){if(!e.customJobs){return[]}var t=e.customJobs;return injectDefaultVarsInCustomJobs(e,t)};var createJobsForComponentContext=function(e){var t=s.BUILD_TYPES[e.build.buildType].jobs(e);var r=e.componentConfig.deploy!==false?p.DEPLOY_TYPES[e.componentConfig.deploy.type].jobs(e):[];var a=getCustomJobs(e);return o(o(o([],i(t),false),i(r),false),i(a),false)};t.createJobsForComponentContext=createJobsForComponentContext},803:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createJobsForWorkspace=void 0;var a=r(7862);var createJobsForWorkspace=function(e){var t=a.WORKSPACE_BUILD_TYPES[e.build.buildType].jobs(e);return t};t.createJobsForWorkspace=createJobsForWorkspace},9192:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var s=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createMainPipeline=void 0;var p=r(7551);var l=r(7770);var d=r(3579);var c=r(7585);var u=r(8862);var f=r(6551);var m=r(6564);var createMainPipeline=function(e,t){return n(void 0,void 0,void 0,(function(){var r,p,h,v,y;return i(this,(function(b){switch(b.label){case 0:r=(0,c.getPipelineStages)(t);if(!(e==="gitlab"))return[3,2];return[4,Promise.all(l.ALL_PIPELINE_TRIGGERS.map((function(r){return n(void 0,void 0,void 0,(function(){var a;return i(this,(function(n){switch(n.label){case 0:a=u.createGitlabJobs;return[4,(0,d.createAllJobs)({config:t,trigger:r,pipelineType:e})];case 1:return[4,a.apply(void 0,[n.sent(),getGitlabRulesForTrigger(r)])];case 2:return[2,n.sent()]}}))}))}))).then((function(e){return e.flat()}))];case 1:p=b.sent();h=p.filter((function(e){return e.context.type==="workspace"})).sort((function(e,r){var a;var n=Object.keys((a=t.builds)!==null&&a!==void 0?a:{});var i=n.findIndex((function(t){return t===e.context.name}));var o=n.findIndex((function(e){return e===r.context.name}));return i-o}));v=p.filter((function(e){return e.context.type==="component"})).sort((function(e,r){var a=Object.keys(t.components);var n=a.findIndex((function(t){return t===e.context.name}));var i=a.findIndex((function(e){return e===r.context.name}));return n-i}));y=s(s([],o(h),false),o(v),false).reduce((function(e,t){var r,a;var n=t.gitlabJob,i=t.name;if(e[i]){e[i].rules=s(s([],o((r=e[i].rules)!==null&&r!==void 0?r:[]),false),o((a=n.rules)!==null&&a!==void 0?a:[]),false)}else{e[i]=n}return e}),{});return[2,(0,f.createGitlabPipelineWithDefaults)({stages:s(s([],o(r),false),["release"],false),jobs:a(a({},y),(0,m.getGitlabReleaseJobs)()),variables:t.runnerVariables})];case 2:throw new Error("".concat(e," is not supported"))}}))}))};t.createMainPipeline=createMainPipeline;function getGitlabRulesForTrigger(e){switch(e){case"mainBranch":return[p.RULE_NEVER_ON_RELEASE_COMMIT,p.RULE_IS_MAIN_BRANCH];case"mr":return[p.RULE_IS_MERGE_REQUEST];case"taggedRelease":return[p.RULE_IS_TAGGED_RELEASE]}}},6169:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};var s=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.generatePipelineFiles=t.generateLocalPipelineContent=t.generateChildPipelineContent=void 0;var p=r(2228);var l=r(5139);var d=r(9192);var c=r(7426);var u=r(2361);function generateChildPipelineContent(e,t){return n(this,void 0,void 0,(function(){var r,n,p,d,f,m,h,v,y;return i(this,(function(i){switch(i.label){case 0:r=(0,c.getPipelineTriggerForGitlabChildPipeline)();return[4,(0,l.createChildPipeline)(t,r,e)];case 1:n=i.sent(),p=n.jobs,d=n.image,f=n.stages,m=n.variables,h=n.workflow,v=o(n,["jobs","image","stages","variables","workflow"]);y=Object.fromEntries(Object.entries(p).map((function(e){var t=s(e,2),r=t[0],a=t[1];return[r,(0,u.sortGitLabJobDefProps)(a)]})));return[2,a(a({image:d,stages:f,variables:m,workflow:h},v),y)]}}))}))}t.generateChildPipelineContent=generateChildPipelineContent;function generateLocalPipelineContent(e,t){return n(this,void 0,void 0,(function(){var r,n,p,l,c,f,m,h;return i(this,(function(i){switch(i.label){case 0:return[4,(0,d.createMainPipeline)(t,e)];case 1:r=i.sent(),n=r.jobs,p=r.image,l=r.stages,c=r.variables,f=r.workflow,m=o(r,["jobs","image","stages","variables","workflow"]);h=Object.fromEntries(Object.entries(n).map((function(e){var t=s(e,2),r=t[0],a=t[1];return[r,(0,u.sortGitLabJobDefProps)(a)]})));return[2,a(a({image:p,stages:l,variables:c,workflow:f},m),h)]}}))}))}t.generateLocalPipelineContent=generateLocalPipelineContent;function generatePipelineFiles(e,t,r){return n(this,void 0,void 0,(function(){var a,n;return i(this,(function(i){switch(i.label){case 0:if(!(r==="childpipeline"))return[3,2];return[4,generateChildPipelineContent(e,t)];case 1:a=i.sent();return[2,(0,p.writeYamlfile)("__pipeline.yml",a)];case 2:return[4,generateLocalPipelineContent(e,t)];case 3:n=i.sent();return[2,(0,p.writeYamlfile)(".gitlab-ci.yml",n)]}}))}))}t.generatePipelineFiles=generatePipelineFiles},7585:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getPipelineStages=void 0;var i=r(3352);var o=r(7432);function getPipelineStages(e){var t=(0,i.getAllEnvsInAllComponents)(e).filter((function(e){return e!=="local"}));var r=o.BASE_STAGES.reduce((function(e,r){return n(n(n([],a(e),false),[r],false),a(t.map((function(e){return"".concat(r," ").concat(e)}))),false)}),[]);return r}t.getPipelineStages=getPipelineStages},8862:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};var s=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var p=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createGitlabJobs=t.makeGitlabJob=t.GITLAB_ENVIRONMENT_URL_VARIABLE=void 0;var l=r(3255);var d=r(8133);var c=r(6484);var u=r(2497);var f=r(8490);var m=r(1073);t.GITLAB_ENVIRONMENT_URL_VARIABLE="CL_GITLAB_ENVIRONMENT_URL";var getFullJobName=function(e){var t=e.type,r=e.name,a=e.baseName,n=e.allJobs,i=e.env;var o=n.workspaces.length>0;var s=t==="component"?"🔹":"🔸";var p=o?s+" ":"";if(i){return"".concat(p).concat(a," ").concat(r," | ").concat(i," ")}return"".concat(p).concat(a," ").concat(r)};var getFullReferencedJobNameFromComponent=function(e,t,r,a){var n,i;var o=(i=(n=a.components.find((function(e){return e.context.name===t&&e.context.env===r})))===null||n===void 0?void 0:n.jobs)===null||i===void 0?void 0:i.find((function(t){return t.name===e}));if(!o){throw new Error("unknown job referenced: '".concat(e,"' from '").concat(r,":").concat(t,"'"))}var s=o.envMode!=="none"?r:null;return getFullJobName({type:"component",name:e,baseName:t,env:s,allJobs:a})};var getFullReferencedJobNameFromWorkspace=function(e,t,r,a){var n,i;var o=(i=(n=a.workspaces.find((function(e){return e.context.name===t})))===null||n===void 0?void 0:n.jobs)===null||i===void 0?void 0:i.find((function(t){return t.name===e}));if(!o){throw new Error("unknown job referenced: '".concat(e,"' from workspace ").concat(r,":").concat(t,"'"))}var s=o.envMode!=="none"?r:null;return getFullJobName({type:"workspace",name:e,baseName:t,env:s,allJobs:a})};var getJobName=function(e){return(0,l.isObject)(e)?e.job:e};var makeGitlabJob=function(e,t,r,n){var i,l;var h=t.environment,v=t.envMode,y=t.needsStages,b=t.needsOtherComponent,g=t.name,w=t.needs,_=t.jobTags,S=t.script,O=t.variables,A=t.runnerVariables,N=t.when,C=o(t,["environment","envMode","needsStages","needsOtherComponent","name","needs","jobTags","script","variables","runnerVariables","when"]);var k=v==="stagePerEnv"?"".concat(t.stage," ").concat(e.env):t.stage;var T=getGitlabNeeds(e,t,r);var D=getFullJobName({type:e.type,name:g,baseName:e.name,env:v!=="none"?e.env:undefined,allJobs:r});var I=["KUBERNETES_CPU_REQUEST","KUBERNETES_MEMORY_REQUEST","KUBERNETES_CPU_LIMIT","KUBERNETES_MEMORY_LIMIT"];var x=(0,f.collapseableSection)("injectvars","Injecting variables")(p([],s((0,d.getInjectVarsScript)(Object.fromEntries(Object.entries(O!==null&&O!==void 0?O:{}).filter((function(e){var t=s(e,1),r=t[0];return!I.includes(r)}))))),false));var P=Object.fromEntries(Object.entries(O!==null&&O!==void 0?O:{}).filter((function(e){var t=s(e,1),r=t[0];return I.includes(r)})));if(Object.keys(P).length>0){console.warn("Legacy variables detected in ".concat(D,": ").concat(Object.keys(P).join(", "),". Please move them to the runnerVariables key."))}var j=p(p([],s((i=t.rules)!==null&&i!==void 0?i:[]),false),s(n?n.map((function(e){return a({when:N},e)})):N?[{when:N}]:[]),false);var L=a(a({},C),{rules:j.length>0?j:undefined,variables:a(a({},P),A),script:p(p([],s(x),false),s((l=S===null||S===void 0?void 0:S.filter(u.notNil))!==null&&l!==void 0?l:[]),false),tags:_,stage:k,needs:T,retry:c.BASE_RETRY,interruptible:true});var R=addGitlabEnvironment(e,h,L,r);return[D,(0,m.removeUndefined)(R)]};t.makeGitlabJob=makeGitlabJob;var addGitlabEnvironment=function(e,r,n,i){var d,c;if(!r){return n}if(e.type!=="component"){return n}var u=e.env,f=e.name,m=e.environment;var h=m.url,v=m.envType;var y=r.on_stop,b=o(r,["on_stop"]);var g="gitlab_environment.env";var w=['echo "'.concat(t.GITLAB_ENVIRONMENT_URL_VARIABLE,"=").concat(h,'" >> ').concat(g)];var _=v==="review"?"".concat(u,"/$CI_COMMIT_REF_NAME/").concat(f):"".concat(u,"/").concat(f);return a(a({},n),{environment:a(a({name:_,url:"$".concat(t.GITLAB_ENVIRONMENT_URL_VARIABLE)},y?{on_stop:getFullReferencedJobNameFromComponent(y,f,u,i)}:{}),b),artifacts:(0,l.merge)((d=n.artifacts)!==null&&d!==void 0?d:{},{reports:{dotenv:"".concat(g)}}),script:p(p([],s((c=n.script)!==null&&c!==void 0?c:[]),false),s(w),false)})};var createGitlabJobs=function(e,r){return n(void 0,void 0,void 0,(function(){return i(this,(function(a){return[2,p(p([],s(e.workspaces),false),s(e.components),false).flatMap((function(a){var n=a.context,i=a.jobs;return i.map((function(a){var i=s((0,t.makeGitlabJob)(n,a,e,r),2),o=i[0],p=i[1];return{name:o,gitlabJob:p,context:n}}))}))]}))}))};t.createGitlabJobs=createGitlabJobs;function getGitlabNeeds(e,t,r){var a=e.type==="workspace"?getGitlabNeedsForWorkspaceJob(e,t,r):getGitlabNeedsForComponentJob(e,t,r);return deduplicateNeeds(a)}function deduplicateNeeds(e){return e?p([],s(new Map(e.map((function(e){return[(0,l.isObject)(e)?e.job:e,e]}))).values()),false):undefined}function getGitlabNeedsForComponentJob(e,t,r){var a=t.needsStages,n=t.needs,i=t.needsOtherComponent;var o=a===null||a===void 0?void 0:a.flatMap((function(t){var a,n,i,o,s,p,l,d;var c=e.name;if(!t.workspaceName){var u=(i=(n=(a=r.components.filter((function(t){return t.context.name===c&&t.context.env===e.env})).flatMap((function(e){return e.jobs})))===null||a===void 0?void 0:a.filter((function(e){return e.stage===t.stage})))===null||n===void 0?void 0:n.map((function(e){return e.name})))!==null&&i!==void 0?i:[];return u.map((function(e){var r;return{job:e,artifacts:(r=t.artifacts)!==null&&r!==void 0?r:false,componentName:c}}))}else{var u=(d=(l=(p=(s=(o=r.workspaces.find((function(r){return r.context.name===t.workspaceName&&r.context.env===e.env})))===null||o===void 0?void 0:o.jobs)===null||s===void 0?void 0:s.flatMap((function(e){return e})))===null||p===void 0?void 0:p.filter((function(e){return e.stage===t.stage})))===null||l===void 0?void 0:l.map((function(e){return e.name})))!==null&&d!==void 0?d:[];return u.map((function(e){var r;return{job:e,artifacts:(r=t.artifacts)!==null&&r!==void 0?r:false,workspaceName:t.workspaceName}}))}}));var d=p(p(p([],s(o!==null&&o!==void 0?o:[]),false),s(n!==null&&n!==void 0?n:[]),false),s(i!==null&&i!==void 0?i:[]),false);return d===null||d===void 0?void 0:d.map((function(t){var a;return(0,l.isObject)(t)?"workspaceName"in t?{job:getFullReferencedJobNameFromWorkspace(t.job,t.workspaceName,e.env,r),artifacts:t.artifacts}:{job:getFullReferencedJobNameFromComponent(t.job,(a=t.componentName)!==null&&a!==void 0?a:e.name,e.env,r),artifacts:t.artifacts}:getFullReferencedJobNameFromComponent(t,e.name,e.env,r)})).sort((function(e,t){return getJobName(e).localeCompare(getJobName(t))}))}function getGitlabNeedsForWorkspaceJob(e,t,r){var a=t.needsStages,n=t.needs;var i=a===null||a===void 0?void 0:a.flatMap((function(t){var a,n,i,o;var s=(a=t.workspaceName)!==null&&a!==void 0?a:e.name;var p=(o=(i=(n=r.workspaces.filter((function(t){return t.context.name===s&&t.context.env===e.env})).flatMap((function(e){return e.jobs})))===null||n===void 0?void 0:n.filter((function(e){return e.stage===t.stage})))===null||i===void 0?void 0:i.map((function(e){return e.name})))!==null&&o!==void 0?o:[];return p.map((function(e){var r;return{job:e,artifacts:(r=t.artifacts)!==null&&r!==void 0?r:false,workspaceName:s}}))}));var o=p(p([],s(i!==null&&i!==void 0?i:[]),false),s(n!==null&&n!==void 0?n:[]),false);return o===null||o===void 0?void 0:o.map((function(t){return(0,l.isObject)(t)?{job:getFullReferencedJobNameFromWorkspace(t.job,"workspaceName"in t&&t.workspaceName?t.workspaceName:e.name,e.env,r),artifacts:t.artifacts}:getFullReferencedJobNameFromWorkspace(t,e.name,e.env,r)})).sort((function(e,t){return getJobName(e).localeCompare(getJobName(t))}))}},6551:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};Object.defineProperty(t,"__esModule",{value:true});t.createGitlabPipelineWithDefaults=void 0;var i=r(4058);var createGitlabPipelineWithDefaults=function(e){var t=e.image,r=e.variables,o=n(e,["image","variables"]);return a({image:t!==null&&t!==void 0?t:(0,i.getRunnerImage)("jobs-default"),variables:a({FF_USE_FASTZIP:"true",ARTIFACT_COMPRESSION_LEVEL:"fast",CACHE_COMPRESSION_LEVEL:"fast",TRANSFER_METER_FREQUENCY:"5s",GIT_DEPTH:"1"},r!==null&&r!==void 0?r:{})},o)};t.createGitlabPipelineWithDefaults=createGitlabPipelineWithDefaults},7426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getPipelineTriggerForGitlabChildPipeline=void 0;var a=r(2898);function getPipelineTriggerForGitlabChildPipeline(){var e=process.env,t=e.CI_MERGE_REQUEST_ID,r=e.CI_COMMIT_TAG,n=e.CI_COMMIT_BRANCH,i=e.CI_DEFAULT_BRANCH;var o=Boolean(i)&&n===i;var s=n?/^[0-9]+\.([0-9]+|x)\.x$/.test(n):false;var p=Boolean(t);var l=Boolean(r);console.info("catladder version ".concat(a.PIPELINE_IMAGE_TAG));var d=p||s?"mr":o?"mainBranch":l?"taggedRelease":null;if(!d){throw new Error("no matching trigger: "+JSON.stringify({isMergeRequest:p,isDefaultBranch:o,isTaggedRelease:l},null,2))}return d}t.getPipelineTriggerForGitlabChildPipeline=getPipelineTriggerForGitlabChildPipeline},6564:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getGitlabReleaseJobs=void 0;var a=r(7551);var n=r(4058);var i="echo '👉 The project access token might be invald - run `project-renew-token` in catladder CLI to fix.'";var getGitlabReleaseJobs=function(){var e;return e={},e["create release"]={stage:"release",image:(0,n.getRunnerImage)("semantic-release"),script:["semanticRelease"],after_script:[i],rules:a.RULES_RELEASE},e["⚠️ force create release"]={stage:"release",image:(0,n.getRunnerImage)("semantic-release"),script:["semanticRelease"],after_script:[i],needs:[],rules:a.RULES_MANUAL_RELEASE},e};t.getGitlabReleaseJobs=getGitlabReleaseJobs},2361:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.sortGitLabJobDefProps=void 0;var r=["stage","tags","image","services","variables","before_script","script","after_script","cache","coverage","environment","release","artifacts","rules","only","except","needs","dependencies","trigger","retry","interruptible","allow_failure","parallel","hooks","resource_group"];var sortGitLabJobDefKeys=function(e){return Object.keys(e).sort((function(e,t){return r.indexOf(e)===-1&&r.indexOf(t)===-1?0:r.indexOf(e)===-1?1:r.indexOf(t)===-1?-1:r.indexOf(e)-r.indexOf(t)}))};var sortGitLabJobDefProps=function(e){return sortGitLabJobDefKeys(e).reduce((function(t,r){var a;return e[r]!==undefined?Object.assign(t,(a={},a[r]=e[r],a)):t}),{})};t.sortGitLabJobDefProps=sortGitLabJobDefProps},7752:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});n(r(5139),t);n(r(2321),t);n(r(6169),t);n(r(6564),t)},6451:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var s=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getPackageManagerInfoBase=t.getPackageManagerInfoForComponent=void 0;var p=r(7147);var l=r(1017);var d=r(4843);var c=r(7843);var getPackageManagerInfoForComponent=function(e,r){return n(void 0,void 0,void 0,(function(){var n,u,f,m,h,v,y,b,g,w,_,S,O;return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.getPackageManagerInfoBase)()];case 1:n=i.sent();u=n.workspaces;f=e.components[r];m=u.find((function(e){return(0,d.pathEqual)(f.dir,e.location)}));h=Boolean(m);v=".";y=(0,l.join)(f.dir,"package.json");b=h?(0,l.join)(v,"package.json"):null;g=h?(0,l.join)(v,"yarn.lock"):(0,l.join)(f.dir,"yarn.lock");w=[".yarnrc",".yarnrc.yml",".npmrc",".yarn"];_=s(s([],o(w),false),o(w.map((function(e){return(0,l.join)(f.dir,e)}))),false).filter((function(e){return(0,p.existsSync)(e)}));S=m?(0,c.getWorkspaceDependencies)(m,u):[];O=s(s(s(s([y],o(b?[b]:[]),false),[g],false),o(_),false),o(S),false);return[2,a(a({},n),{currentWorkspace:m,currentWorkspaceDependencies:S,componentIsInWorkspace:h,pathsToCopyInDocker:O})]}}))}))};t.getPackageManagerInfoForComponent=getPackageManagerInfoForComponent;var getPackageManagerInfoBase=function(){return n(void 0,void 0,void 0,(function(){var e,t,r;return i(this,(function(a){switch(a.label){case 0:return[4,(0,c.getYarnVersion)()];case 1:e=a.sent();if(!e)throw new Error("could not get yarn version");t=e.startsWith("1");return[4,(0,c.getWorkspaces)(t)];case 2:r=a.sent();return[2,{type:"yarn",workspaces:r,version:e,isClassic:t}]}}))}))};t.getPackageManagerInfoBase=getPackageManagerInfoBase},7843:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getWorkspaceDependencies=t.getWorkspaces=t.getYarnVersion=void 0;var p=r(5763);var l=s(r(5839));var d=r(6046);var execOrFail=function(e,t){return a(void 0,void 0,void 0,(function(){var r;return n(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);return[4,(0,p.exec)(e).then((function(e){return e.stdout}))];case 1:return[2,a.sent()];case 2:r=a.sent();return[2,t!==null&&t!==void 0?t:null];case 3:return[2]}}))}))};t.getYarnVersion=(0,l.default)((function(){return a(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,execOrFail("yarn --version","")];case 1:return[2,e.sent()]}}))}))}),{promise:true});t.getWorkspaces=(0,l.default)((function(e){return a(void 0,void 0,void 0,(function(){var t,r,a,i,o,s,p;var l,c;return n(this,(function(n){switch(n.label){case 0:if(!e)return[3,2];a=(r=Object).values;i=d.jsonParseOrThrow;o=d.jsonParseOrThrow;return[4,execOrFail("yarn workspaces --json info","{}")];case 1:t=a.apply(r,[i.apply(void 0,[(c=(l=o.apply(void 0,[n.sent()]))===null||l===void 0?void 0:l.data)!==null&&c!==void 0?c:"{}"])]);return[3,4];case 2:s=d.jsonParseOrThrow;p="[".concat;return[4,execOrFail("yarn workspaces list --json --verbose","")];case 3:t=s.apply(void 0,[p.apply("[",[n.sent().trim().split("\n").join(","),"]"])]);n.label=4;case 4:return[2,t]}}))}))}),{promise:true});var getWorkspaceDependencies=function(e,r){return e?o(o([],i(e.workspaceDependencies),false),i(e.mismatchedWorkspaceDependencies),false).flatMap((function(e){var a=r.find((function(t){return t.location===e}));if(a){return o(o([],i((0,t.getWorkspaceDependencies)(a,r)),false),[a.location],false)}return[]})).filter(Boolean):[]};t.getWorkspaceDependencies=getWorkspaceDependencies},7551:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.RULES_MANUAL_RELEASE=t.RULES_RELEASE=t.RULE_CONDITION_HOTFIX_BRANCH=t.RULES_ALWAYS=t.RULE_IS_TAGGED_RELEASE=t.RULE_IS_MERGE_REQUEST=t.RULE_NEVER_ON_SCHEDULE=t.RULE_NEVER_ON_RELEASE_COMMIT=t.RULE_IS_MAIN_BRANCH=t.RULE_CONDITION_MAIN_BRANCH=void 0;t.RULE_CONDITION_MAIN_BRANCH="$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH";t.RULE_IS_MAIN_BRANCH={if:t.RULE_CONDITION_MAIN_BRANCH};t.RULE_NEVER_ON_RELEASE_COMMIT={if:"$CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/",when:"never"};t.RULE_NEVER_ON_SCHEDULE={if:'$CI_PIPELINE_SOURCE == "schedule"',when:"never"};t.RULE_IS_MERGE_REQUEST={if:"$CI_MERGE_REQUEST_ID"};t.RULE_IS_TAGGED_RELEASE={if:"$CI_COMMIT_TAG"};t.RULES_ALWAYS=[t.RULE_IS_TAGGED_RELEASE,t.RULE_NEVER_ON_RELEASE_COMMIT,t.RULE_NEVER_ON_SCHEDULE,{if:"$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/"},{if:"$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"},t.RULE_IS_MERGE_REQUEST];t.RULE_CONDITION_HOTFIX_BRANCH="$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/";t.RULES_RELEASE=[t.RULE_NEVER_ON_RELEASE_COMMIT,t.RULE_NEVER_ON_SCHEDULE,{if:t.RULE_CONDITION_MAIN_BRANCH+' && $AUTO_RELEASE == "true"',when:"on_success"},{if:t.RULE_CONDITION_MAIN_BRANCH,when:"manual"},{if:t.RULE_CONDITION_HOTFIX_BRANCH,when:"manual"}];t.RULES_MANUAL_RELEASE=[t.RULE_NEVER_ON_RELEASE_COMMIT,t.RULE_NEVER_ON_SCHEDULE,{if:t.RULE_CONDITION_MAIN_BRANCH,when:"manual"},{if:t.RULE_CONDITION_HOTFIX_BRANCH,when:"manual"}]},4058:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getRunnerImage=void 0;var a=r(2898);var getRunnerImage=function(e){return a.DOCKER_REGISTRY+"/"+e+":"+a.PIPELINE_IMAGE_TAG};t.getRunnerImage=getRunnerImage},7770:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.isKnowEnvType=t.DEFAULT_ENV_TYPES=t.DEFAULT_ENVS=t.getEnvTypesByTrigger=t.ENV_TYPES=t.ALL_PIPELINE_TRIGGERS=void 0;t.ALL_PIPELINE_TRIGGERS=["mainBranch","mr","taggedRelease"];t.ENV_TYPES={dev:{triggers:["mainBranch"]},review:{triggers:["mr"]},stage:{triggers:["taggedRelease"]},prod:{triggers:["taggedRelease"]},local:{triggers:[]}};var getEnvTypesByTrigger=function(e){return Object.entries(t.ENV_TYPES).filter((function(t){var a=r(t,2),n=a[1];return n.triggers.includes(e)})).map((function(e){var t=r(e,1),a=t[0];return a}))};t.getEnvTypesByTrigger=getEnvTypesByTrigger;t.DEFAULT_ENVS=Object.keys(t.ENV_TYPES);t.DEFAULT_ENV_TYPES=t.DEFAULT_ENVS;var isKnowEnvType=function(e){return e in t.ENV_TYPES};t.isKnowEnvType=isKnowEnvType},1724:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.componentContextHasWorkspaceBuild=t.componentContextIsStandaloneBuild=void 0;var componentContextIsStandaloneBuild=function(e){return e.build.type==="standalone"};t.componentContextIsStandaloneBuild=componentContextIsStandaloneBuild;var componentContextHasWorkspaceBuild=function(e){return e.build.type==="fromWorkspace"};t.componentContextHasWorkspaceBuild=componentContextHasWorkspaceBuild},688:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1853:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});n(r(7770),t);n(r(688),t);n(r(1724),t);n(r(2074),t)},7432:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BASE_STAGES=void 0;t.BASE_STAGES=["setup","test","build","deploy","verify","rollback","stop"]},2074:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},8490:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var a=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.collapseableSection=t.repeatOnFailure=t.sanitizeForBashVariable=t.allowFailureInScripts=void 0;var allowFailureInScripts=function(e){return a(a(["set +e"],r(e),false),["set -e"],false)};t.allowFailureInScripts=allowFailureInScripts;var sanitizeForBashVariable=function(e){return e.replace(/-/g,"_")};t.sanitizeForBashVariable=sanitizeForBashVariable;var repeatOnFailure=function(e,t){return"\n until ".concat(e,'\n do\n echo "Trying again."\n sleep ').concat(t.pauseInSeconds,"\n done\n ")};t.repeatOnFailure=repeatOnFailure;var collapseableSection=function(e,t){return function(n){return a(a(['echo -e "\\e[0Ksection_start:$(date +%s):'.concat(e,"[collapsed=true]\\r\\e[0K").concat(t,'"')],r(n),false),['echo -e "\\e[0Ksection_end:$(date +%s):'.concat(e,'\\r\\e[0K"')],false)}};t.collapseableSection=collapseableSection},2497:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.mergeWithMergingArrays=t.ensureArray=t.notNil=void 0;var i=r(3255);function notNil(e){return e!==null&&e!==undefined}t.notNil=notNil;var ensureArray=function(e){return(0,i.isNil)(e)?null:Array.isArray(e)?e:[e]};t.ensureArray=ensureArray;var mergeWithMergingArrays=function(e,t){return(0,i.mergeWith)({},e,t,(function(e,t){return Array.isArray(e)&&Array.isArray(t)?n(n([],a(e),false),a(t),false):undefined}))};t.mergeWithMergingArrays=mergeWithMergingArrays},6046:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.jsonParseOrThrow=void 0;var jsonParseOrThrow=function(e){try{return JSON.parse(e)}catch(t){throw new Error("could not parse json: ".concat(e))}};t.jsonParseOrThrow=jsonParseOrThrow},1073:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.removeUndefined=void 0;var removeUndefined=function(e){return Object.fromEntries(Object.entries(e).filter((function(e){var t=r(e,2),a=t[1];return a!==undefined})))};t.removeUndefined=removeUndefined},2228:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.writeYamlfile=t.yamlStringifyOptions=t.writeGeneratedFile=t.getAutoGeneratedHeader=void 0;var o=r(3292);var s=r(8033);var p=i(r(1792));var getAutoGeneratedHeader=function(e){return["-------------------------------------------------","🐱 🔨 This file is generated by catladder v".concat(p.default.version),"🚨 Do not edit this file manually 🚨","-------------------------------------------------"].map((function(t){return"".concat(e," ").concat(t)})).join("\n").concat("\n")};t.getAutoGeneratedHeader=getAutoGeneratedHeader;var writeGeneratedFile=function(e,r,i){return a(void 0,[e,r,i],void 0,(function(e,r,a){var i=a.commentChar;return n(this,(function(a){switch(a.label){case 0:return[4,(0,o.writeFile)(e,[(0,t.getAutoGeneratedHeader)(i),r].join("\n"),{encoding:"utf-8"})];case 1:a.sent();return[2]}}))}))};t.writeGeneratedFile=writeGeneratedFile;t.yamlStringifyOptions={lineWidth:0,doubleQuotedAsJSON:true,singleQuote:true};var writeYamlfile=function(e,r){return a(void 0,void 0,void 0,(function(){return n(this,(function(a){switch(a.label){case 0:return[4,(0,t.writeGeneratedFile)(e,(0,s.stringify)(r,t.yamlStringifyOptions),{commentChar:"#"})];case 1:a.sent();return[2]}}))}))};t.writeYamlfile=writeYamlfile},5763:(e,t,r)=>{"use strict";if(r(5761).major>=4){e.exports=r(2114)}else{e.exports=r(3276)}},8934:e=>{"use strict";function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var t=function(e){_inherits(ChildProcessError,e);function ChildProcessError(e,t,r,a,n){_classCallCheck(this,ChildProcessError);var i=_possibleConstructorReturn(this,(ChildProcessError.__proto__||Object.getPrototypeOf(ChildProcessError)).call(this,e));Error.captureStackTrace(i,i.constructor);i.name=i.constructor.name;i.code=t;i.childProcess=r;i.stdout=a;i.stderr=n;return i}return ChildProcessError}(Error);e.exports=t},7510:(e,t,r)=>{"use strict";var a=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||false;a.configurable=true;if("value"in a)a.writable=true;Object.defineProperty(e,a.key,a)}}return function(e,t,r){if(t)defineProperties(e.prototype,t);if(r)defineProperties(e,r);return e}}();var n=function get(e,t,r){if(e===null)e=Function.prototype;var a=Object.getOwnPropertyDescriptor(e,t);if(a===undefined){var n=Object.getPrototypeOf(e);if(n===null){return undefined}else{return get(n,t,r)}}else if("value"in a){return a.value}else{var i=a.get;if(i===undefined){return undefined}return i.call(r)}};function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var i;if(r(5761).major>=4){i=global.Promise}else{i=r(3322)}var o=function(e){_inherits(ChildProcessPromise,e);function ChildProcessPromise(e){_classCallCheck(this,ChildProcessPromise);var t;var r;var a=_possibleConstructorReturn(this,(ChildProcessPromise.__proto__||Object.getPrototypeOf(ChildProcessPromise)).call(this,(function(a,n){t=a;r=n;if(e){e(t,r)}})));a._cpResolve=t;a._cpReject=r;a.childProcess=undefined;return a}a(ChildProcessPromise,[{key:"progress",value:function progress(e){var t=this;process.nextTick((function(){e(t.childProcess)}));return this}},{key:"then",value:function then(e,t){var r=n(ChildProcessPromise.prototype.__proto__||Object.getPrototypeOf(ChildProcessPromise.prototype),"then",this).call(this,e,t);r.childProcess=this.childProcess;return r}},{key:"catch",value:function _catch(e){var t=n(ChildProcessPromise.prototype.__proto__||Object.getPrototypeOf(ChildProcessPromise.prototype),"catch",this).call(this,e);t.childProcess=this.childProcess;return t}},{key:"done",value:function done(){this.catch((function(e){process.nextTick((function(){throw e}))}))}}]);return ChildProcessPromise}(i);o.prototype.fail=o.prototype.catch;e.exports=o},3276:(e,t,r)=>{"use strict";var a=r(2081);var n=r(1891);var i=r(7510);var o=r(8934);var s=Array.prototype.slice;function doExec(e,t){var r;var n=new i;var p=n._cpReject;var l=n._cpResolve;var d=s.call(t,0);d.push(callback);r=a[e].apply(a,d);function callback(e,n,i){if(e){var s=t[0]+(Array.isArray(t[1])?" "+t[1].join(" "):"");e.message+=" `"+s+"` (exited with error code "+e.code+")";e.stdout=n;e.stderr=i;var d=new o(e.message,e.code,a,n,i);p(d)}else{l({childProcess:r,stdout:n,stderr:i})}}n.childProcess=r;return n}function exec(){return doExec("exec",arguments)}function execFile(){return doExec("execFile",arguments)}function doSpawn(e,t,r,a){var n={};var s;var p=new i;var l=p._cpReject;var d=p._cpResolve;var c=a&&a.successfulExitCodes||[0];s=e(t,r,a);var u=false;var f=false;var m=a&&a.capture;if(m){for(var h=0,v=m.length;h<v;h++){var y=m[h];if(y==="stdout"){u=true}else if(y==="stderr"){f=true}}}n.childProcess=s;if(u){n.stdout="";s.stdout.on("data",(function(e){n.stdout+=e}))}if(f){n.stderr="";s.stderr.on("data",(function(e){n.stderr+=e}))}s.on("error",l);s.on("close",(function(e){if(c.indexOf(e)===-1){var a=t+(r.length?" "+r.join(" "):"");var i="`"+a+"` failed with code "+e;var p=new o(i,e,s);if(f){p.stderr=n.stderr.toString()}if(u){p.stdout=n.stdout.toString()}l(p)}else{n.code=e;d(n)}}));p.childProcess=s;return p}function spawn(e,t,r){return doSpawn(n,e,t,r)}function fork(e,t,r){return doSpawn(a.fork,e,t,r)}t.exec=exec;t.execFile=execFile;t.spawn=spawn;t.fork=fork},5170:e=>{"use strict";class ChildProcessError extends Error{constructor(e,t,r,a,n){super(e);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=t;this.childProcess=r;this.stdout=a;this.stderr=n}}e.exports=ChildProcessError},9308:(e,t,r)=>{"use strict";var a;if(r(5761).major>=4){a=global.Promise}else{a=r(3322)}class ChildProcessPromise extends a{constructor(e){var t;var r;super(((a,n)=>{t=a;r=n;if(e){e(t,r)}}));this._cpResolve=t;this._cpReject=r;this.childProcess=undefined}progress(e){process.nextTick((()=>{e(this.childProcess)}));return this}then(e,t){var r=super.then(e,t);r.childProcess=this.childProcess;return r}catch(e){var t=super.catch(e);t.childProcess=this.childProcess;return t}done(){this.catch((e=>{process.nextTick((()=>{throw e}))}))}}ChildProcessPromise.prototype.fail=ChildProcessPromise.prototype.catch;e.exports=ChildProcessPromise},2114:(e,t,r)=>{"use strict";var a=r(2081);var n=r(1891);var i=r(9308);var o=r(5170);var s=Array.prototype.slice;function doExec(e,t){var r;var n=new i;var p=n._cpReject;var l=n._cpResolve;var d=s.call(t,0);d.push(callback);r=a[e].apply(a,d);function callback(e,n,i){if(e){var s=t[0]+(Array.isArray(t[1])?" "+t[1].join(" "):"");e.message+=" `"+s+"` (exited with error code "+e.code+")";e.stdout=n;e.stderr=i;var d=new o(e.message,e.code,a,n,i);p(d)}else{l({childProcess:r,stdout:n,stderr:i})}}n.childProcess=r;return n}function exec(){return doExec("exec",arguments)}function execFile(){return doExec("execFile",arguments)}function doSpawn(e,t,r,a){var n={};var s;var p=new i;var l=p._cpReject;var d=p._cpResolve;var c=a&&a.successfulExitCodes||[0];s=e(t,r,a);var u=false;var f=false;var m=a&&a.capture;if(m){for(var h=0,v=m.length;h<v;h++){var y=m[h];if(y==="stdout"){u=true}else if(y==="stderr"){f=true}}}n.childProcess=s;if(u){n.stdout="";s.stdout.on("data",(function(e){n.stdout+=e}))}if(f){n.stderr="";s.stderr.on("data",(function(e){n.stderr+=e}))}s.on("error",l);s.on("close",(function(e){if(c.indexOf(e)===-1){var a=t+(r.length?" "+r.join(" "):"");var i="`"+a+"` failed with code "+e;var p=new o(i,e,s);if(f){p.stderr=n.stderr.toString()}if(u){p.stdout=n.stdout.toString()}l(p)}else{n.code=e;d(n)}}));p.childProcess=s;return p}function spawn(e,t,r){return doSpawn(n,e,t,r)}function fork(e,t,r){return doSpawn(a.fork,e,t,r)}t.exec=exec;t.execFile=execFile;t.spawn=spawn;t.fork=fork},1891:(e,t,r)=>{"use strict";var a=r(2081);var n=r(7338);var i=r(499);var o=a.spawnSync;function spawn(e,t,r){var o;var s;o=n(e,t,r);s=a.spawn(o.command,o.args,o.options);i.hookChildProcess(s,o);return s}function spawnSync(e,t,a){var s;var p;if(!o){try{o=r(9904)}catch(e){throw new Error("In order to use spawnSync on node 0.10 or older, you must "+"install spawn-sync:\n\n"+" npm install spawn-sync --save")}}s=n(e,t,a);p=o(s.command,s.args,s.options);p.error=p.error||i.verifyENOENTSync(p.status,s);return p}e.exports=spawn;e.exports.spawn=spawn;e.exports.sync=spawnSync;e.exports._parse=n;e.exports._enoent=i},499:(e,t,r)=>{"use strict";var a=process.platform==="win32";var n=r(6997);var i=process.version.indexOf("v0.10.")===0;function notFoundError(e,t){var r;r=new Error(t+" "+e+" ENOENT");r.code=r.errno="ENOENT";r.syscall=t+" "+e;return r}function hookChildProcess(e,t){var r;if(!a){return}r=e.emit;e.emit=function(a,n){var i;if(a==="exit"){i=verifyENOENT(n,t,"spawn");if(i){return r.call(e,"error",i)}}return r.apply(e,arguments)}}function verifyENOENT(e,t){if(a&&e===1&&!t.file){return notFoundError(t.original,"spawn")}return null}function verifyENOENTSync(e,t){if(a&&e===1&&!t.file){return notFoundError(t.original,"spawnSync")}if(i&&e===-1){t.file=a?t.file:n(t.original);if(!t.file){return notFoundError(t.original,"spawnSync")}}return null}e.exports.hookChildProcess=hookChildProcess;e.exports.verifyENOENT=verifyENOENT;e.exports.verifyENOENTSync=verifyENOENTSync;e.exports.notFoundError=notFoundError},4105:e=>{"use strict";e.exports=function(){if(process.platform!=="win32"){return false}var e=process.version.substr(1).split(".").map((function(e){return parseInt(e,10)}));return e[0]===0&&e[1]<12}()},7338:(e,t,r)=>{"use strict";var a=r(7147);var n=r(4144);var i=r(6997);var o=r(4105);var s=process.platform==="win32";var p=new n({max:50,maxAge:30*1e3});function readShebang(e){var t;var r;var n;var i;if(p.has(e)){return p.get(e)}t=new Buffer(150);try{r=a.openSync(e,"r");a.readSync(r,t,0,150,0);a.closeSync(r)}catch(e){}n=t.toString().trim().match(/#!(.+)/i);if(n){i=n[1].replace(/\/usr\/bin\/env\s+/i,"")}p.set(e,i);return i}function escapeArg(e,t){e=""+e;if(!t){e=e.replace(/([\(\)%!\^<>&|;,"'\s])/g,"^$1")}else{e=e.replace(/(\\*)"/g,'$1$1\\"');e=e.replace(/(\\*)$/,"$1$1");e='"'+e+'"'}return e}function escapeCommand(e){return/^[a-z0-9_-]+$/i.test(e)?e:escapeArg(e,true)}function requiresShell(e){return!/\.(?:com|exe)$/i.test(e)}function parse(e,t,r){var a;var n;var p;var l;var d;if(t&&!Array.isArray(t)){r=t;t=null}t=t?t.slice(0):[];r=r||{};l=e;if(s){p=i(e);p=p||i(e,true);a=p&&readShebang(p);d=r.shell||o;if(a){t.unshift(p);e=a;d=d||requiresShell(i(a)||i(a,true))}else{d=d||requiresShell(p)}if(d){n=e!=="echo";e=escapeCommand(e);t=t.map((function(e){return escapeArg(e,n)}));t=["/s","/c",'"'+e+(t.length?" "+t.join(" "):"")+'"'];e=process.env.comspec||"cmd.exe";r.windowsVerbatimArguments=true}}return{command:e,args:t,options:r,file:p,original:l}}e.exports=parse},6997:(e,t,r)=>{"use strict";var a=r(1017);var n=r(3623);var i=r(4144);var o=new i({max:50,maxAge:30*1e3});function resolveCommand(e,t){var r;t=!!t;r=o.get(e+"!"+t);if(o.has(e)){return o.get(e)}try{r=!t?n.sync(e):n.sync(e,{pathExt:a.delimiter+(process.env.PATHEXT||"")})}catch(e){}o.set(e+"!"+t,r);return r}e.exports=resolveCommand},4144:(e,t,r)=>{"use strict";e.exports=LRUCache;var a=r(3925);var n=r(3837);var i=r(4071);var o=typeof Symbol==="function"&&process.env._nodeLRUCacheForceNoSymbol!=="1";var s;if(o){s=function(e){return Symbol(e)}}else{s=function(e){return"_"+e}}var p=s("max");var l=s("length");var d=s("lengthCalculator");var c=s("allowStale");var u=s("maxAge");var f=s("dispose");var m=s("noDisposeOnSet");var h=s("lruList");var v=s("cache");function naiveLength(){return 1}function LRUCache(e){if(!(this instanceof LRUCache)){return new LRUCache(e)}if(typeof e==="number"){e={max:e}}if(!e){e={}}var t=this[p]=e.max;if(!t||!(typeof t==="number")||t<=0){this[p]=Infinity}var r=e.length||naiveLength;if(typeof r!=="function"){r=naiveLength}this[d]=r;this[c]=e.stale||false;this[u]=e.maxAge||0;this[f]=e.dispose;this[m]=e.noDisposeOnSet||false;this.reset()}Object.defineProperty(LRUCache.prototype,"max",{set:function(e){if(!e||!(typeof e==="number")||e<=0){e=Infinity}this[p]=e;trim(this)},get:function(){return this[p]},enumerable:true});Object.defineProperty(LRUCache.prototype,"allowStale",{set:function(e){this[c]=!!e},get:function(){return this[c]},enumerable:true});Object.defineProperty(LRUCache.prototype,"maxAge",{set:function(e){if(!e||!(typeof e==="number")||e<0){e=0}this[u]=e;trim(this)},get:function(){return this[u]},enumerable:true});Object.defineProperty(LRUCache.prototype,"lengthCalculator",{set:function(e){if(typeof e!=="function"){e=naiveLength}if(e!==this[d]){this[d]=e;this[l]=0;this[h].forEach((function(e){e.length=this[d](e.value,e.key);this[l]+=e.length}),this)}trim(this)},get:function(){return this[d]},enumerable:true});Object.defineProperty(LRUCache.prototype,"length",{get:function(){return this[l]},enumerable:true});Object.defineProperty(LRUCache.prototype,"itemCount",{get:function(){return this[h].length},enumerable:true});LRUCache.prototype.rforEach=function(e,t){t=t||this;for(var r=this[h].tail;r!==null;){var a=r.prev;forEachStep(this,e,r,t);r=a}};function forEachStep(e,t,r,a){var n=r.value;if(isStale(e,n)){del(e,r);if(!e[c]){n=undefined}}if(n){t.call(a,n.value,n.key,e)}}LRUCache.prototype.forEach=function(e,t){t=t||this;for(var r=this[h].head;r!==null;){var a=r.next;forEachStep(this,e,r,t);r=a}};LRUCache.prototype.keys=function(){return this[h].toArray().map((function(e){return e.key}),this)};LRUCache.prototype.values=function(){return this[h].toArray().map((function(e){return e.value}),this)};LRUCache.prototype.reset=function(){if(this[f]&&this[h]&&this[h].length){this[h].forEach((function(e){this[f](e.key,e.value)}),this)}this[v]=new a;this[h]=new i;this[l]=0};LRUCache.prototype.dump=function(){return this[h].map((function(e){if(!isStale(this,e)){return{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}}}),this).toArray().filter((function(e){return e}))};LRUCache.prototype.dumpLru=function(){return this[h]};LRUCache.prototype.inspect=function(e,t){var r="LRUCache {";var a=false;var i=this[c];if(i){r+="\n allowStale: true";a=true}var o=this[p];if(o&&o!==Infinity){if(a){r+=","}r+="\n max: "+n.inspect(o,t);a=true}var s=this[u];if(s){if(a){r+=","}r+="\n maxAge: "+n.inspect(s,t);a=true}var f=this[d];if(f&&f!==naiveLength){if(a){r+=","}r+="\n length: "+n.inspect(this[l],t);a=true}var m=false;this[h].forEach((function(e){if(m){r+=",\n "}else{if(a){r+=",\n"}m=true;r+="\n "}var i=n.inspect(e.key).split("\n").join("\n ");var o={value:e.value};if(e.maxAge!==s){o.maxAge=e.maxAge}if(f!==naiveLength){o.length=e.length}if(isStale(this,e)){o.stale=true}o=n.inspect(o,t).split("\n").join("\n ");r+=i+" => "+o}));if(m||a){r+="\n"}r+="}";return r};LRUCache.prototype.set=function(e,t,r){r=r||this[u];var a=r?Date.now():0;var n=this[d](t,e);if(this[v].has(e)){if(n>this[p]){del(this,this[v].get(e));return false}var i=this[v].get(e);var o=i.value;if(this[f]){if(!this[m]){this[f](e,o.value)}}o.now=a;o.maxAge=r;o.value=t;this[l]+=n-o.length;o.length=n;this.get(e);trim(this);return true}var s=new Entry(e,t,n,a,r);if(s.length>this[p]){if(this[f]){this[f](e,t)}return false}this[l]+=s.length;this[h].unshift(s);this[v].set(e,this[h].head);trim(this);return true};LRUCache.prototype.has=function(e){if(!this[v].has(e))return false;var t=this[v].get(e).value;if(isStale(this,t)){return false}return true};LRUCache.prototype.get=function(e){return get(this,e,true)};LRUCache.prototype.peek=function(e){return get(this,e,false)};LRUCache.prototype.pop=function(){var e=this[h].tail;if(!e)return null;del(this,e);return e.value};LRUCache.prototype.del=function(e){del(this,this[v].get(e))};LRUCache.prototype.load=function(e){this.reset();var t=Date.now();for(var r=e.length-1;r>=0;r--){var a=e[r];var n=a.e||0;if(n===0){this.set(a.k,a.v)}else{var i=n-t;if(i>0){this.set(a.k,a.v,i)}}}};LRUCache.prototype.prune=function(){var e=this;this[v].forEach((function(t,r){get(e,r,false)}))};function get(e,t,r){var a=e[v].get(t);if(a){var n=a.value;if(isStale(e,n)){del(e,a);if(!e[c])n=undefined}else{if(r){e[h].unshiftNode(a)}}if(n)n=n.value}return n}function isStale(e,t){if(!t||!t.maxAge&&!e[u]){return false}var r=false;var a=Date.now()-t.now;if(t.maxAge){r=a>t.maxAge}else{r=e[u]&&a>e[u]}return r}function trim(e){if(e[l]>e[p]){for(var t=e[h].tail;e[l]>e[p]&&t!==null;){var r=t.prev;del(e,t);t=r}}}function del(e,t){if(t){var r=t.value;if(e[f]){e[f](r.key,r.value)}e[l]-=r.length;e[v].delete(r.key);e[h].removeNode(t)}}function Entry(e,t,r,a,n){this.key=e;this.value=t;this.length=r;this.now=a;this.maxAge=n||0}},4071:e=>{e.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(e){var t=this;if(!(t instanceof Yallist)){t=new Yallist}t.tail=null;t.head=null;t.length=0;if(e&&typeof e.forEach==="function"){e.forEach((function(e){t.push(e)}))}else if(arguments.length>0){for(var r=0,a=arguments.length;r<a;r++){t.push(arguments[r])}}return t}Yallist.prototype.removeNode=function(e){if(e.list!==this){throw new Error("removing node which does not belong to this list")}var t=e.next;var r=e.prev;if(t){t.prev=r}if(r){r.next=t}if(e===this.head){this.head=t}if(e===this.tail){this.tail=r}e.list.length--;e.next=null;e.prev=null;e.list=null};Yallist.prototype.unshiftNode=function(e){if(e===this.head){return}if(e.list){e.list.removeNode(e)}var t=this.head;e.list=this;e.next=t;if(t){t.prev=e}this.head=e;if(!this.tail){this.tail=e}this.length++};Yallist.prototype.pushNode=function(e){if(e===this.tail){return}if(e.list){e.list.removeNode(e)}var t=this.tail;e.list=this;e.prev=t;if(t){t.next=e}this.tail=e;if(!this.head){this.head=e}this.length++};Yallist.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++){push(this,arguments[e])}return this.length};Yallist.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++){unshift(this,arguments[e])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var e=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return e};Yallist.prototype.shift=function(){if(!this.head){return undefined}var e=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return e};Yallist.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,a=0;r!==null;a++){e.call(t,r.value,a,this);r=r.next}};Yallist.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,a=this.length-1;r!==null;a--){e.call(t,r.value,a,this);r=r.prev}};Yallist.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++){r=r.next}if(t===e&&r!==null){return r.value}};Yallist.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++){r=r.prev}if(t===e&&r!==null){return r.value}};Yallist.prototype.map=function(e,t){t=t||this;var r=new Yallist;for(var a=this.head;a!==null;){r.push(e.call(t,a.value,this));a=a.next}return r};Yallist.prototype.mapReverse=function(e,t){t=t||this;var r=new Yallist;for(var a=this.tail;a!==null;){r.push(e.call(t,a.value,this));a=a.prev}return r};Yallist.prototype.reduce=function(e,t){var r;var a=this.head;if(arguments.length>1){r=t}else if(this.head){a=this.head.next;r=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var n=0;a!==null;n++){r=e(r,a.value,n);a=a.next}return r};Yallist.prototype.reduceReverse=function(e,t){var r;var a=this.tail;if(arguments.length>1){r=t}else if(this.tail){a=this.tail.prev;r=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var n=this.length-1;a!==null;n--){r=e(r,a.value,n);a=a.prev}return r};Yallist.prototype.toArray=function(){var e=new Array(this.length);for(var t=0,r=this.head;r!==null;t++){e[t]=r.value;r=r.next}return e};Yallist.prototype.toArrayReverse=function(){var e=new Array(this.length);for(var t=0,r=this.tail;r!==null;t++){e[t]=r.value;r=r.prev}return e};Yallist.prototype.slice=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var a=0,n=this.head;n!==null&&a<e;a++){n=n.next}for(;n!==null&&a<t;a++,n=n.next){r.push(n.value)}return r};Yallist.prototype.sliceReverse=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var a=this.length,n=this.tail;n!==null&&a>t;a--){n=n.prev}for(;n!==null&&a>e;a--,n=n.prev){r.push(n.value)}return r};Yallist.prototype.reverse=function(){var e=this.head;var t=this.tail;for(var r=e;r!==null;r=r.prev){var a=r.prev;r.prev=r.next;r.next=a}this.head=t;this.tail=e;return this};function push(e,t){e.tail=new Node(t,e.tail,null,e);if(!e.head){e.head=e.tail}e.length++}function unshift(e,t){e.head=new Node(t,null,e.head,e);if(!e.tail){e.tail=e.head}e.length++}function Node(e,t,r,a){if(!(this instanceof Node)){return new Node(e,t,r,a)}this.list=a;this.value=e;if(t){t.next=this;this.prev=t}else{this.prev=null}if(r){r.prev=this;this.next=r}else{this.next=null}}},5509:(e,t,r)=>{"use strict";var a=r(8057),n=r(1517),i=r(6277),o=r(9325),s=r(2560);var p=e.exports=function(e,t){var r,n,p,l,d;if(arguments.length<2||typeof e!=="string"){l=t;t=e;e=null}else{l=arguments[2]}if(a(e)){r=s.call(e,"c");n=s.call(e,"e");p=s.call(e,"w")}else{r=p=true;n=false}d={value:t,configurable:r,enumerable:n,writable:p};return!l?d:i(o(l),d)};p.gs=function(e,t,r){var p,l,d,c;if(typeof e!=="string"){d=r;r=t;t=e;e=null}else{d=arguments[3]}if(!a(t)){t=undefined}else if(!n(t)){d=t;t=r=undefined}else if(!a(r)){r=undefined}else if(!n(r)){d=r;r=undefined}if(a(e)){p=s.call(e,"c");l=s.call(e,"e")}else{p=true;l=false}c={get:t,set:r,configurable:p,enumerable:l};return!d?c:i(o(d),c)}},330:(e,t,r)=>{"use strict";var a=r(8272);e.exports=function(e){if(typeof e!=="function")return false;if(!hasOwnProperty.call(e,"length"))return false;try{if(typeof e.length!=="number")return false;if(typeof e.call!=="function")return false;if(typeof e.apply!=="function")return false}catch(e){return false}return!a(e)}},6402:(e,t,r)=>{"use strict";var a=r(8057);var n={object:true,function:true,undefined:true};e.exports=function(e){if(!a(e))return false;return hasOwnProperty.call(n,typeof e)}},1517:(e,t,r)=>{"use strict";var a=r(330);var n=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(e){if(!a(e))return false;if(n.test(i.call(e)))return false;return true}},8272:(e,t,r)=>{"use strict";var a=r(6402);e.exports=function(e){if(!a(e))return false;try{if(!e.constructor)return false;return e.constructor.prototype===e}catch(e){return false}}},8057:e=>{"use strict";var t=void 0;e.exports=function(e){return e!==t&&e!==null}},6637:e=>{"use strict";e.exports=(e,t,r)=>{const define=r=>Object.defineProperty(e,t,{value:r,enumerable:true,writable:true});Object.defineProperty(e,t,{configurable:true,enumerable:true,get(){const e=r();define(e);return e},set(e){define(e)}});return e}},2512:(e,t,r)=>{"use strict";var a=r(265);e.exports.O=convert;function convert(e,t,r){r=checkEncoding(r||"UTF-8");t=checkEncoding(t||"UTF-8");e=e||"";var a;if(r!=="UTF-8"&&typeof e==="string"){e=Buffer.from(e,"binary")}if(r===t){if(typeof e==="string"){a=Buffer.from(e)}else{a=e}}else{try{a=convertIconvLite(e,t,r)}catch(t){console.error(t);a=e}}if(typeof a==="string"){a=Buffer.from(a,"utf-8")}return a}function convertIconvLite(e,t,r){if(t==="UTF-8"){return a.decode(e,r)}else if(r==="UTF-8"){return a.encode(e,t)}else{return a.encode(a.decode(e,r),t)}}function checkEncoding(e){return(e||"").toString().trim().replace(/^latin[\-_]?(\d+)$/i,"ISO-8859-$1").replace(/^win(?:dows)?[\-_]?(\d+)$/i,"WINDOWS-$1").replace(/^utf[\-_]?(\d+)$/i,"UTF-$1").replace(/^ks_c_5601\-1987$/i,"CP949").replace(/^us[\-_]?ascii$/i,"ASCII").toUpperCase()}},725:(e,t,r)=>{"use strict";var a=r(4526).Buffer;t._dbcs=DBCSCodec;var n=-1,i=-2,o=-10,s=-1e3,p=new Array(256),l=-1;for(var d=0;d<256;d++)p[d]=n;function DBCSCodec(e,t){this.encodingName=e.encodingName;if(!e)throw new Error("DBCS codec is called without the data.");if(!e.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var r=e.table();this.decodeTables=[];this.decodeTables[0]=p.slice(0);this.decodeTableSeq=[];for(var a=0;a<r.length;a++)this._addDecodeChunk(r[a]);if(typeof e.gb18030==="function"){this.gb18030=e.gb18030();var o=this.decodeTables.length;this.decodeTables.push(p.slice(0));var l=this.decodeTables.length;this.decodeTables.push(p.slice(0));var d=this.decodeTables[0];for(var a=129;a<=254;a++){var c=this.decodeTables[s-d[a]];for(var u=48;u<=57;u++){if(c[u]===n){c[u]=s-o}else if(c[u]>s){throw new Error("gb18030 decode tables conflict at byte 2")}var f=this.decodeTables[s-c[u]];for(var m=129;m<=254;m++){if(f[m]===n){f[m]=s-l}else if(f[m]===s-l){continue}else if(f[m]>s){throw new Error("gb18030 decode tables conflict at byte 3")}var h=this.decodeTables[s-f[m]];for(var v=48;v<=57;v++){if(h[v]===n)h[v]=i}}}}}this.defaultCharUnicode=t.defaultCharUnicode;this.encodeTable=[];this.encodeTableSeq=[];var y={};if(e.encodeSkipVals)for(var a=0;a<e.encodeSkipVals.length;a++){var b=e.encodeSkipVals[a];if(typeof b==="number")y[b]=true;else for(var u=b.from;u<=b.to;u++)y[u]=true}this._fillEncodeTable(0,0,y);if(e.encodeAdd){for(var g in e.encodeAdd)if(Object.prototype.hasOwnProperty.call(e.encodeAdd,g))this._setEncodeChar(g.charCodeAt(0),e.encodeAdd[g])}this.defCharSB=this.encodeTable[0][t.defaultCharSingleByte.charCodeAt(0)];if(this.defCharSB===n)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===n)this.defCharSB="?".charCodeAt(0)}DBCSCodec.prototype.encoder=DBCSEncoder;DBCSCodec.prototype.decoder=DBCSDecoder;DBCSCodec.prototype._getDecodeTrieNode=function(e){var t=[];for(;e>0;e>>>=8)t.push(e&255);if(t.length==0)t.push(0);var r=this.decodeTables[0];for(var a=t.length-1;a>0;a--){var i=r[t[a]];if(i==n){r[t[a]]=s-this.decodeTables.length;this.decodeTables.push(r=p.slice(0))}else if(i<=s){r=this.decodeTables[s-i]}else throw new Error("Overwrite byte in "+this.encodingName+", addr: "+e.toString(16))}return r};DBCSCodec.prototype._addDecodeChunk=function(e){var t=parseInt(e[0],16);var r=this._getDecodeTrieNode(t);t=t&255;for(var a=1;a<e.length;a++){var n=e[a];if(typeof n==="string"){for(var i=0;i<n.length;){var s=n.charCodeAt(i++);if(55296<=s&&s<56320){var p=n.charCodeAt(i++);if(56320<=p&&p<57344)r[t++]=65536+(s-55296)*1024+(p-56320);else throw new Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+e[0])}else if(4080<s&&s<=4095){var l=4095-s+2;var d=[];for(var c=0;c<l;c++)d.push(n.charCodeAt(i++));r[t++]=o-this.decodeTableSeq.length;this.decodeTableSeq.push(d)}else r[t++]=s}}else if(typeof n==="number"){var u=r[t-1]+1;for(var i=0;i<n;i++)r[t++]=u++}else throw new Error("Incorrect type '"+typeof n+"' given in "+this.encodingName+" at chunk "+e[0])}if(t>255)throw new Error("Incorrect chunk in "+this.encodingName+" at addr "+e[0]+": too long"+t)};DBCSCodec.prototype._getEncodeBucket=function(e){var t=e>>8;if(this.encodeTable[t]===undefined)this.encodeTable[t]=p.slice(0);return this.encodeTable[t]};DBCSCodec.prototype._setEncodeChar=function(e,t){var r=this._getEncodeBucket(e);var a=e&255;if(r[a]<=o)this.encodeTableSeq[o-r[a]][l]=t;else if(r[a]==n)r[a]=t};DBCSCodec.prototype._setEncodeSequence=function(e,t){var r=e[0];var a=this._getEncodeBucket(r);var i=r&255;var s;if(a[i]<=o){s=this.encodeTableSeq[o-a[i]]}else{s={};if(a[i]!==n)s[l]=a[i];a[i]=o-this.encodeTableSeq.length;this.encodeTableSeq.push(s)}for(var p=1;p<e.length-1;p++){var d=s[r];if(typeof d==="object")s=d;else{s=s[r]={};if(d!==undefined)s[l]=d}}r=e[e.length-1];s[r]=t};DBCSCodec.prototype._fillEncodeTable=function(e,t,r){var a=this.decodeTables[e];var n=false;var i={};for(var p=0;p<256;p++){var l=a[p];var d=t+p;if(r[d])continue;if(l>=0){this._setEncodeChar(l,d);n=true}else if(l<=s){var c=s-l;if(!i[c]){var u=d<<8>>>0;if(this._fillEncodeTable(c,u,r))n=true;else i[c]=true}}else if(l<=o){this._setEncodeSequence(this.decodeTableSeq[o-l],d);n=true}}return n};function DBCSEncoder(e,t){this.leadSurrogate=-1;this.seqObj=undefined;this.encodeTable=t.encodeTable;this.encodeTableSeq=t.encodeTableSeq;this.defaultCharSingleByte=t.defCharSB;this.gb18030=t.gb18030}DBCSEncoder.prototype.write=function(e){var t=a.alloc(e.length*(this.gb18030?4:3)),r=this.leadSurrogate,i=this.seqObj,s=-1,p=0,d=0;while(true){if(s===-1){if(p==e.length)break;var c=e.charCodeAt(p++)}else{var c=s;s=-1}if(55296<=c&&c<57344){if(c<56320){if(r===-1){r=c;continue}else{r=c;c=n}}else{if(r!==-1){c=65536+(r-55296)*1024+(c-56320);r=-1}else{c=n}}}else if(r!==-1){s=c;c=n;r=-1}var u=n;if(i!==undefined&&c!=n){var f=i[c];if(typeof f==="object"){i=f;continue}else if(typeof f=="number"){u=f}else if(f==undefined){f=i[l];if(f!==undefined){u=f;s=c}else{}}i=undefined}else if(c>=0){var m=this.encodeTable[c>>8];if(m!==undefined)u=m[c&255];if(u<=o){i=this.encodeTableSeq[o-u];continue}if(u==n&&this.gb18030){var h=findIdx(this.gb18030.uChars,c);if(h!=-1){var u=this.gb18030.gbChars[h]+(c-this.gb18030.uChars[h]);t[d++]=129+Math.floor(u/12600);u=u%12600;t[d++]=48+Math.floor(u/1260);u=u%1260;t[d++]=129+Math.floor(u/10);u=u%10;t[d++]=48+u;continue}}}if(u===n)u=this.defaultCharSingleByte;if(u<256){t[d++]=u}else if(u<65536){t[d++]=u>>8;t[d++]=u&255}else if(u<16777216){t[d++]=u>>16;t[d++]=u>>8&255;t[d++]=u&255}else{t[d++]=u>>>24;t[d++]=u>>>16&255;t[d++]=u>>>8&255;t[d++]=u&255}}this.seqObj=i;this.leadSurrogate=r;return t.slice(0,d)};DBCSEncoder.prototype.end=function(){if(this.leadSurrogate===-1&&this.seqObj===undefined)return;var e=a.alloc(10),t=0;if(this.seqObj){var r=this.seqObj[l];if(r!==undefined){if(r<256){e[t++]=r}else{e[t++]=r>>8;e[t++]=r&255}}else{}this.seqObj=undefined}if(this.leadSurrogate!==-1){e[t++]=this.defaultCharSingleByte;this.leadSurrogate=-1}return e.slice(0,t)};DBCSEncoder.prototype.findIdx=findIdx;function DBCSDecoder(e,t){this.nodeIdx=0;this.prevBytes=[];this.decodeTables=t.decodeTables;this.decodeTableSeq=t.decodeTableSeq;this.defaultCharUnicode=t.defaultCharUnicode;this.gb18030=t.gb18030}DBCSDecoder.prototype.write=function(e){var t=a.alloc(e.length*2),r=this.nodeIdx,p=this.prevBytes,l=this.prevBytes.length,d=-this.prevBytes.length,c;for(var u=0,f=0;u<e.length;u++){var m=u>=0?e[u]:p[u+l];var c=this.decodeTables[r][m];if(c>=0){}else if(c===n){c=this.defaultCharUnicode.charCodeAt(0);u=d}else if(c===i){if(u>=3){var h=(e[u-3]-129)*12600+(e[u-2]-48)*1260+(e[u-1]-129)*10+(m-48)}else{var h=(p[u-3+l]-129)*12600+((u-2>=0?e[u-2]:p[u-2+l])-48)*1260+((u-1>=0?e[u-1]:p[u-1+l])-129)*10+(m-48)}var v=findIdx(this.gb18030.gbChars,h);c=this.gb18030.uChars[v]+h-this.gb18030.gbChars[v]}else if(c<=s){r=s-c;continue}else if(c<=o){var y=this.decodeTableSeq[o-c];for(var b=0;b<y.length-1;b++){c=y[b];t[f++]=c&255;t[f++]=c>>8}c=y[y.length-1]}else throw new Error("iconv-lite internal error: invalid decoding table value "+c+" at "+r+"/"+m);if(c>=65536){c-=65536;var g=55296|c>>10;t[f++]=g&255;t[f++]=g>>8;c=56320|c&1023}t[f++]=c&255;t[f++]=c>>8;r=0;d=u+1}this.nodeIdx=r;this.prevBytes=d>=0?Array.prototype.slice.call(e,d):p.slice(d+l).concat(Array.prototype.slice.call(e));return t.slice(0,f).toString("ucs2")};DBCSDecoder.prototype.end=function(){var e="";while(this.prevBytes.length>0){e+=this.defaultCharUnicode;var t=this.prevBytes.slice(1);this.prevBytes=[];this.nodeIdx=0;if(t.length>0)e+=this.write(t)}this.prevBytes=[];this.nodeIdx=0;return e};function findIdx(e,t){if(e[0]>t)return-1;var r=0,a=e.length;while(r<a-1){var n=r+(a-r+1>>1);if(e[n]<=t)r=n;else a=n}return r}},8352:(e,t,r)=>{"use strict";e.exports={shiftjis:{type:"_dbcs",table:function(){return r(9572)},encodeAdd:{"¥":92,"‾":126},encodeSkipVals:[{from:60736,to:63808}]},csshiftjis:"shiftjis",mskanji:"shiftjis",sjis:"shiftjis",windows31j:"shiftjis",ms31j:"shiftjis",xsjis:"shiftjis",windows932:"shiftjis",ms932:"shiftjis",932:"shiftjis",cp932:"shiftjis",eucjp:{type:"_dbcs",table:function(){return r(8470)},encodeAdd:{"¥":92,"‾":126}},gb2312:"cp936",gb231280:"cp936",gb23121980:"cp936",csgb2312:"cp936",csiso58gb231280:"cp936",euccn:"cp936",windows936:"cp936",ms936:"cp936",936:"cp936",cp936:{type:"_dbcs",table:function(){return r(6901)}},gbk:{type:"_dbcs",table:function(){return r(6901).concat(r(6315))}},xgbk:"gbk",isoir58:"gbk",gb18030:{type:"_dbcs",table:function(){return r(6901).concat(r(6315))},gb18030:function(){return r(6176)},encodeSkipVals:[128],encodeAdd:{"€":41699}},chinese:"gb18030",windows949:"cp949",ms949:"cp949",949:"cp949",cp949:{type:"_dbcs",table:function(){return r(6354)}},cseuckr:"cp949",csksc56011987:"cp949",euckr:"cp949",isoir149:"cp949",korean:"cp949",ksc56011987:"cp949",ksc56011989:"cp949",ksc5601:"cp949",windows950:"cp950",ms950:"cp950",950:"cp950",cp950:{type:"_dbcs",table:function(){return r(5969)}},big5:"big5hkscs",big5hkscs:{type:"_dbcs",table:function(){return r(5969).concat(r(8370))},encodeSkipVals:[36457,36463,36478,36523,36532,36557,36560,36695,36713,36718,36811,36862,36973,36986,37060,37084,37105,37311,37551,37552,37553,37554,37585,37959,38090,38361,38652,39285,39798,39800,39803,39878,39902,39916,39926,40002,40019,40034,40040,40043,40055,40124,40125,40144,40279,40282,40388,40431,40443,40617,40687,40701,40800,40907,41079,41180,41183,36812,37576,38468,38637,41636,41637,41639,41638,41676,41678]},cnbig5:"big5hkscs",csbig5:"big5hkscs",xxbig5:"big5hkscs"}},5204:(e,t,r)=>{"use strict";var a=[r(3056),r(3735),r(7428),r(690),r(6890),r(2385),r(3544),r(725),r(8352)];for(var n=0;n<a.length;n++){var i=a[n];for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o))t[o]=i[o]}},3056:(e,t,r)=>{"use strict";var a=r(4526).Buffer;e.exports={utf8:{type:"_internal",bomAware:true},cesu8:{type:"_internal",bomAware:true},unicode11utf8:"utf8",ucs2:{type:"_internal",bomAware:true},utf16le:"ucs2",binary:{type:"_internal"},base64:{type:"_internal"},hex:{type:"_internal"},_internal:InternalCodec};function InternalCodec(e,t){this.enc=e.encodingName;this.bomAware=e.bomAware;if(this.enc==="base64")this.encoder=InternalEncoderBase64;else if(this.enc==="cesu8"){this.enc="utf8";this.encoder=InternalEncoderCesu8;if(a.from("eda0bdedb2a9","hex").toString()!=="💩"){this.decoder=InternalDecoderCesu8;this.defaultCharUnicode=t.defaultCharUnicode}}}InternalCodec.prototype.encoder=InternalEncoder;InternalCodec.prototype.decoder=InternalDecoder;var n=r(1576).StringDecoder;if(!n.prototype.end)n.prototype.end=function(){};function InternalDecoder(e,t){this.decoder=new n(t.enc)}InternalDecoder.prototype.write=function(e){if(!a.isBuffer(e)){e=a.from(e)}return this.decoder.write(e)};InternalDecoder.prototype.end=function(){return this.decoder.end()};function InternalEncoder(e,t){this.enc=t.enc}InternalEncoder.prototype.write=function(e){return a.from(e,this.enc)};InternalEncoder.prototype.end=function(){};function InternalEncoderBase64(e,t){this.prevStr=""}InternalEncoderBase64.prototype.write=function(e){e=this.prevStr+e;var t=e.length-e.length%4;this.prevStr=e.slice(t);e=e.slice(0,t);return a.from(e,"base64")};InternalEncoderBase64.prototype.end=function(){return a.from(this.prevStr,"base64")};function InternalEncoderCesu8(e,t){}InternalEncoderCesu8.prototype.write=function(e){var t=a.alloc(e.length*3),r=0;for(var n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i<128)t[r++]=i;else if(i<2048){t[r++]=192+(i>>>6);t[r++]=128+(i&63)}else{t[r++]=224+(i>>>12);t[r++]=128+(i>>>6&63);t[r++]=128+(i&63)}}return t.slice(0,r)};InternalEncoderCesu8.prototype.end=function(){};function InternalDecoderCesu8(e,t){this.acc=0;this.contBytes=0;this.accBytes=0;this.defaultCharUnicode=t.defaultCharUnicode}InternalDecoderCesu8.prototype.write=function(e){var t=this.acc,r=this.contBytes,a=this.accBytes,n="";for(var i=0;i<e.length;i++){var o=e[i];if((o&192)!==128){if(r>0){n+=this.defaultCharUnicode;r=0}if(o<128){n+=String.fromCharCode(o)}else if(o<224){t=o&31;r=1;a=1}else if(o<240){t=o&15;r=2;a=1}else{n+=this.defaultCharUnicode}}else{if(r>0){t=t<<6|o&63;r--;a++;if(r===0){if(a===2&&t<128&&t>0)n+=this.defaultCharUnicode;else if(a===3&&t<2048)n+=this.defaultCharUnicode;else n+=String.fromCharCode(t)}}else{n+=this.defaultCharUnicode}}}this.acc=t;this.contBytes=r;this.accBytes=a;return n};InternalDecoderCesu8.prototype.end=function(){var e=0;if(this.contBytes>0)e+=this.defaultCharUnicode;return e}},6890:(e,t,r)=>{"use strict";var a=r(4526).Buffer;t._sbcs=SBCSCodec;function SBCSCodec(e,t){if(!e)throw new Error("SBCS codec is called without the data.");if(!e.chars||e.chars.length!==128&&e.chars.length!==256)throw new Error("Encoding '"+e.type+"' has incorrect 'chars' (must be of len 128 or 256)");if(e.chars.length===128){var r="";for(var n=0;n<128;n++)r+=String.fromCharCode(n);e.chars=r+e.chars}this.decodeBuf=a.from(e.chars,"ucs2");var i=a.alloc(65536,t.defaultCharSingleByte.charCodeAt(0));for(var n=0;n<e.chars.length;n++)i[e.chars.charCodeAt(n)]=n;this.encodeBuf=i}SBCSCodec.prototype.encoder=SBCSEncoder;SBCSCodec.prototype.decoder=SBCSDecoder;function SBCSEncoder(e,t){this.encodeBuf=t.encodeBuf}SBCSEncoder.prototype.write=function(e){var t=a.alloc(e.length);for(var r=0;r<e.length;r++)t[r]=this.encodeBuf[e.charCodeAt(r)];return t};SBCSEncoder.prototype.end=function(){};function SBCSDecoder(e,t){this.decodeBuf=t.decodeBuf}SBCSDecoder.prototype.write=function(e){var t=this.decodeBuf;var r=a.alloc(e.length*2);var n=0,i=0;for(var o=0;o<e.length;o++){n=e[o]*2;i=o*2;r[i]=t[n];r[i+1]=t[n+1]}return r.toString("ucs2")};SBCSDecoder.prototype.end=function(){}},3544:e=>{"use strict";e.exports={437:"cp437",737:"cp737",775:"cp775",850:"cp850",852:"cp852",855:"cp855",856:"cp856",857:"cp857",858:"cp858",860:"cp860",861:"cp861",862:"cp862",863:"cp863",864:"cp864",865:"cp865",866:"cp866",869:"cp869",874:"windows874",922:"cp922",1046:"cp1046",1124:"cp1124",1125:"cp1125",1129:"cp1129",1133:"cp1133",1161:"cp1161",1162:"cp1162",1163:"cp1163",1250:"windows1250",1251:"windows1251",1252:"windows1252",1253:"windows1253",1254:"windows1254",1255:"windows1255",1256:"windows1256",1257:"windows1257",1258:"windows1258",28591:"iso88591",28592:"iso88592",28593:"iso88593",28594:"iso88594",28595:"iso88595",28596:"iso88596",28597:"iso88597",28598:"iso88598",28599:"iso88599",28600:"iso885910",28601:"iso885911",28603:"iso885913",28604:"iso885914",28605:"iso885915",28606:"iso885916",windows874:{type:"_sbcs",chars:"€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},win874:"windows874",cp874:"windows874",windows1250:{type:"_sbcs",chars:"€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"},win1250:"windows1250",cp1250:"windows1250",windows1251:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},win1251:"windows1251",cp1251:"windows1251",windows1252:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},win1252:"windows1252",cp1252:"windows1252",windows1253:{type:"_sbcs",chars:"€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"},win1253:"windows1253",cp1253:"windows1253",windows1254:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"},win1254:"windows1254",cp1254:"windows1254",windows1255:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"},win1255:"windows1255",cp1255:"windows1255",windows1256:{type:"_sbcs",chars:"€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے"},win1256:"windows1256",cp1256:"windows1256",windows1257:{type:"_sbcs",chars:"€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"},win1257:"windows1257",cp1257:"windows1257",windows1258:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},win1258:"windows1258",cp1258:"windows1258",iso88591:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},cp28591:"iso88591",iso88592:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"},cp28592:"iso88592",iso88593:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙"},cp28593:"iso88593",iso88594:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"},cp28594:"iso88594",iso88595:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"},cp28595:"iso88595",iso88596:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������"},cp28596:"iso88596",iso88597:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"},cp28597:"iso88597",iso88598:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"},cp28598:"iso88598",iso88599:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"},cp28599:"iso88599",iso885910:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"},cp28600:"iso885910",iso885911:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},cp28601:"iso885911",iso885913:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"},cp28603:"iso885913",iso885914:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"},cp28604:"iso885914",iso885915:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},cp28605:"iso885915",iso885916:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"},cp28606:"iso885916",cp437:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm437:"cp437",csibm437:"cp437",cp737:{type:"_sbcs",chars:"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "},ibm737:"cp737",csibm737:"cp737",cp775:{type:"_sbcs",chars:"ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ "},ibm775:"cp775",csibm775:"cp775",cp850:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "},ibm850:"cp850",csibm850:"cp850",cp852:{type:"_sbcs",chars:"ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ "},ibm852:"cp852",csibm852:"cp852",cp855:{type:"_sbcs",chars:"ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ "},ibm855:"cp855",csibm855:"cp855",cp856:{type:"_sbcs",chars:"אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ "},ibm856:"cp856",csibm856:"cp856",cp857:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ "},ibm857:"cp857",csibm857:"cp857",cp858:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "},ibm858:"cp858",csibm858:"cp858",cp860:{type:"_sbcs",chars:"ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm860:"cp860",csibm860:"cp860",cp861:{type:"_sbcs",chars:"ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm861:"cp861",csibm861:"cp861",cp862:{type:"_sbcs",chars:"אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm862:"cp862",csibm862:"cp862",cp863:{type:"_sbcs",chars:"ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm863:"cp863",csibm863:"cp863",cp864:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�"},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csibm1163:"cp1163",maccroatian:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"},maccyrillic:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},macgreek:{type:"_sbcs",chars:"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"},maciceland:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macroman:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macromania:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macthai:{type:"_sbcs",chars:"«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู\ufeff​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"},macturkish:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"},macukraine:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},koi8r:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8u:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8ru:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8t:{type:"_sbcs",chars:"қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},armscii8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"},rk1048:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},tcvn:{type:"_sbcs",chars:"\0ÚỤỪỬỮ\b\t\n\v\f\rỨỰỲỶỸÝỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"},georgianacademy:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:"\0ẲẴẪ\b\t\n\v\f\rỶỸỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"},iso646cn:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},iso646jp:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}},2385:e=>{"use strict";e.exports={10029:"maccenteuro",maccenteuro:{type:"_sbcs",chars:"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"},808:"cp808",ibm808:"cp808",cp808:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "},mik:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},cp720:{type:"_sbcs",chars:"€éâ„à†çêëèïّْô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡ًٌٍَُِ≈°∙·√ⁿ²■ "},ascii8bit:"ascii",usascii:"ascii",ansix34:"ascii",ansix341968:"ascii",ansix341986:"ascii",csascii:"ascii",cp367:"ascii",ibm367:"ascii",isoir6:"ascii",iso646us:"ascii",iso646irv:"ascii",us:"ascii",latin1:"iso88591",latin2:"iso88592",latin3:"iso88593",latin4:"iso88594",latin5:"iso88599",latin6:"iso885910",latin7:"iso885913",latin8:"iso885914",latin9:"iso885915",latin10:"iso885916",csisolatin1:"iso88591",csisolatin2:"iso88592",csisolatin3:"iso88593",csisolatin4:"iso88594",csisolatincyrillic:"iso88595",csisolatinarabic:"iso88596",csisolatingreek:"iso88597",csisolatinhebrew:"iso88598",csisolatin5:"iso88599",csisolatin6:"iso885910",l1:"iso88591",l2:"iso88592",l3:"iso88593",l4:"iso88594",l5:"iso88599",l6:"iso885910",l7:"iso885913",l8:"iso885914",l9:"iso885915",l10:"iso885916",isoir14:"iso646jp",isoir57:"iso646cn",isoir100:"iso88591",isoir101:"iso88592",isoir109:"iso88593",isoir110:"iso88594",isoir144:"iso88595",isoir127:"iso88596",isoir126:"iso88597",isoir138:"iso88598",isoir148:"iso88599",isoir157:"iso885910",isoir166:"tis620",isoir179:"iso885913",isoir199:"iso885914",isoir203:"iso885915",isoir226:"iso885916",cp819:"iso88591",ibm819:"iso88591",cyrillic:"iso88595",arabic:"iso88596",arabic8:"iso88596",ecma114:"iso88596",asmo708:"iso88596",greek:"iso88597",greek8:"iso88597",ecma118:"iso88597",elot928:"iso88597",hebrew:"iso88598",hebrew8:"iso88598",turkish:"iso88599",turkish8:"iso88599",thai:"iso885911",thai8:"iso885911",celtic:"iso885914",celtic8:"iso885914",isoceltic:"iso885914",tis6200:"tis620",tis62025291:"tis620",tis62025330:"tis620",1e4:"macroman",10006:"macgreek",10007:"maccyrillic",10079:"maciceland",10081:"macturkish",cspc8codepage437:"cp437",cspc775baltic:"cp775",cspc850multilingual:"cp850",cspcp852:"cp852",cspc862latinhebrew:"cp862",cpgr:"cp869",msee:"cp1250",mscyrl:"cp1251",msansi:"cp1252",msgreek:"cp1253",msturk:"cp1254",mshebr:"cp1255",msarab:"cp1256",winbaltrim:"cp1257",cp20866:"koi8r",20866:"koi8r",ibm878:"koi8r",cskoi8r:"koi8r",cp21866:"koi8u",21866:"koi8u",ibm1168:"koi8u",strk10482002:"rk1048",tcvn5712:"tcvn",tcvn57121:"tcvn",gb198880:"iso646cn",cn:"iso646cn",csiso14jisc6220ro:"iso646jp",jisc62201969ro:"iso646jp",jp:"iso646jp",cshproman8:"hproman8",r8:"hproman8",roman8:"hproman8",xroman8:"hproman8",ibm1051:"hproman8",mac:"macintosh",csmacintosh:"macintosh"}},7428:(e,t,r)=>{"use strict";var a=r(4526).Buffer;t.utf16be=Utf16BECodec;function Utf16BECodec(){}Utf16BECodec.prototype.encoder=Utf16BEEncoder;Utf16BECodec.prototype.decoder=Utf16BEDecoder;Utf16BECodec.prototype.bomAware=true;function Utf16BEEncoder(){}Utf16BEEncoder.prototype.write=function(e){var t=a.from(e,"ucs2");for(var r=0;r<t.length;r+=2){var n=t[r];t[r]=t[r+1];t[r+1]=n}return t};Utf16BEEncoder.prototype.end=function(){};function Utf16BEDecoder(){this.overflowByte=-1}Utf16BEDecoder.prototype.write=function(e){if(e.length==0)return"";var t=a.alloc(e.length+1),r=0,n=0;if(this.overflowByte!==-1){t[0]=e[0];t[1]=this.overflowByte;r=1;n=2}for(;r<e.length-1;r+=2,n+=2){t[n]=e[r+1];t[n+1]=e[r]}this.overflowByte=r==e.length-1?e[e.length-1]:-1;return t.slice(0,n).toString("ucs2")};Utf16BEDecoder.prototype.end=function(){this.overflowByte=-1};t.utf16=Utf16Codec;function Utf16Codec(e,t){this.iconv=t}Utf16Codec.prototype.encoder=Utf16Encoder;Utf16Codec.prototype.decoder=Utf16Decoder;function Utf16Encoder(e,t){e=e||{};if(e.addBOM===undefined)e.addBOM=true;this.encoder=t.iconv.getEncoder("utf-16le",e)}Utf16Encoder.prototype.write=function(e){return this.encoder.write(e)};Utf16Encoder.prototype.end=function(){return this.encoder.end()};function Utf16Decoder(e,t){this.decoder=null;this.initialBufs=[];this.initialBufsLen=0;this.options=e||{};this.iconv=t.iconv}Utf16Decoder.prototype.write=function(e){if(!this.decoder){this.initialBufs.push(e);this.initialBufsLen+=e.length;if(this.initialBufsLen<16)return"";var t=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);var r="";for(var a=0;a<this.initialBufs.length;a++)r+=this.decoder.write(this.initialBufs[a]);this.initialBufs.length=this.initialBufsLen=0;return r}return this.decoder.write(e)};Utf16Decoder.prototype.end=function(){if(!this.decoder){var e=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);var t="";for(var r=0;r<this.initialBufs.length;r++)t+=this.decoder.write(this.initialBufs[r]);var a=this.decoder.end();if(a)t+=a;this.initialBufs.length=this.initialBufsLen=0;return t}return this.decoder.end()};function detectEncoding(e,t){var r=[];var a=0;var n=0,i=0;e:for(var o=0;o<e.length;o++){var s=e[o];for(var p=0;p<s.length;p++){r.push(s[p]);if(r.length===2){if(a===0){if(r[0]===255&&r[1]===254)return"utf-16le";if(r[0]===254&&r[1]===255)return"utf-16be"}if(r[0]===0&&r[1]!==0)i++;if(r[0]!==0&&r[1]===0)n++;r.length=0;a++;if(a>=100){break e}}}}if(i>n)return"utf-16be";if(i<n)return"utf-16le";return t||"utf-16le"}},3735:(e,t,r)=>{"use strict";var a=r(4526).Buffer;t._utf32=Utf32Codec;function Utf32Codec(e,t){this.iconv=t;this.bomAware=true;this.isLE=e.isLE}t.utf32le={type:"_utf32",isLE:true};t.utf32be={type:"_utf32",isLE:false};t.ucs4le="utf32le";t.ucs4be="utf32be";Utf32Codec.prototype.encoder=Utf32Encoder;Utf32Codec.prototype.decoder=Utf32Decoder;function Utf32Encoder(e,t){this.isLE=t.isLE;this.highSurrogate=0}Utf32Encoder.prototype.write=function(e){var t=a.from(e,"ucs2");var r=a.alloc(t.length*2);var n=this.isLE?r.writeUInt32LE:r.writeUInt32BE;var i=0;for(var o=0;o<t.length;o+=2){var s=t.readUInt16LE(o);var p=55296<=s&&s<56320;var l=56320<=s&&s<57344;if(this.highSurrogate){if(p||!l){n.call(r,this.highSurrogate,i);i+=4}else{var d=(this.highSurrogate-55296<<10|s-56320)+65536;n.call(r,d,i);i+=4;this.highSurrogate=0;continue}}if(p)this.highSurrogate=s;else{n.call(r,s,i);i+=4;this.highSurrogate=0}}if(i<r.length)r=r.slice(0,i);return r};Utf32Encoder.prototype.end=function(){if(!this.highSurrogate)return;var e=a.alloc(4);if(this.isLE)e.writeUInt32LE(this.highSurrogate,0);else e.writeUInt32BE(this.highSurrogate,0);this.highSurrogate=0;return e};function Utf32Decoder(e,t){this.isLE=t.isLE;this.badChar=t.iconv.defaultCharUnicode.charCodeAt(0);this.overflow=[]}Utf32Decoder.prototype.write=function(e){if(e.length===0)return"";var t=0;var r=0;var n=a.alloc(e.length+4);var i=0;var o=this.isLE;var s=this.overflow;var p=this.badChar;if(s.length>0){for(;t<e.length&&s.length<4;t++)s.push(e[t]);if(s.length===4){if(o){r=s[t]|s[t+1]<<8|s[t+2]<<16|s[t+3]<<24}else{r=s[t+3]|s[t+2]<<8|s[t+1]<<16|s[t]<<24}s.length=0;i=_writeCodepoint(n,i,r,p)}}for(;t<e.length-3;t+=4){if(o){r=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}else{r=e[t+3]|e[t+2]<<8|e[t+1]<<16|e[t]<<24}i=_writeCodepoint(n,i,r,p)}for(;t<e.length;t++){s.push(e[t])}return n.slice(0,i).toString("ucs2")};function _writeCodepoint(e,t,r,a){if(r<0||r>1114111){r=a}if(r>=65536){r-=65536;var n=55296|r>>10;e[t++]=n&255;e[t++]=n>>8;var r=56320|r&1023}e[t++]=r&255;e[t++]=r>>8;return t}Utf32Decoder.prototype.end=function(){this.overflow.length=0};t.utf32=Utf32AutoCodec;t.ucs4="utf32";function Utf32AutoCodec(e,t){this.iconv=t}Utf32AutoCodec.prototype.encoder=Utf32AutoEncoder;Utf32AutoCodec.prototype.decoder=Utf32AutoDecoder;function Utf32AutoEncoder(e,t){e=e||{};if(e.addBOM===undefined)e.addBOM=true;this.encoder=t.iconv.getEncoder(e.defaultEncoding||"utf-32le",e)}Utf32AutoEncoder.prototype.write=function(e){return this.encoder.write(e)};Utf32AutoEncoder.prototype.end=function(){return this.encoder.end()};function Utf32AutoDecoder(e,t){this.decoder=null;this.initialBufs=[];this.initialBufsLen=0;this.options=e||{};this.iconv=t.iconv}Utf32AutoDecoder.prototype.write=function(e){if(!this.decoder){this.initialBufs.push(e);this.initialBufsLen+=e.length;if(this.initialBufsLen<32)return"";var t=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);var r="";for(var a=0;a<this.initialBufs.length;a++)r+=this.decoder.write(this.initialBufs[a]);this.initialBufs.length=this.initialBufsLen=0;return r}return this.decoder.write(e)};Utf32AutoDecoder.prototype.end=function(){if(!this.decoder){var e=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);var t="";for(var r=0;r<this.initialBufs.length;r++)t+=this.decoder.write(this.initialBufs[r]);var a=this.decoder.end();if(a)t+=a;this.initialBufs.length=this.initialBufsLen=0;return t}return this.decoder.end()};function detectEncoding(e,t){var r=[];var a=0;var n=0,i=0;var o=0,s=0;e:for(var p=0;p<e.length;p++){var l=e[p];for(var d=0;d<l.length;d++){r.push(l[d]);if(r.length===4){if(a===0){if(r[0]===255&&r[1]===254&&r[2]===0&&r[3]===0){return"utf-32le"}if(r[0]===0&&r[1]===0&&r[2]===254&&r[3]===255){return"utf-32be"}}if(r[0]!==0||r[1]>16)i++;if(r[3]!==0||r[2]>16)n++;if(r[0]===0&&r[1]===0&&(r[2]!==0||r[3]!==0))s++;if((r[0]!==0||r[1]!==0)&&r[2]===0&&r[3]===0)o++;r.length=0;a++;if(a>=100){break e}}}}if(s-i>o-n)return"utf-32be";if(s-i<o-n)return"utf-32le";return t||"utf-32le"}},690:(e,t,r)=>{"use strict";var a=r(4526).Buffer;t.utf7=Utf7Codec;t.unicode11utf7="utf7";function Utf7Codec(e,t){this.iconv=t}Utf7Codec.prototype.encoder=Utf7Encoder;Utf7Codec.prototype.decoder=Utf7Decoder;Utf7Codec.prototype.bomAware=true;var n=/[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;function Utf7Encoder(e,t){this.iconv=t.iconv}Utf7Encoder.prototype.write=function(e){return a.from(e.replace(n,function(e){return"+"+(e==="+"?"":this.iconv.encode(e,"utf16-be").toString("base64").replace(/=+$/,""))+"-"}.bind(this)))};Utf7Encoder.prototype.end=function(){};function Utf7Decoder(e,t){this.iconv=t.iconv;this.inBase64=false;this.base64Accum=""}var i=/[A-Za-z0-9\/+]/;var o=[];for(var s=0;s<256;s++)o[s]=i.test(String.fromCharCode(s));var p="+".charCodeAt(0),l="-".charCodeAt(0),d="&".charCodeAt(0);Utf7Decoder.prototype.write=function(e){var t="",r=0,n=this.inBase64,i=this.base64Accum;for(var s=0;s<e.length;s++){if(!n){if(e[s]==p){t+=this.iconv.decode(e.slice(r,s),"ascii");r=s+1;n=true}}else{if(!o[e[s]]){if(s==r&&e[s]==l){t+="+"}else{var d=i+this.iconv.decode(e.slice(r,s),"ascii");t+=this.iconv.decode(a.from(d,"base64"),"utf16-be")}if(e[s]!=l)s--;r=s+1;n=false;i=""}}}if(!n){t+=this.iconv.decode(e.slice(r),"ascii")}else{var d=i+this.iconv.decode(e.slice(r),"ascii");var c=d.length-d.length%8;i=d.slice(c);d=d.slice(0,c);t+=this.iconv.decode(a.from(d,"base64"),"utf16-be")}this.inBase64=n;this.base64Accum=i;return t};Utf7Decoder.prototype.end=function(){var e="";if(this.inBase64&&this.base64Accum.length>0)e=this.iconv.decode(a.from(this.base64Accum,"base64"),"utf16-be");this.inBase64=false;this.base64Accum="";return e};t.utf7imap=Utf7IMAPCodec;function Utf7IMAPCodec(e,t){this.iconv=t}Utf7IMAPCodec.prototype.encoder=Utf7IMAPEncoder;Utf7IMAPCodec.prototype.decoder=Utf7IMAPDecoder;Utf7IMAPCodec.prototype.bomAware=true;function Utf7IMAPEncoder(e,t){this.iconv=t.iconv;this.inBase64=false;this.base64Accum=a.alloc(6);this.base64AccumIdx=0}Utf7IMAPEncoder.prototype.write=function(e){var t=this.inBase64,r=this.base64Accum,n=this.base64AccumIdx,i=a.alloc(e.length*5+10),o=0;for(var s=0;s<e.length;s++){var p=e.charCodeAt(s);if(32<=p&&p<=126){if(t){if(n>0){o+=i.write(r.slice(0,n).toString("base64").replace(/\//g,",").replace(/=+$/,""),o);n=0}i[o++]=l;t=false}if(!t){i[o++]=p;if(p===d)i[o++]=l}}else{if(!t){i[o++]=d;t=true}if(t){r[n++]=p>>8;r[n++]=p&255;if(n==r.length){o+=i.write(r.toString("base64").replace(/\//g,","),o);n=0}}}}this.inBase64=t;this.base64AccumIdx=n;return i.slice(0,o)};Utf7IMAPEncoder.prototype.end=function(){var e=a.alloc(10),t=0;if(this.inBase64){if(this.base64AccumIdx>0){t+=e.write(this.base64Accum.slice(0,this.base64AccumIdx).toString("base64").replace(/\//g,",").replace(/=+$/,""),t);this.base64AccumIdx=0}e[t++]=l;this.inBase64=false}return e.slice(0,t)};function Utf7IMAPDecoder(e,t){this.iconv=t.iconv;this.inBase64=false;this.base64Accum=""}var c=o.slice();c[",".charCodeAt(0)]=true;Utf7IMAPDecoder.prototype.write=function(e){var t="",r=0,n=this.inBase64,i=this.base64Accum;for(var o=0;o<e.length;o++){if(!n){if(e[o]==d){t+=this.iconv.decode(e.slice(r,o),"ascii");r=o+1;n=true}}else{if(!c[e[o]]){if(o==r&&e[o]==l){t+="&"}else{var s=i+this.iconv.decode(e.slice(r,o),"ascii").replace(/,/g,"/");t+=this.iconv.decode(a.from(s,"base64"),"utf16-be")}if(e[o]!=l)o--;r=o+1;n=false;i=""}}}if(!n){t+=this.iconv.decode(e.slice(r),"ascii")}else{var s=i+this.iconv.decode(e.slice(r),"ascii").replace(/,/g,"/");var p=s.length-s.length%8;i=s.slice(p);s=s.slice(0,p);t+=this.iconv.decode(a.from(s,"base64"),"utf16-be")}this.inBase64=n;this.base64Accum=i;return t};Utf7IMAPDecoder.prototype.end=function(){var e="";if(this.inBase64&&this.base64Accum.length>0)e=this.iconv.decode(a.from(this.base64Accum,"base64"),"utf16-be");this.inBase64=false;this.base64Accum="";return e}},1577:(e,t)=>{"use strict";var r="\ufeff";t.PrependBOM=PrependBOMWrapper;function PrependBOMWrapper(e,t){this.encoder=e;this.addBOM=true}PrependBOMWrapper.prototype.write=function(e){if(this.addBOM){e=r+e;this.addBOM=false}return this.encoder.write(e)};PrependBOMWrapper.prototype.end=function(){return this.encoder.end()};t.StripBOM=StripBOMWrapper;function StripBOMWrapper(e,t){this.decoder=e;this.pass=false;this.options=t||{}}StripBOMWrapper.prototype.write=function(e){var t=this.decoder.write(e);if(this.pass||!t)return t;if(t[0]===r){t=t.slice(1);if(typeof this.options.stripBOM==="function")this.options.stripBOM()}this.pass=true;return t};StripBOMWrapper.prototype.end=function(){return this.decoder.end()}},265:(e,t,r)=>{"use strict";var a=r(4526).Buffer;var n=r(1577),i=e.exports;i.encodings=null;i.defaultCharUnicode="�";i.defaultCharSingleByte="?";i.encode=function encode(e,t,r){e=""+(e||"");var n=i.getEncoder(t,r);var o=n.write(e);var s=n.end();return s&&s.length>0?a.concat([o,s]):o};i.decode=function decode(e,t,r){if(typeof e==="string"){if(!i.skipDecodeWarning){console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");i.skipDecodeWarning=true}e=a.from(""+(e||""),"binary")}var n=i.getDecoder(t,r);var o=n.write(e);var s=n.end();return s?o+s:o};i.encodingExists=function encodingExists(e){try{i.getCodec(e);return true}catch(e){return false}};i.toEncoding=i.encode;i.fromEncoding=i.decode;i._codecDataCache={};i.getCodec=function getCodec(e){if(!i.encodings)i.encodings=r(5204);var t=i._canonicalizeEncoding(e);var a={};while(true){var n=i._codecDataCache[t];if(n)return n;var o=i.encodings[t];switch(typeof o){case"string":t=o;break;case"object":for(var s in o)a[s]=o[s];if(!a.encodingName)a.encodingName=t;t=o.type;break;case"function":if(!a.encodingName)a.encodingName=t;n=new o(a,i);i._codecDataCache[a.encodingName]=n;return n;default:throw new Error("Encoding not recognized: '"+e+"' (searched as: '"+t+"')")}}};i._canonicalizeEncoding=function(e){return(""+e).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g,"")};i.getEncoder=function getEncoder(e,t){var r=i.getCodec(e),a=new r.encoder(t,r);if(r.bomAware&&t&&t.addBOM)a=new n.PrependBOM(a,t);return a};i.getDecoder=function getDecoder(e,t){var r=i.getCodec(e),a=new r.decoder(t,r);if(r.bomAware&&!(t&&t.stripBOM===false))a=new n.StripBOM(a,t);return a};i.enableStreamingAPI=function enableStreamingAPI(e){if(i.supportsStreams)return;var t=r(7145)(e);i.IconvLiteEncoderStream=t.IconvLiteEncoderStream;i.IconvLiteDecoderStream=t.IconvLiteDecoderStream;i.encodeStream=function encodeStream(e,t){return new i.IconvLiteEncoderStream(i.getEncoder(e,t),t)};i.decodeStream=function decodeStream(e,t){return new i.IconvLiteDecoderStream(i.getDecoder(e,t),t)};i.supportsStreams=true};var o;try{o=r(2781)}catch(e){}if(o&&o.Transform){i.enableStreamingAPI(o)}else{i.encodeStream=i.decodeStream=function(){throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.")}}if(false){}},7145:(e,t,r)=>{"use strict";var a=r(4526).Buffer;e.exports=function(e){var t=e.Transform;function IconvLiteEncoderStream(e,r){this.conv=e;r=r||{};r.decodeStrings=false;t.call(this,r)}IconvLiteEncoderStream.prototype=Object.create(t.prototype,{constructor:{value:IconvLiteEncoderStream}});IconvLiteEncoderStream.prototype._transform=function(e,t,r){if(typeof e!="string")return r(new Error("Iconv encoding stream needs strings as its input."));try{var a=this.conv.write(e);if(a&&a.length)this.push(a);r()}catch(e){r(e)}};IconvLiteEncoderStream.prototype._flush=function(e){try{var t=this.conv.end();if(t&&t.length)this.push(t);e()}catch(t){e(t)}};IconvLiteEncoderStream.prototype.collect=function(e){var t=[];this.on("error",e);this.on("data",(function(e){t.push(e)}));this.on("end",(function(){e(null,a.concat(t))}));return this};function IconvLiteDecoderStream(e,r){this.conv=e;r=r||{};r.encoding=this.encoding="utf8";t.call(this,r)}IconvLiteDecoderStream.prototype=Object.create(t.prototype,{constructor:{value:IconvLiteDecoderStream}});IconvLiteDecoderStream.prototype._transform=function(e,t,r){if(!a.isBuffer(e)&&!(e instanceof Uint8Array))return r(new Error("Iconv decoding stream needs buffers as its input."));try{var n=this.conv.write(e);if(n&&n.length)this.push(n,this.encoding);r()}catch(e){r(e)}};IconvLiteDecoderStream.prototype._flush=function(e){try{var t=this.conv.end();if(t&&t.length)this.push(t,this.encoding);e()}catch(t){e(t)}};IconvLiteDecoderStream.prototype.collect=function(e){var t="";this.on("error",e);this.on("data",(function(e){t+=e}));this.on("end",(function(){e(null,t)}));return this};return{IconvLiteEncoderStream:IconvLiteEncoderStream,IconvLiteDecoderStream:IconvLiteDecoderStream}}},9008:(e,t,r)=>{"use strict";var a=r(7104),n=r(1974),i=r(3354),o=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,p=Math.abs,l=Math.floor;e.exports=function(e){var t,r,d,c;if(!a(e))return o.apply(this,arguments);r=n(i(this).length);d=arguments[1];if(isNaN(d))d=0;else if(d>=0)d=l(d);else d=n(this.length)-l(p(d));for(t=d;t<r;++t){if(s.call(this,t)){c=this[t];if(a(c))return t}}return-1}},5160:(e,t,r)=>{"use strict";e.exports=r(5134)()?Array.from:r(1871)},5134:e=>{"use strict";e.exports=function(){var e=Array.from,t,r;if(typeof e!=="function")return false;t=["raz","dwa"];r=e(t);return Boolean(r&&r!==t&&r[1]==="dwa")}},1871:(e,t,r)=>{"use strict";var a=r(3005).iterator,n=r(8717),i=r(3053),o=r(1974),s=r(1715),p=r(3354),l=r(5269),d=r(4855),c=Array.isArray,u=Function.prototype.call,f={configurable:true,enumerable:true,writable:true,value:null},m=Object.defineProperty;e.exports=function(e){var t=arguments[1],r=arguments[2],h,v,y,b,g,w,_,S,O,A;e=Object(p(e));if(l(t))s(t);if(!this||this===Array||!i(this)){if(!t){if(n(e)){g=e.length;if(g!==1)return Array.apply(null,e);b=new Array(1);b[0]=e[0];return b}if(c(e)){b=new Array(g=e.length);for(v=0;v<g;++v)b[v]=e[v];return b}}b=[]}else{h=this}if(!c(e)){if((O=e[a])!==undefined){_=s(O).call(e);if(h)b=new h;S=_.next();v=0;while(!S.done){A=t?u.call(t,r,S.value,v):S.value;if(h){f.value=A;m(b,v,f)}else{b[v]=A}S=_.next();++v}g=v}else if(d(e)){g=e.length;if(h)b=new h;for(v=0,y=0;v<g;++v){A=e[v];if(v+1<g){w=A.charCodeAt(0);if(w>=55296&&w<=56319)A+=e[++v]}A=t?u.call(t,r,A,y):A;if(h){f.value=A;m(b,y,f)}else{b[y]=A}++y}g=y}}if(g===undefined){g=o(e.length);if(h)b=new h(g);for(v=0;v<g;++v){A=t?u.call(t,r,e[v],v):e[v];if(h){f.value=A;m(b,v,f)}else{b[v]=A}}}if(h){f.value=null;b.length=g}return b}},1800:(e,t,r)=>{"use strict";var a=r(5160),n=Array.isArray;e.exports=function(e){return n(e)?e:a(e)}},3499:(e,t,r)=>{"use strict";var a=r(6277),n=r(7938),i=r(5269),o=Error.captureStackTrace;e.exports=function(t){var r=new Error(t),s=arguments[1],p=arguments[2];if(!i(p)){if(n(s)){p=s;s=null}}if(i(p))a(r,p);if(i(s))r.code=s;if(o)o(r,e.exports);return r}},1516:(e,t,r)=>{"use strict";var a=r(1974);var test=function(e,t){return t};var n,i,o,s;try{Object.defineProperty(test,"length",{configurable:true,writable:false,enumerable:false,value:1})}catch(e){}if(test.length===1){n={configurable:true,writable:false,enumerable:false};i=Object.defineProperty;e.exports=function(e,t){t=a(t);if(e.length===t)return e;n.value=t;return i(e,"length",n)}}else{s=r(648);o=function(){var e=[];return function(t){var r,a=0;if(e[t])return e[t];r=[];while(t--)r.push("a"+(++a).toString(36));return new Function("fn","return function ("+r.join(", ")+") { return fn.apply(this, arguments); };")}}();e.exports=function(e,t){var r;t=a(t);if(e.length===t)return e;r=o(t)(e);try{s(r,e)}catch(e){}return r}}},8717:e=>{"use strict";var t=Object.prototype.toString,r=t.call(function(){return arguments}());e.exports=function(e){return t.call(e)===r}},3053:e=>{"use strict";var t=Object.prototype.toString,r=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(e){return typeof e==="function"&&r(t.call(e))}},5049:e=>{"use strict";e.exports=function(){}},4724:(e,t,r)=>{"use strict";e.exports=r(2174)()?Math.sign:r(4845)},2174:e=>{"use strict";e.exports=function(){var e=Math.sign;if(typeof e!=="function")return false;return e(10)===1&&e(-20)===-1}},4845:e=>{"use strict";e.exports=function(e){e=Number(e);if(isNaN(e)||e===0)return e;return e>0?1:-1}},7104:(e,t,r)=>{"use strict";e.exports=r(2041)()?Number.isNaN:r(8104)},2041:e=>{"use strict";e.exports=function(){var e=Number.isNaN;if(typeof e!=="function")return false;return!e({})&&e(NaN)&&!e(34)}},8104:e=>{"use strict";e.exports=function(e){return e!==e}},5867:(e,t,r)=>{"use strict";var a=r(4724),n=Math.abs,i=Math.floor;e.exports=function(e){if(isNaN(e))return 0;e=Number(e);if(e===0||!isFinite(e))return e;return a(e)*i(n(e))}},1974:(e,t,r)=>{"use strict";var a=r(5867),n=Math.max;e.exports=function(e){return n(0,a(e))}},4320:(e,t,r)=>{"use strict";var a=r(1715),n=r(3354),i=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,p=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(r,l){var d,c=arguments[2],u=arguments[3];r=Object(n(r));a(l);d=s(r);if(u){d.sort(typeof u==="function"?i.call(u,r):undefined)}if(typeof e!=="function")e=d[e];return o.call(e,d,(function(e,a){if(!p.call(r,e))return t;return o.call(l,c,r[e],e,r,a)}))}}},6277:(e,t,r)=>{"use strict";e.exports=r(1982)()?Object.assign:r(6330)},1982:e=>{"use strict";e.exports=function(){var e=Object.assign,t;if(typeof e!=="function")return false;t={foo:"raz"};e(t,{bar:"dwa"},{trzy:"trzy"});return t.foo+t.bar+t.trzy==="razdwatrzy"}},6330:(e,t,r)=>{"use strict";var a=r(7349),n=r(3354),i=Math.max;e.exports=function(e,t){var r,o,s=i(arguments.length,2),p;e=Object(n(e));p=function(a){try{e[a]=t[a]}catch(e){if(!r)r=e}};for(o=1;o<s;++o){t=arguments[o];a(t).forEach(p)}if(r!==undefined)throw r;return e}},3676:(e,t,r)=>{"use strict";e.exports=r(4320)("forEach")},5052:e=>{"use strict";e.exports=function(e){return typeof e==="function"}},7938:(e,t,r)=>{"use strict";var a=r(5269);var n={function:true,object:true};e.exports=function(e){return a(e)&&n[typeof e]||false}},5269:(e,t,r)=>{"use strict";var a=r(5049)();e.exports=function(e){return e!==a&&e!==null}},7349:(e,t,r)=>{"use strict";e.exports=r(186)()?Object.keys:r(4318)},186:e=>{"use strict";e.exports=function(){try{Object.keys("primitive");return true}catch(e){return false}}},4318:(e,t,r)=>{"use strict";var a=r(5269);var n=Object.keys;e.exports=function(e){return n(a(e)?Object(e):e)}},8904:(e,t,r)=>{"use strict";var a=r(1715),n=r(3676),i=Function.prototype.call;e.exports=function(e,t){var r={},o=arguments[2];a(t);n(e,(function(e,a,n,s){r[a]=i.call(t,o,e,a,n,s)}));return r}},648:(e,t,r)=>{"use strict";var a=r(3354),n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;e.exports=function(e,t){var r,p=Object(a(t));e=Object(a(e));o(p).forEach((function(a){try{n(e,a,i(t,a))}catch(e){r=e}}));if(typeof s==="function"){s(p).forEach((function(a){try{n(e,a,i(t,a))}catch(e){r=e}}))}if(r!==undefined)throw r;return e}},9325:(e,t,r)=>{"use strict";var a=r(5269);var n=Array.prototype.forEach,i=Object.create;var process=function(e,t){var r;for(r in e)t[r]=e[r]};e.exports=function(e){var t=i(null);n.call(arguments,(function(e){if(!a(e))return;process(Object(e),t)}));return t}},3786:e=>{"use strict";var t=Array.prototype.forEach,r=Object.create;e.exports=function(e){var a=r(null);t.call(arguments,(function(e){a[e]=true}));return a}},1715:e=>{"use strict";e.exports=function(e){if(typeof e!=="function")throw new TypeError(e+" is not a function");return e}},3354:(e,t,r)=>{"use strict";var a=r(5269);e.exports=function(e){if(!a(e))throw new TypeError("Cannot use null or undefined");return e}},9386:(e,t,r)=>{"use strict";var a=r(3354),n=r(8421);e.exports=function(e){return n(a(e))}},8421:(e,t,r)=>{"use strict";var a=r(5052);e.exports=function(e){try{if(e&&a(e.toString))return e.toString();return String(e)}catch(e){throw new TypeError("Passed argument cannot be stringifed")}}},9381:(e,t,r)=>{"use strict";var a=r(5052);e.exports=function(e){try{if(e&&a(e.toString))return e.toString();return String(e)}catch(e){return"<Non-coercible to string value>"}}},2560:(e,t,r)=>{"use strict";e.exports=r(2262)()?String.prototype.contains:r(2298)},2262:e=>{"use strict";var t="razdwatrzy";e.exports=function(){if(typeof t.contains!=="function")return false;return t.contains("dwa")===true&&t.contains("foo")===false}},2298:e=>{"use strict";var t=String.prototype.indexOf;e.exports=function(e){return t.call(this,e,arguments[1])>-1}},4855:e=>{"use strict";var t=Object.prototype.toString,r=t.call("");e.exports=function(e){return typeof e==="string"||e&&typeof e==="object"&&(e instanceof String||t.call(e)===r)||false}},7354:(e,t,r)=>{"use strict";var a=r(9381);var n=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=a(e);if(t.length>100)t=t.slice(0,99)+"…";t=t.replace(n,(function(e){return JSON.stringify(e).slice(1,-1)}));return t}},3005:(e,t,r)=>{"use strict";e.exports=r(1662)()?r(7538).Symbol:r(5874)},1662:(e,t,r)=>{"use strict";var a=r(7538),n={object:true,symbol:true};e.exports=function(){var e=a.Symbol;var t;if(typeof e!=="function")return false;t=e("test symbol");try{String(t)}catch(e){return false}if(!n[typeof e.iterator])return false;if(!n[typeof e.toPrimitive])return false;if(!n[typeof e.toStringTag])return false;return true}},4550:e=>{"use strict";e.exports=function(e){if(!e)return false;if(typeof e==="symbol")return true;if(!e.constructor)return false;if(e.constructor.name!=="Symbol")return false;return e[e.constructor.toStringTag]==="Symbol"}},6280:(e,t,r)=>{"use strict";var a=r(5509);var n=Object.create,i=Object.defineProperty,o=Object.prototype;var s=n(null);e.exports=function(e){var t=0,r,n;while(s[e+(t||"")])++t;e+=t||"";s[e]=true;r="@@"+e;i(o,r,a.gs(null,(function(e){if(n)return;n=true;i(this,r,a(e));n=false})));return r}},5979:(e,t,r)=>{"use strict";var a=r(5509),n=r(7538).Symbol;e.exports=function(e){return Object.defineProperties(e,{hasInstance:a("",n&&n.hasInstance||e("hasInstance")),isConcatSpreadable:a("",n&&n.isConcatSpreadable||e("isConcatSpreadable")),iterator:a("",n&&n.iterator||e("iterator")),match:a("",n&&n.match||e("match")),replace:a("",n&&n.replace||e("replace")),search:a("",n&&n.search||e("search")),species:a("",n&&n.species||e("species")),split:a("",n&&n.split||e("split")),toPrimitive:a("",n&&n.toPrimitive||e("toPrimitive")),toStringTag:a("",n&&n.toStringTag||e("toStringTag")),unscopables:a("",n&&n.unscopables||e("unscopables"))})}},3162:(e,t,r)=>{"use strict";var a=r(5509),n=r(31);var i=Object.create(null);e.exports=function(e){return Object.defineProperties(e,{for:a((function(t){if(i[t])return i[t];return i[t]=e(String(t))})),keyFor:a((function(e){var t;n(e);for(t in i){if(i[t]===e)return t}return undefined}))})}},5874:(e,t,r)=>{"use strict";var a=r(5509),n=r(31),i=r(7538).Symbol,o=r(6280),s=r(5979),p=r(3162);var l=Object.create,d=Object.defineProperties,c=Object.defineProperty;var u,f,m;if(typeof i==="function"){try{String(i());m=true}catch(e){}}else{i=null}f=function Symbol(e){if(this instanceof f)throw new TypeError("Symbol is not a constructor");return u(e)};e.exports=u=function Symbol(e){var t;if(this instanceof Symbol)throw new TypeError("Symbol is not a constructor");if(m)return i(e);t=l(f.prototype);e=e===undefined?"":String(e);return d(t,{__description__:a("",e),__name__:a("",o(e))})};s(u);p(u);d(f.prototype,{constructor:a(u),toString:a("",(function(){return this.__name__}))});d(u.prototype,{toString:a((function(){return"Symbol ("+n(this).__description__+")"})),valueOf:a((function(){return n(this)}))});c(u.prototype,u.toPrimitive,a("",(function(){var e=n(this);if(typeof e==="symbol")return e;return e.toString()})));c(u.prototype,u.toStringTag,a("c","Symbol"));c(f.prototype,u.toStringTag,a("c",u.prototype[u.toStringTag]));c(f.prototype,u.toPrimitive,a("c",u.prototype[u.toPrimitive]))},31:(e,t,r)=>{"use strict";var a=r(4550);e.exports=function(e){if(!a(e))throw new TypeError(e+" is not a symbol");return e}},8574:(e,t,r)=>{"use strict";var a=r(5509),n=r(1715),i=Function.prototype.apply,o=Function.prototype.call,s=Object.create,p=Object.defineProperty,l=Object.defineProperties,d=Object.prototype.hasOwnProperty,c={configurable:true,enumerable:false,writable:true},u,f,m,h,v,y,b;u=function(e,t){var r;n(t);if(!d.call(this,"__ee__")){r=c.value=s(null);p(this,"__ee__",c);c.value=null}else{r=this.__ee__}if(!r[e])r[e]=t;else if(typeof r[e]==="object")r[e].push(t);else r[e]=[r[e],t];return this};f=function(e,t){var r,a;n(t);a=this;u.call(this,e,r=function(){m.call(a,e,r);i.call(t,this,arguments)});r.__eeOnceListener__=t;return this};m=function(e,t){var r,a,i,o;n(t);if(!d.call(this,"__ee__"))return this;r=this.__ee__;if(!r[e])return this;a=r[e];if(typeof a==="object"){for(o=0;i=a[o];++o){if(i===t||i.__eeOnceListener__===t){if(a.length===2)r[e]=a[o?0:1];else a.splice(o,1)}}}else{if(a===t||a.__eeOnceListener__===t){delete r[e]}}return this};h=function(e){var t,r,a,n,s;if(!d.call(this,"__ee__"))return;n=this.__ee__[e];if(!n)return;if(typeof n==="object"){r=arguments.length;s=new Array(r-1);for(t=1;t<r;++t)s[t-1]=arguments[t];n=n.slice();for(t=0;a=n[t];++t){i.call(a,this,s)}}else{switch(arguments.length){case 1:o.call(n,this);break;case 2:o.call(n,this,arguments[1]);break;case 3:o.call(n,this,arguments[1],arguments[2]);break;default:r=arguments.length;s=new Array(r-1);for(t=1;t<r;++t){s[t-1]=arguments[t]}i.call(n,this,s)}}};v={on:u,once:f,off:m,emit:h};y={on:a(u),once:a(f),off:a(m),emit:a(h)};b=l({},y);e.exports=t=function(e){return e==null?s(b):l(Object(e),y)};t.methods=v},2232:e=>{var naiveFallback=function(){if(typeof self==="object"&&self)return self;if(typeof window==="object"&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:true})}catch(e){return naiveFallback()}try{if(!__global__)return naiveFallback();return __global__}finally{delete Object.prototype.__global__}}()},7538:(e,t,r)=>{"use strict";e.exports=r(6927)()?globalThis:r(2232)},6927:e=>{"use strict";e.exports=function(){if(typeof globalThis!=="object")return false;if(!globalThis)return false;return globalThis.Array===Array}},4216:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(1470).mkdirsSync;const o=r(1767).utimesMillisSync;const s=Symbol("notExist");function copySync(e,t,r){if(typeof r==="function"){r={filter:r}}r=r||{};r.clobber="clobber"in r?!!r.clobber:true;r.overwrite="overwrite"in r?!!r.overwrite:r.clobber;if(r.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}const o=checkPaths(e,t);if(r.filter&&!r.filter(e,t))return;const s=n.dirname(t);if(!a.existsSync(s))i(s);return startCopy(o,e,t,r)}function startCopy(e,t,r,a){if(a.filter&&!a.filter(t,r))return;return getStats(e,t,r,a)}function getStats(e,t,r,n){const i=n.dereference?a.statSync:a.lstatSync;const o=i(t);if(o.isDirectory())return onDir(o,e,t,r,n);else if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return onFile(o,e,t,r,n);else if(o.isSymbolicLink())return onLink(e,t,r,n)}function onFile(e,t,r,a,n){if(t===s)return copyFile(e,r,a,n);return mayCopyFile(e,r,a,n)}function mayCopyFile(e,t,r,n){if(n.overwrite){a.unlinkSync(r);return copyFile(e,t,r,n)}else if(n.errorOnExist){throw new Error(`'${r}' already exists`)}}function copyFile(e,t,r,n){if(typeof a.copyFileSync==="function"){a.copyFileSync(t,r);a.chmodSync(r,e.mode);if(n.preserveTimestamps){return o(r,e.atime,e.mtime)}return}return copyFileFallback(e,t,r,n)}function copyFileFallback(e,t,n,i){const o=64*1024;const s=r(5679)(o);const p=a.openSync(t,"r");const l=a.openSync(n,"w",e.mode);let d=0;while(d<e.size){const e=a.readSync(p,s,0,o,d);a.writeSync(l,s,0,e);d+=e}if(i.preserveTimestamps)a.futimesSync(l,e.atime,e.mtime);a.closeSync(p);a.closeSync(l)}function onDir(e,t,r,a,n){if(t===s)return mkDirAndCopy(e,r,a,n);if(t&&!t.isDirectory()){throw new Error(`Cannot overwrite non-directory '${a}' with directory '${r}'.`)}return copyDir(r,a,n)}function mkDirAndCopy(e,t,r,n){a.mkdirSync(r);copyDir(t,r,n);return a.chmodSync(r,e.mode)}function copyDir(e,t,r){a.readdirSync(e).forEach((a=>copyDirItem(a,e,t,r)))}function copyDirItem(e,t,r,a){const i=n.join(t,e);const o=n.join(r,e);const s=checkPaths(i,o);return startCopy(s,i,o,a)}function onLink(e,t,r,i){let o=a.readlinkSync(t);if(i.dereference){o=n.resolve(process.cwd(),o)}if(e===s){return a.symlinkSync(o,r)}else{let e;try{e=a.readlinkSync(r)}catch(e){if(e.code==="EINVAL"||e.code==="UNKNOWN")return a.symlinkSync(o,r);throw e}if(i.dereference){e=n.resolve(process.cwd(),e)}if(isSrcSubdir(o,e)){throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${e}'.`)}if(a.statSync(r).isDirectory()&&isSrcSubdir(e,o)){throw new Error(`Cannot overwrite '${e}' with '${o}'.`)}return copyLink(o,r)}}function copyLink(e,t){a.unlinkSync(t);return a.symlinkSync(e,t)}function isSrcSubdir(e,t){const r=n.resolve(e).split(n.sep);const a=n.resolve(t).split(n.sep);return r.reduce(((e,t,r)=>e&&a[r]===t),true)}function checkStats(e,t){const r=a.statSync(e);let n;try{n=a.statSync(t)}catch(e){if(e.code==="ENOENT")return{srcStat:r,destStat:s};throw e}return{srcStat:r,destStat:n}}function checkPaths(e,t){const{srcStat:r,destStat:a}=checkStats(e,t);if(a.ino&&a.ino===r.ino){throw new Error("Source and destination must not be the same.")}if(r.isDirectory()&&isSrcSubdir(e,t)){throw new Error(`Cannot copy '${e}' to a subdirectory of itself, '${t}'.`)}return a}e.exports=copySync},582:(e,t,r)=>{"use strict";e.exports={copySync:r(4216)}},8400:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(1470).mkdirs;const o=r(1382).pathExists;const s=r(1767).utimesMillis;const p=Symbol("notExist");function copy(e,t,r,a){if(typeof r==="function"&&!a){a=r;r={}}else if(typeof r==="function"){r={filter:r}}a=a||function(){};r=r||{};r.clobber="clobber"in r?!!r.clobber:true;r.overwrite="overwrite"in r?!!r.overwrite:r.clobber;if(r.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}checkPaths(e,t,((n,i)=>{if(n)return a(n);if(r.filter)return handleFilter(checkParentDir,i,e,t,r,a);return checkParentDir(i,e,t,r,a)}))}function checkParentDir(e,t,r,a,s){const p=n.dirname(r);o(p,((n,o)=>{if(n)return s(n);if(o)return startCopy(e,t,r,a,s);i(p,(n=>{if(n)return s(n);return startCopy(e,t,r,a,s)}))}))}function handleFilter(e,t,r,a,n,i){Promise.resolve(n.filter(r,a)).then((o=>{if(o){if(t)return e(t,r,a,n,i);return e(r,a,n,i)}return i()}),(e=>i(e)))}function startCopy(e,t,r,a,n){if(a.filter)return handleFilter(getStats,e,t,r,a,n);return getStats(e,t,r,a,n)}function getStats(e,t,r,n,i){const o=n.dereference?a.stat:a.lstat;o(t,((a,o)=>{if(a)return i(a);if(o.isDirectory())return onDir(o,e,t,r,n,i);else if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return onFile(o,e,t,r,n,i);else if(o.isSymbolicLink())return onLink(e,t,r,n,i)}))}function onFile(e,t,r,a,n,i){if(t===p)return copyFile(e,r,a,n,i);return mayCopyFile(e,r,a,n,i)}function mayCopyFile(e,t,r,n,i){if(n.overwrite){a.unlink(r,(a=>{if(a)return i(a);return copyFile(e,t,r,n,i)}))}else if(n.errorOnExist){return i(new Error(`'${r}' already exists`))}else return i()}function copyFile(e,t,r,n,i){if(typeof a.copyFile==="function"){return a.copyFile(t,r,(t=>{if(t)return i(t);return setDestModeAndTimestamps(e,r,n,i)}))}return copyFileFallback(e,t,r,n,i)}function copyFileFallback(e,t,r,n,i){const o=a.createReadStream(t);o.on("error",(e=>i(e))).once("open",(()=>{const t=a.createWriteStream(r,{mode:e.mode});t.on("error",(e=>i(e))).on("open",(()=>o.pipe(t))).once("close",(()=>setDestModeAndTimestamps(e,r,n,i)))}))}function setDestModeAndTimestamps(e,t,r,n){a.chmod(t,e.mode,(a=>{if(a)return n(a);if(r.preserveTimestamps){return s(t,e.atime,e.mtime,n)}return n()}))}function onDir(e,t,r,a,n,i){if(t===p)return mkDirAndCopy(e,r,a,n,i);if(t&&!t.isDirectory()){return i(new Error(`Cannot overwrite non-directory '${a}' with directory '${r}'.`))}return copyDir(r,a,n,i)}function mkDirAndCopy(e,t,r,n,i){a.mkdir(r,(o=>{if(o)return i(o);copyDir(t,r,n,(t=>{if(t)return i(t);return a.chmod(r,e.mode,i)}))}))}function copyDir(e,t,r,n){a.readdir(e,((a,i)=>{if(a)return n(a);return copyDirItems(i,e,t,r,n)}))}function copyDirItems(e,t,r,a,n){const i=e.pop();if(!i)return n();return copyDirItem(e,i,t,r,a,n)}function copyDirItem(e,t,r,a,i,o){const s=n.join(r,t);const p=n.join(a,t);checkPaths(s,p,((t,n)=>{if(t)return o(t);startCopy(n,s,p,i,(t=>{if(t)return o(t);return copyDirItems(e,r,a,i,o)}))}))}function onLink(e,t,r,i,o){a.readlink(t,((t,s)=>{if(t)return o(t);if(i.dereference){s=n.resolve(process.cwd(),s)}if(e===p){return a.symlink(s,r,o)}else{a.readlink(r,((t,p)=>{if(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return a.symlink(s,r,o);return o(t)}if(i.dereference){p=n.resolve(process.cwd(),p)}if(isSrcSubdir(s,p)){return o(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${p}'.`))}if(e.isDirectory()&&isSrcSubdir(p,s)){return o(new Error(`Cannot overwrite '${p}' with '${s}'.`))}return copyLink(s,r,o)}))}}))}function copyLink(e,t,r){a.unlink(t,(n=>{if(n)return r(n);return a.symlink(e,t,r)}))}function isSrcSubdir(e,t){const r=n.resolve(e).split(n.sep);const a=n.resolve(t).split(n.sep);return r.reduce(((e,t,r)=>e&&a[r]===t),true)}function checkStats(e,t,r){a.stat(e,((e,n)=>{if(e)return r(e);a.stat(t,((e,t)=>{if(e){if(e.code==="ENOENT")return r(null,{srcStat:n,destStat:p});return r(e)}return r(null,{srcStat:n,destStat:t})}))}))}function checkPaths(e,t,r){checkStats(e,t,((a,n)=>{if(a)return r(a);const{srcStat:i,destStat:o}=n;if(o.ino&&o.ino===i.ino){return r(new Error("Source and destination must not be the same."))}if(i.isDirectory()&&isSrcSubdir(e,t)){return r(new Error(`Cannot copy '${e}' to a subdirectory of itself, '${t}'.`))}return r(null,o)}))}e.exports=copy},6082:(e,t,r)=>{"use strict";const a=r(9676).E;e.exports={copy:a(r(8400))}},4264:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(7147);const i=r(1017);const o=r(1470);const s=r(5951);const p=a((function emptyDir(e,t){t=t||function(){};n.readdir(e,((r,a)=>{if(r)return o.mkdirs(e,t);a=a.map((t=>i.join(e,t)));deleteItem();function deleteItem(){const e=a.pop();if(!e)return t();s.remove(e,(e=>{if(e)return t(e);deleteItem()}))}}))}));function emptyDirSync(e){let t;try{t=n.readdirSync(e)}catch(t){return o.mkdirsSync(e)}t.forEach((t=>{t=i.join(e,t);s.removeSync(t)}))}e.exports={emptyDirSync:emptyDirSync,emptydirSync:emptyDirSync,emptyDir:p,emptydir:p}},6495:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(1017);const i=r(7905);const o=r(1470);const s=r(1382).pathExists;function createFile(e,t){function makeFile(){i.writeFile(e,"",(e=>{if(e)return t(e);t()}))}i.stat(e,((r,a)=>{if(!r&&a.isFile())return t();const i=n.dirname(e);s(i,((e,r)=>{if(e)return t(e);if(r)return makeFile();o.mkdirs(i,(e=>{if(e)return t(e);makeFile()}))}))}))}function createFileSync(e){let t;try{t=i.statSync(e)}catch(e){}if(t&&t.isFile())return;const r=n.dirname(e);if(!i.existsSync(r)){o.mkdirsSync(r)}i.writeFileSync(e,"")}e.exports={createFile:a(createFile),createFileSync:createFileSync}},3483:(e,t,r)=>{"use strict";const a=r(6495);const n=r(4802);const i=r(639);e.exports={createFile:a.createFile,createFileSync:a.createFileSync,ensureFile:a.createFile,ensureFileSync:a.createFileSync,createLink:n.createLink,createLinkSync:n.createLinkSync,ensureLink:n.createLink,ensureLinkSync:n.createLinkSync,createSymlink:i.createSymlink,createSymlinkSync:i.createSymlinkSync,ensureSymlink:i.createSymlink,ensureSymlinkSync:i.createSymlinkSync}},4802:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(1017);const i=r(7905);const o=r(1470);const s=r(1382).pathExists;function createLink(e,t,r){function makeLink(e,t){i.link(e,t,(e=>{if(e)return r(e);r(null)}))}s(t,((a,p)=>{if(a)return r(a);if(p)return r(null);i.lstat(e,(a=>{if(a){a.message=a.message.replace("lstat","ensureLink");return r(a)}const i=n.dirname(t);s(i,((a,n)=>{if(a)return r(a);if(n)return makeLink(e,t);o.mkdirs(i,(a=>{if(a)return r(a);makeLink(e,t)}))}))}))}))}function createLinkSync(e,t){const r=i.existsSync(t);if(r)return undefined;try{i.lstatSync(e)}catch(e){e.message=e.message.replace("lstat","ensureLink");throw e}const a=n.dirname(t);const s=i.existsSync(a);if(s)return i.linkSync(e,t);o.mkdirsSync(a);return i.linkSync(e,t)}e.exports={createLink:a(createLink),createLinkSync:createLinkSync}},8118:(e,t,r)=>{"use strict";const a=r(1017);const n=r(7905);const i=r(1382).pathExists;function symlinkPaths(e,t,r){if(a.isAbsolute(e)){return n.lstat(e,(t=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return r(t)}return r(null,{toCwd:e,toDst:e})}))}else{const o=a.dirname(t);const s=a.join(o,e);return i(s,((t,i)=>{if(t)return r(t);if(i){return r(null,{toCwd:s,toDst:e})}else{return n.lstat(e,(t=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return r(t)}return r(null,{toCwd:e,toDst:a.relative(o,e)})}))}}))}}function symlinkPathsSync(e,t){let r;if(a.isAbsolute(e)){r=n.existsSync(e);if(!r)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}else{const i=a.dirname(t);const o=a.join(i,e);r=n.existsSync(o);if(r){return{toCwd:o,toDst:e}}else{r=n.existsSync(e);if(!r)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:a.relative(i,e)}}}}e.exports={symlinkPaths:symlinkPaths,symlinkPathsSync:symlinkPathsSync}},5742:(e,t,r)=>{"use strict";const a=r(7905);function symlinkType(e,t,r){r=typeof t==="function"?t:r;t=typeof t==="function"?false:t;if(t)return r(null,t);a.lstat(e,((e,a)=>{if(e)return r(null,"file");t=a&&a.isDirectory()?"dir":"file";r(null,t)}))}function symlinkTypeSync(e,t){let r;if(t)return t;try{r=a.lstatSync(e)}catch(e){return"file"}return r&&r.isDirectory()?"dir":"file"}e.exports={symlinkType:symlinkType,symlinkTypeSync:symlinkTypeSync}},639:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(1017);const i=r(7905);const o=r(1470);const s=o.mkdirs;const p=o.mkdirsSync;const l=r(8118);const d=l.symlinkPaths;const c=l.symlinkPathsSync;const u=r(5742);const f=u.symlinkType;const m=u.symlinkTypeSync;const h=r(1382).pathExists;function createSymlink(e,t,r,a){a=typeof r==="function"?r:a;r=typeof r==="function"?false:r;h(t,((o,p)=>{if(o)return a(o);if(p)return a(null);d(e,t,((o,p)=>{if(o)return a(o);e=p.toDst;f(p.toCwd,r,((r,o)=>{if(r)return a(r);const p=n.dirname(t);h(p,((r,n)=>{if(r)return a(r);if(n)return i.symlink(e,t,o,a);s(p,(r=>{if(r)return a(r);i.symlink(e,t,o,a)}))}))}))}))}))}function createSymlinkSync(e,t,r){const a=i.existsSync(t);if(a)return undefined;const o=c(e,t);e=o.toDst;r=m(o.toCwd,r);const s=n.dirname(t);const l=i.existsSync(s);if(l)return i.symlinkSync(e,t,r);p(s);return i.symlinkSync(e,t,r)}e.exports={createSymlink:a(createSymlink),createSymlinkSync:createSymlinkSync}},181:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(7905);const i=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>typeof n[e]==="function"));Object.keys(n).forEach((e=>{if(e==="promises"){return}t[e]=n[e]}));i.forEach((e=>{t[e]=a(n[e])}));t.exists=function(e,t){if(typeof t==="function"){return n.exists(e,t)}return new Promise((t=>n.exists(e,t)))};t.read=function(e,t,r,a,i,o){if(typeof o==="function"){return n.read(e,t,r,a,i,o)}return new Promise(((o,s)=>{n.read(e,t,r,a,i,((e,t,r)=>{if(e)return s(e);o({bytesRead:t,buffer:r})}))}))};t.write=function(e,t,...r){if(typeof r[r.length-1]==="function"){return n.write(e,t,...r)}return new Promise(((a,i)=>{n.write(e,t,...r,((e,t,r)=>{if(e)return i(e);a({bytesWritten:t,buffer:r})}))}))}},5501:(e,t,r)=>{"use strict";e.exports=Object.assign({},r(181),r(582),r(6082),r(4264),r(3483),r(6797),r(1470),r(2599),r(6271),r(6981),r(1382),r(5951));const a=r(7147);if(Object.getOwnPropertyDescriptor(a,"promises")){Object.defineProperty(e.exports,"promises",{get(){return a.promises}})}},6797:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(5622);n.outputJson=a(r(6961));n.outputJsonSync=r(8300);n.outputJSON=n.outputJson;n.outputJSONSync=n.outputJsonSync;n.writeJSON=n.writeJson;n.writeJSONSync=n.writeJsonSync;n.readJSON=n.readJson;n.readJSONSync=n.readJsonSync;e.exports=n},5622:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(4920);e.exports={readJson:a(n.readFile),readJsonSync:n.readFileSync,writeJson:a(n.writeFile),writeJsonSync:n.writeFileSync}},8300:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(1470);const o=r(5622);function outputJsonSync(e,t,r){const s=n.dirname(e);if(!a.existsSync(s)){i.mkdirsSync(s)}o.writeJsonSync(e,t,r)}e.exports=outputJsonSync},6961:(e,t,r)=>{"use strict";const a=r(1017);const n=r(1470);const i=r(1382).pathExists;const o=r(5622);function outputJson(e,t,r,s){if(typeof r==="function"){s=r;r={}}const p=a.dirname(e);i(p,((a,i)=>{if(a)return s(a);if(i)return o.writeJson(e,t,r,s);n.mkdirs(p,(a=>{if(a)return s(a);o.writeJson(e,t,r,s)}))}))}e.exports=outputJson},1470:(e,t,r)=>{"use strict";const a=r(9676).E;const n=a(r(6156));const i=r(1776);e.exports={mkdirs:n,mkdirsSync:i,mkdirp:n,mkdirpSync:i,ensureDir:n,ensureDirSync:i}},1776:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(1929).invalidWin32Path;const o=parseInt("0777",8);function mkdirsSync(e,t,r){if(!t||typeof t!=="object"){t={mode:t}}let s=t.mode;const p=t.fs||a;if(process.platform==="win32"&&i(e)){const t=new Error(e+" contains invalid WIN32 path characters.");t.code="EINVAL";throw t}if(s===undefined){s=o&~process.umask()}if(!r)r=null;e=n.resolve(e);try{p.mkdirSync(e,s);r=r||e}catch(a){if(a.code==="ENOENT"){if(n.dirname(e)===e)throw a;r=mkdirsSync(n.dirname(e),t,r);mkdirsSync(e,t,r)}else{let t;try{t=p.statSync(e)}catch(e){throw a}if(!t.isDirectory())throw a}}return r}e.exports=mkdirsSync},6156:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(1929).invalidWin32Path;const o=parseInt("0777",8);function mkdirs(e,t,r,s){if(typeof t==="function"){r=t;t={}}else if(!t||typeof t!=="object"){t={mode:t}}if(process.platform==="win32"&&i(e)){const t=new Error(e+" contains invalid WIN32 path characters.");t.code="EINVAL";return r(t)}let p=t.mode;const l=t.fs||a;if(p===undefined){p=o&~process.umask()}if(!s)s=null;r=r||function(){};e=n.resolve(e);l.mkdir(e,p,(a=>{if(!a){s=s||e;return r(null,s)}switch(a.code){case"ENOENT":if(n.dirname(e)===e)return r(a);mkdirs(n.dirname(e),t,((a,n)=>{if(a)r(a,n);else mkdirs(e,t,r,n)}));break;default:l.stat(e,((e,t)=>{if(e||!t.isDirectory())r(a,s);else r(null,s)}));break}}))}e.exports=mkdirs},1929:(e,t,r)=>{"use strict";const a=r(1017);function getRootPath(e){e=a.normalize(a.resolve(e)).split(a.sep);if(e.length>0)return e[0];return null}const n=/[<>:"|?*]/;function invalidWin32Path(e){const t=getRootPath(e);e=e.replace(t,"");return n.test(e)}e.exports={getRootPath:getRootPath,invalidWin32Path:invalidWin32Path}},2599:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(582).copySync;const o=r(5951).removeSync;const s=r(1470).mkdirsSync;const p=r(5679);function moveSync(e,t,r){r=r||{};const i=r.overwrite||r.clobber||false;e=n.resolve(e);t=n.resolve(t);if(e===t)return a.accessSync(e);if(isSrcSubdir(e,t))throw new Error(`Cannot move '${e}' into itself '${t}'.`);s(n.dirname(t));tryRenameSync();function tryRenameSync(){if(i){try{return a.renameSync(e,t)}catch(a){if(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM"){o(t);r.overwrite=false;return moveSync(e,t,r)}if(a.code!=="EXDEV")throw a;return moveSyncAcrossDevice(e,t,i)}}else{try{a.linkSync(e,t);return a.unlinkSync(e)}catch(r){if(r.code==="EXDEV"||r.code==="EISDIR"||r.code==="EPERM"||r.code==="ENOTSUP"){return moveSyncAcrossDevice(e,t,i)}throw r}}}}function moveSyncAcrossDevice(e,t,r){const n=a.statSync(e);if(n.isDirectory()){return moveDirSyncAcrossDevice(e,t,r)}else{return moveFileSyncAcrossDevice(e,t,r)}}function moveFileSyncAcrossDevice(e,t,r){const n=64*1024;const i=p(n);const o=r?"w":"wx";const s=a.openSync(e,"r");const l=a.fstatSync(s);const d=a.openSync(t,o,l.mode);let c=0;while(c<l.size){const e=a.readSync(s,i,0,n,c);a.writeSync(d,i,0,e);c+=e}a.closeSync(s);a.closeSync(d);return a.unlinkSync(e)}function moveDirSyncAcrossDevice(e,t,r){const a={overwrite:false};if(r){o(t);tryCopySync()}else{tryCopySync()}function tryCopySync(){i(e,t,a);return o(e)}}function isSrcSubdir(e,t){try{return a.statSync(e).isDirectory()&&e!==t&&t.indexOf(e)>-1&&t.split(n.dirname(e)+n.sep)[1].split(n.sep)[0]===n.basename(e)}catch(e){return false}}e.exports={moveSync:moveSync}},6271:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(7905);const i=r(1017);const o=r(6082).copy;const s=r(5951).remove;const p=r(1470).mkdirp;const l=r(1382).pathExists;function move(e,t,r,a){if(typeof r==="function"){a=r;r={}}const o=r.overwrite||r.clobber||false;e=i.resolve(e);t=i.resolve(t);if(e===t)return n.access(e,a);n.stat(e,((r,n)=>{if(r)return a(r);if(n.isDirectory()&&isSrcSubdir(e,t)){return a(new Error(`Cannot move '${e}' to a subdirectory of itself, '${t}'.`))}p(i.dirname(t),(r=>{if(r)return a(r);return doRename(e,t,o,a)}))}))}function doRename(e,t,r,a){if(r){return s(t,(n=>{if(n)return a(n);return rename(e,t,r,a)}))}l(t,((n,i)=>{if(n)return a(n);if(i)return a(new Error("dest already exists."));return rename(e,t,r,a)}))}function rename(e,t,r,a){n.rename(e,t,(n=>{if(!n)return a();if(n.code!=="EXDEV")return a(n);return moveAcrossDevice(e,t,r,a)}))}function moveAcrossDevice(e,t,r,a){const n={overwrite:r,errorOnExist:true};o(e,t,n,(t=>{if(t)return a(t);return s(e,a)}))}function isSrcSubdir(e,t){const r=e.split(i.sep);const a=t.split(i.sep);return r.reduce(((e,t,r)=>e&&a[r]===t),true)}e.exports={move:a(move)}},6981:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(7905);const i=r(1017);const o=r(1470);const s=r(1382).pathExists;function outputFile(e,t,r,a){if(typeof r==="function"){a=r;r="utf8"}const p=i.dirname(e);s(p,((i,s)=>{if(i)return a(i);if(s)return n.writeFile(e,t,r,a);o.mkdirs(p,(i=>{if(i)return a(i);n.writeFile(e,t,r,a)}))}))}function outputFileSync(e,...t){const r=i.dirname(e);if(n.existsSync(r)){return n.writeFileSync(e,...t)}o.mkdirsSync(r);n.writeFileSync(e,...t)}e.exports={outputFile:a(outputFile),outputFileSync:outputFileSync}},1382:(e,t,r)=>{"use strict";const a=r(9676).p;const n=r(181);function pathExists(e){return n.access(e).then((()=>true)).catch((()=>false))}e.exports={pathExists:a(pathExists),pathExistsSync:n.existsSync}},5951:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(1170);e.exports={remove:a(n),removeSync:n.sync}},1170:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(9491);const o=process.platform==="win32";function defaults(e){const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((t=>{e[t]=e[t]||a[t];t=t+"Sync";e[t]=e[t]||a[t]}));e.maxBusyTries=e.maxBusyTries||3}function rimraf(e,t,r){let a=0;if(typeof t==="function"){r=t;t={}}i(e,"rimraf: missing path");i.strictEqual(typeof e,"string","rimraf: path should be a string");i.strictEqual(typeof r,"function","rimraf: callback function required");i(t,"rimraf: invalid options argument provided");i.strictEqual(typeof t,"object","rimraf: options should be object");defaults(t);rimraf_(e,t,(function CB(n){if(n){if((n.code==="EBUSY"||n.code==="ENOTEMPTY"||n.code==="EPERM")&&a<t.maxBusyTries){a++;const r=a*100;return setTimeout((()=>rimraf_(e,t,CB)),r)}if(n.code==="ENOENT")n=null}r(n)}))}function rimraf_(e,t,r){i(e);i(t);i(typeof r==="function");t.lstat(e,((a,n)=>{if(a&&a.code==="ENOENT"){return r(null)}if(a&&a.code==="EPERM"&&o){return fixWinEPERM(e,t,a,r)}if(n&&n.isDirectory()){return rmdir(e,t,a,r)}t.unlink(e,(a=>{if(a){if(a.code==="ENOENT"){return r(null)}if(a.code==="EPERM"){return o?fixWinEPERM(e,t,a,r):rmdir(e,t,a,r)}if(a.code==="EISDIR"){return rmdir(e,t,a,r)}}return r(a)}))}))}function fixWinEPERM(e,t,r,a){i(e);i(t);i(typeof a==="function");if(r){i(r instanceof Error)}t.chmod(e,438,(n=>{if(n){a(n.code==="ENOENT"?null:r)}else{t.stat(e,((n,i)=>{if(n){a(n.code==="ENOENT"?null:r)}else if(i.isDirectory()){rmdir(e,t,r,a)}else{t.unlink(e,a)}}))}}))}function fixWinEPERMSync(e,t,r){let a;i(e);i(t);if(r){i(r instanceof Error)}try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT"){return}else{throw r}}try{a=t.statSync(e)}catch(e){if(e.code==="ENOENT"){return}else{throw r}}if(a.isDirectory()){rmdirSync(e,t,r)}else{t.unlinkSync(e)}}function rmdir(e,t,r,a){i(e);i(t);if(r){i(r instanceof Error)}i(typeof a==="function");t.rmdir(e,(n=>{if(n&&(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")){rmkids(e,t,a)}else if(n&&n.code==="ENOTDIR"){a(r)}else{a(n)}}))}function rmkids(e,t,r){i(e);i(t);i(typeof r==="function");t.readdir(e,((a,i)=>{if(a)return r(a);let o=i.length;let s;if(o===0)return t.rmdir(e,r);i.forEach((a=>{rimraf(n.join(e,a),t,(a=>{if(s){return}if(a)return r(s=a);if(--o===0){t.rmdir(e,r)}}))}))}))}function rimrafSync(e,t){let r;t=t||{};defaults(t);i(e,"rimraf: missing path");i.strictEqual(typeof e,"string","rimraf: path should be a string");i(t,"rimraf: missing options");i.strictEqual(typeof t,"object","rimraf: options should be object");try{r=t.lstatSync(e)}catch(r){if(r.code==="ENOENT"){return}if(r.code==="EPERM"&&o){fixWinEPERMSync(e,t,r)}}try{if(r&&r.isDirectory()){rmdirSync(e,t,null)}else{t.unlinkSync(e)}}catch(r){if(r.code==="ENOENT"){return}else if(r.code==="EPERM"){return o?fixWinEPERMSync(e,t,r):rmdirSync(e,t,r)}else if(r.code!=="EISDIR"){throw r}rmdirSync(e,t,r)}}function rmdirSync(e,t,r){i(e);i(t);if(r){i(r instanceof Error)}try{t.rmdirSync(e)}catch(a){if(a.code==="ENOTDIR"){throw r}else if(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM"){rmkidsSync(e,t)}else if(a.code!=="ENOENT"){throw a}}}function rmkidsSync(e,t){i(e);i(t);t.readdirSync(e).forEach((r=>rimrafSync(n.join(e,r),t)));if(o){const r=Date.now();do{try{const r=t.rmdirSync(e,t);return r}catch(e){}}while(Date.now()-r<500)}else{const r=t.rmdirSync(e,t);return r}}e.exports=rimraf;rimraf.sync=rimrafSync},5679:e=>{"use strict";e.exports=function(e){if(typeof Buffer.allocUnsafe==="function"){try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}}return new Buffer(e)}},1767:(e,t,r)=>{"use strict";const a=r(7905);const n=r(2037);const i=r(1017);function hasMillisResSync(){let e=i.join("millis-test-sync"+Date.now().toString()+Math.random().toString().slice(2));e=i.join(n.tmpdir(),e);const t=new Date(1435410243862);a.writeFileSync(e,"https://github.com/jprichardson/node-fs-extra/pull/141");const r=a.openSync(e,"r+");a.futimesSync(r,t,t);a.closeSync(r);return a.statSync(e).mtime>1435410243e3}function hasMillisRes(e){let t=i.join("millis-test"+Date.now().toString()+Math.random().toString().slice(2));t=i.join(n.tmpdir(),t);const r=new Date(1435410243862);a.writeFile(t,"https://github.com/jprichardson/node-fs-extra/pull/141",(n=>{if(n)return e(n);a.open(t,"r+",((n,i)=>{if(n)return e(n);a.futimes(i,r,r,(r=>{if(r)return e(r);a.close(i,(r=>{if(r)return e(r);a.stat(t,((t,r)=>{if(t)return e(t);e(null,r.mtime>1435410243e3)}))}))}))}))}))}function timeRemoveMillis(e){if(typeof e==="number"){return Math.floor(e/1e3)*1e3}else if(e instanceof Date){return new Date(Math.floor(e.getTime()/1e3)*1e3)}else{throw new Error("fs-extra: timeRemoveMillis() unknown parameter type")}}function utimesMillis(e,t,r,n){a.open(e,"r+",((e,i)=>{if(e)return n(e);a.futimes(i,t,r,(e=>{a.close(i,(t=>{if(n)n(e||t)}))}))}))}function utimesMillisSync(e,t,r){const n=a.openSync(e,"r+");a.futimesSync(n,t,r);return a.closeSync(n)}e.exports={hasMillisRes:hasMillisRes,hasMillisResSync:hasMillisResSync,timeRemoveMillis:timeRemoveMillis,utimesMillis:utimesMillis,utimesMillisSync:utimesMillisSync}},4920:(e,t,r)=>{var a;try{a=r(7905)}catch(e){a=r(7147)}function readFile(e,t,r){if(r==null){r=t;t={}}if(typeof t==="string"){t={encoding:t}}t=t||{};var n=t.fs||a;var i=true;if("throws"in t){i=t.throws}n.readFile(e,t,(function(a,n){if(a)return r(a);n=stripBom(n);var o;try{o=JSON.parse(n,t?t.reviver:null)}catch(t){if(i){t.message=e+": "+t.message;return r(t)}else{return r(null,null)}}r(null,o)}))}function readFileSync(e,t){t=t||{};if(typeof t==="string"){t={encoding:t}}var r=t.fs||a;var n=true;if("throws"in t){n=t.throws}try{var i=r.readFileSync(e,t);i=stripBom(i);return JSON.parse(i,t.reviver)}catch(t){if(n){t.message=e+": "+t.message;throw t}else{return null}}}function stringify(e,t){var r;var a="\n";if(typeof t==="object"&&t!==null){if(t.spaces){r=t.spaces}if(t.EOL){a=t.EOL}}var n=JSON.stringify(e,t?t.replacer:null,r);return n.replace(/\n/g,a)+a}function writeFile(e,t,r,n){if(n==null){n=r;r={}}r=r||{};var i=r.fs||a;var o="";try{o=stringify(t,r)}catch(e){if(n)n(e,null);return}i.writeFile(e,o,r,n)}function writeFileSync(e,t,r){r=r||{};var n=r.fs||a;var i=stringify(t,r);return n.writeFileSync(e,i,r)}function stripBom(e){if(Buffer.isBuffer(e))e=e.toString("utf8");e=e.replace(/^\uFEFF/,"");return e}var n={readFile:readFile,readFileSync:readFileSync,writeFile:writeFile,writeFileSync:writeFileSync};e.exports=n},9676:(e,t)=>{"use strict";t.E=function(e){return Object.defineProperty((function(){if(typeof arguments[arguments.length-1]==="function")e.apply(this,arguments);else{return new Promise(((t,r)=>{arguments[arguments.length]=(e,a)=>{if(e)return r(e);t(a)};arguments.length++;e.apply(this,arguments)}))}}),"name",{value:e.name})};t.p=function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if(typeof t!=="function")return e.apply(this,arguments);else e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},9735:e=>{"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var r={__proto__:t(e)};else var r=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}));return r}},7905:(e,t,r)=>{var a=r(7147);var n=r(670);var i=r(8612);var o=r(9735);var s=r(3837);var p;var l;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){p=Symbol.for("graceful-fs.queue");l=Symbol.for("graceful-fs.previous")}else{p="___graceful-fs.queue";l="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,p,{get:function(){return t}})}var d=noop;if(s.debuglog)d=s.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))d=function(){var e=s.format.apply(s,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!a[p]){var c=global[p]||[];publishQueue(a,c);a.close=function(e){function close(t,r){return e.call(a,t,(function(e){if(!e){resetQueue()}if(typeof r==="function")r.apply(this,arguments)}))}Object.defineProperty(close,l,{value:e});return close}(a.close);a.closeSync=function(e){function closeSync(t){e.apply(a,arguments);resetQueue()}Object.defineProperty(closeSync,l,{value:e});return closeSync}(a.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){d(a[p]);r(9491).equal(a[p].length,0)}))}}if(!global[p]){publishQueue(global,a[p])}e.exports=patch(o(a));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!a.__patched){e.exports=patch(a);a.__patched=true}function patch(e){n(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,r,a){if(typeof r==="function")a=r,r=null;return go$readFile(e,r,a);function go$readFile(e,r,a,n){return t(e,r,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,r,a],t,n||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var r=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,a,n){if(typeof a==="function")n=a,a=null;return go$writeFile(e,t,a,n);function go$writeFile(e,t,a,n,i){return r(e,t,a,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$writeFile,[e,t,a,n],r,i||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var a=e.appendFile;if(a)e.appendFile=appendFile;function appendFile(e,t,r,n){if(typeof r==="function")n=r,r=null;return go$appendFile(e,t,r,n);function go$appendFile(e,t,r,n,i){return a(e,t,r,(function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$appendFile,[e,t,r,n],a,i||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var o=e.copyFile;if(o)e.copyFile=copyFile;function copyFile(e,t,r,a){if(typeof r==="function"){a=r;r=0}return go$copyFile(e,t,r,a);function go$copyFile(e,t,r,a,n){return o(e,t,r,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$copyFile,[e,t,r,a],i,n||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var s=e.readdir;e.readdir=readdir;var p=/^v[0-5]\./;function readdir(e,t,r){if(typeof t==="function")r=t,t=null;var a=p.test(process.version)?function go$readdir(e,t,r,a){return s(e,fs$readdirCallback(e,t,r,a))}:function go$readdir(e,t,r,a){return s(e,t,fs$readdirCallback(e,t,r,a))};return a(e,t,r);function fs$readdirCallback(e,t,r,n){return function(i,o){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([a,[e,t,r],i,n||Date.now(),Date.now()]);else{if(o&&o.sort)o.sort();if(typeof r==="function")r.call(this,i,o)}}}}if(process.version.substr(0,4)==="v0.8"){var l=i(e);ReadStream=l.ReadStream;WriteStream=l.WriteStream}var d=e.ReadStream;if(d){ReadStream.prototype=Object.create(d.prototype);ReadStream.prototype.open=ReadStream$open}var c=e.WriteStream;if(c){WriteStream.prototype=Object.create(c.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var u=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return u},set:function(e){u=e},enumerable:true,configurable:true});var f=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return d.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return c.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r)}}))}function createReadStream(t,r){return new e.ReadStream(t,r)}function createWriteStream(t,r){return new e.WriteStream(t,r)}var m=e.open;e.open=open;function open(e,t,r,a){if(typeof r==="function")a=r,r=null;return go$open(e,t,r,a);function go$open(e,t,r,a,n){return m(e,t,r,(function(i,o){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$open,[e,t,r,a],i,n||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}return e}function enqueue(e){d("ENQUEUE",e[0].name,e[1]);a[p].push(e);retry()}var u;function resetQueue(){var e=Date.now();for(var t=0;t<a[p].length;++t){if(a[p][t].length>2){a[p][t][3]=e;a[p][t][4]=e}}retry()}function retry(){clearTimeout(u);u=undefined;if(a[p].length===0)return;var e=a[p].shift();var t=e[0];var r=e[1];var n=e[2];var i=e[3];var o=e[4];if(i===undefined){d("RETRY",t.name,r);t.apply(null,r)}else if(Date.now()-i>=6e4){d("TIMEOUT",t.name,r);var s=r.pop();if(typeof s==="function")s.call(null,n)}else{var l=Date.now()-o;var c=Math.max(o-i,1);var f=Math.min(c*1.2,100);if(l>=f){d("RETRY",t.name,r);t.apply(null,r.concat([i]))}else{a[p].push(e)}}if(u===undefined){u=setTimeout(retry,0)}}},8612:(e,t,r)=>{var a=r(2781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,r){if(!(this instanceof ReadStream))return new ReadStream(t,r);a.call(this);var n=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;r=r||{};var i=Object.keys(r);for(var o=0,s=i.length;o<s;o++){var p=i[o];this[p]=r[p]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){n._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){n.emit("error",e);n.readable=false;return}n.fd=t;n.emit("open",t);n._read()}))}function WriteStream(t,r){if(!(this instanceof WriteStream))return new WriteStream(t,r);a.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;r=r||{};var n=Object.keys(r);for(var i=0,o=n.length;i<o;i++){var s=n[i];this[s]=r[s]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},670:(e,t,r)=>{var a=r(2057);var n=process.cwd;var i=null;var o=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!i)i=n.call(process);return i};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var s=process.chdir;process.chdir=function(e){i=null;s.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,s)}e.exports=patch;function patch(e){if(a.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(e.chmod&&!e.lchmod){e.lchmod=function(e,t,r){if(r)process.nextTick(r)};e.lchmodSync=function(){}}if(e.chown&&!e.lchown){e.lchown=function(e,t,r,a){if(a)process.nextTick(a)};e.lchownSync=function(){}}if(o==="win32"){e.rename=typeof e.rename!=="function"?e.rename:function(t){function rename(r,a,n){var i=Date.now();var o=0;t(r,a,(function CB(s){if(s&&(s.code==="EACCES"||s.code==="EPERM")&&Date.now()-i<6e4){setTimeout((function(){e.stat(a,(function(e,i){if(e&&e.code==="ENOENT")t(r,a,CB);else n(s)}))}),o);if(o<100)o+=10;return}if(n)n(s)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,t);return rename}(e.rename)}e.read=typeof e.read!=="function"?e.read:function(t){function read(r,a,n,i,o,s){var p;if(s&&typeof s==="function"){var l=0;p=function(d,c,u){if(d&&d.code==="EAGAIN"&&l<10){l++;return t.call(e,r,a,n,i,o,p)}s.apply(this,arguments)}}return t.call(e,r,a,n,i,o,p)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=typeof e.readSync!=="function"?e.readSync:function(t){return function(r,a,n,i,o){var s=0;while(true){try{return t.call(e,r,a,n,i,o)}catch(e){if(e.code==="EAGAIN"&&s<10){s++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,r,n){e.open(t,a.O_WRONLY|a.O_SYMLINK,r,(function(t,a){if(t){if(n)n(t);return}e.fchmod(a,r,(function(t){e.close(a,(function(e){if(n)n(t||e)}))}))}))};e.lchmodSync=function(t,r){var n=e.openSync(t,a.O_WRONLY|a.O_SYMLINK,r);var i=true;var o;try{o=e.fchmodSync(n,r);i=false}finally{if(i){try{e.closeSync(n)}catch(e){}}else{e.closeSync(n)}}return o}}function patchLutimes(e){if(a.hasOwnProperty("O_SYMLINK")&&e.futimes){e.lutimes=function(t,r,n,i){e.open(t,a.O_SYMLINK,(function(t,a){if(t){if(i)i(t);return}e.futimes(a,r,n,(function(t){e.close(a,(function(e){if(i)i(t||e)}))}))}))};e.lutimesSync=function(t,r,n){var i=e.openSync(t,a.O_SYMLINK);var o;var s=true;try{o=e.futimesSync(i,r,n);s=false}finally{if(s){try{e.closeSync(i)}catch(e){}}else{e.closeSync(i)}}return o}}else if(e.futimes){e.lutimes=function(e,t,r,a){if(a)process.nextTick(a)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(r,a,n){return t.call(e,r,a,(function(e){if(chownErOk(e))e=null;if(n)n.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(r,a){try{return t.call(e,r,a)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(r,a,n,i){return t.call(e,r,a,n,(function(e){if(chownErOk(e))e=null;if(i)i.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(r,a,n){try{return t.call(e,r,a,n)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(r,a,n){if(typeof a==="function"){n=a;a=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(n)n.apply(this,arguments)}return a?t.call(e,r,a,callback):t.call(e,r,callback)}}function statFixSync(t){if(!t)return t;return function(r,a){var n=a?t.call(e,r,a):t.call(e,r);if(n){if(n.uid<0)n.uid+=4294967296;if(n.gid<0)n.gid+=4294967296}return n}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},77:(e,t,r)=>{"use strict";const a=r(7147);let n;function hasDockerEnv(){try{a.statSync("/.dockerenv");return true}catch(e){return false}}function hasDockerCGroup(){try{return a.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch(e){return false}}e.exports=()=>{if(n===undefined){n=hasDockerEnv()||hasDockerCGroup()}return n}},6878:e=>{e.exports=isPromise;e.exports["default"]=isPromise;function isPromise(e){return!!e&&(typeof e==="object"||typeof e==="function")&&typeof e.then==="function"}},2048:(e,t,r)=>{"use strict";const a=r(2037);const n=r(7147);const i=r(77);const isWsl=()=>{if(process.platform!=="linux"){return false}if(a.release().toLowerCase().includes("microsoft")){if(i()){return false}return true}try{return n.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!i():false}catch(e){return false}};if(process.env.__IS_WSL_TEST__){e.exports=isWsl}else{e.exports=isWsl()}},5930:(e,t,r)=>{var a=r(7147);var n;if(process.platform==="win32"||global.TESTING_WINDOWS){n=r(3138)}else{n=r(6017)}e.exports=isexe;isexe.sync=sync;function isexe(e,t,r){if(typeof t==="function"){r=t;t={}}if(!r){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(r,a){isexe(e,t||{},(function(e,t){if(e){a(e)}else{r(t)}}))}))}n(e,t||{},(function(e,a){if(e){if(e.code==="EACCES"||t&&t.ignoreErrors){e=null;a=false}}r(e,a)}))}function sync(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code==="EACCES"){return false}else{throw e}}}},6017:(e,t,r)=>{e.exports=isexe;isexe.sync=sync;var a=r(7147);function isexe(e,t,r){a.stat(e,(function(e,a){r(e,e?false:checkStat(a,t))}))}function sync(e,t){return checkStat(a.statSync(e),t)}function checkStat(e,t){return e.isFile()&&checkMode(e,t)}function checkMode(e,t){var r=e.mode;var a=e.uid;var n=e.gid;var i=t.uid!==undefined?t.uid:process.getuid&&process.getuid();var o=t.gid!==undefined?t.gid:process.getgid&&process.getgid();var s=parseInt("100",8);var p=parseInt("010",8);var l=parseInt("001",8);var d=s|p;var c=r&l||r&p&&n===o||r&s&&a===i||r&d&&i===0;return c}},3138:(e,t,r)=>{e.exports=isexe;isexe.sync=sync;var a=r(7147);function checkPathExt(e,t){var r=t.pathExt!==undefined?t.pathExt:process.env.PATHEXT;if(!r){return true}r=r.split(";");if(r.indexOf("")!==-1){return true}for(var a=0;a<r.length;a++){var n=r[a].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n){return true}}return false}function checkStat(e,t,r){if(!e.isSymbolicLink()&&!e.isFile()){return false}return checkPathExt(t,r)}function isexe(e,t,r){a.stat(e,(function(a,n){r(a,a?false:checkStat(n,e,t))}))}function sync(e,t){return checkStat(a.statSync(e),e,t)}},3255:function(e,t,r){e=r.nmd(e);
1
+ (()=>{var __webpack_modules__={6965:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});var i=r(5264);var o=r(4975);var s=r(4770);var p=r(8800);var l=r(603);t["default"]=function(e){return a(void 0,void 0,void 0,(function(){var t;return n(this,(function(r){switch(r.label){case 0:return[4,(0,i.getProjectConfig)()];case 1:t=r.sent();if(!t){return[2]}return[4,Promise.all([t.pipelineType?(0,l.generatePipelineFiles)(t,t.pipelineType,"local"):undefined,(0,s.writeDotEnvFiles)(t,e),(0,p.writeDTsFiles)(t,e),(0,o.printVariables)(t,e)])];case 2:r.sent();return[2]}}))}))}},4975:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.printVariables=void 0;var s=r(5264);var p=r(4560);var getAllVariablesToPrint=function(e,t){return n(void 0,void 0,void 0,(function(){var r,l,d;return i(this,(function(c){switch(c.label){case 0:return[4,(0,p.getCurrentComponentAndEnvFromChoice)(e,t)];case 1:r=c.sent(),l=r.env,d=r.currentComponent;if(!d)return[3,3];if(e.components[d].dotEnv){return[2,{}]}return[4,(0,s.getEnvVarsResolved)(null,l,d)];case 2:return[2,c.sent()];case 3:return[4,Object.keys(e.components).reduce((function(t,r){return n(void 0,void 0,void 0,(function(){var n,d;return i(this,(function(i){switch(i.label){case 0:if(!e.components[r].dotEnv)return[3,2];return[4,t];case 1:return[2,i.sent()];case 2:return[4,(0,s.getEnvVarsResolved)(null,l,r)];case 3:n=i.sent();delete n["_ALL_ENV_VAR_KEYS"];d=[{}];return[4,t];case 4:return[2,a.apply(void 0,[a.apply(void 0,[a.apply(void 0,d.concat([i.sent()])),n]),Object.fromEntries(Object.entries(n).map((function(e){var t=o(e,2),a=t[0],n=t[1];return["".concat((0,p.sanitizeEnvVarName)(r.toUpperCase()),"_").concat(a),n]})))])]}}))}))}),Promise.resolve({}))];case 4:return[2,c.sent()]}}))}))};var printVariables=function(e,t){return n(void 0,void 0,void 0,(function(){var r;return i(this,(function(a){switch(a.label){case 0:return[4,getAllVariablesToPrint(e,t)];case 1:r=a.sent();console.log(makeExportKeyValuestring(r));return[2]}}))}))};t.printVariables=printVariables;var makeExportKeyValuestring=function(e){return(0,p.makeKeyValueString)(e,"export ")}},4560:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.sanitizeEnvVarName=t.sanitizeMultiLine=t.makeKeyValueString=t.getCurrentComponentAndEnvFromChoice=t.getComponentFullPath=void 0;var o=r(1017);var s=r(9011);var getComponentFullPath=function(e,t,r){return(0,o.join)(e,t.components[r].dir)};t.getComponentFullPath=getComponentFullPath;var getCurrentComponentName=function(e){return a(void 0,void 0,void 0,(function(){var r,a;return n(this,(function(n){switch(n.label){case 0:return[4,(0,s.getGitRoot)()];case 1:r=n.sent();a=process.cwd();return[2,Object.keys(e.components).find((function(n){return a.startsWith((0,t.getComponentFullPath)(r,e,n))}))]}}))}))};var getCurrentComponentAndEnvFromChoice=function(e,t){return a(void 0,void 0,void 0,(function(){var r,a,i;var o,s;return n(this,(function(n){switch(n.label){case 0:r=(o=t===null||t===void 0?void 0:t.env)!==null&&o!==void 0?o:"local";if(!((s=t===null||t===void 0?void 0:t.componentName)!==null&&s!==void 0))return[3,1];i=s;return[3,3];case 1:return[4,getCurrentComponentName(e)];case 2:i=n.sent();n.label=3;case 3:a=i;return[2,{currentComponent:a,env:r}]}}))}))};t.getCurrentComponentAndEnvFromChoice=getCurrentComponentAndEnvFromChoice;var makeKeyValueString=function(e,t){if(t===void 0){t=""}return Object.entries(e).map((function(e){var r=i(e,2),a=r[0],n=r[1];return"".concat(t).concat(a,"='").concat(n,"'")})).join("\n")};t.makeKeyValueString=makeKeyValueString;var sanitizeMultiLine=function(e){return Object.fromEntries(Object.entries(e).map((function(e){var t=i(e,2),r=t[0],a=t[1];return[r,a.replaceAll("\n","\\n")]})))};t.sanitizeMultiLine=sanitizeMultiLine;var sanitizeEnvVarName=function(e){return e.replace(/[\s\-.]+/g,"_")};t.sanitizeEnvVarName=sanitizeEnvVarName},4770:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__values||function(e){var t=typeof Symbol==="function"&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&a>=e.length)e=void 0;return{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:true});t.writeDotEnvFiles=void 0;var s=r(603);var p=r(1017);var l=r(5264);var d=r(9011);var c=r(4560);var writeDotEnvFiles=function(e,t){return a(void 0,void 0,void 0,(function(){var r,a,u,f,m,h,v,y,b,g,w,_,S,O;var A,N;return n(this,(function(n){switch(n.label){case 0:return[4,(0,c.getCurrentComponentAndEnvFromChoice)(e,t)];case 1:r=n.sent(),a=r.env,u=r.currentComponent;f=Object.entries(e.components).filter((function(e){var t=i(e,2),r=t[1];return r===null||r===void 0?void 0:r.dotEnv})).map((function(e){var t=i(e,1),r=t[0];return r}));m=u?f.includes(u)?[u]:[]:f;return[4,(0,d.getGitRoot)()];case 2:h=n.sent();n.label=3;case 3:n.trys.push([3,9,10,11]);v=o(m),y=v.next();n.label=4;case 4:if(!!y.done)return[3,8];b=y.value;return[4,(0,l.getEnvVarsResolved)(null,a,b)];case 5:g=n.sent();delete g["_ALL_ENV_VAR_KEYS"];w=(0,c.getComponentFullPath)(h,e,b);_=(0,p.join)(w,".env");S=(0,c.sanitizeMultiLine)(g);return[4,(0,s.writeGeneratedFile)(_,(0,c.makeKeyValueString)(S),{commentChar:"#"})];case 6:n.sent();n.label=7;case 7:y=v.next();return[3,4];case 8:return[3,11];case 9:O=n.sent();A={error:O};return[3,11];case 10:try{if(y&&!y.done&&(N=v.return))N.call(v)}finally{if(A)throw A.error}return[7];case 11:return[2]}}))}))};t.writeDotEnvFiles=writeDotEnvFiles},8800:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__values||function(e){var t=typeof Symbol==="function"&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&a>=e.length)e=void 0;return{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:true});t.writeDTsFiles=void 0;var s=r(603);var p=r(1017);var l=r(5264);var d=r(9011);var c=r(4560);var writeDTsFiles=function(e,t){return a(void 0,void 0,void 0,(function(){var r,a,l,u,f,m,h,v,y,b,g,w,_,S;var O,A;return n(this,(function(n){switch(n.label){case 0:return[4,(0,c.getCurrentComponentAndEnvFromChoice)(e,t)];case 1:r=n.sent(),a=r.env,l=r.currentComponent;u=Object.entries(e.components).filter((function(e){var t=i(e,2),r=t[1];return r===null||r===void 0?void 0:r.envDTs})).map((function(e){var t=i(e,1),r=t[0];return r}));f=l?u.includes(l)?[l]:[]:u;return[4,(0,d.getGitRoot)()];case 2:m=n.sent();n.label=3;case 3:n.trys.push([3,9,10,11]);h=o(f),v=h.next();n.label=4;case 4:if(!!v.done)return[3,8];y=v.value;return[4,getEnvsForDTs(a,y)];case 5:b=n.sent();g=createEnvDTsContent(b);w=(0,c.getComponentFullPath)(m,e,y);_=(0,p.join)(w,"env.d.ts");return[4,(0,s.writeGeneratedFile)(_,g,{commentChar:"//"})];case 6:n.sent();n.label=7;case 7:v=h.next();return[3,4];case 8:return[3,11];case 9:S=n.sent();O={error:S};return[3,11];case 10:try{if(v&&!v.done&&(A=h.return))A.call(h)}finally{if(O)throw O.error}return[7];case 11:return[2]}}))}))};t.writeDTsFiles=writeDTsFiles;function getEnvsForDTs(e,t){return a(this,void 0,void 0,(function(){var r,a,i,o;return n(this,(function(n){switch(n.label){case 0:return[4,(0,l.getEnvironment)(e,t)];case 1:r=n.sent();a=Object.keys(r.envVars);i=new Set(r.secretEnvVarKeys.filter((function(e){return e.hidden})).map((function(e){return e.key})).concat(["_ALL_ENV_VAR_KEYS"]));o=a.filter((function(e){return!i.has(e)}));return[2,o]}}))}))}function createEnvDTsContent(e){return"/* tslint:disable prettier/prettier */\n/* eslint-disable prettier/prettier */\n/* prettier-ignore */\n\nexport {}\n\ndeclare global {\n namespace NodeJS {\n interface ProcessEnv {\n".concat(e.map((function(e){return" ".concat(e,": string")})).join("\n"),"\n }\n }\n}\n")}},8900:function(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});var n=a(r(6965));var i=r(3941);var o=process.argv.slice(2);var s=["--help","-h","help"];if(o.some((function(e){return s.includes(e)}))){var p="https://git.panter.ch/catladder/catladder/-/blob/main/docs/1_VARS.md";console.log("\nUsage: catenv [env|env:component]\n\nEnv variable and catenv documentation:\n".concat(p));process.exit(0)}(0,n.default)(o[0]?(0,i.parseChoice)(o[0]):null).then((function(){process.exit()}))},5264:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.getJobOnlyEnvVarsResolved=t.getEnvVarsResolved=t.getGitlabVar=t.getEnvironment=t.getAllPipelineContexts=t.getAllComponentsWithAllEnvsHierarchical=t.getAllComponentsWithAllEnvsFlat=t.getPipelineContextByChoice=t.getProjectComponents=t.getProjectConfig=t.parseChoice=void 0;var o=r(603);var s=r(2927);var p=r(9011);var l=r(7147);var d=r(3941);Object.defineProperty(t,"parseChoice",{enumerable:true,get:function(){return d.parseChoice}});var c=null;var reloadConfigAndObserve=function(){return a(void 0,void 0,void 0,(function(){var e,t,r,a,i;return n(this,(function(n){switch(n.label){case 0:return[4,(0,p.getGitRoot)()];case 1:e=n.sent();if(!e){return[2]}return[4,(0,o.readConfig)(e)];case 2:t=n.sent();if(!t){return[2]}r=t.config,a=t.path;i=(0,l.watch)(a,(function(){i.close();reloadConfigAndObserve()}));c=r;return[2]}}))}))};var getProjectConfig=function(){return a(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:if(!!c)return[3,2];return[4,reloadConfigAndObserve()];case 1:e.sent();e.label=2;case 2:return[2,c]}}))}))};t.getProjectConfig=getProjectConfig;var getProjectComponents=function(){return a(void 0,void 0,void 0,(function(){var e;return n(this,(function(r){switch(r.label){case 0:return[4,(0,t.getProjectConfig)()];case 1:e=r.sent();if(!e)return[2,[]];return[2,Object.keys(e.components)]}}))}))};t.getProjectComponents=getProjectComponents;var getPipelineContextByChoice=function(e,r){return a(void 0,void 0,void 0,(function(){var a;return n(this,(function(n){switch(n.label){case 0:return[4,(0,t.getProjectConfig)()];case 1:a=n.sent();return[4,(0,o.createComponentContext)({config:a,componentName:r,env:e})];case 2:return[2,n.sent()]}}))}))};t.getPipelineContextByChoice=getPipelineContextByChoice;var getAllComponentsWithAllEnvsFlat=function(){return a(void 0,void 0,void 0,(function(){var e;return n(this,(function(r){switch(r.label){case 0:return[4,(0,t.getProjectConfig)()];case 1:e=r.sent();if(!e){return[2,[]]}return[2,Object.keys(e.components).flatMap((function(t){return(0,o.getAllEnvs)(e,t).map((function(e){return{env:e,componentName:t}}))}))]}}))}))};t.getAllComponentsWithAllEnvsFlat=getAllComponentsWithAllEnvsFlat;var getAllComponentsWithAllEnvsHierarchical=function(){return a(void 0,void 0,void 0,(function(){var e;return n(this,(function(r){switch(r.label){case 0:return[4,(0,t.getProjectConfig)()];case 1:e=r.sent();if(!e){return[2,{}]}return[2,Object.fromEntries(Object.keys(e.components).map((function(t){return[t,(0,o.getAllEnvs)(e,t)]})))]}}))}))};t.getAllComponentsWithAllEnvsHierarchical=getAllComponentsWithAllEnvsHierarchical;var getAllPipelineContexts=function(){return a(void 0,void 0,void 0,(function(){var e,r;return n(this,(function(a){switch(a.label){case 0:r=(e=Promise).all;return[4,(0,t.getAllComponentsWithAllEnvsFlat)()];case 1:return[2,r.apply(e,[a.sent().filter((function(e){return e.env!=="local"})).map((function(e){var r=e.env,a=e.componentName;return(0,t.getPipelineContextByChoice)(r,a)}))])]}}))}))};t.getAllPipelineContexts=getAllPipelineContexts;var getEnvironment=function(e,r){return a(void 0,void 0,void 0,(function(){var a;return n(this,(function(n){switch(n.label){case 0:return[4,(0,t.getProjectConfig)()];case 1:a=n.sent();return[2,(0,o.getEnvironment)({config:a,componentName:r,env:e})]}}))}))};t.getEnvironment=getEnvironment;var getGitlabVar=function(e,t,r,i){return a(void 0,void 0,void 0,(function(){var a;return n(this,(function(n){switch(n.label){case 0:a=(0,o.getSecretVarName)(t,r,i);return[4,(0,s.getVariableValueByRawName)(e,a)];case 1:return[2,n.sent()]}}))}))};t.getGitlabVar=getGitlabVar;var resolveSecrets=function(e,t){return a(void 0,void 0,void 0,(function(){var r;return n(this,(function(a){switch(a.label){case 0:return[4,(0,s.getAllVariables)(e)];case 1:r=a.sent();return[2,Object.fromEntries(t.flatMap((function(e){var t=e.envVars,a=e.secretEnvVarKeys;return Object.entries(t).filter((function(e){var t;var r=i(e,2),n=r[0],o=r[1];return o!==undefined&&o!==null&&!((t=a.find((function(e){return e.key===n})))===null||t===void 0?void 0:t.hidden)})).map((function(e){var t=i(e,2),a=t[0],n=t[1];return[a,r.reduce((function(e,t){return e.replace(new RegExp("\\$"+t.key,"g"),t.value)}),"".concat(n))]}))})))]}}))}))};var getEnvVarsResolved=function(e,r,i){return a(void 0,void 0,void 0,(function(){var a,o;return n(this,(function(n){switch(n.label){case 0:if(!i){return[2,{}]}n.label=1;case 1:n.trys.push([1,3,,4]);return[4,(0,t.getEnvironment)(r,i)];case 2:a=n.sent();return[2,resolveSecrets(e,[{envVars:a.envVars,secretEnvVarKeys:a.secretEnvVarKeys}])];case 3:o=n.sent();return[2,{}];case 4:return[2]}}))}))};t.getEnvVarsResolved=getEnvVarsResolved;var getJobOnlyEnvVarsResolved=function(e,r,i){return a(void 0,void 0,void 0,(function(){var a,o;return n(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,(0,t.getEnvironment)(r,i)];case 1:a=n.sent();return[2,resolveSecrets(e,[a.jobOnlyVars.build,a.jobOnlyVars.deploy])];case 2:o=n.sent();return[2,{}];case 3:return[2]}}))}))};t.getJobOnlyEnvVarsResolved=getJobOnlyEnvVarsResolved},3941:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.parseChoice=void 0;var parseChoice=function(e){var t=r(e.split(":").map((function(e){return e||null})),2),a=t[0],n=t[1];return{env:a,componentName:n}};t.parseChoice=parseChoice},9863:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.readFileOrError=void 0;var o=i(r(5501));var readFile=function(e){return a(void 0,void 0,void 0,(function(){return n(this,(function(t){return[2,o.default.readFile(e,{encoding:"utf-8"})]}))}))};var readFileOrError=function(e){return a(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);return[4,readFile(e)];case 1:t=a.sent();return[2,[null,t]];case 2:r=a.sent();return[2,[r]];case 3:return[2]}}))}))};t.readFileOrError=readFileOrError},2927:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var s=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};var p=this&&this.__values||function(e){var t=typeof Symbol==="function"&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&a>=e.length)e=void 0;return{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.upsertAllVariables=t.clearBackups=t.getVariableValueByRawName=t.getAllVariables=t.getProjectInfo=t.doGitlabRequest=t.getGitlabToken=t.setupGitlabToken=t.hasGitlabToken=void 0;var d=r(603);var c=r(5763);var u=r(3255);var f=l(r(5839));var m=l(r(6372));var h=l(r(4247));var v=r(2636);var y="gitlab-personal-access-token";var hasGitlabToken=function(){return n(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,(0,v.hasPreference)(y)];case 1:return[2,e.sent()]}}))}))};t.hasGitlabToken=hasGitlabToken;var setupGitlabToken=function(e){return n(void 0,void 0,void 0,(function(){var t,r;return i(this,(function(a){switch(a.label){case 0:e.log("");e.log("☝ in order to access the api, we need a personal access token");e.log("Its best to create one specifically for catladder");e.log("");e.log("☝ we open up the settings page for you!");e.log("");return[4,e.prompt({default:true,message:"Ok",name:"shouldContinue",type:"prompt"})];case 1:t=a.sent().shouldContinue;(0,h.default)("https://git.panter.ch/-/profile/personal_access_tokens");e.log("Please type in gitlab's personal access token");return[4,e.prompt({type:"string",name:"personalToken",default:"",message:"Your personal access token "})];case 2:r=a.sent().personalToken;if(!r)return[3,4];return[4,(0,v.setPreference)(y,r)];case 3:a.sent();a.label=4;case 4:return[2]}}))}))};t.setupGitlabToken=setupGitlabToken;var getGitlabToken=function(e){return n(void 0,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,(0,t.hasGitlabToken)()];case 1:if(!!r.sent())return[3,3];if(!e){console.error("⚠️ gitlab token missing, please run catladder to set it up");process.exit(1)}return[4,(0,t.setupGitlabToken)(e)];case 2:r.sent();r.label=3;case 3:return[2,(0,v.getPreference)(y)]}}))}))};t.getGitlabToken=getGitlabToken;var doGitlabRequest=function(e,r){var a=[];for(var p=2;p<arguments.length;p++){a[p-2]=arguments[p]}return n(void 0,s([e,r],o(a),false),void 0,(function(e,r,a,n){var o,s,p,l,d,c,u;if(a===void 0){a=undefined}if(n===void 0){n="GET"}return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.getGitlabToken)(e)];case 1:o=i.sent();return[4,(0,m.default)("https://git.panter.ch/api/v4/".concat(r),{method:n,headers:{"Content-Type":"application/json","Private-Token":o},body:a?JSON.stringify(a):undefined})];case 2:s=i.sent();if(s.status>=200&&s.status<400){if(s.headers.get("content-type")==="application/json"){return[2,s.json()]}return[2,null]}if(s.status===404){throw new Error("not found")}p=Error.bind;d=(l="Could not send request to gitlab api ".concat(r,": ").concat(s.status,' "').concat(s.statusText,'".\nResponse: ')).concat;u=(c=JSON).stringify;return[4,s.json()];case 3:throw new(p.apply(Error,[void 0,d.apply(l,[u.apply(c,[i.sent(),null,2])])]))}}))}))};t.doGitlabRequest=doGitlabRequest;var getProjectInfo=function(e){return n(void 0,void 0,void 0,(function(){var r,a,n;return i(this,(function(i){switch(i.label){case 0:return[4,(0,c.exec)("git config --get remote.origin.url")];case 1:r=i.sent().stdout.trim();a=/(https:\/\/|git@)git\.panter\.ch[:/]([^.]*)(\.git)?/g.exec(r);return[4,(0,t.doGitlabRequest)(e,"projects/".concat(encodeURIComponent(a[2])))];case 2:n=i.sent();return[2,n]}}))}))};t.getProjectInfo=getProjectInfo;t.getAllVariables=(0,f.default)((function(e){var r=[];for(var a=1;a<arguments.length;a++){r[a-1]=arguments[a]}return n(void 0,s([e],o(r),false),void 0,(function(e,r){var a,n,p,l,d;if(r===void 0){r=5}return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.getProjectInfo)(e)];case 1:a=i.sent().id;n=[];p=[];l=1;i.label=2;case 2:d=Array.from({length:r},(function(r,n){return(0,t.doGitlabRequest)(e,"projects/".concat(a,"/variables?per_page=100&page=").concat(l+n))}));return[4,Promise.all(d)];case 3:p=i.sent();l+=r;n=s(s([],o(n),false),o(p.flat()),false);i.label=4;case 4:if(p.length>0&&p[p.length-1].length>0)return[3,2];i.label=5;case 5:return[2,n]}}))}))}),{promise:true});var getVariableValueByRawName=function(e,r){return n(void 0,void 0,void 0,(function(){var a;var n;return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.getAllVariables)(e)];case 1:a=i.sent();return[2,(n=a.find((function(e){return e.key===r})))===null||n===void 0?void 0:n.value]}}))}))};t.getVariableValueByRawName=getVariableValueByRawName;var b=new RegExp("^[a-zA-Z0-9_+=/@:.~-]{8,}$");var isMaskable=function(e){return b.test(e)};var createVariable=function(e,r,a,p){var l=[];for(var d=4;d<arguments.length;d++){l[d-4]=arguments[d]}return n(void 0,s([e,r,a,p],o(l),false),void 0,(function(e,r,a,n,o,s){if(o===void 0){o=true}if(s===void 0){s="*"}return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.doGitlabRequest)(e,"projects/".concat(r,"/variables"),{key:a,value:n,masked:o&&isMaskable(n),environment_scope:s},"POST")];case 1:return[2,i.sent()]}}))}))};var updateVariable=function(e,r,a,p){var l=[];for(var d=4;d<arguments.length;d++){l[d-4]=arguments[d]}return n(void 0,s([e,r,a,p],o(l),false),void 0,(function(e,r,a,n,o){if(o===void 0){o=true}return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.doGitlabRequest)(e,"projects/".concat(r,"/variables/").concat(a),{value:n,masked:o&&isMaskable(n)},"PUT")];case 1:return[2,i.sent()]}}))}))};var deleteVariable=function(e,r,a){return n(void 0,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,(0,t.doGitlabRequest)(e,"projects/".concat(r,"/variables/").concat(a),undefined,"DELETE")];case 1:return[2,n.sent()]}}))}))};var getAllCatladderEnvVarsInGitlab=function(e){return n(void 0,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,(0,t.getAllVariables)(e).then((function(e){return e.reduce((function(e,t){var r,n;var i,p,l,d;var c=t.key;if(c.startsWith("CL_")){var u=c.match(/(CL_.*)_backup_([0-9]+)/);if(u){var f=u[1];var m=Number(u[2]);var h=s(s([],o((p=(i=e[f])===null||i===void 0?void 0:i.backups)!==null&&p!==void 0?p:[]),false),[m],false);return a(a({},e),(r={},r[f]=a(a({},(l=e[f])!==null&&l!==void 0?l:{}),{backups:h}),r))}return a(a({},e),(n={},n[c]=a(a({backups:[]},(d=e[c])!==null&&d!==void 0?d:{}),{value:t.value}),n))}return e}),{})}))];case 1:r=n.sent();return[2,r]}}))}))};var getBackupKey=function(e,t){return"".concat(e,"_backup_").concat(t)};var clearBackups=function(e,r){return n(void 0,void 0,void 0,(function(){var a,n,s,l,d,c,u,f,m,h,v,y,b,g;var w,_,S,O;return i(this,(function(i){switch(i.label){case 0:return[4,getAllCatladderEnvVarsInGitlab(e)];case 1:a=i.sent();return[4,(0,t.getProjectInfo)(e)];case 2:n=i.sent().id;i.label=3;case 3:i.trys.push([3,14,15,16]);s=p(Object.entries(a)),l=s.next();i.label=4;case 4:if(!!l.done)return[3,13];d=o(l.value,2),c=d[0],u=d[1].backups;f=u.sort((function(e,t){return t-e}));m=f.slice(r);i.label=5;case 5:i.trys.push([5,10,11,12]);h=(S=void 0,p(m)),v=h.next();i.label=6;case 6:if(!!v.done)return[3,9];y=v.value;return[4,deleteVariable(e,n,getBackupKey(c,y))];case 7:i.sent();i.label=8;case 8:v=h.next();return[3,6];case 9:return[3,12];case 10:b=i.sent();S={error:b};return[3,12];case 11:try{if(v&&!v.done&&(O=h.return))O.call(h)}finally{if(S)throw S.error}return[7];case 12:l=s.next();return[3,4];case 13:return[3,16];case 14:g=i.sent();w={error:g};return[3,16];case 15:try{if(l&&!l.done&&(_=s.return))_.call(s)}finally{if(w)throw w.error}return[7];case 16:return[2]}}))}))};t.clearBackups=clearBackups;var upsertAllVariables=function(e,r,a,l){var c=[];for(var f=4;f<arguments.length;f++){c[f-4]=arguments[f]}return n(void 0,s([e,r,a,l],o(c),false),void 0,(function(e,r,a,n,s,l){var c,f,m,h,v,y,b,g,w,_,S,O,A;var N,C;var k;if(s===void 0){s=true}if(l===void 0){l=true}return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.getProjectInfo)(e)];case 1:c=i.sent().id;return[4,getAllCatladderEnvVarsInGitlab(e)];case 2:f=i.sent();i.label=3;case 3:i.trys.push([3,14,15,16]);m=p(Object.entries(r!==null&&r!==void 0?r:{})),h=m.next();i.label=4;case 4:if(!!h.done)return[3,13];v=o(h.value,2),y=v[0],b=v[1];g=(0,d.getSecretVarName)(a,n,y);w=(0,u.isObject)(b)?JSON.stringify(b):"".concat(b);_=(0,u.has)(f,g);S=(k=f[g])===null||k===void 0?void 0:k.value;O=S!==w;if(!O)return[3,11];if(!_)return[3,8];e.log("changed: ".concat(y));return[4,updateVariable(e,c,g,w,l)];case 5:i.sent();if(!s)return[3,7];return[4,createVariable(e,c,getBackupKey(g,(new Date).getTime()),S,l,"_backup")];case 6:i.sent();i.label=7;case 7:return[3,10];case 8:e.log("new : ".concat(y));return[4,createVariable(e,c,g,w,l)];case 9:i.sent();i.label=10;case 10:return[3,12];case 11:e.log("skip : ".concat(y));i.label=12;case 12:h=m.next();return[3,4];case 13:return[3,16];case 14:A=i.sent();N={error:A};return[3,16];case 15:try{if(h&&!h.done&&(C=m.return))C.call(m)}finally{if(N)throw N.error}return[7];case 16:t.getAllVariables.clear();return[2]}}))}))};t.upsertAllVariables=upsertAllVariables},2636:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.setPreference=t.getPreference=t.hasPreference=void 0;var s=o(r(5501));var p=r(2037);var l=r(8033);var d="".concat((0,p.homedir)(),"/.catladder");var c="".concat(d,"/preferences.yml");var getPreferences=function(){return n(void 0,void 0,void 0,(function(){var e;var t;return i(this,(function(r){switch(r.label){case 0:return[4,s.default.pathExists(c)];case 1:if(!!r.sent())return[3,3];return[4,s.default.createFile(c)];case 2:r.sent();r.label=3;case 3:e=l.parse;return[4,s.default.readFile(c,{encoding:"utf-8"})];case 4:return[2,(t=e.apply(void 0,[r.sent()]))!==null&&t!==void 0?t:{}]}}))}))};var hasPreference=function(e){return n(void 0,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,getPreferences()];case 1:t=r.sent();return[2,e in t]}}))}))};t.hasPreference=hasPreference;var getPreference=function(e){return n(void 0,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,getPreferences()];case 1:t=r.sent();return[2,t[e]]}}))}))};t.getPreference=getPreference;var setPreference=function(e,t){return n(void 0,void 0,void 0,(function(){var r,n;var o;return i(this,(function(i){switch(i.label){case 0:return[4,getPreferences()];case 1:r=i.sent();n=a(a({},r),(o={},o[e]=t,o));return[4,s.default.writeFile(c,(0,l.stringify)(n))];case 2:i.sent();return[2]}}))}))};t.setPreference=setPreference},9011:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.getProjectNamespace=t.hasGitlabCiFile=t.readRootGitlabCiFile=t.getRootGitlabCiFile=t.getGitRoot=void 0;var o=r(1017);var s=r(5264);var p=r(9863);var l=r(5763);var getGitRoot=function(){return a(void 0,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,l.exec)("git rev-parse --show-toplevel")];case 1:return[2,t.sent().stdout.trim()];case 2:e=t.sent();return[2,null];case 3:return[2]}}))}))};t.getGitRoot=getGitRoot;var getRootGitlabCiFile=function(){return a(void 0,void 0,void 0,(function(){var e;return n(this,(function(r){switch(r.label){case 0:return[4,(0,t.getGitRoot)()];case 1:e=r.sent();return[2,(0,o.join)(e,".gitlab-ci.yml")]}}))}))};t.getRootGitlabCiFile=getRootGitlabCiFile;var readRootGitlabCiFile=function(){return a(void 0,void 0,void 0,(function(){var e;return n(this,(function(r){switch(r.label){case 0:e=p.readFileOrError;return[4,(0,t.getRootGitlabCiFile)()];case 1:return[2,e.apply(void 0,[r.sent()])]}}))}))};t.readRootGitlabCiFile=readRootGitlabCiFile;var hasGitlabCiFile=function(){return a(void 0,void 0,void 0,(function(){var e,r,a;return n(this,(function(n){switch(n.label){case 0:return[4,(0,t.readRootGitlabCiFile)()];case 1:e=i.apply(void 0,[n.sent(),2]),r=e[0],a=e[1];if(r){return[2,false]}return[2,true]}}))}))};t.hasGitlabCiFile=hasGitlabCiFile;var getProjectNamespace=function(e){return a(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(a){switch(a.label){case 0:t=(0,s.parseChoice)(e).env;return[4,(0,s.getProjectConfig)()];case 1:r=a.sent();return[2,"".concat(r.customerName,"-").concat(r.appName,"-").concat(t)]}}))}))};t.getProjectNamespace=getProjectNamespace},2376:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var a=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.bashEscape=t.joinBashExpressions=t.getBashVariable=t.BashExpression=void 0;var n=function(){function BashExpression(e){this.value=e}BashExpression.prototype.toJSON=function(){return this.toString()};BashExpression.prototype.toString=function(){return this.value.toString()};BashExpression.prototype.toLowerCase=function(){return this.transformWithCommand("awk '{print tolower($0)}'")};BashExpression.prototype.concat=function(){var e;var t=[];for(var n=0;n<arguments.length;n++){t[n]=arguments[n]}return new BashExpression((e=this.toString()).concat.apply(e,a([],r(t.map((function(e){return e.toString()}))),false)))};BashExpression.prototype.transformWithCommand=function(e){return new BashExpression('$(printf %s "'.concat(this.toString(),'" | ').concat(e,")"))};return BashExpression}();t.BashExpression=n;var getBashVariable=function(e){return new n("$".concat(e))};t.getBashVariable=getBashVariable;var joinBashExpressions=function(e,t){if(t===void 0){t=""}var r=e.some((function(e){return e instanceof n}));if(r){return new n(e.map((function(e){return e instanceof n?e.toString():e})).join(t))}else{return e.join(t)}};t.joinBashExpressions=joinBashExpressions;var bashEscape=function(e){if(e instanceof n){return e.toString()}if(typeof e==="string")return e.replace(/"/g,'\\"');return e};t.bashEscape=bashEscape},612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getBashExpressionPerPipelineType=void 0;var getBashExpressionPerPipelineType=function(e,t){if(!t)return e.default;return e[t]||e.default};t.getBashExpressionPerPipelineType=getBashExpressionPerPipelineType},4660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeBashYamlToFileScript=t.yamlBashString=void 0;var a=r(8033);var n=r(2376);var i={tag:"",resolve:function(e){return new n.BashExpression(e)},stringify:function(e,t){return"|-\n"+e.value.transformWithCommand("sed 's/^/".concat(t.indent,"/'"))},identify:function(e){return e instanceof n.BashExpression}};var yamlBashString=function(e){return(0,a.stringify)(e,{defaultStringType:"BLOCK_LITERAL",defaultKeyType:"PLAIN",customTags:[i],aliasDuplicateObjects:false,lineWidth:0})};t.yamlBashString=yamlBashString;var writeBashYamlToFileScript=function(e,r){return["cat > ".concat(r," <<EOF\n").concat((0,t.yamlBashString)(e),"\nEOF\n")]};t.writeBashYamlToFileScript=writeBashYamlToFileScript},8133:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.getInjectVarsScript=void 0;var n=r(3255);var i=r(2376);var getInjectVarsScript=function(e){if(!e)return[];return Object.entries(e).filter((function(e){var t=a(e,2),r=t[1];return!(0,n.isNil)(r)})).map((function(e){var t=a(e,2),r=t[0],n=t[1];return"export ".concat(r,'="').concat(n?(0,i.bashEscape)(n):"",'"')}))};t.getInjectVarsScript=getInjectVarsScript},2233:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});var i=r(2376);function replaceAsync(e,t,r){return a(this,void 0,void 0,(function(){var a,o,s,p,l,d;return n(this,(function(n){switch(n.label){case 0:a=e instanceof i.BashExpression;n.label=1;case 1:n.trys.push([1,3,,4]);o=[];String.prototype.replace.call(e.toString(),t,(function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}var a=r.apply(undefined,e);o.push(a);return""}));return[4,Promise.all(o)];case 2:s=n.sent();p=s.some((function(e){return e instanceof i.BashExpression}));l=String.prototype.replace.call(e.toString(),t,(function(){var e,t;return(t=(e=s.shift())===null||e===void 0?void 0:e.toString())!==null&&t!==void 0?t:""}));if(a||p){return[2,new i.BashExpression(l)]}else{return[2,l]}return[3,4];case 3:d=n.sent();return[2,Promise.reject(d)];case 4:return[2]}}))}))}t["default"]=replaceAsync},8774:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createBuildJobArtifacts=void 0;var o=r(1017);var s=r(1853);var p=r(3255);var l=r(8052);var createBuildJobArtifacts=function(e){var t,r;var n=e.type==="workspace"?e.components.flatMap((function(e){return getArtifactsPathForComponent(e)})):getArtifactsPathForComponent(e,["__build_info.json"]);var i=e.type==="workspace"?e.components.flatMap((function(e){return getDotEnvPathsForComponent(e)})):getDotEnvPathsForComponent(e);return a(a({paths:(0,p.uniq)(n).sort((function(e,t){return e.localeCompare(t)}))},i.length>0?{exclude:i}:{}),{expire_in:"1 day",when:"always",reports:e.type==="component"&&(0,s.componentContextIsStandaloneBuild)(e)?{junit:(r=(t=e.build.config.artifactsReports)===null||t===void 0?void 0:t.junit)===null||r===void 0?void 0:r.map((function(t){return(0,o.join)(e.build.dir,t)}))}:{}})};t.createBuildJobArtifacts=createBuildJobArtifacts;var getArtifactsPathForComponent=function(e,t){var r,a;return(a=i(i([],n((r=e.build.config.artifactsPaths)!==null&&r!==void 0?r:[]),false),n(t!==null&&t!==void 0?t:[]),false))===null||a===void 0?void 0:a.flatMap((function(t){return e.build.getComponentDirs("all").flatMap((function(e){return(0,o.join)(e,t)}))}))};var getDotEnvPathsForComponent=function(e){if((0,l.componentContextNeedsBuildTimeDotEnv)(e)){return[(0,o.join)(e.build.dir,".env")]}return[]}},2786:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.RUNNER_BUILD_RESOURCE_VARIABLES=t.APP_BUILD_JOB_NAME=void 0;t.APP_BUILD_JOB_NAME="🔨 app";t.RUNNER_BUILD_RESOURCE_VARIABLES={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"}},7801:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createAppBuildJob=void 0;var s=r(3255);var p=r(603);var l=r(2497);var d=r(8774);var c=r(5043);var u=r(2786);var f=r(9578);var m=r(8052);var createAppBuildJob=function(e,t){var r,h,v;var y=t.script,b=t.variables,g=t.runnerVariables,w=n(t,["script","variables","runnerVariables"]);return(0,s.merge)({name:u.APP_BUILD_JOB_NAME,envMode:"jobPerEnv",stage:"build",image:(0,p.getRunnerImage)("jobs-default"),needs:[],cache:[],variables:a(a({},b!==null&&b!==void 0?b:{}),e.type==="component"?a(a(a({},e.environment.envVars),e.environment.jobOnlyVars.build.envVars),(r=e.build.config.extraVars)!==null&&r!==void 0?r:{}):{}),runnerVariables:a(a(a({},u.RUNNER_BUILD_RESOURCE_VARIABLES),g!==null&&g!==void 0?g:{}),(h=e.build.config.runnerVariables)!==null&&h!==void 0?h:{}),script:o(o(o(o(o([],i(e.type==="component"?(0,m.componentContextNeedsBuildTimeDotEnv)(e)?(0,m.writeDotEnv)(e):[]:e.type==="workspace"?e.components.filter((function(e){return(0,m.componentContextNeedsBuildTimeDotEnv)(e)})).flatMap((function(e){return(0,m.writeDotEnv)(e)})):[]),false),i(e.type==="component"?(0,f.writeBuildInfo)(e):[]),false),i((0,c.ensureNodeVersion)(e)),false),["cd ".concat(e.build.dir)],false),i((v=(0,l.ensureArray)(y))!==null&&v!==void 0?v:[]),false),artifacts:(0,d.createBuildJobArtifacts)(e)},w)};t.createAppBuildJob=createAppBuildJob},2820:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createArtifactsConfig=void 0;var o=r(1017);var createArtifactsConfig=function(e,t,r){var s,p,l,d;return t||r?{artifacts:a(a({paths:[]},r),{reports:a(a({},r===null||r===void 0?void 0:r.reports),{junit:[t===null||t===void 0?void 0:t.junit,Array.isArray((s=r===null||r===void 0?void 0:r.reports)===null||s===void 0?void 0:s.junit)&&((p=r===null||r===void 0?void 0:r.reports)===null||p===void 0?void 0:p.junit),typeof((l=r===null||r===void 0?void 0:r.reports)===null||l===void 0?void 0:l.junit)==="string"&&[(d=r===null||r===void 0?void 0:r.reports)===null||d===void 0?void 0:d.junit]].filter(Array.isArray).reduce((function(t,r){return i(i([],n(t),false),n(r.map((function(t){return(0,o.join)(e,t)}))),false)}),[])})})}:undefined};t.createArtifactsConfig=createArtifactsConfig},9366:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createWorkspaceBuildJobs=t.createComponentBuildJobs=void 0;var o=r(4986);var s=r(1724);var p=r(9641);var l=r(7038);var d=r(2786);var c=r(7801);var createComponentBuildJobs=function(e,t){var r;return i(i(i([],n(t.appBuild&&(0,s.componentContextIsStandaloneBuild)(e)?[(0,c.createAppBuildJob)(e,t.appBuild)]:[]),false),n((0,p.requiresDockerBuild)(e)?[(0,p.createDockerBuildJobBase)(e,a(a({},t.dockerBuild),{needs:i(i([],n((r=t.dockerBuild.needs)!==null&&r!==void 0?r:[]),false),n(t.appBuild&&(0,s.componentContextIsStandaloneBuild)(e)?[d.APP_BUILD_JOB_NAME]:(0,s.componentContextHasWorkspaceBuild)(e)?[{job:d.APP_BUILD_JOB_NAME,artifacts:true,workspaceName:e.build.workspaceName}]:[]),false)}))]:[]),false),n((0,o.sbomDeactivated)(e)?[]:[(0,l.createSbomBuildJob)(e)]),false)};t.createComponentBuildJobs=createComponentBuildJobs;var createWorkspaceBuildJobs=function(e,t){return t.appBuild?[(0,c.createAppBuildJob)(e,t.appBuild)]:[]};t.createWorkspaceBuildJobs=createWorkspaceBuildJobs},9578:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeBuildInfo=void 0;var writeBuildInfo=function(e){return['echo \'{"id":"'.concat(e.environment.envVars.BUILD_INFO_BUILD_ID,'","time":"').concat(e.environment.envVars.BUILD_INFO_BUILD_TIME,"\"}' > ").concat(e.build.dir,"/__build_info.json")]};t.writeBuildInfo=writeBuildInfo},8052:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.componentContextNeedsBuildTimeDotEnv=t.writeDotEnv=void 0;var n=r(3255);var i=r(8490);var o=r(7827);var writeDotEnv=function(e){var t=e.environment.envVars;var r=Object.entries(t).filter((function(e){var t=a(e,2),r=t[1];return!(0,n.isNil)(r)})).filter((function(e){var t=a(e,1),r=t[0];return!o.ALL_BUILD_VARIABLES.includes(r)})).map((function(e){var t=a(e,2),r=t[0],n=t[1];return"".concat(r,"=").concat(n===null||n===void 0?void 0:n.toString().replaceAll("\n","\\n"))})).join("\n");return(0,i.collapseableSection)("write-dotenv-"+e.name,"write dot env")(["cat <<EOF > ".concat(e.build.dir,"/.env\n").concat(r,"\nEOF")])};t.writeDotEnv=writeDotEnv;var componentContextNeedsBuildTimeDotEnv=function(e){return e.componentConfig.dotEnv===true};t.componentContextNeedsBuildTimeDotEnv=componentContextNeedsBuildTimeDotEnv},1637:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createCustomBuildJobs=void 0;var i=r(2497);var o=r(9641);var s=r(4466);var p=r(9366);var l={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"};var createCustomBuildJobs=function(e){var t;var r=e.build.config;if(!(0,s.isOfBuildType)(r,"custom")){throw new Error("deploy config is not custom")}return(0,p.createComponentBuildJobs)(e,{appBuild:r.buildCommand!==null?{image:r.jobImage,runnerVariables:l,cache:r.jobCache,services:r.jobServices,script:n([],a((t=(0,i.ensureArray)(r.buildCommand))!==null&&t!==void 0?t:[]),false)}:undefined,dockerBuild:{script:(0,o.getDockerBuildScriptWithBuiltInDockerFile)(e),variables:{}}})};t.createCustomBuildJobs=createCustomBuildJobs},1183:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createCustomJobs=void 0;var i=r(1637);var o=r(390);var createCustomJobs=function(e){return n(n([],a((0,o.createCustomTestJobs)(e)),false),a((0,i.createCustomBuildJobs)(e)),false)};t.createCustomJobs=createCustomJobs},390:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createCustomTestJobs=void 0;var o=r(2497);var s=r(4466);var p=r(2820);var l={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"};var createCustomTestJobs=function(e){var t,r,d,c,u,f,m,h,v,y,b,g,w,_,S,O,A,N,C;if(e.trigger==="taggedRelease"){return[]}var k=e.build.config;if(!(0,s.isOfBuildType)(k,"custom")){throw new Error("deploy config is not custom")}var T={variables:a(a({APP_PATH:e.build.dir},e.environment.jobOnlyVars.build.envVars),(t=k.extraVars)!==null&&t!==void 0?t:{}),runnerVariables:l,services:k.jobServices,cache:k.jobCache,stage:"test",needs:[],envMode:"none"};var D=k.audit?a(a(a({name:"🛡 audit"},T),{image:(d=(r=k.audit)===null||r===void 0?void 0:r.jobImage)!==null&&d!==void 0?d:k.jobImage,cache:undefined,script:i([],n((u=(0,o.ensureArray)((c=k.audit)===null||c===void 0?void 0:c.command))!==null&&u!==void 0?u:[]),false),allow_failure:true}),(0,p.createArtifactsConfig)(e.build.dir,(f=k.audit)===null||f===void 0?void 0:f.artifactsReports,(m=k.audit)===null||m===void 0?void 0:m.artifacts)):null;var I=k.lint?a(a(a({name:"👮 lint"},T),{image:(v=(h=k.lint)===null||h===void 0?void 0:h.jobImage)!==null&&v!==void 0?v:k.jobImage,script:i([],n((b=(0,o.ensureArray)((y=k.lint)===null||y===void 0?void 0:y.command))!==null&&b!==void 0?b:[]),false)}),(0,p.createArtifactsConfig)(e.build.dir,(g=k.lint)===null||g===void 0?void 0:g.artifactsReports,(w=k.lint)===null||w===void 0?void 0:w.artifacts)):null;var x=k.test?a(a(a({name:"🧪 test"},T),{image:(S=(_=k.test)===null||_===void 0?void 0:_.jobImage)!==null&&S!==void 0?S:k.jobImage,script:i([],n((A=(0,o.ensureArray)((O=k.test)===null||O===void 0?void 0:O.command))!==null&&A!==void 0?A:[]),false)}),(0,p.createArtifactsConfig)(e.build.dir,(N=k.test)===null||N===void 0?void 0:N.artifactsReports,(C=k.test)===null||C===void 0?void 0:C.artifacts)):null;return[D,I,x].filter(o.notNil)};t.createCustomTestJobs=createCustomTestJobs},9641:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.hasDockerfile=t.getDockerBuildDefaultScript=t.getDockerBuildScriptWithBuiltInDockerFile=t.gitlabDockerLogin=t.createDockerBuildJobBase=t.getDockerJobBaseProps=t.DOCKER_BUILD_JOB_NAME=t.getDockerBuildVariables=t.requiresDockerBuild=t.getDockerImageVariables=void 0;var p=r(7147);var l=r(3255);var d=s(r(1017));var c=r(8483);var u=r(4963);var f=r(6320);var m=r(4058);var h=r(8490);var v={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"2Gi"};var getDockerImageVariables=function(e){var t;var r=(t=e.deploy)===null||t===void 0?void 0:t.config;return a(a({},(0,c.isOfDeployType)(r,"google-cloudrun")?{DOCKER_REGISTRY:(0,u.getArtifactsRegistryHost)(e),DOCKER_IMAGE:(0,u.getArtifactsRegistryImageName)(e),DOCKER_CACHE_IMAGE:(0,u.getArtifactsRegistryBuildCacheImage)(e)}:{DOCKER_REGISTRY:"$CI_REGISTRY",DOCKER_CACHE_IMAGE:"$CI_REGISTRY_IMAGE/caches/"+e.name,DOCKER_IMAGE_NAME:e.env+"/"+e.name,DOCKER_IMAGE:"$CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME"}),{DOCKER_IMAGE_TAG:"$CI_COMMIT_SHA"})};t.getDockerImageVariables=getDockerImageVariables;var requiresDockerBuild=function(e){var t;var r=(t=e.deploy)===null||t===void 0?void 0:t.config;return(0,c.isOfDeployType)(r,"kubernetes","google-cloudrun","dockerTag")||(0,c.isOfDeployType)(r,"custom")&&r.requiresDocker};t.requiresDockerBuild=requiresDockerBuild;var getDockerBuildRunnerVariables=function(){return{DOCKER_HOST:"tcp://0.0.0.0:2375",DOCKER_TLS_CERTDIR:"",DOCKER_DRIVER:"overlay2",DOCKER_BUILDKIT:"1"}};var getDockerAdditions=function(e){var t,r;if(!("docker"in e))return{};if(!e.docker)return{};return{DOCKERFILE_ADDITIONS:"additionsBegin"in e.docker?(t=e.docker.additionsBegin)===null||t===void 0?void 0:t.join("\n"):undefined,DOCKERFILE_ADDITIONS_END:"additionsEnd"in e.docker?(r=e.docker.additionsEnd)===null||r===void 0?void 0:r.join("\n"):undefined}};var getDockerBuildVariables=function(e){var r;return a(a(a({},getDockerAdditions(e.build.config)),{APP_DIR:e.build.dir,DOCKER_BUILD_CONTEXT:"docker"in e.build.config&&e.build.config.docker&&"buildContextLocation"in e.build.config.docker&&((r=e.build.config.docker)===null||r===void 0?void 0:r.buildContextLocation)==="component"?e.build.dir:"."}),(0,t.getDockerImageVariables)(e))};t.getDockerBuildVariables=getDockerBuildVariables;t.DOCKER_BUILD_JOB_NAME="🔨 docker";var getDockerJobBaseProps=function(){return{image:(0,m.getRunnerImage)("docker-build"),services:[{name:"docker:24.0.6-dind",command:["--tls=false"]}],variables:{},runnerVariables:getDockerBuildRunnerVariables()}};t.getDockerJobBaseProps=getDockerJobBaseProps;var createDockerBuildJobBase=function(e,r){var i=r.script,o=n(r,["script"]);return(0,l.merge)(a(a({name:t.DOCKER_BUILD_JOB_NAME,envMode:"jobPerEnv",stage:"build"},(0,t.getDockerJobBaseProps)()),{script:i||[]}),{variables:(0,t.getDockerBuildVariables)(e),runnerVariables:a(a({},v),getDockerBuildRunnerVariables())},o)};t.createDockerBuildJobBase=createDockerBuildJobBase;var gitlabDockerLogin=function(e){return e.deploy&&(0,c.isOfDeployType)(e.deploy.config,"google-cloudrun")?o(o([],i((0,f.gcloudServiceAccountLoginCommands)(e)),false),["gcloud auth configure-docker ".concat((0,u.getArtifactsRegistryHost)(e))],false):["docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY"]};t.gitlabDockerLogin=gitlabDockerLogin;var y={meteor:"ensureMeteorDockerfile",node:"ensureNodeDockerfile",nginx:"ensureNginxDockerfile",custom:null};var getDockerBuildScriptWithBuiltInDockerFile=function(e,r){var a;var n="docker"in e.build.config&&e.build.config.docker&&"type"in e.build.config.docker?(a=e.build.config.docker)===null||a===void 0?void 0:a.type:r;return(0,t.getDockerBuildDefaultScript)(e,n?y[n]:null)};t.getDockerBuildScriptWithBuiltInDockerFile=getDockerBuildScriptWithBuiltInDockerFile;var getDockerBuildDefaultScript=function(e,r){return o(o(o([r!==null&&r!==void 0?r:undefined],i((0,h.collapseableSection)("docker-login","Docker Login")((0,t.gitlabDockerLogin)(e))),false),i((0,h.collapseableSection)("docker-build","Docker build")(["docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile $DOCKER_BUILD_CONTEXT --build-arg BUILDKIT_INLINE_CACHE=1"])),false),i((0,h.collapseableSection)("docker-push","Docker push and tag")(["docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG","docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE","docker push $DOCKER_CACHE_IMAGE"])),false).filter(Boolean)};t.getDockerBuildDefaultScript=getDockerBuildDefaultScript;var hasDockerfile=function(e){return(0,p.existsSync)(d.default.join(e.build.dir,"Dockerfile"))};t.hasDockerfile=hasDockerfile},7862:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});t.WORKSPACE_BUILD_TYPES=t.BUILD_TYPES=void 0;var i=r(1183);var o=r(5734);var s=r(8513);n(r(5734),t);n(r(4466),t);t.BUILD_TYPES={node:{jobs:o.createNodeJobs,defaults:function(){return{buildCommand:"yarn build",startCommand:"yarn start",artifactsPaths:["dist",".next"]}}},"node-static":{jobs:o.createNodeJobs,defaults:function(){return{buildCommand:"yarn build",artifactsPaths:["dist"]}}},storybook:{jobs:o.createStorybookJobs,defaults:function(){return{buildCommand:["yarn build-storybook --quiet -o ./dist"],artifactsPaths:["dist"]}}},meteor:{jobs:o.createMeteorJobs,defaults:function(){return{startCommand:"node main.js",artifactsPaths:["dist"]}}},custom:{jobs:i.createCustomJobs,defaults:function(){return{artifactsPaths:["dist"]}}},rails:{jobs:s.createRailsJobs,defaults:function(){return{startCommand:"/cnb/process/web",cnbBuilder:{image:"heroku/builder:22",packVersion:"0.32.1"}}}}};t.WORKSPACE_BUILD_TYPES={node:{jobs:o.createNodeJobs,defaults:function(){return{buildCommand:"yarn build",lint:{command:"yarn lint"},test:{command:"yarn test"}}}}}},8530:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createNodeDockerJobDefinition=t.createNodeBuildJobDefinition=t.createNodeBuildJobs=void 0;var i=r(4058);var o=r(1724);var s=r(2497);var p=r(9366);var l=r(9641);var d=r(4466);var c=r(2026);var u=r(1765);var f=r(5043);var createNodeBuildJobs=function(e){if(e.type==="workspace"){return(0,p.createWorkspaceBuildJobs)(e,{appBuild:(0,t.createNodeBuildJobDefinition)(e)})}return(0,p.createComponentBuildJobs)(e,{appBuild:(0,o.componentContextIsStandaloneBuild)(e)?(0,t.createNodeBuildJobDefinition)(e):undefined,dockerBuild:(0,t.createNodeDockerJobDefinition)(e)})};t.createNodeBuildJobs=createNodeBuildJobs;var createNodeBuildJobDefinition=function(e){var t,r,o;var p=e.build.config;if(!(0,d.isOfBuildType)(p,"node","node-static","storybook")){throw new Error("deploy config is not node, node-static or storybook")}if(p.buildCommand===null)return undefined;var l=(0,i.getRunnerImage)("jobs-default");var m=(0,f.getYarnInstall)(e);return{image:(t=p.jobImage)!==null&&t!==void 0?t:l,runnerVariables:u.NODE_RUNNER_BUILD_VARIABLES,cache:n(n(n([],a((r=(0,s.ensureArray)(p.jobCache))!==null&&r!==void 0?r:[]),false),a((0,c.getNodeCache)(e)),false),a((0,c.getNextCache)(e)),false),script:n(n([],a(m),false),a((o=(0,s.ensureArray)(p.buildCommand))!==null&&o!==void 0?o:[]),false),jobTags:p.jobTags}};t.createNodeBuildJobDefinition=createNodeBuildJobDefinition;var createNodeDockerJobDefinition=function(e){var t,r;var i=e.build.buildType==="node-static"||e.build.buildType==="storybook"?"nginx":"node";return{script:(0,l.getDockerBuildScriptWithBuiltInDockerFile)(e,i),cache:n([],a((0,c.getYarnCache)(e,"pull")),false),variables:{DOCKER_COPY_AND_INSTALL_APP:(0,f.getDockerAppCopyAndBuildScript)(e),DOCKER_COPY_WORKSPACE_FILES:(r=(t=e.packageManagerInfo)===null||t===void 0?void 0:t.pathsToCopyInDocker.map((function(e){return"COPY --chown=node:node ".concat(e," /app/").concat(e)})))===null||r===void 0?void 0:r.join("\n")}}};t.createNodeDockerJobDefinition=createNodeDockerJobDefinition},2026:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getWorkspaceDefaultCaches=t.getNextCache=t.getNodeCache=t.getNodeModulesCache=t.getYarnCache=void 0;var o=r(3255);var s=r(1017);var p=i(r(4035));var getYarnCache=function(e,t){if(t===void 0){t="pull-push"}var r=e.type==="component"&&e.packageManagerInfo.componentIsInWorkspace;return[r?{key:"yarn",policy:t,paths:[".yarn"]}:{key:(0,p.default)(e.build.dir)+"-yarn",policy:t,paths:[(0,s.join)(e.build.dir,".yarn")]}]};t.getYarnCache=getYarnCache;var getNodeModulesCache=function(e,t){var r;if(t===void 0){t="pull-push"}var i=e.type==="component"&&e.packageManagerInfo.componentIsInWorkspace;return[{key:i?"node-modules-workspace":(0,p.default)(e.build.dir)+"-node-modules",policy:t,paths:n([],a(i?(0,o.uniq)(n(["node_modules"],a((r=e.packageManagerInfo.workspaces.map((function(e){return(0,s.join)(e.location,"node_modules")})))!==null&&r!==void 0?r:[]),false)):[(0,s.join)(e.build.dir,"node_modules")]),false)}]};t.getNodeModulesCache=getNodeModulesCache;var getNodeCache=function(e,r){if(r===void 0){r="pull-push"}return n(n(n([],a((0,t.getYarnCache)(e,r)),false),a((0,t.getNodeModulesCache)(e,r)),false),a(e.type==="workspace"?(0,t.getWorkspaceDefaultCaches)(e):[]),false)};t.getNodeCache=getNodeCache;var getNextCache=function(e){var t=e.name+"-next-cache";var r=e.build.getComponentDirs("direct").map((function(e){return(0,s.join)(e,".next/cache")}));return[{key:t,policy:"pull-push",paths:r}]};t.getNextCache=getNextCache;var getWorkspaceDefaultCaches=function(e){return[{key:e.name+"-turbo",policy:"pull-push",paths:[(0,s.join)(e.build.dir,".turbo")]}]};t.getWorkspaceDefaultCaches=getWorkspaceDefaultCaches},1765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.NODE_RUNNER_BUILD_VARIABLES=void 0;t.NODE_RUNNER_BUILD_VARIABLES={KUBERNETES_CPU_REQUEST:"0.45",KUBERNETES_MEMORY_REQUEST:"1Gi",KUBERNETES_MEMORY_LIMIT:"4Gi"}},5734:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createMeteorJobs=t.createStorybookJobs=t.createNodeJobs=void 0;var i=r(8530);var o=r(1089);var s=r(8630);var createNodeJobs=function(e){return n(n([],a((0,s.createNodeTestJobs)(e)),false),a((0,i.createNodeBuildJobs)(e)),false)};t.createNodeJobs=createNodeJobs;var createStorybookJobs=function(e){return n([],a((0,i.createNodeBuildJobs)(e)),false)};t.createStorybookJobs=createStorybookJobs;var createMeteorJobs=function(e){return n(n([],a((0,s.createNodeTestJobs)(e)),false),a((0,o.createMeteorBuildJobs)(e)),false)};t.createMeteorJobs=createMeteorJobs},1089:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createMeteorBuildJobs=void 0;var i=r(1017);var o=r(4058);var s=r(9366);var p=r(9641);var l=r(4466);var d=r(2026);var c=r(5043);var getMeteorCache=function(e){return[{key:e.name+"meteor-build-cache",policy:"pull-push",paths:[(0,i.join)(e.build.dir,".meteor/local/resolver-result-cache.json"),(0,i.join)(e.build.dir,".meteor/local/plugin-cache"),(0,i.join)(e.build.dir,".meteor/local/isopacks"),(0,i.join)(e.build.dir,".meteor/local/bundler-cache/scanner")]}]};var createMeteorBuildJobs=function(e){var t=e.build.config;if(!(0,l.isOfBuildType)(t,"meteor")){throw new Error("deploy config is not meteor")}var r=(0,c.getYarnInstall)(e);return(0,s.createComponentBuildJobs)(e,{appBuild:t.buildCommand!==null?{cache:n(n([],a((0,d.getNodeCache)(e)),false),a(getMeteorCache(e)),false),image:(0,o.getRunnerImage)("jobs-meteor"),variables:{METEOR_DISABLE_OPTIMISTIC_CACHING:"1"},script:n(n([],a(r),false),['echo "add healthcheck package"',"meteor add panter:healthroute --allow-superuser","meteor add qualia:prod-shell --allow-superuser",'TOOL_NODE_FLAGS="--max_old_space_size=3584 --min_semi_space_size=8 --max_semi_space_size=256 --optimize_for_size" meteor build ./dist --architecture os.linux.x86_64 --allow-superuser --server-only --directory',"cp ./__build_info.json ./dist/bundle/programs/server"],false)}:undefined,dockerBuild:{script:(0,p.getDockerBuildScriptWithBuiltInDockerFile)(e,"meteor"),variables:{METEOR_INSTALL_SCRIPTS:t.installScripts?"true":""}}})};t.createMeteorBuildJobs=createMeteorBuildJobs},8630:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createNodeTestJobs=void 0;var o=r(4058);var s=r(1724);var p=r(2497);var l=r(2820);var d=r(2026);var c=r(1765);var u=r(5043);var createNodeTestJobs=function(e){var t,r,f,m,h,v,y,b,g,w,_,S,O,A,N,C,k,T,D;if(e.trigger==="taggedRelease"){return[]}if(e.type==="component"&&!(0,s.componentContextIsStandaloneBuild)(e)){return[]}var I=(0,o.getRunnerImage)("jobs-default");var x={variables:a({APP_PATH:e.build.dir},e.type==="component"?a(a({},e.environment.jobOnlyVars.build.envVars),(t=e.build.config.extraVars)!==null&&t!==void 0?t:{}):{}),runnerVariables:c.NODE_RUNNER_BUILD_VARIABLES,stage:"test",needs:[],envMode:"none"};var P=e.build.config;var j=(0,u.getYarnInstall)(e);var L=P.audit!==false?a(a(a({name:"🛡 audit"},x),{image:(f=(r=P.audit)===null||r===void 0?void 0:r.jobImage)!==null&&f!==void 0?f:I,cache:undefined,script:i(["cd ".concat(e.build.dir)],n((h=(0,p.ensureArray)((m=P.audit)===null||m===void 0?void 0:m.command))!==null&&h!==void 0?h:[e.packageManagerInfo.isClassic?"yarn audit":"yarn npm audit --environment production"]),false),allow_failure:true}),(0,l.createArtifactsConfig)(e.build.dir,(v=P.audit)===null||v===void 0?void 0:v.artifactsReports,(y=P.audit)===null||y===void 0?void 0:y.artifacts)):null;var R=P.lint!==false?a(a(a({name:"👮 lint"},x),{image:(g=(b=P.lint)===null||b===void 0?void 0:b.jobImage)!==null&&g!==void 0?g:I,cache:(0,d.getNodeCache)(e),script:i(i(i(i([],n((0,u.ensureNodeVersion)(e)),false),["cd ".concat(e.build.dir)],false),n(j),false),n((_=(0,p.ensureArray)((w=P.lint)===null||w===void 0?void 0:w.command))!==null&&_!==void 0?_:["yarn lint"]),false)}),(0,l.createArtifactsConfig)(e.build.dir,(S=P.lint)===null||S===void 0?void 0:S.artifactsReports,(O=P.lint)===null||O===void 0?void 0:O.artifacts)):null;var B=P.test!==false?a(a(a({name:"🧪 test"},x),{image:(N=(A=P.test)===null||A===void 0?void 0:A.jobImage)!==null&&N!==void 0?N:(0,o.getRunnerImage)("jobs-testing-chrome"),cache:(0,d.getNodeCache)(e),script:i(i(i(i([],n((0,u.ensureNodeVersion)(e)),false),["cd ".concat(e.build.dir)],false),n(j),false),n((k=(0,p.ensureArray)((C=P.test)===null||C===void 0?void 0:C.command))!==null&&k!==void 0?k:["yarn test"]),false)}),(0,l.createArtifactsConfig)(e.build.dir,(T=P.test)===null||T===void 0?void 0:T.artifactsReports,(D=P.test)===null||D===void 0?void 0:D.artifacts)):null;return[L,R,B].filter(p.notNil)};t.createNodeTestJobs=createNodeTestJobs},5043:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getDockerAppCopyAndBuildScript=t.getYarnInstall=t.ensureNodeVersion=void 0;var i=r(2376);var o=r(2497);var s=r(8490);var p="yarn install --frozen-lockfile";var l="yarn workspaces focus --production && yarn rebuild";var getYarnInstallCommand=function(e){if(e.packageManagerInfo.isClassic){return p}return"yarn install --immutable"};var ensureNodeVersion=function(e){return(0,s.collapseableSection)("nodeinstall","Ensure node version")(["if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi","if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi"])};t.ensureNodeVersion=ensureNodeVersion;var getYarnInstall=function(e,r){var i;var p=e.type!=="workspace"&&"postInstall"in e.build.config?e.build.config.postInstall:null;return n(n(n([],a((0,t.ensureNodeVersion)(e)),false),a((0,s.collapseableSection)("yarninstall","Yarn install")([getYarnInstallCommand(e)])),false),a(p&&!(r===null||r===void 0?void 0:r.noCustomPostInstall)?(0,s.collapseableSection)("postinstall","Custom post install")((i=(0,o.ensureArray)(p))!==null&&i!==void 0?i:[]):[]),false)};t.getYarnInstall=getYarnInstall;var d="COPY --chown=node:node $APP_DIR .";var getDockerAppCopyAndBuildScript=function(e){if(e.packageManagerInfo.isClassic){return new i.BashExpression("\nRUN ".concat(p," --production --ignore-scripts\n").concat(d,"\nRUN ").concat(p," --production \n ").trim())}var t=["2","3"].some((function(t){return e.packageManagerInfo.version.startsWith(t)}));var r=t?"RUN yarn plugin import workspace-tools":"";return new i.BashExpression("\n".concat(d,"\n").concat(r,"\nRUN ").concat(l,"\n\n ").trim())};t.getDockerAppCopyAndBuildScript=getDockerAppCopyAndBuildScript},7261:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createRailsBuildJobs=void 0;var o=r(603);var s=r(9366);var p=r(9641);var l=r(4466);var createRailsBuildJobs=function(e){var t,r,d;var c=e.build.config;if(!(0,l.isOfBuildType)(c,"rails")){throw new Error("build type is not rails")}if(!(0,o.componentContextIsStandaloneBuild)(e)){throw new Error("workspace builds are not supported for rails apps")}if((0,p.hasDockerfile)(e)){return(0,s.createComponentBuildJobs)(e,{appBuild:undefined,dockerBuild:{script:(0,p.getDockerBuildDefaultScript)(e),variables:{}}})}var u=c.cnbBuilder;var f=Object.entries((t=u===null||u===void 0?void 0:u.buildVars)!==null&&t!==void 0?t:{}).map((function(e){var t=n(e,2),r=t[0],a=t[1];return"--env '".concat(r).concat(a?"=".concat(a):"","'")})).join(" ");return(0,s.createComponentBuildJobs)(e,{appBuild:undefined,dockerBuild:{variables:a(a({},e.environment.jobOnlyVars.build.envVars),e.build.config.extraVars),script:i(i([],n((0,p.gitlabDockerLogin)(e)),false),["cd ".concat(e.build.dir),"docker pull $DOCKER_CACHE_IMAGE || true","wget --output-document=- https://github.com/buildpacks/pack/releases/download/v".concat(u===null||u===void 0?void 0:u.packVersion,"/pack-v").concat(u===null||u===void 0?void 0:u.packVersion,"-linux.tgz | tar -zx --directory /usr/local/bin pack"),"chmod +x /usr/local/bin/pack","sed --in-place 's|git@\\([^:]*\\):|https://\\1/|g' Gemfile Gemfile.lock",'pack build "$DOCKER_IMAGE:$DOCKER_IMAGE_TAG" --builder \''.concat(u===null||u===void 0?void 0:u.image,'\' --publish --cache-image "$DOCKER_CACHE_IMAGE" ').concat(f," ").concat((d=(r=u===null||u===void 0?void 0:u.packExtraArgs)===null||r===void 0?void 0:r.join(" "))!==null&&d!==void 0?d:"")],false)}})};t.createRailsBuildJobs=createRailsBuildJobs},8513:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createRailsJobs=void 0;var i=r(7261);var o=r(7910);var createRailsJobs=function(e){return n(n([],a((0,o.createRailsTestJobs)(e)),false),a((0,i.createRailsBuildJobs)(e)),false)};t.createRailsJobs=createRailsJobs},7910:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createRailsTestJobs=void 0;var o=r(603);var s=r(2497);var createRailsTestJobs=function(e){var t,r,p,l,d,c,u,f,m,h,v,y,b,g,w,_;if(e.trigger==="taggedRelease"){return[]}if(!(0,o.componentContextIsStandaloneBuild)(e)){return[]}var S=e.build.config;var O={variables:a(a({},e.environment.jobOnlyVars.build.envVars),(t=S.extraVars)!==null&&t!==void 0?t:{}),stage:"test",needs:[],envMode:"none"};var A="docker.io/ruby";var N="tmp/cache";var C=["bundle config set path '".concat(N,"'"),"bundle install -j $(nproc)"];var k={key:{files:["Gemfile.lock"],prefix:"$CI_JOB_IMAGE"},paths:[N]};var T=S.audit!==false?a(a({name:"🛡 audit"},O),{cache:undefined,image:(l=(p=(r=S.audit)===null||r===void 0?void 0:r.jobImage)!==null&&p!==void 0?p:S.jobImage)!==null&&l!==void 0?l:A,script:i(["cd ".concat(e.build.dir)],n((c=(0,s.ensureArray)((d=S.audit)===null||d===void 0?void 0:d.command))!==null&&c!==void 0?c:["gem install bundler-audit","bundle audit check"]),false),allow_failure:true}):null;var D=S.lint!==false?a(a({name:"👮 lint"},O),{cache:k,image:(m=(f=(u=S.lint)===null||u===void 0?void 0:u.jobImage)!==null&&f!==void 0?f:S.jobImage)!==null&&m!==void 0?m:A,script:i(i(["cd ".concat(e.build.dir)],n(C),false),n((v=(0,s.ensureArray)((h=S.lint)===null||h===void 0?void 0:h.command))!==null&&v!==void 0?v:["bundle exec rubocop"]),false)}):null;var I=S.test!==false?a(a({name:"🧪 test"},O),{cache:k,image:(g=(b=(y=S.test)===null||y===void 0?void 0:y.jobImage)!==null&&b!==void 0?b:S.jobImage)!==null&&g!==void 0?g:A,script:i(i(["cd ".concat(e.build.dir)],n(C),false),n((_=(0,s.ensureArray)((w=S.test)===null||w===void 0?void 0:w.command))!==null&&_!==void 0?_:["bundle exec rspec"]),false)}):null;return[T,D,I].filter(s.notNil)};t.createRailsTestJobs=createRailsTestJobs},7038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createSbomBuildJob=t.SBOM_FILE=t.SBOM_BUILD_JOB_NAME=void 0;var a=r(7862);var n=r(2497);t.SBOM_BUILD_JOB_NAME="🧾 sbom";t.SBOM_FILE="__sbom.json";var createSbomBuildJob=function(e){var r,i,o,s;var p=e.build.config;var l="aquasec/trivy:0.38.3";var d=['trivy fs --quiet --format cyclonedx --output "'.concat(t.SBOM_FILE,'" ').concat(e.packageManagerInfo.componentIsInWorkspace?".":e.build.dir)];var c=(0,a.isStandaloneBuildConfig)(p)&&p.type==="custom"&&p.sbom!==false?(i=(r=p.sbom)===null||r===void 0?void 0:r.jobImage)!==null&&i!==void 0?i:l:l;var u=(0,a.isStandaloneBuildConfig)(p)&&p.type==="custom"&&p.sbom!==false?(s=(0,n.ensureArray)((o=p.sbom)===null||o===void 0?void 0:o.command))!==null&&s!==void 0?s:d:d;return{name:t.SBOM_BUILD_JOB_NAME,stage:"build",envMode:"jobPerEnv",variables:{},cache:undefined,image:c,script:u,allow_failure:true,artifacts:{paths:[t.SBOM_FILE]}}};t.createSbomBuildJob=createSbomBuildJob},4466:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isOfBuildType=t.isStandaloneBuildConfig=void 0;var isStandaloneBuildConfig=function(e){if(!e)return false;return!("from"in e)};t.isStandaloneBuildConfig=isStandaloneBuildConfig;var isOfBuildType=function(e){var r=[];for(var a=1;a<arguments.length;a++){r[a-1]=arguments[a]}if(!(0,t.isStandaloneBuildConfig)(e))return false;return r.includes(e.type)};t.isOfBuildType=isOfBuildType},9609:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getAllEnvsByTrigger=t.getAllEnvsInAllComponents=t.getAllEnvs=void 0;var i=r(1853);var getConfiguredAndDefaultEnvs=function(e,t,r){var i,o;var s=(i=e.components[t].env)!==null&&i!==void 0?i:{};var p=r.filter((function(e){return s[e]!==false}));var l=Object.entries((o=e.components[t].env)!==null&&o!==void 0?o:{}).filter((function(e){var t=a(e,2),n=t[1];return n&&"type"in n&&n.type&&r.includes(n.type)})).map((function(e){var t=a(e,1),r=t[0];return r}));return n([],a(new Set(n(n([],a(p),false),a(l),false))),false)};var getAllEnvs=function(e,t){return getConfiguredAndDefaultEnvs(e,t,i.DEFAULT_ENV_TYPES)};t.getAllEnvs=getAllEnvs;var getAllEnvsInAllComponents=function(e){return n([],a(new Set(Object.keys(e.components).flatMap((function(r){return(0,t.getAllEnvs)(e,r)})))),false)};t.getAllEnvsInAllComponents=getAllEnvsInAllComponents;var getAllEnvsByTrigger=function(e,t,r){var a=(0,i.getEnvTypesByTrigger)(r);return getConfiguredAndDefaultEnvs(e,t,a)};t.getAllEnvsByTrigger=getAllEnvsByTrigger},3352:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});n(r(9609),t);n(r(501),t)},501:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.readConfig=void 0;var s=r(7147);var p=r(8186);var l=r(8033);var fullPath=function(e,t){return e+"/catladder."+t};var readConfig=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return a(void 0,o([],i(e),false),void 0,(function(e){var t,r,a,i;if(e===void 0){e=process.cwd()}return n(this,(function(n){switch(n.label){case 0:t=["ts","js","yml","yaml"].find((function(t){return(0,s.existsSync)(fullPath(e,t))}));if(!t)return[3,3];r=fullPath(e,t);if(!(t==="ts"||t==="js"))return[3,2];return[4,p.require(r,e)];case 1:a=n.sent();i=a.default.default||a.default;return[2,{path:r,ext:t,config:i}];case 2:return[2,{path:r,ext:t,config:(0,l.parse)((0,s.readFileSync)(r,{encoding:"utf-8"}))}];case 3:return[2,null]}}))}))};t.readConfig=readConfig},2898:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DOCKER_REGISTRY=t.PIPELINE_IMAGE_TAG=void 0;t.PIPELINE_IMAGE_TAG=process.env.INLINE_PIPELINE_IMAGE_TAG||"latest";t.DOCKER_REGISTRY=process.env.INLINE_DOCKER_REGISTRY||"git.panter.ch:5001/catladder/catladder"},8375:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});t.createAllComponentsContext=void 0;var i=r(9609);var o=r(2775);var createAllComponentsContext=function(e){return a(void 0,[e],void 0,(function(e){var t=e.config,r=e.trigger,s=e.pipelineType;return n(this,(function(e){switch(e.label){case 0:return[4,Promise.all(Object.keys(t.components).flatMap((function(e){var p=(0,i.getAllEnvsByTrigger)(t,e,r);return p.map((function(i){return a(void 0,void 0,void 0,(function(){return n(this,(function(a){switch(a.label){case 0:return[4,(0,o.createComponentContext)({config:t,componentName:e,env:i,trigger:r,pipelineType:s})];case 1:return[2,a.sent()]}}))}))}))})))];case 1:return[2,e.sent()]}}))}))};t.createAllComponentsContext=createAllComponentsContext},2775:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var s=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createComponentContext=void 0;var p=r(3255);var l=r(7862);var d=r(8483);var c=r(6451);var u=r(2497);var f=r(5699);var m=r(3663);var createComponentContext=function(e){return n(void 0,void 0,void 0,(function(){var t,r,n,h,v,y,b,g,w,_,S,O,A,N,C,k;var T;return i(this,(function(i){switch(i.label){case 0:if(!/^[a-z0-9-]+$/.test(e.componentName)){throw new Error("componentName may only contain lower case letters, numbers and -")}return[4,(0,c.getPackageManagerInfoForComponent)(e.config,e.componentName)];case 1:t=i.sent();r=(0,m.getEnvironmentContext)(e);n=r.envConfigRaw;h=(0,l.isStandaloneBuildConfig)(n.build)?n.build.type:(T=e.config.builds)===null||T===void 0?void 0:T[n.build.from].type;if(!h){throw new Error("build type not found, is the build config correct?")}v=n.deploy?{build:l.BUILD_TYPES[h].defaults(r),deploy:d.DEPLOY_TYPES[n.deploy.type].defaults(r)}:{build:l.BUILD_TYPES[h].defaults(r),deploy:{}};y=(0,u.mergeWithMergingArrays)(v,n);return[4,(0,f.getEnvironment)(e)];case 2:b=i.sent();g=y.deploy,w=y.build,_=y.customJobs,S=y.dir;O=function(e){var r;return s([S],o(e==="all"?(r=t.currentWorkspaceDependencies)!==null&&r!==void 0?r:[]:[]),false)};A=function(){var t;if((0,l.isStandaloneBuildConfig)(w)){return{dir:S,getComponentDirs:O,config:w,buildType:w.type,type:"standalone"}}var r=(t=e.config.builds)===null||t===void 0?void 0:t[w.from];if(!r){throw new Error("build.from not found in config")}return{dir:S,getComponentDirs:O,config:w,workspaceBuildConfig:r,workspaceName:w.from,buildType:r.type,type:"fromWorkspace"}};N=A();C={type:"component",name:e.componentName,componentName:e.componentName,env:e.env,fullConfig:e.config,componentConfig:y,build:N,deploy:g?{config:g}:null,environment:b,packageManagerInfo:t,pipelineType:e.pipelineType,trigger:e.trigger};k=(0,p.isFunction)(_)?_(C):_;return[2,a(a({},C),{customJobs:k})]}}))}))};t.createComponentContext=createComponentContext},6558:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});t.createWorkspaceContext=void 0;var i=r(603);var o=r(6451);var s=r(2497);var p=r(3255);function createWorkspaceContext(e){return a(this,arguments,void 0,(function(e){var t,r,a;var l;var d,c;var u=e.env,f=e.components,m=e.workspaceName,h=e.config,v=e.pipelineType,y=e.trigger;return n(this,(function(e){switch(e.label){case 0:t=(d=h.builds)===null||d===void 0?void 0:d[m];if(!t){throw new Error("Workspace ".concat(m," not found in config"))}r=i.WORKSPACE_BUILD_TYPES[t.type].defaults();a=(0,s.mergeWithMergingArrays)(r,t);l={name:m,pipelineType:v,trigger:y,type:"workspace",workspaceConfig:a,env:u,components:f,fullConfig:h};return[4,(0,o.getPackageManagerInfoBase)()];case 1:return[2,(l.packageManagerInfo=e.sent(),l.build={type:"workspace",dir:(c=a.dir)!==null&&c!==void 0?c:".",getComponentDirs:function(e){return(0,p.uniq)(f.flatMap((function(t){return t.build.getComponentDirs(e)})))},buildType:a.type,config:a},l)]}}))}))}t.createWorkspaceContext=createWorkspaceContext},7827:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.getBuildInfoVariables=t.ALL_BUILD_VARIABLES=void 0;var n=r(2376);var i=r(612);var o={BUILD_INFO_BUILD_ID:{default:new n.BashExpression("$(git describe --tags 2>/dev/null || git rev-parse HEAD)")},BUILD_INFO_BUILD_TIME:{default:"unknown-build-time",gitlab:new n.BashExpression("$CI_JOB_STARTED_AT")},BUILD_INFO_CURRENT_VERSION:{default:new n.BashExpression('$(tag=$(git ls-remote origin "refs/tags/v*[0-9]" 2>/dev/null | cut -f 2- | sort -V | tail -1 | sed \'s/refs\\/tags\\/v//\'); [ -z "$tag" ] && echo "0.0.0" || echo "$tag")')}};t.ALL_BUILD_VARIABLES=Object.keys(o);var getBuildInfoVariables=function(e){var t=e.pipelineType;return Object.fromEntries(Object.entries(o).map((function(e){var r=a(e,2),n=r[0],o=r[1];return[n,(0,i.getBashExpressionPerPipelineType)(o,t)]})))};t.getBuildInfoVariables=getBuildInfoVariables},6476:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvConfig=void 0;var a=r(2497);var getEnvConfig=function(e,t,r){var n,i;var o=e.components[t];if(!o){throw new Error("unknown component "+t)}var s=(i=(n=o.env)===null||n===void 0?void 0:n[r])!==null&&i!==void 0?i:{};if(s===false){throw new Error("env is disabled: "+r+":"+t)}return(0,a.mergeWithMergingArrays)(o,s)};t.getEnvConfig=getEnvConfig},1593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvType=void 0;var a=r(1853);var getEnvType=function(e,t){if(t.type)return t.type;if((0,a.isKnowEnvType)(e)){return e}throw new Error("unknown env type: "+e)};t.getEnvType=getEnvType},5699:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});t.getEnvironment=void 0;var o=r(3663);var s=r(5133);var getEnvironment=function(e){return n(void 0,void 0,void 0,(function(){var t,r,n,p;return i(this,(function(i){switch(i.label){case 0:t=e.env;return[4,(0,s.getEnvironmentVariables)(e)];case 1:r=i.sent();n=(0,o.getEnvironmentContext)(e);p=n.envType;return[2,a({envType:p,fullName:n.fullName,slugPrefix:n.environmentSlugPrefix,reviewSlug:n.reviewSlug,slug:n.environmentSlug,shortName:t},r)]}}))}))};t.getEnvironment=getEnvironment},3663:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getEnvironmentContext=void 0;var a=r(2376);var n=r(6476);var i=r(1593);var o=r(4993);var getEnvironmentSlugPrefix=function(e,t){if(t){return(0,a.joinBashExpressions)([e,t],"-")}return e};var getEnvironmentContext=function(e){var t=e.env,r=e.componentName,s=e.config,p=e.pipelineType;var l=(0,n.getEnvConfig)(s,r,t);var d=(0,i.getEnvType)(t,l);var c=(0,o.getReviewSlug)(l,t,p);var u=getEnvironmentSlugPrefix(t,c);var f=u.concat("-".concat(r));var m=(0,a.joinBashExpressions)([s.customerName,s.appName,f],"-");return{envConfigRaw:l,deployConfigRaw:l.deploy,buildConfigRaw:l.build,environmentSlugPrefix:u,environmentSlug:f,reviewSlug:c,pipelineType:p,fullName:m,envType:d,componentName:r,env:t,fullConfig:s}};t.getEnvironmentContext=getEnvironmentContext},5133:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var s=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getSecretVarNameForContext=t.getSecretVarName=t.getEnvironmentVariables=void 0;var p=r(3255);var l=r(8483);var d=r(2376);var c=r(4466);var u=r(7827);var f=r(3663);var m=r(3115);var h=r(1552);var v=r(6296);var getBasePredefinedVariables=function(e){return a({ENV_SHORT:e.env,APP_DIR:e.envConfigRaw.dir,ENV_TYPE:e.envType},e.envType!=="local"?(0,u.getBuildInfoVariables)(e):{})};var getEnvironmentVariables=function(e){var r=[];for(var u=1;u<arguments.length;u++){r[u-1]=arguments[u]}return n(void 0,s([e],o(r),false),void 0,(function(e,r){var u,y,b,g,w,_,S,O,A,N,C,k,T,D,I,x,P,j,L,R,B,M,V,U,$;var q,W;var K,G,J,Y,z,H,Q,X,Z;if(r===void 0){r={}}return i(this,(function(ee){switch(ee.label){case 0:u=(0,f.getEnvironmentContext)(e);y=e.config,b=e.env,g=e.componentName;w=u.envConfigRaw,_=u.deployConfigRaw,S=u.buildConfigRaw,O=u.envType;A=getBasePredefinedVariables(u);if(O==="local"){T=w;D=(K=T.port)!==null&&K!==void 0?K:3e3;C="localhost:"+D.toString();k="http://"+C;N=a(a(a(a({},A),{ENV_SHORT:"local",ROOT_URL:k}),(0,c.isStandaloneBuildConfig)(S)&&S.type==="rails"?{}:{HOST:C}),{HOST_INTERNAL:C,ROOT_URL_INTERNAL:"http://"+C,PORT:D.toString()})}else{I=_?l.DEPLOY_TYPES[_.type].getAdditionalEnvVars(u):{};x=(G=I.HOST_INTERNAL)!==null&&G!==void 0?G:"unknown-host.example.com";C=(J=w===null||w===void 0?void 0:w.host)!==null&&J!==void 0?J:x;k=(0,d.joinBashExpressions)(["https://",C]);N=a(a(a(a({},A),(0,c.isStandaloneBuildConfig)(S)&&S.type==="rails"?{}:{HOST:C}),{ROOT_URL:k,HOST_INTERNAL:x,HOST_CANONICAL:x,ROOT_URL_INTERNAL:(0,d.joinBashExpressions)(["https://",x])}),I)}P=(z=(Y=w.vars)===null||Y===void 0?void 0:Y.public)!==null&&z!==void 0?z:{};j=_?l.DEPLOY_TYPES[_.type].additionalSecretKeys(u):[];L=s(s([],o((0,v.stringListToSecreteEnvVarList)((Q=(H=w.vars)===null||H===void 0?void 0:H.secret)!==null&&Q!==void 0?Q:[])),false),o(j),false);R=(0,v.makeSecretEnvVarMapping)(b,g,L);B=(Z=(X=w.vars)===null||X===void 0?void 0:X.fromComponents)!==null&&Z!==void 0?Z:{};M=(0,p.merge)({},(0,m.translateLegacyFromComponents)(B),P);V=(0,v.stringifyValues)(M);U=addIndexVar(a(a(a({},N),R),V));return[4,(0,m.resolveReferences)(U,(function(r,o){return n(void 0,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.getEnvironmentVariables)(a(a({},e),{componentName:r}),o)];case 1:n=i.sent().envVars;return[2,n]}}))}))}),r)];case 1:$=ee.sent();q={envVars:$,secretEnvVarKeys:L};W={};return[4,(0,h.transformJobOnlyVars)(b,g,S&&(0,c.isStandaloneBuildConfig)(S)&&S.jobVars||null)];case 2:W.build=ee.sent();return[4,(0,h.transformJobOnlyVars)(b,g,_&&_.jobVars||null)];case 3:return[2,(q.jobOnlyVars=(W.deploy=ee.sent(),W),q.host=C,q.url=k,q)]}}))}))};t.getEnvironmentVariables=getEnvironmentVariables;var sanitizeForEnVar=function(e){return e.replace(/-/g,"_")};var getSecretVarName=function(e,t,r){return"CL_".concat(sanitizeForEnVar(e),"_").concat(sanitizeForEnVar(t),"_").concat(r)};t.getSecretVarName=getSecretVarName;var addIndexVar=function(e){return a(a({},e),{_ALL_ENV_VAR_KEYS:JSON.stringify(Object.keys(e))})};var getSecretVarNameForContext=function(e,r){return(0,t.getSecretVarName)(e.env,e.name,r)};t.getSecretVarNameForContext=getSecretVarNameForContext},920:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getLabels=void 0;var i=n(r(4035));var sanitize=function(e){if(!e)return e;return(0,i.default)(e).toLowerCase()};var getLabels=function(e){var t,r;var n=a({"customer-name":sanitize(e.fullConfig.customerName),"component-name":sanitize(e.name),"app-name":sanitize(e.fullConfig.appName),"env-type":sanitize(e.environment.envType),"env-name":sanitize(e.env),"build-type":sanitize(e.build.buildType)},(r=(t=e.fullConfig.meta)===null||t===void 0?void 0:t.labels)!==null&&r!==void 0?r:{});return n};t.getLabels=getLabels},4993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getReviewSlug=void 0;var a=r(2376);var n=r(612);var i=r(1593);var o={default:"unknown-review-slug",gitlab:new a.BashExpression('$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })')};var getReviewSlug=function(e,t,r){var a=(0,i.getEnvType)(t,e);if(a==="review"){return(0,n.getBashExpressionPerPipelineType)(o,r)}return null};t.getReviewSlug=getReviewSlug},5875:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});n(r(2775),t);n(r(5699),t);n(r(5133),t)},3115:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.translateLegacyFromComponents=t.resolveReferences=void 0;var p=r(3255);var l=s(r(2233));var d=/\$\{(([^:}]+):)?([^}]+)}/gm;var resolveReferences=function(e,t){var r=[];for(var s=2;s<arguments.length;s++){r[s-2]=arguments[s]}return a(void 0,o([e,t],i(r),false),void 0,(function(e,t,r){var s,c,u;if(r===void 0){r={}}return n(this,(function(f){switch(f.label){case 0:s=function(c){var u=[];for(var f=1;f<arguments.length;f++){u[f-1]=arguments[f]}return a(void 0,o([c],i(u),false),void 0,(function(i,o){if(o===void 0){o=r}return n(this,(function(r){switch(r.label){case 0:if(!d.test(i.toString()))return[3,2];return[4,(0,l.default)(i,d,(function(r,i,l,d){return a(void 0,void 0,void 0,(function(){var a,i,c,u,f;var m,h;var v,y;return n(this,(function(n){switch(n.label){case 0:if((v=o[l])===null||v===void 0?void 0:v[d]){return[2,r]}a=(0,p.merge)({},o,(m={},m[l]=(h={},h[d]=true,h),m));if(!l)return[3,2];return[4,t===null||t===void 0?void 0:t(l,a).then((function(e){return e===null||e===void 0?void 0:e[d]}))];case 1:c=(y=n.sent())!==null&&y!==void 0?y:null;return[3,3];case 2:c=e[d];n.label=3;case 3:i=c;if(!(i!==null&&i!==undefined))return[3,5];return[4,s(i,a)];case 4:f=n.sent();return[3,6];case 5:f=r;n.label=6;case 6:u=f;return[2,u]}}))}))}))];case 1:return[2,r.sent()];case 2:return[2,i]}}))}))};u=(c=Object).fromEntries;return[4,Promise.all(Object.entries(e).map((function(e){return a(void 0,[e],void 0,(function(e){var t,r;var a=i(e,2),o=a[0],p=a[1];return n(this,(function(e){switch(e.label){case 0:if(p===null||p===undefined){return[2,[o,null]]}t=[o];if(!(p!==null&&p!==undefined))return[3,2];return[4,s(p)];case 1:r=e.sent();return[3,3];case 2:r=null;e.label=3;case 3:return[2,t.concat([r])]}}))}))})))];case 1:return[2,u.apply(c,[f.sent()])]}}))}))};t.resolveReferences=resolveReferences;var translateLegacyFromComponents=function(e){return Object.fromEntries(Object.entries(e).flatMap((function(e){var t=i(e,2),r=t[0],a=t[1];return Object.entries(a).map((function(e){var t=i(e,2),a=t[0],n=t[1];return[a,"${"+r+":"+n+"}"]}))})))};t.translateLegacyFromComponents=translateLegacyFromComponents},1552:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});t.transformJobOnlyVars=void 0;var o=r(6296);var transformJobOnlyVars=function(e,t,r){return n(void 0,void 0,void 0,(function(){var n,s,p,l;var d,c;return i(this,(function(i){if(!r){return[2,{envVars:{},secretEnvVarKeys:[]}]}n=(0,o.stringifyValues)((d=r===null||r===void 0?void 0:r.public)!==null&&d!==void 0?d:{});s=(0,o.stringListToSecreteEnvVarList)((c=r===null||r===void 0?void 0:r.secret)!==null&&c!==void 0?c:[]);p=(r===null||r===void 0?void 0:r.secret)?(0,o.makeSecretEnvVarMapping)(e,t,s):{};l=a(a({},p),n);return[2,{envVars:l,secretEnvVarKeys:s}]}))}))};t.transformJobOnlyVars=transformJobOnlyVars},6296:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.makeSecretEnvVarMapping=t.stringListToSecreteEnvVarList=t.stringifyValues=void 0;var n=r(3255);var i=r(5133);var o=r(2376);var stringifyValues=function(e){return Object.fromEntries(Object.entries(e).map((function(e){var t=a(e,2),r=t[0],i=t[1];return[r,(0,n.isObject)(i)?JSON.stringify(i):"".concat(i)]})))};t.stringifyValues=stringifyValues;var stringListToSecreteEnvVarList=function(e){return e.map((function(e){return{key:e}}))};t.stringListToSecreteEnvVarList=stringListToSecreteEnvVarList;var makeSecretEnvVarMapping=function(e,t,r){return Object.fromEntries(r.map((function(r){var a=r.key;return[a,(0,o.getBashVariable)((0,i.getSecretVarName)(e,t,a))]})))};t.makeSecretEnvVarMapping=makeSecretEnvVarMapping},6484:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BASE_RETRY=void 0;t.BASE_RETRY={max:2,when:["runner_system_failure","stuck_or_timeout_failure"]}},1421:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createDeployJob=t.DEPLOY_JOB_NAME=void 0;var o=r(9641);var s=r(7038);var p=r(1724);var l=r(4986);var d=r(6054);var c=r(2846);var u=r(2422);t.DEPLOY_JOB_NAME="🚀 Deploy";var createDeployJob=function(e,r){var f,m,h,v,y,b,g;var w=(0,o.requiresDockerBuild)(e);var _=(0,d.contextIsStoppable)(e);var S=e.environment.envType==="review"?"1 week":e.environment.envType==="dev"?"4 weeks":undefined;var O=(f=e.deploy)===null||f===void 0?void 0:f.config;var A=O&&O.when?O.when:undefined;var N=e.environment.envType!=="prod"?"auto":((m=e.componentConfig.env)===null||m===void 0?void 0:m.stage)===false?"auto":"manual";var C=A?A:N;return{name:t.DEPLOY_JOB_NAME,script:r.script,image:r.image,cache:r.cache,artifacts:r.artifacts,services:r.services,envMode:"stagePerEnv",needs:i(i([],n((0,l.sbomDeactivated)(e)?[]:[{job:s.SBOM_BUILD_JOB_NAME,artifacts:true}]),false),n(O?(v=(h=O.waitFor)===null||h===void 0?void 0:h.map((function(e){return{componentName:e,job:t.DEPLOY_JOB_NAME,artifacts:false}})))!==null&&v!==void 0?v:[]:[]),false),needsStages:i(i([],n((0,p.componentContextHasWorkspaceBuild)(e)?w?[{stage:"build",artifacts:false}]:[{stage:"build",artifacts:true,workspaceName:e.build.workspaceName}]:[{stage:"build",artifacts:w?false:true}]),false),[{stage:"test",artifacts:false,workspaceName:(0,p.componentContextHasWorkspaceBuild)(e)?e.build.workspaceName:undefined}],false),when:C==="auto"?"on_success":"manual",allow_failure:C==="manual"?true:false,stage:"deploy",variables:a(a(a(a(a({},e.environment.envVars),w?(0,o.getDockerImageVariables)(e):{}),e.environment.jobOnlyVars.deploy.envVars),O?(y=O.extraVars)!==null&&y!==void 0?y:{}:{}),r.variables),runnerVariables:a(a(a({},u.DEPLOY_RUNNER_VARIABLES),(b=r.runnerVariables)!==null&&b!==void 0?b:{}),O?(g=O.runnerVariables)!==null&&g!==void 0?g:{}:{}),environment:_?{on_stop:c.STOP_JOB_NAME,auto_stop_in:S}:undefined,jobTags:O?O.jobTags:undefined}};t.createDeployJob=createDeployJob},2024:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createDeployementJobs=void 0;var i=r(1421);var o=r(9756);var s=r(2846);var createDeployementJobs=function(e,t){return n(n([(0,i.createDeployJob)(e,t.deploy)],a(t.stop?[(0,s.createStopJob)(e,t.stop)]:[]),false),a(t.rollback?[(0,o.createRollbackJob)(e,t.rollback)]:[]),false)};t.createDeployementJobs=createDeployementJobs},9756:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.createRollbackJob=t.ROLLBACK_JOB_NAME=void 0;var n=r(2422);t.ROLLBACK_JOB_NAME="↩️ Rollback ⚠️";var createRollbackJob=function(e,r){var i;return{name:t.ROLLBACK_JOB_NAME,image:r.image,envMode:"stagePerEnv",needs:[],allow_failure:true,when:"manual",variables:a(a({},e.environment.jobOnlyVars.deploy.envVars),r.variables),runnerVariables:a(a(a({},n.DEPLOY_RUNNER_VARIABLES),{GIT_STRATEGY:"none"}),(i=r.runnerVariables)!==null&&i!==void 0?i:{}),stage:"rollback",environment:{action:"access"},script:r.script}};t.createRollbackJob=createRollbackJob},2846:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.createStopJob=t.STOP_JOB_NAME=void 0;var n=r(2422);t.STOP_JOB_NAME="🛑 Stop ⚠️";var createStopJob=function(e,r){return{name:t.STOP_JOB_NAME,image:r.image,envMode:"stagePerEnv",needs:[],allow_failure:true,when:"manual",rules:[{if:"$CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/",when:"on_success"}],variables:a(a({},e.environment.jobOnlyVars.deploy.envVars),r.variables),runnerVariables:a(a(a({},n.DEPLOY_RUNNER_VARIABLES),{GIT_STRATEGY:"none"}),r.runnerVariables),stage:"stop",environment:{action:"stop"},script:r.script}};t.createStopJob=createStopJob},2422:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DEPLOY_RUNNER_VARIABLES=void 0;t.DEPLOY_RUNNER_VARIABLES={KUBERNETES_CPU_REQUEST:"0.22",KUBERNETES_MEMORY_REQUEST:"200Mi",KUBERNETES_MEMORY_LIMIT:"400Mi"}},4963:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getDeleteUnusedImagesCommands=t.getArtifactsRegistryImage=t.getArtifactsRegistryBuildCacheImage=t.getArtifactsRegistryImageName=t.getArtifactsRegistryDockerUrl=t.getArtifactsRegistryHost=void 0;var i=r(2376);var o=r(8490);var s=r(5781);var p=r(4398);var getArtifactsRegistryHost=function(e){var t;if(!(0,s.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"google-cloudrun")){throw new Error("deploy config is wrong")}return"".concat(e.deploy.config.region,"-docker.pkg.dev")};t.getArtifactsRegistryHost=getArtifactsRegistryHost;var getArtifactsRegistryDockerUrl=function(e){var r;var a=(r=e.deploy)===null||r===void 0?void 0:r.config;if(!(0,s.isOfDeployType)(a,"google-cloudrun")){throw new Error("deploy config is wrong")}var n="".concat(e.fullConfig.customerName,"-").concat(e.fullConfig.appName);return"".concat((0,t.getArtifactsRegistryHost)(e),"/").concat(a.projectId,"/catladder-deploy/").concat(n)};t.getArtifactsRegistryDockerUrl=getArtifactsRegistryDockerUrl;var getArtifactsRegistryImageName=function(e,r){if(r===void 0){r=false}if(r&&e.environment.envType!=="review"){throw new Error("lecacyReviewImageName is only allowed for review app")}var o=(0,t.getArtifactsRegistryDockerUrl)(e);var s=n([o,e.env,e.name],a(e.environment.reviewSlug&&!r?[e.environment.reviewSlug]:[]),false);return(0,i.joinBashExpressions)(s,"/")};t.getArtifactsRegistryImageName=getArtifactsRegistryImageName;var getArtifactsRegistryBuildCacheImage=function(e){var r=(0,t.getArtifactsRegistryDockerUrl)(e);var a=[r,"caches",e.name];return a.join("/")};t.getArtifactsRegistryBuildCacheImage=getArtifactsRegistryBuildCacheImage;var getArtifactsRegistryImage=function(e){return"".concat((0,t.getArtifactsRegistryImageName)(e),":$DOCKER_IMAGE_TAG")};t.getArtifactsRegistryImage=getArtifactsRegistryImage;var getDeleteImageCommands=function(e,t){if(t===void 0){t=0}if(t===0){return["gcloud artifacts docker images delete ".concat(e," --quiet --delete-tags")]}var r="gcloud artifacts docker images list ".concat(e,' --sort-by=~CREATE_TIME --format="value(version)"');var a=(0,p.removeFirstLinesFromCommandOutput)(r,t);var n="gcloud artifacts docker images delete ".concat(e,"@$version --quiet --delete-tags");var i="".concat(a," | while read -r version; do ").concat(n,"; done");return[i]};var getDeleteUnusedImagesCommands=function(e,r){var i;if(r===void 0){r=0}var p=(i=e.deploy)===null||i===void 0?void 0:i.config;if(!(0,s.isOfDeployType)(p,"google-cloudrun")){throw new Error("deploy config is wrong")}var l=(0,t.getArtifactsRegistryImageName)(e);var d=(0,t.getArtifactsRegistryBuildCacheImage)(e);return n(n(n([],a(getDeleteImageCommands(l,r)),false),a(getDeleteImageCommands(d,1)),false),a(e.environment.envType==="review"?(0,o.allowFailureInScripts)(getDeleteImageCommands((0,t.getArtifactsRegistryImageName)(e,true),0)):[]),false)};t.getDeleteUnusedImagesCommands=getDeleteUnusedImagesCommands},7888:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getRemoveOldRevisionsAndImagesCommand=void 0;var i=r(4963);var o=r(9067);var getRemoveOldRevisionsAndImagesCommand=function(e,t){if(t==="onStop"){return(0,i.getDeleteUnusedImagesCommands)(e)}var r=e.environment.envType==="prod"?5:0;var s=r+1;var p=(0,o.getDeleteUnusedRevisionsCommands)(e,r);var l=(0,i.getDeleteUnusedImagesCommands)(e,s);return n(n([],a(p),false),a(l),false)};t.getRemoveOldRevisionsAndImagesCommand=getRemoveOldRevisionsAndImagesCommand},9067:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.getDeleteUnusedRevisionsCommands=void 0;var n=r(5781);var i=r(9598);var o=r(8128);var s=r(4398);var getListRevisionsCommand=function(e,t){var r;var s=(0,o.getServiceName)(e);var p=(r=e.deploy)===null||r===void 0?void 0:r.config;if(!p||!(0,n.isOfDeployType)(p,"google-cloudrun")){throw new Error("deploy config is wrong")}var l=a({project:p.projectId,region:p.region,service:s,limit:"unlimited","sort-by":"metadata.creationTimestamp"},t);return"gcloud run revisions list ".concat((0,i.createArgsString)(l))};var getDeleteUnusedRevisionsCommands=function(e,t){var r;var a=(r=e.deploy)===null||r===void 0?void 0:r.config;if(!(0,n.isOfDeployType)(a,"google-cloudrun")){throw new Error("deploy config is wrong")}var o=getListRevisionsCommand(e,{format:'"value(name)"',filter:"'(status.conditions.status=False OR status.conditions.status=Unknown)'"});var p=(0,s.removeFirstLinesFromCommandOutput)(o,t);var l="gcloud run revisions delete ".concat((0,i.createArgsString)({project:a.projectId,region:a.region,quiet:true})," $revisionname ");var d="".concat(p," | while read -r revisionname; do ").concat(l,"; done");return[d]};t.getDeleteUnusedRevisionsCommands=getDeleteUnusedRevisionsCommands},1224:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getCreateScheduleScripts=t.getJobCreateScripts=t.getJobRunScripts=t.getDeleteJobsScripts=t.getDeleteSchedulesScripts=void 0;var o=r(8490);var s=r(9598);var p=r(9626);var l=r(3325);var d=r(920);var c=r(847);var u=r(8865);var getJobRunScriptForJob=function(e,t,r){var a=(0,l.getCommonCloudRunArgs)(e);var n=(0,s.createArgsString)(a);return"".concat((0,l.gcloudRunCmd)()," jobs execute ").concat(t.toString()," ").concat(n).concat(r?" --wait":"")};var getDeleteSchedulesScripts=function(e){var t=(0,l.getCloudRunDeployConfig)(e);var r=getCloudRunJobsWithSchedule(e);var a=(0,s.createArgsString)({project:t.projectId,location:t.region});return r.map((function(e){var t=e.schedulerName;return["".concat((0,l.gcloudSchedulerCmd)()," jobs delete ").concat(t," ").concat(a)]})).flat()};t.getDeleteSchedulesScripts=getDeleteSchedulesScripts;var getDeleteJobsScripts=function(e){var t=(0,l.getCommonCloudRunArgs)(e);var r=(0,s.createArgsString)(t);var a=getCloudRunJobsWithNames(e);return a.flatMap((function(e){var t=e.jobName;return["".concat((0,l.gcloudRunCmd)()," jobs executions list ").concat(r," --job ").concat(t,' --format="value(name)" | xargs -I {} ').concat((0,l.gcloudRunCmd)()," jobs executions delete {} --quiet ").concat(r),"".concat((0,l.gcloudRunCmd)()," jobs delete ").concat(t," ").concat(r)]}))};t.getDeleteJobsScripts=getDeleteJobsScripts;var getJobRunScripts=function(e,t){var r=getCloudRunJobsWithNames(e);return r.filter((function(e){var r=e.job;return r.when===t})).map((function(r){var a=r.jobName;return getJobRunScriptForJob(e,a,["preStop","postStop"].includes(t))}))};t.getJobRunScripts=getJobRunScripts;var getJobCreateScripts=function(e){var t=getCloudRunJobsWithNames(e);return t.map((function(t){var r=t.job,a=t.jobName;return getJobCreateScriptsForJob(e,a,r)})).flat()};t.getJobCreateScripts=getJobCreateScripts;var getJobCreateScriptsForJob=function(e,t,r){var p=(0,l.getCommonDeployArgs)(e);var f=Array.isArray(r.command)?r.command:r.command.split(" ");var m=(0,s.createArgsString)(a(a({command:'"'+f.join(",")+'"'},p),{labels:(0,l.makeLabelString)(a(a({},(0,d.getLabels)(e)),{"cloud-run-job-name":t.toString()})),image:r.image||p.image,cpu:r===null||r===void 0?void 0:r.cpu,memory:r.memory||"512Mi","task-timeout":r.timeout||"10m",parallelism:r.parallelism||1,"env-vars-file":u.ENV_VARS_FILENAME,"max-retries":0}));var h=(r===null||r===void 0?void 0:r.volumes)&&Object.keys(r===null||r===void 0?void 0:r.volumes).length>0;var v="".concat(t," ").concat(m);return i(i([],n((0,o.allowFailureInScripts)(["".concat((0,l.gcloudRunCmd)()," jobs create ").concat(v)])),false),["".concat((0,l.gcloudRunCmd)(h?"beta":undefined)," jobs update ").concat(v," ").concat(s.createArgsString.apply(void 0,i([],n((0,c.createVolumeConfig)(r===null||r===void 0?void 0:r.volumes,"job")),false)))],false)};var getCreateScheduleScripts=function(e){var t=getCloudRunJobsWithSchedule(e);var r=(0,l.getCloudRunDeployConfig)(e);return t.map((function(e){var t;var a=e.job,p=e.jobName,d=e.schedulerName;var c=(0,s.createArgsString)({project:r.projectId,location:r.region,schedule:'"'.concat(a.schedule,'"'),"max-retry-attempts":(t=a.maxRetryAttempts)!==null&&t!==void 0?t:0,uri:'"https://'.concat(r.region,"-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(r.projectId,"/jobs/").concat(p,':run"'),"http-method":"POST","oauth-service-account-email":"$GCLOUD_PROJECT_NUMBER-compute@developer.gserviceaccount.com"});var u="http ".concat(d," ").concat(c);return i(i([],n((0,o.allowFailureInScripts)(["".concat((0,l.gcloudSchedulerCmd)()," jobs create ").concat(u)])),false),["".concat((0,l.gcloudSchedulerCmd)()," jobs update ").concat(u)],false)})).flat()};t.getCreateScheduleScripts=getCreateScheduleScripts;var getCloudRunJobsWithSchedule=function(e){var t=getCloudRunJobsWithNames(e);return t.filter((function(e){return e.job.when==="schedule"})).map((function(e){var t=e.job,r=e.jobName;return{job:t,jobName:r,schedulerName:r.concat("-scheduler")}}))};var getCloudRunJobsWithNames=function(e){var t;var r=(0,l.getCloudRunDeployConfig)(e);var getFullJobName=function(t){return(0,p.getCloudRunJobName)(e.environment.fullName,t)};var a=Object.entries((t=r.jobs)!==null&&t!==void 0?t:{}).filter((function(e){return Boolean(e[1])})).map((function(e){var t=n(e,2),r=t[0],a=t[1];return{jobName:getFullJobName(r),job:a}}));return a}},7334:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getServiceDeleteScript=t.getServiceDeployScript=void 0;var o=r(920);var s=r(9598);var p=r(8128);var l=r(3325);var d=r(8865);var c=r(847);var getServiceDeployScript=function(e,t,r){var u,f,m,h,v;var y=(0,l.getCommonDeployArgs)(e);var b=(0,p.getServiceName)(e);var g=t!==true?t:undefined;var w=t!==true?(u=t===null||t===void 0?void 0:t.command)!==null&&u!==void 0?u:e.build.config.startCommand:undefined;var _=w?Array.isArray(w)?w:w.split(" "):undefined;var S=b.concat(r!==null&&r!==void 0?r:"");var O=s.createArgsString.apply(void 0,i([a(a({command:_?'"'+_.join(",")+'"':'""'},y),{labels:(0,l.makeLabelString)(a(a({},(0,o.getLabels)(e)),{"cloud-run-service-name":S})),"env-vars-file":d.ENV_VARS_FILENAME,"min-instances":(f=g===null||g===void 0?void 0:g.minInstances)!==null&&f!==void 0?f:0,"max-instances":(m=g===null||g===void 0?void 0:g.maxInstances)!==null&&m!==void 0?m:100,"cpu-throttling":(g===null||g===void 0?void 0:g.noCpuThrottling)!==true,cpu:g===null||g===void 0?void 0:g.cpu,memory:g===null||g===void 0?void 0:g.memory,timeout:g===null||g===void 0?void 0:g.timeout,"vpc-connector":g===null||g===void 0?void 0:g.vpcConnector,"vpc-egress":g===null||g===void 0?void 0:g.vpcEgress,"allow-unauthenticated":(h=g===null||g===void 0?void 0:g.allowUnauthenticated)!==null&&h!==void 0?h:true,ingress:(v=g===null||g===void 0?void 0:g.ingress)!==null&&v!==void 0?v:"all","cpu-boost":true,"execution-environment":g===null||g===void 0?void 0:g.executionEnvironment})],n((0,c.createVolumeConfig)(g===null||g===void 0?void 0:g.volumes,"service")),false));var A=(g===null||g===void 0?void 0:g.volumes)&&Object.keys(g===null||g===void 0?void 0:g.volumes).length>0;return"".concat((0,l.gcloudRunCmd)(A?"beta":undefined)," deploy ").concat(S," ").concat(O)};t.getServiceDeployScript=getServiceDeployScript;var getServiceDeleteScript=function(e,t){var r=(0,l.getCommonCloudRunArgs)(e);var a=(0,s.createArgsString)(r);var n=(0,p.getServiceName)(e);var i=t?"".concat(n,"-").concat(t):n;return["".concat((0,l.gcloudRunCmd)()," services delete ").concat(i," ").concat(a)]};t.getServiceDeleteScript=getServiceDeleteScript},3325:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.getCommonDeployArgs=t.getCommonCloudRunArgs=t.getCloudRunDeployConfig=t.makeLabelString=t.setGoogleProjectNumberScript=t.gcloudSchedulerCmd=t.gcloudRunCmd=t.gcloudCmd=void 0;var i=r(5781);var o=r(4963);var gcloudCmd=function(e){return e?"gcloud ".concat(e):"gcloud"};t.gcloudCmd=gcloudCmd;var gcloudRunCmd=function(e){return"".concat((0,t.gcloudCmd)(e)," run")};t.gcloudRunCmd=gcloudRunCmd;var gcloudSchedulerCmd=function(e){return"".concat((0,t.gcloudCmd)(e)," scheduler")};t.gcloudSchedulerCmd=gcloudSchedulerCmd;var setGoogleProjectNumberScript=function(e){return["export GCLOUD_PROJECT_NUMBER=$(".concat((0,t.gcloudCmd)()," projects describe ").concat(e.projectId,' --format="value(projectNumber)")'),'echo "GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER"']};t.setGoogleProjectNumberScript=setGoogleProjectNumberScript;var makeLabelString=function(e){return Object.entries(e).map((function(e){var t=n(e,2),r=t[0],a=t[1];return"".concat(r,"=").concat(a)})).join(",")};t.makeLabelString=makeLabelString;var getCloudRunDeployConfig=function(e){var t;var r=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,i.isOfDeployType)(r,"google-cloudrun")){throw new Error("deploy config is wrong")}return r};t.getCloudRunDeployConfig=getCloudRunDeployConfig;function getCommonCloudRunArgs(e){var r=(0,t.getCloudRunDeployConfig)(e);return{project:r.projectId,region:r.region}}t.getCommonCloudRunArgs=getCommonCloudRunArgs;function getCommonDeployArgs(e){var r=getCommonCloudRunArgs(e);var n=(0,t.getCloudRunDeployConfig)(e);return a(a({image:(0,o.getArtifactsRegistryImage)(e)},r),{"set-cloudsql-instances":n.cloudSql?n.cloudSql.instanceConnectionName:undefined})}t.getCommonDeployArgs=getCommonDeployArgs},8865:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ENV_VARS_FILENAME=void 0;t.ENV_VARS_FILENAME="____envvars.yaml"},3695:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunDeployScripts=void 0;var i=r(3255);var o=r(8490);var s=r(4986);var p=r(7888);var l=r(8206);var d=r(6320);var c=r(1224);var u=r(7334);var f=r(3325);var m=r(2674);var h=r(8865);var v=r(4660);function getCloudRunDeployScripts(e){var t;var r=(0,f.getCloudRunDeployConfig)(e);var y=(0,i.omit)(e.environment.envVars,m.GCLOUD_DEPLOY_CREDENTIALS_KEY);return n(n(n(n(n([],a((0,o.collapseableSection)("prepare","Prepare...")(n(n([],a((0,d.gcloudServiceAccountLoginCommands)(e)),false),a((0,f.setGoogleProjectNumberScript)(r)),false))),false),a((0,o.collapseableSection)("writeenvvars","Write env vars to file")((0,v.writeBashYamlToFileScript)(y,h.ENV_VARS_FILENAME))),false),a((0,o.collapseableSection)("deploy","Deploy to cloud run")(n(n(n(n(n(n(n([],a(r.cloudSql?(0,l.getDatabaseCreateScript)(e,r):[]),false),a((0,c.getCreateScheduleScripts)(e)),false),a((0,c.getJobCreateScripts)(e)),false),a((0,c.getJobRunScripts)(e,"preDeploy")),false),a(r.service!==false?[(0,u.getServiceDeployScript)(e,r.service)]:[]),false),a(Object.entries((t=r.additionalServices)!==null&&t!==void 0?t:{}).map((function(t){var r=a(t,2),n=r[0],i=r[1];return(0,u.getServiceDeployScript)(e,i,"-"+n)}))),false),a((0,c.getJobRunScripts)(e,"postDeploy")),false))),false),a((0,o.collapseableSection)("cleanup","Cleanup")((0,p.getRemoveOldRevisionsAndImagesCommand)(e,"postDeploy"))),false),a((0,s.getDependencyTrackUploadScript)(e)),false)}t.getCloudRunDeployScripts=getCloudRunDeployScripts},3747:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunStopScripts=void 0;var i=r(4986);var o=r(7888);var s=r(8206);var p=r(6320);var l=r(1224);var d=r(7334);var c=r(3325);function getCloudRunStopScripts(e){var t;var r=(0,c.getCloudRunDeployConfig)(e);return n(n(n(n(n(n(n(n(n(n([],a((0,p.gcloudServiceAccountLoginCommands)(e)),false),a((0,l.getJobRunScripts)(e,"preStop")),false),a(r.service!==false?(0,d.getServiceDeleteScript)(e):[]),false),a(Object.entries((t=r.additionalServices)!==null&&t!==void 0?t:{}).flatMap((function(t){var r=a(t,1),n=r[0];return(0,d.getServiceDeleteScript)(e,n)}))),false),a((0,l.getJobRunScripts)(e,"postStop")),false),a((0,l.getDeleteSchedulesScripts)(e)),false),a((0,l.getDeleteJobsScripts)(e)),false),a(r.cloudSql&&r.cloudSql.deleteDatabaseOnStop?(0,s.getDatabaseDeleteScript)(e,r):[]),false),a((0,o.getRemoveOldRevisionsAndImagesCommand)(e,"onStop")),false),a((0,i.getDependencyTrackDeleteScript)(e)),false)}t.getCloudRunStopScripts=getCloudRunStopScripts},4069:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.createGoogleCloudRunDeployJobs=void 0;var n=r(4058);var i=r(8490);var o=r(2024);var s=r(5781);var p=r(8865);var l=r(3695);var d=r(3747);var createGoogleCloudRunDeployJobs=function(e){var t;var r=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,s.isOfDeployType)(r,"google-cloudrun")){throw new Error("deploy config is wrong")}var c=(0,l.getCloudRunDeployScripts)(e);var u=(0,d.getCloudRunStopScripts)(e);return(0,o.createDeployementJobs)(e,{deploy:a(a({variables:{CLOUDSDK_CORE_DISABLE_PROMPTS:"1"}},r.debug?{artifacts:{paths:[p.ENV_VARS_FILENAME],when:"always"}}:{}),{image:(0,n.getRunnerImage)("gcloud"),script:c}),stop:{image:(0,n.getRunnerImage)("gcloud"),variables:{CLOUDSDK_CORE_DISABLE_PROMPTS:"1"},script:(0,i.allowFailureInScripts)(u)}})};t.createGoogleCloudRunDeployJobs=createGoogleCloudRunDeployJobs},847:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var a=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createVolumeConfig=void 0;var createVolumeConfig=function(e,t){if(!e){return[]}return a(a([],r(Object.entries(e).map((function(e){var t=r(e,2),a=t[0],n=t[1],i=n.type,o=n.bucket,s=n.mountPath,p=n.readonly;return{"add-volume":"name=".concat(a,",type=").concat(i,",bucket=").concat(o).concat(p?",readonly=true":""),"add-volume-mount":"volume=".concat(a,",mount-path=").concat(s)}}))),false),[t==="service"?{"execution-environment":"gen2"}:{}],false)};t.createVolumeConfig=createVolumeConfig},2674:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.GCLOUD_RUN_DEPLOY_TYPE=t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX=t.GCLOUD_DEPLOY_CREDENTIALS_KEY=void 0;var o=r(2376);var s=r(5875);var p=r(8490);var l=r(2089);var d=r(4069);var c=r(8206);var u=r(9626);t.GCLOUD_DEPLOY_CREDENTIALS_KEY="GCLOUD_DEPLOY_credentialsKey";t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX="GCLOUD_RUN_canonicalHostSuffix";var getCloudSqlVariables=function(e){var t,r;var a=e.deployConfigRaw,i=e.environmentSlugPrefix,o=e.env,p=e.componentName,d=e.fullConfig;if(a&&a.cloudSql){var u=(0,l.getFullDbName)(a.cloudSql,d,i,p);var f=Object.entries((t=a.cloudSql.dbAdditionalQueryParams)!==null&&t!==void 0?t:{}).map((function(e){var t=n(e,2),r=t[0],a=t[1];return"&".concat(r,"=").concat(a)})).join("");return{CLOUD_SQL_INSTANCE_CONNECTION_NAME:a.cloudSql.instanceConnectionName,DB_NAME:u,DB_USER:(r=a.cloudSql.dbUser)!==null&&r!==void 0?r:"postgres",DB_PASSWORD:"$"+(0,s.getSecretVarName)(o,p,"DB_PASSWORD"),DATABASE_URL:"".concat((0,c.getDatabaseConnectionString)(a.cloudSql)).concat(f),DATABASE_JDBC_URL:c.DATABASE_JDBC_URL}}return{}};t.GCLOUD_RUN_DEPLOY_TYPE={jobs:d.createGoogleCloudRunDeployJobs,defaults:function(e){var t=e.deployConfigRaw,r=e.envType;if(t&&t.cloudSql){return{cloudSql:{deleteDatabaseOnStop:r==="review"}}}return{}},additionalSecretKeys:function(e){return i([{key:t.GCLOUD_DEPLOY_CREDENTIALS_KEY,hidden:true},{key:t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX,hidden:true}],n(e.deployConfigRaw&&e.deployConfigRaw.cloudSql?[{key:"DB_PASSWORD"}]:[]),false)},getAdditionalEnvVars:function(e){var r=e.fullName,i=e.env,l=e.componentName,d=e.deployConfigRaw;var c=(0,o.joinBashExpressions)([r,(0,o.getBashVariable)((0,s.getSecretVarName)(i,l,t.GCLOUD_RUN_CANONICAL_HOST_SUFFIX))],"-").toLowerCase();var f=d&&d.jobs?Object.fromEntries(Object.entries(d.jobs).map((function(e){var t=n(e,2),a=t[0],i=t[1];return["CLOUD_RUN_JOB_TRIGGER_URL_"+(0,p.sanitizeForBashVariable)(a),"https://".concat(d.region,"-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/").concat(d.projectId,"/jobs/").concat((0,u.getCloudRunJobName)(r,a),":run")]}))):{};return a(a(a({HOST_INTERNAL:c},getCloudSqlVariables(e)),f),{DEPLOY_CLOUD_RUN_PROJECT_ID:d?d.projectId:undefined,DEPLOY_CLOUD_RUN_REGION:d?d.region:undefined})}}},9598:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.createArgsString=void 0;var n=r(3255);var createArgsString=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e.map((function(e){return Object.entries(e).filter((function(e){var t=a(e,2),r=t[1];return!(0,n.isNil)(r)})).map((function(e){var t=a(e,2),r=t[0],n=t[1];if(n===true){return"--".concat(r)}else if(n===false){return"--no-".concat(r)}return"--".concat(r,"=").concat(n)}))})).flat().join(" ")};t.createArgsString=createArgsString},8206:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.getDatabaseConnectionString=t.DATABASE_JDBC_URL=t.getDatabaseCreateScript=t.getDatabaseDeleteScript=void 0;var n=r(8490);var getDatabaseDeleteScript=function(e,t){if(!t.cloudSql||!t.cloudSql.deleteDatabaseOnStop){throw new Error("not possible")}var r=e.environment.envVars["DB_NAME"];if(!r){throw new Error("error: env vars did not specify DB_NAME")}var i=a(t.cloudSql.instanceConnectionName.split(":"),3),o=i[0],s=i[1],p=i[2];return['echo "deleting database '.concat(r,'..."'),'echo "👆 this can take multiple attemps (3-5min), because google cloud run may still have a connection to the database after the cloud run service is shut down"',(0,n.repeatOnFailure)("gcloud sql databases delete ".concat(r," --instance=").concat(p," --project ").concat(o),{pauseInSeconds:10})]};t.getDatabaseDeleteScript=getDatabaseDeleteScript;var getDatabaseCreateScript=function(e,t){if(!t.cloudSql){throw new Error("not possible")}var r=e.environment.envVars["DB_NAME"];if(!r){throw new Error("error: env vars did not specify DB_NAME")}var i=a(t.cloudSql.instanceConnectionName.split(":"),3),o=i[0],s=i[1],p=i[2];return(0,n.allowFailureInScripts)(['echo "ensuring Database..."',"gcloud sql databases create ".concat(r," --instance=").concat(p," --project ").concat(o)])};t.getDatabaseCreateScript=getDatabaseCreateScript;t.DATABASE_JDBC_URL="jdbc:postgresql:///$DB_NAME?cloudSqlInstance=$CLOUD_SQL_INSTANCE_CONNECTION_NAME&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=$DB_USER&password=$DB_PASSWORD";var getDatabaseConnectionString=function(e){switch(e.dbConnectionStringFormat){case"jdbc":return t.DATABASE_JDBC_URL;case"rails":return"postgresql://$DB_USER:$DB_PASSWORD@".concat(encodeURIComponent("/cloudsql/".concat(e.instanceConnectionName)),"/$DB_NAME?");default:return"postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME"}};t.getDatabaseConnectionString=getDatabaseConnectionString},6320:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gcloudServiceAccountLoginCommands=void 0;var a=r(2674);var n=r(5875);var gcloudServiceAccountLoginCommands=function(e){return['gcloud auth activate-service-account --key-file=<(echo "$'.concat((0,n.getSecretVarNameForContext)(e,a.GCLOUD_DEPLOY_CREDENTIALS_KEY),'")')]};t.gcloudServiceAccountLoginCommands=gcloudServiceAccountLoginCommands},8128:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getServiceName=void 0;var getServiceName=function(e){return e.environment.fullName.toLowerCase()};t.getServiceName=getServiceName},9626:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getCloudRunJobName=void 0;var getCloudRunJobName=function(e,t){return e.toLowerCase().concat("-"+t.toLowerCase())};t.getCloudRunJobName=getCloudRunJobName},4398:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.removeFirstLinesFromCommandOutput=void 0;var removeFirstLinesFromCommandOutput=function(e,t){return t===0?e:"".concat(e," | tail -n +").concat(t+1)};t.removeFirstLinesFromCommandOutput=removeFirstLinesFromCommandOutput},2089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getFullDbName=void 0;var a=r(2376);var getFullDbName=function(e,t,r,n){var i,o;return(0,a.joinBashExpressions)([(i=e.dbNamePrefix)!==null&&i!==void 0?i:"".concat(t.customerName,"-").concat(t.appName),r,(o=e.dbBaseName)!==null&&o!==void 0?o:n].flatMap((function(e){return e?[e]:[]})),"-")};t.getFullDbName=getFullDbName},4910:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createCustomDeployJobs=void 0;var i=r(5043);var o=r(4058);var s=r(2024);var p=r(4986);var l=r(5781);var createCustomDeployJobs=function(e){var t,r,d,c;var u=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,l.isOfDeployType)(u,"custom")){throw new Error("deploy config is not custom")}var f=(0,i.getYarnInstall)(e,{noCustomPostInstall:true});return(0,s.createDeployementJobs)(e,{deploy:{image:(r=u.jobImage)!==null&&r!==void 0?r:(0,o.getRunnerImage)("jobs-default"),cache:(d=u.jobCache)!==null&&d!==void 0?d:[],script:n(n(n(["cd ".concat(e.build.dir)],a(u.requiresYarnInstall?f:[]),false),a(u.script),false),a((0,p.getDependencyTrackUploadScript)(e)),false),variables:{}},stop:u.stopScript?{image:(c=u.jobImage)!==null&&c!==void 0?c:(0,o.getRunnerImage)("jobs-default"),script:n(n([],a(u.stopScript),false),a((0,p.getDependencyTrackDeleteScript)(e)),false),variables:{}}:undefined})};t.createCustomDeployJobs=createCustomDeployJobs},2819:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CUSTOM_DEPLOY_TYPE=void 0;var a=r(4910);t.CUSTOM_DEPLOY_TYPE={jobs:a.createCustomDeployJobs,defaults:function(){return{}},additionalSecretKeys:function(){return[]},getAdditionalEnvVars:function(){return{}}}},6794:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createDockerTagDeployJobs=void 0;var o=r(9641);var s=r(2024);var p=r(5781);var createDockerTagDeployJobs=function(e){var t;var r=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,p.isOfDeployType)(r,"dockerTag")){throw new Error("deploy config is not dockerTag")}var l=r.tag;return(0,s.createDeployementJobs)(e,{deploy:a(a({},(0,o.getDockerJobBaseProps)()),{script:i(i([],n((0,o.gitlabDockerLogin)(e)),false),["docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG","docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_IMAGE:".concat(l),"docker push $DOCKER_IMAGE:".concat(l),'echo "pushed as $DOCKER_IMAGE:'.concat(l,'"')],false)})})};t.createDockerTagDeployJobs=createDockerTagDeployJobs},4511:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DOCKER_TAG_DEPLOY_TYPE=void 0;var a=r(6794);t.DOCKER_TAG_DEPLOY_TYPE={jobs:a.createDockerTagDeployJobs,defaults:function(){return{}},additionalSecretKeys:function(){return[]},getAdditionalEnvVars:function(){return{}}}},8483:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});t.DEPLOY_TYPES=void 0;var i=r(2674);var o=r(2819);var s=r(4511);var p=r(3397);n(r(2674),t);n(r(3397),t);n(r(5781),t);n(r(6054),t);t.DEPLOY_TYPES={kubernetes:p.KUBERNETES_DEPLOY_TYPE,custom:o.CUSTOM_DEPLOY_TYPE,dockerTag:s.DOCKER_TAG_DEPLOY_TYPE,"google-cloudrun":i.GCLOUD_RUN_DEPLOY_TYPE}},436:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.additionalKubernetesSecretKeys=void 0;var additionalKubernetesSecretKeys=function(e){var t,r,a,n;var i=e.deployConfigRaw;if(!i){return[]}var o=[];if((r=(t=i.values)===null||t===void 0?void 0:t.mongodb)===null||r===void 0?void 0:r.enabled){o.push("MONGODB_ROOT_PASSWORD");if(i.values.mongodb.architecture==="replicaset"){o.push("MONGODB_REPLICASET_KEY")}}if((n=(a=i.values)===null||a===void 0?void 0:a.cloudsql)===null||n===void 0?void 0:n.enabled){o.push("POSTGRESQL_PASSWORD");o.push("cloudsqlProxyCredentials")}return o.map((function(e){return{key:e}}))};t.additionalKubernetesSecretKeys=additionalKubernetesSecretKeys},5129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createKubernetesCloudsqlBaseValues=t.hasKubernetesCloudSQL=void 0;var a=r(5875);var n=r(2089);var i=r(5781);var hasKubernetesCloudSQL=function(e){var t,r,a;var n=(t=e.deploy)===null||t===void 0?void 0:t.config;if((0,i.isOfDeployType)(n,"kubernetes")){return(a=(r=n.values)===null||r===void 0?void 0:r.cloudsql)===null||a===void 0?void 0:a.enabled}return false};t.hasKubernetesCloudSQL=hasKubernetesCloudSQL;var createKubernetesCloudsqlBaseValues=function(e){var t,r,o,s,p,l,d;var c=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,i.isOfDeployType)(c,"kubernetes")){throw new Error("cannot get cloud sql config")}var u=(r=c.values)===null||r===void 0?void 0:r.cloudsql;if(!u){throw new Error("cannot get cloud sql config")}var f="$".concat((0,a.getSecretVarNameForContext)(e,"cloudsqlProxyCredentials"));if((u===null||u===void 0?void 0:u.type)!=="unmanaged"){var m="".concat((o=u.projectId)!==null&&o!==void 0?o:"skynet-164509",":").concat((s=u.region)!==null&&s!==void 0?s:"europe-west6",":").concat((p=u.instanceId)!==null&&p!==void 0?p:e.environment.envVars.KUBE_NAMESPACE);return{cloudsql:{enabled:u.enabled,dbUser:"postgres",instanceConnectionName:m,proxyCredentials:f,fullDbName:(l=e.environment.envVars.KUBE_APP_NAME)!==null&&l!==void 0?l:""}}}else if(u.type==="unmanaged"){return{cloudsql:{enabled:u.enabled,dbUser:(d=u.dbUser)!==null&&d!==void 0?d:"postgres",instanceConnectionName:u.instanceConnectionName,proxyCredentials:f,fullDbName:(0,n.getFullDbName)(u,e.fullConfig,e.environment.slugPrefix,e.name)}}}else{throw new Error("unknonw type")}};t.createKubernetesCloudsqlBaseValues=createKubernetesCloudsqlBaseValues},9139:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var i=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createKubernetesDeployJobs=void 0;var o=r(5133);var s=r(4058);var p=r(2024);var l=r(4986);var d=r(5781);var c=r(8772);var u=r(4660);var f=r(8490);var m="__all_values.yml";var createKubernetesDeployJobs=function(e){var t,r,h;var v=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!(0,d.isOfDeployType)(v,"kubernetes")){throw new Error("deploy config is not kubernetes")}var y=a(a({image:(0,s.getRunnerImage)("kubernetes")},v.debug?{artifacts:{paths:[m],when:"always"}}:{}),{variables:a(a({},e.environment.envVars),{RELEASE_NAME:e.environment.fullName,HELM_EXPERIMENTAL_OCI:"1",KUBE_DOCKER_IMAGE_PULL_SECRET:"gitlab-registry-".concat(e.name),HELM_GITLAB_CHART_NAME:(r=v.chartName)!==null&&r!==void 0?r:"/helm-charts/the-panter-chart",HELM_ARGS:i(i([],n(v.debug?["--debug"]:[]),false),n((h=v.additionalHelmArgs)!==null&&h!==void 0?h:[]),false).join(" "),COMPONENT_NAME:e.name,BUILD_ID:e.environment.envVars.BUILD_INFO_BUILD_ID})});var b="kube-".concat(e.environment.fullName);var g=['kubectl config set-cluster "'.concat(b,'" --server="$').concat((0,o.getSecretVarNameForContext)(e,"KUBE_URL"),'" --certificate-authority <(echo $').concat((0,o.getSecretVarNameForContext)(e,"KUBE_CA_PEM")," | base64 -d) --embed-certs=true"),'kubectl config set-credentials "'.concat(b,'" --token="$').concat((0,o.getSecretVarNameForContext)(e,"KUBE_TOKEN"),'"'),'kubectl config set-context "'.concat(b,'" --cluster="').concat(b,'" --user="').concat(b,'" --namespace="').concat(e.environment.envVars.KUBE_NAMESPACE,'"'),'kubectl config use-context "'.concat(b,'"')];return(0,p.createDeployementJobs)(e,{deploy:a(a({},y),{script:i(i(i(i(i([],n(g),false),n((0,f.collapseableSection)("writeallvalues","Write "+m+" for helm deployment")((0,u.writeBashYamlToFileScript)((0,c.createKubeValues)(e),m))),false),["kubernetesCreateSecret","kubernetesDeploy"],false),n((0,l.getDependencyTrackUploadScript)(e)),false),["echo deployment successful 😻"],false)}),stop:a(a({},y),{script:i(i(i([],n(g),false),["kubernetesDelete"],false),n((0,l.getDependencyTrackDeleteScript)(e)),false)}),rollback:a(a({},y),{script:i(i([],n(g),false),["kubernetesRollback"],false)})})};t.createKubernetesDeployJobs=createKubernetesDeployJobs},3397:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.KUBERNETES_DEPLOY_TYPE=void 0;var p=s(r(4035));var l=r(8483);var d=r(2376);var c=r(436);var u=r(9139);n(r(5129),t);t.KUBERNETES_DEPLOY_TYPE={jobs:u.createKubernetesDeployJobs,defaults:function(){return{}},additionalSecretKeys:c.additionalKubernetesSecretKeys,getAdditionalEnvVars:function(e){var t;var r=e.componentName,a=e.fullConfig,n=e.deployConfigRaw,s=e.env,c=e.reviewSlug,u=e.envType;var f=u==="review"&&c?c.concat("-"):"";var m=f.concat(r);var h=(0,l.getKubernetesNamespace)(a,s);var v=(0,p.default)(r);var y=n&&((t=n.cluster)===null||t===void 0?void 0:t.domainCanonical)||a.domainCanonical||"panter.cloud";var b=(0,d.joinBashExpressions)(o(o([v],i(u==="review"&&c?[c]:[]),false),[s,a.appName,a.customerName,y],false),".");return{KUBE_NAMESPACE:h,KUBE_APP_NAME:m,KUBE_APP_NAME_PREFIX:f,HOST_INTERNAL:b}}}},6769:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.createKubeEnv=void 0;var i=r(5781);var shouldGoIntoSecrets=function(e,t){var r;if(!t)return false;if((r=String(t))===null||r===void 0?void 0:r.includes("$CL_")){return true}return false};var createKubeEnv=function(e){var t;if(!(0,i.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"kubernetes")){throw new Error("deploy config is not kubernetes")}var r=e.environment.envVars;var o=Object.entries(r).reduce((function(e,t){var r,i;var o=n(t,2),s=o[0],p=o[1];if(shouldGoIntoSecrets(s,p===null||p===void 0?void 0:p.toString())){e.secret=a(a({},e.secret),(r={},r[s]=p!==null&&p!==void 0?p:"",r));return e}e.public=a(a({},e.public),(i={},i[s]=p!==null&&p!==void 0?p:"",i));return e}),{secret:{},public:{}});return o};t.createKubeEnv=createKubeEnv},8772:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.createKubeValues=void 0;var o=r(3255);var s=r(2497);var p=r(5781);var l=r(5129);var d=r(6769);var c=r(4139);var u=r(6089);var createAppConfig=function(e,t){if(t===false){return{enabled:false}}var r=t!==null&&t!==void 0?t:{},a=r.healthRoute,i=r.command,o=n(r,["healthRoute","command"]);return(0,s.mergeWithMergingArrays)({host:e.environment.host,command:i!==null&&i!==void 0?i:e.build.config.startCommand,livenessProbe:{httpGet:{path:a!==null&&a!==void 0?a:"__health"}},readinessProbe:{httpGet:{path:a!==null&&a!==void 0?a:"__health"}},startupProbe:{httpGet:{path:a!==null&&a!==void 0?a:"__health"}}},o)};var removeFalsy=function(e){if(!e)return undefined;return Object.fromEntries(Object.entries(e).filter((function(e){var t=i(e,2),r=t[1];return r!==false})))};var createKubeValues=function(e){var t,r,i;var f=(t=e.deploy)===null||t===void 0?void 0:t.config;if(!f){return[]}if(!(0,p.isOfDeployType)(f,"kubernetes")){throw new Error("deploy config is not kubernetes")}var m=f.values;var h=m!==null&&m!==void 0?m:{},v=h.application,y=h.jobs,b=h.cronjobs,g=n(h,["application","jobs","cronjobs"]);var w=(0,d.createKubeEnv)(e);var _=(0,o.merge)({env:w,application:createAppConfig(e,v)},(0,l.hasKubernetesCloudSQL)(e)?(0,l.createKubernetesCloudsqlBaseValues)(e):{},((i=(r=f.values)===null||r===void 0?void 0:r.mongodb)===null||i===void 0?void 0:i.enabled)?(0,c.createMongodbBaseConfig)(e):{});var S=(0,u.processSecretsAsFiles)((0,s.mergeWithMergingArrays)(_,a({jobs:removeFalsy(y),cronjobs:removeFalsy(b)},g)));return S};t.createKubeValues=createKubeValues},4139:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.createMongodbBaseConfig=void 0;var n=r(3255);var i=r(5133);var o=r(5781);var getCredentialString=function(e){return"root:$".concat((0,i.getSecretVarNameForContext)(e,"MONGODB_ROOT_PASSWORD"),"@")};var getMongodbHost=function(e,t){var r=e.environment.envVars.KUBE_NAMESPACE;return"".concat(t,".").concat(r,".svc.cluster.local:27017")};var getMongodbStandaloneHost=function(e){var t=e.environment.envVars.KUBE_APP_NAME;return getMongodbHost(e,"".concat(t,"-mongodb"))};var getMongodbReplicasetHost=function(e,t){var r=e.environment.envVars.KUBE_APP_NAME;return getMongodbHost(e,"".concat(r,"-mongodb-").concat(t,".").concat(r,"-mongodb-headless"))};var createMongodbUrl=function(e,t){var r,a,i,s;if(!(0,o.isOfDeployType)((r=e.deploy)===null||r===void 0?void 0:r.config,"kubernetes")){throw new Error("can only createMongodbUrl on supported deploys")}var p=(i=(a=e.deploy)===null||a===void 0?void 0:a.config.values)===null||i===void 0?void 0:i.mongodb;var l=undefined;var d="";if((p===null||p===void 0?void 0:p.architecture)==="replicaset"){d=(0,n.range)(0,(s=p===null||p===void 0?void 0:p.replicaCount)!==null&&s!==void 0?s:2).map((function(t){return getMongodbReplicasetHost(e,t)})).join(",");l="replicaSet=rs0&authSource=admin"}else{d=getMongodbStandaloneHost(e);l="authSource=admin"}return"mongodb://".concat(getCredentialString(e)).concat(d,"/").concat(t).concat(l?"?".concat(l):"")};var createMongoBackupDefaultConfig=function(e){var t,r,a;if(!(0,o.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"kubernetes")){throw new Error("can only create mongodb base config on supported deploys")}var n=(a=(r=e.deploy)===null||r===void 0?void 0:r.config.values)===null||a===void 0?void 0:a.mongodb;var i=e.environment.envVars.KUBE_APP_NAME;var s=["prod","stage"].includes(e.environment.envType);var p;var l;if((n===null||n===void 0?void 0:n.architecture)==="replicaset"){var d=(n===null||n===void 0?void 0:n.architecture)==="replicaset"&&n.replicaCount&&n.replicaCount>1?1:0;p=getMongodbReplicasetHost(e,d);l="datadir-".concat(i,"-mongodb-").concat(d)}else{p=getMongodbStandaloneHost(e);l="".concat(i,"-mongodb")}return{enabled:s,hostToBackup:p,pvcToBackup:l,image:"mrelite/kubectlmongoshell:v1.0",schedule:"0 4 * * *",volumeSnapshotClass:"snapshotclass"}};var createMongodbBaseConfig=function(e){var t,r,n,s;if(!(0,o.isOfDeployType)((t=e.deploy)===null||t===void 0?void 0:t.config,"kubernetes")){throw new Error("can only create mongodb base config on supported deploys")}var p=(n=(r=e.deploy)===null||r===void 0?void 0:r.config.values)===null||n===void 0?void 0:n.mongodb;return{mongodb:{enabled:true,auth:{enabled:true,rootPassword:"$"+(0,i.getSecretVarNameForContext)(e,"MONGODB_ROOT_PASSWORD"),replicaSetKey:"$"+(0,i.getSecretVarNameForContext)(e,"MONGODB_REPLICASET_KEY")},persistence:{storageClass:"standard-rwo"},backup:createMongoBackupDefaultConfig(e)},env:{secret:a({MONGO_URL:createMongodbUrl(e,(s=p===null||p===void 0?void 0:p.dbName)!==null&&s!==void 0?s:"app")},(p===null||p===void 0?void 0:p.architecture)==="replicaset"?{MONGO_OPLOG_URL:createMongodbUrl(e,"local")}:{})}}};t.createMongodbBaseConfig=createMongodbBaseConfig},6089:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:true});t.processSecretsAsFiles=void 0;var n=r(3255);var processSecretsAsFiles=function(e){if(!e.secretsAsFile||e.secretsAsFile.length===0){return e}return a(a({},e),{env:a(a({},e.env),{secret:a(a({},(0,n.omit)(e.env.secret,e.secretsAsFile)),Object.fromEntries(e.secretsAsFile.map((function(t){return[t+"_content",e.env.secret[t]]}))))})})};t.processSecretsAsFiles=processSecretsAsFiles},4986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDependencyTrackDeleteScript=t.getDependencyTrackUploadScript=t.sbomDeactivated=void 0;var a=r(7038);var n=r(1724);var sbomDeactivated=function(e){return(0,n.componentContextIsStandaloneBuild)(e)&&e.build.config.type==="custom"&&e.build.config.sbom===false};t.sbomDeactivated=sbomDeactivated;var getDependencyTrackUploadScript=function(e){return(0,t.sbomDeactivated)(e)?[]:["echo 'Uploading SBOM to Dependency Track'",'/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "'.concat(e.fullConfig.customerName,"-").concat(e.fullConfig.appName,"/").concat(e.name,'" "').concat(e.environment.url,'" "').concat(a.SBOM_FILE,'" vex.json || true')]};t.getDependencyTrackUploadScript=getDependencyTrackUploadScript;var getDependencyTrackDeleteScript=function(e){return(0,t.sbomDeactivated)(e)?[]:["echo 'Disabling component in Dependency Track'",'/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" disable "'.concat(e.fullConfig.customerName,"-").concat(e.fullConfig.appName,"/").concat(e.name,'" "').concat(e.environment.url,'" || true')]};t.getDependencyTrackDeleteScript=getDependencyTrackDeleteScript},461:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},6938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},5781:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});t.isOfDeployType=void 0;n(r(461),t);n(r(6938),t);n(r(835),t);n(r(282),t);var isOfDeployType=function(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}return e&&t.includes(e.type)?true:false};t.isOfDeployType=isOfDeployType},835:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},6054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.contextIsStoppable=t.getKubernetesNamespace=t.getFullKubernetesClusterName=void 0;var a=r(5781);var getFullKubernetesClusterName=function(e){if(e.type==="gcloud"){return"gke_".concat(e.projectId,"_").concat(e.region,"_").concat(e.name)}};t.getFullKubernetesClusterName=getFullKubernetesClusterName;var getKubernetesNamespace=function(e,t){return"".concat(e.customerName,"-").concat(e.appName,"-").concat(t)};t.getKubernetesNamespace=getKubernetesNamespace;var contextIsStoppable=function(e){var t;var r=(t=e.deploy)===null||t===void 0?void 0:t.config;if((0,a.isOfDeployType)(r,"kubernetes")){return true}if((0,a.isOfDeployType)(r,"google-cloudrun")){return true}if((0,a.isOfDeployType)(r,"custom")&&r.stopScript){return true}return false};t.contextIsStoppable=contextIsStoppable},603:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});n(r(7752),t);n(r(1853),t);n(r(7551),t);n(r(4058),t);n(r(3352),t);n(r(5875),t);n(r(7862),t);n(r(8483),t);n(r(2228),t)},1792:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:true});var a={version:"0.0.0"};try{var n=((r=require.main)===null||r===void 0?void 0:r.path)+"/../package.json";a=require(n)}catch(e){}t["default"]=a},3579:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createAllJobs=void 0;var s=r(8375);var p=r(6558);var l=r(1853);var d=r(2321);var c=r(803);var createAllJobs=function(e){return a(void 0,[e],void 0,(function(e){var t;var r;var u;var f=e.config,m=e.trigger,h=e.pipelineType;return n(this,(function(e){switch(e.label){case 0:return[4,(0,s.createAllComponentsContext)({config:f,trigger:m,pipelineType:h})];case 1:t=e.sent();r={};return[4,Promise.all(Object.keys((u=f.builds)!==null&&u!==void 0?u:{}).map((function(e){return a(void 0,void 0,void 0,(function(){var r,s;return n(this,(function(d){switch(d.label){case 0:r=t.filter((function(t){return(0,l.componentContextHasWorkspaceBuild)(t)&&t.build.workspaceName===e}));s=o([],i(new Set(r.map((function(e){var t=e.env;return t})))),false);return[4,Promise.all(s.map((function(t){return a(void 0,void 0,void 0,(function(){var a;return n(this,(function(n){switch(n.label){case 0:return[4,(0,p.createWorkspaceContext)({components:r.filter((function(e){var r=e.env;return r===t})),workspaceName:e,config:f,trigger:m,pipelineType:h,env:t})];case 1:a=n.sent();return[2,{context:a,jobs:(0,c.createJobsForWorkspace)(a)}]}}))}))})))];case 1:return[2,d.sent()]}}))}))}))).then((function(e){return e.flat()}))];case 2:return[2,(r.workspaces=e.sent(),r.components=t.map((function(e){return{context:e,jobs:(0,d.createJobsForComponentContext)(e)}})),r)]}}))}))};t.createAllJobs=createAllJobs},5139:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});t.createChildPipeline=void 0;var i=r(7551);var o=r(3579);var s=r(7585);var p=r(8862);var l=r(6551);var createChildPipeline=function(e,t,r){return a(void 0,void 0,void 0,(function(){var a,d,c;return n(this,(function(n){switch(n.label){case 0:return[4,(0,o.createAllJobs)({config:r,trigger:t,pipelineType:e})];case 1:a=n.sent();d=(0,s.getPipelineStages)(r);if(!(e==="gitlab"))return[3,3];return[4,(0,p.createGitlabJobs)(a)];case 2:c=n.sent();return[2,(0,l.createGitlabPipelineWithDefaults)({workflow:{rules:i.RULES_ALWAYS},stages:d,jobs:Object.fromEntries(c.map((function(e){var t=e.gitlabJob,r=e.name;return[r,t]}))),variables:r.runnerVariables})];case 3:throw new Error("".concat(e," is not supported"))}}))}))};t.createChildPipeline=createChildPipeline},2321:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createJobsForComponentContext=void 0;var s=r(7862);var p=r(8483);var injectDefaultVarsInCustomJobs=function(e,t){return t.map((function(t){var r;var i=t.variables,o=n(t,["variables"]);return a({variables:a(a({},(r=e.environment.envVars)!==null&&r!==void 0?r:{}),i!==null&&i!==void 0?i:{})},o)}))};var getCustomJobs=function(e){if(!e.customJobs){return[]}var t=e.customJobs;return injectDefaultVarsInCustomJobs(e,t)};var createJobsForComponentContext=function(e){var t=s.BUILD_TYPES[e.build.buildType].jobs(e);var r=e.componentConfig.deploy!==false?p.DEPLOY_TYPES[e.componentConfig.deploy.type].jobs(e):[];var a=getCustomJobs(e);return o(o(o([],i(t),false),i(r),false),i(a),false)};t.createJobsForComponentContext=createJobsForComponentContext},803:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createJobsForWorkspace=void 0;var a=r(7862);var createJobsForWorkspace=function(e){var t=a.WORKSPACE_BUILD_TYPES[e.build.buildType].jobs(e);return t};t.createJobsForWorkspace=createJobsForWorkspace},9192:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var s=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createMainPipeline=void 0;var p=r(7551);var l=r(7770);var d=r(3579);var c=r(7585);var u=r(8862);var f=r(6551);var m=r(6564);var createMainPipeline=function(e,t){return n(void 0,void 0,void 0,(function(){var r,p,h,v,y;return i(this,(function(b){switch(b.label){case 0:r=(0,c.getPipelineStages)(t);if(!(e==="gitlab"))return[3,2];return[4,Promise.all(l.ALL_PIPELINE_TRIGGERS.map((function(r){return n(void 0,void 0,void 0,(function(){var a;return i(this,(function(n){switch(n.label){case 0:a=u.createGitlabJobs;return[4,(0,d.createAllJobs)({config:t,trigger:r,pipelineType:e})];case 1:return[4,a.apply(void 0,[n.sent(),getGitlabRulesForTrigger(r)])];case 2:return[2,n.sent()]}}))}))}))).then((function(e){return e.flat()}))];case 1:p=b.sent();h=p.filter((function(e){return e.context.type==="workspace"})).sort((function(e,r){var a;var n=Object.keys((a=t.builds)!==null&&a!==void 0?a:{});var i=n.findIndex((function(t){return t===e.context.name}));var o=n.findIndex((function(e){return e===r.context.name}));return i-o}));v=p.filter((function(e){return e.context.type==="component"})).sort((function(e,r){var a=Object.keys(t.components);var n=a.findIndex((function(t){return t===e.context.name}));var i=a.findIndex((function(e){return e===r.context.name}));return n-i}));y=s(s([],o(h),false),o(v),false).reduce((function(e,t){var r,a;var n=t.gitlabJob,i=t.name;if(e[i]){e[i].rules=s(s([],o((r=e[i].rules)!==null&&r!==void 0?r:[]),false),o((a=n.rules)!==null&&a!==void 0?a:[]),false)}else{e[i]=n}return e}),{});return[2,(0,f.createGitlabPipelineWithDefaults)({stages:s(s([],o(r),false),["release"],false),jobs:a(a({},y),(0,m.getGitlabReleaseJobs)()),variables:t.runnerVariables})];case 2:throw new Error("".concat(e," is not supported"))}}))}))};t.createMainPipeline=createMainPipeline;function getGitlabRulesForTrigger(e){switch(e){case"mainBranch":return[p.RULE_NEVER_ON_RELEASE_COMMIT,p.RULE_IS_MAIN_BRANCH];case"mr":return[p.RULE_IS_MERGE_REQUEST];case"taggedRelease":return[p.RULE_IS_TAGGED_RELEASE]}}},6169:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};var s=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.generatePipelineFiles=t.generateLocalPipelineContent=t.generateChildPipelineContent=void 0;var p=r(2228);var l=r(5139);var d=r(9192);var c=r(7426);var u=r(2361);function generateChildPipelineContent(e,t){return n(this,void 0,void 0,(function(){var r,n,p,d,f,m,h,v,y;return i(this,(function(i){switch(i.label){case 0:r=(0,c.getPipelineTriggerForGitlabChildPipeline)();return[4,(0,l.createChildPipeline)(t,r,e)];case 1:n=i.sent(),p=n.jobs,d=n.image,f=n.stages,m=n.variables,h=n.workflow,v=o(n,["jobs","image","stages","variables","workflow"]);y=Object.fromEntries(Object.entries(p).map((function(e){var t=s(e,2),r=t[0],a=t[1];return[r,(0,u.sortGitLabJobDefProps)(a)]})));return[2,a(a({image:d,stages:f,variables:m,workflow:h},v),y)]}}))}))}t.generateChildPipelineContent=generateChildPipelineContent;function generateLocalPipelineContent(e,t){return n(this,void 0,void 0,(function(){var r,n,p,l,c,f,m,h;return i(this,(function(i){switch(i.label){case 0:return[4,(0,d.createMainPipeline)(t,e)];case 1:r=i.sent(),n=r.jobs,p=r.image,l=r.stages,c=r.variables,f=r.workflow,m=o(r,["jobs","image","stages","variables","workflow"]);h=Object.fromEntries(Object.entries(n).map((function(e){var t=s(e,2),r=t[0],a=t[1];return[r,(0,u.sortGitLabJobDefProps)(a)]})));return[2,a(a({image:p,stages:l,variables:c,workflow:f},m),h)]}}))}))}t.generateLocalPipelineContent=generateLocalPipelineContent;function generatePipelineFiles(e,t,r){return n(this,void 0,void 0,(function(){var a,n;return i(this,(function(i){switch(i.label){case 0:if(!(r==="childpipeline"))return[3,2];return[4,generateChildPipelineContent(e,t)];case 1:a=i.sent();return[2,(0,p.writeYamlfile)("__pipeline.yml",a)];case 2:return[4,generateLocalPipelineContent(e,t)];case 3:n=i.sent();return[2,(0,p.writeYamlfile)(".gitlab-ci.yml",n)]}}))}))}t.generatePipelineFiles=generatePipelineFiles},7585:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getPipelineStages=void 0;var i=r(3352);var o=r(7432);function getPipelineStages(e){var t=(0,i.getAllEnvsInAllComponents)(e).filter((function(e){return e!=="local"}));var r=o.BASE_STAGES.reduce((function(e,r){return n(n(n([],a(e),false),[r],false),a(t.map((function(e){return"".concat(r," ").concat(e)}))),false)}),[]);return r}t.getPipelineStages=getPipelineStages},8862:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};var s=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var p=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.createGitlabJobs=t.makeGitlabJob=t.GITLAB_ENVIRONMENT_URL_VARIABLE=void 0;var l=r(3255);var d=r(8133);var c=r(6484);var u=r(2497);var f=r(8490);var m=r(1073);t.GITLAB_ENVIRONMENT_URL_VARIABLE="CL_GITLAB_ENVIRONMENT_URL";var getFullJobName=function(e){var t=e.type,r=e.name,a=e.baseName,n=e.allJobs,i=e.env;var o=n.workspaces.length>0;var s=t==="component"?"🔹":"🔸";var p=o?s+" ":"";if(i){return"".concat(p).concat(a," ").concat(r," | ").concat(i," ")}return"".concat(p).concat(a," ").concat(r)};var getFullReferencedJobNameFromComponent=function(e,t,r,a){var n,i;var o=(i=(n=a.components.find((function(e){return e.context.name===t&&e.context.env===r})))===null||n===void 0?void 0:n.jobs)===null||i===void 0?void 0:i.find((function(t){return t.name===e}));if(!o){throw new Error("unknown job referenced: '".concat(e,"' from '").concat(r,":").concat(t,"'"))}var s=o.envMode!=="none"?r:null;return getFullJobName({type:"component",name:e,baseName:t,env:s,allJobs:a})};var getFullReferencedJobNameFromWorkspace=function(e,t,r,a){var n,i;var o=(i=(n=a.workspaces.find((function(e){return e.context.name===t})))===null||n===void 0?void 0:n.jobs)===null||i===void 0?void 0:i.find((function(t){return t.name===e}));if(!o){throw new Error("unknown job referenced: '".concat(e,"' from workspace ").concat(r,":").concat(t,"'"))}var s=o.envMode!=="none"?r:null;return getFullJobName({type:"workspace",name:e,baseName:t,env:s,allJobs:a})};var getJobName=function(e){return(0,l.isObject)(e)?e.job:e};var makeGitlabJob=function(e,t,r,n){var i,l;var h=t.environment,v=t.envMode,y=t.needsStages,b=t.needsOtherComponent,g=t.name,w=t.needs,_=t.jobTags,S=t.script,O=t.variables,A=t.runnerVariables,N=t.when,C=o(t,["environment","envMode","needsStages","needsOtherComponent","name","needs","jobTags","script","variables","runnerVariables","when"]);var k=v==="stagePerEnv"?"".concat(t.stage," ").concat(e.env):t.stage;var T=getGitlabNeeds(e,t,r);var D=getFullJobName({type:e.type,name:g,baseName:e.name,env:v!=="none"?e.env:undefined,allJobs:r});var I=["KUBERNETES_CPU_REQUEST","KUBERNETES_MEMORY_REQUEST","KUBERNETES_CPU_LIMIT","KUBERNETES_MEMORY_LIMIT"];var x=(0,f.collapseableSection)("injectvars","Injecting variables")(p([],s((0,d.getInjectVarsScript)(Object.fromEntries(Object.entries(O!==null&&O!==void 0?O:{}).filter((function(e){var t=s(e,1),r=t[0];return!I.includes(r)}))))),false));var P=Object.fromEntries(Object.entries(O!==null&&O!==void 0?O:{}).filter((function(e){var t=s(e,1),r=t[0];return I.includes(r)})));if(Object.keys(P).length>0){console.warn("Legacy variables detected in ".concat(D,": ").concat(Object.keys(P).join(", "),". Please move them to the runnerVariables key."))}var j=p(p([],s((i=t.rules)!==null&&i!==void 0?i:[]),false),s(n?n.map((function(e){return a({when:N},e)})):N?[{when:N}]:[]),false);var L=a(a({},C),{rules:j.length>0?j:undefined,variables:a(a({},P),A),script:p(p([],s(x),false),s((l=S===null||S===void 0?void 0:S.filter(u.notNil))!==null&&l!==void 0?l:[]),false),tags:_,stage:k,needs:T,retry:c.BASE_RETRY,interruptible:true});var R=addGitlabEnvironment(e,h,L,r);return[D,(0,m.removeUndefined)(R)]};t.makeGitlabJob=makeGitlabJob;var addGitlabEnvironment=function(e,r,n,i){var d,c;if(!r){return n}if(e.type!=="component"){return n}var u=e.env,f=e.name,m=e.environment;var h=m.url,v=m.envType;var y=r.on_stop,b=o(r,["on_stop"]);var g="gitlab_environment.env";var w=['echo "'.concat(t.GITLAB_ENVIRONMENT_URL_VARIABLE,"=").concat(h,'" >> ').concat(g)];var _=v==="review"?"".concat(u,"/$CI_COMMIT_REF_NAME/").concat(f):"".concat(u,"/").concat(f);return a(a({},n),{environment:a(a({name:_,url:"$".concat(t.GITLAB_ENVIRONMENT_URL_VARIABLE)},y?{on_stop:getFullReferencedJobNameFromComponent(y,f,u,i)}:{}),b),artifacts:(0,l.merge)((d=n.artifacts)!==null&&d!==void 0?d:{},{reports:{dotenv:"".concat(g)}}),script:p(p([],s((c=n.script)!==null&&c!==void 0?c:[]),false),s(w),false)})};var createGitlabJobs=function(e,r){return n(void 0,void 0,void 0,(function(){return i(this,(function(a){return[2,p(p([],s(e.workspaces),false),s(e.components),false).flatMap((function(a){var n=a.context,i=a.jobs;return i.map((function(a){var i=s((0,t.makeGitlabJob)(n,a,e,r),2),o=i[0],p=i[1];return{name:o,gitlabJob:p,context:n}}))}))]}))}))};t.createGitlabJobs=createGitlabJobs;function getGitlabNeeds(e,t,r){var a=e.type==="workspace"?getGitlabNeedsForWorkspaceJob(e,t,r):getGitlabNeedsForComponentJob(e,t,r);return deduplicateNeeds(a)}function deduplicateNeeds(e){return e?p([],s(new Map(e.map((function(e){return[(0,l.isObject)(e)?e.job:e,e]}))).values()),false):undefined}function getGitlabNeedsForComponentJob(e,t,r){var a=t.needsStages,n=t.needs,i=t.needsOtherComponent;var o=a===null||a===void 0?void 0:a.flatMap((function(t){var a,n,i,o,s,p,l,d;var c=e.name;if(!t.workspaceName){var u=(i=(n=(a=r.components.filter((function(t){return t.context.name===c&&t.context.env===e.env})).flatMap((function(e){return e.jobs})))===null||a===void 0?void 0:a.filter((function(e){return e.stage===t.stage})))===null||n===void 0?void 0:n.map((function(e){return e.name})))!==null&&i!==void 0?i:[];return u.map((function(e){var r;return{job:e,artifacts:(r=t.artifacts)!==null&&r!==void 0?r:false,componentName:c}}))}else{var u=(d=(l=(p=(s=(o=r.workspaces.find((function(r){return r.context.name===t.workspaceName&&r.context.env===e.env})))===null||o===void 0?void 0:o.jobs)===null||s===void 0?void 0:s.flatMap((function(e){return e})))===null||p===void 0?void 0:p.filter((function(e){return e.stage===t.stage})))===null||l===void 0?void 0:l.map((function(e){return e.name})))!==null&&d!==void 0?d:[];return u.map((function(e){var r;return{job:e,artifacts:(r=t.artifacts)!==null&&r!==void 0?r:false,workspaceName:t.workspaceName}}))}}));var d=p(p(p([],s(o!==null&&o!==void 0?o:[]),false),s(n!==null&&n!==void 0?n:[]),false),s(i!==null&&i!==void 0?i:[]),false);return d===null||d===void 0?void 0:d.map((function(t){var a;return(0,l.isObject)(t)?"workspaceName"in t?{job:getFullReferencedJobNameFromWorkspace(t.job,t.workspaceName,e.env,r),artifacts:t.artifacts}:{job:getFullReferencedJobNameFromComponent(t.job,(a=t.componentName)!==null&&a!==void 0?a:e.name,e.env,r),artifacts:t.artifacts}:getFullReferencedJobNameFromComponent(t,e.name,e.env,r)})).sort((function(e,t){return getJobName(e).localeCompare(getJobName(t))}))}function getGitlabNeedsForWorkspaceJob(e,t,r){var a=t.needsStages,n=t.needs;var i=a===null||a===void 0?void 0:a.flatMap((function(t){var a,n,i,o;var s=(a=t.workspaceName)!==null&&a!==void 0?a:e.name;var p=(o=(i=(n=r.workspaces.filter((function(t){return t.context.name===s&&t.context.env===e.env})).flatMap((function(e){return e.jobs})))===null||n===void 0?void 0:n.filter((function(e){return e.stage===t.stage})))===null||i===void 0?void 0:i.map((function(e){return e.name})))!==null&&o!==void 0?o:[];return p.map((function(e){var r;return{job:e,artifacts:(r=t.artifacts)!==null&&r!==void 0?r:false,workspaceName:s}}))}));var o=p(p([],s(i!==null&&i!==void 0?i:[]),false),s(n!==null&&n!==void 0?n:[]),false);return o===null||o===void 0?void 0:o.map((function(t){return(0,l.isObject)(t)?{job:getFullReferencedJobNameFromWorkspace(t.job,"workspaceName"in t&&t.workspaceName?t.workspaceName:e.name,e.env,r),artifacts:t.artifacts}:getFullReferencedJobNameFromWorkspace(t,e.name,e.env,r)})).sort((function(e,t){return getJobName(e).localeCompare(getJobName(t))}))}},6551:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__rest||function(e,t){var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0)r[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++){if(t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n]))r[a[n]]=e[a[n]]}return r};Object.defineProperty(t,"__esModule",{value:true});t.createGitlabPipelineWithDefaults=void 0;var i=r(4058);var createGitlabPipelineWithDefaults=function(e){var t=e.image,r=e.variables,o=n(e,["image","variables"]);return a({image:t!==null&&t!==void 0?t:(0,i.getRunnerImage)("jobs-default"),variables:a({FF_USE_FASTZIP:"true",ARTIFACT_COMPRESSION_LEVEL:"fast",CACHE_COMPRESSION_LEVEL:"fast",TRANSFER_METER_FREQUENCY:"5s",GIT_DEPTH:"1"},r!==null&&r!==void 0?r:{})},o)};t.createGitlabPipelineWithDefaults=createGitlabPipelineWithDefaults},7426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getPipelineTriggerForGitlabChildPipeline=void 0;var a=r(2898);function getPipelineTriggerForGitlabChildPipeline(){var e=process.env,t=e.CI_MERGE_REQUEST_ID,r=e.CI_COMMIT_TAG,n=e.CI_COMMIT_BRANCH,i=e.CI_DEFAULT_BRANCH;var o=Boolean(i)&&n===i;var s=n?/^[0-9]+\.([0-9]+|x)\.x$/.test(n):false;var p=Boolean(t);var l=Boolean(r);console.info("catladder version ".concat(a.PIPELINE_IMAGE_TAG));var d=p||s?"mr":o?"mainBranch":l?"taggedRelease":null;if(!d){throw new Error("no matching trigger: "+JSON.stringify({isMergeRequest:p,isDefaultBranch:o,isTaggedRelease:l},null,2))}return d}t.getPipelineTriggerForGitlabChildPipeline=getPipelineTriggerForGitlabChildPipeline},6564:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getGitlabReleaseJobs=void 0;var a=r(7551);var n=r(4058);var i="echo '👉 The project access token might be invald - run `project-renew-token` in catladder CLI to fix.'";var getGitlabReleaseJobs=function(){var e;return e={},e["create release"]={stage:"release",image:(0,n.getRunnerImage)("semantic-release"),script:["semanticRelease"],after_script:[i],rules:a.RULES_RELEASE},e["⚠️ force create release"]={stage:"release",image:(0,n.getRunnerImage)("semantic-release"),script:["semanticRelease"],after_script:[i],needs:[],rules:a.RULES_MANUAL_RELEASE},e};t.getGitlabReleaseJobs=getGitlabReleaseJobs},2361:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.sortGitLabJobDefProps=void 0;var r=["stage","tags","image","services","variables","before_script","script","after_script","cache","coverage","environment","release","artifacts","rules","only","except","needs","dependencies","trigger","retry","interruptible","allow_failure","parallel","hooks","resource_group"];var sortGitLabJobDefKeys=function(e){return Object.keys(e).sort((function(e,t){return r.indexOf(e)===-1&&r.indexOf(t)===-1?0:r.indexOf(e)===-1?1:r.indexOf(t)===-1?-1:r.indexOf(e)-r.indexOf(t)}))};var sortGitLabJobDefProps=function(e){return sortGitLabJobDefKeys(e).reduce((function(t,r){var a;return e[r]!==undefined?Object.assign(t,(a={},a[r]=e[r],a)):t}),{})};t.sortGitLabJobDefProps=sortGitLabJobDefProps},7752:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});n(r(5139),t);n(r(2321),t);n(r(6169),t);n(r(6564),t)},6451:function(e,t,r){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return a.apply(this,arguments)};var n=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var i=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var o=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var s=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.getPackageManagerInfoBase=t.getPackageManagerInfoForComponent=void 0;var p=r(7147);var l=r(1017);var d=r(4843);var c=r(7843);var getPackageManagerInfoForComponent=function(e,r){return n(void 0,void 0,void 0,(function(){var n,u,f,m,h,v,y,b,g,w,_,S,O;return i(this,(function(i){switch(i.label){case 0:return[4,(0,t.getPackageManagerInfoBase)()];case 1:n=i.sent();u=n.workspaces;f=e.components[r];m=u.find((function(e){return(0,d.pathEqual)(f.dir,e.location)}));h=Boolean(m);v=".";y=(0,l.join)(f.dir,"package.json");b=h?(0,l.join)(v,"package.json"):null;g=h?(0,l.join)(v,"yarn.lock"):(0,l.join)(f.dir,"yarn.lock");w=[".yarnrc",".yarnrc.yml",".npmrc",".yarn"];_=s(s([],o(w),false),o(w.map((function(e){return(0,l.join)(f.dir,e)}))),false).filter((function(e){return(0,p.existsSync)(e)}));S=m?(0,c.getWorkspaceDependencies)(m,u):[];O=s(s(s(s([y],o(b?[b]:[]),false),[g],false),o(_),false),o(S),false);return[2,a(a({},n),{currentWorkspace:m,currentWorkspaceDependencies:S,componentIsInWorkspace:h,pathsToCopyInDocker:O})]}}))}))};t.getPackageManagerInfoForComponent=getPackageManagerInfoForComponent;var getPackageManagerInfoBase=function(){return n(void 0,void 0,void 0,(function(){var e,t,r;return i(this,(function(a){switch(a.label){case 0:return[4,(0,c.getYarnVersion)()];case 1:e=a.sent();if(!e)throw new Error("could not get yarn version");t=e.startsWith("1");return[4,(0,c.getWorkspaces)(t)];case 2:r=a.sent();return[2,{type:"yarn",workspaces:r,version:e,isClassic:t}]}}))}))};t.getPackageManagerInfoBase=getPackageManagerInfoBase},7843:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var o=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getWorkspaceDependencies=t.getWorkspaces=t.getYarnVersion=void 0;var p=r(5763);var l=s(r(5839));var d=r(6046);var execOrFail=function(e,t){return a(void 0,void 0,void 0,(function(){var r;return n(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);return[4,(0,p.exec)(e).then((function(e){return e.stdout}))];case 1:return[2,a.sent()];case 2:r=a.sent();return[2,t!==null&&t!==void 0?t:null];case 3:return[2]}}))}))};t.getYarnVersion=(0,l.default)((function(){return a(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,execOrFail("yarn --version","")];case 1:return[2,e.sent()]}}))}))}),{promise:true});t.getWorkspaces=(0,l.default)((function(e){return a(void 0,void 0,void 0,(function(){var t,r,a,i,o,s,p;var l,c;return n(this,(function(n){switch(n.label){case 0:if(!e)return[3,2];a=(r=Object).values;i=d.jsonParseOrThrow;o=d.jsonParseOrThrow;return[4,execOrFail("yarn workspaces --json info","{}")];case 1:t=a.apply(r,[i.apply(void 0,[(c=(l=o.apply(void 0,[n.sent()]))===null||l===void 0?void 0:l.data)!==null&&c!==void 0?c:"{}"])]);return[3,4];case 2:s=d.jsonParseOrThrow;p="[".concat;return[4,execOrFail("yarn workspaces list --json --verbose","")];case 3:t=s.apply(void 0,[p.apply("[",[n.sent().trim().split("\n").join(","),"]"])]);n.label=4;case 4:return[2,t]}}))}))}),{promise:true});var getWorkspaceDependencies=function(e,r){return e?o(o([],i(e.workspaceDependencies),false),i(e.mismatchedWorkspaceDependencies),false).flatMap((function(e){var a=r.find((function(t){return t.location===e}));if(a){return o(o([],i((0,t.getWorkspaceDependencies)(a,r)),false),[a.location],false)}return[]})).filter(Boolean):[]};t.getWorkspaceDependencies=getWorkspaceDependencies},7551:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.RULES_MANUAL_RELEASE=t.RULES_RELEASE=t.RULE_CONDITION_HOTFIX_BRANCH=t.RULES_ALWAYS=t.RULE_IS_TAGGED_RELEASE=t.RULE_IS_MERGE_REQUEST=t.RULE_NEVER_ON_SCHEDULE=t.RULE_NEVER_ON_RELEASE_COMMIT=t.RULE_IS_MAIN_BRANCH=t.RULE_CONDITION_MAIN_BRANCH=void 0;t.RULE_CONDITION_MAIN_BRANCH="$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH";t.RULE_IS_MAIN_BRANCH={if:t.RULE_CONDITION_MAIN_BRANCH};t.RULE_NEVER_ON_RELEASE_COMMIT={if:"$CI_COMMIT_MESSAGE =~ /^chore\\(release\\).*/",when:"never"};t.RULE_NEVER_ON_SCHEDULE={if:'$CI_PIPELINE_SOURCE == "schedule"',when:"never"};t.RULE_IS_MERGE_REQUEST={if:"$CI_MERGE_REQUEST_ID"};t.RULE_IS_TAGGED_RELEASE={if:"$CI_COMMIT_TAG"};t.RULES_ALWAYS=[t.RULE_IS_TAGGED_RELEASE,t.RULE_NEVER_ON_RELEASE_COMMIT,t.RULE_NEVER_ON_SCHEDULE,{if:"$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/"},{if:"$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"},t.RULE_IS_MERGE_REQUEST];t.RULE_CONDITION_HOTFIX_BRANCH="$CI_COMMIT_BRANCH =~ /^[0-9]+.([0-9]+|x).x$/";t.RULES_RELEASE=[t.RULE_NEVER_ON_RELEASE_COMMIT,t.RULE_NEVER_ON_SCHEDULE,{if:t.RULE_CONDITION_MAIN_BRANCH+' && $AUTO_RELEASE == "true"',when:"on_success"},{if:t.RULE_CONDITION_MAIN_BRANCH,when:"manual"},{if:t.RULE_CONDITION_HOTFIX_BRANCH,when:"manual"}];t.RULES_MANUAL_RELEASE=[t.RULE_NEVER_ON_RELEASE_COMMIT,t.RULE_NEVER_ON_SCHEDULE,{if:t.RULE_CONDITION_MAIN_BRANCH,when:"manual"},{if:t.RULE_CONDITION_HOTFIX_BRANCH,when:"manual"}]},4058:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getRunnerImage=void 0;var a=r(2898);var getRunnerImage=function(e){return a.DOCKER_REGISTRY+"/"+e+":"+a.PIPELINE_IMAGE_TAG};t.getRunnerImage=getRunnerImage},7770:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.isKnowEnvType=t.DEFAULT_ENV_TYPES=t.DEFAULT_ENVS=t.getEnvTypesByTrigger=t.ENV_TYPES=t.ALL_PIPELINE_TRIGGERS=void 0;t.ALL_PIPELINE_TRIGGERS=["mainBranch","mr","taggedRelease"];t.ENV_TYPES={dev:{triggers:["mainBranch"]},review:{triggers:["mr"]},stage:{triggers:["taggedRelease"]},prod:{triggers:["taggedRelease"]},local:{triggers:[]}};var getEnvTypesByTrigger=function(e){return Object.entries(t.ENV_TYPES).filter((function(t){var a=r(t,2),n=a[1];return n.triggers.includes(e)})).map((function(e){var t=r(e,1),a=t[0];return a}))};t.getEnvTypesByTrigger=getEnvTypesByTrigger;t.DEFAULT_ENVS=Object.keys(t.ENV_TYPES);t.DEFAULT_ENV_TYPES=t.DEFAULT_ENVS;var isKnowEnvType=function(e){return e in t.ENV_TYPES};t.isKnowEnvType=isKnowEnvType},1724:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.componentContextHasWorkspaceBuild=t.componentContextIsStandaloneBuild=void 0;var componentContextIsStandaloneBuild=function(e){return e.build.type==="standalone"};t.componentContextIsStandaloneBuild=componentContextIsStandaloneBuild;var componentContextHasWorkspaceBuild=function(e){return e.build.type==="fromWorkspace"};t.componentContextHasWorkspaceBuild=componentContextHasWorkspaceBuild},688:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1853:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,a,n)}:function(e,t,r,a){if(a===undefined)a=r;e[a]=t[r]});var n=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))a(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});n(r(7770),t);n(r(688),t);n(r(1724),t);n(r(2074),t)},7432:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BASE_STAGES=void 0;t.BASE_STAGES=["setup","test","build","deploy","verify","rollback","stop"]},2074:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},8490:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var a=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.collapseableSection=t.repeatOnFailure=t.sanitizeForBashVariable=t.allowFailureInScripts=void 0;var allowFailureInScripts=function(e){return a(a(["set +e"],r(e),false),["set -e"],false)};t.allowFailureInScripts=allowFailureInScripts;var sanitizeForBashVariable=function(e){return e.replace(/-/g,"_")};t.sanitizeForBashVariable=sanitizeForBashVariable;var repeatOnFailure=function(e,t){return"\n until ".concat(e,'\n do\n echo "Trying again."\n sleep ').concat(t.pauseInSeconds,"\n done\n ")};t.repeatOnFailure=repeatOnFailure;var collapseableSection=function(e,t){return function(n){return a(a(['echo -e "\\e[0Ksection_start:$(date +%s):'.concat(e,"[collapsed=true]\\r\\e[0K").concat(t,'"')],r(n),false),['echo -e "\\e[0Ksection_end:$(date +%s):'.concat(e,'\\r\\e[0K"')],false)}};t.collapseableSection=collapseableSection},2497:function(e,t,r){"use strict";var a=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};var n=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,n=t.length,i;a<n;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:true});t.mergeWithMergingArrays=t.ensureArray=t.notNil=void 0;var i=r(3255);function notNil(e){return e!==null&&e!==undefined}t.notNil=notNil;var ensureArray=function(e){return(0,i.isNil)(e)?null:Array.isArray(e)?e:[e]};t.ensureArray=ensureArray;var mergeWithMergingArrays=function(e,t){return(0,i.mergeWith)({},e,t,(function(e,t){return Array.isArray(e)&&Array.isArray(t)?n(n([],a(e),false),a(t),false):undefined}))};t.mergeWithMergingArrays=mergeWithMergingArrays},6046:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.jsonParseOrThrow=void 0;var jsonParseOrThrow=function(e){try{return JSON.parse(e)}catch(t){throw new Error("could not parse json: ".concat(e))}};t.jsonParseOrThrow=jsonParseOrThrow},1073:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r=typeof Symbol==="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),n,i=[],o;try{while((t===void 0||t-- >0)&&!(n=a.next()).done)i.push(n.value)}catch(e){o={error:e}}finally{try{if(n&&!n.done&&(r=a["return"]))r.call(a)}finally{if(o)throw o.error}}return i};Object.defineProperty(t,"__esModule",{value:true});t.removeUndefined=void 0;var removeUndefined=function(e){return Object.fromEntries(Object.entries(e).filter((function(e){var t=r(e,2),a=t[1];return a!==undefined})))};t.removeUndefined=removeUndefined},2228:function(e,t,r){"use strict";var a=this&&this.__awaiter||function(e,t,r,a){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(a.next(e))}catch(e){n(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))};var n=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.writeYamlfile=t.yamlStringifyOptions=t.writeGeneratedFile=t.getAutoGeneratedHeader=void 0;var o=r(3292);var s=r(8033);var p=i(r(1792));var getAutoGeneratedHeader=function(e){return["-------------------------------------------------","🐱 🔨 This file is generated by catladder v".concat(p.default.version),"🚨 Do not edit this file manually 🚨","-------------------------------------------------"].map((function(t){return"".concat(e," ").concat(t)})).join("\n").concat("\n")};t.getAutoGeneratedHeader=getAutoGeneratedHeader;var writeGeneratedFile=function(e,r,i){return a(void 0,[e,r,i],void 0,(function(e,r,a){var i=a.commentChar;return n(this,(function(a){switch(a.label){case 0:return[4,(0,o.writeFile)(e,[(0,t.getAutoGeneratedHeader)(i),r].join("\n"),{encoding:"utf-8"})];case 1:a.sent();return[2]}}))}))};t.writeGeneratedFile=writeGeneratedFile;t.yamlStringifyOptions={lineWidth:0,doubleQuotedAsJSON:true,singleQuote:true};var writeYamlfile=function(e,r){return a(void 0,void 0,void 0,(function(){return n(this,(function(a){switch(a.label){case 0:return[4,(0,t.writeGeneratedFile)(e,(0,s.stringify)(r,t.yamlStringifyOptions),{commentChar:"#"})];case 1:a.sent();return[2]}}))}))};t.writeYamlfile=writeYamlfile},5763:(e,t,r)=>{"use strict";if(r(5761).major>=4){e.exports=r(2114)}else{e.exports=r(3276)}},8934:e=>{"use strict";function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var t=function(e){_inherits(ChildProcessError,e);function ChildProcessError(e,t,r,a,n){_classCallCheck(this,ChildProcessError);var i=_possibleConstructorReturn(this,(ChildProcessError.__proto__||Object.getPrototypeOf(ChildProcessError)).call(this,e));Error.captureStackTrace(i,i.constructor);i.name=i.constructor.name;i.code=t;i.childProcess=r;i.stdout=a;i.stderr=n;return i}return ChildProcessError}(Error);e.exports=t},7510:(e,t,r)=>{"use strict";var a=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||false;a.configurable=true;if("value"in a)a.writable=true;Object.defineProperty(e,a.key,a)}}return function(e,t,r){if(t)defineProperties(e.prototype,t);if(r)defineProperties(e,r);return e}}();var n=function get(e,t,r){if(e===null)e=Function.prototype;var a=Object.getOwnPropertyDescriptor(e,t);if(a===undefined){var n=Object.getPrototypeOf(e);if(n===null){return undefined}else{return get(n,t,r)}}else if("value"in a){return a.value}else{var i=a.get;if(i===undefined){return undefined}return i.call(r)}};function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var i;if(r(5761).major>=4){i=global.Promise}else{i=r(3322)}var o=function(e){_inherits(ChildProcessPromise,e);function ChildProcessPromise(e){_classCallCheck(this,ChildProcessPromise);var t;var r;var a=_possibleConstructorReturn(this,(ChildProcessPromise.__proto__||Object.getPrototypeOf(ChildProcessPromise)).call(this,(function(a,n){t=a;r=n;if(e){e(t,r)}})));a._cpResolve=t;a._cpReject=r;a.childProcess=undefined;return a}a(ChildProcessPromise,[{key:"progress",value:function progress(e){var t=this;process.nextTick((function(){e(t.childProcess)}));return this}},{key:"then",value:function then(e,t){var r=n(ChildProcessPromise.prototype.__proto__||Object.getPrototypeOf(ChildProcessPromise.prototype),"then",this).call(this,e,t);r.childProcess=this.childProcess;return r}},{key:"catch",value:function _catch(e){var t=n(ChildProcessPromise.prototype.__proto__||Object.getPrototypeOf(ChildProcessPromise.prototype),"catch",this).call(this,e);t.childProcess=this.childProcess;return t}},{key:"done",value:function done(){this.catch((function(e){process.nextTick((function(){throw e}))}))}}]);return ChildProcessPromise}(i);o.prototype.fail=o.prototype.catch;e.exports=o},3276:(e,t,r)=>{"use strict";var a=r(2081);var n=r(1891);var i=r(7510);var o=r(8934);var s=Array.prototype.slice;function doExec(e,t){var r;var n=new i;var p=n._cpReject;var l=n._cpResolve;var d=s.call(t,0);d.push(callback);r=a[e].apply(a,d);function callback(e,n,i){if(e){var s=t[0]+(Array.isArray(t[1])?" "+t[1].join(" "):"");e.message+=" `"+s+"` (exited with error code "+e.code+")";e.stdout=n;e.stderr=i;var d=new o(e.message,e.code,a,n,i);p(d)}else{l({childProcess:r,stdout:n,stderr:i})}}n.childProcess=r;return n}function exec(){return doExec("exec",arguments)}function execFile(){return doExec("execFile",arguments)}function doSpawn(e,t,r,a){var n={};var s;var p=new i;var l=p._cpReject;var d=p._cpResolve;var c=a&&a.successfulExitCodes||[0];s=e(t,r,a);var u=false;var f=false;var m=a&&a.capture;if(m){for(var h=0,v=m.length;h<v;h++){var y=m[h];if(y==="stdout"){u=true}else if(y==="stderr"){f=true}}}n.childProcess=s;if(u){n.stdout="";s.stdout.on("data",(function(e){n.stdout+=e}))}if(f){n.stderr="";s.stderr.on("data",(function(e){n.stderr+=e}))}s.on("error",l);s.on("close",(function(e){if(c.indexOf(e)===-1){var a=t+(r.length?" "+r.join(" "):"");var i="`"+a+"` failed with code "+e;var p=new o(i,e,s);if(f){p.stderr=n.stderr.toString()}if(u){p.stdout=n.stdout.toString()}l(p)}else{n.code=e;d(n)}}));p.childProcess=s;return p}function spawn(e,t,r){return doSpawn(n,e,t,r)}function fork(e,t,r){return doSpawn(a.fork,e,t,r)}t.exec=exec;t.execFile=execFile;t.spawn=spawn;t.fork=fork},5170:e=>{"use strict";class ChildProcessError extends Error{constructor(e,t,r,a,n){super(e);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=t;this.childProcess=r;this.stdout=a;this.stderr=n}}e.exports=ChildProcessError},9308:(e,t,r)=>{"use strict";var a;if(r(5761).major>=4){a=global.Promise}else{a=r(3322)}class ChildProcessPromise extends a{constructor(e){var t;var r;super(((a,n)=>{t=a;r=n;if(e){e(t,r)}}));this._cpResolve=t;this._cpReject=r;this.childProcess=undefined}progress(e){process.nextTick((()=>{e(this.childProcess)}));return this}then(e,t){var r=super.then(e,t);r.childProcess=this.childProcess;return r}catch(e){var t=super.catch(e);t.childProcess=this.childProcess;return t}done(){this.catch((e=>{process.nextTick((()=>{throw e}))}))}}ChildProcessPromise.prototype.fail=ChildProcessPromise.prototype.catch;e.exports=ChildProcessPromise},2114:(e,t,r)=>{"use strict";var a=r(2081);var n=r(1891);var i=r(9308);var o=r(5170);var s=Array.prototype.slice;function doExec(e,t){var r;var n=new i;var p=n._cpReject;var l=n._cpResolve;var d=s.call(t,0);d.push(callback);r=a[e].apply(a,d);function callback(e,n,i){if(e){var s=t[0]+(Array.isArray(t[1])?" "+t[1].join(" "):"");e.message+=" `"+s+"` (exited with error code "+e.code+")";e.stdout=n;e.stderr=i;var d=new o(e.message,e.code,a,n,i);p(d)}else{l({childProcess:r,stdout:n,stderr:i})}}n.childProcess=r;return n}function exec(){return doExec("exec",arguments)}function execFile(){return doExec("execFile",arguments)}function doSpawn(e,t,r,a){var n={};var s;var p=new i;var l=p._cpReject;var d=p._cpResolve;var c=a&&a.successfulExitCodes||[0];s=e(t,r,a);var u=false;var f=false;var m=a&&a.capture;if(m){for(var h=0,v=m.length;h<v;h++){var y=m[h];if(y==="stdout"){u=true}else if(y==="stderr"){f=true}}}n.childProcess=s;if(u){n.stdout="";s.stdout.on("data",(function(e){n.stdout+=e}))}if(f){n.stderr="";s.stderr.on("data",(function(e){n.stderr+=e}))}s.on("error",l);s.on("close",(function(e){if(c.indexOf(e)===-1){var a=t+(r.length?" "+r.join(" "):"");var i="`"+a+"` failed with code "+e;var p=new o(i,e,s);if(f){p.stderr=n.stderr.toString()}if(u){p.stdout=n.stdout.toString()}l(p)}else{n.code=e;d(n)}}));p.childProcess=s;return p}function spawn(e,t,r){return doSpawn(n,e,t,r)}function fork(e,t,r){return doSpawn(a.fork,e,t,r)}t.exec=exec;t.execFile=execFile;t.spawn=spawn;t.fork=fork},1891:(e,t,r)=>{"use strict";var a=r(2081);var n=r(7338);var i=r(499);var o=a.spawnSync;function spawn(e,t,r){var o;var s;o=n(e,t,r);s=a.spawn(o.command,o.args,o.options);i.hookChildProcess(s,o);return s}function spawnSync(e,t,a){var s;var p;if(!o){try{o=r(9904)}catch(e){throw new Error("In order to use spawnSync on node 0.10 or older, you must "+"install spawn-sync:\n\n"+" npm install spawn-sync --save")}}s=n(e,t,a);p=o(s.command,s.args,s.options);p.error=p.error||i.verifyENOENTSync(p.status,s);return p}e.exports=spawn;e.exports.spawn=spawn;e.exports.sync=spawnSync;e.exports._parse=n;e.exports._enoent=i},499:(e,t,r)=>{"use strict";var a=process.platform==="win32";var n=r(6997);var i=process.version.indexOf("v0.10.")===0;function notFoundError(e,t){var r;r=new Error(t+" "+e+" ENOENT");r.code=r.errno="ENOENT";r.syscall=t+" "+e;return r}function hookChildProcess(e,t){var r;if(!a){return}r=e.emit;e.emit=function(a,n){var i;if(a==="exit"){i=verifyENOENT(n,t,"spawn");if(i){return r.call(e,"error",i)}}return r.apply(e,arguments)}}function verifyENOENT(e,t){if(a&&e===1&&!t.file){return notFoundError(t.original,"spawn")}return null}function verifyENOENTSync(e,t){if(a&&e===1&&!t.file){return notFoundError(t.original,"spawnSync")}if(i&&e===-1){t.file=a?t.file:n(t.original);if(!t.file){return notFoundError(t.original,"spawnSync")}}return null}e.exports.hookChildProcess=hookChildProcess;e.exports.verifyENOENT=verifyENOENT;e.exports.verifyENOENTSync=verifyENOENTSync;e.exports.notFoundError=notFoundError},4105:e=>{"use strict";e.exports=function(){if(process.platform!=="win32"){return false}var e=process.version.substr(1).split(".").map((function(e){return parseInt(e,10)}));return e[0]===0&&e[1]<12}()},7338:(e,t,r)=>{"use strict";var a=r(7147);var n=r(4144);var i=r(6997);var o=r(4105);var s=process.platform==="win32";var p=new n({max:50,maxAge:30*1e3});function readShebang(e){var t;var r;var n;var i;if(p.has(e)){return p.get(e)}t=new Buffer(150);try{r=a.openSync(e,"r");a.readSync(r,t,0,150,0);a.closeSync(r)}catch(e){}n=t.toString().trim().match(/#!(.+)/i);if(n){i=n[1].replace(/\/usr\/bin\/env\s+/i,"")}p.set(e,i);return i}function escapeArg(e,t){e=""+e;if(!t){e=e.replace(/([\(\)%!\^<>&|;,"'\s])/g,"^$1")}else{e=e.replace(/(\\*)"/g,'$1$1\\"');e=e.replace(/(\\*)$/,"$1$1");e='"'+e+'"'}return e}function escapeCommand(e){return/^[a-z0-9_-]+$/i.test(e)?e:escapeArg(e,true)}function requiresShell(e){return!/\.(?:com|exe)$/i.test(e)}function parse(e,t,r){var a;var n;var p;var l;var d;if(t&&!Array.isArray(t)){r=t;t=null}t=t?t.slice(0):[];r=r||{};l=e;if(s){p=i(e);p=p||i(e,true);a=p&&readShebang(p);d=r.shell||o;if(a){t.unshift(p);e=a;d=d||requiresShell(i(a)||i(a,true))}else{d=d||requiresShell(p)}if(d){n=e!=="echo";e=escapeCommand(e);t=t.map((function(e){return escapeArg(e,n)}));t=["/s","/c",'"'+e+(t.length?" "+t.join(" "):"")+'"'];e=process.env.comspec||"cmd.exe";r.windowsVerbatimArguments=true}}return{command:e,args:t,options:r,file:p,original:l}}e.exports=parse},6997:(e,t,r)=>{"use strict";var a=r(1017);var n=r(3623);var i=r(4144);var o=new i({max:50,maxAge:30*1e3});function resolveCommand(e,t){var r;t=!!t;r=o.get(e+"!"+t);if(o.has(e)){return o.get(e)}try{r=!t?n.sync(e):n.sync(e,{pathExt:a.delimiter+(process.env.PATHEXT||"")})}catch(e){}o.set(e+"!"+t,r);return r}e.exports=resolveCommand},4144:(e,t,r)=>{"use strict";e.exports=LRUCache;var a=r(3925);var n=r(3837);var i=r(4071);var o=typeof Symbol==="function"&&process.env._nodeLRUCacheForceNoSymbol!=="1";var s;if(o){s=function(e){return Symbol(e)}}else{s=function(e){return"_"+e}}var p=s("max");var l=s("length");var d=s("lengthCalculator");var c=s("allowStale");var u=s("maxAge");var f=s("dispose");var m=s("noDisposeOnSet");var h=s("lruList");var v=s("cache");function naiveLength(){return 1}function LRUCache(e){if(!(this instanceof LRUCache)){return new LRUCache(e)}if(typeof e==="number"){e={max:e}}if(!e){e={}}var t=this[p]=e.max;if(!t||!(typeof t==="number")||t<=0){this[p]=Infinity}var r=e.length||naiveLength;if(typeof r!=="function"){r=naiveLength}this[d]=r;this[c]=e.stale||false;this[u]=e.maxAge||0;this[f]=e.dispose;this[m]=e.noDisposeOnSet||false;this.reset()}Object.defineProperty(LRUCache.prototype,"max",{set:function(e){if(!e||!(typeof e==="number")||e<=0){e=Infinity}this[p]=e;trim(this)},get:function(){return this[p]},enumerable:true});Object.defineProperty(LRUCache.prototype,"allowStale",{set:function(e){this[c]=!!e},get:function(){return this[c]},enumerable:true});Object.defineProperty(LRUCache.prototype,"maxAge",{set:function(e){if(!e||!(typeof e==="number")||e<0){e=0}this[u]=e;trim(this)},get:function(){return this[u]},enumerable:true});Object.defineProperty(LRUCache.prototype,"lengthCalculator",{set:function(e){if(typeof e!=="function"){e=naiveLength}if(e!==this[d]){this[d]=e;this[l]=0;this[h].forEach((function(e){e.length=this[d](e.value,e.key);this[l]+=e.length}),this)}trim(this)},get:function(){return this[d]},enumerable:true});Object.defineProperty(LRUCache.prototype,"length",{get:function(){return this[l]},enumerable:true});Object.defineProperty(LRUCache.prototype,"itemCount",{get:function(){return this[h].length},enumerable:true});LRUCache.prototype.rforEach=function(e,t){t=t||this;for(var r=this[h].tail;r!==null;){var a=r.prev;forEachStep(this,e,r,t);r=a}};function forEachStep(e,t,r,a){var n=r.value;if(isStale(e,n)){del(e,r);if(!e[c]){n=undefined}}if(n){t.call(a,n.value,n.key,e)}}LRUCache.prototype.forEach=function(e,t){t=t||this;for(var r=this[h].head;r!==null;){var a=r.next;forEachStep(this,e,r,t);r=a}};LRUCache.prototype.keys=function(){return this[h].toArray().map((function(e){return e.key}),this)};LRUCache.prototype.values=function(){return this[h].toArray().map((function(e){return e.value}),this)};LRUCache.prototype.reset=function(){if(this[f]&&this[h]&&this[h].length){this[h].forEach((function(e){this[f](e.key,e.value)}),this)}this[v]=new a;this[h]=new i;this[l]=0};LRUCache.prototype.dump=function(){return this[h].map((function(e){if(!isStale(this,e)){return{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}}}),this).toArray().filter((function(e){return e}))};LRUCache.prototype.dumpLru=function(){return this[h]};LRUCache.prototype.inspect=function(e,t){var r="LRUCache {";var a=false;var i=this[c];if(i){r+="\n allowStale: true";a=true}var o=this[p];if(o&&o!==Infinity){if(a){r+=","}r+="\n max: "+n.inspect(o,t);a=true}var s=this[u];if(s){if(a){r+=","}r+="\n maxAge: "+n.inspect(s,t);a=true}var f=this[d];if(f&&f!==naiveLength){if(a){r+=","}r+="\n length: "+n.inspect(this[l],t);a=true}var m=false;this[h].forEach((function(e){if(m){r+=",\n "}else{if(a){r+=",\n"}m=true;r+="\n "}var i=n.inspect(e.key).split("\n").join("\n ");var o={value:e.value};if(e.maxAge!==s){o.maxAge=e.maxAge}if(f!==naiveLength){o.length=e.length}if(isStale(this,e)){o.stale=true}o=n.inspect(o,t).split("\n").join("\n ");r+=i+" => "+o}));if(m||a){r+="\n"}r+="}";return r};LRUCache.prototype.set=function(e,t,r){r=r||this[u];var a=r?Date.now():0;var n=this[d](t,e);if(this[v].has(e)){if(n>this[p]){del(this,this[v].get(e));return false}var i=this[v].get(e);var o=i.value;if(this[f]){if(!this[m]){this[f](e,o.value)}}o.now=a;o.maxAge=r;o.value=t;this[l]+=n-o.length;o.length=n;this.get(e);trim(this);return true}var s=new Entry(e,t,n,a,r);if(s.length>this[p]){if(this[f]){this[f](e,t)}return false}this[l]+=s.length;this[h].unshift(s);this[v].set(e,this[h].head);trim(this);return true};LRUCache.prototype.has=function(e){if(!this[v].has(e))return false;var t=this[v].get(e).value;if(isStale(this,t)){return false}return true};LRUCache.prototype.get=function(e){return get(this,e,true)};LRUCache.prototype.peek=function(e){return get(this,e,false)};LRUCache.prototype.pop=function(){var e=this[h].tail;if(!e)return null;del(this,e);return e.value};LRUCache.prototype.del=function(e){del(this,this[v].get(e))};LRUCache.prototype.load=function(e){this.reset();var t=Date.now();for(var r=e.length-1;r>=0;r--){var a=e[r];var n=a.e||0;if(n===0){this.set(a.k,a.v)}else{var i=n-t;if(i>0){this.set(a.k,a.v,i)}}}};LRUCache.prototype.prune=function(){var e=this;this[v].forEach((function(t,r){get(e,r,false)}))};function get(e,t,r){var a=e[v].get(t);if(a){var n=a.value;if(isStale(e,n)){del(e,a);if(!e[c])n=undefined}else{if(r){e[h].unshiftNode(a)}}if(n)n=n.value}return n}function isStale(e,t){if(!t||!t.maxAge&&!e[u]){return false}var r=false;var a=Date.now()-t.now;if(t.maxAge){r=a>t.maxAge}else{r=e[u]&&a>e[u]}return r}function trim(e){if(e[l]>e[p]){for(var t=e[h].tail;e[l]>e[p]&&t!==null;){var r=t.prev;del(e,t);t=r}}}function del(e,t){if(t){var r=t.value;if(e[f]){e[f](r.key,r.value)}e[l]-=r.length;e[v].delete(r.key);e[h].removeNode(t)}}function Entry(e,t,r,a,n){this.key=e;this.value=t;this.length=r;this.now=a;this.maxAge=n||0}},4071:e=>{e.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(e){var t=this;if(!(t instanceof Yallist)){t=new Yallist}t.tail=null;t.head=null;t.length=0;if(e&&typeof e.forEach==="function"){e.forEach((function(e){t.push(e)}))}else if(arguments.length>0){for(var r=0,a=arguments.length;r<a;r++){t.push(arguments[r])}}return t}Yallist.prototype.removeNode=function(e){if(e.list!==this){throw new Error("removing node which does not belong to this list")}var t=e.next;var r=e.prev;if(t){t.prev=r}if(r){r.next=t}if(e===this.head){this.head=t}if(e===this.tail){this.tail=r}e.list.length--;e.next=null;e.prev=null;e.list=null};Yallist.prototype.unshiftNode=function(e){if(e===this.head){return}if(e.list){e.list.removeNode(e)}var t=this.head;e.list=this;e.next=t;if(t){t.prev=e}this.head=e;if(!this.tail){this.tail=e}this.length++};Yallist.prototype.pushNode=function(e){if(e===this.tail){return}if(e.list){e.list.removeNode(e)}var t=this.tail;e.list=this;e.prev=t;if(t){t.next=e}this.tail=e;if(!this.head){this.head=e}this.length++};Yallist.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++){push(this,arguments[e])}return this.length};Yallist.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++){unshift(this,arguments[e])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var e=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return e};Yallist.prototype.shift=function(){if(!this.head){return undefined}var e=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return e};Yallist.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,a=0;r!==null;a++){e.call(t,r.value,a,this);r=r.next}};Yallist.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,a=this.length-1;r!==null;a--){e.call(t,r.value,a,this);r=r.prev}};Yallist.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++){r=r.next}if(t===e&&r!==null){return r.value}};Yallist.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++){r=r.prev}if(t===e&&r!==null){return r.value}};Yallist.prototype.map=function(e,t){t=t||this;var r=new Yallist;for(var a=this.head;a!==null;){r.push(e.call(t,a.value,this));a=a.next}return r};Yallist.prototype.mapReverse=function(e,t){t=t||this;var r=new Yallist;for(var a=this.tail;a!==null;){r.push(e.call(t,a.value,this));a=a.prev}return r};Yallist.prototype.reduce=function(e,t){var r;var a=this.head;if(arguments.length>1){r=t}else if(this.head){a=this.head.next;r=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var n=0;a!==null;n++){r=e(r,a.value,n);a=a.next}return r};Yallist.prototype.reduceReverse=function(e,t){var r;var a=this.tail;if(arguments.length>1){r=t}else if(this.tail){a=this.tail.prev;r=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var n=this.length-1;a!==null;n--){r=e(r,a.value,n);a=a.prev}return r};Yallist.prototype.toArray=function(){var e=new Array(this.length);for(var t=0,r=this.head;r!==null;t++){e[t]=r.value;r=r.next}return e};Yallist.prototype.toArrayReverse=function(){var e=new Array(this.length);for(var t=0,r=this.tail;r!==null;t++){e[t]=r.value;r=r.prev}return e};Yallist.prototype.slice=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var a=0,n=this.head;n!==null&&a<e;a++){n=n.next}for(;n!==null&&a<t;a++,n=n.next){r.push(n.value)}return r};Yallist.prototype.sliceReverse=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var a=this.length,n=this.tail;n!==null&&a>t;a--){n=n.prev}for(;n!==null&&a>e;a--,n=n.prev){r.push(n.value)}return r};Yallist.prototype.reverse=function(){var e=this.head;var t=this.tail;for(var r=e;r!==null;r=r.prev){var a=r.prev;r.prev=r.next;r.next=a}this.head=t;this.tail=e;return this};function push(e,t){e.tail=new Node(t,e.tail,null,e);if(!e.head){e.head=e.tail}e.length++}function unshift(e,t){e.head=new Node(t,null,e.head,e);if(!e.tail){e.tail=e.head}e.length++}function Node(e,t,r,a){if(!(this instanceof Node)){return new Node(e,t,r,a)}this.list=a;this.value=e;if(t){t.next=this;this.prev=t}else{this.prev=null}if(r){r.prev=this;this.next=r}else{this.next=null}}},5509:(e,t,r)=>{"use strict";var a=r(8057),n=r(1517),i=r(6277),o=r(9325),s=r(2560);var p=e.exports=function(e,t){var r,n,p,l,d;if(arguments.length<2||typeof e!=="string"){l=t;t=e;e=null}else{l=arguments[2]}if(a(e)){r=s.call(e,"c");n=s.call(e,"e");p=s.call(e,"w")}else{r=p=true;n=false}d={value:t,configurable:r,enumerable:n,writable:p};return!l?d:i(o(l),d)};p.gs=function(e,t,r){var p,l,d,c;if(typeof e!=="string"){d=r;r=t;t=e;e=null}else{d=arguments[3]}if(!a(t)){t=undefined}else if(!n(t)){d=t;t=r=undefined}else if(!a(r)){r=undefined}else if(!n(r)){d=r;r=undefined}if(a(e)){p=s.call(e,"c");l=s.call(e,"e")}else{p=true;l=false}c={get:t,set:r,configurable:p,enumerable:l};return!d?c:i(o(d),c)}},330:(e,t,r)=>{"use strict";var a=r(8272);e.exports=function(e){if(typeof e!=="function")return false;if(!hasOwnProperty.call(e,"length"))return false;try{if(typeof e.length!=="number")return false;if(typeof e.call!=="function")return false;if(typeof e.apply!=="function")return false}catch(e){return false}return!a(e)}},6402:(e,t,r)=>{"use strict";var a=r(8057);var n={object:true,function:true,undefined:true};e.exports=function(e){if(!a(e))return false;return hasOwnProperty.call(n,typeof e)}},1517:(e,t,r)=>{"use strict";var a=r(330);var n=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(e){if(!a(e))return false;if(n.test(i.call(e)))return false;return true}},8272:(e,t,r)=>{"use strict";var a=r(6402);e.exports=function(e){if(!a(e))return false;try{if(!e.constructor)return false;return e.constructor.prototype===e}catch(e){return false}}},8057:e=>{"use strict";var t=void 0;e.exports=function(e){return e!==t&&e!==null}},6637:e=>{"use strict";e.exports=(e,t,r)=>{const define=r=>Object.defineProperty(e,t,{value:r,enumerable:true,writable:true});Object.defineProperty(e,t,{configurable:true,enumerable:true,get(){const e=r();define(e);return e},set(e){define(e)}});return e}},2512:(e,t,r)=>{"use strict";var a=r(265);e.exports.O=convert;function convert(e,t,r){r=checkEncoding(r||"UTF-8");t=checkEncoding(t||"UTF-8");e=e||"";var a;if(r!=="UTF-8"&&typeof e==="string"){e=Buffer.from(e,"binary")}if(r===t){if(typeof e==="string"){a=Buffer.from(e)}else{a=e}}else{try{a=convertIconvLite(e,t,r)}catch(t){console.error(t);a=e}}if(typeof a==="string"){a=Buffer.from(a,"utf-8")}return a}function convertIconvLite(e,t,r){if(t==="UTF-8"){return a.decode(e,r)}else if(r==="UTF-8"){return a.encode(e,t)}else{return a.encode(a.decode(e,r),t)}}function checkEncoding(e){return(e||"").toString().trim().replace(/^latin[\-_]?(\d+)$/i,"ISO-8859-$1").replace(/^win(?:dows)?[\-_]?(\d+)$/i,"WINDOWS-$1").replace(/^utf[\-_]?(\d+)$/i,"UTF-$1").replace(/^ks_c_5601\-1987$/i,"CP949").replace(/^us[\-_]?ascii$/i,"ASCII").toUpperCase()}},725:(e,t,r)=>{"use strict";var a=r(4526).Buffer;t._dbcs=DBCSCodec;var n=-1,i=-2,o=-10,s=-1e3,p=new Array(256),l=-1;for(var d=0;d<256;d++)p[d]=n;function DBCSCodec(e,t){this.encodingName=e.encodingName;if(!e)throw new Error("DBCS codec is called without the data.");if(!e.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var r=e.table();this.decodeTables=[];this.decodeTables[0]=p.slice(0);this.decodeTableSeq=[];for(var a=0;a<r.length;a++)this._addDecodeChunk(r[a]);if(typeof e.gb18030==="function"){this.gb18030=e.gb18030();var o=this.decodeTables.length;this.decodeTables.push(p.slice(0));var l=this.decodeTables.length;this.decodeTables.push(p.slice(0));var d=this.decodeTables[0];for(var a=129;a<=254;a++){var c=this.decodeTables[s-d[a]];for(var u=48;u<=57;u++){if(c[u]===n){c[u]=s-o}else if(c[u]>s){throw new Error("gb18030 decode tables conflict at byte 2")}var f=this.decodeTables[s-c[u]];for(var m=129;m<=254;m++){if(f[m]===n){f[m]=s-l}else if(f[m]===s-l){continue}else if(f[m]>s){throw new Error("gb18030 decode tables conflict at byte 3")}var h=this.decodeTables[s-f[m]];for(var v=48;v<=57;v++){if(h[v]===n)h[v]=i}}}}}this.defaultCharUnicode=t.defaultCharUnicode;this.encodeTable=[];this.encodeTableSeq=[];var y={};if(e.encodeSkipVals)for(var a=0;a<e.encodeSkipVals.length;a++){var b=e.encodeSkipVals[a];if(typeof b==="number")y[b]=true;else for(var u=b.from;u<=b.to;u++)y[u]=true}this._fillEncodeTable(0,0,y);if(e.encodeAdd){for(var g in e.encodeAdd)if(Object.prototype.hasOwnProperty.call(e.encodeAdd,g))this._setEncodeChar(g.charCodeAt(0),e.encodeAdd[g])}this.defCharSB=this.encodeTable[0][t.defaultCharSingleByte.charCodeAt(0)];if(this.defCharSB===n)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===n)this.defCharSB="?".charCodeAt(0)}DBCSCodec.prototype.encoder=DBCSEncoder;DBCSCodec.prototype.decoder=DBCSDecoder;DBCSCodec.prototype._getDecodeTrieNode=function(e){var t=[];for(;e>0;e>>>=8)t.push(e&255);if(t.length==0)t.push(0);var r=this.decodeTables[0];for(var a=t.length-1;a>0;a--){var i=r[t[a]];if(i==n){r[t[a]]=s-this.decodeTables.length;this.decodeTables.push(r=p.slice(0))}else if(i<=s){r=this.decodeTables[s-i]}else throw new Error("Overwrite byte in "+this.encodingName+", addr: "+e.toString(16))}return r};DBCSCodec.prototype._addDecodeChunk=function(e){var t=parseInt(e[0],16);var r=this._getDecodeTrieNode(t);t=t&255;for(var a=1;a<e.length;a++){var n=e[a];if(typeof n==="string"){for(var i=0;i<n.length;){var s=n.charCodeAt(i++);if(55296<=s&&s<56320){var p=n.charCodeAt(i++);if(56320<=p&&p<57344)r[t++]=65536+(s-55296)*1024+(p-56320);else throw new Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+e[0])}else if(4080<s&&s<=4095){var l=4095-s+2;var d=[];for(var c=0;c<l;c++)d.push(n.charCodeAt(i++));r[t++]=o-this.decodeTableSeq.length;this.decodeTableSeq.push(d)}else r[t++]=s}}else if(typeof n==="number"){var u=r[t-1]+1;for(var i=0;i<n;i++)r[t++]=u++}else throw new Error("Incorrect type '"+typeof n+"' given in "+this.encodingName+" at chunk "+e[0])}if(t>255)throw new Error("Incorrect chunk in "+this.encodingName+" at addr "+e[0]+": too long"+t)};DBCSCodec.prototype._getEncodeBucket=function(e){var t=e>>8;if(this.encodeTable[t]===undefined)this.encodeTable[t]=p.slice(0);return this.encodeTable[t]};DBCSCodec.prototype._setEncodeChar=function(e,t){var r=this._getEncodeBucket(e);var a=e&255;if(r[a]<=o)this.encodeTableSeq[o-r[a]][l]=t;else if(r[a]==n)r[a]=t};DBCSCodec.prototype._setEncodeSequence=function(e,t){var r=e[0];var a=this._getEncodeBucket(r);var i=r&255;var s;if(a[i]<=o){s=this.encodeTableSeq[o-a[i]]}else{s={};if(a[i]!==n)s[l]=a[i];a[i]=o-this.encodeTableSeq.length;this.encodeTableSeq.push(s)}for(var p=1;p<e.length-1;p++){var d=s[r];if(typeof d==="object")s=d;else{s=s[r]={};if(d!==undefined)s[l]=d}}r=e[e.length-1];s[r]=t};DBCSCodec.prototype._fillEncodeTable=function(e,t,r){var a=this.decodeTables[e];var n=false;var i={};for(var p=0;p<256;p++){var l=a[p];var d=t+p;if(r[d])continue;if(l>=0){this._setEncodeChar(l,d);n=true}else if(l<=s){var c=s-l;if(!i[c]){var u=d<<8>>>0;if(this._fillEncodeTable(c,u,r))n=true;else i[c]=true}}else if(l<=o){this._setEncodeSequence(this.decodeTableSeq[o-l],d);n=true}}return n};function DBCSEncoder(e,t){this.leadSurrogate=-1;this.seqObj=undefined;this.encodeTable=t.encodeTable;this.encodeTableSeq=t.encodeTableSeq;this.defaultCharSingleByte=t.defCharSB;this.gb18030=t.gb18030}DBCSEncoder.prototype.write=function(e){var t=a.alloc(e.length*(this.gb18030?4:3)),r=this.leadSurrogate,i=this.seqObj,s=-1,p=0,d=0;while(true){if(s===-1){if(p==e.length)break;var c=e.charCodeAt(p++)}else{var c=s;s=-1}if(55296<=c&&c<57344){if(c<56320){if(r===-1){r=c;continue}else{r=c;c=n}}else{if(r!==-1){c=65536+(r-55296)*1024+(c-56320);r=-1}else{c=n}}}else if(r!==-1){s=c;c=n;r=-1}var u=n;if(i!==undefined&&c!=n){var f=i[c];if(typeof f==="object"){i=f;continue}else if(typeof f=="number"){u=f}else if(f==undefined){f=i[l];if(f!==undefined){u=f;s=c}else{}}i=undefined}else if(c>=0){var m=this.encodeTable[c>>8];if(m!==undefined)u=m[c&255];if(u<=o){i=this.encodeTableSeq[o-u];continue}if(u==n&&this.gb18030){var h=findIdx(this.gb18030.uChars,c);if(h!=-1){var u=this.gb18030.gbChars[h]+(c-this.gb18030.uChars[h]);t[d++]=129+Math.floor(u/12600);u=u%12600;t[d++]=48+Math.floor(u/1260);u=u%1260;t[d++]=129+Math.floor(u/10);u=u%10;t[d++]=48+u;continue}}}if(u===n)u=this.defaultCharSingleByte;if(u<256){t[d++]=u}else if(u<65536){t[d++]=u>>8;t[d++]=u&255}else if(u<16777216){t[d++]=u>>16;t[d++]=u>>8&255;t[d++]=u&255}else{t[d++]=u>>>24;t[d++]=u>>>16&255;t[d++]=u>>>8&255;t[d++]=u&255}}this.seqObj=i;this.leadSurrogate=r;return t.slice(0,d)};DBCSEncoder.prototype.end=function(){if(this.leadSurrogate===-1&&this.seqObj===undefined)return;var e=a.alloc(10),t=0;if(this.seqObj){var r=this.seqObj[l];if(r!==undefined){if(r<256){e[t++]=r}else{e[t++]=r>>8;e[t++]=r&255}}else{}this.seqObj=undefined}if(this.leadSurrogate!==-1){e[t++]=this.defaultCharSingleByte;this.leadSurrogate=-1}return e.slice(0,t)};DBCSEncoder.prototype.findIdx=findIdx;function DBCSDecoder(e,t){this.nodeIdx=0;this.prevBytes=[];this.decodeTables=t.decodeTables;this.decodeTableSeq=t.decodeTableSeq;this.defaultCharUnicode=t.defaultCharUnicode;this.gb18030=t.gb18030}DBCSDecoder.prototype.write=function(e){var t=a.alloc(e.length*2),r=this.nodeIdx,p=this.prevBytes,l=this.prevBytes.length,d=-this.prevBytes.length,c;for(var u=0,f=0;u<e.length;u++){var m=u>=0?e[u]:p[u+l];var c=this.decodeTables[r][m];if(c>=0){}else if(c===n){c=this.defaultCharUnicode.charCodeAt(0);u=d}else if(c===i){if(u>=3){var h=(e[u-3]-129)*12600+(e[u-2]-48)*1260+(e[u-1]-129)*10+(m-48)}else{var h=(p[u-3+l]-129)*12600+((u-2>=0?e[u-2]:p[u-2+l])-48)*1260+((u-1>=0?e[u-1]:p[u-1+l])-129)*10+(m-48)}var v=findIdx(this.gb18030.gbChars,h);c=this.gb18030.uChars[v]+h-this.gb18030.gbChars[v]}else if(c<=s){r=s-c;continue}else if(c<=o){var y=this.decodeTableSeq[o-c];for(var b=0;b<y.length-1;b++){c=y[b];t[f++]=c&255;t[f++]=c>>8}c=y[y.length-1]}else throw new Error("iconv-lite internal error: invalid decoding table value "+c+" at "+r+"/"+m);if(c>=65536){c-=65536;var g=55296|c>>10;t[f++]=g&255;t[f++]=g>>8;c=56320|c&1023}t[f++]=c&255;t[f++]=c>>8;r=0;d=u+1}this.nodeIdx=r;this.prevBytes=d>=0?Array.prototype.slice.call(e,d):p.slice(d+l).concat(Array.prototype.slice.call(e));return t.slice(0,f).toString("ucs2")};DBCSDecoder.prototype.end=function(){var e="";while(this.prevBytes.length>0){e+=this.defaultCharUnicode;var t=this.prevBytes.slice(1);this.prevBytes=[];this.nodeIdx=0;if(t.length>0)e+=this.write(t)}this.prevBytes=[];this.nodeIdx=0;return e};function findIdx(e,t){if(e[0]>t)return-1;var r=0,a=e.length;while(r<a-1){var n=r+(a-r+1>>1);if(e[n]<=t)r=n;else a=n}return r}},8352:(e,t,r)=>{"use strict";e.exports={shiftjis:{type:"_dbcs",table:function(){return r(9572)},encodeAdd:{"¥":92,"‾":126},encodeSkipVals:[{from:60736,to:63808}]},csshiftjis:"shiftjis",mskanji:"shiftjis",sjis:"shiftjis",windows31j:"shiftjis",ms31j:"shiftjis",xsjis:"shiftjis",windows932:"shiftjis",ms932:"shiftjis",932:"shiftjis",cp932:"shiftjis",eucjp:{type:"_dbcs",table:function(){return r(8470)},encodeAdd:{"¥":92,"‾":126}},gb2312:"cp936",gb231280:"cp936",gb23121980:"cp936",csgb2312:"cp936",csiso58gb231280:"cp936",euccn:"cp936",windows936:"cp936",ms936:"cp936",936:"cp936",cp936:{type:"_dbcs",table:function(){return r(6901)}},gbk:{type:"_dbcs",table:function(){return r(6901).concat(r(6315))}},xgbk:"gbk",isoir58:"gbk",gb18030:{type:"_dbcs",table:function(){return r(6901).concat(r(6315))},gb18030:function(){return r(6176)},encodeSkipVals:[128],encodeAdd:{"€":41699}},chinese:"gb18030",windows949:"cp949",ms949:"cp949",949:"cp949",cp949:{type:"_dbcs",table:function(){return r(6354)}},cseuckr:"cp949",csksc56011987:"cp949",euckr:"cp949",isoir149:"cp949",korean:"cp949",ksc56011987:"cp949",ksc56011989:"cp949",ksc5601:"cp949",windows950:"cp950",ms950:"cp950",950:"cp950",cp950:{type:"_dbcs",table:function(){return r(5969)}},big5:"big5hkscs",big5hkscs:{type:"_dbcs",table:function(){return r(5969).concat(r(8370))},encodeSkipVals:[36457,36463,36478,36523,36532,36557,36560,36695,36713,36718,36811,36862,36973,36986,37060,37084,37105,37311,37551,37552,37553,37554,37585,37959,38090,38361,38652,39285,39798,39800,39803,39878,39902,39916,39926,40002,40019,40034,40040,40043,40055,40124,40125,40144,40279,40282,40388,40431,40443,40617,40687,40701,40800,40907,41079,41180,41183,36812,37576,38468,38637,41636,41637,41639,41638,41676,41678]},cnbig5:"big5hkscs",csbig5:"big5hkscs",xxbig5:"big5hkscs"}},5204:(e,t,r)=>{"use strict";var a=[r(3056),r(3735),r(7428),r(690),r(6890),r(2385),r(3544),r(725),r(8352)];for(var n=0;n<a.length;n++){var i=a[n];for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o))t[o]=i[o]}},3056:(e,t,r)=>{"use strict";var a=r(4526).Buffer;e.exports={utf8:{type:"_internal",bomAware:true},cesu8:{type:"_internal",bomAware:true},unicode11utf8:"utf8",ucs2:{type:"_internal",bomAware:true},utf16le:"ucs2",binary:{type:"_internal"},base64:{type:"_internal"},hex:{type:"_internal"},_internal:InternalCodec};function InternalCodec(e,t){this.enc=e.encodingName;this.bomAware=e.bomAware;if(this.enc==="base64")this.encoder=InternalEncoderBase64;else if(this.enc==="cesu8"){this.enc="utf8";this.encoder=InternalEncoderCesu8;if(a.from("eda0bdedb2a9","hex").toString()!=="💩"){this.decoder=InternalDecoderCesu8;this.defaultCharUnicode=t.defaultCharUnicode}}}InternalCodec.prototype.encoder=InternalEncoder;InternalCodec.prototype.decoder=InternalDecoder;var n=r(1576).StringDecoder;if(!n.prototype.end)n.prototype.end=function(){};function InternalDecoder(e,t){this.decoder=new n(t.enc)}InternalDecoder.prototype.write=function(e){if(!a.isBuffer(e)){e=a.from(e)}return this.decoder.write(e)};InternalDecoder.prototype.end=function(){return this.decoder.end()};function InternalEncoder(e,t){this.enc=t.enc}InternalEncoder.prototype.write=function(e){return a.from(e,this.enc)};InternalEncoder.prototype.end=function(){};function InternalEncoderBase64(e,t){this.prevStr=""}InternalEncoderBase64.prototype.write=function(e){e=this.prevStr+e;var t=e.length-e.length%4;this.prevStr=e.slice(t);e=e.slice(0,t);return a.from(e,"base64")};InternalEncoderBase64.prototype.end=function(){return a.from(this.prevStr,"base64")};function InternalEncoderCesu8(e,t){}InternalEncoderCesu8.prototype.write=function(e){var t=a.alloc(e.length*3),r=0;for(var n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i<128)t[r++]=i;else if(i<2048){t[r++]=192+(i>>>6);t[r++]=128+(i&63)}else{t[r++]=224+(i>>>12);t[r++]=128+(i>>>6&63);t[r++]=128+(i&63)}}return t.slice(0,r)};InternalEncoderCesu8.prototype.end=function(){};function InternalDecoderCesu8(e,t){this.acc=0;this.contBytes=0;this.accBytes=0;this.defaultCharUnicode=t.defaultCharUnicode}InternalDecoderCesu8.prototype.write=function(e){var t=this.acc,r=this.contBytes,a=this.accBytes,n="";for(var i=0;i<e.length;i++){var o=e[i];if((o&192)!==128){if(r>0){n+=this.defaultCharUnicode;r=0}if(o<128){n+=String.fromCharCode(o)}else if(o<224){t=o&31;r=1;a=1}else if(o<240){t=o&15;r=2;a=1}else{n+=this.defaultCharUnicode}}else{if(r>0){t=t<<6|o&63;r--;a++;if(r===0){if(a===2&&t<128&&t>0)n+=this.defaultCharUnicode;else if(a===3&&t<2048)n+=this.defaultCharUnicode;else n+=String.fromCharCode(t)}}else{n+=this.defaultCharUnicode}}}this.acc=t;this.contBytes=r;this.accBytes=a;return n};InternalDecoderCesu8.prototype.end=function(){var e=0;if(this.contBytes>0)e+=this.defaultCharUnicode;return e}},6890:(e,t,r)=>{"use strict";var a=r(4526).Buffer;t._sbcs=SBCSCodec;function SBCSCodec(e,t){if(!e)throw new Error("SBCS codec is called without the data.");if(!e.chars||e.chars.length!==128&&e.chars.length!==256)throw new Error("Encoding '"+e.type+"' has incorrect 'chars' (must be of len 128 or 256)");if(e.chars.length===128){var r="";for(var n=0;n<128;n++)r+=String.fromCharCode(n);e.chars=r+e.chars}this.decodeBuf=a.from(e.chars,"ucs2");var i=a.alloc(65536,t.defaultCharSingleByte.charCodeAt(0));for(var n=0;n<e.chars.length;n++)i[e.chars.charCodeAt(n)]=n;this.encodeBuf=i}SBCSCodec.prototype.encoder=SBCSEncoder;SBCSCodec.prototype.decoder=SBCSDecoder;function SBCSEncoder(e,t){this.encodeBuf=t.encodeBuf}SBCSEncoder.prototype.write=function(e){var t=a.alloc(e.length);for(var r=0;r<e.length;r++)t[r]=this.encodeBuf[e.charCodeAt(r)];return t};SBCSEncoder.prototype.end=function(){};function SBCSDecoder(e,t){this.decodeBuf=t.decodeBuf}SBCSDecoder.prototype.write=function(e){var t=this.decodeBuf;var r=a.alloc(e.length*2);var n=0,i=0;for(var o=0;o<e.length;o++){n=e[o]*2;i=o*2;r[i]=t[n];r[i+1]=t[n+1]}return r.toString("ucs2")};SBCSDecoder.prototype.end=function(){}},3544:e=>{"use strict";e.exports={437:"cp437",737:"cp737",775:"cp775",850:"cp850",852:"cp852",855:"cp855",856:"cp856",857:"cp857",858:"cp858",860:"cp860",861:"cp861",862:"cp862",863:"cp863",864:"cp864",865:"cp865",866:"cp866",869:"cp869",874:"windows874",922:"cp922",1046:"cp1046",1124:"cp1124",1125:"cp1125",1129:"cp1129",1133:"cp1133",1161:"cp1161",1162:"cp1162",1163:"cp1163",1250:"windows1250",1251:"windows1251",1252:"windows1252",1253:"windows1253",1254:"windows1254",1255:"windows1255",1256:"windows1256",1257:"windows1257",1258:"windows1258",28591:"iso88591",28592:"iso88592",28593:"iso88593",28594:"iso88594",28595:"iso88595",28596:"iso88596",28597:"iso88597",28598:"iso88598",28599:"iso88599",28600:"iso885910",28601:"iso885911",28603:"iso885913",28604:"iso885914",28605:"iso885915",28606:"iso885916",windows874:{type:"_sbcs",chars:"€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},win874:"windows874",cp874:"windows874",windows1250:{type:"_sbcs",chars:"€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"},win1250:"windows1250",cp1250:"windows1250",windows1251:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},win1251:"windows1251",cp1251:"windows1251",windows1252:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},win1252:"windows1252",cp1252:"windows1252",windows1253:{type:"_sbcs",chars:"€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"},win1253:"windows1253",cp1253:"windows1253",windows1254:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"},win1254:"windows1254",cp1254:"windows1254",windows1255:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"},win1255:"windows1255",cp1255:"windows1255",windows1256:{type:"_sbcs",chars:"€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے"},win1256:"windows1256",cp1256:"windows1256",windows1257:{type:"_sbcs",chars:"€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"},win1257:"windows1257",cp1257:"windows1257",windows1258:{type:"_sbcs",chars:"€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},win1258:"windows1258",cp1258:"windows1258",iso88591:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},cp28591:"iso88591",iso88592:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"},cp28592:"iso88592",iso88593:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙"},cp28593:"iso88593",iso88594:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"},cp28594:"iso88594",iso88595:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"},cp28595:"iso88595",iso88596:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������"},cp28596:"iso88596",iso88597:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"},cp28597:"iso88597",iso88598:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"},cp28598:"iso88598",iso88599:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"},cp28599:"iso88599",iso885910:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"},cp28600:"iso885910",iso885911:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},cp28601:"iso885911",iso885913:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"},cp28603:"iso885913",iso885914:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"},cp28604:"iso885914",iso885915:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},cp28605:"iso885915",iso885916:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"},cp28606:"iso885916",cp437:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm437:"cp437",csibm437:"cp437",cp737:{type:"_sbcs",chars:"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "},ibm737:"cp737",csibm737:"cp737",cp775:{type:"_sbcs",chars:"ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ "},ibm775:"cp775",csibm775:"cp775",cp850:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "},ibm850:"cp850",csibm850:"cp850",cp852:{type:"_sbcs",chars:"ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ "},ibm852:"cp852",csibm852:"cp852",cp855:{type:"_sbcs",chars:"ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ "},ibm855:"cp855",csibm855:"cp855",cp856:{type:"_sbcs",chars:"אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ "},ibm856:"cp856",csibm856:"cp856",cp857:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ "},ibm857:"cp857",csibm857:"cp857",cp858:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "},ibm858:"cp858",csibm858:"cp858",cp860:{type:"_sbcs",chars:"ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm860:"cp860",csibm860:"cp860",cp861:{type:"_sbcs",chars:"ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm861:"cp861",csibm861:"cp861",cp862:{type:"_sbcs",chars:"אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm862:"cp862",csibm862:"cp862",cp863:{type:"_sbcs",chars:"ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm863:"cp863",csibm863:"cp863",cp864:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�"},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csibm1163:"cp1163",maccroatian:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"},maccyrillic:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},macgreek:{type:"_sbcs",chars:"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"},maciceland:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macroman:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macromania:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macthai:{type:"_sbcs",chars:"«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู\ufeff​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"},macturkish:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"},macukraine:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},koi8r:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8u:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8ru:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8t:{type:"_sbcs",chars:"қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},armscii8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"},rk1048:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},tcvn:{type:"_sbcs",chars:"\0ÚỤỪỬỮ\b\t\n\v\f\rỨỰỲỶỸÝỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"},georgianacademy:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:"\0ẲẴẪ\b\t\n\v\f\rỶỸỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"},iso646cn:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},iso646jp:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}},2385:e=>{"use strict";e.exports={10029:"maccenteuro",maccenteuro:{type:"_sbcs",chars:"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"},808:"cp808",ibm808:"cp808",cp808:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "},mik:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},cp720:{type:"_sbcs",chars:"€éâ„à†çêëèïّْô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡ًٌٍَُِ≈°∙·√ⁿ²■ "},ascii8bit:"ascii",usascii:"ascii",ansix34:"ascii",ansix341968:"ascii",ansix341986:"ascii",csascii:"ascii",cp367:"ascii",ibm367:"ascii",isoir6:"ascii",iso646us:"ascii",iso646irv:"ascii",us:"ascii",latin1:"iso88591",latin2:"iso88592",latin3:"iso88593",latin4:"iso88594",latin5:"iso88599",latin6:"iso885910",latin7:"iso885913",latin8:"iso885914",latin9:"iso885915",latin10:"iso885916",csisolatin1:"iso88591",csisolatin2:"iso88592",csisolatin3:"iso88593",csisolatin4:"iso88594",csisolatincyrillic:"iso88595",csisolatinarabic:"iso88596",csisolatingreek:"iso88597",csisolatinhebrew:"iso88598",csisolatin5:"iso88599",csisolatin6:"iso885910",l1:"iso88591",l2:"iso88592",l3:"iso88593",l4:"iso88594",l5:"iso88599",l6:"iso885910",l7:"iso885913",l8:"iso885914",l9:"iso885915",l10:"iso885916",isoir14:"iso646jp",isoir57:"iso646cn",isoir100:"iso88591",isoir101:"iso88592",isoir109:"iso88593",isoir110:"iso88594",isoir144:"iso88595",isoir127:"iso88596",isoir126:"iso88597",isoir138:"iso88598",isoir148:"iso88599",isoir157:"iso885910",isoir166:"tis620",isoir179:"iso885913",isoir199:"iso885914",isoir203:"iso885915",isoir226:"iso885916",cp819:"iso88591",ibm819:"iso88591",cyrillic:"iso88595",arabic:"iso88596",arabic8:"iso88596",ecma114:"iso88596",asmo708:"iso88596",greek:"iso88597",greek8:"iso88597",ecma118:"iso88597",elot928:"iso88597",hebrew:"iso88598",hebrew8:"iso88598",turkish:"iso88599",turkish8:"iso88599",thai:"iso885911",thai8:"iso885911",celtic:"iso885914",celtic8:"iso885914",isoceltic:"iso885914",tis6200:"tis620",tis62025291:"tis620",tis62025330:"tis620",1e4:"macroman",10006:"macgreek",10007:"maccyrillic",10079:"maciceland",10081:"macturkish",cspc8codepage437:"cp437",cspc775baltic:"cp775",cspc850multilingual:"cp850",cspcp852:"cp852",cspc862latinhebrew:"cp862",cpgr:"cp869",msee:"cp1250",mscyrl:"cp1251",msansi:"cp1252",msgreek:"cp1253",msturk:"cp1254",mshebr:"cp1255",msarab:"cp1256",winbaltrim:"cp1257",cp20866:"koi8r",20866:"koi8r",ibm878:"koi8r",cskoi8r:"koi8r",cp21866:"koi8u",21866:"koi8u",ibm1168:"koi8u",strk10482002:"rk1048",tcvn5712:"tcvn",tcvn57121:"tcvn",gb198880:"iso646cn",cn:"iso646cn",csiso14jisc6220ro:"iso646jp",jisc62201969ro:"iso646jp",jp:"iso646jp",cshproman8:"hproman8",r8:"hproman8",roman8:"hproman8",xroman8:"hproman8",ibm1051:"hproman8",mac:"macintosh",csmacintosh:"macintosh"}},7428:(e,t,r)=>{"use strict";var a=r(4526).Buffer;t.utf16be=Utf16BECodec;function Utf16BECodec(){}Utf16BECodec.prototype.encoder=Utf16BEEncoder;Utf16BECodec.prototype.decoder=Utf16BEDecoder;Utf16BECodec.prototype.bomAware=true;function Utf16BEEncoder(){}Utf16BEEncoder.prototype.write=function(e){var t=a.from(e,"ucs2");for(var r=0;r<t.length;r+=2){var n=t[r];t[r]=t[r+1];t[r+1]=n}return t};Utf16BEEncoder.prototype.end=function(){};function Utf16BEDecoder(){this.overflowByte=-1}Utf16BEDecoder.prototype.write=function(e){if(e.length==0)return"";var t=a.alloc(e.length+1),r=0,n=0;if(this.overflowByte!==-1){t[0]=e[0];t[1]=this.overflowByte;r=1;n=2}for(;r<e.length-1;r+=2,n+=2){t[n]=e[r+1];t[n+1]=e[r]}this.overflowByte=r==e.length-1?e[e.length-1]:-1;return t.slice(0,n).toString("ucs2")};Utf16BEDecoder.prototype.end=function(){this.overflowByte=-1};t.utf16=Utf16Codec;function Utf16Codec(e,t){this.iconv=t}Utf16Codec.prototype.encoder=Utf16Encoder;Utf16Codec.prototype.decoder=Utf16Decoder;function Utf16Encoder(e,t){e=e||{};if(e.addBOM===undefined)e.addBOM=true;this.encoder=t.iconv.getEncoder("utf-16le",e)}Utf16Encoder.prototype.write=function(e){return this.encoder.write(e)};Utf16Encoder.prototype.end=function(){return this.encoder.end()};function Utf16Decoder(e,t){this.decoder=null;this.initialBufs=[];this.initialBufsLen=0;this.options=e||{};this.iconv=t.iconv}Utf16Decoder.prototype.write=function(e){if(!this.decoder){this.initialBufs.push(e);this.initialBufsLen+=e.length;if(this.initialBufsLen<16)return"";var t=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);var r="";for(var a=0;a<this.initialBufs.length;a++)r+=this.decoder.write(this.initialBufs[a]);this.initialBufs.length=this.initialBufsLen=0;return r}return this.decoder.write(e)};Utf16Decoder.prototype.end=function(){if(!this.decoder){var e=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);var t="";for(var r=0;r<this.initialBufs.length;r++)t+=this.decoder.write(this.initialBufs[r]);var a=this.decoder.end();if(a)t+=a;this.initialBufs.length=this.initialBufsLen=0;return t}return this.decoder.end()};function detectEncoding(e,t){var r=[];var a=0;var n=0,i=0;e:for(var o=0;o<e.length;o++){var s=e[o];for(var p=0;p<s.length;p++){r.push(s[p]);if(r.length===2){if(a===0){if(r[0]===255&&r[1]===254)return"utf-16le";if(r[0]===254&&r[1]===255)return"utf-16be"}if(r[0]===0&&r[1]!==0)i++;if(r[0]!==0&&r[1]===0)n++;r.length=0;a++;if(a>=100){break e}}}}if(i>n)return"utf-16be";if(i<n)return"utf-16le";return t||"utf-16le"}},3735:(e,t,r)=>{"use strict";var a=r(4526).Buffer;t._utf32=Utf32Codec;function Utf32Codec(e,t){this.iconv=t;this.bomAware=true;this.isLE=e.isLE}t.utf32le={type:"_utf32",isLE:true};t.utf32be={type:"_utf32",isLE:false};t.ucs4le="utf32le";t.ucs4be="utf32be";Utf32Codec.prototype.encoder=Utf32Encoder;Utf32Codec.prototype.decoder=Utf32Decoder;function Utf32Encoder(e,t){this.isLE=t.isLE;this.highSurrogate=0}Utf32Encoder.prototype.write=function(e){var t=a.from(e,"ucs2");var r=a.alloc(t.length*2);var n=this.isLE?r.writeUInt32LE:r.writeUInt32BE;var i=0;for(var o=0;o<t.length;o+=2){var s=t.readUInt16LE(o);var p=55296<=s&&s<56320;var l=56320<=s&&s<57344;if(this.highSurrogate){if(p||!l){n.call(r,this.highSurrogate,i);i+=4}else{var d=(this.highSurrogate-55296<<10|s-56320)+65536;n.call(r,d,i);i+=4;this.highSurrogate=0;continue}}if(p)this.highSurrogate=s;else{n.call(r,s,i);i+=4;this.highSurrogate=0}}if(i<r.length)r=r.slice(0,i);return r};Utf32Encoder.prototype.end=function(){if(!this.highSurrogate)return;var e=a.alloc(4);if(this.isLE)e.writeUInt32LE(this.highSurrogate,0);else e.writeUInt32BE(this.highSurrogate,0);this.highSurrogate=0;return e};function Utf32Decoder(e,t){this.isLE=t.isLE;this.badChar=t.iconv.defaultCharUnicode.charCodeAt(0);this.overflow=[]}Utf32Decoder.prototype.write=function(e){if(e.length===0)return"";var t=0;var r=0;var n=a.alloc(e.length+4);var i=0;var o=this.isLE;var s=this.overflow;var p=this.badChar;if(s.length>0){for(;t<e.length&&s.length<4;t++)s.push(e[t]);if(s.length===4){if(o){r=s[t]|s[t+1]<<8|s[t+2]<<16|s[t+3]<<24}else{r=s[t+3]|s[t+2]<<8|s[t+1]<<16|s[t]<<24}s.length=0;i=_writeCodepoint(n,i,r,p)}}for(;t<e.length-3;t+=4){if(o){r=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}else{r=e[t+3]|e[t+2]<<8|e[t+1]<<16|e[t]<<24}i=_writeCodepoint(n,i,r,p)}for(;t<e.length;t++){s.push(e[t])}return n.slice(0,i).toString("ucs2")};function _writeCodepoint(e,t,r,a){if(r<0||r>1114111){r=a}if(r>=65536){r-=65536;var n=55296|r>>10;e[t++]=n&255;e[t++]=n>>8;var r=56320|r&1023}e[t++]=r&255;e[t++]=r>>8;return t}Utf32Decoder.prototype.end=function(){this.overflow.length=0};t.utf32=Utf32AutoCodec;t.ucs4="utf32";function Utf32AutoCodec(e,t){this.iconv=t}Utf32AutoCodec.prototype.encoder=Utf32AutoEncoder;Utf32AutoCodec.prototype.decoder=Utf32AutoDecoder;function Utf32AutoEncoder(e,t){e=e||{};if(e.addBOM===undefined)e.addBOM=true;this.encoder=t.iconv.getEncoder(e.defaultEncoding||"utf-32le",e)}Utf32AutoEncoder.prototype.write=function(e){return this.encoder.write(e)};Utf32AutoEncoder.prototype.end=function(){return this.encoder.end()};function Utf32AutoDecoder(e,t){this.decoder=null;this.initialBufs=[];this.initialBufsLen=0;this.options=e||{};this.iconv=t.iconv}Utf32AutoDecoder.prototype.write=function(e){if(!this.decoder){this.initialBufs.push(e);this.initialBufsLen+=e.length;if(this.initialBufsLen<32)return"";var t=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(t,this.options);var r="";for(var a=0;a<this.initialBufs.length;a++)r+=this.decoder.write(this.initialBufs[a]);this.initialBufs.length=this.initialBufsLen=0;return r}return this.decoder.write(e)};Utf32AutoDecoder.prototype.end=function(){if(!this.decoder){var e=detectEncoding(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);var t="";for(var r=0;r<this.initialBufs.length;r++)t+=this.decoder.write(this.initialBufs[r]);var a=this.decoder.end();if(a)t+=a;this.initialBufs.length=this.initialBufsLen=0;return t}return this.decoder.end()};function detectEncoding(e,t){var r=[];var a=0;var n=0,i=0;var o=0,s=0;e:for(var p=0;p<e.length;p++){var l=e[p];for(var d=0;d<l.length;d++){r.push(l[d]);if(r.length===4){if(a===0){if(r[0]===255&&r[1]===254&&r[2]===0&&r[3]===0){return"utf-32le"}if(r[0]===0&&r[1]===0&&r[2]===254&&r[3]===255){return"utf-32be"}}if(r[0]!==0||r[1]>16)i++;if(r[3]!==0||r[2]>16)n++;if(r[0]===0&&r[1]===0&&(r[2]!==0||r[3]!==0))s++;if((r[0]!==0||r[1]!==0)&&r[2]===0&&r[3]===0)o++;r.length=0;a++;if(a>=100){break e}}}}if(s-i>o-n)return"utf-32be";if(s-i<o-n)return"utf-32le";return t||"utf-32le"}},690:(e,t,r)=>{"use strict";var a=r(4526).Buffer;t.utf7=Utf7Codec;t.unicode11utf7="utf7";function Utf7Codec(e,t){this.iconv=t}Utf7Codec.prototype.encoder=Utf7Encoder;Utf7Codec.prototype.decoder=Utf7Decoder;Utf7Codec.prototype.bomAware=true;var n=/[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;function Utf7Encoder(e,t){this.iconv=t.iconv}Utf7Encoder.prototype.write=function(e){return a.from(e.replace(n,function(e){return"+"+(e==="+"?"":this.iconv.encode(e,"utf16-be").toString("base64").replace(/=+$/,""))+"-"}.bind(this)))};Utf7Encoder.prototype.end=function(){};function Utf7Decoder(e,t){this.iconv=t.iconv;this.inBase64=false;this.base64Accum=""}var i=/[A-Za-z0-9\/+]/;var o=[];for(var s=0;s<256;s++)o[s]=i.test(String.fromCharCode(s));var p="+".charCodeAt(0),l="-".charCodeAt(0),d="&".charCodeAt(0);Utf7Decoder.prototype.write=function(e){var t="",r=0,n=this.inBase64,i=this.base64Accum;for(var s=0;s<e.length;s++){if(!n){if(e[s]==p){t+=this.iconv.decode(e.slice(r,s),"ascii");r=s+1;n=true}}else{if(!o[e[s]]){if(s==r&&e[s]==l){t+="+"}else{var d=i+this.iconv.decode(e.slice(r,s),"ascii");t+=this.iconv.decode(a.from(d,"base64"),"utf16-be")}if(e[s]!=l)s--;r=s+1;n=false;i=""}}}if(!n){t+=this.iconv.decode(e.slice(r),"ascii")}else{var d=i+this.iconv.decode(e.slice(r),"ascii");var c=d.length-d.length%8;i=d.slice(c);d=d.slice(0,c);t+=this.iconv.decode(a.from(d,"base64"),"utf16-be")}this.inBase64=n;this.base64Accum=i;return t};Utf7Decoder.prototype.end=function(){var e="";if(this.inBase64&&this.base64Accum.length>0)e=this.iconv.decode(a.from(this.base64Accum,"base64"),"utf16-be");this.inBase64=false;this.base64Accum="";return e};t.utf7imap=Utf7IMAPCodec;function Utf7IMAPCodec(e,t){this.iconv=t}Utf7IMAPCodec.prototype.encoder=Utf7IMAPEncoder;Utf7IMAPCodec.prototype.decoder=Utf7IMAPDecoder;Utf7IMAPCodec.prototype.bomAware=true;function Utf7IMAPEncoder(e,t){this.iconv=t.iconv;this.inBase64=false;this.base64Accum=a.alloc(6);this.base64AccumIdx=0}Utf7IMAPEncoder.prototype.write=function(e){var t=this.inBase64,r=this.base64Accum,n=this.base64AccumIdx,i=a.alloc(e.length*5+10),o=0;for(var s=0;s<e.length;s++){var p=e.charCodeAt(s);if(32<=p&&p<=126){if(t){if(n>0){o+=i.write(r.slice(0,n).toString("base64").replace(/\//g,",").replace(/=+$/,""),o);n=0}i[o++]=l;t=false}if(!t){i[o++]=p;if(p===d)i[o++]=l}}else{if(!t){i[o++]=d;t=true}if(t){r[n++]=p>>8;r[n++]=p&255;if(n==r.length){o+=i.write(r.toString("base64").replace(/\//g,","),o);n=0}}}}this.inBase64=t;this.base64AccumIdx=n;return i.slice(0,o)};Utf7IMAPEncoder.prototype.end=function(){var e=a.alloc(10),t=0;if(this.inBase64){if(this.base64AccumIdx>0){t+=e.write(this.base64Accum.slice(0,this.base64AccumIdx).toString("base64").replace(/\//g,",").replace(/=+$/,""),t);this.base64AccumIdx=0}e[t++]=l;this.inBase64=false}return e.slice(0,t)};function Utf7IMAPDecoder(e,t){this.iconv=t.iconv;this.inBase64=false;this.base64Accum=""}var c=o.slice();c[",".charCodeAt(0)]=true;Utf7IMAPDecoder.prototype.write=function(e){var t="",r=0,n=this.inBase64,i=this.base64Accum;for(var o=0;o<e.length;o++){if(!n){if(e[o]==d){t+=this.iconv.decode(e.slice(r,o),"ascii");r=o+1;n=true}}else{if(!c[e[o]]){if(o==r&&e[o]==l){t+="&"}else{var s=i+this.iconv.decode(e.slice(r,o),"ascii").replace(/,/g,"/");t+=this.iconv.decode(a.from(s,"base64"),"utf16-be")}if(e[o]!=l)o--;r=o+1;n=false;i=""}}}if(!n){t+=this.iconv.decode(e.slice(r),"ascii")}else{var s=i+this.iconv.decode(e.slice(r),"ascii").replace(/,/g,"/");var p=s.length-s.length%8;i=s.slice(p);s=s.slice(0,p);t+=this.iconv.decode(a.from(s,"base64"),"utf16-be")}this.inBase64=n;this.base64Accum=i;return t};Utf7IMAPDecoder.prototype.end=function(){var e="";if(this.inBase64&&this.base64Accum.length>0)e=this.iconv.decode(a.from(this.base64Accum,"base64"),"utf16-be");this.inBase64=false;this.base64Accum="";return e}},1577:(e,t)=>{"use strict";var r="\ufeff";t.PrependBOM=PrependBOMWrapper;function PrependBOMWrapper(e,t){this.encoder=e;this.addBOM=true}PrependBOMWrapper.prototype.write=function(e){if(this.addBOM){e=r+e;this.addBOM=false}return this.encoder.write(e)};PrependBOMWrapper.prototype.end=function(){return this.encoder.end()};t.StripBOM=StripBOMWrapper;function StripBOMWrapper(e,t){this.decoder=e;this.pass=false;this.options=t||{}}StripBOMWrapper.prototype.write=function(e){var t=this.decoder.write(e);if(this.pass||!t)return t;if(t[0]===r){t=t.slice(1);if(typeof this.options.stripBOM==="function")this.options.stripBOM()}this.pass=true;return t};StripBOMWrapper.prototype.end=function(){return this.decoder.end()}},265:(e,t,r)=>{"use strict";var a=r(4526).Buffer;var n=r(1577),i=e.exports;i.encodings=null;i.defaultCharUnicode="�";i.defaultCharSingleByte="?";i.encode=function encode(e,t,r){e=""+(e||"");var n=i.getEncoder(t,r);var o=n.write(e);var s=n.end();return s&&s.length>0?a.concat([o,s]):o};i.decode=function decode(e,t,r){if(typeof e==="string"){if(!i.skipDecodeWarning){console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");i.skipDecodeWarning=true}e=a.from(""+(e||""),"binary")}var n=i.getDecoder(t,r);var o=n.write(e);var s=n.end();return s?o+s:o};i.encodingExists=function encodingExists(e){try{i.getCodec(e);return true}catch(e){return false}};i.toEncoding=i.encode;i.fromEncoding=i.decode;i._codecDataCache={};i.getCodec=function getCodec(e){if(!i.encodings)i.encodings=r(5204);var t=i._canonicalizeEncoding(e);var a={};while(true){var n=i._codecDataCache[t];if(n)return n;var o=i.encodings[t];switch(typeof o){case"string":t=o;break;case"object":for(var s in o)a[s]=o[s];if(!a.encodingName)a.encodingName=t;t=o.type;break;case"function":if(!a.encodingName)a.encodingName=t;n=new o(a,i);i._codecDataCache[a.encodingName]=n;return n;default:throw new Error("Encoding not recognized: '"+e+"' (searched as: '"+t+"')")}}};i._canonicalizeEncoding=function(e){return(""+e).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g,"")};i.getEncoder=function getEncoder(e,t){var r=i.getCodec(e),a=new r.encoder(t,r);if(r.bomAware&&t&&t.addBOM)a=new n.PrependBOM(a,t);return a};i.getDecoder=function getDecoder(e,t){var r=i.getCodec(e),a=new r.decoder(t,r);if(r.bomAware&&!(t&&t.stripBOM===false))a=new n.StripBOM(a,t);return a};i.enableStreamingAPI=function enableStreamingAPI(e){if(i.supportsStreams)return;var t=r(7145)(e);i.IconvLiteEncoderStream=t.IconvLiteEncoderStream;i.IconvLiteDecoderStream=t.IconvLiteDecoderStream;i.encodeStream=function encodeStream(e,t){return new i.IconvLiteEncoderStream(i.getEncoder(e,t),t)};i.decodeStream=function decodeStream(e,t){return new i.IconvLiteDecoderStream(i.getDecoder(e,t),t)};i.supportsStreams=true};var o;try{o=r(2781)}catch(e){}if(o&&o.Transform){i.enableStreamingAPI(o)}else{i.encodeStream=i.decodeStream=function(){throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.")}}if(false){}},7145:(e,t,r)=>{"use strict";var a=r(4526).Buffer;e.exports=function(e){var t=e.Transform;function IconvLiteEncoderStream(e,r){this.conv=e;r=r||{};r.decodeStrings=false;t.call(this,r)}IconvLiteEncoderStream.prototype=Object.create(t.prototype,{constructor:{value:IconvLiteEncoderStream}});IconvLiteEncoderStream.prototype._transform=function(e,t,r){if(typeof e!="string")return r(new Error("Iconv encoding stream needs strings as its input."));try{var a=this.conv.write(e);if(a&&a.length)this.push(a);r()}catch(e){r(e)}};IconvLiteEncoderStream.prototype._flush=function(e){try{var t=this.conv.end();if(t&&t.length)this.push(t);e()}catch(t){e(t)}};IconvLiteEncoderStream.prototype.collect=function(e){var t=[];this.on("error",e);this.on("data",(function(e){t.push(e)}));this.on("end",(function(){e(null,a.concat(t))}));return this};function IconvLiteDecoderStream(e,r){this.conv=e;r=r||{};r.encoding=this.encoding="utf8";t.call(this,r)}IconvLiteDecoderStream.prototype=Object.create(t.prototype,{constructor:{value:IconvLiteDecoderStream}});IconvLiteDecoderStream.prototype._transform=function(e,t,r){if(!a.isBuffer(e)&&!(e instanceof Uint8Array))return r(new Error("Iconv decoding stream needs buffers as its input."));try{var n=this.conv.write(e);if(n&&n.length)this.push(n,this.encoding);r()}catch(e){r(e)}};IconvLiteDecoderStream.prototype._flush=function(e){try{var t=this.conv.end();if(t&&t.length)this.push(t,this.encoding);e()}catch(t){e(t)}};IconvLiteDecoderStream.prototype.collect=function(e){var t="";this.on("error",e);this.on("data",(function(e){t+=e}));this.on("end",(function(){e(null,t)}));return this};return{IconvLiteEncoderStream:IconvLiteEncoderStream,IconvLiteDecoderStream:IconvLiteDecoderStream}}},9008:(e,t,r)=>{"use strict";var a=r(7104),n=r(1974),i=r(3354),o=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,p=Math.abs,l=Math.floor;e.exports=function(e){var t,r,d,c;if(!a(e))return o.apply(this,arguments);r=n(i(this).length);d=arguments[1];if(isNaN(d))d=0;else if(d>=0)d=l(d);else d=n(this.length)-l(p(d));for(t=d;t<r;++t){if(s.call(this,t)){c=this[t];if(a(c))return t}}return-1}},5160:(e,t,r)=>{"use strict";e.exports=r(5134)()?Array.from:r(1871)},5134:e=>{"use strict";e.exports=function(){var e=Array.from,t,r;if(typeof e!=="function")return false;t=["raz","dwa"];r=e(t);return Boolean(r&&r!==t&&r[1]==="dwa")}},1871:(e,t,r)=>{"use strict";var a=r(3005).iterator,n=r(8717),i=r(3053),o=r(1974),s=r(1715),p=r(3354),l=r(5269),d=r(4855),c=Array.isArray,u=Function.prototype.call,f={configurable:true,enumerable:true,writable:true,value:null},m=Object.defineProperty;e.exports=function(e){var t=arguments[1],r=arguments[2],h,v,y,b,g,w,_,S,O,A;e=Object(p(e));if(l(t))s(t);if(!this||this===Array||!i(this)){if(!t){if(n(e)){g=e.length;if(g!==1)return Array.apply(null,e);b=new Array(1);b[0]=e[0];return b}if(c(e)){b=new Array(g=e.length);for(v=0;v<g;++v)b[v]=e[v];return b}}b=[]}else{h=this}if(!c(e)){if((O=e[a])!==undefined){_=s(O).call(e);if(h)b=new h;S=_.next();v=0;while(!S.done){A=t?u.call(t,r,S.value,v):S.value;if(h){f.value=A;m(b,v,f)}else{b[v]=A}S=_.next();++v}g=v}else if(d(e)){g=e.length;if(h)b=new h;for(v=0,y=0;v<g;++v){A=e[v];if(v+1<g){w=A.charCodeAt(0);if(w>=55296&&w<=56319)A+=e[++v]}A=t?u.call(t,r,A,y):A;if(h){f.value=A;m(b,y,f)}else{b[y]=A}++y}g=y}}if(g===undefined){g=o(e.length);if(h)b=new h(g);for(v=0;v<g;++v){A=t?u.call(t,r,e[v],v):e[v];if(h){f.value=A;m(b,v,f)}else{b[v]=A}}}if(h){f.value=null;b.length=g}return b}},1800:(e,t,r)=>{"use strict";var a=r(5160),n=Array.isArray;e.exports=function(e){return n(e)?e:a(e)}},3499:(e,t,r)=>{"use strict";var a=r(6277),n=r(7938),i=r(5269),o=Error.captureStackTrace;e.exports=function(t){var r=new Error(t),s=arguments[1],p=arguments[2];if(!i(p)){if(n(s)){p=s;s=null}}if(i(p))a(r,p);if(i(s))r.code=s;if(o)o(r,e.exports);return r}},1516:(e,t,r)=>{"use strict";var a=r(1974);var test=function(e,t){return t};var n,i,o,s;try{Object.defineProperty(test,"length",{configurable:true,writable:false,enumerable:false,value:1})}catch(e){}if(test.length===1){n={configurable:true,writable:false,enumerable:false};i=Object.defineProperty;e.exports=function(e,t){t=a(t);if(e.length===t)return e;n.value=t;return i(e,"length",n)}}else{s=r(648);o=function(){var e=[];return function(t){var r,a=0;if(e[t])return e[t];r=[];while(t--)r.push("a"+(++a).toString(36));return new Function("fn","return function ("+r.join(", ")+") { return fn.apply(this, arguments); };")}}();e.exports=function(e,t){var r;t=a(t);if(e.length===t)return e;r=o(t)(e);try{s(r,e)}catch(e){}return r}}},8717:e=>{"use strict";var t=Object.prototype.toString,r=t.call(function(){return arguments}());e.exports=function(e){return t.call(e)===r}},3053:e=>{"use strict";var t=Object.prototype.toString,r=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(e){return typeof e==="function"&&r(t.call(e))}},5049:e=>{"use strict";e.exports=function(){}},4724:(e,t,r)=>{"use strict";e.exports=r(2174)()?Math.sign:r(4845)},2174:e=>{"use strict";e.exports=function(){var e=Math.sign;if(typeof e!=="function")return false;return e(10)===1&&e(-20)===-1}},4845:e=>{"use strict";e.exports=function(e){e=Number(e);if(isNaN(e)||e===0)return e;return e>0?1:-1}},7104:(e,t,r)=>{"use strict";e.exports=r(2041)()?Number.isNaN:r(8104)},2041:e=>{"use strict";e.exports=function(){var e=Number.isNaN;if(typeof e!=="function")return false;return!e({})&&e(NaN)&&!e(34)}},8104:e=>{"use strict";e.exports=function(e){return e!==e}},5867:(e,t,r)=>{"use strict";var a=r(4724),n=Math.abs,i=Math.floor;e.exports=function(e){if(isNaN(e))return 0;e=Number(e);if(e===0||!isFinite(e))return e;return a(e)*i(n(e))}},1974:(e,t,r)=>{"use strict";var a=r(5867),n=Math.max;e.exports=function(e){return n(0,a(e))}},4320:(e,t,r)=>{"use strict";var a=r(1715),n=r(3354),i=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,p=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(r,l){var d,c=arguments[2],u=arguments[3];r=Object(n(r));a(l);d=s(r);if(u){d.sort(typeof u==="function"?i.call(u,r):undefined)}if(typeof e!=="function")e=d[e];return o.call(e,d,(function(e,a){if(!p.call(r,e))return t;return o.call(l,c,r[e],e,r,a)}))}}},6277:(e,t,r)=>{"use strict";e.exports=r(1982)()?Object.assign:r(6330)},1982:e=>{"use strict";e.exports=function(){var e=Object.assign,t;if(typeof e!=="function")return false;t={foo:"raz"};e(t,{bar:"dwa"},{trzy:"trzy"});return t.foo+t.bar+t.trzy==="razdwatrzy"}},6330:(e,t,r)=>{"use strict";var a=r(7349),n=r(3354),i=Math.max;e.exports=function(e,t){var r,o,s=i(arguments.length,2),p;e=Object(n(e));p=function(a){try{e[a]=t[a]}catch(e){if(!r)r=e}};for(o=1;o<s;++o){t=arguments[o];a(t).forEach(p)}if(r!==undefined)throw r;return e}},3676:(e,t,r)=>{"use strict";e.exports=r(4320)("forEach")},5052:e=>{"use strict";e.exports=function(e){return typeof e==="function"}},7938:(e,t,r)=>{"use strict";var a=r(5269);var n={function:true,object:true};e.exports=function(e){return a(e)&&n[typeof e]||false}},5269:(e,t,r)=>{"use strict";var a=r(5049)();e.exports=function(e){return e!==a&&e!==null}},7349:(e,t,r)=>{"use strict";e.exports=r(186)()?Object.keys:r(4318)},186:e=>{"use strict";e.exports=function(){try{Object.keys("primitive");return true}catch(e){return false}}},4318:(e,t,r)=>{"use strict";var a=r(5269);var n=Object.keys;e.exports=function(e){return n(a(e)?Object(e):e)}},8904:(e,t,r)=>{"use strict";var a=r(1715),n=r(3676),i=Function.prototype.call;e.exports=function(e,t){var r={},o=arguments[2];a(t);n(e,(function(e,a,n,s){r[a]=i.call(t,o,e,a,n,s)}));return r}},648:(e,t,r)=>{"use strict";var a=r(3354),n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;e.exports=function(e,t){var r,p=Object(a(t));e=Object(a(e));o(p).forEach((function(a){try{n(e,a,i(t,a))}catch(e){r=e}}));if(typeof s==="function"){s(p).forEach((function(a){try{n(e,a,i(t,a))}catch(e){r=e}}))}if(r!==undefined)throw r;return e}},9325:(e,t,r)=>{"use strict";var a=r(5269);var n=Array.prototype.forEach,i=Object.create;var process=function(e,t){var r;for(r in e)t[r]=e[r]};e.exports=function(e){var t=i(null);n.call(arguments,(function(e){if(!a(e))return;process(Object(e),t)}));return t}},3786:e=>{"use strict";var t=Array.prototype.forEach,r=Object.create;e.exports=function(e){var a=r(null);t.call(arguments,(function(e){a[e]=true}));return a}},1715:e=>{"use strict";e.exports=function(e){if(typeof e!=="function")throw new TypeError(e+" is not a function");return e}},3354:(e,t,r)=>{"use strict";var a=r(5269);e.exports=function(e){if(!a(e))throw new TypeError("Cannot use null or undefined");return e}},9386:(e,t,r)=>{"use strict";var a=r(3354),n=r(8421);e.exports=function(e){return n(a(e))}},8421:(e,t,r)=>{"use strict";var a=r(5052);e.exports=function(e){try{if(e&&a(e.toString))return e.toString();return String(e)}catch(e){throw new TypeError("Passed argument cannot be stringifed")}}},9381:(e,t,r)=>{"use strict";var a=r(5052);e.exports=function(e){try{if(e&&a(e.toString))return e.toString();return String(e)}catch(e){return"<Non-coercible to string value>"}}},2560:(e,t,r)=>{"use strict";e.exports=r(2262)()?String.prototype.contains:r(2298)},2262:e=>{"use strict";var t="razdwatrzy";e.exports=function(){if(typeof t.contains!=="function")return false;return t.contains("dwa")===true&&t.contains("foo")===false}},2298:e=>{"use strict";var t=String.prototype.indexOf;e.exports=function(e){return t.call(this,e,arguments[1])>-1}},4855:e=>{"use strict";var t=Object.prototype.toString,r=t.call("");e.exports=function(e){return typeof e==="string"||e&&typeof e==="object"&&(e instanceof String||t.call(e)===r)||false}},7354:(e,t,r)=>{"use strict";var a=r(9381);var n=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=a(e);if(t.length>100)t=t.slice(0,99)+"…";t=t.replace(n,(function(e){return JSON.stringify(e).slice(1,-1)}));return t}},3005:(e,t,r)=>{"use strict";e.exports=r(1662)()?r(7538).Symbol:r(5874)},1662:(e,t,r)=>{"use strict";var a=r(7538),n={object:true,symbol:true};e.exports=function(){var e=a.Symbol;var t;if(typeof e!=="function")return false;t=e("test symbol");try{String(t)}catch(e){return false}if(!n[typeof e.iterator])return false;if(!n[typeof e.toPrimitive])return false;if(!n[typeof e.toStringTag])return false;return true}},4550:e=>{"use strict";e.exports=function(e){if(!e)return false;if(typeof e==="symbol")return true;if(!e.constructor)return false;if(e.constructor.name!=="Symbol")return false;return e[e.constructor.toStringTag]==="Symbol"}},6280:(e,t,r)=>{"use strict";var a=r(5509);var n=Object.create,i=Object.defineProperty,o=Object.prototype;var s=n(null);e.exports=function(e){var t=0,r,n;while(s[e+(t||"")])++t;e+=t||"";s[e]=true;r="@@"+e;i(o,r,a.gs(null,(function(e){if(n)return;n=true;i(this,r,a(e));n=false})));return r}},5979:(e,t,r)=>{"use strict";var a=r(5509),n=r(7538).Symbol;e.exports=function(e){return Object.defineProperties(e,{hasInstance:a("",n&&n.hasInstance||e("hasInstance")),isConcatSpreadable:a("",n&&n.isConcatSpreadable||e("isConcatSpreadable")),iterator:a("",n&&n.iterator||e("iterator")),match:a("",n&&n.match||e("match")),replace:a("",n&&n.replace||e("replace")),search:a("",n&&n.search||e("search")),species:a("",n&&n.species||e("species")),split:a("",n&&n.split||e("split")),toPrimitive:a("",n&&n.toPrimitive||e("toPrimitive")),toStringTag:a("",n&&n.toStringTag||e("toStringTag")),unscopables:a("",n&&n.unscopables||e("unscopables"))})}},3162:(e,t,r)=>{"use strict";var a=r(5509),n=r(31);var i=Object.create(null);e.exports=function(e){return Object.defineProperties(e,{for:a((function(t){if(i[t])return i[t];return i[t]=e(String(t))})),keyFor:a((function(e){var t;n(e);for(t in i){if(i[t]===e)return t}return undefined}))})}},5874:(e,t,r)=>{"use strict";var a=r(5509),n=r(31),i=r(7538).Symbol,o=r(6280),s=r(5979),p=r(3162);var l=Object.create,d=Object.defineProperties,c=Object.defineProperty;var u,f,m;if(typeof i==="function"){try{String(i());m=true}catch(e){}}else{i=null}f=function Symbol(e){if(this instanceof f)throw new TypeError("Symbol is not a constructor");return u(e)};e.exports=u=function Symbol(e){var t;if(this instanceof Symbol)throw new TypeError("Symbol is not a constructor");if(m)return i(e);t=l(f.prototype);e=e===undefined?"":String(e);return d(t,{__description__:a("",e),__name__:a("",o(e))})};s(u);p(u);d(f.prototype,{constructor:a(u),toString:a("",(function(){return this.__name__}))});d(u.prototype,{toString:a((function(){return"Symbol ("+n(this).__description__+")"})),valueOf:a((function(){return n(this)}))});c(u.prototype,u.toPrimitive,a("",(function(){var e=n(this);if(typeof e==="symbol")return e;return e.toString()})));c(u.prototype,u.toStringTag,a("c","Symbol"));c(f.prototype,u.toStringTag,a("c",u.prototype[u.toStringTag]));c(f.prototype,u.toPrimitive,a("c",u.prototype[u.toPrimitive]))},31:(e,t,r)=>{"use strict";var a=r(4550);e.exports=function(e){if(!a(e))throw new TypeError(e+" is not a symbol");return e}},8574:(e,t,r)=>{"use strict";var a=r(5509),n=r(1715),i=Function.prototype.apply,o=Function.prototype.call,s=Object.create,p=Object.defineProperty,l=Object.defineProperties,d=Object.prototype.hasOwnProperty,c={configurable:true,enumerable:false,writable:true},u,f,m,h,v,y,b;u=function(e,t){var r;n(t);if(!d.call(this,"__ee__")){r=c.value=s(null);p(this,"__ee__",c);c.value=null}else{r=this.__ee__}if(!r[e])r[e]=t;else if(typeof r[e]==="object")r[e].push(t);else r[e]=[r[e],t];return this};f=function(e,t){var r,a;n(t);a=this;u.call(this,e,r=function(){m.call(a,e,r);i.call(t,this,arguments)});r.__eeOnceListener__=t;return this};m=function(e,t){var r,a,i,o;n(t);if(!d.call(this,"__ee__"))return this;r=this.__ee__;if(!r[e])return this;a=r[e];if(typeof a==="object"){for(o=0;i=a[o];++o){if(i===t||i.__eeOnceListener__===t){if(a.length===2)r[e]=a[o?0:1];else a.splice(o,1)}}}else{if(a===t||a.__eeOnceListener__===t){delete r[e]}}return this};h=function(e){var t,r,a,n,s;if(!d.call(this,"__ee__"))return;n=this.__ee__[e];if(!n)return;if(typeof n==="object"){r=arguments.length;s=new Array(r-1);for(t=1;t<r;++t)s[t-1]=arguments[t];n=n.slice();for(t=0;a=n[t];++t){i.call(a,this,s)}}else{switch(arguments.length){case 1:o.call(n,this);break;case 2:o.call(n,this,arguments[1]);break;case 3:o.call(n,this,arguments[1],arguments[2]);break;default:r=arguments.length;s=new Array(r-1);for(t=1;t<r;++t){s[t-1]=arguments[t]}i.call(n,this,s)}}};v={on:u,once:f,off:m,emit:h};y={on:a(u),once:a(f),off:a(m),emit:a(h)};b=l({},y);e.exports=t=function(e){return e==null?s(b):l(Object(e),y)};t.methods=v},2232:e=>{var naiveFallback=function(){if(typeof self==="object"&&self)return self;if(typeof window==="object"&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:true})}catch(e){return naiveFallback()}try{if(!__global__)return naiveFallback();return __global__}finally{delete Object.prototype.__global__}}()},7538:(e,t,r)=>{"use strict";e.exports=r(6927)()?globalThis:r(2232)},6927:e=>{"use strict";e.exports=function(){if(typeof globalThis!=="object")return false;if(!globalThis)return false;return globalThis.Array===Array}},4216:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(1470).mkdirsSync;const o=r(1767).utimesMillisSync;const s=Symbol("notExist");function copySync(e,t,r){if(typeof r==="function"){r={filter:r}}r=r||{};r.clobber="clobber"in r?!!r.clobber:true;r.overwrite="overwrite"in r?!!r.overwrite:r.clobber;if(r.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}const o=checkPaths(e,t);if(r.filter&&!r.filter(e,t))return;const s=n.dirname(t);if(!a.existsSync(s))i(s);return startCopy(o,e,t,r)}function startCopy(e,t,r,a){if(a.filter&&!a.filter(t,r))return;return getStats(e,t,r,a)}function getStats(e,t,r,n){const i=n.dereference?a.statSync:a.lstatSync;const o=i(t);if(o.isDirectory())return onDir(o,e,t,r,n);else if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return onFile(o,e,t,r,n);else if(o.isSymbolicLink())return onLink(e,t,r,n)}function onFile(e,t,r,a,n){if(t===s)return copyFile(e,r,a,n);return mayCopyFile(e,r,a,n)}function mayCopyFile(e,t,r,n){if(n.overwrite){a.unlinkSync(r);return copyFile(e,t,r,n)}else if(n.errorOnExist){throw new Error(`'${r}' already exists`)}}function copyFile(e,t,r,n){if(typeof a.copyFileSync==="function"){a.copyFileSync(t,r);a.chmodSync(r,e.mode);if(n.preserveTimestamps){return o(r,e.atime,e.mtime)}return}return copyFileFallback(e,t,r,n)}function copyFileFallback(e,t,n,i){const o=64*1024;const s=r(5679)(o);const p=a.openSync(t,"r");const l=a.openSync(n,"w",e.mode);let d=0;while(d<e.size){const e=a.readSync(p,s,0,o,d);a.writeSync(l,s,0,e);d+=e}if(i.preserveTimestamps)a.futimesSync(l,e.atime,e.mtime);a.closeSync(p);a.closeSync(l)}function onDir(e,t,r,a,n){if(t===s)return mkDirAndCopy(e,r,a,n);if(t&&!t.isDirectory()){throw new Error(`Cannot overwrite non-directory '${a}' with directory '${r}'.`)}return copyDir(r,a,n)}function mkDirAndCopy(e,t,r,n){a.mkdirSync(r);copyDir(t,r,n);return a.chmodSync(r,e.mode)}function copyDir(e,t,r){a.readdirSync(e).forEach((a=>copyDirItem(a,e,t,r)))}function copyDirItem(e,t,r,a){const i=n.join(t,e);const o=n.join(r,e);const s=checkPaths(i,o);return startCopy(s,i,o,a)}function onLink(e,t,r,i){let o=a.readlinkSync(t);if(i.dereference){o=n.resolve(process.cwd(),o)}if(e===s){return a.symlinkSync(o,r)}else{let e;try{e=a.readlinkSync(r)}catch(e){if(e.code==="EINVAL"||e.code==="UNKNOWN")return a.symlinkSync(o,r);throw e}if(i.dereference){e=n.resolve(process.cwd(),e)}if(isSrcSubdir(o,e)){throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${e}'.`)}if(a.statSync(r).isDirectory()&&isSrcSubdir(e,o)){throw new Error(`Cannot overwrite '${e}' with '${o}'.`)}return copyLink(o,r)}}function copyLink(e,t){a.unlinkSync(t);return a.symlinkSync(e,t)}function isSrcSubdir(e,t){const r=n.resolve(e).split(n.sep);const a=n.resolve(t).split(n.sep);return r.reduce(((e,t,r)=>e&&a[r]===t),true)}function checkStats(e,t){const r=a.statSync(e);let n;try{n=a.statSync(t)}catch(e){if(e.code==="ENOENT")return{srcStat:r,destStat:s};throw e}return{srcStat:r,destStat:n}}function checkPaths(e,t){const{srcStat:r,destStat:a}=checkStats(e,t);if(a.ino&&a.ino===r.ino){throw new Error("Source and destination must not be the same.")}if(r.isDirectory()&&isSrcSubdir(e,t)){throw new Error(`Cannot copy '${e}' to a subdirectory of itself, '${t}'.`)}return a}e.exports=copySync},582:(e,t,r)=>{"use strict";e.exports={copySync:r(4216)}},8400:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(1470).mkdirs;const o=r(1382).pathExists;const s=r(1767).utimesMillis;const p=Symbol("notExist");function copy(e,t,r,a){if(typeof r==="function"&&!a){a=r;r={}}else if(typeof r==="function"){r={filter:r}}a=a||function(){};r=r||{};r.clobber="clobber"in r?!!r.clobber:true;r.overwrite="overwrite"in r?!!r.overwrite:r.clobber;if(r.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}checkPaths(e,t,((n,i)=>{if(n)return a(n);if(r.filter)return handleFilter(checkParentDir,i,e,t,r,a);return checkParentDir(i,e,t,r,a)}))}function checkParentDir(e,t,r,a,s){const p=n.dirname(r);o(p,((n,o)=>{if(n)return s(n);if(o)return startCopy(e,t,r,a,s);i(p,(n=>{if(n)return s(n);return startCopy(e,t,r,a,s)}))}))}function handleFilter(e,t,r,a,n,i){Promise.resolve(n.filter(r,a)).then((o=>{if(o){if(t)return e(t,r,a,n,i);return e(r,a,n,i)}return i()}),(e=>i(e)))}function startCopy(e,t,r,a,n){if(a.filter)return handleFilter(getStats,e,t,r,a,n);return getStats(e,t,r,a,n)}function getStats(e,t,r,n,i){const o=n.dereference?a.stat:a.lstat;o(t,((a,o)=>{if(a)return i(a);if(o.isDirectory())return onDir(o,e,t,r,n,i);else if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return onFile(o,e,t,r,n,i);else if(o.isSymbolicLink())return onLink(e,t,r,n,i)}))}function onFile(e,t,r,a,n,i){if(t===p)return copyFile(e,r,a,n,i);return mayCopyFile(e,r,a,n,i)}function mayCopyFile(e,t,r,n,i){if(n.overwrite){a.unlink(r,(a=>{if(a)return i(a);return copyFile(e,t,r,n,i)}))}else if(n.errorOnExist){return i(new Error(`'${r}' already exists`))}else return i()}function copyFile(e,t,r,n,i){if(typeof a.copyFile==="function"){return a.copyFile(t,r,(t=>{if(t)return i(t);return setDestModeAndTimestamps(e,r,n,i)}))}return copyFileFallback(e,t,r,n,i)}function copyFileFallback(e,t,r,n,i){const o=a.createReadStream(t);o.on("error",(e=>i(e))).once("open",(()=>{const t=a.createWriteStream(r,{mode:e.mode});t.on("error",(e=>i(e))).on("open",(()=>o.pipe(t))).once("close",(()=>setDestModeAndTimestamps(e,r,n,i)))}))}function setDestModeAndTimestamps(e,t,r,n){a.chmod(t,e.mode,(a=>{if(a)return n(a);if(r.preserveTimestamps){return s(t,e.atime,e.mtime,n)}return n()}))}function onDir(e,t,r,a,n,i){if(t===p)return mkDirAndCopy(e,r,a,n,i);if(t&&!t.isDirectory()){return i(new Error(`Cannot overwrite non-directory '${a}' with directory '${r}'.`))}return copyDir(r,a,n,i)}function mkDirAndCopy(e,t,r,n,i){a.mkdir(r,(o=>{if(o)return i(o);copyDir(t,r,n,(t=>{if(t)return i(t);return a.chmod(r,e.mode,i)}))}))}function copyDir(e,t,r,n){a.readdir(e,((a,i)=>{if(a)return n(a);return copyDirItems(i,e,t,r,n)}))}function copyDirItems(e,t,r,a,n){const i=e.pop();if(!i)return n();return copyDirItem(e,i,t,r,a,n)}function copyDirItem(e,t,r,a,i,o){const s=n.join(r,t);const p=n.join(a,t);checkPaths(s,p,((t,n)=>{if(t)return o(t);startCopy(n,s,p,i,(t=>{if(t)return o(t);return copyDirItems(e,r,a,i,o)}))}))}function onLink(e,t,r,i,o){a.readlink(t,((t,s)=>{if(t)return o(t);if(i.dereference){s=n.resolve(process.cwd(),s)}if(e===p){return a.symlink(s,r,o)}else{a.readlink(r,((t,p)=>{if(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return a.symlink(s,r,o);return o(t)}if(i.dereference){p=n.resolve(process.cwd(),p)}if(isSrcSubdir(s,p)){return o(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${p}'.`))}if(e.isDirectory()&&isSrcSubdir(p,s)){return o(new Error(`Cannot overwrite '${p}' with '${s}'.`))}return copyLink(s,r,o)}))}}))}function copyLink(e,t,r){a.unlink(t,(n=>{if(n)return r(n);return a.symlink(e,t,r)}))}function isSrcSubdir(e,t){const r=n.resolve(e).split(n.sep);const a=n.resolve(t).split(n.sep);return r.reduce(((e,t,r)=>e&&a[r]===t),true)}function checkStats(e,t,r){a.stat(e,((e,n)=>{if(e)return r(e);a.stat(t,((e,t)=>{if(e){if(e.code==="ENOENT")return r(null,{srcStat:n,destStat:p});return r(e)}return r(null,{srcStat:n,destStat:t})}))}))}function checkPaths(e,t,r){checkStats(e,t,((a,n)=>{if(a)return r(a);const{srcStat:i,destStat:o}=n;if(o.ino&&o.ino===i.ino){return r(new Error("Source and destination must not be the same."))}if(i.isDirectory()&&isSrcSubdir(e,t)){return r(new Error(`Cannot copy '${e}' to a subdirectory of itself, '${t}'.`))}return r(null,o)}))}e.exports=copy},6082:(e,t,r)=>{"use strict";const a=r(9676).E;e.exports={copy:a(r(8400))}},4264:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(7147);const i=r(1017);const o=r(1470);const s=r(5951);const p=a((function emptyDir(e,t){t=t||function(){};n.readdir(e,((r,a)=>{if(r)return o.mkdirs(e,t);a=a.map((t=>i.join(e,t)));deleteItem();function deleteItem(){const e=a.pop();if(!e)return t();s.remove(e,(e=>{if(e)return t(e);deleteItem()}))}}))}));function emptyDirSync(e){let t;try{t=n.readdirSync(e)}catch(t){return o.mkdirsSync(e)}t.forEach((t=>{t=i.join(e,t);s.removeSync(t)}))}e.exports={emptyDirSync:emptyDirSync,emptydirSync:emptyDirSync,emptyDir:p,emptydir:p}},6495:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(1017);const i=r(7905);const o=r(1470);const s=r(1382).pathExists;function createFile(e,t){function makeFile(){i.writeFile(e,"",(e=>{if(e)return t(e);t()}))}i.stat(e,((r,a)=>{if(!r&&a.isFile())return t();const i=n.dirname(e);s(i,((e,r)=>{if(e)return t(e);if(r)return makeFile();o.mkdirs(i,(e=>{if(e)return t(e);makeFile()}))}))}))}function createFileSync(e){let t;try{t=i.statSync(e)}catch(e){}if(t&&t.isFile())return;const r=n.dirname(e);if(!i.existsSync(r)){o.mkdirsSync(r)}i.writeFileSync(e,"")}e.exports={createFile:a(createFile),createFileSync:createFileSync}},3483:(e,t,r)=>{"use strict";const a=r(6495);const n=r(4802);const i=r(639);e.exports={createFile:a.createFile,createFileSync:a.createFileSync,ensureFile:a.createFile,ensureFileSync:a.createFileSync,createLink:n.createLink,createLinkSync:n.createLinkSync,ensureLink:n.createLink,ensureLinkSync:n.createLinkSync,createSymlink:i.createSymlink,createSymlinkSync:i.createSymlinkSync,ensureSymlink:i.createSymlink,ensureSymlinkSync:i.createSymlinkSync}},4802:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(1017);const i=r(7905);const o=r(1470);const s=r(1382).pathExists;function createLink(e,t,r){function makeLink(e,t){i.link(e,t,(e=>{if(e)return r(e);r(null)}))}s(t,((a,p)=>{if(a)return r(a);if(p)return r(null);i.lstat(e,(a=>{if(a){a.message=a.message.replace("lstat","ensureLink");return r(a)}const i=n.dirname(t);s(i,((a,n)=>{if(a)return r(a);if(n)return makeLink(e,t);o.mkdirs(i,(a=>{if(a)return r(a);makeLink(e,t)}))}))}))}))}function createLinkSync(e,t){const r=i.existsSync(t);if(r)return undefined;try{i.lstatSync(e)}catch(e){e.message=e.message.replace("lstat","ensureLink");throw e}const a=n.dirname(t);const s=i.existsSync(a);if(s)return i.linkSync(e,t);o.mkdirsSync(a);return i.linkSync(e,t)}e.exports={createLink:a(createLink),createLinkSync:createLinkSync}},8118:(e,t,r)=>{"use strict";const a=r(1017);const n=r(7905);const i=r(1382).pathExists;function symlinkPaths(e,t,r){if(a.isAbsolute(e)){return n.lstat(e,(t=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return r(t)}return r(null,{toCwd:e,toDst:e})}))}else{const o=a.dirname(t);const s=a.join(o,e);return i(s,((t,i)=>{if(t)return r(t);if(i){return r(null,{toCwd:s,toDst:e})}else{return n.lstat(e,(t=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return r(t)}return r(null,{toCwd:e,toDst:a.relative(o,e)})}))}}))}}function symlinkPathsSync(e,t){let r;if(a.isAbsolute(e)){r=n.existsSync(e);if(!r)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}else{const i=a.dirname(t);const o=a.join(i,e);r=n.existsSync(o);if(r){return{toCwd:o,toDst:e}}else{r=n.existsSync(e);if(!r)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:a.relative(i,e)}}}}e.exports={symlinkPaths:symlinkPaths,symlinkPathsSync:symlinkPathsSync}},5742:(e,t,r)=>{"use strict";const a=r(7905);function symlinkType(e,t,r){r=typeof t==="function"?t:r;t=typeof t==="function"?false:t;if(t)return r(null,t);a.lstat(e,((e,a)=>{if(e)return r(null,"file");t=a&&a.isDirectory()?"dir":"file";r(null,t)}))}function symlinkTypeSync(e,t){let r;if(t)return t;try{r=a.lstatSync(e)}catch(e){return"file"}return r&&r.isDirectory()?"dir":"file"}e.exports={symlinkType:symlinkType,symlinkTypeSync:symlinkTypeSync}},639:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(1017);const i=r(7905);const o=r(1470);const s=o.mkdirs;const p=o.mkdirsSync;const l=r(8118);const d=l.symlinkPaths;const c=l.symlinkPathsSync;const u=r(5742);const f=u.symlinkType;const m=u.symlinkTypeSync;const h=r(1382).pathExists;function createSymlink(e,t,r,a){a=typeof r==="function"?r:a;r=typeof r==="function"?false:r;h(t,((o,p)=>{if(o)return a(o);if(p)return a(null);d(e,t,((o,p)=>{if(o)return a(o);e=p.toDst;f(p.toCwd,r,((r,o)=>{if(r)return a(r);const p=n.dirname(t);h(p,((r,n)=>{if(r)return a(r);if(n)return i.symlink(e,t,o,a);s(p,(r=>{if(r)return a(r);i.symlink(e,t,o,a)}))}))}))}))}))}function createSymlinkSync(e,t,r){const a=i.existsSync(t);if(a)return undefined;const o=c(e,t);e=o.toDst;r=m(o.toCwd,r);const s=n.dirname(t);const l=i.existsSync(s);if(l)return i.symlinkSync(e,t,r);p(s);return i.symlinkSync(e,t,r)}e.exports={createSymlink:a(createSymlink),createSymlinkSync:createSymlinkSync}},181:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(7905);const i=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>typeof n[e]==="function"));Object.keys(n).forEach((e=>{if(e==="promises"){return}t[e]=n[e]}));i.forEach((e=>{t[e]=a(n[e])}));t.exists=function(e,t){if(typeof t==="function"){return n.exists(e,t)}return new Promise((t=>n.exists(e,t)))};t.read=function(e,t,r,a,i,o){if(typeof o==="function"){return n.read(e,t,r,a,i,o)}return new Promise(((o,s)=>{n.read(e,t,r,a,i,((e,t,r)=>{if(e)return s(e);o({bytesRead:t,buffer:r})}))}))};t.write=function(e,t,...r){if(typeof r[r.length-1]==="function"){return n.write(e,t,...r)}return new Promise(((a,i)=>{n.write(e,t,...r,((e,t,r)=>{if(e)return i(e);a({bytesWritten:t,buffer:r})}))}))}},5501:(e,t,r)=>{"use strict";e.exports=Object.assign({},r(181),r(582),r(6082),r(4264),r(3483),r(6797),r(1470),r(2599),r(6271),r(6981),r(1382),r(5951));const a=r(7147);if(Object.getOwnPropertyDescriptor(a,"promises")){Object.defineProperty(e.exports,"promises",{get(){return a.promises}})}},6797:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(5622);n.outputJson=a(r(6961));n.outputJsonSync=r(8300);n.outputJSON=n.outputJson;n.outputJSONSync=n.outputJsonSync;n.writeJSON=n.writeJson;n.writeJSONSync=n.writeJsonSync;n.readJSON=n.readJson;n.readJSONSync=n.readJsonSync;e.exports=n},5622:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(4920);e.exports={readJson:a(n.readFile),readJsonSync:n.readFileSync,writeJson:a(n.writeFile),writeJsonSync:n.writeFileSync}},8300:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(1470);const o=r(5622);function outputJsonSync(e,t,r){const s=n.dirname(e);if(!a.existsSync(s)){i.mkdirsSync(s)}o.writeJsonSync(e,t,r)}e.exports=outputJsonSync},6961:(e,t,r)=>{"use strict";const a=r(1017);const n=r(1470);const i=r(1382).pathExists;const o=r(5622);function outputJson(e,t,r,s){if(typeof r==="function"){s=r;r={}}const p=a.dirname(e);i(p,((a,i)=>{if(a)return s(a);if(i)return o.writeJson(e,t,r,s);n.mkdirs(p,(a=>{if(a)return s(a);o.writeJson(e,t,r,s)}))}))}e.exports=outputJson},1470:(e,t,r)=>{"use strict";const a=r(9676).E;const n=a(r(6156));const i=r(1776);e.exports={mkdirs:n,mkdirsSync:i,mkdirp:n,mkdirpSync:i,ensureDir:n,ensureDirSync:i}},1776:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(1929).invalidWin32Path;const o=parseInt("0777",8);function mkdirsSync(e,t,r){if(!t||typeof t!=="object"){t={mode:t}}let s=t.mode;const p=t.fs||a;if(process.platform==="win32"&&i(e)){const t=new Error(e+" contains invalid WIN32 path characters.");t.code="EINVAL";throw t}if(s===undefined){s=o&~process.umask()}if(!r)r=null;e=n.resolve(e);try{p.mkdirSync(e,s);r=r||e}catch(a){if(a.code==="ENOENT"){if(n.dirname(e)===e)throw a;r=mkdirsSync(n.dirname(e),t,r);mkdirsSync(e,t,r)}else{let t;try{t=p.statSync(e)}catch(e){throw a}if(!t.isDirectory())throw a}}return r}e.exports=mkdirsSync},6156:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(1929).invalidWin32Path;const o=parseInt("0777",8);function mkdirs(e,t,r,s){if(typeof t==="function"){r=t;t={}}else if(!t||typeof t!=="object"){t={mode:t}}if(process.platform==="win32"&&i(e)){const t=new Error(e+" contains invalid WIN32 path characters.");t.code="EINVAL";return r(t)}let p=t.mode;const l=t.fs||a;if(p===undefined){p=o&~process.umask()}if(!s)s=null;r=r||function(){};e=n.resolve(e);l.mkdir(e,p,(a=>{if(!a){s=s||e;return r(null,s)}switch(a.code){case"ENOENT":if(n.dirname(e)===e)return r(a);mkdirs(n.dirname(e),t,((a,n)=>{if(a)r(a,n);else mkdirs(e,t,r,n)}));break;default:l.stat(e,((e,t)=>{if(e||!t.isDirectory())r(a,s);else r(null,s)}));break}}))}e.exports=mkdirs},1929:(e,t,r)=>{"use strict";const a=r(1017);function getRootPath(e){e=a.normalize(a.resolve(e)).split(a.sep);if(e.length>0)return e[0];return null}const n=/[<>:"|?*]/;function invalidWin32Path(e){const t=getRootPath(e);e=e.replace(t,"");return n.test(e)}e.exports={getRootPath:getRootPath,invalidWin32Path:invalidWin32Path}},2599:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(582).copySync;const o=r(5951).removeSync;const s=r(1470).mkdirsSync;const p=r(5679);function moveSync(e,t,r){r=r||{};const i=r.overwrite||r.clobber||false;e=n.resolve(e);t=n.resolve(t);if(e===t)return a.accessSync(e);if(isSrcSubdir(e,t))throw new Error(`Cannot move '${e}' into itself '${t}'.`);s(n.dirname(t));tryRenameSync();function tryRenameSync(){if(i){try{return a.renameSync(e,t)}catch(a){if(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM"){o(t);r.overwrite=false;return moveSync(e,t,r)}if(a.code!=="EXDEV")throw a;return moveSyncAcrossDevice(e,t,i)}}else{try{a.linkSync(e,t);return a.unlinkSync(e)}catch(r){if(r.code==="EXDEV"||r.code==="EISDIR"||r.code==="EPERM"||r.code==="ENOTSUP"){return moveSyncAcrossDevice(e,t,i)}throw r}}}}function moveSyncAcrossDevice(e,t,r){const n=a.statSync(e);if(n.isDirectory()){return moveDirSyncAcrossDevice(e,t,r)}else{return moveFileSyncAcrossDevice(e,t,r)}}function moveFileSyncAcrossDevice(e,t,r){const n=64*1024;const i=p(n);const o=r?"w":"wx";const s=a.openSync(e,"r");const l=a.fstatSync(s);const d=a.openSync(t,o,l.mode);let c=0;while(c<l.size){const e=a.readSync(s,i,0,n,c);a.writeSync(d,i,0,e);c+=e}a.closeSync(s);a.closeSync(d);return a.unlinkSync(e)}function moveDirSyncAcrossDevice(e,t,r){const a={overwrite:false};if(r){o(t);tryCopySync()}else{tryCopySync()}function tryCopySync(){i(e,t,a);return o(e)}}function isSrcSubdir(e,t){try{return a.statSync(e).isDirectory()&&e!==t&&t.indexOf(e)>-1&&t.split(n.dirname(e)+n.sep)[1].split(n.sep)[0]===n.basename(e)}catch(e){return false}}e.exports={moveSync:moveSync}},6271:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(7905);const i=r(1017);const o=r(6082).copy;const s=r(5951).remove;const p=r(1470).mkdirp;const l=r(1382).pathExists;function move(e,t,r,a){if(typeof r==="function"){a=r;r={}}const o=r.overwrite||r.clobber||false;e=i.resolve(e);t=i.resolve(t);if(e===t)return n.access(e,a);n.stat(e,((r,n)=>{if(r)return a(r);if(n.isDirectory()&&isSrcSubdir(e,t)){return a(new Error(`Cannot move '${e}' to a subdirectory of itself, '${t}'.`))}p(i.dirname(t),(r=>{if(r)return a(r);return doRename(e,t,o,a)}))}))}function doRename(e,t,r,a){if(r){return s(t,(n=>{if(n)return a(n);return rename(e,t,r,a)}))}l(t,((n,i)=>{if(n)return a(n);if(i)return a(new Error("dest already exists."));return rename(e,t,r,a)}))}function rename(e,t,r,a){n.rename(e,t,(n=>{if(!n)return a();if(n.code!=="EXDEV")return a(n);return moveAcrossDevice(e,t,r,a)}))}function moveAcrossDevice(e,t,r,a){const n={overwrite:r,errorOnExist:true};o(e,t,n,(t=>{if(t)return a(t);return s(e,a)}))}function isSrcSubdir(e,t){const r=e.split(i.sep);const a=t.split(i.sep);return r.reduce(((e,t,r)=>e&&a[r]===t),true)}e.exports={move:a(move)}},6981:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(7905);const i=r(1017);const o=r(1470);const s=r(1382).pathExists;function outputFile(e,t,r,a){if(typeof r==="function"){a=r;r="utf8"}const p=i.dirname(e);s(p,((i,s)=>{if(i)return a(i);if(s)return n.writeFile(e,t,r,a);o.mkdirs(p,(i=>{if(i)return a(i);n.writeFile(e,t,r,a)}))}))}function outputFileSync(e,...t){const r=i.dirname(e);if(n.existsSync(r)){return n.writeFileSync(e,...t)}o.mkdirsSync(r);n.writeFileSync(e,...t)}e.exports={outputFile:a(outputFile),outputFileSync:outputFileSync}},1382:(e,t,r)=>{"use strict";const a=r(9676).p;const n=r(181);function pathExists(e){return n.access(e).then((()=>true)).catch((()=>false))}e.exports={pathExists:a(pathExists),pathExistsSync:n.existsSync}},5951:(e,t,r)=>{"use strict";const a=r(9676).E;const n=r(1170);e.exports={remove:a(n),removeSync:n.sync}},1170:(e,t,r)=>{"use strict";const a=r(7905);const n=r(1017);const i=r(9491);const o=process.platform==="win32";function defaults(e){const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((t=>{e[t]=e[t]||a[t];t=t+"Sync";e[t]=e[t]||a[t]}));e.maxBusyTries=e.maxBusyTries||3}function rimraf(e,t,r){let a=0;if(typeof t==="function"){r=t;t={}}i(e,"rimraf: missing path");i.strictEqual(typeof e,"string","rimraf: path should be a string");i.strictEqual(typeof r,"function","rimraf: callback function required");i(t,"rimraf: invalid options argument provided");i.strictEqual(typeof t,"object","rimraf: options should be object");defaults(t);rimraf_(e,t,(function CB(n){if(n){if((n.code==="EBUSY"||n.code==="ENOTEMPTY"||n.code==="EPERM")&&a<t.maxBusyTries){a++;const r=a*100;return setTimeout((()=>rimraf_(e,t,CB)),r)}if(n.code==="ENOENT")n=null}r(n)}))}function rimraf_(e,t,r){i(e);i(t);i(typeof r==="function");t.lstat(e,((a,n)=>{if(a&&a.code==="ENOENT"){return r(null)}if(a&&a.code==="EPERM"&&o){return fixWinEPERM(e,t,a,r)}if(n&&n.isDirectory()){return rmdir(e,t,a,r)}t.unlink(e,(a=>{if(a){if(a.code==="ENOENT"){return r(null)}if(a.code==="EPERM"){return o?fixWinEPERM(e,t,a,r):rmdir(e,t,a,r)}if(a.code==="EISDIR"){return rmdir(e,t,a,r)}}return r(a)}))}))}function fixWinEPERM(e,t,r,a){i(e);i(t);i(typeof a==="function");if(r){i(r instanceof Error)}t.chmod(e,438,(n=>{if(n){a(n.code==="ENOENT"?null:r)}else{t.stat(e,((n,i)=>{if(n){a(n.code==="ENOENT"?null:r)}else if(i.isDirectory()){rmdir(e,t,r,a)}else{t.unlink(e,a)}}))}}))}function fixWinEPERMSync(e,t,r){let a;i(e);i(t);if(r){i(r instanceof Error)}try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT"){return}else{throw r}}try{a=t.statSync(e)}catch(e){if(e.code==="ENOENT"){return}else{throw r}}if(a.isDirectory()){rmdirSync(e,t,r)}else{t.unlinkSync(e)}}function rmdir(e,t,r,a){i(e);i(t);if(r){i(r instanceof Error)}i(typeof a==="function");t.rmdir(e,(n=>{if(n&&(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")){rmkids(e,t,a)}else if(n&&n.code==="ENOTDIR"){a(r)}else{a(n)}}))}function rmkids(e,t,r){i(e);i(t);i(typeof r==="function");t.readdir(e,((a,i)=>{if(a)return r(a);let o=i.length;let s;if(o===0)return t.rmdir(e,r);i.forEach((a=>{rimraf(n.join(e,a),t,(a=>{if(s){return}if(a)return r(s=a);if(--o===0){t.rmdir(e,r)}}))}))}))}function rimrafSync(e,t){let r;t=t||{};defaults(t);i(e,"rimraf: missing path");i.strictEqual(typeof e,"string","rimraf: path should be a string");i(t,"rimraf: missing options");i.strictEqual(typeof t,"object","rimraf: options should be object");try{r=t.lstatSync(e)}catch(r){if(r.code==="ENOENT"){return}if(r.code==="EPERM"&&o){fixWinEPERMSync(e,t,r)}}try{if(r&&r.isDirectory()){rmdirSync(e,t,null)}else{t.unlinkSync(e)}}catch(r){if(r.code==="ENOENT"){return}else if(r.code==="EPERM"){return o?fixWinEPERMSync(e,t,r):rmdirSync(e,t,r)}else if(r.code!=="EISDIR"){throw r}rmdirSync(e,t,r)}}function rmdirSync(e,t,r){i(e);i(t);if(r){i(r instanceof Error)}try{t.rmdirSync(e)}catch(a){if(a.code==="ENOTDIR"){throw r}else if(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM"){rmkidsSync(e,t)}else if(a.code!=="ENOENT"){throw a}}}function rmkidsSync(e,t){i(e);i(t);t.readdirSync(e).forEach((r=>rimrafSync(n.join(e,r),t)));if(o){const r=Date.now();do{try{const r=t.rmdirSync(e,t);return r}catch(e){}}while(Date.now()-r<500)}else{const r=t.rmdirSync(e,t);return r}}e.exports=rimraf;rimraf.sync=rimrafSync},5679:e=>{"use strict";e.exports=function(e){if(typeof Buffer.allocUnsafe==="function"){try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}}return new Buffer(e)}},1767:(e,t,r)=>{"use strict";const a=r(7905);const n=r(2037);const i=r(1017);function hasMillisResSync(){let e=i.join("millis-test-sync"+Date.now().toString()+Math.random().toString().slice(2));e=i.join(n.tmpdir(),e);const t=new Date(1435410243862);a.writeFileSync(e,"https://github.com/jprichardson/node-fs-extra/pull/141");const r=a.openSync(e,"r+");a.futimesSync(r,t,t);a.closeSync(r);return a.statSync(e).mtime>1435410243e3}function hasMillisRes(e){let t=i.join("millis-test"+Date.now().toString()+Math.random().toString().slice(2));t=i.join(n.tmpdir(),t);const r=new Date(1435410243862);a.writeFile(t,"https://github.com/jprichardson/node-fs-extra/pull/141",(n=>{if(n)return e(n);a.open(t,"r+",((n,i)=>{if(n)return e(n);a.futimes(i,r,r,(r=>{if(r)return e(r);a.close(i,(r=>{if(r)return e(r);a.stat(t,((t,r)=>{if(t)return e(t);e(null,r.mtime>1435410243e3)}))}))}))}))}))}function timeRemoveMillis(e){if(typeof e==="number"){return Math.floor(e/1e3)*1e3}else if(e instanceof Date){return new Date(Math.floor(e.getTime()/1e3)*1e3)}else{throw new Error("fs-extra: timeRemoveMillis() unknown parameter type")}}function utimesMillis(e,t,r,n){a.open(e,"r+",((e,i)=>{if(e)return n(e);a.futimes(i,t,r,(e=>{a.close(i,(t=>{if(n)n(e||t)}))}))}))}function utimesMillisSync(e,t,r){const n=a.openSync(e,"r+");a.futimesSync(n,t,r);return a.closeSync(n)}e.exports={hasMillisRes:hasMillisRes,hasMillisResSync:hasMillisResSync,timeRemoveMillis:timeRemoveMillis,utimesMillis:utimesMillis,utimesMillisSync:utimesMillisSync}},4920:(e,t,r)=>{var a;try{a=r(7905)}catch(e){a=r(7147)}function readFile(e,t,r){if(r==null){r=t;t={}}if(typeof t==="string"){t={encoding:t}}t=t||{};var n=t.fs||a;var i=true;if("throws"in t){i=t.throws}n.readFile(e,t,(function(a,n){if(a)return r(a);n=stripBom(n);var o;try{o=JSON.parse(n,t?t.reviver:null)}catch(t){if(i){t.message=e+": "+t.message;return r(t)}else{return r(null,null)}}r(null,o)}))}function readFileSync(e,t){t=t||{};if(typeof t==="string"){t={encoding:t}}var r=t.fs||a;var n=true;if("throws"in t){n=t.throws}try{var i=r.readFileSync(e,t);i=stripBom(i);return JSON.parse(i,t.reviver)}catch(t){if(n){t.message=e+": "+t.message;throw t}else{return null}}}function stringify(e,t){var r;var a="\n";if(typeof t==="object"&&t!==null){if(t.spaces){r=t.spaces}if(t.EOL){a=t.EOL}}var n=JSON.stringify(e,t?t.replacer:null,r);return n.replace(/\n/g,a)+a}function writeFile(e,t,r,n){if(n==null){n=r;r={}}r=r||{};var i=r.fs||a;var o="";try{o=stringify(t,r)}catch(e){if(n)n(e,null);return}i.writeFile(e,o,r,n)}function writeFileSync(e,t,r){r=r||{};var n=r.fs||a;var i=stringify(t,r);return n.writeFileSync(e,i,r)}function stripBom(e){if(Buffer.isBuffer(e))e=e.toString("utf8");e=e.replace(/^\uFEFF/,"");return e}var n={readFile:readFile,readFileSync:readFileSync,writeFile:writeFile,writeFileSync:writeFileSync};e.exports=n},9676:(e,t)=>{"use strict";t.E=function(e){return Object.defineProperty((function(){if(typeof arguments[arguments.length-1]==="function")e.apply(this,arguments);else{return new Promise(((t,r)=>{arguments[arguments.length]=(e,a)=>{if(e)return r(e);t(a)};arguments.length++;e.apply(this,arguments)}))}}),"name",{value:e.name})};t.p=function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if(typeof t!=="function")return e.apply(this,arguments);else e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},9735:e=>{"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var r={__proto__:t(e)};else var r=Object.create(null);Object.getOwnPropertyNames(e).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}));return r}},7905:(e,t,r)=>{var a=r(7147);var n=r(670);var i=r(8612);var o=r(9735);var s=r(3837);var p;var l;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){p=Symbol.for("graceful-fs.queue");l=Symbol.for("graceful-fs.previous")}else{p="___graceful-fs.queue";l="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,p,{get:function(){return t}})}var d=noop;if(s.debuglog)d=s.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))d=function(){var e=s.format.apply(s,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!a[p]){var c=global[p]||[];publishQueue(a,c);a.close=function(e){function close(t,r){return e.call(a,t,(function(e){if(!e){resetQueue()}if(typeof r==="function")r.apply(this,arguments)}))}Object.defineProperty(close,l,{value:e});return close}(a.close);a.closeSync=function(e){function closeSync(t){e.apply(a,arguments);resetQueue()}Object.defineProperty(closeSync,l,{value:e});return closeSync}(a.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){d(a[p]);r(9491).equal(a[p].length,0)}))}}if(!global[p]){publishQueue(global,a[p])}e.exports=patch(o(a));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!a.__patched){e.exports=patch(a);a.__patched=true}function patch(e){n(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,r,a){if(typeof r==="function")a=r,r=null;return go$readFile(e,r,a);function go$readFile(e,r,a,n){return t(e,r,(function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,r,a],t,n||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var r=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,a,n){if(typeof a==="function")n=a,a=null;return go$writeFile(e,t,a,n);function go$writeFile(e,t,a,n,i){return r(e,t,a,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$writeFile,[e,t,a,n],r,i||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var a=e.appendFile;if(a)e.appendFile=appendFile;function appendFile(e,t,r,n){if(typeof r==="function")n=r,r=null;return go$appendFile(e,t,r,n);function go$appendFile(e,t,r,n,i){return a(e,t,r,(function(a){if(a&&(a.code==="EMFILE"||a.code==="ENFILE"))enqueue([go$appendFile,[e,t,r,n],a,i||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var o=e.copyFile;if(o)e.copyFile=copyFile;function copyFile(e,t,r,a){if(typeof r==="function"){a=r;r=0}return go$copyFile(e,t,r,a);function go$copyFile(e,t,r,a,n){return o(e,t,r,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$copyFile,[e,t,r,a],i,n||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var s=e.readdir;e.readdir=readdir;var p=/^v[0-5]\./;function readdir(e,t,r){if(typeof t==="function")r=t,t=null;var a=p.test(process.version)?function go$readdir(e,t,r,a){return s(e,fs$readdirCallback(e,t,r,a))}:function go$readdir(e,t,r,a){return s(e,t,fs$readdirCallback(e,t,r,a))};return a(e,t,r);function fs$readdirCallback(e,t,r,n){return function(i,o){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([a,[e,t,r],i,n||Date.now(),Date.now()]);else{if(o&&o.sort)o.sort();if(typeof r==="function")r.call(this,i,o)}}}}if(process.version.substr(0,4)==="v0.8"){var l=i(e);ReadStream=l.ReadStream;WriteStream=l.WriteStream}var d=e.ReadStream;if(d){ReadStream.prototype=Object.create(d.prototype);ReadStream.prototype.open=ReadStream$open}var c=e.WriteStream;if(c){WriteStream.prototype=Object.create(c.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var u=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return u},set:function(e){u=e},enumerable:true,configurable:true});var f=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return d.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r);e.read()}}))}function WriteStream(e,t){if(this instanceof WriteStream)return c.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,(function(t,r){if(t){e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r)}}))}function createReadStream(t,r){return new e.ReadStream(t,r)}function createWriteStream(t,r){return new e.WriteStream(t,r)}var m=e.open;e.open=open;function open(e,t,r,a){if(typeof r==="function")a=r,r=null;return go$open(e,t,r,a);function go$open(e,t,r,a,n){return m(e,t,r,(function(i,o){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$open,[e,t,r,a],i,n||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}return e}function enqueue(e){d("ENQUEUE",e[0].name,e[1]);a[p].push(e);retry()}var u;function resetQueue(){var e=Date.now();for(var t=0;t<a[p].length;++t){if(a[p][t].length>2){a[p][t][3]=e;a[p][t][4]=e}}retry()}function retry(){clearTimeout(u);u=undefined;if(a[p].length===0)return;var e=a[p].shift();var t=e[0];var r=e[1];var n=e[2];var i=e[3];var o=e[4];if(i===undefined){d("RETRY",t.name,r);t.apply(null,r)}else if(Date.now()-i>=6e4){d("TIMEOUT",t.name,r);var s=r.pop();if(typeof s==="function")s.call(null,n)}else{var l=Date.now()-o;var c=Math.max(o-i,1);var f=Math.min(c*1.2,100);if(l>=f){d("RETRY",t.name,r);t.apply(null,r.concat([i]))}else{a[p].push(e)}}if(u===undefined){u=setTimeout(retry,0)}}},8612:(e,t,r)=>{var a=r(2781).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,r){if(!(this instanceof ReadStream))return new ReadStream(t,r);a.call(this);var n=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;r=r||{};var i=Object.keys(r);for(var o=0,s=i.length;o<s;o++){var p=i[o];this[p]=r[p]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){n._read()}));return}e.open(this.path,this.flags,this.mode,(function(e,t){if(e){n.emit("error",e);n.readable=false;return}n.fd=t;n.emit("open",t);n._read()}))}function WriteStream(t,r){if(!(this instanceof WriteStream))return new WriteStream(t,r);a.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;r=r||{};var n=Object.keys(r);for(var i=0,o=n.length;i<o;i++){var s=n[i];this[s]=r[s]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},670:(e,t,r)=>{var a=r(2057);var n=process.cwd;var i=null;var o=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!i)i=n.call(process);return i};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var s=process.chdir;process.chdir=function(e){i=null;s.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,s)}e.exports=patch;function patch(e){if(a.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(e.chmod&&!e.lchmod){e.lchmod=function(e,t,r){if(r)process.nextTick(r)};e.lchmodSync=function(){}}if(e.chown&&!e.lchown){e.lchown=function(e,t,r,a){if(a)process.nextTick(a)};e.lchownSync=function(){}}if(o==="win32"){e.rename=typeof e.rename!=="function"?e.rename:function(t){function rename(r,a,n){var i=Date.now();var o=0;t(r,a,(function CB(s){if(s&&(s.code==="EACCES"||s.code==="EPERM")&&Date.now()-i<6e4){setTimeout((function(){e.stat(a,(function(e,i){if(e&&e.code==="ENOENT")t(r,a,CB);else n(s)}))}),o);if(o<100)o+=10;return}if(n)n(s)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,t);return rename}(e.rename)}e.read=typeof e.read!=="function"?e.read:function(t){function read(r,a,n,i,o,s){var p;if(s&&typeof s==="function"){var l=0;p=function(d,c,u){if(d&&d.code==="EAGAIN"&&l<10){l++;return t.call(e,r,a,n,i,o,p)}s.apply(this,arguments)}}return t.call(e,r,a,n,i,o,p)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=typeof e.readSync!=="function"?e.readSync:function(t){return function(r,a,n,i,o){var s=0;while(true){try{return t.call(e,r,a,n,i,o)}catch(e){if(e.code==="EAGAIN"&&s<10){s++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,r,n){e.open(t,a.O_WRONLY|a.O_SYMLINK,r,(function(t,a){if(t){if(n)n(t);return}e.fchmod(a,r,(function(t){e.close(a,(function(e){if(n)n(t||e)}))}))}))};e.lchmodSync=function(t,r){var n=e.openSync(t,a.O_WRONLY|a.O_SYMLINK,r);var i=true;var o;try{o=e.fchmodSync(n,r);i=false}finally{if(i){try{e.closeSync(n)}catch(e){}}else{e.closeSync(n)}}return o}}function patchLutimes(e){if(a.hasOwnProperty("O_SYMLINK")&&e.futimes){e.lutimes=function(t,r,n,i){e.open(t,a.O_SYMLINK,(function(t,a){if(t){if(i)i(t);return}e.futimes(a,r,n,(function(t){e.close(a,(function(e){if(i)i(t||e)}))}))}))};e.lutimesSync=function(t,r,n){var i=e.openSync(t,a.O_SYMLINK);var o;var s=true;try{o=e.futimesSync(i,r,n);s=false}finally{if(s){try{e.closeSync(i)}catch(e){}}else{e.closeSync(i)}}return o}}else if(e.futimes){e.lutimes=function(e,t,r,a){if(a)process.nextTick(a)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(r,a,n){return t.call(e,r,a,(function(e){if(chownErOk(e))e=null;if(n)n.apply(this,arguments)}))}}function chmodFixSync(t){if(!t)return t;return function(r,a){try{return t.call(e,r,a)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(r,a,n,i){return t.call(e,r,a,n,(function(e){if(chownErOk(e))e=null;if(i)i.apply(this,arguments)}))}}function chownFixSync(t){if(!t)return t;return function(r,a,n){try{return t.call(e,r,a,n)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(r,a,n){if(typeof a==="function"){n=a;a=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(n)n.apply(this,arguments)}return a?t.call(e,r,a,callback):t.call(e,r,callback)}}function statFixSync(t){if(!t)return t;return function(r,a){var n=a?t.call(e,r,a):t.call(e,r);if(n){if(n.uid<0)n.uid+=4294967296;if(n.gid<0)n.gid+=4294967296}return n}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},77:(e,t,r)=>{"use strict";const a=r(7147);let n;function hasDockerEnv(){try{a.statSync("/.dockerenv");return true}catch(e){return false}}function hasDockerCGroup(){try{return a.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch(e){return false}}e.exports=()=>{if(n===undefined){n=hasDockerEnv()||hasDockerCGroup()}return n}},6878:e=>{e.exports=isPromise;e.exports["default"]=isPromise;function isPromise(e){return!!e&&(typeof e==="object"||typeof e==="function")&&typeof e.then==="function"}},2048:(e,t,r)=>{"use strict";const a=r(2037);const n=r(7147);const i=r(77);const isWsl=()=>{if(process.platform!=="linux"){return false}if(a.release().toLowerCase().includes("microsoft")){if(i()){return false}return true}try{return n.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!i():false}catch(e){return false}};if(process.env.__IS_WSL_TEST__){e.exports=isWsl}else{e.exports=isWsl()}},5930:(e,t,r)=>{var a=r(7147);var n;if(process.platform==="win32"||global.TESTING_WINDOWS){n=r(3138)}else{n=r(6017)}e.exports=isexe;isexe.sync=sync;function isexe(e,t,r){if(typeof t==="function"){r=t;t={}}if(!r){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(r,a){isexe(e,t||{},(function(e,t){if(e){a(e)}else{r(t)}}))}))}n(e,t||{},(function(e,a){if(e){if(e.code==="EACCES"||t&&t.ignoreErrors){e=null;a=false}}r(e,a)}))}function sync(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code==="EACCES"){return false}else{throw e}}}},6017:(e,t,r)=>{e.exports=isexe;isexe.sync=sync;var a=r(7147);function isexe(e,t,r){a.stat(e,(function(e,a){r(e,e?false:checkStat(a,t))}))}function sync(e,t){return checkStat(a.statSync(e),t)}function checkStat(e,t){return e.isFile()&&checkMode(e,t)}function checkMode(e,t){var r=e.mode;var a=e.uid;var n=e.gid;var i=t.uid!==undefined?t.uid:process.getuid&&process.getuid();var o=t.gid!==undefined?t.gid:process.getgid&&process.getgid();var s=parseInt("100",8);var p=parseInt("010",8);var l=parseInt("001",8);var d=s|p;var c=r&l||r&p&&n===o||r&s&&a===i||r&d&&i===0;return c}},3138:(e,t,r)=>{e.exports=isexe;isexe.sync=sync;var a=r(7147);function checkPathExt(e,t){var r=t.pathExt!==undefined?t.pathExt:process.env.PATHEXT;if(!r){return true}r=r.split(";");if(r.indexOf("")!==-1){return true}for(var a=0;a<r.length;a++){var n=r[a].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n){return true}}return false}function checkStat(e,t,r){if(!e.isSymbolicLink()&&!e.isFile()){return false}return checkPathExt(t,r)}function isexe(e,t,r){a.stat(e,(function(a,n){r(a,a?false:checkStat(n,e,t))}))}function sync(e,t){return checkStat(a.statSync(e),e,t)}},3255:function(e,t,r){e=r.nmd(e);
2
2
  /**
3
3
  * @license
4
4
  * Lodash <https://lodash.com/>