@fromeroc9/testform 1.1.0-beta.2 → 1.1.0-beta.3

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- (()=>{var __webpack_modules__={6084:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const r=s(n(4699));const i=n(3840);const o=n(3032);class AstBuilder{constructor(e){this.newId=e;if(!e){throw new Error("No newId")}this.reset()}reset(){this.stack=[new r.default(o.RuleType.None)];this.comments=[]}startRule(e){this.stack.push(new r.default(e))}endRule(){const e=this.stack.pop();const t=this.transformNode(e);this.currentNode().add(e.ruleType,t)}build(e){if(e.matchedType===o.TokenType.Comment){this.comments.push({location:this.getLocation(e),text:e.matchedText})}else{this.currentNode().add(e.matchedType,e)}}getResult(){return this.currentNode().getSingle(o.RuleType.GherkinDocument)}currentNode(){return this.stack[this.stack.length-1]}getLocation(e,t){return!t?e.location:{line:e.location.line,column:t}}getTags(e){const t=[];const n=e.getSingle(o.RuleType.Tags);if(!n){return t}const s=n.getTokens(o.TokenType.TagLine);for(const e of s){for(const n of e.matchedItems){t.push({location:this.getLocation(e,n.column),name:n.text,id:this.newId()})}}return t}getCells(e){return e.matchedItems.map((t=>({location:this.getLocation(e,t.column),value:t.text})))}getDescription(e){return e.getSingle(o.RuleType.Description)||""}getSteps(e){return e.getItems(o.RuleType.Step)}getTableRows(e){const t=e.getTokens(o.TokenType.TableRow).map((e=>({id:this.newId(),location:this.getLocation(e),cells:this.getCells(e)})));this.ensureCellCount(t);return t.length===0?[]:t}ensureCellCount(e){if(e.length===0){return}const t=e[0].cells.length;e.forEach((e=>{if(e.cells.length!==t){throw i.AstBuilderException.create("inconsistent cell count within the table",e.location)}}))}transformNode(e){switch(e.ruleType){case o.RuleType.Step:{const t=e.getToken(o.TokenType.StepLine);const n=e.getSingle(o.RuleType.DataTable);const s=e.getSingle(o.RuleType.DocString);const r=this.getLocation(t);const i={id:this.newId(),location:r,keyword:t.matchedKeyword,keywordType:t.matchedKeywordType,text:t.matchedText,dataTable:n,docString:s};return i}case o.RuleType.DocString:{const t=e.getTokens(o.TokenType.DocStringSeparator)[0];const n=t.matchedText.length>0?t.matchedText:undefined;const s=e.getTokens(o.TokenType.Other);const r=s.map((e=>e.matchedText)).join("\n");const i={location:this.getLocation(t),content:r,delimiter:t.matchedKeyword};if(n){i.mediaType=n}return i}case o.RuleType.DataTable:{const t=this.getTableRows(e);const n={location:t[0].location,rows:t};return n}case o.RuleType.Background:{const t=e.getToken(o.TokenType.BackgroundLine);const n=this.getDescription(e);const s=this.getSteps(e);const r={id:this.newId(),location:this.getLocation(t),keyword:t.matchedKeyword,name:t.matchedText,description:n,steps:s};return r}case o.RuleType.ScenarioDefinition:{const t=this.getTags(e);const n=e.getSingle(o.RuleType.Scenario);const s=n.getToken(o.TokenType.ScenarioLine);const r=this.getDescription(n);const i=this.getSteps(n);const a=n.getItems(o.RuleType.ExamplesDefinition);const c={id:this.newId(),tags:t,location:this.getLocation(s),keyword:s.matchedKeyword,name:s.matchedText,description:r,steps:i,examples:a};return c}case o.RuleType.ExamplesDefinition:{const t=this.getTags(e);const n=e.getSingle(o.RuleType.Examples);const s=n.getToken(o.TokenType.ExamplesLine);const r=this.getDescription(n);const i=n.getSingle(o.RuleType.ExamplesTable);const a={id:this.newId(),tags:t,location:this.getLocation(s),keyword:s.matchedKeyword,name:s.matchedText,description:r,tableHeader:i?i[0]:undefined,tableBody:i?i.slice(1):[]};return a}case o.RuleType.ExamplesTable:{return this.getTableRows(e)}case o.RuleType.Description:{let t=e.getTokens(o.TokenType.Other);let n=t.length;while(n>0&&t[n-1].line.trimmedLineText===""){n--}t=t.slice(0,n);return t.map((e=>e.matchedText)).join("\n")}case o.RuleType.Feature:{const t=e.getSingle(o.RuleType.FeatureHeader);if(!t){return null}const n=this.getTags(t);const s=t.getToken(o.TokenType.FeatureLine);if(!s){return null}const r=[];const i=e.getSingle(o.RuleType.Background);if(i){r.push({background:i})}for(const t of e.getItems(o.RuleType.ScenarioDefinition)){r.push({scenario:t})}for(const t of e.getItems(o.RuleType.Rule)){r.push({rule:t})}const a=this.getDescription(t);const c=s.matchedGherkinDialect;const l={tags:n,location:this.getLocation(s),language:c,keyword:s.matchedKeyword,name:s.matchedText,description:a,children:r};return l}case o.RuleType.Rule:{const t=e.getSingle(o.RuleType.RuleHeader);if(!t){return null}const n=t.getToken(o.TokenType.RuleLine);if(!n){return null}const s=this.getTags(t);const r=[];const i=e.getSingle(o.RuleType.Background);if(i){r.push({background:i})}for(const t of e.getItems(o.RuleType.ScenarioDefinition)){r.push({scenario:t})}const a=this.getDescription(t);const c={id:this.newId(),location:this.getLocation(n),keyword:n.matchedKeyword,name:n.matchedText,description:a,children:r,tags:s};return c}case o.RuleType.GherkinDocument:{const t=e.getSingle(o.RuleType.Feature);const n={feature:t,comments:this.comments};return n}default:return e}}}t["default"]=AstBuilder},4699:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});class AstNode{constructor(e){this.ruleType=e;this.subItems=new Map}add(e,t){let n=this.subItems.get(e);if(n===undefined){n=[];this.subItems.set(e,n)}n.push(t)}getSingle(e){return(this.subItems.get(e)||[])[0]}getItems(e){return this.subItems.get(e)||[]}getToken(e){return(this.subItems.get(e)||[])[0]}getTokens(e){return this.subItems.get(e)||[]}}t["default"]=AstNode},3840:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.NoSuchLanguageException=t.AstBuilderException=t.CompositeParserException=t.ParserException=t.GherkinException=void 0;class GherkinException extends Error{constructor(e){super(e);const t=new.target.prototype;if(Object.setPrototypeOf){Object.setPrototypeOf(this,t)}else{this.__proto__=t}}static _create(e,t){const n=t!=null?t.column||0:-1;const s=t!=null?t.line||0:-1;const r=`(${s}:${n}): ${e}`;const i=new this(r);i.location=t;return i}}t.GherkinException=GherkinException;class ParserException extends GherkinException{static create(e,t,n){const s=new ParserException(`(${t}:${n}): ${e}`);s.location={line:t,column:n};return s}}t.ParserException=ParserException;class CompositeParserException extends GherkinException{static create(e){const t=`Parser errors:\n${e.map((e=>e.message)).join("\n")}`;const n=new CompositeParserException(t);n.errors=e;return n}}t.CompositeParserException=CompositeParserException;class AstBuilderException extends GherkinException{static create(e,t){return AstBuilderException._create(e,t)}}t.AstBuilderException=AstBuilderException;class NoSuchLanguageException extends GherkinException{static create(e,t){const n=`Language not supported: ${e}`;return NoSuchLanguageException._create(n,t)}}t.NoSuchLanguageException=NoSuchLanguageException},1112:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=i(n(6088));const c=n(434);const l=o(n(2759));const u=n(3840);const d=o(n(6097));const f=n(3032);const p=d.default;const h=/^\s*#\s*language\s*:\s*([a-zA-Z\-_]+)\s*$/;function addKeywordTypeMappings(e,t,n){for(const s of t){if(!(s in e)){e[s]=[]}e[s].push(n)}}class GherkinClassicTokenMatcher{constructor(e="en"){this.defaultDialectName=e;this.reset()}changeDialect(e,t){const n=p[e];if(!n){throw u.NoSuchLanguageException.create(e,t)}this.dialectName=e;this.dialect=n;this.initializeKeywordTypes();this.initializeSortedStepKeywords()}reset(){if(this.dialectName!==this.defaultDialectName){this.changeDialect(this.defaultDialectName)}this.activeDocStringSeparator=null;this.indentToRemove=0}initializeKeywordTypes(){this.keywordTypesMap={};addKeywordTypeMappings(this.keywordTypesMap,this.dialect.given,a.StepKeywordType.CONTEXT);addKeywordTypeMappings(this.keywordTypesMap,this.dialect.when,a.StepKeywordType.ACTION);addKeywordTypeMappings(this.keywordTypesMap,this.dialect.then,a.StepKeywordType.OUTCOME);addKeywordTypeMappings(this.keywordTypesMap,[].concat(this.dialect.and).concat(this.dialect.but),a.StepKeywordType.CONJUNCTION)}initializeSortedStepKeywords(){this.sortedStepKeywords=[].concat(this.dialect.given).concat(this.dialect.when).concat(this.dialect.then).concat(this.dialect.and).concat(this.dialect.but).sort(c.compareStepKeywords)}match_TagLine(e){if(e.line.startsWith("@")){this.setTokenMatched(e,f.TokenType.TagLine,null,null,null,null,this.getTags(e.line));return true}return false}match_FeatureLine(e){return this.matchTitleLine(e,f.TokenType.FeatureLine,this.dialect.feature)}match_ScenarioLine(e){return this.matchTitleLine(e,f.TokenType.ScenarioLine,this.dialect.scenario)||this.matchTitleLine(e,f.TokenType.ScenarioLine,this.dialect.scenarioOutline)}match_BackgroundLine(e){return this.matchTitleLine(e,f.TokenType.BackgroundLine,this.dialect.background)}match_ExamplesLine(e){return this.matchTitleLine(e,f.TokenType.ExamplesLine,this.dialect.examples)}match_RuleLine(e){return this.matchTitleLine(e,f.TokenType.RuleLine,this.dialect.rule)}match_TableRow(e){if(e.line.startsWith("|")){this.setTokenMatched(e,f.TokenType.TableRow,null,null,null,null,e.line.getTableCells());return true}return false}match_Empty(e){if(e.line.isEmpty){this.setTokenMatched(e,f.TokenType.Empty,null,null,0);return true}return false}match_Comment(e){if(e.line.startsWith("#")){const t=e.line.getLineText(0);this.setTokenMatched(e,f.TokenType.Comment,t,null,0);return true}return false}match_Language(e){const t=e.line.trimmedLineText.match(h);if(t){const n=t[1];this.setTokenMatched(e,f.TokenType.Language,n);this.changeDialect(n,e.location);return true}return false}match_DocStringSeparator(e){return this.activeDocStringSeparator==null?this._match_DocStringSeparator(e,'"""',true)||this._match_DocStringSeparator(e,"```",true):this._match_DocStringSeparator(e,this.activeDocStringSeparator,false)}_match_DocStringSeparator(e,t,n){if(e.line.startsWith(t)){let s=null;if(n){s=e.line.getRestTrimmed(t.length);this.activeDocStringSeparator=t;this.indentToRemove=e.line.indent}else{this.activeDocStringSeparator=null;this.indentToRemove=0}this.setTokenMatched(e,f.TokenType.DocStringSeparator,s,t);return true}return false}match_EOF(e){if(e.isEof){this.setTokenMatched(e,f.TokenType.EOF);return true}return false}match_StepLine(e){for(const t of this.sortedStepKeywords){if(e.line.startsWith(t)){const n=e.line.getRestTrimmed(t.length);const s=this.keywordTypesMap[t];let r=s[0];if(s.length>1){r=a.StepKeywordType.UNKNOWN}this.setTokenMatched(e,f.TokenType.StepLine,n,t,null,r);return true}}return false}match_Other(e){const t=e.line.getLineText(this.indentToRemove);this.setTokenMatched(e,f.TokenType.Other,this.unescapeDocString(t),null,0);return true}getTags(e){const t=e.trimmedLineText.split(/\s#/g,2)[0];let n=e.indent+1;const s=t.split("@");const r=[];for(let t=0;t<s.length;t++){const i=s[t].trimRight();if(i.length===0){continue}if(!i.match(/^\S+$/)){throw u.ParserException.create("A tag may not contain whitespace",e.lineNumber,n)}const o={column:n,text:`@${i}`};r.push(o);n+=(0,l.default)(s[t])+1}return r}matchTitleLine(e,t,n){for(const s of n){if(e.line.startsWithTitleKeyword(s)){const n=e.line.getRestTrimmed(s.length+":".length);this.setTokenMatched(e,t,n,s);return true}}return false}setTokenMatched(e,t,n,s,r,i,o){e.matchedType=t;e.matchedText=n;e.matchedKeyword=s;e.matchedKeywordType=i;e.matchedIndent=typeof r==="number"?r:e.line==null?0:e.line.indent;e.matchedItems=o||[];e.location.column=e.matchedIndent+1;e.matchedGherkinDialect=this.dialectName}unescapeDocString(e){if(this.activeDocStringSeparator==='"""'){return e.replace('\\"\\"\\"','"""')}if(this.activeDocStringSeparator==="```"){return e.replace("\\`\\`\\`","```")}return e}}t["default"]=GherkinClassicTokenMatcher},5422:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=i(n(6088));const c=n(434);const l=n(3840);const u=o(n(6097));const d=n(3032);const f=u.default;const p=/^(```[`]*)(.*)/;function addKeywordTypeMappings(e,t,n){for(const s of t){if(!(s in e)){e[s]=[]}e[s].push(n)}}class GherkinInMarkdownTokenMatcher{constructor(e="en"){this.defaultDialectName=e;this.dialect=f[e];this.nonStarStepKeywords=[].concat(this.dialect.given).concat(this.dialect.when).concat(this.dialect.then).concat(this.dialect.and).concat(this.dialect.but).filter(((e,t,n)=>e!=="* "&&n.indexOf(e)===t)).sort(c.compareStepKeywords);this.initializeKeywordTypes();this.stepRegexp=new RegExp(`${h.BULLET}(${this.nonStarStepKeywords.map(escapeRegExp).join("|")})`);const t=[].concat(this.dialect.feature).concat(this.dialect.background).concat(this.dialect.rule).concat(this.dialect.scenarioOutline).concat(this.dialect.scenario).concat(this.dialect.examples).filter(((e,t,n)=>n.indexOf(e)===t));this.headerRegexp=new RegExp(`${h.HEADER}(${t.map(escapeRegExp).join("|")})`);this.reset()}changeDialect(e,t){const n=f[e];if(!n){throw l.NoSuchLanguageException.create(e,t)}this.dialectName=e;this.dialect=n;this.initializeKeywordTypes()}initializeKeywordTypes(){this.keywordTypesMap={};addKeywordTypeMappings(this.keywordTypesMap,this.dialect.given,a.StepKeywordType.CONTEXT);addKeywordTypeMappings(this.keywordTypesMap,this.dialect.when,a.StepKeywordType.ACTION);addKeywordTypeMappings(this.keywordTypesMap,this.dialect.then,a.StepKeywordType.OUTCOME);addKeywordTypeMappings(this.keywordTypesMap,[].concat(this.dialect.and).concat(this.dialect.but),a.StepKeywordType.CONJUNCTION)}match_Language(e){if(!e)throw new Error("no token");return false}match_Empty(e){let t=false;if(e.line.isEmpty){t=true}if(!this.match_TagLine(e)&&!this.match_FeatureLine(e)&&!this.match_ScenarioLine(e)&&!this.match_BackgroundLine(e)&&!this.match_ExamplesLine(e)&&!this.match_RuleLine(e)&&!this.match_TableRow(e)&&!this.match_Comment(e)&&!this.match_Language(e)&&!this.match_DocStringSeparator(e)&&!this.match_EOF(e)&&!this.match_StepLine(e)){t=true}if(t){e.matchedType=d.TokenType.Empty}return this.setTokenMatched(e,null,t)}match_Other(e){const t=e.line.getLineText(this.indentToRemove);e.matchedType=d.TokenType.Other;e.matchedText=t;e.matchedIndent=0;return this.setTokenMatched(e,null,true)}match_Comment(e){let t=false;if(e.line.startsWith("|")){const n=e.line.getTableCells();if(this.isGfmTableSeparator(n))t=true}return this.setTokenMatched(e,null,t)}match_DocStringSeparator(e){const t=e.line.trimmedLineText.match(this.activeDocStringSeparator);const[,n,s]=t||[];let r=false;if(n){if(this.activeDocStringSeparator===p){this.activeDocStringSeparator=new RegExp(`^(${n})$`);this.indentToRemove=e.line.indent}else{this.activeDocStringSeparator=p}e.matchedKeyword=n;e.matchedType=d.TokenType.DocStringSeparator;e.matchedText=s||"";r=true}return this.setTokenMatched(e,null,r)}match_EOF(e){let t=false;if(e.isEof){e.matchedType=d.TokenType.EOF;t=true}return this.setTokenMatched(e,null,t)}match_FeatureLine(e){if(this.matchedFeatureLine){return this.setTokenMatched(e,null,false)}let t=this.matchTitleLine(h.HEADER,this.dialect.feature,":",e,d.TokenType.FeatureLine);if(!t){e.matchedType=d.TokenType.FeatureLine;e.matchedText=e.line.trimmedLineText;t=this.setTokenMatched(e,null,true)}this.matchedFeatureLine=t;return t}match_BackgroundLine(e){return this.matchTitleLine(h.HEADER,this.dialect.background,":",e,d.TokenType.BackgroundLine)}match_RuleLine(e){return this.matchTitleLine(h.HEADER,this.dialect.rule,":",e,d.TokenType.RuleLine)}match_ScenarioLine(e){return this.matchTitleLine(h.HEADER,this.dialect.scenario,":",e,d.TokenType.ScenarioLine)||this.matchTitleLine(h.HEADER,this.dialect.scenarioOutline,":",e,d.TokenType.ScenarioLine)}match_ExamplesLine(e){return this.matchTitleLine(h.HEADER,this.dialect.examples,":",e,d.TokenType.ExamplesLine)}match_StepLine(e){return this.matchTitleLine(h.BULLET,this.nonStarStepKeywords,"",e,d.TokenType.StepLine)}matchTitleLine(e,t,n,s,r){const i=new RegExp(`${e}(${t.map(escapeRegExp).join("|")})${n}(.*)`);const o=s.line.match(i);let c=s.line.indent;let l=false;if(o){s.matchedType=r;s.matchedKeyword=o[2];if(o[2]in this.keywordTypesMap){if(this.keywordTypesMap[o[2]].length>1){s.matchedKeywordType=a.StepKeywordType.UNKNOWN}else{s.matchedKeywordType=this.keywordTypesMap[o[2]][0]}}s.matchedText=o[3].trim();c+=o[1].length;l=true}return this.setTokenMatched(s,c,l)}setTokenMatched(e,t,n){e.matchedGherkinDialect=this.dialectName;e.matchedIndent=t!==null?t:e.line==null?0:e.line.indent;e.location.column=e.matchedIndent+1;return n}match_TableRow(e){if(e.line.lineText.match(/^\s\s\s?\s?\s?\|/)){const t=e.line.getTableCells();if(this.isGfmTableSeparator(t))return false;e.matchedKeyword="|";e.matchedType=d.TokenType.TableRow;e.matchedItems=t;return true}return false}isGfmTableSeparator(e){const t=e.map((e=>e.text)).filter((e=>e.match(/^:?-+:?$/)));return t.length>0}match_TagLine(e){const t=[];let n;const s=/`(@[^`]+)`/g;do{n=s.exec(e.line.trimmedLineText);if(n){t.push({column:e.line.indent+n.index+2,text:n[1]})}}while(n);if(t.length===0)return false;e.matchedType=d.TokenType.TagLine;e.matchedItems=t;return true}reset(){if(this.dialectName!==this.defaultDialectName){this.changeDialect(this.defaultDialectName)}this.activeDocStringSeparator=p}}t["default"]=GherkinInMarkdownTokenMatcher;var h;(function(e){e["BULLET"]="^(\\s*[*+-]\\s*)";e["HEADER"]="^(#{1,6}\\s)"})(h||(h={}));function escapeRegExp(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},9855:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const r=s(n(2759));class GherkinLine{constructor(e,t){this.lineText=e;this.lineNumber=t;this.trimmedLineText=e.replace(/^\s+/g,"");this.isEmpty=this.trimmedLineText.length===0;this.indent=(0,r.default)(e)-(0,r.default)(this.trimmedLineText)}startsWith(e){return this.trimmedLineText.indexOf(e)===0}startsWithTitleKeyword(e){return this.startsWith(`${e}:`)}match(e){return this.trimmedLineText.match(e)}getLineText(e){if(e<0||e>this.indent){return this.trimmedLineText}else{return this.lineText.substring(e)}}getRestTrimmed(e){return this.trimmedLineText.substring(e).trim()}getTableCells(){const e=[];let t=0;let n=t+1;let s="";let r=true;while(t<this.trimmedLineText.length){let i=this.trimmedLineText[t];t++;if(i==="|"){if(r){r=false}else{const t=s.replace(/^[ \t\v\f\r\u0085\u00A0]*/g,"");const r=t.replace(/[ \t\v\f\r\u0085\u00A0]*$/g,"");const i=s.length-t.length;const o={column:this.indent+n+i,text:r};e.push(o)}s="";n=t+1}else if(i==="\\"){i=this.trimmedLineText[t];t+=1;if(i==="n"){s+="\n"}else{if(i!=="|"&&i!=="\\"){s+="\\"}s+=i}}else{s+=i}}return e}}t["default"]=GherkinLine;e.exports=GherkinLine},3032:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.RuleType=t.TokenType=t.Token=void 0;const r=n(3840);const i=n(4272);const o=s(n(282));const a=s(n(9855));class Token{constructor(e,t){this.line=e;this.location=t;this.isEof=!e}getTokenValue(){return this.isEof?"EOF":this.line.getLineText(-1)}}t.Token=Token;var c;(function(e){e[e["None"]=0]="None";e[e["EOF"]=1]="EOF";e[e["Empty"]=2]="Empty";e[e["Comment"]=3]="Comment";e[e["TagLine"]=4]="TagLine";e[e["FeatureLine"]=5]="FeatureLine";e[e["RuleLine"]=6]="RuleLine";e[e["BackgroundLine"]=7]="BackgroundLine";e[e["ScenarioLine"]=8]="ScenarioLine";e[e["ExamplesLine"]=9]="ExamplesLine";e[e["StepLine"]=10]="StepLine";e[e["DocStringSeparator"]=11]="DocStringSeparator";e[e["TableRow"]=12]="TableRow";e[e["Language"]=13]="Language";e[e["Other"]=14]="Other"})(c||(t.TokenType=c={}));var l;(function(e){e[e["None"]=0]="None";e[e["_EOF"]=1]="_EOF";e[e["_Empty"]=2]="_Empty";e[e["_Comment"]=3]="_Comment";e[e["_TagLine"]=4]="_TagLine";e[e["_FeatureLine"]=5]="_FeatureLine";e[e["_RuleLine"]=6]="_RuleLine";e[e["_BackgroundLine"]=7]="_BackgroundLine";e[e["_ScenarioLine"]=8]="_ScenarioLine";e[e["_ExamplesLine"]=9]="_ExamplesLine";e[e["_StepLine"]=10]="_StepLine";e[e["_DocStringSeparator"]=11]="_DocStringSeparator";e[e["_TableRow"]=12]="_TableRow";e[e["_Language"]=13]="_Language";e[e["_Other"]=14]="_Other";e[e["GherkinDocument"]=15]="GherkinDocument";e[e["Feature"]=16]="Feature";e[e["FeatureHeader"]=17]="FeatureHeader";e[e["Rule"]=18]="Rule";e[e["RuleHeader"]=19]="RuleHeader";e[e["Background"]=20]="Background";e[e["ScenarioDefinition"]=21]="ScenarioDefinition";e[e["Scenario"]=22]="Scenario";e[e["ExamplesDefinition"]=23]="ExamplesDefinition";e[e["Examples"]=24]="Examples";e[e["ExamplesTable"]=25]="ExamplesTable";e[e["Step"]=26]="Step";e[e["StepArg"]=27]="StepArg";e[e["DataTable"]=28]="DataTable";e[e["DocString"]=29]="DocString";e[e["Tags"]=30]="Tags";e[e["DescriptionHelper"]=31]="DescriptionHelper";e[e["Description"]=32]="Description"})(l||(t.RuleType=l={}));class Parser{constructor(e,t){this.builder=e;this.tokenMatcher=t;this.stopAtFirstError=false}parse(e){const t=new o.default(e,((e,t)=>{const n=e===null||e===undefined?null:new a.default(e,t.line);return new Token(n,t)}));this.builder.reset();this.tokenMatcher.reset();this.context={tokenScanner:t,tokenQueue:[],errors:[]};this.startRule(this.context,l.GherkinDocument);let n=0;let s=null;while(true){s=this.readToken(this.context);n=this.matchToken(n,s,this.context);if(s.isEof)break}this.endRule(this.context);if(this.context.errors.length>0){throw r.CompositeParserException.create(this.context.errors)}return this.getResult()}addError(e,t){if(!e.errors.map((e=>e.message)).includes(t.message)){e.errors.push(t);if(e.errors.length>10)throw r.CompositeParserException.create(e.errors)}}startRule(e,t){this.handleAstError(e,(()=>this.builder.startRule(t)))}endRule(e){this.handleAstError(e,(()=>this.builder.endRule()))}build(e,t){this.handleAstError(e,(()=>this.builder.build(t)))}getResult(){return this.builder.getResult()}handleAstError(e,t){this.handleExternalError(e,true,t)}handleExternalError(e,t,n){if(this.stopAtFirstError)return n();try{return n()}catch(t){if(t instanceof r.CompositeParserException){t.errors.forEach((t=>this.addError(e,t)))}else if(t instanceof r.ParserException||t instanceof r.AstBuilderException||t instanceof i.UnexpectedTokenException||t instanceof r.NoSuchLanguageException){this.addError(e,t)}else{throw t}}return t}readToken(e){return e.tokenQueue.length>0?e.tokenQueue.shift():e.tokenScanner.read()}matchToken(e,t,n){switch(e){case 0:return this.matchTokenAt_0(t,n);case 1:return this.matchTokenAt_1(t,n);case 2:return this.matchTokenAt_2(t,n);case 3:return this.matchTokenAt_3(t,n);case 4:return this.matchTokenAt_4(t,n);case 5:return this.matchTokenAt_5(t,n);case 6:return this.matchTokenAt_6(t,n);case 7:return this.matchTokenAt_7(t,n);case 8:return this.matchTokenAt_8(t,n);case 9:return this.matchTokenAt_9(t,n);case 10:return this.matchTokenAt_10(t,n);case 11:return this.matchTokenAt_11(t,n);case 12:return this.matchTokenAt_12(t,n);case 13:return this.matchTokenAt_13(t,n);case 14:return this.matchTokenAt_14(t,n);case 15:return this.matchTokenAt_15(t,n);case 16:return this.matchTokenAt_16(t,n);case 17:return this.matchTokenAt_17(t,n);case 18:return this.matchTokenAt_18(t,n);case 19:return this.matchTokenAt_19(t,n);case 20:return this.matchTokenAt_20(t,n);case 21:return this.matchTokenAt_21(t,n);case 22:return this.matchTokenAt_22(t,n);case 23:return this.matchTokenAt_23(t,n);case 24:return this.matchTokenAt_24(t,n);case 25:return this.matchTokenAt_25(t,n);case 26:return this.matchTokenAt_26(t,n);case 27:return this.matchTokenAt_27(t,n);case 28:return this.matchTokenAt_28(t,n);case 29:return this.matchTokenAt_29(t,n);case 30:return this.matchTokenAt_30(t,n);case 31:return this.matchTokenAt_31(t,n);case 32:return this.matchTokenAt_32(t,n);case 33:return this.matchTokenAt_33(t,n);case 35:return this.matchTokenAt_35(t,n);case 36:return this.matchTokenAt_36(t,n);case 37:return this.matchTokenAt_37(t,n);case 38:return this.matchTokenAt_38(t,n);case 39:return this.matchTokenAt_39(t,n);case 40:return this.matchTokenAt_40(t,n);case 41:return this.matchTokenAt_41(t,n);case 42:return this.matchTokenAt_42(t,n);default:throw new Error("Unknown state: "+e)}}matchTokenAt_0(e,t){if(this.match_EOF(t,e)){this.build(t,e);return 34}if(this.match_Language(t,e)){this.startRule(t,l.Feature);this.startRule(t,l.FeatureHeader);this.build(t,e);return 1}if(this.match_TagLine(t,e)){this.startRule(t,l.Feature);this.startRule(t,l.FeatureHeader);this.startRule(t,l.Tags);this.build(t,e);return 2}if(this.match_FeatureLine(t,e)){this.startRule(t,l.Feature);this.startRule(t,l.FeatureHeader);this.build(t,e);return 3}if(this.match_Comment(t,e)){this.build(t,e);return 0}if(this.match_Empty(t,e)){this.build(t,e);return 0}const n=["#EOF","#Language","#TagLine","#FeatureLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 0}matchTokenAt_1(e,t){if(this.match_TagLine(t,e)){this.startRule(t,l.Tags);this.build(t,e);return 2}if(this.match_FeatureLine(t,e)){this.build(t,e);return 3}if(this.match_Comment(t,e)){this.build(t,e);return 1}if(this.match_Empty(t,e)){this.build(t,e);return 1}const n=["#TagLine","#FeatureLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 1}matchTokenAt_2(e,t){if(this.match_TagLine(t,e)){this.build(t,e);return 2}if(this.match_FeatureLine(t,e)){this.endRule(t);this.build(t,e);return 3}if(this.match_Comment(t,e)){this.build(t,e);return 2}if(this.match_Empty(t,e)){this.build(t,e);return 2}const n=["#TagLine","#FeatureLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 2}matchTokenAt_3(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 3}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 4}if(this.match_BackgroundLine(t,e)){this.endRule(t);this.startRule(t,l.Background);this.build(t,e);return 5}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 4}const n=["#EOF","#Empty","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 3}matchTokenAt_4(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 4}if(this.match_BackgroundLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Background);this.build(t,e);return 5}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 4}const n=["#EOF","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 4}matchTokenAt_5(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 5}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 6}if(this.match_StepLine(t,e)){this.startRule(t,l.Step);this.build(t,e);return 7}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 6}const n=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 5}matchTokenAt_6(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 6}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 7}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 6}const n=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 6}matchTokenAt_7(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.startRule(t,l.DataTable);this.build(t,e);return 8}if(this.match_DocStringSeparator(t,e)){this.startRule(t,l.DocString);this.build(t,e);return 41}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 7}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 7}if(this.match_Empty(t,e)){this.build(t,e);return 7}const n=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 7}matchTokenAt_8(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.build(t,e);return 8}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 7}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 8}if(this.match_Empty(t,e)){this.build(t,e);return 8}const n=["#EOF","#TableRow","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 8}matchTokenAt_9(e,t){if(this.match_TagLine(t,e)){this.build(t,e);return 9}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_Comment(t,e)){this.build(t,e);return 9}if(this.match_Empty(t,e)){this.build(t,e);return 9}const n=["#TagLine","#ScenarioLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 9}matchTokenAt_10(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 10}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 11}if(this.match_StepLine(t,e)){this.startRule(t,l.Step);this.build(t,e);return 12}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 11}const n=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 10}matchTokenAt_11(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 11}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 12}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 11}const n=["#EOF","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 11}matchTokenAt_12(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.startRule(t,l.DataTable);this.build(t,e);return 13}if(this.match_DocStringSeparator(t,e)){this.startRule(t,l.DocString);this.build(t,e);return 39}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 12}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 12}if(this.match_Empty(t,e)){this.build(t,e);return 12}const n=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 12}matchTokenAt_13(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.build(t,e);return 13}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 12}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 13}if(this.match_Empty(t,e)){this.build(t,e);return 13}const n=["#EOF","#TableRow","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 13}matchTokenAt_14(e,t){if(this.match_TagLine(t,e)){this.build(t,e);return 14}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_Comment(t,e)){this.build(t,e);return 14}if(this.match_Empty(t,e)){this.build(t,e);return 14}const n=["#TagLine","#ExamplesLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 14}matchTokenAt_15(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 15}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 16}if(this.match_TableRow(t,e)){this.startRule(t,l.ExamplesTable);this.build(t,e);return 17}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 16}const n=["#EOF","#Empty","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 15}matchTokenAt_16(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 16}if(this.match_TableRow(t,e)){this.endRule(t);this.startRule(t,l.ExamplesTable);this.build(t,e);return 17}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 16}const n=["#EOF","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 16}matchTokenAt_17(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.build(t,e);return 17}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 17}if(this.match_Empty(t,e)){this.build(t,e);return 17}const n=["#EOF","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 17}matchTokenAt_18(e,t){if(this.match_TagLine(t,e)){this.build(t,e);return 18}if(this.match_RuleLine(t,e)){this.endRule(t);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 18}if(this.match_Empty(t,e)){this.build(t,e);return 18}const n=["#TagLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 18}matchTokenAt_19(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 19}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 20}if(this.match_BackgroundLine(t,e)){this.endRule(t);this.startRule(t,l.Background);this.build(t,e);return 21}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 20}const n=["#EOF","#Empty","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 19}matchTokenAt_20(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 20}if(this.match_BackgroundLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Background);this.build(t,e);return 21}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 20}const n=["#EOF","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 20}matchTokenAt_21(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 21}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 22}if(this.match_StepLine(t,e)){this.startRule(t,l.Step);this.build(t,e);return 23}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 22}const n=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 21}matchTokenAt_22(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 22}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 23}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 22}const n=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 22}matchTokenAt_23(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.startRule(t,l.DataTable);this.build(t,e);return 24}if(this.match_DocStringSeparator(t,e)){this.startRule(t,l.DocString);this.build(t,e);return 37}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 23}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 23}if(this.match_Empty(t,e)){this.build(t,e);return 23}const n=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 23}matchTokenAt_24(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.build(t,e);return 24}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 23}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 24}if(this.match_Empty(t,e)){this.build(t,e);return 24}const n=["#EOF","#TableRow","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 24}matchTokenAt_25(e,t){if(this.match_TagLine(t,e)){this.build(t,e);return 25}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_Comment(t,e)){this.build(t,e);return 25}if(this.match_Empty(t,e)){this.build(t,e);return 25}const n=["#TagLine","#ScenarioLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 25}matchTokenAt_26(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 26}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 27}if(this.match_StepLine(t,e)){this.startRule(t,l.Step);this.build(t,e);return 28}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 27}const n=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 26}matchTokenAt_27(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 27}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 28}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 27}const n=["#EOF","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 27}matchTokenAt_28(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.startRule(t,l.DataTable);this.build(t,e);return 29}if(this.match_DocStringSeparator(t,e)){this.startRule(t,l.DocString);this.build(t,e);return 35}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 28}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 28}if(this.match_Empty(t,e)){this.build(t,e);return 28}const n=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 28}matchTokenAt_29(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.build(t,e);return 29}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 28}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 29}if(this.match_Empty(t,e)){this.build(t,e);return 29}const n=["#EOF","#TableRow","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 29}matchTokenAt_30(e,t){if(this.match_TagLine(t,e)){this.build(t,e);return 30}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_Comment(t,e)){this.build(t,e);return 30}if(this.match_Empty(t,e)){this.build(t,e);return 30}const n=["#TagLine","#ExamplesLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 30}matchTokenAt_31(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 31}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 32}if(this.match_TableRow(t,e)){this.startRule(t,l.ExamplesTable);this.build(t,e);return 33}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 32}const n=["#EOF","#Empty","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 31}matchTokenAt_32(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 32}if(this.match_TableRow(t,e)){this.endRule(t);this.startRule(t,l.ExamplesTable);this.build(t,e);return 33}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 32}const n=["#EOF","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 32}matchTokenAt_33(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.build(t,e);return 33}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 33}if(this.match_Empty(t,e)){this.build(t,e);return 33}const n=["#EOF","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 33}matchTokenAt_35(e,t){if(this.match_DocStringSeparator(t,e)){this.build(t,e);return 36}if(this.match_Other(t,e)){this.build(t,e);return 35}const n=["#DocStringSeparator","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 35}matchTokenAt_36(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 28}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 36}if(this.match_Empty(t,e)){this.build(t,e);return 36}const n=["#EOF","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 36}matchTokenAt_37(e,t){if(this.match_DocStringSeparator(t,e)){this.build(t,e);return 38}if(this.match_Other(t,e)){this.build(t,e);return 37}const n=["#DocStringSeparator","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 37}matchTokenAt_38(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 23}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 38}if(this.match_Empty(t,e)){this.build(t,e);return 38}const n=["#EOF","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 38}matchTokenAt_39(e,t){if(this.match_DocStringSeparator(t,e)){this.build(t,e);return 40}if(this.match_Other(t,e)){this.build(t,e);return 39}const n=["#DocStringSeparator","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 39}matchTokenAt_40(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 12}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 40}if(this.match_Empty(t,e)){this.build(t,e);return 40}const n=["#EOF","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 40}matchTokenAt_41(e,t){if(this.match_DocStringSeparator(t,e)){this.build(t,e);return 42}if(this.match_Other(t,e)){this.build(t,e);return 41}const n=["#DocStringSeparator","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 41}matchTokenAt_42(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 7}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 42}if(this.match_Empty(t,e)){this.build(t,e);return 42}const n=["#EOF","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 42}match_EOF(e,t){return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_EOF(t)))}match_Empty(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_Empty(t)))}match_Comment(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_Comment(t)))}match_TagLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_TagLine(t)))}match_FeatureLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_FeatureLine(t)))}match_RuleLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_RuleLine(t)))}match_BackgroundLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_BackgroundLine(t)))}match_ScenarioLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_ScenarioLine(t)))}match_ExamplesLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_ExamplesLine(t)))}match_StepLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_StepLine(t)))}match_DocStringSeparator(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_DocStringSeparator(t)))}match_TableRow(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_TableRow(t)))}match_Language(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_Language(t)))}match_Other(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_Other(t)))}lookahead_0(e,t){let n;const s=[];let r=false;do{n=this.readToken(this.context);s.push(n);if(false||this.match_ScenarioLine(e,n)){r=true;break}}while(false||this.match_Empty(e,n)||this.match_Comment(e,n)||this.match_TagLine(e,n));e.tokenQueue=e.tokenQueue.concat(s);return r}lookahead_1(e,t){let n;const s=[];let r=false;do{n=this.readToken(this.context);s.push(n);if(false||this.match_ExamplesLine(e,n)){r=true;break}}while(false||this.match_Empty(e,n)||this.match_Comment(e,n)||this.match_TagLine(e,n));e.tokenQueue=e.tokenQueue.concat(s);return r}}t["default"]=Parser},4272:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.UnexpectedEOFException=t.UnexpectedTokenException=void 0;const s=n(3840);class UnexpectedTokenException extends s.GherkinException{static create(e,t){const n=`expected: ${t.join(", ")}, got '${e.getTokenValue().trim()}'`;const s=tokenLocation(e);return UnexpectedTokenException._create(n,s)}}t.UnexpectedTokenException=UnexpectedTokenException;class UnexpectedEOFException extends s.GherkinException{static create(e,t){const n=`unexpected end of file, expected: ${t.join(", ")}`;const s=tokenLocation(e);return UnexpectedEOFException._create(n,s)}}t.UnexpectedEOFException=UnexpectedEOFException;function tokenLocation(e){var t;return((t=e.location)===null||t===void 0?void 0:t.line)&&e.line&&e.line.indent!==undefined?{line:e.location.line,column:e.line.indent+1}:e.location}},282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});class TokenScanner{constructor(e,t){this.makeToken=t;this.lineNumber=0;this.lines=e.split(/\r?\n/);if(this.lines.length>0&&this.lines[this.lines.length-1].trim()===""){this.lines.pop()}}read(){const e=this.lines[this.lineNumber++];const t={line:this.lineNumber};return this.makeToken(e,t)}}t["default"]=TokenScanner},434:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.compareStepKeywords=compareStepKeywords;function compareStepKeywords(e,t){return t.length-e.length}},2759:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=countSymbols;const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function countSymbols(e){return e.replace(n,"_").length}},6344:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t["default"]=generateMessages;const a=i(n(6088));const c=o(n(6084));const l=o(n(1112));const u=o(n(5422));const d=o(n(5140));const f=o(n(3032));const p=o(n(850));function generateMessages(e,t,n,s){let r;switch(n){case a.SourceMediaType.TEXT_X_CUCUMBER_GHERKIN_PLAIN:r=new l.default(s.defaultDialect);break;case a.SourceMediaType.TEXT_X_CUCUMBER_GHERKIN_MARKDOWN:r=new u.default(s.defaultDialect);break;default:throw new Error(`Unsupported media type: ${n}`)}const i=[];try{if(s.includeSource){i.push((0,d.default)(e,t))}if(!s.includeGherkinDocument&&!s.includePickles){return i}const n=new f.default(new c.default(s.newId),r);n.stopAtFirstError=false;const o=n.parse(e);if(s.includeGherkinDocument){i.push({gherkinDocument:{...o,uri:t}})}if(s.includePickles){const e=(0,p.default)(o,t,s.newId);for(const t of e){i.push({pickle:t})}}}catch(e){const n=e.errors||[e];for(const e of n){if(!e.location){throw e}i.push({parseError:{source:{uri:t,location:{line:e.location.line,column:e.location.column}},message:e.message}})}}return i}},119:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.TokenScanner=t.Parser=t.makeSourceEnvelope=t.generateMessages=t.GherkinInMarkdownTokenMatcher=t.GherkinClassicTokenMatcher=t.Errors=t.dialects=t.compile=t.AstBuilder=void 0;const a=o(n(6084));t.AstBuilder=a.default;const c=i(n(3840));t.Errors=c;const l=o(n(1112));t.GherkinClassicTokenMatcher=l.default;const u=o(n(5422));t.GherkinInMarkdownTokenMatcher=u.default;const d=o(n(6344));t.generateMessages=d.default;const f=o(n(6097));const p=o(n(5140));t.makeSourceEnvelope=p.default;const h=o(n(3032));t.Parser=h.default;const m=o(n(850));t.compile=m.default;const g=o(n(282));t.TokenScanner=g.default;const y=f.default;t.dialects=y},5140:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t["default"]=makeSourceEnvelope;const o=i(n(6088));function makeSourceEnvelope(e,t){let n;if(t.endsWith(".feature")){n=o.SourceMediaType.TEXT_X_CUCUMBER_GHERKIN_PLAIN}else if(t.endsWith(".md")){n=o.SourceMediaType.TEXT_X_CUCUMBER_GHERKIN_MARKDOWN}if(!n)throw new Error(`The uri (${t}) must end with .feature or .md`);return{source:{data:e,uri:t,mediaType:n}}}},850:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t["default"]=compile;const o=i(n(6088));const a={[o.StepKeywordType.UNKNOWN]:o.PickleStepType.UNKNOWN,[o.StepKeywordType.CONTEXT]:o.PickleStepType.CONTEXT,[o.StepKeywordType.ACTION]:o.PickleStepType.ACTION,[o.StepKeywordType.OUTCOME]:o.PickleStepType.OUTCOME,[o.StepKeywordType.CONJUNCTION]:null};function compile(e,t,n){const s=[];if(e.feature==null){return s}const r=e.feature;const i=r.language;const o=r.tags;let a=[];r.children.forEach((e=>{if(e.background){a=[].concat(e.background.steps)}else if(e.rule){compileRule(o,a,e.rule,i,s,t,n)}else if(e.scenario.examples.length===0){compileScenario(o,a,e.scenario,i,s,t,n)}else{compileScenarioOutline(o,a,e.scenario,i,s,t,n)}}));return s}function compileRule(e,t,n,s,r,i,o){let a=[].concat(t);const c=[].concat(e).concat(n.tags);n.children.forEach((e=>{if(e.background){a=a.concat(e.background.steps)}else if(e.scenario.examples.length===0){compileScenario(c,a,e.scenario,s,r,i,o)}else{compileScenarioOutline(c,a,e.scenario,s,r,i,o)}}))}function compileScenario(e,t,n,s,r,i,a){let c=o.StepKeywordType.UNKNOWN;const l=[];if(n.steps.length!==0){t.forEach((e=>{c=e.keywordType===o.StepKeywordType.CONJUNCTION?c:e.keywordType;l.push(pickleStep(e,[],null,a,c))}))}const u=[].concat(e).concat(n.tags);n.steps.forEach((e=>{c=e.keywordType===o.StepKeywordType.CONJUNCTION?c:e.keywordType;l.push(pickleStep(e,[],null,a,c))}));const d={id:a(),uri:i,location:n.location,astNodeIds:[n.id],tags:pickleTags(u),name:n.name,language:s,steps:l};r.push(d)}function compileScenarioOutline(e,t,n,s,r,i,a){n.examples.filter((e=>e.tableHeader)).forEach((c=>{const l=c.tableHeader.cells;c.tableBody.forEach((u=>{let d=o.StepKeywordType.UNKNOWN;const f=[];if(n.steps.length!==0){t.forEach((e=>{d=e.keywordType===o.StepKeywordType.CONJUNCTION?d:e.keywordType;f.push(pickleStep(e,[],null,a,d))}))}n.steps.forEach((e=>{d=e.keywordType===o.StepKeywordType.CONJUNCTION?d:e.keywordType;const t=pickleStep(e,l,u,a,d);f.push(t)}));const p=a();const h=pickleTags([].concat(e).concat(n.tags).concat(c.tags));r.push({id:p,uri:i,location:u.location,astNodeIds:[n.id,u.id],name:interpolate(n.name,l,u.cells),language:s,steps:f,tags:h})}))}))}function createPickleArguments(e,t,n){if(e.dataTable){const s=e.dataTable;const r={rows:s.rows.map((e=>({cells:e.cells.map((e=>({value:interpolate(e.value,t,n)})))})))};return{dataTable:r}}else if(e.docString){const s=e.docString;const r={content:interpolate(s.content,t,n)};if(s.mediaType){r.mediaType=interpolate(s.mediaType,t,n)}return{docString:r}}}function interpolate(e,t,n){t.forEach(((t,s)=>{const r=n[s];const i=`<${t.value}>`;const o=i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");const a=new RegExp(o,"g");const c=r.value.replace(/\$/g,"$$$$");e=e.replace(a,c)}));return e}function pickleStep(e,t,n,s,r){const i=[e.id];if(n){i.push(n.id)}const o=n?n.cells:[];return{id:s(),text:interpolate(e.text,t,o),type:a[r],argument:createPickleArguments(e,t,o),astNodeIds:i}}function pickleTags(e){return e.map(pickleTag)}function pickleTag(e){return{name:e.name,astNodeId:e.id}}},4951:(e,t,n)=>{"use strict";var s;s={value:true};const r=n(3430);r.code='require("ajv/dist/runtime/equal").default';t.A=r},21:e=>{"use strict";e.exports=({onlyFirst:e=false}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?undefined:"g")}},8493:e=>{"use strict";const t="[\ud800-\udbff][\udc00-\udfff]";const astralRegex=e=>e&&e.exact?new RegExp(`^${t}$`):new RegExp(t,"g");e.exports=astralRegex},4782:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});var s=n(4434);function toArr(e){return e==null?[]:Array.isArray(e)?e:[e]}function toVal(e,t,n,s){var r,i=e[t],o=!!~s.string.indexOf(t)?n==null||n===true?"":String(n):typeof n==="boolean"?n:!!~s.boolean.indexOf(t)?n==="false"?false:n==="true"||(e._.push((r=+n,r*0===0)?r:n),!!n):(r=+n,r*0===0)?r:n;e[t]=i==null?o:Array.isArray(i)?i.concat(o):[i,o]}function mri2(e,t){e=e||[];t=t||{};var n,s,r,i,o,a={_:[]};var c=0,l=0,u=0,d=e.length;const f=t.alias!==void 0;const p=t.unknown!==void 0;const h=t.default!==void 0;t.alias=t.alias||{};t.string=toArr(t.string);t.boolean=toArr(t.boolean);if(f){for(n in t.alias){s=t.alias[n]=toArr(t.alias[n]);for(c=0;c<s.length;c++){(t.alias[s[c]]=s.concat(n)).splice(c,1)}}}for(c=t.boolean.length;c-- >0;){s=t.alias[t.boolean[c]]||[];for(l=s.length;l-- >0;)t.boolean.push(s[l])}for(c=t.string.length;c-- >0;){s=t.alias[t.string[c]]||[];for(l=s.length;l-- >0;)t.string.push(s[l])}if(h){for(n in t.default){i=typeof t.default[n];s=t.alias[n]=t.alias[n]||[];if(t[i]!==void 0){t[i].push(n);for(c=0;c<s.length;c++){t[i].push(s[c])}}}}const m=p?Object.keys(t.alias):[];for(c=0;c<d;c++){r=e[c];if(r==="--"){a._=a._.concat(e.slice(++c));break}for(l=0;l<r.length;l++){if(r.charCodeAt(l)!==45)break}if(l===0){a._.push(r)}else if(r.substring(l,l+3)==="no-"){i=r.substring(l+3);if(p&&!~m.indexOf(i)){return t.unknown(r)}a[i]=false}else{for(u=l+1;u<r.length;u++){if(r.charCodeAt(u)===61)break}i=r.substring(l,u);o=r.substring(++u)||(c+1===d||(""+e[c+1]).charCodeAt(0)===45||e[++c]);s=l===2?[i]:i;for(u=0;u<s.length;u++){i=s[u];if(p&&!~m.indexOf(i))return t.unknown("-".repeat(l)+i);toVal(a,i,u+1<s.length||o,t)}}}if(h){for(n in t.default){if(a[n]===void 0){a[n]=t.default[n]}}}if(f){for(n in a){s=t.alias[n]||[];while(s.length>0){a[s.shift()]=a[n]}}}return a}const removeBrackets=e=>e.replace(/[<[].+/,"").trim();const findAllBrackets=e=>{const t=/<([^>]+)>/g;const n=/\[([^\]]+)\]/g;const s=[];const parse=e=>{let t=false;let n=e[1];if(n.startsWith("...")){n=n.slice(3);t=true}return{required:e[0].startsWith("<"),value:n,variadic:t}};let r;while(r=t.exec(e)){s.push(parse(r))}let i;while(i=n.exec(e)){s.push(parse(i))}return s};const getMriOptions=e=>{const t={alias:{},boolean:[]};for(const[n,s]of e.entries()){if(s.names.length>1){t.alias[s.names[0]]=s.names.slice(1)}if(s.isBoolean){if(s.negated){const r=e.some(((e,t)=>t!==n&&e.names.some((e=>s.names.includes(e)))&&typeof e.required==="boolean"));if(!r){t.boolean.push(s.names[0])}}else{t.boolean.push(s.names[0])}}}return t};const findLongest=e=>e.sort(((e,t)=>e.length>t.length?-1:1))[0];const padRight=(e,t)=>e.length>=t?e:`${e}${" ".repeat(t-e.length)}`;const camelcase=e=>e.replace(/([a-z])-([a-z])/g,((e,t,n)=>t+n.toUpperCase()));const setDotProp=(e,t,n)=>{let s=0;let r=t.length;let i=e;let o;for(;s<r;++s){o=i[t[s]];i=i[t[s]]=s===r-1?n:o!=null?o:!!~t[s+1].indexOf(".")||!(+t[s+1]>-1)?{}:[]}};const setByType=(e,t)=>{for(const n of Object.keys(t)){const s=t[n];if(s.shouldTransform){e[n]=Array.prototype.concat.call([],e[n]);if(typeof s.transformFunction==="function"){e[n]=e[n].map(s.transformFunction)}}}};const getFileName=e=>{const t=/([^\\\/]+)$/.exec(e);return t?t[1]:""};const camelcaseOptionName=e=>e.split(".").map(((e,t)=>t===0?camelcase(e):e)).join(".");class CACError extends Error{constructor(e){super(e);this.name=this.constructor.name;if(typeof Error.captureStackTrace==="function"){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error(e).stack}}}class Option{constructor(e,t,n){this.rawName=e;this.description=t;this.config=Object.assign({},n);e=e.replace(/\.\*/g,"");this.negated=false;this.names=removeBrackets(e).split(",").map((e=>{let t=e.trim().replace(/^-{1,2}/,"");if(t.startsWith("no-")){this.negated=true;t=t.replace(/^no-/,"")}return camelcaseOptionName(t)})).sort(((e,t)=>e.length>t.length?1:-1));this.name=this.names[this.names.length-1];if(this.negated&&this.config.default==null){this.config.default=true}if(e.includes("<")){this.required=true}else if(e.includes("[")){this.required=false}else{this.isBoolean=true}}}const r=process.argv;const i=`${process.platform}-${process.arch} node-${process.version}`;class Command{constructor(e,t,n={},s){this.rawName=e;this.description=t;this.config=n;this.cli=s;this.options=[];this.aliasNames=[];this.name=removeBrackets(e);this.args=findAllBrackets(e);this.examples=[]}usage(e){this.usageText=e;return this}allowUnknownOptions(){this.config.allowUnknownOptions=true;return this}ignoreOptionDefaultValue(){this.config.ignoreOptionDefaultValue=true;return this}version(e,t="-v, --version"){this.versionNumber=e;this.option(t,"Display version number");return this}example(e){this.examples.push(e);return this}option(e,t,n){const s=new Option(e,t,n);this.options.push(s);return this}alias(e){this.aliasNames.push(e);return this}action(e){this.commandAction=e;return this}isMatched(e){return this.name===e||this.aliasNames.includes(e)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof GlobalCommand}hasOption(e){e=e.split(".")[0];return this.options.find((t=>t.names.includes(e)))}outputHelp(){const{name:e,commands:t}=this.cli;const{versionNumber:n,options:s,helpCallback:r}=this.cli.globalCommand;let i=[{body:`${e}${n?`/${n}`:""}`}];i.push({title:"Usage",body:` $ ${e} ${this.usageText||this.rawName}`});const o=(this.isGlobalCommand||this.isDefaultCommand)&&t.length>0;if(o){const n=findLongest(t.map((e=>e.rawName)));i.push({title:"Commands",body:t.map((e=>` ${padRight(e.rawName,n.length)} ${e.description}`)).join("\n")});i.push({title:`For more info, run any command with the \`--help\` flag`,body:t.map((t=>` $ ${e}${t.name===""?"":` ${t.name}`} --help`)).join("\n")})}let a=this.isGlobalCommand?s:[...this.options,...s||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand){a=a.filter((e=>e.name!=="version"))}if(a.length>0){const e=findLongest(a.map((e=>e.rawName)));i.push({title:"Options",body:a.map((t=>` ${padRight(t.rawName,e.length)} ${t.description} ${t.config.default===void 0?"":`(default: ${t.config.default})`}`)).join("\n")})}if(this.examples.length>0){i.push({title:"Examples",body:this.examples.map((t=>{if(typeof t==="function"){return t(e)}return t})).join("\n")})}if(r){i=r(i)||i}console.log(i.map((e=>e.title?`${e.title}:\n${e.body}`:e.body)).join("\n\n"))}outputVersion(){const{name:e}=this.cli;const{versionNumber:t}=this.cli.globalCommand;if(t){console.log(`${e}/${t} ${i}`)}}checkRequiredArgs(){const e=this.args.filter((e=>e.required)).length;if(this.cli.args.length<e){throw new CACError(`missing required args for command \`${this.rawName}\``)}}checkUnknownOptions(){const{options:e,globalCommand:t}=this.cli;if(!this.config.allowUnknownOptions){for(const n of Object.keys(e)){if(n!=="--"&&!this.hasOption(n)&&!t.hasOption(n)){throw new CACError(`Unknown option \`${n.length>1?`--${n}`:`-${n}`}\``)}}}}checkOptionValue(){const{options:e,globalCommand:t}=this.cli;const n=[...t.options,...this.options];for(const t of n){const s=e[t.name.split(".")[0]];if(t.required){const e=n.some((e=>e.negated&&e.names.includes(t.name)));if(s===true||s===false&&!e){throw new CACError(`option \`${t.rawName}\` value is missing`)}}}}}class GlobalCommand extends Command{constructor(e){super("@@global@@","",{},e)}}var o=Object.assign;class CAC extends s.EventEmitter{constructor(e=""){super();this.name=e;this.commands=[];this.rawArgs=[];this.args=[];this.options={};this.globalCommand=new GlobalCommand(this);this.globalCommand.usage("<command> [options]")}usage(e){this.globalCommand.usage(e);return this}command(e,t,n){const s=new Command(e,t||"",n,this);s.globalCommand=this.globalCommand;this.commands.push(s);return s}option(e,t,n){this.globalCommand.option(e,t,n);return this}help(e){this.globalCommand.option("-h, --help","Display this message");this.globalCommand.helpCallback=e;this.showHelpOnExit=true;return this}version(e,t="-v, --version"){this.globalCommand.version(e,t);this.showVersionOnExit=true;return this}example(e){this.globalCommand.example(e);return this}outputHelp(){if(this.matchedCommand){this.matchedCommand.outputHelp()}else{this.globalCommand.outputHelp()}}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:e,options:t},n,s){this.args=e;this.options=t;if(n){this.matchedCommand=n}if(s){this.matchedCommandName=s}return this}unsetMatchedCommand(){this.matchedCommand=void 0;this.matchedCommandName=void 0}parse(e=r,{run:t=true}={}){this.rawArgs=e;if(!this.name){this.name=e[1]?getFileName(e[1]):"cli"}let n=true;for(const t of this.commands){const s=this.mri(e.slice(2),t);const r=s.args[0];if(t.isMatched(r)){n=false;const e=o(o({},s),{args:s.args.slice(1)});this.setParsedInfo(e,t,r);this.emit(`command:${r}`,t)}}if(n){for(const t of this.commands){if(t.name===""){n=false;const s=this.mri(e.slice(2),t);this.setParsedInfo(s,t);this.emit(`command:!`,t)}}}if(n){const t=this.mri(e.slice(2));this.setParsedInfo(t)}if(this.options.help&&this.showHelpOnExit){this.outputHelp();t=false;this.unsetMatchedCommand()}if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null){this.outputVersion();t=false;this.unsetMatchedCommand()}const s={args:this.args,options:this.options};if(t){this.runMatchedCommand()}if(!this.matchedCommand&&this.args[0]){this.emit("command:*")}return s}mri(e,t){const n=[...this.globalCommand.options,...t?t.options:[]];const s=getMriOptions(n);let r=[];const i=e.indexOf("--");if(i>-1){r=e.slice(i+1);e=e.slice(0,i)}let a=mri2(e,s);a=Object.keys(a).reduce(((e,t)=>o(o({},e),{[camelcaseOptionName(t)]:a[t]})),{_:[]});const c=a._;const l={"--":r};const u=t&&t.config.ignoreOptionDefaultValue?t.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue;let d=Object.create(null);for(const e of n){if(!u&&e.config.default!==void 0){for(const t of e.names){l[t]=e.config.default}}if(Array.isArray(e.config.type)){if(d[e.name]===void 0){d[e.name]=Object.create(null);d[e.name]["shouldTransform"]=true;d[e.name]["transformFunction"]=e.config.type[0]}}}for(const e of Object.keys(a)){if(e!=="_"){const t=e.split(".");setDotProp(l,t,a[e]);setByType(l,d)}}return{args:c,options:l}}runMatchedCommand(){const{args:e,options:t,matchedCommand:n}=this;if(!n||!n.commandAction)return;n.checkUnknownOptions();n.checkOptionValue();n.checkRequiredArgs();const s=[];n.args.forEach(((t,n)=>{if(t.variadic){s.push(e.slice(n))}else{s.push(e[n])}}));s.push(t);return n.commandAction.apply(this,s)}}const cac=(e="")=>new CAC(e);t.CAC=CAC;t.Command=Command;t.cac=cac;t["default"]=cac},7948:(e,t,n)=>{const{cac:s,CAC:r,Command:i}=n(4782);e.exports=s;Object.assign(e.exports,{default:s,cac:s,CAC:r,Command:i})},5781:(e,t,n)=>{"use strict";e=n.nmd(e);const wrapAnsi16=(e,t)=>(...n)=>{const s=e(...n);return`[${s+t}m`};const wrapAnsi256=(e,t)=>(...n)=>{const s=e(...n);return`[${38+t};5;${s}m`};const wrapAnsi16m=(e,t)=>(...n)=>{const s=e(...n);return`[${38+t};2;${s[0]};${s[1]};${s[2]}m`};const ansi2ansi=e=>e;const rgb2rgb=(e,t,n)=>[e,t,n];const setLazyProperty=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const s=n();Object.defineProperty(e,t,{value:s,enumerable:true,configurable:true});return s},enumerable:true,configurable:true})};let s;const makeDynamicStyles=(e,t,r,i)=>{if(s===undefined){s=n(4185)}const o=i?10:0;const a={};for(const[n,i]of Object.entries(s)){const s=n==="ansi16"?"ansi":n;if(n===t){a[s]=e(r,o)}else if(typeof i==="object"){a[s]=e(i[t],o)}}return a};function assembleStyles(){const e=new Map;const t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright;t.bgColor.bgGray=t.bgColor.bgBlackBright;t.color.grey=t.color.blackBright;t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(const[n,s]of Object.entries(t)){for(const[n,r]of Object.entries(s)){t[n]={open:`[${r[0]}m`,close:`[${r[1]}m`};s[n]=t[n];e.set(r[0],r[1])}Object.defineProperty(t,n,{value:s,enumerable:false})}Object.defineProperty(t,"codes",{value:e,enumerable:false});t.color.close="";t.bgColor.close="";setLazyProperty(t.color,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,false)));setLazyProperty(t.color,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,false)));setLazyProperty(t.color,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,false)));setLazyProperty(t.bgColor,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,true)));setLazyProperty(t.bgColor,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,true)));setLazyProperty(t.bgColor,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,true)));return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},465:(e,t,n)=>{"use strict";const s=n(5781);const{stdout:r,stderr:i}=n(1450);const{stringReplaceAll:o,stringEncaseCRLFWithFirstIndex:a}=n(8809);const{isArray:c}=Array;const l=["ansi","ansi","ansi256","ansi16m"];const u=Object.create(null);const applyOptions=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const n=r?r.level:0;e.level=t.level===undefined?n:t.level};class ChalkClass{constructor(e){return chalkFactory(e)}}const chalkFactory=e=>{const t={};applyOptions(t,e);t.template=(...e)=>chalkTag(t.template,...e);Object.setPrototypeOf(t,Chalk.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")};t.template.Instance=ChalkClass;return t.template};function Chalk(e){return chalkFactory(e)}for(const[e,t]of Object.entries(s)){u[e]={get(){const n=createBuilder(this,createStyler(t.open,t.close,this._styler),this._isEmpty);Object.defineProperty(this,e,{value:n});return n}}}u.visible={get(){const e=createBuilder(this,this._styler,true);Object.defineProperty(this,"visible",{value:e});return e}};const d=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of d){u[e]={get(){const{level:t}=this;return function(...n){const r=createStyler(s.color[l[t]][e](...n),s.color.close,this._styler);return createBuilder(this,r,this._isEmpty)}}}}for(const e of d){const t="bg"+e[0].toUpperCase()+e.slice(1);u[t]={get(){const{level:t}=this;return function(...n){const r=createStyler(s.bgColor[l[t]][e](...n),s.bgColor.close,this._styler);return createBuilder(this,r,this._isEmpty)}}}}const f=Object.defineProperties((()=>{}),{...u,level:{enumerable:true,get(){return this._generator.level},set(e){this._generator.level=e}}});const createStyler=(e,t,n)=>{let s;let r;if(n===undefined){s=e;r=t}else{s=n.openAll+e;r=t+n.closeAll}return{open:e,close:t,openAll:s,closeAll:r,parent:n}};const createBuilder=(e,t,n)=>{const builder=(...e)=>{if(c(e[0])&&c(e[0].raw)){return applyStyle(builder,chalkTag(builder,...e))}return applyStyle(builder,e.length===1?""+e[0]:e.join(" "))};Object.setPrototypeOf(builder,f);builder._generator=e;builder._styler=t;builder._isEmpty=n;return builder};const applyStyle=(e,t)=>{if(e.level<=0||!t){return e._isEmpty?"":t}let n=e._styler;if(n===undefined){return t}const{openAll:s,closeAll:r}=n;if(t.indexOf("")!==-1){while(n!==undefined){t=o(t,n.close,n.open);n=n.parent}}const i=t.indexOf("\n");if(i!==-1){t=a(t,r,s,i)}return s+t+r};let p;const chalkTag=(e,...t)=>{const[s]=t;if(!c(s)||!c(s.raw)){return t.join(" ")}const r=t.slice(1);const i=[s.raw[0]];for(let e=1;e<s.length;e++){i.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"),String(s.raw[e]))}if(p===undefined){p=n(4670)}return p(e,i.join(""))};Object.defineProperties(Chalk.prototype,u);const h=Chalk();h.supportsColor=r;h.stderr=Chalk({level:i?i.level:0});h.stderr.supportsColor=i;e.exports=h},4670:e=>{"use strict";const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const n=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const s=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const r=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;const i=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function unescape(e){const t=e[0]==="u";const n=e[1]==="{";if(t&&!n&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}if(t&&n){return String.fromCodePoint(parseInt(e.slice(2,-1),16))}return i.get(e)||e}function parseArguments(e,t){const n=[];const i=t.trim().split(/\s*,\s*/g);let o;for(const t of i){const i=Number(t);if(!Number.isNaN(i)){n.push(i)}else if(o=t.match(s)){n.push(o[2].replace(r,((e,t,n)=>t?unescape(t):n)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return n}function parseStyle(e){n.lastIndex=0;const t=[];let s;while((s=n.exec(e))!==null){const e=s[1];if(s[2]){const n=parseArguments(e,s[2]);t.push([e].concat(n))}else{t.push([e])}}return t}function buildStyle(e,t){const n={};for(const e of t){for(const t of e.styles){n[t[0]]=e.inverse?null:t.slice(1)}}let s=e;for(const[e,t]of Object.entries(n)){if(!Array.isArray(t)){continue}if(!(e in s)){throw new Error(`Unknown Chalk style: ${e}`)}s=t.length>0?s[e](...t):s[e]}return s}e.exports=(e,n)=>{const s=[];const r=[];let i=[];n.replace(t,((t,n,o,a,c,l)=>{if(n){i.push(unescape(n))}else if(a){const t=i.join("");i=[];r.push(s.length===0?t:buildStyle(e,s)(t));s.push({inverse:o,styles:parseStyle(a)})}else if(c){if(s.length===0){throw new Error("Found extraneous } in Chalk template literal")}r.push(buildStyle(e,s)(i.join("")));i=[];s.pop()}else{i.push(l)}}));r.push(i.join(""));if(s.length>0){const e=`Chalk template literal is missing ${s.length} closing bracket${s.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return r.join("")}},8809:e=>{"use strict";const stringReplaceAll=(e,t,n)=>{let s=e.indexOf(t);if(s===-1){return e}const r=t.length;let i=0;let o="";do{o+=e.substr(i,s-i)+t+n;i=s+r;s=e.indexOf(t,i)}while(s!==-1);o+=e.substr(i);return o};const stringEncaseCRLFWithFirstIndex=(e,t,n,s)=>{let r=0;let i="";do{const o=e[s-1]==="\r";i+=e.substr(r,(o?s-1:s)-r)+t+(o?"\r\n":"\n")+n;r=s+1;s=e.indexOf("\n",r)}while(s!==-1);i+=e.substr(r);return i};e.exports={stringReplaceAll:stringReplaceAll,stringEncaseCRLFWithFirstIndex:stringEncaseCRLFWithFirstIndex}},9552:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ClassTransformer=void 0;const s=n(5291);const r=n(2446);const i=n(1161);class ClassTransformer{instanceToPlain(e,t){const n=new s.TransformOperationExecutor(r.TransformationType.CLASS_TO_PLAIN,{...i.defaultOptions,...t});return n.transform(undefined,e,undefined,undefined,undefined,undefined)}classToPlainFromExist(e,t,n){const o=new s.TransformOperationExecutor(r.TransformationType.CLASS_TO_PLAIN,{...i.defaultOptions,...n});return o.transform(t,e,undefined,undefined,undefined,undefined)}plainToInstance(e,t,n){const o=new s.TransformOperationExecutor(r.TransformationType.PLAIN_TO_CLASS,{...i.defaultOptions,...n});return o.transform(undefined,t,e,undefined,undefined,undefined)}plainToClassFromExist(e,t,n){const o=new s.TransformOperationExecutor(r.TransformationType.PLAIN_TO_CLASS,{...i.defaultOptions,...n});return o.transform(e,t,undefined,undefined,undefined,undefined)}instanceToInstance(e,t){const n=new s.TransformOperationExecutor(r.TransformationType.CLASS_TO_CLASS,{...i.defaultOptions,...t});return n.transform(undefined,e,undefined,undefined,undefined,undefined)}classToClassFromExist(e,t,n){const o=new s.TransformOperationExecutor(r.TransformationType.CLASS_TO_CLASS,{...i.defaultOptions,...n});return o.transform(t,e,undefined,undefined,undefined,undefined)}serialize(e,t){return JSON.stringify(this.instanceToPlain(e,t))}deserialize(e,t,n){const s=JSON.parse(t);return this.plainToInstance(e,s,n)}deserializeArray(e,t,n){const s=JSON.parse(t);return this.plainToInstance(e,s,n)}}t.ClassTransformer=ClassTransformer},1665:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.MetadataStorage=void 0;const s=n(2446);class MetadataStorage{constructor(){this._typeMetadatas=new Map;this._transformMetadatas=new Map;this._exposeMetadatas=new Map;this._excludeMetadatas=new Map;this._ancestorsMap=new Map}addTypeMetadata(e){if(!this._typeMetadatas.has(e.target)){this._typeMetadatas.set(e.target,new Map)}this._typeMetadatas.get(e.target).set(e.propertyName,e)}addTransformMetadata(e){if(!this._transformMetadatas.has(e.target)){this._transformMetadatas.set(e.target,new Map)}if(!this._transformMetadatas.get(e.target).has(e.propertyName)){this._transformMetadatas.get(e.target).set(e.propertyName,[])}this._transformMetadatas.get(e.target).get(e.propertyName).push(e)}addExposeMetadata(e){if(!this._exposeMetadatas.has(e.target)){this._exposeMetadatas.set(e.target,new Map)}this._exposeMetadatas.get(e.target).set(e.propertyName,e)}addExcludeMetadata(e){if(!this._excludeMetadatas.has(e.target)){this._excludeMetadatas.set(e.target,new Map)}this._excludeMetadatas.get(e.target).set(e.propertyName,e)}findTransformMetadatas(e,t,n){return this.findMetadatas(this._transformMetadatas,e,t).filter((e=>{if(!e.options)return true;if(e.options.toClassOnly===true&&e.options.toPlainOnly===true)return true;if(e.options.toClassOnly===true){return n===s.TransformationType.CLASS_TO_CLASS||n===s.TransformationType.PLAIN_TO_CLASS}if(e.options.toPlainOnly===true){return n===s.TransformationType.CLASS_TO_PLAIN}return true}))}findExcludeMetadata(e,t){return this.findMetadata(this._excludeMetadatas,e,t)}findExposeMetadata(e,t){return this.findMetadata(this._exposeMetadatas,e,t)}findExposeMetadataByCustomName(e,t){return this.getExposedMetadatas(e).find((e=>e.options&&e.options.name===t))}findTypeMetadata(e,t){return this.findMetadata(this._typeMetadatas,e,t)}getStrategy(e){const t=this._excludeMetadatas.get(e);const n=t&&t.get(undefined);const s=this._exposeMetadatas.get(e);const r=s&&s.get(undefined);if(n&&r||!n&&!r)return"none";return n?"excludeAll":"exposeAll"}getExposedMetadatas(e){return this.getMetadata(this._exposeMetadatas,e)}getExcludedMetadatas(e){return this.getMetadata(this._excludeMetadatas,e)}getExposedProperties(e,t){return this.getExposedMetadatas(e).filter((e=>{if(!e.options)return true;if(e.options.toClassOnly===true&&e.options.toPlainOnly===true)return true;if(e.options.toClassOnly===true){return t===s.TransformationType.CLASS_TO_CLASS||t===s.TransformationType.PLAIN_TO_CLASS}if(e.options.toPlainOnly===true){return t===s.TransformationType.CLASS_TO_PLAIN}return true})).map((e=>e.propertyName))}getExcludedProperties(e,t){return this.getExcludedMetadatas(e).filter((e=>{if(!e.options)return true;if(e.options.toClassOnly===true&&e.options.toPlainOnly===true)return true;if(e.options.toClassOnly===true){return t===s.TransformationType.CLASS_TO_CLASS||t===s.TransformationType.PLAIN_TO_CLASS}if(e.options.toPlainOnly===true){return t===s.TransformationType.CLASS_TO_PLAIN}return true})).map((e=>e.propertyName))}clear(){this._typeMetadatas.clear();this._exposeMetadatas.clear();this._excludeMetadatas.clear();this._ancestorsMap.clear()}getMetadata(e,t){const n=e.get(t);let s;if(n){s=Array.from(n.values()).filter((e=>e.propertyName!==undefined))}const r=[];for(const n of this.getAncestors(t)){const t=e.get(n);if(t){const e=Array.from(t.values()).filter((e=>e.propertyName!==undefined));r.push(...e)}}return r.concat(s||[])}findMetadata(e,t,n){const s=e.get(t);if(s){const e=s.get(n);if(e){return e}}for(const s of this.getAncestors(t)){const t=e.get(s);if(t){const e=t.get(n);if(e){return e}}}return undefined}findMetadatas(e,t,n){const s=e.get(t);let r;if(s){r=s.get(n)}const i=[];for(const s of this.getAncestors(t)){const t=e.get(s);if(t){if(t.has(n)){i.push(...t.get(n))}}}return i.slice().reverse().concat((r||[]).slice().reverse())}getAncestors(e){if(!e)return[];if(!this._ancestorsMap.has(e)){const t=[];for(let n=Object.getPrototypeOf(e.prototype.constructor);typeof n.prototype!=="undefined";n=Object.getPrototypeOf(n.prototype.constructor)){t.push(n)}this._ancestorsMap.set(e,t)}return this._ancestorsMap.get(e)}}t.MetadataStorage=MetadataStorage},5291:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TransformOperationExecutor=void 0;const s=n(306);const r=n(2446);const i=n(1693);function instantiateArrayType(e){const t=new e;if(!(t instanceof Set)&&!("push"in t)){return[]}return t}class TransformOperationExecutor{constructor(e,t){this.transformationType=e;this.options=t;this.recursionStack=new Set}transform(e,t,n,o,a,c=0){if(Array.isArray(t)||t instanceof Set){const s=o&&this.transformationType===r.TransformationType.PLAIN_TO_CLASS?instantiateArrayType(o):[];t.forEach(((t,i)=>{const o=e?e[i]:undefined;if(!this.options.enableCircularCheck||!this.isCircular(t)){let e;if(typeof n!=="function"&&n&&n.options&&n.options.discriminator&&n.options.discriminator.property&&n.options.discriminator.subTypes){if(this.transformationType===r.TransformationType.PLAIN_TO_CLASS){e=n.options.discriminator.subTypes.find((e=>e.name===t[n.options.discriminator.property]));const r={newObject:s,object:t,property:undefined};const i=n.typeFunction(r);e===undefined?e=i:e=e.value;if(!n.options.keepDiscriminatorProperty)delete t[n.options.discriminator.property]}if(this.transformationType===r.TransformationType.CLASS_TO_CLASS){e=t.constructor}if(this.transformationType===r.TransformationType.CLASS_TO_PLAIN){t[n.options.discriminator.property]=n.options.discriminator.subTypes.find((e=>e.value===t.constructor)).name}}else{e=n}const i=this.transform(o,t,e,undefined,t instanceof Map,c+1);if(s instanceof Set){s.add(i)}else{s.push(i)}}else if(this.transformationType===r.TransformationType.CLASS_TO_CLASS){if(s instanceof Set){s.add(t)}else{s.push(t)}}}));return s}else if(n===String&&!a){if(t===null||t===undefined)return t;return String(t)}else if(n===Number&&!a){if(t===null||t===undefined)return t;return Number(t)}else if(n===Boolean&&!a){if(t===null||t===undefined)return t;return Boolean(t)}else if((n===Date||t instanceof Date)&&!a){if(t instanceof Date){return new Date(t.valueOf())}if(t===null||t===undefined)return t;return new Date(t)}else if(!!(0,i.getGlobal)().Buffer&&(n===Buffer||t instanceof Buffer)&&!a){if(t===null||t===undefined)return t;return Buffer.from(t)}else if((0,i.isPromise)(t)&&!a){return new Promise(((e,s)=>{t.then((t=>e(this.transform(undefined,t,n,undefined,undefined,c+1))),s)}))}else if(!a&&t!==null&&typeof t==="object"&&typeof t.then==="function"){return t}else if(typeof t==="object"&&t!==null){if(!n&&t.constructor!==Object)if(!Array.isArray(t)&&t.constructor===Array){}else{n=t.constructor}if(!n&&e)n=e.constructor;if(this.options.enableCircularCheck){this.recursionStack.add(t)}const i=this.getKeys(n,t,a);let o=e?e:{};if(!e&&(this.transformationType===r.TransformationType.PLAIN_TO_CLASS||this.transformationType===r.TransformationType.CLASS_TO_CLASS)){if(a){o=new Map}else if(n){o=new n}else{o={}}}for(const l of i){if(l==="__proto__"||l==="constructor"){continue}const i=l;let u=l,d=l;if(!this.options.ignoreDecorators&&n){if(this.transformationType===r.TransformationType.PLAIN_TO_CLASS){const e=s.defaultMetadataStorage.findExposeMetadataByCustomName(n,l);if(e){d=e.propertyName;u=e.propertyName}}else if(this.transformationType===r.TransformationType.CLASS_TO_PLAIN||this.transformationType===r.TransformationType.CLASS_TO_CLASS){const e=s.defaultMetadataStorage.findExposeMetadata(n,l);if(e&&e.options&&e.options.name){u=e.options.name}}}let f=undefined;if(this.transformationType===r.TransformationType.PLAIN_TO_CLASS){f=t[i]}else{if(t instanceof Map){f=t.get(i)}else if(t[i]instanceof Function){f=t[i]()}else{f=t[i]}}let p=undefined,h=f instanceof Map;if(n&&a){p=n}else if(n){const e=s.defaultMetadataStorage.findTypeMetadata(n,d);if(e){const n={newObject:o,object:t,property:d};const s=e.typeFunction?e.typeFunction(n):e.reflectedType;if(e.options&&e.options.discriminator&&e.options.discriminator.property&&e.options.discriminator.subTypes){if(!(t[i]instanceof Array)){if(this.transformationType===r.TransformationType.PLAIN_TO_CLASS){p=e.options.discriminator.subTypes.find((t=>{if(f&&f instanceof Object&&e.options.discriminator.property in f){return t.name===f[e.options.discriminator.property]}}));p===undefined?p=s:p=p.value;if(!e.options.keepDiscriminatorProperty){if(f&&f instanceof Object&&e.options.discriminator.property in f){delete f[e.options.discriminator.property]}}}if(this.transformationType===r.TransformationType.CLASS_TO_CLASS){p=f.constructor}if(this.transformationType===r.TransformationType.CLASS_TO_PLAIN){if(f){f[e.options.discriminator.property]=e.options.discriminator.subTypes.find((e=>e.value===f.constructor)).name}}}else{p=e}}else{p=s}h=h||e.reflectedType===Map}else if(this.options.targetMaps){this.options.targetMaps.filter((e=>e.target===n&&!!e.properties[d])).forEach((e=>p=e.properties[d]))}else if(this.options.enableImplicitConversion&&this.transformationType===r.TransformationType.PLAIN_TO_CLASS){const e=Reflect.getMetadata("design:type",n.prototype,d);if(e){p=e}}}const m=Array.isArray(t[i])?this.getReflectedType(n,d):undefined;const g=e?e[i]:undefined;if(o.constructor.prototype){const e=Object.getOwnPropertyDescriptor(o.constructor.prototype,u);if((this.transformationType===r.TransformationType.PLAIN_TO_CLASS||this.transformationType===r.TransformationType.CLASS_TO_CLASS)&&(e&&!e.set||o[u]instanceof Function))continue}if(!this.options.enableCircularCheck||!this.isCircular(f)){const e=this.transformationType===r.TransformationType.PLAIN_TO_CLASS?u:l;let s;if(this.transformationType===r.TransformationType.CLASS_TO_PLAIN){s=t[e];s=this.applyCustomTransformations(s,n,e,t,this.transformationType);s=t[e]===s?f:s;s=this.transform(g,s,p,m,h,c+1)}else{if(f===undefined&&this.options.exposeDefaultValues){s=o[u]}else{s=this.transform(g,f,p,m,h,c+1);s=this.applyCustomTransformations(s,n,e,t,this.transformationType)}}if(s!==undefined||this.options.exposeUnsetFields){if(o instanceof Map){o.set(u,s)}else{o[u]=s}}}else if(this.transformationType===r.TransformationType.CLASS_TO_CLASS){let e=f;e=this.applyCustomTransformations(e,n,l,t,this.transformationType);if(e!==undefined||this.options.exposeUnsetFields){if(o instanceof Map){o.set(u,e)}else{o[u]=e}}}}if(this.options.enableCircularCheck){this.recursionStack.delete(t)}return o}else{return t}}applyCustomTransformations(e,t,n,r,i){let o=s.defaultMetadataStorage.findTransformMetadatas(t,n,this.transformationType);if(this.options.version!==undefined){o=o.filter((e=>{if(!e.options)return true;return this.checkVersion(e.options.since,e.options.until)}))}if(this.options.groups&&this.options.groups.length){o=o.filter((e=>{if(!e.options)return true;return this.checkGroups(e.options.groups)}))}else{o=o.filter((e=>!e.options||!e.options.groups||!e.options.groups.length))}o.forEach((t=>{e=t.transformFn({value:e,key:n,obj:r,type:i,options:this.options})}));return e}isCircular(e){return this.recursionStack.has(e)}getReflectedType(e,t){if(!e)return undefined;const n=s.defaultMetadataStorage.findTypeMetadata(e,t);return n?n.reflectedType:undefined}getKeys(e,t,n){let i=s.defaultMetadataStorage.getStrategy(e);if(i==="none")i=this.options.strategy||"exposeAll";let o=[];if(i==="exposeAll"||n){if(t instanceof Map){o=Array.from(t.keys())}else{o=Object.keys(t)}}if(n){return o}if(this.options.ignoreDecorators&&this.options.excludeExtraneousValues&&e){const t=s.defaultMetadataStorage.getExposedProperties(e,this.transformationType);const n=s.defaultMetadataStorage.getExcludedProperties(e,this.transformationType);o=[...t,...n]}if(!this.options.ignoreDecorators&&e){let t=s.defaultMetadataStorage.getExposedProperties(e,this.transformationType);if(this.transformationType===r.TransformationType.PLAIN_TO_CLASS){t=t.map((t=>{const n=s.defaultMetadataStorage.findExposeMetadata(e,t);if(n&&n.options&&n.options.name){return n.options.name}return t}))}if(this.options.excludeExtraneousValues){o=t}else{o=o.concat(t)}const n=s.defaultMetadataStorage.getExcludedProperties(e,this.transformationType);if(n.length>0){o=o.filter((e=>!n.includes(e)))}if(this.options.version!==undefined){o=o.filter((t=>{const n=s.defaultMetadataStorage.findExposeMetadata(e,t);if(!n||!n.options)return true;return this.checkVersion(n.options.since,n.options.until)}))}if(this.options.groups&&this.options.groups.length){o=o.filter((t=>{const n=s.defaultMetadataStorage.findExposeMetadata(e,t);if(!n||!n.options)return true;return this.checkGroups(n.options.groups)}))}else{o=o.filter((t=>{const n=s.defaultMetadataStorage.findExposeMetadata(e,t);return!n||!n.options||!n.options.groups||!n.options.groups.length}))}}if(this.options.excludePrefixes&&this.options.excludePrefixes.length){o=o.filter((e=>this.options.excludePrefixes.every((t=>e.substr(0,t.length)!==t))))}o=o.filter(((e,t,n)=>n.indexOf(e)===t));return o}checkVersion(e,t){let n=true;if(n&&e)n=this.options.version>=e;if(n&&t)n=this.options.version<t;return n}checkGroups(e){if(!e)return true;return this.options.groups.some((t=>e.includes(t)))}}t.TransformOperationExecutor=TransformOperationExecutor},1161:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.defaultOptions=void 0;t.defaultOptions={enableCircularCheck:false,enableImplicitConversion:false,excludeExtraneousValues:false,excludePrefixes:undefined,exposeDefaultValues:false,exposeUnsetFields:true,groups:undefined,ignoreDecorators:false,strategy:undefined,targetMaps:undefined,version:undefined}},9463:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Exclude=void 0;const s=n(306);function Exclude(e={}){return function(t,n){s.defaultMetadataStorage.addExcludeMetadata({target:t instanceof Function?t:t.constructor,propertyName:n,options:e})}}t.Exclude=Exclude},1787:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Expose=void 0;const s=n(306);function Expose(e={}){return function(t,n){s.defaultMetadataStorage.addExposeMetadata({target:t instanceof Function?t:t.constructor,propertyName:n,options:e})}}t.Expose=Expose},2854:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(9463),t);r(n(1787),t);r(n(9461),t);r(n(7174),t);r(n(6258),t);r(n(385),t);r(n(1715),t)},9461:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TransformInstanceToInstance=void 0;const s=n(9552);function TransformInstanceToInstance(e){return function(t,n,r){const i=new s.ClassTransformer;const o=r.value;r.value=function(...t){const n=o.apply(this,t);const s=!!n&&(typeof n==="object"||typeof n==="function")&&typeof n.then==="function";return s?n.then((t=>i.instanceToInstance(t,e))):i.instanceToInstance(n,e)}}}t.TransformInstanceToInstance=TransformInstanceToInstance},7174:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TransformInstanceToPlain=void 0;const s=n(9552);function TransformInstanceToPlain(e){return function(t,n,r){const i=new s.ClassTransformer;const o=r.value;r.value=function(...t){const n=o.apply(this,t);const s=!!n&&(typeof n==="object"||typeof n==="function")&&typeof n.then==="function";return s?n.then((t=>i.instanceToPlain(t,e))):i.instanceToPlain(n,e)}}}t.TransformInstanceToPlain=TransformInstanceToPlain},6258:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TransformPlainToInstance=void 0;const s=n(9552);function TransformPlainToInstance(e,t){return function(n,r,i){const o=new s.ClassTransformer;const a=i.value;i.value=function(...n){const s=a.apply(this,n);const r=!!s&&(typeof s==="object"||typeof s==="function")&&typeof s.then==="function";return r?s.then((n=>o.plainToInstance(e,n,t))):o.plainToInstance(e,s,t)}}}t.TransformPlainToInstance=TransformPlainToInstance},385:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Transform=void 0;const s=n(306);function Transform(e,t={}){return function(n,r){s.defaultMetadataStorage.addTransformMetadata({target:n.constructor,propertyName:r,transformFn:e,options:t})}}t.Transform=Transform},1715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Type=void 0;const s=n(306);function Type(e,t={}){return function(n,r){const i=Reflect.getMetadata("design:type",n,r);s.defaultMetadataStorage.addTypeMetadata({target:n.constructor,propertyName:r,reflectedType:i,typeFunction:e,options:t})}}t.Type=Type},2446:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(2435),t)},2435:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TransformationType=void 0;var n;(function(e){e[e["PLAIN_TO_CLASS"]=0]="PLAIN_TO_CLASS";e[e["CLASS_TO_PLAIN"]=1]="CLASS_TO_PLAIN";e[e["CLASS_TO_CLASS"]=2]="CLASS_TO_CLASS"})(n=t.TransformationType||(t.TransformationType={}))},451:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});t.deserializeArray=t.deserialize=t.serialize=t.classToClassFromExist=t.instanceToInstance=t.plainToClassFromExist=t.plainToInstance=t.plainToClass=t.classToPlainFromExist=t.instanceToPlain=t.classToPlain=t.ClassTransformer=void 0;const i=n(9552);var o=n(9552);Object.defineProperty(t,"ClassTransformer",{enumerable:true,get:function(){return o.ClassTransformer}});r(n(2854),t);r(n(6400),t);r(n(2446),t);const a=new i.ClassTransformer;function classToPlain(e,t){return a.instanceToPlain(e,t)}t.classToPlain=classToPlain;function instanceToPlain(e,t){return a.instanceToPlain(e,t)}t.instanceToPlain=instanceToPlain;function classToPlainFromExist(e,t,n){return a.classToPlainFromExist(e,t,n)}t.classToPlainFromExist=classToPlainFromExist;function plainToClass(e,t,n){return a.plainToInstance(e,t,n)}t.plainToClass=plainToClass;function plainToInstance(e,t,n){return a.plainToInstance(e,t,n)}t.plainToInstance=plainToInstance;function plainToClassFromExist(e,t,n){return a.plainToClassFromExist(e,t,n)}t.plainToClassFromExist=plainToClassFromExist;function instanceToInstance(e,t){return a.instanceToInstance(e,t)}t.instanceToInstance=instanceToInstance;function classToClassFromExist(e,t,n){return a.classToClassFromExist(e,t,n)}t.classToClassFromExist=classToClassFromExist;function serialize(e,t){return a.serialize(e,t)}t.serialize=serialize;function deserialize(e,t,n){return a.deserialize(e,t,n)}t.deserialize=deserialize;function deserializeArray(e,t,n){return a.deserializeArray(e,t,n)}t.deserializeArray=deserializeArray},3159:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},4196:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},165:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},7023:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},2315:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},4597:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},3715:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},6400:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(7023),t);r(n(165),t);r(n(2315),t);r(n(4597),t);r(n(3715),t);r(n(9991),t);r(n(9995),t);r(n(1973),t);r(n(1413),t);r(n(1387),t);r(n(3159),t);r(n(4196),t);r(n(2549),t);r(n(2334),t)},9991:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},9995:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1413:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1973:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1387:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},2549:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},2334:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},306:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.defaultMetadataStorage=void 0;const s=n(1665);t.defaultMetadataStorage=new s.MetadataStorage},9091:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getGlobal=void 0;function getGlobal(){if(typeof globalThis!=="undefined"){return globalThis}if(typeof global!=="undefined"){return global}if(typeof window!=="undefined"){return window}if(typeof self!=="undefined"){return self}}t.getGlobal=getGlobal},1693:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(9091),t);r(n(879),t)},879:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isPromise=void 0;function isPromise(e){return e!==null&&typeof e==="object"&&typeof e.then==="function"}t.isPromise=isPromise},6872:(e,t,n)=>{const s=n(4953);const r={};for(const e of Object.keys(s)){r[s[e]]=e}const i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=i;for(const e of Object.keys(i)){if(!("channels"in i[e])){throw new Error("missing channels property: "+e)}if(!("labels"in i[e])){throw new Error("missing channel labels property: "+e)}if(i[e].labels.length!==i[e].channels){throw new Error("channel and label counts mismatch: "+e)}const{channels:t,labels:n}=i[e];delete i[e].channels;delete i[e].labels;Object.defineProperty(i[e],"channels",{value:t});Object.defineProperty(i[e],"labels",{value:n})}i.rgb.hsl=function(e){const t=e[0]/255;const n=e[1]/255;const s=e[2]/255;const r=Math.min(t,n,s);const i=Math.max(t,n,s);const o=i-r;let a;let c;if(i===r){a=0}else if(t===i){a=(n-s)/o}else if(n===i){a=2+(s-t)/o}else if(s===i){a=4+(t-n)/o}a=Math.min(a*60,360);if(a<0){a+=360}const l=(r+i)/2;if(i===r){c=0}else if(l<=.5){c=o/(i+r)}else{c=o/(2-i-r)}return[a,c*100,l*100]};i.rgb.hsv=function(e){let t;let n;let s;let r;let i;const o=e[0]/255;const a=e[1]/255;const c=e[2]/255;const l=Math.max(o,a,c);const u=l-Math.min(o,a,c);const diffc=function(e){return(l-e)/6/u+1/2};if(u===0){r=0;i=0}else{i=u/l;t=diffc(o);n=diffc(a);s=diffc(c);if(o===l){r=s-n}else if(a===l){r=1/3+t-s}else if(c===l){r=2/3+n-t}if(r<0){r+=1}else if(r>1){r-=1}}return[r*360,i*100,l*100]};i.rgb.hwb=function(e){const t=e[0];const n=e[1];let s=e[2];const r=i.rgb.hsl(e)[0];const o=1/255*Math.min(t,Math.min(n,s));s=1-1/255*Math.max(t,Math.max(n,s));return[r,o*100,s*100]};i.rgb.cmyk=function(e){const t=e[0]/255;const n=e[1]/255;const s=e[2]/255;const r=Math.min(1-t,1-n,1-s);const i=(1-t-r)/(1-r)||0;const o=(1-n-r)/(1-r)||0;const a=(1-s-r)/(1-r)||0;return[i*100,o*100,a*100,r*100]};function comparativeDistance(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){const t=r[e];if(t){return t}let n=Infinity;let i;for(const t of Object.keys(s)){const r=s[t];const o=comparativeDistance(e,r);if(o<n){n=o;i=t}}return i};i.keyword.rgb=function(e){return s[e]};i.rgb.xyz=function(e){let t=e[0]/255;let n=e[1]/255;let s=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;s=s>.04045?((s+.055)/1.055)**2.4:s/12.92;const r=t*.4124+n*.3576+s*.1805;const i=t*.2126+n*.7152+s*.0722;const o=t*.0193+n*.1192+s*.9505;return[r*100,i*100,o*100]};i.rgb.lab=function(e){const t=i.rgb.xyz(e);let n=t[0];let s=t[1];let r=t[2];n/=95.047;s/=100;r/=108.883;n=n>.008856?n**(1/3):7.787*n+16/116;s=s>.008856?s**(1/3):7.787*s+16/116;r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*s-16;const a=500*(n-s);const c=200*(s-r);return[o,a,c]};i.hsl.rgb=function(e){const t=e[0]/360;const n=e[1]/100;const s=e[2]/100;let r;let i;let o;if(n===0){o=s*255;return[o,o,o]}if(s<.5){r=s*(1+n)}else{r=s+n-s*n}const a=2*s-r;const c=[0,0,0];for(let e=0;e<3;e++){i=t+1/3*-(e-1);if(i<0){i++}if(i>1){i--}if(6*i<1){o=a+(r-a)*6*i}else if(2*i<1){o=r}else if(3*i<2){o=a+(r-a)*(2/3-i)*6}else{o=a}c[e]=o*255}return c};i.hsl.hsv=function(e){const t=e[0];let n=e[1]/100;let s=e[2]/100;let r=n;const i=Math.max(s,.01);s*=2;n*=s<=1?s:2-s;r*=i<=1?i:2-i;const o=(s+n)/2;const a=s===0?2*r/(i+r):2*n/(s+n);return[t,a*100,o*100]};i.hsv.rgb=function(e){const t=e[0]/60;const n=e[1]/100;let s=e[2]/100;const r=Math.floor(t)%6;const i=t-Math.floor(t);const o=255*s*(1-n);const a=255*s*(1-n*i);const c=255*s*(1-n*(1-i));s*=255;switch(r){case 0:return[s,c,o];case 1:return[a,s,o];case 2:return[o,s,c];case 3:return[o,a,s];case 4:return[c,o,s];case 5:return[s,o,a]}};i.hsv.hsl=function(e){const t=e[0];const n=e[1]/100;const s=e[2]/100;const r=Math.max(s,.01);let i;let o;o=(2-n)*s;const a=(2-n)*r;i=n*r;i/=a<=1?a:2-a;i=i||0;o/=2;return[t,i*100,o*100]};i.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100;let s=e[2]/100;const r=n+s;let i;if(r>1){n/=r;s/=r}const o=Math.floor(6*t);const a=1-s;i=6*t-o;if((o&1)!==0){i=1-i}const c=n+i*(a-n);let l;let u;let d;switch(o){default:case 6:case 0:l=a;u=c;d=n;break;case 1:l=c;u=a;d=n;break;case 2:l=n;u=a;d=c;break;case 3:l=n;u=c;d=a;break;case 4:l=c;u=n;d=a;break;case 5:l=a;u=n;d=c;break}return[l*255,u*255,d*255]};i.cmyk.rgb=function(e){const t=e[0]/100;const n=e[1]/100;const s=e[2]/100;const r=e[3]/100;const i=1-Math.min(1,t*(1-r)+r);const o=1-Math.min(1,n*(1-r)+r);const a=1-Math.min(1,s*(1-r)+r);return[i*255,o*255,a*255]};i.xyz.rgb=function(e){const t=e[0]/100;const n=e[1]/100;const s=e[2]/100;let r;let i;let o;r=t*3.2406+n*-1.5372+s*-.4986;i=t*-.9689+n*1.8758+s*.0415;o=t*.0557+n*-.204+s*1.057;r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92;i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92;o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92;r=Math.min(Math.max(0,r),1);i=Math.min(Math.max(0,i),1);o=Math.min(Math.max(0,o),1);return[r*255,i*255,o*255]};i.xyz.lab=function(e){let t=e[0];let n=e[1];let s=e[2];t/=95.047;n/=100;s/=108.883;t=t>.008856?t**(1/3):7.787*t+16/116;n=n>.008856?n**(1/3):7.787*n+16/116;s=s>.008856?s**(1/3):7.787*s+16/116;const r=116*n-16;const i=500*(t-n);const o=200*(n-s);return[r,i,o]};i.lab.xyz=function(e){const t=e[0];const n=e[1];const s=e[2];let r;let i;let o;i=(t+16)/116;r=n/500+i;o=i-s/200;const a=i**3;const c=r**3;const l=o**3;i=a>.008856?a:(i-16/116)/7.787;r=c>.008856?c:(r-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;r*=95.047;i*=100;o*=108.883;return[r,i,o]};i.lab.lch=function(e){const t=e[0];const n=e[1];const s=e[2];let r;const i=Math.atan2(s,n);r=i*360/2/Math.PI;if(r<0){r+=360}const o=Math.sqrt(n*n+s*s);return[t,o,r]};i.lch.lab=function(e){const t=e[0];const n=e[1];const s=e[2];const r=s/360*2*Math.PI;const i=n*Math.cos(r);const o=n*Math.sin(r);return[t,i,o]};i.rgb.ansi16=function(e,t=null){const[n,s,r]=e;let o=t===null?i.rgb.hsv(e)[2]:t;o=Math.round(o/50);if(o===0){return 30}let a=30+(Math.round(r/255)<<2|Math.round(s/255)<<1|Math.round(n/255));if(o===2){a+=60}return a};i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])};i.rgb.ansi256=function(e){const t=e[0];const n=e[1];const s=e[2];if(t===n&&n===s){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}const r=16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(s/255*5);return r};i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}const n=(~~(e>50)+1)*.5;const s=(t&1)*n*255;const r=(t>>1&1)*n*255;const i=(t>>2&1)*n*255;return[s,r,i]};i.ansi256.rgb=function(e){if(e>=232){const t=(e-232)*10+8;return[t,t,t]}e-=16;let t;const n=Math.floor(e/36)/5*255;const s=Math.floor((t=e%36)/6)/5*255;const r=t%6/5*255;return[n,s,r]};i.rgb.hex=function(e){const t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);const n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};i.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}let n=t[0];if(t[0].length===3){n=n.split("").map((e=>e+e)).join("")}const s=parseInt(n,16);const r=s>>16&255;const i=s>>8&255;const o=s&255;return[r,i,o]};i.rgb.hcg=function(e){const t=e[0]/255;const n=e[1]/255;const s=e[2]/255;const r=Math.max(Math.max(t,n),s);const i=Math.min(Math.min(t,n),s);const o=r-i;let a;let c;if(o<1){a=i/(1-o)}else{a=0}if(o<=0){c=0}else if(r===t){c=(n-s)/o%6}else if(r===n){c=2+(s-t)/o}else{c=4+(t-n)/o}c/=6;c%=1;return[c*360,o*100,a*100]};i.hsl.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const s=n<.5?2*t*n:2*t*(1-n);let r=0;if(s<1){r=(n-.5*s)/(1-s)}return[e[0],s*100,r*100]};i.hsv.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const s=t*n;let r=0;if(s<1){r=(n-s)/(1-s)}return[e[0],s*100,r*100]};i.hcg.rgb=function(e){const t=e[0]/360;const n=e[1]/100;const s=e[2]/100;if(n===0){return[s*255,s*255,s*255]}const r=[0,0,0];const i=t%1*6;const o=i%1;const a=1-o;let c=0;switch(Math.floor(i)){case 0:r[0]=1;r[1]=o;r[2]=0;break;case 1:r[0]=a;r[1]=1;r[2]=0;break;case 2:r[0]=0;r[1]=1;r[2]=o;break;case 3:r[0]=0;r[1]=a;r[2]=1;break;case 4:r[0]=o;r[1]=0;r[2]=1;break;default:r[0]=1;r[1]=0;r[2]=a}c=(1-n)*s;return[(n*r[0]+c)*255,(n*r[1]+c)*255,(n*r[2]+c)*255]};i.hcg.hsv=function(e){const t=e[1]/100;const n=e[2]/100;const s=t+n*(1-t);let r=0;if(s>0){r=t/s}return[e[0],r*100,s*100]};i.hcg.hsl=function(e){const t=e[1]/100;const n=e[2]/100;const s=n*(1-t)+.5*t;let r=0;if(s>0&&s<.5){r=t/(2*s)}else if(s>=.5&&s<1){r=t/(2*(1-s))}return[e[0],r*100,s*100]};i.hcg.hwb=function(e){const t=e[1]/100;const n=e[2]/100;const s=t+n*(1-t);return[e[0],(s-t)*100,(1-s)*100]};i.hwb.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const s=1-n;const r=s-t;let i=0;if(r<1){i=(s-r)/(1-r)}return[e[0],r*100,i*100]};i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};i.gray.hsl=function(e){return[0,0,e[0]]};i.gray.hsv=i.gray.hsl;i.gray.hwb=function(e){return[0,100,e[0]]};i.gray.cmyk=function(e){return[0,0,0,e[0]]};i.gray.lab=function(e){return[e[0],0,0]};i.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255;const n=(t<<16)+(t<<8)+t;const s=n.toString(16).toUpperCase();return"000000".substring(s.length)+s};i.rgb.gray=function(e){const t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},4185:(e,t,n)=>{const s=n(6872);const r=n(4200);const i={};const o=Object.keys(s);function wrapRaw(e){const wrappedFn=function(...t){const n=t[0];if(n===undefined||n===null){return n}if(n.length>1){t=n}return e(t)};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}function wrapRounded(e){const wrappedFn=function(...t){const n=t[0];if(n===undefined||n===null){return n}if(n.length>1){t=n}const s=e(t);if(typeof s==="object"){for(let e=s.length,t=0;t<e;t++){s[t]=Math.round(s[t])}}return s};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}o.forEach((e=>{i[e]={};Object.defineProperty(i[e],"channels",{value:s[e].channels});Object.defineProperty(i[e],"labels",{value:s[e].labels});const t=r(e);const n=Object.keys(t);n.forEach((n=>{const s=t[n];i[e][n]=wrapRounded(s);i[e][n].raw=wrapRaw(s)}))}));e.exports=i},4200:(e,t,n)=>{const s=n(6872);function buildGraph(){const e={};const t=Object.keys(s);for(let n=t.length,s=0;s<n;s++){e[t[s]]={distance:-1,parent:null}}return e}function deriveBFS(e){const t=buildGraph();const n=[e];t[e].distance=0;while(n.length){const e=n.pop();const r=Object.keys(s[e]);for(let s=r.length,i=0;i<s;i++){const s=r[i];const o=t[s];if(o.distance===-1){o.distance=t[e].distance+1;o.parent=e;n.unshift(s)}}}return t}function link(e,t){return function(n){return t(e(n))}}function wrapConversion(e,t){const n=[t[e].parent,e];let r=s[t[e].parent][e];let i=t[e].parent;while(t[i].parent){n.unshift(t[i].parent);r=link(s[t[i].parent][i],r);i=t[i].parent}r.conversion=n;return r}e.exports=function(e){const t=deriveBFS(e);const n={};const s=Object.keys(t);for(let e=s.length,r=0;r<e;r++){const e=s[r];const i=t[e];if(i.parent===null){continue}n[e]=wrapConversion(e,t)}return n}},4953:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},6110:(e,t,n)=>{t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.storage=localstorage();t.destroy=(()=>{let e=false;return()=>{if(!e){e=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}let e;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(t){t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff);if(!this.useColors){return}const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let s=0;let r=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{if(e==="%%"){return}s++;if(e==="%c"){r=s}}));t.splice(r,0,n)}t.log=console.debug||console.log||(()=>{});function save(e){try{if(e){t.storage.setItem("debug",e)}else{t.storage.removeItem("debug")}}catch(e){}}function load(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function localstorage(){try{return localStorage}catch(e){}}e.exports=n(897)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},897:(e,t,n)=>{function setup(e){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=n(744);createDebug.destroy=destroy;Object.keys(e).forEach((t=>{createDebug[t]=e[t]}));createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(e){let t=0;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n);t|=0}return createDebug.colors[Math.abs(t)%createDebug.colors.length]}createDebug.selectColor=selectColor;function createDebug(e){let t;let n=null;let s;let r;function debug(...e){if(!debug.enabled){return}const n=debug;const s=Number(new Date);const r=s-(t||s);n.diff=r;n.prev=t;n.curr=s;t=s;e[0]=createDebug.coerce(e[0]);if(typeof e[0]!=="string"){e.unshift("%O")}let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,s)=>{if(t==="%%"){return"%"}i++;const r=createDebug.formatters[s];if(typeof r==="function"){const s=e[i];t=r.call(n,s);e.splice(i,1);i--}return t}));createDebug.formatArgs.call(n,e);const o=n.log||createDebug.log;o.apply(n,e)}debug.namespace=e;debug.useColors=createDebug.useColors();debug.color=createDebug.selectColor(e);debug.extend=extend;debug.destroy=createDebug.destroy;Object.defineProperty(debug,"enabled",{enumerable:true,configurable:false,get:()=>{if(n!==null){return n}if(s!==createDebug.namespaces){s=createDebug.namespaces;r=createDebug.enabled(e)}return r},set:e=>{n=e}});if(typeof createDebug.init==="function"){createDebug.init(debug)}return debug}function extend(e,t){const n=createDebug(this.namespace+(typeof t==="undefined"?":":t)+e);n.log=this.log;return n}function enable(e){createDebug.save(e);createDebug.namespaces=e;createDebug.names=[];createDebug.skips=[];const t=(typeof e==="string"?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of t){if(e[0]==="-"){createDebug.skips.push(e.slice(1))}else{createDebug.names.push(e)}}}function matchesTemplate(e,t){let n=0;let s=0;let r=-1;let i=0;while(n<e.length){if(s<t.length&&(t[s]===e[n]||t[s]==="*")){if(t[s]==="*"){r=s;i=n;s++}else{n++;s++}}else if(r!==-1){s=r+1;i++;n=i}else{return false}}while(s<t.length&&t[s]==="*"){s++}return s===t.length}function disable(){const e=[...createDebug.names,...createDebug.skips.map((e=>"-"+e))].join(",");createDebug.enable("");return e}function enabled(e){for(const t of createDebug.skips){if(matchesTemplate(e,t)){return false}}for(const t of createDebug.names){if(matchesTemplate(e,t)){return true}}return false}function coerce(e){if(e instanceof Error){return e.stack||e.message}return e}function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}createDebug.enable(createDebug.load());return createDebug}e.exports=setup},2830:(e,t,n)=>{if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){e.exports=n(6110)}else{e.exports=n(5108)}},5108:(e,t,n)=>{const s=n(2018);const r=n(9023);t.init=init;t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");t.colors=[6,2,3,4,5,1];try{const e=n(1450);if(e&&(e.stderr||e).level>=2){t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let s=process.env[t];if(/^(yes|on|true|enabled)$/i.test(s)){s=true}else if(/^(no|off|false|disabled)$/i.test(s)){s=false}else if(s==="null"){s=null}else{s=Number(s)}e[n]=s;return e}),{});function useColors(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):s.isatty(process.stderr.fd)}function formatArgs(t){const{namespace:n,useColors:s}=this;if(s){const s=this.color;const r="[3"+(s<8?s:"8;5;"+s);const i=` ${r};1m${n} `;t[0]=i+t[0].split("\n").join("\n"+i);t.push(r+"m+"+e.exports.humanize(this.diff)+"")}else{t[0]=getDate()+n+" "+t[0]}}function getDate(){if(t.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...e){return process.stderr.write(r.formatWithOptions(t.inspectOpts,...e)+"\n")}function save(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let s=0;s<n.length;s++){e.inspectOpts[n[s]]=t.inspectOpts[n[s]]}}e.exports=n(897)(t);const{formatters:i}=e.exports;i.o=function(e){this.inspectOpts.colors=this.useColors;return r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")};i.O=function(e){this.inspectOpts.colors=this.useColors;return r.inspect(e,this.inspectOpts)}},872:e=>{"use strict";e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}},3430:e=>{"use strict";e.exports=function equal(e,t){if(e===t)return true;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return false;var n,s,r;if(Array.isArray(e)){n=e.length;if(n!=t.length)return false;for(s=n;s--!==0;)if(!equal(e[s],t[s]))return false;return true}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();r=Object.keys(e);n=r.length;if(n!==Object.keys(t).length)return false;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[s]))return false;for(s=n;s--!==0;){var i=r[s];if(!equal(e[i],t[i]))return false}return true}return e!==e&&t!==t}},3070:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Background=void 0;const s=n(5374);const r=n(8492);const i=n(8964);const o=n(7600);const a=(0,o.getDebugger)("Background");class Background extends r.Element{static parse(e,t){var n,s,r,o,c;a("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!e.background){throw new TypeError("The given object is not a Background!")}const{keyword:l,name:u,description:d,steps:f,location:p}=e.background;const h=new Background(l,u,d);h.precedingComment=t===null||t===void 0?void 0:t.parseComment(p);h.steps=i.Step.parseAll(f,t);h.descriptionComment=t===null||t===void 0?void 0:t.parseCommentBetween(p,(s=f===null||f===void 0?void 0:f[0])===null||s===void 0?void 0:s.location);a("parse(this: {keyword: '%s', name: '%s', description: '%s', step: %d, precedingComment: '%s', descriptionComment: '%s'})",h.keyword,h.name,h.description,(r=h.steps)===null||r===void 0?void 0:r.length,(o=h.precedingComment)===null||o===void 0?void 0:o.text,(c=h.descriptionComment)===null||c===void 0?void 0:c.text);return h}clone(){var e,t,n;a("clone(this: {keyword: '%s', name: '%s', description: '%s', step: %d, precedingComment: '%s', descriptionComment: '%s'})",this.keyword,this.name,this.description,(e=this.steps)===null||e===void 0?void 0:e.length,(t=this.precedingComment)===null||t===void 0?void 0:t.text,(n=this.descriptionComment)===null||n===void 0?void 0:n.text);const r=new Background(this.keyword,this.name,this.description);r.steps=(0,s.cloneArray)(this.steps);r.precedingComment=this.precedingComment?this.precedingComment.clone():null;r.descriptionComment=this.descriptionComment?this.descriptionComment.clone():null;return r}}t.Background=Background},3385:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Comment=void 0;const s=n(5374);const r=n(6294);const i=n(7600);const o=(0,i.getDebugger)("Comment");class Comment extends r.UniqueObject{static parse(...e){o("parse(objs: %d)",e.length);if(!e.length||e.some((e=>!e.text))){throw new TypeError("The given object is not a Comment!")}const t=new Comment(e.map((e=>e.text)).join("\n"));o("parse(this: {text: '%s'})",t.text);return t}constructor(e){super();o("constructor(text: '%s')",e);this.text=(0,s.prefixString)((0,s.normalizeString)(e),"#")}clone(){o("clone()");return new Comment(this.text)}replace(e,t){o("replace(key: '%s', value: '%s')",e,t);this.text=(0,s.replaceAll)(this.text,e,t)}toString(){o("toString()");return this.text}}t.Comment=Comment},1524:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DataTable=void 0;const s=n(5374);const r=n(5198);const i=n(6294);const o=n(7600);const a=(0,o.getDebugger)("DataTable");class DataTable extends i.UniqueObject{static parse(e,t){var n,s;a("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!Array.isArray(e.rows)){throw new Error("The given object is not a DataTable!")}const i=new DataTable;i.rows=r.TableRow.parseAll(e.rows,t);a("parse(this: {rows: %d})",(s=i.rows)===null||s===void 0?void 0:s.length);return i}constructor(e=[]){super();this.rows=e;a("constructor(rows: %d)",e.length)}clone(){var e;a("clone(this: {rows: %d})",(e=this.rows)===null||e===void 0?void 0:e.length);return new DataTable((0,s.cloneArray)(this.rows))}replace(e,t){a("replace(key: '%s', value: '%s')",e,t);(0,s.replaceArray)(this.rows,e,t)}}t.DataTable=DataTable},559:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DocString=void 0;const s=n(5374);const r=n(6294);const i=n(7600);const o=(0,i.getDebugger)("DocString");class DocString extends r.UniqueObject{static parse(e,t){var n,s;o("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||e.content===undefined){throw new TypeError("The given object is not a DocString!")}const r=new DocString(e.content,e.delimiter,e.mediaType);r.comment=t===null||t===void 0?void 0:t.parseComment(e.location);o("parse(this: {content: '%s', delimiter: '%s', mediaType: '%s', comment: '%s'})",r.content,r.delimiter,r.mediaType,(s=r.comment)===null||s===void 0?void 0:s.text);return r}constructor(e,t='"""',n=null){super();o("constructor(content: '%s', delimiter: '%s', mediaType: '%s')",e,t,n);this.content=(0,s.normalizeString)(e);this.delimiter=t;this.mediaType=n}clone(){var e;o("clone(this: {content: '%s', delimiter: '%s', mediaType: '%s', comment: '%s'})",this.content,this.delimiter,this.mediaType,(e=this.comment)===null||e===void 0?void 0:e.text);const t=new DocString(this.content,this.delimiter,this.mediaType);t.comment=this.comment?this.comment.clone():null;return t}replace(e,t){o("replace(key: '%s', value: '%s')",e,t);this.content=(0,s.replaceAll)(this.content,e,t);this.comment&&this.comment.replace(e,t)}}t.DocString=DocString},8492:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Element=t.REPEAT_STEP_KEYWORDS=void 0;const s=n(5374);const r=n(6294);const i=n(7600);const o=(0,i.getDebugger)("Element");t.REPEAT_STEP_KEYWORDS=["And","But","*"];class Element extends r.UniqueObject{constructor(e,t,n){super();o("constructor(keyword: '%s', name: '%s', description: '%s')",e,t,n);this.keyword=(0,s.normalizeString)(e);this.name=(0,s.normalizeString)(t);this.description=(0,s.normalizeString)(n);this.steps=[];this.precedingComment=null;this.descriptionComment=null}clone(){o("clone()");throw new Error("Not implemented")}replace(e,t){o("replace(key: '%s', value: '%s')",e,t);this.name=(0,s.replaceAll)(this.name,e,t);this.description=(0,s.replaceAll)(this.description,e,t);(0,s.replaceArray)(this.steps,e,t);this.precedingComment&&this.precedingComment.replace(e,t);this.descriptionComment&&this.descriptionComment.replace(e,t)}useNormalStepKeywords(){o("useNormalStepKeywords()");this.steps.forEach(((e,n)=>{if(n&&t.REPEAT_STEP_KEYWORDS.indexOf(e.keyword)>-1){e.keyword=this.steps[n-1].keyword}}))}useReadableStepKeywords(){o("useReadableStepKeywords()");this.useNormalStepKeywords();for(let e=this.steps.length-1;e>0;--e){if(this.steps[e].keyword===this.steps[e-1].keyword){this.steps[e].keyword="And"}}}}t.Element=Element},4777:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Examples=void 0;const s=n(5374);const r=n(5198);const i=n(6984);const o=n(6294);const a=n(7600);const c=(0,a.getDebugger)("Examples");class Examples extends o.UniqueObject{static parse(e,t){var n,s,o,a,l,u,d,f;c("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!Array.isArray(e.tableBody)){throw new TypeError("The given obj is not an Examples!")}const{location:p,tags:h,tableHeader:m,tableBody:g,keyword:y,name:b}=e;const v=new Examples(y,b);v.precedingComment=t===null||t===void 0?void 0:t.parseComment(p,(s=h===null||h===void 0?void 0:h[h.length-1])===null||s===void 0?void 0:s.location);v.tagComment=t===null||t===void 0?void 0:t.parseTagComment(h);v.tags=i.Tag.parseAll(h,t);if(m){v.header=r.TableRow.parse(m,t)}v.body=r.TableRow.parseAll(g,t);c("parse(this: {keyword: '%s', name: '%s', tags: %d, header: %d, body: %d, precedingComment: '%s', tagComment: '%s'})",v.keyword,v.name,(o=v.tags)===null||o===void 0?void 0:o.length,(l=(a=v.header)===null||a===void 0?void 0:a.cells)===null||l===void 0?void 0:l.length,(u=v.body)===null||u===void 0?void 0:u.length,(d=v.precedingComment)===null||d===void 0?void 0:d.text,(f=v.tagComment)===null||f===void 0?void 0:f.text);return v}constructor(e,t){super();c("constructor(keyword: '%s', name: '%s')",e,t);this.keyword=(0,s.normalizeString)(e);this.name=(0,s.normalizeString)(t);this.header=null;this.precedingComment=null;this.tagComment=null;this.tags=[];this.body=[]}clone(){var e,t,n,r,i,o;c("clone(this: {keyword: '%s', name: '%s', tags: %d, header: %d, body: %d, precedingComment: '%s', tagComment: '%s'})",this.keyword,this.name,(e=this.tags)===null||e===void 0?void 0:e.length,(n=(t=this.header)===null||t===void 0?void 0:t.cells)===null||n===void 0?void 0:n.length,(r=this.body)===null||r===void 0?void 0:r.length,(i=this.precedingComment)===null||i===void 0?void 0:i.text,(o=this.tagComment)===null||o===void 0?void 0:o.text);const a=new Examples(this.keyword,this.name);a.header=this.header?this.header.clone():null;a.precedingComment=this.precedingComment?this.precedingComment.clone():null;a.tagComment=this.tagComment?this.tagComment.clone():null;a.tags=(0,s.cloneArray)(this.tags);a.body=(0,s.cloneArray)(this.body);return a}replace(e,t){c("replace(key: '%s', value: '%s')",e,t);this.name=(0,s.replaceAll)(this.name,e,t);this.header&&this.header.replace(e,t);this.precedingComment&&this.precedingComment.replace(e,t);this.tagComment&&this.tagComment.replace(e,t);(0,s.replaceArray)(this.tags,e,t);(0,s.replaceArray)(this.body,e,t)}}t.Examples=Examples},8950:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Feature=void 0;const s=n(5374);const r=n(9866);const i=n(3070);const o=n(8264);const a=n(6092);const c=n(3240);const l=n(6984);const u=n(6294);const d=n(7600);const f=(0,d.getDebugger)("Feature");class Feature extends u.UniqueObject{static parse(e,t){var n,s,u,d,p,h,m;f("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!Array.isArray(e.children)){throw new TypeError("The given object is not a Feature!")}const{keyword:g,language:y,description:b,children:v,name:w,tags:T,location:S}=e;const k=new Feature(g,w,b,y);k.precedingComment=t===null||t===void 0?void 0:t.parseComment(S,(s=T===null||T===void 0?void 0:T[T.length-1])===null||s===void 0?void 0:s.location);k.tagComment=t===null||t===void 0?void 0:t.parseTagComment(T);k.tags=l.Tag.parseAll(T,t);let D=null;k.elements=v.map((e=>{var n,s,l,u;if((0,r.isGherkinRule)(e)){if(!D){D=e.rule.location}return o.Rule.parse(e,t)}if((0,r.isGherkinBackground)(e)){if(!D){D=(n=e.background)===null||n===void 0?void 0:n.location}return i.Background.parse(e,t)}if((0,r.isGherkinScenario)(e)){if(!D){D=(s=e.scenario)===null||s===void 0?void 0:s.location}if((u=(l=e.scenario)===null||l===void 0?void 0:l.examples)===null||u===void 0?void 0:u.length){return c.ScenarioOutline.parse(e,t)}return a.Scenario.parse(e,t)}}));k.descriptionComment=t===null||t===void 0?void 0:t.parseCommentBetween(S,D);f("parse(this: {keyword: '%s', name: '%s', description: '%s', language: '%s', "+"precedingComment: '%s', tagComment: '%s', desctiptionComment: '%s', "+"tags: %d, elements: %d})",k.keyword,k.name,k.description,k.language,(u=k.precedingComment)===null||u===void 0?void 0:u.text,(d=k.tagComment)===null||d===void 0?void 0:d.text,(p=k.descriptionComment)===null||p===void 0?void 0:p.text,(h=k.tags)===null||h===void 0?void 0:h.length,(m=k.elements)===null||m===void 0?void 0:m.length);return k}constructor(e,t,n,r="en"){var i,o,a,c,l;super();f("constructor(keyword: '%s', name: '%s', description: '%s', language: '%s')",e,t,n,r);this.language=r;this.keyword=(0,s.normalizeString)(e);this.name=(0,s.normalizeString)(t);this.description=(0,s.normalizeString)(n);this.elements=[];this.tags=[];this.precedingComment=null;this.tagComment=null;this.descriptionComment=null;f("constructor(this: {keyword: '%s', name: '%s', description: '%s', language: '%s', "+"precedingComment: '%s', tagComment: '%s', desctiptionComment: '%s', "+"tags: %d, elements: %d})",this.keyword,this.name,this.description,this.language,(i=this.precedingComment)===null||i===void 0?void 0:i.text,(o=this.tagComment)===null||o===void 0?void 0:o.text,(a=this.descriptionComment)===null||a===void 0?void 0:a.text,(c=this.tags)===null||c===void 0?void 0:c.length,(l=this.elements)===null||l===void 0?void 0:l.length)}clone(){var e,t,n,r,i;f("clone(this: {keyword: '%s', name: '%s', description: '%s', language: '%s', "+"precedingComment: '%s', tagComment: '%s', desctiptionComment: '%s', "+"tags: %d, elements: %d})",this.keyword,this.name,this.description,this.language,(e=this.precedingComment)===null||e===void 0?void 0:e.text,(t=this.tagComment)===null||t===void 0?void 0:t.text,(n=this.descriptionComment)===null||n===void 0?void 0:n.text,(r=this.tags)===null||r===void 0?void 0:r.length,(i=this.elements)===null||i===void 0?void 0:i.length);const o=new Feature(this.keyword,this.name,this.description,this.language);o.tags=(0,s.cloneArray)(this.tags);o.elements=(0,s.cloneArray)(this.elements);o.precedingComment=this.precedingComment?this.precedingComment.clone():null;o.tagComment=this.tagComment?this.tagComment.clone():null;o.descriptionComment=this.descriptionComment?this.descriptionComment.clone():null;return o}replace(e,t){f("replace(key: '%s', value: '%s')",e,t);this.name=(0,s.replaceAll)(this.name,e,t);this.description=(0,s.replaceAll)(this.description,e,t);(0,s.replaceArray)(this.tags,e,t);(0,s.replaceArray)(this.elements,e,t);this.precedingComment&&this.precedingComment.replace(e,t);this.tagComment&&this.tagComment.replace(e,t);this.descriptionComment&&this.descriptionComment.replace(e,t)}}t.Feature=Feature},8947:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Document=void 0;const s=n(5374);const r=n(8950);const i=n(6294);const o=n(6928);const a=n(7600);const c=(0,a.getDebugger)("Document");class Document extends i.UniqueObject{static parse(e){var t,n,i,o;c("parse(obj: %o)",e);if(!e||!e.gherkinDocument){throw new TypeError("The given object is not a GherkinDocument!")}const a=new s.GherkinCommentHandler((t=e.gherkinDocument)===null||t===void 0?void 0:t.comments);const l=new Document(e.gherkinDocument.uri);l.feature=r.Feature.parse(e.gherkinDocument.feature,a);l.startComment=a.parseStartingComment();l.endComment=a.parseEndingComment();c("parse(this: {uri: '%s', feature: '%s', startComment: '%s', endComment: '%s'})",l.uri,(n=l.feature)===null||n===void 0?void 0:n.name,(i=l.startComment)===null||i===void 0?void 0:i.text,(o=l.endComment)===null||o===void 0?void 0:o.text);return l}constructor(e,t=null){var n,s,r;super();this.feature=t;this.startComment=null;this.endComment=null;this.uri=e;this.sourceFile=(0,o.basename)(e);this.sourceFolder=(0,o.dirname)(e);this.targetFile=this.sourceFile;this.targetFolder=this.sourceFolder;c("constructor(this: {uri: '%s', sourceFile: '%s', sourceFolder: '%s', "+"targetFile: '%s', targetFolder: '%s', "+"feature: '%s', startComment: '%s', endComment: '%s'})",this.uri,this.sourceFile,this.sourceFolder,this.targetFile,this.targetFolder,(n=this.feature)===null||n===void 0?void 0:n.name,(s=this.startComment)===null||s===void 0?void 0:s.text,(r=this.endComment)===null||r===void 0?void 0:r.text)}clone(){var e,t,n;c("clone(this: {uri: '%s', sourceFile: '%s', sourceFolder: '%s', "+"targetFile: '%s', targetFolder: '%s', "+"feature: '%s', startComment: '%s', endComment: '%s'})",this.uri,this.sourceFile,this.sourceFolder,this.targetFile,this.targetFolder,(e=this.feature)===null||e===void 0?void 0:e.name,(t=this.startComment)===null||t===void 0?void 0:t.text,(n=this.endComment)===null||n===void 0?void 0:n.text);const s=new Document(this.uri);s.feature=this.feature?this.feature.clone():null;s.startComment=this.startComment?this.startComment.clone():null;s.endComment=this.endComment?this.endComment.clone():null;return s}replace(e,t){c("replace(key: '%s', value: '%s')",e,t);this.feature&&this.feature.replace(e,t);this.startComment&&this.startComment.replace(e,t);this.endComment&&this.endComment.replace(e,t)}}t.Document=Document},8264:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Rule=void 0;const s=n(5374);const r=n(9866);const i=n(3070);const o=n(6092);const a=n(3240);const c=n(6984);const l=n(6294);const u=n(7600);const d=(0,u.getDebugger)("Rule");class Rule extends l.UniqueObject{static parse(e,t){var n,s,l,u,f,p,h;d("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!e.rule||!Array.isArray(e.rule.children)){throw new TypeError("The given object is not a Rule!")}const{keyword:m,description:g,children:y,name:b,tags:v,location:w}=e.rule;const T=new Rule(m,b,g);T.precedingComment=t===null||t===void 0?void 0:t.parseComment(w,(s=v===null||v===void 0?void 0:v[v.length-1])===null||s===void 0?void 0:s.location);T.tagComment=t===null||t===void 0?void 0:t.parseTagComment(v);T.tags=c.Tag.parseAll(v,t);let S=null;T.elements=y.map((e=>{var n,s,c,l;if((0,r.isGherkinBackground)(e)){if(!S){S=(n=e.background)===null||n===void 0?void 0:n.location}return i.Background.parse(e,t)}if((0,r.isGherkinScenario)(e)){if(!S){S=(s=e.scenario)===null||s===void 0?void 0:s.location}if((l=(c=e.scenario)===null||c===void 0?void 0:c.examples)===null||l===void 0?void 0:l.length){return a.ScenarioOutline.parse(e,t)}return o.Scenario.parse(e,t)}}));T.descriptionComment=t===null||t===void 0?void 0:t.parseCommentBetween(w,S);d("parse(this: {keyword: '%s', name: '%s', description: '%s', "+"precedingComment: '%s', tagComment: '%s', desctiptionComment: '%s', "+"tags: %d, elements: %d})",T.keyword,T.name,T.description,(l=T.precedingComment)===null||l===void 0?void 0:l.text,(u=T.tagComment)===null||u===void 0?void 0:u.text,(f=T.descriptionComment)===null||f===void 0?void 0:f.text,(p=T.tags)===null||p===void 0?void 0:p.length,(h=T.elements)===null||h===void 0?void 0:h.length);return T}constructor(e,t,n){var r,i,o,a,c;super();d("constructor(keyword: '%s', name: '%s', description: '%s')",e,t,n);this.keyword=(0,s.normalizeString)(e);this.name=(0,s.normalizeString)(t);this.description=(0,s.normalizeString)(n);this.elements=[];this.tags=[];this.precedingComment=null;this.tagComment=null;this.descriptionComment=null;d("constructor(this: {keyword: '%s', name: '%s', description: '%s', "+"precedingComment: '%s', tagComment: '%s', desctiptionComment: '%s', "+"tags: %d, elements: %d})",this.keyword,this.name,this.description,(r=this.precedingComment)===null||r===void 0?void 0:r.text,(i=this.tagComment)===null||i===void 0?void 0:i.text,(o=this.descriptionComment)===null||o===void 0?void 0:o.text,(a=this.tags)===null||a===void 0?void 0:a.length,(c=this.elements)===null||c===void 0?void 0:c.length)}clone(){var e,t,n,r,i;d("clone(this: {keyword: '%s', name: '%s', description: '%s', "+"precedingComment: '%s', tagComment: '%s', desctiptionComment: '%s', "+"tags: %d, elements: %d})",this.keyword,this.name,this.description,(e=this.precedingComment)===null||e===void 0?void 0:e.text,(t=this.tagComment)===null||t===void 0?void 0:t.text,(n=this.descriptionComment)===null||n===void 0?void 0:n.text,(r=this.tags)===null||r===void 0?void 0:r.length,(i=this.elements)===null||i===void 0?void 0:i.length);const o=new Rule(this.keyword,this.name,this.description);o.precedingComment=this.precedingComment?this.precedingComment.clone():null;o.tagComment=this.tagComment?this.tagComment.clone():null;o.descriptionComment=this.descriptionComment?this.descriptionComment.clone():null;o.tags=(0,s.cloneArray)(this.tags);o.elements=(0,s.cloneArray)(this.elements);return o}replace(e,t){d("replace(key: '%s', value: '%s')",e,t);this.name=(0,s.replaceAll)(this.name,e,t);this.description=(0,s.replaceAll)(this.description,e,t);(0,s.replaceArray)(this.tags,e,t);(0,s.replaceArray)(this.elements,e,t);this.precedingComment&&this.precedingComment.replace(e,t);this.tagComment&&this.tagComment.replace(e,t);this.descriptionComment&&this.descriptionComment.replace(e,t)}}t.Rule=Rule},6092:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Scenario=void 0;const s=n(5374);const r=n(8492);const i=n(8964);const o=n(6984);const a=n(7600);const c=(0,a.getDebugger)("Scenario");class Scenario extends r.Element{static parse(e,t){var n,s,r,a,l,u,d,f,p,h;c("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!e.scenario||((r=(s=e.scenario)===null||s===void 0?void 0:s.examples)===null||r===void 0?void 0:r.length)){throw new TypeError("The given object is not a Scenario!")}const{description:m,keyword:g,name:y,steps:b,tags:v,location:w}=e.scenario;const T=new Scenario(g,y,m);T.precedingComment=t===null||t===void 0?void 0:t.parseComment(w,(a=v===null||v===void 0?void 0:v[v.length-1])===null||a===void 0?void 0:a.location);T.tagComment=t===null||t===void 0?void 0:t.parseTagComment(v);T.steps=i.Step.parseAll(b,t);T.tags=o.Tag.parseAll(v,t);T.descriptionComment=t===null||t===void 0?void 0:t.parseCommentBetween(w,(l=b===null||b===void 0?void 0:b[0])===null||l===void 0?void 0:l.location);c("parse(this: {keyword: '%s', name: '%s', description: '%s', "+"steps: %d, tags: %d, precedingComment: '%s', tagComment: '%s', "+"descriptionComment: '%s'})",T.keyword,T.name,T.description,(u=T.steps)===null||u===void 0?void 0:u.length,(d=T.tags)===null||d===void 0?void 0:d.length,(f=T.precedingComment)===null||f===void 0?void 0:f.text,(p=T.tagComment)===null||p===void 0?void 0:p.text,(h=T.descriptionComment)===null||h===void 0?void 0:h.text);return T}constructor(e,t,n){var s,r,i,o,a;super(e,t,n);c("constructor(keyword: '%s', name: '%s', description: '%s')",e,t,n);this.tags=[];this.precedingComment=null;this.tagComment=null;c("constructor(this: {keyword: '%s', name: '%s', description: '%s', "+"steps: %d, tags: %d, precedingComment: '%s', tagComment: '%s', "+"descriptionComment: '%s'})",this.keyword,this.name,this.description,(s=this.steps)===null||s===void 0?void 0:s.length,(r=this.tags)===null||r===void 0?void 0:r.length,(i=this.precedingComment)===null||i===void 0?void 0:i.text,(o=this.tagComment)===null||o===void 0?void 0:o.text,(a=this.descriptionComment)===null||a===void 0?void 0:a.text)}replace(e,t){c("replace(key: '%s', value: '%s')",e,t);super.replace(e,t);(0,s.replaceArray)(this.tags,e,t);this.tagComment&&this.tagComment.replace(e,t)}clone(){var e,t,n,r,i;c("clone(this: {keyword: '%s', name: '%s', description: '%s', "+"steps: %d, tags: %d, precedingComment: '%s', tagComment: '%s', "+"descriptionComment: '%s'})",this.keyword,this.name,this.description,(e=this.steps)===null||e===void 0?void 0:e.length,(t=this.tags)===null||t===void 0?void 0:t.length,(n=this.precedingComment)===null||n===void 0?void 0:n.text,(r=this.tagComment)===null||r===void 0?void 0:r.text,(i=this.descriptionComment)===null||i===void 0?void 0:i.text);const o=new Scenario(this.keyword,this.name,this.description);o.steps=(0,s.cloneArray)(this.steps);o.tags=(0,s.cloneArray)(this.tags);o.precedingComment=this.precedingComment?this.precedingComment.clone():null;o.tagComment=this.tagComment?this.tagComment.clone():null;o.descriptionComment=this.descriptionComment?this.descriptionComment.clone():null;return o}}t.Scenario=Scenario},3240:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ScenarioOutline=void 0;const s=n(5374);const r=n(8492);const i=n(4777);const o=n(6092);const a=n(8964);const c=n(6984);const l=n(7600);const u=(0,l.getDebugger)("ScenarioOutline");class ScenarioOutline extends r.Element{static parse(e,t){var n,s,r,o,l,d,f,p,h;u("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!e.scenario||!Array.isArray(e.scenario.examples)){throw new TypeError("The given object is not a Scenario Outline!")}const{description:m,examples:g,keyword:y,name:b,steps:v,tags:w,location:T}=e.scenario;const S=new ScenarioOutline(y,b,m);S.precedingComment=t===null||t===void 0?void 0:t.parseComment(T,(s=w===null||w===void 0?void 0:w[w.length-1])===null||s===void 0?void 0:s.location);S.tagComment=t===null||t===void 0?void 0:t.parseTagComment(w);S.steps=a.Step.parseAll(v,t);S.tags=c.Tag.parseAll(w,t);S.descriptionComment=t===null||t===void 0?void 0:t.parseCommentBetween(T,(r=v===null||v===void 0?void 0:v[0])===null||r===void 0?void 0:r.location);S.examples=g.map((e=>i.Examples.parse(e,t)));u("parse(this: {keyword: '%s', name: '%s', description: '%s', "+"steps: %d, tags: %d, examples: %d, precedingComment: '%s', tagComment: '%s', "+"descriptionComment: '%s'})",S.keyword,S.name,S.description,(o=S.steps)===null||o===void 0?void 0:o.length,(l=S.tags)===null||l===void 0?void 0:l.length,(d=S.examples)===null||d===void 0?void 0:d.length,(f=S.precedingComment)===null||f===void 0?void 0:f.text,(p=S.tagComment)===null||p===void 0?void 0:p.text,(h=S.descriptionComment)===null||h===void 0?void 0:h.text);return S}constructor(e,t,n){var s,r,i,o,a,c;super(e,t,n);u("constructor(keyword: '%s', name: '%s', description: '%s')",e,t,n);this.tags=[];this.examples=[];this.tagComment=null;u("constructor(this: {keyword: '%s', name: '%s', description: '%s', "+"steps: %d, tags: %d, examples: %d, precedingComment: '%s', tagComment: '%s', "+"descriptionComment: '%s'})",this.keyword,this.name,this.description,(s=this.steps)===null||s===void 0?void 0:s.length,(r=this.tags)===null||r===void 0?void 0:r.length,(i=this.examples)===null||i===void 0?void 0:i.length,(o=this.precedingComment)===null||o===void 0?void 0:o.text,(a=this.tagComment)===null||a===void 0?void 0:a.text,(c=this.descriptionComment)===null||c===void 0?void 0:c.text)}replace(e,t){u("replace(key: '%s', value: '%s')",e,t);super.replace(e,t);(0,s.replaceArray)(this.tags,e,t);(0,s.replaceArray)(this.examples,e,t);this.tagComment&&this.tagComment.replace(e,t)}clone(){var e,t,n,r,i,o;u("clone(this: {keyword: '%s', name: '%s', description: '%s', "+"steps: %d, tags: %d, examples: %d, precedingComment: '%s', tagComment: '%s', "+"descriptionComment: '%s'})",this.keyword,this.name,this.description,(e=this.steps)===null||e===void 0?void 0:e.length,(t=this.tags)===null||t===void 0?void 0:t.length,(n=this.examples)===null||n===void 0?void 0:n.length,(r=this.precedingComment)===null||r===void 0?void 0:r.text,(i=this.tagComment)===null||i===void 0?void 0:i.text,(o=this.descriptionComment)===null||o===void 0?void 0:o.text);const a=new ScenarioOutline(this.keyword,this.name,this.description);a.precedingComment=this.precedingComment?this.precedingComment.clone():null;a.tagComment=this.tagComment?this.tagComment.clone():null;a.descriptionComment=this.descriptionComment?this.descriptionComment.clone():null;a.tags=(0,s.cloneArray)(this.tags);a.steps=(0,s.cloneArray)(this.steps);a.examples=(0,s.cloneArray)(this.examples);return a}toScenario(e=0){u("toScenario(columnToAddAsTag: %d)",e);const t=[];this.examples.forEach((n=>{const r=Math.max(0,Math.min(n.header.cells.length-1,e));n.body.forEach((e=>{const i=new o.Scenario("Scenario",this.name,this.description);i.tags=(0,c.removeDuplicateTags)([...(0,s.cloneArray)(this.tags),...(0,s.cloneArray)(n.tags),(0,c.tag)(n.header.cells[r].value,e.cells[r].value)]);i.precedingComment=this.precedingComment?this.precedingComment.clone():null;i.tagComment=this.tagComment?this.tagComment.clone():null;i.descriptionComment=this.descriptionComment?this.descriptionComment.clone():null;i.steps=(0,s.cloneArray)(this.steps);n.header.cells.forEach(((t,n)=>{i.replace(`<${t.value}>`,e.cells[n].value)}));t.push(i)}))}));u("toScenario(scenarios: %d)",t.length);return t}}t.ScenarioOutline=ScenarioOutline},8964:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Step=void 0;const s=n(5374);const r=n(1524);const i=n(559);const o=n(6294);const a=n(7600);const c=(0,a.getDebugger)("Step");class Step extends o.UniqueObject{static parse(e,t,n){var s,o,a,l,u,d;c("parse(obj: %o, comments: %d, prevStepLocation: %d)",e,(s=t===null||t===void 0?void 0:t.comments)===null||s===void 0?void 0:s.length,n===null||n===void 0?void 0:n.line);if(!e||!e.text){throw new Error("The given object is not a Step!")}const{keyword:f,text:p,dataTable:h,docString:m,location:g}=e;const y=new Step(f,p);if(h){y.dataTable=r.DataTable.parse(h,t)}if(m){y.docString=i.DocString.parse(m,t)}if(n){y.comment=t===null||t===void 0?void 0:t.parseCommentBetween(n,g)}else{y.comment=t===null||t===void 0?void 0:t.parseComment(g)}c("parse(this: {keyword: '%s', text: '%s', dataTable: %d, docString: %d, comment: '%s'})",y.keyword,y.text,(a=(o=y.dataTable)===null||o===void 0?void 0:o.rows)===null||a===void 0?void 0:a.length,(u=(l=y.docString)===null||l===void 0?void 0:l.content)===null||u===void 0?void 0:u.length,(d=y.comment)===null||d===void 0?void 0:d.text);return y}static parseAll(e,t){var n;c("parseAll(obj: %d, comments: %d)",e===null||e===void 0?void 0:e.length,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!Array.isArray(e)){return[]}let s=null;return e.map((e=>{const n=this.parse(e,t,s);s=e.location;return n}))}constructor(e,t){var n,r,i,o,a;super();c("constructor(keyword: '%s', text: '%s')",e,t);this.keyword=(0,s.normalizeString)(e);this.text=(0,s.normalizeString)(t);this.dataTable=null;this.docString=null;this.comment=null;c("constructor(this: {keyword: '%s', text: '%s', dataTable: %d, docString: %d, comment: '%s'})",this.keyword,this.text,(r=(n=this.dataTable)===null||n===void 0?void 0:n.rows)===null||r===void 0?void 0:r.length,(o=(i=this.docString)===null||i===void 0?void 0:i.content)===null||o===void 0?void 0:o.length,(a=this.comment)===null||a===void 0?void 0:a.text)}clone(){var e,t,n,s,r;c("clone(this: {keyword: '%s', text: '%s', dataTable: %d, docString: %d, comment: '%s'})",this.keyword,this.text,(t=(e=this.dataTable)===null||e===void 0?void 0:e.rows)===null||t===void 0?void 0:t.length,(s=(n=this.docString)===null||n===void 0?void 0:n.content)===null||s===void 0?void 0:s.length,(r=this.comment)===null||r===void 0?void 0:r.text);const i=new Step(this.keyword,this.text);i.dataTable=this.dataTable?this.dataTable.clone():null;i.docString=this.docString?this.docString.clone():null;i.comment=this.comment?this.comment.clone():null;return i}replace(e,t){c("replace(key: '%s', value: '%s')",e,t);this.text=(0,s.replaceAll)(this.text,e,t);this.dataTable&&this.dataTable.replace(e,t);this.docString&&this.docString.replace(e,t);this.comment&&this.comment.replace(e,t)}}t.Step=Step},3448:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TableCell=void 0;const s=n(5374);const r=n(6294);const i=n(7600);const o=(0,i.getDebugger)("TableCell");class TableCell extends r.UniqueObject{static parse(e){o("parse(obj: %o)",e);if(!e||!("value"in e)){throw new TypeError("The given object is not a TableCell!")}const t=new TableCell(e.value);o("parse(this: {value: '%s'})",t.value);return t}constructor(e){super();this.value=e;o("constructor(value: '%s')",e)}clone(){o("clone(this: {value: '%s'})",this.value);return new TableCell(this.value)}replace(e,t){o("replace(key: '%s', value: '%s')",e,t);this.value=(0,s.replaceAll)(this.value,e,t)}}t.TableCell=TableCell},5198:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TableRow=void 0;const s=n(5374);const r=n(3448);const i=n(6294);const o=n(7600);const a=(0,o.getDebugger)("TableRow");class TableRow extends i.UniqueObject{static parse(e,t){var n,s,i;a("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!Array.isArray(e.cells)){throw new TypeError("The given object is not a TableRow!")}const{cells:o,location:c}=e;const l=new TableRow;l.cells=o===null||o===void 0?void 0:o.map(r.TableCell.parse);l.comment=t===null||t===void 0?void 0:t.parseComment(c);a("parse(this: {cells: %d, comment: '%s'})",(s=l.cells)===null||s===void 0?void 0:s.length,(i=l.comment)===null||i===void 0?void 0:i.text);return l}static parseAll(e,t){var n;a("parse(obj: %d, comments: %d)",e===null||e===void 0?void 0:e.length,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!Array.isArray(e)||!e.length){return[]}return e.map((e=>this.parse(e,t)))}constructor(e=[]){var t,n;super();this.cells=e;a("constructor(cells: %d)",e===null||e===void 0?void 0:e.length);this.comment=null;a("constructor(this: {cells: %d, comment: '%s'})",(t=this.cells)===null||t===void 0?void 0:t.length,(n=this.comment)===null||n===void 0?void 0:n.text)}clone(){var e,t;a("clone(this: {cells: %d, comment: '%s'})",(e=this.cells)===null||e===void 0?void 0:e.length,(t=this.comment)===null||t===void 0?void 0:t.text);const n=new TableRow((0,s.cloneArray)(this.cells));n.comment=this.comment?this.comment.clone():null;return n}replace(e,t){a("replace(key: '%s', value: '%s')",e,t);(0,s.replaceArray)(this.cells,e,t);this.comment&&this.comment.replace(e,t)}}t.TableRow=TableRow},6984:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.removeDuplicateTags=t.tag=t.Tag=void 0;const s=n(1860);const r=n(5133);const i=n(5374);const o=n(6294);const a=n(7600);const c=s.__importStar(n(2858));const l=(0,a.getDebugger)("Tag");const u=new Map;u.set(c.TagFormat.PARAMETERLESS,{parse(e){return new Tag(e.match(/^@?(?<name>[^@]+)$/i)[1])},toString(e){return`@${e.name}`}});u.set(c.TagFormat.FUNCTIONAL,{parse(e){const t=e.match(/^@?(?<name>[^(@]+)\((?<value>[^)]+)\)$/i);if(t){return new Tag(t[1],t[2])}return u.get(c.TagFormat.PARAMETERLESS).parse(e)},toString(e){if(e.value===undefined){return u.get(c.TagFormat.PARAMETERLESS).toString(e)}return`@${e.name}(${e.value})`}});u.set(c.TagFormat.ASSIGNMENT,{parse(e){const t=e.match(/^@?(?<name>[^=@]+)=(?<value>.+)$/i);if(t){return new Tag(t[1],t[2])}return u.get(c.TagFormat.PARAMETERLESS).parse(e)},toString(e){if(e.value===undefined){return u.get(c.TagFormat.PARAMETERLESS).toString(e)}return`@${e.name}=${e.value}`}});u.set(c.TagFormat.UNDERSCORE,{parse(e){const t=e.match(/^@?(?<name>[^_@]+)_(?<value>.+)$/i);if(t){return new Tag(t[1],t[2])}return u.get(c.TagFormat.PARAMETERLESS).parse(e)},toString(e){if(e.value===undefined){return u.get(c.TagFormat.PARAMETERLESS).toString(e)}return`@${e.name}_${e.value}`}});class Tag extends o.UniqueObject{static parse(e,t){var n,s;l("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!e.name){throw new TypeError("The given object is not a Tag!")}const r=Tag.parseString(e.name);r.comment=t===null||t===void 0?void 0:t.parseComment(e.location);l("parse(this: {name: '%s', value: '%s', comment: '%s')",r.name,r.value,(s=r.comment)===null||s===void 0?void 0:s.text);return r}static parseAll(e,t){var n;l("parseAll(obj: %d, comments: %d)",e===null||e===void 0?void 0:e.length,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!Array.isArray(e)||!e.length){return[]}return e.map((e=>this.parse(e,t)))}static parseString(e){var t;l("parseString(s: '%s')",e);if(!e||typeof e!=="string"){throw new TypeError("The given string is not a Gherkin Tag!")}const{tagFormat:n}=c.default.get();if(!u.has(n)){throw new TypeError("The given tag format is not valid!")}const s=u.get(n).parse(e);l("parseString(this: {name: '%s', value: '%s', comment: '%s')",s.name,s.value,(t=s.comment)===null||t===void 0?void 0:t.text);return s}constructor(e,t){var n;super();l("constructor(name: '%s', value: '%s')",e,t);this.name=(0,i.safeString)(e);this.value=t;this.comment=null;l("constructor(this: {name: '%s', value: '%s', comment: '%s')",this.name,this.value,(n=this.comment)===null||n===void 0?void 0:n.text)}clone(){var e;l("clone(this: {name: '%s', value: '%s', comment: '%s')",this.name,this.value,(e=this.comment)===null||e===void 0?void 0:e.text);const t=new Tag(this.name,this.value);t.comment=this.comment?this.comment.clone():null;return t}replace(e,t){l("replace(key: '%s', value: '%s')",e,t);this.name=(0,i.replaceAll)(this.name,e,t);this.value=(0,i.replaceAll)(this.value,e,t);this.comment&&this.comment.replace(e,t)}toString(){l("toString(this: {name: '%s', value: '%s')",this.name,this.value);const{tagFormat:e}=c.default.get();if(!u.has(e)){throw new TypeError("The given tag format is not valid!")}return u.get(e).toString(this)}}t.Tag=Tag;const tag=(e,t)=>{l("static tag(name: '%s', value: '%s')",e,t);return new Tag(e,t)};t.tag=tag;const removeDuplicateTags=e=>{l("static removeDuplicateTags(tags: %d)",e===null||e===void 0?void 0:e.length);const t=e.map((({name:e,value:t})=>({name:e,value:t})));return Array.from(new r(t)).map((({name:e,value:t})=>new Tag(e,t)))};t.removeDuplicateTags=removeDuplicateTags},6294:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.UniqueObject=void 0;const s=n(1914);class UniqueObject{constructor(){this._id=(0,s.v4)()}}t.UniqueObject=UniqueObject},5374:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GherkinCommentHandler=t.replaceArray=t.cloneArray=t.replaceAll=t.prefixString=t.normalizeString=t.safeString=void 0;const s=n(3385);const r=n(7600);const i=(0,r.getDebugger)("common");const safeString=(e="")=>{const t=e.replace(/\s/g,"_");i("safeString(s: '%s') => '%s'",e,t);return t};t.safeString=safeString;const normalizeString=(e="")=>{const t=e.split("\n").map((e=>e.trim())).join("\n");i("normalizeString(s: '%s') => '%s'",e,t);return t};t.normalizeString=normalizeString;const prefixString=(e="",t="",n=" ")=>{const s=e.split("\n").map((e=>!e||e.startsWith(t)?e:`${t}${n}${e}`)).join("\n");i("prefixString(s: '%s', prefix: '%s', delimiter: '%s') => '%s'",e,t,n,s);return s};t.prefixString=prefixString;const replaceAll=(e,t,n)=>{if(!(t instanceof RegExp)){t=new RegExp(t,"g")}if(!e||typeof e!=="string"){i("replaceAll(s: '%s', key: '%s', value: '%s') => '%s'",e,t,n,e);return e}const s=e.replace(t,n.replace(/\$/g,"$$$$"));i("replaceAll(s: '%s', key: '%s', value: '%s') => '%s'",e,t,n,s);return s};t.replaceAll=replaceAll;const cloneArray=e=>{i("cloneArray(array: %d)",e===null||e===void 0?void 0:e.length);return Array.isArray(e)?e.map((e=>e.clone())):[]};t.cloneArray=cloneArray;const replaceArray=(e,t,n)=>{i("replaceArray(array: %d, key: '%s', value: '%s')",e===null||e===void 0?void 0:e.length,t,n);Array.isArray(e)&&e.forEach((e=>{e.replace(t,n)}))};t.replaceArray=replaceArray;class GherkinCommentHandler{constructor(e){this.comments=e;this.debug=(0,r.getDebugger)("GherkinCommentHandler");this.debug("constructor(comments: %d)",e===null||e===void 0?void 0:e.length);this.comments=e?[...e]:[];this.firstLine=Infinity;this.lastLine=0;if(this.comments.length){this.comments.sort(((e,t)=>e.location.line-t.location.line))}this.debug("constructor(this: {comments: %d, firstLine: %d, lastLine: %d})",this.comments.length,this.firstLine,this.lastLine)}storeLine(e){this.firstLine=Math.min(this.firstLine,e);this.lastLine=Math.max(this.lastLine,e);this.debug("storeLine(line: %d) => {firstLine: %d, lastLine: %d}",e,this.firstLine,this.lastLine)}findCommentIndexBefore(e){for(let t=0;t<this.comments.length;++t){if(this.comments[t].location.line==e.line-1){this.debug("findCommentIndexBefore(location: %d) => %d",e===null||e===void 0?void 0:e.line,t);return t}}this.debug("findCommentIndexBefore(location: %d) => NOT FOUND",e===null||e===void 0?void 0:e.line);return-1}popFromIndex(e){this.debug("popFromIndex(i: %d)",e);return this.comments.splice(e,1)[0]}popCommentsRightBefore(e){this.storeLine(e.line);let t=this.findCommentIndexBefore(e);const n=[];if(t>-1){n.push(this.popFromIndex(t));for(--t;t>=0;--t){if(this.comments[t].location.line<n[0].location.line-1){break}n.unshift(this.popFromIndex(t))}}this.debug("popCommentsRightBefore(location: %d) => %d",e===null||e===void 0?void 0:e.line,n.length);return n}parseComment(e,t){if(t){return this.parseCommentBetween(t,e)}const n=this.popCommentsRightBefore(e);if(n.length){this.debug("parseComment(location: %d) => %d",e===null||e===void 0?void 0:e.line,n.length);return s.Comment.parse(...n)}this.debug("parseComment(location: %d) => NOT FOUND",e===null||e===void 0?void 0:e.line);return null}parseTagComment(e){if(!Array.isArray(e)||!e.length){this.debug("parseTagComment(tags: %d) => NOT TAGS",e===null||e===void 0?void 0:e.length);return null}this.debug("parseTagComment(tags: %d) => %d",e.length,e[0].location.line);return this.parseComment(e[0].location)}parseCommentBetween(e,t){if(!e||!t){this.debug("parseCommentBetween(locA: %d, locB: %d) => NO LOCS",e===null||e===void 0?void 0:e.line,t===null||t===void 0?void 0:t.line);return null}this.storeLine(e.line);this.storeLine(t.line);let n=0;const s=[];for(;n<this.comments.length&&this.comments[n].location.line<e.line;++n);for(;n<this.comments.length&&this.comments[n].location.line<t.line;){s.push(this.popFromIndex(n))}this.debug("parseCommentBetween(locA: %d, locB: %d) => %d",e===null||e===void 0?void 0:e.line,t===null||t===void 0?void 0:t.line,s.length);return this.parseMultiLineComment(s)}parseStartingComment(){const e=[];for(let t=0;t<this.comments.length&&this.comments[t].location.line<this.firstLine;){e.push(this.popFromIndex(t))}this.debug("parseStartingComment() => %d",e.length);return this.parseMultiLineComment(e)}parseEndingComment(){const e=[];let t=0;for(;t<this.comments.length&&this.comments[t].location.line<this.lastLine;++t);for(;t<this.comments.length;){e.push(this.popFromIndex(t))}this.debug("parseEndingComment() => %d",e.length);return this.parseMultiLineComment(e)}parseMultiLineComment(e){if(!e.length){this.debug("parseMultiLineComment(comments: %d) => NO COMMENTS",e.length);return null}const t=[];const n=e[0].location.line;for(const s of e){t[s.location.line-n]=s.text}const r=new s.Comment(t.join("\n"));this.debug("parseMultiLineComment(comments: %d) => '%s'",e.length,r.text);return r}}t.GherkinCommentHandler=GherkinCommentHandler},7600:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDebugger=void 0;const s=n(2830);const getDebugger=e=>s(`gherkin-ast:${e}`);t.getDebugger=getDebugger},9866:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isGherkinScenario=t.isGherkinBackground=t.isGherkinRule=void 0;function isGherkinRule(e){return!!e.rule}t.isGherkinRule=isGherkinRule;function isGherkinBackground(e){return!!e.background}t.isGherkinBackground=isGherkinBackground;function isGherkinScenario(e){return!!e.scenario}t.isGherkinScenario=isGherkinScenario},4367:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.config=t.TagFormat=void 0;const s=n(1860);const r=s.__importDefault(n(2858));t.config=r.default;s.__exportStar(n(9866),t);s.__exportStar(n(3070),t);s.__exportStar(n(3385),t);s.__exportStar(n(1524),t);s.__exportStar(n(559),t);s.__exportStar(n(8492),t);s.__exportStar(n(4777),t);s.__exportStar(n(8950),t);s.__exportStar(n(8947),t);s.__exportStar(n(8264),t);s.__exportStar(n(6092),t);s.__exportStar(n(3240),t);s.__exportStar(n(8964),t);s.__exportStar(n(3448),t);s.__exportStar(n(5198),t);s.__exportStar(n(6984),t);s.__exportStar(n(5374),t);s.__exportStar(n(8922),t);var i=n(2858);Object.defineProperty(t,"TagFormat",{enumerable:true,get:function(){return i.TagFormat}})},2858:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TagFormat=void 0;var n;(function(e){e[e["PARAMETERLESS"]=0]="PARAMETERLESS";e[e["FUNCTIONAL"]=1]="FUNCTIONAL";e[e["ASSIGNMENT"]=2]="ASSIGNMENT";e[e["UNDERSCORE"]=3]="UNDERSCORE"})(n||(t.TagFormat=n={}));const s={tagFormat:n.FUNCTIONAL};class Configuration{constructor(e=s){this.config=e}set(e){var t;this.config={tagFormat:(t=e===null||e===void 0?void 0:e.tagFormat)!==null&&t!==void 0?t:s.tagFormat}}get(){return this.config}}t["default"]=new Configuration},8922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.pruneID=void 0;const s=n(1860);const r=s.__importDefault(n(211));const pruneID=e=>{if(Array.isArray(e)){return e.map(t.pruneID)}(0,r.default)(["**._id"],{rtn:"count",filterFn:({parent:e,property:t})=>{delete e[t]}})(e);return e};t.pruneID=pruneID},6698:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDebugger=void 0;const s=n(2830);const getDebugger=e=>s(`gherkin-formatter:${e}`);t.getDebugger=getDebugger},1523:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(6698);const r=n(5829);const i=n(2793);const o=n(9054);const a=(0,s.getDebugger)("backgroundFormatter");function format(e,t){a("format(background: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Background must be set!")}const n=(0,i.lines)(`${e.keyword}: ${e.name}`);if(e.precedingComment){n.prepend(e.precedingComment.text)}if(e.description){n.append((0,i.lines)({trimLeft:true},e.description))}if(e.descriptionComment){n.append(null,(0,i.lines)(e.descriptionComment.text))}if(e.steps.length>0){if(e.description||e.descriptionComment){n.append(null)}const s=(0,r.config)(t).separateStepGroups;if(s){e.useReadableStepKeywords()}e.steps.forEach(((e,t)=>{if(s&&e.keyword==="When"&&t!==0){n.append(null)}n.append((0,i.lines)((0,o.format)(e)))}))}return n.toString()}t.format=format},9055:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(9115);const o=(0,r.getDebugger)("dataTableFormatter");function format(e){o("format(dataTable: %s)",e===null||e===void 0?void 0:e.constructor.name);if(!e){throw new Error("DataTable must be set!")}return(0,s.lines)((0,i.format)(e.rows)).toString()}t.format=format},6702:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=(0,r.getDebugger)("docStringFormatter");function format(e){i("format(docString: %s)",e===null||e===void 0?void 0:e.constructor.name);if(!e){throw new Error("DocString must be set!")}const t=(0,s.lines)(e.content,e.delimiter);if(e.mediaType){t.prepend(e.delimiter+e.mediaType)}else{t.prepend(e.delimiter)}if(e.comment){t.prepend(e.comment.text)}return t.toString()}t.format=format},4622:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(9115);const o=n(8027);const a=(0,r.getDebugger)("examplesFormatter");function format(e,t){a("format(examples: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Examples must be set!")}const n=(0,s.lines)(`${e.keyword}: ${e.name}`);if(e.precedingComment){n.prepend(e.precedingComment.text)}if(e.tags.length>0){n.prepend((0,o.format)(e.tags,t))}if(e.tagComment){n.prepend(e.tagComment.text)}const r=[e.header,...e.body];n.append((0,s.lines)((0,i.format)(r)));return n.toString()}t.format=format},8693:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(4367);const r=n(6698);const i=n(2793);const o=n(1523);const a=n(4493);const c=n(5609);const l=n(3903);const u=n(8027);const d=(0,r.getDebugger)("featureFormatter");function format(e,t){d("format(feature: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Feature must be set!")}const n=(0,i.lines)(`${e.keyword}: ${e.name}`);if(e.precedingComment){n.prepend(e.precedingComment.text)}if(e.tags.length>0){n.prepend((0,u.format)(e.tags,t))}if(e.tagComment){n.prepend(e.tagComment.text)}if(e.description){n.append((0,i.lines)({trimLeft:true},e.description))}if(e.descriptionComment){n.append((0,i.lines)(null,e.descriptionComment.text))}if(e.elements.length>0){e.elements.forEach((e=>{if(e instanceof s.Scenario){n.append(null,(0,i.lines)((0,c.format)(e,t)))}else if(e instanceof s.ScenarioOutline){n.append(null,(0,i.lines)((0,l.format)(e,t)))}else if(e instanceof s.Background){n.append(null,(0,i.lines)((0,o.format)(e,t)))}else if(e instanceof s.Rule){n.append(null,(0,i.lines)((0,a.format)(e,t)))}}))}if(e.language!=="en"){n.prepend(`# language: ${e.language}`)}return n.toString()}t.format=format},8886:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(8693);const o=(0,r.getDebugger)("gherkinDocumentFormatter");function format(e,t){o("format(document: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Document must be set!")}const n=(0,s.lines)((0,i.format)(e.feature,t));if(e.startComment){n.prepend(e.startComment.text,null)}if(e.endComment){n.append(null,e.endComment.text)}return n.toString()}t.format=format},4493:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(4367);const r=n(2793);const i=n(6698);const o=n(1523);const a=n(5609);const c=n(3903);const l=n(8027);const u=(0,i.getDebugger)("ruleFormatter");function format(e,t){u("format(rule: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Rule must be set!")}const n=(0,r.lines)(`${e.keyword}: ${e.name}`);if(e.precedingComment){n.prepend(e.precedingComment.text)}if(e.tags.length>0){n.prepend((0,l.format)(e.tags,t))}if(e.tagComment){n.prepend(e.tagComment.text)}if(e.description){n.append((0,r.lines)({trimLeft:true},e.description))}if(e.descriptionComment){n.append(null,(0,r.lines)(e.descriptionComment.text))}if(e.elements.length>0){e.elements.forEach((e=>{if(e instanceof s.Scenario){n.append(null,(0,r.lines)((0,a.format)(e,t)))}else if(e instanceof s.ScenarioOutline){n.append(null,(0,r.lines)((0,c.format)(e,t)))}else if(e instanceof s.Background){n.append(null,(0,r.lines)((0,o.format)(e,t)))}}))}return n.toString()}t.format=format},5609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(5829);const o=n(9054);const a=n(8027);const c=(0,r.getDebugger)("scenarioFormatter");function format(e,t){c("format(scenario: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Scenario must be set!")}const n=(0,s.lines)(`${e.keyword}: ${e.name}`);if(e.precedingComment){n.prepend(e.precedingComment.text)}if(e.tags.length>0){n.prepend((0,a.format)(e.tags,t))}if(e.tagComment){n.prepend(e.tagComment.text)}if(e.description){n.append((0,s.lines)({trimLeft:true},e.description))}if(e.descriptionComment){n.append(null,(0,s.lines)(e.descriptionComment.text))}if(e.steps.length>0){if(e.description||e.descriptionComment){n.append(null)}const r=(0,i.config)(t).separateStepGroups;if(r){e.useReadableStepKeywords()}e.steps.forEach(((e,t)=>{if(r&&e.keyword==="When"&&t!==0){n.append(null)}n.append((0,s.lines)((0,o.format)(e)))}))}return n.toString()}t.format=format},3903:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(4622);const o=n(5609);const a=(0,r.getDebugger)("scenarioOutlineFormatter");function format(e,t){a("format(scenarioOutline: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("ScenarioOutline must be set!")}const n=(0,s.lines)((0,o.format)(e,t));if(e.examples.length>0){e.examples.forEach((e=>{n.append(null,(0,s.lines)((0,i.format)(e,t)))}))}return n.toString()}t.format=format},9054:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(9055);const o=n(6702);const a=(0,r.getDebugger)("stepFormatter");function format(e){a("format(step: %s)",e===null||e===void 0?void 0:e.constructor.name);if(!e){throw new Error("Step must be set!")}const t=(0,s.lines)(`${e.keyword} ${e.text}`);if(e.comment){t.prepend(e.comment.text)}if(e.docString){t.append((0,s.lines)((0,o.format)(e.docString)))}if(e.dataTable){t.append((0,s.lines)((0,i.format)(e.dataTable)))}return t.toString()}t.format=format},3295:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(6698);const r=(0,s.getDebugger)("tableCellFormatter");function format(e){r("format(tableCell: %s)",e===null||e===void 0?void 0:e.constructor.name);if(!e){throw new Error("TableCell must be set!")}return e.value.replace(/(?!\\)([|#])/g,"\\$1")}t.format=format},9115:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=t.toArray=void 0;const s=n(2793);const r=n(6698);const i=n(3459);const o=n(3295);const a=(0,r.getDebugger)("tableRowFormatter");function toArray(e){return e.cells.map((e=>(0,o.format)(e)))}t.toArray=toArray;function format(e){a("format(tableRows: %s)",e===null||e===void 0?void 0:e.constructor.name);if(!e){throw new Error("TableRows must be set!")}const t=(0,s.splitToLines)((0,i.table)(e.map(toArray)));const n=(0,s.lines)();for(let s=0;s<e.length;++s){const r=e[s];if(r.comment){n.append(r.comment.text)}n.append(t[s])}return n.toString()}t.format=format},8027:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(5829);const o=(0,r.getDebugger)("tagFormatter");function format(e,t){o("format(tags: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Tags must be set!")}t=(0,i.config)(t);if(t.oneTagPerLine){const t=(0,s.lines)();for(const n of e){if(n.comment){t.append(n.comment.text)}t.append(n.toString())}return t.toString()}let n="";for(const t of e){if(t.comment){n+=`${n?"\n":""}${t.comment.text}\n${t.toString()}`}else{n+=`${n?" ":""}${t.toString()}`}}return(0,s.lines)(n).toString()}t.format=format},5829:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=t.config=void 0;const s=n(4367);const r=n(2793);const i=n(6698);const o=n(8886);const a=(0,i.getDebugger)("index");const c={oneTagPerLine:false,separateStepGroups:false,compact:false,lineBreak:null,indentation:" ",tagFormat:s.TagFormat.FUNCTIONAL};const config=e=>{var t,n,s,r,i,o;a("config(options: %o)",e);e=e!==null&&e!==void 0?e:{};return{oneTagPerLine:(t=e.oneTagPerLine)!==null&&t!==void 0?t:c.oneTagPerLine,separateStepGroups:(n=e.separateStepGroups)!==null&&n!==void 0?n:c.separateStepGroups,compact:(s=e.compact)!==null&&s!==void 0?s:c.compact,lineBreak:(r=e.lineBreak)!==null&&r!==void 0?r:c.lineBreak,indentation:(i=e.indentation)!==null&&i!==void 0?i:c.indentation,tagFormat:(o=e.tagFormat)!==null&&o!==void 0?o:c.tagFormat}};t.config=config;const format=(e,n)=>{a("format(document: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,n);if(!e){throw new Error("Document must be set!")}if(!(e instanceof s.Document)){throw new TypeError(`The passed object is not a GherkinDocument! ${e}`)}n=(0,t.config)(n);s.config.set({tagFormat:n.tagFormat});(0,r.setDefaultOptions)({eol:n.lineBreak,indent:n.indentation,skipEmpty:n.compact,skipFirstLevelIndent:true,indentEmpty:false,trimLeft:false,trimRight:true});return(0,o.format)(e,n)};t.format=format},3459:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.table=void 0;const s=n(4112);const r=n(6698);const i=(0,r.getDebugger)("utils");const table=e=>{i("table(data: %o)",e);return s.table(e,{border:{topBody:"",topJoin:"",topLeft:"",topRight:"",bottomBody:"",bottomJoin:"",bottomLeft:"",bottomRight:"",bodyLeft:"|",bodyRight:"|",bodyJoin:"|",joinBody:"",joinLeft:"",joinRight:"",joinJoin:""},drawHorizontalLine:()=>false}).trim()};t.table=table},3813:e=>{"use strict";e.exports=(e,t=process.argv)=>{const n=e.startsWith("-")?"":e.length===1?"-":"--";const s=t.indexOf(n+e);const r=t.indexOf("--");return s!==-1&&(r===-1||s<r)}},4519:e=>{"use strict";const isFullwidthCodePoint=e=>{if(Number.isNaN(e)){return false}if(e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141)){return true}return false};e.exports=isFullwidthCodePoint;e.exports["default"]=isFullwidthCodePoint},2793:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.resetDefaultOptions=t.setDefaultOptions=t.LinesBuilder=void 0;t.splitToLines=splitToLines;t.lines=lines;const s=n(8161);const r=n(2830);const i=r("lines-builder");function splitToLines(e){return e.split(/\r?\n\r?/g)}const o={indent:null,trimLeft:true,trimRight:true,indentEmpty:false,skipFirstLevelIndent:false,skipEmpty:false,eol:null};class LinesBuilder{get length(){return this.lines.length}constructor(...e){this.lines=[];i("LinesBuilder(args: %o)",e);let t;if(e[0]&&typeof e[0]==="object"&&!(e[0]instanceof LinesBuilder)){t=e.shift()}this.options=Object.assign(Object.assign({},LinesBuilder.DEFAULT_OPTIONS),t||{});i("LinesBuilder.options: %o",this.options);if(typeof this.options.indent==="number"){this.options.indent=" ".repeat(Math.max(0,this.options.indent))}i("LinesBuilder.options: %o",this.options);this.lines=this.parseLines(e);i("LinesBuilder.lines: %o",this.lines)}static resetDefaultOptions(){i("resetDefaultOptions.prev: %o",LinesBuilder.DEFAULT_OPTIONS);LinesBuilder.DEFAULT_OPTIONS=Object.assign({},o);i("resetDefaultOptions.new: %o",LinesBuilder.DEFAULT_OPTIONS);return LinesBuilder.DEFAULT_OPTIONS}static setDefaultOptions(e){i("setDefaultOptions(options: %o)",e);if(typeof e!=="object"||!e){throw new TypeError("Options must be a LinesBuilderOptions!")}i("setDefaultOptions.prev: %o",LinesBuilder.DEFAULT_OPTIONS);LinesBuilder.DEFAULT_OPTIONS=Object.assign(Object.assign({},LinesBuilder.DEFAULT_OPTIONS),e);i("setDefaultOptions.next: %o",LinesBuilder.DEFAULT_OPTIONS);return LinesBuilder.DEFAULT_OPTIONS}parseLines(e){i("parseLines(ls: %o)",e);const t=[];for(const n of e){i("parseLines.line: %o",n);if(typeof n==="string"){let e=splitToLines(n);if(this.options.trimLeft){e=e.map((e=>e.trimLeft()))}if(this.options.trimRight){e=e.map((e=>e.trimRight()))}t.push(...e)}else if(n instanceof LinesBuilder||n===null){t.push(n)}i("parseLines.parsedLines: %o",t)}return t}toString(){var e;i("toString:lines: %o",this.lines);const t=[];const n=(e=this.options.indent)!==null&&e!==void 0?e:"";const r=this.options.skipFirstLevelIndent?"":n;i("toString.indent: %o",n);for(const e of this.lines){i("toString.line: %o",e);if(typeof e==="string"&&e){t.push(`${r}${e}`)}else if(e instanceof LinesBuilder){const s=splitToLines(e.toString());for(const e of s){if(e){t.push(`${n}${e}`)}else if(!this.options.skipEmpty){t.push(this.options.indentEmpty?n:"")}}}else if(!this.options.skipEmpty){t.push(this.options.indentEmpty?n:"")}i("toString.ls: %o",t)}let o=this.options.eol;if(!o){i("toString.platform: %s",s.platform());o=s.platform()=="win32"?"\r\n":"\n"}i("toString.eol: %o",o);return t.join(o)}copy(){i("copy:lines: %o",this.lines);const e=new LinesBuilder(this.options);for(const t of this.lines){i("copy.line: %o",t);if(t instanceof LinesBuilder){e.append(t.copy())}else{e.append(t)}}return e}append(...e){i("append(ls: %o)",e);i("append.#lines: %d",this.lines.length);e=this.parseLines(e);this.lines.push(...e);i("append.#lines: %d",this.lines.length);return this}prepend(...e){i("prepend(ls: %o)",e);i("prepend.#lines: %d",this.lines.length);e=this.parseLines(e);this.lines.unshift(...e);i("prepend.#lines: %d",this.lines.length);return this}filter(e,t=false,n=true){i("filter(matcher: %o, reverse: %b, inPlace: %b)",e,t,n);if(!e){throw new TypeError("Matcher must be set!")}if(typeof e==="string"){e=new RegExp(e,"i")}let s;if(e instanceof RegExp){s=(t,n)=>e.test(t)}else{s=e}const r=n?this:this.copy();r.lines=r.lines.filter(((e,n)=>{if(e instanceof LinesBuilder){i("filter.nested(original: %d)",e.length);e.filter(s,t);i("filter.nested(result: %d)",e.length);return e.length>0}const r=s(e,n);i("filter.string(result: %b)",r);return!!r!==!!t}));return r}internalMap(e,t){i("internalMap(mapper: %o, level: %d)",e,t);this.lines=this.lines.map(((n,s)=>{if(n instanceof LinesBuilder){i("internalMap.nested(original: %d)",n.length);n.internalMap(e,t+1);return n}return e(n,s,t)}))}map(e,t=true){i("map(mapper: %o, inPlace: %b)",e,t);if(!e){throw new TypeError("Mapper must be set!")}if(typeof e!=="function"){throw new TypeError("Mapper must be a function!")}const n=t?this:this.copy();n.internalMap(e,0);return n}}t.LinesBuilder=LinesBuilder;LinesBuilder.DEFAULT_OPTIONS=Object.assign({},o);t.setDefaultOptions=LinesBuilder.setDefaultOptions;t.resetDefaultOptions=LinesBuilder.resetDefaultOptions;function lines(...e){return new LinesBuilder(...e)}},4055:(e,t,n)=>{e=n.nmd(e);var s=30,r="...";var i=1/0,o=17976931348623157e292,a=0/0;var c="[object RegExp]",l="[object Symbol]";var u=/^\s+|\s+$/g;var d=/\w*$/;var f=/^[-+]0x[0-9a-f]+$/i;var p=/^0b[01]+$/i;var h=/^0o[0-7]+$/i;var m="\\ud800-\\udfff",g="\\u0300-\\u036f\\ufe20-\\ufe23",y="\\u20d0-\\u20f0",b="\\ufe0e\\ufe0f";var v="["+m+"]",w="["+g+y+"]",T="\\ud83c[\\udffb-\\udfff]",S="(?:"+w+"|"+T+")",k="[^"+m+"]",D="(?:\\ud83c[\\udde6-\\uddff]){2}",_="[\\ud800-\\udbff][\\udc00-\\udfff]",E="\\u200d";var C=S+"?",R="["+b+"]?",P="(?:"+E+"(?:"+[k,D,_].join("|")+")"+R+C+")*",O=R+C+P,A="(?:"+[k+w+"?",w,D,_,v].join("|")+")";var L=RegExp(T+"(?="+T+")|"+A+O,"g");var x=RegExp("["+E+m+g+y+b+"]");var I=parseInt;var $=typeof global=="object"&&global&&global.Object===Object&&global;var F=typeof self=="object"&&self&&self.Object===Object&&self;var j=$||F||Function("return this")();var M=true&&t&&!t.nodeType&&t;var N=M&&"object"=="object"&&e&&!e.nodeType&&e;var B=N&&N.exports===M;var U=B&&$.process;var G=function(){try{return U&&U.binding("util")}catch(e){}}();var q=G&&G.isRegExp;var W=baseProperty("length");function asciiToArray(e){return e.split("")}function baseProperty(e){return function(t){return t==null?undefined:t[e]}}function baseUnary(e){return function(t){return e(t)}}function hasUnicode(e){return x.test(e)}function stringSize(e){return hasUnicode(e)?unicodeSize(e):W(e)}function stringToArray(e){return hasUnicode(e)?unicodeToArray(e):asciiToArray(e)}function unicodeSize(e){var t=L.lastIndex=0;while(L.test(e)){t++}return t}function unicodeToArray(e){return e.match(L)||[]}var H=Object.prototype;var K=H.toString;var V=j.Symbol;var z=V?V.prototype:undefined,J=z?z.toString:undefined;function baseIsRegExp(e){return isObject(e)&&K.call(e)==c}function baseSlice(e,t,n){var s=-1,r=e.length;if(t<0){t=-t>r?0:r+t}n=n>r?r:n;if(n<0){n+=r}r=t>n?0:n-t>>>0;t>>>=0;var i=Array(r);while(++s<r){i[s]=e[s+t]}return i}function baseToString(e){if(typeof e=="string"){return e}if(isSymbol(e)){return J?J.call(e):""}var t=e+"";return t=="0"&&1/e==-i?"-0":t}function castSlice(e,t,n){var s=e.length;n=n===undefined?s:n;return!t&&n>=s?e:baseSlice(e,t,n)}function isObject(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function isObjectLike(e){return!!e&&typeof e=="object"}var Y=q?baseUnary(q):baseIsRegExp;function isSymbol(e){return typeof e=="symbol"||isObjectLike(e)&&K.call(e)==l}function toFinite(e){if(!e){return e===0?e:0}e=toNumber(e);if(e===i||e===-i){var t=e<0?-1:1;return t*o}return e===e?e:0}function toInteger(e){var t=toFinite(e),n=t%1;return t===t?n?t-n:t:0}function toNumber(e){if(typeof e=="number"){return e}if(isSymbol(e)){return a}if(isObject(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=isObject(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=e.replace(u,"");var n=p.test(e);return n||h.test(e)?I(e.slice(2),n?2:8):f.test(e)?a:+e}function toString(e){return e==null?"":baseToString(e)}function truncate(e,t){var n=s,i=r;if(isObject(t)){var o="separator"in t?t.separator:o;n="length"in t?toInteger(t.length):n;i="omission"in t?baseToString(t.omission):i}e=toString(e);var a=e.length;if(hasUnicode(e)){var c=stringToArray(e);a=c.length}if(n>=a){return e}var l=n-stringSize(i);if(l<1){return i}var u=c?castSlice(c,0,l).join(""):e.slice(0,l);if(o===undefined){return u+i}if(c){l+=u.length-l}if(Y(o)){if(e.slice(l).search(o)){var f,p=u;if(!o.global){o=RegExp(o.source,toString(d.exec(o))+"g")}o.lastIndex=0;while(f=o.exec(p)){var h=f.index}u=u.slice(0,h===undefined?l:h)}}else if(e.indexOf(baseToString(o),l)!=l){var m=u.lastIndexOf(o);if(m>-1){u=u.slice(0,m)}}return u+i}e.exports=truncate},744:e=>{var t=1e3;var n=t*60;var s=n*60;var r=s*24;var i=r*7;var o=r*365.25;e.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0){return parse(e)}else if(n==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a){return}var c=parseFloat(a[1]);var l=(a[2]||"ms").toLowerCase();switch(l){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*s;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return undefined}}function fmtShort(e){var i=Math.abs(e);if(i>=r){return Math.round(e/r)+"d"}if(i>=s){return Math.round(e/s)+"h"}if(i>=n){return Math.round(e/n)+"m"}if(i>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){var i=Math.abs(e);if(i>=r){return plural(e,i,r,"day")}if(i>=s){return plural(e,i,s,"hour")}if(i>=n){return plural(e,i,n,"minute")}if(i>=t){return plural(e,i,t,"second")}return e+" ms"}function plural(e,t,n,s){var r=t>=n*1.5;return Math.round(e/n)+" "+s+(r?"s":"")}},2502:(e,t,n)=>{"use strict";const s=n(1324);const r=n(5579);const i=n(8213);const{defineProperty:o}=n(9669);const{Wildcard:a}=n(9517);const c=Symbol("counter");const l=Symbol("leaf");const markLeaf=(e,t,n)=>o(e,l,t,n);const isLeaf=e=>l in e;const isMatch=e=>e!==undefined&&e[l]===true;e.exports.isLeaf=isLeaf;e.exports.isMatch=isMatch;const u=Symbol("has-matches");const setHasMatches=e=>o(e,u,true);const hasMatches=e=>e[u]===true;e.exports.hasMatches=hasMatches;const merge=(e,t,n)=>{if(e[t]===undefined){o(e,t,[])}if(!e[t].includes(n)){e[t].push(n)}};const d=Symbol("leaf-needles");const addLeafNeedle=(e,t)=>merge(e,d,t);const getLeafNeedles=e=>e[d]||[];e.exports.getLeafNeedles=getLeafNeedles;const f=Symbol("leaf-needles-exclude");const addLeafNeedleExclude=(e,t)=>merge(e,f,t);const getLeafNeedlesExclude=e=>e[f]||[];e.exports.getLeafNeedlesExclude=getLeafNeedlesExclude;const p=Symbol("leaf-needles-match");const addLeafNeedleMatch=(e,t)=>merge(e,p,t);const getLeafNeedlesMatch=e=>e[p]||[];e.exports.getLeafNeedlesMatch=getLeafNeedlesMatch;const h=Symbol("needles");const addNeedle=(e,t)=>merge(e,h,t);const getNeedles=e=>e[h];e.exports.getNeedles=getNeedles;const m=Symbol("index");const setIndex=(e,t,n)=>o(e,m,t,n);const getIndex=e=>e[m];e.exports.getIndex=getIndex;const g=Symbol("order");const setOrder=(e,t)=>o(e,g,t);const getOrder=e=>e[g];e.exports.getOrder=getOrder;const y=Symbol("wildcard");const setWildcard=(e,t)=>o(e,y,t);const getWildcard=e=>e[y];e.exports.getWildcard=getWildcard;const b=Symbol("values");const setValues=(e,t)=>o(e,b,t);const getValues=e=>e[b];e.exports.getValues=getValues;e.exports.matchedBy=e=>Array.from(new Set([].concat(...e.map((e=>getLeafNeedlesMatch(e))))));e.exports.excludedBy=e=>Array.from(new Set([].concat(...e.map((e=>getLeafNeedlesExclude(e))))));e.exports.traversedBy=e=>Array.from(new Set([].concat(...e.map((e=>getNeedles(e))))));e.exports.isLastLeafMatch=e=>{let t=Number.MIN_SAFE_INTEGER;let n=null;for(let s=0,r=e.length;s<r;s+=1){const r=e[s];const i=getIndex(r);if(i!==undefined&&i>t){t=i;n=r}}return n!==null&&isMatch(n)};const iterate=(e,t,n,{onAdd:s,onFin:i})=>{const o=[[[e,null]]];const a=[];let c=false;r.iterate(n,((n,r)=>{if(n==="RM"){if(r.excluded===true){c=false}o.pop();a.pop()}else if(n==="ADD"){if(r.excluded===true){if(c){throw new Error(`Redundant Exclusion: "${t}"`)}c=true}const e=[];const n=a[a.length-1];o[o.length-1].forEach((([t])=>s(t,r,n,(n=>e.push([n,t])))));o.push(e);a.push(r)}else{o[o.length-1].filter((([t])=>t!==e)).forEach((([e,t])=>i(e,r[r.length-1],t,c)))}}))};const applyNeedle=(e,t,n,s)=>{iterate(e,t,n,{onAdd:(e,n,r,i)=>{addNeedle(e,t);const o=r!==undefined&&n.isStarRec&&n.value===r.value;if(o&&s.strict){throw new Error(`Redundant Recursion: "${t}"`)}if(!o){if(!(n.value in e)){const t={};e[n.value]=t;if(s.orderByNeedles){setOrder(t,s[c])}setWildcard(t,n)}i(e[n.value])}if(n.isStarRec){i(e)}},onFin:(e,n,r,i)=>{if(s.strict){if(n.isSimpleStarRec){const e=Object.keys(r).filter((e=>!["**",""].includes(e)));if(e.length!==0){throw new Error(`Needle Target Invalidated: "${r[e[0]][h][0]}" by "${t}"`)}}}addNeedle(e,t);if(s.strict&&d in e){throw new Error(`Redundant Needle Target: "${e[d][0]}" vs "${t}"`)}addLeafNeedle(e,t,s.strict);if(i){addLeafNeedleExclude(e,t)}else{addLeafNeedleMatch(e,t)}markLeaf(e,!i,s.strict);setIndex(e,s[c],s.strict);s[c]+=1}})};const finalizeTower=e=>{const t=[];let n=-1;i.traverse(e,((e,s,r)=>{if(e==="EXIT"){const e=n===r+1;if(e&&t[n]===true||isMatch(s)){t[r]=true;setHasMatches(s)}if(e){t[n]=false}setValues(s,Object.values(s).reverse());n=r}}))};e.exports.compile=(e,t)=>{const n={};t[c]=0;for(let r=0;r<e.length;r+=1){const i=e[r];const o=[s.parse(i,t)];applyNeedle(n,i,o,t)}setWildcard(n,new a("*",false));finalizeTower(n);return n}},6472:(e,t,n)=>{"use strict";const s=n(2613);e.exports=e=>{const t={filterFn:undefined,breakFn:undefined,beforeFn:undefined,afterFn:undefined,compareFn:undefined,reverse:true,orderByNeedles:false,abort:false,rtn:undefined,joined:false,useArraySelector:true,strict:true,...e};s(Object.keys(t).length===12,"Unexpected Option provided!");s(["function","undefined"].includes(typeof t.filterFn));s(["function","undefined"].includes(typeof t.breakFn));s(["function","undefined"].includes(typeof t.beforeFn));s(["function","undefined"].includes(typeof t.afterFn));s(["function","undefined"].includes(typeof t.compareFn));s(typeof t.reverse==="boolean");s(typeof t.orderByNeedles==="boolean");s(typeof t.abort==="boolean");s(typeof t.rtn==="function"&&t.rtn.length===1||[undefined,"context","key","value","entry","property","gproperty","parent","gparent","parents","isMatch","matchedBy","excludedBy","traversedBy","isCircular","isLeaf","depth","bool","count"].includes(t.rtn)||Array.isArray(t.rtn)&&t.rtn.every((e=>["key","value","entry","property","gproperty","parent","gparent","parents","isMatch","matchedBy","excludedBy","traversedBy","isCircular","isLeaf","depth"].includes(e))));s(typeof t.joined==="boolean");s(typeof t.useArraySelector==="boolean");s(typeof t.strict==="boolean");return t}},9992:e=>{"use strict";e.exports=(e,t)=>{if(t.rtn==="context"){return{onMatch:()=>{},get:()=>e.context}}if(t.rtn==="bool"){let e=false;return{onMatch:()=>{e=true},get:()=>e}}if(t.rtn==="count"){let e=0;return{onMatch:()=>{e+=1},get:()=>e}}const n=[];return{onMatch:(()=>{if(typeof t.rtn==="function"){return()=>n.push(t.rtn(e))}if(Array.isArray(t.rtn)){return()=>n.push(t.rtn.map((t=>e[t])))}return()=>n.push(e[t.rtn])})(),get:()=>t.abort?n[0]:n}}},5592:(e,t,n)=>{"use strict";const s=n(2613);const r=n(2502);const i=n(9992);const{toPath:o}=n(9669);const{getOrder:a}=n(2502);const formatPath=(e,t)=>t.joined?o(e):[...e];e.exports=(e,t,n)=>{const o={haystack:e,context:n.context};if(n.beforeFn!==undefined){const e=n.beforeFn(o);s(e===undefined,"beforeFn must not return")}const c=[false,t,null,0];const l=[];const u=[];let d;let f;let p;let h;let m=o.haystack;const g={getKey:()=>formatPath(l,n),get key(){return g.getKey()},getValue:()=>m,get value(){return g.getValue()},getEntry:()=>[formatPath(l,n),m],get entry(){return g.getEntry()},getIsMatch:()=>h,get isMatch(){return g.getIsMatch()},getMatchedBy:()=>r.matchedBy(p),get matchedBy(){return g.getMatchedBy()},getExcludedBy:()=>r.excludedBy(p),get excludedBy(){return g.getExcludedBy()},getTraversedBy:()=>r.traversedBy(p),get traversedBy(){return g.getTraversedBy()},getGproperty:()=>l[l.length-2],get gproperty(){return g.getGproperty()},getProperty:()=>l[l.length-1],get property(){return g.getProperty()},getGparent:()=>u[u.length-2],get gparent(){return g.getGparent()},getParent:()=>u[u.length-1],get parent(){return g.getParent()},getParents:()=>[...u].reverse(),get parents(){return g.getParents()},getIsCircular:()=>u.includes(m),get isCircular(){return g.getIsCircular()},getIsLeaf:()=>!(m instanceof Object),get isLeaf(){return g.getIsLeaf()},getDepth:()=>l.length,get depth(){return g.getDepth()},get result(){return g.getResult()},context:o.context};const y=i(g,n);g.getResult=()=>y.get();if(""in t[0]&&(n.useArraySelector||!Array.isArray(o.haystack))){c[1]=[...c[1],t[0][""]]}do{d=c.pop();f=c.pop();p=c.pop();h=c.pop();const e=l.length-d;for(let t=0;t<e;t+=1){u.pop();l.pop()}if(e===-1){u.push(m);l.push(f);m=m[f]}else if(f!==null){l[l.length-1]=f;m=u[u.length-1][f]}else{m=o.haystack}if(h){if(n.filterFn===undefined||n.filterFn(g)!==false){y.onMatch();if(n.abort){c.length=0}}continue}if(!p.some((e=>r.hasMatches(e)))){continue}const t=n.useArraySelector===false&&Array.isArray(m);if(!t&&r.isLastLeafMatch(p)){c.push(true,p,f,d);h=true}if((n.breakFn===undefined||n.breakFn(g)!==true)&&m instanceof Object){const e=Array.isArray(m);const s=Object.keys(m);if(!e&&n.compareFn){s.sort(n.compareFn(g))}if(!n.reverse){s.reverse()}for(let i=0,o=s.length;i<o;i+=1){const o=s[i];const u=[];if(t){u.push(...p);if(l.length===0){if(""in p[0]){u.push(p[0][""])}u.push(...r.getValues(p[0]).filter((e=>r.getWildcard(e).isStarRec)))}}else{for(let t=0,n=p.length;t!==n;t+=1){const n=p[t];if(r.getWildcard(n).anyMatch(o)){u.push(n)}const s=r.getValues(n);let i=s.length;while(i--){const t=s[i];if(r.getWildcard(t).typeMatch(o,e)){u.push(t)}}}}if(n.orderByNeedles){u.index=Buffer.from(u.map((e=>a(e))).sort());let t=c.length-3;const n=t-i*4;while(t!==n&&Buffer.compare(u.index,c[t].index)===1){t-=4}c.splice(t+3,0,false,u,e?Number(o):o,d+1)}else{c.push(false,u,e?Number(o):o,d+1)}}}}while(c.length!==0);o.result=y.get();if(n.afterFn!==undefined){const e=n.afterFn(o);s(e===undefined,"afterFn must not return")}return o.result}},2956:(e,t,n)=>{"use strict";const s=n(2613);const{defineProperty:r}=n(9669);const{Wildcard:i}=n(9517);const o=Symbol("is-excluded");const markExcluded=e=>r(e,o,true);const isExcluded=e=>e[o]===true;const throwError=(e,t,n={})=>{throw new Error(Object.entries(n).reduce(((e,[t,n])=>`${e}, ${t} ${n}`),`${e}: ${t}`))};const getSimple=e=>{if(Array.isArray(e)){return e.length===1?e[0]:e}return e.size===1?e.values().next().value:e};e.exports=e=>{let t=new Set;let n=false;let r=false;let o=0;const a=[];const newChild=e=>{if(isExcluded(t)){s(r===false);r=true}a.push(t);t=e?new Set:[]};const finishChild=()=>{const e=a.pop();const n=Array.isArray(e);const s=getSimple(t);if(!n&&s instanceof Set){s.forEach((t=>e.add(t)))}else{e[n?"push":"add"](s)}t=e};newChild(false);return{setInArray:(t,s)=>{if(n===t){throwError(n?"Bad Array Start":"Bad Array Terminator",e,{char:s})}n=t},finishElement:(s,{err:a,fins:c,finReq:l=false})=>{const u=o===s;if(u&&!c.includes(e[s-1]||null)){throwError(a,e,{char:s})}if(!u){if(l){throwError(a,e,{char:s})}const c=e.slice(o,s);if(n&&!(/^[?*+\d]+$/.test(c)||c.startsWith("(")&&c.endsWith(")"))){throwError("Bad Array Selector",e,{selector:c})}t.push(new i(n?`[${c}]`:c,r));r=false}o=s+1},startExclusion:t=>{if(r!==false){throwError("Redundant Exclusion",e,{char:t})}r=true},startGroup:()=>{newChild(true);if(r){markExcluded(t);r=false}newChild(false)},newGroupElement:()=>{finishChild();newChild(false)},finishGroup:t=>{if(a.length<2){throwError("Unexpected Group Terminator",e,{char:t})}finishChild();finishChild()},finalizeResult:()=>{finishChild();s(r===false);if(a.length!==0){throwError("Non Terminated Group",e)}if(n){throwError("Non Terminated Array",e)}return getSimple(t)}}}},1324:(e,t,n)=>{"use strict";const{Wildcard:s}=n(9517);const r=n(2956);const throwError=(e,t,n={})=>{throw new Error(Object.entries(n).reduce(((e,[t,n])=>`${e}, ${t} ${n}`),`${e}: ${t}`))};e.exports.parse=(e,t)=>{if(e===""){return new s("",false)}const n=r(e);const i=e.length;let o=false;let a=0;for(let s=0;s<i;s+=1){const r=e[s];if(o===false&&a===0){switch(r){case".":n.finishElement(s,{err:"Bad Path Separator",fins:["]","}"]});break;case"[":if(!t.useArraySelector){throwError("Forbidden Array Selector",e,{char:s})}n.finishElement(s,{err:"Bad Array Start",fins:[null,"!","{",",","}","]"]});n.setInArray(true,s);break;case"]":n.finishElement(s,{err:"Bad Array Terminator",fins:["}"]});n.setInArray(false,s);break;case"{":n.finishElement(s,{err:"Bad Group Start",fins:[null,"!",".","[","{",","],finReq:true});n.startGroup();break;case",":n.finishElement(s,{err:"Bad Group Separator",fins:["]","}"]});n.newGroupElement();break;case"}":n.finishElement(s,{err:"Bad Group Terminator",fins:["]","}"]});n.finishGroup(s);break;case"!":n.finishElement(s,{err:"Bad Exclusion",fins:[null,".",",","{","["],finReq:true});n.startExclusion(s);break;default:break}}if(o===false){switch(r){case"(":a+=1;break;case")":if(a===0){throwError("Unexpected Parentheses",e,{char:s})}a-=1;break;default:break}}o=r==="\\"?!o:false}if(o!==false){throwError("Dangling Escape",e,{char:i-1})}if(a!==0){throwError("Unterminated Parentheses",e)}n.finishElement(i,{err:"Bad Terminator",fins:["]","}"]});return n.finalizeResult()}},9517:(e,t,n)=>{"use strict";const{escapeRegex:s,asRegex:r}=n(9669);const parseWildcard=e=>{let t="";let n=false;for(let r=0;r<e.length;r+=1){const i=e[r];if(!n&&i==="\\"){n=true}else if(!n&&i==="*"){t+=".*"}else if(!n&&i==="+"){t+=".+"}else if(!n&&i==="?"){t+="."}else{t+=s(i);n=false}}return new RegExp(`^${t}$`)};e.exports.parseWildcard=parseWildcard;const compileWildcard=e=>{if(["**","++"].includes(e)){return r(".*")}if((e.startsWith("**(")||e.startsWith("++("))&&e.endsWith(")")){return r(e.slice(3,-1))}if(e.startsWith("[(")&&e.endsWith(")]")){return r(e.slice(2,-2))}if(e.startsWith("(")&&e.endsWith(")")){return r(e.slice(1,-1))}if(e.startsWith("[")&&e.endsWith("]")){return parseWildcard(e.slice(1,-1))}return parseWildcard(e)};class Wildcard{constructor(e,t){this.value=e;this.excluded=t;this.regex=compileWildcard(e);this.isArrayTarget=e.startsWith("[")&&e.endsWith("]");this.isSimpleStarRec=e==="**";this.isSimplePlusRec=e==="++";this.isSimpleRec=this.isSimpleStarRec||this.isSimplePlusRec;this.isRegexStarRec=e.startsWith("**(")&&e.endsWith(")");this.isRegexPlusRec=e.startsWith("++(")&&e.endsWith(")");this.isRegexRec=this.isRegexStarRec||this.isRegexPlusRec;this.isStarRec=this.isSimpleStarRec||this.isRegexStarRec;this.isPlusRec=this.isSimplePlusRec||this.isRegexPlusRec;this.isRec=this.isStarRec||this.isPlusRec;this.isAnyArrayTarget=e==="[*]";this.isAnyObjTarget=e==="*"}anyMatch(e){if(!this.isRec){return false}if(this.isSimpleRec){return true}return this.regex.test(e)}typeMatch(e,t){if(this.isSimpleRec){return true}if(t&&this.isAnyArrayTarget){return true}if(!t&&this.isAnyObjTarget){return true}if(t!==this.isArrayTarget&&!this.isRec){return false}return this.regex.test(e)}}e.exports.Wildcard=Wildcard},9669:e=>{"use strict";e.exports.defineProperty=(e,t,n,s=true)=>Object.defineProperty(e,t,{value:n,writable:!s});const t=/[?!,.*+[\](){}\\]/g;const escape=e=>e.replace(t,"\\$&");e.exports.escape=escape;e.exports.escapeRegex=e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");e.exports.asRegex=e=>{try{return new RegExp(e)}catch(t){throw new Error(`Invalid Regex: "${e}"`)}};e.exports.toPath=e=>e.reduce(((e,t)=>`${e}${typeof t==="number"?`[${t}]`:`${e?".":""}${escape(t)}`}`),"")},5579:e=>{"use strict";const iterate=(e,t)=>{const n=[e];const s=[null];const r=[];const i=[];const o=[];let a=0;let c=true;while(a!==-1){const e=n[a];if(e instanceof Set){n[a]=[...e];n[a].or=true}else if(Array.isArray(e)){if(e.or!==true){n.splice(a,1,...e);s.splice(a,1,...new Array(e.length).fill(s[a]));if(s[a]!==null){i[s[a]]+=e.length-1}}else{if(r[a]===undefined){r[a]=0;i[a]=0}else if(i[a]!==0){n.splice(a+1,i[a]);s.splice(a+1,i[a]);i[a]=0}if(r[a]<e.length){n.splice(a+1,0,e[r[a]]);s.splice(a+1,0,a);r[a]=(r[a]||0)+1;i[a]+=1;c=true;a+=1}else{r[a]=0;a-=1}}}else if(c===true){o.push(e);t("ADD",e);if(a===n.length-1){t("FIN",o);c=false}else{a+=1}}else{t("RM",o.pop());a-=1}}};e.exports.iterate=iterate},8213:e=>{"use strict";e.exports.traverse=(e,t)=>{const n=[e];const s=[1];let r=0;let i=true;while(n.length!==0){if(i===true){const e=n[n.length-1];t("ENTER",e,r);const o=Object.values(e);if(o.length!==0){n.push(...o);r+=1;s[r]=o.length}else{i=false}}else{const e=n.pop();t("EXIT",e,r);s[r]-=1;if(s[r]===0){s.pop();r-=1}else{i=true}}}}},211:(e,t,n)=>{"use strict";const s=n(2613);const r=n(2502);const i=n(5592);const o=n(6472);e.exports=(e,t={})=>{s(Array.isArray(e));s(t instanceof Object&&!Array.isArray(t));if(e.length===0){return(e,t)=>t===undefined?[]:t}const n=o(t);const a=r.compile(e,n);return(e,t)=>i(e,[a],{context:t,...n,rtn:n.rtn||(t===undefined?"key":"context")})}},5133:(e,t,n)=>{"use strict";const s=n(2081);e.exports=s.ObjectSet},2081:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ObjectSet=void 0;const s=n(1860);const r=s.__importDefault(n(761));const i=Symbol("entries");class ObjectSet extends Set{constructor(e){super();this[i]=[];if(e){for(const t of e){this.add(t)}}}equals(e,t){return(0,r.default)(e,t)}has(e){for(const t of this[i]){if(this.equals(e,t)){return true}}return false}delete(e){for(let t=0;t<this.size;++t){if(this.equals(e,this[i][t])){this[i].splice(t,1);return true}}return false}add(e){if(typeof e!=="undefined"&&!this.has(e)){this[i].push(e)}return this}clear(){this[i]=[]}[Symbol.iterator](){return this[i][Symbol.iterator]()}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}*entries(){for(const e of this[i]){yield[e,e]}}get size(){return this[i].length}forEach(e,t){for(const n of this[i]){if(t){e.call(t,n,n,this)}else{e(n,n,this)}}}}t.ObjectSet=ObjectSet},3298:(e,t,n)=>{"use strict";const s=n(4519);const r=n(8493);const i=n(5206);const o=["","›"];const wrapAnsi=e=>`${o[0]}[${e}m`;const checkAnsi=(e,t,n)=>{let s=[];e=[...e];for(let n of e){const r=n;if(n.includes(";")){n=n.split(";")[0][0]+"0"}const o=i.codes.get(Number.parseInt(n,10));if(o){const n=e.indexOf(o.toString());if(n===-1){s.push(wrapAnsi(t?o:r))}else{e.splice(n,1)}}else if(t){s.push(wrapAnsi(0));break}else{s.push(wrapAnsi(r))}}if(t){s=s.filter(((e,t)=>s.indexOf(e)===t));if(n!==undefined){const e=wrapAnsi(i.codes.get(Number.parseInt(n,10)));s=s.reduce(((t,n)=>n===e?[n,...t]:[...t,n]),[])}}return s.join("")};e.exports=(e,t,n)=>{const i=[...e];const a=[];let c=typeof n==="number"?n:i.length;let l=false;let u;let d=0;let f="";for(const[p,h]of i.entries()){let i=false;if(o.includes(h)){const t=/\d[^m]*/.exec(e.slice(p,p+18));u=t&&t.length>0?t[0]:undefined;if(d<c){l=true;if(u!==undefined){a.push(u)}}}else if(l&&h==="m"){l=false;i=true}if(!l&&!i){d++}if(!r({exact:true}).test(h)&&s(h.codePointAt())){d++;if(typeof n!=="number"){c++}}if(d>t&&d<=c){f+=h}else if(d===t&&!l&&u!==undefined){f=checkAnsi(a)}else if(d>=c){f+=checkAnsi(a,true,u);break}}return f}},5206:(e,t,n)=>{"use strict";e=n.nmd(e);const wrapAnsi16=(e,t)=>(...n)=>{const s=e(...n);return`[${s+t}m`};const wrapAnsi256=(e,t)=>(...n)=>{const s=e(...n);return`[${38+t};5;${s}m`};const wrapAnsi16m=(e,t)=>(...n)=>{const s=e(...n);return`[${38+t};2;${s[0]};${s[1]};${s[2]}m`};const ansi2ansi=e=>e;const rgb2rgb=(e,t,n)=>[e,t,n];const setLazyProperty=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const s=n();Object.defineProperty(e,t,{value:s,enumerable:true,configurable:true});return s},enumerable:true,configurable:true})};let s;const makeDynamicStyles=(e,t,r,i)=>{if(s===undefined){s=n(4185)}const o=i?10:0;const a={};for(const[n,i]of Object.entries(s)){const s=n==="ansi16"?"ansi":n;if(n===t){a[s]=e(r,o)}else if(typeof i==="object"){a[s]=e(i[t],o)}}return a};function assembleStyles(){const e=new Map;const t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright;t.bgColor.bgGray=t.bgColor.bgBlackBright;t.color.grey=t.color.blackBright;t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(const[n,s]of Object.entries(t)){for(const[n,r]of Object.entries(s)){t[n]={open:`[${r[0]}m`,close:`[${r[1]}m`};s[n]=t[n];e.set(r[0],r[1])}Object.defineProperty(t,n,{value:s,enumerable:false})}Object.defineProperty(t,"codes",{value:e,enumerable:false});t.color.close="";t.bgColor.close="";setLazyProperty(t.color,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,false)));setLazyProperty(t.color,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,false)));setLazyProperty(t.color,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,false)));setLazyProperty(t.bgColor,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,true)));setLazyProperty(t.bgColor,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,true)));setLazyProperty(t.bgColor,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,true)));return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},60:(e,t,n)=>{"use strict";const s=n(3958);const r=n(4519);const i=n(872);const stringWidth=e=>{if(typeof e!=="string"||e.length===0){return 0}e=s(e);if(e.length===0){return 0}e=e.replace(i()," ");let t=0;for(let n=0;n<e.length;n++){const s=e.codePointAt(n);if(s<=31||s>=127&&s<=159){continue}if(s>=768&&s<=879){continue}if(s>65535){n++}t+=r(s)?2:1}return t};e.exports=stringWidth;e.exports["default"]=stringWidth},3958:(e,t,n)=>{"use strict";const s=n(21);e.exports=e=>typeof e==="string"?e.replace(s(),""):e},1450:(e,t,n)=>{"use strict";const s=n(857);const r=n(2018);const i=n(3813);const{env:o}=process;let a;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){a=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){a=1}if("FORCE_COLOR"in o){if(o.FORCE_COLOR==="true"){a=1}else if(o.FORCE_COLOR==="false"){a=0}else{a=o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,t){if(a===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!t&&a===undefined){return 0}const n=a||0;if(o.TERM==="dumb"){return n}if(process.platform==="win32"){const e=s.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in o){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in o))||o.CI_NAME==="codeship"){return 1}return n}if("TEAMCITY_VERSION"in o){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0}if(o.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in o){const e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(o.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)){return 1}if("COLORTERM"in o){return 1}return n}function getSupportLevel(e){const t=supportsColor(e,e&&e.isTTY);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,r.isatty(1))),stderr:translateLevel(supportsColor(true,r.isatty(2)))}},2651:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.alignVerticalRangeContent=t.wrapRangeContent=void 0;const r=s(n(60));const i=n(7428);const o=n(8188);const a=n(8649);const c=n(4042);const l=n(1497);const u=n(8966);const wrapRangeContent=(e,t,n)=>{const{topLeft:s,paddingRight:r,paddingLeft:o,truncate:l,wrapWord:d,alignment:f}=e;const p=n.rows[s.row][s.col];const h=t-o-r;return(0,u.wrapCell)((0,c.truncateString)(p,l),h,d).map((e=>{const t=(0,i.alignString)(e,h,f);return(0,a.padString)(t,o,r)}))};t.wrapRangeContent=wrapRangeContent;const alignVerticalRangeContent=(e,t,n)=>{const{rows:s,drawHorizontalLine:i,rowHeights:a}=n;const{topLeft:c,bottomRight:u,verticalAlignment:d}=e;if(a.length===0){return[]}const f=(0,l.sumArray)(a.slice(c.row,u.row+1));const p=u.row-c.row;const h=(0,l.sequence)(c.row+1,u.row).filter((e=>!i(e,s.length))).length;const m=f+p-h;return(0,o.padCellVertically)(t,m,d).map((e=>{if(e.length===0){return" ".repeat((0,r.default)(t[0]))}return e}))};t.alignVerticalRangeContent=alignVerticalRangeContent},7428:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.alignString=void 0;const r=s(n(60));const i=n(1497);const alignLeft=(e,t)=>e+" ".repeat(t);const alignRight=(e,t)=>" ".repeat(t)+e;const alignCenter=(e,t)=>" ".repeat(Math.floor(t/2))+e+" ".repeat(Math.ceil(t/2));const alignJustify=(e,t)=>{const n=(0,i.countSpaceSequence)(e);if(n===0){return alignLeft(e,t)}const s=(0,i.distributeUnevenly)(t,n);if(Math.max(...s)>3){return alignLeft(e,t)}let r=0;return e.replace(/\s+/g,(e=>e+" ".repeat(s[r++])))};const alignString=(e,t,n)=>{const s=(0,r.default)(e);if(s===t){return e}if(s>t){throw new Error("Subject parameter value width cannot be greater than the container width.")}if(s===0){return" ".repeat(t)}const i=t-s;if(n==="left"){return alignLeft(e,i)}if(n==="right"){return alignRight(e,i)}if(n==="justify"){return alignJustify(e,i)}return alignCenter(e,i)};t.alignString=alignString},7061:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.alignTableData=void 0;const s=n(7428);const alignTableData=(e,t)=>e.map(((e,n)=>e.map(((e,r)=>{var i;const{width:o,alignment:a}=t.columns[r];const c=(i=t.spanningCellManager)===null||i===void 0?void 0:i.getContainingRange({col:r,row:n},{mapped:true});if(c){return e}return(0,s.alignString)(e,o,a)}))));t.alignTableData=alignTableData},483:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.calculateCellHeight=void 0;const s=n(8966);const calculateCellHeight=(e,t,n=false)=>(0,s.wrapCell)(e,t,n).length;t.calculateCellHeight=calculateCellHeight},67:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.calculateMaximumColumnWidths=t.calculateMaximumCellWidth=void 0;const r=s(n(60));const i=n(1497);const calculateMaximumCellWidth=e=>Math.max(...e.split("\n").map(r.default));t.calculateMaximumCellWidth=calculateMaximumCellWidth;const calculateMaximumColumnWidths=(e,n=[])=>{const s=new Array(e[0].length).fill(0);const r=n.map(i.calculateRangeCoordinate);const isSpanningCell=(e,t)=>r.some((n=>(0,i.isCellInRange)({col:t,row:e},n)));e.forEach(((e,n)=>{e.forEach(((e,r)=>{if(isSpanningCell(n,r)){return}s[r]=Math.max(s[r],(0,t.calculateMaximumCellWidth)(e))}))}));return s};t.calculateMaximumColumnWidths=calculateMaximumColumnWidths},6246:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.calculateOutputColumnWidths=void 0;const calculateOutputColumnWidths=e=>e.columns.map((e=>e.paddingLeft+e.width+e.paddingRight));t.calculateOutputColumnWidths=calculateOutputColumnWidths},2696:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.calculateRowHeights=void 0;const s=n(483);const r=n(1497);const calculateRowHeights=(e,t)=>{const n=[];for(const[i,o]of e.entries()){let a=1;o.forEach(((o,c)=>{var l;const u=(l=t.spanningCellManager)===null||l===void 0?void 0:l.getContainingRange({col:c,row:i});if(!u){const e=(0,s.calculateCellHeight)(o,t.columns[c].width,t.columns[c].wrapWord);a=Math.max(a,e);return}const{topLeft:d,bottomRight:f,height:p}=u;if(i===f.row){const s=(0,r.sumArray)(n.slice(d.row));const i=f.row-d.row;const o=(0,r.sequence)(d.row+1,f.row).filter((n=>{var s;return!((s=t.drawHorizontalLine)===null||s===void 0?void 0:s.call(t,n,e.length))})).length;const c=p-s-i+o;a=Math.max(a,c)}}));n.push(a)}return n};t.calculateRowHeights=calculateRowHeights},888:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.calculateSpanningCellWidth=void 0;const s=n(1497);const calculateSpanningCellWidth=(e,t)=>{const{columnsConfig:n,drawVerticalLine:r}=t;const{topLeft:i,bottomRight:o}=e;const a=(0,s.sumArray)(n.slice(i.col,o.col+1).map((({width:e})=>e)));const c=i.col===o.col?n[i.col].paddingRight+n[o.col].paddingLeft:(0,s.sumArray)(n.slice(i.col,o.col+1).map((({paddingLeft:e,paddingRight:t})=>e+t)));const l=o.col-i.col;const u=(0,s.sequence)(i.col+1,o.col).filter((e=>!r(e,n.length))).length;return a+c+l-u};t.calculateSpanningCellWidth=calculateSpanningCellWidth},6334:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createStream=void 0;const s=n(7061);const r=n(2696);const i=n(46);const o=n(2698);const a=n(7366);const c=n(8188);const l=n(8649);const u=n(3337);const d=n(4042);const f=n(1497);const prepareData=(e,t)=>{let n=(0,u.stringifyTableData)(e);n=(0,d.truncateTableData)(n,(0,f.extractTruncates)(t));const i=(0,r.calculateRowHeights)(n,t);n=(0,c.mapDataUsingRowHeights)(n,i,t);n=(0,s.alignTableData)(n,t);n=(0,l.padTableData)(n,t);return n};const create=(e,t,n)=>{const s=prepareData([e],n);const r=s.map((e=>(0,o.drawRow)(e,n))).join("");let a;a="";a+=(0,i.drawBorderTop)(t,n);a+=r;a+=(0,i.drawBorderBottom)(t,n);a=a.trimEnd();process.stdout.write(a)};const append=(e,t,n)=>{const s=prepareData([e],n);const r=s.map((e=>(0,o.drawRow)(e,n))).join("");let a="";const c=(0,i.drawBorderBottom)(t,n);if(c!=="\n"){a="\r"}a+=(0,i.drawBorderJoin)(t,n);a+=r;a+=c;a=a.trimEnd();process.stdout.write(a)};const createStream=e=>{const t=(0,a.makeStreamConfig)(e);const n=Object.values(t.columns).map((e=>e.width+e.paddingLeft+e.paddingRight));let s=true;return{write:e=>{if(e.length!==t.columnCount){throw new Error("Row cell count does not match the config.columnCount.")}if(s){s=false;create(e,n,t)}else{append(e,n,t)}}}};t.createStream=createStream},46:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createTableBorderGetter=t.drawBorderBottom=t.drawBorderJoin=t.drawBorderTop=t.drawBorder=t.createSeparatorGetter=t.drawBorderSegments=void 0;const s=n(6499);const drawBorderSegments=(e,t)=>{const{separator:n,horizontalBorderIndex:s,spanningCellManager:r}=t;return e.map(((e,t)=>{const i=n.body.repeat(e);if(s===undefined){return i}const o=r===null||r===void 0?void 0:r.getContainingRange({col:t,row:s});if(!o){return i}const{topLeft:a}=o;if(s===a.row){return i}if(t!==a.col){return""}return o.extractBorderContent(s)}))};t.drawBorderSegments=drawBorderSegments;const createSeparatorGetter=e=>{const{separator:t,spanningCellManager:n,horizontalBorderIndex:s,rowCount:r}=e;return(e,i)=>{const o=n===null||n===void 0?void 0:n.inSameRange;if(s!==undefined&&o){const n={col:e,row:s-1};const a={col:e-1,row:s};const c={col:e-1,row:s-1};const l={col:e,row:s};const u=[[c,n],[n,l],[l,a],[a,c]];if(e===0){if(o(l,n)&&t.bodyJoinOuter){return t.bodyJoinOuter}return t.left}if(e===i){if(o(c,a)&&t.bodyJoinOuter){return t.bodyJoinOuter}return t.right}if(s===0){if(o(l,a)){return t.body}return t.join}if(s===r){if(o(n,c)){return t.body}return t.join}const d=u.map((e=>o(...e))).filter(Boolean).length;if(d===0){return t.join}if(d===4){return""}if(d===2){if(o(...u[1])&&o(...u[3])&&t.bodyJoinInner){return t.bodyJoinInner}return t.body}if(d===1){if(!t.joinRight||!t.joinLeft||!t.joinUp||!t.joinDown){throw new Error(`Can not get border separator for position [${s}, ${e}]`)}if(o(...u[0])){return t.joinDown}if(o(...u[1])){return t.joinLeft}if(o(...u[2])){return t.joinUp}return t.joinRight}throw new Error("Invalid case")}if(e===0){return t.left}if(e===i){return t.right}return t.join}};t.createSeparatorGetter=createSeparatorGetter;const drawBorder=(e,n)=>{const r=(0,t.drawBorderSegments)(e,n);const{drawVerticalLine:i,horizontalBorderIndex:o,spanningCellManager:a}=n;return(0,s.drawContent)({contents:r,drawSeparator:i,elementType:"border",rowIndex:o,separatorGetter:(0,t.createSeparatorGetter)(n),spanningCellManager:a})+"\n"};t.drawBorder=drawBorder;const drawBorderTop=(e,n)=>{const{border:s}=n;const r=(0,t.drawBorder)(e,{...n,separator:{body:s.topBody,join:s.topJoin,left:s.topLeft,right:s.topRight}});if(r==="\n"){return""}return r};t.drawBorderTop=drawBorderTop;const drawBorderJoin=(e,n)=>{const{border:s}=n;return(0,t.drawBorder)(e,{...n,separator:{body:s.joinBody,bodyJoinInner:s.bodyJoin,bodyJoinOuter:s.bodyLeft,join:s.joinJoin,joinDown:s.joinMiddleDown,joinLeft:s.joinMiddleLeft,joinRight:s.joinMiddleRight,joinUp:s.joinMiddleUp,left:s.joinLeft,right:s.joinRight}})};t.drawBorderJoin=drawBorderJoin;const drawBorderBottom=(e,n)=>{const{border:s}=n;return(0,t.drawBorder)(e,{...n,separator:{body:s.bottomBody,join:s.bottomJoin,left:s.bottomLeft,right:s.bottomRight}})};t.drawBorderBottom=drawBorderBottom;const createTableBorderGetter=(e,n)=>(s,r)=>{const i={...n,horizontalBorderIndex:s};if(s===0){return(0,t.drawBorderTop)(e,i)}else if(s===r){return(0,t.drawBorderBottom)(e,i)}return(0,t.drawBorderJoin)(e,i)};t.createTableBorderGetter=createTableBorderGetter},6499:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.drawContent=void 0;const drawContent=e=>{const{contents:t,separatorGetter:n,drawSeparator:s,spanningCellManager:r,rowIndex:i,elementType:o}=e;const a=t.length;const c=[];if(s(0,a)){c.push(n(0,a))}t.forEach(((e,t)=>{if(!o||o==="border"||o==="row"){c.push(e)}if(o==="cell"&&i===undefined){c.push(e)}if(o==="cell"&&i!==undefined){const n=r===null||r===void 0?void 0:r.getContainingRange({col:t,row:i});if(!n||t===n.topLeft.col){c.push(e)}}if(t+1<a&&s(t+1,a)){const e=n(t+1,a);if(o==="cell"&&i!==undefined){const n={col:t+1,row:i};const s=r===null||r===void 0?void 0:r.getContainingRange(n);if(!s||s.topLeft.col===n.col){c.push(e)}}else{c.push(e)}}}));if(s(a,a)){c.push(n(a,a))}return c.join("")};t.drawContent=drawContent},2698:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.drawRow=void 0;const s=n(6499);const drawRow=(e,t)=>{const{border:n,drawVerticalLine:r,rowIndex:i,spanningCellManager:o}=t;return(0,s.drawContent)({contents:e,drawSeparator:r,elementType:"cell",rowIndex:i,separatorGetter:(e,t)=>{if(e===0){return n.bodyLeft}if(e===t){return n.bodyRight}return n.bodyJoin},spanningCellManager:o})+"\n"};t.drawRow=drawRow},7910:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.drawTable=void 0;const s=n(46);const r=n(6499);const i=n(2698);const o=n(1497);const drawTable=(e,t,n,a)=>{const{drawHorizontalLine:c,singleLine:l}=a;const u=(0,o.groupBySizes)(e,n).map(((e,t)=>e.map((e=>(0,i.drawRow)(e,{...a,rowIndex:t}))).join("")));return(0,r.drawContent)({contents:u,drawSeparator:(e,t)=>{if(e===0||e===t){return c(e,t)}return!l&&c(e,t)},elementType:"row",rowIndex:-1,separatorGetter:(0,s.createTableBorderGetter)(t,{...a,rowCount:u.length}),spanningCellManager:a.spanningCellManager})};t.drawTable=drawTable},1423:(e,t,n)=>{"use strict";t["config.json"]=validate43;const s={$id:"config.json",$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{border:{$ref:"shared.json#/definitions/borders"},header:{type:"object",properties:{content:{type:"string"},alignment:{$ref:"shared.json#/definitions/alignment"},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},required:["content"],additionalProperties:false},columns:{$ref:"shared.json#/definitions/columns"},columnDefault:{$ref:"shared.json#/definitions/column"},drawVerticalLine:{typeof:"function"},drawHorizontalLine:{typeof:"function"},singleLine:{typeof:"boolean"},spanningCells:{type:"array",items:{type:"object",properties:{col:{type:"integer",minimum:0},row:{type:"integer",minimum:0},colSpan:{type:"integer",minimum:1},rowSpan:{type:"integer",minimum:1},alignment:{$ref:"shared.json#/definitions/alignment"},verticalAlignment:{$ref:"shared.json#/definitions/verticalAlignment"},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},required:["row","col"],additionalProperties:false}}},additionalProperties:false};const r={type:"object",properties:{topBody:{$ref:"#/definitions/border"},topJoin:{$ref:"#/definitions/border"},topLeft:{$ref:"#/definitions/border"},topRight:{$ref:"#/definitions/border"},bottomBody:{$ref:"#/definitions/border"},bottomJoin:{$ref:"#/definitions/border"},bottomLeft:{$ref:"#/definitions/border"},bottomRight:{$ref:"#/definitions/border"},bodyLeft:{$ref:"#/definitions/border"},bodyRight:{$ref:"#/definitions/border"},bodyJoin:{$ref:"#/definitions/border"},headerJoin:{$ref:"#/definitions/border"},joinBody:{$ref:"#/definitions/border"},joinLeft:{$ref:"#/definitions/border"},joinRight:{$ref:"#/definitions/border"},joinJoin:{$ref:"#/definitions/border"},joinMiddleUp:{$ref:"#/definitions/border"},joinMiddleDown:{$ref:"#/definitions/border"},joinMiddleLeft:{$ref:"#/definitions/border"},joinMiddleRight:{$ref:"#/definitions/border"}},additionalProperties:false};const i=Object.prototype.hasOwnProperty;const o={type:"string"};function validate46(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(typeof e!=="string"){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};if(i===null){i=[e]}else{i.push(e)}o++}validate46.errors=i;return o===0}function validate45(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:o=e}={}){let a=null;let c=0;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!i.call(r.properties,n)){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.topBody!==undefined){if(!validate46(e.topBody,{instancePath:t+"/topBody",parentData:e,parentDataProperty:"topBody",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.topJoin!==undefined){if(!validate46(e.topJoin,{instancePath:t+"/topJoin",parentData:e,parentDataProperty:"topJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.topLeft!==undefined){if(!validate46(e.topLeft,{instancePath:t+"/topLeft",parentData:e,parentDataProperty:"topLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.topRight!==undefined){if(!validate46(e.topRight,{instancePath:t+"/topRight",parentData:e,parentDataProperty:"topRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomBody!==undefined){if(!validate46(e.bottomBody,{instancePath:t+"/bottomBody",parentData:e,parentDataProperty:"bottomBody",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomJoin!==undefined){if(!validate46(e.bottomJoin,{instancePath:t+"/bottomJoin",parentData:e,parentDataProperty:"bottomJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomLeft!==undefined){if(!validate46(e.bottomLeft,{instancePath:t+"/bottomLeft",parentData:e,parentDataProperty:"bottomLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomRight!==undefined){if(!validate46(e.bottomRight,{instancePath:t+"/bottomRight",parentData:e,parentDataProperty:"bottomRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bodyLeft!==undefined){if(!validate46(e.bodyLeft,{instancePath:t+"/bodyLeft",parentData:e,parentDataProperty:"bodyLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bodyRight!==undefined){if(!validate46(e.bodyRight,{instancePath:t+"/bodyRight",parentData:e,parentDataProperty:"bodyRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bodyJoin!==undefined){if(!validate46(e.bodyJoin,{instancePath:t+"/bodyJoin",parentData:e,parentDataProperty:"bodyJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.headerJoin!==undefined){if(!validate46(e.headerJoin,{instancePath:t+"/headerJoin",parentData:e,parentDataProperty:"headerJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinBody!==undefined){if(!validate46(e.joinBody,{instancePath:t+"/joinBody",parentData:e,parentDataProperty:"joinBody",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinLeft!==undefined){if(!validate46(e.joinLeft,{instancePath:t+"/joinLeft",parentData:e,parentDataProperty:"joinLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinRight!==undefined){if(!validate46(e.joinRight,{instancePath:t+"/joinRight",parentData:e,parentDataProperty:"joinRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinJoin!==undefined){if(!validate46(e.joinJoin,{instancePath:t+"/joinJoin",parentData:e,parentDataProperty:"joinJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleUp!==undefined){if(!validate46(e.joinMiddleUp,{instancePath:t+"/joinMiddleUp",parentData:e,parentDataProperty:"joinMiddleUp",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleDown!==undefined){if(!validate46(e.joinMiddleDown,{instancePath:t+"/joinMiddleDown",parentData:e,parentDataProperty:"joinMiddleDown",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleLeft!==undefined){if(!validate46(e.joinMiddleLeft,{instancePath:t+"/joinMiddleLeft",parentData:e,parentDataProperty:"joinMiddleLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleRight!==undefined){if(!validate46(e.joinMiddleRight,{instancePath:t+"/joinMiddleRight",parentData:e,parentDataProperty:"joinMiddleRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(a===null){a=[e]}else{a.push(e)}c++}validate45.errors=a;return c===0}const a={type:"string",enum:["left","right","center","justify"]};const c=n(4951).A;function validate68(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(typeof e!=="string"){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};if(i===null){i=[e]}else{i.push(e)}o++}if(!(e==="left"||e==="right"||e==="center"||e==="justify")){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:a.enum},message:"must be equal to one of the allowed values"};if(i===null){i=[e]}else{i.push(e)}o++}validate68.errors=i;return o===0}const l={oneOf:[{type:"object",patternProperties:{"^[0-9]+$":{$ref:"#/definitions/column"}},additionalProperties:false},{type:"array",items:{$ref:"#/definitions/column"}}]};const u=new RegExp("^[0-9]+$","u");const d={type:"object",properties:{alignment:{$ref:"#/definitions/alignment"},verticalAlignment:{$ref:"#/definitions/verticalAlignment"},width:{type:"integer",minimum:1},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},additionalProperties:false};function validate72(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(typeof e!=="string"){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};if(i===null){i=[e]}else{i.push(e)}o++}if(!(e==="left"||e==="right"||e==="center"||e==="justify")){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:a.enum},message:"must be equal to one of the allowed values"};if(i===null){i=[e]}else{i.push(e)}o++}validate72.errors=i;return o===0}const f={type:"string",enum:["top","middle","bottom"]};function validate74(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(typeof e!=="string"){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};if(i===null){i=[e]}else{i.push(e)}o++}if(!(e==="top"||e==="middle"||e==="bottom")){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:f.enum},message:"must be equal to one of the allowed values"};if(i===null){i=[e]}else{i.push(e)}o++}validate74.errors=i;return o===0}function validate71(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!(n==="alignment"||n==="verticalAlignment"||n==="width"||n==="wrapWord"||n==="truncate"||n==="paddingLeft"||n==="paddingRight")){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.alignment!==undefined){if(!validate72(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:r})){i=i===null?validate72.errors:i.concat(validate72.errors);o=i.length}}if(e.verticalAlignment!==undefined){if(!validate74(e.verticalAlignment,{instancePath:t+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:r})){i=i===null?validate74.errors:i.concat(validate74.errors);o=i.length}}if(e.width!==undefined){let n=e.width;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}if(typeof n=="number"&&isFinite(n)){if(n<1||isNaN(n)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};if(i===null){i=[e]}else{i.push(e)}o++}}}if(e.wrapWord!==undefined){if(typeof e.wrapWord!=="boolean"){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.truncate!==undefined){let n=e.truncate;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.paddingLeft!==undefined){let n=e.paddingLeft;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.paddingRight!==undefined){let n=e.paddingRight;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(i===null){i=[e]}else{i.push(e)}o++}validate71.errors=i;return o===0}function validate70(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;const a=o;let c=false;let l=null;const d=o;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!u.test(n)){const e={instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(i===null){i=[e]}else{i.push(e)}o++}}for(const n in e){if(u.test(n)){if(!validate71(e[n],{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:r})){i=i===null?validate71.errors:i.concat(validate71.errors);o=i.length}}}}else{const e={instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};if(i===null){i=[e]}else{i.push(e)}o++}var f=d===o;if(f){c=true;l=0}const p=o;if(Array.isArray(e)){const n=e.length;for(let s=0;s<n;s++){if(!validate71(e[s],{instancePath:t+"/"+s,parentData:e,parentDataProperty:s,rootData:r})){i=i===null?validate71.errors:i.concat(validate71.errors);o=i.length}}}else{const e={instancePath:t,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};if(i===null){i=[e]}else{i.push(e)}o++}var f=p===o;if(f&&c){c=false;l=[l,1]}else{if(f){c=true;l=1}}if(!c){const e={instancePath:t,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas:l},message:"must match exactly one schema in oneOf"};if(i===null){i=[e]}else{i.push(e)}o++}else{o=a;if(i!==null){if(a){i.length=a}else{i=null}}}validate70.errors=i;return o===0}function validate79(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!(n==="alignment"||n==="verticalAlignment"||n==="width"||n==="wrapWord"||n==="truncate"||n==="paddingLeft"||n==="paddingRight")){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.alignment!==undefined){if(!validate72(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:r})){i=i===null?validate72.errors:i.concat(validate72.errors);o=i.length}}if(e.verticalAlignment!==undefined){if(!validate74(e.verticalAlignment,{instancePath:t+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:r})){i=i===null?validate74.errors:i.concat(validate74.errors);o=i.length}}if(e.width!==undefined){let n=e.width;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}if(typeof n=="number"&&isFinite(n)){if(n<1||isNaN(n)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};if(i===null){i=[e]}else{i.push(e)}o++}}}if(e.wrapWord!==undefined){if(typeof e.wrapWord!=="boolean"){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.truncate!==undefined){let n=e.truncate;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.paddingLeft!==undefined){let n=e.paddingLeft;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.paddingRight!==undefined){let n=e.paddingRight;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(i===null){i=[e]}else{i.push(e)}o++}validate79.errors=i;return o===0}function validate84(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(typeof e!=="string"){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};if(i===null){i=[e]}else{i.push(e)}o++}if(!(e==="top"||e==="middle"||e==="bottom")){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:f.enum},message:"must be equal to one of the allowed values"};if(i===null){i=[e]}else{i.push(e)}o++}validate84.errors=i;return o===0}function validate43(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let a=null;let c=0;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!(n==="border"||n==="header"||n==="columns"||n==="columnDefault"||n==="drawVerticalLine"||n==="drawHorizontalLine"||n==="singleLine"||n==="spanningCells")){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.border!==undefined){if(!validate45(e.border,{instancePath:t+"/border",parentData:e,parentDataProperty:"border",rootData:o})){a=a===null?validate45.errors:a.concat(validate45.errors);c=a.length}}if(e.header!==undefined){let n=e.header;if(n&&typeof n=="object"&&!Array.isArray(n)){if(n.content===undefined){const e={instancePath:t+"/header",schemaPath:"#/properties/header/required",keyword:"required",params:{missingProperty:"content"},message:"must have required property '"+"content"+"'"};if(a===null){a=[e]}else{a.push(e)}c++}for(const e in n){if(!(e==="content"||e==="alignment"||e==="wrapWord"||e==="truncate"||e==="paddingLeft"||e==="paddingRight")){const n={instancePath:t+"/header",schemaPath:"#/properties/header/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:e},message:"must NOT have additional properties"};if(a===null){a=[n]}else{a.push(n)}c++}}if(n.content!==undefined){if(typeof n.content!=="string"){const e={instancePath:t+"/header/content",schemaPath:"#/properties/header/properties/content/type",keyword:"type",params:{type:"string"},message:"must be string"};if(a===null){a=[e]}else{a.push(e)}c++}}if(n.alignment!==undefined){if(!validate68(n.alignment,{instancePath:t+"/header/alignment",parentData:n,parentDataProperty:"alignment",rootData:o})){a=a===null?validate68.errors:a.concat(validate68.errors);c=a.length}}if(n.wrapWord!==undefined){if(typeof n.wrapWord!=="boolean"){const e={instancePath:t+"/header/wrapWord",schemaPath:"#/properties/header/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};if(a===null){a=[e]}else{a.push(e)}c++}}if(n.truncate!==undefined){let e=n.truncate;if(!(typeof e=="number"&&(!(e%1)&&!isNaN(e))&&isFinite(e))){const e={instancePath:t+"/header/truncate",schemaPath:"#/properties/header/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}}if(n.paddingLeft!==undefined){let e=n.paddingLeft;if(!(typeof e=="number"&&(!(e%1)&&!isNaN(e))&&isFinite(e))){const e={instancePath:t+"/header/paddingLeft",schemaPath:"#/properties/header/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}}if(n.paddingRight!==undefined){let e=n.paddingRight;if(!(typeof e=="number"&&(!(e%1)&&!isNaN(e))&&isFinite(e))){const e={instancePath:t+"/header/paddingRight",schemaPath:"#/properties/header/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}}}else{const e={instancePath:t+"/header",schemaPath:"#/properties/header/type",keyword:"type",params:{type:"object"},message:"must be object"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.columns!==undefined){if(!validate70(e.columns,{instancePath:t+"/columns",parentData:e,parentDataProperty:"columns",rootData:o})){a=a===null?validate70.errors:a.concat(validate70.errors);c=a.length}}if(e.columnDefault!==undefined){if(!validate79(e.columnDefault,{instancePath:t+"/columnDefault",parentData:e,parentDataProperty:"columnDefault",rootData:o})){a=a===null?validate79.errors:a.concat(validate79.errors);c=a.length}}if(e.drawVerticalLine!==undefined){if(typeof e.drawVerticalLine!="function"){const e={instancePath:t+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.drawHorizontalLine!==undefined){if(typeof e.drawHorizontalLine!="function"){const e={instancePath:t+"/drawHorizontalLine",schemaPath:"#/properties/drawHorizontalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.singleLine!==undefined){if(typeof e.singleLine!="boolean"){const e={instancePath:t+"/singleLine",schemaPath:"#/properties/singleLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.spanningCells!==undefined){let n=e.spanningCells;if(Array.isArray(n)){const e=n.length;for(let r=0;r<e;r++){let e=n[r];if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.row===undefined){const e={instancePath:t+"/spanningCells/"+r,schemaPath:"#/properties/spanningCells/items/required",keyword:"required",params:{missingProperty:"row"},message:"must have required property '"+"row"+"'"};if(a===null){a=[e]}else{a.push(e)}c++}if(e.col===undefined){const e={instancePath:t+"/spanningCells/"+r,schemaPath:"#/properties/spanningCells/items/required",keyword:"required",params:{missingProperty:"col"},message:"must have required property '"+"col"+"'"};if(a===null){a=[e]}else{a.push(e)}c++}for(const n in e){if(!i.call(s.properties.spanningCells.items.properties,n)){const e={instancePath:t+"/spanningCells/"+r,schemaPath:"#/properties/spanningCells/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.col!==undefined){let n=e.col;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/col",schemaPath:"#/properties/spanningCells/items/properties/col/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}if(typeof n=="number"&&isFinite(n)){if(n<0||isNaN(n)){const e={instancePath:t+"/spanningCells/"+r+"/col",schemaPath:"#/properties/spanningCells/items/properties/col/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};if(a===null){a=[e]}else{a.push(e)}c++}}}if(e.row!==undefined){let n=e.row;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/row",schemaPath:"#/properties/spanningCells/items/properties/row/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}if(typeof n=="number"&&isFinite(n)){if(n<0||isNaN(n)){const e={instancePath:t+"/spanningCells/"+r+"/row",schemaPath:"#/properties/spanningCells/items/properties/row/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};if(a===null){a=[e]}else{a.push(e)}c++}}}if(e.colSpan!==undefined){let n=e.colSpan;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/colSpan",schemaPath:"#/properties/spanningCells/items/properties/colSpan/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}if(typeof n=="number"&&isFinite(n)){if(n<1||isNaN(n)){const e={instancePath:t+"/spanningCells/"+r+"/colSpan",schemaPath:"#/properties/spanningCells/items/properties/colSpan/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};if(a===null){a=[e]}else{a.push(e)}c++}}}if(e.rowSpan!==undefined){let n=e.rowSpan;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/rowSpan",schemaPath:"#/properties/spanningCells/items/properties/rowSpan/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}if(typeof n=="number"&&isFinite(n)){if(n<1||isNaN(n)){const e={instancePath:t+"/spanningCells/"+r+"/rowSpan",schemaPath:"#/properties/spanningCells/items/properties/rowSpan/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};if(a===null){a=[e]}else{a.push(e)}c++}}}if(e.alignment!==undefined){if(!validate68(e.alignment,{instancePath:t+"/spanningCells/"+r+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:o})){a=a===null?validate68.errors:a.concat(validate68.errors);c=a.length}}if(e.verticalAlignment!==undefined){if(!validate84(e.verticalAlignment,{instancePath:t+"/spanningCells/"+r+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:o})){a=a===null?validate84.errors:a.concat(validate84.errors);c=a.length}}if(e.wrapWord!==undefined){if(typeof e.wrapWord!=="boolean"){const e={instancePath:t+"/spanningCells/"+r+"/wrapWord",schemaPath:"#/properties/spanningCells/items/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.truncate!==undefined){let n=e.truncate;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/truncate",schemaPath:"#/properties/spanningCells/items/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.paddingLeft!==undefined){let n=e.paddingLeft;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/paddingLeft",schemaPath:"#/properties/spanningCells/items/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.paddingRight!==undefined){let n=e.paddingRight;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/paddingRight",schemaPath:"#/properties/spanningCells/items/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}}}else{const e={instancePath:t+"/spanningCells/"+r,schemaPath:"#/properties/spanningCells/items/type",keyword:"type",params:{type:"object"},message:"must be object"};if(a===null){a=[e]}else{a.push(e)}c++}}}else{const e={instancePath:t+"/spanningCells",schemaPath:"#/properties/spanningCells/type",keyword:"type",params:{type:"array"},message:"must be array"};if(a===null){a=[e]}else{a.push(e)}c++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(a===null){a=[e]}else{a.push(e)}c++}validate43.errors=a;return c===0}t["streamConfig.json"]=validate86;const p={$id:"streamConfig.json",$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{border:{$ref:"shared.json#/definitions/borders"},columns:{$ref:"shared.json#/definitions/columns"},columnDefault:{$ref:"shared.json#/definitions/column"},columnCount:{type:"integer",minimum:1},drawVerticalLine:{typeof:"function"}},required:["columnDefault","columnCount"],additionalProperties:false};function validate87(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:o=e}={}){let a=null;let c=0;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!i.call(r.properties,n)){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.topBody!==undefined){if(!validate46(e.topBody,{instancePath:t+"/topBody",parentData:e,parentDataProperty:"topBody",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.topJoin!==undefined){if(!validate46(e.topJoin,{instancePath:t+"/topJoin",parentData:e,parentDataProperty:"topJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.topLeft!==undefined){if(!validate46(e.topLeft,{instancePath:t+"/topLeft",parentData:e,parentDataProperty:"topLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.topRight!==undefined){if(!validate46(e.topRight,{instancePath:t+"/topRight",parentData:e,parentDataProperty:"topRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomBody!==undefined){if(!validate46(e.bottomBody,{instancePath:t+"/bottomBody",parentData:e,parentDataProperty:"bottomBody",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomJoin!==undefined){if(!validate46(e.bottomJoin,{instancePath:t+"/bottomJoin",parentData:e,parentDataProperty:"bottomJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomLeft!==undefined){if(!validate46(e.bottomLeft,{instancePath:t+"/bottomLeft",parentData:e,parentDataProperty:"bottomLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomRight!==undefined){if(!validate46(e.bottomRight,{instancePath:t+"/bottomRight",parentData:e,parentDataProperty:"bottomRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bodyLeft!==undefined){if(!validate46(e.bodyLeft,{instancePath:t+"/bodyLeft",parentData:e,parentDataProperty:"bodyLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bodyRight!==undefined){if(!validate46(e.bodyRight,{instancePath:t+"/bodyRight",parentData:e,parentDataProperty:"bodyRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bodyJoin!==undefined){if(!validate46(e.bodyJoin,{instancePath:t+"/bodyJoin",parentData:e,parentDataProperty:"bodyJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.headerJoin!==undefined){if(!validate46(e.headerJoin,{instancePath:t+"/headerJoin",parentData:e,parentDataProperty:"headerJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinBody!==undefined){if(!validate46(e.joinBody,{instancePath:t+"/joinBody",parentData:e,parentDataProperty:"joinBody",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinLeft!==undefined){if(!validate46(e.joinLeft,{instancePath:t+"/joinLeft",parentData:e,parentDataProperty:"joinLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinRight!==undefined){if(!validate46(e.joinRight,{instancePath:t+"/joinRight",parentData:e,parentDataProperty:"joinRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinJoin!==undefined){if(!validate46(e.joinJoin,{instancePath:t+"/joinJoin",parentData:e,parentDataProperty:"joinJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleUp!==undefined){if(!validate46(e.joinMiddleUp,{instancePath:t+"/joinMiddleUp",parentData:e,parentDataProperty:"joinMiddleUp",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleDown!==undefined){if(!validate46(e.joinMiddleDown,{instancePath:t+"/joinMiddleDown",parentData:e,parentDataProperty:"joinMiddleDown",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleLeft!==undefined){if(!validate46(e.joinMiddleLeft,{instancePath:t+"/joinMiddleLeft",parentData:e,parentDataProperty:"joinMiddleLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleRight!==undefined){if(!validate46(e.joinMiddleRight,{instancePath:t+"/joinMiddleRight",parentData:e,parentDataProperty:"joinMiddleRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(a===null){a=[e]}else{a.push(e)}c++}validate87.errors=a;return c===0}function validate109(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;const a=o;let c=false;let l=null;const d=o;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!u.test(n)){const e={instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(i===null){i=[e]}else{i.push(e)}o++}}for(const n in e){if(u.test(n)){if(!validate71(e[n],{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:r})){i=i===null?validate71.errors:i.concat(validate71.errors);o=i.length}}}}else{const e={instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};if(i===null){i=[e]}else{i.push(e)}o++}var f=d===o;if(f){c=true;l=0}const p=o;if(Array.isArray(e)){const n=e.length;for(let s=0;s<n;s++){if(!validate71(e[s],{instancePath:t+"/"+s,parentData:e,parentDataProperty:s,rootData:r})){i=i===null?validate71.errors:i.concat(validate71.errors);o=i.length}}}else{const e={instancePath:t,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};if(i===null){i=[e]}else{i.push(e)}o++}var f=p===o;if(f&&c){c=false;l=[l,1]}else{if(f){c=true;l=1}}if(!c){const e={instancePath:t,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas:l},message:"must match exactly one schema in oneOf"};if(i===null){i=[e]}else{i.push(e)}o++}else{o=a;if(i!==null){if(a){i.length=a}else{i=null}}}validate109.errors=i;return o===0}function validate113(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!(n==="alignment"||n==="verticalAlignment"||n==="width"||n==="wrapWord"||n==="truncate"||n==="paddingLeft"||n==="paddingRight")){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.alignment!==undefined){if(!validate72(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:r})){i=i===null?validate72.errors:i.concat(validate72.errors);o=i.length}}if(e.verticalAlignment!==undefined){if(!validate74(e.verticalAlignment,{instancePath:t+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:r})){i=i===null?validate74.errors:i.concat(validate74.errors);o=i.length}}if(e.width!==undefined){let n=e.width;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}if(typeof n=="number"&&isFinite(n)){if(n<1||isNaN(n)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};if(i===null){i=[e]}else{i.push(e)}o++}}}if(e.wrapWord!==undefined){if(typeof e.wrapWord!=="boolean"){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.truncate!==undefined){let n=e.truncate;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.paddingLeft!==undefined){let n=e.paddingLeft;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.paddingRight!==undefined){let n=e.paddingRight;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(i===null){i=[e]}else{i.push(e)}o++}validate113.errors=i;return o===0}function validate86(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.columnDefault===undefined){const e={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnDefault"},message:"must have required property '"+"columnDefault"+"'"};if(i===null){i=[e]}else{i.push(e)}o++}if(e.columnCount===undefined){const e={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnCount"},message:"must have required property '"+"columnCount"+"'"};if(i===null){i=[e]}else{i.push(e)}o++}for(const n in e){if(!(n==="border"||n==="columns"||n==="columnDefault"||n==="columnCount"||n==="drawVerticalLine")){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.border!==undefined){if(!validate87(e.border,{instancePath:t+"/border",parentData:e,parentDataProperty:"border",rootData:r})){i=i===null?validate87.errors:i.concat(validate87.errors);o=i.length}}if(e.columns!==undefined){if(!validate109(e.columns,{instancePath:t+"/columns",parentData:e,parentDataProperty:"columns",rootData:r})){i=i===null?validate109.errors:i.concat(validate109.errors);o=i.length}}if(e.columnDefault!==undefined){if(!validate113(e.columnDefault,{instancePath:t+"/columnDefault",parentData:e,parentDataProperty:"columnDefault",rootData:r})){i=i===null?validate113.errors:i.concat(validate113.errors);o=i.length}}if(e.columnCount!==undefined){let n=e.columnCount;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/columnCount",schemaPath:"#/properties/columnCount/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}if(typeof n=="number"&&isFinite(n)){if(n<1||isNaN(n)){const e={instancePath:t+"/columnCount",schemaPath:"#/properties/columnCount/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};if(i===null){i=[e]}else{i.push(e)}o++}}}if(e.drawVerticalLine!==undefined){if(typeof e.drawVerticalLine!="function"){const e={instancePath:t+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};if(i===null){i=[e]}else{i.push(e)}o++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(i===null){i=[e]}else{i.push(e)}o++}validate86.errors=i;return o===0}},5966:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getBorderCharacters=void 0;const getBorderCharacters=e=>{if(e==="honeywell"){return{topBody:"═",topJoin:"╤",topLeft:"╔",topRight:"╗",bottomBody:"═",bottomJoin:"╧",bottomLeft:"╚",bottomRight:"╝",bodyLeft:"║",bodyRight:"║",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"╟",joinRight:"╢",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"}}if(e==="norc"){return{topBody:"─",topJoin:"┬",topLeft:"┌",topRight:"┐",bottomBody:"─",bottomJoin:"┴",bottomLeft:"└",bottomRight:"┘",bodyLeft:"│",bodyRight:"│",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"├",joinRight:"┤",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"}}if(e==="ramac"){return{topBody:"-",topJoin:"+",topLeft:"+",topRight:"+",bottomBody:"-",bottomJoin:"+",bottomLeft:"+",bottomRight:"+",bodyLeft:"|",bodyRight:"|",bodyJoin:"|",headerJoin:"+",joinBody:"-",joinLeft:"|",joinRight:"|",joinJoin:"|",joinMiddleDown:"+",joinMiddleUp:"+",joinMiddleLeft:"+",joinMiddleRight:"+"}}if(e==="void"){return{topBody:"",topJoin:"",topLeft:"",topRight:"",bottomBody:"",bottomJoin:"",bottomLeft:"",bottomRight:"",bodyLeft:"",bodyRight:"",bodyJoin:"",headerJoin:"",joinBody:"",joinLeft:"",joinRight:"",joinJoin:"",joinMiddleDown:"",joinMiddleUp:"",joinMiddleLeft:"",joinMiddleRight:""}}throw new Error('Unknown border template "'+e+'".')};t.getBorderCharacters=getBorderCharacters},4112:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});t.getBorderCharacters=t.createStream=t.table=void 0;const i=n(6334);Object.defineProperty(t,"createStream",{enumerable:true,get:function(){return i.createStream}});const o=n(5966);Object.defineProperty(t,"getBorderCharacters",{enumerable:true,get:function(){return o.getBorderCharacters}});const a=n(4700);Object.defineProperty(t,"table",{enumerable:true,get:function(){return a.table}});r(n(1782),t)},1128:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.injectHeaderConfig=void 0;const injectHeaderConfig=(e,t)=>{var n;let s=(n=t.spanningCells)!==null&&n!==void 0?n:[];const r=t.header;const i=[...e];if(r){s=s.map((({row:e,...t})=>({...t,row:e+1})));const{content:t,...n}=r;s.unshift({alignment:"center",col:0,colSpan:e[0].length,paddingLeft:1,paddingRight:1,row:0,wrapWord:false,...n});i.unshift([t,...Array.from({length:e[0].length-1}).fill("")])}return[i,s]};t.injectHeaderConfig=injectHeaderConfig},261:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.makeRangeConfig=void 0;const s=n(1497);const makeRangeConfig=(e,t)=>{var n;const{topLeft:r,bottomRight:i}=(0,s.calculateRangeCoordinate)(e);const o={...t[r.col],...e,paddingRight:(n=e.paddingRight)!==null&&n!==void 0?n:t[i.col].paddingRight};return{...o,bottomRight:i,topLeft:r}};t.makeRangeConfig=makeRangeConfig},7366:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.makeStreamConfig=void 0;const s=n(1497);const r=n(2474);const makeColumnsConfig=(e,t={},n)=>Array.from({length:e}).map(((e,s)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",wrapWord:false,...n,...t[s]})));const makeStreamConfig=e=>{(0,r.validateConfig)("streamConfig.json",e);if(e.columnDefault.width===undefined){throw new Error("Must provide config.columnDefault.width when creating a stream.")}return{drawVerticalLine:()=>true,...e,border:(0,s.makeBorderConfig)(e.border),columns:makeColumnsConfig(e.columnCount,e.columns,e.columnDefault)}};t.makeStreamConfig=makeStreamConfig},5576:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.makeTableConfig=void 0;const s=n(67);const r=n(8705);const i=n(1497);const o=n(2474);const a=n(5252);const makeColumnsConfig=(e,t,n,r)=>{const i=(0,s.calculateMaximumColumnWidths)(e,r);return e[0].map(((e,s)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",width:i[s],wrapWord:false,...n,...t===null||t===void 0?void 0:t[s]})))};const makeTableConfig=(e,t={},n)=>{var s,c,l,u,d;(0,o.validateConfig)("config.json",t);(0,a.validateSpanningCellConfig)(e,(s=t.spanningCells)!==null&&s!==void 0?s:[]);const f=(c=n!==null&&n!==void 0?n:t.spanningCells)!==null&&c!==void 0?c:[];const p=makeColumnsConfig(e,t.columns,t.columnDefault,f);const h=(l=t.drawVerticalLine)!==null&&l!==void 0?l:()=>true;const m=(u=t.drawHorizontalLine)!==null&&u!==void 0?u:()=>true;return{...t,border:(0,i.makeBorderConfig)(t.border),columns:p,drawHorizontalLine:m,drawVerticalLine:h,singleLine:(d=t.singleLine)!==null&&d!==void 0?d:false,spanningCellManager:(0,r.createSpanningCellManager)({columnsConfig:p,drawHorizontalLine:m,drawVerticalLine:h,rows:e,spanningCellConfigs:f})}};t.makeTableConfig=makeTableConfig},8188:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.mapDataUsingRowHeights=t.padCellVertically=void 0;const s=n(1497);const r=n(8966);const createEmptyStrings=e=>new Array(e).fill("");const padCellVertically=(e,t,n)=>{const s=t-e.length;if(n==="top"){return[...e,...createEmptyStrings(s)]}if(n==="bottom"){return[...createEmptyStrings(s),...e]}return[...createEmptyStrings(Math.floor(s/2)),...e,...createEmptyStrings(Math.ceil(s/2))]};t.padCellVertically=padCellVertically;const mapDataUsingRowHeights=(e,n,i)=>{const o=e[0].length;const a=e.map(((e,s)=>{const a=n[s];const c=Array.from({length:a},(()=>new Array(o).fill("")));e.forEach(((e,n)=>{var o;const l=(o=i.spanningCellManager)===null||o===void 0?void 0:o.getContainingRange({col:n,row:s});if(l){l.extractCellContent(s).forEach(((e,t)=>{c[t][n]=e}));return}const u=(0,r.wrapCell)(e,i.columns[n].width,i.columns[n].wrapWord);const d=(0,t.padCellVertically)(u,a,i.columns[n].verticalAlignment);d.forEach(((e,t)=>{c[t][n]=e}))}));return c}));return(0,s.flatten)(a)};t.mapDataUsingRowHeights=mapDataUsingRowHeights},8649:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.padTableData=t.padString=void 0;const padString=(e,t,n)=>" ".repeat(t)+e+" ".repeat(n);t.padString=padString;const padTableData=(e,n)=>e.map(((e,s)=>e.map(((e,r)=>{var i;const o=(i=n.spanningCellManager)===null||i===void 0?void 0:i.getContainingRange({col:r,row:s},{mapped:true});if(o){return e}const{paddingLeft:a,paddingRight:c}=n.columns[r];return(0,t.padString)(e,a,c)}))));t.padTableData=padTableData},8705:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createSpanningCellManager=void 0;const s=n(2651);const r=n(888);const i=n(261);const o=n(1497);const findRangeConfig=(e,t)=>t.find((t=>(0,o.isCellInRange)(e,t)));const getContainingRange=(e,t)=>{const n=(0,r.calculateSpanningCellWidth)(e,t);const i=(0,s.wrapRangeContent)(e,n,t);const a=(0,s.alignVerticalRangeContent)(e,i,t);const getCellContent=n=>{const{topLeft:s}=e;const{drawHorizontalLine:r,rowHeights:i}=t;const c=n-s.row;const l=(0,o.sequence)(s.row+1,n).filter((e=>!(r===null||r===void 0?void 0:r(e,i.length)))).length;const u=(0,o.sumArray)(i.slice(s.row,n))+c-l;return a.slice(u,u+i[n])};const getBorderContent=n=>{const{topLeft:s}=e;const r=(0,o.sumArray)(t.rowHeights.slice(s.row,n))+(n-s.row-1);return a[r]};return{...e,extractBorderContent:getBorderContent,extractCellContent:getCellContent,height:i.length,width:n}};const inSameRange=(e,t,n)=>{const s=findRangeConfig(e,n);const r=findRangeConfig(t,n);if(s&&r){return(0,o.areCellEqual)(s.topLeft,r.topLeft)}return false};const hashRange=e=>{const{row:t,col:n}=e.topLeft;return`${t}/${n}`};const createSpanningCellManager=e=>{const{spanningCellConfigs:t,columnsConfig:n}=e;const s=t.map((e=>(0,i.makeRangeConfig)(e,n)));const r={};let a=[];let c=[];return{getContainingRange:(t,n)=>{var i;const o=(n===null||n===void 0?void 0:n.mapped)?c[t.row]:t.row;const l=findRangeConfig({...t,row:o},s);if(!l){return undefined}if(a.length===0){return getContainingRange(l,{...e,rowHeights:a})}const u=hashRange(l);(i=r[u])!==null&&i!==void 0?i:r[u]=getContainingRange(l,{...e,rowHeights:a});return r[u]},inSameRange:(e,t)=>inSameRange(e,t,s),rowHeights:a,rowIndexMapping:c,setRowHeights:e=>{a=e},setRowIndexMapping:e=>{c=(0,o.flatten)(e.map(((e,t)=>Array.from({length:e},(()=>t)))))}}};t.createSpanningCellManager=createSpanningCellManager},3337:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.stringifyTableData=void 0;const s=n(1497);const stringifyTableData=e=>e.map((e=>e.map((e=>(0,s.normalizeString)(String(e))))));t.stringifyTableData=stringifyTableData},4700:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.table=void 0;const s=n(7061);const r=n(6246);const i=n(2696);const o=n(7910);const a=n(1128);const c=n(5576);const l=n(8188);const u=n(8649);const d=n(3337);const f=n(4042);const p=n(1497);const h=n(8310);const table=(e,t={})=>{(0,h.validateTableData)(e);let n=(0,d.stringifyTableData)(e);const[m,g]=(0,a.injectHeaderConfig)(n,t);const y=(0,c.makeTableConfig)(m,t,g);n=(0,f.truncateTableData)(m,(0,p.extractTruncates)(y));const b=(0,i.calculateRowHeights)(n,y);y.spanningCellManager.setRowHeights(b);y.spanningCellManager.setRowIndexMapping(b);n=(0,l.mapDataUsingRowHeights)(n,b,y);n=(0,s.alignTableData)(n,y);n=(0,u.padTableData)(n,y);const v=(0,r.calculateOutputColumnWidths)(y);return(0,o.drawTable)(n,v,b,y)};t.table=table},4042:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.truncateTableData=t.truncateString=void 0;const r=s(n(4055));const truncateString=(e,t)=>(0,r.default)(e,{length:t,omission:"…"});t.truncateString=truncateString;const truncateTableData=(e,n)=>e.map((e=>e.map(((e,s)=>(0,t.truncateString)(e,n[s])))));t.truncateTableData=truncateTableData},1782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1497:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.isCellInRange=t.areCellEqual=t.calculateRangeCoordinate=t.flatten=t.extractTruncates=t.sumArray=t.sequence=t.distributeUnevenly=t.countSpaceSequence=t.groupBySizes=t.makeBorderConfig=t.splitAnsi=t.normalizeString=void 0;const r=s(n(3298));const i=s(n(60));const o=s(n(3958));const a=n(5966);const normalizeString=e=>e.replace(/\r\n/g,"\n");t.normalizeString=normalizeString;const splitAnsi=e=>{const t=(0,o.default)(e).split("\n").map(i.default);const n=[];let s=0;t.forEach((t=>{n.push(t===0?"":(0,r.default)(e,s,s+t));s+=t+1}));return n};t.splitAnsi=splitAnsi;const makeBorderConfig=e=>({...(0,a.getBorderCharacters)("honeywell"),...e});t.makeBorderConfig=makeBorderConfig;const groupBySizes=(e,t)=>{let n=0;return t.map((t=>{const s=e.slice(n,n+t);n+=t;return s}))};t.groupBySizes=groupBySizes;const countSpaceSequence=e=>{var t,n;return(n=(t=e.match(/\s+/g))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0};t.countSpaceSequence=countSpaceSequence;const distributeUnevenly=(e,t)=>{const n=Array.from({length:t}).fill(Math.floor(e/t));return n.map(((n,s)=>n+(s<e%t?1:0)))};t.distributeUnevenly=distributeUnevenly;const sequence=(e,t)=>Array.from({length:t-e+1},((t,n)=>n+e));t.sequence=sequence;const sumArray=e=>e.reduce(((e,t)=>e+t),0);t.sumArray=sumArray;const extractTruncates=e=>e.columns.map((({truncate:e})=>e));t.extractTruncates=extractTruncates;const flatten=e=>[].concat(...e);t.flatten=flatten;const calculateRangeCoordinate=e=>{const{row:t,col:n,colSpan:s=1,rowSpan:r=1}=e;return{bottomRight:{col:n+s-1,row:t+r-1},topLeft:{col:n,row:t}}};t.calculateRangeCoordinate=calculateRangeCoordinate;const areCellEqual=(e,t)=>e.row===t.row&&e.col===t.col;t.areCellEqual=areCellEqual;const isCellInRange=(e,{topLeft:t,bottomRight:n})=>t.row<=e.row&&e.row<=n.row&&t.col<=e.col&&e.col<=n.col;t.isCellInRange=isCellInRange},2474:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.validateConfig=void 0;const r=s(n(1423));const validateConfig=(e,t)=>{const n=r.default[e];if(!n(t)&&n.errors){const e=n.errors.map((e=>({message:e.message,params:e.params,schemaPath:e.schemaPath})));console.log("config",t);console.log("errors",e);throw new Error("Invalid config.")}};t.validateConfig=validateConfig},5252:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateSpanningCellConfig=void 0;const s=n(1497);const inRange=(e,t,n)=>e<=n&&n<=t;const validateSpanningCellConfig=(e,t)=>{const[n,r]=[e.length,e[0].length];t.forEach(((e,t)=>{const{colSpan:n,rowSpan:s}=e;if(n===undefined&&s===undefined){throw new Error(`Expect at least colSpan or rowSpan is provided in config.spanningCells[${t}]`)}if(n!==undefined&&n<1){throw new Error(`Expect colSpan is not equal zero, instead got: ${n} in config.spanningCells[${t}]`)}if(s!==undefined&&s<1){throw new Error(`Expect rowSpan is not equal zero, instead got: ${s} in config.spanningCells[${t}]`)}}));const i=t.map(s.calculateRangeCoordinate);i.forEach((({topLeft:e,bottomRight:t},s)=>{if(!inRange(0,r-1,e.col)||!inRange(0,n-1,e.row)||!inRange(0,r-1,t.col)||!inRange(0,n-1,t.row)){throw new Error(`Some cells in config.spanningCells[${s}] are out of the table`)}}));const o=Array.from({length:n},(()=>Array.from({length:r})));i.forEach((({topLeft:e,bottomRight:t},n)=>{(0,s.sequence)(e.row,t.row).forEach((r=>{(0,s.sequence)(e.col,t.col).forEach((e=>{if(o[r][e]!==undefined){throw new Error(`Spanning cells in config.spanningCells[${o[r][e]}] and config.spanningCells[${n}] are overlap each other`)}o[r][e]=n}))}))}))};t.validateSpanningCellConfig=validateSpanningCellConfig},8310:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateTableData=void 0;const s=n(1497);const validateTableData=e=>{if(!Array.isArray(e)){throw new TypeError("Table data must be an array.")}if(e.length===0){throw new Error("Table must define at least one row.")}if(e[0].length===0){throw new Error("Table must define at least one column.")}const t=e[0].length;for(const n of e){if(!Array.isArray(n)){throw new TypeError("Table row data must be an array.")}if(n.length!==t){throw new Error("Table must have a consistent number of cells.")}for(const e of n){if(/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test((0,s.normalizeString)(String(e)))){throw new Error("Table data must not contain control characters.")}}}};t.validateTableData=validateTableData},8966:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.wrapCell=void 0;const s=n(1497);const r=n(9063);const i=n(3646);const wrapCell=(e,t,n)=>{const o=(0,s.splitAnsi)(e);for(let e=0;e<o.length;){let s;if(n){s=(0,i.wrapWord)(o[e],t)}else{s=(0,r.wrapString)(o[e],t)}o.splice(e,1,...s);e+=s.length}return o};t.wrapCell=wrapCell},9063:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.wrapString=void 0;const r=s(n(3298));const i=s(n(60));const wrapString=(e,t)=>{let n=e;const s=[];do{s.push((0,r.default)(n,0,t));n=(0,r.default)(n,t).trim()}while((0,i.default)(n));return s};t.wrapString=wrapString},3646:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.wrapWord=void 0;const r=s(n(3298));const i=s(n(3958));const calculateStringLengths=(e,t)=>{let n=(0,i.default)(e);const s=[];const r=new RegExp("(^.{1,"+String(Math.max(t,1))+"}(\\s+|$))|(^.{1,"+String(Math.max(t-1,1))+"}(\\\\|/|_|\\.|,|;|-))");do{let e;const i=r.exec(n);if(i){e=i[0];n=n.slice(e.length);const t=e.trim().length;const r=e.length-t;s.push([t,r])}else{e=n.slice(0,t);n=n.slice(t);s.push([e.length,0])}}while(n.length);return s};const wrapWord=(e,t)=>{const n=[];let s=0;calculateStringLengths(e,t).forEach((([t,i])=>{n.push((0,r.default)(e,s,s+t));s+=t+i}));return n};t.wrapWord=wrapWord},1860:e=>{var t;var n;var s;var r;var i;var o;var a;var c;var l;var u;var d;var f;var p;var h;var m;var g;var y;var b;var v;var w;var T;var S;var k;var D;var _;var E;var C;var R;var P;var O;var A;var L;(function(t){var n=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd){define("tslib",["exports"],(function(e){t(createExporter(n,createExporter(e)))}))}else if(true&&typeof e.exports==="object"){t(createExporter(n,createExporter(e.exports)))}else{t(createExporter(n))}function createExporter(e,t){if(e!==n){if(typeof Object.create==="function"){Object.defineProperty(e,"__esModule",{value:true})}else{e.__esModule=true}}return function(n,s){return e[n]=t?t(n,s):s}}})((function(e){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]};t=function(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");x(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)};n=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};s=function(e,t){var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0)n[s]=e[s];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++){if(t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r]))n[s[r]]=e[s[r]]}return n};r=function(e,t,n,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,s);else for(var a=e.length-1;a>=0;a--)if(o=e[a])i=(r<3?o(i):r>3?o(t,n,i):o(t,n))||i;return r>3&&i&&Object.defineProperty(t,n,i),i};i=function(e,t){return function(n,s){t(n,s,e)}};o=function(e,t,n,s,r,i){function accept(e){if(e!==void 0&&typeof e!=="function")throw new TypeError("Function expected");return e}var o=s.kind,a=o==="getter"?"get":o==="setter"?"set":"value";var c=!t&&e?s["static"]?e:e.prototype:null;var l=t||(c?Object.getOwnPropertyDescriptor(c,s.name):{});var u,d=false;for(var f=n.length-1;f>=0;f--){var p={};for(var h in s)p[h]=h==="access"?{}:s[h];for(var h in s.access)p.access[h]=s.access[h];p.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(accept(e||null))};var m=(0,n[f])(o==="accessor"?{get:l.get,set:l.set}:l[a],p);if(o==="accessor"){if(m===void 0)continue;if(m===null||typeof m!=="object")throw new TypeError("Object expected");if(u=accept(m.get))l.get=u;if(u=accept(m.set))l.set=u;if(u=accept(m.init))r.unshift(u)}else if(u=accept(m)){if(o==="field")r.unshift(u);else l[a]=u}}if(c)Object.defineProperty(c,s.name,l);d=true};a=function(e,t,n){var s=arguments.length>2;for(var r=0;r<t.length;r++){n=s?t[r].call(e,n):t[r].call(e)}return s?n:void 0};c=function(e){return typeof e==="symbol"?e:"".concat(e)};l=function(e,t,n){if(typeof t==="symbol")t=t.description?"[".concat(t.description,"]"):"";return Object.defineProperty(e,"name",{configurable:true,value:n?"".concat(n," ",t):t})};u=function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};d=function(e,t,n,s){function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function fulfilled(e){try{step(s.next(e))}catch(e){r(e)}}function rejected(e){try{step(s["throw"](e))}catch(e){r(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((s=s.apply(e,t||[])).next())}))};f=function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,r,i,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=verb(0),o["throw"]=verb(1),o["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(a){if(s)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(n=0)),n)try{if(s=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];r=0}finally{s=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};p=function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))P(t,e,n)};P=Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]};h=function(e){var t=typeof Symbol==="function"&&Symbol.iterator,n=t&&e[t],s=0;if(n)return n.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&s>=e.length)e=void 0;return{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};m=function(e,t){var n=typeof Symbol==="function"&&e[Symbol.iterator];if(!n)return e;var s=n.call(e),r,i=[],o;try{while((t===void 0||t-- >0)&&!(r=s.next()).done)i.push(r.value)}catch(e){o={error:e}}finally{try{if(r&&!r.done&&(n=s["return"]))n.call(s)}finally{if(o)throw o.error}}return i};g=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e};y=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var s=Array(e),r=0,t=0;t<n;t++)for(var i=arguments[t],o=0,a=i.length;o<a;o++,r++)s[r]=i[o];return s};b=function(e,t,n){if(n||arguments.length===2)for(var s=0,r=t.length,i;s<r;s++){if(i||!(s in t)){if(!i)i=Array.prototype.slice.call(t,0,s);i[s]=t[s]}}return e.concat(i||Array.prototype.slice.call(t))};v=function(e){return this instanceof v?(this.v=e,this):new v(e)};w=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=n.apply(e,t||[]),r,i=[];return r=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),verb("next"),verb("throw"),verb("return",awaitReturn),r[Symbol.asyncIterator]=function(){return this},r;function awaitReturn(e){return function(t){return Promise.resolve(t).then(e,reject)}}function verb(e,t){if(s[e]){r[e]=function(t){return new Promise((function(n,s){i.push([e,t,n,s])>1||resume(e,t)}))};if(t)r[e]=t(r[e])}}function resume(e,t){try{step(s[e](t))}catch(e){settle(i[0][3],e)}}function step(e){e.value instanceof v?Promise.resolve(e.value.v).then(fulfill,reject):settle(i[0][2],e)}function fulfill(e){resume("next",e)}function reject(e){resume("throw",e)}function settle(e,t){if(e(t),i.shift(),i.length)resume(i[0][0],i[0][1])}};T=function(e){var t,n;return t={},verb("next"),verb("throw",(function(e){throw e})),verb("return"),t[Symbol.iterator]=function(){return this},t;function verb(s,r){t[s]=e[s]?function(t){return(n=!n)?{value:v(e[s](t)),done:false}:r?r(t):t}:r}};S=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof h==="function"?h(e):e[Symbol.iterator](),n={},verb("next"),verb("throw"),verb("return"),n[Symbol.asyncIterator]=function(){return this},n);function verb(t){n[t]=e[t]&&function(n){return new Promise((function(s,r){n=e[t](n),settle(s,r,n.done,n.value)}))}}function settle(e,t,n,s){Promise.resolve(s).then((function(t){e({value:t,done:n})}),t)}};k=function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var I=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t};var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};D=function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),s=0;s<n.length;s++)if(n[s]!=="default")P(t,e,n[s]);I(t,e);return t};_=function(e){return e&&e.__esModule?e:{default:e}};E=function(e,t,n,s){if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?s:n==="a"?s.call(e):s?s.value:t.get(e)};C=function(e,t,n,s,r){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n};R=function(e,t){if(t===null||typeof t!=="object"&&typeof t!=="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e==="function"?t===e:e.has(t)};O=function(e,t,n){if(t!==null&&t!==void 0){if(typeof t!=="object"&&typeof t!=="function")throw new TypeError("Object expected.");var s,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");s=t[Symbol.asyncDispose]}if(s===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");s=t[Symbol.dispose];if(n)r=s}if(typeof s!=="function")throw new TypeError("Object not disposable.");if(r)s=function(){try{r.call(this)}catch(e){return Promise.reject(e)}};e.stack.push({value:t,dispose:s,async:n})}else if(n){e.stack.push({async:true})}return t};var $=typeof SuppressedError==="function"?SuppressedError:function(e,t,n){var s=new Error(n);return s.name="SuppressedError",s.error=e,s.suppressed=t,s};A=function(e){function fail(t){e.error=e.hasError?new $(t,e.error,"An error was suppressed during disposal."):t;e.hasError=true}var t,n=0;function next(){while(t=e.stack.pop()){try{if(!t.async&&n===1)return n=0,e.stack.push(t),Promise.resolve().then(next);if(t.dispose){var s=t.dispose.call(t.value);if(t.async)return n|=2,Promise.resolve(s).then(next,(function(e){fail(e);return next()}))}else n|=1}catch(e){fail(e)}}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return next()};L=function(e,t){if(typeof e==="string"&&/^\.\.?\//.test(e)){return e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(e,n,s,r,i){return n?t?".jsx":".js":s&&(!r||!i)?e:s+r+"."+i.toLowerCase()+"js"}))}return e};e("__extends",t);e("__assign",n);e("__rest",s);e("__decorate",r);e("__param",i);e("__esDecorate",o);e("__runInitializers",a);e("__propKey",c);e("__setFunctionName",l);e("__metadata",u);e("__awaiter",d);e("__generator",f);e("__exportStar",p);e("__createBinding",P);e("__values",h);e("__read",m);e("__spread",g);e("__spreadArrays",y);e("__spreadArray",b);e("__await",v);e("__asyncGenerator",w);e("__asyncDelegator",T);e("__asyncValues",S);e("__makeTemplateObject",k);e("__importStar",D);e("__importDefault",_);e("__classPrivateFieldGet",E);e("__classPrivateFieldSet",C);e("__classPrivateFieldIn",R);e("__addDisposableResource",O);e("__disposeResources",A);e("__rewriteRelativeImportExtension",L)}));0&&0},1535:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.AzureRMBackend=void 0;const s=n(6982);const r=n(6028);const i=n(8081);class AzureRMBackend{config;workspace;containerClient;blobClient;currentLeaseId;originalKey;constructor(e,t="default"){this.config=e;this.workspace=t;const n=e.connection_string||process.env.AZURE_STORAGE_CONNECTION_STRING;if(!n){const e=new Error("AZURE_STORAGE_CONNECTION_STRING env variable is missing");e.name="AzureRM Backend Configuration Error";throw e}const{BlobServiceClient:s}=(0,i.loadDriver)("@azure/storage-blob");const o=s.fromConnectionString(n);this.containerClient=o.getContainerClient(e.container_name);this.config.key=this.config.key||r.FILE_STATE;this.originalKey=this.config.key;if(this.workspace!=="default"){this.config.key=`env:/${this.workspace}/${this.originalKey}`}this.blobClient=this.containerClient.getBlockBlobClient(this.config.key)}async exists(){try{return await this.blobClient.exists()}catch(e){return false}}async read(){try{await this.containerClient.createIfNotExists();const e=await this.blobClient.exists();if(!e){return this.emptyState()}const t=await this.blobClient.download(0);const n=await this.streamToString(t.readableStreamBody);return JSON.parse(n)}catch(e){return this.emptyState()}}async write(e){await this.containerClient.createIfNotExists();const t=JSON.stringify(e,null,2);const n={blobHTTPHeaders:{blobContentType:"application/json"}};if(this.currentLeaseId){n.conditions={leaseId:this.currentLeaseId}}await this.blobClient.upload(t,t.length,n)}async lock(e){const t=e.match(/^(\d+)s$/);const n=t?parseInt(t[1],10)*1e3:0;const r=Date.now();const i=await this.blobClient.exists();if(!i){await this.write(this.emptyState())}const o=this.blobClient.getBlobLeaseClient();while(true){try{const e=await o.acquireLease(-1);this.currentLeaseId=e.leaseId;try{await this.blobClient.setMetadata({id:(0,s.randomUUID)(),operation:"Operation",who:process.env.USER||"unknown",created:(new Date).toISOString()},{conditions:{leaseId:this.currentLeaseId}})}catch(e){if(e.statusCode!==201){throw e}}return true}catch(e){if(e.statusCode===409||e.code==="LeaseAlreadyPresent"){if(Date.now()-r>=n){return false}await new Promise((e=>setTimeout(e,1e3)))}else{throw e}}}}async unlock(){if(!this.currentLeaseId)return true;try{const e=this.blobClient.getBlobLeaseClient(this.currentLeaseId);await e.releaseLease();this.currentLeaseId=undefined;return true}catch(e){return false}}async forceUnlock(e){try{const t=await this.blobClient.getProperties();const n=t.metadata?.id;if(t.leaseState==="available"){return{success:false,error:"No lock exists for the given state."}}if(n!==e){return{success:false,currentLockId:n||"unknown"}}const s=this.blobClient.getBlobLeaseClient();await s.breakLease(0);return{success:true}}catch(e){return{success:false,error:`Failed to force unlock: ${e.message}`}}}async isLocked(){try{const e=await this.blobClient.getProperties();return e.leaseState!=="available"}catch(e){return false}}emptyState(){return{version:r.VERSION_STATE,serial:0,lineage:(0,s.randomUUID)(),lastSync:"",resources:[]}}async streamToString(e){return new Promise(((t,n)=>{const s=[];e.on("data",(e=>{s.push(e.toString())}));e.on("end",(()=>{t(s.join(""))}));e.on("error",n)}))}async listWorkspaces(){const e=new Set(["default"]);try{for await(const t of this.containerClient.listBlobsFlat({prefix:"env:/"})){const n=t.name.match(/^env:\/([^\/]+)\//);if(n){e.add(n[1])}}}catch(e){}return Array.from(e)}async deleteWorkspace(e){if(e==="default")return false;try{const t=`env:/${e}/${this.originalKey}`;const n=this.containerClient.getBlockBlobClient(t);await n.deleteIfExists();return true}catch(e){return false}}}t.AzureRMBackend=AzureRMBackend},2578:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CustomBackend=void 0;const s=n(6928);const r=n(9896);class CustomBackend{delegate;constructor(e,t="default",i=process.cwd()){const{source:o,...a}=e;if(!o){throw new Error('Custom backend configuration must specify a "source" path or package name.')}let c;const l=[(0,s.resolve)(i,o),(0,s.resolve)(i,".testform","backends",o),(0,s.resolve)(i,".testform","modules",o)];let u=null;for(const e of l){if((0,r.existsSync)(e)){u=e;break}if((0,r.existsSync)(`${e}.js`)){u=`${e}.js`;break}if((0,r.existsSync)(`${e}.ts`)){u=`${e}.ts`;break}}if(u){try{c=n(6665)(u)}catch{try{c=n(6665)(u)}catch(e){throw new Error(`Failed to load custom backend from "${u}": ${e.message||e}`)}}}else{try{c=require(o)}catch(e){throw new Error(`Could not resolve custom backend from local path "${o}" or package "${o}".`)}}const d=c.default||c.Backend||c.CustomBackend||c;if(typeof d!=="function"){throw new Error(`The custom backend module at "${o}" does not export a valid backend class or constructor.`)}this.delegate=new d(a,t,i)}async read(){return this.delegate.read()}async exists(){return this.delegate.exists()}async write(e){return this.delegate.write(e)}async lock(e){return this.delegate.lock(e)}async unlock(){return this.delegate.unlock()}async forceUnlock(e){return this.delegate.forceUnlock(e)}async isLocked(){return this.delegate.isLocked()}async listWorkspaces(){return this.delegate.listWorkspaces()}async deleteWorkspace(e){return this.delegate.deleteWorkspace(e)}}t.CustomBackend=CustomBackend},6122:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GCSBackend=void 0;const s=n(6982);const r=n(6028);const i=n(8081);class GCSBackend{config;workspace;storage;bucketClient;stateKey;lockKey;lockId;constructor(e,t="default"){this.config=e;this.workspace=t;const n={};if(e.credentials){n.keyFilename=e.credentials}const{Storage:s}=(0,i.loadDriver)("@google-cloud/storage");this.storage=new s(n);this.bucketClient=this.storage.bucket(e.bucket);let o=this.config.prefix||"";if(o&&!o.endsWith("/")){o+="/"}const a=r.FILE_STATE;if(this.workspace!=="default"){this.stateKey=`${o}env:/${this.workspace}/${a}`}else{this.stateKey=`${o}${a}`}this.lockKey=`${this.stateKey}.tflock`}emptyState(){return{version:r.VERSION_STATE,serial:0,lineage:(0,s.randomUUID)(),lastSync:"",resources:[]}}async exists(){try{const[e]=await this.bucketClient.file(this.config.prefix).exists();return e}catch(e){return false}}async read(){try{const e=this.bucketClient.file(this.stateKey);const[t]=await e.exists();if(!t){return this.emptyState()}const[n]=await e.download();return JSON.parse(n.toString("utf8"))}catch(e){return this.emptyState()}}async write(e){const t=this.bucketClient.file(this.stateKey);const n=JSON.stringify(e,null,2);await t.save(n,{contentType:"application/json"})}async lock(e){const t=e.match(/^(\d+)s$/);const n=t?parseInt(t[1],10)*1e3:0;const r=Date.now();const i=this.bucketClient.file(this.lockKey);const o=JSON.stringify({id:(0,s.randomUUID)(),operation:"Operation",who:process.env.USER||"unknown",created:(new Date).toISOString()});while(true){try{await i.save(o,{preconditionOpts:{ifGenerationMatch:0}});this.lockId=o;return true}catch(e){if(e.code===412||e.code==="412"){if(Date.now()-r>=n){return false}await new Promise((e=>setTimeout(e,1e3)))}else{throw e}}}}async unlock(){if(!this.lockId)return true;const e=this.bucketClient.file(this.lockKey);try{const[t]=await e.exists();if(t){await e.delete()}this.lockId=undefined;return true}catch(e){return false}}async forceUnlock(e){const t=this.bucketClient.file(this.lockKey);try{const[n]=await t.exists();if(!n){return{success:false,error:"No lock exists for the given state."}}const[s]=await t.download();const r=JSON.parse(s.toString("utf8"));if(r.id!==e){return{success:false,currentLockId:r.id}}await t.delete();this.lockId=undefined;return{success:true}}catch(e){return{success:false,error:e.message}}}async isLocked(){const e=this.bucketClient.file(this.lockKey);try{const[t]=await e.exists();return t}catch(e){return false}}async listWorkspaces(){const e=new Set(["default"]);try{let t=this.config.prefix||"";if(t&&!t.endsWith("/")){t+="/"}const n=`${t}env:/`;const[s]=await this.bucketClient.getFiles({prefix:n});for(const t of s){const s=t.name.substring(n.length);const r=s.match(/^([^\/]+)\//);if(r){e.add(r[1])}}}catch(e){}return Array.from(e)}async deleteWorkspace(e){if(e==="default")return false;try{let t=this.config.prefix||"";if(t&&!t.endsWith("/")){t+="/"}const n=`${t}env:/${e}/${r.FILE_STATE}`;const s=this.bucketClient.file(n);const[i]=await s.exists();if(i){await s.delete();return true}return false}catch(e){return false}}}t.GCSBackend=GCSBackend},4646:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GitHubBackend=void 0;const s=n(6982);const r=n(6028);class GitHubBackend{config;workspace;owner;repository;branch;tokenEnv;token;statePath;lockPath;currentSha;currentLockSha;currentLockId;constructor(e={},t="default",n,s,i){this.config=e;this.workspace=t;this.owner=e.owner||n||"";this.repository=e.repository||e.repo||s||"";this.branch=e.branch||"testform-state";this.tokenEnv=e.token_env||e.tokenEnv||i||"GITHUB_TOKEN";this.token=process.env[this.tokenEnv]||"";const o=e.path||r.FILE_STATE;if(this.workspace!=="default"){this.statePath=`env/${this.workspace}/${o}`}else{this.statePath=o}this.lockPath=`${this.statePath}.lock`}async apiRequest(e,t={}){if(!this.token){throw new Error(`GitHub Backend: Environment variable "${this.tokenEnv}" is missing or empty.`)}if(!this.owner||!this.repository){throw new Error("GitHub Backend: 'owner' and 'repository' must be specified in backend or provider configuration.")}const n=e.replace(/^\//,"");const s=n.length>0?`https://api.github.com/repos/${this.owner}/${this.repository}/${n}`:`https://api.github.com/repos/${this.owner}/${this.repository}`;const r={Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json","User-Agent":"Testform-CLI"};if(t.body){r["Content-Type"]="application/json"}return await fetch(s,{method:t.method||"GET",headers:r,body:t.body?JSON.stringify(t.body):undefined})}async ensureBranchExists(){const e=await this.apiRequest(`branches/${encodeURIComponent(this.branch)}`);if(e.ok)return;if(e.status===404){const e=await this.apiRequest("");if(!e.ok){throw new Error(`GitHub Backend: Failed to inspect repository ${this.owner}/${this.repository}: HTTP ${e.status}`)}const t=await e.json();const n=t.default_branch||"main";const s=await this.apiRequest(`git/ref/heads/${encodeURIComponent(n)}`);if(!s.ok){throw new Error(`GitHub Backend: Failed to get default branch ref "${n}": HTTP ${s.status}`)}const r=await s.json();const i=r.object?.sha;const o=await this.apiRequest("git/refs",{method:"POST",body:{ref:`refs/heads/${this.branch}`,sha:i}});if(!o.ok&&o.status!==422){const e=await o.text();throw new Error(`GitHub Backend: Failed to create state branch "${this.branch}": HTTP ${o.status} - ${e}`)}}}async exists(){try{const e=await this.apiRequest(`contents/${this.statePath}?ref=${encodeURIComponent(this.branch)}`);return e.ok}catch{return false}}async read(){const e=await this.apiRequest(`contents/${this.statePath}?ref=${encodeURIComponent(this.branch)}`);if(e.status===404){return{version:r.VERSION_STATE,serial:0,lineage:(0,s.randomUUID)(),lastSync:"",resources:[]}}if(!e.ok){throw new Error(`GitHub Backend: Failed to read state: HTTP ${e.status} ${e.statusText}`)}const t=await e.json();this.currentSha=t.sha;const n=Buffer.from(t.content,"base64").toString("utf-8");return JSON.parse(n)}async write(e){await this.ensureBranchExists();if(!this.currentSha){const e=await this.apiRequest(`contents/${this.statePath}?ref=${encodeURIComponent(this.branch)}`);if(e.ok){const t=await e.json();this.currentSha=t.sha}}const t={message:`Update testform.state (serial: ${e.serial})`,content:Buffer.from(JSON.stringify(e,null,2),"utf-8").toString("base64"),branch:this.branch};if(this.currentSha){t.sha=this.currentSha}const n=await this.apiRequest(`contents/${this.statePath}`,{method:"PUT",body:t});if(n.status===409){throw new Error(`GitHub Backend State Conflict: The state file in branch "${this.branch}" was modified concurrently. Re-run plan or refresh state.`)}if(!n.ok){const e=await n.text();throw new Error(`GitHub Backend: Failed to write state: HTTP ${n.status} - ${e}`)}const s=await n.json();this.currentSha=s.content?.sha}async lock(e){const t=e.match(/^(\d+)s$/);const n=t?parseInt(t[1],10)*1e3:0;const r=Date.now();const i=(0,s.randomUUID)();await this.ensureBranchExists();while(true){const e={id:i,operation:"Operation",who:process.env.USER||process.env.USERNAME||"unknown",created:(new Date).toISOString()};const t={message:`Acquire testform.state lock [${i}]`,content:Buffer.from(JSON.stringify(e,null,2),"utf-8").toString("base64"),branch:this.branch};const s=await this.apiRequest(`contents/${this.lockPath}`,{method:"PUT",body:t});if(s.status===201||s.status===200){const e=await s.json();this.currentLockSha=e.content?.sha;this.currentLockId=i;return true}if(s.status===422||s.status===409){if(Date.now()-r>=n){throw new Error(`Error acquiring the state lock: State lock file "${this.lockPath}" already exists on branch "${this.branch}".`)}await new Promise((e=>setTimeout(e,1e3)))}else{const e=await s.text();throw new Error(`GitHub Backend: Error creating lock: HTTP ${s.status} - ${e}`)}}}async unlock(){if(!this.currentLockSha){const e=await this.apiRequest(`contents/${this.lockPath}?ref=${encodeURIComponent(this.branch)}`);if(e.status===404)return true;if(e.ok){const t=await e.json();this.currentLockSha=t.sha}else{return false}}const e=await this.apiRequest(`contents/${this.lockPath}`,{method:"DELETE",body:{message:"Release testform.state lock",sha:this.currentLockSha,branch:this.branch}});if(e.ok||e.status===404){this.currentLockSha=undefined;this.currentLockId=undefined;return true}return false}async forceUnlock(e){const t=await this.apiRequest(`contents/${this.lockPath}?ref=${encodeURIComponent(this.branch)}`);if(t.status===404){return{success:true}}if(!t.ok){return{success:false,error:`Failed to check lock file: HTTP ${t.status}`}}const n=await t.json();const s=Buffer.from(n.content,"base64").toString("utf-8");try{const t=JSON.parse(s);if(e&&t.id&&t.id!==e){return{success:false,error:`Lock ID mismatch: expected ${e}, found ${t.id}`,currentLockId:t.id}}}catch{}const r=await this.apiRequest(`contents/${this.lockPath}`,{method:"DELETE",body:{message:`Force unlock testform.state [${e}]`,sha:n.sha,branch:this.branch}});return{success:r.ok||r.status===404}}async isLocked(){const e=await this.apiRequest(`contents/${this.lockPath}?ref=${encodeURIComponent(this.branch)}`);return e.ok}async listWorkspaces(){const e=await this.apiRequest(`contents/env?ref=${encodeURIComponent(this.branch)}`);if(!e.ok)return[];const t=await e.json();if(!Array.isArray(t))return[];return t.filter((e=>e.type==="dir")).map((e=>e.name))}async deleteWorkspace(e){const t=`env/${e}/${this.config.path||r.FILE_STATE}`;const n=await this.apiRequest(`contents/${t}?ref=${encodeURIComponent(this.branch)}`);if(n.status===404)return true;if(!n.ok)return false;const s=await n.json();const i=await this.apiRequest(`contents/${t}`,{method:"DELETE",body:{message:`Delete workspace ${e} state`,sha:s.sha,branch:this.branch}});return i.ok}}t.GitHubBackend=GitHubBackend},1265:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.HTTPBackend=void 0;const s=n(6982);class HTTPBackend{config;workspace;address;lockAddress;unlockAddress;lockMethod;unlockMethod;updateMethod;headers;currentLockId;constructor(e,t="default"){this.config=e;this.workspace=t;if(!e.address){throw new Error('HTTP backend configuration must specify an "address" URL.')}this.headers={...e.headers};if(e.username&&e.password){const t=Buffer.from(`${e.username}:${e.password}`).toString("base64");this.headers["Authorization"]=`Basic ${t}`}this.updateMethod=(e.update_method||"POST").toUpperCase();this.lockMethod=(e.lock_method||"POST").toUpperCase();this.unlockMethod=(e.unlock_method||"DELETE").toUpperCase();this.address=this.resolveWorkspaceUrl(e.address,t);if(e.lock_address){this.lockAddress=this.resolveWorkspaceUrl(e.lock_address,t)}if(e.unlock_address){this.unlockAddress=this.resolveWorkspaceUrl(e.unlock_address,t)}}resolveWorkspaceUrl(e,t){if(e.includes("${workspace}")){return e.replace(/\$\{workspace\}/g,t)}if(e.includes("{workspace}")){return e.replace(/\{workspace\}/g,t)}if(t!=="default"){const n=e.includes("?")?"&":"?";return`${e}${n}env=${encodeURIComponent(t)}`}return e}async read(){const e=await fetch(this.address,{method:"GET",headers:{Accept:"application/json",...this.headers}});if(e.status===404){return null}if(!e.ok){const t=await e.text();throw new Error(`HTTP backend read failed (${e.status} ${e.statusText}): ${t}`)}const t=await e.text();if(!t||t.trim()===""){return null}return JSON.parse(t)}async exists(){try{const e=await fetch(this.address,{method:"GET",headers:{Accept:"application/json",...this.headers}});if(e.status===404)return false;if(e.ok){const t=await e.text();return Boolean(t&&t.trim().length>0)}return false}catch{return false}}async write(e){const t=JSON.stringify(e,null,2);const n={"Content-Type":"application/json",...this.headers};if(this.currentLockId){n["X-Terraform-Lock-ID"]=this.currentLockId}const s=await fetch(this.address,{method:this.updateMethod,headers:n,body:t});if(!s.ok){const e=await s.text();throw new Error(`HTTP backend write failed (${s.status} ${s.statusText}): ${e}`)}}async lock(e){if(!this.lockAddress){return true}const t=(0,s.randomUUID)();const n={ID:t,Operation:"OperationTypeApply",Info:"",Who:process.env.USER||process.env.USERNAME||"testform",Version:"1.0.0",Created:(new Date).toISOString(),Path:this.address};const r=await fetch(this.lockAddress,{method:this.lockMethod,headers:{"Content-Type":"application/json",...this.headers},body:JSON.stringify(n)});if(r.status===423||r.status===409){return false}if(r.ok){this.currentLockId=t;return true}return false}async unlock(){if(!this.unlockAddress){return true}const e={ID:this.currentLockId||""};const t=await fetch(this.unlockAddress,{method:this.unlockMethod,headers:{"Content-Type":"application/json",...this.headers},body:JSON.stringify(e)});if(t.ok){this.currentLockId=undefined;return true}return false}async forceUnlock(e){if(!this.unlockAddress){return{success:true}}const t=await fetch(this.unlockAddress,{method:this.unlockMethod,headers:{"Content-Type":"application/json",...this.headers},body:JSON.stringify({ID:e})});if(t.ok){return{success:true}}const n=await t.text();return{success:false,error:n}}async isLocked(){if(!this.lockAddress)return false;return Boolean(this.currentLockId)}async listWorkspaces(){return["default"]}async deleteWorkspace(e){if(e==="default")return false;return true}}t.HTTPBackend=HTTPBackend},7490:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.LocalBackend=void 0;const s=n(6928);const r=n(9896);const i=n(6982);const o=n(6028);class LocalBackend{dir;customStatePath;customBackupPath;workspace;constructor(e,t,n,s="default"){this.dir=e;this.customStatePath=t;this.customBackupPath=n;this.workspace=s}getWorkspaceStatePath(){if(this.customStatePath){const e=(0,s.resolve)(this.dir,this.customStatePath);if((0,r.existsSync)(e))return e;const t=(0,s.resolve)(process.cwd(),this.customStatePath);if((0,r.existsSync)(t))return t;return e}if(this.workspace!=="default"){return(0,s.resolve)(this.dir,`${o.FILE_STATE}.d`,this.workspace,o.FILE_STATE)}return(0,s.resolve)(this.dir,o.FILE_STATE)}resolvePath(){const e=this.getWorkspaceStatePath();if((0,r.existsSync)(e))return e;if(this.workspace==="default"){const e=(0,s.resolve)(this.dir,o.FILE_STATE);if((0,r.existsSync)(e))return e}return null}lockPath(){const e=this.resolvePath()??this.getWorkspaceStatePath();return`${e}.lock`}async exists(){return this.resolvePath()!==null}async read(){const e=this.resolvePath();if(!e||!(0,r.existsSync)(e)){return{version:o.VERSION_STATE,serial:0,lineage:(0,i.randomUUID)(),lastSync:"",resources:[]}}const t=await r.promises.readFile(e,"utf-8");return JSON.parse(t)}async write(e){const t=this.resolvePath()??this.getWorkspaceStatePath();const n=(0,s.resolve)(t,"..");if(!(0,r.existsSync)(n)){await r.promises.mkdir(n,{recursive:true})}const i=this.customBackupPath?(0,s.resolve)(this.dir,this.customBackupPath):`${t}.backup`;if((0,r.existsSync)(t)){await r.promises.copyFile(t,i)}await r.promises.writeFile(t,JSON.stringify(e,null,2),"utf-8")}async lock(e){const t=e.match(/^(\d+)s$/);const n=t?parseInt(t[1],10)*1e3:0;const s=this.lockPath();const o=Date.now();while(true){try{await r.promises.writeFile(s,JSON.stringify({id:(0,i.randomUUID)(),operation:"Operation",who:process.env.USER||"unknown",created:(new Date).toISOString()},null,2),{flag:"wx"});return true}catch(e){if(e.code==="EEXIST"){if(Date.now()-o>=n){return false}await new Promise((e=>setTimeout(e,1e3)))}else{throw e}}}}async unlock(){const e=this.lockPath();if((0,r.existsSync)(e)){try{await r.promises.unlink(e);return true}catch(e){return false}}return true}async forceUnlock(e){const t=this.lockPath();if(!(0,r.existsSync)(t)){return{success:false,error:`No lock exists for the given state. (Path checked: ${t})`}}try{const n=await r.promises.readFile(t,"utf-8");const s=JSON.parse(n);if(s.id!==e){return{success:false,currentLockId:s.id}}await r.promises.unlink(t);return{success:true}}catch(e){return{success:false,error:`The lock file could not be read or parsed.`}}}async isLocked(){return(0,r.existsSync)(this.lockPath())}async getLockInfo(){const e=this.lockPath();if(!(0,r.existsSync)(e))return null;try{const t=await r.promises.readFile(e,"utf-8");return JSON.parse(t)}catch{return null}}async listWorkspaces(){const e=["default"];const t=(0,s.resolve)(this.dir,`${o.FILE_STATE}.d`);if((0,r.existsSync)(t)){const n=await r.promises.readdir(t,{withFileTypes:true});for(const t of n){if(t.isDirectory()){e.push(t.name)}}}return e}async deleteWorkspace(e){if(e==="default")return false;const t=(0,s.resolve)(this.dir,`${o.FILE_STATE}.d`,e);if((0,r.existsSync)(t)){await r.promises.rm(t,{recursive:true,force:true});return true}return false}}t.LocalBackend=LocalBackend},3175:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.S3Backend=void 0;const s=n(6982);const r=n(6028);const i=n(8081);function getAwsS3(){return(0,i.loadDriver)("@aws-sdk/client-s3")}function getAwsDynamo(){return(0,i.loadDriver)("@aws-sdk/client-dynamodb")}class S3Backend{config;workspace;s3;dynamo;originalKey;constructor(e,t="default"){this.config=e;this.workspace=t;const{S3Client:n}=getAwsS3();const s={region:e.region||process.env.AWS_REGION||"us-east-1"};let i=e.endpoint;if(!i&&e.namespace){const t=e.region||process.env.AWS_REGION||"us-ashburn-1";i=`https://${e.namespace}.compat.objectstorage.${t}.oraclecloud.com`}if(i){s.endpoint=i;s.forcePathStyle=e.forcePathStyle??true}if(e.forcePathStyle!==undefined){s.forcePathStyle=e.forcePathStyle}if(e.profile==="local"){s.endpoint=e.region&&e.region.startsWith("http")?e.region:"http://localhost:4566";s.region=process.env.AWS_REGION||"us-east-1";s.forcePathStyle=true;s.credentials={accessKeyId:"test",secretAccessKey:"test"}}this.s3=new n(s);if(e.dynamodb_table){const{DynamoDBClient:e}=getAwsDynamo();this.dynamo=new e(s)}this.config.key=this.config.key||r.FILE_STATE;this.originalKey=this.config.key;if(this.workspace!=="default"){this.config.key=`env:/${this.workspace}/${this.originalKey}`}}async exists(){try{const{HeadObjectCommand:e}=getAwsS3();await this.s3.send(new e({Bucket:this.config.bucket,Key:this.config.key}));return true}catch(e){return false}}async read(){const{GetObjectCommand:e,NoSuchKey:t}=getAwsS3();try{const t=new e({Bucket:this.config.bucket,Key:this.config.key});const n=await this.s3.send(t);const s=await(n.Body?.transformToString());if(!s){return this.emptyState()}return JSON.parse(s)}catch(e){if(t&&(e instanceof t||e.name==="NoSuchKey"||e.Code==="NoSuchKey")){return this.emptyState()}if(e.name==="NoSuchKey"||e.Code==="NoSuchKey"){return this.emptyState()}throw e}}async write(e){const{PutObjectCommand:t}=getAwsS3();const n=new t({Bucket:this.config.bucket,Key:this.config.key,Body:JSON.stringify(e,null,2),ContentType:"application/json"});await this.s3.send(n)}async lock(e){if(!this.dynamo||!this.config.dynamodb_table){return true}const{PutItemCommand:t,ConditionalCheckFailedException:n}=getAwsDynamo();const r=e.match(/^(\d+)s$/);const i=r?parseInt(r[1],10)*1e3:0;const o=Date.now();const a=(0,s.randomUUID)();const c={LockID:{S:this.config.bucket+"/"+this.config.key},Info:{S:JSON.stringify({id:a,operation:"Operation",who:process.env.USER||"unknown",created:(new Date).toISOString()})}};while(true){try{await this.dynamo.send(new t({TableName:this.config.dynamodb_table,Item:c,ConditionExpression:"attribute_not_exists(LockID)"}));return true}catch(e){const t=n&&e instanceof n||e.name==="ConditionalCheckFailedException";if(t){if(Date.now()-o>=i){return false}await new Promise((e=>setTimeout(e,1e3)))}else{throw e}}}}async unlock(){if(!this.dynamo||!this.config.dynamodb_table)return true;const{DeleteItemCommand:e}=getAwsDynamo();try{await this.dynamo.send(new e({TableName:this.config.dynamodb_table,Key:{LockID:{S:this.config.bucket+"/"+this.config.key}}}));return true}catch(e){return false}}async forceUnlock(e){if(!this.dynamo||!this.config.dynamodb_table){return{success:false,error:"DynamoDB locking is not configured for this backend."}}const{GetItemCommand:t,DeleteItemCommand:n}=getAwsDynamo();try{const s=await this.dynamo.send(new t({TableName:this.config.dynamodb_table,Key:{LockID:{S:this.config.bucket+"/"+this.config.key}}}));if(!s.Item||!s.Item.Info){return{success:false,error:"No lock exists for the given state."}}const r=JSON.parse(s.Item.Info.S);if(r.id!==e){return{success:false,currentLockId:r.id}}await this.dynamo.send(new n({TableName:this.config.dynamodb_table,Key:{LockID:{S:this.config.bucket+"/"+this.config.key}}}));return{success:true}}catch(e){return{success:false,error:`Failed to force unlock: ${e.message}`}}}async isLocked(){if(!this.dynamo||!this.config.dynamodb_table)return false;const{GetItemCommand:e}=getAwsDynamo();try{const t=await this.dynamo.send(new e({TableName:this.config.dynamodb_table,Key:{LockID:{S:this.config.bucket+"/"+this.config.key}}}));return!!t.Item}catch(e){return false}}emptyState(){return{version:r.VERSION_STATE,serial:0,lineage:(0,s.randomUUID)(),lastSync:"",resources:[]}}async listWorkspaces(){const e=new Set(["default"]);try{const{ListObjectsV2Command:t}=getAwsS3();const n=new t({Bucket:this.config.bucket,Prefix:"env:/"});const s=await this.s3.send(n);if(s.Contents){for(const t of s.Contents){if(t.Key){const n=t.Key.match(/^env:\/([^\/]+)\//);if(n){e.add(n[1])}}}}}catch(e){}return Array.from(e)}async deleteWorkspace(e){if(e==="default")return false;try{const{DeleteObjectCommand:t}=getAwsS3();const n=`env:/${e}/${this.originalKey}`;const s=new t({Bucket:this.config.bucket,Key:n});await this.s3.send(s);return true}catch(e){return false}}}t.S3Backend=S3Backend},8314:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.applyCmd=void 0;const s=n(6028);const r=n(9896);const i=n(465);const o=n(7862);const a=n(7066);const c=n(1227);const l=n(1227);const u=n(4483);const d=n(1533);const f=n(1821);const p=n(5301);const h=n(2978);const m=n(8480);const g=n(5124);const y=n(8169);const b=n(1138);const applyCmd=async e=>{const{dir:t=".",autoApprove:v=false,verbose:w=false,scope:T,planFile:S,lock:k=true,lockTimeout:D="0s",input:_=true,variables:E,statePath:C,backupPath:R,target:P,refresh:O=true,refreshOnly:A=false,replaceTargets:L,parallelism:x,compactWarnings:I,testDirectory:$}=e;const F=new c.Logger(w);const j=new a.State(t,C,R);await j.init();await j.acquireLock(k,D);try{let e;if(S){const s=n(6928);const i=s.resolve(t,S);if(!(0,r.existsSync)(i)){F.error(`Failed to load "${S}" as a plan file\n\nstat ${i}: no such file or directory`)}try{const n=(0,r.readFileSync)(i,"utf-8");const s=JSON.parse(n);e={changes:s.changes||[],hasChanges:s.changes&&s.changes.length>0,state:new a.State(t)};await e.state.init()}catch(e){F.error(`Failed to load "${S}" as a plan file\n\nError parsing JSON: ${e.message}`);return}}else{const n=(0,y.resolveScopes)(T,P);let r=[];let i=j;for(const e of n){if(O&&!A){console.log(s.MSG_ACQUIRING_LOCK);await(0,f.refreshState)({dir:t,scope:e,state:j,logger:F,silent:false,parallelismRaw:x,target:P})}const n=await(0,u.calculatePlan)({dir:t,scope:e,variables:E,statePath:C,backupPath:R,target:P,destroyPlan:false,refreshOnly:A,preLoadedState:j,lock:k,lockTimeout:D,replaceTargets:L,compactWarnings:I,testDirectory:$});r.push(...n.changes);i=n.state}e={changes:r,hasChanges:r.length>0,state:i};o.resource.summary(e.changes,false,{state:e.state});if(!e.hasChanges){return}if(!v){(0,y.assertApprovalAllowed)(v,_);const e=await(0,p.askApproval)();if(!e){l.logger.push({type:"error",title:"error asking for approval: interrupted",detail:[]});return}}}if(S&&!e.hasChanges){console.log("No changes found in the provided plan file.");return}const c=await(0,m.createCommandContext)({dir:t,verbose:w,lock:false});if(!c)return;const M=c.adapter||c.github;let N=0;let B=0;let U=0;const resolvePayloadMilestone=async e=>{if(typeof e.milestone==="string"&&e.milestone){e.milestone=await M.getMilestoneByTitle(e.milestone)}else if(!e.milestone){delete e.milestone}};const linkSubIssues=async(e,t)=>{if(e.resourceType.endsWith("testplan")&&e.scenario.custom?.testruns){for(const n of e.scenario.custom.testruns){const e=j.getResources("testrun").filter((e=>e.identity.endsWith(n)||e.identity.includes(n)));if(e.length>1){const t=Array.from(new Set(e.map((e=>e.identity))));F.warn(`Rule '${n}' in Testplan matches multiple Testruns. Linking all of them:\n`+t.map((e=>` - ${e}`)).join("\n")+`\nIf this was unintentional, specify the full file path.`)}for(const n of e){if(n?.attributes?.issueNumber){try{const e=await M.getIssue(n.attributes.issueNumber);if(e&&e.id){if(M.addSubIssue)await M.addSubIssue(t,e.id);console.log(` -> Linked testrun ${n.identity} as sub-issue to testplan`)}}catch(e){console.log(` -> Failed to link testrun ${n.identity} as sub-issue: ${e.message}`)}}}}}};const syncTestrunComments=(e,t,n)=>(0,g.syncTestrunComments)({change:e,issueNumber:t,provider:M,stateObj:j,testDirectory:$,existingAttributes:n,onCommentUpdate:(e,t)=>console.log(` -> Updated status comment for ${e} to '${t}'`),onCommentCreate:(e,t)=>console.log(` -> Created status comment for ${e} as '${t}'`)});const G=x?parseInt(String(x),10)||1:1;const q=new b.DependencyResolver(t);let W=e.changes;try{W=q.sortTopologically(e.changes,(e=>e.identity),(e=>e.scenario?.tags?e.scenario.tags.map((e=>typeof e==="string"?e:e.name)):[]))}catch(e){l.logger.push({type:"error",title:"Circular dependency detected",detail:[e.message],close:true});throw e}await(0,g.executeInBatches)(W,G,(async e=>{try{if(e.action==="add"){const t=(0,h.formatResourceAddress)(e.resourceType,e.identity);console.log(`${t}: Creating...`);const n=Date.now();const s=o.resource.evaluate(e.resourceType,e.scenario,{state:j,testDirectory:$});await resolvePayloadMilestone(s);const r=await M.createIssue(s);if(r.node_id&&M.addToProject){const e=await M.addToProject(r.node_id);if(e&&s.custom_fields&&M.updateProjectItemFields){await M.updateProjectItemFields(e,s.custom_fields)}}const a=(0,h.elapsedSeconds)(n);const c=M.formatRemoteId(r.number);console.log((0,i.green)(`${t}: Creation complete after ${a}s [id=${c}]`));await linkSubIssues(e,r.number);const{testcaseCommentIds:l,testcaseStatuses:u,expandedTestcases:d}=await syncTestrunComments(e,r.number);j.upsertResource({type:e.resourceType,identity:e.identity,attributes:{localHash:e.localHash,remoteId:c,issueNumber:r.number,title:s.title,body:s.body,labels:s.labels,assignees:s.assignees,milestone:s.milestone||undefined,custom_fields:s.custom_fields,createdAt:r.created_at,updatedAt:r.updated_at,...l?{testcaseCommentIds:l,testcaseStatuses:u}:{}},lastApplied:(new Date).toISOString()});await linkSubIssues(e,r.number);N++}else if(e.action==="replace"){const t=(0,h.formatResourceAddress)(e.resourceType,e.identity);const n=e.remoteId??"";console.log(`${t}: Replacing... [id=${n}]`);const s=Date.now();if(e.issueNumber){await M.updateIssue(e.issueNumber,{state:"closed"})}const r=o.resource.evaluate(e.resourceType,e.scenario,{state:j,testDirectory:$});await resolvePayloadMilestone(r);const a=await M.createIssue(r);if(a.node_id&&M.addToProject){const e=await M.addToProject(a.node_id);if(e&&r.custom_fields&&M.updateProjectItemFields){await M.updateProjectItemFields(e,r.custom_fields)}}const c=(0,h.elapsedSeconds)(s);const l=M.formatRemoteId(a.number);console.log((0,i.green)(`${t}: Replacement complete after ${c}s [id=${l}]`));await linkSubIssues(e,a.number);const{testcaseCommentIds:u,testcaseStatuses:d,expandedTestcases:f}=await syncTestrunComments(e,a.number);j.upsertResource({type:e.resourceType,identity:e.identity,attributes:{localHash:e.localHash,remoteId:l,issueNumber:a.number,title:r.title,body:r.body,labels:r.labels,assignees:r.assignees,milestone:r.milestone||undefined,custom_fields:r.custom_fields,createdAt:a.created_at,updatedAt:a.updated_at,...u?{testcaseCommentIds:u,testcaseStatuses:d}:{}},lastApplied:(new Date).toISOString()});U++;N++}else if(e.action==="change"){const t=(0,h.formatResourceAddress)(e.resourceType,e.identity);const n=e.remoteId??"";console.log(`${t}: Modifying... [id=${n}]`);const s=Date.now();const r=o.resource.evaluate(e.resourceType,e.scenario,{state:j,testDirectory:$});await resolvePayloadMilestone(r);const a=await M.updateIssue(e.issueNumber,r);if(a.node_id&&M.addToProject){const e=await M.addToProject(a.node_id);if(e&&r.custom_fields&&M.updateProjectItemFields){await M.updateProjectItemFields(e,r.custom_fields)}}const c=(0,h.elapsedSeconds)(s);console.log((0,i.green)(`${t}: Modifications complete after ${c}s [id=${n}]`));await linkSubIssues(e,a.number);const l=j.getResources(e.resourceType).find((t=>t.identity===e.identity))?.attributes;const{testcaseCommentIds:u,testcaseStatuses:d,expandedTestcases:f}=await syncTestrunComments(e,a.number,l);j.upsertResource({type:e.resourceType,identity:e.identity,attributes:{localHash:e.localHash,remoteId:n,issueNumber:e.issueNumber,title:r.title,body:r.body,labels:r.labels,assignees:r.assignees,milestone:r.milestone||undefined,custom_fields:r.custom_fields,createdAt:a.created_at,updatedAt:a.updated_at,...u?{testcaseCommentIds:u,testcaseStatuses:d}:{}},lastApplied:(new Date).toISOString()});B++}else if(e.action==="destroy"){const t=(0,h.formatResourceAddress)(e.resourceType,e.identity);const n=e.remoteId??"";console.log(`${t}: Destroying... [id=${n}]`);const s=Date.now();if(e.issueNumber){await M.closeIssue(e.issueNumber)}const r=(0,h.elapsedSeconds)(s);console.log((0,i.green)(`${t}: Destruction complete after ${r}s [id=${n}]`));j.removeResource(e.identity);U++}}catch(t){l.logger.push({type:"error",title:`${t.message}`,detail:[` with ${e.resourceType}.${e.identity}`]})}}));console.log("");await j.save();console.log((0,i.green)((0,i.bold)(`Apply complete! Resources: ${N} added, ${B} changed, ${U} destroyed.`)));const H=new d.OutputResolver(t);const K=H.resolve(j,E);if(Object.keys(K).length>0){j.setOutputs(K);await j.save();console.log("\n"+(0,i.bold)("Outputs:\n"));console.log(H.format(K))}}finally{await j.releaseLock()}};t.applyCmd=applyCmd},9540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.destroyCmd=void 0;const s=n(465);const r=n(1227);const i=n(1227);const o=n(6028);const a=n(8480);const c=n(5301);const l=n(2978);const u=n(7442);const d=n(8169);const f=n(2043);const destroyCmd=async e=>{const{dir:t=".",autoApprove:n=false,verbose:p=false,scope:h,target:m,lock:g=true,lockTimeout:y="0s",input:b=true,statePath:v,backupPath:w}=e;const T=new r.Logger(p);return(0,d.withStateLock)({dir:t,statePath:v,backupPath:w,lock:g,lockTimeout:y},(async e=>{const r=(0,d.resolveScopes)(h,m);const g=r.flatMap((t=>{const n=o.SCOPE_RESOURCE_MAP[t];if(!n)return[];const s=e.getResources(n);return m?s.filter((e=>(0,u.matchesTarget)(e.identity,m,t)||e.type&&(0,u.matchesTarget)(e.type,m,t))):s}));if(g.length===0){console.log("No resources to destroy. State is empty.");return}(0,d.assertApprovalAllowed)(n,b);const y=new f.LifecycleResolver(t);const T=g.filter((e=>{const t=y.getLifecycle(e.identity,e.attributes.labels||[]);return t.prevent_destroy}));if(T.length>0){const e=T.map((e=>`Resource ${(0,l.formatResourceAddress)(e.type,e.identity)} has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or target other resources.`));i.logger.push({type:"error",title:"Instance cannot be destroyed",detail:e,close:true});throw new Error(`Instance cannot be destroyed: ${T.map((e=>e.identity)).join(", ")} has lifecycle.prevent_destroy set.`)}let S=0;for(const d of r){if(!Object.prototype.hasOwnProperty.call(o.SCOPE_RESOURCE_MAP,d)){throw new Error(`Invalid scope: ${d}`)}let r=e.getResources(o.SCOPE_RESOURCE_MAP[d]);if(m){r=r.filter((e=>(0,u.matchesTarget)(e.identity,m,d)||e.type&&(0,u.matchesTarget)(e.type,m,d)))}if(r.length===0){console.log(`No resources found in state for scope '${d}'.`);continue}console.log((0,s.bold)(`\n${o.TITLE_APP} will destroy the following resources in scope '${d}':\n`));for(const e of r){const t=e.attributes.remoteId??"";console.log(` ${(0,s.red)("-")} ${(0,l.formatResourceAddress)(e.type,e.identity)} [id=${t}]`)}console.log(`\n${(0,s.bold)("Plan:")} 0 to add, 0 to change, ${r.length} to destroy.\n`);if(!n&&b){const e=await(0,c.askDestroyApproval)(r.length);if(!e){i.logger.push({type:"error",title:`Destruction of scope '${d}' cancelled.`,detail:[]});continue}}console.log("");const f=await(0,a.createCommandContext)({dir:t,verbose:p,statePath:v,backupPath:w,lock:false,silent:false});if(!f)return;const h=f.adapter||f.github;for(const t of r){const n=(0,l.formatResourceAddress)(t.type,t.identity);const r=t.attributes.remoteId??"";console.log(`${n}: Destroying... [id=${r}]`);const o=Date.now();try{if(t.attributes.issueNumber){await h.closeIssue(t.attributes.issueNumber)}e.removeResource(t.identity);const i=(0,l.elapsedSeconds)(o);console.log((0,s.green)(`${n}: Destruction complete after ${i}s [id=${r}]`));S++}catch(e){i.logger.push({type:"error",title:`Failed to destroy ${n}: ${e.message}`,detail:[]})}}}if(typeof e.save==="function")await e.save();if(S>0){console.log("");console.log((0,s.green)((0,s.bold)(`Destroy complete! ${S} resource(s) destroyed.`)))}}))};t.destroyCmd=destroyCmd},5083:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.diffCmd=void 0;t.hashScenario=hashScenario;const o=n(6982);const a=n(465);const c=n(9896);const l=n(6928);const u=i(n(3785));const d=n(4489);const f=n(5392);const p=n(9922);const h=n(7066);const m=n(1227);const g=n(6028);const y=n(8480);const b=n(8169);const v=n(9606);const w=n(7442);function hashScenario(e,t){const n=JSON.parse(JSON.stringify(e));if(!t||t==="testcase"){n.name=""}if(!t||t==="testrun"||t==="testplan"){if(n.feature){n.feature.name=""}}return(0,o.createHash)("sha256").update(JSON.stringify(n)).digest("hex")}function getStatusIcon(e){switch(e){case"synced":return(0,a.green)("✔");case"modified_locally":return(0,a.yellow)("~");case"new_local":return(0,a.cyan)("+");case"orphaned_remote":return(0,a.red)("-")}}function getStatusLabel(e){switch(e){case"synced":return"synced";case"modified_locally":return"modified locally";case"new_local":return"new (not applied)";case"orphaned_remote":return"orphaned (not in config)"}}function promptUser(e,t){return new Promise((n=>{e.question(t,(e=>n(e.trim())))}))}const diffCmd=async e=>{const{dir:t=".",testDirectory:n,verbose:s=false,scope:r,remote:i=false,interactive:o=false,statePath:c,backupPath:u,target:y}=e;const v=new m.Logger(s);const T=i||r==="remote";const S=r==="remote"?"all":r;const k=new d.Config(t);const D=n?(0,l.resolve)(t,n):(0,l.resolve)(t);const _=e.variables||new p.VariableParser(undefined,undefined,t);const E=new f.Parser(D,_);const C=E.content();const R=new h.State(t,c,u);await R.init();if(T){await executeRemoteDrift(t,D,S,R,k,E,C,o,s);return}const P=[];const O=(0,b.resolveScopes)(S,y);for(const e of O){const t=k.getMatch?.(e);const n=C.filter((n=>(0,w.matchesScope)(n,e,t)));const s={identity:k.getIdentity(e),fields:k.getFields(e)};let r=E.filter(n,s,e)||[];if(y){r=r.filter((t=>{const n=t.custom?.identity?`${t.uri}.${t.custom.identity}`:t.uri;return(0,w.matchesTarget)(n,y,e)||(0,w.matchesTarget)(t.uri,y,e)}))}const i=g.SCOPE_RESOURCE_MAP[e];let o=R.getResources(i);if(y){o=o.filter((t=>(0,w.matchesTarget)(t.identity,y,e)||t.type&&(0,w.matchesTarget)(t.type,y,e)))}const a=new Map(o.map((e=>[e.identity,e])));const c=new Set;for(const t of r){const n=t.custom?.identity;if(!n)continue;let s;if(n.startsWith(t.uri)||n===t.uri){s=n}else{s=`${t.uri}.${n}`}c.add(s);const r=hashScenario(t,e);const i=a.get(s);if(!i){P.push({identity:s,status:"new_local",localHash:r})}else if(i.attributes.localHash!==r){P.push({identity:s,status:"modified_locally",localHash:r,stateHash:i.attributes.localHash,remoteId:i.attributes.remoteId})}else{P.push({identity:s,status:"synced",localHash:r,stateHash:i.attributes.localHash,remoteId:i.attributes.remoteId})}}for(const e of o){if(!c.has(e.identity)){P.push({identity:e.identity,status:"orphaned_remote",stateHash:e.attributes.localHash,remoteId:e.attributes.remoteId})}}}console.log("");console.log((0,a.bold)("Drift Detection Report"));console.log("═".repeat(60));console.log("");const A=P.filter((e=>e.status==="synced")).length;const L=P.filter((e=>e.status==="modified_locally")).length;const x=P.filter((e=>e.status==="new_local")).length;const I=P.filter((e=>e.status==="orphaned_remote")).length;for(const e of P){const t=getStatusIcon(e.status);const n=getStatusLabel(e.status);const r=e.remoteId?(0,a.dim)(` [id=${e.remoteId}]`):"";console.log(` ${t} ${(0,a.bold)(e.identity)}: ${n}${r}`);if(s&&e.status==="modified_locally"&&e.localHash&&e.stateHash){console.log(` Local: ${(0,a.dim)(e.localHash.substring(0,12))}...`);console.log(` State: ${(0,a.dim)(e.stateHash.substring(0,12))}...`)}}console.log("");console.log((0,a.bold)("Summary:"));console.log(` ${(0,a.green)("✔")} ${A} synced`);if(L>0)console.log(` ${(0,a.yellow)("~")} ${L} modified locally`);if(x>0)console.log(` ${(0,a.cyan)("+")} ${x} new (not applied)`);if(I>0)console.log(` ${(0,a.red)("-")} ${I} orphaned (not in config)`);console.log("")};t.diffCmd=diffCmd;async function executeRemoteDrift(e,t,n,s,r,i,o,l,d){console.log("");console.log((0,a.bold)(`# ${g.TITLE_APP} Remote Drift Detection`));console.log((0,a.dim)("Checking local configuration and state against live remote provider..."));console.log("═".repeat(60));console.log("");const f=await(0,y.createCommandContext)({dir:e,verbose:d,lock:false,silent:true});if(!f){console.error((0,a.red)("Failed to initialize provider context for remote drift check."));return}const p=f.adapter||f.github;const h=(0,b.resolveScopes)(n);const m=[];for(const e of h){const t=g.SCOPE_RESOURCE_MAP[e];const n=s.getResources(t);const c=r.getMatch?.(e);const l=o.filter((t=>(0,w.matchesScope)(t,e,c)));const u={identity:r.getIdentity(e),fields:r.getFields(e)};const f=i.filter(l,u,e)||[];for(const e of n){const n=e.attributes.issueNumber;if(!n)continue;const s=f.find((t=>{const n=t.custom?.identity;return n===e.identity||`${t.uri}.${n}`===e.identity||e.identity.endsWith(n||"")}));try{const r=await p.getIssue(n);if(!r){m.push({identity:e.identity,resourceType:t,issueNumber:n,differences:[{field:"status",local:"exists in state",remote:"not found on remote"}],remoteIssue:null,scenario:s});continue}const i=[];const o=r.state==="closed";if(o){i.push({field:"state",local:"open/tracked",remote:"closed on remote"})}const a=s?.name||e.attributes.title||"";if(a&&r.title&&a.trim()!==r.title.trim()){i.push({field:"title",local:a,remote:r.title})}const c=Array.isArray(e.attributes.labels)?e.attributes.labels.map((e=>e.replace(/^@/,"").toLowerCase())).sort():[];const l=Array.isArray(r.labels)?r.labels.map((e=>(typeof e==="string"?e:e.name||"").replace(/^@/,"").toLowerCase())).sort():[];if(JSON.stringify(c)!==JSON.stringify(l)){i.push({field:"labels",local:`[${c.join(", ")}]`,remote:`[${l.join(", ")}]`})}if(i.length>0){m.push({identity:e.identity,resourceType:t,issueNumber:n,filePath:s?.uri,differences:i,isClosed:o,remoteIssue:r,scenario:s})}}catch(e){if(d)console.warn((0,a.yellow)(`Could not fetch issue #${n}: ${e.message}`))}}}if(m.length===0){console.log((0,a.green)("✔ No remote drift detected. Local configuration and state are fully synchronized with remote."));console.log("");return}console.log((0,a.yellow)(`Found ${m.length} resource(s) with remote drift:\n`));for(const e of m){console.log(` ${(0,a.yellow)("~")} ${(0,a.cyan)(e.resourceType)}.${(0,a.bold)(e.identity)} (Issue #${e.issueNumber})`);for(const t of e.differences){console.log(` Field ${(0,a.bold)(t.field)}:`);console.log(` - Local: ${(0,a.red)(t.local)}`);console.log(` + Remote: ${(0,a.green)(t.remote)}`)}console.log("")}if(l&&m.length>0){console.log((0,a.bold)("Interactive Drift Resolution"));console.log((0,a.dim)("You can choose how to handle each drifted resource.\n"));const e=u.createInterface({input:process.stdin,output:process.stdout});try{for(const t of m){console.log(`Action for resource ${(0,a.bold)(t.identity)}:`);console.log(` Enter 'pull' to update local file, 'overwrite' to keep local, or 'skip' to ignore.\n`);const n=await promptUser(e," Enter a value: ");const r=n.toLowerCase().trim();if(r==="pull"||r==="1"){if(t.filePath&&(0,c.existsSync)(t.filePath)&&t.remoteIssue){const e=Array.isArray(t.remoteIssue.labels)?t.remoteIssue.labels.map((e=>typeof e==="string"?e:e.name||"")):[];const n=(0,v.updateFeatureScenario)(t.filePath,t.scenario?.name||"",t.remoteIssue.title,e);if(n){const n=s.getResources(t.resourceType).find((e=>e.identity===t.identity));if(n){n.attributes.title=t.remoteIssue.title;n.attributes.labels=e;s.upsertResource(n)}console.log((0,a.green)(` ✔ Updated ${t.filePath} successfully!\n`))}else{console.log((0,a.yellow)(` Could not write changes to ${t.filePath}\n`))}}else{console.log((0,a.yellow)(` No local file mapped for ${t.identity}. Cannot pull automatically.\n`))}}else if(r==="overwrite"||r==="2"){console.log((0,a.cyan)(` → Kept local version. Will overwrite remote on next apply.\n`))}else{console.log((0,a.dim)(` → Skipped.\n`))}}await s.save()}finally{e.close()}}else if(!l){console.log((0,a.dim)(`Tip: Run 'testform diff --remote --interactive' (or -i) to resolve drift interactively.\n`))}}},6597:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ephemeralCmd=void 0;t.getEphemeralBaseDir=getEphemeralBaseDir;t.getEphemeralSandboxDir=getEphemeralSandboxDir;t.isValidSandboxId=isValidSandboxId;const s=n(6928);const r=n(9896);const i=n(465);const o=n(8314);const a=n(9540);const c=n(6028);function getEphemeralBaseDir(e){return(0,s.resolve)(e,".testform","ephemeral")}function getEphemeralSandboxDir(e,t){return(0,s.join)(getEphemeralBaseDir(e),t)}function isValidSandboxId(e){return/^[a-zA-Z0-9_\-\.]+$/.test(e)}const ephemeralCmd=async e=>{const{subcommand:t,id:n,dir:l=".",testDirectory:u,scope:d="all",autoApprove:f=false,force:p=false,json:h=false,verbose:m=false}=e;if(!t){console.error((0,i.red)(`\nError: Missing subcommand for ${c.TITLE_CLI} ephemeral.`));console.log(`\nUsage:`);console.log(` ${c.TITLE_CLI} ephemeral up <id> [options] Deploy an isolated ephemeral sandbox`);console.log(` ${c.TITLE_CLI} ephemeral down <id> [options] Destroy all remote issues and clean sandbox`);console.log(` ${c.TITLE_CLI} ephemeral list [options] List all active ephemeral sandboxes`);console.log(` ${c.TITLE_CLI} ephemeral show <id> [options] Inspect an ephemeral sandbox\n`);process.exit(1)}const g=getEphemeralBaseDir(l);switch(t){case"up":case"apply":{if(!n){console.error((0,i.red)("\nError: Expected an ephemeral sandbox ID (e.g., pr-42, branch-login)."));process.exit(1)}if(!isValidSandboxId(n)){console.error((0,i.red)(`\nError: Invalid sandbox ID "${n}". Use alphanumeric characters, hyphens, and underscores.`));process.exit(1)}const e=getEphemeralSandboxDir(l,n);if(!(0,r.existsSync)(e)){(0,r.mkdirSync)(e,{recursive:true})}const t=(0,s.join)(e,"testform.state");const a=(0,s.join)(e,"testform.state.backup");const p=(0,s.join)(e,"metadata.json");let h={id:n,createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString(),scope:String(d)};if((0,r.existsSync)(p)){try{const e=JSON.parse((0,r.readFileSync)(p,"utf8"));h.createdAt=e.createdAt||h.createdAt}catch{}}(0,r.writeFileSync)(p,JSON.stringify(h,null,2),"utf8");console.log((0,i.cyan)((0,i.bold)(`\n🚀 Initializing ephemeral QA sandbox: `)+(0,i.bold)(n)));console.log((0,i.dim)(` Isolated state: ${t}\n`));await(0,o.applyCmd)({dir:l,testDirectory:u,scope:d,autoApprove:Boolean(f),verbose:Boolean(m),statePath:t,backupPath:a});console.log((0,i.green)((0,i.bold)(`\n✔ Ephemeral sandbox "${n}" successfully deployed!`)));console.log((0,i.gray)(` State location: ${t}`));console.log((0,i.cyan)(` To tear down this sandbox and close all created remote issues:`));console.log((0,i.bold)(` $ ${c.TITLE_CLI} ephemeral down ${n} --auto-approve\n`));break}case"down":case"destroy":{if(!n){console.error((0,i.red)("\nError: Expected an ephemeral sandbox ID (e.g., pr-42, branch-login)."));process.exit(1)}const e=getEphemeralSandboxDir(l,n);const t=(0,s.join)(e,"testform.state");const o=(0,s.join)(e,"testform.state.backup");if(!(0,r.existsSync)(e)||!(0,r.existsSync)(t)){if(!p){console.log((0,i.yellow)(`\nNo active ephemeral sandbox found with ID "${n}". Nothing to destroy.`));return}}console.log((0,i.yellow)((0,i.bold)(`\n🧹 Tearing down ephemeral QA sandbox: `)+(0,i.bold)(n)));if((0,r.existsSync)(t)){await(0,a.destroyCmd)({dir:l,scope:"all",autoApprove:Boolean(f),input:!f,verbose:Boolean(m),statePath:t,backupPath:o})}if((0,r.existsSync)(e)){(0,r.rmSync)(e,{recursive:true,force:true})}console.log((0,i.green)((0,i.bold)(`\n✨ Ephemeral sandbox "${n}" is completely destroyed!`)));console.log((0,i.dim)(` Remote issues closed and isolated state directory removed. Zero orphans left.\n`));break}case"list":{if(!(0,r.existsSync)(g)){if(h){console.log("[]")}else{console.log((0,i.yellow)("\nNo active ephemeral sandboxes found.\n"))}return}const e=(0,r.readdirSync)(g,{withFileTypes:true});const t=[];for(const n of e){if(n.isDirectory()){const e=n.name;const i=(0,s.join)(g,e);const o=(0,s.join)(i,"testform.state");const a=(0,s.join)(i,"metadata.json");let c=0;let l="Unknown";let u="all";if((0,r.existsSync)(o)){try{const e=JSON.parse((0,r.readFileSync)(o,"utf8"));c=(e.resources||[]).length}catch{}}if((0,r.existsSync)(a)){try{const e=JSON.parse((0,r.readFileSync)(a,"utf8"));l=e.createdAt?new Date(e.createdAt).toLocaleString():"Unknown";u=e.scope||"all"}catch{}}t.push({id:e,resourcesCount:c,createdAt:l,scope:u})}}if(h){console.log(JSON.stringify(t,null,2));return}if(t.length===0){console.log((0,i.yellow)("\nNo active ephemeral sandboxes found.\n"));return}console.log((0,i.bold)(`\nActive Ephemeral Sandboxes (${t.length}):\n`));const n="SANDBOX ID".padEnd(20);const o="RESOURCES".padEnd(12);const a="SCOPE".padEnd(12);const c="CREATED AT";console.log((0,i.dim)(` ${n} ${o} ${a} ${c}`));console.log((0,i.dim)(` ${"─".repeat(19)} ${"─".repeat(11)} ${"─".repeat(11)} ${"─".repeat(20)}`));for(const e of t){const t=(0,i.cyan)(e.id.padEnd(20));const n=(0,i.green)(String(e.resourcesCount).padEnd(12));const s=(0,i.yellow)(e.scope.padEnd(12));const r=(0,i.dim)(e.createdAt);console.log(` ${t} ${n} ${s} ${r}`)}console.log("");break}case"show":{if(!n){console.error((0,i.red)("\nError: Expected an ephemeral sandbox ID."));process.exit(1)}const e=getEphemeralSandboxDir(l,n);const t=(0,s.join)(e,"testform.state");const o=(0,s.join)(e,"metadata.json");if(!(0,r.existsSync)(e)||!(0,r.existsSync)(t)){console.error((0,i.red)(`\nError: Ephemeral sandbox "${n}" not found.`));process.exit(1)}let a={};let c={};try{a=JSON.parse((0,r.readFileSync)(t,"utf8"))}catch{}if((0,r.existsSync)(o)){try{c=JSON.parse((0,r.readFileSync)(o,"utf8"))}catch{}}if(h){console.log(JSON.stringify({metadata:c,state:a},null,2));return}const u=a.resources||[];console.log((0,i.bold)(`\nEphemeral Sandbox: `)+(0,i.cyan)((0,i.bold)(n)));console.log((0,i.dim)(`Created: `)+(c.createdAt?new Date(c.createdAt).toLocaleString():"N/A"));console.log((0,i.dim)(`State file: `)+t);console.log((0,i.dim)(`Tracked resources: `)+(0,i.green)(u.length));if(u.length>0){console.log((0,i.bold)(`\nResources:`));for(const e of u){const t=e.attributes?.issueNumber?`#${e.attributes.issueNumber}`:"(unassigned)";console.log(` - ${(0,i.cyan)(e.type)}: ${e.identity} ${(0,i.dim)(t)}`)}}console.log("");break}default:console.error((0,i.red)(`\nUnknown ephemeral subcommand: "${t}".`));console.log(`Available subcommands: up, down, list, show\n`);process.exit(1)}};t.ephemeralCmd=ephemeralCmd},2353:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.fmtCmd=void 0;const s=n(9896);const r=n(465);const i=n(1227);const o=n(9606);function printUnifiedDiff(e,t,n){console.log(`--- ${e}`);console.log(`+++ ${e}`);const s=t.split("\n");const i=n.split("\n");const o=Math.max(s.length,i.length);for(let e=0;e<o;e++){const t=s[e];const n=i[e];if(t!==n){if(t!==undefined)console.log((0,r.red)(`-${t}`));if(n!==undefined)console.log((0,r.green)(`+${n}`))}}}const fmtCmd=async e=>{const{dir:t=".",check:n=false,diff:r=false,list:a=true,write:c=true,recursive:l=false}=e;const u=(0,o.findFeatureFiles)(t,l);if(u.length===0){console.log("No .feature files found.");return}let d=0;for(const e of u){const t=(0,s.readFileSync)(e,"utf8");const i=(0,o.formatGherkin)(t);if(t!==i){d++;if(r){printUnifiedDiff(e,t,i)}else if(!n&&c){(0,s.writeFileSync)(e,i,"utf8")}if(a&&!r){console.log(e)}}}if(n){if(d>0){console.log(`\n${d} file(s) would be reformatted.`);process.exit(3)}else{i.logger.success("All files are formatted correctly.")}}};t.fmtCmd=fmtCmd},3634:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.forceUnlockCmd=void 0;const o=i(n(3785));const a=n(465);const c=n(7066);const l=n(6028);const forceUnlockCmd=async e=>{const{dir:t=".",lockId:n,force:s=false,statePath:r}=e;const i=new c.State(t,r);await i.init();const executeUnlock=async()=>{const e=await i.forceUnlock(n);if(e.success){console.log((0,a.green)(`\n${l.TITLE_APP} state has been successfully unlocked!\n`));if(!s){console.log(`The state has been unlocked, and ${l.TITLE_APP} commands should now be able to`);console.log(`obtain a new lock on the remote state.`)}}else{if(e.currentLockId){console.error((0,a.red)(`Error: Lock ID does not match.\n\nExpected: ${n}\nActual: ${e.currentLockId}\n`))}else if(e.error){console.error((0,a.red)(`${e.error}\n`))}process.exit(1)}};if(s){await executeUnlock();return}console.log(`Do you really want to force-unlock?`);console.log(` ${l.TITLE_APP} will remove the lock on the remote state.`);console.log(` This will allow local ${l.TITLE_APP} commands to modify this state, even though it`);console.log(` may be still be in use. Only 'yes' will be accepted to confirm.`);console.log("");const u=o.createInterface({input:process.stdin,output:process.stdout});return new Promise(((e,t)=>{u.question(" Enter a value: ",(async n=>{u.close();try{if(n.trim().toLowerCase()==="yes"){await executeUnlock()}else{console.error((0,a.red)(`\nUnlock cancelled.\n`));process.exitCode=1}e()}catch(e){t(e)}}))}))};t.forceUnlockCmd=forceUnlockCmd},31:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.FUNCTIONS_CATALOG=void 0;t.functionsCmd=functionsCmd;const r=s(n(465));const i=n(6066);const o=n(2825);const{bold:a,cyan:c,green:l,yellow:u,gray:d,white:f,magenta:p}=r.default;t.FUNCTIONS_CATALOG={lower:{name:"lower",category:"String & Text",signature:"lower(string)",returnType:"string",description:"Converts all letters in a string to lowercase.",arguments:[{name:"string",type:"string",description:"The string to convert."}],examples:[{expression:'lower("HELLO WORLD")',result:'"hello world"'},{expression:"lower(var.environment)",result:'"staging"'}]},upper:{name:"upper",category:"String & Text",signature:"upper(string)",returnType:"string",description:"Converts all letters in a string to uppercase.",arguments:[{name:"string",type:"string",description:"The string to convert."}],examples:[{expression:'upper("testform")',result:'"TESTFORM"'},{expression:"upper(var.tier)",result:'"ENTERPRISE"'}]},trim:{name:"trim",category:"String & Text",signature:"trim(string, [cutset])",returnType:"string",description:"Removes leading and trailing whitespace or specified characters.",arguments:[{name:"string",type:"string",description:"The input string."},{name:"cutset",type:"string",optional:true,description:"Characters to strip (defaults to whitespace)."}],examples:[{expression:'trim(" hello ")',result:'"hello"'},{expression:'trim("!?hello!?", "!?")',result:'"hello"'}]},trimprefix:{name:"trimprefix",category:"String & Text",signature:"trimprefix(string, prefix)",returnType:"string",description:"Removes the specified prefix from the beginning of a string if present.",arguments:[{name:"string",type:"string",description:"The input string."},{name:"prefix",type:"string",description:"The prefix to remove."}],examples:[{expression:'trimprefix("v1.2.3", "v")',result:'"1.2.3"'}]},trimsuffix:{name:"trimsuffix",category:"String & Text",signature:"trimsuffix(string, suffix)",returnType:"string",description:"Removes the specified suffix from the end of a string if present.",arguments:[{name:"string",type:"string",description:"The input string."},{name:"suffix",type:"string",description:"The suffix to remove."}],examples:[{expression:'trimsuffix("index.case.feature", ".case.feature")',result:'"index"'}]},startswith:{name:"startswith",category:"String & Text",signature:"startswith(string, prefix)",returnType:"boolean",description:"Returns true if the string begins with the specified prefix.",arguments:[{name:"string",type:"string",description:"The string to test."},{name:"prefix",type:"string",description:"The prefix to check."}],examples:[{expression:'startswith(var.image_tag, "v")',result:"true"}]},endswith:{name:"endswith",category:"String & Text",signature:"endswith(string, suffix)",returnType:"boolean",description:"Returns true if the string ends with the specified suffix.",arguments:[{name:"string",type:"string",description:"The string to test."},{name:"suffix",type:"string",description:"The suffix to check."}],examples:[{expression:'endswith(var.filename, ".feature")',result:"true"}]},replace:{name:"replace",category:"String & Text",signature:"replace(string, search, replacement)",returnType:"string",description:"Replaces all occurrences of a search string with a replacement string.",arguments:[{name:"string",type:"string",description:"The source string."},{name:"search",type:"string",description:"Substring to search for."},{name:"replacement",type:"string",description:"Replacement string."}],examples:[{expression:'replace("10.0.0.1", ".", "-")',result:'"10-0-0-1"'}]},split:{name:"split",category:"String & Text",signature:"split(separator, string)",returnType:"list",description:"Divides a string into a list of substrings separated by the specified delimiter.",arguments:[{name:"separator",type:"string",description:"Delimiter used to split."},{name:"string",type:"string",description:"The input string."}],examples:[{expression:'split(",", "dev,staging,prod")',result:'["dev", "staging", "prod"]'}]},join:{name:"join",category:"String & Text",signature:"join(separator, list)",returnType:"string",description:"Concatenates elements of a list into a single string separated by the delimiter.",arguments:[{name:"separator",type:"string",description:"Delimiter inserted between elements."},{name:"list",type:"list",description:"List of elements to concatenate."}],examples:[{expression:'join("-", ["test", "run", "1"])',result:'"test-run-1"'}]},format:{name:"format",category:"String & Text",signature:"format(format, ...args)",returnType:"string",description:"Formats a string using verbs (%s for string, %d for integer, %j for JSON, %% for literal %).",arguments:[{name:"format",type:"string",description:"Format string containing placeholders."},{name:"args",type:"any...",description:"Values to interpolate."}],examples:[{expression:'format("%s/%s", var.base_url, "api/v1")',result:'"https://example.com/api/v1"'},{expression:'format("run-%03d", 5)',result:'"run-5"'}]},substr:{name:"substr",category:"String & Text",signature:"substr(string, offset, length)",returnType:"string",description:"Extracts a substring from offset up to length characters.",arguments:[{name:"string",type:"string",description:"The source string."},{name:"offset",type:"number",description:"Zero-based starting position."},{name:"length",type:"number",description:"Number of characters to extract."}],examples:[{expression:'substr("abcdef", 1, 3)',result:'"bcd"'}]},coalesce:{name:"coalesce",category:"Collections & Logic",signature:"coalesce(...args)",returnType:"any",description:"Returns the first argument that is not null, undefined, or empty string.",arguments:[{name:"args",type:"any...",description:"Sequence of values to evaluate."}],examples:[{expression:'coalesce(var.custom_title, var.default_title, "Untitled")',result:'"Untitled"'}]},lookup:{name:"lookup",category:"Collections & Logic",signature:"lookup(map, key, [default])",returnType:"any",description:"Retrieves the value of a key from a map, returning default if not present.",arguments:[{name:"map",type:"map",description:"The map to query."},{name:"key",type:"string",description:"The attribute name."},{name:"default",type:"any",optional:true,description:"Fallback value if key is not found."}],examples:[{expression:'lookup(local.env_urls, var.env, "http://localhost:3000")',result:'"https://api.dev.com"'}]},contains:{name:"contains",category:"Collections & Logic",signature:"contains(list_or_string, value)",returnType:"boolean",description:"Checks whether a list contains an element or a string contains a substring.",arguments:[{name:"list_or_string",type:"list | string",description:"The collection or text."},{name:"value",type:"any",description:"Value to search for."}],examples:[{expression:'contains(["dev", "staging", "prod"], var.environment)',result:"true"},{expression:'contains("hello world", "world")',result:"true"}]},length:{name:"length",category:"Collections & Logic",signature:"length(value)",returnType:"number",description:"Returns the number of elements in a list, keys in a map, or characters in a string.",arguments:[{name:"value",type:"list | map | string",description:"Target value."}],examples:[{expression:'length(["a", "b", "c"])',result:"3"},{expression:'length("hello")',result:"5"}]},element:{name:"element",category:"Collections & Logic",signature:"element(list, index)",returnType:"any",description:"Retrieves an element at the specified index with safe wrapping modulo behavior.",arguments:[{name:"list",type:"list",description:"Target list."},{name:"index",type:"number",description:"Zero-based index."}],examples:[{expression:'element(["a", "b", "c"], 1)',result:'"b"'}]},slice:{name:"slice",category:"Collections & Logic",signature:"slice(list, start, [end])",returnType:"list",description:"Returns a sublist of elements from start index up to end index.",arguments:[{name:"list",type:"list",description:"Target list."},{name:"start",type:"number",description:"Starting index."},{name:"end",type:"number",optional:true,description:"Ending index (exclusive)."}],examples:[{expression:'slice(["a", "b", "c", "d"], 1, 3)',result:'["b", "c"]'}]},merge:{name:"merge",category:"Collections & Logic",signature:"merge(...maps)",returnType:"map",description:"Merges multiple maps into a single map, with rightmost keys overriding leftmost.",arguments:[{name:"maps",type:"map...",description:"Maps to merge."}],examples:[{expression:"merge({ a: 1 }, { b: 2, a: 3 })",result:"{ a: 3, b: 2 }"}]},env:{name:"env",category:"System & Encoding",signature:"env(name)",returnType:"string",description:"Reads an environment variable from the host process.",arguments:[{name:"name",type:"string",description:"Environment variable name."}],examples:[{expression:'env("CI")',result:'"true"'},{expression:'env("GITHUB_TOKEN")',result:'"ghp_..."'}]},uuid:{name:"uuid",category:"System & Encoding",signature:"uuid()",returnType:"string",description:"Generates a random RFC 4122 version 4 UUID.",arguments:[],examples:[{expression:"uuid()",result:'"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"'}]},timestamp:{name:"timestamp",category:"System & Encoding",signature:"timestamp()",returnType:"string",description:"Returns current UTC date and time formatted in ISO 8601.",arguments:[],examples:[{expression:"timestamp()",result:'"2026-10-25T05:00:00.000Z"'}]},jsonencode:{name:"jsonencode",category:"System & Encoding",signature:"jsonencode(value)",returnType:"string",description:"Serializes a value into a standard JSON string.",arguments:[{name:"value",type:"any",description:"Value or data structure to serialize."}],examples:[{expression:"jsonencode({ active: true, retries: 3 })",result:'\'{"active":true,"retries":3}\''}]},jsondecode:{name:"jsondecode",category:"System & Encoding",signature:"jsondecode(string)",returnType:"any",description:"Parses a JSON string into its native data structure (object, list, etc.).",arguments:[{name:"string",type:"string",description:"JSON formatted string."}],examples:[{expression:'jsondecode(\'{"env":"qa"}\')',result:'{ env: "qa" }'}]},file:{name:"file",category:"System & Encoding",signature:"file(path)",returnType:"string",description:"Reads the contents of a local file as UTF-8 text.",arguments:[{name:"path",type:"string",description:"Relative or absolute file path."}],examples:[{expression:'file("config.json")',result:'"{\\n \\"version\\": 1\\n}"'}]}};async function functionsCmd(e){const{name:n,evalExpr:s}=e;if(s){try{const e=(0,o.evaluateExpression)(s,{vars:{},locals:{},extraFunctions:i.standardFunctions});console.log(a(c("\nExpression Evaluation:")));console.log(` ${d("Input:")} ${f(s)}`);console.log(` ${d("Type:")} ${u(typeof e==="object"?Array.isArray(e)?"list":"map":typeof e)}`);console.log(` ${d("Result:")} ${l(JSON.stringify(e,null,2))}\n`)}catch(e){console.error(r.default.red(`\nEvaluation Error: ${e.message}\n`));throw e}return}if(n){const e=n.toLowerCase().trim();const s=t.FUNCTIONS_CATALOG[e];if(!s){console.log(r.default.red(`\nUnknown function: "${n}".`));console.log(d(`Run 'testform functions' to view all available built-in functions.\n`));return}console.log(a(c(`\nTestform Expression Function: ${p(s.name)}`)));console.log(` ${d("Category:")} ${s.category}`);console.log(` ${d("Signature:")} ${u(s.signature)} -> ${c(s.returnType)}`);console.log(` ${d("Description:")} ${f(s.description)}`);if(s.arguments.length>0){console.log(a("\nArguments:"));for(const e of s.arguments){const t=e.optional?d(" (optional)"):"";console.log(` - ${c(e.name)} ${u(`[${e.type}]`)}${t}: ${e.description}`)}}else{console.log(a("\nArguments: none"))}if(s.examples.length>0){console.log(a("\nExamples:"));for(const e of s.examples){console.log(` ${d("$")} ${f(e.expression)}`);console.log(` ${l("=>")} ${c(e.result)}`);if(e.note)console.log(` ${d(`(${e.note})`)}`)}}console.log("");return}console.log(a(c("\nTestform Expression Engine — Built-in Functions Catalog\n")));console.log(d("Available in locals.yml expressions, variables.yml validation conditions, and CLI:"));const h=["String & Text","Collections & Logic","System & Encoding"];for(const e of h){console.log(a(u(`\n• ${e}:`)));const n=Object.values(t.FUNCTIONS_CATALOG).filter((t=>t.category===e));for(const e of n){const t=e.signature.padEnd(38," ");console.log(` ${c(t)} ${d("→")} ${f(e.description)}`)}}console.log(d("\nRun 'testform functions <name>' for detailed documentation and examples on a specific function."));console.log(d("Run 'testform functions --eval \"<expression>\"' to test expressions live in your terminal.\n"))}},7651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.generateCmd=void 0;const s=n(6928);const r=n(9896);const i=n(4489);const o=n(1227);const a=n(9606);const generateCmd=async e=>{const{dir:t,scope:n,title:c}=e;const l=new i.Config(t);const u=l.getConvention(n);const d=l.getIdentity(n);const f=n.replace("test","");const p=u?.directory||"";const h=u?.filename||`{YYYYMMDD}_{HHmmss}.${f}.feature`;const m=new Date;const g=m.toISOString().split("T")[0].replace(/-/g,"");const y=m.toTimeString().split(" ")[0].replace(/:/g,"");const b=m.getTime().toString();let v=c;let w="";if(v){w=v.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}let T=h.replace(/{YYYYMMDD}/g,g).replace(/{HHmmss}/g,y).replace(/{timestamp}/g,b).replace(/{slug}/g,w);T=T.replace(/^[_\-]+/,"").replace(/[_\-]+(\.)/g,"$1");const S=Math.random().toString(16).substring(2,8);if(T.endsWith(".feature")){if(T.endsWith(`.${f}.feature`)){T=T.replace(`.${f}.feature`,`_${S}.${f}.feature`)}else{T=T.replace(`.feature`,`_${S}.feature`)}}else{if(T.endsWith(`.${f}`)){T=T.replace(`.${f}`,`_${S}.${f}.feature`)}else{T+=`_${S}.${f}.feature`}}if(!v){v=T.replace(/\.feature$/,"")}const k=(0,s.join)(t,p,T);if((0,r.existsSync)(k)){o.logger.error(`File already exists: ${k}`);process.exit(1)}if(e.rules&&e.rules.length>0){const n=(0,a.findFeatureFiles)(t,true);for(const t of e.rules){const e=t.includes(".feature.")?t.slice(0,t.indexOf(".feature.")+8):t;const s=n.some((t=>t.endsWith(e)||t.includes(e)));if(!s){o.logger.error([`Not Found`,`The feature file for Rule '${e}' does not exist in the workspace.`]);process.exit(1)}}}const D=(0,s.dirname)(k);if(!(0,r.existsSync)(D)){(0,r.mkdirSync)(D,{recursive:true})}const _=(n==="testrun"||n==="testplan")&&d?(0,a.findNextIdentity)(t,d):null;let E=`@${n}`;if(_){E+=` ${_}`}E+=`\nFeature: ${v}\n`;if(e.rules&&e.rules.length>0){E+=`\n`;for(const t of e.rules){E+=` Rule: ${t}\n`}}try{(0,r.writeFileSync)(k,E,"utf-8");o.logger.success(`Generated ${n} file: ${k}`,{bold:true})}catch(e){o.logger.error(`Failed to generate file: ${e.message}`);process.exit(1)}};t.generateCmd=generateCmd},9478:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.graphCmd=void 0;const s=n(465);const r=n(5392);const i=n(9922);const o=n(1138);const a=n(2978);function escapeDot(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function toMermaidId(e){return"node_"+e.replace(/[^a-zA-Z0-9_]/g,"_")}function escapeMermaidLabel(e){return e.replace(/"/g,"#quot;").replace(/[\r\n]+/g," ")}function findCycleEdges(e){const t=new Map;for(const n of e){if(!t.has(n.from))t.set(n.from,[]);t.get(n.from).push(n.to)}const n=new Map;const s=new Set;function dfs(e,r){n.set(e,1);r.push(e);for(const i of t.get(e)||[]){const t=n.get(i)||0;if(t===1){s.add(`${e}->${i}`);const t=r.indexOf(i);if(t!==-1){for(let e=t;e<r.length-1;e++){s.add(`${r[e]}->${r[e+1]}`)}s.add(`${r[r.length-1]}->${i}`)}}else if(t===0){dfs(i,r)}}r.pop();n.set(e,2)}for(const e of t.keys()){if((n.get(e)||0)===0){dfs(e,[])}}return s}const graphCmd=async(e={})=>{const{dir:t=".",scope:s="testcase",drawCycles:c=false,format:l="dot",type:u}=e;const d=e.variables||new i.VariableParser(undefined,undefined,t);const f=new r.Parser(t,d);const p=f.content();const h=new o.DependencyResolver(t);const m=p.filter((e=>!e.uri.endsWith(".run.feature")&&!e.uri.endsWith(".plan.feature")));const g=p.filter((e=>e.uri.endsWith(".run.feature")));const y=p.filter((e=>e.uri.endsWith(".plan.feature")));const b=new Map;for(const e of y){if(!b.has(e.uri)){b.set(e.uri,{name:e.feature?.name||"Unnamed Plan",testruns:[]})}if(e.rule?.name)b.get(e.uri).testruns.push(e.rule.name)}const v=Array.from(b.values());const w=new Map;for(const e of g){if(!w.has(e.uri)){w.set(e.uri,{name:e.feature?.name||"Unnamed Run",testcases:[],identity:e.custom?.identity||e.feature?.name||"",uri:e.uri})}if(e.rule?.name)w.get(e.uri).testcases.push(e.rule.name);else if(e.name)w.get(e.uri).testcases.push(`${e.feature?.name}.${e.name}`)}const T=Array.from(w.values());if(v.length===0&&T.length===0&&m.length===0){console.log("No test configurations found.");return}function findTcs(e){let t="*";let s=e;if(e.includes(".feature.")){const n=e.indexOf(".feature.");s=e.substring(0,n+8);t=e.substring(n+9)}else if(e.endsWith(".feature")){s=e;t="*"}else if(e.includes(".")){const n=e.split(".");t=n.pop()||"*";s=n.join(".")}const r=m.filter((e=>{const n=!s||e.uri.endsWith(s)||e.uri.includes(s);const r=t==="*"||e.name===t||e.name.includes(t)||e.custom?.identity===t;return n&&r}));const i=Array.from(new Set(r.map((e=>e.uri))));if(i.length>1){if(t!=="*"){const{logger:e}=n(1227);e.error(`Ambiguous reference for Scenario '${t}' under Rule '${s}'. It matches multiple files:\n`+i.map((e=>` - ${e}`)).join("\n")+`\nPlease specify the full file path in your Rule to disambiguate.`)}else{const{logger:e}=n(1227);e.warn(`Rule '${s}' matches multiple feature files. Processing all of them:\n`+i.map((e=>` - ${e}`)).join("\n")+`\nIf this was unintentional, specify the full file path.`)}}return r}function findMatchingTcNode(e){const t=(0,a.normalizeAddress)(e);for(const n of m){const s=n.custom?.identity||`${n.uri}.${n.name}`;const r=n.tags?n.tags.map((e=>typeof e==="string"?e:e.name)):[];const i=r.map((e=>(0,a.normalizeAddress)(`${n.uri}.${e}`)));if((0,a.addressesMatch)(s,e)||(0,a.addressesMatch)(n.name,e)||(0,a.addressesMatch)(n.uri,e)||i.some((t=>(0,a.addressesMatch)(t,e)))||t.endsWith((0,a.normalizeAddress)(n.name))||t.endsWith((0,a.normalizeAddress)(s))){return`testcase.${n.name}`}}return`testcase.${e}`}function getTcDependencies(e){const t=e.tags?e.tags.map((e=>typeof e==="string"?e:e.name)):[];const n=[e.name,`${e.uri}.${e.name}`,e.custom?.identity,...t.map((t=>`${e.uri}.${t}`)),...t.map((t=>`${e.uri}.@${t.replace(/^@/,"")}`)),...t].filter(Boolean);const s=new Set;for(const e of n){const n=h.getDependencies(e,t);for(const e of n)s.add(e)}return Array.from(s)}const S=(l||"dot").toLowerCase();if(S==="tree"){renderTreeGraph({testplans:v,testruns:T,testcases:m,scope:s,drawCycles:c,depResolver:h,findTcs:findTcs,getTcDependencies:getTcDependencies});return}const k=new Map;const D=[];const _=u?` (${u})`:"";if(s==="testplan"||s==="testcase"){for(const e of v){const t=`testplan.${e.name}`;k.set(t,{id:t,label:`${e.name}${_}`,kind:"testplan"});for(const n of e.testruns){const e=(0,a.normalizeAddress)(n);const r=T.find((t=>(0,a.addressesMatch)(t.identity,n)||t.name===n||t.name.endsWith(n)||n.endsWith(t.name)||(0,a.normalizeAddress)(t.uri).endsWith(e)));if(r){const e=`testrun.${r.name}`;k.set(e,{id:e,label:`${r.name}${_}`,kind:"testrun"});D.push({from:t,to:e,kind:"contains"});if(s!=="testplan"){for(const t of r.testcases){const n=findTcs(t);for(const t of n){const n=`testcase.${t.name}`;k.set(n,{id:n,label:`${t.name}${_}`,kind:"testcase"});D.push({from:e,to:n,kind:"contains"});const s=getTcDependencies(t);for(const e of s){const t=findMatchingTcNode(e);if(!k.has(t)){k.set(t,{id:t,label:`${e}${_}`,kind:"testcase"})}D.push({from:t,to:n,kind:"depends_on",label:"depends_on"})}}}}}}}if(s!=="testplan"){const e=new Set(v.flatMap((e=>e.testruns||[])));const t=T.filter((t=>!Array.from(e).some((e=>(0,a.addressesMatch)(t.identity,e)||t.name===e||(0,a.normalizeAddress)(t.uri).endsWith((0,a.normalizeAddress)(e))||e.endsWith(t.name)))));for(const e of t){const t=`testrun.${e.name}`;k.set(t,{id:t,label:`${e.name}${_}`,kind:"testrun"});for(const n of e.testcases){const e=findTcs(n);for(const n of e){const e=`testcase.${n.name}`;k.set(e,{id:e,label:`${n.name}${_}`,kind:"testcase"});D.push({from:t,to:e,kind:"contains"});const s=getTcDependencies(n);for(const t of s){const n=findMatchingTcNode(t);if(!k.has(n)){k.set(n,{id:n,label:`${t}${_}`,kind:"testcase"})}D.push({from:n,to:e,kind:"depends_on",label:"depends_on"})}}}}}}else if(s==="testrun"){for(const e of T){const t=`testrun.${e.name}`;k.set(t,{id:t,label:`${e.name}${_}`,kind:"testrun"});for(const n of e.testcases){const e=findTcs(n);for(const n of e){const e=`testcase.${n.name}`;k.set(e,{id:e,label:`${n.name}${_}`,kind:"testcase"});D.push({from:t,to:e,kind:"contains"});const s=getTcDependencies(n);for(const t of s){const n=findMatchingTcNode(t);if(!k.has(n)){k.set(n,{id:n,label:`${t}${_}`,kind:"testcase"})}D.push({from:n,to:e,kind:"depends_on",label:"depends_on"})}}}}}const E=findCycleEdges(D);if(S==="mermaid"){renderMermaidGraph({nodes:Array.from(k.values()),edges:D,cycleEdges:E,drawCycles:c})}else{renderDotGraph({nodes:Array.from(k.values()),edges:D,cycleEdges:E,drawCycles:c})}};t.graphCmd=graphCmd;function renderDotGraph(e){const{nodes:t,edges:n,cycleEdges:s,drawCycles:r}=e;const i=[];i.push("digraph G {");i.push(' compound = "true";');i.push(' newrank = "true";');i.push(' subgraph "root" {');for(const e of t){const t=`[root] ${e.id}`;i.push(` "${escapeDot(t)}" [label = "${escapeDot(e.label)}", shape = "box"];`)}for(const e of n){const t=`[root] ${e.from}`;const n=`[root] ${e.to}`;const o=`${e.from}->${e.to}`;const a=s.has(o);if(a&&r){i.push(` "${escapeDot(t)}" -> "${escapeDot(n)}" [color = "red", penwidth = 2.0];`)}else if(e.label){i.push(` "${escapeDot(t)}" -> "${escapeDot(n)}" [label = "${escapeDot(e.label)}"];`)}else{i.push(` "${escapeDot(t)}" -> "${escapeDot(n)}";`)}}i.push(" }");i.push("}");console.log(i.join("\n"))}function renderMermaidGraph(e){const{nodes:t,edges:n,cycleEdges:s,drawCycles:r}=e;const i=[];i.push("graph TD");i.push(" subgraph root");for(const e of t){const t=toMermaidId(e.id);const n=e.kind==="testplan"?"📦 ":e.kind==="testrun"?"📂 ":"📄 ";i.push(` ${t}["${n}${escapeMermaidLabel(e.label)} (${e.kind})"]`)}for(const e of n){const t=toMermaidId(e.from);const n=toMermaidId(e.to);const o=`${e.from}->${e.to}`;const a=s.has(o);if(a&&r){i.push(` ${t} -.->|cycle| ${n}`);i.push(` style ${t} stroke:#ff0000,stroke-width:2px;`);i.push(` style ${n} stroke:#ff0000,stroke-width:2px;`)}else if(e.label){i.push(` ${t} --\x3e|${e.label}| ${n}`)}else{i.push(` ${t} --\x3e ${n}`)}}i.push(" end");console.log(i.join("\n"))}function renderTreeGraph(e){const{testplans:t,testruns:n,scope:r,drawCycles:i,depResolver:o,findTcs:c,getTcDependencies:l}=e;console.log((0,s.bold)("Test Infrastructure Graph\n"));const link=e=>i?(0,s.magenta)(e):e;if(r==="testplan"||r==="testcase"){for(const e of t){const t=e.name;console.log(`📦 ${(0,s.cyan)((0,s.bold)(t))} ${(0,s.dim)(`(testplan)`)}`);const i=e.testruns;for(const[e,t]of i.entries()){const o=e===i.length-1;const u=o?"└── ":"├── ";const d=(0,a.normalizeAddress)(t);const f=n.find((e=>(0,a.addressesMatch)(e.identity,t)||e.name===t||e.name.endsWith(t)||t.endsWith(e.name)||(0,a.normalizeAddress)(e.uri).endsWith(d)));if(f){const e=f.name;console.log(` ${link(u)}📂 ${(0,s.green)(e)} ${(0,s.dim)(`(testrun)`)}`);if(r==="testcase"){const e=f.testcases;for(let t=0;t<e.length;t++){const n=e.at(t);const r=t===e.length-1;const i=o?" ":"│ ";const a=c(n);if(a.length>0){for(let e=0;e<a.length;e++){const t=a.at(e);const n=r&&e===a.length-1;const o=n?"└── ":"├── ";console.log(` ${i}${link(o)}📄 ${t.name} ${(0,s.dim)(`(testcase)`)}`);const c=l(t);if(c.length>0){const e=n?" ":"│ ";console.log(` ${i}${e}└── 🔗 ${(0,s.cyan)("depends_on:")} ${(0,s.dim)(c.join(", "))}`)}}}else{const e=r?"└── ":"├── ";console.log(` ${i}${link(e)}📄 ${(0,s.dim)(n+" (Not found)")}`)}}}}else{console.log(` ${link(u)}📂 ${(0,s.dim)(t+" (Not found)")}`)}}console.log("")}if(r==="testcase"){const e=new Set(t.flatMap((e=>e.testruns||[])));const r=n.filter((t=>!Array.from(e).some((e=>(0,a.addressesMatch)(t.identity,e)||t.name===e||(0,a.normalizeAddress)(t.uri).endsWith((0,a.normalizeAddress)(e))||e.endsWith(t.name)))));if(r.length>0){console.log((0,s.bold)("Orphaned Test Runs (Not linked to any testplan)\n"));for(const e of r){const t=e.name;console.log(`📂 ${(0,s.green)(t)} ${(0,s.dim)(`(testrun)`)}`);const n=e.testcases;for(let e=0;e<n.length;e++){const t=n.at(e);const r=e===n.length-1;const i=c(t);if(i.length>0){for(let e=0;e<i.length;e++){const t=i.at(e);const n=r&&e===i.length-1;const o=n?"└── ":"├── ";console.log(` ${link(o)}📄 ${t.name} ${(0,s.dim)(`(testcase)`)}`);const a=l(t);if(a.length>0){const e=n?" ":"│ ";console.log(` ${e}└── 🔗 ${(0,s.cyan)("depends_on:")} ${(0,s.dim)(a.join(", "))}`)}}}else{const e=r?"└── ":"├── ";console.log(` ${link(e)}📄 ${t}`)}}console.log("")}}}}else if(r==="testrun"){for(const e of n){const t=e.name;console.log(`📂 ${(0,s.green)((0,s.bold)(t))} ${(0,s.dim)(`(testrun)`)}`);const n=e.testcases;for(let e=0;e<n.length;e++){const t=n.at(e);const r=e===n.length-1;const i=c(t);if(i.length>0){for(let e=0;e<i.length;e++){const t=i.at(e);const n=r&&e===i.length-1;const o=n?"└── ":"├── ";console.log(` ${link(o)}📄 ${t.name} ${(0,s.dim)(`(testcase)`)}`)}}else{const e=r?"└── ":"├── ";console.log(` ${link(e)}📄 ${(0,s.dim)(t+" (Not found)")}`)}}console.log("")}}}},2541:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.importCmd=void 0;const r=n(6928);const i=n(4489);const o=n(7066);const a=n(5320);const c=n(942);const l=n(5392);const u=n(7862);const d=n(465);const f=n(4483);const p=s(n(9896));const h=n(1227);const m=n(6028);const g=n(7442);const importCmd=async e=>{const{dir:t=".",scope:n,identityArg:s,issueNumber:y,lock:b=true,lockTimeout:v="0s",statePath:w,backupPath:T}=e;const S=n||(0,g.detectScopeFromTarget)(s)||"testcase";const k=new h.Logger;console.log((0,d.bold)(`Importing ${S} ${s} from issue #${y}...`));const D=new o.State(t,w,T);await D.init();await D.acquireLock(b,v);try{const e=D;const n=(0,r.resolve)(t);const o=new i.Config(t);const h=o.getConfig();let b;if(o.getAdapterType()==="local"){b=new c.LocalAdapter(t)}else{b=new a.GitHubAdapter(o.getGitHub())}const v=parseInt(y,10);if(isNaN(v)){console.error((0,d.red)(`Invalid issue number: ${y}`));process.exit(1)}let w=s;const T=new i.Config(t);const k={identity:T.getIdentity(S),fields:T.getFields(S)};const _=new l.Parser(t);const E=_.content();const C=E.filter((e=>(0,g.matchesScope)(e,S)));let R=_.filter(C,k,S)||[];const P=R.find((e=>{const t=e.custom?.identity;if(!t)return false;const n=S==="testrun"||S==="testplan"?t:`${e.uri}.${t}`;return n===s||n.endsWith(s)||s.endsWith(n)}));if(P){const e=P.custom?.identity;w=S==="testrun"||S==="testplan"?e||s:`${P.uri}.${e}`;console.log(`Resolved short identity to full identity: ${w}`)}else{console.log((0,d.yellow)(`Warning: Could not find matching local scenario for identity: ${s}`));console.log((0,d.yellow)(`Import will proceed with the exact identity provided, but it might not map to any local file.`))}console.log(`Fetching issue #${v} from GitHub...`);const O=await b.getIssue(v);if(!O){console.error((0,d.red)(`Issue #${v} not found in GitHub repository.`));process.exit(1)}if(O.state==="closed"){console.log((0,d.yellow)(`Warning: Issue #${v} is currently closed.`))}if(!Object.prototype.hasOwnProperty.call(m.SCOPE_RESOURCE_MAP,S)){console.error((0,d.red)(`Invalid scope: ${S}`));process.exit(1)}const A=m.SCOPE_RESOURCE_MAP[S];const L=b.formatRemoteId(v);let x={};if(O.node_id){x=b.getProjectItemFields?await b.getProjectItemFields(O.node_id):{}}if(!P&&S==="testcase"&&w.includes(".")){const e=w.lastIndexOf(".");const t=w.slice(0,e);const s=w.slice(e+1);const i=(0,r.normalize)((0,r.resolve)(n,t));if(!i.startsWith(n)){console.error((0,d.red)(`Invalid file path in identity.`));process.exit(1)}if(p.default.existsSync(i)){const e=C.find((e=>e.uri===i));const t=e?.feature?.tags||[];const n=new Map;const r=p.default.readFileSync(i,"utf-8");const o=r.match(/Background:([\s\S]*?)(?=\n\s*@|\n\s*Scenario:|$)/);if(o){const e=o[1];for(const t of e.split("\n")){const e=t.match(/^\s*(?:\*|Given|When|Then|And)\s+field\s+([A-Za-z0-9_.\- ]+?)\s*=\s*(.+)$/i);if(e){n.set(e[1].trim().toLowerCase(),e[2].trim())}}}const a=T.getFields(S)||[];const c=[];const l=[];const u=O.labels||[];const f=a.find((e=>e.name==="labels"));const h=f?.default?String(f.default):"";for(const e of u){if(t.includes(e)||t.includes(`@${e}`))continue;if(e===h)continue;c.push(`@${e}`)}for(const e of a){if(e.name==="labels"||e.name==="assignees"||e.name==="milestone")continue;const s=Object.keys(x).find((t=>t.toLowerCase()===e.name.toLowerCase()));const r=s?x[s]:"";if(!r)continue;const i=e.default?String(e.default):"";const o=r.toLowerCase()===i.toLowerCase();const a=n.get(e.name.toLowerCase());const u=a&&a.toLowerCase()===r.toLowerCase();if(o||u)continue;if(e.source==="tag"){const e=r.startsWith("@")?r:`@${r}`;if(!t.includes(e)&&!t.includes(e.substring(1))){c.push(e)}}else if(e.source==="step"){l.push(`* field ${e.name} = ${r}`)}}let m=O.body||"";const g=m.match(/```gherkin\n([\s\S]*?)```/);if(g){m=g[1].trim()}else{m=m.trim()}if(m){const e=c.length>0?` ${s} ${c.join(" ")}\n`:` ${s}\n`;const t=l.length>0?l.map((e=>` ${e}\n`)).join(""):"";const n=m.split("\n").map((e=>` ${e}`)).join("\n")+`\n`;const r=`\n\n${e} Scenario: ${O.title}\n${t}${n}`;p.default.appendFileSync(i,r);console.log((0,d.green)(`\nAutomatically reconstructed scenario code in ${i}`))}}}let I="";if(P){I=(0,f.hashScenario)(P)}const $=P?u.resource.evaluate(A,P,{state:D}):null;const F=$;e.upsertResource({type:A,identity:w,attributes:{title:O.title,body:O.body||"",labels:O.labels?.filter((e=>e.name)).map((e=>e.name))??[],assignees:O.assignees||[],milestone:O.milestone||undefined,custom_fields:x,remoteId:L,issueNumber:O.number,localHash:I},lastApplied:(new Date).toISOString()});e.save();console.log((0,d.green)(`\nImport successful!`));console.log(`State updated for ${(0,d.bold)(`${A}.${w}`)} -> Issue #${v}`);console.log(`Run 'plan' to see if any local changes need to be applied.`)}finally{await D.save();await D.releaseLock()}};t.importCmd=importCmd},722:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.initCmd=t.hasValidFeatureFiles=t.EXPECTED_BACKEND_ARGS=void 0;const r=n(6028);const i=s(n(8815));const o=n(9896);const a=n(4489);const c=n(1227);const l=n(6928);const u=n(7066);const d=n(8081);const f=n(9606);const p=n(8742);const h=n(5301);const m=n(1859);t.EXPECTED_BACKEND_ARGS={local:["path","workspace_dir","workspace_dir_prefix"],s3:["bucket","key","region","endpoint","dynamodb_table","profile","namespace","force_path_style","forcepathstyle","encrypt","kms_key_id","role_arn","workspace_key_prefix","access_key","secret_key","token"],oci:["bucket","namespace","region","key","endpoint","profile","tenancy_id","compartment_id","fingerprint","private_key_path","user_id"],azurerm:["resource_group_name","storage_account_name","container_name","key","connection_string","environment","subscription_id","tenant_id","client_id","client_secret"],gcs:["bucket","prefix","credentials","impersonate_service_account"],github:["owner","repository","repo","branch","path","token_env","tokenenv","token"]};const hasValidFeatureFiles=e=>{const t=(0,f.findFeatureFiles)(e,true);for(const e of t){try{const t=(0,o.readFileSync)(e,"utf-8");if(/@(testcase|testrun|testplan)\b/i.test(t)){return true}}catch{}}return false};t.hasValidFeatureFiles=hasValidFeatureFiles;const resolvePaths=e=>({configPath:(0,l.join)(e,r.FILE_CONFIG),statePath:(0,l.join)(e,r.FILE_STATE)});const ensureWorkingDirectory=(e,t)=>{if((0,o.existsSync)(e))return;(0,o.mkdirSync)(e,{recursive:true});t.info(`Created ${e} directory`)};const createConfigIfNotExists=(e,t,n="local",s="github")=>{const a=(0,l.dirname)(e);for(const e of r.CONFIG_FILE_NAMES){if((0,o.existsSync)((0,l.join)(a,e))){return true}}let c="local";const u=(n||"local").toLowerCase().trim();const d=["local","github","s3","azurerm","gcs","oci"];if(!d.includes(u)){t.warn(`Unknown backend type "${n}". Defaulting to "local". (Supported: ${d.join(", ")})`)}if(u==="github"){c={github:{branch:"testform-state",path:"state/testform.state"}}}else if(u==="s3"){c={s3:{bucket:"<required>",region:"us-east-1",key:"testform.state",dynamodb_table:"<optional>"}}}else if(u==="oci"){c={oci:{bucket:"<required_oci_bucket>",namespace:"<required_namespace>",region:"us-ashburn-1",key:"testform.state"}}}else if(u==="azurerm"){c={azurerm:{resource_group_name:"<required>",storage_account_name:"<required>",container_name:"<required>",key:"testform.state"}}}else if(u==="gcs"){c={gcs:{bucket:"<required>",prefix:"testform/state"}}}let f={github:{owner:"<required>",repository:"<required>",token_env:"GITHUB_TOKEN"}};const p=(s||"github").toLowerCase().trim();if(p==="local"){f="local"}else if(p==="gitlab"){f={gitlab:{projectId:"<required>",token_env:"GITLAB_TOKEN"}}}const h={testform:{required_version:`>= ${r.VERSION_CONFIG}`,backend:c},provider:f,resource:{testcase:{match:"*.case.feature",scaffold:{directory:"testcase",filename:"{slug}_{YYYYMMDD}.case.feature"},fields:[]},testrun:{match:"*.run.feature",scaffold:{directory:"testrun",filename:"{slug}_{YYYYMMDD}.run.feature"},fields:[]},testplan:{match:"*.plan.feature",scaffold:{directory:"testplan",filename:"{slug}_{YYYYMMDD}.plan.feature"},fields:[]}}};(0,o.writeFileSync)(e,i.default.stringify(h),"utf-8");return false};const loadValidatedConfig=e=>{const t=new a.Config(e);return t};const printNextSteps=e=>{e.success(`${r.TITLE_APP} has been successfully initialized!`,{bold:true});e.blank();e.info(`You may now begin working with ${r.TITLE_APP}. Try running "${r.TITLE_CLI} plan" to see`);e.info(`any changes that are required for your test management resources. All ${r.TITLE_APP} commands`);e.info("should now work.");e.blank();e.info(`If you ever set or change modules or backend configuration for ${r.TITLE_APP},`);e.info("rerun this command to reinitialize your working directory. If you forget, other");e.info("commands will detect it and remind you to do so if necessary.")};const initCmd=async(e={})=>{const{dir:n=".",backendType:s="local",providerType:i="github",verbose:a=false,backendConfigRaw:f,lock:g=true,lockTimeout:y="0s",reconfigure:b=false,backendEnabled:v=true,isJson:w=false}=e;const T=new c.Logger(a,w);const S=resolvePaths(n);ensureWorkingDirectory(n,T);const k=(0,t.hasValidFeatureFiles)(n);if(!k){T.success(`${r.TITLE_APP} initialized in an empty directory!`,{bold:true});T.blank();T.info(`The directory has no ${r.TITLE_APP} feature files. You may begin working`);T.info(`with ${r.TITLE_APP} immediately by creating Gherkin feature files.`);return}const D=createConfigIfNotExists(S.configPath,T,s,i);if(v){T.info("Initializing the backend...",{bold:true})}const _=loadValidatedConfig(n);const E=_.getBackend();let C=E;const R=["local","github","s3","azurerm","gcs","oci"];if(v&&E){if(E.type===""){T.push({type:"error",title:"Unsupported backend type",detail:[`on ${r.FILE_CONFIG} line 2, in backend:`,' 2: backend: ""',""],extra:['There is no backend type named "".']});return}else if(E.type&&!R.includes(E.type.toLowerCase())){T.push({type:"error",title:"Unsupported backend type",detail:[`on ${r.FILE_CONFIG}, in backend:`,` backend: "${E.type}"`,""],extra:[`There is no backend type named "${E.type}".`]});return}}if(!v){C={type:"local",config:{}}}if(f){if(!E){T.push({type:"warning",title:"Missing backend configuration",extra:['-backend-config was used without a "backend" block in the configuration.',"","If you intended to override the default local backend configuration,","no action is required, but you may add an explicit backend block to your","configuration to clear this warning:","",' backend: "local"',"","However, if you intended to override a defined backend, please verify that","the backend configuration is present and valid."]})}else{const e=(0,u.parseBackendOverrides)(f,n);const s=(C?.type||"local").toLowerCase().trim();const r=t.EXPECTED_BACKEND_ARGS[s]||[];for(const t of Object.keys(e)){const e=t.toLowerCase().replace(/-/g,"_");if(!r.includes(e)){T.push({type:"error",title:"Invalid backend configuration argument",extra:[`The backend configuration argument "${t}" given on the command line is not`,"expected for the selected backend type."]});return}}}}const P=!D&&(C?.config?.bucket==="<required>"||C?.config?.bucket==="<required_oci_bucket>"||C?.config?.namespace==="<required_namespace>"||C?.config?.resource_group_name==="<required>"||C?.config?.storage_account_name==="<required>"||C?.type==="github"&&_.getGitHub()?.owner==="<required>");if(P){const e=_.getResolvedPath()?(0,l.basename)(_.getResolvedPath()):r.FILE_CONFIG;const t=_.getRequiredVersion?_.getRequiredVersion():_.getConfig().version;T.info(`- Configuration: ${e} (${t?"v"+t:"v"+r.VERSION_CONFIG})`);T.info(`- State backend: scaffolded (${C?.type||"local"})`);T.blank();T.info(`Notice: Backend configuration template created with placeholder '<required>' values.`);T.info(`Please update ${e} with your cloud/repo details, then rerun:`);T.info(` ${r.TITLE_CLI} init`);return}const O=new p.WorkspaceManager(n);const A=O.getActiveBackend();const L=(C?.type||"local").toLowerCase().trim();const x={...C?.config||{}};if(f){const e=(0,u.parseBackendOverrides)(f,n);Object.assign(x,e)}const I={type:L,config:x};const isBackendEqual=(e,t)=>{if(!e||!t)return false;if(e.type!==t.type)return false;const n=Object.keys(e.config||{}).filter((t=>e.config[t]!==undefined&&e.config[t]!==""));const s=Object.keys(t.config||{}).filter((e=>t.config[e]!==undefined&&t.config[e]!==""));if(n.length!==s.length)return false;for(const s of n){if(String(e.config[s]||"")!==String(t.config[s]||""))return false}return true};const $=v&&A!==null&&!isBackendEqual(A,I);if($){if(!b&&!e.migrateState){T.push({type:"error",title:"Backend configuration changed",extra:["A change in the backend configuration has been detected, which may require migrating existing","state.","",`If you wish to attempt automatic migration of the state, run "${r.TITLE_CLI} init -migrate-state".`,"If you wish to store the current configuration with no changes to the state, run",`"${r.TITLE_CLI} init -reconfigure".`]});return}}if(v&&!P){const t=(e.inputEnabled??true)&&(0,h.isInteractive)();if(L==="s3"){if(!x.bucket||x.bucket==="<required>"){if(t){const e=await(0,h.askBackendAttribute)("bucket","The name of the S3 bucket");if(e){x.bucket=e}}}if(!x.bucket||x.bucket==="<required>"){T.push({type:"error",title:"Missing bucket value",extra:['The "bucket" attribute must be set for the s3 backend.']});return}if(!x.key){if(t){const e=await(0,h.askBackendAttribute)("key","The path to the state file inside the bucket");if(e){x.key=e}}}if(!x.key){T.push({type:"error",title:"Missing key value",extra:['The "key" attribute must be set for the s3 backend.']});return}if(!x.region&&!process.env.AWS_REGION&&!process.env.AWS_DEFAULT_REGION){T.push({type:"error",title:"Missing region value",extra:['The "region" attribute or the "AWS_REGION" or "AWS_DEFAULT_REGION" environment variables must',"be set."]});return}}else if(L==="oci"){if(!x.bucket||x.bucket==="<required_oci_bucket>"){if(t){const e=await(0,h.askBackendAttribute)("bucket","The name of the OCI bucket");if(e){x.bucket=e}}}if(!x.bucket||x.bucket==="<required_oci_bucket>"){T.push({type:"error",title:"Missing bucket value",extra:['The "bucket" attribute must be set for the oci backend.']});return}if(!x.namespace||x.namespace==="<required_namespace>"){if(t){const e=await(0,h.askBackendAttribute)("namespace","The OCI Object Storage namespace");if(e){x.namespace=e}}}if(!x.namespace||x.namespace==="<required_namespace>"){T.push({type:"error",title:"Missing namespace value",extra:['The "namespace" attribute must be set for the oci backend.']});return}if(!x.key){if(t){const e=await(0,h.askBackendAttribute)("key","The path to the state file inside the bucket");if(e){x.key=e}}}if(!x.key){T.push({type:"error",title:"Missing key value",extra:['The "key" attribute must be set for the oci backend.']});return}}else if(L==="azurerm"){const e={resource_group_name:"The name of the Resource Group",storage_account_name:"The name of the Storage Account",container_name:"The name of the Storage Container",key:"The name of the blob file inside the storage container"};const n=["resource_group_name","storage_account_name","container_name","key"];for(const s of n){if(!x[s]||x[s]==="<required>"){if(t&&e[s]){const t=await(0,h.askBackendAttribute)(s,e[s]);if(t){x[s]=t}}}if(!x[s]||x[s]==="<required>"){T.push({type:"error",title:`Missing ${s} value`,extra:[`The "${s}" attribute must be set for the azurerm backend.`]});return}}}else if(L==="gcs"){if(!x.bucket||x.bucket==="<required>"){if(t){const e=await(0,h.askBackendAttribute)("bucket","The name of the GCS bucket");if(e){x.bucket=e}}}if(!x.bucket||x.bucket==="<required>"){T.push({type:"error",title:"Missing bucket value",extra:['The "bucket" attribute must be set for the gcs backend.']});return}}}if(v&&L!=="local"&&L!=="github"){if(L==="azurerm"){(0,d.ensureDriverInstalled)("@azure/storage-blob",T)}else if(L==="s3"||L==="oci"){(0,d.ensureDriverInstalled)("@aws-sdk/client-s3",T);if(x?.dynamodb_table&&x.dynamodb_table!=="<optional>"){(0,d.ensureDriverInstalled)("@aws-sdk/client-dynamodb",T)}}else if(L==="gcs"){(0,d.ensureDriverInstalled)("@google-cloud/storage",T)}}const F=new u.State(n,undefined,undefined,!v,f,I);try{await F.acquireLock(g,y);if(e.migrateState&&$&&A){T.info(`Migrating state from ${A.type} to ${I.type}...`);const e=new u.State(n,undefined,undefined,false,undefined,A);try{await e.init();const t=e.getState();await F.init();F.replaceState(t);await F.save();T.success(`Successfully migrated state to ${I.type} backend!`)}catch(e){T.error(`Failed to migrate state: ${e.message}`);return}}else{await F.init()}}catch(e){const t=(L||"local").toLowerCase();if(t==="s3"){const e=Boolean(x?.namespace||x?.endpoint?.includes("oraclecloud.com"));const t=e?"https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication.htm":"https://developer.hashicorp.com/terraform/language/backend/s3";T.push({type:"error",title:"No valid credential sources found",extra:[`Please see ${t}`,"for more information about providing credentials.","","Error: failed to refresh cached credentials, no EC2 IMDS role found, operation","error ec2imds: GetMetadata, request canceled, context deadline exceeded"]});return}else if(t==="gcs"){T.push({type:"error",title:"No valid credential sources found",extra:["Please see https://cloud.google.com/docs/authentication/provide-credentials-adc","for more information about providing credentials.","","Error: Google Cloud Application Default Credentials not found or invalid"]});return}else if(t==="azurerm"){T.push({type:"error",title:"No valid credential sources found",extra:["Please see https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/authentication","for more information about providing credentials.","","Error: Azure credentials not found (ARM_ACCESS_KEY, ARM_CLIENT_ID / ARM_CLIENT_SECRET, or connection string required)"]});return}else if(t==="oci"){T.push({type:"error",title:"No valid credential sources found",extra:["Please see https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication.htm","for more information about providing credentials.","","Error: OCI credentials not found or invalid (check tenancy_id, fingerprint, and private_key_path)"]});return}else if(t==="github"){T.push({type:"error",title:"No valid credential sources found",extra:["Please see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens","for more information about providing credentials.","","Error: GitHub token not found or unauthorized (check GITHUB_TOKEN environment variable or login)"]});return}T.error(`Failed to initialize remote backend: ${e.message}`);return}finally{await F.releaseLock()}if(v){O.setActiveBackend(I);T.blank();T.info(`Successfully configured the backend "${I.type}"! ${r.TITLE_APP} will automatically`);T.info("use this backend unless the backend configuration changes.");T.blank()}const j=new m.ModuleRegistry(n);const M=j.getDeclaredModules();if(M.size>0){T.info("Initializing modules...",{bold:true});for(const[e,t]of M.entries()){if((0,m.isGitSource)(t.source)){T.info(`- Downloading ${t.source} for ${e}...`);const s=(0,m.parseGitSource)(t.source);const r=(0,l.join)(n,".testform","modules",e);if(!(0,o.existsSync)(r)){(0,o.mkdirSync)(r,{recursive:true})}T.info(`- Installed ${e} to .testform/modules/${e}`)}else{T.info(`- Using local module ${e} from ${t.source}`)}}T.blank()}T.info("Initializing provider plugins...",{bold:true});const N=_.getProviderType()||"github";T.info(`- Finding fromeroc9/${N} versions matching "1.0.0"...`);T.info(`- Installing fromeroc9/${N} v1.0.0...`);T.info(`- Installed fromeroc9/${N} v1.0.0`);const B=(0,l.join)(n,r.FILE_LOCK);if(!(0,o.existsSync)(B)){const e=(0,l.dirname)(B);if(!(0,o.existsSync)(e)){(0,o.mkdirSync)(e,{recursive:true})}const t={provider:{[`registry.testform.io/fromeroc9/${N}`]:{version:"1.0.0",constraints:">= 1.0.0",hashes:["h1:dGVzdGZvcm0tcHJvdmlkZXItbG9jay12ZXJpZmllZA=="]}}};(0,o.writeFileSync)(B,JSON.stringify(t,null,2),"utf-8");T.info(`\n${r.TITLE_APP} has created a lock file ${r.FILE_LOCK} to record the provider\nselections it made above. Include this file in your version control repository\nso that ${r.TITLE_APP} can guarantee to make the same selections by default when you\nrun "${r.TITLE_CLI} init" in the future.`)}else{T.info(`- Re-using previous version of fromeroc9/${N} from the dependency lock file`)}T.blank();printNextSteps(T)};t.initCmd=initCmd},7155:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.loginCmd=void 0;const o=n(465);const a=i(n(3785));const c=n(2633);const askQuestion=(e,t)=>new Promise((n=>{e.question(t,(e=>n(e.trim())))}));const loginCmd=async(e={})=>{let{hostname:t="github.com"}=e;const n=(t||"").trim().toLowerCase();if(n==="local"){console.error((0,o.bold)((0,o.red)(`\nError: The "local" provider does not require authentication.\n`)));process.exit(1)}if(n==="app.terraform.io"||n==="github")t="github.com";else if(n==="gitlab")t="gitlab.com";console.log(`\nTestForm must now request authentication credentials for ${(0,o.bold)(t)}.\nThese credentials will be stored locally at ~/.testform.d/credentials.json.\n`);const s=a.createInterface({input:process.stdin,output:process.stdout});try{const e=new c.Credentials;const n={};const r=await askQuestion(s,`Token (PAT) for ${t}: `);if(!r)throw new Error("Token cannot be empty.");n.token=r;e.setAuth(t,n);console.log(`\n${(0,o.green)("Success!")} Configuration saved for ${t}.`)}catch(e){console.log(`\n${(0,o.yellow)("Login aborted:")} ${e.message}`);process.exit(1)}finally{s.close()}};t.loginCmd=loginCmd},3834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.logoutCmd=void 0;const s=n(465);const r=n(2633);const logoutCmd=async(e={})=>{let{hostname:t="github.com"}=e;if(t==="app.terraform.io")t="github.com";const n=new r.Credentials;const i=n.removeToken(t);if(i){console.log(`\n${(0,s.green)("Success!")} Removed credentials for ${t}.`)}else{console.log(`\n${(0,s.yellow)("Warning:")} No credentials found for ${t}.`)}};t.logoutCmd=logoutCmd},3067:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.modulesCmd=void 0;const s=n(6928);const r=n(1859);const modulesCmd=async(e={})=>{const{dir:t=".",isJson:n=false}=e;const i=(0,s.resolve)(process.cwd(),t);const o=new r.ModuleRegistry(i);const a=o.getDeclaredModules();if(a.size===0){if(n){console.log(JSON.stringify({format_version:"1.0",modules:null}))}else{console.log("No modules found in configuration.")}return}if(n){const e=[];for(const[t,n]of a.entries()){let s=n.version||"";if(!s&&(0,r.isGitSource)(n.source)){const e=(0,r.parseGitSource)(n.source);if(e.ref){s=e.ref}}e.push({key:t,source:n.source,version:s})}console.log(JSON.stringify({format_version:"1.0",modules:e}));return}const c=Array.from(a.entries());console.log(`Modules declared by configuration:\n.`);c.forEach((([e,t],n)=>{const s=n===c.length-1;const i=s?"└──":"├──";let o=t.version||"";if(!o&&(0,r.isGitSource)(t.source)){const e=(0,r.parseGitSource)(t.source);if(e.ref){o=e.ref}}const a=o?` ${o}`:"";console.log(`${i} "${e}"[${t.source}]${a}`)}))};t.modulesCmd=modulesCmd},8973:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.outputCmd=void 0;const s=n(465);const r=n(7066);const i=n(1533);const o=n(9922);const a=n(6028);const c=`No state file was found!\n\nState management commands require a state file. Run this command\nin a directory where ${a.TITLE_CLI} has been run or use the -state flag\nto point the command to a specific state location.`;const outputCmd=async e=>{const{dir:t=".",name:n,statePath:a,backupPath:l,isJson:u=false,raw:d=false,variables:f}=e;const p=new r.State(t,a,l);if(typeof p.hasState==="function"&&!await p.hasState()){console.error((0,s.red)(c));process.exitCode=1;return}await p.init();const h=new i.OutputResolver(t);let m=p.getOutputs();if(!m||Object.keys(m).length===0){const e=f||new o.VariableParser(undefined,undefined,t);m=h.resolve(p,e);if(Object.keys(m).length>0){p.setOutputs(m);await p.save()}}try{const e=h.format(m,{json:u,raw:d,name:n});console.log(e)}catch(e){console.error((0,s.red)(e.message));process.exitCode=1}};t.outputCmd=outputCmd},4483:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.planCmd=void 0;t.hashScenario=hashScenario;t.calculatePlan=calculatePlan;const s=n(6982);const r=n(6028);const i=n(465);const o=n(7862);const a=n(4489);const c=n(5392);const l=n(2721);const u=n(7066);const d=n(1227);const f=n(9896);const p=n(1821);const h=n(6028);const m=n(2978);const g=n(6928);const y=n(7442);const b=n(8169);const v=n(2043);function hashScenario(e,t,n=[]){const r=JSON.parse(JSON.stringify(e));const i=new Set(n.map((e=>e.toLowerCase())));if(!t||t==="testcase"||i.has("title")||i.has("name")){r.name=""}if(!t||t==="testrun"||t==="testplan"||i.has("title")||i.has("name")){if(r.feature){r.feature.name=""}}if(i.has("tags")||i.has("labels")){r.tags=[];if(r.feature){r.feature.tags=[]}}if(i.has("steps")||i.has("body")){r.steps=[]}if(i.has("custom_fields")&&r.custom){delete r.custom.fields}return(0,s.createHash)("sha256").update(JSON.stringify(r)).digest("hex")}async function calculatePlan(e){const{dir:t,scope:n,variables:s,statePath:r,backupPath:o,target:f,destroyPlan:p=false,refreshOnly:b=false,preLoadedState:w,lock:T=true,lockTimeout:S="0s",replaceTargets:k,compactWarnings:D,testDirectory:_}=e;const E=new a.Config(t);if(!Object.prototype.hasOwnProperty.call(h.SCOPE_CONFIG,n)){throw new Error(`Invalid scope: ${n}`)}const C=h.SCOPE_CONFIG[n];const R=C.resource;const P=_?(0,g.join)(t,_):t;const O=new c.Parser(P,s);const A=O.content();const L=E.getMatch?.(n);let x=A.filter((e=>(0,y.matchesScope)(e,n,L)));const I={identity:E.getIdentity(n),fields:E.getFields(n)};let $=O.filter(x,I,n)||[];if(f){$=$.filter((e=>{const t=e.custom?.identity?`${e.uri}.${e.custom.identity}`:e.uri;return(0,y.matchesTarget)(t,f,n)||(0,y.matchesTarget)(e.uri,f,n)}))}if(p){$=[]}if(l.policy&&typeof l.policy.loadCustomPolicies==="function"){await l.policy.loadCustomPolicies(t)}const F=E&&typeof E.getPolicies==="function"?E.getPolicies():undefined;if(F&&l.policy&&typeof l.policy.configure==="function"){l.policy.configure(F)}const j=l.policy.scanner($,n,false,D);if(j){const e=new Error("Please fix them before continuing.");e.name="Policy violations found";throw e}const M=w||new u.State(t,r,o);if(!w){await M.init();await M.acquireLock(T,S)}let N=M.getResources(R);if(f){N=N.filter((e=>(0,y.matchesTarget)(e.identity,f,n)||e.type&&(0,y.matchesTarget)(e.type,f,n)))}if(b){return{changes:[],state:M,hasChanges:false}}for(const e of N){const t=e.attributes.remoteId?`[id=${e.attributes.remoteId}]`:"";console.log((0,i.bold)(`${(0,m.formatResourceAddress)(e.type,e.identity)}: Refreshing state... ${t}`))}console.log("");const B=new Map(N.map((e=>[(0,m.normalizeAddress)(e.identity),e])));const U=new Set;const G=[];const q=new v.LifecycleResolver(t);for(const e of $){let t;const s=e.custom?.identity;if(!s)continue;if(s.startsWith(e.uri)||s===e.uri){t=s}else{t=`${e.uri}.${s}`}const r=(0,m.normalizeAddress)(t);U.add(r);const i=e.tags?e.tags.map((e=>typeof e==="string"?e:e.name)):[];const o=q.getLifecycle(t,i);const a=hashScenario(e,n,o.ignore_changes);const c=B.get(r);const l=k?(0,y.matchesTarget)(t,k):false;if(!c){G.push({action:"add",identity:t,resourceType:R,scenario:e,localHash:a})}else if(c.tainted||l){G.push({action:"replace",identity:t,resourceType:R,scenario:e,remoteId:c.attributes.remoteId,issueNumber:c.attributes.issueNumber,localHash:a,oldAttributes:c.attributes})}else if(c.attributes.localHash!==a){G.push({action:"change",identity:t,resourceType:R,scenario:e,remoteId:c.attributes.remoteId,issueNumber:c.attributes.issueNumber,localHash:a,oldAttributes:c.attributes})}}for(const e of N){if(!U.has((0,m.normalizeAddress)(e.identity))){const t=q.getLifecycle(e.identity,e.attributes.labels||[]);if(t.prevent_destroy){d.logger.push({type:"error",title:"Instance cannot be destroyed",detail:[`Resource ${(0,m.formatResourceAddress)(e.type,e.identity)} has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or target other resources.`],close:true});throw new Error(`Instance cannot be destroyed: ${e.identity} has lifecycle.prevent_destroy set.`)}G.push({action:"destroy",identity:e.identity,resourceType:R,scenario:n==="testrun"||n==="testplan"?{uri:"(state)",feature:{tags:[],keyword:"",name:e.attributes.title,description:"",location:0},location:0,keyword:"",name:e.attributes.title,description:"",steps:[],tags:Array.isArray(e.attributes.labels)?e.attributes.labels:e.attributes.labels?String(e.attributes.labels).split(","):[],custom:{identity:e.identity}}:{uri:"(state)",feature:{tags:[],keyword:"",name:"",description:"",location:0},location:0,keyword:"",name:e.attributes.title,description:"",steps:[],tags:Array.isArray(e.attributes.labels)?e.attributes.labels:e.attributes.labels?String(e.attributes.labels).split(","):[],custom:{identity:e.identity}},remoteId:e.attributes.remoteId,issueNumber:e.attributes.issueNumber,localHash:e.attributes.localHash})}}return{changes:G,hasChanges:G.length>0,state:M}}const planCmd=async e=>{const{dir:t=".",verbose:s=false,scope:i,outPath:a,lock:c=true,lockTimeout:l="0s",input:m=true,variables:g,isJson:y=false,detailedExitCode:v=false,statePath:w,backupPath:T,target:S,destroyPlan:k=false,refresh:D=true,refreshOnly:_=false,replaceTargets:E,parallelism:C,compactWarnings:R=false,testDirectory:P}=e;const O=new d.Logger(s);if(g){const e=g.getMissingRequiredVars();if(e.length>0){if(!m||!process.stdin.isTTY){O.push({type:"error",title:"No value for required variable",detail:e.map((e=>`The root module input variable "${e.name}" is not set, and has no default value. Use -var or -var-file to supply a value.`)),close:true});return}const t=n(3785);const s=t.createInterface({input:process.stdin,output:process.stdout});const ask=e=>new Promise((t=>s.question(e,(e=>t(e.trim())))));for(const t of e){console.log(`var.${t.name}`);if(t.description){console.log(` ${t.description}`)}console.log("");const e=await ask(" Enter a value: ");console.log("");g.setVar(t.name,e)}s.close()}}const A=new u.State(t,w,T);await A.init();await A.acquireLock(c,l);let L={changes:[],hasChanges:false,state:A};try{const e=(0,b.resolveScopes)(i,S);if(D&&!k){if(!y)console.log(r.MSG_ACQUIRING_LOCK)}let n=[];for(const s of e){if(D&&!k){await(0,p.refreshState)({dir:t,scope:s,state:A,logger:O,silent:y,parallelismRaw:C,target:S})}const e=await calculatePlan({dir:t,scope:s,variables:g,statePath:w,backupPath:T,target:S,destroyPlan:k,refreshOnly:_,preLoadedState:A,lock:c,lockTimeout:l,replaceTargets:E,compactWarnings:R,testDirectory:P});n.push(...e.changes);L.state=e.state}L.changes=n;L.hasChanges=n.length>0;if(y){const e={format_version:"1.0",testform_version:h.VERSION_CLI,scope:i,changes:L.changes};console.log(JSON.stringify(e,null,2))}else{o.resource.summary(L.changes,true,{state:L.state,outPath:a})}}finally{await A.releaseLock()}if(a){const e=n(6928);const s=e.resolve(t,a);const r={format_version:"1.0",testform_version:h.VERSION_CLI,scope:i,changes:L.changes};try{(0,f.writeFileSync)(s,JSON.stringify(r,null,2),"utf-8");console.log(`\nSaved the plan to: ${a}\n\nTo perform exactly these actions, run the following command to apply:\n testform apply "${a}"`)}catch(e){O.error(`Failed to write plan to ${s}: ${e.message}`)}}if(v){process.exitCode=L.hasChanges?2:0}return L};t.planCmd=planCmd},5950:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.policyCmd=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=s(n(465));const c=n(2721);const l=n(4489);const u=n(6028);const d=n(1227);const{bold:f,green:p,red:h,yellow:m,cyan:g,gray:y}=a.default;function updateConfigFilePolicy(e,t,n){let s=null;for(const t of u.CONFIG_FILE_NAMES){const n=(0,i.resolve)(e,t);if((0,r.existsSync)(n)){s=n;break}}if(!s){s=(0,i.resolve)(e,"main.yml")}let a;if((0,r.existsSync)(s)){const e=(0,r.readFileSync)(s,"utf-8");a=o.default.parseDocument(e)}else{a=new o.default.Document({})}if(!a.contents){a.contents=a.createNode({})}let c=a.get("policy");if(!c){a.set("policy",a.createNode({}));c=a.get("policy")}if(n){const e=a.getIn(["policy","disabled"]);if(e){const n=e.items?e.items.map((e=>e.value??e)):Array.isArray(e)?e:[];const s=n.filter((e=>e!==t));if(s.length>0){a.setIn(["policy","disabled"],s)}else{a.deleteIn(["policy","disabled"])}}if(a.hasIn(["policy",t])){a.deleteIn(["policy",t])}}else{const e=a.getIn(["policy","disabled"]);if(e){const n=e.items?e.items.map((e=>e.value??e)):Array.isArray(e)?e:[];if(!n.includes(t)){n.push(t);a.setIn(["policy","disabled"],n)}}else if(a.hasIn(["policy",t])){a.setIn(["policy",t],false)}else{a.setIn(["policy","disabled"],[t])}}(0,r.writeFileSync)(s,a.toString(),"utf-8");return s}const policyCmd=async e=>{const{dir:t,scope:n,enable:s,disable:r,show:i,json:o,verbose:a}=e;const u=new d.Logger(a);await c.policy.loadCustomPolicies(t);const b=new l.Config(t,false);const v=b.getPolicies();if(v){c.policy.configure(v)}if(s){const e=s.trim();const n=c.policy.get(e);if(!n){u.warn(`Warning: Policy "${e}" is not currently registered, but will be enabled in configuration.`)}c.policy.enable(e);const r=updateConfigFilePolicy(t,e,true);if(o){console.log(JSON.stringify({id:e,action:"enable",status:"enabled",configFile:r}))}else{console.log(p(`\nSuccess! Policy "${e}" has been enabled.`));console.log(y(`Updated configuration in ${r}\n`))}return}if(r){const e=r.trim();const n=c.policy.get(e);if(!n){u.warn(`Warning: Policy "${e}" is not currently registered, but will be disabled in configuration.`)}c.policy.disable(e);const s=updateConfigFilePolicy(t,e,false);if(o){console.log(JSON.stringify({id:e,action:"disable",status:"disabled",configFile:s}))}else{console.log(m(`\nPolicy "${e}" has been disabled.`));console.log(y(`Updated configuration in ${s}\n`))}return}if(i){const e=i.trim();const t=c.policy.get(e);if(!t){u.error(`Error: Policy "${e}" was not found.`);process.exit(1)}if(o){console.log(JSON.stringify(t,null,2));return}console.log("");console.log(f(`Policy: ${g(t.id)}`));console.log(` ${f("Type:")} ${t.type==="system"?"system (built-in)":"user (custom)"}`);console.log(` ${f("Scope:")} ${t.scope.join(", ")}`);console.log(` ${f("Status:")} ${t.enabled?p("enabled"):h("disabled")}`);console.log(` ${f("Description:")} ${t.description||"(none)"}`);console.log("");return}let w=c.policy.getAll();if(n){w=w.filter((e=>e.scope.includes(n)))}if(o){console.log(JSON.stringify(w,null,2));return}if(w.length===0){console.log(y("\nNo policies registered for this configuration.\n"));return}const T=Math.max(14,...w.map((e=>e.id.length)));const S=Math.max(7,...w.map((e=>e.scope.join(", ").length)));const k=8;const D=10;console.log("");const _=["ID".padEnd(T),"SCOPE".padEnd(S),"TYPE".padEnd(k),"STATUS".padEnd(D),"DESCRIPTION"].join(" ");const E=["─".repeat(T),"─".repeat(S),"─".repeat(k),"─".repeat(D),"─".repeat(30)].join(" ");console.log(f(_));console.log(y(E));for(const e of w){const t=g(e.id.padEnd(T));const n=e.scope.join(", ").padEnd(S);const s=(e.type==="system"?"system":"custom").padEnd(k);const r=e.enabled?p("enabled".padEnd(D)):h("disabled".padEnd(D));const i=y(e.description||"");console.log(`${t} ${n} ${s} ${r} ${i}`)}console.log("")};t.policyCmd=policyCmd},7633:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.printCmd=void 0;const s=n(5392);const r=n(4489);const i=n(7442);const o=n(1227);const printCmd=async e=>{const{dir:t,file:a,format:c,scope:l,variables:u}=e;const d=l||(a?(0,i.detectScopeFromTarget)(a):undefined)||"testcase";const f=new s.Parser(t,u);const p=new r.Config(t);const h={identity:p.getIdentity(d),fields:p.getFields(d),convention:p.getConvention(d)};const m=f.content();let g=m;if(a){const e=n(6928);const s=e.resolve(t,a);g=m.filter((n=>{if(!n.uri)return false;if(n.uri.includes(a))return true;const r=e.resolve(t,n.uri);return r===s||r.includes(s)}));if(g.length===0){o.logger.error(`No scenarios found for file matching: ${a}`);process.exit(1)}}if(c==="gherkin"){console.log(JSON.stringify(g,null,2));return}if(c==="testform"){const e=f.filter(g,h,d);console.log(JSON.stringify(e,null,2));return}o.logger.error(`Invalid format: ${c}. Use 'gherkin' or 'testform'.`);process.exit(1)};t.printCmd=printCmd},5644:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.providersCmd=void 0;const s=n(9896);const r=n(6928);const i=n(465);const o=n(4489);const a=n(6028);const c=n(8184);const l=n(1227);const providersCmd=async(e={})=>{const{dir:t=".",action:n,args:u=[],isJson:d=false}=e;let f=t;let p=n;const h=["lock","mirror","schema"];if(n&&!h.includes(n.toLowerCase())){f=n;p=undefined}const m=(0,r.resolve)(process.cwd(),f);const g=a.CONFIG_FILE_NAMES.some((e=>(0,s.existsSync)((0,r.resolve)(m,e))));if(!g){l.logger.push({type:"error",title:"No configuration files",extra:[`The directory ${m} contains no ${a.TITLE_APP} configuration files.`],close:true});return}const y=new o.Config(m,false);const b=y.getProviderType()||"local";if(!p){console.log(`\nProviders required by configuration:\n.\n└── provider[registry.testform.io/fromeroc9/${b}] 1.0.0\n`);return}switch(p.toLowerCase()){case"lock":{const e=(0,r.resolve)(m,a.FILE_LOCK);const t=(0,r.dirname)(e);if(!(0,s.existsSync)(t)){(0,s.mkdirSync)(t,{recursive:true})}const n={provider:{[`registry.testform.io/fromeroc9/${b}`]:{version:"1.0.0",constraints:">= 1.0.0",hashes:["h1:dGVzdGZvcm0tcHJvdmlkZXItbG9jay12ZXJpZmllZA=="]}}};(0,s.writeFileSync)(e,JSON.stringify(n,null,2),"utf-8");console.log((0,i.green)(`\nSuccess! Dependencies for provider "fromeroc9/${b}" verified and written to ${a.FILE_LOCK}.\n`));break}case"mirror":{if(!u[0]){l.logger.push({type:"error",title:"Missing target directory argument",extra:["Target directory is required. Specify a directory where provider plugins should be mirrored."],close:true});return}const e=(0,r.resolve)(m,u[0]);if(!(0,s.existsSync)(e)){(0,s.mkdirSync)(e,{recursive:true})}const t={provider:`registry.testform.io/fromeroc9/${b}`,version:"1.0.0",mirrored_at:(new Date).toISOString()};(0,s.writeFileSync)((0,r.resolve)(e,`${b}.json`),JSON.stringify(t,null,2),"utf-8");console.log(`- Mirroring provider "fromeroc9/${b}" to ${u[0]}...`);console.log((0,i.green)(`\nSuccess! Provider plugins mirrored to ${u[0]}.\n`));break}case"schema":{const e=d||u.includes("-json")||u.includes("--json");if(e){const e={format_version:"1.0",provider_schemas:{[`registry.testform.io/fromeroc9/${b}`]:{provider:{version:0,block:{attributes:b==="github"?{owner:{type:"string",description:"GitHub repository owner",required:true},repository:{type:"string",description:"GitHub repository name",required:true},project_id:{type:"number",description:"GitHub Projects (v2) Project Number",optional:true},token_env:{type:"string",description:"Environment variable containing personal access token",optional:true}}:{endpoint:{type:"string",description:"Driver endpoint or path",optional:true}}}},resource_schemas:{[`${b}_testcase`]:{version:0,block:{attributes:{identity:{type:"string",description:"Unique testcase identifier tag (e.g. @tc-1)",required:true},title:{type:"string",description:"Test case scenario name",optional:true},labels:{type:["list","string"],description:"Labels/tags associated with test case",optional:true},assignees:{type:["list","string"],description:"Assigned engineers/testers",optional:true},custom_fields:{type:["map","string"],description:"Custom metadata fields",optional:true}}}},[`${b}_testrun`]:{version:0,block:{attributes:{identity:{type:"string",description:"Unique testrun identifier tag (e.g. @tr-1)",required:true},rules:{type:["list","string"],description:"Execution rules and included test scenarios",optional:true}}}},[`${b}_testplan`]:{version:0,block:{attributes:{identity:{type:"string",description:"Unique testplan identifier tag (e.g. @tp-1)",required:true},runs:{type:["list","string"],description:"Associated test run identifiers",optional:true}}}}}}}};console.log(JSON.stringify(e,null,2))}else{console.log((0,i.bold)(`\nProvider Schema: fromeroc9/${b}`));console.log((0,i.dim)("─".repeat(50)));console.log(`Resource: ${b}_testcase`);console.log(` - identity: string (required)`);console.log(` - title: string (optional)`);console.log(` - labels: list of string (optional)`);console.log(` - assignees: list of string (optional)`);console.log(` - custom_fields: map of string (optional)`);console.log(`Resource: ${b}_testrun`);console.log(` - identity: string (required)`);console.log(` - rules: list of rule`);console.log(`Resource: ${b}_testplan`);console.log(` - identity: string (required)`);console.log(` - runs: list of testrun\n`)}break}default:{console.log(c.HELP_PROVIDERS);break}}};t.providersCmd=providersCmd},1906:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.queryCmd=void 0;const s=n(465);const r=n(6028);const i=n(6928);const o=n(9896);const a=n(363);const queryCmd=async(e={})=>{const{dir:t=".",testDirectory:n,scope:c="all",filter:l,target:u,json:d=false,count:f=false,verbose:p=false,statePath:h,backupPath:m,generateConfigOut:g}=e;const y=n?(0,i.resolve)(t,n):(0,i.resolve)(t);const b=new a.StateQuery(y,h,m);await b.init();if(b.getResources().length===0){console.error((0,s.red)("╷"));console.error(`${(0,s.red)("│")} ${(0,s.bold)((0,s.red)("Error:"))} ${(0,s.bold)("No resources to query")}`);console.error((0,s.red)("│"));console.error(`${(0,s.red)("│")} The configuration does not contain any resources that can be queried.`);console.error((0,s.red)("╵"));process.exit(1)}const v=b.filterByTarget(u);const w=[];if(l){if(Array.isArray(l))w.push(...l);else w.push(l)}if(c&&c!=="all")w.push(`scope=${c}`);const T=w.length>0?b.filter(w,v):v;if(g){const e=(0,i.resolve)(t,g);const n=T.map((e=>`# Resource: ${e.id}\nimport {\n to = ${e.type}.${e.id.replace(/[^a-zA-Z0-9_]/g,"_")}\n id = "${e.remoteId||e.issueNumber||e.id}"\n}`)).join("\n\n");if(d){console.log(JSON.stringify({generated_config:n,resources:T},null,2))}else{(0,o.writeFileSync)(e,n+"\n","utf-8");console.log((0,s.green)(`\n✔ Generated configuration written to ${e}\n`))}return}if(f){console.log(T.length);return}if(d){console.log(JSON.stringify(T,null,2));return}console.log("");console.log((0,s.bold)(`# ${r.TITLE_APP} Query Results (${T.length} matches)`));console.log((0,s.dim)("─".repeat(80)));if(T.length===0){console.log((0,s.yellow)("No resources matched the given query criteria."));console.log("");return}const formatStatus=e=>{switch(e.toLowerCase()){case"passed":return(0,s.green)("✔ passed");case"failed":return(0,s.red)("✖ failed");case"pending":return(0,s.yellow)("⏳ pending");case"blocked":return(0,s.magenta)("⛔ blocked");case"skipped":return(0,s.gray)("⏭ skipped");case"unexecuted":return(0,s.dim)("❔ unexecuted");default:return(0,s.cyan)(e)}};for(const e of T){const t=e.issueNumber?(0,s.cyan)(`#${e.issueNumber}`):(0,s.dim)("(no issue)");const n=e.labels.length>0?(0,s.gray)(`[${e.labels.join(", ")}]`):"";const r=e.tainted?(0,s.red)(" [tainted]"):"";const i=formatStatus(e.status);console.log(` ${i} ${(0,s.cyan)(e.canonicalScope)}.${(0,s.bold)(e.id)} ${t}${r}`);console.log(` Title: ${e.title||(0,s.dim)("(no title)")}`);if(e.assignees.length>0){console.log(` Assignees: ${e.assignees.join(", ")}`)}if(n){console.log(` Labels: ${n}`)}if(Object.keys(e.custom_fields).length>0){const t=Object.entries(e.custom_fields).map((([e,t])=>`${e}=${t}`)).join(", ");console.log(` Fields: ${(0,s.dim)(t)}`)}console.log("")}console.log((0,s.bold)(`Total: ${T.length} resource(s) found.`));console.log("")};t.queryCmd=queryCmd},1821:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.refreshCmd=t.refreshState=void 0;const s=n(465);const r=n(5320);const i=n(942);const o=n(4489);const a=n(1227);const c=n(1227);const l=n(6028);const u=n(7442);const d=n(2978);const f=n(5124);const p=n(8169);const h=n(2043);const refreshState=async e=>{const{dir:t,scope:n,state:a,logger:p,silent:m=false,parallelismRaw:g,target:y}=e;if(!Object.prototype.hasOwnProperty.call(l.SCOPE_RESOURCE_MAP,n)){throw new Error(`Invalid scope: ${n}`)}const b=l.SCOPE_RESOURCE_MAP[n];let v=a.getResources(b);if(y){v=v.filter((e=>(0,u.matchesTarget)(e.identity,y,n)||e.type&&(0,u.matchesTarget)(e.type,y,n)))}if(v.length===0){await a.save();if(!m)console.log("No resources in state to refresh.");return}const w=new o.Config(t);const T=w.getAdapterType();let S;if(T==="local"){S=new i.LocalAdapter(t)}else{const e=w.getGitHub();if(!e){if(!m){c.logger.push({type:"error",title:"GitHub configuration not found",detail:[l.ERR_GITHUB_CONFIG_NOT_FOUND],close:true})}return}S=new r.GitHubAdapter(e)}let k=0;let D=0;const _=g?parseInt(String(g),10)||3:3;const E=new h.LifecycleResolver(t);await(0,f.executeInBatches)(v,_,(async e=>{const t=e.attributes.remoteId??"";if(!m)console.log(`${(0,d.formatResourceAddress)(e.type,e.identity)}: Refreshing state... ${(0,s.dim)(`[id=${t}]`)}`);try{if(!e.attributes.issueNumber){if(!m)console.log((0,s.yellow)(` ${e.identity}: No issue number — removing from state`));a.removeResource(e.identity);D++;return}const t=await S.getIssue(e.attributes.issueNumber);if(!t){if(!m)console.log((0,s.red)(` ${e.identity}: Issue #${e.attributes.issueNumber} not found — removing from state`));a.removeResource(e.identity);D++}else if(t.state==="closed"){if(!m)console.log((0,s.yellow)(` ${e.identity}: Issue #${e.attributes.issueNumber} is closed — removing from state`));a.removeResource(e.identity);D++}else{const n=t.node_id&&S.getProjectItemFields?await S.getProjectItemFields(t.node_id):undefined;const r=E.getLifecycle(e.identity,e.attributes.labels||[]);const{hasDrift:i,newAttributes:o}=(0,f.detectAttributeDrift)(e.attributes,t,n,r.ignore_changes);if(i){e.attributes={...e.attributes,...o};if(!m){console.log((0,s.yellow)(` ! Drift detected on remote for ${e.identity} (Issue #${e.attributes.issueNumber})`));console.log((0,s.dim)(` Run 'testform diff --remote' to inspect differences or interactively pull changes.`))}e.attributes.localHash="drift_detected";a.upsertResource(e)}k++}}catch(t){if(!m){c.logger.push({type:"warning",title:`Failed to refresh ${e.identity}: ${t.message}`,detail:[]})}}}));await a.save();if(!m){console.log("");console.log((0,s.green)((0,s.bold)(`Refresh complete! ${k} resource(s) refreshed, ${D} removed.`)))}};t.refreshState=refreshState;const refreshCmd=async e=>{const{dir:n=".",verbose:s=false,scope:r,lock:i=true,lockTimeout:o="0s",statePath:c,backupPath:l,parallelismRaw:u,compactWarnings:d,target:f}=e;const h=new a.Logger(s);return(0,p.withStateLock)({dir:n,statePath:c,backupPath:l,lock:i,lockTimeout:o},(async e=>{const s=(0,p.resolveScopes)(r,f);for(const r of s){await(0,t.refreshState)({dir:n,scope:r,state:e,logger:h,silent:false,parallelismRaw:u,target:f})}}))};t.refreshCmd=refreshCmd},8938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.reportCmd=void 0;const s=n(363);const r=n(6396);const i=n(6928);const o=n(9896);const a=n(465);const c=n(1227);const l=n(4296);const reportCmd=async e=>{const{dir:t=".",type:n="testcase-summary",format:u="markdown",filter:d,target:f,out:p,groupBy:h,statePath:m,template:g,variables:y}=e;try{const c=new s.StateQuery(t,m);await c.init();const l=c.filterByTarget(f);const b=Array.isArray(d)?d:d?[d]:[];const v=b.length>0?c.filter(b,l):l;const w=c.getStats(v);const T=y?y.getVars():{};const S=await(0,r.resolveReport)(n,t);const k={target:f,items:v,stats:w,variables:T,groupBy:h,options:e,stateQuery:c};const D=await S.collect(k);const _=await(0,r.resolveFormat)(S,u,t);const E=(0,r.resolveTemplate)(S,_.name,g,k,t);const C=await _.render(D,k,E);if(p){const e=(0,i.resolve)(t,p);(0,o.writeFileSync)(e,C);console.log((0,a.green)(`✔ Report saved to ${p}`))}else{if(_.isBinary){const e=`report${_.extension}`;const n=(0,i.resolve)(t,e);(0,o.writeFileSync)(n,C);console.log((0,a.yellow)(`Binary format "${_.name}" saved to default output: ${e}`))}else{console.log(typeof C==="string"?C:C.toString("utf-8"))}}}catch(e){if(e instanceof l.TestformError){process.exitCode=e.exitCode||1;return}c.logger.push({type:"error",title:e.name&&e.name!=="Error"?e.name:"Report generation error",detail:e.message?e.message.split("\n"):[String(e)]});process.exitCode=1}};t.reportCmd=reportCmd},5765:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.showCmd=void 0;const r=n(465);const i=n(9896);const o=s(n(6928));const a=n(7066);const c=n(1227);const l=n(6028);const u=n(7862);const showCmd=async(e={})=>{const{path:t,isJson:n=false,verbose:s=false,dir:d=".",statePath:f,backupPath:p}=e;const h=new c.Logger(s);if(t){const e=o.default.resolve(d,t);if(!(0,i.existsSync)(e)){h.error(`The specified file does not exist: ${e}`);process.exitCode=1;return}try{const t=(0,i.readFileSync)(e,"utf-8");const s=JSON.parse(t);if(s&&(Array.isArray(s.changes)||(s.testform_version||s.format_version)&&!s.resources)){if(n){console.log(JSON.stringify(s,null,2));return}const e=s.changes||[];const t=new a.State(d,f,p);try{await t.init()}catch{}u.resource.summary(e,true,{state:t});return}}catch(t){if(t instanceof SyntaxError){h.error(`Failed to parse file at ${e}: ${t.message}`);process.exitCode=1;return}}}const m=new a.State(d,t||f,p);await m.init();const g=m.getState();const y=g.resources;if(n){console.log(JSON.stringify(g,null,2));return}console.log("");console.log((0,r.bold)(`# ${l.TITLE_APP} State`));console.log(` Version: ${g.version}`);console.log(` Serial: ${g.serial}`);console.log(` Lineage: ${g.lineage}`);console.log(` Last Sync: ${g.lastSync||"(never)"}`);console.log(` Resources: ${y.length}`);console.log("");if(y.length>0){for(const e of y){const t=e.attributes.remoteId??"(unknown)";const n=e.attributes.issueNumber?(0,r.green)("synced"):(0,r.yellow)("pending");const s=e.identity;console.log(` ${(0,r.cyan)(e.type)}.${(0,r.bold)(s)} [id=${t}] ${n}`);console.log(` title: ${e.attributes.title}`);console.log(` issueNumber: ${e.attributes.issueNumber??"(none)"}`);console.log(` localHash: ${(0,r.dim)(e.attributes.localHash.substring(0,12))}...`);console.log(` lastApplied: ${e.lastApplied}`);console.log("")}}};t.showCmd=showCmd},1047:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.stateCmd=void 0;const s=n(465);const r=n(9896);const i=n(6928);const o=n(7066);const a=n(6028);const c=n(2978);const l=`No state file was found!\n\nState management commands require a state file. Run this command\nin a directory where ${a.TITLE_CLI} has been run or use the -state flag\nto point the command to a specific state location.`;const stateCmd=async e=>{const{dir:t=".",action:n,args:u,statePath:d,backupPath:f,isJson:p,id:h,dryRun:m,force:g}=e;const y=new o.State(t,d,f);if(n!=="push"&&typeof y.hasState==="function"&&!await y.hasState()){console.error((0,s.red)(l));process.exit(1)}await y.init();if(n==="pull"){const e=y.getState();console.log(JSON.stringify(e,null,2));return}if(n==="push"){if(u.length!==1){console.error((0,s.red)(`Usage: ${a.TITLE_CLI} state push [path]`));process.exit(1)}const e=(0,i.resolve)(process.cwd(),u[0]);if(!(0,r.existsSync)(e)){console.error((0,s.red)(`Error: File ${e} not found.`));process.exit(1)}try{const t=(0,r.readFileSync)(e,"utf-8");const n=JSON.parse(t);await y.acquireLock(true,"0s");const i=y.getState();if(!g&&i.lineage&&n.lineage&&i.lineage!==n.lineage){console.error((0,s.red)(`Error: Cannot push state with different lineage. Use -force to override.`));process.exit(1)}const o=i;o.resources=n.resources||[];o.serial+=1;await y.save();await y.releaseLock();console.log((0,s.green)(`Successfully pushed state from ${u[0]}`));return}catch(e){console.error((0,s.red)(`Error parsing or pushing state: ${e.message}`));process.exit(1)}}await y.acquireLock(true,"0s");try{const e=y.getResources();const filterResources=e=>{let t=e;if(h){t=t.filter((e=>e.attributes.issueNumber?.toString()===h||e.attributes.remoteId===h))}if(u.length>0){t=t.filter((e=>{const t=`${e.type}.${e.identity}`;return u.some((n=>t.startsWith(n)||e.identity.startsWith(n)))}))}return t};if(n==="list"){const t=filterResources(e);if(t.length===0&&u.length>0){console.error((0,s.red)(`No instance found for the given address!`));process.exit(1)}else if(t.length===0){console.log("No resources found in state.")}else{for(const e of t){const t=e.tainted?"[tainted] ":"";console.log(`${t}${e.type}.${e.identity}`)}}}else if(n==="identities"){const t=filterResources(e);const n=t.map((e=>e.identity));if(p){console.log(JSON.stringify(n,null,2))}else{for(const e of n){console.log(e)}}}else if(n==="show"){if(u.length!==1){console.error((0,s.red)(`Exactly one argument expected.\nUsage: ${a.TITLE_CLI} [global options] state show [options] ADDRESS`));process.exit(1)}const t=u[0];const n=t.includes(".")?t.split(".").slice(1).join("."):t;const r=e.find((e=>(0,c.normalizeAddress)(e.identity)===(0,c.normalizeAddress)(n)||(0,c.normalizeAddress)(`${e.type}.${e.identity}`)===(0,c.normalizeAddress)(n)||(0,c.normalizeAddress)(`${e.type}.${e.identity}`)===(0,c.normalizeAddress)(t)||(0,c.normalizeAddress)(e.identity)===(0,c.normalizeAddress)(t)));if(!r){console.error((0,s.red)(`No instance found for the given address!`));process.exit(1)}console.log((0,s.bold)(`# ${r.type}.${r.identity}:`));console.log(`resource "${r.type}" "${r.identity}" {`);const i=Object.keys(r.attributes);let o=0;for(const e of i){if(e.length>o)o=e.length}for(const e of i){const t=" ".repeat(o-e.length);const n=Object.prototype.hasOwnProperty.call(r.attributes,e)?r.attributes[e]:undefined;console.log(` ${e}${t} = ${(0,c.formatHclValue)(n,1)}`)}console.log(`}`);if(r.tainted){console.log((0,s.red)(`\nThis resource is marked as tainted.`))}}else if(n==="rm"){if(u.length===0){console.error((0,s.red)(`At least one address is required.\n\nUsage: ${a.TITLE_CLI} [global options] state rm [options] ADDRESS...`));process.exit(1)}let t=0;for(const n of u){const r=n.includes(".")?n.split(".").slice(1).join("."):n;const i=e.find((e=>(0,c.normalizeAddress)(e.identity)===(0,c.normalizeAddress)(r)||(0,c.normalizeAddress)(`${e.type}.${e.identity}`)===(0,c.normalizeAddress)(r)||(0,c.normalizeAddress)(`${e.type}.${e.identity}`)===(0,c.normalizeAddress)(n)||(0,c.normalizeAddress)(e.identity)===(0,c.normalizeAddress)(n)));if(i){if(m){console.log(`Would remove ${n}`)}else{y.removeResource(i.identity);console.log(`Removed ${n}`)}t++}else{console.error((0,s.red)(`Error: Resource ${n} not found in state.`))}}if(t>0&&!m){await y.save();console.log((0,s.green)(`\nSuccessfully removed ${t} resource instance(s).`))}}else if(n==="mv"){if(u.length!==2){console.error((0,s.red)(`Exactly two arguments expected.\n\nUsage: ${a.TITLE_CLI} [global options] state mv [options] SOURCE DESTINATION`));process.exit(1)}const t=u[0];const n=u[1];const r=t.includes(".")?t.split(".").slice(1).join("."):t;const i=n.includes(".")?n.split(".").slice(1).join("."):n;const o=e.find((e=>e.identity===r||`${e.type}.${e.identity}`===r));if(!o){console.error((0,s.red)(`Error: Source resource ${t} not found in state.`));process.exit(1)}if(m){console.log(`Would move ${t} to ${n}`)}else{y.removeResource(o.identity);o.identity=i;if(n.includes(".")){o.type=n.split(".")[0]}y.upsertResource(o);await y.save();console.log((0,s.green)(`Move ${t} to ${n} successfully executed!`))}}else if(n==="clean"||n==="optimize"){const t=JSON.stringify(y.getState());const n=Buffer.byteLength(t,"utf8");const r=filterResources(e);if(r.length===0&&u.length>0){console.error((0,s.red)(`No instance found for the given address!`));process.exit(1)}let i=0;for(const e of r){if(e.attributes){const t=JSON.stringify(e.attributes);e.attributes=(0,o.cleanAttributes)(e.attributes);const n=JSON.stringify(e.attributes);if(t!==n){i++}}}const a=JSON.stringify(y.getState());const c=Buffer.byteLength(a,"utf8");const l=Math.max(0,n-c);const d=n>0?(l/n*100).toFixed(1):"0.0";const formatSize=e=>{if(e<1024)return`${e} B`;return`${(e/1024).toFixed(2)} KB`};if(m){console.log((0,s.bold)(`State optimization dry-run preview:`));console.log(` Resources matching: ${r.length}`);console.log(` Resources to clean: ${i}`);console.log(` Current payload: ${formatSize(n)}`);console.log(` Estimated payload: ${formatSize(c)}`);console.log(` Potential reduction: -${d}% (-${formatSize(l)})`)}else{if(i>0){await y.save();console.log((0,s.green)((0,s.bold)(`State optimization complete:`)));console.log(` Resources evaluated: ${r.length}`);console.log(` Resources cleaned: ${i}`);console.log(` Payload size: ${formatSize(n)} -> ${formatSize(c)} (-${d}%)`);console.log(` Saved space: ${formatSize(l)}`)}else{console.log((0,s.green)(`State is already optimal (no redundant fields found).`))}}}else if(n==="replace-provider"){if(u.length!==2){console.error((0,s.red)(`Usage: ${a.TITLE_CLI} state replace-provider [options] FROM_PROVIDER TO_PROVIDER`));process.exit(1)}const t=u[0].toLowerCase();const n=u[1].toLowerCase();let r=0;for(const s of e){if(s.type.startsWith(`${t}_`)){s.type=s.type.replace(`${t}_`,`${n}_`);r++}}const i=y.getState();if(i.provider&&i.provider.toLowerCase()===t){i.provider=n}await y.save();console.log((0,s.green)(`\nSuccess! Replaced provider "${t}" with "${n}" across ${r} resource(s).\n`))}else{console.error((0,s.red)(`Usage: ${a.TITLE_CLI} state <clean|identities|list|mv|pull|push|replace-provider|rm|show> [options] [args]`));process.exit(1)}}finally{await y.releaseLock()}};t.stateCmd=stateCmd},5822:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.toolCmd=t.suiteCmd=t.IDENTIFIER_STRATEGIES_DETAIL=t.TARGET_STRATEGIES_DETAIL=void 0;t.parseTagAddress=parseTagAddress;const s=n(6928);const r=n(9896);const i=n(465);const o=n(7651);const a=n(9606);const c=n(5392);const l=n(4489);const u=n(7066);const d=n(3912);const f=n(8480);const p=n(7862);const h=n(6028);const m=n(5301);const g=n(7442);t.TARGET_STRATEGIES_DETAIL=[`Target strategies (-target):`,` 1. Identity Tag (@tr-N / @tp-N):`,` Unique identifier across the workspace. Only valid for testrun and testplan`,` (testcase @tc-N tags can repeat across different files and cannot be used as target).`,` Example: -target="@tr-1" or -target="@tp-2"`,``,` 2. Canonical Address:`,` Immutable full address binding the feature file and its identity tag.`,` Example: -target="tests/runs/20261024.run.feature.@tr-1"`,``,` 3. Scoped File Path:`,` File path resolved against -test-directory.`,` - With -test-directory="tests/runs": -target="20261024.run.feature"`,` - Without -test-directory: -target="tests/runs/20261024.run.feature"`];t.IDENTIFIER_STRATEGIES_DETAIL=[`Identifier strategies (<identifier>=<status>):`,` 1. Identity Tag: "@tc-1=passed" (caution: if @tc-1 repeats across files, use strategy 2)`,` 2. Canonical / File: "checkout.case.feature.@tc-1=passed" (disambiguates across files)`,` 3. Scenario Name: "Pago con tarjeta=passed"`];function parseTagAddress(e){const t=e.trim();const n=t.match(/^(?:(.*)(?:\.|\b))?\[([^\]]+)\]$/);if(!n){throw new Error(`Invalid tag address format: "${e}". Expected format like "[@smoke]" or "checkout.case.feature.[@smoke]".`)}let s=n[1]?.trim()||undefined;if(s?.endsWith(".")){s=s.slice(0,-1).trim()}const r=n[2].split(",").map((e=>e.trim())).filter(Boolean);const i=r.map((e=>e.startsWith("@")?e:`@${e}`));return{filePattern:s,tags:i}}async function runAdd(e){const{dir:t,scope:n,title:s,rules:r}=e;if(n==="testcase"){d.Diag.error({title:`\`testform suite init\` does not support scope 'testcase'.`,detail:[`Use \`${h.TITLE_CLI} generate\` for testcase files, or specify -scope=testrun or -scope=testplan.`]}).abort()}await(0,o.generateCmd)({dir:t,scope:n,title:s,rules:r})}async function runAutocomplete(e){const{dir:t,target:n,testDirectory:r,variables:o}=e;const u=r?(0,s.join)(t,r):t;const{absolutePath:f}=await(0,g.resolveTargetScenario)(n,t,"testrun",r,o);const p=a.GherkinEditor.parseRawDocument(f);if(!p.feature){d.Diag.structureError({file:n,message:`No Feature block found in '${n}'.`}).abort();return}const h=(p.feature.children||[]).filter((e=>e.rule));if(h.length===0){d.Diag.structureError({file:n,message:`No Rule blocks found in '${n}'.`}).abort()}const m=new c.Parser(u,o);const y=m.content()||[];const b=y.filter((e=>(0,g.matchesScope)(e,"testcase")));const v=Array.from(new Set(b.map((e=>e.uri))));let w=0;for(const e of h){const n=e?.rule;if(!n)continue;const r=typeof n==="string"?n:n.name||"";const o=typeof n==="object"&&n.children?n.children:[];const c=o.filter((e=>e.scenario));if(c.length>0){console.log(` ${(0,i.yellow)("~")} Rule '${r}': already has ${c.length} explicit scenario(s). Skipping.`);continue}const u=r.replace(/\.feature$/i,"");const d=v.find((e=>e===r||e.replace(/\.feature$/i,"")===u||(0,s.basename)(e).replace(/\.feature$/i,"")===u||e.endsWith("/"+r)||e.endsWith("/"+r+".feature")));if(!d){console.log(` ${(0,i.red)("!")} Rule '${r}': source file not found in workspace. Skipping.`);continue}const p=b.filter((e=>e.uri===d));if(p.length===0){console.log(` ${(0,i.red)("!")} Rule '${r}': no scenarios parsed from source file. Skipping.`);continue}const h=new l.Config(t);const g={identity:h.getIdentity("testcase"),fields:h.getFields("testcase")};const y=m.filter(p,g,"testcase")||[];const T=y.map((e=>{const t=e.custom?.identity||e.name;return`${r}.${t}`}));a.GherkinEditor.expandScenarios(f,T,"pending");console.log(` ${(0,i.green)("✓")} Rule '${r}': expanded ${T.length} scenario(s).`);w+=T.length}if(w===0){console.log("No scenarios were expanded. All Rules already have explicit scenarios or source files were not found.")}else{console.log((0,i.green)((0,i.bold)(`\nAutocomplete complete! ${w} scenario(s) expanded.`)))}}async function runLink(e){const{dir:t,testDirectory:n,variables:r,statePath:o,backupPath:u,verbose:f=false}=e;let p=e.target;if(!p){if((0,m.isInteractive)()){p=await(0,g.promptTargetSuite)(t,["testrun","testplan"],n,r)}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite link "<identifier>=<status>" -target=<path|relative|@tr-N>`,detail:[`Specify -target to indicate which suite to link into.`,`Available statuses: ${h.TESTCASE_STATUSES.join(", ")}`,``,`Identity strategies:`,` 1. Only tag: "@tc-1=passed"`,` 2. File + tag: "cuenta/inicio-sesion.feature@tc-1=passed"`,` 3. Scenario name: "Pago con tarjeta=passed"`,``,`Examples:`,` # Link into testrun (implicit):`,` ${h.TITLE_CLI} suite link "checkout.case.feature" -target="@tr-42"`,` # Link into testrun (explicit):`,` ${h.TITLE_CLI} suite link "@tc-1" -target="@tr-42"`,` ${h.TITLE_CLI} suite link "checkout.case.feature.@tc-1=passed" -target="@tr-42"`,` # Link into testplan:`,` ${h.TITLE_CLI} suite link "sprint42.run.feature" -target="@tp-1"`]}).abort();return}}if(!p)return;const y=n?(0,s.join)(t,n):t;const b=new c.Parser(y,r);const v=b.content()||[];let w="testrun";if(p.endsWith(".plan.feature")||p.includes("plan")||p.startsWith("@tp")){w="testplan"}else{const e=v.filter((e=>(0,g.matchesScope)(e,"testrun")));const t=e.some((e=>e.uri===p||e.uri.endsWith(p)||e.custom?.identity===p));if(!t){const e=v.filter((e=>(0,g.matchesScope)(e,"testplan")));if(e.some((e=>e.uri===p||e.uri.endsWith(p)||e.custom?.identity===p))){w="testplan"}}}const{absolutePath:T}=await(0,g.resolveTargetScenario)(p,t,w,n,r);if(w==="testplan"){let n=e.linkArg;if(n&&(n.includes("=")||n.startsWith("@tc"))){d.Diag.error({title:`Cannot link explicit testcase scenarios into a testplan.`,detail:[`Testplans only link entire testrun suites (Rule: <file.run.feature>).`,`Example: ${h.TITLE_CLI} suite link "sprint42.run.feature" -target="${p}"`,` ${h.TITLE_CLI} suite link "@tr-1" -target="${p}"`]}).abort()}if(!n){if((0,m.isInteractive)()){const e=v.filter((e=>(0,g.matchesScope)(e,"testrun")));const r=new l.Config(t);const i={identity:r.getIdentity("testrun"),fields:r.getFields("testrun")};const o=b.filter(e,i,"testrun")||[];const a=o.map((e=>({label:`${(0,s.basename)(e.uri)} ${e.custom?.identity?`(${e.custom.identity})`:""} - "${e.feature?.name||""}"`,value:(0,s.basename)(e.uri)})));if(a.length===0){d.Diag.error({title:`No testrun files found to link into testplan '${p}'.`,detail:[`Create a testrun first with \`${h.TITLE_CLI} suite init -scope=testrun\`.`]}).abort()}n=await(0,m.askSelect)(`Selecciona el testrun para enlazar en '${(0,s.basename)(T)}':`,a)}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite link "<testrunFile|@tr-N>" -target="${p}"`,detail:[`Please specify the testrun to link into testplan '${p}'.`,`Example: ${h.TITLE_CLI} suite link "sprint42.run.feature" -target="${p}"`]}).abort();return}}if(!n)return;let r=n;if(n.startsWith("@")||!n.includes(".feature")){const e=v.filter((e=>(0,g.matchesScope)(e,"testrun")));const t=e.find((e=>e.custom?.identity===n||e.uri.includes(n)));if(t){r=(0,s.basename)(t.uri)}}const{addedRule:o}=a.GherkinEditor.linkRuleOrScenario(T,r);if(o){console.log((0,i.green)((0,i.bold)(`\n✓ Successfully linked Rule '${r}' into testplan '${(0,s.basename)(T)}'`)))}else{console.log((0,i.yellow)(`\n~ Rule '${r}' is already present in testplan '${(0,s.basename)(T)}'`))}return}let S=e.linkArg;if(!S){if((0,m.isInteractive)()){const e=await(0,m.askSelect)("¿Cómo deseas enlazar a este testrun?",[{label:"Enlace Implícito - Enlazar todo un archivo .case.feature mediante Rule",value:"implicit"},{label:"Enlace Explícito - Enlazar un escenario específico con status",value:"explicit"}]);const n=v.filter((e=>(0,g.matchesScope)(e,"testcase")));const r=new l.Config(t);const i={identity:r.getIdentity("testcase"),fields:r.getFields("testcase")};const o=b.filter(n,i,"testcase")||[];if(e==="implicit"){const e=Array.from(new Set(o.map((e=>(0,s.basename)(e.uri)))));const t=e.map((e=>({label:e,value:e})));const n=await(0,m.askSelect)("Selecciona el archivo .case.feature a enlazar:",t);S=n}else{const e=Array.from(new Set(o.map((e=>(0,s.basename)(e.uri)))));let t="";if(e.length>1){const n=e.map((e=>({label:e,value:e})));t=await(0,m.askSelect)("Selecciona el archivo .case.feature del escenario:",n)}else if(e.length===1){t=e[0]}const n=o.filter((e=>!t||(0,s.basename)(e.uri)===t));const r=n.map((e=>{const t=e.custom?.identity?`[${e.custom.identity}] `:"";return{label:`${t}${e.name}`,value:`${(0,s.basename)(e.uri)}.${e.custom?.identity||e.name}`}}));const i=await(0,m.askSelect)("Selecciona el testcase a enlazar:",r);const a=await(0,m.askStatus)("pending");S=`${i}=${a}`}}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite link "<identifier>=<status>" -target="${p}"`,detail:[`Please provide the testcase or rule argument to link into '${p}'.`,`Usage:`,` Implicit link: ${h.TITLE_CLI} suite link "checkout.case.feature" -target="${p}"`,` Explicit link: ${h.TITLE_CLI} suite link "checkout.case.feature.@tc-1" -target="${p}"`,` ${h.TITLE_CLI} suite link "@tc-1" -target="${p}"`,` ${h.TITLE_CLI} suite link "@tc-1=passed" -target="${p}"`]}).abort();return}}if(!S)return;const k=S.replace(/=(passed|failed|skipped|pending)$/i,"").trim();const D=k.includes("@")||k.includes("=")||k.includes(".case.feature.")||k.includes(".run.feature.");const _=v.filter((e=>(0,g.matchesScope)(e,"testcase")));const E=Array.from(new Set(_.map((e=>e.uri))));const C=!D?E.find((e=>e===k||(0,s.basename)(e)===k||(0,s.basename)(e).replace(/\.feature$/i,"")===k.replace(/\.feature$/i,"")||(0,s.basename)(e).replace(/\.case\.feature$/i,"")===k.replace(/\.case\.feature$/i,""))):undefined;if(C){const e=(0,s.basename)(C);const{addedRule:t}=a.GherkinEditor.linkRuleOrScenario(T,e);if(t){console.log((0,i.green)((0,i.bold)(`\n✓ Successfully linked Rule '${e}' implicitly into testrun '${(0,s.basename)(T)}'`)))}else{console.log((0,i.yellow)(`\n~ Rule '${e}' is already present in testrun '${(0,s.basename)(T)}'`))}return}const{featurePart:R,casePart:P,newStatus:O}=(0,g.parseSpec)(S,{command:"link"});const A=new l.Config(t);const L={identity:A.getIdentity("testcase"),fields:A.getFields("testcase")};const x=b.filter(_,L,"testcase")||[];const I=x.filter((e=>(0,g.matchesScenarioSpec)(e,{featurePart:R,casePart:P})));if(I.length===0){d.Diag.error({title:`Testcase '${P}' not found in workspace to link.`,detail:[`Make sure the .case.feature file and scenario exist in your test directory.`]}).abort()}if(I.length>1){const e=I.map((e=>`${(0,s.basename)(e.uri)}.${e.custom?.identity||e.name}`));d.Diag.ambiguousTestcase({identifier:P,target:"workspace",matches:e}).abort()}const $=I[0];const F=(0,s.basename)($.uri);const j=$.custom?.identity||$.name;const{addedRule:M,addedScenario:N,updatedScenario:B}=a.GherkinEditor.linkRuleOrScenario(T,F,j,O);if(N){console.log((0,i.green)((0,i.bold)(`\n✓ Linked Scenario '${j}' under '${F}' with status '${O}' into '${(0,s.basename)(T)}'`)))}else if(B){console.log((0,i.green)((0,i.bold)(`\n✓ Updated Scenario '${j}' status to '${O}' in '${(0,s.basename)(T)}'`)))}else if(M){console.log((0,i.green)((0,i.bold)(`\n✓ Linked Rule '${F}' into '${(0,s.basename)(T)}'`)))}}async function runState(e){const{dir:t,target:r,subCommand:o="link",tcArg:y,statePath:b,backupPath:v,testDirectory:w,variables:T,verbose:S=false}=e;const k=new u.State(t,b,v);await k.init();const D=w?(0,s.join)(t,w):t;const{scenario:_,absolutePath:E}=await(0,g.resolveTargetScenario)(r,t,"testrun",w,T);let C;const R=_.custom?.identity;if(!R){C=_.uri}else if(R.startsWith(_.uri)||R===_.uri){C=R}else{C=`${_.uri}.${R}`}const P=k.getResources("testrun");const O=P.find((e=>e.identity===C));if(!O){d.Diag.error({title:`Testrun not found in state for target '${r}' (Identity: ${C}).`,detail:[`Try running \`${h.TITLE_CLI} refresh -scope testrun\` to sync state.`]}).abort();return}let A="";let L="";let x="";let I="";const $=k.getResources("testcase");if(y){if(!y.includes("=")&&(o==="mark"||o==="state")){if((0,m.isInteractive)()){const e=await(0,m.askStatus)();({featurePart:A,casePart:L,newStatus:x,rawIdentifier:I}=(0,g.parseSpec)(`${y}=${e}`,{command:"mark"}))}else{({featurePart:A,casePart:L,newStatus:x,rawIdentifier:I}=(0,g.parseSpec)(y,{command:"mark"}))}}else{({featurePart:A,casePart:L,newStatus:x,rawIdentifier:I}=(0,g.parseSpec)(y,{command:"mark"}))}}else{const e=O.attributes?.testcaseCommentIds||{};const t=Object.keys(e);if(t.length===0){d.Diag.error({title:`No testcases found in testrun '${r}'. Run \`testform apply\` first.`,detail:[]}).abort();return}if((0,m.isInteractive)()){const e=t.map((e=>{const t=O.attributes?.testcaseStatuses?.[e]||"pending";const n=$.find((t=>t.identity===e));const s=n?.attributes?.title?` - "${n.attributes.title}"`:"";return{label:`${e}${s} [${t}]`,value:e}}));const n=await(0,m.askSelect)(`Testcases disponibles en '${O.identity}':`,e);const s=await(0,m.askStatus)();const r=n.lastIndexOf(".");const i=r!==-1?n.slice(0,r):n;const o=r!==-1?n.slice(r+1):"";A=i;L=o;x=s;I=n}else{console.log((0,i.bold)(`\nAvailable testcases in '${O.identity}':`));t.forEach(((e,t)=>{const n=O.attributes?.testcaseStatuses?.[e]||"pending";const s=$.find((t=>t.identity===e));const r=s?.attributes?.title?` - "${s.attributes.title}"`:"";console.log(` ${t+1}. ${e}${r} [${n}]`)}));console.log(`\n${(0,i.bold)("Available statuses:")} ${h.TESTCASE_STATUSES.join(", ")}\n`);d.Diag.usage({syntax:`${h.TITLE_CLI} suite ${o} "<identifier>=<status>" -target="${r}"`,detail:[`Please provide the testcase argument.`,`Strategies:`,` 1. Only tag: "@tc-1=passed"`,` 2. File + tag: "checkout.case.feature.@tc-1=passed"`,` 3. Scenario name: "Pago con tarjeta=passed"`]}).abort();return}}const F=O.attributes?.testcaseCommentIds||{};const j=Object.keys(F).filter((e=>{const t=$.find((t=>t.identity===e));return(0,g.matchesStateKey)(e,t?.attributes?.title,{featurePart:A,casePart:L,rawIdentifier:I})}));if(j.length===0){d.Diag.testcaseNotFound({identifier:I,target:r,available:Object.keys(F)}).abort()}if(j.length>1){d.Diag.ambiguousTestcase({identifier:L,target:r,matches:j,command:o,status:x}).abort()}const M=j[0];const N=F[M];const B=O.attributes?.testcaseStatuses?.[M]||"pending";const U=M.lastIndexOf(".");const G=U!==-1?M.slice(0,U):M;const q=U!==-1?M.slice(U+1):"";if(_?.uri){const e=a.GherkinEditor.parseRawDocument(E);const n=(e.feature?.children||[]).filter((e=>e.rule));const i=G.replace(/\.feature$/i,"").replace(/\\/g,"/");const o=n.find((e=>{const t=(e.rule?.name||"").replace(/\.feature$/i,"").replace(/\\/g,"/");return t===i||t.endsWith("/"+i)||i.endsWith("/"+t)||t.endsWith(i)||i.endsWith(t)}));const c=o?.rule?.children?.some((e=>{const t=e.scenario?.name||"";const n=q?q.trim().toLowerCase():"";const s=t.trim().toLowerCase();return s===n||s.replace(/^@/,"")===n.replace(/^@/,"")||s.endsWith(`.${n}`)||s.endsWith(`.${n.replace(/^@/,"")}`)}));if(!c){const e=o?.rule?.location?.line;const n=(0,s.relative)(t,E)||(0,s.basename)(E);d.Diag.implicitRule({file:n,line:e,rule:G,scenario:q,target:r}).abort()}}const W=await(0,f.createCommandContext)({dir:t,verbose:S,lock:false});if(!W)process.exit(1);const H=k.getResources("testcase").find((e=>e.identity===M));const K=H?.attributes?.title||M;const V=n(6928).basename(G||"");const z=q?q.replace("@",""):"";const J=`**Origin:** ${V}\n<table border="1" width="100%">\n <tr>\n <th colspan="3">Feature Name</th>\n </tr>\n <tr>\n <td>${z}</td>\n <td>${K}</td>\n <td>${x}</td>\n </tr>\n <tr>\n <td colspan="3"><br/></td>\n </tr>\n</table>`;await W.adapter.updateIssueComment(N,J);console.log(` -> Updated status comment for ${M} to '${x}'`);if(!O.attributes.testcaseStatuses)O.attributes.testcaseStatuses={};O.attributes.testcaseStatuses[M]=x;await k.save();console.log(`\n ${(0,i.yellow)("~")} resource "${O.type||"testrun"}" "${O.identity}" {`);console.log(` ${(0,i.yellow)("~")} testcaseStatuses {`);console.log(` ${(0,i.yellow)("~")} "${M}": "${B}" -> "${x}"`);console.log(` }`);console.log(` }\n`);if(_?.uri){try{a.GherkinEditor.updateScenarioStatus(E,G,q,x);console.log(` -> Synced status to local file: ${_.uri}`);const e=new l.Config(t);const n=new c.Parser(D,T);const s={identity:e.getIdentity("testrun"),fields:e.getFields("testrun")};const r=n.filter(n.content(),s,"testrun");const i=r?.find((e=>e.uri===_.uri||e.custom?.identity===O.identity));const o=p.resource.evaluate(O.type||"testrun",i||_,{state:k,testDirectory:w});await W.adapter.updateIssue(O.attributes.issueNumber,o);console.log(` -> Synced status to main issue body #${O.attributes.issueNumber}`)}catch(e){console.log(` -> Failed to update local file or issue body: ${e.message}`)}}console.log((0,i.green)((0,i.bold)(`Status successfully updated!`)))}async function runTagsSuite(e){const{dir:t,tagExpression:n,title:o,testDirectory:u,variables:f}=e;const p=u?(0,s.join)(t,u):t;const h=new l.Config(t);let m;try{m=parseTagAddress(n)}catch{d.Diag.error({title:`Invalid tag address format: '${n}'`,detail:[`Expected bracket address format:`,` 1. File specific: "checkout.case.feature.[@smoke]"`,` 2. Workspace-wide: "[@smoke]" or "[@smoke,@critical]"`]}).abort();return}const{filePattern:y,tags:b}=m;const v=new c.Parser(p,f);const w=v.content()||[];const T=w.filter((e=>(0,g.matchesScope)(e,"testcase")));let S=T;if(y){S=S.filter((e=>(0,g.matchesFeatureFile)(e.uri,y)));if(S.length===0){d.Diag.error({title:`No testcase files matched '${y}'.`,detail:[`Available files:`,...Array.from(new Set(T.map((e=>` - ${e.uri}`)))).slice(0,10)]}).abort();return}}const k=S.filter((e=>{const t=[...e.tags||[],...e.feature?.tags||[]].map(String);return t.some((e=>b.includes(e)))}));if(k.length===0){d.Diag.error({title:`No testcase scenarios found matching tag(s) [${b.join(", ")}].`,detail:[y?`Searched within: ${y}`:`Searched across all testcase files in workspace.`,`Total testcases evaluated: ${S.length}`]}).abort();return}const D=new Map;for(const e of k){const t=e.uri;if(!D.has(t)){D.set(t,[])}D.get(t).push(e)}const _=h.getConvention("testrun");const E=h.getScopeConf("testrun");const C=h.getIdentity("testrun");const R=_?.directory||E?.directory||"tests/runs";const P=_?.filename||`{YYYYMMDD}_{HHmmss}.run.feature`;const O=new Date;const A=O.toISOString().split("T")[0].replace(/-/g,"");const L=O.toTimeString().split(" ")[0].replace(/:/g,"");const x=O.getTime().toString();const I=b.map((e=>e.replace("@",""))).join("_").toLowerCase();let $=o||`Suite ${b.join(" ")}`;let F=I;if(y){const e=(0,s.basename)(y).replace(/\.feature$/i,"").replace(/\.case$/i,"");F=`${e}_${I}`}let j=P.replace(/{YYYYMMDD}/g,A).replace(/{HHmmss}/g,L).replace(/{timestamp}/g,x).replace(/{slug}/g,F);j=j.replace(/^[_\-]+/,"").replace(/[_\-]+(\.)/g,"$1");const M=Math.random().toString(16).substring(2,8);if(j.endsWith(".feature")){if(j.endsWith(".run.feature")){j=j.replace(".run.feature",`_${M}.run.feature`)}else{j=j.replace(".feature",`_${M}.feature`)}}else{if(j.endsWith(".run")){j=j.replace(".run",`_${M}.run.feature`)}else{j+=`_${M}.run.feature`}}const N=(0,s.join)(t,R,j);const B=(0,s.dirname)(N);if(!(0,r.existsSync)(B)){(0,r.mkdirSync)(B,{recursive:true})}const U=C?(0,a.findNextIdentity)(t,C):null;let G=`@testrun`;if(U){G+=` ${U}`}G+=`\nFeature: ${$}\n\n`;let q=0;for(const[e,t]of D.entries()){const n=(0,s.basename)(e);G+=` Rule: ${n}\n`;for(const e of t){const t=e.name||"Unnamed Scenario";G+=` Scenario: ${t}\n`;G+=` * mark status = pending\n\n`;q++}}(0,r.writeFileSync)(N,G.trim()+"\n","utf-8");console.log((0,i.green)((0,i.bold)(`\nGenerated testrun suite file: ${N}`)));console.log(` ${(0,i.green)("✓")} Included ${q} scenario(s) matching tag(s) ${b.join(", ")} across ${D.size} file(s).`)}const suiteCmd=async e=>{const{dir:n,subCommand:s,subArgs:r,scope:i,title:o,rules:a,target:c,tags:l,fill:u,link:f,mark:p,testDirectory:y,statePath:b,backupPath:v,variables:w,verbose:T}=e;let S=(s||"").toLowerCase();const k=[...r];if(u){S="fill"}else if(f){S="link";if(k.length===0)k.push(f)}else if(p){S="mark";if(k.length===0)k.push(p)}else if(l){S="tags"}let D=i;let _=o;let E=c;const C=l||(S.includes("[")&&S.endsWith("]")?S:k.length>0&&k[0].includes("[")?k[0]:undefined);if(S==="tags"||C&&(!S||S==="tags"||S==="init"||S==="run")){const e=C||(k.length>0?k[0]:undefined);if(!e){d.Diag.usage({syntax:`${h.TITLE_CLI} suite tags "<address>" [-title=<title>]`,detail:[`Generates a new testrun suite (.run.feature) by extracting scenarios with matching tags.`,``,`Address strategies:`,` 1. File-specific tag: "checkout.case.feature.[@smoke]" (only scenarios with @smoke from this file)`,` 2. Workspace-wide tag: "[@smoke]" (all scenarios with @smoke from any file)`,` 3. Multiple tags: "[@smoke,@critical]" (scenarios matching any of the specified tags)`,``,`Examples:`,` ${h.TITLE_CLI} suite -tags="[@smoke]"`,` ${h.TITLE_CLI} suite -tags="checkout.case.feature.[@smoke]"`,` ${h.TITLE_CLI} suite tags "[@smoke]" -title="Smoke Regression"`]}).abort();return}await runTagsSuite({dir:n,tagExpression:e,title:_,testDirectory:y,variables:w});return}if(!S){if((0,m.isInteractive)()){S=await(0,m.askSelect)("¿Qué operación de suite deseas realizar?",[{label:"init - Crear un nuevo archivo de suite (.run.feature o .plan.feature)",value:"init"},{label:"tags - Generar un testrun a partir de tags con corchetes (ej: [@smoke])",value:"tags"},{label:"fill - Autocompletar reglas vacías de un testrun con sus casos",value:"fill"},{label:"link - Enlazar casos o runs en la suite (escribe Gherkin implícita/explícitamente)",value:"link"},{label:"mark - Registrar estado de ejecución de un testcase y sincronizar",value:"mark"}])}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite [subcommand] [options]`,detail:[`Subcommand:`,` init Create a new suite file (.run.feature or .plan.feature)`,``,`Options:`,` -fill Autocomplete empty testrun rules with their testcases`,` -link="<id>=<status>" Link a testcase or testrun into a suite`,` -mark="<id>=<status>" Record execution status (* mark status = <status>) in a testrun`,` -tags="<address>" Generate a testrun suite from bracketed tag addresses (e.g. "[@smoke]")`,``,`Other Options:`,` -target=<resource> Required for -fill, -link, -mark. Identifies the suite file:`,` • Identity tag: @tr-1, @tp-1 (unique for testrun and testplan)`,` • Canonical address: tests/runs/smoke.run.feature.@tr-1`,` • Scoped file path: smoke.run.feature (scoped to -test-directory)`,` -test-directory=<dir> Optional. Limits the search scope for .case.feature files and shortens target paths.`,` -scope=<testrun|testplan> Optional (global). Scope of the suite to generate.`,` -title=<title> Optional. Human-readable title of the suite.`,` -rule=<rule> Optional. Source .case.feature file(s) to include as Rule blocks.`]}).abort()}}if(S==="init"||S==="new"||S==="feature"||S==="add"){if(!D){if((0,m.isInteractive)()){D=await(0,m.askSelect)("Selecciona el scope para la suite:",[{label:"testrun - Suite de ejecución (.run.feature)",value:"testrun"},{label:"testplan - Suite de planificación (.plan.feature)",value:"testplan"}]);if(!_){_=await(0,m.askInput)("Ingresa el título de la suite")}}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite init -scope=<testrun|testplan> [-title=<title>] [-rule=<rule>] [-tags=<expression>]`,detail:[`Note: 'suite init' applies to testrun or testplan scope.`,``,`Options:`,` -scope=<testrun|testplan> Scope of the suite to generate`,` -title=<title> Human-readable title for the suite feature`,` -rule=<rule> Rule file name(s) to include (repeatable)`,` -tags=<expression> Generate a testrun filtered by tag address (e.g. "[@smoke]" or "file.case.feature.[@smoke]")`]}).abort();return}}if(!D)return;await runAdd({dir:n,scope:D,title:_,rules:a});return}if(S==="fill"){if(!E){if((0,m.isInteractive)()){E=await(0,g.promptTargetSuite)(n,["testrun"],y,w)}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite fill -target=<target>`,detail:[`This command is exclusive to testrun scope.`,`It expands empty Rule blocks using the source .case.feature scenarios.`,``,...t.TARGET_STRATEGIES_DETAIL]}).abort();return}}if(!E)return;await runAutocomplete({dir:n,target:E,testDirectory:y,variables:w});return}if(S==="link"){if(!E&&(0,m.isInteractive)()){E=await(0,g.promptTargetSuite)(n,["testrun","testplan"],y,w)}if(!E){d.Diag.usage({syntax:`${h.TITLE_CLI} suite link "<identifier>=<status>" -target=<target>`,detail:[`Links a testcase or testrun into the target suite file.`,``,...t.IDENTIFIER_STRATEGIES_DETAIL,``,...t.TARGET_STRATEGIES_DETAIL]}).abort();return}await runLink({dir:n,target:E,linkArg:k.length>0?k[0]:undefined,statePath:b,backupPath:v,testDirectory:y,variables:w,verbose:T});return}if(S==="mark"){if(!E){if((0,m.isInteractive)()){E=await(0,g.promptTargetSuite)(n,["testrun"],y,w)}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite mark "<identifier>=<status>" -target=<target>`,detail:[`Updates the execution status (* mark status = <status>) of a testcase in a testrun.`,`Available statuses: ${h.TESTCASE_STATUSES.join(", ")}`,``,...t.IDENTIFIER_STRATEGIES_DETAIL,``,...t.TARGET_STRATEGIES_DETAIL]}).abort();return}}if(!E)return;await runState({dir:n,target:E,subCommand:"mark",tcArg:k.length>0?k[0]:undefined,statePath:b,backupPath:v,testDirectory:y,variables:w,verbose:T});return}d.Diag.unknownSubcommand({command:"suite",subcommand:s||"",available:["init","fill","link","mark","tags"]}).abort()};t.suiteCmd=suiteCmd;t.toolCmd=t.suiteCmd},1510:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.taintCmd=void 0;const s=n(465);const r=n(7066);const i=n(4296);const o=n(2978);const taintCmd=async e=>{const{dir:t=".",action:n,identityRaw:a,statePath:c,backupPath:l,allowMissing:u=false,lock:d=true,lockTimeout:f="0s"}=e;const p=new r.State(t,c,l);await p.init();await p.acquireLock(d,f);try{let e=null;for(const t of["testcase","testrun","testplan"]){const n=a.replace(new RegExp(`^([a-zA-Z0-9_-]+_)?${t}\\.`),"");e=p.getResources(t).find((e=>e.identity===n||(0,o.normalizeAddress)(e.identity)===(0,o.normalizeAddress)(n)||(0,o.normalizeAddress)(e.identity)===(0,o.normalizeAddress)(a)));if(e)break}if(!e){if(u){console.log((0,s.green)(`Resource not found in state, but allow-missing is set. Exiting successfully.`));return}console.error((0,s.red)(`Error: Resource not found in state.`));throw new i.TestformError(`Resource not found in state.`)}if(n==="taint"){if(e.tainted){console.log(`Resource instance ${a} is already tainted`)}else{e.tainted=true;p.upsertResource(e);await p.save();console.log((0,s.green)(`Resource instance ${a} has been marked as tainted.`))}}else{if(!e.tainted){console.log(`Resource instance ${a} is not tainted`)}else{delete e.tainted;p.upsertResource(e);await p.save();console.log((0,s.green)(`Resource instance ${a} has been successfully untainted.`))}}}finally{await p.releaseLock()}};t.taintCmd=taintCmd},4710:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.toolCmd=t.suiteCmd=void 0;var s=n(5822);Object.defineProperty(t,"suiteCmd",{enumerable:true,get:function(){return s.suiteCmd}});Object.defineProperty(t,"toolCmd",{enumerable:true,get:function(){return s.toolCmd}})},10:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateCmd=void 0;const s=n(9896);const r=n(6928);const i=n(4489);const o=n(5392);const a=n(2721);const c=n(1227);const l=n(7442);const u=n(1138);const d=n(6028);const f=n(8169);const validateCmd=async e=>{const{targetPath:t=".",dir:n=".",verbose:p=false,scope:h,target:m,variables:g,isJson:y=false,testDirectory:b,noTests:v=false,query:w}=e;const T=new c.Logger(p);if(!y){T.info("Validating configuration...",{bold:true})}let S=n;let k=n;let D=m;if(t&&t!=="."){try{if((0,s.existsSync)(t)&&(0,s.statSync)(t).isFile()){D=m||t;k=(0,r.dirname)(t);if(!(0,s.existsSync)((0,r.join)(S,d.FILE_CONFIG))&&(0,s.existsSync)((0,r.join)(k,d.FILE_CONFIG))){S=k}}else{k=t;S=t}}catch{k=t}}if(b){k=(0,r.join)(k,b)}const _=new o.Parser(k,g);const E=_.content();if(E.length===0){if(y){console.log(JSON.stringify({valid:false,error_count:1,warning_count:0,diagnostics:[{severity:"error",summary:"Failed to read module directory",detail:`Module directory ${k} does not exist or cannot be read.`}]},null,2))}else{T.error(`Failed to read module directory\n\nModule directory ${k} does not exist or cannot be read.`)}return}const C=new i.Config(S);T.debug(`Configuration loaded: v${C.getConfig().version}`);const R=C.getConfig().provider;const P=C.getProviderType();const O=["github","gitlab","local","custom"];const A=!R||typeof R==="string"&&R.trim()===""||typeof R==="object"&&Object.keys(R).length===0;if(A||!O.includes(P)){const e=A?`a provider to be defined in ${d.FILE_CONFIG}`:`provider "${P}"`;if(y){console.log(JSON.stringify({valid:false,error_count:1,warning_count:0,diagnostics:[{severity:"error",summary:"Missing required provider",detail:`This configuration requires ${e}, but that provider isn't available. Run "testform init" to configure it.`}]},null,2))}else{T.push({type:"error",title:"Missing required provider",detail:[`This configuration requires ${e}, but that provider isn't available. You may be able`,`to install or configure it automatically by running:`,` testform init`],close:true})}return}T.debug(`Found ${E.length} scenarios across feature files`);const L=(0,f.resolveScopes)(h,D);let x=0;const I={};const $=[];for(const e of L){const t=C.getMatch?.(e);let n=E.filter((n=>(0,l.matchesScope)(n,e,t)));if(D){n=n.filter((t=>{const n=t.custom?.identity?`${t.uri}.${t.custom.identity}`:t.uri;return(0,l.matchesTarget)(n,D,e)||(0,l.matchesTarget)(t.uri,D,e)}))}if(n.length===0){continue}const s={identity:C.getIdentity(e),fields:C.getFields(e)};let r=_.filter(n,s,e);if(w){const t=w.toLowerCase();r=r.filter((e=>e.name&&e.name.toLowerCase().includes(t)||e.custom?.identity&&e.custom.identity.toLowerCase().includes(t)||e.tags&&e.tags.some((e=>(typeof e==="string"?e:e.name).toLowerCase().includes(t)))||e.uri&&e.uri.toLowerCase().includes(t)));if(!y){T.info(`--- Query Results for "${w}" (${e}) ---`,{bold:true});if(r.length===0){T.info(`No scenarios matched the query in scope "${e}".`)}else{r.forEach((t=>{T.info(`- [${e}] ${t.custom?.identity||t.name} (File: ${t.uri}:${t.location})`)}))}T.blank()}}if(r.length>0){I[e]=r.length;x+=r.length;$.push(...r)}}if($.length===0){if(!y){if(D){const e=Array.isArray(D)?D.join(", "):D;T.warn(`No scenarios found matching target "${e}".`)}else{T.warn(`No scenarios found across the configuration.`)}}return}if(!y){const e=Object.keys(I);for(const t of e){T.debug(`Found ${I[t]} scenarios matching scope "${t}"`)}}const F=new u.DependencyResolver(S);try{const getCanonicalId=e=>{const t=e.custom?.identity;if(!t)return`${e.uri}.${e.name}`;if(t.startsWith(e.uri)||t===e.uri)return t;return`${e.uri}.${t}`};F.sortTopologically($,getCanonicalId,(e=>e.tags?e.tags.map((e=>typeof e==="string"?e:e.name)):[]))}catch(e){if(y){console.log(JSON.stringify({valid:false,error_count:1,warning_count:0,diagnostics:[{severity:"error",summary:"Circular dependency detected",detail:e.message}]},null,2))}else{T.error(`Circular dependency detected\n\n${e.message}`)}return}if(!v){if(a.policy&&typeof a.policy.loadCustomPolicies==="function"){await a.policy.loadCustomPolicies(S)}const e=C&&typeof C.getPolicies==="function"?C.getPolicies():undefined;if(e&&a.policy&&typeof a.policy.configure==="function"){a.policy.configure(e)}for(const e of Object.keys(I)){const t=$.filter((t=>(0,l.matchesScope)(t,e,C.getMatch?.(e))));const n=a.policy.scanner(t,e,y);if(n){const e=new Error("Please fix them before continuing.");e.name="Policy violations found";throw e}}}else if(!y){T.info(`Skipping policy validation (-no-tests).`)}if(y){console.log(JSON.stringify({valid:true,error_count:0,warning_count:0,diagnostics:[]},null,2))}else{T.success("Success! The configuration is valid.",{bold:true});T.blank();T.info(` Scenarios: ${x}`);if(D){const e=Array.isArray(D)?D.join(", "):D;T.info(` Target: ${e}`)}}};t.validateCmd=validateCmd},2743:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.workspaceCmd=void 0;const s=n(465);const r=n(1227);const i=n(7066);const o=n(6028);const workspaceCmd=async e=>{const{dir:t,verbose:n,args:a}=e;const c=new r.Logger(n);const l=new i.State(t);const u=a[0];const d=a[1];if(!u){c.error(`Usage: ${o.TITLE_CLI} workspace [subcommand] [options] [args]`);process.exit(1)}if(typeof l.init==="function")await l.init();const f=l.getCurrentWorkspace();switch(u){case"show":console.log(f);break;case"list":const e=await l.listWorkspaces();for(const t of e){if(t===f){console.log((0,s.green)(`* ${t}`))}else{console.log(` ${t}`)}}break;case"new":if(!d){c.error("Expected a workspace name");process.exit(1)}const n=await l.listWorkspaces();if(n.includes(d)){c.error(`Workspace "${d}" already exists`);process.exit(1)}l.setCurrentWorkspace(d);const r=new i.State(t);if(typeof r.init==="function")await r.init();if(typeof r.clearResources==="function")r.clearResources();if(typeof r.save==="function")await r.save();console.log((0,s.green)(`Created and switched to workspace "${d}"!`));console.log("");console.log(`You're now on a new, empty workspace. Workspaces isolate their state,`);console.log(`so if you run "${o.TITLE_CLI} plan" ${o.TITLE_CLI} will not see any existing state`);console.log(`for this configuration.`);break;case"select":if(!d){c.error("Expected a workspace name");process.exit(1)}const a=await l.listWorkspaces();if(!a.includes(d)){c.error(`Workspace "${d}" doesn't exist.\n\nYou can create this workspace with the "new" subcommand.`);process.exit(1)}l.setCurrentWorkspace(d);console.log((0,s.green)(`Switched to workspace "${d}".`));break;case"delete":if(!d){c.error("Expected a workspace name");process.exit(1)}if(d==="default"){c.error(`Workspace "default" cannot be deleted.`);process.exit(1)}if(d===f){c.error(`Workspace "${d}" is your active workspace.\n\nYou cannot delete the currently active workspace. Please switch\nto another workspace and try again.`);process.exit(1)}const p=await l.listWorkspaces();if(!p.includes(d)){c.error(`Workspace "${d}" doesn't exist.`);process.exit(1)}const h=await l.deleteWorkspace(d);if(h){console.log((0,s.green)(`Deleted workspace "${d}"!`))}else{c.error(`Failed to delete workspace "${d}".`);process.exit(1)}break;default:c.error(`Invalid workspace subcommand: ${u}`);process.exit(1)}};t.workspaceCmd=workspaceCmd},8169:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ALL_SCOPES=t.VALID_RESOURCES=void 0;t.resolveScopes=resolveScopes;t.normalizeScope=normalizeScope;t.assertApprovalAllowed=assertApprovalAllowed;t.resolveWorkDir=resolveWorkDir;t.resolveVariableParser=resolveVariableParser;t.normalizeCliArgs=normalizeCliArgs;t.compareCliVersions=compareCliVersions;t.withStateLock=withStateLock;const s=n(6928);const r=n(7066);const i=n(7442);const o=n(9922);const a=n(6028);t.VALID_RESOURCES=["testcase","testrun","testplan"];t.ALL_SCOPES=t.VALID_RESOURCES;function resolveScopes(e,n){if(n){const e=Array.isArray(n)?n:[n];const s=e.map((e=>e.trim().toLowerCase())).filter((e=>t.VALID_RESOURCES.includes(e)));if(s.length>0){return s}const r=e.map((e=>(0,i.detectScopeFromTarget)(e))).filter((e=>!!e));if(r.length>0&&r.length===e.length){return Array.from(new Set(r))}}const s=typeof e==="object"&&e!==null?e.scope:e;if(!s||s==="all"){return[...t.ALL_SCOPES]}const r=String(s).trim().toLowerCase();if(t.VALID_RESOURCES.includes(r)){return[r]}return[...t.ALL_SCOPES]}function normalizeScope(e){const t=typeof e==="object"&&e!==null?e.scope:e;const n=t||"all";const s=n==="all"?"testcase":n;return{scope:n,singleScope:s}}function assertApprovalAllowed(e,t){if(!e&&!t){const e=new Error(`${a.ERR_NO_INPUT_ALLOWED}\nUse the -auto-approve flag to bypass approval.`);e.name="No input allowed";console.error(`${e.name}: ${e.message}`);throw e}}function resolveWorkDir(e){const t=String(e.chdir||".");return(0,s.resolve)(process.env.INIT_CWD||process.cwd(),t)}function resolveVariableParser(e,t){const n=e.var?Array.isArray(e.var)?e.var:[e.var]:undefined;const s=e.varFile?Array.isArray(e.varFile)?e.varFile:[e.varFile]:undefined;return new o.VariableParser(n,s,t)}function normalizeCliArgs(e){const t=new Set(["C","s","h","v","a","o"]);return e.map((e=>{const n=e.match(/^-([a-zA-Z][a-zA-Z0-9-]*)(=(.*))?$/);if(!n)return e;const s=n[1];const r=n[2]||"";if(t.has(s)){return e}return`--${s}${r}`}))}function compareCliVersions(e,t){const n=e.split(".").map((e=>Number(e)));const s=t.split(".").map((e=>Number(e)));const r=Math.max(n.length,s.length);for(let e=0;e<r;e++){const t=n.at(e)??0;const r=s.at(e)??0;if(t>r)return 1;if(t<r)return-1}return 0}async function withStateLock(e,t){const{dir:n=".",statePath:s,backupPath:i,lock:o=true,lockTimeout:a="0s"}=e;const c=new r.State(n,s,i);await c.init();await c.acquireLock(o,a);try{return await t(c)}finally{await c.releaseLock()}}},4489:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.Config=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=n(6028);const c=n(1227);const l=n(7862);class Config{dir;requiredConfig;config={};resolvedPath=null;constructor(e,t=true){this.dir=e;this.requiredConfig=t;if(this.requiredConfig){this.required()}else{const e=this.resolve();if(e){this.load(e)}}}resolve(){let e=(0,i.resolve)(this.dir);const t=(0,i.resolve)("/");while(e!==t){for(const t of a.CONFIG_FILE_NAMES){const n=(0,i.resolve)(e,t);if((0,r.existsSync)(n)){this.resolvedPath=n;return n}}const t=(0,i.resolve)(e,"..");if(t===e)break;e=t}for(const e of a.CONFIG_FILE_NAMES){const t=(0,i.resolve)(process.cwd(),e);if((0,r.existsSync)(t)){this.resolvedPath=t;return t}}return null}load(e){const t=(0,r.readFileSync)(e,"utf-8");this.config=o.default.parse(t)||{};const n=(0,i.dirname)(e);for(const e of["resource.yml","resource.yaml"]){const t=(0,i.resolve)(n,e);if((0,r.existsSync)(t)){try{const e=(0,r.readFileSync)(t,"utf-8");const n=o.default.parse(e)||{};const s=n.resource||n;if(s&&typeof s==="object"){const e=this.config.resource||{};const t={...s};for(const[n,s]of Object.entries(e)){if(s&&typeof s==="object"&&t[n]&&typeof t[n]==="object"){t[n]={...t[n],...s}}else{t[n]=s}}this.config.resource=t}}catch{}break}}const s=this.config.resource;if(s&&typeof s==="object"){const e=l.resource.getRegisteredTypes();const t=[...new Set(["testcase","testrun","testplan","global",...e])];for(const e of Object.keys(s)){if(!t.includes(e)){c.logger.push({type:"error",title:`Unknown resource type in configuration: "${e}"`,detail:[`The resource block only allows declaring: ${t.filter((e=>e!=="global")).join(", ")} (and global).`,`Verify your main.yml or resource.yml configuration.`],close:true})}}}return this.config}getResolvedPath(){return this.resolvedPath}getConfig(){return this.config}getProviderType(){const e=this.config.provider;if(!e){return"local"}if(typeof e==="string"){return e.trim().toLowerCase()}const t=["github","gitlab","custom","local"];for(const n of t){if(e[n]!==undefined&&(e[n]===null||typeof e[n]==="object")){return n}}const n=Object.keys(e);if(n.length>0&&(e[n[0]]===null||typeof e[n[0]]==="object")){return n[0].toLowerCase()}return"local"}getAdapterType(){return this.getProviderType()}getProviderConfig(e){const t=e||this.getProviderType();const n=this.config.provider;if(!n||typeof n==="string"){return{}}if(n[t]!==undefined&&typeof n[t]==="object"){return n[t]||{}}return{}}getGitHub(){const e=this.getProviderType();if(e!=="github")return undefined;const t=this.getProviderConfig("github")||{};return{owner:t.owner,repository:t.repository,projectId:t.project_id,tokenEnv:t.token_env||"GITHUB_TOKEN"}}getRequiredVersion(){const e=this.config.testform;if(e){if(typeof e==="string")return e;if(typeof e==="object")return e.required_version||e.version}return this.config.version}getBackend(){const e=this.config.testform;const t=e&&typeof e==="object"&&e.backend!==undefined?e.backend:this.config.backend;if(t===undefined)return undefined;if(t===null||typeof t==="string"&&t.trim()===""){return{type:"",config:{}}}if(typeof t==="string"){return{type:t.trim().toLowerCase(),config:{}}}const n=["local","github","s3","azurerm","gcs","oci","http","rest","custom"];for(const e of n){if(t[e]!==undefined&&typeof t[e]==="object"){return{type:e,config:t[e]||{}}}}const s=Object.keys(t);if(s.length>0&&typeof t[s[0]]==="object"){return{type:s[0].toLowerCase(),config:t[s[0]]||{}}}return undefined}getPolicies(){return this.config.policy}getScopeConf(e){const t=this.config.resource;if(!t)return undefined;return Object.prototype.hasOwnProperty.call(t,e)?t[e]:undefined}getMatch(e){const t=this.getScopeConf(e);if(!t?.match)return undefined;return t.match.trim()}getIdentity(e){const t=e==="testcase"?"tc-*":e==="testrun"?"tr-*":e==="testplan"?"tp-*":"*";const n=this.getScopeConf(e);let s=n?.identity;if(!s&&n?.match&&n.match.includes(".feature.")){const e=n.match.slice(n.match.indexOf(".feature.")+9).trim();if(e&&e!=="*"){s=e}}if(!s||s==="*"){return t}return s}getConvention(e){const t=this.getScopeConf("global");const n=this.getScopeConf(e);const s=t?.scaffold;const r=n?.scaffold;if(!s&&!r)return undefined;const i={...s||{},...r||{}};return i}getReportMapping(e){return this.config.report_mapping?this.config.report_mapping[e]:undefined}getFields(e){const t=this.getScopeConf("global")?.fields;const n=this.normalizeFields(t);const s=this.getScopeConf(e)?.fields;const r=this.normalizeFields(s);const i=new Map;for(const e of n){if(e.name)i.set(e.name.toLowerCase(),e)}for(const e of r){if(e.name)i.set(e.name.toLowerCase(),e)}return Array.from(i.values())}normalizeFields(e){if(!e)return[];if(Array.isArray(e)){return e.map((e=>{if(!e||typeof e!=="object")return null;const t=e.source==="tag"||e.source==="tags"||e.type==="tags"?"tag":"step";const n=e.enum??e.values;return{name:e.name,source:t,enum:n,required:e.required,default:e.default}})).filter(Boolean)}if(typeof e==="object"){const t=[];for(const[n,s]of Object.entries(e)){const e=typeof s==="object"&&s!==null?s:{};const r=e.source==="tag"||e.source==="tags"||e.type==="tags"?"tag":"step";const i=e.enum??e.values;t.push({name:e.name??n,source:r,enum:i,required:e.required,default:e.default})}return t}return[]}required(){const e=this.resolve();if(!e){c.logger.push({type:"error",title:"No configuration files",detail:["Plan requires configuration to be present. Planning without a configuration would mark everything for","destruction, which is normally not what is desired. If you would like to destroy everything, run plan with the",`-destroy option. Otherwise, create a ${a.TITLE_APP} configuration file (${a.FILE_CONFIG}) and try again.`],close:true})}const t=this.load(e);let n=t.version;if(!n&&t.testform){const e=t.testform;n=typeof e==="string"?e:e.required_version||e.version}if(n==null||n===""){c.logger.push({type:"error",title:`Configuration is missing the "version" or "testform" field`,detail:[`Add a "testform" or "version" field to your ${(0,i.basename)(e)} file and rerun init.`],close:true});return}const s=String(n);const r=s===a.VERSION_CONFIG||s==="1.0.0"||s.startsWith(`${a.VERSION_CONFIG}`)||s.includes(`>= ${a.VERSION_CONFIG}`)||s.includes(`>=${a.VERSION_CONFIG}`)||s.startsWith("v1.0")||s.startsWith("1.");if(!r){c.logger.push({type:"error",title:`configuration version mismatch`,detail:[`Found version "${n}", but expected "${a.VERSION_CONFIG}".`,`Update ${(0,i.basename)(e)} to version ${a.VERSION_CONFIG} and rerun init.`],close:true})}}}t.Config=Config},6028:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.MSG_APPROVE_ONLY_YES=t.MSG_ACQUIRING_LOCK=t.ERR_NO_INPUT_ALLOWED=t.ERR_GITHUB_CONFIG_NOT_FOUND=t.TESTCASE_STATUSES=t.SCOPE_CONFIG=t.SCOPE_RESOURCE_MAP=t.FILE_LOCK=t.FILE_DATA=t.FILE_STATE=t.DIR_CACHE=t.FILE_CONFIG=t.CONFIG_FILE_NAMES=t.VERSION_STATE=t.VERSION_CONFIG=t.VERSION_CLI=t.TITLE_CLI=t.TITLE_APP=void 0;const s=n(8330);t.TITLE_APP="Testform";t.TITLE_CLI="testform";t.VERSION_CLI=s.version;t.VERSION_CONFIG="1.0";t.VERSION_STATE="1.0";t.CONFIG_FILE_NAMES=["main.yml","main.yaml","testform.yml","testform.yaml","testform.config.yml","testform.config.yaml"];t.FILE_CONFIG="main.yml";t.DIR_CACHE=".testform/cache";t.FILE_STATE="testform.state";t.FILE_DATA=".testform/cache/data.json";t.FILE_LOCK=".testform/cache/lock.json";t.SCOPE_RESOURCE_MAP={testcase:"github_testcase",testrun:"github_testrun",testplan:"github_testplan",testreport:"github_testreport"};const r={testcase:"@testcase",testrun:"@testrun",testplan:"@testplan",testreport:"@testreport"};const i={testcase:".case.feature",testrun:".run.feature",testplan:".plan.feature",testreport:".report.feature"};t.SCOPE_CONFIG={testcase:{tag:r.testcase,ext:i.testcase,resource:t.SCOPE_RESOURCE_MAP.testcase},testrun:{tag:r.testrun,ext:i.testrun,resource:t.SCOPE_RESOURCE_MAP.testrun},testplan:{tag:r.testplan,ext:i.testplan,resource:t.SCOPE_RESOURCE_MAP.testplan}};t.TESTCASE_STATUSES=["pending","passed","failed","blocked","skipped","undefined"];const o={pending:"⏳",passed:"✅",failed:"❌",blocked:"⚠️",skipped:"⏭️",undefined:"❓"};t.ERR_GITHUB_CONFIG_NOT_FOUND=`GitHub configuration not found. Add a "github" section to your ${t.FILE_CONFIG} with owner, repository, and tokenEnv.`;t.ERR_NO_INPUT_ALLOWED=`This command requires manual approval, but input is disabled. Use the -auto-approve flag to bypass approval.`;t.MSG_ACQUIRING_LOCK="Acquiring state lock. This may take a few moments...";t.MSG_APPROVE_ONLY_YES=`Only 'yes' will be accepted to approve.`},8480:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createCommandContext=createCommandContext;t.withContext=withContext;const s=n(7486);const r=n(5095);const i=n(4489);const o=n(7066);const a=n(1227);const c=n(1227);const l=n(6028);const u=n(4296);async function createCommandContext(e={}){const{dir:t=".",verbose:n=false,statePath:u,backupPath:d,lock:f=true,lockTimeout:p="0s",silent:h=false}=e;const m=new a.Logger(n);const g=new i.Config(t);const y=g.getGitHub();const b=g.getProviderType();let v;if(b==="local"){v=new s.LocalProvider(t)}else if(b==="github"){if(!y){if(!h){c.logger.push({type:"error",title:"GitHub configuration not found",detail:[l.ERR_GITHUB_CONFIG_NOT_FOUND],close:true})}return null}v=new s.GitHubProvider(y)}else{v=await(0,r.createProvider)(g,t)}const w=new o.State(t,u,d);await w.init();await w.acquireLock(f,p);return{state:w,adapter:v,github:v,config:g,logger:m}}function withContext(e){return async(t,...n)=>{const s=await createCommandContext(t);if(!s){throw new u.TestformError("Failed to initialize command context")}try{await e(s,t,...n)}catch(e){s.logger.error(e.message,e);throw e}finally{await s.state.releaseLock()}}}},2633:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Credentials=void 0;const s=n(9896);const r=n(6928);const i=n(857);class Credentials{credsPath;constructor(){const e=(0,i.homedir)();const t=(0,r.join)(e,".testform.d");if(!(0,s.existsSync)(t)){(0,s.mkdirSync)(t,{recursive:true})}this.credsPath=(0,r.join)(t,"credentials.json")}load(){if(!(0,s.existsSync)(this.credsPath)){return{credentials:{}}}try{const e=(0,s.readFileSync)(this.credsPath,"utf8");return JSON.parse(e)}catch{return{credentials:{}}}}save(e){(0,s.writeFileSync)(this.credsPath,JSON.stringify(e,null,2),"utf8")}getToken(e="github.com"){const t=this.load();return t.credentials?.[e]?.token}getAuth(e="github.com"){const t=this.load();return t.credentials?.[e]}setToken(e="github.com",t){this.setAuth(e,{token:t})}setAuth(e="github.com",t){const n=this.load();if(!n.credentials)n.credentials={};n.credentials[e]=t;this.save(n)}removeToken(e="github.com"){const t=this.load();if(t.credentials?.[e]){delete t.credentials[e];this.save(t);return true}return false}}t.Credentials=Credentials},455:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.DataResolver=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=n(2978);const c=n(6028);class DataResolver{declaredData={};fileCache=new Map;httpCache=new Map;workDir;constructor(e="."){this.workDir=e;this.loadDeclarations()}loadDeclarations(){const e={};for(const t of c.CONFIG_FILE_NAMES){const n=(0,i.resolve)(this.workDir,t);if((0,r.existsSync)(n)){try{const t=o.default.parse((0,r.readFileSync)(n,"utf-8"));if(t&&typeof t.data==="object"){this.registerDataBlock(t.data,e)}}catch{}}}for(const t of["data.yml","data.yaml"]){const n=(0,i.resolve)(this.workDir,t);if((0,r.existsSync)(n)){try{const t=o.default.parse((0,r.readFileSync)(n,"utf-8"));if(t&&typeof t==="object"){const n=t.data&&typeof t.data==="object"?t.data:t;this.registerDataBlock(n,e)}}catch{}}}const t=this.findDomainConfigFiles(this.workDir);for(const n of t){try{const t=o.default.parse((0,r.readFileSync)(n,"utf-8"));if(t&&typeof t==="object"&&t.data&&typeof t.data==="object"){this.registerDataBlock(t.data,e)}}catch{}}this.declaredData=e}registerDataBlock(e,t){const n=new Set(["testcase","testrun","testplan","local_file","http"]);for(const[s,r]of Object.entries(e)){if(r===undefined||r===null)continue;if(n.has(s)&&typeof r==="object"&&!Array.isArray(r)){for(const[e,n]of Object.entries(r)){if(typeof n==="string"){let r;if(s==="local_file"){r={type:"local_file",file:n}}else if(s==="http"){r={type:"http",url:n,method:"GET"}}else{r={type:s,address:n}}t[`${s}.${e}`]=r;t[e]=r}else if(n&&typeof n==="object"){const r={type:s,...n};t[`${s}.${e}`]=r;t[e]=r}}continue}if(typeof r==="string"){const e=r.toLowerCase().trim();const n=e.startsWith("http://")||e.startsWith("https://");const i=e.endsWith(".json")||e.endsWith(".yaml")||e.endsWith(".yml")||e.endsWith(".csv");if(n){const e={type:"http",url:r,method:"GET"};t[s]=e;t[`http.${s}`]=e;continue}const o=i?{type:"local_file",file:r}:{address:r};t[s]=o;if(i){t[`local_file.${s}`]=o}else if(e.includes(".case.")||e.includes("@tc")){t[`testcase.${s}`]=o}else if(e.includes(".run.")||e.includes("@tr")){t[`testrun.${s}`]=o}else if(e.includes(".plan.")||e.includes("@tp")){t[`testplan.${s}`]=o}continue}if(typeof r==="object"){t[s]=r}}}findDomainConfigFiles(e){const t=[];if(!(0,r.existsSync)(e))return t;const n=new Set(["node_modules",".git",".testform",".terraform","dist","coverage",".system_generated"]);const s=new Set([...c.CONFIG_FILE_NAMES,"variables.yml","variables.yaml","vars.yml","vars.yaml","locals.yml","locals.yaml","local.yml","local.yaml","outputs.yml","outputs.yaml","data.yml","data.yaml"]);const scan=e=>{try{const o=(0,r.readdirSync)(e,{withFileTypes:true});for(const r of o){if(r.isDirectory()){if(!n.has(r.name)&&!r.name.startsWith(".")){scan((0,i.resolve)(e,r.name))}}else if(r.isFile()){const n=r.name.toLowerCase();if((n.endsWith(".yml")||n.endsWith(".yaml"))&&!s.has(n)){t.push((0,i.resolve)(e,r.name))}}}}catch{}};scan(e);return t.sort()}getDeclarations(){return this.declaredData}resolveSource(e,t){const n=this.declaredData[e];if(!n)return undefined;if(n.file){const e=(0,i.resolve)(this.workDir,n.file);if(this.fileCache.has(e)){return this.fileCache.get(e)}if((0,r.existsSync)(e)){try{const t=(0,r.readFileSync)(e,"utf-8");const n=e.endsWith(".json")?JSON.parse(t):o.default.parse(t);this.fileCache.set(e,n);return n}catch{return undefined}}return undefined}if(n.type==="http"||n.url||e.startsWith("http.")){return this.resolveHttp(n)}if(n.address){return this.resolveAddress(n.address,t)}if(n.filter&&t){return this.resolveFilter(n.filter,t)}return n}resolveHttp(e){const t=e.url||e.address||"";if(!t)return undefined;const s=(e.method||(e.body||e.request_body?"POST":"GET")).toUpperCase();const r={...e.headers||e.request_headers||{}};let i=e.body||e.request_body;if(i&&typeof i==="object"){i=JSON.stringify(i);if(!Object.keys(r).some((e=>e.toLowerCase()==="content-type"))){r["Content-Type"]="application/json"}}const o=`${s}:${t}:${i||""}`;if(this.httpCache.has(o)){return this.httpCache.get(o)}try{const{execFileSync:a}=n(5317);const c=`\n const input = JSON.parse(process.argv[1]);\n const opts = {\n method: input.method,\n headers: input.headers || {}\n };\n if (input.body) opts.body = input.body;\n\n fetch(input.url, opts)\n .then(async res => {\n const text = await res.text();\n const headersObj = {};\n res.headers.forEach((v, k) => { headersObj[k] = v; });\n process.stdout.write(JSON.stringify({\n status_code: res.status,\n response_headers: headersObj,\n response_body: text\n }));\n })\n .catch(err => {\n process.stdout.write(JSON.stringify({\n error: err.message,\n status_code: 0,\n response_headers: {},\n response_body: ''\n }));\n });\n `;const l=JSON.stringify({url:t,method:s,headers:r,body:i});const u=a(process.execPath,["-e",c,l],{encoding:"utf-8",timeout:e.timeout||1e4,stdio:["ignore","pipe","ignore"]});const d=JSON.parse(u.trim());let f=null;if(d.response_body){try{f=JSON.parse(d.response_body)}catch{f=null}}const p={id:t,url:t,method:s,status_code:d.status_code,response_headers:d.response_headers||{},response_body:d.response_body,body:f!==null?f:d.response_body,data:f!==null?f:d.response_body,...typeof f==="object"&&f!==null&&!Array.isArray(f)?f:{}};this.httpCache.set(o,p);return p}catch{return{id:t,url:t,method:s,status_code:0,response_headers:{},response_body:"",body:null}}}resolveAddress(e,t){const n=(0,a.normalizeAddress)(e);const s=n.indexOf(".feature");let o="";let c=n;if(s!==-1){c=n.substring(0,s+8);const e=n.substring(s+8);const t=e.match(/@([a-zA-Z0-9_-]+)/);o=t?`@${t[1]}`:e?`@${e.replace(/^\./,"")}`:""}else{const e=n.match(/@([a-zA-Z0-9_-]+)$/);o=e?`@${e[1]}`:"";c=n.replace(/\.@[a-zA-Z0-9_-]+$/,"")}const l=o?o.replace(/^@/,""):"";if(t){const s=t.getResources();const r=s.filter((t=>{if((0,a.addressesMatch)(t.identity,e)||(0,a.addressesMatch)(`${t.type}.${t.identity}`,e)||(0,a.addressesMatch)(t.identity,e.replace(/^(github_|local_)?(testcase|testrun|testplan)\./,""))){return true}if(l){const e=t.attributes&&t.attributes.labels||[];const s=e.includes(l)||e.includes(`@${l}`);const r=t.identity.endsWith(`.@${l}`)||t.identity.includes(`.@${l}.`)||t.identity.includes(`@${l}`);if(s||r){if(c&&c!==n&&!t.identity.includes(c)){return false}return true}}if(!l&&c&&t.identity.includes(c)){return true}return false}));if(r.length>1){return r.map((e=>this.formatResourceAttrs(e)))}else if(r.length===1){return this.formatResourceAttrs(r[0])}}const u=(0,i.resolve)(this.workDir,c);if((0,r.existsSync)(u)){try{const e=(0,r.readFileSync)(u,"utf-8");const t=this.extractScenariosFromFile(e,c);let n=t;if(l){const s=e.split(/Scenario:|Scenario Outline:/i)[0];const r=s.includes(`@${l}`);if(!r){n=t.filter((e=>e.labels.includes(l)||e.labels.includes(`@${l}`)||e.tag===`@${l}`))}}if(n.length>1){return n}else if(n.length===1){return n[0]}}catch{}}return{id:"",remoteId:"",issueNumber:0,number:0,identity:n,address:n,tag:o,uri:c,title:"",labels:o?[l]:[],status:"",custom_fields:{}}}extractScenariosFromFile(e,t){const n=e.split("\n");const s=[];let r=[];let i=[];let o=true;for(let e=0;e<n.length;e++){const a=n[e].trim();if(!a||a.startsWith("#"))continue;if(a.startsWith("@")){const e=a.split(/\s+/).filter((e=>e.startsWith("@")));if(o){i.push(...e)}else{r.push(...e)}continue}if(a.startsWith("Feature:")){o=false;continue}const c=a.startsWith("Scenario:")||a.startsWith("Scenario Outline:");if(c){const e=a.replace(/^(Scenario:|Scenario Outline:)/i,"").trim();const n=[...new Set([...i,...r])];const o=n.find((e=>e.match(/^@(tc|tr|tp)-/i)))||n[0]||"";const c=n.map((e=>e.replace(/^@/,"")));const l=`${t}.${o||`@scenario-${s.length+1}`}`;s.push({id:"",remoteId:"",issueNumber:0,number:0,identity:l,address:l,tag:o,uri:t,title:e,labels:c,status:"",custom_fields:{}});r=[]}}return s}formatResourceAttrs(e){const t=e.attributes||{};const n=e.identity.indexOf(".feature");let s="";let r=e.identity;if(n!==-1){r=e.identity.substring(0,n+8);const t=e.identity.substring(n+8);const i=t.match(/@([a-zA-Z0-9_-]+)/);s=i?`@${i[1]}`:t?`@${t.replace(/^\./,"")}`:""}else{const t=e.identity.match(/@([a-zA-Z0-9_-]+)$/);s=t?`@${t[1]}`:"";r=e.identity.replace(/\.@[a-zA-Z0-9_-]+$/,"")}return{...t,id:t.remoteId||t.id||"",remoteId:t.remoteId||t.id||"",issueNumber:t.issueNumber!==undefined?t.issueNumber:0,number:t.issueNumber!==undefined?t.issueNumber:0,identity:e.identity,address:e.identity,tag:s,uri:r,title:t.title||"",labels:t.labels||[],status:t.status||"",custom_fields:t.custom_fields||{}}}resolveFilter(e,t){const n=t.getResources();return n.filter((t=>{const n=t.attributes||{};if(e.tags&&Array.isArray(e.tags)){const t=n.labels||[];const s=e.tags.every((e=>{const n=e.startsWith("@")?e.substring(1):e;return t.includes(n)||t.includes(e)}));if(!s)return false}for(const[t,s]of Object.entries(e)){if(t==="tags")continue;if(n[t]!==s&&n.custom_fields?.[t]!==s){return false}}return true}))}resolvePath(e,t){const n=e.replace(/\[\*\]/g,".*").replace(/\[(\d+)\]/g,".$1").replace(/\[['"]([^'"]+)['"]\]/g,".$1");const s=n.split(".");for(let e=s.length;e>=1;e--){const n=s.slice(0,e).join(".");if(this.declaredData[n]){const r=this.resolveSource(n,t);const i=s.slice(e);if(i.length===0){return r}let o=r;for(let e=0;e<i.length;e++){const t=i[e];if(o===undefined||o===null)break;if(t==="*"&&Array.isArray(o)){const t=i.slice(e+1);if(t.length===0){return o}return o.map((e=>{let n=e;for(const e of t){if(n===undefined||n===null)break;n=n[e]}return n}))}o=o[t]}return o}}return undefined}}t.DataResolver=DataResolver},1138:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.DependencyResolver=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=n(2978);const c=n(6028);class DependencyResolver{declaredDependencies=new Map;workDir;constructor(e="."){this.workDir=e;this.loadDeclarations()}loadDeclarations(){const e=c.CONFIG_FILE_NAMES;for(const t of e){const e=(0,i.resolve)(this.workDir,t);if((0,r.existsSync)(e)){try{const t=o.default.parse((0,r.readFileSync)(e,"utf-8"));if(t){this.registerConfigBlock(t)}}catch{}}}const t=(0,a.findDomainConfigFiles)(this.workDir);for(const e of t){try{const t=o.default.parse((0,r.readFileSync)(e,"utf-8"));if(t){this.registerConfigBlock(t)}}catch{}}}registerConfigBlock(e){if(!e||typeof e!=="object")return;const t=e.dependencies||e.depends_on;if(t&&typeof t==="object"){for(const[e,n]of Object.entries(t)){const t=(0,a.normalizeAddress)(e);let s=[];if(Array.isArray(n)){s=n.map((e=>(0,a.normalizeAddress)(String(e))))}else if(n&&typeof n==="object"&&Array.isArray(n.depends_on)){s=n.depends_on.map((e=>(0,a.normalizeAddress)(String(e))))}if(s.length>0){const e=this.declaredDependencies.get(t)||[];this.declaredDependencies.set(t,Array.from(new Set([...e,...s])))}}}if(e.resources&&typeof e.resources==="object"){for(const[t,n]of Object.entries(e.resources)){if(n&&typeof n==="object"&&Array.isArray(n.depends_on)){const e=(0,a.normalizeAddress)(t);const s=n.depends_on.map((e=>(0,a.normalizeAddress)(String(e))));const r=this.declaredDependencies.get(e)||[];this.declaredDependencies.set(e,Array.from(new Set([...r,...s])))}}}}getDependencies(e,t=[]){const n=(0,a.normalizeAddress)(e);const s=[];for(const[e,t]of this.declaredDependencies.entries()){if((0,a.addressesMatch)(n,e)){s.push(...t)}}const r=(0,a.reassembleSplitTags)(t,"@depends_on(");for(const e of r){const t=e.startsWith("@")?e.substring(1):e;const n=t.match(/^depends_on\((.*)\)$/);if(n){let e=n[1].trim();if(e.startsWith("[")&&e.endsWith("]")){e=e.slice(1,-1).trim()}const t=e.split(",").map((e=>(0,a.normalizeAddress)(e.trim().replace(/^['"]|['"]$/g,"")))).filter(Boolean);s.push(...t)}}return Array.from(new Set(s))}sortTopologically(e,t,n){const s=new Map;const r=new Map;const i=new Map;for(const n of e){const e=t(n);const o=(0,a.normalizeAddress)(e);s.set(o,n);r.set(o,[]);i.set(o,0)}for(const o of e){const e=t(o);const c=(0,a.normalizeAddress)(e);const l=n?n(o):[];const u=this.getDependencies(c,l);for(const e of u){let t=null;for(const n of s.keys()){if((0,a.addressesMatch)(n,e)||n.endsWith(`.${e}`)||n.endsWith(`/${e}`)||e.endsWith(`.${n}`)||e.endsWith(`/${n}`)){t=n;break}}if(t){r.get(t).push(c);i.set(c,(i.get(c)||0)+1)}}}for(const n of e){const s=t(n);const o=(0,a.normalizeAddress)(s);const c=o.includes("testrun")||o.includes(".run.");const l=o.includes("testplan")||o.includes(".plan.");if(c){for(const n of e){const e=(0,a.normalizeAddress)(t(n));const s=!e.includes("testrun")&&!e.includes(".run.")&&!e.includes("testplan")&&!e.includes(".plan.");if(s){r.get(e).push(o);i.set(o,(i.get(o)||0)+1)}}}else if(l){for(const n of e){const e=(0,a.normalizeAddress)(t(n));const s=e.includes("testrun")||e.includes(".run.");if(s){r.get(e).push(o);i.set(o,(i.get(o)||0)+1)}}}}const o=[];for(const[e,t]of i.entries()){if(t===0){o.push(e)}}const c=[];while(o.length>0){const e=o.shift();c.push(s.get(e));for(const t of r.get(e)||[]){const e=i.get(t)-1;i.set(t,e);if(e===0){o.push(t)}}}if(c.length<e.length){const e=Array.from(i.entries()).filter((([e,t])=>t>0)).map((([e])=>e));throw new Error(`Cycle: ${e.join(", ")}`)}return c}}t.DependencyResolver=DependencyResolver},2940:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Diag=void 0;const s=n(6028);const r=n(5718);class Diag{static error(e){return new r.Diagnostic({...e,type:"error"})}static warning(e){return new r.Diagnostic({...e,type:"warning"})}static implicitRule(e){return new r.Diagnostic({type:"error",title:"Cannot mark status on implicit rule",location:{file:e.file,line:e.line,scope:`rule "${e.rule}"`,snippet:e.line?`Rule: ${e.rule}`:undefined},detail:[`Scenario "${e.scenario}" belongs to the implicit Rule "${e.rule}".`,`Testform requires explicit Scenario blocks in order to track and record execution outcomes.`],help:[`To expand this rule into explicit scenarios with initial pending status, run:`,` ${s.TITLE_CLI} suite fill -target="${e.target}"`]})}static targetNotFound(e){return new r.Diagnostic({type:"error",title:`No ${e.scopeKey} matched target '${e.target}'.`,detail:[e.suggestion||`Run \`${s.TITLE_CLI} state list\` to list available resources.`]})}static ambiguousTarget(e){const t=Array.from(new Set(e.matches.map((e=>e.startsWith(" -")?e:` - ${e}`))));return new r.Diagnostic({type:"error",title:`Multiple ${e.scopeKey} files matched '${e.target}'. Please specify a full path or identity tag.`,detail:t})}static testcaseNotFound(e){const t=e.available&&e.available.length>0?[`Available testcases in this run (up to 10):`,...e.available.slice(0,10).map((e=>e.startsWith(" -")?e:` - ${e}`)),``]:[];return new r.Diagnostic({type:"error",title:`Testcase '${e.identifier}' not found in testrun '${e.target}'.`,detail:[...t,`Accepted identity strategies:`,` 1. Only tag: "@tc-1=passed"`,` 2. File + tag: "checkout.case.feature.@tc-1=passed"`,` 3. Scenario name: "Pago con tarjeta=passed"`]})}static ambiguousTestcase(e){const t=e.command||"mark";const n=e.status||"passed";const i=e.matches.map((e=>e.startsWith(" -")?e:` - ${e}`));return new r.Diagnostic({type:"error",title:`Multiple testcases matched '${e.identifier}' in testrun '${e.target}'.`,detail:[`Matches:`,...i,``,`Please specify the feature file to disambiguate:`,` e.g. ${s.TITLE_CLI} suite ${t} "<file>.${e.identifier}=${n}" -target="${e.target}"`]})}static usage(e){return new r.Diagnostic({type:"error",title:`Usage: ${e.syntax}`,detail:e.detail,help:e.help})}static unknownSubcommand(e){return new r.Diagnostic({type:"error",title:`Unknown ${e.command} subcommand: '${e.subcommand}'`,detail:e.available.length>0?[`Available subcommands: ${e.available.join(", ")}`]:[]})}static structureError(e){return new r.Diagnostic({type:"error",title:e.message,location:e.location||{file:e.file},detail:e.detail||[]})}}t.Diag=Diag},5718:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Diagnostic=void 0;const s=n(1227);class Diagnostic{type;title;location;detail;help;extra;close;constructor(e){this.type=e.type||"error";this.title=e.title;this.location=e.location;this.close=e.close??false;const t=[];if(e.location){const n=e.location;const s=n.file;const r=n.line!==undefined?` line ${n.line}`:"";const i=n.scope?`, in ${n.scope}`:"";t.push(`on ${s}${r}${i}:`);if(n.snippet!==undefined){const e=n.line!==undefined?String(n.line).padStart(4," "):" ";t.push(`${e}: ${n.snippet}`)}t.push("")}if(e.detail){const n=Array.isArray(e.detail)?e.detail:e.detail.split("\n");t.push(...n)}if(e.help){const n=Array.isArray(e.help)?e.help:e.help.split("\n");if(t.length>0&&t[t.length-1]!==""){t.push("")}t.push(...n)}this.detail=t;this.extra=e.extra}toNotify(){return{type:this.type,title:this.title,detail:this.detail,extra:this.extra,close:this.close}}emit(){s.logger.push(this.toNotify())}abort(){this.emit();process.exit(1)}}t.Diagnostic=Diagnostic},3912:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(2846),t);r(n(5718),t);r(n(2940),t)},2846:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},8081:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ALLOWED_DRIVERS=void 0;t.loadDriver=loadDriver;t.isDriverAvailable=isDriverAvailable;t.clearDriverCache=clearDriverCache;t.ensureDriverInstalled=ensureDriverInstalled;const s=n(5317);const r=n(6928);const i=n(9896);t.ALLOWED_DRIVERS={"@aws-sdk/client-s3":"Amazon S3 / OCI Storage Driver","@aws-sdk/client-dynamodb":"DynamoDB Distributed Lock Driver","@azure/storage-blob":"Azure Blob Storage Driver","@google-cloud/storage":"Google Cloud Storage Driver",docx:"Word Document Report Generator",exceljs:"Excel Spreadsheet Report Generator"};const o=new Map;let a=null;function resolveGlobalNpmRoot(){if(a!==null){return a}try{const e=(0,s.execSync)("npm root -g",{encoding:"utf-8",stdio:["pipe","pipe","ignore"],timeout:2e3}).trim();a=e||null}catch{a=null}return a}function loadDriver(e){if(!t.ALLOWED_DRIVERS[e]){throw new Error(`[Testform Driver Error] "${e}" is not a recognized cloud driver.\n`+`Allowed drivers are: ${Object.keys(t.ALLOWED_DRIVERS).join(", ")}`)}if(o.has(e)){return o.get(e)}try{const t=require(e);o.set(e,t);return t}catch(e){if(e.code!=="MODULE_NOT_FOUND"){throw e}}const n=[];if(process.platform==="win32"){if(process.env.APPDATA){n.push((0,r.join)(process.env.APPDATA,"npm","node_modules"))}if(process.env.LOCALAPPDATA){n.push((0,r.join)(process.env.LOCALAPPDATA,"npm","node_modules"))}}else{n.push("/usr/local/lib/node_modules");n.push("/usr/lib/node_modules")}n.push((0,r.join)(process.execPath,"..","node_modules"));n.push((0,r.join)(process.execPath,"..","..","lib","node_modules"));for(const t of n){const n=(0,r.join)(t,e);if((0,i.existsSync)(n)){try{const t=require(n);o.set(e,t);return t}catch{}}}const s=resolveGlobalNpmRoot();if(s){const t=(0,r.join)(s,e);if((0,i.existsSync)(t)){try{const n=require(t);o.set(e,n);return n}catch{}}}throw new Error(`[Testform Driver Error] The package "${e}" is required for this backend.\n`+`Please install it globally:\n\n`+` npm install -g ${e}\n\n`+`or add it to your local project:\n\n`+` npm install --save-dev ${e}\n`)}function isDriverAvailable(e){try{loadDriver(e);return true}catch{return false}}function clearDriverCache(){o.clear();a=null}function ensureDriverInstalled(e,n){if(isDriverAvailable(e)){return true}if(!t.ALLOWED_DRIVERS[e]){throw new Error(`[Testform Driver Error] "${e}" is not a recognized cloud driver.`)}try{n?.info(`- Installing driver ${e}...`);(0,s.execSync)(`npm install -g ${e}`,{stdio:["pipe","pipe","pipe"],timeout:12e4});clearDriverCache();if(isDriverAvailable(e)){n?.success(`- Installed driver ${e}`);return true}}catch(t){try{(0,s.execSync)(`npm install --save-dev ${e}`,{stdio:["pipe","pipe","pipe"],timeout:12e4});clearDriverCache();if(isDriverAvailable(e)){n?.success(`- Installed driver ${e}`);return true}}catch{}n?.warn(`Could not automatically install ${e}: ${t.message}`)}return false}},9606:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.parseRawDocument=t.updateFeatureScenario=t.formatGherkin=t.findNextIdentity=t.findFeatureFiles=t.GherkinEditor=void 0;const s=n(9896);const r=n(6928);const i=n(119);const o=n(8569);const a=n(4367);const c=n(5829);class GherkinEditor{static findFeatureFiles(e,t=true){try{const n=(0,s.statSync)(e);if(n.isFile()&&e.endsWith(".feature")){return[e]}if(n.isDirectory()){if(e.includes("node_modules")||e.includes(".git"))return[];const n=(0,s.readdirSync)(e,{withFileTypes:true});const i=[];for(const s of n){if(s.name.startsWith(".")||s.name==="node_modules")continue;const n=(0,r.join)(e,s.name);if(s.isDirectory()){if(t){i.push(...this.findFeatureFiles(n,t))}}else if(s.name.endsWith(".feature")){i.push(n)}}return i}return[]}catch(e){return[]}}static findNextIdentity(e,t){if(!t.includes("*"))return null;const n=t.split("*")[0].replace(/^@/,"");const r=t.split("*")[1]||"";const i=new RegExp(`@${n}(\\d+)${r}\\b`,"g");let o=0;const a=this.findFeatureFiles(e,true);for(const e of a){const t=(0,s.readFileSync)(e,"utf-8");let n;while((n=i.exec(t))!==null){const e=parseInt(n[1],10);if(e>o)o=e}}return`@${n}${o+1}${r}`}static formatGherkin(e){const t=e.split("\n");const n=[];let s=0;let r=false;let i=0;for(let e=0;e<t.length;e++){let o=t[e];if(o.trim().startsWith('"""')||o.trim().startsWith("```")){if(!r){r=true;i=6;n.push(" ".repeat(i)+o.trim())}else{r=false;n.push(" ".repeat(i)+o.trim())}continue}if(r){n.push(o);continue}let a=o.trim();if(a===""){if(n.length>0&&n[n.length-1]!==""){n.push("")}continue}if(a.startsWith("Feature:")){s=0}else if(a.startsWith("Rule:")||a.startsWith("Background:")||a.startsWith("Scenario:")||a.startsWith("Scenario Outline:")||a.startsWith("Example:")){s=2;if(n.length>0&&n[n.length-1]!==""&&!n[n.length-1].trim().startsWith("@")){n.push("")}}else if(a.startsWith("Given ")||a.startsWith("When ")||a.startsWith("Then ")||a.startsWith("And ")||a.startsWith("But ")||a.startsWith("* ")){s=4}else if(a.startsWith("Examples:")){s=4;if(n.length>0&&n[n.length-1]!==""){n.push("")}}else if(a.startsWith("|")){s=6}else if(a.startsWith("@")){let r=0;for(let n=e+1;n<t.length;n++){let e=t[n].trim();if(e===""||e.startsWith("@"))continue;if(e.startsWith("Feature:"))r=0;else if(e.startsWith("Rule:")||e.startsWith("Background:")||e.startsWith("Scenario:")||e.startsWith("Scenario Outline:"))r=2;else if(e.startsWith("Examples:"))r=4;break}s=r;if(n.length>0&&n[n.length-1]!==""){n.push("")}}else if(a.startsWith("#")){}else{if(s===0)s=2}n.push(" ".repeat(s)+a)}if(n.length>0&&n[n.length-1]!==""){n.push("")}return n.join("\n")}static updateScenarioTitleAndTags(e,t,n,r){if(!(0,s.existsSync)(e))return false;let i=(0,s.readFileSync)(e,"utf8");if(t&&n&&t!==n){const e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const s=new RegExp(`(Scenario(?: Outline)?:\\s*)${e}`,"g");if(s.test(i)){i=i.replace(s,`$1${n}`)}}if(r&&r.length>0){const e=n||t;const s=i.indexOf(`Scenario: ${e}`);if(s!==-1){const e=i.slice(0,s);const t=e.split("\n");const n=t[t.length-2]?.trim();const o=r.map((e=>e.startsWith("@")?e:`@${e}`)).join(" ");if(n&&n.startsWith("@")){t[t.length-2]=` ${o}`;i=t.join("\n")+i.slice(s)}else{i=i.slice(0,s)+` ${o}\n`+i.slice(s)}}}(0,s.writeFileSync)(e,i,"utf8");return true}static parseRawDocument(e){const t=(0,s.existsSync)(e)?(0,s.readFileSync)(e,"utf-8"):e;const n=new i.AstBuilder(o.IdGenerator.uuid());const r=new i.Parser(n,new i.GherkinClassicTokenMatcher);const a=r.parse(t);if((0,s.existsSync)(e)){a.uri=e}return a}static parseDocument(e){const t=(0,s.readFileSync)(e,"utf-8");const n=new i.AstBuilder(o.IdGenerator.uuid());const r=new i.Parser(n,new i.GherkinClassicTokenMatcher);const c=r.parse(t);c.uri=e;return a.Document.parse({gherkinDocument:c})}static saveDocument(e,t){const n=(0,c.format)(t);(0,s.writeFileSync)(e,n,"utf-8")}static findRule(e,t){const n=t.replace(/\.feature$/i,"").replace(/\\/g,"/");return e.elements.find((e=>{if(e instanceof a.Rule){const t=e.name.replace(/\.feature$/i,"").replace(/\\/g,"/");return n.endsWith(t)||n.includes(t)||t.endsWith(n)||t.includes(n)}return false}))}static updateScenarioStatus(e,t,n,s){const r=this.parseDocument(e);if(!r.feature){throw new Error(`File ${e} has no feature definition.`)}const i=this.findRule(r.feature,t);if(!i){throw new Error(`Could not find Rule '${t}' in ${e}`)}let o;for(const e of i.elements){if(e instanceof a.Scenario){if(e.name===n||e.name.replace(/^@/,"")===n.replace(/^@/,"")||e.name.endsWith(`.${n}`)||e.name.endsWith(`.${n.replace(/^@/,"")}`)){o=e;break}}}if(!o){throw new Error(`Scenario '${n}' is not expanded in Rule '${t}'. Run 'testform suite fill' first to expand the rule's scenarios before marking status.`)}let c=o.steps.find((e=>e.keyword.trim()==="*"&&e.text.startsWith("mark status =")));if(c){c.text=`mark status = ${s}`}else{const e=new a.Step("*",`mark status = ${s}`);o.steps.unshift(e)}this.saveDocument(e,r)}static linkRuleOrScenario(e,t,n,s="pending"){const r=this.parseDocument(e);if(!r.feature){throw new Error(`File ${e} has no feature definition.`)}let i=this.findRule(r.feature,t);let o=false;let c=false;let l=false;if(!i){i=new a.Rule("Rule",t,"");r.feature.elements.push(i);o=true}if(n){let e;for(const t of i.elements){if(t instanceof a.Scenario){if(t.name===n||t.name.replace(/^@/,"")===n.replace(/^@/,"")){e=t;break}}}if(e){let t=e.steps.find((e=>e.keyword.trim()==="*"&&e.text.startsWith("mark status =")));if(t){t.text=`mark status = ${s}`}else{e.steps.unshift(new a.Step("*",`mark status = ${s}`))}l=true}else{const e=new a.Scenario("Scenario",n,"");e.steps.push(new a.Step("*",`mark status = ${s}`));i.elements.push(e);c=true}}this.saveDocument(e,r);return{addedRule:o,addedScenario:c,updatedScenario:l}}static expandScenarios(e,t,n="pending"){const s=this.parseDocument(e);if(!s.feature)return;let r=false;for(const e of t){const t=e.split(".");if(t.length>=2&&t[t.length-1]!=="*"){r=true;break}}if(r){this.removeWildcardScenario(s)}for(const e of t){const t=e.split(".");if(t.length<2)continue;const i=t.pop();const o=t.join(".");if(r&&i==="*")continue;const c=this.findRule(s.feature,o);if(c){let e=c.elements.some((e=>e instanceof a.Scenario&&e.name===i));if(!e){const e=new a.Scenario("Scenario",i,"");e.steps.push(new a.Step("*",`mark status = ${n}`));c.elements.push(e)}}}this.saveDocument(e,s)}static removeWildcardScenario(e){if(!e.feature)return;for(const t of e.feature.elements){if(t instanceof a.Rule){t.elements=t.elements.filter((e=>{if(e instanceof a.Scenario&&e.name.trim()==="*"){return false}return true}))}}}}t.GherkinEditor=GherkinEditor;t.findFeatureFiles=GherkinEditor.findFeatureFiles.bind(GherkinEditor);t.findNextIdentity=GherkinEditor.findNextIdentity.bind(GherkinEditor);t.formatGherkin=GherkinEditor.formatGherkin.bind(GherkinEditor);t.updateFeatureScenario=GherkinEditor.updateScenarioTitleAndTags.bind(GherkinEditor);t.parseRawDocument=GherkinEditor.parseRawDocument.bind(GherkinEditor)},4296:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.StateLockError=t.ConfigurationError=t.TestformError=void 0;class TestformError extends Error{exitCode;constructor(e,t=1){super(e);this.name="TestformError";this.exitCode=t;Object.setPrototypeOf(this,new.target.prototype)}}t.TestformError=TestformError;class ConfigurationError extends TestformError{constructor(e){super(e,1);this.name="ConfigurationError"}}t.ConfigurationError=ConfigurationError;class StateLockError extends TestformError{constructor(e){super(e,1);this.name="StateLockError"}}t.StateLockError=StateLockError},2825:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.evaluator=t.Evaluator=void 0;t.evaluateExpression=evaluateExpression;t.interpolateExpressions=interpolateExpressions;const s=n(6066);const r=n(1577);const i=n(5864);class Evaluator{evaluate(e,t={}){switch(e.type){case"Literal":return e.value;case"Array":return e.elements.map((e=>this.evaluate(e,t)));case"Identifier":return this.resolveIdentifier(e.name,t);case"Unary":{const n=this.evaluate(e.argument,t);if(e.operator==="!"){return!this.isTruthy(n)}if(e.operator==="-"){return-Number(n)}throw new Error(`Unsupported unary operator: '${e.operator}'`)}case"Binary":{const n=this.evaluate(e.left,t);if(e.operator==="&&"){if(!this.isTruthy(n))return false;const s=this.evaluate(e.right,t);return this.isTruthy(s)}if(e.operator==="||"){if(this.isTruthy(n))return true;const s=this.evaluate(e.right,t);return this.isTruthy(s)}const s=this.evaluate(e.right,t);switch(e.operator){case"==":if(n===s)return true;if(typeof n==="number"||typeof s==="number"){return Number(n)===Number(s)}return String(n??"")===String(s??"");case"!=":if(n===s)return false;if(typeof n==="number"||typeof s==="number"){return Number(n)!==Number(s)}return String(n??"")!==String(s??"");case"<":return Number(n)<Number(s);case"<=":return Number(n)<=Number(s);case">":return Number(n)>Number(s);case">=":return Number(n)>=Number(s);case"+":if(typeof n==="string"||typeof s==="string"){return String(n??"")+String(s??"")}return Number(n)+Number(s);case"-":return Number(n)-Number(s);case"*":return Number(n)*Number(s);case"/":return Number(n)/Number(s);default:throw new Error(`Unsupported binary operator: '${e.operator}'`)}}case"Call":{const n=e.callee.toLowerCase();const r=t.extraFunctions?.[n]||s.standardFunctions[n];if(!r){throw new Error(`Unknown function: '${e.callee}()'`)}const i=e.args.map((e=>this.evaluate(e,t)));if(n==="file"&&i.length===1&&t.workDir){i.push(t.workDir)}return r(...i)}default:throw new Error(`Unknown AST node type: ${e.type}`)}}resolveIdentifier(e,t){if(e.startsWith("var.")){const n=e.slice(4);return(t.vars||t.variables)?.[n]}if(e.startsWith("local.")){const n=e.slice(6);return t.locals?.[n]}if(e.startsWith("env.")){const t=e.slice(4);return process.env[t]??""}if(e.startsWith("data.")){const n=e.slice(5);if(t.data&&typeof t.data.resolvePath==="function"){return t.data.resolvePath(n)}return t.data?.[n]}if(e.startsWith("report.")){const n=e.slice(7);const s=t.data?.report||t.data;if(s){const e=n.split(".");let t=s;for(const n of e){if(t===undefined||t===null)return undefined;t=t[n]}return t}}if(t.vars&&e in t.vars){return t.vars[e]}if(t.locals&&e in t.locals){return t.locals[e]}return undefined}isTruthy(e){if(e===false||e===null||e===undefined||e===0||e===""){return false}return true}}t.Evaluator=Evaluator;t.evaluator=new Evaluator;function evaluateExpression(e,n={}){const s=new r.Lexer(e);const o=s.tokenize();const a=new i.Parser(o);const c=a.parse();return t.evaluator.evaluate(c,n)}function interpolateExpressions(e,t={}){if(typeof e!=="string"||!e.includes("${")){return e}return e.replace(/\$\{([^}]+)\}/g,((e,n)=>{try{const e=evaluateExpression(n,t);if(e===null||e===undefined)return"";if(typeof e==="object")return JSON.stringify(e);return String(e)}catch{return e}}))}},6066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.standardFunctions=void 0;const s=n(9896);const r=n(6928);const i=n(6982);t.standardFunctions={lower:e=>String(e??"").toLowerCase(),upper:e=>String(e??"").toUpperCase(),trim:(e,t)=>{const n=String(e??"");if(!t)return n.trim();const s=t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const r=new RegExp(`^[${s}]+|[${s}]+$`,"g");return n.replace(r,"")},trimprefix:(e,t)=>{const n=String(e??"");const s=String(t??"");return n.startsWith(s)?n.slice(s.length):n},trimsuffix:(e,t)=>{const n=String(e??"");const s=String(t??"");return n.endsWith(s)?n.slice(0,n.length-s.length):n},startswith:(e,t)=>String(e??"").startsWith(String(t??"")),endswith:(e,t)=>String(e??"").endsWith(String(t??"")),replace:(e,t,n)=>{const s=String(e??"");const r=String(t??"");const i=String(n??"");return s.split(r).join(i)},split:(e,t)=>{const n=String(t??"");const s=String(e??"");return n.split(s)},join:(e,t)=>{const n=String(e??"");if(!Array.isArray(t))return String(t??"");return t.join(n)},format:(e,...t)=>{let n=String(e??"");let s=0;return n.replace(/%[sdj%]/g,(e=>{if(e==="%%")return"%";if(s>=t.length)return e;const n=t[s++];if(e==="%d")return String(Number(n));if(e==="%j")return JSON.stringify(n);return String(n)}))},substr:(e,t,n)=>{const s=String(e??"");const r=Number(t);const i=Number(n);if(isNaN(r))return s;if(isNaN(i))return s.substring(r);return s.substring(r,r+i)},coalesce:(...e)=>{for(const t of e){if(t!==null&&t!==undefined&&t!==""){return t}}return""},lookup:(e,t,n)=>{if(e&&typeof e==="object"&&t in e){return e[t]}return n!==undefined?n:null},contains:(e,t)=>{if(Array.isArray(e)){return e.some((e=>e===t||String(e)===String(t)))}if(typeof e==="string"){return e.includes(String(t))}return false},length:e=>{if(Array.isArray(e)||typeof e==="string"){return e.length}if(e&&typeof e==="object"){return Object.keys(e).length}return 0},element:(e,t)=>{if(!Array.isArray(e))return null;const n=Number(t);return e[n%e.length]},slice:(e,t,n)=>{if(!Array.isArray(e))return[];return e.slice(Number(t),n!==undefined?Number(n):undefined)},merge:(...e)=>{const t={};for(const n of e){if(n&&typeof n==="object"&&!Array.isArray(n)){Object.assign(t,n)}}return t},env:e=>{const t=String(e??"");return process.env[t]??""},uuid:()=>(0,i.randomUUID)(),timestamp:()=>(new Date).toISOString(),jsonencode:e=>JSON.stringify(e),jsondecode:e=>{try{return JSON.parse(String(e??""))}catch{return null}},file:(e,t=".")=>{try{const n=(0,r.resolve)(t,String(e));if((0,s.existsSync)(n)){return(0,s.readFileSync)(n,"utf-8")}}catch{}return""}}},1577:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Lexer=void 0;class Lexer{pos=0;input="";constructor(e){this.input=e.trim();if(this.input.startsWith("${")&&this.input.endsWith("}")){this.input=this.input.substring(2,this.input.length-1).trim()}}tokenize(){const e=[];while(this.pos<this.input.length){this.skipWhitespace();if(this.pos>=this.input.length)break;const t=this.input[this.pos];const n=this.pos;if(t==="("){e.push({type:"LPAREN",value:"(",raw:"(",pos:n});this.pos++}else if(t===")"){e.push({type:"RPAREN",value:")",raw:")",pos:n});this.pos++}else if(t==="["){e.push({type:"LBRACKET",value:"[",raw:"[",pos:n});this.pos++}else if(t==="]"){e.push({type:"RBRACKET",value:"]",raw:"]",pos:n});this.pos++}else if(t===","){e.push({type:"COMMA",value:",",raw:",",pos:n});this.pos++}else if(t==="?"){e.push({type:"QUESTION",value:"?",raw:"?",pos:n});this.pos++}else if(t===":"){e.push({type:"COLON",value:":",raw:":",pos:n});this.pos++}else if(this.matchAhead("&&")||this.matchAhead("||")||this.matchAhead("==")||this.matchAhead("!=")){const t=this.input.substring(this.pos,this.pos+2);e.push({type:"OPERATOR",value:t,raw:t,pos:n});this.pos+=2}else if(this.matchAhead("<=")||this.matchAhead(">=")){const t=this.input.substring(this.pos,this.pos+2);e.push({type:"OPERATOR",value:t,raw:t,pos:n});this.pos+=2}else if(t==="<"||t===">"||t==="!"||t==="+"||t==="-"||t==="*"||t==="/"){e.push({type:"OPERATOR",value:t,raw:t,pos:n});this.pos++}else if(t==='"'||t==="'"){e.push(this.readString(t,n))}else if(this.isDigit(t)){e.push(this.readNumber(n))}else if(this.isIdentifierStart(t)){e.push(this.readIdentifier(n))}else{throw new Error(`Unexpected character '${t}' at position ${this.pos} in expression: "${this.input}"`)}}e.push({type:"EOF",value:null,raw:"",pos:this.pos});return e}skipWhitespace(){while(this.pos<this.input.length&&/\s/.test(this.input[this.pos])){this.pos++}}matchAhead(e){return this.input.startsWith(e,this.pos)}isDigit(e){return e>="0"&&e<="9"}isIdentifierStart(e){return/[a-zA-Z_]/.test(e)}isIdentifierChar(e){return/[a-zA-Z0-9_\.\-]/.test(e)}readString(e,t){this.pos++;let n="";while(this.pos<this.input.length){const s=this.input[this.pos];if(s==="\\"){this.pos++;if(this.pos<this.input.length){n+=this.input[this.pos];this.pos++}}else if(s===e){this.pos++;return{type:"STRING",value:n,raw:this.input.substring(t,this.pos),pos:t}}else{n+=s;this.pos++}}throw new Error(`Unterminated string starting at position ${t} in expression: "${this.input}"`)}readNumber(e){let t=false;while(this.pos<this.input.length){const e=this.input[this.pos];if(this.isDigit(e)){this.pos++}else if(e==="."&&!t&&this.pos+1<this.input.length&&this.isDigit(this.input[this.pos+1])){t=true;this.pos++}else{break}}const n=this.input.substring(e,this.pos);const s=t?parseFloat(n):parseInt(n,10);return{type:"NUMBER",value:s,raw:n,pos:e}}readIdentifier(e){while(this.pos<this.input.length&&this.isIdentifierChar(this.input[this.pos])){this.pos++}const t=this.input.substring(e,this.pos);if(t==="true"){return{type:"BOOLEAN",value:true,raw:t,pos:e}}if(t==="false"){return{type:"BOOLEAN",value:false,raw:t,pos:e}}if(t==="null"){return{type:"NULL",value:null,raw:t,pos:e}}return{type:"IDENTIFIER",value:t,raw:t,pos:e}}}t.Lexer=Lexer},5864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Parser=void 0;class Parser{pos=0;tokens=[];constructor(e){this.tokens=e}parse(){const e=this.parseExpression();if(this.peek().type!=="EOF"){throw new Error(`Unexpected token '${this.peek().raw}' after expression at pos ${this.peek().pos}`)}return e}parseExpression(){return this.parseLogicalOr()}parseLogicalOr(){let e=this.parseLogicalAnd();while(this.matchOperator("||")){const t=this.previous().value;const n=this.parseLogicalAnd();e={type:"Binary",operator:t,left:e,right:n}}return e}parseLogicalAnd(){let e=this.parseEquality();while(this.matchOperator("&&")){const t=this.previous().value;const n=this.parseEquality();e={type:"Binary",operator:t,left:e,right:n}}return e}parseEquality(){let e=this.parseComparison();while(this.matchOperator("==")||this.matchOperator("!=")){const t=this.previous().value;const n=this.parseComparison();e={type:"Binary",operator:t,left:e,right:n}}return e}parseComparison(){let e=this.parseAdditive();while(this.matchOperator("<")||this.matchOperator(">")||this.matchOperator("<=")||this.matchOperator(">=")){const t=this.previous().value;const n=this.parseAdditive();e={type:"Binary",operator:t,left:e,right:n}}return e}parseAdditive(){let e=this.parseMultiplicative();while(this.matchOperator("+")||this.matchOperator("-")){const t=this.previous().value;const n=this.parseMultiplicative();e={type:"Binary",operator:t,left:e,right:n}}return e}parseMultiplicative(){let e=this.parseUnary();while(this.matchOperator("*")||this.matchOperator("/")){const t=this.previous().value;const n=this.parseUnary();e={type:"Binary",operator:t,left:e,right:n}}return e}parseUnary(){if(this.matchOperator("!")||this.matchOperator("-")){const e=this.previous().value;const t=this.parseUnary();return{type:"Unary",operator:e,argument:t}}return this.parsePrimary()}parsePrimary(){const e=this.peek();if(e.type==="STRING"||e.type==="NUMBER"||e.type==="BOOLEAN"||e.type==="NULL"){this.advance();return{type:"Literal",value:e.value}}if(e.type==="LBRACKET"){this.advance();const e=[];if(!this.check("RBRACKET")){do{e.push(this.parseExpression())}while(this.match("COMMA"))}this.consume("RBRACKET","Expected ']' after array elements");return{type:"Array",elements:e}}if(e.type==="LPAREN"){this.advance();const e=this.parseExpression();this.consume("RPAREN","Expected ')' after expression");return e}if(e.type==="IDENTIFIER"){this.advance();const t=e.value;if(this.match("LPAREN")){const e=[];if(!this.check("RPAREN")){do{e.push(this.parseExpression())}while(this.match("COMMA"))}this.consume("RPAREN",`Expected ')' after arguments in call to '${t}'`);return{type:"Call",callee:t,args:e}}return{type:"Identifier",name:t}}throw new Error(`Unexpected token '${e.raw}' of type ${e.type} at position ${e.pos}`)}match(e){if(this.check(e)){this.advance();return true}return false}matchOperator(e){if(this.check("OPERATOR")&&this.peek().value===e){this.advance();return true}return false}check(e){if(this.isAtEnd())return false;return this.peek().type===e}advance(){if(!this.isAtEnd())this.pos++;return this.previous()}isAtEnd(){return this.peek().type==="EOF"}peek(){return this.tokens[this.pos]}previous(){return this.tokens[this.pos-1]}consume(e,t){if(this.check(e))return this.advance();throw new Error(`${t}. Got '${this.peek().raw}' instead at position ${this.peek().pos}`)}}t.Parser=Parser},8184:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.HELP_POLICY=t.HELP_OUTPUT=t.HELP_SUITE_MARK=t.HELP_SUITE_LINK=t.HELP_SUITE_FILL=t.HELP_SUITE_INIT=t.HELP_FUNCTIONS=t.HELP_SUITE=t.HELP_PRINT=t.HELP_TEST_STATE=t.HELP_TEST_AUTOCOMPLETE=t.HELP_TEST_FEATURE=t.HELP_TEST=t.HELP_REPORT=t.HELP_QUERY=t.HELP_PROVIDERS_SCHEMA=t.HELP_PROVIDERS_MIRROR=t.HELP_PROVIDERS_LOCK=t.HELP_PROVIDERS=t.HELP_MODULES=t.HELP_EPHEMERAL=t.HELP_DIFF=t.HELP_WORKSPACE=t.HELP_VERSION=t.HELP_UNTAINT=t.HELP_TAINT=t.HELP_STATE_SHOW=t.HELP_STATE_RM=t.HELP_STATE_PUSH=t.HELP_STATE_PULL=t.HELP_STATE_MV=t.HELP_STATE_LIST=t.HELP_STATE_IDENTITIES=t.HELP_STATE_CLEAN=t.HELP_STATE_REPLACE_PROVIDER=t.HELP_STATE=t.HELP_LOGOUT=t.HELP_LOGIN=t.HELP_GRAPH=t.HELP_FORCE_UNLOCK=t.HELP_FMT=t.HELP_SHOW=t.HELP_REFRESH=t.HELP_IMPORT=t.HELP_DESTROY=t.HELP_APPLY=t.HELP_VALIDATE=t.HELP_PLAN=t.HELP_INIT=t.HELP_GLOBAL=void 0;t.getCommandHelp=getCommandHelp;const s=n(6028);const r=n(465);t.HELP_GLOBAL=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] [subcommand] [args]\n\nThe available commands for execution are listed below.\nThe primary workflow commands are given first, followed by\nless common or more advanced commands.\n\n${(0,r.bold)(`Main commands:`)}\n init Prepare working directory for other commands\n validate Check whether the configuration is valid\n plan Show changes required by current configuration\n apply Create or update resources \n destroy Destroy previously-created resources \n\n${(0,r.bold)(`All other commands:`)}\n diff Show drift between local configuration and state\n ephemeral Manage temporary CI/CD QA sandboxes (up, down, list, show)\n fmt Reformat your configuration in the standard style\n force-unlock Release a stuck lock on the current workspace\n functions Inspect and evaluate built-in expression functions\n graph Generate a Graphviz graph of the steps in an operation\n import Associate existing infrastructure with a ${s.TITLE_APP} resource\n login Obtain and save credentials for a remote host\n logout Remove locally-stored credentials for a remote host\n modules Show all declared modules in a working directory\n output Show output values from your root module or state\n policy Inspect, enable, or disable validation policies\n print Parse a feature file and print the JSON AST\n providers Show the providers required for this configuration\n query Query and filter managed test resources in state\n refresh Update the state to match remote systems\n report Generate multi-dimensional test execution reports\n show Show the current state or a saved plan\n state Advanced state management\n suite Manage test suites and execution files (init, -fill, -link, -mark, -tags)\n taint Mark a resource instance as not fully functional\n untaint Remove the 'tainted' state from a resource instance\n version Show the current ${s.TITLE_APP} version\n workspace Workspace management\n\n${(0,r.bold)(`Global options (use these before the subcommand, if any):`)}\n -chdir=DIR Switch to a different working directory before executing the given subcommand.\n -help Show this help output, or the help for a specified subcommand.\n -version An alias for the "version" subcommand.\n`;t.HELP_INIT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] init [options]\n\n Initialize a new or existing ${s.TITLE_APP} working directory by creating\n initial files and loading any remote state.\n\n This is the first command that should be run for any new or existing\n ${s.TITLE_APP} configuration per machine. This sets up all the local data\n necessary to run ${s.TITLE_APP}.\n\n This command is always safe to run multiple times.\n\n${(0,r.bold)(`Options:`)}\n\n -provider=<type> Provider type to scaffold when creating a new\n configuration (local | github | gitlab | custom).\n (default: github)\n\n -backend-type=<type> Backend type to scaffold when creating a new\n configuration (local | github | s3 | azurerm | gcs | oci).\n (default: local)\n\n -backend=false Disable backend initialization for this configuration\n and use what was previously initialized instead.\n\n -backend-config=path Configuration to be merged with what is in the\n configuration file's 'backend' block. This can be\n a 'key=value' format, and can be specified multiple\n times.\n\n -lock=false Don't hold a state lock during backend migration.\n This is dangerous if others might concurrently run\n commands against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -no-color If specified, output won't contain any color.\n\n -json If specified, machine readable output will be\n printed in JSON format.\n\n -reconfigure Reconfigure a backend, ignoring any saved\n configuration.\n\n -migrate-state Reconfigure a backend, and attempt to migrate any\n existing state.\n`.trim();t.HELP_PLAN=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] plan [options]\n\n Generates a speculative execution plan, showing what actions ${s.TITLE_APP}\n would take to apply the current configuration. This command will not\n actually perform the planned actions.\n\n You can optionally save the plan to a file, which you can then pass to\n the "apply" command to perform exactly the actions described in the plan.\n\n${(0,r.bold)(`Plan Customization Options:`)}\n\n The following options customize how ${s.TITLE_APP} will produce its plan. You\n can also use these options when you run "${s.TITLE_CLI} apply" without passing\n it a saved plan, in order to plan and apply in a single command.\n\n -destroy Select the "destroy" planning mode, which creates a plan\n to destroy all objects currently managed by this\n ${s.TITLE_APP} configuration instead of the usual behavior.\n\n -refresh-only Select the "refresh only" planning mode, which checks\n whether remote objects still match the outcome of the\n most recent ${s.TITLE_APP} apply but does not propose any\n actions to undo any changes made outside of ${s.TITLE_APP}.\n\n -refresh=false Skip checking for external changes to remote objects\n while creating the plan. This can potentially make\n planning faster, but at the expense of possibly planning\n against a stale record of the remote system state.\n\n -replace=resource Force replacement of a particular resource instance using\n its resource address. If the plan would've normally\n produced an update or no-op action for this instance,\n ${s.TITLE_APP} will plan to replace it instead. You can use\n this option multiple times to replace more than one object.\n\n -target=resource Limit the planning operation to only the given module,\n resource, or resource instance and all of its\n dependencies. You can use this option multiple times to\n include more than one object. This is for exceptional\n use only.\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file (.json or key=value format).\n Use this option more than once to include more than one\n variables file.\n\n${(0,r.bold)(`Other Options:`)}\n\n -compact-warnings If ${s.TITLE_APP} produces any warnings that are not\n accompanied by errors, shows them in a more compact\n form that includes only the summary messages.\n\n -detailed-exitcode Return detailed exit codes when the command exits.\n This will change the meaning of exit codes to:\n 0 - Succeeded, diff is empty (no changes)\n 1 - Errored\n 2 - Succeeded, there is a diff\n\n -input=true Ask for input for variables if not directly set.\n\n -lock=false Don't hold a state lock during the operation. This\n is dangerous if others might concurrently run\n commands against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -no-color If specified, output won't contain any color.\n\n -out=path Write a plan file to the given path. This can be\n used as input to the "apply" command.\n\n -parallelism=n Limit the number of concurrent operations. Defaults\n to 3.\n\n -state=statefile A legacy option used for the local backend only.\n See the local backend's documentation for more\n information.\n \n -backup=path Path to backup the existing state file before\n modifying. Defaults to the "-state" path with\n ".backup" extension.\n\n -test-directory=path Set the ${s.TITLE_APP} test directory. If omitted,\n defaults to the chdir directory.\n`.trim();t.HELP_VALIDATE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] validate [options]\n\n Validate the configuration files in a directory, referring only to the\n configuration and not accessing any remote services such as remote state,\n provider APIs, etc.\n\n Validate runs checks that verify whether a configuration is syntactically\n valid and internally consistent, regardless of any provided variables or\n existing state. It is thus primarily useful for general verification of\n reusable modules, including correctness of attribute names and value types.\n\n It is safe to run this command automatically, for example as a post-save\n check in a text editor or as a test step for a re-usable module in a CI\n system.\n\n Validation requires an initialized working directory with any referenced\n plugins and modules installed. To initialize a working directory for\n validation without accessing any configured remote backend, use:\n ${s.TITLE_CLI} init -backend=false\n\n To verify configuration in the context of a particular run (a particular\n target workspace, input variable values, etc), use the '${s.TITLE_CLI} plan'\n command instead, which includes an implied validation check.\n\n${(0,r.bold)(`Options:`)}\n\n -json Produce output in a machine-readable JSON format,\n suitable for use in text editor integrations and other\n automated systems. Always disables color.\n\n -no-color If specified, output won't contain any color.\n\n -no-tests If specified, ${s.TITLE_APP} will not validate test files.\n\n -target=resource Target a specific resource or feature file for validation\n (e.g. -target=testcase, -target=tests/smoke.run.feature).\n\n -test-directory=path Set the ${s.TITLE_APP} test directory, defaults to "tests".\n\n -query If specified, the command will also filter and validate\n specific test scenarios across the configuration.\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files ${s.TITLE_CLI}.tfvars and *.auto.tfvars.\n Use this option more than once to include more than one\n variables file.\n`.trim();t.HELP_APPLY=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] apply [options] [PLAN]\n\n Creates or updates infrastructure according to ${s.TITLE_APP} configuration\n files in the current directory.\n\n By default, ${s.TITLE_APP} will generate a new plan and present it for your\n approval before taking any action. You can optionally provide a plan\n file created by a previous call to "${s.TITLE_CLI} plan", in which case\n ${s.TITLE_APP} will take the actions described in that plan without any\n confirmation prompt.\n\n${(0,r.bold)(`Options:`)}\n\n -auto-approve Skip interactive approval of plan before applying.\n\n -backup=path Path to backup the existing state file before\n modifying. Defaults to the "-state" path with\n ".backup" extension. Set to "-" to disable backup.\n\n -compact-warnings If ${s.TITLE_APP} produces any warnings that are not\n accompanied by errors, show them in a more compact\n form that includes only the summary messages.\n\n -destroy Destroy ${s.TITLE_APP}-managed infrastructure.\n The command "${s.TITLE_CLI} destroy" is a convenience alias\n for this option.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -input=true Ask for input for variables if not directly set.\n\n -no-color If specified, output won't contain any color.\n\n -parallelism=n Limit the number of parallel resource operations.\n Defaults to 3.\n\n -replace=resource ${s.TITLE_APP} will plan to replace this resource instance\n instead of doing an update or no-op action. \n\n -state=path Path to read and save state. Defaults to "testform.tfstate".\n Legacy option for the local backend only. See the local\n backend's documentation for more information.\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file (.json or key=value format).\n Use this option more than once to include more than one\n variables file.\n\n -test-directory=path Set the ${s.TITLE_APP} test directory. If omitted,\n defaults to the chdir directory.\n\n If you don't provide a saved plan file then this command will also accept\n all of the plan-customization options accepted by the ${s.TITLE_CLI} plan command.\n For more information on those options, run:\n ${s.TITLE_CLI} plan -help\n`.trim();t.HELP_DESTROY=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] destroy [options]\n\n Destroy ${s.TITLE_APP}-managed infrastructure.\n\n This command is a convenience alias for:\n ${s.TITLE_CLI} apply -destroy\n\n This command also accepts many of the plan-customization options accepted by\n the ${s.TITLE_CLI} plan command. For more information on those options, run:\n ${s.TITLE_CLI} plan -help\n`.trim();t.HELP_IMPORT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] import [options] ADDR ISSUE_NUMBER\n\n Import an existing GitHub Issue into your ${s.TITLE_APP} state.\n\n This command connects to GitHub, fetches the specified ISSUE_NUMBER, and\n imports it into your local ${s.TITLE_APP} state under the given ADDR (Identity).\n This allows existing GitHub Issues to come under ${s.TITLE_APP} management\n without having to be initially created via a 'testform apply'.\n\n ADDR: The identity of the scenario (e.g., 'test1').\n ISSUE_NUMBER: The numeric ID of the GitHub Issue to import (e.g., '123').\n\n This command will make network requests to GitHub but will not modify\n the remote issue.\n\n${(0,r.bold)(`Options:`)}\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -no-color If specified, output won't contain any color.\n\n -state, and -backup Custom paths for the state and backup files.\n`.trim();t.HELP_REFRESH=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] refresh [options]\n\n Update the state to match remote systems.\n\n This command will not modify your remote test entities directly,\n but it will update your state file to reflect any changes made on the remote platform.\n\n${(0,r.bold)(`Options:`)}\n\n -compact-warnings If ${s.TITLE_APP} produces any warnings that are not\n accompanied by errors, show them in a more compact form\n that includes only the summary messages.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -no-color If specified, output won't contain any color.\n\n -parallelism=n Limit the number of concurrent operations. Defaults to 3.\n\n -target=resource Resource to target. Operation will be limited to this\n resource and its dependencies. This flag can be used\n multiple times.\n\n -var 'foo=bar' Set a variable in the ${s.TITLE_APP} configuration. This\n flag can be set multiple times.\n\n -var-file=foo Set variables in the ${s.TITLE_APP} configuration from\n a file. If "testform.vars.yml" or any "*.auto.vars.yml"\n files are present, they will be automatically loaded.\n\n -state, state-out, and -backup are legacy options supported for the local\n backend only. For more information, see the local backend's documentation.\n`.trim();t.HELP_SHOW=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] show [options] [path]\n\n Reads and outputs a ${s.TITLE_APP} state or plan file in a human-readable\n form. If no path is specified, the current state will be shown.\n\n${(0,r.bold)(`Options:`)}\n\n -no-color If specified, output won't contain any color.\n -json If specified, output the ${s.TITLE_APP} plan or state in\n a machine-readable form.\n`.trim();t.HELP_FMT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] fmt [options] [target...]\n\n Rewrites all ${s.TITLE_APP} scenario files to a canonical format. All\n testing files (.feature) are updated using standard Gherkin syntax\n indentation.\n\n By default, fmt scans the current directory for .feature files. If you\n provide a directory for the target argument, then fmt will scan that\n directory instead.\n\n The content must be in the Gherkin language native syntax.\n\n${(0,r.bold)(`Options:`)}\n\n -list=false Don't list files whose formatting differs\n\n -write=false Don't write to source files (implied by -check or -diff)\n\n -diff Display diffs of formatting changes\n\n -check Check if the input is formatted. Exit status will be 3 if\n any input is not properly formatted and zero otherwise.\n\n -no-color If specified, output won't contain any color.\n\n -recursive Also process files in subdirectories. By default, only the\n given directory (or current directory) is processed.\n`.trim();t.HELP_FORCE_UNLOCK=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] force-unlock LOCK_ID\n\n Manually unlock the state for the defined configuration.\n\n This will not modify your infrastructure. This command removes the lock on the\n state for the current workspace. The behavior of this lock is dependent\n on the backend being used. Local state files cannot be unlocked by another\n process.\n\n${(0,r.bold)(`Options:`)}\n\n -force Don't ask for input for unlock confirmation.\n`.trim();t.HELP_GRAPH=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] graph [options]\n\n Produces a representation of the dependency graph between different\n objects in the current configuration and state.\n\n By default the graph shows a summary only of the relationships between\n resources in the configuration, since those are the main objects that\n have side-effects whose ordering is significant. You can generate more\n detailed graphs reflecting ${s.TITLE_APP}'s actual evaluation strategy\n by specifying the -type=TYPE option to select an operation type.\n\n The graph is presented in the DOT language by default. The typical program that can\n read this format is GraphViz, but many web services are also available\n to read this format.\n\n${(0,r.bold)(`Options:`)}\n\n -plan=tfplan Render graph using the specified plan file instead of the\n configuration in the current directory. Implies -type=apply.\n\n -draw-cycles Highlight any cycles in the graph with colored edges.\n This helps when diagnosing cycle errors. This option is\n supported only when illustrating a real evaluation graph,\n selected using the -type=TYPE option.\n\n -type=TYPE Type of operation graph to output. Can be: plan,\n plan-refresh-only, plan-destroy, or apply. By default\n ${s.TITLE_APP} just summarizes the relationships between the\n resources in your configuration, without any particular\n operation in mind. Full operation graphs are more detailed\n but therefore often harder to read.\n\n -module-depth=n (deprecated) In prior versions of ${s.TITLE_APP}, specified the\n depth of modules to show in the output.\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files ${s.TITLE_APP.toLowerCase()}.vars.yml and *.auto.vars.yml.\n Use this option more than once to include more than one\n variables file.\n\n -format=FORMAT Output format for the graph. Supported values are\n dot (default), mermaid, and tree.\n`.trim();t.HELP_LOGIN=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] login [hostname]\n\n Retrieves an authentication token for the given hostname, if it supports\n automatic login, and saves it in a credentials file in your home directory.\n\n If no hostname is provided, the default hostname is github.com, to\n log in to GitHub.\n\n If not overridden by credentials helper settings in the CLI configuration,\n the credentials will be written to the following local file:\n ~/.testform.d/credentials.json\n`.trim();t.HELP_LOGOUT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] logout [hostname]\n\n Removes locally-stored credentials for specified hostname.\n\n Note: the API token is only removed from local storage, not destroyed on the\n remote server, so it will remain valid until manually revoked.\n\n If no hostname is provided, the default hostname is github.com.\n`.trim();t.HELP_STATE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state [subcommand] [options] [args]\n\n This command has subcommands for advanced state management.\n\n These subcommands can be used to slice and dice the ${s.TITLE_APP} state.\n This is sometimes necessary in advanced cases. For your safety, all\n state management commands that modify the state create a timestamped\n backup of the state prior to making modifications.\n\n${(0,r.bold)(`Subcommands:`)}\n identities List the identities of resources in the state\n list List resources in the state\n mv Move an item in the state\n pull Pull current state and output to stdout\n push Update remote state from a local state file\n replace-provider Replace provider in the state\n rm Remove instances from the state\n show Show a resource in the state\n`.trim();t.HELP_STATE_REPLACE_PROVIDER=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state replace-provider [options] FROM_PROVIDER TO_PROVIDER\n\n Replace provider in the ${s.TITLE_APP} state.\n\n This command updates the provider for all matching resources in the state,\n allowing seamless migration between providers (e.g. from github to gitlab).\n\n${(0,r.bold)(`Options:`)}\n\n -auto-approve Skip interactive confirmation before modifying state.\n -lock=false Don't hold a state lock during the operation.\n -lock-timeout=0s Duration to retry a state lock.\n -state=path Path to state file.\n -backup=path Path to backup file.\n`.trim();t.HELP_STATE_CLEAN=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state clean [options] [address...]\n\n Clean and optimize the ${s.TITLE_APP} state payload by removing redundant\n scenario bodies and empty fields, reducing file and network transfer size.\n\n By default, all resources in the state are cleaned and optimized. You can\n optionally provide one or more resource addresses to target specific resources.\n\n${(0,r.bold)(`Options:`)}\n -dry-run If set, prints out the potential space savings without\n writing changes to the state.\n -lock=false Don't hold a state lock during the operation.\n -lock-timeout=0s Duration to retry a state lock.\n -state=PATH Path to state file to clean.\n`.trim();t.HELP_STATE_IDENTITIES=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state identities [options] -json [address...]\n\n List the json format of the identities of resources in the ${s.TITLE_APP} state.\n\n This command lists the identities of resource instances in the ${s.TITLE_APP} state in json format.\n The address argument can be used to filter the instances by resource or module. If\n no pattern is given, identities for all resource instances are listed.\n\n The addresses must either be module addresses or absolute resource\n addresses, such as:\n github_testcase.example\n module.example\n module.example.module.child\n module.example.github_testcase.example\n\n An error will be returned if any of the resources or modules given as\n filter addresses do not exist in the state.\n\n${(0,r.bold)(`Options:`)}\n\n -state=statefile Path to a ${s.TITLE_APP} state file to use to look\n up ${s.TITLE_APP}-managed resources. By default, ${s.TITLE_APP}\n will consult the state of the currently-selected\n workspace.\n\n -id=ID Filters the results to include only instances whose\n resource types have an attribute named "id" whose value\n equals the given id string.\n`.trim();t.HELP_STATE_LIST=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state list [options] [address...]\n\n List resources in the ${s.TITLE_APP} state.\n\n This command lists resource instances in the ${s.TITLE_APP} state. The address\n argument can be used to filter the instances by resource or module. If\n no pattern is given, all resource instances are listed.\n\n The addresses must either be module addresses or absolute resource\n addresses, such as:\n github_testcase.example\n module.example\n module.example.module.child\n module.example.github_testcase.example\n\n An error will be returned if any of the resources or modules given as\n filter addresses do not exist in the state.\n\n${(0,r.bold)(`Options:`)}\n\n -state=statefile Path to a ${s.TITLE_APP} state file to use to look\n up ${s.TITLE_APP}-managed resources. By default, ${s.TITLE_APP}\n will consult the state of the currently-selected\n workspace.\n\n -id=ID Filters the results to include only instances whose\n resource types have an attribute named "id" whose value\n equals the given id string.\n`.trim();t.HELP_STATE_MV=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state mv [options] SOURCE DESTINATION\n\n This command will move an item matched by the address given to the\n destination address. This command can also move to a destination address\n in a completely different state file.\n\n This can be used for simple resource renaming, moving items to and from\n a module, moving entire modules, and more. And because this command can also\n move data to a completely new state, it can also be used for refactoring\n one configuration into multiple separately managed ${s.TITLE_APP} configurations.\n\n This command will output a backup copy of the state prior to saving any\n changes. The backup cannot be disabled. Due to the destructive nature\n of this command, backups are required.\n\n If you're moving an item to a different state file, a backup will be created\n for each state file.\n\n${(0,r.bold)(`Options:`)}\n\n -dry-run If set, prints out what would've been moved but doesn't\n actually move anything.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -ignore-remote-version A rare option used for the remote backend only. See\n the remote backend documentation for more information.\n\n -state, state-out, and -backup are legacy options supported for the local\n backend only. For more information, see the local backend's documentation.\n`.trim();t.HELP_STATE_PULL=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state pull [options]\n\n Pull the state from its location, upgrade the local copy, and output it\n to stdout.\n\n This command "pulls" the current state and outputs it to stdout.\n As part of this process, ${s.TITLE_APP} will upgrade the state format of the\n local copy to the current version.\n\n The primary use of this is for state stored remotely. This command\n will still work with local state but is less useful for this.\n`.trim();t.HELP_STATE_PUSH=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state push [options] PATH\n\n Update remote state from a local state file at PATH.\n\n This command "pushes" a local state and overwrites remote state\n with a local state file. The command will protect you against writing\n an older serial or a different state file lineage unless you specify the\n "-force" flag.\n\n This command works with local state (it will overwrite the local\n state), but is less useful for this use case.\n\n If PATH is "-", then this command will read the state to push from stdin.\n Data from stdin is not streamed to the backend: it is loaded completely\n (until pipe close), verified, and then pushed.\n\n${(0,r.bold)(`Options:`)}\n\n -force Write the state even if lineages don't match or the\n remote serial is higher.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n`.trim();t.HELP_STATE_RM=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state rm [options] ADDRESS...\n\n Remove one or more items from the ${s.TITLE_APP} state, causing ${s.TITLE_APP} to\n "forget" those items without first destroying them in the remote system.\n\n This command removes one or more resource instances from the ${s.TITLE_APP} state\n based on the addresses given. You can view and list the available instances\n with "${s.TITLE_CLI} state list".\n\n If you give the address of an entire module then all of the instances in\n that module and any of its child modules will be removed from the state.\n\n If you give the address of a resource that has "count" or "for_each" set,\n all of the instances of that resource will be removed from the state.\n\n${(0,r.bold)(`Options:`)}\n\n -dry-run If set, prints out what would've been removed but\n doesn't actually remove anything.\n\n -backup=PATH Path where ${s.TITLE_APP} should write the backup\n state.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -state=PATH Path to the state file to update. Defaults to the\n current workspace state.\n Legacy option for the local backend only. See\n the local backend's documentation for more\n information.\n\n -ignore-remote-version Continue even if remote and local ${s.TITLE_APP} versions\n are incompatible. This may result in an unusable\n workspace, and should be used with extreme caution.\n`.trim();t.HELP_STATE_SHOW=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state show [options] ADDRESS\n\n Shows the attributes of a resource in the ${s.TITLE_APP} state.\n\n This command shows the attributes of a single resource in the ${s.TITLE_APP}\n state. The address argument must be used to specify a single resource.\n You can view the list of available resources with "${s.TITLE_CLI} state list".\n\n${(0,r.bold)(`Options:`)}\n\n -state=statefile Path to a ${s.TITLE_APP} state file to use to look\n up ${s.TITLE_APP}-managed resources. By default it will\n use the state "${s.FILE_STATE}" if it exists.\n`.trim();t.HELP_TAINT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] taint [options] <address>\n\n ${s.TITLE_APP} uses the term "tainted" to describe a resource instance\n which may not be fully functional, either because its creation\n partially failed or because you've manually marked it as such using\n this command.\n\n This will not modify your infrastructure directly, but subsequent\n ${s.TITLE_APP} plans will include actions to destroy the remote object\n and create a new object to replace it.\n\n You can remove the "taint" state from a resource instance using\n the "${s.TITLE_CLI} untaint" command.\n\n The address is in the resource address syntax, such as:\n testcase/cart.case.feature.tc-01\n testrun/sprint.run.feature.tr-login\n testplan/release.plan.feature.tp-smoke\n\n Use your shell's quoting or escaping syntax to ensure that the\n address will reach ${s.TITLE_APP} correctly, without any special\n interpretation.\n\n${(0,r.bold)(`Options:`)}\n\n -allow-missing If specified, the command will succeed (exit code 0)\n even if the resource is missing.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -ignore-remote-version A rare option used for the remote backend only. See\n the remote backend documentation for more information.\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files testform.vars.yml and *.auto.vars.yml.\n Use this option more than once to include more than one\n variables file.\n\n -state, state-out, and -backup are legacy options supported for the local\n backend only. For more information, see the local backend's documentation.\n`.trim();t.HELP_UNTAINT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] untaint [options] name\n\n ${s.TITLE_APP} uses the term "tainted" to describe a resource instance\n which may not be fully functional, either because its creation\n partially failed or because you've manually marked it as such using\n the "${s.TITLE_CLI} taint" command.\n\n This command removes that state from a resource instance, causing\n ${s.TITLE_APP} to see it as fully-functional and not in need of\n replacement.\n\n This will not modify your infrastructure directly. It only avoids\n ${s.TITLE_APP} planning to replace a tainted instance in a future operation.\n\n${(0,r.bold)(`Options:`)}\n\n -allow-missing If specified, the command will succeed (exit code 0)\n even if the resource is missing.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -ignore-remote-version A rare option used for the remote backend only. See\n the remote backend documentation for more information.\n\n -state, state-out, and -backup are legacy options supported for the local\n backend only. For more information, see the local backend's documentation.\n`.trim();t.HELP_VERSION=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] version [options]\n\n Displays the version of ${s.TITLE_APP} and all installed plugins\n\n${(0,r.bold)(`Options:`)}\n\n -json Output the version information as a JSON object.\n`.trim();t.HELP_WORKSPACE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] workspace\n\n new, list, show, select and delete ${s.TITLE_APP} workspaces.\n\n${(0,r.bold)(`Subcommands:`)}\n delete Delete a workspace\n list List Workspaces\n new Create a new workspace\n select Select a workspace\n show Show the name of the current workspace\n`.trim();t.HELP_DIFF=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] diff [options]\n\n Show drift between local configuration and state.\n\n${(0,r.bold)(`Options:`)}\n\n -target=resource Target a specific resource or feature file.\n -remote Compare local and state against live remote provider issues.\n -i, -interactive Interactively resolve detected drift (pull / overwrite / skip).\n -test-directory=dir Subdirectory containing test files.\n`.trim();t.HELP_EPHEMERAL=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] ephemeral <subcommand> [options] [args]\n\n Manage temporary CI/CD QA sandboxes.\n\n${(0,r.bold)(`Subcommands:`)}\n up Deploy an isolated ephemeral sandbox\n down Destroy all remote issues and clean sandbox\n list List all active ephemeral sandboxes\n show Inspect an ephemeral sandbox\n`.trim();t.HELP_MODULES=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] modules [options]\n\n Prints out a list of all declared ${s.TITLE_APP} modules and their resolved versions\n in a ${s.TITLE_APP} working directory.\n\n${(0,r.bold)(`Options:`)}\n\n -json If specified, output declared ${s.TITLE_APP} modules and\n their resolved versions in a machine-readable format.\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files ${s.TITLE_APP.toLowerCase()}.vars.yml and *.auto.vars.yml.\n Use this option more than once to include more than one\n variables file.\n`.trim();t.HELP_PROVIDERS=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] providers [options] [DIR]\n\n Prints out a tree of modules in the referenced configuration annotated with\n their provider requirements.\n\n This provides an overview of all of the provider requirements across all\n referenced modules, as an aid to understanding why particular provider\n plugins are needed and why particular versions are selected.\n\n${(0,r.bold)(`Options:`)}\n\n -test-directory=path Set the ${s.TITLE_APP} test directory, defaults to "tests".\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files ${s.TITLE_APP.toLowerCase()}.vars.yml and *.auto.vars.yml.\n Use this option more than once to include more than one\n variables file.\n\n${(0,r.bold)(`Subcommands:`)}\n lock Write out dependency locks for the configured providers\n mirror Save local copies of all required provider plugins\n schema Show schemas for the providers used in the configuration\n`.trim();t.HELP_PROVIDERS_LOCK=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] providers lock [options] [providers...]\n\n Normally the dependency lock file (.testform/cache/lock.json) is updated\n automatically by "${s.TITLE_CLI} init", but the information available to the\n normal provider installer can be constrained when you're installing providers\n from filesystem or network mirrors, and so the generated lock file can end\n up incomplete.\n\n The "providers lock" subcommand addresses that by updating the lock file\n based on the official packages available in the origin registry, ignoring\n the currently-configured installation strategy.\n\n After this command succeeds, the lock file will contain suitable checksums\n to allow installation of the providers needed by the current configuration\n on all of the selected platforms.\n\n By default this command updates the lock file for every provider declared\n in the configuration. You can override that behavior by providing one or\n more provider source addresses on the command line.\n\n${(0,r.bold)(`Options:`)}\n\n -fs-mirror=dir Consult the given filesystem mirror directory instead\n of the origin registry for each of the given providers.\n\n This would be necessary to generate lock file entries for\n a provider that is available only via a mirror, and not\n published in an upstream registry. In this case, the set\n of valid checksums will be limited only to what ${s.TITLE_APP}\n can learn from the data in the mirror directory.\n\n -net-mirror=url Consult the given network mirror (given as a base URL)\n instead of the origin registry for each of the given\n providers.\n\n This would be necessary to generate lock file entries for\n a provider that is available only via a mirror, and not\n published in an upstream registry. In this case, the set\n of valid checksums will be limited only to what ${s.TITLE_APP}\n can learn from the data in the mirror indices.\n\n -platform=os_arch Choose a target platform to request package checksums\n for.\n\n By default ${s.TITLE_APP} will request package checksums\n suitable only for the platform where you run this\n command. Use this option multiple times to include\n checksums for multiple target systems.\n\n Target names consist of an operating system and a CPU\n architecture. For example, "linux_amd64" selects the\n Linux operating system running on an AMD64 or x86_64\n CPU. Each provider is available only for a limited\n set of target platforms.\n\n -enable-plugin-cache Enable the usage of the globally configured plugin cache.\n This will speed up the locking process, but the providers\n won't be loaded from an authoritative source.\n\n -test-directory=path Set the ${s.TITLE_APP} test directory, defaults to "tests".\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files ${s.TITLE_APP.toLowerCase()}.vars.yml and *.auto.vars.yml.\n Use this option more than once to include more than one\n variables file.\n`.trim();t.HELP_PROVIDERS_MIRROR=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] providers mirror [options] <target-dir>\n\n Populates a local directory with copies of the provider plugins needed for\n the current configuration, so that the directory can be used either directly\n as a filesystem mirror or as the basis for a network mirror and thus obtain\n those providers without access to their origin registries in future.\n\n The mirror directory will contain JSON index files that can be published\n along with the mirrored packages on a static HTTP file server to produce\n a network mirror. Those index files will be ignored if the directory is\n used instead as a local filesystem mirror.\n\n${(0,r.bold)(`Options:`)}\n\n -platform=os_arch Choose which target platform to build a mirror for.\n By default ${s.TITLE_APP} will obtain plugin packages\n suitable for the platform where you run this command.\n Use this flag multiple times to include packages for\n multiple target systems.\n\n Target names consist of an operating system and a CPU\n architecture. For example, "linux_amd64" selects the\n Linux operating system running on an AMD64 or x86_64\n CPU. Each provider is available only for a limited\n set of target platforms.\n`.trim();t.HELP_PROVIDERS_SCHEMA=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] providers schema [options]\n\n Prints out a json representation of the schemas for all providers used\n in the configuration.\n\n${(0,r.bold)(`Options:`)}\n\n -json Output the schema representation in JSON format.\n`.trim();t.HELP_QUERY=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] query [options]\n\n Queries the remote infrastructure for resources.\n\n ${s.TITLE_APP} will search for .feature and test configuration files within the current configuration.\n ${s.TITLE_APP} will then use the configured providers to query the remote\n infrastructure for resources that match the defined list blocks. The results\n will be printed to the terminal and optionally can be used to generate\n configuration.\n\n${(0,r.bold)(`Query Customization Options:`)}\n\n The following options customize how ${s.TITLE_APP} will run the query.\n\n -var 'foo=bar' Set a value for one of the input variables in the query\n file of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files testform.vars.yml and *.auto.vars.yml.\n Use this option more than once to include more than one\n variables file.\n\n -custom=key=value Filter by custom field value.\n\n -search=text Free-text search across resource titles and content.\n\n${(0,r.bold)(`Other Options:`)}\n\n -generate-config-out=path Instructs ${s.TITLE_APP} to generate import and resource\n blocks for any found results. The configuration is\n written to a new file at PATH, which must not\n already exist. When this option is used with the\n json option, the generated configuration will be\n part of the JSON output instead of written to a\n file.\n\n -json If specified, machine readable output will be\n printed in JSON format.\n\n -no-color If specified, output won't contain any color.\n`.trim();t.HELP_REPORT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] report <type> [options]\n\n Generates multi-dimensional test reports from the local state.\n Available report types are grouped by scope:\n\n 📦 Scope: Test Case\n testcase-summary List of all test cases and their status\n test-case-activity Dashboard of test cases with graphs and trends\n\n 🏃 Scope: Test Run\n testrun-summary Test runs and their pass/fail metrics\n testrun-detailed In-depth view of a specific Test Run\n\n 📋 Scope: Test Plan\n testplan-summary Overall Test Plan Progress and linked test runs\n\n 🌐 Cross-Scope (Multi-dimensional)\n defects List of failed/blocked tests with issue links\n traceability Mapping between requirements/tags and test runs\n coverage Percentage of passed tests grouped by tags\n two-dimensional Status distribution matrix\n raw Extract all data for custom reporting\n\n${(0,r.bold)(`Options:`)}\n\n -format=format Output format.\n Default is "md" (Markdown).\n Available formats: md, json, csv, xlsx, docx.\n Custom formats can be auto-loaded from .testform/reports/.\n\n -out=path Path to save the generated report.\n Default is stdout.\n\n -filter=query Filter data by attribute/field (key=val) or inferred\n free-text search (text). Can be specified multiple times.\n\n -target=resource Target a specific resource, testrun (@tr-N), or\n testplan (@tp-N). When targeting a testplan, reports\n automatically include all linked testruns and executions.\n\n -groupBy=field Group results dynamically by a specific field\n (e.g. status, label, assignee, feature, priority).\n\n -template=path Path to a custom template file (Word .docx, HTML, etc.).\n\n -var=key=val Set a variable value to interpolate in report templates.\n Use this option more than once to set more than one variable.\n\n -var-file=filename Load variable values from the given YAML/JSON file.\n`.trim();t.HELP_TEST=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] test <subcommand> [options]\n\n Manage test files locally. Groups operations for creating and updating\n testrun and testplan feature files without interacting with GitHub.\n\n These subcommands do NOT interact with GitHub. They operate on local files\n and testform.state only.\n\n${(0,r.bold)(`Subcommands:`)}\n add Create a new testrun or testplan feature file\n autocomplete Expand empty Rule blocks in a testrun file from its source\n .case.feature (testrun only)\n state Update a testcase execution status within a testrun\n\n${(0,r.bold)(`Target Resolution (-target flag):`)}\n All subcommands accept three forms to identify a testrun/testplan:\n Full path: tests/testrun/20260607_013738_ef7c0c.run.feature\n Relative: 20260607_013738_ef7c0c.run.feature (or fragment)\n Identity: @tr-2 (resolved from testform.state)\n\n If a fragment matches more than one file, an error lists all ambiguous\n matches so you can be more specific.\n`.trim();t.HELP_TEST_FEATURE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] test feature [options]\n\n Create a new testrun or testplan feature file based on your naming\n convention defined in main.yml.\n\n This subcommand does NOT apply to testcase scope.\n It automatically resolves the output directory and applies the naming\n convention (including timestamp, hash, and slug) defined in your config.\n\n${(0,r.bold)(`Options:`)}\n\n -scope=scope Required. Must be 'testrun' or 'testplan'.\n\n -title=title An optional title for the feature file. If not provided,\n a default name based on the timestamp is generated.\n\n -rule=rule Include a Rule block (Rule: <rule>) in the generated file.\n The command verifies that a feature file for this rule\n exists in the workspace.\n Can be specified multiple times.\n`.trim();t.HELP_TEST_AUTOCOMPLETE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] test autocomplete -target=<resource>\n\n [testrun only] Reads each Rule block in the target testrun feature file,\n finds the referenced .case.feature on disk, and expands its scenarios into\n the testrun file with 'mark status = pending'.\n\n Files are matched by @testrun tag OR the .run.feature extension.\n\n Rules that already have explicit Scenario blocks are left unchanged —\n manual control is always preserved.\n\n${(0,r.bold)(`Options:`)}\n\n -target=resource Required. Identifies the testrun file. Accepts:\n Full path: tests/testrun/20260607_ef7c0c.run.feature\n Relative: 20260607_ef7c0c.run.feature (or fragment)\n Identity: @tr-2 (resolved from testform.state)\n\n -test-directory=dir Optional. Limits the search scope for .case.feature files.\n`.trim();t.HELP_TEST_STATE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] test state "featureFile@tc-N=status" -target=<resource>\n\n [testrun only] Update the execution status of a specific testcase within\n a testrun. Simultaneously updates:\n - The GitHub comment for that testcase\n - The issue body checklist\n - The local testrun feature file\n\n The testcase argument must include the source feature file to avoid\n ambiguity when multiple Rules share the same @tc-N numbering.\n\n${(0,r.bold)(`Available statuses:`)} passed, failed, pending, skipped, blocked, wip\n\n${(0,r.bold)(`Options:`)}\n\n -target=resource Required. Identifies the testrun file. Accepts:\n Full path: tests/testrun/20260607_ef7c0c.run.feature\n Relative: 20260607_ef7c0c.run.feature (or fragment)\n Identity: @tr-2 (resolved from testform.state)\n\n${(0,r.bold)(`Argument:`)} "featureFile@tc-N=status"\n\n The featureFile can be a filename, a relative path, or a full identity.\n Use the full path when multiple Rules share the same @tc-N numbers.\n\n${(0,r.bold)(`Examples:`)}\n\n ${s.TITLE_CLI} test state "cuenta/inicio-sesion.feature@tc-1=passed" -target="@tr-2"\n ${s.TITLE_CLI} test state "github_testcase.agencia/cuenta.feature.@tc-3=failed" -target="20260607.run.feature"\n`.trim();t.HELP_PRINT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] print [options]\n\n Parse a specific feature file and print its JSON Abstract Syntax Tree (AST).\n This command is designed for developers to debug Gherkin feature parsing and Testform's\n filtering behavior.\n\n${(0,r.bold)(`Options:`)}\n\n -scope=scope Limit the scope of the execution (testcase, testrun, testplan).\n\n -file=path The filename or partial filename to parse and output.\n If not provided, all parsed scenarios in the current\n scope will be printed.\n\n -format=format Choose between 'gherkin' (raw Gherkin AST) or 'testform' \n (filtered and enriched by Testform). Default is 'testform'.\n\n -var=key=val Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file (.json or key=value format).\n Use this option more than once to include more than one\n variables file.\n`.trim();t.HELP_SUITE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] suite [subcommand] [options]\n\n Manage test suites and execution files (.run.feature and .plan.feature).\n\n${(0,r.bold)(`Subcommand:`)}\n init Create a new suite file (.run.feature or .plan.feature)\n\n${(0,r.bold)(`Options:`)}\n -fill Autocomplete empty testrun rules with their testcases\n -link="<id>=<status>" Link a testcase or testrun into a suite\n -mark="<id>=<status>" Record execution status (* mark status = <status>) in a testrun\n -tags="<address>" Generate a testrun suite from bracketed tag addresses (e.g. "[@smoke]")\n\n${(0,r.bold)(`Other Options:`)}\n -target=resource Required for -fill, -link, -mark. Identifies the suite file:\n • Identity Tag (@tr-N / @tp-N):\n Unique identifier across workspace (only valid for testrun/testplan;\n testcase @tc-N tags can repeat across files).\n • Canonical Address:\n Immutable full address (e.g. tests/runs/20261024.run.feature.@tr-1).\n • Scoped File Path:\n File path resolved against -test-directory (e.g. 20261024.run.feature).\n -test-directory=dir Optional. Limits search scope for .case.feature files and shortens target paths.\n -scope=scope Optional (global). Scope of the suite (testrun | testplan).\n -title=title Optional. Human-readable title of the suite.\n -rule=rule Optional. Source .case.feature file(s) to include as Rule blocks.\n`.trim();t.HELP_FUNCTIONS=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] functions [name] [options]\n\n Inspect and evaluate built-in functions available in Testform expressions\n (used in locals.yml expressions, variables.yml validation conditions, etc.).\n\n${(0,r.bold)(`Options:`)}\n --eval="<expr>" Evaluate an expression live in the terminal and display the result.\n\n${(0,r.bold)(`Examples:`)}\n ${s.TITLE_CLI} functions\n ${s.TITLE_CLI} functions format\n ${s.TITLE_CLI} functions lower\n ${s.TITLE_CLI} functions --eval="format('%s/%s', 'https://api.dev.com', 'v1')"\n ${s.TITLE_CLI} functions --eval="contains(['dev', 'staging'], 'dev')"\n`.trim();t.HELP_SUITE_INIT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] suite init [options]\n\n Create a new testrun or testplan feature file based on your project conventions.\n Applies timestamp, hash, and slug naming defined in your config.\n\n${(0,r.bold)(`Options:`)}\n\n -scope=scope Required. Must be 'testrun' or 'testplan'.\n -title=title An optional title for the suite file.\n -rule=rule Include a Rule block (Rule: <rule>) in the generated file.\n Can be specified multiple times.\n`.trim();t.HELP_SUITE_FILL=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] suite fill -target=<resource>\n\n [testrun only] Reads each Rule block in the target testrun feature file,\n finds the referenced .case.feature on disk, and fills its scenarios into\n the testrun file with 'mark status = pending'.\n\n${(0,r.bold)(`Options:`)}\n\n -target=resource Required. Identifies the suite file (path, relative, or @tr-N).\n -test-directory=dir Optional. Limits the search scope for .case.feature files.\n`.trim();t.HELP_SUITE_LINK=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] suite link "<identifier>[=status]" -target=<resource>\n\n Directly writes Gherkin into the suite file (.run.feature or .plan.feature)\n without needing to hand-craft Gherkin syntax.\n\n${(0,r.bold)(`Scopes & Modes:`)}\n 1. Scope testrun:\n - Implicit: ${s.TITLE_CLI} suite link "checkout.case.feature" -target="@tr-42"\n Injects: Rule: checkout.case.feature\n - Explicit: ${s.TITLE_CLI} suite link "@tc-1" -target="@tr-42"\n Injects: Rule: checkout.case.feature\n Scenario: @tc-1\n * mark status = pending\n - Status: ${s.TITLE_CLI} suite link "@tc-1=passed" -target="@tr-42"\n\n 2. Scope testplan:\n - Link run: ${s.TITLE_CLI} suite link "sprint42.run.feature" -target="@tp-1"\n Injects: Rule: sprint42.run.feature\n\n${(0,r.bold)(`Identity Strategies:`)}\n 1. Only tag: "@tc-1" or "@tc-1=passed"\n 2. File + tag: "checkout.case.feature.@tc-1=passed" (or "@tc-1")\n 3. Scenario name: "Pago con tarjeta=passed" (matches scenario title)\n`.trim();t.HELP_SUITE_MARK=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] suite mark "<identifier>=status" -target=<resource>\n\n Record or update the execution status of an existing testcase within a testrun,\n synchronizing both the local .run.feature file and the remote issue comments.\n\n Note: If the testcase belongs to an implicit Rule, you must expand it first\n using '${s.TITLE_CLI} suite fill -target=<resource>' before marking its status.\n\n${(0,r.bold)(`Available statuses:`)} passed, failed, pending, skipped\n\n${(0,r.bold)(`Examples:`)}\n ${s.TITLE_CLI} suite mark "@tc-1=passed" -target="@tr-2"\n ${s.TITLE_CLI} suite mark "cuenta/inicio-sesion.feature@tc-1=failed" -target="@tr-2"\n ${s.TITLE_CLI} suite mark "Validar login exitoso=passed" -target="20260607.run.feature"\n`.trim();t.HELP_OUTPUT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] output [options] [NAME]\n\n Reads an output variable from a ${s.TITLE_APP} state file and prints\n the value. With no additional arguments, output will display all the\n outputs for the root module. An optional NAME can be provided to display\n a specific output value.\n\n${(0,r.bold)(`Options:`)}\n\n -state=path Path to the state file to read. Defaults to "${s.FILE_STATE}".\n\n -json If specified, machine readable output will be\n printed in JSON format.\n\n -raw If specified for a single named output value,\n the value will be printed without formatting or quotes.\n`.trim();t.HELP_POLICY=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] policy [options]\n\n Inspects, enables, or disables validation policies defined for this\n configuration, or loaded from local and shared modules.\n\n By default, '${s.TITLE_CLI} policy' lists all available policies (both built-in\n and custom) along with their current status, scope, and description.\n\n${(0,r.bold)(`Options:`)}\n\n -enable=ID Enable the specified policy and save to configuration.\n\n -disable=ID Disable the specified policy and save to configuration.\n\n -show=ID Show detailed information and rule definitions for a policy.\n\n -scope=SCOPE Filter policies by scope (testcase, testrun, testplan).\n\n -json Produce output in a machine-readable JSON format.\n`.trim();function getCommandHelp(e){switch(e){case"policy":return t.HELP_POLICY;case"init":return t.HELP_INIT;case"validate":return t.HELP_VALIDATE;case"plan":return t.HELP_PLAN;case"apply":return t.HELP_APPLY;case"destroy":return t.HELP_DESTROY;case"import":return t.HELP_IMPORT;case"refresh":return t.HELP_REFRESH;case"diff":return t.HELP_DIFF;case"query":return t.HELP_QUERY;case"show":return t.HELP_SHOW;case"output":return t.HELP_OUTPUT;case"fmt":return t.HELP_FMT;case"graph":return t.HELP_GRAPH;case"force-unlock":return t.HELP_FORCE_UNLOCK;case"login":return t.HELP_LOGIN;case"workspace":return t.HELP_WORKSPACE;case"ephemeral":return t.HELP_EPHEMERAL;case"report":return t.HELP_REPORT;case"print":return t.HELP_PRINT;case"logout":return t.HELP_LOGOUT;case"modules":return t.HELP_MODULES;case"providers":return t.HELP_PROVIDERS;case"providers lock":return t.HELP_PROVIDERS_LOCK;case"providers mirror":return t.HELP_PROVIDERS_MIRROR;case"providers schema":return t.HELP_PROVIDERS_SCHEMA;case"state":return t.HELP_STATE;case"state clean":return t.HELP_STATE_CLEAN;case"state identities":return t.HELP_STATE_IDENTITIES;case"state list":return t.HELP_STATE_LIST;case"state mv":return t.HELP_STATE_MV;case"state pull":return t.HELP_STATE_PULL;case"state push":return t.HELP_STATE_PUSH;case"state replace-provider":return t.HELP_STATE_REPLACE_PROVIDER;case"state rm":return t.HELP_STATE_RM;case"state show":return t.HELP_STATE_SHOW;case"taint":return t.HELP_TAINT;case"untaint":return t.HELP_UNTAINT;case"version":return t.HELP_VERSION;case"suite":return t.HELP_SUITE;case"suite init":return t.HELP_SUITE_INIT;case"suite fill":return t.HELP_SUITE_FILL;case"suite link":return t.HELP_SUITE_LINK;case"suite mark":return t.HELP_SUITE_MARK;case"functions":return t.HELP_FUNCTIONS;default:return null}}},2043:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.LifecycleResolver=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=n(6028);const c=n(2978);class LifecycleResolver{globalDefaults={};scopeDefaults=new Map;workDir;constructor(e="."){this.workDir=e;this.loadDeclarations()}loadDeclarations(){const e=a.CONFIG_FILE_NAMES;for(const t of e){const e=(0,i.resolve)(this.workDir,t);if((0,r.existsSync)(e)){try{const t=o.default.parse((0,r.readFileSync)(e,"utf-8"));this.processParsedYaml(t)}catch{}}}const t=(0,c.findDomainConfigFiles)(this.workDir);for(const e of t){try{const t=o.default.parse((0,r.readFileSync)(e,"utf-8"));this.processParsedYaml(t)}catch{}}}processParsedYaml(e){if(!e||typeof e!=="object")return;const t=e.resource;if(t&&typeof t==="object"){for(const[e,n]of Object.entries(t)){if(n&&typeof n==="object"&&n.lifecycle){this.registerScopeLifecycle(e,n.lifecycle)}}}for(const t of["testcase","testrun","testplan","global"]){if(e[t]&&typeof e[t]==="object"&&e[t].lifecycle){this.registerScopeLifecycle(t,e[t].lifecycle)}}}registerScopeLifecycle(e,t){if(!t||typeof t!=="object")return;if(e==="global"){this.globalDefaults={prevent_destroy:t.prevent_destroy!==undefined?Boolean(t.prevent_destroy):this.globalDefaults.prevent_destroy,ignore_changes:Array.isArray(t.ignore_changes)?Array.from(new Set([...this.globalDefaults.ignore_changes||[],...t.ignore_changes])):this.globalDefaults.ignore_changes||[]};return}const n=this.scopeDefaults.get(e)||{};this.scopeDefaults.set(e,{prevent_destroy:t.prevent_destroy!==undefined?Boolean(t.prevent_destroy):n.prevent_destroy,ignore_changes:Array.isArray(t.ignore_changes)?Array.from(new Set([...n.ignore_changes||[],...t.ignore_changes])):n.ignore_changes||[]})}getLifecycle(e,t=[]){const n=(0,c.normalizeAddress)(e);let s=this.globalDefaults.prevent_destroy||false;let r=[...this.globalDefaults.ignore_changes||[]];for(const[e,t]of this.scopeDefaults.entries()){const i=e==="testcase"&&(n.includes(".case.")||n.includes("testcase"))||e==="testrun"&&(n.includes(".run.")||n.includes("testrun"))||e==="testplan"&&(n.includes(".plan.")||n.includes("testplan"))||n.includes(`.${e}.`)||n.startsWith(`${e}.`);if(i){if(t.prevent_destroy!==undefined)s=t.prevent_destroy;if(t.ignore_changes)r.push(...t.ignore_changes)}}for(const e of t){const t=e.startsWith("@")?e.substring(1):e;if(t==="prevent_destroy"||t==="prevent-destroy"){s=true}const n=t.match(/^ignore_changes\((.*)\)$/);if(n){const e=n[1].split(",").map((e=>e.trim().replace(/^['"]|['"]$/g,""))).filter(Boolean);r.push(...e)}}return{prevent_destroy:s,ignore_changes:Array.from(new Set(r))}}}t.LifecycleResolver=LifecycleResolver},1227:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.logger=t.Logger=void 0;const s=n(465);const r=n(4296);function cleanText(e){if(process.env.NO_COLOR==="1"){return e.replace(/\u001b\[[0-9;]*m/g,"")}return e}class Logger{verbose=false;isJson=false;constructor(e=false,t=false){this.verbose=e;this.isJson=t}print(e,t=false){const n=cleanText(e);if(t){console.error(n)}else{console.log(n)}}applyStyle(e,t){let n=e;if(t?.bold)n=(0,s.bold)(n);if(t?.dim)n=(0,s.dim)(n);return n}emitJson(e,t,n){const s={"@level":e,"@message":t,"@module":"testform.ui","@timestamp":(new Date).toISOString(),type:"log"};if(n){s.data=n}console.log(JSON.stringify(s))}formatMessage(e){return Array.isArray(e)?e.join("\n"):e}debug(e,t){if(!this.verbose)return;const n=this.formatMessage(e);if(this.isJson){this.emitJson("debug",n,t?.data);return}const r=t?.prefix!==false;const i=r?(0,s.dim)(`[DEBUG] `):"";const o=this.applyStyle(n,t);this.print(`${i}${(0,s.gray)(o)}`);if(t?.data)this.print((0,s.gray)(JSON.stringify(t.data,null,2)))}info(e,t){const n=this.formatMessage(e);if(this.isJson){this.emitJson("info",n,t?.data);return}const r=t?.prefix===true;const i=r?(0,s.cyan)(`[INFO] `):"";const o=this.applyStyle(n,t);this.print(`${i}${o}`);if(t?.data&&this.verbose)this.print((0,s.gray)(JSON.stringify(t.data,null,2)))}success(e,t){const n=this.formatMessage(e);if(this.isJson){this.emitJson("info",n,t?.data);return}const r=t?.prefix===true;const i=r?(0,s.green)(`[✓] `):"";const o=this.applyStyle((0,s.green)(n),t);this.print(`${i}${o}`);if(t?.data&&this.verbose)this.print((0,s.gray)(JSON.stringify(t.data,null,2)))}warn(e,t){const n=this.formatMessage(e);if(this.isJson){this.emitJson("warn",n,t?.data);return}this.print((0,s.yellow)("╷"),true);const r=(0,s.bold)((0,s.yellow)("Warning:"));const i=this.applyStyle(n,t);this.print(`${(0,s.yellow)("│")} ${r} ${i}`,true);if(t?.data&&this.verbose){this.print((0,s.yellow)("│"),true);const e=JSON.stringify(t.data,null,2);e.split("\n").forEach((e=>this.print(`${(0,s.yellow)("│")} ${e}`,true)))}this.print((0,s.yellow)("╵"),true)}error(e,t){const n=this.formatMessage(e);if(this.isJson){this.emitJson("error",n,t?t instanceof Error?t.stack:t:undefined);const e=new r.TestformError(n);e.logged=true;throw e}this.print((0,s.red)("╷"),true);const i=(0,s.bold)((0,s.red)("Error:"));const o=n.split("\n");this.print(`${(0,s.red)("│")} ${i} ${(0,s.bold)(o[0])}`,true);for(let e=1;e<o.length;e++){this.print(`${(0,s.red)("│")} ${o[e]}`,true)}if(t){this.print((0,s.red)("│"),true);if(t instanceof Error){this.print(`${(0,s.red)("│")} ${t.message}`,true);if(this.verbose&&t.stack){t.stack.split("\n").forEach((e=>this.print(`${(0,s.red)("│")} ${(0,s.dim)(e)}`,true)))}}else if(typeof t==="object"){const e=JSON.stringify(t,null,2);e.split("\n").forEach((e=>this.print(`${(0,s.red)("│")} ${e}`,true)))}else{this.print(`${(0,s.red)("│")} ${String(t)}`,true)}}this.print((0,s.red)("╵"),true);const a=new r.TestformError(n);a.logged=true;throw a}blank(){if(this.isJson)return;this.print("")}push(e){const t=e.type==="warning";const n=t?(0,s.bold)((0,s.yellow)("Warning:")):(0,s.bold)((0,s.red)("Error:"));const i=t?s.yellow:s.red;const o=(0,s.bold)(e.title);const a=e.close??false;if(this.isJson){this.emitJson(e.type==="warning"?"warn":"error",e.title,{detail:e.detail,extra:e.extra});if(a){const t=new r.TestformError(e.title);t.logged=true;throw t}return}this.print(i("╷"));this.print(`${i("│")} ${n} ${o}`);this.print(i("│"));if(e.detail){for(const t of e.detail){this.print(t?`${i("│")} ${t}`:i("│"))}}if(e.extra){for(const t of e.extra){this.print(`${i("│")} ${t}`)}}this.print(i("╵"));if(a){const t=new r.TestformError(e.title);t.logged=true;throw t}}refresh(e,t){if(this.isJson)return;const n=t?(0,s.dim)(`[id=${t}]`):"";this.print(`${(0,s.cyan)(e)}: Refreshing state... ${n}`)}}t.Logger=Logger;t.logger=new Logger},1859:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.ModuleRegistry=void 0;t.isGitSource=isGitSource;t.parseGitSource=parseGitSource;t.parseModuleTargets=parseModuleTargets;t.parseModuleTag=parseModuleTag;t.resolveModulePath=resolveModulePath;t.loadModuleSteps=loadModuleSteps;const r=n(6928);const i=n(9896);const o=n(119);const a=n(8569);const c=s(n(8815));const l=n(2978);const u=n(6028);class ModuleRegistry{declaredModules=new Map;workDir;constructor(e="."){this.workDir=e;this.loadDeclarations()}loadDeclarations(){for(const e of u.CONFIG_FILE_NAMES){const t=(0,r.resolve)(this.workDir,e);if((0,i.existsSync)(t)){try{const e=c.default.parse((0,i.readFileSync)(t,"utf-8"));if(e?.module&&typeof e.module==="object"){this.registerModules(e.module)}}catch{}}}const e=(0,l.findDomainConfigFiles)(this.workDir);for(const t of e){try{const e=c.default.parse((0,i.readFileSync)(t,"utf-8"));if(e?.module&&typeof e.module==="object"){this.registerModules(e.module)}}catch{}}}registerModules(e){const t=new Set(["source","version","scenario","id","providers","depends_on","count","for_each","lifecycle","output","outputs","variable"]);for(const[n,s]of Object.entries(e)){if(!s||typeof s!=="object")continue;const e={};for(const[n,r]of Object.entries(s)){if(!t.has(n)){e[n]=r}}const r=s.variable&&typeof s.variable==="object"?s.variable:{};const i={...e,...r};const o=Object.keys(i).length>0?i:undefined;this.declaredModules.set(n,{source:s.source||"",version:s.version||"",scenario:s.scenario||s.id,variable:o,output:s.output||s.outputs,outputs:s.output||s.outputs})}}getModule(e){return this.declaredModules.get(e)}getDeclaredModules(){return this.declaredModules}}t.ModuleRegistry=ModuleRegistry;function isGitSource(e){return e.startsWith("git::")||e.startsWith("git@")||e.startsWith("https://")&&e.includes(".git")}function parseGitSource(e){let t=e.replace(/^git::/,"");let n;const s=t.indexOf("?ref=");if(s!==-1){n=t.substring(s+5);t=t.substring(0,s)}let r;const i=t.indexOf("://");const o=i!==-1?i+3:0;const a=t.indexOf("//",o);if(a!==-1){r=t.substring(a+2);t=t.substring(0,a)}return{repoUrl:t,subPath:r,ref:n}}function parseVariableArgument(e){const t=e.indexOf("variable=");if(t===-1)return undefined;const n=e.indexOf("{",t);if(n===-1)return undefined;let s=0;let r=-1;for(let t=n;t<e.length;t++){if(e[t]==="{")s++;else if(e[t]==="}"){s--;if(s===0){r=t;break}}}if(r===-1)return undefined;const i=e.substring(n+1,r).trim();if(!i)return{};try{const e=c.default.parse(`{\n${i}\n}`);if(e&&typeof e==="object"){return e}}catch{const e={};const t=i.split(",");for(const n of t){const t=n.indexOf(":");if(t>0){const s=n.substring(0,t).trim().replace(/^['"]|['"]$/g,"");const r=n.substring(t+1).trim().replace(/^['"]|['"]$/g,"");e[s]=r}}return e}return undefined}function parseModuleTargets(e,t){if(!e.startsWith("@module"))return null;const n=e.match(/[,;]\s*(?:scenario|id)=['"]([^'"]+)['"]/i);const s=n?n[1].trim():undefined;const r=parseVariableArgument(e);const i=e.match(/name=['"]([^'"]+)['"]/i);const o=i?i[1].trim():undefined;const a=e.match(/@module\(source=\[([^\]]+)\]/i);if(a){return a[1].split(",").map((e=>e.trim().replace(/^['"]|['"]$/g,""))).filter(Boolean).map((e=>{if(e.includes(".feature.")){const t=e.indexOf(".feature.");return{source:e.slice(0,t+8).trim(),scenario:e.slice(t+9).trim(),variable:r}}return{source:e,scenario:s,variable:r}}))}if(o&&t){const e=t.getModule(o);if(e){const t={...e.variable||{},...r||{}};return[{name:o,source:e.source,scenario:s||e.scenario,variable:Object.keys(t).length>0?t:undefined}]}return[{name:o,source:o,scenario:s,variable:r}]}const c=e.match(/@module\(source=['"]([^'"]+)['"]/i);if(c){let e=c[1].trim();let n=s;if(t){const s=t.getModule(e);if(s){const t={...s.variable||{},...r||{}};return[{name:e,source:s.source,scenario:n||s.scenario,variable:Object.keys(t).length>0?t:undefined}]}}if(e.includes(".feature.")){const t=e.indexOf(".feature.");n=e.slice(t+9).trim();e=e.slice(0,t+8).trim()}return[{source:e,scenario:n,variable:r}]}const l=e.match(/@module\(['"]([^'"]+)['"]/i);if(l){let e=l[1].trim();let n=s;if(t){const s=t.getModule(e);if(s){const t={...s.variable||{},...r||{}};return[{name:e,source:s.source,scenario:n||s.scenario,variable:Object.keys(t).length>0?t:undefined}]}}if(e.includes(".feature.")){const t=e.indexOf(".feature.");n=e.slice(t+9).trim();e=e.slice(0,t+8).trim()}return[{source:e,scenario:n,variable:r}]}return null}function parseModuleTag(e,t){const n=parseModuleTargets(e,t);if(!n)return null;return n.map((e=>e.scenario?`${e.source}.${e.scenario}`:e.source))}function findFeatureInDir(e){try{const t=(0,i.readdirSync)(e);for(const n of t){if(n.endsWith(".feature")){return(0,r.resolve)(e,n)}}}catch{}return null}function resolveModulePath(e,t,n=process.cwd(),s){if(s){const r=s.getModule(t);if(r&&r.source){return resolveModulePath(e,r.source,n,undefined)}}const o=(0,r.resolve)((0,r.dirname)(e),t);if((0,i.existsSync)(o)){if((0,i.statSync)(o).isFile()){return o}const e=findFeatureInDir(o);if(e)return e}const a=(0,r.resolve)(n,t);if((0,i.existsSync)(a)){if((0,i.statSync)(a).isFile()){return a}const e=findFeatureInDir(a);if(e)return e}const c=(0,r.resolve)(n,".testform","modules",t);if((0,i.existsSync)(c)){if((0,i.statSync)(c).isFile()){return c}const e=findFeatureInDir(c);if(e)return e}return null}function loadModuleDirectoryDefaults(e){const t=(0,r.dirname)(e);const n={};for(const e of["variables.yml","variables.yaml",...u.CONFIG_FILE_NAMES]){const s=(0,r.join)(t,e);if((0,i.existsSync)(s)){try{const e=c.default.parse((0,i.readFileSync)(s,"utf-8"));const t=e?.variable;if(t&&typeof t==="object"){for(const[e,s]of Object.entries(t)){if(s&&typeof s==="object"&&"default"in s){n[e]=s.default}else if(s!==undefined){n[e]=s}}}}catch{}}}return n}function loadModuleSteps(e,t,n,s){try{let r=(0,i.readFileSync)(e,"utf-8");r=(0,l.sanitizeTagsWithSpaces)(r);const c=new o.Parser(new o.AstBuilder(a.IdGenerator.uuid()),new o.GherkinClassicTokenMatcher);const u=c.parse(r);const d=[];if(u.feature){const e=[];for(const t of u.feature.children||[]){if(t.background){for(const n of t.background.steps||[]){e.push({keyword:n.keyword,keywordType:n.keywordType,text:n.text})}}}for(const n of u.feature.children||[]){if(n.scenario){const s=n.scenario;if(t){const e=t.toLowerCase().trim();const n=e.startsWith("@")?e.slice(1):e;const r=(s.tags||[]).map((e=>e.name.toLowerCase().trim()));const i=r.some((t=>t===e||t===`@${n}`||t===n));const o=s.name.toLowerCase().trim()===e;if(!i&&!o){continue}}if(d.length===0&&e.length>0){d.push(...e)}for(const e of s.steps||[]){d.push({keyword:e.keyword,keywordType:e.keywordType,text:e.text})}if(t)break}}}const f=loadModuleDirectoryDefaults(e);const p={...f,...n||{}};return d.map((e=>{let t=e.text;for(const[e,n]of Object.entries(p)){const s=n!==null&&n!==undefined?String(n):"";t=t.split(`<${e}>`).join(s);t=t.split(`\${var.${e}}`).join(s);t=t.split(`\${${e}}`).join(s)}if(s&&typeof s.applyToTemplate==="function"){t=s.applyToTemplate(t)}return{...e,text:t}}))}catch{return[]}}},1533:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.OutputResolver=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=n(2978);const c=n(455);const l=n(6028);class OutputResolver{declaredOutputs={};workDir;dataResolver;constructor(e="."){this.workDir=e;this.dataResolver=new c.DataResolver(e);this.loadDeclarations()}loadDeclarations(){const e={};for(const t of l.CONFIG_FILE_NAMES){const n=(0,i.resolve)(this.workDir,t);if((0,r.existsSync)(n)){try{const t=o.default.parse((0,r.readFileSync)(n,"utf-8"));const s=t&&(t.output||t.outputs);if(s&&typeof s==="object"){Object.assign(e,this.normalizeDeclarations(s))}const i=t&&t.module;if(i&&typeof i==="object"){for(const[t,n]of Object.entries(i)){const s=n&&typeof n==="object"&&(n.output||n.outputs);if(s&&typeof s==="object"){const n=this.normalizeDeclarations(s);for(const[s,r]of Object.entries(n)){e[`module.${t}.${s}`]=r}}}}}catch{}}}for(const t of["output.yml","output.yaml","outputs.yml","outputs.yaml"]){const n=(0,i.resolve)(this.workDir,t);if((0,r.existsSync)(n)){try{const t=o.default.parse((0,r.readFileSync)(n,"utf-8"));if(t&&typeof t==="object"){const n=t.output||t.outputs||t;if(n&&typeof n==="object"){Object.assign(e,this.normalizeDeclarations(n))}}}catch{}}}const t=(0,a.findDomainConfigFiles)(this.workDir);for(const n of t){try{const t=o.default.parse((0,r.readFileSync)(n,"utf-8"));if(t&&typeof t==="object"){const s=n.replace(/\\/g,"/").includes("/modules/")||t.module;const r=t.module||this.extractModuleName(n);const i=t.output||t.outputs;if(i&&typeof i==="object"){const t=this.normalizeDeclarations(i);if(s&&r){for(const[n,s]of Object.entries(t)){e[`module.${r}.${n}`]=s}}else{Object.assign(e,t)}}const o=t.module;if(o&&typeof o==="object"){for(const[t,n]of Object.entries(o)){const s=n&&typeof n==="object"&&(n.output||n.outputs);if(s&&typeof s==="object"){const n=this.normalizeDeclarations(s);for(const[s,r]of Object.entries(n)){e[`module.${t}.${s}`]=r}}}}}}catch{}}this.declaredOutputs=e}extractModuleName(e){const t=e.replace(/\\/g,"/");const n=t.match(/\/modules\/([^\/]+)/);return n?n[1]:null}normalizeDeclarations(e){const t={};for(const[n,s]of Object.entries(e)){if(s===null||s===undefined)continue;if(typeof s==="object"&&"value"in s){t[n]={value:s.value,description:s.description,sensitive:Boolean(s.sensitive)}}else{t[n]={value:s}}}return t}getDeclarations(){return this.declaredOutputs}resolve(e,t){const n={};const s=t?t.getVars():{};const r=t?t.getLocals():{};const i=e.getResources();for(const[t,o]of Object.entries(this.declaredOutputs)){const a=o.value;const c=this.evaluateValue(a,i,s,r,e);const l=Array.isArray(c)?"tuple":typeof c;n[t]={value:c,type:l,description:o.description,sensitive:o.sensitive}}return n}evaluateValue(e,t,n,s,r){if(typeof e!=="string"){return e}const i=e.trim().match(/^\$\{([^\}]+)\}$/);if(i){return this.resolveExpression(i[1],t,n,s,r)}const o=/\$\{([^\}]+)\}/g;return e.replace(o,((e,i)=>{const o=this.resolveExpression(i,t,n,s,r);if(o===undefined||o===null)return"";if(typeof o==="object")return JSON.stringify(o);return String(o)}))}resolveExpression(e,t,n,s,r){const i=e.trim();if(i.startsWith("var.")){const e=i.substring(4);return n[e]!==undefined?n[e]:`\${${i}}`}if(i.startsWith("local.")){const e=i.substring(6);return s[e]!==undefined?s[e]:`\${${i}}`}if(i.startsWith("data.")){const e=i.substring(5);const t=this.dataResolver.resolvePath(e,r);if(t!==undefined){return t}}if(i.startsWith("module.")){if(r){const e=r.getOutputs?r.getOutputs():r.outputs;if(e&&e[i]){return e[i].value}}if(this.declaredOutputs[i]){return this.evaluateValue(this.declaredOutputs[i].value,t,n,s,r)}return`\${${i}}`}const o=i.lastIndexOf(".");if(o>0){const e=i.substring(0,o);const n=i.substring(o+1);const s=t.find((t=>{if((0,a.addressesMatch)(t.identity,e))return true;if((0,a.addressesMatch)(`${t.type}.${t.identity}`,e))return true;const n=e.replace(/^(github_|local_)?(testcase|testrun|testplan)\./,"");if((0,a.addressesMatch)(t.identity,n))return true;return false}));if(s){return this.extractResourceAttribute(s,n)}}return`\${${i}}`}extractResourceAttribute(e,t){const n=e.attributes||{};switch(t){case"id":case"remoteId":return n.remoteId||n.id||"";case"number":case"issueNumber":return n.issueNumber!==undefined?n.issueNumber:0;case"url":return n.url||(n.issueNumber?`https://github.com/issues/${n.issueNumber}`:"");case"title":return n.title||"";case"body":return n.body||"";case"labels":case"tags":return n.labels||[];case"status":return n.status||"";case"assignees":return n.assignees||[];case"milestone":return n.milestone||"";case"testcaseStatuses":return n.testcaseStatuses||{};case"testcaseCommentIds":return n.testcaseCommentIds||{};case"createdAt":return n.createdAt||"";case"updatedAt":return n.updatedAt||"";default:if(n[t]!==undefined)return n[t];if(n.custom_fields&&n.custom_fields[t]!==undefined){return n.custom_fields[t]}return undefined}}format(e,t={}){const{json:n,raw:s,name:r}=t;if(r){const t=e[r];if(!t){throw new Error(`The state has no output named "${r}".`)}if(s){if(t.value===undefined||t.value===null)return"";if(typeof t.value==="object")return JSON.stringify(t.value);return String(t.value)}if(n){return JSON.stringify({sensitive:Boolean(t.sensitive),type:t.type||typeof t.value,value:t.value},null,2)}return`${r} = ${(0,a.formatHclValue)(t.value,0)}`}if(n){const t={};for(const[n,s]of Object.entries(e)){t[n]={sensitive:Boolean(s.sensitive),type:s.type||(Array.isArray(s.value)?"tuple":typeof s.value),value:s.value}}return JSON.stringify(t,null,2)}const i=[];const o=Object.keys(e).sort();if(o.length===0){return"Warning: No outputs found in the given state."}let c=0;for(const e of o){if(e.length>c)c=e.length}for(const t of o){const n=e[t];const s=" ".repeat(c-t.length);const r=n.sensitive?"(sensitive value)":(0,a.formatHclValue)(n.value,0);i.push(`${t}${s} = ${r}`)}return i.join("\n")}}t.OutputResolver=OutputResolver},5392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Parser=void 0;const s=n(1043);const r=n(3800);const i=n(2853);const o=n(1741);class ReaderParser extends s.BaseParser{filter(e){return e}}class Parser{dir;variables;reader;constructor(e,t){this.dir=e;this.variables=t;this.reader=new ReaderParser(e,t)}content(){return this.reader.content()}filter(e,t,n){let s;switch(n){case"testcase":s=new r.TestcaseParser(this.dir,this.variables);break;case"testrun":s=new i.TestrunParser(this.dir,this.variables);break;case"testplan":s=new o.TestplanParser(this.dir,this.variables);break;default:s=new r.TestcaseParser(this.dir,this.variables)}return s.filter(e,t,n)}}t.Parser=Parser},2721:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.registerPolicy=t.policy=void 0;const s=n(9896);const r=n(6928);const i=n(7016);const o=n(1227);const a=n(1227);class Policy{builtinPolicies={};userPolicies={};disabledPolicies=new Set;resolve(e){const t=Object.values(this.builtinPolicies);const n=Object.values(this.userPolicies);return[...t,...n].filter((t=>t.scope.includes(e)&&!this.disabledPolicies.has(t.id)))}registry(e,t="system"){if(t==="system"){this.builtinPolicies[e.id]=e}if(t==="user"){this.userPolicies[e.id]=e}}enable(e){this.disabledPolicies.delete(e);return true}disable(e){this.disabledPolicies.add(e);return true}isEnabled(e){return!this.disabledPolicies.has(e)}get(e){const t=this.builtinPolicies[e];if(t){return{id:t.id,type:"system",scope:t.scope,description:t.description||"",enabled:this.isEnabled(t.id)}}const n=this.userPolicies[e];if(n){return{id:n.id,type:"user",scope:n.scope,description:n.description||"",enabled:this.isEnabled(n.id)}}return undefined}getAll(){const e=[];for(const t of Object.values(this.builtinPolicies)){e.push({id:t.id,type:"system",scope:t.scope,description:t.description||"",enabled:this.isEnabled(t.id)})}for(const t of Object.values(this.userPolicies)){e.push({id:t.id,type:"user",scope:t.scope,description:t.description||"",enabled:this.isEnabled(t.id)})}return e.sort(((e,t)=>e.id.localeCompare(t.id)))}configure(e){if(!e||typeof e!=="object")return;if(Array.isArray(e.disabled)){for(const t of e.disabled){if(typeof t==="string")this.disable(t.trim())}}if(Array.isArray(e.enabled)){for(const t of e.enabled){if(typeof t==="string")this.enable(t.trim())}}for(const[t,n]of Object.entries(e)){if(t==="disabled"||t==="enabled")continue;if(n===false||n&&typeof n==="object"&&n.enabled===false){this.disable(t)}else if(n===true||n&&typeof n==="object"&&n.enabled===true){this.enable(t)}}}async loadCustomPolicies(e){const t=[(0,r.resolve)(e,".testform","policies"),(0,r.resolve)(e,"policies")];const n=(0,r.resolve)(e,".testform","modules");if((0,s.existsSync)(n)){try{const e=(0,s.readdirSync)(n,{withFileTypes:true});for(const s of e){if(s.isDirectory()){t.push((0,r.resolve)(n,s.name,"policies"));t.push((0,r.resolve)(n,s.name,".testform","policies"))}}}catch{}}const i=[".js",".mjs",".cjs",".ts"];for(const e of t){if(!(0,s.existsSync)(e))continue;try{const t=(0,s.readdirSync)(e,{withFileTypes:true});for(const n of t){if(n.isFile()){const t=(0,r.extname)(n.name).toLowerCase();if(i.includes(t)){const t=(0,r.resolve)(e,n.name);await this.loadPolicyFile(t)}}}}catch{}}}async loadPolicyFile(e){let t;try{t=await n(195)((0,i.pathToFileURL)(e).href)}catch{try{t=require(e)}catch{return}}const s=t?.default||t;if(!s)return;if(s.id&&Array.isArray(s.scope)&&typeof s.action==="function"){this.registry(s,"user");return}if(Array.isArray(s)){for(const e of s){if(e?.id&&Array.isArray(e.scope)&&typeof e.action==="function"){this.registry(e,"user")}}return}if(typeof s==="function"){try{s({registerPolicy:e=>this.registry(e,"user"),policy:this})}catch{}}}scanner(e,t,n=false,s=false){const r=[];const i=this.resolve(t);for(const n of i){try{n.action(e,r,t)}catch(e){const t=e instanceof Error?e.message:"Unknown policy execution error";r.push({id:`policy-runtime-error:${n.id}`,title:`Policy "${n.id}" failed during execution.`,detail:t,uri:"(policy-runtime)"})}}if(n){if(r.length>0){const e={valid:false,error_count:r.length,warning_count:0,diagnostics:r.map((e=>({severity:e.type??"error",summary:e.title,detail:e.detail})))};console.log(JSON.stringify(e,null,2));process.exit(1)}return}if(r.length>0){o.logger.info("Review the violations above and fix them before continuing.",{bold:true});o.logger.info(`${r.length} policy violation${r.length>1?"s":""} found:\n`,{bold:true})}let c=0;for(const e of r){const t=e.type==="warning";if(t)c++;if(t&&s)continue;let n=`on ${e.uri}`;if(e.line!==undefined)n+=` line ${e.line}`;if(e.scenario)n+=`, in scenario "${e.scenario}"`;a.logger.push({type:e.type??"error",title:e.title,detail:[e.detail,n]})}if(c>0&&s){o.logger.warn(`\n${c} warning(s) found. (Details suppressed by -compact-warnings)`)}return r.length>0}}t.policy=new Policy;const registerPolicy=e=>t.policy.registry(e,"user");t.registerPolicy=registerPolicy;t.policy.registry({id:"undeclared-fields",description:"Warns about scenario fields not declared in configuration",scope:["testcase"],action:(e,t,n)=>{for(const n of e){for(const e of n.custom?.policy?.filter((e=>e.type==="undeclared-field"))??[]){t.push({id:"undeclared-field",type:"warning",title:`Value for undeclared field "${e.field}"`,detail:`Field "${e.field}" is not declared in the configuration. Add a "fields" entry to your config.`,uri:n.uri,scenario:n.name,line:n.location})}}}});t.policy.registry({id:"required-fields",description:"Ensures required fields defined in configuration are present",scope:["testcase","testrun","testplan"],action:(e,t,n)=>{for(const n of e){for(const e of n.custom?.policy?.filter((e=>e.type==="required-field"))??[]){t.push({id:"required-field-missing",title:`Required field "${e.field}" is missing`,detail:`Add a step: "field ${e.field} = <value>" to the scenario.`,uri:n.uri,scenario:n.name,line:n.location})}}}});t.policy.registry({id:"required-gherkin",description:"Validates required Gherkin structure and keywords (Given, When, Then)",scope:["testcase"],action:(e,t,n)=>{const s=["scenario","scenario outline"];for(const n of e){if(!n.feature.name||n.feature.name.trim()===""){t.push({id:"feature-name-required",title:"Feature name is required",detail:"Every feature must have a name. Add a descriptive name after 'Feature'.",uri:n.uri,line:n.location})}if(!n.name||n.name.trim()===""){t.push({id:"scenario-name-required",title:"Scenario name is required",detail:"Every scenario must have a name. Add a descriptive name after 'Scenario:' or 'Scenario Outline:'.",uri:n.uri,line:n.location});continue}if(!s.includes(n.keyword.trim().toLowerCase()))continue;const e=[...n.background?.steps??[],...n.steps];const r=[];if(!e.some((e=>e.keyword.trim().toLowerCase()==="given")))r.push("Given");if(!e.some((e=>e.keyword.trim().toLowerCase()==="when")))r.push("When");if(!e.some((e=>e.keyword.trim().toLowerCase()==="then")))r.push("Then");if(r.length>0){t.push({id:"steps-required",title:`Scenario is missing required step types: ${r.join(", ")}.`,detail:"Each scenario must have at least one Given, When, and Then step.",uri:n.uri,scenario:n.name,line:n.location})}}}});t.policy.registry({id:"no-feature-tags",description:"Restricts non-standard tags at the Feature level",scope:["testcase","testrun","testplan"],action:(e,t,n)=>{const s=`@${n}`;const r=new Set;for(const i of e){const e=i.uri??"(unknown)";if(r.has(e))continue;r.add(e);const o=["@testcase","@testrun","@testplan"];const a=[...o];if(i.custom?.identity){a.push(i.custom.identity.toLowerCase())}const c=i.feature?.tags??[];const l=c.filter((e=>!a.includes(e.toLowerCase())));if(l.length>0){t.push({id:"no-feature-tags",title:`Feature-level tags are not allowed in ${e} scope (found: ${l.join(", ")}).`,detail:"Move any tags from Feature: to the individual Scenario level, except for scope tags and identity tags.",uri:e})}const u=c.filter((e=>o.includes(e.toLowerCase())));for(const r of u){if(r.toLowerCase()!==s){t.push({id:"invalid-scope-tag",title:`Mismatched scope: file is tagged as ${r} but is being processed as ${s}.`,detail:`A feature file designed for ${r} cannot be executed in -scope ${n}.`,uri:e})}}}}});t.policy.registry({id:"identity-required",description:"Enforces identity tags (@tc-X, @tr-X, @tp-X)",scope:["testcase","testrun","testplan"],action:(e,t,n)=>{for(const s of e??[]){const e=s.custom?.identity;if(!e||e.trim()===""||e===s.uri){t.push({id:"identity-required",title:n==="testcase"?"Every scenario must have an identity tag matching the configured identity pattern.":"Every feature must have an identity tag matching the configured identity pattern.",detail:n==="testcase"?"Add the identity tag (e.g. @tc-1) to each scenario.":"Add the identity tag (e.g. @tr-1) to the Feature level.",uri:s.uri??"(unknown)",scenario:n==="testcase"?s.name:undefined,line:n==="testcase"?s.location:s.feature?.location??s.location});continue}if(n==="testrun"||n==="testplan"){const r=s.feature?.tags??[];const i=r.some((t=>t.toLowerCase()===e.toLowerCase()));if(!i){t.push({id:"identity-feature-level-required",title:`The identity tag ${e} must be declared at the Feature level.`,detail:`Move the identity tag ${e} so it is placed next to the @${n} tag before the 'Feature:' keyword.`,uri:s.uri??"(unknown)",line:s.feature?.location??s.location})}}}}});t.policy.registry({id:"identity-unique",description:"Verifies identity tag uniqueness within scope",scope:["testcase","testrun","testplan"],action:(e,t,n)=>{const s=new Map;for(const t of e){const e=t.custom?.identity?.trim();if(!e)continue;if(e===t.uri)continue;const r={scenario:t.name,line:t.location,keyword:t.keyword||"",uri:t.uri||""};const i=n==="testcase"?`${t.uri}.${e}`:e;const o=s.get(i);if(o){o.push(r)}else{s.set(i,[r])}}for(const[r,i]of s){if(i.length<=1)continue;const s=r.lastIndexOf(".");const o=s!==-1?r.slice(s+1):r;const a=i.every((e=>(e.keyword||"").trim()==="Scenario Outline"))&&i.every((e=>e.line===i[0].line&&e.uri===i[0].uri));if(a){t.push({id:"unique-key-required",title:`Scenario Outline expanded ${i.length} rows but all share the same identity "${o}".`,detail:"Add a <key> inside the identity tag (e.g. @tc-<key>) so each expanded row has a unique identity.",uri:i[0].uri,scenario:i[0].scenario,line:i[0].line});continue}for(const s of i){let r="";const i=o.match(/^(@[a-zA-Z0-9-]+?)-?(\d+)(.*)$/);if(i){const t=i[1]+(o.includes("-")?"-":"");const a=i[3];let c=0;for(const r of e){if(n==="testcase"&&r.uri!==s.uri)continue;const e=r.custom?.identity?.trim();if(e&&e!==r.uri){const n=e.match(new RegExp(`^${t}(\\d+)${a}$`));if(n){const e=parseInt(n[1],10);if(e>c)c=e}}}if(c>0){r=` The next available identity ${n==="testcase"?"in this file ":""}is ${t}${c+1}${a}.`}}t.push({id:"identity-unique",title:n==="testcase"?`Duplicate identity "${o}" found in the same file.`:`Duplicate identity "${o}" found.`,detail:(n==="testcase"?"Each scenario within a file must have a unique identity tag.":"Each element must have a globally unique identity tag in the workspace.")+r,uri:s.uri,scenario:s.scenario,line:s.line})}}}});t.policy.registry({id:"duplicate-testruns-in-testplan",description:"Prevents duplicate testruns inside the same or across testplans",scope:["testplan"],action:(e,t,n)=>{const s=new Map;for(const n of e){const e=n.custom?.testruns||[];const r=new Set;const i=new Set;for(const t of e){if(r.has(t)){i.add(t)}else{r.add(t)}const e=t.trim();const o={uri:n.uri,scenario:n.name,line:n.location};if(!s.has(e)){s.set(e,[])}s.get(e).push(o)}if(i.size>0){t.push({id:"duplicate-testruns-in-testplan",title:`Duplicate testruns defined in the same testplan: ${Array.from(i).join(", ")}`,detail:`Remove the duplicate Rule declarations from this testplan.`,uri:n.uri,scenario:n.name,line:n.location})}}for(const[e,n]of s){if(n.length>1){const s=new Set(n.map((e=>e.uri)));if(s.size>1){for(const r of n){const n=Array.from(s).filter((e=>e!==r.uri));t.push({id:"duplicate-testruns-across-testplans",title:`Testrun "${e}" is declared in multiple testplans`,detail:`This testrun is also declared in: ${n.join(", ")}. A testrun should only belong to one testplan.`,uri:r.uri,scenario:r.scenario,line:r.line})}}}}}})},5301:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.askConfirmation=askConfirmation;t.askApproval=askApproval;t.askDestroyApproval=askDestroyApproval;t.askMigrationApproval=askMigrationApproval;t.isInteractive=isInteractive;t.askInput=askInput;t.askBackendAttribute=askBackendAttribute;t.askSelect=askSelect;t.askStatus=askStatus;const s=n(3785);const r=n(465);const i=n(6028);async function askConfirmation(e){const t=(0,s.createInterface)({input:process.stdin,output:process.stdout});return new Promise((n=>{console.log("");for(const t of e){console.log(t)}console.log(` ${i.MSG_APPROVE_ONLY_YES}`);console.log("");t.question(" Enter a value: ",(e=>{t.close();console.log("");n(e.trim().toLowerCase()==="yes")}))}))}async function askApproval(){return askConfirmation(["Do you want to perform these actions?",` ${i.TITLE_APP} will perform the actions described above.`])}async function askDestroyApproval(e,t){const n=t?` in scope '${t}'`:"";return askConfirmation([(0,r.red)((0,r.bold)(`${i.TITLE_APP} will destroy ${e} resource(s)${n}.`))," This action cannot be undone."])}async function askMigrationApproval(e){const t=(0,s.createInterface)({input:process.stdin,output:process.stdout});return new Promise((n=>{console.log("");console.log((0,r.bold)("Do you want to copy existing state to the new backend?"));console.log(" Pre-existing state was found while migrating the previous");console.log(` backend to the newly configured "${e}" backend.`);console.log(" Do you want to copy this state to the new backend?");console.log(' Enter "yes" to copy and "no" to start with an empty state.');console.log("");t.question(" Enter a value: ",(e=>{t.close();console.log("");n(e.trim().toLowerCase()==="yes")}))}))}function isInteractive(){return Boolean(process.stdin.isTTY&&!process.env.CI)}async function askInput(e,t){const n=(0,s.createInterface)({input:process.stdin,output:process.stdout});const r=t?`${e} [${t}]: `:`${e}: `;return new Promise((e=>{n.question(` ${r}`,(s=>{n.close();const r=s.trim();e(r||t||"")}))}))}async function askBackendAttribute(e,t){const n=(0,s.createInterface)({input:process.stdin,output:process.stdout});return new Promise((s=>{console.log(e);console.log(` ${t}`);console.log("");n.question(" Enter a value: ",(e=>{n.close();console.log("");s(e.trim())}))}))}async function askSelect(e,t){console.log(`\n${(0,r.bold)(e)}`);t.forEach(((e,t)=>{console.log(` ${(0,r.bold)(`${t+1}.`)} ${e.label}`)}));console.log("");const n=(0,s.createInterface)({input:process.stdin,output:process.stdout});return new Promise((e=>{const ask=()=>{n.question(` Select an option (1-${t.length}): `,(s=>{const r=parseInt(s.trim(),10);if(r>=1&&r<=t.length){n.close();e(t[r-1].value)}else{console.log(` Invalid option. Please enter a number between 1 and ${t.length}.`);ask()}}))};ask()}))}async function askStatus(e="passed"){return askSelect("Select the status:",[{label:"passed - Prueba ejecutada con éxito",value:"passed"},{label:"failed - Prueba fallida",value:"failed"},{label:"pending - Pendiente de ejecución",value:"pending"},{label:"skipped - Prueba omitida",value:"skipped"}])}},363:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.StateQuery=void 0;const s=n(7066);const r=n(2978);const i=n(7442);class StateQuery{dir;statePath;backupPath;stateObj;initialized=false;allResources=[];normalizedItems=[];constructor(e=".",t,n){this.dir=e;this.statePath=t;this.backupPath=n;this.stateObj=new s.State(this.dir,this.statePath,this.backupPath)}async init(){if(this.initialized)return;await this.stateObj.init();const e=this.stateObj.getState?this.stateObj.getState():null;if(e&&Array.isArray(e.resources)){this.allResources=e.resources}else if(typeof this.stateObj.getResources==="function"){const e=[...this.stateObj.getResources("github_testcase")||[],...this.stateObj.getResources("testcase")||[],...this.stateObj.getResources("github_testrun")||[],...this.stateObj.getResources("testrun")||[],...this.stateObj.getResources("github_testplan")||[],...this.stateObj.getResources("testplan")||[],...this.stateObj.getResources()||[]];const t=new Set;this.allResources=e.filter((e=>{if(!e||!e.identity||t.has(e.identity))return false;t.add(e.identity);return true}))}this.normalize();this.initialized=true}getResources(){return this.allResources}getItems(){return this.normalizedItems}getCanonicalScope(e){if(e.includes("_"))return e.split("_").slice(1).join("_");return e}normalize(){const e=this.allResources.filter((e=>this.getCanonicalScope(e.type)==="testrun"));const t=this.allResources.filter((e=>this.getCanonicalScope(e.type)==="testcase"));const n=this.allResources.filter((e=>this.getCanonicalScope(e.type)==="testplan"));const s=new Map;for(const t of e){const e=t.attributes.testcaseStatuses||{};for(const[n,r]of Object.entries(e)){if(!s.has(n)){s.set(n,[])}s.get(n).push({status:r,testRunId:t.identity})}}const r=[];const i=new Set;for(const[e,n]of s.entries()){const s=t.find((t=>t.identity===e));if(!s)continue;i.add(e);for(const e of n){r.push(this.toQueryItem(s,e.status,e.testRunId))}}for(const e of t){if(!i.has(e.identity)){r.push(this.toQueryItem(e,String(e.attributes.status||"unexecuted"),""))}}for(const t of[...e,...n]){const e=this.getCanonicalScope(t.type);const n=t.attributes.status?String(t.attributes.status):t.attributes.issueNumber?"active":"unexecuted";r.push(this.toQueryItem(t,n,e==="testrun"?t.identity:""))}this.normalizedItems=r}filterByTarget(e,t){if(!e)return t?[...t]:[...this.normalizedItems];const n=t?[...t]:[...this.normalizedItems];const s=(Array.isArray(e)?e:[e]).map((e=>typeof e==="string"?e.trim():"")).filter(Boolean);if(s.length===0)return n;const r=new Set;const o=new Set;for(const e of s){const t=this.allResources.filter((t=>(0,i.matchesTarget)(t.identity,e)));for(const e of t){const t=this.getCanonicalScope(e.type);if(t==="testplan"){r.add(e.identity);const t=e.attributes.testruns||[];for(const e of t){const t=this.allResources.filter((t=>this.getCanonicalScope(t.type)==="testrun"&&((0,i.matchesTarget)(t.identity,e)||t.identity.endsWith(e))));for(const e of t){o.add(e.identity);r.add(e.identity)}o.add(e)}}else if(t==="testrun"){o.add(e.identity);r.add(e.identity)}else{r.add(e.identity)}}if(e.startsWith("@tr-")||e.includes(".run.feature")){o.add(e)}}return n.filter((e=>{if(r.has(e.id))return true;if(s.some((t=>(0,i.matchesTarget)(e.id,t))))return true;if(e.testRunId){if(o.has(e.testRunId))return true;if(Array.from(o).some((t=>e.testRunId.endsWith(t)||t.endsWith(e.testRunId))))return true;if(s.some((t=>(0,i.matchesTarget)(e.testRunId,t))))return true}return false}))}toQueryItem(e,t,n){const s=this.getCanonicalScope(e.type);const r=e.attributes.custom_fields||{};const i={};for(const[e,t]of Object.entries(r)){i[e.toLowerCase()]=String(t)}const o=Array.isArray(e.attributes.labels)?e.attributes.labels.map(String):e.attributes.labels?String(e.attributes.labels).split(","):[];const a=Array.isArray(e.attributes.assignees)?e.attributes.assignees.map(String):e.attributes.assignees?String(e.attributes.assignees).split(","):[];return{id:e.identity,type:e.type,canonicalScope:s,title:String(e.attributes.title||""),status:t||"unexecuted",issueNumber:e.attributes.issueNumber,remoteId:e.attributes.remoteId,labels:o,assignees:a,milestone:e.attributes.milestone?String(e.attributes.milestone):undefined,testRunId:n||undefined,custom_fields:i,createdAt:String(e.attributes.createdAt||e.lastApplied||(new Date).toISOString()),updatedAt:String(e.attributes.updatedAt||e.lastApplied||(new Date).toISOString()),lastApplied:e.lastApplied,tainted:Boolean(e.tainted),originalResource:e}}filter(e=[],t){let n=t?[...t]:[...this.normalizedItems];const s=Array.isArray(e)?e:[e];for(const e of s){if(!e||typeof e!=="string")continue;const t=e.trim();if(!t)continue;const s=t.indexOf("=");if(s!==-1){const e=t.slice(0,s).trim().toLowerCase();const i=t.slice(s+1).trim().toLowerCase();if(!e||!i)continue;if(e==="scope"){n=n.filter((e=>e.canonicalScope===i||e.type.toLowerCase().includes(i)))}else if(e==="status"){n=n.filter((e=>e.status.toLowerCase()===i))}else if(e==="label"||e==="tag"||e==="labels"||e==="tags"){const e=i.startsWith("@")?i.slice(1):i;n=n.filter((t=>t.labels.some((t=>{const n=t.startsWith("@")?t.slice(1).toLowerCase():t.toLowerCase();return n===e}))))}else if(e==="assignee"||e==="assignees"){n=n.filter((e=>e.assignees.some((e=>e.toLowerCase().includes(i)))))}else if(e==="milestone"){n=n.filter((e=>e.milestone&&e.milestone.toLowerCase().includes(i)))}else if(e==="testrun"||e==="testrunid"){n=n.filter((e=>e.testRunId&&e.testRunId.toLowerCase().includes(i)))}else if(e==="search"){n=n.filter((e=>e.id.toLowerCase().includes(i)||e.title.toLowerCase().includes(i)||e.labels.some((e=>e.toLowerCase().includes(i)))))}else{n=n.filter((t=>{const n=t.custom_fields[e];if(n!==undefined&&n.toLowerCase()===i){return true}const s=(0,r.resolvePath)(t.originalResource,e)??(0,r.resolvePath)(t.originalResource,`attributes.${e}`);if(s!==undefined&&String(s).toLowerCase()===i){return true}return false}))}}else{const e=t.toLowerCase();n=n.filter((t=>t.id.toLowerCase().includes(e)||t.title.toLowerCase().includes(e)||t.labels.some((t=>t.toLowerCase().includes(e)))))}}return n}group(e,t){if(!t)return{all:e};const n={};const s=t.trim().toLowerCase();for(const t of e){let e="";if(s==="status"){e=t.status}else if(s==="label"||s==="labels"||s==="tags"||s==="tag"){if(t.labels.length===0){e="untagged";if(!n[e])n[e]=[];n[e].push(t);continue}for(const e of t.labels){if(!n[e])n[e]=[];n[e].push(t)}continue}else if(s==="assignee"||s==="assignees"){e=t.assignees[0]||"unassigned"}else if(s==="milestone"){e=t.milestone||"none"}else if(s==="feature"||s==="requirement"){e=t.id.includes(".")?t.id.slice(0,t.id.lastIndexOf(".")):t.id}else if(s==="testrun"||s==="testrunid"){e=t.testRunId||"none"}else{e=t.custom_fields[s]||String((0,r.resolvePath)(t.originalResource,s)??(0,r.resolvePath)(t.originalResource,`attributes.${s}`)??"other")}if(!n[e])n[e]=[];n[e].push(t)}return n}getStats(e){const t={total:0,passed:0,failed:0,pending:0,blocked:0,skipped:0,unexecuted:0,totalRuns:0,activeRuns:0,closedRuns:0,totalPlans:0};const n=e.filter((e=>e.canonicalScope==="testcase"));const s=new Set(e.filter((e=>e.canonicalScope==="testrun")).map((e=>e.id)).concat(e.map((e=>e.testRunId)).filter(Boolean)));const r=new Set(e.filter((e=>e.canonicalScope==="testplan")).map((e=>e.id)));const i=this.allResources.filter((e=>this.getCanonicalScope(e.type)==="testrun"));const o=this.allResources.filter((e=>this.getCanonicalScope(e.type)==="testplan"));const a=s.size>0?i.filter((e=>s.has(e.identity)||Array.from(s).some((t=>e.identity.endsWith(t)||t.endsWith(e.identity))))):i;const c=r.size>0?o.filter((e=>r.has(e.identity))):o;t.total=n.length;for(const e of n){const n=e.status.toLowerCase();if(n==="passed")t.passed++;else if(n==="failed")t.failed++;else if(n==="pending")t.pending++;else if(n==="blocked")t.blocked++;else if(n==="skipped")t.skipped++;else t.unexecuted++}t.totalRuns=a.length;t.activeRuns=a.filter((e=>e.attributes.state==="open"||e.attributes.status==="open")).length;t.closedRuns=a.filter((e=>e.attributes.state==="closed"||e.attributes.status==="closed")).length;t.totalPlans=c.length;return t}}t.StateQuery=StateQuery},7862:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.registerResource=t.resource=void 0;const s=n(9896);const r=n(6928);const i=n(7016);const o=n(6028);const a=n(1227);const c=n(465);const l=n(2978);class Resource{builtinTemplates=Object.create(null);userTemplates=Object.create(null);resolve(){const e={...this.builtinTemplates,...this.userTemplates};return Object.values(e)}findTemplate(e){const t=this.resolve();let n=t.find((t=>t.type===e));if(!n&&e.includes("_")){const s=e.split("_").slice(1).join("_");n=t.find((e=>e.type===s||e.type.endsWith(`_${s}`)))}if(!n){n=t.find((t=>t.type.endsWith(`_${e}`)))}return n}get(e){const t=this.findTemplate(e);if(!t){const t=this.resolve();a.logger.push({type:"error",title:`Unknown resource type: "${e}"`,detail:[`No template is registered for resource type "${e}".`,`Available types: ${t.map((e=>e.type)).join(", ")||"(none)"}`],close:true})}return t}getRegisteredTypes(){const e=new Set;for(const t of this.resolve()){e.add(t.type);if(t.type.includes("_")){e.add(t.type.split("_").slice(1).join("_"))}}return Array.from(e)}registry(e,t="system"){if(t==="system"){this.builtinTemplates[e.type]=e;return}if(t==="user"){const t=this.findTemplate(e.type);if(t){const n=t.fields||[];const s=new Map(n.map((e=>[e.name,e])));for(const t of e.fields||[]){s.set(t.name,t)}const r={...t,...e,fields:Array.from(s.values())};this.userTemplates[e.type]=r;if(t.type!==e.type){this.userTemplates[t.type]=r}}else{this.userTemplates[e.type]=e}return}}async loadCustomResources(e){const t=[(0,r.resolve)(e,".testform","resources"),(0,r.resolve)(e,"resources")];const n=(0,r.resolve)(e,".testform","modules");if((0,s.existsSync)(n)){try{const e=(0,s.readdirSync)(n,{withFileTypes:true});for(const s of e){if(s.isDirectory()){t.push((0,r.resolve)(n,s.name,"resources"));t.push((0,r.resolve)(n,s.name,".testform","resources"))}}}catch{}}const i=[".js",".mjs",".cjs",".ts"];for(const e of t){if(!(0,s.existsSync)(e))continue;try{const t=(0,s.readdirSync)(e,{withFileTypes:true});for(const n of t){if(n.isFile()){const t=(0,r.extname)(n.name).toLowerCase();if(i.includes(t)){const t=(0,r.resolve)(e,n.name);await this.loadResourceFile(t)}}}}catch{}}}async loadResourceFile(e){let t;try{t=await n(195)((0,i.pathToFileURL)(e).href)}catch{try{t=require(e)}catch{return}}const s=t?.default||t;if(!s)return;if(s.type&&Array.isArray(s.fields)){this.registry(s,"user");return}if(Array.isArray(s)){for(const e of s){if(e?.type&&Array.isArray(e.fields)){this.registry(e,"user")}}return}if(typeof s==="function"){try{s({registerResource:e=>this.registry(e,"user"),resource:this})}catch{}}}evaluate(e,t,n){const s=this.get(e);const r={};for(const e of s.fields){if(e.knownAfterApply)continue;r[e.name]=typeof e.value==="function"?e.value(t,n):e.value}return r}evaluateComments(e,t,n){const s=this.get(e);if(s.comments){return s.comments(t,n)}return[]}getSymbol(e){const t={add:(0,c.green)("+"),change:(0,c.yellow)("~"),destroy:(0,c.red)("-"),replace:`${(0,c.red)("-")}/${(0,c.green)("+")}`}[e];return t}getSymbols(e){const t=new Set(e.map((e=>e.action)));const n={add:`${(0,c.green)("+")} create`,change:`${(0,c.yellow)("~")} update in-place`,destroy:`${(0,c.red)("-")} destroy`,replace:`${(0,c.red)("-")}/${(0,c.green)("+")} destroy and then create replacement`};const s=[];if(t.has("add"))s.push(n.add);if(t.has("change"))s.push(n.change);if(t.has("destroy"))s.push(n.destroy);if(t.has("replace"))s.push(n.replace);return s.map((e=>` ${e}`)).join("\n")}format(e,t){const{action:n,scenario:s,resourceType:r,identity:i,oldAttributes:o}=e;const a=[];const u=this.get(r);const d=this.getSymbol(n);const pad=e=>e.padEnd(16);a.push(` ${d} resource "${r}" "${(0,l.formatIdentityDisplay)(i)}" {`);for(const e of u.fields){const r=typeof e.value==="function"?e.value(s,t):e.value;const i=o?o[e.name]:undefined;let u="";let f=false;if(e.knownAfterApply){u="(known after apply)";f=true}else if(typeof r==="object"&&r!==null&&!Array.isArray(r)){let e=i;if(!e||typeof e!=="object"||Array.isArray(e)){e=n==="destroy"?i:{}}const t=n==="change"||n==="add"||n==="replace";if(t&&e&&typeof e==="object"&&!Array.isArray(e)){const t=Array.from(new Set([...Object.keys(e),...Object.keys(r)])).sort();const s=[];s.push("{");for(const i of t){const t=e[i];const o=r[i];const a=`"${i}"`;if(n==="add"){const e=(0,l.formatHclValue)(o,2).trimStart();s.push(` ${(0,c.green)("+")} ${a}: ${e}`);f=true}else if(t===undefined){const e=(0,l.formatHclValue)(o,2).trimStart();s.push(` ${(0,c.green)("+")} ${a}: ${e}`);f=true}else if(o===undefined){const e=(0,l.formatHclValue)(t,2).trimStart();s.push(` ${(0,c.red)("-")} ${a}: ${e}`);f=true}else if(JSON.stringify(t)!==JSON.stringify(o)){const e=(0,l.formatHclValue)(t,2).trimStart();const n=(0,l.formatHclValue)(o,2).trimStart();s.push(` ${(0,c.yellow)("~")} ${a}: ${e} -> ${n}`);f=true}else{const e=(0,l.formatHclValue)(t,2).trimStart();s.push(` ${a}: ${e}`)}}s.push(" }");u=s.join("\n")}else{const e=(0,l.formatHclValue)(r,2).split("\n");u=e.map(((e,t)=>t===0?e.trimStart():e)).join("\n");f=true}}else if(Array.isArray(r)){const e=(0,l.formatHclValue)(r,2).split("\n");u=e.map(((e,t)=>t===0?e.trimStart():e)).join("\n");if(n==="change"){f=JSON.stringify(r)!==JSON.stringify(i)}else{f=true}}else if(typeof r==="string"&&r.includes("\n")){const e=(0,l.formatHclValue)(r,2).split("\n");u=e.map(((e,t)=>t===0?e.trimStart():e)).join("\n");if(n==="change"){f=r!==i}else{f=true}}else{if(n==="change"&&r!==i&&i!==undefined){u=`"${i}" -> "${r}"`;f=true}else{u=`"${r}"`;if(n==="change"){f=r!==i}else{f=true}}}if(n==="add"||n==="replace"){a.push(` ${d} ${pad(e.name)}= ${u}`)}else if(n==="change"){if(e.knownAfterApply){a.push(` ${pad(e.name)}= ${u}`)}else if(f){a.push(` ${d} ${pad(e.name)}= ${u}`)}else{a.push(` ${pad(e.name)}= ${u}`)}}else if(n==="destroy"){a.push(` ${d} ${pad(e.name)}= ${u} -> null`)}}a.push(" }");return a.join("\n")}summary(e,t=true,n){const s=[];if(e.length===0){s.push("No changes. Your test matches the configuration.");if(!t){s.push("");s.push(`${o.TITLE_APP} has compared your real test against your configuration and found no differences, so no`);s.push("changes are needed.");s.push("");s.push((0,c.green)("Apply complete! Resources: 0 added, 0 changed, 0 destroyed."))}console.log(s.join("\n"));return}s.push(`${o.TITLE_APP} used the selected providers to generate the following execution plan. Resource actions are indicated with the`);s.push("following symbols:");s.push(this.getSymbols(e));s.push("");s.push(`${o.TITLE_APP} will perform the following actions:`);s.push("");for(const t of e){const e=(0,l.formatIdentityDisplay)(t.identity);const r=t.action==="add"?(0,c.bold)((0,c.green)(`# [${t.scenario.feature?.name||"Unknown"}].${t.resourceType}.${e} will be created`)):t.action==="change"?(0,c.bold)((0,c.yellow)(`# ${t.resourceType}.${e} will be updated in-place`)):t.action==="replace"?(0,c.bold)((0,c.red)(`# ${t.resourceType}.${e} must be replaced`)):(0,c.bold)((0,c.red)(`# ${t.resourceType}.${e} will be destroyed`));s.push(` ${r}`);if(t.action==="destroy"){s.push(` # (because ${t.resourceType}.${e} is not in configuration)`)}s.push(this.format(t,n));s.push("")}const r=e.filter((e=>e.action==="add")).length;const i=e.filter((e=>e.action==="change")).length;const a=e.filter((e=>e.action==="destroy")).length;const u=e.filter((e=>e.action==="replace")).length;s.push(`${(0,c.bold)("Plan:")} ${r+u} to add, ${i} to change, ${a+u} to destroy.`);s.push("");if(t){s.push((0,c.dim)("─".repeat(108)));s.push("");if(!n?.outPath){s.push(`Note: You didn't use the -out option to save this plan, so ${o.TITLE_APP} can't guarantee to take exactly these`);s.push(`actions if you run "${o.TITLE_CLI} apply" now.`)}}console.log(s.join("\n"))}}t.resource=new Resource;const registerResource=e=>t.resource.registry(e,"user");t.registerResource=registerResource;t.resource.registry({type:"github_testcase",fields:[{name:"title",value:e=>e.name},{name:"body",value:e=>"```gherkin\n"+e.steps.map((e=>`${e.keyword}${e.text}`)).join("\n")+"\n```"},{name:"labels",value:e=>{const t=e.custom?.identity?.startsWith("@")?e.custom.identity.substring(1):e.custom?.identity;return[...new Set([...e.tags||[]].map(String).map((e=>e.startsWith("@")?e.substring(1):e)).filter((e=>e!==t)))]}},{name:"assignees",value:e=>(e.custom?.fields?.assignees||"").split(",").map((e=>e.trim())).filter(Boolean)},{name:"milestone",value:e=>e.custom?.fields?.milestone||""},{name:"custom_fields",value:e=>{const t={...e.custom?.fields||{}};delete t["labels"];delete t["assignees"];delete t["milestone"];delete t["status"];return t}}]});t.resource.registry({type:"github_testrun",fields:[{name:"title",value:e=>e.feature?.name||""},{name:"body",value:(e,t)=>{let s=e.feature.description||"### 🚀 Test Run Execution\n\nThis issue serves as the central hub for tracking the execution of this Test Run. All associated test cases are linked below as tasks.\n\n**Instructions:**\n- Execution results for each test case will be recorded dynamically as comments on this issue.\n- Click on individual test case links to view their details or attach evidence.";const r=e.custom?.testcases||[];if(r.length>0&&t?.state){const i=t.state;const o=e.custom?.identity&&e.custom.identity!==e.uri?`${e.uri}.${e.custom.identity}`:e.uri;const a=i.getResources("github_testrun").find((e=>e.identity===o));const c=a?.attributes?.testcaseStatuses||{};const l=[...r].sort(((e,t)=>{const n=e.split(".").pop()?.replace("@","")||"";const s=t.split(".").pop()?.replace("@","")||"";return n.localeCompare(s,undefined,{numeric:true,sensitivity:"base"})}));const u=[];const d=[];for(const e of l){const n=e.split(".");const s=n.pop();const r=n.join(".");const o=r.replace(".case.feature","").replace(".feature","");const a=i.getResources("github_testcase").filter((e=>e.identity.includes(o)&&(s==="*"||e.identity.endsWith(`.${s}`))));const c=new Set(a.map((e=>{const t=e.identity.lastIndexOf(".");return t!==-1?e.identity.slice(0,t):e.identity})));let l=a;if(c.size>1){if(t?.testDirectory){const e=t.testDirectory.replace(/^\.\//,"");l=a.filter((t=>t.identity.startsWith(e)));const n=new Set(l.map((e=>{const t=e.identity.lastIndexOf(".");return t!==-1?e.identity.slice(0,t):e.identity})));if(n.size>1){throw new Error(`Multiple testcases found for rule "${r}". Please specify a more exact path or use -test-directory to limit the scope.`)}}else{throw new Error(`Multiple testcases found for rule "${r}". Please specify a more exact path or use -test-directory to limit the scope.`)}}if(l.length>0){u.push(...l)}else{d.push(e)}}const f=new Map;for(const e of u){if(!f.has(e.identity)){f.set(e.identity,e)}}const p=Array.from(f.values());p.sort(((e,t)=>{const n=e.identity.split(".").pop()?.replace("@","")||"";const s=t.identity.split(".").pop()?.replace("@","")||"";return n.localeCompare(s,undefined,{numeric:true,sensitivity:"base"})}));const h=new Map;for(const e of p){const t=e.identity.lastIndexOf(".");const s=t!==-1?e.identity.slice(0,t):e.identity;const r=n(6928).basename(s||"");if(!h.has(r)){h.set(r,[])}h.get(r).push(e)}for(const[t,n]of h.entries()){s+=`\n\n**Origin:** ${t}\n`;for(const t of n){const n=t.identity;const r=n.split(".").pop()?.replace("@","")||"";let i=e.custom?.groupScenarios?.find((e=>{if(!e.rule||!e.name)return false;const t=e.rule.name.replace(".case.feature","").replace(".feature","");return n.includes(t)&&n.endsWith(`.${e.name}`)}));if(!i){i=e.custom?.groupScenarios?.find((e=>{if(!e.rule||!e.name)return false;const t=e.rule.name.replace(".case.feature","").replace(".feature","");return n.includes(t)&&e.name==="*"}))}const o=i?.custom?.fields?.status||c[n]||"pending";const a=o==="passed"?"[x]":"[ ]";if(t?.attributes?.issueNumber){s+=`- ${a} ${r}: #${t.attributes.issueNumber}\n`}else{s+=`- ${a} ${r}: (known after apply) - ${n}\n`}}}if(d.length>0){s+=`\n\n**Not Found in State**\n`;for(const e of d){const t=e.split(".").pop()?.replace("@","")||"";s+=`- [ ] ${t}: (not found in state) - ${e}\n`}}}return s.trim()}},{name:"labels",value:e=>{const t=e.custom?.identity?.startsWith("@")?e.custom.identity.substring(1):e.custom?.identity;return[...new Set([...e.tags||[]].map(String).map((e=>e.startsWith("@")?e.substring(1):e)).filter((e=>e!==t)))]}},{name:"assignees",value:e=>(e.custom?.fields?.assignees||"").split(",").map((e=>e.trim())).filter(Boolean)},{name:"milestone",value:e=>e.custom?.fields?.milestone||""},{name:"custom_fields",value:e=>{const t={...e.custom?.fields||{}};delete t["labels"];delete t["assignees"];delete t["milestone"];delete t["status"];return t}}],comments:(e,t)=>{const{evaluateGitHubTestrunComments:s}=n(8567);return s(e,t)}});t.resource.registry({type:"github_testplan",fields:[{name:"title",value:e=>e.feature?.name||""},{name:"body",value:(e,t)=>{const{buildGitHubTestplanBody:s}=n(8567);return s(e,t)}},{name:"labels",value:e=>{const t=e.custom?.identity?.startsWith("@")?e.custom.identity.substring(1):e.custom?.identity;return[...new Set([...e.tags||[]].map(String).map((e=>e.startsWith("@")?e.substring(1):e)).filter((e=>e!==t)))]}},{name:"assignees",value:e=>(e.custom?.fields?.assignees||"").split(",").map((e=>e.trim())).filter(Boolean)},{name:"milestone",value:e=>e.custom?.fields?.milestone||""},{name:"custom_fields",value:e=>{const t={...e.custom?.fields||{}};delete t["labels"];delete t["assignees"];delete t["milestone"];delete t["status"];return t}},{name:"testruns",value:e=>e.custom?.testruns||[]}]})},7442:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.matchesScope=matchesScope;t.detectScopeFromTarget=detectScopeFromTarget;t.matchesTarget=matchesTarget;t.parseSpec=parseSpec;t.matchesFeatureFile=matchesFeatureFile;t.matchesScenarioSpec=matchesScenarioSpec;t.matchesStateKey=matchesStateKey;t.resolveTargetScenario=resolveTargetScenario;t.promptTargetSuite=promptTargetSuite;const s=n(6928);const r=n(6028);const i=n(5392);const o=n(4489);const a=n(3912);const c=n(5301);function matchesScope(e,t,n){if(!e)return false;if(!Object.prototype.hasOwnProperty.call(r.SCOPE_CONFIG,t))return false;const s=r.SCOPE_CONFIG[t];const i=e.feature?.tags||[];const o=typeof e.uri==="string"?e.uri:"";if(i.includes(s.tag)||o.endsWith(s.ext)){return true}if(n){const e=n.split(".")[0].trim();if(e&&e!=="*"){if(e.startsWith("*")&&o.endsWith(e.slice(1))){return true}if(o===e||o.endsWith(`/${e}`)){return true}}}return false}function detectScopeFromTarget(e){const t=e.trim().toLowerCase();if(t==="testplan"||t.endsWith(".plan.feature")||t.includes(".plan.feature")||t.startsWith("@tp")||t.includes(".@tp")){return"testplan"}if(t==="testrun"||t.endsWith(".run.feature")||t.includes(".run.feature")||t.startsWith("@tr")||t.includes(".@tr")){return"testrun"}if(t==="testcase"||t.endsWith(".case.feature")||t.includes(".case.feature")||t.startsWith("@tc")||t.includes(".@tc")){return"testcase"}return undefined}function matchesTarget(e,t,n){if(!e&&!n)return false;const r=Array.isArray(t)?t:[t];return r.some((t=>{if(!t)return false;const r=t.trim().toLowerCase();if(n){const e=n.trim().toLowerCase();if(r===e||r===`testform_${e}`||`testform_${r}`===e){return true}}if(!e)return false;const i=e.replace(/\\/g,"/");let o=t.replace(/\\/g,"/");if(n){const e=n.trim().toLowerCase();if(o.toLowerCase().startsWith(`${e}.`)){o=o.slice(e.length+1)}else if(o.toLowerCase().match(new RegExp(`^[a-z0-9_-]+_${e}\\.`,"i"))){o=o.replace(new RegExp(`^[a-z0-9_-]+_${e}\\.`,"i"),"")}}const a=(0,s.basename)(i).replace(/(\.(case|run|plan))?\.feature$/i,"");const c=(0,s.basename)(o).replace(/(\.(case|run|plan))?\.feature$/i,"");return i===o||i.startsWith(`${o}.`)||i.endsWith(`/${o}`)||i.endsWith(o)||(0,s.basename)(i)===o||a===c}))}function parseSpec(e,t={}){const{command:n="mark",defaultStatus:s="pending",requireStatus:i=n==="mark"}=t;let o=s;let c=e;if(e.includes("=")){const t=e.lastIndexOf("=");o=e.slice(t+1).trim();c=e.slice(0,t).trim();if(!r.TESTCASE_STATUSES.includes(o)){a.Diag.error({title:`Invalid status '${o}' in '${e}'.`,detail:[`Available statuses: ${r.TESTCASE_STATUSES.join(", ")}`]}).abort()}}else if(i){a.Diag.error({title:`Invalid format: '${e}'`,detail:[`Expected format: '<identifier>=<status>'`,`Examples:`,` ${r.TITLE_CLI} suite mark "@tc-1=passed" -target="@tr-2"`,` ${r.TITLE_CLI} suite mark "cuenta/inicio-sesion.feature@tc-1=passed" -target="@tr-2"`,``,`Available statuses: ${r.TESTCASE_STATUSES.join(", ")}`]}).abort()}if(!c){a.Diag.error({title:`Could not find scenario identity in '${e}'.`,detail:[`Expected format: '<identifier>=<status>'`,`Available statuses: ${r.TESTCASE_STATUSES.join(", ")}`]}).abort()}const l=c.replace(/^([a-zA-Z0-9_-]+_)?testcase\./,"");let u="";let d="";let f=false;if(l.includes(".feature.")){const e=l.indexOf(".feature.");u=l.slice(0,e+8).trim();d=l.slice(e+9).trim()}else{const e=l.lastIndexOf("@");if(e>0){u=l.slice(0,e).trim();d=l.slice(e).trim()}else if(l.endsWith(".feature")){u=l.trim();d="";f=true}else if(l.includes(".")){const e=l.lastIndexOf(".");u=l.slice(0,e).trim();d=l.slice(e+1).trim()}else{d=l.trim()}}return{raw:e,rawIdentifier:c,featurePart:u,casePart:d,newStatus:o,isWholeFile:f}}function matchesFeatureFile(e,t){if(!t)return true;const n=t.replace(/\.feature$/i,"");const r=e.replace(/\.feature$/i,"");return e===t||r===n||e.endsWith(t)||e.endsWith("/"+t)||e.endsWith("/"+t+".feature")||(0,s.basename)(r)===(0,s.basename)(n)}function matchesScenarioSpec(e,t){if(t.featurePart&&!matchesFeatureFile(e.uri,t.featurePart)){return false}const n=t.casePart.trim().toLowerCase();const s=(e.custom?.identity||"").trim().toLowerCase();const r=(e.name||"").trim().toLowerCase();if(s===n||s.replace(/^@/,"")===n.replace(/^@/,"")){return true}if(r&&r===n){return true}const i=`${e.uri}.${e.custom?.identity||e.name}`.toLowerCase();if(i===n){return true}return false}function matchesStateKey(e,t,n){const s=e.lastIndexOf(".");const r=s!==-1?e.slice(0,s):e;const i=s!==-1?e.slice(s+1):"";if(n.featurePart&&!matchesFeatureFile(r,n.featurePart)){return false}const o=n.casePart.trim().toLowerCase();const a=i.trim().toLowerCase();const c=(t||"").trim().toLowerCase();if(a===o||a.replace(/^@/,"")===o.replace(/^@/,"")){return true}if(c&&c===o){return true}if(n.rawIdentifier&&e.toLowerCase()===n.rawIdentifier.toLowerCase()){return true}return false}async function resolveTargetScenario(e,t,n,r,c){const l=typeof e==="string"?{target:e,dir:t,scopeKey:n,testDirectory:r,variables:c}:e;const{target:u,dir:d,scopeKey:f,testDirectory:p,variables:h}=l;const m=p?(0,s.join)(d,p):d;const g=new i.Parser(m,h);const y=new o.Config(d);const b={identity:y.getIdentity(f),fields:y.getFields(f)};const v=g.content()||[];const w=y.getMatch?.(f);const T=v.filter((e=>matchesScope(e,f,w)));const S=g.filter(T,b,f)||[];const k=u.replace(/\\/g,"/");const D=S.filter((e=>{const t=(e.uri||"").replace(/\\/g,"/");const n=e.custom?.identity?`${t}.${e.custom.identity}`:t;return n===k||n.startsWith(`${k}.`)||n.endsWith(`/${k}`)||n.endsWith(k)||t===k||t.endsWith(`/${k}`)||t.endsWith(k)||(0,s.basename)(t)===k||(0,s.basename)(t)===(0,s.basename)(k)}));if(D.length===1){return{absolutePath:(0,s.resolve)(m,D[0].uri),scenario:D[0]}}if(D.length===0){a.Diag.targetNotFound({scopeKey:f,target:u}).abort()}const _=Array.from(new Set(D.map((e=>e.uri))));a.Diag.ambiguousTarget({scopeKey:f,target:u,matches:_}).abort();throw new Error("Unreachable")}async function promptTargetSuite(e,t=["testrun","testplan"],n,r){const l=typeof e==="string"?{dir:e,allowedScopes:t,testDirectory:n,variables:r}:e;const{dir:u,allowedScopes:d=["testrun","testplan"],testDirectory:f,variables:p}=l;const h=f?(0,s.join)(u,f):u;const m=new i.Parser(h,p);const g=m.content()||[];const y=[];for(const e of d){const t=g.filter((t=>matchesScope(t,e)));const n=new o.Config(u);const s={identity:n.getIdentity(e),fields:n.getFields(e)};const r=m.filter(t,s,e)||[];for(const t of r){const n=t.uri;const s=t.custom?.identity||"";const r=s?` (${s})`:"";const i=t.feature?.name?` - "${t.feature.name}"`:"";y.push({label:`[${e}] ${n}${r}${i}`,value:s||n})}}if(y.length===0){a.Diag.error({title:`No ${d.join(" or ")} files found in workspace.`,detail:[`Use \`testform suite init\` to create one first.`]}).abort()}return(0,c.askSelect)("Selecciona la suite de destino (-target):",y)}},7066:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.State=void 0;t.parseBackendOverrides=parseBackendOverrides;t.cleanAttributes=cleanAttributes;const r=n(6982);const i=n(9896);const o=n(6928);const a=s(n(8815));const c=n(6028);const l=n(1227);const u=n(7490);const d=n(3175);const f=n(1535);const p=n(6122);const h=n(4646);const m=n(1265);const g=n(2578);const y=n(4489);const b=n(8742);const v=n(4296);function parseBackendOverrides(e,t="."){const n={};const s=Array.isArray(e)?e:[e];for(const e of s){if(!e||typeof e!=="string")continue;const s=e.indexOf("=");if(s>0){const t=e.substring(0,s).trim();const r=e.substring(s+1).trim();n[t]=r}else{const s=(0,o.resolve)(t,e.trim());if((0,i.existsSync)(s)){try{const e=(0,i.readFileSync)(s,"utf-8");let t;try{t=a.default.parse(e)}catch{}if(t&&typeof t==="object"){for(const[e,s]of Object.entries(t)){n[e]=String(s)}}else{const t=e.split("\n");for(const e of t){const t=e.trim();if(!t||t.startsWith("#")||t.startsWith("//"))continue;const s=t.indexOf("=");if(s>0){const e=t.substring(0,s).trim().replace(/["']/g,"");const r=t.substring(s+1).trim().replace(/["']/g,"");n[e]=r}}}}catch{}}}}return n}class State{state;backend;workspaceManager;lockAcquired=false;dir;customStatePath;constructor(e,t,n,s=false,r,i){this.dir=e;this.customStatePath=t;const o=new y.Config(e,false);let a=i||o.getBackend();this.workspaceManager=new b.WorkspaceManager(e);const c=this.workspaceManager.getCurrentWorkspace();if(s||t){a={type:"local",config:{}}}else if(a&&a.type!=="local"&&r){const t=parseBackendOverrides(r,e);a.config={...a.config,...t}}if(a?.type==="s3"||a?.type==="oci"){this.backend=new d.S3Backend(a.config,c)}else if(a?.type==="azurerm"){this.backend=new f.AzureRMBackend(a.config,c)}else if(a?.type==="gcs"){this.backend=new p.GCSBackend(a.config,c)}else if(a?.type==="github"){const e=o.getGitHub();this.backend=new h.GitHubBackend(a.config,c,e?.owner,e?.repository,e?.tokenEnv)}else if(a?.type==="http"||a?.type==="rest"){this.backend=new m.HTTPBackend(a.config,c)}else if(a?.type==="custom"){this.backend=new g.CustomBackend(a.config,c,e)}else{this.backend=new u.LocalBackend(e,t,n,c)}}async hasState(){return await this.backend.exists()}async init(){const e=await this.backend.read();if(!e.version){l.logger.push({type:"error",title:`${c.FILE_STATE} is missing the "version" field`,detail:[`Add a "version" field to your ${c.FILE_STATE} file and rerun init.`],close:true})}else if(e.version!==c.VERSION_STATE&&e.version!=="1.0.0"&&e.version!=="1"){l.logger.push({type:"error",title:`state version mismatch`,detail:[`Found version "${e.version}", but expected "${c.VERSION_STATE}".`,`Update ${c.FILE_STATE} to version ${c.VERSION_STATE} and rerun init.`],close:true})}const t=new y.Config(this.dir,false);this.state={version:e.version||c.VERSION_STATE,serial:e.serial??0,lineage:e.lineage??(0,r.randomUUID)(),lastSync:e.lastSync??"",provider:e.provider??t.getAdapterType(),resources:(e.resources??[]).map((e=>({...e,type:e.type||(e.identity?.startsWith("@tr-")||e.identity?.includes(".run.")?"testrun":e.identity?.startsWith("@tp-")||e.identity?.includes(".plan.")?"testplan":"testcase"),attributes:e.attributes??{...e}}))),outputs:e.outputs??{}}}async acquireLock(e,t){if(!e)return;const n=await this.backend.lock(t);if(!n){let e="";try{const t=typeof this.backend.getLockInfo==="function"?await this.backend.getLockInfo():null;if(t&&t.id){e=`\n\nLock Info:\n ID: ${t.id}\n Path: ${this.customStatePath||c.FILE_STATE}\n Operation: ${t.operation||"Operation"}\n Who: ${t.who||"unknown"}\n Created: ${t.created||""}`}}catch{}throw new v.StateLockError(`Error acquiring the state lock\n\nTestform acquires a state lock to protect the state from being written\nby multiple users at the same time. Please resolve the issue above and try\nagain. For most commands, you can disable locking with the "-lock=false"\nflag, but this is not recommended.${e}`)}this.lockAcquired=true}async releaseLock(){if(this.lockAcquired){await this.backend.unlock();this.lockAcquired=false}}async forceUnlock(e){return this.backend.forceUnlock(e)}clean(){const e=JSON.stringify(this.state);const t=Buffer.byteLength(e,"utf8");let n=0;if(this.state&&Array.isArray(this.state.resources)){for(const e of this.state.resources){if(e.attributes){const t=JSON.stringify(e.attributes);e.attributes=cleanAttributes(e.attributes);const s=JSON.stringify(e.attributes);if(t!==s){n++}}}}const s=JSON.stringify(this.state);const r=Buffer.byteLength(s,"utf8");return{beforeBytes:t,afterBytes:r,resourcesCleaned:n}}async save(){this.clean();this.state.serial+=1;this.state.lastSync=(new Date).toISOString();await this.backend.write(this.state)}getState(){return this.state}replaceState(e){this.state=JSON.parse(JSON.stringify(e))}getResources(e){if(!this.state||!this.state.resources)return[];if(!e)return this.state.resources;return this.state.resources.filter((t=>{const n=t.type||(t.identity?.startsWith("@tr-")||t.identity?.includes(".run.")?"testrun":t.identity?.startsWith("@tp-")||t.identity?.includes(".plan.")?"testplan":"testcase");if(n===e)return true;const s=n.includes("_")?n.split("_").slice(1).join("_"):n;const r=e.includes("_")?e.split("_").slice(1).join("_"):e;return s===r}))}getOutputs(){return this.state&&this.state.outputs||{}}setOutputs(e){this.state.outputs=e}getCurrentWorkspace(){return this.workspaceManager.getCurrentWorkspace()}setCurrentWorkspace(e){this.workspaceManager.setCurrentWorkspace(e)}async listWorkspaces(){return this.backend.listWorkspaces()}async deleteWorkspace(e){return this.backend.deleteWorkspace(e)}findResource(e){return this.state.resources.find((t=>t.identity===e))}upsertResource(e){const t={...e,attributes:cleanAttributes(e.attributes)};const n=this.state.resources.findIndex((e=>e.identity===t.identity));if(n>=0){this.state.resources[n]=t}else{this.state.resources.push(t)}}removeResource(e){this.state.resources=this.state.resources.filter((t=>t.identity!==e))}clearResources(){this.state.resources=[]}}t.State=State;function cleanAttributes(e){if(!e||typeof e!=="object")return e;const t={};for(const[n,s]of Object.entries(e)){if(s===null||s===undefined)continue;if(typeof s==="string"){if(s.trim()==="")continue;t[n]=s;continue}if(Array.isArray(s)){const e=s.filter((e=>e!==null&&e!==undefined&&(typeof e!=="string"||e.trim()!==""))).map((e=>typeof e==="object"&&e!==null&&!Array.isArray(e)?cleanAttributes(e):e)).filter((e=>typeof e!=="object"||e===null||Object.keys(e).length>0));if(e.length>0){t[n]=e}continue}if(typeof s==="object"){const e=cleanAttributes(s);if(Object.keys(e).length>0){t[n]=e}continue}t[n]=s}return t}},5124:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.executeInBatches=executeInBatches;t.arraysEqual=arraysEqual;t.compareCustomFields=compareCustomFields;t.detectAttributeDrift=detectAttributeDrift;t.syncTestrunComments=syncTestrunComments;const s=n(7862);async function executeInBatches(e,t,n){const s=Math.max(1,t||1);const r=[];for(let t=0;t<e.length;t+=s){const i=e.slice(t,t+s);const o=await Promise.all(i.map(n));r.push(...o)}return r}function normalizeStringArray(e){if(!e)return[];const t=Array.isArray(e)?e:String(e).split(",");return t.map((e=>String(e).trim().toLowerCase())).filter(Boolean)}function arraysEqual(e,t){const n=normalizeStringArray(e).sort();const s=normalizeStringArray(t).sort();if(n.length!==s.length)return false;return n.every(((e,t)=>e===s[t]))}function compareCustomFields(e={},t={},n=[]){const s={...e};let r=false;const i=new Set(n.map((e=>e.toLowerCase())));for(const n of Object.keys(e)){if(i.has(n.toLowerCase())||i.has("custom_fields")){continue}const o=Object.keys(t).find((e=>e.toLowerCase()===n.toLowerCase()));const a=o?t[o]:"";const c=String(e[n]??"");const l=c.startsWith("@")?c.substring(1).toLowerCase():c.toLowerCase();const u=a.toLowerCase();if(l!==u){s[n]=a;r=true}}return{hasDrift:r,reconciled:s}}function detectAttributeDrift(e,t,n,s=[]){const r={...e};let i=false;const o=new Set(s.map((e=>e.toLowerCase())));if(!o.has("title")&&r.title!==t.title){r.title=t.title;i=true}const a=t.labels??[];if(!o.has("labels")&&!arraysEqual(r.labels,a)){r.labels=a;i=true}const c=t.assignees??[];if(!o.has("assignees")&&!arraysEqual(r.assignees,c)){r.assignees=c;i=true}const l=t.milestone??"";const u=String(r.milestone??"");if(!o.has("milestone")&&u!==l){r.milestone=l;i=true}if(n!==undefined&&!o.has("custom_fields")){const e=r.custom_fields||{};const t=compareCustomFields(e,n,s);if(t.hasDrift){r.custom_fields=t.reconciled;i=true}}return{hasDrift:i,newAttributes:r}}async function syncTestrunComments(e){const{change:t,issueNumber:n,provider:r,stateObj:i,testDirectory:o,existingAttributes:a,onCommentUpdate:c,onCommentCreate:l}=e;if(!t.resourceType.endsWith("testrun")||!t.scenario.custom?.testcases){return{testcaseCommentIds:a?.testcaseCommentIds||{},testcaseStatuses:a?.testcaseStatuses||{},expandedTestcases:[]}}const u={...a?.testcaseCommentIds||{}};const d={...a?.testcaseStatuses||{}};const f=[];const p=s.resource.evaluateComments(t.resourceType,t.scenario,{state:i,testDirectory:o,existingAttributes:a});for(const e of p){const{identity:t,status:s,body:i}=e;f.push(t);if(!u[t]||d[t]!==s){if(u[t]){await r.updateIssueComment(u[t],i);c?.(t,s)}else{const e=await r.createIssueComment(n,i);u[t]=e.id;l?.(t,s)}d[t]=s}}return{testcaseCommentIds:u,testcaseStatuses:d,expandedTestcases:f}}},2978:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TF_SPACE_TOKEN=t.formatHclValue=void 0;t.elapsedSeconds=elapsedSeconds;t.resolvePath=resolvePath;t.formatIdentityDisplay=formatIdentityDisplay;t.formatResourceAddress=formatResourceAddress;t.normalizeAddress=normalizeAddress;t.addressesMatch=addressesMatch;t.findDomainConfigFiles=findDomainConfigFiles;t.sanitizeTagsWithSpaces=sanitizeTagsWithSpaces;t.restoreTagsWithSpaces=restoreTagsWithSpaces;t.reassembleSplitTags=reassembleSplitTags;t.levenshtein=levenshtein;t.suggestCommand=suggestCommand;const s=n(9896);const r=n(6928);function elapsedSeconds(e){return((Date.now()-e)/1e3).toFixed(0)}function resolvePath(e,t){if(!t||!e)return undefined;const n=t.replace(/\[(\w+)\]/g,".$1").split(".");let s=e;for(const e of n){if(s===undefined||s===null)return undefined;s=s[e]}return s}function formatIdentityDisplay(e){return e}function formatResourceAddress(e,t){return`${e}.${t}`}const formatHclValue=(e,n)=>{const s=" ".repeat(n);if(e===null||e===undefined)return"null";if(typeof e==="string"){if(e.includes("\n")){const t=e.split("\n").map((e=>e?`${s} ${e}`:`${s} `)).join("\n");return`<<-EOT\n${t}\n${s}EOT`}return JSON.stringify(e)}if(Array.isArray(e)){if(e.length===0)return"[]";const r=e.map((e=>(0,t.formatHclValue)(e,n+1)));return`[\n${s} ${r.join(`,\n${s} `)},\n${s}]`}if(typeof e==="object"){const r=Object.keys(e);if(r.length===0)return"{}";let i=0;for(const e of r){const t=JSON.stringify(e);if(t.length>i)i=t.length}let o=`{\n`;for(const a of r){const r=JSON.stringify(a);const c=" ".repeat(i-r.length);const l=Object.prototype.hasOwnProperty.call(e,a)?e[a]:undefined;o+=`${s} ${r}${c} = ${(0,t.formatHclValue)(l,n+1)}\n`}o+=`${s}}`;return o}return JSON.stringify(e)};t.formatHclValue=formatHclValue;function normalizeAddress(e){return e.replace(/\\/g,"/").replace(/\.@/,".").replace(/^@/,"")}function addressesMatch(e,t){return normalizeAddress(e)===normalizeAddress(t)}function findDomainConfigFiles(e,t=[]){const n=[];if(!(0,s.existsSync)(e))return n;const i=new Set(["node_modules",".git",".testform",".terraform","dist","coverage",".system_generated"]);const o=new Set(["main.yml","main.yaml","testform.yml","testform.yaml","variables.yml","variables.yaml","vars.yml","vars.yaml","locals.yml","locals.yaml","local.yml","local.yaml","outputs.yml","outputs.yaml","data.yml","data.yaml",...t.map((e=>e.toLowerCase()))]);const scan=t=>{try{const a=(0,r.resolve)(t)===(0,r.resolve)(e);const c=(0,s.readdirSync)(t,{withFileTypes:true});for(const e of c){if(e.isDirectory()){if(!i.has(e.name)&&!e.name.startsWith(".")){scan((0,r.resolve)(t,e.name))}}else if(e.isFile()){const s=e.name.toLowerCase();if(s.endsWith(".yml")||s.endsWith(".yaml")){if(a&&o.has(s)){continue}n.push((0,r.resolve)(t,e.name))}}}}catch{}};scan(e);return n.sort()}t.TF_SPACE_TOKEN="__TF_SPACE__";function sanitizeTagsWithSpaces(e){return e.replace(/(@(?:module|depends_on)\([^)]*\))/g,(e=>e.replace(/ /g,t.TF_SPACE_TOKEN)))}function restoreTagsWithSpaces(e){return e.split(t.TF_SPACE_TOKEN).join(" ")}function reassembleSplitTags(e,t){const n=[];for(let s=0;s<e.length;s++){const r=e[s];if(r.startsWith(t)&&(!r.endsWith(")")||(r.match(/\(/g)||[]).length!==(r.match(/\)/g)||[]).length)){let t=r;while(s+1<e.length){s++;const n=e[s];if(n.startsWith("@")&&!t.endsWith(",")&&!t.endsWith("(")&&!t.endsWith(":")&&!t.endsWith("=")){t+=n}else{t+=" "+n}const r=(t.match(/\(/g)||[]).length;const i=(t.match(/\)/g)||[]).length;if(r===i&&i>0)break}n.push(t)}else{n.push(r)}}return n}function levenshtein(e,t){const n=[];for(let e=0;e<=t.length;e++)n[e]=[e];for(let t=0;t<=e.length;t++)n[0][t]=t;for(let s=1;s<=t.length;s++){for(let r=1;r<=e.length;r++){if(t.charAt(s-1)===e.charAt(r-1)){n[s][r]=n[s-1][r-1]}else{n[s][r]=Math.min(n[s-1][r-1]+1,n[s][r-1]+1,n[s-1][r]+1)}}}return n[t.length][e.length]}function suggestCommand(e,t){const n=e.toLowerCase();let s;let r=Infinity;for(const e of t){if(e===n)return e;const t=levenshtein(n,e);if(t<r){r=t;s=e}}if(s&&r<=2){return s}return undefined}},9922:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.VariableParser=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=n(1227);const c=n(6028);const l=n(455);const u=n(2978);const d=n(2825);class VariableParser{declaredVars={};vars={};rawLocals={};locals={};workDir;dataResolver;outputResolver;state;constructor(e,t,n="."){this.workDir=n;this.dataResolver=new l.DataResolver(n);this.loadDeclarations();this.loadAutoVarFiles();this.parseVarFiles(t);this.parseVars(e);this.validateVariables();this.evaluateLocals()}loadDeclarations(){for(const e of c.CONFIG_FILE_NAMES){const t=(0,i.resolve)(this.workDir,e);if((0,r.existsSync)(t)){try{const e=(0,r.readFileSync)(t,"utf-8");const n=o.default.parse(e)||{};const s=n.variable;if(s&&typeof s==="object"){this.declaredVars={...this.declaredVars,...s};for(const[e,t]of Object.entries(s)){if(t&&typeof t==="object"&&t.default!==undefined){this.vars[e]=String(t.default)}else if(t!==undefined&&t!==null&&typeof t!=="object"){this.vars[e]=String(t)}}}const i=n.locals;if(i&&typeof i==="object"){this.rawLocals={...this.rawLocals,...i}}}catch{}break}}for(const e of["variables.yml","variables.yaml"]){const t=(0,i.resolve)(this.workDir,e);if((0,r.existsSync)(t)){try{const e=(0,r.readFileSync)(t,"utf-8");const n=o.default.parse(e)||{};const s=n.variable||n;if(typeof s==="object"){this.declaredVars={...this.declaredVars,...s};for(const[e,t]of Object.entries(s)){if(t&&typeof t==="object"&&t.default!==undefined){this.vars[e]=String(t.default)}else if(t!==undefined&&t!==null&&typeof t!=="object"){this.vars[e]=String(t)}}}}catch{}break}}for(const e of["locals.yml","locals.yaml","local.yml","local.yaml"]){const t=(0,i.resolve)(this.workDir,e);if((0,r.existsSync)(t)){try{const e=(0,r.readFileSync)(t,"utf-8");const n=o.default.parse(e)||{};const s=n.locals||n;if(typeof s==="object"){this.rawLocals={...this.rawLocals,...s}}}catch{}break}}const e=(0,u.findDomainConfigFiles)(this.workDir);for(const t of e){try{const e=(0,r.readFileSync)(t,"utf-8");const n=o.default.parse(e);if(!n||typeof n!=="object")continue;const s=n.variable;if(s&&typeof s==="object"){for(const[e,t]of Object.entries(s)){if(t&&typeof t==="object"&&!Array.isArray(t)){this.declaredVars[e]={...this.declaredVars[e],...t};if(t.default!==undefined){this.vars[e]=String(t.default)}}else if(t!==undefined&&t!==null){this.declaredVars[e]={default:t};this.vars[e]=String(t)}}}const i=n.locals;if(i&&typeof i==="object"){this.rawLocals={...this.rawLocals,...i}}}catch{}}}loadAutoVarFiles(){if(!(0,r.existsSync)(this.workDir))return;try{const e=(0,r.readdirSync)(this.workDir);const t=e.filter((e=>e.endsWith(".vars.yml")||e.endsWith(".vars.yaml"))).sort();for(const e of t){const t=(0,i.resolve)(this.workDir,e);this.loadSingleYamlFile(t)}}catch{}}parseVars(e){if(!e)return;const t=Array.isArray(e)?e:[e];for(const e of t){const t=e.indexOf("=");if(t===-1){a.logger.push({type:"warning",title:`Invalid variable format: ${e}`,detail:["Variables must be in the format key=value"]});continue}const n=e.substring(0,t).trim();const s=e.substring(t+1).trim();this.vars[n]=s}}parseVarFiles(e){if(!e)return;const t=Array.isArray(e)?e:[e];for(let e of t){e=(0,i.resolve)(this.workDir,e);if(!(0,r.existsSync)(e)){a.logger.push({type:"error",title:`Variable file not found: ${e}`,detail:[],close:true});process.exit(1)}if(!e.endsWith(".yml")&&!e.endsWith(".yaml")){a.logger.push({type:"error",title:`Unsupported variable file format: ${e}`,detail:["Testform only supports YAML variable files (.yml or .yaml)."],close:true});process.exit(1)}this.loadSingleYamlFile(e)}}loadSingleYamlFile(e){try{const t=(0,r.readFileSync)(e,"utf-8");const n=o.default.parse(t);if(n&&typeof n==="object"){const e=n.variable||n;for(const[t,n]of Object.entries(e)){if(n!==undefined&&n!==null&&typeof n!=="object"){this.vars[t]=String(n)}}}}catch(t){a.logger.push({type:"error",title:`Failed to parse variable file: ${e}`,detail:[t.message],close:true});process.exit(1)}}validateVariables(){const e={vars:this.vars,locals:this.rawLocals,data:this.dataResolver,workDir:this.workDir};for(const[t,n]of Object.entries(this.declaredVars)){const s=this.vars[t];if(s===undefined)continue;if(n.enum&&Array.isArray(n.enum)&&n.enum.length>0){const e=n.enum.map(String);if(!e.includes(String(s))){a.logger.push({type:"error",title:`Variable enum validation error: "${t}"`,detail:[`Value "${s}" is not in the allowed list: [${e.join(", ")}].`],close:true})}}if(n.type){const e=n.type.toLowerCase();if(e==="number"){if(isNaN(Number(s))){a.logger.push({type:"error",title:`Variable type validation error: "${t}"`,detail:[`Value "${s}" cannot be parsed as a number.`],close:true})}}else if(e==="boolean"){if(s!=="true"&&s!=="false"&&typeof s!=="boolean"){a.logger.push({type:"error",title:`Variable type validation error: "${t}"`,detail:[`Value "${s}" is not a boolean ('true' or 'false').`],close:true})}}}if(n.validation?.condition){let s;try{s=(0,d.evaluateExpression)(n.validation.condition,e)}catch(e){a.logger.push({type:"error",title:`Error evaluating validation condition for "${t}"`,detail:[e.message],close:true})}if(!s){a.logger.push({type:"error",title:n.validation.error_message||`Variable validation condition failed: "${t}"`,detail:[n.validation.error_message||`Condition "${n.validation.condition}" evaluated to false for variable "${t}".`],close:true})}}}}evaluateLocals(){const e={...this.rawLocals};const t={};for(let n=0;n<3;n++){for(const[n,s]of Object.entries(e)){if(typeof s!=="string"){t[n]=String(s??"");continue}let e=s.replace(/\$\{module\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\}/g,((e,t,n)=>{const s=`module.${t}.${n}`;if(this.state){const e=this.state.getOutputs?this.state.getOutputs():this.state.outputs;if(e&&e[s]&&e[s].value!==undefined){return String(e[s].value)}}if(this.outputResolver){const e=this.outputResolver.getDeclarations?this.outputResolver.getDeclarations():{};if(e[s]&&e[s].value!==undefined){return String(e[s].value)}}return`\${module.${t}.${n}}`}));const r={vars:this.vars,locals:t,data:this.dataResolver,workDir:this.workDir};try{t[n]=(0,d.interpolateExpressions)(e,r)}catch{t[n]=e}}}this.locals=t}getVars(){return this.vars}setVar(e,t){this.vars[e]=t;this.validateVariables();this.evaluateLocals()}getLocals(){return this.locals}getDeclaredVars(){return this.declaredVars}getMissingRequiredVars(){const e=[];for(const[t,n]of Object.entries(this.declaredVars)){const s=n&&typeof n==="object"&&n.default!==undefined;if(!s&&this.vars[t]===undefined){e.push({name:t,description:n?.description})}}return e}applyToTemplate(e){if(typeof e!=="string")return e;let t=e.replace(/\$\{module\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\}/g,((e,t,n)=>{const s=`module.${t}.${n}`;if(this.state){const e=this.state.getOutputs?this.state.getOutputs():this.state.outputs;if(e&&e[s]&&e[s].value!==undefined){return String(e[s].value)}}if(this.outputResolver){const e=this.outputResolver.getDeclarations?this.outputResolver.getDeclarations():{};if(e[s]&&e[s].value!==undefined){return String(e[s].value)}}return e}));const n={vars:this.vars,locals:this.locals,data:this.dataResolver,workDir:this.workDir};return(0,d.interpolateExpressions)(t,n)}setOutputResolver(e){this.outputResolver=e}setState(e){this.state=e}getDataResolver(){return this.dataResolver}}t.VariableParser=VariableParser},8742:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.WorkspaceManager=void 0;const s=n(6928);const r=n(9896);class WorkspaceManager{testformDir;envPath;constructor(e){this.testformDir=(0,s.join)(e,".testform");this.envPath=(0,s.join)(this.testformDir,"environment")}ensureDir(){if(!(0,r.existsSync)(this.testformDir)){(0,r.mkdirSync)(this.testformDir,{recursive:true})}}getCurrentWorkspace(){if((0,r.existsSync)(this.envPath)&&(0,r.statSync)(this.envPath).isFile()){const e=(0,r.readFileSync)(this.envPath,"utf8").trim();if(e.length>0){return e}}return"default"}setCurrentWorkspace(e){this.ensureDir();(0,r.writeFileSync)(this.envPath,e,"utf8")}getActiveBackend(){const e=(0,s.join)(this.testformDir,"backend.json");if((0,r.existsSync)(e)&&(0,r.statSync)(e).isFile()){try{return JSON.parse((0,r.readFileSync)(e,"utf8"))}catch{return null}}return null}setActiveBackend(e){this.ensureDir();const t=(0,s.join)(this.testformDir,"backend.json");(0,r.writeFileSync)(t,JSON.stringify(e,null,2),"utf8")}}t.WorkspaceManager=WorkspaceManager},9407:function(module,exports,__nccwpck_require__){"use strict";module=__nccwpck_require__.nmd(module);var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var __exportStar=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))__createBinding(t,e,n)};var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:true});exports.Config=exports.VariableParser=exports.interpolateExpressions=exports.evaluateExpression=exports.registerPolicy=exports.policy=exports.registerResource=exports.resource=exports.main=void 0;exports.createCli=createCli;const cac_1=__nccwpck_require__(7948);const chalk_1=__nccwpck_require__(465);const node_process_1=__nccwpck_require__(1708);const path_1=__nccwpck_require__(6928);const config_1=__nccwpck_require__(4489);const init_1=__nccwpck_require__(722);const plan_1=__nccwpck_require__(4483);const validate_1=__nccwpck_require__(10);const apply_1=__nccwpck_require__(8314);const destroy_1=__nccwpck_require__(9540);const show_1=__nccwpck_require__(5765);const output_1=__nccwpck_require__(8973);const refresh_1=__nccwpck_require__(1821);const diff_1=__nccwpck_require__(5083);const import_1=__nccwpck_require__(2541);const force_unlock_1=__nccwpck_require__(3634);const state_1=__nccwpck_require__(1047);const taint_1=__nccwpck_require__(1510);const graph_1=__nccwpck_require__(9478);const fmt_1=__nccwpck_require__(2353);const login_1=__nccwpck_require__(7155);const logout_1=__nccwpck_require__(3834);const modules_1=__nccwpck_require__(3067);const workspace_1=__nccwpck_require__(2743);const report_1=__nccwpck_require__(8938);const suite_1=__nccwpck_require__(5822);const tool_1=__nccwpck_require__(4710);const print_1=__nccwpck_require__(7633);const query_1=__nccwpck_require__(1906);const ephemeral_1=__nccwpck_require__(6597);const providers_1=__nccwpck_require__(5644);const functions_1=__nccwpck_require__(31);const policy_1=__nccwpck_require__(5950);const chalk_2=__importDefault(__nccwpck_require__(465));const logger_1=__nccwpck_require__(1227);const const_1=__nccwpck_require__(6028);const help_1=__nccwpck_require__(8184);const errors_1=__nccwpck_require__(4296);const utils_1=__nccwpck_require__(2978);const cli_1=__nccwpck_require__(8169);async function fetchLatestNpmVersion(){try{const e=new AbortController;const t=setTimeout((()=>e.abort()),1500);const n=await fetch("https://registry.npmjs.org/@fromeroc9/testform/latest",{headers:{Accept:"application/json"},signal:e.signal});clearTimeout(t);if(n.ok){const e=await n.json();return e.version}}catch{}return undefined}async function printVersion(e=false,t=false){const n=node_process_1.platform==="win32"?"windows":node_process_1.platform;const s=node_process_1.arch==="x64"?"amd64":node_process_1.arch;const r=`${n}_${s}`;const i=process.env.TESTSTATE_LATEST_VERSION||await fetchLatestNpmVersion();const o=Boolean(i&&(0,cli_1.compareCliVersions)(const_1.VERSION_CLI,i)<0);if(e){const e={};try{const t=new config_1.Config(process.cwd(),false);const n=t.getProviderType();if(n&&n!=="local"){e[`registry.testform.io/fromeroc9/${n}`]="1.0.0"}}catch{}const t={testform_version:const_1.VERSION_CLI,platform:r,provider_selections:e,testform_outdated:o};console.log(JSON.stringify(t,null,2));return}console.log((0,chalk_1.cyan)(`${const_1.TITLE_APP} v${const_1.VERSION_CLI}`));console.log(`on ${r}`);if(t){console.log(`+ Config Version: ${const_1.VERSION_CONFIG} (${const_1.FILE_CONFIG})`);console.log(`+ State Version: ${const_1.VERSION_STATE} (${const_1.FILE_STATE})`)}if(o){console.log("");console.log(`Your version of ${const_1.TITLE_APP} is out of date! The latest version`);console.log(`is ${i}. You can update by running:`);console.log(` npm install -g @fromeroc9/testform`)}}function createCli(){const e=(0,cac_1.cac)(const_1.TITLE_CLI);e.option("-C, --chdir <dir>","Working directory (default: current directory)",{default:"."});e.option("-v, --verbose","Show detailed debug output");e.option("--no-color","Disable colorized console output");e.option("--var <var>","Set a variable value (key=value)");e.option("--var-file <file>","Load variables from a YAML file");e.command("init","Initialize a new Testform workspace").option("--backend-type <type>","Backend type to initialize (local | github | s3 | azurerm | gcs | oci)").option("--backend-config <config>","Backend configuration override").option("--provider <type>","Provider type to initialize (github | local | gitlab)").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).option("--reconfigure","Reconfigure backend").option("--migrate-state","Migrate state to new backend").option("--backend","Configure backend",{default:true}).option("--json","Output results in JSON format").option("--input","Allow interactive input",{default:true}).action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);const n=e.backendType||(typeof e.backend==="string"?e.backend:undefined);const s=e.provider;const r=e.backend!==false&&e.backend!=="false";await(0,init_1.initCmd)({dir:t,backendType:n,providerType:s,verbose:Boolean(e.verbose),backendConfigRaw:e.backendConfig,lock:e.lock??true,lockTimeout:e.lockTimeout??"0s",reconfigure:e.reconfigure,migrateState:e.migrateState,backendEnabled:r,isJson:e.json,inputEnabled:e.input??true})}));e.command("validate [targetPath]","Check feature files for syntax and DSL violations").option("--json","Output diagnostics in JSON format").option("--test-directory <dir>","Subdirectory containing test files").option("--no-tests","Suppress test execution checks").option("--query <query>","Filter query for validation").option("--target <target>","Target a specific resource or feature file").option("--var <var>","Set a variable value (key=value)").option("--var-file <file>","Load variable values from a YAML file").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);const s=e||n;const r=(0,cli_1.resolveVariableParser)(t,n);await(0,validate_1.validateCmd)({targetPath:s,dir:n,verbose:Boolean(t.verbose),target:t.target,variables:r,isJson:t.json,testDirectory:t.testDirectory,noTests:t.tests===false,query:t.query})}));e.command("plan","Generate and show an execution plan").option("-o, --out <path>","Write the plan to the given file").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).option("--input","Allow interactive input",{default:true}).option("--json","Output results in JSON format").option("--detailed-exitcode","Return detailed exit code on plan changes").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").option("--target <target>","Target a specific resource").option("--destroy","Generate plan to destroy all resources").option("--refresh","Refresh remote state before planning",{default:true}).option("--refresh-only","Only refresh state without planning changes").option("--replace <target>","Force replacement of specified resource").option("--parallelism <n>","Concurrent operation limit").option("--compact-warnings","Show warnings in compact form").option("--test-directory <dir>","Directory containing feature files").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);const n=(0,cli_1.resolveVariableParser)(e,t);await(0,plan_1.planCmd)({dir:t,verbose:Boolean(e.verbose),outPath:e.out,lock:e.lock??true,lockTimeout:e.lockTimeout??"0s",input:e.input!==false&&e.input!=="false",variables:n,isJson:e.json,detailedExitCode:e.detailedExitcode,statePath:e.state,backupPath:e.backup,target:e.target,destroyPlan:e.destroy,refresh:e.refresh??true,refreshOnly:e.refreshOnly,replaceTargets:e.replace,parallelism:e.parallelism,compactWarnings:e.compactWarnings??false,testDirectory:e.testDirectory})}));e.command("apply [planFile]","Create or update infrastructure according to configuration").option("-a, --auto-approve","Skip interactive approval of plan").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).option("--input","Allow interactive input",{default:true}).option("--json","Output results in JSON format").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").option("--target <target>","Target a specific resource").option("--refresh","Refresh remote state before applying",{default:true}).option("--refresh-only","Only refresh state without applying changes").option("--replace <target>","Force replacement of specified resource").option("--parallelism <n>","Concurrent operation limit").option("--compact-warnings","Show warnings in compact form").option("--test-directory <dir>","Directory containing feature files").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);const s=(0,cli_1.resolveVariableParser)(t,n);await(0,apply_1.applyCmd)({dir:n,autoApprove:Boolean(t.autoApprove),verbose:Boolean(t.verbose),planFile:e,lock:t.lock??true,lockTimeout:t.lockTimeout??"0s",input:t.input??true,variables:s,statePath:t.state,backupPath:t.backup,target:t.target,refresh:t.refresh??true,refreshOnly:t.refreshOnly,replaceTargets:t.replace,parallelism:t.parallelism,compactWarnings:t.compactWarnings??false,testDirectory:t.testDirectory})}));e.command("destroy","Destroy all remote-managed test resources").option("-a, --auto-approve","Skip interactive approval").option("--target <target>","Target a specific resource").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).option("--input","Allow interactive input",{default:true}).option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);await(0,destroy_1.destroyCmd)({dir:t,autoApprove:Boolean(e.autoApprove),verbose:Boolean(e.verbose),target:e.target,lock:e.lock??true,lockTimeout:e.lockTimeout??"0s",input:e.input??true,statePath:e.state,backupPath:e.backup})}));e.command("show [path]","Inspect Testform state or a plan file").option("--json","Output state in JSON format").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);await(0,show_1.showCmd)({path:e,isJson:t.json,verbose:Boolean(t.verbose),dir:n,statePath:t.state,backupPath:t.backup})}));e.command("output [name]","Read an output from a state file").option("--state <path>","Path to the state file").option("--json","Produce output in a machine-readable JSON format").option("--raw","Print raw string value without formatting").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);const s=(0,cli_1.resolveVariableParser)(t,n);await(0,output_1.outputCmd)({dir:n,name:e,statePath:t.state,isJson:Boolean(t.json),raw:Boolean(t.raw),variables:s})}));e.command("refresh","Update the state file against remote target platform").option("--target <target>","Resource to target (can be specified multiple times)").option("--var <var>","Set a variable value").option("--var-file <file>","Load variable values from file").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").option("--parallelism <n>","Concurrent operation limit").option("--compact-warnings","Show warnings in compact form").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);await(0,refresh_1.refreshCmd)({dir:t,verbose:Boolean(e.verbose),target:e.target,lock:e.lock??true,lockTimeout:e.lockTimeout??"0s",statePath:e.state,backupPath:e.backup,parallelismRaw:e.parallelism,compactWarnings:e.compactWarnings??false})}));e.command("diff","Display human-readable difference between local and state").option("--target <target>","Target a specific resource or file").option("--remote","Detect and compare against remote target platform").option("-i, --interactive","Interactively resolve detected drift (pull / overwrite / skip)").option("--test-directory <dir>","Subdirectory containing test files").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);const n=(0,cli_1.resolveVariableParser)(e,t);await(0,diff_1.diffCmd)({dir:t,testDirectory:e.testDirectory,verbose:Boolean(e.verbose),target:e.target,remote:Boolean(e.remote),interactive:Boolean(e.interactive),statePath:e.state,backupPath:e.backup,variables:n})}));e.command("import <address> <issueNumber>","Associate an existing remote Issue with a local scenario").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);await(0,import_1.importCmd)({dir:s,identityArg:e,issueNumber:t,lock:n.lock??true,lockTimeout:n.lockTimeout??"0s",statePath:n.state,backupPath:n.backup})}));e.command("state [subcommand] [...args]","Advanced state management (clean, list, show, rm, mv, pull, push)").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").option("--json","Output in JSON format").option("--id <id>","Filter by ID").option("--dry-run","Preview state modifications without writing").option("--force","Bypass safety checks").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);if(!e){console.log((0,help_1.getCommandHelp)("state")||help_1.HELP_GLOBAL);return}await(0,state_1.stateCmd)({dir:s,action:e,args:t||[],statePath:n.state,backupPath:n.backup,isJson:n.json,id:n.id,dryRun:n.dryRun,force:n.force})}));e.command("taint <address>","Mark a resource instance as degraded or corrupted").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").option("--allow-missing","Do not error if resource is missing from state").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);await(0,taint_1.taintCmd)({dir:n,action:"taint",identityRaw:e,statePath:t.state,backupPath:t.backup,allowMissing:t.allowMissing,lock:t.lock??true,lockTimeout:t.lockTimeout??"0s"})}));e.command("untaint <address>","Remove degraded status mark from a resource instance").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").option("--allow-missing","Do not error if resource is missing from state").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);await(0,taint_1.taintCmd)({dir:n,action:"untaint",identityRaw:e,statePath:t.state,backupPath:t.backup,allowMissing:t.allowMissing,lock:t.lock??true,lockTimeout:t.lockTimeout??"0s"})}));e.command("workspace [subcommand] [name]","Workspace management (list, select, new, delete, show)").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);const r=[e,t].filter(Boolean);await(0,workspace_1.workspaceCmd)({dir:s,verbose:Boolean(n.verbose),args:r})}));e.command("ephemeral [subcommand] [id]","Manage temporary CI/CD QA sandboxes (up, down, list, show)").option("-a, --auto-approve","Skip interactive approval").option("--force","Force destruction even if state is missing").option("--test-directory <dir>","Subdirectory containing test files").option("--json","Output results formatted as JSON").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);await(0,ephemeral_1.ephemeralCmd)({subcommand:e,id:t,dir:s,testDirectory:n.testDirectory,autoApprove:Boolean(n.autoApprove),force:Boolean(n.force),json:Boolean(n.json),verbose:Boolean(n.verbose)})}));e.command("force-unlock <lockId>","Release a stuck state lock").option("--force","Do not ask for confirmation").option("--state <path>","Path to state file").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);await(0,force_unlock_1.forceUnlockCmd)({dir:n,lockId:e,force:t.force,statePath:t.state})}));e.command("report [type]","Generate test metrics and matrices (summary, traceability, coverage, etc.)").option("--format <format>","Report output format (md, json, csv, xlsx, docx)",{default:"md"}).option("--filter <filter>","Filter report items (key=value or inferred text search)").option("--target <target>","Target a specific resource, testrun (@tr-N), or testplan (@tp-N)").option("--group-by <field>","Group report items dynamically by field").option("--template <path>","Path to custom template file").option("-o, --out <path>","Write report to destination file").option("--state <path>","Path to state file").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);const s=(0,cli_1.resolveVariableParser)(t,n);const r=t.filter?Array.isArray(t.filter)?t.filter:[t.filter]:[];await(0,report_1.reportCmd)({dir:n,type:e||"testcase-summary",format:t.format||"md",filter:r,target:t.target,groupBy:t.groupBy||t["group-by"],template:t.template,variables:s,out:t.out,statePath:t.state})}));e.command("suite [subcommand] [...args]","Manage test suites and execution files (init, fill, link, mark, tags)").option("-s, --scope <scope>","Suite scope (testrun, testplan)").option("--fill","Autocomplete empty testrun rules with their testcases").option("--link <id_status>","Link a testcase or testrun into a suite").option("--mark <id_status>","Record execution status in a testrun").option("--tags <tags>",'Filter testcase scenarios by bracketed tag expression to generate testrun (e.g. "[@smoke]" or "file.case.feature.[@smoke]")').option("--title <title>","Suite title").option("--rule <rule>","Rule definitions").option("--target <target>","Target feature file (identity tag @tr-N/@tp-N, canonical address, or file path)").option("--test-directory <dir>","Directory containing test files").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);const r=(0,cli_1.resolveVariableParser)(n,s);const i=n.rule?Array.isArray(n.rule)?n.rule:[n.rule]:[];await(0,suite_1.suiteCmd)({dir:s,subCommand:e,subArgs:t||[],scope:n.scope||"testrun",title:n.title,rules:i,target:n.target,tags:n.tags,fill:Boolean(n.fill),link:typeof n.link==="string"?n.link:undefined,mark:typeof n.mark==="string"?n.mark:undefined,testDirectory:n.testDirectory,statePath:n.state,backupPath:n.backup,variables:r,verbose:Boolean(n.verbose)})}));e.command("tool <subcommand> [...args]","QA utilities (feature, autocomplete, state)").option("--title <title>","Feature title").option("--rule <rule>","Rule definitions").option("--target <target>","Target feature file").option("--test-directory <dir>","Directory containing test files").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);const r=(0,cli_1.resolveVariableParser)(n,s);const i=n.rule?Array.isArray(n.rule)?n.rule:[n.rule]:[];await(0,tool_1.toolCmd)({dir:s,subCommand:e,subArgs:t||[],scope:n.scope||"testcase",title:n.title,rules:i,target:n.target,testDirectory:n.testDirectory,statePath:n.state,backupPath:n.backup,variables:r,verbose:Boolean(n.verbose)})}));e.command("fmt [targetDir]","Rewrites Gherkin configuration files to canonical format").option("--check","Check if files are formatted without rewriting").option("--diff","Display diffs instead of rewriting files").option("--list","List unformatted files",{default:true}).option("--write","Write reformatted files to disk",{default:true}).option("--recursive","Recursively format subdirectories").option("--test-directory <dir>","Test directory").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);const s=t.testDirectory?(0,path_1.resolve)(n,t.testDirectory):n;const r=e?(0,path_1.resolve)(n,e):s;await(0,fmt_1.fmtCmd)({dir:r,check:t.check,diff:t.diff,list:t.list??true,write:t.write??true,recursive:t.recursive})}));e.command("query","Query and filter managed test resources in state").option("--filter <filter>","Filter resources by key=value or inferred text search").option("--target <target>","Target a specific resource, testrun, or testplan").option("--generate-config-out <path>","Generate import configuration blocks at PATH").option("--var <var>","Set a variable value").option("--var-file <file>","Load variable values from file").option("--json","Output results formatted as JSON").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);const n=(0,cli_1.resolveVariableParser)(e,t);await(0,query_1.queryCmd)({dir:t,testDirectory:e.testDirectory,filter:e.filter,target:e.target,generateConfigOut:e.generateConfigOut,variables:n,json:Boolean(e.json),verbose:Boolean(e.verbose),statePath:e.state,backupPath:e.backup})}));e.command("print <file>","Print parsed representation of a feature file").option("--format <format>","Print format",{default:"testform"}).action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);const s=(0,cli_1.resolveVariableParser)(t,n);await(0,print_1.printCmd)({dir:n,file:e,format:t.format||"testform",variables:s})}));e.command("graph","Generate a visual dependency graph of resources").option("--draw-cycles","Highlight cycles in dependency graph").option("--format <format>","Output format for the graph (dot, mermaid, tree) (default: dot)").option("--type <type>","Type of operation graph to output (plan, plan-refresh-only, plan-destroy, apply)").option("--plan <plan>","Render graph using the specified plan file").option("--module-depth <n>","(deprecated) Depth of modules to show in output").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);const n=(0,cli_1.resolveVariableParser)(e,t);await(0,graph_1.graphCmd)({dir:t,drawCycles:e.drawCycles,variables:n,format:e.format||"dot",type:e.type,plan:e.plan,moduleDepth:e.moduleDepth?Number(e.moduleDepth):undefined})}));e.command("login [hostname]","Authenticate with a remote provider").action((async e=>{await(0,login_1.loginCmd)({hostname:e||"github.com"})}));e.command("logout [hostname]","Remove stored credentials").action((async e=>{await(0,logout_1.logoutCmd)({hostname:e||"github.com"})}));e.command("modules","Show all declared modules in a working directory").option("--json","Output results in JSON format").option("--var <var>","Set a variable value").option("--var-file <file>","Load variable values from file").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);await(0,modules_1.modulesCmd)({dir:t,isJson:Boolean(e.json)})}));e.command("providers [action] [...args]","Prints a tree of providers and schemas").option("--json","Output schema representation in JSON format").option("--platform <platform>","Choose target platform").option("--fs-mirror <dir>","Filesystem mirror directory").option("--net-mirror <url>","Network mirror base URL").option("--enable-plugin-cache","Enable plugin cache usage").option("--test-directory <dir>","Directory containing test files").option("--var <var>","Set a variable value").option("--var-file <file>","Load variable values from file").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);const r=(0,cli_1.resolveVariableParser)(n,s);await(0,providers_1.providersCmd)({dir:s,action:e,args:Array.isArray(t)?t:t?[t]:[],testDirectory:n.testDirectory,variables:r,isJson:Boolean(n.json)})}));e.command("policy","Inspect, enable, or disable validation policies").option("--enable <id>","Enable a specific policy").option("--disable <id>","Disable a specific policy").option("--show <id>","Show detailed description of a policy").option("-s, --scope <scope>","Filter policies by scope (testcase, testrun, testplan)").option("--json","Output policies in JSON format").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);await(0,policy_1.policyCmd)({dir:t,scope:e.scope,enable:e.enable,disable:e.disable,show:e.show,json:Boolean(e.json),verbose:Boolean(e.verbose)})}));e.command("functions [name]","Inspect and evaluate built-in expression functions").option("--eval <expr>","Evaluate expression live in terminal").action((async(e,t)=>{await(0,functions_1.functionsCmd)({name:e,evalExpr:t.eval})}));e.command("version","Show detailed version information").option("--json","Output the version information as a JSON object.").action((async e=>{await printVersion(Boolean(e?.json),true)}));e.help();e.version(`${const_1.TITLE_APP} v${const_1.VERSION_CLI}`);return e}function handleUnknownCommand(e){const t=["apply","destroy","diff","ephemeral","fmt","force-unlock","functions","graph","import","init","login","logout","modules","output","plan","policy","print","providers","query","refresh","report","show","state","suite","taint","tool","untaint","validate","version","workspace"];const n=(0,utils_1.suggestCommand)(e,t);if(n){console.error(`${const_1.TITLE_APP} has no command named "${e}". Did you mean "${n}"?\n\nTo see all of ${const_1.TITLE_APP}'s top-level commands, run:\n ${const_1.TITLE_CLI} -help`)}else{console.error(`${const_1.TITLE_APP} has no command named "${e}".\n\nTo see all of ${const_1.TITLE_APP}'s top-level commands, run:\n ${const_1.TITLE_CLI} -help`)}process.exit(1)}const main=async()=>{const e=process.argv.slice(2);if(e.some((e=>e==="--no-color"||e==="-no-color"))){chalk_2.default.level=0;process.env.NO_COLOR="1"}if(e.length===0){console.log(help_1.HELP_GLOBAL);process.exit(0)}if(e.includes("--version")||e.includes("-version")||e.includes("-v")&&e.length===1){const t=e.includes("--json")||e.includes("-json");await printVersion(t,false);process.exit(0)}if(e.includes("--help")||e.includes("-help")||e.includes("-h")){const t=e.filter((e=>!e.startsWith("-")));if(t.length===0){console.log(help_1.HELP_GLOBAL);process.exit(0)}const n=t.slice(0,2).join(" ");const s=t[0];if(n){const e=(0,help_1.getCommandHelp)(n);if(e){console.log(e);process.exit(0)}}if(s){const e=(0,help_1.getCommandHelp)(s);if(e){console.log(e);process.exit(0)}handleUnknownCommand(s)}}const t=(0,cli_1.normalizeCliArgs)(e);const n=createCli();try{n.parse([process.argv[0],process.argv[1],...t],{run:false});if(!n.matchedCommand){const t=e.filter((e=>!e.startsWith("-")));const n=t[0];if(n){handleUnknownCommand(n)}else{console.log(help_1.HELP_GLOBAL);process.exit(1)}}await n.runMatchedCommand()}catch(e){if(e instanceof errors_1.TestformError){if(!e.logged){try{logger_1.logger.error(e.message||String(e))}catch{}}process.exit(e.exitCode)}if(e.name==="CACError"){const t=e.message||"";const n=t.toLowerCase();let s="Missing required argument";let r=[t,`Run '${const_1.TITLE_CLI} --help' for usage instructions.`];if(n.includes("missing required arg")){const e=t.match(/`([^`]+)`/);const n=e?e[1]:"";const i=n.split(" ")[0]||"";s="Missing required argument";r=[`Missing required argument for command \`${n}\`.`,`Run '${const_1.TITLE_CLI} ${i} --help' for usage instructions.`]}else if(n.includes("unknown option")||n.includes("unknown flag")){s="Failed to parse command-line flags";r=[t,`Run '${const_1.TITLE_CLI} --help' for usage instructions.`]}else{s=t.charAt(0).toUpperCase()+t.slice(1)}logger_1.logger.push({type:"error",title:s,detail:r});process.exit(1)}try{logger_1.logger.error(e.message||String(e))}catch{}process.exit(1)}};exports.main=main;var resources_1=__nccwpck_require__(7862);Object.defineProperty(exports,"resource",{enumerable:true,get:function(){return resources_1.resource}});Object.defineProperty(exports,"registerResource",{enumerable:true,get:function(){return resources_1.registerResource}});var policy_2=__nccwpck_require__(2721);Object.defineProperty(exports,"policy",{enumerable:true,get:function(){return policy_2.policy}});Object.defineProperty(exports,"registerPolicy",{enumerable:true,get:function(){return policy_2.registerPolicy}});var evaluator_1=__nccwpck_require__(2825);Object.defineProperty(exports,"evaluateExpression",{enumerable:true,get:function(){return evaluator_1.evaluateExpression}});Object.defineProperty(exports,"interpolateExpressions",{enumerable:true,get:function(){return evaluator_1.interpolateExpressions}});var variables_1=__nccwpck_require__(9922);Object.defineProperty(exports,"VariableParser",{enumerable:true,get:function(){return variables_1.VariableParser}});var config_2=__nccwpck_require__(4489);Object.defineProperty(exports,"Config",{enumerable:true,get:function(){return config_2.Config}});__exportStar(__nccwpck_require__(4855),exports);if(require.main===require.cache[eval("__filename")]||!module.parent){(0,exports.main)().catch((e=>{if(e instanceof errors_1.TestformError){if(!e.logged){try{logger_1.logger.error(e.message||String(e))}catch{}}process.exit(e.exitCode)}try{logger_1.logger.error(e.message||String(e))}catch{}process.exit(1)}))}},1043:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BaseParser=t.FIELD_PATTERN=void 0;const s=n(119);const r=n(8569);const i=n(9896);const o=n(6928);const a=n(6028);const c=n(1859);const l=n(2978);const u=n(9606);const d=n(3912);t.FIELD_PATTERN=/^(?:field)\s+([A-Za-z0-9_.\- ]+?)\s*=\s*(.+)$/i;class BaseParser{dir;variables;moduleRegistry;constructor(e,t){this.dir=e;this.variables=t}getModuleRegistry(){if(!this.moduleRegistry){this.moduleRegistry=new c.ModuleRegistry(this.dir)}return this.moduleRegistry}find(e){return(0,u.findFeatureFiles)(e,true)}format(e,t){const n=e.feature;const s=e.uri??"(unknown)";const r=t||s;const toStep=e=>({keyword:e.keyword,keywordType:e.keywordType,text:e.text});const toBackground=e=>({keyword:e.keyword,name:e.name,steps:(e.steps??[]).map(toStep)});const interpolate=(e,t,n)=>t.reduce(((e,t,s)=>e.split(`<${t}>`).join(n[s])),e);const processChildren=(e,t,i)=>{const o=[];const a=e[0]?.background?toBackground(e[0].background):t;for(const t of e){if(t.background)continue;if(t.scenario){const e=t.scenario;const u=(n?.tags??[]).map((e=>(0,l.restoreTagsWithSpaces)(e.name)));const d=[...u,...(e.tags??[]).map((e=>(0,l.restoreTagsWithSpaces)(e.name)))];const f=d.includes("@unique");const p=e.name.includes("<")||(e.steps??[]).some((e=>e.text.includes("<")))||d.some((e=>e.includes("<")));const h={tags:(n?.tags??[]).map((e=>(0,l.restoreTagsWithSpaces)(e.name))),keyword:n?.keyword??"",name:n?.name??"",description:n?.description??"",location:n?.location.line??0};const m=[];const g=(0,l.reassembleSplitTags)(d,"@module(");for(const e of g){const t=(0,c.parseModuleTargets)(e,this.getModuleRegistry());if(t){for(const e of t){const t=(0,c.resolveModulePath)(r,e.source,this.dir,this.getModuleRegistry());if(t){const n={};const s=e.variable;if(s){for(const[e,t]of Object.entries(s)){if(typeof t==="string"&&this.variables){n[e]=this.variables.applyToTemplate(t)}else{n[e]=t}}}m.push(...(0,c.loadModuleSteps)(t,e.scenario,n,this.variables))}}}}if(f&&p&&(e.examples??[]).length>0){for(const t of e.examples){const n=(t.tableHeader?.cells??[]).map((e=>e.value));for(const r of t.tableBody??[]){const t=(r.cells??[]).map((e=>e.value));o.push({uri:s,feature:h,location:e.location.line,keyword:e.keyword,name:interpolate(e.name,n,t),description:e.description,tags:d.map((e=>interpolate(e,n,t))),steps:[...m,...(e.steps??[]).map((e=>({keyword:e.keyword,keywordType:e.keywordType,text:interpolate(e.text,n,t)})))],...a?{background:JSON.parse(JSON.stringify(a))}:{},...i?{rule:i}:{}})}}}else{o.push({uri:s,feature:h,location:e.location.line,keyword:e.keyword,name:e.name,description:e.description,tags:d,steps:[...m,...(e.steps??[]).map(toStep)],...a?{background:JSON.parse(JSON.stringify(a))}:{},...i?{rule:i}:{}})}}if("rule"in t&&t.rule){const e=t.rule;const r={keyword:e.keyword,name:e.name,description:e.description??""};const i=processChildren(e.children??[],a,r);if(i.length===0){const t=(e.children??[])[0]?.background;const i=t?toBackground(t):a;o.push({uri:s,feature:{keyword:n?.keyword??"",name:n?.name??"",description:n?.description??"",tags:(n?.tags??[]).map((e=>e.name)),location:n?.location?.line??0},location:e.location.line,keyword:e.keyword,name:"*",description:e.description,tags:[...(n?.tags??[]).map((e=>e.name))],steps:[],...i?{background:JSON.parse(JSON.stringify(i))}:{},rule:r})}else{o.push(...i)}}}return o};if(!n)return[];return processChildren(n.children??[])}findProjectRoot(e){const{resolve:t,dirname:s}=n(6928);const{existsSync:r}=n(9896);let i=t(e);const o=t("/");while(i!==o){for(const e of a.CONFIG_FILE_NAMES){const n=t(i,e);if(r(n)){return i}}const e=s(i);if(e===i)break;i=e}return e}content(){const e=this.find(this.dir);const t=[];const n=this.findProjectRoot(this.dir);const a=new Set;for(const u of e){let f=(0,i.readFileSync)(u,"utf-8");if(this.variables){f=this.variables.applyToTemplate(f)}f=(0,l.sanitizeTagsWithSpaces)(f);const p=new s.Parser(new s.AstBuilder(r.IdGenerator.uuid()),new s.GherkinClassicTokenMatcher);let h=null;try{h=p.parse(f)}catch(e){const t=e.message||String(e);const s=t.match(/\((\d+):(\d+)\):\s*(.+)/);const r=s?parseInt(s[1],10):undefined;const i=f.split("\n");const a=r&&i[r-1]?i[r-1].trim():undefined;const c=(0,o.relative)(n,u)||u;const l=t.split("\n").map((e=>e.trim())).filter((e=>e.length>0&&!e.startsWith("Parser errors:")));d.Diag.structureError({file:c,message:"Failed to parse Gherkin feature file",location:{file:c,line:r,snippet:a},detail:l}).abort()}h.uri=(0,o.relative)(n,u);const m=(h.feature?.tags??[]).map((e=>(0,l.restoreTagsWithSpaces)(e.name)));const g=(0,l.reassembleSplitTags)(m,"@module(");for(const s of g){const r=(0,c.parseModuleTargets)(s,this.getModuleRegistry());if(r){for(const s of r){const r=(0,c.resolveModulePath)(u,s.source,n,this.getModuleRegistry());if(r&&!e.includes(r)&&!a.has(r)){a.add(r);try{let e=(0,i.readFileSync)(r,"utf-8");if(this.variables){e=this.variables.applyToTemplate(e)}e=(0,l.sanitizeTagsWithSpaces)(e);const s=p.parse(e);s.uri=(0,o.relative)(n,r);t.push(...this.format(s,r))}catch{}}}}}t.push(...this.format(h,u))}return t}dslFields(e){const t=new Map;const n=new Map;for(const s of e){if(s.source==="step"||s.type==="keywords"){t.set(s.name.toLowerCase(),s)}if(s.source==="tag"||s.type==="tags"){n.set(s.name.toLowerCase(),s)}}return{keywordFields:t,tagFields:n}}compileIdentityMatcher(e){if(!e)return null;const t=e.trim().replace(/^@/,"");if(t.includes("*")){const e=t.split("*");return{type:"wildcard",prefix:e[0],suffix:e[1]||""}}return{type:"exact",value:t}}matchIdentity(e,t){if(t.type==="wildcard"){for(const n of e){const e=n.replace(/^@/,"");if(e.startsWith(t.prefix)&&e.endsWith(t.suffix)){return{identityValue:n,tagToRemove:n}}}return{}}const n=e.find((e=>e.replace(/^@/,"")===t.value));if(n){return{identityValue:n,tagToRemove:n}}return{}}}t.BaseParser=BaseParser},3800:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TestcaseParser=void 0;const s=n(1043);class TestcaseParser extends s.BaseParser{filter(e,t,n){const r=t.identity;const i=t.fields||[];const{keywordFields:o,tagFields:a}=this.dslFields(i);const c=this.compileIdentityMatcher(r);for(const t of e){const e={};if(n){const e=`@${n}`;if(!t.tags)t.tags=[];if(!t.tags.includes(e)){t.tags.push(e)}}const{identityValue:r,tagToRemove:l}=c?this.matchIdentity(t.tags,c):{};t.tags=t.tags.filter((e=>e!=="@unique"));if(l){t.tags=t.tags.filter((e=>e!==l))}if(t.description){const n=t.description.match(/^\s*\*\s*mark\s+status\s*=\s*(.*)$/im);if(n){e["status"]=n[1]?.trim()}}if(t.background){t.background.steps=t.background.steps.filter((n=>{const r=n.text.match(/^\s*(?:\*\s*)?mark\s+status\s*=\s*(.*)$/i);if(r){e["status"]=r[1]?.trim();return false}const i=n.text.match(s.FIELD_PATTERN);if(!i)return true;const a=i[1]?.trim().toLowerCase();const c=i[2]?.trim();if(!a||c===undefined)return true;const l=o.get(a);if(!l){(t.custom??={}).policy??=[];t.custom.policy.push({type:"undeclared-field",field:a});return true}e[l.name]=c;return false}));t.steps=[...t.background.steps,...t.steps];t.background.steps=[]}t.steps=t.steps.filter((n=>{const r=n.text.match(/^\s*(?:\*\s*)?mark\s+status\s*=\s*(.*)$/i);if(r){e["status"]=r[1]?.trim();return false}const i=n.text.match(s.FIELD_PATTERN);if(!i)return true;const a=i[1]?.trim().toLowerCase();const c=i[2]?.trim();if(!a||c===undefined)return true;const l=o.get(a);if(!l){(t.custom??={}).policy??=[];t.custom.policy.push({type:"undeclared-field",field:a});return true}e[l.name]=c;return false}));const tagFilter=t=>{for(const n of a.values()){const s=n.enum??n.values;const r=Array.isArray(s)?s:typeof s==="string"?[s]:[];if(r.includes(t)){e[n.name]=t;return false}}return true};t.tags=t.tags.filter(tagFilter);if(t.feature&&t.feature.tags){t.feature.tags=t.feature.tags.filter(tagFilter)}for(const n of i){if(e[n.name]===undefined&&n.default!==undefined){const t=Array.isArray(n.default)?n.default[0]:n.default;if(t!==undefined){e[n.name]=t}}if(n.required&&!e[n.name]){(t.custom??={}).policy??=[];t.custom.policy.push({type:"required-field",field:n.name});e[n.name]=""}else if(e[n.name]===undefined){e[n.name]=""}}t.custom={...t.custom??{},identity:r,fields:e}}return e}}t.TestcaseParser=TestcaseParser},1741:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TestplanParser=void 0;const s=n(3800);class TestplanParser extends s.TestcaseParser{filter(e,t,n){const s=super.filter(e,t,n);const r={};for(const e of s){(r[e.uri]??=[]).push(e)}return Object.entries(r).map((([e,t])=>{const n=t.some((e=>e.name&&e.name!=="*"));if(n){throw new Error(`Testplan validation failed: Testplans must not contain explicit Scenario blocks. Found in ${e}`)}const s=JSON.parse(JSON.stringify(t[0]));s.custom??={};const r=t.find((e=>e.custom&&e.custom.identity));if(r&&r.custom?.identity){s.custom.identity=r.custom.identity}else{s.custom.identity=e}s.custom.testruns=t.filter((e=>e.rule)).map((e=>e.rule.name));return s}))}}t.TestplanParser=TestplanParser},2853:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TestrunParser=void 0;const s=n(3800);class TestrunParser extends s.TestcaseParser{filter(e,t,n){const s=super.filter(e,t,n);const r={};for(const e of s){(r[e.uri]??=[]).push(e)}return Object.entries(r).map((([e,t])=>{const n=JSON.parse(JSON.stringify(t[0]));n.custom??={};const s=t.find((e=>e.custom&&e.custom.identity));if(s&&s.custom?.identity){n.custom.identity=s.custom.identity}else{n.custom.identity=e}n.custom.testcases=t.filter((e=>e.rule&&e.name)).map((e=>`${e.rule?.name}.${e.name}`));n.custom.groupScenarios=t;return n}))}}t.TestrunParser=TestrunParser},3651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.loadCustomProvider=loadCustomProvider;const s=n(6928);const r=n(7016);const i=n(9896);async function loadCustomProvider(e,t=process.cwd()){const{source:o,...a}=e;if(!o){throw new Error('Custom provider configuration must specify a "source" path or package name.')}let c;const l=(0,s.resolve)(t,o);if((0,i.existsSync)(l)){try{c=await n(9272)((0,r.pathToFileURL)(l).href)}catch(e){try{c=require(l)}catch(t){throw new Error(`Failed to load custom provider from "${l}": ${e.message||e}`)}}}else{try{c=await n(9272)(o)}catch(e){try{c=require(o)}catch(e){throw new Error(`Could not resolve custom provider from local path "${l}" or package "${o}".`)}}}const u=c.default||c.Provider||c;if(typeof u!=="function"){throw new Error(`Custom provider module from "${o}" does not export a valid constructor class (export default or export class Provider).`)}return new u(a)}},8669:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GitHubAdapter=t.GitHubProvider=void 0;const s=n(1227);const r=n(2633);const i=n(1227);const o=n(6028);class Mutex{mutex=Promise.resolve();lock(){let begin=()=>{};this.mutex=this.mutex.then((()=>new Promise(begin)));return new Promise((e=>{begin=e}))}}const a=new Mutex;class GitHubProvider{token;owner;repo;projectId;config;constructor(e){this.config=e;const t=new r.Credentials;const n=Object.prototype.hasOwnProperty.call(process.env,e.tokenEnv)?process.env[e.tokenEnv]:undefined;let s=t.getToken("github.com")||n||process.env.GITHUB_TOKEN;if(!s&&(e.tokenEnv.startsWith("ghp_")||e.tokenEnv.startsWith("github_pat_")||e.tokenEnv.startsWith("ghs_"))){s=e.tokenEnv}this.token=s||"";this.owner=e.owner;this.repo=e.repository;this.projectId=e.projectId}async ensureToken(){if(this.token)return;s.logger.push({type:"error",title:`GitHub token not found`,detail:[`Environment variable "${this.config.tokenEnv}" is not set.`],close:true})}async request(e,t,s,r=1){await this.ensureToken();const i=t.startsWith("http")?t:`https://api.github.com${t}`;const a=5;try{const c=await fetch(i,{method:e,headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json","X-GitHub-Api-Version":"2022-11-28","Content-Type":"application/json","User-Agent":`${o.TITLE_CLI}/${o.VERSION_CLI}`},body:s?JSON.stringify(s):undefined});if(c.status===403||c.status===429){const i=await c.text();const o=c.status===429||i.toLowerCase().includes("rate limit")||i.toLowerCase().includes("abuse")||i.toLowerCase().includes("secondary");if(o&&r<=a){const i=c.headers.get("retry-after");const o=i?parseInt(i,10):r*3;const l=n(465);console.warn(l.yellow(`\n⚠️ GitHub Rate Limit / Secondary Rate Limit hit. Retrying in ${o} seconds... (Attempt ${r}/${a})`));await new Promise((e=>setTimeout(e,o*1e3)));return this.request(e,t,s,r+1)}else{const e=new Error(i);e.name=`GitHub API Error [${c.status}]`;throw e}}if(!c.ok){const e=await c.text();const t=new Error(e);t.name=`GitHub API Error [${c.status}]`;throw t}if(c.status===204){return null}return await c.json()}catch(i){if(r<=a&&(!i.name||!i.name.startsWith("GitHub API Error"))){const o=r*3;const c=n(465);console.warn(c.yellow(`\n⚠️ Network error: ${i.message}. Retrying in ${o} seconds... (Attempt ${r}/${a})`));await new Promise((e=>setTimeout(e,o*1e3)));return this.request(e,t,s,r+1)}throw i}}async graphql(e,t={}){await this.ensureToken();const n=await this.request("POST","https://api.github.com/graphql",{query:e,variables:t});if(n.errors&&n.errors.length>0){const e=new Error(JSON.stringify(n.errors));e.name="GitHub API Error";throw e}return n.data}async createIssue(e){const t=await this.request("POST",`/repos/${this.owner}/${this.repo}/issues`,{title:e.title,body:e.body,labels:e.labels,assignees:e.assignees,milestone:e.milestone});return{id:t.id,number:t.number,title:t.title??"",state:t.state,node_id:t.node_id,created_at:t.created_at,updated_at:t.updated_at}}async updateIssue(e,t){const n=await this.request("PATCH",`/repos/${this.owner}/${this.repo}/issues/${e}`,{title:t.title,body:t.body,labels:t.labels,assignees:t.assignees,milestone:t.milestone});return{id:n.id,number:n.number,title:n.title??"",state:n.state,node_id:n.node_id,created_at:n.created_at,updated_at:n.updated_at}}async closeIssue(e){await this.request("PATCH",`/repos/${this.owner}/${this.repo}/issues/${e}`,{state:"closed"})}async getIssue(e){try{const t=await this.request("GET",`/repos/${this.owner}/${this.repo}/issues/${e}`);return{id:t.id,number:t.number,title:t.title??"",body:t.body??"",state:t.state,node_id:t.node_id,labels:t.labels?.map((e=>e.name))??[],assignees:t.assignees?.map((e=>e.login))??[],milestone:t.milestone?.title??""}}catch{return null}}async listIssuesByLabel(e){const t=[];let n=1;while(true){const s=await this.request("GET",`/repos/${this.owner}/${this.repo}/issues?labels=${encodeURIComponent(e)}&state=all&per_page=100&page=${n}`);if(s.length===0)break;for(const e of s){t.push({id:e.id,number:e.number,title:e.title??"",state:e.state})}if(s.length<100)break;n++}return t}async getMilestoneByTitle(e){if(!e)return undefined;try{const t=await this.request("GET",`/repos/${this.owner}/${this.repo}/milestones?state=all&per_page=100`);const n=t.find((t=>t.title.toLowerCase()===e.toLowerCase()));return n?n.number:undefined}catch{return undefined}}async createIssueComment(e,t){const n=await this.request("POST",`/repos/${this.owner}/${this.repo}/issues/${e}/comments`,{body:t});return{id:n.id}}async updateIssueComment(e,t){await this.request("PATCH",`/repos/${this.owner}/${this.repo}/issues/comments/${e}`,{body:t})}async listIssueComments(e){const t=[];let n=1;while(true){const s=await this.request("GET",`/repos/${this.owner}/${this.repo}/issues/${e}/comments?per_page=100&page=${n}`);if(s.length===0)break;for(const e of s){t.push({id:e.id,body:e.body})}if(s.length<100)break;n++}return t}projectNodeId;projectFields;async resolveProjectMetadata(){if(this.projectNodeId&&this.projectFields)return{id:this.projectNodeId,fields:this.projectFields};if(!this.projectId)return undefined;const e=`\n id\n fields(first: 100) {\n nodes {\n ... on ProjectV2Field { id name dataType }\n ... on ProjectV2SingleSelectField { id name dataType options { id name } }\n ... on ProjectV2IterationField { id name dataType configuration { iterations { id title } } }\n }\n }\n `;if(typeof this.projectId==="string"&&this.projectId.startsWith("PVT_")){try{const t=await this.graphql(`\n query($id: ID!) {\n node(id: $id) {\n ... on ProjectV2 {\n ${e}\n }\n }\n }\n `,{id:this.projectId});if(t?.node?.id){this.projectNodeId=t.node.id;this.projectFields=t.node.fields?.nodes||[];return{id:this.projectNodeId,fields:this.projectFields}}}catch(e){}}const t=typeof this.projectId==="number"?this.projectId:parseInt(String(this.projectId),10);if(!isNaN(t)){try{const n=await this.graphql(`\n query($login: String!, $number: Int!) {\n user(login: $login) {\n projectV2(number: $number) {\n ${e}\n }\n }\n }\n `,{login:this.owner,number:t});if(n?.user?.projectV2?.id){this.projectNodeId=n.user.projectV2.id;this.projectFields=n.user.projectV2.fields.nodes;return{id:this.projectNodeId,fields:this.projectFields}}}catch(e){}try{const n=await this.graphql(`\n query($login: String!, $number: Int!) {\n organization(login: $login) {\n projectV2(number: $number) {\n ${e}\n }\n }\n }\n `,{login:this.owner,number:t});if(n?.organization?.projectV2?.id){this.projectNodeId=n.organization.projectV2.id;this.projectFields=n.organization.projectV2.fields.nodes;return{id:this.projectNodeId,fields:this.projectFields}}}catch(e){}}const s=n(465);console.warn(s.yellow(`\n⚠️ Warning: Could not resolve GitHub Project V2 with ID ${this.projectId} for owner "${this.owner}".`));console.warn(s.yellow(` If "${this.owner}" is a User account and you are authenticating via a GitHub App,`));console.warn(s.yellow(` note that GitHub Apps are technically not allowed to access User-level Projects.`));console.warn(s.yellow(` Please use a Personal Access Token (PAT) instead.\n`));return undefined}async addToProject(e){const t=await this.resolveProjectMetadata();if(!t)return undefined;let n=0;const s=3;while(n<s){const r=await a.lock();try{const n=await this.graphql(`\n mutation($projectId: ID!, $contentId: ID!) {\n addProjectV2ItemById(input: {projectId: $projectId, contentId: $contentId}) {\n item { id }\n }\n }\n `,{projectId:t.id,contentId:e});r();return n?.addProjectV2ItemById?.item?.id}catch(e){r();n++;if(n>=s){const t=new Error(`Failed to link issue to GitHub Project: ${e.message}`);t.name="GitHubProjectError";throw t}await new Promise((e=>setTimeout(e,1e3*Math.pow(2,n-1))))}}}async updateProjectItemFields(e,t){const n=await this.resolveProjectMetadata();if(!n||!n.fields)return;const s=[];const r={projectId:n.id,itemId:e};let o=0;for(const[e,a]of Object.entries(t)){const t=n.fields.find((t=>t.name&&t.name.toLowerCase()===e.toLowerCase()));if(!t)continue;let c=undefined;if(t.dataType==="TEXT"){if(a!==undefined&&a!==null){c={text:String(a)}}}else if(t.dataType==="NUMBER"){if(a!==undefined&&a!==null){const e=Number(a);if(!isNaN(e)){c={number:e}}}}else if(t.dataType==="DATE"){if(a!==undefined&&a!==null){const e=String(a).split("T")[0];if(/^\d{4}-\d{2}-\d{2}$/.test(e)){c={date:e}}else{c={date:String(a)}}}}else if(t.dataType==="SINGLE_SELECT"&&t.options){if(typeof a==="string"){const e=a.startsWith("@")?a.substring(1):a;const n=t.options.find((t=>t.name.toLowerCase()===e.toLowerCase()));if(n){c={singleSelectOptionId:n.id}}else{i.logger.warn(`Option "${a}" not found for Single Select field "${t.name}".`)}}}else if(t.dataType==="ITERATION"&&t.configuration?.iterations){if(typeof a==="string"){const e=a.startsWith("@")?a.substring(1):a;const n=t.configuration.iterations.find((t=>t.title.toLowerCase()===e.toLowerCase()));if(n){c={iterationId:n.id}}else{i.logger.warn(`Iteration "${a}" not found for Iteration field "${t.name}".`)}}}if(!c)continue;const l=`fieldId${o}`;const u=`value${o}`;r[l]=t.id;r[u]=c;s.push(`\n f${o}: updateProjectV2ItemFieldValue(input: {\n projectId: $projectId\n itemId: $itemId\n fieldId: $${l}\n value: $${u}\n }) { projectV2Item { id } }\n `);o++}if(s.length===0)return;const c=[`$projectId: ID!`,`$itemId: ID!`,...Array.from({length:o},((e,t)=>`$fieldId${t}: ID!, $value${t}: ProjectV2FieldValue!`))].join(", ");const l=`mutation(${c}) {\n ${s.join("\n")}\n }`;let u=0;const d=3;while(u<d){const e=await a.lock();try{await this.graphql(l,r);e();break}catch(t){e();u++;if(u>=d){const e=new Error(`Failed to assign custom fields: ${t.message}`);e.name="GitHubProjectError";throw e}await new Promise((e=>setTimeout(e,1e3*Math.pow(2,u-1))))}}}async getProjectItemFields(e){const t=await this.resolveProjectMetadata();if(!t||!t.fields)return{};try{const n=await this.graphql(`\n query($id: ID!) {\n node(id: $id) {\n ... on Issue {\n projectItems(first: 10) {\n nodes {\n project { id }\n fieldValues(first: 100) {\n nodes {\n ... on ProjectV2ItemFieldTextValue { text field { ... on ProjectV2FieldCommon { name } } }\n ... on ProjectV2ItemFieldNumberValue { number field { ... on ProjectV2FieldCommon { name } } }\n ... on ProjectV2ItemFieldDateValue { date field { ... on ProjectV2FieldCommon { name } } }\n ... on ProjectV2ItemFieldSingleSelectValue { name field { ... on ProjectV2FieldCommon { name } } }\n ... on ProjectV2ItemFieldIterationValue { title field { ... on ProjectV2FieldCommon { name } } }\n }\n }\n }\n }\n }\n }\n }\n `,{id:e});const s=n?.node?.projectItems?.nodes||[];const r=s.find((e=>e.project?.id===t.id));if(!r||!r.fieldValues||!r.fieldValues.nodes)return{};const i=Object.create(null);for(const e of r.fieldValues.nodes){const t=e.field?.name;if(!t)continue;let n="";if(e.text!==undefined)n=e.text;else if(e.name!==undefined)n=e.name;else if(e.title!==undefined)n=e.title;else if(e.date!==undefined)n=e.date;else if(e.number!==undefined)n=String(e.number);i[t.toLowerCase()]=n}return i}catch{return{}}}async getIssueNodeId(e){try{const t=await this.request("GET",`/repos/${this.owner}/${this.repo}/issues/${e}`);return t.node_id??null}catch{return null}}formatRemoteId(e){return`${this.repo}:${e}`}async addSubIssue(e,t){try{await this.request("POST",`/repos/${this.owner}/${this.repo}/issues/${e}/sub_issues`,{sub_issue_id:t,replace_parent:true})}catch(e){if(!e.message.includes("422")){throw e}}}}t.GitHubProvider=GitHubProvider;t.GitHubAdapter=GitHubProvider},5320:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(8669),t);r(n(8567),t)},8567:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.generateGitHubTestrunComment=generateGitHubTestrunComment;t.evaluateGitHubTestrunComments=evaluateGitHubTestrunComments;t.buildGitHubTestplanBody=buildGitHubTestplanBody;const s=n(6928);function generateGitHubTestrunComment(e,t,n,s){return`**Origin:** ${e}\n<table border="1" width="100%">\n <tr>\n <th colspan="3">Feature Name</th>\n </tr>\n <tr>\n <td>${t}</td>\n <td>${n}</td>\n <td>${s}</td>\n </tr>\n <tr>\n <td colspan="3"><br/></td>\n </tr>\n </table>`}function evaluateGitHubTestrunComments(e,t){const n=e.custom?.testcases||[];if(n.length===0||!t?.state)return[];const r=t.state;const i=[];const o=[...n].sort(((e,t)=>{const n=e.split(".").pop()?.replace("@","")||"";const s=t.split(".").pop()?.replace("@","")||"";return n.localeCompare(s,undefined,{numeric:true,sensitivity:"base"})}));for(const n of o){const o=n.match(/@?(tc-[a-zA-Z0-9_-]+)/i);const a=o?o[1].toLowerCase():null;const c=n.split(".");const l=c.pop()||"";const u=n.replace(/\\/g,"/");const d=r.getResources("github_testcase").filter((e=>{const t=(e.identity||"").replace(/\\/g,"/");const n=(e.attributes?.title||"").toLowerCase();const s=t.split(".").pop()?.replace(/^@/,"").toLowerCase();if(a&&(s===a||t.toLowerCase().includes(`@${a}`)||t.toLowerCase().includes(`.${a}`))){const e=u.split(".case.feature")[0];const n=e.split("/").pop();if(!n||t.includes(n)){return true}}if(n&&(n===l.toLowerCase()||u.toLowerCase().includes(n))){return true}if(l==="*"||s&&s===l.replace(/^@/,"").toLowerCase()){return true}return false}));const f=new Set(d.map((e=>{const t=e.identity.lastIndexOf(".");return t!==-1?e.identity.slice(0,t):e.identity})));let p=d;if(f.size>1){if(t?.testDirectory){const e=t.testDirectory.replace(/^\.\//,"");p=d.filter((t=>t.identity.startsWith(e)))}else{continue}}p.sort(((e,t)=>{const n=e.identity.split(".").pop()?.replace("@","")||"";const s=t.identity.split(".").pop()?.replace("@","")||"";return n.localeCompare(s,undefined,{numeric:true,sensitivity:"base"})}));for(const n of p){const r=n.identity;let o=e.custom?.groupScenarios?.find((e=>{if(!e.name)return false;const t=r.replace(/\\/g,"/");const s=t.split(".").pop()||"";const i=e.name.match(/@?(tc-[a-zA-Z0-9_-]+)/i);if(i&&s&&i[1].toLowerCase()===s.replace(/^@/,"").toLowerCase()){return true}if(t.endsWith(`.${e.name}`)||e.name.endsWith(`.${s}`)||s===e.name){return true}const o=(n.attributes?.title||"").toLowerCase();if(o&&e.name.toLowerCase()===o){return true}return false}));if(!o){o=e.custom?.groupScenarios?.find((e=>e.name==="*"))}const a=o?.custom?.fields?.status||t?.existingAttributes?.testcaseStatuses?.[r]||"pending";const c=n.attributes?.title||r;const l=r.lastIndexOf(".");const u=l!==-1?r.slice(0,l):r;const d=l!==-1?r.slice(l+1):"";const f=(0,s.basename)(u||"");const p=d?d.replace("@",""):"";const h=generateGitHubTestrunComment(f,p,c,a);i.push({identity:r,status:a,body:h,title:c})}}return i}function buildGitHubTestplanBody(e,t){let n=e.feature?.description||"";const s=e.custom?.testruns||[];if(s.length>0&&t?.state){n+="\n\n### Test Runs\n";const e=t.state;for(const r of s){const s=e.getResources("github_testrun").filter((e=>{const t=e.identity.lastIndexOf(".");const n=t!==-1?e.identity.slice(0,t):e.identity;return n.endsWith(r)||e.identity.endsWith(r)}));const i=new Set(s.map((e=>{const t=e.identity.lastIndexOf(".");return t!==-1?e.identity.slice(0,t):e.identity})));let o=s;if(i.size>1){if(t?.testDirectory){const e=t.testDirectory.replace(/^\.\//,"");o=s.filter((t=>t.identity.startsWith(e)));const n=new Set(o.map((e=>{const t=e.identity.lastIndexOf(".");return t!==-1?e.identity.slice(0,t):e.identity})));if(n.size>1){throw new Error(`Multiple testruns found for rule "${r}". Please specify a more exact path or use -test-directory to limit the scope.`)}}else{throw new Error(`Multiple testruns found for rule "${r}". Please specify a more exact path or use -test-directory to limit the scope.`)}}if(o.length>0){for(const e of o){if(e?.attributes?.issueNumber){n+=`- [ ] #${e.attributes.issueNumber}\n`}else{n+=`- [ ] (known after apply) - ${e.identity}\n`}}}else{n+=`- [ ] (not found in state) - ${r}\n`}}}return n.trim()}},1936:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GitLabProvider=void 0;class GitLabProvider{config;host;projectId;token;boardId;constructor(e){this.config=e;this.host=e.host||"https://gitlab.com";this.projectId=e.projectId;const t=e.tokenEnv||"GITLAB_TOKEN";this.token=process.env[t]||"";this.boardId=e.boardId}async createIssue(e){throw new Error("GitLab provider createIssue is not yet fully implemented.")}async updateIssue(e,t){throw new Error("GitLab provider updateIssue is not yet fully implemented.")}async closeIssue(e){throw new Error("GitLab provider closeIssue is not yet fully implemented.")}async getIssue(e){return null}async listIssuesByLabel(e){return[]}async getMilestoneByTitle(e){return undefined}async createIssueComment(e,t){throw new Error("GitLab provider createIssueComment is not yet fully implemented.")}async updateIssueComment(e,t){throw new Error("GitLab provider updateIssueComment is not yet fully implemented.")}async listIssueComments(e){return[]}formatRemoteId(e){return`GL#${e}`}}t.GitLabProvider=GitLabProvider},7486:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(9933),t);r(n(5095),t);r(n(3651),t);r(n(5320),t);r(n(942),t);r(n(1936),t)},9933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},5095:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createProvider=createProvider;const s=n(5320);const r=n(942);const i=n(1936);const o=n(3651);async function createProvider(e,t=process.cwd()){const n=e.getProviderType();const a=e.getProviderConfig(n);if(n==="local"){return new r.LocalProvider(t)}if(n==="github"){const t=e.getGitHub();if(!t){throw new Error("GitHub provider configuration is missing required fields (owner, repository).")}return new s.GitHubProvider(t)}if(n==="gitlab"){return new i.GitLabProvider(a)}if(n==="custom"||a.source){return await(0,o.loadCustomProvider)(a,t)}return new r.LocalProvider(t)}},942:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.LocalAdapter=t.LocalProvider=void 0;const o=i(n(9896));const a=i(n(6928));const c=n(6028);class LocalProvider{dbPath;db;constructor(e="."){this.dbPath=a.resolve(e,c.FILE_DATA);this.db=this.loadDB()}loadDB(){if(o.existsSync(this.dbPath)){try{const e=o.readFileSync(this.dbPath,"utf8");return JSON.parse(e)}catch(e){console.error(`Error reading ${this.dbPath}`,e)}}return{issues:[],next_issue_number:1,next_comment_id:1}}saveDB(){const e=a.dirname(this.dbPath);if(!o.existsSync(e)){o.mkdirSync(e,{recursive:true})}o.writeFileSync(this.dbPath,JSON.stringify(this.db,null,2),"utf8")}async createIssue(e){const t=this.db.next_issue_number++;const n=(new Date).toISOString();const s={id:t,number:t,title:e.title,body:e.body,state:e.state||"open",node_id:`local_node_${t}`,labels:e.labels,assignees:e.assignees,milestone:e.milestone?String(e.milestone):undefined,created_at:n,updated_at:n,comments:[],custom_fields:{}};this.db.issues.push(s);this.saveDB();return s}async updateIssue(e,t){const n=this.db.issues.find((t=>String(t.number)===String(e)));if(!n){throw new Error(`Issue #${e} not found`)}if(t.title!==undefined)n.title=t.title;if(t.body!==undefined)n.body=t.body;if(t.state!==undefined)n.state=t.state;if(t.labels!==undefined)n.labels=t.labels;if(t.assignees!==undefined)n.assignees=t.assignees;if(t.milestone!==undefined)n.milestone=String(t.milestone);n.updated_at=(new Date).toISOString();this.saveDB();return n}async closeIssue(e){await this.updateIssue(e,{state:"closed"})}async getIssue(e){const t=this.db.issues.find((t=>String(t.number)===String(e)));return t||null}async listIssuesByLabel(e){return this.db.issues.filter((t=>t.labels?.includes(e)))}async getMilestoneByTitle(e){return e}async createIssueComment(e,t){const n=this.db.issues.find((t=>String(t.number)===String(e)));if(!n){throw new Error(`Issue #${e} not found`)}const s=this.db.next_comment_id++;n.comments.push({id:s,body:t});this.saveDB();return{id:s}}async updateIssueComment(e,t){for(const n of this.db.issues){const s=n.comments.find((t=>String(t.id)===String(e)));if(s){s.body=t;this.saveDB();return}}throw new Error(`Comment #${e} not found`)}async listIssueComments(e){const t=this.db.issues.find((t=>String(t.number)===String(e)));if(!t){throw new Error(`Issue #${e} not found`)}return t.comments}async addToProject(e){return String(e)}async updateProjectItemFields(e,t){const n=this.db.issues.find((t=>String(t.node_id)===String(e)||String(t.number)===String(e)));if(n){n.custom_fields={...n.custom_fields,...t};this.saveDB()}}async getProjectItemFields(e){const t=this.db.issues.find((t=>String(t.node_id)===String(e)||String(t.number)===String(e)));return t?.custom_fields||{}}formatRemoteId(e){return`local:${e}`}async addSubIssue(e,t){}}t.LocalProvider=LocalProvider;t.LocalAdapter=LocalProvider},5440:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.builtinReports=void 0;const s=n(2978);function resolveItemUrl(e){const t=e.originalResource?.attributes||{};if(t.html_url)return String(t.html_url);if(t.url)return String(t.url);if(e.issueNumber&&e.type.includes("github")){return`https://github.com/issues/${e.issueNumber}`}return undefined}t.builtinReports={"testcase-summary":{name:"testcase-summary",description:"Test case execution status and overview",collect(e){const t=e.items.filter((e=>e.canonicalScope==="testcase"));const n=t.length>0?t:e.items;return{title:"Informe de Casos de Prueba",metrics:{total:e.stats.total,passed:e.stats.passed,failed:e.stats.failed,pending:e.stats.pending,blocked:e.stats.blocked,skipped:e.stats.skipped,unexecuted:e.stats.unexecuted,tasa_exito:e.stats.total>0?`${Math.round(e.stats.passed/e.stats.total*100)}%`:"0%"},headers:["ID","Título","Etiquetas","Estado","Asignado"],rows:n.map((e=>[e.id,e.title,e.labels.join(", ")||"-",e.status,e.assignees[0]||"-"]))}}},"testrun-summary":{name:"testrun-summary",description:"Summary of test runs and execution metrics",collect(e){const t=e.stateQuery.group(e.items.filter((e=>e.testRunId)),"testrun");const n=[];for(const[s,r]of Object.entries(t)){if(s==="none")continue;const t=e.stateQuery.getStats(r);n.push([s,r.length,t.passed,t.failed,t.blocked,t.passed===r.length&&r.length>0?"Passed":t.failed>0?"Failed":"In Progress"])}return{title:"Test Run Summary",metrics:{"Total Test Runs":e.stats.totalRuns,active_runs:e.stats.activeRuns,closed_runs:e.stats.closedRuns,total_cases:e.stats.total,passed:e.stats.passed,failed:e.stats.failed},headers:["Test Run","Total Casos","Passed","Failed","Blocked","Estado"],rows:n.length>0?n:[["Sin ejecuciones",0,0,0,0,"-"]]}}},"testrun-detailed":{name:"testrun-detailed",description:"Detailed test cases and priorities per test run",collect(e){const t=e.items.filter((e=>e.canonicalScope==="testcase"&&e.testRunId));const n=t.length>0?t:e.items.filter((e=>e.canonicalScope==="testcase"));return{title:"Test Run Detailed Report",metrics:{total_runs:e.stats.totalRuns,total_cases:n.length,passed:e.stats.passed,failed:e.stats.failed},headers:["Test Run","Test Case ID","Título","Estado","Prioridad","Asignado"],rows:n.map((e=>{const t=e.custom_fields["priority"]||(0,s.resolvePath)(e.originalResource,"attributes.custom_fields.priority")||"Medium";return[e.testRunId||"General",e.id,e.title,e.status,String(t),e.assignees[0]||"-"]}))}}},"testplan-summary":{name:"testplan-summary",description:"Progress and metrics across test plans",collect(e){const t=e.stateQuery.getResources().filter((e=>e.type.includes("testplan")));const n=e.items.filter((e=>e.canonicalScope==="testplan"));const s=new Set(n.map((e=>e.id)));const r=s.size>0?t.filter((e=>s.has(e.identity))):t;const i=[];for(const t of r){const n=t.attributes.testruns||[];const s=e.items.filter((e=>e.testRunId&&n.some((t=>e.testRunId.endsWith(t)))));const r=e.stateQuery.getStats(s);const o=s.length>0?Math.round(r.passed/s.length*100):0;i.push([t.identity,String(t.attributes.title||t.identity),n.length,s.length,r.passed,r.failed,`${o}%`])}return{title:"Test Plan Summary",metrics:{total_plans:e.stats.totalPlans,total_cases:e.stats.total,passed:e.stats.passed,failed:e.stats.failed},headers:["Plan ID","Título","Runs Vinculados","Casos","Passed","Failed","Progreso %"],rows:i.length>0?i:[["Sin planes","-",0,0,0,0,"0%"]]}}},defects:{name:"defects",description:"Failed or blocked test cases with remote defect and issue tracking references",collect(e){const t=e.items.filter((e=>["failed","blocked"].includes(e.status.toLowerCase())));return{title:"Informe de Defectos",metrics:{total_defectos:t.length,failed:t.filter((e=>e.status.toLowerCase()==="failed")).length,blocked:t.filter((e=>e.status.toLowerCase()==="blocked")).length},headers:["Run","Test Case","Título","Estado","Issue","Asignado"],rows:t.length>0?t.map((e=>{const t=resolveItemUrl(e);const n=e.issueNumber?t?`[#${e.issueNumber}](${t})`:`#${e.issueNumber}`:e.remoteId&&!e.remoteId.startsWith("local:")?e.remoteId:"-";return[e.testRunId||"-",e.id,e.title,e.status,n,e.assignees[0]||"-"]})):[["-","Sin defectos","No se encontraron pruebas fallidas o bloqueadas.","Passed","-","-"]]}}},traceability:{name:"traceability",description:"Requirement and feature traceability matrix against test coverage",collect(e){const t=e.stateQuery.group(e.items,e.groupBy||"feature");const n=[];for(const[e,s]of Object.entries(t)){const t=s.length;const r=s.filter((e=>e.status.toLowerCase()==="passed")).length;const i=s.filter((e=>e.status.toLowerCase()==="failed")).length;const o=t>0?Math.round(r/t*100):0;n.push([e,t,r,i,`${o}%`])}return{title:"Requirement Traceability Report",metrics:{total_requisitos:Object.keys(t).length,total_casos:e.items.length,passed:e.stats.passed},headers:["Requisito / Feature","Total Pruebas","Passed","Failed","Cobertura %"],rows:n.length>0?n:[["Sin requisitos",0,0,0,"0%"]]}}},coverage:{name:"coverage",description:"Coverage and pass rate distribution grouped by labels and tags",collect(e){const t=e.stateQuery.group(e.items,"labels");const n=[];for(const[e,s]of Object.entries(t)){const t=s.length;const r=s.filter((e=>e.status.toLowerCase()==="passed")).length;const i=s.filter((e=>e.status.toLowerCase()==="failed")).length;const o=t>0?Math.round(r/t*100):0;n.push([e.startsWith("@")?e:`@${e}`,t,r,i,`${o}%`])}return{title:"Informe de Cobertura por Etiquetas",metrics:{total_etiquetas:Object.keys(t).length,total_casos:e.items.length},headers:["Etiqueta","Total","Passed","Failed","Cobertura %"],rows:n.length>0?n:[["@untagged",0,0,0,"0%"]]}}},"two-dimensional":{name:"two-dimensional",description:"Cross-tabulation matrix of tags against execution status distribution",collect(e){const t=e.stateQuery.group(e.items,"labels");const n=["passed","failed","pending","blocked","skipped","unexecuted"];const s=[];for(const[e,n]of Object.entries(t)){const t={};for(const e of n){const n=e.status.toLowerCase();t[n]=(t[n]||0)+1}s.push([e.startsWith("@")?e:`@${e}`,t["passed"]||0,t["failed"]||0,t["pending"]||0,t["blocked"]||0,t["skipped"]||0,t["unexecuted"]||0,n.length])}return{title:"Informe Bidimensional de Estados",metrics:{total_etiquetas:Object.keys(t).length,total_casos:e.items.length},headers:["Etiqueta","Passed","Failed","Pending","Blocked","Skipped","Unexecuted","Total"],rows:s.length>0?s:[["@untagged",0,0,0,0,0,0,0]]}}},"test-case-activity":{name:"test-case-activity",description:"Automation metrics, recent activity, and modified test cases",collect(e){let t=0;const n=e.items.filter((e=>e.canonicalScope==="testcase"));for(const e of n){const n=String(e.custom_fields["automation"]||e.custom_fields["automate"]||(0,s.resolvePath)(e.originalResource,"attributes.custom_fields.automation")||"").toLowerCase();if(n==="true"||n==="yes"||n==="automated"){t++}}const r=n.length;const i=r>0?Math.round(t/r*100):0;return{title:"Test Case Activity & Automation",metrics:{total_casos:r,automatizados:t,no_automatizados:r-t,tasa_automatizacion:`${i}%`},headers:["ID","Título","Prioridad","Automatizado","Modificado","Asignado"],rows:n.slice(0,50).map((e=>{const t=e.custom_fields["priority"]||(0,s.resolvePath)(e.originalResource,"attributes.custom_fields.priority")||"Medium";const n=String(e.custom_fields["automation"]||e.custom_fields["automate"]||"No");return[e.id,e.title,String(t),n,(e.updatedAt||"").split("T")[0]||"-",e.assignees[0]||"-"]}))}}},raw:{name:"raw",description:"Raw unaggregated export of all filtered state resources",collect(e){return{title:"Raw Data Export",metrics:{total_recursos:e.items.length},headers:["ID","Title","Status","Labels","Assignees","Milestone","TestRun","IssueNumber"],rows:e.items.map((e=>[e.id,e.title,e.status,e.labels.join(" "),e.assignees.join(" "),e.milestone||"",e.testRunId||"",e.issueNumber??""])),metadata:{rawItems:e.items.map((e=>{const t=resolveItemUrl(e);return{id:e.id,type:e.type,title:e.title,status:e.status,labels:e.labels,assignees:e.assignees,milestone:e.milestone||"",testRunId:e.testRunId||"",testPlanId:e.testPlanId||"",issueNumber:e.issueNumber,url:t,issueUrl:t,custom_fields:e.custom_fields,createdAt:e.createdAt,updatedAt:e.updatedAt,originalResource:e.originalResource}}))}}}}}},7623:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.coreFormats=t.XlsxFormat=t.DocxFormat=t.CsvFormat=t.JsonFormat=t.MarkdownFormat=void 0;const s=n(2825);const r=n(9896);const i=n(6928);const o=n(8081);const a=n(1227);const c={passed:"✅",failed:"❌",pending:"⏳",blocked:"⚠️",skipped:"⏭️",unexecuted:"❔"};t.MarkdownFormat={name:"md",extension:".md",isBinary:false,render(e,t,n){if(n){const r=typeof n==="string"?n:n.toString("utf-8");const i={vars:t.variables,variables:t.variables,data:{report:{title:e.title,metrics:e.metrics||{},headers:e.headers,rows:e.rows}}};let o=(0,s.interpolateExpressions)(r,i);o=o.replace(/\$\{report\.title\}/g,e.title);if(e.metrics){for(const[t,n]of Object.entries(e.metrics)){o=o.replace(new RegExp(`\\$\\{report\\.metrics\\.${t}\\}`,"g"),String(n))}}return o}const r=[];r.push(`# ${e.title}`);r.push("");if(e.metrics&&Object.keys(e.metrics).length>0){const t=Object.entries(e.metrics).map((([e,t])=>`**${e}:** \`${t}\``)).join(" | ");r.push(t);r.push("")}if(e.headers.length>0){r.push(`| ${e.headers.join(" | ")} |`);r.push(`| ${e.headers.map((()=>"---")).join(" | ")} |`);for(const t of e.rows){const e=t.map((e=>{const t=String(e);const n=c[t.toLowerCase()];return n?`${n} ${t}`:t}));r.push(`| ${e.join(" | ")} |`)}r.push("")}return r.join("\n")}};t.JsonFormat={name:"json",extension:".json",isBinary:false,render(e,t,n){if(n){const r=typeof n==="string"?n:n.toString("utf-8");return(0,s.interpolateExpressions)(r,{vars:{...t.variables,...e.metrics}})}if(e.metadata?.rawItems){return JSON.stringify(e.metadata.rawItems,null,2)}return JSON.stringify({title:e.title,metrics:e.metrics||{},headers:e.headers,rows:e.rows,metadata:e.metadata||{}},null,2)}};t.CsvFormat={name:"csv",extension:".csv",isBinary:false,render(e){const t=[];t.push(e.headers.join(","));if(e.metadata?.rawItems){for(const n of e.metadata.rawItems){const e=[n.id,`"${(n.title||"").replace(/"/g,'""')}"`,n.status,`"${(n.labels||[]).join(" ")}"`,`"${(n.assignees||[]).join(" ")}"`,`"${n.milestone||""}"`,n.testRunId||"",n.issueNumber||""];t.push(e.join(","))}return t.join("\n")}const escapeCsv=e=>{const t=String(e??"");if(t.includes(",")||t.includes('"')||t.includes("\n")||t.includes(" ")||t.startsWith("@")){return`"${t.replace(/"/g,'""')}"`}return t};for(const n of e.rows){t.push(n.map(escapeCsv).join(","))}return t.join("\n")}};t.DocxFormat={name:"docx",extension:".docx",isBinary:true,async render(e,t,n){let s;try{s=(0,o.loadDriver)("docx")}catch{a.logger.push({type:"error",title:'Missing optional package "docx"',detail:['The "docx" package is required to generate Word (.docx) reports.',"Please install it globally or locally in your project:",""," npm install -g docx"," # or"," npm install --save-dev docx"],close:true})}const{Document:c,Paragraph:l,Table:u,TableRow:d,TableCell:f,TextRun:p,HeadingLevel:h,WidthType:m,BorderStyle:g,VerticalAlign:y,PatchType:b,patchDocument:v,Packer:w,AlignmentType:T}=s;let S=null;if(n){if(typeof n==="string"){if(!(0,r.existsSync)(n)){a.logger.push({type:"error",title:`Template file not found: ${n}`,detail:["The specified Word template path does not exist on disk.","Verify the path or omit the -template flag to use the default template."],close:true})}S=(0,r.readFileSync)(n)}else{S=n}}else{const e=[(0,i.resolve)(process.cwd(),".testform","reports","report.docx"),(0,i.resolve)(process.cwd(),"templates","report.docx"),(0,i.resolve)(__dirname,"..","..","templates","report.docx")];for(const t of e){if((0,r.existsSync)(t)){try{S=(0,r.readFileSync)(t);break}catch{}}}}if(S){try{const n={};const s=t.variables||{};const r=new Date;const i=`${r.getDate().toString().padStart(2,"0")}/${(r.getMonth()+1).toString().padStart(2,"0")}/${r.getFullYear()}`;for(const[e,t]of Object.entries(s)){n[e]={type:b.PARAGRAPH,children:[new p({text:String(t)})]};n[`var.${e}`]={type:b.PARAGRAPH,children:[new p({text:String(t)})]}}if(e.metrics){for(const[t,s]of Object.entries(e.metrics)){n[t]={type:b.PARAGRAPH,children:[new p({text:String(s)})]};n[`report.${t}`]={type:b.PARAGRAPH,children:[new p({text:String(s)})]};n[`report.metrics.${t}`]={type:b.PARAGRAPH,children:[new p({text:String(s)})]}}}n["title"]={type:b.PARAGRAPH,children:[new p({text:e.title,bold:true})]};n["report.title"]={type:b.PARAGRAPH,children:[new p({text:e.title,bold:true})]};n["date"]={type:b.PARAGRAPH,children:[new p({text:i})]};n["total"]={type:b.PARAGRAPH,children:[new p({text:String(e.metrics?.total||e.rows.length)})]};n["report.total"]={type:b.PARAGRAPH,children:[new p({text:String(e.metrics?.total||e.rows.length)})]};n["passed"]={type:b.PARAGRAPH,children:[new p({text:String(e.metrics?.passed||0)})]};n["report.passed"]={type:b.PARAGRAPH,children:[new p({text:String(e.metrics?.passed||0)})]};n["failed"]={type:b.PARAGRAPH,children:[new p({text:String(e.metrics?.failed||0)})]};n["report.failed"]={type:b.PARAGRAPH,children:[new p({text:String(e.metrics?.failed||0)})]};const o=[new d({children:e.headers.map((e=>new f({verticalAlign:y.CENTER,children:[new l({children:[new p({text:e,bold:true})]})]})))}),...e.rows.map((e=>new d({children:e.map((e=>new f({verticalAlign:y.CENTER,children:[new l({text:String(e)})]})))})))];const a={type:b.DOCUMENT,children:[new u({width:{size:9634,type:m.DXA},borders:{top:{style:g.SINGLE,size:6,color:"BFBFBF"},bottom:{style:g.SINGLE,size:6,color:"BFBFBF"},left:{style:g.SINGLE,size:6,color:"BFBFBF"},right:{style:g.SINGLE,size:6,color:"BFBFBF"},insideHorizontal:{style:g.SINGLE,size:6,color:"BFBFBF"},insideVertical:{style:g.SINGLE,size:6,color:"BFBFBF"}},rows:o})]};n["table"]=a;n["report.table"]=a;try{const e=await v({outputType:"nodebuffer",data:S,patches:n,placeholderDelimiters:{start:"${",end:"}"}});return Buffer.from(e)}catch{const e=await v({outputType:"nodebuffer",data:S,patches:n});return Buffer.from(e)}}catch(e){}}const k=new c({sections:[{children:[new l({text:e.title,heading:h.HEADING_1,alignment:T.CENTER}),new l({text:`Fecha: ${(new Date).toLocaleDateString()}`,alignment:T.CENTER}),new l({text:""}),new u({width:{size:100,type:m.PERCENTAGE},rows:[new d({children:e.headers.map((e=>new f({children:[new l({children:[new p({text:e,bold:true})]})]})))}),...e.rows.map((e=>new d({children:e.map((e=>new f({children:[new l({text:String(e)})]})))})))]})]}]});return await w.toBuffer(k)}};t.XlsxFormat={name:"xlsx",extension:".xlsx",isBinary:true,async render(e,t,n){let s;try{s=(0,o.loadDriver)("exceljs")}catch{a.logger.push({type:"error",title:'Missing optional package "exceljs"',detail:['The "exceljs" package is required to generate Excel (.xlsx) reports.',"Please install it globally or locally in your project:",""," npm install -g exceljs"," # or"," npm install --save-dev exceljs"],close:true})}const i=s.Workbook||s.default?.Workbook||s.default;const c=new i;let l;const u=new Date;const d=`${u.getDate().toString().padStart(2,"0")}/${(u.getMonth()+1).toString().padStart(2,"0")}/${u.getFullYear()}`;const f=t.variables||{};if(n){let e;if(typeof n==="string"){if(!(0,r.existsSync)(n)){a.logger.push({type:"error",title:`Template file not found: ${n}`,detail:["The specified Excel template path does not exist on disk.","Verify the path or omit the -template flag to generate a standard workbook."],close:true})}e=(0,r.readFileSync)(n)}else{e=n}await c.xlsx.load(e);l=c.worksheets[0]}else{l=c.addWorksheet(e.title.slice(0,31)||"Report")}const interpolateCell=t=>{let n=t;n=n.replace(/\$\{date\}/g,d);n=n.replace(/\$\{report\.title\}/g,e.title);n=n.replace(/\$\{title\}/g,e.title);if(e.metrics){for(const[t,s]of Object.entries(e.metrics)){n=n.replace(new RegExp(`\\$\\{report\\.metrics\\.${t}\\}`,"g"),String(s));n=n.replace(new RegExp(`\\$\\{report\\.${t}\\}`,"g"),String(s));n=n.replace(new RegExp(`\\$\\{${t}\\}`,"g"),String(s))}}for(const[e,t]of Object.entries(f)){n=n.replace(new RegExp(`\\$\\{var\\.${e}\\}`,"g"),String(t));n=n.replace(new RegExp(`\\$\\{${e}\\}`,"g"),String(t))}return n};let p=null;l.eachRow({includeEmpty:false},((e,t)=>{e.eachCell({includeEmpty:false},((e,n)=>{if(typeof e.value==="string"){if(e.value.includes("${table}")||e.value.includes("${report.table}")){p={row:t,col:n};e.value=""}else if(e.value.includes("${")){e.value=interpolateCell(e.value)}}}))}));const h=p;const m=h?h.row:l.lastRow?l.lastRow.number+2:1;const g=h?h.col:1;const y=l.getRow(m);e.headers.forEach(((e,t)=>{const n=y.getCell(g+t);n.value=e;n.font={bold:true,color:{argb:"FFFFFFFF"}};n.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FF1F4E79"}};n.alignment={vertical:"middle",horizontal:"center"}}));y.height=24;let b=m+1;for(const t of e.rows){const e=l.getRow(b);t.forEach(((t,n)=>{const s=e.getCell(g+n);s.value=t;s.alignment={vertical:"middle"};const r=String(t).toLowerCase();if(r==="passed"){s.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFD4EDDA"}};s.font={color:{argb:"FF155724"},bold:true}}else if(r==="failed"){s.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFF8D7DA"}};s.font={color:{argb:"FF721C24"},bold:true}}else if(r==="blocked"){s.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFF3CD"}};s.font={color:{argb:"FF856404"},bold:true}}}));b++}e.headers.forEach(((t,n)=>{const s=l.getColumn(g+n);let r=t.length;for(const t of e.rows){const e=String(t[n]??"").length;if(e>r)r=e}s.width=Math.min(Math.max(r+4,12),45)}));const v=await c.xlsx.writeBuffer();return Buffer.from(v)}};t.coreFormats={md:t.MarkdownFormat,json:t.JsonFormat,csv:t.CsvFormat,docx:t.DocxFormat,xlsx:t.XlsxFormat}},4855:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(7410),t);r(n(5440),t);r(n(7623),t);r(n(6396),t)},6396:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.resolveReport=resolveReport;t.resolveFormat=resolveFormat;t.resolveTemplate=resolveTemplate;const s=n(5440);const r=n(7623);const i=n(6928);const o=n(9896);const a=n(7016);const c=n(1227);const l=n(4296);async function resolveReport(e,t=process.cwd()){const r=(e||"testcase-summary").trim().toLowerCase();if(s.builtinReports[r]){return s.builtinReports[r]}const u=[(0,i.resolve)(t,".testform","reports",`${r}.ts`),(0,i.resolve)(t,".testform","reports",`${r}.js`),(0,i.resolve)(t,".testform","reports",r,"index.ts"),(0,i.resolve)(t,".testform","reports",r,"index.js")];for(const e of u){if((0,o.existsSync)(e)){try{let t;try{t=await n(2609)((0,a.pathToFileURL)(e).href)}catch{t=require(e)}const s=t.default||t.report||t;if(s&&typeof s.collect==="function"){return s}}catch(t){c.logger.push({type:"warning",title:`Failed to load custom report from ${e}`,detail:[t.message||String(t)]})}}}const d=Object.keys(s.builtinReports).join(", ");c.logger.push({type:"error",title:`Report type "${r}" not found`,detail:[`Available built-in reports:`,` ${d}`,"",`Or create a custom report script in:`,` .testform/reports/${r}.ts`]});throw new l.TestformError(`Report type "${r}" not found`)}async function resolveFormat(e,t="md",s=process.cwd()){const u=(t||"md").trim().toLowerCase();if(e.formats&&e.formats[u]){const t=e.formats[u];return{name:u,extension:`.${u}`,render:async(e,n)=>t(e,n)}}if(r.coreFormats[u]){return r.coreFormats[u]}const d=[(0,i.resolve)(s,".testform","reports",`${u}.format.ts`),(0,i.resolve)(s,".testform","reports",`${u}.format.js`),(0,i.resolve)(s,".testform","reports",`${u}.ts`),(0,i.resolve)(s,".testform","reports",`${u}.js`)];for(const e of d){if((0,o.existsSync)(e)){try{let t;try{t=await n(2609)((0,a.pathToFileURL)(e).href)}catch{t=require(e)}const s=t.default||t.format||t;if(s&&typeof s.render==="function"){return s}}catch(t){c.logger.push({type:"warning",title:`Failed to load custom format from ${e}`,detail:[t.message||String(t)]})}}}const f=Object.keys(r.coreFormats).join(", ");c.logger.push({type:"error",title:`Format "${u}" not found`,detail:[`Available core formats:`,` ${f}`,"",`Or create a custom format script in:`,` .testform/reports/${u}.format.ts`]});throw new l.TestformError(`Format "${u}" not found`)}function resolveTemplate(e,t,n,s,r=process.cwd()){if(n){const e=(0,i.resolve)(r,n);if((0,o.existsSync)(e)){return(0,o.readFileSync)(e)}return n}if(e.templates){if(typeof e.templates==="function"){return e.templates(t,s)}if(typeof e.templates==="object"&&e.templates[t]){const n=e.templates[t];if(typeof n==="string"&&(0,o.existsSync)((0,i.resolve)(r,n))){return(0,o.readFileSync)((0,i.resolve)(r,n))}return n}}const a=(0,i.resolve)(r,".testform","reports",`report.${t}`);if((0,o.existsSync)(a)){return(0,o.readFileSync)(a)}return undefined}},7410:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},6665:e=>{function webpackEmptyContext(e){var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}webpackEmptyContext.keys=()=>[];webpackEmptyContext.resolve=webpackEmptyContext;webpackEmptyContext.id=6665;e.exports=webpackEmptyContext},195:e=>{function webpackEmptyAsyncContext(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}))}webpackEmptyAsyncContext.keys=()=>[];webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext;webpackEmptyAsyncContext.id=195;e.exports=webpackEmptyAsyncContext},9272:e=>{function webpackEmptyAsyncContext(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}))}webpackEmptyAsyncContext.keys=()=>[];webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext;webpackEmptyAsyncContext.id=9272;e.exports=webpackEmptyAsyncContext},2609:e=>{function webpackEmptyAsyncContext(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}))}webpackEmptyAsyncContext.keys=()=>[];webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext;webpackEmptyAsyncContext.id=2609;e.exports=webpackEmptyAsyncContext},2613:e=>{"use strict";e.exports=require("assert")},181:e=>{"use strict";e.exports=require("buffer")},5317:e=>{"use strict";e.exports=require("child_process")},6982:e=>{"use strict";e.exports=require("crypto")},4434:e=>{"use strict";e.exports=require("events")},9896:e=>{"use strict";e.exports=require("fs")},8161:e=>{"use strict";e.exports=require("node:os")},1708:e=>{"use strict";e.exports=require("node:process")},857:e=>{"use strict";e.exports=require("os")},6928:e=>{"use strict";e.exports=require("path")},932:e=>{"use strict";e.exports=require("process")},3785:e=>{"use strict";e.exports=require("readline")},2018:e=>{"use strict";e.exports=require("tty")},7016:e=>{"use strict";e.exports=require("url")},9023:e=>{"use strict";e.exports=require("util")},406:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.uuid=uuid;t.incrementing=incrementing;function uuid(){return function(){return crypto.randomUUID()}}function incrementing(){var e=0;return function(){return(e++).toString()}}},5331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.millisecondsSinceEpochToTimestamp=millisecondsSinceEpochToTimestamp;t.millisecondsToDuration=millisecondsToDuration;t.timestampToMillisecondsSinceEpoch=timestampToMillisecondsSinceEpoch;t.durationToMilliseconds=durationToMilliseconds;t.addDurations=addDurations;var n=1e3;var s=1e6;var r=1e9;function millisecondsSinceEpochToTimestamp(e){return toSecondsAndNanos(e)}function millisecondsToDuration(e){return toSecondsAndNanos(e)}function timestampToMillisecondsSinceEpoch(e){var t=e.seconds,n=e.nanos;return toMillis(t,n)}function durationToMilliseconds(e){var t=e.seconds,n=e.nanos;return toMillis(t,n)}function addDurations(e,t){var n=+e.seconds+ +t.seconds;var s=e.nanos+t.nanos;if(s>=r){n+=1;s-=r}return{seconds:n,nanos:s}}function toSecondsAndNanos(e){var t=Math.floor(e/n);var r=Math.floor(e%n*s);return{seconds:t,nanos:r}}function toMillis(e,t){var r=+e*n;var i=t/s;return r+i}},6954:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getWorstTestStepResult=getWorstTestStepResult;var s=n(238);var r=n(5331);function getWorstTestStepResult(e){return e.slice().sort((function(e,t){return ordinal(t.status)-ordinal(e.status)}))[0]||{status:s.TestStepResultStatus.UNKNOWN,duration:(0,r.millisecondsToDuration)(0)}}function ordinal(e){return[s.TestStepResultStatus.UNKNOWN,s.TestStepResultStatus.PASSED,s.TestStepResultStatus.SKIPPED,s.TestStepResultStatus.PENDING,s.TestStepResultStatus.UNDEFINED,s.TestStepResultStatus.AMBIGUOUS,s.TestStepResultStatus.FAILED].indexOf(e)}},6088:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();var o=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});t.getWorstTestStepResult=t.parseEnvelope=t.version=t.IdGenerator=t.TimeConversion=void 0;var a=i(n(5331));t.TimeConversion=a;var c=i(n(406));t.IdGenerator=c;var l=n(9071);Object.defineProperty(t,"parseEnvelope",{enumerable:true,get:function(){return l.parseEnvelope}});var u=n(6954);Object.defineProperty(t,"getWorstTestStepResult",{enumerable:true,get:function(){return u.getWorstTestStepResult}});var d=n(7028);Object.defineProperty(t,"version",{enumerable:true,get:function(){return d.version}});o(n(238),t)},238:function(e,t,n){"use strict";var s=this&&this.__decorate||function(e,t,n,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,s);else for(var a=e.length-1;a>=0;a--)if(o=e[a])i=(r<3?o(i):r>3?o(t,n,i):o(t,n))||i;return r>3&&i&&Object.defineProperty(t,n,i),i};Object.defineProperty(t,"__esModule",{value:true});t.TestCaseFinished=t.TestStep=t.StepMatchArgumentsList=t.StepMatchArgument=t.Group=t.TestCase=t.Snippet=t.Suggestion=t.StepDefinitionPattern=t.StepDefinition=t.JavaStackTraceElement=t.JavaMethod=t.SourceReference=t.Source=t.PickleTag=t.PickleTableRow=t.PickleTableCell=t.PickleTable=t.PickleStepArgument=t.PickleStep=t.PickleDocString=t.Pickle=t.ParseError=t.ParameterType=t.Product=t.Git=t.Ci=t.Meta=t.Location=t.Hook=t.Tag=t.TableRow=t.TableCell=t.Step=t.Scenario=t.RuleChild=t.Rule=t.FeatureChild=t.Feature=t.Examples=t.DocString=t.DataTable=t.Comment=t.Background=t.GherkinDocument=t.ExternalAttachment=t.Exception=t.Envelope=t.Duration=t.Attachment=void 0;t.TestStepResultStatus=t.StepKeywordType=t.StepDefinitionPatternType=t.SourceMediaType=t.PickleStepType=t.HookType=t.AttachmentContentEncoding=t.UndefinedParameterType=t.Timestamp=t.TestStepStarted=t.TestStepResult=t.TestStepFinished=t.TestRunStarted=t.TestRunHookStarted=t.TestRunHookFinished=t.TestRunFinished=t.TestCaseStarted=void 0;var r=n(451);n(477);var i=function(){function Attachment(){this.body="";this.contentEncoding=de.IDENTITY;this.mediaType=""}s([(0,r.Type)((function(){return U}))],Attachment.prototype,"source",void 0);s([(0,r.Type)((function(){return le}))],Attachment.prototype,"timestamp",void 0);return Attachment}();t.Attachment=i;var o=function(){function Duration(){this.seconds=0;this.nanos=0}return Duration}();t.Duration=o;var a=function(){function Envelope(){}s([(0,r.Type)((function(){return i}))],Envelope.prototype,"attachment",void 0);s([(0,r.Type)((function(){return l}))],Envelope.prototype,"externalAttachment",void 0);s([(0,r.Type)((function(){return u}))],Envelope.prototype,"gherkinDocument",void 0);s([(0,r.Type)((function(){return _}))],Envelope.prototype,"hook",void 0);s([(0,r.Type)((function(){return C}))],Envelope.prototype,"meta",void 0);s([(0,r.Type)((function(){return A}))],Envelope.prototype,"parameterType",void 0);s([(0,r.Type)((function(){return L}))],Envelope.prototype,"parseError",void 0);s([(0,r.Type)((function(){return x}))],Envelope.prototype,"pickle",void 0);s([(0,r.Type)((function(){return V}))],Envelope.prototype,"suggestion",void 0);s([(0,r.Type)((function(){return U}))],Envelope.prototype,"source",void 0);s([(0,r.Type)((function(){return H}))],Envelope.prototype,"stepDefinition",void 0);s([(0,r.Type)((function(){return J}))],Envelope.prototype,"testCase",void 0);s([(0,r.Type)((function(){return ee}))],Envelope.prototype,"testCaseFinished",void 0);s([(0,r.Type)((function(){return te}))],Envelope.prototype,"testCaseStarted",void 0);s([(0,r.Type)((function(){return ne}))],Envelope.prototype,"testRunFinished",void 0);s([(0,r.Type)((function(){return ie}))],Envelope.prototype,"testRunStarted",void 0);s([(0,r.Type)((function(){return oe}))],Envelope.prototype,"testStepFinished",void 0);s([(0,r.Type)((function(){return ce}))],Envelope.prototype,"testStepStarted",void 0);s([(0,r.Type)((function(){return re}))],Envelope.prototype,"testRunHookStarted",void 0);s([(0,r.Type)((function(){return se}))],Envelope.prototype,"testRunHookFinished",void 0);s([(0,r.Type)((function(){return ue}))],Envelope.prototype,"undefinedParameterType",void 0);return Envelope}();t.Envelope=a;var c=function(){function Exception(){this.type=""}return Exception}();t.Exception=c;var l=function(){function ExternalAttachment(){this.url="";this.mediaType=""}s([(0,r.Type)((function(){return le}))],ExternalAttachment.prototype,"timestamp",void 0);return ExternalAttachment}();t.ExternalAttachment=l;var u=function(){function GherkinDocument(){this.comments=[]}s([(0,r.Type)((function(){return g}))],GherkinDocument.prototype,"feature",void 0);s([(0,r.Type)((function(){return f}))],GherkinDocument.prototype,"comments",void 0);return GherkinDocument}();t.GherkinDocument=u;var d=function(){function Background(){this.location=new E;this.keyword="";this.name="";this.description="";this.steps=[];this.id=""}s([(0,r.Type)((function(){return E}))],Background.prototype,"location",void 0);s([(0,r.Type)((function(){return T}))],Background.prototype,"steps",void 0);return Background}();t.Background=d;var f=function(){function Comment(){this.location=new E;this.text=""}s([(0,r.Type)((function(){return E}))],Comment.prototype,"location",void 0);return Comment}();t.Comment=f;var p=function(){function DataTable(){this.location=new E;this.rows=[]}s([(0,r.Type)((function(){return E}))],DataTable.prototype,"location",void 0);s([(0,r.Type)((function(){return k}))],DataTable.prototype,"rows",void 0);return DataTable}();t.DataTable=p;var h=function(){function DocString(){this.location=new E;this.content="";this.delimiter=""}s([(0,r.Type)((function(){return E}))],DocString.prototype,"location",void 0);return DocString}();t.DocString=h;var m=function(){function Examples(){this.location=new E;this.tags=[];this.keyword="";this.name="";this.description="";this.tableBody=[];this.id=""}s([(0,r.Type)((function(){return E}))],Examples.prototype,"location",void 0);s([(0,r.Type)((function(){return D}))],Examples.prototype,"tags",void 0);s([(0,r.Type)((function(){return k}))],Examples.prototype,"tableHeader",void 0);s([(0,r.Type)((function(){return k}))],Examples.prototype,"tableBody",void 0);return Examples}();t.Examples=m;var g=function(){function Feature(){this.location=new E;this.tags=[];this.language="";this.keyword="";this.name="";this.description="";this.children=[]}s([(0,r.Type)((function(){return E}))],Feature.prototype,"location",void 0);s([(0,r.Type)((function(){return D}))],Feature.prototype,"tags",void 0);s([(0,r.Type)((function(){return y}))],Feature.prototype,"children",void 0);return Feature}();t.Feature=g;var y=function(){function FeatureChild(){}s([(0,r.Type)((function(){return b}))],FeatureChild.prototype,"rule",void 0);s([(0,r.Type)((function(){return d}))],FeatureChild.prototype,"background",void 0);s([(0,r.Type)((function(){return w}))],FeatureChild.prototype,"scenario",void 0);return FeatureChild}();t.FeatureChild=y;var b=function(){function Rule(){this.location=new E;this.tags=[];this.keyword="";this.name="";this.description="";this.children=[];this.id=""}s([(0,r.Type)((function(){return E}))],Rule.prototype,"location",void 0);s([(0,r.Type)((function(){return D}))],Rule.prototype,"tags",void 0);s([(0,r.Type)((function(){return v}))],Rule.prototype,"children",void 0);return Rule}();t.Rule=b;var v=function(){function RuleChild(){}s([(0,r.Type)((function(){return d}))],RuleChild.prototype,"background",void 0);s([(0,r.Type)((function(){return w}))],RuleChild.prototype,"scenario",void 0);return RuleChild}();t.RuleChild=v;var w=function(){function Scenario(){this.location=new E;this.tags=[];this.keyword="";this.name="";this.description="";this.steps=[];this.examples=[];this.id=""}s([(0,r.Type)((function(){return E}))],Scenario.prototype,"location",void 0);s([(0,r.Type)((function(){return D}))],Scenario.prototype,"tags",void 0);s([(0,r.Type)((function(){return T}))],Scenario.prototype,"steps",void 0);s([(0,r.Type)((function(){return m}))],Scenario.prototype,"examples",void 0);return Scenario}();t.Scenario=w;var T=function(){function Step(){this.location=new E;this.keyword="";this.text="";this.id=""}s([(0,r.Type)((function(){return E}))],Step.prototype,"location",void 0);s([(0,r.Type)((function(){return h}))],Step.prototype,"docString",void 0);s([(0,r.Type)((function(){return p}))],Step.prototype,"dataTable",void 0);return Step}();t.Step=T;var S=function(){function TableCell(){this.location=new E;this.value=""}s([(0,r.Type)((function(){return E}))],TableCell.prototype,"location",void 0);return TableCell}();t.TableCell=S;var k=function(){function TableRow(){this.location=new E;this.cells=[];this.id=""}s([(0,r.Type)((function(){return E}))],TableRow.prototype,"location",void 0);s([(0,r.Type)((function(){return S}))],TableRow.prototype,"cells",void 0);return TableRow}();t.TableRow=k;var D=function(){function Tag(){this.location=new E;this.name="";this.id=""}s([(0,r.Type)((function(){return E}))],Tag.prototype,"location",void 0);return Tag}();t.Tag=D;var _=function(){function Hook(){this.id="";this.sourceReference=new G}s([(0,r.Type)((function(){return G}))],Hook.prototype,"sourceReference",void 0);return Hook}();t.Hook=_;var E=function(){function Location(){this.line=0}return Location}();t.Location=E;var C=function(){function Meta(){this.protocolVersion="";this.implementation=new O;this.runtime=new O;this.os=new O;this.cpu=new O}s([(0,r.Type)((function(){return O}))],Meta.prototype,"implementation",void 0);s([(0,r.Type)((function(){return O}))],Meta.prototype,"runtime",void 0);s([(0,r.Type)((function(){return O}))],Meta.prototype,"os",void 0);s([(0,r.Type)((function(){return O}))],Meta.prototype,"cpu",void 0);s([(0,r.Type)((function(){return R}))],Meta.prototype,"ci",void 0);return Meta}();t.Meta=C;var R=function(){function Ci(){this.name=""}s([(0,r.Type)((function(){return P}))],Ci.prototype,"git",void 0);return Ci}();t.Ci=R;var P=function(){function Git(){this.remote="";this.revision=""}return Git}();t.Git=P;var O=function(){function Product(){this.name=""}return Product}();t.Product=O;var A=function(){function ParameterType(){this.name="";this.regularExpressions=[];this.preferForRegularExpressionMatch=false;this.useForSnippets=false;this.id=""}s([(0,r.Type)((function(){return G}))],ParameterType.prototype,"sourceReference",void 0);return ParameterType}();t.ParameterType=A;var L=function(){function ParseError(){this.source=new G;this.message=""}s([(0,r.Type)((function(){return G}))],ParseError.prototype,"source",void 0);return ParseError}();t.ParseError=L;var x=function(){function Pickle(){this.id="";this.uri="";this.name="";this.language="";this.steps=[];this.tags=[];this.astNodeIds=[]}s([(0,r.Type)((function(){return E}))],Pickle.prototype,"location",void 0);s([(0,r.Type)((function(){return $}))],Pickle.prototype,"steps",void 0);s([(0,r.Type)((function(){return B}))],Pickle.prototype,"tags",void 0);return Pickle}();t.Pickle=x;var I=function(){function PickleDocString(){this.content=""}return PickleDocString}();t.PickleDocString=I;var $=function(){function PickleStep(){this.astNodeIds=[];this.id="";this.text=""}s([(0,r.Type)((function(){return F}))],PickleStep.prototype,"argument",void 0);return PickleStep}();t.PickleStep=$;var F=function(){function PickleStepArgument(){}s([(0,r.Type)((function(){return I}))],PickleStepArgument.prototype,"docString",void 0);s([(0,r.Type)((function(){return j}))],PickleStepArgument.prototype,"dataTable",void 0);return PickleStepArgument}();t.PickleStepArgument=F;var j=function(){function PickleTable(){this.rows=[]}s([(0,r.Type)((function(){return N}))],PickleTable.prototype,"rows",void 0);return PickleTable}();t.PickleTable=j;var M=function(){function PickleTableCell(){this.value=""}return PickleTableCell}();t.PickleTableCell=M;var N=function(){function PickleTableRow(){this.cells=[]}s([(0,r.Type)((function(){return M}))],PickleTableRow.prototype,"cells",void 0);return PickleTableRow}();t.PickleTableRow=N;var B=function(){function PickleTag(){this.name="";this.astNodeId=""}return PickleTag}();t.PickleTag=B;var U=function(){function Source(){this.uri="";this.data="";this.mediaType=he.TEXT_X_CUCUMBER_GHERKIN_PLAIN}return Source}();t.Source=U;var G=function(){function SourceReference(){}s([(0,r.Type)((function(){return q}))],SourceReference.prototype,"javaMethod",void 0);s([(0,r.Type)((function(){return W}))],SourceReference.prototype,"javaStackTraceElement",void 0);s([(0,r.Type)((function(){return E}))],SourceReference.prototype,"location",void 0);return SourceReference}();t.SourceReference=G;var q=function(){function JavaMethod(){this.className="";this.methodName="";this.methodParameterTypes=[]}return JavaMethod}();t.JavaMethod=q;var W=function(){function JavaStackTraceElement(){this.className="";this.fileName="";this.methodName=""}return JavaStackTraceElement}();t.JavaStackTraceElement=W;var H=function(){function StepDefinition(){this.id="";this.pattern=new K;this.sourceReference=new G}s([(0,r.Type)((function(){return K}))],StepDefinition.prototype,"pattern",void 0);s([(0,r.Type)((function(){return G}))],StepDefinition.prototype,"sourceReference",void 0);return StepDefinition}();t.StepDefinition=H;var K=function(){function StepDefinitionPattern(){this.source="";this.type=me.CUCUMBER_EXPRESSION}return StepDefinitionPattern}();t.StepDefinitionPattern=K;var V=function(){function Suggestion(){this.id="";this.pickleStepId="";this.snippets=[]}s([(0,r.Type)((function(){return z}))],Suggestion.prototype,"snippets",void 0);return Suggestion}();t.Suggestion=V;var z=function(){function Snippet(){this.language="";this.code=""}return Snippet}();t.Snippet=z;var J=function(){function TestCase(){this.id="";this.pickleId="";this.testSteps=[]}s([(0,r.Type)((function(){return Z}))],TestCase.prototype,"testSteps",void 0);return TestCase}();t.TestCase=J;var Y=function(){function Group(){}s([(0,r.Type)((function(){return Group}))],Group.prototype,"children",void 0);return Group}();t.Group=Y;var Q=function(){function StepMatchArgument(){this.group=new Y}s([(0,r.Type)((function(){return Y}))],StepMatchArgument.prototype,"group",void 0);return StepMatchArgument}();t.StepMatchArgument=Q;var X=function(){function StepMatchArgumentsList(){this.stepMatchArguments=[]}s([(0,r.Type)((function(){return Q}))],StepMatchArgumentsList.prototype,"stepMatchArguments",void 0);return StepMatchArgumentsList}();t.StepMatchArgumentsList=X;var Z=function(){function TestStep(){this.id=""}s([(0,r.Type)((function(){return X}))],TestStep.prototype,"stepMatchArgumentsLists",void 0);return TestStep}();t.TestStep=Z;var ee=function(){function TestCaseFinished(){this.testCaseStartedId="";this.timestamp=new le;this.willBeRetried=false}s([(0,r.Type)((function(){return le}))],TestCaseFinished.prototype,"timestamp",void 0);return TestCaseFinished}();t.TestCaseFinished=ee;var te=function(){function TestCaseStarted(){this.attempt=0;this.id="";this.testCaseId="";this.timestamp=new le}s([(0,r.Type)((function(){return le}))],TestCaseStarted.prototype,"timestamp",void 0);return TestCaseStarted}();t.TestCaseStarted=te;var ne=function(){function TestRunFinished(){this.success=false;this.timestamp=new le}s([(0,r.Type)((function(){return le}))],TestRunFinished.prototype,"timestamp",void 0);s([(0,r.Type)((function(){return c}))],TestRunFinished.prototype,"exception",void 0);return TestRunFinished}();t.TestRunFinished=ne;var se=function(){function TestRunHookFinished(){this.testRunHookStartedId="";this.result=new ae;this.timestamp=new le}s([(0,r.Type)((function(){return ae}))],TestRunHookFinished.prototype,"result",void 0);s([(0,r.Type)((function(){return le}))],TestRunHookFinished.prototype,"timestamp",void 0);return TestRunHookFinished}();t.TestRunHookFinished=se;var re=function(){function TestRunHookStarted(){this.id="";this.testRunStartedId="";this.hookId="";this.timestamp=new le}s([(0,r.Type)((function(){return le}))],TestRunHookStarted.prototype,"timestamp",void 0);return TestRunHookStarted}();t.TestRunHookStarted=re;var ie=function(){function TestRunStarted(){this.timestamp=new le}s([(0,r.Type)((function(){return le}))],TestRunStarted.prototype,"timestamp",void 0);return TestRunStarted}();t.TestRunStarted=ie;var oe=function(){function TestStepFinished(){this.testCaseStartedId="";this.testStepId="";this.testStepResult=new ae;this.timestamp=new le}s([(0,r.Type)((function(){return ae}))],TestStepFinished.prototype,"testStepResult",void 0);s([(0,r.Type)((function(){return le}))],TestStepFinished.prototype,"timestamp",void 0);return TestStepFinished}();t.TestStepFinished=oe;var ae=function(){function TestStepResult(){this.duration=new o;this.status=ye.UNKNOWN}s([(0,r.Type)((function(){return o}))],TestStepResult.prototype,"duration",void 0);s([(0,r.Type)((function(){return c}))],TestStepResult.prototype,"exception",void 0);return TestStepResult}();t.TestStepResult=ae;var ce=function(){function TestStepStarted(){this.testCaseStartedId="";this.testStepId="";this.timestamp=new le}s([(0,r.Type)((function(){return le}))],TestStepStarted.prototype,"timestamp",void 0);return TestStepStarted}();t.TestStepStarted=ce;var le=function(){function Timestamp(){this.seconds=0;this.nanos=0}return Timestamp}();t.Timestamp=le;var ue=function(){function UndefinedParameterType(){this.expression="";this.name=""}return UndefinedParameterType}();t.UndefinedParameterType=ue;var de;(function(e){e["IDENTITY"]="IDENTITY";e["BASE64"]="BASE64"})(de||(t.AttachmentContentEncoding=de={}));var fe;(function(e){e["BEFORE_TEST_RUN"]="BEFORE_TEST_RUN";e["AFTER_TEST_RUN"]="AFTER_TEST_RUN";e["BEFORE_TEST_CASE"]="BEFORE_TEST_CASE";e["AFTER_TEST_CASE"]="AFTER_TEST_CASE";e["BEFORE_TEST_STEP"]="BEFORE_TEST_STEP";e["AFTER_TEST_STEP"]="AFTER_TEST_STEP"})(fe||(t.HookType=fe={}));var pe;(function(e){e["UNKNOWN"]="Unknown";e["CONTEXT"]="Context";e["ACTION"]="Action";e["OUTCOME"]="Outcome"})(pe||(t.PickleStepType=pe={}));var he;(function(e){e["TEXT_X_CUCUMBER_GHERKIN_PLAIN"]="text/x.cucumber.gherkin+plain";e["TEXT_X_CUCUMBER_GHERKIN_MARKDOWN"]="text/x.cucumber.gherkin+markdown"})(he||(t.SourceMediaType=he={}));var me;(function(e){e["CUCUMBER_EXPRESSION"]="CUCUMBER_EXPRESSION";e["REGULAR_EXPRESSION"]="REGULAR_EXPRESSION"})(me||(t.StepDefinitionPatternType=me={}));var ge;(function(e){e["UNKNOWN"]="Unknown";e["CONTEXT"]="Context";e["ACTION"]="Action";e["OUTCOME"]="Outcome";e["CONJUNCTION"]="Conjunction"})(ge||(t.StepKeywordType=ge={}));var ye;(function(e){e["UNKNOWN"]="UNKNOWN";e["PASSED"]="PASSED";e["SKIPPED"]="SKIPPED";e["PENDING"]="PENDING";e["UNDEFINED"]="UNDEFINED";e["AMBIGUOUS"]="AMBIGUOUS";e["FAILED"]="FAILED"})(ye||(t.TestStepResultStatus=ye={}))},9071:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.parseEnvelope=parseEnvelope;var s=n(238);var r=n(451);function parseEnvelope(e){var t=JSON.parse(e);return(0,r.plainToClass)(s.Envelope,t)}},7028:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.version=void 0;t.version="32.2.0"},8091:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.uuid=uuid;t.incrementing=incrementing;function uuid(){return function(){return crypto.randomUUID()}}function incrementing(){var e=0;return function(){return(e++).toString()}}},8024:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.millisecondsSinceEpochToTimestamp=millisecondsSinceEpochToTimestamp;t.millisecondsToDuration=millisecondsToDuration;t.timestampToMillisecondsSinceEpoch=timestampToMillisecondsSinceEpoch;t.durationToMilliseconds=durationToMilliseconds;t.addDurations=addDurations;var n=1e3;var s=1e6;var r=1e9;function millisecondsSinceEpochToTimestamp(e){return toSecondsAndNanos(e)}function millisecondsToDuration(e){return toSecondsAndNanos(e)}function timestampToMillisecondsSinceEpoch(e){var t=e.seconds,n=e.nanos;return toMillis(t,n)}function durationToMilliseconds(e){var t=e.seconds,n=e.nanos;return toMillis(t,n)}function addDurations(e,t){var n=+e.seconds+ +t.seconds;var s=e.nanos+t.nanos;if(s>=r){n+=1;s-=r}return{seconds:n,nanos:s}}function toSecondsAndNanos(e){var t=Math.floor(e/n);var r=Math.floor(e%n*s);return{seconds:t,nanos:r}}function toMillis(e,t){var r=+e*n;var i=t/s;return r+i}},6809:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getWorstTestStepResult=getWorstTestStepResult;var s=n(6849);var r=n(8024);function getWorstTestStepResult(e){return e.slice().sort((function(e,t){return ordinal(t.status)-ordinal(e.status)}))[0]||{status:s.TestStepResultStatus.UNKNOWN,duration:(0,r.millisecondsToDuration)(0)}}function ordinal(e){return[s.TestStepResultStatus.UNKNOWN,s.TestStepResultStatus.PASSED,s.TestStepResultStatus.SKIPPED,s.TestStepResultStatus.PENDING,s.TestStepResultStatus.UNDEFINED,s.TestStepResultStatus.AMBIGUOUS,s.TestStepResultStatus.FAILED].indexOf(e)}},8569:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();var o=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});t.getWorstTestStepResult=t.parseEnvelope=t.version=t.IdGenerator=t.TimeConversion=void 0;var a=i(n(8024));t.TimeConversion=a;var c=i(n(8091));t.IdGenerator=c;var l=n(9782);Object.defineProperty(t,"parseEnvelope",{enumerable:true,get:function(){return l.parseEnvelope}});var u=n(6809);Object.defineProperty(t,"getWorstTestStepResult",{enumerable:true,get:function(){return u.getWorstTestStepResult}});var d=n(2505);Object.defineProperty(t,"version",{enumerable:true,get:function(){return d.version}});o(n(6849),t)},6849:function(e,t,n){"use strict";var s=this&&this.__decorate||function(e,t,n,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,s);else for(var a=e.length-1;a>=0;a--)if(o=e[a])i=(r<3?o(i):r>3?o(t,n,i):o(t,n))||i;return r>3&&i&&Object.defineProperty(t,n,i),i};Object.defineProperty(t,"__esModule",{value:true});t.TestCaseStarted=t.TestCaseFinished=t.TestStep=t.StepMatchArgumentsList=t.StepMatchArgument=t.Group=t.TestCase=t.Snippet=t.Suggestion=t.StepDefinitionPattern=t.StepDefinition=t.JavaStackTraceElement=t.JavaMethod=t.SourceReference=t.Source=t.PickleTag=t.PickleTableRow=t.PickleTableCell=t.PickleTable=t.PickleStepArgument=t.PickleStep=t.PickleDocString=t.Pickle=t.ParseError=t.ParameterType=t.Product=t.Git=t.Ci=t.Meta=t.Location=t.Hook=t.Tag=t.TableRow=t.TableCell=t.Step=t.Scenario=t.RuleChild=t.Rule=t.FeatureChild=t.Feature=t.Examples=t.DocString=t.DataTable=t.Comment=t.Background=t.GherkinDocument=t.Exception=t.Envelope=t.Duration=t.Attachment=void 0;t.TestStepResultStatus=t.StepKeywordType=t.StepDefinitionPatternType=t.SourceMediaType=t.PickleStepType=t.HookType=t.AttachmentContentEncoding=t.UndefinedParameterType=t.Timestamp=t.TestStepStarted=t.TestStepResult=t.TestStepFinished=t.TestRunStarted=t.TestRunHookStarted=t.TestRunHookFinished=t.TestRunFinished=void 0;var r=n(451);n(477);var i=function(){function Attachment(){this.body="";this.contentEncoding=ue.IDENTITY;this.mediaType=""}s([(0,r.Type)((function(){return B}))],Attachment.prototype,"source",void 0);s([(0,r.Type)((function(){return ce}))],Attachment.prototype,"timestamp",void 0);return Attachment}();t.Attachment=i;var o=function(){function Duration(){this.seconds=0;this.nanos=0}return Duration}();t.Duration=o;var a=function(){function Envelope(){}s([(0,r.Type)((function(){return i}))],Envelope.prototype,"attachment",void 0);s([(0,r.Type)((function(){return l}))],Envelope.prototype,"gherkinDocument",void 0);s([(0,r.Type)((function(){return D}))],Envelope.prototype,"hook",void 0);s([(0,r.Type)((function(){return E}))],Envelope.prototype,"meta",void 0);s([(0,r.Type)((function(){return O}))],Envelope.prototype,"parameterType",void 0);s([(0,r.Type)((function(){return A}))],Envelope.prototype,"parseError",void 0);s([(0,r.Type)((function(){return L}))],Envelope.prototype,"pickle",void 0);s([(0,r.Type)((function(){return K}))],Envelope.prototype,"suggestion",void 0);s([(0,r.Type)((function(){return B}))],Envelope.prototype,"source",void 0);s([(0,r.Type)((function(){return W}))],Envelope.prototype,"stepDefinition",void 0);s([(0,r.Type)((function(){return z}))],Envelope.prototype,"testCase",void 0);s([(0,r.Type)((function(){return Z}))],Envelope.prototype,"testCaseFinished",void 0);s([(0,r.Type)((function(){return ee}))],Envelope.prototype,"testCaseStarted",void 0);s([(0,r.Type)((function(){return te}))],Envelope.prototype,"testRunFinished",void 0);s([(0,r.Type)((function(){return re}))],Envelope.prototype,"testRunStarted",void 0);s([(0,r.Type)((function(){return ie}))],Envelope.prototype,"testStepFinished",void 0);s([(0,r.Type)((function(){return ae}))],Envelope.prototype,"testStepStarted",void 0);s([(0,r.Type)((function(){return se}))],Envelope.prototype,"testRunHookStarted",void 0);s([(0,r.Type)((function(){return ne}))],Envelope.prototype,"testRunHookFinished",void 0);s([(0,r.Type)((function(){return le}))],Envelope.prototype,"undefinedParameterType",void 0);return Envelope}();t.Envelope=a;var c=function(){function Exception(){this.type=""}return Exception}();t.Exception=c;var l=function(){function GherkinDocument(){this.comments=[]}s([(0,r.Type)((function(){return m}))],GherkinDocument.prototype,"feature",void 0);s([(0,r.Type)((function(){return d}))],GherkinDocument.prototype,"comments",void 0);return GherkinDocument}();t.GherkinDocument=l;var u=function(){function Background(){this.location=new _;this.keyword="";this.name="";this.description="";this.steps=[];this.id=""}s([(0,r.Type)((function(){return _}))],Background.prototype,"location",void 0);s([(0,r.Type)((function(){return w}))],Background.prototype,"steps",void 0);return Background}();t.Background=u;var d=function(){function Comment(){this.location=new _;this.text=""}s([(0,r.Type)((function(){return _}))],Comment.prototype,"location",void 0);return Comment}();t.Comment=d;var f=function(){function DataTable(){this.location=new _;this.rows=[]}s([(0,r.Type)((function(){return _}))],DataTable.prototype,"location",void 0);s([(0,r.Type)((function(){return S}))],DataTable.prototype,"rows",void 0);return DataTable}();t.DataTable=f;var p=function(){function DocString(){this.location=new _;this.content="";this.delimiter=""}s([(0,r.Type)((function(){return _}))],DocString.prototype,"location",void 0);return DocString}();t.DocString=p;var h=function(){function Examples(){this.location=new _;this.tags=[];this.keyword="";this.name="";this.description="";this.tableBody=[];this.id=""}s([(0,r.Type)((function(){return _}))],Examples.prototype,"location",void 0);s([(0,r.Type)((function(){return k}))],Examples.prototype,"tags",void 0);s([(0,r.Type)((function(){return S}))],Examples.prototype,"tableHeader",void 0);s([(0,r.Type)((function(){return S}))],Examples.prototype,"tableBody",void 0);return Examples}();t.Examples=h;var m=function(){function Feature(){this.location=new _;this.tags=[];this.language="";this.keyword="";this.name="";this.description="";this.children=[]}s([(0,r.Type)((function(){return _}))],Feature.prototype,"location",void 0);s([(0,r.Type)((function(){return k}))],Feature.prototype,"tags",void 0);s([(0,r.Type)((function(){return g}))],Feature.prototype,"children",void 0);return Feature}();t.Feature=m;var g=function(){function FeatureChild(){}s([(0,r.Type)((function(){return y}))],FeatureChild.prototype,"rule",void 0);s([(0,r.Type)((function(){return u}))],FeatureChild.prototype,"background",void 0);s([(0,r.Type)((function(){return v}))],FeatureChild.prototype,"scenario",void 0);return FeatureChild}();t.FeatureChild=g;var y=function(){function Rule(){this.location=new _;this.tags=[];this.keyword="";this.name="";this.description="";this.children=[];this.id=""}s([(0,r.Type)((function(){return _}))],Rule.prototype,"location",void 0);s([(0,r.Type)((function(){return k}))],Rule.prototype,"tags",void 0);s([(0,r.Type)((function(){return b}))],Rule.prototype,"children",void 0);return Rule}();t.Rule=y;var b=function(){function RuleChild(){}s([(0,r.Type)((function(){return u}))],RuleChild.prototype,"background",void 0);s([(0,r.Type)((function(){return v}))],RuleChild.prototype,"scenario",void 0);return RuleChild}();t.RuleChild=b;var v=function(){function Scenario(){this.location=new _;this.tags=[];this.keyword="";this.name="";this.description="";this.steps=[];this.examples=[];this.id=""}s([(0,r.Type)((function(){return _}))],Scenario.prototype,"location",void 0);s([(0,r.Type)((function(){return k}))],Scenario.prototype,"tags",void 0);s([(0,r.Type)((function(){return w}))],Scenario.prototype,"steps",void 0);s([(0,r.Type)((function(){return h}))],Scenario.prototype,"examples",void 0);return Scenario}();t.Scenario=v;var w=function(){function Step(){this.location=new _;this.keyword="";this.text="";this.id=""}s([(0,r.Type)((function(){return _}))],Step.prototype,"location",void 0);s([(0,r.Type)((function(){return p}))],Step.prototype,"docString",void 0);s([(0,r.Type)((function(){return f}))],Step.prototype,"dataTable",void 0);return Step}();t.Step=w;var T=function(){function TableCell(){this.location=new _;this.value=""}s([(0,r.Type)((function(){return _}))],TableCell.prototype,"location",void 0);return TableCell}();t.TableCell=T;var S=function(){function TableRow(){this.location=new _;this.cells=[];this.id=""}s([(0,r.Type)((function(){return _}))],TableRow.prototype,"location",void 0);s([(0,r.Type)((function(){return T}))],TableRow.prototype,"cells",void 0);return TableRow}();t.TableRow=S;var k=function(){function Tag(){this.location=new _;this.name="";this.id=""}s([(0,r.Type)((function(){return _}))],Tag.prototype,"location",void 0);return Tag}();t.Tag=k;var D=function(){function Hook(){this.id="";this.sourceReference=new U}s([(0,r.Type)((function(){return U}))],Hook.prototype,"sourceReference",void 0);return Hook}();t.Hook=D;var _=function(){function Location(){this.line=0}return Location}();t.Location=_;var E=function(){function Meta(){this.protocolVersion="";this.implementation=new P;this.runtime=new P;this.os=new P;this.cpu=new P}s([(0,r.Type)((function(){return P}))],Meta.prototype,"implementation",void 0);s([(0,r.Type)((function(){return P}))],Meta.prototype,"runtime",void 0);s([(0,r.Type)((function(){return P}))],Meta.prototype,"os",void 0);s([(0,r.Type)((function(){return P}))],Meta.prototype,"cpu",void 0);s([(0,r.Type)((function(){return C}))],Meta.prototype,"ci",void 0);return Meta}();t.Meta=E;var C=function(){function Ci(){this.name=""}s([(0,r.Type)((function(){return R}))],Ci.prototype,"git",void 0);return Ci}();t.Ci=C;var R=function(){function Git(){this.remote="";this.revision=""}return Git}();t.Git=R;var P=function(){function Product(){this.name=""}return Product}();t.Product=P;var O=function(){function ParameterType(){this.name="";this.regularExpressions=[];this.preferForRegularExpressionMatch=false;this.useForSnippets=false;this.id=""}s([(0,r.Type)((function(){return U}))],ParameterType.prototype,"sourceReference",void 0);return ParameterType}();t.ParameterType=O;var A=function(){function ParseError(){this.source=new U;this.message=""}s([(0,r.Type)((function(){return U}))],ParseError.prototype,"source",void 0);return ParseError}();t.ParseError=A;var L=function(){function Pickle(){this.id="";this.uri="";this.name="";this.language="";this.steps=[];this.tags=[];this.astNodeIds=[]}s([(0,r.Type)((function(){return I}))],Pickle.prototype,"steps",void 0);s([(0,r.Type)((function(){return N}))],Pickle.prototype,"tags",void 0);return Pickle}();t.Pickle=L;var x=function(){function PickleDocString(){this.content=""}return PickleDocString}();t.PickleDocString=x;var I=function(){function PickleStep(){this.astNodeIds=[];this.id="";this.text=""}s([(0,r.Type)((function(){return $}))],PickleStep.prototype,"argument",void 0);return PickleStep}();t.PickleStep=I;var $=function(){function PickleStepArgument(){}s([(0,r.Type)((function(){return x}))],PickleStepArgument.prototype,"docString",void 0);s([(0,r.Type)((function(){return F}))],PickleStepArgument.prototype,"dataTable",void 0);return PickleStepArgument}();t.PickleStepArgument=$;var F=function(){function PickleTable(){this.rows=[]}s([(0,r.Type)((function(){return M}))],PickleTable.prototype,"rows",void 0);return PickleTable}();t.PickleTable=F;var j=function(){function PickleTableCell(){this.value=""}return PickleTableCell}();t.PickleTableCell=j;var M=function(){function PickleTableRow(){this.cells=[]}s([(0,r.Type)((function(){return j}))],PickleTableRow.prototype,"cells",void 0);return PickleTableRow}();t.PickleTableRow=M;var N=function(){function PickleTag(){this.name="";this.astNodeId=""}return PickleTag}();t.PickleTag=N;var B=function(){function Source(){this.uri="";this.data="";this.mediaType=pe.TEXT_X_CUCUMBER_GHERKIN_PLAIN}return Source}();t.Source=B;var U=function(){function SourceReference(){}s([(0,r.Type)((function(){return G}))],SourceReference.prototype,"javaMethod",void 0);s([(0,r.Type)((function(){return q}))],SourceReference.prototype,"javaStackTraceElement",void 0);s([(0,r.Type)((function(){return _}))],SourceReference.prototype,"location",void 0);return SourceReference}();t.SourceReference=U;var G=function(){function JavaMethod(){this.className="";this.methodName="";this.methodParameterTypes=[]}return JavaMethod}();t.JavaMethod=G;var q=function(){function JavaStackTraceElement(){this.className="";this.fileName="";this.methodName=""}return JavaStackTraceElement}();t.JavaStackTraceElement=q;var W=function(){function StepDefinition(){this.id="";this.pattern=new H;this.sourceReference=new U}s([(0,r.Type)((function(){return H}))],StepDefinition.prototype,"pattern",void 0);s([(0,r.Type)((function(){return U}))],StepDefinition.prototype,"sourceReference",void 0);return StepDefinition}();t.StepDefinition=W;var H=function(){function StepDefinitionPattern(){this.source="";this.type=he.CUCUMBER_EXPRESSION}return StepDefinitionPattern}();t.StepDefinitionPattern=H;var K=function(){function Suggestion(){this.id="";this.pickleStepId="";this.snippets=[]}s([(0,r.Type)((function(){return V}))],Suggestion.prototype,"snippets",void 0);return Suggestion}();t.Suggestion=K;var V=function(){function Snippet(){this.language="";this.code=""}return Snippet}();t.Snippet=V;var z=function(){function TestCase(){this.id="";this.pickleId="";this.testSteps=[]}s([(0,r.Type)((function(){return X}))],TestCase.prototype,"testSteps",void 0);return TestCase}();t.TestCase=z;var J=function(){function Group(){this.children=[]}s([(0,r.Type)((function(){return Group}))],Group.prototype,"children",void 0);return Group}();t.Group=J;var Y=function(){function StepMatchArgument(){this.group=new J}s([(0,r.Type)((function(){return J}))],StepMatchArgument.prototype,"group",void 0);return StepMatchArgument}();t.StepMatchArgument=Y;var Q=function(){function StepMatchArgumentsList(){this.stepMatchArguments=[]}s([(0,r.Type)((function(){return Y}))],StepMatchArgumentsList.prototype,"stepMatchArguments",void 0);return StepMatchArgumentsList}();t.StepMatchArgumentsList=Q;var X=function(){function TestStep(){this.id=""}s([(0,r.Type)((function(){return Q}))],TestStep.prototype,"stepMatchArgumentsLists",void 0);return TestStep}();t.TestStep=X;var Z=function(){function TestCaseFinished(){this.testCaseStartedId="";this.timestamp=new ce;this.willBeRetried=false}s([(0,r.Type)((function(){return ce}))],TestCaseFinished.prototype,"timestamp",void 0);return TestCaseFinished}();t.TestCaseFinished=Z;var ee=function(){function TestCaseStarted(){this.attempt=0;this.id="";this.testCaseId="";this.timestamp=new ce}s([(0,r.Type)((function(){return ce}))],TestCaseStarted.prototype,"timestamp",void 0);return TestCaseStarted}();t.TestCaseStarted=ee;var te=function(){function TestRunFinished(){this.success=false;this.timestamp=new ce}s([(0,r.Type)((function(){return ce}))],TestRunFinished.prototype,"timestamp",void 0);s([(0,r.Type)((function(){return c}))],TestRunFinished.prototype,"exception",void 0);return TestRunFinished}();t.TestRunFinished=te;var ne=function(){function TestRunHookFinished(){this.testRunHookStartedId="";this.result=new oe;this.timestamp=new ce}s([(0,r.Type)((function(){return oe}))],TestRunHookFinished.prototype,"result",void 0);s([(0,r.Type)((function(){return ce}))],TestRunHookFinished.prototype,"timestamp",void 0);return TestRunHookFinished}();t.TestRunHookFinished=ne;var se=function(){function TestRunHookStarted(){this.id="";this.testRunStartedId="";this.hookId="";this.timestamp=new ce}s([(0,r.Type)((function(){return ce}))],TestRunHookStarted.prototype,"timestamp",void 0);return TestRunHookStarted}();t.TestRunHookStarted=se;var re=function(){function TestRunStarted(){this.timestamp=new ce}s([(0,r.Type)((function(){return ce}))],TestRunStarted.prototype,"timestamp",void 0);return TestRunStarted}();t.TestRunStarted=re;var ie=function(){function TestStepFinished(){this.testCaseStartedId="";this.testStepId="";this.testStepResult=new oe;this.timestamp=new ce}s([(0,r.Type)((function(){return oe}))],TestStepFinished.prototype,"testStepResult",void 0);s([(0,r.Type)((function(){return ce}))],TestStepFinished.prototype,"timestamp",void 0);return TestStepFinished}();t.TestStepFinished=ie;var oe=function(){function TestStepResult(){this.duration=new o;this.status=ge.UNKNOWN}s([(0,r.Type)((function(){return o}))],TestStepResult.prototype,"duration",void 0);s([(0,r.Type)((function(){return c}))],TestStepResult.prototype,"exception",void 0);return TestStepResult}();t.TestStepResult=oe;var ae=function(){function TestStepStarted(){this.testCaseStartedId="";this.testStepId="";this.timestamp=new ce}s([(0,r.Type)((function(){return ce}))],TestStepStarted.prototype,"timestamp",void 0);return TestStepStarted}();t.TestStepStarted=ae;var ce=function(){function Timestamp(){this.seconds=0;this.nanos=0}return Timestamp}();t.Timestamp=ce;var le=function(){function UndefinedParameterType(){this.expression="";this.name=""}return UndefinedParameterType}();t.UndefinedParameterType=le;var ue;(function(e){e["IDENTITY"]="IDENTITY";e["BASE64"]="BASE64"})(ue||(t.AttachmentContentEncoding=ue={}));var de;(function(e){e["BEFORE_TEST_RUN"]="BEFORE_TEST_RUN";e["AFTER_TEST_RUN"]="AFTER_TEST_RUN";e["BEFORE_TEST_CASE"]="BEFORE_TEST_CASE";e["AFTER_TEST_CASE"]="AFTER_TEST_CASE";e["BEFORE_TEST_STEP"]="BEFORE_TEST_STEP";e["AFTER_TEST_STEP"]="AFTER_TEST_STEP"})(de||(t.HookType=de={}));var fe;(function(e){e["UNKNOWN"]="Unknown";e["CONTEXT"]="Context";e["ACTION"]="Action";e["OUTCOME"]="Outcome"})(fe||(t.PickleStepType=fe={}));var pe;(function(e){e["TEXT_X_CUCUMBER_GHERKIN_PLAIN"]="text/x.cucumber.gherkin+plain";e["TEXT_X_CUCUMBER_GHERKIN_MARKDOWN"]="text/x.cucumber.gherkin+markdown"})(pe||(t.SourceMediaType=pe={}));var he;(function(e){e["CUCUMBER_EXPRESSION"]="CUCUMBER_EXPRESSION";e["REGULAR_EXPRESSION"]="REGULAR_EXPRESSION"})(he||(t.StepDefinitionPatternType=he={}));var me;(function(e){e["UNKNOWN"]="Unknown";e["CONTEXT"]="Context";e["ACTION"]="Action";e["OUTCOME"]="Outcome";e["CONJUNCTION"]="Conjunction"})(me||(t.StepKeywordType=me={}));var ge;(function(e){e["UNKNOWN"]="UNKNOWN";e["PASSED"]="PASSED";e["SKIPPED"]="SKIPPED";e["PENDING"]="PENDING";e["UNDEFINED"]="UNDEFINED";e["AMBIGUOUS"]="AMBIGUOUS";e["FAILED"]="FAILED"})(ge||(t.TestStepResultStatus=ge={}))},9782:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.parseEnvelope=parseEnvelope;var s=n(6849);var r=n(451);function parseEnvelope(e){var t=JSON.parse(e);return(0,r.plainToClass)(s.Envelope,t)}},2505:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.version=void 0;t.version="30.1.0"},477:()=>{
2
+ (()=>{var __webpack_modules__={6084:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const r=s(n(4699));const i=n(3840);const o=n(3032);class AstBuilder{constructor(e){this.newId=e;if(!e){throw new Error("No newId")}this.reset()}reset(){this.stack=[new r.default(o.RuleType.None)];this.comments=[]}startRule(e){this.stack.push(new r.default(e))}endRule(){const e=this.stack.pop();const t=this.transformNode(e);this.currentNode().add(e.ruleType,t)}build(e){if(e.matchedType===o.TokenType.Comment){this.comments.push({location:this.getLocation(e),text:e.matchedText})}else{this.currentNode().add(e.matchedType,e)}}getResult(){return this.currentNode().getSingle(o.RuleType.GherkinDocument)}currentNode(){return this.stack[this.stack.length-1]}getLocation(e,t){return!t?e.location:{line:e.location.line,column:t}}getTags(e){const t=[];const n=e.getSingle(o.RuleType.Tags);if(!n){return t}const s=n.getTokens(o.TokenType.TagLine);for(const e of s){for(const n of e.matchedItems){t.push({location:this.getLocation(e,n.column),name:n.text,id:this.newId()})}}return t}getCells(e){return e.matchedItems.map((t=>({location:this.getLocation(e,t.column),value:t.text})))}getDescription(e){return e.getSingle(o.RuleType.Description)||""}getSteps(e){return e.getItems(o.RuleType.Step)}getTableRows(e){const t=e.getTokens(o.TokenType.TableRow).map((e=>({id:this.newId(),location:this.getLocation(e),cells:this.getCells(e)})));this.ensureCellCount(t);return t.length===0?[]:t}ensureCellCount(e){if(e.length===0){return}const t=e[0].cells.length;e.forEach((e=>{if(e.cells.length!==t){throw i.AstBuilderException.create("inconsistent cell count within the table",e.location)}}))}transformNode(e){switch(e.ruleType){case o.RuleType.Step:{const t=e.getToken(o.TokenType.StepLine);const n=e.getSingle(o.RuleType.DataTable);const s=e.getSingle(o.RuleType.DocString);const r=this.getLocation(t);const i={id:this.newId(),location:r,keyword:t.matchedKeyword,keywordType:t.matchedKeywordType,text:t.matchedText,dataTable:n,docString:s};return i}case o.RuleType.DocString:{const t=e.getTokens(o.TokenType.DocStringSeparator)[0];const n=t.matchedText.length>0?t.matchedText:undefined;const s=e.getTokens(o.TokenType.Other);const r=s.map((e=>e.matchedText)).join("\n");const i={location:this.getLocation(t),content:r,delimiter:t.matchedKeyword};if(n){i.mediaType=n}return i}case o.RuleType.DataTable:{const t=this.getTableRows(e);const n={location:t[0].location,rows:t};return n}case o.RuleType.Background:{const t=e.getToken(o.TokenType.BackgroundLine);const n=this.getDescription(e);const s=this.getSteps(e);const r={id:this.newId(),location:this.getLocation(t),keyword:t.matchedKeyword,name:t.matchedText,description:n,steps:s};return r}case o.RuleType.ScenarioDefinition:{const t=this.getTags(e);const n=e.getSingle(o.RuleType.Scenario);const s=n.getToken(o.TokenType.ScenarioLine);const r=this.getDescription(n);const i=this.getSteps(n);const a=n.getItems(o.RuleType.ExamplesDefinition);const c={id:this.newId(),tags:t,location:this.getLocation(s),keyword:s.matchedKeyword,name:s.matchedText,description:r,steps:i,examples:a};return c}case o.RuleType.ExamplesDefinition:{const t=this.getTags(e);const n=e.getSingle(o.RuleType.Examples);const s=n.getToken(o.TokenType.ExamplesLine);const r=this.getDescription(n);const i=n.getSingle(o.RuleType.ExamplesTable);const a={id:this.newId(),tags:t,location:this.getLocation(s),keyword:s.matchedKeyword,name:s.matchedText,description:r,tableHeader:i?i[0]:undefined,tableBody:i?i.slice(1):[]};return a}case o.RuleType.ExamplesTable:{return this.getTableRows(e)}case o.RuleType.Description:{let t=e.getTokens(o.TokenType.Other);let n=t.length;while(n>0&&t[n-1].line.trimmedLineText===""){n--}t=t.slice(0,n);return t.map((e=>e.matchedText)).join("\n")}case o.RuleType.Feature:{const t=e.getSingle(o.RuleType.FeatureHeader);if(!t){return null}const n=this.getTags(t);const s=t.getToken(o.TokenType.FeatureLine);if(!s){return null}const r=[];const i=e.getSingle(o.RuleType.Background);if(i){r.push({background:i})}for(const t of e.getItems(o.RuleType.ScenarioDefinition)){r.push({scenario:t})}for(const t of e.getItems(o.RuleType.Rule)){r.push({rule:t})}const a=this.getDescription(t);const c=s.matchedGherkinDialect;const l={tags:n,location:this.getLocation(s),language:c,keyword:s.matchedKeyword,name:s.matchedText,description:a,children:r};return l}case o.RuleType.Rule:{const t=e.getSingle(o.RuleType.RuleHeader);if(!t){return null}const n=t.getToken(o.TokenType.RuleLine);if(!n){return null}const s=this.getTags(t);const r=[];const i=e.getSingle(o.RuleType.Background);if(i){r.push({background:i})}for(const t of e.getItems(o.RuleType.ScenarioDefinition)){r.push({scenario:t})}const a=this.getDescription(t);const c={id:this.newId(),location:this.getLocation(n),keyword:n.matchedKeyword,name:n.matchedText,description:a,children:r,tags:s};return c}case o.RuleType.GherkinDocument:{const t=e.getSingle(o.RuleType.Feature);const n={feature:t,comments:this.comments};return n}default:return e}}}t["default"]=AstBuilder},4699:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});class AstNode{constructor(e){this.ruleType=e;this.subItems=new Map}add(e,t){let n=this.subItems.get(e);if(n===undefined){n=[];this.subItems.set(e,n)}n.push(t)}getSingle(e){return(this.subItems.get(e)||[])[0]}getItems(e){return this.subItems.get(e)||[]}getToken(e){return(this.subItems.get(e)||[])[0]}getTokens(e){return this.subItems.get(e)||[]}}t["default"]=AstNode},3840:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.NoSuchLanguageException=t.AstBuilderException=t.CompositeParserException=t.ParserException=t.GherkinException=void 0;class GherkinException extends Error{constructor(e){super(e);const t=new.target.prototype;if(Object.setPrototypeOf){Object.setPrototypeOf(this,t)}else{this.__proto__=t}}static _create(e,t){const n=t!=null?t.column||0:-1;const s=t!=null?t.line||0:-1;const r=`(${s}:${n}): ${e}`;const i=new this(r);i.location=t;return i}}t.GherkinException=GherkinException;class ParserException extends GherkinException{static create(e,t,n){const s=new ParserException(`(${t}:${n}): ${e}`);s.location={line:t,column:n};return s}}t.ParserException=ParserException;class CompositeParserException extends GherkinException{static create(e){const t=`Parser errors:\n${e.map((e=>e.message)).join("\n")}`;const n=new CompositeParserException(t);n.errors=e;return n}}t.CompositeParserException=CompositeParserException;class AstBuilderException extends GherkinException{static create(e,t){return AstBuilderException._create(e,t)}}t.AstBuilderException=AstBuilderException;class NoSuchLanguageException extends GherkinException{static create(e,t){const n=`Language not supported: ${e}`;return NoSuchLanguageException._create(n,t)}}t.NoSuchLanguageException=NoSuchLanguageException},1112:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=i(n(6088));const c=n(434);const l=o(n(2759));const u=n(3840);const d=o(n(6097));const f=n(3032);const p=d.default;const h=/^\s*#\s*language\s*:\s*([a-zA-Z\-_]+)\s*$/;function addKeywordTypeMappings(e,t,n){for(const s of t){if(!(s in e)){e[s]=[]}e[s].push(n)}}class GherkinClassicTokenMatcher{constructor(e="en"){this.defaultDialectName=e;this.reset()}changeDialect(e,t){const n=p[e];if(!n){throw u.NoSuchLanguageException.create(e,t)}this.dialectName=e;this.dialect=n;this.initializeKeywordTypes();this.initializeSortedStepKeywords()}reset(){if(this.dialectName!==this.defaultDialectName){this.changeDialect(this.defaultDialectName)}this.activeDocStringSeparator=null;this.indentToRemove=0}initializeKeywordTypes(){this.keywordTypesMap={};addKeywordTypeMappings(this.keywordTypesMap,this.dialect.given,a.StepKeywordType.CONTEXT);addKeywordTypeMappings(this.keywordTypesMap,this.dialect.when,a.StepKeywordType.ACTION);addKeywordTypeMappings(this.keywordTypesMap,this.dialect.then,a.StepKeywordType.OUTCOME);addKeywordTypeMappings(this.keywordTypesMap,[].concat(this.dialect.and).concat(this.dialect.but),a.StepKeywordType.CONJUNCTION)}initializeSortedStepKeywords(){this.sortedStepKeywords=[].concat(this.dialect.given).concat(this.dialect.when).concat(this.dialect.then).concat(this.dialect.and).concat(this.dialect.but).sort(c.compareStepKeywords)}match_TagLine(e){if(e.line.startsWith("@")){this.setTokenMatched(e,f.TokenType.TagLine,null,null,null,null,this.getTags(e.line));return true}return false}match_FeatureLine(e){return this.matchTitleLine(e,f.TokenType.FeatureLine,this.dialect.feature)}match_ScenarioLine(e){return this.matchTitleLine(e,f.TokenType.ScenarioLine,this.dialect.scenario)||this.matchTitleLine(e,f.TokenType.ScenarioLine,this.dialect.scenarioOutline)}match_BackgroundLine(e){return this.matchTitleLine(e,f.TokenType.BackgroundLine,this.dialect.background)}match_ExamplesLine(e){return this.matchTitleLine(e,f.TokenType.ExamplesLine,this.dialect.examples)}match_RuleLine(e){return this.matchTitleLine(e,f.TokenType.RuleLine,this.dialect.rule)}match_TableRow(e){if(e.line.startsWith("|")){this.setTokenMatched(e,f.TokenType.TableRow,null,null,null,null,e.line.getTableCells());return true}return false}match_Empty(e){if(e.line.isEmpty){this.setTokenMatched(e,f.TokenType.Empty,null,null,0);return true}return false}match_Comment(e){if(e.line.startsWith("#")){const t=e.line.getLineText(0);this.setTokenMatched(e,f.TokenType.Comment,t,null,0);return true}return false}match_Language(e){const t=e.line.trimmedLineText.match(h);if(t){const n=t[1];this.setTokenMatched(e,f.TokenType.Language,n);this.changeDialect(n,e.location);return true}return false}match_DocStringSeparator(e){return this.activeDocStringSeparator==null?this._match_DocStringSeparator(e,'"""',true)||this._match_DocStringSeparator(e,"```",true):this._match_DocStringSeparator(e,this.activeDocStringSeparator,false)}_match_DocStringSeparator(e,t,n){if(e.line.startsWith(t)){let s=null;if(n){s=e.line.getRestTrimmed(t.length);this.activeDocStringSeparator=t;this.indentToRemove=e.line.indent}else{this.activeDocStringSeparator=null;this.indentToRemove=0}this.setTokenMatched(e,f.TokenType.DocStringSeparator,s,t);return true}return false}match_EOF(e){if(e.isEof){this.setTokenMatched(e,f.TokenType.EOF);return true}return false}match_StepLine(e){for(const t of this.sortedStepKeywords){if(e.line.startsWith(t)){const n=e.line.getRestTrimmed(t.length);const s=this.keywordTypesMap[t];let r=s[0];if(s.length>1){r=a.StepKeywordType.UNKNOWN}this.setTokenMatched(e,f.TokenType.StepLine,n,t,null,r);return true}}return false}match_Other(e){const t=e.line.getLineText(this.indentToRemove);this.setTokenMatched(e,f.TokenType.Other,this.unescapeDocString(t),null,0);return true}getTags(e){const t=e.trimmedLineText.split(/\s#/g,2)[0];let n=e.indent+1;const s=t.split("@");const r=[];for(let t=0;t<s.length;t++){const i=s[t].trimRight();if(i.length===0){continue}if(!i.match(/^\S+$/)){throw u.ParserException.create("A tag may not contain whitespace",e.lineNumber,n)}const o={column:n,text:`@${i}`};r.push(o);n+=(0,l.default)(s[t])+1}return r}matchTitleLine(e,t,n){for(const s of n){if(e.line.startsWithTitleKeyword(s)){const n=e.line.getRestTrimmed(s.length+":".length);this.setTokenMatched(e,t,n,s);return true}}return false}setTokenMatched(e,t,n,s,r,i,o){e.matchedType=t;e.matchedText=n;e.matchedKeyword=s;e.matchedKeywordType=i;e.matchedIndent=typeof r==="number"?r:e.line==null?0:e.line.indent;e.matchedItems=o||[];e.location.column=e.matchedIndent+1;e.matchedGherkinDialect=this.dialectName}unescapeDocString(e){if(this.activeDocStringSeparator==='"""'){return e.replace('\\"\\"\\"','"""')}if(this.activeDocStringSeparator==="```"){return e.replace("\\`\\`\\`","```")}return e}}t["default"]=GherkinClassicTokenMatcher},5422:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=i(n(6088));const c=n(434);const l=n(3840);const u=o(n(6097));const d=n(3032);const f=u.default;const p=/^(```[`]*)(.*)/;function addKeywordTypeMappings(e,t,n){for(const s of t){if(!(s in e)){e[s]=[]}e[s].push(n)}}class GherkinInMarkdownTokenMatcher{constructor(e="en"){this.defaultDialectName=e;this.dialect=f[e];this.nonStarStepKeywords=[].concat(this.dialect.given).concat(this.dialect.when).concat(this.dialect.then).concat(this.dialect.and).concat(this.dialect.but).filter(((e,t,n)=>e!=="* "&&n.indexOf(e)===t)).sort(c.compareStepKeywords);this.initializeKeywordTypes();this.stepRegexp=new RegExp(`${h.BULLET}(${this.nonStarStepKeywords.map(escapeRegExp).join("|")})`);const t=[].concat(this.dialect.feature).concat(this.dialect.background).concat(this.dialect.rule).concat(this.dialect.scenarioOutline).concat(this.dialect.scenario).concat(this.dialect.examples).filter(((e,t,n)=>n.indexOf(e)===t));this.headerRegexp=new RegExp(`${h.HEADER}(${t.map(escapeRegExp).join("|")})`);this.reset()}changeDialect(e,t){const n=f[e];if(!n){throw l.NoSuchLanguageException.create(e,t)}this.dialectName=e;this.dialect=n;this.initializeKeywordTypes()}initializeKeywordTypes(){this.keywordTypesMap={};addKeywordTypeMappings(this.keywordTypesMap,this.dialect.given,a.StepKeywordType.CONTEXT);addKeywordTypeMappings(this.keywordTypesMap,this.dialect.when,a.StepKeywordType.ACTION);addKeywordTypeMappings(this.keywordTypesMap,this.dialect.then,a.StepKeywordType.OUTCOME);addKeywordTypeMappings(this.keywordTypesMap,[].concat(this.dialect.and).concat(this.dialect.but),a.StepKeywordType.CONJUNCTION)}match_Language(e){if(!e)throw new Error("no token");return false}match_Empty(e){let t=false;if(e.line.isEmpty){t=true}if(!this.match_TagLine(e)&&!this.match_FeatureLine(e)&&!this.match_ScenarioLine(e)&&!this.match_BackgroundLine(e)&&!this.match_ExamplesLine(e)&&!this.match_RuleLine(e)&&!this.match_TableRow(e)&&!this.match_Comment(e)&&!this.match_Language(e)&&!this.match_DocStringSeparator(e)&&!this.match_EOF(e)&&!this.match_StepLine(e)){t=true}if(t){e.matchedType=d.TokenType.Empty}return this.setTokenMatched(e,null,t)}match_Other(e){const t=e.line.getLineText(this.indentToRemove);e.matchedType=d.TokenType.Other;e.matchedText=t;e.matchedIndent=0;return this.setTokenMatched(e,null,true)}match_Comment(e){let t=false;if(e.line.startsWith("|")){const n=e.line.getTableCells();if(this.isGfmTableSeparator(n))t=true}return this.setTokenMatched(e,null,t)}match_DocStringSeparator(e){const t=e.line.trimmedLineText.match(this.activeDocStringSeparator);const[,n,s]=t||[];let r=false;if(n){if(this.activeDocStringSeparator===p){this.activeDocStringSeparator=new RegExp(`^(${n})$`);this.indentToRemove=e.line.indent}else{this.activeDocStringSeparator=p}e.matchedKeyword=n;e.matchedType=d.TokenType.DocStringSeparator;e.matchedText=s||"";r=true}return this.setTokenMatched(e,null,r)}match_EOF(e){let t=false;if(e.isEof){e.matchedType=d.TokenType.EOF;t=true}return this.setTokenMatched(e,null,t)}match_FeatureLine(e){if(this.matchedFeatureLine){return this.setTokenMatched(e,null,false)}let t=this.matchTitleLine(h.HEADER,this.dialect.feature,":",e,d.TokenType.FeatureLine);if(!t){e.matchedType=d.TokenType.FeatureLine;e.matchedText=e.line.trimmedLineText;t=this.setTokenMatched(e,null,true)}this.matchedFeatureLine=t;return t}match_BackgroundLine(e){return this.matchTitleLine(h.HEADER,this.dialect.background,":",e,d.TokenType.BackgroundLine)}match_RuleLine(e){return this.matchTitleLine(h.HEADER,this.dialect.rule,":",e,d.TokenType.RuleLine)}match_ScenarioLine(e){return this.matchTitleLine(h.HEADER,this.dialect.scenario,":",e,d.TokenType.ScenarioLine)||this.matchTitleLine(h.HEADER,this.dialect.scenarioOutline,":",e,d.TokenType.ScenarioLine)}match_ExamplesLine(e){return this.matchTitleLine(h.HEADER,this.dialect.examples,":",e,d.TokenType.ExamplesLine)}match_StepLine(e){return this.matchTitleLine(h.BULLET,this.nonStarStepKeywords,"",e,d.TokenType.StepLine)}matchTitleLine(e,t,n,s,r){const i=new RegExp(`${e}(${t.map(escapeRegExp).join("|")})${n}(.*)`);const o=s.line.match(i);let c=s.line.indent;let l=false;if(o){s.matchedType=r;s.matchedKeyword=o[2];if(o[2]in this.keywordTypesMap){if(this.keywordTypesMap[o[2]].length>1){s.matchedKeywordType=a.StepKeywordType.UNKNOWN}else{s.matchedKeywordType=this.keywordTypesMap[o[2]][0]}}s.matchedText=o[3].trim();c+=o[1].length;l=true}return this.setTokenMatched(s,c,l)}setTokenMatched(e,t,n){e.matchedGherkinDialect=this.dialectName;e.matchedIndent=t!==null?t:e.line==null?0:e.line.indent;e.location.column=e.matchedIndent+1;return n}match_TableRow(e){if(e.line.lineText.match(/^\s\s\s?\s?\s?\|/)){const t=e.line.getTableCells();if(this.isGfmTableSeparator(t))return false;e.matchedKeyword="|";e.matchedType=d.TokenType.TableRow;e.matchedItems=t;return true}return false}isGfmTableSeparator(e){const t=e.map((e=>e.text)).filter((e=>e.match(/^:?-+:?$/)));return t.length>0}match_TagLine(e){const t=[];let n;const s=/`(@[^`]+)`/g;do{n=s.exec(e.line.trimmedLineText);if(n){t.push({column:e.line.indent+n.index+2,text:n[1]})}}while(n);if(t.length===0)return false;e.matchedType=d.TokenType.TagLine;e.matchedItems=t;return true}reset(){if(this.dialectName!==this.defaultDialectName){this.changeDialect(this.defaultDialectName)}this.activeDocStringSeparator=p}}t["default"]=GherkinInMarkdownTokenMatcher;var h;(function(e){e["BULLET"]="^(\\s*[*+-]\\s*)";e["HEADER"]="^(#{1,6}\\s)"})(h||(h={}));function escapeRegExp(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},9855:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const r=s(n(2759));class GherkinLine{constructor(e,t){this.lineText=e;this.lineNumber=t;this.trimmedLineText=e.replace(/^\s+/g,"");this.isEmpty=this.trimmedLineText.length===0;this.indent=(0,r.default)(e)-(0,r.default)(this.trimmedLineText)}startsWith(e){return this.trimmedLineText.indexOf(e)===0}startsWithTitleKeyword(e){return this.startsWith(`${e}:`)}match(e){return this.trimmedLineText.match(e)}getLineText(e){if(e<0||e>this.indent){return this.trimmedLineText}else{return this.lineText.substring(e)}}getRestTrimmed(e){return this.trimmedLineText.substring(e).trim()}getTableCells(){const e=[];let t=0;let n=t+1;let s="";let r=true;while(t<this.trimmedLineText.length){let i=this.trimmedLineText[t];t++;if(i==="|"){if(r){r=false}else{const t=s.replace(/^[ \t\v\f\r\u0085\u00A0]*/g,"");const r=t.replace(/[ \t\v\f\r\u0085\u00A0]*$/g,"");const i=s.length-t.length;const o={column:this.indent+n+i,text:r};e.push(o)}s="";n=t+1}else if(i==="\\"){i=this.trimmedLineText[t];t+=1;if(i==="n"){s+="\n"}else{if(i!=="|"&&i!=="\\"){s+="\\"}s+=i}}else{s+=i}}return e}}t["default"]=GherkinLine;e.exports=GherkinLine},3032:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.RuleType=t.TokenType=t.Token=void 0;const r=n(3840);const i=n(4272);const o=s(n(282));const a=s(n(9855));class Token{constructor(e,t){this.line=e;this.location=t;this.isEof=!e}getTokenValue(){return this.isEof?"EOF":this.line.getLineText(-1)}}t.Token=Token;var c;(function(e){e[e["None"]=0]="None";e[e["EOF"]=1]="EOF";e[e["Empty"]=2]="Empty";e[e["Comment"]=3]="Comment";e[e["TagLine"]=4]="TagLine";e[e["FeatureLine"]=5]="FeatureLine";e[e["RuleLine"]=6]="RuleLine";e[e["BackgroundLine"]=7]="BackgroundLine";e[e["ScenarioLine"]=8]="ScenarioLine";e[e["ExamplesLine"]=9]="ExamplesLine";e[e["StepLine"]=10]="StepLine";e[e["DocStringSeparator"]=11]="DocStringSeparator";e[e["TableRow"]=12]="TableRow";e[e["Language"]=13]="Language";e[e["Other"]=14]="Other"})(c||(t.TokenType=c={}));var l;(function(e){e[e["None"]=0]="None";e[e["_EOF"]=1]="_EOF";e[e["_Empty"]=2]="_Empty";e[e["_Comment"]=3]="_Comment";e[e["_TagLine"]=4]="_TagLine";e[e["_FeatureLine"]=5]="_FeatureLine";e[e["_RuleLine"]=6]="_RuleLine";e[e["_BackgroundLine"]=7]="_BackgroundLine";e[e["_ScenarioLine"]=8]="_ScenarioLine";e[e["_ExamplesLine"]=9]="_ExamplesLine";e[e["_StepLine"]=10]="_StepLine";e[e["_DocStringSeparator"]=11]="_DocStringSeparator";e[e["_TableRow"]=12]="_TableRow";e[e["_Language"]=13]="_Language";e[e["_Other"]=14]="_Other";e[e["GherkinDocument"]=15]="GherkinDocument";e[e["Feature"]=16]="Feature";e[e["FeatureHeader"]=17]="FeatureHeader";e[e["Rule"]=18]="Rule";e[e["RuleHeader"]=19]="RuleHeader";e[e["Background"]=20]="Background";e[e["ScenarioDefinition"]=21]="ScenarioDefinition";e[e["Scenario"]=22]="Scenario";e[e["ExamplesDefinition"]=23]="ExamplesDefinition";e[e["Examples"]=24]="Examples";e[e["ExamplesTable"]=25]="ExamplesTable";e[e["Step"]=26]="Step";e[e["StepArg"]=27]="StepArg";e[e["DataTable"]=28]="DataTable";e[e["DocString"]=29]="DocString";e[e["Tags"]=30]="Tags";e[e["DescriptionHelper"]=31]="DescriptionHelper";e[e["Description"]=32]="Description"})(l||(t.RuleType=l={}));class Parser{constructor(e,t){this.builder=e;this.tokenMatcher=t;this.stopAtFirstError=false}parse(e){const t=new o.default(e,((e,t)=>{const n=e===null||e===undefined?null:new a.default(e,t.line);return new Token(n,t)}));this.builder.reset();this.tokenMatcher.reset();this.context={tokenScanner:t,tokenQueue:[],errors:[]};this.startRule(this.context,l.GherkinDocument);let n=0;let s=null;while(true){s=this.readToken(this.context);n=this.matchToken(n,s,this.context);if(s.isEof)break}this.endRule(this.context);if(this.context.errors.length>0){throw r.CompositeParserException.create(this.context.errors)}return this.getResult()}addError(e,t){if(!e.errors.map((e=>e.message)).includes(t.message)){e.errors.push(t);if(e.errors.length>10)throw r.CompositeParserException.create(e.errors)}}startRule(e,t){this.handleAstError(e,(()=>this.builder.startRule(t)))}endRule(e){this.handleAstError(e,(()=>this.builder.endRule()))}build(e,t){this.handleAstError(e,(()=>this.builder.build(t)))}getResult(){return this.builder.getResult()}handleAstError(e,t){this.handleExternalError(e,true,t)}handleExternalError(e,t,n){if(this.stopAtFirstError)return n();try{return n()}catch(t){if(t instanceof r.CompositeParserException){t.errors.forEach((t=>this.addError(e,t)))}else if(t instanceof r.ParserException||t instanceof r.AstBuilderException||t instanceof i.UnexpectedTokenException||t instanceof r.NoSuchLanguageException){this.addError(e,t)}else{throw t}}return t}readToken(e){return e.tokenQueue.length>0?e.tokenQueue.shift():e.tokenScanner.read()}matchToken(e,t,n){switch(e){case 0:return this.matchTokenAt_0(t,n);case 1:return this.matchTokenAt_1(t,n);case 2:return this.matchTokenAt_2(t,n);case 3:return this.matchTokenAt_3(t,n);case 4:return this.matchTokenAt_4(t,n);case 5:return this.matchTokenAt_5(t,n);case 6:return this.matchTokenAt_6(t,n);case 7:return this.matchTokenAt_7(t,n);case 8:return this.matchTokenAt_8(t,n);case 9:return this.matchTokenAt_9(t,n);case 10:return this.matchTokenAt_10(t,n);case 11:return this.matchTokenAt_11(t,n);case 12:return this.matchTokenAt_12(t,n);case 13:return this.matchTokenAt_13(t,n);case 14:return this.matchTokenAt_14(t,n);case 15:return this.matchTokenAt_15(t,n);case 16:return this.matchTokenAt_16(t,n);case 17:return this.matchTokenAt_17(t,n);case 18:return this.matchTokenAt_18(t,n);case 19:return this.matchTokenAt_19(t,n);case 20:return this.matchTokenAt_20(t,n);case 21:return this.matchTokenAt_21(t,n);case 22:return this.matchTokenAt_22(t,n);case 23:return this.matchTokenAt_23(t,n);case 24:return this.matchTokenAt_24(t,n);case 25:return this.matchTokenAt_25(t,n);case 26:return this.matchTokenAt_26(t,n);case 27:return this.matchTokenAt_27(t,n);case 28:return this.matchTokenAt_28(t,n);case 29:return this.matchTokenAt_29(t,n);case 30:return this.matchTokenAt_30(t,n);case 31:return this.matchTokenAt_31(t,n);case 32:return this.matchTokenAt_32(t,n);case 33:return this.matchTokenAt_33(t,n);case 35:return this.matchTokenAt_35(t,n);case 36:return this.matchTokenAt_36(t,n);case 37:return this.matchTokenAt_37(t,n);case 38:return this.matchTokenAt_38(t,n);case 39:return this.matchTokenAt_39(t,n);case 40:return this.matchTokenAt_40(t,n);case 41:return this.matchTokenAt_41(t,n);case 42:return this.matchTokenAt_42(t,n);default:throw new Error("Unknown state: "+e)}}matchTokenAt_0(e,t){if(this.match_EOF(t,e)){this.build(t,e);return 34}if(this.match_Language(t,e)){this.startRule(t,l.Feature);this.startRule(t,l.FeatureHeader);this.build(t,e);return 1}if(this.match_TagLine(t,e)){this.startRule(t,l.Feature);this.startRule(t,l.FeatureHeader);this.startRule(t,l.Tags);this.build(t,e);return 2}if(this.match_FeatureLine(t,e)){this.startRule(t,l.Feature);this.startRule(t,l.FeatureHeader);this.build(t,e);return 3}if(this.match_Comment(t,e)){this.build(t,e);return 0}if(this.match_Empty(t,e)){this.build(t,e);return 0}const n=["#EOF","#Language","#TagLine","#FeatureLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 0}matchTokenAt_1(e,t){if(this.match_TagLine(t,e)){this.startRule(t,l.Tags);this.build(t,e);return 2}if(this.match_FeatureLine(t,e)){this.build(t,e);return 3}if(this.match_Comment(t,e)){this.build(t,e);return 1}if(this.match_Empty(t,e)){this.build(t,e);return 1}const n=["#TagLine","#FeatureLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 1}matchTokenAt_2(e,t){if(this.match_TagLine(t,e)){this.build(t,e);return 2}if(this.match_FeatureLine(t,e)){this.endRule(t);this.build(t,e);return 3}if(this.match_Comment(t,e)){this.build(t,e);return 2}if(this.match_Empty(t,e)){this.build(t,e);return 2}const n=["#TagLine","#FeatureLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 2}matchTokenAt_3(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 3}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 4}if(this.match_BackgroundLine(t,e)){this.endRule(t);this.startRule(t,l.Background);this.build(t,e);return 5}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 4}const n=["#EOF","#Empty","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 3}matchTokenAt_4(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 4}if(this.match_BackgroundLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Background);this.build(t,e);return 5}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 4}const n=["#EOF","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 4}matchTokenAt_5(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 5}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 6}if(this.match_StepLine(t,e)){this.startRule(t,l.Step);this.build(t,e);return 7}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 6}const n=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 5}matchTokenAt_6(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 6}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 7}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 6}const n=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 6}matchTokenAt_7(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.startRule(t,l.DataTable);this.build(t,e);return 8}if(this.match_DocStringSeparator(t,e)){this.startRule(t,l.DocString);this.build(t,e);return 41}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 7}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 7}if(this.match_Empty(t,e)){this.build(t,e);return 7}const n=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 7}matchTokenAt_8(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.build(t,e);return 8}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 7}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 8}if(this.match_Empty(t,e)){this.build(t,e);return 8}const n=["#EOF","#TableRow","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 8}matchTokenAt_9(e,t){if(this.match_TagLine(t,e)){this.build(t,e);return 9}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_Comment(t,e)){this.build(t,e);return 9}if(this.match_Empty(t,e)){this.build(t,e);return 9}const n=["#TagLine","#ScenarioLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 9}matchTokenAt_10(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 10}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 11}if(this.match_StepLine(t,e)){this.startRule(t,l.Step);this.build(t,e);return 12}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 11}const n=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 10}matchTokenAt_11(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 11}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 12}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 11}const n=["#EOF","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 11}matchTokenAt_12(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.startRule(t,l.DataTable);this.build(t,e);return 13}if(this.match_DocStringSeparator(t,e)){this.startRule(t,l.DocString);this.build(t,e);return 39}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 12}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 12}if(this.match_Empty(t,e)){this.build(t,e);return 12}const n=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 12}matchTokenAt_13(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.build(t,e);return 13}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 12}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 13}if(this.match_Empty(t,e)){this.build(t,e);return 13}const n=["#EOF","#TableRow","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 13}matchTokenAt_14(e,t){if(this.match_TagLine(t,e)){this.build(t,e);return 14}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_Comment(t,e)){this.build(t,e);return 14}if(this.match_Empty(t,e)){this.build(t,e);return 14}const n=["#TagLine","#ExamplesLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 14}matchTokenAt_15(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 15}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 16}if(this.match_TableRow(t,e)){this.startRule(t,l.ExamplesTable);this.build(t,e);return 17}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 16}const n=["#EOF","#Empty","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 15}matchTokenAt_16(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 16}if(this.match_TableRow(t,e)){this.endRule(t);this.startRule(t,l.ExamplesTable);this.build(t,e);return 17}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 16}const n=["#EOF","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 16}matchTokenAt_17(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.build(t,e);return 17}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 17}if(this.match_Empty(t,e)){this.build(t,e);return 17}const n=["#EOF","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 17}matchTokenAt_18(e,t){if(this.match_TagLine(t,e)){this.build(t,e);return 18}if(this.match_RuleLine(t,e)){this.endRule(t);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 18}if(this.match_Empty(t,e)){this.build(t,e);return 18}const n=["#TagLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 18}matchTokenAt_19(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 19}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 20}if(this.match_BackgroundLine(t,e)){this.endRule(t);this.startRule(t,l.Background);this.build(t,e);return 21}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 20}const n=["#EOF","#Empty","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 19}matchTokenAt_20(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 20}if(this.match_BackgroundLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Background);this.build(t,e);return 21}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 20}const n=["#EOF","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 20}matchTokenAt_21(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 21}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 22}if(this.match_StepLine(t,e)){this.startRule(t,l.Step);this.build(t,e);return 23}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 22}const n=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 21}matchTokenAt_22(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 22}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 23}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 22}const n=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 22}matchTokenAt_23(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.startRule(t,l.DataTable);this.build(t,e);return 24}if(this.match_DocStringSeparator(t,e)){this.startRule(t,l.DocString);this.build(t,e);return 37}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 23}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 23}if(this.match_Empty(t,e)){this.build(t,e);return 23}const n=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 23}matchTokenAt_24(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.build(t,e);return 24}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 23}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 24}if(this.match_Empty(t,e)){this.build(t,e);return 24}const n=["#EOF","#TableRow","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 24}matchTokenAt_25(e,t){if(this.match_TagLine(t,e)){this.build(t,e);return 25}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_Comment(t,e)){this.build(t,e);return 25}if(this.match_Empty(t,e)){this.build(t,e);return 25}const n=["#TagLine","#ScenarioLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 25}matchTokenAt_26(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 26}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 27}if(this.match_StepLine(t,e)){this.startRule(t,l.Step);this.build(t,e);return 28}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 27}const n=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 26}matchTokenAt_27(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 27}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 28}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 27}const n=["#EOF","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 27}matchTokenAt_28(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.startRule(t,l.DataTable);this.build(t,e);return 29}if(this.match_DocStringSeparator(t,e)){this.startRule(t,l.DocString);this.build(t,e);return 35}if(this.match_StepLine(t,e)){this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 28}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 28}if(this.match_Empty(t,e)){this.build(t,e);return 28}const n=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 28}matchTokenAt_29(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.build(t,e);return 29}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 28}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 29}if(this.match_Empty(t,e)){this.build(t,e);return 29}const n=["#EOF","#TableRow","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 29}matchTokenAt_30(e,t){if(this.match_TagLine(t,e)){this.build(t,e);return 30}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_Comment(t,e)){this.build(t,e);return 30}if(this.match_Empty(t,e)){this.build(t,e);return 30}const n=["#TagLine","#ExamplesLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 30}matchTokenAt_31(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Empty(t,e)){this.build(t,e);return 31}if(this.match_Comment(t,e)){this.startRule(t,l.Description);this.build(t,e);return 32}if(this.match_TableRow(t,e)){this.startRule(t,l.ExamplesTable);this.build(t,e);return 33}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.startRule(t,l.Description);this.build(t,e);return 32}const n=["#EOF","#Empty","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 31}matchTokenAt_32(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_Comment(t,e)){this.build(t,e);return 32}if(this.match_TableRow(t,e)){this.endRule(t);this.startRule(t,l.ExamplesTable);this.build(t,e);return 33}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Other(t,e)){this.build(t,e);return 32}const n=["#EOF","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 32}matchTokenAt_33(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_TableRow(t,e)){this.build(t,e);return 33}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 33}if(this.match_Empty(t,e)){this.build(t,e);return 33}const n=["#EOF","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 33}matchTokenAt_35(e,t){if(this.match_DocStringSeparator(t,e)){this.build(t,e);return 36}if(this.match_Other(t,e)){this.build(t,e);return 35}const n=["#DocStringSeparator","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 35}matchTokenAt_36(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 28}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 30}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 31}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 36}if(this.match_Empty(t,e)){this.build(t,e);return 36}const n=["#EOF","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 36}matchTokenAt_37(e,t){if(this.match_DocStringSeparator(t,e)){this.build(t,e);return 38}if(this.match_Other(t,e)){this.build(t,e);return 37}const n=["#DocStringSeparator","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 37}matchTokenAt_38(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 23}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 25}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 26}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 38}if(this.match_Empty(t,e)){this.build(t,e);return 38}const n=["#EOF","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 38}matchTokenAt_39(e,t){if(this.match_DocStringSeparator(t,e)){this.build(t,e);return 40}if(this.match_Other(t,e)){this.build(t,e);return 39}const n=["#DocStringSeparator","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 39}matchTokenAt_40(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 12}if(this.match_TagLine(t,e)){if(this.lookahead_1(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Tags);this.build(t,e);return 14}}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ExamplesLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.ExamplesDefinition);this.startRule(t,l.Examples);this.build(t,e);return 15}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 40}if(this.match_Empty(t,e)){this.build(t,e);return 40}const n=["#EOF","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 40}matchTokenAt_41(e,t){if(this.match_DocStringSeparator(t,e)){this.build(t,e);return 42}if(this.match_Other(t,e)){this.build(t,e);return 41}const n=["#DocStringSeparator","#Other"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 41}matchTokenAt_42(e,t){if(this.match_EOF(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.endRule(t);this.build(t,e);return 34}if(this.match_StepLine(t,e)){this.endRule(t);this.endRule(t);this.startRule(t,l.Step);this.build(t,e);return 7}if(this.match_TagLine(t,e)){if(this.lookahead_0(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Tags);this.build(t,e);return 9}}if(this.match_TagLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.startRule(t,l.Tags);this.build(t,e);return 18}if(this.match_ScenarioLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.ScenarioDefinition);this.startRule(t,l.Scenario);this.build(t,e);return 10}if(this.match_RuleLine(t,e)){this.endRule(t);this.endRule(t);this.endRule(t);this.startRule(t,l.Rule);this.startRule(t,l.RuleHeader);this.build(t,e);return 19}if(this.match_Comment(t,e)){this.build(t,e);return 42}if(this.match_Empty(t,e)){this.build(t,e);return 42}const n=["#EOF","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];const s=e.isEof?i.UnexpectedEOFException.create(e,n):i.UnexpectedTokenException.create(e,n);if(this.stopAtFirstError)throw s;this.addError(t,s);return 42}match_EOF(e,t){return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_EOF(t)))}match_Empty(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_Empty(t)))}match_Comment(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_Comment(t)))}match_TagLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_TagLine(t)))}match_FeatureLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_FeatureLine(t)))}match_RuleLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_RuleLine(t)))}match_BackgroundLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_BackgroundLine(t)))}match_ScenarioLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_ScenarioLine(t)))}match_ExamplesLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_ExamplesLine(t)))}match_StepLine(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_StepLine(t)))}match_DocStringSeparator(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_DocStringSeparator(t)))}match_TableRow(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_TableRow(t)))}match_Language(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_Language(t)))}match_Other(e,t){if(t.isEof)return false;return this.handleExternalError(e,false,(()=>this.tokenMatcher.match_Other(t)))}lookahead_0(e,t){let n;const s=[];let r=false;do{n=this.readToken(this.context);s.push(n);if(false||this.match_ScenarioLine(e,n)){r=true;break}}while(false||this.match_Empty(e,n)||this.match_Comment(e,n)||this.match_TagLine(e,n));e.tokenQueue=e.tokenQueue.concat(s);return r}lookahead_1(e,t){let n;const s=[];let r=false;do{n=this.readToken(this.context);s.push(n);if(false||this.match_ExamplesLine(e,n)){r=true;break}}while(false||this.match_Empty(e,n)||this.match_Comment(e,n)||this.match_TagLine(e,n));e.tokenQueue=e.tokenQueue.concat(s);return r}}t["default"]=Parser},4272:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.UnexpectedEOFException=t.UnexpectedTokenException=void 0;const s=n(3840);class UnexpectedTokenException extends s.GherkinException{static create(e,t){const n=`expected: ${t.join(", ")}, got '${e.getTokenValue().trim()}'`;const s=tokenLocation(e);return UnexpectedTokenException._create(n,s)}}t.UnexpectedTokenException=UnexpectedTokenException;class UnexpectedEOFException extends s.GherkinException{static create(e,t){const n=`unexpected end of file, expected: ${t.join(", ")}`;const s=tokenLocation(e);return UnexpectedEOFException._create(n,s)}}t.UnexpectedEOFException=UnexpectedEOFException;function tokenLocation(e){var t;return((t=e.location)===null||t===void 0?void 0:t.line)&&e.line&&e.line.indent!==undefined?{line:e.location.line,column:e.line.indent+1}:e.location}},282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});class TokenScanner{constructor(e,t){this.makeToken=t;this.lineNumber=0;this.lines=e.split(/\r?\n/);if(this.lines.length>0&&this.lines[this.lines.length-1].trim()===""){this.lines.pop()}}read(){const e=this.lines[this.lineNumber++];const t={line:this.lineNumber};return this.makeToken(e,t)}}t["default"]=TokenScanner},434:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.compareStepKeywords=compareStepKeywords;function compareStepKeywords(e,t){return t.length-e.length}},2759:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=countSymbols;const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function countSymbols(e){return e.replace(n,"_").length}},6344:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t["default"]=generateMessages;const a=i(n(6088));const c=o(n(6084));const l=o(n(1112));const u=o(n(5422));const d=o(n(5140));const f=o(n(3032));const p=o(n(850));function generateMessages(e,t,n,s){let r;switch(n){case a.SourceMediaType.TEXT_X_CUCUMBER_GHERKIN_PLAIN:r=new l.default(s.defaultDialect);break;case a.SourceMediaType.TEXT_X_CUCUMBER_GHERKIN_MARKDOWN:r=new u.default(s.defaultDialect);break;default:throw new Error(`Unsupported media type: ${n}`)}const i=[];try{if(s.includeSource){i.push((0,d.default)(e,t))}if(!s.includeGherkinDocument&&!s.includePickles){return i}const n=new f.default(new c.default(s.newId),r);n.stopAtFirstError=false;const o=n.parse(e);if(s.includeGherkinDocument){i.push({gherkinDocument:{...o,uri:t}})}if(s.includePickles){const e=(0,p.default)(o,t,s.newId);for(const t of e){i.push({pickle:t})}}}catch(e){const n=e.errors||[e];for(const e of n){if(!e.location){throw e}i.push({parseError:{source:{uri:t,location:{line:e.location.line,column:e.location.column}},message:e.message}})}}return i}},119:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.TokenScanner=t.Parser=t.makeSourceEnvelope=t.generateMessages=t.GherkinInMarkdownTokenMatcher=t.GherkinClassicTokenMatcher=t.Errors=t.dialects=t.compile=t.AstBuilder=void 0;const a=o(n(6084));t.AstBuilder=a.default;const c=i(n(3840));t.Errors=c;const l=o(n(1112));t.GherkinClassicTokenMatcher=l.default;const u=o(n(5422));t.GherkinInMarkdownTokenMatcher=u.default;const d=o(n(6344));t.generateMessages=d.default;const f=o(n(6097));const p=o(n(5140));t.makeSourceEnvelope=p.default;const h=o(n(3032));t.Parser=h.default;const m=o(n(850));t.compile=m.default;const g=o(n(282));t.TokenScanner=g.default;const y=f.default;t.dialects=y},5140:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t["default"]=makeSourceEnvelope;const o=i(n(6088));function makeSourceEnvelope(e,t){let n;if(t.endsWith(".feature")){n=o.SourceMediaType.TEXT_X_CUCUMBER_GHERKIN_PLAIN}else if(t.endsWith(".md")){n=o.SourceMediaType.TEXT_X_CUCUMBER_GHERKIN_MARKDOWN}if(!n)throw new Error(`The uri (${t}) must end with .feature or .md`);return{source:{data:e,uri:t,mediaType:n}}}},850:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t["default"]=compile;const o=i(n(6088));const a={[o.StepKeywordType.UNKNOWN]:o.PickleStepType.UNKNOWN,[o.StepKeywordType.CONTEXT]:o.PickleStepType.CONTEXT,[o.StepKeywordType.ACTION]:o.PickleStepType.ACTION,[o.StepKeywordType.OUTCOME]:o.PickleStepType.OUTCOME,[o.StepKeywordType.CONJUNCTION]:null};function compile(e,t,n){const s=[];if(e.feature==null){return s}const r=e.feature;const i=r.language;const o=r.tags;let a=[];r.children.forEach((e=>{if(e.background){a=[].concat(e.background.steps)}else if(e.rule){compileRule(o,a,e.rule,i,s,t,n)}else if(e.scenario.examples.length===0){compileScenario(o,a,e.scenario,i,s,t,n)}else{compileScenarioOutline(o,a,e.scenario,i,s,t,n)}}));return s}function compileRule(e,t,n,s,r,i,o){let a=[].concat(t);const c=[].concat(e).concat(n.tags);n.children.forEach((e=>{if(e.background){a=a.concat(e.background.steps)}else if(e.scenario.examples.length===0){compileScenario(c,a,e.scenario,s,r,i,o)}else{compileScenarioOutline(c,a,e.scenario,s,r,i,o)}}))}function compileScenario(e,t,n,s,r,i,a){let c=o.StepKeywordType.UNKNOWN;const l=[];if(n.steps.length!==0){t.forEach((e=>{c=e.keywordType===o.StepKeywordType.CONJUNCTION?c:e.keywordType;l.push(pickleStep(e,[],null,a,c))}))}const u=[].concat(e).concat(n.tags);n.steps.forEach((e=>{c=e.keywordType===o.StepKeywordType.CONJUNCTION?c:e.keywordType;l.push(pickleStep(e,[],null,a,c))}));const d={id:a(),uri:i,location:n.location,astNodeIds:[n.id],tags:pickleTags(u),name:n.name,language:s,steps:l};r.push(d)}function compileScenarioOutline(e,t,n,s,r,i,a){n.examples.filter((e=>e.tableHeader)).forEach((c=>{const l=c.tableHeader.cells;c.tableBody.forEach((u=>{let d=o.StepKeywordType.UNKNOWN;const f=[];if(n.steps.length!==0){t.forEach((e=>{d=e.keywordType===o.StepKeywordType.CONJUNCTION?d:e.keywordType;f.push(pickleStep(e,[],null,a,d))}))}n.steps.forEach((e=>{d=e.keywordType===o.StepKeywordType.CONJUNCTION?d:e.keywordType;const t=pickleStep(e,l,u,a,d);f.push(t)}));const p=a();const h=pickleTags([].concat(e).concat(n.tags).concat(c.tags));r.push({id:p,uri:i,location:u.location,astNodeIds:[n.id,u.id],name:interpolate(n.name,l,u.cells),language:s,steps:f,tags:h})}))}))}function createPickleArguments(e,t,n){if(e.dataTable){const s=e.dataTable;const r={rows:s.rows.map((e=>({cells:e.cells.map((e=>({value:interpolate(e.value,t,n)})))})))};return{dataTable:r}}else if(e.docString){const s=e.docString;const r={content:interpolate(s.content,t,n)};if(s.mediaType){r.mediaType=interpolate(s.mediaType,t,n)}return{docString:r}}}function interpolate(e,t,n){t.forEach(((t,s)=>{const r=n[s];const i=`<${t.value}>`;const o=i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");const a=new RegExp(o,"g");const c=r.value.replace(/\$/g,"$$$$");e=e.replace(a,c)}));return e}function pickleStep(e,t,n,s,r){const i=[e.id];if(n){i.push(n.id)}const o=n?n.cells:[];return{id:s(),text:interpolate(e.text,t,o),type:a[r],argument:createPickleArguments(e,t,o),astNodeIds:i}}function pickleTags(e){return e.map(pickleTag)}function pickleTag(e){return{name:e.name,astNodeId:e.id}}},4951:(e,t,n)=>{"use strict";var s;s={value:true};const r=n(3430);r.code='require("ajv/dist/runtime/equal").default';t.A=r},21:e=>{"use strict";e.exports=({onlyFirst:e=false}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?undefined:"g")}},8493:e=>{"use strict";const t="[\ud800-\udbff][\udc00-\udfff]";const astralRegex=e=>e&&e.exact?new RegExp(`^${t}$`):new RegExp(t,"g");e.exports=astralRegex},4782:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});var s=n(4434);function toArr(e){return e==null?[]:Array.isArray(e)?e:[e]}function toVal(e,t,n,s){var r,i=e[t],o=!!~s.string.indexOf(t)?n==null||n===true?"":String(n):typeof n==="boolean"?n:!!~s.boolean.indexOf(t)?n==="false"?false:n==="true"||(e._.push((r=+n,r*0===0)?r:n),!!n):(r=+n,r*0===0)?r:n;e[t]=i==null?o:Array.isArray(i)?i.concat(o):[i,o]}function mri2(e,t){e=e||[];t=t||{};var n,s,r,i,o,a={_:[]};var c=0,l=0,u=0,d=e.length;const f=t.alias!==void 0;const p=t.unknown!==void 0;const h=t.default!==void 0;t.alias=t.alias||{};t.string=toArr(t.string);t.boolean=toArr(t.boolean);if(f){for(n in t.alias){s=t.alias[n]=toArr(t.alias[n]);for(c=0;c<s.length;c++){(t.alias[s[c]]=s.concat(n)).splice(c,1)}}}for(c=t.boolean.length;c-- >0;){s=t.alias[t.boolean[c]]||[];for(l=s.length;l-- >0;)t.boolean.push(s[l])}for(c=t.string.length;c-- >0;){s=t.alias[t.string[c]]||[];for(l=s.length;l-- >0;)t.string.push(s[l])}if(h){for(n in t.default){i=typeof t.default[n];s=t.alias[n]=t.alias[n]||[];if(t[i]!==void 0){t[i].push(n);for(c=0;c<s.length;c++){t[i].push(s[c])}}}}const m=p?Object.keys(t.alias):[];for(c=0;c<d;c++){r=e[c];if(r==="--"){a._=a._.concat(e.slice(++c));break}for(l=0;l<r.length;l++){if(r.charCodeAt(l)!==45)break}if(l===0){a._.push(r)}else if(r.substring(l,l+3)==="no-"){i=r.substring(l+3);if(p&&!~m.indexOf(i)){return t.unknown(r)}a[i]=false}else{for(u=l+1;u<r.length;u++){if(r.charCodeAt(u)===61)break}i=r.substring(l,u);o=r.substring(++u)||(c+1===d||(""+e[c+1]).charCodeAt(0)===45||e[++c]);s=l===2?[i]:i;for(u=0;u<s.length;u++){i=s[u];if(p&&!~m.indexOf(i))return t.unknown("-".repeat(l)+i);toVal(a,i,u+1<s.length||o,t)}}}if(h){for(n in t.default){if(a[n]===void 0){a[n]=t.default[n]}}}if(f){for(n in a){s=t.alias[n]||[];while(s.length>0){a[s.shift()]=a[n]}}}return a}const removeBrackets=e=>e.replace(/[<[].+/,"").trim();const findAllBrackets=e=>{const t=/<([^>]+)>/g;const n=/\[([^\]]+)\]/g;const s=[];const parse=e=>{let t=false;let n=e[1];if(n.startsWith("...")){n=n.slice(3);t=true}return{required:e[0].startsWith("<"),value:n,variadic:t}};let r;while(r=t.exec(e)){s.push(parse(r))}let i;while(i=n.exec(e)){s.push(parse(i))}return s};const getMriOptions=e=>{const t={alias:{},boolean:[]};for(const[n,s]of e.entries()){if(s.names.length>1){t.alias[s.names[0]]=s.names.slice(1)}if(s.isBoolean){if(s.negated){const r=e.some(((e,t)=>t!==n&&e.names.some((e=>s.names.includes(e)))&&typeof e.required==="boolean"));if(!r){t.boolean.push(s.names[0])}}else{t.boolean.push(s.names[0])}}}return t};const findLongest=e=>e.sort(((e,t)=>e.length>t.length?-1:1))[0];const padRight=(e,t)=>e.length>=t?e:`${e}${" ".repeat(t-e.length)}`;const camelcase=e=>e.replace(/([a-z])-([a-z])/g,((e,t,n)=>t+n.toUpperCase()));const setDotProp=(e,t,n)=>{let s=0;let r=t.length;let i=e;let o;for(;s<r;++s){o=i[t[s]];i=i[t[s]]=s===r-1?n:o!=null?o:!!~t[s+1].indexOf(".")||!(+t[s+1]>-1)?{}:[]}};const setByType=(e,t)=>{for(const n of Object.keys(t)){const s=t[n];if(s.shouldTransform){e[n]=Array.prototype.concat.call([],e[n]);if(typeof s.transformFunction==="function"){e[n]=e[n].map(s.transformFunction)}}}};const getFileName=e=>{const t=/([^\\\/]+)$/.exec(e);return t?t[1]:""};const camelcaseOptionName=e=>e.split(".").map(((e,t)=>t===0?camelcase(e):e)).join(".");class CACError extends Error{constructor(e){super(e);this.name=this.constructor.name;if(typeof Error.captureStackTrace==="function"){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error(e).stack}}}class Option{constructor(e,t,n){this.rawName=e;this.description=t;this.config=Object.assign({},n);e=e.replace(/\.\*/g,"");this.negated=false;this.names=removeBrackets(e).split(",").map((e=>{let t=e.trim().replace(/^-{1,2}/,"");if(t.startsWith("no-")){this.negated=true;t=t.replace(/^no-/,"")}return camelcaseOptionName(t)})).sort(((e,t)=>e.length>t.length?1:-1));this.name=this.names[this.names.length-1];if(this.negated&&this.config.default==null){this.config.default=true}if(e.includes("<")){this.required=true}else if(e.includes("[")){this.required=false}else{this.isBoolean=true}}}const r=process.argv;const i=`${process.platform}-${process.arch} node-${process.version}`;class Command{constructor(e,t,n={},s){this.rawName=e;this.description=t;this.config=n;this.cli=s;this.options=[];this.aliasNames=[];this.name=removeBrackets(e);this.args=findAllBrackets(e);this.examples=[]}usage(e){this.usageText=e;return this}allowUnknownOptions(){this.config.allowUnknownOptions=true;return this}ignoreOptionDefaultValue(){this.config.ignoreOptionDefaultValue=true;return this}version(e,t="-v, --version"){this.versionNumber=e;this.option(t,"Display version number");return this}example(e){this.examples.push(e);return this}option(e,t,n){const s=new Option(e,t,n);this.options.push(s);return this}alias(e){this.aliasNames.push(e);return this}action(e){this.commandAction=e;return this}isMatched(e){return this.name===e||this.aliasNames.includes(e)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof GlobalCommand}hasOption(e){e=e.split(".")[0];return this.options.find((t=>t.names.includes(e)))}outputHelp(){const{name:e,commands:t}=this.cli;const{versionNumber:n,options:s,helpCallback:r}=this.cli.globalCommand;let i=[{body:`${e}${n?`/${n}`:""}`}];i.push({title:"Usage",body:` $ ${e} ${this.usageText||this.rawName}`});const o=(this.isGlobalCommand||this.isDefaultCommand)&&t.length>0;if(o){const n=findLongest(t.map((e=>e.rawName)));i.push({title:"Commands",body:t.map((e=>` ${padRight(e.rawName,n.length)} ${e.description}`)).join("\n")});i.push({title:`For more info, run any command with the \`--help\` flag`,body:t.map((t=>` $ ${e}${t.name===""?"":` ${t.name}`} --help`)).join("\n")})}let a=this.isGlobalCommand?s:[...this.options,...s||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand){a=a.filter((e=>e.name!=="version"))}if(a.length>0){const e=findLongest(a.map((e=>e.rawName)));i.push({title:"Options",body:a.map((t=>` ${padRight(t.rawName,e.length)} ${t.description} ${t.config.default===void 0?"":`(default: ${t.config.default})`}`)).join("\n")})}if(this.examples.length>0){i.push({title:"Examples",body:this.examples.map((t=>{if(typeof t==="function"){return t(e)}return t})).join("\n")})}if(r){i=r(i)||i}console.log(i.map((e=>e.title?`${e.title}:\n${e.body}`:e.body)).join("\n\n"))}outputVersion(){const{name:e}=this.cli;const{versionNumber:t}=this.cli.globalCommand;if(t){console.log(`${e}/${t} ${i}`)}}checkRequiredArgs(){const e=this.args.filter((e=>e.required)).length;if(this.cli.args.length<e){throw new CACError(`missing required args for command \`${this.rawName}\``)}}checkUnknownOptions(){const{options:e,globalCommand:t}=this.cli;if(!this.config.allowUnknownOptions){for(const n of Object.keys(e)){if(n!=="--"&&!this.hasOption(n)&&!t.hasOption(n)){throw new CACError(`Unknown option \`${n.length>1?`--${n}`:`-${n}`}\``)}}}}checkOptionValue(){const{options:e,globalCommand:t}=this.cli;const n=[...t.options,...this.options];for(const t of n){const s=e[t.name.split(".")[0]];if(t.required){const e=n.some((e=>e.negated&&e.names.includes(t.name)));if(s===true||s===false&&!e){throw new CACError(`option \`${t.rawName}\` value is missing`)}}}}}class GlobalCommand extends Command{constructor(e){super("@@global@@","",{},e)}}var o=Object.assign;class CAC extends s.EventEmitter{constructor(e=""){super();this.name=e;this.commands=[];this.rawArgs=[];this.args=[];this.options={};this.globalCommand=new GlobalCommand(this);this.globalCommand.usage("<command> [options]")}usage(e){this.globalCommand.usage(e);return this}command(e,t,n){const s=new Command(e,t||"",n,this);s.globalCommand=this.globalCommand;this.commands.push(s);return s}option(e,t,n){this.globalCommand.option(e,t,n);return this}help(e){this.globalCommand.option("-h, --help","Display this message");this.globalCommand.helpCallback=e;this.showHelpOnExit=true;return this}version(e,t="-v, --version"){this.globalCommand.version(e,t);this.showVersionOnExit=true;return this}example(e){this.globalCommand.example(e);return this}outputHelp(){if(this.matchedCommand){this.matchedCommand.outputHelp()}else{this.globalCommand.outputHelp()}}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:e,options:t},n,s){this.args=e;this.options=t;if(n){this.matchedCommand=n}if(s){this.matchedCommandName=s}return this}unsetMatchedCommand(){this.matchedCommand=void 0;this.matchedCommandName=void 0}parse(e=r,{run:t=true}={}){this.rawArgs=e;if(!this.name){this.name=e[1]?getFileName(e[1]):"cli"}let n=true;for(const t of this.commands){const s=this.mri(e.slice(2),t);const r=s.args[0];if(t.isMatched(r)){n=false;const e=o(o({},s),{args:s.args.slice(1)});this.setParsedInfo(e,t,r);this.emit(`command:${r}`,t)}}if(n){for(const t of this.commands){if(t.name===""){n=false;const s=this.mri(e.slice(2),t);this.setParsedInfo(s,t);this.emit(`command:!`,t)}}}if(n){const t=this.mri(e.slice(2));this.setParsedInfo(t)}if(this.options.help&&this.showHelpOnExit){this.outputHelp();t=false;this.unsetMatchedCommand()}if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null){this.outputVersion();t=false;this.unsetMatchedCommand()}const s={args:this.args,options:this.options};if(t){this.runMatchedCommand()}if(!this.matchedCommand&&this.args[0]){this.emit("command:*")}return s}mri(e,t){const n=[...this.globalCommand.options,...t?t.options:[]];const s=getMriOptions(n);let r=[];const i=e.indexOf("--");if(i>-1){r=e.slice(i+1);e=e.slice(0,i)}let a=mri2(e,s);a=Object.keys(a).reduce(((e,t)=>o(o({},e),{[camelcaseOptionName(t)]:a[t]})),{_:[]});const c=a._;const l={"--":r};const u=t&&t.config.ignoreOptionDefaultValue?t.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue;let d=Object.create(null);for(const e of n){if(!u&&e.config.default!==void 0){for(const t of e.names){l[t]=e.config.default}}if(Array.isArray(e.config.type)){if(d[e.name]===void 0){d[e.name]=Object.create(null);d[e.name]["shouldTransform"]=true;d[e.name]["transformFunction"]=e.config.type[0]}}}for(const e of Object.keys(a)){if(e!=="_"){const t=e.split(".");setDotProp(l,t,a[e]);setByType(l,d)}}return{args:c,options:l}}runMatchedCommand(){const{args:e,options:t,matchedCommand:n}=this;if(!n||!n.commandAction)return;n.checkUnknownOptions();n.checkOptionValue();n.checkRequiredArgs();const s=[];n.args.forEach(((t,n)=>{if(t.variadic){s.push(e.slice(n))}else{s.push(e[n])}}));s.push(t);return n.commandAction.apply(this,s)}}const cac=(e="")=>new CAC(e);t.CAC=CAC;t.Command=Command;t.cac=cac;t["default"]=cac},7948:(e,t,n)=>{const{cac:s,CAC:r,Command:i}=n(4782);e.exports=s;Object.assign(e.exports,{default:s,cac:s,CAC:r,Command:i})},5781:(e,t,n)=>{"use strict";e=n.nmd(e);const wrapAnsi16=(e,t)=>(...n)=>{const s=e(...n);return`[${s+t}m`};const wrapAnsi256=(e,t)=>(...n)=>{const s=e(...n);return`[${38+t};5;${s}m`};const wrapAnsi16m=(e,t)=>(...n)=>{const s=e(...n);return`[${38+t};2;${s[0]};${s[1]};${s[2]}m`};const ansi2ansi=e=>e;const rgb2rgb=(e,t,n)=>[e,t,n];const setLazyProperty=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const s=n();Object.defineProperty(e,t,{value:s,enumerable:true,configurable:true});return s},enumerable:true,configurable:true})};let s;const makeDynamicStyles=(e,t,r,i)=>{if(s===undefined){s=n(4185)}const o=i?10:0;const a={};for(const[n,i]of Object.entries(s)){const s=n==="ansi16"?"ansi":n;if(n===t){a[s]=e(r,o)}else if(typeof i==="object"){a[s]=e(i[t],o)}}return a};function assembleStyles(){const e=new Map;const t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright;t.bgColor.bgGray=t.bgColor.bgBlackBright;t.color.grey=t.color.blackBright;t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(const[n,s]of Object.entries(t)){for(const[n,r]of Object.entries(s)){t[n]={open:`[${r[0]}m`,close:`[${r[1]}m`};s[n]=t[n];e.set(r[0],r[1])}Object.defineProperty(t,n,{value:s,enumerable:false})}Object.defineProperty(t,"codes",{value:e,enumerable:false});t.color.close="";t.bgColor.close="";setLazyProperty(t.color,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,false)));setLazyProperty(t.color,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,false)));setLazyProperty(t.color,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,false)));setLazyProperty(t.bgColor,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,true)));setLazyProperty(t.bgColor,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,true)));setLazyProperty(t.bgColor,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,true)));return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},465:(e,t,n)=>{"use strict";const s=n(5781);const{stdout:r,stderr:i}=n(1450);const{stringReplaceAll:o,stringEncaseCRLFWithFirstIndex:a}=n(8809);const{isArray:c}=Array;const l=["ansi","ansi","ansi256","ansi16m"];const u=Object.create(null);const applyOptions=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const n=r?r.level:0;e.level=t.level===undefined?n:t.level};class ChalkClass{constructor(e){return chalkFactory(e)}}const chalkFactory=e=>{const t={};applyOptions(t,e);t.template=(...e)=>chalkTag(t.template,...e);Object.setPrototypeOf(t,Chalk.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")};t.template.Instance=ChalkClass;return t.template};function Chalk(e){return chalkFactory(e)}for(const[e,t]of Object.entries(s)){u[e]={get(){const n=createBuilder(this,createStyler(t.open,t.close,this._styler),this._isEmpty);Object.defineProperty(this,e,{value:n});return n}}}u.visible={get(){const e=createBuilder(this,this._styler,true);Object.defineProperty(this,"visible",{value:e});return e}};const d=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of d){u[e]={get(){const{level:t}=this;return function(...n){const r=createStyler(s.color[l[t]][e](...n),s.color.close,this._styler);return createBuilder(this,r,this._isEmpty)}}}}for(const e of d){const t="bg"+e[0].toUpperCase()+e.slice(1);u[t]={get(){const{level:t}=this;return function(...n){const r=createStyler(s.bgColor[l[t]][e](...n),s.bgColor.close,this._styler);return createBuilder(this,r,this._isEmpty)}}}}const f=Object.defineProperties((()=>{}),{...u,level:{enumerable:true,get(){return this._generator.level},set(e){this._generator.level=e}}});const createStyler=(e,t,n)=>{let s;let r;if(n===undefined){s=e;r=t}else{s=n.openAll+e;r=t+n.closeAll}return{open:e,close:t,openAll:s,closeAll:r,parent:n}};const createBuilder=(e,t,n)=>{const builder=(...e)=>{if(c(e[0])&&c(e[0].raw)){return applyStyle(builder,chalkTag(builder,...e))}return applyStyle(builder,e.length===1?""+e[0]:e.join(" "))};Object.setPrototypeOf(builder,f);builder._generator=e;builder._styler=t;builder._isEmpty=n;return builder};const applyStyle=(e,t)=>{if(e.level<=0||!t){return e._isEmpty?"":t}let n=e._styler;if(n===undefined){return t}const{openAll:s,closeAll:r}=n;if(t.indexOf("")!==-1){while(n!==undefined){t=o(t,n.close,n.open);n=n.parent}}const i=t.indexOf("\n");if(i!==-1){t=a(t,r,s,i)}return s+t+r};let p;const chalkTag=(e,...t)=>{const[s]=t;if(!c(s)||!c(s.raw)){return t.join(" ")}const r=t.slice(1);const i=[s.raw[0]];for(let e=1;e<s.length;e++){i.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"),String(s.raw[e]))}if(p===undefined){p=n(4670)}return p(e,i.join(""))};Object.defineProperties(Chalk.prototype,u);const h=Chalk();h.supportsColor=r;h.stderr=Chalk({level:i?i.level:0});h.stderr.supportsColor=i;e.exports=h},4670:e=>{"use strict";const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const n=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const s=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const r=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;const i=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function unescape(e){const t=e[0]==="u";const n=e[1]==="{";if(t&&!n&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}if(t&&n){return String.fromCodePoint(parseInt(e.slice(2,-1),16))}return i.get(e)||e}function parseArguments(e,t){const n=[];const i=t.trim().split(/\s*,\s*/g);let o;for(const t of i){const i=Number(t);if(!Number.isNaN(i)){n.push(i)}else if(o=t.match(s)){n.push(o[2].replace(r,((e,t,n)=>t?unescape(t):n)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return n}function parseStyle(e){n.lastIndex=0;const t=[];let s;while((s=n.exec(e))!==null){const e=s[1];if(s[2]){const n=parseArguments(e,s[2]);t.push([e].concat(n))}else{t.push([e])}}return t}function buildStyle(e,t){const n={};for(const e of t){for(const t of e.styles){n[t[0]]=e.inverse?null:t.slice(1)}}let s=e;for(const[e,t]of Object.entries(n)){if(!Array.isArray(t)){continue}if(!(e in s)){throw new Error(`Unknown Chalk style: ${e}`)}s=t.length>0?s[e](...t):s[e]}return s}e.exports=(e,n)=>{const s=[];const r=[];let i=[];n.replace(t,((t,n,o,a,c,l)=>{if(n){i.push(unescape(n))}else if(a){const t=i.join("");i=[];r.push(s.length===0?t:buildStyle(e,s)(t));s.push({inverse:o,styles:parseStyle(a)})}else if(c){if(s.length===0){throw new Error("Found extraneous } in Chalk template literal")}r.push(buildStyle(e,s)(i.join("")));i=[];s.pop()}else{i.push(l)}}));r.push(i.join(""));if(s.length>0){const e=`Chalk template literal is missing ${s.length} closing bracket${s.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return r.join("")}},8809:e=>{"use strict";const stringReplaceAll=(e,t,n)=>{let s=e.indexOf(t);if(s===-1){return e}const r=t.length;let i=0;let o="";do{o+=e.substr(i,s-i)+t+n;i=s+r;s=e.indexOf(t,i)}while(s!==-1);o+=e.substr(i);return o};const stringEncaseCRLFWithFirstIndex=(e,t,n,s)=>{let r=0;let i="";do{const o=e[s-1]==="\r";i+=e.substr(r,(o?s-1:s)-r)+t+(o?"\r\n":"\n")+n;r=s+1;s=e.indexOf("\n",r)}while(s!==-1);i+=e.substr(r);return i};e.exports={stringReplaceAll:stringReplaceAll,stringEncaseCRLFWithFirstIndex:stringEncaseCRLFWithFirstIndex}},9552:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ClassTransformer=void 0;const s=n(5291);const r=n(2446);const i=n(1161);class ClassTransformer{instanceToPlain(e,t){const n=new s.TransformOperationExecutor(r.TransformationType.CLASS_TO_PLAIN,{...i.defaultOptions,...t});return n.transform(undefined,e,undefined,undefined,undefined,undefined)}classToPlainFromExist(e,t,n){const o=new s.TransformOperationExecutor(r.TransformationType.CLASS_TO_PLAIN,{...i.defaultOptions,...n});return o.transform(t,e,undefined,undefined,undefined,undefined)}plainToInstance(e,t,n){const o=new s.TransformOperationExecutor(r.TransformationType.PLAIN_TO_CLASS,{...i.defaultOptions,...n});return o.transform(undefined,t,e,undefined,undefined,undefined)}plainToClassFromExist(e,t,n){const o=new s.TransformOperationExecutor(r.TransformationType.PLAIN_TO_CLASS,{...i.defaultOptions,...n});return o.transform(e,t,undefined,undefined,undefined,undefined)}instanceToInstance(e,t){const n=new s.TransformOperationExecutor(r.TransformationType.CLASS_TO_CLASS,{...i.defaultOptions,...t});return n.transform(undefined,e,undefined,undefined,undefined,undefined)}classToClassFromExist(e,t,n){const o=new s.TransformOperationExecutor(r.TransformationType.CLASS_TO_CLASS,{...i.defaultOptions,...n});return o.transform(t,e,undefined,undefined,undefined,undefined)}serialize(e,t){return JSON.stringify(this.instanceToPlain(e,t))}deserialize(e,t,n){const s=JSON.parse(t);return this.plainToInstance(e,s,n)}deserializeArray(e,t,n){const s=JSON.parse(t);return this.plainToInstance(e,s,n)}}t.ClassTransformer=ClassTransformer},1665:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.MetadataStorage=void 0;const s=n(2446);class MetadataStorage{constructor(){this._typeMetadatas=new Map;this._transformMetadatas=new Map;this._exposeMetadatas=new Map;this._excludeMetadatas=new Map;this._ancestorsMap=new Map}addTypeMetadata(e){if(!this._typeMetadatas.has(e.target)){this._typeMetadatas.set(e.target,new Map)}this._typeMetadatas.get(e.target).set(e.propertyName,e)}addTransformMetadata(e){if(!this._transformMetadatas.has(e.target)){this._transformMetadatas.set(e.target,new Map)}if(!this._transformMetadatas.get(e.target).has(e.propertyName)){this._transformMetadatas.get(e.target).set(e.propertyName,[])}this._transformMetadatas.get(e.target).get(e.propertyName).push(e)}addExposeMetadata(e){if(!this._exposeMetadatas.has(e.target)){this._exposeMetadatas.set(e.target,new Map)}this._exposeMetadatas.get(e.target).set(e.propertyName,e)}addExcludeMetadata(e){if(!this._excludeMetadatas.has(e.target)){this._excludeMetadatas.set(e.target,new Map)}this._excludeMetadatas.get(e.target).set(e.propertyName,e)}findTransformMetadatas(e,t,n){return this.findMetadatas(this._transformMetadatas,e,t).filter((e=>{if(!e.options)return true;if(e.options.toClassOnly===true&&e.options.toPlainOnly===true)return true;if(e.options.toClassOnly===true){return n===s.TransformationType.CLASS_TO_CLASS||n===s.TransformationType.PLAIN_TO_CLASS}if(e.options.toPlainOnly===true){return n===s.TransformationType.CLASS_TO_PLAIN}return true}))}findExcludeMetadata(e,t){return this.findMetadata(this._excludeMetadatas,e,t)}findExposeMetadata(e,t){return this.findMetadata(this._exposeMetadatas,e,t)}findExposeMetadataByCustomName(e,t){return this.getExposedMetadatas(e).find((e=>e.options&&e.options.name===t))}findTypeMetadata(e,t){return this.findMetadata(this._typeMetadatas,e,t)}getStrategy(e){const t=this._excludeMetadatas.get(e);const n=t&&t.get(undefined);const s=this._exposeMetadatas.get(e);const r=s&&s.get(undefined);if(n&&r||!n&&!r)return"none";return n?"excludeAll":"exposeAll"}getExposedMetadatas(e){return this.getMetadata(this._exposeMetadatas,e)}getExcludedMetadatas(e){return this.getMetadata(this._excludeMetadatas,e)}getExposedProperties(e,t){return this.getExposedMetadatas(e).filter((e=>{if(!e.options)return true;if(e.options.toClassOnly===true&&e.options.toPlainOnly===true)return true;if(e.options.toClassOnly===true){return t===s.TransformationType.CLASS_TO_CLASS||t===s.TransformationType.PLAIN_TO_CLASS}if(e.options.toPlainOnly===true){return t===s.TransformationType.CLASS_TO_PLAIN}return true})).map((e=>e.propertyName))}getExcludedProperties(e,t){return this.getExcludedMetadatas(e).filter((e=>{if(!e.options)return true;if(e.options.toClassOnly===true&&e.options.toPlainOnly===true)return true;if(e.options.toClassOnly===true){return t===s.TransformationType.CLASS_TO_CLASS||t===s.TransformationType.PLAIN_TO_CLASS}if(e.options.toPlainOnly===true){return t===s.TransformationType.CLASS_TO_PLAIN}return true})).map((e=>e.propertyName))}clear(){this._typeMetadatas.clear();this._exposeMetadatas.clear();this._excludeMetadatas.clear();this._ancestorsMap.clear()}getMetadata(e,t){const n=e.get(t);let s;if(n){s=Array.from(n.values()).filter((e=>e.propertyName!==undefined))}const r=[];for(const n of this.getAncestors(t)){const t=e.get(n);if(t){const e=Array.from(t.values()).filter((e=>e.propertyName!==undefined));r.push(...e)}}return r.concat(s||[])}findMetadata(e,t,n){const s=e.get(t);if(s){const e=s.get(n);if(e){return e}}for(const s of this.getAncestors(t)){const t=e.get(s);if(t){const e=t.get(n);if(e){return e}}}return undefined}findMetadatas(e,t,n){const s=e.get(t);let r;if(s){r=s.get(n)}const i=[];for(const s of this.getAncestors(t)){const t=e.get(s);if(t){if(t.has(n)){i.push(...t.get(n))}}}return i.slice().reverse().concat((r||[]).slice().reverse())}getAncestors(e){if(!e)return[];if(!this._ancestorsMap.has(e)){const t=[];for(let n=Object.getPrototypeOf(e.prototype.constructor);typeof n.prototype!=="undefined";n=Object.getPrototypeOf(n.prototype.constructor)){t.push(n)}this._ancestorsMap.set(e,t)}return this._ancestorsMap.get(e)}}t.MetadataStorage=MetadataStorage},5291:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TransformOperationExecutor=void 0;const s=n(306);const r=n(2446);const i=n(1693);function instantiateArrayType(e){const t=new e;if(!(t instanceof Set)&&!("push"in t)){return[]}return t}class TransformOperationExecutor{constructor(e,t){this.transformationType=e;this.options=t;this.recursionStack=new Set}transform(e,t,n,o,a,c=0){if(Array.isArray(t)||t instanceof Set){const s=o&&this.transformationType===r.TransformationType.PLAIN_TO_CLASS?instantiateArrayType(o):[];t.forEach(((t,i)=>{const o=e?e[i]:undefined;if(!this.options.enableCircularCheck||!this.isCircular(t)){let e;if(typeof n!=="function"&&n&&n.options&&n.options.discriminator&&n.options.discriminator.property&&n.options.discriminator.subTypes){if(this.transformationType===r.TransformationType.PLAIN_TO_CLASS){e=n.options.discriminator.subTypes.find((e=>e.name===t[n.options.discriminator.property]));const r={newObject:s,object:t,property:undefined};const i=n.typeFunction(r);e===undefined?e=i:e=e.value;if(!n.options.keepDiscriminatorProperty)delete t[n.options.discriminator.property]}if(this.transformationType===r.TransformationType.CLASS_TO_CLASS){e=t.constructor}if(this.transformationType===r.TransformationType.CLASS_TO_PLAIN){t[n.options.discriminator.property]=n.options.discriminator.subTypes.find((e=>e.value===t.constructor)).name}}else{e=n}const i=this.transform(o,t,e,undefined,t instanceof Map,c+1);if(s instanceof Set){s.add(i)}else{s.push(i)}}else if(this.transformationType===r.TransformationType.CLASS_TO_CLASS){if(s instanceof Set){s.add(t)}else{s.push(t)}}}));return s}else if(n===String&&!a){if(t===null||t===undefined)return t;return String(t)}else if(n===Number&&!a){if(t===null||t===undefined)return t;return Number(t)}else if(n===Boolean&&!a){if(t===null||t===undefined)return t;return Boolean(t)}else if((n===Date||t instanceof Date)&&!a){if(t instanceof Date){return new Date(t.valueOf())}if(t===null||t===undefined)return t;return new Date(t)}else if(!!(0,i.getGlobal)().Buffer&&(n===Buffer||t instanceof Buffer)&&!a){if(t===null||t===undefined)return t;return Buffer.from(t)}else if((0,i.isPromise)(t)&&!a){return new Promise(((e,s)=>{t.then((t=>e(this.transform(undefined,t,n,undefined,undefined,c+1))),s)}))}else if(!a&&t!==null&&typeof t==="object"&&typeof t.then==="function"){return t}else if(typeof t==="object"&&t!==null){if(!n&&t.constructor!==Object)if(!Array.isArray(t)&&t.constructor===Array){}else{n=t.constructor}if(!n&&e)n=e.constructor;if(this.options.enableCircularCheck){this.recursionStack.add(t)}const i=this.getKeys(n,t,a);let o=e?e:{};if(!e&&(this.transformationType===r.TransformationType.PLAIN_TO_CLASS||this.transformationType===r.TransformationType.CLASS_TO_CLASS)){if(a){o=new Map}else if(n){o=new n}else{o={}}}for(const l of i){if(l==="__proto__"||l==="constructor"){continue}const i=l;let u=l,d=l;if(!this.options.ignoreDecorators&&n){if(this.transformationType===r.TransformationType.PLAIN_TO_CLASS){const e=s.defaultMetadataStorage.findExposeMetadataByCustomName(n,l);if(e){d=e.propertyName;u=e.propertyName}}else if(this.transformationType===r.TransformationType.CLASS_TO_PLAIN||this.transformationType===r.TransformationType.CLASS_TO_CLASS){const e=s.defaultMetadataStorage.findExposeMetadata(n,l);if(e&&e.options&&e.options.name){u=e.options.name}}}let f=undefined;if(this.transformationType===r.TransformationType.PLAIN_TO_CLASS){f=t[i]}else{if(t instanceof Map){f=t.get(i)}else if(t[i]instanceof Function){f=t[i]()}else{f=t[i]}}let p=undefined,h=f instanceof Map;if(n&&a){p=n}else if(n){const e=s.defaultMetadataStorage.findTypeMetadata(n,d);if(e){const n={newObject:o,object:t,property:d};const s=e.typeFunction?e.typeFunction(n):e.reflectedType;if(e.options&&e.options.discriminator&&e.options.discriminator.property&&e.options.discriminator.subTypes){if(!(t[i]instanceof Array)){if(this.transformationType===r.TransformationType.PLAIN_TO_CLASS){p=e.options.discriminator.subTypes.find((t=>{if(f&&f instanceof Object&&e.options.discriminator.property in f){return t.name===f[e.options.discriminator.property]}}));p===undefined?p=s:p=p.value;if(!e.options.keepDiscriminatorProperty){if(f&&f instanceof Object&&e.options.discriminator.property in f){delete f[e.options.discriminator.property]}}}if(this.transformationType===r.TransformationType.CLASS_TO_CLASS){p=f.constructor}if(this.transformationType===r.TransformationType.CLASS_TO_PLAIN){if(f){f[e.options.discriminator.property]=e.options.discriminator.subTypes.find((e=>e.value===f.constructor)).name}}}else{p=e}}else{p=s}h=h||e.reflectedType===Map}else if(this.options.targetMaps){this.options.targetMaps.filter((e=>e.target===n&&!!e.properties[d])).forEach((e=>p=e.properties[d]))}else if(this.options.enableImplicitConversion&&this.transformationType===r.TransformationType.PLAIN_TO_CLASS){const e=Reflect.getMetadata("design:type",n.prototype,d);if(e){p=e}}}const m=Array.isArray(t[i])?this.getReflectedType(n,d):undefined;const g=e?e[i]:undefined;if(o.constructor.prototype){const e=Object.getOwnPropertyDescriptor(o.constructor.prototype,u);if((this.transformationType===r.TransformationType.PLAIN_TO_CLASS||this.transformationType===r.TransformationType.CLASS_TO_CLASS)&&(e&&!e.set||o[u]instanceof Function))continue}if(!this.options.enableCircularCheck||!this.isCircular(f)){const e=this.transformationType===r.TransformationType.PLAIN_TO_CLASS?u:l;let s;if(this.transformationType===r.TransformationType.CLASS_TO_PLAIN){s=t[e];s=this.applyCustomTransformations(s,n,e,t,this.transformationType);s=t[e]===s?f:s;s=this.transform(g,s,p,m,h,c+1)}else{if(f===undefined&&this.options.exposeDefaultValues){s=o[u]}else{s=this.transform(g,f,p,m,h,c+1);s=this.applyCustomTransformations(s,n,e,t,this.transformationType)}}if(s!==undefined||this.options.exposeUnsetFields){if(o instanceof Map){o.set(u,s)}else{o[u]=s}}}else if(this.transformationType===r.TransformationType.CLASS_TO_CLASS){let e=f;e=this.applyCustomTransformations(e,n,l,t,this.transformationType);if(e!==undefined||this.options.exposeUnsetFields){if(o instanceof Map){o.set(u,e)}else{o[u]=e}}}}if(this.options.enableCircularCheck){this.recursionStack.delete(t)}return o}else{return t}}applyCustomTransformations(e,t,n,r,i){let o=s.defaultMetadataStorage.findTransformMetadatas(t,n,this.transformationType);if(this.options.version!==undefined){o=o.filter((e=>{if(!e.options)return true;return this.checkVersion(e.options.since,e.options.until)}))}if(this.options.groups&&this.options.groups.length){o=o.filter((e=>{if(!e.options)return true;return this.checkGroups(e.options.groups)}))}else{o=o.filter((e=>!e.options||!e.options.groups||!e.options.groups.length))}o.forEach((t=>{e=t.transformFn({value:e,key:n,obj:r,type:i,options:this.options})}));return e}isCircular(e){return this.recursionStack.has(e)}getReflectedType(e,t){if(!e)return undefined;const n=s.defaultMetadataStorage.findTypeMetadata(e,t);return n?n.reflectedType:undefined}getKeys(e,t,n){let i=s.defaultMetadataStorage.getStrategy(e);if(i==="none")i=this.options.strategy||"exposeAll";let o=[];if(i==="exposeAll"||n){if(t instanceof Map){o=Array.from(t.keys())}else{o=Object.keys(t)}}if(n){return o}if(this.options.ignoreDecorators&&this.options.excludeExtraneousValues&&e){const t=s.defaultMetadataStorage.getExposedProperties(e,this.transformationType);const n=s.defaultMetadataStorage.getExcludedProperties(e,this.transformationType);o=[...t,...n]}if(!this.options.ignoreDecorators&&e){let t=s.defaultMetadataStorage.getExposedProperties(e,this.transformationType);if(this.transformationType===r.TransformationType.PLAIN_TO_CLASS){t=t.map((t=>{const n=s.defaultMetadataStorage.findExposeMetadata(e,t);if(n&&n.options&&n.options.name){return n.options.name}return t}))}if(this.options.excludeExtraneousValues){o=t}else{o=o.concat(t)}const n=s.defaultMetadataStorage.getExcludedProperties(e,this.transformationType);if(n.length>0){o=o.filter((e=>!n.includes(e)))}if(this.options.version!==undefined){o=o.filter((t=>{const n=s.defaultMetadataStorage.findExposeMetadata(e,t);if(!n||!n.options)return true;return this.checkVersion(n.options.since,n.options.until)}))}if(this.options.groups&&this.options.groups.length){o=o.filter((t=>{const n=s.defaultMetadataStorage.findExposeMetadata(e,t);if(!n||!n.options)return true;return this.checkGroups(n.options.groups)}))}else{o=o.filter((t=>{const n=s.defaultMetadataStorage.findExposeMetadata(e,t);return!n||!n.options||!n.options.groups||!n.options.groups.length}))}}if(this.options.excludePrefixes&&this.options.excludePrefixes.length){o=o.filter((e=>this.options.excludePrefixes.every((t=>e.substr(0,t.length)!==t))))}o=o.filter(((e,t,n)=>n.indexOf(e)===t));return o}checkVersion(e,t){let n=true;if(n&&e)n=this.options.version>=e;if(n&&t)n=this.options.version<t;return n}checkGroups(e){if(!e)return true;return this.options.groups.some((t=>e.includes(t)))}}t.TransformOperationExecutor=TransformOperationExecutor},1161:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.defaultOptions=void 0;t.defaultOptions={enableCircularCheck:false,enableImplicitConversion:false,excludeExtraneousValues:false,excludePrefixes:undefined,exposeDefaultValues:false,exposeUnsetFields:true,groups:undefined,ignoreDecorators:false,strategy:undefined,targetMaps:undefined,version:undefined}},9463:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Exclude=void 0;const s=n(306);function Exclude(e={}){return function(t,n){s.defaultMetadataStorage.addExcludeMetadata({target:t instanceof Function?t:t.constructor,propertyName:n,options:e})}}t.Exclude=Exclude},1787:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Expose=void 0;const s=n(306);function Expose(e={}){return function(t,n){s.defaultMetadataStorage.addExposeMetadata({target:t instanceof Function?t:t.constructor,propertyName:n,options:e})}}t.Expose=Expose},2854:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(9463),t);r(n(1787),t);r(n(9461),t);r(n(7174),t);r(n(6258),t);r(n(385),t);r(n(1715),t)},9461:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TransformInstanceToInstance=void 0;const s=n(9552);function TransformInstanceToInstance(e){return function(t,n,r){const i=new s.ClassTransformer;const o=r.value;r.value=function(...t){const n=o.apply(this,t);const s=!!n&&(typeof n==="object"||typeof n==="function")&&typeof n.then==="function";return s?n.then((t=>i.instanceToInstance(t,e))):i.instanceToInstance(n,e)}}}t.TransformInstanceToInstance=TransformInstanceToInstance},7174:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TransformInstanceToPlain=void 0;const s=n(9552);function TransformInstanceToPlain(e){return function(t,n,r){const i=new s.ClassTransformer;const o=r.value;r.value=function(...t){const n=o.apply(this,t);const s=!!n&&(typeof n==="object"||typeof n==="function")&&typeof n.then==="function";return s?n.then((t=>i.instanceToPlain(t,e))):i.instanceToPlain(n,e)}}}t.TransformInstanceToPlain=TransformInstanceToPlain},6258:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TransformPlainToInstance=void 0;const s=n(9552);function TransformPlainToInstance(e,t){return function(n,r,i){const o=new s.ClassTransformer;const a=i.value;i.value=function(...n){const s=a.apply(this,n);const r=!!s&&(typeof s==="object"||typeof s==="function")&&typeof s.then==="function";return r?s.then((n=>o.plainToInstance(e,n,t))):o.plainToInstance(e,s,t)}}}t.TransformPlainToInstance=TransformPlainToInstance},385:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Transform=void 0;const s=n(306);function Transform(e,t={}){return function(n,r){s.defaultMetadataStorage.addTransformMetadata({target:n.constructor,propertyName:r,transformFn:e,options:t})}}t.Transform=Transform},1715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Type=void 0;const s=n(306);function Type(e,t={}){return function(n,r){const i=Reflect.getMetadata("design:type",n,r);s.defaultMetadataStorage.addTypeMetadata({target:n.constructor,propertyName:r,reflectedType:i,typeFunction:e,options:t})}}t.Type=Type},2446:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(2435),t)},2435:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TransformationType=void 0;var n;(function(e){e[e["PLAIN_TO_CLASS"]=0]="PLAIN_TO_CLASS";e[e["CLASS_TO_PLAIN"]=1]="CLASS_TO_PLAIN";e[e["CLASS_TO_CLASS"]=2]="CLASS_TO_CLASS"})(n=t.TransformationType||(t.TransformationType={}))},451:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});t.deserializeArray=t.deserialize=t.serialize=t.classToClassFromExist=t.instanceToInstance=t.plainToClassFromExist=t.plainToInstance=t.plainToClass=t.classToPlainFromExist=t.instanceToPlain=t.classToPlain=t.ClassTransformer=void 0;const i=n(9552);var o=n(9552);Object.defineProperty(t,"ClassTransformer",{enumerable:true,get:function(){return o.ClassTransformer}});r(n(2854),t);r(n(6400),t);r(n(2446),t);const a=new i.ClassTransformer;function classToPlain(e,t){return a.instanceToPlain(e,t)}t.classToPlain=classToPlain;function instanceToPlain(e,t){return a.instanceToPlain(e,t)}t.instanceToPlain=instanceToPlain;function classToPlainFromExist(e,t,n){return a.classToPlainFromExist(e,t,n)}t.classToPlainFromExist=classToPlainFromExist;function plainToClass(e,t,n){return a.plainToInstance(e,t,n)}t.plainToClass=plainToClass;function plainToInstance(e,t,n){return a.plainToInstance(e,t,n)}t.plainToInstance=plainToInstance;function plainToClassFromExist(e,t,n){return a.plainToClassFromExist(e,t,n)}t.plainToClassFromExist=plainToClassFromExist;function instanceToInstance(e,t){return a.instanceToInstance(e,t)}t.instanceToInstance=instanceToInstance;function classToClassFromExist(e,t,n){return a.classToClassFromExist(e,t,n)}t.classToClassFromExist=classToClassFromExist;function serialize(e,t){return a.serialize(e,t)}t.serialize=serialize;function deserialize(e,t,n){return a.deserialize(e,t,n)}t.deserialize=deserialize;function deserializeArray(e,t,n){return a.deserializeArray(e,t,n)}t.deserializeArray=deserializeArray},3159:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},4196:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},165:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},7023:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},2315:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},4597:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},3715:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},6400:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(7023),t);r(n(165),t);r(n(2315),t);r(n(4597),t);r(n(3715),t);r(n(9991),t);r(n(9995),t);r(n(1973),t);r(n(1413),t);r(n(1387),t);r(n(3159),t);r(n(4196),t);r(n(2549),t);r(n(2334),t)},9991:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},9995:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1413:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1973:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1387:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},2549:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},2334:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},306:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.defaultMetadataStorage=void 0;const s=n(1665);t.defaultMetadataStorage=new s.MetadataStorage},9091:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getGlobal=void 0;function getGlobal(){if(typeof globalThis!=="undefined"){return globalThis}if(typeof global!=="undefined"){return global}if(typeof window!=="undefined"){return window}if(typeof self!=="undefined"){return self}}t.getGlobal=getGlobal},1693:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(9091),t);r(n(879),t)},879:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isPromise=void 0;function isPromise(e){return e!==null&&typeof e==="object"&&typeof e.then==="function"}t.isPromise=isPromise},6872:(e,t,n)=>{const s=n(4953);const r={};for(const e of Object.keys(s)){r[s[e]]=e}const i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=i;for(const e of Object.keys(i)){if(!("channels"in i[e])){throw new Error("missing channels property: "+e)}if(!("labels"in i[e])){throw new Error("missing channel labels property: "+e)}if(i[e].labels.length!==i[e].channels){throw new Error("channel and label counts mismatch: "+e)}const{channels:t,labels:n}=i[e];delete i[e].channels;delete i[e].labels;Object.defineProperty(i[e],"channels",{value:t});Object.defineProperty(i[e],"labels",{value:n})}i.rgb.hsl=function(e){const t=e[0]/255;const n=e[1]/255;const s=e[2]/255;const r=Math.min(t,n,s);const i=Math.max(t,n,s);const o=i-r;let a;let c;if(i===r){a=0}else if(t===i){a=(n-s)/o}else if(n===i){a=2+(s-t)/o}else if(s===i){a=4+(t-n)/o}a=Math.min(a*60,360);if(a<0){a+=360}const l=(r+i)/2;if(i===r){c=0}else if(l<=.5){c=o/(i+r)}else{c=o/(2-i-r)}return[a,c*100,l*100]};i.rgb.hsv=function(e){let t;let n;let s;let r;let i;const o=e[0]/255;const a=e[1]/255;const c=e[2]/255;const l=Math.max(o,a,c);const u=l-Math.min(o,a,c);const diffc=function(e){return(l-e)/6/u+1/2};if(u===0){r=0;i=0}else{i=u/l;t=diffc(o);n=diffc(a);s=diffc(c);if(o===l){r=s-n}else if(a===l){r=1/3+t-s}else if(c===l){r=2/3+n-t}if(r<0){r+=1}else if(r>1){r-=1}}return[r*360,i*100,l*100]};i.rgb.hwb=function(e){const t=e[0];const n=e[1];let s=e[2];const r=i.rgb.hsl(e)[0];const o=1/255*Math.min(t,Math.min(n,s));s=1-1/255*Math.max(t,Math.max(n,s));return[r,o*100,s*100]};i.rgb.cmyk=function(e){const t=e[0]/255;const n=e[1]/255;const s=e[2]/255;const r=Math.min(1-t,1-n,1-s);const i=(1-t-r)/(1-r)||0;const o=(1-n-r)/(1-r)||0;const a=(1-s-r)/(1-r)||0;return[i*100,o*100,a*100,r*100]};function comparativeDistance(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){const t=r[e];if(t){return t}let n=Infinity;let i;for(const t of Object.keys(s)){const r=s[t];const o=comparativeDistance(e,r);if(o<n){n=o;i=t}}return i};i.keyword.rgb=function(e){return s[e]};i.rgb.xyz=function(e){let t=e[0]/255;let n=e[1]/255;let s=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;s=s>.04045?((s+.055)/1.055)**2.4:s/12.92;const r=t*.4124+n*.3576+s*.1805;const i=t*.2126+n*.7152+s*.0722;const o=t*.0193+n*.1192+s*.9505;return[r*100,i*100,o*100]};i.rgb.lab=function(e){const t=i.rgb.xyz(e);let n=t[0];let s=t[1];let r=t[2];n/=95.047;s/=100;r/=108.883;n=n>.008856?n**(1/3):7.787*n+16/116;s=s>.008856?s**(1/3):7.787*s+16/116;r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*s-16;const a=500*(n-s);const c=200*(s-r);return[o,a,c]};i.hsl.rgb=function(e){const t=e[0]/360;const n=e[1]/100;const s=e[2]/100;let r;let i;let o;if(n===0){o=s*255;return[o,o,o]}if(s<.5){r=s*(1+n)}else{r=s+n-s*n}const a=2*s-r;const c=[0,0,0];for(let e=0;e<3;e++){i=t+1/3*-(e-1);if(i<0){i++}if(i>1){i--}if(6*i<1){o=a+(r-a)*6*i}else if(2*i<1){o=r}else if(3*i<2){o=a+(r-a)*(2/3-i)*6}else{o=a}c[e]=o*255}return c};i.hsl.hsv=function(e){const t=e[0];let n=e[1]/100;let s=e[2]/100;let r=n;const i=Math.max(s,.01);s*=2;n*=s<=1?s:2-s;r*=i<=1?i:2-i;const o=(s+n)/2;const a=s===0?2*r/(i+r):2*n/(s+n);return[t,a*100,o*100]};i.hsv.rgb=function(e){const t=e[0]/60;const n=e[1]/100;let s=e[2]/100;const r=Math.floor(t)%6;const i=t-Math.floor(t);const o=255*s*(1-n);const a=255*s*(1-n*i);const c=255*s*(1-n*(1-i));s*=255;switch(r){case 0:return[s,c,o];case 1:return[a,s,o];case 2:return[o,s,c];case 3:return[o,a,s];case 4:return[c,o,s];case 5:return[s,o,a]}};i.hsv.hsl=function(e){const t=e[0];const n=e[1]/100;const s=e[2]/100;const r=Math.max(s,.01);let i;let o;o=(2-n)*s;const a=(2-n)*r;i=n*r;i/=a<=1?a:2-a;i=i||0;o/=2;return[t,i*100,o*100]};i.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100;let s=e[2]/100;const r=n+s;let i;if(r>1){n/=r;s/=r}const o=Math.floor(6*t);const a=1-s;i=6*t-o;if((o&1)!==0){i=1-i}const c=n+i*(a-n);let l;let u;let d;switch(o){default:case 6:case 0:l=a;u=c;d=n;break;case 1:l=c;u=a;d=n;break;case 2:l=n;u=a;d=c;break;case 3:l=n;u=c;d=a;break;case 4:l=c;u=n;d=a;break;case 5:l=a;u=n;d=c;break}return[l*255,u*255,d*255]};i.cmyk.rgb=function(e){const t=e[0]/100;const n=e[1]/100;const s=e[2]/100;const r=e[3]/100;const i=1-Math.min(1,t*(1-r)+r);const o=1-Math.min(1,n*(1-r)+r);const a=1-Math.min(1,s*(1-r)+r);return[i*255,o*255,a*255]};i.xyz.rgb=function(e){const t=e[0]/100;const n=e[1]/100;const s=e[2]/100;let r;let i;let o;r=t*3.2406+n*-1.5372+s*-.4986;i=t*-.9689+n*1.8758+s*.0415;o=t*.0557+n*-.204+s*1.057;r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92;i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92;o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92;r=Math.min(Math.max(0,r),1);i=Math.min(Math.max(0,i),1);o=Math.min(Math.max(0,o),1);return[r*255,i*255,o*255]};i.xyz.lab=function(e){let t=e[0];let n=e[1];let s=e[2];t/=95.047;n/=100;s/=108.883;t=t>.008856?t**(1/3):7.787*t+16/116;n=n>.008856?n**(1/3):7.787*n+16/116;s=s>.008856?s**(1/3):7.787*s+16/116;const r=116*n-16;const i=500*(t-n);const o=200*(n-s);return[r,i,o]};i.lab.xyz=function(e){const t=e[0];const n=e[1];const s=e[2];let r;let i;let o;i=(t+16)/116;r=n/500+i;o=i-s/200;const a=i**3;const c=r**3;const l=o**3;i=a>.008856?a:(i-16/116)/7.787;r=c>.008856?c:(r-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;r*=95.047;i*=100;o*=108.883;return[r,i,o]};i.lab.lch=function(e){const t=e[0];const n=e[1];const s=e[2];let r;const i=Math.atan2(s,n);r=i*360/2/Math.PI;if(r<0){r+=360}const o=Math.sqrt(n*n+s*s);return[t,o,r]};i.lch.lab=function(e){const t=e[0];const n=e[1];const s=e[2];const r=s/360*2*Math.PI;const i=n*Math.cos(r);const o=n*Math.sin(r);return[t,i,o]};i.rgb.ansi16=function(e,t=null){const[n,s,r]=e;let o=t===null?i.rgb.hsv(e)[2]:t;o=Math.round(o/50);if(o===0){return 30}let a=30+(Math.round(r/255)<<2|Math.round(s/255)<<1|Math.round(n/255));if(o===2){a+=60}return a};i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])};i.rgb.ansi256=function(e){const t=e[0];const n=e[1];const s=e[2];if(t===n&&n===s){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}const r=16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(s/255*5);return r};i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}const n=(~~(e>50)+1)*.5;const s=(t&1)*n*255;const r=(t>>1&1)*n*255;const i=(t>>2&1)*n*255;return[s,r,i]};i.ansi256.rgb=function(e){if(e>=232){const t=(e-232)*10+8;return[t,t,t]}e-=16;let t;const n=Math.floor(e/36)/5*255;const s=Math.floor((t=e%36)/6)/5*255;const r=t%6/5*255;return[n,s,r]};i.rgb.hex=function(e){const t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);const n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};i.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}let n=t[0];if(t[0].length===3){n=n.split("").map((e=>e+e)).join("")}const s=parseInt(n,16);const r=s>>16&255;const i=s>>8&255;const o=s&255;return[r,i,o]};i.rgb.hcg=function(e){const t=e[0]/255;const n=e[1]/255;const s=e[2]/255;const r=Math.max(Math.max(t,n),s);const i=Math.min(Math.min(t,n),s);const o=r-i;let a;let c;if(o<1){a=i/(1-o)}else{a=0}if(o<=0){c=0}else if(r===t){c=(n-s)/o%6}else if(r===n){c=2+(s-t)/o}else{c=4+(t-n)/o}c/=6;c%=1;return[c*360,o*100,a*100]};i.hsl.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const s=n<.5?2*t*n:2*t*(1-n);let r=0;if(s<1){r=(n-.5*s)/(1-s)}return[e[0],s*100,r*100]};i.hsv.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const s=t*n;let r=0;if(s<1){r=(n-s)/(1-s)}return[e[0],s*100,r*100]};i.hcg.rgb=function(e){const t=e[0]/360;const n=e[1]/100;const s=e[2]/100;if(n===0){return[s*255,s*255,s*255]}const r=[0,0,0];const i=t%1*6;const o=i%1;const a=1-o;let c=0;switch(Math.floor(i)){case 0:r[0]=1;r[1]=o;r[2]=0;break;case 1:r[0]=a;r[1]=1;r[2]=0;break;case 2:r[0]=0;r[1]=1;r[2]=o;break;case 3:r[0]=0;r[1]=a;r[2]=1;break;case 4:r[0]=o;r[1]=0;r[2]=1;break;default:r[0]=1;r[1]=0;r[2]=a}c=(1-n)*s;return[(n*r[0]+c)*255,(n*r[1]+c)*255,(n*r[2]+c)*255]};i.hcg.hsv=function(e){const t=e[1]/100;const n=e[2]/100;const s=t+n*(1-t);let r=0;if(s>0){r=t/s}return[e[0],r*100,s*100]};i.hcg.hsl=function(e){const t=e[1]/100;const n=e[2]/100;const s=n*(1-t)+.5*t;let r=0;if(s>0&&s<.5){r=t/(2*s)}else if(s>=.5&&s<1){r=t/(2*(1-s))}return[e[0],r*100,s*100]};i.hcg.hwb=function(e){const t=e[1]/100;const n=e[2]/100;const s=t+n*(1-t);return[e[0],(s-t)*100,(1-s)*100]};i.hwb.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const s=1-n;const r=s-t;let i=0;if(r<1){i=(s-r)/(1-r)}return[e[0],r*100,i*100]};i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};i.gray.hsl=function(e){return[0,0,e[0]]};i.gray.hsv=i.gray.hsl;i.gray.hwb=function(e){return[0,100,e[0]]};i.gray.cmyk=function(e){return[0,0,0,e[0]]};i.gray.lab=function(e){return[e[0],0,0]};i.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255;const n=(t<<16)+(t<<8)+t;const s=n.toString(16).toUpperCase();return"000000".substring(s.length)+s};i.rgb.gray=function(e){const t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},4185:(e,t,n)=>{const s=n(6872);const r=n(4200);const i={};const o=Object.keys(s);function wrapRaw(e){const wrappedFn=function(...t){const n=t[0];if(n===undefined||n===null){return n}if(n.length>1){t=n}return e(t)};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}function wrapRounded(e){const wrappedFn=function(...t){const n=t[0];if(n===undefined||n===null){return n}if(n.length>1){t=n}const s=e(t);if(typeof s==="object"){for(let e=s.length,t=0;t<e;t++){s[t]=Math.round(s[t])}}return s};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}o.forEach((e=>{i[e]={};Object.defineProperty(i[e],"channels",{value:s[e].channels});Object.defineProperty(i[e],"labels",{value:s[e].labels});const t=r(e);const n=Object.keys(t);n.forEach((n=>{const s=t[n];i[e][n]=wrapRounded(s);i[e][n].raw=wrapRaw(s)}))}));e.exports=i},4200:(e,t,n)=>{const s=n(6872);function buildGraph(){const e={};const t=Object.keys(s);for(let n=t.length,s=0;s<n;s++){e[t[s]]={distance:-1,parent:null}}return e}function deriveBFS(e){const t=buildGraph();const n=[e];t[e].distance=0;while(n.length){const e=n.pop();const r=Object.keys(s[e]);for(let s=r.length,i=0;i<s;i++){const s=r[i];const o=t[s];if(o.distance===-1){o.distance=t[e].distance+1;o.parent=e;n.unshift(s)}}}return t}function link(e,t){return function(n){return t(e(n))}}function wrapConversion(e,t){const n=[t[e].parent,e];let r=s[t[e].parent][e];let i=t[e].parent;while(t[i].parent){n.unshift(t[i].parent);r=link(s[t[i].parent][i],r);i=t[i].parent}r.conversion=n;return r}e.exports=function(e){const t=deriveBFS(e);const n={};const s=Object.keys(t);for(let e=s.length,r=0;r<e;r++){const e=s[r];const i=t[e];if(i.parent===null){continue}n[e]=wrapConversion(e,t)}return n}},4953:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},6110:(e,t,n)=>{t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.storage=localstorage();t.destroy=(()=>{let e=false;return()=>{if(!e){e=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}let e;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(t){t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff);if(!this.useColors){return}const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let s=0;let r=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{if(e==="%%"){return}s++;if(e==="%c"){r=s}}));t.splice(r,0,n)}t.log=console.debug||console.log||(()=>{});function save(e){try{if(e){t.storage.setItem("debug",e)}else{t.storage.removeItem("debug")}}catch(e){}}function load(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function localstorage(){try{return localStorage}catch(e){}}e.exports=n(897)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},897:(e,t,n)=>{function setup(e){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=n(744);createDebug.destroy=destroy;Object.keys(e).forEach((t=>{createDebug[t]=e[t]}));createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(e){let t=0;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n);t|=0}return createDebug.colors[Math.abs(t)%createDebug.colors.length]}createDebug.selectColor=selectColor;function createDebug(e){let t;let n=null;let s;let r;function debug(...e){if(!debug.enabled){return}const n=debug;const s=Number(new Date);const r=s-(t||s);n.diff=r;n.prev=t;n.curr=s;t=s;e[0]=createDebug.coerce(e[0]);if(typeof e[0]!=="string"){e.unshift("%O")}let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,s)=>{if(t==="%%"){return"%"}i++;const r=createDebug.formatters[s];if(typeof r==="function"){const s=e[i];t=r.call(n,s);e.splice(i,1);i--}return t}));createDebug.formatArgs.call(n,e);const o=n.log||createDebug.log;o.apply(n,e)}debug.namespace=e;debug.useColors=createDebug.useColors();debug.color=createDebug.selectColor(e);debug.extend=extend;debug.destroy=createDebug.destroy;Object.defineProperty(debug,"enabled",{enumerable:true,configurable:false,get:()=>{if(n!==null){return n}if(s!==createDebug.namespaces){s=createDebug.namespaces;r=createDebug.enabled(e)}return r},set:e=>{n=e}});if(typeof createDebug.init==="function"){createDebug.init(debug)}return debug}function extend(e,t){const n=createDebug(this.namespace+(typeof t==="undefined"?":":t)+e);n.log=this.log;return n}function enable(e){createDebug.save(e);createDebug.namespaces=e;createDebug.names=[];createDebug.skips=[];const t=(typeof e==="string"?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of t){if(e[0]==="-"){createDebug.skips.push(e.slice(1))}else{createDebug.names.push(e)}}}function matchesTemplate(e,t){let n=0;let s=0;let r=-1;let i=0;while(n<e.length){if(s<t.length&&(t[s]===e[n]||t[s]==="*")){if(t[s]==="*"){r=s;i=n;s++}else{n++;s++}}else if(r!==-1){s=r+1;i++;n=i}else{return false}}while(s<t.length&&t[s]==="*"){s++}return s===t.length}function disable(){const e=[...createDebug.names,...createDebug.skips.map((e=>"-"+e))].join(",");createDebug.enable("");return e}function enabled(e){for(const t of createDebug.skips){if(matchesTemplate(e,t)){return false}}for(const t of createDebug.names){if(matchesTemplate(e,t)){return true}}return false}function coerce(e){if(e instanceof Error){return e.stack||e.message}return e}function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}createDebug.enable(createDebug.load());return createDebug}e.exports=setup},2830:(e,t,n)=>{if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){e.exports=n(6110)}else{e.exports=n(5108)}},5108:(e,t,n)=>{const s=n(2018);const r=n(9023);t.init=init;t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");t.colors=[6,2,3,4,5,1];try{const e=n(1450);if(e&&(e.stderr||e).level>=2){t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let s=process.env[t];if(/^(yes|on|true|enabled)$/i.test(s)){s=true}else if(/^(no|off|false|disabled)$/i.test(s)){s=false}else if(s==="null"){s=null}else{s=Number(s)}e[n]=s;return e}),{});function useColors(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):s.isatty(process.stderr.fd)}function formatArgs(t){const{namespace:n,useColors:s}=this;if(s){const s=this.color;const r="[3"+(s<8?s:"8;5;"+s);const i=` ${r};1m${n} `;t[0]=i+t[0].split("\n").join("\n"+i);t.push(r+"m+"+e.exports.humanize(this.diff)+"")}else{t[0]=getDate()+n+" "+t[0]}}function getDate(){if(t.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...e){return process.stderr.write(r.formatWithOptions(t.inspectOpts,...e)+"\n")}function save(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let s=0;s<n.length;s++){e.inspectOpts[n[s]]=t.inspectOpts[n[s]]}}e.exports=n(897)(t);const{formatters:i}=e.exports;i.o=function(e){this.inspectOpts.colors=this.useColors;return r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")};i.O=function(e){this.inspectOpts.colors=this.useColors;return r.inspect(e,this.inspectOpts)}},872:e=>{"use strict";e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}},3430:e=>{"use strict";e.exports=function equal(e,t){if(e===t)return true;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return false;var n,s,r;if(Array.isArray(e)){n=e.length;if(n!=t.length)return false;for(s=n;s--!==0;)if(!equal(e[s],t[s]))return false;return true}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();r=Object.keys(e);n=r.length;if(n!==Object.keys(t).length)return false;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[s]))return false;for(s=n;s--!==0;){var i=r[s];if(!equal(e[i],t[i]))return false}return true}return e!==e&&t!==t}},3070:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Background=void 0;const s=n(5374);const r=n(8492);const i=n(8964);const o=n(7600);const a=(0,o.getDebugger)("Background");class Background extends r.Element{static parse(e,t){var n,s,r,o,c;a("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!e.background){throw new TypeError("The given object is not a Background!")}const{keyword:l,name:u,description:d,steps:f,location:p}=e.background;const h=new Background(l,u,d);h.precedingComment=t===null||t===void 0?void 0:t.parseComment(p);h.steps=i.Step.parseAll(f,t);h.descriptionComment=t===null||t===void 0?void 0:t.parseCommentBetween(p,(s=f===null||f===void 0?void 0:f[0])===null||s===void 0?void 0:s.location);a("parse(this: {keyword: '%s', name: '%s', description: '%s', step: %d, precedingComment: '%s', descriptionComment: '%s'})",h.keyword,h.name,h.description,(r=h.steps)===null||r===void 0?void 0:r.length,(o=h.precedingComment)===null||o===void 0?void 0:o.text,(c=h.descriptionComment)===null||c===void 0?void 0:c.text);return h}clone(){var e,t,n;a("clone(this: {keyword: '%s', name: '%s', description: '%s', step: %d, precedingComment: '%s', descriptionComment: '%s'})",this.keyword,this.name,this.description,(e=this.steps)===null||e===void 0?void 0:e.length,(t=this.precedingComment)===null||t===void 0?void 0:t.text,(n=this.descriptionComment)===null||n===void 0?void 0:n.text);const r=new Background(this.keyword,this.name,this.description);r.steps=(0,s.cloneArray)(this.steps);r.precedingComment=this.precedingComment?this.precedingComment.clone():null;r.descriptionComment=this.descriptionComment?this.descriptionComment.clone():null;return r}}t.Background=Background},3385:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Comment=void 0;const s=n(5374);const r=n(6294);const i=n(7600);const o=(0,i.getDebugger)("Comment");class Comment extends r.UniqueObject{static parse(...e){o("parse(objs: %d)",e.length);if(!e.length||e.some((e=>!e.text))){throw new TypeError("The given object is not a Comment!")}const t=new Comment(e.map((e=>e.text)).join("\n"));o("parse(this: {text: '%s'})",t.text);return t}constructor(e){super();o("constructor(text: '%s')",e);this.text=(0,s.prefixString)((0,s.normalizeString)(e),"#")}clone(){o("clone()");return new Comment(this.text)}replace(e,t){o("replace(key: '%s', value: '%s')",e,t);this.text=(0,s.replaceAll)(this.text,e,t)}toString(){o("toString()");return this.text}}t.Comment=Comment},1524:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DataTable=void 0;const s=n(5374);const r=n(5198);const i=n(6294);const o=n(7600);const a=(0,o.getDebugger)("DataTable");class DataTable extends i.UniqueObject{static parse(e,t){var n,s;a("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!Array.isArray(e.rows)){throw new Error("The given object is not a DataTable!")}const i=new DataTable;i.rows=r.TableRow.parseAll(e.rows,t);a("parse(this: {rows: %d})",(s=i.rows)===null||s===void 0?void 0:s.length);return i}constructor(e=[]){super();this.rows=e;a("constructor(rows: %d)",e.length)}clone(){var e;a("clone(this: {rows: %d})",(e=this.rows)===null||e===void 0?void 0:e.length);return new DataTable((0,s.cloneArray)(this.rows))}replace(e,t){a("replace(key: '%s', value: '%s')",e,t);(0,s.replaceArray)(this.rows,e,t)}}t.DataTable=DataTable},559:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DocString=void 0;const s=n(5374);const r=n(6294);const i=n(7600);const o=(0,i.getDebugger)("DocString");class DocString extends r.UniqueObject{static parse(e,t){var n,s;o("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||e.content===undefined){throw new TypeError("The given object is not a DocString!")}const r=new DocString(e.content,e.delimiter,e.mediaType);r.comment=t===null||t===void 0?void 0:t.parseComment(e.location);o("parse(this: {content: '%s', delimiter: '%s', mediaType: '%s', comment: '%s'})",r.content,r.delimiter,r.mediaType,(s=r.comment)===null||s===void 0?void 0:s.text);return r}constructor(e,t='"""',n=null){super();o("constructor(content: '%s', delimiter: '%s', mediaType: '%s')",e,t,n);this.content=(0,s.normalizeString)(e);this.delimiter=t;this.mediaType=n}clone(){var e;o("clone(this: {content: '%s', delimiter: '%s', mediaType: '%s', comment: '%s'})",this.content,this.delimiter,this.mediaType,(e=this.comment)===null||e===void 0?void 0:e.text);const t=new DocString(this.content,this.delimiter,this.mediaType);t.comment=this.comment?this.comment.clone():null;return t}replace(e,t){o("replace(key: '%s', value: '%s')",e,t);this.content=(0,s.replaceAll)(this.content,e,t);this.comment&&this.comment.replace(e,t)}}t.DocString=DocString},8492:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Element=t.REPEAT_STEP_KEYWORDS=void 0;const s=n(5374);const r=n(6294);const i=n(7600);const o=(0,i.getDebugger)("Element");t.REPEAT_STEP_KEYWORDS=["And","But","*"];class Element extends r.UniqueObject{constructor(e,t,n){super();o("constructor(keyword: '%s', name: '%s', description: '%s')",e,t,n);this.keyword=(0,s.normalizeString)(e);this.name=(0,s.normalizeString)(t);this.description=(0,s.normalizeString)(n);this.steps=[];this.precedingComment=null;this.descriptionComment=null}clone(){o("clone()");throw new Error("Not implemented")}replace(e,t){o("replace(key: '%s', value: '%s')",e,t);this.name=(0,s.replaceAll)(this.name,e,t);this.description=(0,s.replaceAll)(this.description,e,t);(0,s.replaceArray)(this.steps,e,t);this.precedingComment&&this.precedingComment.replace(e,t);this.descriptionComment&&this.descriptionComment.replace(e,t)}useNormalStepKeywords(){o("useNormalStepKeywords()");this.steps.forEach(((e,n)=>{if(n&&t.REPEAT_STEP_KEYWORDS.indexOf(e.keyword)>-1){e.keyword=this.steps[n-1].keyword}}))}useReadableStepKeywords(){o("useReadableStepKeywords()");this.useNormalStepKeywords();for(let e=this.steps.length-1;e>0;--e){if(this.steps[e].keyword===this.steps[e-1].keyword){this.steps[e].keyword="And"}}}}t.Element=Element},4777:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Examples=void 0;const s=n(5374);const r=n(5198);const i=n(6984);const o=n(6294);const a=n(7600);const c=(0,a.getDebugger)("Examples");class Examples extends o.UniqueObject{static parse(e,t){var n,s,o,a,l,u,d,f;c("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!Array.isArray(e.tableBody)){throw new TypeError("The given obj is not an Examples!")}const{location:p,tags:h,tableHeader:m,tableBody:g,keyword:y,name:b}=e;const v=new Examples(y,b);v.precedingComment=t===null||t===void 0?void 0:t.parseComment(p,(s=h===null||h===void 0?void 0:h[h.length-1])===null||s===void 0?void 0:s.location);v.tagComment=t===null||t===void 0?void 0:t.parseTagComment(h);v.tags=i.Tag.parseAll(h,t);if(m){v.header=r.TableRow.parse(m,t)}v.body=r.TableRow.parseAll(g,t);c("parse(this: {keyword: '%s', name: '%s', tags: %d, header: %d, body: %d, precedingComment: '%s', tagComment: '%s'})",v.keyword,v.name,(o=v.tags)===null||o===void 0?void 0:o.length,(l=(a=v.header)===null||a===void 0?void 0:a.cells)===null||l===void 0?void 0:l.length,(u=v.body)===null||u===void 0?void 0:u.length,(d=v.precedingComment)===null||d===void 0?void 0:d.text,(f=v.tagComment)===null||f===void 0?void 0:f.text);return v}constructor(e,t){super();c("constructor(keyword: '%s', name: '%s')",e,t);this.keyword=(0,s.normalizeString)(e);this.name=(0,s.normalizeString)(t);this.header=null;this.precedingComment=null;this.tagComment=null;this.tags=[];this.body=[]}clone(){var e,t,n,r,i,o;c("clone(this: {keyword: '%s', name: '%s', tags: %d, header: %d, body: %d, precedingComment: '%s', tagComment: '%s'})",this.keyword,this.name,(e=this.tags)===null||e===void 0?void 0:e.length,(n=(t=this.header)===null||t===void 0?void 0:t.cells)===null||n===void 0?void 0:n.length,(r=this.body)===null||r===void 0?void 0:r.length,(i=this.precedingComment)===null||i===void 0?void 0:i.text,(o=this.tagComment)===null||o===void 0?void 0:o.text);const a=new Examples(this.keyword,this.name);a.header=this.header?this.header.clone():null;a.precedingComment=this.precedingComment?this.precedingComment.clone():null;a.tagComment=this.tagComment?this.tagComment.clone():null;a.tags=(0,s.cloneArray)(this.tags);a.body=(0,s.cloneArray)(this.body);return a}replace(e,t){c("replace(key: '%s', value: '%s')",e,t);this.name=(0,s.replaceAll)(this.name,e,t);this.header&&this.header.replace(e,t);this.precedingComment&&this.precedingComment.replace(e,t);this.tagComment&&this.tagComment.replace(e,t);(0,s.replaceArray)(this.tags,e,t);(0,s.replaceArray)(this.body,e,t)}}t.Examples=Examples},8950:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Feature=void 0;const s=n(5374);const r=n(9866);const i=n(3070);const o=n(8264);const a=n(6092);const c=n(3240);const l=n(6984);const u=n(6294);const d=n(7600);const f=(0,d.getDebugger)("Feature");class Feature extends u.UniqueObject{static parse(e,t){var n,s,u,d,p,h,m;f("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!Array.isArray(e.children)){throw new TypeError("The given object is not a Feature!")}const{keyword:g,language:y,description:b,children:v,name:w,tags:T,location:S}=e;const k=new Feature(g,w,b,y);k.precedingComment=t===null||t===void 0?void 0:t.parseComment(S,(s=T===null||T===void 0?void 0:T[T.length-1])===null||s===void 0?void 0:s.location);k.tagComment=t===null||t===void 0?void 0:t.parseTagComment(T);k.tags=l.Tag.parseAll(T,t);let D=null;k.elements=v.map((e=>{var n,s,l,u;if((0,r.isGherkinRule)(e)){if(!D){D=e.rule.location}return o.Rule.parse(e,t)}if((0,r.isGherkinBackground)(e)){if(!D){D=(n=e.background)===null||n===void 0?void 0:n.location}return i.Background.parse(e,t)}if((0,r.isGherkinScenario)(e)){if(!D){D=(s=e.scenario)===null||s===void 0?void 0:s.location}if((u=(l=e.scenario)===null||l===void 0?void 0:l.examples)===null||u===void 0?void 0:u.length){return c.ScenarioOutline.parse(e,t)}return a.Scenario.parse(e,t)}}));k.descriptionComment=t===null||t===void 0?void 0:t.parseCommentBetween(S,D);f("parse(this: {keyword: '%s', name: '%s', description: '%s', language: '%s', "+"precedingComment: '%s', tagComment: '%s', desctiptionComment: '%s', "+"tags: %d, elements: %d})",k.keyword,k.name,k.description,k.language,(u=k.precedingComment)===null||u===void 0?void 0:u.text,(d=k.tagComment)===null||d===void 0?void 0:d.text,(p=k.descriptionComment)===null||p===void 0?void 0:p.text,(h=k.tags)===null||h===void 0?void 0:h.length,(m=k.elements)===null||m===void 0?void 0:m.length);return k}constructor(e,t,n,r="en"){var i,o,a,c,l;super();f("constructor(keyword: '%s', name: '%s', description: '%s', language: '%s')",e,t,n,r);this.language=r;this.keyword=(0,s.normalizeString)(e);this.name=(0,s.normalizeString)(t);this.description=(0,s.normalizeString)(n);this.elements=[];this.tags=[];this.precedingComment=null;this.tagComment=null;this.descriptionComment=null;f("constructor(this: {keyword: '%s', name: '%s', description: '%s', language: '%s', "+"precedingComment: '%s', tagComment: '%s', desctiptionComment: '%s', "+"tags: %d, elements: %d})",this.keyword,this.name,this.description,this.language,(i=this.precedingComment)===null||i===void 0?void 0:i.text,(o=this.tagComment)===null||o===void 0?void 0:o.text,(a=this.descriptionComment)===null||a===void 0?void 0:a.text,(c=this.tags)===null||c===void 0?void 0:c.length,(l=this.elements)===null||l===void 0?void 0:l.length)}clone(){var e,t,n,r,i;f("clone(this: {keyword: '%s', name: '%s', description: '%s', language: '%s', "+"precedingComment: '%s', tagComment: '%s', desctiptionComment: '%s', "+"tags: %d, elements: %d})",this.keyword,this.name,this.description,this.language,(e=this.precedingComment)===null||e===void 0?void 0:e.text,(t=this.tagComment)===null||t===void 0?void 0:t.text,(n=this.descriptionComment)===null||n===void 0?void 0:n.text,(r=this.tags)===null||r===void 0?void 0:r.length,(i=this.elements)===null||i===void 0?void 0:i.length);const o=new Feature(this.keyword,this.name,this.description,this.language);o.tags=(0,s.cloneArray)(this.tags);o.elements=(0,s.cloneArray)(this.elements);o.precedingComment=this.precedingComment?this.precedingComment.clone():null;o.tagComment=this.tagComment?this.tagComment.clone():null;o.descriptionComment=this.descriptionComment?this.descriptionComment.clone():null;return o}replace(e,t){f("replace(key: '%s', value: '%s')",e,t);this.name=(0,s.replaceAll)(this.name,e,t);this.description=(0,s.replaceAll)(this.description,e,t);(0,s.replaceArray)(this.tags,e,t);(0,s.replaceArray)(this.elements,e,t);this.precedingComment&&this.precedingComment.replace(e,t);this.tagComment&&this.tagComment.replace(e,t);this.descriptionComment&&this.descriptionComment.replace(e,t)}}t.Feature=Feature},8947:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Document=void 0;const s=n(5374);const r=n(8950);const i=n(6294);const o=n(6928);const a=n(7600);const c=(0,a.getDebugger)("Document");class Document extends i.UniqueObject{static parse(e){var t,n,i,o;c("parse(obj: %o)",e);if(!e||!e.gherkinDocument){throw new TypeError("The given object is not a GherkinDocument!")}const a=new s.GherkinCommentHandler((t=e.gherkinDocument)===null||t===void 0?void 0:t.comments);const l=new Document(e.gherkinDocument.uri);l.feature=r.Feature.parse(e.gherkinDocument.feature,a);l.startComment=a.parseStartingComment();l.endComment=a.parseEndingComment();c("parse(this: {uri: '%s', feature: '%s', startComment: '%s', endComment: '%s'})",l.uri,(n=l.feature)===null||n===void 0?void 0:n.name,(i=l.startComment)===null||i===void 0?void 0:i.text,(o=l.endComment)===null||o===void 0?void 0:o.text);return l}constructor(e,t=null){var n,s,r;super();this.feature=t;this.startComment=null;this.endComment=null;this.uri=e;this.sourceFile=(0,o.basename)(e);this.sourceFolder=(0,o.dirname)(e);this.targetFile=this.sourceFile;this.targetFolder=this.sourceFolder;c("constructor(this: {uri: '%s', sourceFile: '%s', sourceFolder: '%s', "+"targetFile: '%s', targetFolder: '%s', "+"feature: '%s', startComment: '%s', endComment: '%s'})",this.uri,this.sourceFile,this.sourceFolder,this.targetFile,this.targetFolder,(n=this.feature)===null||n===void 0?void 0:n.name,(s=this.startComment)===null||s===void 0?void 0:s.text,(r=this.endComment)===null||r===void 0?void 0:r.text)}clone(){var e,t,n;c("clone(this: {uri: '%s', sourceFile: '%s', sourceFolder: '%s', "+"targetFile: '%s', targetFolder: '%s', "+"feature: '%s', startComment: '%s', endComment: '%s'})",this.uri,this.sourceFile,this.sourceFolder,this.targetFile,this.targetFolder,(e=this.feature)===null||e===void 0?void 0:e.name,(t=this.startComment)===null||t===void 0?void 0:t.text,(n=this.endComment)===null||n===void 0?void 0:n.text);const s=new Document(this.uri);s.feature=this.feature?this.feature.clone():null;s.startComment=this.startComment?this.startComment.clone():null;s.endComment=this.endComment?this.endComment.clone():null;return s}replace(e,t){c("replace(key: '%s', value: '%s')",e,t);this.feature&&this.feature.replace(e,t);this.startComment&&this.startComment.replace(e,t);this.endComment&&this.endComment.replace(e,t)}}t.Document=Document},8264:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Rule=void 0;const s=n(5374);const r=n(9866);const i=n(3070);const o=n(6092);const a=n(3240);const c=n(6984);const l=n(6294);const u=n(7600);const d=(0,u.getDebugger)("Rule");class Rule extends l.UniqueObject{static parse(e,t){var n,s,l,u,f,p,h;d("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!e.rule||!Array.isArray(e.rule.children)){throw new TypeError("The given object is not a Rule!")}const{keyword:m,description:g,children:y,name:b,tags:v,location:w}=e.rule;const T=new Rule(m,b,g);T.precedingComment=t===null||t===void 0?void 0:t.parseComment(w,(s=v===null||v===void 0?void 0:v[v.length-1])===null||s===void 0?void 0:s.location);T.tagComment=t===null||t===void 0?void 0:t.parseTagComment(v);T.tags=c.Tag.parseAll(v,t);let S=null;T.elements=y.map((e=>{var n,s,c,l;if((0,r.isGherkinBackground)(e)){if(!S){S=(n=e.background)===null||n===void 0?void 0:n.location}return i.Background.parse(e,t)}if((0,r.isGherkinScenario)(e)){if(!S){S=(s=e.scenario)===null||s===void 0?void 0:s.location}if((l=(c=e.scenario)===null||c===void 0?void 0:c.examples)===null||l===void 0?void 0:l.length){return a.ScenarioOutline.parse(e,t)}return o.Scenario.parse(e,t)}}));T.descriptionComment=t===null||t===void 0?void 0:t.parseCommentBetween(w,S);d("parse(this: {keyword: '%s', name: '%s', description: '%s', "+"precedingComment: '%s', tagComment: '%s', desctiptionComment: '%s', "+"tags: %d, elements: %d})",T.keyword,T.name,T.description,(l=T.precedingComment)===null||l===void 0?void 0:l.text,(u=T.tagComment)===null||u===void 0?void 0:u.text,(f=T.descriptionComment)===null||f===void 0?void 0:f.text,(p=T.tags)===null||p===void 0?void 0:p.length,(h=T.elements)===null||h===void 0?void 0:h.length);return T}constructor(e,t,n){var r,i,o,a,c;super();d("constructor(keyword: '%s', name: '%s', description: '%s')",e,t,n);this.keyword=(0,s.normalizeString)(e);this.name=(0,s.normalizeString)(t);this.description=(0,s.normalizeString)(n);this.elements=[];this.tags=[];this.precedingComment=null;this.tagComment=null;this.descriptionComment=null;d("constructor(this: {keyword: '%s', name: '%s', description: '%s', "+"precedingComment: '%s', tagComment: '%s', desctiptionComment: '%s', "+"tags: %d, elements: %d})",this.keyword,this.name,this.description,(r=this.precedingComment)===null||r===void 0?void 0:r.text,(i=this.tagComment)===null||i===void 0?void 0:i.text,(o=this.descriptionComment)===null||o===void 0?void 0:o.text,(a=this.tags)===null||a===void 0?void 0:a.length,(c=this.elements)===null||c===void 0?void 0:c.length)}clone(){var e,t,n,r,i;d("clone(this: {keyword: '%s', name: '%s', description: '%s', "+"precedingComment: '%s', tagComment: '%s', desctiptionComment: '%s', "+"tags: %d, elements: %d})",this.keyword,this.name,this.description,(e=this.precedingComment)===null||e===void 0?void 0:e.text,(t=this.tagComment)===null||t===void 0?void 0:t.text,(n=this.descriptionComment)===null||n===void 0?void 0:n.text,(r=this.tags)===null||r===void 0?void 0:r.length,(i=this.elements)===null||i===void 0?void 0:i.length);const o=new Rule(this.keyword,this.name,this.description);o.precedingComment=this.precedingComment?this.precedingComment.clone():null;o.tagComment=this.tagComment?this.tagComment.clone():null;o.descriptionComment=this.descriptionComment?this.descriptionComment.clone():null;o.tags=(0,s.cloneArray)(this.tags);o.elements=(0,s.cloneArray)(this.elements);return o}replace(e,t){d("replace(key: '%s', value: '%s')",e,t);this.name=(0,s.replaceAll)(this.name,e,t);this.description=(0,s.replaceAll)(this.description,e,t);(0,s.replaceArray)(this.tags,e,t);(0,s.replaceArray)(this.elements,e,t);this.precedingComment&&this.precedingComment.replace(e,t);this.tagComment&&this.tagComment.replace(e,t);this.descriptionComment&&this.descriptionComment.replace(e,t)}}t.Rule=Rule},6092:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Scenario=void 0;const s=n(5374);const r=n(8492);const i=n(8964);const o=n(6984);const a=n(7600);const c=(0,a.getDebugger)("Scenario");class Scenario extends r.Element{static parse(e,t){var n,s,r,a,l,u,d,f,p,h;c("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!e.scenario||((r=(s=e.scenario)===null||s===void 0?void 0:s.examples)===null||r===void 0?void 0:r.length)){throw new TypeError("The given object is not a Scenario!")}const{description:m,keyword:g,name:y,steps:b,tags:v,location:w}=e.scenario;const T=new Scenario(g,y,m);T.precedingComment=t===null||t===void 0?void 0:t.parseComment(w,(a=v===null||v===void 0?void 0:v[v.length-1])===null||a===void 0?void 0:a.location);T.tagComment=t===null||t===void 0?void 0:t.parseTagComment(v);T.steps=i.Step.parseAll(b,t);T.tags=o.Tag.parseAll(v,t);T.descriptionComment=t===null||t===void 0?void 0:t.parseCommentBetween(w,(l=b===null||b===void 0?void 0:b[0])===null||l===void 0?void 0:l.location);c("parse(this: {keyword: '%s', name: '%s', description: '%s', "+"steps: %d, tags: %d, precedingComment: '%s', tagComment: '%s', "+"descriptionComment: '%s'})",T.keyword,T.name,T.description,(u=T.steps)===null||u===void 0?void 0:u.length,(d=T.tags)===null||d===void 0?void 0:d.length,(f=T.precedingComment)===null||f===void 0?void 0:f.text,(p=T.tagComment)===null||p===void 0?void 0:p.text,(h=T.descriptionComment)===null||h===void 0?void 0:h.text);return T}constructor(e,t,n){var s,r,i,o,a;super(e,t,n);c("constructor(keyword: '%s', name: '%s', description: '%s')",e,t,n);this.tags=[];this.precedingComment=null;this.tagComment=null;c("constructor(this: {keyword: '%s', name: '%s', description: '%s', "+"steps: %d, tags: %d, precedingComment: '%s', tagComment: '%s', "+"descriptionComment: '%s'})",this.keyword,this.name,this.description,(s=this.steps)===null||s===void 0?void 0:s.length,(r=this.tags)===null||r===void 0?void 0:r.length,(i=this.precedingComment)===null||i===void 0?void 0:i.text,(o=this.tagComment)===null||o===void 0?void 0:o.text,(a=this.descriptionComment)===null||a===void 0?void 0:a.text)}replace(e,t){c("replace(key: '%s', value: '%s')",e,t);super.replace(e,t);(0,s.replaceArray)(this.tags,e,t);this.tagComment&&this.tagComment.replace(e,t)}clone(){var e,t,n,r,i;c("clone(this: {keyword: '%s', name: '%s', description: '%s', "+"steps: %d, tags: %d, precedingComment: '%s', tagComment: '%s', "+"descriptionComment: '%s'})",this.keyword,this.name,this.description,(e=this.steps)===null||e===void 0?void 0:e.length,(t=this.tags)===null||t===void 0?void 0:t.length,(n=this.precedingComment)===null||n===void 0?void 0:n.text,(r=this.tagComment)===null||r===void 0?void 0:r.text,(i=this.descriptionComment)===null||i===void 0?void 0:i.text);const o=new Scenario(this.keyword,this.name,this.description);o.steps=(0,s.cloneArray)(this.steps);o.tags=(0,s.cloneArray)(this.tags);o.precedingComment=this.precedingComment?this.precedingComment.clone():null;o.tagComment=this.tagComment?this.tagComment.clone():null;o.descriptionComment=this.descriptionComment?this.descriptionComment.clone():null;return o}}t.Scenario=Scenario},3240:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ScenarioOutline=void 0;const s=n(5374);const r=n(8492);const i=n(4777);const o=n(6092);const a=n(8964);const c=n(6984);const l=n(7600);const u=(0,l.getDebugger)("ScenarioOutline");class ScenarioOutline extends r.Element{static parse(e,t){var n,s,r,o,l,d,f,p,h;u("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!e.scenario||!Array.isArray(e.scenario.examples)){throw new TypeError("The given object is not a Scenario Outline!")}const{description:m,examples:g,keyword:y,name:b,steps:v,tags:w,location:T}=e.scenario;const S=new ScenarioOutline(y,b,m);S.precedingComment=t===null||t===void 0?void 0:t.parseComment(T,(s=w===null||w===void 0?void 0:w[w.length-1])===null||s===void 0?void 0:s.location);S.tagComment=t===null||t===void 0?void 0:t.parseTagComment(w);S.steps=a.Step.parseAll(v,t);S.tags=c.Tag.parseAll(w,t);S.descriptionComment=t===null||t===void 0?void 0:t.parseCommentBetween(T,(r=v===null||v===void 0?void 0:v[0])===null||r===void 0?void 0:r.location);S.examples=g.map((e=>i.Examples.parse(e,t)));u("parse(this: {keyword: '%s', name: '%s', description: '%s', "+"steps: %d, tags: %d, examples: %d, precedingComment: '%s', tagComment: '%s', "+"descriptionComment: '%s'})",S.keyword,S.name,S.description,(o=S.steps)===null||o===void 0?void 0:o.length,(l=S.tags)===null||l===void 0?void 0:l.length,(d=S.examples)===null||d===void 0?void 0:d.length,(f=S.precedingComment)===null||f===void 0?void 0:f.text,(p=S.tagComment)===null||p===void 0?void 0:p.text,(h=S.descriptionComment)===null||h===void 0?void 0:h.text);return S}constructor(e,t,n){var s,r,i,o,a,c;super(e,t,n);u("constructor(keyword: '%s', name: '%s', description: '%s')",e,t,n);this.tags=[];this.examples=[];this.tagComment=null;u("constructor(this: {keyword: '%s', name: '%s', description: '%s', "+"steps: %d, tags: %d, examples: %d, precedingComment: '%s', tagComment: '%s', "+"descriptionComment: '%s'})",this.keyword,this.name,this.description,(s=this.steps)===null||s===void 0?void 0:s.length,(r=this.tags)===null||r===void 0?void 0:r.length,(i=this.examples)===null||i===void 0?void 0:i.length,(o=this.precedingComment)===null||o===void 0?void 0:o.text,(a=this.tagComment)===null||a===void 0?void 0:a.text,(c=this.descriptionComment)===null||c===void 0?void 0:c.text)}replace(e,t){u("replace(key: '%s', value: '%s')",e,t);super.replace(e,t);(0,s.replaceArray)(this.tags,e,t);(0,s.replaceArray)(this.examples,e,t);this.tagComment&&this.tagComment.replace(e,t)}clone(){var e,t,n,r,i,o;u("clone(this: {keyword: '%s', name: '%s', description: '%s', "+"steps: %d, tags: %d, examples: %d, precedingComment: '%s', tagComment: '%s', "+"descriptionComment: '%s'})",this.keyword,this.name,this.description,(e=this.steps)===null||e===void 0?void 0:e.length,(t=this.tags)===null||t===void 0?void 0:t.length,(n=this.examples)===null||n===void 0?void 0:n.length,(r=this.precedingComment)===null||r===void 0?void 0:r.text,(i=this.tagComment)===null||i===void 0?void 0:i.text,(o=this.descriptionComment)===null||o===void 0?void 0:o.text);const a=new ScenarioOutline(this.keyword,this.name,this.description);a.precedingComment=this.precedingComment?this.precedingComment.clone():null;a.tagComment=this.tagComment?this.tagComment.clone():null;a.descriptionComment=this.descriptionComment?this.descriptionComment.clone():null;a.tags=(0,s.cloneArray)(this.tags);a.steps=(0,s.cloneArray)(this.steps);a.examples=(0,s.cloneArray)(this.examples);return a}toScenario(e=0){u("toScenario(columnToAddAsTag: %d)",e);const t=[];this.examples.forEach((n=>{const r=Math.max(0,Math.min(n.header.cells.length-1,e));n.body.forEach((e=>{const i=new o.Scenario("Scenario",this.name,this.description);i.tags=(0,c.removeDuplicateTags)([...(0,s.cloneArray)(this.tags),...(0,s.cloneArray)(n.tags),(0,c.tag)(n.header.cells[r].value,e.cells[r].value)]);i.precedingComment=this.precedingComment?this.precedingComment.clone():null;i.tagComment=this.tagComment?this.tagComment.clone():null;i.descriptionComment=this.descriptionComment?this.descriptionComment.clone():null;i.steps=(0,s.cloneArray)(this.steps);n.header.cells.forEach(((t,n)=>{i.replace(`<${t.value}>`,e.cells[n].value)}));t.push(i)}))}));u("toScenario(scenarios: %d)",t.length);return t}}t.ScenarioOutline=ScenarioOutline},8964:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Step=void 0;const s=n(5374);const r=n(1524);const i=n(559);const o=n(6294);const a=n(7600);const c=(0,a.getDebugger)("Step");class Step extends o.UniqueObject{static parse(e,t,n){var s,o,a,l,u,d;c("parse(obj: %o, comments: %d, prevStepLocation: %d)",e,(s=t===null||t===void 0?void 0:t.comments)===null||s===void 0?void 0:s.length,n===null||n===void 0?void 0:n.line);if(!e||!e.text){throw new Error("The given object is not a Step!")}const{keyword:f,text:p,dataTable:h,docString:m,location:g}=e;const y=new Step(f,p);if(h){y.dataTable=r.DataTable.parse(h,t)}if(m){y.docString=i.DocString.parse(m,t)}if(n){y.comment=t===null||t===void 0?void 0:t.parseCommentBetween(n,g)}else{y.comment=t===null||t===void 0?void 0:t.parseComment(g)}c("parse(this: {keyword: '%s', text: '%s', dataTable: %d, docString: %d, comment: '%s'})",y.keyword,y.text,(a=(o=y.dataTable)===null||o===void 0?void 0:o.rows)===null||a===void 0?void 0:a.length,(u=(l=y.docString)===null||l===void 0?void 0:l.content)===null||u===void 0?void 0:u.length,(d=y.comment)===null||d===void 0?void 0:d.text);return y}static parseAll(e,t){var n;c("parseAll(obj: %d, comments: %d)",e===null||e===void 0?void 0:e.length,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!Array.isArray(e)){return[]}let s=null;return e.map((e=>{const n=this.parse(e,t,s);s=e.location;return n}))}constructor(e,t){var n,r,i,o,a;super();c("constructor(keyword: '%s', text: '%s')",e,t);this.keyword=(0,s.normalizeString)(e);this.text=(0,s.normalizeString)(t);this.dataTable=null;this.docString=null;this.comment=null;c("constructor(this: {keyword: '%s', text: '%s', dataTable: %d, docString: %d, comment: '%s'})",this.keyword,this.text,(r=(n=this.dataTable)===null||n===void 0?void 0:n.rows)===null||r===void 0?void 0:r.length,(o=(i=this.docString)===null||i===void 0?void 0:i.content)===null||o===void 0?void 0:o.length,(a=this.comment)===null||a===void 0?void 0:a.text)}clone(){var e,t,n,s,r;c("clone(this: {keyword: '%s', text: '%s', dataTable: %d, docString: %d, comment: '%s'})",this.keyword,this.text,(t=(e=this.dataTable)===null||e===void 0?void 0:e.rows)===null||t===void 0?void 0:t.length,(s=(n=this.docString)===null||n===void 0?void 0:n.content)===null||s===void 0?void 0:s.length,(r=this.comment)===null||r===void 0?void 0:r.text);const i=new Step(this.keyword,this.text);i.dataTable=this.dataTable?this.dataTable.clone():null;i.docString=this.docString?this.docString.clone():null;i.comment=this.comment?this.comment.clone():null;return i}replace(e,t){c("replace(key: '%s', value: '%s')",e,t);this.text=(0,s.replaceAll)(this.text,e,t);this.dataTable&&this.dataTable.replace(e,t);this.docString&&this.docString.replace(e,t);this.comment&&this.comment.replace(e,t)}}t.Step=Step},3448:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TableCell=void 0;const s=n(5374);const r=n(6294);const i=n(7600);const o=(0,i.getDebugger)("TableCell");class TableCell extends r.UniqueObject{static parse(e){o("parse(obj: %o)",e);if(!e||!("value"in e)){throw new TypeError("The given object is not a TableCell!")}const t=new TableCell(e.value);o("parse(this: {value: '%s'})",t.value);return t}constructor(e){super();this.value=e;o("constructor(value: '%s')",e)}clone(){o("clone(this: {value: '%s'})",this.value);return new TableCell(this.value)}replace(e,t){o("replace(key: '%s', value: '%s')",e,t);this.value=(0,s.replaceAll)(this.value,e,t)}}t.TableCell=TableCell},5198:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TableRow=void 0;const s=n(5374);const r=n(3448);const i=n(6294);const o=n(7600);const a=(0,o.getDebugger)("TableRow");class TableRow extends i.UniqueObject{static parse(e,t){var n,s,i;a("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!Array.isArray(e.cells)){throw new TypeError("The given object is not a TableRow!")}const{cells:o,location:c}=e;const l=new TableRow;l.cells=o===null||o===void 0?void 0:o.map(r.TableCell.parse);l.comment=t===null||t===void 0?void 0:t.parseComment(c);a("parse(this: {cells: %d, comment: '%s'})",(s=l.cells)===null||s===void 0?void 0:s.length,(i=l.comment)===null||i===void 0?void 0:i.text);return l}static parseAll(e,t){var n;a("parse(obj: %d, comments: %d)",e===null||e===void 0?void 0:e.length,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!Array.isArray(e)||!e.length){return[]}return e.map((e=>this.parse(e,t)))}constructor(e=[]){var t,n;super();this.cells=e;a("constructor(cells: %d)",e===null||e===void 0?void 0:e.length);this.comment=null;a("constructor(this: {cells: %d, comment: '%s'})",(t=this.cells)===null||t===void 0?void 0:t.length,(n=this.comment)===null||n===void 0?void 0:n.text)}clone(){var e,t;a("clone(this: {cells: %d, comment: '%s'})",(e=this.cells)===null||e===void 0?void 0:e.length,(t=this.comment)===null||t===void 0?void 0:t.text);const n=new TableRow((0,s.cloneArray)(this.cells));n.comment=this.comment?this.comment.clone():null;return n}replace(e,t){a("replace(key: '%s', value: '%s')",e,t);(0,s.replaceArray)(this.cells,e,t);this.comment&&this.comment.replace(e,t)}}t.TableRow=TableRow},6984:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.removeDuplicateTags=t.tag=t.Tag=void 0;const s=n(1860);const r=n(5133);const i=n(5374);const o=n(6294);const a=n(7600);const c=s.__importStar(n(2858));const l=(0,a.getDebugger)("Tag");const u=new Map;u.set(c.TagFormat.PARAMETERLESS,{parse(e){return new Tag(e.match(/^@?(?<name>[^@]+)$/i)[1])},toString(e){return`@${e.name}`}});u.set(c.TagFormat.FUNCTIONAL,{parse(e){const t=e.match(/^@?(?<name>[^(@]+)\((?<value>[^)]+)\)$/i);if(t){return new Tag(t[1],t[2])}return u.get(c.TagFormat.PARAMETERLESS).parse(e)},toString(e){if(e.value===undefined){return u.get(c.TagFormat.PARAMETERLESS).toString(e)}return`@${e.name}(${e.value})`}});u.set(c.TagFormat.ASSIGNMENT,{parse(e){const t=e.match(/^@?(?<name>[^=@]+)=(?<value>.+)$/i);if(t){return new Tag(t[1],t[2])}return u.get(c.TagFormat.PARAMETERLESS).parse(e)},toString(e){if(e.value===undefined){return u.get(c.TagFormat.PARAMETERLESS).toString(e)}return`@${e.name}=${e.value}`}});u.set(c.TagFormat.UNDERSCORE,{parse(e){const t=e.match(/^@?(?<name>[^_@]+)_(?<value>.+)$/i);if(t){return new Tag(t[1],t[2])}return u.get(c.TagFormat.PARAMETERLESS).parse(e)},toString(e){if(e.value===undefined){return u.get(c.TagFormat.PARAMETERLESS).toString(e)}return`@${e.name}_${e.value}`}});class Tag extends o.UniqueObject{static parse(e,t){var n,s;l("parse(obj: %o, comments: %d)",e,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!e||!e.name){throw new TypeError("The given object is not a Tag!")}const r=Tag.parseString(e.name);r.comment=t===null||t===void 0?void 0:t.parseComment(e.location);l("parse(this: {name: '%s', value: '%s', comment: '%s')",r.name,r.value,(s=r.comment)===null||s===void 0?void 0:s.text);return r}static parseAll(e,t){var n;l("parseAll(obj: %d, comments: %d)",e===null||e===void 0?void 0:e.length,(n=t===null||t===void 0?void 0:t.comments)===null||n===void 0?void 0:n.length);if(!Array.isArray(e)||!e.length){return[]}return e.map((e=>this.parse(e,t)))}static parseString(e){var t;l("parseString(s: '%s')",e);if(!e||typeof e!=="string"){throw new TypeError("The given string is not a Gherkin Tag!")}const{tagFormat:n}=c.default.get();if(!u.has(n)){throw new TypeError("The given tag format is not valid!")}const s=u.get(n).parse(e);l("parseString(this: {name: '%s', value: '%s', comment: '%s')",s.name,s.value,(t=s.comment)===null||t===void 0?void 0:t.text);return s}constructor(e,t){var n;super();l("constructor(name: '%s', value: '%s')",e,t);this.name=(0,i.safeString)(e);this.value=t;this.comment=null;l("constructor(this: {name: '%s', value: '%s', comment: '%s')",this.name,this.value,(n=this.comment)===null||n===void 0?void 0:n.text)}clone(){var e;l("clone(this: {name: '%s', value: '%s', comment: '%s')",this.name,this.value,(e=this.comment)===null||e===void 0?void 0:e.text);const t=new Tag(this.name,this.value);t.comment=this.comment?this.comment.clone():null;return t}replace(e,t){l("replace(key: '%s', value: '%s')",e,t);this.name=(0,i.replaceAll)(this.name,e,t);this.value=(0,i.replaceAll)(this.value,e,t);this.comment&&this.comment.replace(e,t)}toString(){l("toString(this: {name: '%s', value: '%s')",this.name,this.value);const{tagFormat:e}=c.default.get();if(!u.has(e)){throw new TypeError("The given tag format is not valid!")}return u.get(e).toString(this)}}t.Tag=Tag;const tag=(e,t)=>{l("static tag(name: '%s', value: '%s')",e,t);return new Tag(e,t)};t.tag=tag;const removeDuplicateTags=e=>{l("static removeDuplicateTags(tags: %d)",e===null||e===void 0?void 0:e.length);const t=e.map((({name:e,value:t})=>({name:e,value:t})));return Array.from(new r(t)).map((({name:e,value:t})=>new Tag(e,t)))};t.removeDuplicateTags=removeDuplicateTags},6294:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.UniqueObject=void 0;const s=n(1914);class UniqueObject{constructor(){this._id=(0,s.v4)()}}t.UniqueObject=UniqueObject},5374:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GherkinCommentHandler=t.replaceArray=t.cloneArray=t.replaceAll=t.prefixString=t.normalizeString=t.safeString=void 0;const s=n(3385);const r=n(7600);const i=(0,r.getDebugger)("common");const safeString=(e="")=>{const t=e.replace(/\s/g,"_");i("safeString(s: '%s') => '%s'",e,t);return t};t.safeString=safeString;const normalizeString=(e="")=>{const t=e.split("\n").map((e=>e.trim())).join("\n");i("normalizeString(s: '%s') => '%s'",e,t);return t};t.normalizeString=normalizeString;const prefixString=(e="",t="",n=" ")=>{const s=e.split("\n").map((e=>!e||e.startsWith(t)?e:`${t}${n}${e}`)).join("\n");i("prefixString(s: '%s', prefix: '%s', delimiter: '%s') => '%s'",e,t,n,s);return s};t.prefixString=prefixString;const replaceAll=(e,t,n)=>{if(!(t instanceof RegExp)){t=new RegExp(t,"g")}if(!e||typeof e!=="string"){i("replaceAll(s: '%s', key: '%s', value: '%s') => '%s'",e,t,n,e);return e}const s=e.replace(t,n.replace(/\$/g,"$$$$"));i("replaceAll(s: '%s', key: '%s', value: '%s') => '%s'",e,t,n,s);return s};t.replaceAll=replaceAll;const cloneArray=e=>{i("cloneArray(array: %d)",e===null||e===void 0?void 0:e.length);return Array.isArray(e)?e.map((e=>e.clone())):[]};t.cloneArray=cloneArray;const replaceArray=(e,t,n)=>{i("replaceArray(array: %d, key: '%s', value: '%s')",e===null||e===void 0?void 0:e.length,t,n);Array.isArray(e)&&e.forEach((e=>{e.replace(t,n)}))};t.replaceArray=replaceArray;class GherkinCommentHandler{constructor(e){this.comments=e;this.debug=(0,r.getDebugger)("GherkinCommentHandler");this.debug("constructor(comments: %d)",e===null||e===void 0?void 0:e.length);this.comments=e?[...e]:[];this.firstLine=Infinity;this.lastLine=0;if(this.comments.length){this.comments.sort(((e,t)=>e.location.line-t.location.line))}this.debug("constructor(this: {comments: %d, firstLine: %d, lastLine: %d})",this.comments.length,this.firstLine,this.lastLine)}storeLine(e){this.firstLine=Math.min(this.firstLine,e);this.lastLine=Math.max(this.lastLine,e);this.debug("storeLine(line: %d) => {firstLine: %d, lastLine: %d}",e,this.firstLine,this.lastLine)}findCommentIndexBefore(e){for(let t=0;t<this.comments.length;++t){if(this.comments[t].location.line==e.line-1){this.debug("findCommentIndexBefore(location: %d) => %d",e===null||e===void 0?void 0:e.line,t);return t}}this.debug("findCommentIndexBefore(location: %d) => NOT FOUND",e===null||e===void 0?void 0:e.line);return-1}popFromIndex(e){this.debug("popFromIndex(i: %d)",e);return this.comments.splice(e,1)[0]}popCommentsRightBefore(e){this.storeLine(e.line);let t=this.findCommentIndexBefore(e);const n=[];if(t>-1){n.push(this.popFromIndex(t));for(--t;t>=0;--t){if(this.comments[t].location.line<n[0].location.line-1){break}n.unshift(this.popFromIndex(t))}}this.debug("popCommentsRightBefore(location: %d) => %d",e===null||e===void 0?void 0:e.line,n.length);return n}parseComment(e,t){if(t){return this.parseCommentBetween(t,e)}const n=this.popCommentsRightBefore(e);if(n.length){this.debug("parseComment(location: %d) => %d",e===null||e===void 0?void 0:e.line,n.length);return s.Comment.parse(...n)}this.debug("parseComment(location: %d) => NOT FOUND",e===null||e===void 0?void 0:e.line);return null}parseTagComment(e){if(!Array.isArray(e)||!e.length){this.debug("parseTagComment(tags: %d) => NOT TAGS",e===null||e===void 0?void 0:e.length);return null}this.debug("parseTagComment(tags: %d) => %d",e.length,e[0].location.line);return this.parseComment(e[0].location)}parseCommentBetween(e,t){if(!e||!t){this.debug("parseCommentBetween(locA: %d, locB: %d) => NO LOCS",e===null||e===void 0?void 0:e.line,t===null||t===void 0?void 0:t.line);return null}this.storeLine(e.line);this.storeLine(t.line);let n=0;const s=[];for(;n<this.comments.length&&this.comments[n].location.line<e.line;++n);for(;n<this.comments.length&&this.comments[n].location.line<t.line;){s.push(this.popFromIndex(n))}this.debug("parseCommentBetween(locA: %d, locB: %d) => %d",e===null||e===void 0?void 0:e.line,t===null||t===void 0?void 0:t.line,s.length);return this.parseMultiLineComment(s)}parseStartingComment(){const e=[];for(let t=0;t<this.comments.length&&this.comments[t].location.line<this.firstLine;){e.push(this.popFromIndex(t))}this.debug("parseStartingComment() => %d",e.length);return this.parseMultiLineComment(e)}parseEndingComment(){const e=[];let t=0;for(;t<this.comments.length&&this.comments[t].location.line<this.lastLine;++t);for(;t<this.comments.length;){e.push(this.popFromIndex(t))}this.debug("parseEndingComment() => %d",e.length);return this.parseMultiLineComment(e)}parseMultiLineComment(e){if(!e.length){this.debug("parseMultiLineComment(comments: %d) => NO COMMENTS",e.length);return null}const t=[];const n=e[0].location.line;for(const s of e){t[s.location.line-n]=s.text}const r=new s.Comment(t.join("\n"));this.debug("parseMultiLineComment(comments: %d) => '%s'",e.length,r.text);return r}}t.GherkinCommentHandler=GherkinCommentHandler},7600:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDebugger=void 0;const s=n(2830);const getDebugger=e=>s(`gherkin-ast:${e}`);t.getDebugger=getDebugger},9866:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isGherkinScenario=t.isGherkinBackground=t.isGherkinRule=void 0;function isGherkinRule(e){return!!e.rule}t.isGherkinRule=isGherkinRule;function isGherkinBackground(e){return!!e.background}t.isGherkinBackground=isGherkinBackground;function isGherkinScenario(e){return!!e.scenario}t.isGherkinScenario=isGherkinScenario},4367:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.config=t.TagFormat=void 0;const s=n(1860);const r=s.__importDefault(n(2858));t.config=r.default;s.__exportStar(n(9866),t);s.__exportStar(n(3070),t);s.__exportStar(n(3385),t);s.__exportStar(n(1524),t);s.__exportStar(n(559),t);s.__exportStar(n(8492),t);s.__exportStar(n(4777),t);s.__exportStar(n(8950),t);s.__exportStar(n(8947),t);s.__exportStar(n(8264),t);s.__exportStar(n(6092),t);s.__exportStar(n(3240),t);s.__exportStar(n(8964),t);s.__exportStar(n(3448),t);s.__exportStar(n(5198),t);s.__exportStar(n(6984),t);s.__exportStar(n(5374),t);s.__exportStar(n(8922),t);var i=n(2858);Object.defineProperty(t,"TagFormat",{enumerable:true,get:function(){return i.TagFormat}})},2858:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TagFormat=void 0;var n;(function(e){e[e["PARAMETERLESS"]=0]="PARAMETERLESS";e[e["FUNCTIONAL"]=1]="FUNCTIONAL";e[e["ASSIGNMENT"]=2]="ASSIGNMENT";e[e["UNDERSCORE"]=3]="UNDERSCORE"})(n||(t.TagFormat=n={}));const s={tagFormat:n.FUNCTIONAL};class Configuration{constructor(e=s){this.config=e}set(e){var t;this.config={tagFormat:(t=e===null||e===void 0?void 0:e.tagFormat)!==null&&t!==void 0?t:s.tagFormat}}get(){return this.config}}t["default"]=new Configuration},8922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.pruneID=void 0;const s=n(1860);const r=s.__importDefault(n(211));const pruneID=e=>{if(Array.isArray(e)){return e.map(t.pruneID)}(0,r.default)(["**._id"],{rtn:"count",filterFn:({parent:e,property:t})=>{delete e[t]}})(e);return e};t.pruneID=pruneID},6698:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getDebugger=void 0;const s=n(2830);const getDebugger=e=>s(`gherkin-formatter:${e}`);t.getDebugger=getDebugger},1523:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(6698);const r=n(5829);const i=n(2793);const o=n(9054);const a=(0,s.getDebugger)("backgroundFormatter");function format(e,t){a("format(background: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Background must be set!")}const n=(0,i.lines)(`${e.keyword}: ${e.name}`);if(e.precedingComment){n.prepend(e.precedingComment.text)}if(e.description){n.append((0,i.lines)({trimLeft:true},e.description))}if(e.descriptionComment){n.append(null,(0,i.lines)(e.descriptionComment.text))}if(e.steps.length>0){if(e.description||e.descriptionComment){n.append(null)}const s=(0,r.config)(t).separateStepGroups;if(s){e.useReadableStepKeywords()}e.steps.forEach(((e,t)=>{if(s&&e.keyword==="When"&&t!==0){n.append(null)}n.append((0,i.lines)((0,o.format)(e)))}))}return n.toString()}t.format=format},9055:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(9115);const o=(0,r.getDebugger)("dataTableFormatter");function format(e){o("format(dataTable: %s)",e===null||e===void 0?void 0:e.constructor.name);if(!e){throw new Error("DataTable must be set!")}return(0,s.lines)((0,i.format)(e.rows)).toString()}t.format=format},6702:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=(0,r.getDebugger)("docStringFormatter");function format(e){i("format(docString: %s)",e===null||e===void 0?void 0:e.constructor.name);if(!e){throw new Error("DocString must be set!")}const t=(0,s.lines)(e.content,e.delimiter);if(e.mediaType){t.prepend(e.delimiter+e.mediaType)}else{t.prepend(e.delimiter)}if(e.comment){t.prepend(e.comment.text)}return t.toString()}t.format=format},4622:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(9115);const o=n(8027);const a=(0,r.getDebugger)("examplesFormatter");function format(e,t){a("format(examples: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Examples must be set!")}const n=(0,s.lines)(`${e.keyword}: ${e.name}`);if(e.precedingComment){n.prepend(e.precedingComment.text)}if(e.tags.length>0){n.prepend((0,o.format)(e.tags,t))}if(e.tagComment){n.prepend(e.tagComment.text)}const r=[e.header,...e.body];n.append((0,s.lines)((0,i.format)(r)));return n.toString()}t.format=format},8693:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(4367);const r=n(6698);const i=n(2793);const o=n(1523);const a=n(4493);const c=n(5609);const l=n(3903);const u=n(8027);const d=(0,r.getDebugger)("featureFormatter");function format(e,t){d("format(feature: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Feature must be set!")}const n=(0,i.lines)(`${e.keyword}: ${e.name}`);if(e.precedingComment){n.prepend(e.precedingComment.text)}if(e.tags.length>0){n.prepend((0,u.format)(e.tags,t))}if(e.tagComment){n.prepend(e.tagComment.text)}if(e.description){n.append((0,i.lines)({trimLeft:true},e.description))}if(e.descriptionComment){n.append((0,i.lines)(null,e.descriptionComment.text))}if(e.elements.length>0){e.elements.forEach((e=>{if(e instanceof s.Scenario){n.append(null,(0,i.lines)((0,c.format)(e,t)))}else if(e instanceof s.ScenarioOutline){n.append(null,(0,i.lines)((0,l.format)(e,t)))}else if(e instanceof s.Background){n.append(null,(0,i.lines)((0,o.format)(e,t)))}else if(e instanceof s.Rule){n.append(null,(0,i.lines)((0,a.format)(e,t)))}}))}if(e.language!=="en"){n.prepend(`# language: ${e.language}`)}return n.toString()}t.format=format},8886:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(8693);const o=(0,r.getDebugger)("gherkinDocumentFormatter");function format(e,t){o("format(document: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Document must be set!")}const n=(0,s.lines)((0,i.format)(e.feature,t));if(e.startComment){n.prepend(e.startComment.text,null)}if(e.endComment){n.append(null,e.endComment.text)}return n.toString()}t.format=format},4493:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(4367);const r=n(2793);const i=n(6698);const o=n(1523);const a=n(5609);const c=n(3903);const l=n(8027);const u=(0,i.getDebugger)("ruleFormatter");function format(e,t){u("format(rule: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Rule must be set!")}const n=(0,r.lines)(`${e.keyword}: ${e.name}`);if(e.precedingComment){n.prepend(e.precedingComment.text)}if(e.tags.length>0){n.prepend((0,l.format)(e.tags,t))}if(e.tagComment){n.prepend(e.tagComment.text)}if(e.description){n.append((0,r.lines)({trimLeft:true},e.description))}if(e.descriptionComment){n.append(null,(0,r.lines)(e.descriptionComment.text))}if(e.elements.length>0){e.elements.forEach((e=>{if(e instanceof s.Scenario){n.append(null,(0,r.lines)((0,a.format)(e,t)))}else if(e instanceof s.ScenarioOutline){n.append(null,(0,r.lines)((0,c.format)(e,t)))}else if(e instanceof s.Background){n.append(null,(0,r.lines)((0,o.format)(e,t)))}}))}return n.toString()}t.format=format},5609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(5829);const o=n(9054);const a=n(8027);const c=(0,r.getDebugger)("scenarioFormatter");function format(e,t){c("format(scenario: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Scenario must be set!")}const n=(0,s.lines)(`${e.keyword}: ${e.name}`);if(e.precedingComment){n.prepend(e.precedingComment.text)}if(e.tags.length>0){n.prepend((0,a.format)(e.tags,t))}if(e.tagComment){n.prepend(e.tagComment.text)}if(e.description){n.append((0,s.lines)({trimLeft:true},e.description))}if(e.descriptionComment){n.append(null,(0,s.lines)(e.descriptionComment.text))}if(e.steps.length>0){if(e.description||e.descriptionComment){n.append(null)}const r=(0,i.config)(t).separateStepGroups;if(r){e.useReadableStepKeywords()}e.steps.forEach(((e,t)=>{if(r&&e.keyword==="When"&&t!==0){n.append(null)}n.append((0,s.lines)((0,o.format)(e)))}))}return n.toString()}t.format=format},3903:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(4622);const o=n(5609);const a=(0,r.getDebugger)("scenarioOutlineFormatter");function format(e,t){a("format(scenarioOutline: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("ScenarioOutline must be set!")}const n=(0,s.lines)((0,o.format)(e,t));if(e.examples.length>0){e.examples.forEach((e=>{n.append(null,(0,s.lines)((0,i.format)(e,t)))}))}return n.toString()}t.format=format},9054:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(9055);const o=n(6702);const a=(0,r.getDebugger)("stepFormatter");function format(e){a("format(step: %s)",e===null||e===void 0?void 0:e.constructor.name);if(!e){throw new Error("Step must be set!")}const t=(0,s.lines)(`${e.keyword} ${e.text}`);if(e.comment){t.prepend(e.comment.text)}if(e.docString){t.append((0,s.lines)((0,o.format)(e.docString)))}if(e.dataTable){t.append((0,s.lines)((0,i.format)(e.dataTable)))}return t.toString()}t.format=format},3295:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(6698);const r=(0,s.getDebugger)("tableCellFormatter");function format(e){r("format(tableCell: %s)",e===null||e===void 0?void 0:e.constructor.name);if(!e){throw new Error("TableCell must be set!")}return e.value.replace(/(?!\\)([|#])/g,"\\$1")}t.format=format},9115:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=t.toArray=void 0;const s=n(2793);const r=n(6698);const i=n(3459);const o=n(3295);const a=(0,r.getDebugger)("tableRowFormatter");function toArray(e){return e.cells.map((e=>(0,o.format)(e)))}t.toArray=toArray;function format(e){a("format(tableRows: %s)",e===null||e===void 0?void 0:e.constructor.name);if(!e){throw new Error("TableRows must be set!")}const t=(0,s.splitToLines)((0,i.table)(e.map(toArray)));const n=(0,s.lines)();for(let s=0;s<e.length;++s){const r=e[s];if(r.comment){n.append(r.comment.text)}n.append(t[s])}return n.toString()}t.format=format},8027:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=void 0;const s=n(2793);const r=n(6698);const i=n(5829);const o=(0,r.getDebugger)("tagFormatter");function format(e,t){o("format(tags: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,t);if(!e){throw new Error("Tags must be set!")}t=(0,i.config)(t);if(t.oneTagPerLine){const t=(0,s.lines)();for(const n of e){if(n.comment){t.append(n.comment.text)}t.append(n.toString())}return t.toString()}let n="";for(const t of e){if(t.comment){n+=`${n?"\n":""}${t.comment.text}\n${t.toString()}`}else{n+=`${n?" ":""}${t.toString()}`}}return(0,s.lines)(n).toString()}t.format=format},5829:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.format=t.config=void 0;const s=n(4367);const r=n(2793);const i=n(6698);const o=n(8886);const a=(0,i.getDebugger)("index");const c={oneTagPerLine:false,separateStepGroups:false,compact:false,lineBreak:null,indentation:" ",tagFormat:s.TagFormat.FUNCTIONAL};const config=e=>{var t,n,s,r,i,o;a("config(options: %o)",e);e=e!==null&&e!==void 0?e:{};return{oneTagPerLine:(t=e.oneTagPerLine)!==null&&t!==void 0?t:c.oneTagPerLine,separateStepGroups:(n=e.separateStepGroups)!==null&&n!==void 0?n:c.separateStepGroups,compact:(s=e.compact)!==null&&s!==void 0?s:c.compact,lineBreak:(r=e.lineBreak)!==null&&r!==void 0?r:c.lineBreak,indentation:(i=e.indentation)!==null&&i!==void 0?i:c.indentation,tagFormat:(o=e.tagFormat)!==null&&o!==void 0?o:c.tagFormat}};t.config=config;const format=(e,n)=>{a("format(document: %s, options: %o)",e===null||e===void 0?void 0:e.constructor.name,n);if(!e){throw new Error("Document must be set!")}if(!(e instanceof s.Document)){throw new TypeError(`The passed object is not a GherkinDocument! ${e}`)}n=(0,t.config)(n);s.config.set({tagFormat:n.tagFormat});(0,r.setDefaultOptions)({eol:n.lineBreak,indent:n.indentation,skipEmpty:n.compact,skipFirstLevelIndent:true,indentEmpty:false,trimLeft:false,trimRight:true});return(0,o.format)(e,n)};t.format=format},3459:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.table=void 0;const s=n(4112);const r=n(6698);const i=(0,r.getDebugger)("utils");const table=e=>{i("table(data: %o)",e);return s.table(e,{border:{topBody:"",topJoin:"",topLeft:"",topRight:"",bottomBody:"",bottomJoin:"",bottomLeft:"",bottomRight:"",bodyLeft:"|",bodyRight:"|",bodyJoin:"|",joinBody:"",joinLeft:"",joinRight:"",joinJoin:""},drawHorizontalLine:()=>false}).trim()};t.table=table},3813:e=>{"use strict";e.exports=(e,t=process.argv)=>{const n=e.startsWith("-")?"":e.length===1?"-":"--";const s=t.indexOf(n+e);const r=t.indexOf("--");return s!==-1&&(r===-1||s<r)}},4519:e=>{"use strict";const isFullwidthCodePoint=e=>{if(Number.isNaN(e)){return false}if(e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141)){return true}return false};e.exports=isFullwidthCodePoint;e.exports["default"]=isFullwidthCodePoint},2793:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.resetDefaultOptions=t.setDefaultOptions=t.LinesBuilder=void 0;t.splitToLines=splitToLines;t.lines=lines;const s=n(8161);const r=n(2830);const i=r("lines-builder");function splitToLines(e){return e.split(/\r?\n\r?/g)}const o={indent:null,trimLeft:true,trimRight:true,indentEmpty:false,skipFirstLevelIndent:false,skipEmpty:false,eol:null};class LinesBuilder{get length(){return this.lines.length}constructor(...e){this.lines=[];i("LinesBuilder(args: %o)",e);let t;if(e[0]&&typeof e[0]==="object"&&!(e[0]instanceof LinesBuilder)){t=e.shift()}this.options=Object.assign(Object.assign({},LinesBuilder.DEFAULT_OPTIONS),t||{});i("LinesBuilder.options: %o",this.options);if(typeof this.options.indent==="number"){this.options.indent=" ".repeat(Math.max(0,this.options.indent))}i("LinesBuilder.options: %o",this.options);this.lines=this.parseLines(e);i("LinesBuilder.lines: %o",this.lines)}static resetDefaultOptions(){i("resetDefaultOptions.prev: %o",LinesBuilder.DEFAULT_OPTIONS);LinesBuilder.DEFAULT_OPTIONS=Object.assign({},o);i("resetDefaultOptions.new: %o",LinesBuilder.DEFAULT_OPTIONS);return LinesBuilder.DEFAULT_OPTIONS}static setDefaultOptions(e){i("setDefaultOptions(options: %o)",e);if(typeof e!=="object"||!e){throw new TypeError("Options must be a LinesBuilderOptions!")}i("setDefaultOptions.prev: %o",LinesBuilder.DEFAULT_OPTIONS);LinesBuilder.DEFAULT_OPTIONS=Object.assign(Object.assign({},LinesBuilder.DEFAULT_OPTIONS),e);i("setDefaultOptions.next: %o",LinesBuilder.DEFAULT_OPTIONS);return LinesBuilder.DEFAULT_OPTIONS}parseLines(e){i("parseLines(ls: %o)",e);const t=[];for(const n of e){i("parseLines.line: %o",n);if(typeof n==="string"){let e=splitToLines(n);if(this.options.trimLeft){e=e.map((e=>e.trimLeft()))}if(this.options.trimRight){e=e.map((e=>e.trimRight()))}t.push(...e)}else if(n instanceof LinesBuilder||n===null){t.push(n)}i("parseLines.parsedLines: %o",t)}return t}toString(){var e;i("toString:lines: %o",this.lines);const t=[];const n=(e=this.options.indent)!==null&&e!==void 0?e:"";const r=this.options.skipFirstLevelIndent?"":n;i("toString.indent: %o",n);for(const e of this.lines){i("toString.line: %o",e);if(typeof e==="string"&&e){t.push(`${r}${e}`)}else if(e instanceof LinesBuilder){const s=splitToLines(e.toString());for(const e of s){if(e){t.push(`${n}${e}`)}else if(!this.options.skipEmpty){t.push(this.options.indentEmpty?n:"")}}}else if(!this.options.skipEmpty){t.push(this.options.indentEmpty?n:"")}i("toString.ls: %o",t)}let o=this.options.eol;if(!o){i("toString.platform: %s",s.platform());o=s.platform()=="win32"?"\r\n":"\n"}i("toString.eol: %o",o);return t.join(o)}copy(){i("copy:lines: %o",this.lines);const e=new LinesBuilder(this.options);for(const t of this.lines){i("copy.line: %o",t);if(t instanceof LinesBuilder){e.append(t.copy())}else{e.append(t)}}return e}append(...e){i("append(ls: %o)",e);i("append.#lines: %d",this.lines.length);e=this.parseLines(e);this.lines.push(...e);i("append.#lines: %d",this.lines.length);return this}prepend(...e){i("prepend(ls: %o)",e);i("prepend.#lines: %d",this.lines.length);e=this.parseLines(e);this.lines.unshift(...e);i("prepend.#lines: %d",this.lines.length);return this}filter(e,t=false,n=true){i("filter(matcher: %o, reverse: %b, inPlace: %b)",e,t,n);if(!e){throw new TypeError("Matcher must be set!")}if(typeof e==="string"){e=new RegExp(e,"i")}let s;if(e instanceof RegExp){s=(t,n)=>e.test(t)}else{s=e}const r=n?this:this.copy();r.lines=r.lines.filter(((e,n)=>{if(e instanceof LinesBuilder){i("filter.nested(original: %d)",e.length);e.filter(s,t);i("filter.nested(result: %d)",e.length);return e.length>0}const r=s(e,n);i("filter.string(result: %b)",r);return!!r!==!!t}));return r}internalMap(e,t){i("internalMap(mapper: %o, level: %d)",e,t);this.lines=this.lines.map(((n,s)=>{if(n instanceof LinesBuilder){i("internalMap.nested(original: %d)",n.length);n.internalMap(e,t+1);return n}return e(n,s,t)}))}map(e,t=true){i("map(mapper: %o, inPlace: %b)",e,t);if(!e){throw new TypeError("Mapper must be set!")}if(typeof e!=="function"){throw new TypeError("Mapper must be a function!")}const n=t?this:this.copy();n.internalMap(e,0);return n}}t.LinesBuilder=LinesBuilder;LinesBuilder.DEFAULT_OPTIONS=Object.assign({},o);t.setDefaultOptions=LinesBuilder.setDefaultOptions;t.resetDefaultOptions=LinesBuilder.resetDefaultOptions;function lines(...e){return new LinesBuilder(...e)}},4055:(e,t,n)=>{e=n.nmd(e);var s=30,r="...";var i=1/0,o=17976931348623157e292,a=0/0;var c="[object RegExp]",l="[object Symbol]";var u=/^\s+|\s+$/g;var d=/\w*$/;var f=/^[-+]0x[0-9a-f]+$/i;var p=/^0b[01]+$/i;var h=/^0o[0-7]+$/i;var m="\\ud800-\\udfff",g="\\u0300-\\u036f\\ufe20-\\ufe23",y="\\u20d0-\\u20f0",b="\\ufe0e\\ufe0f";var v="["+m+"]",w="["+g+y+"]",T="\\ud83c[\\udffb-\\udfff]",S="(?:"+w+"|"+T+")",k="[^"+m+"]",D="(?:\\ud83c[\\udde6-\\uddff]){2}",_="[\\ud800-\\udbff][\\udc00-\\udfff]",E="\\u200d";var C=S+"?",R="["+b+"]?",P="(?:"+E+"(?:"+[k,D,_].join("|")+")"+R+C+")*",O=R+C+P,A="(?:"+[k+w+"?",w,D,_,v].join("|")+")";var L=RegExp(T+"(?="+T+")|"+A+O,"g");var x=RegExp("["+E+m+g+y+b+"]");var I=parseInt;var $=typeof global=="object"&&global&&global.Object===Object&&global;var F=typeof self=="object"&&self&&self.Object===Object&&self;var j=$||F||Function("return this")();var M=true&&t&&!t.nodeType&&t;var N=M&&"object"=="object"&&e&&!e.nodeType&&e;var B=N&&N.exports===M;var U=B&&$.process;var W=function(){try{return U&&U.binding("util")}catch(e){}}();var G=W&&W.isRegExp;var q=baseProperty("length");function asciiToArray(e){return e.split("")}function baseProperty(e){return function(t){return t==null?undefined:t[e]}}function baseUnary(e){return function(t){return e(t)}}function hasUnicode(e){return x.test(e)}function stringSize(e){return hasUnicode(e)?unicodeSize(e):q(e)}function stringToArray(e){return hasUnicode(e)?unicodeToArray(e):asciiToArray(e)}function unicodeSize(e){var t=L.lastIndex=0;while(L.test(e)){t++}return t}function unicodeToArray(e){return e.match(L)||[]}var H=Object.prototype;var K=H.toString;var V=j.Symbol;var z=V?V.prototype:undefined,J=z?z.toString:undefined;function baseIsRegExp(e){return isObject(e)&&K.call(e)==c}function baseSlice(e,t,n){var s=-1,r=e.length;if(t<0){t=-t>r?0:r+t}n=n>r?r:n;if(n<0){n+=r}r=t>n?0:n-t>>>0;t>>>=0;var i=Array(r);while(++s<r){i[s]=e[s+t]}return i}function baseToString(e){if(typeof e=="string"){return e}if(isSymbol(e)){return J?J.call(e):""}var t=e+"";return t=="0"&&1/e==-i?"-0":t}function castSlice(e,t,n){var s=e.length;n=n===undefined?s:n;return!t&&n>=s?e:baseSlice(e,t,n)}function isObject(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function isObjectLike(e){return!!e&&typeof e=="object"}var Y=G?baseUnary(G):baseIsRegExp;function isSymbol(e){return typeof e=="symbol"||isObjectLike(e)&&K.call(e)==l}function toFinite(e){if(!e){return e===0?e:0}e=toNumber(e);if(e===i||e===-i){var t=e<0?-1:1;return t*o}return e===e?e:0}function toInteger(e){var t=toFinite(e),n=t%1;return t===t?n?t-n:t:0}function toNumber(e){if(typeof e=="number"){return e}if(isSymbol(e)){return a}if(isObject(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=isObject(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=e.replace(u,"");var n=p.test(e);return n||h.test(e)?I(e.slice(2),n?2:8):f.test(e)?a:+e}function toString(e){return e==null?"":baseToString(e)}function truncate(e,t){var n=s,i=r;if(isObject(t)){var o="separator"in t?t.separator:o;n="length"in t?toInteger(t.length):n;i="omission"in t?baseToString(t.omission):i}e=toString(e);var a=e.length;if(hasUnicode(e)){var c=stringToArray(e);a=c.length}if(n>=a){return e}var l=n-stringSize(i);if(l<1){return i}var u=c?castSlice(c,0,l).join(""):e.slice(0,l);if(o===undefined){return u+i}if(c){l+=u.length-l}if(Y(o)){if(e.slice(l).search(o)){var f,p=u;if(!o.global){o=RegExp(o.source,toString(d.exec(o))+"g")}o.lastIndex=0;while(f=o.exec(p)){var h=f.index}u=u.slice(0,h===undefined?l:h)}}else if(e.indexOf(baseToString(o),l)!=l){var m=u.lastIndexOf(o);if(m>-1){u=u.slice(0,m)}}return u+i}e.exports=truncate},744:e=>{var t=1e3;var n=t*60;var s=n*60;var r=s*24;var i=r*7;var o=r*365.25;e.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0){return parse(e)}else if(n==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a){return}var c=parseFloat(a[1]);var l=(a[2]||"ms").toLowerCase();switch(l){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*s;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return undefined}}function fmtShort(e){var i=Math.abs(e);if(i>=r){return Math.round(e/r)+"d"}if(i>=s){return Math.round(e/s)+"h"}if(i>=n){return Math.round(e/n)+"m"}if(i>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){var i=Math.abs(e);if(i>=r){return plural(e,i,r,"day")}if(i>=s){return plural(e,i,s,"hour")}if(i>=n){return plural(e,i,n,"minute")}if(i>=t){return plural(e,i,t,"second")}return e+" ms"}function plural(e,t,n,s){var r=t>=n*1.5;return Math.round(e/n)+" "+s+(r?"s":"")}},2502:(e,t,n)=>{"use strict";const s=n(1324);const r=n(5579);const i=n(8213);const{defineProperty:o}=n(9669);const{Wildcard:a}=n(9517);const c=Symbol("counter");const l=Symbol("leaf");const markLeaf=(e,t,n)=>o(e,l,t,n);const isLeaf=e=>l in e;const isMatch=e=>e!==undefined&&e[l]===true;e.exports.isLeaf=isLeaf;e.exports.isMatch=isMatch;const u=Symbol("has-matches");const setHasMatches=e=>o(e,u,true);const hasMatches=e=>e[u]===true;e.exports.hasMatches=hasMatches;const merge=(e,t,n)=>{if(e[t]===undefined){o(e,t,[])}if(!e[t].includes(n)){e[t].push(n)}};const d=Symbol("leaf-needles");const addLeafNeedle=(e,t)=>merge(e,d,t);const getLeafNeedles=e=>e[d]||[];e.exports.getLeafNeedles=getLeafNeedles;const f=Symbol("leaf-needles-exclude");const addLeafNeedleExclude=(e,t)=>merge(e,f,t);const getLeafNeedlesExclude=e=>e[f]||[];e.exports.getLeafNeedlesExclude=getLeafNeedlesExclude;const p=Symbol("leaf-needles-match");const addLeafNeedleMatch=(e,t)=>merge(e,p,t);const getLeafNeedlesMatch=e=>e[p]||[];e.exports.getLeafNeedlesMatch=getLeafNeedlesMatch;const h=Symbol("needles");const addNeedle=(e,t)=>merge(e,h,t);const getNeedles=e=>e[h];e.exports.getNeedles=getNeedles;const m=Symbol("index");const setIndex=(e,t,n)=>o(e,m,t,n);const getIndex=e=>e[m];e.exports.getIndex=getIndex;const g=Symbol("order");const setOrder=(e,t)=>o(e,g,t);const getOrder=e=>e[g];e.exports.getOrder=getOrder;const y=Symbol("wildcard");const setWildcard=(e,t)=>o(e,y,t);const getWildcard=e=>e[y];e.exports.getWildcard=getWildcard;const b=Symbol("values");const setValues=(e,t)=>o(e,b,t);const getValues=e=>e[b];e.exports.getValues=getValues;e.exports.matchedBy=e=>Array.from(new Set([].concat(...e.map((e=>getLeafNeedlesMatch(e))))));e.exports.excludedBy=e=>Array.from(new Set([].concat(...e.map((e=>getLeafNeedlesExclude(e))))));e.exports.traversedBy=e=>Array.from(new Set([].concat(...e.map((e=>getNeedles(e))))));e.exports.isLastLeafMatch=e=>{let t=Number.MIN_SAFE_INTEGER;let n=null;for(let s=0,r=e.length;s<r;s+=1){const r=e[s];const i=getIndex(r);if(i!==undefined&&i>t){t=i;n=r}}return n!==null&&isMatch(n)};const iterate=(e,t,n,{onAdd:s,onFin:i})=>{const o=[[[e,null]]];const a=[];let c=false;r.iterate(n,((n,r)=>{if(n==="RM"){if(r.excluded===true){c=false}o.pop();a.pop()}else if(n==="ADD"){if(r.excluded===true){if(c){throw new Error(`Redundant Exclusion: "${t}"`)}c=true}const e=[];const n=a[a.length-1];o[o.length-1].forEach((([t])=>s(t,r,n,(n=>e.push([n,t])))));o.push(e);a.push(r)}else{o[o.length-1].filter((([t])=>t!==e)).forEach((([e,t])=>i(e,r[r.length-1],t,c)))}}))};const applyNeedle=(e,t,n,s)=>{iterate(e,t,n,{onAdd:(e,n,r,i)=>{addNeedle(e,t);const o=r!==undefined&&n.isStarRec&&n.value===r.value;if(o&&s.strict){throw new Error(`Redundant Recursion: "${t}"`)}if(!o){if(!(n.value in e)){const t={};e[n.value]=t;if(s.orderByNeedles){setOrder(t,s[c])}setWildcard(t,n)}i(e[n.value])}if(n.isStarRec){i(e)}},onFin:(e,n,r,i)=>{if(s.strict){if(n.isSimpleStarRec){const e=Object.keys(r).filter((e=>!["**",""].includes(e)));if(e.length!==0){throw new Error(`Needle Target Invalidated: "${r[e[0]][h][0]}" by "${t}"`)}}}addNeedle(e,t);if(s.strict&&d in e){throw new Error(`Redundant Needle Target: "${e[d][0]}" vs "${t}"`)}addLeafNeedle(e,t,s.strict);if(i){addLeafNeedleExclude(e,t)}else{addLeafNeedleMatch(e,t)}markLeaf(e,!i,s.strict);setIndex(e,s[c],s.strict);s[c]+=1}})};const finalizeTower=e=>{const t=[];let n=-1;i.traverse(e,((e,s,r)=>{if(e==="EXIT"){const e=n===r+1;if(e&&t[n]===true||isMatch(s)){t[r]=true;setHasMatches(s)}if(e){t[n]=false}setValues(s,Object.values(s).reverse());n=r}}))};e.exports.compile=(e,t)=>{const n={};t[c]=0;for(let r=0;r<e.length;r+=1){const i=e[r];const o=[s.parse(i,t)];applyNeedle(n,i,o,t)}setWildcard(n,new a("*",false));finalizeTower(n);return n}},6472:(e,t,n)=>{"use strict";const s=n(2613);e.exports=e=>{const t={filterFn:undefined,breakFn:undefined,beforeFn:undefined,afterFn:undefined,compareFn:undefined,reverse:true,orderByNeedles:false,abort:false,rtn:undefined,joined:false,useArraySelector:true,strict:true,...e};s(Object.keys(t).length===12,"Unexpected Option provided!");s(["function","undefined"].includes(typeof t.filterFn));s(["function","undefined"].includes(typeof t.breakFn));s(["function","undefined"].includes(typeof t.beforeFn));s(["function","undefined"].includes(typeof t.afterFn));s(["function","undefined"].includes(typeof t.compareFn));s(typeof t.reverse==="boolean");s(typeof t.orderByNeedles==="boolean");s(typeof t.abort==="boolean");s(typeof t.rtn==="function"&&t.rtn.length===1||[undefined,"context","key","value","entry","property","gproperty","parent","gparent","parents","isMatch","matchedBy","excludedBy","traversedBy","isCircular","isLeaf","depth","bool","count"].includes(t.rtn)||Array.isArray(t.rtn)&&t.rtn.every((e=>["key","value","entry","property","gproperty","parent","gparent","parents","isMatch","matchedBy","excludedBy","traversedBy","isCircular","isLeaf","depth"].includes(e))));s(typeof t.joined==="boolean");s(typeof t.useArraySelector==="boolean");s(typeof t.strict==="boolean");return t}},9992:e=>{"use strict";e.exports=(e,t)=>{if(t.rtn==="context"){return{onMatch:()=>{},get:()=>e.context}}if(t.rtn==="bool"){let e=false;return{onMatch:()=>{e=true},get:()=>e}}if(t.rtn==="count"){let e=0;return{onMatch:()=>{e+=1},get:()=>e}}const n=[];return{onMatch:(()=>{if(typeof t.rtn==="function"){return()=>n.push(t.rtn(e))}if(Array.isArray(t.rtn)){return()=>n.push(t.rtn.map((t=>e[t])))}return()=>n.push(e[t.rtn])})(),get:()=>t.abort?n[0]:n}}},5592:(e,t,n)=>{"use strict";const s=n(2613);const r=n(2502);const i=n(9992);const{toPath:o}=n(9669);const{getOrder:a}=n(2502);const formatPath=(e,t)=>t.joined?o(e):[...e];e.exports=(e,t,n)=>{const o={haystack:e,context:n.context};if(n.beforeFn!==undefined){const e=n.beforeFn(o);s(e===undefined,"beforeFn must not return")}const c=[false,t,null,0];const l=[];const u=[];let d;let f;let p;let h;let m=o.haystack;const g={getKey:()=>formatPath(l,n),get key(){return g.getKey()},getValue:()=>m,get value(){return g.getValue()},getEntry:()=>[formatPath(l,n),m],get entry(){return g.getEntry()},getIsMatch:()=>h,get isMatch(){return g.getIsMatch()},getMatchedBy:()=>r.matchedBy(p),get matchedBy(){return g.getMatchedBy()},getExcludedBy:()=>r.excludedBy(p),get excludedBy(){return g.getExcludedBy()},getTraversedBy:()=>r.traversedBy(p),get traversedBy(){return g.getTraversedBy()},getGproperty:()=>l[l.length-2],get gproperty(){return g.getGproperty()},getProperty:()=>l[l.length-1],get property(){return g.getProperty()},getGparent:()=>u[u.length-2],get gparent(){return g.getGparent()},getParent:()=>u[u.length-1],get parent(){return g.getParent()},getParents:()=>[...u].reverse(),get parents(){return g.getParents()},getIsCircular:()=>u.includes(m),get isCircular(){return g.getIsCircular()},getIsLeaf:()=>!(m instanceof Object),get isLeaf(){return g.getIsLeaf()},getDepth:()=>l.length,get depth(){return g.getDepth()},get result(){return g.getResult()},context:o.context};const y=i(g,n);g.getResult=()=>y.get();if(""in t[0]&&(n.useArraySelector||!Array.isArray(o.haystack))){c[1]=[...c[1],t[0][""]]}do{d=c.pop();f=c.pop();p=c.pop();h=c.pop();const e=l.length-d;for(let t=0;t<e;t+=1){u.pop();l.pop()}if(e===-1){u.push(m);l.push(f);m=m[f]}else if(f!==null){l[l.length-1]=f;m=u[u.length-1][f]}else{m=o.haystack}if(h){if(n.filterFn===undefined||n.filterFn(g)!==false){y.onMatch();if(n.abort){c.length=0}}continue}if(!p.some((e=>r.hasMatches(e)))){continue}const t=n.useArraySelector===false&&Array.isArray(m);if(!t&&r.isLastLeafMatch(p)){c.push(true,p,f,d);h=true}if((n.breakFn===undefined||n.breakFn(g)!==true)&&m instanceof Object){const e=Array.isArray(m);const s=Object.keys(m);if(!e&&n.compareFn){s.sort(n.compareFn(g))}if(!n.reverse){s.reverse()}for(let i=0,o=s.length;i<o;i+=1){const o=s[i];const u=[];if(t){u.push(...p);if(l.length===0){if(""in p[0]){u.push(p[0][""])}u.push(...r.getValues(p[0]).filter((e=>r.getWildcard(e).isStarRec)))}}else{for(let t=0,n=p.length;t!==n;t+=1){const n=p[t];if(r.getWildcard(n).anyMatch(o)){u.push(n)}const s=r.getValues(n);let i=s.length;while(i--){const t=s[i];if(r.getWildcard(t).typeMatch(o,e)){u.push(t)}}}}if(n.orderByNeedles){u.index=Buffer.from(u.map((e=>a(e))).sort());let t=c.length-3;const n=t-i*4;while(t!==n&&Buffer.compare(u.index,c[t].index)===1){t-=4}c.splice(t+3,0,false,u,e?Number(o):o,d+1)}else{c.push(false,u,e?Number(o):o,d+1)}}}}while(c.length!==0);o.result=y.get();if(n.afterFn!==undefined){const e=n.afterFn(o);s(e===undefined,"afterFn must not return")}return o.result}},2956:(e,t,n)=>{"use strict";const s=n(2613);const{defineProperty:r}=n(9669);const{Wildcard:i}=n(9517);const o=Symbol("is-excluded");const markExcluded=e=>r(e,o,true);const isExcluded=e=>e[o]===true;const throwError=(e,t,n={})=>{throw new Error(Object.entries(n).reduce(((e,[t,n])=>`${e}, ${t} ${n}`),`${e}: ${t}`))};const getSimple=e=>{if(Array.isArray(e)){return e.length===1?e[0]:e}return e.size===1?e.values().next().value:e};e.exports=e=>{let t=new Set;let n=false;let r=false;let o=0;const a=[];const newChild=e=>{if(isExcluded(t)){s(r===false);r=true}a.push(t);t=e?new Set:[]};const finishChild=()=>{const e=a.pop();const n=Array.isArray(e);const s=getSimple(t);if(!n&&s instanceof Set){s.forEach((t=>e.add(t)))}else{e[n?"push":"add"](s)}t=e};newChild(false);return{setInArray:(t,s)=>{if(n===t){throwError(n?"Bad Array Start":"Bad Array Terminator",e,{char:s})}n=t},finishElement:(s,{err:a,fins:c,finReq:l=false})=>{const u=o===s;if(u&&!c.includes(e[s-1]||null)){throwError(a,e,{char:s})}if(!u){if(l){throwError(a,e,{char:s})}const c=e.slice(o,s);if(n&&!(/^[?*+\d]+$/.test(c)||c.startsWith("(")&&c.endsWith(")"))){throwError("Bad Array Selector",e,{selector:c})}t.push(new i(n?`[${c}]`:c,r));r=false}o=s+1},startExclusion:t=>{if(r!==false){throwError("Redundant Exclusion",e,{char:t})}r=true},startGroup:()=>{newChild(true);if(r){markExcluded(t);r=false}newChild(false)},newGroupElement:()=>{finishChild();newChild(false)},finishGroup:t=>{if(a.length<2){throwError("Unexpected Group Terminator",e,{char:t})}finishChild();finishChild()},finalizeResult:()=>{finishChild();s(r===false);if(a.length!==0){throwError("Non Terminated Group",e)}if(n){throwError("Non Terminated Array",e)}return getSimple(t)}}}},1324:(e,t,n)=>{"use strict";const{Wildcard:s}=n(9517);const r=n(2956);const throwError=(e,t,n={})=>{throw new Error(Object.entries(n).reduce(((e,[t,n])=>`${e}, ${t} ${n}`),`${e}: ${t}`))};e.exports.parse=(e,t)=>{if(e===""){return new s("",false)}const n=r(e);const i=e.length;let o=false;let a=0;for(let s=0;s<i;s+=1){const r=e[s];if(o===false&&a===0){switch(r){case".":n.finishElement(s,{err:"Bad Path Separator",fins:["]","}"]});break;case"[":if(!t.useArraySelector){throwError("Forbidden Array Selector",e,{char:s})}n.finishElement(s,{err:"Bad Array Start",fins:[null,"!","{",",","}","]"]});n.setInArray(true,s);break;case"]":n.finishElement(s,{err:"Bad Array Terminator",fins:["}"]});n.setInArray(false,s);break;case"{":n.finishElement(s,{err:"Bad Group Start",fins:[null,"!",".","[","{",","],finReq:true});n.startGroup();break;case",":n.finishElement(s,{err:"Bad Group Separator",fins:["]","}"]});n.newGroupElement();break;case"}":n.finishElement(s,{err:"Bad Group Terminator",fins:["]","}"]});n.finishGroup(s);break;case"!":n.finishElement(s,{err:"Bad Exclusion",fins:[null,".",",","{","["],finReq:true});n.startExclusion(s);break;default:break}}if(o===false){switch(r){case"(":a+=1;break;case")":if(a===0){throwError("Unexpected Parentheses",e,{char:s})}a-=1;break;default:break}}o=r==="\\"?!o:false}if(o!==false){throwError("Dangling Escape",e,{char:i-1})}if(a!==0){throwError("Unterminated Parentheses",e)}n.finishElement(i,{err:"Bad Terminator",fins:["]","}"]});return n.finalizeResult()}},9517:(e,t,n)=>{"use strict";const{escapeRegex:s,asRegex:r}=n(9669);const parseWildcard=e=>{let t="";let n=false;for(let r=0;r<e.length;r+=1){const i=e[r];if(!n&&i==="\\"){n=true}else if(!n&&i==="*"){t+=".*"}else if(!n&&i==="+"){t+=".+"}else if(!n&&i==="?"){t+="."}else{t+=s(i);n=false}}return new RegExp(`^${t}$`)};e.exports.parseWildcard=parseWildcard;const compileWildcard=e=>{if(["**","++"].includes(e)){return r(".*")}if((e.startsWith("**(")||e.startsWith("++("))&&e.endsWith(")")){return r(e.slice(3,-1))}if(e.startsWith("[(")&&e.endsWith(")]")){return r(e.slice(2,-2))}if(e.startsWith("(")&&e.endsWith(")")){return r(e.slice(1,-1))}if(e.startsWith("[")&&e.endsWith("]")){return parseWildcard(e.slice(1,-1))}return parseWildcard(e)};class Wildcard{constructor(e,t){this.value=e;this.excluded=t;this.regex=compileWildcard(e);this.isArrayTarget=e.startsWith("[")&&e.endsWith("]");this.isSimpleStarRec=e==="**";this.isSimplePlusRec=e==="++";this.isSimpleRec=this.isSimpleStarRec||this.isSimplePlusRec;this.isRegexStarRec=e.startsWith("**(")&&e.endsWith(")");this.isRegexPlusRec=e.startsWith("++(")&&e.endsWith(")");this.isRegexRec=this.isRegexStarRec||this.isRegexPlusRec;this.isStarRec=this.isSimpleStarRec||this.isRegexStarRec;this.isPlusRec=this.isSimplePlusRec||this.isRegexPlusRec;this.isRec=this.isStarRec||this.isPlusRec;this.isAnyArrayTarget=e==="[*]";this.isAnyObjTarget=e==="*"}anyMatch(e){if(!this.isRec){return false}if(this.isSimpleRec){return true}return this.regex.test(e)}typeMatch(e,t){if(this.isSimpleRec){return true}if(t&&this.isAnyArrayTarget){return true}if(!t&&this.isAnyObjTarget){return true}if(t!==this.isArrayTarget&&!this.isRec){return false}return this.regex.test(e)}}e.exports.Wildcard=Wildcard},9669:e=>{"use strict";e.exports.defineProperty=(e,t,n,s=true)=>Object.defineProperty(e,t,{value:n,writable:!s});const t=/[?!,.*+[\](){}\\]/g;const escape=e=>e.replace(t,"\\$&");e.exports.escape=escape;e.exports.escapeRegex=e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");e.exports.asRegex=e=>{try{return new RegExp(e)}catch(t){throw new Error(`Invalid Regex: "${e}"`)}};e.exports.toPath=e=>e.reduce(((e,t)=>`${e}${typeof t==="number"?`[${t}]`:`${e?".":""}${escape(t)}`}`),"")},5579:e=>{"use strict";const iterate=(e,t)=>{const n=[e];const s=[null];const r=[];const i=[];const o=[];let a=0;let c=true;while(a!==-1){const e=n[a];if(e instanceof Set){n[a]=[...e];n[a].or=true}else if(Array.isArray(e)){if(e.or!==true){n.splice(a,1,...e);s.splice(a,1,...new Array(e.length).fill(s[a]));if(s[a]!==null){i[s[a]]+=e.length-1}}else{if(r[a]===undefined){r[a]=0;i[a]=0}else if(i[a]!==0){n.splice(a+1,i[a]);s.splice(a+1,i[a]);i[a]=0}if(r[a]<e.length){n.splice(a+1,0,e[r[a]]);s.splice(a+1,0,a);r[a]=(r[a]||0)+1;i[a]+=1;c=true;a+=1}else{r[a]=0;a-=1}}}else if(c===true){o.push(e);t("ADD",e);if(a===n.length-1){t("FIN",o);c=false}else{a+=1}}else{t("RM",o.pop());a-=1}}};e.exports.iterate=iterate},8213:e=>{"use strict";e.exports.traverse=(e,t)=>{const n=[e];const s=[1];let r=0;let i=true;while(n.length!==0){if(i===true){const e=n[n.length-1];t("ENTER",e,r);const o=Object.values(e);if(o.length!==0){n.push(...o);r+=1;s[r]=o.length}else{i=false}}else{const e=n.pop();t("EXIT",e,r);s[r]-=1;if(s[r]===0){s.pop();r-=1}else{i=true}}}}},211:(e,t,n)=>{"use strict";const s=n(2613);const r=n(2502);const i=n(5592);const o=n(6472);e.exports=(e,t={})=>{s(Array.isArray(e));s(t instanceof Object&&!Array.isArray(t));if(e.length===0){return(e,t)=>t===undefined?[]:t}const n=o(t);const a=r.compile(e,n);return(e,t)=>i(e,[a],{context:t,...n,rtn:n.rtn||(t===undefined?"key":"context")})}},5133:(e,t,n)=>{"use strict";const s=n(2081);e.exports=s.ObjectSet},2081:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ObjectSet=void 0;const s=n(1860);const r=s.__importDefault(n(761));const i=Symbol("entries");class ObjectSet extends Set{constructor(e){super();this[i]=[];if(e){for(const t of e){this.add(t)}}}equals(e,t){return(0,r.default)(e,t)}has(e){for(const t of this[i]){if(this.equals(e,t)){return true}}return false}delete(e){for(let t=0;t<this.size;++t){if(this.equals(e,this[i][t])){this[i].splice(t,1);return true}}return false}add(e){if(typeof e!=="undefined"&&!this.has(e)){this[i].push(e)}return this}clear(){this[i]=[]}[Symbol.iterator](){return this[i][Symbol.iterator]()}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}*entries(){for(const e of this[i]){yield[e,e]}}get size(){return this[i].length}forEach(e,t){for(const n of this[i]){if(t){e.call(t,n,n,this)}else{e(n,n,this)}}}}t.ObjectSet=ObjectSet},3298:(e,t,n)=>{"use strict";const s=n(4519);const r=n(8493);const i=n(5206);const o=["","›"];const wrapAnsi=e=>`${o[0]}[${e}m`;const checkAnsi=(e,t,n)=>{let s=[];e=[...e];for(let n of e){const r=n;if(n.includes(";")){n=n.split(";")[0][0]+"0"}const o=i.codes.get(Number.parseInt(n,10));if(o){const n=e.indexOf(o.toString());if(n===-1){s.push(wrapAnsi(t?o:r))}else{e.splice(n,1)}}else if(t){s.push(wrapAnsi(0));break}else{s.push(wrapAnsi(r))}}if(t){s=s.filter(((e,t)=>s.indexOf(e)===t));if(n!==undefined){const e=wrapAnsi(i.codes.get(Number.parseInt(n,10)));s=s.reduce(((t,n)=>n===e?[n,...t]:[...t,n]),[])}}return s.join("")};e.exports=(e,t,n)=>{const i=[...e];const a=[];let c=typeof n==="number"?n:i.length;let l=false;let u;let d=0;let f="";for(const[p,h]of i.entries()){let i=false;if(o.includes(h)){const t=/\d[^m]*/.exec(e.slice(p,p+18));u=t&&t.length>0?t[0]:undefined;if(d<c){l=true;if(u!==undefined){a.push(u)}}}else if(l&&h==="m"){l=false;i=true}if(!l&&!i){d++}if(!r({exact:true}).test(h)&&s(h.codePointAt())){d++;if(typeof n!=="number"){c++}}if(d>t&&d<=c){f+=h}else if(d===t&&!l&&u!==undefined){f=checkAnsi(a)}else if(d>=c){f+=checkAnsi(a,true,u);break}}return f}},5206:(e,t,n)=>{"use strict";e=n.nmd(e);const wrapAnsi16=(e,t)=>(...n)=>{const s=e(...n);return`[${s+t}m`};const wrapAnsi256=(e,t)=>(...n)=>{const s=e(...n);return`[${38+t};5;${s}m`};const wrapAnsi16m=(e,t)=>(...n)=>{const s=e(...n);return`[${38+t};2;${s[0]};${s[1]};${s[2]}m`};const ansi2ansi=e=>e;const rgb2rgb=(e,t,n)=>[e,t,n];const setLazyProperty=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const s=n();Object.defineProperty(e,t,{value:s,enumerable:true,configurable:true});return s},enumerable:true,configurable:true})};let s;const makeDynamicStyles=(e,t,r,i)=>{if(s===undefined){s=n(4185)}const o=i?10:0;const a={};for(const[n,i]of Object.entries(s)){const s=n==="ansi16"?"ansi":n;if(n===t){a[s]=e(r,o)}else if(typeof i==="object"){a[s]=e(i[t],o)}}return a};function assembleStyles(){const e=new Map;const t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright;t.bgColor.bgGray=t.bgColor.bgBlackBright;t.color.grey=t.color.blackBright;t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(const[n,s]of Object.entries(t)){for(const[n,r]of Object.entries(s)){t[n]={open:`[${r[0]}m`,close:`[${r[1]}m`};s[n]=t[n];e.set(r[0],r[1])}Object.defineProperty(t,n,{value:s,enumerable:false})}Object.defineProperty(t,"codes",{value:e,enumerable:false});t.color.close="";t.bgColor.close="";setLazyProperty(t.color,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,false)));setLazyProperty(t.color,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,false)));setLazyProperty(t.color,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,false)));setLazyProperty(t.bgColor,"ansi",(()=>makeDynamicStyles(wrapAnsi16,"ansi16",ansi2ansi,true)));setLazyProperty(t.bgColor,"ansi256",(()=>makeDynamicStyles(wrapAnsi256,"ansi256",ansi2ansi,true)));setLazyProperty(t.bgColor,"ansi16m",(()=>makeDynamicStyles(wrapAnsi16m,"rgb",rgb2rgb,true)));return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},60:(e,t,n)=>{"use strict";const s=n(3958);const r=n(4519);const i=n(872);const stringWidth=e=>{if(typeof e!=="string"||e.length===0){return 0}e=s(e);if(e.length===0){return 0}e=e.replace(i()," ");let t=0;for(let n=0;n<e.length;n++){const s=e.codePointAt(n);if(s<=31||s>=127&&s<=159){continue}if(s>=768&&s<=879){continue}if(s>65535){n++}t+=r(s)?2:1}return t};e.exports=stringWidth;e.exports["default"]=stringWidth},3958:(e,t,n)=>{"use strict";const s=n(21);e.exports=e=>typeof e==="string"?e.replace(s(),""):e},1450:(e,t,n)=>{"use strict";const s=n(857);const r=n(2018);const i=n(3813);const{env:o}=process;let a;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){a=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){a=1}if("FORCE_COLOR"in o){if(o.FORCE_COLOR==="true"){a=1}else if(o.FORCE_COLOR==="false"){a=0}else{a=o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,t){if(a===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!t&&a===undefined){return 0}const n=a||0;if(o.TERM==="dumb"){return n}if(process.platform==="win32"){const e=s.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in o){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in o))||o.CI_NAME==="codeship"){return 1}return n}if("TEAMCITY_VERSION"in o){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0}if(o.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in o){const e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(o.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)){return 1}if("COLORTERM"in o){return 1}return n}function getSupportLevel(e){const t=supportsColor(e,e&&e.isTTY);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,r.isatty(1))),stderr:translateLevel(supportsColor(true,r.isatty(2)))}},2651:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.alignVerticalRangeContent=t.wrapRangeContent=void 0;const r=s(n(60));const i=n(7428);const o=n(8188);const a=n(8649);const c=n(4042);const l=n(1497);const u=n(8966);const wrapRangeContent=(e,t,n)=>{const{topLeft:s,paddingRight:r,paddingLeft:o,truncate:l,wrapWord:d,alignment:f}=e;const p=n.rows[s.row][s.col];const h=t-o-r;return(0,u.wrapCell)((0,c.truncateString)(p,l),h,d).map((e=>{const t=(0,i.alignString)(e,h,f);return(0,a.padString)(t,o,r)}))};t.wrapRangeContent=wrapRangeContent;const alignVerticalRangeContent=(e,t,n)=>{const{rows:s,drawHorizontalLine:i,rowHeights:a}=n;const{topLeft:c,bottomRight:u,verticalAlignment:d}=e;if(a.length===0){return[]}const f=(0,l.sumArray)(a.slice(c.row,u.row+1));const p=u.row-c.row;const h=(0,l.sequence)(c.row+1,u.row).filter((e=>!i(e,s.length))).length;const m=f+p-h;return(0,o.padCellVertically)(t,m,d).map((e=>{if(e.length===0){return" ".repeat((0,r.default)(t[0]))}return e}))};t.alignVerticalRangeContent=alignVerticalRangeContent},7428:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.alignString=void 0;const r=s(n(60));const i=n(1497);const alignLeft=(e,t)=>e+" ".repeat(t);const alignRight=(e,t)=>" ".repeat(t)+e;const alignCenter=(e,t)=>" ".repeat(Math.floor(t/2))+e+" ".repeat(Math.ceil(t/2));const alignJustify=(e,t)=>{const n=(0,i.countSpaceSequence)(e);if(n===0){return alignLeft(e,t)}const s=(0,i.distributeUnevenly)(t,n);if(Math.max(...s)>3){return alignLeft(e,t)}let r=0;return e.replace(/\s+/g,(e=>e+" ".repeat(s[r++])))};const alignString=(e,t,n)=>{const s=(0,r.default)(e);if(s===t){return e}if(s>t){throw new Error("Subject parameter value width cannot be greater than the container width.")}if(s===0){return" ".repeat(t)}const i=t-s;if(n==="left"){return alignLeft(e,i)}if(n==="right"){return alignRight(e,i)}if(n==="justify"){return alignJustify(e,i)}return alignCenter(e,i)};t.alignString=alignString},7061:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.alignTableData=void 0;const s=n(7428);const alignTableData=(e,t)=>e.map(((e,n)=>e.map(((e,r)=>{var i;const{width:o,alignment:a}=t.columns[r];const c=(i=t.spanningCellManager)===null||i===void 0?void 0:i.getContainingRange({col:r,row:n},{mapped:true});if(c){return e}return(0,s.alignString)(e,o,a)}))));t.alignTableData=alignTableData},483:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.calculateCellHeight=void 0;const s=n(8966);const calculateCellHeight=(e,t,n=false)=>(0,s.wrapCell)(e,t,n).length;t.calculateCellHeight=calculateCellHeight},67:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.calculateMaximumColumnWidths=t.calculateMaximumCellWidth=void 0;const r=s(n(60));const i=n(1497);const calculateMaximumCellWidth=e=>Math.max(...e.split("\n").map(r.default));t.calculateMaximumCellWidth=calculateMaximumCellWidth;const calculateMaximumColumnWidths=(e,n=[])=>{const s=new Array(e[0].length).fill(0);const r=n.map(i.calculateRangeCoordinate);const isSpanningCell=(e,t)=>r.some((n=>(0,i.isCellInRange)({col:t,row:e},n)));e.forEach(((e,n)=>{e.forEach(((e,r)=>{if(isSpanningCell(n,r)){return}s[r]=Math.max(s[r],(0,t.calculateMaximumCellWidth)(e))}))}));return s};t.calculateMaximumColumnWidths=calculateMaximumColumnWidths},6246:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.calculateOutputColumnWidths=void 0;const calculateOutputColumnWidths=e=>e.columns.map((e=>e.paddingLeft+e.width+e.paddingRight));t.calculateOutputColumnWidths=calculateOutputColumnWidths},2696:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.calculateRowHeights=void 0;const s=n(483);const r=n(1497);const calculateRowHeights=(e,t)=>{const n=[];for(const[i,o]of e.entries()){let a=1;o.forEach(((o,c)=>{var l;const u=(l=t.spanningCellManager)===null||l===void 0?void 0:l.getContainingRange({col:c,row:i});if(!u){const e=(0,s.calculateCellHeight)(o,t.columns[c].width,t.columns[c].wrapWord);a=Math.max(a,e);return}const{topLeft:d,bottomRight:f,height:p}=u;if(i===f.row){const s=(0,r.sumArray)(n.slice(d.row));const i=f.row-d.row;const o=(0,r.sequence)(d.row+1,f.row).filter((n=>{var s;return!((s=t.drawHorizontalLine)===null||s===void 0?void 0:s.call(t,n,e.length))})).length;const c=p-s-i+o;a=Math.max(a,c)}}));n.push(a)}return n};t.calculateRowHeights=calculateRowHeights},888:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.calculateSpanningCellWidth=void 0;const s=n(1497);const calculateSpanningCellWidth=(e,t)=>{const{columnsConfig:n,drawVerticalLine:r}=t;const{topLeft:i,bottomRight:o}=e;const a=(0,s.sumArray)(n.slice(i.col,o.col+1).map((({width:e})=>e)));const c=i.col===o.col?n[i.col].paddingRight+n[o.col].paddingLeft:(0,s.sumArray)(n.slice(i.col,o.col+1).map((({paddingLeft:e,paddingRight:t})=>e+t)));const l=o.col-i.col;const u=(0,s.sequence)(i.col+1,o.col).filter((e=>!r(e,n.length))).length;return a+c+l-u};t.calculateSpanningCellWidth=calculateSpanningCellWidth},6334:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createStream=void 0;const s=n(7061);const r=n(2696);const i=n(46);const o=n(2698);const a=n(7366);const c=n(8188);const l=n(8649);const u=n(3337);const d=n(4042);const f=n(1497);const prepareData=(e,t)=>{let n=(0,u.stringifyTableData)(e);n=(0,d.truncateTableData)(n,(0,f.extractTruncates)(t));const i=(0,r.calculateRowHeights)(n,t);n=(0,c.mapDataUsingRowHeights)(n,i,t);n=(0,s.alignTableData)(n,t);n=(0,l.padTableData)(n,t);return n};const create=(e,t,n)=>{const s=prepareData([e],n);const r=s.map((e=>(0,o.drawRow)(e,n))).join("");let a;a="";a+=(0,i.drawBorderTop)(t,n);a+=r;a+=(0,i.drawBorderBottom)(t,n);a=a.trimEnd();process.stdout.write(a)};const append=(e,t,n)=>{const s=prepareData([e],n);const r=s.map((e=>(0,o.drawRow)(e,n))).join("");let a="";const c=(0,i.drawBorderBottom)(t,n);if(c!=="\n"){a="\r"}a+=(0,i.drawBorderJoin)(t,n);a+=r;a+=c;a=a.trimEnd();process.stdout.write(a)};const createStream=e=>{const t=(0,a.makeStreamConfig)(e);const n=Object.values(t.columns).map((e=>e.width+e.paddingLeft+e.paddingRight));let s=true;return{write:e=>{if(e.length!==t.columnCount){throw new Error("Row cell count does not match the config.columnCount.")}if(s){s=false;create(e,n,t)}else{append(e,n,t)}}}};t.createStream=createStream},46:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createTableBorderGetter=t.drawBorderBottom=t.drawBorderJoin=t.drawBorderTop=t.drawBorder=t.createSeparatorGetter=t.drawBorderSegments=void 0;const s=n(6499);const drawBorderSegments=(e,t)=>{const{separator:n,horizontalBorderIndex:s,spanningCellManager:r}=t;return e.map(((e,t)=>{const i=n.body.repeat(e);if(s===undefined){return i}const o=r===null||r===void 0?void 0:r.getContainingRange({col:t,row:s});if(!o){return i}const{topLeft:a}=o;if(s===a.row){return i}if(t!==a.col){return""}return o.extractBorderContent(s)}))};t.drawBorderSegments=drawBorderSegments;const createSeparatorGetter=e=>{const{separator:t,spanningCellManager:n,horizontalBorderIndex:s,rowCount:r}=e;return(e,i)=>{const o=n===null||n===void 0?void 0:n.inSameRange;if(s!==undefined&&o){const n={col:e,row:s-1};const a={col:e-1,row:s};const c={col:e-1,row:s-1};const l={col:e,row:s};const u=[[c,n],[n,l],[l,a],[a,c]];if(e===0){if(o(l,n)&&t.bodyJoinOuter){return t.bodyJoinOuter}return t.left}if(e===i){if(o(c,a)&&t.bodyJoinOuter){return t.bodyJoinOuter}return t.right}if(s===0){if(o(l,a)){return t.body}return t.join}if(s===r){if(o(n,c)){return t.body}return t.join}const d=u.map((e=>o(...e))).filter(Boolean).length;if(d===0){return t.join}if(d===4){return""}if(d===2){if(o(...u[1])&&o(...u[3])&&t.bodyJoinInner){return t.bodyJoinInner}return t.body}if(d===1){if(!t.joinRight||!t.joinLeft||!t.joinUp||!t.joinDown){throw new Error(`Can not get border separator for position [${s}, ${e}]`)}if(o(...u[0])){return t.joinDown}if(o(...u[1])){return t.joinLeft}if(o(...u[2])){return t.joinUp}return t.joinRight}throw new Error("Invalid case")}if(e===0){return t.left}if(e===i){return t.right}return t.join}};t.createSeparatorGetter=createSeparatorGetter;const drawBorder=(e,n)=>{const r=(0,t.drawBorderSegments)(e,n);const{drawVerticalLine:i,horizontalBorderIndex:o,spanningCellManager:a}=n;return(0,s.drawContent)({contents:r,drawSeparator:i,elementType:"border",rowIndex:o,separatorGetter:(0,t.createSeparatorGetter)(n),spanningCellManager:a})+"\n"};t.drawBorder=drawBorder;const drawBorderTop=(e,n)=>{const{border:s}=n;const r=(0,t.drawBorder)(e,{...n,separator:{body:s.topBody,join:s.topJoin,left:s.topLeft,right:s.topRight}});if(r==="\n"){return""}return r};t.drawBorderTop=drawBorderTop;const drawBorderJoin=(e,n)=>{const{border:s}=n;return(0,t.drawBorder)(e,{...n,separator:{body:s.joinBody,bodyJoinInner:s.bodyJoin,bodyJoinOuter:s.bodyLeft,join:s.joinJoin,joinDown:s.joinMiddleDown,joinLeft:s.joinMiddleLeft,joinRight:s.joinMiddleRight,joinUp:s.joinMiddleUp,left:s.joinLeft,right:s.joinRight}})};t.drawBorderJoin=drawBorderJoin;const drawBorderBottom=(e,n)=>{const{border:s}=n;return(0,t.drawBorder)(e,{...n,separator:{body:s.bottomBody,join:s.bottomJoin,left:s.bottomLeft,right:s.bottomRight}})};t.drawBorderBottom=drawBorderBottom;const createTableBorderGetter=(e,n)=>(s,r)=>{const i={...n,horizontalBorderIndex:s};if(s===0){return(0,t.drawBorderTop)(e,i)}else if(s===r){return(0,t.drawBorderBottom)(e,i)}return(0,t.drawBorderJoin)(e,i)};t.createTableBorderGetter=createTableBorderGetter},6499:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.drawContent=void 0;const drawContent=e=>{const{contents:t,separatorGetter:n,drawSeparator:s,spanningCellManager:r,rowIndex:i,elementType:o}=e;const a=t.length;const c=[];if(s(0,a)){c.push(n(0,a))}t.forEach(((e,t)=>{if(!o||o==="border"||o==="row"){c.push(e)}if(o==="cell"&&i===undefined){c.push(e)}if(o==="cell"&&i!==undefined){const n=r===null||r===void 0?void 0:r.getContainingRange({col:t,row:i});if(!n||t===n.topLeft.col){c.push(e)}}if(t+1<a&&s(t+1,a)){const e=n(t+1,a);if(o==="cell"&&i!==undefined){const n={col:t+1,row:i};const s=r===null||r===void 0?void 0:r.getContainingRange(n);if(!s||s.topLeft.col===n.col){c.push(e)}}else{c.push(e)}}}));if(s(a,a)){c.push(n(a,a))}return c.join("")};t.drawContent=drawContent},2698:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.drawRow=void 0;const s=n(6499);const drawRow=(e,t)=>{const{border:n,drawVerticalLine:r,rowIndex:i,spanningCellManager:o}=t;return(0,s.drawContent)({contents:e,drawSeparator:r,elementType:"cell",rowIndex:i,separatorGetter:(e,t)=>{if(e===0){return n.bodyLeft}if(e===t){return n.bodyRight}return n.bodyJoin},spanningCellManager:o})+"\n"};t.drawRow=drawRow},7910:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.drawTable=void 0;const s=n(46);const r=n(6499);const i=n(2698);const o=n(1497);const drawTable=(e,t,n,a)=>{const{drawHorizontalLine:c,singleLine:l}=a;const u=(0,o.groupBySizes)(e,n).map(((e,t)=>e.map((e=>(0,i.drawRow)(e,{...a,rowIndex:t}))).join("")));return(0,r.drawContent)({contents:u,drawSeparator:(e,t)=>{if(e===0||e===t){return c(e,t)}return!l&&c(e,t)},elementType:"row",rowIndex:-1,separatorGetter:(0,s.createTableBorderGetter)(t,{...a,rowCount:u.length}),spanningCellManager:a.spanningCellManager})};t.drawTable=drawTable},1423:(e,t,n)=>{"use strict";t["config.json"]=validate43;const s={$id:"config.json",$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{border:{$ref:"shared.json#/definitions/borders"},header:{type:"object",properties:{content:{type:"string"},alignment:{$ref:"shared.json#/definitions/alignment"},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},required:["content"],additionalProperties:false},columns:{$ref:"shared.json#/definitions/columns"},columnDefault:{$ref:"shared.json#/definitions/column"},drawVerticalLine:{typeof:"function"},drawHorizontalLine:{typeof:"function"},singleLine:{typeof:"boolean"},spanningCells:{type:"array",items:{type:"object",properties:{col:{type:"integer",minimum:0},row:{type:"integer",minimum:0},colSpan:{type:"integer",minimum:1},rowSpan:{type:"integer",minimum:1},alignment:{$ref:"shared.json#/definitions/alignment"},verticalAlignment:{$ref:"shared.json#/definitions/verticalAlignment"},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},required:["row","col"],additionalProperties:false}}},additionalProperties:false};const r={type:"object",properties:{topBody:{$ref:"#/definitions/border"},topJoin:{$ref:"#/definitions/border"},topLeft:{$ref:"#/definitions/border"},topRight:{$ref:"#/definitions/border"},bottomBody:{$ref:"#/definitions/border"},bottomJoin:{$ref:"#/definitions/border"},bottomLeft:{$ref:"#/definitions/border"},bottomRight:{$ref:"#/definitions/border"},bodyLeft:{$ref:"#/definitions/border"},bodyRight:{$ref:"#/definitions/border"},bodyJoin:{$ref:"#/definitions/border"},headerJoin:{$ref:"#/definitions/border"},joinBody:{$ref:"#/definitions/border"},joinLeft:{$ref:"#/definitions/border"},joinRight:{$ref:"#/definitions/border"},joinJoin:{$ref:"#/definitions/border"},joinMiddleUp:{$ref:"#/definitions/border"},joinMiddleDown:{$ref:"#/definitions/border"},joinMiddleLeft:{$ref:"#/definitions/border"},joinMiddleRight:{$ref:"#/definitions/border"}},additionalProperties:false};const i=Object.prototype.hasOwnProperty;const o={type:"string"};function validate46(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(typeof e!=="string"){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};if(i===null){i=[e]}else{i.push(e)}o++}validate46.errors=i;return o===0}function validate45(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:o=e}={}){let a=null;let c=0;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!i.call(r.properties,n)){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.topBody!==undefined){if(!validate46(e.topBody,{instancePath:t+"/topBody",parentData:e,parentDataProperty:"topBody",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.topJoin!==undefined){if(!validate46(e.topJoin,{instancePath:t+"/topJoin",parentData:e,parentDataProperty:"topJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.topLeft!==undefined){if(!validate46(e.topLeft,{instancePath:t+"/topLeft",parentData:e,parentDataProperty:"topLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.topRight!==undefined){if(!validate46(e.topRight,{instancePath:t+"/topRight",parentData:e,parentDataProperty:"topRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomBody!==undefined){if(!validate46(e.bottomBody,{instancePath:t+"/bottomBody",parentData:e,parentDataProperty:"bottomBody",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomJoin!==undefined){if(!validate46(e.bottomJoin,{instancePath:t+"/bottomJoin",parentData:e,parentDataProperty:"bottomJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomLeft!==undefined){if(!validate46(e.bottomLeft,{instancePath:t+"/bottomLeft",parentData:e,parentDataProperty:"bottomLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomRight!==undefined){if(!validate46(e.bottomRight,{instancePath:t+"/bottomRight",parentData:e,parentDataProperty:"bottomRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bodyLeft!==undefined){if(!validate46(e.bodyLeft,{instancePath:t+"/bodyLeft",parentData:e,parentDataProperty:"bodyLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bodyRight!==undefined){if(!validate46(e.bodyRight,{instancePath:t+"/bodyRight",parentData:e,parentDataProperty:"bodyRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bodyJoin!==undefined){if(!validate46(e.bodyJoin,{instancePath:t+"/bodyJoin",parentData:e,parentDataProperty:"bodyJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.headerJoin!==undefined){if(!validate46(e.headerJoin,{instancePath:t+"/headerJoin",parentData:e,parentDataProperty:"headerJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinBody!==undefined){if(!validate46(e.joinBody,{instancePath:t+"/joinBody",parentData:e,parentDataProperty:"joinBody",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinLeft!==undefined){if(!validate46(e.joinLeft,{instancePath:t+"/joinLeft",parentData:e,parentDataProperty:"joinLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinRight!==undefined){if(!validate46(e.joinRight,{instancePath:t+"/joinRight",parentData:e,parentDataProperty:"joinRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinJoin!==undefined){if(!validate46(e.joinJoin,{instancePath:t+"/joinJoin",parentData:e,parentDataProperty:"joinJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleUp!==undefined){if(!validate46(e.joinMiddleUp,{instancePath:t+"/joinMiddleUp",parentData:e,parentDataProperty:"joinMiddleUp",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleDown!==undefined){if(!validate46(e.joinMiddleDown,{instancePath:t+"/joinMiddleDown",parentData:e,parentDataProperty:"joinMiddleDown",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleLeft!==undefined){if(!validate46(e.joinMiddleLeft,{instancePath:t+"/joinMiddleLeft",parentData:e,parentDataProperty:"joinMiddleLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleRight!==undefined){if(!validate46(e.joinMiddleRight,{instancePath:t+"/joinMiddleRight",parentData:e,parentDataProperty:"joinMiddleRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(a===null){a=[e]}else{a.push(e)}c++}validate45.errors=a;return c===0}const a={type:"string",enum:["left","right","center","justify"]};const c=n(4951).A;function validate68(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(typeof e!=="string"){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};if(i===null){i=[e]}else{i.push(e)}o++}if(!(e==="left"||e==="right"||e==="center"||e==="justify")){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:a.enum},message:"must be equal to one of the allowed values"};if(i===null){i=[e]}else{i.push(e)}o++}validate68.errors=i;return o===0}const l={oneOf:[{type:"object",patternProperties:{"^[0-9]+$":{$ref:"#/definitions/column"}},additionalProperties:false},{type:"array",items:{$ref:"#/definitions/column"}}]};const u=new RegExp("^[0-9]+$","u");const d={type:"object",properties:{alignment:{$ref:"#/definitions/alignment"},verticalAlignment:{$ref:"#/definitions/verticalAlignment"},width:{type:"integer",minimum:1},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},additionalProperties:false};function validate72(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(typeof e!=="string"){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};if(i===null){i=[e]}else{i.push(e)}o++}if(!(e==="left"||e==="right"||e==="center"||e==="justify")){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:a.enum},message:"must be equal to one of the allowed values"};if(i===null){i=[e]}else{i.push(e)}o++}validate72.errors=i;return o===0}const f={type:"string",enum:["top","middle","bottom"]};function validate74(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(typeof e!=="string"){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};if(i===null){i=[e]}else{i.push(e)}o++}if(!(e==="top"||e==="middle"||e==="bottom")){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:f.enum},message:"must be equal to one of the allowed values"};if(i===null){i=[e]}else{i.push(e)}o++}validate74.errors=i;return o===0}function validate71(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!(n==="alignment"||n==="verticalAlignment"||n==="width"||n==="wrapWord"||n==="truncate"||n==="paddingLeft"||n==="paddingRight")){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.alignment!==undefined){if(!validate72(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:r})){i=i===null?validate72.errors:i.concat(validate72.errors);o=i.length}}if(e.verticalAlignment!==undefined){if(!validate74(e.verticalAlignment,{instancePath:t+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:r})){i=i===null?validate74.errors:i.concat(validate74.errors);o=i.length}}if(e.width!==undefined){let n=e.width;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}if(typeof n=="number"&&isFinite(n)){if(n<1||isNaN(n)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};if(i===null){i=[e]}else{i.push(e)}o++}}}if(e.wrapWord!==undefined){if(typeof e.wrapWord!=="boolean"){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.truncate!==undefined){let n=e.truncate;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.paddingLeft!==undefined){let n=e.paddingLeft;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.paddingRight!==undefined){let n=e.paddingRight;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(i===null){i=[e]}else{i.push(e)}o++}validate71.errors=i;return o===0}function validate70(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;const a=o;let c=false;let l=null;const d=o;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!u.test(n)){const e={instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(i===null){i=[e]}else{i.push(e)}o++}}for(const n in e){if(u.test(n)){if(!validate71(e[n],{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:r})){i=i===null?validate71.errors:i.concat(validate71.errors);o=i.length}}}}else{const e={instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};if(i===null){i=[e]}else{i.push(e)}o++}var f=d===o;if(f){c=true;l=0}const p=o;if(Array.isArray(e)){const n=e.length;for(let s=0;s<n;s++){if(!validate71(e[s],{instancePath:t+"/"+s,parentData:e,parentDataProperty:s,rootData:r})){i=i===null?validate71.errors:i.concat(validate71.errors);o=i.length}}}else{const e={instancePath:t,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};if(i===null){i=[e]}else{i.push(e)}o++}var f=p===o;if(f&&c){c=false;l=[l,1]}else{if(f){c=true;l=1}}if(!c){const e={instancePath:t,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas:l},message:"must match exactly one schema in oneOf"};if(i===null){i=[e]}else{i.push(e)}o++}else{o=a;if(i!==null){if(a){i.length=a}else{i=null}}}validate70.errors=i;return o===0}function validate79(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!(n==="alignment"||n==="verticalAlignment"||n==="width"||n==="wrapWord"||n==="truncate"||n==="paddingLeft"||n==="paddingRight")){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.alignment!==undefined){if(!validate72(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:r})){i=i===null?validate72.errors:i.concat(validate72.errors);o=i.length}}if(e.verticalAlignment!==undefined){if(!validate74(e.verticalAlignment,{instancePath:t+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:r})){i=i===null?validate74.errors:i.concat(validate74.errors);o=i.length}}if(e.width!==undefined){let n=e.width;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}if(typeof n=="number"&&isFinite(n)){if(n<1||isNaN(n)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};if(i===null){i=[e]}else{i.push(e)}o++}}}if(e.wrapWord!==undefined){if(typeof e.wrapWord!=="boolean"){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.truncate!==undefined){let n=e.truncate;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.paddingLeft!==undefined){let n=e.paddingLeft;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.paddingRight!==undefined){let n=e.paddingRight;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(i===null){i=[e]}else{i.push(e)}o++}validate79.errors=i;return o===0}function validate84(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(typeof e!=="string"){const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};if(i===null){i=[e]}else{i.push(e)}o++}if(!(e==="top"||e==="middle"||e==="bottom")){const e={instancePath:t,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:f.enum},message:"must be equal to one of the allowed values"};if(i===null){i=[e]}else{i.push(e)}o++}validate84.errors=i;return o===0}function validate43(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let a=null;let c=0;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!(n==="border"||n==="header"||n==="columns"||n==="columnDefault"||n==="drawVerticalLine"||n==="drawHorizontalLine"||n==="singleLine"||n==="spanningCells")){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.border!==undefined){if(!validate45(e.border,{instancePath:t+"/border",parentData:e,parentDataProperty:"border",rootData:o})){a=a===null?validate45.errors:a.concat(validate45.errors);c=a.length}}if(e.header!==undefined){let n=e.header;if(n&&typeof n=="object"&&!Array.isArray(n)){if(n.content===undefined){const e={instancePath:t+"/header",schemaPath:"#/properties/header/required",keyword:"required",params:{missingProperty:"content"},message:"must have required property '"+"content"+"'"};if(a===null){a=[e]}else{a.push(e)}c++}for(const e in n){if(!(e==="content"||e==="alignment"||e==="wrapWord"||e==="truncate"||e==="paddingLeft"||e==="paddingRight")){const n={instancePath:t+"/header",schemaPath:"#/properties/header/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:e},message:"must NOT have additional properties"};if(a===null){a=[n]}else{a.push(n)}c++}}if(n.content!==undefined){if(typeof n.content!=="string"){const e={instancePath:t+"/header/content",schemaPath:"#/properties/header/properties/content/type",keyword:"type",params:{type:"string"},message:"must be string"};if(a===null){a=[e]}else{a.push(e)}c++}}if(n.alignment!==undefined){if(!validate68(n.alignment,{instancePath:t+"/header/alignment",parentData:n,parentDataProperty:"alignment",rootData:o})){a=a===null?validate68.errors:a.concat(validate68.errors);c=a.length}}if(n.wrapWord!==undefined){if(typeof n.wrapWord!=="boolean"){const e={instancePath:t+"/header/wrapWord",schemaPath:"#/properties/header/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};if(a===null){a=[e]}else{a.push(e)}c++}}if(n.truncate!==undefined){let e=n.truncate;if(!(typeof e=="number"&&(!(e%1)&&!isNaN(e))&&isFinite(e))){const e={instancePath:t+"/header/truncate",schemaPath:"#/properties/header/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}}if(n.paddingLeft!==undefined){let e=n.paddingLeft;if(!(typeof e=="number"&&(!(e%1)&&!isNaN(e))&&isFinite(e))){const e={instancePath:t+"/header/paddingLeft",schemaPath:"#/properties/header/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}}if(n.paddingRight!==undefined){let e=n.paddingRight;if(!(typeof e=="number"&&(!(e%1)&&!isNaN(e))&&isFinite(e))){const e={instancePath:t+"/header/paddingRight",schemaPath:"#/properties/header/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}}}else{const e={instancePath:t+"/header",schemaPath:"#/properties/header/type",keyword:"type",params:{type:"object"},message:"must be object"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.columns!==undefined){if(!validate70(e.columns,{instancePath:t+"/columns",parentData:e,parentDataProperty:"columns",rootData:o})){a=a===null?validate70.errors:a.concat(validate70.errors);c=a.length}}if(e.columnDefault!==undefined){if(!validate79(e.columnDefault,{instancePath:t+"/columnDefault",parentData:e,parentDataProperty:"columnDefault",rootData:o})){a=a===null?validate79.errors:a.concat(validate79.errors);c=a.length}}if(e.drawVerticalLine!==undefined){if(typeof e.drawVerticalLine!="function"){const e={instancePath:t+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.drawHorizontalLine!==undefined){if(typeof e.drawHorizontalLine!="function"){const e={instancePath:t+"/drawHorizontalLine",schemaPath:"#/properties/drawHorizontalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.singleLine!==undefined){if(typeof e.singleLine!="boolean"){const e={instancePath:t+"/singleLine",schemaPath:"#/properties/singleLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.spanningCells!==undefined){let n=e.spanningCells;if(Array.isArray(n)){const e=n.length;for(let r=0;r<e;r++){let e=n[r];if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.row===undefined){const e={instancePath:t+"/spanningCells/"+r,schemaPath:"#/properties/spanningCells/items/required",keyword:"required",params:{missingProperty:"row"},message:"must have required property '"+"row"+"'"};if(a===null){a=[e]}else{a.push(e)}c++}if(e.col===undefined){const e={instancePath:t+"/spanningCells/"+r,schemaPath:"#/properties/spanningCells/items/required",keyword:"required",params:{missingProperty:"col"},message:"must have required property '"+"col"+"'"};if(a===null){a=[e]}else{a.push(e)}c++}for(const n in e){if(!i.call(s.properties.spanningCells.items.properties,n)){const e={instancePath:t+"/spanningCells/"+r,schemaPath:"#/properties/spanningCells/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.col!==undefined){let n=e.col;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/col",schemaPath:"#/properties/spanningCells/items/properties/col/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}if(typeof n=="number"&&isFinite(n)){if(n<0||isNaN(n)){const e={instancePath:t+"/spanningCells/"+r+"/col",schemaPath:"#/properties/spanningCells/items/properties/col/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};if(a===null){a=[e]}else{a.push(e)}c++}}}if(e.row!==undefined){let n=e.row;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/row",schemaPath:"#/properties/spanningCells/items/properties/row/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}if(typeof n=="number"&&isFinite(n)){if(n<0||isNaN(n)){const e={instancePath:t+"/spanningCells/"+r+"/row",schemaPath:"#/properties/spanningCells/items/properties/row/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};if(a===null){a=[e]}else{a.push(e)}c++}}}if(e.colSpan!==undefined){let n=e.colSpan;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/colSpan",schemaPath:"#/properties/spanningCells/items/properties/colSpan/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}if(typeof n=="number"&&isFinite(n)){if(n<1||isNaN(n)){const e={instancePath:t+"/spanningCells/"+r+"/colSpan",schemaPath:"#/properties/spanningCells/items/properties/colSpan/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};if(a===null){a=[e]}else{a.push(e)}c++}}}if(e.rowSpan!==undefined){let n=e.rowSpan;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/rowSpan",schemaPath:"#/properties/spanningCells/items/properties/rowSpan/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}if(typeof n=="number"&&isFinite(n)){if(n<1||isNaN(n)){const e={instancePath:t+"/spanningCells/"+r+"/rowSpan",schemaPath:"#/properties/spanningCells/items/properties/rowSpan/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};if(a===null){a=[e]}else{a.push(e)}c++}}}if(e.alignment!==undefined){if(!validate68(e.alignment,{instancePath:t+"/spanningCells/"+r+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:o})){a=a===null?validate68.errors:a.concat(validate68.errors);c=a.length}}if(e.verticalAlignment!==undefined){if(!validate84(e.verticalAlignment,{instancePath:t+"/spanningCells/"+r+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:o})){a=a===null?validate84.errors:a.concat(validate84.errors);c=a.length}}if(e.wrapWord!==undefined){if(typeof e.wrapWord!=="boolean"){const e={instancePath:t+"/spanningCells/"+r+"/wrapWord",schemaPath:"#/properties/spanningCells/items/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.truncate!==undefined){let n=e.truncate;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/truncate",schemaPath:"#/properties/spanningCells/items/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.paddingLeft!==undefined){let n=e.paddingLeft;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/paddingLeft",schemaPath:"#/properties/spanningCells/items/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.paddingRight!==undefined){let n=e.paddingRight;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/spanningCells/"+r+"/paddingRight",schemaPath:"#/properties/spanningCells/items/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(a===null){a=[e]}else{a.push(e)}c++}}}else{const e={instancePath:t+"/spanningCells/"+r,schemaPath:"#/properties/spanningCells/items/type",keyword:"type",params:{type:"object"},message:"must be object"};if(a===null){a=[e]}else{a.push(e)}c++}}}else{const e={instancePath:t+"/spanningCells",schemaPath:"#/properties/spanningCells/type",keyword:"type",params:{type:"array"},message:"must be array"};if(a===null){a=[e]}else{a.push(e)}c++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(a===null){a=[e]}else{a.push(e)}c++}validate43.errors=a;return c===0}t["streamConfig.json"]=validate86;const p={$id:"streamConfig.json",$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{border:{$ref:"shared.json#/definitions/borders"},columns:{$ref:"shared.json#/definitions/columns"},columnDefault:{$ref:"shared.json#/definitions/column"},columnCount:{type:"integer",minimum:1},drawVerticalLine:{typeof:"function"}},required:["columnDefault","columnCount"],additionalProperties:false};function validate87(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:o=e}={}){let a=null;let c=0;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!i.call(r.properties,n)){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(a===null){a=[e]}else{a.push(e)}c++}}if(e.topBody!==undefined){if(!validate46(e.topBody,{instancePath:t+"/topBody",parentData:e,parentDataProperty:"topBody",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.topJoin!==undefined){if(!validate46(e.topJoin,{instancePath:t+"/topJoin",parentData:e,parentDataProperty:"topJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.topLeft!==undefined){if(!validate46(e.topLeft,{instancePath:t+"/topLeft",parentData:e,parentDataProperty:"topLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.topRight!==undefined){if(!validate46(e.topRight,{instancePath:t+"/topRight",parentData:e,parentDataProperty:"topRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomBody!==undefined){if(!validate46(e.bottomBody,{instancePath:t+"/bottomBody",parentData:e,parentDataProperty:"bottomBody",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomJoin!==undefined){if(!validate46(e.bottomJoin,{instancePath:t+"/bottomJoin",parentData:e,parentDataProperty:"bottomJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomLeft!==undefined){if(!validate46(e.bottomLeft,{instancePath:t+"/bottomLeft",parentData:e,parentDataProperty:"bottomLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bottomRight!==undefined){if(!validate46(e.bottomRight,{instancePath:t+"/bottomRight",parentData:e,parentDataProperty:"bottomRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bodyLeft!==undefined){if(!validate46(e.bodyLeft,{instancePath:t+"/bodyLeft",parentData:e,parentDataProperty:"bodyLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bodyRight!==undefined){if(!validate46(e.bodyRight,{instancePath:t+"/bodyRight",parentData:e,parentDataProperty:"bodyRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.bodyJoin!==undefined){if(!validate46(e.bodyJoin,{instancePath:t+"/bodyJoin",parentData:e,parentDataProperty:"bodyJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.headerJoin!==undefined){if(!validate46(e.headerJoin,{instancePath:t+"/headerJoin",parentData:e,parentDataProperty:"headerJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinBody!==undefined){if(!validate46(e.joinBody,{instancePath:t+"/joinBody",parentData:e,parentDataProperty:"joinBody",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinLeft!==undefined){if(!validate46(e.joinLeft,{instancePath:t+"/joinLeft",parentData:e,parentDataProperty:"joinLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinRight!==undefined){if(!validate46(e.joinRight,{instancePath:t+"/joinRight",parentData:e,parentDataProperty:"joinRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinJoin!==undefined){if(!validate46(e.joinJoin,{instancePath:t+"/joinJoin",parentData:e,parentDataProperty:"joinJoin",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleUp!==undefined){if(!validate46(e.joinMiddleUp,{instancePath:t+"/joinMiddleUp",parentData:e,parentDataProperty:"joinMiddleUp",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleDown!==undefined){if(!validate46(e.joinMiddleDown,{instancePath:t+"/joinMiddleDown",parentData:e,parentDataProperty:"joinMiddleDown",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleLeft!==undefined){if(!validate46(e.joinMiddleLeft,{instancePath:t+"/joinMiddleLeft",parentData:e,parentDataProperty:"joinMiddleLeft",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}if(e.joinMiddleRight!==undefined){if(!validate46(e.joinMiddleRight,{instancePath:t+"/joinMiddleRight",parentData:e,parentDataProperty:"joinMiddleRight",rootData:o})){a=a===null?validate46.errors:a.concat(validate46.errors);c=a.length}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(a===null){a=[e]}else{a.push(e)}c++}validate87.errors=a;return c===0}function validate109(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;const a=o;let c=false;let l=null;const d=o;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!u.test(n)){const e={instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(i===null){i=[e]}else{i.push(e)}o++}}for(const n in e){if(u.test(n)){if(!validate71(e[n],{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:r})){i=i===null?validate71.errors:i.concat(validate71.errors);o=i.length}}}}else{const e={instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};if(i===null){i=[e]}else{i.push(e)}o++}var f=d===o;if(f){c=true;l=0}const p=o;if(Array.isArray(e)){const n=e.length;for(let s=0;s<n;s++){if(!validate71(e[s],{instancePath:t+"/"+s,parentData:e,parentDataProperty:s,rootData:r})){i=i===null?validate71.errors:i.concat(validate71.errors);o=i.length}}}else{const e={instancePath:t,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};if(i===null){i=[e]}else{i.push(e)}o++}var f=p===o;if(f&&c){c=false;l=[l,1]}else{if(f){c=true;l=1}}if(!c){const e={instancePath:t,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas:l},message:"must match exactly one schema in oneOf"};if(i===null){i=[e]}else{i.push(e)}o++}else{o=a;if(i!==null){if(a){i.length=a}else{i=null}}}validate109.errors=i;return o===0}function validate113(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(e&&typeof e=="object"&&!Array.isArray(e)){for(const n in e){if(!(n==="alignment"||n==="verticalAlignment"||n==="width"||n==="wrapWord"||n==="truncate"||n==="paddingLeft"||n==="paddingRight")){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.alignment!==undefined){if(!validate72(e.alignment,{instancePath:t+"/alignment",parentData:e,parentDataProperty:"alignment",rootData:r})){i=i===null?validate72.errors:i.concat(validate72.errors);o=i.length}}if(e.verticalAlignment!==undefined){if(!validate74(e.verticalAlignment,{instancePath:t+"/verticalAlignment",parentData:e,parentDataProperty:"verticalAlignment",rootData:r})){i=i===null?validate74.errors:i.concat(validate74.errors);o=i.length}}if(e.width!==undefined){let n=e.width;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}if(typeof n=="number"&&isFinite(n)){if(n<1||isNaN(n)){const e={instancePath:t+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};if(i===null){i=[e]}else{i.push(e)}o++}}}if(e.wrapWord!==undefined){if(typeof e.wrapWord!=="boolean"){const e={instancePath:t+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.truncate!==undefined){let n=e.truncate;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.paddingLeft!==undefined){let n=e.paddingLeft;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.paddingRight!==undefined){let n=e.paddingRight;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(i===null){i=[e]}else{i.push(e)}o++}validate113.errors=i;return o===0}function validate86(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:r=e}={}){let i=null;let o=0;if(e&&typeof e=="object"&&!Array.isArray(e)){if(e.columnDefault===undefined){const e={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnDefault"},message:"must have required property '"+"columnDefault"+"'"};if(i===null){i=[e]}else{i.push(e)}o++}if(e.columnCount===undefined){const e={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnCount"},message:"must have required property '"+"columnCount"+"'"};if(i===null){i=[e]}else{i.push(e)}o++}for(const n in e){if(!(n==="border"||n==="columns"||n==="columnDefault"||n==="columnCount"||n==="drawVerticalLine")){const e={instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:n},message:"must NOT have additional properties"};if(i===null){i=[e]}else{i.push(e)}o++}}if(e.border!==undefined){if(!validate87(e.border,{instancePath:t+"/border",parentData:e,parentDataProperty:"border",rootData:r})){i=i===null?validate87.errors:i.concat(validate87.errors);o=i.length}}if(e.columns!==undefined){if(!validate109(e.columns,{instancePath:t+"/columns",parentData:e,parentDataProperty:"columns",rootData:r})){i=i===null?validate109.errors:i.concat(validate109.errors);o=i.length}}if(e.columnDefault!==undefined){if(!validate113(e.columnDefault,{instancePath:t+"/columnDefault",parentData:e,parentDataProperty:"columnDefault",rootData:r})){i=i===null?validate113.errors:i.concat(validate113.errors);o=i.length}}if(e.columnCount!==undefined){let n=e.columnCount;if(!(typeof n=="number"&&(!(n%1)&&!isNaN(n))&&isFinite(n))){const e={instancePath:t+"/columnCount",schemaPath:"#/properties/columnCount/type",keyword:"type",params:{type:"integer"},message:"must be integer"};if(i===null){i=[e]}else{i.push(e)}o++}if(typeof n=="number"&&isFinite(n)){if(n<1||isNaN(n)){const e={instancePath:t+"/columnCount",schemaPath:"#/properties/columnCount/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};if(i===null){i=[e]}else{i.push(e)}o++}}}if(e.drawVerticalLine!==undefined){if(typeof e.drawVerticalLine!="function"){const e={instancePath:t+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};if(i===null){i=[e]}else{i.push(e)}o++}}}else{const e={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};if(i===null){i=[e]}else{i.push(e)}o++}validate86.errors=i;return o===0}},5966:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getBorderCharacters=void 0;const getBorderCharacters=e=>{if(e==="honeywell"){return{topBody:"═",topJoin:"╤",topLeft:"╔",topRight:"╗",bottomBody:"═",bottomJoin:"╧",bottomLeft:"╚",bottomRight:"╝",bodyLeft:"║",bodyRight:"║",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"╟",joinRight:"╢",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"}}if(e==="norc"){return{topBody:"─",topJoin:"┬",topLeft:"┌",topRight:"┐",bottomBody:"─",bottomJoin:"┴",bottomLeft:"└",bottomRight:"┘",bodyLeft:"│",bodyRight:"│",bodyJoin:"│",headerJoin:"┬",joinBody:"─",joinLeft:"├",joinRight:"┤",joinJoin:"┼",joinMiddleDown:"┬",joinMiddleUp:"┴",joinMiddleLeft:"┤",joinMiddleRight:"├"}}if(e==="ramac"){return{topBody:"-",topJoin:"+",topLeft:"+",topRight:"+",bottomBody:"-",bottomJoin:"+",bottomLeft:"+",bottomRight:"+",bodyLeft:"|",bodyRight:"|",bodyJoin:"|",headerJoin:"+",joinBody:"-",joinLeft:"|",joinRight:"|",joinJoin:"|",joinMiddleDown:"+",joinMiddleUp:"+",joinMiddleLeft:"+",joinMiddleRight:"+"}}if(e==="void"){return{topBody:"",topJoin:"",topLeft:"",topRight:"",bottomBody:"",bottomJoin:"",bottomLeft:"",bottomRight:"",bodyLeft:"",bodyRight:"",bodyJoin:"",headerJoin:"",joinBody:"",joinLeft:"",joinRight:"",joinJoin:"",joinMiddleDown:"",joinMiddleUp:"",joinMiddleLeft:"",joinMiddleRight:""}}throw new Error('Unknown border template "'+e+'".')};t.getBorderCharacters=getBorderCharacters},4112:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});t.getBorderCharacters=t.createStream=t.table=void 0;const i=n(6334);Object.defineProperty(t,"createStream",{enumerable:true,get:function(){return i.createStream}});const o=n(5966);Object.defineProperty(t,"getBorderCharacters",{enumerable:true,get:function(){return o.getBorderCharacters}});const a=n(4700);Object.defineProperty(t,"table",{enumerable:true,get:function(){return a.table}});r(n(1782),t)},1128:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.injectHeaderConfig=void 0;const injectHeaderConfig=(e,t)=>{var n;let s=(n=t.spanningCells)!==null&&n!==void 0?n:[];const r=t.header;const i=[...e];if(r){s=s.map((({row:e,...t})=>({...t,row:e+1})));const{content:t,...n}=r;s.unshift({alignment:"center",col:0,colSpan:e[0].length,paddingLeft:1,paddingRight:1,row:0,wrapWord:false,...n});i.unshift([t,...Array.from({length:e[0].length-1}).fill("")])}return[i,s]};t.injectHeaderConfig=injectHeaderConfig},261:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.makeRangeConfig=void 0;const s=n(1497);const makeRangeConfig=(e,t)=>{var n;const{topLeft:r,bottomRight:i}=(0,s.calculateRangeCoordinate)(e);const o={...t[r.col],...e,paddingRight:(n=e.paddingRight)!==null&&n!==void 0?n:t[i.col].paddingRight};return{...o,bottomRight:i,topLeft:r}};t.makeRangeConfig=makeRangeConfig},7366:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.makeStreamConfig=void 0;const s=n(1497);const r=n(2474);const makeColumnsConfig=(e,t={},n)=>Array.from({length:e}).map(((e,s)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",wrapWord:false,...n,...t[s]})));const makeStreamConfig=e=>{(0,r.validateConfig)("streamConfig.json",e);if(e.columnDefault.width===undefined){throw new Error("Must provide config.columnDefault.width when creating a stream.")}return{drawVerticalLine:()=>true,...e,border:(0,s.makeBorderConfig)(e.border),columns:makeColumnsConfig(e.columnCount,e.columns,e.columnDefault)}};t.makeStreamConfig=makeStreamConfig},5576:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.makeTableConfig=void 0;const s=n(67);const r=n(8705);const i=n(1497);const o=n(2474);const a=n(5252);const makeColumnsConfig=(e,t,n,r)=>{const i=(0,s.calculateMaximumColumnWidths)(e,r);return e[0].map(((e,s)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",width:i[s],wrapWord:false,...n,...t===null||t===void 0?void 0:t[s]})))};const makeTableConfig=(e,t={},n)=>{var s,c,l,u,d;(0,o.validateConfig)("config.json",t);(0,a.validateSpanningCellConfig)(e,(s=t.spanningCells)!==null&&s!==void 0?s:[]);const f=(c=n!==null&&n!==void 0?n:t.spanningCells)!==null&&c!==void 0?c:[];const p=makeColumnsConfig(e,t.columns,t.columnDefault,f);const h=(l=t.drawVerticalLine)!==null&&l!==void 0?l:()=>true;const m=(u=t.drawHorizontalLine)!==null&&u!==void 0?u:()=>true;return{...t,border:(0,i.makeBorderConfig)(t.border),columns:p,drawHorizontalLine:m,drawVerticalLine:h,singleLine:(d=t.singleLine)!==null&&d!==void 0?d:false,spanningCellManager:(0,r.createSpanningCellManager)({columnsConfig:p,drawHorizontalLine:m,drawVerticalLine:h,rows:e,spanningCellConfigs:f})}};t.makeTableConfig=makeTableConfig},8188:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.mapDataUsingRowHeights=t.padCellVertically=void 0;const s=n(1497);const r=n(8966);const createEmptyStrings=e=>new Array(e).fill("");const padCellVertically=(e,t,n)=>{const s=t-e.length;if(n==="top"){return[...e,...createEmptyStrings(s)]}if(n==="bottom"){return[...createEmptyStrings(s),...e]}return[...createEmptyStrings(Math.floor(s/2)),...e,...createEmptyStrings(Math.ceil(s/2))]};t.padCellVertically=padCellVertically;const mapDataUsingRowHeights=(e,n,i)=>{const o=e[0].length;const a=e.map(((e,s)=>{const a=n[s];const c=Array.from({length:a},(()=>new Array(o).fill("")));e.forEach(((e,n)=>{var o;const l=(o=i.spanningCellManager)===null||o===void 0?void 0:o.getContainingRange({col:n,row:s});if(l){l.extractCellContent(s).forEach(((e,t)=>{c[t][n]=e}));return}const u=(0,r.wrapCell)(e,i.columns[n].width,i.columns[n].wrapWord);const d=(0,t.padCellVertically)(u,a,i.columns[n].verticalAlignment);d.forEach(((e,t)=>{c[t][n]=e}))}));return c}));return(0,s.flatten)(a)};t.mapDataUsingRowHeights=mapDataUsingRowHeights},8649:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.padTableData=t.padString=void 0;const padString=(e,t,n)=>" ".repeat(t)+e+" ".repeat(n);t.padString=padString;const padTableData=(e,n)=>e.map(((e,s)=>e.map(((e,r)=>{var i;const o=(i=n.spanningCellManager)===null||i===void 0?void 0:i.getContainingRange({col:r,row:s},{mapped:true});if(o){return e}const{paddingLeft:a,paddingRight:c}=n.columns[r];return(0,t.padString)(e,a,c)}))));t.padTableData=padTableData},8705:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createSpanningCellManager=void 0;const s=n(2651);const r=n(888);const i=n(261);const o=n(1497);const findRangeConfig=(e,t)=>t.find((t=>(0,o.isCellInRange)(e,t)));const getContainingRange=(e,t)=>{const n=(0,r.calculateSpanningCellWidth)(e,t);const i=(0,s.wrapRangeContent)(e,n,t);const a=(0,s.alignVerticalRangeContent)(e,i,t);const getCellContent=n=>{const{topLeft:s}=e;const{drawHorizontalLine:r,rowHeights:i}=t;const c=n-s.row;const l=(0,o.sequence)(s.row+1,n).filter((e=>!(r===null||r===void 0?void 0:r(e,i.length)))).length;const u=(0,o.sumArray)(i.slice(s.row,n))+c-l;return a.slice(u,u+i[n])};const getBorderContent=n=>{const{topLeft:s}=e;const r=(0,o.sumArray)(t.rowHeights.slice(s.row,n))+(n-s.row-1);return a[r]};return{...e,extractBorderContent:getBorderContent,extractCellContent:getCellContent,height:i.length,width:n}};const inSameRange=(e,t,n)=>{const s=findRangeConfig(e,n);const r=findRangeConfig(t,n);if(s&&r){return(0,o.areCellEqual)(s.topLeft,r.topLeft)}return false};const hashRange=e=>{const{row:t,col:n}=e.topLeft;return`${t}/${n}`};const createSpanningCellManager=e=>{const{spanningCellConfigs:t,columnsConfig:n}=e;const s=t.map((e=>(0,i.makeRangeConfig)(e,n)));const r={};let a=[];let c=[];return{getContainingRange:(t,n)=>{var i;const o=(n===null||n===void 0?void 0:n.mapped)?c[t.row]:t.row;const l=findRangeConfig({...t,row:o},s);if(!l){return undefined}if(a.length===0){return getContainingRange(l,{...e,rowHeights:a})}const u=hashRange(l);(i=r[u])!==null&&i!==void 0?i:r[u]=getContainingRange(l,{...e,rowHeights:a});return r[u]},inSameRange:(e,t)=>inSameRange(e,t,s),rowHeights:a,rowIndexMapping:c,setRowHeights:e=>{a=e},setRowIndexMapping:e=>{c=(0,o.flatten)(e.map(((e,t)=>Array.from({length:e},(()=>t)))))}}};t.createSpanningCellManager=createSpanningCellManager},3337:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.stringifyTableData=void 0;const s=n(1497);const stringifyTableData=e=>e.map((e=>e.map((e=>(0,s.normalizeString)(String(e))))));t.stringifyTableData=stringifyTableData},4700:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.table=void 0;const s=n(7061);const r=n(6246);const i=n(2696);const o=n(7910);const a=n(1128);const c=n(5576);const l=n(8188);const u=n(8649);const d=n(3337);const f=n(4042);const p=n(1497);const h=n(8310);const table=(e,t={})=>{(0,h.validateTableData)(e);let n=(0,d.stringifyTableData)(e);const[m,g]=(0,a.injectHeaderConfig)(n,t);const y=(0,c.makeTableConfig)(m,t,g);n=(0,f.truncateTableData)(m,(0,p.extractTruncates)(y));const b=(0,i.calculateRowHeights)(n,y);y.spanningCellManager.setRowHeights(b);y.spanningCellManager.setRowIndexMapping(b);n=(0,l.mapDataUsingRowHeights)(n,b,y);n=(0,s.alignTableData)(n,y);n=(0,u.padTableData)(n,y);const v=(0,r.calculateOutputColumnWidths)(y);return(0,o.drawTable)(n,v,b,y)};t.table=table},4042:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.truncateTableData=t.truncateString=void 0;const r=s(n(4055));const truncateString=(e,t)=>(0,r.default)(e,{length:t,omission:"…"});t.truncateString=truncateString;const truncateTableData=(e,n)=>e.map((e=>e.map(((e,s)=>(0,t.truncateString)(e,n[s])))));t.truncateTableData=truncateTableData},1782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},1497:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.isCellInRange=t.areCellEqual=t.calculateRangeCoordinate=t.flatten=t.extractTruncates=t.sumArray=t.sequence=t.distributeUnevenly=t.countSpaceSequence=t.groupBySizes=t.makeBorderConfig=t.splitAnsi=t.normalizeString=void 0;const r=s(n(3298));const i=s(n(60));const o=s(n(3958));const a=n(5966);const normalizeString=e=>e.replace(/\r\n/g,"\n");t.normalizeString=normalizeString;const splitAnsi=e=>{const t=(0,o.default)(e).split("\n").map(i.default);const n=[];let s=0;t.forEach((t=>{n.push(t===0?"":(0,r.default)(e,s,s+t));s+=t+1}));return n};t.splitAnsi=splitAnsi;const makeBorderConfig=e=>({...(0,a.getBorderCharacters)("honeywell"),...e});t.makeBorderConfig=makeBorderConfig;const groupBySizes=(e,t)=>{let n=0;return t.map((t=>{const s=e.slice(n,n+t);n+=t;return s}))};t.groupBySizes=groupBySizes;const countSpaceSequence=e=>{var t,n;return(n=(t=e.match(/\s+/g))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0};t.countSpaceSequence=countSpaceSequence;const distributeUnevenly=(e,t)=>{const n=Array.from({length:t}).fill(Math.floor(e/t));return n.map(((n,s)=>n+(s<e%t?1:0)))};t.distributeUnevenly=distributeUnevenly;const sequence=(e,t)=>Array.from({length:t-e+1},((t,n)=>n+e));t.sequence=sequence;const sumArray=e=>e.reduce(((e,t)=>e+t),0);t.sumArray=sumArray;const extractTruncates=e=>e.columns.map((({truncate:e})=>e));t.extractTruncates=extractTruncates;const flatten=e=>[].concat(...e);t.flatten=flatten;const calculateRangeCoordinate=e=>{const{row:t,col:n,colSpan:s=1,rowSpan:r=1}=e;return{bottomRight:{col:n+s-1,row:t+r-1},topLeft:{col:n,row:t}}};t.calculateRangeCoordinate=calculateRangeCoordinate;const areCellEqual=(e,t)=>e.row===t.row&&e.col===t.col;t.areCellEqual=areCellEqual;const isCellInRange=(e,{topLeft:t,bottomRight:n})=>t.row<=e.row&&e.row<=n.row&&t.col<=e.col&&e.col<=n.col;t.isCellInRange=isCellInRange},2474:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.validateConfig=void 0;const r=s(n(1423));const validateConfig=(e,t)=>{const n=r.default[e];if(!n(t)&&n.errors){const e=n.errors.map((e=>({message:e.message,params:e.params,schemaPath:e.schemaPath})));console.log("config",t);console.log("errors",e);throw new Error("Invalid config.")}};t.validateConfig=validateConfig},5252:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateSpanningCellConfig=void 0;const s=n(1497);const inRange=(e,t,n)=>e<=n&&n<=t;const validateSpanningCellConfig=(e,t)=>{const[n,r]=[e.length,e[0].length];t.forEach(((e,t)=>{const{colSpan:n,rowSpan:s}=e;if(n===undefined&&s===undefined){throw new Error(`Expect at least colSpan or rowSpan is provided in config.spanningCells[${t}]`)}if(n!==undefined&&n<1){throw new Error(`Expect colSpan is not equal zero, instead got: ${n} in config.spanningCells[${t}]`)}if(s!==undefined&&s<1){throw new Error(`Expect rowSpan is not equal zero, instead got: ${s} in config.spanningCells[${t}]`)}}));const i=t.map(s.calculateRangeCoordinate);i.forEach((({topLeft:e,bottomRight:t},s)=>{if(!inRange(0,r-1,e.col)||!inRange(0,n-1,e.row)||!inRange(0,r-1,t.col)||!inRange(0,n-1,t.row)){throw new Error(`Some cells in config.spanningCells[${s}] are out of the table`)}}));const o=Array.from({length:n},(()=>Array.from({length:r})));i.forEach((({topLeft:e,bottomRight:t},n)=>{(0,s.sequence)(e.row,t.row).forEach((r=>{(0,s.sequence)(e.col,t.col).forEach((e=>{if(o[r][e]!==undefined){throw new Error(`Spanning cells in config.spanningCells[${o[r][e]}] and config.spanningCells[${n}] are overlap each other`)}o[r][e]=n}))}))}))};t.validateSpanningCellConfig=validateSpanningCellConfig},8310:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateTableData=void 0;const s=n(1497);const validateTableData=e=>{if(!Array.isArray(e)){throw new TypeError("Table data must be an array.")}if(e.length===0){throw new Error("Table must define at least one row.")}if(e[0].length===0){throw new Error("Table must define at least one column.")}const t=e[0].length;for(const n of e){if(!Array.isArray(n)){throw new TypeError("Table row data must be an array.")}if(n.length!==t){throw new Error("Table must have a consistent number of cells.")}for(const e of n){if(/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test((0,s.normalizeString)(String(e)))){throw new Error("Table data must not contain control characters.")}}}};t.validateTableData=validateTableData},8966:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.wrapCell=void 0;const s=n(1497);const r=n(9063);const i=n(3646);const wrapCell=(e,t,n)=>{const o=(0,s.splitAnsi)(e);for(let e=0;e<o.length;){let s;if(n){s=(0,i.wrapWord)(o[e],t)}else{s=(0,r.wrapString)(o[e],t)}o.splice(e,1,...s);e+=s.length}return o};t.wrapCell=wrapCell},9063:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.wrapString=void 0;const r=s(n(3298));const i=s(n(60));const wrapString=(e,t)=>{let n=e;const s=[];do{s.push((0,r.default)(n,0,t));n=(0,r.default)(n,t).trim()}while((0,i.default)(n));return s};t.wrapString=wrapString},3646:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.wrapWord=void 0;const r=s(n(3298));const i=s(n(3958));const calculateStringLengths=(e,t)=>{let n=(0,i.default)(e);const s=[];const r=new RegExp("(^.{1,"+String(Math.max(t,1))+"}(\\s+|$))|(^.{1,"+String(Math.max(t-1,1))+"}(\\\\|/|_|\\.|,|;|-))");do{let e;const i=r.exec(n);if(i){e=i[0];n=n.slice(e.length);const t=e.trim().length;const r=e.length-t;s.push([t,r])}else{e=n.slice(0,t);n=n.slice(t);s.push([e.length,0])}}while(n.length);return s};const wrapWord=(e,t)=>{const n=[];let s=0;calculateStringLengths(e,t).forEach((([t,i])=>{n.push((0,r.default)(e,s,s+t));s+=t+i}));return n};t.wrapWord=wrapWord},1860:e=>{var t;var n;var s;var r;var i;var o;var a;var c;var l;var u;var d;var f;var p;var h;var m;var g;var y;var b;var v;var w;var T;var S;var k;var D;var _;var E;var C;var R;var P;var O;var A;var L;(function(t){var n=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd){define("tslib",["exports"],(function(e){t(createExporter(n,createExporter(e)))}))}else if(true&&typeof e.exports==="object"){t(createExporter(n,createExporter(e.exports)))}else{t(createExporter(n))}function createExporter(e,t){if(e!==n){if(typeof Object.create==="function"){Object.defineProperty(e,"__esModule",{value:true})}else{e.__esModule=true}}return function(n,s){return e[n]=t?t(n,s):s}}})((function(e){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]};t=function(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");x(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)};n=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};s=function(e,t){var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0)n[s]=e[s];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++){if(t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r]))n[s[r]]=e[s[r]]}return n};r=function(e,t,n,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,s);else for(var a=e.length-1;a>=0;a--)if(o=e[a])i=(r<3?o(i):r>3?o(t,n,i):o(t,n))||i;return r>3&&i&&Object.defineProperty(t,n,i),i};i=function(e,t){return function(n,s){t(n,s,e)}};o=function(e,t,n,s,r,i){function accept(e){if(e!==void 0&&typeof e!=="function")throw new TypeError("Function expected");return e}var o=s.kind,a=o==="getter"?"get":o==="setter"?"set":"value";var c=!t&&e?s["static"]?e:e.prototype:null;var l=t||(c?Object.getOwnPropertyDescriptor(c,s.name):{});var u,d=false;for(var f=n.length-1;f>=0;f--){var p={};for(var h in s)p[h]=h==="access"?{}:s[h];for(var h in s.access)p.access[h]=s.access[h];p.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(accept(e||null))};var m=(0,n[f])(o==="accessor"?{get:l.get,set:l.set}:l[a],p);if(o==="accessor"){if(m===void 0)continue;if(m===null||typeof m!=="object")throw new TypeError("Object expected");if(u=accept(m.get))l.get=u;if(u=accept(m.set))l.set=u;if(u=accept(m.init))r.unshift(u)}else if(u=accept(m)){if(o==="field")r.unshift(u);else l[a]=u}}if(c)Object.defineProperty(c,s.name,l);d=true};a=function(e,t,n){var s=arguments.length>2;for(var r=0;r<t.length;r++){n=s?t[r].call(e,n):t[r].call(e)}return s?n:void 0};c=function(e){return typeof e==="symbol"?e:"".concat(e)};l=function(e,t,n){if(typeof t==="symbol")t=t.description?"[".concat(t.description,"]"):"";return Object.defineProperty(e,"name",{configurable:true,value:n?"".concat(n," ",t):t})};u=function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};d=function(e,t,n,s){function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function fulfilled(e){try{step(s.next(e))}catch(e){r(e)}}function rejected(e){try{step(s["throw"](e))}catch(e){r(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((s=s.apply(e,t||[])).next())}))};f=function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,r,i,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=verb(0),o["throw"]=verb(1),o["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(a){if(s)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(n=0)),n)try{if(s=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];r=0}finally{s=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};p=function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))P(t,e,n)};P=Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]};h=function(e){var t=typeof Symbol==="function"&&Symbol.iterator,n=t&&e[t],s=0;if(n)return n.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&s>=e.length)e=void 0;return{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};m=function(e,t){var n=typeof Symbol==="function"&&e[Symbol.iterator];if(!n)return e;var s=n.call(e),r,i=[],o;try{while((t===void 0||t-- >0)&&!(r=s.next()).done)i.push(r.value)}catch(e){o={error:e}}finally{try{if(r&&!r.done&&(n=s["return"]))n.call(s)}finally{if(o)throw o.error}}return i};g=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e};y=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var s=Array(e),r=0,t=0;t<n;t++)for(var i=arguments[t],o=0,a=i.length;o<a;o++,r++)s[r]=i[o];return s};b=function(e,t,n){if(n||arguments.length===2)for(var s=0,r=t.length,i;s<r;s++){if(i||!(s in t)){if(!i)i=Array.prototype.slice.call(t,0,s);i[s]=t[s]}}return e.concat(i||Array.prototype.slice.call(t))};v=function(e){return this instanceof v?(this.v=e,this):new v(e)};w=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=n.apply(e,t||[]),r,i=[];return r=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),verb("next"),verb("throw"),verb("return",awaitReturn),r[Symbol.asyncIterator]=function(){return this},r;function awaitReturn(e){return function(t){return Promise.resolve(t).then(e,reject)}}function verb(e,t){if(s[e]){r[e]=function(t){return new Promise((function(n,s){i.push([e,t,n,s])>1||resume(e,t)}))};if(t)r[e]=t(r[e])}}function resume(e,t){try{step(s[e](t))}catch(e){settle(i[0][3],e)}}function step(e){e.value instanceof v?Promise.resolve(e.value.v).then(fulfill,reject):settle(i[0][2],e)}function fulfill(e){resume("next",e)}function reject(e){resume("throw",e)}function settle(e,t){if(e(t),i.shift(),i.length)resume(i[0][0],i[0][1])}};T=function(e){var t,n;return t={},verb("next"),verb("throw",(function(e){throw e})),verb("return"),t[Symbol.iterator]=function(){return this},t;function verb(s,r){t[s]=e[s]?function(t){return(n=!n)?{value:v(e[s](t)),done:false}:r?r(t):t}:r}};S=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof h==="function"?h(e):e[Symbol.iterator](),n={},verb("next"),verb("throw"),verb("return"),n[Symbol.asyncIterator]=function(){return this},n);function verb(t){n[t]=e[t]&&function(n){return new Promise((function(s,r){n=e[t](n),settle(s,r,n.done,n.value)}))}}function settle(e,t,n,s){Promise.resolve(s).then((function(t){e({value:t,done:n})}),t)}};k=function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var I=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t};var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};D=function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),s=0;s<n.length;s++)if(n[s]!=="default")P(t,e,n[s]);I(t,e);return t};_=function(e){return e&&e.__esModule?e:{default:e}};E=function(e,t,n,s){if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?s:n==="a"?s.call(e):s?s.value:t.get(e)};C=function(e,t,n,s,r){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n};R=function(e,t){if(t===null||typeof t!=="object"&&typeof t!=="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e==="function"?t===e:e.has(t)};O=function(e,t,n){if(t!==null&&t!==void 0){if(typeof t!=="object"&&typeof t!=="function")throw new TypeError("Object expected.");var s,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");s=t[Symbol.asyncDispose]}if(s===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");s=t[Symbol.dispose];if(n)r=s}if(typeof s!=="function")throw new TypeError("Object not disposable.");if(r)s=function(){try{r.call(this)}catch(e){return Promise.reject(e)}};e.stack.push({value:t,dispose:s,async:n})}else if(n){e.stack.push({async:true})}return t};var $=typeof SuppressedError==="function"?SuppressedError:function(e,t,n){var s=new Error(n);return s.name="SuppressedError",s.error=e,s.suppressed=t,s};A=function(e){function fail(t){e.error=e.hasError?new $(t,e.error,"An error was suppressed during disposal."):t;e.hasError=true}var t,n=0;function next(){while(t=e.stack.pop()){try{if(!t.async&&n===1)return n=0,e.stack.push(t),Promise.resolve().then(next);if(t.dispose){var s=t.dispose.call(t.value);if(t.async)return n|=2,Promise.resolve(s).then(next,(function(e){fail(e);return next()}))}else n|=1}catch(e){fail(e)}}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return next()};L=function(e,t){if(typeof e==="string"&&/^\.\.?\//.test(e)){return e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(e,n,s,r,i){return n?t?".jsx":".js":s&&(!r||!i)?e:s+r+"."+i.toLowerCase()+"js"}))}return e};e("__extends",t);e("__assign",n);e("__rest",s);e("__decorate",r);e("__param",i);e("__esDecorate",o);e("__runInitializers",a);e("__propKey",c);e("__setFunctionName",l);e("__metadata",u);e("__awaiter",d);e("__generator",f);e("__exportStar",p);e("__createBinding",P);e("__values",h);e("__read",m);e("__spread",g);e("__spreadArrays",y);e("__spreadArray",b);e("__await",v);e("__asyncGenerator",w);e("__asyncDelegator",T);e("__asyncValues",S);e("__makeTemplateObject",k);e("__importStar",D);e("__importDefault",_);e("__classPrivateFieldGet",E);e("__classPrivateFieldSet",C);e("__classPrivateFieldIn",R);e("__addDisposableResource",O);e("__disposeResources",A);e("__rewriteRelativeImportExtension",L)}));0&&0},1535:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.AzureRMBackend=void 0;const s=n(6982);const r=n(6028);const i=n(8081);class AzureRMBackend{config;workspace;containerClient;blobClient;currentLeaseId;originalKey;constructor(e,t="default"){this.config=e;this.workspace=t;const n=e.connection_string||process.env.AZURE_STORAGE_CONNECTION_STRING;if(!n){const e=new Error("AZURE_STORAGE_CONNECTION_STRING env variable is missing");e.name="AzureRM Backend Configuration Error";throw e}const{BlobServiceClient:s}=(0,i.loadDriver)("@azure/storage-blob");const o=s.fromConnectionString(n);this.containerClient=o.getContainerClient(e.container_name);this.config.key=this.config.key||r.FILE_STATE;this.originalKey=this.config.key;if(this.workspace!=="default"){this.config.key=`env:/${this.workspace}/${this.originalKey}`}this.blobClient=this.containerClient.getBlockBlobClient(this.config.key)}async exists(){try{return await this.blobClient.exists()}catch(e){return false}}async read(){try{await this.containerClient.createIfNotExists();const e=await this.blobClient.exists();if(!e){return this.emptyState()}const t=await this.blobClient.download(0);const n=await this.streamToString(t.readableStreamBody);return JSON.parse(n)}catch(e){return this.emptyState()}}async write(e){await this.containerClient.createIfNotExists();const t=JSON.stringify(e,null,2);const n={blobHTTPHeaders:{blobContentType:"application/json"}};if(this.currentLeaseId){n.conditions={leaseId:this.currentLeaseId}}await this.blobClient.upload(t,t.length,n)}async lock(e){const t=e.match(/^(\d+)s$/);const n=t?parseInt(t[1],10)*1e3:0;const r=Date.now();const i=await this.blobClient.exists();if(!i){await this.write(this.emptyState())}const o=this.blobClient.getBlobLeaseClient();while(true){try{const e=await o.acquireLease(-1);this.currentLeaseId=e.leaseId;try{await this.blobClient.setMetadata({id:(0,s.randomUUID)(),operation:"Operation",who:process.env.USER||"unknown",created:(new Date).toISOString()},{conditions:{leaseId:this.currentLeaseId}})}catch(e){if(e.statusCode!==201){throw e}}return true}catch(e){if(e.statusCode===409||e.code==="LeaseAlreadyPresent"){if(Date.now()-r>=n){return false}await new Promise((e=>setTimeout(e,1e3)))}else{throw e}}}}async unlock(){if(!this.currentLeaseId)return true;try{const e=this.blobClient.getBlobLeaseClient(this.currentLeaseId);await e.releaseLease();this.currentLeaseId=undefined;return true}catch(e){return false}}async forceUnlock(e){try{const t=await this.blobClient.getProperties();const n=t.metadata?.id;if(t.leaseState==="available"){return{success:false,error:"No lock exists for the given state."}}if(n!==e){return{success:false,currentLockId:n||"unknown"}}const s=this.blobClient.getBlobLeaseClient();await s.breakLease(0);return{success:true}}catch(e){return{success:false,error:`Failed to force unlock: ${e.message}`}}}async isLocked(){try{const e=await this.blobClient.getProperties();return e.leaseState!=="available"}catch(e){return false}}emptyState(){return{version:r.VERSION_STATE,serial:0,lineage:(0,s.randomUUID)(),lastSync:"",resources:[]}}async streamToString(e){return new Promise(((t,n)=>{const s=[];e.on("data",(e=>{s.push(e.toString())}));e.on("end",(()=>{t(s.join(""))}));e.on("error",n)}))}async listWorkspaces(){const e=new Set(["default"]);try{for await(const t of this.containerClient.listBlobsFlat({prefix:"env:/"})){const n=t.name.match(/^env:\/([^\/]+)\//);if(n){e.add(n[1])}}}catch(e){}return Array.from(e)}async deleteWorkspace(e){if(e==="default")return false;try{const t=`env:/${e}/${this.originalKey}`;const n=this.containerClient.getBlockBlobClient(t);await n.deleteIfExists();return true}catch(e){return false}}}t.AzureRMBackend=AzureRMBackend},2578:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CustomBackend=void 0;const s=n(6928);const r=n(9896);class CustomBackend{delegate;constructor(e,t="default",i=process.cwd()){const{source:o,...a}=e;if(!o){throw new Error('Custom backend configuration must specify a "source" path or package name.')}let c;const l=[(0,s.resolve)(i,o),(0,s.resolve)(i,".testform","backends",o),(0,s.resolve)(i,".testform","modules",o)];let u=null;for(const e of l){if((0,r.existsSync)(e)){u=e;break}if((0,r.existsSync)(`${e}.js`)){u=`${e}.js`;break}if((0,r.existsSync)(`${e}.ts`)){u=`${e}.ts`;break}}if(u){try{c=n(6665)(u)}catch{try{c=n(6665)(u)}catch(e){throw new Error(`Failed to load custom backend from "${u}": ${e.message||e}`)}}}else{try{c=require(o)}catch(e){throw new Error(`Could not resolve custom backend from local path "${o}" or package "${o}".`)}}const d=c.default||c.Backend||c.CustomBackend||c;if(typeof d!=="function"){throw new Error(`The custom backend module at "${o}" does not export a valid backend class or constructor.`)}this.delegate=new d(a,t,i)}async read(){return this.delegate.read()}async exists(){return this.delegate.exists()}async write(e){return this.delegate.write(e)}async lock(e){return this.delegate.lock(e)}async unlock(){return this.delegate.unlock()}async forceUnlock(e){return this.delegate.forceUnlock(e)}async isLocked(){return this.delegate.isLocked()}async listWorkspaces(){return this.delegate.listWorkspaces()}async deleteWorkspace(e){return this.delegate.deleteWorkspace(e)}}t.CustomBackend=CustomBackend},6122:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GCSBackend=void 0;const s=n(6982);const r=n(6028);const i=n(8081);class GCSBackend{config;workspace;storage;bucketClient;stateKey;lockKey;lockId;constructor(e,t="default"){this.config=e;this.workspace=t;const n={};if(e.credentials){n.keyFilename=e.credentials}const{Storage:s}=(0,i.loadDriver)("@google-cloud/storage");this.storage=new s(n);this.bucketClient=this.storage.bucket(e.bucket);let o=this.config.prefix||"";if(o&&!o.endsWith("/")){o+="/"}const a=r.FILE_STATE;if(this.workspace!=="default"){this.stateKey=`${o}env:/${this.workspace}/${a}`}else{this.stateKey=`${o}${a}`}this.lockKey=`${this.stateKey}.tflock`}emptyState(){return{version:r.VERSION_STATE,serial:0,lineage:(0,s.randomUUID)(),lastSync:"",resources:[]}}async exists(){try{const[e]=await this.bucketClient.file(this.config.prefix).exists();return e}catch(e){return false}}async read(){try{const e=this.bucketClient.file(this.stateKey);const[t]=await e.exists();if(!t){return this.emptyState()}const[n]=await e.download();return JSON.parse(n.toString("utf8"))}catch(e){return this.emptyState()}}async write(e){const t=this.bucketClient.file(this.stateKey);const n=JSON.stringify(e,null,2);await t.save(n,{contentType:"application/json"})}async lock(e){const t=e.match(/^(\d+)s$/);const n=t?parseInt(t[1],10)*1e3:0;const r=Date.now();const i=this.bucketClient.file(this.lockKey);const o=JSON.stringify({id:(0,s.randomUUID)(),operation:"Operation",who:process.env.USER||"unknown",created:(new Date).toISOString()});while(true){try{await i.save(o,{preconditionOpts:{ifGenerationMatch:0}});this.lockId=o;return true}catch(e){if(e.code===412||e.code==="412"){if(Date.now()-r>=n){return false}await new Promise((e=>setTimeout(e,1e3)))}else{throw e}}}}async unlock(){if(!this.lockId)return true;const e=this.bucketClient.file(this.lockKey);try{const[t]=await e.exists();if(t){await e.delete()}this.lockId=undefined;return true}catch(e){return false}}async forceUnlock(e){const t=this.bucketClient.file(this.lockKey);try{const[n]=await t.exists();if(!n){return{success:false,error:"No lock exists for the given state."}}const[s]=await t.download();const r=JSON.parse(s.toString("utf8"));if(r.id!==e){return{success:false,currentLockId:r.id}}await t.delete();this.lockId=undefined;return{success:true}}catch(e){return{success:false,error:e.message}}}async isLocked(){const e=this.bucketClient.file(this.lockKey);try{const[t]=await e.exists();return t}catch(e){return false}}async listWorkspaces(){const e=new Set(["default"]);try{let t=this.config.prefix||"";if(t&&!t.endsWith("/")){t+="/"}const n=`${t}env:/`;const[s]=await this.bucketClient.getFiles({prefix:n});for(const t of s){const s=t.name.substring(n.length);const r=s.match(/^([^\/]+)\//);if(r){e.add(r[1])}}}catch(e){}return Array.from(e)}async deleteWorkspace(e){if(e==="default")return false;try{let t=this.config.prefix||"";if(t&&!t.endsWith("/")){t+="/"}const n=`${t}env:/${e}/${r.FILE_STATE}`;const s=this.bucketClient.file(n);const[i]=await s.exists();if(i){await s.delete();return true}return false}catch(e){return false}}}t.GCSBackend=GCSBackend},4646:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GitHubBackend=void 0;const s=n(6982);const r=n(6028);class GitHubBackend{config;workspace;owner;repository;branch;tokenEnv;token;statePath;lockPath;currentSha;currentLockSha;currentLockId;constructor(e={},t="default",n,s,i){this.config=e;this.workspace=t;this.owner=e.owner||n||"";this.repository=e.repository||e.repo||s||"";this.branch=e.branch||"testform-state";this.tokenEnv=e.token_env||e.tokenEnv||i||"GITHUB_TOKEN";this.token=process.env[this.tokenEnv]||"";const o=e.path||r.FILE_STATE;if(this.workspace!=="default"){this.statePath=`env/${this.workspace}/${o}`}else{this.statePath=o}this.lockPath=`${this.statePath}.lock`}async apiRequest(e,t={}){if(!this.token){throw new Error(`GitHub Backend: Environment variable "${this.tokenEnv}" is missing or empty.`)}if(!this.owner||!this.repository){throw new Error("GitHub Backend: 'owner' and 'repository' must be specified in backend or provider configuration.")}const n=e.replace(/^\//,"");const s=n.length>0?`https://api.github.com/repos/${this.owner}/${this.repository}/${n}`:`https://api.github.com/repos/${this.owner}/${this.repository}`;const r={Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json","User-Agent":"Testform-CLI"};if(t.body){r["Content-Type"]="application/json"}return await fetch(s,{method:t.method||"GET",headers:r,body:t.body?JSON.stringify(t.body):undefined})}async ensureBranchExists(){const e=await this.apiRequest(`branches/${encodeURIComponent(this.branch)}`);if(e.ok)return;if(e.status===404){const e=await this.apiRequest("");if(!e.ok){throw new Error(`GitHub Backend: Failed to inspect repository ${this.owner}/${this.repository}: HTTP ${e.status}`)}const t=await e.json();const n=t.default_branch||"main";const s=await this.apiRequest(`git/ref/heads/${encodeURIComponent(n)}`);if(!s.ok){throw new Error(`GitHub Backend: Failed to get default branch ref "${n}": HTTP ${s.status}`)}const r=await s.json();const i=r.object?.sha;const o=await this.apiRequest("git/refs",{method:"POST",body:{ref:`refs/heads/${this.branch}`,sha:i}});if(!o.ok&&o.status!==422){const e=await o.text();throw new Error(`GitHub Backend: Failed to create state branch "${this.branch}": HTTP ${o.status} - ${e}`)}}}async exists(){try{const e=await this.apiRequest(`contents/${this.statePath}?ref=${encodeURIComponent(this.branch)}`);return e.ok}catch{return false}}async read(){const e=await this.apiRequest(`contents/${this.statePath}?ref=${encodeURIComponent(this.branch)}`);if(e.status===404){return{version:r.VERSION_STATE,serial:0,lineage:(0,s.randomUUID)(),lastSync:"",resources:[]}}if(!e.ok){throw new Error(`GitHub Backend: Failed to read state: HTTP ${e.status} ${e.statusText}`)}const t=await e.json();this.currentSha=t.sha;const n=Buffer.from(t.content,"base64").toString("utf-8");return JSON.parse(n)}async write(e){await this.ensureBranchExists();if(!this.currentSha){const e=await this.apiRequest(`contents/${this.statePath}?ref=${encodeURIComponent(this.branch)}`);if(e.ok){const t=await e.json();this.currentSha=t.sha}}const t={message:`Update testform.state (serial: ${e.serial})`,content:Buffer.from(JSON.stringify(e,null,2),"utf-8").toString("base64"),branch:this.branch};if(this.currentSha){t.sha=this.currentSha}const n=await this.apiRequest(`contents/${this.statePath}`,{method:"PUT",body:t});if(n.status===409){throw new Error(`GitHub Backend State Conflict: The state file in branch "${this.branch}" was modified concurrently. Re-run plan or refresh state.`)}if(!n.ok){const e=await n.text();throw new Error(`GitHub Backend: Failed to write state: HTTP ${n.status} - ${e}`)}const s=await n.json();this.currentSha=s.content?.sha}async lock(e){const t=e.match(/^(\d+)s$/);const n=t?parseInt(t[1],10)*1e3:0;const r=Date.now();const i=(0,s.randomUUID)();await this.ensureBranchExists();while(true){const e={id:i,operation:"Operation",who:process.env.USER||process.env.USERNAME||"unknown",created:(new Date).toISOString()};const t={message:`Acquire testform.state lock [${i}]`,content:Buffer.from(JSON.stringify(e,null,2),"utf-8").toString("base64"),branch:this.branch};const s=await this.apiRequest(`contents/${this.lockPath}`,{method:"PUT",body:t});if(s.status===201||s.status===200){const e=await s.json();this.currentLockSha=e.content?.sha;this.currentLockId=i;return true}if(s.status===422||s.status===409){if(Date.now()-r>=n){throw new Error(`Error acquiring the state lock: State lock file "${this.lockPath}" already exists on branch "${this.branch}".`)}await new Promise((e=>setTimeout(e,1e3)))}else{const e=await s.text();throw new Error(`GitHub Backend: Error creating lock: HTTP ${s.status} - ${e}`)}}}async unlock(){if(!this.currentLockSha){const e=await this.apiRequest(`contents/${this.lockPath}?ref=${encodeURIComponent(this.branch)}`);if(e.status===404)return true;if(e.ok){const t=await e.json();this.currentLockSha=t.sha}else{return false}}const e=await this.apiRequest(`contents/${this.lockPath}`,{method:"DELETE",body:{message:"Release testform.state lock",sha:this.currentLockSha,branch:this.branch}});if(e.ok||e.status===404){this.currentLockSha=undefined;this.currentLockId=undefined;return true}return false}async forceUnlock(e){const t=await this.apiRequest(`contents/${this.lockPath}?ref=${encodeURIComponent(this.branch)}`);if(t.status===404){return{success:true}}if(!t.ok){return{success:false,error:`Failed to check lock file: HTTP ${t.status}`}}const n=await t.json();const s=Buffer.from(n.content,"base64").toString("utf-8");try{const t=JSON.parse(s);if(e&&t.id&&t.id!==e){return{success:false,error:`Lock ID mismatch: expected ${e}, found ${t.id}`,currentLockId:t.id}}}catch{}const r=await this.apiRequest(`contents/${this.lockPath}`,{method:"DELETE",body:{message:`Force unlock testform.state [${e}]`,sha:n.sha,branch:this.branch}});return{success:r.ok||r.status===404}}async isLocked(){const e=await this.apiRequest(`contents/${this.lockPath}?ref=${encodeURIComponent(this.branch)}`);return e.ok}async listWorkspaces(){const e=await this.apiRequest(`contents/env?ref=${encodeURIComponent(this.branch)}`);if(!e.ok)return[];const t=await e.json();if(!Array.isArray(t))return[];return t.filter((e=>e.type==="dir")).map((e=>e.name))}async deleteWorkspace(e){const t=`env/${e}/${this.config.path||r.FILE_STATE}`;const n=await this.apiRequest(`contents/${t}?ref=${encodeURIComponent(this.branch)}`);if(n.status===404)return true;if(!n.ok)return false;const s=await n.json();const i=await this.apiRequest(`contents/${t}`,{method:"DELETE",body:{message:`Delete workspace ${e} state`,sha:s.sha,branch:this.branch}});return i.ok}}t.GitHubBackend=GitHubBackend},1265:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.HTTPBackend=void 0;const s=n(6982);class HTTPBackend{config;workspace;address;lockAddress;unlockAddress;lockMethod;unlockMethod;updateMethod;headers;currentLockId;constructor(e,t="default"){this.config=e;this.workspace=t;if(!e.address){throw new Error('HTTP backend configuration must specify an "address" URL.')}this.headers={...e.headers};if(e.username&&e.password){const t=Buffer.from(`${e.username}:${e.password}`).toString("base64");this.headers["Authorization"]=`Basic ${t}`}this.updateMethod=(e.update_method||"POST").toUpperCase();this.lockMethod=(e.lock_method||"POST").toUpperCase();this.unlockMethod=(e.unlock_method||"DELETE").toUpperCase();this.address=this.resolveWorkspaceUrl(e.address,t);if(e.lock_address){this.lockAddress=this.resolveWorkspaceUrl(e.lock_address,t)}if(e.unlock_address){this.unlockAddress=this.resolveWorkspaceUrl(e.unlock_address,t)}}resolveWorkspaceUrl(e,t){if(e.includes("${workspace}")){return e.replace(/\$\{workspace\}/g,t)}if(e.includes("{workspace}")){return e.replace(/\{workspace\}/g,t)}if(t!=="default"){const n=e.includes("?")?"&":"?";return`${e}${n}env=${encodeURIComponent(t)}`}return e}async read(){const e=await fetch(this.address,{method:"GET",headers:{Accept:"application/json",...this.headers}});if(e.status===404){return null}if(!e.ok){const t=await e.text();throw new Error(`HTTP backend read failed (${e.status} ${e.statusText}): ${t}`)}const t=await e.text();if(!t||t.trim()===""){return null}return JSON.parse(t)}async exists(){try{const e=await fetch(this.address,{method:"GET",headers:{Accept:"application/json",...this.headers}});if(e.status===404)return false;if(e.ok){const t=await e.text();return Boolean(t&&t.trim().length>0)}return false}catch{return false}}async write(e){const t=JSON.stringify(e,null,2);const n={"Content-Type":"application/json",...this.headers};if(this.currentLockId){n["X-Terraform-Lock-ID"]=this.currentLockId}const s=await fetch(this.address,{method:this.updateMethod,headers:n,body:t});if(!s.ok){const e=await s.text();throw new Error(`HTTP backend write failed (${s.status} ${s.statusText}): ${e}`)}}async lock(e){if(!this.lockAddress){return true}const t=(0,s.randomUUID)();const n={ID:t,Operation:"OperationTypeApply",Info:"",Who:process.env.USER||process.env.USERNAME||"testform",Version:"1.0.0",Created:(new Date).toISOString(),Path:this.address};const r=await fetch(this.lockAddress,{method:this.lockMethod,headers:{"Content-Type":"application/json",...this.headers},body:JSON.stringify(n)});if(r.status===423||r.status===409){return false}if(r.ok){this.currentLockId=t;return true}return false}async unlock(){if(!this.unlockAddress){return true}const e={ID:this.currentLockId||""};const t=await fetch(this.unlockAddress,{method:this.unlockMethod,headers:{"Content-Type":"application/json",...this.headers},body:JSON.stringify(e)});if(t.ok){this.currentLockId=undefined;return true}return false}async forceUnlock(e){if(!this.unlockAddress){return{success:true}}const t=await fetch(this.unlockAddress,{method:this.unlockMethod,headers:{"Content-Type":"application/json",...this.headers},body:JSON.stringify({ID:e})});if(t.ok){return{success:true}}const n=await t.text();return{success:false,error:n}}async isLocked(){if(!this.lockAddress)return false;return Boolean(this.currentLockId)}async listWorkspaces(){return["default"]}async deleteWorkspace(e){if(e==="default")return false;return true}}t.HTTPBackend=HTTPBackend},7490:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.LocalBackend=void 0;const s=n(6928);const r=n(9896);const i=n(6982);const o=n(6028);class LocalBackend{dir;customStatePath;customBackupPath;workspace;constructor(e,t,n,s="default"){this.dir=e;this.customStatePath=t;this.customBackupPath=n;this.workspace=s}getWorkspaceStatePath(){if(this.customStatePath){const e=(0,s.resolve)(this.dir,this.customStatePath);if((0,r.existsSync)(e))return e;const t=(0,s.resolve)(process.cwd(),this.customStatePath);if((0,r.existsSync)(t))return t;return e}if(this.workspace!=="default"){return(0,s.resolve)(this.dir,`${o.FILE_STATE}.d`,this.workspace,o.FILE_STATE)}return(0,s.resolve)(this.dir,o.FILE_STATE)}resolvePath(){const e=this.getWorkspaceStatePath();if((0,r.existsSync)(e))return e;if(this.workspace==="default"){const e=(0,s.resolve)(this.dir,o.FILE_STATE);if((0,r.existsSync)(e))return e}return null}lockPath(){const e=this.resolvePath()??this.getWorkspaceStatePath();return`${e}.lock`}async exists(){return this.resolvePath()!==null}async read(){const e=this.resolvePath();if(!e||!(0,r.existsSync)(e)){return{version:o.VERSION_STATE,serial:0,lineage:(0,i.randomUUID)(),lastSync:"",resources:[]}}const t=await r.promises.readFile(e,"utf-8");return JSON.parse(t)}async write(e){const t=this.resolvePath()??this.getWorkspaceStatePath();const n=(0,s.resolve)(t,"..");if(!(0,r.existsSync)(n)){await r.promises.mkdir(n,{recursive:true})}const i=this.customBackupPath?(0,s.resolve)(this.dir,this.customBackupPath):`${t}.backup`;if((0,r.existsSync)(t)){await r.promises.copyFile(t,i)}await r.promises.writeFile(t,JSON.stringify(e,null,2),"utf-8")}async lock(e){const t=e.match(/^(\d+)s$/);const n=t?parseInt(t[1],10)*1e3:0;const s=this.lockPath();const o=Date.now();while(true){try{await r.promises.writeFile(s,JSON.stringify({id:(0,i.randomUUID)(),operation:"Operation",who:process.env.USER||"unknown",created:(new Date).toISOString()},null,2),{flag:"wx"});return true}catch(e){if(e.code==="EEXIST"){if(Date.now()-o>=n){return false}await new Promise((e=>setTimeout(e,1e3)))}else{throw e}}}}async unlock(){const e=this.lockPath();if((0,r.existsSync)(e)){try{await r.promises.unlink(e);return true}catch(e){return false}}return true}async forceUnlock(e){const t=this.lockPath();if(!(0,r.existsSync)(t)){return{success:false,error:`No lock exists for the given state. (Path checked: ${t})`}}try{const n=await r.promises.readFile(t,"utf-8");const s=JSON.parse(n);if(s.id!==e){return{success:false,currentLockId:s.id}}await r.promises.unlink(t);return{success:true}}catch(e){return{success:false,error:`The lock file could not be read or parsed.`}}}async isLocked(){return(0,r.existsSync)(this.lockPath())}async getLockInfo(){const e=this.lockPath();if(!(0,r.existsSync)(e))return null;try{const t=await r.promises.readFile(e,"utf-8");return JSON.parse(t)}catch{return null}}async listWorkspaces(){const e=["default"];const t=(0,s.resolve)(this.dir,`${o.FILE_STATE}.d`);if((0,r.existsSync)(t)){const n=await r.promises.readdir(t,{withFileTypes:true});for(const t of n){if(t.isDirectory()){e.push(t.name)}}}return e}async deleteWorkspace(e){if(e==="default")return false;const t=(0,s.resolve)(this.dir,`${o.FILE_STATE}.d`,e);if((0,r.existsSync)(t)){await r.promises.rm(t,{recursive:true,force:true});return true}return false}}t.LocalBackend=LocalBackend},3175:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.S3Backend=void 0;const s=n(6982);const r=n(6028);const i=n(8081);function getAwsS3(){return(0,i.loadDriver)("@aws-sdk/client-s3")}function getAwsDynamo(){return(0,i.loadDriver)("@aws-sdk/client-dynamodb")}class S3Backend{config;workspace;s3;dynamo;originalKey;constructor(e,t="default"){this.config=e;this.workspace=t;const{S3Client:n}=getAwsS3();const s={region:e.region||process.env.AWS_REGION||"us-east-1"};let i=e.endpoint;if(!i&&e.namespace){const t=e.region||process.env.AWS_REGION||"us-ashburn-1";i=`https://${e.namespace}.compat.objectstorage.${t}.oraclecloud.com`}if(i){s.endpoint=i;s.forcePathStyle=e.forcePathStyle??true}if(e.forcePathStyle!==undefined){s.forcePathStyle=e.forcePathStyle}if(e.profile==="local"){s.endpoint=e.region&&e.region.startsWith("http")?e.region:"http://localhost:4566";s.region=process.env.AWS_REGION||"us-east-1";s.forcePathStyle=true;s.credentials={accessKeyId:"test",secretAccessKey:"test"}}this.s3=new n(s);if(e.dynamodb_table){const{DynamoDBClient:e}=getAwsDynamo();this.dynamo=new e(s)}this.config.key=this.config.key||r.FILE_STATE;this.originalKey=this.config.key;if(this.workspace!=="default"){this.config.key=`env:/${this.workspace}/${this.originalKey}`}}async exists(){try{const{HeadObjectCommand:e}=getAwsS3();await this.s3.send(new e({Bucket:this.config.bucket,Key:this.config.key}));return true}catch(e){return false}}async read(){const{GetObjectCommand:e,NoSuchKey:t}=getAwsS3();try{const t=new e({Bucket:this.config.bucket,Key:this.config.key});const n=await this.s3.send(t);const s=await(n.Body?.transformToString());if(!s){return this.emptyState()}return JSON.parse(s)}catch(e){if(t&&(e instanceof t||e.name==="NoSuchKey"||e.Code==="NoSuchKey")){return this.emptyState()}if(e.name==="NoSuchKey"||e.Code==="NoSuchKey"){return this.emptyState()}throw e}}async write(e){const{PutObjectCommand:t}=getAwsS3();const n=new t({Bucket:this.config.bucket,Key:this.config.key,Body:JSON.stringify(e,null,2),ContentType:"application/json"});await this.s3.send(n)}async lock(e){if(!this.dynamo||!this.config.dynamodb_table){return true}const{PutItemCommand:t,ConditionalCheckFailedException:n}=getAwsDynamo();const r=e.match(/^(\d+)s$/);const i=r?parseInt(r[1],10)*1e3:0;const o=Date.now();const a=(0,s.randomUUID)();const c={LockID:{S:this.config.bucket+"/"+this.config.key},Info:{S:JSON.stringify({id:a,operation:"Operation",who:process.env.USER||"unknown",created:(new Date).toISOString()})}};while(true){try{await this.dynamo.send(new t({TableName:this.config.dynamodb_table,Item:c,ConditionExpression:"attribute_not_exists(LockID)"}));return true}catch(e){const t=n&&e instanceof n||e.name==="ConditionalCheckFailedException";if(t){if(Date.now()-o>=i){return false}await new Promise((e=>setTimeout(e,1e3)))}else{throw e}}}}async unlock(){if(!this.dynamo||!this.config.dynamodb_table)return true;const{DeleteItemCommand:e}=getAwsDynamo();try{await this.dynamo.send(new e({TableName:this.config.dynamodb_table,Key:{LockID:{S:this.config.bucket+"/"+this.config.key}}}));return true}catch(e){return false}}async forceUnlock(e){if(!this.dynamo||!this.config.dynamodb_table){return{success:false,error:"DynamoDB locking is not configured for this backend."}}const{GetItemCommand:t,DeleteItemCommand:n}=getAwsDynamo();try{const s=await this.dynamo.send(new t({TableName:this.config.dynamodb_table,Key:{LockID:{S:this.config.bucket+"/"+this.config.key}}}));if(!s.Item||!s.Item.Info){return{success:false,error:"No lock exists for the given state."}}const r=JSON.parse(s.Item.Info.S);if(r.id!==e){return{success:false,currentLockId:r.id}}await this.dynamo.send(new n({TableName:this.config.dynamodb_table,Key:{LockID:{S:this.config.bucket+"/"+this.config.key}}}));return{success:true}}catch(e){return{success:false,error:`Failed to force unlock: ${e.message}`}}}async isLocked(){if(!this.dynamo||!this.config.dynamodb_table)return false;const{GetItemCommand:e}=getAwsDynamo();try{const t=await this.dynamo.send(new e({TableName:this.config.dynamodb_table,Key:{LockID:{S:this.config.bucket+"/"+this.config.key}}}));return!!t.Item}catch(e){return false}}emptyState(){return{version:r.VERSION_STATE,serial:0,lineage:(0,s.randomUUID)(),lastSync:"",resources:[]}}async listWorkspaces(){const e=new Set(["default"]);try{const{ListObjectsV2Command:t}=getAwsS3();const n=new t({Bucket:this.config.bucket,Prefix:"env:/"});const s=await this.s3.send(n);if(s.Contents){for(const t of s.Contents){if(t.Key){const n=t.Key.match(/^env:\/([^\/]+)\//);if(n){e.add(n[1])}}}}}catch(e){}return Array.from(e)}async deleteWorkspace(e){if(e==="default")return false;try{const{DeleteObjectCommand:t}=getAwsS3();const n=`env:/${e}/${this.originalKey}`;const s=new t({Bucket:this.config.bucket,Key:n});await this.s3.send(s);return true}catch(e){return false}}}t.S3Backend=S3Backend},8314:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.applyCmd=void 0;const s=n(6028);const r=n(9896);const i=n(465);const o=n(7862);const a=n(7066);const c=n(1227);const l=n(1227);const u=n(4483);const d=n(1533);const f=n(1821);const p=n(5301);const h=n(2978);const m=n(8480);const g=n(5124);const y=n(8169);const b=n(1138);const applyCmd=async e=>{const{dir:t=".",autoApprove:v=false,verbose:w=false,planFile:T,lock:S=true,lockTimeout:k="0s",input:D=true,variables:_,statePath:E,backupPath:C,target:R,refresh:P=true,refreshOnly:O=false,replaceTargets:A,parallelism:L,compactWarnings:x,testDirectory:I}=e;const $=new c.Logger(w);const F=new a.State(t,E,C);await F.init();await F.acquireLock(S,k);try{let c;if(T){const e=n(6928);const s=e.resolve(t,T);if(!(0,r.existsSync)(s)){$.error(`Failed to load "${T}" as a plan file\n\nstat ${s}: no such file or directory`)}try{const e=(0,r.readFileSync)(s,"utf-8");const n=JSON.parse(e);c={changes:n.changes||[],hasChanges:n.changes&&n.changes.length>0,state:new a.State(t)};await c.state.init()}catch(e){$.error(`Failed to load "${T}" as a plan file\n\nError parsing JSON: ${e.message}`);return}}else{const n=R||e.scope;const r=n||e.scope;const i=(0,y.resolveScopes)(r);let a=[];let d=F;for(const e of i){if(P&&!O){console.log(s.MSG_ACQUIRING_LOCK);await(0,f.refreshState)({dir:t,scope:e,state:F,logger:$,silent:false,parallelismRaw:L,target:R})}const n=await(0,u.calculatePlan)({dir:t,scope:e,variables:_,statePath:E,backupPath:C,target:R,destroyPlan:false,refreshOnly:O,preLoadedState:F,lock:S,lockTimeout:k,replaceTargets:A,compactWarnings:x,testDirectory:I});a.push(...n.changes);d=n.state}c={changes:a,hasChanges:a.length>0,state:d};o.resource.summary(c.changes,false,{state:c.state});if(!c.hasChanges){await F.save();return}if(!v){(0,y.assertApprovalAllowed)(v,D);const e=await(0,p.askApproval)();if(!e){l.logger.push({type:"error",title:"error asking for approval: interrupted",detail:[]});return}}}if(T&&!c.hasChanges){console.log("No changes found in the provided plan file.");return}const j=await(0,m.createCommandContext)({dir:t,verbose:w,lock:false});if(!j)return;const M=j.adapter||j.github;let N=0;let B=0;let U=0;const resolvePayloadMilestone=async e=>{if(typeof e.milestone==="string"&&e.milestone){e.milestone=await M.getMilestoneByTitle(e.milestone)}else if(!e.milestone){delete e.milestone}};const linkSubIssues=async(e,t)=>{if(e.resourceType.endsWith("testplan")&&e.scenario.custom?.testruns){for(const n of e.scenario.custom.testruns){const e=F.getResources("testrun").filter((e=>e.identity.endsWith(n)||e.identity.includes(n)));if(e.length>1){const t=Array.from(new Set(e.map((e=>e.identity))));$.warn(`Rule '${n}' in Testplan matches multiple Testruns. Linking all of them:\n`+t.map((e=>` - ${e}`)).join("\n")+`\nIf this was unintentional, specify the full file path.`)}for(const n of e){if(n?.attributes?.issueNumber){try{const e=await M.getIssue(n.attributes.issueNumber);if(e&&e.id){if(M.addSubIssue)await M.addSubIssue(t,e.id);console.log(` -> Linked testrun ${n.identity} as sub-issue to testplan`)}}catch(e){console.log(` -> Failed to link testrun ${n.identity} as sub-issue: ${e.message}`)}}}}}};const W=L?parseInt(String(L),10)||1:1;const G=new b.DependencyResolver(t);let q=c.changes;try{q=G.sortTopologically(c.changes,(e=>e.identity),(e=>e.scenario?.tags?e.scenario.tags.map((e=>typeof e==="string"?e:e.name)):[]))}catch(e){l.logger.push({type:"error",title:"Circular dependency detected",detail:[e.message],close:true});throw e}await(0,g.executeInBatches)(q,W,(async e=>{try{if(e.action==="add"){const t=(0,h.formatResourceAddress)(e.resourceType,e.identity);console.log(`${t}: Creating...`);const n=Date.now();const s=o.resource.evaluate(e.resourceType,e.scenario,{state:F,testDirectory:I});await resolvePayloadMilestone(s);const r=await M.createIssue(s);if(r.node_id&&M.addToProject){const e=await M.addToProject(r.node_id);if(e&&s.custom_fields&&M.updateProjectItemFields){await M.updateProjectItemFields(e,s.custom_fields)}}const a=(0,h.elapsedSeconds)(n);const c=M.formatRemoteId(r.number);console.log((0,i.green)(`${t}: Creation complete after ${a}s [id=${c}]`));await linkSubIssues(e,r.number);F.upsertResource({type:e.resourceType,identity:e.identity,attributes:{localHash:e.localHash,remoteId:c,issueNumber:r.number,title:s.title,body:s.body,labels:s.labels,assignees:s.assignees,milestone:s.milestone||undefined,custom_fields:s.custom_fields,createdAt:r.created_at,updatedAt:r.updated_at,...s.status?{status:s.status}:{},...e.resourceType.endsWith("testrun")?{testcases:s.testcases||{},metadata:s.metadata||{}}:{},...e.resourceType.endsWith("testplan")?{testruns:s.testruns||{},metadata:s.metadata||{}}:{}},lastApplied:(new Date).toISOString()});await linkSubIssues(e,r.number);N++}else if(e.action==="replace"){const t=(0,h.formatResourceAddress)(e.resourceType,e.identity);const n=e.remoteId??"";console.log(`${t}: Replacing... [id=${n}]`);const s=Date.now();if(e.issueNumber){await M.updateIssue(e.issueNumber,{state:"closed"})}const r=o.resource.evaluate(e.resourceType,e.scenario,{state:F,testDirectory:I});await resolvePayloadMilestone(r);const a=await M.createIssue(r);if(a.node_id&&M.addToProject){const e=await M.addToProject(a.node_id);if(e&&r.custom_fields&&M.updateProjectItemFields){await M.updateProjectItemFields(e,r.custom_fields)}}const c=(0,h.elapsedSeconds)(s);const l=M.formatRemoteId(a.number);console.log((0,i.green)(`${t}: Replacement complete after ${c}s [id=${l}]`));await linkSubIssues(e,a.number);F.upsertResource({type:e.resourceType,identity:e.identity,attributes:{localHash:e.localHash,remoteId:l,issueNumber:a.number,title:r.title,body:r.body,labels:r.labels,assignees:r.assignees,milestone:r.milestone||undefined,custom_fields:r.custom_fields,createdAt:a.created_at,updatedAt:a.updated_at,...r.status?{status:r.status}:{},...e.resourceType.endsWith("testrun")?{testcases:r.testcases||{},metadata:r.metadata||{}}:{},...e.resourceType.endsWith("testplan")?{testruns:r.testruns||{},metadata:r.metadata||{}}:{}},lastApplied:(new Date).toISOString()});U++;N++}else if(e.action==="change"){const t=(0,h.formatResourceAddress)(e.resourceType,e.identity);const n=e.remoteId??"";console.log(`${t}: Modifying... [id=${n}]`);const s=Date.now();const r=o.resource.evaluate(e.resourceType,e.scenario,{state:F,testDirectory:I});await resolvePayloadMilestone(r);const a=await M.updateIssue(e.issueNumber,r);if(a.node_id&&M.addToProject){const e=await M.addToProject(a.node_id);if(e&&r.custom_fields&&M.updateProjectItemFields){await M.updateProjectItemFields(e,r.custom_fields)}}const c=(0,h.elapsedSeconds)(s);console.log((0,i.green)(`${t}: Modifications complete after ${c}s [id=${n}]`));await linkSubIssues(e,a.number);F.upsertResource({type:e.resourceType,identity:e.identity,attributes:{localHash:e.localHash,remoteId:n,issueNumber:e.issueNumber,title:r.title,body:r.body,labels:r.labels,assignees:r.assignees,milestone:r.milestone||undefined,custom_fields:r.custom_fields,createdAt:a.created_at,updatedAt:a.updated_at,...r.status?{status:r.status}:{},...e.resourceType.endsWith("testrun")?{testcases:r.testcases||{},metadata:r.metadata||{}}:{},...e.resourceType.endsWith("testplan")?{testruns:r.testruns||{},metadata:r.metadata||{}}:{}},lastApplied:(new Date).toISOString()});B++}else if(e.action==="destroy"){const t=(0,h.formatResourceAddress)(e.resourceType,e.identity);const n=e.remoteId??"";console.log(`${t}: Destroying... [id=${n}]`);const s=Date.now();if(e.issueNumber){await M.closeIssue(e.issueNumber)}const r=(0,h.elapsedSeconds)(s);console.log((0,i.green)(`${t}: Destruction complete after ${r}s [id=${n}]`));F.removeResource(e.identity);U++}}catch(t){l.logger.push({type:"error",title:`${t.message}`,detail:[` with ${e.resourceType}.${e.identity}`]})}}));console.log("");await F.save();console.log((0,i.green)((0,i.bold)(`Apply complete! Resources: ${N} added, ${B} changed, ${U} destroyed.`)));const H=new d.OutputResolver(t);const K=H.resolve(F,_);if(Object.keys(K).length>0){F.setOutputs(K);await F.save();console.log("\n"+(0,i.bold)("Outputs:\n"));console.log(H.format(K))}}finally{await F.releaseLock()}};t.applyCmd=applyCmd},9540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.destroyCmd=void 0;const s=n(465);const r=n(1227);const i=n(1227);const o=n(6028);const a=n(8480);const c=n(5301);const l=n(2978);const u=n(7442);const d=n(8169);const f=n(2043);const destroyCmd=async e=>{const{dir:t=".",autoApprove:n=false,verbose:p=false,target:h,lock:m=true,lockTimeout:g="0s",input:y=true,statePath:b,backupPath:v}=e;const w=new r.Logger(p);return(0,d.withStateLock)({dir:t,statePath:b,backupPath:v,lock:m,lockTimeout:g},(async r=>{const m=h||e.scope;const g=m||e.scope;const w=(0,d.resolveScopes)(g);const T=w.flatMap((e=>{const t=o.SCOPE_RESOURCE_MAP[e];if(!t)return[];const n=r.getResources(t);return h?n.filter((t=>(0,u.matchesTarget)(t.identity,h,e)||t.type&&(0,u.matchesTarget)(t.type,h,e))):n}));if(T.length===0){console.log("No resources to destroy. State is empty.");return}(0,d.assertApprovalAllowed)(n,y);const S=new f.LifecycleResolver(t);const k=T.filter((e=>{const t=S.getLifecycle(e.identity,e.attributes.labels||[]);return t.prevent_destroy}));if(k.length>0){const e=k.map((e=>`Resource ${(0,l.formatResourceAddress)(e.type,e.identity)} has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or target other resources.`));i.logger.push({type:"error",title:"Instance cannot be destroyed",detail:e,close:true});throw new Error(`Instance cannot be destroyed: ${k.map((e=>e.identity)).join(", ")} has lifecycle.prevent_destroy set.`)}let D=0;for(const e of w){if(!Object.prototype.hasOwnProperty.call(o.SCOPE_RESOURCE_MAP,e)){throw new Error(`Invalid scope: ${e}`)}let d=r.getResources(o.SCOPE_RESOURCE_MAP[e]);if(h){d=d.filter((t=>(0,u.matchesTarget)(t.identity,h,e)||t.type&&(0,u.matchesTarget)(t.type,h,e)))}if(d.length===0){console.log(`No resources found in state for scope '${e}'.`);continue}console.log((0,s.bold)(`\n${o.TITLE_APP} will destroy the following resources in scope '${e}':\n`));for(const e of d){const t=e.attributes.remoteId??"";console.log(` ${(0,s.red)("-")} ${(0,l.formatResourceAddress)(e.type,e.identity)} [id=${t}]`)}console.log(`\n${(0,s.bold)("Plan:")} 0 to add, 0 to change, ${d.length} to destroy.\n`);if(!n&&y){const t=await(0,c.askDestroyApproval)(d.length);if(!t){i.logger.push({type:"error",title:`Destruction of scope '${e}' cancelled.`,detail:[]});continue}}console.log("");const f=await(0,a.createCommandContext)({dir:t,verbose:p,statePath:b,backupPath:v,lock:false,silent:false});if(!f)return;const m=f.adapter||f.github;for(const e of d){const t=(0,l.formatResourceAddress)(e.type,e.identity);const n=e.attributes.remoteId??"";console.log(`${t}: Destroying... [id=${n}]`);const o=Date.now();try{if(e.attributes.issueNumber){await m.closeIssue(e.attributes.issueNumber)}r.removeResource(e.identity);const i=(0,l.elapsedSeconds)(o);console.log((0,s.green)(`${t}: Destruction complete after ${i}s [id=${n}]`));D++}catch(e){i.logger.push({type:"error",title:`Failed to destroy ${t}: ${e.message}`,detail:[]})}}}if(typeof r.save==="function")await r.save();if(D>0){console.log("");console.log((0,s.green)((0,s.bold)(`Destroy complete! ${D} resource(s) destroyed.`)))}}))};t.destroyCmd=destroyCmd},5083:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.diffCmd=t.hashScenario=void 0;const o=n(465);const a=n(9896);const c=n(6928);const l=i(n(3785));const u=n(4489);const d=n(5392);const f=n(9922);const p=n(7066);const h=n(1227);const m=n(6028);const g=n(8480);const y=n(8169);const b=n(9606);const v=n(7442);const w=n(2978);const T=n(2043);const S=n(5124);const k=n(4483);Object.defineProperty(t,"hashScenario",{enumerable:true,get:function(){return k.hashScenario}});function getStatusIcon(e){switch(e){case"synced":return(0,o.green)("✔");case"modified_locally":return(0,o.yellow)("~");case"new_local":return(0,o.cyan)("+");case"orphaned_remote":return(0,o.red)("-")}}function getStatusLabel(e){switch(e){case"synced":return"synced";case"modified_locally":return"modified locally";case"new_local":return"new (not applied)";case"orphaned_remote":return"orphaned (not in config)"}}function promptUser(e,t){return new Promise((n=>{e.question(t,(e=>n(e.trim())))}))}const diffCmd=async e=>{const{dir:t=".",testDirectory:n,verbose:s=false,remote:r=false,interactive:i=false,statePath:a,backupPath:l,target:g}=e;const b=new h.Logger(s);const S=Boolean(r);const D=g||e.scope;const _=new u.Config(t);const E=n?(0,c.resolve)(t,n):(0,c.resolve)(t);const C=e.variables||new f.VariableParser(undefined,undefined,t);const R=new d.Parser(E,C);const P=R.content();const O=new p.State(t,a,l);await O.init();if(S){await executeRemoteDrift(t,E,D,O,_,R,P,i,s);return}const A=[];const L=(0,y.resolveScopes)(D);for(const e of L){const n=_.getMatch?.(e);const s=P.filter((t=>(0,v.matchesScope)(t,e,n)));const r={identity:_.getIdentity(e),fields:_.getFields(e)};let i=R.filter(s,r,e)||[];if(g){i=i.filter((t=>{const n=t.custom?.identity?`${t.uri}.${t.custom.identity}`:t.uri;return(0,v.matchesTarget)(n,g,e)||(0,v.matchesTarget)(t.uri,g,e)}))}const o=m.SCOPE_RESOURCE_MAP[e];let a=O.getResources(o);if(g){a=a.filter((t=>(0,v.matchesTarget)(t.identity,g,e)||t.type&&(0,v.matchesTarget)(t.type,g,e)))}const c=new Map(a.map((e=>[(0,w.normalizeAddress)(e.identity),e])));const l=new Set;const u=new T.LifecycleResolver(t);for(const t of i){const n=t.custom?.identity;if(!n)continue;let s;if(n.startsWith(t.uri)||n===t.uri){s=n}else{s=`${t.uri}.${n}`}const r=(0,w.normalizeAddress)(s);l.add(r);const i=t.tags?t.tags.map((e=>typeof e==="string"?e:e.name)):[];const o=u.getLifecycle(s,i);const a=(0,k.hashScenario)(t,e,o.ignore_changes);const d=c.get(r);if(!d){A.push({identity:s,status:"new_local",localHash:a})}else if(d.attributes.localHash!==a){A.push({identity:s,status:"modified_locally",localHash:a,stateHash:d.attributes.localHash,remoteId:d.attributes.remoteId})}else{A.push({identity:s,status:"synced",localHash:a,stateHash:d.attributes.localHash,remoteId:d.attributes.remoteId})}}for(const e of a){if(!l.has((0,w.normalizeAddress)(e.identity))){A.push({identity:e.identity,status:"orphaned_remote",stateHash:e.attributes.localHash,remoteId:e.attributes.remoteId})}}}console.log("");console.log((0,o.bold)("Drift Detection Report"));console.log("═".repeat(60));console.log("");const x=A.filter((e=>e.status==="synced")).length;const I=A.filter((e=>e.status==="modified_locally")).length;const $=A.filter((e=>e.status==="new_local")).length;const F=A.filter((e=>e.status==="orphaned_remote")).length;for(const e of A){const t=getStatusIcon(e.status);const n=getStatusLabel(e.status);const r=e.remoteId?(0,o.dim)(` [id=${e.remoteId}]`):"";console.log(` ${t} ${(0,o.bold)(e.identity)}: ${n}${r}`);if(s&&e.status==="modified_locally"&&e.localHash&&e.stateHash){console.log(` Local: ${(0,o.dim)(e.localHash.substring(0,12))}...`);console.log(` State: ${(0,o.dim)(e.stateHash.substring(0,12))}...`)}}console.log("");console.log((0,o.bold)("Summary:"));console.log(` ${(0,o.green)("✔")} ${x} synced`);if(I>0)console.log(` ${(0,o.yellow)("~")} ${I} modified locally`);if($>0)console.log(` ${(0,o.cyan)("+")} ${$} new (not applied)`);if(F>0)console.log(` ${(0,o.red)("-")} ${F} orphaned (not in config)`);console.log("")};t.diffCmd=diffCmd;async function executeRemoteDrift(e,t,n,s,r,i,c,u,d){console.log("");console.log((0,o.bold)(`# ${m.TITLE_APP} Remote Drift Detection`));console.log((0,o.dim)("Checking local configuration and state against live remote provider..."));console.log("═".repeat(60));console.log("");const f=await(0,g.createCommandContext)({dir:e,verbose:d,lock:false,silent:true});if(!f){console.error((0,o.red)("Failed to initialize provider context for remote drift check."));return}const p=f.adapter||f.github;const h=(0,y.resolveScopes)(n);const T=[];for(const e of h){const t=m.SCOPE_RESOURCE_MAP[e];const n=s.getResources(t);const a=r.getMatch?.(e);const l=c.filter((t=>(0,v.matchesScope)(t,e,a)));const u={identity:r.getIdentity(e),fields:r.getFields(e)};const f=i.filter(l,u,e)||[];for(const e of n){const n=e.attributes.issueNumber;if(!n)continue;const s=(0,w.normalizeAddress)(e.identity);const r=f.find((e=>{const t=e.custom?.identity;if(!t)return false;const n=t.startsWith(e.uri)||t===e.uri?t:`${e.uri}.${t}`;return(0,w.normalizeAddress)(n)===s||(0,w.normalizeAddress)(t)===s}));try{const s=await p.getIssue(n);if(!s){T.push({identity:e.identity,resourceType:t,issueNumber:n,differences:[{field:"status",local:"exists in state",remote:"not found on remote"}],remoteIssue:null,scenario:r});continue}const i=[];const o=s.state==="closed";if(o){i.push({field:"state",local:"open/tracked",remote:"closed on remote"})}const a=r?.name||e.attributes.title||"";if(a&&s.title&&a.trim()!==s.title.trim()){i.push({field:"title",local:a,remote:s.title})}const c=Array.isArray(e.attributes.labels)?e.attributes.labels:[];const l=Array.isArray(s.labels)?s.labels.map((e=>typeof e==="string"?e:e.name||"")):[];if(!(0,S.arraysEqual)(c,l)){i.push({field:"labels",local:`[${c.join(", ")}]`,remote:`[${l.join(", ")}]`})}if(i.length>0){T.push({identity:e.identity,resourceType:t,issueNumber:n,filePath:r?.uri,differences:i,isClosed:o,remoteIssue:s,scenario:r})}}catch(e){if(d)console.warn((0,o.yellow)(`Could not fetch issue #${n}: ${e.message}`))}}}if(T.length===0){console.log((0,o.green)("✔ No remote drift detected. Local configuration and state are fully synchronized with remote."));console.log("");return}console.log((0,o.yellow)(`Found ${T.length} resource(s) with remote drift:\n`));for(const e of T){console.log(` ${(0,o.yellow)("~")} ${(0,o.cyan)(e.resourceType)}.${(0,o.bold)(e.identity)} (Issue #${e.issueNumber})`);for(const t of e.differences){console.log(` Field ${(0,o.bold)(t.field)}:`);console.log(` - Local: ${(0,o.red)(t.local)}`);console.log(` + Remote: ${(0,o.green)(t.remote)}`)}console.log("")}if(u&&T.length>0){console.log((0,o.bold)("Interactive Drift Resolution"));console.log((0,o.dim)("You can choose how to handle each drifted resource.\n"));const e=l.createInterface({input:process.stdin,output:process.stdout});try{for(const t of T){console.log(`Action for resource ${(0,o.bold)(t.identity)}:`);console.log(` Enter 'pull' to update local file, 'overwrite' to keep local, or 'skip' to ignore.\n`);const n=await promptUser(e," Enter a value: ");const r=n.toLowerCase().trim();if(r==="pull"||r==="1"){if(t.filePath&&(0,a.existsSync)(t.filePath)&&t.remoteIssue){const e=Array.isArray(t.remoteIssue.labels)?t.remoteIssue.labels.map((e=>typeof e==="string"?e:e.name||"")):[];const n=(0,b.updateFeatureScenario)(t.filePath,t.scenario?.name||"",t.remoteIssue.title,e);if(n){const n=s.getResources(t.resourceType).find((e=>e.identity===t.identity));if(n){n.attributes.title=t.remoteIssue.title;n.attributes.labels=e;s.upsertResource(n)}console.log((0,o.green)(` ✔ Updated ${t.filePath} successfully!\n`))}else{console.log((0,o.yellow)(` Could not write changes to ${t.filePath}\n`))}}else{console.log((0,o.yellow)(` No local file mapped for ${t.identity}. Cannot pull automatically.\n`))}}else if(r==="overwrite"||r==="2"){console.log((0,o.cyan)(` → Kept local version. Will overwrite remote on next apply.\n`))}else{console.log((0,o.dim)(` → Skipped.\n`))}}await s.save()}finally{e.close()}}else if(!u){console.log((0,o.dim)(`Tip: Run 'testform diff --remote --interactive' (or -i) to resolve drift interactively.\n`))}}},6597:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ephemeralCmd=void 0;t.getEphemeralBaseDir=getEphemeralBaseDir;t.getEphemeralSandboxDir=getEphemeralSandboxDir;t.isValidSandboxId=isValidSandboxId;const s=n(6928);const r=n(9896);const i=n(465);const o=n(8314);const a=n(9540);const c=n(6028);function getEphemeralBaseDir(e){return(0,s.resolve)(e,".testform","ephemeral")}function getEphemeralSandboxDir(e,t){return(0,s.join)(getEphemeralBaseDir(e),t)}function isValidSandboxId(e){return/^[a-zA-Z0-9_\-\.]+$/.test(e)}const ephemeralCmd=async e=>{const{subcommand:t,id:n,dir:l=".",testDirectory:u,scope:d="all",autoApprove:f=false,force:p=false,json:h=false,verbose:m=false}=e;if(!t){console.error((0,i.red)(`\nError: Missing subcommand for ${c.TITLE_CLI} ephemeral.`));console.log(`\nUsage:`);console.log(` ${c.TITLE_CLI} ephemeral up <id> [options] Deploy an isolated ephemeral sandbox`);console.log(` ${c.TITLE_CLI} ephemeral down <id> [options] Destroy all remote issues and clean sandbox`);console.log(` ${c.TITLE_CLI} ephemeral list [options] List all active ephemeral sandboxes`);console.log(` ${c.TITLE_CLI} ephemeral show <id> [options] Inspect an ephemeral sandbox\n`);process.exit(1)}const g=getEphemeralBaseDir(l);switch(t){case"up":case"apply":{if(!n){console.error((0,i.red)("\nError: Expected an ephemeral sandbox ID (e.g., pr-42, branch-login)."));process.exit(1)}if(!isValidSandboxId(n)){console.error((0,i.red)(`\nError: Invalid sandbox ID "${n}". Use alphanumeric characters, hyphens, and underscores.`));process.exit(1)}const e=getEphemeralSandboxDir(l,n);if(!(0,r.existsSync)(e)){(0,r.mkdirSync)(e,{recursive:true})}const t=(0,s.join)(e,"testform.state");const a=(0,s.join)(e,"testform.state.backup");const p=(0,s.join)(e,"metadata.json");let h={id:n,createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString(),scope:String(d)};if((0,r.existsSync)(p)){try{const e=JSON.parse((0,r.readFileSync)(p,"utf8"));h.createdAt=e.createdAt||h.createdAt}catch{}}(0,r.writeFileSync)(p,JSON.stringify(h,null,2),"utf8");console.log((0,i.cyan)((0,i.bold)(`\n🚀 Initializing ephemeral QA sandbox: `)+(0,i.bold)(n)));console.log((0,i.dim)(` Isolated state: ${t}\n`));await(0,o.applyCmd)({dir:l,testDirectory:u,target:d==="all"?undefined:d,autoApprove:Boolean(f),verbose:Boolean(m),statePath:t,backupPath:a});console.log((0,i.green)((0,i.bold)(`\n✔ Ephemeral sandbox "${n}" successfully deployed!`)));console.log((0,i.gray)(` State location: ${t}`));console.log((0,i.cyan)(` To tear down this sandbox and close all created remote issues:`));console.log((0,i.bold)(` $ ${c.TITLE_CLI} ephemeral down ${n} --auto-approve\n`));break}case"down":case"destroy":{if(!n){console.error((0,i.red)("\nError: Expected an ephemeral sandbox ID (e.g., pr-42, branch-login)."));process.exit(1)}const e=getEphemeralSandboxDir(l,n);const t=(0,s.join)(e,"testform.state");const o=(0,s.join)(e,"testform.state.backup");if(!(0,r.existsSync)(e)||!(0,r.existsSync)(t)){if(!p){console.log((0,i.yellow)(`\nNo active ephemeral sandbox found with ID "${n}". Nothing to destroy.`));return}}console.log((0,i.yellow)((0,i.bold)(`\n🧹 Tearing down ephemeral QA sandbox: `)+(0,i.bold)(n)));if((0,r.existsSync)(t)){await(0,a.destroyCmd)({dir:l,autoApprove:Boolean(f),input:!f,verbose:Boolean(m),statePath:t,backupPath:o})}if((0,r.existsSync)(e)){(0,r.rmSync)(e,{recursive:true,force:true})}console.log((0,i.green)((0,i.bold)(`\n✨ Ephemeral sandbox "${n}" is completely destroyed!`)));console.log((0,i.dim)(` Remote issues closed and isolated state directory removed. Zero orphans left.\n`));break}case"list":{if(!(0,r.existsSync)(g)){if(h){console.log("[]")}else{console.log((0,i.yellow)("\nNo active ephemeral sandboxes found.\n"))}return}const e=(0,r.readdirSync)(g,{withFileTypes:true});const t=[];for(const n of e){if(n.isDirectory()){const e=n.name;const i=(0,s.join)(g,e);const o=(0,s.join)(i,"testform.state");const a=(0,s.join)(i,"metadata.json");let c=0;let l="Unknown";let u="all";if((0,r.existsSync)(o)){try{const e=JSON.parse((0,r.readFileSync)(o,"utf8"));c=(e.resources||[]).length}catch{}}if((0,r.existsSync)(a)){try{const e=JSON.parse((0,r.readFileSync)(a,"utf8"));l=e.createdAt?new Date(e.createdAt).toLocaleString():"Unknown";u=e.scope||"all"}catch{}}t.push({id:e,resourcesCount:c,createdAt:l,scope:u})}}if(h){console.log(JSON.stringify(t,null,2));return}if(t.length===0){console.log((0,i.yellow)("\nNo active ephemeral sandboxes found.\n"));return}console.log((0,i.bold)(`\nActive Ephemeral Sandboxes (${t.length}):\n`));const n="SANDBOX ID".padEnd(20);const o="RESOURCES".padEnd(12);const a="SCOPE".padEnd(12);const c="CREATED AT";console.log((0,i.dim)(` ${n} ${o} ${a} ${c}`));console.log((0,i.dim)(` ${"─".repeat(19)} ${"─".repeat(11)} ${"─".repeat(11)} ${"─".repeat(20)}`));for(const e of t){const t=(0,i.cyan)(e.id.padEnd(20));const n=(0,i.green)(String(e.resourcesCount).padEnd(12));const s=(0,i.yellow)(e.scope.padEnd(12));const r=(0,i.dim)(e.createdAt);console.log(` ${t} ${n} ${s} ${r}`)}console.log("");break}case"show":{if(!n){console.error((0,i.red)("\nError: Expected an ephemeral sandbox ID."));process.exit(1)}const e=getEphemeralSandboxDir(l,n);const t=(0,s.join)(e,"testform.state");const o=(0,s.join)(e,"metadata.json");if(!(0,r.existsSync)(e)||!(0,r.existsSync)(t)){console.error((0,i.red)(`\nError: Ephemeral sandbox "${n}" not found.`));process.exit(1)}let a={};let c={};try{a=JSON.parse((0,r.readFileSync)(t,"utf8"))}catch{}if((0,r.existsSync)(o)){try{c=JSON.parse((0,r.readFileSync)(o,"utf8"))}catch{}}if(h){console.log(JSON.stringify({metadata:c,state:a},null,2));return}const u=a.resources||[];console.log((0,i.bold)(`\nEphemeral Sandbox: `)+(0,i.cyan)((0,i.bold)(n)));console.log((0,i.dim)(`Created: `)+(c.createdAt?new Date(c.createdAt).toLocaleString():"N/A"));console.log((0,i.dim)(`State file: `)+t);console.log((0,i.dim)(`Tracked resources: `)+(0,i.green)(u.length));if(u.length>0){console.log((0,i.bold)(`\nResources:`));for(const e of u){const t=e.attributes?.issueNumber?`#${e.attributes.issueNumber}`:"(unassigned)";console.log(` - ${(0,i.cyan)(e.type)}: ${e.identity} ${(0,i.dim)(t)}`)}}console.log("");break}default:console.error((0,i.red)(`\nUnknown ephemeral subcommand: "${t}".`));console.log(`Available subcommands: up, down, list, show\n`);process.exit(1)}};t.ephemeralCmd=ephemeralCmd},2353:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.fmtCmd=void 0;const s=n(9896);const r=n(465);const i=n(1227);const o=n(9606);function printUnifiedDiff(e,t,n){console.log(`--- ${e}`);console.log(`+++ ${e}`);const s=t.split("\n");const i=n.split("\n");const o=Math.max(s.length,i.length);for(let e=0;e<o;e++){const t=s[e];const n=i[e];if(t!==n){if(t!==undefined)console.log((0,r.red)(`-${t}`));if(n!==undefined)console.log((0,r.green)(`+${n}`))}}}const fmtCmd=async e=>{const{dir:t=".",check:n=false,diff:r=false,list:a=true,write:c=true,recursive:l=false}=e;const u=(0,o.findFeatureFiles)(t,l);if(u.length===0){console.log("No .feature files found.");return}let d=0;for(const e of u){const t=(0,s.readFileSync)(e,"utf8");const i=(0,o.formatGherkin)(t);if(t!==i){d++;if(r){printUnifiedDiff(e,t,i)}else if(!n&&c){(0,s.writeFileSync)(e,i,"utf8")}if(a&&!r){console.log(e)}}}if(n){if(d>0){console.log(`\n${d} file(s) would be reformatted.`);process.exit(3)}else{i.logger.success("All files are formatted correctly.")}}};t.fmtCmd=fmtCmd},3634:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.forceUnlockCmd=void 0;const o=i(n(3785));const a=n(465);const c=n(7066);const l=n(6028);const forceUnlockCmd=async e=>{const{dir:t=".",lockId:n,force:s=false,statePath:r}=e;const i=new c.State(t,r);await i.init();const executeUnlock=async()=>{const e=await i.forceUnlock(n);if(e.success){console.log((0,a.green)(`\n${l.TITLE_APP} state has been successfully unlocked!\n`));if(!s){console.log(`The state has been unlocked, and ${l.TITLE_APP} commands should now be able to`);console.log(`obtain a new lock on the remote state.`)}}else{if(e.currentLockId){console.error((0,a.red)(`Error: Lock ID does not match.\n\nExpected: ${n}\nActual: ${e.currentLockId}\n`))}else if(e.error){console.error((0,a.red)(`${e.error}\n`))}process.exit(1)}};if(s){await executeUnlock();return}console.log(`Do you really want to force-unlock?`);console.log(` ${l.TITLE_APP} will remove the lock on the remote state.`);console.log(` This will allow local ${l.TITLE_APP} commands to modify this state, even though it`);console.log(` may be still be in use. Only 'yes' will be accepted to confirm.`);console.log("");const u=o.createInterface({input:process.stdin,output:process.stdout});return new Promise(((e,t)=>{u.question(" Enter a value: ",(async n=>{u.close();try{if(n.trim().toLowerCase()==="yes"){await executeUnlock()}else{console.error((0,a.red)(`\nUnlock cancelled.\n`));process.exitCode=1}e()}catch(e){t(e)}}))}))};t.forceUnlockCmd=forceUnlockCmd},31:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.FUNCTIONS_CATALOG=void 0;t.functionsCmd=functionsCmd;const r=s(n(465));const i=n(6066);const o=n(2825);const{bold:a,cyan:c,green:l,yellow:u,gray:d,white:f,magenta:p}=r.default;t.FUNCTIONS_CATALOG={lower:{name:"lower",category:"String & Text",signature:"lower(string)",returnType:"string",description:"Converts all letters in a string to lowercase.",arguments:[{name:"string",type:"string",description:"The string to convert."}],examples:[{expression:'lower("HELLO WORLD")',result:'"hello world"'},{expression:"lower(var.environment)",result:'"staging"'}]},upper:{name:"upper",category:"String & Text",signature:"upper(string)",returnType:"string",description:"Converts all letters in a string to uppercase.",arguments:[{name:"string",type:"string",description:"The string to convert."}],examples:[{expression:'upper("testform")',result:'"TESTFORM"'},{expression:"upper(var.tier)",result:'"ENTERPRISE"'}]},trim:{name:"trim",category:"String & Text",signature:"trim(string, [cutset])",returnType:"string",description:"Removes leading and trailing whitespace or specified characters.",arguments:[{name:"string",type:"string",description:"The input string."},{name:"cutset",type:"string",optional:true,description:"Characters to strip (defaults to whitespace)."}],examples:[{expression:'trim(" hello ")',result:'"hello"'},{expression:'trim("!?hello!?", "!?")',result:'"hello"'}]},trimprefix:{name:"trimprefix",category:"String & Text",signature:"trimprefix(string, prefix)",returnType:"string",description:"Removes the specified prefix from the beginning of a string if present.",arguments:[{name:"string",type:"string",description:"The input string."},{name:"prefix",type:"string",description:"The prefix to remove."}],examples:[{expression:'trimprefix("v1.2.3", "v")',result:'"1.2.3"'}]},trimsuffix:{name:"trimsuffix",category:"String & Text",signature:"trimsuffix(string, suffix)",returnType:"string",description:"Removes the specified suffix from the end of a string if present.",arguments:[{name:"string",type:"string",description:"The input string."},{name:"suffix",type:"string",description:"The suffix to remove."}],examples:[{expression:'trimsuffix("index.case.feature", ".case.feature")',result:'"index"'}]},startswith:{name:"startswith",category:"String & Text",signature:"startswith(string, prefix)",returnType:"boolean",description:"Returns true if the string begins with the specified prefix.",arguments:[{name:"string",type:"string",description:"The string to test."},{name:"prefix",type:"string",description:"The prefix to check."}],examples:[{expression:'startswith(var.image_tag, "v")',result:"true"}]},endswith:{name:"endswith",category:"String & Text",signature:"endswith(string, suffix)",returnType:"boolean",description:"Returns true if the string ends with the specified suffix.",arguments:[{name:"string",type:"string",description:"The string to test."},{name:"suffix",type:"string",description:"The suffix to check."}],examples:[{expression:'endswith(var.filename, ".feature")',result:"true"}]},replace:{name:"replace",category:"String & Text",signature:"replace(string, search, replacement)",returnType:"string",description:"Replaces all occurrences of a search string with a replacement string.",arguments:[{name:"string",type:"string",description:"The source string."},{name:"search",type:"string",description:"Substring to search for."},{name:"replacement",type:"string",description:"Replacement string."}],examples:[{expression:'replace("10.0.0.1", ".", "-")',result:'"10-0-0-1"'}]},split:{name:"split",category:"String & Text",signature:"split(separator, string)",returnType:"list",description:"Divides a string into a list of substrings separated by the specified delimiter.",arguments:[{name:"separator",type:"string",description:"Delimiter used to split."},{name:"string",type:"string",description:"The input string."}],examples:[{expression:'split(",", "dev,staging,prod")',result:'["dev", "staging", "prod"]'}]},join:{name:"join",category:"String & Text",signature:"join(separator, list)",returnType:"string",description:"Concatenates elements of a list into a single string separated by the delimiter.",arguments:[{name:"separator",type:"string",description:"Delimiter inserted between elements."},{name:"list",type:"list",description:"List of elements to concatenate."}],examples:[{expression:'join("-", ["test", "run", "1"])',result:'"test-run-1"'}]},format:{name:"format",category:"String & Text",signature:"format(format, ...args)",returnType:"string",description:"Formats a string using verbs (%s for string, %d for integer, %j for JSON, %% for literal %).",arguments:[{name:"format",type:"string",description:"Format string containing placeholders."},{name:"args",type:"any...",description:"Values to interpolate."}],examples:[{expression:'format("%s/%s", var.base_url, "api/v1")',result:'"https://example.com/api/v1"'},{expression:'format("run-%03d", 5)',result:'"run-5"'}]},substr:{name:"substr",category:"String & Text",signature:"substr(string, offset, length)",returnType:"string",description:"Extracts a substring from offset up to length characters.",arguments:[{name:"string",type:"string",description:"The source string."},{name:"offset",type:"number",description:"Zero-based starting position."},{name:"length",type:"number",description:"Number of characters to extract."}],examples:[{expression:'substr("abcdef", 1, 3)',result:'"bcd"'}]},coalesce:{name:"coalesce",category:"Collections & Logic",signature:"coalesce(...args)",returnType:"any",description:"Returns the first argument that is not null, undefined, or empty string.",arguments:[{name:"args",type:"any...",description:"Sequence of values to evaluate."}],examples:[{expression:'coalesce(var.custom_title, var.default_title, "Untitled")',result:'"Untitled"'}]},lookup:{name:"lookup",category:"Collections & Logic",signature:"lookup(map, key, [default])",returnType:"any",description:"Retrieves the value of a key from a map, returning default if not present.",arguments:[{name:"map",type:"map",description:"The map to query."},{name:"key",type:"string",description:"The attribute name."},{name:"default",type:"any",optional:true,description:"Fallback value if key is not found."}],examples:[{expression:'lookup(local.env_urls, var.env, "http://localhost:3000")',result:'"https://api.dev.com"'}]},contains:{name:"contains",category:"Collections & Logic",signature:"contains(list_or_string, value)",returnType:"boolean",description:"Checks whether a list contains an element or a string contains a substring.",arguments:[{name:"list_or_string",type:"list | string",description:"The collection or text."},{name:"value",type:"any",description:"Value to search for."}],examples:[{expression:'contains(["dev", "staging", "prod"], var.environment)',result:"true"},{expression:'contains("hello world", "world")',result:"true"}]},length:{name:"length",category:"Collections & Logic",signature:"length(value)",returnType:"number",description:"Returns the number of elements in a list, keys in a map, or characters in a string.",arguments:[{name:"value",type:"list | map | string",description:"Target value."}],examples:[{expression:'length(["a", "b", "c"])',result:"3"},{expression:'length("hello")',result:"5"}]},element:{name:"element",category:"Collections & Logic",signature:"element(list, index)",returnType:"any",description:"Retrieves an element at the specified index with safe wrapping modulo behavior.",arguments:[{name:"list",type:"list",description:"Target list."},{name:"index",type:"number",description:"Zero-based index."}],examples:[{expression:'element(["a", "b", "c"], 1)',result:'"b"'}]},slice:{name:"slice",category:"Collections & Logic",signature:"slice(list, start, [end])",returnType:"list",description:"Returns a sublist of elements from start index up to end index.",arguments:[{name:"list",type:"list",description:"Target list."},{name:"start",type:"number",description:"Starting index."},{name:"end",type:"number",optional:true,description:"Ending index (exclusive)."}],examples:[{expression:'slice(["a", "b", "c", "d"], 1, 3)',result:'["b", "c"]'}]},merge:{name:"merge",category:"Collections & Logic",signature:"merge(...maps)",returnType:"map",description:"Merges multiple maps into a single map, with rightmost keys overriding leftmost.",arguments:[{name:"maps",type:"map...",description:"Maps to merge."}],examples:[{expression:"merge({ a: 1 }, { b: 2, a: 3 })",result:"{ a: 3, b: 2 }"}]},env:{name:"env",category:"System & Encoding",signature:"env(name)",returnType:"string",description:"Reads an environment variable from the host process.",arguments:[{name:"name",type:"string",description:"Environment variable name."}],examples:[{expression:'env("CI")',result:'"true"'},{expression:'env("GITHUB_TOKEN")',result:'"ghp_..."'}]},uuid:{name:"uuid",category:"System & Encoding",signature:"uuid()",returnType:"string",description:"Generates a random RFC 4122 version 4 UUID.",arguments:[],examples:[{expression:"uuid()",result:'"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"'}]},timestamp:{name:"timestamp",category:"System & Encoding",signature:"timestamp()",returnType:"string",description:"Returns current UTC date and time formatted in ISO 8601.",arguments:[],examples:[{expression:"timestamp()",result:'"2026-10-25T05:00:00.000Z"'}]},jsonencode:{name:"jsonencode",category:"System & Encoding",signature:"jsonencode(value)",returnType:"string",description:"Serializes a value into a standard JSON string.",arguments:[{name:"value",type:"any",description:"Value or data structure to serialize."}],examples:[{expression:"jsonencode({ active: true, retries: 3 })",result:'\'{"active":true,"retries":3}\''}]},jsondecode:{name:"jsondecode",category:"System & Encoding",signature:"jsondecode(string)",returnType:"any",description:"Parses a JSON string into its native data structure (object, list, etc.).",arguments:[{name:"string",type:"string",description:"JSON formatted string."}],examples:[{expression:'jsondecode(\'{"env":"qa"}\')',result:'{ env: "qa" }'}]},file:{name:"file",category:"System & Encoding",signature:"file(path)",returnType:"string",description:"Reads the contents of a local file as UTF-8 text.",arguments:[{name:"path",type:"string",description:"Relative or absolute file path."}],examples:[{expression:'file("config.json")',result:'"{\\n \\"version\\": 1\\n}"'}]}};async function functionsCmd(e){const{name:n,evalExpr:s}=e;if(s){try{const e=(0,o.evaluateExpression)(s,{vars:{},locals:{},extraFunctions:i.standardFunctions});console.log(a(c("\nExpression Evaluation:")));console.log(` ${d("Input:")} ${f(s)}`);console.log(` ${d("Type:")} ${u(typeof e==="object"?Array.isArray(e)?"list":"map":typeof e)}`);console.log(` ${d("Result:")} ${l(JSON.stringify(e,null,2))}\n`)}catch(e){console.error(r.default.red(`\nEvaluation Error: ${e.message}\n`));throw e}return}if(n){const e=n.toLowerCase().trim();const s=t.FUNCTIONS_CATALOG[e];if(!s){console.log(r.default.red(`\nUnknown function: "${n}".`));console.log(d(`Run 'testform functions' to view all available built-in functions.\n`));return}console.log(a(c(`\nTestform Expression Function: ${p(s.name)}`)));console.log(` ${d("Category:")} ${s.category}`);console.log(` ${d("Signature:")} ${u(s.signature)} -> ${c(s.returnType)}`);console.log(` ${d("Description:")} ${f(s.description)}`);if(s.arguments.length>0){console.log(a("\nArguments:"));for(const e of s.arguments){const t=e.optional?d(" (optional)"):"";console.log(` - ${c(e.name)} ${u(`[${e.type}]`)}${t}: ${e.description}`)}}else{console.log(a("\nArguments: none"))}if(s.examples.length>0){console.log(a("\nExamples:"));for(const e of s.examples){console.log(` ${d("$")} ${f(e.expression)}`);console.log(` ${l("=>")} ${c(e.result)}`);if(e.note)console.log(` ${d(`(${e.note})`)}`)}}console.log("");return}console.log(a(c("\nTestform Expression Engine — Built-in Functions Catalog\n")));console.log(d("Available in locals.yml expressions, variables.yml validation conditions, and CLI:"));const h=["String & Text","Collections & Logic","System & Encoding"];for(const e of h){console.log(a(u(`\n• ${e}:`)));const n=Object.values(t.FUNCTIONS_CATALOG).filter((t=>t.category===e));for(const e of n){const t=e.signature.padEnd(38," ");console.log(` ${c(t)} ${d("→")} ${f(e.description)}`)}}console.log(d("\nRun 'testform functions <name>' for detailed documentation and examples on a specific function."));console.log(d("Run 'testform functions --eval \"<expression>\"' to test expressions live in your terminal.\n"))}},7651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.generateCmd=void 0;const s=n(6928);const r=n(9896);const i=n(4489);const o=n(1227);const a=n(9606);const generateCmd=async e=>{const{dir:t,scope:n,title:c}=e;const l=new i.Config(t);const u=l.getConvention(n);const d=l.getIdentity(n);const f=n.replace("test","");const p=u?.directory||"";const h=u?.filename||`{YYYYMMDD}_{HHmmss}.${f}.feature`;const m=new Date;const g=m.toISOString().split("T")[0].replace(/-/g,"");const y=m.toTimeString().split(" ")[0].replace(/:/g,"");const b=m.getTime().toString();let v=c;let w="";if(v){w=v.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}let T=h.replace(/{YYYYMMDD}/g,g).replace(/{HHmmss}/g,y).replace(/{timestamp}/g,b).replace(/{slug}/g,w);T=T.replace(/^[_\-]+/,"").replace(/[_\-]+(\.)/g,"$1");const S=Math.random().toString(16).substring(2,8);if(T.endsWith(".feature")){if(T.endsWith(`.${f}.feature`)){T=T.replace(`.${f}.feature`,`_${S}.${f}.feature`)}else{T=T.replace(`.feature`,`_${S}.feature`)}}else{if(T.endsWith(`.${f}`)){T=T.replace(`.${f}`,`_${S}.${f}.feature`)}else{T+=`_${S}.${f}.feature`}}if(!v){v=T.replace(/\.feature$/,"")}const k=(0,s.join)(t,p,T);if((0,r.existsSync)(k)){o.logger.error(`File already exists: ${k}`);process.exit(1)}if(e.rules&&e.rules.length>0){const n=(0,a.findFeatureFiles)(t,true);for(const t of e.rules){const e=t.includes(".feature.")?t.slice(0,t.indexOf(".feature.")+8):t;const s=n.some((t=>t.endsWith(e)||t.includes(e)));if(!s){o.logger.error([`Not Found`,`The feature file for Rule '${e}' does not exist in the workspace.`]);process.exit(1)}}}const D=(0,s.dirname)(k);if(!(0,r.existsSync)(D)){(0,r.mkdirSync)(D,{recursive:true})}const _=(n==="testrun"||n==="testplan")&&d?(0,a.findNextIdentity)(t,d):null;let E=`@${n}`;if(_){E+=` ${_}`}E+=`\nFeature: ${v}\n`;if(e.rules&&e.rules.length>0){E+=`\n`;for(const t of e.rules){E+=` Rule: ${t}\n`}}try{(0,r.writeFileSync)(k,E,"utf-8");o.logger.success(`Generated ${n} file: ${k}`,{bold:true})}catch(e){o.logger.error(`Failed to generate file: ${e.message}`);process.exit(1)}};t.generateCmd=generateCmd},9478:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.graphCmd=void 0;const s=n(465);const r=n(5392);const i=n(9922);const o=n(1138);const a=n(2978);function escapeDot(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function toMermaidId(e){return"node_"+e.replace(/[^a-zA-Z0-9_]/g,"_")}function escapeMermaidLabel(e){return e.replace(/"/g,"#quot;").replace(/[\r\n]+/g," ")}function findCycleEdges(e){const t=new Map;for(const n of e){if(!t.has(n.from))t.set(n.from,[]);t.get(n.from).push(n.to)}const n=new Map;const s=new Set;function dfs(e,r){n.set(e,1);r.push(e);for(const i of t.get(e)||[]){const t=n.get(i)||0;if(t===1){s.add(`${e}->${i}`);const t=r.indexOf(i);if(t!==-1){for(let e=t;e<r.length-1;e++){s.add(`${r[e]}->${r[e+1]}`)}s.add(`${r[r.length-1]}->${i}`)}}else if(t===0){dfs(i,r)}}r.pop();n.set(e,2)}for(const e of t.keys()){if((n.get(e)||0)===0){dfs(e,[])}}return s}const graphCmd=async(e={})=>{const{dir:t=".",scope:s="testcase",drawCycles:c=false,format:l="dot",type:u}=e;const d=e.variables||new i.VariableParser(undefined,undefined,t);const f=new r.Parser(t,d);const p=f.content();const h=new o.DependencyResolver(t);const m=p.filter((e=>!e.uri.endsWith(".run.feature")&&!e.uri.endsWith(".plan.feature")));const g=p.filter((e=>e.uri.endsWith(".run.feature")));const y=p.filter((e=>e.uri.endsWith(".plan.feature")));const b=new Map;for(const e of y){if(!b.has(e.uri)){b.set(e.uri,{name:e.feature?.name||"Unnamed Plan",testruns:[]})}if(e.rule?.name)b.get(e.uri).testruns.push(e.rule.name)}const v=Array.from(b.values());const w=new Map;for(const e of g){if(!w.has(e.uri)){w.set(e.uri,{name:e.feature?.name||"Unnamed Run",testcases:[],identity:e.custom?.identity||e.feature?.name||"",uri:e.uri})}if(e.rule?.name)w.get(e.uri).testcases.push(e.rule.name);else if(e.name)w.get(e.uri).testcases.push(`${e.feature?.name}.${e.name}`)}const T=Array.from(w.values());if(v.length===0&&T.length===0&&m.length===0){console.log("No test configurations found.");return}function findTcs(e){let t="*";let s=e;if(e.includes(".feature.")){const n=e.indexOf(".feature.");s=e.substring(0,n+8);t=e.substring(n+9)}else if(e.endsWith(".feature")){s=e;t="*"}else if(e.includes(".")){const n=e.split(".");t=n.pop()||"*";s=n.join(".")}const r=m.filter((e=>{const n=!s||e.uri.endsWith(s)||e.uri.includes(s);const r=t==="*"||e.name===t||e.name.includes(t)||e.custom?.identity===t;return n&&r}));const i=Array.from(new Set(r.map((e=>e.uri))));if(i.length>1){if(t!=="*"){const{logger:e}=n(1227);e.error(`Ambiguous reference for Scenario '${t}' under Rule '${s}'. It matches multiple files:\n`+i.map((e=>` - ${e}`)).join("\n")+`\nPlease specify the full file path in your Rule to disambiguate.`)}else{const{logger:e}=n(1227);e.warn(`Rule '${s}' matches multiple feature files. Processing all of them:\n`+i.map((e=>` - ${e}`)).join("\n")+`\nIf this was unintentional, specify the full file path.`)}}return r}function findMatchingTcNode(e){const t=(0,a.normalizeAddress)(e);for(const n of m){const s=n.custom?.identity||`${n.uri}.${n.name}`;const r=n.tags?n.tags.map((e=>typeof e==="string"?e:e.name)):[];const i=r.map((e=>(0,a.normalizeAddress)(`${n.uri}.${e}`)));if((0,a.addressesMatch)(s,e)||(0,a.addressesMatch)(n.name,e)||(0,a.addressesMatch)(n.uri,e)||i.some((t=>(0,a.addressesMatch)(t,e)))||t.endsWith((0,a.normalizeAddress)(n.name))||t.endsWith((0,a.normalizeAddress)(s))){return`testcase.${n.name}`}}return`testcase.${e}`}function getTcDependencies(e){const t=e.tags?e.tags.map((e=>typeof e==="string"?e:e.name)):[];const n=[e.name,`${e.uri}.${e.name}`,e.custom?.identity,...t.map((t=>`${e.uri}.${t}`)),...t.map((t=>`${e.uri}.@${t.replace(/^@/,"")}`)),...t].filter(Boolean);const s=new Set;for(const e of n){const n=h.getDependencies(e,t);for(const e of n)s.add(e)}return Array.from(s)}const S=(l||"dot").toLowerCase();if(S==="tree"){renderTreeGraph({testplans:v,testruns:T,testcases:m,scope:s,drawCycles:c,depResolver:h,findTcs:findTcs,getTcDependencies:getTcDependencies});return}const k=new Map;const D=[];const _=u?` (${u})`:"";if(s==="testplan"||s==="testcase"){for(const e of v){const t=`testplan.${e.name}`;k.set(t,{id:t,label:`${e.name}${_}`,kind:"testplan"});for(const n of e.testruns){const e=(0,a.normalizeAddress)(n);const r=T.find((t=>(0,a.addressesMatch)(t.identity,n)||t.name===n||t.name.endsWith(n)||n.endsWith(t.name)||(0,a.normalizeAddress)(t.uri).endsWith(e)));if(r){const e=`testrun.${r.name}`;k.set(e,{id:e,label:`${r.name}${_}`,kind:"testrun"});D.push({from:t,to:e,kind:"contains"});if(s!=="testplan"){for(const t of r.testcases){const n=findTcs(t);for(const t of n){const n=`testcase.${t.name}`;k.set(n,{id:n,label:`${t.name}${_}`,kind:"testcase"});D.push({from:e,to:n,kind:"contains"});const s=getTcDependencies(t);for(const e of s){const t=findMatchingTcNode(e);if(!k.has(t)){k.set(t,{id:t,label:`${e}${_}`,kind:"testcase"})}D.push({from:t,to:n,kind:"depends_on",label:"depends_on"})}}}}}}}if(s!=="testplan"){const e=new Set(v.flatMap((e=>e.testruns||[])));const t=T.filter((t=>!Array.from(e).some((e=>(0,a.addressesMatch)(t.identity,e)||t.name===e||(0,a.normalizeAddress)(t.uri).endsWith((0,a.normalizeAddress)(e))||e.endsWith(t.name)))));for(const e of t){const t=`testrun.${e.name}`;k.set(t,{id:t,label:`${e.name}${_}`,kind:"testrun"});for(const n of e.testcases){const e=findTcs(n);for(const n of e){const e=`testcase.${n.name}`;k.set(e,{id:e,label:`${n.name}${_}`,kind:"testcase"});D.push({from:t,to:e,kind:"contains"});const s=getTcDependencies(n);for(const t of s){const n=findMatchingTcNode(t);if(!k.has(n)){k.set(n,{id:n,label:`${t}${_}`,kind:"testcase"})}D.push({from:n,to:e,kind:"depends_on",label:"depends_on"})}}}}}}else if(s==="testrun"){for(const e of T){const t=`testrun.${e.name}`;k.set(t,{id:t,label:`${e.name}${_}`,kind:"testrun"});for(const n of e.testcases){const e=findTcs(n);for(const n of e){const e=`testcase.${n.name}`;k.set(e,{id:e,label:`${n.name}${_}`,kind:"testcase"});D.push({from:t,to:e,kind:"contains"});const s=getTcDependencies(n);for(const t of s){const n=findMatchingTcNode(t);if(!k.has(n)){k.set(n,{id:n,label:`${t}${_}`,kind:"testcase"})}D.push({from:n,to:e,kind:"depends_on",label:"depends_on"})}}}}}const E=findCycleEdges(D);if(S==="mermaid"){renderMermaidGraph({nodes:Array.from(k.values()),edges:D,cycleEdges:E,drawCycles:c})}else{renderDotGraph({nodes:Array.from(k.values()),edges:D,cycleEdges:E,drawCycles:c})}};t.graphCmd=graphCmd;function renderDotGraph(e){const{nodes:t,edges:n,cycleEdges:s,drawCycles:r}=e;const i=[];i.push("digraph G {");i.push(' compound = "true";');i.push(' newrank = "true";');i.push(' subgraph "root" {');for(const e of t){const t=`[root] ${e.id}`;i.push(` "${escapeDot(t)}" [label = "${escapeDot(e.label)}", shape = "box"];`)}for(const e of n){const t=`[root] ${e.from}`;const n=`[root] ${e.to}`;const o=`${e.from}->${e.to}`;const a=s.has(o);if(a&&r){i.push(` "${escapeDot(t)}" -> "${escapeDot(n)}" [color = "red", penwidth = 2.0];`)}else if(e.label){i.push(` "${escapeDot(t)}" -> "${escapeDot(n)}" [label = "${escapeDot(e.label)}"];`)}else{i.push(` "${escapeDot(t)}" -> "${escapeDot(n)}";`)}}i.push(" }");i.push("}");console.log(i.join("\n"))}function renderMermaidGraph(e){const{nodes:t,edges:n,cycleEdges:s,drawCycles:r}=e;const i=[];i.push("graph TD");i.push(" subgraph root");for(const e of t){const t=toMermaidId(e.id);const n=e.kind==="testplan"?"📦 ":e.kind==="testrun"?"📂 ":"📄 ";i.push(` ${t}["${n}${escapeMermaidLabel(e.label)} (${e.kind})"]`)}for(const e of n){const t=toMermaidId(e.from);const n=toMermaidId(e.to);const o=`${e.from}->${e.to}`;const a=s.has(o);if(a&&r){i.push(` ${t} -.->|cycle| ${n}`);i.push(` style ${t} stroke:#ff0000,stroke-width:2px;`);i.push(` style ${n} stroke:#ff0000,stroke-width:2px;`)}else if(e.label){i.push(` ${t} --\x3e|${e.label}| ${n}`)}else{i.push(` ${t} --\x3e ${n}`)}}i.push(" end");console.log(i.join("\n"))}function renderTreeGraph(e){const{testplans:t,testruns:n,scope:r,drawCycles:i,depResolver:o,findTcs:c,getTcDependencies:l}=e;console.log((0,s.bold)("Test Infrastructure Graph\n"));const link=e=>i?(0,s.magenta)(e):e;if(r==="testplan"||r==="testcase"){for(const e of t){const t=e.name;console.log(`📦 ${(0,s.cyan)((0,s.bold)(t))} ${(0,s.dim)(`(testplan)`)}`);const i=e.testruns;for(const[e,t]of i.entries()){const o=e===i.length-1;const u=o?"└── ":"├── ";const d=(0,a.normalizeAddress)(t);const f=n.find((e=>(0,a.addressesMatch)(e.identity,t)||e.name===t||e.name.endsWith(t)||t.endsWith(e.name)||(0,a.normalizeAddress)(e.uri).endsWith(d)));if(f){const e=f.name;console.log(` ${link(u)}📂 ${(0,s.green)(e)} ${(0,s.dim)(`(testrun)`)}`);if(r==="testcase"){const e=f.testcases;for(let t=0;t<e.length;t++){const n=e.at(t);const r=t===e.length-1;const i=o?" ":"│ ";const a=c(n);if(a.length>0){for(let e=0;e<a.length;e++){const t=a.at(e);const n=r&&e===a.length-1;const o=n?"└── ":"├── ";console.log(` ${i}${link(o)}📄 ${t.name} ${(0,s.dim)(`(testcase)`)}`);const c=l(t);if(c.length>0){const e=n?" ":"│ ";console.log(` ${i}${e}└── 🔗 ${(0,s.cyan)("depends_on:")} ${(0,s.dim)(c.join(", "))}`)}}}else{const e=r?"└── ":"├── ";console.log(` ${i}${link(e)}📄 ${(0,s.dim)(n+" (Not found)")}`)}}}}else{console.log(` ${link(u)}📂 ${(0,s.dim)(t+" (Not found)")}`)}}console.log("")}if(r==="testcase"){const e=new Set(t.flatMap((e=>e.testruns||[])));const r=n.filter((t=>!Array.from(e).some((e=>(0,a.addressesMatch)(t.identity,e)||t.name===e||(0,a.normalizeAddress)(t.uri).endsWith((0,a.normalizeAddress)(e))||e.endsWith(t.name)))));if(r.length>0){console.log((0,s.bold)("Orphaned Test Runs (Not linked to any testplan)\n"));for(const e of r){const t=e.name;console.log(`📂 ${(0,s.green)(t)} ${(0,s.dim)(`(testrun)`)}`);const n=e.testcases;for(let e=0;e<n.length;e++){const t=n.at(e);const r=e===n.length-1;const i=c(t);if(i.length>0){for(let e=0;e<i.length;e++){const t=i.at(e);const n=r&&e===i.length-1;const o=n?"└── ":"├── ";console.log(` ${link(o)}📄 ${t.name} ${(0,s.dim)(`(testcase)`)}`);const a=l(t);if(a.length>0){const e=n?" ":"│ ";console.log(` ${e}└── 🔗 ${(0,s.cyan)("depends_on:")} ${(0,s.dim)(a.join(", "))}`)}}}else{const e=r?"└── ":"├── ";console.log(` ${link(e)}📄 ${t}`)}}console.log("")}}}}else if(r==="testrun"){for(const e of n){const t=e.name;console.log(`📂 ${(0,s.green)((0,s.bold)(t))} ${(0,s.dim)(`(testrun)`)}`);const n=e.testcases;for(let e=0;e<n.length;e++){const t=n.at(e);const r=e===n.length-1;const i=c(t);if(i.length>0){for(let e=0;e<i.length;e++){const t=i.at(e);const n=r&&e===i.length-1;const o=n?"└── ":"├── ";console.log(` ${link(o)}📄 ${t.name} ${(0,s.dim)(`(testcase)`)}`)}}else{const e=r?"└── ":"├── ";console.log(` ${link(e)}📄 ${(0,s.dim)(t+" (Not found)")}`)}}console.log("")}}}},2541:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.importCmd=void 0;const r=n(6928);const i=n(4489);const o=n(7066);const a=n(5320);const c=n(942);const l=n(5392);const u=n(7862);const d=n(465);const f=n(4483);const p=s(n(9896));const h=n(1227);const m=n(6028);const g=n(7442);const importCmd=async e=>{const{dir:t=".",scope:n,identityArg:s,issueNumber:y,lock:b=true,lockTimeout:v="0s",statePath:w,backupPath:T}=e;const S=n||(0,g.detectScopeFromTarget)(s)||"testcase";const k=new h.Logger;console.log((0,d.bold)(`Importing ${S} ${s} from issue #${y}...`));const D=new o.State(t,w,T);await D.init();await D.acquireLock(b,v);try{const e=D;const n=(0,r.resolve)(t);const o=new i.Config(t);const h=o.getConfig();let b;if(o.getAdapterType()==="local"){b=new c.LocalAdapter(t)}else{b=new a.GitHubAdapter(o.getGitHub())}const v=parseInt(y,10);if(isNaN(v)){console.error((0,d.red)(`Invalid issue number: ${y}`));process.exit(1)}let w=s;const T=new i.Config(t);const k={identity:T.getIdentity(S),fields:T.getFields(S)};const _=new l.Parser(t);const E=_.content();const C=E.filter((e=>(0,g.matchesScope)(e,S)));let R=_.filter(C,k,S)||[];const P=R.find((e=>{const t=e.custom?.identity;if(!t)return false;const n=S==="testrun"||S==="testplan"?t:`${e.uri}.${t}`;return n===s||n.endsWith(s)||s.endsWith(n)}));if(P){const e=P.custom?.identity;w=S==="testrun"||S==="testplan"?e||s:`${P.uri}.${e}`;console.log(`Resolved short identity to full identity: ${w}`)}else{console.log((0,d.yellow)(`Warning: Could not find matching local scenario for identity: ${s}`));console.log((0,d.yellow)(`Import will proceed with the exact identity provided, but it might not map to any local file.`))}console.log(`Fetching issue #${v} from GitHub...`);const O=await b.getIssue(v);if(!O){console.error((0,d.red)(`Issue #${v} not found in GitHub repository.`));process.exit(1)}if(O.state==="closed"){console.log((0,d.yellow)(`Warning: Issue #${v} is currently closed.`))}if(!Object.prototype.hasOwnProperty.call(m.SCOPE_RESOURCE_MAP,S)){console.error((0,d.red)(`Invalid scope: ${S}`));process.exit(1)}const A=m.SCOPE_RESOURCE_MAP[S];const L=b.formatRemoteId(v);let x={};if(O.node_id){x=b.getProjectItemFields?await b.getProjectItemFields(O.node_id):{}}if(!P&&S==="testcase"&&w.includes(".")){const e=w.lastIndexOf(".");const t=w.slice(0,e);const s=w.slice(e+1);const i=(0,r.normalize)((0,r.resolve)(n,t));if(!i.startsWith(n)){console.error((0,d.red)(`Invalid file path in identity.`));process.exit(1)}if(p.default.existsSync(i)){const e=C.find((e=>e.uri===i));const t=e?.feature?.tags||[];const n=new Map;const r=p.default.readFileSync(i,"utf-8");const o=r.match(/Background:([\s\S]*?)(?=\n\s*@|\n\s*Scenario:|$)/);if(o){const e=o[1];for(const t of e.split("\n")){const e=t.match(/^\s*(?:\*|Given|When|Then|And)\s+field\s+([A-Za-z0-9_.\- ]+?)\s*=\s*(.+)$/i);if(e){n.set(e[1].trim().toLowerCase(),e[2].trim())}}}const a=T.getFields(S)||[];const c=[];const l=[];const u=O.labels||[];const f=a.find((e=>e.name==="labels"));const h=f?.default?String(f.default):"";for(const e of u){if(t.includes(e)||t.includes(`@${e}`))continue;if(e===h)continue;c.push(`@${e}`)}for(const e of a){if(e.name==="labels"||e.name==="assignees"||e.name==="milestone")continue;const s=Object.keys(x).find((t=>t.toLowerCase()===e.name.toLowerCase()));const r=s?x[s]:"";if(!r)continue;const i=e.default?String(e.default):"";const o=r.toLowerCase()===i.toLowerCase();const a=n.get(e.name.toLowerCase());const u=a&&a.toLowerCase()===r.toLowerCase();if(o||u)continue;if(e.source==="tag"){const e=r.startsWith("@")?r:`@${r}`;if(!t.includes(e)&&!t.includes(e.substring(1))){c.push(e)}}else if(e.source==="step"){l.push(`* field ${e.name} = ${r}`)}}let m=O.body||"";const g=m.match(/```gherkin\n([\s\S]*?)```/);if(g){m=g[1].trim()}else{m=m.trim()}if(m){const e=c.length>0?` ${s} ${c.join(" ")}\n`:` ${s}\n`;const t=l.length>0?l.map((e=>` ${e}\n`)).join(""):"";const n=m.split("\n").map((e=>` ${e}`)).join("\n")+`\n`;const r=`\n\n${e} Scenario: ${O.title}\n${t}${n}`;p.default.appendFileSync(i,r);console.log((0,d.green)(`\nAutomatically reconstructed scenario code in ${i}`))}}}let I="";if(P){I=(0,f.hashScenario)(P)}const $=P?u.resource.evaluate(A,P,{state:D}):null;const F=$;e.upsertResource({type:A,identity:w,attributes:{title:O.title,body:O.body||"",labels:O.labels?.filter((e=>e.name)).map((e=>e.name))??[],assignees:O.assignees||[],milestone:O.milestone||undefined,custom_fields:x,remoteId:L,issueNumber:O.number,localHash:I},lastApplied:(new Date).toISOString()});e.save();console.log((0,d.green)(`\nImport successful!`));console.log(`State updated for ${(0,d.bold)(`${A}.${w}`)} -> Issue #${v}`);console.log(`Run 'plan' to see if any local changes need to be applied.`)}finally{await D.save();await D.releaseLock()}};t.importCmd=importCmd},722:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.initCmd=t.hasValidFeatureFiles=t.EXPECTED_BACKEND_ARGS=void 0;const r=n(6028);const i=s(n(8815));const o=n(9896);const a=n(4489);const c=n(1227);const l=n(6928);const u=n(7066);const d=n(8081);const f=n(9606);const p=n(8742);const h=n(5301);const m=n(1859);t.EXPECTED_BACKEND_ARGS={local:["path","workspace_dir","workspace_dir_prefix"],s3:["bucket","key","region","endpoint","dynamodb_table","profile","namespace","force_path_style","forcepathstyle","encrypt","kms_key_id","role_arn","workspace_key_prefix","access_key","secret_key","token"],oci:["bucket","namespace","region","key","endpoint","profile","tenancy_id","compartment_id","fingerprint","private_key_path","user_id"],azurerm:["resource_group_name","storage_account_name","container_name","key","connection_string","environment","subscription_id","tenant_id","client_id","client_secret"],gcs:["bucket","prefix","credentials","impersonate_service_account"],github:["owner","repository","repo","branch","path","token_env","tokenenv","token"]};const hasValidFeatureFiles=e=>{const t=(0,f.findFeatureFiles)(e,true);for(const e of t){try{const t=(0,o.readFileSync)(e,"utf-8");if(/@(testcase|testrun|testplan)\b/i.test(t)){return true}}catch{}}return false};t.hasValidFeatureFiles=hasValidFeatureFiles;const resolvePaths=e=>({configPath:(0,l.join)(e,r.FILE_CONFIG),statePath:(0,l.join)(e,r.FILE_STATE)});const ensureWorkingDirectory=(e,t)=>{if((0,o.existsSync)(e))return;(0,o.mkdirSync)(e,{recursive:true});t.info(`Created ${e} directory`)};const createConfigIfNotExists=(e,t,n="local",s="github")=>{const a=(0,l.dirname)(e);for(const e of r.CONFIG_FILE_NAMES){if((0,o.existsSync)((0,l.join)(a,e))){return true}}let c="local";const u=(n||"local").toLowerCase().trim();const d=["local","github","s3","azurerm","gcs","oci"];if(!d.includes(u)){t.warn(`Unknown backend type "${n}". Defaulting to "local". (Supported: ${d.join(", ")})`)}if(u==="github"){c={github:{branch:"testform-state",path:"state/testform.state"}}}else if(u==="s3"){c={s3:{bucket:"<required>",region:"us-east-1",key:"testform.state",dynamodb_table:"<optional>"}}}else if(u==="oci"){c={oci:{bucket:"<required_oci_bucket>",namespace:"<required_namespace>",region:"us-ashburn-1",key:"testform.state"}}}else if(u==="azurerm"){c={azurerm:{resource_group_name:"<required>",storage_account_name:"<required>",container_name:"<required>",key:"testform.state"}}}else if(u==="gcs"){c={gcs:{bucket:"<required>",prefix:"testform/state"}}}let f={github:{owner:"<required>",repository:"<required>",token_env:"GITHUB_TOKEN"}};const p=(s||"github").toLowerCase().trim();if(p==="local"){f="local"}else if(p==="gitlab"){f={gitlab:{projectId:"<required>",token_env:"GITLAB_TOKEN"}}}const h={testform:{required_version:`>= ${r.VERSION_CONFIG}`,backend:c},provider:f,resource:{testcase:{match:"*.case.feature",scaffold:{directory:"testcase",filename:"{slug}_{YYYYMMDD}.case.feature"},fields:[]},testrun:{match:"*.run.feature",scaffold:{directory:"testrun",filename:"{slug}_{YYYYMMDD}.run.feature"},fields:[]},testplan:{match:"*.plan.feature",scaffold:{directory:"testplan",filename:"{slug}_{YYYYMMDD}.plan.feature"},fields:[]}}};(0,o.writeFileSync)(e,i.default.stringify(h),"utf-8");return false};const loadValidatedConfig=e=>{const t=new a.Config(e);return t};const printNextSteps=e=>{e.success(`${r.TITLE_APP} has been successfully initialized!`,{bold:true});e.blank();e.info(`You may now begin working with ${r.TITLE_APP}. Try running "${r.TITLE_CLI} plan" to see`);e.info(`any changes that are required for your test management resources. All ${r.TITLE_APP} commands`);e.info("should now work.");e.blank();e.info(`If you ever set or change modules or backend configuration for ${r.TITLE_APP},`);e.info("rerun this command to reinitialize your working directory. If you forget, other");e.info("commands will detect it and remind you to do so if necessary.")};const initCmd=async(e={})=>{const{dir:n=".",backendType:s="local",providerType:i="github",verbose:a=false,backendConfigRaw:f,lock:g=true,lockTimeout:y="0s",reconfigure:b=false,backendEnabled:v=true,isJson:w=false}=e;const T=new c.Logger(a,w);const S=resolvePaths(n);ensureWorkingDirectory(n,T);const k=(0,t.hasValidFeatureFiles)(n);if(!k){T.success(`${r.TITLE_APP} initialized in an empty directory!`,{bold:true});T.blank();T.info(`The directory has no ${r.TITLE_APP} feature files. You may begin working`);T.info(`with ${r.TITLE_APP} immediately by creating Gherkin feature files.`);return}const D=createConfigIfNotExists(S.configPath,T,s,i);if(v){T.info("Initializing the backend...",{bold:true})}const _=loadValidatedConfig(n);const E=_.getBackend();let C=E;const R=["local","github","s3","azurerm","gcs","oci"];if(v&&E){if(E.type===""){T.push({type:"error",title:"Unsupported backend type",detail:[`on ${r.FILE_CONFIG} line 2, in backend:`,' 2: backend: ""',""],extra:['There is no backend type named "".']});return}else if(E.type&&!R.includes(E.type.toLowerCase())){T.push({type:"error",title:"Unsupported backend type",detail:[`on ${r.FILE_CONFIG}, in backend:`,` backend: "${E.type}"`,""],extra:[`There is no backend type named "${E.type}".`]});return}}if(!v){C={type:"local",config:{}}}if(f){if(!E){T.push({type:"warning",title:"Missing backend configuration",extra:['-backend-config was used without a "backend" block in the configuration.',"","If you intended to override the default local backend configuration,","no action is required, but you may add an explicit backend block to your","configuration to clear this warning:","",' backend: "local"',"","However, if you intended to override a defined backend, please verify that","the backend configuration is present and valid."]})}else{const e=(0,u.parseBackendOverrides)(f,n);const s=(C?.type||"local").toLowerCase().trim();const r=t.EXPECTED_BACKEND_ARGS[s]||[];for(const t of Object.keys(e)){const e=t.toLowerCase().replace(/-/g,"_");if(!r.includes(e)){T.push({type:"error",title:"Invalid backend configuration argument",extra:[`The backend configuration argument "${t}" given on the command line is not`,"expected for the selected backend type."]});return}}}}const P=!D&&(C?.config?.bucket==="<required>"||C?.config?.bucket==="<required_oci_bucket>"||C?.config?.namespace==="<required_namespace>"||C?.config?.resource_group_name==="<required>"||C?.config?.storage_account_name==="<required>"||C?.type==="github"&&_.getGitHub()?.owner==="<required>");if(P){const e=_.getResolvedPath()?(0,l.basename)(_.getResolvedPath()):r.FILE_CONFIG;const t=_.getRequiredVersion?_.getRequiredVersion():_.getConfig().version;T.info(`- Configuration: ${e} (${t?"v"+t:"v"+r.VERSION_CONFIG})`);T.info(`- State backend: scaffolded (${C?.type||"local"})`);T.blank();T.info(`Notice: Backend configuration template created with placeholder '<required>' values.`);T.info(`Please update ${e} with your cloud/repo details, then rerun:`);T.info(` ${r.TITLE_CLI} init`);return}const O=new p.WorkspaceManager(n);const A=O.getActiveBackend();const L=(C?.type||"local").toLowerCase().trim();const x={...C?.config||{}};if(f){const e=(0,u.parseBackendOverrides)(f,n);Object.assign(x,e)}const I={type:L,config:x};const isBackendEqual=(e,t)=>{if(!e||!t)return false;if(e.type!==t.type)return false;const n=Object.keys(e.config||{}).filter((t=>e.config[t]!==undefined&&e.config[t]!==""));const s=Object.keys(t.config||{}).filter((e=>t.config[e]!==undefined&&t.config[e]!==""));if(n.length!==s.length)return false;for(const s of n){if(String(e.config[s]||"")!==String(t.config[s]||""))return false}return true};const $=v&&A!==null&&!isBackendEqual(A,I);if($){if(!b&&!e.migrateState){T.push({type:"error",title:"Backend configuration changed",extra:["A change in the backend configuration has been detected, which may require migrating existing","state.","",`If you wish to attempt automatic migration of the state, run "${r.TITLE_CLI} init -migrate-state".`,"If you wish to store the current configuration with no changes to the state, run",`"${r.TITLE_CLI} init -reconfigure".`]});return}}if(v&&!P){const t=(e.inputEnabled??true)&&(0,h.isInteractive)();if(L==="s3"){if(!x.bucket||x.bucket==="<required>"){if(t){const e=await(0,h.askBackendAttribute)("bucket","The name of the S3 bucket");if(e){x.bucket=e}}}if(!x.bucket||x.bucket==="<required>"){T.push({type:"error",title:"Missing bucket value",extra:['The "bucket" attribute must be set for the s3 backend.']});return}if(!x.key){if(t){const e=await(0,h.askBackendAttribute)("key","The path to the state file inside the bucket");if(e){x.key=e}}}if(!x.key){T.push({type:"error",title:"Missing key value",extra:['The "key" attribute must be set for the s3 backend.']});return}if(!x.region&&!process.env.AWS_REGION&&!process.env.AWS_DEFAULT_REGION){T.push({type:"error",title:"Missing region value",extra:['The "region" attribute or the "AWS_REGION" or "AWS_DEFAULT_REGION" environment variables must',"be set."]});return}}else if(L==="oci"){if(!x.bucket||x.bucket==="<required_oci_bucket>"){if(t){const e=await(0,h.askBackendAttribute)("bucket","The name of the OCI bucket");if(e){x.bucket=e}}}if(!x.bucket||x.bucket==="<required_oci_bucket>"){T.push({type:"error",title:"Missing bucket value",extra:['The "bucket" attribute must be set for the oci backend.']});return}if(!x.namespace||x.namespace==="<required_namespace>"){if(t){const e=await(0,h.askBackendAttribute)("namespace","The OCI Object Storage namespace");if(e){x.namespace=e}}}if(!x.namespace||x.namespace==="<required_namespace>"){T.push({type:"error",title:"Missing namespace value",extra:['The "namespace" attribute must be set for the oci backend.']});return}if(!x.key){if(t){const e=await(0,h.askBackendAttribute)("key","The path to the state file inside the bucket");if(e){x.key=e}}}if(!x.key){T.push({type:"error",title:"Missing key value",extra:['The "key" attribute must be set for the oci backend.']});return}}else if(L==="azurerm"){const e={resource_group_name:"The name of the Resource Group",storage_account_name:"The name of the Storage Account",container_name:"The name of the Storage Container",key:"The name of the blob file inside the storage container"};const n=["resource_group_name","storage_account_name","container_name","key"];for(const s of n){if(!x[s]||x[s]==="<required>"){if(t&&e[s]){const t=await(0,h.askBackendAttribute)(s,e[s]);if(t){x[s]=t}}}if(!x[s]||x[s]==="<required>"){T.push({type:"error",title:`Missing ${s} value`,extra:[`The "${s}" attribute must be set for the azurerm backend.`]});return}}}else if(L==="gcs"){if(!x.bucket||x.bucket==="<required>"){if(t){const e=await(0,h.askBackendAttribute)("bucket","The name of the GCS bucket");if(e){x.bucket=e}}}if(!x.bucket||x.bucket==="<required>"){T.push({type:"error",title:"Missing bucket value",extra:['The "bucket" attribute must be set for the gcs backend.']});return}}}if(v&&L!=="local"&&L!=="github"){if(L==="azurerm"){(0,d.ensureDriverInstalled)("@azure/storage-blob",T)}else if(L==="s3"||L==="oci"){(0,d.ensureDriverInstalled)("@aws-sdk/client-s3",T);if(x?.dynamodb_table&&x.dynamodb_table!=="<optional>"){(0,d.ensureDriverInstalled)("@aws-sdk/client-dynamodb",T)}}else if(L==="gcs"){(0,d.ensureDriverInstalled)("@google-cloud/storage",T)}}const F=new u.State(n,undefined,undefined,!v,f,I);try{await F.acquireLock(g,y);if(e.migrateState&&$&&A){T.info(`Migrating state from ${A.type} to ${I.type}...`);const e=new u.State(n,undefined,undefined,false,undefined,A);try{await e.init();const t=e.getState();await F.init();F.replaceState(t);await F.save();T.success(`Successfully migrated state to ${I.type} backend!`)}catch(e){T.error(`Failed to migrate state: ${e.message}`);return}}else{await F.init()}}catch(e){const t=(L||"local").toLowerCase();if(t==="s3"){const e=Boolean(x?.namespace||x?.endpoint?.includes("oraclecloud.com"));const t=e?"https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication.htm":"https://developer.hashicorp.com/terraform/language/backend/s3";T.push({type:"error",title:"No valid credential sources found",extra:[`Please see ${t}`,"for more information about providing credentials.","","Error: failed to refresh cached credentials, no EC2 IMDS role found, operation","error ec2imds: GetMetadata, request canceled, context deadline exceeded"]});return}else if(t==="gcs"){T.push({type:"error",title:"No valid credential sources found",extra:["Please see https://cloud.google.com/docs/authentication/provide-credentials-adc","for more information about providing credentials.","","Error: Google Cloud Application Default Credentials not found or invalid"]});return}else if(t==="azurerm"){T.push({type:"error",title:"No valid credential sources found",extra:["Please see https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/authentication","for more information about providing credentials.","","Error: Azure credentials not found (ARM_ACCESS_KEY, ARM_CLIENT_ID / ARM_CLIENT_SECRET, or connection string required)"]});return}else if(t==="oci"){T.push({type:"error",title:"No valid credential sources found",extra:["Please see https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_authentication.htm","for more information about providing credentials.","","Error: OCI credentials not found or invalid (check tenancy_id, fingerprint, and private_key_path)"]});return}else if(t==="github"){T.push({type:"error",title:"No valid credential sources found",extra:["Please see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens","for more information about providing credentials.","","Error: GitHub token not found or unauthorized (check GITHUB_TOKEN environment variable or login)"]});return}T.error(`Failed to initialize remote backend: ${e.message}`);return}finally{await F.releaseLock()}if(v){O.setActiveBackend(I);T.blank();T.info(`Successfully configured the backend "${I.type}"! ${r.TITLE_APP} will automatically`);T.info("use this backend unless the backend configuration changes.");T.blank()}const j=new m.ModuleRegistry(n);const M=j.getDeclaredModules();if(M.size>0){T.info("Initializing modules...",{bold:true});for(const[e,t]of M.entries()){if((0,m.isGitSource)(t.source)){T.info(`- Downloading ${t.source} for ${e}...`);const s=(0,m.parseGitSource)(t.source);const r=(0,l.join)(n,".testform","modules",e);if(!(0,o.existsSync)(r)){(0,o.mkdirSync)(r,{recursive:true})}T.info(`- Installed ${e} to .testform/modules/${e}`)}else{T.info(`- Using local module ${e} from ${t.source}`)}}T.blank()}T.info("Initializing provider plugins...",{bold:true});const N=_.getProviderType()||"github";T.info(`- Finding fromeroc9/${N} versions matching "1.0.0"...`);T.info(`- Installing fromeroc9/${N} v1.0.0...`);T.info(`- Installed fromeroc9/${N} v1.0.0`);const B=(0,l.join)(n,r.FILE_LOCK);if(!(0,o.existsSync)(B)){const e=(0,l.dirname)(B);if(!(0,o.existsSync)(e)){(0,o.mkdirSync)(e,{recursive:true})}const t={provider:{[`registry.testform.io/fromeroc9/${N}`]:{version:"1.0.0",constraints:">= 1.0.0",hashes:["h1:dGVzdGZvcm0tcHJvdmlkZXItbG9jay12ZXJpZmllZA=="]}}};(0,o.writeFileSync)(B,JSON.stringify(t,null,2),"utf-8");T.info(`\n${r.TITLE_APP} has created a lock file ${r.FILE_LOCK} to record the provider\nselections it made above. Include this file in your version control repository\nso that ${r.TITLE_APP} can guarantee to make the same selections by default when you\nrun "${r.TITLE_CLI} init" in the future.`)}else{T.info(`- Re-using previous version of fromeroc9/${N} from the dependency lock file`)}T.blank();printNextSteps(T)};t.initCmd=initCmd},7155:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.loginCmd=void 0;const o=n(465);const a=i(n(3785));const c=n(2633);const askQuestion=(e,t)=>new Promise((n=>{e.question(t,(e=>n(e.trim())))}));const loginCmd=async(e={})=>{let{hostname:t="github.com"}=e;const n=(t||"").trim().toLowerCase();if(n==="local"){console.error((0,o.bold)((0,o.red)(`\nError: The "local" provider does not require authentication.\n`)));process.exit(1)}if(n==="app.terraform.io"||n==="github")t="github.com";else if(n==="gitlab")t="gitlab.com";console.log(`\nTestForm must now request authentication credentials for ${(0,o.bold)(t)}.\nThese credentials will be stored locally at ~/.testform.d/credentials.json.\n`);const s=a.createInterface({input:process.stdin,output:process.stdout});try{const e=new c.Credentials;const n={};const r=await askQuestion(s,`Token (PAT) for ${t}: `);if(!r)throw new Error("Token cannot be empty.");n.token=r;e.setAuth(t,n);console.log(`\n${(0,o.green)("Success!")} Configuration saved for ${t}.`)}catch(e){console.log(`\n${(0,o.yellow)("Login aborted:")} ${e.message}`);process.exit(1)}finally{s.close()}};t.loginCmd=loginCmd},3834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.logoutCmd=void 0;const s=n(465);const r=n(2633);const logoutCmd=async(e={})=>{let{hostname:t="github.com"}=e;if(t==="app.terraform.io")t="github.com";const n=new r.Credentials;const i=n.removeToken(t);if(i){console.log(`\n${(0,s.green)("Success!")} Removed credentials for ${t}.`)}else{console.log(`\n${(0,s.yellow)("Warning:")} No credentials found for ${t}.`)}};t.logoutCmd=logoutCmd},3067:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.modulesCmd=void 0;const s=n(6928);const r=n(1859);const modulesCmd=async(e={})=>{const{dir:t=".",isJson:n=false}=e;const i=(0,s.resolve)(process.cwd(),t);const o=new r.ModuleRegistry(i);const a=o.getDeclaredModules();if(a.size===0){if(n){console.log(JSON.stringify({format_version:"1.0",modules:null}))}else{console.log("No modules found in configuration.")}return}if(n){const e=[];for(const[t,n]of a.entries()){let s=n.version||"";if(!s&&(0,r.isGitSource)(n.source)){const e=(0,r.parseGitSource)(n.source);if(e.ref){s=e.ref}}e.push({key:t,source:n.source,version:s})}console.log(JSON.stringify({format_version:"1.0",modules:e}));return}const c=Array.from(a.entries());console.log(`Modules declared by configuration:\n.`);c.forEach((([e,t],n)=>{const s=n===c.length-1;const i=s?"└──":"├──";let o=t.version||"";if(!o&&(0,r.isGitSource)(t.source)){const e=(0,r.parseGitSource)(t.source);if(e.ref){o=e.ref}}const a=o?` ${o}`:"";console.log(`${i} "${e}"[${t.source}]${a}`)}))};t.modulesCmd=modulesCmd},8973:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.outputCmd=void 0;const s=n(465);const r=n(7066);const i=n(1533);const o=n(9922);const a=n(6028);const c=`No state file was found!\n\nState management commands require a state file. Run this command\nin a directory where ${a.TITLE_CLI} has been run or use the -state flag\nto point the command to a specific state location.`;const outputCmd=async e=>{const{dir:t=".",name:n,statePath:a,backupPath:l,isJson:u=false,raw:d=false,variables:f}=e;const p=new r.State(t,a,l);if(typeof p.hasState==="function"&&!await p.hasState()){console.error((0,s.red)(c));process.exitCode=1;return}await p.init();const h=new i.OutputResolver(t);let m=p.getOutputs();if(!m||Object.keys(m).length===0){const e=f||new o.VariableParser(undefined,undefined,t);m=h.resolve(p,e);if(Object.keys(m).length>0){p.setOutputs(m);await p.save()}}try{const e=h.format(m,{json:u,raw:d,name:n});console.log(e)}catch(e){console.error((0,s.red)(e.message));process.exitCode=1}};t.outputCmd=outputCmd},4483:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.planCmd=void 0;t.hashScenario=hashScenario;t.calculatePlan=calculatePlan;const s=n(6982);const r=n(6028);const i=n(465);const o=n(7862);const a=n(4489);const c=n(5392);const l=n(2721);const u=n(7066);const d=n(1227);const f=n(9896);const p=n(1821);const h=n(6028);const m=n(2978);const g=n(6928);const y=n(7442);const b=n(8169);const v=n(2043);function hashScenario(e,t,n=[]){const r=JSON.parse(JSON.stringify(e));const i=new Set(n.map((e=>e.toLowerCase())));if(!t||t==="testcase"||i.has("title")||i.has("name")){r.name=""}if(!t||t==="testrun"||t==="testplan"||i.has("title")||i.has("name")){if(r.feature){r.feature.name=""}}if(i.has("tags")||i.has("labels")){r.tags=[];if(r.feature){r.feature.tags=[]}}if(i.has("steps")||i.has("body")){r.steps=[]}if(i.has("custom_fields")&&r.custom){delete r.custom.fields}return(0,s.createHash)("sha256").update(JSON.stringify(r)).digest("hex")}async function calculatePlan(e){const{dir:t,scope:n,variables:s,statePath:r,backupPath:f,target:p,destroyPlan:b=false,refreshOnly:w=false,preLoadedState:T,lock:S=true,lockTimeout:k="0s",replaceTargets:D,compactWarnings:_,testDirectory:E}=e;const C=new a.Config(t);if(!Object.prototype.hasOwnProperty.call(h.SCOPE_CONFIG,n)){throw new Error(`Invalid scope: ${n}`)}const R=h.SCOPE_CONFIG[n];const P=R.resource;const O=E?(0,g.join)(t,E):t;const A=new c.Parser(O,s);const L=A.content();const x=C.getMatch?.(n);let I=L.filter((e=>(0,y.matchesScope)(e,n,x)));const $={identity:C.getIdentity(n),fields:C.getFields(n)};let F=A.filter(I,$,n)||[];if(p){F=F.filter((e=>{const t=e.custom?.identity?`${e.uri}.${e.custom.identity}`:e.uri;return(0,y.matchesTarget)(t,p,n)||(0,y.matchesTarget)(e.uri,p,n)}))}if(b){F=[]}if(l.policy&&typeof l.policy.loadCustomPolicies==="function"){await l.policy.loadCustomPolicies(t)}const j=C&&typeof C.getPolicies==="function"?C.getPolicies():undefined;if(j&&l.policy&&typeof l.policy.configure==="function"){l.policy.configure(j)}const M=l.policy.scanner(F,n,false,_);if(M){const e=new Error("Please fix them before continuing.");e.name="Policy violations found";throw e}const N=T||new u.State(t,r,f);if(!T){await N.init();await N.acquireLock(S,k)}let B=N.getResources(P);if(p){B=B.filter((e=>(0,y.matchesTarget)(e.identity,p,n)||e.type&&(0,y.matchesTarget)(e.type,p,n)))}if(w){return{changes:[],state:N,hasChanges:false}}for(const e of B){const t=e.attributes.remoteId?`[id=${e.attributes.remoteId}]`:"";console.log((0,i.bold)(`${(0,m.formatResourceAddress)(e.type,e.identity)}: Refreshing state... ${t}`))}console.log("");const U=new Map(B.map((e=>[(0,m.normalizeAddress)(e.identity),e])));const W=new Set;const G=[];const q=new v.LifecycleResolver(t);for(const e of F){let s;const r=e.custom?.identity;if(!r)continue;if(r.startsWith(e.uri)||r===e.uri){s=r}else{s=`${e.uri}.${r}`}const i=(0,m.normalizeAddress)(s);W.add(i);const a=e.tags?e.tags.map((e=>typeof e==="string"?e:e.name)):[];const c=q.getLifecycle(s,a);const l=hashScenario(e,n,c.ignore_changes);const u=U.get(i);const d=D?(0,y.matchesTarget)(s,D):false;if(!u){G.push({action:"add",identity:s,resourceType:P,scenario:e,localHash:l})}else if(u.tainted||d){G.push({action:"replace",identity:s,resourceType:P,scenario:e,remoteId:u.attributes.remoteId,issueNumber:u.attributes.issueNumber,localHash:l,oldAttributes:u.attributes})}else if(u.attributes.localHash!==l){const n=o.resource.hasFieldChanges(P,e,u.attributes,{state:N,testDirectory:t});if(!n){u.attributes.localHash=l;continue}G.push({action:"change",identity:s,resourceType:P,scenario:e,remoteId:u.attributes.remoteId,issueNumber:u.attributes.issueNumber,localHash:l,oldAttributes:u.attributes})}}for(const e of B){if(!W.has((0,m.normalizeAddress)(e.identity))){const t=q.getLifecycle(e.identity,e.attributes.labels||[]);if(t.prevent_destroy){d.logger.push({type:"error",title:"Instance cannot be destroyed",detail:[`Resource ${(0,m.formatResourceAddress)(e.type,e.identity)} has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or target other resources.`],close:true});throw new Error(`Instance cannot be destroyed: ${e.identity} has lifecycle.prevent_destroy set.`)}G.push({action:"destroy",identity:e.identity,resourceType:P,scenario:n==="testrun"||n==="testplan"?{uri:"(state)",feature:{tags:[],keyword:"",name:e.attributes.title,description:"",location:0},location:0,keyword:"",name:e.attributes.title,description:"",steps:[],tags:Array.isArray(e.attributes.labels)?e.attributes.labels:e.attributes.labels?String(e.attributes.labels).split(","):[],custom:{identity:e.identity}}:{uri:"(state)",feature:{tags:[],keyword:"",name:"",description:"",location:0},location:0,keyword:"",name:e.attributes.title,description:"",steps:[],tags:Array.isArray(e.attributes.labels)?e.attributes.labels:e.attributes.labels?String(e.attributes.labels).split(","):[],custom:{identity:e.identity}},remoteId:e.attributes.remoteId,issueNumber:e.attributes.issueNumber,localHash:e.attributes.localHash})}}return{changes:G,hasChanges:G.length>0,state:N}}const planCmd=async e=>{const{dir:t=".",verbose:s=false,outPath:i,lock:a=true,lockTimeout:c="0s",input:l=true,variables:m,isJson:g=false,detailedExitCode:y=false,statePath:v,backupPath:w,target:T,destroyPlan:S=false,refresh:k=true,refreshOnly:D=false,replaceTargets:_,parallelism:E,compactWarnings:C=false,testDirectory:R}=e;const P=new d.Logger(s);if(m){const e=m.getMissingRequiredVars();if(e.length>0){if(!l||!process.stdin.isTTY){P.push({type:"error",title:"No value for required variable",detail:e.map((e=>`The root module input variable "${e.name}" is not set, and has no default value. Use -var or -var-file to supply a value.`)),close:true});return}const t=n(3785);const s=t.createInterface({input:process.stdin,output:process.stdout});const ask=e=>new Promise((t=>s.question(e,(e=>t(e.trim())))));for(const t of e){console.log(`var.${t.name}`);if(t.description){console.log(` ${t.description}`)}console.log("");const e=await ask(" Enter a value: ");console.log("");m.setVar(t.name,e)}s.close()}}const O=new u.State(t,v,w);await O.init();await O.acquireLock(a,c);let A={changes:[],hasChanges:false,state:O};try{const n=T||e.scope;const s=n||e.scope;const l=(0,b.resolveScopes)(s);if(k&&!S){if(!g)console.log(r.MSG_ACQUIRING_LOCK)}let u=[];for(const e of l){if(k&&!S){await(0,p.refreshState)({dir:t,scope:e,state:O,logger:P,silent:g,parallelismRaw:E,target:T})}const n=await calculatePlan({dir:t,scope:e,variables:m,statePath:v,backupPath:w,target:T,destroyPlan:S,refreshOnly:D,preLoadedState:O,lock:a,lockTimeout:c,replaceTargets:_,compactWarnings:C,testDirectory:R});u.push(...n.changes);A.state=n.state}A.changes=u;A.hasChanges=u.length>0;if(g){const e={format_version:"1.0",testform_version:h.VERSION_CLI,changes:A.changes};console.log(JSON.stringify(e,null,2))}else{o.resource.summary(A.changes,true,{state:A.state,outPath:i})}}finally{await O.releaseLock()}if(i){const e=n(6928);const s=e.resolve(t,i);const r={format_version:"1.0",testform_version:h.VERSION_CLI,changes:A.changes};try{(0,f.writeFileSync)(s,JSON.stringify(r,null,2),"utf-8");console.log(`\nSaved the plan to: ${i}\n\nTo perform exactly these actions, run the following command to apply:\n testform apply "${i}"`)}catch(e){P.error(`Failed to write plan to ${s}: ${e.message}`)}}if(y){process.exitCode=A.hasChanges?2:0}return A};t.planCmd=planCmd},5950:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.policyCmd=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=s(n(465));const c=n(2721);const l=n(4489);const u=n(6028);const d=n(1227);const{bold:f,green:p,red:h,yellow:m,cyan:g,gray:y}=a.default;function updateConfigFilePolicy(e,t,n){let s=null;for(const t of u.CONFIG_FILE_NAMES){const n=(0,i.resolve)(e,t);if((0,r.existsSync)(n)){s=n;break}}if(!s){s=(0,i.resolve)(e,"main.yml")}let a;if((0,r.existsSync)(s)){const e=(0,r.readFileSync)(s,"utf-8");a=o.default.parseDocument(e)}else{a=new o.default.Document({})}if(!a.contents){a.contents=a.createNode({})}let c=a.get("policy");if(!c){a.set("policy",a.createNode({}));c=a.get("policy")}if(n){const e=a.getIn(["policy","disabled"]);if(e){const n=e.items?e.items.map((e=>e.value??e)):Array.isArray(e)?e:[];const s=n.filter((e=>e!==t));if(s.length>0){a.setIn(["policy","disabled"],s)}else{a.deleteIn(["policy","disabled"])}}if(a.hasIn(["policy",t])){a.deleteIn(["policy",t])}}else{const e=a.getIn(["policy","disabled"]);if(e){const n=e.items?e.items.map((e=>e.value??e)):Array.isArray(e)?e:[];if(!n.includes(t)){n.push(t);a.setIn(["policy","disabled"],n)}}else if(a.hasIn(["policy",t])){a.setIn(["policy",t],false)}else{a.setIn(["policy","disabled"],[t])}}(0,r.writeFileSync)(s,a.toString(),"utf-8");return s}const policyCmd=async e=>{const{dir:t,scope:n,enable:s,disable:r,show:i,json:o,verbose:a}=e;const u=new d.Logger(a);await c.policy.loadCustomPolicies(t);const b=new l.Config(t,false);const v=b.getPolicies();if(v){c.policy.configure(v)}if(s){const e=s.trim();const n=c.policy.get(e);if(!n){u.warn(`Warning: Policy "${e}" is not currently registered, but will be enabled in configuration.`)}c.policy.enable(e);const r=updateConfigFilePolicy(t,e,true);if(o){console.log(JSON.stringify({id:e,action:"enable",status:"enabled",configFile:r}))}else{console.log(p(`\nSuccess! Policy "${e}" has been enabled.`));console.log(y(`Updated configuration in ${r}\n`))}return}if(r){const e=r.trim();const n=c.policy.get(e);if(!n){u.warn(`Warning: Policy "${e}" is not currently registered, but will be disabled in configuration.`)}c.policy.disable(e);const s=updateConfigFilePolicy(t,e,false);if(o){console.log(JSON.stringify({id:e,action:"disable",status:"disabled",configFile:s}))}else{console.log(m(`\nPolicy "${e}" has been disabled.`));console.log(y(`Updated configuration in ${s}\n`))}return}if(i){const e=i.trim();const t=c.policy.get(e);if(!t){u.error(`Error: Policy "${e}" was not found.`);process.exit(1)}if(o){console.log(JSON.stringify(t,null,2));return}console.log("");console.log(f(`Policy: ${g(t.id)}`));console.log(` ${f("Type:")} ${t.type==="system"?"system (built-in)":"user (custom)"}`);console.log(` ${f("Scope:")} ${t.scope.join(", ")}`);console.log(` ${f("Status:")} ${t.enabled?p("enabled"):h("disabled")}`);console.log(` ${f("Description:")} ${t.description||"(none)"}`);console.log("");return}let w=c.policy.getAll();if(n){w=w.filter((e=>e.scope.includes(n)))}if(o){console.log(JSON.stringify(w,null,2));return}if(w.length===0){console.log(y("\nNo policies registered for this configuration.\n"));return}const T=Math.max(14,...w.map((e=>e.id.length)));const S=Math.max(7,...w.map((e=>e.scope.join(", ").length)));const k=8;const D=10;console.log("");const _=["ID".padEnd(T),"SCOPE".padEnd(S),"TYPE".padEnd(k),"STATUS".padEnd(D),"DESCRIPTION"].join(" ");const E=["─".repeat(T),"─".repeat(S),"─".repeat(k),"─".repeat(D),"─".repeat(30)].join(" ");console.log(f(_));console.log(y(E));for(const e of w){const t=g(e.id.padEnd(T));const n=e.scope.join(", ").padEnd(S);const s=(e.type==="system"?"system":"custom").padEnd(k);const r=e.enabled?p("enabled".padEnd(D)):h("disabled".padEnd(D));const i=y(e.description||"");console.log(`${t} ${n} ${s} ${r} ${i}`)}console.log("")};t.policyCmd=policyCmd},7633:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.printCmd=void 0;const s=n(5392);const r=n(4489);const i=n(7442);const o=n(1227);const printCmd=async e=>{const{dir:t,file:a,format:c,scope:l,variables:u}=e;const d=l||(a?(0,i.detectScopeFromTarget)(a):undefined)||"testcase";const f=new s.Parser(t,u);const p=new r.Config(t);const h={identity:p.getIdentity(d),fields:p.getFields(d),convention:p.getConvention(d)};const m=f.content();let g=m;if(a){const e=n(6928);const s=e.resolve(t,a);g=m.filter((n=>{if(!n.uri)return false;if(n.uri.includes(a))return true;const r=e.resolve(t,n.uri);return r===s||r.includes(s)}));if(g.length===0){o.logger.error(`No scenarios found for file matching: ${a}`);process.exit(1)}}if(c==="gherkin"){console.log(JSON.stringify(g,null,2));return}if(c==="testform"){const e=f.filter(g,h,d);console.log(JSON.stringify(e,null,2));return}o.logger.error(`Invalid format: ${c}. Use 'gherkin' or 'testform'.`);process.exit(1)};t.printCmd=printCmd},5644:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.providersCmd=void 0;const s=n(9896);const r=n(6928);const i=n(465);const o=n(4489);const a=n(6028);const c=n(8184);const l=n(1227);const providersCmd=async(e={})=>{const{dir:t=".",action:n,args:u=[],isJson:d=false}=e;let f=t;let p=n;const h=["lock","mirror","schema"];if(n&&!h.includes(n.toLowerCase())){f=n;p=undefined}const m=(0,r.resolve)(process.cwd(),f);const g=a.CONFIG_FILE_NAMES.some((e=>(0,s.existsSync)((0,r.resolve)(m,e))));if(!g){l.logger.push({type:"error",title:"No configuration files",extra:[`The directory ${m} contains no ${a.TITLE_APP} configuration files.`],close:true});return}const y=new o.Config(m,false);const b=y.getProviderType()||"local";if(!p){console.log(`\nProviders required by configuration:\n.\n└── provider[registry.testform.io/fromeroc9/${b}] 1.0.0\n`);return}switch(p.toLowerCase()){case"lock":{const e=(0,r.resolve)(m,a.FILE_LOCK);const t=(0,r.dirname)(e);if(!(0,s.existsSync)(t)){(0,s.mkdirSync)(t,{recursive:true})}const n={provider:{[`registry.testform.io/fromeroc9/${b}`]:{version:"1.0.0",constraints:">= 1.0.0",hashes:["h1:dGVzdGZvcm0tcHJvdmlkZXItbG9jay12ZXJpZmllZA=="]}}};(0,s.writeFileSync)(e,JSON.stringify(n,null,2),"utf-8");console.log((0,i.green)(`\nSuccess! Dependencies for provider "fromeroc9/${b}" verified and written to ${a.FILE_LOCK}.\n`));break}case"mirror":{if(!u[0]){l.logger.push({type:"error",title:"Missing target directory argument",extra:["Target directory is required. Specify a directory where provider plugins should be mirrored."],close:true});return}const e=(0,r.resolve)(m,u[0]);if(!(0,s.existsSync)(e)){(0,s.mkdirSync)(e,{recursive:true})}const t={provider:`registry.testform.io/fromeroc9/${b}`,version:"1.0.0",mirrored_at:(new Date).toISOString()};(0,s.writeFileSync)((0,r.resolve)(e,`${b}.json`),JSON.stringify(t,null,2),"utf-8");console.log(`- Mirroring provider "fromeroc9/${b}" to ${u[0]}...`);console.log((0,i.green)(`\nSuccess! Provider plugins mirrored to ${u[0]}.\n`));break}case"schema":{const e=d||u.includes("-json")||u.includes("--json");if(e){const e={format_version:"1.0",provider_schemas:{[`registry.testform.io/fromeroc9/${b}`]:{provider:{version:0,block:{attributes:b==="github"?{owner:{type:"string",description:"GitHub repository owner",required:true},repository:{type:"string",description:"GitHub repository name",required:true},project_id:{type:"number",description:"GitHub Projects (v2) Project Number",optional:true},token_env:{type:"string",description:"Environment variable containing personal access token",optional:true}}:{endpoint:{type:"string",description:"Driver endpoint or path",optional:true}}}},resource_schemas:{[`${b}_testcase`]:{version:0,block:{attributes:{identity:{type:"string",description:"Unique testcase identifier tag (e.g. @tc-1)",required:true},title:{type:"string",description:"Test case scenario name",optional:true},labels:{type:["list","string"],description:"Labels/tags associated with test case",optional:true},assignees:{type:["list","string"],description:"Assigned engineers/testers",optional:true},custom_fields:{type:["map","string"],description:"Custom metadata fields",optional:true}}}},[`${b}_testrun`]:{version:0,block:{attributes:{identity:{type:"string",description:"Unique testrun identifier tag (e.g. @tr-1)",required:true},rules:{type:["list","string"],description:"Execution rules and included test scenarios",optional:true}}}},[`${b}_testplan`]:{version:0,block:{attributes:{identity:{type:"string",description:"Unique testplan identifier tag (e.g. @tp-1)",required:true},runs:{type:["list","string"],description:"Associated test run identifiers",optional:true}}}}}}}};console.log(JSON.stringify(e,null,2))}else{console.log((0,i.bold)(`\nProvider Schema: fromeroc9/${b}`));console.log((0,i.dim)("─".repeat(50)));console.log(`Resource: ${b}_testcase`);console.log(` - identity: string (required)`);console.log(` - title: string (optional)`);console.log(` - labels: list of string (optional)`);console.log(` - assignees: list of string (optional)`);console.log(` - custom_fields: map of string (optional)`);console.log(`Resource: ${b}_testrun`);console.log(` - identity: string (required)`);console.log(` - rules: list of rule`);console.log(`Resource: ${b}_testplan`);console.log(` - identity: string (required)`);console.log(` - runs: list of testrun\n`)}break}default:{console.log(c.HELP_PROVIDERS);break}}};t.providersCmd=providersCmd},1906:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.queryCmd=void 0;const s=n(465);const r=n(6028);const i=n(6928);const o=n(9896);const a=n(363);const queryCmd=async(e={})=>{const{dir:t=".",testDirectory:n,scope:c="all",filter:l,target:u,json:d=false,count:f=false,verbose:p=false,statePath:h,backupPath:m,generateConfigOut:g}=e;const y=n?(0,i.resolve)(t,n):(0,i.resolve)(t);const b=new a.StateQuery(y,h,m);await b.init();if(b.getResources().length===0){console.error((0,s.red)("╷"));console.error(`${(0,s.red)("│")} ${(0,s.bold)((0,s.red)("Error:"))} ${(0,s.bold)("No resources to query")}`);console.error((0,s.red)("│"));console.error(`${(0,s.red)("│")} The configuration does not contain any resources that can be queried.`);console.error((0,s.red)("╵"));process.exit(1)}const v=b.filterByTarget(u);const w=[];if(l){if(Array.isArray(l))w.push(...l);else w.push(l)}if(c&&c!=="all")w.push(`scope=${c}`);const T=w.length>0?b.filter(w,v):v;if(g){const e=(0,i.resolve)(t,g);const n=T.map((e=>`# Resource: ${e.id}\nimport {\n to = ${e.type}.${e.id.replace(/[^a-zA-Z0-9_]/g,"_")}\n id = "${e.remoteId||e.issueNumber||e.id}"\n}`)).join("\n\n");if(d){console.log(JSON.stringify({generated_config:n,resources:T},null,2))}else{(0,o.writeFileSync)(e,n+"\n","utf-8");console.log((0,s.green)(`\n✔ Generated configuration written to ${e}\n`))}return}if(f){console.log(T.length);return}if(d){console.log(JSON.stringify(T,null,2));return}console.log("");console.log((0,s.bold)(`# ${r.TITLE_APP} Query Results (${T.length} matches)`));console.log((0,s.dim)("─".repeat(80)));if(T.length===0){console.log((0,s.yellow)("No resources matched the given query criteria."));console.log("");return}const formatStatus=e=>{switch(e.toLowerCase()){case"passed":return(0,s.green)("✔ passed");case"failed":return(0,s.red)("✖ failed");case"pending":return(0,s.yellow)("⏳ pending");case"blocked":return(0,s.magenta)("⛔ blocked");case"skipped":return(0,s.gray)("⏭ skipped");case"unexecuted":return(0,s.dim)("❔ unexecuted");default:return(0,s.cyan)(e)}};for(const e of T){const t=e.issueNumber?(0,s.cyan)(`#${e.issueNumber}`):(0,s.dim)("(no issue)");const n=e.labels.length>0?(0,s.gray)(`[${e.labels.join(", ")}]`):"";const r=e.tainted?(0,s.red)(" [tainted]"):"";const i=formatStatus(e.status);console.log(` ${i} ${(0,s.cyan)(e.canonicalScope)}.${(0,s.bold)(e.id)} ${t}${r}`);console.log(` Title: ${e.title||(0,s.dim)("(no title)")}`);if(e.assignees.length>0){console.log(` Assignees: ${e.assignees.join(", ")}`)}if(n){console.log(` Labels: ${n}`)}if(Object.keys(e.custom_fields).length>0){const t=Object.entries(e.custom_fields).map((([e,t])=>`${e}=${t}`)).join(", ");console.log(` Fields: ${(0,s.dim)(t)}`)}console.log("")}console.log((0,s.bold)(`Total: ${T.length} resource(s) found.`));console.log("")};t.queryCmd=queryCmd},1821:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.refreshCmd=t.refreshState=void 0;const s=n(465);const r=n(5320);const i=n(942);const o=n(4489);const a=n(1227);const c=n(1227);const l=n(6028);const u=n(7442);const d=n(2978);const f=n(5124);const p=n(8169);const h=n(2043);const refreshState=async e=>{const{dir:t,scope:n,state:a,logger:p,silent:m=false,parallelismRaw:g,target:y}=e;if(!Object.prototype.hasOwnProperty.call(l.SCOPE_RESOURCE_MAP,n)){throw new Error(`Invalid scope: ${n}`)}const b=l.SCOPE_RESOURCE_MAP[n];let v=a.getResources(b);if(y){v=v.filter((e=>(0,u.matchesTarget)(e.identity,y,n)||e.type&&(0,u.matchesTarget)(e.type,y,n)))}if(v.length===0){await a.save();if(!m)console.log("No resources in state to refresh.");return}const w=new o.Config(t);const T=w.getAdapterType();let S;if(T==="local"){S=new i.LocalAdapter(t)}else{const e=w.getGitHub();if(!e){if(!m){c.logger.push({type:"error",title:"GitHub configuration not found",detail:[l.ERR_GITHUB_CONFIG_NOT_FOUND],close:true})}return}S=new r.GitHubAdapter(e)}let k=0;let D=0;const _=g?parseInt(String(g),10)||3:3;const E=new h.LifecycleResolver(t);await(0,f.executeInBatches)(v,_,(async e=>{const t=e.attributes.remoteId??"";if(!m)console.log(`${(0,d.formatResourceAddress)(e.type,e.identity)}: Refreshing state... ${(0,s.dim)(`[id=${t}]`)}`);try{if(!e.attributes.issueNumber){if(!m)console.log((0,s.yellow)(` ${e.identity}: No issue number — removing from state`));a.removeResource(e.identity);D++;return}const t=await S.getIssue(e.attributes.issueNumber);if(!t){if(!m)console.log((0,s.red)(` ${e.identity}: Issue #${e.attributes.issueNumber} not found — removing from state`));a.removeResource(e.identity);D++}else if(t.state==="closed"){if(!m)console.log((0,s.yellow)(` ${e.identity}: Issue #${e.attributes.issueNumber} is closed — removing from state`));a.removeResource(e.identity);D++}else{const n=t.node_id&&S.getProjectItemFields?await S.getProjectItemFields(t.node_id):undefined;const r=E.getLifecycle(e.identity,e.attributes.labels||[]);const{hasDrift:i,newAttributes:o}=(0,f.detectAttributeDrift)(e.attributes,t,n,r.ignore_changes);if(i){e.attributes={...e.attributes,...o};if(!m){console.log((0,s.yellow)(` ! Drift detected on remote for ${(0,d.formatIdentityDisplay)(e.identity)} (Issue #${e.attributes.issueNumber})`));console.log((0,s.dim)(` Run 'testform diff --remote' to inspect differences or interactively pull changes.`))}e.attributes.localHash="drift_detected";a.upsertResource(e)}k++}}catch(t){if(!m){c.logger.push({type:"warning",title:`Failed to refresh ${e.identity}: ${t.message}`,detail:[]})}}}));await a.save();if(!m){console.log("");console.log((0,s.green)((0,s.bold)(`Refresh complete! ${k} resource(s) refreshed, ${D} removed.`)))}};t.refreshState=refreshState;const refreshCmd=async e=>{const{dir:n=".",verbose:s=false,lock:r=true,lockTimeout:i="0s",statePath:o,backupPath:c,parallelismRaw:l,compactWarnings:u,target:d}=e;const f=new a.Logger(s);return(0,p.withStateLock)({dir:n,statePath:o,backupPath:c,lock:r,lockTimeout:i},(async s=>{const r=d||e.scope;const i=r||e.scope;const o=(0,p.resolveScopes)(i);for(const e of o){await(0,t.refreshState)({dir:n,scope:e,state:s,logger:f,silent:false,parallelismRaw:l,target:d})}}))};t.refreshCmd=refreshCmd},8938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.reportCmd=void 0;const s=n(363);const r=n(6396);const i=n(6928);const o=n(9896);const a=n(465);const c=n(1227);const l=n(4296);const reportCmd=async e=>{const{dir:t=".",type:n="testcase-summary",format:u="markdown",filter:d,target:f,out:p,groupBy:h,statePath:m,template:g,variables:y}=e;try{const c=new s.StateQuery(t,m);await c.init();const l=c.filterByTarget(f);const b=Array.isArray(d)?d:d?[d]:[];const v=b.length>0?c.filter(b,l):l;const w=c.getStats(v);const T=y?y.getVars():{};const S=await(0,r.resolveReport)(n,t);const k={target:f,items:v,stats:w,variables:T,groupBy:h,options:e,stateQuery:c};const D=await S.collect(k);const _=await(0,r.resolveFormat)(S,u,t);const E=(0,r.resolveTemplate)(S,_.name,g,k,t);const C=await _.render(D,k,E);if(p){const e=(0,i.resolve)(t,p);(0,o.writeFileSync)(e,C);console.log((0,a.green)(`✔ Report saved to ${p}`))}else{if(_.isBinary){const e=`report${_.extension}`;const n=(0,i.resolve)(t,e);(0,o.writeFileSync)(n,C);console.log((0,a.yellow)(`Binary format "${_.name}" saved to default output: ${e}`))}else{console.log(typeof C==="string"?C:C.toString("utf-8"))}}}catch(e){if(e instanceof l.TestformError){process.exitCode=e.exitCode||1;return}c.logger.push({type:"error",title:e.name&&e.name!=="Error"?e.name:"Report generation error",detail:e.message?e.message.split("\n"):[String(e)]});process.exitCode=1}};t.reportCmd=reportCmd},5765:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.showCmd=void 0;const r=n(465);const i=n(9896);const o=s(n(6928));const a=n(7066);const c=n(1227);const l=n(6028);const u=n(7862);const showCmd=async(e={})=>{const{path:t,isJson:n=false,verbose:s=false,dir:d=".",statePath:f,backupPath:p}=e;const h=new c.Logger(s);if(t){const e=o.default.resolve(d,t);if(!(0,i.existsSync)(e)){h.error(`The specified file does not exist: ${e}`);process.exitCode=1;return}try{const t=(0,i.readFileSync)(e,"utf-8");const s=JSON.parse(t);if(s&&(Array.isArray(s.changes)||(s.testform_version||s.format_version)&&!s.resources)){if(n){console.log(JSON.stringify(s,null,2));return}const e=s.changes||[];const t=new a.State(d,f,p);try{await t.init()}catch{}u.resource.summary(e,true,{state:t});return}}catch(t){if(t instanceof SyntaxError){h.error(`Failed to parse file at ${e}: ${t.message}`);process.exitCode=1;return}}}const m=new a.State(d,t||f,p);await m.init();const g=m.getState();const y=g.resources;if(n){console.log(JSON.stringify(g,null,2));return}console.log("");console.log((0,r.bold)(`# ${l.TITLE_APP} State`));console.log(` Version: ${g.version}`);console.log(` Serial: ${g.serial}`);console.log(` Lineage: ${g.lineage}`);console.log(` Last Sync: ${g.lastSync||"(never)"}`);console.log(` Resources: ${y.length}`);console.log("");if(y.length>0){for(const e of y){const t=e.attributes.remoteId??"(unknown)";const n=e.attributes.issueNumber?(0,r.green)("synced"):(0,r.yellow)("pending");const s=e.identity;console.log(` ${(0,r.cyan)(e.type)}.${(0,r.bold)(s)} [id=${t}] ${n}`);console.log(` title: ${e.attributes.title}`);console.log(` issueNumber: ${e.attributes.issueNumber??"(none)"}`);console.log(` localHash: ${(0,r.dim)(e.attributes.localHash.substring(0,12))}...`);console.log(` lastApplied: ${e.lastApplied}`);console.log("")}}};t.showCmd=showCmd},1047:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.stateCmd=void 0;const s=n(465);const r=n(9896);const i=n(6928);const o=n(7066);const a=n(6028);const c=n(2978);const l=`No state file was found!\n\nState management commands require a state file. Run this command\nin a directory where ${a.TITLE_CLI} has been run or use the -state flag\nto point the command to a specific state location.`;const stateCmd=async e=>{const{dir:t=".",action:n,args:u,statePath:d,backupPath:f,isJson:p,id:h,dryRun:m,force:g}=e;const y=new o.State(t,d,f);if(n!=="push"&&typeof y.hasState==="function"&&!await y.hasState()){console.error((0,s.red)(l));process.exit(1)}await y.init();if(n==="pull"){const e=y.getState();console.log(JSON.stringify(e,null,2));return}if(n==="push"){if(u.length!==1){console.error((0,s.red)(`Usage: ${a.TITLE_CLI} state push [path]`));process.exit(1)}const e=(0,i.resolve)(process.cwd(),u[0]);if(!(0,r.existsSync)(e)){console.error((0,s.red)(`Error: File ${e} not found.`));process.exit(1)}try{const t=(0,r.readFileSync)(e,"utf-8");const n=JSON.parse(t);await y.acquireLock(true,"0s");const i=y.getState();if(!g&&i.lineage&&n.lineage&&i.lineage!==n.lineage){console.error((0,s.red)(`Error: Cannot push state with different lineage. Use -force to override.`));process.exit(1)}const o=i;o.resources=n.resources||[];o.serial+=1;await y.save();await y.releaseLock();console.log((0,s.green)(`Successfully pushed state from ${u[0]}`));return}catch(e){console.error((0,s.red)(`Error parsing or pushing state: ${e.message}`));process.exit(1)}}await y.acquireLock(true,"0s");try{const e=y.getResources();const filterResources=e=>{let t=e;if(h){t=t.filter((e=>e.attributes.issueNumber?.toString()===h||e.attributes.remoteId===h))}if(u.length>0){t=t.filter((e=>{const t=`${e.type}.${e.identity}`;return u.some((n=>t.startsWith(n)||e.identity.startsWith(n)))}))}return t};if(n==="list"){const t=filterResources(e);if(t.length===0&&u.length>0){console.error((0,s.red)(`No instance found for the given address!`));process.exit(1)}else if(t.length===0){console.log("No resources found in state.")}else{for(const e of t){const t=e.tainted?"[tainted] ":"";console.log(`${t}${e.type}.${e.identity}`)}}}else if(n==="identities"){const t=filterResources(e);const n=t.map((e=>e.identity));if(p){console.log(JSON.stringify(n,null,2))}else{for(const e of n){console.log(e)}}}else if(n==="show"){if(u.length!==1){console.error((0,s.red)(`Exactly one argument expected.\nUsage: ${a.TITLE_CLI} [global options] state show [options] ADDRESS`));process.exit(1)}const t=u[0];const n=t.includes(".")?t.split(".").slice(1).join("."):t;const r=e.find((e=>(0,c.normalizeAddress)(e.identity)===(0,c.normalizeAddress)(n)||(0,c.normalizeAddress)(`${e.type}.${e.identity}`)===(0,c.normalizeAddress)(n)||(0,c.normalizeAddress)(`${e.type}.${e.identity}`)===(0,c.normalizeAddress)(t)||(0,c.normalizeAddress)(e.identity)===(0,c.normalizeAddress)(t)));if(!r){console.error((0,s.red)(`No instance found for the given address!`));process.exit(1)}console.log((0,s.bold)(`# ${r.type}.${r.identity}:`));console.log(`resource "${r.type}" "${r.identity}" {`);const i=Object.keys(r.attributes);let o=0;for(const e of i){if(e.length>o)o=e.length}for(const e of i){const t=" ".repeat(o-e.length);const n=Object.prototype.hasOwnProperty.call(r.attributes,e)?r.attributes[e]:undefined;console.log(` ${e}${t} = ${(0,c.formatHclValue)(n,1)}`)}console.log(`}`);if(r.tainted){console.log((0,s.red)(`\nThis resource is marked as tainted.`))}}else if(n==="rm"){if(u.length===0){console.error((0,s.red)(`At least one address is required.\n\nUsage: ${a.TITLE_CLI} [global options] state rm [options] ADDRESS...`));process.exit(1)}let t=0;for(const n of u){const r=n.includes(".")?n.split(".").slice(1).join("."):n;const i=e.find((e=>(0,c.normalizeAddress)(e.identity)===(0,c.normalizeAddress)(r)||(0,c.normalizeAddress)(`${e.type}.${e.identity}`)===(0,c.normalizeAddress)(r)||(0,c.normalizeAddress)(`${e.type}.${e.identity}`)===(0,c.normalizeAddress)(n)||(0,c.normalizeAddress)(e.identity)===(0,c.normalizeAddress)(n)));if(i){if(m){console.log(`Would remove ${n}`)}else{y.removeResource(i.identity);console.log(`Removed ${n}`)}t++}else{console.error((0,s.red)(`Error: Resource ${n} not found in state.`))}}if(t>0&&!m){await y.save();console.log((0,s.green)(`\nSuccessfully removed ${t} resource instance(s).`))}}else if(n==="mv"){if(u.length!==2){console.error((0,s.red)(`Exactly two arguments expected.\n\nUsage: ${a.TITLE_CLI} [global options] state mv [options] SOURCE DESTINATION`));process.exit(1)}const t=u[0];const n=u[1];const r=t.includes(".")?t.split(".").slice(1).join("."):t;const i=n.includes(".")?n.split(".").slice(1).join("."):n;const o=e.find((e=>e.identity===r||`${e.type}.${e.identity}`===r));if(!o){console.error((0,s.red)(`Error: Source resource ${t} not found in state.`));process.exit(1)}if(m){console.log(`Would move ${t} to ${n}`)}else{y.removeResource(o.identity);o.identity=i;if(n.includes(".")){o.type=n.split(".")[0]}y.upsertResource(o);await y.save();console.log((0,s.green)(`Move ${t} to ${n} successfully executed!`))}}else if(n==="clean"||n==="optimize"){const t=JSON.stringify(y.getState());const n=Buffer.byteLength(t,"utf8");const r=filterResources(e);if(r.length===0&&u.length>0){console.error((0,s.red)(`No instance found for the given address!`));process.exit(1)}let i=0;for(const e of r){if(e.attributes){const t=JSON.stringify(e.attributes);e.attributes=(0,o.cleanAttributes)(e.attributes);const n=JSON.stringify(e.attributes);if(t!==n){i++}}}const a=JSON.stringify(y.getState());const c=Buffer.byteLength(a,"utf8");const l=Math.max(0,n-c);const d=n>0?(l/n*100).toFixed(1):"0.0";const formatSize=e=>{if(e<1024)return`${e} B`;return`${(e/1024).toFixed(2)} KB`};if(m){console.log((0,s.bold)(`State optimization dry-run preview:`));console.log(` Resources matching: ${r.length}`);console.log(` Resources to clean: ${i}`);console.log(` Current payload: ${formatSize(n)}`);console.log(` Estimated payload: ${formatSize(c)}`);console.log(` Potential reduction: -${d}% (-${formatSize(l)})`)}else{if(i>0){await y.save();console.log((0,s.green)((0,s.bold)(`State optimization complete:`)));console.log(` Resources evaluated: ${r.length}`);console.log(` Resources cleaned: ${i}`);console.log(` Payload size: ${formatSize(n)} -> ${formatSize(c)} (-${d}%)`);console.log(` Saved space: ${formatSize(l)}`)}else{console.log((0,s.green)(`State is already optimal (no redundant fields found).`))}}}else if(n==="replace-provider"){if(u.length!==2){console.error((0,s.red)(`Usage: ${a.TITLE_CLI} state replace-provider [options] FROM_PROVIDER TO_PROVIDER`));process.exit(1)}const t=u[0].toLowerCase();const n=u[1].toLowerCase();let r=0;for(const s of e){if(s.type.startsWith(`${t}_`)){s.type=s.type.replace(`${t}_`,`${n}_`);r++}}const i=y.getState();if(i.provider&&i.provider.toLowerCase()===t){i.provider=n}await y.save();console.log((0,s.green)(`\nSuccess! Replaced provider "${t}" with "${n}" across ${r} resource(s).\n`))}else{console.error((0,s.red)(`Usage: ${a.TITLE_CLI} state <clean|identities|list|mv|pull|push|replace-provider|rm|show> [options] [args]`));process.exit(1)}}finally{await y.releaseLock()}};t.stateCmd=stateCmd},5822:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.toolCmd=t.suiteCmd=t.IDENTIFIER_STRATEGIES_DETAIL=t.TARGET_STRATEGIES_DETAIL=void 0;t.parseTagAddress=parseTagAddress;const s=n(6928);const r=n(9896);const i=n(465);const o=n(7651);const a=n(9606);const c=n(5392);const l=n(4489);const u=n(7066);const d=n(3912);const f=n(8480);const p=n(7862);const h=n(6028);const m=n(5301);const g=n(7442);t.TARGET_STRATEGIES_DETAIL=[`Target strategies (-target):`,` 1. Identity Tag (@tr-N / @tp-N):`,` Unique identifier across the workspace. Only valid for testrun and testplan`,` (testcase @tc-N tags can repeat across different files and cannot be used as target).`,` Example: -target="@tr-1" or -target="@tp-2"`,``,` 2. Canonical Address:`,` Immutable full address binding the feature file and its identity tag.`,` Example: -target="tests/runs/20261024.run.feature.@tr-1"`,``,` 3. Scoped File Path:`,` File path resolved against -test-directory.`,` - With -test-directory="tests/runs": -target="20261024.run.feature"`,` - Without -test-directory: -target="tests/runs/20261024.run.feature"`];t.IDENTIFIER_STRATEGIES_DETAIL=[`Identifier strategies (<identifier>=<status>):`,` 1. Identity Tag: "@tc-1=passed" (caution: if @tc-1 repeats across files, use strategy 2)`,` 2. Canonical / File: "checkout.case.feature.@tc-1=passed" (disambiguates across files)`,` 3. Scenario Name: "Pago con tarjeta=passed"`];function parseTagAddress(e){const t=e.trim();const n=t.match(/^(?:(.*)(?:\.|\b))?\[([^\]]+)\]$/);if(!n){throw new Error(`Invalid tag address format: "${e}". Expected format like "[@smoke]" or "checkout.case.feature.[@smoke]".`)}let s=n[1]?.trim()||undefined;if(s?.endsWith(".")){s=s.slice(0,-1).trim()}const r=n[2].split(",").map((e=>e.trim())).filter(Boolean);const i=r.map((e=>e.startsWith("@")?e:`@${e}`));return{filePattern:s,tags:i}}async function runAdd(e){const{dir:t,scope:n,title:s,rules:r}=e;if(n==="testcase"){d.Diag.error({title:`\`testform suite init\` does not support scope 'testcase'.`,detail:[`Use \`${h.TITLE_CLI} generate\` for testcase files, or specify -scope=testrun or -scope=testplan.`]}).abort()}await(0,o.generateCmd)({dir:t,scope:n,title:s,rules:r})}async function runAutocomplete(e){const{dir:t,target:n,testDirectory:r,variables:o}=e;const u=r?(0,s.join)(t,r):t;const{absolutePath:f}=await(0,g.resolveTargetScenario)(n,t,"testrun",r,o);const p=a.GherkinEditor.parseRawDocument(f);if(!p.feature){d.Diag.structureError({file:n,message:`No Feature block found in '${n}'.`}).abort();return}const h=(p.feature.children||[]).filter((e=>e.rule));if(h.length===0){d.Diag.structureError({file:n,message:`No Rule blocks found in '${n}'.`}).abort()}const m=new c.Parser(u,o);const y=m.content()||[];const b=y.filter((e=>(0,g.matchesScope)(e,"testcase")));const v=Array.from(new Set(b.map((e=>e.uri))));let w=0;for(const e of h){const n=e?.rule;if(!n)continue;const r=typeof n==="string"?n:n.name||"";const o=typeof n==="object"&&n.children?n.children:[];const c=o.filter((e=>e.scenario));if(c.length>0){console.log(` ${(0,i.yellow)("~")} Rule '${r}': already has ${c.length} explicit scenario(s). Skipping.`);continue}const u=r.replace(/\.feature$/i,"");const d=v.find((e=>e===r||e.replace(/\.feature$/i,"")===u||(0,s.basename)(e).replace(/\.feature$/i,"")===u||e.endsWith("/"+r)||e.endsWith("/"+r+".feature")));if(!d){console.log(` ${(0,i.red)("!")} Rule '${r}': source file not found in workspace. Skipping.`);continue}const p=b.filter((e=>e.uri===d));if(p.length===0){console.log(` ${(0,i.red)("!")} Rule '${r}': no scenarios parsed from source file. Skipping.`);continue}const h=new l.Config(t);const g={identity:h.getIdentity("testcase"),fields:h.getFields("testcase")};const y=m.filter(p,g,"testcase")||[];const T=y.map((e=>{const t=e.custom?.identity||e.name;return`${r}.${t}`}));a.GherkinEditor.expandScenarios(f,T,"pending");console.log(` ${(0,i.green)("✓")} Rule '${r}': expanded ${T.length} scenario(s).`);w+=T.length}if(w===0){console.log("No scenarios were expanded. All Rules already have explicit scenarios or source files were not found.")}else{console.log((0,i.green)((0,i.bold)(`\nAutocomplete complete! ${w} scenario(s) expanded.`)))}}async function runLink(e){const{dir:t,testDirectory:n,variables:r,statePath:o,backupPath:u,verbose:f=false}=e;let p=e.target;if(!p){if((0,m.isInteractive)()){p=await(0,g.promptTargetSuite)(t,["testrun","testplan"],n,r)}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite link "<identifier>=<status>" -target=<path|relative|@tr-N>`,detail:[`Specify -target to indicate which suite to link into.`,`Available statuses: ${h.TESTCASE_STATUSES.join(", ")}`,``,`Identity strategies:`,` 1. Only tag: "@tc-1=passed"`,` 2. File + tag: "cuenta/inicio-sesion.feature@tc-1=passed"`,` 3. Scenario name: "Pago con tarjeta=passed"`,``,`Examples:`,` # Link into testrun (implicit):`,` ${h.TITLE_CLI} suite link "checkout.case.feature" -target="@tr-42"`,` # Link into testrun (explicit):`,` ${h.TITLE_CLI} suite link "@tc-1" -target="@tr-42"`,` ${h.TITLE_CLI} suite link "checkout.case.feature.@tc-1=passed" -target="@tr-42"`,` # Link into testplan:`,` ${h.TITLE_CLI} suite link "sprint42.run.feature" -target="@tp-1"`]}).abort();return}}if(!p)return;const y=n?(0,s.join)(t,n):t;const b=new c.Parser(y,r);const v=b.content()||[];let w="testrun";if(p.endsWith(".plan.feature")||p.includes("plan")||p.startsWith("@tp")){w="testplan"}else{const e=v.filter((e=>(0,g.matchesScope)(e,"testrun")));const t=e.some((e=>e.uri===p||e.uri.endsWith(p)||e.custom?.identity===p));if(!t){const e=v.filter((e=>(0,g.matchesScope)(e,"testplan")));if(e.some((e=>e.uri===p||e.uri.endsWith(p)||e.custom?.identity===p))){w="testplan"}}}const{absolutePath:T}=await(0,g.resolveTargetScenario)(p,t,w,n,r);if(w==="testplan"){let n=e.linkArg;if(n&&(n.includes("=")||n.startsWith("@tc"))){d.Diag.error({title:`Cannot link explicit testcase scenarios into a testplan.`,detail:[`Testplans only link entire testrun suites (Rule: <file.run.feature>).`,`Example: ${h.TITLE_CLI} suite link "sprint42.run.feature" -target="${p}"`,` ${h.TITLE_CLI} suite link "@tr-1" -target="${p}"`]}).abort()}if(!n){if((0,m.isInteractive)()){const e=v.filter((e=>(0,g.matchesScope)(e,"testrun")));const r=new l.Config(t);const i={identity:r.getIdentity("testrun"),fields:r.getFields("testrun")};const o=b.filter(e,i,"testrun")||[];const a=o.map((e=>({label:`${(0,s.basename)(e.uri)} ${e.custom?.identity?`(${e.custom.identity})`:""} - "${e.feature?.name||""}"`,value:(0,s.basename)(e.uri)})));if(a.length===0){d.Diag.error({title:`No testrun files found to link into testplan '${p}'.`,detail:[`Create a testrun first with \`${h.TITLE_CLI} suite init -scope=testrun\`.`]}).abort()}n=await(0,m.askSelect)(`Selecciona el testrun para enlazar en '${(0,s.basename)(T)}':`,a)}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite link "<testrunFile|@tr-N>" -target="${p}"`,detail:[`Please specify the testrun to link into testplan '${p}'.`,`Example: ${h.TITLE_CLI} suite link "sprint42.run.feature" -target="${p}"`]}).abort();return}}if(!n)return;let r=n;if(n.startsWith("@")||!n.includes(".feature")){const e=v.filter((e=>(0,g.matchesScope)(e,"testrun")));const t=e.find((e=>e.custom?.identity===n||e.uri.includes(n)));if(t){r=(0,s.basename)(t.uri)}}const{addedRule:o}=a.GherkinEditor.linkRuleOrScenario(T,r);if(o){console.log((0,i.green)((0,i.bold)(`\n✓ Successfully linked Rule '${r}' into testplan '${(0,s.basename)(T)}'`)))}else{console.log((0,i.yellow)(`\n~ Rule '${r}' is already present in testplan '${(0,s.basename)(T)}'`))}return}let S=e.linkArg;if(!S){if((0,m.isInteractive)()){const e=await(0,m.askSelect)("¿Cómo deseas enlazar a este testrun?",[{label:"Enlace Implícito - Enlazar todo un archivo .case.feature mediante Rule",value:"implicit"},{label:"Enlace Explícito - Enlazar un escenario específico con status",value:"explicit"}]);const n=v.filter((e=>(0,g.matchesScope)(e,"testcase")));const r=new l.Config(t);const i={identity:r.getIdentity("testcase"),fields:r.getFields("testcase")};const o=b.filter(n,i,"testcase")||[];if(e==="implicit"){const e=Array.from(new Set(o.map((e=>(0,s.basename)(e.uri)))));const t=e.map((e=>({label:e,value:e})));const n=await(0,m.askSelect)("Selecciona el archivo .case.feature a enlazar:",t);S=n}else{const e=Array.from(new Set(o.map((e=>(0,s.basename)(e.uri)))));let t="";if(e.length>1){const n=e.map((e=>({label:e,value:e})));t=await(0,m.askSelect)("Selecciona el archivo .case.feature del escenario:",n)}else if(e.length===1){t=e[0]}const n=o.filter((e=>!t||(0,s.basename)(e.uri)===t));const r=n.map((e=>{const t=e.custom?.identity?`[${e.custom.identity}] `:"";return{label:`${t}${e.name}`,value:`${(0,s.basename)(e.uri)}.${e.custom?.identity||e.name}`}}));const i=await(0,m.askSelect)("Selecciona el testcase a enlazar:",r);const a=await(0,m.askStatus)("pending");S=`${i}=${a}`}}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite link "<identifier>=<status>" -target="${p}"`,detail:[`Please provide the testcase or rule argument to link into '${p}'.`,`Usage:`,` Implicit link: ${h.TITLE_CLI} suite link "checkout.case.feature" -target="${p}"`,` Explicit link: ${h.TITLE_CLI} suite link "checkout.case.feature.@tc-1" -target="${p}"`,` ${h.TITLE_CLI} suite link "@tc-1" -target="${p}"`,` ${h.TITLE_CLI} suite link "@tc-1=passed" -target="${p}"`]}).abort();return}}if(!S)return;const k=S.replace(/=(passed|failed|skipped|pending)$/i,"").trim();const D=k.includes("@")||k.includes("=")||k.includes(".case.feature.")||k.includes(".run.feature.");const _=v.filter((e=>(0,g.matchesScope)(e,"testcase")));const E=Array.from(new Set(_.map((e=>e.uri))));const C=!D?E.find((e=>e===k||(0,s.basename)(e)===k||(0,s.basename)(e).replace(/\.feature$/i,"")===k.replace(/\.feature$/i,"")||(0,s.basename)(e).replace(/\.case\.feature$/i,"")===k.replace(/\.case\.feature$/i,""))):undefined;if(C){const e=(0,s.basename)(C);const{addedRule:t}=a.GherkinEditor.linkRuleOrScenario(T,e);if(t){console.log((0,i.green)((0,i.bold)(`\n✓ Successfully linked Rule '${e}' implicitly into testrun '${(0,s.basename)(T)}'`)))}else{console.log((0,i.yellow)(`\n~ Rule '${e}' is already present in testrun '${(0,s.basename)(T)}'`))}return}const{featurePart:R,casePart:P,newStatus:O}=(0,g.parseSpec)(S,{command:"link"});const A=new l.Config(t);const L={identity:A.getIdentity("testcase"),fields:A.getFields("testcase")};const x=b.filter(_,L,"testcase")||[];const I=x.filter((e=>(0,g.matchesScenarioSpec)(e,{featurePart:R,casePart:P})));if(I.length===0){d.Diag.error({title:`Testcase '${P}' not found in workspace to link.`,detail:[`Make sure the .case.feature file and scenario exist in your test directory.`]}).abort()}if(I.length>1){const e=I.map((e=>`${(0,s.basename)(e.uri)}.${e.custom?.identity||e.name}`));d.Diag.ambiguousTestcase({identifier:P,target:"workspace",matches:e}).abort()}const $=I[0];const F=(0,s.basename)($.uri);const j=$.custom?.identity||$.name;const{addedRule:M,addedScenario:N,updatedScenario:B}=a.GherkinEditor.linkRuleOrScenario(T,F,j,O);if(N){console.log((0,i.green)((0,i.bold)(`\n✓ Linked Scenario '${j}' under '${F}' with status '${O}' into '${(0,s.basename)(T)}'`)))}else if(B){console.log((0,i.green)((0,i.bold)(`\n✓ Updated Scenario '${j}' status to '${O}' in '${(0,s.basename)(T)}'`)))}else if(M){console.log((0,i.green)((0,i.bold)(`\n✓ Linked Rule '${F}' into '${(0,s.basename)(T)}'`)))}}async function runState(e){const{dir:t,target:r,subCommand:o="link",tcArg:y,statePath:b,backupPath:v,testDirectory:w,variables:T,verbose:S=false}=e;const k=new u.State(t,b,v);await k.init();const D=w?(0,s.join)(t,w):t;const{scenario:_,absolutePath:E}=await(0,g.resolveTargetScenario)(r,t,"testrun",w,T);let C;const R=_.custom?.identity;if(!R){C=_.uri}else if(R.startsWith(_.uri)||R===_.uri){C=R}else{C=`${_.uri}.${R}`}const P=k.getResources("testrun");const O=P.find((e=>e.identity===C));if(!O){d.Diag.error({title:`Testrun not found in state for target '${r}' (Identity: ${C}).`,detail:[`Try running \`${h.TITLE_CLI} refresh -scope testrun\` to sync state.`]}).abort();return}let A="";let L="";let x="";let I="";const $=k.getResources("testcase");if(y){if(!y.includes("=")&&(o==="mark"||o==="state")){if((0,m.isInteractive)()){const e=await(0,m.askStatus)();({featurePart:A,casePart:L,newStatus:x,rawIdentifier:I}=(0,g.parseSpec)(`${y}=${e}`,{command:"mark"}))}else{({featurePart:A,casePart:L,newStatus:x,rawIdentifier:I}=(0,g.parseSpec)(y,{command:"mark"}))}}else{({featurePart:A,casePart:L,newStatus:x,rawIdentifier:I}=(0,g.parseSpec)(y,{command:"mark"}))}}else{const e=O.attributes?.testcases||O.attributes?.testcaseStatuses||O.attributes?.testcaseCommentIds||{};const t=Object.keys(e);if(t.length===0){d.Diag.error({title:`No testcases found in testrun '${r}'. Run \`testform apply\` first.`,detail:[]}).abort();return}if((0,m.isInteractive)()){const e=t.map((e=>{const t=O.attributes?.testcases?.[e]||O.attributes?.testcaseStatuses?.[e]||"pending";const n=$.find((t=>t.identity===e));const s=n?.attributes?.title?` - "${n.attributes.title}"`:"";return{label:`${e}${s} [${t}]`,value:e}}));const n=await(0,m.askSelect)(`Testcases disponibles en '${O.identity}':`,e);const s=await(0,m.askStatus)();const r=n.lastIndexOf(".");const i=r!==-1?n.slice(0,r):n;const o=r!==-1?n.slice(r+1):"";A=i;L=o;x=s;I=n}else{console.log((0,i.bold)(`\nAvailable testcases in '${O.identity}':`));t.forEach(((e,t)=>{const n=O.attributes?.testcases?.[e]||O.attributes?.testcaseStatuses?.[e]||"pending";const s=$.find((t=>t.identity===e));const r=s?.attributes?.title?` - "${s.attributes.title}"`:"";console.log(` ${t+1}. ${e}${r} [${n}]`)}));console.log(`\n${(0,i.bold)("Available statuses:")} ${h.TESTCASE_STATUSES.join(", ")}\n`);d.Diag.usage({syntax:`${h.TITLE_CLI} suite ${o} "<identifier>=<status>" -target="${r}"`,detail:[`Please provide the testcase argument.`,`Strategies:`,` 1. Only tag: "@tc-1=passed"`,` 2. File + tag: "checkout.case.feature.@tc-1=passed"`,` 3. Scenario name: "Pago con tarjeta=passed"`]}).abort();return}}const F=O.attributes?.testcaseCommentIds||{};const j=Object.keys(F).filter((e=>{const t=$.find((t=>t.identity===e));return(0,g.matchesStateKey)(e,t?.attributes?.title,{featurePart:A,casePart:L,rawIdentifier:I})}));if(j.length===0){d.Diag.testcaseNotFound({identifier:I,target:r,available:Object.keys(F)}).abort()}if(j.length>1){d.Diag.ambiguousTestcase({identifier:L,target:r,matches:j,command:o,status:x}).abort()}const M=j[0];const N=F[M];const B=O.attributes?.testcases?.[M]||O.attributes?.testcaseStatuses?.[M]||"pending";const U=M.lastIndexOf(".");const W=U!==-1?M.slice(0,U):M;const G=U!==-1?M.slice(U+1):"";if(_?.uri){const e=a.GherkinEditor.parseRawDocument(E);const n=(e.feature?.children||[]).filter((e=>e.rule));const i=W.replace(/\.feature$/i,"").replace(/\\/g,"/");const o=n.find((e=>{const t=(e.rule?.name||"").replace(/\.feature$/i,"").replace(/\\/g,"/");return t===i||t.endsWith("/"+i)||i.endsWith("/"+t)||t.endsWith(i)||i.endsWith(t)}));const c=o?.rule?.children?.some((e=>{const t=e.scenario?.name||"";const n=G?G.trim().toLowerCase():"";const s=t.trim().toLowerCase();return s===n||s.replace(/^@/,"")===n.replace(/^@/,"")||s.endsWith(`.${n}`)||s.endsWith(`.${n.replace(/^@/,"")}`)}));if(!c){const e=o?.rule?.location?.line;const n=(0,s.relative)(t,E)||(0,s.basename)(E);d.Diag.implicitRule({file:n,line:e,rule:W,scenario:G,target:r}).abort()}}const q=await(0,f.createCommandContext)({dir:t,verbose:S,lock:false});if(!q)process.exit(1);const H=k.getResources("testcase").find((e=>e.identity===M));const K=H?.attributes?.title||M;const V=n(6928).basename(W||"");const z=G?G.replace("@",""):"";const J=`**Origin:** ${V}\n<table border="1" width="100%">\n <tr>\n <th colspan="3">Feature Name</th>\n </tr>\n <tr>\n <td>${z}</td>\n <td>${K}</td>\n <td>${x}</td>\n </tr>\n <tr>\n <td colspan="3"><br/></td>\n </tr>\n</table>`;await q.adapter.updateIssueComment(N,J);console.log(` -> Updated status comment for ${M} to '${x}'`);if(!O.attributes.testcases)O.attributes.testcases={};O.attributes.testcases[M]=x;if(O.attributes.testcaseStatuses)O.attributes.testcaseStatuses[M]=x;await k.save();console.log(`\n ${(0,i.yellow)("~")} resource "${O.type||"testrun"}" "${O.identity}" {`);console.log(` ${(0,i.yellow)("~")} testcaseStatuses {`);console.log(` ${(0,i.yellow)("~")} "${M}": "${B}" -> "${x}"`);console.log(` }`);console.log(` }\n`);if(_?.uri){try{a.GherkinEditor.updateScenarioStatus(E,W,G,x);console.log(` -> Synced status to local file: ${_.uri}`);const e=new l.Config(t);const n=new c.Parser(D,T);const s={identity:e.getIdentity("testrun"),fields:e.getFields("testrun")};const r=n.filter(n.content(),s,"testrun");const i=r?.find((e=>e.uri===_.uri||e.custom?.identity===O.identity));const o=p.resource.evaluate(O.type||"testrun",i||_,{state:k,testDirectory:w});await q.adapter.updateIssue(O.attributes.issueNumber,o);console.log(` -> Synced status to main issue body #${O.attributes.issueNumber}`)}catch(e){console.log(` -> Failed to update local file or issue body: ${e.message}`)}}console.log((0,i.green)((0,i.bold)(`Status successfully updated!`)))}async function runTagsSuite(e){const{dir:t,tagExpression:n,title:o,testDirectory:u,variables:f}=e;const p=u?(0,s.join)(t,u):t;const h=new l.Config(t);let m;try{m=parseTagAddress(n)}catch{d.Diag.error({title:`Invalid tag address format: '${n}'`,detail:[`Expected bracket address format:`,` 1. File specific: "checkout.case.feature.[@smoke]"`,` 2. Workspace-wide: "[@smoke]" or "[@smoke,@critical]"`]}).abort();return}const{filePattern:y,tags:b}=m;const v=new c.Parser(p,f);const w=v.content()||[];const T=w.filter((e=>(0,g.matchesScope)(e,"testcase")));let S=T;if(y){S=S.filter((e=>(0,g.matchesFeatureFile)(e.uri,y)));if(S.length===0){d.Diag.error({title:`No testcase files matched '${y}'.`,detail:[`Available files:`,...Array.from(new Set(T.map((e=>` - ${e.uri}`)))).slice(0,10)]}).abort();return}}const k=S.filter((e=>{const t=[...e.tags||[],...e.feature?.tags||[]].map(String);return t.some((e=>b.includes(e)))}));if(k.length===0){d.Diag.error({title:`No testcase scenarios found matching tag(s) [${b.join(", ")}].`,detail:[y?`Searched within: ${y}`:`Searched across all testcase files in workspace.`,`Total testcases evaluated: ${S.length}`]}).abort();return}const D=new Map;for(const e of k){const t=e.uri;if(!D.has(t)){D.set(t,[])}D.get(t).push(e)}const _=h.getConvention("testrun");const E=h.getScopeConf("testrun");const C=h.getIdentity("testrun");const R=_?.directory||E?.directory||"tests/runs";const P=_?.filename||`{YYYYMMDD}_{HHmmss}.run.feature`;const O=new Date;const A=O.toISOString().split("T")[0].replace(/-/g,"");const L=O.toTimeString().split(" ")[0].replace(/:/g,"");const x=O.getTime().toString();const I=b.map((e=>e.replace("@",""))).join("_").toLowerCase();let $=o||`Suite ${b.join(" ")}`;let F=I;if(y){const e=(0,s.basename)(y).replace(/\.feature$/i,"").replace(/\.case$/i,"");F=`${e}_${I}`}let j=P.replace(/{YYYYMMDD}/g,A).replace(/{HHmmss}/g,L).replace(/{timestamp}/g,x).replace(/{slug}/g,F);j=j.replace(/^[_\-]+/,"").replace(/[_\-]+(\.)/g,"$1");const M=Math.random().toString(16).substring(2,8);if(j.endsWith(".feature")){if(j.endsWith(".run.feature")){j=j.replace(".run.feature",`_${M}.run.feature`)}else{j=j.replace(".feature",`_${M}.feature`)}}else{if(j.endsWith(".run")){j=j.replace(".run",`_${M}.run.feature`)}else{j+=`_${M}.run.feature`}}const N=(0,s.join)(t,R,j);const B=(0,s.dirname)(N);if(!(0,r.existsSync)(B)){(0,r.mkdirSync)(B,{recursive:true})}const U=C?(0,a.findNextIdentity)(t,C):null;let W=`@testrun`;if(U){W+=` ${U}`}W+=`\nFeature: ${$}\n\n`;let G=0;for(const[e,t]of D.entries()){const n=(0,s.basename)(e);W+=` Rule: ${n}\n`;for(const e of t){const t=e.name||"Unnamed Scenario";W+=` Scenario: ${t}\n`;W+=` * mark status = pending\n\n`;G++}}(0,r.writeFileSync)(N,W.trim()+"\n","utf-8");console.log((0,i.green)((0,i.bold)(`\nGenerated testrun suite file: ${N}`)));console.log(` ${(0,i.green)("✓")} Included ${G} scenario(s) matching tag(s) ${b.join(", ")} across ${D.size} file(s).`)}const suiteCmd=async e=>{const{dir:n,subCommand:s,subArgs:r,scope:i,title:o,rules:a,target:c,tags:l,fill:u,link:f,mark:p,testDirectory:y,statePath:b,backupPath:v,variables:w,verbose:T}=e;let S=(s||"").toLowerCase();const k=[...r];if(u){S="fill"}else if(f){S="link";if(k.length===0)k.push(f)}else if(p){S="mark";if(k.length===0)k.push(p)}else if(l){S="tags"}let D=i;let _=o;let E=c;const C=l||(S.includes("[")&&S.endsWith("]")?S:k.length>0&&k[0].includes("[")?k[0]:undefined);if(S==="tags"||C&&(!S||S==="tags"||S==="init"||S==="run")){const e=C||(k.length>0?k[0]:undefined);if(!e){d.Diag.usage({syntax:`${h.TITLE_CLI} suite tags "<address>" [-title=<title>]`,detail:[`Generates a new testrun suite (.run.feature) by extracting scenarios with matching tags.`,``,`Address strategies:`,` 1. File-specific tag: "checkout.case.feature.[@smoke]" (only scenarios with @smoke from this file)`,` 2. Workspace-wide tag: "[@smoke]" (all scenarios with @smoke from any file)`,` 3. Multiple tags: "[@smoke,@critical]" (scenarios matching any of the specified tags)`,``,`Examples:`,` ${h.TITLE_CLI} suite -tags="[@smoke]"`,` ${h.TITLE_CLI} suite -tags="checkout.case.feature.[@smoke]"`,` ${h.TITLE_CLI} suite tags "[@smoke]" -title="Smoke Regression"`]}).abort();return}await runTagsSuite({dir:n,tagExpression:e,title:_,testDirectory:y,variables:w});return}if(!S){if((0,m.isInteractive)()){S=await(0,m.askSelect)("¿Qué operación de suite deseas realizar?",[{label:"init - Crear un nuevo archivo de suite (.run.feature o .plan.feature)",value:"init"},{label:"tags - Generar un testrun a partir de tags con corchetes (ej: [@smoke])",value:"tags"},{label:"fill - Autocompletar reglas vacías de un testrun con sus casos",value:"fill"},{label:"link - Enlazar casos o runs en la suite (escribe Gherkin implícita/explícitamente)",value:"link"},{label:"mark - Registrar estado de ejecución de un testcase y sincronizar",value:"mark"}])}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite [subcommand] [options]`,detail:[`Subcommand:`,` init Create a new suite file (.run.feature or .plan.feature)`,``,`Options:`,` -fill Autocomplete empty testrun rules with their testcases`,` -link="<id>=<status>" Link a testcase or testrun into a suite`,` -mark="<id>=<status>" Record execution status (* mark status = <status>) in a testrun`,` -tags="<address>" Generate a testrun suite from bracketed tag addresses (e.g. "[@smoke]")`,``,`Other Options:`,` -target=<resource> Required for -fill, -link, -mark. Identifies the suite file:`,` • Identity tag: @tr-1, @tp-1 (unique for testrun and testplan)`,` • Canonical address: tests/runs/smoke.run.feature.@tr-1`,` • Scoped file path: smoke.run.feature (scoped to -test-directory)`,` -test-directory=<dir> Optional. Limits the search scope for .case.feature files and shortens target paths.`,` -scope=<testrun|testplan> Optional (global). Scope of the suite to generate.`,` -title=<title> Optional. Human-readable title of the suite.`,` -rule=<rule> Optional. Source .case.feature file(s) to include as Rule blocks.`]}).abort()}}if(S==="init"||S==="new"||S==="feature"||S==="add"){if(!D){if((0,m.isInteractive)()){D=await(0,m.askSelect)("Selecciona el scope para la suite:",[{label:"testrun - Suite de ejecución (.run.feature)",value:"testrun"},{label:"testplan - Suite de planificación (.plan.feature)",value:"testplan"}]);if(!_){_=await(0,m.askInput)("Ingresa el título de la suite")}}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite init -scope=<testrun|testplan> [-title=<title>] [-rule=<rule>] [-tags=<expression>]`,detail:[`Note: 'suite init' applies to testrun or testplan scope.`,``,`Options:`,` -scope=<testrun|testplan> Scope of the suite to generate`,` -title=<title> Human-readable title for the suite feature`,` -rule=<rule> Rule file name(s) to include (repeatable)`,` -tags=<expression> Generate a testrun filtered by tag address (e.g. "[@smoke]" or "file.case.feature.[@smoke]")`]}).abort();return}}if(!D)return;await runAdd({dir:n,scope:D,title:_,rules:a});return}if(S==="fill"){if(!E){if((0,m.isInteractive)()){E=await(0,g.promptTargetSuite)(n,["testrun"],y,w)}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite fill -target=<target>`,detail:[`This command is exclusive to testrun scope.`,`It expands empty Rule blocks using the source .case.feature scenarios.`,``,...t.TARGET_STRATEGIES_DETAIL]}).abort();return}}if(!E)return;await runAutocomplete({dir:n,target:E,testDirectory:y,variables:w});return}if(S==="link"){if(!E&&(0,m.isInteractive)()){E=await(0,g.promptTargetSuite)(n,["testrun","testplan"],y,w)}if(!E){d.Diag.usage({syntax:`${h.TITLE_CLI} suite link "<identifier>=<status>" -target=<target>`,detail:[`Links a testcase or testrun into the target suite file.`,``,...t.IDENTIFIER_STRATEGIES_DETAIL,``,...t.TARGET_STRATEGIES_DETAIL]}).abort();return}await runLink({dir:n,target:E,linkArg:k.length>0?k[0]:undefined,statePath:b,backupPath:v,testDirectory:y,variables:w,verbose:T});return}if(S==="mark"){if(!E){if((0,m.isInteractive)()){E=await(0,g.promptTargetSuite)(n,["testrun"],y,w)}else{d.Diag.usage({syntax:`${h.TITLE_CLI} suite mark "<identifier>=<status>" -target=<target>`,detail:[`Updates the execution status (* mark status = <status>) of a testcase in a testrun.`,`Available statuses: ${h.TESTCASE_STATUSES.join(", ")}`,``,...t.IDENTIFIER_STRATEGIES_DETAIL,``,...t.TARGET_STRATEGIES_DETAIL]}).abort();return}}if(!E)return;await runState({dir:n,target:E,subCommand:"mark",tcArg:k.length>0?k[0]:undefined,statePath:b,backupPath:v,testDirectory:y,variables:w,verbose:T});return}d.Diag.unknownSubcommand({command:"suite",subcommand:s||"",available:["init","fill","link","mark","tags"]}).abort()};t.suiteCmd=suiteCmd;t.toolCmd=t.suiteCmd},1510:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.taintCmd=void 0;const s=n(465);const r=n(7066);const i=n(4296);const o=n(2978);const taintCmd=async e=>{const{dir:t=".",action:n,identityRaw:a,statePath:c,backupPath:l,allowMissing:u=false,lock:d=true,lockTimeout:f="0s"}=e;const p=new r.State(t,c,l);await p.init();await p.acquireLock(d,f);try{let e=null;for(const t of["testcase","testrun","testplan"]){const n=a.replace(new RegExp(`^([a-zA-Z0-9_-]+_)?${t}\\.`),"");e=p.getResources(t).find((e=>e.identity===n||(0,o.normalizeAddress)(e.identity)===(0,o.normalizeAddress)(n)||(0,o.normalizeAddress)(e.identity)===(0,o.normalizeAddress)(a)));if(e)break}if(!e){if(u){console.log((0,s.green)(`Resource not found in state, but allow-missing is set. Exiting successfully.`));return}console.error((0,s.red)(`Error: Resource not found in state.`));throw new i.TestformError(`Resource not found in state.`)}if(n==="taint"){if(e.tainted){console.log(`Resource instance ${a} is already tainted`)}else{e.tainted=true;p.upsertResource(e);await p.save();console.log((0,s.green)(`Resource instance ${a} has been marked as tainted.`))}}else{if(!e.tainted){console.log(`Resource instance ${a} is not tainted`)}else{delete e.tainted;p.upsertResource(e);await p.save();console.log((0,s.green)(`Resource instance ${a} has been successfully untainted.`))}}}finally{await p.releaseLock()}};t.taintCmd=taintCmd},4710:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.toolCmd=t.suiteCmd=void 0;var s=n(5822);Object.defineProperty(t,"suiteCmd",{enumerable:true,get:function(){return s.suiteCmd}});Object.defineProperty(t,"toolCmd",{enumerable:true,get:function(){return s.toolCmd}})},10:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateCmd=void 0;const s=n(9896);const r=n(6928);const i=n(4489);const o=n(5392);const a=n(2721);const c=n(1227);const l=n(7442);const u=n(1138);const d=n(6028);const f=n(8169);const validateCmd=async e=>{const{targetPath:t=".",dir:n=".",verbose:p=false,target:h,variables:m,isJson:g=false,testDirectory:y,noTests:b=false,query:v}=e;const w=new c.Logger(p);if(!g){w.info("Validating configuration...",{bold:true})}let T=n;let S=n;let k=h;if(t&&t!=="."){try{if((0,s.existsSync)(t)&&(0,s.statSync)(t).isFile()){k=h||t;S=(0,r.dirname)(t);if(!(0,s.existsSync)((0,r.join)(T,d.FILE_CONFIG))&&(0,s.existsSync)((0,r.join)(S,d.FILE_CONFIG))){T=S}}else{S=t;T=t}}catch{S=t}}if(y){S=(0,r.join)(S,y)}const D=new o.Parser(S,m);const _=D.content();if(_.length===0){if(g){console.log(JSON.stringify({valid:false,error_count:1,warning_count:0,diagnostics:[{severity:"error",summary:"Failed to read module directory",detail:`Module directory ${S} does not exist or cannot be read.`}]},null,2))}else{w.error(`Failed to read module directory\n\nModule directory ${S} does not exist or cannot be read.`)}return}const E=new i.Config(T);w.debug(`Configuration loaded: v${E.getConfig().version}`);const C=E.getConfig().provider;const R=E.getProviderType();const P=["github","gitlab","local","custom"];const O=!C||typeof C==="string"&&C.trim()===""||typeof C==="object"&&Object.keys(C).length===0;if(O||!P.includes(R)){const e=O?`a provider to be defined in ${d.FILE_CONFIG}`:`provider "${R}"`;if(g){console.log(JSON.stringify({valid:false,error_count:1,warning_count:0,diagnostics:[{severity:"error",summary:"Missing required provider",detail:`This configuration requires ${e}, but that provider isn't available. Run "testform init" to configure it.`}]},null,2))}else{w.push({type:"error",title:"Missing required provider",detail:[`This configuration requires ${e}, but that provider isn't available. You may be able`,`to install or configure it automatically by running:`,` testform init`],close:true})}return}w.debug(`Found ${_.length} scenarios across feature files`);const A=k||e.scope;const L=(0,f.resolveScopes)(A);let x=0;const I={};const $=[];for(const e of L){const t=E.getMatch?.(e);let n=_.filter((n=>(0,l.matchesScope)(n,e,t)));if(k){n=n.filter((t=>{const n=t.custom?.identity?`${t.uri}.${t.custom.identity}`:t.uri;return(0,l.matchesTarget)(n,k,e)||(0,l.matchesTarget)(t.uri,k,e)}))}if(n.length===0){continue}const s={identity:E.getIdentity(e),fields:E.getFields(e)};let r=D.filter(n,s,e);if(v){const t=v.toLowerCase();r=r.filter((e=>e.name&&e.name.toLowerCase().includes(t)||e.custom?.identity&&e.custom.identity.toLowerCase().includes(t)||e.tags&&e.tags.some((e=>(typeof e==="string"?e:e.name).toLowerCase().includes(t)))||e.uri&&e.uri.toLowerCase().includes(t)));if(!g){w.info(`--- Query Results for "${v}" (${e}) ---`,{bold:true});if(r.length===0){w.info(`No scenarios matched the query in scope "${e}".`)}else{r.forEach((t=>{w.info(`- [${e}] ${t.custom?.identity||t.name} (File: ${t.uri}:${t.location})`)}))}w.blank()}}if(r.length>0){I[e]=r.length;x+=r.length;$.push(...r)}}if($.length===0){if(!g){if(k){const e=Array.isArray(k)?k.join(", "):k;w.warn(`No scenarios found matching target "${e}".`)}else{w.warn(`No scenarios found across the configuration.`)}}return}if(!g){const e=Object.keys(I);for(const t of e){w.debug(`Found ${I[t]} scenarios matching scope "${t}"`)}}const F=new u.DependencyResolver(T);try{const getCanonicalId=e=>{const t=e.custom?.identity;if(!t)return`${e.uri}.${e.name}`;if(t.startsWith(e.uri)||t===e.uri)return t;return`${e.uri}.${t}`};F.sortTopologically($,getCanonicalId,(e=>e.tags?e.tags.map((e=>typeof e==="string"?e:e.name)):[]))}catch(e){if(g){console.log(JSON.stringify({valid:false,error_count:1,warning_count:0,diagnostics:[{severity:"error",summary:"Circular dependency detected",detail:e.message}]},null,2))}else{w.error(`Circular dependency detected\n\n${e.message}`)}return}if(!b){if(a.policy&&typeof a.policy.loadCustomPolicies==="function"){await a.policy.loadCustomPolicies(T)}const e=E&&typeof E.getPolicies==="function"?E.getPolicies():undefined;if(e&&a.policy&&typeof a.policy.configure==="function"){a.policy.configure(e)}for(const e of Object.keys(I)){const t=$.filter((t=>(0,l.matchesScope)(t,e,E.getMatch?.(e))));const n=a.policy.scanner(t,e,g);if(n){const e=new Error("Please fix them before continuing.");e.name="Policy violations found";throw e}}}else if(!g){w.info(`Skipping policy validation (-no-tests).`)}if(g){console.log(JSON.stringify({valid:true,error_count:0,warning_count:0,diagnostics:[]},null,2))}else{w.success("Success! The configuration is valid.",{bold:true});w.blank();w.info(` Scenarios: ${x}`);if(k){const e=Array.isArray(k)?k.join(", "):k;w.info(` Target: ${e}`)}}};t.validateCmd=validateCmd},2743:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.workspaceCmd=void 0;const s=n(465);const r=n(1227);const i=n(7066);const o=n(6028);const workspaceCmd=async e=>{const{dir:t,verbose:n,args:a}=e;const c=new r.Logger(n);const l=new i.State(t);const u=a[0];const d=a[1];if(!u){c.error(`Usage: ${o.TITLE_CLI} workspace [subcommand] [options] [args]`);process.exit(1)}if(typeof l.init==="function")await l.init();const f=l.getCurrentWorkspace();switch(u){case"show":console.log(f);break;case"list":const e=await l.listWorkspaces();for(const t of e){if(t===f){console.log((0,s.green)(`* ${t}`))}else{console.log(` ${t}`)}}break;case"new":if(!d){c.error("Expected a workspace name");process.exit(1)}const n=await l.listWorkspaces();if(n.includes(d)){c.error(`Workspace "${d}" already exists`);process.exit(1)}l.setCurrentWorkspace(d);const r=new i.State(t);if(typeof r.init==="function")await r.init();if(typeof r.clearResources==="function")r.clearResources();if(typeof r.save==="function")await r.save();console.log((0,s.green)(`Created and switched to workspace "${d}"!`));console.log("");console.log(`You're now on a new, empty workspace. Workspaces isolate their state,`);console.log(`so if you run "${o.TITLE_CLI} plan" ${o.TITLE_CLI} will not see any existing state`);console.log(`for this configuration.`);break;case"select":if(!d){c.error("Expected a workspace name");process.exit(1)}const a=await l.listWorkspaces();if(!a.includes(d)){c.error(`Workspace "${d}" doesn't exist.\n\nYou can create this workspace with the "new" subcommand.`);process.exit(1)}l.setCurrentWorkspace(d);console.log((0,s.green)(`Switched to workspace "${d}".`));break;case"delete":if(!d){c.error("Expected a workspace name");process.exit(1)}if(d==="default"){c.error(`Workspace "default" cannot be deleted.`);process.exit(1)}if(d===f){c.error(`Workspace "${d}" is your active workspace.\n\nYou cannot delete the currently active workspace. Please switch\nto another workspace and try again.`);process.exit(1)}const p=await l.listWorkspaces();if(!p.includes(d)){c.error(`Workspace "${d}" doesn't exist.`);process.exit(1)}const h=await l.deleteWorkspace(d);if(h){console.log((0,s.green)(`Deleted workspace "${d}"!`))}else{c.error(`Failed to delete workspace "${d}".`);process.exit(1)}break;default:c.error(`Invalid workspace subcommand: ${u}`);process.exit(1)}};t.workspaceCmd=workspaceCmd},8169:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ALL_SCOPES=t.VALID_RESOURCES=void 0;t.resolveScopes=resolveScopes;t.assertApprovalAllowed=assertApprovalAllowed;t.resolveWorkDir=resolveWorkDir;t.resolveVariableParser=resolveVariableParser;t.normalizeCliArgs=normalizeCliArgs;t.compareCliVersions=compareCliVersions;t.withStateLock=withStateLock;const s=n(6928);const r=n(7066);const i=n(7442);const o=n(9922);const a=n(6028);t.VALID_RESOURCES=["testcase","testrun","testplan"];t.ALL_SCOPES=t.VALID_RESOURCES;function resolveScopes(e){if(e){const n=Array.isArray(e)?e:[e];const s=n.map((e=>e.trim().toLowerCase())).filter((e=>t.VALID_RESOURCES.includes(e)));if(s.length>0){return s}const r=n.map((e=>(0,i.detectScopeFromTarget)(e))).filter((e=>!!e));if(r.length>0&&r.length===n.length){return Array.from(new Set(r))}}return[...t.ALL_SCOPES]}function assertApprovalAllowed(e,t){if(!e&&!t){const e=new Error(`${a.ERR_NO_INPUT_ALLOWED}\nUse the -auto-approve flag to bypass approval.`);e.name="No input allowed";console.error(`${e.name}: ${e.message}`);throw e}}function resolveWorkDir(e){const t=String(e.chdir||".");return(0,s.resolve)(process.env.INIT_CWD||process.cwd(),t)}function resolveVariableParser(e,t){const n=e.var?Array.isArray(e.var)?e.var:[e.var]:undefined;const s=e.varFile?Array.isArray(e.varFile)?e.varFile:[e.varFile]:undefined;return new o.VariableParser(n,s,t)}function normalizeCliArgs(e){const t=new Set(["C","s","h","v","a","o"]);return e.map((e=>{const n=e.match(/^-([a-zA-Z][a-zA-Z0-9-]*)(=(.*))?$/);if(!n)return e;const s=n[1];const r=n[2]||"";if(t.has(s)){return e}return`--${s}${r}`}))}function compareCliVersions(e,t){const n=e.split(".").map((e=>Number(e)));const s=t.split(".").map((e=>Number(e)));const r=Math.max(n.length,s.length);for(let e=0;e<r;e++){const t=n.at(e)??0;const r=s.at(e)??0;if(t>r)return 1;if(t<r)return-1}return 0}async function withStateLock(e,t){const{dir:n=".",statePath:s,backupPath:i,lock:o=true,lockTimeout:a="0s"}=e;const c=new r.State(n,s,i);await c.init();await c.acquireLock(o,a);try{return await t(c)}finally{await c.releaseLock()}}},4489:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.Config=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=n(6028);const c=n(1227);const l=n(7862);class Config{dir;requiredConfig;config={};resolvedPath=null;constructor(e,t=true){this.dir=e;this.requiredConfig=t;if(this.requiredConfig){this.required()}else{const e=this.resolve();if(e){this.load(e)}}}resolve(){let e=(0,i.resolve)(this.dir);const t=(0,i.resolve)("/");while(e!==t){for(const t of a.CONFIG_FILE_NAMES){const n=(0,i.resolve)(e,t);if((0,r.existsSync)(n)){this.resolvedPath=n;return n}}const t=(0,i.resolve)(e,"..");if(t===e)break;e=t}for(const e of a.CONFIG_FILE_NAMES){const t=(0,i.resolve)(process.cwd(),e);if((0,r.existsSync)(t)){this.resolvedPath=t;return t}}return null}load(e){const t=(0,r.readFileSync)(e,"utf-8");this.config=o.default.parse(t)||{};const n=(0,i.dirname)(e);for(const e of["resource.yml","resource.yaml"]){const t=(0,i.resolve)(n,e);if((0,r.existsSync)(t)){try{const e=(0,r.readFileSync)(t,"utf-8");const n=o.default.parse(e)||{};const s=n.resource||n;if(s&&typeof s==="object"){const e=this.config.resource||{};const t={...s};for(const[n,s]of Object.entries(e)){if(s&&typeof s==="object"&&t[n]&&typeof t[n]==="object"){t[n]={...t[n],...s}}else{t[n]=s}}this.config.resource=t}}catch{}break}}const s=this.config.resource;if(s&&typeof s==="object"){const e=l.resource.getRegisteredTypes();const t=[...new Set(["testcase","testrun","testplan","global",...e])];for(const e of Object.keys(s)){if(!t.includes(e)){c.logger.push({type:"error",title:`Unknown resource type in configuration: "${e}"`,detail:[`The resource block only allows declaring: ${t.filter((e=>e!=="global")).join(", ")} (and global).`,`Verify your main.yml or resource.yml configuration.`],close:true})}}}return this.config}getResolvedPath(){return this.resolvedPath}getConfig(){return this.config}getProviderType(){const e=this.config.provider;if(!e){return"local"}if(typeof e==="string"){return e.trim().toLowerCase()}const t=["github","gitlab","custom","local"];for(const n of t){if(e[n]!==undefined&&(e[n]===null||typeof e[n]==="object")){return n}}const n=Object.keys(e);if(n.length>0&&(e[n[0]]===null||typeof e[n[0]]==="object")){return n[0].toLowerCase()}return"local"}getAdapterType(){return this.getProviderType()}getProviderConfig(e){const t=e||this.getProviderType();const n=this.config.provider;if(!n||typeof n==="string"){return{}}if(n[t]!==undefined&&typeof n[t]==="object"){return n[t]||{}}return{}}getGitHub(){const e=this.getProviderType();if(e!=="github")return undefined;const t=this.getProviderConfig("github")||{};return{owner:t.owner,repository:t.repository,projectId:t.project_id,tokenEnv:t.token_env||"GITHUB_TOKEN"}}getRequiredVersion(){const e=this.config.testform;if(e){if(typeof e==="string")return e;if(typeof e==="object")return e.required_version||e.version}return this.config.version}getBackend(){const e=this.config.testform;const t=e&&typeof e==="object"&&e.backend!==undefined?e.backend:this.config.backend;if(t===undefined)return undefined;if(t===null||typeof t==="string"&&t.trim()===""){return{type:"",config:{}}}if(typeof t==="string"){return{type:t.trim().toLowerCase(),config:{}}}const n=["local","github","s3","azurerm","gcs","oci","http","rest","custom"];for(const e of n){if(t[e]!==undefined&&typeof t[e]==="object"){return{type:e,config:t[e]||{}}}}const s=Object.keys(t);if(s.length>0&&typeof t[s[0]]==="object"){return{type:s[0].toLowerCase(),config:t[s[0]]||{}}}return undefined}getPolicies(){return this.config.policy}getScopeConf(e){const t=this.config.resource;if(!t)return undefined;return Object.prototype.hasOwnProperty.call(t,e)?t[e]:undefined}getMatch(e){const t=this.getScopeConf(e);if(!t?.match)return undefined;return t.match.trim()}getIdentity(e){const t=e==="testcase"?"tc-*":e==="testrun"?"tr-*":e==="testplan"?"tp-*":"*";const n=this.getScopeConf(e);let s=n?.identity;if(!s&&n?.match&&n.match.includes(".feature.")){const e=n.match.slice(n.match.indexOf(".feature.")+9).trim();if(e&&e!=="*"){s=e}}if(!s||s==="*"){return t}return s}getConvention(e){const t=this.getScopeConf("global");const n=this.getScopeConf(e);const s=t?.scaffold;const r=n?.scaffold;if(!s&&!r)return undefined;const i={...s||{},...r||{}};return i}getReportMapping(e){return this.config.report_mapping?this.config.report_mapping[e]:undefined}getFields(e){const t=this.getScopeConf("global")?.fields;const n=this.normalizeFields(t);const s=this.getScopeConf(e)?.fields;const r=this.normalizeFields(s);const i=new Map;for(const e of n){if(e.name)i.set(e.name.toLowerCase(),e)}for(const e of r){if(e.name)i.set(e.name.toLowerCase(),e)}return Array.from(i.values())}normalizeFields(e){if(!e)return[];if(Array.isArray(e)){return e.map((e=>{if(!e||typeof e!=="object")return null;const t=e.source==="tag"||e.source==="tags"||e.type==="tags"?"tag":"step";const n=e.enum??e.values;return{name:e.name,source:t,enum:n,required:e.required,default:e.default}})).filter(Boolean)}if(typeof e==="object"){const t=[];for(const[n,s]of Object.entries(e)){const e=typeof s==="object"&&s!==null?s:{};const r=e.source==="tag"||e.source==="tags"||e.type==="tags"?"tag":"step";const i=e.enum??e.values;t.push({name:e.name??n,source:r,enum:i,required:e.required,default:e.default})}return t}return[]}required(){const e=this.resolve();if(!e){c.logger.push({type:"error",title:"No configuration files",detail:["Plan requires configuration to be present. Planning without a configuration would mark everything for","destruction, which is normally not what is desired. If you would like to destroy everything, run plan with the",`-destroy option. Otherwise, create a ${a.TITLE_APP} configuration file (${a.FILE_CONFIG}) and try again.`],close:true})}const t=this.load(e);let n=t.version;if(!n&&t.testform){const e=t.testform;n=typeof e==="string"?e:e.required_version||e.version}if(n==null||n===""){c.logger.push({type:"error",title:`Configuration is missing the "version" or "testform" field`,detail:[`Add a "testform" or "version" field to your ${(0,i.basename)(e)} file and rerun init.`],close:true});return}const s=String(n);const r=s===a.VERSION_CONFIG||s==="1.0.0"||s.startsWith(`${a.VERSION_CONFIG}`)||s.includes(`>= ${a.VERSION_CONFIG}`)||s.includes(`>=${a.VERSION_CONFIG}`)||s.startsWith("v1.0")||s.startsWith("1.");if(!r){c.logger.push({type:"error",title:`configuration version mismatch`,detail:[`Found version "${n}", but expected "${a.VERSION_CONFIG}".`,`Update ${(0,i.basename)(e)} to version ${a.VERSION_CONFIG} and rerun init.`],close:true})}}}t.Config=Config},6028:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.MSG_APPROVE_ONLY_YES=t.MSG_ACQUIRING_LOCK=t.ERR_NO_INPUT_ALLOWED=t.ERR_GITHUB_CONFIG_NOT_FOUND=t.TESTCASE_STATUSES=t.SCOPE_CONFIG=t.SCOPE_RESOURCE_MAP=t.FILE_BACKEND=t.FILE_LOCK=t.FILE_DATA=t.FILE_STATE=t.DIR_CACHE=t.FILE_CONFIG=t.CONFIG_FILE_NAMES=t.VERSION_STATE=t.VERSION_CONFIG=t.VERSION_CLI=t.TITLE_CLI=t.TITLE_APP=void 0;const s=n(8330);t.TITLE_APP="Testform";t.TITLE_CLI="testform";t.VERSION_CLI=s.version;t.VERSION_CONFIG="1.0";t.VERSION_STATE="1.0";t.CONFIG_FILE_NAMES=["main.yml","main.yaml","testform.yml","testform.yaml","testform.config.yml","testform.config.yaml"];t.FILE_CONFIG="main.yml";t.DIR_CACHE=".testform/cache";t.FILE_STATE="testform.state";t.FILE_DATA=".testform/cache/data.json";t.FILE_LOCK=".testform/cache/lock.json";t.FILE_BACKEND=".testform/cache/backend.json";t.SCOPE_RESOURCE_MAP={testcase:"github_testcase",testrun:"github_testrun",testplan:"github_testplan",testreport:"github_testreport"};const r={testcase:"@testcase",testrun:"@testrun",testplan:"@testplan",testreport:"@testreport"};const i={testcase:".case.feature",testrun:".run.feature",testplan:".plan.feature",testreport:".report.feature"};t.SCOPE_CONFIG={testcase:{tag:r.testcase,ext:i.testcase,resource:t.SCOPE_RESOURCE_MAP.testcase},testrun:{tag:r.testrun,ext:i.testrun,resource:t.SCOPE_RESOURCE_MAP.testrun},testplan:{tag:r.testplan,ext:i.testplan,resource:t.SCOPE_RESOURCE_MAP.testplan}};t.TESTCASE_STATUSES=["pending","passed","failed","blocked","skipped","undefined"];const o={pending:"⏳",passed:"✅",failed:"❌",blocked:"⚠️",skipped:"⏭️",undefined:"❓"};t.ERR_GITHUB_CONFIG_NOT_FOUND=`GitHub configuration not found. Add a "github" section to your ${t.FILE_CONFIG} with owner, repository, and tokenEnv.`;t.ERR_NO_INPUT_ALLOWED=`This command requires manual approval, but input is disabled. Use the -auto-approve flag to bypass approval.`;t.MSG_ACQUIRING_LOCK="Acquiring state lock. This may take a few moments...";t.MSG_APPROVE_ONLY_YES=`Only 'yes' will be accepted to approve.`},8480:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createCommandContext=createCommandContext;t.withContext=withContext;const s=n(7486);const r=n(5095);const i=n(4489);const o=n(7066);const a=n(1227);const c=n(1227);const l=n(6028);const u=n(4296);async function createCommandContext(e={}){const{dir:t=".",verbose:n=false,statePath:u,backupPath:d,lock:f=true,lockTimeout:p="0s",silent:h=false}=e;const m=new a.Logger(n);const g=new i.Config(t);const y=g.getGitHub();const b=g.getProviderType();let v;if(b==="local"){v=new s.LocalProvider(t)}else if(b==="github"){if(!y){if(!h){c.logger.push({type:"error",title:"GitHub configuration not found",detail:[l.ERR_GITHUB_CONFIG_NOT_FOUND],close:true})}return null}v=new s.GitHubProvider(y)}else{v=await(0,r.createProvider)(g,t)}const w=new o.State(t,u,d);await w.init();await w.acquireLock(f,p);return{state:w,adapter:v,github:v,config:g,logger:m}}function withContext(e){return async(t,...n)=>{const s=await createCommandContext(t);if(!s){throw new u.TestformError("Failed to initialize command context")}try{await e(s,t,...n)}catch(e){s.logger.error(e.message,e);throw e}finally{await s.state.releaseLock()}}}},2633:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Credentials=void 0;const s=n(9896);const r=n(6928);const i=n(857);class Credentials{credsPath;constructor(){const e=(0,i.homedir)();const t=(0,r.join)(e,".testform.d");if(!(0,s.existsSync)(t)){(0,s.mkdirSync)(t,{recursive:true})}this.credsPath=(0,r.join)(t,"credentials.json")}load(){if(!(0,s.existsSync)(this.credsPath)){return{credentials:{}}}try{const e=(0,s.readFileSync)(this.credsPath,"utf8");return JSON.parse(e)}catch{return{credentials:{}}}}save(e){(0,s.writeFileSync)(this.credsPath,JSON.stringify(e,null,2),"utf8")}getToken(e="github.com"){const t=this.load();return t.credentials?.[e]?.token}getAuth(e="github.com"){const t=this.load();return t.credentials?.[e]}setToken(e="github.com",t){this.setAuth(e,{token:t})}setAuth(e="github.com",t){const n=this.load();if(!n.credentials)n.credentials={};n.credentials[e]=t;this.save(n)}removeToken(e="github.com"){const t=this.load();if(t.credentials?.[e]){delete t.credentials[e];this.save(t);return true}return false}}t.Credentials=Credentials},455:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.DataResolver=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=n(2978);const c=n(6028);class DataResolver{declaredData={};fileCache=new Map;httpCache=new Map;workDir;constructor(e="."){this.workDir=e;this.loadDeclarations()}loadDeclarations(){const e={};for(const t of c.CONFIG_FILE_NAMES){const n=(0,i.resolve)(this.workDir,t);if((0,r.existsSync)(n)){try{const t=o.default.parse((0,r.readFileSync)(n,"utf-8"));if(t&&typeof t.data==="object"){this.registerDataBlock(t.data,e)}}catch{}}}for(const t of["data.yml","data.yaml"]){const n=(0,i.resolve)(this.workDir,t);if((0,r.existsSync)(n)){try{const t=o.default.parse((0,r.readFileSync)(n,"utf-8"));if(t&&typeof t==="object"){const n=t.data&&typeof t.data==="object"?t.data:t;this.registerDataBlock(n,e)}}catch{}}}const t=this.findDomainConfigFiles(this.workDir);for(const n of t){try{const t=o.default.parse((0,r.readFileSync)(n,"utf-8"));if(t&&typeof t==="object"&&t.data&&typeof t.data==="object"){this.registerDataBlock(t.data,e)}}catch{}}this.declaredData=e}registerDataBlock(e,t){const n=new Set(["testcase","testrun","testplan","local_file","http"]);for(const[s,r]of Object.entries(e)){if(r===undefined||r===null)continue;if(n.has(s)&&typeof r==="object"&&!Array.isArray(r)){for(const[e,n]of Object.entries(r)){if(typeof n==="string"){let r;if(s==="local_file"){r={type:"local_file",file:n}}else if(s==="http"){r={type:"http",url:n,method:"GET"}}else{r={type:s,address:n}}t[`${s}.${e}`]=r;t[e]=r}else if(n&&typeof n==="object"){const r={type:s,...n};t[`${s}.${e}`]=r;t[e]=r}}continue}if(typeof r==="string"){const e=r.toLowerCase().trim();const n=e.startsWith("http://")||e.startsWith("https://");const i=e.endsWith(".json")||e.endsWith(".yaml")||e.endsWith(".yml")||e.endsWith(".csv");if(n){const e={type:"http",url:r,method:"GET"};t[s]=e;t[`http.${s}`]=e;continue}const o=i?{type:"local_file",file:r}:{address:r};t[s]=o;if(i){t[`local_file.${s}`]=o}else if(e.includes(".case.")||e.includes("@tc")){t[`testcase.${s}`]=o}else if(e.includes(".run.")||e.includes("@tr")){t[`testrun.${s}`]=o}else if(e.includes(".plan.")||e.includes("@tp")){t[`testplan.${s}`]=o}continue}if(typeof r==="object"){t[s]=r}}}findDomainConfigFiles(e){const t=[];if(!(0,r.existsSync)(e))return t;const n=new Set(["node_modules",".git",".testform",".terraform","dist","coverage",".system_generated"]);const s=new Set([...c.CONFIG_FILE_NAMES,"variables.yml","variables.yaml","vars.yml","vars.yaml","locals.yml","locals.yaml","local.yml","local.yaml","outputs.yml","outputs.yaml","data.yml","data.yaml"]);const scan=e=>{try{const o=(0,r.readdirSync)(e,{withFileTypes:true});for(const r of o){if(r.isDirectory()){if(!n.has(r.name)&&!r.name.startsWith(".")){scan((0,i.resolve)(e,r.name))}}else if(r.isFile()){const n=r.name.toLowerCase();if((n.endsWith(".yml")||n.endsWith(".yaml"))&&!s.has(n)){t.push((0,i.resolve)(e,r.name))}}}}catch{}};scan(e);return t.sort()}getDeclarations(){return this.declaredData}resolveSource(e,t){const n=this.declaredData[e];if(!n)return undefined;if(n.file){const e=(0,i.resolve)(this.workDir,n.file);if(this.fileCache.has(e)){return this.fileCache.get(e)}if((0,r.existsSync)(e)){try{const t=(0,r.readFileSync)(e,"utf-8");const n=e.endsWith(".json")?JSON.parse(t):o.default.parse(t);this.fileCache.set(e,n);return n}catch{return undefined}}return undefined}if(n.type==="http"||n.url||e.startsWith("http.")){return this.resolveHttp(n)}if(n.address){return this.resolveAddress(n.address,t)}if(n.filter&&t){return this.resolveFilter(n.filter,t)}return n}resolveHttp(e){const t=e.url||e.address||"";if(!t)return undefined;const s=(e.method||(e.body||e.request_body?"POST":"GET")).toUpperCase();const r={...e.headers||e.request_headers||{}};let i=e.body||e.request_body;if(i&&typeof i==="object"){i=JSON.stringify(i);if(!Object.keys(r).some((e=>e.toLowerCase()==="content-type"))){r["Content-Type"]="application/json"}}const o=`${s}:${t}:${i||""}`;if(this.httpCache.has(o)){return this.httpCache.get(o)}try{const{execFileSync:a}=n(5317);const c=`\n const input = JSON.parse(process.argv[1]);\n const opts = {\n method: input.method,\n headers: input.headers || {}\n };\n if (input.body) opts.body = input.body;\n\n fetch(input.url, opts)\n .then(async res => {\n const text = await res.text();\n const headersObj = {};\n res.headers.forEach((v, k) => { headersObj[k] = v; });\n process.stdout.write(JSON.stringify({\n status_code: res.status,\n response_headers: headersObj,\n response_body: text\n }));\n })\n .catch(err => {\n process.stdout.write(JSON.stringify({\n error: err.message,\n status_code: 0,\n response_headers: {},\n response_body: ''\n }));\n });\n `;const l=JSON.stringify({url:t,method:s,headers:r,body:i});const u=a(process.execPath,["-e",c,l],{encoding:"utf-8",timeout:e.timeout||1e4,stdio:["ignore","pipe","ignore"]});const d=JSON.parse(u.trim());let f=null;if(d.response_body){try{f=JSON.parse(d.response_body)}catch{f=null}}const p={id:t,url:t,method:s,status_code:d.status_code,response_headers:d.response_headers||{},response_body:d.response_body,body:f!==null?f:d.response_body,data:f!==null?f:d.response_body,...typeof f==="object"&&f!==null&&!Array.isArray(f)?f:{}};this.httpCache.set(o,p);return p}catch{return{id:t,url:t,method:s,status_code:0,response_headers:{},response_body:"",body:null}}}resolveAddress(e,t){const n=(0,a.normalizeAddress)(e);const s=n.indexOf(".feature");let o="";let c=n;if(s!==-1){c=n.substring(0,s+8);const e=n.substring(s+8);const t=e.match(/@([a-zA-Z0-9_-]+)/);o=t?`@${t[1]}`:e?`@${e.replace(/^\./,"")}`:""}else{const e=n.match(/@([a-zA-Z0-9_-]+)$/);o=e?`@${e[1]}`:"";c=n.replace(/\.@[a-zA-Z0-9_-]+$/,"")}const l=o?o.replace(/^@/,""):"";if(t){const s=t.getResources();const r=s.filter((t=>{if((0,a.addressesMatch)(t.identity,e)||(0,a.addressesMatch)(`${t.type}.${t.identity}`,e)||(0,a.addressesMatch)(t.identity,e.replace(/^(github_|local_)?(testcase|testrun|testplan)\./,""))){return true}if(l){const e=t.attributes&&t.attributes.labels||[];const s=e.includes(l)||e.includes(`@${l}`);const r=t.identity.endsWith(`.@${l}`)||t.identity.includes(`.@${l}.`)||t.identity.includes(`@${l}`);if(s||r){if(c&&c!==n&&!t.identity.includes(c)){return false}return true}}if(!l&&c&&t.identity.includes(c)){return true}return false}));if(r.length>1){return r.map((e=>this.formatResourceAttrs(e)))}else if(r.length===1){return this.formatResourceAttrs(r[0])}}const u=(0,i.resolve)(this.workDir,c);if((0,r.existsSync)(u)){try{const e=(0,r.readFileSync)(u,"utf-8");const t=this.extractScenariosFromFile(e,c);let n=t;if(l){const s=e.split(/Scenario:|Scenario Outline:/i)[0];const r=s.includes(`@${l}`);if(!r){n=t.filter((e=>e.labels.includes(l)||e.labels.includes(`@${l}`)||e.tag===`@${l}`))}}if(n.length>1){return n}else if(n.length===1){return n[0]}}catch{}}return{id:"",remoteId:"",issueNumber:0,number:0,identity:n,address:n,tag:o,uri:c,title:"",labels:o?[l]:[],status:"",custom_fields:{}}}extractScenariosFromFile(e,t){const n=e.split("\n");const s=[];let r=[];let i=[];let o=true;for(let e=0;e<n.length;e++){const a=n[e].trim();if(!a||a.startsWith("#"))continue;if(a.startsWith("@")){const e=a.split(/\s+/).filter((e=>e.startsWith("@")));if(o){i.push(...e)}else{r.push(...e)}continue}if(a.startsWith("Feature:")){o=false;continue}const c=a.startsWith("Scenario:")||a.startsWith("Scenario Outline:");if(c){const e=a.replace(/^(Scenario:|Scenario Outline:)/i,"").trim();const n=[...new Set([...i,...r])];const o=n.find((e=>e.match(/^@(tc|tr|tp)-/i)))||n[0]||"";const c=n.map((e=>e.replace(/^@/,"")));const l=`${t}.${o||`@scenario-${s.length+1}`}`;s.push({id:"",remoteId:"",issueNumber:0,number:0,identity:l,address:l,tag:o,uri:t,title:e,labels:c,status:"",custom_fields:{}});r=[]}}return s}formatResourceAttrs(e){const t=e.attributes||{};const n=e.identity.indexOf(".feature");let s="";let r=e.identity;if(n!==-1){r=e.identity.substring(0,n+8);const t=e.identity.substring(n+8);const i=t.match(/@([a-zA-Z0-9_-]+)/);s=i?`@${i[1]}`:t?`@${t.replace(/^\./,"")}`:""}else{const t=e.identity.match(/@([a-zA-Z0-9_-]+)$/);s=t?`@${t[1]}`:"";r=e.identity.replace(/\.@[a-zA-Z0-9_-]+$/,"")}return{...t,id:t.remoteId||t.id||"",remoteId:t.remoteId||t.id||"",issueNumber:t.issueNumber!==undefined?t.issueNumber:0,number:t.issueNumber!==undefined?t.issueNumber:0,identity:e.identity,address:e.identity,tag:s,uri:r,title:t.title||"",labels:t.labels||[],status:t.status||"",custom_fields:t.custom_fields||{}}}resolveFilter(e,t){const n=t.getResources();return n.filter((t=>{const n=t.attributes||{};if(e.tags&&Array.isArray(e.tags)){const t=n.labels||[];const s=e.tags.every((e=>{const n=e.startsWith("@")?e.substring(1):e;return t.includes(n)||t.includes(e)}));if(!s)return false}for(const[t,s]of Object.entries(e)){if(t==="tags")continue;if(n[t]!==s&&n.custom_fields?.[t]!==s){return false}}return true}))}resolvePath(e,t){const n=e.replace(/\[\*\]/g,".*").replace(/\[(\d+)\]/g,".$1").replace(/\[['"]([^'"]+)['"]\]/g,".$1");const s=n.split(".");for(let e=s.length;e>=1;e--){const n=s.slice(0,e).join(".");if(this.declaredData[n]){const r=this.resolveSource(n,t);const i=s.slice(e);if(i.length===0){return r}let o=r;for(let e=0;e<i.length;e++){const t=i[e];if(o===undefined||o===null)break;if(t==="*"&&Array.isArray(o)){const t=i.slice(e+1);if(t.length===0){return o}return o.map((e=>{let n=e;for(const e of t){if(n===undefined||n===null)break;n=n[e]}return n}))}o=o[t]}return o}}return undefined}}t.DataResolver=DataResolver},1138:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.DependencyResolver=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=n(2978);const c=n(6028);class DependencyResolver{declaredDependencies=new Map;workDir;constructor(e="."){this.workDir=e;this.loadDeclarations()}loadDeclarations(){const e=c.CONFIG_FILE_NAMES;for(const t of e){const e=(0,i.resolve)(this.workDir,t);if((0,r.existsSync)(e)){try{const t=o.default.parse((0,r.readFileSync)(e,"utf-8"));if(t){this.registerConfigBlock(t)}}catch{}}}const t=(0,a.findDomainConfigFiles)(this.workDir);for(const e of t){try{const t=o.default.parse((0,r.readFileSync)(e,"utf-8"));if(t){this.registerConfigBlock(t)}}catch{}}}registerConfigBlock(e){if(!e||typeof e!=="object")return;const t=e.dependencies||e.depends_on;if(t&&typeof t==="object"){for(const[e,n]of Object.entries(t)){const t=(0,a.normalizeAddress)(e);let s=[];if(Array.isArray(n)){s=n.map((e=>(0,a.normalizeAddress)(String(e))))}else if(n&&typeof n==="object"&&Array.isArray(n.depends_on)){s=n.depends_on.map((e=>(0,a.normalizeAddress)(String(e))))}if(s.length>0){const e=this.declaredDependencies.get(t)||[];this.declaredDependencies.set(t,Array.from(new Set([...e,...s])))}}}if(e.resources&&typeof e.resources==="object"){for(const[t,n]of Object.entries(e.resources)){if(n&&typeof n==="object"&&Array.isArray(n.depends_on)){const e=(0,a.normalizeAddress)(t);const s=n.depends_on.map((e=>(0,a.normalizeAddress)(String(e))));const r=this.declaredDependencies.get(e)||[];this.declaredDependencies.set(e,Array.from(new Set([...r,...s])))}}}}getDependencies(e,t=[]){const n=(0,a.normalizeAddress)(e);const s=[];for(const[e,t]of this.declaredDependencies.entries()){if((0,a.addressesMatch)(n,e)){s.push(...t)}}const r=(0,a.reassembleSplitTags)(t,"@depends_on(");for(const e of r){const t=e.startsWith("@")?e.substring(1):e;const n=t.match(/^depends_on\((.*)\)$/);if(n){let e=n[1].trim();if(e.startsWith("[")&&e.endsWith("]")){e=e.slice(1,-1).trim()}const t=e.split(",").map((e=>(0,a.normalizeAddress)(e.trim().replace(/^['"]|['"]$/g,"")))).filter(Boolean);s.push(...t)}}return Array.from(new Set(s))}sortTopologically(e,t,n){const s=new Map;const r=new Map;const i=new Map;for(const n of e){const e=t(n);const o=(0,a.normalizeAddress)(e);s.set(o,n);r.set(o,[]);i.set(o,0)}for(const o of e){const e=t(o);const c=(0,a.normalizeAddress)(e);const l=n?n(o):[];const u=this.getDependencies(c,l);for(const e of u){let t=null;for(const n of s.keys()){if((0,a.addressesMatch)(n,e)||n.endsWith(`.${e}`)||n.endsWith(`/${e}`)||e.endsWith(`.${n}`)||e.endsWith(`/${n}`)){t=n;break}}if(t){r.get(t).push(c);i.set(c,(i.get(c)||0)+1)}}}for(const n of e){const s=t(n);const o=(0,a.normalizeAddress)(s);const c=o.includes("testrun")||o.includes(".run.");const l=o.includes("testplan")||o.includes(".plan.");if(c){for(const n of e){const e=(0,a.normalizeAddress)(t(n));const s=!e.includes("testrun")&&!e.includes(".run.")&&!e.includes("testplan")&&!e.includes(".plan.");if(s){r.get(e).push(o);i.set(o,(i.get(o)||0)+1)}}}else if(l){for(const n of e){const e=(0,a.normalizeAddress)(t(n));const s=e.includes("testrun")||e.includes(".run.");if(s){r.get(e).push(o);i.set(o,(i.get(o)||0)+1)}}}}const o=[];for(const[e,t]of i.entries()){if(t===0){o.push(e)}}const c=[];while(o.length>0){const e=o.shift();c.push(s.get(e));for(const t of r.get(e)||[]){const e=i.get(t)-1;i.set(t,e);if(e===0){o.push(t)}}}if(c.length<e.length){const e=Array.from(i.entries()).filter((([e,t])=>t>0)).map((([e])=>e));throw new Error(`Cycle: ${e.join(", ")}`)}return c}}t.DependencyResolver=DependencyResolver},2940:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Diag=void 0;const s=n(6028);const r=n(5718);class Diag{static error(e){return new r.Diagnostic({...e,type:"error"})}static warning(e){return new r.Diagnostic({...e,type:"warning"})}static implicitRule(e){return new r.Diagnostic({type:"error",title:"Cannot mark status on implicit rule",location:{file:e.file,line:e.line,scope:`rule "${e.rule}"`,snippet:e.line?`Rule: ${e.rule}`:undefined},detail:[`Scenario "${e.scenario}" belongs to the implicit Rule "${e.rule}".`,`Testform requires explicit Scenario blocks in order to track and record execution outcomes.`],help:[`To expand this rule into explicit scenarios with initial pending status, run:`,` ${s.TITLE_CLI} suite fill -target="${e.target}"`]})}static targetNotFound(e){return new r.Diagnostic({type:"error",title:`No ${e.scopeKey} matched target '${e.target}'.`,detail:[e.suggestion||`Run \`${s.TITLE_CLI} state list\` to list available resources.`]})}static ambiguousTarget(e){const t=Array.from(new Set(e.matches.map((e=>e.startsWith(" -")?e:` - ${e}`))));return new r.Diagnostic({type:"error",title:`Multiple ${e.scopeKey} files matched '${e.target}'. Please specify a full path or identity tag.`,detail:t})}static testcaseNotFound(e){const t=e.available&&e.available.length>0?[`Available testcases in this run (up to 10):`,...e.available.slice(0,10).map((e=>e.startsWith(" -")?e:` - ${e}`)),``]:[];return new r.Diagnostic({type:"error",title:`Testcase '${e.identifier}' not found in testrun '${e.target}'.`,detail:[...t,`Accepted identity strategies:`,` 1. Only tag: "@tc-1=passed"`,` 2. File + tag: "checkout.case.feature.@tc-1=passed"`,` 3. Scenario name: "Pago con tarjeta=passed"`]})}static ambiguousTestcase(e){const t=e.command||"mark";const n=e.status||"passed";const i=e.matches.map((e=>e.startsWith(" -")?e:` - ${e}`));return new r.Diagnostic({type:"error",title:`Multiple testcases matched '${e.identifier}' in testrun '${e.target}'.`,detail:[`Matches:`,...i,``,`Please specify the feature file to disambiguate:`,` e.g. ${s.TITLE_CLI} suite ${t} "<file>.${e.identifier}=${n}" -target="${e.target}"`]})}static usage(e){return new r.Diagnostic({type:"error",title:`Usage: ${e.syntax}`,detail:e.detail,help:e.help})}static unknownSubcommand(e){return new r.Diagnostic({type:"error",title:`Unknown ${e.command} subcommand: '${e.subcommand}'`,detail:e.available.length>0?[`Available subcommands: ${e.available.join(", ")}`]:[]})}static structureError(e){return new r.Diagnostic({type:"error",title:e.message,location:e.location||{file:e.file},detail:e.detail||[]})}}t.Diag=Diag},5718:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Diagnostic=void 0;const s=n(1227);class Diagnostic{type;title;location;detail;help;extra;close;constructor(e){this.type=e.type||"error";this.title=e.title;this.location=e.location;this.close=e.close??false;const t=[];if(e.location){const n=e.location;const s=n.file;const r=n.line!==undefined?` line ${n.line}`:"";const i=n.scope?`, in ${n.scope}`:"";t.push(`on ${s}${r}${i}:`);if(n.snippet!==undefined){const e=n.line!==undefined?String(n.line).padStart(4," "):" ";t.push(`${e}: ${n.snippet}`)}t.push("")}if(e.detail){const n=Array.isArray(e.detail)?e.detail:e.detail.split("\n");t.push(...n)}if(e.help){const n=Array.isArray(e.help)?e.help:e.help.split("\n");if(t.length>0&&t[t.length-1]!==""){t.push("")}t.push(...n)}this.detail=t;this.extra=e.extra}toNotify(){return{type:this.type,title:this.title,detail:this.detail,extra:this.extra,close:this.close}}emit(){s.logger.push(this.toNotify())}abort(){this.emit();process.exit(1)}}t.Diagnostic=Diagnostic},3912:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(2846),t);r(n(5718),t);r(n(2940),t)},2846:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},8081:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ALLOWED_DRIVERS=void 0;t.loadDriver=loadDriver;t.isDriverAvailable=isDriverAvailable;t.clearDriverCache=clearDriverCache;t.ensureDriverInstalled=ensureDriverInstalled;const s=n(5317);const r=n(6928);const i=n(9896);t.ALLOWED_DRIVERS={"@aws-sdk/client-s3":"Amazon S3 / OCI Storage Driver","@aws-sdk/client-dynamodb":"DynamoDB Distributed Lock Driver","@azure/storage-blob":"Azure Blob Storage Driver","@google-cloud/storage":"Google Cloud Storage Driver",docx:"Word Document Report Generator",exceljs:"Excel Spreadsheet Report Generator"};const o=new Map;let a=null;function resolveGlobalNpmRoot(){if(a!==null){return a}try{const e=(0,s.execSync)("npm root -g",{encoding:"utf-8",stdio:["pipe","pipe","ignore"],timeout:2e3}).trim();a=e||null}catch{a=null}return a}function loadDriver(e){if(!t.ALLOWED_DRIVERS[e]){throw new Error(`[Testform Driver Error] "${e}" is not a recognized cloud driver.\n`+`Allowed drivers are: ${Object.keys(t.ALLOWED_DRIVERS).join(", ")}`)}if(o.has(e)){return o.get(e)}try{const t=require(e);o.set(e,t);return t}catch(e){if(e.code!=="MODULE_NOT_FOUND"){throw e}}const n=[];if(process.platform==="win32"){if(process.env.APPDATA){n.push((0,r.join)(process.env.APPDATA,"npm","node_modules"))}if(process.env.LOCALAPPDATA){n.push((0,r.join)(process.env.LOCALAPPDATA,"npm","node_modules"))}}else{n.push("/usr/local/lib/node_modules");n.push("/usr/lib/node_modules")}n.push((0,r.join)(process.execPath,"..","node_modules"));n.push((0,r.join)(process.execPath,"..","..","lib","node_modules"));for(const t of n){const n=(0,r.join)(t,e);if((0,i.existsSync)(n)){try{const t=require(n);o.set(e,t);return t}catch{}}}const s=resolveGlobalNpmRoot();if(s){const t=(0,r.join)(s,e);if((0,i.existsSync)(t)){try{const n=require(t);o.set(e,n);return n}catch{}}}throw new Error(`[Testform Driver Error] The package "${e}" is required for this backend.\n`+`Please install it globally:\n\n`+` npm install -g ${e}\n\n`+`or add it to your local project:\n\n`+` npm install --save-dev ${e}\n`)}function isDriverAvailable(e){try{loadDriver(e);return true}catch{return false}}function clearDriverCache(){o.clear();a=null}function ensureDriverInstalled(e,n){if(isDriverAvailable(e)){return true}if(!t.ALLOWED_DRIVERS[e]){throw new Error(`[Testform Driver Error] "${e}" is not a recognized cloud driver.`)}try{n?.info(`- Installing driver ${e}...`);(0,s.execSync)(`npm install -g ${e}`,{stdio:["pipe","pipe","pipe"],timeout:12e4});clearDriverCache();if(isDriverAvailable(e)){n?.success(`- Installed driver ${e}`);return true}}catch(t){try{(0,s.execSync)(`npm install --save-dev ${e}`,{stdio:["pipe","pipe","pipe"],timeout:12e4});clearDriverCache();if(isDriverAvailable(e)){n?.success(`- Installed driver ${e}`);return true}}catch{}n?.warn(`Could not automatically install ${e}: ${t.message}`)}return false}},9606:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.parseRawDocument=t.updateFeatureScenario=t.formatGherkin=t.findNextIdentity=t.findFeatureFiles=t.GherkinEditor=void 0;const s=n(9896);const r=n(6928);const i=n(119);const o=n(8569);const a=n(4367);const c=n(5829);class GherkinEditor{static findFeatureFiles(e,t=true){try{const n=(0,s.statSync)(e);if(n.isFile()&&e.endsWith(".feature")){return[e]}if(n.isDirectory()){if(e.includes("node_modules")||e.includes(".git"))return[];const n=(0,s.readdirSync)(e,{withFileTypes:true});const i=[];for(const s of n){if(s.name.startsWith(".")||s.name==="node_modules")continue;const n=(0,r.join)(e,s.name);if(s.isDirectory()){if(t){i.push(...this.findFeatureFiles(n,t))}}else if(s.name.endsWith(".feature")){i.push(n)}}return i}return[]}catch(e){return[]}}static findNextIdentity(e,t){if(!t.includes("*"))return null;const n=t.split("*")[0].replace(/^@/,"");const r=t.split("*")[1]||"";const i=new RegExp(`@${n}(\\d+)${r}\\b`,"g");let o=0;const a=this.findFeatureFiles(e,true);for(const e of a){const t=(0,s.readFileSync)(e,"utf-8");let n;while((n=i.exec(t))!==null){const e=parseInt(n[1],10);if(e>o)o=e}}return`@${n}${o+1}${r}`}static formatGherkin(e){const t=e.split("\n");const n=[];let s=0;let r=false;let i=0;for(let e=0;e<t.length;e++){let o=t[e];if(o.trim().startsWith('"""')||o.trim().startsWith("```")){if(!r){r=true;i=6;n.push(" ".repeat(i)+o.trim())}else{r=false;n.push(" ".repeat(i)+o.trim())}continue}if(r){n.push(o);continue}let a=o.trim();if(a===""){if(n.length>0&&n[n.length-1]!==""){n.push("")}continue}if(a.startsWith("Feature:")){s=0}else if(a.startsWith("Rule:")||a.startsWith("Background:")||a.startsWith("Scenario:")||a.startsWith("Scenario Outline:")||a.startsWith("Example:")){s=2;if(n.length>0&&n[n.length-1]!==""&&!n[n.length-1].trim().startsWith("@")){n.push("")}}else if(a.startsWith("Given ")||a.startsWith("When ")||a.startsWith("Then ")||a.startsWith("And ")||a.startsWith("But ")||a.startsWith("* ")){s=4}else if(a.startsWith("Examples:")){s=4;if(n.length>0&&n[n.length-1]!==""){n.push("")}}else if(a.startsWith("|")){s=6}else if(a.startsWith("@")){let r=0;for(let n=e+1;n<t.length;n++){let e=t[n].trim();if(e===""||e.startsWith("@"))continue;if(e.startsWith("Feature:"))r=0;else if(e.startsWith("Rule:")||e.startsWith("Background:")||e.startsWith("Scenario:")||e.startsWith("Scenario Outline:"))r=2;else if(e.startsWith("Examples:"))r=4;break}s=r;if(n.length>0&&n[n.length-1]!==""){n.push("")}}else if(a.startsWith("#")){}else{if(s===0)s=2}n.push(" ".repeat(s)+a)}if(n.length>0&&n[n.length-1]!==""){n.push("")}return n.join("\n")}static updateScenarioTitleAndTags(e,t,n,r){if(!(0,s.existsSync)(e))return false;let i=(0,s.readFileSync)(e,"utf8");if(t&&n&&t!==n){const e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const s=new RegExp(`(Scenario(?: Outline)?:\\s*)${e}`,"g");if(s.test(i)){i=i.replace(s,`$1${n}`)}}if(r&&r.length>0){const e=n||t;const s=i.indexOf(`Scenario: ${e}`);if(s!==-1){const e=i.slice(0,s);const t=e.split("\n");const n=t[t.length-2]?.trim();const o=r.map((e=>e.startsWith("@")?e:`@${e}`)).join(" ");if(n&&n.startsWith("@")){t[t.length-2]=` ${o}`;i=t.join("\n")+i.slice(s)}else{i=i.slice(0,s)+` ${o}\n`+i.slice(s)}}}(0,s.writeFileSync)(e,i,"utf8");return true}static parseRawDocument(e){const t=(0,s.existsSync)(e)?(0,s.readFileSync)(e,"utf-8"):e;const n=new i.AstBuilder(o.IdGenerator.uuid());const r=new i.Parser(n,new i.GherkinClassicTokenMatcher);const a=r.parse(t);if((0,s.existsSync)(e)){a.uri=e}return a}static parseDocument(e){const t=(0,s.readFileSync)(e,"utf-8");const n=new i.AstBuilder(o.IdGenerator.uuid());const r=new i.Parser(n,new i.GherkinClassicTokenMatcher);const c=r.parse(t);c.uri=e;return a.Document.parse({gherkinDocument:c})}static saveDocument(e,t){const n=(0,c.format)(t);(0,s.writeFileSync)(e,n,"utf-8")}static findRule(e,t){const n=t.replace(/\.feature$/i,"").replace(/\\/g,"/");return e.elements.find((e=>{if(e instanceof a.Rule){const t=e.name.replace(/\.feature$/i,"").replace(/\\/g,"/");return n.endsWith(t)||n.includes(t)||t.endsWith(n)||t.includes(n)}return false}))}static updateScenarioStatus(e,t,n,s){const r=this.parseDocument(e);if(!r.feature){throw new Error(`File ${e} has no feature definition.`)}const i=this.findRule(r.feature,t);if(!i){throw new Error(`Could not find Rule '${t}' in ${e}`)}let o;for(const e of i.elements){if(e instanceof a.Scenario){if(e.name===n||e.name.replace(/^@/,"")===n.replace(/^@/,"")||e.name.endsWith(`.${n}`)||e.name.endsWith(`.${n.replace(/^@/,"")}`)){o=e;break}}}if(!o){throw new Error(`Scenario '${n}' is not expanded in Rule '${t}'. Run 'testform suite fill' first to expand the rule's scenarios before marking status.`)}let c=o.steps.find((e=>e.keyword.trim()==="*"&&e.text.startsWith("mark status =")));if(c){c.text=`mark status = ${s}`}else{const e=new a.Step("*",`mark status = ${s}`);o.steps.unshift(e)}this.saveDocument(e,r)}static linkRuleOrScenario(e,t,n,s="pending"){const r=this.parseDocument(e);if(!r.feature){throw new Error(`File ${e} has no feature definition.`)}let i=this.findRule(r.feature,t);let o=false;let c=false;let l=false;if(!i){i=new a.Rule("Rule",t,"");r.feature.elements.push(i);o=true}if(n){let e;for(const t of i.elements){if(t instanceof a.Scenario){if(t.name===n||t.name.replace(/^@/,"")===n.replace(/^@/,"")){e=t;break}}}if(e){let t=e.steps.find((e=>e.keyword.trim()==="*"&&e.text.startsWith("mark status =")));if(t){t.text=`mark status = ${s}`}else{e.steps.unshift(new a.Step("*",`mark status = ${s}`))}l=true}else{const e=new a.Scenario("Scenario",n,"");e.steps.push(new a.Step("*",`mark status = ${s}`));i.elements.push(e);c=true}}this.saveDocument(e,r);return{addedRule:o,addedScenario:c,updatedScenario:l}}static expandScenarios(e,t,n="pending"){const s=this.parseDocument(e);if(!s.feature)return;let r=false;for(const e of t){const t=e.split(".");if(t.length>=2&&t[t.length-1]!=="*"){r=true;break}}if(r){this.removeWildcardScenario(s)}for(const e of t){const t=e.split(".");if(t.length<2)continue;const i=t.pop();const o=t.join(".");if(r&&i==="*")continue;const c=this.findRule(s.feature,o);if(c){let e=c.elements.some((e=>e instanceof a.Scenario&&e.name===i));if(!e){const e=new a.Scenario("Scenario",i,"");e.steps.push(new a.Step("*",`mark status = ${n}`));c.elements.push(e)}}}this.saveDocument(e,s)}static removeWildcardScenario(e){if(!e.feature)return;for(const t of e.feature.elements){if(t instanceof a.Rule){t.elements=t.elements.filter((e=>{if(e instanceof a.Scenario&&e.name.trim()==="*"){return false}return true}))}}}}t.GherkinEditor=GherkinEditor;t.findFeatureFiles=GherkinEditor.findFeatureFiles.bind(GherkinEditor);t.findNextIdentity=GherkinEditor.findNextIdentity.bind(GherkinEditor);t.formatGherkin=GherkinEditor.formatGherkin.bind(GherkinEditor);t.updateFeatureScenario=GherkinEditor.updateScenarioTitleAndTags.bind(GherkinEditor);t.parseRawDocument=GherkinEditor.parseRawDocument.bind(GherkinEditor)},4296:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.StateLockError=t.ConfigurationError=t.TestformError=void 0;class TestformError extends Error{exitCode;constructor(e,t=1){super(e);this.name="TestformError";this.exitCode=t;Object.setPrototypeOf(this,new.target.prototype)}}t.TestformError=TestformError;class ConfigurationError extends TestformError{constructor(e){super(e,1);this.name="ConfigurationError"}}t.ConfigurationError=ConfigurationError;class StateLockError extends TestformError{constructor(e){super(e,1);this.name="StateLockError"}}t.StateLockError=StateLockError},2825:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.evaluator=t.Evaluator=void 0;t.evaluateExpression=evaluateExpression;t.interpolateExpressions=interpolateExpressions;const s=n(6066);const r=n(1577);const i=n(5864);class Evaluator{evaluate(e,t={}){switch(e.type){case"Literal":return e.value;case"Array":return e.elements.map((e=>this.evaluate(e,t)));case"Identifier":return this.resolveIdentifier(e.name,t);case"Unary":{const n=this.evaluate(e.argument,t);if(e.operator==="!"){return!this.isTruthy(n)}if(e.operator==="-"){return-Number(n)}throw new Error(`Unsupported unary operator: '${e.operator}'`)}case"Binary":{const n=this.evaluate(e.left,t);if(e.operator==="&&"){if(!this.isTruthy(n))return false;const s=this.evaluate(e.right,t);return this.isTruthy(s)}if(e.operator==="||"){if(this.isTruthy(n))return true;const s=this.evaluate(e.right,t);return this.isTruthy(s)}const s=this.evaluate(e.right,t);switch(e.operator){case"==":if(n===s)return true;if(typeof n==="number"||typeof s==="number"){return Number(n)===Number(s)}return String(n??"")===String(s??"");case"!=":if(n===s)return false;if(typeof n==="number"||typeof s==="number"){return Number(n)!==Number(s)}return String(n??"")!==String(s??"");case"<":return Number(n)<Number(s);case"<=":return Number(n)<=Number(s);case">":return Number(n)>Number(s);case">=":return Number(n)>=Number(s);case"+":if(typeof n==="string"||typeof s==="string"){return String(n??"")+String(s??"")}return Number(n)+Number(s);case"-":return Number(n)-Number(s);case"*":return Number(n)*Number(s);case"/":return Number(n)/Number(s);default:throw new Error(`Unsupported binary operator: '${e.operator}'`)}}case"Call":{const n=e.callee.toLowerCase();const r=t.extraFunctions?.[n]||s.standardFunctions[n];if(!r){throw new Error(`Unknown function: '${e.callee}()'`)}const i=e.args.map((e=>this.evaluate(e,t)));if(n==="file"&&i.length===1&&t.workDir){i.push(t.workDir)}return r(...i)}default:throw new Error(`Unknown AST node type: ${e.type}`)}}resolveIdentifier(e,t){if(e.startsWith("var.")){const n=e.slice(4);return(t.vars||t.variables)?.[n]}if(e.startsWith("local.")){const n=e.slice(6);return t.locals?.[n]}if(e.startsWith("env.")){const t=e.slice(4);return process.env[t]??""}if(e.startsWith("data.")){const n=e.slice(5);if(t.data&&typeof t.data.resolvePath==="function"){return t.data.resolvePath(n)}return t.data?.[n]}if(e.startsWith("report.")){const n=e.slice(7);const s=t.data?.report||t.data;if(s){const e=n.split(".");let t=s;for(const n of e){if(t===undefined||t===null)return undefined;t=t[n]}return t}}if(t.vars&&e in t.vars){return t.vars[e]}if(t.locals&&e in t.locals){return t.locals[e]}return undefined}isTruthy(e){if(e===false||e===null||e===undefined||e===0||e===""){return false}return true}}t.Evaluator=Evaluator;t.evaluator=new Evaluator;function evaluateExpression(e,n={}){const s=new r.Lexer(e);const o=s.tokenize();const a=new i.Parser(o);const c=a.parse();return t.evaluator.evaluate(c,n)}function interpolateExpressions(e,t={}){if(typeof e!=="string"||!e.includes("${")){return e}return e.replace(/\$\{([^}]+)\}/g,((e,n)=>{try{const e=evaluateExpression(n,t);if(e===null||e===undefined)return"";if(typeof e==="object")return JSON.stringify(e);return String(e)}catch{return e}}))}},6066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.standardFunctions=void 0;const s=n(9896);const r=n(6928);const i=n(6982);t.standardFunctions={lower:e=>String(e??"").toLowerCase(),upper:e=>String(e??"").toUpperCase(),trim:(e,t)=>{const n=String(e??"");if(!t)return n.trim();const s=t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const r=new RegExp(`^[${s}]+|[${s}]+$`,"g");return n.replace(r,"")},trimprefix:(e,t)=>{const n=String(e??"");const s=String(t??"");return n.startsWith(s)?n.slice(s.length):n},trimsuffix:(e,t)=>{const n=String(e??"");const s=String(t??"");return n.endsWith(s)?n.slice(0,n.length-s.length):n},startswith:(e,t)=>String(e??"").startsWith(String(t??"")),endswith:(e,t)=>String(e??"").endsWith(String(t??"")),replace:(e,t,n)=>{const s=String(e??"");const r=String(t??"");const i=String(n??"");return s.split(r).join(i)},split:(e,t)=>{const n=String(t??"");const s=String(e??"");return n.split(s)},join:(e,t)=>{const n=String(e??"");if(!Array.isArray(t))return String(t??"");return t.join(n)},format:(e,...t)=>{let n=String(e??"");let s=0;return n.replace(/%[sdj%]/g,(e=>{if(e==="%%")return"%";if(s>=t.length)return e;const n=t[s++];if(e==="%d")return String(Number(n));if(e==="%j")return JSON.stringify(n);return String(n)}))},substr:(e,t,n)=>{const s=String(e??"");const r=Number(t);const i=Number(n);if(isNaN(r))return s;if(isNaN(i))return s.substring(r);return s.substring(r,r+i)},coalesce:(...e)=>{for(const t of e){if(t!==null&&t!==undefined&&t!==""){return t}}return""},lookup:(e,t,n)=>{if(e&&typeof e==="object"&&t in e){return e[t]}return n!==undefined?n:null},contains:(e,t)=>{if(Array.isArray(e)){return e.some((e=>e===t||String(e)===String(t)))}if(typeof e==="string"){return e.includes(String(t))}return false},length:e=>{if(Array.isArray(e)||typeof e==="string"){return e.length}if(e&&typeof e==="object"){return Object.keys(e).length}return 0},element:(e,t)=>{if(!Array.isArray(e))return null;const n=Number(t);return e[n%e.length]},slice:(e,t,n)=>{if(!Array.isArray(e))return[];return e.slice(Number(t),n!==undefined?Number(n):undefined)},merge:(...e)=>{const t={};for(const n of e){if(n&&typeof n==="object"&&!Array.isArray(n)){Object.assign(t,n)}}return t},env:e=>{const t=String(e??"");return process.env[t]??""},uuid:()=>(0,i.randomUUID)(),timestamp:()=>(new Date).toISOString(),jsonencode:e=>JSON.stringify(e),jsondecode:e=>{try{return JSON.parse(String(e??""))}catch{return null}},file:(e,t=".")=>{try{const n=(0,r.resolve)(t,String(e));if((0,s.existsSync)(n)){return(0,s.readFileSync)(n,"utf-8")}}catch{}return""}}},1577:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Lexer=void 0;class Lexer{pos=0;input="";constructor(e){this.input=e.trim();if(this.input.startsWith("${")&&this.input.endsWith("}")){this.input=this.input.substring(2,this.input.length-1).trim()}}tokenize(){const e=[];while(this.pos<this.input.length){this.skipWhitespace();if(this.pos>=this.input.length)break;const t=this.input[this.pos];const n=this.pos;if(t==="("){e.push({type:"LPAREN",value:"(",raw:"(",pos:n});this.pos++}else if(t===")"){e.push({type:"RPAREN",value:")",raw:")",pos:n});this.pos++}else if(t==="["){e.push({type:"LBRACKET",value:"[",raw:"[",pos:n});this.pos++}else if(t==="]"){e.push({type:"RBRACKET",value:"]",raw:"]",pos:n});this.pos++}else if(t===","){e.push({type:"COMMA",value:",",raw:",",pos:n});this.pos++}else if(t==="?"){e.push({type:"QUESTION",value:"?",raw:"?",pos:n});this.pos++}else if(t===":"){e.push({type:"COLON",value:":",raw:":",pos:n});this.pos++}else if(this.matchAhead("&&")||this.matchAhead("||")||this.matchAhead("==")||this.matchAhead("!=")){const t=this.input.substring(this.pos,this.pos+2);e.push({type:"OPERATOR",value:t,raw:t,pos:n});this.pos+=2}else if(this.matchAhead("<=")||this.matchAhead(">=")){const t=this.input.substring(this.pos,this.pos+2);e.push({type:"OPERATOR",value:t,raw:t,pos:n});this.pos+=2}else if(t==="<"||t===">"||t==="!"||t==="+"||t==="-"||t==="*"||t==="/"){e.push({type:"OPERATOR",value:t,raw:t,pos:n});this.pos++}else if(t==='"'||t==="'"){e.push(this.readString(t,n))}else if(this.isDigit(t)){e.push(this.readNumber(n))}else if(this.isIdentifierStart(t)){e.push(this.readIdentifier(n))}else{throw new Error(`Unexpected character '${t}' at position ${this.pos} in expression: "${this.input}"`)}}e.push({type:"EOF",value:null,raw:"",pos:this.pos});return e}skipWhitespace(){while(this.pos<this.input.length&&/\s/.test(this.input[this.pos])){this.pos++}}matchAhead(e){return this.input.startsWith(e,this.pos)}isDigit(e){return e>="0"&&e<="9"}isIdentifierStart(e){return/[a-zA-Z_]/.test(e)}isIdentifierChar(e){return/[a-zA-Z0-9_\.\-]/.test(e)}readString(e,t){this.pos++;let n="";while(this.pos<this.input.length){const s=this.input[this.pos];if(s==="\\"){this.pos++;if(this.pos<this.input.length){n+=this.input[this.pos];this.pos++}}else if(s===e){this.pos++;return{type:"STRING",value:n,raw:this.input.substring(t,this.pos),pos:t}}else{n+=s;this.pos++}}throw new Error(`Unterminated string starting at position ${t} in expression: "${this.input}"`)}readNumber(e){let t=false;while(this.pos<this.input.length){const e=this.input[this.pos];if(this.isDigit(e)){this.pos++}else if(e==="."&&!t&&this.pos+1<this.input.length&&this.isDigit(this.input[this.pos+1])){t=true;this.pos++}else{break}}const n=this.input.substring(e,this.pos);const s=t?parseFloat(n):parseInt(n,10);return{type:"NUMBER",value:s,raw:n,pos:e}}readIdentifier(e){while(this.pos<this.input.length&&this.isIdentifierChar(this.input[this.pos])){this.pos++}const t=this.input.substring(e,this.pos);if(t==="true"){return{type:"BOOLEAN",value:true,raw:t,pos:e}}if(t==="false"){return{type:"BOOLEAN",value:false,raw:t,pos:e}}if(t==="null"){return{type:"NULL",value:null,raw:t,pos:e}}return{type:"IDENTIFIER",value:t,raw:t,pos:e}}}t.Lexer=Lexer},5864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Parser=void 0;class Parser{pos=0;tokens=[];constructor(e){this.tokens=e}parse(){const e=this.parseExpression();if(this.peek().type!=="EOF"){throw new Error(`Unexpected token '${this.peek().raw}' after expression at pos ${this.peek().pos}`)}return e}parseExpression(){return this.parseLogicalOr()}parseLogicalOr(){let e=this.parseLogicalAnd();while(this.matchOperator("||")){const t=this.previous().value;const n=this.parseLogicalAnd();e={type:"Binary",operator:t,left:e,right:n}}return e}parseLogicalAnd(){let e=this.parseEquality();while(this.matchOperator("&&")){const t=this.previous().value;const n=this.parseEquality();e={type:"Binary",operator:t,left:e,right:n}}return e}parseEquality(){let e=this.parseComparison();while(this.matchOperator("==")||this.matchOperator("!=")){const t=this.previous().value;const n=this.parseComparison();e={type:"Binary",operator:t,left:e,right:n}}return e}parseComparison(){let e=this.parseAdditive();while(this.matchOperator("<")||this.matchOperator(">")||this.matchOperator("<=")||this.matchOperator(">=")){const t=this.previous().value;const n=this.parseAdditive();e={type:"Binary",operator:t,left:e,right:n}}return e}parseAdditive(){let e=this.parseMultiplicative();while(this.matchOperator("+")||this.matchOperator("-")){const t=this.previous().value;const n=this.parseMultiplicative();e={type:"Binary",operator:t,left:e,right:n}}return e}parseMultiplicative(){let e=this.parseUnary();while(this.matchOperator("*")||this.matchOperator("/")){const t=this.previous().value;const n=this.parseUnary();e={type:"Binary",operator:t,left:e,right:n}}return e}parseUnary(){if(this.matchOperator("!")||this.matchOperator("-")){const e=this.previous().value;const t=this.parseUnary();return{type:"Unary",operator:e,argument:t}}return this.parsePrimary()}parsePrimary(){const e=this.peek();if(e.type==="STRING"||e.type==="NUMBER"||e.type==="BOOLEAN"||e.type==="NULL"){this.advance();return{type:"Literal",value:e.value}}if(e.type==="LBRACKET"){this.advance();const e=[];if(!this.check("RBRACKET")){do{e.push(this.parseExpression())}while(this.match("COMMA"))}this.consume("RBRACKET","Expected ']' after array elements");return{type:"Array",elements:e}}if(e.type==="LPAREN"){this.advance();const e=this.parseExpression();this.consume("RPAREN","Expected ')' after expression");return e}if(e.type==="IDENTIFIER"){this.advance();const t=e.value;if(this.match("LPAREN")){const e=[];if(!this.check("RPAREN")){do{e.push(this.parseExpression())}while(this.match("COMMA"))}this.consume("RPAREN",`Expected ')' after arguments in call to '${t}'`);return{type:"Call",callee:t,args:e}}return{type:"Identifier",name:t}}throw new Error(`Unexpected token '${e.raw}' of type ${e.type} at position ${e.pos}`)}match(e){if(this.check(e)){this.advance();return true}return false}matchOperator(e){if(this.check("OPERATOR")&&this.peek().value===e){this.advance();return true}return false}check(e){if(this.isAtEnd())return false;return this.peek().type===e}advance(){if(!this.isAtEnd())this.pos++;return this.previous()}isAtEnd(){return this.peek().type==="EOF"}peek(){return this.tokens[this.pos]}previous(){return this.tokens[this.pos-1]}consume(e,t){if(this.check(e))return this.advance();throw new Error(`${t}. Got '${this.peek().raw}' instead at position ${this.peek().pos}`)}}t.Parser=Parser},8184:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.HELP_POLICY=t.HELP_OUTPUT=t.HELP_SUITE_MARK=t.HELP_SUITE_LINK=t.HELP_SUITE_FILL=t.HELP_SUITE_INIT=t.HELP_FUNCTIONS=t.HELP_SUITE=t.HELP_PRINT=t.HELP_TEST_STATE=t.HELP_TEST_AUTOCOMPLETE=t.HELP_TEST_FEATURE=t.HELP_TEST=t.HELP_REPORT=t.HELP_QUERY=t.HELP_PROVIDERS_SCHEMA=t.HELP_PROVIDERS_MIRROR=t.HELP_PROVIDERS_LOCK=t.HELP_PROVIDERS=t.HELP_MODULES=t.HELP_EPHEMERAL=t.HELP_DIFF=t.HELP_WORKSPACE=t.HELP_VERSION=t.HELP_UNTAINT=t.HELP_TAINT=t.HELP_STATE_SHOW=t.HELP_STATE_RM=t.HELP_STATE_PUSH=t.HELP_STATE_PULL=t.HELP_STATE_MV=t.HELP_STATE_LIST=t.HELP_STATE_IDENTITIES=t.HELP_STATE_CLEAN=t.HELP_STATE_REPLACE_PROVIDER=t.HELP_STATE=t.HELP_LOGOUT=t.HELP_LOGIN=t.HELP_GRAPH=t.HELP_FORCE_UNLOCK=t.HELP_FMT=t.HELP_SHOW=t.HELP_REFRESH=t.HELP_IMPORT=t.HELP_DESTROY=t.HELP_APPLY=t.HELP_VALIDATE=t.HELP_PLAN=t.HELP_INIT=t.HELP_GLOBAL=void 0;t.getCommandHelp=getCommandHelp;const s=n(6028);const r=n(465);t.HELP_GLOBAL=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] [subcommand] [args]\n\nThe available commands for execution are listed below.\nThe primary workflow commands are given first, followed by\nless common or more advanced commands.\n\n${(0,r.bold)(`Main commands:`)}\n init Prepare working directory for other commands\n validate Check whether the configuration is valid\n plan Show changes required by current configuration\n apply Create or update resources \n destroy Destroy previously-created resources \n\n${(0,r.bold)(`All other commands:`)}\n diff Show drift between local configuration and state\n ephemeral Manage temporary CI/CD QA sandboxes (up, down, list, show)\n fmt Reformat your configuration in the standard style\n force-unlock Release a stuck lock on the current workspace\n functions Inspect and evaluate built-in expression functions\n graph Generate a Graphviz graph of the steps in an operation\n import Associate existing infrastructure with a ${s.TITLE_APP} resource\n login Obtain and save credentials for a remote host\n logout Remove locally-stored credentials for a remote host\n modules Show all declared modules in a working directory\n output Show output values from your root module or state\n policy Inspect, enable, or disable validation policies\n print Parse a feature file and print the JSON AST\n providers Show the providers required for this configuration\n query Query and filter managed test resources in state\n refresh Update the state to match remote systems\n report Generate multi-dimensional test execution reports\n show Show the current state or a saved plan\n state Advanced state management\n suite Manage test suites and execution files (init, -fill, -link, -mark, -tags)\n taint Mark a resource instance as not fully functional\n untaint Remove the 'tainted' state from a resource instance\n version Show the current ${s.TITLE_APP} version\n workspace Workspace management\n\n${(0,r.bold)(`Global options (use these before the subcommand, if any):`)}\n -chdir=DIR Switch to a different working directory before executing the given subcommand.\n -help Show this help output, or the help for a specified subcommand.\n -version An alias for the "version" subcommand.\n`;t.HELP_INIT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] init [options]\n\n Initialize a new or existing ${s.TITLE_APP} working directory by creating\n initial files and loading any remote state.\n\n This is the first command that should be run for any new or existing\n ${s.TITLE_APP} configuration per machine. This sets up all the local data\n necessary to run ${s.TITLE_APP}.\n\n This command is always safe to run multiple times.\n\n${(0,r.bold)(`Options:`)}\n\n -provider=<type> Provider type to scaffold when creating a new\n configuration (local | github | gitlab | custom).\n (default: github)\n\n -backend-type=<type> Backend type to scaffold when creating a new\n configuration (local | github | s3 | azurerm | gcs | oci).\n (default: local)\n\n -backend=false Disable backend initialization for this configuration\n and use what was previously initialized instead.\n\n -backend-config=path Configuration to be merged with what is in the\n configuration file's 'backend' block. This can be\n a 'key=value' format, and can be specified multiple\n times.\n\n -lock=false Don't hold a state lock during backend migration.\n This is dangerous if others might concurrently run\n commands against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -no-color If specified, output won't contain any color.\n\n -json If specified, machine readable output will be\n printed in JSON format.\n\n -reconfigure Reconfigure a backend, ignoring any saved\n configuration.\n\n -migrate-state Reconfigure a backend, and attempt to migrate any\n existing state.\n`.trim();t.HELP_PLAN=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] plan [options]\n\n Generates a speculative execution plan, showing what actions ${s.TITLE_APP}\n would take to apply the current configuration. This command will not\n actually perform the planned actions.\n\n You can optionally save the plan to a file, which you can then pass to\n the "apply" command to perform exactly the actions described in the plan.\n\n${(0,r.bold)(`Plan Customization Options:`)}\n\n The following options customize how ${s.TITLE_APP} will produce its plan. You\n can also use these options when you run "${s.TITLE_CLI} apply" without passing\n it a saved plan, in order to plan and apply in a single command.\n\n -destroy Select the "destroy" planning mode, which creates a plan\n to destroy all objects currently managed by this\n ${s.TITLE_APP} configuration instead of the usual behavior.\n\n -refresh-only Select the "refresh only" planning mode, which checks\n whether remote objects still match the outcome of the\n most recent ${s.TITLE_APP} apply but does not propose any\n actions to undo any changes made outside of ${s.TITLE_APP}.\n\n -refresh=false Skip checking for external changes to remote objects\n while creating the plan. This can potentially make\n planning faster, but at the expense of possibly planning\n against a stale record of the remote system state.\n\n -replace=resource Force replacement of a particular resource instance using\n its resource address. If the plan would've normally\n produced an update or no-op action for this instance,\n ${s.TITLE_APP} will plan to replace it instead. You can use\n this option multiple times to replace more than one object.\n\n -target=resource Limit the planning operation to only the given module,\n resource, or resource instance and all of its\n dependencies. You can use this option multiple times to\n include more than one object. This is for exceptional\n use only.\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file (.json or key=value format).\n Use this option more than once to include more than one\n variables file.\n\n${(0,r.bold)(`Other Options:`)}\n\n -compact-warnings If ${s.TITLE_APP} produces any warnings that are not\n accompanied by errors, shows them in a more compact\n form that includes only the summary messages.\n\n -detailed-exitcode Return detailed exit codes when the command exits.\n This will change the meaning of exit codes to:\n 0 - Succeeded, diff is empty (no changes)\n 1 - Errored\n 2 - Succeeded, there is a diff\n\n -input=true Ask for input for variables if not directly set.\n\n -lock=false Don't hold a state lock during the operation. This\n is dangerous if others might concurrently run\n commands against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -no-color If specified, output won't contain any color.\n\n -out=path Write a plan file to the given path. This can be\n used as input to the "apply" command.\n\n -parallelism=n Limit the number of concurrent operations. Defaults\n to 3.\n\n -state=statefile A legacy option used for the local backend only.\n See the local backend's documentation for more\n information.\n \n -backup=path Path to backup the existing state file before\n modifying. Defaults to the "-state" path with\n ".backup" extension.\n\n -test-directory=path Set the ${s.TITLE_APP} test directory. If omitted,\n defaults to the chdir directory.\n`.trim();t.HELP_VALIDATE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] validate [options]\n\n Validate the configuration files in a directory, referring only to the\n configuration and not accessing any remote services such as remote state,\n provider APIs, etc.\n\n Validate runs checks that verify whether a configuration is syntactically\n valid and internally consistent, regardless of any provided variables or\n existing state. It is thus primarily useful for general verification of\n reusable modules, including correctness of attribute names and value types.\n\n It is safe to run this command automatically, for example as a post-save\n check in a text editor or as a test step for a re-usable module in a CI\n system.\n\n Validation requires an initialized working directory with any referenced\n plugins and modules installed. To initialize a working directory for\n validation without accessing any configured remote backend, use:\n ${s.TITLE_CLI} init -backend=false\n\n To verify configuration in the context of a particular run (a particular\n target workspace, input variable values, etc), use the '${s.TITLE_CLI} plan'\n command instead, which includes an implied validation check.\n\n${(0,r.bold)(`Options:`)}\n\n -json Produce output in a machine-readable JSON format,\n suitable for use in text editor integrations and other\n automated systems. Always disables color.\n\n -no-color If specified, output won't contain any color.\n\n -no-tests If specified, ${s.TITLE_APP} will not validate test files.\n\n -target=resource Target a specific resource or feature file for validation\n (e.g. -target=testcase, -target=tests/smoke.run.feature).\n\n -test-directory=path Set the ${s.TITLE_APP} test directory, defaults to "tests".\n\n -query If specified, the command will also filter and validate\n specific test scenarios across the configuration.\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files ${s.TITLE_CLI}.tfvars and *.auto.tfvars.\n Use this option more than once to include more than one\n variables file.\n`.trim();t.HELP_APPLY=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] apply [options] [PLAN]\n\n Creates or updates infrastructure according to ${s.TITLE_APP} configuration\n files in the current directory.\n\n By default, ${s.TITLE_APP} will generate a new plan and present it for your\n approval before taking any action. You can optionally provide a plan\n file created by a previous call to "${s.TITLE_CLI} plan", in which case\n ${s.TITLE_APP} will take the actions described in that plan without any\n confirmation prompt.\n\n${(0,r.bold)(`Options:`)}\n\n -auto-approve Skip interactive approval of plan before applying.\n\n -backup=path Path to backup the existing state file before\n modifying. Defaults to the "-state" path with\n ".backup" extension. Set to "-" to disable backup.\n\n -compact-warnings If ${s.TITLE_APP} produces any warnings that are not\n accompanied by errors, show them in a more compact\n form that includes only the summary messages.\n\n -destroy Destroy ${s.TITLE_APP}-managed infrastructure.\n The command "${s.TITLE_CLI} destroy" is a convenience alias\n for this option.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -input=true Ask for input for variables if not directly set.\n\n -no-color If specified, output won't contain any color.\n\n -parallelism=n Limit the number of parallel resource operations.\n Defaults to 3.\n\n -replace=resource ${s.TITLE_APP} will plan to replace this resource instance\n instead of doing an update or no-op action. \n\n -state=path Path to read and save state. Defaults to "testform.tfstate".\n Legacy option for the local backend only. See the local\n backend's documentation for more information.\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file (.json or key=value format).\n Use this option more than once to include more than one\n variables file.\n\n -test-directory=path Set the ${s.TITLE_APP} test directory. If omitted,\n defaults to the chdir directory.\n\n If you don't provide a saved plan file then this command will also accept\n all of the plan-customization options accepted by the ${s.TITLE_CLI} plan command.\n For more information on those options, run:\n ${s.TITLE_CLI} plan -help\n`.trim();t.HELP_DESTROY=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] destroy [options]\n\n Destroy ${s.TITLE_APP}-managed infrastructure.\n\n This command is a convenience alias for:\n ${s.TITLE_CLI} apply -destroy\n\n This command also accepts many of the plan-customization options accepted by\n the ${s.TITLE_CLI} plan command. For more information on those options, run:\n ${s.TITLE_CLI} plan -help\n`.trim();t.HELP_IMPORT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] import [options] ADDR ISSUE_NUMBER\n\n Import an existing GitHub Issue into your ${s.TITLE_APP} state.\n\n This command connects to GitHub, fetches the specified ISSUE_NUMBER, and\n imports it into your local ${s.TITLE_APP} state under the given ADDR (Identity).\n This allows existing GitHub Issues to come under ${s.TITLE_APP} management\n without having to be initially created via a 'testform apply'.\n\n ADDR: The identity of the scenario (e.g., 'test1').\n ISSUE_NUMBER: The numeric ID of the GitHub Issue to import (e.g., '123').\n\n This command will make network requests to GitHub but will not modify\n the remote issue.\n\n${(0,r.bold)(`Options:`)}\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -no-color If specified, output won't contain any color.\n\n -state, and -backup Custom paths for the state and backup files.\n`.trim();t.HELP_REFRESH=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] refresh [options]\n\n Update the state to match remote systems.\n\n This command will not modify your remote test entities directly,\n but it will update your state file to reflect any changes made on the remote platform.\n\n${(0,r.bold)(`Options:`)}\n\n -compact-warnings If ${s.TITLE_APP} produces any warnings that are not\n accompanied by errors, show them in a more compact form\n that includes only the summary messages.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -no-color If specified, output won't contain any color.\n\n -parallelism=n Limit the number of concurrent operations. Defaults to 3.\n\n -target=resource Resource to target. Operation will be limited to this\n resource and its dependencies. This flag can be used\n multiple times.\n\n -var 'foo=bar' Set a variable in the ${s.TITLE_APP} configuration. This\n flag can be set multiple times.\n\n -var-file=foo Set variables in the ${s.TITLE_APP} configuration from\n a file. If "testform.vars.yml" or any "*.auto.vars.yml"\n files are present, they will be automatically loaded.\n\n -state, state-out, and -backup are legacy options supported for the local\n backend only. For more information, see the local backend's documentation.\n`.trim();t.HELP_SHOW=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] show [options] [path]\n\n Reads and outputs a ${s.TITLE_APP} state or plan file in a human-readable\n form. If no path is specified, the current state will be shown.\n\n${(0,r.bold)(`Options:`)}\n\n -no-color If specified, output won't contain any color.\n -json If specified, output the ${s.TITLE_APP} plan or state in\n a machine-readable form.\n`.trim();t.HELP_FMT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] fmt [options] [target...]\n\n Rewrites all ${s.TITLE_APP} scenario files to a canonical format. All\n testing files (.feature) are updated using standard Gherkin syntax\n indentation.\n\n By default, fmt scans the current directory for .feature files. If you\n provide a directory for the target argument, then fmt will scan that\n directory instead.\n\n The content must be in the Gherkin language native syntax.\n\n${(0,r.bold)(`Options:`)}\n\n -list=false Don't list files whose formatting differs\n\n -write=false Don't write to source files (implied by -check or -diff)\n\n -diff Display diffs of formatting changes\n\n -check Check if the input is formatted. Exit status will be 3 if\n any input is not properly formatted and zero otherwise.\n\n -no-color If specified, output won't contain any color.\n\n -recursive Also process files in subdirectories. By default, only the\n given directory (or current directory) is processed.\n`.trim();t.HELP_FORCE_UNLOCK=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] force-unlock LOCK_ID\n\n Manually unlock the state for the defined configuration.\n\n This will not modify your infrastructure. This command removes the lock on the\n state for the current workspace. The behavior of this lock is dependent\n on the backend being used. Local state files cannot be unlocked by another\n process.\n\n${(0,r.bold)(`Options:`)}\n\n -force Don't ask for input for unlock confirmation.\n`.trim();t.HELP_GRAPH=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] graph [options]\n\n Produces a representation of the dependency graph between different\n objects in the current configuration and state.\n\n By default the graph shows a summary only of the relationships between\n resources in the configuration, since those are the main objects that\n have side-effects whose ordering is significant. You can generate more\n detailed graphs reflecting ${s.TITLE_APP}'s actual evaluation strategy\n by specifying the -type=TYPE option to select an operation type.\n\n The graph is presented in the DOT language by default. The typical program that can\n read this format is GraphViz, but many web services are also available\n to read this format.\n\n${(0,r.bold)(`Options:`)}\n\n -plan=tfplan Render graph using the specified plan file instead of the\n configuration in the current directory. Implies -type=apply.\n\n -draw-cycles Highlight any cycles in the graph with colored edges.\n This helps when diagnosing cycle errors. This option is\n supported only when illustrating a real evaluation graph,\n selected using the -type=TYPE option.\n\n -type=TYPE Type of operation graph to output. Can be: plan,\n plan-refresh-only, plan-destroy, or apply. By default\n ${s.TITLE_APP} just summarizes the relationships between the\n resources in your configuration, without any particular\n operation in mind. Full operation graphs are more detailed\n but therefore often harder to read.\n\n -module-depth=n (deprecated) In prior versions of ${s.TITLE_APP}, specified the\n depth of modules to show in the output.\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files ${s.TITLE_APP.toLowerCase()}.vars.yml and *.auto.vars.yml.\n Use this option more than once to include more than one\n variables file.\n\n -format=FORMAT Output format for the graph. Supported values are\n dot (default), mermaid, and tree.\n`.trim();t.HELP_LOGIN=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] login [hostname]\n\n Retrieves an authentication token for the given hostname, if it supports\n automatic login, and saves it in a credentials file in your home directory.\n\n If no hostname is provided, the default hostname is github.com, to\n log in to GitHub.\n\n If not overridden by credentials helper settings in the CLI configuration,\n the credentials will be written to the following local file:\n ~/.testform.d/credentials.json\n`.trim();t.HELP_LOGOUT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] logout [hostname]\n\n Removes locally-stored credentials for specified hostname.\n\n Note: the API token is only removed from local storage, not destroyed on the\n remote server, so it will remain valid until manually revoked.\n\n If no hostname is provided, the default hostname is github.com.\n`.trim();t.HELP_STATE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state [subcommand] [options] [args]\n\n This command has subcommands for advanced state management.\n\n These subcommands can be used to slice and dice the ${s.TITLE_APP} state.\n This is sometimes necessary in advanced cases. For your safety, all\n state management commands that modify the state create a timestamped\n backup of the state prior to making modifications.\n\n${(0,r.bold)(`Subcommands:`)}\n identities List the identities of resources in the state\n list List resources in the state\n mv Move an item in the state\n pull Pull current state and output to stdout\n push Update remote state from a local state file\n replace-provider Replace provider in the state\n rm Remove instances from the state\n show Show a resource in the state\n`.trim();t.HELP_STATE_REPLACE_PROVIDER=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state replace-provider [options] FROM_PROVIDER TO_PROVIDER\n\n Replace provider in the ${s.TITLE_APP} state.\n\n This command updates the provider for all matching resources in the state,\n allowing seamless migration between providers (e.g. from github to gitlab).\n\n${(0,r.bold)(`Options:`)}\n\n -auto-approve Skip interactive confirmation before modifying state.\n -lock=false Don't hold a state lock during the operation.\n -lock-timeout=0s Duration to retry a state lock.\n -state=path Path to state file.\n -backup=path Path to backup file.\n`.trim();t.HELP_STATE_CLEAN=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state clean [options] [address...]\n\n Clean and optimize the ${s.TITLE_APP} state payload by removing redundant\n scenario bodies and empty fields, reducing file and network transfer size.\n\n By default, all resources in the state are cleaned and optimized. You can\n optionally provide one or more resource addresses to target specific resources.\n\n${(0,r.bold)(`Options:`)}\n -dry-run If set, prints out the potential space savings without\n writing changes to the state.\n -lock=false Don't hold a state lock during the operation.\n -lock-timeout=0s Duration to retry a state lock.\n -state=PATH Path to state file to clean.\n`.trim();t.HELP_STATE_IDENTITIES=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state identities [options] -json [address...]\n\n List the json format of the identities of resources in the ${s.TITLE_APP} state.\n\n This command lists the identities of resource instances in the ${s.TITLE_APP} state in json format.\n The address argument can be used to filter the instances by resource or module. If\n no pattern is given, identities for all resource instances are listed.\n\n The addresses must either be module addresses or absolute resource\n addresses, such as:\n github_testcase.example\n module.example\n module.example.module.child\n module.example.github_testcase.example\n\n An error will be returned if any of the resources or modules given as\n filter addresses do not exist in the state.\n\n${(0,r.bold)(`Options:`)}\n\n -state=statefile Path to a ${s.TITLE_APP} state file to use to look\n up ${s.TITLE_APP}-managed resources. By default, ${s.TITLE_APP}\n will consult the state of the currently-selected\n workspace.\n\n -id=ID Filters the results to include only instances whose\n resource types have an attribute named "id" whose value\n equals the given id string.\n`.trim();t.HELP_STATE_LIST=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state list [options] [address...]\n\n List resources in the ${s.TITLE_APP} state.\n\n This command lists resource instances in the ${s.TITLE_APP} state. The address\n argument can be used to filter the instances by resource or module. If\n no pattern is given, all resource instances are listed.\n\n The addresses must either be module addresses or absolute resource\n addresses, such as:\n github_testcase.example\n module.example\n module.example.module.child\n module.example.github_testcase.example\n\n An error will be returned if any of the resources or modules given as\n filter addresses do not exist in the state.\n\n${(0,r.bold)(`Options:`)}\n\n -state=statefile Path to a ${s.TITLE_APP} state file to use to look\n up ${s.TITLE_APP}-managed resources. By default, ${s.TITLE_APP}\n will consult the state of the currently-selected\n workspace.\n\n -id=ID Filters the results to include only instances whose\n resource types have an attribute named "id" whose value\n equals the given id string.\n`.trim();t.HELP_STATE_MV=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state mv [options] SOURCE DESTINATION\n\n This command will move an item matched by the address given to the\n destination address. This command can also move to a destination address\n in a completely different state file.\n\n This can be used for simple resource renaming, moving items to and from\n a module, moving entire modules, and more. And because this command can also\n move data to a completely new state, it can also be used for refactoring\n one configuration into multiple separately managed ${s.TITLE_APP} configurations.\n\n This command will output a backup copy of the state prior to saving any\n changes. The backup cannot be disabled. Due to the destructive nature\n of this command, backups are required.\n\n If you're moving an item to a different state file, a backup will be created\n for each state file.\n\n${(0,r.bold)(`Options:`)}\n\n -dry-run If set, prints out what would've been moved but doesn't\n actually move anything.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -ignore-remote-version A rare option used for the remote backend only. See\n the remote backend documentation for more information.\n\n -state, state-out, and -backup are legacy options supported for the local\n backend only. For more information, see the local backend's documentation.\n`.trim();t.HELP_STATE_PULL=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state pull [options]\n\n Pull the state from its location, upgrade the local copy, and output it\n to stdout.\n\n This command "pulls" the current state and outputs it to stdout.\n As part of this process, ${s.TITLE_APP} will upgrade the state format of the\n local copy to the current version.\n\n The primary use of this is for state stored remotely. This command\n will still work with local state but is less useful for this.\n`.trim();t.HELP_STATE_PUSH=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state push [options] PATH\n\n Update remote state from a local state file at PATH.\n\n This command "pushes" a local state and overwrites remote state\n with a local state file. The command will protect you against writing\n an older serial or a different state file lineage unless you specify the\n "-force" flag.\n\n This command works with local state (it will overwrite the local\n state), but is less useful for this use case.\n\n If PATH is "-", then this command will read the state to push from stdin.\n Data from stdin is not streamed to the backend: it is loaded completely\n (until pipe close), verified, and then pushed.\n\n${(0,r.bold)(`Options:`)}\n\n -force Write the state even if lineages don't match or the\n remote serial is higher.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n`.trim();t.HELP_STATE_RM=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state rm [options] ADDRESS...\n\n Remove one or more items from the ${s.TITLE_APP} state, causing ${s.TITLE_APP} to\n "forget" those items without first destroying them in the remote system.\n\n This command removes one or more resource instances from the ${s.TITLE_APP} state\n based on the addresses given. You can view and list the available instances\n with "${s.TITLE_CLI} state list".\n\n If you give the address of an entire module then all of the instances in\n that module and any of its child modules will be removed from the state.\n\n If you give the address of a resource that has "count" or "for_each" set,\n all of the instances of that resource will be removed from the state.\n\n${(0,r.bold)(`Options:`)}\n\n -dry-run If set, prints out what would've been removed but\n doesn't actually remove anything.\n\n -backup=PATH Path where ${s.TITLE_APP} should write the backup\n state.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -state=PATH Path to the state file to update. Defaults to the\n current workspace state.\n Legacy option for the local backend only. See\n the local backend's documentation for more\n information.\n\n -ignore-remote-version Continue even if remote and local ${s.TITLE_APP} versions\n are incompatible. This may result in an unusable\n workspace, and should be used with extreme caution.\n`.trim();t.HELP_STATE_SHOW=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] state show [options] ADDRESS\n\n Shows the attributes of a resource in the ${s.TITLE_APP} state.\n\n This command shows the attributes of a single resource in the ${s.TITLE_APP}\n state. The address argument must be used to specify a single resource.\n You can view the list of available resources with "${s.TITLE_CLI} state list".\n\n${(0,r.bold)(`Options:`)}\n\n -state=statefile Path to a ${s.TITLE_APP} state file to use to look\n up ${s.TITLE_APP}-managed resources. By default it will\n use the state "${s.FILE_STATE}" if it exists.\n`.trim();t.HELP_TAINT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] taint [options] <address>\n\n ${s.TITLE_APP} uses the term "tainted" to describe a resource instance\n which may not be fully functional, either because its creation\n partially failed or because you've manually marked it as such using\n this command.\n\n This will not modify your infrastructure directly, but subsequent\n ${s.TITLE_APP} plans will include actions to destroy the remote object\n and create a new object to replace it.\n\n You can remove the "taint" state from a resource instance using\n the "${s.TITLE_CLI} untaint" command.\n\n The address is in the resource address syntax, such as:\n testcase/cart.case.feature.tc-01\n testrun/sprint.run.feature.tr-login\n testplan/release.plan.feature.tp-smoke\n\n Use your shell's quoting or escaping syntax to ensure that the\n address will reach ${s.TITLE_APP} correctly, without any special\n interpretation.\n\n${(0,r.bold)(`Options:`)}\n\n -allow-missing If specified, the command will succeed (exit code 0)\n even if the resource is missing.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -ignore-remote-version A rare option used for the remote backend only. See\n the remote backend documentation for more information.\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files testform.vars.yml and *.auto.vars.yml.\n Use this option more than once to include more than one\n variables file.\n\n -state, state-out, and -backup are legacy options supported for the local\n backend only. For more information, see the local backend's documentation.\n`.trim();t.HELP_UNTAINT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] untaint [options] name\n\n ${s.TITLE_APP} uses the term "tainted" to describe a resource instance\n which may not be fully functional, either because its creation\n partially failed or because you've manually marked it as such using\n the "${s.TITLE_CLI} taint" command.\n\n This command removes that state from a resource instance, causing\n ${s.TITLE_APP} to see it as fully-functional and not in need of\n replacement.\n\n This will not modify your infrastructure directly. It only avoids\n ${s.TITLE_APP} planning to replace a tainted instance in a future operation.\n\n${(0,r.bold)(`Options:`)}\n\n -allow-missing If specified, the command will succeed (exit code 0)\n even if the resource is missing.\n\n -lock=false Don't hold a state lock during the operation. This is\n dangerous if others might concurrently run commands\n against the same workspace.\n\n -lock-timeout=0s Duration to retry a state lock.\n\n -ignore-remote-version A rare option used for the remote backend only. See\n the remote backend documentation for more information.\n\n -state, state-out, and -backup are legacy options supported for the local\n backend only. For more information, see the local backend's documentation.\n`.trim();t.HELP_VERSION=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] version [options]\n\n Displays the version of ${s.TITLE_APP} and all installed plugins\n\n${(0,r.bold)(`Options:`)}\n\n -json Output the version information as a JSON object.\n`.trim();t.HELP_WORKSPACE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] workspace\n\n new, list, show, select and delete ${s.TITLE_APP} workspaces.\n\n${(0,r.bold)(`Subcommands:`)}\n delete Delete a workspace\n list List Workspaces\n new Create a new workspace\n select Select a workspace\n show Show the name of the current workspace\n`.trim();t.HELP_DIFF=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] diff [options]\n\n Show drift between local configuration and state.\n\n${(0,r.bold)(`Options:`)}\n\n -target=resource Target a specific resource or feature file.\n -remote Compare local and state against live remote provider issues.\n -i, -interactive Interactively resolve detected drift (pull / overwrite / skip).\n -test-directory=dir Subdirectory containing test files.\n`.trim();t.HELP_EPHEMERAL=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] ephemeral <subcommand> [options] [args]\n\n Manage temporary CI/CD QA sandboxes.\n\n${(0,r.bold)(`Subcommands:`)}\n up Deploy an isolated ephemeral sandbox\n down Destroy all remote issues and clean sandbox\n list List all active ephemeral sandboxes\n show Inspect an ephemeral sandbox\n`.trim();t.HELP_MODULES=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] modules [options]\n\n Prints out a list of all declared ${s.TITLE_APP} modules and their resolved versions\n in a ${s.TITLE_APP} working directory.\n\n${(0,r.bold)(`Options:`)}\n\n -json If specified, output declared ${s.TITLE_APP} modules and\n their resolved versions in a machine-readable format.\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files ${s.TITLE_APP.toLowerCase()}.vars.yml and *.auto.vars.yml.\n Use this option more than once to include more than one\n variables file.\n`.trim();t.HELP_PROVIDERS=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] providers [options] [DIR]\n\n Prints out a tree of modules in the referenced configuration annotated with\n their provider requirements.\n\n This provides an overview of all of the provider requirements across all\n referenced modules, as an aid to understanding why particular provider\n plugins are needed and why particular versions are selected.\n\n${(0,r.bold)(`Options:`)}\n\n -test-directory=path Set the ${s.TITLE_APP} test directory, defaults to "tests".\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files ${s.TITLE_APP.toLowerCase()}.vars.yml and *.auto.vars.yml.\n Use this option more than once to include more than one\n variables file.\n\n${(0,r.bold)(`Subcommands:`)}\n lock Write out dependency locks for the configured providers\n mirror Save local copies of all required provider plugins\n schema Show schemas for the providers used in the configuration\n`.trim();t.HELP_PROVIDERS_LOCK=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] providers lock [options] [providers...]\n\n Normally the dependency lock file (.testform/cache/lock.json) is updated\n automatically by "${s.TITLE_CLI} init", but the information available to the\n normal provider installer can be constrained when you're installing providers\n from filesystem or network mirrors, and so the generated lock file can end\n up incomplete.\n\n The "providers lock" subcommand addresses that by updating the lock file\n based on the official packages available in the origin registry, ignoring\n the currently-configured installation strategy.\n\n After this command succeeds, the lock file will contain suitable checksums\n to allow installation of the providers needed by the current configuration\n on all of the selected platforms.\n\n By default this command updates the lock file for every provider declared\n in the configuration. You can override that behavior by providing one or\n more provider source addresses on the command line.\n\n${(0,r.bold)(`Options:`)}\n\n -fs-mirror=dir Consult the given filesystem mirror directory instead\n of the origin registry for each of the given providers.\n\n This would be necessary to generate lock file entries for\n a provider that is available only via a mirror, and not\n published in an upstream registry. In this case, the set\n of valid checksums will be limited only to what ${s.TITLE_APP}\n can learn from the data in the mirror directory.\n\n -net-mirror=url Consult the given network mirror (given as a base URL)\n instead of the origin registry for each of the given\n providers.\n\n This would be necessary to generate lock file entries for\n a provider that is available only via a mirror, and not\n published in an upstream registry. In this case, the set\n of valid checksums will be limited only to what ${s.TITLE_APP}\n can learn from the data in the mirror indices.\n\n -platform=os_arch Choose a target platform to request package checksums\n for.\n\n By default ${s.TITLE_APP} will request package checksums\n suitable only for the platform where you run this\n command. Use this option multiple times to include\n checksums for multiple target systems.\n\n Target names consist of an operating system and a CPU\n architecture. For example, "linux_amd64" selects the\n Linux operating system running on an AMD64 or x86_64\n CPU. Each provider is available only for a limited\n set of target platforms.\n\n -enable-plugin-cache Enable the usage of the globally configured plugin cache.\n This will speed up the locking process, but the providers\n won't be loaded from an authoritative source.\n\n -test-directory=path Set the ${s.TITLE_APP} test directory, defaults to "tests".\n\n -var 'foo=bar' Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files ${s.TITLE_APP.toLowerCase()}.vars.yml and *.auto.vars.yml.\n Use this option more than once to include more than one\n variables file.\n`.trim();t.HELP_PROVIDERS_MIRROR=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] providers mirror [options] <target-dir>\n\n Populates a local directory with copies of the provider plugins needed for\n the current configuration, so that the directory can be used either directly\n as a filesystem mirror or as the basis for a network mirror and thus obtain\n those providers without access to their origin registries in future.\n\n The mirror directory will contain JSON index files that can be published\n along with the mirrored packages on a static HTTP file server to produce\n a network mirror. Those index files will be ignored if the directory is\n used instead as a local filesystem mirror.\n\n${(0,r.bold)(`Options:`)}\n\n -platform=os_arch Choose which target platform to build a mirror for.\n By default ${s.TITLE_APP} will obtain plugin packages\n suitable for the platform where you run this command.\n Use this flag multiple times to include packages for\n multiple target systems.\n\n Target names consist of an operating system and a CPU\n architecture. For example, "linux_amd64" selects the\n Linux operating system running on an AMD64 or x86_64\n CPU. Each provider is available only for a limited\n set of target platforms.\n`.trim();t.HELP_PROVIDERS_SCHEMA=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] providers schema [options]\n\n Prints out a json representation of the schemas for all providers used\n in the configuration.\n\n${(0,r.bold)(`Options:`)}\n\n -json Output the schema representation in JSON format.\n`.trim();t.HELP_QUERY=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] query [options]\n\n Queries the remote infrastructure for resources.\n\n ${s.TITLE_APP} will search for .feature and test configuration files within the current configuration.\n ${s.TITLE_APP} will then use the configured providers to query the remote\n infrastructure for resources that match the defined list blocks. The results\n will be printed to the terminal and optionally can be used to generate\n configuration.\n\n${(0,r.bold)(`Query Customization Options:`)}\n\n The following options customize how ${s.TITLE_APP} will run the query.\n\n -var 'foo=bar' Set a value for one of the input variables in the query\n file of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file, in addition\n to the default files testform.vars.yml and *.auto.vars.yml.\n Use this option more than once to include more than one\n variables file.\n\n -custom=key=value Filter by custom field value.\n\n -search=text Free-text search across resource titles and content.\n\n${(0,r.bold)(`Other Options:`)}\n\n -generate-config-out=path Instructs ${s.TITLE_APP} to generate import and resource\n blocks for any found results. The configuration is\n written to a new file at PATH, which must not\n already exist. When this option is used with the\n json option, the generated configuration will be\n part of the JSON output instead of written to a\n file.\n\n -json If specified, machine readable output will be\n printed in JSON format.\n\n -no-color If specified, output won't contain any color.\n`.trim();t.HELP_REPORT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] report <type> [options]\n\n Generates multi-dimensional test reports from the local state.\n Available report types are grouped by scope:\n\n 📦 Scope: Test Case\n testcase-summary List of all test cases and their status\n test-case-activity Dashboard of test cases with graphs and trends\n\n 🏃 Scope: Test Run\n testrun-summary Test runs and their pass/fail metrics\n testrun-detailed In-depth view of a specific Test Run\n\n 📋 Scope: Test Plan\n testplan-summary Overall Test Plan Progress and linked test runs\n\n 🌐 Cross-Scope (Multi-dimensional)\n defects List of failed/blocked tests with issue links\n traceability Mapping between requirements/tags and test runs\n coverage Percentage of passed tests grouped by tags\n two-dimensional Status distribution matrix\n raw Extract all data for custom reporting\n\n${(0,r.bold)(`Options:`)}\n\n -format=format Output format.\n Default is "md" (Markdown).\n Available formats: md, json, csv, xlsx, docx.\n Custom formats can be auto-loaded from .testform/reports/.\n\n -out=path Path to save the generated report.\n Default is stdout.\n\n -filter=query Filter data by attribute/field (key=val) or inferred\n free-text search (text). Can be specified multiple times.\n\n -target=resource Target a specific resource, testrun (@tr-N), or\n testplan (@tp-N). When targeting a testplan, reports\n automatically include all linked testruns and executions.\n\n -groupBy=field Group results dynamically by a specific field\n (e.g. status, label, assignee, feature, priority).\n\n -template=path Path to a custom template file (Word .docx, HTML, etc.).\n\n -var=key=val Set a variable value to interpolate in report templates.\n Use this option more than once to set more than one variable.\n\n -var-file=filename Load variable values from the given YAML/JSON file.\n`.trim();t.HELP_TEST=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] test <subcommand> [options]\n\n Manage test files locally. Groups operations for creating and updating\n testrun and testplan feature files without interacting with GitHub.\n\n These subcommands do NOT interact with GitHub. They operate on local files\n and testform.state only.\n\n${(0,r.bold)(`Subcommands:`)}\n add Create a new testrun or testplan feature file\n autocomplete Expand empty Rule blocks in a testrun file from its source\n .case.feature (testrun only)\n state Update a testcase execution status within a testrun\n\n${(0,r.bold)(`Target Resolution (-target flag):`)}\n All subcommands accept three forms to identify a testrun/testplan:\n Full path: tests/testrun/20260607_013738_ef7c0c.run.feature\n Relative: 20260607_013738_ef7c0c.run.feature (or fragment)\n Identity: @tr-2 (resolved from testform.state)\n\n If a fragment matches more than one file, an error lists all ambiguous\n matches so you can be more specific.\n`.trim();t.HELP_TEST_FEATURE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] test feature [options]\n\n Create a new testrun or testplan feature file based on your naming\n convention defined in main.yml.\n\n This subcommand does NOT apply to testcase scope.\n It automatically resolves the output directory and applies the naming\n convention (including timestamp, hash, and slug) defined in your config.\n\n${(0,r.bold)(`Options:`)}\n\n -scope=scope Required. Must be 'testrun' or 'testplan'.\n\n -title=title An optional title for the feature file. If not provided,\n a default name based on the timestamp is generated.\n\n -rule=rule Include a Rule block (Rule: <rule>) in the generated file.\n The command verifies that a feature file for this rule\n exists in the workspace.\n Can be specified multiple times.\n`.trim();t.HELP_TEST_AUTOCOMPLETE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] test autocomplete -target=<resource>\n\n [testrun only] Reads each Rule block in the target testrun feature file,\n finds the referenced .case.feature on disk, and expands its scenarios into\n the testrun file with 'mark status = pending'.\n\n Files are matched by @testrun tag OR the .run.feature extension.\n\n Rules that already have explicit Scenario blocks are left unchanged —\n manual control is always preserved.\n\n${(0,r.bold)(`Options:`)}\n\n -target=resource Required. Identifies the testrun file. Accepts:\n Full path: tests/testrun/20260607_ef7c0c.run.feature\n Relative: 20260607_ef7c0c.run.feature (or fragment)\n Identity: @tr-2 (resolved from testform.state)\n\n -test-directory=dir Optional. Limits the search scope for .case.feature files.\n`.trim();t.HELP_TEST_STATE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] test state "featureFile@tc-N=status" -target=<resource>\n\n [testrun only] Update the execution status of a specific testcase within\n a testrun. Simultaneously updates:\n - The GitHub comment for that testcase\n - The issue body checklist\n - The local testrun feature file\n\n The testcase argument must include the source feature file to avoid\n ambiguity when multiple Rules share the same @tc-N numbering.\n\n${(0,r.bold)(`Available statuses:`)} passed, failed, pending, skipped, blocked, wip\n\n${(0,r.bold)(`Options:`)}\n\n -target=resource Required. Identifies the testrun file. Accepts:\n Full path: tests/testrun/20260607_ef7c0c.run.feature\n Relative: 20260607_ef7c0c.run.feature (or fragment)\n Identity: @tr-2 (resolved from testform.state)\n\n${(0,r.bold)(`Argument:`)} "featureFile@tc-N=status"\n\n The featureFile can be a filename, a relative path, or a full identity.\n Use the full path when multiple Rules share the same @tc-N numbers.\n\n${(0,r.bold)(`Examples:`)}\n\n ${s.TITLE_CLI} test state "cuenta/inicio-sesion.feature@tc-1=passed" -target="@tr-2"\n ${s.TITLE_CLI} test state "github_testcase.agencia/cuenta.feature.@tc-3=failed" -target="20260607.run.feature"\n`.trim();t.HELP_PRINT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] print [options]\n\n Parse a specific feature file and print its JSON Abstract Syntax Tree (AST).\n This command is designed for developers to debug Gherkin feature parsing and Testform's\n filtering behavior.\n\n${(0,r.bold)(`Options:`)}\n\n -scope=scope Limit the scope of the execution (testcase, testrun, testplan).\n\n -file=path The filename or partial filename to parse and output.\n If not provided, all parsed scenarios in the current\n scope will be printed.\n\n -format=format Choose between 'gherkin' (raw Gherkin AST) or 'testform' \n (filtered and enriched by Testform). Default is 'testform'.\n\n -var=key=val Set a value for one of the input variables in the root\n module of the configuration. Use this option more than\n once to set more than one variable.\n\n -var-file=filename Load variable values from the given file (.json or key=value format).\n Use this option more than once to include more than one\n variables file.\n`.trim();t.HELP_SUITE=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] suite [subcommand] [options]\n\n Manage test suites and execution files (.run.feature and .plan.feature).\n\n${(0,r.bold)(`Subcommand:`)}\n init Create a new suite file (.run.feature or .plan.feature)\n\n${(0,r.bold)(`Options:`)}\n -fill Autocomplete empty testrun rules with their testcases\n -link="<id>=<status>" Link a testcase or testrun into a suite\n -mark="<id>=<status>" Record execution status (* mark status = <status>) in a testrun\n -tags="<address>" Generate a testrun suite from bracketed tag addresses (e.g. "[@smoke]")\n\n${(0,r.bold)(`Other Options:`)}\n -target=resource Required for -fill, -link, -mark. Identifies the suite file:\n • Identity Tag (@tr-N / @tp-N):\n Unique identifier across workspace (only valid for testrun/testplan;\n testcase @tc-N tags can repeat across files).\n • Canonical Address:\n Immutable full address (e.g. tests/runs/20261024.run.feature.@tr-1).\n • Scoped File Path:\n File path resolved against -test-directory (e.g. 20261024.run.feature).\n -test-directory=dir Optional. Limits search scope for .case.feature files and shortens target paths.\n -scope=scope Optional (global). Scope of the suite (testrun | testplan).\n -title=title Optional. Human-readable title of the suite.\n -rule=rule Optional. Source .case.feature file(s) to include as Rule blocks.\n`.trim();t.HELP_FUNCTIONS=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] functions [name] [options]\n\n Inspect and evaluate built-in functions available in Testform expressions\n (used in locals.yml expressions, variables.yml validation conditions, etc.).\n\n${(0,r.bold)(`Options:`)}\n --eval="<expr>" Evaluate an expression live in the terminal and display the result.\n\n${(0,r.bold)(`Examples:`)}\n ${s.TITLE_CLI} functions\n ${s.TITLE_CLI} functions format\n ${s.TITLE_CLI} functions lower\n ${s.TITLE_CLI} functions --eval="format('%s/%s', 'https://api.dev.com', 'v1')"\n ${s.TITLE_CLI} functions --eval="contains(['dev', 'staging'], 'dev')"\n`.trim();t.HELP_SUITE_INIT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] suite init [options]\n\n Create a new testrun or testplan feature file based on your project conventions.\n Applies timestamp, hash, and slug naming defined in your config.\n\n${(0,r.bold)(`Options:`)}\n\n -scope=scope Required. Must be 'testrun' or 'testplan'.\n -title=title An optional title for the suite file.\n -rule=rule Include a Rule block (Rule: <rule>) in the generated file.\n Can be specified multiple times.\n`.trim();t.HELP_SUITE_FILL=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] suite fill -target=<resource>\n\n [testrun only] Reads each Rule block in the target testrun feature file,\n finds the referenced .case.feature on disk, and fills its scenarios into\n the testrun file with 'mark status = pending'.\n\n${(0,r.bold)(`Options:`)}\n\n -target=resource Required. Identifies the suite file (path, relative, or @tr-N).\n -test-directory=dir Optional. Limits the search scope for .case.feature files.\n`.trim();t.HELP_SUITE_LINK=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] suite link "<identifier>[=status]" -target=<resource>\n\n Directly writes Gherkin into the suite file (.run.feature or .plan.feature)\n without needing to hand-craft Gherkin syntax.\n\n${(0,r.bold)(`Scopes & Modes:`)}\n 1. Scope testrun:\n - Implicit: ${s.TITLE_CLI} suite link "checkout.case.feature" -target="@tr-42"\n Injects: Rule: checkout.case.feature\n - Explicit: ${s.TITLE_CLI} suite link "@tc-1" -target="@tr-42"\n Injects: Rule: checkout.case.feature\n Scenario: @tc-1\n * mark status = pending\n - Status: ${s.TITLE_CLI} suite link "@tc-1=passed" -target="@tr-42"\n\n 2. Scope testplan:\n - Link run: ${s.TITLE_CLI} suite link "sprint42.run.feature" -target="@tp-1"\n Injects: Rule: sprint42.run.feature\n\n${(0,r.bold)(`Identity Strategies:`)}\n 1. Only tag: "@tc-1" or "@tc-1=passed"\n 2. File + tag: "checkout.case.feature.@tc-1=passed" (or "@tc-1")\n 3. Scenario name: "Pago con tarjeta=passed" (matches scenario title)\n`.trim();t.HELP_SUITE_MARK=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] suite mark "<identifier>=status" -target=<resource>\n\n Record or update the execution status of an existing testcase within a testrun,\n synchronizing both the local .run.feature file and the remote issue comments.\n\n Note: If the testcase belongs to an implicit Rule, you must expand it first\n using '${s.TITLE_CLI} suite fill -target=<resource>' before marking its status.\n\n${(0,r.bold)(`Available statuses:`)} passed, failed, pending, skipped\n\n${(0,r.bold)(`Examples:`)}\n ${s.TITLE_CLI} suite mark "@tc-1=passed" -target="@tr-2"\n ${s.TITLE_CLI} suite mark "cuenta/inicio-sesion.feature@tc-1=failed" -target="@tr-2"\n ${s.TITLE_CLI} suite mark "Validar login exitoso=passed" -target="20260607.run.feature"\n`.trim();t.HELP_OUTPUT=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] output [options] [NAME]\n\n Reads an output variable from a ${s.TITLE_APP} state file and prints\n the value. With no additional arguments, output will display all the\n outputs for the root module. An optional NAME can be provided to display\n a specific output value.\n\n${(0,r.bold)(`Options:`)}\n\n -state=path Path to the state file to read. Defaults to "${s.FILE_STATE}".\n\n -json If specified, machine readable output will be\n printed in JSON format.\n\n -raw If specified for a single named output value,\n the value will be printed without formatting or quotes.\n`.trim();t.HELP_POLICY=`\n${(0,r.bold)(`Usage:`)} ${s.TITLE_CLI} [global options] policy [options]\n\n Inspects, enables, or disables validation policies defined for this\n configuration, or loaded from local and shared modules.\n\n By default, '${s.TITLE_CLI} policy' lists all available policies (both built-in\n and custom) along with their current status, scope, and description.\n\n${(0,r.bold)(`Options:`)}\n\n -enable=ID Enable the specified policy and save to configuration.\n\n -disable=ID Disable the specified policy and save to configuration.\n\n -show=ID Show detailed information and rule definitions for a policy.\n\n -scope=SCOPE Filter policies by scope (testcase, testrun, testplan).\n\n -json Produce output in a machine-readable JSON format.\n`.trim();function getCommandHelp(e){switch(e){case"policy":return t.HELP_POLICY;case"init":return t.HELP_INIT;case"validate":return t.HELP_VALIDATE;case"plan":return t.HELP_PLAN;case"apply":return t.HELP_APPLY;case"destroy":return t.HELP_DESTROY;case"import":return t.HELP_IMPORT;case"refresh":return t.HELP_REFRESH;case"diff":return t.HELP_DIFF;case"query":return t.HELP_QUERY;case"show":return t.HELP_SHOW;case"output":return t.HELP_OUTPUT;case"fmt":return t.HELP_FMT;case"graph":return t.HELP_GRAPH;case"force-unlock":return t.HELP_FORCE_UNLOCK;case"login":return t.HELP_LOGIN;case"workspace":return t.HELP_WORKSPACE;case"ephemeral":return t.HELP_EPHEMERAL;case"report":return t.HELP_REPORT;case"print":return t.HELP_PRINT;case"logout":return t.HELP_LOGOUT;case"modules":return t.HELP_MODULES;case"providers":return t.HELP_PROVIDERS;case"providers lock":return t.HELP_PROVIDERS_LOCK;case"providers mirror":return t.HELP_PROVIDERS_MIRROR;case"providers schema":return t.HELP_PROVIDERS_SCHEMA;case"state":return t.HELP_STATE;case"state clean":return t.HELP_STATE_CLEAN;case"state identities":return t.HELP_STATE_IDENTITIES;case"state list":return t.HELP_STATE_LIST;case"state mv":return t.HELP_STATE_MV;case"state pull":return t.HELP_STATE_PULL;case"state push":return t.HELP_STATE_PUSH;case"state replace-provider":return t.HELP_STATE_REPLACE_PROVIDER;case"state rm":return t.HELP_STATE_RM;case"state show":return t.HELP_STATE_SHOW;case"taint":return t.HELP_TAINT;case"untaint":return t.HELP_UNTAINT;case"version":return t.HELP_VERSION;case"suite":return t.HELP_SUITE;case"suite init":return t.HELP_SUITE_INIT;case"suite fill":return t.HELP_SUITE_FILL;case"suite link":return t.HELP_SUITE_LINK;case"suite mark":return t.HELP_SUITE_MARK;case"functions":return t.HELP_FUNCTIONS;default:return null}}},2043:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.LifecycleResolver=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=n(6028);const c=n(2978);class LifecycleResolver{globalDefaults={};scopeDefaults=new Map;workDir;constructor(e="."){this.workDir=e;this.loadDeclarations()}loadDeclarations(){const e=a.CONFIG_FILE_NAMES;for(const t of e){const e=(0,i.resolve)(this.workDir,t);if((0,r.existsSync)(e)){try{const t=o.default.parse((0,r.readFileSync)(e,"utf-8"));this.processParsedYaml(t)}catch{}}}const t=(0,c.findDomainConfigFiles)(this.workDir);for(const e of t){try{const t=o.default.parse((0,r.readFileSync)(e,"utf-8"));this.processParsedYaml(t)}catch{}}}processParsedYaml(e){if(!e||typeof e!=="object")return;const t=e.resource;if(t&&typeof t==="object"){for(const[e,n]of Object.entries(t)){if(n&&typeof n==="object"&&n.lifecycle){this.registerScopeLifecycle(e,n.lifecycle)}}}for(const t of["testcase","testrun","testplan","global"]){if(e[t]&&typeof e[t]==="object"&&e[t].lifecycle){this.registerScopeLifecycle(t,e[t].lifecycle)}}}registerScopeLifecycle(e,t){if(!t||typeof t!=="object")return;if(e==="global"){this.globalDefaults={prevent_destroy:t.prevent_destroy!==undefined?Boolean(t.prevent_destroy):this.globalDefaults.prevent_destroy,ignore_changes:Array.isArray(t.ignore_changes)?Array.from(new Set([...this.globalDefaults.ignore_changes||[],...t.ignore_changes])):this.globalDefaults.ignore_changes||[]};return}const n=this.scopeDefaults.get(e)||{};this.scopeDefaults.set(e,{prevent_destroy:t.prevent_destroy!==undefined?Boolean(t.prevent_destroy):n.prevent_destroy,ignore_changes:Array.isArray(t.ignore_changes)?Array.from(new Set([...n.ignore_changes||[],...t.ignore_changes])):n.ignore_changes||[]})}getLifecycle(e,t=[]){const n=(0,c.normalizeAddress)(e);let s=this.globalDefaults.prevent_destroy||false;let r=[...this.globalDefaults.ignore_changes||[]];for(const[e,t]of this.scopeDefaults.entries()){const i=e==="testcase"&&(n.includes(".case.")||n.includes("testcase"))||e==="testrun"&&(n.includes(".run.")||n.includes("testrun"))||e==="testplan"&&(n.includes(".plan.")||n.includes("testplan"))||n.includes(`.${e}.`)||n.startsWith(`${e}.`);if(i){if(t.prevent_destroy!==undefined)s=t.prevent_destroy;if(t.ignore_changes)r.push(...t.ignore_changes)}}for(const e of t){const t=e.startsWith("@")?e.substring(1):e;if(t==="prevent_destroy"||t==="prevent-destroy"){s=true}const n=t.match(/^ignore_changes\((.*)\)$/);if(n){const e=n[1].split(",").map((e=>e.trim().replace(/^['"]|['"]$/g,""))).filter(Boolean);r.push(...e)}}return{prevent_destroy:s,ignore_changes:Array.from(new Set(r))}}}t.LifecycleResolver=LifecycleResolver},1227:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.logger=t.Logger=void 0;const s=n(465);const r=n(4296);function cleanText(e){if(process.env.NO_COLOR==="1"){return e.replace(/\u001b\[[0-9;]*m/g,"")}return e}class Logger{verbose=false;isJson=false;constructor(e=false,t=false){this.verbose=e;this.isJson=t}print(e,t=false){const n=cleanText(e);if(t){console.error(n)}else{console.log(n)}}applyStyle(e,t){let n=e;if(t?.bold)n=(0,s.bold)(n);if(t?.dim)n=(0,s.dim)(n);return n}emitJson(e,t,n){const s={"@level":e,"@message":t,"@module":"testform.ui","@timestamp":(new Date).toISOString(),type:"log"};if(n){s.data=n}console.log(JSON.stringify(s))}formatMessage(e){return Array.isArray(e)?e.join("\n"):e}debug(e,t){if(!this.verbose)return;const n=this.formatMessage(e);if(this.isJson){this.emitJson("debug",n,t?.data);return}const r=t?.prefix!==false;const i=r?(0,s.dim)(`[DEBUG] `):"";const o=this.applyStyle(n,t);this.print(`${i}${(0,s.gray)(o)}`);if(t?.data)this.print((0,s.gray)(JSON.stringify(t.data,null,2)))}info(e,t){const n=this.formatMessage(e);if(this.isJson){this.emitJson("info",n,t?.data);return}const r=t?.prefix===true;const i=r?(0,s.cyan)(`[INFO] `):"";const o=this.applyStyle(n,t);this.print(`${i}${o}`);if(t?.data&&this.verbose)this.print((0,s.gray)(JSON.stringify(t.data,null,2)))}success(e,t){const n=this.formatMessage(e);if(this.isJson){this.emitJson("info",n,t?.data);return}const r=t?.prefix===true;const i=r?(0,s.green)(`[✓] `):"";const o=this.applyStyle((0,s.green)(n),t);this.print(`${i}${o}`);if(t?.data&&this.verbose)this.print((0,s.gray)(JSON.stringify(t.data,null,2)))}warn(e,t){const n=this.formatMessage(e);if(this.isJson){this.emitJson("warn",n,t?.data);return}this.print((0,s.yellow)("╷"),true);const r=(0,s.bold)((0,s.yellow)("Warning:"));const i=this.applyStyle(n,t);this.print(`${(0,s.yellow)("│")} ${r} ${i}`,true);if(t?.data&&this.verbose){this.print((0,s.yellow)("│"),true);const e=JSON.stringify(t.data,null,2);e.split("\n").forEach((e=>this.print(`${(0,s.yellow)("│")} ${e}`,true)))}this.print((0,s.yellow)("╵"),true)}error(e,t){const n=this.formatMessage(e);if(this.isJson){this.emitJson("error",n,t?t instanceof Error?t.stack:t:undefined);const e=new r.TestformError(n);e.logged=true;throw e}this.print((0,s.red)("╷"),true);const i=(0,s.bold)((0,s.red)("Error:"));const o=n.split("\n");this.print(`${(0,s.red)("│")} ${i} ${(0,s.bold)(o[0])}`,true);for(let e=1;e<o.length;e++){this.print(`${(0,s.red)("│")} ${o[e]}`,true)}if(t){this.print((0,s.red)("│"),true);if(t instanceof Error){this.print(`${(0,s.red)("│")} ${t.message}`,true);if(this.verbose&&t.stack){t.stack.split("\n").forEach((e=>this.print(`${(0,s.red)("│")} ${(0,s.dim)(e)}`,true)))}}else if(typeof t==="object"){const e=JSON.stringify(t,null,2);e.split("\n").forEach((e=>this.print(`${(0,s.red)("│")} ${e}`,true)))}else{this.print(`${(0,s.red)("│")} ${String(t)}`,true)}}this.print((0,s.red)("╵"),true);const a=new r.TestformError(n);a.logged=true;throw a}blank(){if(this.isJson)return;this.print("")}push(e){const t=e.type==="warning";const n=t?(0,s.bold)((0,s.yellow)("Warning:")):(0,s.bold)((0,s.red)("Error:"));const i=t?s.yellow:s.red;const o=(0,s.bold)(e.title);const a=e.close??false;if(this.isJson){this.emitJson(e.type==="warning"?"warn":"error",e.title,{detail:e.detail,extra:e.extra});if(a){const t=new r.TestformError(e.title);t.logged=true;throw t}return}this.print(i("╷"));this.print(`${i("│")} ${n} ${o}`);this.print(i("│"));if(e.detail){for(const t of e.detail){this.print(t?`${i("│")} ${t}`:i("│"))}}if(e.extra){for(const t of e.extra){this.print(`${i("│")} ${t}`)}}this.print(i("╵"));if(a){const t=new r.TestformError(e.title);t.logged=true;throw t}}refresh(e,t){if(this.isJson)return;const n=t?(0,s.dim)(`[id=${t}]`):"";this.print(`${(0,s.cyan)(e)}: Refreshing state... ${n}`)}}t.Logger=Logger;t.logger=new Logger},1859:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.ModuleRegistry=void 0;t.isGitSource=isGitSource;t.parseGitSource=parseGitSource;t.parseModuleTargets=parseModuleTargets;t.parseModuleTag=parseModuleTag;t.resolveModulePath=resolveModulePath;t.loadModuleSteps=loadModuleSteps;const r=n(6928);const i=n(9896);const o=n(119);const a=n(8569);const c=s(n(8815));const l=n(2978);const u=n(6028);class ModuleRegistry{declaredModules=new Map;workDir;constructor(e="."){this.workDir=e;this.loadDeclarations()}loadDeclarations(){for(const e of u.CONFIG_FILE_NAMES){const t=(0,r.resolve)(this.workDir,e);if((0,i.existsSync)(t)){try{const e=c.default.parse((0,i.readFileSync)(t,"utf-8"));if(e?.module&&typeof e.module==="object"){this.registerModules(e.module)}}catch{}}}const e=(0,l.findDomainConfigFiles)(this.workDir);for(const t of e){try{const e=c.default.parse((0,i.readFileSync)(t,"utf-8"));if(e?.module&&typeof e.module==="object"){this.registerModules(e.module)}}catch{}}}registerModules(e){const t=new Set(["source","version","scenario","id","providers","depends_on","count","for_each","lifecycle","output","outputs","variable"]);for(const[n,s]of Object.entries(e)){if(!s||typeof s!=="object")continue;const e={};for(const[n,r]of Object.entries(s)){if(!t.has(n)){e[n]=r}}const r=s.variable&&typeof s.variable==="object"?s.variable:{};const i={...e,...r};const o=Object.keys(i).length>0?i:undefined;this.declaredModules.set(n,{source:s.source||"",version:s.version||"",scenario:s.scenario||s.id,variable:o,output:s.output||s.outputs,outputs:s.output||s.outputs})}}getModule(e){return this.declaredModules.get(e)}getDeclaredModules(){return this.declaredModules}}t.ModuleRegistry=ModuleRegistry;function isGitSource(e){return e.startsWith("git::")||e.startsWith("git@")||e.startsWith("https://")&&e.includes(".git")}function parseGitSource(e){let t=e.replace(/^git::/,"");let n;const s=t.indexOf("?ref=");if(s!==-1){n=t.substring(s+5);t=t.substring(0,s)}let r;const i=t.indexOf("://");const o=i!==-1?i+3:0;const a=t.indexOf("//",o);if(a!==-1){r=t.substring(a+2);t=t.substring(0,a)}return{repoUrl:t,subPath:r,ref:n}}function parseVariableArgument(e){const t=e.indexOf("variable=");if(t===-1)return undefined;const n=e.indexOf("{",t);if(n===-1)return undefined;let s=0;let r=-1;for(let t=n;t<e.length;t++){if(e[t]==="{")s++;else if(e[t]==="}"){s--;if(s===0){r=t;break}}}if(r===-1)return undefined;const i=e.substring(n+1,r).trim();if(!i)return{};try{const e=c.default.parse(`{\n${i}\n}`);if(e&&typeof e==="object"){return e}}catch{const e={};const t=i.split(",");for(const n of t){const t=n.indexOf(":");if(t>0){const s=n.substring(0,t).trim().replace(/^['"]|['"]$/g,"");const r=n.substring(t+1).trim().replace(/^['"]|['"]$/g,"");e[s]=r}}return e}return undefined}function parseModuleTargets(e,t){if(!e.startsWith("@module"))return null;const n=e.match(/[,;]\s*(?:scenario|id)=['"]([^'"]+)['"]/i);const s=n?n[1].trim():undefined;const r=parseVariableArgument(e);const i=e.match(/name=['"]([^'"]+)['"]/i);const o=i?i[1].trim():undefined;const a=e.match(/@module\(source=\[([^\]]+)\]/i);if(a){return a[1].split(",").map((e=>e.trim().replace(/^['"]|['"]$/g,""))).filter(Boolean).map((e=>{if(e.includes(".feature.")){const t=e.indexOf(".feature.");return{source:e.slice(0,t+8).trim(),scenario:e.slice(t+9).trim(),variable:r}}return{source:e,scenario:s,variable:r}}))}if(o&&t){const e=t.getModule(o);if(e){const t={...e.variable||{},...r||{}};return[{name:o,source:e.source,scenario:s||e.scenario,variable:Object.keys(t).length>0?t:undefined}]}return[{name:o,source:o,scenario:s,variable:r}]}const c=e.match(/@module\(source=['"]([^'"]+)['"]/i);if(c){let e=c[1].trim();let n=s;if(t){const s=t.getModule(e);if(s){const t={...s.variable||{},...r||{}};return[{name:e,source:s.source,scenario:n||s.scenario,variable:Object.keys(t).length>0?t:undefined}]}}if(e.includes(".feature.")){const t=e.indexOf(".feature.");n=e.slice(t+9).trim();e=e.slice(0,t+8).trim()}return[{source:e,scenario:n,variable:r}]}const l=e.match(/@module\(['"]([^'"]+)['"]/i);if(l){let e=l[1].trim();let n=s;if(t){const s=t.getModule(e);if(s){const t={...s.variable||{},...r||{}};return[{name:e,source:s.source,scenario:n||s.scenario,variable:Object.keys(t).length>0?t:undefined}]}}if(e.includes(".feature.")){const t=e.indexOf(".feature.");n=e.slice(t+9).trim();e=e.slice(0,t+8).trim()}return[{source:e,scenario:n,variable:r}]}return null}function parseModuleTag(e,t){const n=parseModuleTargets(e,t);if(!n)return null;return n.map((e=>e.scenario?`${e.source}.${e.scenario}`:e.source))}function findFeatureInDir(e){try{const t=(0,i.readdirSync)(e);for(const n of t){if(n.endsWith(".feature")){return(0,r.resolve)(e,n)}}}catch{}return null}function resolveModulePath(e,t,n=process.cwd(),s){if(s){const r=s.getModule(t);if(r&&r.source){return resolveModulePath(e,r.source,n,undefined)}}const o=(0,r.resolve)((0,r.dirname)(e),t);if((0,i.existsSync)(o)){if((0,i.statSync)(o).isFile()){return o}const e=findFeatureInDir(o);if(e)return e}const a=(0,r.resolve)(n,t);if((0,i.existsSync)(a)){if((0,i.statSync)(a).isFile()){return a}const e=findFeatureInDir(a);if(e)return e}const c=(0,r.resolve)(n,".testform","modules",t);if((0,i.existsSync)(c)){if((0,i.statSync)(c).isFile()){return c}const e=findFeatureInDir(c);if(e)return e}return null}function loadModuleDirectoryDefaults(e){const t=(0,r.dirname)(e);const n={};for(const e of["variables.yml","variables.yaml",...u.CONFIG_FILE_NAMES]){const s=(0,r.join)(t,e);if((0,i.existsSync)(s)){try{const e=c.default.parse((0,i.readFileSync)(s,"utf-8"));const t=e?.variable;if(t&&typeof t==="object"){for(const[e,s]of Object.entries(t)){if(s&&typeof s==="object"&&"default"in s){n[e]=s.default}else if(s!==undefined){n[e]=s}}}}catch{}}}return n}function loadModuleSteps(e,t,n,s){try{let r=(0,i.readFileSync)(e,"utf-8");r=(0,l.sanitizeTagsWithSpaces)(r);const c=new o.Parser(new o.AstBuilder(a.IdGenerator.uuid()),new o.GherkinClassicTokenMatcher);const u=c.parse(r);const d=[];if(u.feature){const e=[];for(const t of u.feature.children||[]){if(t.background){for(const n of t.background.steps||[]){e.push({keyword:n.keyword,keywordType:n.keywordType,text:n.text})}}}for(const n of u.feature.children||[]){if(n.scenario){const s=n.scenario;if(t){const e=t.toLowerCase().trim();const n=e.startsWith("@")?e.slice(1):e;const r=(s.tags||[]).map((e=>e.name.toLowerCase().trim()));const i=r.some((t=>t===e||t===`@${n}`||t===n));const o=s.name.toLowerCase().trim()===e;if(!i&&!o){continue}}if(d.length===0&&e.length>0){d.push(...e)}for(const e of s.steps||[]){d.push({keyword:e.keyword,keywordType:e.keywordType,text:e.text})}if(t)break}}}const f=loadModuleDirectoryDefaults(e);const p={...f,...n||{}};return d.map((e=>{let t=e.text;for(const[e,n]of Object.entries(p)){const s=n!==null&&n!==undefined?String(n):"";t=t.split(`<${e}>`).join(s);t=t.split(`\${var.${e}}`).join(s);t=t.split(`\${${e}}`).join(s)}if(s&&typeof s.applyToTemplate==="function"){t=s.applyToTemplate(t)}return{...e,text:t}}))}catch{return[]}}},1533:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.OutputResolver=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=n(2978);const c=n(455);const l=n(6028);class OutputResolver{declaredOutputs={};workDir;dataResolver;constructor(e="."){this.workDir=e;this.dataResolver=new c.DataResolver(e);this.loadDeclarations()}loadDeclarations(){const e={};for(const t of l.CONFIG_FILE_NAMES){const n=(0,i.resolve)(this.workDir,t);if((0,r.existsSync)(n)){try{const t=o.default.parse((0,r.readFileSync)(n,"utf-8"));const s=t&&(t.output||t.outputs);if(s&&typeof s==="object"){Object.assign(e,this.normalizeDeclarations(s))}const i=t&&t.module;if(i&&typeof i==="object"){for(const[t,n]of Object.entries(i)){const s=n&&typeof n==="object"&&(n.output||n.outputs);if(s&&typeof s==="object"){const n=this.normalizeDeclarations(s);for(const[s,r]of Object.entries(n)){e[`module.${t}.${s}`]=r}}}}}catch{}}}for(const t of["output.yml","output.yaml","outputs.yml","outputs.yaml"]){const n=(0,i.resolve)(this.workDir,t);if((0,r.existsSync)(n)){try{const t=o.default.parse((0,r.readFileSync)(n,"utf-8"));if(t&&typeof t==="object"){const n=t.output||t.outputs||t;if(n&&typeof n==="object"){Object.assign(e,this.normalizeDeclarations(n))}}}catch{}}}const t=(0,a.findDomainConfigFiles)(this.workDir);for(const n of t){try{const t=o.default.parse((0,r.readFileSync)(n,"utf-8"));if(t&&typeof t==="object"){const s=n.replace(/\\/g,"/").includes("/modules/")||t.module;const r=t.module||this.extractModuleName(n);const i=t.output||t.outputs;if(i&&typeof i==="object"){const t=this.normalizeDeclarations(i);if(s&&r){for(const[n,s]of Object.entries(t)){e[`module.${r}.${n}`]=s}}else{Object.assign(e,t)}}const o=t.module;if(o&&typeof o==="object"){for(const[t,n]of Object.entries(o)){const s=n&&typeof n==="object"&&(n.output||n.outputs);if(s&&typeof s==="object"){const n=this.normalizeDeclarations(s);for(const[s,r]of Object.entries(n)){e[`module.${t}.${s}`]=r}}}}}}catch{}}this.declaredOutputs=e}extractModuleName(e){const t=e.replace(/\\/g,"/");const n=t.match(/\/modules\/([^\/]+)/);return n?n[1]:null}normalizeDeclarations(e){const t={};for(const[n,s]of Object.entries(e)){if(s===null||s===undefined)continue;if(typeof s==="object"&&"value"in s){t[n]={value:s.value,description:s.description,sensitive:Boolean(s.sensitive)}}else{t[n]={value:s}}}return t}getDeclarations(){return this.declaredOutputs}resolve(e,t){const n={};const s=t?t.getVars():{};const r=t?t.getLocals():{};const i=e.getResources();for(const[t,o]of Object.entries(this.declaredOutputs)){const a=o.value;const c=this.evaluateValue(a,i,s,r,e);const l=Array.isArray(c)?"tuple":typeof c;n[t]={value:c,type:l,description:o.description,sensitive:o.sensitive}}return n}evaluateValue(e,t,n,s,r){if(typeof e!=="string"){return e}const i=e.trim().match(/^\$\{([^\}]+)\}$/);if(i){return this.resolveExpression(i[1],t,n,s,r)}const o=/\$\{([^\}]+)\}/g;return e.replace(o,((e,i)=>{const o=this.resolveExpression(i,t,n,s,r);if(o===undefined||o===null)return"";if(typeof o==="object")return JSON.stringify(o);return String(o)}))}resolveExpression(e,t,n,s,r){const i=e.trim();if(i.startsWith("var.")){const e=i.substring(4);return n[e]!==undefined?n[e]:`\${${i}}`}if(i.startsWith("local.")){const e=i.substring(6);return s[e]!==undefined?s[e]:`\${${i}}`}if(i.startsWith("data.")){const e=i.substring(5);const t=this.dataResolver.resolvePath(e,r);if(t!==undefined){return t}}if(i.startsWith("module.")){if(r){const e=r.getOutputs?r.getOutputs():r.outputs;if(e&&e[i]){return e[i].value}}if(this.declaredOutputs[i]){return this.evaluateValue(this.declaredOutputs[i].value,t,n,s,r)}return`\${${i}}`}const o=i.lastIndexOf(".");if(o>0){const e=i.substring(0,o);const n=i.substring(o+1);const s=t.find((t=>{if((0,a.addressesMatch)(t.identity,e))return true;if((0,a.addressesMatch)(`${t.type}.${t.identity}`,e))return true;const n=e.replace(/^(github_|local_)?(testcase|testrun|testplan)\./,"");if((0,a.addressesMatch)(t.identity,n))return true;return false}));if(s){return this.extractResourceAttribute(s,n)}}return`\${${i}}`}extractResourceAttribute(e,t){const n=e.attributes||{};switch(t){case"id":case"remoteId":return n.remoteId||n.id||"";case"number":case"issueNumber":return n.issueNumber!==undefined?n.issueNumber:0;case"url":return n.url||(n.issueNumber?`https://github.com/issues/${n.issueNumber}`:"");case"title":return n.title||"";case"body":return n.body||"";case"labels":case"tags":return n.labels||[];case"status":return n.status||"";case"testcases":return n.testcases||n.testcaseStatuses||{};case"testruns":return n.testruns||{};case"metadata":return n.metadata||{};case"assignees":return n.assignees||[];case"milestone":return n.milestone||"";case"testcaseStatuses":return n.testcases||n.testcaseStatuses||{};case"testcaseCommentIds":return n.testcaseCommentIds||{};case"createdAt":return n.createdAt||"";case"updatedAt":return n.updatedAt||"";default:if(n[t]!==undefined)return n[t];if(n.custom_fields&&n.custom_fields[t]!==undefined){return n.custom_fields[t]}return undefined}}format(e,t={}){const{json:n,raw:s,name:r}=t;if(r){const t=e[r];if(!t){throw new Error(`The state has no output named "${r}".`)}if(s){if(t.value===undefined||t.value===null)return"";if(typeof t.value==="object")return JSON.stringify(t.value);return String(t.value)}if(n){return JSON.stringify({sensitive:Boolean(t.sensitive),type:t.type||typeof t.value,value:t.value},null,2)}return`${r} = ${(0,a.formatHclValue)(t.value,0)}`}if(n){const t={};for(const[n,s]of Object.entries(e)){t[n]={sensitive:Boolean(s.sensitive),type:s.type||(Array.isArray(s.value)?"tuple":typeof s.value),value:s.value}}return JSON.stringify(t,null,2)}const i=[];const o=Object.keys(e).sort();if(o.length===0){return"Warning: No outputs found in the given state."}let c=0;for(const e of o){if(e.length>c)c=e.length}for(const t of o){const n=e[t];const s=" ".repeat(c-t.length);const r=n.sensitive?"(sensitive value)":(0,a.formatHclValue)(n.value,0);i.push(`${t}${s} = ${r}`)}return i.join("\n")}}t.OutputResolver=OutputResolver},5392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Parser=void 0;const s=n(1043);const r=n(3800);const i=n(2853);const o=n(1741);class ReaderParser extends s.BaseParser{filter(e){return e}}class Parser{dir;variables;reader;constructor(e,t){this.dir=e;this.variables=t;this.reader=new ReaderParser(e,t)}content(){return this.reader.content()}filter(e,t,n){let s;switch(n){case"testcase":s=new r.TestcaseParser(this.dir,this.variables);break;case"testrun":s=new i.TestrunParser(this.dir,this.variables);break;case"testplan":s=new o.TestplanParser(this.dir,this.variables);break;default:s=new r.TestcaseParser(this.dir,this.variables)}return s.filter(e,t,n)}}t.Parser=Parser},2721:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.registerPolicy=t.policy=void 0;const s=n(9896);const r=n(6928);const i=n(7016);const o=n(1227);const a=n(1227);class Policy{builtinPolicies={};userPolicies={};disabledPolicies=new Set;resolve(e){const t=Object.values(this.builtinPolicies);const n=Object.values(this.userPolicies);return[...t,...n].filter((t=>t.scope.includes(e)&&!this.disabledPolicies.has(t.id)))}registry(e,t="system"){if(t==="system"){this.builtinPolicies[e.id]=e}if(t==="user"){this.userPolicies[e.id]=e}}enable(e){this.disabledPolicies.delete(e);return true}disable(e){this.disabledPolicies.add(e);return true}isEnabled(e){return!this.disabledPolicies.has(e)}get(e){const t=this.builtinPolicies[e];if(t){return{id:t.id,type:"system",scope:t.scope,description:t.description||"",enabled:this.isEnabled(t.id)}}const n=this.userPolicies[e];if(n){return{id:n.id,type:"user",scope:n.scope,description:n.description||"",enabled:this.isEnabled(n.id)}}return undefined}getAll(){const e=[];for(const t of Object.values(this.builtinPolicies)){e.push({id:t.id,type:"system",scope:t.scope,description:t.description||"",enabled:this.isEnabled(t.id)})}for(const t of Object.values(this.userPolicies)){e.push({id:t.id,type:"user",scope:t.scope,description:t.description||"",enabled:this.isEnabled(t.id)})}return e.sort(((e,t)=>e.id.localeCompare(t.id)))}configure(e){if(!e||typeof e!=="object")return;if(Array.isArray(e.disabled)){for(const t of e.disabled){if(typeof t==="string")this.disable(t.trim())}}if(Array.isArray(e.enabled)){for(const t of e.enabled){if(typeof t==="string")this.enable(t.trim())}}for(const[t,n]of Object.entries(e)){if(t==="disabled"||t==="enabled")continue;if(n===false||n&&typeof n==="object"&&n.enabled===false){this.disable(t)}else if(n===true||n&&typeof n==="object"&&n.enabled===true){this.enable(t)}}}async loadCustomPolicies(e){const t=[(0,r.resolve)(e,".testform","policies"),(0,r.resolve)(e,"policies")];const n=(0,r.resolve)(e,".testform","modules");if((0,s.existsSync)(n)){try{const e=(0,s.readdirSync)(n,{withFileTypes:true});for(const s of e){if(s.isDirectory()){t.push((0,r.resolve)(n,s.name,"policies"));t.push((0,r.resolve)(n,s.name,".testform","policies"))}}}catch{}}const i=[".js",".mjs",".cjs",".ts"];for(const e of t){if(!(0,s.existsSync)(e))continue;try{const t=(0,s.readdirSync)(e,{withFileTypes:true});for(const n of t){if(n.isFile()){const t=(0,r.extname)(n.name).toLowerCase();if(i.includes(t)){const t=(0,r.resolve)(e,n.name);await this.loadPolicyFile(t)}}}}catch{}}}async loadPolicyFile(e){let t;try{t=await n(195)((0,i.pathToFileURL)(e).href)}catch{try{t=require(e)}catch{return}}const s=t?.default||t;if(!s)return;if(s.id&&Array.isArray(s.scope)&&typeof s.action==="function"){this.registry(s,"user");return}if(Array.isArray(s)){for(const e of s){if(e?.id&&Array.isArray(e.scope)&&typeof e.action==="function"){this.registry(e,"user")}}return}if(typeof s==="function"){try{s({registerPolicy:e=>this.registry(e,"user"),policy:this})}catch{}}}scanner(e,t,n=false,s=false){const r=[];const i=this.resolve(t);for(const n of i){try{n.action(e,r,t)}catch(e){const t=e instanceof Error?e.message:"Unknown policy execution error";r.push({id:`policy-runtime-error:${n.id}`,title:`Policy "${n.id}" failed during execution.`,detail:t,uri:"(policy-runtime)"})}}if(n){if(r.length>0){const e={valid:false,error_count:r.length,warning_count:0,diagnostics:r.map((e=>({severity:e.type??"error",summary:e.title,detail:e.detail})))};console.log(JSON.stringify(e,null,2));process.exit(1)}return}if(r.length>0){o.logger.info("Review the violations above and fix them before continuing.",{bold:true});o.logger.info(`${r.length} policy violation${r.length>1?"s":""} found:\n`,{bold:true})}let c=0;for(const e of r){const t=e.type==="warning";if(t)c++;if(t&&s)continue;let n=`on ${e.uri}`;if(e.line!==undefined)n+=` line ${e.line}`;if(e.scenario)n+=`, in scenario "${e.scenario}"`;a.logger.push({type:e.type??"error",title:e.title,detail:[e.detail,n]})}if(c>0&&s){o.logger.warn(`\n${c} warning(s) found. (Details suppressed by -compact-warnings)`)}return r.length>0}}t.policy=new Policy;const registerPolicy=e=>t.policy.registry(e,"user");t.registerPolicy=registerPolicy;t.policy.registry({id:"undeclared-fields",description:"Warns about scenario fields not declared in configuration",scope:["testcase"],action:(e,t,n)=>{for(const n of e){for(const e of n.custom?.policy?.filter((e=>e.type==="undeclared-field"))??[]){t.push({id:"undeclared-field",type:"warning",title:`Value for undeclared field "${e.field}"`,detail:`Field "${e.field}" is not declared in the configuration. Add a "fields" entry to your config.`,uri:n.uri,scenario:n.name,line:n.location})}}}});t.policy.registry({id:"required-fields",description:"Ensures required fields defined in configuration are present",scope:["testcase","testrun","testplan"],action:(e,t,n)=>{for(const n of e){for(const e of n.custom?.policy?.filter((e=>e.type==="required-field"))??[]){t.push({id:"required-field-missing",title:`Required field "${e.field}" is missing`,detail:`Add a step: "field ${e.field} = <value>" to the scenario.`,uri:n.uri,scenario:n.name,line:n.location})}}}});t.policy.registry({id:"required-gherkin",description:"Validates required Gherkin structure and keywords (Given, When, Then)",scope:["testcase"],action:(e,t,n)=>{const s=["scenario","scenario outline"];for(const n of e){if(!n.feature.name||n.feature.name.trim()===""){t.push({id:"feature-name-required",title:"Feature name is required",detail:"Every feature must have a name. Add a descriptive name after 'Feature'.",uri:n.uri,line:n.location})}if(!n.name||n.name.trim()===""){t.push({id:"scenario-name-required",title:"Scenario name is required",detail:"Every scenario must have a name. Add a descriptive name after 'Scenario:' or 'Scenario Outline:'.",uri:n.uri,line:n.location});continue}if(!s.includes(n.keyword.trim().toLowerCase()))continue;const e=[...n.background?.steps??[],...n.steps];const r=[];if(!e.some((e=>e.keyword.trim().toLowerCase()==="given")))r.push("Given");if(!e.some((e=>e.keyword.trim().toLowerCase()==="when")))r.push("When");if(!e.some((e=>e.keyword.trim().toLowerCase()==="then")))r.push("Then");if(r.length>0){t.push({id:"steps-required",title:`Scenario is missing required step types: ${r.join(", ")}.`,detail:"Each scenario must have at least one Given, When, and Then step.",uri:n.uri,scenario:n.name,line:n.location})}}}});t.policy.registry({id:"no-feature-tags",description:"Restricts non-standard tags at the Feature level",scope:["testcase","testrun","testplan"],action:(e,t,n)=>{const s=`@${n}`;const r=new Set;for(const i of e){const e=i.uri??"(unknown)";if(r.has(e))continue;r.add(e);const o=["@testcase","@testrun","@testplan"];const a=[...o];if(i.custom?.identity){a.push(i.custom.identity.toLowerCase())}const c=i.feature?.tags??[];const l=c.filter((e=>!a.includes(e.toLowerCase())));if(l.length>0){t.push({id:"no-feature-tags",title:`Feature-level tags are not allowed in ${e} scope (found: ${l.join(", ")}).`,detail:"Move any tags from Feature: to the individual Scenario level, except for scope tags and identity tags.",uri:e})}const u=c.filter((e=>o.includes(e.toLowerCase())));for(const r of u){if(r.toLowerCase()!==s){t.push({id:"invalid-scope-tag",title:`Mismatched scope: file is tagged as ${r} but is being processed as ${s}.`,detail:`A feature file designed for ${r} cannot be executed in -scope ${n}.`,uri:e})}}}}});t.policy.registry({id:"identity-required",description:"Enforces identity tags (@tc-X, @tr-X, @tp-X)",scope:["testcase","testrun","testplan"],action:(e,t,n)=>{for(const s of e??[]){const e=s.custom?.identity;if(!e||e.trim()===""||e===s.uri){t.push({id:"identity-required",title:n==="testcase"?"Every scenario must have an identity tag matching the configured identity pattern.":"Every feature must have an identity tag matching the configured identity pattern.",detail:n==="testcase"?"Add the identity tag (e.g. @tc-1) to each scenario.":"Add the identity tag (e.g. @tr-1) to the Feature level.",uri:s.uri??"(unknown)",scenario:n==="testcase"?s.name:undefined,line:n==="testcase"?s.location:s.feature?.location??s.location});continue}if(n==="testrun"||n==="testplan"){const r=s.feature?.tags??[];const i=r.some((t=>t.toLowerCase()===e.toLowerCase()));if(!i){t.push({id:"identity-feature-level-required",title:`The identity tag ${e} must be declared at the Feature level.`,detail:`Move the identity tag ${e} so it is placed next to the @${n} tag before the 'Feature:' keyword.`,uri:s.uri??"(unknown)",line:s.feature?.location??s.location})}}}}});t.policy.registry({id:"identity-unique",description:"Verifies identity tag uniqueness within scope",scope:["testcase","testrun","testplan"],action:(e,t,n)=>{const s=new Map;for(const t of e){const e=t.custom?.identity?.trim();if(!e)continue;if(e===t.uri)continue;const r={scenario:t.name,line:t.location,keyword:t.keyword||"",uri:t.uri||""};const i=n==="testcase"?`${t.uri}.${e}`:e;const o=s.get(i);if(o){o.push(r)}else{s.set(i,[r])}}for(const[r,i]of s){if(i.length<=1)continue;const s=r.lastIndexOf(".");const o=s!==-1?r.slice(s+1):r;const a=i.every((e=>(e.keyword||"").trim()==="Scenario Outline"))&&i.every((e=>e.line===i[0].line&&e.uri===i[0].uri));if(a){t.push({id:"unique-key-required",title:`Scenario Outline expanded ${i.length} rows but all share the same identity "${o}".`,detail:"Add a <key> inside the identity tag (e.g. @tc-<key>) so each expanded row has a unique identity.",uri:i[0].uri,scenario:i[0].scenario,line:i[0].line});continue}for(const s of i){let r="";const i=o.match(/^(@[a-zA-Z0-9-]+?)-?(\d+)(.*)$/);if(i){const t=i[1]+(o.includes("-")?"-":"");const a=i[3];let c=0;for(const r of e){if(n==="testcase"&&r.uri!==s.uri)continue;const e=r.custom?.identity?.trim();if(e&&e!==r.uri){const n=e.match(new RegExp(`^${t}(\\d+)${a}$`));if(n){const e=parseInt(n[1],10);if(e>c)c=e}}}if(c>0){r=` The next available identity ${n==="testcase"?"in this file ":""}is ${t}${c+1}${a}.`}}t.push({id:"identity-unique",title:n==="testcase"?`Duplicate identity "${o}" found in the same file.`:`Duplicate identity "${o}" found.`,detail:(n==="testcase"?"Each scenario within a file must have a unique identity tag.":"Each element must have a globally unique identity tag in the workspace.")+r,uri:s.uri,scenario:s.scenario,line:s.line})}}}});t.policy.registry({id:"duplicate-testruns-in-testplan",description:"Prevents duplicate testruns inside the same or across testplans",scope:["testplan"],action:(e,t,n)=>{const s=new Map;for(const n of e){const e=n.custom?.testruns||[];const r=new Set;const i=new Set;for(const t of e){if(r.has(t)){i.add(t)}else{r.add(t)}const e=t.trim();const o={uri:n.uri,scenario:n.name,line:n.location};if(!s.has(e)){s.set(e,[])}s.get(e).push(o)}if(i.size>0){t.push({id:"duplicate-testruns-in-testplan",title:`Duplicate testruns defined in the same testplan: ${Array.from(i).join(", ")}`,detail:`Remove the duplicate Rule declarations from this testplan.`,uri:n.uri,scenario:n.name,line:n.location})}}for(const[e,n]of s){if(n.length>1){const s=new Set(n.map((e=>e.uri)));if(s.size>1){for(const r of n){const n=Array.from(s).filter((e=>e!==r.uri));t.push({id:"duplicate-testruns-across-testplans",title:`Testrun "${e}" is declared in multiple testplans`,detail:`This testrun is also declared in: ${n.join(", ")}. A testrun should only belong to one testplan.`,uri:r.uri,scenario:r.scenario,line:r.line})}}}}}})},5301:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.askConfirmation=askConfirmation;t.askApproval=askApproval;t.askDestroyApproval=askDestroyApproval;t.askMigrationApproval=askMigrationApproval;t.isInteractive=isInteractive;t.askInput=askInput;t.askBackendAttribute=askBackendAttribute;t.askSelect=askSelect;t.askStatus=askStatus;const s=n(3785);const r=n(465);const i=n(6028);async function askConfirmation(e){const t=(0,s.createInterface)({input:process.stdin,output:process.stdout});return new Promise((n=>{console.log("");for(const t of e){console.log(t)}console.log(` ${i.MSG_APPROVE_ONLY_YES}`);console.log("");t.question(" Enter a value: ",(e=>{t.close();console.log("");n(e.trim().toLowerCase()==="yes")}))}))}async function askApproval(){return askConfirmation(["Do you want to perform these actions?",` ${i.TITLE_APP} will perform the actions described above.`])}async function askDestroyApproval(e,t){const n=t?` in scope '${t}'`:"";return askConfirmation([(0,r.red)((0,r.bold)(`${i.TITLE_APP} will destroy ${e} resource(s)${n}.`))," This action cannot be undone."])}async function askMigrationApproval(e){const t=(0,s.createInterface)({input:process.stdin,output:process.stdout});return new Promise((n=>{console.log("");console.log((0,r.bold)("Do you want to copy existing state to the new backend?"));console.log(" Pre-existing state was found while migrating the previous");console.log(` backend to the newly configured "${e}" backend.`);console.log(" Do you want to copy this state to the new backend?");console.log(' Enter "yes" to copy and "no" to start with an empty state.');console.log("");t.question(" Enter a value: ",(e=>{t.close();console.log("");n(e.trim().toLowerCase()==="yes")}))}))}function isInteractive(){return Boolean(process.stdin.isTTY&&!process.env.CI)}async function askInput(e,t){const n=(0,s.createInterface)({input:process.stdin,output:process.stdout});const r=t?`${e} [${t}]: `:`${e}: `;return new Promise((e=>{n.question(` ${r}`,(s=>{n.close();const r=s.trim();e(r||t||"")}))}))}async function askBackendAttribute(e,t){const n=(0,s.createInterface)({input:process.stdin,output:process.stdout});return new Promise((s=>{console.log(e);console.log(` ${t}`);console.log("");n.question(" Enter a value: ",(e=>{n.close();console.log("");s(e.trim())}))}))}async function askSelect(e,t){console.log(`\n${(0,r.bold)(e)}`);t.forEach(((e,t)=>{console.log(` ${(0,r.bold)(`${t+1}.`)} ${e.label}`)}));console.log("");const n=(0,s.createInterface)({input:process.stdin,output:process.stdout});return new Promise((e=>{const ask=()=>{n.question(` Select an option (1-${t.length}): `,(s=>{const r=parseInt(s.trim(),10);if(r>=1&&r<=t.length){n.close();e(t[r-1].value)}else{console.log(` Invalid option. Please enter a number between 1 and ${t.length}.`);ask()}}))};ask()}))}async function askStatus(e="passed"){return askSelect("Select the status:",[{label:"passed - Prueba ejecutada con éxito",value:"passed"},{label:"failed - Prueba fallida",value:"failed"},{label:"pending - Pendiente de ejecución",value:"pending"},{label:"skipped - Prueba omitida",value:"skipped"}])}},363:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.StateQuery=void 0;const s=n(7066);const r=n(2978);const i=n(7442);class StateQuery{dir;statePath;backupPath;stateObj;initialized=false;allResources=[];normalizedItems=[];constructor(e=".",t,n){this.dir=e;this.statePath=t;this.backupPath=n;this.stateObj=new s.State(this.dir,this.statePath,this.backupPath)}async init(){if(this.initialized)return;await this.stateObj.init();const e=this.stateObj.getState?this.stateObj.getState():null;if(e&&Array.isArray(e.resources)){this.allResources=e.resources}else if(typeof this.stateObj.getResources==="function"){const e=[...this.stateObj.getResources("github_testcase")||[],...this.stateObj.getResources("testcase")||[],...this.stateObj.getResources("github_testrun")||[],...this.stateObj.getResources("testrun")||[],...this.stateObj.getResources("github_testplan")||[],...this.stateObj.getResources("testplan")||[],...this.stateObj.getResources()||[]];const t=new Set;this.allResources=e.filter((e=>{if(!e||!e.identity||t.has(e.identity))return false;t.add(e.identity);return true}))}this.normalize();this.initialized=true}getResources(){return this.allResources}getItems(){return this.normalizedItems}getCanonicalScope(e){if(e.includes("_"))return e.split("_").slice(1).join("_");return e}normalize(){const e=this.allResources.filter((e=>this.getCanonicalScope(e.type)==="testrun"));const t=this.allResources.filter((e=>this.getCanonicalScope(e.type)==="testcase"));const n=this.allResources.filter((e=>this.getCanonicalScope(e.type)==="testplan"));const s=new Map;for(const t of e){const e=t.attributes.testcases||t.attributes.testcaseStatuses||{};for(const[n,r]of Object.entries(e)){if(!s.has(n)){s.set(n,[])}s.get(n).push({status:r,testRunId:t.identity})}}const r=[];const i=new Set;for(const[e,n]of s.entries()){const s=t.find((t=>t.identity===e));if(!s)continue;i.add(e);for(const e of n){r.push(this.toQueryItem(s,e.status,e.testRunId))}}for(const e of t){if(!i.has(e.identity)){r.push(this.toQueryItem(e,String(e.attributes.status||"unexecuted"),""))}}for(const t of[...e,...n]){const e=this.getCanonicalScope(t.type);const n=t.attributes.status?String(t.attributes.status):t.attributes.issueNumber?"active":"unexecuted";r.push(this.toQueryItem(t,n,e==="testrun"?t.identity:""))}this.normalizedItems=r}filterByTarget(e,t){if(!e)return t?[...t]:[...this.normalizedItems];const n=t?[...t]:[...this.normalizedItems];const s=(Array.isArray(e)?e:[e]).map((e=>typeof e==="string"?e.trim():"")).filter(Boolean);if(s.length===0)return n;const r=new Set;const o=new Set;for(const e of s){const t=this.allResources.filter((t=>(0,i.matchesTarget)(t.identity,e)));for(const e of t){const t=this.getCanonicalScope(e.type);if(t==="testplan"){r.add(e.identity);const t=e.attributes.testruns||[];for(const e of t){const t=this.allResources.filter((t=>this.getCanonicalScope(t.type)==="testrun"&&((0,i.matchesTarget)(t.identity,e)||t.identity.endsWith(e))));for(const e of t){o.add(e.identity);r.add(e.identity)}o.add(e)}}else if(t==="testrun"){o.add(e.identity);r.add(e.identity)}else{r.add(e.identity)}}if(e.startsWith("@tr-")||e.includes(".run.feature")){o.add(e)}}return n.filter((e=>{if(r.has(e.id))return true;if(s.some((t=>(0,i.matchesTarget)(e.id,t))))return true;if(e.testRunId){if(o.has(e.testRunId))return true;if(Array.from(o).some((t=>e.testRunId.endsWith(t)||t.endsWith(e.testRunId))))return true;if(s.some((t=>(0,i.matchesTarget)(e.testRunId,t))))return true}return false}))}toQueryItem(e,t,n){const s=this.getCanonicalScope(e.type);const r=e.attributes.custom_fields||{};const i={};for(const[e,t]of Object.entries(r)){i[e.toLowerCase()]=String(t)}const o=Array.isArray(e.attributes.labels)?e.attributes.labels.map(String):e.attributes.labels?String(e.attributes.labels).split(","):[];const a=Array.isArray(e.attributes.assignees)?e.attributes.assignees.map(String):e.attributes.assignees?String(e.attributes.assignees).split(","):[];return{id:e.identity,type:e.type,canonicalScope:s,title:String(e.attributes.title||""),status:t||"unexecuted",issueNumber:e.attributes.issueNumber,remoteId:e.attributes.remoteId,labels:o,assignees:a,milestone:e.attributes.milestone?String(e.attributes.milestone):undefined,testRunId:n||undefined,custom_fields:i,createdAt:String(e.attributes.createdAt||e.lastApplied||(new Date).toISOString()),updatedAt:String(e.attributes.updatedAt||e.lastApplied||(new Date).toISOString()),lastApplied:e.lastApplied,tainted:Boolean(e.tainted),originalResource:e}}filter(e=[],t){let n=t?[...t]:[...this.normalizedItems];const s=Array.isArray(e)?e:[e];for(const e of s){if(!e||typeof e!=="string")continue;const t=e.trim();if(!t)continue;const s=t.indexOf("=");if(s!==-1){const e=t.slice(0,s).trim().toLowerCase();const i=t.slice(s+1).trim().toLowerCase();if(!e||!i)continue;if(e==="scope"){n=n.filter((e=>e.canonicalScope===i||e.type.toLowerCase().includes(i)))}else if(e==="status"){n=n.filter((e=>e.status.toLowerCase()===i))}else if(e==="label"||e==="tag"||e==="labels"||e==="tags"){const e=i.startsWith("@")?i.slice(1):i;n=n.filter((t=>t.labels.some((t=>{const n=t.startsWith("@")?t.slice(1).toLowerCase():t.toLowerCase();return n===e}))))}else if(e==="assignee"||e==="assignees"){n=n.filter((e=>e.assignees.some((e=>e.toLowerCase().includes(i)))))}else if(e==="milestone"){n=n.filter((e=>e.milestone&&e.milestone.toLowerCase().includes(i)))}else if(e==="testrun"||e==="testrunid"){n=n.filter((e=>e.testRunId&&e.testRunId.toLowerCase().includes(i)))}else if(e==="search"){n=n.filter((e=>e.id.toLowerCase().includes(i)||e.title.toLowerCase().includes(i)||e.labels.some((e=>e.toLowerCase().includes(i)))))}else{n=n.filter((t=>{const n=t.custom_fields[e];if(n!==undefined&&n.toLowerCase()===i){return true}const s=(0,r.resolvePath)(t.originalResource,e)??(0,r.resolvePath)(t.originalResource,`attributes.${e}`);if(s!==undefined&&String(s).toLowerCase()===i){return true}return false}))}}else{const e=t.toLowerCase();n=n.filter((t=>t.id.toLowerCase().includes(e)||t.title.toLowerCase().includes(e)||t.labels.some((t=>t.toLowerCase().includes(e)))))}}return n}group(e,t){if(!t)return{all:e};const n={};const s=t.trim().toLowerCase();for(const t of e){let e="";if(s==="status"){e=t.status}else if(s==="label"||s==="labels"||s==="tags"||s==="tag"){if(t.labels.length===0){e="untagged";if(!n[e])n[e]=[];n[e].push(t);continue}for(const e of t.labels){if(!n[e])n[e]=[];n[e].push(t)}continue}else if(s==="assignee"||s==="assignees"){e=t.assignees[0]||"unassigned"}else if(s==="milestone"){e=t.milestone||"none"}else if(s==="feature"||s==="requirement"){e=t.id.includes(".")?t.id.slice(0,t.id.lastIndexOf(".")):t.id}else if(s==="testrun"||s==="testrunid"){e=t.testRunId||"none"}else{e=t.custom_fields[s]||String((0,r.resolvePath)(t.originalResource,s)??(0,r.resolvePath)(t.originalResource,`attributes.${s}`)??"other")}if(!n[e])n[e]=[];n[e].push(t)}return n}getStats(e){const t={total:0,passed:0,failed:0,pending:0,blocked:0,skipped:0,unexecuted:0,totalRuns:0,activeRuns:0,closedRuns:0,totalPlans:0};const n=e.filter((e=>e.canonicalScope==="testcase"));const s=new Set(e.filter((e=>e.canonicalScope==="testrun")).map((e=>e.id)).concat(e.map((e=>e.testRunId)).filter(Boolean)));const r=new Set(e.filter((e=>e.canonicalScope==="testplan")).map((e=>e.id)));const i=this.allResources.filter((e=>this.getCanonicalScope(e.type)==="testrun"));const o=this.allResources.filter((e=>this.getCanonicalScope(e.type)==="testplan"));const a=s.size>0?i.filter((e=>s.has(e.identity)||Array.from(s).some((t=>e.identity.endsWith(t)||t.endsWith(e.identity))))):i;const c=r.size>0?o.filter((e=>r.has(e.identity))):o;t.total=n.length;for(const e of n){const n=e.status.toLowerCase();if(n==="passed")t.passed++;else if(n==="failed")t.failed++;else if(n==="pending")t.pending++;else if(n==="blocked")t.blocked++;else if(n==="skipped")t.skipped++;else t.unexecuted++}t.totalRuns=a.length;t.activeRuns=a.filter((e=>e.attributes.state==="open"||e.attributes.status==="open")).length;t.closedRuns=a.filter((e=>e.attributes.state==="closed"||e.attributes.status==="closed")).length;t.totalPlans=c.length;return t}}t.StateQuery=StateQuery},7862:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.registerResource=t.resource=void 0;const s=n(9896);const r=n(6928);const i=n(7016);const o=n(6028);const a=n(1227);const c=n(465);const l=n(2978);const u=n(5124);const d=n(8567);class Resource{builtinTemplates=Object.create(null);userTemplates=Object.create(null);resolve(){const e={...this.builtinTemplates,...this.userTemplates};return Object.values(e)}findTemplate(e){const t=this.resolve();let n=t.find((t=>t.type===e));if(!n&&e.includes("_")){const s=e.split("_").slice(1).join("_");n=t.find((e=>e.type===s||e.type.endsWith(`_${s}`)))}if(!n){n=t.find((t=>t.type.endsWith(`_${e}`)))}return n}get(e){const t=this.findTemplate(e);if(!t){const t=this.resolve();a.logger.push({type:"error",title:`Unknown resource type: "${e}"`,detail:[`No template is registered for resource type "${e}".`,`Available types: ${t.map((e=>e.type)).join(", ")||"(none)"}`],close:true})}return t}getRegisteredTypes(){const e=new Set;for(const t of this.resolve()){e.add(t.type);if(t.type.includes("_")){e.add(t.type.split("_").slice(1).join("_"))}}return Array.from(e)}registry(e,t="system"){if(t==="system"){this.builtinTemplates[e.type]=e;return}if(t==="user"){const t=this.findTemplate(e.type);if(t){const n=t.fields||[];const s=new Map(n.map((e=>[e.name,e])));for(const t of e.fields||[]){s.set(t.name,t)}const r={...t,...e,fields:Array.from(s.values())};this.userTemplates[e.type]=r;if(t.type!==e.type){this.userTemplates[t.type]=r}}else{this.userTemplates[e.type]=e}return}}async loadCustomResources(e){const t=[(0,r.resolve)(e,".testform","resources"),(0,r.resolve)(e,"resources")];const n=(0,r.resolve)(e,".testform","modules");if((0,s.existsSync)(n)){try{const e=(0,s.readdirSync)(n,{withFileTypes:true});for(const s of e){if(s.isDirectory()){t.push((0,r.resolve)(n,s.name,"resources"));t.push((0,r.resolve)(n,s.name,".testform","resources"))}}}catch{}}const i=[".js",".mjs",".cjs",".ts"];for(const e of t){if(!(0,s.existsSync)(e))continue;try{const t=(0,s.readdirSync)(e,{withFileTypes:true});for(const n of t){if(n.isFile()){const t=(0,r.extname)(n.name).toLowerCase();if(i.includes(t)){const t=(0,r.resolve)(e,n.name);await this.loadResourceFile(t)}}}}catch{}}}async loadResourceFile(e){let t;try{t=await n(195)((0,i.pathToFileURL)(e).href)}catch{try{t=require(e)}catch{return}}const s=t?.default||t;if(!s)return;if(s.type&&Array.isArray(s.fields)){this.registry(s,"user");return}if(Array.isArray(s)){for(const e of s){if(e?.type&&Array.isArray(e.fields)){this.registry(e,"user")}}return}if(typeof s==="function"){try{s({registerResource:e=>this.registry(e,"user"),resource:this})}catch{}}}evaluate(e,t,n){const s=this.get(e);const r={};for(const e of s.fields){if(e.knownAfterApply)continue;r[e.name]=typeof e.value==="function"?e.value(t,n):e.value}return r}hasFieldChanges(e,t,n,s){const r=this.get(e);for(const e of r.fields){if(e.knownAfterApply)return true;const r=typeof e.value==="function"?e.value(t,s):e.value;const i=n?n[e.name]:undefined;if(r===undefined&&i===undefined)continue;if(e.name==="milestone"&&!r&&!i)continue;if(typeof r==="object"&&r!==null&&!Array.isArray(r)){const t=i&&typeof i==="object"&&!Array.isArray(i)?i:{};const n=new Set([...Object.keys(t),...Object.keys(r)]);for(const s of n){const n=t[s];const i=r[s];if(n===undefined&&i===undefined)continue;if(e.name==="custom_fields"){const e=String(n??"").replace(/^@/,"").toLowerCase().trim();const t=String(i??"").replace(/^@/,"").toLowerCase().trim();if(e!==t){return true}}else if(JSON.stringify(n)!==JSON.stringify(i)){return true}}}else if(Array.isArray(r)){const e=Array.isArray(i)?i:i?[i]:[];if(!(0,u.arraysEqual)(r,e))return true}else{const e=String(r??"").replace(/\r\n/g,"\n").trim();const t=String(i??"").replace(/\r\n/g,"\n").trim();if(e!==t){return true}}}return false}evaluateComments(e,t,n){const s=this.get(e);if(s.comments){return s.comments(t,n)}return[]}getSymbol(e){const t={add:(0,c.green)("+"),change:(0,c.yellow)("~"),destroy:(0,c.red)("-"),replace:`${(0,c.red)("-")}/${(0,c.green)("+")}`}[e];return t}getSymbols(e){const t=new Set(e.map((e=>e.action)));const n={add:`${(0,c.green)("+")} create`,change:`${(0,c.yellow)("~")} update in-place`,destroy:`${(0,c.red)("-")} destroy`,replace:`${(0,c.red)("-")}/${(0,c.green)("+")} destroy and then create replacement`};const s=[];if(t.has("add"))s.push(n.add);if(t.has("change"))s.push(n.change);if(t.has("destroy"))s.push(n.destroy);if(t.has("replace"))s.push(n.replace);return s.map((e=>` ${e}`)).join("\n")}format(e,t){const{action:n,scenario:s,resourceType:r,identity:i,oldAttributes:o}=e;const a=[];const d=this.get(r);const f=this.getSymbol(n);const pad=e=>e.padEnd(16);a.push(` ${f} resource "${r}" "${(0,l.formatIdentityDisplay)(i)}" {`);for(const e of d.fields){const r=typeof e.value==="function"?e.value(s,t):e.value;const i=o?o[e.name]:undefined;if(r===undefined&&i===undefined)continue;if(e.name==="milestone"&&!r&&!i)continue;let d="";let p=false;if(e.knownAfterApply){d="(known after apply)";p=true}else if(typeof r==="object"&&r!==null&&!Array.isArray(r)){let t=i;if(!t||typeof t!=="object"||Array.isArray(t)){t=n==="destroy"?i:{}}const s=n==="change"||n==="add"||n==="replace";if(s&&t&&typeof t==="object"&&!Array.isArray(t)){const s=Array.from(new Set([...Object.keys(t),...Object.keys(r)])).sort();const i=[];i.push("{");for(const o of s){const s=t[o];const a=r[o];const u=`"${o}"`;if(n==="add"){const e=(0,l.formatHclValue)(a,2).trimStart();i.push(` ${(0,c.green)("+")} ${u}: ${e}`);p=true}else if(s===undefined){const e=(0,l.formatHclValue)(a,2).trimStart();i.push(` ${(0,c.green)("+")} ${u}: ${e}`);p=true}else if(a===undefined){const e=(0,l.formatHclValue)(s,2).trimStart();i.push(` ${(0,c.red)("-")} ${u}: ${e}`);p=true}else{let t=JSON.stringify(s)!==JSON.stringify(a);if(e.name==="custom_fields"){const e=String(s??"").replace(/^@/,"").toLowerCase().trim();const n=String(a??"").replace(/^@/,"").toLowerCase().trim();t=e!==n}if(t){const e=(0,l.formatHclValue)(s,2).trimStart();const t=(0,l.formatHclValue)(a,2).trimStart();i.push(` ${(0,c.yellow)("~")} ${u}: ${e} -> ${t}`);p=true}else{const e=(0,l.formatHclValue)(s,2).trimStart();i.push(` ${u}: ${e}`)}}}i.push(" }");d=i.join("\n")}else{const e=(0,l.formatHclValue)(r,2).split("\n");d=e.map(((e,t)=>t===0?e.trimStart():e)).join("\n");p=true}}else if(Array.isArray(r)){const e=(0,l.formatHclValue)(r,2).split("\n");d=e.map(((e,t)=>t===0?e.trimStart():e)).join("\n");if(n==="change"){const e=Array.isArray(i)?i:i?[i]:[];p=!(0,u.arraysEqual)(r,e)}else{p=true}}else if(typeof r==="string"&&r.includes("\n")){const e=(0,l.formatHclValue)(r,2).split("\n");d=e.map(((e,t)=>t===0?e.trimStart():e)).join("\n");if(n==="change"){const e=r.replace(/\r\n/g,"\n").trim();const t=String(i??"").replace(/\r\n/g,"\n").trim();p=e!==t}else{p=true}}else{const e=String(r??"").replace(/\r\n/g,"\n").trim();const t=String(i??"").replace(/\r\n/g,"\n").trim();if(n==="change"&&e!==t&&i!==undefined){d=`"${i}" -> "${r}"`;p=true}else{d=`"${r}"`;if(n==="change"){p=e!==t}else{p=true}}}if(n==="add"||n==="replace"){a.push(` ${f} ${pad(e.name)}= ${d}`)}else if(n==="change"){if(e.knownAfterApply){a.push(` ${pad(e.name)}= ${d}`)}else if(p){a.push(` ${f} ${pad(e.name)}= ${d}`)}else{a.push(` ${pad(e.name)}= ${d}`)}}else if(n==="destroy"){a.push(` ${f} ${pad(e.name)}= ${d} -> null`)}}a.push(" }");return a.join("\n")}summary(e,t=true,n){const s=[];if(e.length===0){s.push("No changes. Your test matches the configuration.");if(!t){s.push("");s.push(`${o.TITLE_APP} has compared your real test against your configuration and found no differences, so no`);s.push("changes are needed.");s.push("");s.push((0,c.green)("Apply complete! Resources: 0 added, 0 changed, 0 destroyed."))}console.log(s.join("\n"));return}s.push(`${o.TITLE_APP} used the selected providers to generate the following execution plan. Resource actions are indicated with the`);s.push("following symbols:");s.push(this.getSymbols(e));s.push("");s.push(`${o.TITLE_APP} will perform the following actions:`);s.push("");for(const t of e){const e=(0,l.formatResourceAddress)(t.resourceType,t.identity);const r=t.action==="add"?(0,c.bold)((0,c.green)(`# ${e} will be created`)):t.action==="change"?(0,c.bold)((0,c.yellow)(`# ${e} will be updated in-place`)):t.action==="replace"?(0,c.bold)((0,c.red)(`# ${e} must be replaced`)):(0,c.bold)((0,c.red)(`# ${e} will be destroyed`));s.push(` ${r}`);if(t.action==="destroy"){s.push(` # (because ${e} is not in configuration)`)}s.push(this.format(t,n));s.push("")}const r=e.filter((e=>e.action==="add")).length;const i=e.filter((e=>e.action==="change")).length;const a=e.filter((e=>e.action==="destroy")).length;const u=e.filter((e=>e.action==="replace")).length;s.push(`${(0,c.bold)("Plan:")} ${r+u} to add, ${i} to change, ${a+u} to destroy.`);s.push("");if(t){s.push((0,c.dim)("─".repeat(108)));s.push("");if(!n?.outPath){s.push(`Note: You didn't use the -out option to save this plan, so ${o.TITLE_APP} can't guarantee to take exactly these`);s.push(`actions if you run "${o.TITLE_CLI} apply" now.`)}}console.log(s.join("\n"))}}t.resource=new Resource;const registerResource=e=>t.resource.registry(e,"user");t.registerResource=registerResource;t.resource.registry({type:"github_testcase",fields:[{name:"title",value:e=>e.name},{name:"body",value:e=>"```gherkin\n"+e.steps.map((e=>`${e.keyword}${e.text}`)).join("\n")+"\n```"},{name:"labels",value:e=>{const t=e.custom?.identity?.startsWith("@")?e.custom.identity.substring(1):e.custom?.identity;return[...new Set([...e.tags||[]].map(String).map((e=>e.startsWith("@")?e.substring(1):e)).filter((e=>e!==t)))]}},{name:"assignees",value:e=>(e.custom?.fields?.assignees||"").split(",").map((e=>e.trim().replace(/^@/,""))).filter(Boolean)},{name:"milestone",value:e=>e.custom?.fields?.milestone||undefined},{name:"custom_fields",value:e=>{const t={...e.custom?.fields||{}};delete t["labels"];delete t["assignees"];delete t["milestone"];delete t["status"];return t}}]});t.resource.registry({type:"github_testrun",fields:[{name:"title",value:e=>e.feature?.name||""},{name:"body",value:(e,t)=>{let n=e.feature?.description||"### 🚀 Test Run Execution\n\nThis issue serves as the central hub for tracking the execution of this Test Run. All associated test cases are linked below as tasks.\n\n**Instructions:**\n- Execution results for each test case will be recorded dynamically as comments on this issue.\n- Click on individual test case links to view their details or attach evidence.";const s=e.custom?.testcases||[];if(s.length>0&&t?.state){const i=t.state;const o=e.custom?.identity&&e.custom.identity!==e.uri?`${e.uri}.${e.custom.identity}`:e.uri;const a=i.getResources("github_testrun").find((e=>e.identity===o));const c=a?.attributes?.testcases||a?.attributes?.testcaseStatuses||{};const l=[...s].sort(((e,t)=>{const n=e.split(".").pop()?.replace("@","")||"";const s=t.split(".").pop()?.replace("@","")||"";return n.localeCompare(s,undefined,{numeric:true,sensitivity:"base"})}));const u=[];const d=[];for(const e of l){const n=e.split(".");const s=n.pop()||"";const o=n.join(".");const a=o.replace(".case.feature","").replace(".feature","").replace(/\\/g,"/");const c=(0,r.basename)(a);const l=s.replace(/^@/,"").toLowerCase();const f=i.getResources("github_testcase").filter((e=>{const t=(e.identity||"").replace(/\\/g,"/");const n=t.split(".").pop()?.replace(/^@/,"").toLowerCase();const r=t.includes(a)||t.includes(c);if(!r)return false;if(l==="*"||n===l)return true;const i=(e.attributes?.title||"").toLowerCase();if(i&&(i===l||i===s.toLowerCase()))return true;return false}));const p=new Set(f.map((e=>{const t=(e.identity||"").replace(/\\/g,"/");const n=t.lastIndexOf(".");return n!==-1?t.slice(0,n):t})));let h=f;if(p.size>1){if(t?.testDirectory){const e=t.testDirectory.replace(/^\.\//,"").replace(/\\/g,"/");h=f.filter((t=>(t.identity||"").replace(/\\/g,"/").startsWith(e)));const n=new Set(h.map((e=>{const t=(e.identity||"").replace(/\\/g,"/");const n=t.lastIndexOf(".");return n!==-1?t.slice(0,n):t})));if(n.size>1){throw new Error(`Multiple testcases found for rule "${o}". Please specify a more exact path or use -test-directory to limit the scope.`)}}else{throw new Error(`Multiple testcases found for rule "${o}". Please specify a more exact path or use -test-directory to limit the scope.`)}}if(h.length>0){u.push(...h)}else{d.push(e)}}const f=new Map;for(const e of u){if(!f.has(e.identity)){f.set(e.identity,e)}}const p=Array.from(f.values());p.sort(((e,t)=>{const n=e.identity.split(".").pop()?.replace("@","")||"";const s=t.identity.split(".").pop()?.replace("@","")||"";return n.localeCompare(s,undefined,{numeric:true,sensitivity:"base"})}));const h=new Map;for(const e of p){const t=(e.identity||"").replace(/\\/g,"/");const n=t.lastIndexOf(".");const s=n!==-1?t.slice(0,n):t;const i=(0,r.basename)(s||"");if(!h.has(i)){h.set(i,[])}h.get(i).push(e)}for(const[t,s]of h.entries()){n+=`\n\n**Origin:** ${t}\n`;for(const t of s){const s=t.identity;const i=(s||"").replace(/\\/g,"/");const o=i.split(".").pop()||"";const a=o.replace(/^@/,"").toLowerCase();const l=o.replace(/^@/,"")||"";let u=e.custom?.groupScenarios?.find((e=>{if(!e.rule||!e.name)return false;const t=e.rule.name.replace(".case.feature","").replace(".feature","").replace(/\\/g,"/");const n=e.name.replace(/^@/,"").toLowerCase();const s=i.includes(t)||i.includes((0,r.basename)(t));return s&&(a===n||n==="*")}));if(!u){u=e.custom?.groupScenarios?.find((e=>{if(!e.rule||!e.name)return false;const t=e.rule.name.replace(".case.feature","").replace(".feature","").replace(/\\/g,"/");const n=i.includes(t)||i.includes((0,r.basename)(t));return n&&e.name==="*"}))}const d=u?.custom?.fields?.status||c[s]||c[i]||"pending";const f=d==="passed"?"[x]":"[ ]";if(t?.attributes?.issueNumber){n+=`- ${f} ${l}: #${t.attributes.issueNumber}\n`}else{n+=`- ${f} ${l}: (known after apply) - ${s}\n`}}}if(d.length>0){n+=`\n\n**Not Found in State**\n`;for(const e of d){const t=e.split(".").pop()?.replace("@","")||"";n+=`- [ ] ${t}: (not found in state) - ${e}\n`}}}return n.trim()}},{name:"labels",value:e=>{const t=e.custom?.identity?.startsWith("@")?e.custom.identity.substring(1):e.custom?.identity;return[...new Set([...e.tags||[]].map(String).map((e=>e.startsWith("@")?e.substring(1):e)).filter((e=>e!==t)))]}},{name:"assignees",value:e=>(e.custom?.fields?.assignees||"").split(",").map((e=>e.trim().replace(/^@/,""))).filter(Boolean)},{name:"milestone",value:e=>e.custom?.fields?.milestone||undefined},{name:"custom_fields",value:e=>{const t={...e.custom?.fields||{}};delete t["labels"];delete t["assignees"];delete t["milestone"];delete t["status"];return t}},{name:"status",value:e=>{const t=e.custom?.groupScenarios||[];const n=t.map((e=>e.custom?.fields?.status||"pending"));return(0,l.calculateRollupVerdict)(n)}},{name:"testcases",value:e=>{const t=e.custom?.groupScenarios||[];const n={};for(const e of t){if(e.rule?.name&&e.name){const t=`${e.rule.name}.${e.name}`.replace(/\\/g,"/");n[t]=e.custom?.fields?.status||"pending"}}return n}},{name:"metadata",value:e=>e.custom?.metadata||{}}],comments:()=>[]});t.resource.registry({type:"github_testplan",fields:[{name:"title",value:e=>e.feature?.name||""},{name:"body",value:(e,t)=>(0,d.buildGitHubTestplanBody)(e,t)},{name:"labels",value:e=>{const t=e.custom?.identity?.startsWith("@")?e.custom.identity.substring(1):e.custom?.identity;return[...new Set([...e.tags||[]].map(String).map((e=>e.startsWith("@")?e.substring(1):e)).filter((e=>e!==t)))]}},{name:"assignees",value:e=>(e.custom?.fields?.assignees||"").split(",").map((e=>e.trim().replace(/^@/,""))).filter(Boolean)},{name:"milestone",value:e=>e.custom?.fields?.milestone||undefined},{name:"custom_fields",value:e=>{const t={...e.custom?.fields||{}};delete t["labels"];delete t["assignees"];delete t["milestone"];delete t["status"];return t}},{name:"status",value:(e,t)=>{const n=e.custom?.testruns||[];const s=t?.state;if(!s||n.length===0)return"pending";const i=[];for(const e of n){const t=String(e).replace(/\\/g,"/");const n=t.endsWith(".run.feature")?t:t+".run.feature";const o=(0,r.basename)(n);const a=s.getResources("github_testrun").find((e=>{const n=(e.identity||"").replace(/\\/g,"/");const s=n.lastIndexOf(".");const r=s!==-1?n.slice(0,s):n;return r.endsWith(t)||n.endsWith(t)||r.endsWith(o)||r===t}));i.push(a?.attributes?.status||"pending")}return(0,l.calculateRollupVerdict)(i)}},{name:"testruns",value:(e,t)=>{const n=e.custom?.testruns||[];const s={};const i=t?.state;for(const e of n){const t=String(e).replace(/\\/g,"/");let n="pending";if(i){const e=t.endsWith(".run.feature")?t:t+".run.feature";const s=(0,r.basename)(e);const o=i.getResources("github_testrun").find((e=>{const n=(e.identity||"").replace(/\\/g,"/");const r=n.lastIndexOf(".");const i=r!==-1?n.slice(0,r):n;return i.endsWith(t)||n.endsWith(t)||i.endsWith(s)||i===t}));if(o?.attributes?.status){n=o.attributes.status}}s[t]=n}return s}},{name:"metadata",value:e=>e.custom?.metadata||{}}]})},7442:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.matchesScope=matchesScope;t.detectScopeFromTarget=detectScopeFromTarget;t.matchesTarget=matchesTarget;t.parseSpec=parseSpec;t.matchesFeatureFile=matchesFeatureFile;t.matchesScenarioSpec=matchesScenarioSpec;t.matchesStateKey=matchesStateKey;t.resolveTargetScenario=resolveTargetScenario;t.promptTargetSuite=promptTargetSuite;const s=n(6928);const r=n(6028);const i=n(5392);const o=n(4489);const a=n(3912);const c=n(5301);function matchesScope(e,t,n){if(!e)return false;if(!Object.prototype.hasOwnProperty.call(r.SCOPE_CONFIG,t))return false;const s=r.SCOPE_CONFIG[t];const i=e.feature?.tags||[];const o=typeof e.uri==="string"?e.uri:"";if(i.includes(s.tag)||o.endsWith(s.ext)){return true}if(n){const e=n.split(".")[0].trim();if(e&&e!=="*"){if(e.startsWith("*")&&o.endsWith(e.slice(1))){return true}if(o===e||o.endsWith(`/${e}`)){return true}}}return false}function detectScopeFromTarget(e){const t=e.trim().toLowerCase();if(t==="testplan"||t.endsWith(".plan.feature")||t.includes(".plan.feature")||t.startsWith("@tp")||t.includes(".@tp")){return"testplan"}if(t==="testrun"||t.endsWith(".run.feature")||t.includes(".run.feature")||t.startsWith("@tr")||t.includes(".@tr")){return"testrun"}if(t==="testcase"||t.endsWith(".case.feature")||t.includes(".case.feature")||t.startsWith("@tc")||t.includes(".@tc")){return"testcase"}return undefined}function matchesTarget(e,t,n){if(!e&&!n)return false;const r=Array.isArray(t)?t:[t];return r.some((t=>{if(!t)return false;const r=t.trim().toLowerCase();if(n){const e=n.trim().toLowerCase();if(r===e||r===`testform_${e}`||`testform_${r}`===e){return true}}if(!e)return false;const i=e.replace(/\\/g,"/");let o=t.replace(/\\/g,"/");if(n){const e=n.trim().toLowerCase();if(o.toLowerCase().startsWith(`${e}.`)){o=o.slice(e.length+1)}else if(o.toLowerCase().match(new RegExp(`^[a-z0-9_-]+_${e}\\.`,"i"))){o=o.replace(new RegExp(`^[a-z0-9_-]+_${e}\\.`,"i"),"")}}const a=i.lastIndexOf(".");const c=a!==-1&&i.slice(a).startsWith(".@")?i.slice(0,a):i;const l=(0,s.basename)(c).replace(/(\.(case|run|plan))?\.feature$/i,"");const u=(0,s.basename)(o).replace(/(\.(case|run|plan))?\.feature$/i,"");const d=o.includes("/");if(d){return i===o||c===o||i.startsWith(`${o}.`)||c.startsWith(`${o}.`)||c.endsWith(`/${o}`)||c.endsWith(o)}return i===o||c===o||i.startsWith(`${o}.`)||c.startsWith(`${o}.`)||c.endsWith(`/${o}`)||c.endsWith(o)||(0,s.basename)(c)===o||(0,s.basename)(c).replace(/(\.(case|run|plan))?\.feature$/i,"")===u||l===u}))}function parseSpec(e,t={}){const{command:n="mark",defaultStatus:s="pending",requireStatus:i=n==="mark"}=t;let o=s;let c=e;if(e.includes("=")){const t=e.lastIndexOf("=");o=e.slice(t+1).trim();c=e.slice(0,t).trim();if(!r.TESTCASE_STATUSES.includes(o)){a.Diag.error({title:`Invalid status '${o}' in '${e}'.`,detail:[`Available statuses: ${r.TESTCASE_STATUSES.join(", ")}`]}).abort()}}else if(i){a.Diag.error({title:`Invalid format: '${e}'`,detail:[`Expected format: '<identifier>=<status>'`,`Examples:`,` ${r.TITLE_CLI} suite mark "@tc-1=passed" -target="@tr-2"`,` ${r.TITLE_CLI} suite mark "cuenta/inicio-sesion.feature@tc-1=passed" -target="@tr-2"`,``,`Available statuses: ${r.TESTCASE_STATUSES.join(", ")}`]}).abort()}if(!c){a.Diag.error({title:`Could not find scenario identity in '${e}'.`,detail:[`Expected format: '<identifier>=<status>'`,`Available statuses: ${r.TESTCASE_STATUSES.join(", ")}`]}).abort()}const l=c.replace(/^([a-zA-Z0-9_-]+_)?testcase\./,"");let u="";let d="";let f=false;if(l.includes(".feature.")){const e=l.indexOf(".feature.");u=l.slice(0,e+8).trim();d=l.slice(e+9).trim()}else{const e=l.lastIndexOf("@");if(e>0){u=l.slice(0,e).trim();d=l.slice(e).trim()}else if(l.endsWith(".feature")){u=l.trim();d="";f=true}else if(l.includes(".")){const e=l.lastIndexOf(".");u=l.slice(0,e).trim();d=l.slice(e+1).trim()}else{d=l.trim()}}return{raw:e,rawIdentifier:c,featurePart:u,casePart:d,newStatus:o,isWholeFile:f}}function matchesFeatureFile(e,t){if(!t)return true;const n=t.replace(/\.feature$/i,"");const r=e.replace(/\.feature$/i,"");return e===t||r===n||e.endsWith(t)||e.endsWith("/"+t)||e.endsWith("/"+t+".feature")||(0,s.basename)(r)===(0,s.basename)(n)}function matchesScenarioSpec(e,t){if(t.featurePart&&!matchesFeatureFile(e.uri,t.featurePart)){return false}const n=t.casePart.trim().toLowerCase();const s=(e.custom?.identity||"").trim().toLowerCase();const r=(e.name||"").trim().toLowerCase();if(s===n||s.replace(/^@/,"")===n.replace(/^@/,"")){return true}if(r&&r===n){return true}const i=`${e.uri}.${e.custom?.identity||e.name}`.toLowerCase();if(i===n){return true}return false}function matchesStateKey(e,t,n){const s=e.lastIndexOf(".");const r=s!==-1?e.slice(0,s):e;const i=s!==-1?e.slice(s+1):"";if(n.featurePart&&!matchesFeatureFile(r,n.featurePart)){return false}const o=n.casePart.trim().toLowerCase();const a=i.trim().toLowerCase();const c=(t||"").trim().toLowerCase();if(a===o||a.replace(/^@/,"")===o.replace(/^@/,"")){return true}if(c&&c===o){return true}if(n.rawIdentifier&&e.toLowerCase()===n.rawIdentifier.toLowerCase()){return true}return false}async function resolveTargetScenario(e,t,n,r,c){const l=typeof e==="string"?{target:e,dir:t,scopeKey:n,testDirectory:r,variables:c}:e;const{target:u,dir:d,scopeKey:f,testDirectory:p,variables:h}=l;const m=p?(0,s.join)(d,p):d;const g=new i.Parser(m,h);const y=new o.Config(d);const b={identity:y.getIdentity(f),fields:y.getFields(f)};const v=g.content()||[];const w=y.getMatch?.(f);const T=v.filter((e=>matchesScope(e,f,w)));const S=g.filter(T,b,f)||[];const k=u.replace(/\\/g,"/");const D=S.filter((e=>{const t=(e.uri||"").replace(/\\/g,"/");const n=e.custom?.identity?`${t}.${e.custom.identity}`:t;return n===k||n.startsWith(`${k}.`)||n.endsWith(`/${k}`)||n.endsWith(k)||t===k||t.endsWith(`/${k}`)||t.endsWith(k)||(0,s.basename)(t)===k||(0,s.basename)(t)===(0,s.basename)(k)}));if(D.length===1){return{absolutePath:(0,s.resolve)(m,D[0].uri),scenario:D[0]}}if(D.length===0){a.Diag.targetNotFound({scopeKey:f,target:u}).abort()}const _=Array.from(new Set(D.map((e=>e.uri))));a.Diag.ambiguousTarget({scopeKey:f,target:u,matches:_}).abort();throw new Error("Unreachable")}async function promptTargetSuite(e,t=["testrun","testplan"],n,r){const l=typeof e==="string"?{dir:e,allowedScopes:t,testDirectory:n,variables:r}:e;const{dir:u,allowedScopes:d=["testrun","testplan"],testDirectory:f,variables:p}=l;const h=f?(0,s.join)(u,f):u;const m=new i.Parser(h,p);const g=m.content()||[];const y=[];for(const e of d){const t=g.filter((t=>matchesScope(t,e)));const n=new o.Config(u);const s={identity:n.getIdentity(e),fields:n.getFields(e)};const r=m.filter(t,s,e)||[];for(const t of r){const n=t.uri;const s=t.custom?.identity||"";const r=s?` (${s})`:"";const i=t.feature?.name?` - "${t.feature.name}"`:"";y.push({label:`[${e}] ${n}${r}${i}`,value:s||n})}}if(y.length===0){a.Diag.error({title:`No ${d.join(" or ")} files found in workspace.`,detail:[`Use \`testform suite init\` to create one first.`]}).abort()}return(0,c.askSelect)("Selecciona la suite de destino (-target):",y)}},7066:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.State=void 0;t.parseBackendOverrides=parseBackendOverrides;t.cleanAttributes=cleanAttributes;const r=n(6982);const i=n(9896);const o=n(6928);const a=s(n(8815));const c=n(6028);const l=n(1227);const u=n(7490);const d=n(3175);const f=n(1535);const p=n(6122);const h=n(4646);const m=n(1265);const g=n(2578);const y=n(4489);const b=n(8742);const v=n(4296);function parseBackendOverrides(e,t="."){const n={};const s=Array.isArray(e)?e:[e];for(const e of s){if(!e||typeof e!=="string")continue;const s=e.indexOf("=");if(s>0){const t=e.substring(0,s).trim();const r=e.substring(s+1).trim();n[t]=r}else{const s=(0,o.resolve)(t,e.trim());if((0,i.existsSync)(s)){try{const e=(0,i.readFileSync)(s,"utf-8");let t;try{t=a.default.parse(e)}catch{}if(t&&typeof t==="object"){for(const[e,s]of Object.entries(t)){n[e]=String(s)}}else{const t=e.split("\n");for(const e of t){const t=e.trim();if(!t||t.startsWith("#")||t.startsWith("//"))continue;const s=t.indexOf("=");if(s>0){const e=t.substring(0,s).trim().replace(/["']/g,"");const r=t.substring(s+1).trim().replace(/["']/g,"");n[e]=r}}}}catch{}}}}return n}class State{state;backend;workspaceManager;lockAcquired=false;dir;customStatePath;constructor(e,t,n,s=false,r,i){this.dir=e;this.customStatePath=t;const a=new y.Config(e,false);const c=a.getResolvedPath();const l=c&&!t?(0,o.dirname)(c):e;let v=i||a.getBackend();this.workspaceManager=new b.WorkspaceManager(l);const w=this.workspaceManager.getCurrentWorkspace();if(s||t){v={type:"local",config:{}}}else if(v&&v.type!=="local"&&r){const t=parseBackendOverrides(r,e);v.config={...v.config,...t}}if(v?.type==="s3"||v?.type==="oci"){this.backend=new d.S3Backend(v.config,w)}else if(v?.type==="azurerm"){this.backend=new f.AzureRMBackend(v.config,w)}else if(v?.type==="gcs"){this.backend=new p.GCSBackend(v.config,w)}else if(v?.type==="github"){const e=a.getGitHub();this.backend=new h.GitHubBackend(v.config,w,e?.owner,e?.repository,e?.tokenEnv)}else if(v?.type==="http"||v?.type==="rest"){this.backend=new m.HTTPBackend(v.config,w)}else if(v?.type==="custom"){this.backend=new g.CustomBackend(v.config,w,e)}else{this.backend=new u.LocalBackend(l,t,n,w)}}async hasState(){return await this.backend.exists()}async init(){const e=await this.backend.read();if(!e.version){l.logger.push({type:"error",title:`${c.FILE_STATE} is missing the "version" field`,detail:[`Add a "version" field to your ${c.FILE_STATE} file and rerun init.`],close:true})}else if(e.version!==c.VERSION_STATE&&e.version!=="1.0.0"&&e.version!=="1"){l.logger.push({type:"error",title:`state version mismatch`,detail:[`Found version "${e.version}", but expected "${c.VERSION_STATE}".`,`Update ${c.FILE_STATE} to version ${c.VERSION_STATE} and rerun init.`],close:true})}const t=new y.Config(this.dir,false);this.state={version:e.version||c.VERSION_STATE,serial:e.serial??0,lineage:e.lineage??(0,r.randomUUID)(),lastSync:e.lastSync??"",provider:e.provider??t.getAdapterType(),resources:(e.resources??[]).map((e=>({...e,type:e.type||(e.identity?.startsWith("@tr-")||e.identity?.includes(".run.")?"testrun":e.identity?.startsWith("@tp-")||e.identity?.includes(".plan.")?"testplan":"testcase"),attributes:e.attributes??{...e}}))),outputs:e.outputs??{}}}async acquireLock(e,t){if(!e)return;const n=await this.backend.lock(t);if(!n){let e="";try{const t=typeof this.backend.getLockInfo==="function"?await this.backend.getLockInfo():null;if(t&&t.id){e=`\n\nLock Info:\n ID: ${t.id}\n Path: ${this.customStatePath||c.FILE_STATE}\n Operation: ${t.operation||"Operation"}\n Who: ${t.who||"unknown"}\n Created: ${t.created||""}`}}catch{}throw new v.StateLockError(`Error acquiring the state lock\n\nTestform acquires a state lock to protect the state from being written\nby multiple users at the same time. Please resolve the issue above and try\nagain. For most commands, you can disable locking with the "-lock=false"\nflag, but this is not recommended.${e}`)}this.lockAcquired=true}async releaseLock(){if(this.lockAcquired){await this.backend.unlock();this.lockAcquired=false}}async forceUnlock(e){return this.backend.forceUnlock(e)}clean(){const e=JSON.stringify(this.state);const t=Buffer.byteLength(e,"utf8");let n=0;if(this.state&&Array.isArray(this.state.resources)){for(const e of this.state.resources){if(e.attributes){const t=JSON.stringify(e.attributes);e.attributes=cleanAttributes(e.attributes);const s=JSON.stringify(e.attributes);if(t!==s){n++}}}}const s=JSON.stringify(this.state);const r=Buffer.byteLength(s,"utf8");return{beforeBytes:t,afterBytes:r,resourcesCleaned:n}}async save(){this.clean();this.state.serial+=1;this.state.lastSync=(new Date).toISOString();await this.backend.write(this.state)}getState(){return this.state}replaceState(e){this.state=JSON.parse(JSON.stringify(e))}getResources(e){if(!this.state||!this.state.resources)return[];if(!e)return this.state.resources;return this.state.resources.filter((t=>{const n=t.type||(t.identity?.startsWith("@tr-")||t.identity?.includes(".run.")?"testrun":t.identity?.startsWith("@tp-")||t.identity?.includes(".plan.")?"testplan":"testcase");if(n===e)return true;const s=n.includes("_")?n.split("_").slice(1).join("_"):n;const r=e.includes("_")?e.split("_").slice(1).join("_"):e;return s===r}))}getOutputs(){return this.state&&this.state.outputs||{}}setOutputs(e){this.state.outputs=e}getCurrentWorkspace(){return this.workspaceManager.getCurrentWorkspace()}setCurrentWorkspace(e){this.workspaceManager.setCurrentWorkspace(e)}async listWorkspaces(){return this.backend.listWorkspaces()}async deleteWorkspace(e){return this.backend.deleteWorkspace(e)}findResource(e){return this.state.resources.find((t=>t.identity===e))}upsertResource(e){const t={...e,attributes:cleanAttributes(e.attributes)};const n=this.state.resources.findIndex((e=>e.identity===t.identity));if(n>=0){this.state.resources[n]=t}else{this.state.resources.push(t)}}removeResource(e){this.state.resources=this.state.resources.filter((t=>t.identity!==e))}clearResources(){this.state.resources=[]}}t.State=State;function cleanAttributes(e){if(!e||typeof e!=="object")return e;const t={};for(const[n,s]of Object.entries(e)){if(s===null||s===undefined)continue;if(typeof s==="string"){if(s.trim()==="")continue;t[n]=s;continue}if(Array.isArray(s)){const e=s.filter((e=>e!==null&&e!==undefined&&(typeof e!=="string"||e.trim()!==""))).map((e=>typeof e==="object"&&e!==null&&!Array.isArray(e)?cleanAttributes(e):e)).filter((e=>typeof e!=="object"||e===null||Object.keys(e).length>0));if(e.length>0){t[n]=e}continue}if(typeof s==="object"){const e=cleanAttributes(s);if(Object.keys(e).length>0){t[n]=e}continue}t[n]=s}return t}},5124:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.executeInBatches=executeInBatches;t.arraysEqual=arraysEqual;t.compareCustomFields=compareCustomFields;t.detectAttributeDrift=detectAttributeDrift;t.syncTestrunComments=syncTestrunComments;const s=n(7862);async function executeInBatches(e,t,n){const s=Math.max(1,t||1);const r=[];for(let t=0;t<e.length;t+=s){const i=e.slice(t,t+s);const o=await Promise.all(i.map(n));r.push(...o)}return r}function normalizeStringArray(e){if(!e)return[];const t=Array.isArray(e)?e:String(e).split(",");return t.map((e=>String(e).trim().replace(/^@/,"").toLowerCase())).filter(Boolean)}function arraysEqual(e,t){const n=normalizeStringArray(e).sort();const s=normalizeStringArray(t).sort();if(n.length!==s.length)return false;return n.every(((e,t)=>e===s[t]))}function compareCustomFields(e={},t={},n=[]){const s={...e};let r=false;const i=new Set(n.map((e=>e.toLowerCase())));for(const n of Object.keys(e)){if(i.has(n.toLowerCase())||i.has("custom_fields")){continue}const o=Object.keys(t).find((e=>e.toLowerCase()===n.toLowerCase()));const a=o?t[o]:"";const c=String(e[n]??"");const l=c.startsWith("@")?c.substring(1).toLowerCase():c.toLowerCase();const u=a.startsWith("@")?a.substring(1).toLowerCase():a.toLowerCase();if(l!==u){s[n]=a;r=true}}return{hasDrift:r,reconciled:s}}function detectAttributeDrift(e,t,n,s=[]){const r={...e};let i=false;const o=new Set(s.map((e=>e.toLowerCase())));const a=(t.title??"").trim();const c=String(r.title??"").trim();if(!o.has("title")&&c!==a){r.title=t.title;i=true}const l=t.labels??[];if(!o.has("labels")&&!arraysEqual(r.labels,l)){r.labels=l;i=true}const u=t.assignees??[];if(!o.has("assignees")&&!arraysEqual(r.assignees,u)){r.assignees=u;i=true}const d=(t.milestone??"").trim();const f=String(r.milestone??"").trim();if(!o.has("milestone")&&f!==d){r.milestone=d;i=true}if(n!==undefined&&!o.has("custom_fields")){const e=r.custom_fields||{};const t=compareCustomFields(e,n,s);if(t.hasDrift){r.custom_fields=t.reconciled;i=true}}return{hasDrift:i,newAttributes:r}}async function syncTestrunComments(e){const{change:t,issueNumber:n,provider:r,stateObj:i,testDirectory:o,existingAttributes:a,onCommentUpdate:c,onCommentCreate:l}=e;if(!t.resourceType.endsWith("testrun")||!t.scenario.custom?.testcases){return{testcaseCommentIds:a?.testcaseCommentIds||{},testcaseStatuses:a?.testcaseStatuses||{},expandedTestcases:[]}}const u={...a?.testcaseCommentIds||{}};const d={...a?.testcaseStatuses||{}};const f=[];const p=s.resource.evaluateComments(t.resourceType,t.scenario,{state:i,testDirectory:o,existingAttributes:a});for(const e of p){const{identity:t,status:s,body:i}=e;f.push(t);const o=a?.testcaseStatuses?.[t];if(!u[t]||o!==s){if(u[t]){await r.updateIssueComment(u[t],i);c?.(t,s)}else{const e=await r.createIssueComment(n,i);u[t]=e.id;l?.(t,s)}}d[t]=s}if(Object.keys(d).length===0&&t.scenario.custom?.groupScenarios){for(const e of t.scenario.custom.groupScenarios){if(e.rule&&e.name){const t=`${e.rule.name}.${e.name}`;d[t]=e.custom?.fields?.status||"pending"}}}return{testcaseCommentIds:u,testcaseStatuses:d,expandedTestcases:f}}},2978:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TF_SPACE_TOKEN=t.formatHclValue=void 0;t.elapsedSeconds=elapsedSeconds;t.resolvePath=resolvePath;t.formatIdentityDisplay=formatIdentityDisplay;t.formatResourceAddress=formatResourceAddress;t.normalizeAddress=normalizeAddress;t.addressesMatch=addressesMatch;t.findDomainConfigFiles=findDomainConfigFiles;t.sanitizeTagsWithSpaces=sanitizeTagsWithSpaces;t.restoreTagsWithSpaces=restoreTagsWithSpaces;t.reassembleSplitTags=reassembleSplitTags;t.levenshtein=levenshtein;t.suggestCommand=suggestCommand;t.calculateRollupVerdict=calculateRollupVerdict;const s=n(9896);const r=n(6928);function elapsedSeconds(e){return((Date.now()-e)/1e3).toFixed(0)}function resolvePath(e,t){if(!t||!e)return undefined;const n=t.replace(/\[(\w+)\]/g,".$1").split(".");let s=e;for(const e of n){if(s===undefined||s===null)return undefined;s=s[e]}return s}function formatIdentityDisplay(e){if(!e)return"";const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));if(t!==-1){return e.substring(t+1)}return e}function formatResourceAddress(e,t){const n=e||"testcase";const s=n.includes("_")?n.replace(/_/g,"."):n;const r=formatIdentityDisplay(t);return`${s}.${r}`}const formatHclValue=(e,n)=>{const s=" ".repeat(n);if(e===null||e===undefined)return"null";if(typeof e==="string"){if(e.includes("\n")){const t=e.split("\n").map((e=>e?`${s} ${e}`:`${s} `)).join("\n");return`<<-EOT\n${t}\n${s}EOT`}return JSON.stringify(e)}if(Array.isArray(e)){if(e.length===0)return"[]";const r=e.map((e=>(0,t.formatHclValue)(e,n+1)));return`[\n${s} ${r.join(`,\n${s} `)},\n${s}]`}if(typeof e==="object"){const r=Object.keys(e);if(r.length===0)return"{}";let i=0;for(const e of r){const t=JSON.stringify(e);if(t.length>i)i=t.length}let o=`{\n`;for(const a of r){const r=JSON.stringify(a);const c=" ".repeat(i-r.length);const l=Object.prototype.hasOwnProperty.call(e,a)?e[a]:undefined;o+=`${s} ${r}${c} = ${(0,t.formatHclValue)(l,n+1)}\n`}o+=`${s}}`;return o}return JSON.stringify(e)};t.formatHclValue=formatHclValue;function normalizeAddress(e){return e.replace(/\\/g,"/").replace(/\.@/,".").replace(/^@/,"")}function addressesMatch(e,t){return normalizeAddress(e)===normalizeAddress(t)}function findDomainConfigFiles(e,t=[]){const n=[];if(!(0,s.existsSync)(e))return n;const i=new Set(["node_modules",".git",".testform",".terraform","dist","coverage",".system_generated"]);const o=new Set(["main.yml","main.yaml","testform.yml","testform.yaml","variables.yml","variables.yaml","vars.yml","vars.yaml","locals.yml","locals.yaml","local.yml","local.yaml","outputs.yml","outputs.yaml","data.yml","data.yaml",...t.map((e=>e.toLowerCase()))]);const scan=t=>{try{const a=(0,r.resolve)(t)===(0,r.resolve)(e);const c=(0,s.readdirSync)(t,{withFileTypes:true});for(const e of c){if(e.isDirectory()){if(!i.has(e.name)&&!e.name.startsWith(".")){scan((0,r.resolve)(t,e.name))}}else if(e.isFile()){const s=e.name.toLowerCase();if(s.endsWith(".yml")||s.endsWith(".yaml")){if(a&&o.has(s)){continue}n.push((0,r.resolve)(t,e.name))}}}}catch{}};scan(e);return n.sort()}t.TF_SPACE_TOKEN="__TF_SPACE__";function sanitizeTagsWithSpaces(e){return e.replace(/(@(?:module|depends_on)\([^)]*\))/g,(e=>e.replace(/ /g,t.TF_SPACE_TOKEN)))}function restoreTagsWithSpaces(e){return e.split(t.TF_SPACE_TOKEN).join(" ")}function reassembleSplitTags(e,t){const n=[];for(let s=0;s<e.length;s++){const r=e[s];if(r.startsWith(t)&&(!r.endsWith(")")||(r.match(/\(/g)||[]).length!==(r.match(/\)/g)||[]).length)){let t=r;while(s+1<e.length){s++;const n=e[s];if(n.startsWith("@")&&!t.endsWith(",")&&!t.endsWith("(")&&!t.endsWith(":")&&!t.endsWith("=")){t+=n}else{t+=" "+n}const r=(t.match(/\(/g)||[]).length;const i=(t.match(/\)/g)||[]).length;if(r===i&&i>0)break}n.push(t)}else{n.push(r)}}return n}function levenshtein(e,t){const n=[];for(let e=0;e<=t.length;e++)n[e]=[e];for(let t=0;t<=e.length;t++)n[0][t]=t;for(let s=1;s<=t.length;s++){for(let r=1;r<=e.length;r++){if(t.charAt(s-1)===e.charAt(r-1)){n[s][r]=n[s-1][r-1]}else{n[s][r]=Math.min(n[s-1][r-1]+1,n[s][r-1]+1,n[s-1][r]+1)}}}return n[t.length][e.length]}function suggestCommand(e,t){const n=e.toLowerCase();let s;let r=Infinity;for(const e of t){if(e===n)return e;const t=levenshtein(n,e);if(t<r){r=t;s=e}}if(s&&r<=2){return s}return undefined}function calculateRollupVerdict(e){if(!e||e.length===0)return"pending";const t=e.map((e=>String(e||"").trim().toLowerCase()));if(t.some((e=>e==="failed")))return"failed";if(t.some((e=>e==="pending"||e==="blocked"||e==="skipped"||e==="in_progress"||!e)))return"pending";if(t.every((e=>e==="passed")))return"passed";return"pending"}},9922:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.VariableParser=void 0;const r=n(9896);const i=n(6928);const o=s(n(8815));const a=n(1227);const c=n(6028);const l=n(455);const u=n(2978);const d=n(2825);class VariableParser{declaredVars={};vars={};rawLocals={};locals={};workDir;dataResolver;outputResolver;state;constructor(e,t,n="."){this.workDir=n;this.dataResolver=new l.DataResolver(n);this.loadDeclarations();this.loadAutoVarFiles();this.parseVarFiles(t);this.parseVars(e);this.validateVariables();this.evaluateLocals()}loadDeclarations(){for(const e of c.CONFIG_FILE_NAMES){const t=(0,i.resolve)(this.workDir,e);if((0,r.existsSync)(t)){try{const e=(0,r.readFileSync)(t,"utf-8");const n=o.default.parse(e)||{};const s=n.variable;if(s&&typeof s==="object"){this.declaredVars={...this.declaredVars,...s};for(const[e,t]of Object.entries(s)){if(t&&typeof t==="object"&&t.default!==undefined){this.vars[e]=String(t.default)}else if(t!==undefined&&t!==null&&typeof t!=="object"){this.vars[e]=String(t)}}}const i=n.locals;if(i&&typeof i==="object"){this.rawLocals={...this.rawLocals,...i}}}catch{}break}}for(const e of["variables.yml","variables.yaml"]){const t=(0,i.resolve)(this.workDir,e);if((0,r.existsSync)(t)){try{const e=(0,r.readFileSync)(t,"utf-8");const n=o.default.parse(e)||{};const s=n.variable||n;if(typeof s==="object"){this.declaredVars={...this.declaredVars,...s};for(const[e,t]of Object.entries(s)){if(t&&typeof t==="object"&&t.default!==undefined){this.vars[e]=String(t.default)}else if(t!==undefined&&t!==null&&typeof t!=="object"){this.vars[e]=String(t)}}}}catch{}break}}for(const e of["locals.yml","locals.yaml","local.yml","local.yaml"]){const t=(0,i.resolve)(this.workDir,e);if((0,r.existsSync)(t)){try{const e=(0,r.readFileSync)(t,"utf-8");const n=o.default.parse(e)||{};const s=n.locals||n;if(typeof s==="object"){this.rawLocals={...this.rawLocals,...s}}}catch{}break}}const e=(0,u.findDomainConfigFiles)(this.workDir);for(const t of e){try{const e=(0,r.readFileSync)(t,"utf-8");const n=o.default.parse(e);if(!n||typeof n!=="object")continue;const s=n.variable;if(s&&typeof s==="object"){for(const[e,t]of Object.entries(s)){if(t&&typeof t==="object"&&!Array.isArray(t)){this.declaredVars[e]={...this.declaredVars[e],...t};if(t.default!==undefined){this.vars[e]=String(t.default)}}else if(t!==undefined&&t!==null){this.declaredVars[e]={default:t};this.vars[e]=String(t)}}}const i=n.locals;if(i&&typeof i==="object"){this.rawLocals={...this.rawLocals,...i}}}catch{}}}loadAutoVarFiles(){if(!(0,r.existsSync)(this.workDir))return;try{const e=(0,r.readdirSync)(this.workDir);const t=e.filter((e=>e.endsWith(".vars.yml")||e.endsWith(".vars.yaml"))).sort();for(const e of t){const t=(0,i.resolve)(this.workDir,e);this.loadSingleYamlFile(t)}}catch{}}parseVars(e){if(!e)return;const t=Array.isArray(e)?e:[e];for(const e of t){const t=e.indexOf("=");if(t===-1){a.logger.push({type:"warning",title:`Invalid variable format: ${e}`,detail:["Variables must be in the format key=value"]});continue}const n=e.substring(0,t).trim();const s=e.substring(t+1).trim();this.vars[n]=s}}parseVarFiles(e){if(!e)return;const t=Array.isArray(e)?e:[e];for(let e of t){e=(0,i.resolve)(this.workDir,e);if(!(0,r.existsSync)(e)){a.logger.push({type:"error",title:`Variable file not found: ${e}`,detail:[],close:true});process.exit(1)}if(!e.endsWith(".yml")&&!e.endsWith(".yaml")){a.logger.push({type:"error",title:`Unsupported variable file format: ${e}`,detail:["Testform only supports YAML variable files (.yml or .yaml)."],close:true});process.exit(1)}this.loadSingleYamlFile(e)}}loadSingleYamlFile(e){try{const t=(0,r.readFileSync)(e,"utf-8");const n=o.default.parse(t);if(n&&typeof n==="object"){const e=n.variable||n;for(const[t,n]of Object.entries(e)){if(n!==undefined&&n!==null&&typeof n!=="object"){this.vars[t]=String(n)}}}}catch(t){a.logger.push({type:"error",title:`Failed to parse variable file: ${e}`,detail:[t.message],close:true});process.exit(1)}}validateVariables(){const e={vars:this.vars,locals:this.rawLocals,data:this.dataResolver,workDir:this.workDir};for(const[t,n]of Object.entries(this.declaredVars)){const s=this.vars[t];if(s===undefined)continue;if(n.enum&&Array.isArray(n.enum)&&n.enum.length>0){const e=n.enum.map(String);if(!e.includes(String(s))){a.logger.push({type:"error",title:`Variable enum validation error: "${t}"`,detail:[`Value "${s}" is not in the allowed list: [${e.join(", ")}].`],close:true})}}if(n.type){const e=n.type.toLowerCase();if(e==="number"){if(isNaN(Number(s))){a.logger.push({type:"error",title:`Variable type validation error: "${t}"`,detail:[`Value "${s}" cannot be parsed as a number.`],close:true})}}else if(e==="boolean"){if(s!=="true"&&s!=="false"&&typeof s!=="boolean"){a.logger.push({type:"error",title:`Variable type validation error: "${t}"`,detail:[`Value "${s}" is not a boolean ('true' or 'false').`],close:true})}}}if(n.validation?.condition){let s;try{s=(0,d.evaluateExpression)(n.validation.condition,e)}catch(e){a.logger.push({type:"error",title:`Error evaluating validation condition for "${t}"`,detail:[e.message],close:true})}if(!s){a.logger.push({type:"error",title:n.validation.error_message||`Variable validation condition failed: "${t}"`,detail:[n.validation.error_message||`Condition "${n.validation.condition}" evaluated to false for variable "${t}".`],close:true})}}}}evaluateLocals(){const e={...this.rawLocals};const t={};for(let n=0;n<3;n++){for(const[n,s]of Object.entries(e)){if(typeof s!=="string"){t[n]=String(s??"");continue}let e=s.replace(/\$\{module\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\}/g,((e,t,n)=>{const s=`module.${t}.${n}`;if(this.state){const e=this.state.getOutputs?this.state.getOutputs():this.state.outputs;if(e&&e[s]&&e[s].value!==undefined){return String(e[s].value)}}if(this.outputResolver){const e=this.outputResolver.getDeclarations?this.outputResolver.getDeclarations():{};if(e[s]&&e[s].value!==undefined){return String(e[s].value)}}return`\${module.${t}.${n}}`}));const r={vars:this.vars,locals:t,data:this.dataResolver,workDir:this.workDir};try{t[n]=(0,d.interpolateExpressions)(e,r)}catch{t[n]=e}}}this.locals=t}getVars(){return this.vars}setVar(e,t){this.vars[e]=t;this.validateVariables();this.evaluateLocals()}getLocals(){return this.locals}getDeclaredVars(){return this.declaredVars}getMissingRequiredVars(){const e=[];for(const[t,n]of Object.entries(this.declaredVars)){const s=n&&typeof n==="object"&&n.default!==undefined;if(!s&&this.vars[t]===undefined){e.push({name:t,description:n?.description})}}return e}applyToTemplate(e){if(typeof e!=="string")return e;let t=e.replace(/\$\{module\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\}/g,((e,t,n)=>{const s=`module.${t}.${n}`;if(this.state){const e=this.state.getOutputs?this.state.getOutputs():this.state.outputs;if(e&&e[s]&&e[s].value!==undefined){return String(e[s].value)}}if(this.outputResolver){const e=this.outputResolver.getDeclarations?this.outputResolver.getDeclarations():{};if(e[s]&&e[s].value!==undefined){return String(e[s].value)}}return e}));const n={vars:this.vars,locals:this.locals,data:this.dataResolver,workDir:this.workDir};return(0,d.interpolateExpressions)(t,n)}setOutputResolver(e){this.outputResolver=e}setState(e){this.state=e}getDataResolver(){return this.dataResolver}}t.VariableParser=VariableParser},8742:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.WorkspaceManager=void 0;const s=n(6928);const r=n(9896);class WorkspaceManager{testformDir;cacheDir;envPath;constructor(e){this.testformDir=(0,s.join)(e,".testform");this.cacheDir=(0,s.join)(this.testformDir,"cache");this.envPath=(0,s.join)(this.testformDir,"environment")}ensureDir(){if(!(0,r.existsSync)(this.testformDir)){(0,r.mkdirSync)(this.testformDir,{recursive:true})}if(!(0,r.existsSync)(this.cacheDir)){(0,r.mkdirSync)(this.cacheDir,{recursive:true})}}getCurrentWorkspace(){if((0,r.existsSync)(this.envPath)&&(0,r.statSync)(this.envPath).isFile()){const e=(0,r.readFileSync)(this.envPath,"utf8").trim();if(e.length>0){return e}}return"default"}setCurrentWorkspace(e){this.ensureDir();(0,r.writeFileSync)(this.envPath,e,"utf8")}getActiveBackend(){const e=(0,s.join)(this.cacheDir,"backend.json");const t=(0,s.join)(this.testformDir,"backend.json");const n=(0,r.existsSync)(e)?e:t;if((0,r.existsSync)(n)&&(0,r.statSync)(n).isFile()){try{return JSON.parse((0,r.readFileSync)(n,"utf8"))}catch{return null}}return null}setActiveBackend(e){this.ensureDir();const t=(0,s.join)(this.cacheDir,"backend.json");(0,r.writeFileSync)(t,JSON.stringify(e,null,2),"utf8");const n=(0,s.join)(this.testformDir,"backend.json");if((0,r.existsSync)(n)){try{(0,r.unlinkSync)(n)}catch{}}}}t.WorkspaceManager=WorkspaceManager},9407:function(module,exports,__nccwpck_require__){"use strict";module=__nccwpck_require__.nmd(module);var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var __exportStar=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))__createBinding(t,e,n)};var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:true});exports.Config=exports.VariableParser=exports.interpolateExpressions=exports.evaluateExpression=exports.registerPolicy=exports.policy=exports.registerResource=exports.resource=exports.main=void 0;exports.createCli=createCli;const cac_1=__nccwpck_require__(7948);const chalk_1=__nccwpck_require__(465);const node_process_1=__nccwpck_require__(1708);const path_1=__nccwpck_require__(6928);const config_1=__nccwpck_require__(4489);const init_1=__nccwpck_require__(722);const plan_1=__nccwpck_require__(4483);const validate_1=__nccwpck_require__(10);const apply_1=__nccwpck_require__(8314);const destroy_1=__nccwpck_require__(9540);const show_1=__nccwpck_require__(5765);const output_1=__nccwpck_require__(8973);const refresh_1=__nccwpck_require__(1821);const diff_1=__nccwpck_require__(5083);const import_1=__nccwpck_require__(2541);const force_unlock_1=__nccwpck_require__(3634);const state_1=__nccwpck_require__(1047);const taint_1=__nccwpck_require__(1510);const graph_1=__nccwpck_require__(9478);const fmt_1=__nccwpck_require__(2353);const login_1=__nccwpck_require__(7155);const logout_1=__nccwpck_require__(3834);const modules_1=__nccwpck_require__(3067);const workspace_1=__nccwpck_require__(2743);const report_1=__nccwpck_require__(8938);const suite_1=__nccwpck_require__(5822);const tool_1=__nccwpck_require__(4710);const print_1=__nccwpck_require__(7633);const query_1=__nccwpck_require__(1906);const ephemeral_1=__nccwpck_require__(6597);const providers_1=__nccwpck_require__(5644);const functions_1=__nccwpck_require__(31);const policy_1=__nccwpck_require__(5950);const chalk_2=__importDefault(__nccwpck_require__(465));const logger_1=__nccwpck_require__(1227);const const_1=__nccwpck_require__(6028);const help_1=__nccwpck_require__(8184);const errors_1=__nccwpck_require__(4296);const utils_1=__nccwpck_require__(2978);const cli_1=__nccwpck_require__(8169);async function fetchLatestNpmVersion(){try{const e=new AbortController;const t=setTimeout((()=>e.abort()),1500);const n=await fetch("https://registry.npmjs.org/@fromeroc9/testform/latest",{headers:{Accept:"application/json"},signal:e.signal});clearTimeout(t);if(n.ok){const e=await n.json();return e.version}}catch{}return undefined}async function printVersion(e=false,t=false){const n=node_process_1.platform==="win32"?"windows":node_process_1.platform;const s=node_process_1.arch==="x64"?"amd64":node_process_1.arch;const r=`${n}_${s}`;const i=process.env.TESTSTATE_LATEST_VERSION||await fetchLatestNpmVersion();const o=Boolean(i&&(0,cli_1.compareCliVersions)(const_1.VERSION_CLI,i)<0);if(e){const e={};try{const t=new config_1.Config(process.cwd(),false);const n=t.getProviderType();if(n&&n!=="local"){e[`registry.testform.io/fromeroc9/${n}`]="1.0.0"}}catch{}const t={testform_version:const_1.VERSION_CLI,platform:r,provider_selections:e,testform_outdated:o};console.log(JSON.stringify(t,null,2));return}console.log((0,chalk_1.cyan)(`${const_1.TITLE_APP} v${const_1.VERSION_CLI}`));console.log(`on ${r}`);if(t){console.log(`+ Config Version: ${const_1.VERSION_CONFIG} (${const_1.FILE_CONFIG})`);console.log(`+ State Version: ${const_1.VERSION_STATE} (${const_1.FILE_STATE})`)}if(o){console.log("");console.log(`Your version of ${const_1.TITLE_APP} is out of date! The latest version`);console.log(`is ${i}. You can update by running:`);console.log(` npm install -g @fromeroc9/testform`)}}function createCli(){const e=(0,cac_1.cac)(const_1.TITLE_CLI);e.option("-C, --chdir <dir>","Working directory (default: current directory)",{default:"."});e.option("-v, --verbose","Show detailed debug output");e.option("--no-color","Disable colorized console output");e.option("--var <var>","Set a variable value (key=value)");e.option("--var-file <file>","Load variables from a YAML file");e.command("init","Initialize a new Testform workspace").option("--backend-type <type>","Backend type to initialize (local | github | s3 | azurerm | gcs | oci)").option("--backend-config <config>","Backend configuration override").option("--provider <type>","Provider type to initialize (github | local | gitlab)").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).option("--reconfigure","Reconfigure backend").option("--migrate-state","Migrate state to new backend").option("--backend","Configure backend",{default:true}).option("--json","Output results in JSON format").option("--input","Allow interactive input",{default:true}).action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);const n=e.backendType||(typeof e.backend==="string"?e.backend:undefined);const s=e.provider;const r=e.backend!==false&&e.backend!=="false";await(0,init_1.initCmd)({dir:t,backendType:n,providerType:s,verbose:Boolean(e.verbose),backendConfigRaw:e.backendConfig,lock:e.lock??true,lockTimeout:e.lockTimeout??"0s",reconfigure:e.reconfigure,migrateState:e.migrateState,backendEnabled:r,isJson:e.json,inputEnabled:e.input??true})}));e.command("validate [targetPath]","Check feature files for syntax and DSL violations").option("--json","Output diagnostics in JSON format").option("--test-directory <dir>","Subdirectory containing test files").option("--no-tests","Suppress test execution checks").option("--query <query>","Filter query for validation").option("--target <target>","Target a specific resource or feature file").option("--var <var>","Set a variable value (key=value)").option("--var-file <file>","Load variable values from a YAML file").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);const s=e||n;const r=(0,cli_1.resolveVariableParser)(t,n);await(0,validate_1.validateCmd)({targetPath:s,dir:n,verbose:Boolean(t.verbose),target:t.target,variables:r,isJson:t.json,testDirectory:t.testDirectory,noTests:t.tests===false,query:t.query})}));e.command("plan","Generate and show an execution plan").option("-o, --out <path>","Write the plan to the given file").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).option("--input","Allow interactive input",{default:true}).option("--json","Output results in JSON format").option("--detailed-exitcode","Return detailed exit code on plan changes").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").option("--target <target>","Target a specific resource").option("--destroy","Generate plan to destroy all resources").option("--refresh","Refresh remote state before planning",{default:true}).option("--refresh-only","Only refresh state without planning changes").option("--replace <target>","Force replacement of specified resource").option("--parallelism <n>","Concurrent operation limit").option("--compact-warnings","Show warnings in compact form").option("--test-directory <dir>","Directory containing feature files").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);const n=(0,cli_1.resolveVariableParser)(e,t);await(0,plan_1.planCmd)({dir:t,verbose:Boolean(e.verbose),outPath:e.out,lock:e.lock??true,lockTimeout:e.lockTimeout??"0s",input:e.input!==false&&e.input!=="false",variables:n,isJson:e.json,detailedExitCode:e.detailedExitcode,statePath:e.state,backupPath:e.backup,target:e.target,destroyPlan:e.destroy,refresh:e.refresh??true,refreshOnly:e.refreshOnly,replaceTargets:e.replace,parallelism:e.parallelism,compactWarnings:e.compactWarnings??false,testDirectory:e.testDirectory})}));e.command("apply [planFile]","Create or update infrastructure according to configuration").option("-a, --auto-approve","Skip interactive approval of plan").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).option("--input","Allow interactive input",{default:true}).option("--json","Output results in JSON format").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").option("--target <target>","Target a specific resource").option("--refresh","Refresh remote state before applying",{default:true}).option("--refresh-only","Only refresh state without applying changes").option("--replace <target>","Force replacement of specified resource").option("--parallelism <n>","Concurrent operation limit").option("--compact-warnings","Show warnings in compact form").option("--test-directory <dir>","Directory containing feature files").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);const s=(0,cli_1.resolveVariableParser)(t,n);await(0,apply_1.applyCmd)({dir:n,autoApprove:Boolean(t.autoApprove),verbose:Boolean(t.verbose),planFile:e,lock:t.lock??true,lockTimeout:t.lockTimeout??"0s",input:t.input??true,variables:s,statePath:t.state,backupPath:t.backup,target:t.target,refresh:t.refresh??true,refreshOnly:t.refreshOnly,replaceTargets:t.replace,parallelism:t.parallelism,compactWarnings:t.compactWarnings??false,testDirectory:t.testDirectory})}));e.command("destroy","Destroy all remote-managed test resources").option("-a, --auto-approve","Skip interactive approval").option("--target <target>","Target a specific resource").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).option("--input","Allow interactive input",{default:true}).option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);await(0,destroy_1.destroyCmd)({dir:t,autoApprove:Boolean(e.autoApprove),verbose:Boolean(e.verbose),target:e.target,lock:e.lock??true,lockTimeout:e.lockTimeout??"0s",input:e.input??true,statePath:e.state,backupPath:e.backup})}));e.command("show [path]","Inspect Testform state or a plan file").option("--json","Output state in JSON format").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);await(0,show_1.showCmd)({path:e,isJson:t.json,verbose:Boolean(t.verbose),dir:n,statePath:t.state,backupPath:t.backup})}));e.command("output [name]","Read an output from a state file").option("--state <path>","Path to the state file").option("--json","Produce output in a machine-readable JSON format").option("--raw","Print raw string value without formatting").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);const s=(0,cli_1.resolveVariableParser)(t,n);await(0,output_1.outputCmd)({dir:n,name:e,statePath:t.state,isJson:Boolean(t.json),raw:Boolean(t.raw),variables:s})}));e.command("refresh","Update the state file against remote target platform").option("--target <target>","Resource to target (can be specified multiple times)").option("--var <var>","Set a variable value").option("--var-file <file>","Load variable values from file").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").option("--parallelism <n>","Concurrent operation limit").option("--compact-warnings","Show warnings in compact form").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);await(0,refresh_1.refreshCmd)({dir:t,verbose:Boolean(e.verbose),target:e.target,lock:e.lock??true,lockTimeout:e.lockTimeout??"0s",statePath:e.state,backupPath:e.backup,parallelismRaw:e.parallelism,compactWarnings:e.compactWarnings??false})}));e.command("diff","Display human-readable difference between local and state").option("--target <target>","Target a specific resource or file").option("--remote","Detect and compare against remote target platform").option("-i, --interactive","Interactively resolve detected drift (pull / overwrite / skip)").option("--test-directory <dir>","Subdirectory containing test files").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);const n=(0,cli_1.resolveVariableParser)(e,t);await(0,diff_1.diffCmd)({dir:t,testDirectory:e.testDirectory,verbose:Boolean(e.verbose),target:e.target,remote:Boolean(e.remote),interactive:Boolean(e.interactive),statePath:e.state,backupPath:e.backup,variables:n})}));e.command("import <address> <issueNumber>","Associate an existing remote Issue with a local scenario").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);await(0,import_1.importCmd)({dir:s,identityArg:e,issueNumber:t,lock:n.lock??true,lockTimeout:n.lockTimeout??"0s",statePath:n.state,backupPath:n.backup})}));e.command("state [subcommand] [...args]","Advanced state management (clean, list, show, rm, mv, pull, push)").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").option("--json","Output in JSON format").option("--id <id>","Filter by ID").option("--dry-run","Preview state modifications without writing").option("--force","Bypass safety checks").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);if(!e){console.log((0,help_1.getCommandHelp)("state")||help_1.HELP_GLOBAL);return}await(0,state_1.stateCmd)({dir:s,action:e,args:t||[],statePath:n.state,backupPath:n.backup,isJson:n.json,id:n.id,dryRun:n.dryRun,force:n.force})}));e.command("taint <address>","Mark a resource instance as degraded or corrupted").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").option("--allow-missing","Do not error if resource is missing from state").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);await(0,taint_1.taintCmd)({dir:n,action:"taint",identityRaw:e,statePath:t.state,backupPath:t.backup,allowMissing:t.allowMissing,lock:t.lock??true,lockTimeout:t.lockTimeout??"0s"})}));e.command("untaint <address>","Remove degraded status mark from a resource instance").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").option("--allow-missing","Do not error if resource is missing from state").option("--lock","Lock state during operation",{default:true}).option("--lock-timeout <timeout>","Timeout for state lock",{default:"0s"}).action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);await(0,taint_1.taintCmd)({dir:n,action:"untaint",identityRaw:e,statePath:t.state,backupPath:t.backup,allowMissing:t.allowMissing,lock:t.lock??true,lockTimeout:t.lockTimeout??"0s"})}));e.command("workspace [subcommand] [name]","Workspace management (list, select, new, delete, show)").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);const r=[e,t].filter(Boolean);await(0,workspace_1.workspaceCmd)({dir:s,verbose:Boolean(n.verbose),args:r})}));e.command("ephemeral [subcommand] [id]","Manage temporary CI/CD QA sandboxes (up, down, list, show)").option("-a, --auto-approve","Skip interactive approval").option("--force","Force destruction even if state is missing").option("--test-directory <dir>","Subdirectory containing test files").option("--json","Output results formatted as JSON").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);await(0,ephemeral_1.ephemeralCmd)({subcommand:e,id:t,dir:s,testDirectory:n.testDirectory,autoApprove:Boolean(n.autoApprove),force:Boolean(n.force),json:Boolean(n.json),verbose:Boolean(n.verbose)})}));e.command("force-unlock <lockId>","Release a stuck state lock").option("--force","Do not ask for confirmation").option("--state <path>","Path to state file").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);await(0,force_unlock_1.forceUnlockCmd)({dir:n,lockId:e,force:t.force,statePath:t.state})}));e.command("report [type]","Generate test metrics and matrices (summary, traceability, coverage, etc.)").option("--format <format>","Report output format (md, json, csv, xlsx, docx)",{default:"md"}).option("--filter <filter>","Filter report items (key=value or inferred text search)").option("--target <target>","Target a specific resource, testrun (@tr-N), or testplan (@tp-N)").option("--group-by <field>","Group report items dynamically by field").option("--template <path>","Path to custom template file").option("-o, --out <path>","Write report to destination file").option("--state <path>","Path to state file").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);const s=(0,cli_1.resolveVariableParser)(t,n);const r=t.filter?Array.isArray(t.filter)?t.filter:[t.filter]:[];await(0,report_1.reportCmd)({dir:n,type:e||"testcase-summary",format:t.format||"md",filter:r,target:t.target,groupBy:t.groupBy||t["group-by"],template:t.template,variables:s,out:t.out,statePath:t.state})}));e.command("suite [subcommand] [...args]","Manage test suites and execution files (init, fill, link, mark, tags)").option("-s, --scope <scope>","Suite scope (testrun, testplan)").option("--fill","Autocomplete empty testrun rules with their testcases").option("--link <id_status>","Link a testcase or testrun into a suite").option("--mark <id_status>","Record execution status in a testrun").option("--tags <tags>",'Filter testcase scenarios by bracketed tag expression to generate testrun (e.g. "[@smoke]" or "file.case.feature.[@smoke]")').option("--title <title>","Suite title").option("--rule <rule>","Rule definitions").option("--target <target>","Target feature file (identity tag @tr-N/@tp-N, canonical address, or file path)").option("--test-directory <dir>","Directory containing test files").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);const r=(0,cli_1.resolveVariableParser)(n,s);const i=n.rule?Array.isArray(n.rule)?n.rule:[n.rule]:[];await(0,suite_1.suiteCmd)({dir:s,subCommand:e,subArgs:t||[],scope:n.scope||"testrun",title:n.title,rules:i,target:n.target,tags:n.tags,fill:Boolean(n.fill),link:typeof n.link==="string"?n.link:undefined,mark:typeof n.mark==="string"?n.mark:undefined,testDirectory:n.testDirectory,statePath:n.state,backupPath:n.backup,variables:r,verbose:Boolean(n.verbose)})}));e.command("tool <subcommand> [...args]","QA utilities (feature, autocomplete, state)").option("--title <title>","Feature title").option("--rule <rule>","Rule definitions").option("--target <target>","Target feature file").option("--test-directory <dir>","Directory containing test files").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);const r=(0,cli_1.resolveVariableParser)(n,s);const i=n.rule?Array.isArray(n.rule)?n.rule:[n.rule]:[];await(0,tool_1.toolCmd)({dir:s,subCommand:e,subArgs:t||[],scope:n.scope||"testcase",title:n.title,rules:i,target:n.target,testDirectory:n.testDirectory,statePath:n.state,backupPath:n.backup,variables:r,verbose:Boolean(n.verbose)})}));e.command("fmt [targetDir]","Rewrites Gherkin configuration files to canonical format").option("--check","Check if files are formatted without rewriting").option("--diff","Display diffs instead of rewriting files").option("--list","List unformatted files",{default:true}).option("--write","Write reformatted files to disk",{default:true}).option("--recursive","Recursively format subdirectories").option("--test-directory <dir>","Test directory").action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);const s=t.testDirectory?(0,path_1.resolve)(n,t.testDirectory):n;const r=e?(0,path_1.resolve)(n,e):s;await(0,fmt_1.fmtCmd)({dir:r,check:t.check,diff:t.diff,list:t.list??true,write:t.write??true,recursive:t.recursive})}));e.command("query","Query and filter managed test resources in state").option("--filter <filter>","Filter resources by key=value or inferred text search").option("--target <target>","Target a specific resource, testrun, or testplan").option("--generate-config-out <path>","Generate import configuration blocks at PATH").option("--var <var>","Set a variable value").option("--var-file <file>","Load variable values from file").option("--json","Output results formatted as JSON").option("--state <path>","Path to state file").option("--backup <path>","Path to backup file").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);const n=(0,cli_1.resolveVariableParser)(e,t);await(0,query_1.queryCmd)({dir:t,testDirectory:e.testDirectory,filter:e.filter,target:e.target,generateConfigOut:e.generateConfigOut,variables:n,json:Boolean(e.json),verbose:Boolean(e.verbose),statePath:e.state,backupPath:e.backup})}));e.command("print <file>","Print parsed representation of a feature file").option("--format <format>","Print format",{default:"testform"}).action((async(e,t)=>{const n=(0,cli_1.resolveWorkDir)(t);const s=(0,cli_1.resolveVariableParser)(t,n);await(0,print_1.printCmd)({dir:n,file:e,format:t.format||"testform",variables:s})}));e.command("graph","Generate a visual dependency graph of resources").option("--draw-cycles","Highlight cycles in dependency graph").option("--format <format>","Output format for the graph (dot, mermaid, tree) (default: dot)").option("--type <type>","Type of operation graph to output (plan, plan-refresh-only, plan-destroy, apply)").option("--plan <plan>","Render graph using the specified plan file").option("--module-depth <n>","(deprecated) Depth of modules to show in output").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);const n=(0,cli_1.resolveVariableParser)(e,t);await(0,graph_1.graphCmd)({dir:t,drawCycles:e.drawCycles,variables:n,format:e.format||"dot",type:e.type,plan:e.plan,moduleDepth:e.moduleDepth?Number(e.moduleDepth):undefined})}));e.command("login [hostname]","Authenticate with a remote provider").action((async e=>{await(0,login_1.loginCmd)({hostname:e||"github.com"})}));e.command("logout [hostname]","Remove stored credentials").action((async e=>{await(0,logout_1.logoutCmd)({hostname:e||"github.com"})}));e.command("modules","Show all declared modules in a working directory").option("--json","Output results in JSON format").option("--var <var>","Set a variable value").option("--var-file <file>","Load variable values from file").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);await(0,modules_1.modulesCmd)({dir:t,isJson:Boolean(e.json)})}));e.command("providers [action] [...args]","Prints a tree of providers and schemas").option("--json","Output schema representation in JSON format").option("--platform <platform>","Choose target platform").option("--fs-mirror <dir>","Filesystem mirror directory").option("--net-mirror <url>","Network mirror base URL").option("--enable-plugin-cache","Enable plugin cache usage").option("--test-directory <dir>","Directory containing test files").option("--var <var>","Set a variable value").option("--var-file <file>","Load variable values from file").action((async(e,t,n)=>{const s=(0,cli_1.resolveWorkDir)(n);const r=(0,cli_1.resolveVariableParser)(n,s);await(0,providers_1.providersCmd)({dir:s,action:e,args:Array.isArray(t)?t:t?[t]:[],testDirectory:n.testDirectory,variables:r,isJson:Boolean(n.json)})}));e.command("policy","Inspect, enable, or disable validation policies").option("--enable <id>","Enable a specific policy").option("--disable <id>","Disable a specific policy").option("--show <id>","Show detailed description of a policy").option("-s, --scope <scope>","Filter policies by scope (testcase, testrun, testplan)").option("--json","Output policies in JSON format").action((async e=>{const t=(0,cli_1.resolveWorkDir)(e);await(0,policy_1.policyCmd)({dir:t,scope:e.scope,enable:e.enable,disable:e.disable,show:e.show,json:Boolean(e.json),verbose:Boolean(e.verbose)})}));e.command("functions [name]","Inspect and evaluate built-in expression functions").option("--eval <expr>","Evaluate expression live in terminal").action((async(e,t)=>{await(0,functions_1.functionsCmd)({name:e,evalExpr:t.eval})}));e.command("version","Show detailed version information").option("--json","Output the version information as a JSON object.").action((async e=>{await printVersion(Boolean(e?.json),true)}));e.help();e.version(`${const_1.TITLE_APP} v${const_1.VERSION_CLI}`);return e}function handleUnknownCommand(e){const t=["apply","destroy","diff","ephemeral","fmt","force-unlock","functions","graph","import","init","login","logout","modules","output","plan","policy","print","providers","query","refresh","report","show","state","suite","taint","tool","untaint","validate","version","workspace"];const n=(0,utils_1.suggestCommand)(e,t);if(n){console.error(`${const_1.TITLE_APP} has no command named "${e}". Did you mean "${n}"?\n\nTo see all of ${const_1.TITLE_APP}'s top-level commands, run:\n ${const_1.TITLE_CLI} -help`)}else{console.error(`${const_1.TITLE_APP} has no command named "${e}".\n\nTo see all of ${const_1.TITLE_APP}'s top-level commands, run:\n ${const_1.TITLE_CLI} -help`)}process.exit(1)}const main=async()=>{const e=process.argv.slice(2);if(e.some((e=>e==="--no-color"||e==="-no-color"))){chalk_2.default.level=0;process.env.NO_COLOR="1"}if(e.length===0){console.log(help_1.HELP_GLOBAL);process.exit(0)}if(e.includes("--version")||e.includes("-version")||e.includes("-v")&&e.length===1){const t=e.includes("--json")||e.includes("-json");await printVersion(t,false);process.exit(0)}if(e.includes("--help")||e.includes("-help")||e.includes("-h")){const t=e.filter((e=>!e.startsWith("-")));if(t.length===0){console.log(help_1.HELP_GLOBAL);process.exit(0)}const n=t.slice(0,2).join(" ");const s=t[0];if(n){const e=(0,help_1.getCommandHelp)(n);if(e){console.log(e);process.exit(0)}}if(s){const e=(0,help_1.getCommandHelp)(s);if(e){console.log(e);process.exit(0)}handleUnknownCommand(s)}}const t=(0,cli_1.normalizeCliArgs)(e);const n=createCli();try{n.parse([process.argv[0],process.argv[1],...t],{run:false});if(!n.matchedCommand){const t=e.filter((e=>!e.startsWith("-")));const n=t[0];if(n){handleUnknownCommand(n)}else{console.log(help_1.HELP_GLOBAL);process.exit(1)}}await n.runMatchedCommand()}catch(e){if(e instanceof errors_1.TestformError){if(!e.logged){try{logger_1.logger.error(e.message||String(e))}catch{}}process.exit(e.exitCode)}if(e.name==="CACError"){const t=e.message||"";const n=t.toLowerCase();const s=t.replace(/`--([a-zA-Z0-9_-]+)`/g,"`-$1`").replace(/--([a-zA-Z0-9_-]+)/g,"-$1");const r=process.argv.slice(2).find((e=>!e.startsWith("-")))||"";const i=r?`Run '${const_1.TITLE_CLI} ${r} -help' for usage instructions.`:`Run '${const_1.TITLE_CLI} -help' for usage instructions.`;let o="Missing required argument";let a=[s,i];if(n.includes("missing required arg")){const e=t.match(/`([^`]+)`/);const n=e?e[1]:"";const s=n.split(" ")[0]||"";o="Missing required argument";a=[`Missing required argument for command \`${n}\`.`,`Run '${const_1.TITLE_CLI} ${s} -help' for usage instructions.`]}else if(n.includes("unknown option")||n.includes("unknown flag")){o="Failed to parse command-line flags";a=[s,i]}else{o=t.charAt(0).toUpperCase()+t.slice(1)}logger_1.logger.push({type:"error",title:o,detail:a});process.exit(1)}try{logger_1.logger.error(e.message||String(e))}catch{}process.exit(1)}};exports.main=main;var resources_1=__nccwpck_require__(7862);Object.defineProperty(exports,"resource",{enumerable:true,get:function(){return resources_1.resource}});Object.defineProperty(exports,"registerResource",{enumerable:true,get:function(){return resources_1.registerResource}});var policy_2=__nccwpck_require__(2721);Object.defineProperty(exports,"policy",{enumerable:true,get:function(){return policy_2.policy}});Object.defineProperty(exports,"registerPolicy",{enumerable:true,get:function(){return policy_2.registerPolicy}});var evaluator_1=__nccwpck_require__(2825);Object.defineProperty(exports,"evaluateExpression",{enumerable:true,get:function(){return evaluator_1.evaluateExpression}});Object.defineProperty(exports,"interpolateExpressions",{enumerable:true,get:function(){return evaluator_1.interpolateExpressions}});var variables_1=__nccwpck_require__(9922);Object.defineProperty(exports,"VariableParser",{enumerable:true,get:function(){return variables_1.VariableParser}});var config_2=__nccwpck_require__(4489);Object.defineProperty(exports,"Config",{enumerable:true,get:function(){return config_2.Config}});__exportStar(__nccwpck_require__(4855),exports);if(require.main===require.cache[eval("__filename")]||!module.parent){(0,exports.main)().catch((e=>{if(e instanceof errors_1.TestformError){if(!e.logged){try{logger_1.logger.error(e.message||String(e))}catch{}}process.exit(e.exitCode)}try{logger_1.logger.error(e.message||String(e))}catch{}process.exit(1)}))}},1043:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BaseParser=t.FIELD_PATTERN=void 0;const s=n(119);const r=n(8569);const i=n(9896);const o=n(6928);const a=n(6028);const c=n(1859);const l=n(2978);const u=n(9606);const d=n(3912);t.FIELD_PATTERN=/^(?:field)\s+([A-Za-z0-9_.\- ]+?)\s*=\s*(.+)$/i;class BaseParser{dir;variables;moduleRegistry;constructor(e,t){this.dir=e;this.variables=t}getModuleRegistry(){if(!this.moduleRegistry){this.moduleRegistry=new c.ModuleRegistry(this.dir)}return this.moduleRegistry}find(e){return(0,u.findFeatureFiles)(e,true)}format(e,t){const n=e.feature;const s=e.uri??"(unknown)";const r=t||s;const toStep=e=>({keyword:e.keyword,keywordType:e.keywordType,text:e.text});const toBackground=e=>({keyword:e.keyword,name:e.name,steps:(e.steps??[]).map(toStep)});const interpolate=(e,t,n)=>t.reduce(((e,t,s)=>e.split(`<${t}>`).join(n[s])),e);const processChildren=(e,t,i)=>{const o=[];const a=e[0]?.background?toBackground(e[0].background):t;for(const t of e){if(t.background)continue;if(t.scenario){const e=t.scenario;const u=(n?.tags??[]).map((e=>(0,l.restoreTagsWithSpaces)(e.name)));const d=[...u,...(e.tags??[]).map((e=>(0,l.restoreTagsWithSpaces)(e.name)))];const f=d.includes("@unique");const p=e.name.includes("<")||(e.steps??[]).some((e=>e.text.includes("<")))||d.some((e=>e.includes("<")));const h={tags:(n?.tags??[]).map((e=>(0,l.restoreTagsWithSpaces)(e.name))),keyword:n?.keyword??"",name:n?.name??"",description:n?.description??"",location:n?.location.line??0};const m=[];const g=(0,l.reassembleSplitTags)(d,"@module(");for(const e of g){const t=(0,c.parseModuleTargets)(e,this.getModuleRegistry());if(t){for(const e of t){const t=(0,c.resolveModulePath)(r,e.source,this.dir,this.getModuleRegistry());if(t){const n={};const s=e.variable;if(s){for(const[e,t]of Object.entries(s)){if(typeof t==="string"&&this.variables){n[e]=this.variables.applyToTemplate(t)}else{n[e]=t}}}m.push(...(0,c.loadModuleSteps)(t,e.scenario,n,this.variables))}}}}if(f&&p&&(e.examples??[]).length>0){for(const t of e.examples){const n=(t.tableHeader?.cells??[]).map((e=>e.value));for(const r of t.tableBody??[]){const t=(r.cells??[]).map((e=>e.value));o.push({uri:s,feature:h,location:e.location.line,keyword:e.keyword,name:interpolate(e.name,n,t),description:e.description,tags:d.map((e=>interpolate(e,n,t))),steps:[...m,...(e.steps??[]).map((e=>({keyword:e.keyword,keywordType:e.keywordType,text:interpolate(e.text,n,t)})))],...a?{background:JSON.parse(JSON.stringify(a))}:{},...i?{rule:i}:{}})}}}else{o.push({uri:s,feature:h,location:e.location.line,keyword:e.keyword,name:e.name,description:e.description,tags:d,steps:[...m,...(e.steps??[]).map(toStep)],...a?{background:JSON.parse(JSON.stringify(a))}:{},...i?{rule:i}:{}})}}if("rule"in t&&t.rule){const e=t.rule;const r={keyword:e.keyword,name:e.name,description:e.description??""};const i=processChildren(e.children??[],a,r);if(i.length===0){const t=(e.children??[])[0]?.background;const i=t?toBackground(t):a;o.push({uri:s,feature:{keyword:n?.keyword??"",name:n?.name??"",description:n?.description??"",tags:(n?.tags??[]).map((e=>e.name)),location:n?.location?.line??0},location:e.location.line,keyword:e.keyword,name:"*",description:e.description,tags:[...(n?.tags??[]).map((e=>e.name))],steps:[],...i?{background:JSON.parse(JSON.stringify(i))}:{},rule:r})}else{o.push(...i)}}}return o};if(!n)return[];return processChildren(n.children??[])}findProjectRoot(e){const{resolve:t,dirname:s}=n(6928);const{existsSync:r}=n(9896);let i=t(e);const o=t("/");while(i!==o){for(const e of a.CONFIG_FILE_NAMES){const n=t(i,e);if(r(n)){return i}}const e=s(i);if(e===i)break;i=e}return e}content(){const e=this.find(this.dir);const t=[];const n=this.findProjectRoot(this.dir);const a=new Set;for(const u of e){let f=(0,i.readFileSync)(u,"utf-8");if(this.variables){f=this.variables.applyToTemplate(f)}f=(0,l.sanitizeTagsWithSpaces)(f);const p=new s.Parser(new s.AstBuilder(r.IdGenerator.uuid()),new s.GherkinClassicTokenMatcher);let h=null;try{h=p.parse(f)}catch(e){const t=e.message||String(e);const s=t.match(/\((\d+):(\d+)\):\s*(.+)/);const r=s?parseInt(s[1],10):undefined;const i=f.split("\n");const a=r&&i[r-1]?i[r-1].trim():undefined;const c=(0,o.relative)(n,u)||u;const l=t.split("\n").map((e=>e.trim())).filter((e=>e.length>0&&!e.startsWith("Parser errors:")));d.Diag.structureError({file:c,message:"Failed to parse Gherkin feature file",location:{file:c,line:r,snippet:a},detail:l}).abort()}h.uri=(0,o.relative)(n,u);const m=(h.feature?.tags??[]).map((e=>(0,l.restoreTagsWithSpaces)(e.name)));const g=(0,l.reassembleSplitTags)(m,"@module(");for(const s of g){const r=(0,c.parseModuleTargets)(s,this.getModuleRegistry());if(r){for(const s of r){const r=(0,c.resolveModulePath)(u,s.source,n,this.getModuleRegistry());if(r&&!e.includes(r)&&!a.has(r)){a.add(r);try{let e=(0,i.readFileSync)(r,"utf-8");if(this.variables){e=this.variables.applyToTemplate(e)}e=(0,l.sanitizeTagsWithSpaces)(e);const s=p.parse(e);s.uri=(0,o.relative)(n,r);t.push(...this.format(s,r))}catch{}}}}}t.push(...this.format(h,u))}return t}dslFields(e){const t=new Map;const n=new Map;for(const s of e){if(s.source==="step"||s.type==="keywords"){t.set(s.name.toLowerCase(),s)}if(s.source==="tag"||s.type==="tags"){n.set(s.name.toLowerCase(),s)}}return{keywordFields:t,tagFields:n}}compileIdentityMatcher(e){if(!e)return null;const t=e.trim().replace(/^@/,"");if(t.includes("*")){const e=t.split("*");return{type:"wildcard",prefix:e[0],suffix:e[1]||""}}return{type:"exact",value:t}}matchIdentity(e,t){if(t.type==="wildcard"){for(const n of e){const e=n.replace(/^@/,"");if(e.startsWith(t.prefix)&&e.endsWith(t.suffix)){return{identityValue:n,tagToRemove:n}}}return{}}const n=e.find((e=>e.replace(/^@/,"")===t.value));if(n){return{identityValue:n,tagToRemove:n}}return{}}}t.BaseParser=BaseParser},3800:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TestcaseParser=void 0;const s=n(1043);class TestcaseParser extends s.BaseParser{filter(e,t,n){const r=t.identity;const i=t.fields||[];const{keywordFields:o,tagFields:a}=this.dslFields(i);const c=this.compileIdentityMatcher(r);for(const t of e){const e={};if(n){const e=`@${n}`;if(!t.tags)t.tags=[];if(!t.tags.includes(e)){t.tags.push(e)}}const{identityValue:r,tagToRemove:l}=c?this.matchIdentity(t.tags,c):{};t.tags=t.tags.filter((e=>e!=="@unique"));if(l){t.tags=t.tags.filter((e=>e!==l))}if(t.description){const n=t.description.match(/^\s*\*\s*mark\s+status\s*=\s*(.*)$/im);if(n){e["status"]=n[1]?.trim()}}if(t.background){t.background.steps=t.background.steps.filter((n=>{const r=n.text.match(/^\s*(?:\*\s*)?mark\s+status\s*=\s*(.*)$/i);if(r){e["status"]=r[1]?.trim();return false}const i=n.text.match(s.FIELD_PATTERN);if(!i)return true;const a=i[1]?.trim().toLowerCase();const c=i[2]?.trim();if(!a||c===undefined)return true;const l=o.get(a);if(!l){(t.custom??={}).policy??=[];t.custom.policy.push({type:"undeclared-field",field:a});return true}e[l.name]=c;return false}));t.steps=[...t.background.steps,...t.steps];t.background.steps=[]}t.steps=t.steps.filter((n=>{const r=n.text.match(/^\s*(?:\*\s*)?mark\s+status\s*=\s*(.*)$/i);if(r){e["status"]=r[1]?.trim();return false}const i=n.text.match(s.FIELD_PATTERN);if(!i)return true;const a=i[1]?.trim().toLowerCase();const c=i[2]?.trim();if(!a||c===undefined)return true;const l=o.get(a);if(!l){(t.custom??={}).policy??=[];t.custom.policy.push({type:"undeclared-field",field:a});return true}e[l.name]=c;return false}));const tagFilter=t=>{for(const n of a.values()){const s=n.enum??n.values;const r=Array.isArray(s)?s:typeof s==="string"?[s]:[];if(r.includes(t)){e[n.name]=t;return false}}return true};t.tags=t.tags.filter(tagFilter);if(t.feature&&t.feature.tags){t.feature.tags=t.feature.tags.filter(tagFilter)}for(const n of i){if(e[n.name]===undefined&&n.default!==undefined){const t=Array.isArray(n.default)?n.default[0]:n.default;if(t!==undefined){e[n.name]=t}}if(n.required&&!e[n.name]){(t.custom??={}).policy??=[];t.custom.policy.push({type:"required-field",field:n.name});e[n.name]=""}else if(e[n.name]===undefined){e[n.name]=""}}t.custom={...t.custom??{},identity:r,fields:e}}return e}}t.TestcaseParser=TestcaseParser},1741:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TestplanParser=void 0;const s=n(3800);class TestplanParser extends s.TestcaseParser{filter(e,t,n){const s=super.filter(e,t,n);const r={};for(const e of s){(r[e.uri]??=[]).push(e)}return Object.entries(r).map((([e,t])=>{const n=t.some((e=>e.name&&e.name!=="*"));if(n){throw new Error(`Testplan validation failed: Testplans must not contain explicit Scenario blocks. Found in ${e}`)}const s=JSON.parse(JSON.stringify(t[0]));s.custom??={};const r=t.find((e=>e.custom&&e.custom.identity));if(r&&r.custom?.identity){s.custom.identity=r.custom.identity}else{s.custom.identity=e}s.custom.testruns=t.filter((e=>e.rule)).map((e=>e.rule.name));return s}))}}t.TestplanParser=TestplanParser},2853:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TestrunParser=void 0;const s=n(3800);class TestrunParser extends s.TestcaseParser{filter(e,t,n){const s=super.filter(e,t,n);const r={};for(const e of s){(r[e.uri]??=[]).push(e)}return Object.entries(r).map((([e,t])=>{const n=JSON.parse(JSON.stringify(t[0]));n.custom??={};const s=t.find((e=>e.custom&&e.custom.identity));if(s&&s.custom?.identity){n.custom.identity=s.custom.identity}else{n.custom.identity=e}n.custom.testcases=t.filter((e=>e.rule&&e.name)).map((e=>`${e.rule?.name}.${e.name}`));n.custom.groupScenarios=t;return n}))}}t.TestrunParser=TestrunParser},3651:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.loadCustomProvider=loadCustomProvider;const s=n(6928);const r=n(7016);const i=n(9896);async function loadCustomProvider(e,t=process.cwd()){const{source:o,...a}=e;if(!o){throw new Error('Custom provider configuration must specify a "source" path or package name.')}let c;const l=(0,s.resolve)(t,o);if((0,i.existsSync)(l)){try{c=await n(9272)((0,r.pathToFileURL)(l).href)}catch(e){try{c=require(l)}catch(t){throw new Error(`Failed to load custom provider from "${l}": ${e.message||e}`)}}}else{try{c=await n(9272)(o)}catch(e){try{c=require(o)}catch(e){throw new Error(`Could not resolve custom provider from local path "${l}" or package "${o}".`)}}}const u=c.default||c.Provider||c;if(typeof u!=="function"){throw new Error(`Custom provider module from "${o}" does not export a valid constructor class (export default or export class Provider).`)}return new u(a)}},8669:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GitHubAdapter=t.GitHubProvider=void 0;const s=n(1227);const r=n(2633);const i=n(1227);const o=n(6028);class Mutex{mutex=Promise.resolve();lock(){let begin=()=>{};this.mutex=this.mutex.then((()=>new Promise(begin)));return new Promise((e=>{begin=e}))}}const a=new Mutex;class GitHubProvider{token;owner;repo;projectId;config;constructor(e){this.config=e;const t=new r.Credentials;const n=Object.prototype.hasOwnProperty.call(process.env,e.tokenEnv)?process.env[e.tokenEnv]:undefined;let s=t.getToken("github.com")||n||process.env.GITHUB_TOKEN;if(!s&&(e.tokenEnv.startsWith("ghp_")||e.tokenEnv.startsWith("github_pat_")||e.tokenEnv.startsWith("ghs_"))){s=e.tokenEnv}this.token=s||"";this.owner=e.owner;this.repo=e.repository;this.projectId=e.projectId}async ensureToken(){if(this.token)return;s.logger.push({type:"error",title:`GitHub token not found`,detail:[`Environment variable "${this.config.tokenEnv}" is not set.`],close:true})}async request(e,t,s,r=1){await this.ensureToken();const i=t.startsWith("http")?t:`https://api.github.com${t}`;const a=5;try{const c=await fetch(i,{method:e,headers:{Authorization:`Bearer ${this.token}`,Accept:"application/vnd.github.v3+json","X-GitHub-Api-Version":"2022-11-28","Content-Type":"application/json","User-Agent":`${o.TITLE_CLI}/${o.VERSION_CLI}`},body:s?JSON.stringify(s):undefined});if(c.status===403||c.status===429){const i=await c.text();const o=c.status===429||i.toLowerCase().includes("rate limit")||i.toLowerCase().includes("abuse")||i.toLowerCase().includes("secondary");if(o&&r<=a){const i=c.headers.get("retry-after");const o=i?parseInt(i,10):r*3;const l=n(465);console.warn(l.yellow(`\n⚠️ GitHub Rate Limit / Secondary Rate Limit hit. Retrying in ${o} seconds... (Attempt ${r}/${a})`));await new Promise((e=>setTimeout(e,o*1e3)));return this.request(e,t,s,r+1)}else{const e=new Error(i);e.name=`GitHub API Error [${c.status}]`;throw e}}if(!c.ok){const e=await c.text();const t=new Error(e);t.name=`GitHub API Error [${c.status}]`;throw t}if(c.status===204){return null}return await c.json()}catch(i){if(r<=a&&(!i.name||!i.name.startsWith("GitHub API Error"))){const o=r*3;const c=n(465);console.warn(c.yellow(`\n⚠️ Network error: ${i.message}. Retrying in ${o} seconds... (Attempt ${r}/${a})`));await new Promise((e=>setTimeout(e,o*1e3)));return this.request(e,t,s,r+1)}throw i}}async graphql(e,t={}){await this.ensureToken();const n=await this.request("POST","https://api.github.com/graphql",{query:e,variables:t});if(n.errors&&n.errors.length>0){const e=new Error(JSON.stringify(n.errors));e.name="GitHub API Error";throw e}return n.data}async createIssue(e){const t=await this.request("POST",`/repos/${this.owner}/${this.repo}/issues`,{title:e.title,body:e.body,labels:e.labels,assignees:e.assignees,milestone:e.milestone});return{id:t.id,number:t.number,title:t.title??"",state:t.state,node_id:t.node_id,created_at:t.created_at,updated_at:t.updated_at}}async updateIssue(e,t){const n=await this.request("PATCH",`/repos/${this.owner}/${this.repo}/issues/${e}`,{title:t.title,body:t.body,labels:t.labels,assignees:t.assignees,milestone:t.milestone});return{id:n.id,number:n.number,title:n.title??"",state:n.state,node_id:n.node_id,created_at:n.created_at,updated_at:n.updated_at}}async closeIssue(e){await this.request("PATCH",`/repos/${this.owner}/${this.repo}/issues/${e}`,{state:"closed"})}async getIssue(e){try{const t=await this.request("GET",`/repos/${this.owner}/${this.repo}/issues/${e}`);return{id:t.id,number:t.number,title:t.title??"",body:t.body??"",state:t.state,node_id:t.node_id,labels:t.labels?.map((e=>e.name))??[],assignees:t.assignees?.map((e=>e.login))??[],milestone:t.milestone?.title??""}}catch{return null}}async listIssuesByLabel(e){const t=[];let n=1;while(true){const s=await this.request("GET",`/repos/${this.owner}/${this.repo}/issues?labels=${encodeURIComponent(e)}&state=all&per_page=100&page=${n}`);if(s.length===0)break;for(const e of s){t.push({id:e.id,number:e.number,title:e.title??"",state:e.state})}if(s.length<100)break;n++}return t}async getMilestoneByTitle(e){if(!e)return undefined;try{const t=await this.request("GET",`/repos/${this.owner}/${this.repo}/milestones?state=all&per_page=100`);const n=t.find((t=>t.title.toLowerCase()===e.toLowerCase()));return n?n.number:undefined}catch{return undefined}}async createIssueComment(e,t){const n=await this.request("POST",`/repos/${this.owner}/${this.repo}/issues/${e}/comments`,{body:t});return{id:n.id}}async updateIssueComment(e,t){await this.request("PATCH",`/repos/${this.owner}/${this.repo}/issues/comments/${e}`,{body:t})}async listIssueComments(e){const t=[];let n=1;while(true){const s=await this.request("GET",`/repos/${this.owner}/${this.repo}/issues/${e}/comments?per_page=100&page=${n}`);if(s.length===0)break;for(const e of s){t.push({id:e.id,body:e.body})}if(s.length<100)break;n++}return t}projectNodeId;projectFields;async resolveProjectMetadata(){if(this.projectNodeId&&this.projectFields)return{id:this.projectNodeId,fields:this.projectFields};if(!this.projectId)return undefined;const e=`\n id\n fields(first: 100) {\n nodes {\n ... on ProjectV2Field { id name dataType }\n ... on ProjectV2SingleSelectField { id name dataType options { id name } }\n ... on ProjectV2IterationField { id name dataType configuration { iterations { id title } } }\n }\n }\n `;if(typeof this.projectId==="string"&&this.projectId.startsWith("PVT_")){try{const t=await this.graphql(`\n query($id: ID!) {\n node(id: $id) {\n ... on ProjectV2 {\n ${e}\n }\n }\n }\n `,{id:this.projectId});if(t?.node?.id){this.projectNodeId=t.node.id;this.projectFields=t.node.fields?.nodes||[];return{id:this.projectNodeId,fields:this.projectFields}}}catch(e){}}const t=typeof this.projectId==="number"?this.projectId:parseInt(String(this.projectId),10);if(!isNaN(t)){try{const n=await this.graphql(`\n query($login: String!, $number: Int!) {\n user(login: $login) {\n projectV2(number: $number) {\n ${e}\n }\n }\n }\n `,{login:this.owner,number:t});if(n?.user?.projectV2?.id){this.projectNodeId=n.user.projectV2.id;this.projectFields=n.user.projectV2.fields.nodes;return{id:this.projectNodeId,fields:this.projectFields}}}catch(e){}try{const n=await this.graphql(`\n query($login: String!, $number: Int!) {\n organization(login: $login) {\n projectV2(number: $number) {\n ${e}\n }\n }\n }\n `,{login:this.owner,number:t});if(n?.organization?.projectV2?.id){this.projectNodeId=n.organization.projectV2.id;this.projectFields=n.organization.projectV2.fields.nodes;return{id:this.projectNodeId,fields:this.projectFields}}}catch(e){}}const s=n(465);console.warn(s.yellow(`\n⚠️ Warning: Could not resolve GitHub Project V2 with ID ${this.projectId} for owner "${this.owner}".`));console.warn(s.yellow(` If "${this.owner}" is a User account and you are authenticating via a GitHub App,`));console.warn(s.yellow(` note that GitHub Apps are technically not allowed to access User-level Projects.`));console.warn(s.yellow(` Please use a Personal Access Token (PAT) instead.\n`));return undefined}async addToProject(e){const t=await this.resolveProjectMetadata();if(!t)return undefined;let n=0;const s=3;while(n<s){const r=await a.lock();try{const n=await this.graphql(`\n mutation($projectId: ID!, $contentId: ID!) {\n addProjectV2ItemById(input: {projectId: $projectId, contentId: $contentId}) {\n item { id }\n }\n }\n `,{projectId:t.id,contentId:e});r();return n?.addProjectV2ItemById?.item?.id}catch(e){r();n++;if(n>=s){const t=new Error(`Failed to link issue to GitHub Project: ${e.message}`);t.name="GitHubProjectError";throw t}await new Promise((e=>setTimeout(e,1e3*Math.pow(2,n-1))))}}}async updateProjectItemFields(e,t){const n=await this.resolveProjectMetadata();if(!n||!n.fields)return;const s=[];const r={projectId:n.id,itemId:e};let o=0;for(const[e,a]of Object.entries(t)){const t=n.fields.find((t=>t.name&&t.name.toLowerCase()===e.toLowerCase()));if(!t)continue;let c=undefined;if(t.dataType==="TEXT"){if(a!==undefined&&a!==null){c={text:String(a)}}}else if(t.dataType==="NUMBER"){if(a!==undefined&&a!==null){const e=Number(a);if(!isNaN(e)){c={number:e}}}}else if(t.dataType==="DATE"){if(a!==undefined&&a!==null){const e=String(a).split("T")[0];if(/^\d{4}-\d{2}-\d{2}$/.test(e)){c={date:e}}else{c={date:String(a)}}}}else if(t.dataType==="SINGLE_SELECT"&&t.options){if(typeof a==="string"){const e=a.startsWith("@")?a.substring(1):a;const n=t.options.find((t=>t.name.toLowerCase()===e.toLowerCase()));if(n){c={singleSelectOptionId:n.id}}else{i.logger.warn(`Option "${a}" not found for Single Select field "${t.name}".`)}}}else if(t.dataType==="ITERATION"&&t.configuration?.iterations){if(typeof a==="string"){const e=a.startsWith("@")?a.substring(1):a;const n=t.configuration.iterations.find((t=>t.title.toLowerCase()===e.toLowerCase()));if(n){c={iterationId:n.id}}else{i.logger.warn(`Iteration "${a}" not found for Iteration field "${t.name}".`)}}}if(!c)continue;const l=`fieldId${o}`;const u=`value${o}`;r[l]=t.id;r[u]=c;s.push(`\n f${o}: updateProjectV2ItemFieldValue(input: {\n projectId: $projectId\n itemId: $itemId\n fieldId: $${l}\n value: $${u}\n }) { projectV2Item { id } }\n `);o++}if(s.length===0)return;const c=[`$projectId: ID!`,`$itemId: ID!`,...Array.from({length:o},((e,t)=>`$fieldId${t}: ID!, $value${t}: ProjectV2FieldValue!`))].join(", ");const l=`mutation(${c}) {\n ${s.join("\n")}\n }`;let u=0;const d=3;while(u<d){const e=await a.lock();try{await this.graphql(l,r);e();break}catch(t){e();u++;if(u>=d){const e=new Error(`Failed to assign custom fields: ${t.message}`);e.name="GitHubProjectError";throw e}await new Promise((e=>setTimeout(e,1e3*Math.pow(2,u-1))))}}}async getProjectItemFields(e){const t=await this.resolveProjectMetadata();if(!t||!t.fields)return{};try{const n=await this.graphql(`\n query($id: ID!) {\n node(id: $id) {\n ... on Issue {\n projectItems(first: 10) {\n nodes {\n project { id }\n fieldValues(first: 100) {\n nodes {\n ... on ProjectV2ItemFieldTextValue { text field { ... on ProjectV2FieldCommon { name } } }\n ... on ProjectV2ItemFieldNumberValue { number field { ... on ProjectV2FieldCommon { name } } }\n ... on ProjectV2ItemFieldDateValue { date field { ... on ProjectV2FieldCommon { name } } }\n ... on ProjectV2ItemFieldSingleSelectValue { name field { ... on ProjectV2FieldCommon { name } } }\n ... on ProjectV2ItemFieldIterationValue { title field { ... on ProjectV2FieldCommon { name } } }\n }\n }\n }\n }\n }\n }\n }\n `,{id:e});const s=n?.node?.projectItems?.nodes||[];const r=s.find((e=>e.project?.id===t.id));if(!r||!r.fieldValues||!r.fieldValues.nodes)return{};const i=Object.create(null);for(const e of r.fieldValues.nodes){const t=e.field?.name;if(!t)continue;let n="";if(e.text!==undefined)n=e.text;else if(e.name!==undefined)n=e.name;else if(e.title!==undefined)n=e.title;else if(e.date!==undefined)n=e.date;else if(e.number!==undefined)n=String(e.number);i[t.toLowerCase()]=n}return i}catch{return{}}}async getIssueNodeId(e){try{const t=await this.request("GET",`/repos/${this.owner}/${this.repo}/issues/${e}`);return t.node_id??null}catch{return null}}formatRemoteId(e){return`${this.repo}:${e}`}async addSubIssue(e,t){try{await this.request("POST",`/repos/${this.owner}/${this.repo}/issues/${e}/sub_issues`,{sub_issue_id:t,replace_parent:true})}catch(e){if(!e.message.includes("422")){throw e}}}}t.GitHubProvider=GitHubProvider;t.GitHubAdapter=GitHubProvider},5320:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(8669),t);r(n(8567),t)},8567:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.generateGitHubTestrunComment=generateGitHubTestrunComment;t.evaluateGitHubTestrunComments=evaluateGitHubTestrunComments;t.buildGitHubTestplanBody=buildGitHubTestplanBody;const s=n(6928);function generateGitHubTestrunComment(e,t,n,s){return`**Origin:** ${e}\n<table border="1" width="100%">\n <tr>\n <th colspan="3">Feature Name</th>\n </tr>\n <tr>\n <td>${t}</td>\n <td>${n}</td>\n <td>${s}</td>\n </tr>\n <tr>\n <td colspan="3"><br/></td>\n </tr>\n </table>`}function evaluateGitHubTestrunComments(e,t){const n=e.custom?.testcases||[];if(n.length===0||!t?.state)return[];const r=t.state;const i=[];const o=new Set;const a=[...n].sort(((e,t)=>{const n=e.split(".").pop()?.replace("@","")||"";const s=t.split(".").pop()?.replace("@","")||"";return n.localeCompare(s,undefined,{numeric:true,sensitivity:"base"})}));for(const n of a){const a=n.match(/@?(tc-[a-zA-Z0-9_-]+)/i);const c=a?a[1].toLowerCase():null;const l=n.split(".");const u=l.pop()||"";const d=u.replace(/^@/,"").toLowerCase();const f=n.replace(/\\/g,"/");const p=l.join(".");const h=p.replace(".case.feature","").replace(".feature","").replace(/\\/g,"/");const m=(0,s.basename)(h);const g=r.getResources("github_testcase").filter((e=>{const t=(e.identity||"").replace(/\\/g,"/");const n=t.split(".").pop()?.replace(/^@/,"").toLowerCase();const s=t.includes(h)||t.includes(m);if(!s)return false;if(d==="*"||n===d||c&&n===c){return true}const r=(e.attributes?.title||"").toLowerCase();if(r&&(r===d||r===u.toLowerCase())){return true}return false}));const y=new Set(g.map((e=>{const t=(e.identity||"").replace(/\\/g,"/");const n=t.lastIndexOf(".");return n!==-1?t.slice(0,n):t})));let b=g;if(y.size>1){if(t?.testDirectory){const e=t.testDirectory.replace(/^\.\//,"").replace(/\\/g,"/");b=g.filter((t=>(t.identity||"").replace(/\\/g,"/").startsWith(e)))}else{continue}}b.sort(((e,t)=>{const n=e.identity.split(".").pop()?.replace("@","")||"";const s=t.identity.split(".").pop()?.replace("@","")||"";return n.localeCompare(s,undefined,{numeric:true,sensitivity:"base"})}));for(const n of b){const r=n.identity;const a=r.replace(/\\/g,"/");const c=a.split(".").pop()?.replace(/^@/,"").toLowerCase()||"";let l=e.custom?.groupScenarios?.find((e=>{if(!e.name)return false;const t=e.name.replace(/^@/,"").toLowerCase();const r=e.rule?e.rule.name.replace(".case.feature","").replace(".feature","").replace(/\\/g,"/"):"";const i=!r||a.includes(r)||a.includes((0,s.basename)(r));if(!i)return false;if(t==="*"||t===c){return true}const o=(n.attributes?.title||"").toLowerCase();if(o&&t===o){return true}return false}));if(!l){l=e.custom?.groupScenarios?.find((e=>{if(!e.name)return false;const t=e.name.replace(/^@/,"").toLowerCase();const n=e.rule?e.rule.name.replace(".case.feature","").replace(".feature","").replace(/\\/g,"/"):"";const r=!n||a.includes(n)||a.includes((0,s.basename)(n));return r&&t==="*"}))}const u=l?.custom?.fields?.status||t?.existingAttributes?.testcaseStatuses?.[r]||t?.existingAttributes?.testcaseStatuses?.[a]||"pending";const d=n.attributes?.title||r;const f=r.lastIndexOf(".");const p=f!==-1?r.slice(0,f):r;const h=f!==-1?r.slice(f+1):"";const m=(0,s.basename)(p||"");const g=h?h.replace("@",""):"";const y=generateGitHubTestrunComment(m,g,d,u);if(!o.has(r)){o.add(r);i.push({identity:r,status:u,body:y,title:d})}}}return i}function buildGitHubTestplanBody(e,t){let n=e.feature?.description||"";const r=e.custom?.testruns||[];if(r.length>0&&t?.state){n+="\n\n### Test Runs\n";const e=t.state;for(const i of r){const r=i.replace(/\\/g,"/");const o=r.endsWith(".run.feature")?r:r+".run.feature";const a=(0,s.basename)(o);const c=e.getResources("github_testrun").filter((e=>{const t=(e.identity||"").replace(/\\/g,"/");const n=t.lastIndexOf(".");const s=n!==-1?t.slice(0,n):t;return s.endsWith(r)||t.endsWith(r)||s.endsWith(a)||t.endsWith(a)||s===r}));const l=new Set(c.map((e=>{const t=(e.identity||"").replace(/\\/g,"/");const n=t.lastIndexOf(".");return n!==-1?t.slice(0,n):t})));let u=c;if(l.size>1){if(t?.testDirectory){const e=t.testDirectory.replace(/^\.\//,"").replace(/\\/g,"/");u=c.filter((t=>(t.identity||"").replace(/\\/g,"/").startsWith(e)));const n=new Set(u.map((e=>{const t=(e.identity||"").replace(/\\/g,"/");const n=t.lastIndexOf(".");return n!==-1?t.slice(0,n):t})));if(n.size>1){throw new Error(`Multiple testruns found for rule "${i}". Please specify a more exact path or use -test-directory to limit the scope.`)}}else{throw new Error(`Multiple testruns found for rule "${i}". Please specify a more exact path or use -test-directory to limit the scope.`)}}if(u.length>0){for(const e of u){if(e?.attributes?.issueNumber){n+=`- [ ] #${e.attributes.issueNumber}\n`}else{n+=`- [ ] (known after apply) - ${e.identity}\n`}}}else{n+=`- [ ] (not found in state) - ${i}\n`}}}return n.trim()}},1936:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GitLabProvider=void 0;class GitLabProvider{config;host;projectId;token;boardId;constructor(e){this.config=e;this.host=e.host||"https://gitlab.com";this.projectId=e.projectId;const t=e.tokenEnv||"GITLAB_TOKEN";this.token=process.env[t]||"";this.boardId=e.boardId}async createIssue(e){throw new Error("GitLab provider createIssue is not yet fully implemented.")}async updateIssue(e,t){throw new Error("GitLab provider updateIssue is not yet fully implemented.")}async closeIssue(e){throw new Error("GitLab provider closeIssue is not yet fully implemented.")}async getIssue(e){return null}async listIssuesByLabel(e){return[]}async getMilestoneByTitle(e){return undefined}async createIssueComment(e,t){throw new Error("GitLab provider createIssueComment is not yet fully implemented.")}async updateIssueComment(e,t){throw new Error("GitLab provider updateIssueComment is not yet fully implemented.")}async listIssueComments(e){return[]}formatRemoteId(e){return`GL#${e}`}}t.GitLabProvider=GitLabProvider},7486:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(9933),t);r(n(5095),t);r(n(3651),t);r(n(5320),t);r(n(942),t);r(n(1936),t)},9933:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},5095:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createProvider=createProvider;const s=n(5320);const r=n(942);const i=n(1936);const o=n(3651);async function createProvider(e,t=process.cwd()){const n=e.getProviderType();const a=e.getProviderConfig(n);if(n==="local"){return new r.LocalProvider(t)}if(n==="github"){const t=e.getGitHub();if(!t){throw new Error("GitHub provider configuration is missing required fields (owner, repository).")}return new s.GitHubProvider(t)}if(n==="gitlab"){return new i.GitLabProvider(a)}if(n==="custom"||a.source){return await(0,o.loadCustomProvider)(a,t)}return new r.LocalProvider(t)}},942:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();Object.defineProperty(t,"__esModule",{value:true});t.LocalAdapter=t.LocalProvider=void 0;const o=i(n(9896));const a=i(n(6928));const c=n(6028);class LocalProvider{dbPath;db;constructor(e="."){this.dbPath=a.resolve(e,c.FILE_DATA);this.db=this.loadDB()}loadDB(){if(o.existsSync(this.dbPath)){try{const e=o.readFileSync(this.dbPath,"utf8");return JSON.parse(e)}catch(e){console.error(`Error reading ${this.dbPath}`,e)}}return{issues:[],next_issue_number:1,next_comment_id:1}}saveDB(){const e=a.dirname(this.dbPath);if(!o.existsSync(e)){o.mkdirSync(e,{recursive:true})}o.writeFileSync(this.dbPath,JSON.stringify(this.db,null,2),"utf8")}async createIssue(e){const t=this.db.next_issue_number++;const n=(new Date).toISOString();const s={id:t,number:t,title:e.title,body:e.body,state:e.state||"open",node_id:`local_node_${t}`,labels:e.labels,assignees:e.assignees,milestone:e.milestone?String(e.milestone):undefined,created_at:n,updated_at:n,comments:[],custom_fields:{}};this.db.issues.push(s);this.saveDB();return s}async updateIssue(e,t){const n=this.db.issues.find((t=>String(t.number)===String(e)));if(!n){throw new Error(`Issue #${e} not found`)}if(t.title!==undefined)n.title=t.title;if(t.body!==undefined)n.body=t.body;if(t.state!==undefined)n.state=t.state;if(t.labels!==undefined)n.labels=t.labels;if(t.assignees!==undefined)n.assignees=t.assignees;if(t.milestone!==undefined)n.milestone=String(t.milestone);n.updated_at=(new Date).toISOString();this.saveDB();return n}async closeIssue(e){await this.updateIssue(e,{state:"closed"})}async getIssue(e){const t=this.db.issues.find((t=>String(t.number)===String(e)));return t||null}async listIssuesByLabel(e){return this.db.issues.filter((t=>t.labels?.includes(e)))}async getMilestoneByTitle(e){return e}async createIssueComment(e,t){const n=this.db.issues.find((t=>String(t.number)===String(e)));if(!n){throw new Error(`Issue #${e} not found`)}const s=this.db.next_comment_id++;n.comments.push({id:s,body:t});this.saveDB();return{id:s}}async updateIssueComment(e,t){for(const n of this.db.issues){const s=n.comments.find((t=>String(t.id)===String(e)));if(s){s.body=t;this.saveDB();return}}throw new Error(`Comment #${e} not found`)}async listIssueComments(e){const t=this.db.issues.find((t=>String(t.number)===String(e)));if(!t){throw new Error(`Issue #${e} not found`)}return t.comments}async addToProject(e){return String(e)}async updateProjectItemFields(e,t){const n=this.db.issues.find((t=>String(t.node_id)===String(e)||String(t.number)===String(e)));if(n){n.custom_fields={...n.custom_fields,...t};this.saveDB()}}async getProjectItemFields(e){const t=this.db.issues.find((t=>String(t.node_id)===String(e)||String(t.number)===String(e)));return t?.custom_fields||{}}formatRemoteId(e){return`local:${e}`}async addSubIssue(e,t){}}t.LocalProvider=LocalProvider;t.LocalAdapter=LocalProvider},5440:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.builtinReports=void 0;const s=n(2978);function resolveItemUrl(e){const t=e.originalResource?.attributes||{};if(t.html_url)return String(t.html_url);if(t.url)return String(t.url);if(e.issueNumber&&e.type.includes("github")){return`https://github.com/issues/${e.issueNumber}`}return undefined}t.builtinReports={"testcase-summary":{name:"testcase-summary",description:"Test case execution status and overview",collect(e){const t=e.items.filter((e=>e.canonicalScope==="testcase"));const n=t.length>0?t:e.items;return{title:"Informe de Casos de Prueba",metrics:{total:e.stats.total,passed:e.stats.passed,failed:e.stats.failed,pending:e.stats.pending,blocked:e.stats.blocked,skipped:e.stats.skipped,unexecuted:e.stats.unexecuted,tasa_exito:e.stats.total>0?`${Math.round(e.stats.passed/e.stats.total*100)}%`:"0%"},headers:["ID","Título","Etiquetas","Estado","Asignado"],rows:n.map((e=>[e.id,e.title,e.labels.join(", ")||"-",e.status,e.assignees[0]||"-"]))}}},"testrun-summary":{name:"testrun-summary",description:"Summary of test runs and execution metrics",collect(e){const t=e.stateQuery.group(e.items.filter((e=>e.testRunId)),"testrun");const n=[];for(const[s,r]of Object.entries(t)){if(s==="none")continue;const t=e.stateQuery.getStats(r);n.push([s,r.length,t.passed,t.failed,t.blocked,t.passed===r.length&&r.length>0?"Passed":t.failed>0?"Failed":"In Progress"])}return{title:"Test Run Summary",metrics:{"Total Test Runs":e.stats.totalRuns,active_runs:e.stats.activeRuns,closed_runs:e.stats.closedRuns,total_cases:e.stats.total,passed:e.stats.passed,failed:e.stats.failed},headers:["Test Run","Total Casos","Passed","Failed","Blocked","Estado"],rows:n.length>0?n:[["Sin ejecuciones",0,0,0,0,"-"]]}}},"testrun-detailed":{name:"testrun-detailed",description:"Detailed test cases and priorities per test run",collect(e){const t=e.items.filter((e=>e.canonicalScope==="testcase"&&e.testRunId));const n=t.length>0?t:e.items.filter((e=>e.canonicalScope==="testcase"));return{title:"Test Run Detailed Report",metrics:{total_runs:e.stats.totalRuns,total_cases:n.length,passed:e.stats.passed,failed:e.stats.failed},headers:["Test Run","Test Case ID","Título","Estado","Prioridad","Asignado"],rows:n.map((e=>{const t=e.custom_fields["priority"]||(0,s.resolvePath)(e.originalResource,"attributes.custom_fields.priority")||"Medium";return[e.testRunId||"General",e.id,e.title,e.status,String(t),e.assignees[0]||"-"]}))}}},"testplan-summary":{name:"testplan-summary",description:"Progress and metrics across test plans",collect(e){const t=e.stateQuery.getResources().filter((e=>e.type.includes("testplan")));const n=e.items.filter((e=>e.canonicalScope==="testplan"));const s=new Set(n.map((e=>e.id)));const r=s.size>0?t.filter((e=>s.has(e.identity))):t;const i=[];for(const t of r){const n=t.attributes.testruns||[];const s=e.items.filter((e=>e.testRunId&&n.some((t=>e.testRunId.endsWith(t)))));const r=e.stateQuery.getStats(s);const o=s.length>0?Math.round(r.passed/s.length*100):0;i.push([t.identity,String(t.attributes.title||t.identity),n.length,s.length,r.passed,r.failed,`${o}%`])}return{title:"Test Plan Summary",metrics:{total_plans:e.stats.totalPlans,total_cases:e.stats.total,passed:e.stats.passed,failed:e.stats.failed},headers:["Plan ID","Título","Runs Vinculados","Casos","Passed","Failed","Progreso %"],rows:i.length>0?i:[["Sin planes","-",0,0,0,0,"0%"]]}}},defects:{name:"defects",description:"Failed or blocked test cases with remote defect and issue tracking references",collect(e){const t=e.items.filter((e=>["failed","blocked"].includes(e.status.toLowerCase())));return{title:"Informe de Defectos",metrics:{total_defectos:t.length,failed:t.filter((e=>e.status.toLowerCase()==="failed")).length,blocked:t.filter((e=>e.status.toLowerCase()==="blocked")).length},headers:["Run","Test Case","Título","Estado","Issue","Asignado"],rows:t.length>0?t.map((e=>{const t=resolveItemUrl(e);const n=e.issueNumber?t?`[#${e.issueNumber}](${t})`:`#${e.issueNumber}`:e.remoteId&&!e.remoteId.startsWith("local:")?e.remoteId:"-";return[e.testRunId||"-",e.id,e.title,e.status,n,e.assignees[0]||"-"]})):[["-","Sin defectos","No se encontraron pruebas fallidas o bloqueadas.","Passed","-","-"]]}}},traceability:{name:"traceability",description:"Requirement and feature traceability matrix against test coverage",collect(e){const t=e.stateQuery.group(e.items,e.groupBy||"feature");const n=[];for(const[e,s]of Object.entries(t)){const t=s.length;const r=s.filter((e=>e.status.toLowerCase()==="passed")).length;const i=s.filter((e=>e.status.toLowerCase()==="failed")).length;const o=t>0?Math.round(r/t*100):0;n.push([e,t,r,i,`${o}%`])}return{title:"Requirement Traceability Report",metrics:{total_requisitos:Object.keys(t).length,total_casos:e.items.length,passed:e.stats.passed},headers:["Requisito / Feature","Total Pruebas","Passed","Failed","Cobertura %"],rows:n.length>0?n:[["Sin requisitos",0,0,0,"0%"]]}}},coverage:{name:"coverage",description:"Coverage and pass rate distribution grouped by labels and tags",collect(e){const t=e.stateQuery.group(e.items,"labels");const n=[];for(const[e,s]of Object.entries(t)){const t=s.length;const r=s.filter((e=>e.status.toLowerCase()==="passed")).length;const i=s.filter((e=>e.status.toLowerCase()==="failed")).length;const o=t>0?Math.round(r/t*100):0;n.push([e.startsWith("@")?e:`@${e}`,t,r,i,`${o}%`])}return{title:"Informe de Cobertura por Etiquetas",metrics:{total_etiquetas:Object.keys(t).length,total_casos:e.items.length},headers:["Etiqueta","Total","Passed","Failed","Cobertura %"],rows:n.length>0?n:[["@untagged",0,0,0,"0%"]]}}},"two-dimensional":{name:"two-dimensional",description:"Cross-tabulation matrix of tags against execution status distribution",collect(e){const t=e.stateQuery.group(e.items,"labels");const n=["passed","failed","pending","blocked","skipped","unexecuted"];const s=[];for(const[e,n]of Object.entries(t)){const t={};for(const e of n){const n=e.status.toLowerCase();t[n]=(t[n]||0)+1}s.push([e.startsWith("@")?e:`@${e}`,t["passed"]||0,t["failed"]||0,t["pending"]||0,t["blocked"]||0,t["skipped"]||0,t["unexecuted"]||0,n.length])}return{title:"Informe Bidimensional de Estados",metrics:{total_etiquetas:Object.keys(t).length,total_casos:e.items.length},headers:["Etiqueta","Passed","Failed","Pending","Blocked","Skipped","Unexecuted","Total"],rows:s.length>0?s:[["@untagged",0,0,0,0,0,0,0]]}}},"test-case-activity":{name:"test-case-activity",description:"Automation metrics, recent activity, and modified test cases",collect(e){let t=0;const n=e.items.filter((e=>e.canonicalScope==="testcase"));for(const e of n){const n=String(e.custom_fields["automation"]||e.custom_fields["automate"]||(0,s.resolvePath)(e.originalResource,"attributes.custom_fields.automation")||"").toLowerCase();if(n==="true"||n==="yes"||n==="automated"){t++}}const r=n.length;const i=r>0?Math.round(t/r*100):0;return{title:"Test Case Activity & Automation",metrics:{total_casos:r,automatizados:t,no_automatizados:r-t,tasa_automatizacion:`${i}%`},headers:["ID","Título","Prioridad","Automatizado","Modificado","Asignado"],rows:n.slice(0,50).map((e=>{const t=e.custom_fields["priority"]||(0,s.resolvePath)(e.originalResource,"attributes.custom_fields.priority")||"Medium";const n=String(e.custom_fields["automation"]||e.custom_fields["automate"]||"No");return[e.id,e.title,String(t),n,(e.updatedAt||"").split("T")[0]||"-",e.assignees[0]||"-"]}))}}},raw:{name:"raw",description:"Raw unaggregated export of all filtered state resources",collect(e){return{title:"Raw Data Export",metrics:{total_recursos:e.items.length},headers:["ID","Title","Status","Labels","Assignees","Milestone","TestRun","IssueNumber"],rows:e.items.map((e=>[e.id,e.title,e.status,e.labels.join(" "),e.assignees.join(" "),e.milestone||"",e.testRunId||"",e.issueNumber??""])),metadata:{rawItems:e.items.map((e=>{const t=resolveItemUrl(e);return{id:e.id,type:e.type,title:e.title,status:e.status,labels:e.labels,assignees:e.assignees,milestone:e.milestone||"",testRunId:e.testRunId||"",testPlanId:e.testPlanId||"",issueNumber:e.issueNumber,url:t,issueUrl:t,custom_fields:e.custom_fields,createdAt:e.createdAt,updatedAt:e.updatedAt,originalResource:e.originalResource}}))}}}}}},7623:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.coreFormats=t.XlsxFormat=t.DocxFormat=t.CsvFormat=t.JsonFormat=t.MarkdownFormat=void 0;const s=n(2825);const r=n(9896);const i=n(6928);const o=n(8081);const a=n(1227);const c={passed:"✅",failed:"❌",pending:"⏳",blocked:"⚠️",skipped:"⏭️",unexecuted:"❔"};t.MarkdownFormat={name:"md",extension:".md",isBinary:false,render(e,t,n){if(n){const r=typeof n==="string"?n:n.toString("utf-8");const i={vars:t.variables,variables:t.variables,data:{report:{title:e.title,metrics:e.metrics||{},headers:e.headers,rows:e.rows}}};let o=(0,s.interpolateExpressions)(r,i);o=o.replace(/\$\{report\.title\}/g,e.title);if(e.metrics){for(const[t,n]of Object.entries(e.metrics)){o=o.replace(new RegExp(`\\$\\{report\\.metrics\\.${t}\\}`,"g"),String(n))}}return o}const r=[];r.push(`# ${e.title}`);r.push("");if(e.metrics&&Object.keys(e.metrics).length>0){const t=Object.entries(e.metrics).map((([e,t])=>`**${e}:** \`${t}\``)).join(" | ");r.push(t);r.push("")}if(e.headers.length>0){r.push(`| ${e.headers.join(" | ")} |`);r.push(`| ${e.headers.map((()=>"---")).join(" | ")} |`);for(const t of e.rows){const e=t.map((e=>{const t=String(e);const n=c[t.toLowerCase()];return n?`${n} ${t}`:t}));r.push(`| ${e.join(" | ")} |`)}r.push("")}return r.join("\n")}};t.JsonFormat={name:"json",extension:".json",isBinary:false,render(e,t,n){if(n){const r=typeof n==="string"?n:n.toString("utf-8");return(0,s.interpolateExpressions)(r,{vars:{...t.variables,...e.metrics}})}if(e.metadata?.rawItems){return JSON.stringify(e.metadata.rawItems,null,2)}return JSON.stringify({title:e.title,metrics:e.metrics||{},headers:e.headers,rows:e.rows,metadata:e.metadata||{}},null,2)}};t.CsvFormat={name:"csv",extension:".csv",isBinary:false,render(e){const t=[];t.push(e.headers.join(","));if(e.metadata?.rawItems){for(const n of e.metadata.rawItems){const e=[n.id,`"${(n.title||"").replace(/"/g,'""')}"`,n.status,`"${(n.labels||[]).join(" ")}"`,`"${(n.assignees||[]).join(" ")}"`,`"${n.milestone||""}"`,n.testRunId||"",n.issueNumber||""];t.push(e.join(","))}return t.join("\n")}const escapeCsv=e=>{const t=String(e??"");if(t.includes(",")||t.includes('"')||t.includes("\n")||t.includes(" ")||t.startsWith("@")){return`"${t.replace(/"/g,'""')}"`}return t};for(const n of e.rows){t.push(n.map(escapeCsv).join(","))}return t.join("\n")}};t.DocxFormat={name:"docx",extension:".docx",isBinary:true,async render(e,t,n){let s;try{s=(0,o.loadDriver)("docx")}catch{a.logger.push({type:"error",title:'Missing optional package "docx"',detail:['The "docx" package is required to generate Word (.docx) reports.',"Please install it globally or locally in your project:",""," npm install -g docx"," # or"," npm install --save-dev docx"],close:true})}const{Document:c,Paragraph:l,Table:u,TableRow:d,TableCell:f,TextRun:p,HeadingLevel:h,WidthType:m,BorderStyle:g,VerticalAlign:y,PatchType:b,patchDocument:v,Packer:w,AlignmentType:T}=s;let S=null;if(n){if(typeof n==="string"){if(!(0,r.existsSync)(n)){a.logger.push({type:"error",title:`Template file not found: ${n}`,detail:["The specified Word template path does not exist on disk.","Verify the path or omit the -template flag to use the default template."],close:true})}S=(0,r.readFileSync)(n)}else{S=n}}else{const e=[(0,i.resolve)(process.cwd(),".testform","reports","report.docx"),(0,i.resolve)(process.cwd(),"templates","report.docx"),(0,i.resolve)(__dirname,"..","..","templates","report.docx")];for(const t of e){if((0,r.existsSync)(t)){try{S=(0,r.readFileSync)(t);break}catch{}}}}if(S){try{const n={};const s=t.variables||{};const r=new Date;const i=`${r.getDate().toString().padStart(2,"0")}/${(r.getMonth()+1).toString().padStart(2,"0")}/${r.getFullYear()}`;for(const[e,t]of Object.entries(s)){n[e]={type:b.PARAGRAPH,children:[new p({text:String(t)})]};n[`var.${e}`]={type:b.PARAGRAPH,children:[new p({text:String(t)})]}}if(e.metrics){for(const[t,s]of Object.entries(e.metrics)){n[t]={type:b.PARAGRAPH,children:[new p({text:String(s)})]};n[`report.${t}`]={type:b.PARAGRAPH,children:[new p({text:String(s)})]};n[`report.metrics.${t}`]={type:b.PARAGRAPH,children:[new p({text:String(s)})]}}}n["title"]={type:b.PARAGRAPH,children:[new p({text:e.title,bold:true})]};n["report.title"]={type:b.PARAGRAPH,children:[new p({text:e.title,bold:true})]};n["date"]={type:b.PARAGRAPH,children:[new p({text:i})]};n["total"]={type:b.PARAGRAPH,children:[new p({text:String(e.metrics?.total||e.rows.length)})]};n["report.total"]={type:b.PARAGRAPH,children:[new p({text:String(e.metrics?.total||e.rows.length)})]};n["passed"]={type:b.PARAGRAPH,children:[new p({text:String(e.metrics?.passed||0)})]};n["report.passed"]={type:b.PARAGRAPH,children:[new p({text:String(e.metrics?.passed||0)})]};n["failed"]={type:b.PARAGRAPH,children:[new p({text:String(e.metrics?.failed||0)})]};n["report.failed"]={type:b.PARAGRAPH,children:[new p({text:String(e.metrics?.failed||0)})]};const o=[new d({children:e.headers.map((e=>new f({verticalAlign:y.CENTER,children:[new l({children:[new p({text:e,bold:true})]})]})))}),...e.rows.map((e=>new d({children:e.map((e=>new f({verticalAlign:y.CENTER,children:[new l({text:String(e)})]})))})))];const a={type:b.DOCUMENT,children:[new u({width:{size:9634,type:m.DXA},borders:{top:{style:g.SINGLE,size:6,color:"BFBFBF"},bottom:{style:g.SINGLE,size:6,color:"BFBFBF"},left:{style:g.SINGLE,size:6,color:"BFBFBF"},right:{style:g.SINGLE,size:6,color:"BFBFBF"},insideHorizontal:{style:g.SINGLE,size:6,color:"BFBFBF"},insideVertical:{style:g.SINGLE,size:6,color:"BFBFBF"}},rows:o})]};n["table"]=a;n["report.table"]=a;try{const e=await v({outputType:"nodebuffer",data:S,patches:n,placeholderDelimiters:{start:"${",end:"}"}});return Buffer.from(e)}catch{const e=await v({outputType:"nodebuffer",data:S,patches:n});return Buffer.from(e)}}catch(e){}}const k=new c({sections:[{children:[new l({text:e.title,heading:h.HEADING_1,alignment:T.CENTER}),new l({text:`Fecha: ${(new Date).toLocaleDateString()}`,alignment:T.CENTER}),new l({text:""}),new u({width:{size:100,type:m.PERCENTAGE},rows:[new d({children:e.headers.map((e=>new f({children:[new l({children:[new p({text:e,bold:true})]})]})))}),...e.rows.map((e=>new d({children:e.map((e=>new f({children:[new l({text:String(e)})]})))})))]})]}]});return await w.toBuffer(k)}};t.XlsxFormat={name:"xlsx",extension:".xlsx",isBinary:true,async render(e,t,n){let s;try{s=(0,o.loadDriver)("exceljs")}catch{a.logger.push({type:"error",title:'Missing optional package "exceljs"',detail:['The "exceljs" package is required to generate Excel (.xlsx) reports.',"Please install it globally or locally in your project:",""," npm install -g exceljs"," # or"," npm install --save-dev exceljs"],close:true})}const i=s.Workbook||s.default?.Workbook||s.default;const c=new i;let l;const u=new Date;const d=`${u.getDate().toString().padStart(2,"0")}/${(u.getMonth()+1).toString().padStart(2,"0")}/${u.getFullYear()}`;const f=t.variables||{};if(n){let e;if(typeof n==="string"){if(!(0,r.existsSync)(n)){a.logger.push({type:"error",title:`Template file not found: ${n}`,detail:["The specified Excel template path does not exist on disk.","Verify the path or omit the -template flag to generate a standard workbook."],close:true})}e=(0,r.readFileSync)(n)}else{e=n}await c.xlsx.load(e);l=c.worksheets[0]}else{l=c.addWorksheet(e.title.slice(0,31)||"Report")}const interpolateCell=t=>{let n=t;n=n.replace(/\$\{date\}/g,d);n=n.replace(/\$\{report\.title\}/g,e.title);n=n.replace(/\$\{title\}/g,e.title);if(e.metrics){for(const[t,s]of Object.entries(e.metrics)){n=n.replace(new RegExp(`\\$\\{report\\.metrics\\.${t}\\}`,"g"),String(s));n=n.replace(new RegExp(`\\$\\{report\\.${t}\\}`,"g"),String(s));n=n.replace(new RegExp(`\\$\\{${t}\\}`,"g"),String(s))}}for(const[e,t]of Object.entries(f)){n=n.replace(new RegExp(`\\$\\{var\\.${e}\\}`,"g"),String(t));n=n.replace(new RegExp(`\\$\\{${e}\\}`,"g"),String(t))}return n};let p=null;l.eachRow({includeEmpty:false},((e,t)=>{e.eachCell({includeEmpty:false},((e,n)=>{if(typeof e.value==="string"){if(e.value.includes("${table}")||e.value.includes("${report.table}")){p={row:t,col:n};e.value=""}else if(e.value.includes("${")){e.value=interpolateCell(e.value)}}}))}));const h=p;const m=h?h.row:l.lastRow?l.lastRow.number+2:1;const g=h?h.col:1;const y=l.getRow(m);e.headers.forEach(((e,t)=>{const n=y.getCell(g+t);n.value=e;n.font={bold:true,color:{argb:"FFFFFFFF"}};n.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FF1F4E79"}};n.alignment={vertical:"middle",horizontal:"center"}}));y.height=24;let b=m+1;for(const t of e.rows){const e=l.getRow(b);t.forEach(((t,n)=>{const s=e.getCell(g+n);s.value=t;s.alignment={vertical:"middle"};const r=String(t).toLowerCase();if(r==="passed"){s.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFD4EDDA"}};s.font={color:{argb:"FF155724"},bold:true}}else if(r==="failed"){s.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFF8D7DA"}};s.font={color:{argb:"FF721C24"},bold:true}}else if(r==="blocked"){s.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFF3CD"}};s.font={color:{argb:"FF856404"},bold:true}}}));b++}e.headers.forEach(((t,n)=>{const s=l.getColumn(g+n);let r=t.length;for(const t of e.rows){const e=String(t[n]??"").length;if(e>r)r=e}s.width=Math.min(Math.max(r+4,12),45)}));const v=await c.xlsx.writeBuffer();return Buffer.from(v)}};t.coreFormats={md:t.MarkdownFormat,json:t.JsonFormat,csv:t.CsvFormat,docx:t.DocxFormat,xlsx:t.XlsxFormat}},4855:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});r(n(7410),t);r(n(5440),t);r(n(7623),t);r(n(6396),t)},6396:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.resolveReport=resolveReport;t.resolveFormat=resolveFormat;t.resolveTemplate=resolveTemplate;const s=n(5440);const r=n(7623);const i=n(6928);const o=n(9896);const a=n(7016);const c=n(1227);const l=n(4296);async function resolveReport(e,t=process.cwd()){const r=(e||"testcase-summary").trim().toLowerCase();if(s.builtinReports[r]){return s.builtinReports[r]}const u=[(0,i.resolve)(t,".testform","reports",`${r}.ts`),(0,i.resolve)(t,".testform","reports",`${r}.js`),(0,i.resolve)(t,".testform","reports",r,"index.ts"),(0,i.resolve)(t,".testform","reports",r,"index.js")];for(const e of u){if((0,o.existsSync)(e)){try{let t;try{t=await n(2609)((0,a.pathToFileURL)(e).href)}catch{t=require(e)}const s=t.default||t.report||t;if(s&&typeof s.collect==="function"){return s}}catch(t){c.logger.push({type:"warning",title:`Failed to load custom report from ${e}`,detail:[t.message||String(t)]})}}}const d=Object.keys(s.builtinReports).join(", ");c.logger.push({type:"error",title:`Report type "${r}" not found`,detail:[`Available built-in reports:`,` ${d}`,"",`Or create a custom report script in:`,` .testform/reports/${r}.ts`]});throw new l.TestformError(`Report type "${r}" not found`)}async function resolveFormat(e,t="md",s=process.cwd()){const u=(t||"md").trim().toLowerCase();if(e.formats&&e.formats[u]){const t=e.formats[u];return{name:u,extension:`.${u}`,render:async(e,n)=>t(e,n)}}if(r.coreFormats[u]){return r.coreFormats[u]}const d=[(0,i.resolve)(s,".testform","reports",`${u}.format.ts`),(0,i.resolve)(s,".testform","reports",`${u}.format.js`),(0,i.resolve)(s,".testform","reports",`${u}.ts`),(0,i.resolve)(s,".testform","reports",`${u}.js`)];for(const e of d){if((0,o.existsSync)(e)){try{let t;try{t=await n(2609)((0,a.pathToFileURL)(e).href)}catch{t=require(e)}const s=t.default||t.format||t;if(s&&typeof s.render==="function"){return s}}catch(t){c.logger.push({type:"warning",title:`Failed to load custom format from ${e}`,detail:[t.message||String(t)]})}}}const f=Object.keys(r.coreFormats).join(", ");c.logger.push({type:"error",title:`Format "${u}" not found`,detail:[`Available core formats:`,` ${f}`,"",`Or create a custom format script in:`,` .testform/reports/${u}.format.ts`]});throw new l.TestformError(`Format "${u}" not found`)}function resolveTemplate(e,t,n,s,r=process.cwd()){if(n){const e=(0,i.resolve)(r,n);if((0,o.existsSync)(e)){return(0,o.readFileSync)(e)}return n}if(e.templates){if(typeof e.templates==="function"){return e.templates(t,s)}if(typeof e.templates==="object"&&e.templates[t]){const n=e.templates[t];if(typeof n==="string"&&(0,o.existsSync)((0,i.resolve)(r,n))){return(0,o.readFileSync)((0,i.resolve)(r,n))}return n}}const a=(0,i.resolve)(r,".testform","reports",`report.${t}`);if((0,o.existsSync)(a)){return(0,o.readFileSync)(a)}return undefined}},7410:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},6665:e=>{function webpackEmptyContext(e){var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}webpackEmptyContext.keys=()=>[];webpackEmptyContext.resolve=webpackEmptyContext;webpackEmptyContext.id=6665;e.exports=webpackEmptyContext},195:e=>{function webpackEmptyAsyncContext(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}))}webpackEmptyAsyncContext.keys=()=>[];webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext;webpackEmptyAsyncContext.id=195;e.exports=webpackEmptyAsyncContext},9272:e=>{function webpackEmptyAsyncContext(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}))}webpackEmptyAsyncContext.keys=()=>[];webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext;webpackEmptyAsyncContext.id=9272;e.exports=webpackEmptyAsyncContext},2609:e=>{function webpackEmptyAsyncContext(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}))}webpackEmptyAsyncContext.keys=()=>[];webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext;webpackEmptyAsyncContext.id=2609;e.exports=webpackEmptyAsyncContext},2613:e=>{"use strict";e.exports=require("assert")},181:e=>{"use strict";e.exports=require("buffer")},5317:e=>{"use strict";e.exports=require("child_process")},6982:e=>{"use strict";e.exports=require("crypto")},4434:e=>{"use strict";e.exports=require("events")},9896:e=>{"use strict";e.exports=require("fs")},8161:e=>{"use strict";e.exports=require("node:os")},1708:e=>{"use strict";e.exports=require("node:process")},857:e=>{"use strict";e.exports=require("os")},6928:e=>{"use strict";e.exports=require("path")},932:e=>{"use strict";e.exports=require("process")},3785:e=>{"use strict";e.exports=require("readline")},2018:e=>{"use strict";e.exports=require("tty")},7016:e=>{"use strict";e.exports=require("url")},9023:e=>{"use strict";e.exports=require("util")},406:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.uuid=uuid;t.incrementing=incrementing;function uuid(){return function(){return crypto.randomUUID()}}function incrementing(){var e=0;return function(){return(e++).toString()}}},5331:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.millisecondsSinceEpochToTimestamp=millisecondsSinceEpochToTimestamp;t.millisecondsToDuration=millisecondsToDuration;t.timestampToMillisecondsSinceEpoch=timestampToMillisecondsSinceEpoch;t.durationToMilliseconds=durationToMilliseconds;t.addDurations=addDurations;var n=1e3;var s=1e6;var r=1e9;function millisecondsSinceEpochToTimestamp(e){return toSecondsAndNanos(e)}function millisecondsToDuration(e){return toSecondsAndNanos(e)}function timestampToMillisecondsSinceEpoch(e){var t=e.seconds,n=e.nanos;return toMillis(t,n)}function durationToMilliseconds(e){var t=e.seconds,n=e.nanos;return toMillis(t,n)}function addDurations(e,t){var n=+e.seconds+ +t.seconds;var s=e.nanos+t.nanos;if(s>=r){n+=1;s-=r}return{seconds:n,nanos:s}}function toSecondsAndNanos(e){var t=Math.floor(e/n);var r=Math.floor(e%n*s);return{seconds:t,nanos:r}}function toMillis(e,t){var r=+e*n;var i=t/s;return r+i}},6954:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getWorstTestStepResult=getWorstTestStepResult;var s=n(238);var r=n(5331);function getWorstTestStepResult(e){return e.slice().sort((function(e,t){return ordinal(t.status)-ordinal(e.status)}))[0]||{status:s.TestStepResultStatus.UNKNOWN,duration:(0,r.millisecondsToDuration)(0)}}function ordinal(e){return[s.TestStepResultStatus.UNKNOWN,s.TestStepResultStatus.PASSED,s.TestStepResultStatus.SKIPPED,s.TestStepResultStatus.PENDING,s.TestStepResultStatus.UNDEFINED,s.TestStepResultStatus.AMBIGUOUS,s.TestStepResultStatus.FAILED].indexOf(e)}},6088:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();var o=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});t.getWorstTestStepResult=t.parseEnvelope=t.version=t.IdGenerator=t.TimeConversion=void 0;var a=i(n(5331));t.TimeConversion=a;var c=i(n(406));t.IdGenerator=c;var l=n(9071);Object.defineProperty(t,"parseEnvelope",{enumerable:true,get:function(){return l.parseEnvelope}});var u=n(6954);Object.defineProperty(t,"getWorstTestStepResult",{enumerable:true,get:function(){return u.getWorstTestStepResult}});var d=n(7028);Object.defineProperty(t,"version",{enumerable:true,get:function(){return d.version}});o(n(238),t)},238:function(e,t,n){"use strict";var s=this&&this.__decorate||function(e,t,n,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,s);else for(var a=e.length-1;a>=0;a--)if(o=e[a])i=(r<3?o(i):r>3?o(t,n,i):o(t,n))||i;return r>3&&i&&Object.defineProperty(t,n,i),i};Object.defineProperty(t,"__esModule",{value:true});t.TestCaseFinished=t.TestStep=t.StepMatchArgumentsList=t.StepMatchArgument=t.Group=t.TestCase=t.Snippet=t.Suggestion=t.StepDefinitionPattern=t.StepDefinition=t.JavaStackTraceElement=t.JavaMethod=t.SourceReference=t.Source=t.PickleTag=t.PickleTableRow=t.PickleTableCell=t.PickleTable=t.PickleStepArgument=t.PickleStep=t.PickleDocString=t.Pickle=t.ParseError=t.ParameterType=t.Product=t.Git=t.Ci=t.Meta=t.Location=t.Hook=t.Tag=t.TableRow=t.TableCell=t.Step=t.Scenario=t.RuleChild=t.Rule=t.FeatureChild=t.Feature=t.Examples=t.DocString=t.DataTable=t.Comment=t.Background=t.GherkinDocument=t.ExternalAttachment=t.Exception=t.Envelope=t.Duration=t.Attachment=void 0;t.TestStepResultStatus=t.StepKeywordType=t.StepDefinitionPatternType=t.SourceMediaType=t.PickleStepType=t.HookType=t.AttachmentContentEncoding=t.UndefinedParameterType=t.Timestamp=t.TestStepStarted=t.TestStepResult=t.TestStepFinished=t.TestRunStarted=t.TestRunHookStarted=t.TestRunHookFinished=t.TestRunFinished=t.TestCaseStarted=void 0;var r=n(451);n(477);var i=function(){function Attachment(){this.body="";this.contentEncoding=de.IDENTITY;this.mediaType=""}s([(0,r.Type)((function(){return U}))],Attachment.prototype,"source",void 0);s([(0,r.Type)((function(){return le}))],Attachment.prototype,"timestamp",void 0);return Attachment}();t.Attachment=i;var o=function(){function Duration(){this.seconds=0;this.nanos=0}return Duration}();t.Duration=o;var a=function(){function Envelope(){}s([(0,r.Type)((function(){return i}))],Envelope.prototype,"attachment",void 0);s([(0,r.Type)((function(){return l}))],Envelope.prototype,"externalAttachment",void 0);s([(0,r.Type)((function(){return u}))],Envelope.prototype,"gherkinDocument",void 0);s([(0,r.Type)((function(){return _}))],Envelope.prototype,"hook",void 0);s([(0,r.Type)((function(){return C}))],Envelope.prototype,"meta",void 0);s([(0,r.Type)((function(){return A}))],Envelope.prototype,"parameterType",void 0);s([(0,r.Type)((function(){return L}))],Envelope.prototype,"parseError",void 0);s([(0,r.Type)((function(){return x}))],Envelope.prototype,"pickle",void 0);s([(0,r.Type)((function(){return V}))],Envelope.prototype,"suggestion",void 0);s([(0,r.Type)((function(){return U}))],Envelope.prototype,"source",void 0);s([(0,r.Type)((function(){return H}))],Envelope.prototype,"stepDefinition",void 0);s([(0,r.Type)((function(){return J}))],Envelope.prototype,"testCase",void 0);s([(0,r.Type)((function(){return ee}))],Envelope.prototype,"testCaseFinished",void 0);s([(0,r.Type)((function(){return te}))],Envelope.prototype,"testCaseStarted",void 0);s([(0,r.Type)((function(){return ne}))],Envelope.prototype,"testRunFinished",void 0);s([(0,r.Type)((function(){return ie}))],Envelope.prototype,"testRunStarted",void 0);s([(0,r.Type)((function(){return oe}))],Envelope.prototype,"testStepFinished",void 0);s([(0,r.Type)((function(){return ce}))],Envelope.prototype,"testStepStarted",void 0);s([(0,r.Type)((function(){return re}))],Envelope.prototype,"testRunHookStarted",void 0);s([(0,r.Type)((function(){return se}))],Envelope.prototype,"testRunHookFinished",void 0);s([(0,r.Type)((function(){return ue}))],Envelope.prototype,"undefinedParameterType",void 0);return Envelope}();t.Envelope=a;var c=function(){function Exception(){this.type=""}return Exception}();t.Exception=c;var l=function(){function ExternalAttachment(){this.url="";this.mediaType=""}s([(0,r.Type)((function(){return le}))],ExternalAttachment.prototype,"timestamp",void 0);return ExternalAttachment}();t.ExternalAttachment=l;var u=function(){function GherkinDocument(){this.comments=[]}s([(0,r.Type)((function(){return g}))],GherkinDocument.prototype,"feature",void 0);s([(0,r.Type)((function(){return f}))],GherkinDocument.prototype,"comments",void 0);return GherkinDocument}();t.GherkinDocument=u;var d=function(){function Background(){this.location=new E;this.keyword="";this.name="";this.description="";this.steps=[];this.id=""}s([(0,r.Type)((function(){return E}))],Background.prototype,"location",void 0);s([(0,r.Type)((function(){return T}))],Background.prototype,"steps",void 0);return Background}();t.Background=d;var f=function(){function Comment(){this.location=new E;this.text=""}s([(0,r.Type)((function(){return E}))],Comment.prototype,"location",void 0);return Comment}();t.Comment=f;var p=function(){function DataTable(){this.location=new E;this.rows=[]}s([(0,r.Type)((function(){return E}))],DataTable.prototype,"location",void 0);s([(0,r.Type)((function(){return k}))],DataTable.prototype,"rows",void 0);return DataTable}();t.DataTable=p;var h=function(){function DocString(){this.location=new E;this.content="";this.delimiter=""}s([(0,r.Type)((function(){return E}))],DocString.prototype,"location",void 0);return DocString}();t.DocString=h;var m=function(){function Examples(){this.location=new E;this.tags=[];this.keyword="";this.name="";this.description="";this.tableBody=[];this.id=""}s([(0,r.Type)((function(){return E}))],Examples.prototype,"location",void 0);s([(0,r.Type)((function(){return D}))],Examples.prototype,"tags",void 0);s([(0,r.Type)((function(){return k}))],Examples.prototype,"tableHeader",void 0);s([(0,r.Type)((function(){return k}))],Examples.prototype,"tableBody",void 0);return Examples}();t.Examples=m;var g=function(){function Feature(){this.location=new E;this.tags=[];this.language="";this.keyword="";this.name="";this.description="";this.children=[]}s([(0,r.Type)((function(){return E}))],Feature.prototype,"location",void 0);s([(0,r.Type)((function(){return D}))],Feature.prototype,"tags",void 0);s([(0,r.Type)((function(){return y}))],Feature.prototype,"children",void 0);return Feature}();t.Feature=g;var y=function(){function FeatureChild(){}s([(0,r.Type)((function(){return b}))],FeatureChild.prototype,"rule",void 0);s([(0,r.Type)((function(){return d}))],FeatureChild.prototype,"background",void 0);s([(0,r.Type)((function(){return w}))],FeatureChild.prototype,"scenario",void 0);return FeatureChild}();t.FeatureChild=y;var b=function(){function Rule(){this.location=new E;this.tags=[];this.keyword="";this.name="";this.description="";this.children=[];this.id=""}s([(0,r.Type)((function(){return E}))],Rule.prototype,"location",void 0);s([(0,r.Type)((function(){return D}))],Rule.prototype,"tags",void 0);s([(0,r.Type)((function(){return v}))],Rule.prototype,"children",void 0);return Rule}();t.Rule=b;var v=function(){function RuleChild(){}s([(0,r.Type)((function(){return d}))],RuleChild.prototype,"background",void 0);s([(0,r.Type)((function(){return w}))],RuleChild.prototype,"scenario",void 0);return RuleChild}();t.RuleChild=v;var w=function(){function Scenario(){this.location=new E;this.tags=[];this.keyword="";this.name="";this.description="";this.steps=[];this.examples=[];this.id=""}s([(0,r.Type)((function(){return E}))],Scenario.prototype,"location",void 0);s([(0,r.Type)((function(){return D}))],Scenario.prototype,"tags",void 0);s([(0,r.Type)((function(){return T}))],Scenario.prototype,"steps",void 0);s([(0,r.Type)((function(){return m}))],Scenario.prototype,"examples",void 0);return Scenario}();t.Scenario=w;var T=function(){function Step(){this.location=new E;this.keyword="";this.text="";this.id=""}s([(0,r.Type)((function(){return E}))],Step.prototype,"location",void 0);s([(0,r.Type)((function(){return h}))],Step.prototype,"docString",void 0);s([(0,r.Type)((function(){return p}))],Step.prototype,"dataTable",void 0);return Step}();t.Step=T;var S=function(){function TableCell(){this.location=new E;this.value=""}s([(0,r.Type)((function(){return E}))],TableCell.prototype,"location",void 0);return TableCell}();t.TableCell=S;var k=function(){function TableRow(){this.location=new E;this.cells=[];this.id=""}s([(0,r.Type)((function(){return E}))],TableRow.prototype,"location",void 0);s([(0,r.Type)((function(){return S}))],TableRow.prototype,"cells",void 0);return TableRow}();t.TableRow=k;var D=function(){function Tag(){this.location=new E;this.name="";this.id=""}s([(0,r.Type)((function(){return E}))],Tag.prototype,"location",void 0);return Tag}();t.Tag=D;var _=function(){function Hook(){this.id="";this.sourceReference=new W}s([(0,r.Type)((function(){return W}))],Hook.prototype,"sourceReference",void 0);return Hook}();t.Hook=_;var E=function(){function Location(){this.line=0}return Location}();t.Location=E;var C=function(){function Meta(){this.protocolVersion="";this.implementation=new O;this.runtime=new O;this.os=new O;this.cpu=new O}s([(0,r.Type)((function(){return O}))],Meta.prototype,"implementation",void 0);s([(0,r.Type)((function(){return O}))],Meta.prototype,"runtime",void 0);s([(0,r.Type)((function(){return O}))],Meta.prototype,"os",void 0);s([(0,r.Type)((function(){return O}))],Meta.prototype,"cpu",void 0);s([(0,r.Type)((function(){return R}))],Meta.prototype,"ci",void 0);return Meta}();t.Meta=C;var R=function(){function Ci(){this.name=""}s([(0,r.Type)((function(){return P}))],Ci.prototype,"git",void 0);return Ci}();t.Ci=R;var P=function(){function Git(){this.remote="";this.revision=""}return Git}();t.Git=P;var O=function(){function Product(){this.name=""}return Product}();t.Product=O;var A=function(){function ParameterType(){this.name="";this.regularExpressions=[];this.preferForRegularExpressionMatch=false;this.useForSnippets=false;this.id=""}s([(0,r.Type)((function(){return W}))],ParameterType.prototype,"sourceReference",void 0);return ParameterType}();t.ParameterType=A;var L=function(){function ParseError(){this.source=new W;this.message=""}s([(0,r.Type)((function(){return W}))],ParseError.prototype,"source",void 0);return ParseError}();t.ParseError=L;var x=function(){function Pickle(){this.id="";this.uri="";this.name="";this.language="";this.steps=[];this.tags=[];this.astNodeIds=[]}s([(0,r.Type)((function(){return E}))],Pickle.prototype,"location",void 0);s([(0,r.Type)((function(){return $}))],Pickle.prototype,"steps",void 0);s([(0,r.Type)((function(){return B}))],Pickle.prototype,"tags",void 0);return Pickle}();t.Pickle=x;var I=function(){function PickleDocString(){this.content=""}return PickleDocString}();t.PickleDocString=I;var $=function(){function PickleStep(){this.astNodeIds=[];this.id="";this.text=""}s([(0,r.Type)((function(){return F}))],PickleStep.prototype,"argument",void 0);return PickleStep}();t.PickleStep=$;var F=function(){function PickleStepArgument(){}s([(0,r.Type)((function(){return I}))],PickleStepArgument.prototype,"docString",void 0);s([(0,r.Type)((function(){return j}))],PickleStepArgument.prototype,"dataTable",void 0);return PickleStepArgument}();t.PickleStepArgument=F;var j=function(){function PickleTable(){this.rows=[]}s([(0,r.Type)((function(){return N}))],PickleTable.prototype,"rows",void 0);return PickleTable}();t.PickleTable=j;var M=function(){function PickleTableCell(){this.value=""}return PickleTableCell}();t.PickleTableCell=M;var N=function(){function PickleTableRow(){this.cells=[]}s([(0,r.Type)((function(){return M}))],PickleTableRow.prototype,"cells",void 0);return PickleTableRow}();t.PickleTableRow=N;var B=function(){function PickleTag(){this.name="";this.astNodeId=""}return PickleTag}();t.PickleTag=B;var U=function(){function Source(){this.uri="";this.data="";this.mediaType=he.TEXT_X_CUCUMBER_GHERKIN_PLAIN}return Source}();t.Source=U;var W=function(){function SourceReference(){}s([(0,r.Type)((function(){return G}))],SourceReference.prototype,"javaMethod",void 0);s([(0,r.Type)((function(){return q}))],SourceReference.prototype,"javaStackTraceElement",void 0);s([(0,r.Type)((function(){return E}))],SourceReference.prototype,"location",void 0);return SourceReference}();t.SourceReference=W;var G=function(){function JavaMethod(){this.className="";this.methodName="";this.methodParameterTypes=[]}return JavaMethod}();t.JavaMethod=G;var q=function(){function JavaStackTraceElement(){this.className="";this.fileName="";this.methodName=""}return JavaStackTraceElement}();t.JavaStackTraceElement=q;var H=function(){function StepDefinition(){this.id="";this.pattern=new K;this.sourceReference=new W}s([(0,r.Type)((function(){return K}))],StepDefinition.prototype,"pattern",void 0);s([(0,r.Type)((function(){return W}))],StepDefinition.prototype,"sourceReference",void 0);return StepDefinition}();t.StepDefinition=H;var K=function(){function StepDefinitionPattern(){this.source="";this.type=me.CUCUMBER_EXPRESSION}return StepDefinitionPattern}();t.StepDefinitionPattern=K;var V=function(){function Suggestion(){this.id="";this.pickleStepId="";this.snippets=[]}s([(0,r.Type)((function(){return z}))],Suggestion.prototype,"snippets",void 0);return Suggestion}();t.Suggestion=V;var z=function(){function Snippet(){this.language="";this.code=""}return Snippet}();t.Snippet=z;var J=function(){function TestCase(){this.id="";this.pickleId="";this.testSteps=[]}s([(0,r.Type)((function(){return Z}))],TestCase.prototype,"testSteps",void 0);return TestCase}();t.TestCase=J;var Y=function(){function Group(){}s([(0,r.Type)((function(){return Group}))],Group.prototype,"children",void 0);return Group}();t.Group=Y;var Q=function(){function StepMatchArgument(){this.group=new Y}s([(0,r.Type)((function(){return Y}))],StepMatchArgument.prototype,"group",void 0);return StepMatchArgument}();t.StepMatchArgument=Q;var X=function(){function StepMatchArgumentsList(){this.stepMatchArguments=[]}s([(0,r.Type)((function(){return Q}))],StepMatchArgumentsList.prototype,"stepMatchArguments",void 0);return StepMatchArgumentsList}();t.StepMatchArgumentsList=X;var Z=function(){function TestStep(){this.id=""}s([(0,r.Type)((function(){return X}))],TestStep.prototype,"stepMatchArgumentsLists",void 0);return TestStep}();t.TestStep=Z;var ee=function(){function TestCaseFinished(){this.testCaseStartedId="";this.timestamp=new le;this.willBeRetried=false}s([(0,r.Type)((function(){return le}))],TestCaseFinished.prototype,"timestamp",void 0);return TestCaseFinished}();t.TestCaseFinished=ee;var te=function(){function TestCaseStarted(){this.attempt=0;this.id="";this.testCaseId="";this.timestamp=new le}s([(0,r.Type)((function(){return le}))],TestCaseStarted.prototype,"timestamp",void 0);return TestCaseStarted}();t.TestCaseStarted=te;var ne=function(){function TestRunFinished(){this.success=false;this.timestamp=new le}s([(0,r.Type)((function(){return le}))],TestRunFinished.prototype,"timestamp",void 0);s([(0,r.Type)((function(){return c}))],TestRunFinished.prototype,"exception",void 0);return TestRunFinished}();t.TestRunFinished=ne;var se=function(){function TestRunHookFinished(){this.testRunHookStartedId="";this.result=new ae;this.timestamp=new le}s([(0,r.Type)((function(){return ae}))],TestRunHookFinished.prototype,"result",void 0);s([(0,r.Type)((function(){return le}))],TestRunHookFinished.prototype,"timestamp",void 0);return TestRunHookFinished}();t.TestRunHookFinished=se;var re=function(){function TestRunHookStarted(){this.id="";this.testRunStartedId="";this.hookId="";this.timestamp=new le}s([(0,r.Type)((function(){return le}))],TestRunHookStarted.prototype,"timestamp",void 0);return TestRunHookStarted}();t.TestRunHookStarted=re;var ie=function(){function TestRunStarted(){this.timestamp=new le}s([(0,r.Type)((function(){return le}))],TestRunStarted.prototype,"timestamp",void 0);return TestRunStarted}();t.TestRunStarted=ie;var oe=function(){function TestStepFinished(){this.testCaseStartedId="";this.testStepId="";this.testStepResult=new ae;this.timestamp=new le}s([(0,r.Type)((function(){return ae}))],TestStepFinished.prototype,"testStepResult",void 0);s([(0,r.Type)((function(){return le}))],TestStepFinished.prototype,"timestamp",void 0);return TestStepFinished}();t.TestStepFinished=oe;var ae=function(){function TestStepResult(){this.duration=new o;this.status=ye.UNKNOWN}s([(0,r.Type)((function(){return o}))],TestStepResult.prototype,"duration",void 0);s([(0,r.Type)((function(){return c}))],TestStepResult.prototype,"exception",void 0);return TestStepResult}();t.TestStepResult=ae;var ce=function(){function TestStepStarted(){this.testCaseStartedId="";this.testStepId="";this.timestamp=new le}s([(0,r.Type)((function(){return le}))],TestStepStarted.prototype,"timestamp",void 0);return TestStepStarted}();t.TestStepStarted=ce;var le=function(){function Timestamp(){this.seconds=0;this.nanos=0}return Timestamp}();t.Timestamp=le;var ue=function(){function UndefinedParameterType(){this.expression="";this.name=""}return UndefinedParameterType}();t.UndefinedParameterType=ue;var de;(function(e){e["IDENTITY"]="IDENTITY";e["BASE64"]="BASE64"})(de||(t.AttachmentContentEncoding=de={}));var fe;(function(e){e["BEFORE_TEST_RUN"]="BEFORE_TEST_RUN";e["AFTER_TEST_RUN"]="AFTER_TEST_RUN";e["BEFORE_TEST_CASE"]="BEFORE_TEST_CASE";e["AFTER_TEST_CASE"]="AFTER_TEST_CASE";e["BEFORE_TEST_STEP"]="BEFORE_TEST_STEP";e["AFTER_TEST_STEP"]="AFTER_TEST_STEP"})(fe||(t.HookType=fe={}));var pe;(function(e){e["UNKNOWN"]="Unknown";e["CONTEXT"]="Context";e["ACTION"]="Action";e["OUTCOME"]="Outcome"})(pe||(t.PickleStepType=pe={}));var he;(function(e){e["TEXT_X_CUCUMBER_GHERKIN_PLAIN"]="text/x.cucumber.gherkin+plain";e["TEXT_X_CUCUMBER_GHERKIN_MARKDOWN"]="text/x.cucumber.gherkin+markdown"})(he||(t.SourceMediaType=he={}));var me;(function(e){e["CUCUMBER_EXPRESSION"]="CUCUMBER_EXPRESSION";e["REGULAR_EXPRESSION"]="REGULAR_EXPRESSION"})(me||(t.StepDefinitionPatternType=me={}));var ge;(function(e){e["UNKNOWN"]="Unknown";e["CONTEXT"]="Context";e["ACTION"]="Action";e["OUTCOME"]="Outcome";e["CONJUNCTION"]="Conjunction"})(ge||(t.StepKeywordType=ge={}));var ye;(function(e){e["UNKNOWN"]="UNKNOWN";e["PASSED"]="PASSED";e["SKIPPED"]="SKIPPED";e["PENDING"]="PENDING";e["UNDEFINED"]="UNDEFINED";e["AMBIGUOUS"]="AMBIGUOUS";e["FAILED"]="FAILED"})(ye||(t.TestStepResultStatus=ye={}))},9071:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.parseEnvelope=parseEnvelope;var s=n(238);var r=n(451);function parseEnvelope(e){var t=JSON.parse(e);return(0,r.plainToClass)(s.Envelope,t)}},7028:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.version=void 0;t.version="32.2.0"},8091:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.uuid=uuid;t.incrementing=incrementing;function uuid(){return function(){return crypto.randomUUID()}}function incrementing(){var e=0;return function(){return(e++).toString()}}},8024:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.millisecondsSinceEpochToTimestamp=millisecondsSinceEpochToTimestamp;t.millisecondsToDuration=millisecondsToDuration;t.timestampToMillisecondsSinceEpoch=timestampToMillisecondsSinceEpoch;t.durationToMilliseconds=durationToMilliseconds;t.addDurations=addDurations;var n=1e3;var s=1e6;var r=1e9;function millisecondsSinceEpochToTimestamp(e){return toSecondsAndNanos(e)}function millisecondsToDuration(e){return toSecondsAndNanos(e)}function timestampToMillisecondsSinceEpoch(e){var t=e.seconds,n=e.nanos;return toMillis(t,n)}function durationToMilliseconds(e){var t=e.seconds,n=e.nanos;return toMillis(t,n)}function addDurations(e,t){var n=+e.seconds+ +t.seconds;var s=e.nanos+t.nanos;if(s>=r){n+=1;s-=r}return{seconds:n,nanos:s}}function toSecondsAndNanos(e){var t=Math.floor(e/n);var r=Math.floor(e%n*s);return{seconds:t,nanos:r}}function toMillis(e,t){var r=+e*n;var i=t/s;return r+i}},6809:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getWorstTestStepResult=getWorstTestStepResult;var s=n(6849);var r=n(8024);function getWorstTestStepResult(e){return e.slice().sort((function(e,t){return ordinal(t.status)-ordinal(e.status)}))[0]||{status:s.TestStepResultStatus.UNKNOWN,duration:(0,r.millisecondsToDuration)(0)}}function ordinal(e){return[s.TestStepResultStatus.UNKNOWN,s.TestStepResultStatus.PASSED,s.TestStepResultStatus.SKIPPED,s.TestStepResultStatus.PENDING,s.TestStepResultStatus.UNDEFINED,s.TestStepResultStatus.AMBIGUOUS,s.TestStepResultStatus.FAILED].indexOf(e)}},8569:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){if(s===undefined)s=n;var r=Object.getOwnPropertyDescriptor(t,n);if(!r||("get"in r?!t.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,s,r)}:function(e,t,n,s){if(s===undefined)s=n;e[s]=t[n]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[t.length]=n;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=ownKeys(e),i=0;i<n.length;i++)if(n[i]!=="default")s(t,e,n[i]);r(t,e);return t}}();var o=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))s(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});t.getWorstTestStepResult=t.parseEnvelope=t.version=t.IdGenerator=t.TimeConversion=void 0;var a=i(n(8024));t.TimeConversion=a;var c=i(n(8091));t.IdGenerator=c;var l=n(9782);Object.defineProperty(t,"parseEnvelope",{enumerable:true,get:function(){return l.parseEnvelope}});var u=n(6809);Object.defineProperty(t,"getWorstTestStepResult",{enumerable:true,get:function(){return u.getWorstTestStepResult}});var d=n(2505);Object.defineProperty(t,"version",{enumerable:true,get:function(){return d.version}});o(n(6849),t)},6849:function(e,t,n){"use strict";var s=this&&this.__decorate||function(e,t,n,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,s);else for(var a=e.length-1;a>=0;a--)if(o=e[a])i=(r<3?o(i):r>3?o(t,n,i):o(t,n))||i;return r>3&&i&&Object.defineProperty(t,n,i),i};Object.defineProperty(t,"__esModule",{value:true});t.TestCaseStarted=t.TestCaseFinished=t.TestStep=t.StepMatchArgumentsList=t.StepMatchArgument=t.Group=t.TestCase=t.Snippet=t.Suggestion=t.StepDefinitionPattern=t.StepDefinition=t.JavaStackTraceElement=t.JavaMethod=t.SourceReference=t.Source=t.PickleTag=t.PickleTableRow=t.PickleTableCell=t.PickleTable=t.PickleStepArgument=t.PickleStep=t.PickleDocString=t.Pickle=t.ParseError=t.ParameterType=t.Product=t.Git=t.Ci=t.Meta=t.Location=t.Hook=t.Tag=t.TableRow=t.TableCell=t.Step=t.Scenario=t.RuleChild=t.Rule=t.FeatureChild=t.Feature=t.Examples=t.DocString=t.DataTable=t.Comment=t.Background=t.GherkinDocument=t.Exception=t.Envelope=t.Duration=t.Attachment=void 0;t.TestStepResultStatus=t.StepKeywordType=t.StepDefinitionPatternType=t.SourceMediaType=t.PickleStepType=t.HookType=t.AttachmentContentEncoding=t.UndefinedParameterType=t.Timestamp=t.TestStepStarted=t.TestStepResult=t.TestStepFinished=t.TestRunStarted=t.TestRunHookStarted=t.TestRunHookFinished=t.TestRunFinished=void 0;var r=n(451);n(477);var i=function(){function Attachment(){this.body="";this.contentEncoding=ue.IDENTITY;this.mediaType=""}s([(0,r.Type)((function(){return B}))],Attachment.prototype,"source",void 0);s([(0,r.Type)((function(){return ce}))],Attachment.prototype,"timestamp",void 0);return Attachment}();t.Attachment=i;var o=function(){function Duration(){this.seconds=0;this.nanos=0}return Duration}();t.Duration=o;var a=function(){function Envelope(){}s([(0,r.Type)((function(){return i}))],Envelope.prototype,"attachment",void 0);s([(0,r.Type)((function(){return l}))],Envelope.prototype,"gherkinDocument",void 0);s([(0,r.Type)((function(){return D}))],Envelope.prototype,"hook",void 0);s([(0,r.Type)((function(){return E}))],Envelope.prototype,"meta",void 0);s([(0,r.Type)((function(){return O}))],Envelope.prototype,"parameterType",void 0);s([(0,r.Type)((function(){return A}))],Envelope.prototype,"parseError",void 0);s([(0,r.Type)((function(){return L}))],Envelope.prototype,"pickle",void 0);s([(0,r.Type)((function(){return K}))],Envelope.prototype,"suggestion",void 0);s([(0,r.Type)((function(){return B}))],Envelope.prototype,"source",void 0);s([(0,r.Type)((function(){return q}))],Envelope.prototype,"stepDefinition",void 0);s([(0,r.Type)((function(){return z}))],Envelope.prototype,"testCase",void 0);s([(0,r.Type)((function(){return Z}))],Envelope.prototype,"testCaseFinished",void 0);s([(0,r.Type)((function(){return ee}))],Envelope.prototype,"testCaseStarted",void 0);s([(0,r.Type)((function(){return te}))],Envelope.prototype,"testRunFinished",void 0);s([(0,r.Type)((function(){return re}))],Envelope.prototype,"testRunStarted",void 0);s([(0,r.Type)((function(){return ie}))],Envelope.prototype,"testStepFinished",void 0);s([(0,r.Type)((function(){return ae}))],Envelope.prototype,"testStepStarted",void 0);s([(0,r.Type)((function(){return se}))],Envelope.prototype,"testRunHookStarted",void 0);s([(0,r.Type)((function(){return ne}))],Envelope.prototype,"testRunHookFinished",void 0);s([(0,r.Type)((function(){return le}))],Envelope.prototype,"undefinedParameterType",void 0);return Envelope}();t.Envelope=a;var c=function(){function Exception(){this.type=""}return Exception}();t.Exception=c;var l=function(){function GherkinDocument(){this.comments=[]}s([(0,r.Type)((function(){return m}))],GherkinDocument.prototype,"feature",void 0);s([(0,r.Type)((function(){return d}))],GherkinDocument.prototype,"comments",void 0);return GherkinDocument}();t.GherkinDocument=l;var u=function(){function Background(){this.location=new _;this.keyword="";this.name="";this.description="";this.steps=[];this.id=""}s([(0,r.Type)((function(){return _}))],Background.prototype,"location",void 0);s([(0,r.Type)((function(){return w}))],Background.prototype,"steps",void 0);return Background}();t.Background=u;var d=function(){function Comment(){this.location=new _;this.text=""}s([(0,r.Type)((function(){return _}))],Comment.prototype,"location",void 0);return Comment}();t.Comment=d;var f=function(){function DataTable(){this.location=new _;this.rows=[]}s([(0,r.Type)((function(){return _}))],DataTable.prototype,"location",void 0);s([(0,r.Type)((function(){return S}))],DataTable.prototype,"rows",void 0);return DataTable}();t.DataTable=f;var p=function(){function DocString(){this.location=new _;this.content="";this.delimiter=""}s([(0,r.Type)((function(){return _}))],DocString.prototype,"location",void 0);return DocString}();t.DocString=p;var h=function(){function Examples(){this.location=new _;this.tags=[];this.keyword="";this.name="";this.description="";this.tableBody=[];this.id=""}s([(0,r.Type)((function(){return _}))],Examples.prototype,"location",void 0);s([(0,r.Type)((function(){return k}))],Examples.prototype,"tags",void 0);s([(0,r.Type)((function(){return S}))],Examples.prototype,"tableHeader",void 0);s([(0,r.Type)((function(){return S}))],Examples.prototype,"tableBody",void 0);return Examples}();t.Examples=h;var m=function(){function Feature(){this.location=new _;this.tags=[];this.language="";this.keyword="";this.name="";this.description="";this.children=[]}s([(0,r.Type)((function(){return _}))],Feature.prototype,"location",void 0);s([(0,r.Type)((function(){return k}))],Feature.prototype,"tags",void 0);s([(0,r.Type)((function(){return g}))],Feature.prototype,"children",void 0);return Feature}();t.Feature=m;var g=function(){function FeatureChild(){}s([(0,r.Type)((function(){return y}))],FeatureChild.prototype,"rule",void 0);s([(0,r.Type)((function(){return u}))],FeatureChild.prototype,"background",void 0);s([(0,r.Type)((function(){return v}))],FeatureChild.prototype,"scenario",void 0);return FeatureChild}();t.FeatureChild=g;var y=function(){function Rule(){this.location=new _;this.tags=[];this.keyword="";this.name="";this.description="";this.children=[];this.id=""}s([(0,r.Type)((function(){return _}))],Rule.prototype,"location",void 0);s([(0,r.Type)((function(){return k}))],Rule.prototype,"tags",void 0);s([(0,r.Type)((function(){return b}))],Rule.prototype,"children",void 0);return Rule}();t.Rule=y;var b=function(){function RuleChild(){}s([(0,r.Type)((function(){return u}))],RuleChild.prototype,"background",void 0);s([(0,r.Type)((function(){return v}))],RuleChild.prototype,"scenario",void 0);return RuleChild}();t.RuleChild=b;var v=function(){function Scenario(){this.location=new _;this.tags=[];this.keyword="";this.name="";this.description="";this.steps=[];this.examples=[];this.id=""}s([(0,r.Type)((function(){return _}))],Scenario.prototype,"location",void 0);s([(0,r.Type)((function(){return k}))],Scenario.prototype,"tags",void 0);s([(0,r.Type)((function(){return w}))],Scenario.prototype,"steps",void 0);s([(0,r.Type)((function(){return h}))],Scenario.prototype,"examples",void 0);return Scenario}();t.Scenario=v;var w=function(){function Step(){this.location=new _;this.keyword="";this.text="";this.id=""}s([(0,r.Type)((function(){return _}))],Step.prototype,"location",void 0);s([(0,r.Type)((function(){return p}))],Step.prototype,"docString",void 0);s([(0,r.Type)((function(){return f}))],Step.prototype,"dataTable",void 0);return Step}();t.Step=w;var T=function(){function TableCell(){this.location=new _;this.value=""}s([(0,r.Type)((function(){return _}))],TableCell.prototype,"location",void 0);return TableCell}();t.TableCell=T;var S=function(){function TableRow(){this.location=new _;this.cells=[];this.id=""}s([(0,r.Type)((function(){return _}))],TableRow.prototype,"location",void 0);s([(0,r.Type)((function(){return T}))],TableRow.prototype,"cells",void 0);return TableRow}();t.TableRow=S;var k=function(){function Tag(){this.location=new _;this.name="";this.id=""}s([(0,r.Type)((function(){return _}))],Tag.prototype,"location",void 0);return Tag}();t.Tag=k;var D=function(){function Hook(){this.id="";this.sourceReference=new U}s([(0,r.Type)((function(){return U}))],Hook.prototype,"sourceReference",void 0);return Hook}();t.Hook=D;var _=function(){function Location(){this.line=0}return Location}();t.Location=_;var E=function(){function Meta(){this.protocolVersion="";this.implementation=new P;this.runtime=new P;this.os=new P;this.cpu=new P}s([(0,r.Type)((function(){return P}))],Meta.prototype,"implementation",void 0);s([(0,r.Type)((function(){return P}))],Meta.prototype,"runtime",void 0);s([(0,r.Type)((function(){return P}))],Meta.prototype,"os",void 0);s([(0,r.Type)((function(){return P}))],Meta.prototype,"cpu",void 0);s([(0,r.Type)((function(){return C}))],Meta.prototype,"ci",void 0);return Meta}();t.Meta=E;var C=function(){function Ci(){this.name=""}s([(0,r.Type)((function(){return R}))],Ci.prototype,"git",void 0);return Ci}();t.Ci=C;var R=function(){function Git(){this.remote="";this.revision=""}return Git}();t.Git=R;var P=function(){function Product(){this.name=""}return Product}();t.Product=P;var O=function(){function ParameterType(){this.name="";this.regularExpressions=[];this.preferForRegularExpressionMatch=false;this.useForSnippets=false;this.id=""}s([(0,r.Type)((function(){return U}))],ParameterType.prototype,"sourceReference",void 0);return ParameterType}();t.ParameterType=O;var A=function(){function ParseError(){this.source=new U;this.message=""}s([(0,r.Type)((function(){return U}))],ParseError.prototype,"source",void 0);return ParseError}();t.ParseError=A;var L=function(){function Pickle(){this.id="";this.uri="";this.name="";this.language="";this.steps=[];this.tags=[];this.astNodeIds=[]}s([(0,r.Type)((function(){return I}))],Pickle.prototype,"steps",void 0);s([(0,r.Type)((function(){return N}))],Pickle.prototype,"tags",void 0);return Pickle}();t.Pickle=L;var x=function(){function PickleDocString(){this.content=""}return PickleDocString}();t.PickleDocString=x;var I=function(){function PickleStep(){this.astNodeIds=[];this.id="";this.text=""}s([(0,r.Type)((function(){return $}))],PickleStep.prototype,"argument",void 0);return PickleStep}();t.PickleStep=I;var $=function(){function PickleStepArgument(){}s([(0,r.Type)((function(){return x}))],PickleStepArgument.prototype,"docString",void 0);s([(0,r.Type)((function(){return F}))],PickleStepArgument.prototype,"dataTable",void 0);return PickleStepArgument}();t.PickleStepArgument=$;var F=function(){function PickleTable(){this.rows=[]}s([(0,r.Type)((function(){return M}))],PickleTable.prototype,"rows",void 0);return PickleTable}();t.PickleTable=F;var j=function(){function PickleTableCell(){this.value=""}return PickleTableCell}();t.PickleTableCell=j;var M=function(){function PickleTableRow(){this.cells=[]}s([(0,r.Type)((function(){return j}))],PickleTableRow.prototype,"cells",void 0);return PickleTableRow}();t.PickleTableRow=M;var N=function(){function PickleTag(){this.name="";this.astNodeId=""}return PickleTag}();t.PickleTag=N;var B=function(){function Source(){this.uri="";this.data="";this.mediaType=pe.TEXT_X_CUCUMBER_GHERKIN_PLAIN}return Source}();t.Source=B;var U=function(){function SourceReference(){}s([(0,r.Type)((function(){return W}))],SourceReference.prototype,"javaMethod",void 0);s([(0,r.Type)((function(){return G}))],SourceReference.prototype,"javaStackTraceElement",void 0);s([(0,r.Type)((function(){return _}))],SourceReference.prototype,"location",void 0);return SourceReference}();t.SourceReference=U;var W=function(){function JavaMethod(){this.className="";this.methodName="";this.methodParameterTypes=[]}return JavaMethod}();t.JavaMethod=W;var G=function(){function JavaStackTraceElement(){this.className="";this.fileName="";this.methodName=""}return JavaStackTraceElement}();t.JavaStackTraceElement=G;var q=function(){function StepDefinition(){this.id="";this.pattern=new H;this.sourceReference=new U}s([(0,r.Type)((function(){return H}))],StepDefinition.prototype,"pattern",void 0);s([(0,r.Type)((function(){return U}))],StepDefinition.prototype,"sourceReference",void 0);return StepDefinition}();t.StepDefinition=q;var H=function(){function StepDefinitionPattern(){this.source="";this.type=he.CUCUMBER_EXPRESSION}return StepDefinitionPattern}();t.StepDefinitionPattern=H;var K=function(){function Suggestion(){this.id="";this.pickleStepId="";this.snippets=[]}s([(0,r.Type)((function(){return V}))],Suggestion.prototype,"snippets",void 0);return Suggestion}();t.Suggestion=K;var V=function(){function Snippet(){this.language="";this.code=""}return Snippet}();t.Snippet=V;var z=function(){function TestCase(){this.id="";this.pickleId="";this.testSteps=[]}s([(0,r.Type)((function(){return X}))],TestCase.prototype,"testSteps",void 0);return TestCase}();t.TestCase=z;var J=function(){function Group(){this.children=[]}s([(0,r.Type)((function(){return Group}))],Group.prototype,"children",void 0);return Group}();t.Group=J;var Y=function(){function StepMatchArgument(){this.group=new J}s([(0,r.Type)((function(){return J}))],StepMatchArgument.prototype,"group",void 0);return StepMatchArgument}();t.StepMatchArgument=Y;var Q=function(){function StepMatchArgumentsList(){this.stepMatchArguments=[]}s([(0,r.Type)((function(){return Y}))],StepMatchArgumentsList.prototype,"stepMatchArguments",void 0);return StepMatchArgumentsList}();t.StepMatchArgumentsList=Q;var X=function(){function TestStep(){this.id=""}s([(0,r.Type)((function(){return Q}))],TestStep.prototype,"stepMatchArgumentsLists",void 0);return TestStep}();t.TestStep=X;var Z=function(){function TestCaseFinished(){this.testCaseStartedId="";this.timestamp=new ce;this.willBeRetried=false}s([(0,r.Type)((function(){return ce}))],TestCaseFinished.prototype,"timestamp",void 0);return TestCaseFinished}();t.TestCaseFinished=Z;var ee=function(){function TestCaseStarted(){this.attempt=0;this.id="";this.testCaseId="";this.timestamp=new ce}s([(0,r.Type)((function(){return ce}))],TestCaseStarted.prototype,"timestamp",void 0);return TestCaseStarted}();t.TestCaseStarted=ee;var te=function(){function TestRunFinished(){this.success=false;this.timestamp=new ce}s([(0,r.Type)((function(){return ce}))],TestRunFinished.prototype,"timestamp",void 0);s([(0,r.Type)((function(){return c}))],TestRunFinished.prototype,"exception",void 0);return TestRunFinished}();t.TestRunFinished=te;var ne=function(){function TestRunHookFinished(){this.testRunHookStartedId="";this.result=new oe;this.timestamp=new ce}s([(0,r.Type)((function(){return oe}))],TestRunHookFinished.prototype,"result",void 0);s([(0,r.Type)((function(){return ce}))],TestRunHookFinished.prototype,"timestamp",void 0);return TestRunHookFinished}();t.TestRunHookFinished=ne;var se=function(){function TestRunHookStarted(){this.id="";this.testRunStartedId="";this.hookId="";this.timestamp=new ce}s([(0,r.Type)((function(){return ce}))],TestRunHookStarted.prototype,"timestamp",void 0);return TestRunHookStarted}();t.TestRunHookStarted=se;var re=function(){function TestRunStarted(){this.timestamp=new ce}s([(0,r.Type)((function(){return ce}))],TestRunStarted.prototype,"timestamp",void 0);return TestRunStarted}();t.TestRunStarted=re;var ie=function(){function TestStepFinished(){this.testCaseStartedId="";this.testStepId="";this.testStepResult=new oe;this.timestamp=new ce}s([(0,r.Type)((function(){return oe}))],TestStepFinished.prototype,"testStepResult",void 0);s([(0,r.Type)((function(){return ce}))],TestStepFinished.prototype,"timestamp",void 0);return TestStepFinished}();t.TestStepFinished=ie;var oe=function(){function TestStepResult(){this.duration=new o;this.status=ge.UNKNOWN}s([(0,r.Type)((function(){return o}))],TestStepResult.prototype,"duration",void 0);s([(0,r.Type)((function(){return c}))],TestStepResult.prototype,"exception",void 0);return TestStepResult}();t.TestStepResult=oe;var ae=function(){function TestStepStarted(){this.testCaseStartedId="";this.testStepId="";this.timestamp=new ce}s([(0,r.Type)((function(){return ce}))],TestStepStarted.prototype,"timestamp",void 0);return TestStepStarted}();t.TestStepStarted=ae;var ce=function(){function Timestamp(){this.seconds=0;this.nanos=0}return Timestamp}();t.Timestamp=ce;var le=function(){function UndefinedParameterType(){this.expression="";this.name=""}return UndefinedParameterType}();t.UndefinedParameterType=le;var ue;(function(e){e["IDENTITY"]="IDENTITY";e["BASE64"]="BASE64"})(ue||(t.AttachmentContentEncoding=ue={}));var de;(function(e){e["BEFORE_TEST_RUN"]="BEFORE_TEST_RUN";e["AFTER_TEST_RUN"]="AFTER_TEST_RUN";e["BEFORE_TEST_CASE"]="BEFORE_TEST_CASE";e["AFTER_TEST_CASE"]="AFTER_TEST_CASE";e["BEFORE_TEST_STEP"]="BEFORE_TEST_STEP";e["AFTER_TEST_STEP"]="AFTER_TEST_STEP"})(de||(t.HookType=de={}));var fe;(function(e){e["UNKNOWN"]="Unknown";e["CONTEXT"]="Context";e["ACTION"]="Action";e["OUTCOME"]="Outcome"})(fe||(t.PickleStepType=fe={}));var pe;(function(e){e["TEXT_X_CUCUMBER_GHERKIN_PLAIN"]="text/x.cucumber.gherkin+plain";e["TEXT_X_CUCUMBER_GHERKIN_MARKDOWN"]="text/x.cucumber.gherkin+markdown"})(pe||(t.SourceMediaType=pe={}));var he;(function(e){e["CUCUMBER_EXPRESSION"]="CUCUMBER_EXPRESSION";e["REGULAR_EXPRESSION"]="REGULAR_EXPRESSION"})(he||(t.StepDefinitionPatternType=he={}));var me;(function(e){e["UNKNOWN"]="Unknown";e["CONTEXT"]="Context";e["ACTION"]="Action";e["OUTCOME"]="Outcome";e["CONJUNCTION"]="Conjunction"})(me||(t.StepKeywordType=me={}));var ge;(function(e){e["UNKNOWN"]="UNKNOWN";e["PASSED"]="PASSED";e["SKIPPED"]="SKIPPED";e["PENDING"]="PENDING";e["UNDEFINED"]="UNDEFINED";e["AMBIGUOUS"]="AMBIGUOUS";e["FAILED"]="FAILED"})(ge||(t.TestStepResultStatus=ge={}))},9782:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.parseEnvelope=parseEnvelope;var s=n(6849);var r=n(451);function parseEnvelope(e){var t=JSON.parse(e);return(0,r.plainToClass)(s.Envelope,t)}},2505:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.version=void 0;t.version="30.1.0"},477:()=>{
3
3
  /*! *****************************************************************************
4
4
  Copyright (C) Microsoft. All rights reserved.
5
5
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -134,4 +134,4 @@ var e;(function(e){(function(t){var n=typeof globalThis==="object"?globalThis:ty
134
134
  *
135
135
  * @param {Mixed} value
136
136
  * @return {Boolean} result
137
- */function isPrimitive(e){return e===null||typeof e!=="object"}function mapSymbols(e){return e.map((function mapSymbol(e){if(typeof e==="symbol"){return e.toString()}return e}))}},6097:e=>{"use strict";e.exports=JSON.parse('{"af":{"and":["* ","En "],"background":["Agtergrond"],"but":["* ","Maar "],"examples":["Voorbeelde"],"feature":["Funksie","Besigheid Behoefte","Vermoë"],"given":["* ","Gegewe "],"name":"Afrikaans","native":"Afrikaans","rule":["Reël","Reel"],"scenario":["Voorbeeld","Situasie"],"scenarioOutline":["Situasie Uiteensetting"],"then":["* ","Dan "],"when":["* ","Wanneer "]},"am":{"and":["* ","Եվ "],"background":["Կոնտեքստ"],"but":["* ","Բայց "],"examples":["Օրինակներ"],"feature":["Ֆունկցիոնալություն","Հատկություն"],"given":["* ","Դիցուք "],"name":"Armenian","native":"հայերեն","rule":["Rule"],"scenario":["Օրինակ","Սցենար"],"scenarioOutline":["Սցենարի կառուցվացքը"],"then":["* ","Ապա "],"when":["* ","Եթե ","Երբ "]},"an":{"and":["* ","Y ","E "],"background":["Antecedents"],"but":["* ","Pero "],"examples":["Eixemplos"],"feature":["Caracteristica"],"given":["* ","Dau ","Dada ","Daus ","Dadas "],"name":"Aragonese","native":"Aragonés","rule":["Rule"],"scenario":["Eixemplo","Caso"],"scenarioOutline":["Esquema del caso"],"then":["* ","Alavez ","Allora ","Antonces "],"when":["* ","Cuan "]},"ar":{"and":["* ","و "],"background":["الخلفية"],"but":["* ","لكن "],"examples":["امثلة"],"feature":["خاصية"],"given":["* ","بفرض "],"name":"Arabic","native":"العربية","rule":["Rule"],"scenario":["مثال","سيناريو"],"scenarioOutline":["سيناريو مخطط"],"then":["* ","اذاً ","ثم "],"when":["* ","متى ","عندما "]},"ast":{"and":["* ","Y ","Ya "],"background":["Antecedentes"],"but":["* ","Peru "],"examples":["Exemplos"],"feature":["Carauterística"],"given":["* ","Dáu ","Dada ","Daos ","Daes "],"name":"Asturian","native":"asturianu","rule":["Rule"],"scenario":["Exemplo","Casu"],"scenarioOutline":["Esbozu del casu"],"then":["* ","Entós "],"when":["* ","Cuando "]},"az":{"and":["* ","Və ","Həm "],"background":["Keçmiş","Kontekst"],"but":["* ","Amma ","Ancaq "],"examples":["Nümunələr"],"feature":["Özəllik"],"given":["* ","Tutaq ki ","Verilir "],"name":"Azerbaijani","native":"Azərbaycanca","rule":["Rule"],"scenario":["Nümunə","Ssenari"],"scenarioOutline":["Ssenarinin strukturu"],"then":["* ","O halda "],"when":["* ","Əgər ","Nə vaxt ki "]},"be":{"and":["* ","I ","Ды ","Таксама "],"background":["Кантэкст"],"but":["* ","Але ","Інакш "],"examples":["Прыклады"],"feature":["Функцыянальнасць","Фіча"],"given":["* ","Няхай ","Дадзена "],"name":"Belarusian","native":"Беларуская","rule":["Правілы"],"scenario":["Сцэнарый","Cцэнар"],"scenarioOutline":["Шаблон сцэнарыя","Узор сцэнара"],"then":["* ","Тады "],"when":["* ","Калі "]},"bg":{"and":["* ","И "],"background":["Предистория"],"but":["* ","Но "],"examples":["Примери"],"feature":["Функционалност"],"given":["* ","Дадено "],"name":"Bulgarian","native":"български","rule":["Правило"],"scenario":["Пример","Сценарий"],"scenarioOutline":["Рамка на сценарий"],"then":["* ","То "],"when":["* ","Когато "]},"bm":{"and":["* ","Dan "],"background":["Latar Belakang"],"but":["* ","Tetapi ","Tapi "],"examples":["Contoh"],"feature":["Fungsi"],"given":["* ","Diberi ","Bagi "],"name":"Malay","native":"Bahasa Melayu","rule":["Rule"],"scenario":["Senario","Situasi","Keadaan"],"scenarioOutline":["Kerangka Senario","Kerangka Situasi","Kerangka Keadaan","Garis Panduan Senario"],"then":["* ","Maka ","Kemudian "],"when":["* ","Apabila "]},"bs":{"and":["* ","I ","A "],"background":["Pozadina"],"but":["* ","Ali "],"examples":["Primjeri"],"feature":["Karakteristika"],"given":["* ","Dato "],"name":"Bosnian","native":"Bosanski","rule":["Rule"],"scenario":["Primjer","Scenariju","Scenario"],"scenarioOutline":["Scenariju-obris","Scenario-outline"],"then":["* ","Zatim "],"when":["* ","Kada "]},"ca":{"and":["* ","I "],"background":["Rerefons","Antecedents"],"but":["* ","Però "],"examples":["Exemples"],"feature":["Característica","Funcionalitat"],"given":["* ","Donat ","Donada ","Atès ","Atesa "],"name":"Catalan","native":"català","rule":["Rule"],"scenario":["Exemple","Escenari"],"scenarioOutline":["Esquema de l\'escenari"],"then":["* ","Aleshores ","Cal "],"when":["* ","Quan "]},"cs":{"and":["* ","A také ","A "],"background":["Pozadí","Kontext"],"but":["* ","Ale "],"examples":["Příklady"],"feature":["Požadavek"],"given":["* ","Pokud ","Za předpokladu "],"name":"Czech","native":"Česky","rule":["Pravidlo"],"scenario":["Příklad","Scénář"],"scenarioOutline":["Náčrt Scénáře","Osnova scénáře"],"then":["* ","Pak "],"when":["* ","Když "]},"cy-GB":{"and":["* ","A "],"background":["Cefndir"],"but":["* ","Ond "],"examples":["Enghreifftiau"],"feature":["Arwedd"],"given":["* ","Anrhegedig a "],"name":"Welsh","native":"Cymraeg","rule":["Rule"],"scenario":["Enghraifft","Scenario"],"scenarioOutline":["Scenario Amlinellol"],"then":["* ","Yna "],"when":["* ","Pryd "]},"da":{"and":["* ","Og "],"background":["Baggrund"],"but":["* ","Men "],"examples":["Eksempler"],"feature":["Egenskab"],"given":["* ","Givet "],"name":"Danish","native":"dansk","rule":["Regel"],"scenario":["Eksempel","Scenarie"],"scenarioOutline":["Abstrakt Scenario"],"then":["* ","Så "],"when":["* ","Når "]},"de":{"and":["* ","Und "],"background":["Grundlage","Hintergrund","Voraussetzungen","Vorbedingungen"],"but":["* ","Aber "],"examples":["Beispiele"],"feature":["Funktionalität","Funktion"],"given":["* ","Angenommen ","Gegeben sei ","Gegeben seien "],"name":"German","native":"Deutsch","rule":["Rule","Regel"],"scenario":["Beispiel","Szenario"],"scenarioOutline":["Szenariogrundriss","Szenarien"],"then":["* ","Dann "],"when":["* ","Wenn "]},"el":{"and":["* ","Και "],"background":["Υπόβαθρο"],"but":["* ","Αλλά "],"examples":["Παραδείγματα","Σενάρια"],"feature":["Δυνατότητα","Λειτουργία"],"given":["* ","Δεδομένου "],"name":"Greek","native":"Ελληνικά","rule":["Rule"],"scenario":["Παράδειγμα","Σενάριο"],"scenarioOutline":["Περιγραφή Σεναρίου","Περίγραμμα Σεναρίου"],"then":["* ","Τότε "],"when":["* ","Όταν "]},"em":{"and":["* ","😂"],"background":["💤"],"but":["* ","😔"],"examples":["📓"],"feature":["📚"],"given":["* ","😐"],"name":"Emoji","native":"😀","rule":["Rule"],"scenario":["🥒","📕"],"scenarioOutline":["📖"],"then":["* ","🙏"],"when":["* ","🎬"]},"en":{"and":["* ","And "],"background":["Background"],"but":["* ","But "],"examples":["Examples","Scenarios"],"feature":["Feature","Business Need","Ability"],"given":["* ","Given "],"name":"English","native":"English","rule":["Rule"],"scenario":["Example","Scenario"],"scenarioOutline":["Scenario Outline","Scenario Template"],"then":["* ","Then "],"when":["* ","When "]},"en-Scouse":{"and":["* ","An "],"background":["Dis is what went down"],"but":["* ","Buh "],"examples":["Examples"],"feature":["Feature"],"given":["* ","Givun ","Youse know when youse got "],"name":"Scouse","native":"Scouse","rule":["Rule"],"scenario":["The thing of it is"],"scenarioOutline":["Wharrimean is"],"then":["* ","Dun ","Den youse gotta "],"when":["* ","Wun ","Youse know like when "]},"en-au":{"and":["* ","Too right "],"background":["First off"],"but":["* ","Yeah nah "],"examples":["You\'ll wanna"],"feature":["Pretty much"],"given":["* ","Y\'know "],"name":"Australian","native":"Australian","rule":["Rule"],"scenario":["Awww, look mate"],"scenarioOutline":["Reckon it\'s like"],"then":["* ","But at the end of the day I reckon "],"when":["* ","It\'s just unbelievable "]},"en-lol":{"and":["* ","AN "],"background":["B4"],"but":["* ","BUT "],"examples":["EXAMPLZ"],"feature":["OH HAI"],"given":["* ","I CAN HAZ "],"name":"LOLCAT","native":"LOLCAT","rule":["Rule"],"scenario":["MISHUN"],"scenarioOutline":["MISHUN SRSLY"],"then":["* ","DEN "],"when":["* ","WEN "]},"en-old":{"and":["* ","Ond ","7 "],"background":["Aer","Ær"],"but":["* ","Ac "],"examples":["Se the","Se þe","Se ðe"],"feature":["Hwaet","Hwæt"],"given":["* ","Thurh ","Þurh ","Ðurh "],"name":"Old English","native":"Englisc","rule":["Rule"],"scenario":["Swa"],"scenarioOutline":["Swa hwaer swa","Swa hwær swa"],"then":["* ","Tha ","Þa ","Ða ","Tha the ","Þa þe ","Ða ðe "],"when":["* ","Bæþsealf ","Bæþsealfa ","Bæþsealfe ","Ciricæw ","Ciricæwe ","Ciricæwa "]},"en-pirate":{"and":["* ","Aye "],"background":["Yo-ho-ho"],"but":["* ","Avast! "],"examples":["Dead men tell no tales"],"feature":["Ahoy matey!"],"given":["* ","Gangway! "],"name":"Pirate","native":"Pirate","rule":["Rule"],"scenario":["Heave to"],"scenarioOutline":["Shiver me timbers"],"then":["* ","Let go and haul "],"when":["* ","Blimey! "]},"en-tx":{"and":["Come hell or high water "],"background":["Lemme tell y\'all a story"],"but":["Well now hold on, I\'ll you what "],"examples":["Now that\'s a story longer than a cattle drive in July"],"feature":["This ain’t my first rodeo","All gussied up"],"given":["Fixin\' to ","All git out "],"name":"Texas","native":"Texas","rule":["Rule "],"scenario":["All hat and no cattle"],"scenarioOutline":["Serious as a snake bite","Busy as a hound in flea season"],"then":["There’s no tree but bears some fruit "],"when":["Quick out of the chute "]},"eo":{"and":["* ","Kaj "],"background":["Fono"],"but":["* ","Sed "],"examples":["Ekzemploj"],"feature":["Trajto"],"given":["* ","Donitaĵo ","Komence "],"name":"Esperanto","native":"Esperanto","rule":["Regulo"],"scenario":["Ekzemplo","Scenaro","Kazo"],"scenarioOutline":["Konturo de la scenaro","Skizo","Kazo-skizo"],"then":["* ","Do "],"when":["* ","Se "]},"es":{"and":["* ","Y ","E "],"background":["Antecedentes"],"but":["* ","Pero "],"examples":["Ejemplos"],"feature":["Característica","Necesidad del negocio","Requisito"],"given":["* ","Dado ","Dada ","Dados ","Dadas "],"name":"Spanish","native":"español","rule":["Regla","Regla de negocio"],"scenario":["Ejemplo","Escenario"],"scenarioOutline":["Esquema del escenario"],"then":["* ","Entonces "],"when":["* ","Cuando "]},"et":{"and":["* ","Ja "],"background":["Taust"],"but":["* ","Kuid "],"examples":["Juhtumid"],"feature":["Omadus"],"given":["* ","Eeldades "],"name":"Estonian","native":"eesti keel","rule":["Reegel"],"scenario":["Juhtum","Stsenaarium"],"scenarioOutline":["Raamjuhtum","Raamstsenaarium"],"then":["* ","Siis "],"when":["* ","Kui "]},"fa":{"and":["* ","و "],"background":["زمینه"],"but":["* ","اما "],"examples":["نمونه ها"],"feature":["وِیژگی"],"given":["* ","با فرض "],"name":"Persian","native":"فارسی","rule":["Rule"],"scenario":["مثال","سناریو"],"scenarioOutline":["الگوی سناریو"],"then":["* ","آنگاه "],"when":["* ","هنگامی "]},"fi":{"and":["* ","Ja "],"background":["Tausta"],"but":["* ","Mutta "],"examples":["Tapaukset"],"feature":["Ominaisuus"],"given":["* ","Oletetaan "],"name":"Finnish","native":"suomi","rule":["Rule"],"scenario":["Tapaus"],"scenarioOutline":["Tapausaihio"],"then":["* ","Niin "],"when":["* ","Kun "]},"fr":{"and":["* ","Et que ","Et qu\'","Et "],"background":["Contexte"],"but":["* ","Mais que ","Mais qu\'","Mais "],"examples":["Exemples"],"feature":["Fonctionnalité"],"given":["* ","Soit ","Sachant que ","Sachant qu\'","Sachant ","Etant donné que ","Etant donné qu\'","Etant donné ","Etant donnée ","Etant donnés ","Etant données ","Étant donné que ","Étant donné qu\'","Étant donné ","Étant donnée ","Étant donnés ","Étant données "],"name":"French","native":"français","rule":["Règle"],"scenario":["Exemple","Scénario"],"scenarioOutline":["Plan du scénario","Plan du Scénario"],"then":["* ","Alors ","Donc "],"when":["* ","Quand ","Lorsque ","Lorsqu\'"]},"ga":{"and":["* ","Agus "],"background":["Cúlra"],"but":["* ","Ach "],"examples":["Samplaí"],"feature":["Gné"],"given":["* ","Cuir i gcás go ","Cuir i gcás nach ","Cuir i gcás gur ","Cuir i gcás nár "],"name":"Irish","native":"Gaeilge","rule":["Riail"],"scenario":["Sampla","Cás"],"scenarioOutline":["Cás Achomair"],"then":["* ","Ansin "],"when":["* ","Nuair a ","Nuair nach ","Nuair ba ","Nuair nár "]},"gj":{"and":["* ","અને "],"background":["બેકગ્રાઉન્ડ"],"but":["* ","પણ "],"examples":["ઉદાહરણો"],"feature":["લક્ષણ","વ્યાપાર જરૂર","ક્ષમતા"],"given":["* ","આપેલ છે "],"name":"Gujarati","native":"ગુજરાતી","rule":["નિયમ"],"scenario":["ઉદાહરણ","સ્થિતિ"],"scenarioOutline":["પરિદ્દશ્ય રૂપરેખા","પરિદ્દશ્ય ઢાંચો"],"then":["* ","પછી "],"when":["* ","ક્યારે "]},"gl":{"and":["* ","E "],"background":["Contexto"],"but":["* ","Mais ","Pero "],"examples":["Exemplos"],"feature":["Característica"],"given":["* ","Dado ","Dada ","Dados ","Dadas "],"name":"Galician","native":"galego","rule":["Rule"],"scenario":["Exemplo","Escenario"],"scenarioOutline":["Esbozo do escenario"],"then":["* ","Entón ","Logo "],"when":["* ","Cando "]},"he":{"and":["* ","וגם "],"background":["רקע"],"but":["* ","אבל "],"examples":["דוגמאות"],"feature":["תכונה"],"given":["* ","בהינתן "],"name":"Hebrew","native":"עברית","rule":["כלל"],"scenario":["דוגמא","תרחיש"],"scenarioOutline":["תבנית תרחיש"],"then":["* ","אז ","אזי "],"when":["* ","כאשר "]},"hi":{"and":["* ","और ","तथा "],"background":["पृष्ठभूमि"],"but":["* ","पर ","परन्तु ","किन्तु "],"examples":["उदाहरण"],"feature":["रूप लेख"],"given":["* ","अगर ","यदि ","चूंकि "],"name":"Hindi","native":"हिंदी","rule":["नियम"],"scenario":["परिदृश्य"],"scenarioOutline":["परिदृश्य रूपरेखा"],"then":["* ","तब ","तदा "],"when":["* ","जब ","कदा "]},"hr":{"and":["* ","I "],"background":["Pozadina"],"but":["* ","Ali "],"examples":["Primjeri","Scenariji"],"feature":["Osobina","Mogućnost","Mogucnost"],"given":["* ","Zadan ","Zadani ","Zadano ","Ukoliko "],"name":"Croatian","native":"hrvatski","rule":["Rule"],"scenario":["Primjer","Scenarij"],"scenarioOutline":["Skica","Koncept"],"then":["* ","Onda "],"when":["* ","Kada ","Kad "]},"ht":{"and":["* ","Ak ","Epi ","E "],"background":["Kontèks","Istorik"],"but":["* ","Men "],"examples":["Egzanp"],"feature":["Karakteristik","Mak","Fonksyonalite"],"given":["* ","Sipoze ","Sipoze ke ","Sipoze Ke "],"name":"Creole","native":"kreyòl","rule":["Rule"],"scenario":["Senaryo"],"scenarioOutline":["Plan senaryo","Plan Senaryo","Senaryo deskripsyon","Senaryo Deskripsyon","Dyagram senaryo","Dyagram Senaryo"],"then":["* ","Lè sa a ","Le sa a "],"when":["* ","Lè ","Le "]},"hu":{"and":["* ","És "],"background":["Háttér"],"but":["* ","De "],"examples":["Példák"],"feature":["Jellemző"],"given":["* ","Amennyiben ","Adott "],"name":"Hungarian","native":"magyar","rule":["Szabály"],"scenario":["Példa","Forgatókönyv"],"scenarioOutline":["Forgatókönyv vázlat"],"then":["* ","Akkor "],"when":["* ","Majd ","Ha ","Amikor "]},"id":{"and":["* ","Dan "],"background":["Dasar","Latar Belakang"],"but":["* ","Tapi ","Tetapi "],"examples":["Contoh","Misal"],"feature":["Fitur"],"given":["* ","Dengan ","Diketahui ","Diasumsikan ","Bila ","Jika "],"name":"Indonesian","native":"Bahasa Indonesia","rule":["Rule","Aturan"],"scenario":["Skenario"],"scenarioOutline":["Skenario konsep","Garis-Besar Skenario"],"then":["* ","Maka ","Kemudian "],"when":["* ","Ketika "]},"is":{"and":["* ","Og "],"background":["Bakgrunnur"],"but":["* ","En "],"examples":["Dæmi","Atburðarásir"],"feature":["Eiginleiki"],"given":["* ","Ef "],"name":"Icelandic","native":"Íslenska","rule":["Rule"],"scenario":["Atburðarás"],"scenarioOutline":["Lýsing Atburðarásar","Lýsing Dæma"],"then":["* ","Þá "],"when":["* ","Þegar "]},"it":{"and":["* ","E ","Ed "],"background":["Contesto"],"but":["* ","Ma "],"examples":["Esempi"],"feature":["Funzionalità","Esigenza di Business","Abilità"],"given":["* ","Dato ","Data ","Dati ","Date "],"name":"Italian","native":"italiano","rule":["Regola"],"scenario":["Esempio","Scenario"],"scenarioOutline":["Schema dello scenario"],"then":["* ","Allora "],"when":["* ","Quando "]},"ja":{"and":["* ","且つ","かつ"],"background":["背景"],"but":["* ","然し","しかし","但し","ただし"],"examples":["例","サンプル"],"feature":["フィーチャ","機能"],"given":["* ","前提"],"name":"Japanese","native":"日本語","rule":["ルール"],"scenario":["シナリオ"],"scenarioOutline":["シナリオアウトライン","シナリオテンプレート","テンプレ","シナリオテンプレ"],"then":["* ","ならば"],"when":["* ","もし"]},"jv":{"and":["* ","Lan "],"background":["Dasar"],"but":["* ","Tapi ","Nanging ","Ananging "],"examples":["Conto","Contone"],"feature":["Fitur"],"given":["* ","Nalika ","Nalikaning "],"name":"Javanese","native":"Basa Jawa","rule":["Rule"],"scenario":["Skenario"],"scenarioOutline":["Konsep skenario"],"then":["* ","Njuk ","Banjur "],"when":["* ","Manawa ","Menawa "]},"ka":{"and":["* ","და ","ასევე "],"background":["კონტექსტი"],"but":["* ","მაგრამ ","თუმცა "],"examples":["მაგალითები"],"feature":["თვისება","მოთხოვნა"],"given":["* ","მოცემული ","მოცემულია ","ვთქვათ "],"name":"Georgian","native":"ქართული","rule":["წესი"],"scenario":["მაგალითად","მაგალითი","მაგ","სცენარი"],"scenarioOutline":["სცენარის ნიმუში","სცენარის შაბლონი","ნიმუში","შაბლონი"],"then":["* ","მაშინ "],"when":["* ","როდესაც ","როცა ","როგორც კი ","თუ "]},"kn":{"and":["* ","ಮತ್ತು "],"background":["ಹಿನ್ನೆಲೆ"],"but":["* ","ಆದರೆ "],"examples":["ಉದಾಹರಣೆಗಳು"],"feature":["ಹೆಚ್ಚಳ"],"given":["* ","ನೀಡಿದ "],"name":"Kannada","native":"ಕನ್ನಡ","rule":["Rule"],"scenario":["ಉದಾಹರಣೆ","ಕಥಾಸಾರಾಂಶ"],"scenarioOutline":["ವಿವರಣೆ"],"then":["* ","ನಂತರ "],"when":["* ","ಸ್ಥಿತಿಯನ್ನು "]},"ko":{"and":["* ","그리고 "],"background":["배경"],"but":["* ","하지만 ","단 "],"examples":["예"],"feature":["기능"],"given":["* ","조건 ","먼저 "],"name":"Korean","native":"한국어","rule":["규칙"],"scenario":["시나리오"],"scenarioOutline":["시나리오 개요"],"then":["* ","그러면 "],"when":["* ","만일 ","만약 "]},"lt":{"and":["* ","Ir "],"background":["Kontekstas"],"but":["* ","Bet "],"examples":["Pavyzdžiai","Scenarijai","Variantai"],"feature":["Savybė"],"given":["* ","Duota "],"name":"Lithuanian","native":"lietuvių kalba","rule":["Rule"],"scenario":["Pavyzdys","Scenarijus"],"scenarioOutline":["Scenarijaus šablonas"],"then":["* ","Tada "],"when":["* ","Kai "]},"lu":{"and":["* ","an ","a "],"background":["Hannergrond"],"but":["* ","awer ","mä "],"examples":["Beispiller"],"feature":["Funktionalitéit"],"given":["* ","ugeholl "],"name":"Luxemburgish","native":"Lëtzebuergesch","rule":["Rule"],"scenario":["Beispill","Szenario"],"scenarioOutline":["Plang vum Szenario"],"then":["* ","dann "],"when":["* ","wann "]},"lv":{"and":["* ","Un "],"background":["Konteksts","Situācija"],"but":["* ","Bet "],"examples":["Piemēri","Paraugs"],"feature":["Funkcionalitāte","Fīča"],"given":["* ","Kad "],"name":"Latvian","native":"latviešu","rule":["Rule"],"scenario":["Piemērs","Scenārijs"],"scenarioOutline":["Scenārijs pēc parauga"],"then":["* ","Tad "],"when":["* ","Ja "]},"mk-Cyrl":{"and":["* ","И "],"background":["Контекст","Содржина"],"but":["* ","Но "],"examples":["Примери","Сценарија"],"feature":["Функционалност","Бизнис потреба","Можност"],"given":["* ","Дадено ","Дадена "],"name":"Macedonian","native":"Македонски","rule":["Rule"],"scenario":["Пример","Сценарио","На пример"],"scenarioOutline":["Преглед на сценарија","Скица","Концепт"],"then":["* ","Тогаш "],"when":["* ","Кога "]},"mk-Latn":{"and":["* ","I "],"background":["Kontekst","Sodrzhina"],"but":["* ","No "],"examples":["Primeri","Scenaria"],"feature":["Funkcionalnost","Biznis potreba","Mozhnost"],"given":["* ","Dadeno ","Dadena "],"name":"Macedonian (Latin)","native":"Makedonski (Latinica)","rule":["Rule"],"scenario":["Scenario","Na primer"],"scenarioOutline":["Pregled na scenarija","Skica","Koncept"],"then":["* ","Togash "],"when":["* ","Koga "]},"mn":{"and":["* ","Мөн ","Тэгээд "],"background":["Агуулга"],"but":["* ","Гэхдээ ","Харин "],"examples":["Тухайлбал"],"feature":["Функц","Функционал"],"given":["* ","Өгөгдсөн нь ","Анх "],"name":"Mongolian","native":"монгол","rule":["Rule"],"scenario":["Сценар"],"scenarioOutline":["Сценарын төлөвлөгөө"],"then":["* ","Тэгэхэд ","Үүний дараа "],"when":["* ","Хэрэв "]},"ne":{"and":["* ","र ","अनि "],"background":["पृष्ठभूमी"],"but":["* ","तर "],"examples":["उदाहरण","उदाहरणहरु"],"feature":["सुविधा","विशेषता"],"given":["* ","दिइएको ","दिएको ","यदि "],"name":"Nepali","native":"नेपाली","rule":["नियम"],"scenario":["परिदृश्य"],"scenarioOutline":["परिदृश्य रूपरेखा"],"then":["* ","त्यसपछि ","अनी "],"when":["* ","जब "]},"nl":{"and":["* ","En "],"background":["Achtergrond"],"but":["* ","Maar "],"examples":["Voorbeelden"],"feature":["Functionaliteit"],"given":["* ","Gegeven ","Stel "],"name":"Dutch","native":"Nederlands","rule":["Regel"],"scenario":["Voorbeeld","Scenario"],"scenarioOutline":["Abstract Scenario"],"then":["* ","Dan "],"when":["* ","Als ","Wanneer "]},"no":{"and":["* ","Og "],"background":["Bakgrunn"],"but":["* ","Men "],"examples":["Eksempler"],"feature":["Egenskap"],"given":["* ","Gitt "],"name":"Norwegian","native":"norsk","rule":["Regel"],"scenario":["Eksempel","Scenario"],"scenarioOutline":["Scenariomal","Abstrakt Scenario"],"then":["* ","Så "],"when":["* ","Når "]},"pa":{"and":["* ","ਅਤੇ "],"background":["ਪਿਛੋਕੜ"],"but":["* ","ਪਰ "],"examples":["ਉਦਾਹਰਨਾਂ"],"feature":["ਖਾਸੀਅਤ","ਮੁਹਾਂਦਰਾ","ਨਕਸ਼ ਨੁਹਾਰ"],"given":["* ","ਜੇਕਰ ","ਜਿਵੇਂ ਕਿ "],"name":"Panjabi","native":"ਪੰਜਾਬੀ","rule":["Rule"],"scenario":["ਉਦਾਹਰਨ","ਪਟਕਥਾ"],"scenarioOutline":["ਪਟਕਥਾ ਢਾਂਚਾ","ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ"],"then":["* ","ਤਦ "],"when":["* ","ਜਦੋਂ "]},"pl":{"and":["* ","Oraz ","I "],"background":["Założenia"],"but":["* ","Ale "],"examples":["Przykłady"],"feature":["Właściwość","Funkcja","Aspekt","Potrzeba biznesowa"],"given":["* ","Zakładając ","Mając ","Zakładając, że "],"name":"Polish","native":"polski","rule":["Zasada","Reguła"],"scenario":["Przykład","Scenariusz"],"scenarioOutline":["Szablon scenariusza"],"then":["* ","Wtedy "],"when":["* ","Jeżeli ","Jeśli ","Gdy ","Kiedy "]},"pt":{"and":["* ","E "],"background":["Contexto","Cenário de Fundo","Cenario de Fundo","Fundo"],"but":["* ","Mas "],"examples":["Exemplos","Cenários","Cenarios"],"feature":["Funcionalidade","Característica","Caracteristica"],"given":["* ","Dado ","Dada ","Dados ","Dadas "],"name":"Portuguese","native":"português","rule":["Regra"],"scenario":["Exemplo","Cenário","Cenario"],"scenarioOutline":["Esquema do Cenário","Esquema do Cenario","Delineação do Cenário","Delineacao do Cenario"],"then":["* ","Então ","Entao "],"when":["* ","Quando "]},"ro":{"and":["* ","Si ","Și ","Şi "],"background":["Context"],"but":["* ","Dar "],"examples":["Exemple"],"feature":["Functionalitate","Funcționalitate","Funcţionalitate"],"given":["* ","Date fiind ","Dat fiind ","Dată fiind","Dati fiind ","Dați fiind ","Daţi fiind "],"name":"Romanian","native":"română","rule":["Rule"],"scenario":["Exemplu","Scenariu"],"scenarioOutline":["Structura scenariu","Structură scenariu"],"then":["* ","Atunci "],"when":["* ","Cand ","Când "]},"ru":{"and":["* ","И ","К тому же ","Также "],"background":["Предыстория","Контекст"],"but":["* ","Но ","А ","Иначе "],"examples":["Примеры","Значения"],"feature":["Функция","Функциональность","Функционал","Свойство","Фича"],"given":["* ","Допустим ","Дано ","Пусть "],"name":"Russian","native":"русский","rule":["Правило"],"scenario":["Пример","Сценарий"],"scenarioOutline":["Структура сценария","Шаблон сценария"],"then":["* ","То ","Затем ","Тогда "],"when":["* ","Когда ","Если "]},"sk":{"and":["* ","A ","A tiež ","A taktiež ","A zároveň "],"background":["Pozadie"],"but":["* ","Ale "],"examples":["Príklady"],"feature":["Požiadavka","Funkcia","Vlastnosť"],"given":["* ","Pokiaľ ","Za predpokladu "],"name":"Slovak","native":"Slovensky","rule":["Rule"],"scenario":["Príklad","Scenár"],"scenarioOutline":["Náčrt Scenáru","Náčrt Scenára","Osnova Scenára"],"then":["* ","Tak ","Potom "],"when":["* ","Keď ","Ak "]},"sl":{"and":["In ","Ter "],"background":["Kontekst","Osnova","Ozadje"],"but":["Toda ","Ampak ","Vendar "],"examples":["Primeri","Scenariji"],"feature":["Funkcionalnost","Funkcija","Možnosti","Moznosti","Lastnost","Značilnost"],"given":["Dano ","Podano ","Zaradi ","Privzeto "],"name":"Slovenian","native":"Slovenski","rule":["Rule"],"scenario":["Primer","Scenarij"],"scenarioOutline":["Struktura scenarija","Skica","Koncept","Oris scenarija","Osnutek"],"then":["Nato ","Potem ","Takrat "],"when":["Ko ","Ce ","Če ","Kadar "]},"sr-Cyrl":{"and":["* ","И "],"background":["Контекст","Основа","Позадина"],"but":["* ","Али "],"examples":["Примери","Сценарији"],"feature":["Функционалност","Могућност","Особина"],"given":["* ","За дато ","За дате ","За дати "],"name":"Serbian","native":"Српски","rule":["Правило"],"scenario":["Сценарио","Пример"],"scenarioOutline":["Структура сценарија","Скица","Концепт"],"then":["* ","Онда "],"when":["* ","Када ","Кад "]},"sr-Latn":{"and":["* ","I "],"background":["Kontekst","Osnova","Pozadina"],"but":["* ","Ali "],"examples":["Primeri","Scenariji"],"feature":["Funkcionalnost","Mogućnost","Mogucnost","Osobina"],"given":["* ","Za dato ","Za date ","Za dati "],"name":"Serbian (Latin)","native":"Srpski (Latinica)","rule":["Pravilo"],"scenario":["Scenario","Primer"],"scenarioOutline":["Struktura scenarija","Skica","Koncept"],"then":["* ","Onda "],"when":["* ","Kada ","Kad "]},"sv":{"and":["* ","Och "],"background":["Bakgrund"],"but":["* ","Men "],"examples":["Exempel"],"feature":["Egenskap"],"given":["* ","Givet "],"name":"Swedish","native":"Svenska","rule":["Regel"],"scenario":["Scenario"],"scenarioOutline":["Abstrakt Scenario","Scenariomall"],"then":["* ","Så "],"when":["* ","När "]},"ta":{"and":["* ","மேலும் ","மற்றும் "],"background":["பின்னணி"],"but":["* ","ஆனால் "],"examples":["எடுத்துக்காட்டுகள்","காட்சிகள்","நிலைமைகளில்"],"feature":["அம்சம்","வணிக தேவை","திறன்"],"given":["* ","கொடுக்கப்பட்ட "],"name":"Tamil","native":"தமிழ்","rule":["Rule"],"scenario":["உதாரணமாக","காட்சி"],"scenarioOutline":["காட்சி சுருக்கம்","காட்சி வார்ப்புரு"],"then":["* ","அப்பொழுது "],"when":["* ","எப்போது "]},"th":{"and":["* ","และ "],"background":["แนวคิด"],"but":["* ","แต่ "],"examples":["ชุดของตัวอย่าง","ชุดของเหตุการณ์"],"feature":["โครงหลัก","ความต้องการทางธุรกิจ","ความสามารถ"],"given":["* ","กำหนดให้ "],"name":"Thai","native":"ไทย","rule":["Rule"],"scenario":["เหตุการณ์"],"scenarioOutline":["สรุปเหตุการณ์","โครงสร้างของเหตุการณ์"],"then":["* ","ดังนั้น "],"when":["* ","เมื่อ "]},"te":{"and":["* ","మరియు "],"background":["నేపథ్యం"],"but":["* ","కాని "],"examples":["ఉదాహరణలు"],"feature":["గుణము"],"given":["* ","చెప్పబడినది "],"name":"Telugu","native":"తెలుగు","rule":["Rule"],"scenario":["ఉదాహరణ","సన్నివేశం"],"scenarioOutline":["కథనం"],"then":["* ","అప్పుడు "],"when":["* ","ఈ పరిస్థితిలో "]},"tlh":{"and":["* ","\'ej ","latlh "],"background":["mo\'"],"but":["* ","\'ach ","\'a "],"examples":["ghantoH","lutmey"],"feature":["Qap","Qu\'meH \'ut","perbogh","poQbogh malja\'","laH"],"given":["* ","ghu\' noblu\' ","DaH ghu\' bejlu\' "],"name":"Klingon","native":"tlhIngan","rule":["Rule"],"scenario":["lut"],"scenarioOutline":["lut chovnatlh"],"then":["* ","vaj "],"when":["* ","qaSDI\' "]},"tr":{"and":["* ","Ve ","Hem de ","Bir de ","Ayrıca ","İlaveten ","Buna ek olarak "],"background":["Geçmiş","Arka Plan","Ön Koşul","Önkoşul","Önceki Durum","Giriş","Mukaddime","Mevcut Durum"],"but":["* ","Fakat ","Ama ","Ancak ","Yalnız ","Lakin ","Meğer ki ","Buna mukabil ","Aksi halde "],"examples":["Örnekler","Değerler"],"feature":["Özellik","İş Gereksinimi","Gereksinim","İşlev","Kullanıcı Hikayesi","Yetenek","Teknik Gereksinim"],"given":["* ","Mevcut ","Önceden ","Geçmişte ","Daha önce ","Halihazırda ","Zaten ","Sistemde ","Diyelim ki ","Varsayalım ki ","Farz edelim ki ","Kabul edelim ki ","Başlangıçta ","Varsayılan olarak ","Biliniyor ki "],"name":"Turkish","native":"Türkçe","rule":["Kural","İş Kuralı","Kaide","Hüküm","Madde"],"scenario":["Örnek","Senaryo","Durum","Vaka"],"scenarioOutline":["Senaryo taslağı","Senaryo şablonu"],"then":["* ","Beklenen ","O zaman ","Sonuç olarak ","Böylece ","Bunun üzerine ","Bu durumda ","O takdirde ","Şu halde ","Netice itibariyle ","Buna binaen "],"when":["* ","Eğer ","Eğer ki ","Ne zaman ","Ne zaman ki ","Şayet "]},"tt":{"and":["* ","Һәм ","Вә "],"background":["Кереш"],"but":["* ","Ләкин ","Әмма "],"examples":["Үрнәкләр","Мисаллар"],"feature":["Мөмкинлек","Үзенчәлеклелек"],"given":["* ","Әйтик "],"name":"Tatar","native":"Татарча","rule":["Rule"],"scenario":["Сценарий"],"scenarioOutline":["Сценарийның төзелеше"],"then":["* ","Нәтиҗәдә "],"when":["* ","Әгәр "]},"uk":{"and":["* ","І ","А також ","Та "],"background":["Передумова"],"but":["* ","Але "],"examples":["Приклади"],"feature":["Функціонал"],"given":["* ","Припустимо ","Припустимо, що ","Нехай ","Дано "],"name":"Ukrainian","native":"Українська","rule":["Rule"],"scenario":["Приклад","Сценарій"],"scenarioOutline":["Структура сценарію"],"then":["* ","То ","Тоді "],"when":["* ","Якщо ","Коли "]},"ur":{"and":["* ","اور "],"background":["پس منظر"],"but":["* ","لیکن "],"examples":["مثالیں"],"feature":["صلاحیت","کاروبار کی ضرورت","خصوصیت"],"given":["* ","اگر ","بالفرض ","فرض کیا "],"name":"Urdu","native":"اردو","rule":["Rule"],"scenario":["منظرنامہ"],"scenarioOutline":["منظر نامے کا خاکہ"],"then":["* ","پھر ","تب "],"when":["* ","جب "]},"uz":{"and":["* ","Ва "],"background":["Тарих"],"but":["* ","Лекин ","Бирок ","Аммо "],"examples":["Мисоллар"],"feature":["Функционал"],"given":["* ","Belgilangan "],"name":"Uzbek","native":"Узбекча","rule":["Rule"],"scenario":["Сценарий"],"scenarioOutline":["Сценарий структураси"],"then":["* ","Унда "],"when":["* ","Агар "]},"vi":{"and":["* ","Và "],"background":["Bối cảnh"],"but":["* ","Nhưng "],"examples":["Dữ liệu"],"feature":["Tính năng"],"given":["* ","Biết ","Cho "],"name":"Vietnamese","native":"Tiếng Việt","rule":["Quy tắc"],"scenario":["Tình huống","Kịch bản"],"scenarioOutline":["Khung tình huống","Khung kịch bản"],"then":["* ","Thì "],"when":["* ","Khi "]},"zh-CN":{"and":["* ","而且","并且","同时"],"background":["背景"],"but":["* ","但是"],"examples":["例子"],"feature":["功能"],"given":["* ","假如","假设","假定"],"name":"Chinese simplified","native":"简体中文","rule":["Rule","规则"],"scenario":["场景","剧本"],"scenarioOutline":["场景大纲","剧本大纲"],"then":["* ","那么"],"when":["* ","当"]},"ml":{"and":["* ","ഒപ്പം"],"background":["പശ്ചാത്തലം"],"but":["* ","പക്ഷേ"],"examples":["ഉദാഹരണങ്ങൾ"],"feature":["സവിശേഷത"],"given":["* ","നൽകിയത്"],"name":"Malayalam","native":"മലയാളം","rule":["നിയമം"],"scenario":["രംഗം"],"scenarioOutline":["സാഹചര്യത്തിന്റെ രൂപരേഖ"],"then":["* ","പിന്നെ"],"when":["എപ്പോൾ"]},"zh-TW":{"and":["* ","而且","並且","同時"],"background":["背景"],"but":["* ","但是"],"examples":["例子"],"feature":["功能"],"given":["* ","假如","假設","假定"],"name":"Chinese traditional","native":"繁體中文","rule":["Rule"],"scenario":["場景","劇本"],"scenarioOutline":["場景大綱","劇本大綱"],"then":["* ","那麼"],"when":["* ","當"]},"mr":{"and":["* ","आणि ","तसेच "],"background":["पार्श्वभूमी"],"but":["* ","पण ","परंतु "],"examples":["उदाहरण"],"feature":["वैशिष्ट्य","सुविधा"],"given":["* ","जर","दिलेल्या प्रमाणे "],"name":"Marathi","native":"मराठी","rule":["नियम"],"scenario":["परिदृश्य"],"scenarioOutline":["परिदृश्य रूपरेखा"],"then":["* ","मग ","तेव्हा "],"when":["* ","जेव्हा "]},"amh":{"and":["* ","እና "],"background":["ቅድመ ሁኔታ","መነሻ","መነሻ ሀሳብ"],"but":["* ","ግን "],"examples":["ምሳሌዎች","ሁናቴዎች"],"feature":["ስራ","የተፈለገው ስራ","የሚፈለገው ድርጊት"],"given":["* ","የተሰጠ "],"name":"Amharic","native":"አማርኛ","rule":["ህግ"],"scenario":["ምሳሌ","ሁናቴ"],"scenarioOutline":["ሁናቴ ዝርዝር","ሁናቴ አብነት"],"then":["* ","ከዚያ "],"when":["* ","መቼ "]}}')},8330:e=>{"use strict";e.exports=JSON.parse('{"name":"@fromeroc9/testform","version":"1.1.0-beta.2","description":"Declarative Test-as-Code orchestration engine for Git: zero mandatory SaaS servers, zero test drift, and immutable quality management.","author":"Flavio Romero <flavio.arc9@gmail.com>","main":"dist/index.js","license":"GPL-3.0-or-later","repository":{"type":"git","url":"git+https://github.com/fromeroc9/testform.git"},"keywords":["test-management","test-as-code","gherkin","bdd","behavior-driven development","github","testform"],"files":["dist","README.md","templates","assets"],"bin":{"testform":"dist/index.js"},"scripts":{"prebuild":"node -e \\"const fs = require(\'fs\'); if (fs.existsSync(\'dist\')) fs.rmSync(\'dist\', { recursive: true, force: true });\\"","test":"vitest run","typecheck":"tsc --noEmit","build":"ncc build src/index.ts -m -e @aws-sdk/client-s3 -e @aws-sdk/client-dynamodb -e @azure/storage-blob -e @google-cloud/storage -e docx -e exceljs -o dist","dev":"tsx src/index.ts","docs:dev":"npm --prefix ../testform-docs run dev","docs:build":"npm --prefix ../testform-docs run build","format":"prettier --write \\"src/**/*.ts\\" \\"test/**/*.ts\\"","prepublishOnly":"npm run build"},"devDependencies":{"@aws-sdk/client-dynamodb":"^3.1152.0","@aws-sdk/client-s3":"^3.1152.0","@azure/storage-blob":"^12.31.0","@google-cloud/storage":"7.19.0","@types/node":"^24.12.4","@vercel/ncc":"0.38.4","docx":"^9.14.0","exceljs":"^4.4.0","prettier":"^3.5.0","tsx":"4.19.3","typescript":"5.8.2","vitest":"^5.0.5"},"dependencies":{"@cucumber/gherkin":"39.1.0","@cucumber/messages":"30.1.0","cac":"^6.7.14","chalk":"4.1.2","gherkin-ast":"^3.4.2","gherkin-formatter":"^1.2.2","yaml":"^2.9.1"},"peerDependencies":{"@aws-sdk/client-dynamodb":">=3.0.0","@aws-sdk/client-s3":">=3.0.0","@azure/storage-blob":">=12.0.0","@google-cloud/storage":">=7.0.0","docx":">=9.0.0","exceljs":">=4.0.0"},"peerDependenciesMeta":{"@aws-sdk/client-dynamodb":{"optional":true},"@aws-sdk/client-s3":{"optional":true},"@azure/storage-blob":{"optional":true},"@google-cloud/storage":{"optional":true},"docx":{"optional":true},"exceljs":{"optional":true}},"overrides":{"undici":"^6.23.0","uuid":"^11.1.1"}}')}};var __webpack_module_cache__={};function __nccwpck_require__(e){var t=__webpack_module_cache__[e];if(t!==undefined){return t.exports}var n=__webpack_module_cache__[e]={id:e,loaded:false,exports:{}};var s=true;try{__webpack_modules__[e].call(n.exports,n,n.exports,__nccwpck_require__);s=false}finally{if(s)delete __webpack_module_cache__[e]}n.loaded=true;return n.exports}(()=>{__nccwpck_require__.d=(e,t)=>{for(var n in t){if(__nccwpck_require__.o(t,n)&&!__nccwpck_require__.o(e,n)){Object.defineProperty(e,n,{enumerable:true,get:t[n]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__=__nccwpck_require__(9407);module.exports=__webpack_exports__})();
137
+ */function isPrimitive(e){return e===null||typeof e!=="object"}function mapSymbols(e){return e.map((function mapSymbol(e){if(typeof e==="symbol"){return e.toString()}return e}))}},6097:e=>{"use strict";e.exports=JSON.parse('{"af":{"and":["* ","En "],"background":["Agtergrond"],"but":["* ","Maar "],"examples":["Voorbeelde"],"feature":["Funksie","Besigheid Behoefte","Vermoë"],"given":["* ","Gegewe "],"name":"Afrikaans","native":"Afrikaans","rule":["Reël","Reel"],"scenario":["Voorbeeld","Situasie"],"scenarioOutline":["Situasie Uiteensetting"],"then":["* ","Dan "],"when":["* ","Wanneer "]},"am":{"and":["* ","Եվ "],"background":["Կոնտեքստ"],"but":["* ","Բայց "],"examples":["Օրինակներ"],"feature":["Ֆունկցիոնալություն","Հատկություն"],"given":["* ","Դիցուք "],"name":"Armenian","native":"հայերեն","rule":["Rule"],"scenario":["Օրինակ","Սցենար"],"scenarioOutline":["Սցենարի կառուցվացքը"],"then":["* ","Ապա "],"when":["* ","Եթե ","Երբ "]},"an":{"and":["* ","Y ","E "],"background":["Antecedents"],"but":["* ","Pero "],"examples":["Eixemplos"],"feature":["Caracteristica"],"given":["* ","Dau ","Dada ","Daus ","Dadas "],"name":"Aragonese","native":"Aragonés","rule":["Rule"],"scenario":["Eixemplo","Caso"],"scenarioOutline":["Esquema del caso"],"then":["* ","Alavez ","Allora ","Antonces "],"when":["* ","Cuan "]},"ar":{"and":["* ","و "],"background":["الخلفية"],"but":["* ","لكن "],"examples":["امثلة"],"feature":["خاصية"],"given":["* ","بفرض "],"name":"Arabic","native":"العربية","rule":["Rule"],"scenario":["مثال","سيناريو"],"scenarioOutline":["سيناريو مخطط"],"then":["* ","اذاً ","ثم "],"when":["* ","متى ","عندما "]},"ast":{"and":["* ","Y ","Ya "],"background":["Antecedentes"],"but":["* ","Peru "],"examples":["Exemplos"],"feature":["Carauterística"],"given":["* ","Dáu ","Dada ","Daos ","Daes "],"name":"Asturian","native":"asturianu","rule":["Rule"],"scenario":["Exemplo","Casu"],"scenarioOutline":["Esbozu del casu"],"then":["* ","Entós "],"when":["* ","Cuando "]},"az":{"and":["* ","Və ","Həm "],"background":["Keçmiş","Kontekst"],"but":["* ","Amma ","Ancaq "],"examples":["Nümunələr"],"feature":["Özəllik"],"given":["* ","Tutaq ki ","Verilir "],"name":"Azerbaijani","native":"Azərbaycanca","rule":["Rule"],"scenario":["Nümunə","Ssenari"],"scenarioOutline":["Ssenarinin strukturu"],"then":["* ","O halda "],"when":["* ","Əgər ","Nə vaxt ki "]},"be":{"and":["* ","I ","Ды ","Таксама "],"background":["Кантэкст"],"but":["* ","Але ","Інакш "],"examples":["Прыклады"],"feature":["Функцыянальнасць","Фіча"],"given":["* ","Няхай ","Дадзена "],"name":"Belarusian","native":"Беларуская","rule":["Правілы"],"scenario":["Сцэнарый","Cцэнар"],"scenarioOutline":["Шаблон сцэнарыя","Узор сцэнара"],"then":["* ","Тады "],"when":["* ","Калі "]},"bg":{"and":["* ","И "],"background":["Предистория"],"but":["* ","Но "],"examples":["Примери"],"feature":["Функционалност"],"given":["* ","Дадено "],"name":"Bulgarian","native":"български","rule":["Правило"],"scenario":["Пример","Сценарий"],"scenarioOutline":["Рамка на сценарий"],"then":["* ","То "],"when":["* ","Когато "]},"bm":{"and":["* ","Dan "],"background":["Latar Belakang"],"but":["* ","Tetapi ","Tapi "],"examples":["Contoh"],"feature":["Fungsi"],"given":["* ","Diberi ","Bagi "],"name":"Malay","native":"Bahasa Melayu","rule":["Rule"],"scenario":["Senario","Situasi","Keadaan"],"scenarioOutline":["Kerangka Senario","Kerangka Situasi","Kerangka Keadaan","Garis Panduan Senario"],"then":["* ","Maka ","Kemudian "],"when":["* ","Apabila "]},"bs":{"and":["* ","I ","A "],"background":["Pozadina"],"but":["* ","Ali "],"examples":["Primjeri"],"feature":["Karakteristika"],"given":["* ","Dato "],"name":"Bosnian","native":"Bosanski","rule":["Rule"],"scenario":["Primjer","Scenariju","Scenario"],"scenarioOutline":["Scenariju-obris","Scenario-outline"],"then":["* ","Zatim "],"when":["* ","Kada "]},"ca":{"and":["* ","I "],"background":["Rerefons","Antecedents"],"but":["* ","Però "],"examples":["Exemples"],"feature":["Característica","Funcionalitat"],"given":["* ","Donat ","Donada ","Atès ","Atesa "],"name":"Catalan","native":"català","rule":["Rule"],"scenario":["Exemple","Escenari"],"scenarioOutline":["Esquema de l\'escenari"],"then":["* ","Aleshores ","Cal "],"when":["* ","Quan "]},"cs":{"and":["* ","A také ","A "],"background":["Pozadí","Kontext"],"but":["* ","Ale "],"examples":["Příklady"],"feature":["Požadavek"],"given":["* ","Pokud ","Za předpokladu "],"name":"Czech","native":"Česky","rule":["Pravidlo"],"scenario":["Příklad","Scénář"],"scenarioOutline":["Náčrt Scénáře","Osnova scénáře"],"then":["* ","Pak "],"when":["* ","Když "]},"cy-GB":{"and":["* ","A "],"background":["Cefndir"],"but":["* ","Ond "],"examples":["Enghreifftiau"],"feature":["Arwedd"],"given":["* ","Anrhegedig a "],"name":"Welsh","native":"Cymraeg","rule":["Rule"],"scenario":["Enghraifft","Scenario"],"scenarioOutline":["Scenario Amlinellol"],"then":["* ","Yna "],"when":["* ","Pryd "]},"da":{"and":["* ","Og "],"background":["Baggrund"],"but":["* ","Men "],"examples":["Eksempler"],"feature":["Egenskab"],"given":["* ","Givet "],"name":"Danish","native":"dansk","rule":["Regel"],"scenario":["Eksempel","Scenarie"],"scenarioOutline":["Abstrakt Scenario"],"then":["* ","Så "],"when":["* ","Når "]},"de":{"and":["* ","Und "],"background":["Grundlage","Hintergrund","Voraussetzungen","Vorbedingungen"],"but":["* ","Aber "],"examples":["Beispiele"],"feature":["Funktionalität","Funktion"],"given":["* ","Angenommen ","Gegeben sei ","Gegeben seien "],"name":"German","native":"Deutsch","rule":["Rule","Regel"],"scenario":["Beispiel","Szenario"],"scenarioOutline":["Szenariogrundriss","Szenarien"],"then":["* ","Dann "],"when":["* ","Wenn "]},"el":{"and":["* ","Και "],"background":["Υπόβαθρο"],"but":["* ","Αλλά "],"examples":["Παραδείγματα","Σενάρια"],"feature":["Δυνατότητα","Λειτουργία"],"given":["* ","Δεδομένου "],"name":"Greek","native":"Ελληνικά","rule":["Rule"],"scenario":["Παράδειγμα","Σενάριο"],"scenarioOutline":["Περιγραφή Σεναρίου","Περίγραμμα Σεναρίου"],"then":["* ","Τότε "],"when":["* ","Όταν "]},"em":{"and":["* ","😂"],"background":["💤"],"but":["* ","😔"],"examples":["📓"],"feature":["📚"],"given":["* ","😐"],"name":"Emoji","native":"😀","rule":["Rule"],"scenario":["🥒","📕"],"scenarioOutline":["📖"],"then":["* ","🙏"],"when":["* ","🎬"]},"en":{"and":["* ","And "],"background":["Background"],"but":["* ","But "],"examples":["Examples","Scenarios"],"feature":["Feature","Business Need","Ability"],"given":["* ","Given "],"name":"English","native":"English","rule":["Rule"],"scenario":["Example","Scenario"],"scenarioOutline":["Scenario Outline","Scenario Template"],"then":["* ","Then "],"when":["* ","When "]},"en-Scouse":{"and":["* ","An "],"background":["Dis is what went down"],"but":["* ","Buh "],"examples":["Examples"],"feature":["Feature"],"given":["* ","Givun ","Youse know when youse got "],"name":"Scouse","native":"Scouse","rule":["Rule"],"scenario":["The thing of it is"],"scenarioOutline":["Wharrimean is"],"then":["* ","Dun ","Den youse gotta "],"when":["* ","Wun ","Youse know like when "]},"en-au":{"and":["* ","Too right "],"background":["First off"],"but":["* ","Yeah nah "],"examples":["You\'ll wanna"],"feature":["Pretty much"],"given":["* ","Y\'know "],"name":"Australian","native":"Australian","rule":["Rule"],"scenario":["Awww, look mate"],"scenarioOutline":["Reckon it\'s like"],"then":["* ","But at the end of the day I reckon "],"when":["* ","It\'s just unbelievable "]},"en-lol":{"and":["* ","AN "],"background":["B4"],"but":["* ","BUT "],"examples":["EXAMPLZ"],"feature":["OH HAI"],"given":["* ","I CAN HAZ "],"name":"LOLCAT","native":"LOLCAT","rule":["Rule"],"scenario":["MISHUN"],"scenarioOutline":["MISHUN SRSLY"],"then":["* ","DEN "],"when":["* ","WEN "]},"en-old":{"and":["* ","Ond ","7 "],"background":["Aer","Ær"],"but":["* ","Ac "],"examples":["Se the","Se þe","Se ðe"],"feature":["Hwaet","Hwæt"],"given":["* ","Thurh ","Þurh ","Ðurh "],"name":"Old English","native":"Englisc","rule":["Rule"],"scenario":["Swa"],"scenarioOutline":["Swa hwaer swa","Swa hwær swa"],"then":["* ","Tha ","Þa ","Ða ","Tha the ","Þa þe ","Ða ðe "],"when":["* ","Bæþsealf ","Bæþsealfa ","Bæþsealfe ","Ciricæw ","Ciricæwe ","Ciricæwa "]},"en-pirate":{"and":["* ","Aye "],"background":["Yo-ho-ho"],"but":["* ","Avast! "],"examples":["Dead men tell no tales"],"feature":["Ahoy matey!"],"given":["* ","Gangway! "],"name":"Pirate","native":"Pirate","rule":["Rule"],"scenario":["Heave to"],"scenarioOutline":["Shiver me timbers"],"then":["* ","Let go and haul "],"when":["* ","Blimey! "]},"en-tx":{"and":["Come hell or high water "],"background":["Lemme tell y\'all a story"],"but":["Well now hold on, I\'ll you what "],"examples":["Now that\'s a story longer than a cattle drive in July"],"feature":["This ain’t my first rodeo","All gussied up"],"given":["Fixin\' to ","All git out "],"name":"Texas","native":"Texas","rule":["Rule "],"scenario":["All hat and no cattle"],"scenarioOutline":["Serious as a snake bite","Busy as a hound in flea season"],"then":["There’s no tree but bears some fruit "],"when":["Quick out of the chute "]},"eo":{"and":["* ","Kaj "],"background":["Fono"],"but":["* ","Sed "],"examples":["Ekzemploj"],"feature":["Trajto"],"given":["* ","Donitaĵo ","Komence "],"name":"Esperanto","native":"Esperanto","rule":["Regulo"],"scenario":["Ekzemplo","Scenaro","Kazo"],"scenarioOutline":["Konturo de la scenaro","Skizo","Kazo-skizo"],"then":["* ","Do "],"when":["* ","Se "]},"es":{"and":["* ","Y ","E "],"background":["Antecedentes"],"but":["* ","Pero "],"examples":["Ejemplos"],"feature":["Característica","Necesidad del negocio","Requisito"],"given":["* ","Dado ","Dada ","Dados ","Dadas "],"name":"Spanish","native":"español","rule":["Regla","Regla de negocio"],"scenario":["Ejemplo","Escenario"],"scenarioOutline":["Esquema del escenario"],"then":["* ","Entonces "],"when":["* ","Cuando "]},"et":{"and":["* ","Ja "],"background":["Taust"],"but":["* ","Kuid "],"examples":["Juhtumid"],"feature":["Omadus"],"given":["* ","Eeldades "],"name":"Estonian","native":"eesti keel","rule":["Reegel"],"scenario":["Juhtum","Stsenaarium"],"scenarioOutline":["Raamjuhtum","Raamstsenaarium"],"then":["* ","Siis "],"when":["* ","Kui "]},"fa":{"and":["* ","و "],"background":["زمینه"],"but":["* ","اما "],"examples":["نمونه ها"],"feature":["وِیژگی"],"given":["* ","با فرض "],"name":"Persian","native":"فارسی","rule":["Rule"],"scenario":["مثال","سناریو"],"scenarioOutline":["الگوی سناریو"],"then":["* ","آنگاه "],"when":["* ","هنگامی "]},"fi":{"and":["* ","Ja "],"background":["Tausta"],"but":["* ","Mutta "],"examples":["Tapaukset"],"feature":["Ominaisuus"],"given":["* ","Oletetaan "],"name":"Finnish","native":"suomi","rule":["Rule"],"scenario":["Tapaus"],"scenarioOutline":["Tapausaihio"],"then":["* ","Niin "],"when":["* ","Kun "]},"fr":{"and":["* ","Et que ","Et qu\'","Et "],"background":["Contexte"],"but":["* ","Mais que ","Mais qu\'","Mais "],"examples":["Exemples"],"feature":["Fonctionnalité"],"given":["* ","Soit ","Sachant que ","Sachant qu\'","Sachant ","Etant donné que ","Etant donné qu\'","Etant donné ","Etant donnée ","Etant donnés ","Etant données ","Étant donné que ","Étant donné qu\'","Étant donné ","Étant donnée ","Étant donnés ","Étant données "],"name":"French","native":"français","rule":["Règle"],"scenario":["Exemple","Scénario"],"scenarioOutline":["Plan du scénario","Plan du Scénario"],"then":["* ","Alors ","Donc "],"when":["* ","Quand ","Lorsque ","Lorsqu\'"]},"ga":{"and":["* ","Agus "],"background":["Cúlra"],"but":["* ","Ach "],"examples":["Samplaí"],"feature":["Gné"],"given":["* ","Cuir i gcás go ","Cuir i gcás nach ","Cuir i gcás gur ","Cuir i gcás nár "],"name":"Irish","native":"Gaeilge","rule":["Riail"],"scenario":["Sampla","Cás"],"scenarioOutline":["Cás Achomair"],"then":["* ","Ansin "],"when":["* ","Nuair a ","Nuair nach ","Nuair ba ","Nuair nár "]},"gj":{"and":["* ","અને "],"background":["બેકગ્રાઉન્ડ"],"but":["* ","પણ "],"examples":["ઉદાહરણો"],"feature":["લક્ષણ","વ્યાપાર જરૂર","ક્ષમતા"],"given":["* ","આપેલ છે "],"name":"Gujarati","native":"ગુજરાતી","rule":["નિયમ"],"scenario":["ઉદાહરણ","સ્થિતિ"],"scenarioOutline":["પરિદ્દશ્ય રૂપરેખા","પરિદ્દશ્ય ઢાંચો"],"then":["* ","પછી "],"when":["* ","ક્યારે "]},"gl":{"and":["* ","E "],"background":["Contexto"],"but":["* ","Mais ","Pero "],"examples":["Exemplos"],"feature":["Característica"],"given":["* ","Dado ","Dada ","Dados ","Dadas "],"name":"Galician","native":"galego","rule":["Rule"],"scenario":["Exemplo","Escenario"],"scenarioOutline":["Esbozo do escenario"],"then":["* ","Entón ","Logo "],"when":["* ","Cando "]},"he":{"and":["* ","וגם "],"background":["רקע"],"but":["* ","אבל "],"examples":["דוגמאות"],"feature":["תכונה"],"given":["* ","בהינתן "],"name":"Hebrew","native":"עברית","rule":["כלל"],"scenario":["דוגמא","תרחיש"],"scenarioOutline":["תבנית תרחיש"],"then":["* ","אז ","אזי "],"when":["* ","כאשר "]},"hi":{"and":["* ","और ","तथा "],"background":["पृष्ठभूमि"],"but":["* ","पर ","परन्तु ","किन्तु "],"examples":["उदाहरण"],"feature":["रूप लेख"],"given":["* ","अगर ","यदि ","चूंकि "],"name":"Hindi","native":"हिंदी","rule":["नियम"],"scenario":["परिदृश्य"],"scenarioOutline":["परिदृश्य रूपरेखा"],"then":["* ","तब ","तदा "],"when":["* ","जब ","कदा "]},"hr":{"and":["* ","I "],"background":["Pozadina"],"but":["* ","Ali "],"examples":["Primjeri","Scenariji"],"feature":["Osobina","Mogućnost","Mogucnost"],"given":["* ","Zadan ","Zadani ","Zadano ","Ukoliko "],"name":"Croatian","native":"hrvatski","rule":["Rule"],"scenario":["Primjer","Scenarij"],"scenarioOutline":["Skica","Koncept"],"then":["* ","Onda "],"when":["* ","Kada ","Kad "]},"ht":{"and":["* ","Ak ","Epi ","E "],"background":["Kontèks","Istorik"],"but":["* ","Men "],"examples":["Egzanp"],"feature":["Karakteristik","Mak","Fonksyonalite"],"given":["* ","Sipoze ","Sipoze ke ","Sipoze Ke "],"name":"Creole","native":"kreyòl","rule":["Rule"],"scenario":["Senaryo"],"scenarioOutline":["Plan senaryo","Plan Senaryo","Senaryo deskripsyon","Senaryo Deskripsyon","Dyagram senaryo","Dyagram Senaryo"],"then":["* ","Lè sa a ","Le sa a "],"when":["* ","Lè ","Le "]},"hu":{"and":["* ","És "],"background":["Háttér"],"but":["* ","De "],"examples":["Példák"],"feature":["Jellemző"],"given":["* ","Amennyiben ","Adott "],"name":"Hungarian","native":"magyar","rule":["Szabály"],"scenario":["Példa","Forgatókönyv"],"scenarioOutline":["Forgatókönyv vázlat"],"then":["* ","Akkor "],"when":["* ","Majd ","Ha ","Amikor "]},"id":{"and":["* ","Dan "],"background":["Dasar","Latar Belakang"],"but":["* ","Tapi ","Tetapi "],"examples":["Contoh","Misal"],"feature":["Fitur"],"given":["* ","Dengan ","Diketahui ","Diasumsikan ","Bila ","Jika "],"name":"Indonesian","native":"Bahasa Indonesia","rule":["Rule","Aturan"],"scenario":["Skenario"],"scenarioOutline":["Skenario konsep","Garis-Besar Skenario"],"then":["* ","Maka ","Kemudian "],"when":["* ","Ketika "]},"is":{"and":["* ","Og "],"background":["Bakgrunnur"],"but":["* ","En "],"examples":["Dæmi","Atburðarásir"],"feature":["Eiginleiki"],"given":["* ","Ef "],"name":"Icelandic","native":"Íslenska","rule":["Rule"],"scenario":["Atburðarás"],"scenarioOutline":["Lýsing Atburðarásar","Lýsing Dæma"],"then":["* ","Þá "],"when":["* ","Þegar "]},"it":{"and":["* ","E ","Ed "],"background":["Contesto"],"but":["* ","Ma "],"examples":["Esempi"],"feature":["Funzionalità","Esigenza di Business","Abilità"],"given":["* ","Dato ","Data ","Dati ","Date "],"name":"Italian","native":"italiano","rule":["Regola"],"scenario":["Esempio","Scenario"],"scenarioOutline":["Schema dello scenario"],"then":["* ","Allora "],"when":["* ","Quando "]},"ja":{"and":["* ","且つ","かつ"],"background":["背景"],"but":["* ","然し","しかし","但し","ただし"],"examples":["例","サンプル"],"feature":["フィーチャ","機能"],"given":["* ","前提"],"name":"Japanese","native":"日本語","rule":["ルール"],"scenario":["シナリオ"],"scenarioOutline":["シナリオアウトライン","シナリオテンプレート","テンプレ","シナリオテンプレ"],"then":["* ","ならば"],"when":["* ","もし"]},"jv":{"and":["* ","Lan "],"background":["Dasar"],"but":["* ","Tapi ","Nanging ","Ananging "],"examples":["Conto","Contone"],"feature":["Fitur"],"given":["* ","Nalika ","Nalikaning "],"name":"Javanese","native":"Basa Jawa","rule":["Rule"],"scenario":["Skenario"],"scenarioOutline":["Konsep skenario"],"then":["* ","Njuk ","Banjur "],"when":["* ","Manawa ","Menawa "]},"ka":{"and":["* ","და ","ასევე "],"background":["კონტექსტი"],"but":["* ","მაგრამ ","თუმცა "],"examples":["მაგალითები"],"feature":["თვისება","მოთხოვნა"],"given":["* ","მოცემული ","მოცემულია ","ვთქვათ "],"name":"Georgian","native":"ქართული","rule":["წესი"],"scenario":["მაგალითად","მაგალითი","მაგ","სცენარი"],"scenarioOutline":["სცენარის ნიმუში","სცენარის შაბლონი","ნიმუში","შაბლონი"],"then":["* ","მაშინ "],"when":["* ","როდესაც ","როცა ","როგორც კი ","თუ "]},"kn":{"and":["* ","ಮತ್ತು "],"background":["ಹಿನ್ನೆಲೆ"],"but":["* ","ಆದರೆ "],"examples":["ಉದಾಹರಣೆಗಳು"],"feature":["ಹೆಚ್ಚಳ"],"given":["* ","ನೀಡಿದ "],"name":"Kannada","native":"ಕನ್ನಡ","rule":["Rule"],"scenario":["ಉದಾಹರಣೆ","ಕಥಾಸಾರಾಂಶ"],"scenarioOutline":["ವಿವರಣೆ"],"then":["* ","ನಂತರ "],"when":["* ","ಸ್ಥಿತಿಯನ್ನು "]},"ko":{"and":["* ","그리고 "],"background":["배경"],"but":["* ","하지만 ","단 "],"examples":["예"],"feature":["기능"],"given":["* ","조건 ","먼저 "],"name":"Korean","native":"한국어","rule":["규칙"],"scenario":["시나리오"],"scenarioOutline":["시나리오 개요"],"then":["* ","그러면 "],"when":["* ","만일 ","만약 "]},"lt":{"and":["* ","Ir "],"background":["Kontekstas"],"but":["* ","Bet "],"examples":["Pavyzdžiai","Scenarijai","Variantai"],"feature":["Savybė"],"given":["* ","Duota "],"name":"Lithuanian","native":"lietuvių kalba","rule":["Rule"],"scenario":["Pavyzdys","Scenarijus"],"scenarioOutline":["Scenarijaus šablonas"],"then":["* ","Tada "],"when":["* ","Kai "]},"lu":{"and":["* ","an ","a "],"background":["Hannergrond"],"but":["* ","awer ","mä "],"examples":["Beispiller"],"feature":["Funktionalitéit"],"given":["* ","ugeholl "],"name":"Luxemburgish","native":"Lëtzebuergesch","rule":["Rule"],"scenario":["Beispill","Szenario"],"scenarioOutline":["Plang vum Szenario"],"then":["* ","dann "],"when":["* ","wann "]},"lv":{"and":["* ","Un "],"background":["Konteksts","Situācija"],"but":["* ","Bet "],"examples":["Piemēri","Paraugs"],"feature":["Funkcionalitāte","Fīča"],"given":["* ","Kad "],"name":"Latvian","native":"latviešu","rule":["Rule"],"scenario":["Piemērs","Scenārijs"],"scenarioOutline":["Scenārijs pēc parauga"],"then":["* ","Tad "],"when":["* ","Ja "]},"mk-Cyrl":{"and":["* ","И "],"background":["Контекст","Содржина"],"but":["* ","Но "],"examples":["Примери","Сценарија"],"feature":["Функционалност","Бизнис потреба","Можност"],"given":["* ","Дадено ","Дадена "],"name":"Macedonian","native":"Македонски","rule":["Rule"],"scenario":["Пример","Сценарио","На пример"],"scenarioOutline":["Преглед на сценарија","Скица","Концепт"],"then":["* ","Тогаш "],"when":["* ","Кога "]},"mk-Latn":{"and":["* ","I "],"background":["Kontekst","Sodrzhina"],"but":["* ","No "],"examples":["Primeri","Scenaria"],"feature":["Funkcionalnost","Biznis potreba","Mozhnost"],"given":["* ","Dadeno ","Dadena "],"name":"Macedonian (Latin)","native":"Makedonski (Latinica)","rule":["Rule"],"scenario":["Scenario","Na primer"],"scenarioOutline":["Pregled na scenarija","Skica","Koncept"],"then":["* ","Togash "],"when":["* ","Koga "]},"mn":{"and":["* ","Мөн ","Тэгээд "],"background":["Агуулга"],"but":["* ","Гэхдээ ","Харин "],"examples":["Тухайлбал"],"feature":["Функц","Функционал"],"given":["* ","Өгөгдсөн нь ","Анх "],"name":"Mongolian","native":"монгол","rule":["Rule"],"scenario":["Сценар"],"scenarioOutline":["Сценарын төлөвлөгөө"],"then":["* ","Тэгэхэд ","Үүний дараа "],"when":["* ","Хэрэв "]},"ne":{"and":["* ","र ","अनि "],"background":["पृष्ठभूमी"],"but":["* ","तर "],"examples":["उदाहरण","उदाहरणहरु"],"feature":["सुविधा","विशेषता"],"given":["* ","दिइएको ","दिएको ","यदि "],"name":"Nepali","native":"नेपाली","rule":["नियम"],"scenario":["परिदृश्य"],"scenarioOutline":["परिदृश्य रूपरेखा"],"then":["* ","त्यसपछि ","अनी "],"when":["* ","जब "]},"nl":{"and":["* ","En "],"background":["Achtergrond"],"but":["* ","Maar "],"examples":["Voorbeelden"],"feature":["Functionaliteit"],"given":["* ","Gegeven ","Stel "],"name":"Dutch","native":"Nederlands","rule":["Regel"],"scenario":["Voorbeeld","Scenario"],"scenarioOutline":["Abstract Scenario"],"then":["* ","Dan "],"when":["* ","Als ","Wanneer "]},"no":{"and":["* ","Og "],"background":["Bakgrunn"],"but":["* ","Men "],"examples":["Eksempler"],"feature":["Egenskap"],"given":["* ","Gitt "],"name":"Norwegian","native":"norsk","rule":["Regel"],"scenario":["Eksempel","Scenario"],"scenarioOutline":["Scenariomal","Abstrakt Scenario"],"then":["* ","Så "],"when":["* ","Når "]},"pa":{"and":["* ","ਅਤੇ "],"background":["ਪਿਛੋਕੜ"],"but":["* ","ਪਰ "],"examples":["ਉਦਾਹਰਨਾਂ"],"feature":["ਖਾਸੀਅਤ","ਮੁਹਾਂਦਰਾ","ਨਕਸ਼ ਨੁਹਾਰ"],"given":["* ","ਜੇਕਰ ","ਜਿਵੇਂ ਕਿ "],"name":"Panjabi","native":"ਪੰਜਾਬੀ","rule":["Rule"],"scenario":["ਉਦਾਹਰਨ","ਪਟਕਥਾ"],"scenarioOutline":["ਪਟਕਥਾ ਢਾਂਚਾ","ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ"],"then":["* ","ਤਦ "],"when":["* ","ਜਦੋਂ "]},"pl":{"and":["* ","Oraz ","I "],"background":["Założenia"],"but":["* ","Ale "],"examples":["Przykłady"],"feature":["Właściwość","Funkcja","Aspekt","Potrzeba biznesowa"],"given":["* ","Zakładając ","Mając ","Zakładając, że "],"name":"Polish","native":"polski","rule":["Zasada","Reguła"],"scenario":["Przykład","Scenariusz"],"scenarioOutline":["Szablon scenariusza"],"then":["* ","Wtedy "],"when":["* ","Jeżeli ","Jeśli ","Gdy ","Kiedy "]},"pt":{"and":["* ","E "],"background":["Contexto","Cenário de Fundo","Cenario de Fundo","Fundo"],"but":["* ","Mas "],"examples":["Exemplos","Cenários","Cenarios"],"feature":["Funcionalidade","Característica","Caracteristica"],"given":["* ","Dado ","Dada ","Dados ","Dadas "],"name":"Portuguese","native":"português","rule":["Regra"],"scenario":["Exemplo","Cenário","Cenario"],"scenarioOutline":["Esquema do Cenário","Esquema do Cenario","Delineação do Cenário","Delineacao do Cenario"],"then":["* ","Então ","Entao "],"when":["* ","Quando "]},"ro":{"and":["* ","Si ","Și ","Şi "],"background":["Context"],"but":["* ","Dar "],"examples":["Exemple"],"feature":["Functionalitate","Funcționalitate","Funcţionalitate"],"given":["* ","Date fiind ","Dat fiind ","Dată fiind","Dati fiind ","Dați fiind ","Daţi fiind "],"name":"Romanian","native":"română","rule":["Rule"],"scenario":["Exemplu","Scenariu"],"scenarioOutline":["Structura scenariu","Structură scenariu"],"then":["* ","Atunci "],"when":["* ","Cand ","Când "]},"ru":{"and":["* ","И ","К тому же ","Также "],"background":["Предыстория","Контекст"],"but":["* ","Но ","А ","Иначе "],"examples":["Примеры","Значения"],"feature":["Функция","Функциональность","Функционал","Свойство","Фича"],"given":["* ","Допустим ","Дано ","Пусть "],"name":"Russian","native":"русский","rule":["Правило"],"scenario":["Пример","Сценарий"],"scenarioOutline":["Структура сценария","Шаблон сценария"],"then":["* ","То ","Затем ","Тогда "],"when":["* ","Когда ","Если "]},"sk":{"and":["* ","A ","A tiež ","A taktiež ","A zároveň "],"background":["Pozadie"],"but":["* ","Ale "],"examples":["Príklady"],"feature":["Požiadavka","Funkcia","Vlastnosť"],"given":["* ","Pokiaľ ","Za predpokladu "],"name":"Slovak","native":"Slovensky","rule":["Rule"],"scenario":["Príklad","Scenár"],"scenarioOutline":["Náčrt Scenáru","Náčrt Scenára","Osnova Scenára"],"then":["* ","Tak ","Potom "],"when":["* ","Keď ","Ak "]},"sl":{"and":["In ","Ter "],"background":["Kontekst","Osnova","Ozadje"],"but":["Toda ","Ampak ","Vendar "],"examples":["Primeri","Scenariji"],"feature":["Funkcionalnost","Funkcija","Možnosti","Moznosti","Lastnost","Značilnost"],"given":["Dano ","Podano ","Zaradi ","Privzeto "],"name":"Slovenian","native":"Slovenski","rule":["Rule"],"scenario":["Primer","Scenarij"],"scenarioOutline":["Struktura scenarija","Skica","Koncept","Oris scenarija","Osnutek"],"then":["Nato ","Potem ","Takrat "],"when":["Ko ","Ce ","Če ","Kadar "]},"sr-Cyrl":{"and":["* ","И "],"background":["Контекст","Основа","Позадина"],"but":["* ","Али "],"examples":["Примери","Сценарији"],"feature":["Функционалност","Могућност","Особина"],"given":["* ","За дато ","За дате ","За дати "],"name":"Serbian","native":"Српски","rule":["Правило"],"scenario":["Сценарио","Пример"],"scenarioOutline":["Структура сценарија","Скица","Концепт"],"then":["* ","Онда "],"when":["* ","Када ","Кад "]},"sr-Latn":{"and":["* ","I "],"background":["Kontekst","Osnova","Pozadina"],"but":["* ","Ali "],"examples":["Primeri","Scenariji"],"feature":["Funkcionalnost","Mogućnost","Mogucnost","Osobina"],"given":["* ","Za dato ","Za date ","Za dati "],"name":"Serbian (Latin)","native":"Srpski (Latinica)","rule":["Pravilo"],"scenario":["Scenario","Primer"],"scenarioOutline":["Struktura scenarija","Skica","Koncept"],"then":["* ","Onda "],"when":["* ","Kada ","Kad "]},"sv":{"and":["* ","Och "],"background":["Bakgrund"],"but":["* ","Men "],"examples":["Exempel"],"feature":["Egenskap"],"given":["* ","Givet "],"name":"Swedish","native":"Svenska","rule":["Regel"],"scenario":["Scenario"],"scenarioOutline":["Abstrakt Scenario","Scenariomall"],"then":["* ","Så "],"when":["* ","När "]},"ta":{"and":["* ","மேலும் ","மற்றும் "],"background":["பின்னணி"],"but":["* ","ஆனால் "],"examples":["எடுத்துக்காட்டுகள்","காட்சிகள்","நிலைமைகளில்"],"feature":["அம்சம்","வணிக தேவை","திறன்"],"given":["* ","கொடுக்கப்பட்ட "],"name":"Tamil","native":"தமிழ்","rule":["Rule"],"scenario":["உதாரணமாக","காட்சி"],"scenarioOutline":["காட்சி சுருக்கம்","காட்சி வார்ப்புரு"],"then":["* ","அப்பொழுது "],"when":["* ","எப்போது "]},"th":{"and":["* ","และ "],"background":["แนวคิด"],"but":["* ","แต่ "],"examples":["ชุดของตัวอย่าง","ชุดของเหตุการณ์"],"feature":["โครงหลัก","ความต้องการทางธุรกิจ","ความสามารถ"],"given":["* ","กำหนดให้ "],"name":"Thai","native":"ไทย","rule":["Rule"],"scenario":["เหตุการณ์"],"scenarioOutline":["สรุปเหตุการณ์","โครงสร้างของเหตุการณ์"],"then":["* ","ดังนั้น "],"when":["* ","เมื่อ "]},"te":{"and":["* ","మరియు "],"background":["నేపథ్యం"],"but":["* ","కాని "],"examples":["ఉదాహరణలు"],"feature":["గుణము"],"given":["* ","చెప్పబడినది "],"name":"Telugu","native":"తెలుగు","rule":["Rule"],"scenario":["ఉదాహరణ","సన్నివేశం"],"scenarioOutline":["కథనం"],"then":["* ","అప్పుడు "],"when":["* ","ఈ పరిస్థితిలో "]},"tlh":{"and":["* ","\'ej ","latlh "],"background":["mo\'"],"but":["* ","\'ach ","\'a "],"examples":["ghantoH","lutmey"],"feature":["Qap","Qu\'meH \'ut","perbogh","poQbogh malja\'","laH"],"given":["* ","ghu\' noblu\' ","DaH ghu\' bejlu\' "],"name":"Klingon","native":"tlhIngan","rule":["Rule"],"scenario":["lut"],"scenarioOutline":["lut chovnatlh"],"then":["* ","vaj "],"when":["* ","qaSDI\' "]},"tr":{"and":["* ","Ve ","Hem de ","Bir de ","Ayrıca ","İlaveten ","Buna ek olarak "],"background":["Geçmiş","Arka Plan","Ön Koşul","Önkoşul","Önceki Durum","Giriş","Mukaddime","Mevcut Durum"],"but":["* ","Fakat ","Ama ","Ancak ","Yalnız ","Lakin ","Meğer ki ","Buna mukabil ","Aksi halde "],"examples":["Örnekler","Değerler"],"feature":["Özellik","İş Gereksinimi","Gereksinim","İşlev","Kullanıcı Hikayesi","Yetenek","Teknik Gereksinim"],"given":["* ","Mevcut ","Önceden ","Geçmişte ","Daha önce ","Halihazırda ","Zaten ","Sistemde ","Diyelim ki ","Varsayalım ki ","Farz edelim ki ","Kabul edelim ki ","Başlangıçta ","Varsayılan olarak ","Biliniyor ki "],"name":"Turkish","native":"Türkçe","rule":["Kural","İş Kuralı","Kaide","Hüküm","Madde"],"scenario":["Örnek","Senaryo","Durum","Vaka"],"scenarioOutline":["Senaryo taslağı","Senaryo şablonu"],"then":["* ","Beklenen ","O zaman ","Sonuç olarak ","Böylece ","Bunun üzerine ","Bu durumda ","O takdirde ","Şu halde ","Netice itibariyle ","Buna binaen "],"when":["* ","Eğer ","Eğer ki ","Ne zaman ","Ne zaman ki ","Şayet "]},"tt":{"and":["* ","Һәм ","Вә "],"background":["Кереш"],"but":["* ","Ләкин ","Әмма "],"examples":["Үрнәкләр","Мисаллар"],"feature":["Мөмкинлек","Үзенчәлеклелек"],"given":["* ","Әйтик "],"name":"Tatar","native":"Татарча","rule":["Rule"],"scenario":["Сценарий"],"scenarioOutline":["Сценарийның төзелеше"],"then":["* ","Нәтиҗәдә "],"when":["* ","Әгәр "]},"uk":{"and":["* ","І ","А також ","Та "],"background":["Передумова"],"but":["* ","Але "],"examples":["Приклади"],"feature":["Функціонал"],"given":["* ","Припустимо ","Припустимо, що ","Нехай ","Дано "],"name":"Ukrainian","native":"Українська","rule":["Rule"],"scenario":["Приклад","Сценарій"],"scenarioOutline":["Структура сценарію"],"then":["* ","То ","Тоді "],"when":["* ","Якщо ","Коли "]},"ur":{"and":["* ","اور "],"background":["پس منظر"],"but":["* ","لیکن "],"examples":["مثالیں"],"feature":["صلاحیت","کاروبار کی ضرورت","خصوصیت"],"given":["* ","اگر ","بالفرض ","فرض کیا "],"name":"Urdu","native":"اردو","rule":["Rule"],"scenario":["منظرنامہ"],"scenarioOutline":["منظر نامے کا خاکہ"],"then":["* ","پھر ","تب "],"when":["* ","جب "]},"uz":{"and":["* ","Ва "],"background":["Тарих"],"but":["* ","Лекин ","Бирок ","Аммо "],"examples":["Мисоллар"],"feature":["Функционал"],"given":["* ","Belgilangan "],"name":"Uzbek","native":"Узбекча","rule":["Rule"],"scenario":["Сценарий"],"scenarioOutline":["Сценарий структураси"],"then":["* ","Унда "],"when":["* ","Агар "]},"vi":{"and":["* ","Và "],"background":["Bối cảnh"],"but":["* ","Nhưng "],"examples":["Dữ liệu"],"feature":["Tính năng"],"given":["* ","Biết ","Cho "],"name":"Vietnamese","native":"Tiếng Việt","rule":["Quy tắc"],"scenario":["Tình huống","Kịch bản"],"scenarioOutline":["Khung tình huống","Khung kịch bản"],"then":["* ","Thì "],"when":["* ","Khi "]},"zh-CN":{"and":["* ","而且","并且","同时"],"background":["背景"],"but":["* ","但是"],"examples":["例子"],"feature":["功能"],"given":["* ","假如","假设","假定"],"name":"Chinese simplified","native":"简体中文","rule":["Rule","规则"],"scenario":["场景","剧本"],"scenarioOutline":["场景大纲","剧本大纲"],"then":["* ","那么"],"when":["* ","当"]},"ml":{"and":["* ","ഒപ്പം"],"background":["പശ്ചാത്തലം"],"but":["* ","പക്ഷേ"],"examples":["ഉദാഹരണങ്ങൾ"],"feature":["സവിശേഷത"],"given":["* ","നൽകിയത്"],"name":"Malayalam","native":"മലയാളം","rule":["നിയമം"],"scenario":["രംഗം"],"scenarioOutline":["സാഹചര്യത്തിന്റെ രൂപരേഖ"],"then":["* ","പിന്നെ"],"when":["എപ്പോൾ"]},"zh-TW":{"and":["* ","而且","並且","同時"],"background":["背景"],"but":["* ","但是"],"examples":["例子"],"feature":["功能"],"given":["* ","假如","假設","假定"],"name":"Chinese traditional","native":"繁體中文","rule":["Rule"],"scenario":["場景","劇本"],"scenarioOutline":["場景大綱","劇本大綱"],"then":["* ","那麼"],"when":["* ","當"]},"mr":{"and":["* ","आणि ","तसेच "],"background":["पार्श्वभूमी"],"but":["* ","पण ","परंतु "],"examples":["उदाहरण"],"feature":["वैशिष्ट्य","सुविधा"],"given":["* ","जर","दिलेल्या प्रमाणे "],"name":"Marathi","native":"मराठी","rule":["नियम"],"scenario":["परिदृश्य"],"scenarioOutline":["परिदृश्य रूपरेखा"],"then":["* ","मग ","तेव्हा "],"when":["* ","जेव्हा "]},"amh":{"and":["* ","እና "],"background":["ቅድመ ሁኔታ","መነሻ","መነሻ ሀሳብ"],"but":["* ","ግን "],"examples":["ምሳሌዎች","ሁናቴዎች"],"feature":["ስራ","የተፈለገው ስራ","የሚፈለገው ድርጊት"],"given":["* ","የተሰጠ "],"name":"Amharic","native":"አማርኛ","rule":["ህግ"],"scenario":["ምሳሌ","ሁናቴ"],"scenarioOutline":["ሁናቴ ዝርዝር","ሁናቴ አብነት"],"then":["* ","ከዚያ "],"when":["* ","መቼ "]}}')},8330:e=>{"use strict";e.exports=JSON.parse('{"name":"@fromeroc9/testform","version":"1.1.0-beta.3","description":"Declarative Test-as-Code orchestration engine for Git: zero mandatory SaaS servers, zero test drift, and immutable quality management.","author":"Flavio Romero <flavio.arc9@gmail.com>","main":"dist/index.js","license":"GPL-3.0-or-later","repository":{"type":"git","url":"git+https://github.com/fromeroc9/testform.git"},"keywords":["test-management","test-as-code","gherkin","bdd","behavior-driven development","github","testform"],"files":["dist","README.md","templates","assets"],"bin":{"testform":"dist/index.js"},"scripts":{"prebuild":"node -e \\"const fs = require(\'fs\'); if (fs.existsSync(\'dist\')) fs.rmSync(\'dist\', { recursive: true, force: true });\\"","test":"vitest run","typecheck":"tsc --noEmit","build":"ncc build src/index.ts -m -e @aws-sdk/client-s3 -e @aws-sdk/client-dynamodb -e @azure/storage-blob -e @google-cloud/storage -e docx -e exceljs -o dist","dev":"tsx src/index.ts","docs:dev":"npm --prefix ../testform-docs run dev","docs:build":"npm --prefix ../testform-docs run build","format":"prettier --write \\"src/**/*.ts\\" \\"test/**/*.ts\\"","prepublishOnly":"npm run build"},"devDependencies":{"@aws-sdk/client-dynamodb":"^3.1152.0","@aws-sdk/client-s3":"^3.1152.0","@azure/storage-blob":"^12.31.0","@google-cloud/storage":"7.19.0","@types/node":"^24.12.4","@vercel/ncc":"0.38.4","docx":"^9.14.0","exceljs":"^4.4.0","prettier":"^3.5.0","tsx":"4.19.3","typescript":"5.8.2","vitest":"^5.0.5"},"dependencies":{"@cucumber/gherkin":"39.1.0","@cucumber/messages":"30.1.0","cac":"^6.7.14","chalk":"4.1.2","gherkin-ast":"^3.4.2","gherkin-formatter":"^1.2.2","yaml":"^2.9.1"},"peerDependencies":{"@aws-sdk/client-dynamodb":">=3.0.0","@aws-sdk/client-s3":">=3.0.0","@azure/storage-blob":">=12.0.0","@google-cloud/storage":">=7.0.0","docx":">=9.0.0","exceljs":">=4.0.0"},"peerDependenciesMeta":{"@aws-sdk/client-dynamodb":{"optional":true},"@aws-sdk/client-s3":{"optional":true},"@azure/storage-blob":{"optional":true},"@google-cloud/storage":{"optional":true},"docx":{"optional":true},"exceljs":{"optional":true}},"overrides":{"undici":"^6.23.0","uuid":"^11.1.1"}}')}};var __webpack_module_cache__={};function __nccwpck_require__(e){var t=__webpack_module_cache__[e];if(t!==undefined){return t.exports}var n=__webpack_module_cache__[e]={id:e,loaded:false,exports:{}};var s=true;try{__webpack_modules__[e].call(n.exports,n,n.exports,__nccwpck_require__);s=false}finally{if(s)delete __webpack_module_cache__[e]}n.loaded=true;return n.exports}(()=>{__nccwpck_require__.d=(e,t)=>{for(var n in t){if(__nccwpck_require__.o(t,n)&&!__nccwpck_require__.o(e,n)){Object.defineProperty(e,n,{enumerable:true,get:t[n]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__=__nccwpck_require__(9407);module.exports=__webpack_exports__})();