vitest 0.0.43 → 0.0.47

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/README.gh.md CHANGED
@@ -115,6 +115,23 @@ To get TypeScript working with the global APIs, add `vitest/global` to the `type
115
115
  }
116
116
  ```
117
117
 
118
+ If you are already using [`unplugin-auto-import`](https://github.com/antfu/unplugin-vue-components) in your project, you can also use it directly for auto importing those APIs.
119
+
120
+ ```ts
121
+ // vite.config.ts
122
+ import { defineConfig } from 'vite'
123
+ import AutoImport from 'unplugin-auto-import/vite'
124
+
125
+ export default defineConfig({
126
+ plugins: [
127
+ AutoImport({
128
+ imports: ['vitest'],
129
+ dts: true // genreate TypeScript declaration
130
+ })
131
+ ]
132
+ })
133
+ ```
134
+
118
135
  ## Browser Mocking
119
136
 
120
137
  Pass `--dom` option in CLI to enable browser mocking. Or the `dom` flag in the config.
@@ -1 +1 @@
1
- import{init_esm_shims}from"./chunk-6IXNQZKF.js";init_esm_shims();import{resolve}from"path";import{fileURLToPath}from"url";var distDir=resolve(fileURLToPath(import.meta.url),"../../dist"),defaultIncludes=["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],defaultExcludes=["**/node_modules/**","**/dist/**"],globalApis=["suite","test","describe","it","chai","expect","assert","sinon","spy","mock","stub","beforeAll","afterAll","beforeEach","afterEach"];export{distDir,defaultIncludes,defaultExcludes,globalApis};
1
+ import{init_esm_shims}from"./chunk-7OSWSRXU.js";init_esm_shims();import{resolve}from"path";import{fileURLToPath}from"url";var distDir=resolve(fileURLToPath(import.meta.url),"../../dist"),defaultIncludes=["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],defaultExcludes=["**/node_modules/**","**/dist/**"],globalApis=["suite","test","describe","it","chai","expect","assert","sinon","spy","mock","stub","beforeAll","afterAll","beforeEach","afterEach"];export{distDir,defaultIncludes,defaultExcludes,globalApis};
@@ -0,0 +1 @@
1
+ import{__filename,init_esm_shims}from"./chunk-7OSWSRXU.js";init_esm_shims();init_esm_shims();var context={tasks:[],currentSuite:null};process.__vitest__||(console.warn("[vitest] Runtime is running in non-Vite environment, there might be some issues with your setup..."),console.warn("cwd: ",process.cwd()),console.warn("path:",__filename));init_esm_shims();var fnMap=new WeakMap,hooksMap=new WeakMap;function setFn(key,fn){fnMap.set(key,fn)}function getFn(key){return fnMap.get(key)}function setHooks(key,hooks){hooksMap.set(key,hooks)}function getHooks(key){return hooksMap.get(key)}var suite=createSuite(),defaultSuite=suite("");function getCurrentSuite(){return context.currentSuite||defaultSuite}function createSuiteHooks(){return{beforeAll:[],afterAll:[],beforeEach:[],afterEach:[]}}function createSuiteCollector(name,factory=()=>{},mode,suiteComputeMode){var _a;let tasks=[],factoryQueue=[],suite2;initSuite();let test2=createTestCollector((name2,fn,mode2,computeMode)=>{let test3={type:"test",name:name2,mode:mode2,computeMode:computeMode??suiteComputeMode??"serial",suite:{}};setFn(test3,fn),tasks.push(test3)}),collector={type:"collector",name,mode,test:test2,tasks,collect,clear,on:addHook};function addHook(name2,...fn){getHooks(suite2)[name2].push(...fn)}function initSuite(){suite2={type:"suite",computeMode:"serial",name,mode,tasks:[],suite:{}},setHooks(suite2,createSuiteHooks())}function clear(){tasks.length=0,factoryQueue.length=0,initSuite()}async function collect(file){if(factoryQueue.length=0,factory){let prev=context.currentSuite;context.currentSuite=collector,await factory(test2),context.currentSuite=prev}let allChildren=await Promise.all([...factoryQueue,...tasks].map(i=>i.type==="collector"?i.collect(file):i));return suite2.file=file,suite2.tasks=allChildren,allChildren.forEach(task=>{task.suite=suite2,file&&(task.file=file)}),suite2}return(_a=context.currentSuite)==null||_a.tasks.push(collector),collector}function createTestCollector(collectTest){function test2(name,fn){collectTest(name,fn,"run")}test2.concurrent=concurrent,test2.skip=skip,test2.only=only,test2.todo=todo;function concurrent(name,fn){collectTest(name,fn,"run","concurrent")}concurrent.skip=(name,fn)=>collectTest(name,fn,"skip","concurrent"),concurrent.only=(name,fn)=>collectTest(name,fn,"only","concurrent"),concurrent.todo=todo;function skip(name,fn){collectTest(name,fn,"skip")}skip.concurrent=concurrent.skip;function only(name,fn){collectTest(name,fn,"only")}only.concurrent=concurrent.only;function todo(name){collectTest(name,()=>{},"todo")}return todo.concurrent=todo,test2}var test=function(){function test2(name,fn){return getCurrentSuite().test(name,fn)}function concurrent(name,fn){return getCurrentSuite().test.concurrent(name,fn)}concurrent.skip=(name,fn)=>getCurrentSuite().test.concurrent.skip(name,fn),concurrent.only=(name,fn)=>getCurrentSuite().test.concurrent.only(name,fn),concurrent.todo=name=>getCurrentSuite().test.concurrent.todo(name);function skip(name,fn){return getCurrentSuite().test.skip(name,fn)}skip.concurrent=(name,fn)=>getCurrentSuite().test.skip.concurrent(name,fn);function only(name,fn){return getCurrentSuite().test.only(name,fn)}only.concurrent=(name,fn)=>getCurrentSuite().test.only.concurrent(name,fn);function todo(name){return getCurrentSuite().test.todo(name)}return todo.concurrent=name=>getCurrentSuite().test.todo.concurrent(name),test2.concurrent=concurrent,test2.skip=skip,test2.only=only,test2.todo=todo,test2}();function createSuite(){function suite2(suiteName,factory){return createSuiteCollector(suiteName,factory,"run")}function concurrent(suiteName,factory){return createSuiteCollector(suiteName,factory,"run","concurrent")}concurrent.skip=(suiteName,factory)=>createSuiteCollector(suiteName,factory,"skip","concurrent"),concurrent.only=(suiteName,factory)=>createSuiteCollector(suiteName,factory,"only","concurrent"),concurrent.todo=suiteName=>createSuiteCollector(suiteName,void 0,"todo");function skip(suiteName,factory){return createSuiteCollector(suiteName,factory,"skip")}skip.concurrent=concurrent.skip;function only(suiteName,factory){return createSuiteCollector(suiteName,factory,"only")}only.concurrent=concurrent.only;function todo(suiteName){return createSuiteCollector(suiteName,void 0,"todo")}return todo.concurrent=concurrent.todo,suite2.concurrent=concurrent,suite2.skip=skip,suite2.only=only,suite2.todo=todo,suite2}var describe=suite,it=test,beforeAll=fn=>getCurrentSuite().on("beforeAll",fn),afterAll=fn=>getCurrentSuite().on("afterAll",fn),beforeEach=fn=>getCurrentSuite().on("beforeEach",fn),afterEach=fn=>getCurrentSuite().on("afterEach",fn);function clearContext(){context.tasks.length=0,defaultSuite.clear(),context.currentSuite=defaultSuite}export{context,getFn,setHooks,getHooks,suite,defaultSuite,createSuiteHooks,test,describe,it,beforeAll,afterAll,beforeEach,afterEach,clearContext};
@@ -0,0 +1 @@
1
+ var __create=Object.create;var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__markAsModule=target=>__defProp(target,"__esModule",{value:!0});var __require=(x=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(x,{get:(a,b)=>(typeof require!="undefined"?require:a)[b]}):x)(function(x){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+x+'" is not supported')});var __esm=(fn,res)=>function(){return fn&&(res=(0,fn[Object.keys(fn)[0]])(fn=0)),res};var __commonJS=(cb,mod)=>function(){return mod||(0,cb[Object.keys(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all)=>{__markAsModule(target);for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__reExport=(target,module,desc)=>{if(module&&typeof module=="object"||typeof module=="function")for(let key of __getOwnPropNames(module))!__hasOwnProp.call(target,key)&&key!=="default"&&__defProp(target,key,{get:()=>module[key],enumerable:!(desc=__getOwnPropDesc(module,key))||desc.enumerable});return target},__toModule=module=>__reExport(__markAsModule(__defProp(module!=null?__create(__getProtoOf(module)):{},"default",module&&module.__esModule&&"default"in module?{get:()=>module.default,enumerable:!0}:{value:module,enumerable:!0})),module);import{fileURLToPath}from"url";import path from"path";var __filename,__dirname,init_esm_shims=__esm({"node_modules/.pnpm/tsup@5.10.3_typescript@4.5.2/node_modules/tsup/assets/esm_shims.js"(){__filename=fileURLToPath(import.meta.url),__dirname=path.dirname(__filename)}});export{__spreadValues,__spreadProps,__require,__commonJS,__export,__toModule,__filename,init_esm_shims};
@@ -1 +1 @@
1
- import{init_esm_shims}from"./chunk-6IXNQZKF.js";init_esm_shims();var LIVING_KEYS=["DOMException","URL","URLSearchParams","EventTarget","NamedNodeMap","Node","Attr","Element","DocumentFragment","DOMImplementation","Document","XMLDocument","CharacterData","Text","CDATASection","ProcessingInstruction","Comment","DocumentType","NodeList","HTMLCollection","HTMLOptionsCollection","DOMStringMap","DOMTokenList","StyleSheetList","HTMLElement","HTMLHeadElement","HTMLTitleElement","HTMLBaseElement","HTMLLinkElement","HTMLMetaElement","HTMLStyleElement","HTMLBodyElement","HTMLHeadingElement","HTMLParagraphElement","HTMLHRElement","HTMLPreElement","HTMLUListElement","HTMLOListElement","HTMLLIElement","HTMLMenuElement","HTMLDListElement","HTMLDivElement","HTMLAnchorElement","HTMLAreaElement","HTMLBRElement","HTMLButtonElement","HTMLCanvasElement","HTMLDataElement","HTMLDataListElement","HTMLDetailsElement","HTMLDialogElement","HTMLDirectoryElement","HTMLFieldSetElement","HTMLFontElement","HTMLFormElement","HTMLHtmlElement","HTMLImageElement","HTMLInputElement","HTMLLabelElement","HTMLLegendElement","HTMLMapElement","HTMLMarqueeElement","HTMLMediaElement","HTMLMeterElement","HTMLModElement","HTMLOptGroupElement","HTMLOptionElement","HTMLOutputElement","HTMLPictureElement","HTMLProgressElement","HTMLQuoteElement","HTMLScriptElement","HTMLSelectElement","HTMLSlotElement","HTMLSourceElement","HTMLSpanElement","HTMLTableCaptionElement","HTMLTableCellElement","HTMLTableColElement","HTMLTableElement","HTMLTimeElement","HTMLTableRowElement","HTMLTableSectionElement","HTMLTemplateElement","HTMLTextAreaElement","HTMLUnknownElement","HTMLFrameElement","HTMLFrameSetElement","HTMLIFrameElement","HTMLEmbedElement","HTMLObjectElement","HTMLParamElement","HTMLVideoElement","HTMLAudioElement","HTMLTrackElement","SVGElement","SVGGraphicsElement","SVGSVGElement","SVGTitleElement","SVGAnimatedString","SVGNumber","SVGStringList","Event","CloseEvent","CustomEvent","MessageEvent","ErrorEvent","HashChangeEvent","PopStateEvent","StorageEvent","ProgressEvent","PageTransitionEvent","UIEvent","FocusEvent","InputEvent","MouseEvent","KeyboardEvent","TouchEvent","CompositionEvent","WheelEvent","BarProp","External","Location","History","Screen","Performance","Navigator","PluginArray","MimeTypeArray","Plugin","MimeType","FileReader","Blob","File","FileList","ValidityState","DOMParser","XMLSerializer","FormData","XMLHttpRequestEventTarget","XMLHttpRequestUpload","XMLHttpRequest","WebSocket","NodeFilter","NodeIterator","TreeWalker","AbstractRange","Range","StaticRange","Selection","Storage","CustomElementRegistry","ShadowRoot","MutationObserver","MutationRecord","Headers","AbortController","AbortSignal"],OTHER_KEYS=["addEventListener","alert","atob","blur","btoa","close","confirm","createPopup","dispatchEvent","document","focus","frames","getComputedStyle","history","innerHeight","innerWidth","length","location","moveBy","moveTo","name","navigator","open","outerHeight","outerWidth","pageXOffset","pageYOffset","parent","postMessage","print","prompt","removeEventListener","resizeBy","resizeTo","screen","screenLeft","screenTop","screenX","screenY","scroll","scrollBy","scrollLeft","scrollTo","scrollTop","scrollX","scrollY","self","stop","top","window"],KEYS=LIVING_KEYS.concat(OTHER_KEYS);export{KEYS};
1
+ import{init_esm_shims}from"./chunk-7OSWSRXU.js";init_esm_shims();var LIVING_KEYS=["DOMException","URL","URLSearchParams","EventTarget","NamedNodeMap","Node","Attr","Element","DocumentFragment","DOMImplementation","Document","XMLDocument","CharacterData","Text","CDATASection","ProcessingInstruction","Comment","DocumentType","NodeList","HTMLCollection","HTMLOptionsCollection","DOMStringMap","DOMTokenList","StyleSheetList","HTMLElement","HTMLHeadElement","HTMLTitleElement","HTMLBaseElement","HTMLLinkElement","HTMLMetaElement","HTMLStyleElement","HTMLBodyElement","HTMLHeadingElement","HTMLParagraphElement","HTMLHRElement","HTMLPreElement","HTMLUListElement","HTMLOListElement","HTMLLIElement","HTMLMenuElement","HTMLDListElement","HTMLDivElement","HTMLAnchorElement","HTMLAreaElement","HTMLBRElement","HTMLButtonElement","HTMLCanvasElement","HTMLDataElement","HTMLDataListElement","HTMLDetailsElement","HTMLDialogElement","HTMLDirectoryElement","HTMLFieldSetElement","HTMLFontElement","HTMLFormElement","HTMLHtmlElement","HTMLImageElement","HTMLInputElement","HTMLLabelElement","HTMLLegendElement","HTMLMapElement","HTMLMarqueeElement","HTMLMediaElement","HTMLMeterElement","HTMLModElement","HTMLOptGroupElement","HTMLOptionElement","HTMLOutputElement","HTMLPictureElement","HTMLProgressElement","HTMLQuoteElement","HTMLScriptElement","HTMLSelectElement","HTMLSlotElement","HTMLSourceElement","HTMLSpanElement","HTMLTableCaptionElement","HTMLTableCellElement","HTMLTableColElement","HTMLTableElement","HTMLTimeElement","HTMLTableRowElement","HTMLTableSectionElement","HTMLTemplateElement","HTMLTextAreaElement","HTMLUnknownElement","HTMLFrameElement","HTMLFrameSetElement","HTMLIFrameElement","HTMLEmbedElement","HTMLObjectElement","HTMLParamElement","HTMLVideoElement","HTMLAudioElement","HTMLTrackElement","SVGElement","SVGGraphicsElement","SVGSVGElement","SVGTitleElement","SVGAnimatedString","SVGNumber","SVGStringList","Event","CloseEvent","CustomEvent","MessageEvent","ErrorEvent","HashChangeEvent","PopStateEvent","StorageEvent","ProgressEvent","PageTransitionEvent","UIEvent","FocusEvent","InputEvent","MouseEvent","KeyboardEvent","TouchEvent","CompositionEvent","WheelEvent","BarProp","External","Location","History","Screen","Performance","Navigator","PluginArray","MimeTypeArray","Plugin","MimeType","FileReader","Blob","File","FileList","ValidityState","DOMParser","XMLSerializer","FormData","XMLHttpRequestEventTarget","XMLHttpRequestUpload","XMLHttpRequest","WebSocket","NodeFilter","NodeIterator","TreeWalker","AbstractRange","Range","StaticRange","Selection","Storage","CustomElementRegistry","ShadowRoot","MutationObserver","MutationRecord","Headers","AbortController","AbortSignal"],OTHER_KEYS=["addEventListener","alert","atob","blur","btoa","close","confirm","createPopup","dispatchEvent","document","focus","frames","getComputedStyle","history","innerHeight","innerWidth","length","location","moveBy","moveTo","name","navigator","open","outerHeight","outerWidth","pageXOffset","pageYOffset","parent","postMessage","print","prompt","removeEventListener","resizeBy","resizeTo","screen","screenLeft","screenTop","screenX","screenY","scroll","scrollBy","scrollLeft","scrollTo","scrollTop","scrollX","scrollY","self","stop","top","window"],KEYS=LIVING_KEYS.concat(OTHER_KEYS);export{KEYS};
@@ -1 +1 @@
1
- import{afterAll,afterEach,beforeAll,beforeEach,clearContext,createSuiteHooks,defaultSuite,describe,it,suite,test}from"./chunk-AQN47UC5.js";import{__export,init_esm_shims}from"./chunk-6IXNQZKF.js";var src_exports={};__export(src_exports,{afterAll:()=>afterAll,afterEach:()=>afterEach,assert:()=>assert,beforeAll:()=>beforeAll,beforeEach:()=>beforeEach,chai:()=>chai,clearContext:()=>clearContext,createSuiteHooks:()=>createSuiteHooks,defaultSuite:()=>defaultSuite,describe:()=>describe,expect:()=>expect,it:()=>it,mock:()=>mock,should:()=>should,sinon:()=>sinon,spy:()=>spy,stub:()=>stub,suite:()=>suite,test:()=>test});init_esm_shims();init_esm_shims();init_esm_shims();import chai from"chai";import{assert,should,expect}from"chai";init_esm_shims();import sinon from"sinon";var{mock,spy,stub}=sinon;sinon.fn=sinon.spy;export{chai,assert,should,expect,sinon,mock,spy,stub,src_exports};
1
+ import{afterAll,afterEach,beforeAll,beforeEach,clearContext,createSuiteHooks,defaultSuite,describe,it,suite,test}from"./chunk-6ZV4435G.js";import{__export,init_esm_shims}from"./chunk-7OSWSRXU.js";var src_exports={};__export(src_exports,{afterAll:()=>afterAll,afterEach:()=>afterEach,assert:()=>assert,beforeAll:()=>beforeAll,beforeEach:()=>beforeEach,chai:()=>chai,clearContext:()=>clearContext,createSuiteHooks:()=>createSuiteHooks,defaultSuite:()=>defaultSuite,describe:()=>describe,expect:()=>expect,it:()=>it,mock:()=>mock,should:()=>should,sinon:()=>sinon,spy:()=>spy,stub:()=>stub,suite:()=>suite,test:()=>test});init_esm_shims();init_esm_shims();init_esm_shims();import chai from"chai";import{assert,should,expect}from"chai";init_esm_shims();import sinon from"sinon";var{mock,spy,stub}=sinon;sinon.fn=sinon.spy;export{chai,assert,should,expect,sinon,mock,spy,stub,src_exports};
@@ -0,0 +1 @@
1
+ import{src_exports}from"./chunk-NYHZEME4.js";import"./chunk-6ZV4435G.js";import{globalApis}from"./chunk-253QKTIQ.js";import{init_esm_shims}from"./chunk-7OSWSRXU.js";init_esm_shims();function registerApiGlobally(){globalApis.forEach(api=>{globalThis[api]=src_exports[api]})}export{registerApiGlobally};
@@ -1 +1 @@
1
- import{KEYS}from"./chunk-3SFPYX4Z.js";import{init_esm_shims}from"./chunk-6IXNQZKF.js";init_esm_shims();import{Window}from"happy-dom";function setupHappyDOM(global){let win=new Window,keys=KEYS.concat(Object.getOwnPropertyNames(win)).filter(k=>!k.startsWith("_")).filter(k=>!(k in global));for(let key of keys)global[key]=win[key];return{dom:win,restore(){win.happyDOM.cancelAsync(),keys.forEach(key=>delete global[key])}}}export{setupHappyDOM};
1
+ import{KEYS}from"./chunk-NVC7FB7V.js";import{init_esm_shims}from"./chunk-7OSWSRXU.js";init_esm_shims();import{Window}from"happy-dom";function setupHappyDOM(global){let win=new Window,keys=KEYS.concat(Object.getOwnPropertyNames(win)).filter(k=>!k.startsWith("_")).filter(k=>!(k in global));for(let key of keys)global[key]=win[key];return{dom:win,restore(){win.happyDOM.cancelAsync(),keys.forEach(key=>delete global[key])}}}export{setupHappyDOM};
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as pretty_format from 'pretty-format';
2
- import { T as TestFactory, S as SuiteCollector, a as TestFunction, b as SuiteHooks, U as UserOptions } from './types-1e901cba';
3
- export { C as ComputeMode, F as File, G as GlobalContext, H as HookListener, l as Reporter, R as ResolvedConfig, c as RunMode, k as RunnerContext, j as Suite, S as SuiteCollector, b as SuiteHooks, e as SuiteState, h as Task, f as Test, i as TestCollector, T as TestFactory, a as TestFunction, g as TestResult, d as TestState, U as UserOptions } from './types-1e901cba';
2
+ import { T as TestFactory, S as SuiteCollector, a as TestFunction, b as SuiteHooks, U as UserOptions } from './types-8b2d1521';
3
+ export { C as ComputeMode, F as File, G as GlobalContext, H as HookListener, m as Reporter, R as ResolvedConfig, c as RunMode, l as RunnerContext, k as Suite, S as SuiteCollector, b as SuiteHooks, e as SuiteState, g as Task, i as TaskResult, f as TaskType, h as Test, j as TestCollector, T as TestFactory, a as TestFunction, d as TestState, U as UserOptions } from './types-8b2d1521';
4
4
  export { assert, default as chai, expect, should } from 'chai';
5
5
  import sinon from 'sinon';
6
6
  export { default as sinon } from 'sinon';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{assert,chai,expect,mock,should,sinon,spy,stub}from"./chunk-MTU4HR6S.js";import{afterAll,afterEach,beforeAll,beforeEach,clearContext,createSuiteHooks,defaultSuite,describe,it,suite,test}from"./chunk-AQN47UC5.js";import"./chunk-6IXNQZKF.js";export{afterAll,afterEach,assert,beforeAll,beforeEach,chai,clearContext,createSuiteHooks,defaultSuite,describe,expect,it,mock,should,sinon,spy,stub,suite,test};
1
+ import{assert,chai,expect,mock,should,sinon,spy,stub}from"./chunk-NYHZEME4.js";import{afterAll,afterEach,beforeAll,beforeEach,clearContext,createSuiteHooks,defaultSuite,describe,it,suite,test}from"./chunk-6ZV4435G.js";import"./chunk-7OSWSRXU.js";export{afterAll,afterEach,assert,beforeAll,beforeEach,chai,clearContext,createSuiteHooks,defaultSuite,describe,expect,it,mock,should,sinon,spy,stub,suite,test};
@@ -1 +1 @@
1
- import{KEYS}from"./chunk-3SFPYX4Z.js";import{init_esm_shims}from"./chunk-6IXNQZKF.js";init_esm_shims();import{JSDOM}from"jsdom";function setupJSDOM(global){let dom=new JSDOM("<!DOCTYPE html>",{pretendToBeVisual:!0,runScripts:"dangerously",url:"http://localhost:3000"}),keys=KEYS.concat(Object.getOwnPropertyNames(dom.window)).filter(k=>!k.startsWith("_")).filter(k=>!(k in global));for(let key of keys)global[key]=dom.window[key];return{dom,restore(){keys.forEach(key=>delete global[key])}}}export{setupJSDOM};
1
+ import{KEYS}from"./chunk-NVC7FB7V.js";import{init_esm_shims}from"./chunk-7OSWSRXU.js";init_esm_shims();import{JSDOM}from"jsdom";function setupJSDOM(global){let dom=new JSDOM("<!DOCTYPE html>",{pretendToBeVisual:!0,runScripts:"dangerously",url:"http://localhost:3000"}),keys=KEYS.concat(Object.getOwnPropertyNames(dom.window)).filter(k=>!k.startsWith("_")).filter(k=>!(k in global));for(let key of keys)global[key]=dom.window[key];return{dom,restore(){keys.forEach(key=>delete global[key])}}}export{setupJSDOM};
@@ -1,5 +1,5 @@
1
1
  import { TransformResult, ViteDevServer } from 'vite';
2
- import { R as ResolvedConfig } from '../types-1e901cba';
2
+ import { R as ResolvedConfig } from '../types-8b2d1521';
3
3
  import '@antfu/utils';
4
4
  import 'jest-snapshot';
5
5
  import 'jest-snapshot/build/State';
package/dist/node/cli.js CHANGED
@@ -1,7 +1,7 @@
1
- import{distDir}from"../chunk-HKVZR3WA.js";import{__spreadProps,__spreadValues,init_esm_shims}from"../chunk-6IXNQZKF.js";init_esm_shims();import{resolve as resolve3}from"path";import sade from"sade";import c from"picocolors";var version="0.0.43";init_esm_shims();init_esm_shims();import{builtinModules,createRequire}from"module";import{fileURLToPath,pathToFileURL}from"url";import{dirname,resolve}from"path";import vm from"vm";var isWindows=process.platform==="win32",stubRequests={"/@vite/client":{injectQuery:id=>id,createHotContext(){return{accept:()=>{},prune:()=>{}}},updateStyle(){}}};async function executeInViteNode({moduleCache,root,files,fetch,inline,external}){let result=[];for(let file of files)result.push(await cachedRequest(`/@fs/${slash(resolve(file))}`,[]));return result;async function directRequest(id,fsPath,callstack){callstack=[...callstack,id];let request=async dep=>{var _a;if(callstack.includes(dep)){let cacheKey=toFilePath(dep,root);if(!((_a=moduleCache.get(cacheKey))==null?void 0:_a.exports))throw new Error(`Circular dependency detected
1
+ import{distDir}from"../chunk-253QKTIQ.js";import{__spreadProps,__spreadValues,init_esm_shims}from"../chunk-7OSWSRXU.js";init_esm_shims();import{resolve as resolve3}from"path";import sade from"sade";import c from"picocolors";var version="0.0.47";init_esm_shims();init_esm_shims();import{builtinModules,createRequire}from"module";import{fileURLToPath,pathToFileURL}from"url";import{dirname,resolve}from"path";import vm from"vm";var isWindows=process.platform==="win32",stubRequests={"/@vite/client":{injectQuery:id=>id,createHotContext(){return{accept:()=>{},prune:()=>{}}},updateStyle(){}}};async function executeInViteNode({moduleCache,root,files,fetch,inline,external}){let externaled=new Set(builtinModules),result=[];for(let file of files)result.push(await cachedRequest(`/@fs/${slash(resolve(file))}`,[]));return result;async function directRequest(id,fsPath,callstack){callstack=[...callstack,id];let request=async dep=>{var _a;if(callstack.includes(dep)){let cacheKey=toFilePath(dep,root);if(!((_a=moduleCache.get(cacheKey))==null?void 0:_a.exports))throw new Error(`Circular dependency detected
2
2
  Stack:
3
3
  ${[...callstack,dep].reverse().map(p=>`- ${p}`).join(`
4
- `)}`);return moduleCache.get(cacheKey).exports}return cachedRequest(dep,callstack)};if(id in stubRequests)return stubRequests[id];let result2=await fetch(id);if(!result2)throw new Error(`failed to load ${id}`);let url=pathToFileURL(fsPath).href,exports={};setCache(fsPath,{transformResult:result2,exports});let __filename2=fileURLToPath(url),context={require:createRequire(url),__filename:__filename2,__dirname:dirname(__filename2),__vite_ssr_import__:request,__vite_ssr_dynamic_import__:request,__vite_ssr_exports__:exports,__vite_ssr_exportAll__:obj=>exportAll(exports,obj),__vite_ssr_import_meta__:{url}};return await vm.runInThisContext(`async (${Object.keys(context).join(",")}) => { ${result2.code} }`,{filename:fsPath,lineOffset:0})(...Object.values(context)),exports}function setCache(id,mod){moduleCache.has(id)?Object.assign(moduleCache.get(id),mod):moduleCache.set(id,mod)}function shouldExternalize(id){for(let ex of inline)if(typeof ex=="string"){if(id.includes(`/node_modules/${ex}/`))return!1}else if(ex.test(id))return!1;for(let ex of external)if(typeof ex=="string"){if(id.includes(`/node_modules/${ex}/`))return!0}else if(ex.test(id))return!0;return id.includes("/node_modules/")}async function cachedRequest(rawId,callstack){var _a,_b;let id=normalizeId(rawId);if(builtinModules.includes(id))return import(id);let fsPath=toFilePath(id,root);if(shouldExternalize(fsPath))return fsPath.match(/^\w:\//)?import(`/${fsPath}`):import(fsPath);if((_a=moduleCache.get(fsPath))==null?void 0:_a.promise)return(_b=moduleCache.get(fsPath))==null?void 0:_b.promise;let promise=directRequest(id,fsPath,callstack);return setCache(fsPath,{promise}),await promise}function exportAll(exports,sourceModule){for(let key in sourceModule)if(key!=="default")try{Object.defineProperty(exports,key,{enumerable:!0,configurable:!0,get(){return sourceModule[key]}})}catch{}}}function normalizeId(id){return id&&id.startsWith("/@id/__x00__")&&(id=`\0${id.slice("/@id/__x00__".length)}`),id&&id.startsWith("/@id/")&&(id=id.slice("/@id/".length)),id.startsWith("__vite-browser-external:")&&(id=id.slice("__vite-browser-external:".length)),id}function toFilePath(id,root){id=slash(id);let absolute=id.startsWith("/@fs/")?id.slice(4):id.startsWith(dirname(root))?id:id.startsWith("/")?slash(resolve(root,id.slice(1))):id;return absolute.startsWith("//")&&(absolute=absolute.slice(1)),isWindows&&absolute.startsWith("/")?pathToFileURL(absolute.slice(1)).href:absolute}function slash(path){return path.replace(/\\/g,"/")}init_esm_shims();async function transformRequest(server,id){if(id.match(/\.(?:[cm]?[jt]sx?|json)$/))return await server.transformRequest(id,{ssr:!0});{let result=await server.transformRequest(id);return result?await server.ssrTransform(result.code,result.map,id):void 0}}async function run(server,config,moduleCache,files){let executeOptions={root:server.config.root,files,fetch:id=>transformRequest(server,id),inline:config.depsInline,external:config.depsExternal,moduleCache};try{await executeInViteNode(executeOptions)}catch(e){throw process.exitCode=1,e}finally{config.watch||await server.close()}}init_esm_shims();import{resolve as resolve2}from"path";import{findUp}from"find-up";import{createServer}from"vite";var configFiles=["vitest.config.ts","vitest.config.js","vitest.config.mjs","vite.config.ts","vite.config.js","vite.config.mjs"];async function initViteServer(options={}){var _a,_b,_c,_d;let{filters}=options,root=resolve2(options.root||process.cwd());process.chdir(root);let configPath=options.config?resolve2(root,options.config):await findUp(configFiles,{cwd:root}),resolved=__spreadValues({},options);resolved.config=configPath,resolved.root=root,resolved.filters=filters?Array.isArray(filters)?filters:[filters]:void 0;let server=await createServer({root,logLevel:"error",clearScreen:!1,configFile:resolved.config,optimizeDeps:{exclude:["vitest"]}});return await server.pluginContainer.buildStart({}),Object.assign(resolved,server.config.test),resolved.depsInline=["vitest/dist","vitest/src","@vue","@vueuse","diff","vue-demi","vue",...((_b=(_a=server.config.test)==null?void 0:_a.deps)==null?void 0:_b.inline)||[]],resolved.depsExternal=((_d=(_c=server.config.test)==null?void 0:_c.deps)==null?void 0:_d.external)||[],{server,config:resolved}}sade("vitest [filter]",!0).version(version).describe("A blazing fast unit test framework powered by Vite.").option("-r, --root","root path",process.cwd()).option("-c, --config","path to config file").option("-w, --watch","watch mode",!1).option("-u, --update","update snapshot",!1).option("--global","inject apis globally",!1).option("--dom","mock browser api using jsdom or happy-dom","").action(async(filters,argv)=>{process.env.VITEST="true",console.log(c.yellow(c.bold(`
4
+ `)}`);return moduleCache.get(cacheKey).exports}return cachedRequest(dep,callstack)};if(id in stubRequests)return stubRequests[id];let result2=await fetch(id);if(!result2)throw new Error(`failed to load ${id}`);let url=pathToFileURL(fsPath).href,exports={};setCache(fsPath,{transformResult:result2,exports});let __filename2=fileURLToPath(url),context={require:createRequire(url),__filename:__filename2,__dirname:dirname(__filename2),__vite_ssr_import__:request,__vite_ssr_dynamic_import__:request,__vite_ssr_exports__:exports,__vite_ssr_exportAll__:obj=>exportAll(exports,obj),__vite_ssr_import_meta__:{url}};return await vm.runInThisContext(`async (${Object.keys(context).join(",")}) => { ${result2.code} }`,{filename:fsPath,lineOffset:0})(...Object.values(context)),exports}function setCache(id,mod){moduleCache.has(id)?Object.assign(moduleCache.get(id),mod):moduleCache.set(id,mod)}async function shouldExternalize(id){for(let ex of inline)if(typeof ex=="string"){if(id.includes(`/node_modules/${ex}/`))return!1}else if(ex.test(id))return!1;for(let ex of external)if(typeof ex=="string"){if(id.includes(`/node_modules/${ex}/`))return!0}else if(ex.test(id))return!0;return id.includes("/node_modules/")}async function cachedRequest(rawId,callstack){var _a,_b;let id=normalizeId(rawId);if(externaled.has(id))return import(id);let fsPath=toFilePath(id,root);if(externaled.has(fsPath)||await shouldExternalize(fsPath))return externaled.add(fsPath),fsPath.match(/^\w:\//)?import(`/${fsPath}`):import(fsPath);if((_a=moduleCache.get(fsPath))==null?void 0:_a.promise)return(_b=moduleCache.get(fsPath))==null?void 0:_b.promise;let promise=directRequest(id,fsPath,callstack);return setCache(fsPath,{promise}),await promise}function exportAll(exports,sourceModule){for(let key in sourceModule)if(key!=="default")try{Object.defineProperty(exports,key,{enumerable:!0,configurable:!0,get(){return sourceModule[key]}})}catch{}}}function normalizeId(id){return id&&id.startsWith("/@id/__x00__")&&(id=`\0${id.slice("/@id/__x00__".length)}`),id&&id.startsWith("/@id/")&&(id=id.slice("/@id/".length)),id.startsWith("__vite-browser-external:")&&(id=id.slice("__vite-browser-external:".length)),id.startsWith("node:")&&(id=id.slice("node:".length)),id}function toFilePath(id,root){id=slash(id);let absolute=id.startsWith("/@fs/")?id.slice(4):id.startsWith(dirname(root))?id:id.startsWith("/")?slash(resolve(root,id.slice(1))):id;return absolute.startsWith("//")&&(absolute=absolute.slice(1)),isWindows&&absolute.startsWith("/")?pathToFileURL(absolute.slice(1)).href:absolute}function slash(path){return path.replace(/\\/g,"/")}init_esm_shims();async function transformRequest(server,id){if(id.match(/\.(?:[cm]?[jt]sx?|json)$/))return await server.transformRequest(id,{ssr:!0});{let result=await server.transformRequest(id);return result?await server.ssrTransform(result.code,result.map,id):void 0}}async function run(server,config,moduleCache,files){let executeOptions={root:server.config.root,files,fetch:id=>transformRequest(server,id),inline:config.depsInline,external:config.depsExternal,moduleCache};try{await executeInViteNode(executeOptions)}catch(e){throw process.exitCode=1,e}finally{config.watch||await server.close()}}init_esm_shims();import{resolve as resolve2}from"path";import{findUp}from"find-up";import{createServer}from"vite";var configFiles=["vitest.config.ts","vitest.config.js","vitest.config.mjs","vite.config.ts","vite.config.js","vite.config.mjs"];async function initViteServer(options={}){var _a,_b,_c,_d;let{filters}=options,root=resolve2(options.root||process.cwd());process.chdir(root);let configPath=options.config?resolve2(root,options.config):await findUp(configFiles,{cwd:root}),resolved=__spreadValues({},options);resolved.config=configPath,resolved.root=root,resolved.filters=filters?Array.isArray(filters)?filters:[filters]:void 0;let server=await createServer({root,logLevel:"error",clearScreen:!1,configFile:resolved.config,optimizeDeps:{exclude:["vitest"]}});return await server.pluginContainer.buildStart({}),Object.assign(resolved,server.config.test),resolved.depsInline=["vitest/dist","vitest/src","@vue","@vueuse","vue-demi","vue",/virtual:/,/\.ts$/,/\/esm\/.*\.js$/,/\.(es|esm|esm-browser|esm-bundler|es6).js$/,...((_b=(_a=server.config.test)==null?void 0:_a.deps)==null?void 0:_b.inline)||[]],resolved.depsExternal=[/node_modules/,...((_d=(_c=server.config.test)==null?void 0:_c.deps)==null?void 0:_d.external)||[]],{server,config:resolved}}sade("vitest [filter]",!0).version(version).describe("A blazing fast unit test framework powered by Vite.").option("-r, --root","root path",process.cwd()).option("-c, --config","path to config file").option("-w, --watch","watch mode",!1).option("-u, --update","update snapshot",!1).option("--global","inject apis globally",!1).option("--dom","mock browser api using jsdom or happy-dom","").action(async(filters,argv)=>{process.env.VITEST="true",console.log(c.yellow(c.bold(`
5
5
  Vitest is currently in closed beta exclusively for Sponsors`))),console.log(c.magenta(`Become a Sponsor of ${c.underline("https://github.com/sponsors/patak-js")} or ${c.underline("https://github.com/sponsors/antfu")}
6
6
  to access the source code and issues tracker \u{1F496}
7
7
  `));let{config,server}=await initViteServer(__spreadProps(__spreadValues({},argv),{filters})),moduleCache=new Map;process.__vitest__={server,config,moduleCache},await run(server,config,moduleCache,[resolve3(distDir,"./node/entry.js")])}).parse(process.argv);
@@ -1,4 +1,13 @@
1
- import{clearContext,context,createSuiteHooks,defaultSuite,getFn,getHooks,setHooks}from"../chunk-AQN47UC5.js";import{defaultExcludes,defaultIncludes}from"../chunk-HKVZR3WA.js";import{__commonJS,__toModule,init_esm_shims}from"../chunk-6IXNQZKF.js";var require_slash=__commonJS({"node_modules/.pnpm/slash@3.0.0/node_modules/slash/index.js"(exports,module){init_esm_shims();"use strict";module.exports=path2=>{let isExtendedLengthPath=/^\\\\\?\\/.test(path2),hasNonAscii=/[^\u0000-\u0080]+/.test(path2);return isExtendedLengthPath||hasNonAscii?path2:path2.replace(/\\/g,"/")}}});init_esm_shims();init_esm_shims();init_esm_shims();import Snap2 from"jest-snapshot";init_esm_shims();import chai from"chai";import Snap from"jest-snapshot";init_esm_shims();import Test from"@jest/test-result";var{makeEmptyAggregatedTestResult}=Test,makeEmptySnapshotSummary=options=>{let summary=makeEmptyAggregatedTestResult().snapshot;return summary.didUpdate=options.updateSnapshot==="all",summary},packSnapshotState=snapshotState=>{let snapshot={added:0,fileDeleted:!1,matched:0,unchecked:0,uncheckedKeys:[],unmatched:0,updated:0},uncheckedCount=snapshotState.getUncheckedCount(),uncheckedKeys=snapshotState.getUncheckedKeys();uncheckedCount&&snapshotState.removeUncheckedKeys();let status=snapshotState.save();return snapshot.fileDeleted=status.deleted,snapshot.added=snapshotState.added,snapshot.matched=snapshotState.matched,snapshot.unmatched=snapshotState.unmatched,snapshot.updated=snapshotState.updated,snapshot.unchecked=status.deleted?0:uncheckedCount,snapshot.uncheckedKeys=Array.from(uncheckedKeys),snapshot},addSnapshotResult=(snapshotSummary,snapshotResult,testFilePath)=>{snapshotResult.added&&snapshotSummary.filesAdded++,snapshotResult.fileDeleted&&snapshotSummary.filesRemoved++,snapshotResult.unmatched&&snapshotSummary.filesUnmatched++,snapshotResult.updated&&snapshotSummary.filesUpdated++,snapshotSummary.added+=snapshotResult.added,snapshotSummary.matched+=snapshotResult.matched,snapshotSummary.unchecked+=snapshotResult.unchecked,snapshotResult.uncheckedKeys&&snapshotResult.uncheckedKeys.length>0&&snapshotSummary.uncheckedKeysByFile.push({filePath:testFilePath,keys:snapshotResult.uncheckedKeys}),snapshotSummary.unmatched+=snapshotResult.unmatched,snapshotSummary.updated+=snapshotResult.updated,snapshotSummary.total+=snapshotResult.added+snapshotResult.matched+snapshotResult.unmatched+snapshotResult.updated};init_esm_shims();var import_slash=__toModule(require_slash());import path,{isAbsolute}from"path";import{pluralize}from"jest-util";import c from"picocolors";var formatTestPath=(rootDir,testPath)=>{isAbsolute(testPath)&&(testPath=path.relative(rootDir,testPath));let dirname=path.dirname(testPath),basename2=path.basename(testPath);return(0,import_slash.default)(c.dim(dirname+path.sep)+c.bold(basename2))},ARROW=" \u203A ",DOWN_ARROW=" \u21B3 ",DOT=" \u2022 ",FAIL_COLOR=v=>c.bold(c.red(v)),OBSOLETE_COLOR=v=>c.bold(c.yellow(v)),SNAPSHOT_ADDED=v=>c.bold(c.green(v)),SNAPSHOT_NOTE=c.dim,SNAPSHOT_REMOVED=v=>c.bold(c.green(v)),SNAPSHOT_SUMMARY=c.bold,SNAPSHOT_UPDATED=v=>c.bold(c.green(v)),updateCommand="re-run mocha with `--update` to update them",getSnapshotSummaryOutput=(rootDir,snapshots)=>{let summary=[];if(summary.push(SNAPSHOT_SUMMARY("Snapshot Summary")),snapshots.added&&summary.push(`${SNAPSHOT_ADDED(`${ARROW+pluralize("snapshot",snapshots.added)} written `)}from ${pluralize("test suite",snapshots.filesAdded)}.`),snapshots.unmatched&&summary.push(`${FAIL_COLOR(`${ARROW}${pluralize("snapshot",snapshots.unmatched)} failed`)} from ${pluralize("test suite",snapshots.filesUnmatched)}. ${SNAPSHOT_NOTE(`Inspect your code changes or ${updateCommand} to update them.`)}`),snapshots.updated&&summary.push(`${SNAPSHOT_UPDATED(`${ARROW+pluralize("snapshot",snapshots.updated)} updated `)}from ${pluralize("test suite",snapshots.filesUpdated)}.`),snapshots.filesRemoved&&(snapshots.didUpdate?summary.push(`${SNAPSHOT_REMOVED(`${ARROW}${pluralize("snapshot file",snapshots.filesRemoved)} removed `)}from ${pluralize("test suite",snapshots.filesRemoved)}.`):summary.push(`${OBSOLETE_COLOR(`${ARROW}${pluralize("snapshot file",snapshots.filesRemoved)} obsolete `)}from ${pluralize("test suite",snapshots.filesRemoved)}. ${SNAPSHOT_NOTE(`To remove ${snapshots.filesRemoved===1?"it":"them all"}, ${updateCommand}.`)}`)),snapshots.filesRemovedList&&snapshots.filesRemovedList.length){let[head,...tail]=snapshots.filesRemovedList;summary.push(` ${DOWN_ARROW} ${DOT}${formatTestPath(rootDir,head)}`),tail.forEach(key=>{summary.push(` ${DOT}${formatTestPath(rootDir,key)}`)})}return snapshots.unchecked&&(snapshots.didUpdate?summary.push(`${SNAPSHOT_REMOVED(`${ARROW}${pluralize("snapshot",snapshots.unchecked)} removed `)}from ${pluralize("test suite",snapshots.uncheckedKeysByFile.length)}.`):summary.push(`${OBSOLETE_COLOR(`${ARROW}${pluralize("snapshot",snapshots.unchecked)} obsolete `)}from ${pluralize("test suite",snapshots.uncheckedKeysByFile.length)}. ${SNAPSHOT_NOTE(`To remove ${snapshots.unchecked===1?"it":"them all"}, ${updateCommand}.`)}`),snapshots.uncheckedKeysByFile.forEach(uncheckedFile=>{summary.push(` ${DOWN_ARROW}${formatTestPath(rootDir,uncheckedFile.filePath)}`),uncheckedFile.keys.forEach(key=>{summary.push(` ${DOT}${key}`)})})),summary};var{expect}=chai,{SnapshotState}=Snap,SnapshotManager=class{snapshotState=null;snapshotSummary;snapshotOptions;ctx=null;testFile="";snapshotResolver;rootDir;constructor({rootDir,update,snapshotResolver=null}){this.rootDir=rootDir,this.snapshotResolver=snapshotResolver;let env=process.env,CI=!!env.CI,UPDATE_SNAPSHOT=update||env.UPDATE_SNAPSHOT;this.snapshotOptions={updateSnapshot:CI&&!UPDATE_SNAPSHOT?"none":UPDATE_SNAPSHOT?"all":"new"},this.snapshotSummary=makeEmptySnapshotSummary(this.snapshotOptions)}onFileChanged(){!this.ctx||(this.snapshotState!==null&&this.saveSnap(),this.testFile=this.ctx.file,this.snapshotState=new SnapshotState(this.snapshotResolver.resolveSnapshotPath(this.testFile),this.snapshotOptions))}setTest(test){var _a;this.setContext({file:((_a=test.file)==null?void 0:_a.filepath)||test.name,title:test.name,fullTitle:[test.suite.name,test.name].filter(Boolean).join(" > ")})}setContext(context2){!context2.title||!context2.file||(this.ctx=context2,this.testFile!==context2.file&&this.onFileChanged())}assert(received,message){if(!this.snapshotState||!this.ctx)return;let{actual,expected,key,pass}=this.snapshotState.match({testName:this.ctx.fullTitle||this.ctx.title||this.ctx.file,received,isInline:!1});pass||expect(actual.trim()).equals(expected?expected.trim():"",message||`Snapshot name: \`${key}\``)}clear(){this.snapshotSummary=makeEmptySnapshotSummary(this.snapshotOptions)}saveSnap(){if(!this.testFile||!this.snapshotState)return;let packedSnapshotState=packSnapshotState(this.snapshotState);addSnapshotResult(this.snapshotSummary,packedSnapshotState,this.testFile),this.testFile="",this.snapshotState=null}report(){let outputs=getSnapshotSummaryOutput(this.rootDir,this.snapshotSummary);if(outputs.length>1)return outputs}};var{addSerializer}=Snap2,_manager;function getSnapshotManager(){return _manager}async function SnapshotPlugin(options){let{root:rootDir}=options;return _manager=new SnapshotManager({rootDir,update:options.update}),_manager.snapshotResolver=await Snap2.buildSnapshotResolver({transform:[],rootDir}),function(chai3,utils){for(let key of["matchSnapshot","toMatchSnapshot"])utils.addMethod(chai3.Assertion.prototype,key,function(message){let expected=utils.flag(this,"object");_manager.assert(expected,message)});chai3.expect.addSnapshotSerializer=addSerializer}}init_esm_shims();import{slash as slash2}from"@antfu/utils";init_esm_shims();import{basename}from"path";init_esm_shims();import{toArray}from"@antfu/utils";function partitionSuiteChildren(suite){let tasksGroup=[],tasksGroups=[];for(let c4 of suite.tasks)tasksGroup.length===0||c4.computeMode===tasksGroup[0].computeMode?tasksGroup.push(c4):(tasksGroups.push(tasksGroup),tasksGroup=[c4]);return tasksGroup.length>0&&tasksGroups.push(tasksGroup),tasksGroups}function interpretOnlyMode(items){items.some(i=>i.mode==="only")&&items.forEach(i=>{i.mode==="run"?i.mode="skip":i.mode==="only"&&(i.mode="run")})}function getTests(suite){return toArray(suite).flatMap(s=>s.tasks.flatMap(c4=>c4.type==="test"?[c4]:getTests(c4)))}function getSuites(suite){return toArray(suite).flatMap(s=>s.type==="suite"?[s,...getSuites(s.tasks)]:[])}function hasTests(suite){return toArray(suite).some(s=>s.tasks.some(c4=>c4.type==="test"||hasTests(c4)))}function hasFailed(suite){return toArray(suite).some(s=>s.tasks.some(c4=>{var _a;return((_a=c4.result)==null?void 0:_a.state)==="fail"}))}async function collectTests(paths){let files={};for(let filepath of paths){let file={name:basename(filepath),type:"suite",mode:"run",computeMode:"serial",filepath,tasks:[]};setHooks(file,createSuiteHooks()),clearContext();try{await import(filepath);for(let c4 of[defaultSuite,...context.tasks])if(c4.type==="test")file.tasks.push(c4);else{let suite=await c4.collect(file);(suite.name||suite.tasks.length)&&file.tasks.push(suite)}}catch(e){file.result={start:performance.now(),state:"fail",error:e},process.exitCode=1}files[filepath]=file}let allChildren=Object.values(files).reduce((tasks,file)=>tasks.concat(file.tasks),[]);return interpretOnlyMode(allChildren),allChildren.forEach(i=>{i.type==="suite"&&(i.mode==="skip"?i.tasks.forEach(c4=>c4.mode==="run"&&(c4.mode="skip")):interpretOnlyMode(i.tasks))}),files}async function startWatcher(ctx){var _a;let{reporter,snapshotManager,filesMap}=ctx;await((_a=reporter.onWatcherStart)==null?void 0:_a.call(reporter,ctx));let timer2,changedTests=new Set,seen=new Set,{server,moduleCache}=process.__vitest__;server.watcher.on("change",async id=>{id=slash2(id),getAffectedTests(id,ctx,changedTests,seen),seen.forEach(i=>moduleCache.delete(i)),seen.clear(),changedTests.size!==0&&(clearTimeout(timer2),timer2=setTimeout(async()=>{var _a2,_b,_c,_d;if(changedTests.size===0)return;snapshotManager.clear();let paths=Array.from(changedTests);changedTests.clear(),await((_a2=reporter.onWatcherRerun)==null?void 0:_a2.call(reporter,paths,id,ctx)),paths.forEach(i=>moduleCache.delete(i));let newFilesMap=await collectTests(paths);Object.assign(filesMap,newFilesMap);let files=Object.values(filesMap);(_b=reporter.onCollected)==null||_b.call(reporter,files,ctx),await runSuites(files,ctx),snapshotManager.saveSnap(),await((_c=reporter.onFinished)==null?void 0:_c.call(reporter,ctx,Object.values(newFilesMap))),await((_d=reporter.onWatcherStart)==null?void 0:_d.call(reporter,ctx))},100))}),await new Promise(()=>{})}function getAffectedTests(id,ctx,set=new Set,seen=new Set){if(seen.has(id)||set.has(id))return set;if(seen.add(id),id in ctx.filesMap)return set.add(id),set;let mod=process.__vitest__.server.moduleGraph.getModuleById(id);return mod&&mod.importers.forEach(i=>{i.id&&getAffectedTests(i.id,ctx,set,seen)}),set}init_esm_shims();import fg from"fast-glob";async function globTestFiles(config){var _a;let testFilepaths=await fg(config.includes||defaultIncludes,{absolute:!0,cwd:config.root,ignore:config.excludes||defaultExcludes});return((_a=config.filters)==null?void 0:_a.length)&&(testFilepaths=testFilepaths.filter(i=>config.filters.some(f=>i.includes(f)))),testFilepaths}init_esm_shims();init_esm_shims();import{performance as performance2}from"perf_hooks";import{relative}from"path";import c3 from"picocolors";import Listr from"listr";init_esm_shims();import{promises as fs,existsSync}from"fs";import c2 from"picocolors";import{createPatch}from"diff";import{notNullish}from"@antfu/utils";import{SourceMapConsumer}from"source-map";async function printError(error){var _a;if(!(error instanceof Error)){console.error(error);return}let{moduleCache}=process.__vitest__,e=error,codeFramePrinted=!1,nearest=parseStack(e.stack||"").find(stack=>moduleCache.has(stack.file));if(nearest){let transformResult=(_a=moduleCache.get(nearest.file))==null?void 0:_a.transformResult,pos=await getOriginalPos(transformResult==null?void 0:transformResult.map,nearest);if(pos&&existsSync(nearest.file)){let sourceCode=await fs.readFile(nearest.file,"utf-8");console.error(`${c2.red(`${c2.bold(e.name)}: ${e.message}`)}`),console.log(c2.gray(`${nearest.file}:${pos.line}:${pos.column}`)),console.log(c2.yellow(generateCodeFrame(sourceCode,pos))),codeFramePrinted=!0}}codeFramePrinted||console.error(e),e.showDiff&&console.error(c2.gray(generateDiff(stringify(e.actual),stringify(e.expected))))}function getOriginalPos(map,{line,column}){return new Promise(resolve=>{if(!map)return resolve(null);SourceMapConsumer.with(map,null,consumer=>{let pos=consumer.originalPositionFor({line,column});pos.line!=null&&pos.column!=null?resolve(pos):resolve(null)})})}var splitRE=/\r?\n/;function posToNumber(source,pos){if(typeof pos=="number")return pos;let lines=source.split(splitRE),{line,column}=pos,start=0;for(let i=0;i<line-1;i++)start+=lines[i].length+1;return start+column}function generateCodeFrame(source,start=0,end,range=2){start=posToNumber(source,start),end=end||start;let lines=source.split(splitRE),count=0,res=[];for(let i=0;i<lines.length;i++)if(count+=lines[i].length+1,count>=start){for(let j=i-range;j<=i+range||end>count;j++){if(j<0||j>=lines.length)continue;let line=j+1;res.push(`${c2.gray(`${line}${" ".repeat(Math.max(3-String(line).length,0))}|`)} ${lines[j]}`);let lineLength=lines[j].length;if(lineLength>200)return"";if(j===i){let pad=start-(count-lineLength)+1,length=Math.max(1,end>count?lineLength-pad:end-start);res.push(`${c2.gray(" |")} ${" ".repeat(pad)}${"^".repeat(length)}`)}else if(j>i){if(end>count){let length=Math.max(Math.min(end-count,lineLength),1);res.push(`${c2.gray(" |")} ${"^".repeat(length)}`)}count+=lineLength+1}}break}return res.join(`
1
+ import{clearContext,context,createSuiteHooks,defaultSuite,getFn,getHooks,setHooks}from"../chunk-6ZV4435G.js";import{defaultExcludes,defaultIncludes}from"../chunk-253QKTIQ.js";import{__commonJS,__require,__spreadProps,__spreadValues,__toModule,init_esm_shims}from"../chunk-7OSWSRXU.js";var require_slash=__commonJS({"node_modules/.pnpm/slash@3.0.0/node_modules/slash/index.js"(exports,module){init_esm_shims();"use strict";module.exports=path2=>{let isExtendedLengthPath=/^\\\\\?\\/.test(path2),hasNonAscii=/[^\u0000-\u0080]+/.test(path2);return isExtendedLengthPath||hasNonAscii?path2:path2.replace(/\\/g,"/")}}});var require_mimic_fn=__commonJS({"node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js"(exports,module){init_esm_shims();"use strict";var mimicFn=(to,from)=>{for(let prop of Reflect.ownKeys(from))Object.defineProperty(to,prop,Object.getOwnPropertyDescriptor(from,prop));return to};module.exports=mimicFn;module.exports.default=mimicFn}});var require_onetime=__commonJS({"node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js"(exports,module){init_esm_shims();"use strict";var mimicFn=require_mimic_fn(),calledFunctions=new WeakMap,onetime2=(function_,options={})=>{if(typeof function_!="function")throw new TypeError("Expected a function");let returnValue,callCount=0,functionName=function_.displayName||function_.name||"<anonymous>",onetime3=function(...arguments_){if(calledFunctions.set(onetime3,++callCount),callCount===1)returnValue=function_.apply(this,arguments_),function_=null;else if(options.throw===!0)throw new Error(`Function \`${functionName}\` can only be called once`);return returnValue};return mimicFn(onetime3,function_),calledFunctions.set(onetime3,callCount),onetime3};module.exports=onetime2;module.exports.default=onetime2;module.exports.callCount=function_=>{if(!calledFunctions.has(function_))throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);return calledFunctions.get(function_)}}});var require_signals=__commonJS({"node_modules/.pnpm/signal-exit@3.0.6/node_modules/signal-exit/signals.js"(exports,module){init_esm_shims();module.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&module.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&module.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}});var require_signal_exit=__commonJS({"node_modules/.pnpm/signal-exit@3.0.6/node_modules/signal-exit/index.js"(exports,module){init_esm_shims();var process6=global.process,processOk=function(process7){return process7&&typeof process7=="object"&&typeof process7.removeListener=="function"&&typeof process7.emit=="function"&&typeof process7.reallyExit=="function"&&typeof process7.listeners=="function"&&typeof process7.kill=="function"&&typeof process7.pid=="number"&&typeof process7.on=="function"};processOk(process6)?(assert=__require("assert"),signals=require_signals(),isWin=/^win/i.test(process6.platform),EE=__require("events"),typeof EE!="function"&&(EE=EE.EventEmitter),process6.__signal_exit_emitter__?emitter=process6.__signal_exit_emitter__:(emitter=process6.__signal_exit_emitter__=new EE,emitter.count=0,emitter.emitted={}),emitter.infinite||(emitter.setMaxListeners(1/0),emitter.infinite=!0),module.exports=function(cb,opts){if(!!processOk(global.process)){assert.equal(typeof cb,"function","a callback must be provided for exit handler"),loaded===!1&&load();var ev="exit";opts&&opts.alwaysLast&&(ev="afterexit");var remove=function(){emitter.removeListener(ev,cb),emitter.listeners("exit").length===0&&emitter.listeners("afterexit").length===0&&unload()};return emitter.on(ev,cb),remove}},unload=function(){!loaded||!processOk(global.process)||(loaded=!1,signals.forEach(function(sig){try{process6.removeListener(sig,sigListeners[sig])}catch{}}),process6.emit=originalProcessEmit,process6.reallyExit=originalProcessReallyExit,emitter.count-=1)},module.exports.unload=unload,emit=function(event,code,signal){emitter.emitted[event]||(emitter.emitted[event]=!0,emitter.emit(event,code,signal))},sigListeners={},signals.forEach(function(sig){sigListeners[sig]=function(){if(!!processOk(global.process)){var listeners=process6.listeners(sig);listeners.length===emitter.count&&(unload(),emit("exit",null,sig),emit("afterexit",null,sig),isWin&&sig==="SIGHUP"&&(sig="SIGINT"),process6.kill(process6.pid,sig))}}}),module.exports.signals=function(){return signals},loaded=!1,load=function(){loaded||!processOk(global.process)||(loaded=!0,emitter.count+=1,signals=signals.filter(function(sig){try{return process6.on(sig,sigListeners[sig]),!0}catch{return!1}}),process6.emit=processEmit,process6.reallyExit=processReallyExit)},module.exports.load=load,originalProcessReallyExit=process6.reallyExit,processReallyExit=function(code){!processOk(global.process)||(process6.exitCode=code||0,emit("exit",process6.exitCode,null),emit("afterexit",process6.exitCode,null),originalProcessReallyExit.call(process6,process6.exitCode))},originalProcessEmit=process6.emit,processEmit=function(ev,arg){if(ev==="exit"&&processOk(global.process)){arg!==void 0&&(process6.exitCode=arg);var ret=originalProcessEmit.apply(this,arguments);return emit("exit",process6.exitCode,null),emit("afterexit",process6.exitCode,null),ret}else return originalProcessEmit.apply(this,arguments)}):module.exports=function(){};var assert,signals,isWin,EE,emitter,unload,emit,sigListeners,loaded,load,originalProcessReallyExit,processReallyExit,originalProcessEmit,processEmit}});var require_emoji_regex=__commonJS({"node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js"(exports,module){init_esm_shims();"use strict";module.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}}});var require_indent_string=__commonJS({"node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js"(exports,module){init_esm_shims();"use strict";module.exports=(string,count=1,options)=>{if(options=__spreadValues({indent:" ",includeEmptyLines:!1},options),typeof string!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof string}\``);if(typeof count!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof count}\``);if(typeof options.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``);if(count===0)return string;let regex=options.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return string.replace(regex,options.indent.repeat(count))}}});var require_color_name=__commonJS({"node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports,module){init_esm_shims();"use strict";module.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}});var require_conversions=__commonJS({"node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"(exports,module){init_esm_shims();var cssKeywords=require_color_name(),reverseKeywords={};for(let key of Object.keys(cssKeywords))reverseKeywords[cssKeywords[key]]=key;var convert={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};module.exports=convert;for(let model of Object.keys(convert)){if(!("channels"in convert[model]))throw new Error("missing channels property: "+model);if(!("labels"in convert[model]))throw new Error("missing channel labels property: "+model);if(convert[model].labels.length!==convert[model].channels)throw new Error("channel and label counts mismatch: "+model);let{channels,labels}=convert[model];delete convert[model].channels,delete convert[model].labels,Object.defineProperty(convert[model],"channels",{value:channels}),Object.defineProperty(convert[model],"labels",{value:labels})}convert.rgb.hsl=function(rgb){let r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255,min=Math.min(r,g,b),max=Math.max(r,g,b),delta=max-min,h,s;max===min?h=0:r===max?h=(g-b)/delta:g===max?h=2+(b-r)/delta:b===max&&(h=4+(r-g)/delta),h=Math.min(h*60,360),h<0&&(h+=360);let l=(min+max)/2;return max===min?s=0:l<=.5?s=delta/(max+min):s=delta/(2-max-min),[h,s*100,l*100]};convert.rgb.hsv=function(rgb){let rdif,gdif,bdif,h,s,r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255,v=Math.max(r,g,b),diff3=v-Math.min(r,g,b),diffc=function(c5){return(v-c5)/6/diff3+1/2};return diff3===0?(h=0,s=0):(s=diff3/v,rdif=diffc(r),gdif=diffc(g),bdif=diffc(b),r===v?h=bdif-gdif:g===v?h=1/3+rdif-bdif:b===v&&(h=2/3+gdif-rdif),h<0?h+=1:h>1&&(h-=1)),[h*360,s*100,v*100]};convert.rgb.hwb=function(rgb){let r=rgb[0],g=rgb[1],b=rgb[2],h=convert.rgb.hsl(rgb)[0],w=1/255*Math.min(r,Math.min(g,b));return b=1-1/255*Math.max(r,Math.max(g,b)),[h,w*100,b*100]};convert.rgb.cmyk=function(rgb){let r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255,k=Math.min(1-r,1-g,1-b),c5=(1-r-k)/(1-k)||0,m=(1-g-k)/(1-k)||0,y=(1-b-k)/(1-k)||0;return[c5*100,m*100,y*100,k*100]};function comparativeDistance(x,y){return(x[0]-y[0])**2+(x[1]-y[1])**2+(x[2]-y[2])**2}convert.rgb.keyword=function(rgb){let reversed=reverseKeywords[rgb];if(reversed)return reversed;let currentClosestDistance=1/0,currentClosestKeyword;for(let keyword of Object.keys(cssKeywords)){let value=cssKeywords[keyword],distance=comparativeDistance(rgb,value);distance<currentClosestDistance&&(currentClosestDistance=distance,currentClosestKeyword=keyword)}return currentClosestKeyword};convert.keyword.rgb=function(keyword){return cssKeywords[keyword]};convert.rgb.xyz=function(rgb){let r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255;r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,g=g>.04045?((g+.055)/1.055)**2.4:g/12.92,b=b>.04045?((b+.055)/1.055)**2.4:b/12.92;let x=r*.4124+g*.3576+b*.1805,y=r*.2126+g*.7152+b*.0722,z=r*.0193+g*.1192+b*.9505;return[x*100,y*100,z*100]};convert.rgb.lab=function(rgb){let xyz=convert.rgb.xyz(rgb),x=xyz[0],y=xyz[1],z=xyz[2];x/=95.047,y/=100,z/=108.883,x=x>.008856?x**(1/3):7.787*x+16/116,y=y>.008856?y**(1/3):7.787*y+16/116,z=z>.008856?z**(1/3):7.787*z+16/116;let l=116*y-16,a=500*(x-y),b=200*(y-z);return[l,a,b]};convert.hsl.rgb=function(hsl){let h=hsl[0]/360,s=hsl[1]/100,l=hsl[2]/100,t2,t3,val;if(s===0)return val=l*255,[val,val,val];l<.5?t2=l*(1+s):t2=l+s-l*s;let t1=2*l-t2,rgb=[0,0,0];for(let i=0;i<3;i++)t3=h+1/3*-(i-1),t3<0&&t3++,t3>1&&t3--,6*t3<1?val=t1+(t2-t1)*6*t3:2*t3<1?val=t2:3*t3<2?val=t1+(t2-t1)*(2/3-t3)*6:val=t1,rgb[i]=val*255;return rgb};convert.hsl.hsv=function(hsl){let h=hsl[0],s=hsl[1]/100,l=hsl[2]/100,smin=s,lmin=Math.max(l,.01);l*=2,s*=l<=1?l:2-l,smin*=lmin<=1?lmin:2-lmin;let v=(l+s)/2,sv=l===0?2*smin/(lmin+smin):2*s/(l+s);return[h,sv*100,v*100]};convert.hsv.rgb=function(hsv){let h=hsv[0]/60,s=hsv[1]/100,v=hsv[2]/100,hi=Math.floor(h)%6,f=h-Math.floor(h),p=255*v*(1-s),q=255*v*(1-s*f),t=255*v*(1-s*(1-f));switch(v*=255,hi){case 0:return[v,t,p];case 1:return[q,v,p];case 2:return[p,v,t];case 3:return[p,q,v];case 4:return[t,p,v];case 5:return[v,p,q]}};convert.hsv.hsl=function(hsv){let h=hsv[0],s=hsv[1]/100,v=hsv[2]/100,vmin=Math.max(v,.01),sl,l;l=(2-s)*v;let lmin=(2-s)*vmin;return sl=s*vmin,sl/=lmin<=1?lmin:2-lmin,sl=sl||0,l/=2,[h,sl*100,l*100]};convert.hwb.rgb=function(hwb){let h=hwb[0]/360,wh=hwb[1]/100,bl=hwb[2]/100,ratio=wh+bl,f;ratio>1&&(wh/=ratio,bl/=ratio);let i=Math.floor(6*h),v=1-bl;f=6*h-i,(i&1)!=0&&(f=1-f);let n=wh+f*(v-wh),r,g,b;switch(i){default:case 6:case 0:r=v,g=n,b=wh;break;case 1:r=n,g=v,b=wh;break;case 2:r=wh,g=v,b=n;break;case 3:r=wh,g=n,b=v;break;case 4:r=n,g=wh,b=v;break;case 5:r=v,g=wh,b=n;break}return[r*255,g*255,b*255]};convert.cmyk.rgb=function(cmyk){let c5=cmyk[0]/100,m=cmyk[1]/100,y=cmyk[2]/100,k=cmyk[3]/100,r=1-Math.min(1,c5*(1-k)+k),g=1-Math.min(1,m*(1-k)+k),b=1-Math.min(1,y*(1-k)+k);return[r*255,g*255,b*255]};convert.xyz.rgb=function(xyz){let x=xyz[0]/100,y=xyz[1]/100,z=xyz[2]/100,r,g,b;return r=x*3.2406+y*-1.5372+z*-.4986,g=x*-.9689+y*1.8758+z*.0415,b=x*.0557+y*-.204+z*1.057,r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92,g=g>.0031308?1.055*g**(1/2.4)-.055:g*12.92,b=b>.0031308?1.055*b**(1/2.4)-.055:b*12.92,r=Math.min(Math.max(0,r),1),g=Math.min(Math.max(0,g),1),b=Math.min(Math.max(0,b),1),[r*255,g*255,b*255]};convert.xyz.lab=function(xyz){let x=xyz[0],y=xyz[1],z=xyz[2];x/=95.047,y/=100,z/=108.883,x=x>.008856?x**(1/3):7.787*x+16/116,y=y>.008856?y**(1/3):7.787*y+16/116,z=z>.008856?z**(1/3):7.787*z+16/116;let l=116*y-16,a=500*(x-y),b=200*(y-z);return[l,a,b]};convert.lab.xyz=function(lab){let l=lab[0],a=lab[1],b=lab[2],x,y,z;y=(l+16)/116,x=a/500+y,z=y-b/200;let y2=y**3,x2=x**3,z2=z**3;return y=y2>.008856?y2:(y-16/116)/7.787,x=x2>.008856?x2:(x-16/116)/7.787,z=z2>.008856?z2:(z-16/116)/7.787,x*=95.047,y*=100,z*=108.883,[x,y,z]};convert.lab.lch=function(lab){let l=lab[0],a=lab[1],b=lab[2],h;h=Math.atan2(b,a)*360/2/Math.PI,h<0&&(h+=360);let c5=Math.sqrt(a*a+b*b);return[l,c5,h]};convert.lch.lab=function(lch){let l=lch[0],c5=lch[1],hr=lch[2]/360*2*Math.PI,a=c5*Math.cos(hr),b=c5*Math.sin(hr);return[l,a,b]};convert.rgb.ansi16=function(args,saturation=null){let[r,g,b]=args,value=saturation===null?convert.rgb.hsv(args)[2]:saturation;if(value=Math.round(value/50),value===0)return 30;let ansi=30+(Math.round(b/255)<<2|Math.round(g/255)<<1|Math.round(r/255));return value===2&&(ansi+=60),ansi};convert.hsv.ansi16=function(args){return convert.rgb.ansi16(convert.hsv.rgb(args),args[2])};convert.rgb.ansi256=function(args){let r=args[0],g=args[1],b=args[2];return r===g&&g===b?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(g/255*5)+Math.round(b/255*5)};convert.ansi16.rgb=function(args){let color=args%10;if(color===0||color===7)return args>50&&(color+=3.5),color=color/10.5*255,[color,color,color];let mult=(~~(args>50)+1)*.5,r=(color&1)*mult*255,g=(color>>1&1)*mult*255,b=(color>>2&1)*mult*255;return[r,g,b]};convert.ansi256.rgb=function(args){if(args>=232){let c5=(args-232)*10+8;return[c5,c5,c5]}args-=16;let rem,r=Math.floor(args/36)/5*255,g=Math.floor((rem=args%36)/6)/5*255,b=rem%6/5*255;return[r,g,b]};convert.rgb.hex=function(args){let string=(((Math.round(args[0])&255)<<16)+((Math.round(args[1])&255)<<8)+(Math.round(args[2])&255)).toString(16).toUpperCase();return"000000".substring(string.length)+string};convert.hex.rgb=function(args){let match=args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!match)return[0,0,0];let colorString=match[0];match[0].length===3&&(colorString=colorString.split("").map(char=>char+char).join(""));let integer=parseInt(colorString,16),r=integer>>16&255,g=integer>>8&255,b=integer&255;return[r,g,b]};convert.rgb.hcg=function(rgb){let r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255,max=Math.max(Math.max(r,g),b),min=Math.min(Math.min(r,g),b),chroma=max-min,grayscale,hue;return chroma<1?grayscale=min/(1-chroma):grayscale=0,chroma<=0?hue=0:max===r?hue=(g-b)/chroma%6:max===g?hue=2+(b-r)/chroma:hue=4+(r-g)/chroma,hue/=6,hue%=1,[hue*360,chroma*100,grayscale*100]};convert.hsl.hcg=function(hsl){let s=hsl[1]/100,l=hsl[2]/100,c5=l<.5?2*s*l:2*s*(1-l),f=0;return c5<1&&(f=(l-.5*c5)/(1-c5)),[hsl[0],c5*100,f*100]};convert.hsv.hcg=function(hsv){let s=hsv[1]/100,v=hsv[2]/100,c5=s*v,f=0;return c5<1&&(f=(v-c5)/(1-c5)),[hsv[0],c5*100,f*100]};convert.hcg.rgb=function(hcg){let h=hcg[0]/360,c5=hcg[1]/100,g=hcg[2]/100;if(c5===0)return[g*255,g*255,g*255];let pure=[0,0,0],hi=h%1*6,v=hi%1,w=1-v,mg=0;switch(Math.floor(hi)){case 0:pure[0]=1,pure[1]=v,pure[2]=0;break;case 1:pure[0]=w,pure[1]=1,pure[2]=0;break;case 2:pure[0]=0,pure[1]=1,pure[2]=v;break;case 3:pure[0]=0,pure[1]=w,pure[2]=1;break;case 4:pure[0]=v,pure[1]=0,pure[2]=1;break;default:pure[0]=1,pure[1]=0,pure[2]=w}return mg=(1-c5)*g,[(c5*pure[0]+mg)*255,(c5*pure[1]+mg)*255,(c5*pure[2]+mg)*255]};convert.hcg.hsv=function(hcg){let c5=hcg[1]/100,g=hcg[2]/100,v=c5+g*(1-c5),f=0;return v>0&&(f=c5/v),[hcg[0],f*100,v*100]};convert.hcg.hsl=function(hcg){let c5=hcg[1]/100,l=hcg[2]/100*(1-c5)+.5*c5,s=0;return l>0&&l<.5?s=c5/(2*l):l>=.5&&l<1&&(s=c5/(2*(1-l))),[hcg[0],s*100,l*100]};convert.hcg.hwb=function(hcg){let c5=hcg[1]/100,g=hcg[2]/100,v=c5+g*(1-c5);return[hcg[0],(v-c5)*100,(1-v)*100]};convert.hwb.hcg=function(hwb){let w=hwb[1]/100,b=hwb[2]/100,v=1-b,c5=v-w,g=0;return c5<1&&(g=(v-c5)/(1-c5)),[hwb[0],c5*100,g*100]};convert.apple.rgb=function(apple){return[apple[0]/65535*255,apple[1]/65535*255,apple[2]/65535*255]};convert.rgb.apple=function(rgb){return[rgb[0]/255*65535,rgb[1]/255*65535,rgb[2]/255*65535]};convert.gray.rgb=function(args){return[args[0]/100*255,args[0]/100*255,args[0]/100*255]};convert.gray.hsl=function(args){return[0,0,args[0]]};convert.gray.hsv=convert.gray.hsl;convert.gray.hwb=function(gray){return[0,100,gray[0]]};convert.gray.cmyk=function(gray){return[0,0,0,gray[0]]};convert.gray.lab=function(gray){return[gray[0],0,0]};convert.gray.hex=function(gray){let val=Math.round(gray[0]/100*255)&255,string=((val<<16)+(val<<8)+val).toString(16).toUpperCase();return"000000".substring(string.length)+string};convert.rgb.gray=function(rgb){return[(rgb[0]+rgb[1]+rgb[2])/3/255*100]}}});var require_route=__commonJS({"node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"(exports,module){init_esm_shims();var conversions=require_conversions();function buildGraph(){let graph={},models=Object.keys(conversions);for(let len=models.length,i=0;i<len;i++)graph[models[i]]={distance:-1,parent:null};return graph}function deriveBFS(fromModel){let graph=buildGraph(),queue=[fromModel];for(graph[fromModel].distance=0;queue.length;){let current=queue.pop(),adjacents=Object.keys(conversions[current]);for(let len=adjacents.length,i=0;i<len;i++){let adjacent=adjacents[i],node=graph[adjacent];node.distance===-1&&(node.distance=graph[current].distance+1,node.parent=current,queue.unshift(adjacent))}}return graph}function link(from,to){return function(args){return to(from(args))}}function wrapConversion(toModel,graph){let path2=[graph[toModel].parent,toModel],fn=conversions[graph[toModel].parent][toModel],cur=graph[toModel].parent;for(;graph[cur].parent;)path2.unshift(graph[cur].parent),fn=link(conversions[graph[cur].parent][cur],fn),cur=graph[cur].parent;return fn.conversion=path2,fn}module.exports=function(fromModel){let graph=deriveBFS(fromModel),conversion={},models=Object.keys(graph);for(let len=models.length,i=0;i<len;i++){let toModel=models[i];graph[toModel].parent!==null&&(conversion[toModel]=wrapConversion(toModel,graph))}return conversion}}});var require_color_convert=__commonJS({"node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"(exports,module){init_esm_shims();var conversions=require_conversions(),route=require_route(),convert={},models=Object.keys(conversions);function wrapRaw(fn){let wrappedFn=function(...args){let arg0=args[0];return arg0==null?arg0:(arg0.length>1&&(args=arg0),fn(args))};return"conversion"in fn&&(wrappedFn.conversion=fn.conversion),wrappedFn}function wrapRounded(fn){let wrappedFn=function(...args){let arg0=args[0];if(arg0==null)return arg0;arg0.length>1&&(args=arg0);let result=fn(args);if(typeof result=="object")for(let len=result.length,i=0;i<len;i++)result[i]=Math.round(result[i]);return result};return"conversion"in fn&&(wrappedFn.conversion=fn.conversion),wrappedFn}models.forEach(fromModel=>{convert[fromModel]={},Object.defineProperty(convert[fromModel],"channels",{value:conversions[fromModel].channels}),Object.defineProperty(convert[fromModel],"labels",{value:conversions[fromModel].labels});let routes=route(fromModel);Object.keys(routes).forEach(toModel=>{let fn=routes[toModel];convert[fromModel][toModel]=wrapRounded(fn),convert[fromModel][toModel].raw=wrapRaw(fn)})});module.exports=convert}});var require_ansi_styles=__commonJS({"node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"(exports,module){init_esm_shims();"use strict";var wrapAnsi162=(fn,offset)=>(...args)=>`[${fn(...args)+offset}m`,wrapAnsi2562=(fn,offset)=>(...args)=>{let code=fn(...args);return`[${38+offset};5;${code}m`},wrapAnsi16m2=(fn,offset)=>(...args)=>{let rgb=fn(...args);return`[${38+offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`},ansi2ansi=n=>n,rgb2rgb=(r,g,b)=>[r,g,b],setLazyProperty=(object,property,get)=>{Object.defineProperty(object,property,{get:()=>{let value=get();return Object.defineProperty(object,property,{value,enumerable:!0,configurable:!0}),value},enumerable:!0,configurable:!0})},colorConvert,makeDynamicStyles=(wrap,targetSpace,identity,isBackground)=>{colorConvert===void 0&&(colorConvert=require_color_convert());let offset=isBackground?10:0,styles={};for(let[sourceSpace,suite]of Object.entries(colorConvert)){let name=sourceSpace==="ansi16"?"ansi":sourceSpace;sourceSpace===targetSpace?styles[name]=wrap(identity,offset):typeof suite=="object"&&(styles[name]=wrap(suite[targetSpace],offset))}return styles};function assembleStyles2(){let codes=new Map,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};styles.color.gray=styles.color.blackBright,styles.bgColor.bgGray=styles.bgColor.bgBlackBright,styles.color.grey=styles.color.blackBright,styles.bgColor.bgGrey=styles.bgColor.bgBlackBright;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`[${style[0]}m`,close:`[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1})}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="",styles.bgColor.close="",setLazyProperty(styles.color,"ansi",()=>makeDynamicStyles(wrapAnsi162,"ansi16",ansi2ansi,!1)),setLazyProperty(styles.color,"ansi256",()=>makeDynamicStyles(wrapAnsi2562,"ansi256",ansi2ansi,!1)),setLazyProperty(styles.color,"ansi16m",()=>makeDynamicStyles(wrapAnsi16m2,"rgb",rgb2rgb,!1)),setLazyProperty(styles.bgColor,"ansi",()=>makeDynamicStyles(wrapAnsi162,"ansi16",ansi2ansi,!0)),setLazyProperty(styles.bgColor,"ansi256",()=>makeDynamicStyles(wrapAnsi2562,"ansi256",ansi2ansi,!0)),setLazyProperty(styles.bgColor,"ansi16m",()=>makeDynamicStyles(wrapAnsi16m2,"rgb",rgb2rgb,!0)),styles}Object.defineProperty(module,"exports",{enumerable:!0,get:assembleStyles2})}});var require_has_flag=__commonJS({"node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports,module){init_esm_shims();"use strict";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/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports,module){init_esm_shims();"use strict";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_util=__commonJS({"node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"(exports,module){init_esm_shims();"use strict";var stringReplaceAll=(string,substring,replacer)=>{let index=string.indexOf(substring);if(index===-1)return string;let substringLength=substring.length,endIndex=0,returnValue="";do returnValue+=string.substr(endIndex,index-endIndex)+substring+replacer,endIndex=index+substringLength,index=string.indexOf(substring,endIndex);while(index!==-1);return returnValue+=string.substr(endIndex),returnValue},stringEncaseCRLFWithFirstIndex=(string,prefix,postfix,index)=>{let endIndex=0,returnValue="";do{let gotCR=string[index-1]==="\r";returnValue+=string.substr(endIndex,(gotCR?index-1:index)-endIndex)+prefix+(gotCR?`\r
2
+ `:`
3
+ `)+postfix,endIndex=index+1,index=string.indexOf(`
4
+ `,endIndex)}while(index!==-1);return returnValue+=string.substr(endIndex),returnValue};module.exports={stringReplaceAll,stringEncaseCRLFWithFirstIndex}}});var require_templates=__commonJS({"node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"(exports,module){init_esm_shims();"use strict";var TEMPLATE_REGEX=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,STYLE_REGEX=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,STRING_REGEX=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,ESCAPE_REGEX=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,ESCAPES3=new Map([["n",`
5
+ `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a","\x07"]]);function unescape(c5){let u=c5[0]==="u",bracket=c5[1]==="{";return u&&!bracket&&c5.length===5||c5[0]==="x"&&c5.length===3?String.fromCharCode(parseInt(c5.slice(1),16)):u&&bracket?String.fromCodePoint(parseInt(c5.slice(2,-1),16)):ESCAPES3.get(c5)||c5}function parseArguments(name,arguments_){let results=[],chunks=arguments_.trim().split(/\s*,\s*/g),matches;for(let chunk of chunks){let number=Number(chunk);if(!Number.isNaN(number))results.push(number);else if(matches=chunk.match(STRING_REGEX))results.push(matches[2].replace(ESCAPE_REGEX,(m,escape,character)=>escape?unescape(escape):character));else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`)}return results}function parseStyle(style){STYLE_REGEX.lastIndex=0;let results=[],matches;for(;(matches=STYLE_REGEX.exec(style))!==null;){let name=matches[1];if(matches[2]){let args=parseArguments(name,matches[2]);results.push([name].concat(args))}else results.push([name])}return results}function buildStyle(chalk,styles){let enabled={};for(let layer of styles)for(let style of layer.styles)enabled[style[0]]=layer.inverse?null:style.slice(1);let current=chalk;for(let[styleName,styles2]of Object.entries(enabled))if(!!Array.isArray(styles2)){if(!(styleName in current))throw new Error(`Unknown Chalk style: ${styleName}`);current=styles2.length>0?current[styleName](...styles2):current[styleName]}return current}module.exports=(chalk,temporary)=>{let styles=[],chunks=[],chunk=[];if(temporary.replace(TEMPLATE_REGEX,(m,escapeCharacter,inverse,style,close,character)=>{if(escapeCharacter)chunk.push(unescape(escapeCharacter));else if(style){let string=chunk.join("");chunk=[],chunks.push(styles.length===0?string:buildStyle(chalk,styles)(string)),styles.push({inverse,styles:parseStyle(style)})}else if(close){if(styles.length===0)throw new Error("Found extraneous } in Chalk template literal");chunks.push(buildStyle(chalk,styles)(chunk.join(""))),chunk=[],styles.pop()}else chunk.push(character)}),chunks.push(chunk.join("")),styles.length>0){let errMessage=`Chalk template literal is missing ${styles.length} closing bracket${styles.length===1?"":"s"} (\`}\`)`;throw new Error(errMessage)}return chunks.join("")}}});var require_source=__commonJS({"node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"(exports,module){init_esm_shims();"use strict";var ansiStyles2=require_ansi_styles(),{stdout:stdoutColor,stderr:stderrColor}=require_supports_color(),{stringReplaceAll,stringEncaseCRLFWithFirstIndex}=require_util(),{isArray}=Array,levelMapping=["ansi","ansi","ansi256","ansi16m"],styles=Object.create(null),applyOptions=(object,options={})=>{if(options.level&&!(Number.isInteger(options.level)&&options.level>=0&&options.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let colorLevel=stdoutColor?stdoutColor.level:0;object.level=options.level===void 0?colorLevel:options.level},ChalkClass=class{constructor(options){return chalkFactory(options)}},chalkFactory=options=>{let chalk2={};return applyOptions(chalk2,options),chalk2.template=(...arguments_)=>chalkTag(chalk2.template,...arguments_),Object.setPrototypeOf(chalk2,Chalk.prototype),Object.setPrototypeOf(chalk2.template,chalk2),chalk2.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},chalk2.template.Instance=ChalkClass,chalk2.template};function Chalk(options){return chalkFactory(options)}for(let[styleName,style]of Object.entries(ansiStyles2))styles[styleName]={get(){let builder=createBuilder(this,createStyler(style.open,style.close,this._styler),this._isEmpty);return Object.defineProperty(this,styleName,{value:builder}),builder}};styles.visible={get(){let builder=createBuilder(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:builder}),builder}};var usedModels=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let model of usedModels)styles[model]={get(){let{level}=this;return function(...arguments_){let styler=createStyler(ansiStyles2.color[levelMapping[level]][model](...arguments_),ansiStyles2.color.close,this._styler);return createBuilder(this,styler,this._isEmpty)}}};for(let model of usedModels){let bgModel="bg"+model[0].toUpperCase()+model.slice(1);styles[bgModel]={get(){let{level}=this;return function(...arguments_){let styler=createStyler(ansiStyles2.bgColor[levelMapping[level]][model](...arguments_),ansiStyles2.bgColor.close,this._styler);return createBuilder(this,styler,this._isEmpty)}}}}var proto=Object.defineProperties(()=>{},__spreadProps(__spreadValues({},styles),{level:{enumerable:!0,get(){return this._generator.level},set(level){this._generator.level=level}}})),createStyler=(open,close,parent)=>{let openAll,closeAll;return parent===void 0?(openAll=open,closeAll=close):(openAll=parent.openAll+open,closeAll=close+parent.closeAll),{open,close,openAll,closeAll,parent}},createBuilder=(self,_styler,_isEmpty)=>{let builder=(...arguments_)=>isArray(arguments_[0])&&isArray(arguments_[0].raw)?applyStyle(builder,chalkTag(builder,...arguments_)):applyStyle(builder,arguments_.length===1?""+arguments_[0]:arguments_.join(" "));return Object.setPrototypeOf(builder,proto),builder._generator=self,builder._styler=_styler,builder._isEmpty=_isEmpty,builder},applyStyle=(self,string)=>{if(self.level<=0||!string)return self._isEmpty?"":string;let styler=self._styler;if(styler===void 0)return string;let{openAll,closeAll}=styler;if(string.indexOf("")!==-1)for(;styler!==void 0;)string=stringReplaceAll(string,styler.close,styler.open),styler=styler.parent;let lfIndex=string.indexOf(`
6
+ `);return lfIndex!==-1&&(string=stringEncaseCRLFWithFirstIndex(string,closeAll,openAll,lfIndex)),openAll+string+closeAll},template,chalkTag=(chalk2,...strings)=>{let[firstString]=strings;if(!isArray(firstString)||!isArray(firstString.raw))return strings.join(" ");let arguments_=strings.slice(1),parts=[firstString.raw[0]];for(let i=1;i<firstString.length;i++)parts.push(String(arguments_[i-1]).replace(/[{}\\]/g,"\\$&"),String(firstString.raw[i]));return template===void 0&&(template=require_templates()),template(chalk2,parts.join(""))};Object.defineProperties(Chalk.prototype,styles);var chalk=Chalk();chalk.supportsColor=stdoutColor;chalk.stderr=Chalk({level:stderrColor?stderrColor.level:0});chalk.stderr.supportsColor=stderrColor;module.exports=chalk}});var require_is_unicode_supported=__commonJS({"node_modules/.pnpm/is-unicode-supported@0.1.0/node_modules/is-unicode-supported/index.js"(exports,module){init_esm_shims();"use strict";module.exports=()=>process.platform!=="win32"?!0:Boolean(process.env.CI)||Boolean(process.env.WT_SESSION)||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color"||process.env.TERM==="alacritty"}});var require_log_symbols=__commonJS({"node_modules/.pnpm/log-symbols@4.1.0/node_modules/log-symbols/index.js"(exports,module){init_esm_shims();"use strict";var chalk=require_source(),isUnicodeSupported=require_is_unicode_supported(),main={info:chalk.blue("\u2139"),success:chalk.green("\u2714"),warning:chalk.yellow("\u26A0"),error:chalk.red("\u2716")},fallback={info:chalk.blue("i"),success:chalk.green("\u221A"),warning:chalk.yellow("\u203C"),error:chalk.red("\xD7")};module.exports=isUnicodeSupported()?main:fallback}});var require_sinon_chai=__commonJS({"node_modules/.pnpm/sinon-chai@3.7.0_chai@4.3.4+sinon@12.0.1/node_modules/sinon-chai/lib/sinon-chai.js"(exports,module){init_esm_shims();"use strict";(function(sinonChai){typeof __require=="function"&&typeof exports=="object"&&typeof module=="object"?module.exports=sinonChai:typeof define=="function"&&define.amd?define(function(){return sinonChai}):chai.use(sinonChai)})(function(chai4,utils){var slice=Array.prototype.slice;function isSpy(putativeSpy){return typeof putativeSpy=="function"&&typeof putativeSpy.getCall=="function"&&typeof putativeSpy.calledWithExactly=="function"}function timesInWords(count){switch(count){case 1:return"once";case 2:return"twice";case 3:return"thrice";default:return(count||0)+" times"}}function isCall(putativeCall){return putativeCall&&isSpy(putativeCall.proxy)}function assertCanWorkWith(assertion){if(!isSpy(assertion._obj)&&!isCall(assertion._obj))throw new TypeError(utils.inspect(assertion._obj)+" is not a spy or a call to a spy!")}function getMessages(spy,action,nonNegatedSuffix,always,args){var verbPhrase=always?"always have ":"have ";nonNegatedSuffix=nonNegatedSuffix||"",isSpy(spy.proxy)&&(spy=spy.proxy);function printfArray(array){return spy.printf.apply(spy,array)}return{affirmative:function(){return printfArray(["expected %n to "+verbPhrase+action+nonNegatedSuffix].concat(args))},negative:function(){return printfArray(["expected %n to not "+verbPhrase+action].concat(args))}}}function sinonProperty(name,action,nonNegatedSuffix){utils.addProperty(chai4.Assertion.prototype,name,function(){assertCanWorkWith(this);var messages=getMessages(this._obj,action,nonNegatedSuffix,!1);this.assert(this._obj[name],messages.affirmative,messages.negative)})}function sinonPropertyAsBooleanMethod(name,action,nonNegatedSuffix){utils.addMethod(chai4.Assertion.prototype,name,function(arg){assertCanWorkWith(this);var messages=getMessages(this._obj,action,nonNegatedSuffix,!1,[timesInWords(arg)]);this.assert(this._obj[name]===arg,messages.affirmative,messages.negative)})}function createSinonMethodHandler(sinonName,action,nonNegatedSuffix){return function(){assertCanWorkWith(this);var alwaysSinonMethod="always"+sinonName[0].toUpperCase()+sinonName.substring(1),shouldBeAlways=utils.flag(this,"always")&&typeof this._obj[alwaysSinonMethod]=="function",sinonMethodName=shouldBeAlways?alwaysSinonMethod:sinonName,messages=getMessages(this._obj,action,nonNegatedSuffix,shouldBeAlways,slice.call(arguments));this.assert(this._obj[sinonMethodName].apply(this._obj,arguments),messages.affirmative,messages.negative)}}function sinonMethodAsProperty(name,action,nonNegatedSuffix){var handler=createSinonMethodHandler(name,action,nonNegatedSuffix);utils.addProperty(chai4.Assertion.prototype,name,handler)}function exceptionalSinonMethod(chaiName,sinonName,action,nonNegatedSuffix){var handler=createSinonMethodHandler(sinonName,action,nonNegatedSuffix);utils.addMethod(chai4.Assertion.prototype,chaiName,handler)}function sinonMethod(name,action,nonNegatedSuffix){exceptionalSinonMethod(name,name,action,nonNegatedSuffix)}utils.addProperty(chai4.Assertion.prototype,"always",function(){utils.flag(this,"always",!0)}),sinonProperty("called","been called"," at least once, but it was never called"),sinonPropertyAsBooleanMethod("callCount","been called exactly %1",", but it was called %c%C"),sinonProperty("calledOnce","been called exactly once",", but it was called %c%C"),sinonProperty("calledTwice","been called exactly twice",", but it was called %c%C"),sinonProperty("calledThrice","been called exactly thrice",", but it was called %c%C"),sinonMethodAsProperty("calledWithNew","been called with new"),sinonMethod("calledBefore","been called before %1"),sinonMethod("calledAfter","been called after %1"),sinonMethod("calledImmediatelyBefore","been called immediately before %1"),sinonMethod("calledImmediatelyAfter","been called immediately after %1"),sinonMethod("calledOn","been called with %1 as this",", but it was called with %t instead"),sinonMethod("calledWith","been called with arguments %*","%D"),sinonMethod("calledOnceWith","been called exactly once with arguments %*","%D"),sinonMethod("calledWithExactly","been called with exact arguments %*","%D"),sinonMethod("calledOnceWithExactly","been called exactly once with exact arguments %*","%D"),sinonMethod("calledWithMatch","been called with arguments matching %*","%D"),sinonMethod("returned","returned %1"),exceptionalSinonMethod("thrown","threw","thrown %1")})}});init_esm_shims();init_esm_shims();import{performance as performance3}from"perf_hooks";init_esm_shims();import Snap2 from"jest-snapshot";init_esm_shims();import chai2 from"chai";import Snap from"jest-snapshot";init_esm_shims();import Test from"@jest/test-result";var{makeEmptyAggregatedTestResult}=Test,makeEmptySnapshotSummary=options=>{let summary=makeEmptyAggregatedTestResult().snapshot;return summary.didUpdate=options.updateSnapshot==="all",summary},packSnapshotState=snapshotState=>{let snapshot={added:0,fileDeleted:!1,matched:0,unchecked:0,uncheckedKeys:[],unmatched:0,updated:0},uncheckedCount=snapshotState.getUncheckedCount(),uncheckedKeys=snapshotState.getUncheckedKeys();uncheckedCount&&snapshotState.removeUncheckedKeys();let status=snapshotState.save();return snapshot.fileDeleted=status.deleted,snapshot.added=snapshotState.added,snapshot.matched=snapshotState.matched,snapshot.unmatched=snapshotState.unmatched,snapshot.updated=snapshotState.updated,snapshot.unchecked=status.deleted?0:uncheckedCount,snapshot.uncheckedKeys=Array.from(uncheckedKeys),snapshot},addSnapshotResult=(snapshotSummary,snapshotResult,testFilePath)=>{snapshotResult.added&&snapshotSummary.filesAdded++,snapshotResult.fileDeleted&&snapshotSummary.filesRemoved++,snapshotResult.unmatched&&snapshotSummary.filesUnmatched++,snapshotResult.updated&&snapshotSummary.filesUpdated++,snapshotSummary.added+=snapshotResult.added,snapshotSummary.matched+=snapshotResult.matched,snapshotSummary.unchecked+=snapshotResult.unchecked,snapshotResult.uncheckedKeys&&snapshotResult.uncheckedKeys.length>0&&snapshotSummary.uncheckedKeysByFile.push({filePath:testFilePath,keys:snapshotResult.uncheckedKeys}),snapshotSummary.unmatched+=snapshotResult.unmatched,snapshotSummary.updated+=snapshotResult.updated,snapshotSummary.total+=snapshotResult.added+snapshotResult.matched+snapshotResult.unmatched+snapshotResult.updated};init_esm_shims();var import_slash=__toModule(require_slash());import path,{isAbsolute}from"path";import{pluralize}from"jest-util";import c from"picocolors";var formatTestPath=(rootDir,testPath)=>{isAbsolute(testPath)&&(testPath=path.relative(rootDir,testPath));let dirname=path.dirname(testPath),basename2=path.basename(testPath);return(0,import_slash.default)(c.dim(dirname+path.sep)+c.bold(basename2))},ARROW=" \u203A ",DOWN_ARROW=" \u21B3 ",DOT=" \u2022 ",FAIL_COLOR=v=>c.bold(c.red(v)),OBSOLETE_COLOR=v=>c.bold(c.yellow(v)),SNAPSHOT_ADDED=v=>c.bold(c.green(v)),SNAPSHOT_NOTE=c.dim,SNAPSHOT_REMOVED=v=>c.bold(c.green(v)),SNAPSHOT_SUMMARY=c.bold,SNAPSHOT_UPDATED=v=>c.bold(c.green(v)),updateCommand="re-run mocha with `--update` to update them",getSnapshotSummaryOutput=(rootDir,snapshots)=>{let summary=[];if(summary.push(SNAPSHOT_SUMMARY("Snapshot Summary")),snapshots.added&&summary.push(`${SNAPSHOT_ADDED(`${ARROW+pluralize("snapshot",snapshots.added)} written `)}from ${pluralize("test suite",snapshots.filesAdded)}.`),snapshots.unmatched&&summary.push(`${FAIL_COLOR(`${ARROW}${pluralize("snapshot",snapshots.unmatched)} failed`)} from ${pluralize("test suite",snapshots.filesUnmatched)}. ${SNAPSHOT_NOTE(`Inspect your code changes or ${updateCommand} to update them.`)}`),snapshots.updated&&summary.push(`${SNAPSHOT_UPDATED(`${ARROW+pluralize("snapshot",snapshots.updated)} updated `)}from ${pluralize("test suite",snapshots.filesUpdated)}.`),snapshots.filesRemoved&&(snapshots.didUpdate?summary.push(`${SNAPSHOT_REMOVED(`${ARROW}${pluralize("snapshot file",snapshots.filesRemoved)} removed `)}from ${pluralize("test suite",snapshots.filesRemoved)}.`):summary.push(`${OBSOLETE_COLOR(`${ARROW}${pluralize("snapshot file",snapshots.filesRemoved)} obsolete `)}from ${pluralize("test suite",snapshots.filesRemoved)}. ${SNAPSHOT_NOTE(`To remove ${snapshots.filesRemoved===1?"it":"them all"}, ${updateCommand}.`)}`)),snapshots.filesRemovedList&&snapshots.filesRemovedList.length){let[head,...tail]=snapshots.filesRemovedList;summary.push(` ${DOWN_ARROW} ${DOT}${formatTestPath(rootDir,head)}`),tail.forEach(key=>{summary.push(` ${DOT}${formatTestPath(rootDir,key)}`)})}return snapshots.unchecked&&(snapshots.didUpdate?summary.push(`${SNAPSHOT_REMOVED(`${ARROW}${pluralize("snapshot",snapshots.unchecked)} removed `)}from ${pluralize("test suite",snapshots.uncheckedKeysByFile.length)}.`):summary.push(`${OBSOLETE_COLOR(`${ARROW}${pluralize("snapshot",snapshots.unchecked)} obsolete `)}from ${pluralize("test suite",snapshots.uncheckedKeysByFile.length)}. ${SNAPSHOT_NOTE(`To remove ${snapshots.unchecked===1?"it":"them all"}, ${updateCommand}.`)}`),snapshots.uncheckedKeysByFile.forEach(uncheckedFile=>{summary.push(` ${DOWN_ARROW}${formatTestPath(rootDir,uncheckedFile.filePath)}`),uncheckedFile.keys.forEach(key=>{summary.push(` ${DOT}${key}`)})})),summary};var{expect}=chai2,{SnapshotState}=Snap,SnapshotManager=class{snapshotState=null;snapshotSummary;snapshotOptions;ctx=null;testFile="";snapshotResolver;rootDir;constructor({rootDir,update,snapshotResolver=null}){this.rootDir=rootDir,this.snapshotResolver=snapshotResolver;let env=process.env,CI=!!env.CI,UPDATE_SNAPSHOT=update||env.UPDATE_SNAPSHOT;this.snapshotOptions={updateSnapshot:CI&&!UPDATE_SNAPSHOT?"none":UPDATE_SNAPSHOT?"all":"new"},this.snapshotSummary=makeEmptySnapshotSummary(this.snapshotOptions)}onFileChanged(){!this.ctx||(this.snapshotState!==null&&this.saveSnap(),this.testFile=this.ctx.file,this.snapshotState=new SnapshotState(this.snapshotResolver.resolveSnapshotPath(this.testFile),this.snapshotOptions))}setTest(test){var _a;this.setContext({file:((_a=test.file)==null?void 0:_a.filepath)||test.name,title:test.name,fullTitle:[test.suite.name,test.name].filter(Boolean).join(" > ")})}setContext(context2){!context2.title||!context2.file||(this.ctx=context2,this.testFile!==context2.file&&this.onFileChanged())}assert(received,message){if(!this.snapshotState||!this.ctx)return;let{actual,expected,key,pass}=this.snapshotState.match({testName:this.ctx.fullTitle||this.ctx.title||this.ctx.file,received,isInline:!1});pass||expect(actual.trim()).equals(expected?expected.trim():"",message||`Snapshot name: \`${key}\``)}clear(){this.snapshotSummary=makeEmptySnapshotSummary(this.snapshotOptions)}saveSnap(){if(!this.testFile||!this.snapshotState)return;let packedSnapshotState=packSnapshotState(this.snapshotState);addSnapshotResult(this.snapshotSummary,packedSnapshotState,this.testFile),this.testFile="",this.snapshotState=null}report(){let outputs=getSnapshotSummaryOutput(this.rootDir,this.snapshotSummary);if(outputs.length>1)return outputs}};var{addSerializer}=Snap2,_manager;function getSnapshotManager(){return _manager}async function SnapshotPlugin(options){let{root:rootDir}=options;return _manager=new SnapshotManager({rootDir,update:options.update}),_manager.snapshotResolver=await Snap2.buildSnapshotResolver({transform:[],rootDir}),function(chai4,utils){for(let key of["matchSnapshot","toMatchSnapshot"])utils.addMethod(chai4.Assertion.prototype,key,function(message){let expected=utils.flag(this,"object");_manager.assert(expected,message)});chai4.expect.addSnapshotSerializer=addSerializer}}init_esm_shims();import{slash as slash2}from"@antfu/utils";init_esm_shims();import{basename}from"path";import{performance}from"perf_hooks";init_esm_shims();import{toArray}from"@antfu/utils";function partitionSuiteChildren(suite){let tasksGroup=[],tasksGroups=[];for(let c5 of suite.tasks)tasksGroup.length===0||c5.computeMode===tasksGroup[0].computeMode?tasksGroup.push(c5):(tasksGroups.push(tasksGroup),tasksGroup=[c5]);return tasksGroup.length>0&&tasksGroups.push(tasksGroup),tasksGroups}function interpretOnlyMode(items){items.some(i=>i.mode==="only")&&items.forEach(i=>{i.mode==="run"?i.mode="skip":i.mode==="only"&&(i.mode="run")})}function getTests(suite){return toArray(suite).flatMap(s=>s.tasks.flatMap(c5=>c5.type==="test"?[c5]:getTests(c5)))}function getSuites(suite){return toArray(suite).flatMap(s=>s.type==="suite"?[s,...getSuites(s.tasks)]:[])}function hasTests(suite){return toArray(suite).some(s=>s.tasks.some(c5=>c5.type==="test"||hasTests(c5)))}function hasFailed(suite){return toArray(suite).some(s=>s.tasks.some(c5=>{var _a;return((_a=c5.result)==null?void 0:_a.state)==="fail"}))}async function collectTests(paths){let files={};for(let filepath of paths){let file={name:basename(filepath),type:"suite",mode:"run",computeMode:"serial",filepath,tasks:[],suite:{}};setHooks(file,createSuiteHooks()),clearContext();try{await import(filepath);for(let c5 of[defaultSuite,...context.tasks])if(c5.type==="test")file.tasks.push(c5);else{let suite=await c5.collect(file);(suite.name||suite.tasks.length)&&file.tasks.push(suite)}}catch(e){file.result={start:performance.now(),state:"fail",error:e},process.exitCode=1}files[filepath]=file}let allChildren=Object.values(files).reduce((tasks,file)=>tasks.concat(file.tasks),[]);return interpretOnlyMode(allChildren),allChildren.forEach(i=>{i.type==="suite"&&(i.mode==="skip"?i.tasks.forEach(c5=>c5.mode==="run"&&(c5.mode="skip")):interpretOnlyMode(i.tasks))}),files}async function startWatcher(ctx){var _a;let{reporter,snapshotManager,filesMap}=ctx;await((_a=reporter.onWatcherStart)==null?void 0:_a.call(reporter,ctx));let timer2,changedTests=new Set,seen=new Set,{server,moduleCache}=process.__vitest__;server.watcher.on("change",async id=>{id=slash2(id),getAffectedTests(id,ctx,changedTests,seen),seen.forEach(i=>moduleCache.delete(i)),seen.clear(),changedTests.size!==0&&(clearTimeout(timer2),timer2=setTimeout(async()=>{var _a2,_b,_c,_d;if(changedTests.size===0)return;snapshotManager.clear();let paths=Array.from(changedTests);changedTests.clear(),await((_a2=reporter.onWatcherRerun)==null?void 0:_a2.call(reporter,paths,id,ctx)),paths.forEach(i=>moduleCache.delete(i));let newFilesMap=await collectTests(paths);Object.assign(filesMap,newFilesMap);let files=Object.values(filesMap);(_b=reporter.onCollected)==null||_b.call(reporter,files,ctx),await runSuites(files,ctx),snapshotManager.saveSnap(),await((_c=reporter.onFinished)==null?void 0:_c.call(reporter,ctx,Object.values(newFilesMap))),await((_d=reporter.onWatcherStart)==null?void 0:_d.call(reporter,ctx))},100))}),await new Promise(()=>{})}function getAffectedTests(id,ctx,set=new Set,seen=new Set){if(seen.has(id)||set.has(id))return set;if(seen.add(id),id in ctx.filesMap)return set.add(id),set;let mod=process.__vitest__.server.moduleGraph.getModuleById(id);return mod&&mod.importers.forEach(i=>{i.id&&getAffectedTests(i.id,ctx,set,seen)}),set}init_esm_shims();import fg from"fast-glob";async function globTestFiles(config){var _a;let testFilepaths=await fg(config.includes||defaultIncludes,{absolute:!0,cwd:config.root,ignore:config.excludes||defaultExcludes});return((_a=config.filters)==null?void 0:_a.length)&&(testFilepaths=testFilepaths.filter(i=>config.filters.some(f=>i.includes(f)))),testFilepaths}init_esm_shims();init_esm_shims();import{performance as performance2}from"perf_hooks";import{relative}from"path";import c4 from"picocolors";init_esm_shims();import{promises as fs,existsSync}from"fs";import c2 from"picocolors";init_esm_shims();function Diff(){}Diff.prototype={diff:function(oldString,newString){var options=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},callback=options.callback;typeof options=="function"&&(callback=options,options={}),this.options=options;var self=this;function done(value){return callback?(setTimeout(function(){callback(void 0,value)},0),!0):value}oldString=this.castInput(oldString),newString=this.castInput(newString),oldString=this.removeEmpty(this.tokenize(oldString)),newString=this.removeEmpty(this.tokenize(newString));var newLen=newString.length,oldLen=oldString.length,editLength=1,maxEditLength=newLen+oldLen,bestPath=[{newPos:-1,components:[]}],oldPos=this.extractCommon(bestPath[0],newString,oldString,0);if(bestPath[0].newPos+1>=newLen&&oldPos+1>=oldLen)return done([{value:this.join(newString),count:newString.length}]);function execEditLength(){for(var diagonalPath=-1*editLength;diagonalPath<=editLength;diagonalPath+=2){var basePath=void 0,addPath=bestPath[diagonalPath-1],removePath=bestPath[diagonalPath+1],_oldPos=(removePath?removePath.newPos:0)-diagonalPath;addPath&&(bestPath[diagonalPath-1]=void 0);var canAdd=addPath&&addPath.newPos+1<newLen,canRemove=removePath&&0<=_oldPos&&_oldPos<oldLen;if(!canAdd&&!canRemove){bestPath[diagonalPath]=void 0;continue}if(!canAdd||canRemove&&addPath.newPos<removePath.newPos?(basePath=clonePath(removePath),self.pushComponent(basePath.components,void 0,!0)):(basePath=addPath,basePath.newPos++,self.pushComponent(basePath.components,!0,void 0)),_oldPos=self.extractCommon(basePath,newString,oldString,diagonalPath),basePath.newPos+1>=newLen&&_oldPos+1>=oldLen)return done(buildValues(self,basePath.components,newString,oldString,self.useLongestToken));bestPath[diagonalPath]=basePath}editLength++}if(callback)(function exec2(){setTimeout(function(){if(editLength>maxEditLength)return callback();execEditLength()||exec2()},0)})();else for(;editLength<=maxEditLength;){var ret=execEditLength();if(ret)return ret}},pushComponent:function(components,added,removed){var last=components[components.length-1];last&&last.added===added&&last.removed===removed?components[components.length-1]={count:last.count+1,added,removed}:components.push({count:1,added,removed})},extractCommon:function(basePath,newString,oldString,diagonalPath){for(var newLen=newString.length,oldLen=oldString.length,newPos=basePath.newPos,oldPos=newPos-diagonalPath,commonCount=0;newPos+1<newLen&&oldPos+1<oldLen&&this.equals(newString[newPos+1],oldString[oldPos+1]);)newPos++,oldPos++,commonCount++;return commonCount&&basePath.components.push({count:commonCount}),basePath.newPos=newPos,oldPos},equals:function(left,right){return this.options.comparator?this.options.comparator(left,right):left===right||this.options.ignoreCase&&left.toLowerCase()===right.toLowerCase()},removeEmpty:function(array){for(var ret=[],i=0;i<array.length;i++)array[i]&&ret.push(array[i]);return ret},castInput:function(value){return value},tokenize:function(value){return value.split("")},join:function(chars){return chars.join("")}};function buildValues(diff3,components,newString,oldString,useLongestToken){for(var componentPos=0,componentLen=components.length,newPos=0,oldPos=0;componentPos<componentLen;componentPos++){var component=components[componentPos];if(component.removed){if(component.value=diff3.join(oldString.slice(oldPos,oldPos+component.count)),oldPos+=component.count,componentPos&&components[componentPos-1].added){var tmp=components[componentPos-1];components[componentPos-1]=components[componentPos],components[componentPos]=tmp}}else{if(!component.added&&useLongestToken){var value=newString.slice(newPos,newPos+component.count);value=value.map(function(value2,i){var oldValue=oldString[oldPos+i];return oldValue.length>value2.length?oldValue:value2}),component.value=diff3.join(value)}else component.value=diff3.join(newString.slice(newPos,newPos+component.count));newPos+=component.count,component.added||(oldPos+=component.count)}}var lastComponent=components[componentLen-1];return componentLen>1&&typeof lastComponent.value=="string"&&(lastComponent.added||lastComponent.removed)&&diff3.equals("",lastComponent.value)&&(components[componentLen-2].value+=lastComponent.value,components.pop()),components}function clonePath(path2){return{newPos:path2.newPos,components:path2.components.slice(0)}}var characterDiff=new Diff;var extendedWordChars=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,reWhitespace=/\S/,wordDiff=new Diff;wordDiff.equals=function(left,right){return this.options.ignoreCase&&(left=left.toLowerCase(),right=right.toLowerCase()),left===right||this.options.ignoreWhitespace&&!reWhitespace.test(left)&&!reWhitespace.test(right)};wordDiff.tokenize=function(value){for(var tokens=value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),i=0;i<tokens.length-1;i++)!tokens[i+1]&&tokens[i+2]&&extendedWordChars.test(tokens[i])&&extendedWordChars.test(tokens[i+2])&&(tokens[i]+=tokens[i+2],tokens.splice(i+1,2),i--);return tokens};var lineDiff=new Diff;lineDiff.tokenize=function(value){var retLines=[],linesAndNewlines=value.split(/(\n|\r\n)/);linesAndNewlines[linesAndNewlines.length-1]||linesAndNewlines.pop();for(var i=0;i<linesAndNewlines.length;i++){var line=linesAndNewlines[i];i%2&&!this.options.newlineIsToken?retLines[retLines.length-1]+=line:(this.options.ignoreWhitespace&&(line=line.trim()),retLines.push(line))}return retLines};function diffLines(oldStr,newStr,callback){return lineDiff.diff(oldStr,newStr,callback)}var sentenceDiff=new Diff;sentenceDiff.tokenize=function(value){return value.split(/(\S.+?[.!?])(?=\s+|$)/)};var cssDiff=new Diff;cssDiff.tokenize=function(value){return value.split(/([{}:;,]|\s+)/)};function _typeof(obj){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function(obj2){return typeof obj2}:_typeof=function(obj2){return obj2&&typeof Symbol=="function"&&obj2.constructor===Symbol&&obj2!==Symbol.prototype?"symbol":typeof obj2},_typeof(obj)}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _iterableToArray(iter){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(iter))return Array.from(iter)}function _unsupportedIterableToArray(o,minLen){if(!!o){if(typeof o=="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor&&(n=o.constructor.name),n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}}function _arrayLikeToArray(arr,len){(len==null||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
7
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var objectPrototypeToString=Object.prototype.toString,jsonDiff=new Diff;jsonDiff.useLongestToken=!0;jsonDiff.tokenize=lineDiff.tokenize;jsonDiff.castInput=function(value){var _this$options=this.options,undefinedReplacement=_this$options.undefinedReplacement,_this$options$stringi=_this$options.stringifyReplacer,stringifyReplacer=_this$options$stringi===void 0?function(k,v){return typeof v=="undefined"?undefinedReplacement:v}:_this$options$stringi;return typeof value=="string"?value:JSON.stringify(canonicalize(value,null,null,stringifyReplacer),stringifyReplacer," ")};jsonDiff.equals=function(left,right){return Diff.prototype.equals.call(jsonDiff,left.replace(/,([\r\n])/g,"$1"),right.replace(/,([\r\n])/g,"$1"))};function canonicalize(obj,stack,replacementStack,replacer,key){stack=stack||[],replacementStack=replacementStack||[],replacer&&(obj=replacer(key,obj));var i;for(i=0;i<stack.length;i+=1)if(stack[i]===obj)return replacementStack[i];var canonicalizedObj;if(objectPrototypeToString.call(obj)==="[object Array]"){for(stack.push(obj),canonicalizedObj=new Array(obj.length),replacementStack.push(canonicalizedObj),i=0;i<obj.length;i+=1)canonicalizedObj[i]=canonicalize(obj[i],stack,replacementStack,replacer,key);return stack.pop(),replacementStack.pop(),canonicalizedObj}if(obj&&obj.toJSON&&(obj=obj.toJSON()),_typeof(obj)==="object"&&obj!==null){stack.push(obj),canonicalizedObj={},replacementStack.push(canonicalizedObj);var sortedKeys=[],_key;for(_key in obj)obj.hasOwnProperty(_key)&&sortedKeys.push(_key);for(sortedKeys.sort(),i=0;i<sortedKeys.length;i+=1)_key=sortedKeys[i],canonicalizedObj[_key]=canonicalize(obj[_key],stack,replacementStack,replacer,_key);stack.pop(),replacementStack.pop()}else canonicalizedObj=obj;return canonicalizedObj}var arrayDiff=new Diff;arrayDiff.tokenize=function(value){return value.slice()};arrayDiff.join=arrayDiff.removeEmpty=function(value){return value};function structuredPatch(oldFileName,newFileName,oldStr,newStr,oldHeader,newHeader,options){options||(options={}),typeof options.context=="undefined"&&(options.context=4);var diff3=diffLines(oldStr,newStr,options);diff3.push({value:"",lines:[]});function contextLines(lines){return lines.map(function(entry){return" "+entry})}for(var hunks=[],oldRangeStart=0,newRangeStart=0,curRange=[],oldLine=1,newLine=1,_loop=function(i2){var current=diff3[i2],lines=current.lines||current.value.replace(/\n$/,"").split(`
8
+ `);if(current.lines=lines,current.added||current.removed){var _curRange;if(!oldRangeStart){var prev=diff3[i2-1];oldRangeStart=oldLine,newRangeStart=newLine,prev&&(curRange=options.context>0?contextLines(prev.lines.slice(-options.context)):[],oldRangeStart-=curRange.length,newRangeStart-=curRange.length)}(_curRange=curRange).push.apply(_curRange,_toConsumableArray(lines.map(function(entry){return(current.added?"+":"-")+entry}))),current.added?newLine+=lines.length:oldLine+=lines.length}else{if(oldRangeStart)if(lines.length<=options.context*2&&i2<diff3.length-2){var _curRange2;(_curRange2=curRange).push.apply(_curRange2,_toConsumableArray(contextLines(lines)))}else{var _curRange3,contextSize=Math.min(lines.length,options.context);(_curRange3=curRange).push.apply(_curRange3,_toConsumableArray(contextLines(lines.slice(0,contextSize))));var hunk={oldStart:oldRangeStart,oldLines:oldLine-oldRangeStart+contextSize,newStart:newRangeStart,newLines:newLine-newRangeStart+contextSize,lines:curRange};if(i2>=diff3.length-2&&lines.length<=options.context){var oldEOFNewline=/\n$/.test(oldStr),newEOFNewline=/\n$/.test(newStr),noNlBeforeAdds=lines.length==0&&curRange.length>hunk.oldLines;!oldEOFNewline&&noNlBeforeAdds&&oldStr.length>0&&curRange.splice(hunk.oldLines,0,"\"),(!oldEOFNewline&&!noNlBeforeAdds||!newEOFNewline)&&curRange.push("\")}hunks.push(hunk),oldRangeStart=0,newRangeStart=0,curRange=[]}oldLine+=lines.length,newLine+=lines.length}},i=0;i<diff3.length;i++)_loop(i);return{oldFileName,newFileName,oldHeader,newHeader,hunks}}function formatPatch(diff3){var ret=[];diff3.oldFileName==diff3.newFileName&&ret.push("Index: "+diff3.oldFileName),ret.push("==================================================================="),ret.push("--- "+diff3.oldFileName+(typeof diff3.oldHeader=="undefined"?"":" "+diff3.oldHeader)),ret.push("+++ "+diff3.newFileName+(typeof diff3.newHeader=="undefined"?"":" "+diff3.newHeader));for(var i=0;i<diff3.hunks.length;i++){var hunk=diff3.hunks[i];hunk.oldLines===0&&(hunk.oldStart-=1),hunk.newLines===0&&(hunk.newStart-=1),ret.push("@@ -"+hunk.oldStart+","+hunk.oldLines+" +"+hunk.newStart+","+hunk.newLines+" @@"),ret.push.apply(ret,hunk.lines)}return ret.join(`
9
+ `)+`
10
+ `}function createTwoFilesPatch(oldFileName,newFileName,oldStr,newStr,oldHeader,newHeader,options){return formatPatch(structuredPatch(oldFileName,newFileName,oldStr,newStr,oldHeader,newHeader,options))}function createPatch(fileName,oldStr,newStr,oldHeader,newHeader,options){return createTwoFilesPatch(fileName,fileName,oldStr,newStr,oldHeader,newHeader,options)}import{notNullish}from"@antfu/utils";import{SourceMapConsumer}from"source-map";async function printError(error){var _a;if(!(error instanceof Error)){console.error(error);return}let{moduleCache}=process.__vitest__,e=error,codeFramePrinted=!1,nearest=parseStack(e.stack||"").find(stack=>moduleCache.has(stack.file));if(nearest){let transformResult=(_a=moduleCache.get(nearest.file))==null?void 0:_a.transformResult,pos=await getOriginalPos(transformResult==null?void 0:transformResult.map,nearest);if(pos&&existsSync(nearest.file)){let sourceCode=await fs.readFile(nearest.file,"utf-8");console.error(`${c2.red(`${c2.bold(e.name)}: ${e.message}`)}`),console.log(c2.gray(`${nearest.file}:${pos.line}:${pos.column}`)),console.log(c2.yellow(generateCodeFrame(sourceCode,pos))),codeFramePrinted=!0}}codeFramePrinted||console.error(e),e.showDiff&&console.error(c2.gray(generateDiff(stringify(e.actual),stringify(e.expected))))}function getOriginalPos(map,{line,column}){return new Promise(resolve=>{if(!map)return resolve(null);SourceMapConsumer.with(map,null,consumer=>{let pos=consumer.originalPositionFor({line,column});pos.line!=null&&pos.column!=null?resolve(pos):resolve(null)})})}var splitRE=/\r?\n/;function posToNumber(source,pos){if(typeof pos=="number")return pos;let lines=source.split(splitRE),{line,column}=pos,start=0;for(let i=0;i<line-1;i++)start+=lines[i].length+1;return start+column}function generateCodeFrame(source,start=0,end,range=2){start=posToNumber(source,start),end=end||start;let lines=source.split(splitRE),count=0,res=[];for(let i=0;i<lines.length;i++)if(count+=lines[i].length+1,count>=start){for(let j=i-range;j<=i+range||end>count;j++){if(j<0||j>=lines.length)continue;let line=j+1;res.push(`${c2.gray(`${line}${" ".repeat(Math.max(3-String(line).length,0))}|`)} ${lines[j]}`);let lineLength=lines[j].length;if(lineLength>200)return"";if(j===i){let pad=start-(count-lineLength)+1,length=Math.max(1,end>count?lineLength-pad:end-start);res.push(`${c2.gray(" |")} ${" ".repeat(pad)}${"^".repeat(length)}`)}else if(j>i){if(end>count){let length=Math.max(Math.min(end-count,lineLength),1);res.push(`${c2.gray(" |")} ${"^".repeat(length)}`)}count+=lineLength+1}}break}return res.join(`
2
11
  `)}function stringify(obj){return String(obj)}var stackFnCallRE=/at (.*) \((.+):(\d+):(\d+)\)$/,stackBarePathRE=/at ()(.+):(\d+):(\d+)$/;function parseStack(stack){return stack.split(`
3
12
  `).map(raw=>{let line=raw.trim(),match=line.match(stackFnCallRE)||line.match(stackBarePathRE);if(!match)return null;let file=match[2];return file.startsWith("file://")&&(file=file.slice(7)),{method:match[1],file:match[2],line:parseInt(match[3]),column:parseInt(match[4])}}).filter(notNullish)}function generateDiff(actual,expected){let diffSize=2048;return actual.length>diffSize&&(actual=`${actual.substring(0,diffSize)} ... Lines skipped`),expected.length>diffSize&&(expected=`${expected.substring(0,diffSize)} ... Lines skipped`),unifiedDiff(actual,expected)}function unifiedDiff(actual,expected){let indent=" ";function cleanUp(line){return line[0]==="+"?indent+c2.green(`${line[0]} ${line.slice(1)}`):line[0]==="-"?indent+c2.red(`${line[0]} ${line.slice(1)}`):line.match(/@@/)?"--":line.match(/\\ No newline/)?null:indent+line}let lines=createPatch("string",actual,expected).split(`
4
13
  `).splice(5);return`
@@ -6,13 +15,25 @@ ${indent}${c2.red("- actual")}
6
15
  ${indent}${c2.green("+ expected")}
7
16
 
8
17
  ${lines.map(cleanUp).filter(notBlank).join(`
9
- `)}`}function notBlank(line){return typeof line!="undefined"&&line!==null}var DefaultReporter=class{start=0;end=0;listr=null;listrPromise=null;testMap=new Map;cwd=process.cwd();relative(path2){return relative(this.cwd,path2)}onStart(config){this.cwd=config.root,console.log(c3.green(`Running tests under ${c3.gray(this.cwd)}
10
- `))}onCollected(files){this.start=performance2.now(),this.testMap=new Map,files.reduce((acc,file)=>acc.concat(getTests(file)),[]).forEach(t=>{let obj={};obj.promise=new Promise((resolve,reject)=>{obj.resolve=resolve,obj.reject=reject}),this.testMap.set(t,obj)});let listrOptions={exitOnError:!1},createListrTestTask=test=>({title:test.name,skip:()=>test.mode==="skip"||test.mode==="todo",task:async()=>{var _a;return await((_a=this.testMap.get(test))==null?void 0:_a.promise)}});function createListrSuiteTask(suite){return{title:suite.name,skip:()=>suite.mode!=="run",task:()=>createSuiteListr(suite)}}function createListrSuiteChildren(suite){return suite.tasks.map(c4=>c4.type==="test"?createListrTestTask(c4):createListrSuiteTask(c4))}function createSuiteListr(suite){var _a;if((_a=suite.result)==null?void 0:_a.error)throw suite.result.error;if(!hasTests(suite))throw new Error("No tests found");return new Listr(createListrSuiteChildren(suite),listrOptions)}this.listr=new Listr(files.map(file=>({title:this.relative(file.filepath),task:()=>{var _a,_b;if((_a=file.result)==null?void 0:_a.error)throw(_b=file.result)==null?void 0:_b.error;return createSuiteListr(file)}})),listrOptions),this.listrPromise=this.listr.run().catch(()=>{})}onTestEnd(test){var _a,_b,_c,_d;((_a=test.result)==null?void 0:_a.state)==="fail"?(_c=this.testMap.get(test))==null||_c.reject((_b=test.result)==null?void 0:_b.error):(_d=this.testMap.get(test))==null||_d.resolve()}async onFinished(ctx,files=ctx.files){var _a,_b,_c;await this.listrPromise,this.end=performance2.now(),console.log();let snapshot=ctx.snapshotManager.report();snapshot&&console.log(snapshot.join(`
11
- `));let suites=getSuites(files),tests=getTests(files),failedSuites=suites.filter(i=>{var _a2;return(_a2=i.result)==null?void 0:_a2.error}),runnable=tests.filter(i=>{var _a2,_b2;return((_a2=i.result)==null?void 0:_a2.state)==="pass"||((_b2=i.result)==null?void 0:_b2.state)==="fail"}),passed=tests.filter(i=>{var _a2;return((_a2=i.result)==null?void 0:_a2.state)==="pass"}),failed=tests.filter(i=>{var _a2;return((_a2=i.result)==null?void 0:_a2.state)==="fail"}),skipped=tests.filter(i=>i.mode==="skip"),todo=tests.filter(i=>i.mode==="todo");if(failedSuites.length){console.error(c3.bold(c3.red(`
12
- Failed to run ${failedSuites.length} suites:`)));for(let suite of failedSuites)console.error(c3.red(`
13
- - ${(_a=suite.file)==null?void 0:_a.filepath} > ${suite.name}`)),await printError((_b=suite.result)==null?void 0:_b.error),console.log()}if(failed.length){console.error(c3.bold(c3.red(`
14
- Failed Tests (${failed.length})`)));for(let test of failed)console.error(`${c3.red(`
15
- ${c3.inverse(" FAIL ")}`)} ${[test.suite.name,test.name].filter(Boolean).join(" > ")}`),await printError((_c=test.result)==null?void 0:_c.error),console.log()}console.log(c3.bold(c3.green(`Passed ${passed.length} / ${runnable.length}`))),failed.length&&console.log(c3.bold(c3.red(`Failed ${failed.length} / ${runnable.length}`))),skipped.length&&console.log(c3.yellow(`Skipped ${skipped.length}`)),todo.length&&console.log(c3.dim(`Todo ${todo.length}`)),console.log(`Time ${(this.end-this.start).toFixed(2)}ms`)}async onWatcherStart(ctx){await this.listrPromise;let failed=ctx.tests.filter(i=>{var _a;return((_a=i.result)==null?void 0:_a.state)==="fail"});failed.length?console.log(`
16
- ${c3.bold(c3.inverse(c3.red(" FAIL ")))}${c3.red(` ${failed.length} tests failed. Watching for file changes...`)}`):console.log(`
17
- ${c3.bold(c3.inverse(c3.green(" PASS ")))}${c3.green(" Watching for file changes...")}`)}async onWatcherRerun(files,trigger){await this.listrPromise,console.clear(),console.log(c3.blue("Re-running tests...")+c3.dim(` [ ${this.relative(trigger)} ]
18
- `))}};init_esm_shims();init_esm_shims();import chai2 from"chai";import SinonChai from"sinon-chai";import Subset from"chai-subset";init_esm_shims();function JestChaiExpect(){return(chai3,utils)=>{let proto=chai3.Assertion.prototype;utils.addMethod(proto,"toEqual",function(expected){return this.eql(expected)}),utils.addMethod(proto,"toStrictEqual",function(expected){return this.equal(expected)}),utils.addMethod(proto,"toBe",function(expected){return this.equal(expected)}),utils.addMethod(proto,"toMatchObject",function(expected){return this.containSubset(expected)}),utils.addMethod(proto,"toMatch",function(expected){return typeof expected=="string"?this.include(expected):this.match(expected)}),utils.addMethod(proto,"toContain",function(item){return this.contain(item)}),utils.addMethod(proto,"toBeTruthy",function(){let obj=utils.flag(this,"object");this.assert(Boolean(obj),"expected #{this} to be truthy","expected #{this} to not be truthy",obj)}),utils.addMethod(proto,"toBeFalsy",function(){let obj=utils.flag(this,"object");this.assert(!obj,"expected #{this} to be falsy","expected #{this} to not be falsy",obj)}),utils.addMethod(proto,"toBeNaN",function(){return this.be.NaN}),utils.addMethod(proto,"toBeUndefined",function(){return this.be.undefined}),utils.addMethod(proto,"toBeNull",function(){return this.be.null}),utils.addMethod(proto,"toBeDefined",function(){return this.not.be.undefined}),utils.addMethod(proto,"toBeInstanceOf",function(obj){return this.instanceOf(obj)}),utils.addMethod(proto,"toHaveBeenCalledTimes",function(number){return this.callCount(number)}),utils.addMethod(proto,"toHaveBeenCalledOnce",function(){return this.callCount(1)}),utils.addMethod(proto,"toHaveBeenCalled",function(){return this.called}),utils.addMethod(proto,"toHaveBeenCalled",function(){return this.called}),utils.addMethod(proto,"toHaveBeenCalledWith",function(...args){return this.calledWith(...args)})}}async function setupChai(config){chai2.use(SinonChai),chai2.use(JestChaiExpect()),chai2.use(Subset),chai2.use(await SnapshotPlugin(config))}async function setupEnv(config){await setupChai(config),config.global&&(await import("../global-EYQRAQJ6.js")).registerApiGlobally(),config.dom==="happy-dom"?(await import("../happy-dom-57PK5RJB.js")).setupHappyDOM(globalThis):config.dom&&(await import("../jsdom-3T4EXDYB.js")).setupJSDOM(globalThis)}async function setupRunner(config){return await setupEnv(config),{filesMap:{},get files(){return Object.values(this.filesMap)},get tests(){return getTests(Object.values(this.filesMap))},config,reporter:config.reporter||new DefaultReporter,snapshotManager:getSnapshotManager()}}async function callHook(suite,name,args){await Promise.all(getHooks(suite)[name].map(fn=>fn(...args)))}async function runTest(test,ctx){var _a,_b,_c;if(test.mode!=="run")return;let{reporter}=ctx;(_a=getSnapshotManager())==null||_a.setTest(test),await((_b=reporter.onTestBegin)==null?void 0:_b.call(reporter,test,ctx)),test.result={start:performance.now(),state:"run"};try{await callHook(test.suite,"beforeEach",[test,test.suite]),await getFn(test)(),test.result.state="pass"}catch(e){test.result.state="fail",test.result.error=e,process.exitCode=1}try{await callHook(test.suite,"afterEach",[test,test.suite])}catch(e){test.result.state="fail",test.result.error=e,process.exitCode=1}test.result.end=performance.now(),await((_c=reporter.onTestEnd)==null?void 0:_c.call(reporter,test,ctx))}async function runSuite(suite,ctx){var _a,_b;let{reporter}=ctx;if(await((_a=reporter.onSuiteBegin)==null?void 0:_a.call(reporter,suite,ctx)),suite.result={start:performance.now(),state:"run"},suite.mode==="skip")suite.result.state="skip";else if(suite.mode==="todo")suite.result.state="todo";else try{await callHook(suite,"beforeAll",[suite]);for(let tasksGroup of partitionSuiteChildren(suite)){let computeMode=tasksGroup[0].computeMode;if(computeMode==="serial")for(let c4 of tasksGroup)await runSuiteChild(c4,ctx);else computeMode==="concurrent"&&await Promise.all(tasksGroup.map(c4=>runSuiteChild(c4,ctx)))}await callHook(suite,"afterAll",[suite])}catch(e){suite.result.state="fail",suite.result.error=e,process.exitCode=1}suite.result.end=performance.now(),suite.mode==="run"&&(hasTests(suite)?hasFailed(suite)&&(suite.result.state="fail"):(suite.result.state="fail",suite.result.error=new Error(`No tests found in suite ${suite.name}`),process.exitCode=1)),await((_b=reporter.onSuiteEnd)==null?void 0:_b.call(reporter,suite,ctx))}async function runSuiteChild(c4,ctx){return c4.type==="test"?runTest(c4,ctx):runSuite(c4,ctx)}async function runSuites(suites,ctx){for(let suite of suites)await runSuite(suite,ctx)}async function run(config){var _a,_b,_c;let testFilepaths=await globTestFiles(config);if(!testFilepaths.length){console.error("No test files found"),process.exitCode=1;return}let ctx=await setupRunner(config),{filesMap,snapshotManager,reporter}=ctx;await((_a=reporter.onStart)==null?void 0:_a.call(reporter,config));let newFileMap=await collectTests(testFilepaths);Object.assign(filesMap,newFileMap);let files=Object.values(filesMap);await((_b=reporter.onCollected)==null?void 0:_b.call(reporter,files,ctx)),await runSuites(files,ctx),snapshotManager.saveSnap(),await((_c=reporter.onFinished)==null?void 0:_c.call(reporter,ctx)),config.watch&&await startWatcher(ctx)}if(!process.__vitest__)throw new Error("Vitest can only run in vite-node environment, please use the CLI to start the process");await run(process.__vitest__.config);var timer=setTimeout(()=>{process.exit()},500);timer.unref();
18
+ `)}`}function notBlank(line){return typeof line!="undefined"&&line!==null}init_esm_shims();init_esm_shims();import process4 from"node:process";init_esm_shims();var ESC="[",OSC="]",BEL="\x07",SEP=";",isTerminalApp=process.env.TERM_PROGRAM==="Apple_Terminal",ansiEscapes={};ansiEscapes.cursorTo=(x,y)=>{if(typeof x!="number")throw new TypeError("The `x` argument is required");return typeof y!="number"?ESC+(x+1)+"G":ESC+(y+1)+";"+(x+1)+"H"};ansiEscapes.cursorMove=(x,y)=>{if(typeof x!="number")throw new TypeError("The `x` argument is required");let returnValue="";return x<0?returnValue+=ESC+-x+"D":x>0&&(returnValue+=ESC+x+"C"),y<0?returnValue+=ESC+-y+"A":y>0&&(returnValue+=ESC+y+"B"),returnValue};ansiEscapes.cursorUp=(count=1)=>ESC+count+"A";ansiEscapes.cursorDown=(count=1)=>ESC+count+"B";ansiEscapes.cursorForward=(count=1)=>ESC+count+"C";ansiEscapes.cursorBackward=(count=1)=>ESC+count+"D";ansiEscapes.cursorLeft=ESC+"G";ansiEscapes.cursorSavePosition=isTerminalApp?"7":ESC+"s";ansiEscapes.cursorRestorePosition=isTerminalApp?"8":ESC+"u";ansiEscapes.cursorGetPosition=ESC+"6n";ansiEscapes.cursorNextLine=ESC+"E";ansiEscapes.cursorPrevLine=ESC+"F";ansiEscapes.cursorHide=ESC+"?25l";ansiEscapes.cursorShow=ESC+"?25h";ansiEscapes.eraseLines=count=>{let clear="";for(let i=0;i<count;i++)clear+=ansiEscapes.eraseLine+(i<count-1?ansiEscapes.cursorUp():"");return count&&(clear+=ansiEscapes.cursorLeft),clear};ansiEscapes.eraseEndLine=ESC+"K";ansiEscapes.eraseStartLine=ESC+"1K";ansiEscapes.eraseLine=ESC+"2K";ansiEscapes.eraseDown=ESC+"J";ansiEscapes.eraseUp=ESC+"1J";ansiEscapes.eraseScreen=ESC+"2J";ansiEscapes.scrollUp=ESC+"S";ansiEscapes.scrollDown=ESC+"T";ansiEscapes.clearScreen="c";ansiEscapes.clearTerminal=process.platform==="win32"?`${ansiEscapes.eraseScreen}${ESC}0f`:`${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;ansiEscapes.beep=BEL;ansiEscapes.link=(text,url)=>[OSC,"8",SEP,SEP,url,BEL,text,OSC,"8",SEP,SEP,BEL].join("");ansiEscapes.image=(buffer,options={})=>{let returnValue=`${OSC}1337;File=inline=1`;return options.width&&(returnValue+=`;width=${options.width}`),options.height&&(returnValue+=`;height=${options.height}`),options.preserveAspectRatio===!1&&(returnValue+=";preserveAspectRatio=0"),returnValue+":"+buffer.toString("base64")+BEL};ansiEscapes.iTerm={setCwd:(cwd=process.cwd())=>`${OSC}50;CurrentDir=${cwd}${BEL}`,annotation:(message,options={})=>{let returnValue=`${OSC}1337;`,hasX=typeof options.x!="undefined",hasY=typeof options.y!="undefined";if((hasX||hasY)&&!(hasX&&hasY&&typeof options.length!="undefined"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return message=message.replace(/\|/g,""),returnValue+=options.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",options.length>0?returnValue+=(hasX?[message,options.length,options.x,options.y]:[options.length,message]).join("|"):returnValue+=message,returnValue+BEL}};var ansi_escapes_default=ansiEscapes;init_esm_shims();import process3 from"node:process";init_esm_shims();var import_onetime=__toModule(require_onetime()),import_signal_exit=__toModule(require_signal_exit());import process2 from"node:process";var restoreCursor=(0,import_onetime.default)(()=>{(0,import_signal_exit.default)(()=>{process2.stderr.write("[?25h")},{alwaysLast:!0})}),restore_cursor_default=restoreCursor;var isHidden=!1,cliCursor={};cliCursor.show=(writableStream=process3.stderr)=>{!writableStream.isTTY||(isHidden=!1,writableStream.write("[?25h"))};cliCursor.hide=(writableStream=process3.stderr)=>{!writableStream.isTTY||(restore_cursor_default(),isHidden=!0,writableStream.write("[?25l"))};cliCursor.toggle=(force,writableStream)=>{force!==void 0&&(isHidden=force),isHidden?cliCursor.show(writableStream):cliCursor.hide(writableStream)};var cli_cursor_default=cliCursor;init_esm_shims();init_esm_shims();init_esm_shims();init_esm_shims();function ansiRegex({onlyFirst=!1}={}){let pattern=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(pattern,onlyFirst?void 0:"g")}function stripAnsi(string){if(typeof string!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);return string.replace(ansiRegex(),"")}init_esm_shims();function isFullwidthCodePoint(codePoint){return Number.isInteger(codePoint)?codePoint>=4352&&(codePoint<=4447||codePoint===9001||codePoint===9002||11904<=codePoint&&codePoint<=12871&&codePoint!==12351||12880<=codePoint&&codePoint<=19903||19968<=codePoint&&codePoint<=42182||43360<=codePoint&&codePoint<=43388||44032<=codePoint&&codePoint<=55203||63744<=codePoint&&codePoint<=64255||65040<=codePoint&&codePoint<=65049||65072<=codePoint&&codePoint<=65131||65281<=codePoint&&codePoint<=65376||65504<=codePoint&&codePoint<=65510||110592<=codePoint&&codePoint<=110593||127488<=codePoint&&codePoint<=127569||131072<=codePoint&&codePoint<=262141):!1}var import_emoji_regex=__toModule(require_emoji_regex());function stringWidth(string){if(typeof string!="string"||string.length===0||(string=stripAnsi(string),string.length===0))return 0;string=string.replace((0,import_emoji_regex.default)()," ");let width=0;for(let index=0;index<string.length;index++){let codePoint=string.codePointAt(index);codePoint<=31||codePoint>=127&&codePoint<=159||codePoint>=768&&codePoint<=879||(codePoint>65535&&index++,width+=isFullwidthCodePoint(codePoint)?2:1)}return width}init_esm_shims();var ANSI_BACKGROUND_OFFSET=10,wrapAnsi16=(offset=0)=>code=>`[${code+offset}m`,wrapAnsi256=(offset=0)=>code=>`[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`[${38+offset};2;${red};${green};${blue}m`;function assembleStyles(){let codes=new Map,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};styles.color.gray=styles.color.blackBright,styles.bgColor.bgGray=styles.bgColor.bgBlackBright,styles.color.grey=styles.color.blackBright,styles.bgColor.bgGrey=styles.bgColor.bgBlackBright;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`[${style[0]}m`,close:`[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1})}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="",styles.bgColor.close="",styles.color.ansi=wrapAnsi16(),styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi=wrapAnsi16(ANSI_BACKGROUND_OFFSET),styles.bgColor.ansi256=wrapAnsi256(ANSI_BACKGROUND_OFFSET),styles.bgColor.ansi16m=wrapAnsi16m(ANSI_BACKGROUND_OFFSET),Object.defineProperties(styles,{rgbToAnsi256:{value:(red,green,blue)=>red===green&&green===blue?red<8?16:red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5),enumerable:!1},hexToRgb:{value:hex=>{let matches=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));if(!matches)return[0,0,0];let{colorString}=matches.groups;colorString.length===3&&(colorString=colorString.split("").map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return[integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1},ansi256ToAnsi:{value:code=>{if(code<8)return 30+code;if(code<16)return 90+(code-8);let red,green,blue;if(code>=232)red=((code-232)*10+8)/255,green=red,blue=red;else{code-=16;let remainder=code%36;red=Math.floor(code/36)/5,green=Math.floor(remainder/6)/5,blue=remainder%6/5}let value=Math.max(red,green,blue)*2;if(value===0)return 30;let result=30+(Math.round(blue)<<2|Math.round(green)<<1|Math.round(red));return value===2&&(result+=60),result},enumerable:!1},rgbToAnsi:{value:(red,green,blue)=>styles.ansi256ToAnsi(styles.rgbToAnsi256(red,green,blue)),enumerable:!1},hexToAnsi:{value:hex=>styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),enumerable:!1}}),styles}var ansiStyles=assembleStyles(),ansi_styles_default=ansiStyles;var ESCAPES=new Set(["","\x9B"]),END_CODE=39,ANSI_ESCAPE_BELL="\x07",ANSI_CSI="[",ANSI_OSC="]",ANSI_SGR_TERMINATOR="m",ANSI_ESCAPE_LINK=`${ANSI_OSC}8;;`,wrapAnsiCode=code=>`${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`,wrapAnsiHyperlink=uri=>`${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`,wordLengths=string=>string.split(" ").map(character=>stringWidth(character)),wrapWord=(rows,word,columns)=>{let characters=[...word],isInsideEscape=!1,isInsideLinkEscape=!1,visible=stringWidth(stripAnsi(rows[rows.length-1]));for(let[index,character]of characters.entries()){let characterLength=stringWidth(character);if(visible+characterLength<=columns?rows[rows.length-1]+=character:(rows.push(character),visible=0),ESCAPES.has(character)&&(isInsideEscape=!0,isInsideLinkEscape=characters.slice(index+1).join("").startsWith(ANSI_ESCAPE_LINK)),isInsideEscape){isInsideLinkEscape?character===ANSI_ESCAPE_BELL&&(isInsideEscape=!1,isInsideLinkEscape=!1):character===ANSI_SGR_TERMINATOR&&(isInsideEscape=!1);continue}visible+=characterLength,visible===columns&&index<characters.length-1&&(rows.push(""),visible=0)}!visible&&rows[rows.length-1].length>0&&rows.length>1&&(rows[rows.length-2]+=rows.pop())},stringVisibleTrimSpacesRight=string=>{let words=string.split(" "),last=words.length;for(;last>0&&!(stringWidth(words[last-1])>0);)last--;return last===words.length?string:words.slice(0,last).join(" ")+words.slice(last).join("")},exec=(string,columns,options={})=>{if(options.trim!==!1&&string.trim()==="")return"";let returnValue="",escapeCode,escapeUrl,lengths=wordLengths(string),rows=[""];for(let[index,word]of string.split(" ").entries()){options.trim!==!1&&(rows[rows.length-1]=rows[rows.length-1].trimStart());let rowLength=stringWidth(rows[rows.length-1]);if(index!==0&&(rowLength>=columns&&(options.wordWrap===!1||options.trim===!1)&&(rows.push(""),rowLength=0),(rowLength>0||options.trim===!1)&&(rows[rows.length-1]+=" ",rowLength++)),options.hard&&lengths[index]>columns){let remainingColumns=columns-rowLength,breaksStartingThisLine=1+Math.floor((lengths[index]-remainingColumns-1)/columns);Math.floor((lengths[index]-1)/columns)<breaksStartingThisLine&&rows.push(""),wrapWord(rows,word,columns);continue}if(rowLength+lengths[index]>columns&&rowLength>0&&lengths[index]>0){if(options.wordWrap===!1&&rowLength<columns){wrapWord(rows,word,columns);continue}rows.push("")}if(rowLength+lengths[index]>columns&&options.wordWrap===!1){wrapWord(rows,word,columns);continue}rows[rows.length-1]+=word}options.trim!==!1&&(rows=rows.map(row=>stringVisibleTrimSpacesRight(row)));let pre=[...rows.join(`
19
+ `)];for(let[index,character]of pre.entries()){if(returnValue+=character,ESCAPES.has(character)){let{groups}=new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join(""))||{groups:{}};if(groups.code!==void 0){let code2=Number.parseFloat(groups.code);escapeCode=code2===END_CODE?void 0:code2}else groups.uri!==void 0&&(escapeUrl=groups.uri.length===0?void 0:groups.uri)}let code=ansi_styles_default.codes.get(Number(escapeCode));pre[index+1]===`
20
+ `?(escapeUrl&&(returnValue+=wrapAnsiHyperlink("")),escapeCode&&code&&(returnValue+=wrapAnsiCode(code))):character===`
21
+ `&&(escapeCode&&code&&(returnValue+=wrapAnsiCode(escapeCode)),escapeUrl&&(returnValue+=wrapAnsiHyperlink(escapeUrl)))}return returnValue};function wrapAnsi(string,columns,options){return String(string).normalize().replace(/\r\n/g,`
22
+ `).split(`
23
+ `).map(line=>exec(line,columns,options)).join(`
24
+ `)}init_esm_shims();var astralRegex=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,ESCAPES2=["","\x9B"],wrapAnsi2=code=>`${ESCAPES2[0]}[${code}m`,checkAnsi=(ansiCodes,isEscapes,endAnsiCode)=>{let output=[];ansiCodes=[...ansiCodes];for(let ansiCode of ansiCodes){let ansiCodeOrigin=ansiCode;ansiCode.includes(";")&&(ansiCode=ansiCode.split(";")[0][0]+"0");let item=ansi_styles_default.codes.get(Number.parseInt(ansiCode,10));if(item){let indexEscape=ansiCodes.indexOf(item.toString());indexEscape===-1?output.push(wrapAnsi2(isEscapes?item:ansiCodeOrigin)):ansiCodes.splice(indexEscape,1)}else if(isEscapes){output.push(wrapAnsi2(0));break}else output.push(wrapAnsi2(ansiCodeOrigin))}if(isEscapes&&(output=output.filter((element,index)=>output.indexOf(element)===index),endAnsiCode!==void 0)){let fistEscapeCode=wrapAnsi2(ansi_styles_default.codes.get(Number.parseInt(endAnsiCode,10)));output=output.reduce((current,next)=>next===fistEscapeCode?[next,...current]:[...current,next],[])}return output.join("")};function sliceAnsi(string,begin,end){let characters=[...string],ansiCodes=[],stringEnd=typeof end=="number"?end:characters.length,isInsideEscape=!1,ansiCode,visible=0,output="";for(let[index,character]of characters.entries()){let leftEscape=!1;if(ESCAPES2.includes(character)){let code=/\d[^m]*/.exec(string.slice(index,index+18));ansiCode=code&&code.length>0?code[0]:void 0,visible<stringEnd&&(isInsideEscape=!0,ansiCode!==void 0&&ansiCodes.push(ansiCode))}else isInsideEscape&&character==="m"&&(isInsideEscape=!1,leftEscape=!0);if(!isInsideEscape&&!leftEscape&&visible++,!astralRegex.test(character)&&isFullwidthCodePoint(character.codePointAt())&&(visible++,typeof end!="number"&&stringEnd++),visible>begin&&visible<=stringEnd)output+=character;else if(visible===begin&&!isInsideEscape&&ansiCode!==void 0)output=checkAnsi(ansiCodes);else if(visible>=stringEnd){output+=checkAnsi(ansiCodes,!0,ansiCode);break}}return output}import"node:console";var defaultTerminalHeight=24,getWidth=stream=>{let{columns}=stream;return columns||80},fitToTerminalHeight=(stream,text)=>{let terminalHeight=stream.rows||defaultTerminalHeight,lines=text.split(`
25
+ `),toRemove=lines.length-terminalHeight;return toRemove<=0?text:sliceAnsi(text,lines.slice(0,toRemove).join(`
26
+ `).length+1,text.length)};function createLogUpdate(stream,{showCursor=!1}={}){let previousLineCount=0,previousWidth=getWidth(stream),previousOutput="",render=(...arguments_)=>{showCursor||cli_cursor_default.hide();let output=arguments_.join(" ")+`
27
+ `;output=fitToTerminalHeight(stream,output);let width=getWidth(stream);output===previousOutput&&previousWidth===width||(previousOutput=output,previousWidth=width,output=wrapAnsi(output,width,{trim:!1,hard:!0,wordWrap:!1}),stream.write(ansi_escapes_default.eraseLines(previousLineCount)+output),previousLineCount=output.split(`
28
+ `).length)};return render.clear=()=>{stream.write(ansi_escapes_default.eraseLines(previousLineCount)),previousOutput="",previousWidth=getWidth(stream),previousLineCount=0},render.done=()=>{previousOutput="",previousWidth=getWidth(stream),previousLineCount=0,showCursor||cli_cursor_default.show()},render}var logUpdate=createLogUpdate(process4.stdout);var logUpdateStderr=createLogUpdate(process4.stderr);var import_indent_string=__toModule(require_indent_string());import c3 from"picocolors";import figures from"figures";init_esm_shims();function getIndexOfNearestSpace(string,wantedIndex,shouldSearchRight){if(string.charAt(wantedIndex)===" ")return wantedIndex;for(let index=1;index<=3;index++)if(shouldSearchRight){if(string.charAt(wantedIndex+index)===" ")return wantedIndex+index}else if(string.charAt(wantedIndex-index)===" ")return wantedIndex-index;return wantedIndex}function cliTruncate(text,columns,options){options=__spreadValues({position:"end",preferTruncationOnSpace:!1,truncationCharacter:"\u2026"},options);let{position,space,preferTruncationOnSpace}=options,{truncationCharacter}=options;if(typeof text!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof text}`);if(typeof columns!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof columns}`);if(columns<1)return"";if(columns===1)return truncationCharacter;let length=stringWidth(text);if(length<=columns)return text;if(position==="start"){if(preferTruncationOnSpace){let nearestSpace=getIndexOfNearestSpace(text,length-columns+1,!0);return truncationCharacter+sliceAnsi(text,nearestSpace,length).trim()}return space===!0&&(truncationCharacter+=" "),truncationCharacter+sliceAnsi(text,length-columns+stringWidth(truncationCharacter),length)}if(position==="middle"){space===!0&&(truncationCharacter=` ${truncationCharacter} `);let half=Math.floor(columns/2);if(preferTruncationOnSpace){let spaceNearFirstBreakPoint=getIndexOfNearestSpace(text,half),spaceNearSecondBreakPoint=getIndexOfNearestSpace(text,length-(columns-half)+1,!0);return sliceAnsi(text,0,spaceNearFirstBreakPoint)+truncationCharacter+sliceAnsi(text,spaceNearSecondBreakPoint,length).trim()}return sliceAnsi(text,0,half)+truncationCharacter+sliceAnsi(text,length-(columns-half)+stringWidth(truncationCharacter),length)}if(position==="end"){if(preferTruncationOnSpace){let nearestSpace=getIndexOfNearestSpace(text,columns-1);return sliceAnsi(text,0,nearestSpace)+truncationCharacter}return space===!0&&(truncationCharacter=` ${truncationCharacter}`),sliceAnsi(text,0,columns-stringWidth(truncationCharacter))+truncationCharacter}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`)}init_esm_shims();import process5 from"node:process";var spinnerFrames=process5.platform==="win32"?["-","\\","|","/"]:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function elegantSpinner(){let index=0;return()=>(index=++index%spinnerFrames.length,spinnerFrames[index])}var import_log_symbols=__toModule(require_log_symbols());var DURATION_LONG=300,pointer=c3.yellow(figures.pointer),skipped=c3.yellow(figures.arrowDown),spinnerMap=new WeakMap,outputMap=new WeakMap,getSymbol=task=>{if(task.mode==="skip"||task.mode==="todo")return skipped;if(!task.result)return c3.gray("\xB7");if(task.result.state==="run"){if(task.type==="suite")return pointer;let spinner=spinnerMap.get(task);return spinner||(spinner=elegantSpinner(),spinnerMap.set(task,spinner)),c3.yellow(spinner())}return task.result.state==="pass"?import_log_symbols.default.success:task.result.state==="fail"?task.type==="suite"?pointer:import_log_symbols.default.error:" "},renderHelper=(tasks,level=0)=>{var _a,_b,_c,_d;let output=[];for(let task of tasks){let delta=1,suffix=task.mode==="skip"||task.mode==="todo"?` ${c3.dim("[skipped]")}`:"";if(task.type==="suite"&&(suffix+=c3.dim(` (${getTests(task).length})`)),(_a=task.result)==null?void 0:_a.end){let duration=task.result.end-task.result.start;duration>DURATION_LONG&&(suffix+=c3.yellow(` ${Math.round(duration)}${c3.dim("ms")}`))}if(task.name?output.push((0,import_indent_string.default)(` ${getSymbol(task)} ${task.name}${suffix}`,level,{indent:" "})):delta=0,((_b=task.result)==null?void 0:_b.state)!=="pass"&&outputMap.get(task)!=null){let data=outputMap.get(task);if(typeof data=="string"&&(data=stripAnsi(data.trim().split(`
29
+ `).filter(Boolean).pop()),data===""&&(data=void 0)),data!=null){let out=(0,import_indent_string.default)(`${figures.arrowRight} ${data}`,level,{indent:" "});output.push(` ${c3.gray(cliTruncate(out,process.stdout.columns-3))}`)}}(((_c=task.result)==null?void 0:_c.state)==="fail"||((_d=task.result)==null?void 0:_d.state)==="run")&&task.type==="suite"&&task.tasks.length>0&&(output=output.concat(renderHelper(task.tasks,level+delta)))}return output},createRenderer=_tasks=>{let tasks=_tasks,timer2,log=createLogUpdate(process.stdout);function run2(){let content=renderHelper(tasks);log(content.slice(0,20).join(`
30
+ `))}return{start(){return timer2?this:(timer2=setInterval(run2,200),this)},update(_tasks2){return tasks=_tasks2,run2(),this},stop(){return timer2&&(clearInterval(timer2),timer2=void 0),run2(),log.done(),this}}};var DefaultReporter=class{constructor(config){this.config=config}start=0;end=0;renderer=void 0;relative(path2){return relative(this.config.root,path2)}onStart(){console.log(c4.green(`Running tests under ${c4.gray(this.config.root)}
31
+ `))}onCollected(files){var _a;this.start=performance2.now(),(_a=this.renderer)==null||_a.stop(),this.renderer=createRenderer(files).start()}async onFinished(ctx,files=ctx.files){var _a,_b,_c,_d;(_a=this.renderer)==null||_a.stop(),this.end=performance2.now(),console.log();let snapshot=ctx.snapshotManager.report();snapshot&&console.log(snapshot.join(`
32
+ `));let suites=getSuites(files),tests=getTests(files),failedSuites=suites.filter(i=>{var _a2;return(_a2=i.result)==null?void 0:_a2.error}),runnable=tests.filter(i=>{var _a2,_b2;return((_a2=i.result)==null?void 0:_a2.state)==="pass"||((_b2=i.result)==null?void 0:_b2.state)==="fail"}),passed=tests.filter(i=>{var _a2;return((_a2=i.result)==null?void 0:_a2.state)==="pass"}),failed=tests.filter(i=>{var _a2;return((_a2=i.result)==null?void 0:_a2.state)==="fail"}),skipped2=tests.filter(i=>i.mode==="skip"),todo=tests.filter(i=>i.mode==="todo");if(failedSuites.length){console.error(c4.bold(c4.red(`
33
+ Failed to run ${failedSuites.length} suites:`)));for(let suite of failedSuites)console.error(c4.red(`
34
+ - ${(_b=suite.file)==null?void 0:_b.filepath} > ${suite.name}`)),await printError((_c=suite.result)==null?void 0:_c.error),console.log()}if(failed.length){console.error(c4.bold(c4.red(`
35
+ Failed Tests (${failed.length})`)));for(let test of failed)console.error(`${c4.red(`
36
+ ${c4.inverse(" FAIL ")}`)} ${[test.suite.name,test.name].filter(Boolean).join(" > ")}`),await printError((_d=test.result)==null?void 0:_d.error),console.log()}console.log(c4.bold(c4.green(`Passed ${passed.length} / ${runnable.length}`))),failed.length&&console.log(c4.bold(c4.red(`Failed ${failed.length} / ${runnable.length}`))),skipped2.length&&console.log(c4.yellow(`Skipped ${skipped2.length}`)),todo.length&&console.log(c4.dim(`Todo ${todo.length}`)),console.log(`Time ${(this.end-this.start).toFixed(2)}ms`)}async onWatcherStart(ctx){var _a;(_a=this.renderer)==null||_a.stop();let failed=ctx.tests.filter(i=>{var _a2;return((_a2=i.result)==null?void 0:_a2.state)==="fail"});failed.length?console.log(`
37
+ ${c4.bold(c4.inverse(c4.red(" FAIL ")))}${c4.red(` ${failed.length} tests failed. Watching for file changes...`)}`):console.log(`
38
+ ${c4.bold(c4.inverse(c4.green(" PASS ")))}${c4.green(" Watching for file changes...")}`)}async onWatcherRerun(files,trigger){var _a;(_a=this.renderer)==null||_a.stop(),console.clear(),console.log(c4.blue("Re-running tests...")+c4.dim(` [ ${this.relative(trigger)} ]
39
+ `))}};init_esm_shims();init_esm_shims();var import_sinon_chai=__toModule(require_sinon_chai());import chai3 from"chai";import Subset from"chai-subset";init_esm_shims();function JestChaiExpect(){return(chai4,utils)=>{let proto=chai4.Assertion.prototype;utils.addMethod(proto,"toEqual",function(expected){return this.eql(expected)}),utils.addMethod(proto,"toStrictEqual",function(expected){return this.equal(expected)}),utils.addMethod(proto,"toBe",function(expected){return this.equal(expected)}),utils.addMethod(proto,"toMatchObject",function(expected){return this.containSubset(expected)}),utils.addMethod(proto,"toMatch",function(expected){return typeof expected=="string"?this.include(expected):this.match(expected)}),utils.addMethod(proto,"toContain",function(item){return this.contain(item)}),utils.addMethod(proto,"toBeTruthy",function(){let obj=utils.flag(this,"object");this.assert(Boolean(obj),"expected #{this} to be truthy","expected #{this} to not be truthy",obj)}),utils.addMethod(proto,"toBeFalsy",function(){let obj=utils.flag(this,"object");this.assert(!obj,"expected #{this} to be falsy","expected #{this} to not be falsy",obj)}),utils.addMethod(proto,"toBeNaN",function(){return this.be.NaN}),utils.addMethod(proto,"toBeUndefined",function(){return this.be.undefined}),utils.addMethod(proto,"toBeNull",function(){return this.be.null}),utils.addMethod(proto,"toBeDefined",function(){return this.not.be.undefined}),utils.addMethod(proto,"toBeInstanceOf",function(obj){return this.instanceOf(obj)}),utils.addMethod(proto,"toHaveBeenCalledTimes",function(number){return this.callCount(number)}),utils.addMethod(proto,"toHaveBeenCalledOnce",function(){return this.callCount(1)}),utils.addMethod(proto,"toHaveBeenCalled",function(){return this.called}),utils.addMethod(proto,"toHaveBeenCalled",function(){return this.called}),utils.addMethod(proto,"toHaveBeenCalledWith",function(...args){return this.calledWith(...args)})}}async function setupChai(config){chai3.use(import_sinon_chai.default),chai3.use(JestChaiExpect()),chai3.use(Subset),chai3.use(await SnapshotPlugin(config))}async function setupEnv(config){await setupChai(config),config.global&&(await import("../global-MUBPT26L.js")).registerApiGlobally(),config.dom==="happy-dom"?(await import("../happy-dom-UCCFJZ4E.js")).setupHappyDOM(globalThis):config.dom&&(await import("../jsdom-6UH2UV3A.js")).setupJSDOM(globalThis)}async function setupRunner(config){return await setupEnv(config),{filesMap:{},get files(){return Object.values(this.filesMap)},get tests(){return getTests(Object.values(this.filesMap))},config,reporter:config.reporter||new DefaultReporter(config),snapshotManager:getSnapshotManager()}}async function callHook(suite,name,args){await Promise.all(getHooks(suite)[name].map(fn=>fn(...args)))}async function runTest(test,ctx){var _a,_b,_c;if(test.mode!=="run")return;let{reporter}=ctx;(_a=getSnapshotManager())==null||_a.setTest(test),await((_b=reporter.onTestBegin)==null?void 0:_b.call(reporter,test,ctx)),test.result={start:performance3.now(),state:"run"};try{await callHook(test.suite,"beforeEach",[test,test.suite]),await getFn(test)(),test.result.state="pass"}catch(e){test.result.state="fail",test.result.error=e,process.exitCode=1}try{await callHook(test.suite,"afterEach",[test,test.suite])}catch(e){test.result.state="fail",test.result.error=e,process.exitCode=1}test.result.end=performance3.now(),await((_c=reporter.onTestEnd)==null?void 0:_c.call(reporter,test,ctx))}async function runSuite(suite,ctx){var _a,_b;let{reporter}=ctx;if(await((_a=reporter.onSuiteBegin)==null?void 0:_a.call(reporter,suite,ctx)),suite.result={start:performance3.now(),state:"run"},suite.mode==="skip")suite.result.state="skip";else if(suite.mode==="todo")suite.result.state="todo";else try{await callHook(suite,"beforeAll",[suite]);for(let tasksGroup of partitionSuiteChildren(suite)){let computeMode=tasksGroup[0].computeMode;if(computeMode==="serial")for(let c5 of tasksGroup)await runSuiteChild(c5,ctx);else computeMode==="concurrent"&&await Promise.all(tasksGroup.map(c5=>runSuiteChild(c5,ctx)))}await callHook(suite,"afterAll",[suite])}catch(e){suite.result.state="fail",suite.result.error=e,process.exitCode=1}suite.result.end=performance3.now(),suite.mode==="run"&&(hasTests(suite)?hasFailed(suite)?suite.result.state="fail":suite.result.state="pass":(suite.result.state="fail",suite.result.error=new Error(`No tests found in suite ${suite.name}`),process.exitCode=1)),await((_b=reporter.onSuiteEnd)==null?void 0:_b.call(reporter,suite,ctx))}async function runSuiteChild(c5,ctx){return c5.type==="test"?runTest(c5,ctx):runSuite(c5,ctx)}async function runSuites(suites,ctx){for(let suite of suites)await runSuite(suite,ctx)}async function run(config){var _a,_b,_c;let testFilepaths=await globTestFiles(config);if(!testFilepaths.length){console.error("No test files found"),process.exitCode=1;return}let ctx=await setupRunner(config),{filesMap,snapshotManager,reporter}=ctx;await((_a=reporter.onStart)==null?void 0:_a.call(reporter,config));let newFileMap=await collectTests(testFilepaths);Object.assign(filesMap,newFileMap);let files=Object.values(filesMap);await((_b=reporter.onCollected)==null?void 0:_b.call(reporter,files,ctx)),await runSuites(files,ctx),snapshotManager.saveSnap(),await((_c=reporter.onFinished)==null?void 0:_c.call(reporter,ctx)),config.watch&&await startWatcher(ctx)}if(!process.__vitest__)throw new Error("Vitest can only run in vite-node environment, please use the CLI to start the process");await run(process.__vitest__.config);var timer=setTimeout(()=>{process.exit()},500);timer.unref();
@@ -114,22 +114,26 @@ declare type RunMode = 'run' | 'skip' | 'only' | 'todo';
114
114
  declare type TestState = RunMode | 'pass' | 'fail';
115
115
  declare type SuiteState = RunMode | 'pass' | 'fail';
116
116
  declare type ComputeMode = 'serial' | 'concurrent';
117
- interface Test {
118
- type: 'test';
117
+ declare type TaskType = 'test' | 'suite';
118
+ interface Task {
119
+ type: TaskType;
119
120
  name: string;
120
121
  mode: RunMode;
121
122
  computeMode: ComputeMode;
122
123
  suite: Suite;
123
124
  file?: File;
124
- result?: TestResult;
125
+ result?: TaskResult;
126
+ }
127
+ interface Test extends Task {
128
+ type: 'test';
129
+ result?: TaskResult;
125
130
  }
126
- interface TestResult {
131
+ interface TaskResult {
127
132
  state: TestState;
128
133
  start: number;
129
134
  end?: number;
130
135
  error?: unknown;
131
136
  }
132
- declare type Task = Test | Suite;
133
137
  declare type TestFunction = () => Awaitable<void>;
134
138
  interface ConcurrentCollector {
135
139
  (name: string, fn: TestFunction): void;
@@ -163,14 +167,10 @@ interface SuiteHooks {
163
167
  beforeEach: HookListener<[Test, Suite]>[];
164
168
  afterEach: HookListener<[Test, Suite]>[];
165
169
  }
166
- interface Suite {
170
+ interface Suite extends Task {
167
171
  type: 'suite';
168
- name: string;
169
- mode: RunMode;
170
- computeMode: ComputeMode;
171
172
  tasks: Task[];
172
- file?: File;
173
- result?: TestResult;
173
+ result?: TaskResult;
174
174
  }
175
175
  interface SuiteCollector {
176
176
  readonly name: string;
@@ -210,4 +210,4 @@ interface Reporter {
210
210
  onWatcherRerun?: (files: string[], trigger: string, ctx: RunnerContext) => Awaitable<void>;
211
211
  }
212
212
 
213
- export { ComputeMode as C, File as F, GlobalContext as G, HookListener as H, ResolvedConfig as R, SuiteCollector as S, TestFactory as T, UserOptions as U, TestFunction as a, SuiteHooks as b, RunMode as c, TestState as d, SuiteState as e, Test as f, TestResult as g, Task as h, TestCollector as i, Suite as j, RunnerContext as k, Reporter as l };
213
+ export { ComputeMode as C, File as F, GlobalContext as G, HookListener as H, ResolvedConfig as R, SuiteCollector as S, TestFactory as T, UserOptions as U, TestFunction as a, SuiteHooks as b, RunMode as c, TestState as d, SuiteState as e, TaskType as f, Task as g, Test as h, TaskResult as i, TestCollector as j, Suite as k, RunnerContext as l, Reporter as m };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest",
3
- "version": "0.0.43",
3
+ "version": "0.0.47",
4
4
  "description": "A blazing fast unit test framework powered by Vite",
5
5
  "keywords": [
6
6
  "vite",
@@ -8,9 +8,6 @@
8
8
  "test",
9
9
  "jest"
10
10
  ],
11
- "engines": {
12
- "node": ">=16.0.0"
13
- },
14
11
  "homepage": "https://github.com/antfu/vitest#readme",
15
12
  "bugs": {
16
13
  "url": "https://github.com/antfu/vitest/issues"
@@ -42,59 +39,66 @@
42
39
  "*.d.ts"
43
40
  ],
44
41
  "scripts": {
45
- "prepare": "esmo scripts/generate-types.ts",
46
42
  "build": "tsup --dts --minify-whitespace --minify-syntax",
43
+ "coverage": "node bin/vitest.mjs -r test/core --coverage",
47
44
  "dev": "tsup --watch src",
48
45
  "lint": "eslint \"{src,test}/**/*.ts\"",
46
+ "prepare": "esmo scripts/generate-types.ts",
49
47
  "prepublishOnly": "nr build",
50
48
  "release": "bumpp --commit --push --tag && esmo scripts/publish.ts",
51
- "test:all": "pnpm -r --stream --filter !vitest run test --",
52
49
  "test": "node bin/vitest.mjs -r test/core",
53
- "coverage": "node bin/vitest.mjs -r test/core --coverage"
50
+ "test:all": "pnpm -r --stream --filter !vitest run test --"
54
51
  },
55
52
  "dependencies": {
56
53
  "@antfu/utils": "^0.3.0",
57
54
  "@jest/test-result": "^27.4.2",
58
- "@types/chai": "^4.2.22",
55
+ "@types/chai": "^4.3.0",
59
56
  "@types/sinon-chai": "^3.2.6",
60
57
  "c8": "^7.10.0",
61
58
  "chai": "^4.3.4",
62
59
  "chai-subset": "^1.6.0",
63
- "diff": "^5.0.0",
64
60
  "fast-glob": "^3.2.7",
61
+ "figures": "^4.0.0",
65
62
  "find-up": "^6.2.0",
66
- "happy-dom": "^2.24.4",
63
+ "happy-dom": "^2.24.5",
67
64
  "jest-snapshot": "^27.4.2",
68
65
  "jest-util": "^27.4.2",
69
66
  "jsdom": "^19.0.0",
70
- "listr": "^0.14.3",
71
67
  "picocolors": "^1.0.0",
72
68
  "sade": "^1.7.4",
73
69
  "sinon": "^12.0.1",
74
- "sinon-chai": "^3.7.0",
75
70
  "source-map": "^0.7.3",
76
71
  "source-map-support": "^0.5.21"
77
72
  },
78
- "peerDependencies": {
79
- "vite": "^2.7.1"
80
- },
81
73
  "devDependencies": {
82
74
  "@antfu/eslint-config": "^0.12.2",
83
- "@antfu/ni": "^0.11.0",
75
+ "@antfu/ni": "^0.11.1",
84
76
  "@types/chai-subset": "^1.3.3",
85
77
  "@types/diff": "^5.0.1",
86
78
  "@types/jsdom": "^16.2.13",
87
- "@types/listr": "^0.14.4",
88
79
  "@types/node": "^16.11.12",
89
80
  "@types/sade": "^1.7.3",
90
81
  "@types/sinon": "^10.0.6",
91
82
  "bumpp": "^7.1.1",
83
+ "cli-truncate": "^3.1.0",
84
+ "diff": "^5.0.0",
85
+ "elegant-spinner": "^3.0.0",
92
86
  "eslint": "^8.4.1",
93
87
  "esno": "^0.12.1",
88
+ "log-symbols": "^4.1.0",
89
+ "log-update": "^5.0.0",
94
90
  "npm-run-all": "^4.1.5",
95
91
  "rimraf": "^3.0.2",
92
+ "sinon-chai": "^3.7.0",
93
+ "strip-ansi": "^7.0.1",
96
94
  "tsup": "^5.10.3",
97
95
  "typescript": "^4.5.2",
98
96
  "vite": "^2.7.1"
97
+ },
98
+ "peerDependencies": {
99
+ "vite": "^2.7.1"
100
+ },
101
+ "engines": {
102
+ "node": ">=16.0.0"
99
103
  }
100
104
  }
@@ -1 +0,0 @@
1
- var __create=Object.create;var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__markAsModule=target=>__defProp(target,"__esModule",{value:!0});var __esm=(fn,res)=>function(){return fn&&(res=(0,fn[Object.keys(fn)[0]])(fn=0)),res};var __commonJS=(cb,mod)=>function(){return mod||(0,cb[Object.keys(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all)=>{__markAsModule(target);for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__reExport=(target,module,desc)=>{if(module&&typeof module=="object"||typeof module=="function")for(let key of __getOwnPropNames(module))!__hasOwnProp.call(target,key)&&key!=="default"&&__defProp(target,key,{get:()=>module[key],enumerable:!(desc=__getOwnPropDesc(module,key))||desc.enumerable});return target},__toModule=module=>__reExport(__markAsModule(__defProp(module!=null?__create(__getProtoOf(module)):{},"default",module&&module.__esModule&&"default"in module?{get:()=>module.default,enumerable:!0}:{value:module,enumerable:!0})),module);import{fileURLToPath}from"url";import path from"path";var __filename,__dirname,init_esm_shims=__esm({"node_modules/.pnpm/tsup@5.10.3_typescript@4.5.2/node_modules/tsup/assets/esm_shims.js"(){__filename=fileURLToPath(import.meta.url),__dirname=path.dirname(__filename)}});export{__spreadValues,__spreadProps,__commonJS,__export,__toModule,__filename,init_esm_shims};
@@ -1 +0,0 @@
1
- import{__filename,init_esm_shims}from"./chunk-6IXNQZKF.js";init_esm_shims();init_esm_shims();var context={tasks:[],currentSuite:null};process.__vitest__||(console.warn("[vitest] Runtime is running in non-Vite environment, there might be some issues with your setup..."),console.warn("cwd: ",process.cwd()),console.warn("path:",__filename));init_esm_shims();var fnMap=new WeakMap,hooksMap=new WeakMap;function setFn(key,fn){fnMap.set(key,fn)}function getFn(key){return fnMap.get(key)}function setHooks(key,hooks){hooksMap.set(key,hooks)}function getHooks(key){return hooksMap.get(key)}var suite=createSuite(),defaultSuite=suite("");function getCurrentSuite(){return context.currentSuite||defaultSuite}function createSuiteHooks(){return{beforeAll:[],afterAll:[],beforeEach:[],afterEach:[]}}function createSuiteCollector(name,factory=()=>{},mode,suiteComputeMode){var _a;let tasks=[],factoryQueue=[],suite2;initSuite();let test2=createTestCollector((name2,fn,mode2,computeMode)=>{let test3={type:"test",name:name2,mode:mode2,computeMode:computeMode??suiteComputeMode??"serial",suite:{}};setFn(test3,fn),tasks.push(test3)}),collector={type:"collector",name,mode,test:test2,tasks,collect,clear,on:addHook};function addHook(name2,...fn){getHooks(suite2)[name2].push(...fn)}function initSuite(){suite2={type:"suite",computeMode:"serial",name,mode,tasks:[]},setHooks(suite2,createSuiteHooks())}function clear(){tasks.length=0,factoryQueue.length=0,initSuite()}async function collect(file){if(factoryQueue.length=0,factory){let prev=context.currentSuite;context.currentSuite=collector,await factory(test2),context.currentSuite=prev}let allChildren=await Promise.all([...factoryQueue,...tasks].map(i=>i.type==="collector"?i.collect(file):i));return suite2.file=file,suite2.tasks=allChildren,allChildren.forEach(task=>{task.type==="test"&&(task.suite=suite2,file&&(task.file=file))}),suite2}return(_a=context.currentSuite)==null||_a.tasks.push(collector),collector}function createTestCollector(collectTest){function test2(name,fn){collectTest(name,fn,"run")}test2.concurrent=concurrent,test2.skip=skip,test2.only=only,test2.todo=todo;function concurrent(name,fn){collectTest(name,fn,"run","concurrent")}concurrent.skip=(name,fn)=>collectTest(name,fn,"skip","concurrent"),concurrent.only=(name,fn)=>collectTest(name,fn,"only","concurrent"),concurrent.todo=todo;function skip(name,fn){collectTest(name,fn,"skip")}skip.concurrent=concurrent.skip;function only(name,fn){collectTest(name,fn,"only")}only.concurrent=concurrent.only;function todo(name){collectTest(name,()=>{},"todo")}return todo.concurrent=todo,test2}var test=function(){function test2(name,fn){return getCurrentSuite().test(name,fn)}function concurrent(name,fn){return getCurrentSuite().test.concurrent(name,fn)}concurrent.skip=(name,fn)=>getCurrentSuite().test.concurrent.skip(name,fn),concurrent.only=(name,fn)=>getCurrentSuite().test.concurrent.only(name,fn),concurrent.todo=name=>getCurrentSuite().test.concurrent.todo(name);function skip(name,fn){return getCurrentSuite().test.skip(name,fn)}skip.concurrent=(name,fn)=>getCurrentSuite().test.skip.concurrent(name,fn);function only(name,fn){return getCurrentSuite().test.only(name,fn)}only.concurrent=(name,fn)=>getCurrentSuite().test.only.concurrent(name,fn);function todo(name){return getCurrentSuite().test.todo(name)}return todo.concurrent=name=>getCurrentSuite().test.todo.concurrent(name),test2.concurrent=concurrent,test2.skip=skip,test2.only=only,test2.todo=todo,test2}();function createSuite(){function suite2(suiteName,factory){return createSuiteCollector(suiteName,factory,"run")}function concurrent(suiteName,factory){return createSuiteCollector(suiteName,factory,"run","concurrent")}concurrent.skip=(suiteName,factory)=>createSuiteCollector(suiteName,factory,"skip","concurrent"),concurrent.only=(suiteName,factory)=>createSuiteCollector(suiteName,factory,"only","concurrent"),concurrent.todo=suiteName=>createSuiteCollector(suiteName,void 0,"todo");function skip(suiteName,factory){return createSuiteCollector(suiteName,factory,"skip")}skip.concurrent=concurrent.skip;function only(suiteName,factory){return createSuiteCollector(suiteName,factory,"only")}only.concurrent=concurrent.only;function todo(suiteName){return createSuiteCollector(suiteName,void 0,"todo")}return todo.concurrent=concurrent.todo,suite2.concurrent=concurrent,suite2.skip=skip,suite2.only=only,suite2.todo=todo,suite2}var describe=suite,it=test,beforeAll=fn=>getCurrentSuite().on("beforeAll",fn),afterAll=fn=>getCurrentSuite().on("afterAll",fn),beforeEach=fn=>getCurrentSuite().on("beforeEach",fn),afterEach=fn=>getCurrentSuite().on("afterEach",fn);function clearContext(){context.tasks.length=0,defaultSuite.clear(),context.currentSuite=defaultSuite}export{context,getFn,setHooks,getHooks,suite,defaultSuite,createSuiteHooks,test,describe,it,beforeAll,afterAll,beforeEach,afterEach,clearContext};
@@ -1 +0,0 @@
1
- import{src_exports}from"./chunk-MTU4HR6S.js";import"./chunk-AQN47UC5.js";import{globalApis}from"./chunk-HKVZR3WA.js";import{init_esm_shims}from"./chunk-6IXNQZKF.js";init_esm_shims();function registerApiGlobally(){globalApis.forEach(api=>{globalThis[api]=src_exports[api]})}export{registerApiGlobally};