@storybook/addon-vitest 0.0.0-pr-30601-sha-d70f67e1 → 0.0.0-pr-31819-sha-b1c88d51

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 (43) hide show
  1. package/dist/_browser-chunks/chunk-A47P2DCZ.js +11 -0
  2. package/dist/_browser-chunks/chunk-VMSW5DPM.js +60 -0
  3. package/dist/_node-chunks/chunk-C4NXJJA3.js +324 -0
  4. package/dist/_node-chunks/chunk-CIKGVIS6.js +223 -0
  5. package/dist/_node-chunks/chunk-FMQIQP6D.js +96 -0
  6. package/dist/_node-chunks/chunk-KVKHJ5OL.js +46 -0
  7. package/dist/_node-chunks/chunk-N3OFRDD3.js +80 -0
  8. package/dist/_node-chunks/chunk-VFT2PRGV.js +5002 -0
  9. package/dist/_node-chunks/chunk-W26ZMSD3.js +143 -0
  10. package/dist/_node-chunks/chunk-XWQZZ2C3.js +1586 -0
  11. package/dist/index.js +9 -6
  12. package/dist/manager.js +5571 -8
  13. package/dist/node/coverage-reporter.js +1395 -4
  14. package/dist/node/vitest.js +564 -17
  15. package/dist/postinstall.js +1179 -124
  16. package/dist/preset.js +268 -32
  17. package/dist/vitest-plugin/global-setup.js +146 -6
  18. package/dist/vitest-plugin/index.js +2589 -43
  19. package/dist/vitest-plugin/setup-file.js +28 -9
  20. package/dist/vitest-plugin/test-utils.js +68 -8
  21. package/package.json +20 -92
  22. package/static/coverage-reporter.cjs +10 -0
  23. package/templates/vitest.config.3.2.template.ts +30 -0
  24. package/dist/chunk-55WZLVGN.mjs +0 -11
  25. package/dist/chunk-JKRQGT2U.mjs +0 -10
  26. package/dist/index.mjs +0 -5
  27. package/dist/node/coverage-reporter.d.ts +0 -184
  28. package/dist/node/coverage-reporter.mjs +0 -12
  29. package/dist/node/vitest.d.ts +0 -2
  30. package/dist/node/vitest.mjs +0 -19
  31. package/dist/vitest-plugin/global-setup.d.ts +0 -6
  32. package/dist/vitest-plugin/global-setup.mjs +0 -13
  33. package/dist/vitest-plugin/index.mjs +0 -28
  34. package/dist/vitest-plugin/setup-file.d.ts +0 -14
  35. package/dist/vitest-plugin/setup-file.mjs +0 -9
  36. package/dist/vitest-plugin/test-utils.d.ts +0 -20
  37. package/dist/vitest-plugin/test-utils.mjs +0 -8
  38. package/manager.js +0 -1
  39. package/manager.mjs +0 -1
  40. package/postinstall.js +0 -1
  41. package/postinstall.mjs +0 -1
  42. package/preset.js +0 -1
  43. package/preset.mjs +0 -1
@@ -1,6 +1,1397 @@
1
- 'use strict';
1
+ import CJS_COMPAT_NODE_URL from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE from "node:module";
2
4
 
