@storybook/addon-vitest 9.1.0-alpha.6 → 9.1.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manager.js +2 -2
- package/dist/node/coverage-reporter.js +1 -1
- package/dist/node/coverage-reporter.mjs +1 -1
- package/dist/postinstall.js +45 -43
- package/dist/vitest-plugin/index.js +1 -1
- package/dist/vitest-plugin/index.mjs +1 -1
- package/package.json +5 -5
- package/templates/vitest.config.3.2.template.ts +30 -0
package/dist/manager.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React3, { useState, useContext, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
2
2
|
import { Addon_TypesEnum } from 'storybook/internal/types';
|
|
3
3
|
import { experimental_UniversalStore, experimental_getStatusStore, experimental_getTestProviderStore, addons, useStorybookApi, experimental_useTestProviderStore, experimental_useUniversalStore, experimental_useStatusStore } from 'storybook/manager-api';
|
|
4
|
-
import { Modal, ProgressSpinner, Button, IconButton, WithTooltip, TooltipNote, ListItem,
|
|
4
|
+
import { Modal, ProgressSpinner, Button, IconButton, WithTooltip, TooltipNote, ListItem, Form, Link } from 'storybook/internal/components';
|
|
5
5
|
import { StopAltIcon, SyncIcon, CloseIcon, EyeIcon, PlayHollowIcon, InfoIcon } from '@storybook/icons';
|
|
6
6
|
import { styled } from 'storybook/theming';
|
|
7
7
|
|
|
8
|
-
var ADDON_ID="storybook/interactions",PANEL_ID=`${ADDON_ID}/panel`;var ADDON_ID2="storybook/a11y",PANEL_ID2=`${ADDON_ID2}/panel`;var ADDON_ID3="storybook/test",TEST_PROVIDER_ID=`${ADDON_ID3}/test-provider`;var DOCUMENTATION_LINK3="writing-tests/integrations/vitest-addon",DOCUMENTATION_FATAL_ERROR_LINK=`${DOCUMENTATION_LINK3}#what-happens-if-vitest-itself-has-an-error`;var storeOptions={id:ADDON_ID3,initialState:{config:{coverage:!1,a11y:!1},watching:!1,cancelling:!1,fatalError:void 0,indexUrl:void 0,previewAnnotations:[],currentRun:{triggeredBy:void 0,config:{coverage:!1,a11y:!1},componentTestCount:{success:0,error:0},a11yCount:{success:0,warning:0,error:0},storyIds:void 0,totalTestCount:void 0,startedAt:void 0,finishedAt:void 0,unhandledErrors:[],coverageSummary:void 0}}},FULL_RUN_TRIGGERS=["global","run-all"];var STATUS_TYPE_ID_COMPONENT_TEST="storybook/component-test",STATUS_TYPE_ID_A11Y="storybook/a11y";var store=experimental_UniversalStore.create({...storeOptions,leader:globalThis.CONFIG_TYPE==="PRODUCTION"}),componentTestStatusStore=experimental_getStatusStore(STATUS_TYPE_ID_COMPONENT_TEST),a11yStatusStore=experimental_getStatusStore(STATUS_TYPE_ID_A11Y),testProviderStore=experimental_getTestProviderStore(ADDON_ID3);var ModalBar=styled.div({display:"flex",justifyContent:"space-between",alignItems:"center",padding:"6px 6px 6px 20px"}),ModalActionBar=styled.div({display:"flex",justifyContent:"space-between",alignItems:"center"}),ModalTitle=styled(Modal.Title)(({theme:{typography}})=>({fontSize:typography.size.s2,fontWeight:typography.weight.bold})),ModalStackTrace=styled.pre(({theme})=>({whiteSpace:"pre-wrap",wordWrap:"break-word",overflow:"auto",maxHeight:"60vh",margin:0,padding:"20px",fontFamily:theme.typography.fonts.mono,fontSize:"12px",borderTop:`1px solid ${theme.appBorderColor}`,borderRadius:0})),TroubleshootLink=styled.a(({theme})=>({color:theme.color.defaultText})),GlobalErrorContext=React3.createContext({isModalOpen:!1,setModalOpen:void 0});function ErrorCause({error}){return error?React3.createElement("div",null,React3.createElement("h4",null,"Caused by: ",error.name||"Error",": ",error.message),error.stack&&React3.createElement("pre",null,error.stack),error.cause&&React3.createElement(ErrorCause,{error:error.cause})):null}function GlobalErrorModal({onRerun,storeState}){let api=useStorybookApi(),{isModalOpen,setModalOpen}=useContext(GlobalErrorContext),handleClose=()=>setModalOpen?.(!1),troubleshootURL=api.getDocsUrl({subpath:DOCUMENTATION_FATAL_ERROR_LINK,versioned:!0,renderer:!0}),{fatalError,currentRun:{unhandledErrors}}=storeState,content=fatalError?React3.createElement(React3.Fragment,null,React3.createElement("p",null,fatalError.error.name||"Error"),fatalError.message&&React3.createElement("p",null,fatalError.message),fatalError.error.message&&React3.createElement("p",null,fatalError.error.message),fatalError.error.stack&&React3.createElement("p",null,fatalError.error.stack),fatalError.error.cause&&React3.createElement(ErrorCause,{error:fatalError.error.cause})):unhandledErrors.length>0?React3.createElement("ol",null,unhandledErrors.map(error=>React3.createElement("li",{key:error.name+error.message},React3.createElement("p",null,error.name,": ",error.message),error.VITEST_TEST_PATH&&React3.createElement("p",null,'This error originated in "',React3.createElement("b",null,error.VITEST_TEST_PATH),`". It doesn't mean the error was thrown inside the file itself, but while it was running.`),error.VITEST_TEST_NAME&&React3.createElement(React3.Fragment,null,React3.createElement("p",null,`The latest test that might've caused the error is "`,React3.createElement("b",null,error.VITEST_TEST_NAME),'". It might mean one of the following:'),React3.createElement("ul",null,React3.createElement("li",null,"The error was thrown, while Vitest was running this test."),React3.createElement("li",null,"If the error occurred after the test had been completed, this was the last documented test before it was thrown."))),error.stacks&&React3.createElement(React3.Fragment,null,React3.createElement("p",null,React3.createElement("b",null,"Stacks:")),React3.createElement("ul",null,error.stacks.map(stack=>React3.createElement("li",{key:stack.file+stack.line+stack.column},stack.file,":",stack.line,":",stack.column," - ",stack.method||"unknown method")))),error.stack&&React3.createElement("p",null,error.stack),error.cause?React3.createElement(ErrorCause,{error:error.cause}):null))):null;return React3.createElement(Modal,{onEscapeKeyDown:handleClose,onInteractOutside:handleClose,open:isModalOpen},React3.createElement(ModalBar,null,React3.createElement(ModalTitle,null,"Storybook Tests error details"),React3.createElement(ModalActionBar,null,React3.createElement(Button,{onClick:onRerun,variant:"ghost"},React3.createElement(SyncIcon,null),"Rerun"),React3.createElement(Button,{variant:"ghost",asChild:!0},React3.createElement("a",{target:"_blank",href:troubleshootURL,rel:"noreferrer"},"Troubleshoot")),React3.createElement(IconButton,{onClick:handleClose,"aria-label":"Close modal"},React3.createElement(CloseIcon,null)))),React3.createElement(ModalStackTrace,null,content,React3.createElement("br",null),React3.createElement("br",null),"Troubleshoot:"," ",React3.createElement(TroubleshootLink,{target:"_blank",href:troubleshootURL},troubleshootURL)))}function noop(){}function getSymbols(object){return Object.getOwnPropertySymbols(object).filter(symbol=>Object.prototype.propertyIsEnumerable.call(object,symbol))}function getTag(value){return value==null?value===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(value)}var regexpTag="[object RegExp]",stringTag="[object String]",numberTag="[object Number]",booleanTag="[object Boolean]",argumentsTag="[object Arguments]",symbolTag="[object Symbol]",dateTag="[object Date]",mapTag="[object Map]",setTag="[object Set]",arrayTag="[object Array]",functionTag="[object Function]",arrayBufferTag="[object ArrayBuffer]",objectTag="[object Object]",errorTag="[object Error]",dataViewTag="[object DataView]",uint8ArrayTag="[object Uint8Array]",uint8ClampedArrayTag="[object Uint8ClampedArray]",uint16ArrayTag="[object Uint16Array]",uint32ArrayTag="[object Uint32Array]",bigUint64ArrayTag="[object BigUint64Array]",int8ArrayTag="[object Int8Array]",int16ArrayTag="[object Int16Array]",int32ArrayTag="[object Int32Array]",bigInt64ArrayTag="[object BigInt64Array]",float32ArrayTag="[object Float32Array]",float64ArrayTag="[object Float64Array]";function isPlainObject(value){if(!value||typeof value!="object")return !1;let proto=Object.getPrototypeOf(value);return proto===null||proto===Object.prototype||Object.getPrototypeOf(proto)===null?Object.prototype.toString.call(value)==="[object Object]":!1}function eq(value,other){return value===other||Number.isNaN(value)&&Number.isNaN(other)}function isEqualWith(a,b,areValuesEqual){return isEqualWithImpl(a,b,void 0,void 0,void 0,void 0,areValuesEqual)}function isEqualWithImpl(a,b,property,aParent,bParent,stack,areValuesEqual){let result=areValuesEqual(a,b,property,aParent,bParent,stack);if(result!==void 0)return result;if(typeof a==typeof b)switch(typeof a){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return a===b;case"number":return a===b||Object.is(a,b);case"function":return a===b;case"object":return areObjectsEqual(a,b,stack,areValuesEqual)}return areObjectsEqual(a,b,stack,areValuesEqual)}function areObjectsEqual(a,b,stack,areValuesEqual){if(Object.is(a,b))return !0;let aTag=getTag(a),bTag=getTag(b);if(aTag===argumentsTag&&(aTag=objectTag),bTag===argumentsTag&&(bTag=objectTag),aTag!==bTag)return !1;switch(aTag){case stringTag:return a.toString()===b.toString();case numberTag:{let x=a.valueOf(),y=b.valueOf();return eq(x,y)}case booleanTag:case dateTag:case symbolTag:return Object.is(a.valueOf(),b.valueOf());case regexpTag:return a.source===b.source&&a.flags===b.flags;case functionTag:return a===b}stack=stack??new Map;let aStack=stack.get(a),bStack=stack.get(b);if(aStack!=null&&bStack!=null)return aStack===b;stack.set(a,b),stack.set(b,a);try{switch(aTag){case mapTag:{if(a.size!==b.size)return !1;for(let[key,value]of a.entries())if(!b.has(key)||!isEqualWithImpl(value,b.get(key),key,a,b,stack,areValuesEqual))return !1;return !0}case setTag:{if(a.size!==b.size)return !1;let aValues=Array.from(a.values()),bValues=Array.from(b.values());for(let i=0;i<aValues.length;i++){let aValue=aValues[i],index=bValues.findIndex(bValue=>isEqualWithImpl(aValue,bValue,void 0,a,b,stack,areValuesEqual));if(index===-1)return !1;bValues.splice(index,1);}return !0}case arrayTag:case uint8ArrayTag:case uint8ClampedArrayTag:case uint16ArrayTag:case uint32ArrayTag:case bigUint64ArrayTag:case int8ArrayTag:case int16ArrayTag:case int32ArrayTag:case bigInt64ArrayTag:case float32ArrayTag:case float64ArrayTag:{if(typeof Buffer<"u"&&Buffer.isBuffer(a)!==Buffer.isBuffer(b)||a.length!==b.length)return !1;for(let i=0;i<a.length;i++)if(!isEqualWithImpl(a[i],b[i],i,a,b,stack,areValuesEqual))return !1;return !0}case arrayBufferTag:return a.byteLength!==b.byteLength?!1:areObjectsEqual(new Uint8Array(a),new Uint8Array(b),stack,areValuesEqual);case dataViewTag:return a.byteLength!==b.byteLength||a.byteOffset!==b.byteOffset?!1:areObjectsEqual(new Uint8Array(a),new Uint8Array(b),stack,areValuesEqual);case errorTag:return a.name===b.name&&a.message===b.message;case objectTag:{if(!(areObjectsEqual(a.constructor,b.constructor,stack,areValuesEqual)||isPlainObject(a)&&isPlainObject(b)))return !1;let aKeys=[...Object.keys(a),...getSymbols(a)],bKeys=[...Object.keys(b),...getSymbols(b)];if(aKeys.length!==bKeys.length)return !1;for(let i=0;i<aKeys.length;i++){let propKey=aKeys[i],aProp=a[propKey];if(!Object.hasOwn(b,propKey))return !1;let bProp=b[propKey];if(!isEqualWithImpl(aProp,bProp,propKey,a,b,stack,areValuesEqual))return !1}return !0}default:return !1}}finally{stack.delete(a),stack.delete(b);}}function isEqual(a,b){return isEqualWith(a,b,noop)}var statusValueToStoryIds=(allStatuses,typeId,storyIds)=>{let statusValueToStoryIdsMap={"status-value:pending":[],"status-value:success":[],"status-value:error":[],"status-value:warning":[],"status-value:unknown":[]};return (storyIds?storyIds.map(storyId=>allStatuses[storyId]).filter(Boolean):Object.values(allStatuses)).forEach(statusByTypeId=>{let status=statusByTypeId[typeId];status&&statusValueToStoryIdsMap[status.value].push(status.storyId);}),statusValueToStoryIdsMap},useTestProvider=(api,entryId)=>{let testProviderState=experimental_useTestProviderStore(s=>s[ADDON_ID3]),[storeState,setStoreState]=experimental_useUniversalStore(store),[isSettingsUpdated,setIsSettingsUpdated]=useState(!1),settingsUpdatedTimeoutRef=useRef();useEffect(()=>{let unsubscribe=store.onStateChange((state,previousState)=>{isEqual(state.config,previousState.config)||(testProviderStore.settingsChanged(),setIsSettingsUpdated(!0),clearTimeout(settingsUpdatedTimeoutRef.current),settingsUpdatedTimeoutRef.current=setTimeout(()=>{setIsSettingsUpdated(!1);},1e3));});return ()=>{unsubscribe(),clearTimeout(settingsUpdatedTimeoutRef.current);}},[]);let storyIds=useMemo(()=>entryId?api.findAllLeafStoryIds(entryId):void 0,[entryId,api]),componentTestStatusSelector=useCallback(allStatuses=>statusValueToStoryIds(allStatuses,STATUS_TYPE_ID_COMPONENT_TEST,storyIds),[storyIds]),componentTestStatusValueToStoryIds=experimental_useStatusStore(componentTestStatusSelector),a11yStatusValueToStoryIdsSelector=useCallback(allStatuses=>statusValueToStoryIds(allStatuses,STATUS_TYPE_ID_A11Y,storyIds),[storyIds]),a11yStatusValueToStoryIds=experimental_useStatusStore(a11yStatusValueToStoryIdsSelector);return {storeState,setStoreState,testProviderState,componentTestStatusValueToStoryIds,a11yStatusValueToStoryIds,isSettingsUpdated}};var RelativeTime=({timestamp})=>{let[timeAgo,setTimeAgo]=useState(null);if(useEffect(()=>{if(timestamp){setTimeAgo(Date.now()-timestamp);let interval=setInterval(()=>setTimeAgo(Date.now()-timestamp),1e4);return ()=>clearInterval(interval)}},[timestamp]),timeAgo===null)return null;let seconds=Math.round(timeAgo/1e3);if(seconds<60)return "just now";let minutes=Math.floor(seconds/60);if(minutes<60)return minutes===1?"a minute ago":`${minutes} minutes ago`;let hours=Math.floor(minutes/60);if(hours<24)return hours===1?"an hour ago":`${hours} hours ago`;let days=Math.floor(hours/24);return days===1?"yesterday":`${days} days ago`};var Wrapper=styled.div(({theme})=>({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:theme.typography.size.s1,color:theme.textMutedColor})),PositiveText=styled.span(({theme})=>({color:theme.color.positiveText}));function Description({entryId,storeState,testProviderState,isSettingsUpdated,...props}){let{setModalOpen}=React3.useContext(GlobalErrorContext),{componentTestCount,totalTestCount,unhandledErrors,finishedAt}=storeState.currentRun,finishedTestCount=componentTestCount.success+componentTestCount.error,description="Not run";if(!entryId&&isSettingsUpdated)description=React3.createElement(PositiveText,null,"Settings updated");else if(testProviderState==="test-provider-state:running")description=(finishedTestCount??0)===0?"Starting...":`Testing... ${finishedTestCount}/${totalTestCount}`;else if(!entryId&&testProviderState==="test-provider-state:crashed")description=setModalOpen?React3.createElement(Link,{isButton:!0,onClick:()=>setModalOpen(!0)},"View full error"):"Crashed";else if(!entryId&&unhandledErrors.length>0){let unhandledErrorDescription=`View ${unhandledErrors.length} unhandled error${unhandledErrors?.length>1?"s":""}`;description=setModalOpen?React3.createElement(Link,{isButton:!0,onClick:()=>setModalOpen(!0)},unhandledErrorDescription):unhandledErrorDescription;}else entryId&&totalTestCount?description=`Ran ${totalTestCount} ${totalTestCount===1?"test":"tests"}`:finishedAt?description=React3.createElement(React3.Fragment,null,"Ran ",totalTestCount," ",totalTestCount===1?"test":"tests"," ",React3.createElement(RelativeTime,{timestamp:finishedAt})):storeState.watching&&(description="Watching for file changes");return React3.createElement(Wrapper,{...props},description)}var TestStatusIcon=styled.div(({percentage})=>({width:percentage?12:6,height:percentage?12:6,margin:percentage?1:4,background:percentage?`conic-gradient(var(--status-color) ${percentage}%, var(--status-background) ${percentage+1}%)`:"var(--status-color)",borderRadius:"50%"}),({isRunning,theme})=>isRunning&&{animation:`${theme.animation.glow} 1.5s ease-in-out infinite`},({status,theme})=>status==="positive"&&{"--status-color":theme.color.positive,"--status-background":`${theme.color.positive}66`},({status,theme})=>status==="warning"&&{"--status-color":theme.color.gold,"--status-background":`${theme.color.gold}66`},({status,theme})=>status==="negative"&&{"--status-color":theme.color.negative,"--status-background":`${theme.color.negative}66`},({status,theme})=>status==="critical"&&{"--status-color":theme.color.defaultText,"--status-background":`${theme.color.defaultText}66`},({status,theme})=>status==="unknown"&&{"--status-color":theme.color.mediumdark,"--status-background":`${theme.color.mediumdark}66`});var Container=styled.div({display:"flex",flexDirection:"column"}),Heading=styled.div({display:"flex",justifyContent:"space-between",padding:"8px 0",gap:12}),Info=styled.div({display:"flex",flexDirection:"column",marginLeft:8,minWidth:0}),Title=styled.div(({crashed,theme})=>({fontSize:theme.typography.size.s1,fontWeight:crashed?"bold":"normal",color:crashed?theme.color.negativeText:theme.color.defaultText})),Actions=styled.div({display:"flex",gap:4}),Extras=styled.div({marginBottom:2}),Muted=styled.span(({theme})=>({color:theme.textMutedColor})),Progress=styled(ProgressSpinner)({margin:4}),Row=styled.div({display:"flex",gap:4}),StopIcon=styled(StopAltIcon)({width:10}),openPanel=({api,panelId,entryId})=>{let story=entryId?api.findAllLeafStoryIds(entryId)[0]:void 0;story&&api.selectStory(story),api.setSelectedPanel(panelId),api.togglePanel(!0);},TestProviderRender=({api,entry,testProviderState,storeState,setStoreState,componentTestStatusValueToStoryIds,a11yStatusValueToStoryIds,isSettingsUpdated,...props})=>{let{config,watching,cancelling,currentRun,fatalError}=storeState,finishedTestCount=currentRun.componentTestCount.success+currentRun.componentTestCount.error,hasA11yAddon=addons.experimental_getRegisteredAddons().includes(ADDON_ID2),isRunning=testProviderState==="test-provider-state:running",isStarting=isRunning&&finishedTestCount===0,[componentTestStatusIcon,componentTestStatusLabel]=fatalError?["critical","Component tests crashed"]:componentTestStatusValueToStoryIds["status-value:error"].length>0?["negative","Component tests failed"]:isRunning?["unknown","Testing in progress"]:componentTestStatusValueToStoryIds["status-value:success"].length>0?["positive","Component tests passed"]:["unknown","Run tests to see results"],[a11yStatusIcon,a11yStatusLabel]=fatalError?["critical","Component tests crashed"]:a11yStatusValueToStoryIds["status-value:error"].length>0?["negative","Accessibility tests failed"]:a11yStatusValueToStoryIds["status-value:warning"].length>0?["warning","Accessibility tests failed"]:isRunning?["unknown","Testing in progress"]:a11yStatusValueToStoryIds["status-value:success"].length>0?["positive","Accessibility tests passed"]:["unknown","Run tests to see accessibility results"];return React3.createElement(Container,{...props},React3.createElement(Heading,null,React3.createElement(Info,null,entry?React3.createElement(Title,{id:"testing-module-title"},"Run component tests"):React3.createElement(Title,{id:"testing-module-title",crashed:testProviderState==="test-provider-state:crashed"||fatalError!==void 0||currentRun.unhandledErrors.length>0},currentRun.unhandledErrors.length===1?"Component tests completed with an error":currentRun.unhandledErrors.length>1?"Component tests completed with errors":fatalError?"Component tests didn\u2019t complete":"Run component tests"),React3.createElement(Description,{id:"testing-module-description",storeState,testProviderState,entryId:entry?.id,isSettingsUpdated})),React3.createElement(Actions,null,!entry&&React3.createElement(WithTooltip,{hasChrome:!1,trigger:"hover",tooltip:React3.createElement(TooltipNote,{note:`${watching?"Disable":"Enable"} watch mode`})},React3.createElement(IconButton,{"aria-label":`${watching?"Disable":"Enable"} watch mode`,size:"medium",active:watching,onClick:()=>store.send({type:"TOGGLE_WATCHING",payload:{to:!watching}}),disabled:isRunning},React3.createElement(EyeIcon,null))),isRunning?React3.createElement(WithTooltip,{hasChrome:!1,trigger:"hover",tooltip:React3.createElement(TooltipNote,{note:cancelling?"Stopping...":"Stop test run"})},React3.createElement(IconButton,{"aria-label":cancelling?"Stopping...":"Stop test run",padding:"none",size:"medium",onClick:()=>store.send({type:"CANCEL_RUN"}),disabled:cancelling||isStarting},React3.createElement(Progress,{percentage:finishedTestCount&&storeState.currentRun.totalTestCount?finishedTestCount/storeState.currentRun.totalTestCount*100:void 0},React3.createElement(StopIcon,null)))):React3.createElement(WithTooltip,{hasChrome:!1,trigger:"hover",tooltip:React3.createElement(TooltipNote,{note:"Start test run"})},React3.createElement(IconButton,{"aria-label":"Start test run",size:"medium",onClick:()=>store.send({type:"TRIGGER_RUN",payload:{storyIds:entry?api.findAllLeafStoryIds(entry.id):void 0,triggeredBy:entry?entry.type:"global"}})},React3.createElement(PlayHollowIcon,null))))),React3.createElement(Extras,null,React3.createElement(Row,null,React3.createElement(ListItem,{as:"label",title:"Interactions",icon:entry?null:React3.createElement(Checkbox,{checked:!0,disabled:!0})}),React3.createElement(WithTooltip,{hasChrome:!1,trigger:"hover",tooltip:React3.createElement(TooltipNote,{note:componentTestStatusLabel})},React3.createElement(IconButton,{size:"medium",disabled:componentTestStatusValueToStoryIds["status-value:error"].length===0&&componentTestStatusValueToStoryIds["status-value:warning"].length===0&&componentTestStatusValueToStoryIds["status-value:success"].length===0,onClick:()=>{openPanel({api,panelId:PANEL_ID,entryId:componentTestStatusValueToStoryIds["status-value:error"][0]??componentTestStatusValueToStoryIds["status-value:warning"][0]??componentTestStatusValueToStoryIds["status-value:success"][0]??entry?.id});}},React3.createElement(TestStatusIcon,{status:componentTestStatusIcon,"aria-label":componentTestStatusLabel,isRunning}),componentTestStatusValueToStoryIds["status-value:error"].length+componentTestStatusValueToStoryIds["status-value:warning"].length||null))),!entry&&React3.createElement(Row,null,React3.createElement(ListItem,{as:"label",title:watching?React3.createElement(Muted,null,"Coverage (unavailable)"):"Coverage",icon:React3.createElement(Checkbox,{checked:config.coverage,disabled:isRunning,onChange:()=>setStoreState(s=>({...s,config:{...s.config,coverage:!config.coverage}}))})}),React3.createElement(WithTooltip,{hasChrome:!1,trigger:"hover",tooltip:React3.createElement(TooltipNote,{note:watching?"Unavailable in watch mode":currentRun.triggeredBy&&!FULL_RUN_TRIGGERS.includes(currentRun.triggeredBy)?"Unavailable when running focused tests":isRunning?"Testing in progress":currentRun.coverageSummary?"View coverage report":fatalError?"Component tests crashed":"Run tests to calculate coverage"})},watching||currentRun.triggeredBy&&!FULL_RUN_TRIGGERS.includes(currentRun.triggeredBy)?React3.createElement(IconButton,{size:"medium",disabled:!0},React3.createElement(InfoIcon,{"aria-label":watching?"Coverage is unavailable in watch mode":"Coverage is unavailable when running focused tests"})):currentRun.coverageSummary?React3.createElement(IconButton,{asChild:!0,size:"medium"},React3.createElement("a",{href:"/coverage/index.html",target:"_blank","aria-label":"Open coverage report"},React3.createElement(TestStatusIcon,{isRunning,percentage:currentRun.coverageSummary.percentage,status:currentRun.coverageSummary.status,"aria-label":`Coverage status: ${currentRun.coverageSummary.status}`}),React3.createElement("span",{"aria-label":`${currentRun.coverageSummary.percentage} percent coverage`},currentRun.coverageSummary.percentage,"%"))):React3.createElement(IconButton,{size:"medium",disabled:!0},React3.createElement(TestStatusIcon,{isRunning,status:fatalError?"critical":"unknown","aria-label":"Coverage status: unknown"})))),hasA11yAddon&&React3.createElement(Row,null,React3.createElement(ListItem,{as:"label",title:"Accessibility",icon:entry?null:React3.createElement(Checkbox,{checked:config.a11y,disabled:isRunning,onChange:()=>setStoreState(s=>({...s,config:{...s.config,a11y:!config.a11y}}))})}),React3.createElement(WithTooltip,{hasChrome:!1,trigger:"hover",tooltip:React3.createElement(TooltipNote,{note:a11yStatusLabel})},React3.createElement(IconButton,{size:"medium",disabled:a11yStatusValueToStoryIds["status-value:error"].length===0&&a11yStatusValueToStoryIds["status-value:warning"].length===0&&a11yStatusValueToStoryIds["status-value:success"].length===0,onClick:()=>{openPanel({api,entryId:a11yStatusValueToStoryIds["status-value:error"][0]??a11yStatusValueToStoryIds["status-value:warning"][0]??a11yStatusValueToStoryIds["status-value:success"][0]??entry?.id,panelId:PANEL_ID2});}},React3.createElement(TestStatusIcon,{status:a11yStatusIcon,"aria-label":a11yStatusLabel,isRunning}),a11yStatusValueToStoryIds["status-value:error"].length+a11yStatusValueToStoryIds["status-value:warning"].length||null)))))};var SidebarContextMenu=({context,api})=>{let{testProviderState,componentTestStatusValueToStoryIds,a11yStatusValueToStoryIds,storeState,setStoreState}=useTestProvider(api,context.id);return React3.createElement(TestProviderRender,{api,entry:context,style:{minWidth:240},testProviderState,componentTestStatusValueToStoryIds,a11yStatusValueToStoryIds,storeState,setStoreState,isSettingsUpdated:!1})};addons.register(ADDON_ID3,api=>{if((globalThis.STORYBOOK_BUILDER||"").includes("vite")){let openPanel2=panelId=>{api.setSelectedPanel(panelId),api.togglePanel(!0);};componentTestStatusStore.onSelect(()=>{openPanel2(PANEL_ID);}),a11yStatusStore.onSelect(()=>{openPanel2(PANEL_ID2);}),testProviderStore.onRunAll(()=>{store.send({type:"TRIGGER_RUN",payload:{triggeredBy:"run-all"}});}),store.untilReady().then(()=>{store.setState(state=>({...state,indexUrl:new URL("index.json",window.location.href).toString()}));}),addons.add(TEST_PROVIDER_ID,{type:Addon_TypesEnum.experimental_TEST_PROVIDER,render:()=>{let[isModalOpen,setModalOpen]=useState(!1),{storeState,setStoreState,testProviderState,componentTestStatusValueToStoryIds,a11yStatusValueToStoryIds,isSettingsUpdated}=useTestProvider(api);return React3.createElement(GlobalErrorContext.Provider,{value:{isModalOpen,setModalOpen}},React3.createElement(TestProviderRender,{api,storeState,setStoreState,isSettingsUpdated,testProviderState,componentTestStatusValueToStoryIds,a11yStatusValueToStoryIds}),React3.createElement(GlobalErrorModal,{storeState,onRerun:()=>{setModalOpen(!1),store.send({type:"TRIGGER_RUN",payload:{triggeredBy:"global"}});}}))},sidebarContextMenu:({context})=>context.type==="docs"||context.type==="story"&&!context.tags.includes("test")?null:React3.createElement(SidebarContextMenu,{context,api})});}});
|
|
8
|
+
var ADDON_ID="storybook/interactions",PANEL_ID=`${ADDON_ID}/panel`;var ADDON_ID2="storybook/a11y",PANEL_ID2=`${ADDON_ID2}/panel`;var ADDON_ID3="storybook/test",TEST_PROVIDER_ID=`${ADDON_ID3}/test-provider`;var DOCUMENTATION_LINK3="writing-tests/integrations/vitest-addon",DOCUMENTATION_FATAL_ERROR_LINK=`${DOCUMENTATION_LINK3}#what-happens-if-vitest-itself-has-an-error`;var storeOptions={id:ADDON_ID3,initialState:{config:{coverage:!1,a11y:!1},watching:!1,cancelling:!1,fatalError:void 0,indexUrl:void 0,previewAnnotations:[],currentRun:{triggeredBy:void 0,config:{coverage:!1,a11y:!1},componentTestCount:{success:0,error:0},a11yCount:{success:0,warning:0,error:0},storyIds:void 0,totalTestCount:void 0,startedAt:void 0,finishedAt:void 0,unhandledErrors:[],coverageSummary:void 0}}},FULL_RUN_TRIGGERS=["global","run-all"];var STATUS_TYPE_ID_COMPONENT_TEST="storybook/component-test",STATUS_TYPE_ID_A11Y="storybook/a11y";var store=experimental_UniversalStore.create({...storeOptions,leader:globalThis.CONFIG_TYPE==="PRODUCTION"}),componentTestStatusStore=experimental_getStatusStore(STATUS_TYPE_ID_COMPONENT_TEST),a11yStatusStore=experimental_getStatusStore(STATUS_TYPE_ID_A11Y),testProviderStore=experimental_getTestProviderStore(ADDON_ID3);var ModalBar=styled.div({display:"flex",justifyContent:"space-between",alignItems:"center",padding:"6px 6px 6px 20px"}),ModalActionBar=styled.div({display:"flex",justifyContent:"space-between",alignItems:"center"}),ModalTitle=styled(Modal.Title)(({theme:{typography}})=>({fontSize:typography.size.s2,fontWeight:typography.weight.bold})),ModalStackTrace=styled.pre(({theme})=>({whiteSpace:"pre-wrap",wordWrap:"break-word",overflow:"auto",maxHeight:"60vh",margin:0,padding:"20px",fontFamily:theme.typography.fonts.mono,fontSize:"12px",borderTop:`1px solid ${theme.appBorderColor}`,borderRadius:0})),TroubleshootLink=styled.a(({theme})=>({color:theme.color.defaultText})),GlobalErrorContext=React3.createContext({isModalOpen:!1,setModalOpen:void 0});function ErrorCause({error}){return error?React3.createElement("div",null,React3.createElement("h4",null,"Caused by: ",error.name||"Error",": ",error.message),error.stack&&React3.createElement("pre",null,error.stack),error.cause&&React3.createElement(ErrorCause,{error:error.cause})):null}function GlobalErrorModal({onRerun,storeState}){let api=useStorybookApi(),{isModalOpen,setModalOpen}=useContext(GlobalErrorContext),handleClose=()=>setModalOpen?.(!1),troubleshootURL=api.getDocsUrl({subpath:DOCUMENTATION_FATAL_ERROR_LINK,versioned:!0,renderer:!0}),{fatalError,currentRun:{unhandledErrors}}=storeState,content=fatalError?React3.createElement(React3.Fragment,null,React3.createElement("p",null,fatalError.error.name||"Error"),fatalError.message&&React3.createElement("p",null,fatalError.message),fatalError.error.message&&React3.createElement("p",null,fatalError.error.message),fatalError.error.stack&&React3.createElement("p",null,fatalError.error.stack),fatalError.error.cause&&React3.createElement(ErrorCause,{error:fatalError.error.cause})):unhandledErrors.length>0?React3.createElement("ol",null,unhandledErrors.map(error=>React3.createElement("li",{key:error.name+error.message},React3.createElement("p",null,error.name,": ",error.message),error.VITEST_TEST_PATH&&React3.createElement("p",null,'This error originated in "',React3.createElement("b",null,error.VITEST_TEST_PATH),`". It doesn't mean the error was thrown inside the file itself, but while it was running.`),error.VITEST_TEST_NAME&&React3.createElement(React3.Fragment,null,React3.createElement("p",null,`The latest test that might've caused the error is "`,React3.createElement("b",null,error.VITEST_TEST_NAME),'". It might mean one of the following:'),React3.createElement("ul",null,React3.createElement("li",null,"The error was thrown, while Vitest was running this test."),React3.createElement("li",null,"If the error occurred after the test had been completed, this was the last documented test before it was thrown."))),error.stacks&&React3.createElement(React3.Fragment,null,React3.createElement("p",null,React3.createElement("b",null,"Stacks:")),React3.createElement("ul",null,error.stacks.map(stack=>React3.createElement("li",{key:stack.file+stack.line+stack.column},stack.file,":",stack.line,":",stack.column," - ",stack.method||"unknown method")))),error.stack&&React3.createElement("p",null,error.stack),error.cause?React3.createElement(ErrorCause,{error:error.cause}):null))):null;return React3.createElement(Modal,{onEscapeKeyDown:handleClose,onInteractOutside:handleClose,open:isModalOpen},React3.createElement(ModalBar,null,React3.createElement(ModalTitle,null,"Storybook Tests error details"),React3.createElement(ModalActionBar,null,React3.createElement(Button,{onClick:onRerun,variant:"ghost"},React3.createElement(SyncIcon,null),"Rerun"),React3.createElement(Button,{variant:"ghost",asChild:!0},React3.createElement("a",{target:"_blank",href:troubleshootURL,rel:"noreferrer"},"Troubleshoot")),React3.createElement(IconButton,{onClick:handleClose,"aria-label":"Close modal"},React3.createElement(CloseIcon,null)))),React3.createElement(ModalStackTrace,null,content,React3.createElement("br",null),React3.createElement("br",null),"Troubleshoot:"," ",React3.createElement(TroubleshootLink,{target:"_blank",href:troubleshootURL},troubleshootURL)))}function noop(){}function getSymbols(object){return Object.getOwnPropertySymbols(object).filter(symbol=>Object.prototype.propertyIsEnumerable.call(object,symbol))}function getTag(value){return value==null?value===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(value)}var regexpTag="[object RegExp]",stringTag="[object String]",numberTag="[object Number]",booleanTag="[object Boolean]",argumentsTag="[object Arguments]",symbolTag="[object Symbol]",dateTag="[object Date]",mapTag="[object Map]",setTag="[object Set]",arrayTag="[object Array]",functionTag="[object Function]",arrayBufferTag="[object ArrayBuffer]",objectTag="[object Object]",errorTag="[object Error]",dataViewTag="[object DataView]",uint8ArrayTag="[object Uint8Array]",uint8ClampedArrayTag="[object Uint8ClampedArray]",uint16ArrayTag="[object Uint16Array]",uint32ArrayTag="[object Uint32Array]",bigUint64ArrayTag="[object BigUint64Array]",int8ArrayTag="[object Int8Array]",int16ArrayTag="[object Int16Array]",int32ArrayTag="[object Int32Array]",bigInt64ArrayTag="[object BigInt64Array]",float32ArrayTag="[object Float32Array]",float64ArrayTag="[object Float64Array]";function isPlainObject(value){if(!value||typeof value!="object")return !1;let proto=Object.getPrototypeOf(value);return proto===null||proto===Object.prototype||Object.getPrototypeOf(proto)===null?Object.prototype.toString.call(value)==="[object Object]":!1}function eq(value,other){return value===other||Number.isNaN(value)&&Number.isNaN(other)}function isEqualWith(a,b,areValuesEqual){return isEqualWithImpl(a,b,void 0,void 0,void 0,void 0,areValuesEqual)}function isEqualWithImpl(a,b,property,aParent,bParent,stack,areValuesEqual){let result=areValuesEqual(a,b,property,aParent,bParent,stack);if(result!==void 0)return result;if(typeof a==typeof b)switch(typeof a){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return a===b;case"number":return a===b||Object.is(a,b);case"function":return a===b;case"object":return areObjectsEqual(a,b,stack,areValuesEqual)}return areObjectsEqual(a,b,stack,areValuesEqual)}function areObjectsEqual(a,b,stack,areValuesEqual){if(Object.is(a,b))return !0;let aTag=getTag(a),bTag=getTag(b);if(aTag===argumentsTag&&(aTag=objectTag),bTag===argumentsTag&&(bTag=objectTag),aTag!==bTag)return !1;switch(aTag){case stringTag:return a.toString()===b.toString();case numberTag:{let x=a.valueOf(),y=b.valueOf();return eq(x,y)}case booleanTag:case dateTag:case symbolTag:return Object.is(a.valueOf(),b.valueOf());case regexpTag:return a.source===b.source&&a.flags===b.flags;case functionTag:return a===b}stack=stack??new Map;let aStack=stack.get(a),bStack=stack.get(b);if(aStack!=null&&bStack!=null)return aStack===b;stack.set(a,b),stack.set(b,a);try{switch(aTag){case mapTag:{if(a.size!==b.size)return !1;for(let[key,value]of a.entries())if(!b.has(key)||!isEqualWithImpl(value,b.get(key),key,a,b,stack,areValuesEqual))return !1;return !0}case setTag:{if(a.size!==b.size)return !1;let aValues=Array.from(a.values()),bValues=Array.from(b.values());for(let i=0;i<aValues.length;i++){let aValue=aValues[i],index=bValues.findIndex(bValue=>isEqualWithImpl(aValue,bValue,void 0,a,b,stack,areValuesEqual));if(index===-1)return !1;bValues.splice(index,1);}return !0}case arrayTag:case uint8ArrayTag:case uint8ClampedArrayTag:case uint16ArrayTag:case uint32ArrayTag:case bigUint64ArrayTag:case int8ArrayTag:case int16ArrayTag:case int32ArrayTag:case bigInt64ArrayTag:case float32ArrayTag:case float64ArrayTag:{if(typeof Buffer<"u"&&Buffer.isBuffer(a)!==Buffer.isBuffer(b)||a.length!==b.length)return !1;for(let i=0;i<a.length;i++)if(!isEqualWithImpl(a[i],b[i],i,a,b,stack,areValuesEqual))return !1;return !0}case arrayBufferTag:return a.byteLength!==b.byteLength?!1:areObjectsEqual(new Uint8Array(a),new Uint8Array(b),stack,areValuesEqual);case dataViewTag:return a.byteLength!==b.byteLength||a.byteOffset!==b.byteOffset?!1:areObjectsEqual(new Uint8Array(a),new Uint8Array(b),stack,areValuesEqual);case errorTag:return a.name===b.name&&a.message===b.message;case objectTag:{if(!(areObjectsEqual(a.constructor,b.constructor,stack,areValuesEqual)||isPlainObject(a)&&isPlainObject(b)))return !1;let aKeys=[...Object.keys(a),...getSymbols(a)],bKeys=[...Object.keys(b),...getSymbols(b)];if(aKeys.length!==bKeys.length)return !1;for(let i=0;i<aKeys.length;i++){let propKey=aKeys[i],aProp=a[propKey];if(!Object.hasOwn(b,propKey))return !1;let bProp=b[propKey];if(!isEqualWithImpl(aProp,bProp,propKey,a,b,stack,areValuesEqual))return !1}return !0}default:return !1}}finally{stack.delete(a),stack.delete(b);}}function isEqual(a,b){return isEqualWith(a,b,noop)}var statusValueToStoryIds=(allStatuses,typeId,storyIds)=>{let statusValueToStoryIdsMap={"status-value:pending":[],"status-value:success":[],"status-value:error":[],"status-value:warning":[],"status-value:unknown":[]};return (storyIds?storyIds.map(storyId=>allStatuses[storyId]).filter(Boolean):Object.values(allStatuses)).forEach(statusByTypeId=>{let status=statusByTypeId[typeId];status&&statusValueToStoryIdsMap[status.value].push(status.storyId);}),statusValueToStoryIdsMap},useTestProvider=(api,entryId)=>{let testProviderState=experimental_useTestProviderStore(s=>s[ADDON_ID3]),[storeState,setStoreState]=experimental_useUniversalStore(store),[isSettingsUpdated,setIsSettingsUpdated]=useState(!1),settingsUpdatedTimeoutRef=useRef();useEffect(()=>{let unsubscribe=store.onStateChange((state,previousState)=>{isEqual(state.config,previousState.config)||(testProviderStore.settingsChanged(),setIsSettingsUpdated(!0),clearTimeout(settingsUpdatedTimeoutRef.current),settingsUpdatedTimeoutRef.current=setTimeout(()=>{setIsSettingsUpdated(!1);},1e3));});return ()=>{unsubscribe(),clearTimeout(settingsUpdatedTimeoutRef.current);}},[]);let storyIds=useMemo(()=>entryId?api.findAllLeafStoryIds(entryId):void 0,[entryId,api]),componentTestStatusSelector=useCallback(allStatuses=>statusValueToStoryIds(allStatuses,STATUS_TYPE_ID_COMPONENT_TEST,storyIds),[storyIds]),componentTestStatusValueToStoryIds=experimental_useStatusStore(componentTestStatusSelector),a11yStatusValueToStoryIdsSelector=useCallback(allStatuses=>statusValueToStoryIds(allStatuses,STATUS_TYPE_ID_A11Y,storyIds),[storyIds]),a11yStatusValueToStoryIds=experimental_useStatusStore(a11yStatusValueToStoryIdsSelector);return {storeState,setStoreState,testProviderState,componentTestStatusValueToStoryIds,a11yStatusValueToStoryIds,isSettingsUpdated}};var RelativeTime=({timestamp})=>{let[timeAgo,setTimeAgo]=useState(null);if(useEffect(()=>{if(timestamp){setTimeAgo(Date.now()-timestamp);let interval=setInterval(()=>setTimeAgo(Date.now()-timestamp),1e4);return ()=>clearInterval(interval)}},[timestamp]),timeAgo===null)return null;let seconds=Math.round(timeAgo/1e3);if(seconds<60)return "just now";let minutes=Math.floor(seconds/60);if(minutes<60)return minutes===1?"a minute ago":`${minutes} minutes ago`;let hours=Math.floor(minutes/60);if(hours<24)return hours===1?"an hour ago":`${hours} hours ago`;let days=Math.floor(hours/24);return days===1?"yesterday":`${days} days ago`};var Wrapper=styled.div(({theme})=>({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:theme.typography.size.s1,color:theme.textMutedColor})),PositiveText=styled.span(({theme})=>({color:theme.color.positiveText}));function Description({entryId,storeState,testProviderState,isSettingsUpdated,...props}){let{setModalOpen}=React3.useContext(GlobalErrorContext),{componentTestCount,totalTestCount,unhandledErrors,finishedAt}=storeState.currentRun,finishedTestCount=componentTestCount.success+componentTestCount.error,description="Not run";if(!entryId&&isSettingsUpdated)description=React3.createElement(PositiveText,null,"Settings updated");else if(testProviderState==="test-provider-state:running")description=(finishedTestCount??0)===0?"Starting...":`Testing... ${finishedTestCount}/${totalTestCount}`;else if(!entryId&&testProviderState==="test-provider-state:crashed")description=setModalOpen?React3.createElement(Link,{isButton:!0,onClick:()=>setModalOpen(!0)},"View full error"):"Crashed";else if(!entryId&&unhandledErrors.length>0){let unhandledErrorDescription=`View ${unhandledErrors.length} unhandled error${unhandledErrors?.length>1?"s":""}`;description=setModalOpen?React3.createElement(Link,{isButton:!0,onClick:()=>setModalOpen(!0)},unhandledErrorDescription):unhandledErrorDescription;}else entryId&&totalTestCount?description=`Ran ${totalTestCount} ${totalTestCount===1?"test":"tests"}`:finishedAt?description=React3.createElement(React3.Fragment,null,"Ran ",totalTestCount," ",totalTestCount===1?"test":"tests"," ",React3.createElement(RelativeTime,{timestamp:finishedAt})):storeState.watching&&(description="Watching for file changes");return React3.createElement(Wrapper,{...props},description)}var TestStatusIcon=styled.div(({percentage})=>({width:percentage?12:6,height:percentage?12:6,margin:percentage?1:4,background:percentage?`conic-gradient(var(--status-color) ${percentage}%, var(--status-background) ${percentage+1}%)`:"var(--status-color)",borderRadius:"50%"}),({isRunning,theme})=>isRunning&&{animation:`${theme.animation.glow} 1.5s ease-in-out infinite`},({status,theme})=>status==="positive"&&{"--status-color":theme.color.positive,"--status-background":`${theme.color.positive}66`},({status,theme})=>status==="warning"&&{"--status-color":theme.color.gold,"--status-background":`${theme.color.gold}66`},({status,theme})=>status==="negative"&&{"--status-color":theme.color.negative,"--status-background":`${theme.color.negative}66`},({status,theme})=>status==="critical"&&{"--status-color":theme.color.defaultText,"--status-background":`${theme.color.defaultText}66`},({status,theme})=>status==="unknown"&&{"--status-color":theme.color.mediumdark,"--status-background":`${theme.color.mediumdark}66`});var Container=styled.div({display:"flex",flexDirection:"column"}),Heading=styled.div({display:"flex",justifyContent:"space-between",padding:"8px 0",gap:12}),Info=styled.div({display:"flex",flexDirection:"column",marginLeft:8,minWidth:0}),Title=styled.div(({crashed,theme})=>({fontSize:theme.typography.size.s1,fontWeight:crashed?"bold":"normal",color:crashed?theme.color.negativeText:theme.color.defaultText})),Actions=styled.div({display:"flex",gap:4}),Extras=styled.div({marginBottom:2}),Muted=styled.span(({theme})=>({color:theme.textMutedColor})),Progress=styled(ProgressSpinner)({margin:4}),Row=styled.div({display:"flex",gap:4}),StopIcon=styled(StopAltIcon)({width:10}),openPanel=({api,panelId,entryId})=>{let story=entryId?api.findAllLeafStoryIds(entryId)[0]:void 0;story&&api.selectStory(story),api.setSelectedPanel(panelId),api.togglePanel(!0);},TestProviderRender=({api,entry,testProviderState,storeState,setStoreState,componentTestStatusValueToStoryIds,a11yStatusValueToStoryIds,isSettingsUpdated,...props})=>{let{config,watching,cancelling,currentRun,fatalError}=storeState,finishedTestCount=currentRun.componentTestCount.success+currentRun.componentTestCount.error,hasA11yAddon=addons.experimental_getRegisteredAddons().includes(ADDON_ID2),isRunning=testProviderState==="test-provider-state:running",isStarting=isRunning&&finishedTestCount===0,[componentTestStatusIcon,componentTestStatusLabel]=fatalError?["critical","Component tests crashed"]:componentTestStatusValueToStoryIds["status-value:error"].length>0?["negative","Component tests failed"]:isRunning?["unknown","Testing in progress"]:componentTestStatusValueToStoryIds["status-value:success"].length>0?["positive","Component tests passed"]:["unknown","Run tests to see results"],[a11yStatusIcon,a11yStatusLabel]=fatalError?["critical","Component tests crashed"]:a11yStatusValueToStoryIds["status-value:error"].length>0?["negative","Accessibility tests failed"]:a11yStatusValueToStoryIds["status-value:warning"].length>0?["warning","Accessibility tests failed"]:isRunning?["unknown","Testing in progress"]:a11yStatusValueToStoryIds["status-value:success"].length>0?["positive","Accessibility tests passed"]:["unknown","Run tests to see accessibility results"];return React3.createElement(Container,{...props},React3.createElement(Heading,null,React3.createElement(Info,null,entry?React3.createElement(Title,{id:"testing-module-title"},"Run component tests"):React3.createElement(Title,{id:"testing-module-title",crashed:testProviderState==="test-provider-state:crashed"||fatalError!==void 0||currentRun.unhandledErrors.length>0},currentRun.unhandledErrors.length===1?"Component tests completed with an error":currentRun.unhandledErrors.length>1?"Component tests completed with errors":fatalError?"Component tests didn\u2019t complete":"Run component tests"),React3.createElement(Description,{id:"testing-module-description",storeState,testProviderState,entryId:entry?.id,isSettingsUpdated})),React3.createElement(Actions,null,!entry&&React3.createElement(WithTooltip,{hasChrome:!1,trigger:"hover",tooltip:React3.createElement(TooltipNote,{note:`${watching?"Disable":"Enable"} watch mode`})},React3.createElement(IconButton,{"aria-label":`${watching?"Disable":"Enable"} watch mode`,size:"medium",active:watching,onClick:()=>store.send({type:"TOGGLE_WATCHING",payload:{to:!watching}}),disabled:isRunning},React3.createElement(EyeIcon,null))),isRunning?React3.createElement(WithTooltip,{hasChrome:!1,trigger:"hover",tooltip:React3.createElement(TooltipNote,{note:cancelling?"Stopping...":"Stop test run"})},React3.createElement(IconButton,{"aria-label":cancelling?"Stopping...":"Stop test run",padding:"none",size:"medium",onClick:()=>store.send({type:"CANCEL_RUN"}),disabled:cancelling||isStarting},React3.createElement(Progress,{percentage:finishedTestCount&&storeState.currentRun.totalTestCount?finishedTestCount/storeState.currentRun.totalTestCount*100:void 0},React3.createElement(StopIcon,null)))):React3.createElement(WithTooltip,{hasChrome:!1,trigger:"hover",tooltip:React3.createElement(TooltipNote,{note:"Start test run"})},React3.createElement(IconButton,{"aria-label":"Start test run",size:"medium",onClick:()=>store.send({type:"TRIGGER_RUN",payload:{storyIds:entry?api.findAllLeafStoryIds(entry.id):void 0,triggeredBy:entry?entry.type:"global"}})},React3.createElement(PlayHollowIcon,null))))),React3.createElement(Extras,null,React3.createElement(Row,null,React3.createElement(ListItem,{as:"label",title:"Interactions",icon:entry?null:React3.createElement(Form.Checkbox,{checked:!0,disabled:!0})}),React3.createElement(WithTooltip,{hasChrome:!1,trigger:"hover",tooltip:React3.createElement(TooltipNote,{note:componentTestStatusLabel})},React3.createElement(IconButton,{size:"medium",disabled:componentTestStatusValueToStoryIds["status-value:error"].length===0&&componentTestStatusValueToStoryIds["status-value:warning"].length===0&&componentTestStatusValueToStoryIds["status-value:success"].length===0,onClick:()=>{openPanel({api,panelId:PANEL_ID,entryId:componentTestStatusValueToStoryIds["status-value:error"][0]??componentTestStatusValueToStoryIds["status-value:warning"][0]??componentTestStatusValueToStoryIds["status-value:success"][0]??entry?.id});}},React3.createElement(TestStatusIcon,{status:componentTestStatusIcon,"aria-label":componentTestStatusLabel,isRunning}),componentTestStatusValueToStoryIds["status-value:error"].length+componentTestStatusValueToStoryIds["status-value:warning"].length||null))),!entry&&React3.createElement(Row,null,React3.createElement(ListItem,{as:"label",title:watching?React3.createElement(Muted,null,"Coverage (unavailable)"):"Coverage",icon:React3.createElement(Form.Checkbox,{checked:config.coverage,disabled:isRunning,onChange:()=>setStoreState(s=>({...s,config:{...s.config,coverage:!config.coverage}}))})}),React3.createElement(WithTooltip,{hasChrome:!1,trigger:"hover",tooltip:React3.createElement(TooltipNote,{note:watching?"Unavailable in watch mode":currentRun.triggeredBy&&!FULL_RUN_TRIGGERS.includes(currentRun.triggeredBy)?"Unavailable when running focused tests":isRunning?"Testing in progress":currentRun.coverageSummary?"View coverage report":fatalError?"Component tests crashed":"Run tests to calculate coverage"})},watching||currentRun.triggeredBy&&!FULL_RUN_TRIGGERS.includes(currentRun.triggeredBy)?React3.createElement(IconButton,{size:"medium",disabled:!0},React3.createElement(InfoIcon,{"aria-label":watching?"Coverage is unavailable in watch mode":"Coverage is unavailable when running focused tests"})):currentRun.coverageSummary?React3.createElement(IconButton,{asChild:!0,size:"medium"},React3.createElement("a",{href:"/coverage/index.html",target:"_blank","aria-label":"Open coverage report"},React3.createElement(TestStatusIcon,{isRunning,percentage:currentRun.coverageSummary.percentage,status:currentRun.coverageSummary.status,"aria-label":`Coverage status: ${currentRun.coverageSummary.status}`}),React3.createElement("span",{"aria-label":`${currentRun.coverageSummary.percentage} percent coverage`},currentRun.coverageSummary.percentage,"%"))):React3.createElement(IconButton,{size:"medium",disabled:!0},React3.createElement(TestStatusIcon,{isRunning,status:fatalError?"critical":"unknown","aria-label":"Coverage status: unknown"})))),hasA11yAddon&&React3.createElement(Row,null,React3.createElement(ListItem,{as:"label",title:"Accessibility",icon:entry?null:React3.createElement(Form.Checkbox,{checked:config.a11y,disabled:isRunning,onChange:()=>setStoreState(s=>({...s,config:{...s.config,a11y:!config.a11y}}))})}),React3.createElement(WithTooltip,{hasChrome:!1,trigger:"hover",tooltip:React3.createElement(TooltipNote,{note:a11yStatusLabel})},React3.createElement(IconButton,{size:"medium",disabled:a11yStatusValueToStoryIds["status-value:error"].length===0&&a11yStatusValueToStoryIds["status-value:warning"].length===0&&a11yStatusValueToStoryIds["status-value:success"].length===0,onClick:()=>{openPanel({api,entryId:a11yStatusValueToStoryIds["status-value:error"][0]??a11yStatusValueToStoryIds["status-value:warning"][0]??a11yStatusValueToStoryIds["status-value:success"][0]??entry?.id,panelId:PANEL_ID2});}},React3.createElement(TestStatusIcon,{status:a11yStatusIcon,"aria-label":a11yStatusLabel,isRunning}),a11yStatusValueToStoryIds["status-value:error"].length+a11yStatusValueToStoryIds["status-value:warning"].length||null)))))};var SidebarContextMenu=({context,api})=>{let{testProviderState,componentTestStatusValueToStoryIds,a11yStatusValueToStoryIds,storeState,setStoreState}=useTestProvider(api,context.id);return React3.createElement(TestProviderRender,{api,entry:context,style:{minWidth:240},testProviderState,componentTestStatusValueToStoryIds,a11yStatusValueToStoryIds,storeState,setStoreState,isSettingsUpdated:!1})};addons.register(ADDON_ID3,api=>{if((globalThis.STORYBOOK_BUILDER||"").includes("vite")){let openPanel2=panelId=>{api.setSelectedPanel(panelId),api.togglePanel(!0);};componentTestStatusStore.onSelect(()=>{openPanel2(PANEL_ID);}),a11yStatusStore.onSelect(()=>{openPanel2(PANEL_ID2);}),testProviderStore.onRunAll(()=>{store.send({type:"TRIGGER_RUN",payload:{triggeredBy:"run-all"}});}),store.untilReady().then(()=>{store.setState(state=>({...state,indexUrl:new URL("index.json",window.location.href).toString()}));}),addons.add(TEST_PROVIDER_ID,{type:Addon_TypesEnum.experimental_TEST_PROVIDER,render:()=>{let[isModalOpen,setModalOpen]=useState(!1),{storeState,setStoreState,testProviderState,componentTestStatusValueToStoryIds,a11yStatusValueToStoryIds,isSettingsUpdated}=useTestProvider(api);return React3.createElement(GlobalErrorContext.Provider,{value:{isModalOpen,setModalOpen}},React3.createElement(TestProviderRender,{api,storeState,setStoreState,isSettingsUpdated,testProviderState,componentTestStatusValueToStoryIds,a11yStatusValueToStoryIds}),React3.createElement(GlobalErrorModal,{storeState,onRerun:()=>{setModalOpen(!1),store.send({type:"TRIGGER_RUN",payload:{triggeredBy:"global"}});}}))},sidebarContextMenu:({context})=>context.type==="docs"||context.type==="story"&&!context.tags.includes("test")?null:React3.createElement(SidebarContextMenu,{context,api})});}});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
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}
|
|
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.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);createToken("PRERELEASEIDENTIFIERLOOSE",`(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);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,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 match=`-${identifier}`.match(this.options.loose?re[t.PRERELEASELOOSE]:re[t.PRERELEASE]);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
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
5
|
|
|
6
6
|
module.exports = StorybookCoverageReporter;
|
|
@@ -6,7 +6,7 @@ import { __commonJS, __require, __toESM } from '../chunk-JKRQGT2U.mjs';
|
|
|
6
6
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
7
|
dirname(__filename);
|
|
8
8
|
ESM_COMPAT_Module.createRequire(import.meta.url);
|
|
9
|
-
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}
|
|
9
|
+
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.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);createToken("PRERELEASEIDENTIFIERLOOSE",`(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);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,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 match=`-${identifier}`.match(this.options.loose?re[t.PRERELEASELOOSE]:re[t.PRERELEASE]);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}
|
|
10
10
|
`);}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);}};
|
|
11
11
|
|
|
12
12
|
export { StorybookCoverageReporter as default };
|