3
- var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __require=(x=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:(a,b)=>(typeof require<"u"?require:a)[b]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});var __commonJS=(cb,mod)=>function(){return mod||(0, cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));var require_debug=__commonJS({"../../node_modules/semver/internal/debug.js"(exports,module){var debug=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...args)=>console.error("SEMVER",...args):()=>{};module.exports=debug;}});var require_constants=__commonJS({"../../node_modules/semver/internal/constants.js"(exports,module){var SEMVER_SPEC_VERSION="2.0.0",MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH=16,MAX_SAFE_BUILD_LENGTH=250,RELEASE_TYPES=["major","premajor","minor","preminor","patch","prepatch","prerelease"];module.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH,MAX_SAFE_BUILD_LENGTH,MAX_SAFE_INTEGER,RELEASE_TYPES,SEMVER_SPEC_VERSION,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};}});var require_re=__commonJS({"../../node_modules/semver/internal/re.js"(exports,module){var{MAX_SAFE_COMPONENT_LENGTH,MAX_SAFE_BUILD_LENGTH,MAX_LENGTH}=require_constants(),debug=require_debug();exports=module.exports={};var re=exports.re=[],safeRe=exports.safeRe=[],src=exports.src=[],safeSrc=exports.safeSrc=[],t=exports.t={},R=0,LETTERDASHNUMBER="[a-zA-Z0-9-]",safeRegexReplacements=[["\\s",1],["\\d",MAX_LENGTH],[LETTERDASHNUMBER,MAX_SAFE_BUILD_LENGTH]],makeSafeRegex=value=>{for(let[token,max]of safeRegexReplacements)value=value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);return value},createToken=(name,value,isGlobal)=>{let safe=makeSafeRegex(value),index=R++;debug(name,index,value),t[name]=index,src[index]=value,safeSrc[index]=safe,re[index]=new RegExp(value,isGlobal?"g":void 0),safeRe[index]=new RegExp(safe,isGlobal?"g":void 0);};createToken("NUMERICIDENTIFIER","0|[1-9]\\d*");createToken("NUMERICIDENTIFIERLOOSE","\\d+");createToken("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);createToken("MAINVERSION",`(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);createToken("MAINVERSIONLOOSE",`(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);createToken("PRERELEASEIDENTIFIER",`(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);createToken("PRERELEASEIDENTIFIERLOOSE",`(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);createToken("PRERELEASE",`(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);createToken("PRERELEASELOOSE",`(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);createToken("BUILDIDENTIFIER",`${LETTERDASHNUMBER}+`);createToken("BUILD",`(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);createToken("FULLPLAIN",`v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);createToken("FULL",`^${src[t.FULLPLAIN]}$`);createToken("LOOSEPLAIN",`[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);createToken("LOOSE",`^${src[t.LOOSEPLAIN]}$`);createToken("GTLT","((?:<|>)?=?)");createToken("XRANGEIDENTIFIERLOOSE",`${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);createToken("XRANGEIDENTIFIER",`${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);createToken("XRANGEPLAIN",`[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);createToken("XRANGEPLAINLOOSE",`[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);createToken("XRANGE",`^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);createToken("XRANGELOOSE",`^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);createToken("COERCEPLAIN",`(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);createToken("COERCE",`${src[t.COERCEPLAIN]}(?:$|[^\\d])`);createToken("COERCEFULL",src[t.COERCEPLAIN]+`(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);createToken("COERCERTL",src[t.COERCE],!0);createToken("COERCERTLFULL",src[t.COERCEFULL],!0);createToken("LONETILDE","(?:~>?)");createToken("TILDETRIM",`(\\s*)${src[t.LONETILDE]}\\s+`,!0);exports.tildeTrimReplace="$1~";createToken("TILDE",`^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);createToken("TILDELOOSE",`^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);createToken("LONECARET","(?:\\^)");createToken("CARETTRIM",`(\\s*)${src[t.LONECARET]}\\s+`,!0);exports.caretTrimReplace="$1^";createToken("CARET",`^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);createToken("CARETLOOSE",`^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);createToken("COMPARATORLOOSE",`^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);createToken("COMPARATOR",`^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);createToken("COMPARATORTRIM",`(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`,!0);exports.comparatorTrimReplace="$1$2$3";createToken("HYPHENRANGE",`^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);createToken("HYPHENRANGELOOSE",`^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);createToken("STAR","(<|>)?=?\\s*\\*");createToken("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");createToken("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$");}});var require_parse_options=__commonJS({"../../node_modules/semver/internal/parse-options.js"(exports,module){var looseOption=Object.freeze({loose:!0}),emptyOpts=Object.freeze({}),parseOptions=options=>options?typeof options!="object"?looseOption:options:emptyOpts;module.exports=parseOptions;}});var require_identifiers=__commonJS({"../../node_modules/semver/internal/identifiers.js"(exports,module){var numeric=/^[0-9]+$/,compareIdentifiers=(a,b)=>{let anum=numeric.test(a),bnum=numeric.test(b);return anum&&bnum&&(a=+a,b=+b),a===b?0:anum&&!bnum?-1:bnum&&!anum?1:a<b?-1:1},rcompareIdentifiers=(a,b)=>compareIdentifiers(b,a);module.exports={compareIdentifiers,rcompareIdentifiers};}});var require_semver=__commonJS({"../../node_modules/semver/classes/semver.js"(exports,module){var debug=require_debug(),{MAX_LENGTH,MAX_SAFE_INTEGER}=require_constants(),{safeRe:re,safeSrc:src,t}=require_re(),parseOptions=require_parse_options(),{compareIdentifiers}=require_identifiers(),SemVer=class _SemVer{constructor(version,options){if(options=parseOptions(options),version instanceof _SemVer){if(version.loose===!!options.loose&&version.includePrerelease===!!options.includePrerelease)return version;version=version.version;}else if(typeof version!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);if(version.length>MAX_LENGTH)throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);debug("SemVer",version,options),this.options=options,this.loose=!!options.loose,this.includePrerelease=!!options.includePrerelease;let m=version.trim().match(options.loose?re[t.LOOSE]:re[t.FULL]);if(!m)throw new TypeError(`Invalid Version: ${version}`);if(this.raw=version,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>MAX_SAFE_INTEGER||this.major<0)throw new TypeError("Invalid major version");if(this.minor>MAX_SAFE_INTEGER||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>MAX_SAFE_INTEGER||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(id=>{if(/^[0-9]+$/.test(id)){let num=+id;if(num>=0&&num<MAX_SAFE_INTEGER)return num}return id}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format();}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(other){if(debug("SemVer.compare",this.version,this.options,other),!(other instanceof _SemVer)){if(typeof other=="string"&&other===this.version)return 0;other=new _SemVer(other,this.options);}return other.version===this.version?0:this.compareMain(other)||this.comparePre(other)}compareMain(other){return other instanceof _SemVer||(other=new _SemVer(other,this.options)),compareIdentifiers(this.major,other.major)||compareIdentifiers(this.minor,other.minor)||compareIdentifiers(this.patch,other.patch)}comparePre(other){if(other instanceof _SemVer||(other=new _SemVer(other,this.options)),this.prerelease.length&&!other.prerelease.length)return -1;if(!this.prerelease.length&&other.prerelease.length)return 1;if(!this.prerelease.length&&!other.prerelease.length)return 0;let i=0;do{let a=this.prerelease[i],b=other.prerelease[i];if(debug("prerelease compare",i,a,b),a===void 0&&b===void 0)return 0;if(b===void 0)return 1;if(a===void 0)return -1;if(a===b)continue;return compareIdentifiers(a,b)}while(++i)}compareBuild(other){other instanceof _SemVer||(other=new _SemVer(other,this.options));let i=0;do{let a=this.build[i],b=other.build[i];if(debug("build compare",i,a,b),a===void 0&&b===void 0)return 0;if(b===void 0)return 1;if(a===void 0)return -1;if(a===b)continue;return compareIdentifiers(a,b)}while(++i)}inc(release,identifier,identifierBase){if(release.startsWith("pre")){if(!identifier&&identifierBase===!1)throw new Error("invalid increment argument: identifier is empty");if(identifier){let r=new RegExp(`^${this.options.loose?src[t.PRERELEASELOOSE]:src[t.PRERELEASE]}$`),match=`-${identifier}`.match(r);if(!match||match[1]!==identifier)throw new Error(`invalid identifier: ${identifier}`)}}switch(release){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",identifier,identifierBase);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",identifier,identifierBase);break;case"prepatch":this.prerelease.length=0,this.inc("patch",identifier,identifierBase),this.inc("pre",identifier,identifierBase);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",identifier,identifierBase),this.inc("pre",identifier,identifierBase);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let base=Number(identifierBase)?1:0;if(this.prerelease.length===0)this.prerelease=[base];else {let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(identifier===this.prerelease.join(".")&&identifierBase===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(base);}}if(identifier){let prerelease=[identifier,base];identifierBase===!1&&(prerelease=[identifier]),compareIdentifiers(this.prerelease[0],identifier)===0?isNaN(this.prerelease[1])&&(this.prerelease=prerelease):this.prerelease=prerelease;}break}default:throw new Error(`invalid increment argument: ${release}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};module.exports=SemVer;}});var require_compare=__commonJS({"../../node_modules/semver/functions/compare.js"(exports,module){var SemVer=require_semver(),compare=(a,b,loose)=>new SemVer(a,loose).compare(new SemVer(b,loose));module.exports=compare;}});var require_gte=__commonJS({"../../node_modules/semver/functions/gte.js"(exports,module){var compare=require_compare(),gte=(a,b,loose)=>compare(a,b,loose)>=0;module.exports=gte;}});var require_make_dir=__commonJS({"../../node_modules/istanbul-lib-report/node_modules/make-dir/index.js"(exports,module){var fs=__require("fs"),path=__require("path"),{promisify}=__require("util"),semverGte=require_gte(),useNativeRecursiveOption=semverGte(process.version,"10.12.0"),checkPath=pth=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(pth.replace(path.parse(pth).root,""))){let error=new Error(`Path contains invalid characters: ${pth}`);throw error.code="EINVAL",error}},processOptions=options=>({...{mode:511,fs},...options}),permissionError=pth=>{let error=new Error(`operation not permitted, mkdir '${pth}'`);return error.code="EPERM",error.errno=-4048,error.path=pth,error.syscall="mkdir",error},makeDir=async(input,options)=>{checkPath(input),options=processOptions(options);let mkdir=promisify(options.fs.mkdir),stat=promisify(options.fs.stat);if(useNativeRecursiveOption&&options.fs.mkdir===fs.mkdir){let pth=path.resolve(input);return await mkdir(pth,{mode:options.mode,recursive:!0}),pth}let make=async pth=>{try{return await mkdir(pth,options.mode),pth}catch(error){if(error.code==="EPERM")throw error;if(error.code==="ENOENT"){if(path.dirname(pth)===pth)throw permissionError(pth);if(error.message.includes("null bytes"))throw error;return await make(path.dirname(pth)),make(pth)}try{if(!(await stat(pth)).isDirectory())throw new Error("The path is not a directory")}catch{throw error}return pth}};return make(path.resolve(input))};module.exports=makeDir;module.exports.sync=(input,options)=>{if(checkPath(input),options=processOptions(options),useNativeRecursiveOption&&options.fs.mkdirSync===fs.mkdirSync){let pth=path.resolve(input);return fs.mkdirSync(pth,{mode:options.mode,recursive:!0}),pth}let make=pth=>{try{options.fs.mkdirSync(pth,options.mode);}catch(error){if(error.code==="EPERM")throw error;if(error.code==="ENOENT"){if(path.dirname(pth)===pth)throw permissionError(pth);if(error.message.includes("null bytes"))throw error;return make(path.dirname(pth)),make(pth)}try{if(!options.fs.statSync(pth).isDirectory())throw new Error("The path is not a directory")}catch{throw error}}return pth};return make(path.resolve(input))};}});var require_has_flag=__commonJS({"../../node_modules/has-flag/index.js"(exports,module){module.exports=(flag,argv=process.argv)=>{let prefix=flag.startsWith("-")?"":flag.length===1?"-":"--",position=argv.indexOf(prefix+flag),terminatorPosition=argv.indexOf("--");return position!==-1&&(terminatorPosition===-1||position<terminatorPosition)};}});var require_supports_color=__commonJS({"../../node_modules/supports-color/index.js"(exports,module){var os=__require("os"),tty=__require("tty"),hasFlag=require_has_flag(),{env}=process,forceColor;hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")?forceColor=0:(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always"))&&(forceColor=1);"FORCE_COLOR"in env&&(env.FORCE_COLOR==="true"?forceColor=1:env.FORCE_COLOR==="false"?forceColor=0:forceColor=env.FORCE_COLOR.length===0?1:Math.min(parseInt(env.FORCE_COLOR,10),3));function translateLevel(level){return level===0?!1:{level,hasBasic:!0,has256:level>=2,has16m:level>=3}}function supportsColor(haveStream,streamIsTTY){if(forceColor===0)return 0;if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor"))return 3;if(hasFlag("color=256"))return 2;if(haveStream&&!streamIsTTY&&forceColor===void 0)return 0;let min=forceColor||0;if(env.TERM==="dumb")return min;if(process.platform==="win32"){let osRelease=os.release().split(".");return Number(osRelease[0])>=10&&Number(osRelease[2])>=10586?Number(osRelease[2])>=14931?3:2:1}if("CI"in env)return ["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(sign=>sign in env)||env.CI_NAME==="codeship"?1:min;if("TEAMCITY_VERSION"in env)return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION)?1:0;if(env.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in env){let version=parseInt((env.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(env.TERM_PROGRAM){case"iTerm.app":return version>=3?3:2;case"Apple_Terminal":return 2}}return /-256(color)?$/i.test(env.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)||"COLORTERM"in env?1:min}function getSupportLevel(stream){let level=supportsColor(stream,stream&&stream.isTTY);return translateLevel(level)}module.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(!0,tty.isatty(1))),stderr:translateLevel(supportsColor(!0,tty.isatty(2)))};}});var require_file_writer=__commonJS({"../../node_modules/istanbul-lib-report/lib/file-writer.js"(exports,module){var path=__require("path"),fs=__require("fs"),mkdirp=require_make_dir(),supportsColor=require_supports_color(),ContentWriter=class{colorize(str){return str}println(str){this.write(`${str}
4
- `);}close(){}},FileContentWriter=class extends ContentWriter{constructor(fd){super(),this.fd=fd;}write(str){fs.writeSync(this.fd,str);}close(){fs.closeSync(this.fd);}},capture=!1,output="",ConsoleWriter=class extends ContentWriter{write(str){capture?output+=str:process.stdout.write(str);}colorize(str,clazz){let colors={low:"31;1",medium:"33;1",high:"32;1"};return supportsColor.stdout&&colors[clazz]?`\x1B[${colors[clazz]}m${str}\x1B[0m`:str}},FileWriter=class _FileWriter{constructor(baseDir){if(!baseDir)throw new Error("baseDir must be specified");this.baseDir=baseDir;}static startCapture(){capture=!0;}static stopCapture(){capture=!1;}static getOutput(){return output}static resetOutput(){output="";}writerForDir(subdir){if(path.isAbsolute(subdir))throw new Error(`Cannot create subdir writer for absolute path: ${subdir}`);return new _FileWriter(`${this.baseDir}/${subdir}`)}copyFile(source,dest,header){if(path.isAbsolute(dest))throw new Error(`Cannot write to absolute path: ${dest}`);dest=path.resolve(this.baseDir,dest),mkdirp.sync(path.dirname(dest));let contents;header?contents=header+fs.readFileSync(source,"utf8"):contents=fs.readFileSync(source),fs.writeFileSync(dest,contents);}writeFile(file){if(file===null||file==="-")return new ConsoleWriter;if(path.isAbsolute(file))throw new Error(`Cannot write to absolute path: ${file}`);return file=path.resolve(this.baseDir,file),mkdirp.sync(path.dirname(file)),new FileContentWriter(fs.openSync(file,"w"))}};module.exports=FileWriter;}});var require_xml_writer=__commonJS({"../../node_modules/istanbul-lib-report/lib/xml-writer.js"(exports,module){var INDENT=" ";function attrString(attrs){return Object.entries(attrs||{}).map(([k,v])=>` ${k}="${v}"`).join("")}var XMLWriter=class{constructor(contentWriter){this.cw=contentWriter,this.stack=[];}indent(str){return this.stack.map(()=>INDENT).join("")+str}openTag(name,attrs){let str=this.indent(`<${name+attrString(attrs)}>`);this.cw.println(str),this.stack.push(name);}closeTag(name){if(this.stack.length===0)throw new Error(`Attempt to close tag ${name} when not opened`);let stashed=this.stack.pop(),str=`</${name}>`;if(stashed!==name)throw new Error(`Attempt to close tag ${name} when ${stashed} was the one open`);this.cw.println(this.indent(str));}inlineTag(name,attrs,content){let str="<"+name+attrString(attrs);content?str+=`>${content}</${name}>`:str+="/>",str=this.indent(str),this.cw.println(str);}closeAll(){this.stack.slice().reverse().forEach(name=>{this.closeTag(name);});}};module.exports=XMLWriter;}});var require_tree=__commonJS({"../../node_modules/istanbul-lib-report/lib/tree.js"(exports,module){var Visitor=class{constructor(delegate){this.delegate=delegate;}};["Start","End","Summary","SummaryEnd","Detail"].map(k=>`on${k}`).forEach(fn=>{Object.defineProperty(Visitor.prototype,fn,{writable:!0,value(node,state){typeof this.delegate[fn]=="function"&&this.delegate[fn](node,state);}});});var CompositeVisitor=class extends Visitor{constructor(visitors){super(),Array.isArray(visitors)||(visitors=[visitors]),this.visitors=visitors.map(v=>v instanceof Visitor?v:new Visitor(v));}};["Start","Summary","SummaryEnd","Detail","End"].map(k=>`on${k}`).forEach(fn=>{Object.defineProperty(CompositeVisitor.prototype,fn,{value(node,state){this.visitors.forEach(v=>{v[fn](node,state);});}});});var BaseNode=class{isRoot(){return !this.getParent()}visit(visitor,state){this.isSummary()?visitor.onSummary(this,state):visitor.onDetail(this,state),this.getChildren().forEach(child=>{child.visit(visitor,state);}),this.isSummary()&&visitor.onSummaryEnd(this,state);}},BaseTree=class{constructor(root){this.root=root;}getRoot(){return this.root}visit(visitor,state){visitor instanceof Visitor||(visitor=new Visitor(visitor)),visitor.onStart(this.getRoot(),state),this.getRoot().visit(visitor,state),visitor.onEnd(this.getRoot(),state);}};module.exports={BaseTree,BaseNode,Visitor,CompositeVisitor};}});var require_watermarks=__commonJS({"../../node_modules/istanbul-lib-report/lib/watermarks.js"(exports,module){module.exports={getDefault(){return {statements:[50,80],functions:[50,80],branches:[50,80],lines:[50,80]}}};}});var require_percent=__commonJS({"../../node_modules/istanbul-lib-coverage/lib/percent.js"(exports,module){module.exports=function(covered,total){let tmp;return total>0?(tmp=1e3*100*covered/total,Math.floor(tmp/10)/100):100};}});var require_data_properties=__commonJS({"../../node_modules/istanbul-lib-coverage/lib/data-properties.js"(exports,module){module.exports=function(klass,properties){properties.forEach(p=>{Object.defineProperty(klass.prototype,p,{enumerable:!0,get(){return this.data[p]}});});};}});var require_coverage_summary=__commonJS({"../../node_modules/istanbul-lib-coverage/lib/coverage-summary.js"(exports,module){var percent=require_percent(),dataProperties=require_data_properties();function blankSummary(){let empty=()=>({total:0,covered:0,skipped:0,pct:"Unknown"});return {lines:empty(),statements:empty(),functions:empty(),branches:empty(),branchesTrue:empty()}}function assertValidSummary(obj){if(!(obj&&obj.lines&&obj.statements&&obj.functions&&obj.branches))throw new Error("Invalid summary coverage object, missing keys, found:"+Object.keys(obj).join(","))}var CoverageSummary=class _CoverageSummary{constructor(obj){obj?obj instanceof _CoverageSummary?this.data=obj.data:this.data=obj:this.data=blankSummary(),assertValidSummary(this.data);}merge(obj){return ["lines","statements","branches","functions","branchesTrue"].forEach(key=>{obj[key]&&(this[key].total+=obj[key].total,this[key].covered+=obj[key].covered,this[key].skipped+=obj[key].skipped,this[key].pct=percent(this[key].covered,this[key].total));}),this}toJSON(){return this.data}isEmpty(){return this.lines.total===0}};dataProperties(CoverageSummary,["lines","statements","functions","branches","branchesTrue"]);module.exports={CoverageSummary};}});var require_file_coverage=__commonJS({"../../node_modules/istanbul-lib-coverage/lib/file-coverage.js"(exports,module){var percent=require_percent(),dataProperties=require_data_properties(),{CoverageSummary}=require_coverage_summary();function emptyCoverage(filePath,reportLogic){let cov={path:filePath,statementMap:{},fnMap:{},branchMap:{},s:{},f:{},b:{}};return reportLogic&&(cov.bT={}),cov}function assertValidObject(obj){if(!(obj&&obj.path&&obj.statementMap&&obj.fnMap&&obj.branchMap&&obj.s&&obj.f&&obj.b))throw new Error("Invalid file coverage object, missing keys, found:"+Object.keys(obj).join(","))}var keyFromLoc=({start,end})=>`${start.line}|${start.column}|${end.line}|${end.column}`,isObj=o=>!!o&&typeof o=="object",isLineCol=o=>isObj(o)&&typeof o.line=="number"&&typeof o.column=="number",isLoc=o=>isObj(o)&&isLineCol(o.start)&&isLineCol(o.end),getLoc=o=>isLoc(o)?o:isLoc(o.loc)?o.loc:null,findNearestContainer=(item,map)=>{let itemLoc=getLoc(item);if(!itemLoc)return null;let nearestContainingItem=null,containerDistance=null,containerKey=null;for(let[i,mapItem]of Object.entries(map)){let mapLoc=getLoc(mapItem);if(!mapLoc)continue;let distance=[itemLoc.start.line-mapLoc.start.line,itemLoc.start.column-mapLoc.start.column,mapLoc.end.line-itemLoc.end.line,mapLoc.end.column-itemLoc.end.column];if(distance[0]<0||distance[2]<0||distance[0]===0&&distance[1]<0||distance[2]===0&&distance[3]<0)continue;if(nearestContainingItem===null){containerDistance=distance,nearestContainingItem=mapItem,containerKey=i;continue}let closerBefore=distance[0]<containerDistance[0]||distance[0]===0&&distance[1]<containerDistance[1],closerAfter=distance[2]<containerDistance[2]||distance[2]===0&&distance[3]<containerDistance[3];(closerBefore||closerAfter)&&(containerDistance=distance,nearestContainingItem=mapItem,containerKey=i);}return containerKey},addHits=(aHits,bHits)=>typeof aHits=="number"&&typeof bHits=="number"?aHits+bHits:Array.isArray(aHits)&&Array.isArray(bHits)?aHits.map((a,i)=>(a||0)+(bHits[i]||0)):null,addNearestContainerHits=(item,itemHits,map,mapHits)=>{let container=findNearestContainer(item,map);return container?addHits(itemHits,mapHits[container]):itemHits},mergeProp=(aHits,aMap,bHits,bMap,itemKey=keyFromLoc)=>{let aItems={};for(let[key,itemHits]of Object.entries(aHits)){let item=aMap[key];aItems[itemKey(item)]=[itemHits,item];}let bItems={};for(let[key,itemHits]of Object.entries(bHits)){let item=bMap[key];bItems[itemKey(item)]=[itemHits,item];}let mergedItems={};for(let[key,aValue]of Object.entries(aItems)){let aItemHits=aValue[0],aItem=aValue[1],bValue=bItems[key];bValue?aItemHits=addHits(aItemHits,bValue[0]):aItemHits=addNearestContainerHits(aItem,aItemHits,bMap,bHits),mergedItems[key]=[aItemHits,aItem];}for(let[key,bValue]of Object.entries(bItems)){let bItemHits=bValue[0],bItem=bValue[1];mergedItems[key]||(bItemHits=addNearestContainerHits(bItem,bItemHits,aMap,aHits),mergedItems[key]=[bItemHits,bItem]);}let hits={},map={};return Object.values(mergedItems).forEach(([itemHits,item],i)=>{hits[i]=itemHits,map[i]=item;}),[hits,map]},FileCoverage=class _FileCoverage{constructor(pathOrObj,reportLogic=!1){if(!pathOrObj)throw new Error("Coverage must be initialized with a path or an object");if(typeof pathOrObj=="string")this.data=emptyCoverage(pathOrObj,reportLogic);else if(pathOrObj instanceof _FileCoverage)this.data=pathOrObj.data;else if(typeof pathOrObj=="object")this.data=pathOrObj;else throw new Error("Invalid argument to coverage constructor");assertValidObject(this.data);}getLineCoverage(){let statementMap=this.data.statementMap,statements=this.data.s,lineMap=Object.create(null);return Object.entries(statements).forEach(([st,count])=>{if(!statementMap[st])return;let{line}=statementMap[st].start,prevVal=lineMap[line];(prevVal===void 0||prevVal<count)&&(lineMap[line]=count);}),lineMap}getUncoveredLines(){let lc=this.getLineCoverage(),ret=[];return Object.entries(lc).forEach(([l,hits])=>{hits===0&&ret.push(l);}),ret}getBranchCoverageByLine(){let branchMap=this.branchMap,branches=this.b,ret={};return Object.entries(branchMap).forEach(([k,map])=>{let line=map.line||map.loc.start.line,branchData=branches[k];ret[line]=ret[line]||[],ret[line].push(...branchData);}),Object.entries(ret).forEach(([k,dataArray])=>{let covered=dataArray.filter(item=>item>0),coverage=covered.length/dataArray.length*100;ret[k]={covered:covered.length,total:dataArray.length,coverage};}),ret}toJSON(){return this.data}merge(other){if(other.all===!0)return;if(this.all===!0){this.data=other.data;return}let[hits,map]=mergeProp(this.s,this.statementMap,other.s,other.statementMap);this.data.s=hits,this.data.statementMap=map;let keyFromLocProp=x=>keyFromLoc(x.loc),keyFromLocationsProp=x=>keyFromLoc(x.locations[0]);[hits,map]=mergeProp(this.f,this.fnMap,other.f,other.fnMap,keyFromLocProp),this.data.f=hits,this.data.fnMap=map,[hits,map]=mergeProp(this.b,this.branchMap,other.b,other.branchMap,keyFromLocationsProp),this.data.b=hits,this.data.branchMap=map,this.bT&&other.bT&&([hits,map]=mergeProp(this.bT,this.branchMap,other.bT,other.branchMap,keyFromLocationsProp),this.data.bT=hits);}computeSimpleTotals(property){let stats=this[property];typeof stats=="function"&&(stats=stats.call(this));let ret={total:Object.keys(stats).length,covered:Object.values(stats).filter(v=>!!v).length,skipped:0};return ret.pct=percent(ret.covered,ret.total),ret}computeBranchTotals(property){let stats=this[property],ret={total:0,covered:0,skipped:0};return Object.values(stats).forEach(branches=>{ret.covered+=branches.filter(hits=>hits>0).length,ret.total+=branches.length;}),ret.pct=percent(ret.covered,ret.total),ret}resetHits(){let statements=this.s,functions=this.f,branches=this.b,branchesTrue=this.bT;Object.keys(statements).forEach(s=>{statements[s]=0;}),Object.keys(functions).forEach(f=>{functions[f]=0;}),Object.keys(branches).forEach(b=>{branches[b].fill(0);}),branchesTrue&&Object.keys(branchesTrue).forEach(bT=>{branchesTrue[bT].fill(0);});}toSummary(){let ret={};return ret.lines=this.computeSimpleTotals("getLineCoverage"),ret.functions=this.computeSimpleTotals("f","fnMap"),ret.statements=this.computeSimpleTotals("s","statementMap"),ret.branches=this.computeBranchTotals("b"),this.bT&&(ret.branchesTrue=this.computeBranchTotals("bT")),new CoverageSummary(ret)}};dataProperties(FileCoverage,["path","statementMap","fnMap","branchMap","s","f","b","bT","all"]);module.exports={FileCoverage,findNearestContainer,addHits,addNearestContainerHits};}});var require_coverage_map=__commonJS({"../../node_modules/istanbul-lib-coverage/lib/coverage-map.js"(exports,module){var{FileCoverage}=require_file_coverage(),{CoverageSummary}=require_coverage_summary();function maybeConstruct(obj,klass){return obj instanceof klass?obj:new klass(obj)}function loadMap(source){let data=Object.create(null);return source&&Object.entries(source).forEach(([k,cov])=>{data[k]=maybeConstruct(cov,FileCoverage);}),data}var CoverageMap=class _CoverageMap{constructor(obj){obj instanceof _CoverageMap?this.data=obj.data:this.data=loadMap(obj);}merge(obj){let other=maybeConstruct(obj,_CoverageMap);Object.values(other.data).forEach(fc=>{this.addFileCoverage(fc);});}filter(callback){Object.keys(this.data).forEach(k=>{callback(k)||delete this.data[k];});}toJSON(){return this.data}files(){return Object.keys(this.data)}fileCoverageFor(file){let fc=this.data[file];if(!fc)throw new Error(`No file coverage available for: ${file}`);return fc}addFileCoverage(fc){let cov=new FileCoverage(fc),{path}=cov;this.data[path]?this.data[path].merge(cov):this.data[path]=cov;}getCoverageSummary(){let ret=new CoverageSummary;return Object.values(this.data).forEach(fc=>{ret.merge(fc.toSummary());}),ret}};module.exports={CoverageMap};}});var require_istanbul_lib_coverage=__commonJS({"../../node_modules/istanbul-lib-coverage/index.js"(exports,module){var{FileCoverage}=require_file_coverage(),{CoverageMap}=require_coverage_map(),{CoverageSummary}=require_coverage_summary();module.exports={createCoverageSummary(obj){return obj&&obj instanceof CoverageSummary?obj:new CoverageSummary(obj)},createCoverageMap(obj){return obj&&obj instanceof CoverageMap?obj:new CoverageMap(obj)},createFileCoverage(obj){return obj&&obj instanceof FileCoverage?obj:new FileCoverage(obj)}};module.exports.classes={FileCoverage};}});var require_path=__commonJS({"../../node_modules/istanbul-lib-report/lib/path.js"(exports,module){var path=__require("path"),parsePath=path.parse,SEP=path.sep,origParser=parsePath,origSep=SEP;function makeRelativeNormalizedPath(str,sep){let parsed=parsePath(str),root=parsed.root,dir,file=parsed.base,quoted,pos;return sep==="\\"&&(pos=root.indexOf(":\\"),pos>=0&&(root=root.substring(0,pos+2))),dir=parsed.dir.substring(root.length),str===""?[]:(sep!=="/"&&(quoted=new RegExp(sep.replace(/\W/g,"\\$&"),"g"),dir=dir.replace(quoted,"/"),file=file.replace(quoted,"/")),dir!==""?dir=`${dir}/${file}`:dir=file,dir.substring(0,1)==="/"&&(dir=dir.substring(1)),dir=dir.split(/\/+/),dir)}var Path=class _Path{constructor(strOrArray){if(Array.isArray(strOrArray))this.v=strOrArray;else if(typeof strOrArray=="string")this.v=makeRelativeNormalizedPath(strOrArray,SEP);else throw new Error(`Invalid Path argument must be string or array:${strOrArray}`)}toString(){return this.v.join("/")}hasParent(){return this.v.length>0}parent(){if(!this.hasParent())throw new Error("Unable to get parent for 0 elem path");let p=this.v.slice();return p.pop(),new _Path(p)}elements(){return this.v.slice()}name(){return this.v.slice(-1)[0]}contains(other){let i;if(other.length>this.length)return !1;for(i=0;i<other.length;i+=1)if(this.v[i]!==other.v[i])return !1;return !0}ancestorOf(other){return other.contains(this)&&other.length!==this.length}descendantOf(other){return this.contains(other)&&other.length!==this.length}commonPrefixPath(other){let len=this.length>other.length?other.length:this.length,i,ret=[];for(i=0;i<len&&this.v[i]===other.v[i];i+=1)ret.push(this.v[i]);return new _Path(ret)}static compare(a,b){let al=a.length,bl=b.length;if(al<bl)return -1;if(al>bl)return 1;let astr=a.toString(),bstr=b.toString();return astr<bstr?-1:astr>bstr?1:0}};["push","pop","shift","unshift","splice"].forEach(fn=>{Object.defineProperty(Path.prototype,fn,{value(...args){return this.v[fn](...args)}});});Object.defineProperty(Path.prototype,"length",{enumerable:!0,get(){return this.v.length}});module.exports=Path;Path.tester={setParserAndSep(p,sep){parsePath=p,SEP=sep;},reset(){parsePath=origParser,SEP=origSep;}};}});var require_summarizer_factory=__commonJS({"../../node_modules/istanbul-lib-report/lib/summarizer-factory.js"(exports,module){var coverage=require_istanbul_lib_coverage(),Path=require_path(),{BaseNode,BaseTree}=require_tree(),ReportNode=class _ReportNode extends BaseNode{constructor(path,fileCoverage){super(),this.path=path,this.parent=null,this.fileCoverage=fileCoverage,this.children=[];}static createRoot(children){let root=new _ReportNode(new Path([]));return children.forEach(child=>{root.addChild(child);}),root}addChild(child){child.parent=this,this.children.push(child);}asRelative(p){return p.substring(0,1)==="/"?p.substring(1):p}getQualifiedName(){return this.asRelative(this.path.toString())}getRelativeName(){let parent=this.getParent(),myPath=this.path,relPath,i,parentPath=parent?parent.path:new Path([]);if(parentPath.ancestorOf(myPath)){for(relPath=new Path(myPath.elements()),i=0;i<parentPath.length;i+=1)relPath.shift();return this.asRelative(relPath.toString())}return this.asRelative(this.path.toString())}getParent(){return this.parent}getChildren(){return this.children}isSummary(){return !this.fileCoverage}getFileCoverage(){return this.fileCoverage}getCoverageSummary(filesOnly){let cacheProp=`c_${filesOnly?"files":"full"}`,summary;if(Object.prototype.hasOwnProperty.call(this,cacheProp))return this[cacheProp];if(!this.isSummary())summary=this.getFileCoverage().toSummary();else {let count=0;summary=coverage.createCoverageSummary(),this.getChildren().forEach(child=>{filesOnly&&child.isSummary()||(count+=1,summary.merge(child.getCoverageSummary(filesOnly)));}),count===0&&filesOnly&&(summary=null);}return this[cacheProp]=summary,summary}},ReportTree=class extends BaseTree{constructor(root,childPrefix){super(root);let maybePrefix=node=>{childPrefix&&!node.isRoot()&&node.path.unshift(childPrefix);};this.visit({onDetail:maybePrefix,onSummary(node){maybePrefix(node),node.children.sort((a,b)=>{let astr=a.path.toString(),bstr=b.path.toString();return astr<bstr?-1:astr>bstr?1:0});}});}};function findCommonParent(paths){return paths.reduce((common,path)=>common.commonPrefixPath(path),paths[0]||new Path([]))}function findOrCreateParent(parentPath,nodeMap,created=()=>{}){let parent=nodeMap[parentPath.toString()];return parent||(parent=new ReportNode(parentPath),nodeMap[parentPath.toString()]=parent,created(parentPath,parent)),parent}function toDirParents(list){let nodeMap=Object.create(null);return list.forEach(o=>{findOrCreateParent(o.path.parent(),nodeMap).addChild(new ReportNode(o.path,o.fileCoverage));}),Object.values(nodeMap)}function addAllPaths(topPaths,nodeMap,path,node){findOrCreateParent(path.parent(),nodeMap,(parentPath,parent2)=>{parentPath.hasParent()?addAllPaths(topPaths,nodeMap,parentPath,parent2):topPaths.push(parent2);}).addChild(node);}function foldIntoOneDir(node,parent){let{children}=node;return children.length===1&&!children[0].fileCoverage?(children[0].parent=parent,foldIntoOneDir(children[0],parent)):(node.children=children.map(child=>foldIntoOneDir(child,node)),node)}function pkgSummaryPrefix(dirParents,commonParent){if(dirParents.some(dp=>dp.path.length===0))return commonParent.length===0?"root":commonParent.name()}var SummarizerFactory=class{constructor(coverageMap,defaultSummarizer="pkg"){this._coverageMap=coverageMap,this._defaultSummarizer=defaultSummarizer,this._initialList=coverageMap.files().map(filePath=>({filePath,path:new Path(filePath),fileCoverage:coverageMap.fileCoverageFor(filePath)})),this._commonParent=findCommonParent(this._initialList.map(o=>o.path.parent())),this._commonParent.length>0&&this._initialList.forEach(o=>{o.path.splice(0,this._commonParent.length);});}get defaultSummarizer(){return this[this._defaultSummarizer]}get flat(){return this._flat||(this._flat=new ReportTree(ReportNode.createRoot(this._initialList.map(node=>new ReportNode(node.path,node.fileCoverage))))),this._flat}_createPkg(){let dirParents=toDirParents(this._initialList);return dirParents.length===1?new ReportTree(dirParents[0]):new ReportTree(ReportNode.createRoot(dirParents),pkgSummaryPrefix(dirParents,this._commonParent))}get pkg(){return this._pkg||(this._pkg=this._createPkg()),this._pkg}_createNested(){let nodeMap=Object.create(null),topPaths=[];this._initialList.forEach(o=>{let node=new ReportNode(o.path,o.fileCoverage);addAllPaths(topPaths,nodeMap,o.path,node);});let topNodes=topPaths.map(node=>foldIntoOneDir(node));return topNodes.length===1?new ReportTree(topNodes[0]):new ReportTree(ReportNode.createRoot(topNodes))}get nested(){return this._nested||(this._nested=this._createNested()),this._nested}};module.exports=SummarizerFactory;}});var require_context=__commonJS({"../../node_modules/istanbul-lib-report/lib/context.js"(exports,module){var fs=__require("fs"),FileWriter=require_file_writer(),XMLWriter=require_xml_writer(),tree=require_tree(),watermarks=require_watermarks(),SummarizerFactory=require_summarizer_factory();function defaultSourceLookup(path){try{return fs.readFileSync(path,"utf8")}catch(ex){throw new Error(`Unable to lookup source: ${path} (${ex.message})`)}}function normalizeWatermarks(specified={}){return Object.entries(watermarks.getDefault()).forEach(([k,value])=>{let specValue=specified[k];(!Array.isArray(specValue)||specValue.length!==2)&&(specified[k]=value);}),specified}var Context=class{constructor(opts){this.dir=opts.dir||"coverage",this.watermarks=normalizeWatermarks(opts.watermarks),this.sourceFinder=opts.sourceFinder||defaultSourceLookup,this._summarizerFactory=new SummarizerFactory(opts.coverageMap,opts.defaultSummarizer),this.data={};}getWriter(){return this.writer}getSource(filePath){return this.sourceFinder(filePath)}classForPercent(type,value){let watermarks2=this.watermarks[type];return watermarks2?value<watermarks2[0]?"low":value>=watermarks2[1]?"high":"medium":"unknown"}getXMLWriter(contentWriter){return new XMLWriter(contentWriter)}getVisitor(partialVisitor){return new tree.Visitor(partialVisitor)}getTree(name="defaultSummarizer"){return this._summarizerFactory[name]}};Object.defineProperty(Context.prototype,"writer",{enumerable:!0,get(){return this.data.writer||(this.data.writer=new FileWriter(this.dir)),this.data.writer}});module.exports=Context;}});var require_report_base=__commonJS({"../../node_modules/istanbul-lib-report/lib/report-base.js"(exports,module){var _summarizer=Symbol("ReportBase.#summarizer"),ReportBase2=class{constructor(opts={}){this[_summarizer]=opts.summarizer;}execute(context){context.getTree(this[_summarizer]).visit(this,context);}};module.exports=ReportBase2;}});var require_istanbul_lib_report=__commonJS({"../../node_modules/istanbul-lib-report/index.js"(exports,module){var Context=require_context(),watermarks=require_watermarks(),ReportBase2=require_report_base();module.exports={createContext(opts){return new Context(opts)},getDefaultWatermarks(){return watermarks.getDefault()},ReportBase:ReportBase2};}});var import_istanbul_lib_report=__toESM(require_istanbul_lib_report()),StorybookCoverageReporter=class extends import_istanbul_lib_report.ReportBase{#testManager;#coverageOptions;constructor(opts){super(),this.#testManager=opts.testManager,this.#coverageOptions=opts.coverageOptions;}onSummary(node){if(!node.isRoot())return;let rawCoverageSummary=node.getCoverageSummary(!1),percentage=Math.round(rawCoverageSummary.data.statements.pct),[lowWatermark=50,highWatermark=80]=this.#coverageOptions?.watermarks?.statements??[],coverageSummary={percentage,status:percentage<lowWatermark?"negative":percentage<highWatermark?"warning":"positive"};this.#testManager.onCoverageCollected(coverageSummary);}};
5
+ const __filename = CJS_COMPAT_NODE_URL.fileURLToPath(import.meta.url);
6
+ const __dirname = CJS_COMPAT_NODE_PATH.dirname(__filename);
7
+ const require = CJS_COMPAT_NODE_MODULE.createRequire(import.meta.url);
8
+ // ------------------------------------------------------------
9
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
10
+ // ------------------------------------------------------------
11
+ import {
12
+ h as ue
13
+ } from "../_node-chunks/chunk-C4NXJJA3.js";
14
+ import {
15
+ a as i,
16
+ b as w,
17
+ c as l,
18
+ e as ce
19
+ } from "../_node-chunks/chunk-KVKHJ5OL.js";
5
20
 
6
- module.exports = StorybookCoverageReporter;
21
+ // ../../node_modules/istanbul-lib-report/node_modules/make-dir/index.js
22
+ var gt = l((Ue, A) => {
23
+ "use strict";
24
+ var M = w("fs"), v = w("path"), { promisify: ht } = w("util"), le = ue(), ft = le(process.version, "10.12.0"), mt = /* @__PURE__ */ i((e) => {
25
+ if (process.platform === "win32" && /[<>:"|?*]/.test(e.replace(v.parse(e).root, ""))) {
26
+ let r = new Error(`Path contains invalid characters: ${e}`);
27
+ throw r.code = "EINVAL", r;
28
+ }
29
+ }, "checkPath"), pt = /* @__PURE__ */ i((e) => ({
30
+ ...{
31
+ mode: 511,
32
+ fs: M
33
+ },
34
+ ...e
35
+ }), "processOptions"), dt = /* @__PURE__ */ i((e) => {
36
+ let t = new Error(`operation not permitted, mkdir '${e}'`);
37
+ return t.code = "EPERM", t.errno = -4048, t.path = e, t.syscall = "mkdir", t;
38
+ }, "permissionError"), he = /* @__PURE__ */ i(async (e, t) => {
39
+ mt(e), t = pt(t);
40
+ let r = ht(t.fs.mkdir), s = ht(t.fs.stat);
41
+ if (ft && t.fs.mkdir === M.mkdir) {
42
+ let a = v.resolve(e);
43
+ return await r(a, {
44
+ mode: t.mode,
45
+ recursive: !0
46
+ }), a;
47
+ }
48
+ let n = /* @__PURE__ */ i(async (a) => {
49
+ try {
50
+ return await r(a, t.mode), a;
51
+ } catch (o) {
52
+ if (o.code === "EPERM")
53
+ throw o;
54
+ if (o.code === "ENOENT") {
55
+ if (v.dirname(a) === a)
56
+ throw dt(a);
57
+ if (o.message.includes("null bytes"))
58
+ throw o;
59
+ return await n(v.dirname(a)), n(a);
60
+ }
61
+ try {
62
+ if (!(await s(a)).isDirectory())
63
+ throw new Error("The path is not a directory");
64
+ } catch {
65
+ throw o;
66
+ }
67
+ return a;
68
+ }
69
+ }, "make");
70
+ return n(v.resolve(e));
71
+ }, "makeDir");
72
+ A.exports = he;
73
+ A.exports.sync = (e, t) => {
74
+ if (mt(e), t = pt(t), ft && t.fs.mkdirSync === M.mkdirSync) {
75
+ let s = v.resolve(e);
76
+ return M.mkdirSync(s, {
77
+ mode: t.mode,
78
+ recursive: !0
79
+ }), s;
80
+ }
81
+ let r = /* @__PURE__ */ i((s) => {
82
+ try {
83
+ t.fs.mkdirSync(s, t.mode);
84
+ } catch (n) {
85
+ if (n.code === "EPERM")
86
+ throw n;
87
+ if (n.code === "ENOENT") {
88
+ if (v.dirname(s) === s)
89
+ throw dt(s);
90
+ if (n.message.includes("null bytes"))
91
+ throw n;
92
+ return r(v.dirname(s)), r(s);
93
+ }
94
+ try {
95
+ if (!t.fs.statSync(s).isDirectory())
96
+ throw new Error("The path is not a directory");
97
+ } catch {
98
+ throw n;
99
+ }
100
+ }
101
+ return s;
102
+ }, "make");
103
+ return r(v.resolve(e));
104
+ };
105
+ });
106
+
107
+ // ../../node_modules/has-flag/index.js
108
+ var vt = l((Je, wt) => {
109
+ "use strict";
110
+ wt.exports = (e, t = process.argv) => {
111
+ let r = e.startsWith("-") ? "" : e.length === 1 ? "-" : "--", s = t.indexOf(r + e), n = t.indexOf("--");
112
+ return s !== -1 && (n === -1 || s < n);
113
+ };
114
+ });
115
+
116
+ // ../../node_modules/supports-color/index.js
117
+ var Et = l((He, bt) => {
118
+ "use strict";
119
+ var fe = w("os"), yt = w("tty"), g = vt(), { env: h } = process, E;
120
+ g("no-color") || g("no-colors") || g("color=false") || g("color=never") ? E = 0 : (g("color") || g("colors") || g("color=true") || g("color=always")) && (E = 1);
121
+ "FORCE_COLOR" in h && (h.FORCE_COLOR === "true" ? E = 1 : h.FORCE_COLOR === "false" ? E = 0 : E = h.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(h.FORCE_COLOR, 10), 3));
122
+ function D(e) {
123
+ return e === 0 ? !1 : {
124
+ level: e,
125
+ hasBasic: !0,
126
+ has256: e >= 2,
127
+ has16m: e >= 3
128
+ };
129
+ }
130
+ i(D, "translateLevel");
131
+ function V(e, t) {
132
+ if (E === 0)
133
+ return 0;
134
+ if (g("color=16m") || g("color=full") || g("color=truecolor"))
135
+ return 3;
136
+ if (g("color=256"))
137
+ return 2;
138
+ if (e && !t && E === void 0)
139
+ return 0;
140
+ let r = E || 0;
141
+ if (h.TERM === "dumb")
142
+ return r;
143
+ if (process.platform === "win32") {
144
+ let s = fe.release().split(".");
145
+ return Number(s[0]) >= 10 && Number(s[2]) >= 10586 ? Number(s[2]) >= 14931 ? 3 : 2 : 1;
146
+ }
147
+ if ("CI" in h)
148
+ return ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((s) => s in h) || h.CI_NAME === "codeship" ? 1 : r;
149
+ if ("TEAMCITY_VERSION" in h)
150
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(h.TEAMCITY_VERSION) ? 1 : 0;
151
+ if (h.COLORTERM === "truecolor")
152
+ return 3;
153
+ if ("TERM_PROGRAM" in h) {
154
+ let s = parseInt((h.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
155
+ switch (h.TERM_PROGRAM) {
156
+ case "iTerm.app":
157
+ return s >= 3 ? 3 : 2;
158
+ case "Apple_Terminal":
159
+ return 2;
160
+ }
161
+ }
162
+ return /-256(color)?$/i.test(h.TERM) ? 2 : /^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(h.TERM) || "COLORTERM" in h ? 1 : r;
163
+ }
164
+ i(V, "supportsColor");
165
+ function me(e) {
166
+ let t = V(e, e && e.isTTY);
167
+ return D(t);
168
+ }
169
+ i(me, "getSupportLevel");
170
+ bt.exports = {
171
+ supportsColor: me,
172
+ stdout: D(V(!0, yt.isatty(1))),
173
+ stderr: D(V(!0, yt.isatty(2)))
174
+ };
175
+ });
176
+
177
+ // ../../node_modules/istanbul-lib-report/lib/file-writer.js
178
+ var Ot = l((Qe, Ct) => {
179
+ "use strict";
180
+ var S = w("path"), O = w("fs"), St = gt(), pe = Et(), P = class {
181
+ static {
182
+ i(this, "ContentWriter");
183
+ }
184
+ /**
185
+ * returns the colorized version of a string. Typically,
186
+ * content writers that write to files will return the
187
+ * same string and ones writing to a tty will wrap it in
188
+ * appropriate escape sequences.
189
+ * @param {String} str the string to colorize
190
+ * @param {String} clazz one of `high`, `medium` or `low`
191
+ * @returns {String} the colorized form of the string
192
+ */
193
+ colorize(t) {
194
+ return t;
195
+ }
196
+ /**
197
+ * writes a string appended with a newline to the destination
198
+ * @param {String} str the string to write
199
+ */
200
+ println(t) {
201
+ this.write(`${t}
202
+ `);
203
+ }
204
+ /**
205
+ * closes this content writer. Should be called after all writes are complete.
206
+ */
207
+ close() {
208
+ }
209
+ }, z = class extends P {
210
+ static {
211
+ i(this, "FileContentWriter");
212
+ }
213
+ constructor(t) {
214
+ super(), this.fd = t;
215
+ }
216
+ write(t) {
217
+ O.writeSync(this.fd, t);
218
+ }
219
+ close() {
220
+ O.closeSync(this.fd);
221
+ }
222
+ }, j = !1, B = "", W = class extends P {
223
+ static {
224
+ i(this, "ConsoleWriter");
225
+ }
226
+ write(t) {
227
+ j ? B += t : process.stdout.write(t);
228
+ }
229
+ colorize(t, r) {
230
+ let s = {
231
+ low: "31;1",
232
+ medium: "33;1",
233
+ high: "32;1"
234
+ };
235
+ return pe.stdout && s[r] ? `\x1B[${s[r]}m${t}\x1B[0m` : t;
236
+ }
237
+ }, G = class e {
238
+ static {
239
+ i(this, "FileWriter");
240
+ }
241
+ constructor(t) {
242
+ if (!t)
243
+ throw new Error("baseDir must be specified");
244
+ this.baseDir = t;
245
+ }
246
+ /**
247
+ * static helpers for capturing stdout report output;
248
+ * super useful for tests!
249
+ */
250
+ static startCapture() {
251
+ j = !0;
252
+ }
253
+ static stopCapture() {
254
+ j = !1;
255
+ }
256
+ static getOutput() {
257
+ return B;
258
+ }
259
+ static resetOutput() {
260
+ B = "";
261
+ }
262
+ /**
263
+ * returns a FileWriter that is rooted at the supplied subdirectory
264
+ * @param {String} subdir the subdirectory under which to root the
265
+ * returned FileWriter
266
+ * @returns {FileWriter}
267
+ */
268
+ writerForDir(t) {
269
+ if (S.isAbsolute(t))
270
+ throw new Error(
271
+ `Cannot create subdir writer for absolute path: ${t}`
272
+ );
273
+ return new e(`${this.baseDir}/${t}`);
274
+ }
275
+ /**
276
+ * copies a file from a source directory to a destination name
277
+ * @param {String} source path to source file
278
+ * @param {String} dest relative path to destination file
279
+ * @param {String} [header=undefined] optional text to prepend to destination
280
+ * (e.g., an "this file is autogenerated" comment, copyright notice, etc.)
281
+ */
282
+ copyFile(t, r, s) {
283
+ if (S.isAbsolute(r))
284
+ throw new Error(`Cannot write to absolute path: ${r}`);
285
+ r = S.resolve(this.baseDir, r), St.sync(S.dirname(r));
286
+ let n;
287
+ s ? n = s + O.readFileSync(t, "utf8") : n = O.readFileSync(t), O.writeFileSync(r, n);
288
+ }
289
+ /**
290
+ * returns a content writer for writing content to the supplied file.
291
+ * @param {String|null} file the relative path to the file or the special
292
+ * values `"-"` or `null` for writing to the console
293
+ * @returns {ContentWriter}
294
+ */
295
+ writeFile(t) {
296
+ if (t === null || t === "-")
297
+ return new W();
298
+ if (S.isAbsolute(t))
299
+ throw new Error(`Cannot write to absolute path: ${t}`);
300
+ return t = S.resolve(this.baseDir, t), St.sync(S.dirname(t)), new z(O.openSync(t, "w"));
301
+ }
302
+ };
303
+ Ct.exports = G;
304
+ });
305
+
306
+ // ../../node_modules/istanbul-lib-report/lib/xml-writer.js
307
+ var Tt = l((Ze, Rt) => {
308
+ "use strict";
309
+ var de = " ";
310
+ function kt(e) {
311
+ return Object.entries(e || {}).map(([t, r]) => ` ${t}="${r}"`).join("");
312
+ }
313
+ i(kt, "attrString");
314
+ var U = class {
315
+ static {
316
+ i(this, "XMLWriter");
317
+ }
318
+ constructor(t) {
319
+ this.cw = t, this.stack = [];
320
+ }
321
+ indent(t) {
322
+ return this.stack.map(() => de).join("") + t;
323
+ }
324
+ /**
325
+ * writes the opening XML tag with the supplied attributes
326
+ * @param {String} name tag name
327
+ * @param {Object} [attrs=null] attrs attributes for the tag
328
+ */
329
+ openTag(t, r) {
330
+ let s = this.indent(`<${t + kt(r)}>`);
331
+ this.cw.println(s), this.stack.push(t);
332
+ }
333
+ /**
334
+ * closes an open XML tag.
335
+ * @param {String} name - tag name to close. This must match the writer's
336
+ * notion of the tag that is currently open.
337
+ */
338
+ closeTag(t) {
339
+ if (this.stack.length === 0)
340
+ throw new Error(`Attempt to close tag ${t} when not opened`);
341
+ let r = this.stack.pop(), s = `</${t}>`;
342
+ if (r !== t)
343
+ throw new Error(
344
+ `Attempt to close tag ${t} when ${r} was the one open`
345
+ );
346
+ this.cw.println(this.indent(s));
347
+ }
348
+ /**
349
+ * writes a tag and its value opening and closing it at the same time
350
+ * @param {String} name tag name
351
+ * @param {Object} [attrs=null] attrs tag attributes
352
+ * @param {String} [content=null] content optional tag content
353
+ */
354
+ inlineTag(t, r, s) {
355
+ let n = "<" + t + kt(r);
356
+ s ? n += `>${s}</${t}>` : n += "/>", n = this.indent(n), this.cw.println(n);
357
+ }
358
+ /**
359
+ * closes all open tags and ends the document
360
+ */
361
+ closeAll() {
362
+ this.stack.slice().reverse().forEach((t) => {
363
+ this.closeTag(t);
364
+ });
365
+ }
366
+ };
367
+ Rt.exports = U;
368
+ });
369
+
370
+ // ../../node_modules/istanbul-lib-report/lib/tree.js
371
+ var H = l((er, Mt) => {
372
+ "use strict";
373
+ var y = class {
374
+ static {
375
+ i(this, "Visitor");
376
+ }
377
+ constructor(t) {
378
+ this.delegate = t;
379
+ }
380
+ };
381
+ ["Start", "End", "Summary", "SummaryEnd", "Detail"].map((e) => `on${e}`).forEach((e) => {
382
+ Object.defineProperty(y.prototype, e, {
383
+ writable: !0,
384
+ value(t, r) {
385
+ typeof this.delegate[e] == "function" && this.delegate[e](t, r);
386
+ }
387
+ });
388
+ });
389
+ var x = class extends y {
390
+ static {
391
+ i(this, "CompositeVisitor");
392
+ }
393
+ constructor(t) {
394
+ super(), Array.isArray(t) || (t = [t]), this.visitors = t.map((r) => r instanceof y ? r : new y(r));
395
+ }
396
+ };
397
+ ["Start", "Summary", "SummaryEnd", "Detail", "End"].map((e) => `on${e}`).forEach((e) => {
398
+ Object.defineProperty(x.prototype, e, {
399
+ value(t, r) {
400
+ this.visitors.forEach((s) => {
401
+ s[e](t, r);
402
+ });
403
+ }
404
+ });
405
+ });
406
+ var Y = class {
407
+ static {
408
+ i(this, "BaseNode");
409
+ }
410
+ isRoot() {
411
+ return !this.getParent();
412
+ }
413
+ /**
414
+ * visit all nodes depth-first from this node down. Note that `onStart`
415
+ * and `onEnd` are never called on the visitor even if the current
416
+ * node is the root of the tree.
417
+ * @param visitor a full visitor that is called during tree traversal
418
+ * @param state optional state that is passed around
419
+ */
420
+ visit(t, r) {
421
+ this.isSummary() ? t.onSummary(this, r) : t.onDetail(this, r), this.getChildren().forEach((s) => {
422
+ s.visit(t, r);
423
+ }), this.isSummary() && t.onSummaryEnd(this, r);
424
+ }
425
+ }, J = class {
426
+ static {
427
+ i(this, "BaseTree");
428
+ }
429
+ constructor(t) {
430
+ this.root = t;
431
+ }
432
+ /**
433
+ * returns the root node of the tree
434
+ */
435
+ getRoot() {
436
+ return this.root;
437
+ }
438
+ /**
439
+ * visits the tree depth-first with the supplied partial visitor
440
+ * @param visitor - a potentially partial visitor
441
+ * @param state - the state to be passed around during tree traversal
442
+ */
443
+ visit(t, r) {
444
+ t instanceof y || (t = new y(t)), t.onStart(this.getRoot(), r), this.getRoot().visit(t, r), t.onEnd(this.getRoot(), r);
445
+ }
446
+ };
447
+ Mt.exports = {
448
+ BaseTree: J,
449
+ BaseNode: Y,
450
+ Visitor: y,
451
+ CompositeVisitor: x
452
+ };
453
+ });
454
+
455
+ // ../../node_modules/istanbul-lib-report/lib/watermarks.js
456
+ var K = l((sr, Pt) => {
457
+ "use strict";
458
+ Pt.exports = {
459
+ getDefault() {
460
+ return {
461
+ statements: [50, 80],
462
+ functions: [50, 80],
463
+ branches: [50, 80],
464
+ lines: [50, 80]
465
+ };
466
+ }
467
+ };
468
+ });
469
+
470
+ // ../../node_modules/istanbul-lib-coverage/lib/percent.js
471
+ var Q = l((nr, xt) => {
472
+ "use strict";
473
+ xt.exports = /* @__PURE__ */ i(function(t, r) {
474
+ let s;
475
+ return r > 0 ? (s = 1e3 * 100 * t / r, Math.floor(s / 10) / 100) : 100;
476
+ }, "percent");
477
+ });
478
+
479
+ // ../../node_modules/istanbul-lib-coverage/lib/data-properties.js
480
+ var X = l((ar, _t) => {
481
+ "use strict";
482
+ _t.exports = /* @__PURE__ */ i(function(t, r) {
483
+ r.forEach((s) => {
484
+ Object.defineProperty(t.prototype, s, {
485
+ enumerable: !0,
486
+ get() {
487
+ return this.data[s];
488
+ }
489
+ });
490
+ });
491
+ }, "dataProperties");
492
+ });
493
+
494
+ // ../../node_modules/istanbul-lib-coverage/lib/coverage-summary.js
495
+ var I = l((cr, It) => {
496
+ "use strict";
497
+ var ge = Q(), we = X();
498
+ function ve() {
499
+ let e = /* @__PURE__ */ i(() => ({
500
+ total: 0,
501
+ covered: 0,
502
+ skipped: 0,
503
+ pct: "Unknown"
504
+ }), "empty");
505
+ return {
506
+ lines: e(),
507
+ statements: e(),
508
+ functions: e(),
509
+ branches: e(),
510
+ branchesTrue: e()
511
+ };
512
+ }
513
+ i(ve, "blankSummary");
514
+ function ye(e) {
515
+ if (!(e && e.lines && e.statements && e.functions && e.branches))
516
+ throw new Error(
517
+ "Invalid summary coverage object, missing keys, found:" + Object.keys(e).join(",")
518
+ );
519
+ }
520
+ i(ye, "assertValidSummary");
521
+ var _ = class e {
522
+ static {
523
+ i(this, "CoverageSummary");
524
+ }
525
+ /**
526
+ * @constructor
527
+ * @param {Object|CoverageSummary} [obj=undefined] an optional data object or
528
+ * another coverage summary to initialize this object with.
529
+ */
530
+ constructor(t) {
531
+ t ? t instanceof e ? this.data = t.data : this.data = t : this.data = ve(), ye(this.data);
532
+ }
533
+ /**
534
+ * merges a second summary coverage object into this one
535
+ * @param {CoverageSummary} obj - another coverage summary object
536
+ */
537
+ merge(t) {
538
+ return [
539
+ "lines",
540
+ "statements",
541
+ "branches",
542
+ "functions",
543
+ "branchesTrue"
544
+ ].forEach((s) => {
545
+ t[s] && (this[s].total += t[s].total, this[s].covered += t[s].covered, this[s].skipped += t[s].skipped, this[s].pct = ge(this[s].covered, this[s].total));
546
+ }), this;
547
+ }
548
+ /**
549
+ * returns a POJO that is JSON serializable. May be used to get the raw
550
+ * summary object.
551
+ */
552
+ toJSON() {
553
+ return this.data;
554
+ }
555
+ /**
556
+ * return true if summary has no lines of code
557
+ */
558
+ isEmpty() {
559
+ return this.lines.total === 0;
560
+ }
561
+ };
562
+ we(_, [
563
+ "lines",
564
+ "statements",
565
+ "functions",
566
+ "branches",
567
+ "branchesTrue"
568
+ ]);
569
+ It.exports = {
570
+ CoverageSummary: _
571
+ };
572
+ });
573
+
574
+ // ../../node_modules/istanbul-lib-coverage/lib/file-coverage.js
575
+ var rt = l((lr, Dt) => {
576
+ "use strict";
577
+ var qt = Q(), be = X(), { CoverageSummary: Ee } = I();
578
+ function Se(e, t) {
579
+ let r = {
580
+ path: e,
581
+ statementMap: {},
582
+ fnMap: {},
583
+ branchMap: {},
584
+ s: {},
585
+ f: {},
586
+ b: {}
587
+ };
588
+ return t && (r.bT = {}), r;
589
+ }
590
+ i(Se, "emptyCoverage");
591
+ function Ce(e) {
592
+ if (!(e && e.path && e.statementMap && e.fnMap && e.branchMap && e.s && e.f && e.b))
593
+ throw new Error(
594
+ "Invalid file coverage object, missing keys, found:" + Object.keys(e).join(",")
595
+ );
596
+ }
597
+ i(Ce, "assertValidObject");
598
+ var Z = /* @__PURE__ */ i(({ start: e, end: t }) => `${e.line}|${e.column}|${t.line}|${t.column}`, "keyFromLoc"), Nt = /* @__PURE__ */ i((e) => !!e && typeof e == "object", "isObj"), Lt = /* @__PURE__ */ i((e) => Nt(e) && typeof e.line == "number" && typeof e.column == "number", "isLineCol"), $t = /* @__PURE__ */ i((e) => Nt(e) && Lt(e.start) && Lt(e.end), "isLoc"), Ft = /* @__PURE__ */ i((e) => $t(e) ? e : $t(e.loc) ? e.loc : null, "getLoc"), At = /* @__PURE__ */ i((e, t) => {
599
+ let r = Ft(e);
600
+ if (!r) return null;
601
+ let s = null, n = null, a = null;
602
+ for (let [o, c] of Object.entries(t)) {
603
+ let m = Ft(c);
604
+ if (!m) continue;
605
+ let f = [
606
+ r.start.line - m.start.line,
607
+ r.start.column - m.start.column,
608
+ m.end.line - r.end.line,
609
+ m.end.column - r.end.column
610
+ ];
611
+ if (f[0] < 0 || f[2] < 0 || f[0] === 0 && f[1] < 0 || f[2] === 0 && f[3] < 0)
612
+ continue;
613
+ if (s === null) {
614
+ n = f, s = c, a = o;
615
+ continue;
616
+ }
617
+ let p = f[0] < n[0] || f[0] === 0 && f[1] < n[1], d = f[2] < n[2] || f[2] === 0 && f[3] < n[3];
618
+ (p || d) && (n = f, s = c, a = o);
619
+ }
620
+ return a;
621
+ }, "findNearestContainer"), et = /* @__PURE__ */ i((e, t) => typeof e == "number" && typeof t == "number" ? e + t : Array.isArray(e) && Array.isArray(t) ? e.map((r, s) => (r || 0) + (t[s] || 0)) : null, "addHits"), tt = /* @__PURE__ */ i((e, t, r, s) => {
622
+ let n = At(e, r);
623
+ return n ? et(t, s[n]) : t;
624
+ }, "addNearestContainerHits"), q = /* @__PURE__ */ i((e, t, r, s, n = Z) => {
625
+ let a = {};
626
+ for (let [p, d] of Object.entries(e)) {
627
+ let u = t[p];
628
+ a[n(u)] = [d, u];
629
+ }
630
+ let o = {};
631
+ for (let [p, d] of Object.entries(r)) {
632
+ let u = s[p];
633
+ o[n(u)] = [d, u];
634
+ }
635
+ let c = {};
636
+ for (let [p, d] of Object.entries(a)) {
637
+ let u = d[0], R = d[1], lt = o[p];
638
+ lt ? u = et(u, lt[0]) : u = tt(R, u, s, r), c[p] = [u, R];
639
+ }
640
+ for (let [p, d] of Object.entries(o)) {
641
+ let u = d[0], R = d[1];
642
+ c[p] || (u = tt(R, u, t, e), c[p] = [u, R]);
643
+ }
644
+ let m = {}, f = {};
645
+ return Object.values(c).forEach(([p, d], u) => {
646
+ m[u] = p, f[u] = d;
647
+ }), [m, f];
648
+ }, "mergeProp"), L = class e {
649
+ static {
650
+ i(this, "FileCoverage");
651
+ }
652
+ /**
653
+ * @constructor
654
+ * @param {Object|FileCoverage|String} pathOrObj is a string that initializes
655
+ * and empty coverage object with the specified file path or a data object that
656
+ * has all the required properties for a file coverage object.
657
+ */
658
+ constructor(t, r = !1) {
659
+ if (!t)
660
+ throw new Error(
661
+ "Coverage must be initialized with a path or an object"
662
+ );
663
+ if (typeof t == "string")
664
+ this.data = Se(t, r);
665
+ else if (t instanceof e)
666
+ this.data = t.data;
667
+ else if (typeof t == "object")
668
+ this.data = t;
669
+ else
670
+ throw new Error("Invalid argument to coverage constructor");
671
+ Ce(this.data);
672
+ }
673
+ /**
674
+ * returns computed line coverage from statement coverage.
675
+ * This is a map of hits keyed by line number in the source.
676
+ */
677
+ getLineCoverage() {
678
+ let t = this.data.statementMap, r = this.data.s, s = /* @__PURE__ */ Object.create(null);
679
+ return Object.entries(r).forEach(([n, a]) => {
680
+ if (!t[n])
681
+ return;
682
+ let { line: o } = t[n].start, c = s[o];
683
+ (c === void 0 || c < a) && (s[o] = a);
684
+ }), s;
685
+ }
686
+ /**
687
+ * returns an array of uncovered line numbers.
688
+ * @returns {Array} an array of line numbers for which no hits have been
689
+ * collected.
690
+ */
691
+ getUncoveredLines() {
692
+ let t = this.getLineCoverage(), r = [];
693
+ return Object.entries(t).forEach(([s, n]) => {
694
+ n === 0 && r.push(s);
695
+ }), r;
696
+ }
697
+ /**
698
+ * returns a map of branch coverage by source line number.
699
+ * @returns {Object} an object keyed by line number. Each object
700
+ * has a `covered`, `total` and `coverage` (percentage) property.
701
+ */
702
+ getBranchCoverageByLine() {
703
+ let t = this.branchMap, r = this.b, s = {};
704
+ return Object.entries(t).forEach(([n, a]) => {
705
+ let o = a.line || a.loc.start.line, c = r[n];
706
+ s[o] = s[o] || [], s[o].push(...c);
707
+ }), Object.entries(s).forEach(([n, a]) => {
708
+ let o = a.filter((m) => m > 0), c = o.length / a.length * 100;
709
+ s[n] = {
710
+ covered: o.length,
711
+ total: a.length,
712
+ coverage: c
713
+ };
714
+ }), s;
715
+ }
716
+ /**
717
+ * return a JSON-serializable POJO for this file coverage object
718
+ */
719
+ toJSON() {
720
+ return this.data;
721
+ }
722
+ /**
723
+ * merges a second coverage object into this one, updating hit counts
724
+ * @param {FileCoverage} other - the coverage object to be merged into this one.
725
+ * Note that the other object should have the same structure as this one (same file).
726
+ */
727
+ merge(t) {
728
+ if (t.all === !0)
729
+ return;
730
+ if (this.all === !0) {
731
+ this.data = t.data;
732
+ return;
733
+ }
734
+ let [r, s] = q(
735
+ this.s,
736
+ this.statementMap,
737
+ t.s,
738
+ t.statementMap
739
+ );
740
+ this.data.s = r, this.data.statementMap = s;
741
+ let n = /* @__PURE__ */ i((o) => Z(o.loc), "keyFromLocProp"), a = /* @__PURE__ */ i((o) => Z(o.locations[0]), "keyFromLocationsProp");
742
+ [r, s] = q(
743
+ this.f,
744
+ this.fnMap,
745
+ t.f,
746
+ t.fnMap,
747
+ n
748
+ ), this.data.f = r, this.data.fnMap = s, [r, s] = q(
749
+ this.b,
750
+ this.branchMap,
751
+ t.b,
752
+ t.branchMap,
753
+ a
754
+ ), this.data.b = r, this.data.branchMap = s, this.bT && t.bT && ([r, s] = q(
755
+ this.bT,
756
+ this.branchMap,
757
+ t.bT,
758
+ t.branchMap,
759
+ a
760
+ ), this.data.bT = r);
761
+ }
762
+ computeSimpleTotals(t) {
763
+ let r = this[t];
764
+ typeof r == "function" && (r = r.call(this));
765
+ let s = {
766
+ total: Object.keys(r).length,
767
+ covered: Object.values(r).filter((n) => !!n).length,
768
+ skipped: 0
769
+ };
770
+ return s.pct = qt(s.covered, s.total), s;
771
+ }
772
+ computeBranchTotals(t) {
773
+ let r = this[t], s = { total: 0, covered: 0, skipped: 0 };
774
+ return Object.values(r).forEach((n) => {
775
+ s.covered += n.filter((a) => a > 0).length, s.total += n.length;
776
+ }), s.pct = qt(s.covered, s.total), s;
777
+ }
778
+ /**
779
+ * resets hit counts for all statements, functions and branches
780
+ * in this coverage object resulting in zero coverage.
781
+ */
782
+ resetHits() {
783
+ let t = this.s, r = this.f, s = this.b, n = this.bT;
784
+ Object.keys(t).forEach((a) => {
785
+ t[a] = 0;
786
+ }), Object.keys(r).forEach((a) => {
787
+ r[a] = 0;
788
+ }), Object.keys(s).forEach((a) => {
789
+ s[a].fill(0);
790
+ }), n && Object.keys(n).forEach((a) => {
791
+ n[a].fill(0);
792
+ });
793
+ }
794
+ /**
795
+ * returns a CoverageSummary for this file coverage object
796
+ * @returns {CoverageSummary}
797
+ */
798
+ toSummary() {
799
+ let t = {};
800
+ return t.lines = this.computeSimpleTotals("getLineCoverage"), t.functions = this.computeSimpleTotals("f", "fnMap"), t.statements = this.computeSimpleTotals("s", "statementMap"), t.branches = this.computeBranchTotals("b"), this.bT && (t.branchesTrue = this.computeBranchTotals("bT")), new Ee(t);
801
+ }
802
+ };
803
+ be(L, [
804
+ "path",
805
+ "statementMap",
806
+ "fnMap",
807
+ "branchMap",
808
+ "s",
809
+ "f",
810
+ "b",
811
+ "bT",
812
+ "all"
813
+ ]);
814
+ Dt.exports = {
815
+ FileCoverage: L,
816
+ // exported for testing
817
+ findNearestContainer: At,
818
+ addHits: et,
819
+ addNearestContainerHits: tt
820
+ };
821
+ });
822
+
823
+ // ../../node_modules/istanbul-lib-coverage/lib/coverage-map.js
824
+ var Bt = l((fr, jt) => {
825
+ "use strict";
826
+ var { FileCoverage: Vt } = rt(), { CoverageSummary: Oe } = I();
827
+ function zt(e, t) {
828
+ return e instanceof t ? e : new t(e);
829
+ }
830
+ i(zt, "maybeConstruct");
831
+ function ke(e) {
832
+ let t = /* @__PURE__ */ Object.create(null);
833
+ return e && Object.entries(e).forEach(([r, s]) => {
834
+ t[r] = zt(s, Vt);
835
+ }), t;
836
+ }
837
+ i(ke, "loadMap");
838
+ var st = class e {
839
+ static {
840
+ i(this, "CoverageMap");
841
+ }
842
+ /**
843
+ * @constructor
844
+ * @param {Object} [obj=undefined] obj A coverage map from which to initialize this
845
+ * map's contents. This can be the raw global coverage object.
846
+ */
847
+ constructor(t) {
848
+ t instanceof e ? this.data = t.data : this.data = ke(t);
849
+ }
850
+ /**
851
+ * merges a second coverage map into this one
852
+ * @param {CoverageMap} obj - a CoverageMap or its raw data. Coverage is merged
853
+ * correctly for the same files and additional file coverage keys are created
854
+ * as needed.
855
+ */
856
+ merge(t) {
857
+ let r = zt(t, e);
858
+ Object.values(r.data).forEach((s) => {
859
+ this.addFileCoverage(s);
860
+ });
861
+ }
862
+ /**
863
+ * filter the coveragemap based on the callback provided
864
+ * @param {Function (filename)} callback - Returns true if the path
865
+ * should be included in the coveragemap. False if it should be
866
+ * removed.
867
+ */
868
+ filter(t) {
869
+ Object.keys(this.data).forEach((r) => {
870
+ t(r) || delete this.data[r];
871
+ });
872
+ }
873
+ /**
874
+ * returns a JSON-serializable POJO for this coverage map
875
+ * @returns {Object}
876
+ */
877
+ toJSON() {
878
+ return this.data;
879
+ }
880
+ /**
881
+ * returns an array for file paths for which this map has coverage
882
+ * @returns {Array{string}} - array of files
883
+ */
884
+ files() {
885
+ return Object.keys(this.data);
886
+ }
887
+ /**
888
+ * returns the file coverage for the specified file.
889
+ * @param {String} file
890
+ * @returns {FileCoverage}
891
+ */
892
+ fileCoverageFor(t) {
893
+ let r = this.data[t];
894
+ if (!r)
895
+ throw new Error(`No file coverage available for: ${t}`);
896
+ return r;
897
+ }
898
+ /**
899
+ * adds a file coverage object to this map. If the path for the object,
900
+ * already exists in the map, it is merged with the existing coverage
901
+ * otherwise a new key is added to the map.
902
+ * @param {FileCoverage} fc the file coverage to add
903
+ */
904
+ addFileCoverage(t) {
905
+ let r = new Vt(t), { path: s } = r;
906
+ this.data[s] ? this.data[s].merge(r) : this.data[s] = r;
907
+ }
908
+ /**
909
+ * returns the coverage summary for all the file coverage objects in this map.
910
+ * @returns {CoverageSummary}
911
+ */
912
+ getCoverageSummary() {
913
+ let t = new Oe();
914
+ return Object.values(this.data).forEach((r) => {
915
+ t.merge(r.toSummary());
916
+ }), t;
917
+ }
918
+ };
919
+ jt.exports = {
920
+ CoverageMap: st
921
+ };
922
+ });
923
+
924
+ // ../../node_modules/istanbul-lib-coverage/index.js
925
+ var Ut = l((pr, it) => {
926
+ "use strict";
927
+ var { FileCoverage: nt } = rt(), { CoverageMap: Wt } = Bt(), { CoverageSummary: Gt } = I();
928
+ it.exports = {
929
+ /**
930
+ * creates a coverage summary object
931
+ * @param {Object} obj an argument with the same semantics
932
+ * as the one passed to the `CoverageSummary` constructor
933
+ * @returns {CoverageSummary}
934
+ */
935
+ createCoverageSummary(e) {
936
+ return e && e instanceof Gt ? e : new Gt(e);
937
+ },
938
+ /**
939
+ * creates a CoverageMap object
940
+ * @param {Object} obj optional - an argument with the same semantics
941
+ * as the one passed to the CoverageMap constructor.
942
+ * @returns {CoverageMap}
943
+ */
944
+ createCoverageMap(e) {
945
+ return e && e instanceof Wt ? e : new Wt(e);
946
+ },
947
+ /**
948
+ * creates a FileCoverage object
949
+ * @param {Object} obj optional - an argument with the same semantics
950
+ * as the one passed to the FileCoverage constructor.
951
+ * @returns {FileCoverage}
952
+ */
953
+ createFileCoverage(e) {
954
+ return e && e instanceof nt ? e : new nt(e);
955
+ }
956
+ };
957
+ it.exports.classes = {
958
+ /**
959
+ * the file coverage constructor
960
+ */
961
+ FileCoverage: nt
962
+ };
963
+ });
964
+
965
+ // ../../node_modules/istanbul-lib-report/lib/path.js
966
+ var Ht = l((dr, Jt) => {
967
+ "use strict";
968
+ var Yt = w("path"), $ = Yt.parse, F = Yt.sep, Re = $, Te = F;
969
+ function Me(e, t) {
970
+ let r = $(e), s = r.root, n, a = r.base, o, c;
971
+ return t === "\\" && (c = s.indexOf(":\\"), c >= 0 && (s = s.substring(0, c + 2))), n = r.dir.substring(s.length), e === "" ? [] : (t !== "/" && (o = new RegExp(t.replace(/\W/g, "\\$&"), "g"), n = n.replace(o, "/"), a = a.replace(o, "/")), n !== "" ? n = `${n}/${a}` : n = a, n.substring(0, 1) === "/" && (n = n.substring(1)), n = n.split(/\/+/), n);
972
+ }
973
+ i(Me, "makeRelativeNormalizedPath");
974
+ var k = class e {
975
+ static {
976
+ i(this, "Path");
977
+ }
978
+ constructor(t) {
979
+ if (Array.isArray(t))
980
+ this.v = t;
981
+ else if (typeof t == "string")
982
+ this.v = Me(t, F);
983
+ else
984
+ throw new Error(
985
+ `Invalid Path argument must be string or array:${t}`
986
+ );
987
+ }
988
+ toString() {
989
+ return this.v.join("/");
990
+ }
991
+ hasParent() {
992
+ return this.v.length > 0;
993
+ }
994
+ parent() {
995
+ if (!this.hasParent())
996
+ throw new Error("Unable to get parent for 0 elem path");
997
+ let t = this.v.slice();
998
+ return t.pop(), new e(t);
999
+ }
1000
+ elements() {
1001
+ return this.v.slice();
1002
+ }
1003
+ name() {
1004
+ return this.v.slice(-1)[0];
1005
+ }
1006
+ contains(t) {
1007
+ let r;
1008
+ if (t.length > this.length)
1009
+ return !1;
1010
+ for (r = 0; r < t.length; r += 1)
1011
+ if (this.v[r] !== t.v[r])
1012
+ return !1;
1013
+ return !0;
1014
+ }
1015
+ ancestorOf(t) {
1016
+ return t.contains(this) && t.length !== this.length;
1017
+ }
1018
+ descendantOf(t) {
1019
+ return this.contains(t) && t.length !== this.length;
1020
+ }
1021
+ commonPrefixPath(t) {
1022
+ let r = this.length > t.length ? t.length : this.length, s, n = [];
1023
+ for (s = 0; s < r && this.v[s] === t.v[s]; s += 1)
1024
+ n.push(this.v[s]);
1025
+ return new e(n);
1026
+ }
1027
+ static compare(t, r) {
1028
+ let s = t.length, n = r.length;
1029
+ if (s < n)
1030
+ return -1;
1031
+ if (s > n)
1032
+ return 1;
1033
+ let a = t.toString(), o = r.toString();
1034
+ return a < o ? -1 : a > o ? 1 : 0;
1035
+ }
1036
+ };
1037
+ ["push", "pop", "shift", "unshift", "splice"].forEach((e) => {
1038
+ Object.defineProperty(k.prototype, e, {
1039
+ value(...t) {
1040
+ return this.v[e](...t);
1041
+ }
1042
+ });
1043
+ });
1044
+ Object.defineProperty(k.prototype, "length", {
1045
+ enumerable: !0,
1046
+ get() {
1047
+ return this.v.length;
1048
+ }
1049
+ });
1050
+ Jt.exports = k;
1051
+ k.tester = {
1052
+ setParserAndSep(e, t) {
1053
+ $ = e, F = t;
1054
+ },
1055
+ reset() {
1056
+ $ = Re, F = Te;
1057
+ }
1058
+ };
1059
+ });
1060
+
1061
+ // ../../node_modules/istanbul-lib-report/lib/summarizer-factory.js
1062
+ var Zt = l((wr, Xt) => {
1063
+ "use strict";
1064
+ var Pe = Ut(), T = Ht(), { BaseNode: xe, BaseTree: _e } = H(), b = class e extends xe {
1065
+ static {
1066
+ i(this, "ReportNode");
1067
+ }
1068
+ constructor(t, r) {
1069
+ super(), this.path = t, this.parent = null, this.fileCoverage = r, this.children = [];
1070
+ }
1071
+ static createRoot(t) {
1072
+ let r = new e(new T([]));
1073
+ return t.forEach((s) => {
1074
+ r.addChild(s);
1075
+ }), r;
1076
+ }
1077
+ addChild(t) {
1078
+ t.parent = this, this.children.push(t);
1079
+ }
1080
+ asRelative(t) {
1081
+ return t.substring(0, 1) === "/" ? t.substring(1) : t;
1082
+ }
1083
+ getQualifiedName() {
1084
+ return this.asRelative(this.path.toString());
1085
+ }
1086
+ getRelativeName() {
1087
+ let t = this.getParent(), r = this.path, s, n, a = t ? t.path : new T([]);
1088
+ if (a.ancestorOf(r)) {
1089
+ for (s = new T(r.elements()), n = 0; n < a.length; n += 1)
1090
+ s.shift();
1091
+ return this.asRelative(s.toString());
1092
+ }
1093
+ return this.asRelative(this.path.toString());
1094
+ }
1095
+ getParent() {
1096
+ return this.parent;
1097
+ }
1098
+ getChildren() {
1099
+ return this.children;
1100
+ }
1101
+ isSummary() {
1102
+ return !this.fileCoverage;
1103
+ }
1104
+ getFileCoverage() {
1105
+ return this.fileCoverage;
1106
+ }
1107
+ getCoverageSummary(t) {
1108
+ let r = `c_${t ? "files" : "full"}`, s;
1109
+ if (Object.prototype.hasOwnProperty.call(this, r))
1110
+ return this[r];
1111
+ if (!this.isSummary())
1112
+ s = this.getFileCoverage().toSummary();
1113
+ else {
1114
+ let n = 0;
1115
+ s = Pe.createCoverageSummary(), this.getChildren().forEach((a) => {
1116
+ t && a.isSummary() || (n += 1, s.merge(a.getCoverageSummary(t)));
1117
+ }), n === 0 && t && (s = null);
1118
+ }
1119
+ return this[r] = s, s;
1120
+ }
1121
+ }, C = class extends _e {
1122
+ static {
1123
+ i(this, "ReportTree");
1124
+ }
1125
+ constructor(t, r) {
1126
+ super(t);
1127
+ let s = /* @__PURE__ */ i((n) => {
1128
+ r && !n.isRoot() && n.path.unshift(r);
1129
+ }, "maybePrefix");
1130
+ this.visit({
1131
+ onDetail: s,
1132
+ onSummary(n) {
1133
+ s(n), n.children.sort((a, o) => {
1134
+ let c = a.path.toString(), m = o.path.toString();
1135
+ return c < m ? -1 : c > m ? 1 : (
1136
+ /* istanbul ignore next */
1137
+ 0
1138
+ );
1139
+ });
1140
+ }
1141
+ });
1142
+ }
1143
+ };
1144
+ function Ie(e) {
1145
+ return e.reduce(
1146
+ (t, r) => t.commonPrefixPath(r),
1147
+ e[0] || new T([])
1148
+ );
1149
+ }
1150
+ i(Ie, "findCommonParent");
1151
+ function Kt(e, t, r = () => {
1152
+ }) {
1153
+ let s = t[e.toString()];
1154
+ return s || (s = new b(e), t[e.toString()] = s, r(e, s)), s;
1155
+ }
1156
+ i(Kt, "findOrCreateParent");
1157
+ function qe(e) {
1158
+ let t = /* @__PURE__ */ Object.create(null);
1159
+ return e.forEach((r) => {
1160
+ Kt(r.path.parent(), t).addChild(new b(r.path, r.fileCoverage));
1161
+ }), Object.values(t);
1162
+ }
1163
+ i(qe, "toDirParents");
1164
+ function Qt(e, t, r, s) {
1165
+ Kt(
1166
+ r.parent(),
1167
+ t,
1168
+ (a, o) => {
1169
+ a.hasParent() ? Qt(e, t, a, o) : e.push(o);
1170
+ }
1171
+ ).addChild(s);
1172
+ }
1173
+ i(Qt, "addAllPaths");
1174
+ function at(e, t) {
1175
+ let { children: r } = e;
1176
+ return r.length === 1 && !r[0].fileCoverage ? (r[0].parent = t, at(r[0], t)) : (e.children = r.map((s) => at(s, e)), e);
1177
+ }
1178
+ i(at, "foldIntoOneDir");
1179
+ function Le(e, t) {
1180
+ if (e.some((r) => r.path.length === 0))
1181
+ return t.length === 0 ? "root" : t.name();
1182
+ }
1183
+ i(Le, "pkgSummaryPrefix");
1184
+ var ot = class {
1185
+ static {
1186
+ i(this, "SummarizerFactory");
1187
+ }
1188
+ constructor(t, r = "pkg") {
1189
+ this._coverageMap = t, this._defaultSummarizer = r, this._initialList = t.files().map((s) => ({
1190
+ filePath: s,
1191
+ path: new T(s),
1192
+ fileCoverage: t.fileCoverageFor(s)
1193
+ })), this._commonParent = Ie(
1194
+ this._initialList.map((s) => s.path.parent())
1195
+ ), this._commonParent.length > 0 && this._initialList.forEach((s) => {
1196
+ s.path.splice(0, this._commonParent.length);
1197
+ });
1198
+ }
1199
+ get defaultSummarizer() {
1200
+ return this[this._defaultSummarizer];
1201
+ }
1202
+ get flat() {
1203
+ return this._flat || (this._flat = new C(
1204
+ b.createRoot(
1205
+ this._initialList.map(
1206
+ (t) => new b(t.path, t.fileCoverage)
1207
+ )
1208
+ )
1209
+ )), this._flat;
1210
+ }
1211
+ _createPkg() {
1212
+ let t = qe(this._initialList);
1213
+ return t.length === 1 ? new C(t[0]) : new C(
1214
+ b.createRoot(t),
1215
+ Le(t, this._commonParent)
1216
+ );
1217
+ }
1218
+ get pkg() {
1219
+ return this._pkg || (this._pkg = this._createPkg()), this._pkg;
1220
+ }
1221
+ _createNested() {
1222
+ let t = /* @__PURE__ */ Object.create(null), r = [];
1223
+ this._initialList.forEach((n) => {
1224
+ let a = new b(n.path, n.fileCoverage);
1225
+ Qt(r, t, n.path, a);
1226
+ });
1227
+ let s = r.map((n) => at(n));
1228
+ return s.length === 1 ? new C(s[0]) : new C(b.createRoot(s));
1229
+ }
1230
+ get nested() {
1231
+ return this._nested || (this._nested = this._createNested()), this._nested;
1232
+ }
1233
+ };
1234
+ Xt.exports = ot;
1235
+ });
1236
+
1237
+ // ../../node_modules/istanbul-lib-report/lib/context.js
1238
+ var ee = l((yr, te) => {
1239
+ "use strict";
1240
+ var $e = w("fs"), Fe = Ot(), Ne = Tt(), Ae = H(), De = K(), Ve = Zt();
1241
+ function ze(e) {
1242
+ try {
1243
+ return $e.readFileSync(e, "utf8");
1244
+ } catch (t) {
1245
+ throw new Error(`Unable to lookup source: ${e} (${t.message})`);
1246
+ }
1247
+ }
1248
+ i(ze, "defaultSourceLookup");
1249
+ function je(e = {}) {
1250
+ return Object.entries(De.getDefault()).forEach(([t, r]) => {
1251
+ let s = e[t];
1252
+ (!Array.isArray(s) || s.length !== 2) && (e[t] = r);
1253
+ }), e;
1254
+ }
1255
+ i(je, "normalizeWatermarks");
1256
+ var N = class {
1257
+ static {
1258
+ i(this, "Context");
1259
+ }
1260
+ constructor(t) {
1261
+ this.dir = t.dir || "coverage", this.watermarks = je(t.watermarks), this.sourceFinder = t.sourceFinder || ze, this._summarizerFactory = new Ve(
1262
+ t.coverageMap,
1263
+ t.defaultSummarizer
1264
+ ), this.data = {};
1265
+ }
1266
+ /**
1267
+ * returns a FileWriter implementation for reporting use. Also available
1268
+ * as the `writer` property on the context.
1269
+ * @returns {Writer}
1270
+ */
1271
+ getWriter() {
1272
+ return this.writer;
1273
+ }
1274
+ /**
1275
+ * returns the source code for the specified file path or throws if
1276
+ * the source could not be found.
1277
+ * @param {String} filePath the file path as found in a file coverage object
1278
+ * @returns {String} the source code
1279
+ */
1280
+ getSource(t) {
1281
+ return this.sourceFinder(t);
1282
+ }
1283
+ /**
1284
+ * returns the coverage class given a coverage
1285
+ * types and a percentage value.
1286
+ * @param {String} type - the coverage type, one of `statements`, `functions`,
1287
+ * `branches`, or `lines`
1288
+ * @param {Number} value - the percentage value
1289
+ * @returns {String} one of `high`, `medium` or `low`
1290
+ */
1291
+ classForPercent(t, r) {
1292
+ let s = this.watermarks[t];
1293
+ return s ? r < s[0] ? "low" : r >= s[1] ? "high" : "medium" : "unknown";
1294
+ }
1295
+ /**
1296
+ * returns an XML writer for the supplied content writer
1297
+ * @param {ContentWriter} contentWriter the content writer to which the returned XML writer
1298
+ * writes data
1299
+ * @returns {XMLWriter}
1300
+ */
1301
+ getXMLWriter(t) {
1302
+ return new Ne(t);
1303
+ }
1304
+ /**
1305
+ * returns a full visitor given a partial one.
1306
+ * @param {Object} partialVisitor a partial visitor only having the functions of
1307
+ * interest to the caller. These functions are called with a scope that is the
1308
+ * supplied object.
1309
+ * @returns {Visitor}
1310
+ */
1311
+ getVisitor(t) {
1312
+ return new Ae.Visitor(t);
1313
+ }
1314
+ getTree(t = "defaultSummarizer") {
1315
+ return this._summarizerFactory[t];
1316
+ }
1317
+ };
1318
+ Object.defineProperty(N.prototype, "writer", {
1319
+ enumerable: !0,
1320
+ get() {
1321
+ return this.data.writer || (this.data.writer = new Fe(this.dir)), this.data.writer;
1322
+ }
1323
+ });
1324
+ te.exports = N;
1325
+ });
1326
+
1327
+ // ../../node_modules/istanbul-lib-report/lib/report-base.js
1328
+ var ne = l((Er, se) => {
1329
+ "use strict";
1330
+ var re = Symbol("ReportBase.#summarizer"), ct = class {
1331
+ static {
1332
+ i(this, "ReportBase");
1333
+ }
1334
+ constructor(t = {}) {
1335
+ this[re] = t.summarizer;
1336
+ }
1337
+ execute(t) {
1338
+ t.getTree(this[re]).visit(this, t);
1339
+ }
1340
+ };
1341
+ se.exports = ct;
1342
+ });
1343
+
1344
+ // ../../node_modules/istanbul-lib-report/index.js
1345
+ var ae = l((Cr, ie) => {
1346
+ "use strict";
1347
+ var Be = ee(), We = K(), Ge = ne();
1348
+ ie.exports = {
1349
+ /**
1350
+ * returns a reporting context for the supplied options
1351
+ * @param {Object} [opts=null] opts
1352
+ * @returns {Context}
1353
+ */
1354
+ createContext(e) {
1355
+ return new Be(e);
1356
+ },
1357
+ /**
1358
+ * returns the default watermarks that would be used when not
1359
+ * overridden
1360
+ * @returns {Object} an object with `statements`, `functions`, `branches`,
1361
+ * and `line` keys. Each value is a 2 element array that has the low and
1362
+ * high watermark as percentages.
1363
+ */
1364
+ getDefaultWatermarks() {
1365
+ return We.getDefault();
1366
+ },
1367
+ /**
1368
+ * Base class for all reports
1369
+ */
1370
+ ReportBase: Ge
1371
+ };
1372
+ });
1373
+
1374
+ // src/node/coverage-reporter.ts
1375
+ var oe = ce(ae(), 1);
1376
+ var ut = class extends oe.ReportBase {
1377
+ static {
1378
+ i(this, "StorybookCoverageReporter");
1379
+ }
1380
+ #t;
1381
+ #e;
1382
+ constructor(t) {
1383
+ super(), this.#t = t.testManager, this.#e = t.coverageOptions;
1384
+ }
1385
+ onSummary(t) {
1386
+ if (!t.isRoot())
1387
+ return;
1388
+ let r = t.getCoverageSummary(!1), s = Math.round(r.data.statements.pct), [n = 50, a = 80] = this.#e?.watermarks?.statements ?? [], o = {
1389
+ percentage: s,
1390
+ status: s < n ? "negative" : s < a ? "warning" : "positive"
1391
+ };
1392
+ this.#t.onCoverageCollected(o);
1393
+ }
1394
+ };
1395
+ export {
1396
+ ut as default
1397
+ };