From 79249d5f2c2464c675fd48bb5b628bcea222ab1d Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 8 May 2024 16:38:20 -0700 Subject: [PATCH] deps(rollup): Update to v4.17. --- packages/packemon/package.json | 4 +- .../tests/__snapshots__/outputs.test.ts.snap | 180 +++++++++++------- yarn.lock | 14 +- 3 files changed, 115 insertions(+), 83 deletions(-) diff --git a/packages/packemon/package.json b/packages/packemon/package.json index ae4451cb..01f30ecc 100644 --- a/packages/packemon/package.json +++ b/packages/packemon/package.json @@ -86,11 +86,11 @@ "ink": "^4.4.1", "ink-progress-bar": "^3.0.0", "ink-spinner": "^5.0.0", - "magic-string": "^0.30.7", + "magic-string": "^0.30.10", "micromatch": "^4.0.5", "react": "^18.2.0", "resolve": "^1.22.8", - "rollup": "^4.12.0", + "rollup": "^4.17.2", "rollup-plugin-node-externals": "^7.1.2", "rollup-plugin-polyfill-node": "^0.13.0", "semver": "^7.6.0", diff --git a/packages/packemon/tests/__snapshots__/outputs.test.ts.snap b/packages/packemon/tests/__snapshots__/outputs.test.ts.snap index 335c6565..d2c17a73 100644 --- a/packages/packemon/tests/__snapshots__/outputs.test.ts.snap +++ b/packages/packemon/tests/__snapshots__/outputs.test.ts.snap @@ -304,7 +304,7 @@ export { createClient }; " `; -exports[`Outputs (babel) > artifacts > builds all the artifacts with rollup > lib/bundle-D12lh4FL.js 1`] = ` +exports[`Outputs (babel) > artifacts > builds all the artifacts with rollup > lib/bundle-D7lcxiVj.js 1`] = ` "// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib @@ -658,9 +658,12 @@ class Mappings { } addEdit(sourceIndex, content, loc, nameIndex) { if (content.length) { + const contentLengthMinusOne = content.length - 1; let contentLineEnd = content.indexOf('\\n', 0); let previousContentLineEnd = -1; - while (contentLineEnd >= 0) { + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; if (nameIndex >= 0) { segment.push(nameIndex); @@ -1349,11 +1352,21 @@ class MagicString { if (searchValue.global) { const matches = matchAll(searchValue, this.original); matches.forEach(match => { - if (match.index != null) this.overwrite(match.index, match.index + match[0].length, getReplacement(match, this.original)); + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite(match.index, match.index + match[0].length, replacement); + } + } }); } else { const match = this.original.match(searchValue); - if (match && match.index != null) this.overwrite(match.index, match.index + match[0].length, getReplacement(match, this.original)); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite(match.index, match.index + match[0].length, replacement); + } + } } return this; } @@ -1375,7 +1388,8 @@ class MagicString { const original = this.original; const stringLength = string.length; for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) { - this.overwrite(index, index + stringLength, replacement); + const previous = original.slice(index, index + stringLength); + if (previous !== replacement) this.overwrite(index, index + stringLength, replacement); } return this; } @@ -1391,7 +1405,7 @@ class MagicString { } exports.SourceMap = SourceMap; exports.default = MagicString; -//# sourceMappingURL=bundle-D12lh4FL.js.map +//# sourceMappingURL=bundle-D7lcxiVj.js.map " `; @@ -1452,7 +1466,7 @@ exports.EXAMPLE = EXAMPLE; exports[`Outputs (babel) > artifacts > builds all the artifacts with rollup > lib/test.js 1`] = ` "// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib -'use strict';const _excluded=["maxLength"],_excluded2=["value"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key];}return target;}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;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;if(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){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);icollector.add(key);Object.getOwnPropertyNames(obj).forEach(collect);Object.getOwnPropertySymbols(obj).forEach(collect);}function getOwnProperties(obj){const ownProps=/* @__PURE__ */new Set();if(isFinalObj(obj))return[];collectOwnProperties(obj,ownProps);return Array.from(ownProps);}const defaultCloneOptions={forceWritable:false};function deepClone(val,options=defaultCloneOptions){const seen=/* @__PURE__ */new WeakMap();return clone(val,seen,options);}function clone(val,seen,options=defaultCloneOptions){let k,out;if(seen.has(val))return seen.get(val);if(Array.isArray(val)){out=Array(k=val.length);seen.set(val,out);while(k--)out[k]=clone(val[k],seen,options);return out;}if(Object.prototype.toString.call(val)==="[object Object]"){out=Object.create(Object.getPrototypeOf(val));seen.set(val,out);const props=getOwnProperties(val);for(const k2 of props){const descriptor=Object.getOwnPropertyDescriptor(val,k2);if(!descriptor)continue;const cloned=clone(val[k2],seen,options);if("get"in descriptor){Object.defineProperty(out,k2,_objectSpread(_objectSpread({},descriptor),{},{get(){return cloned;}}));}else{Object.defineProperty(out,k2,_objectSpread(_objectSpread({},descriptor),{},{writable:options.forceWritable?true:descriptor.writable,value:cloned}));}}return out;}return val;}function objectAttr(source,path,defaultValue=void 0){const paths=path.replace(/\\[(\\d+)\\]/g,".$1").split(".");let result=source;for(const p of paths){result=Object(result)[p];if(result===void 0)return defaultValue;}return result;}function createDefer(){let resolve=null;let reject=null;const p=new Promise((_resolve,_reject)=>{resolve=_resolve;reject=_reject;});p.resolve=resolve;p.reject=reject;return p;}var commonjsGlobal$1=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs$2(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}function getAugmentedNamespace(n){if(n.__esModule)return n;var f=n.default;if(typeof f=="function"){var a=function a(){if(this instanceof a){return Reflect.construct(f,arguments,this.constructor);}return f.apply(this,arguments);};a.prototype=f.prototype;}else a={};Object.defineProperty(a,'__esModule',{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){return n[k];}});});return a;}var build$1={};var ansiStyles={exports:{}};ansiStyles.exports;(function(module){const ANSI_BACKGROUND_OFFSET=10;const wrapAnsi256=(offset=0)=>code=>\`\\u001B[\${38+offset};5;\${code}m\`;const wrapAnsi16m=(offset=0)=>(red,green,blue)=>\`\\u001B[\${38+offset};2;\${red};\${green};\${blue}m\`;function assembleStyles(){const codes=new Map();const styles={modifier:{reset:[0,0],// 21 isn't widely supported and 22 does the same thing +'use strict';const _excluded=["maxLength"],_excluded2=["value"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key];}return target;}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;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;if(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){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);icollector.add(key);Object.getOwnPropertyNames(obj).forEach(collect);Object.getOwnPropertySymbols(obj).forEach(collect);}function getOwnProperties(obj){const ownProps=/* @__PURE__ */new Set();if(isFinalObj(obj))return[];collectOwnProperties(obj,ownProps);return Array.from(ownProps);}const defaultCloneOptions={forceWritable:false};function deepClone(val,options=defaultCloneOptions){const seen=/* @__PURE__ */new WeakMap();return clone(val,seen,options);}function clone(val,seen,options=defaultCloneOptions){let k,out;if(seen.has(val))return seen.get(val);if(Array.isArray(val)){out=Array(k=val.length);seen.set(val,out);while(k--)out[k]=clone(val[k],seen,options);return out;}if(Object.prototype.toString.call(val)==="[object Object]"){out=Object.create(Object.getPrototypeOf(val));seen.set(val,out);const props=getOwnProperties(val);for(const k2 of props){const descriptor=Object.getOwnPropertyDescriptor(val,k2);if(!descriptor)continue;const cloned=clone(val[k2],seen,options);if(options.forceWritable){Object.defineProperty(out,k2,{enumerable:descriptor.enumerable,configurable:true,writable:true,value:cloned});}else if("get"in descriptor){Object.defineProperty(out,k2,_objectSpread(_objectSpread({},descriptor),{},{get(){return cloned;}}));}else{Object.defineProperty(out,k2,_objectSpread(_objectSpread({},descriptor),{},{value:cloned}));}}return out;}return val;}function objectAttr(source,path,defaultValue=void 0){const paths=path.replace(/\\[(\\d+)\\]/g,".$1").split(".");let result=source;for(const p of paths){result=Object(result)[p];if(result===void 0)return defaultValue;}return result;}function createDefer(){let resolve=null;let reject=null;const p=new Promise((_resolve,_reject)=>{resolve=_resolve;reject=_reject;});p.resolve=resolve;p.reject=reject;return p;}var commonjsGlobal$1=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs$2(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}function getAugmentedNamespace(n){if(n.__esModule)return n;var f=n.default;if(typeof f=="function"){var a=function a(){if(this instanceof a){return Reflect.construct(f,arguments,this.constructor);}return f.apply(this,arguments);};a.prototype=f.prototype;}else a={};Object.defineProperty(a,'__esModule',{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){return n[k];}});});return a;}var build$1={};var ansiStyles={exports:{}};ansiStyles.exports;(function(module){const ANSI_BACKGROUND_OFFSET=10;const wrapAnsi256=(offset=0)=>code=>\`\\u001B[\${38+offset};5;\${code}m\`;const wrapAnsi16m=(offset=0)=>(red,green,blue)=>\`\\u001B[\${38+offset};2;\${red};\${green};\${blue}m\`;function assembleStyles(){const codes=new Map();const styles={modifier:{reset:[0,0],// 21 isn't widely supported and 22 does the same thing 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],// Bright color 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],// Bright color bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};// Alias bright black as gray (and grey) @@ -1678,7 +1692,7 @@ if(value===Object(value)){return inspectObject$1(value,options);}// We have run return options.stylize(String(value),type);}function registerConstructor(constructor,inspector){if(constructorMap.has(constructor)){return false;}constructorMap.set(constructor,inspector);return true;}function registerStringTag(stringTag,inspector){if(stringTag in stringTagMap){return false;}stringTagMap[stringTag]=inspector;return true;}const custom=chaiInspect;const loupe$1=/*#__PURE__*/Object.freeze({__proto__:null,custom,default:inspect$4,inspect:inspect$4,registerConstructor,registerStringTag});const _plugins_=plugins_1,AsymmetricMatcher$3=_plugins_.AsymmetricMatcher,DOMCollection$2=_plugins_.DOMCollection,DOMElement$2=_plugins_.DOMElement,Immutable$2=_plugins_.Immutable,ReactElement$2=_plugins_.ReactElement,ReactTestComponent$2=_plugins_.ReactTestComponent;const PLUGINS$2=[ReactTestComponent$2,ReactElement$2,DOMElement$2,DOMCollection$2,Immutable$2,AsymmetricMatcher$3];function stringify(object,maxDepth=10,_ref5={}){let maxLength=_ref5.maxLength,options=_objectWithoutProperties(_ref5,_excluded);const MAX_LENGTH=maxLength??1e4;let result;try{result=format_1(object,_objectSpread({maxDepth,escapeString:false,// min: true, plugins:PLUGINS$2},options));}catch{result=format_1(object,_objectSpread({callToJSON:false,maxDepth,escapeString:false,// min: true, plugins:PLUGINS$2},options));}return result.length>=MAX_LENGTH&&maxDepth>1?stringify(object,Math.floor(maxDepth/2)):result;}const formatRegExp=/%[sdjifoOcj%]/g;function format(...args){if(typeof args[0]!=="string"){const objects=[];for(let i2=0;i2{if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":{const value=args[i++];if(typeof value==="bigint")return\`\${value.toString()}n\`;if(typeof value==="number"&&value===0&&1/value<0)return"-0";if(typeof value==="object"&&value!==null)return inspect$3(value,{depth:0,colors:false,compact:3});return String(value);}case"%d":{const value=args[i++];if(typeof value==="bigint")return\`\${value.toString()}n\`;return Number(value).toString();}case"%i":{const value=args[i++];if(typeof value==="bigint")return\`\${value.toString()}n\`;return Number.parseInt(String(value)).toString();}case"%f":return Number.parseFloat(String(args[i++])).toString();case"%o":return inspect$3(args[i++],{showHidden:true,showProxy:true});case"%O":return inspect$3(args[i++]);case"%c":{i++;return"";}case"%j":try{return JSON.stringify(args[i++]);}catch(err){const m=err.message;if(// chromium -m.includes("circular structure")||m.includes("cyclic structures")||m.includes("cyclic object"))return"[Circular]";throw err;}default:return x;}});for(let x=args[i];i=options.truncate){if(type==="[object Function]"){const fn=obj;return!fn.name||fn.name===""?"[Function]":\`[Function: \${fn.name}]\`;}else if(type==="[object Array]"){return\`[ Array(\${obj.length}) ]\`;}else if(type==="[object Object]"){const keys=Object.keys(obj);const kstr=keys.length>2?\`\${keys.splice(0,2).join(", ")}, ...\`:keys.join(", ");return\`{ Object (\${kstr}) }\`;}else{return str;}}return str;}const SAFE_TIMERS_SYMBOL=Symbol("vitest:SAFE_TIMERS");const SAFE_COLORS_SYMBOL=Symbol("vitest:SAFE_COLORS");const colorsMap={bold:["\\x1B[1m","\\x1B[22m","\\x1B[22m\\x1B[1m"],dim:["\\x1B[2m","\\x1B[22m","\\x1B[22m\\x1B[2m"],italic:["\\x1B[3m","\\x1B[23m"],underline:["\\x1B[4m","\\x1B[24m"],inverse:["\\x1B[7m","\\x1B[27m"],hidden:["\\x1B[8m","\\x1B[28m"],strikethrough:["\\x1B[9m","\\x1B[29m"],black:["\\x1B[30m","\\x1B[39m"],red:["\\x1B[31m","\\x1B[39m"],green:["\\x1B[32m","\\x1B[39m"],yellow:["\\x1B[33m","\\x1B[39m"],blue:["\\x1B[34m","\\x1B[39m"],magenta:["\\x1B[35m","\\x1B[39m"],cyan:["\\x1B[36m","\\x1B[39m"],white:["\\x1B[37m","\\x1B[39m"],gray:["\\x1B[90m","\\x1B[39m"],bgBlack:["\\x1B[40m","\\x1B[49m"],bgRed:["\\x1B[41m","\\x1B[49m"],bgGreen:["\\x1B[42m","\\x1B[49m"],bgYellow:["\\x1B[43m","\\x1B[49m"],bgBlue:["\\x1B[44m","\\x1B[49m"],bgMagenta:["\\x1B[45m","\\x1B[49m"],bgCyan:["\\x1B[46m","\\x1B[49m"],bgWhite:["\\x1B[47m","\\x1B[49m"]};const colorsEntries=Object.entries(colorsMap);function string$1(str){return String(str);}string$1.open="";string$1.close="";const defaultColors=/* @__PURE__ */colorsEntries.reduce((acc,[key])=>{acc[key]=string$1;return acc;},{isColorSupported:false});function getColors(){return globalThis[SAFE_COLORS_SYMBOL]||defaultColors;}function getSafeTimers(){const _ref6=globalThis[SAFE_TIMERS_SYMBOL]||globalThis,safeSetTimeout=_ref6.setTimeout,safeSetInterval=_ref6.setInterval,safeClearInterval=_ref6.clearInterval,safeClearTimeout=_ref6.clearTimeout,safeSetImmediate=_ref6.setImmediate,safeClearImmediate=_ref6.clearImmediate;const _ref7=globalThis[SAFE_TIMERS_SYMBOL]||globalThis.process||{nextTick:cb=>cb()},safeNextTick=_ref7.nextTick;return{nextTick:safeNextTick,setTimeout:safeSetTimeout,setInterval:safeSetInterval,clearInterval:safeClearInterval,clearTimeout:safeClearTimeout,setImmediate:safeSetImmediate,clearImmediate:safeClearImmediate};}function createSimpleStackTrace(options){const _ref8=options||{},_ref8$message=_ref8.message,message=_ref8$message===void 0?"error":_ref8$message,_ref8$stackTraceLimit=_ref8.stackTraceLimit,stackTraceLimit=_ref8$stackTraceLimit===void 0?1:_ref8$stackTraceLimit;const limit=Error.stackTraceLimit;const prepareStackTrace=Error.prepareStackTrace;Error.stackTraceLimit=stackTraceLimit;Error.prepareStackTrace=e=>e.stack;const err=new Error(message);const stackTrace=err.stack||"";Error.prepareStackTrace=prepareStackTrace;Error.stackTraceLimit=limit;return stackTrace;}// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell +m.includes("circular structure")||m.includes("cyclic structures")||m.includes("cyclic object"))return"[Circular]";throw err;}default:return x;}});for(let x=args[i];i=options.truncate){if(type==="[object Function]"){const fn=obj;return!fn.name?"[Function]":\`[Function: \${fn.name}]\`;}else if(type==="[object Array]"){return\`[ Array(\${obj.length}) ]\`;}else if(type==="[object Object]"){const keys=Object.keys(obj);const kstr=keys.length>2?\`\${keys.splice(0,2).join(", ")}, ...\`:keys.join(", ");return\`{ Object (\${kstr}) }\`;}else{return str;}}return str;}const SAFE_TIMERS_SYMBOL=Symbol("vitest:SAFE_TIMERS");const SAFE_COLORS_SYMBOL=Symbol("vitest:SAFE_COLORS");const colorsMap={bold:["\\x1B[1m","\\x1B[22m","\\x1B[22m\\x1B[1m"],dim:["\\x1B[2m","\\x1B[22m","\\x1B[22m\\x1B[2m"],italic:["\\x1B[3m","\\x1B[23m"],underline:["\\x1B[4m","\\x1B[24m"],inverse:["\\x1B[7m","\\x1B[27m"],hidden:["\\x1B[8m","\\x1B[28m"],strikethrough:["\\x1B[9m","\\x1B[29m"],black:["\\x1B[30m","\\x1B[39m"],red:["\\x1B[31m","\\x1B[39m"],green:["\\x1B[32m","\\x1B[39m"],yellow:["\\x1B[33m","\\x1B[39m"],blue:["\\x1B[34m","\\x1B[39m"],magenta:["\\x1B[35m","\\x1B[39m"],cyan:["\\x1B[36m","\\x1B[39m"],white:["\\x1B[37m","\\x1B[39m"],gray:["\\x1B[90m","\\x1B[39m"],bgBlack:["\\x1B[40m","\\x1B[49m"],bgRed:["\\x1B[41m","\\x1B[49m"],bgGreen:["\\x1B[42m","\\x1B[49m"],bgYellow:["\\x1B[43m","\\x1B[49m"],bgBlue:["\\x1B[44m","\\x1B[49m"],bgMagenta:["\\x1B[45m","\\x1B[49m"],bgCyan:["\\x1B[46m","\\x1B[49m"],bgWhite:["\\x1B[47m","\\x1B[49m"]};const colorsEntries=Object.entries(colorsMap);function string$1(str){return String(str);}string$1.open="";string$1.close="";const defaultColors=/* @__PURE__ */colorsEntries.reduce((acc,[key])=>{acc[key]=string$1;return acc;},{isColorSupported:false});function getColors(){return globalThis[SAFE_COLORS_SYMBOL]||defaultColors;}function getSafeTimers(){const _ref6=globalThis[SAFE_TIMERS_SYMBOL]||globalThis,safeSetTimeout=_ref6.setTimeout,safeSetInterval=_ref6.setInterval,safeClearInterval=_ref6.clearInterval,safeClearTimeout=_ref6.clearTimeout,safeSetImmediate=_ref6.setImmediate,safeClearImmediate=_ref6.clearImmediate;const _ref7=globalThis[SAFE_TIMERS_SYMBOL]||globalThis.process||{nextTick:cb=>cb()},safeNextTick=_ref7.nextTick;return{nextTick:safeNextTick,setTimeout:safeSetTimeout,setInterval:safeSetInterval,clearInterval:safeClearInterval,clearTimeout:safeClearTimeout,setImmediate:safeSetImmediate,clearImmediate:safeClearImmediate};}function createSimpleStackTrace(options){const _ref8=options||{},_ref8$message=_ref8.message,message=_ref8$message===void 0?"error":_ref8$message,_ref8$stackTraceLimit=_ref8.stackTraceLimit,stackTraceLimit=_ref8$stackTraceLimit===void 0?1:_ref8$stackTraceLimit;const limit=Error.stackTraceLimit;const prepareStackTrace=Error.prepareStackTrace;Error.stackTraceLimit=stackTraceLimit;Error.prepareStackTrace=e=>e.stack;const err=new Error(message);const stackTrace=err.stack||"";Error.prepareStackTrace=prepareStackTrace;Error.stackTraceLimit=limit;return stackTrace;}// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell // License: MIT. var LineTerminatorSequence$1;LineTerminatorSequence$1=/\\r?\\n|[\\r\\u2028\\u2029]/y;RegExp(LineTerminatorSequence$1.source);// src/index.ts var reservedWords$1={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(reservedWords$1.keyword);new Set(reservedWords$1.strict);var build={};Object.defineProperty(build,'__esModule',{value:true});var _default=build.default=diffSequence;/** @@ -1920,18 +1934,21 @@ const callbacks=[{foundSubsequence,isCommon}];// Indexes in sequence a of last p const aIndexesF=[NOT_YET_SET];// from the end at bottom right in the reverse direction: const aIndexesR=[NOT_YET_SET];// Initialize one object as output of all calls to divide function. const division={aCommonFollowing:NOT_YET_SET,aCommonPreceding:NOT_YET_SET,aEndPreceding:NOT_YET_SET,aStartFollowing:NOT_YET_SET,bCommonFollowing:NOT_YET_SET,bCommonPreceding:NOT_YET_SET,bEndPreceding:NOT_YET_SET,bStartFollowing:NOT_YET_SET,nChangeFollowing:NOT_YET_SET,nChangePreceding:NOT_YET_SET,nCommonFollowing:NOT_YET_SET,nCommonPreceding:NOT_YET_SET};// Find and return common subsequences in the trimmed index intervals. -findSubsequences(nChange,aStart,aEnd,bStart,bEnd,transposed,callbacks,aIndexesF,aIndexesR,division);}if(nCommonR!==0){foundSubsequence(nCommonR,aEnd,bEnd);}}}function getType(value){if(value===void 0){return"undefined";}else if(value===null){return"null";}else if(Array.isArray(value)){return"array";}else if(typeof value==="boolean"){return"boolean";}else if(typeof value==="function"){return"function";}else if(typeof value==="number"){return"number";}else if(typeof value==="string"){return"string";}else if(typeof value==="bigint"){return"bigint";}else if(typeof value==="object"){if(value!=null){if(value.constructor===RegExp)return"regexp";else if(value.constructor===Map)return"map";else if(value.constructor===Set)return"set";else if(value.constructor===Date)return"date";}return"object";}else if(typeof value==="symbol"){return"symbol";}throw new Error(\`value of unknown type: \${value}\`);}const DIFF_DELETE=-1;const DIFF_INSERT=1;const DIFF_EQUAL=0;class Diff{0;1;constructor(op,text){this[0]=op;this[1]=text;}}const NO_DIFF_MESSAGE="Compared values have no visual difference.";const SIMILAR_MESSAGE="Compared values serialize to the same structure.\\nPrinting internal object structure without calling \`toJSON\` instead.";function formatTrailingSpaces(line,trailingSpaceFormatter){return line.replace(/\\s+$/,match=>trailingSpaceFormatter(match));}function printDiffLine(line,isFirstOrLast,color,indicator,trailingSpaceFormatter,emptyFirstOrLastLinePlaceholder){return line.length!==0?color(\`\${indicator} \${formatTrailingSpaces(line,trailingSpaceFormatter)}\`):indicator!==" "?color(indicator):isFirstOrLast&&emptyFirstOrLastLinePlaceholder.length!==0?color(\`\${indicator} \${emptyFirstOrLastLinePlaceholder}\`):"";}function printDeleteLine(line,isFirstOrLast,{aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function printInsertLine(line,isFirstOrLast,{bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function printCommonLine(line,isFirstOrLast,{commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function createPatchMark(aStart,aEnd,bStart,bEnd,{patchColor}){return patchColor(\`@@ -\${aStart+1},\${aEnd-aStart} +\${bStart+1},\${bEnd-bStart} @@\`);}function joinAlignedDiffsNoExpand(diffs,options){const iLength=diffs.length;const nContextLines=options.contextLines;const nContextLines2=nContextLines+nContextLines;let jLength=iLength;let hasExcessAtStartOrEnd=false;let nExcessesBetweenChanges=0;let i=0;while(i!==iLength){const iStart=i;while(i!==iLength&&diffs[i][0]===DIFF_EQUAL)i+=1;if(iStart!==i){if(iStart===0){if(i>nContextLines){jLength-=i-nContextLines;hasExcessAtStartOrEnd=true;}}else if(i===iLength){const n=i-iStart;if(n>nContextLines){jLength-=n-nContextLines;hasExcessAtStartOrEnd=true;}}else{const n=i-iStart;if(n>nContextLines2){jLength-=n-nContextLines2;nExcessesBetweenChanges+=1;}}}while(i!==iLength&&diffs[i][0]!==DIFF_EQUAL)i+=1;}const hasPatch=nExcessesBetweenChanges!==0||hasExcessAtStartOrEnd;if(nExcessesBetweenChanges!==0)jLength+=nExcessesBetweenChanges+1;else if(hasExcessAtStartOrEnd)jLength+=1;const jLast=jLength-1;const lines=[];let jPatchMark=0;if(hasPatch)lines.push("");let aStart=0;let bStart=0;let aEnd=0;let bEnd=0;const pushCommonLine=line=>{const j=lines.length;lines.push(printCommonLine(line,j===0||j===jLast,options));aEnd+=1;bEnd+=1;};const pushDeleteLine=line=>{const j=lines.length;lines.push(printDeleteLine(line,j===0||j===jLast,options));aEnd+=1;};const pushInsertLine=line=>{const j=lines.length;lines.push(printInsertLine(line,j===0||j===jLast,options));bEnd+=1;};i=0;while(i!==iLength){let iStart=i;while(i!==iLength&&diffs[i][0]===DIFF_EQUAL)i+=1;if(iStart!==i){if(iStart===0){if(i>nContextLines){iStart=i-nContextLines;aStart=iStart;bStart=iStart;aEnd=aStart;bEnd=bStart;}for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else if(i===iLength){const iEnd=i-iStart>nContextLines?iStart+nContextLines:i;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else{const nCommon=i-iStart;if(nCommon>nContextLines2){const iEnd=iStart+nContextLines;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options);jPatchMark=lines.length;lines.push("");const nOmit=nCommon-nContextLines2;aStart=aEnd+nOmit;bStart=bEnd+nOmit;aEnd=aStart;bEnd=bStart;for(let iCommon=i-nContextLines;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else{for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}}}while(i!==iLength&&diffs[i][0]===DIFF_DELETE){pushDeleteLine(diffs[i][1]);i+=1;}while(i!==iLength&&diffs[i][0]===DIFF_INSERT){pushInsertLine(diffs[i][1]);i+=1;}}if(hasPatch)lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options);return lines.join("\\n");}function joinAlignedDiffsExpand(diffs,options){return diffs.map((diff,i,diffs2)=>{const line=diff[1];const isFirstOrLast=i===0||i===diffs2.length-1;switch(diff[0]){case DIFF_DELETE:return printDeleteLine(line,isFirstOrLast,options);case DIFF_INSERT:return printInsertLine(line,isFirstOrLast,options);default:return printCommonLine(line,isFirstOrLast,options);}}).join("\\n");}const noColor=string=>string;const DIFF_CONTEXT_DEFAULT=5;function getDefaultOptions(){const c=getColors();return{aAnnotation:"Expected",aColor:c.green,aIndicator:"-",bAnnotation:"Received",bColor:c.red,bIndicator:"+",changeColor:c.inverse,changeLineTrailingSpaceColor:noColor,commonColor:c.dim,commonIndicator:" ",commonLineTrailingSpaceColor:noColor,compareKeys:void 0,contextLines:DIFF_CONTEXT_DEFAULT,emptyFirstOrLastLinePlaceholder:"",expand:true,includeChangeCounts:false,omitAnnotationLines:false,patchColor:c.yellow};}function getCompareKeys(compareKeys){return compareKeys&&typeof compareKeys==="function"?compareKeys:void 0;}function getContextLines(contextLines){return typeof contextLines==="number"&&Number.isSafeInteger(contextLines)&&contextLines>=0?contextLines:DIFF_CONTEXT_DEFAULT;}function normalizeDiffOptions(options={}){return _objectSpread(_objectSpread(_objectSpread({},getDefaultOptions()),options),{},{compareKeys:getCompareKeys(options.compareKeys),contextLines:getContextLines(options.contextLines)});}function isEmptyString(lines){return lines.length===1&&lines[0].length===0;}function countChanges(diffs){let a=0;let b=0;diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:a+=1;break;case DIFF_INSERT:b+=1;break;}});return{a,b};}function printAnnotation({aAnnotation,aColor,aIndicator,bAnnotation,bColor,bIndicator,includeChangeCounts,omitAnnotationLines},changeCounts){if(omitAnnotationLines)return"";let aRest="";let bRest="";if(includeChangeCounts){const aCount=String(changeCounts.a);const bCount=String(changeCounts.b);const baAnnotationLengthDiff=bAnnotation.length-aAnnotation.length;const aAnnotationPadding=" ".repeat(Math.max(0,baAnnotationLengthDiff));const bAnnotationPadding=" ".repeat(Math.max(0,-baAnnotationLengthDiff));const baCountLengthDiff=bCount.length-aCount.length;const aCountPadding=" ".repeat(Math.max(0,baCountLengthDiff));const bCountPadding=" ".repeat(Math.max(0,-baCountLengthDiff));aRest=\`\${aAnnotationPadding} \${aIndicator} \${aCountPadding}\${aCount}\`;bRest=\`\${bAnnotationPadding} \${bIndicator} \${bCountPadding}\${bCount}\`;}const a=\`\${aIndicator} \${aAnnotation}\${aRest}\`;const b=\`\${bIndicator} \${bAnnotation}\${bRest}\`;return\`\${aColor(a)} +findSubsequences(nChange,aStart,aEnd,bStart,bEnd,transposed,callbacks,aIndexesF,aIndexesR,division);}if(nCommonR!==0){foundSubsequence(nCommonR,aEnd,bEnd);}}}function getType(value){if(value===void 0){return"undefined";}else if(value===null){return"null";}else if(Array.isArray(value)){return"array";}else if(typeof value==="boolean"){return"boolean";}else if(typeof value==="function"){return"function";}else if(typeof value==="number"){return"number";}else if(typeof value==="string"){return"string";}else if(typeof value==="bigint"){return"bigint";}else if(typeof value==="object"){if(value!=null){if(value.constructor===RegExp)return"regexp";else if(value.constructor===Map)return"map";else if(value.constructor===Set)return"set";else if(value.constructor===Date)return"date";}return"object";}else if(typeof value==="symbol"){return"symbol";}throw new Error(\`value of unknown type: \${value}\`);}const DIFF_DELETE=-1;const DIFF_INSERT=1;const DIFF_EQUAL=0;class Diff{0;1;constructor(op,text){this[0]=op;this[1]=text;}}const NO_DIFF_MESSAGE="Compared values have no visual difference.";const SIMILAR_MESSAGE="Compared values serialize to the same structure.\\nPrinting internal object structure without calling \`toJSON\` instead.";function formatTrailingSpaces(line,trailingSpaceFormatter){return line.replace(/\\s+$/,match=>trailingSpaceFormatter(match));}function printDiffLine(line,isFirstOrLast,color,indicator,trailingSpaceFormatter,emptyFirstOrLastLinePlaceholder){return line.length!==0?color(\`\${indicator} \${formatTrailingSpaces(line,trailingSpaceFormatter)}\`):indicator!==" "?color(indicator):isFirstOrLast&&emptyFirstOrLastLinePlaceholder.length!==0?color(\`\${indicator} \${emptyFirstOrLastLinePlaceholder}\`):"";}function printDeleteLine(line,isFirstOrLast,{aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function printInsertLine(line,isFirstOrLast,{bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function printCommonLine(line,isFirstOrLast,{commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function createPatchMark(aStart,aEnd,bStart,bEnd,{patchColor}){return patchColor(\`@@ -\${aStart+1},\${aEnd-aStart} +\${bStart+1},\${bEnd-bStart} @@\`);}function joinAlignedDiffsNoExpand(diffs,options){const iLength=diffs.length;const nContextLines=options.contextLines;const nContextLines2=nContextLines+nContextLines;let jLength=iLength;let hasExcessAtStartOrEnd=false;let nExcessesBetweenChanges=0;let i=0;while(i!==iLength){const iStart=i;while(i!==iLength&&diffs[i][0]===DIFF_EQUAL)i+=1;if(iStart!==i){if(iStart===0){if(i>nContextLines){jLength-=i-nContextLines;hasExcessAtStartOrEnd=true;}}else if(i===iLength){const n=i-iStart;if(n>nContextLines){jLength-=n-nContextLines;hasExcessAtStartOrEnd=true;}}else{const n=i-iStart;if(n>nContextLines2){jLength-=n-nContextLines2;nExcessesBetweenChanges+=1;}}}while(i!==iLength&&diffs[i][0]!==DIFF_EQUAL)i+=1;}const hasPatch=nExcessesBetweenChanges!==0||hasExcessAtStartOrEnd;if(nExcessesBetweenChanges!==0)jLength+=nExcessesBetweenChanges+1;else if(hasExcessAtStartOrEnd)jLength+=1;const jLast=jLength-1;const lines=[];let jPatchMark=0;if(hasPatch)lines.push("");let aStart=0;let bStart=0;let aEnd=0;let bEnd=0;const pushCommonLine=line=>{const j=lines.length;lines.push(printCommonLine(line,j===0||j===jLast,options));aEnd+=1;bEnd+=1;};const pushDeleteLine=line=>{const j=lines.length;lines.push(printDeleteLine(line,j===0||j===jLast,options));aEnd+=1;};const pushInsertLine=line=>{const j=lines.length;lines.push(printInsertLine(line,j===0||j===jLast,options));bEnd+=1;};i=0;while(i!==iLength){let iStart=i;while(i!==iLength&&diffs[i][0]===DIFF_EQUAL)i+=1;if(iStart!==i){if(iStart===0){if(i>nContextLines){iStart=i-nContextLines;aStart=iStart;bStart=iStart;aEnd=aStart;bEnd=bStart;}for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else if(i===iLength){const iEnd=i-iStart>nContextLines?iStart+nContextLines:i;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else{const nCommon=i-iStart;if(nCommon>nContextLines2){const iEnd=iStart+nContextLines;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options);jPatchMark=lines.length;lines.push("");const nOmit=nCommon-nContextLines2;aStart=aEnd+nOmit;bStart=bEnd+nOmit;aEnd=aStart;bEnd=bStart;for(let iCommon=i-nContextLines;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else{for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}}}while(i!==iLength&&diffs[i][0]===DIFF_DELETE){pushDeleteLine(diffs[i][1]);i+=1;}while(i!==iLength&&diffs[i][0]===DIFF_INSERT){pushInsertLine(diffs[i][1]);i+=1;}}if(hasPatch)lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options);return lines.join("\\n");}function joinAlignedDiffsExpand(diffs,options){return diffs.map((diff,i,diffs2)=>{const line=diff[1];const isFirstOrLast=i===0||i===diffs2.length-1;switch(diff[0]){case DIFF_DELETE:return printDeleteLine(line,isFirstOrLast,options);case DIFF_INSERT:return printInsertLine(line,isFirstOrLast,options);default:return printCommonLine(line,isFirstOrLast,options);}}).join("\\n");}const noColor=string=>string;const DIFF_CONTEXT_DEFAULT=5;const DIFF_TRUNCATE_THRESHOLD_DEFAULT=0;function getDefaultOptions(){const c=getColors();return{aAnnotation:"Expected",aColor:c.green,aIndicator:"-",bAnnotation:"Received",bColor:c.red,bIndicator:"+",changeColor:c.inverse,changeLineTrailingSpaceColor:noColor,commonColor:c.dim,commonIndicator:" ",commonLineTrailingSpaceColor:noColor,compareKeys:void 0,contextLines:DIFF_CONTEXT_DEFAULT,emptyFirstOrLastLinePlaceholder:"",expand:true,includeChangeCounts:false,omitAnnotationLines:false,patchColor:c.yellow,truncateThreshold:DIFF_TRUNCATE_THRESHOLD_DEFAULT,truncateAnnotation:"... Diff result is truncated",truncateAnnotationColor:noColor};}function getCompareKeys(compareKeys){return compareKeys&&typeof compareKeys==="function"?compareKeys:void 0;}function getContextLines(contextLines){return typeof contextLines==="number"&&Number.isSafeInteger(contextLines)&&contextLines>=0?contextLines:DIFF_CONTEXT_DEFAULT;}function normalizeDiffOptions(options={}){return _objectSpread(_objectSpread(_objectSpread({},getDefaultOptions()),options),{},{compareKeys:getCompareKeys(options.compareKeys),contextLines:getContextLines(options.contextLines)});}function isEmptyString(lines){return lines.length===1&&lines[0].length===0;}function countChanges(diffs){let a=0;let b=0;diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:a+=1;break;case DIFF_INSERT:b+=1;break;}});return{a,b};}function printAnnotation({aAnnotation,aColor,aIndicator,bAnnotation,bColor,bIndicator,includeChangeCounts,omitAnnotationLines},changeCounts){if(omitAnnotationLines)return"";let aRest="";let bRest="";if(includeChangeCounts){const aCount=String(changeCounts.a);const bCount=String(changeCounts.b);const baAnnotationLengthDiff=bAnnotation.length-aAnnotation.length;const aAnnotationPadding=" ".repeat(Math.max(0,baAnnotationLengthDiff));const bAnnotationPadding=" ".repeat(Math.max(0,-baAnnotationLengthDiff));const baCountLengthDiff=bCount.length-aCount.length;const aCountPadding=" ".repeat(Math.max(0,baCountLengthDiff));const bCountPadding=" ".repeat(Math.max(0,-baCountLengthDiff));aRest=\`\${aAnnotationPadding} \${aIndicator} \${aCountPadding}\${aCount}\`;bRest=\`\${bAnnotationPadding} \${bIndicator} \${bCountPadding}\${bCount}\`;}const a=\`\${aIndicator} \${aAnnotation}\${aRest}\`;const b=\`\${bIndicator} \${bAnnotation}\${bRest}\`;return\`\${aColor(a)} \${bColor(b)} -\`;}function printDiffLines(diffs,options){return printAnnotation(options,countChanges(diffs))+(options.expand?joinAlignedDiffsExpand(diffs,options):joinAlignedDiffsNoExpand(diffs,options));}function diffLinesUnified(aLines,bLines,options){return printDiffLines(diffLinesRaw(isEmptyString(aLines)?[]:aLines,isEmptyString(bLines)?[]:bLines),normalizeDiffOptions(options));}function diffLinesUnified2(aLinesDisplay,bLinesDisplay,aLinesCompare,bLinesCompare,options){if(isEmptyString(aLinesDisplay)&&isEmptyString(aLinesCompare)){aLinesDisplay=[];aLinesCompare=[];}if(isEmptyString(bLinesDisplay)&&isEmptyString(bLinesCompare)){bLinesDisplay=[];bLinesCompare=[];}if(aLinesDisplay.length!==aLinesCompare.length||bLinesDisplay.length!==bLinesCompare.length){return diffLinesUnified(aLinesDisplay,bLinesDisplay,options);}const diffs=diffLinesRaw(aLinesCompare,bLinesCompare);let aIndex=0;let bIndex=0;diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:diff2[1]=aLinesDisplay[aIndex];aIndex+=1;break;case DIFF_INSERT:diff2[1]=bLinesDisplay[bIndex];bIndex+=1;break;default:diff2[1]=bLinesDisplay[bIndex];aIndex+=1;bIndex+=1;}});return printDiffLines(diffs,normalizeDiffOptions(options));}function diffLinesRaw(aLines,bLines){const aLength=aLines.length;const bLength=bLines.length;const isCommon=(aIndex2,bIndex2)=>aLines[aIndex2]===bLines[bIndex2];const diffs=[];let aIndex=0;let bIndex=0;const foundSubsequence=(nCommon,aCommon,bCommon)=>{for(;aIndex!==aCommon;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bCommon;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));for(;nCommon!==0;nCommon-=1,aIndex+=1,bIndex+=1)diffs.push(new Diff(DIFF_EQUAL,bLines[bIndex]));};const diffSequences=_default.default||_default;diffSequences(aLength,bLength,isCommon,foundSubsequence);for(;aIndex!==aLength;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bLength;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));return diffs;}function getCommonMessage(message,options){const _normalizeDiffOptions=normalizeDiffOptions(options),commonColor=_normalizeDiffOptions.commonColor;return commonColor(message);}const _plugins_2=plugins_1,AsymmetricMatcher$2=_plugins_2.AsymmetricMatcher,DOMCollection$1=_plugins_2.DOMCollection,DOMElement$1=_plugins_2.DOMElement,Immutable$1=_plugins_2.Immutable,ReactElement$1=_plugins_2.ReactElement,ReactTestComponent$1=_plugins_2.ReactTestComponent;const PLUGINS$1=[ReactTestComponent$1,ReactElement$1,DOMElement$1,DOMCollection$1,Immutable$1,AsymmetricMatcher$2];const FORMAT_OPTIONS={plugins:PLUGINS$1};const FALLBACK_FORMAT_OPTIONS={callToJSON:false,maxDepth:10,plugins:PLUGINS$1};function diff(a,b,options){if(Object.is(a,b))return"";const aType=getType(a);let expectedType=aType;let omitDifference=false;if(aType==="object"&&typeof a.asymmetricMatch==="function"){if(a.$$typeof!==Symbol.for("jest.asymmetricMatcher")){return null;}if(typeof a.getExpectedType!=="function"){return null;}expectedType=a.getExpectedType();omitDifference=expectedType==="string";}if(expectedType!==getType(b)){const _normalizeDiffOptions2=normalizeDiffOptions(options),aAnnotation=_normalizeDiffOptions2.aAnnotation,aColor=_normalizeDiffOptions2.aColor,aIndicator=_normalizeDiffOptions2.aIndicator,bAnnotation=_normalizeDiffOptions2.bAnnotation,bColor=_normalizeDiffOptions2.bColor,bIndicator=_normalizeDiffOptions2.bIndicator;const formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options);const aDisplay=format_1(a,formatOptions);const bDisplay=format_1(b,formatOptions);const aDiff=\`\${aColor(\`\${aIndicator} \${aAnnotation}:\`)} +\`;}function printDiffLines(diffs,truncated,options){return printAnnotation(options,countChanges(diffs))+(options.expand?joinAlignedDiffsExpand(diffs,options):joinAlignedDiffsNoExpand(diffs,options))+(truncated?options.truncateAnnotationColor(\` +\${options.truncateAnnotation}\`):"");}function diffLinesUnified(aLines,bLines,options){const normalizedOptions=normalizeDiffOptions(options);const _diffLinesRaw=diffLinesRaw(isEmptyString(aLines)?[]:aLines,isEmptyString(bLines)?[]:bLines,normalizedOptions),_diffLinesRaw2=_slicedToArray(_diffLinesRaw,2),diffs=_diffLinesRaw2[0],truncated=_diffLinesRaw2[1];return printDiffLines(diffs,truncated,normalizedOptions);}function diffLinesUnified2(aLinesDisplay,bLinesDisplay,aLinesCompare,bLinesCompare,options){if(isEmptyString(aLinesDisplay)&&isEmptyString(aLinesCompare)){aLinesDisplay=[];aLinesCompare=[];}if(isEmptyString(bLinesDisplay)&&isEmptyString(bLinesCompare)){bLinesDisplay=[];bLinesCompare=[];}if(aLinesDisplay.length!==aLinesCompare.length||bLinesDisplay.length!==bLinesCompare.length){return diffLinesUnified(aLinesDisplay,bLinesDisplay,options);}const _diffLinesRaw3=diffLinesRaw(aLinesCompare,bLinesCompare,options),_diffLinesRaw4=_slicedToArray(_diffLinesRaw3,2),diffs=_diffLinesRaw4[0],truncated=_diffLinesRaw4[1];let aIndex=0;let bIndex=0;diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:diff2[1]=aLinesDisplay[aIndex];aIndex+=1;break;case DIFF_INSERT:diff2[1]=bLinesDisplay[bIndex];bIndex+=1;break;default:diff2[1]=bLinesDisplay[bIndex];aIndex+=1;bIndex+=1;}});return printDiffLines(diffs,truncated,normalizeDiffOptions(options));}function diffLinesRaw(aLines,bLines,options){const truncate=(options==null?void 0:options.truncateThreshold)??false;const truncateThreshold=Math.max(Math.floor((options==null?void 0:options.truncateThreshold)??0),0);const aLength=truncate?Math.min(aLines.length,truncateThreshold):aLines.length;const bLength=truncate?Math.min(bLines.length,truncateThreshold):bLines.length;const truncated=aLength!==aLines.length||bLength!==bLines.length;const isCommon=(aIndex2,bIndex2)=>aLines[aIndex2]===bLines[bIndex2];const diffs=[];let aIndex=0;let bIndex=0;const foundSubsequence=(nCommon,aCommon,bCommon)=>{for(;aIndex!==aCommon;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bCommon;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));for(;nCommon!==0;nCommon-=1,aIndex+=1,bIndex+=1)diffs.push(new Diff(DIFF_EQUAL,bLines[bIndex]));};const diffSequences=_default.default||_default;diffSequences(aLength,bLength,isCommon,foundSubsequence);for(;aIndex!==aLength;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bLength;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));return[diffs,truncated];}function getCommonMessage(message,options){const _normalizeDiffOptions=normalizeDiffOptions(options),commonColor=_normalizeDiffOptions.commonColor;return commonColor(message);}const _plugins_2=plugins_1,AsymmetricMatcher$2=_plugins_2.AsymmetricMatcher,DOMCollection$1=_plugins_2.DOMCollection,DOMElement$1=_plugins_2.DOMElement,Immutable$1=_plugins_2.Immutable,ReactElement$1=_plugins_2.ReactElement,ReactTestComponent$1=_plugins_2.ReactTestComponent;const PLUGINS$1=[ReactTestComponent$1,ReactElement$1,DOMElement$1,DOMCollection$1,Immutable$1,AsymmetricMatcher$2];const FORMAT_OPTIONS={plugins:PLUGINS$1};const FALLBACK_FORMAT_OPTIONS={callToJSON:false,maxDepth:10,plugins:PLUGINS$1};function diff(a,b,options){if(Object.is(a,b))return"";const aType=getType(a);let expectedType=aType;let omitDifference=false;if(aType==="object"&&typeof a.asymmetricMatch==="function"){if(a.$$typeof!==Symbol.for("jest.asymmetricMatcher")){return null;}if(typeof a.getExpectedType!=="function"){return null;}expectedType=a.getExpectedType();omitDifference=expectedType==="string";}if(expectedType!==getType(b)){const _normalizeDiffOptions2=normalizeDiffOptions(options),aAnnotation=_normalizeDiffOptions2.aAnnotation,aColor=_normalizeDiffOptions2.aColor,aIndicator=_normalizeDiffOptions2.aIndicator,bAnnotation=_normalizeDiffOptions2.bAnnotation,bColor=_normalizeDiffOptions2.bColor,bIndicator=_normalizeDiffOptions2.bIndicator;const formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options);const aDisplay=format_1(a,formatOptions);const bDisplay=format_1(b,formatOptions);const aDiff=\`\${aColor(\`\${aIndicator} \${aAnnotation}:\`)} \${aDisplay}\`;const bDiff=\`\${bColor(\`\${bIndicator} \${bAnnotation}:\`)} \${bDisplay}\`;return\`\${aDiff} \${bDiff}\`;}if(omitDifference)return null;switch(aType){case"string":return diffLinesUnified(a.split("\\n"),b.split("\\n"),options);case"boolean":case"number":return comparePrimitive(a,b,options);case"map":return compareObjects(sortMap(a),sortMap(b),options);case"set":return compareObjects(sortSet(a),sortSet(b),options);default:return compareObjects(a,b,options);}}function comparePrimitive(a,b,options){const aFormat=format_1(a,FORMAT_OPTIONS);const bFormat=format_1(b,FORMAT_OPTIONS);return aFormat===bFormat?"":diffLinesUnified(aFormat.split("\\n"),bFormat.split("\\n"),options);}function sortMap(map){return new Map(Array.from(map.entries()).sort());}function sortSet(set){return new Set(Array.from(set.values()).sort());}function compareObjects(a,b,options){let difference;let hasThrown=false;try{const formatOptions=getFormatOptions(FORMAT_OPTIONS,options);difference=getObjectsDifference(a,b,formatOptions,options);}catch{hasThrown=true;}const noDiffMessage=getCommonMessage(NO_DIFF_MESSAGE,options);if(difference===void 0||difference===noDiffMessage){const formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options);difference=getObjectsDifference(a,b,formatOptions,options);if(difference!==noDiffMessage&&!hasThrown){difference=\`\${getCommonMessage(SIMILAR_MESSAGE,options)} -\${difference}\`;}}return difference;}function getFormatOptions(formatOptions,options){const _normalizeDiffOptions3=normalizeDiffOptions(options),compareKeys=_normalizeDiffOptions3.compareKeys;return _objectSpread(_objectSpread({},formatOptions),{},{compareKeys});}function getObjectsDifference(a,b,formatOptions,options){const formatOptionsZeroIndent=_objectSpread(_objectSpread({},formatOptions),{},{indent:0});const aCompare=format_1(a,formatOptionsZeroIndent);const bCompare=format_1(b,formatOptionsZeroIndent);if(aCompare===bCompare){return getCommonMessage(NO_DIFF_MESSAGE,options);}else{const aDisplay=format_1(a,formatOptions);const bDisplay=format_1(b,formatOptions);return diffLinesUnified2(aDisplay.split("\\n"),bDisplay.split("\\n"),aCompare.split("\\n"),bCompare.split("\\n"),options);}}const IS_RECORD_SYMBOL="@@__IMMUTABLE_RECORD__@@";const IS_COLLECTION_SYMBOL="@@__IMMUTABLE_ITERABLE__@@";function isImmutable(v){return v&&(v[IS_COLLECTION_SYMBOL]||v[IS_RECORD_SYMBOL]);}const OBJECT_PROTO=Object.getPrototypeOf({});function getUnserializableMessage(err){if(err instanceof Error)return\`: \${err.message}\`;if(typeof err==="string")return\`: \${err}\`;return"";}function serializeError(val,seen=/* @__PURE__ */new WeakMap()){if(!val||typeof val==="string")return val;if(typeof val==="function")return\`Function<\${val.name||"anonymous"}>\`;if(typeof val==="symbol")return val.toString();if(typeof val!=="object")return val;if(isImmutable(val))return serializeError(val.toJSON(),seen);if(val instanceof Promise||val.constructor&&val.constructor.prototype==="AsyncFunction")return"Promise";if(typeof Element!=="undefined"&&val instanceof Element)return val.tagName;if(typeof val.asymmetricMatch==="function")return\`\${val.toString()} \${format(val.sample)}\`;if(seen.has(val))return seen.get(val);if(Array.isArray(val)){const clone=new Array(val.length);seen.set(val,clone);val.forEach((e,i)=>{try{clone[i]=serializeError(e,seen);}catch(err){clone[i]=getUnserializableMessage(err);}});return clone;}else{const clone=/* @__PURE__ */Object.create(null);seen.set(val,clone);let obj=val;while(obj&&obj!==OBJECT_PROTO){Object.getOwnPropertyNames(obj).forEach(key=>{if(key in clone)return;try{clone[key]=serializeError(val[key],seen);}catch(err){delete clone[key];clone[key]=getUnserializableMessage(err);}});obj=Object.getPrototypeOf(obj);}return clone;}}function normalizeErrorMessage(message){return message.replace(/__(vite_ssr_import|vi_import)_\\d+__\\./g,"");}function processError(err,diffOptions){if(!err||typeof err!=="object")return{message:err};if(err.stack)err.stackStr=String(err.stack);if(err.name)err.nameStr=String(err.name);if(err.showDiff||err.showDiff===void 0&&err.expected!==void 0&&err.actual!==void 0){const clonedActual=deepClone(err.actual,{forceWritable:true});const clonedExpected=deepClone(err.expected,{forceWritable:true});const _replaceAsymmetricMat=replaceAsymmetricMatcher(clonedActual,clonedExpected),replacedActual=_replaceAsymmetricMat.replacedActual,replacedExpected=_replaceAsymmetricMat.replacedExpected;err.diff=diff(replacedExpected,replacedActual,_objectSpread(_objectSpread({},diffOptions),err.diffOptions));}if(typeof err.expected!=="string")err.expected=stringify(err.expected,10);if(typeof err.actual!=="string")err.actual=stringify(err.actual,10);try{if(typeof err.message==="string")err.message=normalizeErrorMessage(err.message);if(typeof err.cause==="object"&&typeof err.cause.message==="string")err.cause.message=normalizeErrorMessage(err.cause.message);}catch{}try{return serializeError(err);}catch(e){return serializeError(new Error(\`Failed to fully serialize error: \${e==null?void 0:e.message} -Inner error message: \${err==null?void 0:err.message}\`));}}function isAsymmetricMatcher(data){const type=getType$2(data);return type==="Object"&&typeof data.asymmetricMatch==="function";}function isReplaceable(obj1,obj2){const obj1Type=getType$2(obj1);const obj2Type=getType$2(obj2);return obj1Type===obj2Type&&(obj1Type==="Object"||obj1Type==="Array");}function replaceAsymmetricMatcher(actual,expected,actualReplaced=/* @__PURE__ */new WeakSet(),expectedReplaced=/* @__PURE__ */new WeakSet()){if(!isReplaceable(actual,expected))return{replacedActual:actual,replacedExpected:expected};if(actualReplaced.has(actual)||expectedReplaced.has(expected))return{replacedActual:actual,replacedExpected:expected};actualReplaced.add(actual);expectedReplaced.add(expected);getOwnProperties(expected).forEach(key=>{const expectedValue=expected[key];const actualValue=actual[key];if(isAsymmetricMatcher(expectedValue)){if(expectedValue.asymmetricMatch(actualValue))actual[key]=expectedValue;}else if(isAsymmetricMatcher(actualValue)){if(actualValue.asymmetricMatch(expectedValue))expected[key]=actualValue;}else if(isReplaceable(actualValue,expectedValue)){const replaced=replaceAsymmetricMatcher(actualValue,expectedValue,actualReplaced,expectedReplaced);actual[key]=replaced.replacedActual;expected[key]=replaced.replacedExpected;}});return{replacedActual:actual,replacedExpected:expected};}function createChainable(keys,fn){function create(context){const chain2=function(...args){return fn.apply(context,args);};Object.assign(chain2,fn);chain2.withContext=()=>chain2.bind(context);chain2.setContext=(key,value)=>{context[key]=value;};chain2.mergeContext=ctx=>{Object.assign(context,ctx);};for(const key of keys){Object.defineProperty(chain2,key,{get(){return create(_objectSpread(_objectSpread({},context),{},{[key]:true}));}});}return chain2;}const chain=create({});chain.fn=fn;return chain;}function getNames(task){const names=[task.name];let current=task;while((current==null?void 0:current.suite)||(current==null?void 0:current.file)){current=current.suite||current.file;if(current==null?void 0:current.name)names.unshift(current.name);}return names;}const _DRIVE_LETTER_START_RE=/^[A-Za-z]:\\//;function normalizeWindowsPath$1(input=""){if(!input){return input;}return input.replace(/\\\\/g,"/").replace(_DRIVE_LETTER_START_RE,r=>r.toUpperCase());}const _IS_ABSOLUTE_RE$1=/^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;function cwd$1(){if(typeof process!=="undefined"&&typeof process.cwd==="function"){return process.cwd().replace(/\\\\/g,"/");}return"/";}const resolve$3=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath$1(argument));let resolvedPath="";let resolvedAbsolute=false;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){const path=index>=0?arguments_[index]:cwd$1();if(!path||path.length===0){continue;}resolvedPath=\`\${path}/\${resolvedPath}\`;resolvedAbsolute=isAbsolute$1(path);}resolvedPath=normalizeString$1(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute&&!isAbsolute$1(resolvedPath)){return\`/\${resolvedPath}\`;}return resolvedPath.length>0?resolvedPath:".";};function normalizeString$1(path,allowAboveRoot){let res="";let lastSegmentLength=0;let lastSlash=-1;let dots=0;let char=null;for(let index=0;index<=path.length;++index){if(index2){const lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex===-1){res="";lastSegmentLength=0;}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/");}lastSlash=index;dots=0;continue;}else if(res.length>0){res="";lastSegmentLength=0;lastSlash=index;dots=0;continue;}}if(allowAboveRoot){res+=res.length>0?"/..":"..";lastSegmentLength=2;}}else{if(res.length>0){res+=\`/\${path.slice(lastSlash+1,index)}\`;}else{res=path.slice(lastSlash+1,index);}lastSegmentLength=index-lastSlash-1;}lastSlash=index;dots=0;}else if(char==="."&&dots!==-1){++dots;}else{dots=-1;}}return res;}const isAbsolute$1=function(p){return _IS_ABSOLUTE_RE$1.test(p);};const fnMap=/* @__PURE__ */new WeakMap();const fixtureMap=/* @__PURE__ */new WeakMap();const hooksMap=/* @__PURE__ */new WeakMap();function setFn(key,fn){fnMap.set(key,fn);}function setFixture(key,fixture){fixtureMap.set(key,fixture);}function getFixture(key){return fixtureMap.get(key);}function setHooks(key,hooks){hooksMap.set(key,hooks);}function getHooks(key){return hooksMap.get(key);}class PendingError extends Error{constructor(message,task){super(message);this.message=message;this.taskId=task.id;}code="VITEST_PENDING";taskId;}const collectorContext={tasks:[],currentSuite:null};function collectTask(task){var _a;(_a=collectorContext.currentSuite)==null?void 0:_a.tasks.push(task);}async function runWithSuite(suite,fn){const prev=collectorContext.currentSuite;collectorContext.currentSuite=suite;await fn();collectorContext.currentSuite=prev;}function withTimeout(fn,timeout,isHook=false){if(timeout<=0||timeout===Number.POSITIVE_INFINITY)return fn;const _getSafeTimers=getSafeTimers(),setTimeout=_getSafeTimers.setTimeout,clearTimeout=_getSafeTimers.clearTimeout;return(...args)=>{return Promise.race([fn(...args),new Promise((resolve,reject)=>{var _a;const timer=setTimeout(()=>{clearTimeout(timer);reject(new Error(makeTimeoutMsg(isHook,timeout)));},timeout);(_a=timer.unref)==null?void 0:_a.call(timer);})]);};}function createTestContext(test,runner){var _a;const context=function(){throw new Error("done() callback is deprecated, use promise instead");};context.task=test;context.skip=()=>{test.pending=true;throw new PendingError("test is skipped; abort execution",test);};context.onTestFailed=fn=>{test.onFailed||(test.onFailed=[]);test.onFailed.push(fn);};context.onTestFinished=fn=>{test.onFinished||(test.onFinished=[]);test.onFinished.push(fn);};return((_a=runner.extendTaskContext)==null?void 0:_a.call(runner,context))||context;}function makeTimeoutMsg(isHook,timeout){return\`\${isHook?"Hook":"Test"} timed out in \${timeout}ms. -If this is a long-running \${isHook?"hook":"test"}, pass a timeout value as the last argument or configure it globally with "\${isHook?"hookTimeout":"testTimeout"}".\`;}function mergeContextFixtures(fixtures,context={}){const fixtureOptionKeys=["auto"];const fixtureArray=Object.entries(fixtures).map(([prop,value])=>{const fixtureItem={value};if(Array.isArray(value)&&value.length>=2&&isObject$1(value[1])&&Object.keys(value[1]).some(key=>fixtureOptionKeys.includes(key))){Object.assign(fixtureItem,value[1]);fixtureItem.value=value[0];}fixtureItem.prop=prop;fixtureItem.isFn=typeof fixtureItem.value==="function";return fixtureItem;});if(Array.isArray(context.fixtures))context.fixtures=context.fixtures.concat(fixtureArray);else context.fixtures=fixtureArray;fixtureArray.forEach(fixture=>{if(fixture.isFn){const usedProps=getUsedProps(fixture.value);if(usedProps.length)fixture.deps=context.fixtures.filter(({prop})=>prop!==fixture.prop&&usedProps.includes(prop));}});return context;}const fixtureValueMaps=/* @__PURE__ */new Map();const cleanupFnArrayMap=/* @__PURE__ */new Map();function withFixtures(fn,testContext){return hookContext=>{const context=hookContext||testContext;if(!context)return fn({});const fixtures=getFixture(context);if(!(fixtures==null?void 0:fixtures.length))return fn(context);const usedProps=getUsedProps(fn);const hasAutoFixture=fixtures.some(({auto})=>auto);if(!usedProps.length&&!hasAutoFixture)return fn(context);if(!fixtureValueMaps.get(context))fixtureValueMaps.set(context,/* @__PURE__ */new Map());const fixtureValueMap=fixtureValueMaps.get(context);if(!cleanupFnArrayMap.has(context))cleanupFnArrayMap.set(context,[]);const cleanupFnArray=cleanupFnArrayMap.get(context);const usedFixtures=fixtures.filter(({prop,auto})=>auto||usedProps.includes(prop));const pendingFixtures=resolveDeps(usedFixtures);if(!pendingFixtures.length)return fn(context);async function resolveFixtures(){for(const fixture of pendingFixtures){if(fixtureValueMap.has(fixture))continue;const resolvedValue=fixture.isFn?await resolveFixtureFunction(fixture.value,context,cleanupFnArray):fixture.value;context[fixture.prop]=resolvedValue;fixtureValueMap.set(fixture,resolvedValue);cleanupFnArray.unshift(()=>{fixtureValueMap.delete(fixture);});}}return resolveFixtures().then(()=>fn(context));};}async function resolveFixtureFunction(fixtureFn,context,cleanupFnArray){const useFnArgPromise=createDefer();let isUseFnArgResolved=false;const fixtureReturn=fixtureFn(context,async useFnArg=>{isUseFnArgResolved=true;useFnArgPromise.resolve(useFnArg);const useReturnPromise=createDefer();cleanupFnArray.push(async()=>{useReturnPromise.resolve();await fixtureReturn;});await useReturnPromise;}).catch(e=>{if(!isUseFnArgResolved){useFnArgPromise.reject(e);return;}throw e;});return useFnArgPromise;}function resolveDeps(fixtures,depSet=/* @__PURE__ */new Set(),pendingFixtures=[]){fixtures.forEach(fixture=>{if(pendingFixtures.includes(fixture))return;if(!fixture.isFn||!fixture.deps){pendingFixtures.push(fixture);return;}if(depSet.has(fixture))throw new Error(\`Circular fixture dependency detected: \${fixture.prop} <- \${[...depSet].reverse().map(d=>d.prop).join(" <- ")}\`);depSet.add(fixture);resolveDeps(fixture.deps,depSet,pendingFixtures);pendingFixtures.push(fixture);depSet.clear();});return pendingFixtures;}function getUsedProps(fn){const match=fn.toString().match(/[^(]*\\(([^)]*)/);if(!match)return[];const args=splitByComma(match[1]);if(!args.length)return[];const first=args[0];if(!(first.startsWith("{")&&first.endsWith("}")))throw new Error(\`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "\${first}".\`);const _first=first.slice(1,-1).replace(/\\s/g,"");const props=splitByComma(_first).map(prop=>{return prop.replace(/\\:.*|\\=.*/g,"");});const last=props.at(-1);if(last&&last.startsWith("..."))throw new Error(\`Rest parameters are not supported in fixtures, received "\${last}".\`);return props;}function splitByComma(s){const result=[];const stack=[];let start=0;for(let i=0;i{};if(typeof optionsOrTest==="object"){if(typeof optionsOrFn==="object")throw new TypeError("Cannot use two objects as arguments. Please provide options and a function callback in that order.");options=optionsOrTest;}else if(typeof optionsOrTest==="number"){options={timeout:optionsOrTest};}else if(typeof optionsOrFn==="object"){options=optionsOrFn;}if(typeof optionsOrFn==="function"){if(typeof optionsOrTest==="function")throw new TypeError("Cannot use two functions as arguments. Please use the second argument for options.");fn=optionsOrFn;}else if(typeof optionsOrTest==="function"){fn=optionsOrTest;}return{options,handler:fn};}function createSuiteCollector(name,factory=()=>{},mode,shuffle,each,suiteOptions){const tasks=[];const factoryQueue=[];let suite2;initSuite();const task=function(name2="",options={}){const task2={id:"",name:name2,suite:void 0,each:options.each,fails:options.fails,context:void 0,type:"custom",retry:options.retry??runner.config.retry,repeats:options.repeats,mode:options.only?"only":options.skip?"skip":options.todo?"todo":"run",meta:options.meta??/* @__PURE__ */Object.create(null)};const handler=options.handler;if(options.concurrent||!options.sequential&&runner.config.sequence.concurrent)task2.concurrent=true;if(shuffle)task2.shuffle=true;const context=createTestContext(task2,runner);Object.defineProperty(task2,"context",{value:context,enumerable:false});setFixture(context,options.fixtures);if(handler){setFn(task2,withTimeout(withFixtures(handler,context),(options==null?void 0:options.timeout)??runner.config.testTimeout));}tasks.push(task2);return task2;};const test2=createTest(function(name2,optionsOrFn,optionsOrTest){let _parseArguments=parseArguments(optionsOrFn,optionsOrTest),options=_parseArguments.options,handler=_parseArguments.handler;if(typeof suiteOptions==="object")options=Object.assign({},suiteOptions,options);options.concurrent=this.concurrent||!this.sequential&&(options==null?void 0:options.concurrent);options.sequential=this.sequential||!this.concurrent&&(options==null?void 0:options.sequential);const test3=task(formatName(name2),_objectSpread(_objectSpread(_objectSpread({},this),options),{},{handler}));test3.type="test";});const collector={type:"collector",name,mode,options:suiteOptions,test:test2,tasks,collect,task,clear,on:addHook};function addHook(name2,...fn){getHooks(suite2)[name2].push(...fn);}function initSuite(){if(typeof suiteOptions==="number")suiteOptions={timeout:suiteOptions};suite2={id:"",type:"suite",name,mode,each,shuffle,tasks:[],meta:/* @__PURE__ */Object.create(null),projectName:""};setHooks(suite2,createSuiteHooks());}function clear(){tasks.length=0;factoryQueue.length=0;initSuite();}async function collect(file){factoryQueue.length=0;if(factory)await runWithSuite(collector,()=>factory(test2));const allChildren=[];for(const i of[...factoryQueue,...tasks])allChildren.push(i.type==="collector"?await i.collect(file):i);suite2.file=file;suite2.tasks=allChildren;allChildren.forEach(task2=>{task2.suite=suite2;if(file)task2.file=file;});return suite2;}collectTask(collector);return collector;}function createSuite(){function suiteFn(name,factoryOrOptions,optionsOrFactory={}){const mode=this.only?"only":this.skip?"skip":this.todo?"todo":"run";const currentSuite=getCurrentSuite();let _parseArguments2=parseArguments(factoryOrOptions,optionsOrFactory),options=_parseArguments2.options,factory=_parseArguments2.handler;if(currentSuite==null?void 0:currentSuite.options)options=_objectSpread(_objectSpread({},currentSuite.options),options);options.concurrent=this.concurrent||!this.sequential&&(options==null?void 0:options.concurrent);options.sequential=this.sequential||!this.concurrent&&(options==null?void 0:options.sequential);return createSuiteCollector(formatName(name),factory,mode,this.shuffle,this.each,options);}suiteFn.each=function(cases,...args){const suite2=this.withContext();this.setContext("each",true);if(Array.isArray(cases)&&args.length)cases=formatTemplateString(cases,args);return(name,optionsOrFn,fnOrOptions)=>{const _name=formatName(name);const arrayOnlyCases=cases.every(Array.isArray);const _parseArguments3=parseArguments(optionsOrFn,fnOrOptions),options=_parseArguments3.options,handler=_parseArguments3.handler;cases.forEach((i,idx)=>{const items=Array.isArray(i)?i:[i];arrayOnlyCases?suite2(formatTitle(_name,items,idx),options,()=>handler(...items)):suite2(formatTitle(_name,items,idx),options,()=>handler(i));});this.setContext("each",void 0);};};suiteFn.skipIf=condition=>condition?suite.skip:suite;suiteFn.runIf=condition=>condition?suite:suite.skip;return createChainable(["concurrent","sequential","shuffle","skip","only","todo"],suiteFn);}function createTaskCollector(fn,context){const taskFn=fn;taskFn.each=function(cases,...args){const test2=this.withContext();this.setContext("each",true);if(Array.isArray(cases)&&args.length)cases=formatTemplateString(cases,args);return(name,optionsOrFn,fnOrOptions)=>{const _name=formatName(name);const arrayOnlyCases=cases.every(Array.isArray);const _parseArguments4=parseArguments(optionsOrFn,fnOrOptions),options=_parseArguments4.options,handler=_parseArguments4.handler;cases.forEach((i,idx)=>{const items=Array.isArray(i)?i:[i];arrayOnlyCases?test2(formatTitle(_name,items,idx),options,()=>handler(...items)):test2(formatTitle(_name,items,idx),options,()=>handler(i));});this.setContext("each",void 0);};};taskFn.skipIf=function(condition){return condition?this.skip:this;};taskFn.runIf=function(condition){return condition?this:this.skip;};taskFn.extend=function(fixtures){const _context=mergeContextFixtures(fixtures,context);return createTest(function fn2(name,optionsOrFn,optionsOrTest){getCurrentSuite().test.fn.call(this,formatName(name),optionsOrFn,optionsOrTest);},_context);};const _test=createChainable(["concurrent","sequential","skip","only","todo","fails"],taskFn);if(context)_test.mergeContext(context);return _test;}function createTest(fn,context){return createTaskCollector(fn,context);}function formatName(name){return typeof name==="string"?name:name instanceof Function?name.name||"":String(name);}function formatTitle(template,items,idx){if(template.includes("%#")){template=template.replace(/%%/g,"__vitest_escaped_%__").replace(/%#/g,\`\${idx}\`).replace(/__vitest_escaped_%__/g,"%%");}const count=template.split("%").length-1;let formatted=format(template,...items.slice(0,count));if(isObject$1(items[0])){formatted=formatted.replace(/\\$([$\\w_.]+)/g,// https://github.com/chaijs/chai/pull/1490 +\${difference}\`;}}return difference;}function getFormatOptions(formatOptions,options){const _normalizeDiffOptions3=normalizeDiffOptions(options),compareKeys=_normalizeDiffOptions3.compareKeys;return _objectSpread(_objectSpread({},formatOptions),{},{compareKeys});}function getObjectsDifference(a,b,formatOptions,options){const formatOptionsZeroIndent=_objectSpread(_objectSpread({},formatOptions),{},{indent:0});const aCompare=format_1(a,formatOptionsZeroIndent);const bCompare=format_1(b,formatOptionsZeroIndent);if(aCompare===bCompare){return getCommonMessage(NO_DIFF_MESSAGE,options);}else{const aDisplay=format_1(a,formatOptions);const bDisplay=format_1(b,formatOptions);return diffLinesUnified2(aDisplay.split("\\n"),bDisplay.split("\\n"),aCompare.split("\\n"),bCompare.split("\\n"),options);}}const IS_RECORD_SYMBOL="@@__IMMUTABLE_RECORD__@@";const IS_COLLECTION_SYMBOL="@@__IMMUTABLE_ITERABLE__@@";function isImmutable(v){return v&&(v[IS_COLLECTION_SYMBOL]||v[IS_RECORD_SYMBOL]);}const OBJECT_PROTO=Object.getPrototypeOf({});function getUnserializableMessage(err){if(err instanceof Error)return\`: \${err.message}\`;if(typeof err==="string")return\`: \${err}\`;return"";}function serializeError(val,seen=/* @__PURE__ */new WeakMap()){if(!val||typeof val==="string")return val;if(typeof val==="function")return\`Function<\${val.name||"anonymous"}>\`;if(typeof val==="symbol")return val.toString();if(typeof val!=="object")return val;if(isImmutable(val))return serializeError(val.toJSON(),seen);if(val instanceof Promise||val.constructor&&val.constructor.prototype==="AsyncFunction")return"Promise";if(typeof Element!=="undefined"&&val instanceof Element)return val.tagName;if(typeof val.asymmetricMatch==="function")return\`\${val.toString()} \${format(val.sample)}\`;if(typeof val.toJSON==="function")return val.toJSON();if(seen.has(val))return seen.get(val);if(Array.isArray(val)){const clone=new Array(val.length);seen.set(val,clone);val.forEach((e,i)=>{try{clone[i]=serializeError(e,seen);}catch(err){clone[i]=getUnserializableMessage(err);}});return clone;}else{const clone=/* @__PURE__ */Object.create(null);seen.set(val,clone);let obj=val;while(obj&&obj!==OBJECT_PROTO){Object.getOwnPropertyNames(obj).forEach(key=>{if(key in clone)return;try{clone[key]=serializeError(val[key],seen);}catch(err){delete clone[key];clone[key]=getUnserializableMessage(err);}});obj=Object.getPrototypeOf(obj);}return clone;}}function normalizeErrorMessage(message){return message.replace(/__(vite_ssr_import|vi_import)_\\d+__\\./g,"");}function processError(err,diffOptions){if(!err||typeof err!=="object")return{message:err};if(err.stack)err.stackStr=String(err.stack);if(err.name)err.nameStr=String(err.name);if(err.showDiff||err.showDiff===void 0&&err.expected!==void 0&&err.actual!==void 0){const clonedActual=deepClone(err.actual,{forceWritable:true});const clonedExpected=deepClone(err.expected,{forceWritable:true});const _replaceAsymmetricMat=replaceAsymmetricMatcher(clonedActual,clonedExpected),replacedActual=_replaceAsymmetricMat.replacedActual,replacedExpected=_replaceAsymmetricMat.replacedExpected;err.diff=diff(replacedExpected,replacedActual,_objectSpread(_objectSpread({},diffOptions),err.diffOptions));}if(typeof err.expected!=="string")err.expected=stringify(err.expected,10);if(typeof err.actual!=="string")err.actual=stringify(err.actual,10);try{if(typeof err.message==="string")err.message=normalizeErrorMessage(err.message);if(typeof err.cause==="object"&&typeof err.cause.message==="string")err.cause.message=normalizeErrorMessage(err.cause.message);}catch{}try{return serializeError(err);}catch(e){return serializeError(new Error(\`Failed to fully serialize error: \${e==null?void 0:e.message} +Inner error message: \${err==null?void 0:err.message}\`));}}function isAsymmetricMatcher(data){const type=getType$2(data);return type==="Object"&&typeof data.asymmetricMatch==="function";}function isReplaceable(obj1,obj2){const obj1Type=getType$2(obj1);const obj2Type=getType$2(obj2);return obj1Type===obj2Type&&(obj1Type==="Object"||obj1Type==="Array");}function replaceAsymmetricMatcher(actual,expected,actualReplaced=/* @__PURE__ */new WeakSet(),expectedReplaced=/* @__PURE__ */new WeakSet()){if(!isReplaceable(actual,expected))return{replacedActual:actual,replacedExpected:expected};if(actualReplaced.has(actual)||expectedReplaced.has(expected))return{replacedActual:actual,replacedExpected:expected};actualReplaced.add(actual);expectedReplaced.add(expected);getOwnProperties(expected).forEach(key=>{const expectedValue=expected[key];const actualValue=actual[key];if(isAsymmetricMatcher(expectedValue)){if(expectedValue.asymmetricMatch(actualValue))actual[key]=expectedValue;}else if(isAsymmetricMatcher(actualValue)){if(actualValue.asymmetricMatch(expectedValue))expected[key]=actualValue;}else if(isReplaceable(actualValue,expectedValue)){const replaced=replaceAsymmetricMatcher(actualValue,expectedValue,actualReplaced,expectedReplaced);actual[key]=replaced.replacedActual;expected[key]=replaced.replacedExpected;}});return{replacedActual:actual,replacedExpected:expected};}function createChainable(keys,fn){function create(context){const chain2=function(...args){return fn.apply(context,args);};Object.assign(chain2,fn);chain2.withContext=()=>chain2.bind(context);chain2.setContext=(key,value)=>{context[key]=value;};chain2.mergeContext=ctx=>{Object.assign(context,ctx);};for(const key of keys){Object.defineProperty(chain2,key,{get(){return create(_objectSpread(_objectSpread({},context),{},{[key]:true}));}});}return chain2;}const chain=create({});chain.fn=fn;return chain;}function getNames(task){const names=[task.name];let current=task;while((current==null?void 0:current.suite)||(current==null?void 0:current.file)){current=current.suite||current.file;if(current==null?void 0:current.name)names.unshift(current.name);}return names;}const _DRIVE_LETTER_START_RE=/^[A-Za-z]:\\//;function normalizeWindowsPath$1(input=""){if(!input){return input;}return input.replace(/\\\\/g,"/").replace(_DRIVE_LETTER_START_RE,r=>r.toUpperCase());}const _IS_ABSOLUTE_RE$1=/^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;function cwd$1(){if(typeof process!=="undefined"&&typeof process.cwd==="function"){return process.cwd().replace(/\\\\/g,"/");}return"/";}const resolve$3=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath$1(argument));let resolvedPath="";let resolvedAbsolute=false;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){const path=index>=0?arguments_[index]:cwd$1();if(!path||path.length===0){continue;}resolvedPath=\`\${path}/\${resolvedPath}\`;resolvedAbsolute=isAbsolute$1(path);}resolvedPath=normalizeString$1(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute&&!isAbsolute$1(resolvedPath)){return\`/\${resolvedPath}\`;}return resolvedPath.length>0?resolvedPath:".";};function normalizeString$1(path,allowAboveRoot){let res="";let lastSegmentLength=0;let lastSlash=-1;let dots=0;let char=null;for(let index=0;index<=path.length;++index){if(index2){const lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex===-1){res="";lastSegmentLength=0;}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/");}lastSlash=index;dots=0;continue;}else if(res.length>0){res="";lastSegmentLength=0;lastSlash=index;dots=0;continue;}}if(allowAboveRoot){res+=res.length>0?"/..":"..";lastSegmentLength=2;}}else{if(res.length>0){res+=\`/\${path.slice(lastSlash+1,index)}\`;}else{res=path.slice(lastSlash+1,index);}lastSegmentLength=index-lastSlash-1;}lastSlash=index;dots=0;}else if(char==="."&&dots!==-1){++dots;}else{dots=-1;}}return res;}const isAbsolute$1=function(p){return _IS_ABSOLUTE_RE$1.test(p);};function normalizeWindowsPath(input=""){if(!input||!input.includes("\\\\")){return input;}return input.replace(/\\\\/g,"/");}const _IS_ABSOLUTE_RE=/^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;function cwd(){if(typeof process!=="undefined"){return process.cwd().replace(/\\\\/g,"/");}return"/";}const resolve$2=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath(argument));let resolvedPath="";let resolvedAbsolute=false;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){const path=index>=0?arguments_[index]:cwd();if(!path||path.length===0){continue;}resolvedPath=\`\${path}/\${resolvedPath}\`;resolvedAbsolute=isAbsolute(path);}resolvedPath=normalizeString(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute&&!isAbsolute(resolvedPath)){return\`/\${resolvedPath}\`;}return resolvedPath.length>0?resolvedPath:".";};function normalizeString(path,allowAboveRoot){let res="";let lastSegmentLength=0;let lastSlash=-1;let dots=0;let char=null;for(let index=0;index<=path.length;++index){if(index2){const lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex===-1){res="";lastSegmentLength=0;}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/");}lastSlash=index;dots=0;continue;}else if(res.length>0){res="";lastSegmentLength=0;lastSlash=index;dots=0;continue;}}if(allowAboveRoot){res+=res.length>0?"/..":"..";lastSegmentLength=2;}}else{if(res.length>0){res+=\`/\${path.slice(lastSlash+1,index)}\`;}else{res=path.slice(lastSlash+1,index);}lastSegmentLength=index-lastSlash-1;}lastSlash=index;dots=0;}else if(char==="."&&dots!==-1){++dots;}else{dots=-1;}}return res;}const isAbsolute=function(p){return _IS_ABSOLUTE_RE.test(p);};const chars$1='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';const intToChar$1=new Uint8Array(64);// 64 possible chars. +const charToInt$1=new Uint8Array(128);// z is 122 in ASCII +for(let i=0;i eval"))line=line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,":$1");if(!line.includes("@")&&!line.includes(":"))return null;const functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;const matches=line.match(functionNameRegex);const functionName=matches&&matches[1]?matches[1]:void 0;const _extractLocation$=extractLocation$1(line.replace(functionNameRegex,"")),_extractLocation$2=_slicedToArray(_extractLocation$,3),url=_extractLocation$2[0],lineNumber=_extractLocation$2[1],columnNumber=_extractLocation$2[2];if(!url||!lineNumber||!columnNumber)return null;return{file:url,method:functionName||"",line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseSingleStack(raw){const line=raw.trim();if(!CHROME_IE_STACK_REGEXP$1.test(line))return parseSingleFFOrSafariStack$1(line);return parseSingleV8Stack$1(line);}function parseSingleV8Stack$1(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP$1.test(line))return null;if(line.includes("(eval "))line=line.replace(/eval code/g,"eval").replace(/(\\(eval at [^()]*)|(,.*$)/g,"");let sanitizedLine=line.replace(/^\\s+/,"").replace(/\\(eval code/g,"(").replace(/^.*?\\s+/,"");const location=sanitizedLine.match(/ (\\(.+\\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],""):sanitizedLine;const _extractLocation$3=extractLocation$1(location?location[1]:sanitizedLine),_extractLocation$4=_slicedToArray(_extractLocation$3,3),url=_extractLocation$4[0],lineNumber=_extractLocation$4[1],columnNumber=_extractLocation$4[2];let method=location&&sanitizedLine||"";let file=url&&["eval",""].includes(url)?void 0:url;if(!file||!lineNumber||!columnNumber)return null;if(method.startsWith("async "))method=method.slice(6);if(file.startsWith("file://"))file=file.slice(7);file=resolve$2(file);if(method)method=method.replace(/__vite_ssr_import_\\d+__\\./g,"");return{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}const fnMap=/* @__PURE__ */new WeakMap();const fixtureMap=/* @__PURE__ */new WeakMap();const hooksMap=/* @__PURE__ */new WeakMap();function setFn(key,fn){fnMap.set(key,fn);}function setFixture(key,fixture){fixtureMap.set(key,fixture);}function getFixture(key){return fixtureMap.get(key);}function setHooks(key,hooks){hooksMap.set(key,hooks);}function getHooks(key){return hooksMap.get(key);}class PendingError extends Error{constructor(message,task){super(message);this.message=message;this.taskId=task.id;}code="VITEST_PENDING";taskId;}const collectorContext={tasks:[],currentSuite:null};function collectTask(task){var _a;(_a=collectorContext.currentSuite)==null?void 0:_a.tasks.push(task);}async function runWithSuite(suite,fn){const prev=collectorContext.currentSuite;collectorContext.currentSuite=suite;await fn();collectorContext.currentSuite=prev;}function withTimeout(fn,timeout,isHook=false){if(timeout<=0||timeout===Number.POSITIVE_INFINITY)return fn;const _getSafeTimers=getSafeTimers(),setTimeout=_getSafeTimers.setTimeout,clearTimeout=_getSafeTimers.clearTimeout;return(...args)=>{return Promise.race([fn(...args),new Promise((resolve,reject)=>{var _a;const timer=setTimeout(()=>{clearTimeout(timer);reject(new Error(makeTimeoutMsg(isHook,timeout)));},timeout);(_a=timer.unref)==null?void 0:_a.call(timer);})]);};}function createTestContext(test,runner){var _a;const context=function(){throw new Error("done() callback is deprecated, use promise instead");};context.task=test;context.skip=()=>{test.pending=true;throw new PendingError("test is skipped; abort execution",test);};context.onTestFailed=fn=>{test.onFailed||(test.onFailed=[]);test.onFailed.push(fn);};context.onTestFinished=fn=>{test.onFinished||(test.onFinished=[]);test.onFinished.push(fn);};return((_a=runner.extendTaskContext)==null?void 0:_a.call(runner,context))||context;}function makeTimeoutMsg(isHook,timeout){return\`\${isHook?"Hook":"Test"} timed out in \${timeout}ms. +If this is a long-running \${isHook?"hook":"test"}, pass a timeout value as the last argument or configure it globally with "\${isHook?"hookTimeout":"testTimeout"}".\`;}function mergeContextFixtures(fixtures,context={}){const fixtureOptionKeys=["auto"];const fixtureArray=Object.entries(fixtures).map(([prop,value])=>{const fixtureItem={value};if(Array.isArray(value)&&value.length>=2&&isObject$1(value[1])&&Object.keys(value[1]).some(key=>fixtureOptionKeys.includes(key))){Object.assign(fixtureItem,value[1]);fixtureItem.value=value[0];}fixtureItem.prop=prop;fixtureItem.isFn=typeof fixtureItem.value==="function";return fixtureItem;});if(Array.isArray(context.fixtures))context.fixtures=context.fixtures.concat(fixtureArray);else context.fixtures=fixtureArray;fixtureArray.forEach(fixture=>{if(fixture.isFn){const usedProps=getUsedProps(fixture.value);if(usedProps.length)fixture.deps=context.fixtures.filter(({prop})=>prop!==fixture.prop&&usedProps.includes(prop));}});return context;}const fixtureValueMaps=/* @__PURE__ */new Map();const cleanupFnArrayMap=/* @__PURE__ */new Map();function withFixtures(fn,testContext){return hookContext=>{const context=hookContext||testContext;if(!context)return fn({});const fixtures=getFixture(context);if(!(fixtures==null?void 0:fixtures.length))return fn(context);const usedProps=getUsedProps(fn);const hasAutoFixture=fixtures.some(({auto})=>auto);if(!usedProps.length&&!hasAutoFixture)return fn(context);if(!fixtureValueMaps.get(context))fixtureValueMaps.set(context,/* @__PURE__ */new Map());const fixtureValueMap=fixtureValueMaps.get(context);if(!cleanupFnArrayMap.has(context))cleanupFnArrayMap.set(context,[]);const cleanupFnArray=cleanupFnArrayMap.get(context);const usedFixtures=fixtures.filter(({prop,auto})=>auto||usedProps.includes(prop));const pendingFixtures=resolveDeps(usedFixtures);if(!pendingFixtures.length)return fn(context);async function resolveFixtures(){for(const fixture of pendingFixtures){if(fixtureValueMap.has(fixture))continue;const resolvedValue=fixture.isFn?await resolveFixtureFunction(fixture.value,context,cleanupFnArray):fixture.value;context[fixture.prop]=resolvedValue;fixtureValueMap.set(fixture,resolvedValue);cleanupFnArray.unshift(()=>{fixtureValueMap.delete(fixture);});}}return resolveFixtures().then(()=>fn(context));};}async function resolveFixtureFunction(fixtureFn,context,cleanupFnArray){const useFnArgPromise=createDefer();let isUseFnArgResolved=false;const fixtureReturn=fixtureFn(context,async useFnArg=>{isUseFnArgResolved=true;useFnArgPromise.resolve(useFnArg);const useReturnPromise=createDefer();cleanupFnArray.push(async()=>{useReturnPromise.resolve();await fixtureReturn;});await useReturnPromise;}).catch(e=>{if(!isUseFnArgResolved){useFnArgPromise.reject(e);return;}throw e;});return useFnArgPromise;}function resolveDeps(fixtures,depSet=/* @__PURE__ */new Set(),pendingFixtures=[]){fixtures.forEach(fixture=>{if(pendingFixtures.includes(fixture))return;if(!fixture.isFn||!fixture.deps){pendingFixtures.push(fixture);return;}if(depSet.has(fixture))throw new Error(\`Circular fixture dependency detected: \${fixture.prop} <- \${[...depSet].reverse().map(d=>d.prop).join(" <- ")}\`);depSet.add(fixture);resolveDeps(fixture.deps,depSet,pendingFixtures);pendingFixtures.push(fixture);depSet.clear();});return pendingFixtures;}function getUsedProps(fn){const match=fn.toString().match(/[^(]*\\(([^)]*)/);if(!match)return[];const args=splitByComma(match[1]);if(!args.length)return[];const first=args[0];if(!(first.startsWith("{")&&first.endsWith("}")))throw new Error(\`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "\${first}".\`);const _first=first.slice(1,-1).replace(/\\s/g,"");const props=splitByComma(_first).map(prop=>{return prop.replace(/\\:.*|\\=.*/g,"");});const last=props.at(-1);if(last&&last.startsWith("..."))throw new Error(\`Rest parameters are not supported in fixtures, received "\${last}".\`);return props;}function splitByComma(s){const result=[];const stack=[];let start=0;for(let i=0;i{};if(typeof optionsOrTest==="object"){if(typeof optionsOrFn==="object")throw new TypeError("Cannot use two objects as arguments. Please provide options and a function callback in that order.");options=optionsOrTest;}else if(typeof optionsOrTest==="number"){options={timeout:optionsOrTest};}else if(typeof optionsOrFn==="object"){options=optionsOrFn;}if(typeof optionsOrFn==="function"){if(typeof optionsOrTest==="function")throw new TypeError("Cannot use two functions as arguments. Please use the second argument for options.");fn=optionsOrFn;}else if(typeof optionsOrTest==="function"){fn=optionsOrTest;}return{options,handler:fn};}function createSuiteCollector(name,factory=()=>{},mode,shuffle,each,suiteOptions){const tasks=[];const factoryQueue=[];let suite2;initSuite();const task=function(name2="",options={}){const task2={id:"",name:name2,suite:void 0,each:options.each,fails:options.fails,context:void 0,type:"custom",retry:options.retry??runner.config.retry,repeats:options.repeats,mode:options.only?"only":options.skip?"skip":options.todo?"todo":"run",meta:options.meta??/* @__PURE__ */Object.create(null)};const handler=options.handler;if(options.concurrent||!options.sequential&&runner.config.sequence.concurrent)task2.concurrent=true;if(shuffle)task2.shuffle=true;const context=createTestContext(task2,runner);Object.defineProperty(task2,"context",{value:context,enumerable:false});setFixture(context,options.fixtures);if(handler){setFn(task2,withTimeout(withFixtures(handler,context),(options==null?void 0:options.timeout)??runner.config.testTimeout));}if(runner.config.includeTaskLocation);tasks.push(task2);return task2;};const test2=createTest(function(name2,optionsOrFn,optionsOrTest){let _parseArguments=parseArguments(optionsOrFn,optionsOrTest),options=_parseArguments.options,handler=_parseArguments.handler;if(typeof suiteOptions==="object")options=Object.assign({},suiteOptions,options);options.concurrent=this.concurrent||!this.sequential&&(options==null?void 0:options.concurrent);options.sequential=this.sequential||!this.concurrent&&(options==null?void 0:options.sequential);const test3=task(formatName(name2),_objectSpread(_objectSpread(_objectSpread({},this),options),{},{handler}));test3.type="test";});const collector={type:"collector",name,mode,options:suiteOptions,test:test2,tasks,collect,task,clear,on:addHook};function addHook(name2,...fn){getHooks(suite2)[name2].push(...fn);}function initSuite(includeLocation){if(typeof suiteOptions==="number")suiteOptions={timeout:suiteOptions};suite2={id:"",type:"suite",name,mode,each,shuffle,tasks:[],meta:/* @__PURE__ */Object.create(null),projectName:""};setHooks(suite2,createSuiteHooks());}function clear(){tasks.length=0;factoryQueue.length=0;initSuite();}async function collect(file){factoryQueue.length=0;if(factory)await runWithSuite(collector,()=>factory(test2));const allChildren=[];for(const i of[...factoryQueue,...tasks])allChildren.push(i.type==="collector"?await i.collect(file):i);suite2.file=file;suite2.tasks=allChildren;allChildren.forEach(task2=>{task2.suite=suite2;if(file)task2.file=file;});return suite2;}collectTask(collector);return collector;}function createSuite(){function suiteFn(name,factoryOrOptions,optionsOrFactory={}){const mode=this.only?"only":this.skip?"skip":this.todo?"todo":"run";const currentSuite=getCurrentSuite();let _parseArguments2=parseArguments(factoryOrOptions,optionsOrFactory),options=_parseArguments2.options,factory=_parseArguments2.handler;if(currentSuite==null?void 0:currentSuite.options)options=_objectSpread(_objectSpread({},currentSuite.options),options);options.concurrent=this.concurrent||!this.sequential&&(options==null?void 0:options.concurrent);options.sequential=this.sequential||!this.concurrent&&(options==null?void 0:options.sequential);return createSuiteCollector(formatName(name),factory,mode,this.shuffle,this.each,options);}suiteFn.each=function(cases,...args){const suite2=this.withContext();this.setContext("each",true);if(Array.isArray(cases)&&args.length)cases=formatTemplateString(cases,args);return(name,optionsOrFn,fnOrOptions)=>{const _name=formatName(name);const arrayOnlyCases=cases.every(Array.isArray);const _parseArguments3=parseArguments(optionsOrFn,fnOrOptions),options=_parseArguments3.options,handler=_parseArguments3.handler;const fnFirst=typeof optionsOrFn==="function";cases.forEach((i,idx)=>{const items=Array.isArray(i)?i:[i];if(fnFirst){arrayOnlyCases?suite2(formatTitle(_name,items,idx),()=>handler(...items),options):suite2(formatTitle(_name,items,idx),()=>handler(i),options);}else{arrayOnlyCases?suite2(formatTitle(_name,items,idx),options,()=>handler(...items)):suite2(formatTitle(_name,items,idx),options,()=>handler(i));}});this.setContext("each",void 0);};};suiteFn.skipIf=condition=>condition?suite.skip:suite;suiteFn.runIf=condition=>condition?suite:suite.skip;return createChainable(["concurrent","sequential","shuffle","skip","only","todo"],suiteFn);}function createTaskCollector(fn,context){const taskFn=fn;taskFn.each=function(cases,...args){const test2=this.withContext();this.setContext("each",true);if(Array.isArray(cases)&&args.length)cases=formatTemplateString(cases,args);return(name,optionsOrFn,fnOrOptions)=>{const _name=formatName(name);const arrayOnlyCases=cases.every(Array.isArray);const _parseArguments4=parseArguments(optionsOrFn,fnOrOptions),options=_parseArguments4.options,handler=_parseArguments4.handler;const fnFirst=typeof optionsOrFn==="function";cases.forEach((i,idx)=>{const items=Array.isArray(i)?i:[i];if(fnFirst){arrayOnlyCases?test2(formatTitle(_name,items,idx),()=>handler(...items),options):test2(formatTitle(_name,items,idx),()=>handler(i),options);}else{arrayOnlyCases?test2(formatTitle(_name,items,idx),options,()=>handler(...items)):test2(formatTitle(_name,items,idx),options,()=>handler(i));}});this.setContext("each",void 0);};};taskFn.skipIf=function(condition){return condition?this.skip:this;};taskFn.runIf=function(condition){return condition?this:this.skip;};taskFn.extend=function(fixtures){const _context=mergeContextFixtures(fixtures,context);return createTest(function fn2(name,optionsOrFn,optionsOrTest){getCurrentSuite().test.fn.call(this,formatName(name),optionsOrFn,optionsOrTest);},_context);};const _test=createChainable(["concurrent","sequential","skip","only","todo","fails"],taskFn);if(context)_test.mergeContext(context);return _test;}function createTest(fn,context){return createTaskCollector(fn,context);}function formatName(name){return typeof name==="string"?name:name instanceof Function?name.name||"":String(name);}function formatTitle(template,items,idx){if(template.includes("%#")){template=template.replace(/%%/g,"__vitest_escaped_%__").replace(/%#/g,\`\${idx}\`).replace(/__vitest_escaped_%__/g,"%%");}const count=template.split("%").length-1;let formatted=format(template,...items.slice(0,count));if(isObject$1(items[0])){formatted=formatted.replace(/\\$([$\\w_.]+)/g,// https://github.com/chaijs/chai/pull/1490 (_,key)=>{var _a,_b;return objDisplay$2(objectAttr(items[0],key),{truncate:(_b=(_a=void 0)==null?void 0:_a.chaiConfig)==null?void 0:_b.truncateThreshold});});}return formatted;}function formatTemplateString(cases,args){const header=cases.join("").trim().replace(/ /g,"").split("\\n").map(i=>i.split("|"))[0];const res=[];for(let i=0;i @@ -7959,16 +7976,17 @@ message=actual;actual=undefined;}message=message||'assert.fail()';throw new chai function R(e,t){if(!e)throw new Error(t);}function u(e,t){return typeof t===e;}function b(e){return e instanceof Promise;}function f(e,t,n){Object.defineProperty(e,t,n);}function i(e,t,n){Object.defineProperty(e,t,{value:n});}// src/constants.ts var c=Symbol.for("tinyspy:spy");// src/internal.ts var g=/* @__PURE__ */new Set(),C=e=>{e.called=!1,e.callCount=0,e.calls=[],e.results=[],e.next=[];},M=e=>(f(e,c,{value:{reset:()=>C(e[c])}}),e[c]),A=e=>e[c]||M(e);function I(e){R(u("function",e)||u("undefined",e),"cannot spy on a non-function value");let t=function(...s){let r=A(t);r.called=!0,r.callCount++,r.calls.push(s);let m=r.next.shift();if(m){r.results.push(m);let _m=_slicedToArray(m,2),l=_m[0],o=_m[1];if(l==="ok")return o;throw o;}let p,d="ok";if(r.impl)try{new.target?p=Reflect.construct(r.impl,s,new.target):p=r.impl.apply(this,s),d="ok";}catch(l){throw p=l,d="error",r.results.push([d,l]),l;}let a=[d,p];if(b(p)){let l=p.then(o=>a[1]=o).catch(o=>{throw a[0]="error",a[1]=o,o;});Object.assign(l,p),p=l;}return r.results.push(a),p;};i(t,"_isMockFunction",!0),i(t,"length",e?e.length:0),i(t,"name",e&&e.name||"spy");let n=A(t);return n.reset(),n.impl=e,t;}// src/spyOn.ts -var k=(e,t)=>Object.getOwnPropertyDescriptor(e,t),P=(e,t)=>{t!=null&&typeof t=="function"&&t.prototype!=null&&Object.setPrototypeOf(e.prototype,t.prototype);};function E(e,t,n){R(!u("undefined",e),"spyOn could not find an object to spy upon"),R(u("object",e)||u("function",e),"cannot spyOn on a primitive value");let _ref9=(()=>{if(!u("object",t))return[t,"value"];if("getter"in t&&"setter"in t)throw new Error("cannot spy on both getter and setter");if("getter"in t)return[t.getter,"get"];if("setter"in t)return[t.setter,"set"];throw new Error("specify getter or setter to spy on");})(),_ref10=_slicedToArray(_ref9,2),s=_ref10[0],r=_ref10[1],m=k(e,s),p=Object.getPrototypeOf(e),d=p&&k(p,s),a=m||d;R(a||s in e,\`\${String(s)} does not exist\`);let l=!1;r==="value"&&a&&!a.value&&a.get&&(r="get",l=!0,n=a.get());let o;a?o=a[r]:r!=="value"?o=()=>e[s]:o=e[s],n||(n=o);let y=I(n);r==="value"&&P(y,o);let O=h=>{let _ref11=a||{configurable:!0,writable:!0},G=_ref11.value,w=_objectWithoutProperties(_ref11,_excluded2);r!=="value"&&delete w.writable,w[r]=h,f(e,s,w);},K=()=>a?f(e,s,a):O(o),T=y[c];return i(T,"restore",K),i(T,"getOriginal",()=>l?o():o),i(T,"willCall",h=>(T.impl=h,y)),O(l?()=>(P(y,n),y):y),g.add(y),y;}const mocks=/* @__PURE__ */new Set();function isMockFunction(fn2){return typeof fn2==="function"&&"_isMockFunction"in fn2&&fn2._isMockFunction;}function spyOn(obj,method,accessType){const dictionary={get:"getter",set:"setter"};const objMethod=accessType?{[dictionary[accessType]]:method}:method;const stub=E(obj,objMethod);return enhanceSpy(stub);}let callOrder=0;function enhanceSpy(spy){const stub=spy;let implementation;let instances=[];let invocations=[];const state=A(spy);const mockContext={get calls(){return state.calls;},get instances(){return instances;},get invocationCallOrder(){return invocations;},get results(){return state.results.map(([callType,value])=>{const type=callType==="error"?"throw":"return";return{type,value};});},get lastCall(){return state.calls[state.calls.length-1];}};let onceImplementations=[];let implementationChangedTemporarily=false;function mockCall(...args){instances.push(this);invocations.push(++callOrder);const impl=implementationChangedTemporarily?implementation:onceImplementations.shift()||implementation||state.getOriginal()||(()=>{});return impl.apply(this,args);}let name=stub.name;stub.getMockName=()=>name||"vi.fn()";stub.mockName=n=>{name=n;return stub;};stub.mockClear=()=>{state.reset();instances=[];invocations=[];return stub;};stub.mockReset=()=>{stub.mockClear();implementation=()=>void 0;onceImplementations=[];return stub;};stub.mockRestore=()=>{stub.mockReset();state.restore();implementation=void 0;return stub;};stub.getMockImplementation=()=>implementation;stub.mockImplementation=fn2=>{implementation=fn2;state.willCall(mockCall);return stub;};stub.mockImplementationOnce=fn2=>{onceImplementations.push(fn2);return stub;};function withImplementation(fn2,cb){const originalImplementation=implementation;implementation=fn2;state.willCall(mockCall);implementationChangedTemporarily=true;const reset=()=>{implementation=originalImplementation;implementationChangedTemporarily=false;};const result=cb();if(result instanceof Promise){return result.then(()=>{reset();return stub;});}reset();return stub;}stub.withImplementation=withImplementation;stub.mockReturnThis=()=>stub.mockImplementation(function(){return this;});stub.mockReturnValue=val=>stub.mockImplementation(()=>val);stub.mockReturnValueOnce=val=>stub.mockImplementationOnce(()=>val);stub.mockResolvedValue=val=>stub.mockImplementation(()=>Promise.resolve(val));stub.mockResolvedValueOnce=val=>stub.mockImplementationOnce(()=>Promise.resolve(val));stub.mockRejectedValue=val=>stub.mockImplementation(()=>Promise.reject(val));stub.mockRejectedValueOnce=val=>stub.mockImplementationOnce(()=>Promise.reject(val));Object.defineProperty(stub,"mock",{get:()=>mockContext});state.willCall(mockCall);mocks.add(stub);return stub;}function fn(implementation){const enhancedSpy=enhanceSpy(E({spy:implementation||(()=>{})},"spy"));if(implementation)enhancedSpy.mockImplementation(implementation);return enhancedSpy;}const MATCHERS_OBJECT$1=Symbol.for("matchers-object");const JEST_MATCHERS_OBJECT$1=Symbol.for("$$jest-matchers-object");const GLOBAL_EXPECT$1=Symbol.for("expect-global");const ASYMMETRIC_MATCHERS_OBJECT$1=Symbol.for("asymmetric-matchers-object");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT$1)){const globalState=/* @__PURE__ */new WeakMap();const matchers=/* @__PURE__ */Object.create(null);const customEqualityTesters=[];const assymetricMatchers=/* @__PURE__ */Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT$1,{get:()=>globalState});Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT$1,{configurable:true,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT$1]),matchers,customEqualityTesters})});Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT$1,{get:()=>assymetricMatchers});}function getState(expect){return globalThis[MATCHERS_OBJECT$1].get(expect);}function setState(state,expect){const map=globalThis[MATCHERS_OBJECT$1];const current=map.get(expect)||{};Object.assign(current,state);map.set(expect,current);}function getMatcherUtils(){const c=()=>getColors();const EXPECTED_COLOR=c().green;const RECEIVED_COLOR=c().red;const INVERTED_COLOR=c().inverse;const BOLD_WEIGHT=c().bold;const DIM_COLOR=c().dim;function matcherHint(matcherName,received="received",expected="expected",options={}){const _options$comment=options.comment,comment=_options$comment===void 0?"":_options$comment,_options$isDirectExpe=options.isDirectExpectCall,isDirectExpectCall=_options$isDirectExpe===void 0?false:_options$isDirectExpe,_options$isNot=options.isNot,isNot=_options$isNot===void 0?false:_options$isNot,_options$promise=options.promise,promise=_options$promise===void 0?"":_options$promise,_options$secondArgume=options.secondArgument,secondArgument=_options$secondArgume===void 0?"":_options$secondArgume,_options$expectedColo=options.expectedColor,expectedColor=_options$expectedColo===void 0?EXPECTED_COLOR:_options$expectedColo,_options$receivedColo=options.receivedColor,receivedColor=_options$receivedColo===void 0?RECEIVED_COLOR:_options$receivedColo,_options$secondArgume2=options.secondArgumentColor,secondArgumentColor=_options$secondArgume2===void 0?EXPECTED_COLOR:_options$secondArgume2;let hint="";let dimString="expect";if(!isDirectExpectCall&&received!==""){hint+=DIM_COLOR(\`\${dimString}(\`)+receivedColor(received);dimString=")";}if(promise!==""){hint+=DIM_COLOR(\`\${dimString}.\`)+promise;dimString="";}if(isNot){hint+=\`\${DIM_COLOR(\`\${dimString}.\`)}not\`;dimString="";}if(matcherName.includes(".")){dimString+=matcherName;}else{hint+=DIM_COLOR(\`\${dimString}.\`)+matcherName;dimString="";}if(expected===""){dimString+="()";}else{hint+=DIM_COLOR(\`\${dimString}(\`)+expectedColor(expected);if(secondArgument)hint+=DIM_COLOR(", ")+secondArgumentColor(secondArgument);dimString=")";}if(comment!=="")dimString+=\` // \${comment}\`;if(dimString!=="")hint+=DIM_COLOR(dimString);return hint;}const SPACE_SYMBOL="\\xB7";const replaceTrailingSpaces=text=>text.replace(/\\s+$/gm,spaces=>SPACE_SYMBOL.repeat(spaces.length));const printReceived=object=>RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)));const printExpected=value=>EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)));return{EXPECTED_COLOR,RECEIVED_COLOR,INVERTED_COLOR,BOLD_WEIGHT,DIM_COLOR,matcherHint,printReceived,printExpected};}function addCustomEqualityTesters(newTesters){if(!Array.isArray(newTesters)){throw new TypeError(\`expect.customEqualityTesters: Must be set to an array of Testers. Was given "\${getType$2(newTesters)}"\`);}globalThis[JEST_MATCHERS_OBJECT$1].customEqualityTesters.push(...newTesters);}function getCustomEqualityTesters(){return globalThis[JEST_MATCHERS_OBJECT$1].customEqualityTesters;}function equals(a,b,customTesters,strictCheck){customTesters=customTesters||[];return eq(a,b,[],[],customTesters,strictCheck?hasKey:hasDefinedKey);}function isAsymmetric(obj){return!!obj&&typeof obj==="object"&&"asymmetricMatch"in obj&&isA("Function",obj.asymmetricMatch);}function asymmetricMatch(a,b){const asymmetricA=isAsymmetric(a);const asymmetricB=isAsymmetric(b);if(asymmetricA&&asymmetricB)return void 0;if(asymmetricA)return a.asymmetricMatch(b);if(asymmetricB)return b.asymmetricMatch(a);}function eq(a,b,aStack,bStack,customTesters,hasKey2){let result=true;const asymmetricResult=asymmetricMatch(a,b);if(asymmetricResult!==void 0)return asymmetricResult;const testerContext={equals};for(let i=0;iObject.getOwnPropertyDescriptor(obj,symbol).enumerable));}function hasDefinedKey(obj,key){return hasKey(obj,key)&&obj[key]!==void 0;}function hasKey(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}function isA(typeName,value){return Object.prototype.toString.apply(value)===\`[object \${typeName}]\`;}function isDomNode(obj){return obj!==null&&typeof obj==="object"&&"nodeType"in obj&&typeof obj.nodeType==="number"&&"nodeName"in obj&&typeof obj.nodeName==="string"&&"isEqualNode"in obj&&typeof obj.isEqualNode==="function";}const IS_KEYED_SENTINEL="@@__IMMUTABLE_KEYED__@@";const IS_SET_SENTINEL="@@__IMMUTABLE_SET__@@";const IS_ORDERED_SENTINEL="@@__IMMUTABLE_ORDERED__@@";function isImmutableUnorderedKeyed(maybeKeyed){return!!(maybeKeyed&&maybeKeyed[IS_KEYED_SENTINEL]&&!maybeKeyed[IS_ORDERED_SENTINEL]);}function isImmutableUnorderedSet(maybeSet){return!!(maybeSet&&maybeSet[IS_SET_SENTINEL]&&!maybeSet[IS_ORDERED_SENTINEL]);}const IteratorSymbol=Symbol.iterator;function hasIterator(object){return!!(object!=null&&object[IteratorSymbol]);}function iterableEquality(a,b,customTesters=[],aStack=[],bStack=[]){if(typeof a!=="object"||typeof b!=="object"||Array.isArray(a)||Array.isArray(b)||!hasIterator(a)||!hasIterator(b))return void 0;if(a.constructor!==b.constructor)return false;let length=aStack.length;while(length--){if(aStack[length]===a)return bStack[length]===b;}aStack.push(a);bStack.push(b);const filteredCustomTesters=[...customTesters.filter(t=>t!==iterableEquality),iterableEqualityWithStack];function iterableEqualityWithStack(a2,b2){return iterableEquality(a2,b2,[...filteredCustomTesters],[...aStack],[...bStack]);}if(a.size!==void 0){if(a.size!==b.size){return false;}else if(isA("Set",a)||isImmutableUnorderedSet(a)){let allFound=true;for(const aValue of a){if(!b.has(aValue)){let has=false;for(const bValue of b){const isEqual=equals(aValue,bValue,filteredCustomTesters);if(isEqual===true)has=true;}if(has===false){allFound=false;break;}}}aStack.pop();bStack.pop();return allFound;}else if(isA("Map",a)||isImmutableUnorderedKeyed(a)){let allFound=true;for(const aEntry of a){if(!b.has(aEntry[0])||!equals(aEntry[1],b.get(aEntry[0]),filteredCustomTesters)){let has=false;for(const bEntry of b){const matchedKey=equals(aEntry[0],bEntry[0],filteredCustomTesters);let matchedValue=false;if(matchedKey===true)matchedValue=equals(aEntry[1],bEntry[1],filteredCustomTesters);if(matchedValue===true)has=true;}if(has===false){allFound=false;break;}}}aStack.pop();bStack.pop();return allFound;}}const bIterator=b[IteratorSymbol]();for(const aValue of a){const nextB=bIterator.next();if(nextB.done||!equals(aValue,nextB.value,filteredCustomTesters))return false;}if(!bIterator.next().done)return false;aStack.pop();bStack.pop();return true;}function hasPropertyInObject(object,key){const shouldTerminate=!object||typeof object!=="object"||object===Object.prototype;if(shouldTerminate)return false;return Object.prototype.hasOwnProperty.call(object,key)||hasPropertyInObject(Object.getPrototypeOf(object),key);}function isObjectWithKeys(a){return isObject$1(a)&&!(a instanceof Error)&&!Array.isArray(a)&&!(a instanceof Date);}function subsetEquality(object,subset,customTesters=[]){const filteredCustomTesters=customTesters.filter(t=>t!==subsetEquality);const subsetEqualityWithContext=(seenReferences=/* @__PURE__ */new WeakMap())=>(object2,subset2)=>{if(!isObjectWithKeys(subset2))return void 0;return Object.keys(subset2).every(key=>{if(isObjectWithKeys(subset2[key])){if(seenReferences.has(subset2[key]))return equals(object2[key],subset2[key],filteredCustomTesters);seenReferences.set(subset2[key],true);}const result=object2!=null&&hasPropertyInObject(object2,key)&&equals(object2[key],subset2[key],[...filteredCustomTesters,subsetEqualityWithContext(seenReferences)]);seenReferences.delete(subset2[key]);return result;});};return subsetEqualityWithContext()(object,subset);}function typeEquality(a,b){if(a==null||b==null||a.constructor===b.constructor)return void 0;return false;}function arrayBufferEquality(a,b){let dataViewA=a;let dataViewB=b;if(!(a instanceof DataView&&b instanceof DataView)){if(!(a instanceof ArrayBuffer)||!(b instanceof ArrayBuffer))return void 0;try{dataViewA=new DataView(a);dataViewB=new DataView(b);}catch{return void 0;}}if(dataViewA.byteLength!==dataViewB.byteLength)return false;for(let i=0;it!==sparseArrayEquality);return equals(a,b,filteredCustomTesters,true)&&equals(aKeys,bKeys);}function generateToBeMessage(deepEqualityName,expected="#{this}",actual="#{exp}"){const toBeMessage=\`expected \${expected} to be \${actual} // Object.is equality\`;if(["toStrictEqual","toEqual"].includes(deepEqualityName))return\`\${toBeMessage} +var k=(e,t)=>Object.getOwnPropertyDescriptor(e,t),P=(e,t)=>{t!=null&&typeof t=="function"&&t.prototype!=null&&Object.setPrototypeOf(e.prototype,t.prototype);};function E(e,t,n){R(!u("undefined",e),"spyOn could not find an object to spy upon"),R(u("object",e)||u("function",e),"cannot spyOn on a primitive value");let _ref9=(()=>{if(!u("object",t))return[t,"value"];if("getter"in t&&"setter"in t)throw new Error("cannot spy on both getter and setter");if("getter"in t)return[t.getter,"get"];if("setter"in t)return[t.setter,"set"];throw new Error("specify getter or setter to spy on");})(),_ref10=_slicedToArray(_ref9,2),s=_ref10[0],r=_ref10[1],m=k(e,s),p=Object.getPrototypeOf(e),d=p&&k(p,s),a=m||d;R(a||s in e,\`\${String(s)} does not exist\`);let l=!1;r==="value"&&a&&!a.value&&a.get&&(r="get",l=!0,n=a.get());let o;a?o=a[r]:r!=="value"?o=()=>e[s]:o=e[s],n||(n=o);let y=I(n);r==="value"&&P(y,o);let O=h=>{let _ref11=a||{configurable:!0,writable:!0},G=_ref11.value,w=_objectWithoutProperties(_ref11,_excluded2);r!=="value"&&delete w.writable,w[r]=h,f(e,s,w);},K=()=>a?f(e,s,a):O(o),T=y[c];return i(T,"restore",K),i(T,"getOriginal",()=>l?o():o),i(T,"willCall",h=>(T.impl=h,y)),O(l?()=>(P(y,n),y):y),g.add(y),y;}const mocks=/* @__PURE__ */new Set();function isMockFunction(fn2){return typeof fn2==="function"&&"_isMockFunction"in fn2&&fn2._isMockFunction;}function spyOn(obj,method,accessType){const dictionary={get:"getter",set:"setter"};const objMethod=accessType?{[dictionary[accessType]]:method}:method;const stub=E(obj,objMethod);return enhanceSpy(stub);}let callOrder=0;function enhanceSpy(spy){const stub=spy;let implementation;let instances=[];let invocations=[];const state=A(spy);const mockContext={get calls(){return state.calls;},get instances(){return instances;},get invocationCallOrder(){return invocations;},get results(){return state.results.map(([callType,value])=>{const type=callType==="error"?"throw":"return";return{type,value};});},get lastCall(){return state.calls[state.calls.length-1];}};let onceImplementations=[];let implementationChangedTemporarily=false;function mockCall(...args){instances.push(this);invocations.push(++callOrder);const impl=implementationChangedTemporarily?implementation:onceImplementations.shift()||implementation||state.getOriginal()||(()=>{});return impl.apply(this,args);}let name=stub.name;stub.getMockName=()=>name||"vi.fn()";stub.mockName=n=>{name=n;return stub;};stub.mockClear=()=>{state.reset();instances=[];invocations=[];return stub;};stub.mockReset=()=>{stub.mockClear();implementation=()=>void 0;onceImplementations=[];return stub;};stub.mockRestore=()=>{stub.mockReset();state.restore();implementation=void 0;return stub;};stub.getMockImplementation=()=>implementation;stub.mockImplementation=fn2=>{implementation=fn2;state.willCall(mockCall);return stub;};stub.mockImplementationOnce=fn2=>{onceImplementations.push(fn2);return stub;};function withImplementation(fn2,cb){const originalImplementation=implementation;implementation=fn2;state.willCall(mockCall);implementationChangedTemporarily=true;const reset=()=>{implementation=originalImplementation;implementationChangedTemporarily=false;};const result=cb();if(result instanceof Promise){return result.then(()=>{reset();return stub;});}reset();return stub;}stub.withImplementation=withImplementation;stub.mockReturnThis=()=>stub.mockImplementation(function(){return this;});stub.mockReturnValue=val=>stub.mockImplementation(()=>val);stub.mockReturnValueOnce=val=>stub.mockImplementationOnce(()=>val);stub.mockResolvedValue=val=>stub.mockImplementation(()=>Promise.resolve(val));stub.mockResolvedValueOnce=val=>stub.mockImplementationOnce(()=>Promise.resolve(val));stub.mockRejectedValue=val=>stub.mockImplementation(()=>Promise.reject(val));stub.mockRejectedValueOnce=val=>stub.mockImplementationOnce(()=>Promise.reject(val));Object.defineProperty(stub,"mock",{get:()=>mockContext});state.willCall(mockCall);mocks.add(stub);return stub;}function fn(implementation){const enhancedSpy=enhanceSpy(E({spy:implementation||(()=>{})},"spy"));if(implementation)enhancedSpy.mockImplementation(implementation);return enhancedSpy;}const MATCHERS_OBJECT$1=Symbol.for("matchers-object");const JEST_MATCHERS_OBJECT$1=Symbol.for("$$jest-matchers-object");const GLOBAL_EXPECT$1=Symbol.for("expect-global");const ASYMMETRIC_MATCHERS_OBJECT$1=Symbol.for("asymmetric-matchers-object");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT$1)){const globalState=/* @__PURE__ */new WeakMap();const matchers=/* @__PURE__ */Object.create(null);const customEqualityTesters=[];const assymetricMatchers=/* @__PURE__ */Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT$1,{get:()=>globalState});Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT$1,{configurable:true,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT$1]),matchers,customEqualityTesters})});Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT$1,{get:()=>assymetricMatchers});}function getState(expect){return globalThis[MATCHERS_OBJECT$1].get(expect);}function setState(state,expect){const map=globalThis[MATCHERS_OBJECT$1];const current=map.get(expect)||{};Object.assign(current,state);map.set(expect,current);}function getMatcherUtils(){const c=()=>getColors();const EXPECTED_COLOR=c().green;const RECEIVED_COLOR=c().red;const INVERTED_COLOR=c().inverse;const BOLD_WEIGHT=c().bold;const DIM_COLOR=c().dim;function matcherHint(matcherName,received="received",expected="expected",options={}){const _options$comment=options.comment,comment=_options$comment===void 0?"":_options$comment,_options$isDirectExpe=options.isDirectExpectCall,isDirectExpectCall=_options$isDirectExpe===void 0?false:_options$isDirectExpe,_options$isNot=options.isNot,isNot=_options$isNot===void 0?false:_options$isNot,_options$promise=options.promise,promise=_options$promise===void 0?"":_options$promise,_options$secondArgume=options.secondArgument,secondArgument=_options$secondArgume===void 0?"":_options$secondArgume,_options$expectedColo=options.expectedColor,expectedColor=_options$expectedColo===void 0?EXPECTED_COLOR:_options$expectedColo,_options$receivedColo=options.receivedColor,receivedColor=_options$receivedColo===void 0?RECEIVED_COLOR:_options$receivedColo,_options$secondArgume2=options.secondArgumentColor,secondArgumentColor=_options$secondArgume2===void 0?EXPECTED_COLOR:_options$secondArgume2;let hint="";let dimString="expect";if(!isDirectExpectCall&&received!==""){hint+=DIM_COLOR(\`\${dimString}(\`)+receivedColor(received);dimString=")";}if(promise!==""){hint+=DIM_COLOR(\`\${dimString}.\`)+promise;dimString="";}if(isNot){hint+=\`\${DIM_COLOR(\`\${dimString}.\`)}not\`;dimString="";}if(matcherName.includes(".")){dimString+=matcherName;}else{hint+=DIM_COLOR(\`\${dimString}.\`)+matcherName;dimString="";}if(expected===""){dimString+="()";}else{hint+=DIM_COLOR(\`\${dimString}(\`)+expectedColor(expected);if(secondArgument)hint+=DIM_COLOR(", ")+secondArgumentColor(secondArgument);dimString=")";}if(comment!=="")dimString+=\` // \${comment}\`;if(dimString!=="")hint+=DIM_COLOR(dimString);return hint;}const SPACE_SYMBOL="\\xB7";const replaceTrailingSpaces=text=>text.replace(/\\s+$/gm,spaces=>SPACE_SYMBOL.repeat(spaces.length));const printReceived=object=>RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)));const printExpected=value=>EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)));return{EXPECTED_COLOR,RECEIVED_COLOR,INVERTED_COLOR,BOLD_WEIGHT,DIM_COLOR,matcherHint,printReceived,printExpected};}function addCustomEqualityTesters(newTesters){if(!Array.isArray(newTesters)){throw new TypeError(\`expect.customEqualityTesters: Must be set to an array of Testers. Was given "\${getType$2(newTesters)}"\`);}globalThis[JEST_MATCHERS_OBJECT$1].customEqualityTesters.push(...newTesters);}function getCustomEqualityTesters(){return globalThis[JEST_MATCHERS_OBJECT$1].customEqualityTesters;}function equals(a,b,customTesters,strictCheck){customTesters=customTesters||[];return eq(a,b,[],[],customTesters,strictCheck?hasKey:hasDefinedKey);}function isAsymmetric(obj){return!!obj&&typeof obj==="object"&&"asymmetricMatch"in obj&&isA("Function",obj.asymmetricMatch);}function asymmetricMatch(a,b){const asymmetricA=isAsymmetric(a);const asymmetricB=isAsymmetric(b);if(asymmetricA&&asymmetricB)return void 0;if(asymmetricA)return a.asymmetricMatch(b);if(asymmetricB)return b.asymmetricMatch(a);}function eq(a,b,aStack,bStack,customTesters,hasKey2){let result=true;const asymmetricResult=asymmetricMatch(a,b);if(asymmetricResult!==void 0)return asymmetricResult;const testerContext={equals};for(let i=0;iObject.getOwnPropertyDescriptor(obj,symbol).enumerable));}function hasDefinedKey(obj,key){return hasKey(obj,key)&&obj[key]!==void 0;}function hasKey(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}function isA(typeName,value){return Object.prototype.toString.apply(value)===\`[object \${typeName}]\`;}function isDomNode(obj){return obj!==null&&typeof obj==="object"&&"nodeType"in obj&&typeof obj.nodeType==="number"&&"nodeName"in obj&&typeof obj.nodeName==="string"&&"isEqualNode"in obj&&typeof obj.isEqualNode==="function";}const IS_KEYED_SENTINEL="@@__IMMUTABLE_KEYED__@@";const IS_SET_SENTINEL="@@__IMMUTABLE_SET__@@";const IS_ORDERED_SENTINEL="@@__IMMUTABLE_ORDERED__@@";function isImmutableUnorderedKeyed(maybeKeyed){return!!(maybeKeyed&&maybeKeyed[IS_KEYED_SENTINEL]&&!maybeKeyed[IS_ORDERED_SENTINEL]);}function isImmutableUnorderedSet(maybeSet){return!!(maybeSet&&maybeSet[IS_SET_SENTINEL]&&!maybeSet[IS_ORDERED_SENTINEL]);}const IteratorSymbol=Symbol.iterator;function hasIterator(object){return!!(object!=null&&object[IteratorSymbol]);}function iterableEquality(a,b,customTesters=[],aStack=[],bStack=[]){if(typeof a!=="object"||typeof b!=="object"||Array.isArray(a)||Array.isArray(b)||!hasIterator(a)||!hasIterator(b))return void 0;if(a.constructor!==b.constructor)return false;let length=aStack.length;while(length--){if(aStack[length]===a)return bStack[length]===b;}aStack.push(a);bStack.push(b);const filteredCustomTesters=[...customTesters.filter(t=>t!==iterableEquality),iterableEqualityWithStack];function iterableEqualityWithStack(a2,b2){return iterableEquality(a2,b2,[...customTesters],[...aStack],[...bStack]);}if(a.size!==void 0){if(a.size!==b.size){return false;}else if(isA("Set",a)||isImmutableUnorderedSet(a)){let allFound=true;for(const aValue of a){if(!b.has(aValue)){let has=false;for(const bValue of b){const isEqual=equals(aValue,bValue,filteredCustomTesters);if(isEqual===true)has=true;}if(has===false){allFound=false;break;}}}aStack.pop();bStack.pop();return allFound;}else if(isA("Map",a)||isImmutableUnorderedKeyed(a)){let allFound=true;for(const aEntry of a){if(!b.has(aEntry[0])||!equals(aEntry[1],b.get(aEntry[0]),filteredCustomTesters)){let has=false;for(const bEntry of b){const matchedKey=equals(aEntry[0],bEntry[0],filteredCustomTesters);let matchedValue=false;if(matchedKey===true)matchedValue=equals(aEntry[1],bEntry[1],filteredCustomTesters);if(matchedValue===true)has=true;}if(has===false){allFound=false;break;}}}aStack.pop();bStack.pop();return allFound;}}const bIterator=b[IteratorSymbol]();for(const aValue of a){const nextB=bIterator.next();if(nextB.done||!equals(aValue,nextB.value,filteredCustomTesters))return false;}if(!bIterator.next().done)return false;const aEntries=Object.entries(a);const bEntries=Object.entries(b);if(!equals(aEntries,bEntries))return false;aStack.pop();bStack.pop();return true;}function hasPropertyInObject(object,key){const shouldTerminate=!object||typeof object!=="object"||object===Object.prototype;if(shouldTerminate)return false;return Object.prototype.hasOwnProperty.call(object,key)||hasPropertyInObject(Object.getPrototypeOf(object),key);}function isObjectWithKeys(a){return isObject$1(a)&&!(a instanceof Error)&&!Array.isArray(a)&&!(a instanceof Date);}function subsetEquality(object,subset,customTesters=[]){const filteredCustomTesters=customTesters.filter(t=>t!==subsetEquality);const subsetEqualityWithContext=(seenReferences=/* @__PURE__ */new WeakMap())=>(object2,subset2)=>{if(!isObjectWithKeys(subset2))return void 0;return Object.keys(subset2).every(key=>{if(subset2[key]!=null&&typeof subset2[key]==="object"){if(seenReferences.has(subset2[key]))return equals(object2[key],subset2[key],filteredCustomTesters);seenReferences.set(subset2[key],true);}const result=object2!=null&&hasPropertyInObject(object2,key)&&equals(object2[key],subset2[key],[...filteredCustomTesters,subsetEqualityWithContext(seenReferences)]);seenReferences.delete(subset2[key]);return result;});};return subsetEqualityWithContext()(object,subset);}function typeEquality(a,b){if(a==null||b==null||a.constructor===b.constructor)return void 0;return false;}function arrayBufferEquality(a,b){let dataViewA=a;let dataViewB=b;if(!(a instanceof DataView&&b instanceof DataView)){if(!(a instanceof ArrayBuffer)||!(b instanceof ArrayBuffer))return void 0;try{dataViewA=new DataView(a);dataViewB=new DataView(b);}catch{return void 0;}}if(dataViewA.byteLength!==dataViewB.byteLength)return false;for(let i=0;it!==sparseArrayEquality);return equals(a,b,filteredCustomTesters,true)&&equals(aKeys,bKeys);}function generateToBeMessage(deepEqualityName,expected="#{this}",actual="#{exp}"){const toBeMessage=\`expected \${expected} to be \${actual} // Object.is equality\`;if(["toStrictEqual","toEqual"].includes(deepEqualityName))return\`\${toBeMessage} If it should pass with deep equality, replace "toBe" with "\${deepEqualityName}" Expected: \${expected} Received: serializes to the same string -\`;return toBeMessage;}function pluralize(word,count){return\`\${count} \${word}\${count===1?"":"s"}\`;}let AsymmetricMatcher$1=class AsymmetricMatcher{constructor(sample,inverse=false){this.sample=sample;this.inverse=inverse;}// should have "jest" to be compatible with its ecosystem +\`;return toBeMessage;}function pluralize(word,count){return\`\${count} \${word}\${count===1?"":"s"}\`;}function getObjectKeys(object){return[...Object.keys(object),...Object.getOwnPropertySymbols(object).filter(s=>{var _a;return(_a=Object.getOwnPropertyDescriptor(object,s))==null?void 0:_a.enumerable;})];}function getObjectSubset(object,subset,customTesters=[]){let stripped=0;const getObjectSubsetWithContext=(seenReferences=/* @__PURE__ */new WeakMap())=>(object2,subset2)=>{if(Array.isArray(object2)){if(Array.isArray(subset2)&&subset2.length===object2.length){return subset2.map((sub,i)=>getObjectSubsetWithContext(seenReferences)(object2[i],sub));}}else if(object2 instanceof Date){return object2;}else if(isObject$1(object2)&&isObject$1(subset2)){if(equals(object2,subset2,[...customTesters,iterableEquality,subsetEquality])){return subset2;}const trimmed={};seenReferences.set(object2,trimmed);for(const key of getObjectKeys(object2)){if(hasPropertyInObject(subset2,key)){trimmed[key]=seenReferences.has(object2[key])?seenReferences.get(object2[key]):getObjectSubsetWithContext(seenReferences)(object2[key],subset2[key]);}else{if(!seenReferences.has(object2[key])){stripped+=1;if(isObject$1(object2[key]))stripped+=getObjectKeys(object2[key]).length;getObjectSubsetWithContext(seenReferences)(object2[key],subset2[key]);}}}if(getObjectKeys(trimmed).length>0)return trimmed;}return object2;};return{subset:getObjectSubsetWithContext()(object,subset),stripped};}let AsymmetricMatcher$1=class AsymmetricMatcher{constructor(sample,inverse=false){this.sample=sample;this.inverse=inverse;}// should have "jest" to be compatible with its ecosystem $$typeof=Symbol.for("jest.asymmetricMatcher");getMatcherContext(expect){return _objectSpread(_objectSpread({},getState(expect||globalThis[GLOBAL_EXPECT$1])),{},{equals,isNot:this.inverse,customTesters:getCustomEqualityTesters(),utils:_objectSpread(_objectSpread({},getMatcherUtils()),{},{diff,stringify,iterableEquality,subsetEquality})});}// implement custom chai/loupe inspect for better AssertionError.message formatting // https://github.com/chaijs/loupe/blob/9b8a6deabcd50adc056a64fb705896194710c5c6/src/index.ts#L29 -[Symbol.for("chai/inspect")](options){const result=stringify(this,options.depth,{min:true});if(result.length<=options.truncate)return result;return\`\${this.toString()}{\\u2026}\`;}};class StringContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){if(!isA("String",sample))throw new Error("Expected is not a string");super(sample,inverse);}asymmetricMatch(other){const result=isA("String",other)&&other.includes(this.sample);return this.inverse?!result:result;}toString(){return\`String\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"string";}}class Anything extends AsymmetricMatcher$1{asymmetricMatch(other){return other!=null;}toString(){return"Anything";}toAsymmetricMatcher(){return"Anything";}}class ObjectContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){super(sample,inverse);}getPrototype(obj){if(Object.getPrototypeOf)return Object.getPrototypeOf(obj);if(obj.constructor.prototype===obj)return null;return obj.constructor.prototype;}hasProperty(obj,property){if(!obj)return false;if(Object.prototype.hasOwnProperty.call(obj,property))return true;return this.hasProperty(this.getPrototype(obj),property);}asymmetricMatch(other){if(typeof this.sample!=="object"){throw new TypeError(\`You must provide an object to \${this.toString()}, not '\${typeof this.sample}'.\`);}let result=true;const matcherContext=this.getMatcherContext();for(const property in this.sample){if(!this.hasProperty(other,property)||!equals(this.sample[property],other[property],matcherContext.customTesters)){result=false;break;}}return this.inverse?!result:result;}toString(){return\`Object\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"object";}}class ArrayContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){super(sample,inverse);}asymmetricMatch(other){if(!Array.isArray(this.sample)){throw new TypeError(\`You must provide an array to \${this.toString()}, not '\${typeof this.sample}'.\`);}const matcherContext=this.getMatcherContext();const result=this.sample.length===0||Array.isArray(other)&&this.sample.every(item=>other.some(another=>equals(item,another,matcherContext.customTesters)));return this.inverse?!result:result;}toString(){return\`Array\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"array";}}class Any extends AsymmetricMatcher$1{constructor(sample){if(typeof sample==="undefined"){throw new TypeError("any() expects to be passed a constructor function. Please pass one or use anything() to match any object.");}super(sample);}fnNameFor(func){if(func.name)return func.name;const functionToString=Function.prototype.toString;const matches=functionToString.call(func).match(/^(?:async)?\\s*function\\s*\\*?\\s*([\\w$]+)\\s*\\(/);return matches?matches[1]:"";}asymmetricMatch(other){if(this.sample===String)return typeof other=="string"||other instanceof String;if(this.sample===Number)return typeof other=="number"||other instanceof Number;if(this.sample===Function)return typeof other=="function"||other instanceof Function;if(this.sample===Boolean)return typeof other=="boolean"||other instanceof Boolean;if(this.sample===BigInt)return typeof other=="bigint"||other instanceof BigInt;if(this.sample===Symbol)return typeof other=="symbol"||other instanceof Symbol;if(this.sample===Object)return typeof other=="object";return other instanceof this.sample;}toString(){return"Any";}getExpectedType(){if(this.sample===String)return"string";if(this.sample===Number)return"number";if(this.sample===Function)return"function";if(this.sample===Object)return"object";if(this.sample===Boolean)return"boolean";return this.fnNameFor(this.sample);}toAsymmetricMatcher(){return\`Any<\${this.fnNameFor(this.sample)}>\`;}}class StringMatching extends AsymmetricMatcher$1{constructor(sample,inverse=false){if(!isA("String",sample)&&!isA("RegExp",sample))throw new Error("Expected is not a String or a RegExp");super(new RegExp(sample),inverse);}asymmetricMatch(other){const result=isA("String",other)&&this.sample.test(other);return this.inverse?!result:result;}toString(){return\`String\${this.inverse?"Not":""}Matching\`;}getExpectedType(){return"string";}}class CloseTo extends AsymmetricMatcher$1{precision;constructor(sample,precision=2,inverse=false){if(!isA("Number",sample))throw new Error("Expected is not a Number");if(!isA("Number",precision))throw new Error("Precision is not a Number");super(sample);this.inverse=inverse;this.precision=precision;}asymmetricMatch(other){if(!isA("Number",other))return false;let result=false;if(other===Number.POSITIVE_INFINITY&&this.sample===Number.POSITIVE_INFINITY){result=true;}else if(other===Number.NEGATIVE_INFINITY&&this.sample===Number.NEGATIVE_INFINITY){result=true;}else{result=Math.abs(this.sample-other)<10**-this.precision/2;}return this.inverse?!result:result;}toString(){return\`Number\${this.inverse?"Not":""}CloseTo\`;}getExpectedType(){return"number";}toAsymmetricMatcher(){return[this.toString(),this.sample,\`(\${pluralize("digit",this.precision)})\`].join(" ");}}const JestAsymmetricMatchers=(chai,utils)=>{utils.addMethod(chai.expect,"anything",()=>new Anything());utils.addMethod(chai.expect,"any",expected=>new Any(expected));utils.addMethod(chai.expect,"stringContaining",expected=>new StringContaining(expected));utils.addMethod(chai.expect,"objectContaining",expected=>new ObjectContaining(expected));utils.addMethod(chai.expect,"arrayContaining",expected=>new ArrayContaining(expected));utils.addMethod(chai.expect,"stringMatching",expected=>new StringMatching(expected));utils.addMethod(chai.expect,"closeTo",(expected,precision)=>new CloseTo(expected,precision));chai.expect.not={stringContaining:expected=>new StringContaining(expected,true),objectContaining:expected=>new ObjectContaining(expected,true),arrayContaining:expected=>new ArrayContaining(expected,true),stringMatching:expected=>new StringMatching(expected,true),closeTo:(expected,precision)=>new CloseTo(expected,precision,true)};};function recordAsyncExpect$1(test,promise){if(test&&promise instanceof Promise){promise=promise.finally(()=>{const index=test.promises.indexOf(promise);if(index!==-1)test.promises.splice(index,1);});if(!test.promises)test.promises=[];test.promises.push(promise);}return promise;}function wrapSoft(utils,fn){return function(...args){var _a;const test=utils.flag(this,"vitest-test");const state=(test==null?void 0:test.context._local)?test.context.expect.getState():getState(globalThis[GLOBAL_EXPECT$1]);if(!state.soft)return fn.apply(this,args);if(!test)throw new Error("expect.soft() can only be used inside a test");try{return fn.apply(this,args);}catch(err){test.result||(test.result={state:"fail"});test.result.state="fail";(_a=test.result).errors||(_a.errors=[]);test.result.errors.push(processError(err));}};}const JestChaiExpect=(chai,utils)=>{const AssertionError=chai.AssertionError;const c=()=>getColors();const customTesters=getCustomEqualityTesters();function def(name,fn){const addMethod=n=>{const softWrapper=wrapSoft(utils,fn);utils.addMethod(chai.Assertion.prototype,n,softWrapper);utils.addMethod(globalThis[JEST_MATCHERS_OBJECT$1].matchers,n,softWrapper);};if(Array.isArray(name))name.forEach(n=>addMethod(n));else addMethod(name);}["throw","throws","Throw"].forEach(m=>{utils.overwriteMethod(chai.Assertion.prototype,m,_super=>{return function(...args){const promise=utils.flag(this,"promise");const object=utils.flag(this,"object");const isNot=utils.flag(this,"negate");if(promise==="rejects"){utils.flag(this,"object",()=>{throw object;});}else if(promise==="resolves"&&typeof object!=="function"){if(!isNot){const message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}else{return;}}_super.apply(this,args);};});});def("withTest",function(test){utils.flag(this,"vitest-test",test);return this;});def("toEqual",function(expected){const actual=utils.flag(this,"object");const equal=equals(actual,expected,[...customTesters,iterableEquality]);return this.assert(equal,"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",expected,actual);});def("toStrictEqual",function(expected){const obj=utils.flag(this,"object");const equal=equals(obj,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],true);return this.assert(equal,"expected #{this} to strictly equal #{exp}","expected #{this} to not strictly equal #{exp}",expected,obj);});def("toBe",function(expected){const actual=this._obj;const pass=Object.is(actual,expected);let deepEqualityName="";if(!pass){const toStrictEqualPass=equals(actual,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],true);if(toStrictEqualPass){deepEqualityName="toStrictEqual";}else{const toEqualPass=equals(actual,expected,[...customTesters,iterableEquality]);if(toEqualPass)deepEqualityName="toEqual";}}return this.assert(pass,generateToBeMessage(deepEqualityName),"expected #{this} not to be #{exp} // Object.is equality",expected,actual);});def("toMatchObject",function(expected){const actual=this._obj;return this.assert(equals(actual,expected,[...customTesters,iterableEquality,subsetEquality]),"expected #{this} to match object #{exp}","expected #{this} to not match object #{exp}",expected,actual);});def("toMatch",function(expected){if(typeof expected==="string")return this.include(expected);else return this.match(expected);});def("toContain",function(item){const actual=this._obj;if(typeof Node!=="undefined"&&actual instanceof Node){if(!(item instanceof Node))throw new TypeError(\`toContain() expected a DOM node as the argument, but got \${typeof item}\`);return this.assert(actual.contains(item),"expected #{this} to contain element #{exp}","expected #{this} not to contain element #{exp}",item,actual);}if(typeof DOMTokenList!=="undefined"&&actual instanceof DOMTokenList){assertTypes(item,"class name",["string"]);const isNot=utils.flag(this,"negate");const expectedClassList=isNot?actual.value.replace(item,"").trim():\`\${actual.value} \${item}\`;return this.assert(actual.contains(item),\`expected "\${actual.value}" to contain "\${item}"\`,\`expected "\${actual.value}" not to contain "\${item}"\`,expectedClassList,actual.value);}if(actual!=null&&typeof actual!=="string")utils.flag(this,"object",Array.from(actual));return this.contain(item);});def("toContainEqual",function(expected){const obj=utils.flag(this,"object");const index=Array.from(obj).findIndex(item=>{return equals(item,expected,customTesters);});this.assert(index!==-1,"expected #{this} to deep equally contain #{exp}","expected #{this} to not deep equally contain #{exp}",expected);});def("toBeTruthy",function(){const obj=utils.flag(this,"object");this.assert(Boolean(obj),"expected #{this} to be truthy","expected #{this} to not be truthy",obj,false);});def("toBeFalsy",function(){const obj=utils.flag(this,"object");this.assert(!obj,"expected #{this} to be falsy","expected #{this} to not be falsy",obj,false);});def("toBeGreaterThan",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actual>expected,\`expected \${actual} to be greater than \${expected}\`,\`expected \${actual} to be not greater than \${expected}\`,actual,expected,false);});def("toBeGreaterThanOrEqual",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actual>=expected,\`expected \${actual} to be greater than or equal to \${expected}\`,\`expected \${actual} to be not greater than or equal to \${expected}\`,actual,expected,false);});def("toBeLessThan",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actualString(key).replace(/([.[\\]])/g,"\\\\$1")).join(".");const actual=this._obj;const propertyName=args[0],expected=args[1];const getValue=()=>{const hasOwn=Object.prototype.hasOwnProperty.call(actual,propertyName);if(hasOwn)return{value:actual[propertyName],exists:true};return utils.getPathInfo(actual,propertyName);};const _getValue=getValue(),value=_getValue.value,exists=_getValue.exists;const pass=exists&&(args.length===1||equals(expected,value,customTesters));const valueString=args.length===1?"":\` with value \${utils.objDisplay(expected)}\`;return this.assert(pass,\`expected #{this} to have property "\${propertyName}"\${valueString}\`,\`expected #{this} to not have property "\${propertyName}"\${valueString}\`,expected,exists?value:void 0);});def("toBeCloseTo",function(received,precision=2){const expected=this._obj;let pass=false;let expectedDiff=0;let receivedDiff=0;if(received===Number.POSITIVE_INFINITY&&expected===Number.POSITIVE_INFINITY){pass=true;}else if(received===Number.NEGATIVE_INFINITY&&expected===Number.NEGATIVE_INFINITY){pass=true;}else{expectedDiff=10**-precision/2;receivedDiff=Math.abs(expected-received);pass=receivedDiff{if(!isMockFunction(assertion._obj))throw new TypeError(\`\${utils.inspect(assertion._obj)} is not a spy or a call to a spy!\`);};const getSpy=assertion=>{assertIsMock(assertion);return assertion._obj;};const ordinalOf=i=>{const j=i%10;const k=i%100;if(j===1&&k!==11)return\`\${i}st\`;if(j===2&&k!==12)return\`\${i}nd\`;if(j===3&&k!==13)return\`\${i}rd\`;return\`\${i}th\`;};const formatCalls=(spy,msg,actualCall)=>{if(spy.mock.calls){msg+=c().gray(\` +[Symbol.for("chai/inspect")](options){const result=stringify(this,options.depth,{min:true});if(result.length<=options.truncate)return result;return\`\${this.toString()}{\\u2026}\`;}};class StringContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){if(!isA("String",sample))throw new Error("Expected is not a string");super(sample,inverse);}asymmetricMatch(other){const result=isA("String",other)&&other.includes(this.sample);return this.inverse?!result:result;}toString(){return\`String\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"string";}}class Anything extends AsymmetricMatcher$1{asymmetricMatch(other){return other!=null;}toString(){return"Anything";}toAsymmetricMatcher(){return"Anything";}}class ObjectContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){super(sample,inverse);}getPrototype(obj){if(Object.getPrototypeOf)return Object.getPrototypeOf(obj);if(obj.constructor.prototype===obj)return null;return obj.constructor.prototype;}hasProperty(obj,property){if(!obj)return false;if(Object.prototype.hasOwnProperty.call(obj,property))return true;return this.hasProperty(this.getPrototype(obj),property);}asymmetricMatch(other){if(typeof this.sample!=="object"){throw new TypeError(\`You must provide an object to \${this.toString()}, not '\${typeof this.sample}'.\`);}let result=true;const matcherContext=this.getMatcherContext();for(const property in this.sample){if(!this.hasProperty(other,property)||!equals(this.sample[property],other[property],matcherContext.customTesters)){result=false;break;}}return this.inverse?!result:result;}toString(){return\`Object\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"object";}}class ArrayContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){super(sample,inverse);}asymmetricMatch(other){if(!Array.isArray(this.sample)){throw new TypeError(\`You must provide an array to \${this.toString()}, not '\${typeof this.sample}'.\`);}const matcherContext=this.getMatcherContext();const result=this.sample.length===0||Array.isArray(other)&&this.sample.every(item=>other.some(another=>equals(item,another,matcherContext.customTesters)));return this.inverse?!result:result;}toString(){return\`Array\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"array";}}class Any extends AsymmetricMatcher$1{constructor(sample){if(typeof sample==="undefined"){throw new TypeError("any() expects to be passed a constructor function. Please pass one or use anything() to match any object.");}super(sample);}fnNameFor(func){if(func.name)return func.name;const functionToString=Function.prototype.toString;const matches=functionToString.call(func).match(/^(?:async)?\\s*function\\s*\\*?\\s*([\\w$]+)\\s*\\(/);return matches?matches[1]:"";}asymmetricMatch(other){if(this.sample===String)return typeof other=="string"||other instanceof String;if(this.sample===Number)return typeof other=="number"||other instanceof Number;if(this.sample===Function)return typeof other=="function"||other instanceof Function;if(this.sample===Boolean)return typeof other=="boolean"||other instanceof Boolean;if(this.sample===BigInt)return typeof other=="bigint"||other instanceof BigInt;if(this.sample===Symbol)return typeof other=="symbol"||other instanceof Symbol;if(this.sample===Object)return typeof other=="object";return other instanceof this.sample;}toString(){return"Any";}getExpectedType(){if(this.sample===String)return"string";if(this.sample===Number)return"number";if(this.sample===Function)return"function";if(this.sample===Object)return"object";if(this.sample===Boolean)return"boolean";return this.fnNameFor(this.sample);}toAsymmetricMatcher(){return\`Any<\${this.fnNameFor(this.sample)}>\`;}}class StringMatching extends AsymmetricMatcher$1{constructor(sample,inverse=false){if(!isA("String",sample)&&!isA("RegExp",sample))throw new Error("Expected is not a String or a RegExp");super(new RegExp(sample),inverse);}asymmetricMatch(other){const result=isA("String",other)&&this.sample.test(other);return this.inverse?!result:result;}toString(){return\`String\${this.inverse?"Not":""}Matching\`;}getExpectedType(){return"string";}}class CloseTo extends AsymmetricMatcher$1{precision;constructor(sample,precision=2,inverse=false){if(!isA("Number",sample))throw new Error("Expected is not a Number");if(!isA("Number",precision))throw new Error("Precision is not a Number");super(sample);this.inverse=inverse;this.precision=precision;}asymmetricMatch(other){if(!isA("Number",other))return false;let result=false;if(other===Number.POSITIVE_INFINITY&&this.sample===Number.POSITIVE_INFINITY){result=true;}else if(other===Number.NEGATIVE_INFINITY&&this.sample===Number.NEGATIVE_INFINITY){result=true;}else{result=Math.abs(this.sample-other)<10**-this.precision/2;}return this.inverse?!result:result;}toString(){return\`Number\${this.inverse?"Not":""}CloseTo\`;}getExpectedType(){return"number";}toAsymmetricMatcher(){return[this.toString(),this.sample,\`(\${pluralize("digit",this.precision)})\`].join(" ");}}const JestAsymmetricMatchers=(chai,utils)=>{utils.addMethod(chai.expect,"anything",()=>new Anything());utils.addMethod(chai.expect,"any",expected=>new Any(expected));utils.addMethod(chai.expect,"stringContaining",expected=>new StringContaining(expected));utils.addMethod(chai.expect,"objectContaining",expected=>new ObjectContaining(expected));utils.addMethod(chai.expect,"arrayContaining",expected=>new ArrayContaining(expected));utils.addMethod(chai.expect,"stringMatching",expected=>new StringMatching(expected));utils.addMethod(chai.expect,"closeTo",(expected,precision)=>new CloseTo(expected,precision));chai.expect.not={stringContaining:expected=>new StringContaining(expected,true),objectContaining:expected=>new ObjectContaining(expected,true),arrayContaining:expected=>new ArrayContaining(expected,true),stringMatching:expected=>new StringMatching(expected,true),closeTo:(expected,precision)=>new CloseTo(expected,precision,true)};};function recordAsyncExpect$1(test,promise){if(test&&promise instanceof Promise){promise=promise.finally(()=>{const index=test.promises.indexOf(promise);if(index!==-1)test.promises.splice(index,1);});if(!test.promises)test.promises=[];test.promises.push(promise);}return promise;}function wrapSoft(utils,fn){return function(...args){var _a;const test=utils.flag(this,"vitest-test");const state=(test==null?void 0:test.context._local)?test.context.expect.getState():getState(globalThis[GLOBAL_EXPECT$1]);if(!state.soft)return fn.apply(this,args);if(!test)throw new Error("expect.soft() can only be used inside a test");try{return fn.apply(this,args);}catch(err){test.result||(test.result={state:"fail"});test.result.state="fail";(_a=test.result).errors||(_a.errors=[]);test.result.errors.push(processError(err));}};}const JestChaiExpect=(chai,utils)=>{const AssertionError=chai.AssertionError;const c=()=>getColors();const customTesters=getCustomEqualityTesters();function def(name,fn){const addMethod=n=>{const softWrapper=wrapSoft(utils,fn);utils.addMethod(chai.Assertion.prototype,n,softWrapper);utils.addMethod(globalThis[JEST_MATCHERS_OBJECT$1].matchers,n,softWrapper);};if(Array.isArray(name))name.forEach(n=>addMethod(n));else addMethod(name);}["throw","throws","Throw"].forEach(m=>{utils.overwriteMethod(chai.Assertion.prototype,m,_super=>{return function(...args){const promise=utils.flag(this,"promise");const object=utils.flag(this,"object");const isNot=utils.flag(this,"negate");if(promise==="rejects"){utils.flag(this,"object",()=>{throw object;});}else if(promise==="resolves"&&typeof object!=="function"){if(!isNot){const message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}else{return;}}_super.apply(this,args);};});});def("withTest",function(test){utils.flag(this,"vitest-test",test);return this;});def("toEqual",function(expected){const actual=utils.flag(this,"object");const equal=equals(actual,expected,[...customTesters,iterableEquality]);return this.assert(equal,"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",expected,actual);});def("toStrictEqual",function(expected){const obj=utils.flag(this,"object");const equal=equals(obj,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],true);return this.assert(equal,"expected #{this} to strictly equal #{exp}","expected #{this} to not strictly equal #{exp}",expected,obj);});def("toBe",function(expected){const actual=this._obj;const pass=Object.is(actual,expected);let deepEqualityName="";if(!pass){const toStrictEqualPass=equals(actual,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],true);if(toStrictEqualPass){deepEqualityName="toStrictEqual";}else{const toEqualPass=equals(actual,expected,[...customTesters,iterableEquality]);if(toEqualPass)deepEqualityName="toEqual";}}return this.assert(pass,generateToBeMessage(deepEqualityName),"expected #{this} not to be #{exp} // Object.is equality",expected,actual);});def("toMatchObject",function(expected){const actual=this._obj;const pass=equals(actual,expected,[...customTesters,iterableEquality,subsetEquality]);const isNot=utils.flag(this,"negate");const _getObjectSubset=getObjectSubset(actual,expected),actualSubset=_getObjectSubset.subset,stripped=_getObjectSubset.stripped;if(pass&&isNot||!pass&&!isNot){const msg=utils.getMessage(this,[pass,"expected #{this} to match object #{exp}","expected #{this} to not match object #{exp}",expected,actualSubset,false]);const message=stripped===0?msg:\`\${msg} +(\${stripped} matching \${stripped===1?"property":"properties"} omitted from actual)\`;throw new AssertionError(message,{showDiff:true,expected,actual:actualSubset});}});def("toMatch",function(expected){const actual=this._obj;if(typeof actual!=="string")throw new TypeError(\`.toMatch() expects to receive a string, but got \${typeof actual}\`);return this.assert(typeof expected==="string"?actual.includes(expected):actual.match(expected),\`expected #{this} to match #{exp}\`,\`expected #{this} not to match #{exp}\`,expected,actual);});def("toContain",function(item){const actual=this._obj;if(typeof Node!=="undefined"&&actual instanceof Node){if(!(item instanceof Node))throw new TypeError(\`toContain() expected a DOM node as the argument, but got \${typeof item}\`);return this.assert(actual.contains(item),"expected #{this} to contain element #{exp}","expected #{this} not to contain element #{exp}",item,actual);}if(typeof DOMTokenList!=="undefined"&&actual instanceof DOMTokenList){assertTypes(item,"class name",["string"]);const isNot=utils.flag(this,"negate");const expectedClassList=isNot?actual.value.replace(item,"").trim():\`\${actual.value} \${item}\`;return this.assert(actual.contains(item),\`expected "\${actual.value}" to contain "\${item}"\`,\`expected "\${actual.value}" not to contain "\${item}"\`,expectedClassList,actual.value);}if(typeof actual==="string"&&typeof item==="string"){return this.assert(actual.includes(item),\`expected #{this} to contain #{exp}\`,\`expected #{this} not to contain #{exp}\`,item,actual);}if(actual!=null&&typeof actual!=="string")utils.flag(this,"object",Array.from(actual));return this.contain(item);});def("toContainEqual",function(expected){const obj=utils.flag(this,"object");const index=Array.from(obj).findIndex(item=>{return equals(item,expected,customTesters);});this.assert(index!==-1,"expected #{this} to deep equally contain #{exp}","expected #{this} to not deep equally contain #{exp}",expected);});def("toBeTruthy",function(){const obj=utils.flag(this,"object");this.assert(Boolean(obj),"expected #{this} to be truthy","expected #{this} to not be truthy",obj,false);});def("toBeFalsy",function(){const obj=utils.flag(this,"object");this.assert(!obj,"expected #{this} to be falsy","expected #{this} to not be falsy",obj,false);});def("toBeGreaterThan",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actual>expected,\`expected \${actual} to be greater than \${expected}\`,\`expected \${actual} to be not greater than \${expected}\`,actual,expected,false);});def("toBeGreaterThanOrEqual",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actual>=expected,\`expected \${actual} to be greater than or equal to \${expected}\`,\`expected \${actual} to be not greater than or equal to \${expected}\`,actual,expected,false);});def("toBeLessThan",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actualString(key).replace(/([.[\\]])/g,"\\\\$1")).join(".");const actual=this._obj;const propertyName=args[0],expected=args[1];const getValue=()=>{const hasOwn=Object.prototype.hasOwnProperty.call(actual,propertyName);if(hasOwn)return{value:actual[propertyName],exists:true};return utils.getPathInfo(actual,propertyName);};const _getValue=getValue(),value=_getValue.value,exists=_getValue.exists;const pass=exists&&(args.length===1||equals(expected,value,customTesters));const valueString=args.length===1?"":\` with value \${utils.objDisplay(expected)}\`;return this.assert(pass,\`expected #{this} to have property "\${propertyName}"\${valueString}\`,\`expected #{this} to not have property "\${propertyName}"\${valueString}\`,expected,exists?value:void 0);});def("toBeCloseTo",function(received,precision=2){const expected=this._obj;let pass=false;let expectedDiff=0;let receivedDiff=0;if(received===Number.POSITIVE_INFINITY&&expected===Number.POSITIVE_INFINITY){pass=true;}else if(received===Number.NEGATIVE_INFINITY&&expected===Number.NEGATIVE_INFINITY){pass=true;}else{expectedDiff=10**-precision/2;receivedDiff=Math.abs(expected-received);pass=receivedDiff{if(!isMockFunction(assertion._obj))throw new TypeError(\`\${utils.inspect(assertion._obj)} is not a spy or a call to a spy!\`);};const getSpy=assertion=>{assertIsMock(assertion);return assertion._obj;};const ordinalOf=i=>{const j=i%10;const k=i%100;if(j===1&&k!==11)return\`\${i}st\`;if(j===2&&k!==12)return\`\${i}nd\`;if(j===3&&k!==13)return\`\${i}rd\`;return\`\${i}th\`;};const formatCalls=(spy,msg,actualCall)=>{if(spy.mock.calls){msg+=c().gray(\` Received: @@ -7986,7 +8004,7 @@ Received: \`);if(actualReturn)methodCall+=diff(actualReturn,callReturn.value,{omitAnnotationLines:true});else methodCall+=stringify(callReturn).split("\\n").map(line=>\` \${line}\`).join("\\n");methodCall+="\\n";return methodCall;}).join("\\n")}\`);msg+=c().gray(\` Number of calls: \${c().bold(spy.mock.calls.length)} -\`);return msg;};def(["toHaveBeenCalledTimes","toBeCalledTimes"],function(number){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;return this.assert(callCount===number,\`expected "\${spyName}" to be called #{exp} times, but got \${callCount} times\`,\`expected "\${spyName}" to not be called #{exp} times\`,number,callCount,false);});def("toHaveBeenCalledOnce",function(){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;return this.assert(callCount===1,\`expected "\${spyName}" to be called once, but got \${callCount} times\`,\`expected "\${spyName}" to not be called once\`,1,callCount,false);});def(["toHaveBeenCalled","toBeCalled"],function(){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;const called=callCount>0;const isNot=utils.flag(this,"negate");let msg=utils.getMessage(this,[called,\`expected "\${spyName}" to be called at least once\`,\`expected "\${spyName}" to not be called at all, but actually been called \${callCount} times\`,true,called]);if(called&&isNot)msg=formatCalls(spy,msg);if(called&&isNot||!called&&!isNot)throw new AssertionError(msg);});def(["toHaveBeenCalledWith","toBeCalledWith"],function(...args){const spy=getSpy(this);const spyName=spy.getMockName();const pass=spy.mock.calls.some(callArg=>equals(callArg,args,[...customTesters,iterableEquality]));const isNot=utils.flag(this,"negate");const msg=utils.getMessage(this,[pass,\`expected "\${spyName}" to be called with arguments: #{exp}\`,\`expected "\${spyName}" to not be called with arguments: #{exp}\`,args]);if(pass&&isNot||!pass&&!isNot)throw new AssertionError(formatCalls(spy,msg,args));});def(["toHaveBeenNthCalledWith","nthCalledWith"],function(times,...args){const spy=getSpy(this);const spyName=spy.getMockName();const nthCall=spy.mock.calls[times-1];this.assert(equals(nthCall,args,[...customTesters,iterableEquality]),\`expected \${ordinalOf(times)} "\${spyName}" call to have been called with #{exp}\`,\`expected \${ordinalOf(times)} "\${spyName}" call to not have been called with #{exp}\`,args,nthCall);});def(["toHaveBeenLastCalledWith","lastCalledWith"],function(...args){const spy=getSpy(this);const spyName=spy.getMockName();const lastCall=spy.mock.calls[spy.mock.calls.length-1];this.assert(equals(lastCall,args,[...customTesters,iterableEquality]),\`expected last "\${spyName}" call to have been called with #{exp}\`,\`expected last "\${spyName}" call to not have been called with #{exp}\`,args,lastCall);});def(["toThrow","toThrowError"],function(expected){if(typeof expected==="string"||typeof expected==="undefined"||expected instanceof RegExp)return this.throws(expected);const obj=this._obj;const promise=utils.flag(this,"promise");const isNot=utils.flag(this,"negate");let thrown=null;if(promise==="rejects"){thrown=obj;}else if(promise==="resolves"&&typeof obj!=="function"){if(!isNot){const message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}else{return;}}else{let isThrow=false;try{obj();}catch(err){isThrow=true;thrown=err;}if(!isThrow&&!isNot){const message=utils.flag(this,"message")||"expected function to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}}if(typeof expected==="function"){const name=expected.name||expected.prototype.constructor.name;return this.assert(thrown&&thrown instanceof expected,\`expected error to be instance of \${name}\`,\`expected error not to be instance of \${name}\`,expected,thrown);}if(expected instanceof Error){return this.assert(thrown&&expected.message===thrown.message,\`expected error to have message: \${expected.message}\`,\`expected error not to have message: \${expected.message}\`,expected.message,thrown&&thrown.message);}if(typeof expected==="object"&&"asymmetricMatch"in expected&&typeof expected.asymmetricMatch==="function"){const matcher=expected;return this.assert(thrown&&matcher.asymmetricMatch(thrown),"expected error to match asymmetric matcher","expected error not to match asymmetric matcher",matcher,thrown);}throw new Error(\`"toThrow" expects string, RegExp, function, Error instance or asymmetric matcher, got "\${typeof expected}"\`);});def(["toHaveReturned","toReturn"],function(){const spy=getSpy(this);const spyName=spy.getMockName();const calledAndNotThrew=spy.mock.calls.length>0&&spy.mock.results.some(({type})=>type!=="throw");this.assert(calledAndNotThrew,\`expected "\${spyName}" to be successfully called at least once\`,\`expected "\${spyName}" to not be successfully called\`,calledAndNotThrew,!calledAndNotThrew,false);});def(["toHaveReturnedTimes","toReturnTimes"],function(times){const spy=getSpy(this);const spyName=spy.getMockName();const successfulReturns=spy.mock.results.reduce((success,{type})=>type==="throw"?success:++success,0);this.assert(successfulReturns===times,\`expected "\${spyName}" to be successfully called \${times} times\`,\`expected "\${spyName}" to not be successfully called \${times} times\`,\`expected number of returns: \${times}\`,\`received number of returns: \${successfulReturns}\`,false);});def(["toHaveReturnedWith","toReturnWith"],function(value){const spy=getSpy(this);const spyName=spy.getMockName();const pass=spy.mock.results.some(({type,value:result})=>type==="return"&&equals(value,result));const isNot=utils.flag(this,"negate");const msg=utils.getMessage(this,[pass,\`expected "\${spyName}" to return with: #{exp} at least once\`,\`expected "\${spyName}" to not return with: #{exp}\`,value]);if(pass&&isNot||!pass&&!isNot)throw new AssertionError(formatReturns(spy,msg,value));});def(["toHaveLastReturnedWith","lastReturnedWith"],function(value){const spy=getSpy(this);const spyName=spy.getMockName();const lastResult=spy.mock.results[spy.mock.results.length-1].value;const pass=equals(lastResult,value);this.assert(pass,\`expected last "\${spyName}" call to return #{exp}\`,\`expected last "\${spyName}" call to not return #{exp}\`,value,lastResult);});def(["toHaveNthReturnedWith","nthReturnedWith"],function(nthCall,value){const spy=getSpy(this);const spyName=spy.getMockName();const isNot=utils.flag(this,"negate");const _spy$mock$results=spy.mock.results[nthCall-1],callType=_spy$mock$results.type,callResult=_spy$mock$results.value;const ordinalCall=\`\${ordinalOf(nthCall)} call\`;if(!isNot&&callType==="throw")chai.assert.fail(\`expected \${ordinalCall} to return #{exp}, but instead it threw an error\`);const nthCallReturn=equals(callResult,value);this.assert(nthCallReturn,\`expected \${ordinalCall} "\${spyName}" call to return #{exp}\`,\`expected \${ordinalCall} "\${spyName}" call to not return #{exp}\`,value,callResult);});def("toSatisfy",function(matcher,message){return this.be.satisfy(matcher,message);});utils.addProperty(chai.Assertion.prototype,"resolves",function __VITEST_RESOLVES__(){const error=new Error("resolves");utils.flag(this,"promise","resolves");utils.flag(this,"error",error);const test=utils.flag(this,"vitest-test");const obj=utils.flag(this,"object");if(typeof(obj==null?void 0:obj.then)!=="function")throw new TypeError(\`You must provide a Promise to expect() when using .resolves, not '\${typeof obj}'.\`);const proxy=new Proxy(this,{get:(target,key,receiver)=>{const result=Reflect.get(target,key,receiver);if(typeof result!=="function")return result instanceof chai.Assertion?proxy:result;return async(...args)=>{const promise=obj.then(value=>{utils.flag(this,"object",value);return result.call(this,...args);},err=>{const _error=new AssertionError(\`promise rejected "\${utils.inspect(err)}" instead of resolving\`,{showDiff:false});_error.cause=err;_error.stack=error.stack.replace(error.message,_error.message);throw _error;});return recordAsyncExpect$1(test,promise);};}});return proxy;});utils.addProperty(chai.Assertion.prototype,"rejects",function __VITEST_REJECTS__(){const error=new Error("rejects");utils.flag(this,"promise","rejects");utils.flag(this,"error",error);const test=utils.flag(this,"vitest-test");const obj=utils.flag(this,"object");const wrapper=typeof obj==="function"?obj():obj;if(typeof(wrapper==null?void 0:wrapper.then)!=="function")throw new TypeError(\`You must provide a Promise to expect() when using .rejects, not '\${typeof wrapper}'.\`);const proxy=new Proxy(this,{get:(target,key,receiver)=>{const result=Reflect.get(target,key,receiver);if(typeof result!=="function")return result instanceof chai.Assertion?proxy:result;return async(...args)=>{const promise=wrapper.then(value=>{const _error=new AssertionError(\`promise resolved "\${utils.inspect(value)}" instead of rejecting\`,{showDiff:true,expected:new Error("rejected promise"),actual:value});_error.stack=error.stack.replace(error.message,_error.message);throw _error;},err=>{utils.flag(this,"object",err);return result.call(this,...args);});return recordAsyncExpect$1(test,promise);};}});return proxy;});};function getMatcherState(assertion,expect){const obj=assertion._obj;const isNot=util.flag(assertion,"negate");const promise=util.flag(assertion,"promise")||"";const jestUtils=_objectSpread(_objectSpread({},getMatcherUtils()),{},{diff,stringify,iterableEquality,subsetEquality});const matcherState=_objectSpread(_objectSpread({},getState(expect)),{},{customTesters:getCustomEqualityTesters(),isNot,utils:jestUtils,promise,equals,// needed for built-in jest-snapshots, but we don't use it +\`);return msg;};def(["toHaveBeenCalledTimes","toBeCalledTimes"],function(number){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;return this.assert(callCount===number,\`expected "\${spyName}" to be called #{exp} times, but got \${callCount} times\`,\`expected "\${spyName}" to not be called #{exp} times\`,number,callCount,false);});def("toHaveBeenCalledOnce",function(){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;return this.assert(callCount===1,\`expected "\${spyName}" to be called once, but got \${callCount} times\`,\`expected "\${spyName}" to not be called once\`,1,callCount,false);});def(["toHaveBeenCalled","toBeCalled"],function(){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;const called=callCount>0;const isNot=utils.flag(this,"negate");let msg=utils.getMessage(this,[called,\`expected "\${spyName}" to be called at least once\`,\`expected "\${spyName}" to not be called at all, but actually been called \${callCount} times\`,true,called]);if(called&&isNot)msg=formatCalls(spy,msg);if(called&&isNot||!called&&!isNot)throw new AssertionError(msg);});def(["toHaveBeenCalledWith","toBeCalledWith"],function(...args){const spy=getSpy(this);const spyName=spy.getMockName();const pass=spy.mock.calls.some(callArg=>equals(callArg,args,[...customTesters,iterableEquality]));const isNot=utils.flag(this,"negate");const msg=utils.getMessage(this,[pass,\`expected "\${spyName}" to be called with arguments: #{exp}\`,\`expected "\${spyName}" to not be called with arguments: #{exp}\`,args]);if(pass&&isNot||!pass&&!isNot)throw new AssertionError(formatCalls(spy,msg,args));});def(["toHaveBeenNthCalledWith","nthCalledWith"],function(times,...args){const spy=getSpy(this);const spyName=spy.getMockName();const nthCall=spy.mock.calls[times-1];const callCount=spy.mock.calls.length;const isCalled=times<=callCount;this.assert(equals(nthCall,args,[...customTesters,iterableEquality]),\`expected \${ordinalOf(times)} "\${spyName}" call to have been called with #{exp}\${isCalled?\`\`:\`, but called only \${callCount} times\`}\`,\`expected \${ordinalOf(times)} "\${spyName}" call to not have been called with #{exp}\`,args,nthCall,isCalled);});def(["toHaveBeenLastCalledWith","lastCalledWith"],function(...args){const spy=getSpy(this);const spyName=spy.getMockName();const lastCall=spy.mock.calls[spy.mock.calls.length-1];this.assert(equals(lastCall,args,[...customTesters,iterableEquality]),\`expected last "\${spyName}" call to have been called with #{exp}\`,\`expected last "\${spyName}" call to not have been called with #{exp}\`,args,lastCall);});def(["toThrow","toThrowError"],function(expected){if(typeof expected==="string"||typeof expected==="undefined"||expected instanceof RegExp)return this.throws(expected);const obj=this._obj;const promise=utils.flag(this,"promise");const isNot=utils.flag(this,"negate");let thrown=null;if(promise==="rejects"){thrown=obj;}else if(promise==="resolves"&&typeof obj!=="function"){if(!isNot){const message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}else{return;}}else{let isThrow=false;try{obj();}catch(err){isThrow=true;thrown=err;}if(!isThrow&&!isNot){const message=utils.flag(this,"message")||"expected function to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}}if(typeof expected==="function"){const name=expected.name||expected.prototype.constructor.name;return this.assert(thrown&&thrown instanceof expected,\`expected error to be instance of \${name}\`,\`expected error not to be instance of \${name}\`,expected,thrown);}if(expected instanceof Error){return this.assert(thrown&&expected.message===thrown.message,\`expected error to have message: \${expected.message}\`,\`expected error not to have message: \${expected.message}\`,expected.message,thrown&&thrown.message);}if(typeof expected==="object"&&"asymmetricMatch"in expected&&typeof expected.asymmetricMatch==="function"){const matcher=expected;return this.assert(thrown&&matcher.asymmetricMatch(thrown),"expected error to match asymmetric matcher","expected error not to match asymmetric matcher",matcher,thrown);}throw new Error(\`"toThrow" expects string, RegExp, function, Error instance or asymmetric matcher, got "\${typeof expected}"\`);});def(["toHaveReturned","toReturn"],function(){const spy=getSpy(this);const spyName=spy.getMockName();const calledAndNotThrew=spy.mock.calls.length>0&&spy.mock.results.some(({type})=>type!=="throw");this.assert(calledAndNotThrew,\`expected "\${spyName}" to be successfully called at least once\`,\`expected "\${spyName}" to not be successfully called\`,calledAndNotThrew,!calledAndNotThrew,false);});def(["toHaveReturnedTimes","toReturnTimes"],function(times){const spy=getSpy(this);const spyName=spy.getMockName();const successfulReturns=spy.mock.results.reduce((success,{type})=>type==="throw"?success:++success,0);this.assert(successfulReturns===times,\`expected "\${spyName}" to be successfully called \${times} times\`,\`expected "\${spyName}" to not be successfully called \${times} times\`,\`expected number of returns: \${times}\`,\`received number of returns: \${successfulReturns}\`,false);});def(["toHaveReturnedWith","toReturnWith"],function(value){const spy=getSpy(this);const spyName=spy.getMockName();const pass=spy.mock.results.some(({type,value:result})=>type==="return"&&equals(value,result));const isNot=utils.flag(this,"negate");const msg=utils.getMessage(this,[pass,\`expected "\${spyName}" to return with: #{exp} at least once\`,\`expected "\${spyName}" to not return with: #{exp}\`,value]);if(pass&&isNot||!pass&&!isNot)throw new AssertionError(formatReturns(spy,msg,value));});def(["toHaveLastReturnedWith","lastReturnedWith"],function(value){const spy=getSpy(this);const spyName=spy.getMockName();const lastResult=spy.mock.results[spy.mock.results.length-1].value;const pass=equals(lastResult,value);this.assert(pass,\`expected last "\${spyName}" call to return #{exp}\`,\`expected last "\${spyName}" call to not return #{exp}\`,value,lastResult);});def(["toHaveNthReturnedWith","nthReturnedWith"],function(nthCall,value){const spy=getSpy(this);const spyName=spy.getMockName();const isNot=utils.flag(this,"negate");const _spy$mock$results=spy.mock.results[nthCall-1],callType=_spy$mock$results.type,callResult=_spy$mock$results.value;const ordinalCall=\`\${ordinalOf(nthCall)} call\`;if(!isNot&&callType==="throw")chai.assert.fail(\`expected \${ordinalCall} to return #{exp}, but instead it threw an error\`);const nthCallReturn=equals(callResult,value);this.assert(nthCallReturn,\`expected \${ordinalCall} "\${spyName}" call to return #{exp}\`,\`expected \${ordinalCall} "\${spyName}" call to not return #{exp}\`,value,callResult);});def("toSatisfy",function(matcher,message){return this.be.satisfy(matcher,message);});utils.addProperty(chai.Assertion.prototype,"resolves",function __VITEST_RESOLVES__(){const error=new Error("resolves");utils.flag(this,"promise","resolves");utils.flag(this,"error",error);const test=utils.flag(this,"vitest-test");const obj=utils.flag(this,"object");if(typeof(obj==null?void 0:obj.then)!=="function")throw new TypeError(\`You must provide a Promise to expect() when using .resolves, not '\${typeof obj}'.\`);const proxy=new Proxy(this,{get:(target,key,receiver)=>{const result=Reflect.get(target,key,receiver);if(typeof result!=="function")return result instanceof chai.Assertion?proxy:result;return async(...args)=>{const promise=obj.then(value=>{utils.flag(this,"object",value);return result.call(this,...args);},err=>{const _error=new AssertionError(\`promise rejected "\${utils.inspect(err)}" instead of resolving\`,{showDiff:false});_error.cause=err;_error.stack=error.stack.replace(error.message,_error.message);throw _error;});return recordAsyncExpect$1(test,promise);};}});return proxy;});utils.addProperty(chai.Assertion.prototype,"rejects",function __VITEST_REJECTS__(){const error=new Error("rejects");utils.flag(this,"promise","rejects");utils.flag(this,"error",error);const test=utils.flag(this,"vitest-test");const obj=utils.flag(this,"object");const wrapper=typeof obj==="function"?obj():obj;if(typeof(wrapper==null?void 0:wrapper.then)!=="function")throw new TypeError(\`You must provide a Promise to expect() when using .rejects, not '\${typeof wrapper}'.\`);const proxy=new Proxy(this,{get:(target,key,receiver)=>{const result=Reflect.get(target,key,receiver);if(typeof result!=="function")return result instanceof chai.Assertion?proxy:result;return async(...args)=>{const promise=wrapper.then(value=>{const _error=new AssertionError(\`promise resolved "\${utils.inspect(value)}" instead of rejecting\`,{showDiff:true,expected:new Error("rejected promise"),actual:value});_error.stack=error.stack.replace(error.message,_error.message);throw _error;},err=>{utils.flag(this,"object",err);return result.call(this,...args);});return recordAsyncExpect$1(test,promise);};}});return proxy;});};function getMatcherState(assertion,expect){const obj=assertion._obj;const isNot=util.flag(assertion,"negate");const promise=util.flag(assertion,"promise")||"";const jestUtils=_objectSpread(_objectSpread({},getMatcherUtils()),{},{diff,stringify,iterableEquality,subsetEquality});const matcherState=_objectSpread(_objectSpread({},getState(expect)),{},{customTesters:getCustomEqualityTesters(),isNot,utils:jestUtils,promise,equals,// needed for built-in jest-snapshots, but we don't use it suppressedErrors:[]});return{state:matcherState,isNot,obj};}class JestExtendError extends Error{constructor(message,actual,expected){super(message);this.actual=actual;this.expected=expected;}}function JestExtendPlugin(expect,matchers){return(c,utils)=>{Object.entries(matchers).forEach(([expectAssertionName,expectAssertion])=>{function expectWrapper(...args){const _getMatcherState=getMatcherState(this,expect),state=_getMatcherState.state,isNot=_getMatcherState.isNot,obj=_getMatcherState.obj;const result=expectAssertion.call(state,obj,...args);if(result&&typeof result==="object"&&result instanceof Promise){return result.then(({pass:pass2,message:message2,actual:actual2,expected:expected2})=>{if(pass2&&isNot||!pass2&&!isNot)throw new JestExtendError(message2(),actual2,expected2);});}const pass=result.pass,message=result.message,actual=result.actual,expected=result.expected;if(pass&&isNot||!pass&&!isNot)throw new JestExtendError(message(),actual,expected);}const softWrapper=wrapSoft(utils,expectWrapper);utils.addMethod(globalThis[JEST_MATCHERS_OBJECT$1].matchers,expectAssertionName,softWrapper);utils.addMethod(c.Assertion.prototype,expectAssertionName,softWrapper);class CustomMatcher extends AsymmetricMatcher$1{constructor(inverse=false,...sample){super(sample,inverse);}asymmetricMatch(other){const _expectAssertion$call=expectAssertion.call(this.getMatcherContext(expect),other,...this.sample),pass=_expectAssertion$call.pass;return this.inverse?!pass:pass;}toString(){return\`\${this.inverse?"not.":""}\${expectAssertionName}\`;}getExpectedType(){return"any";}toAsymmetricMatcher(){return\`\${this.toString()}<\${this.sample.map(String).join(", ")}>\`;}}const customMatcher=(...sample)=>new CustomMatcher(false,...sample);Object.defineProperty(expect,expectAssertionName,{configurable:true,enumerable:true,value:customMatcher,writable:true});Object.defineProperty(expect.not,expectAssertionName,{configurable:true,enumerable:true,value:(...sample)=>new CustomMatcher(true,...sample),writable:true});Object.defineProperty(globalThis[ASYMMETRIC_MATCHERS_OBJECT$1],expectAssertionName,{configurable:true,enumerable:true,value:customMatcher,writable:true});});};}const JestExtend=(chai,utils)=>{utils.addMethod(chai.expect,"extend",(expect,expects)=>{chai.use(JestExtendPlugin(expect,expects));});};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}var naturalCompare$2={exports:{}};/* * @version 1.4.0 * @date 2015-10-26 @@ -8010,14 +8028,14 @@ var reservedWords={keyword:["break","case","catch","continue","debugger","defaul \`:string;}function removeExtraLineBreaks(string){return string.length>2&&string.startsWith("\\n")&&string.endsWith("\\n")?string.slice(1,-1):string;}const escapeRegex=true;const printFunctionName=false;function serialize(val,indent=2,formatOverrides={}){return normalizeNewlines(format_1(val,_objectSpread({escapeRegex,indent,plugins:getSerializers(),printFunctionName},formatOverrides)));}function escapeBacktickString(str){return str.replace(/\`|\\\\|\\\${/g,"\\\\$&");}function printBacktickString(str){return\`\\\`\${escapeBacktickString(str)}\\\`\`;}function normalizeNewlines(string){return string.replace(/\\r\\n|\\r/g,"\\n");}async function saveSnapshotFile(environment,snapshotData,snapshotPath){const snapshots=Object.keys(snapshotData).sort(naturalCompare$1).map(key=>\`exports[\${printBacktickString(key)}] = \${printBacktickString(normalizeNewlines(snapshotData[key]))};\`);const content=\`\${environment.getHeader()} \${snapshots.join("\\n\\n")} -\`;const oldContent=await environment.readSnapshotFile(snapshotPath);const skipWriting=oldContent!=null&&oldContent===content;if(skipWriting)return;await environment.saveSnapshotFile(snapshotPath,content);}function prepareExpected(expected){function findStartIndent(){var _a,_b;const matchObject=/^( +)}\\s+$/m.exec(expected||"");const objectIndent=(_a=matchObject==null?void 0:matchObject[1])==null?void 0:_a.length;if(objectIndent)return objectIndent;const matchText=/^\\n( +)"/.exec(expected||"");return((_b=matchText==null?void 0:matchText[1])==null?void 0:_b.length)||0;}const startIndent=findStartIndent();let expectedTrimmed=expected==null?void 0:expected.trim();if(startIndent){expectedTrimmed=expectedTrimmed==null?void 0:expectedTrimmed.replace(new RegExp(\`^\${" ".repeat(startIndent)}\`,"gm"),"").replace(/ +}$/,"}");}return expectedTrimmed;}function deepMergeArray(target=[],source=[]){const mergedOutput=Array.from(target);source.forEach((sourceElement,index)=>{const targetElement=mergedOutput[index];if(Array.isArray(target[index])){mergedOutput[index]=deepMergeArray(target[index],sourceElement);}else if(isObject(targetElement)){mergedOutput[index]=deepMergeSnapshot(target[index],sourceElement);}else{mergedOutput[index]=sourceElement;}});return mergedOutput;}function deepMergeSnapshot(target,source){if(isObject(target)&&isObject(source)){const mergedOutput=_objectSpread({},target);Object.keys(source).forEach(key=>{if(isObject(source[key])&&!source[key].$$typeof){if(!(key in target))Object.assign(mergedOutput,{[key]:source[key]});else mergedOutput[key]=deepMergeSnapshot(target[key],source[key]);}else if(Array.isArray(source[key])){mergedOutput[key]=deepMergeArray(target[key],source[key]);}else{Object.assign(mergedOutput,{[key]:source[key]});}});return mergedOutput;}else if(Array.isArray(target)&&Array.isArray(source)){return deepMergeArray(target,source);}return target;}const comma=','.charCodeAt(0);const chars$1='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';const intToChar$1=new Uint8Array(64);// 64 possible chars. -const charToInt$1=new Uint8Array(128);// z is 122 in ASCII -for(let i=0;i{const targetElement=mergedOutput[index];if(Array.isArray(target[index])){mergedOutput[index]=deepMergeArray(target[index],sourceElement);}else if(isObject(targetElement)){mergedOutput[index]=deepMergeSnapshot(target[index],sourceElement);}else{mergedOutput[index]=sourceElement;}});return mergedOutput;}function deepMergeSnapshot(target,source){if(isObject(target)&&isObject(source)){const mergedOutput=_objectSpread({},target);Object.keys(source).forEach(key=>{if(isObject(source[key])&&!source[key].$$typeof){if(!(key in target))Object.assign(mergedOutput,{[key]:source[key]});else mergedOutput[key]=deepMergeSnapshot(target[key],source[key]);}else if(Array.isArray(source[key])){mergedOutput[key]=deepMergeArray(target[key],source[key]);}else{Object.assign(mergedOutput,{[key]:source[key]});}});return mergedOutput;}else if(Array.isArray(target)&&Array.isArray(source)){return deepMergeArray(target,source);}return target;}const comma=','.charCodeAt(0);const chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';const intToChar=new Uint8Array(64);// 64 possible chars. +const charToInt=new Uint8Array(128);// z is 122 in ASCII +for(let i=0;i>>=1;if(shouldNegate){value=-0x80000000|-value;}state[j]+=value;return pos;}function hasMoreVlq(mappings,i,length){if(i>=length)return false;return mappings.charCodeAt(i)!==comma;}function sort$1(line){line.sort(sortComparator$1);}function sortComparator$1(a,b){return a[0]-b[0];}// Matches the scheme of a URL, eg "http://" +seg=[col,state[1],state[2],state[3],state[4]];}else{seg=[col,state[1],state[2],state[3]];}}else{seg=[col];}line.push(seg);}if(!sorted)sort$1(line);decoded.push(line);index=semi+1;}while(index<=mappings.length);return decoded;}function indexOf(mappings,index){const idx=mappings.indexOf(';',index);return idx===-1?mappings.length:idx;}function decodeInteger(mappings,pos,state,j){let value=0;let shift=0;let integer=0;do{const c=mappings.charCodeAt(pos++);integer=charToInt[c];value|=(integer&31)<>>=1;if(shouldNegate){value=-0x80000000|-value;}state[j]+=value;return pos;}function hasMoreVlq(mappings,i,length){if(i>=length)return false;return mappings.charCodeAt(i)!==comma;}function sort$1(line){line.sort(sortComparator$1);}function sortComparator$1(a,b){return a[0]-b[0];}// Matches the scheme of a URL, eg "http://" const schemeRegex=/^[\\w+.-]+:\\/\\//;/** * Matches the parts of a URL: * 1. Scheme, including ":", guaranteed. @@ -8035,7 +8053,7 @@ const schemeRegex=/^[\\w+.-]+:\\/\\//;/** * 2. Path, which may include "/", guaranteed. * 3. Query, including "?", optional. * 4. Hash, including "#", optional. - */const fileRegex=/^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;var UrlType$1;(function(UrlType){UrlType[UrlType["Empty"]=1]="Empty";UrlType[UrlType["Hash"]=2]="Hash";UrlType[UrlType["Query"]=3]="Query";UrlType[UrlType["RelativePath"]=4]="RelativePath";UrlType[UrlType["AbsolutePath"]=5]="AbsolutePath";UrlType[UrlType["SchemeRelative"]=6]="SchemeRelative";UrlType[UrlType["Absolute"]=7]="Absolute";})(UrlType$1||(UrlType$1={}));function isAbsoluteUrl(input){return schemeRegex.test(input);}function isSchemeRelativeUrl(input){return input.startsWith('//');}function isAbsolutePath(input){return input.startsWith('/');}function isFileUrl(input){return input.startsWith('file:');}function isRelative(input){return /^[.?#]/.test(input);}function parseAbsoluteUrl(input){const match=urlRegex.exec(input);return makeUrl(match[1],match[2]||'',match[3],match[4]||'',match[5]||'/',match[6]||'',match[7]||'');}function parseFileUrl(input){const match=fileRegex.exec(input);const path=match[2];return makeUrl('file:','',match[1]||'','',isAbsolutePath(path)?path:'/'+path,match[3]||'',match[4]||'');}function makeUrl(scheme,user,host,port,path,query,hash){return{scheme,user,host,port,path,query,hash,type:UrlType$1.Absolute};}function parseUrl(input){if(isSchemeRelativeUrl(input)){const url=parseAbsoluteUrl('http:'+input);url.scheme='';url.type=UrlType$1.SchemeRelative;return url;}if(isAbsolutePath(input)){const url=parseAbsoluteUrl('http://foo.com'+input);url.scheme='';url.host='';url.type=UrlType$1.AbsolutePath;return url;}if(isFileUrl(input))return parseFileUrl(input);if(isAbsoluteUrl(input))return parseAbsoluteUrl(input);const url=parseAbsoluteUrl('http://foo.com/'+input);url.scheme='';url.host='';url.type=input?input.startsWith('?')?UrlType$1.Query:input.startsWith('#')?UrlType$1.Hash:UrlType$1.RelativePath:UrlType$1.Empty;return url;}function stripPathFilename(path){// If a path ends with a parent directory "..", then it's a relative path with excess parent + */const fileRegex=/^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;var UrlType;(function(UrlType){UrlType[UrlType["Empty"]=1]="Empty";UrlType[UrlType["Hash"]=2]="Hash";UrlType[UrlType["Query"]=3]="Query";UrlType[UrlType["RelativePath"]=4]="RelativePath";UrlType[UrlType["AbsolutePath"]=5]="AbsolutePath";UrlType[UrlType["SchemeRelative"]=6]="SchemeRelative";UrlType[UrlType["Absolute"]=7]="Absolute";})(UrlType||(UrlType={}));function isAbsoluteUrl(input){return schemeRegex.test(input);}function isSchemeRelativeUrl(input){return input.startsWith('//');}function isAbsolutePath(input){return input.startsWith('/');}function isFileUrl(input){return input.startsWith('file:');}function isRelative(input){return /^[.?#]/.test(input);}function parseAbsoluteUrl(input){const match=urlRegex.exec(input);return makeUrl(match[1],match[2]||'',match[3],match[4]||'',match[5]||'/',match[6]||'',match[7]||'');}function parseFileUrl(input){const match=fileRegex.exec(input);const path=match[2];return makeUrl('file:','',match[1]||'','',isAbsolutePath(path)?path:'/'+path,match[3]||'',match[4]||'');}function makeUrl(scheme,user,host,port,path,query,hash){return{scheme,user,host,port,path,query,hash,type:UrlType.Absolute};}function parseUrl(input){if(isSchemeRelativeUrl(input)){const url=parseAbsoluteUrl('http:'+input);url.scheme='';url.type=UrlType.SchemeRelative;return url;}if(isAbsolutePath(input)){const url=parseAbsoluteUrl('http://foo.com'+input);url.scheme='';url.host='';url.type=UrlType.AbsolutePath;return url;}if(isFileUrl(input))return parseFileUrl(input);if(isAbsoluteUrl(input))return parseAbsoluteUrl(input);const url=parseAbsoluteUrl('http://foo.com/'+input);url.scheme='';url.host='';url.type=input?input.startsWith('?')?UrlType.Query:input.startsWith('#')?UrlType.Hash:UrlType.RelativePath:UrlType.Empty;return url;}function stripPathFilename(path){// If a path ends with a parent directory "..", then it's a relative path with excess parent // paths. It's not a file, so we can't strip it. if(path.endsWith('/..'))return path;const index=path.lastIndexOf('/');return path.slice(0,index+1);}function mergePaths(url,base){normalizePath(base,base.type);// If the path is just a "/", then it was an empty path to begin with (remember, we're a relative // path). @@ -8043,7 +8061,7 @@ if(url.path==='/'){url.path=base.path;}else{// Resolution happens relative to th url.path=stripPathFilename(base.path)+url.path;}}/** * The path can have empty directories "//", unneeded parents "foo/..", or current directory * "foo/.". We need to normalize to a standard representation. - */function normalizePath(url,type){const rel=type<=UrlType$1.RelativePath;const pieces=url.path.split('/');// We need to preserve the first piece always, so that we output a leading slash. The item at + */function normalizePath(url,type){const rel=type<=UrlType.RelativePath;const pieces=url.path.split('/');// We need to preserve the first piece always, so that we output a leading slash. The item at // pieces[0] is an empty string. let pointer=1;// Positive is the number of real directories we've output, used for popping a parent directory. // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". @@ -8061,19 +8079,19 @@ pieces[pointer++]=piece;}continue;}// We've encountered a real directory. Move i // any popped or dropped directories. pieces[pointer++]=piece;positive++;}let path='';for(let i=1;iinputType)inputType=baseType;}normalizePath(url,inputType);const queryHash=url.query+url.hash;switch(inputType){// This is impossible, because of the empty checks at the start of the function. // case UrlType.Empty: -case UrlType$1.Hash:case UrlType$1.Query:return queryHash;case UrlType$1.RelativePath:{// The first char is always a "/", and we need it to be relative. +case UrlType.Hash:case UrlType.Query:return queryHash;case UrlType.RelativePath:{// The first char is always a "/", and we need it to be relative. const path=url.path.slice(1);if(!path)return queryHash||'.';if(isRelative(base||input)&&!isRelative(path)){// If base started with a leading ".", or there is no base and input started with a ".", // then we need to ensure that the relative path starts with a ".". We don't know if // relative starts with a "..", though, so check before prepending. -return'./'+path+queryHash;}return path+queryHash;}case UrlType$1.AbsolutePath:return url.path+queryHash;default:return url.scheme+'//'+url.user+url.host+url.port+url.path+queryHash;}}function resolve(input,base){// The base is always treated as a directory, if it's not empty. +return'./'+path+queryHash;}return path+queryHash;}case UrlType.AbsolutePath:return url.path+queryHash;default:return url.scheme+'//'+url.user+url.host+url.port+url.path+queryHash;}}function resolve(input,base){// The base is always treated as a directory, if it's not empty. // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 if(base&&!base.endsWith('/'))base+='/';return resolve$1(input,base);}/** @@ -8107,16 +8125,14 @@ low=lastIndex===-1?0:lastIndex;}else{high=lastIndex;}}state.lastKey=key;state.la * \`source-map\` library. */let originalPositionFor;class TraceMap{constructor(map,mapUrl){const isString=typeof map==='string';if(!isString&&map._decodedMemo)return map;const parsed=isString?JSON.parse(map):map;const version=parsed.version,file=parsed.file,names=parsed.names,sourceRoot=parsed.sourceRoot,sources=parsed.sources,sourcesContent=parsed.sourcesContent;this.version=version;this.file=file;this.names=names||[];this.sourceRoot=sourceRoot;this.sources=sources;this.sourcesContent=sourcesContent;const from=resolve(sourceRoot||'',stripFilename(mapUrl));this.resolvedSources=sources.map(s=>resolve(s||'',from));const mappings=parsed.mappings;if(typeof mappings==='string'){this._encoded=mappings;this._decoded=undefined;}else{this._encoded=undefined;this._decoded=maybeSort(mappings,isString);}this._decodedMemo=memoizedState();this._bySources=undefined;this._bySourceMemos=undefined;}}(()=>{decodedMappings=map=>{return map._decoded||(map._decoded=decode(map._encoded));};originalPositionFor=(map,{line,column,bias})=>{line--;if(line<0)throw new Error(LINE_GTR_ZERO);if(column<0)throw new Error(COL_GTR_EQ_ZERO);const decoded=decodedMappings(map);// It's common for parent source maps to have pointers to lines that have no // mapping (like a "//# sourceMappingURL=") at the end of the child file. -if(line>=decoded.length)return OMapping(null,null,null,null);const segments=decoded[line];const index=traceSegmentInternal(segments,map._decodedMemo,line,column,bias||GREATEST_LOWER_BOUND);if(index===-1)return OMapping(null,null,null,null);const segment=segments[index];if(segment.length===1)return OMapping(null,null,null,null);const names=map.names,resolvedSources=map.resolvedSources;return OMapping(resolvedSources[segment[SOURCES_INDEX]],segment[SOURCE_LINE]+1,segment[SOURCE_COLUMN],segment.length===5?names[segment[NAMES_INDEX]]:null);};})();function OMapping(source,line,column,name){return{source,line,column,name};}function traceSegmentInternal(segments,memo,line,column,bias){let index=memoizedBinarySearch(segments,column,memo,line);if(found){index=(bias===LEAST_UPPER_BOUND?upperBound:lowerBound)(segments,column,index);}else if(bias===LEAST_UPPER_BOUND)index++;if(index===-1||index===segments.length)return-1;return index;}const CHROME_IE_STACK_REGEXP$1=/^\\s*at .*(\\S+:\\d+|\\(native\\))/m;const SAFARI_NATIVE_CODE_REGEXP$1=/^(eval@)?(\\[native code])?$/;const stackIgnorePatterns=["node:internal",/\\/packages\\/\\w+\\/dist\\//,/\\/@vitest\\/\\w+\\/dist\\//,"/vitest/dist/","/vitest/src/","/vite-node/dist/","/vite-node/src/","/node_modules/chai/","/node_modules/tinypool/","/node_modules/tinyspy/","/deps/chai.js",/__vitest_browser__/];function extractLocation$1(urlLike){if(!urlLike.includes(":"))return[urlLike];const regExp=/(.+?)(?::(\\d+))?(?::(\\d+))?$/;const parts=regExp.exec(urlLike.replace(/^\\(|\\)$/g,""));if(!parts)return[urlLike];let url=parts[1];if(url.startsWith("http:")||url.startsWith("https:")){const urlObj=new URL(url);url=urlObj.pathname;}if(url.startsWith("/@fs/")){url=url.slice(typeof process!=="undefined"&&process.platform==="win32"?5:4);}return[url,parts[2]||void 0,parts[3]||void 0];}function parseSingleFFOrSafariStack$1(raw){let line=raw.trim();if(SAFARI_NATIVE_CODE_REGEXP$1.test(line))return null;if(line.includes(" > eval"))line=line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,":$1");if(!line.includes("@")&&!line.includes(":"))return null;const functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;const matches=line.match(functionNameRegex);const functionName=matches&&matches[1]?matches[1]:void 0;const _extractLocation$=extractLocation$1(line.replace(functionNameRegex,"")),_extractLocation$2=_slicedToArray(_extractLocation$,3),url=_extractLocation$2[0],lineNumber=_extractLocation$2[1],columnNumber=_extractLocation$2[2];if(!url||!lineNumber||!columnNumber)return null;return{file:url,method:functionName||"",line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseSingleV8Stack$1(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP$1.test(line))return null;if(line.includes("(eval "))line=line.replace(/eval code/g,"eval").replace(/(\\(eval at [^()]*)|(,.*$)/g,"");let sanitizedLine=line.replace(/^\\s+/,"").replace(/\\(eval code/g,"(").replace(/^.*?\\s+/,"");const location=sanitizedLine.match(/ (\\(.+\\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],""):sanitizedLine;const _extractLocation$3=extractLocation$1(location?location[1]:sanitizedLine),_extractLocation$4=_slicedToArray(_extractLocation$3,3),url=_extractLocation$4[0],lineNumber=_extractLocation$4[1],columnNumber=_extractLocation$4[2];let method=location&&sanitizedLine||"";let file=url&&["eval",""].includes(url)?void 0:url;if(!file||!lineNumber||!columnNumber)return null;if(method.startsWith("async "))method=method.slice(6);if(file.startsWith("file://"))file=file.slice(7);file=resolve$3(file);if(method)method=method.replace(/__vite_ssr_import_\\d+__\\./g,"");return{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseStacktrace(stack,options={}){const _options$ignoreStackE=options.ignoreStackEntries,ignoreStackEntries=_options$ignoreStackE===void 0?stackIgnorePatterns:_options$ignoreStackE;let stacks=!CHROME_IE_STACK_REGEXP$1.test(stack)?parseFFOrSafariStackTrace(stack):parseV8Stacktrace(stack);if(ignoreStackEntries.length)stacks=stacks.filter(stack2=>!ignoreStackEntries.some(p=>stack2.file.match(p)));return stacks.map(stack2=>{var _a;const map=(_a=options.getSourceMap)==null?void 0:_a.call(options,stack2.file);if(!map||typeof map!=="object"||!map.version)return stack2;const traceMap=new TraceMap(map);const _originalPositionFor=originalPositionFor(traceMap,stack2),line=_originalPositionFor.line,column=_originalPositionFor.column;if(line!=null&&column!=null)return _objectSpread(_objectSpread({},stack2),{},{line,column});return stack2;});}function parseFFOrSafariStackTrace(stack){return stack.split("\\n").map(line=>parseSingleFFOrSafariStack$1(line)).filter(notNullish);}function parseV8Stacktrace(stack){return stack.split("\\n").map(line=>parseSingleV8Stack$1(line)).filter(notNullish);}function parseErrorStacktrace(e,options={}){if(!e||isPrimitive(e))return[];if(e.stacks)return e.stacks;const stackStr=e.stack||e.stackStr||"";let stackFrames=parseStacktrace(stackStr,options);if(options.frameFilter)stackFrames=stackFrames.filter(f=>options.frameFilter(e,f)!==false);e.stacks=stackFrames;return stackFrames;}async function saveInlineSnapshots(environment,snapshots){const MagicString=(await import('./bundle-D12lh4FL.js')).default;const files=new Set(snapshots.map(i=>i.file));await Promise.all(Array.from(files).map(async file=>{const snaps=snapshots.filter(i=>i.file===file);const code=await environment.readSnapshotFile(file);const s=new MagicString(code);for(const snap of snaps){const index=positionToOffset(code,snap.line,snap.column);replaceInlineSnap(code,s,index,snap.snapshot);}const transformed=s.toString();if(transformed!==code)await environment.saveSnapshotFile(file,transformed);}));}const startObjectRegex=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\\s*\\(\\s*(?:\\/\\*[\\S\\s]*\\*\\/\\s*|\\/\\/.*\\s+)*\\s*({)/m;function replaceObjectSnap(code,s,index,newSnap){let _code=code.slice(index);const startMatch=startObjectRegex.exec(_code);if(!startMatch)return false;_code=_code.slice(startMatch.index);let callEnd=getCallLastIndex(_code);if(callEnd===null)return false;callEnd+=index+startMatch.index;const shapeStart=index+startMatch.index+startMatch[0].length;const shapeEnd=getObjectShapeEndIndex(code,shapeStart);const snap=\`, \${prepareSnapString(newSnap,code,index)}\`;if(shapeEnd===callEnd){s.appendLeft(callEnd,snap);}else{s.overwrite(shapeEnd,callEnd,snap);}return true;}function getObjectShapeEndIndex(code,index){let startBraces=1;let endBraces=0;while(startBraces!==endBraces&&index=decoded.length)return OMapping(null,null,null,null);const segments=decoded[line];const index=traceSegmentInternal(segments,map._decodedMemo,line,column,bias||GREATEST_LOWER_BOUND);if(index===-1)return OMapping(null,null,null,null);const segment=segments[index];if(segment.length===1)return OMapping(null,null,null,null);const names=map.names,resolvedSources=map.resolvedSources;return OMapping(resolvedSources[segment[SOURCES_INDEX]],segment[SOURCE_LINE]+1,segment[SOURCE_COLUMN],segment.length===5?names[segment[NAMES_INDEX]]:null);};})();function OMapping(source,line,column,name){return{source,line,column,name};}function traceSegmentInternal(segments,memo,line,column,bias){let index=memoizedBinarySearch(segments,column,memo,line);if(found){index=(bias===LEAST_UPPER_BOUND?upperBound:lowerBound)(segments,column,index);}else if(bias===LEAST_UPPER_BOUND)index++;if(index===-1||index===segments.length)return-1;return index;}const CHROME_IE_STACK_REGEXP=/^\\s*at .*(\\S+:\\d+|\\(native\\))/m;const SAFARI_NATIVE_CODE_REGEXP=/^(eval@)?(\\[native code])?$/;const stackIgnorePatterns=["node:internal",/\\/packages\\/\\w+\\/dist\\//,/\\/@vitest\\/\\w+\\/dist\\//,"/vitest/dist/","/vitest/src/","/vite-node/dist/","/vite-node/src/","/node_modules/chai/","/node_modules/tinypool/","/node_modules/tinyspy/","/deps/chai.js",/__vitest_browser__/];function extractLocation(urlLike){if(!urlLike.includes(":"))return[urlLike];const regExp=/(.+?)(?::(\\d+))?(?::(\\d+))?$/;const parts=regExp.exec(urlLike.replace(/^\\(|\\)$/g,""));if(!parts)return[urlLike];let url=parts[1];if(url.startsWith("http:")||url.startsWith("https:")){const urlObj=new URL(url);url=urlObj.pathname;}if(url.startsWith("/@fs/")){url=url.slice(typeof process!=="undefined"&&process.platform==="win32"?5:4);}return[url,parts[2]||void 0,parts[3]||void 0];}function parseSingleFFOrSafariStack(raw){let line=raw.trim();if(SAFARI_NATIVE_CODE_REGEXP.test(line))return null;if(line.includes(" > eval"))line=line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,":$1");if(!line.includes("@")&&!line.includes(":"))return null;const functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;const matches=line.match(functionNameRegex);const functionName=matches&&matches[1]?matches[1]:void 0;const _extractLocation=extractLocation(line.replace(functionNameRegex,"")),_extractLocation2=_slicedToArray(_extractLocation,3),url=_extractLocation2[0],lineNumber=_extractLocation2[1],columnNumber=_extractLocation2[2];if(!url||!lineNumber||!columnNumber)return null;return{file:url,method:functionName||"",line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseSingleV8Stack(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP.test(line))return null;if(line.includes("(eval "))line=line.replace(/eval code/g,"eval").replace(/(\\(eval at [^()]*)|(,.*$)/g,"");let sanitizedLine=line.replace(/^\\s+/,"").replace(/\\(eval code/g,"(").replace(/^.*?\\s+/,"");const location=sanitizedLine.match(/ (\\(.+\\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],""):sanitizedLine;const _extractLocation3=extractLocation(location?location[1]:sanitizedLine),_extractLocation4=_slicedToArray(_extractLocation3,3),url=_extractLocation4[0],lineNumber=_extractLocation4[1],columnNumber=_extractLocation4[2];let method=location&&sanitizedLine||"";let file=url&&["eval",""].includes(url)?void 0:url;if(!file||!lineNumber||!columnNumber)return null;if(method.startsWith("async "))method=method.slice(6);if(file.startsWith("file://"))file=file.slice(7);file=resolve$3(file);if(method)method=method.replace(/__vite_ssr_import_\\d+__\\./g,"");return{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseStacktrace(stack,options={}){const _options$ignoreStackE=options.ignoreStackEntries,ignoreStackEntries=_options$ignoreStackE===void 0?stackIgnorePatterns:_options$ignoreStackE;let stacks=!CHROME_IE_STACK_REGEXP.test(stack)?parseFFOrSafariStackTrace(stack):parseV8Stacktrace(stack);if(ignoreStackEntries.length)stacks=stacks.filter(stack2=>!ignoreStackEntries.some(p=>stack2.file.match(p)));return stacks.map(stack2=>{var _a;const map=(_a=options.getSourceMap)==null?void 0:_a.call(options,stack2.file);if(!map||typeof map!=="object"||!map.version)return stack2;const traceMap=new TraceMap(map);const _originalPositionFor=originalPositionFor(traceMap,stack2),line=_originalPositionFor.line,column=_originalPositionFor.column;if(line!=null&&column!=null)return _objectSpread(_objectSpread({},stack2),{},{line,column});return stack2;});}function parseFFOrSafariStackTrace(stack){return stack.split("\\n").map(line=>parseSingleFFOrSafariStack(line)).filter(notNullish);}function parseV8Stacktrace(stack){return stack.split("\\n").map(line=>parseSingleV8Stack(line)).filter(notNullish);}function parseErrorStacktrace(e,options={}){if(!e||isPrimitive(e))return[];if(e.stacks)return e.stacks;const stackStr=e.stack||e.stackStr||"";let stackFrames=parseStacktrace(stackStr,options);if(options.frameFilter)stackFrames=stackFrames.filter(f=>options.frameFilter(e,f)!==false);e.stacks=stackFrames;return stackFrames;}async function saveInlineSnapshots(environment,snapshots){const MagicString=(await import('./bundle-D7lcxiVj.js')).default;const files=new Set(snapshots.map(i=>i.file));await Promise.all(Array.from(files).map(async file=>{const snaps=snapshots.filter(i=>i.file===file);const code=await environment.readSnapshotFile(file);const s=new MagicString(code);for(const snap of snaps){const index=positionToOffset(code,snap.line,snap.column);replaceInlineSnap(code,s,index,snap.snapshot);}const transformed=s.toString();if(transformed!==code)await environment.saveSnapshotFile(file,transformed);}));}const startObjectRegex=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\\s*\\(\\s*(?:\\/\\*[\\S\\s]*\\*\\/\\s*|\\/\\/.*\\s+)*\\s*({)/m;function replaceObjectSnap(code,s,index,newSnap){let _code=code.slice(index);const startMatch=startObjectRegex.exec(_code);if(!startMatch)return false;_code=_code.slice(startMatch.index);let callEnd=getCallLastIndex(_code);if(callEnd===null)return false;callEnd+=index+startMatch.index;const shapeStart=index+startMatch.index+startMatch[0].length;const shapeEnd=getObjectShapeEndIndex(code,shapeStart);const snap=\`, \${prepareSnapString(newSnap,code,index)}\`;if(shapeEnd===callEnd){s.appendLeft(callEnd,snap);}else{s.overwrite(shapeEnd,callEnd,snap);}return true;}function getObjectShapeEndIndex(code,index){let startBraces=1;let endBraces=0;while(startBraces!==endBraces&&indexi?indentNext+i:"").join("\\n").replace(/\`/g,"\\\\\`").replace(/\\\${/g,"\\\\\${")} \${indent}\${quote}\`;}const startRegex=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\\s*\\(\\s*(?:\\/\\*[\\S\\s]*\\*\\/\\s*|\\/\\/.*\\s+)*\\s*[\\w_$]*(['"\`\\)])/m;function replaceInlineSnap(code,s,index,newSnap){const codeStartingAtIndex=code.slice(index);const startMatch=startRegex.exec(codeStartingAtIndex);const firstKeywordMatch=/toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot/.exec(codeStartingAtIndex);if(!startMatch||startMatch.index!==(firstKeywordMatch==null?void 0:firstKeywordMatch.index))return replaceObjectSnap(code,s,index,newSnap);const quote=startMatch[1];const startIndex=index+startMatch.index+startMatch[0].length;const snapString=prepareSnapString(newSnap,code,index);if(quote===")"){s.appendRight(startIndex-1,snapString);return true;}const quoteEndRE=new RegExp(\`(?:^|[^\\\\\\\\])\${quote}\`);const endMatch=quoteEndRE.exec(code.slice(startIndex));if(!endMatch)return false;const endIndex=startIndex+endMatch.index+endMatch[0].length;s.overwrite(startIndex-1,endIndex,snapString);return true;}const INDENTATION_REGEX=/^([^\\S\\n]*)\\S/m;function stripSnapshotIndentation(inlineSnapshot){const match=inlineSnapshot.match(INDENTATION_REGEX);if(!match||!match[1]){return inlineSnapshot;}const indentation=match[1];const lines=inlineSnapshot.split(/\\n/g);if(lines.length<=2){return inlineSnapshot;}if(lines[0].trim()!==""||lines[lines.length-1].trim()!==""){return inlineSnapshot;}for(let i=1;i{if(!snap.readonly)await environment.saveSnapshotFile(snap.file,snap.snapshot);}));}class SnapshotState{constructor(testFilePath,snapshotPath,snapshotContent,options){this.testFilePath=testFilePath;this.snapshotPath=snapshotPath;const _getSnapshotData=getSnapshotData(snapshotContent,options),data=_getSnapshotData.data,dirty=_getSnapshotData.dirty;this._fileExists=snapshotContent!=null;this._initialData=data;this._snapshotData=data;this._dirty=dirty;this._inlineSnapshots=[];this._rawSnapshots=[];this._uncheckedKeys=new Set(Object.keys(this._snapshotData));this._counters=/* @__PURE__ */new Map();this.expand=options.expand||false;this.added=0;this.matched=0;this.unmatched=0;this._updateSnapshot=options.updateSnapshot;this.updated=0;this._snapshotFormat=_objectSpread({printBasicPrototype:false,escapeString:false},options.snapshotFormat);this._environment=options.snapshotEnvironment;}_counters;_dirty;_updateSnapshot;_snapshotData;_initialData;_inlineSnapshots;_rawSnapshots;_uncheckedKeys;_snapshotFormat;_environment;_fileExists;added;expand;matched;unmatched;updated;static async create(testFilePath,options){const snapshotPath=await options.snapshotEnvironment.resolvePath(testFilePath);const content=await options.snapshotEnvironment.readSnapshotFile(snapshotPath);return new SnapshotState(testFilePath,snapshotPath,content,options);}get environment(){return this._environment;}markSnapshotsAsCheckedForTest(testName){this._uncheckedKeys.forEach(uncheckedKey=>{if(keyToTestName(uncheckedKey)===testName)this._uncheckedKeys.delete(uncheckedKey);});}_inferInlineSnapshotStack(stacks){const promiseIndex=stacks.findIndex(i=>i.method.match(/__VITEST_(RESOLVES|REJECTS)__/));if(promiseIndex!==-1)return stacks[promiseIndex+3];const stackIndex=stacks.findIndex(i=>i.method.includes("__INLINE_SNAPSHOT__"));return stackIndex!==-1?stacks[stackIndex+2]:null;}_addSnapshot(key,receivedSerialized,options){this._dirty=true;if(options.isInline){const stacks=parseErrorStacktrace(options.error||new Error("snapshot"),{ignoreStackEntries:[]});const stack=this._inferInlineSnapshotStack(stacks);if(!stack){throw new Error(\`@vitest/snapshot: Couldn't infer stack frame for inline snapshot. -\${JSON.stringify(stacks)}\`);}stack.column--;this._inlineSnapshots.push(_objectSpread({snapshot:receivedSerialized},stack));}else if(options.rawSnapshot){this._rawSnapshots.push(_objectSpread(_objectSpread({},options.rawSnapshot),{},{snapshot:receivedSerialized}));}else{this._snapshotData[key]=receivedSerialized;}}clear(){this._snapshotData=this._initialData;this._counters=/* @__PURE__ */new Map();this.added=0;this.matched=0;this.unmatched=0;this.updated=0;this._dirty=false;}async save(){const hasExternalSnapshots=Object.keys(this._snapshotData).length;const hasInlineSnapshots=this._inlineSnapshots.length;const hasRawSnapshots=this._rawSnapshots.length;const isEmpty=!hasExternalSnapshots&&!hasInlineSnapshots&&!hasRawSnapshots;const status={deleted:false,saved:false};if((this._dirty||this._uncheckedKeys.size)&&!isEmpty){if(hasExternalSnapshots){await saveSnapshotFile(this._environment,this._snapshotData,this.snapshotPath);this._fileExists=true;}if(hasInlineSnapshots)await saveInlineSnapshots(this._environment,this._inlineSnapshots);if(hasRawSnapshots)await saveRawSnapshots(this._environment,this._rawSnapshots);status.saved=true;}else if(!hasExternalSnapshots&&this._fileExists){if(this._updateSnapshot==="all"){await this._environment.removeSnapshotFile(this.snapshotPath);this._fileExists=false;}status.deleted=true;}return status;}getUncheckedCount(){return this._uncheckedKeys.size||0;}getUncheckedKeys(){return Array.from(this._uncheckedKeys);}removeUncheckedKeys(){if(this._updateSnapshot==="all"&&this._uncheckedKeys.size){this._dirty=true;this._uncheckedKeys.forEach(key=>delete this._snapshotData[key]);this._uncheckedKeys.clear();}}match({testName,received,key,inlineSnapshot,isInline,error,rawSnapshot}){this._counters.set(testName,(this._counters.get(testName)||0)+1);const count=Number(this._counters.get(testName));if(!key)key=testNameToKey(testName,count);if(!(isInline&&this._snapshotData[key]!==void 0))this._uncheckedKeys.delete(key);let receivedSerialized=rawSnapshot&&typeof received==="string"?received:serialize(received,void 0,this._snapshotFormat);if(!rawSnapshot)receivedSerialized=addExtraLineBreaks(receivedSerialized);if(rawSnapshot){if(rawSnapshot.content&&rawSnapshot.content.match(/\\r\\n/)&&!receivedSerialized.match(/\\r\\n/))rawSnapshot.content=normalizeNewlines(rawSnapshot.content);}const expected=isInline?inlineSnapshot:rawSnapshot?rawSnapshot.content:this._snapshotData[key];const expectedTrimmed=prepareExpected(expected);const pass=expectedTrimmed===prepareExpected(receivedSerialized);const hasSnapshot=expected!==void 0;const snapshotIsPersisted=isInline||this._fileExists||rawSnapshot&&rawSnapshot.content!=null;if(pass&&!isInline&&!rawSnapshot){this._snapshotData[key]=receivedSerialized;}if(hasSnapshot&&this._updateSnapshot==="all"||(!hasSnapshot||!snapshotIsPersisted)&&(this._updateSnapshot==="new"||this._updateSnapshot==="all")){if(this._updateSnapshot==="all"){if(!pass){if(hasSnapshot)this.updated++;else this.added++;this._addSnapshot(key,receivedSerialized,{error,isInline,rawSnapshot});}else{this.matched++;}}else{this._addSnapshot(key,receivedSerialized,{error,isInline,rawSnapshot});this.added++;}return{actual:"",count,expected:"",key,pass:true};}else{if(!pass){this.unmatched++;return{actual:removeExtraLineBreaks(receivedSerialized),count,expected:expectedTrimmed!==void 0?removeExtraLineBreaks(expectedTrimmed):void 0,key,pass:false};}else{this.matched++;return{actual:"",count,expected:"",key,pass:true};}}}async pack(){const snapshot={filepath:this.testFilePath,added:0,fileDeleted:false,matched:0,unchecked:0,uncheckedKeys:[],unmatched:0,updated:0};const uncheckedCount=this.getUncheckedCount();const uncheckedKeys=this.getUncheckedKeys();if(uncheckedCount)this.removeUncheckedKeys();const status=await this.save();snapshot.fileDeleted=status.deleted;snapshot.added=this.added;snapshot.matched=this.matched;snapshot.unmatched=this.unmatched;snapshot.updated=this.updated;snapshot.unchecked=!status.deleted?uncheckedCount:0;snapshot.uncheckedKeys=Array.from(uncheckedKeys);return snapshot;}}function createMismatchError(message,expand,actual,expected){const error=new Error(message);Object.defineProperty(error,"actual",{value:actual,enumerable:true,configurable:true,writable:true});Object.defineProperty(error,"expected",{value:expected,enumerable:true,configurable:true,writable:true});Object.defineProperty(error,"diffOptions",{value:{expand}});return error;}class SnapshotClient{constructor(options={}){this.options=options;}filepath;name;snapshotState;snapshotStateMap=/* @__PURE__ */new Map();async startCurrentRun(filepath,name,options){var _a;this.filepath=filepath;this.name=name;if(((_a=this.snapshotState)==null?void 0:_a.testFilePath)!==filepath){await this.finishCurrentRun();if(!this.getSnapshotState(filepath)){this.snapshotStateMap.set(filepath,await SnapshotState.create(filepath,options));}this.snapshotState=this.getSnapshotState(filepath);}}getSnapshotState(filepath){return this.snapshotStateMap.get(filepath);}clearTest(){this.filepath=void 0;this.name=void 0;}skipTestSnapshots(name){var _a;(_a=this.snapshotState)==null?void 0:_a.markSnapshotsAsCheckedForTest(name);}assert(options){var _a,_b,_c,_d;const _options$filepath=options.filepath,filepath=_options$filepath===void 0?this.filepath:_options$filepath,_options$name=options.name,name=_options$name===void 0?this.name:_options$name,message=options.message,_options$isInline=options.isInline,isInline=_options$isInline===void 0?false:_options$isInline,properties=options.properties,inlineSnapshot=options.inlineSnapshot,error=options.error,errorMessage=options.errorMessage,rawSnapshot=options.rawSnapshot;let received=options.received;if(!filepath)throw new Error("Snapshot cannot be used outside of test");if(typeof properties==="object"){if(typeof received!=="object"||!received)throw new Error("Received value must be an object when the matcher has properties");try{const pass2=((_b=(_a=this.options).isEqual)==null?void 0:_b.call(_a,received,properties))??false;if(!pass2)throw createMismatchError("Snapshot properties mismatched",(_c=this.snapshotState)==null?void 0:_c.expand,received,properties);else received=deepMergeSnapshot(received,properties);}catch(err){err.message=errorMessage||"Snapshot mismatched";throw err;}}const testName=[name,...(message?[message]:[])].join(" > ");const snapshotState=this.getSnapshotState(filepath);const _snapshotState$match=snapshotState.match({testName,received,isInline,error,inlineSnapshot,rawSnapshot}),actual=_snapshotState$match.actual,expected=_snapshotState$match.expected,key=_snapshotState$match.key,pass=_snapshotState$match.pass;if(!pass)throw createMismatchError(\`Snapshot \\\`\${key||"unknown"}\\\` mismatched\`,(_d=this.snapshotState)==null?void 0:_d.expand,actual==null?void 0:actual.trim(),expected==null?void 0:expected.trim());}async assertRaw(options){if(!options.rawSnapshot)throw new Error("Raw snapshot is required");const _options$filepath2=options.filepath,filepath=_options$filepath2===void 0?this.filepath:_options$filepath2,rawSnapshot=options.rawSnapshot;if(rawSnapshot.content==null){if(!filepath)throw new Error("Snapshot cannot be used outside of test");const snapshotState=this.getSnapshotState(filepath);options.filepath||(options.filepath=filepath);rawSnapshot.file=await snapshotState.environment.resolveRawPath(filepath,rawSnapshot.file);rawSnapshot.content=(await snapshotState.environment.readSnapshotFile(rawSnapshot.file))||void 0;}return this.assert(options);}async finishCurrentRun(){if(!this.snapshotState)return null;const result=await this.snapshotState.pack();this.snapshotState=void 0;return result;}clear(){this.snapshotStateMap.clear();}}function getFullName(task,separator=" > "){return getNames(task).join(separator);}function normalizeWindowsPath(input=""){if(!input||!input.includes("\\\\")){return input;}return input.replace(/\\\\/g,"/");}const _IS_ABSOLUTE_RE=/^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;function cwd(){if(typeof process!=="undefined"){return process.cwd().replace(/\\\\/g,"/");}return"/";}const resolve$2=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath(argument));let resolvedPath="";let resolvedAbsolute=false;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){const path=index>=0?arguments_[index]:cwd();if(!path||path.length===0){continue;}resolvedPath=\`\${path}/\${resolvedPath}\`;resolvedAbsolute=isAbsolute(path);}resolvedPath=normalizeString(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute&&!isAbsolute(resolvedPath)){return\`/\${resolvedPath}\`;}return resolvedPath.length>0?resolvedPath:".";};function normalizeString(path,allowAboveRoot){let res="";let lastSegmentLength=0;let lastSlash=-1;let dots=0;let char=null;for(let index=0;index<=path.length;++index){if(index2){const lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex===-1){res="";lastSegmentLength=0;}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/");}lastSlash=index;dots=0;continue;}else if(res.length>0){res="";lastSegmentLength=0;lastSlash=index;dots=0;continue;}}if(allowAboveRoot){res+=res.length>0?"/..":"..";lastSegmentLength=2;}}else{if(res.length>0){res+=\`/\${path.slice(lastSlash+1,index)}\`;}else{res=path.slice(lastSlash+1,index);}lastSegmentLength=index-lastSlash-1;}lastSlash=index;dots=0;}else if(char==="."&&dots!==-1){++dots;}else{dots=-1;}}return res;}const isAbsolute=function(p){return _IS_ABSOLUTE_RE.test(p);};const chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';const intToChar=new Uint8Array(64);// 64 possible chars. -const charToInt=new Uint8Array(128);// z is 122 in ASCII -for(let i=0;i eval"))line=line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,":$1");if(!line.includes("@")&&!line.includes(":"))return null;const functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;const matches=line.match(functionNameRegex);const functionName=matches&&matches[1]?matches[1]:void 0;const _extractLocation=extractLocation(line.replace(functionNameRegex,"")),_extractLocation2=_slicedToArray(_extractLocation,3),url=_extractLocation2[0],lineNumber=_extractLocation2[1],columnNumber=_extractLocation2[2];if(!url||!lineNumber||!columnNumber)return null;return{file:url,method:functionName||"",line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseSingleStack(raw){const line=raw.trim();if(!CHROME_IE_STACK_REGEXP.test(line))return parseSingleFFOrSafariStack(line);return parseSingleV8Stack(line);}function parseSingleV8Stack(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP.test(line))return null;if(line.includes("(eval "))line=line.replace(/eval code/g,"eval").replace(/(\\(eval at [^()]*)|(,.*$)/g,"");let sanitizedLine=line.replace(/^\\s+/,"").replace(/\\(eval code/g,"(").replace(/^.*?\\s+/,"");const location=sanitizedLine.match(/ (\\(.+\\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],""):sanitizedLine;const _extractLocation3=extractLocation(location?location[1]:sanitizedLine),_extractLocation4=_slicedToArray(_extractLocation3,3),url=_extractLocation4[0],lineNumber=_extractLocation4[1],columnNumber=_extractLocation4[2];let method=location&&sanitizedLine||"";let file=url&&["eval",""].includes(url)?void 0:url;if(!file||!lineNumber||!columnNumber)return null;if(method.startsWith("async "))method=method.slice(6);if(file.startsWith("file://"))file=file.slice(7);file=resolve$2(file);if(method)method=method.replace(/__vite_ssr_import_\\d+__\\./g,"");return{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function isChildProcess(){return typeof process!=="undefined"&&!!process.send;}const RealDate=Date;let now=null;class MockDate extends RealDate{constructor(y,m,d,h,M,s,ms){super();let date;switch(arguments.length){case 0:if(now!==null)date=new RealDate(now.valueOf());else date=new RealDate();break;case 1:date=new RealDate(y);break;default:d=typeof d==="undefined"?1:d;h=h||0;M=M||0;s=s||0;ms=ms||0;date=new RealDate(y,m,d,h,M,s,ms);break;}Object.setPrototypeOf(date,MockDate.prototype);return date;}}MockDate.UTC=RealDate.UTC;MockDate.now=function(){return new MockDate().valueOf();};MockDate.parse=function(dateString){return RealDate.parse(dateString);};MockDate.toString=function(){return RealDate.toString();};function mockDate(date){const dateObj=new RealDate(date.valueOf());if(Number.isNaN(dateObj.getTime()))throw new TypeError(\`mockdate: The time set is an invalid date: \${date}\`);globalThis.Date=MockDate;now=dateObj.valueOf();}function resetDate(){globalThis.Date=RealDate;}function resetModules(modules,resetMocks=false){const skipPaths=[// Vitest +\${JSON.stringify(stacks)}\`);}stack.column--;this._inlineSnapshots.push(_objectSpread({snapshot:receivedSerialized},stack));}else if(options.rawSnapshot){this._rawSnapshots.push(_objectSpread(_objectSpread({},options.rawSnapshot),{},{snapshot:receivedSerialized}));}else{this._snapshotData[key]=receivedSerialized;}}clear(){this._snapshotData=this._initialData;this._counters=/* @__PURE__ */new Map();this.added=0;this.matched=0;this.unmatched=0;this.updated=0;this._dirty=false;}async save(){const hasExternalSnapshots=Object.keys(this._snapshotData).length;const hasInlineSnapshots=this._inlineSnapshots.length;const hasRawSnapshots=this._rawSnapshots.length;const isEmpty=!hasExternalSnapshots&&!hasInlineSnapshots&&!hasRawSnapshots;const status={deleted:false,saved:false};if((this._dirty||this._uncheckedKeys.size)&&!isEmpty){if(hasExternalSnapshots){await saveSnapshotFile(this._environment,this._snapshotData,this.snapshotPath);this._fileExists=true;}if(hasInlineSnapshots)await saveInlineSnapshots(this._environment,this._inlineSnapshots);if(hasRawSnapshots)await saveRawSnapshots(this._environment,this._rawSnapshots);status.saved=true;}else if(!hasExternalSnapshots&&this._fileExists){if(this._updateSnapshot==="all"){await this._environment.removeSnapshotFile(this.snapshotPath);this._fileExists=false;}status.deleted=true;}return status;}getUncheckedCount(){return this._uncheckedKeys.size||0;}getUncheckedKeys(){return Array.from(this._uncheckedKeys);}removeUncheckedKeys(){if(this._updateSnapshot==="all"&&this._uncheckedKeys.size){this._dirty=true;this._uncheckedKeys.forEach(key=>delete this._snapshotData[key]);this._uncheckedKeys.clear();}}match({testName,received,key,inlineSnapshot,isInline,error,rawSnapshot}){this._counters.set(testName,(this._counters.get(testName)||0)+1);const count=Number(this._counters.get(testName));if(!key)key=testNameToKey(testName,count);if(!(isInline&&this._snapshotData[key]!==void 0))this._uncheckedKeys.delete(key);let receivedSerialized=rawSnapshot&&typeof received==="string"?received:serialize(received,void 0,this._snapshotFormat);if(!rawSnapshot)receivedSerialized=addExtraLineBreaks(receivedSerialized);if(rawSnapshot){if(rawSnapshot.content&&rawSnapshot.content.match(/\\r\\n/)&&!receivedSerialized.match(/\\r\\n/))rawSnapshot.content=normalizeNewlines(rawSnapshot.content);}const expected=isInline?inlineSnapshot:rawSnapshot?rawSnapshot.content:this._snapshotData[key];const expectedTrimmed=prepareExpected(expected);const pass=expectedTrimmed===prepareExpected(receivedSerialized);const hasSnapshot=expected!==void 0;const snapshotIsPersisted=isInline||this._fileExists||rawSnapshot&&rawSnapshot.content!=null;if(pass&&!isInline&&!rawSnapshot){this._snapshotData[key]=receivedSerialized;}if(hasSnapshot&&this._updateSnapshot==="all"||(!hasSnapshot||!snapshotIsPersisted)&&(this._updateSnapshot==="new"||this._updateSnapshot==="all")){if(this._updateSnapshot==="all"){if(!pass){if(hasSnapshot)this.updated++;else this.added++;this._addSnapshot(key,receivedSerialized,{error,isInline,rawSnapshot});}else{this.matched++;}}else{this._addSnapshot(key,receivedSerialized,{error,isInline,rawSnapshot});this.added++;}return{actual:"",count,expected:"",key,pass:true};}else{if(!pass){this.unmatched++;return{actual:removeExtraLineBreaks(receivedSerialized),count,expected:expectedTrimmed!==void 0?removeExtraLineBreaks(expectedTrimmed):void 0,key,pass:false};}else{this.matched++;return{actual:"",count,expected:"",key,pass:true};}}}async pack(){const snapshot={filepath:this.testFilePath,added:0,fileDeleted:false,matched:0,unchecked:0,uncheckedKeys:[],unmatched:0,updated:0};const uncheckedCount=this.getUncheckedCount();const uncheckedKeys=this.getUncheckedKeys();if(uncheckedCount)this.removeUncheckedKeys();const status=await this.save();snapshot.fileDeleted=status.deleted;snapshot.added=this.added;snapshot.matched=this.matched;snapshot.unmatched=this.unmatched;snapshot.updated=this.updated;snapshot.unchecked=!status.deleted?uncheckedCount:0;snapshot.uncheckedKeys=Array.from(uncheckedKeys);return snapshot;}}function createMismatchError(message,expand,actual,expected){const error=new Error(message);Object.defineProperty(error,"actual",{value:actual,enumerable:true,configurable:true,writable:true});Object.defineProperty(error,"expected",{value:expected,enumerable:true,configurable:true,writable:true});Object.defineProperty(error,"diffOptions",{value:{expand}});return error;}class SnapshotClient{constructor(options={}){this.options=options;}filepath;name;snapshotState;snapshotStateMap=/* @__PURE__ */new Map();async startCurrentRun(filepath,name,options){var _a;this.filepath=filepath;this.name=name;if(((_a=this.snapshotState)==null?void 0:_a.testFilePath)!==filepath){await this.finishCurrentRun();if(!this.getSnapshotState(filepath)){this.snapshotStateMap.set(filepath,await SnapshotState.create(filepath,options));}this.snapshotState=this.getSnapshotState(filepath);}}getSnapshotState(filepath){return this.snapshotStateMap.get(filepath);}clearTest(){this.filepath=void 0;this.name=void 0;}skipTestSnapshots(name){var _a;(_a=this.snapshotState)==null?void 0:_a.markSnapshotsAsCheckedForTest(name);}assert(options){var _a,_b,_c,_d;const _options$filepath=options.filepath,filepath=_options$filepath===void 0?this.filepath:_options$filepath,_options$name=options.name,name=_options$name===void 0?this.name:_options$name,message=options.message,_options$isInline=options.isInline,isInline=_options$isInline===void 0?false:_options$isInline,properties=options.properties,inlineSnapshot=options.inlineSnapshot,error=options.error,errorMessage=options.errorMessage,rawSnapshot=options.rawSnapshot;let received=options.received;if(!filepath)throw new Error("Snapshot cannot be used outside of test");if(typeof properties==="object"){if(typeof received!=="object"||!received)throw new Error("Received value must be an object when the matcher has properties");try{const pass2=((_b=(_a=this.options).isEqual)==null?void 0:_b.call(_a,received,properties))??false;if(!pass2)throw createMismatchError("Snapshot properties mismatched",(_c=this.snapshotState)==null?void 0:_c.expand,received,properties);else received=deepMergeSnapshot(received,properties);}catch(err){err.message=errorMessage||"Snapshot mismatched";throw err;}}const testName=[name,...(message?[message]:[])].join(" > ");const snapshotState=this.getSnapshotState(filepath);const _snapshotState$match=snapshotState.match({testName,received,isInline,error,inlineSnapshot,rawSnapshot}),actual=_snapshotState$match.actual,expected=_snapshotState$match.expected,key=_snapshotState$match.key,pass=_snapshotState$match.pass;if(!pass)throw createMismatchError(\`Snapshot \\\`\${key||"unknown"}\\\` mismatched\`,(_d=this.snapshotState)==null?void 0:_d.expand,actual==null?void 0:actual.trim(),expected==null?void 0:expected.trim());}async assertRaw(options){if(!options.rawSnapshot)throw new Error("Raw snapshot is required");const _options$filepath2=options.filepath,filepath=_options$filepath2===void 0?this.filepath:_options$filepath2,rawSnapshot=options.rawSnapshot;if(rawSnapshot.content==null){if(!filepath)throw new Error("Snapshot cannot be used outside of test");const snapshotState=this.getSnapshotState(filepath);options.filepath||(options.filepath=filepath);rawSnapshot.file=await snapshotState.environment.resolveRawPath(filepath,rawSnapshot.file);rawSnapshot.content=(await snapshotState.environment.readSnapshotFile(rawSnapshot.file))||void 0;}return this.assert(options);}async finishCurrentRun(){if(!this.snapshotState)return null;const result=await this.snapshotState.pack();this.snapshotState=void 0;return result;}clear(){this.snapshotStateMap.clear();}}function getFullName(task,separator=" > "){return getNames(task).join(separator);}function isChildProcess(){return typeof process!=="undefined"&&!!process.send;}const RealDate=Date;let now=null;class MockDate extends RealDate{constructor(y,m,d,h,M,s,ms){super();let date;switch(arguments.length){case 0:if(now!==null)date=new RealDate(now.valueOf());else date=new RealDate();break;case 1:date=new RealDate(y);break;default:d=typeof d==="undefined"?1:d;h=h||0;M=M||0;s=s||0;ms=ms||0;date=new RealDate(y,m,d,h,M,s,ms);break;}Object.setPrototypeOf(date,MockDate.prototype);return date;}}MockDate.UTC=RealDate.UTC;MockDate.now=function(){return new MockDate().valueOf();};MockDate.parse=function(dateString){return RealDate.parse(dateString);};MockDate.toString=function(){return RealDate.toString();};function mockDate(date){const dateObj=new RealDate(date.valueOf());if(Number.isNaN(dateObj.getTime()))throw new TypeError(\`mockdate: The time set is an invalid date: \${date}\`);globalThis.Date=MockDate;now=dateObj.valueOf();}function resetDate(){globalThis.Date=RealDate;}function resetModules(modules,resetMocks=false){const skipPaths=[// Vitest /\\/vitest\\/dist\\//,/\\/vite-node\\/dist\\//,// yarn's .store folder /vitest-virtual-\\w+\\/dist/,// cnpm /@vitest\\/dist/,// don't clear mocks -...(!resetMocks?[/^mock:/]:[])];modules.forEach((mod,path)=>{if(skipPaths.some(re=>re.test(path)))return;modules.invalidateModule(mod);});}function waitNextTick(){const _getSafeTimers2=getSafeTimers(),setTimeout=_getSafeTimers2.setTimeout;return new Promise(resolve=>setTimeout(resolve,0));}async function waitForImportsToResolve(){await waitNextTick();const state=getWorkerState();const promises=[];let resolvingCount=0;for(const mod of state.moduleCache.values()){if(mod.promise&&!mod.evaluated)promises.push(mod.promise);if(mod.resolving)resolvingCount++;}if(!promises.length&&!resolvingCount)return;await Promise.allSettled(promises);await waitForImportsToResolve();}function commonjsRequire(path){throw new Error('Could not dynamically require "'+path+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');}var chaiSubset={exports:{}};(function(module,exports){(function(){(function(chaiSubset){if(typeof commonjsRequire==='function'&&'object'==='object'&&'object'==='object'){return module.exports=chaiSubset;}else{return chai.use(chaiSubset);}})(function(chai,utils){var Assertion=chai.Assertion;var assertionPrototype=Assertion.prototype;Assertion.addMethod('containSubset',function(expected){var actual=utils.flag(this,'object');var showDiff=chai.config.showDiff;assertionPrototype.assert.call(this,compare(expected,actual),'expected #{act} to contain subset #{exp}','expected #{act} to not contain subset #{exp}',expected,actual,showDiff);});chai.assert.containSubset=function(val,exp,msg){new chai.Assertion(val,msg).to.be.containSubset(exp);};function compare(expected,actual){if(expected===actual){return true;}if(typeof actual!==typeof expected){return false;}if(typeof expected!=='object'||expected===null){return expected===actual;}if(!!expected&&!actual){return false;}if(Array.isArray(expected)){if(typeof actual.length!=='number'){return false;}var aa=Array.prototype.slice.call(actual);return expected.every(function(exp){return aa.some(function(act){return compare(exp,act);});});}if(expected instanceof Date){if(actual instanceof Date){return expected.getTime()===actual.getTime();}else{return false;}}return Object.keys(expected).every(function(key){var eo=expected[key];var ao=actual[key];if(typeof eo==='object'&&eo!==null&&ao!==null){return compare(eo,ao);}if(typeof eo==='function'){return eo(ao);}return ao===eo;});}});}).call(commonjsGlobal);})(chaiSubset);var chaiSubsetExports=chaiSubset.exports;var Subset=/*@__PURE__*/getDefaultExportFromCjs$1(chaiSubsetExports);const MATCHERS_OBJECT=Symbol.for("matchers-object");const JEST_MATCHERS_OBJECT=Symbol.for("$$jest-matchers-object");const GLOBAL_EXPECT=Symbol.for("expect-global");const ASYMMETRIC_MATCHERS_OBJECT=Symbol.for("asymmetric-matchers-object");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT)){const globalState=/* @__PURE__ */new WeakMap();const matchers=/* @__PURE__ */Object.create(null);const customEqualityTesters=[];const assymetricMatchers=/* @__PURE__ */Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT,{get:()=>globalState});Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT,{configurable:true,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT]),matchers,customEqualityTesters})});Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT,{get:()=>assymetricMatchers});}function recordAsyncExpect(test,promise){if(test&&promise instanceof Promise){promise=promise.finally(()=>{const index=test.promises.indexOf(promise);if(index!==-1)test.promises.splice(index,1);});if(!test.promises)test.promises=[];test.promises.push(promise);}return promise;}let _client;function getSnapshotClient(){if(!_client){_client=new SnapshotClient({isEqual:(received,expected)=>{return equals(received,expected,[iterableEquality,subsetEquality]);}});}return _client;}function getError(expected,promise){if(typeof expected!=="function"){if(!promise)throw new Error(\`expected must be a function, received \${typeof expected}\`);return expected;}try{expected();}catch(e){return e;}throw new Error("snapshot function didn't throw");}const SnapshotPlugin=(chai,utils)=>{const getTestNames=test=>{var _a;if(!test)return{};return{filepath:(_a=test.file)==null?void 0:_a.filepath,name:getNames(test).slice(1).join(" > ")};};for(const key of["matchSnapshot","toMatchSnapshot"]){utils.addMethod(chai.Assertion.prototype,key,function(properties,message){const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");if(typeof properties==="string"&&typeof message==="undefined"){message=properties;properties=void 0;}const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:expected,message,isInline:false,properties,errorMessage},getTestNames(test)));});}utils.addMethod(chai.Assertion.prototype,"toMatchFileSnapshot",function(file,message){const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");const errorMessage=utils.flag(this,"message");const promise=getSnapshotClient().assertRaw(_objectSpread({received:expected,message,isInline:false,rawSnapshot:{file},errorMessage},getTestNames(test)));return recordAsyncExpect(test,promise);});utils.addMethod(chai.Assertion.prototype,"toMatchInlineSnapshot",function __INLINE_SNAPSHOT__(properties,inlineSnapshot,message){var _a;const test=utils.flag(this,"vitest-test");const isInsideEach=test&&(test.each||((_a=test.suite)==null?void 0:_a.each));if(isInsideEach)throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const expected=utils.flag(this,"object");const error=utils.flag(this,"error");if(typeof properties==="string"){message=inlineSnapshot;inlineSnapshot=properties;properties=void 0;}if(inlineSnapshot)inlineSnapshot=stripSnapshotIndentation(inlineSnapshot);const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:expected,message,isInline:true,properties,inlineSnapshot,error,errorMessage},getTestNames(test)));});utils.addMethod(chai.Assertion.prototype,"toThrowErrorMatchingSnapshot",function(message){const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");const promise=utils.flag(this,"promise");const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:getError(expected,promise),message,errorMessage},getTestNames(test)));});utils.addMethod(chai.Assertion.prototype,"toThrowErrorMatchingInlineSnapshot",function __INLINE_SNAPSHOT__(inlineSnapshot,message){var _a;const test=utils.flag(this,"vitest-test");const isInsideEach=test&&(test.each||((_a=test.suite)==null?void 0:_a.each));if(isInsideEach)throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const expected=utils.flag(this,"object");const error=utils.flag(this,"error");const promise=utils.flag(this,"promise");const errorMessage=utils.flag(this,"message");if(inlineSnapshot)inlineSnapshot=stripSnapshotIndentation(inlineSnapshot);getSnapshotClient().assert(_objectSpread({received:getError(expected,promise),message,inlineSnapshot,isInline:true,error,errorMessage},getTestNames(test)));});utils.addMethod(chai.expect,"addSnapshotSerializer",addSerializer);};use(JestExtend);use(JestChaiExpect);use(Subset);use(SnapshotPlugin);use(JestAsymmetricMatchers);function createExpect(test){var _a;const expect$1=(value,message)=>{const _getState=getState(expect$1),assertionCalls=_getState.assertionCalls;setState({assertionCalls:assertionCalls+1,soft:false},expect$1);const assert2=expect(value,message);const _test=test||getCurrentTest();if(_test)return assert2.withTest(_test);else return assert2;};Object.assign(expect$1,expect);Object.assign(expect$1,globalThis[ASYMMETRIC_MATCHERS_OBJECT$1]);expect$1.getState=()=>getState(expect$1);expect$1.setState=state=>setState(state,expect$1);const globalState=getState(globalThis[GLOBAL_EXPECT$1])||{};setState(_objectSpread(_objectSpread({},globalState),{},{assertionCalls:0,isExpectingAssertions:false,isExpectingAssertionsError:null,expectedAssertionsNumber:null,expectedAssertionsNumberErrorGen:null,environment:getCurrentEnvironment(),testPath:test?(_a=test.suite.file)==null?void 0:_a.filepath:globalState.testPath,currentTestName:test?getFullName(test):globalState.currentTestName}),expect$1);expect$1.extend=matchers=>expect.extend(expect$1,matchers);expect$1.addEqualityTesters=customTesters=>addCustomEqualityTesters(customTesters);expect$1.soft=(...args)=>{const assert2=expect$1(...args);expect$1.setState({soft:true});return assert2;};expect$1.unreachable=message=>{assert.fail(\`expected\${message?\` "\${message}" \`:" "}not to be reached\`);};function assertions(expected){const errorGen=()=>new Error(\`expected number of assertions to be \${expected}, but got \${expect$1.getState().assertionCalls}\`);if(Error.captureStackTrace)Error.captureStackTrace(errorGen(),assertions);expect$1.setState({expectedAssertionsNumber:expected,expectedAssertionsNumberErrorGen:errorGen});}function hasAssertions(){const error=new Error("expected any number of assertion, but got none");if(Error.captureStackTrace)Error.captureStackTrace(error,hasAssertions);expect$1.setState({isExpectingAssertions:true,isExpectingAssertionsError:error});}util.addMethod(expect$1,"assertions",assertions);util.addMethod(expect$1,"hasAssertions",hasAssertions);return expect$1;}const globalExpect=createExpect();Object.defineProperty(globalThis,GLOBAL_EXPECT$1,{value:globalExpect,writable:true,configurable:true});/** +...(!resetMocks?[/^mock:/]:[])];modules.forEach((mod,path)=>{if(skipPaths.some(re=>re.test(path)))return;modules.invalidateModule(mod);});}function waitNextTick(){const _getSafeTimers2=getSafeTimers(),setTimeout=_getSafeTimers2.setTimeout;return new Promise(resolve=>setTimeout(resolve,0));}async function waitForImportsToResolve(){await waitNextTick();const state=getWorkerState();const promises=[];let resolvingCount=0;for(const mod of state.moduleCache.values()){if(mod.promise&&!mod.evaluated)promises.push(mod.promise);if(mod.resolving)resolvingCount++;}if(!promises.length&&!resolvingCount)return;await Promise.allSettled(promises);await waitForImportsToResolve();}function commonjsRequire(path){throw new Error('Could not dynamically require "'+path+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');}var chaiSubset={exports:{}};(function(module,exports){(function(){(function(chaiSubset){if(typeof commonjsRequire==='function'&&'object'==='object'&&'object'==='object'){return module.exports=chaiSubset;}else{return chai.use(chaiSubset);}})(function(chai,utils){var Assertion=chai.Assertion;var assertionPrototype=Assertion.prototype;Assertion.addMethod('containSubset',function(expected){var actual=utils.flag(this,'object');var showDiff=chai.config.showDiff;assertionPrototype.assert.call(this,compare(expected,actual),'expected #{act} to contain subset #{exp}','expected #{act} to not contain subset #{exp}',expected,actual,showDiff);});chai.assert.containSubset=function(val,exp,msg){new chai.Assertion(val,msg).to.be.containSubset(exp);};function compare(expected,actual){if(expected===actual){return true;}if(typeof actual!==typeof expected){return false;}if(typeof expected!=='object'||expected===null){return expected===actual;}if(!!expected&&!actual){return false;}if(Array.isArray(expected)){if(typeof actual.length!=='number'){return false;}var aa=Array.prototype.slice.call(actual);return expected.every(function(exp){return aa.some(function(act){return compare(exp,act);});});}if(expected instanceof Date){if(actual instanceof Date){return expected.getTime()===actual.getTime();}else{return false;}}return Object.keys(expected).every(function(key){var eo=expected[key];var ao=actual[key];if(typeof eo==='object'&&eo!==null&&ao!==null){return compare(eo,ao);}if(typeof eo==='function'){return eo(ao);}return ao===eo;});}});}).call(commonjsGlobal);})(chaiSubset);var chaiSubsetExports=chaiSubset.exports;var Subset=/*@__PURE__*/getDefaultExportFromCjs$1(chaiSubsetExports);const MATCHERS_OBJECT=Symbol.for("matchers-object");const JEST_MATCHERS_OBJECT=Symbol.for("$$jest-matchers-object");const GLOBAL_EXPECT=Symbol.for("expect-global");const ASYMMETRIC_MATCHERS_OBJECT=Symbol.for("asymmetric-matchers-object");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT)){const globalState=/* @__PURE__ */new WeakMap();const matchers=/* @__PURE__ */Object.create(null);const customEqualityTesters=[];const assymetricMatchers=/* @__PURE__ */Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT,{get:()=>globalState});Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT,{configurable:true,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT]),matchers,customEqualityTesters})});Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT,{get:()=>assymetricMatchers});}function recordAsyncExpect(test,promise){if(test&&promise instanceof Promise){promise=promise.finally(()=>{const index=test.promises.indexOf(promise);if(index!==-1)test.promises.splice(index,1);});if(!test.promises)test.promises=[];test.promises.push(promise);}return promise;}let _client;function getSnapshotClient(){if(!_client){_client=new SnapshotClient({isEqual:(received,expected)=>{return equals(received,expected,[iterableEquality,subsetEquality]);}});}return _client;}function getError(expected,promise){if(typeof expected!=="function"){if(!promise)throw new Error(\`expected must be a function, received \${typeof expected}\`);return expected;}try{expected();}catch(e){return e;}throw new Error("snapshot function didn't throw");}const SnapshotPlugin=(chai,utils)=>{const getTestNames=test=>{var _a;if(!test)return{};return{filepath:(_a=test.file)==null?void 0:_a.filepath,name:getNames(test).slice(1).join(" > ")};};for(const key of["matchSnapshot","toMatchSnapshot"]){utils.addMethod(chai.Assertion.prototype,key,function(properties,message){const isNot=utils.flag(this,"negate");if(isNot)throw new Error(\`\${key} cannot be used with "not"\`);const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");if(typeof properties==="string"&&typeof message==="undefined"){message=properties;properties=void 0;}const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:expected,message,isInline:false,properties,errorMessage},getTestNames(test)));});}utils.addMethod(chai.Assertion.prototype,"toMatchFileSnapshot",function(file,message){const isNot=utils.flag(this,"negate");if(isNot)throw new Error('toMatchFileSnapshot cannot be used with "not"');const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");const errorMessage=utils.flag(this,"message");const promise=getSnapshotClient().assertRaw(_objectSpread({received:expected,message,isInline:false,rawSnapshot:{file},errorMessage},getTestNames(test)));return recordAsyncExpect(test,promise);});utils.addMethod(chai.Assertion.prototype,"toMatchInlineSnapshot",function __INLINE_SNAPSHOT__(properties,inlineSnapshot,message){var _a;const isNot=utils.flag(this,"negate");if(isNot)throw new Error('toMatchInlineSnapshot cannot be used with "not"');const test=utils.flag(this,"vitest-test");const isInsideEach=test&&(test.each||((_a=test.suite)==null?void 0:_a.each));if(isInsideEach)throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const expected=utils.flag(this,"object");const error=utils.flag(this,"error");if(typeof properties==="string"){message=inlineSnapshot;inlineSnapshot=properties;properties=void 0;}if(inlineSnapshot)inlineSnapshot=stripSnapshotIndentation(inlineSnapshot);const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:expected,message,isInline:true,properties,inlineSnapshot,error,errorMessage},getTestNames(test)));});utils.addMethod(chai.Assertion.prototype,"toThrowErrorMatchingSnapshot",function(message){const isNot=utils.flag(this,"negate");if(isNot)throw new Error('toThrowErrorMatchingSnapshot cannot be used with "not"');const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");const promise=utils.flag(this,"promise");const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:getError(expected,promise),message,errorMessage},getTestNames(test)));});utils.addMethod(chai.Assertion.prototype,"toThrowErrorMatchingInlineSnapshot",function __INLINE_SNAPSHOT__(inlineSnapshot,message){var _a;const isNot=utils.flag(this,"negate");if(isNot)throw new Error('toThrowErrorMatchingInlineSnapshot cannot be used with "not"');const test=utils.flag(this,"vitest-test");const isInsideEach=test&&(test.each||((_a=test.suite)==null?void 0:_a.each));if(isInsideEach)throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const expected=utils.flag(this,"object");const error=utils.flag(this,"error");const promise=utils.flag(this,"promise");const errorMessage=utils.flag(this,"message");if(inlineSnapshot)inlineSnapshot=stripSnapshotIndentation(inlineSnapshot);getSnapshotClient().assert(_objectSpread({received:getError(expected,promise),message,inlineSnapshot,isInline:true,error,errorMessage},getTestNames(test)));});utils.addMethod(chai.expect,"addSnapshotSerializer",addSerializer);};use(JestExtend);use(JestChaiExpect);use(Subset);use(SnapshotPlugin);use(JestAsymmetricMatchers);function createExpect(test){var _a;const expect$1=(value,message)=>{const _getState=getState(expect$1),assertionCalls=_getState.assertionCalls;setState({assertionCalls:assertionCalls+1,soft:false},expect$1);const assert2=expect(value,message);const _test=test||getCurrentTest();if(_test)return assert2.withTest(_test);else return assert2;};Object.assign(expect$1,expect);Object.assign(expect$1,globalThis[ASYMMETRIC_MATCHERS_OBJECT$1]);expect$1.getState=()=>getState(expect$1);expect$1.setState=state=>setState(state,expect$1);const globalState=getState(globalThis[GLOBAL_EXPECT$1])||{};setState(_objectSpread(_objectSpread({},globalState),{},{assertionCalls:0,isExpectingAssertions:false,isExpectingAssertionsError:null,expectedAssertionsNumber:null,expectedAssertionsNumberErrorGen:null,environment:getCurrentEnvironment(),testPath:test?(_a=test.suite.file)==null?void 0:_a.filepath:globalState.testPath,currentTestName:test?getFullName(test):globalState.currentTestName}),expect$1);expect$1.extend=matchers=>expect.extend(expect$1,matchers);expect$1.addEqualityTesters=customTesters=>addCustomEqualityTesters(customTesters);expect$1.soft=(...args)=>{const assert2=expect$1(...args);expect$1.setState({soft:true});return assert2;};expect$1.unreachable=message=>{assert.fail(\`expected\${message?\` "\${message}" \`:" "}not to be reached\`);};function assertions(expected){const errorGen=()=>new Error(\`expected number of assertions to be \${expected}, but got \${expect$1.getState().assertionCalls}\`);if(Error.captureStackTrace)Error.captureStackTrace(errorGen(),assertions);expect$1.setState({expectedAssertionsNumber:expected,expectedAssertionsNumberErrorGen:errorGen});}function hasAssertions(){const error=new Error("expected any number of assertion, but got none");if(Error.captureStackTrace)Error.captureStackTrace(error,hasAssertions);expect$1.setState({isExpectingAssertions:true,isExpectingAssertionsError:error});}util.addMethod(expect$1,"assertions",assertions);util.addMethod(expect$1,"hasAssertions",hasAssertions);return expect$1;}const globalExpect=createExpect();Object.defineProperty(globalThis,GLOBAL_EXPECT$1,{value:globalExpect,writable:true,configurable:true});/** * A reference to the global object * * @type {object} globalObject @@ -8762,9 +8778,9 @@ throw new ReferenceError("non-existent performance object cannot be faked");}}if * @property {createClock} createClock * @property {Function} install * @property {withGlobal} withGlobal - */ /* eslint-enable complexity */ /** @type {FakeTimers} */const defaultImplementation=withGlobal(globalObject);defaultImplementation.timers;defaultImplementation.createClock;defaultImplementation.install;var withGlobal_1=withGlobal;class FakeTimers{_global;_clock;_fakingTime;_fakingDate;_fakeTimers;_userConfig;_now=RealDate.now;constructor({global,config}){this._userConfig=config;this._fakingDate=false;this._fakingTime=false;this._fakeTimers=withGlobal_1(global);this._global=global;}clearAllTimers(){if(this._fakingTime)this._clock.reset();}dispose(){this.useRealTimers();}runAllTimers(){if(this._checkFakeTimers())this._clock.runAll();}async runAllTimersAsync(){if(this._checkFakeTimers())await this._clock.runAllAsync();}runOnlyPendingTimers(){if(this._checkFakeTimers())this._clock.runToLast();}async runOnlyPendingTimersAsync(){if(this._checkFakeTimers())await this._clock.runToLastAsync();}advanceTimersToNextTimer(steps=1){if(this._checkFakeTimers()){for(let i=steps;i>0;i--){this._clock.next();this._clock.tick(0);if(this._clock.countTimers()===0)break;}}}async advanceTimersToNextTimerAsync(steps=1){if(this._checkFakeTimers()){for(let i=steps;i>0;i--){await this._clock.nextAsync();this._clock.tick(0);if(this._clock.countTimers()===0)break;}}}advanceTimersByTime(msToRun){if(this._checkFakeTimers())this._clock.tick(msToRun);}async advanceTimersByTimeAsync(msToRun){if(this._checkFakeTimers())await this._clock.tickAsync(msToRun);}runAllTicks(){if(this._checkFakeTimers()){this._clock.runMicrotasks();}}useRealTimers(){if(this._fakingDate){resetDate();this._fakingDate=false;}if(this._fakingTime){this._clock.uninstall();this._fakingTime=false;}}useFakeTimers(){var _a,_b,_c;if(this._fakingDate){throw new Error('"setSystemTime" was called already and date was mocked. Reset timers using \`vi.useRealTimers()\` if you want to use fake timers again.');}if(!this._fakingTime){const toFake=Object.keys(this._fakeTimers.timers).filter(timer=>timer!=="nextTick");if(((_b=(_a=this._userConfig)==null?void 0:_a.toFake)==null?void 0:_b.includes("nextTick"))&&isChildProcess())throw new Error("process.nextTick cannot be mocked inside child_process");const existingFakedMethods=(((_c=this._userConfig)==null?void 0:_c.toFake)||toFake).filter(method=>{switch(method){case"setImmediate":case"clearImmediate":return method in this._global&&this._global[method];default:return true;}});this._clock=this._fakeTimers.install(_objectSpread(_objectSpread({now:Date.now()},this._userConfig),{},{toFake:existingFakedMethods}));this._fakingTime=true;}}reset(){if(this._checkFakeTimers()){const now=this._clock.now;this._clock.reset();this._clock.setSystemTime(now);}}setSystemTime(now){if(this._fakingTime){this._clock.setSystemTime(now);}else{mockDate(now??this.getRealSystemTime());this._fakingDate=true;}}getRealSystemTime(){return this._now();}getTimerCount(){if(this._checkFakeTimers())return this._clock.countTimers();return 0;}configure(config){this._userConfig=config;}isFakeTimers(){return this._fakingTime;}_checkFakeTimers(){if(!this._fakingTime){throw new Error('Timers are not mocked. Try calling "vi.useFakeTimers()" first.');}return this._fakingTime;}}function copyStackTrace(target,source){if(source.stack!==void 0)target.stack=source.stack.replace(source.message,target.message);return target;}function waitFor(callback,options={}){const _getSafeTimers3=getSafeTimers(),setTimeout=_getSafeTimers3.setTimeout,setInterval=_getSafeTimers3.setInterval,clearTimeout=_getSafeTimers3.clearTimeout,clearInterval=_getSafeTimers3.clearInterval;const _ref12=typeof options==="number"?{timeout:options}:options,_ref12$interval=_ref12.interval,interval=_ref12$interval===void 0?50:_ref12$interval,_ref12$timeout=_ref12.timeout,timeout=_ref12$timeout===void 0?1e3:_ref12$timeout;const STACK_TRACE_ERROR=new Error("STACK_TRACE_ERROR");return new Promise((resolve,reject)=>{let lastError;let promiseStatus="idle";let timeoutId;let intervalId;const onResolve=result=>{if(timeoutId)clearTimeout(timeoutId);if(intervalId)clearInterval(intervalId);resolve(result);};const handleTimeout=()=>{let error=lastError;if(!error)error=copyStackTrace(new Error("Timed out in waitFor!"),STACK_TRACE_ERROR);reject(error);};const checkCallback=()=>{if(vi.isFakeTimers())vi.advanceTimersByTime(interval);if(promiseStatus==="pending")return;try{const result=callback();if(result!==null&&typeof result==="object"&&typeof result.then==="function"){const thenable=result;promiseStatus="pending";thenable.then(resolvedValue=>{promiseStatus="resolved";onResolve(resolvedValue);},rejectedValue=>{promiseStatus="rejected";lastError=rejectedValue;});}else{onResolve(result);return true;}}catch(error){lastError=error;}};if(checkCallback()===true)return;timeoutId=setTimeout(handleTimeout,timeout);intervalId=setInterval(checkCallback,interval);});}function waitUntil(callback,options={}){const _getSafeTimers4=getSafeTimers(),setTimeout=_getSafeTimers4.setTimeout,setInterval=_getSafeTimers4.setInterval,clearTimeout=_getSafeTimers4.clearTimeout,clearInterval=_getSafeTimers4.clearInterval;const _ref13=typeof options==="number"?{timeout:options}:options,_ref13$interval=_ref13.interval,interval=_ref13$interval===void 0?50:_ref13$interval,_ref13$timeout=_ref13.timeout,timeout=_ref13$timeout===void 0?1e3:_ref13$timeout;const STACK_TRACE_ERROR=new Error("STACK_TRACE_ERROR");return new Promise((resolve,reject)=>{let promiseStatus="idle";let timeoutId;let intervalId;const onReject=error=>{if(!error)error=copyStackTrace(new Error("Timed out in waitUntil!"),STACK_TRACE_ERROR);reject(error);};const onResolve=result=>{if(!result)return;if(timeoutId)clearTimeout(timeoutId);if(intervalId)clearInterval(intervalId);resolve(result);return true;};const checkCallback=()=>{if(vi.isFakeTimers())vi.advanceTimersByTime(interval);if(promiseStatus==="pending")return;try{const result=callback();if(result!==null&&typeof result==="object"&&typeof result.then==="function"){const thenable=result;promiseStatus="pending";thenable.then(resolvedValue=>{promiseStatus="resolved";onResolve(resolvedValue);},rejectedValue=>{promiseStatus="rejected";onReject(rejectedValue);});}else{return onResolve(result);}}catch(error){onReject(error);}};if(checkCallback()===true)return;timeoutId=setTimeout(onReject,timeout);intervalId=setInterval(checkCallback,interval);});}function createVitest(){const _mocker=typeof __vitest_mocker__!=="undefined"?__vitest_mocker__:new Proxy({},{get(_,name){throw new Error(\`Vitest mocker was not initialized in this environment. vi.\${String(name)}() is forbidden.\`);}});let _mockedDate=null;let _config=null;const workerState=getWorkerState();const _timers=new FakeTimers({global:globalThis,config:workerState.config.fakeTimers});const _stubsGlobal=/* @__PURE__ */new Map();const _stubsEnv=/* @__PURE__ */new Map();const getImporter=()=>{const stackTrace=createSimpleStackTrace({stackTraceLimit:4});const importerStack=stackTrace.split("\\n")[4];const stack=parseSingleStack(importerStack);return(stack==null?void 0:stack.file)||"";};const utils={useFakeTimers(config){var _a,_b,_c,_d;if(isChildProcess()){if(((_a=config==null?void 0:config.toFake)==null?void 0:_a.includes("nextTick"))||((_d=(_c=(_b=workerState.config)==null?void 0:_b.fakeTimers)==null?void 0:_c.toFake)==null?void 0:_d.includes("nextTick"))){throw new Error('vi.useFakeTimers({ toFake: ["nextTick"] }) is not supported in node:child_process. Use --pool=threads if mocking nextTick is required.');}}if(config)_timers.configure(_objectSpread(_objectSpread({},workerState.config.fakeTimers),config));else _timers.configure(workerState.config.fakeTimers);_timers.useFakeTimers();return utils;},isFakeTimers(){return _timers.isFakeTimers();},useRealTimers(){_timers.useRealTimers();_mockedDate=null;return utils;},runOnlyPendingTimers(){_timers.runOnlyPendingTimers();return utils;},async runOnlyPendingTimersAsync(){await _timers.runOnlyPendingTimersAsync();return utils;},runAllTimers(){_timers.runAllTimers();return utils;},async runAllTimersAsync(){await _timers.runAllTimersAsync();return utils;},runAllTicks(){_timers.runAllTicks();return utils;},advanceTimersByTime(ms){_timers.advanceTimersByTime(ms);return utils;},async advanceTimersByTimeAsync(ms){await _timers.advanceTimersByTimeAsync(ms);return utils;},advanceTimersToNextTimer(){_timers.advanceTimersToNextTimer();return utils;},async advanceTimersToNextTimerAsync(){await _timers.advanceTimersToNextTimerAsync();return utils;},getTimerCount(){return _timers.getTimerCount();},setSystemTime(time){const date=time instanceof Date?time:new Date(time);_mockedDate=date;_timers.setSystemTime(date);return utils;},getMockedSystemTime(){return _mockedDate;},getRealSystemTime(){return _timers.getRealSystemTime();},clearAllTimers(){_timers.clearAllTimers();return utils;},// mocks + */ /* eslint-enable complexity */ /** @type {FakeTimers} */const defaultImplementation=withGlobal(globalObject);defaultImplementation.timers;defaultImplementation.createClock;defaultImplementation.install;var withGlobal_1=withGlobal;class FakeTimers{_global;_clock;_fakingTime;_fakingDate;_fakeTimers;_userConfig;_now=RealDate.now;constructor({global,config}){this._userConfig=config;this._fakingDate=false;this._fakingTime=false;this._fakeTimers=withGlobal_1(global);this._global=global;}clearAllTimers(){if(this._fakingTime)this._clock.reset();}dispose(){this.useRealTimers();}runAllTimers(){if(this._checkFakeTimers())this._clock.runAll();}async runAllTimersAsync(){if(this._checkFakeTimers())await this._clock.runAllAsync();}runOnlyPendingTimers(){if(this._checkFakeTimers())this._clock.runToLast();}async runOnlyPendingTimersAsync(){if(this._checkFakeTimers())await this._clock.runToLastAsync();}advanceTimersToNextTimer(steps=1){if(this._checkFakeTimers()){for(let i=steps;i>0;i--){this._clock.next();this._clock.tick(0);if(this._clock.countTimers()===0)break;}}}async advanceTimersToNextTimerAsync(steps=1){if(this._checkFakeTimers()){for(let i=steps;i>0;i--){await this._clock.nextAsync();this._clock.tick(0);if(this._clock.countTimers()===0)break;}}}advanceTimersByTime(msToRun){if(this._checkFakeTimers())this._clock.tick(msToRun);}async advanceTimersByTimeAsync(msToRun){if(this._checkFakeTimers())await this._clock.tickAsync(msToRun);}runAllTicks(){if(this._checkFakeTimers()){this._clock.runMicrotasks();}}useRealTimers(){if(this._fakingDate){resetDate();this._fakingDate=false;}if(this._fakingTime){this._clock.uninstall();this._fakingTime=false;}}useFakeTimers(){var _a,_b,_c;if(this._fakingDate){throw new Error('"setSystemTime" was called already and date was mocked. Reset timers using \`vi.useRealTimers()\` if you want to use fake timers again.');}if(!this._fakingTime){const toFake=Object.keys(this._fakeTimers.timers).filter(timer=>timer!=="nextTick");if(((_b=(_a=this._userConfig)==null?void 0:_a.toFake)==null?void 0:_b.includes("nextTick"))&&isChildProcess())throw new Error("process.nextTick cannot be mocked inside child_process");const existingFakedMethods=(((_c=this._userConfig)==null?void 0:_c.toFake)||toFake).filter(method=>{switch(method){case"setImmediate":case"clearImmediate":return method in this._global&&this._global[method];default:return true;}});this._clock=this._fakeTimers.install(_objectSpread(_objectSpread({now:Date.now()},this._userConfig),{},{toFake:existingFakedMethods}));this._fakingTime=true;}}reset(){if(this._checkFakeTimers()){const now=this._clock.now;this._clock.reset();this._clock.setSystemTime(now);}}setSystemTime(now){if(this._fakingTime){this._clock.setSystemTime(now);}else{mockDate(now??this.getRealSystemTime());this._fakingDate=true;}}getRealSystemTime(){return this._now();}getTimerCount(){if(this._checkFakeTimers())return this._clock.countTimers();return 0;}configure(config){this._userConfig=config;}isFakeTimers(){return this._fakingTime;}_checkFakeTimers(){if(!this._fakingTime){throw new Error('Timers are not mocked. Try calling "vi.useFakeTimers()" first.');}return this._fakingTime;}}function copyStackTrace(target,source){if(source.stack!==void 0)target.stack=source.stack.replace(source.message,target.message);return target;}function waitFor(callback,options={}){const _getSafeTimers3=getSafeTimers(),setTimeout=_getSafeTimers3.setTimeout,setInterval=_getSafeTimers3.setInterval,clearTimeout=_getSafeTimers3.clearTimeout,clearInterval=_getSafeTimers3.clearInterval;const _ref12=typeof options==="number"?{timeout:options}:options,_ref12$interval=_ref12.interval,interval=_ref12$interval===void 0?50:_ref12$interval,_ref12$timeout=_ref12.timeout,timeout=_ref12$timeout===void 0?1e3:_ref12$timeout;const STACK_TRACE_ERROR=new Error("STACK_TRACE_ERROR");return new Promise((resolve,reject)=>{let lastError;let promiseStatus="idle";let timeoutId;let intervalId;const onResolve=result=>{if(timeoutId)clearTimeout(timeoutId);if(intervalId)clearInterval(intervalId);resolve(result);};const handleTimeout=()=>{let error=lastError;if(!error)error=copyStackTrace(new Error("Timed out in waitFor!"),STACK_TRACE_ERROR);reject(error);};const checkCallback=()=>{if(vi.isFakeTimers())vi.advanceTimersByTime(interval);if(promiseStatus==="pending")return;try{const result=callback();if(result!==null&&typeof result==="object"&&typeof result.then==="function"){const thenable=result;promiseStatus="pending";thenable.then(resolvedValue=>{promiseStatus="resolved";onResolve(resolvedValue);},rejectedValue=>{promiseStatus="rejected";lastError=rejectedValue;});}else{onResolve(result);return true;}}catch(error){lastError=error;}};if(checkCallback()===true)return;timeoutId=setTimeout(handleTimeout,timeout);intervalId=setInterval(checkCallback,interval);});}function waitUntil(callback,options={}){const _getSafeTimers4=getSafeTimers(),setTimeout=_getSafeTimers4.setTimeout,setInterval=_getSafeTimers4.setInterval,clearTimeout=_getSafeTimers4.clearTimeout,clearInterval=_getSafeTimers4.clearInterval;const _ref13=typeof options==="number"?{timeout:options}:options,_ref13$interval=_ref13.interval,interval=_ref13$interval===void 0?50:_ref13$interval,_ref13$timeout=_ref13.timeout,timeout=_ref13$timeout===void 0?1e3:_ref13$timeout;const STACK_TRACE_ERROR=new Error("STACK_TRACE_ERROR");return new Promise((resolve,reject)=>{let promiseStatus="idle";let timeoutId;let intervalId;const onReject=error=>{if(!error)error=copyStackTrace(new Error("Timed out in waitUntil!"),STACK_TRACE_ERROR);reject(error);};const onResolve=result=>{if(!result)return;if(timeoutId)clearTimeout(timeoutId);if(intervalId)clearInterval(intervalId);resolve(result);return true;};const checkCallback=()=>{if(vi.isFakeTimers())vi.advanceTimersByTime(interval);if(promiseStatus==="pending")return;try{const result=callback();if(result!==null&&typeof result==="object"&&typeof result.then==="function"){const thenable=result;promiseStatus="pending";thenable.then(resolvedValue=>{promiseStatus="resolved";onResolve(resolvedValue);},rejectedValue=>{promiseStatus="rejected";onReject(rejectedValue);});}else{return onResolve(result);}}catch(error){onReject(error);}};if(checkCallback()===true)return;timeoutId=setTimeout(onReject,timeout);intervalId=setInterval(checkCallback,interval);});}function createVitest(){const _mocker=typeof __vitest_mocker__!=="undefined"?__vitest_mocker__:new Proxy({},{get(_,name){throw new Error(\`Vitest mocker was not initialized in this environment. vi.\${String(name)}() is forbidden.\`);}});let _mockedDate=null;let _config=null;const workerState=getWorkerState();let _timers;const timers=()=>_timers||(_timers=new FakeTimers({global:globalThis,config:workerState.config.fakeTimers}));const _stubsGlobal=/* @__PURE__ */new Map();const _stubsEnv=/* @__PURE__ */new Map();const _envBooleans=["PROD","DEV","SSR"];const getImporter=()=>{const stackTrace=createSimpleStackTrace({stackTraceLimit:4});const importerStack=stackTrace.split("\\n")[4];const stack=parseSingleStack(importerStack);return(stack==null?void 0:stack.file)||"";};const utils={useFakeTimers(config){var _a,_b,_c,_d;if(isChildProcess()){if(((_a=config==null?void 0:config.toFake)==null?void 0:_a.includes("nextTick"))||((_d=(_c=(_b=workerState.config)==null?void 0:_b.fakeTimers)==null?void 0:_c.toFake)==null?void 0:_d.includes("nextTick"))){throw new Error('vi.useFakeTimers({ toFake: ["nextTick"] }) is not supported in node:child_process. Use --pool=threads if mocking nextTick is required.');}}if(config)timers().configure(_objectSpread(_objectSpread({},workerState.config.fakeTimers),config));else timers().configure(workerState.config.fakeTimers);timers().useFakeTimers();return utils;},isFakeTimers(){return timers().isFakeTimers();},useRealTimers(){timers().useRealTimers();_mockedDate=null;return utils;},runOnlyPendingTimers(){timers().runOnlyPendingTimers();return utils;},async runOnlyPendingTimersAsync(){await timers().runOnlyPendingTimersAsync();return utils;},runAllTimers(){timers().runAllTimers();return utils;},async runAllTimersAsync(){await timers().runAllTimersAsync();return utils;},runAllTicks(){timers().runAllTicks();return utils;},advanceTimersByTime(ms){timers().advanceTimersByTime(ms);return utils;},async advanceTimersByTimeAsync(ms){await timers().advanceTimersByTimeAsync(ms);return utils;},advanceTimersToNextTimer(){timers().advanceTimersToNextTimer();return utils;},async advanceTimersToNextTimerAsync(){await timers().advanceTimersToNextTimerAsync();return utils;},getTimerCount(){return timers().getTimerCount();},setSystemTime(time){const date=time instanceof Date?time:new Date(time);_mockedDate=date;timers().setSystemTime(date);return utils;},getMockedSystemTime(){return _mockedDate;},getRealSystemTime(){return timers().getRealSystemTime();},clearAllTimers(){timers().clearAllTimers();return utils;},// mocks spyOn,fn,waitFor,waitUntil,hoisted(factory){assertTypes(factory,'"vi.hoisted" factory',["function"]);return factory();},mock(path,factory){const importer=getImporter();_mocker.queueMock(path,importer,factory?()=>factory(()=>_mocker.importActual(path,importer,_mocker.getMockContext().callstack)):void 0,true);},unmock(path){_mocker.queueUnmock(path,getImporter());},doMock(path,factory){const importer=getImporter();_mocker.queueMock(path,importer,factory?()=>factory(()=>_mocker.importActual(path,importer,_mocker.getMockContext().callstack)):void 0,false);},doUnmock(path){_mocker.queueUnmock(path,getImporter());},async importActual(path){return _mocker.importActual(path,getImporter(),_mocker.getMockContext().callstack);},async importMock(path){return _mocker.importMock(path,getImporter());},// this is typed in the interface so it's not necessary to type it here -mocked(item,_options={}){return item;},isMockFunction(fn2){return isMockFunction(fn2);},clearAllMocks(){mocks.forEach(spy=>spy.mockClear());return utils;},resetAllMocks(){mocks.forEach(spy=>spy.mockReset());return utils;},restoreAllMocks(){mocks.forEach(spy=>spy.mockRestore());return utils;},stubGlobal(name,value){if(!_stubsGlobal.has(name))_stubsGlobal.set(name,Object.getOwnPropertyDescriptor(globalThis,name));Object.defineProperty(globalThis,name,{value,writable:true,configurable:true,enumerable:true});return utils;},stubEnv(name,value){if(!_stubsEnv.has(name))_stubsEnv.set(name,process.env[name]);process.env[name]=value;return utils;},unstubAllGlobals(){_stubsGlobal.forEach((original,name)=>{if(!original)Reflect.deleteProperty(globalThis,name);else Object.defineProperty(globalThis,name,original);});_stubsGlobal.clear();return utils;},unstubAllEnvs(){_stubsEnv.forEach((original,name)=>{if(original===void 0)delete process.env[name];else process.env[name]=original;});_stubsEnv.clear();return utils;},resetModules(){resetModules(workerState.moduleCache);return utils;},async dynamicImportSettled(){return waitForImportsToResolve();},setConfig(config){if(!_config)_config=_objectSpread({},workerState.config);Object.assign(workerState.config,config);},resetConfig(){if(_config)Object.assign(workerState.config,_config);}};return utils;}const vitest=createVitest();const vi=vitest;class Spy{called=false;mock=()=>{};method(){}}function spy(){const inst=new Spy();return vi.fn(inst.mock);}async function wait(){}exports.spy=spy;exports.wait=wait; +mocked(item,_options={}){return item;},isMockFunction(fn2){return isMockFunction(fn2);},clearAllMocks(){mocks.forEach(spy=>spy.mockClear());return utils;},resetAllMocks(){mocks.forEach(spy=>spy.mockReset());return utils;},restoreAllMocks(){mocks.forEach(spy=>spy.mockRestore());return utils;},stubGlobal(name,value){if(!_stubsGlobal.has(name))_stubsGlobal.set(name,Object.getOwnPropertyDescriptor(globalThis,name));Object.defineProperty(globalThis,name,{value,writable:true,configurable:true,enumerable:true});return utils;},stubEnv(name,value){if(!_stubsEnv.has(name))_stubsEnv.set(name,process.env[name]);if(_envBooleans.includes(name))process.env[name]=value?"1":"";else process.env[name]=String(value);return utils;},unstubAllGlobals(){_stubsGlobal.forEach((original,name)=>{if(!original)Reflect.deleteProperty(globalThis,name);else Object.defineProperty(globalThis,name,original);});_stubsGlobal.clear();return utils;},unstubAllEnvs(){_stubsEnv.forEach((original,name)=>{if(original===void 0)delete process.env[name];else process.env[name]=original;});_stubsEnv.clear();return utils;},resetModules(){resetModules(workerState.moduleCache);return utils;},async dynamicImportSettled(){return waitForImportsToResolve();},setConfig(config){if(!_config)_config=_objectSpread({},workerState.config);Object.assign(workerState.config,config);},resetConfig(){if(_config)Object.assign(workerState.config,_config);}};return utils;}const vitest=createVitest();const vi=vitest;class Spy{called=false;mock=()=>{};method(){}}function spy(){const inst=new Spy();return vi.fn(inst.mock);}async function wait(){}exports.spy=spy;exports.wait=wait; //# sourceMappingURL=test.js.map " `; @@ -9832,7 +9848,7 @@ export { createClient }; " `; -exports[`Outputs (swc) > artifacts > builds all the artifacts with rollup > lib/bundle-D12lh4FL.js 1`] = ` +exports[`Outputs (swc) > artifacts > builds all the artifacts with rollup > lib/bundle-D7lcxiVj.js 1`] = ` "// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib @@ -10186,9 +10202,12 @@ class Mappings { } addEdit(sourceIndex, content, loc, nameIndex) { if (content.length) { + const contentLengthMinusOne = content.length - 1; let contentLineEnd = content.indexOf('\\n', 0); let previousContentLineEnd = -1; - while (contentLineEnd >= 0) { + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; if (nameIndex >= 0) { segment.push(nameIndex); @@ -10877,11 +10896,21 @@ class MagicString { if (searchValue.global) { const matches = matchAll(searchValue, this.original); matches.forEach(match => { - if (match.index != null) this.overwrite(match.index, match.index + match[0].length, getReplacement(match, this.original)); + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite(match.index, match.index + match[0].length, replacement); + } + } }); } else { const match = this.original.match(searchValue); - if (match && match.index != null) this.overwrite(match.index, match.index + match[0].length, getReplacement(match, this.original)); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite(match.index, match.index + match[0].length, replacement); + } + } } return this; } @@ -10903,7 +10932,8 @@ class MagicString { const original = this.original; const stringLength = string.length; for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) { - this.overwrite(index, index + stringLength, replacement); + const previous = original.slice(index, index + stringLength); + if (previous !== replacement) this.overwrite(index, index + stringLength, replacement); } return this; } @@ -10919,7 +10949,7 @@ class MagicString { } exports.SourceMap = SourceMap; exports.default = MagicString; -//# sourceMappingURL=bundle-D12lh4FL.js.map +//# sourceMappingURL=bundle-D7lcxiVj.js.map " `; @@ -10980,7 +11010,7 @@ exports.EXAMPLE = EXAMPLE; exports[`Outputs (swc) > artifacts > builds all the artifacts with rollup > lib/test.js 1`] = ` "// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib -'use strict';const _excluded=["maxLength"],_excluded2=["value"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key];}return target;}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;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;if(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){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);icollector.add(key);Object.getOwnPropertyNames(obj).forEach(collect);Object.getOwnPropertySymbols(obj).forEach(collect);}function getOwnProperties(obj){const ownProps=/* @__PURE__ */new Set();if(isFinalObj(obj))return[];collectOwnProperties(obj,ownProps);return Array.from(ownProps);}const defaultCloneOptions={forceWritable:false};function deepClone(val,options=defaultCloneOptions){const seen=/* @__PURE__ */new WeakMap();return clone(val,seen,options);}function clone(val,seen,options=defaultCloneOptions){let k,out;if(seen.has(val))return seen.get(val);if(Array.isArray(val)){out=Array(k=val.length);seen.set(val,out);while(k--)out[k]=clone(val[k],seen,options);return out;}if(Object.prototype.toString.call(val)==="[object Object]"){out=Object.create(Object.getPrototypeOf(val));seen.set(val,out);const props=getOwnProperties(val);for(const k2 of props){const descriptor=Object.getOwnPropertyDescriptor(val,k2);if(!descriptor)continue;const cloned=clone(val[k2],seen,options);if("get"in descriptor){Object.defineProperty(out,k2,_objectSpread(_objectSpread({},descriptor),{},{get(){return cloned;}}));}else{Object.defineProperty(out,k2,_objectSpread(_objectSpread({},descriptor),{},{writable:options.forceWritable?true:descriptor.writable,value:cloned}));}}return out;}return val;}function objectAttr(source,path,defaultValue=void 0){const paths=path.replace(/\\[(\\d+)\\]/g,".$1").split(".");let result=source;for(const p of paths){result=Object(result)[p];if(result===void 0)return defaultValue;}return result;}function createDefer(){let resolve=null;let reject=null;const p=new Promise((_resolve,_reject)=>{resolve=_resolve;reject=_reject;});p.resolve=resolve;p.reject=reject;return p;}var commonjsGlobal$1=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs$2(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}function getAugmentedNamespace(n){if(n.__esModule)return n;var f=n.default;if(typeof f=="function"){var a=function a(){if(this instanceof a){return Reflect.construct(f,arguments,this.constructor);}return f.apply(this,arguments);};a.prototype=f.prototype;}else a={};Object.defineProperty(a,'__esModule',{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){return n[k];}});});return a;}var build$1={};var ansiStyles={exports:{}};ansiStyles.exports;(function(module){const ANSI_BACKGROUND_OFFSET=10;const wrapAnsi256=(offset=0)=>code=>\`\\u001B[\${38+offset};5;\${code}m\`;const wrapAnsi16m=(offset=0)=>(red,green,blue)=>\`\\u001B[\${38+offset};2;\${red};\${green};\${blue}m\`;function assembleStyles(){const codes=new Map();const styles={modifier:{reset:[0,0],// 21 isn't widely supported and 22 does the same thing +'use strict';const _excluded=["maxLength"],_excluded2=["value"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key];}return target;}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;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;if(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){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);icollector.add(key);Object.getOwnPropertyNames(obj).forEach(collect);Object.getOwnPropertySymbols(obj).forEach(collect);}function getOwnProperties(obj){const ownProps=/* @__PURE__ */new Set();if(isFinalObj(obj))return[];collectOwnProperties(obj,ownProps);return Array.from(ownProps);}const defaultCloneOptions={forceWritable:false};function deepClone(val,options=defaultCloneOptions){const seen=/* @__PURE__ */new WeakMap();return clone(val,seen,options);}function clone(val,seen,options=defaultCloneOptions){let k,out;if(seen.has(val))return seen.get(val);if(Array.isArray(val)){out=Array(k=val.length);seen.set(val,out);while(k--)out[k]=clone(val[k],seen,options);return out;}if(Object.prototype.toString.call(val)==="[object Object]"){out=Object.create(Object.getPrototypeOf(val));seen.set(val,out);const props=getOwnProperties(val);for(const k2 of props){const descriptor=Object.getOwnPropertyDescriptor(val,k2);if(!descriptor)continue;const cloned=clone(val[k2],seen,options);if(options.forceWritable){Object.defineProperty(out,k2,{enumerable:descriptor.enumerable,configurable:true,writable:true,value:cloned});}else if("get"in descriptor){Object.defineProperty(out,k2,_objectSpread(_objectSpread({},descriptor),{},{get(){return cloned;}}));}else{Object.defineProperty(out,k2,_objectSpread(_objectSpread({},descriptor),{},{value:cloned}));}}return out;}return val;}function objectAttr(source,path,defaultValue=void 0){const paths=path.replace(/\\[(\\d+)\\]/g,".$1").split(".");let result=source;for(const p of paths){result=Object(result)[p];if(result===void 0)return defaultValue;}return result;}function createDefer(){let resolve=null;let reject=null;const p=new Promise((_resolve,_reject)=>{resolve=_resolve;reject=_reject;});p.resolve=resolve;p.reject=reject;return p;}var commonjsGlobal$1=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs$2(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}function getAugmentedNamespace(n){if(n.__esModule)return n;var f=n.default;if(typeof f=="function"){var a=function a(){if(this instanceof a){return Reflect.construct(f,arguments,this.constructor);}return f.apply(this,arguments);};a.prototype=f.prototype;}else a={};Object.defineProperty(a,'__esModule',{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){return n[k];}});});return a;}var build$1={};var ansiStyles={exports:{}};ansiStyles.exports;(function(module){const ANSI_BACKGROUND_OFFSET=10;const wrapAnsi256=(offset=0)=>code=>\`\\u001B[\${38+offset};5;\${code}m\`;const wrapAnsi16m=(offset=0)=>(red,green,blue)=>\`\\u001B[\${38+offset};2;\${red};\${green};\${blue}m\`;function assembleStyles(){const codes=new Map();const styles={modifier:{reset:[0,0],// 21 isn't widely supported and 22 does the same thing 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],// Bright color 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],// Bright color bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};// Alias bright black as gray (and grey) @@ -11206,7 +11236,7 @@ if(value===Object(value)){return inspectObject$1(value,options);}// We have run return options.stylize(String(value),type);}function registerConstructor(constructor,inspector){if(constructorMap.has(constructor)){return false;}constructorMap.set(constructor,inspector);return true;}function registerStringTag(stringTag,inspector){if(stringTag in stringTagMap){return false;}stringTagMap[stringTag]=inspector;return true;}const custom=chaiInspect;const loupe$1=/*#__PURE__*/Object.freeze({__proto__:null,custom,default:inspect$4,inspect:inspect$4,registerConstructor,registerStringTag});const _plugins_=plugins_1,AsymmetricMatcher$3=_plugins_.AsymmetricMatcher,DOMCollection$2=_plugins_.DOMCollection,DOMElement$2=_plugins_.DOMElement,Immutable$2=_plugins_.Immutable,ReactElement$2=_plugins_.ReactElement,ReactTestComponent$2=_plugins_.ReactTestComponent;const PLUGINS$2=[ReactTestComponent$2,ReactElement$2,DOMElement$2,DOMCollection$2,Immutable$2,AsymmetricMatcher$3];function stringify(object,maxDepth=10,_ref5={}){let maxLength=_ref5.maxLength,options=_objectWithoutProperties(_ref5,_excluded);const MAX_LENGTH=maxLength??1e4;let result;try{result=format_1(object,_objectSpread({maxDepth,escapeString:false,// min: true, plugins:PLUGINS$2},options));}catch{result=format_1(object,_objectSpread({callToJSON:false,maxDepth,escapeString:false,// min: true, plugins:PLUGINS$2},options));}return result.length>=MAX_LENGTH&&maxDepth>1?stringify(object,Math.floor(maxDepth/2)):result;}const formatRegExp=/%[sdjifoOcj%]/g;function format(...args){if(typeof args[0]!=="string"){const objects=[];for(let i2=0;i2{if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":{const value=args[i++];if(typeof value==="bigint")return\`\${value.toString()}n\`;if(typeof value==="number"&&value===0&&1/value<0)return"-0";if(typeof value==="object"&&value!==null)return inspect$3(value,{depth:0,colors:false,compact:3});return String(value);}case"%d":{const value=args[i++];if(typeof value==="bigint")return\`\${value.toString()}n\`;return Number(value).toString();}case"%i":{const value=args[i++];if(typeof value==="bigint")return\`\${value.toString()}n\`;return Number.parseInt(String(value)).toString();}case"%f":return Number.parseFloat(String(args[i++])).toString();case"%o":return inspect$3(args[i++],{showHidden:true,showProxy:true});case"%O":return inspect$3(args[i++]);case"%c":{i++;return"";}case"%j":try{return JSON.stringify(args[i++]);}catch(err){const m=err.message;if(// chromium -m.includes("circular structure")||m.includes("cyclic structures")||m.includes("cyclic object"))return"[Circular]";throw err;}default:return x;}});for(let x=args[i];i=options.truncate){if(type==="[object Function]"){const fn=obj;return!fn.name||fn.name===""?"[Function]":\`[Function: \${fn.name}]\`;}else if(type==="[object Array]"){return\`[ Array(\${obj.length}) ]\`;}else if(type==="[object Object]"){const keys=Object.keys(obj);const kstr=keys.length>2?\`\${keys.splice(0,2).join(", ")}, ...\`:keys.join(", ");return\`{ Object (\${kstr}) }\`;}else{return str;}}return str;}const SAFE_TIMERS_SYMBOL=Symbol("vitest:SAFE_TIMERS");const SAFE_COLORS_SYMBOL=Symbol("vitest:SAFE_COLORS");const colorsMap={bold:["\\x1B[1m","\\x1B[22m","\\x1B[22m\\x1B[1m"],dim:["\\x1B[2m","\\x1B[22m","\\x1B[22m\\x1B[2m"],italic:["\\x1B[3m","\\x1B[23m"],underline:["\\x1B[4m","\\x1B[24m"],inverse:["\\x1B[7m","\\x1B[27m"],hidden:["\\x1B[8m","\\x1B[28m"],strikethrough:["\\x1B[9m","\\x1B[29m"],black:["\\x1B[30m","\\x1B[39m"],red:["\\x1B[31m","\\x1B[39m"],green:["\\x1B[32m","\\x1B[39m"],yellow:["\\x1B[33m","\\x1B[39m"],blue:["\\x1B[34m","\\x1B[39m"],magenta:["\\x1B[35m","\\x1B[39m"],cyan:["\\x1B[36m","\\x1B[39m"],white:["\\x1B[37m","\\x1B[39m"],gray:["\\x1B[90m","\\x1B[39m"],bgBlack:["\\x1B[40m","\\x1B[49m"],bgRed:["\\x1B[41m","\\x1B[49m"],bgGreen:["\\x1B[42m","\\x1B[49m"],bgYellow:["\\x1B[43m","\\x1B[49m"],bgBlue:["\\x1B[44m","\\x1B[49m"],bgMagenta:["\\x1B[45m","\\x1B[49m"],bgCyan:["\\x1B[46m","\\x1B[49m"],bgWhite:["\\x1B[47m","\\x1B[49m"]};const colorsEntries=Object.entries(colorsMap);function string$1(str){return String(str);}string$1.open="";string$1.close="";const defaultColors=/* @__PURE__ */colorsEntries.reduce((acc,[key])=>{acc[key]=string$1;return acc;},{isColorSupported:false});function getColors(){return globalThis[SAFE_COLORS_SYMBOL]||defaultColors;}function getSafeTimers(){const _ref6=globalThis[SAFE_TIMERS_SYMBOL]||globalThis,safeSetTimeout=_ref6.setTimeout,safeSetInterval=_ref6.setInterval,safeClearInterval=_ref6.clearInterval,safeClearTimeout=_ref6.clearTimeout,safeSetImmediate=_ref6.setImmediate,safeClearImmediate=_ref6.clearImmediate;const _ref7=globalThis[SAFE_TIMERS_SYMBOL]||globalThis.process||{nextTick:cb=>cb()},safeNextTick=_ref7.nextTick;return{nextTick:safeNextTick,setTimeout:safeSetTimeout,setInterval:safeSetInterval,clearInterval:safeClearInterval,clearTimeout:safeClearTimeout,setImmediate:safeSetImmediate,clearImmediate:safeClearImmediate};}function createSimpleStackTrace(options){const _ref8=options||{},_ref8$message=_ref8.message,message=_ref8$message===void 0?"error":_ref8$message,_ref8$stackTraceLimit=_ref8.stackTraceLimit,stackTraceLimit=_ref8$stackTraceLimit===void 0?1:_ref8$stackTraceLimit;const limit=Error.stackTraceLimit;const prepareStackTrace=Error.prepareStackTrace;Error.stackTraceLimit=stackTraceLimit;Error.prepareStackTrace=e=>e.stack;const err=new Error(message);const stackTrace=err.stack||"";Error.prepareStackTrace=prepareStackTrace;Error.stackTraceLimit=limit;return stackTrace;}// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell +m.includes("circular structure")||m.includes("cyclic structures")||m.includes("cyclic object"))return"[Circular]";throw err;}default:return x;}});for(let x=args[i];i=options.truncate){if(type==="[object Function]"){const fn=obj;return!fn.name?"[Function]":\`[Function: \${fn.name}]\`;}else if(type==="[object Array]"){return\`[ Array(\${obj.length}) ]\`;}else if(type==="[object Object]"){const keys=Object.keys(obj);const kstr=keys.length>2?\`\${keys.splice(0,2).join(", ")}, ...\`:keys.join(", ");return\`{ Object (\${kstr}) }\`;}else{return str;}}return str;}const SAFE_TIMERS_SYMBOL=Symbol("vitest:SAFE_TIMERS");const SAFE_COLORS_SYMBOL=Symbol("vitest:SAFE_COLORS");const colorsMap={bold:["\\x1B[1m","\\x1B[22m","\\x1B[22m\\x1B[1m"],dim:["\\x1B[2m","\\x1B[22m","\\x1B[22m\\x1B[2m"],italic:["\\x1B[3m","\\x1B[23m"],underline:["\\x1B[4m","\\x1B[24m"],inverse:["\\x1B[7m","\\x1B[27m"],hidden:["\\x1B[8m","\\x1B[28m"],strikethrough:["\\x1B[9m","\\x1B[29m"],black:["\\x1B[30m","\\x1B[39m"],red:["\\x1B[31m","\\x1B[39m"],green:["\\x1B[32m","\\x1B[39m"],yellow:["\\x1B[33m","\\x1B[39m"],blue:["\\x1B[34m","\\x1B[39m"],magenta:["\\x1B[35m","\\x1B[39m"],cyan:["\\x1B[36m","\\x1B[39m"],white:["\\x1B[37m","\\x1B[39m"],gray:["\\x1B[90m","\\x1B[39m"],bgBlack:["\\x1B[40m","\\x1B[49m"],bgRed:["\\x1B[41m","\\x1B[49m"],bgGreen:["\\x1B[42m","\\x1B[49m"],bgYellow:["\\x1B[43m","\\x1B[49m"],bgBlue:["\\x1B[44m","\\x1B[49m"],bgMagenta:["\\x1B[45m","\\x1B[49m"],bgCyan:["\\x1B[46m","\\x1B[49m"],bgWhite:["\\x1B[47m","\\x1B[49m"]};const colorsEntries=Object.entries(colorsMap);function string$1(str){return String(str);}string$1.open="";string$1.close="";const defaultColors=/* @__PURE__ */colorsEntries.reduce((acc,[key])=>{acc[key]=string$1;return acc;},{isColorSupported:false});function getColors(){return globalThis[SAFE_COLORS_SYMBOL]||defaultColors;}function getSafeTimers(){const _ref6=globalThis[SAFE_TIMERS_SYMBOL]||globalThis,safeSetTimeout=_ref6.setTimeout,safeSetInterval=_ref6.setInterval,safeClearInterval=_ref6.clearInterval,safeClearTimeout=_ref6.clearTimeout,safeSetImmediate=_ref6.setImmediate,safeClearImmediate=_ref6.clearImmediate;const _ref7=globalThis[SAFE_TIMERS_SYMBOL]||globalThis.process||{nextTick:cb=>cb()},safeNextTick=_ref7.nextTick;return{nextTick:safeNextTick,setTimeout:safeSetTimeout,setInterval:safeSetInterval,clearInterval:safeClearInterval,clearTimeout:safeClearTimeout,setImmediate:safeSetImmediate,clearImmediate:safeClearImmediate};}function createSimpleStackTrace(options){const _ref8=options||{},_ref8$message=_ref8.message,message=_ref8$message===void 0?"error":_ref8$message,_ref8$stackTraceLimit=_ref8.stackTraceLimit,stackTraceLimit=_ref8$stackTraceLimit===void 0?1:_ref8$stackTraceLimit;const limit=Error.stackTraceLimit;const prepareStackTrace=Error.prepareStackTrace;Error.stackTraceLimit=stackTraceLimit;Error.prepareStackTrace=e=>e.stack;const err=new Error(message);const stackTrace=err.stack||"";Error.prepareStackTrace=prepareStackTrace;Error.stackTraceLimit=limit;return stackTrace;}// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell // License: MIT. var LineTerminatorSequence$1;LineTerminatorSequence$1=/\\r?\\n|[\\r\\u2028\\u2029]/y;RegExp(LineTerminatorSequence$1.source);// src/index.ts var reservedWords$1={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(reservedWords$1.keyword);new Set(reservedWords$1.strict);var build={};Object.defineProperty(build,'__esModule',{value:true});var _default=build.default=diffSequence;/** @@ -11448,18 +11478,21 @@ const callbacks=[{foundSubsequence,isCommon}];// Indexes in sequence a of last p const aIndexesF=[NOT_YET_SET];// from the end at bottom right in the reverse direction: const aIndexesR=[NOT_YET_SET];// Initialize one object as output of all calls to divide function. const division={aCommonFollowing:NOT_YET_SET,aCommonPreceding:NOT_YET_SET,aEndPreceding:NOT_YET_SET,aStartFollowing:NOT_YET_SET,bCommonFollowing:NOT_YET_SET,bCommonPreceding:NOT_YET_SET,bEndPreceding:NOT_YET_SET,bStartFollowing:NOT_YET_SET,nChangeFollowing:NOT_YET_SET,nChangePreceding:NOT_YET_SET,nCommonFollowing:NOT_YET_SET,nCommonPreceding:NOT_YET_SET};// Find and return common subsequences in the trimmed index intervals. -findSubsequences(nChange,aStart,aEnd,bStart,bEnd,transposed,callbacks,aIndexesF,aIndexesR,division);}if(nCommonR!==0){foundSubsequence(nCommonR,aEnd,bEnd);}}}function getType(value){if(value===void 0){return"undefined";}else if(value===null){return"null";}else if(Array.isArray(value)){return"array";}else if(typeof value==="boolean"){return"boolean";}else if(typeof value==="function"){return"function";}else if(typeof value==="number"){return"number";}else if(typeof value==="string"){return"string";}else if(typeof value==="bigint"){return"bigint";}else if(typeof value==="object"){if(value!=null){if(value.constructor===RegExp)return"regexp";else if(value.constructor===Map)return"map";else if(value.constructor===Set)return"set";else if(value.constructor===Date)return"date";}return"object";}else if(typeof value==="symbol"){return"symbol";}throw new Error(\`value of unknown type: \${value}\`);}const DIFF_DELETE=-1;const DIFF_INSERT=1;const DIFF_EQUAL=0;class Diff{0;1;constructor(op,text){this[0]=op;this[1]=text;}}const NO_DIFF_MESSAGE="Compared values have no visual difference.";const SIMILAR_MESSAGE="Compared values serialize to the same structure.\\nPrinting internal object structure without calling \`toJSON\` instead.";function formatTrailingSpaces(line,trailingSpaceFormatter){return line.replace(/\\s+$/,match=>trailingSpaceFormatter(match));}function printDiffLine(line,isFirstOrLast,color,indicator,trailingSpaceFormatter,emptyFirstOrLastLinePlaceholder){return line.length!==0?color(\`\${indicator} \${formatTrailingSpaces(line,trailingSpaceFormatter)}\`):indicator!==" "?color(indicator):isFirstOrLast&&emptyFirstOrLastLinePlaceholder.length!==0?color(\`\${indicator} \${emptyFirstOrLastLinePlaceholder}\`):"";}function printDeleteLine(line,isFirstOrLast,{aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function printInsertLine(line,isFirstOrLast,{bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function printCommonLine(line,isFirstOrLast,{commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function createPatchMark(aStart,aEnd,bStart,bEnd,{patchColor}){return patchColor(\`@@ -\${aStart+1},\${aEnd-aStart} +\${bStart+1},\${bEnd-bStart} @@\`);}function joinAlignedDiffsNoExpand(diffs,options){const iLength=diffs.length;const nContextLines=options.contextLines;const nContextLines2=nContextLines+nContextLines;let jLength=iLength;let hasExcessAtStartOrEnd=false;let nExcessesBetweenChanges=0;let i=0;while(i!==iLength){const iStart=i;while(i!==iLength&&diffs[i][0]===DIFF_EQUAL)i+=1;if(iStart!==i){if(iStart===0){if(i>nContextLines){jLength-=i-nContextLines;hasExcessAtStartOrEnd=true;}}else if(i===iLength){const n=i-iStart;if(n>nContextLines){jLength-=n-nContextLines;hasExcessAtStartOrEnd=true;}}else{const n=i-iStart;if(n>nContextLines2){jLength-=n-nContextLines2;nExcessesBetweenChanges+=1;}}}while(i!==iLength&&diffs[i][0]!==DIFF_EQUAL)i+=1;}const hasPatch=nExcessesBetweenChanges!==0||hasExcessAtStartOrEnd;if(nExcessesBetweenChanges!==0)jLength+=nExcessesBetweenChanges+1;else if(hasExcessAtStartOrEnd)jLength+=1;const jLast=jLength-1;const lines=[];let jPatchMark=0;if(hasPatch)lines.push("");let aStart=0;let bStart=0;let aEnd=0;let bEnd=0;const pushCommonLine=line=>{const j=lines.length;lines.push(printCommonLine(line,j===0||j===jLast,options));aEnd+=1;bEnd+=1;};const pushDeleteLine=line=>{const j=lines.length;lines.push(printDeleteLine(line,j===0||j===jLast,options));aEnd+=1;};const pushInsertLine=line=>{const j=lines.length;lines.push(printInsertLine(line,j===0||j===jLast,options));bEnd+=1;};i=0;while(i!==iLength){let iStart=i;while(i!==iLength&&diffs[i][0]===DIFF_EQUAL)i+=1;if(iStart!==i){if(iStart===0){if(i>nContextLines){iStart=i-nContextLines;aStart=iStart;bStart=iStart;aEnd=aStart;bEnd=bStart;}for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else if(i===iLength){const iEnd=i-iStart>nContextLines?iStart+nContextLines:i;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else{const nCommon=i-iStart;if(nCommon>nContextLines2){const iEnd=iStart+nContextLines;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options);jPatchMark=lines.length;lines.push("");const nOmit=nCommon-nContextLines2;aStart=aEnd+nOmit;bStart=bEnd+nOmit;aEnd=aStart;bEnd=bStart;for(let iCommon=i-nContextLines;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else{for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}}}while(i!==iLength&&diffs[i][0]===DIFF_DELETE){pushDeleteLine(diffs[i][1]);i+=1;}while(i!==iLength&&diffs[i][0]===DIFF_INSERT){pushInsertLine(diffs[i][1]);i+=1;}}if(hasPatch)lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options);return lines.join("\\n");}function joinAlignedDiffsExpand(diffs,options){return diffs.map((diff,i,diffs2)=>{const line=diff[1];const isFirstOrLast=i===0||i===diffs2.length-1;switch(diff[0]){case DIFF_DELETE:return printDeleteLine(line,isFirstOrLast,options);case DIFF_INSERT:return printInsertLine(line,isFirstOrLast,options);default:return printCommonLine(line,isFirstOrLast,options);}}).join("\\n");}const noColor=string=>string;const DIFF_CONTEXT_DEFAULT=5;function getDefaultOptions(){const c=getColors();return{aAnnotation:"Expected",aColor:c.green,aIndicator:"-",bAnnotation:"Received",bColor:c.red,bIndicator:"+",changeColor:c.inverse,changeLineTrailingSpaceColor:noColor,commonColor:c.dim,commonIndicator:" ",commonLineTrailingSpaceColor:noColor,compareKeys:void 0,contextLines:DIFF_CONTEXT_DEFAULT,emptyFirstOrLastLinePlaceholder:"",expand:true,includeChangeCounts:false,omitAnnotationLines:false,patchColor:c.yellow};}function getCompareKeys(compareKeys){return compareKeys&&typeof compareKeys==="function"?compareKeys:void 0;}function getContextLines(contextLines){return typeof contextLines==="number"&&Number.isSafeInteger(contextLines)&&contextLines>=0?contextLines:DIFF_CONTEXT_DEFAULT;}function normalizeDiffOptions(options={}){return _objectSpread(_objectSpread(_objectSpread({},getDefaultOptions()),options),{},{compareKeys:getCompareKeys(options.compareKeys),contextLines:getContextLines(options.contextLines)});}function isEmptyString(lines){return lines.length===1&&lines[0].length===0;}function countChanges(diffs){let a=0;let b=0;diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:a+=1;break;case DIFF_INSERT:b+=1;break;}});return{a,b};}function printAnnotation({aAnnotation,aColor,aIndicator,bAnnotation,bColor,bIndicator,includeChangeCounts,omitAnnotationLines},changeCounts){if(omitAnnotationLines)return"";let aRest="";let bRest="";if(includeChangeCounts){const aCount=String(changeCounts.a);const bCount=String(changeCounts.b);const baAnnotationLengthDiff=bAnnotation.length-aAnnotation.length;const aAnnotationPadding=" ".repeat(Math.max(0,baAnnotationLengthDiff));const bAnnotationPadding=" ".repeat(Math.max(0,-baAnnotationLengthDiff));const baCountLengthDiff=bCount.length-aCount.length;const aCountPadding=" ".repeat(Math.max(0,baCountLengthDiff));const bCountPadding=" ".repeat(Math.max(0,-baCountLengthDiff));aRest=\`\${aAnnotationPadding} \${aIndicator} \${aCountPadding}\${aCount}\`;bRest=\`\${bAnnotationPadding} \${bIndicator} \${bCountPadding}\${bCount}\`;}const a=\`\${aIndicator} \${aAnnotation}\${aRest}\`;const b=\`\${bIndicator} \${bAnnotation}\${bRest}\`;return\`\${aColor(a)} +findSubsequences(nChange,aStart,aEnd,bStart,bEnd,transposed,callbacks,aIndexesF,aIndexesR,division);}if(nCommonR!==0){foundSubsequence(nCommonR,aEnd,bEnd);}}}function getType(value){if(value===void 0){return"undefined";}else if(value===null){return"null";}else if(Array.isArray(value)){return"array";}else if(typeof value==="boolean"){return"boolean";}else if(typeof value==="function"){return"function";}else if(typeof value==="number"){return"number";}else if(typeof value==="string"){return"string";}else if(typeof value==="bigint"){return"bigint";}else if(typeof value==="object"){if(value!=null){if(value.constructor===RegExp)return"regexp";else if(value.constructor===Map)return"map";else if(value.constructor===Set)return"set";else if(value.constructor===Date)return"date";}return"object";}else if(typeof value==="symbol"){return"symbol";}throw new Error(\`value of unknown type: \${value}\`);}const DIFF_DELETE=-1;const DIFF_INSERT=1;const DIFF_EQUAL=0;class Diff{0;1;constructor(op,text){this[0]=op;this[1]=text;}}const NO_DIFF_MESSAGE="Compared values have no visual difference.";const SIMILAR_MESSAGE="Compared values serialize to the same structure.\\nPrinting internal object structure without calling \`toJSON\` instead.";function formatTrailingSpaces(line,trailingSpaceFormatter){return line.replace(/\\s+$/,match=>trailingSpaceFormatter(match));}function printDiffLine(line,isFirstOrLast,color,indicator,trailingSpaceFormatter,emptyFirstOrLastLinePlaceholder){return line.length!==0?color(\`\${indicator} \${formatTrailingSpaces(line,trailingSpaceFormatter)}\`):indicator!==" "?color(indicator):isFirstOrLast&&emptyFirstOrLastLinePlaceholder.length!==0?color(\`\${indicator} \${emptyFirstOrLastLinePlaceholder}\`):"";}function printDeleteLine(line,isFirstOrLast,{aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function printInsertLine(line,isFirstOrLast,{bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function printCommonLine(line,isFirstOrLast,{commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function createPatchMark(aStart,aEnd,bStart,bEnd,{patchColor}){return patchColor(\`@@ -\${aStart+1},\${aEnd-aStart} +\${bStart+1},\${bEnd-bStart} @@\`);}function joinAlignedDiffsNoExpand(diffs,options){const iLength=diffs.length;const nContextLines=options.contextLines;const nContextLines2=nContextLines+nContextLines;let jLength=iLength;let hasExcessAtStartOrEnd=false;let nExcessesBetweenChanges=0;let i=0;while(i!==iLength){const iStart=i;while(i!==iLength&&diffs[i][0]===DIFF_EQUAL)i+=1;if(iStart!==i){if(iStart===0){if(i>nContextLines){jLength-=i-nContextLines;hasExcessAtStartOrEnd=true;}}else if(i===iLength){const n=i-iStart;if(n>nContextLines){jLength-=n-nContextLines;hasExcessAtStartOrEnd=true;}}else{const n=i-iStart;if(n>nContextLines2){jLength-=n-nContextLines2;nExcessesBetweenChanges+=1;}}}while(i!==iLength&&diffs[i][0]!==DIFF_EQUAL)i+=1;}const hasPatch=nExcessesBetweenChanges!==0||hasExcessAtStartOrEnd;if(nExcessesBetweenChanges!==0)jLength+=nExcessesBetweenChanges+1;else if(hasExcessAtStartOrEnd)jLength+=1;const jLast=jLength-1;const lines=[];let jPatchMark=0;if(hasPatch)lines.push("");let aStart=0;let bStart=0;let aEnd=0;let bEnd=0;const pushCommonLine=line=>{const j=lines.length;lines.push(printCommonLine(line,j===0||j===jLast,options));aEnd+=1;bEnd+=1;};const pushDeleteLine=line=>{const j=lines.length;lines.push(printDeleteLine(line,j===0||j===jLast,options));aEnd+=1;};const pushInsertLine=line=>{const j=lines.length;lines.push(printInsertLine(line,j===0||j===jLast,options));bEnd+=1;};i=0;while(i!==iLength){let iStart=i;while(i!==iLength&&diffs[i][0]===DIFF_EQUAL)i+=1;if(iStart!==i){if(iStart===0){if(i>nContextLines){iStart=i-nContextLines;aStart=iStart;bStart=iStart;aEnd=aStart;bEnd=bStart;}for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else if(i===iLength){const iEnd=i-iStart>nContextLines?iStart+nContextLines:i;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else{const nCommon=i-iStart;if(nCommon>nContextLines2){const iEnd=iStart+nContextLines;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options);jPatchMark=lines.length;lines.push("");const nOmit=nCommon-nContextLines2;aStart=aEnd+nOmit;bStart=bEnd+nOmit;aEnd=aStart;bEnd=bStart;for(let iCommon=i-nContextLines;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else{for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}}}while(i!==iLength&&diffs[i][0]===DIFF_DELETE){pushDeleteLine(diffs[i][1]);i+=1;}while(i!==iLength&&diffs[i][0]===DIFF_INSERT){pushInsertLine(diffs[i][1]);i+=1;}}if(hasPatch)lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options);return lines.join("\\n");}function joinAlignedDiffsExpand(diffs,options){return diffs.map((diff,i,diffs2)=>{const line=diff[1];const isFirstOrLast=i===0||i===diffs2.length-1;switch(diff[0]){case DIFF_DELETE:return printDeleteLine(line,isFirstOrLast,options);case DIFF_INSERT:return printInsertLine(line,isFirstOrLast,options);default:return printCommonLine(line,isFirstOrLast,options);}}).join("\\n");}const noColor=string=>string;const DIFF_CONTEXT_DEFAULT=5;const DIFF_TRUNCATE_THRESHOLD_DEFAULT=0;function getDefaultOptions(){const c=getColors();return{aAnnotation:"Expected",aColor:c.green,aIndicator:"-",bAnnotation:"Received",bColor:c.red,bIndicator:"+",changeColor:c.inverse,changeLineTrailingSpaceColor:noColor,commonColor:c.dim,commonIndicator:" ",commonLineTrailingSpaceColor:noColor,compareKeys:void 0,contextLines:DIFF_CONTEXT_DEFAULT,emptyFirstOrLastLinePlaceholder:"",expand:true,includeChangeCounts:false,omitAnnotationLines:false,patchColor:c.yellow,truncateThreshold:DIFF_TRUNCATE_THRESHOLD_DEFAULT,truncateAnnotation:"... Diff result is truncated",truncateAnnotationColor:noColor};}function getCompareKeys(compareKeys){return compareKeys&&typeof compareKeys==="function"?compareKeys:void 0;}function getContextLines(contextLines){return typeof contextLines==="number"&&Number.isSafeInteger(contextLines)&&contextLines>=0?contextLines:DIFF_CONTEXT_DEFAULT;}function normalizeDiffOptions(options={}){return _objectSpread(_objectSpread(_objectSpread({},getDefaultOptions()),options),{},{compareKeys:getCompareKeys(options.compareKeys),contextLines:getContextLines(options.contextLines)});}function isEmptyString(lines){return lines.length===1&&lines[0].length===0;}function countChanges(diffs){let a=0;let b=0;diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:a+=1;break;case DIFF_INSERT:b+=1;break;}});return{a,b};}function printAnnotation({aAnnotation,aColor,aIndicator,bAnnotation,bColor,bIndicator,includeChangeCounts,omitAnnotationLines},changeCounts){if(omitAnnotationLines)return"";let aRest="";let bRest="";if(includeChangeCounts){const aCount=String(changeCounts.a);const bCount=String(changeCounts.b);const baAnnotationLengthDiff=bAnnotation.length-aAnnotation.length;const aAnnotationPadding=" ".repeat(Math.max(0,baAnnotationLengthDiff));const bAnnotationPadding=" ".repeat(Math.max(0,-baAnnotationLengthDiff));const baCountLengthDiff=bCount.length-aCount.length;const aCountPadding=" ".repeat(Math.max(0,baCountLengthDiff));const bCountPadding=" ".repeat(Math.max(0,-baCountLengthDiff));aRest=\`\${aAnnotationPadding} \${aIndicator} \${aCountPadding}\${aCount}\`;bRest=\`\${bAnnotationPadding} \${bIndicator} \${bCountPadding}\${bCount}\`;}const a=\`\${aIndicator} \${aAnnotation}\${aRest}\`;const b=\`\${bIndicator} \${bAnnotation}\${bRest}\`;return\`\${aColor(a)} \${bColor(b)} -\`;}function printDiffLines(diffs,options){return printAnnotation(options,countChanges(diffs))+(options.expand?joinAlignedDiffsExpand(diffs,options):joinAlignedDiffsNoExpand(diffs,options));}function diffLinesUnified(aLines,bLines,options){return printDiffLines(diffLinesRaw(isEmptyString(aLines)?[]:aLines,isEmptyString(bLines)?[]:bLines),normalizeDiffOptions(options));}function diffLinesUnified2(aLinesDisplay,bLinesDisplay,aLinesCompare,bLinesCompare,options){if(isEmptyString(aLinesDisplay)&&isEmptyString(aLinesCompare)){aLinesDisplay=[];aLinesCompare=[];}if(isEmptyString(bLinesDisplay)&&isEmptyString(bLinesCompare)){bLinesDisplay=[];bLinesCompare=[];}if(aLinesDisplay.length!==aLinesCompare.length||bLinesDisplay.length!==bLinesCompare.length){return diffLinesUnified(aLinesDisplay,bLinesDisplay,options);}const diffs=diffLinesRaw(aLinesCompare,bLinesCompare);let aIndex=0;let bIndex=0;diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:diff2[1]=aLinesDisplay[aIndex];aIndex+=1;break;case DIFF_INSERT:diff2[1]=bLinesDisplay[bIndex];bIndex+=1;break;default:diff2[1]=bLinesDisplay[bIndex];aIndex+=1;bIndex+=1;}});return printDiffLines(diffs,normalizeDiffOptions(options));}function diffLinesRaw(aLines,bLines){const aLength=aLines.length;const bLength=bLines.length;const isCommon=(aIndex2,bIndex2)=>aLines[aIndex2]===bLines[bIndex2];const diffs=[];let aIndex=0;let bIndex=0;const foundSubsequence=(nCommon,aCommon,bCommon)=>{for(;aIndex!==aCommon;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bCommon;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));for(;nCommon!==0;nCommon-=1,aIndex+=1,bIndex+=1)diffs.push(new Diff(DIFF_EQUAL,bLines[bIndex]));};const diffSequences=_default.default||_default;diffSequences(aLength,bLength,isCommon,foundSubsequence);for(;aIndex!==aLength;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bLength;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));return diffs;}function getCommonMessage(message,options){const _normalizeDiffOptions=normalizeDiffOptions(options),commonColor=_normalizeDiffOptions.commonColor;return commonColor(message);}const _plugins_2=plugins_1,AsymmetricMatcher$2=_plugins_2.AsymmetricMatcher,DOMCollection$1=_plugins_2.DOMCollection,DOMElement$1=_plugins_2.DOMElement,Immutable$1=_plugins_2.Immutable,ReactElement$1=_plugins_2.ReactElement,ReactTestComponent$1=_plugins_2.ReactTestComponent;const PLUGINS$1=[ReactTestComponent$1,ReactElement$1,DOMElement$1,DOMCollection$1,Immutable$1,AsymmetricMatcher$2];const FORMAT_OPTIONS={plugins:PLUGINS$1};const FALLBACK_FORMAT_OPTIONS={callToJSON:false,maxDepth:10,plugins:PLUGINS$1};function diff(a,b,options){if(Object.is(a,b))return"";const aType=getType(a);let expectedType=aType;let omitDifference=false;if(aType==="object"&&typeof a.asymmetricMatch==="function"){if(a.$$typeof!==Symbol.for("jest.asymmetricMatcher")){return null;}if(typeof a.getExpectedType!=="function"){return null;}expectedType=a.getExpectedType();omitDifference=expectedType==="string";}if(expectedType!==getType(b)){const _normalizeDiffOptions2=normalizeDiffOptions(options),aAnnotation=_normalizeDiffOptions2.aAnnotation,aColor=_normalizeDiffOptions2.aColor,aIndicator=_normalizeDiffOptions2.aIndicator,bAnnotation=_normalizeDiffOptions2.bAnnotation,bColor=_normalizeDiffOptions2.bColor,bIndicator=_normalizeDiffOptions2.bIndicator;const formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options);const aDisplay=format_1(a,formatOptions);const bDisplay=format_1(b,formatOptions);const aDiff=\`\${aColor(\`\${aIndicator} \${aAnnotation}:\`)} +\`;}function printDiffLines(diffs,truncated,options){return printAnnotation(options,countChanges(diffs))+(options.expand?joinAlignedDiffsExpand(diffs,options):joinAlignedDiffsNoExpand(diffs,options))+(truncated?options.truncateAnnotationColor(\` +\${options.truncateAnnotation}\`):"");}function diffLinesUnified(aLines,bLines,options){const normalizedOptions=normalizeDiffOptions(options);const _diffLinesRaw=diffLinesRaw(isEmptyString(aLines)?[]:aLines,isEmptyString(bLines)?[]:bLines,normalizedOptions),_diffLinesRaw2=_slicedToArray(_diffLinesRaw,2),diffs=_diffLinesRaw2[0],truncated=_diffLinesRaw2[1];return printDiffLines(diffs,truncated,normalizedOptions);}function diffLinesUnified2(aLinesDisplay,bLinesDisplay,aLinesCompare,bLinesCompare,options){if(isEmptyString(aLinesDisplay)&&isEmptyString(aLinesCompare)){aLinesDisplay=[];aLinesCompare=[];}if(isEmptyString(bLinesDisplay)&&isEmptyString(bLinesCompare)){bLinesDisplay=[];bLinesCompare=[];}if(aLinesDisplay.length!==aLinesCompare.length||bLinesDisplay.length!==bLinesCompare.length){return diffLinesUnified(aLinesDisplay,bLinesDisplay,options);}const _diffLinesRaw3=diffLinesRaw(aLinesCompare,bLinesCompare,options),_diffLinesRaw4=_slicedToArray(_diffLinesRaw3,2),diffs=_diffLinesRaw4[0],truncated=_diffLinesRaw4[1];let aIndex=0;let bIndex=0;diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:diff2[1]=aLinesDisplay[aIndex];aIndex+=1;break;case DIFF_INSERT:diff2[1]=bLinesDisplay[bIndex];bIndex+=1;break;default:diff2[1]=bLinesDisplay[bIndex];aIndex+=1;bIndex+=1;}});return printDiffLines(diffs,truncated,normalizeDiffOptions(options));}function diffLinesRaw(aLines,bLines,options){const truncate=(options==null?void 0:options.truncateThreshold)??false;const truncateThreshold=Math.max(Math.floor((options==null?void 0:options.truncateThreshold)??0),0);const aLength=truncate?Math.min(aLines.length,truncateThreshold):aLines.length;const bLength=truncate?Math.min(bLines.length,truncateThreshold):bLines.length;const truncated=aLength!==aLines.length||bLength!==bLines.length;const isCommon=(aIndex2,bIndex2)=>aLines[aIndex2]===bLines[bIndex2];const diffs=[];let aIndex=0;let bIndex=0;const foundSubsequence=(nCommon,aCommon,bCommon)=>{for(;aIndex!==aCommon;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bCommon;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));for(;nCommon!==0;nCommon-=1,aIndex+=1,bIndex+=1)diffs.push(new Diff(DIFF_EQUAL,bLines[bIndex]));};const diffSequences=_default.default||_default;diffSequences(aLength,bLength,isCommon,foundSubsequence);for(;aIndex!==aLength;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bLength;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));return[diffs,truncated];}function getCommonMessage(message,options){const _normalizeDiffOptions=normalizeDiffOptions(options),commonColor=_normalizeDiffOptions.commonColor;return commonColor(message);}const _plugins_2=plugins_1,AsymmetricMatcher$2=_plugins_2.AsymmetricMatcher,DOMCollection$1=_plugins_2.DOMCollection,DOMElement$1=_plugins_2.DOMElement,Immutable$1=_plugins_2.Immutable,ReactElement$1=_plugins_2.ReactElement,ReactTestComponent$1=_plugins_2.ReactTestComponent;const PLUGINS$1=[ReactTestComponent$1,ReactElement$1,DOMElement$1,DOMCollection$1,Immutable$1,AsymmetricMatcher$2];const FORMAT_OPTIONS={plugins:PLUGINS$1};const FALLBACK_FORMAT_OPTIONS={callToJSON:false,maxDepth:10,plugins:PLUGINS$1};function diff(a,b,options){if(Object.is(a,b))return"";const aType=getType(a);let expectedType=aType;let omitDifference=false;if(aType==="object"&&typeof a.asymmetricMatch==="function"){if(a.$$typeof!==Symbol.for("jest.asymmetricMatcher")){return null;}if(typeof a.getExpectedType!=="function"){return null;}expectedType=a.getExpectedType();omitDifference=expectedType==="string";}if(expectedType!==getType(b)){const _normalizeDiffOptions2=normalizeDiffOptions(options),aAnnotation=_normalizeDiffOptions2.aAnnotation,aColor=_normalizeDiffOptions2.aColor,aIndicator=_normalizeDiffOptions2.aIndicator,bAnnotation=_normalizeDiffOptions2.bAnnotation,bColor=_normalizeDiffOptions2.bColor,bIndicator=_normalizeDiffOptions2.bIndicator;const formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options);const aDisplay=format_1(a,formatOptions);const bDisplay=format_1(b,formatOptions);const aDiff=\`\${aColor(\`\${aIndicator} \${aAnnotation}:\`)} \${aDisplay}\`;const bDiff=\`\${bColor(\`\${bIndicator} \${bAnnotation}:\`)} \${bDisplay}\`;return\`\${aDiff} \${bDiff}\`;}if(omitDifference)return null;switch(aType){case"string":return diffLinesUnified(a.split("\\n"),b.split("\\n"),options);case"boolean":case"number":return comparePrimitive(a,b,options);case"map":return compareObjects(sortMap(a),sortMap(b),options);case"set":return compareObjects(sortSet(a),sortSet(b),options);default:return compareObjects(a,b,options);}}function comparePrimitive(a,b,options){const aFormat=format_1(a,FORMAT_OPTIONS);const bFormat=format_1(b,FORMAT_OPTIONS);return aFormat===bFormat?"":diffLinesUnified(aFormat.split("\\n"),bFormat.split("\\n"),options);}function sortMap(map){return new Map(Array.from(map.entries()).sort());}function sortSet(set){return new Set(Array.from(set.values()).sort());}function compareObjects(a,b,options){let difference;let hasThrown=false;try{const formatOptions=getFormatOptions(FORMAT_OPTIONS,options);difference=getObjectsDifference(a,b,formatOptions,options);}catch{hasThrown=true;}const noDiffMessage=getCommonMessage(NO_DIFF_MESSAGE,options);if(difference===void 0||difference===noDiffMessage){const formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options);difference=getObjectsDifference(a,b,formatOptions,options);if(difference!==noDiffMessage&&!hasThrown){difference=\`\${getCommonMessage(SIMILAR_MESSAGE,options)} -\${difference}\`;}}return difference;}function getFormatOptions(formatOptions,options){const _normalizeDiffOptions3=normalizeDiffOptions(options),compareKeys=_normalizeDiffOptions3.compareKeys;return _objectSpread(_objectSpread({},formatOptions),{},{compareKeys});}function getObjectsDifference(a,b,formatOptions,options){const formatOptionsZeroIndent=_objectSpread(_objectSpread({},formatOptions),{},{indent:0});const aCompare=format_1(a,formatOptionsZeroIndent);const bCompare=format_1(b,formatOptionsZeroIndent);if(aCompare===bCompare){return getCommonMessage(NO_DIFF_MESSAGE,options);}else{const aDisplay=format_1(a,formatOptions);const bDisplay=format_1(b,formatOptions);return diffLinesUnified2(aDisplay.split("\\n"),bDisplay.split("\\n"),aCompare.split("\\n"),bCompare.split("\\n"),options);}}const IS_RECORD_SYMBOL="@@__IMMUTABLE_RECORD__@@";const IS_COLLECTION_SYMBOL="@@__IMMUTABLE_ITERABLE__@@";function isImmutable(v){return v&&(v[IS_COLLECTION_SYMBOL]||v[IS_RECORD_SYMBOL]);}const OBJECT_PROTO=Object.getPrototypeOf({});function getUnserializableMessage(err){if(err instanceof Error)return\`: \${err.message}\`;if(typeof err==="string")return\`: \${err}\`;return"";}function serializeError(val,seen=/* @__PURE__ */new WeakMap()){if(!val||typeof val==="string")return val;if(typeof val==="function")return\`Function<\${val.name||"anonymous"}>\`;if(typeof val==="symbol")return val.toString();if(typeof val!=="object")return val;if(isImmutable(val))return serializeError(val.toJSON(),seen);if(val instanceof Promise||val.constructor&&val.constructor.prototype==="AsyncFunction")return"Promise";if(typeof Element!=="undefined"&&val instanceof Element)return val.tagName;if(typeof val.asymmetricMatch==="function")return\`\${val.toString()} \${format(val.sample)}\`;if(seen.has(val))return seen.get(val);if(Array.isArray(val)){const clone=new Array(val.length);seen.set(val,clone);val.forEach((e,i)=>{try{clone[i]=serializeError(e,seen);}catch(err){clone[i]=getUnserializableMessage(err);}});return clone;}else{const clone=/* @__PURE__ */Object.create(null);seen.set(val,clone);let obj=val;while(obj&&obj!==OBJECT_PROTO){Object.getOwnPropertyNames(obj).forEach(key=>{if(key in clone)return;try{clone[key]=serializeError(val[key],seen);}catch(err){delete clone[key];clone[key]=getUnserializableMessage(err);}});obj=Object.getPrototypeOf(obj);}return clone;}}function normalizeErrorMessage(message){return message.replace(/__(vite_ssr_import|vi_import)_\\d+__\\./g,"");}function processError(err,diffOptions){if(!err||typeof err!=="object")return{message:err};if(err.stack)err.stackStr=String(err.stack);if(err.name)err.nameStr=String(err.name);if(err.showDiff||err.showDiff===void 0&&err.expected!==void 0&&err.actual!==void 0){const clonedActual=deepClone(err.actual,{forceWritable:true});const clonedExpected=deepClone(err.expected,{forceWritable:true});const _replaceAsymmetricMat=replaceAsymmetricMatcher(clonedActual,clonedExpected),replacedActual=_replaceAsymmetricMat.replacedActual,replacedExpected=_replaceAsymmetricMat.replacedExpected;err.diff=diff(replacedExpected,replacedActual,_objectSpread(_objectSpread({},diffOptions),err.diffOptions));}if(typeof err.expected!=="string")err.expected=stringify(err.expected,10);if(typeof err.actual!=="string")err.actual=stringify(err.actual,10);try{if(typeof err.message==="string")err.message=normalizeErrorMessage(err.message);if(typeof err.cause==="object"&&typeof err.cause.message==="string")err.cause.message=normalizeErrorMessage(err.cause.message);}catch{}try{return serializeError(err);}catch(e){return serializeError(new Error(\`Failed to fully serialize error: \${e==null?void 0:e.message} -Inner error message: \${err==null?void 0:err.message}\`));}}function isAsymmetricMatcher(data){const type=getType$2(data);return type==="Object"&&typeof data.asymmetricMatch==="function";}function isReplaceable(obj1,obj2){const obj1Type=getType$2(obj1);const obj2Type=getType$2(obj2);return obj1Type===obj2Type&&(obj1Type==="Object"||obj1Type==="Array");}function replaceAsymmetricMatcher(actual,expected,actualReplaced=/* @__PURE__ */new WeakSet(),expectedReplaced=/* @__PURE__ */new WeakSet()){if(!isReplaceable(actual,expected))return{replacedActual:actual,replacedExpected:expected};if(actualReplaced.has(actual)||expectedReplaced.has(expected))return{replacedActual:actual,replacedExpected:expected};actualReplaced.add(actual);expectedReplaced.add(expected);getOwnProperties(expected).forEach(key=>{const expectedValue=expected[key];const actualValue=actual[key];if(isAsymmetricMatcher(expectedValue)){if(expectedValue.asymmetricMatch(actualValue))actual[key]=expectedValue;}else if(isAsymmetricMatcher(actualValue)){if(actualValue.asymmetricMatch(expectedValue))expected[key]=actualValue;}else if(isReplaceable(actualValue,expectedValue)){const replaced=replaceAsymmetricMatcher(actualValue,expectedValue,actualReplaced,expectedReplaced);actual[key]=replaced.replacedActual;expected[key]=replaced.replacedExpected;}});return{replacedActual:actual,replacedExpected:expected};}function createChainable(keys,fn){function create(context){const chain2=function(...args){return fn.apply(context,args);};Object.assign(chain2,fn);chain2.withContext=()=>chain2.bind(context);chain2.setContext=(key,value)=>{context[key]=value;};chain2.mergeContext=ctx=>{Object.assign(context,ctx);};for(const key of keys){Object.defineProperty(chain2,key,{get(){return create(_objectSpread(_objectSpread({},context),{},{[key]:true}));}});}return chain2;}const chain=create({});chain.fn=fn;return chain;}function getNames(task){const names=[task.name];let current=task;while((current==null?void 0:current.suite)||(current==null?void 0:current.file)){current=current.suite||current.file;if(current==null?void 0:current.name)names.unshift(current.name);}return names;}const _DRIVE_LETTER_START_RE=/^[A-Za-z]:\\//;function normalizeWindowsPath$1(input=""){if(!input){return input;}return input.replace(/\\\\/g,"/").replace(_DRIVE_LETTER_START_RE,r=>r.toUpperCase());}const _IS_ABSOLUTE_RE$1=/^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;function cwd$1(){if(typeof process!=="undefined"&&typeof process.cwd==="function"){return process.cwd().replace(/\\\\/g,"/");}return"/";}const resolve$3=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath$1(argument));let resolvedPath="";let resolvedAbsolute=false;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){const path=index>=0?arguments_[index]:cwd$1();if(!path||path.length===0){continue;}resolvedPath=\`\${path}/\${resolvedPath}\`;resolvedAbsolute=isAbsolute$1(path);}resolvedPath=normalizeString$1(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute&&!isAbsolute$1(resolvedPath)){return\`/\${resolvedPath}\`;}return resolvedPath.length>0?resolvedPath:".";};function normalizeString$1(path,allowAboveRoot){let res="";let lastSegmentLength=0;let lastSlash=-1;let dots=0;let char=null;for(let index=0;index<=path.length;++index){if(index2){const lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex===-1){res="";lastSegmentLength=0;}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/");}lastSlash=index;dots=0;continue;}else if(res.length>0){res="";lastSegmentLength=0;lastSlash=index;dots=0;continue;}}if(allowAboveRoot){res+=res.length>0?"/..":"..";lastSegmentLength=2;}}else{if(res.length>0){res+=\`/\${path.slice(lastSlash+1,index)}\`;}else{res=path.slice(lastSlash+1,index);}lastSegmentLength=index-lastSlash-1;}lastSlash=index;dots=0;}else if(char==="."&&dots!==-1){++dots;}else{dots=-1;}}return res;}const isAbsolute$1=function(p){return _IS_ABSOLUTE_RE$1.test(p);};const fnMap=/* @__PURE__ */new WeakMap();const fixtureMap=/* @__PURE__ */new WeakMap();const hooksMap=/* @__PURE__ */new WeakMap();function setFn(key,fn){fnMap.set(key,fn);}function setFixture(key,fixture){fixtureMap.set(key,fixture);}function getFixture(key){return fixtureMap.get(key);}function setHooks(key,hooks){hooksMap.set(key,hooks);}function getHooks(key){return hooksMap.get(key);}class PendingError extends Error{constructor(message,task){super(message);this.message=message;this.taskId=task.id;}code="VITEST_PENDING";taskId;}const collectorContext={tasks:[],currentSuite:null};function collectTask(task){var _a;(_a=collectorContext.currentSuite)==null?void 0:_a.tasks.push(task);}async function runWithSuite(suite,fn){const prev=collectorContext.currentSuite;collectorContext.currentSuite=suite;await fn();collectorContext.currentSuite=prev;}function withTimeout(fn,timeout,isHook=false){if(timeout<=0||timeout===Number.POSITIVE_INFINITY)return fn;const _getSafeTimers=getSafeTimers(),setTimeout=_getSafeTimers.setTimeout,clearTimeout=_getSafeTimers.clearTimeout;return(...args)=>{return Promise.race([fn(...args),new Promise((resolve,reject)=>{var _a;const timer=setTimeout(()=>{clearTimeout(timer);reject(new Error(makeTimeoutMsg(isHook,timeout)));},timeout);(_a=timer.unref)==null?void 0:_a.call(timer);})]);};}function createTestContext(test,runner){var _a;const context=function(){throw new Error("done() callback is deprecated, use promise instead");};context.task=test;context.skip=()=>{test.pending=true;throw new PendingError("test is skipped; abort execution",test);};context.onTestFailed=fn=>{test.onFailed||(test.onFailed=[]);test.onFailed.push(fn);};context.onTestFinished=fn=>{test.onFinished||(test.onFinished=[]);test.onFinished.push(fn);};return((_a=runner.extendTaskContext)==null?void 0:_a.call(runner,context))||context;}function makeTimeoutMsg(isHook,timeout){return\`\${isHook?"Hook":"Test"} timed out in \${timeout}ms. -If this is a long-running \${isHook?"hook":"test"}, pass a timeout value as the last argument or configure it globally with "\${isHook?"hookTimeout":"testTimeout"}".\`;}function mergeContextFixtures(fixtures,context={}){const fixtureOptionKeys=["auto"];const fixtureArray=Object.entries(fixtures).map(([prop,value])=>{const fixtureItem={value};if(Array.isArray(value)&&value.length>=2&&isObject$1(value[1])&&Object.keys(value[1]).some(key=>fixtureOptionKeys.includes(key))){Object.assign(fixtureItem,value[1]);fixtureItem.value=value[0];}fixtureItem.prop=prop;fixtureItem.isFn=typeof fixtureItem.value==="function";return fixtureItem;});if(Array.isArray(context.fixtures))context.fixtures=context.fixtures.concat(fixtureArray);else context.fixtures=fixtureArray;fixtureArray.forEach(fixture=>{if(fixture.isFn){const usedProps=getUsedProps(fixture.value);if(usedProps.length)fixture.deps=context.fixtures.filter(({prop})=>prop!==fixture.prop&&usedProps.includes(prop));}});return context;}const fixtureValueMaps=/* @__PURE__ */new Map();const cleanupFnArrayMap=/* @__PURE__ */new Map();function withFixtures(fn,testContext){return hookContext=>{const context=hookContext||testContext;if(!context)return fn({});const fixtures=getFixture(context);if(!(fixtures==null?void 0:fixtures.length))return fn(context);const usedProps=getUsedProps(fn);const hasAutoFixture=fixtures.some(({auto})=>auto);if(!usedProps.length&&!hasAutoFixture)return fn(context);if(!fixtureValueMaps.get(context))fixtureValueMaps.set(context,/* @__PURE__ */new Map());const fixtureValueMap=fixtureValueMaps.get(context);if(!cleanupFnArrayMap.has(context))cleanupFnArrayMap.set(context,[]);const cleanupFnArray=cleanupFnArrayMap.get(context);const usedFixtures=fixtures.filter(({prop,auto})=>auto||usedProps.includes(prop));const pendingFixtures=resolveDeps(usedFixtures);if(!pendingFixtures.length)return fn(context);async function resolveFixtures(){for(const fixture of pendingFixtures){if(fixtureValueMap.has(fixture))continue;const resolvedValue=fixture.isFn?await resolveFixtureFunction(fixture.value,context,cleanupFnArray):fixture.value;context[fixture.prop]=resolvedValue;fixtureValueMap.set(fixture,resolvedValue);cleanupFnArray.unshift(()=>{fixtureValueMap.delete(fixture);});}}return resolveFixtures().then(()=>fn(context));};}async function resolveFixtureFunction(fixtureFn,context,cleanupFnArray){const useFnArgPromise=createDefer();let isUseFnArgResolved=false;const fixtureReturn=fixtureFn(context,async useFnArg=>{isUseFnArgResolved=true;useFnArgPromise.resolve(useFnArg);const useReturnPromise=createDefer();cleanupFnArray.push(async()=>{useReturnPromise.resolve();await fixtureReturn;});await useReturnPromise;}).catch(e=>{if(!isUseFnArgResolved){useFnArgPromise.reject(e);return;}throw e;});return useFnArgPromise;}function resolveDeps(fixtures,depSet=/* @__PURE__ */new Set(),pendingFixtures=[]){fixtures.forEach(fixture=>{if(pendingFixtures.includes(fixture))return;if(!fixture.isFn||!fixture.deps){pendingFixtures.push(fixture);return;}if(depSet.has(fixture))throw new Error(\`Circular fixture dependency detected: \${fixture.prop} <- \${[...depSet].reverse().map(d=>d.prop).join(" <- ")}\`);depSet.add(fixture);resolveDeps(fixture.deps,depSet,pendingFixtures);pendingFixtures.push(fixture);depSet.clear();});return pendingFixtures;}function getUsedProps(fn){const match=fn.toString().match(/[^(]*\\(([^)]*)/);if(!match)return[];const args=splitByComma(match[1]);if(!args.length)return[];const first=args[0];if(!(first.startsWith("{")&&first.endsWith("}")))throw new Error(\`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "\${first}".\`);const _first=first.slice(1,-1).replace(/\\s/g,"");const props=splitByComma(_first).map(prop=>{return prop.replace(/\\:.*|\\=.*/g,"");});const last=props.at(-1);if(last&&last.startsWith("..."))throw new Error(\`Rest parameters are not supported in fixtures, received "\${last}".\`);return props;}function splitByComma(s){const result=[];const stack=[];let start=0;for(let i=0;i{};if(typeof optionsOrTest==="object"){if(typeof optionsOrFn==="object")throw new TypeError("Cannot use two objects as arguments. Please provide options and a function callback in that order.");options=optionsOrTest;}else if(typeof optionsOrTest==="number"){options={timeout:optionsOrTest};}else if(typeof optionsOrFn==="object"){options=optionsOrFn;}if(typeof optionsOrFn==="function"){if(typeof optionsOrTest==="function")throw new TypeError("Cannot use two functions as arguments. Please use the second argument for options.");fn=optionsOrFn;}else if(typeof optionsOrTest==="function"){fn=optionsOrTest;}return{options,handler:fn};}function createSuiteCollector(name,factory=()=>{},mode,shuffle,each,suiteOptions){const tasks=[];const factoryQueue=[];let suite2;initSuite();const task=function(name2="",options={}){const task2={id:"",name:name2,suite:void 0,each:options.each,fails:options.fails,context:void 0,type:"custom",retry:options.retry??runner.config.retry,repeats:options.repeats,mode:options.only?"only":options.skip?"skip":options.todo?"todo":"run",meta:options.meta??/* @__PURE__ */Object.create(null)};const handler=options.handler;if(options.concurrent||!options.sequential&&runner.config.sequence.concurrent)task2.concurrent=true;if(shuffle)task2.shuffle=true;const context=createTestContext(task2,runner);Object.defineProperty(task2,"context",{value:context,enumerable:false});setFixture(context,options.fixtures);if(handler){setFn(task2,withTimeout(withFixtures(handler,context),(options==null?void 0:options.timeout)??runner.config.testTimeout));}tasks.push(task2);return task2;};const test2=createTest(function(name2,optionsOrFn,optionsOrTest){let _parseArguments=parseArguments(optionsOrFn,optionsOrTest),options=_parseArguments.options,handler=_parseArguments.handler;if(typeof suiteOptions==="object")options=Object.assign({},suiteOptions,options);options.concurrent=this.concurrent||!this.sequential&&(options==null?void 0:options.concurrent);options.sequential=this.sequential||!this.concurrent&&(options==null?void 0:options.sequential);const test3=task(formatName(name2),_objectSpread(_objectSpread(_objectSpread({},this),options),{},{handler}));test3.type="test";});const collector={type:"collector",name,mode,options:suiteOptions,test:test2,tasks,collect,task,clear,on:addHook};function addHook(name2,...fn){getHooks(suite2)[name2].push(...fn);}function initSuite(){if(typeof suiteOptions==="number")suiteOptions={timeout:suiteOptions};suite2={id:"",type:"suite",name,mode,each,shuffle,tasks:[],meta:/* @__PURE__ */Object.create(null),projectName:""};setHooks(suite2,createSuiteHooks());}function clear(){tasks.length=0;factoryQueue.length=0;initSuite();}async function collect(file){factoryQueue.length=0;if(factory)await runWithSuite(collector,()=>factory(test2));const allChildren=[];for(const i of[...factoryQueue,...tasks])allChildren.push(i.type==="collector"?await i.collect(file):i);suite2.file=file;suite2.tasks=allChildren;allChildren.forEach(task2=>{task2.suite=suite2;if(file)task2.file=file;});return suite2;}collectTask(collector);return collector;}function createSuite(){function suiteFn(name,factoryOrOptions,optionsOrFactory={}){const mode=this.only?"only":this.skip?"skip":this.todo?"todo":"run";const currentSuite=getCurrentSuite();let _parseArguments2=parseArguments(factoryOrOptions,optionsOrFactory),options=_parseArguments2.options,factory=_parseArguments2.handler;if(currentSuite==null?void 0:currentSuite.options)options=_objectSpread(_objectSpread({},currentSuite.options),options);options.concurrent=this.concurrent||!this.sequential&&(options==null?void 0:options.concurrent);options.sequential=this.sequential||!this.concurrent&&(options==null?void 0:options.sequential);return createSuiteCollector(formatName(name),factory,mode,this.shuffle,this.each,options);}suiteFn.each=function(cases,...args){const suite2=this.withContext();this.setContext("each",true);if(Array.isArray(cases)&&args.length)cases=formatTemplateString(cases,args);return(name,optionsOrFn,fnOrOptions)=>{const _name=formatName(name);const arrayOnlyCases=cases.every(Array.isArray);const _parseArguments3=parseArguments(optionsOrFn,fnOrOptions),options=_parseArguments3.options,handler=_parseArguments3.handler;cases.forEach((i,idx)=>{const items=Array.isArray(i)?i:[i];arrayOnlyCases?suite2(formatTitle(_name,items,idx),options,()=>handler(...items)):suite2(formatTitle(_name,items,idx),options,()=>handler(i));});this.setContext("each",void 0);};};suiteFn.skipIf=condition=>condition?suite.skip:suite;suiteFn.runIf=condition=>condition?suite:suite.skip;return createChainable(["concurrent","sequential","shuffle","skip","only","todo"],suiteFn);}function createTaskCollector(fn,context){const taskFn=fn;taskFn.each=function(cases,...args){const test2=this.withContext();this.setContext("each",true);if(Array.isArray(cases)&&args.length)cases=formatTemplateString(cases,args);return(name,optionsOrFn,fnOrOptions)=>{const _name=formatName(name);const arrayOnlyCases=cases.every(Array.isArray);const _parseArguments4=parseArguments(optionsOrFn,fnOrOptions),options=_parseArguments4.options,handler=_parseArguments4.handler;cases.forEach((i,idx)=>{const items=Array.isArray(i)?i:[i];arrayOnlyCases?test2(formatTitle(_name,items,idx),options,()=>handler(...items)):test2(formatTitle(_name,items,idx),options,()=>handler(i));});this.setContext("each",void 0);};};taskFn.skipIf=function(condition){return condition?this.skip:this;};taskFn.runIf=function(condition){return condition?this:this.skip;};taskFn.extend=function(fixtures){const _context=mergeContextFixtures(fixtures,context);return createTest(function fn2(name,optionsOrFn,optionsOrTest){getCurrentSuite().test.fn.call(this,formatName(name),optionsOrFn,optionsOrTest);},_context);};const _test=createChainable(["concurrent","sequential","skip","only","todo","fails"],taskFn);if(context)_test.mergeContext(context);return _test;}function createTest(fn,context){return createTaskCollector(fn,context);}function formatName(name){return typeof name==="string"?name:name instanceof Function?name.name||"":String(name);}function formatTitle(template,items,idx){if(template.includes("%#")){template=template.replace(/%%/g,"__vitest_escaped_%__").replace(/%#/g,\`\${idx}\`).replace(/__vitest_escaped_%__/g,"%%");}const count=template.split("%").length-1;let formatted=format(template,...items.slice(0,count));if(isObject$1(items[0])){formatted=formatted.replace(/\\$([$\\w_.]+)/g,// https://github.com/chaijs/chai/pull/1490 +\${difference}\`;}}return difference;}function getFormatOptions(formatOptions,options){const _normalizeDiffOptions3=normalizeDiffOptions(options),compareKeys=_normalizeDiffOptions3.compareKeys;return _objectSpread(_objectSpread({},formatOptions),{},{compareKeys});}function getObjectsDifference(a,b,formatOptions,options){const formatOptionsZeroIndent=_objectSpread(_objectSpread({},formatOptions),{},{indent:0});const aCompare=format_1(a,formatOptionsZeroIndent);const bCompare=format_1(b,formatOptionsZeroIndent);if(aCompare===bCompare){return getCommonMessage(NO_DIFF_MESSAGE,options);}else{const aDisplay=format_1(a,formatOptions);const bDisplay=format_1(b,formatOptions);return diffLinesUnified2(aDisplay.split("\\n"),bDisplay.split("\\n"),aCompare.split("\\n"),bCompare.split("\\n"),options);}}const IS_RECORD_SYMBOL="@@__IMMUTABLE_RECORD__@@";const IS_COLLECTION_SYMBOL="@@__IMMUTABLE_ITERABLE__@@";function isImmutable(v){return v&&(v[IS_COLLECTION_SYMBOL]||v[IS_RECORD_SYMBOL]);}const OBJECT_PROTO=Object.getPrototypeOf({});function getUnserializableMessage(err){if(err instanceof Error)return\`: \${err.message}\`;if(typeof err==="string")return\`: \${err}\`;return"";}function serializeError(val,seen=/* @__PURE__ */new WeakMap()){if(!val||typeof val==="string")return val;if(typeof val==="function")return\`Function<\${val.name||"anonymous"}>\`;if(typeof val==="symbol")return val.toString();if(typeof val!=="object")return val;if(isImmutable(val))return serializeError(val.toJSON(),seen);if(val instanceof Promise||val.constructor&&val.constructor.prototype==="AsyncFunction")return"Promise";if(typeof Element!=="undefined"&&val instanceof Element)return val.tagName;if(typeof val.asymmetricMatch==="function")return\`\${val.toString()} \${format(val.sample)}\`;if(typeof val.toJSON==="function")return val.toJSON();if(seen.has(val))return seen.get(val);if(Array.isArray(val)){const clone=new Array(val.length);seen.set(val,clone);val.forEach((e,i)=>{try{clone[i]=serializeError(e,seen);}catch(err){clone[i]=getUnserializableMessage(err);}});return clone;}else{const clone=/* @__PURE__ */Object.create(null);seen.set(val,clone);let obj=val;while(obj&&obj!==OBJECT_PROTO){Object.getOwnPropertyNames(obj).forEach(key=>{if(key in clone)return;try{clone[key]=serializeError(val[key],seen);}catch(err){delete clone[key];clone[key]=getUnserializableMessage(err);}});obj=Object.getPrototypeOf(obj);}return clone;}}function normalizeErrorMessage(message){return message.replace(/__(vite_ssr_import|vi_import)_\\d+__\\./g,"");}function processError(err,diffOptions){if(!err||typeof err!=="object")return{message:err};if(err.stack)err.stackStr=String(err.stack);if(err.name)err.nameStr=String(err.name);if(err.showDiff||err.showDiff===void 0&&err.expected!==void 0&&err.actual!==void 0){const clonedActual=deepClone(err.actual,{forceWritable:true});const clonedExpected=deepClone(err.expected,{forceWritable:true});const _replaceAsymmetricMat=replaceAsymmetricMatcher(clonedActual,clonedExpected),replacedActual=_replaceAsymmetricMat.replacedActual,replacedExpected=_replaceAsymmetricMat.replacedExpected;err.diff=diff(replacedExpected,replacedActual,_objectSpread(_objectSpread({},diffOptions),err.diffOptions));}if(typeof err.expected!=="string")err.expected=stringify(err.expected,10);if(typeof err.actual!=="string")err.actual=stringify(err.actual,10);try{if(typeof err.message==="string")err.message=normalizeErrorMessage(err.message);if(typeof err.cause==="object"&&typeof err.cause.message==="string")err.cause.message=normalizeErrorMessage(err.cause.message);}catch{}try{return serializeError(err);}catch(e){return serializeError(new Error(\`Failed to fully serialize error: \${e==null?void 0:e.message} +Inner error message: \${err==null?void 0:err.message}\`));}}function isAsymmetricMatcher(data){const type=getType$2(data);return type==="Object"&&typeof data.asymmetricMatch==="function";}function isReplaceable(obj1,obj2){const obj1Type=getType$2(obj1);const obj2Type=getType$2(obj2);return obj1Type===obj2Type&&(obj1Type==="Object"||obj1Type==="Array");}function replaceAsymmetricMatcher(actual,expected,actualReplaced=/* @__PURE__ */new WeakSet(),expectedReplaced=/* @__PURE__ */new WeakSet()){if(!isReplaceable(actual,expected))return{replacedActual:actual,replacedExpected:expected};if(actualReplaced.has(actual)||expectedReplaced.has(expected))return{replacedActual:actual,replacedExpected:expected};actualReplaced.add(actual);expectedReplaced.add(expected);getOwnProperties(expected).forEach(key=>{const expectedValue=expected[key];const actualValue=actual[key];if(isAsymmetricMatcher(expectedValue)){if(expectedValue.asymmetricMatch(actualValue))actual[key]=expectedValue;}else if(isAsymmetricMatcher(actualValue)){if(actualValue.asymmetricMatch(expectedValue))expected[key]=actualValue;}else if(isReplaceable(actualValue,expectedValue)){const replaced=replaceAsymmetricMatcher(actualValue,expectedValue,actualReplaced,expectedReplaced);actual[key]=replaced.replacedActual;expected[key]=replaced.replacedExpected;}});return{replacedActual:actual,replacedExpected:expected};}function createChainable(keys,fn){function create(context){const chain2=function(...args){return fn.apply(context,args);};Object.assign(chain2,fn);chain2.withContext=()=>chain2.bind(context);chain2.setContext=(key,value)=>{context[key]=value;};chain2.mergeContext=ctx=>{Object.assign(context,ctx);};for(const key of keys){Object.defineProperty(chain2,key,{get(){return create(_objectSpread(_objectSpread({},context),{},{[key]:true}));}});}return chain2;}const chain=create({});chain.fn=fn;return chain;}function getNames(task){const names=[task.name];let current=task;while((current==null?void 0:current.suite)||(current==null?void 0:current.file)){current=current.suite||current.file;if(current==null?void 0:current.name)names.unshift(current.name);}return names;}const _DRIVE_LETTER_START_RE=/^[A-Za-z]:\\//;function normalizeWindowsPath$1(input=""){if(!input){return input;}return input.replace(/\\\\/g,"/").replace(_DRIVE_LETTER_START_RE,r=>r.toUpperCase());}const _IS_ABSOLUTE_RE$1=/^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;function cwd$1(){if(typeof process!=="undefined"&&typeof process.cwd==="function"){return process.cwd().replace(/\\\\/g,"/");}return"/";}const resolve$3=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath$1(argument));let resolvedPath="";let resolvedAbsolute=false;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){const path=index>=0?arguments_[index]:cwd$1();if(!path||path.length===0){continue;}resolvedPath=\`\${path}/\${resolvedPath}\`;resolvedAbsolute=isAbsolute$1(path);}resolvedPath=normalizeString$1(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute&&!isAbsolute$1(resolvedPath)){return\`/\${resolvedPath}\`;}return resolvedPath.length>0?resolvedPath:".";};function normalizeString$1(path,allowAboveRoot){let res="";let lastSegmentLength=0;let lastSlash=-1;let dots=0;let char=null;for(let index=0;index<=path.length;++index){if(index2){const lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex===-1){res="";lastSegmentLength=0;}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/");}lastSlash=index;dots=0;continue;}else if(res.length>0){res="";lastSegmentLength=0;lastSlash=index;dots=0;continue;}}if(allowAboveRoot){res+=res.length>0?"/..":"..";lastSegmentLength=2;}}else{if(res.length>0){res+=\`/\${path.slice(lastSlash+1,index)}\`;}else{res=path.slice(lastSlash+1,index);}lastSegmentLength=index-lastSlash-1;}lastSlash=index;dots=0;}else if(char==="."&&dots!==-1){++dots;}else{dots=-1;}}return res;}const isAbsolute$1=function(p){return _IS_ABSOLUTE_RE$1.test(p);};function normalizeWindowsPath(input=""){if(!input||!input.includes("\\\\")){return input;}return input.replace(/\\\\/g,"/");}const _IS_ABSOLUTE_RE=/^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;function cwd(){if(typeof process!=="undefined"){return process.cwd().replace(/\\\\/g,"/");}return"/";}const resolve$2=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath(argument));let resolvedPath="";let resolvedAbsolute=false;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){const path=index>=0?arguments_[index]:cwd();if(!path||path.length===0){continue;}resolvedPath=\`\${path}/\${resolvedPath}\`;resolvedAbsolute=isAbsolute(path);}resolvedPath=normalizeString(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute&&!isAbsolute(resolvedPath)){return\`/\${resolvedPath}\`;}return resolvedPath.length>0?resolvedPath:".";};function normalizeString(path,allowAboveRoot){let res="";let lastSegmentLength=0;let lastSlash=-1;let dots=0;let char=null;for(let index=0;index<=path.length;++index){if(index2){const lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex===-1){res="";lastSegmentLength=0;}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/");}lastSlash=index;dots=0;continue;}else if(res.length>0){res="";lastSegmentLength=0;lastSlash=index;dots=0;continue;}}if(allowAboveRoot){res+=res.length>0?"/..":"..";lastSegmentLength=2;}}else{if(res.length>0){res+=\`/\${path.slice(lastSlash+1,index)}\`;}else{res=path.slice(lastSlash+1,index);}lastSegmentLength=index-lastSlash-1;}lastSlash=index;dots=0;}else if(char==="."&&dots!==-1){++dots;}else{dots=-1;}}return res;}const isAbsolute=function(p){return _IS_ABSOLUTE_RE.test(p);};const chars$1='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';const intToChar$1=new Uint8Array(64);// 64 possible chars. +const charToInt$1=new Uint8Array(128);// z is 122 in ASCII +for(let i=0;i eval"))line=line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,":$1");if(!line.includes("@")&&!line.includes(":"))return null;const functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;const matches=line.match(functionNameRegex);const functionName=matches&&matches[1]?matches[1]:void 0;const _extractLocation$=extractLocation$1(line.replace(functionNameRegex,"")),_extractLocation$2=_slicedToArray(_extractLocation$,3),url=_extractLocation$2[0],lineNumber=_extractLocation$2[1],columnNumber=_extractLocation$2[2];if(!url||!lineNumber||!columnNumber)return null;return{file:url,method:functionName||"",line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseSingleStack(raw){const line=raw.trim();if(!CHROME_IE_STACK_REGEXP$1.test(line))return parseSingleFFOrSafariStack$1(line);return parseSingleV8Stack$1(line);}function parseSingleV8Stack$1(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP$1.test(line))return null;if(line.includes("(eval "))line=line.replace(/eval code/g,"eval").replace(/(\\(eval at [^()]*)|(,.*$)/g,"");let sanitizedLine=line.replace(/^\\s+/,"").replace(/\\(eval code/g,"(").replace(/^.*?\\s+/,"");const location=sanitizedLine.match(/ (\\(.+\\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],""):sanitizedLine;const _extractLocation$3=extractLocation$1(location?location[1]:sanitizedLine),_extractLocation$4=_slicedToArray(_extractLocation$3,3),url=_extractLocation$4[0],lineNumber=_extractLocation$4[1],columnNumber=_extractLocation$4[2];let method=location&&sanitizedLine||"";let file=url&&["eval",""].includes(url)?void 0:url;if(!file||!lineNumber||!columnNumber)return null;if(method.startsWith("async "))method=method.slice(6);if(file.startsWith("file://"))file=file.slice(7);file=resolve$2(file);if(method)method=method.replace(/__vite_ssr_import_\\d+__\\./g,"");return{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}const fnMap=/* @__PURE__ */new WeakMap();const fixtureMap=/* @__PURE__ */new WeakMap();const hooksMap=/* @__PURE__ */new WeakMap();function setFn(key,fn){fnMap.set(key,fn);}function setFixture(key,fixture){fixtureMap.set(key,fixture);}function getFixture(key){return fixtureMap.get(key);}function setHooks(key,hooks){hooksMap.set(key,hooks);}function getHooks(key){return hooksMap.get(key);}class PendingError extends Error{constructor(message,task){super(message);this.message=message;this.taskId=task.id;}code="VITEST_PENDING";taskId;}const collectorContext={tasks:[],currentSuite:null};function collectTask(task){var _a;(_a=collectorContext.currentSuite)==null?void 0:_a.tasks.push(task);}async function runWithSuite(suite,fn){const prev=collectorContext.currentSuite;collectorContext.currentSuite=suite;await fn();collectorContext.currentSuite=prev;}function withTimeout(fn,timeout,isHook=false){if(timeout<=0||timeout===Number.POSITIVE_INFINITY)return fn;const _getSafeTimers=getSafeTimers(),setTimeout=_getSafeTimers.setTimeout,clearTimeout=_getSafeTimers.clearTimeout;return(...args)=>{return Promise.race([fn(...args),new Promise((resolve,reject)=>{var _a;const timer=setTimeout(()=>{clearTimeout(timer);reject(new Error(makeTimeoutMsg(isHook,timeout)));},timeout);(_a=timer.unref)==null?void 0:_a.call(timer);})]);};}function createTestContext(test,runner){var _a;const context=function(){throw new Error("done() callback is deprecated, use promise instead");};context.task=test;context.skip=()=>{test.pending=true;throw new PendingError("test is skipped; abort execution",test);};context.onTestFailed=fn=>{test.onFailed||(test.onFailed=[]);test.onFailed.push(fn);};context.onTestFinished=fn=>{test.onFinished||(test.onFinished=[]);test.onFinished.push(fn);};return((_a=runner.extendTaskContext)==null?void 0:_a.call(runner,context))||context;}function makeTimeoutMsg(isHook,timeout){return\`\${isHook?"Hook":"Test"} timed out in \${timeout}ms. +If this is a long-running \${isHook?"hook":"test"}, pass a timeout value as the last argument or configure it globally with "\${isHook?"hookTimeout":"testTimeout"}".\`;}function mergeContextFixtures(fixtures,context={}){const fixtureOptionKeys=["auto"];const fixtureArray=Object.entries(fixtures).map(([prop,value])=>{const fixtureItem={value};if(Array.isArray(value)&&value.length>=2&&isObject$1(value[1])&&Object.keys(value[1]).some(key=>fixtureOptionKeys.includes(key))){Object.assign(fixtureItem,value[1]);fixtureItem.value=value[0];}fixtureItem.prop=prop;fixtureItem.isFn=typeof fixtureItem.value==="function";return fixtureItem;});if(Array.isArray(context.fixtures))context.fixtures=context.fixtures.concat(fixtureArray);else context.fixtures=fixtureArray;fixtureArray.forEach(fixture=>{if(fixture.isFn){const usedProps=getUsedProps(fixture.value);if(usedProps.length)fixture.deps=context.fixtures.filter(({prop})=>prop!==fixture.prop&&usedProps.includes(prop));}});return context;}const fixtureValueMaps=/* @__PURE__ */new Map();const cleanupFnArrayMap=/* @__PURE__ */new Map();function withFixtures(fn,testContext){return hookContext=>{const context=hookContext||testContext;if(!context)return fn({});const fixtures=getFixture(context);if(!(fixtures==null?void 0:fixtures.length))return fn(context);const usedProps=getUsedProps(fn);const hasAutoFixture=fixtures.some(({auto})=>auto);if(!usedProps.length&&!hasAutoFixture)return fn(context);if(!fixtureValueMaps.get(context))fixtureValueMaps.set(context,/* @__PURE__ */new Map());const fixtureValueMap=fixtureValueMaps.get(context);if(!cleanupFnArrayMap.has(context))cleanupFnArrayMap.set(context,[]);const cleanupFnArray=cleanupFnArrayMap.get(context);const usedFixtures=fixtures.filter(({prop,auto})=>auto||usedProps.includes(prop));const pendingFixtures=resolveDeps(usedFixtures);if(!pendingFixtures.length)return fn(context);async function resolveFixtures(){for(const fixture of pendingFixtures){if(fixtureValueMap.has(fixture))continue;const resolvedValue=fixture.isFn?await resolveFixtureFunction(fixture.value,context,cleanupFnArray):fixture.value;context[fixture.prop]=resolvedValue;fixtureValueMap.set(fixture,resolvedValue);cleanupFnArray.unshift(()=>{fixtureValueMap.delete(fixture);});}}return resolveFixtures().then(()=>fn(context));};}async function resolveFixtureFunction(fixtureFn,context,cleanupFnArray){const useFnArgPromise=createDefer();let isUseFnArgResolved=false;const fixtureReturn=fixtureFn(context,async useFnArg=>{isUseFnArgResolved=true;useFnArgPromise.resolve(useFnArg);const useReturnPromise=createDefer();cleanupFnArray.push(async()=>{useReturnPromise.resolve();await fixtureReturn;});await useReturnPromise;}).catch(e=>{if(!isUseFnArgResolved){useFnArgPromise.reject(e);return;}throw e;});return useFnArgPromise;}function resolveDeps(fixtures,depSet=/* @__PURE__ */new Set(),pendingFixtures=[]){fixtures.forEach(fixture=>{if(pendingFixtures.includes(fixture))return;if(!fixture.isFn||!fixture.deps){pendingFixtures.push(fixture);return;}if(depSet.has(fixture))throw new Error(\`Circular fixture dependency detected: \${fixture.prop} <- \${[...depSet].reverse().map(d=>d.prop).join(" <- ")}\`);depSet.add(fixture);resolveDeps(fixture.deps,depSet,pendingFixtures);pendingFixtures.push(fixture);depSet.clear();});return pendingFixtures;}function getUsedProps(fn){const match=fn.toString().match(/[^(]*\\(([^)]*)/);if(!match)return[];const args=splitByComma(match[1]);if(!args.length)return[];const first=args[0];if(!(first.startsWith("{")&&first.endsWith("}")))throw new Error(\`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "\${first}".\`);const _first=first.slice(1,-1).replace(/\\s/g,"");const props=splitByComma(_first).map(prop=>{return prop.replace(/\\:.*|\\=.*/g,"");});const last=props.at(-1);if(last&&last.startsWith("..."))throw new Error(\`Rest parameters are not supported in fixtures, received "\${last}".\`);return props;}function splitByComma(s){const result=[];const stack=[];let start=0;for(let i=0;i{};if(typeof optionsOrTest==="object"){if(typeof optionsOrFn==="object")throw new TypeError("Cannot use two objects as arguments. Please provide options and a function callback in that order.");options=optionsOrTest;}else if(typeof optionsOrTest==="number"){options={timeout:optionsOrTest};}else if(typeof optionsOrFn==="object"){options=optionsOrFn;}if(typeof optionsOrFn==="function"){if(typeof optionsOrTest==="function")throw new TypeError("Cannot use two functions as arguments. Please use the second argument for options.");fn=optionsOrFn;}else if(typeof optionsOrTest==="function"){fn=optionsOrTest;}return{options,handler:fn};}function createSuiteCollector(name,factory=()=>{},mode,shuffle,each,suiteOptions){const tasks=[];const factoryQueue=[];let suite2;initSuite();const task=function(name2="",options={}){const task2={id:"",name:name2,suite:void 0,each:options.each,fails:options.fails,context:void 0,type:"custom",retry:options.retry??runner.config.retry,repeats:options.repeats,mode:options.only?"only":options.skip?"skip":options.todo?"todo":"run",meta:options.meta??/* @__PURE__ */Object.create(null)};const handler=options.handler;if(options.concurrent||!options.sequential&&runner.config.sequence.concurrent)task2.concurrent=true;if(shuffle)task2.shuffle=true;const context=createTestContext(task2,runner);Object.defineProperty(task2,"context",{value:context,enumerable:false});setFixture(context,options.fixtures);if(handler){setFn(task2,withTimeout(withFixtures(handler,context),(options==null?void 0:options.timeout)??runner.config.testTimeout));}if(runner.config.includeTaskLocation);tasks.push(task2);return task2;};const test2=createTest(function(name2,optionsOrFn,optionsOrTest){let _parseArguments=parseArguments(optionsOrFn,optionsOrTest),options=_parseArguments.options,handler=_parseArguments.handler;if(typeof suiteOptions==="object")options=Object.assign({},suiteOptions,options);options.concurrent=this.concurrent||!this.sequential&&(options==null?void 0:options.concurrent);options.sequential=this.sequential||!this.concurrent&&(options==null?void 0:options.sequential);const test3=task(formatName(name2),_objectSpread(_objectSpread(_objectSpread({},this),options),{},{handler}));test3.type="test";});const collector={type:"collector",name,mode,options:suiteOptions,test:test2,tasks,collect,task,clear,on:addHook};function addHook(name2,...fn){getHooks(suite2)[name2].push(...fn);}function initSuite(includeLocation){if(typeof suiteOptions==="number")suiteOptions={timeout:suiteOptions};suite2={id:"",type:"suite",name,mode,each,shuffle,tasks:[],meta:/* @__PURE__ */Object.create(null),projectName:""};setHooks(suite2,createSuiteHooks());}function clear(){tasks.length=0;factoryQueue.length=0;initSuite();}async function collect(file){factoryQueue.length=0;if(factory)await runWithSuite(collector,()=>factory(test2));const allChildren=[];for(const i of[...factoryQueue,...tasks])allChildren.push(i.type==="collector"?await i.collect(file):i);suite2.file=file;suite2.tasks=allChildren;allChildren.forEach(task2=>{task2.suite=suite2;if(file)task2.file=file;});return suite2;}collectTask(collector);return collector;}function createSuite(){function suiteFn(name,factoryOrOptions,optionsOrFactory={}){const mode=this.only?"only":this.skip?"skip":this.todo?"todo":"run";const currentSuite=getCurrentSuite();let _parseArguments2=parseArguments(factoryOrOptions,optionsOrFactory),options=_parseArguments2.options,factory=_parseArguments2.handler;if(currentSuite==null?void 0:currentSuite.options)options=_objectSpread(_objectSpread({},currentSuite.options),options);options.concurrent=this.concurrent||!this.sequential&&(options==null?void 0:options.concurrent);options.sequential=this.sequential||!this.concurrent&&(options==null?void 0:options.sequential);return createSuiteCollector(formatName(name),factory,mode,this.shuffle,this.each,options);}suiteFn.each=function(cases,...args){const suite2=this.withContext();this.setContext("each",true);if(Array.isArray(cases)&&args.length)cases=formatTemplateString(cases,args);return(name,optionsOrFn,fnOrOptions)=>{const _name=formatName(name);const arrayOnlyCases=cases.every(Array.isArray);const _parseArguments3=parseArguments(optionsOrFn,fnOrOptions),options=_parseArguments3.options,handler=_parseArguments3.handler;const fnFirst=typeof optionsOrFn==="function";cases.forEach((i,idx)=>{const items=Array.isArray(i)?i:[i];if(fnFirst){arrayOnlyCases?suite2(formatTitle(_name,items,idx),()=>handler(...items),options):suite2(formatTitle(_name,items,idx),()=>handler(i),options);}else{arrayOnlyCases?suite2(formatTitle(_name,items,idx),options,()=>handler(...items)):suite2(formatTitle(_name,items,idx),options,()=>handler(i));}});this.setContext("each",void 0);};};suiteFn.skipIf=condition=>condition?suite.skip:suite;suiteFn.runIf=condition=>condition?suite:suite.skip;return createChainable(["concurrent","sequential","shuffle","skip","only","todo"],suiteFn);}function createTaskCollector(fn,context){const taskFn=fn;taskFn.each=function(cases,...args){const test2=this.withContext();this.setContext("each",true);if(Array.isArray(cases)&&args.length)cases=formatTemplateString(cases,args);return(name,optionsOrFn,fnOrOptions)=>{const _name=formatName(name);const arrayOnlyCases=cases.every(Array.isArray);const _parseArguments4=parseArguments(optionsOrFn,fnOrOptions),options=_parseArguments4.options,handler=_parseArguments4.handler;const fnFirst=typeof optionsOrFn==="function";cases.forEach((i,idx)=>{const items=Array.isArray(i)?i:[i];if(fnFirst){arrayOnlyCases?test2(formatTitle(_name,items,idx),()=>handler(...items),options):test2(formatTitle(_name,items,idx),()=>handler(i),options);}else{arrayOnlyCases?test2(formatTitle(_name,items,idx),options,()=>handler(...items)):test2(formatTitle(_name,items,idx),options,()=>handler(i));}});this.setContext("each",void 0);};};taskFn.skipIf=function(condition){return condition?this.skip:this;};taskFn.runIf=function(condition){return condition?this:this.skip;};taskFn.extend=function(fixtures){const _context=mergeContextFixtures(fixtures,context);return createTest(function fn2(name,optionsOrFn,optionsOrTest){getCurrentSuite().test.fn.call(this,formatName(name),optionsOrFn,optionsOrTest);},_context);};const _test=createChainable(["concurrent","sequential","skip","only","todo","fails"],taskFn);if(context)_test.mergeContext(context);return _test;}function createTest(fn,context){return createTaskCollector(fn,context);}function formatName(name){return typeof name==="string"?name:name instanceof Function?name.name||"":String(name);}function formatTitle(template,items,idx){if(template.includes("%#")){template=template.replace(/%%/g,"__vitest_escaped_%__").replace(/%#/g,\`\${idx}\`).replace(/__vitest_escaped_%__/g,"%%");}const count=template.split("%").length-1;let formatted=format(template,...items.slice(0,count));if(isObject$1(items[0])){formatted=formatted.replace(/\\$([$\\w_.]+)/g,// https://github.com/chaijs/chai/pull/1490 (_,key)=>{var _a,_b;return objDisplay$2(objectAttr(items[0],key),{truncate:(_b=(_a=void 0)==null?void 0:_a.chaiConfig)==null?void 0:_b.truncateThreshold});});}return formatted;}function formatTemplateString(cases,args){const header=cases.join("").trim().replace(/ /g,"").split("\\n").map(i=>i.split("|"))[0];const res=[];for(let i=0;i @@ -17487,16 +17520,17 @@ message=actual;actual=undefined;}message=message||'assert.fail()';throw new chai function R(e,t){if(!e)throw new Error(t);}function u(e,t){return typeof t===e;}function b(e){return e instanceof Promise;}function f(e,t,n){Object.defineProperty(e,t,n);}function i(e,t,n){Object.defineProperty(e,t,{value:n});}// src/constants.ts var c=Symbol.for("tinyspy:spy");// src/internal.ts var g=/* @__PURE__ */new Set(),C=e=>{e.called=!1,e.callCount=0,e.calls=[],e.results=[],e.next=[];},M=e=>(f(e,c,{value:{reset:()=>C(e[c])}}),e[c]),A=e=>e[c]||M(e);function I(e){R(u("function",e)||u("undefined",e),"cannot spy on a non-function value");let t=function(...s){let r=A(t);r.called=!0,r.callCount++,r.calls.push(s);let m=r.next.shift();if(m){r.results.push(m);let _m=_slicedToArray(m,2),l=_m[0],o=_m[1];if(l==="ok")return o;throw o;}let p,d="ok";if(r.impl)try{new.target?p=Reflect.construct(r.impl,s,new.target):p=r.impl.apply(this,s),d="ok";}catch(l){throw p=l,d="error",r.results.push([d,l]),l;}let a=[d,p];if(b(p)){let l=p.then(o=>a[1]=o).catch(o=>{throw a[0]="error",a[1]=o,o;});Object.assign(l,p),p=l;}return r.results.push(a),p;};i(t,"_isMockFunction",!0),i(t,"length",e?e.length:0),i(t,"name",e&&e.name||"spy");let n=A(t);return n.reset(),n.impl=e,t;}// src/spyOn.ts -var k=(e,t)=>Object.getOwnPropertyDescriptor(e,t),P=(e,t)=>{t!=null&&typeof t=="function"&&t.prototype!=null&&Object.setPrototypeOf(e.prototype,t.prototype);};function E(e,t,n){R(!u("undefined",e),"spyOn could not find an object to spy upon"),R(u("object",e)||u("function",e),"cannot spyOn on a primitive value");let _ref9=(()=>{if(!u("object",t))return[t,"value"];if("getter"in t&&"setter"in t)throw new Error("cannot spy on both getter and setter");if("getter"in t)return[t.getter,"get"];if("setter"in t)return[t.setter,"set"];throw new Error("specify getter or setter to spy on");})(),_ref10=_slicedToArray(_ref9,2),s=_ref10[0],r=_ref10[1],m=k(e,s),p=Object.getPrototypeOf(e),d=p&&k(p,s),a=m||d;R(a||s in e,\`\${String(s)} does not exist\`);let l=!1;r==="value"&&a&&!a.value&&a.get&&(r="get",l=!0,n=a.get());let o;a?o=a[r]:r!=="value"?o=()=>e[s]:o=e[s],n||(n=o);let y=I(n);r==="value"&&P(y,o);let O=h=>{let _ref11=a||{configurable:!0,writable:!0},G=_ref11.value,w=_objectWithoutProperties(_ref11,_excluded2);r!=="value"&&delete w.writable,w[r]=h,f(e,s,w);},K=()=>a?f(e,s,a):O(o),T=y[c];return i(T,"restore",K),i(T,"getOriginal",()=>l?o():o),i(T,"willCall",h=>(T.impl=h,y)),O(l?()=>(P(y,n),y):y),g.add(y),y;}const mocks=/* @__PURE__ */new Set();function isMockFunction(fn2){return typeof fn2==="function"&&"_isMockFunction"in fn2&&fn2._isMockFunction;}function spyOn(obj,method,accessType){const dictionary={get:"getter",set:"setter"};const objMethod=accessType?{[dictionary[accessType]]:method}:method;const stub=E(obj,objMethod);return enhanceSpy(stub);}let callOrder=0;function enhanceSpy(spy){const stub=spy;let implementation;let instances=[];let invocations=[];const state=A(spy);const mockContext={get calls(){return state.calls;},get instances(){return instances;},get invocationCallOrder(){return invocations;},get results(){return state.results.map(([callType,value])=>{const type=callType==="error"?"throw":"return";return{type,value};});},get lastCall(){return state.calls[state.calls.length-1];}};let onceImplementations=[];let implementationChangedTemporarily=false;function mockCall(...args){instances.push(this);invocations.push(++callOrder);const impl=implementationChangedTemporarily?implementation:onceImplementations.shift()||implementation||state.getOriginal()||(()=>{});return impl.apply(this,args);}let name=stub.name;stub.getMockName=()=>name||"vi.fn()";stub.mockName=n=>{name=n;return stub;};stub.mockClear=()=>{state.reset();instances=[];invocations=[];return stub;};stub.mockReset=()=>{stub.mockClear();implementation=()=>void 0;onceImplementations=[];return stub;};stub.mockRestore=()=>{stub.mockReset();state.restore();implementation=void 0;return stub;};stub.getMockImplementation=()=>implementation;stub.mockImplementation=fn2=>{implementation=fn2;state.willCall(mockCall);return stub;};stub.mockImplementationOnce=fn2=>{onceImplementations.push(fn2);return stub;};function withImplementation(fn2,cb){const originalImplementation=implementation;implementation=fn2;state.willCall(mockCall);implementationChangedTemporarily=true;const reset=()=>{implementation=originalImplementation;implementationChangedTemporarily=false;};const result=cb();if(result instanceof Promise){return result.then(()=>{reset();return stub;});}reset();return stub;}stub.withImplementation=withImplementation;stub.mockReturnThis=()=>stub.mockImplementation(function(){return this;});stub.mockReturnValue=val=>stub.mockImplementation(()=>val);stub.mockReturnValueOnce=val=>stub.mockImplementationOnce(()=>val);stub.mockResolvedValue=val=>stub.mockImplementation(()=>Promise.resolve(val));stub.mockResolvedValueOnce=val=>stub.mockImplementationOnce(()=>Promise.resolve(val));stub.mockRejectedValue=val=>stub.mockImplementation(()=>Promise.reject(val));stub.mockRejectedValueOnce=val=>stub.mockImplementationOnce(()=>Promise.reject(val));Object.defineProperty(stub,"mock",{get:()=>mockContext});state.willCall(mockCall);mocks.add(stub);return stub;}function fn(implementation){const enhancedSpy=enhanceSpy(E({spy:implementation||(()=>{})},"spy"));if(implementation)enhancedSpy.mockImplementation(implementation);return enhancedSpy;}const MATCHERS_OBJECT$1=Symbol.for("matchers-object");const JEST_MATCHERS_OBJECT$1=Symbol.for("$$jest-matchers-object");const GLOBAL_EXPECT$1=Symbol.for("expect-global");const ASYMMETRIC_MATCHERS_OBJECT$1=Symbol.for("asymmetric-matchers-object");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT$1)){const globalState=/* @__PURE__ */new WeakMap();const matchers=/* @__PURE__ */Object.create(null);const customEqualityTesters=[];const assymetricMatchers=/* @__PURE__ */Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT$1,{get:()=>globalState});Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT$1,{configurable:true,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT$1]),matchers,customEqualityTesters})});Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT$1,{get:()=>assymetricMatchers});}function getState(expect){return globalThis[MATCHERS_OBJECT$1].get(expect);}function setState(state,expect){const map=globalThis[MATCHERS_OBJECT$1];const current=map.get(expect)||{};Object.assign(current,state);map.set(expect,current);}function getMatcherUtils(){const c=()=>getColors();const EXPECTED_COLOR=c().green;const RECEIVED_COLOR=c().red;const INVERTED_COLOR=c().inverse;const BOLD_WEIGHT=c().bold;const DIM_COLOR=c().dim;function matcherHint(matcherName,received="received",expected="expected",options={}){const _options$comment=options.comment,comment=_options$comment===void 0?"":_options$comment,_options$isDirectExpe=options.isDirectExpectCall,isDirectExpectCall=_options$isDirectExpe===void 0?false:_options$isDirectExpe,_options$isNot=options.isNot,isNot=_options$isNot===void 0?false:_options$isNot,_options$promise=options.promise,promise=_options$promise===void 0?"":_options$promise,_options$secondArgume=options.secondArgument,secondArgument=_options$secondArgume===void 0?"":_options$secondArgume,_options$expectedColo=options.expectedColor,expectedColor=_options$expectedColo===void 0?EXPECTED_COLOR:_options$expectedColo,_options$receivedColo=options.receivedColor,receivedColor=_options$receivedColo===void 0?RECEIVED_COLOR:_options$receivedColo,_options$secondArgume2=options.secondArgumentColor,secondArgumentColor=_options$secondArgume2===void 0?EXPECTED_COLOR:_options$secondArgume2;let hint="";let dimString="expect";if(!isDirectExpectCall&&received!==""){hint+=DIM_COLOR(\`\${dimString}(\`)+receivedColor(received);dimString=")";}if(promise!==""){hint+=DIM_COLOR(\`\${dimString}.\`)+promise;dimString="";}if(isNot){hint+=\`\${DIM_COLOR(\`\${dimString}.\`)}not\`;dimString="";}if(matcherName.includes(".")){dimString+=matcherName;}else{hint+=DIM_COLOR(\`\${dimString}.\`)+matcherName;dimString="";}if(expected===""){dimString+="()";}else{hint+=DIM_COLOR(\`\${dimString}(\`)+expectedColor(expected);if(secondArgument)hint+=DIM_COLOR(", ")+secondArgumentColor(secondArgument);dimString=")";}if(comment!=="")dimString+=\` // \${comment}\`;if(dimString!=="")hint+=DIM_COLOR(dimString);return hint;}const SPACE_SYMBOL="\\xB7";const replaceTrailingSpaces=text=>text.replace(/\\s+$/gm,spaces=>SPACE_SYMBOL.repeat(spaces.length));const printReceived=object=>RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)));const printExpected=value=>EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)));return{EXPECTED_COLOR,RECEIVED_COLOR,INVERTED_COLOR,BOLD_WEIGHT,DIM_COLOR,matcherHint,printReceived,printExpected};}function addCustomEqualityTesters(newTesters){if(!Array.isArray(newTesters)){throw new TypeError(\`expect.customEqualityTesters: Must be set to an array of Testers. Was given "\${getType$2(newTesters)}"\`);}globalThis[JEST_MATCHERS_OBJECT$1].customEqualityTesters.push(...newTesters);}function getCustomEqualityTesters(){return globalThis[JEST_MATCHERS_OBJECT$1].customEqualityTesters;}function equals(a,b,customTesters,strictCheck){customTesters=customTesters||[];return eq(a,b,[],[],customTesters,strictCheck?hasKey:hasDefinedKey);}function isAsymmetric(obj){return!!obj&&typeof obj==="object"&&"asymmetricMatch"in obj&&isA("Function",obj.asymmetricMatch);}function asymmetricMatch(a,b){const asymmetricA=isAsymmetric(a);const asymmetricB=isAsymmetric(b);if(asymmetricA&&asymmetricB)return void 0;if(asymmetricA)return a.asymmetricMatch(b);if(asymmetricB)return b.asymmetricMatch(a);}function eq(a,b,aStack,bStack,customTesters,hasKey2){let result=true;const asymmetricResult=asymmetricMatch(a,b);if(asymmetricResult!==void 0)return asymmetricResult;const testerContext={equals};for(let i=0;iObject.getOwnPropertyDescriptor(obj,symbol).enumerable));}function hasDefinedKey(obj,key){return hasKey(obj,key)&&obj[key]!==void 0;}function hasKey(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}function isA(typeName,value){return Object.prototype.toString.apply(value)===\`[object \${typeName}]\`;}function isDomNode(obj){return obj!==null&&typeof obj==="object"&&"nodeType"in obj&&typeof obj.nodeType==="number"&&"nodeName"in obj&&typeof obj.nodeName==="string"&&"isEqualNode"in obj&&typeof obj.isEqualNode==="function";}const IS_KEYED_SENTINEL="@@__IMMUTABLE_KEYED__@@";const IS_SET_SENTINEL="@@__IMMUTABLE_SET__@@";const IS_ORDERED_SENTINEL="@@__IMMUTABLE_ORDERED__@@";function isImmutableUnorderedKeyed(maybeKeyed){return!!(maybeKeyed&&maybeKeyed[IS_KEYED_SENTINEL]&&!maybeKeyed[IS_ORDERED_SENTINEL]);}function isImmutableUnorderedSet(maybeSet){return!!(maybeSet&&maybeSet[IS_SET_SENTINEL]&&!maybeSet[IS_ORDERED_SENTINEL]);}const IteratorSymbol=Symbol.iterator;function hasIterator(object){return!!(object!=null&&object[IteratorSymbol]);}function iterableEquality(a,b,customTesters=[],aStack=[],bStack=[]){if(typeof a!=="object"||typeof b!=="object"||Array.isArray(a)||Array.isArray(b)||!hasIterator(a)||!hasIterator(b))return void 0;if(a.constructor!==b.constructor)return false;let length=aStack.length;while(length--){if(aStack[length]===a)return bStack[length]===b;}aStack.push(a);bStack.push(b);const filteredCustomTesters=[...customTesters.filter(t=>t!==iterableEquality),iterableEqualityWithStack];function iterableEqualityWithStack(a2,b2){return iterableEquality(a2,b2,[...filteredCustomTesters],[...aStack],[...bStack]);}if(a.size!==void 0){if(a.size!==b.size){return false;}else if(isA("Set",a)||isImmutableUnorderedSet(a)){let allFound=true;for(const aValue of a){if(!b.has(aValue)){let has=false;for(const bValue of b){const isEqual=equals(aValue,bValue,filteredCustomTesters);if(isEqual===true)has=true;}if(has===false){allFound=false;break;}}}aStack.pop();bStack.pop();return allFound;}else if(isA("Map",a)||isImmutableUnorderedKeyed(a)){let allFound=true;for(const aEntry of a){if(!b.has(aEntry[0])||!equals(aEntry[1],b.get(aEntry[0]),filteredCustomTesters)){let has=false;for(const bEntry of b){const matchedKey=equals(aEntry[0],bEntry[0],filteredCustomTesters);let matchedValue=false;if(matchedKey===true)matchedValue=equals(aEntry[1],bEntry[1],filteredCustomTesters);if(matchedValue===true)has=true;}if(has===false){allFound=false;break;}}}aStack.pop();bStack.pop();return allFound;}}const bIterator=b[IteratorSymbol]();for(const aValue of a){const nextB=bIterator.next();if(nextB.done||!equals(aValue,nextB.value,filteredCustomTesters))return false;}if(!bIterator.next().done)return false;aStack.pop();bStack.pop();return true;}function hasPropertyInObject(object,key){const shouldTerminate=!object||typeof object!=="object"||object===Object.prototype;if(shouldTerminate)return false;return Object.prototype.hasOwnProperty.call(object,key)||hasPropertyInObject(Object.getPrototypeOf(object),key);}function isObjectWithKeys(a){return isObject$1(a)&&!(a instanceof Error)&&!Array.isArray(a)&&!(a instanceof Date);}function subsetEquality(object,subset,customTesters=[]){const filteredCustomTesters=customTesters.filter(t=>t!==subsetEquality);const subsetEqualityWithContext=(seenReferences=/* @__PURE__ */new WeakMap())=>(object2,subset2)=>{if(!isObjectWithKeys(subset2))return void 0;return Object.keys(subset2).every(key=>{if(isObjectWithKeys(subset2[key])){if(seenReferences.has(subset2[key]))return equals(object2[key],subset2[key],filteredCustomTesters);seenReferences.set(subset2[key],true);}const result=object2!=null&&hasPropertyInObject(object2,key)&&equals(object2[key],subset2[key],[...filteredCustomTesters,subsetEqualityWithContext(seenReferences)]);seenReferences.delete(subset2[key]);return result;});};return subsetEqualityWithContext()(object,subset);}function typeEquality(a,b){if(a==null||b==null||a.constructor===b.constructor)return void 0;return false;}function arrayBufferEquality(a,b){let dataViewA=a;let dataViewB=b;if(!(a instanceof DataView&&b instanceof DataView)){if(!(a instanceof ArrayBuffer)||!(b instanceof ArrayBuffer))return void 0;try{dataViewA=new DataView(a);dataViewB=new DataView(b);}catch{return void 0;}}if(dataViewA.byteLength!==dataViewB.byteLength)return false;for(let i=0;it!==sparseArrayEquality);return equals(a,b,filteredCustomTesters,true)&&equals(aKeys,bKeys);}function generateToBeMessage(deepEqualityName,expected="#{this}",actual="#{exp}"){const toBeMessage=\`expected \${expected} to be \${actual} // Object.is equality\`;if(["toStrictEqual","toEqual"].includes(deepEqualityName))return\`\${toBeMessage} +var k=(e,t)=>Object.getOwnPropertyDescriptor(e,t),P=(e,t)=>{t!=null&&typeof t=="function"&&t.prototype!=null&&Object.setPrototypeOf(e.prototype,t.prototype);};function E(e,t,n){R(!u("undefined",e),"spyOn could not find an object to spy upon"),R(u("object",e)||u("function",e),"cannot spyOn on a primitive value");let _ref9=(()=>{if(!u("object",t))return[t,"value"];if("getter"in t&&"setter"in t)throw new Error("cannot spy on both getter and setter");if("getter"in t)return[t.getter,"get"];if("setter"in t)return[t.setter,"set"];throw new Error("specify getter or setter to spy on");})(),_ref10=_slicedToArray(_ref9,2),s=_ref10[0],r=_ref10[1],m=k(e,s),p=Object.getPrototypeOf(e),d=p&&k(p,s),a=m||d;R(a||s in e,\`\${String(s)} does not exist\`);let l=!1;r==="value"&&a&&!a.value&&a.get&&(r="get",l=!0,n=a.get());let o;a?o=a[r]:r!=="value"?o=()=>e[s]:o=e[s],n||(n=o);let y=I(n);r==="value"&&P(y,o);let O=h=>{let _ref11=a||{configurable:!0,writable:!0},G=_ref11.value,w=_objectWithoutProperties(_ref11,_excluded2);r!=="value"&&delete w.writable,w[r]=h,f(e,s,w);},K=()=>a?f(e,s,a):O(o),T=y[c];return i(T,"restore",K),i(T,"getOriginal",()=>l?o():o),i(T,"willCall",h=>(T.impl=h,y)),O(l?()=>(P(y,n),y):y),g.add(y),y;}const mocks=/* @__PURE__ */new Set();function isMockFunction(fn2){return typeof fn2==="function"&&"_isMockFunction"in fn2&&fn2._isMockFunction;}function spyOn(obj,method,accessType){const dictionary={get:"getter",set:"setter"};const objMethod=accessType?{[dictionary[accessType]]:method}:method;const stub=E(obj,objMethod);return enhanceSpy(stub);}let callOrder=0;function enhanceSpy(spy){const stub=spy;let implementation;let instances=[];let invocations=[];const state=A(spy);const mockContext={get calls(){return state.calls;},get instances(){return instances;},get invocationCallOrder(){return invocations;},get results(){return state.results.map(([callType,value])=>{const type=callType==="error"?"throw":"return";return{type,value};});},get lastCall(){return state.calls[state.calls.length-1];}};let onceImplementations=[];let implementationChangedTemporarily=false;function mockCall(...args){instances.push(this);invocations.push(++callOrder);const impl=implementationChangedTemporarily?implementation:onceImplementations.shift()||implementation||state.getOriginal()||(()=>{});return impl.apply(this,args);}let name=stub.name;stub.getMockName=()=>name||"vi.fn()";stub.mockName=n=>{name=n;return stub;};stub.mockClear=()=>{state.reset();instances=[];invocations=[];return stub;};stub.mockReset=()=>{stub.mockClear();implementation=()=>void 0;onceImplementations=[];return stub;};stub.mockRestore=()=>{stub.mockReset();state.restore();implementation=void 0;return stub;};stub.getMockImplementation=()=>implementation;stub.mockImplementation=fn2=>{implementation=fn2;state.willCall(mockCall);return stub;};stub.mockImplementationOnce=fn2=>{onceImplementations.push(fn2);return stub;};function withImplementation(fn2,cb){const originalImplementation=implementation;implementation=fn2;state.willCall(mockCall);implementationChangedTemporarily=true;const reset=()=>{implementation=originalImplementation;implementationChangedTemporarily=false;};const result=cb();if(result instanceof Promise){return result.then(()=>{reset();return stub;});}reset();return stub;}stub.withImplementation=withImplementation;stub.mockReturnThis=()=>stub.mockImplementation(function(){return this;});stub.mockReturnValue=val=>stub.mockImplementation(()=>val);stub.mockReturnValueOnce=val=>stub.mockImplementationOnce(()=>val);stub.mockResolvedValue=val=>stub.mockImplementation(()=>Promise.resolve(val));stub.mockResolvedValueOnce=val=>stub.mockImplementationOnce(()=>Promise.resolve(val));stub.mockRejectedValue=val=>stub.mockImplementation(()=>Promise.reject(val));stub.mockRejectedValueOnce=val=>stub.mockImplementationOnce(()=>Promise.reject(val));Object.defineProperty(stub,"mock",{get:()=>mockContext});state.willCall(mockCall);mocks.add(stub);return stub;}function fn(implementation){const enhancedSpy=enhanceSpy(E({spy:implementation||(()=>{})},"spy"));if(implementation)enhancedSpy.mockImplementation(implementation);return enhancedSpy;}const MATCHERS_OBJECT$1=Symbol.for("matchers-object");const JEST_MATCHERS_OBJECT$1=Symbol.for("$$jest-matchers-object");const GLOBAL_EXPECT$1=Symbol.for("expect-global");const ASYMMETRIC_MATCHERS_OBJECT$1=Symbol.for("asymmetric-matchers-object");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT$1)){const globalState=/* @__PURE__ */new WeakMap();const matchers=/* @__PURE__ */Object.create(null);const customEqualityTesters=[];const assymetricMatchers=/* @__PURE__ */Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT$1,{get:()=>globalState});Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT$1,{configurable:true,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT$1]),matchers,customEqualityTesters})});Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT$1,{get:()=>assymetricMatchers});}function getState(expect){return globalThis[MATCHERS_OBJECT$1].get(expect);}function setState(state,expect){const map=globalThis[MATCHERS_OBJECT$1];const current=map.get(expect)||{};Object.assign(current,state);map.set(expect,current);}function getMatcherUtils(){const c=()=>getColors();const EXPECTED_COLOR=c().green;const RECEIVED_COLOR=c().red;const INVERTED_COLOR=c().inverse;const BOLD_WEIGHT=c().bold;const DIM_COLOR=c().dim;function matcherHint(matcherName,received="received",expected="expected",options={}){const _options$comment=options.comment,comment=_options$comment===void 0?"":_options$comment,_options$isDirectExpe=options.isDirectExpectCall,isDirectExpectCall=_options$isDirectExpe===void 0?false:_options$isDirectExpe,_options$isNot=options.isNot,isNot=_options$isNot===void 0?false:_options$isNot,_options$promise=options.promise,promise=_options$promise===void 0?"":_options$promise,_options$secondArgume=options.secondArgument,secondArgument=_options$secondArgume===void 0?"":_options$secondArgume,_options$expectedColo=options.expectedColor,expectedColor=_options$expectedColo===void 0?EXPECTED_COLOR:_options$expectedColo,_options$receivedColo=options.receivedColor,receivedColor=_options$receivedColo===void 0?RECEIVED_COLOR:_options$receivedColo,_options$secondArgume2=options.secondArgumentColor,secondArgumentColor=_options$secondArgume2===void 0?EXPECTED_COLOR:_options$secondArgume2;let hint="";let dimString="expect";if(!isDirectExpectCall&&received!==""){hint+=DIM_COLOR(\`\${dimString}(\`)+receivedColor(received);dimString=")";}if(promise!==""){hint+=DIM_COLOR(\`\${dimString}.\`)+promise;dimString="";}if(isNot){hint+=\`\${DIM_COLOR(\`\${dimString}.\`)}not\`;dimString="";}if(matcherName.includes(".")){dimString+=matcherName;}else{hint+=DIM_COLOR(\`\${dimString}.\`)+matcherName;dimString="";}if(expected===""){dimString+="()";}else{hint+=DIM_COLOR(\`\${dimString}(\`)+expectedColor(expected);if(secondArgument)hint+=DIM_COLOR(", ")+secondArgumentColor(secondArgument);dimString=")";}if(comment!=="")dimString+=\` // \${comment}\`;if(dimString!=="")hint+=DIM_COLOR(dimString);return hint;}const SPACE_SYMBOL="\\xB7";const replaceTrailingSpaces=text=>text.replace(/\\s+$/gm,spaces=>SPACE_SYMBOL.repeat(spaces.length));const printReceived=object=>RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)));const printExpected=value=>EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)));return{EXPECTED_COLOR,RECEIVED_COLOR,INVERTED_COLOR,BOLD_WEIGHT,DIM_COLOR,matcherHint,printReceived,printExpected};}function addCustomEqualityTesters(newTesters){if(!Array.isArray(newTesters)){throw new TypeError(\`expect.customEqualityTesters: Must be set to an array of Testers. Was given "\${getType$2(newTesters)}"\`);}globalThis[JEST_MATCHERS_OBJECT$1].customEqualityTesters.push(...newTesters);}function getCustomEqualityTesters(){return globalThis[JEST_MATCHERS_OBJECT$1].customEqualityTesters;}function equals(a,b,customTesters,strictCheck){customTesters=customTesters||[];return eq(a,b,[],[],customTesters,strictCheck?hasKey:hasDefinedKey);}function isAsymmetric(obj){return!!obj&&typeof obj==="object"&&"asymmetricMatch"in obj&&isA("Function",obj.asymmetricMatch);}function asymmetricMatch(a,b){const asymmetricA=isAsymmetric(a);const asymmetricB=isAsymmetric(b);if(asymmetricA&&asymmetricB)return void 0;if(asymmetricA)return a.asymmetricMatch(b);if(asymmetricB)return b.asymmetricMatch(a);}function eq(a,b,aStack,bStack,customTesters,hasKey2){let result=true;const asymmetricResult=asymmetricMatch(a,b);if(asymmetricResult!==void 0)return asymmetricResult;const testerContext={equals};for(let i=0;iObject.getOwnPropertyDescriptor(obj,symbol).enumerable));}function hasDefinedKey(obj,key){return hasKey(obj,key)&&obj[key]!==void 0;}function hasKey(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}function isA(typeName,value){return Object.prototype.toString.apply(value)===\`[object \${typeName}]\`;}function isDomNode(obj){return obj!==null&&typeof obj==="object"&&"nodeType"in obj&&typeof obj.nodeType==="number"&&"nodeName"in obj&&typeof obj.nodeName==="string"&&"isEqualNode"in obj&&typeof obj.isEqualNode==="function";}const IS_KEYED_SENTINEL="@@__IMMUTABLE_KEYED__@@";const IS_SET_SENTINEL="@@__IMMUTABLE_SET__@@";const IS_ORDERED_SENTINEL="@@__IMMUTABLE_ORDERED__@@";function isImmutableUnorderedKeyed(maybeKeyed){return!!(maybeKeyed&&maybeKeyed[IS_KEYED_SENTINEL]&&!maybeKeyed[IS_ORDERED_SENTINEL]);}function isImmutableUnorderedSet(maybeSet){return!!(maybeSet&&maybeSet[IS_SET_SENTINEL]&&!maybeSet[IS_ORDERED_SENTINEL]);}const IteratorSymbol=Symbol.iterator;function hasIterator(object){return!!(object!=null&&object[IteratorSymbol]);}function iterableEquality(a,b,customTesters=[],aStack=[],bStack=[]){if(typeof a!=="object"||typeof b!=="object"||Array.isArray(a)||Array.isArray(b)||!hasIterator(a)||!hasIterator(b))return void 0;if(a.constructor!==b.constructor)return false;let length=aStack.length;while(length--){if(aStack[length]===a)return bStack[length]===b;}aStack.push(a);bStack.push(b);const filteredCustomTesters=[...customTesters.filter(t=>t!==iterableEquality),iterableEqualityWithStack];function iterableEqualityWithStack(a2,b2){return iterableEquality(a2,b2,[...customTesters],[...aStack],[...bStack]);}if(a.size!==void 0){if(a.size!==b.size){return false;}else if(isA("Set",a)||isImmutableUnorderedSet(a)){let allFound=true;for(const aValue of a){if(!b.has(aValue)){let has=false;for(const bValue of b){const isEqual=equals(aValue,bValue,filteredCustomTesters);if(isEqual===true)has=true;}if(has===false){allFound=false;break;}}}aStack.pop();bStack.pop();return allFound;}else if(isA("Map",a)||isImmutableUnorderedKeyed(a)){let allFound=true;for(const aEntry of a){if(!b.has(aEntry[0])||!equals(aEntry[1],b.get(aEntry[0]),filteredCustomTesters)){let has=false;for(const bEntry of b){const matchedKey=equals(aEntry[0],bEntry[0],filteredCustomTesters);let matchedValue=false;if(matchedKey===true)matchedValue=equals(aEntry[1],bEntry[1],filteredCustomTesters);if(matchedValue===true)has=true;}if(has===false){allFound=false;break;}}}aStack.pop();bStack.pop();return allFound;}}const bIterator=b[IteratorSymbol]();for(const aValue of a){const nextB=bIterator.next();if(nextB.done||!equals(aValue,nextB.value,filteredCustomTesters))return false;}if(!bIterator.next().done)return false;const aEntries=Object.entries(a);const bEntries=Object.entries(b);if(!equals(aEntries,bEntries))return false;aStack.pop();bStack.pop();return true;}function hasPropertyInObject(object,key){const shouldTerminate=!object||typeof object!=="object"||object===Object.prototype;if(shouldTerminate)return false;return Object.prototype.hasOwnProperty.call(object,key)||hasPropertyInObject(Object.getPrototypeOf(object),key);}function isObjectWithKeys(a){return isObject$1(a)&&!(a instanceof Error)&&!Array.isArray(a)&&!(a instanceof Date);}function subsetEquality(object,subset,customTesters=[]){const filteredCustomTesters=customTesters.filter(t=>t!==subsetEquality);const subsetEqualityWithContext=(seenReferences=/* @__PURE__ */new WeakMap())=>(object2,subset2)=>{if(!isObjectWithKeys(subset2))return void 0;return Object.keys(subset2).every(key=>{if(subset2[key]!=null&&typeof subset2[key]==="object"){if(seenReferences.has(subset2[key]))return equals(object2[key],subset2[key],filteredCustomTesters);seenReferences.set(subset2[key],true);}const result=object2!=null&&hasPropertyInObject(object2,key)&&equals(object2[key],subset2[key],[...filteredCustomTesters,subsetEqualityWithContext(seenReferences)]);seenReferences.delete(subset2[key]);return result;});};return subsetEqualityWithContext()(object,subset);}function typeEquality(a,b){if(a==null||b==null||a.constructor===b.constructor)return void 0;return false;}function arrayBufferEquality(a,b){let dataViewA=a;let dataViewB=b;if(!(a instanceof DataView&&b instanceof DataView)){if(!(a instanceof ArrayBuffer)||!(b instanceof ArrayBuffer))return void 0;try{dataViewA=new DataView(a);dataViewB=new DataView(b);}catch{return void 0;}}if(dataViewA.byteLength!==dataViewB.byteLength)return false;for(let i=0;it!==sparseArrayEquality);return equals(a,b,filteredCustomTesters,true)&&equals(aKeys,bKeys);}function generateToBeMessage(deepEqualityName,expected="#{this}",actual="#{exp}"){const toBeMessage=\`expected \${expected} to be \${actual} // Object.is equality\`;if(["toStrictEqual","toEqual"].includes(deepEqualityName))return\`\${toBeMessage} If it should pass with deep equality, replace "toBe" with "\${deepEqualityName}" Expected: \${expected} Received: serializes to the same string -\`;return toBeMessage;}function pluralize(word,count){return\`\${count} \${word}\${count===1?"":"s"}\`;}let AsymmetricMatcher$1=class AsymmetricMatcher{constructor(sample,inverse=false){this.sample=sample;this.inverse=inverse;}// should have "jest" to be compatible with its ecosystem +\`;return toBeMessage;}function pluralize(word,count){return\`\${count} \${word}\${count===1?"":"s"}\`;}function getObjectKeys(object){return[...Object.keys(object),...Object.getOwnPropertySymbols(object).filter(s=>{var _a;return(_a=Object.getOwnPropertyDescriptor(object,s))==null?void 0:_a.enumerable;})];}function getObjectSubset(object,subset,customTesters=[]){let stripped=0;const getObjectSubsetWithContext=(seenReferences=/* @__PURE__ */new WeakMap())=>(object2,subset2)=>{if(Array.isArray(object2)){if(Array.isArray(subset2)&&subset2.length===object2.length){return subset2.map((sub,i)=>getObjectSubsetWithContext(seenReferences)(object2[i],sub));}}else if(object2 instanceof Date){return object2;}else if(isObject$1(object2)&&isObject$1(subset2)){if(equals(object2,subset2,[...customTesters,iterableEquality,subsetEquality])){return subset2;}const trimmed={};seenReferences.set(object2,trimmed);for(const key of getObjectKeys(object2)){if(hasPropertyInObject(subset2,key)){trimmed[key]=seenReferences.has(object2[key])?seenReferences.get(object2[key]):getObjectSubsetWithContext(seenReferences)(object2[key],subset2[key]);}else{if(!seenReferences.has(object2[key])){stripped+=1;if(isObject$1(object2[key]))stripped+=getObjectKeys(object2[key]).length;getObjectSubsetWithContext(seenReferences)(object2[key],subset2[key]);}}}if(getObjectKeys(trimmed).length>0)return trimmed;}return object2;};return{subset:getObjectSubsetWithContext()(object,subset),stripped};}let AsymmetricMatcher$1=class AsymmetricMatcher{constructor(sample,inverse=false){this.sample=sample;this.inverse=inverse;}// should have "jest" to be compatible with its ecosystem $$typeof=Symbol.for("jest.asymmetricMatcher");getMatcherContext(expect){return _objectSpread(_objectSpread({},getState(expect||globalThis[GLOBAL_EXPECT$1])),{},{equals,isNot:this.inverse,customTesters:getCustomEqualityTesters(),utils:_objectSpread(_objectSpread({},getMatcherUtils()),{},{diff,stringify,iterableEquality,subsetEquality})});}// implement custom chai/loupe inspect for better AssertionError.message formatting // https://github.com/chaijs/loupe/blob/9b8a6deabcd50adc056a64fb705896194710c5c6/src/index.ts#L29 -[Symbol.for("chai/inspect")](options){const result=stringify(this,options.depth,{min:true});if(result.length<=options.truncate)return result;return\`\${this.toString()}{\\u2026}\`;}};class StringContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){if(!isA("String",sample))throw new Error("Expected is not a string");super(sample,inverse);}asymmetricMatch(other){const result=isA("String",other)&&other.includes(this.sample);return this.inverse?!result:result;}toString(){return\`String\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"string";}}class Anything extends AsymmetricMatcher$1{asymmetricMatch(other){return other!=null;}toString(){return"Anything";}toAsymmetricMatcher(){return"Anything";}}class ObjectContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){super(sample,inverse);}getPrototype(obj){if(Object.getPrototypeOf)return Object.getPrototypeOf(obj);if(obj.constructor.prototype===obj)return null;return obj.constructor.prototype;}hasProperty(obj,property){if(!obj)return false;if(Object.prototype.hasOwnProperty.call(obj,property))return true;return this.hasProperty(this.getPrototype(obj),property);}asymmetricMatch(other){if(typeof this.sample!=="object"){throw new TypeError(\`You must provide an object to \${this.toString()}, not '\${typeof this.sample}'.\`);}let result=true;const matcherContext=this.getMatcherContext();for(const property in this.sample){if(!this.hasProperty(other,property)||!equals(this.sample[property],other[property],matcherContext.customTesters)){result=false;break;}}return this.inverse?!result:result;}toString(){return\`Object\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"object";}}class ArrayContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){super(sample,inverse);}asymmetricMatch(other){if(!Array.isArray(this.sample)){throw new TypeError(\`You must provide an array to \${this.toString()}, not '\${typeof this.sample}'.\`);}const matcherContext=this.getMatcherContext();const result=this.sample.length===0||Array.isArray(other)&&this.sample.every(item=>other.some(another=>equals(item,another,matcherContext.customTesters)));return this.inverse?!result:result;}toString(){return\`Array\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"array";}}class Any extends AsymmetricMatcher$1{constructor(sample){if(typeof sample==="undefined"){throw new TypeError("any() expects to be passed a constructor function. Please pass one or use anything() to match any object.");}super(sample);}fnNameFor(func){if(func.name)return func.name;const functionToString=Function.prototype.toString;const matches=functionToString.call(func).match(/^(?:async)?\\s*function\\s*\\*?\\s*([\\w$]+)\\s*\\(/);return matches?matches[1]:"";}asymmetricMatch(other){if(this.sample===String)return typeof other=="string"||other instanceof String;if(this.sample===Number)return typeof other=="number"||other instanceof Number;if(this.sample===Function)return typeof other=="function"||other instanceof Function;if(this.sample===Boolean)return typeof other=="boolean"||other instanceof Boolean;if(this.sample===BigInt)return typeof other=="bigint"||other instanceof BigInt;if(this.sample===Symbol)return typeof other=="symbol"||other instanceof Symbol;if(this.sample===Object)return typeof other=="object";return other instanceof this.sample;}toString(){return"Any";}getExpectedType(){if(this.sample===String)return"string";if(this.sample===Number)return"number";if(this.sample===Function)return"function";if(this.sample===Object)return"object";if(this.sample===Boolean)return"boolean";return this.fnNameFor(this.sample);}toAsymmetricMatcher(){return\`Any<\${this.fnNameFor(this.sample)}>\`;}}class StringMatching extends AsymmetricMatcher$1{constructor(sample,inverse=false){if(!isA("String",sample)&&!isA("RegExp",sample))throw new Error("Expected is not a String or a RegExp");super(new RegExp(sample),inverse);}asymmetricMatch(other){const result=isA("String",other)&&this.sample.test(other);return this.inverse?!result:result;}toString(){return\`String\${this.inverse?"Not":""}Matching\`;}getExpectedType(){return"string";}}class CloseTo extends AsymmetricMatcher$1{precision;constructor(sample,precision=2,inverse=false){if(!isA("Number",sample))throw new Error("Expected is not a Number");if(!isA("Number",precision))throw new Error("Precision is not a Number");super(sample);this.inverse=inverse;this.precision=precision;}asymmetricMatch(other){if(!isA("Number",other))return false;let result=false;if(other===Number.POSITIVE_INFINITY&&this.sample===Number.POSITIVE_INFINITY){result=true;}else if(other===Number.NEGATIVE_INFINITY&&this.sample===Number.NEGATIVE_INFINITY){result=true;}else{result=Math.abs(this.sample-other)<10**-this.precision/2;}return this.inverse?!result:result;}toString(){return\`Number\${this.inverse?"Not":""}CloseTo\`;}getExpectedType(){return"number";}toAsymmetricMatcher(){return[this.toString(),this.sample,\`(\${pluralize("digit",this.precision)})\`].join(" ");}}const JestAsymmetricMatchers=(chai,utils)=>{utils.addMethod(chai.expect,"anything",()=>new Anything());utils.addMethod(chai.expect,"any",expected=>new Any(expected));utils.addMethod(chai.expect,"stringContaining",expected=>new StringContaining(expected));utils.addMethod(chai.expect,"objectContaining",expected=>new ObjectContaining(expected));utils.addMethod(chai.expect,"arrayContaining",expected=>new ArrayContaining(expected));utils.addMethod(chai.expect,"stringMatching",expected=>new StringMatching(expected));utils.addMethod(chai.expect,"closeTo",(expected,precision)=>new CloseTo(expected,precision));chai.expect.not={stringContaining:expected=>new StringContaining(expected,true),objectContaining:expected=>new ObjectContaining(expected,true),arrayContaining:expected=>new ArrayContaining(expected,true),stringMatching:expected=>new StringMatching(expected,true),closeTo:(expected,precision)=>new CloseTo(expected,precision,true)};};function recordAsyncExpect$1(test,promise){if(test&&promise instanceof Promise){promise=promise.finally(()=>{const index=test.promises.indexOf(promise);if(index!==-1)test.promises.splice(index,1);});if(!test.promises)test.promises=[];test.promises.push(promise);}return promise;}function wrapSoft(utils,fn){return function(...args){var _a;const test=utils.flag(this,"vitest-test");const state=(test==null?void 0:test.context._local)?test.context.expect.getState():getState(globalThis[GLOBAL_EXPECT$1]);if(!state.soft)return fn.apply(this,args);if(!test)throw new Error("expect.soft() can only be used inside a test");try{return fn.apply(this,args);}catch(err){test.result||(test.result={state:"fail"});test.result.state="fail";(_a=test.result).errors||(_a.errors=[]);test.result.errors.push(processError(err));}};}const JestChaiExpect=(chai,utils)=>{const AssertionError=chai.AssertionError;const c=()=>getColors();const customTesters=getCustomEqualityTesters();function def(name,fn){const addMethod=n=>{const softWrapper=wrapSoft(utils,fn);utils.addMethod(chai.Assertion.prototype,n,softWrapper);utils.addMethod(globalThis[JEST_MATCHERS_OBJECT$1].matchers,n,softWrapper);};if(Array.isArray(name))name.forEach(n=>addMethod(n));else addMethod(name);}["throw","throws","Throw"].forEach(m=>{utils.overwriteMethod(chai.Assertion.prototype,m,_super=>{return function(...args){const promise=utils.flag(this,"promise");const object=utils.flag(this,"object");const isNot=utils.flag(this,"negate");if(promise==="rejects"){utils.flag(this,"object",()=>{throw object;});}else if(promise==="resolves"&&typeof object!=="function"){if(!isNot){const message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}else{return;}}_super.apply(this,args);};});});def("withTest",function(test){utils.flag(this,"vitest-test",test);return this;});def("toEqual",function(expected){const actual=utils.flag(this,"object");const equal=equals(actual,expected,[...customTesters,iterableEquality]);return this.assert(equal,"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",expected,actual);});def("toStrictEqual",function(expected){const obj=utils.flag(this,"object");const equal=equals(obj,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],true);return this.assert(equal,"expected #{this} to strictly equal #{exp}","expected #{this} to not strictly equal #{exp}",expected,obj);});def("toBe",function(expected){const actual=this._obj;const pass=Object.is(actual,expected);let deepEqualityName="";if(!pass){const toStrictEqualPass=equals(actual,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],true);if(toStrictEqualPass){deepEqualityName="toStrictEqual";}else{const toEqualPass=equals(actual,expected,[...customTesters,iterableEquality]);if(toEqualPass)deepEqualityName="toEqual";}}return this.assert(pass,generateToBeMessage(deepEqualityName),"expected #{this} not to be #{exp} // Object.is equality",expected,actual);});def("toMatchObject",function(expected){const actual=this._obj;return this.assert(equals(actual,expected,[...customTesters,iterableEquality,subsetEquality]),"expected #{this} to match object #{exp}","expected #{this} to not match object #{exp}",expected,actual);});def("toMatch",function(expected){if(typeof expected==="string")return this.include(expected);else return this.match(expected);});def("toContain",function(item){const actual=this._obj;if(typeof Node!=="undefined"&&actual instanceof Node){if(!(item instanceof Node))throw new TypeError(\`toContain() expected a DOM node as the argument, but got \${typeof item}\`);return this.assert(actual.contains(item),"expected #{this} to contain element #{exp}","expected #{this} not to contain element #{exp}",item,actual);}if(typeof DOMTokenList!=="undefined"&&actual instanceof DOMTokenList){assertTypes(item,"class name",["string"]);const isNot=utils.flag(this,"negate");const expectedClassList=isNot?actual.value.replace(item,"").trim():\`\${actual.value} \${item}\`;return this.assert(actual.contains(item),\`expected "\${actual.value}" to contain "\${item}"\`,\`expected "\${actual.value}" not to contain "\${item}"\`,expectedClassList,actual.value);}if(actual!=null&&typeof actual!=="string")utils.flag(this,"object",Array.from(actual));return this.contain(item);});def("toContainEqual",function(expected){const obj=utils.flag(this,"object");const index=Array.from(obj).findIndex(item=>{return equals(item,expected,customTesters);});this.assert(index!==-1,"expected #{this} to deep equally contain #{exp}","expected #{this} to not deep equally contain #{exp}",expected);});def("toBeTruthy",function(){const obj=utils.flag(this,"object");this.assert(Boolean(obj),"expected #{this} to be truthy","expected #{this} to not be truthy",obj,false);});def("toBeFalsy",function(){const obj=utils.flag(this,"object");this.assert(!obj,"expected #{this} to be falsy","expected #{this} to not be falsy",obj,false);});def("toBeGreaterThan",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actual>expected,\`expected \${actual} to be greater than \${expected}\`,\`expected \${actual} to be not greater than \${expected}\`,actual,expected,false);});def("toBeGreaterThanOrEqual",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actual>=expected,\`expected \${actual} to be greater than or equal to \${expected}\`,\`expected \${actual} to be not greater than or equal to \${expected}\`,actual,expected,false);});def("toBeLessThan",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actualString(key).replace(/([.[\\]])/g,"\\\\$1")).join(".");const actual=this._obj;const propertyName=args[0],expected=args[1];const getValue=()=>{const hasOwn=Object.prototype.hasOwnProperty.call(actual,propertyName);if(hasOwn)return{value:actual[propertyName],exists:true};return utils.getPathInfo(actual,propertyName);};const _getValue=getValue(),value=_getValue.value,exists=_getValue.exists;const pass=exists&&(args.length===1||equals(expected,value,customTesters));const valueString=args.length===1?"":\` with value \${utils.objDisplay(expected)}\`;return this.assert(pass,\`expected #{this} to have property "\${propertyName}"\${valueString}\`,\`expected #{this} to not have property "\${propertyName}"\${valueString}\`,expected,exists?value:void 0);});def("toBeCloseTo",function(received,precision=2){const expected=this._obj;let pass=false;let expectedDiff=0;let receivedDiff=0;if(received===Number.POSITIVE_INFINITY&&expected===Number.POSITIVE_INFINITY){pass=true;}else if(received===Number.NEGATIVE_INFINITY&&expected===Number.NEGATIVE_INFINITY){pass=true;}else{expectedDiff=10**-precision/2;receivedDiff=Math.abs(expected-received);pass=receivedDiff{if(!isMockFunction(assertion._obj))throw new TypeError(\`\${utils.inspect(assertion._obj)} is not a spy or a call to a spy!\`);};const getSpy=assertion=>{assertIsMock(assertion);return assertion._obj;};const ordinalOf=i=>{const j=i%10;const k=i%100;if(j===1&&k!==11)return\`\${i}st\`;if(j===2&&k!==12)return\`\${i}nd\`;if(j===3&&k!==13)return\`\${i}rd\`;return\`\${i}th\`;};const formatCalls=(spy,msg,actualCall)=>{if(spy.mock.calls){msg+=c().gray(\` +[Symbol.for("chai/inspect")](options){const result=stringify(this,options.depth,{min:true});if(result.length<=options.truncate)return result;return\`\${this.toString()}{\\u2026}\`;}};class StringContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){if(!isA("String",sample))throw new Error("Expected is not a string");super(sample,inverse);}asymmetricMatch(other){const result=isA("String",other)&&other.includes(this.sample);return this.inverse?!result:result;}toString(){return\`String\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"string";}}class Anything extends AsymmetricMatcher$1{asymmetricMatch(other){return other!=null;}toString(){return"Anything";}toAsymmetricMatcher(){return"Anything";}}class ObjectContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){super(sample,inverse);}getPrototype(obj){if(Object.getPrototypeOf)return Object.getPrototypeOf(obj);if(obj.constructor.prototype===obj)return null;return obj.constructor.prototype;}hasProperty(obj,property){if(!obj)return false;if(Object.prototype.hasOwnProperty.call(obj,property))return true;return this.hasProperty(this.getPrototype(obj),property);}asymmetricMatch(other){if(typeof this.sample!=="object"){throw new TypeError(\`You must provide an object to \${this.toString()}, not '\${typeof this.sample}'.\`);}let result=true;const matcherContext=this.getMatcherContext();for(const property in this.sample){if(!this.hasProperty(other,property)||!equals(this.sample[property],other[property],matcherContext.customTesters)){result=false;break;}}return this.inverse?!result:result;}toString(){return\`Object\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"object";}}class ArrayContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){super(sample,inverse);}asymmetricMatch(other){if(!Array.isArray(this.sample)){throw new TypeError(\`You must provide an array to \${this.toString()}, not '\${typeof this.sample}'.\`);}const matcherContext=this.getMatcherContext();const result=this.sample.length===0||Array.isArray(other)&&this.sample.every(item=>other.some(another=>equals(item,another,matcherContext.customTesters)));return this.inverse?!result:result;}toString(){return\`Array\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"array";}}class Any extends AsymmetricMatcher$1{constructor(sample){if(typeof sample==="undefined"){throw new TypeError("any() expects to be passed a constructor function. Please pass one or use anything() to match any object.");}super(sample);}fnNameFor(func){if(func.name)return func.name;const functionToString=Function.prototype.toString;const matches=functionToString.call(func).match(/^(?:async)?\\s*function\\s*\\*?\\s*([\\w$]+)\\s*\\(/);return matches?matches[1]:"";}asymmetricMatch(other){if(this.sample===String)return typeof other=="string"||other instanceof String;if(this.sample===Number)return typeof other=="number"||other instanceof Number;if(this.sample===Function)return typeof other=="function"||other instanceof Function;if(this.sample===Boolean)return typeof other=="boolean"||other instanceof Boolean;if(this.sample===BigInt)return typeof other=="bigint"||other instanceof BigInt;if(this.sample===Symbol)return typeof other=="symbol"||other instanceof Symbol;if(this.sample===Object)return typeof other=="object";return other instanceof this.sample;}toString(){return"Any";}getExpectedType(){if(this.sample===String)return"string";if(this.sample===Number)return"number";if(this.sample===Function)return"function";if(this.sample===Object)return"object";if(this.sample===Boolean)return"boolean";return this.fnNameFor(this.sample);}toAsymmetricMatcher(){return\`Any<\${this.fnNameFor(this.sample)}>\`;}}class StringMatching extends AsymmetricMatcher$1{constructor(sample,inverse=false){if(!isA("String",sample)&&!isA("RegExp",sample))throw new Error("Expected is not a String or a RegExp");super(new RegExp(sample),inverse);}asymmetricMatch(other){const result=isA("String",other)&&this.sample.test(other);return this.inverse?!result:result;}toString(){return\`String\${this.inverse?"Not":""}Matching\`;}getExpectedType(){return"string";}}class CloseTo extends AsymmetricMatcher$1{precision;constructor(sample,precision=2,inverse=false){if(!isA("Number",sample))throw new Error("Expected is not a Number");if(!isA("Number",precision))throw new Error("Precision is not a Number");super(sample);this.inverse=inverse;this.precision=precision;}asymmetricMatch(other){if(!isA("Number",other))return false;let result=false;if(other===Number.POSITIVE_INFINITY&&this.sample===Number.POSITIVE_INFINITY){result=true;}else if(other===Number.NEGATIVE_INFINITY&&this.sample===Number.NEGATIVE_INFINITY){result=true;}else{result=Math.abs(this.sample-other)<10**-this.precision/2;}return this.inverse?!result:result;}toString(){return\`Number\${this.inverse?"Not":""}CloseTo\`;}getExpectedType(){return"number";}toAsymmetricMatcher(){return[this.toString(),this.sample,\`(\${pluralize("digit",this.precision)})\`].join(" ");}}const JestAsymmetricMatchers=(chai,utils)=>{utils.addMethod(chai.expect,"anything",()=>new Anything());utils.addMethod(chai.expect,"any",expected=>new Any(expected));utils.addMethod(chai.expect,"stringContaining",expected=>new StringContaining(expected));utils.addMethod(chai.expect,"objectContaining",expected=>new ObjectContaining(expected));utils.addMethod(chai.expect,"arrayContaining",expected=>new ArrayContaining(expected));utils.addMethod(chai.expect,"stringMatching",expected=>new StringMatching(expected));utils.addMethod(chai.expect,"closeTo",(expected,precision)=>new CloseTo(expected,precision));chai.expect.not={stringContaining:expected=>new StringContaining(expected,true),objectContaining:expected=>new ObjectContaining(expected,true),arrayContaining:expected=>new ArrayContaining(expected,true),stringMatching:expected=>new StringMatching(expected,true),closeTo:(expected,precision)=>new CloseTo(expected,precision,true)};};function recordAsyncExpect$1(test,promise){if(test&&promise instanceof Promise){promise=promise.finally(()=>{const index=test.promises.indexOf(promise);if(index!==-1)test.promises.splice(index,1);});if(!test.promises)test.promises=[];test.promises.push(promise);}return promise;}function wrapSoft(utils,fn){return function(...args){var _a;const test=utils.flag(this,"vitest-test");const state=(test==null?void 0:test.context._local)?test.context.expect.getState():getState(globalThis[GLOBAL_EXPECT$1]);if(!state.soft)return fn.apply(this,args);if(!test)throw new Error("expect.soft() can only be used inside a test");try{return fn.apply(this,args);}catch(err){test.result||(test.result={state:"fail"});test.result.state="fail";(_a=test.result).errors||(_a.errors=[]);test.result.errors.push(processError(err));}};}const JestChaiExpect=(chai,utils)=>{const AssertionError=chai.AssertionError;const c=()=>getColors();const customTesters=getCustomEqualityTesters();function def(name,fn){const addMethod=n=>{const softWrapper=wrapSoft(utils,fn);utils.addMethod(chai.Assertion.prototype,n,softWrapper);utils.addMethod(globalThis[JEST_MATCHERS_OBJECT$1].matchers,n,softWrapper);};if(Array.isArray(name))name.forEach(n=>addMethod(n));else addMethod(name);}["throw","throws","Throw"].forEach(m=>{utils.overwriteMethod(chai.Assertion.prototype,m,_super=>{return function(...args){const promise=utils.flag(this,"promise");const object=utils.flag(this,"object");const isNot=utils.flag(this,"negate");if(promise==="rejects"){utils.flag(this,"object",()=>{throw object;});}else if(promise==="resolves"&&typeof object!=="function"){if(!isNot){const message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}else{return;}}_super.apply(this,args);};});});def("withTest",function(test){utils.flag(this,"vitest-test",test);return this;});def("toEqual",function(expected){const actual=utils.flag(this,"object");const equal=equals(actual,expected,[...customTesters,iterableEquality]);return this.assert(equal,"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",expected,actual);});def("toStrictEqual",function(expected){const obj=utils.flag(this,"object");const equal=equals(obj,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],true);return this.assert(equal,"expected #{this} to strictly equal #{exp}","expected #{this} to not strictly equal #{exp}",expected,obj);});def("toBe",function(expected){const actual=this._obj;const pass=Object.is(actual,expected);let deepEqualityName="";if(!pass){const toStrictEqualPass=equals(actual,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],true);if(toStrictEqualPass){deepEqualityName="toStrictEqual";}else{const toEqualPass=equals(actual,expected,[...customTesters,iterableEquality]);if(toEqualPass)deepEqualityName="toEqual";}}return this.assert(pass,generateToBeMessage(deepEqualityName),"expected #{this} not to be #{exp} // Object.is equality",expected,actual);});def("toMatchObject",function(expected){const actual=this._obj;const pass=equals(actual,expected,[...customTesters,iterableEquality,subsetEquality]);const isNot=utils.flag(this,"negate");const _getObjectSubset=getObjectSubset(actual,expected),actualSubset=_getObjectSubset.subset,stripped=_getObjectSubset.stripped;if(pass&&isNot||!pass&&!isNot){const msg=utils.getMessage(this,[pass,"expected #{this} to match object #{exp}","expected #{this} to not match object #{exp}",expected,actualSubset,false]);const message=stripped===0?msg:\`\${msg} +(\${stripped} matching \${stripped===1?"property":"properties"} omitted from actual)\`;throw new AssertionError(message,{showDiff:true,expected,actual:actualSubset});}});def("toMatch",function(expected){const actual=this._obj;if(typeof actual!=="string")throw new TypeError(\`.toMatch() expects to receive a string, but got \${typeof actual}\`);return this.assert(typeof expected==="string"?actual.includes(expected):actual.match(expected),\`expected #{this} to match #{exp}\`,\`expected #{this} not to match #{exp}\`,expected,actual);});def("toContain",function(item){const actual=this._obj;if(typeof Node!=="undefined"&&actual instanceof Node){if(!(item instanceof Node))throw new TypeError(\`toContain() expected a DOM node as the argument, but got \${typeof item}\`);return this.assert(actual.contains(item),"expected #{this} to contain element #{exp}","expected #{this} not to contain element #{exp}",item,actual);}if(typeof DOMTokenList!=="undefined"&&actual instanceof DOMTokenList){assertTypes(item,"class name",["string"]);const isNot=utils.flag(this,"negate");const expectedClassList=isNot?actual.value.replace(item,"").trim():\`\${actual.value} \${item}\`;return this.assert(actual.contains(item),\`expected "\${actual.value}" to contain "\${item}"\`,\`expected "\${actual.value}" not to contain "\${item}"\`,expectedClassList,actual.value);}if(typeof actual==="string"&&typeof item==="string"){return this.assert(actual.includes(item),\`expected #{this} to contain #{exp}\`,\`expected #{this} not to contain #{exp}\`,item,actual);}if(actual!=null&&typeof actual!=="string")utils.flag(this,"object",Array.from(actual));return this.contain(item);});def("toContainEqual",function(expected){const obj=utils.flag(this,"object");const index=Array.from(obj).findIndex(item=>{return equals(item,expected,customTesters);});this.assert(index!==-1,"expected #{this} to deep equally contain #{exp}","expected #{this} to not deep equally contain #{exp}",expected);});def("toBeTruthy",function(){const obj=utils.flag(this,"object");this.assert(Boolean(obj),"expected #{this} to be truthy","expected #{this} to not be truthy",obj,false);});def("toBeFalsy",function(){const obj=utils.flag(this,"object");this.assert(!obj,"expected #{this} to be falsy","expected #{this} to not be falsy",obj,false);});def("toBeGreaterThan",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actual>expected,\`expected \${actual} to be greater than \${expected}\`,\`expected \${actual} to be not greater than \${expected}\`,actual,expected,false);});def("toBeGreaterThanOrEqual",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actual>=expected,\`expected \${actual} to be greater than or equal to \${expected}\`,\`expected \${actual} to be not greater than or equal to \${expected}\`,actual,expected,false);});def("toBeLessThan",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actualString(key).replace(/([.[\\]])/g,"\\\\$1")).join(".");const actual=this._obj;const propertyName=args[0],expected=args[1];const getValue=()=>{const hasOwn=Object.prototype.hasOwnProperty.call(actual,propertyName);if(hasOwn)return{value:actual[propertyName],exists:true};return utils.getPathInfo(actual,propertyName);};const _getValue=getValue(),value=_getValue.value,exists=_getValue.exists;const pass=exists&&(args.length===1||equals(expected,value,customTesters));const valueString=args.length===1?"":\` with value \${utils.objDisplay(expected)}\`;return this.assert(pass,\`expected #{this} to have property "\${propertyName}"\${valueString}\`,\`expected #{this} to not have property "\${propertyName}"\${valueString}\`,expected,exists?value:void 0);});def("toBeCloseTo",function(received,precision=2){const expected=this._obj;let pass=false;let expectedDiff=0;let receivedDiff=0;if(received===Number.POSITIVE_INFINITY&&expected===Number.POSITIVE_INFINITY){pass=true;}else if(received===Number.NEGATIVE_INFINITY&&expected===Number.NEGATIVE_INFINITY){pass=true;}else{expectedDiff=10**-precision/2;receivedDiff=Math.abs(expected-received);pass=receivedDiff{if(!isMockFunction(assertion._obj))throw new TypeError(\`\${utils.inspect(assertion._obj)} is not a spy or a call to a spy!\`);};const getSpy=assertion=>{assertIsMock(assertion);return assertion._obj;};const ordinalOf=i=>{const j=i%10;const k=i%100;if(j===1&&k!==11)return\`\${i}st\`;if(j===2&&k!==12)return\`\${i}nd\`;if(j===3&&k!==13)return\`\${i}rd\`;return\`\${i}th\`;};const formatCalls=(spy,msg,actualCall)=>{if(spy.mock.calls){msg+=c().gray(\` Received: @@ -17514,7 +17548,7 @@ Received: \`);if(actualReturn)methodCall+=diff(actualReturn,callReturn.value,{omitAnnotationLines:true});else methodCall+=stringify(callReturn).split("\\n").map(line=>\` \${line}\`).join("\\n");methodCall+="\\n";return methodCall;}).join("\\n")}\`);msg+=c().gray(\` Number of calls: \${c().bold(spy.mock.calls.length)} -\`);return msg;};def(["toHaveBeenCalledTimes","toBeCalledTimes"],function(number){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;return this.assert(callCount===number,\`expected "\${spyName}" to be called #{exp} times, but got \${callCount} times\`,\`expected "\${spyName}" to not be called #{exp} times\`,number,callCount,false);});def("toHaveBeenCalledOnce",function(){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;return this.assert(callCount===1,\`expected "\${spyName}" to be called once, but got \${callCount} times\`,\`expected "\${spyName}" to not be called once\`,1,callCount,false);});def(["toHaveBeenCalled","toBeCalled"],function(){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;const called=callCount>0;const isNot=utils.flag(this,"negate");let msg=utils.getMessage(this,[called,\`expected "\${spyName}" to be called at least once\`,\`expected "\${spyName}" to not be called at all, but actually been called \${callCount} times\`,true,called]);if(called&&isNot)msg=formatCalls(spy,msg);if(called&&isNot||!called&&!isNot)throw new AssertionError(msg);});def(["toHaveBeenCalledWith","toBeCalledWith"],function(...args){const spy=getSpy(this);const spyName=spy.getMockName();const pass=spy.mock.calls.some(callArg=>equals(callArg,args,[...customTesters,iterableEquality]));const isNot=utils.flag(this,"negate");const msg=utils.getMessage(this,[pass,\`expected "\${spyName}" to be called with arguments: #{exp}\`,\`expected "\${spyName}" to not be called with arguments: #{exp}\`,args]);if(pass&&isNot||!pass&&!isNot)throw new AssertionError(formatCalls(spy,msg,args));});def(["toHaveBeenNthCalledWith","nthCalledWith"],function(times,...args){const spy=getSpy(this);const spyName=spy.getMockName();const nthCall=spy.mock.calls[times-1];this.assert(equals(nthCall,args,[...customTesters,iterableEquality]),\`expected \${ordinalOf(times)} "\${spyName}" call to have been called with #{exp}\`,\`expected \${ordinalOf(times)} "\${spyName}" call to not have been called with #{exp}\`,args,nthCall);});def(["toHaveBeenLastCalledWith","lastCalledWith"],function(...args){const spy=getSpy(this);const spyName=spy.getMockName();const lastCall=spy.mock.calls[spy.mock.calls.length-1];this.assert(equals(lastCall,args,[...customTesters,iterableEquality]),\`expected last "\${spyName}" call to have been called with #{exp}\`,\`expected last "\${spyName}" call to not have been called with #{exp}\`,args,lastCall);});def(["toThrow","toThrowError"],function(expected){if(typeof expected==="string"||typeof expected==="undefined"||expected instanceof RegExp)return this.throws(expected);const obj=this._obj;const promise=utils.flag(this,"promise");const isNot=utils.flag(this,"negate");let thrown=null;if(promise==="rejects"){thrown=obj;}else if(promise==="resolves"&&typeof obj!=="function"){if(!isNot){const message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}else{return;}}else{let isThrow=false;try{obj();}catch(err){isThrow=true;thrown=err;}if(!isThrow&&!isNot){const message=utils.flag(this,"message")||"expected function to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}}if(typeof expected==="function"){const name=expected.name||expected.prototype.constructor.name;return this.assert(thrown&&thrown instanceof expected,\`expected error to be instance of \${name}\`,\`expected error not to be instance of \${name}\`,expected,thrown);}if(expected instanceof Error){return this.assert(thrown&&expected.message===thrown.message,\`expected error to have message: \${expected.message}\`,\`expected error not to have message: \${expected.message}\`,expected.message,thrown&&thrown.message);}if(typeof expected==="object"&&"asymmetricMatch"in expected&&typeof expected.asymmetricMatch==="function"){const matcher=expected;return this.assert(thrown&&matcher.asymmetricMatch(thrown),"expected error to match asymmetric matcher","expected error not to match asymmetric matcher",matcher,thrown);}throw new Error(\`"toThrow" expects string, RegExp, function, Error instance or asymmetric matcher, got "\${typeof expected}"\`);});def(["toHaveReturned","toReturn"],function(){const spy=getSpy(this);const spyName=spy.getMockName();const calledAndNotThrew=spy.mock.calls.length>0&&spy.mock.results.some(({type})=>type!=="throw");this.assert(calledAndNotThrew,\`expected "\${spyName}" to be successfully called at least once\`,\`expected "\${spyName}" to not be successfully called\`,calledAndNotThrew,!calledAndNotThrew,false);});def(["toHaveReturnedTimes","toReturnTimes"],function(times){const spy=getSpy(this);const spyName=spy.getMockName();const successfulReturns=spy.mock.results.reduce((success,{type})=>type==="throw"?success:++success,0);this.assert(successfulReturns===times,\`expected "\${spyName}" to be successfully called \${times} times\`,\`expected "\${spyName}" to not be successfully called \${times} times\`,\`expected number of returns: \${times}\`,\`received number of returns: \${successfulReturns}\`,false);});def(["toHaveReturnedWith","toReturnWith"],function(value){const spy=getSpy(this);const spyName=spy.getMockName();const pass=spy.mock.results.some(({type,value:result})=>type==="return"&&equals(value,result));const isNot=utils.flag(this,"negate");const msg=utils.getMessage(this,[pass,\`expected "\${spyName}" to return with: #{exp} at least once\`,\`expected "\${spyName}" to not return with: #{exp}\`,value]);if(pass&&isNot||!pass&&!isNot)throw new AssertionError(formatReturns(spy,msg,value));});def(["toHaveLastReturnedWith","lastReturnedWith"],function(value){const spy=getSpy(this);const spyName=spy.getMockName();const lastResult=spy.mock.results[spy.mock.results.length-1].value;const pass=equals(lastResult,value);this.assert(pass,\`expected last "\${spyName}" call to return #{exp}\`,\`expected last "\${spyName}" call to not return #{exp}\`,value,lastResult);});def(["toHaveNthReturnedWith","nthReturnedWith"],function(nthCall,value){const spy=getSpy(this);const spyName=spy.getMockName();const isNot=utils.flag(this,"negate");const _spy$mock$results=spy.mock.results[nthCall-1],callType=_spy$mock$results.type,callResult=_spy$mock$results.value;const ordinalCall=\`\${ordinalOf(nthCall)} call\`;if(!isNot&&callType==="throw")chai.assert.fail(\`expected \${ordinalCall} to return #{exp}, but instead it threw an error\`);const nthCallReturn=equals(callResult,value);this.assert(nthCallReturn,\`expected \${ordinalCall} "\${spyName}" call to return #{exp}\`,\`expected \${ordinalCall} "\${spyName}" call to not return #{exp}\`,value,callResult);});def("toSatisfy",function(matcher,message){return this.be.satisfy(matcher,message);});utils.addProperty(chai.Assertion.prototype,"resolves",function __VITEST_RESOLVES__(){const error=new Error("resolves");utils.flag(this,"promise","resolves");utils.flag(this,"error",error);const test=utils.flag(this,"vitest-test");const obj=utils.flag(this,"object");if(typeof(obj==null?void 0:obj.then)!=="function")throw new TypeError(\`You must provide a Promise to expect() when using .resolves, not '\${typeof obj}'.\`);const proxy=new Proxy(this,{get:(target,key,receiver)=>{const result=Reflect.get(target,key,receiver);if(typeof result!=="function")return result instanceof chai.Assertion?proxy:result;return async(...args)=>{const promise=obj.then(value=>{utils.flag(this,"object",value);return result.call(this,...args);},err=>{const _error=new AssertionError(\`promise rejected "\${utils.inspect(err)}" instead of resolving\`,{showDiff:false});_error.cause=err;_error.stack=error.stack.replace(error.message,_error.message);throw _error;});return recordAsyncExpect$1(test,promise);};}});return proxy;});utils.addProperty(chai.Assertion.prototype,"rejects",function __VITEST_REJECTS__(){const error=new Error("rejects");utils.flag(this,"promise","rejects");utils.flag(this,"error",error);const test=utils.flag(this,"vitest-test");const obj=utils.flag(this,"object");const wrapper=typeof obj==="function"?obj():obj;if(typeof(wrapper==null?void 0:wrapper.then)!=="function")throw new TypeError(\`You must provide a Promise to expect() when using .rejects, not '\${typeof wrapper}'.\`);const proxy=new Proxy(this,{get:(target,key,receiver)=>{const result=Reflect.get(target,key,receiver);if(typeof result!=="function")return result instanceof chai.Assertion?proxy:result;return async(...args)=>{const promise=wrapper.then(value=>{const _error=new AssertionError(\`promise resolved "\${utils.inspect(value)}" instead of rejecting\`,{showDiff:true,expected:new Error("rejected promise"),actual:value});_error.stack=error.stack.replace(error.message,_error.message);throw _error;},err=>{utils.flag(this,"object",err);return result.call(this,...args);});return recordAsyncExpect$1(test,promise);};}});return proxy;});};function getMatcherState(assertion,expect){const obj=assertion._obj;const isNot=util.flag(assertion,"negate");const promise=util.flag(assertion,"promise")||"";const jestUtils=_objectSpread(_objectSpread({},getMatcherUtils()),{},{diff,stringify,iterableEquality,subsetEquality});const matcherState=_objectSpread(_objectSpread({},getState(expect)),{},{customTesters:getCustomEqualityTesters(),isNot,utils:jestUtils,promise,equals,// needed for built-in jest-snapshots, but we don't use it +\`);return msg;};def(["toHaveBeenCalledTimes","toBeCalledTimes"],function(number){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;return this.assert(callCount===number,\`expected "\${spyName}" to be called #{exp} times, but got \${callCount} times\`,\`expected "\${spyName}" to not be called #{exp} times\`,number,callCount,false);});def("toHaveBeenCalledOnce",function(){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;return this.assert(callCount===1,\`expected "\${spyName}" to be called once, but got \${callCount} times\`,\`expected "\${spyName}" to not be called once\`,1,callCount,false);});def(["toHaveBeenCalled","toBeCalled"],function(){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;const called=callCount>0;const isNot=utils.flag(this,"negate");let msg=utils.getMessage(this,[called,\`expected "\${spyName}" to be called at least once\`,\`expected "\${spyName}" to not be called at all, but actually been called \${callCount} times\`,true,called]);if(called&&isNot)msg=formatCalls(spy,msg);if(called&&isNot||!called&&!isNot)throw new AssertionError(msg);});def(["toHaveBeenCalledWith","toBeCalledWith"],function(...args){const spy=getSpy(this);const spyName=spy.getMockName();const pass=spy.mock.calls.some(callArg=>equals(callArg,args,[...customTesters,iterableEquality]));const isNot=utils.flag(this,"negate");const msg=utils.getMessage(this,[pass,\`expected "\${spyName}" to be called with arguments: #{exp}\`,\`expected "\${spyName}" to not be called with arguments: #{exp}\`,args]);if(pass&&isNot||!pass&&!isNot)throw new AssertionError(formatCalls(spy,msg,args));});def(["toHaveBeenNthCalledWith","nthCalledWith"],function(times,...args){const spy=getSpy(this);const spyName=spy.getMockName();const nthCall=spy.mock.calls[times-1];const callCount=spy.mock.calls.length;const isCalled=times<=callCount;this.assert(equals(nthCall,args,[...customTesters,iterableEquality]),\`expected \${ordinalOf(times)} "\${spyName}" call to have been called with #{exp}\${isCalled?\`\`:\`, but called only \${callCount} times\`}\`,\`expected \${ordinalOf(times)} "\${spyName}" call to not have been called with #{exp}\`,args,nthCall,isCalled);});def(["toHaveBeenLastCalledWith","lastCalledWith"],function(...args){const spy=getSpy(this);const spyName=spy.getMockName();const lastCall=spy.mock.calls[spy.mock.calls.length-1];this.assert(equals(lastCall,args,[...customTesters,iterableEquality]),\`expected last "\${spyName}" call to have been called with #{exp}\`,\`expected last "\${spyName}" call to not have been called with #{exp}\`,args,lastCall);});def(["toThrow","toThrowError"],function(expected){if(typeof expected==="string"||typeof expected==="undefined"||expected instanceof RegExp)return this.throws(expected);const obj=this._obj;const promise=utils.flag(this,"promise");const isNot=utils.flag(this,"negate");let thrown=null;if(promise==="rejects"){thrown=obj;}else if(promise==="resolves"&&typeof obj!=="function"){if(!isNot){const message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}else{return;}}else{let isThrow=false;try{obj();}catch(err){isThrow=true;thrown=err;}if(!isThrow&&!isNot){const message=utils.flag(this,"message")||"expected function to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}}if(typeof expected==="function"){const name=expected.name||expected.prototype.constructor.name;return this.assert(thrown&&thrown instanceof expected,\`expected error to be instance of \${name}\`,\`expected error not to be instance of \${name}\`,expected,thrown);}if(expected instanceof Error){return this.assert(thrown&&expected.message===thrown.message,\`expected error to have message: \${expected.message}\`,\`expected error not to have message: \${expected.message}\`,expected.message,thrown&&thrown.message);}if(typeof expected==="object"&&"asymmetricMatch"in expected&&typeof expected.asymmetricMatch==="function"){const matcher=expected;return this.assert(thrown&&matcher.asymmetricMatch(thrown),"expected error to match asymmetric matcher","expected error not to match asymmetric matcher",matcher,thrown);}throw new Error(\`"toThrow" expects string, RegExp, function, Error instance or asymmetric matcher, got "\${typeof expected}"\`);});def(["toHaveReturned","toReturn"],function(){const spy=getSpy(this);const spyName=spy.getMockName();const calledAndNotThrew=spy.mock.calls.length>0&&spy.mock.results.some(({type})=>type!=="throw");this.assert(calledAndNotThrew,\`expected "\${spyName}" to be successfully called at least once\`,\`expected "\${spyName}" to not be successfully called\`,calledAndNotThrew,!calledAndNotThrew,false);});def(["toHaveReturnedTimes","toReturnTimes"],function(times){const spy=getSpy(this);const spyName=spy.getMockName();const successfulReturns=spy.mock.results.reduce((success,{type})=>type==="throw"?success:++success,0);this.assert(successfulReturns===times,\`expected "\${spyName}" to be successfully called \${times} times\`,\`expected "\${spyName}" to not be successfully called \${times} times\`,\`expected number of returns: \${times}\`,\`received number of returns: \${successfulReturns}\`,false);});def(["toHaveReturnedWith","toReturnWith"],function(value){const spy=getSpy(this);const spyName=spy.getMockName();const pass=spy.mock.results.some(({type,value:result})=>type==="return"&&equals(value,result));const isNot=utils.flag(this,"negate");const msg=utils.getMessage(this,[pass,\`expected "\${spyName}" to return with: #{exp} at least once\`,\`expected "\${spyName}" to not return with: #{exp}\`,value]);if(pass&&isNot||!pass&&!isNot)throw new AssertionError(formatReturns(spy,msg,value));});def(["toHaveLastReturnedWith","lastReturnedWith"],function(value){const spy=getSpy(this);const spyName=spy.getMockName();const lastResult=spy.mock.results[spy.mock.results.length-1].value;const pass=equals(lastResult,value);this.assert(pass,\`expected last "\${spyName}" call to return #{exp}\`,\`expected last "\${spyName}" call to not return #{exp}\`,value,lastResult);});def(["toHaveNthReturnedWith","nthReturnedWith"],function(nthCall,value){const spy=getSpy(this);const spyName=spy.getMockName();const isNot=utils.flag(this,"negate");const _spy$mock$results=spy.mock.results[nthCall-1],callType=_spy$mock$results.type,callResult=_spy$mock$results.value;const ordinalCall=\`\${ordinalOf(nthCall)} call\`;if(!isNot&&callType==="throw")chai.assert.fail(\`expected \${ordinalCall} to return #{exp}, but instead it threw an error\`);const nthCallReturn=equals(callResult,value);this.assert(nthCallReturn,\`expected \${ordinalCall} "\${spyName}" call to return #{exp}\`,\`expected \${ordinalCall} "\${spyName}" call to not return #{exp}\`,value,callResult);});def("toSatisfy",function(matcher,message){return this.be.satisfy(matcher,message);});utils.addProperty(chai.Assertion.prototype,"resolves",function __VITEST_RESOLVES__(){const error=new Error("resolves");utils.flag(this,"promise","resolves");utils.flag(this,"error",error);const test=utils.flag(this,"vitest-test");const obj=utils.flag(this,"object");if(typeof(obj==null?void 0:obj.then)!=="function")throw new TypeError(\`You must provide a Promise to expect() when using .resolves, not '\${typeof obj}'.\`);const proxy=new Proxy(this,{get:(target,key,receiver)=>{const result=Reflect.get(target,key,receiver);if(typeof result!=="function")return result instanceof chai.Assertion?proxy:result;return async(...args)=>{const promise=obj.then(value=>{utils.flag(this,"object",value);return result.call(this,...args);},err=>{const _error=new AssertionError(\`promise rejected "\${utils.inspect(err)}" instead of resolving\`,{showDiff:false});_error.cause=err;_error.stack=error.stack.replace(error.message,_error.message);throw _error;});return recordAsyncExpect$1(test,promise);};}});return proxy;});utils.addProperty(chai.Assertion.prototype,"rejects",function __VITEST_REJECTS__(){const error=new Error("rejects");utils.flag(this,"promise","rejects");utils.flag(this,"error",error);const test=utils.flag(this,"vitest-test");const obj=utils.flag(this,"object");const wrapper=typeof obj==="function"?obj():obj;if(typeof(wrapper==null?void 0:wrapper.then)!=="function")throw new TypeError(\`You must provide a Promise to expect() when using .rejects, not '\${typeof wrapper}'.\`);const proxy=new Proxy(this,{get:(target,key,receiver)=>{const result=Reflect.get(target,key,receiver);if(typeof result!=="function")return result instanceof chai.Assertion?proxy:result;return async(...args)=>{const promise=wrapper.then(value=>{const _error=new AssertionError(\`promise resolved "\${utils.inspect(value)}" instead of rejecting\`,{showDiff:true,expected:new Error("rejected promise"),actual:value});_error.stack=error.stack.replace(error.message,_error.message);throw _error;},err=>{utils.flag(this,"object",err);return result.call(this,...args);});return recordAsyncExpect$1(test,promise);};}});return proxy;});};function getMatcherState(assertion,expect){const obj=assertion._obj;const isNot=util.flag(assertion,"negate");const promise=util.flag(assertion,"promise")||"";const jestUtils=_objectSpread(_objectSpread({},getMatcherUtils()),{},{diff,stringify,iterableEquality,subsetEquality});const matcherState=_objectSpread(_objectSpread({},getState(expect)),{},{customTesters:getCustomEqualityTesters(),isNot,utils:jestUtils,promise,equals,// needed for built-in jest-snapshots, but we don't use it suppressedErrors:[]});return{state:matcherState,isNot,obj};}class JestExtendError extends Error{constructor(message,actual,expected){super(message);this.actual=actual;this.expected=expected;}}function JestExtendPlugin(expect,matchers){return(c,utils)=>{Object.entries(matchers).forEach(([expectAssertionName,expectAssertion])=>{function expectWrapper(...args){const _getMatcherState=getMatcherState(this,expect),state=_getMatcherState.state,isNot=_getMatcherState.isNot,obj=_getMatcherState.obj;const result=expectAssertion.call(state,obj,...args);if(result&&typeof result==="object"&&result instanceof Promise){return result.then(({pass:pass2,message:message2,actual:actual2,expected:expected2})=>{if(pass2&&isNot||!pass2&&!isNot)throw new JestExtendError(message2(),actual2,expected2);});}const pass=result.pass,message=result.message,actual=result.actual,expected=result.expected;if(pass&&isNot||!pass&&!isNot)throw new JestExtendError(message(),actual,expected);}const softWrapper=wrapSoft(utils,expectWrapper);utils.addMethod(globalThis[JEST_MATCHERS_OBJECT$1].matchers,expectAssertionName,softWrapper);utils.addMethod(c.Assertion.prototype,expectAssertionName,softWrapper);class CustomMatcher extends AsymmetricMatcher$1{constructor(inverse=false,...sample){super(sample,inverse);}asymmetricMatch(other){const _expectAssertion$call=expectAssertion.call(this.getMatcherContext(expect),other,...this.sample),pass=_expectAssertion$call.pass;return this.inverse?!pass:pass;}toString(){return\`\${this.inverse?"not.":""}\${expectAssertionName}\`;}getExpectedType(){return"any";}toAsymmetricMatcher(){return\`\${this.toString()}<\${this.sample.map(String).join(", ")}>\`;}}const customMatcher=(...sample)=>new CustomMatcher(false,...sample);Object.defineProperty(expect,expectAssertionName,{configurable:true,enumerable:true,value:customMatcher,writable:true});Object.defineProperty(expect.not,expectAssertionName,{configurable:true,enumerable:true,value:(...sample)=>new CustomMatcher(true,...sample),writable:true});Object.defineProperty(globalThis[ASYMMETRIC_MATCHERS_OBJECT$1],expectAssertionName,{configurable:true,enumerable:true,value:customMatcher,writable:true});});};}const JestExtend=(chai,utils)=>{utils.addMethod(chai.expect,"extend",(expect,expects)=>{chai.use(JestExtendPlugin(expect,expects));});};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}var naturalCompare$2={exports:{}};/* * @version 1.4.0 * @date 2015-10-26 @@ -17538,14 +17572,14 @@ var reservedWords={keyword:["break","case","catch","continue","debugger","defaul \`:string;}function removeExtraLineBreaks(string){return string.length>2&&string.startsWith("\\n")&&string.endsWith("\\n")?string.slice(1,-1):string;}const escapeRegex=true;const printFunctionName=false;function serialize(val,indent=2,formatOverrides={}){return normalizeNewlines(format_1(val,_objectSpread({escapeRegex,indent,plugins:getSerializers(),printFunctionName},formatOverrides)));}function escapeBacktickString(str){return str.replace(/\`|\\\\|\\\${/g,"\\\\$&");}function printBacktickString(str){return\`\\\`\${escapeBacktickString(str)}\\\`\`;}function normalizeNewlines(string){return string.replace(/\\r\\n|\\r/g,"\\n");}async function saveSnapshotFile(environment,snapshotData,snapshotPath){const snapshots=Object.keys(snapshotData).sort(naturalCompare$1).map(key=>\`exports[\${printBacktickString(key)}] = \${printBacktickString(normalizeNewlines(snapshotData[key]))};\`);const content=\`\${environment.getHeader()} \${snapshots.join("\\n\\n")} -\`;const oldContent=await environment.readSnapshotFile(snapshotPath);const skipWriting=oldContent!=null&&oldContent===content;if(skipWriting)return;await environment.saveSnapshotFile(snapshotPath,content);}function prepareExpected(expected){function findStartIndent(){var _a,_b;const matchObject=/^( +)}\\s+$/m.exec(expected||"");const objectIndent=(_a=matchObject==null?void 0:matchObject[1])==null?void 0:_a.length;if(objectIndent)return objectIndent;const matchText=/^\\n( +)"/.exec(expected||"");return((_b=matchText==null?void 0:matchText[1])==null?void 0:_b.length)||0;}const startIndent=findStartIndent();let expectedTrimmed=expected==null?void 0:expected.trim();if(startIndent){expectedTrimmed=expectedTrimmed==null?void 0:expectedTrimmed.replace(new RegExp(\`^\${" ".repeat(startIndent)}\`,"gm"),"").replace(/ +}$/,"}");}return expectedTrimmed;}function deepMergeArray(target=[],source=[]){const mergedOutput=Array.from(target);source.forEach((sourceElement,index)=>{const targetElement=mergedOutput[index];if(Array.isArray(target[index])){mergedOutput[index]=deepMergeArray(target[index],sourceElement);}else if(isObject(targetElement)){mergedOutput[index]=deepMergeSnapshot(target[index],sourceElement);}else{mergedOutput[index]=sourceElement;}});return mergedOutput;}function deepMergeSnapshot(target,source){if(isObject(target)&&isObject(source)){const mergedOutput=_objectSpread({},target);Object.keys(source).forEach(key=>{if(isObject(source[key])&&!source[key].$$typeof){if(!(key in target))Object.assign(mergedOutput,{[key]:source[key]});else mergedOutput[key]=deepMergeSnapshot(target[key],source[key]);}else if(Array.isArray(source[key])){mergedOutput[key]=deepMergeArray(target[key],source[key]);}else{Object.assign(mergedOutput,{[key]:source[key]});}});return mergedOutput;}else if(Array.isArray(target)&&Array.isArray(source)){return deepMergeArray(target,source);}return target;}const comma=','.charCodeAt(0);const chars$1='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';const intToChar$1=new Uint8Array(64);// 64 possible chars. -const charToInt$1=new Uint8Array(128);// z is 122 in ASCII -for(let i=0;i{const targetElement=mergedOutput[index];if(Array.isArray(target[index])){mergedOutput[index]=deepMergeArray(target[index],sourceElement);}else if(isObject(targetElement)){mergedOutput[index]=deepMergeSnapshot(target[index],sourceElement);}else{mergedOutput[index]=sourceElement;}});return mergedOutput;}function deepMergeSnapshot(target,source){if(isObject(target)&&isObject(source)){const mergedOutput=_objectSpread({},target);Object.keys(source).forEach(key=>{if(isObject(source[key])&&!source[key].$$typeof){if(!(key in target))Object.assign(mergedOutput,{[key]:source[key]});else mergedOutput[key]=deepMergeSnapshot(target[key],source[key]);}else if(Array.isArray(source[key])){mergedOutput[key]=deepMergeArray(target[key],source[key]);}else{Object.assign(mergedOutput,{[key]:source[key]});}});return mergedOutput;}else if(Array.isArray(target)&&Array.isArray(source)){return deepMergeArray(target,source);}return target;}const comma=','.charCodeAt(0);const chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';const intToChar=new Uint8Array(64);// 64 possible chars. +const charToInt=new Uint8Array(128);// z is 122 in ASCII +for(let i=0;i>>=1;if(shouldNegate){value=-0x80000000|-value;}state[j]+=value;return pos;}function hasMoreVlq(mappings,i,length){if(i>=length)return false;return mappings.charCodeAt(i)!==comma;}function sort$1(line){line.sort(sortComparator$1);}function sortComparator$1(a,b){return a[0]-b[0];}// Matches the scheme of a URL, eg "http://" +seg=[col,state[1],state[2],state[3],state[4]];}else{seg=[col,state[1],state[2],state[3]];}}else{seg=[col];}line.push(seg);}if(!sorted)sort$1(line);decoded.push(line);index=semi+1;}while(index<=mappings.length);return decoded;}function indexOf(mappings,index){const idx=mappings.indexOf(';',index);return idx===-1?mappings.length:idx;}function decodeInteger(mappings,pos,state,j){let value=0;let shift=0;let integer=0;do{const c=mappings.charCodeAt(pos++);integer=charToInt[c];value|=(integer&31)<>>=1;if(shouldNegate){value=-0x80000000|-value;}state[j]+=value;return pos;}function hasMoreVlq(mappings,i,length){if(i>=length)return false;return mappings.charCodeAt(i)!==comma;}function sort$1(line){line.sort(sortComparator$1);}function sortComparator$1(a,b){return a[0]-b[0];}// Matches the scheme of a URL, eg "http://" const schemeRegex=/^[\\w+.-]+:\\/\\//;/** * Matches the parts of a URL: * 1. Scheme, including ":", guaranteed. @@ -17563,7 +17597,7 @@ const schemeRegex=/^[\\w+.-]+:\\/\\//;/** * 2. Path, which may include "/", guaranteed. * 3. Query, including "?", optional. * 4. Hash, including "#", optional. - */const fileRegex=/^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;var UrlType$1;(function(UrlType){UrlType[UrlType["Empty"]=1]="Empty";UrlType[UrlType["Hash"]=2]="Hash";UrlType[UrlType["Query"]=3]="Query";UrlType[UrlType["RelativePath"]=4]="RelativePath";UrlType[UrlType["AbsolutePath"]=5]="AbsolutePath";UrlType[UrlType["SchemeRelative"]=6]="SchemeRelative";UrlType[UrlType["Absolute"]=7]="Absolute";})(UrlType$1||(UrlType$1={}));function isAbsoluteUrl(input){return schemeRegex.test(input);}function isSchemeRelativeUrl(input){return input.startsWith('//');}function isAbsolutePath(input){return input.startsWith('/');}function isFileUrl(input){return input.startsWith('file:');}function isRelative(input){return /^[.?#]/.test(input);}function parseAbsoluteUrl(input){const match=urlRegex.exec(input);return makeUrl(match[1],match[2]||'',match[3],match[4]||'',match[5]||'/',match[6]||'',match[7]||'');}function parseFileUrl(input){const match=fileRegex.exec(input);const path=match[2];return makeUrl('file:','',match[1]||'','',isAbsolutePath(path)?path:'/'+path,match[3]||'',match[4]||'');}function makeUrl(scheme,user,host,port,path,query,hash){return{scheme,user,host,port,path,query,hash,type:UrlType$1.Absolute};}function parseUrl(input){if(isSchemeRelativeUrl(input)){const url=parseAbsoluteUrl('http:'+input);url.scheme='';url.type=UrlType$1.SchemeRelative;return url;}if(isAbsolutePath(input)){const url=parseAbsoluteUrl('http://foo.com'+input);url.scheme='';url.host='';url.type=UrlType$1.AbsolutePath;return url;}if(isFileUrl(input))return parseFileUrl(input);if(isAbsoluteUrl(input))return parseAbsoluteUrl(input);const url=parseAbsoluteUrl('http://foo.com/'+input);url.scheme='';url.host='';url.type=input?input.startsWith('?')?UrlType$1.Query:input.startsWith('#')?UrlType$1.Hash:UrlType$1.RelativePath:UrlType$1.Empty;return url;}function stripPathFilename(path){// If a path ends with a parent directory "..", then it's a relative path with excess parent + */const fileRegex=/^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;var UrlType;(function(UrlType){UrlType[UrlType["Empty"]=1]="Empty";UrlType[UrlType["Hash"]=2]="Hash";UrlType[UrlType["Query"]=3]="Query";UrlType[UrlType["RelativePath"]=4]="RelativePath";UrlType[UrlType["AbsolutePath"]=5]="AbsolutePath";UrlType[UrlType["SchemeRelative"]=6]="SchemeRelative";UrlType[UrlType["Absolute"]=7]="Absolute";})(UrlType||(UrlType={}));function isAbsoluteUrl(input){return schemeRegex.test(input);}function isSchemeRelativeUrl(input){return input.startsWith('//');}function isAbsolutePath(input){return input.startsWith('/');}function isFileUrl(input){return input.startsWith('file:');}function isRelative(input){return /^[.?#]/.test(input);}function parseAbsoluteUrl(input){const match=urlRegex.exec(input);return makeUrl(match[1],match[2]||'',match[3],match[4]||'',match[5]||'/',match[6]||'',match[7]||'');}function parseFileUrl(input){const match=fileRegex.exec(input);const path=match[2];return makeUrl('file:','',match[1]||'','',isAbsolutePath(path)?path:'/'+path,match[3]||'',match[4]||'');}function makeUrl(scheme,user,host,port,path,query,hash){return{scheme,user,host,port,path,query,hash,type:UrlType.Absolute};}function parseUrl(input){if(isSchemeRelativeUrl(input)){const url=parseAbsoluteUrl('http:'+input);url.scheme='';url.type=UrlType.SchemeRelative;return url;}if(isAbsolutePath(input)){const url=parseAbsoluteUrl('http://foo.com'+input);url.scheme='';url.host='';url.type=UrlType.AbsolutePath;return url;}if(isFileUrl(input))return parseFileUrl(input);if(isAbsoluteUrl(input))return parseAbsoluteUrl(input);const url=parseAbsoluteUrl('http://foo.com/'+input);url.scheme='';url.host='';url.type=input?input.startsWith('?')?UrlType.Query:input.startsWith('#')?UrlType.Hash:UrlType.RelativePath:UrlType.Empty;return url;}function stripPathFilename(path){// If a path ends with a parent directory "..", then it's a relative path with excess parent // paths. It's not a file, so we can't strip it. if(path.endsWith('/..'))return path;const index=path.lastIndexOf('/');return path.slice(0,index+1);}function mergePaths(url,base){normalizePath(base,base.type);// If the path is just a "/", then it was an empty path to begin with (remember, we're a relative // path). @@ -17571,7 +17605,7 @@ if(url.path==='/'){url.path=base.path;}else{// Resolution happens relative to th url.path=stripPathFilename(base.path)+url.path;}}/** * The path can have empty directories "//", unneeded parents "foo/..", or current directory * "foo/.". We need to normalize to a standard representation. - */function normalizePath(url,type){const rel=type<=UrlType$1.RelativePath;const pieces=url.path.split('/');// We need to preserve the first piece always, so that we output a leading slash. The item at + */function normalizePath(url,type){const rel=type<=UrlType.RelativePath;const pieces=url.path.split('/');// We need to preserve the first piece always, so that we output a leading slash. The item at // pieces[0] is an empty string. let pointer=1;// Positive is the number of real directories we've output, used for popping a parent directory. // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". @@ -17589,19 +17623,19 @@ pieces[pointer++]=piece;}continue;}// We've encountered a real directory. Move i // any popped or dropped directories. pieces[pointer++]=piece;positive++;}let path='';for(let i=1;iinputType)inputType=baseType;}normalizePath(url,inputType);const queryHash=url.query+url.hash;switch(inputType){// This is impossible, because of the empty checks at the start of the function. // case UrlType.Empty: -case UrlType$1.Hash:case UrlType$1.Query:return queryHash;case UrlType$1.RelativePath:{// The first char is always a "/", and we need it to be relative. +case UrlType.Hash:case UrlType.Query:return queryHash;case UrlType.RelativePath:{// The first char is always a "/", and we need it to be relative. const path=url.path.slice(1);if(!path)return queryHash||'.';if(isRelative(base||input)&&!isRelative(path)){// If base started with a leading ".", or there is no base and input started with a ".", // then we need to ensure that the relative path starts with a ".". We don't know if // relative starts with a "..", though, so check before prepending. -return'./'+path+queryHash;}return path+queryHash;}case UrlType$1.AbsolutePath:return url.path+queryHash;default:return url.scheme+'//'+url.user+url.host+url.port+url.path+queryHash;}}function resolve(input,base){// The base is always treated as a directory, if it's not empty. +return'./'+path+queryHash;}return path+queryHash;}case UrlType.AbsolutePath:return url.path+queryHash;default:return url.scheme+'//'+url.user+url.host+url.port+url.path+queryHash;}}function resolve(input,base){// The base is always treated as a directory, if it's not empty. // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 if(base&&!base.endsWith('/'))base+='/';return resolve$1(input,base);}/** @@ -17635,16 +17669,14 @@ low=lastIndex===-1?0:lastIndex;}else{high=lastIndex;}}state.lastKey=key;state.la * \`source-map\` library. */let originalPositionFor;class TraceMap{constructor(map,mapUrl){const isString=typeof map==='string';if(!isString&&map._decodedMemo)return map;const parsed=isString?JSON.parse(map):map;const version=parsed.version,file=parsed.file,names=parsed.names,sourceRoot=parsed.sourceRoot,sources=parsed.sources,sourcesContent=parsed.sourcesContent;this.version=version;this.file=file;this.names=names||[];this.sourceRoot=sourceRoot;this.sources=sources;this.sourcesContent=sourcesContent;const from=resolve(sourceRoot||'',stripFilename(mapUrl));this.resolvedSources=sources.map(s=>resolve(s||'',from));const mappings=parsed.mappings;if(typeof mappings==='string'){this._encoded=mappings;this._decoded=undefined;}else{this._encoded=undefined;this._decoded=maybeSort(mappings,isString);}this._decodedMemo=memoizedState();this._bySources=undefined;this._bySourceMemos=undefined;}}(()=>{decodedMappings=map=>{return map._decoded||(map._decoded=decode(map._encoded));};originalPositionFor=(map,{line,column,bias})=>{line--;if(line<0)throw new Error(LINE_GTR_ZERO);if(column<0)throw new Error(COL_GTR_EQ_ZERO);const decoded=decodedMappings(map);// It's common for parent source maps to have pointers to lines that have no // mapping (like a "//# sourceMappingURL=") at the end of the child file. -if(line>=decoded.length)return OMapping(null,null,null,null);const segments=decoded[line];const index=traceSegmentInternal(segments,map._decodedMemo,line,column,bias||GREATEST_LOWER_BOUND);if(index===-1)return OMapping(null,null,null,null);const segment=segments[index];if(segment.length===1)return OMapping(null,null,null,null);const names=map.names,resolvedSources=map.resolvedSources;return OMapping(resolvedSources[segment[SOURCES_INDEX]],segment[SOURCE_LINE]+1,segment[SOURCE_COLUMN],segment.length===5?names[segment[NAMES_INDEX]]:null);};})();function OMapping(source,line,column,name){return{source,line,column,name};}function traceSegmentInternal(segments,memo,line,column,bias){let index=memoizedBinarySearch(segments,column,memo,line);if(found){index=(bias===LEAST_UPPER_BOUND?upperBound:lowerBound)(segments,column,index);}else if(bias===LEAST_UPPER_BOUND)index++;if(index===-1||index===segments.length)return-1;return index;}const CHROME_IE_STACK_REGEXP$1=/^\\s*at .*(\\S+:\\d+|\\(native\\))/m;const SAFARI_NATIVE_CODE_REGEXP$1=/^(eval@)?(\\[native code])?$/;const stackIgnorePatterns=["node:internal",/\\/packages\\/\\w+\\/dist\\//,/\\/@vitest\\/\\w+\\/dist\\//,"/vitest/dist/","/vitest/src/","/vite-node/dist/","/vite-node/src/","/node_modules/chai/","/node_modules/tinypool/","/node_modules/tinyspy/","/deps/chai.js",/__vitest_browser__/];function extractLocation$1(urlLike){if(!urlLike.includes(":"))return[urlLike];const regExp=/(.+?)(?::(\\d+))?(?::(\\d+))?$/;const parts=regExp.exec(urlLike.replace(/^\\(|\\)$/g,""));if(!parts)return[urlLike];let url=parts[1];if(url.startsWith("http:")||url.startsWith("https:")){const urlObj=new URL(url);url=urlObj.pathname;}if(url.startsWith("/@fs/")){url=url.slice(typeof process!=="undefined"&&process.platform==="win32"?5:4);}return[url,parts[2]||void 0,parts[3]||void 0];}function parseSingleFFOrSafariStack$1(raw){let line=raw.trim();if(SAFARI_NATIVE_CODE_REGEXP$1.test(line))return null;if(line.includes(" > eval"))line=line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,":$1");if(!line.includes("@")&&!line.includes(":"))return null;const functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;const matches=line.match(functionNameRegex);const functionName=matches&&matches[1]?matches[1]:void 0;const _extractLocation$=extractLocation$1(line.replace(functionNameRegex,"")),_extractLocation$2=_slicedToArray(_extractLocation$,3),url=_extractLocation$2[0],lineNumber=_extractLocation$2[1],columnNumber=_extractLocation$2[2];if(!url||!lineNumber||!columnNumber)return null;return{file:url,method:functionName||"",line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseSingleV8Stack$1(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP$1.test(line))return null;if(line.includes("(eval "))line=line.replace(/eval code/g,"eval").replace(/(\\(eval at [^()]*)|(,.*$)/g,"");let sanitizedLine=line.replace(/^\\s+/,"").replace(/\\(eval code/g,"(").replace(/^.*?\\s+/,"");const location=sanitizedLine.match(/ (\\(.+\\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],""):sanitizedLine;const _extractLocation$3=extractLocation$1(location?location[1]:sanitizedLine),_extractLocation$4=_slicedToArray(_extractLocation$3,3),url=_extractLocation$4[0],lineNumber=_extractLocation$4[1],columnNumber=_extractLocation$4[2];let method=location&&sanitizedLine||"";let file=url&&["eval",""].includes(url)?void 0:url;if(!file||!lineNumber||!columnNumber)return null;if(method.startsWith("async "))method=method.slice(6);if(file.startsWith("file://"))file=file.slice(7);file=resolve$3(file);if(method)method=method.replace(/__vite_ssr_import_\\d+__\\./g,"");return{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseStacktrace(stack,options={}){const _options$ignoreStackE=options.ignoreStackEntries,ignoreStackEntries=_options$ignoreStackE===void 0?stackIgnorePatterns:_options$ignoreStackE;let stacks=!CHROME_IE_STACK_REGEXP$1.test(stack)?parseFFOrSafariStackTrace(stack):parseV8Stacktrace(stack);if(ignoreStackEntries.length)stacks=stacks.filter(stack2=>!ignoreStackEntries.some(p=>stack2.file.match(p)));return stacks.map(stack2=>{var _a;const map=(_a=options.getSourceMap)==null?void 0:_a.call(options,stack2.file);if(!map||typeof map!=="object"||!map.version)return stack2;const traceMap=new TraceMap(map);const _originalPositionFor=originalPositionFor(traceMap,stack2),line=_originalPositionFor.line,column=_originalPositionFor.column;if(line!=null&&column!=null)return _objectSpread(_objectSpread({},stack2),{},{line,column});return stack2;});}function parseFFOrSafariStackTrace(stack){return stack.split("\\n").map(line=>parseSingleFFOrSafariStack$1(line)).filter(notNullish);}function parseV8Stacktrace(stack){return stack.split("\\n").map(line=>parseSingleV8Stack$1(line)).filter(notNullish);}function parseErrorStacktrace(e,options={}){if(!e||isPrimitive(e))return[];if(e.stacks)return e.stacks;const stackStr=e.stack||e.stackStr||"";let stackFrames=parseStacktrace(stackStr,options);if(options.frameFilter)stackFrames=stackFrames.filter(f=>options.frameFilter(e,f)!==false);e.stacks=stackFrames;return stackFrames;}async function saveInlineSnapshots(environment,snapshots){const MagicString=(await import('./bundle-D12lh4FL.js')).default;const files=new Set(snapshots.map(i=>i.file));await Promise.all(Array.from(files).map(async file=>{const snaps=snapshots.filter(i=>i.file===file);const code=await environment.readSnapshotFile(file);const s=new MagicString(code);for(const snap of snaps){const index=positionToOffset(code,snap.line,snap.column);replaceInlineSnap(code,s,index,snap.snapshot);}const transformed=s.toString();if(transformed!==code)await environment.saveSnapshotFile(file,transformed);}));}const startObjectRegex=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\\s*\\(\\s*(?:\\/\\*[\\S\\s]*\\*\\/\\s*|\\/\\/.*\\s+)*\\s*({)/m;function replaceObjectSnap(code,s,index,newSnap){let _code=code.slice(index);const startMatch=startObjectRegex.exec(_code);if(!startMatch)return false;_code=_code.slice(startMatch.index);let callEnd=getCallLastIndex(_code);if(callEnd===null)return false;callEnd+=index+startMatch.index;const shapeStart=index+startMatch.index+startMatch[0].length;const shapeEnd=getObjectShapeEndIndex(code,shapeStart);const snap=\`, \${prepareSnapString(newSnap,code,index)}\`;if(shapeEnd===callEnd){s.appendLeft(callEnd,snap);}else{s.overwrite(shapeEnd,callEnd,snap);}return true;}function getObjectShapeEndIndex(code,index){let startBraces=1;let endBraces=0;while(startBraces!==endBraces&&index=decoded.length)return OMapping(null,null,null,null);const segments=decoded[line];const index=traceSegmentInternal(segments,map._decodedMemo,line,column,bias||GREATEST_LOWER_BOUND);if(index===-1)return OMapping(null,null,null,null);const segment=segments[index];if(segment.length===1)return OMapping(null,null,null,null);const names=map.names,resolvedSources=map.resolvedSources;return OMapping(resolvedSources[segment[SOURCES_INDEX]],segment[SOURCE_LINE]+1,segment[SOURCE_COLUMN],segment.length===5?names[segment[NAMES_INDEX]]:null);};})();function OMapping(source,line,column,name){return{source,line,column,name};}function traceSegmentInternal(segments,memo,line,column,bias){let index=memoizedBinarySearch(segments,column,memo,line);if(found){index=(bias===LEAST_UPPER_BOUND?upperBound:lowerBound)(segments,column,index);}else if(bias===LEAST_UPPER_BOUND)index++;if(index===-1||index===segments.length)return-1;return index;}const CHROME_IE_STACK_REGEXP=/^\\s*at .*(\\S+:\\d+|\\(native\\))/m;const SAFARI_NATIVE_CODE_REGEXP=/^(eval@)?(\\[native code])?$/;const stackIgnorePatterns=["node:internal",/\\/packages\\/\\w+\\/dist\\//,/\\/@vitest\\/\\w+\\/dist\\//,"/vitest/dist/","/vitest/src/","/vite-node/dist/","/vite-node/src/","/node_modules/chai/","/node_modules/tinypool/","/node_modules/tinyspy/","/deps/chai.js",/__vitest_browser__/];function extractLocation(urlLike){if(!urlLike.includes(":"))return[urlLike];const regExp=/(.+?)(?::(\\d+))?(?::(\\d+))?$/;const parts=regExp.exec(urlLike.replace(/^\\(|\\)$/g,""));if(!parts)return[urlLike];let url=parts[1];if(url.startsWith("http:")||url.startsWith("https:")){const urlObj=new URL(url);url=urlObj.pathname;}if(url.startsWith("/@fs/")){url=url.slice(typeof process!=="undefined"&&process.platform==="win32"?5:4);}return[url,parts[2]||void 0,parts[3]||void 0];}function parseSingleFFOrSafariStack(raw){let line=raw.trim();if(SAFARI_NATIVE_CODE_REGEXP.test(line))return null;if(line.includes(" > eval"))line=line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,":$1");if(!line.includes("@")&&!line.includes(":"))return null;const functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;const matches=line.match(functionNameRegex);const functionName=matches&&matches[1]?matches[1]:void 0;const _extractLocation=extractLocation(line.replace(functionNameRegex,"")),_extractLocation2=_slicedToArray(_extractLocation,3),url=_extractLocation2[0],lineNumber=_extractLocation2[1],columnNumber=_extractLocation2[2];if(!url||!lineNumber||!columnNumber)return null;return{file:url,method:functionName||"",line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseSingleV8Stack(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP.test(line))return null;if(line.includes("(eval "))line=line.replace(/eval code/g,"eval").replace(/(\\(eval at [^()]*)|(,.*$)/g,"");let sanitizedLine=line.replace(/^\\s+/,"").replace(/\\(eval code/g,"(").replace(/^.*?\\s+/,"");const location=sanitizedLine.match(/ (\\(.+\\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],""):sanitizedLine;const _extractLocation3=extractLocation(location?location[1]:sanitizedLine),_extractLocation4=_slicedToArray(_extractLocation3,3),url=_extractLocation4[0],lineNumber=_extractLocation4[1],columnNumber=_extractLocation4[2];let method=location&&sanitizedLine||"";let file=url&&["eval",""].includes(url)?void 0:url;if(!file||!lineNumber||!columnNumber)return null;if(method.startsWith("async "))method=method.slice(6);if(file.startsWith("file://"))file=file.slice(7);file=resolve$3(file);if(method)method=method.replace(/__vite_ssr_import_\\d+__\\./g,"");return{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseStacktrace(stack,options={}){const _options$ignoreStackE=options.ignoreStackEntries,ignoreStackEntries=_options$ignoreStackE===void 0?stackIgnorePatterns:_options$ignoreStackE;let stacks=!CHROME_IE_STACK_REGEXP.test(stack)?parseFFOrSafariStackTrace(stack):parseV8Stacktrace(stack);if(ignoreStackEntries.length)stacks=stacks.filter(stack2=>!ignoreStackEntries.some(p=>stack2.file.match(p)));return stacks.map(stack2=>{var _a;const map=(_a=options.getSourceMap)==null?void 0:_a.call(options,stack2.file);if(!map||typeof map!=="object"||!map.version)return stack2;const traceMap=new TraceMap(map);const _originalPositionFor=originalPositionFor(traceMap,stack2),line=_originalPositionFor.line,column=_originalPositionFor.column;if(line!=null&&column!=null)return _objectSpread(_objectSpread({},stack2),{},{line,column});return stack2;});}function parseFFOrSafariStackTrace(stack){return stack.split("\\n").map(line=>parseSingleFFOrSafariStack(line)).filter(notNullish);}function parseV8Stacktrace(stack){return stack.split("\\n").map(line=>parseSingleV8Stack(line)).filter(notNullish);}function parseErrorStacktrace(e,options={}){if(!e||isPrimitive(e))return[];if(e.stacks)return e.stacks;const stackStr=e.stack||e.stackStr||"";let stackFrames=parseStacktrace(stackStr,options);if(options.frameFilter)stackFrames=stackFrames.filter(f=>options.frameFilter(e,f)!==false);e.stacks=stackFrames;return stackFrames;}async function saveInlineSnapshots(environment,snapshots){const MagicString=(await import('./bundle-D7lcxiVj.js')).default;const files=new Set(snapshots.map(i=>i.file));await Promise.all(Array.from(files).map(async file=>{const snaps=snapshots.filter(i=>i.file===file);const code=await environment.readSnapshotFile(file);const s=new MagicString(code);for(const snap of snaps){const index=positionToOffset(code,snap.line,snap.column);replaceInlineSnap(code,s,index,snap.snapshot);}const transformed=s.toString();if(transformed!==code)await environment.saveSnapshotFile(file,transformed);}));}const startObjectRegex=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\\s*\\(\\s*(?:\\/\\*[\\S\\s]*\\*\\/\\s*|\\/\\/.*\\s+)*\\s*({)/m;function replaceObjectSnap(code,s,index,newSnap){let _code=code.slice(index);const startMatch=startObjectRegex.exec(_code);if(!startMatch)return false;_code=_code.slice(startMatch.index);let callEnd=getCallLastIndex(_code);if(callEnd===null)return false;callEnd+=index+startMatch.index;const shapeStart=index+startMatch.index+startMatch[0].length;const shapeEnd=getObjectShapeEndIndex(code,shapeStart);const snap=\`, \${prepareSnapString(newSnap,code,index)}\`;if(shapeEnd===callEnd){s.appendLeft(callEnd,snap);}else{s.overwrite(shapeEnd,callEnd,snap);}return true;}function getObjectShapeEndIndex(code,index){let startBraces=1;let endBraces=0;while(startBraces!==endBraces&&indexi?indentNext+i:"").join("\\n").replace(/\`/g,"\\\\\`").replace(/\\\${/g,"\\\\\${")} \${indent}\${quote}\`;}const startRegex=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\\s*\\(\\s*(?:\\/\\*[\\S\\s]*\\*\\/\\s*|\\/\\/.*\\s+)*\\s*[\\w_$]*(['"\`\\)])/m;function replaceInlineSnap(code,s,index,newSnap){const codeStartingAtIndex=code.slice(index);const startMatch=startRegex.exec(codeStartingAtIndex);const firstKeywordMatch=/toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot/.exec(codeStartingAtIndex);if(!startMatch||startMatch.index!==(firstKeywordMatch==null?void 0:firstKeywordMatch.index))return replaceObjectSnap(code,s,index,newSnap);const quote=startMatch[1];const startIndex=index+startMatch.index+startMatch[0].length;const snapString=prepareSnapString(newSnap,code,index);if(quote===")"){s.appendRight(startIndex-1,snapString);return true;}const quoteEndRE=new RegExp(\`(?:^|[^\\\\\\\\])\${quote}\`);const endMatch=quoteEndRE.exec(code.slice(startIndex));if(!endMatch)return false;const endIndex=startIndex+endMatch.index+endMatch[0].length;s.overwrite(startIndex-1,endIndex,snapString);return true;}const INDENTATION_REGEX=/^([^\\S\\n]*)\\S/m;function stripSnapshotIndentation(inlineSnapshot){const match=inlineSnapshot.match(INDENTATION_REGEX);if(!match||!match[1]){return inlineSnapshot;}const indentation=match[1];const lines=inlineSnapshot.split(/\\n/g);if(lines.length<=2){return inlineSnapshot;}if(lines[0].trim()!==""||lines[lines.length-1].trim()!==""){return inlineSnapshot;}for(let i=1;i{if(!snap.readonly)await environment.saveSnapshotFile(snap.file,snap.snapshot);}));}class SnapshotState{constructor(testFilePath,snapshotPath,snapshotContent,options){this.testFilePath=testFilePath;this.snapshotPath=snapshotPath;const _getSnapshotData=getSnapshotData(snapshotContent,options),data=_getSnapshotData.data,dirty=_getSnapshotData.dirty;this._fileExists=snapshotContent!=null;this._initialData=data;this._snapshotData=data;this._dirty=dirty;this._inlineSnapshots=[];this._rawSnapshots=[];this._uncheckedKeys=new Set(Object.keys(this._snapshotData));this._counters=/* @__PURE__ */new Map();this.expand=options.expand||false;this.added=0;this.matched=0;this.unmatched=0;this._updateSnapshot=options.updateSnapshot;this.updated=0;this._snapshotFormat=_objectSpread({printBasicPrototype:false,escapeString:false},options.snapshotFormat);this._environment=options.snapshotEnvironment;}_counters;_dirty;_updateSnapshot;_snapshotData;_initialData;_inlineSnapshots;_rawSnapshots;_uncheckedKeys;_snapshotFormat;_environment;_fileExists;added;expand;matched;unmatched;updated;static async create(testFilePath,options){const snapshotPath=await options.snapshotEnvironment.resolvePath(testFilePath);const content=await options.snapshotEnvironment.readSnapshotFile(snapshotPath);return new SnapshotState(testFilePath,snapshotPath,content,options);}get environment(){return this._environment;}markSnapshotsAsCheckedForTest(testName){this._uncheckedKeys.forEach(uncheckedKey=>{if(keyToTestName(uncheckedKey)===testName)this._uncheckedKeys.delete(uncheckedKey);});}_inferInlineSnapshotStack(stacks){const promiseIndex=stacks.findIndex(i=>i.method.match(/__VITEST_(RESOLVES|REJECTS)__/));if(promiseIndex!==-1)return stacks[promiseIndex+3];const stackIndex=stacks.findIndex(i=>i.method.includes("__INLINE_SNAPSHOT__"));return stackIndex!==-1?stacks[stackIndex+2]:null;}_addSnapshot(key,receivedSerialized,options){this._dirty=true;if(options.isInline){const stacks=parseErrorStacktrace(options.error||new Error("snapshot"),{ignoreStackEntries:[]});const stack=this._inferInlineSnapshotStack(stacks);if(!stack){throw new Error(\`@vitest/snapshot: Couldn't infer stack frame for inline snapshot. -\${JSON.stringify(stacks)}\`);}stack.column--;this._inlineSnapshots.push(_objectSpread({snapshot:receivedSerialized},stack));}else if(options.rawSnapshot){this._rawSnapshots.push(_objectSpread(_objectSpread({},options.rawSnapshot),{},{snapshot:receivedSerialized}));}else{this._snapshotData[key]=receivedSerialized;}}clear(){this._snapshotData=this._initialData;this._counters=/* @__PURE__ */new Map();this.added=0;this.matched=0;this.unmatched=0;this.updated=0;this._dirty=false;}async save(){const hasExternalSnapshots=Object.keys(this._snapshotData).length;const hasInlineSnapshots=this._inlineSnapshots.length;const hasRawSnapshots=this._rawSnapshots.length;const isEmpty=!hasExternalSnapshots&&!hasInlineSnapshots&&!hasRawSnapshots;const status={deleted:false,saved:false};if((this._dirty||this._uncheckedKeys.size)&&!isEmpty){if(hasExternalSnapshots){await saveSnapshotFile(this._environment,this._snapshotData,this.snapshotPath);this._fileExists=true;}if(hasInlineSnapshots)await saveInlineSnapshots(this._environment,this._inlineSnapshots);if(hasRawSnapshots)await saveRawSnapshots(this._environment,this._rawSnapshots);status.saved=true;}else if(!hasExternalSnapshots&&this._fileExists){if(this._updateSnapshot==="all"){await this._environment.removeSnapshotFile(this.snapshotPath);this._fileExists=false;}status.deleted=true;}return status;}getUncheckedCount(){return this._uncheckedKeys.size||0;}getUncheckedKeys(){return Array.from(this._uncheckedKeys);}removeUncheckedKeys(){if(this._updateSnapshot==="all"&&this._uncheckedKeys.size){this._dirty=true;this._uncheckedKeys.forEach(key=>delete this._snapshotData[key]);this._uncheckedKeys.clear();}}match({testName,received,key,inlineSnapshot,isInline,error,rawSnapshot}){this._counters.set(testName,(this._counters.get(testName)||0)+1);const count=Number(this._counters.get(testName));if(!key)key=testNameToKey(testName,count);if(!(isInline&&this._snapshotData[key]!==void 0))this._uncheckedKeys.delete(key);let receivedSerialized=rawSnapshot&&typeof received==="string"?received:serialize(received,void 0,this._snapshotFormat);if(!rawSnapshot)receivedSerialized=addExtraLineBreaks(receivedSerialized);if(rawSnapshot){if(rawSnapshot.content&&rawSnapshot.content.match(/\\r\\n/)&&!receivedSerialized.match(/\\r\\n/))rawSnapshot.content=normalizeNewlines(rawSnapshot.content);}const expected=isInline?inlineSnapshot:rawSnapshot?rawSnapshot.content:this._snapshotData[key];const expectedTrimmed=prepareExpected(expected);const pass=expectedTrimmed===prepareExpected(receivedSerialized);const hasSnapshot=expected!==void 0;const snapshotIsPersisted=isInline||this._fileExists||rawSnapshot&&rawSnapshot.content!=null;if(pass&&!isInline&&!rawSnapshot){this._snapshotData[key]=receivedSerialized;}if(hasSnapshot&&this._updateSnapshot==="all"||(!hasSnapshot||!snapshotIsPersisted)&&(this._updateSnapshot==="new"||this._updateSnapshot==="all")){if(this._updateSnapshot==="all"){if(!pass){if(hasSnapshot)this.updated++;else this.added++;this._addSnapshot(key,receivedSerialized,{error,isInline,rawSnapshot});}else{this.matched++;}}else{this._addSnapshot(key,receivedSerialized,{error,isInline,rawSnapshot});this.added++;}return{actual:"",count,expected:"",key,pass:true};}else{if(!pass){this.unmatched++;return{actual:removeExtraLineBreaks(receivedSerialized),count,expected:expectedTrimmed!==void 0?removeExtraLineBreaks(expectedTrimmed):void 0,key,pass:false};}else{this.matched++;return{actual:"",count,expected:"",key,pass:true};}}}async pack(){const snapshot={filepath:this.testFilePath,added:0,fileDeleted:false,matched:0,unchecked:0,uncheckedKeys:[],unmatched:0,updated:0};const uncheckedCount=this.getUncheckedCount();const uncheckedKeys=this.getUncheckedKeys();if(uncheckedCount)this.removeUncheckedKeys();const status=await this.save();snapshot.fileDeleted=status.deleted;snapshot.added=this.added;snapshot.matched=this.matched;snapshot.unmatched=this.unmatched;snapshot.updated=this.updated;snapshot.unchecked=!status.deleted?uncheckedCount:0;snapshot.uncheckedKeys=Array.from(uncheckedKeys);return snapshot;}}function createMismatchError(message,expand,actual,expected){const error=new Error(message);Object.defineProperty(error,"actual",{value:actual,enumerable:true,configurable:true,writable:true});Object.defineProperty(error,"expected",{value:expected,enumerable:true,configurable:true,writable:true});Object.defineProperty(error,"diffOptions",{value:{expand}});return error;}class SnapshotClient{constructor(options={}){this.options=options;}filepath;name;snapshotState;snapshotStateMap=/* @__PURE__ */new Map();async startCurrentRun(filepath,name,options){var _a;this.filepath=filepath;this.name=name;if(((_a=this.snapshotState)==null?void 0:_a.testFilePath)!==filepath){await this.finishCurrentRun();if(!this.getSnapshotState(filepath)){this.snapshotStateMap.set(filepath,await SnapshotState.create(filepath,options));}this.snapshotState=this.getSnapshotState(filepath);}}getSnapshotState(filepath){return this.snapshotStateMap.get(filepath);}clearTest(){this.filepath=void 0;this.name=void 0;}skipTestSnapshots(name){var _a;(_a=this.snapshotState)==null?void 0:_a.markSnapshotsAsCheckedForTest(name);}assert(options){var _a,_b,_c,_d;const _options$filepath=options.filepath,filepath=_options$filepath===void 0?this.filepath:_options$filepath,_options$name=options.name,name=_options$name===void 0?this.name:_options$name,message=options.message,_options$isInline=options.isInline,isInline=_options$isInline===void 0?false:_options$isInline,properties=options.properties,inlineSnapshot=options.inlineSnapshot,error=options.error,errorMessage=options.errorMessage,rawSnapshot=options.rawSnapshot;let received=options.received;if(!filepath)throw new Error("Snapshot cannot be used outside of test");if(typeof properties==="object"){if(typeof received!=="object"||!received)throw new Error("Received value must be an object when the matcher has properties");try{const pass2=((_b=(_a=this.options).isEqual)==null?void 0:_b.call(_a,received,properties))??false;if(!pass2)throw createMismatchError("Snapshot properties mismatched",(_c=this.snapshotState)==null?void 0:_c.expand,received,properties);else received=deepMergeSnapshot(received,properties);}catch(err){err.message=errorMessage||"Snapshot mismatched";throw err;}}const testName=[name,...(message?[message]:[])].join(" > ");const snapshotState=this.getSnapshotState(filepath);const _snapshotState$match=snapshotState.match({testName,received,isInline,error,inlineSnapshot,rawSnapshot}),actual=_snapshotState$match.actual,expected=_snapshotState$match.expected,key=_snapshotState$match.key,pass=_snapshotState$match.pass;if(!pass)throw createMismatchError(\`Snapshot \\\`\${key||"unknown"}\\\` mismatched\`,(_d=this.snapshotState)==null?void 0:_d.expand,actual==null?void 0:actual.trim(),expected==null?void 0:expected.trim());}async assertRaw(options){if(!options.rawSnapshot)throw new Error("Raw snapshot is required");const _options$filepath2=options.filepath,filepath=_options$filepath2===void 0?this.filepath:_options$filepath2,rawSnapshot=options.rawSnapshot;if(rawSnapshot.content==null){if(!filepath)throw new Error("Snapshot cannot be used outside of test");const snapshotState=this.getSnapshotState(filepath);options.filepath||(options.filepath=filepath);rawSnapshot.file=await snapshotState.environment.resolveRawPath(filepath,rawSnapshot.file);rawSnapshot.content=(await snapshotState.environment.readSnapshotFile(rawSnapshot.file))||void 0;}return this.assert(options);}async finishCurrentRun(){if(!this.snapshotState)return null;const result=await this.snapshotState.pack();this.snapshotState=void 0;return result;}clear(){this.snapshotStateMap.clear();}}function getFullName(task,separator=" > "){return getNames(task).join(separator);}function normalizeWindowsPath(input=""){if(!input||!input.includes("\\\\")){return input;}return input.replace(/\\\\/g,"/");}const _IS_ABSOLUTE_RE=/^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;function cwd(){if(typeof process!=="undefined"){return process.cwd().replace(/\\\\/g,"/");}return"/";}const resolve$2=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath(argument));let resolvedPath="";let resolvedAbsolute=false;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){const path=index>=0?arguments_[index]:cwd();if(!path||path.length===0){continue;}resolvedPath=\`\${path}/\${resolvedPath}\`;resolvedAbsolute=isAbsolute(path);}resolvedPath=normalizeString(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute&&!isAbsolute(resolvedPath)){return\`/\${resolvedPath}\`;}return resolvedPath.length>0?resolvedPath:".";};function normalizeString(path,allowAboveRoot){let res="";let lastSegmentLength=0;let lastSlash=-1;let dots=0;let char=null;for(let index=0;index<=path.length;++index){if(index2){const lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex===-1){res="";lastSegmentLength=0;}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/");}lastSlash=index;dots=0;continue;}else if(res.length>0){res="";lastSegmentLength=0;lastSlash=index;dots=0;continue;}}if(allowAboveRoot){res+=res.length>0?"/..":"..";lastSegmentLength=2;}}else{if(res.length>0){res+=\`/\${path.slice(lastSlash+1,index)}\`;}else{res=path.slice(lastSlash+1,index);}lastSegmentLength=index-lastSlash-1;}lastSlash=index;dots=0;}else if(char==="."&&dots!==-1){++dots;}else{dots=-1;}}return res;}const isAbsolute=function(p){return _IS_ABSOLUTE_RE.test(p);};const chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';const intToChar=new Uint8Array(64);// 64 possible chars. -const charToInt=new Uint8Array(128);// z is 122 in ASCII -for(let i=0;i eval"))line=line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,":$1");if(!line.includes("@")&&!line.includes(":"))return null;const functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;const matches=line.match(functionNameRegex);const functionName=matches&&matches[1]?matches[1]:void 0;const _extractLocation=extractLocation(line.replace(functionNameRegex,"")),_extractLocation2=_slicedToArray(_extractLocation,3),url=_extractLocation2[0],lineNumber=_extractLocation2[1],columnNumber=_extractLocation2[2];if(!url||!lineNumber||!columnNumber)return null;return{file:url,method:functionName||"",line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseSingleStack(raw){const line=raw.trim();if(!CHROME_IE_STACK_REGEXP.test(line))return parseSingleFFOrSafariStack(line);return parseSingleV8Stack(line);}function parseSingleV8Stack(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP.test(line))return null;if(line.includes("(eval "))line=line.replace(/eval code/g,"eval").replace(/(\\(eval at [^()]*)|(,.*$)/g,"");let sanitizedLine=line.replace(/^\\s+/,"").replace(/\\(eval code/g,"(").replace(/^.*?\\s+/,"");const location=sanitizedLine.match(/ (\\(.+\\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],""):sanitizedLine;const _extractLocation3=extractLocation(location?location[1]:sanitizedLine),_extractLocation4=_slicedToArray(_extractLocation3,3),url=_extractLocation4[0],lineNumber=_extractLocation4[1],columnNumber=_extractLocation4[2];let method=location&&sanitizedLine||"";let file=url&&["eval",""].includes(url)?void 0:url;if(!file||!lineNumber||!columnNumber)return null;if(method.startsWith("async "))method=method.slice(6);if(file.startsWith("file://"))file=file.slice(7);file=resolve$2(file);if(method)method=method.replace(/__vite_ssr_import_\\d+__\\./g,"");return{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function isChildProcess(){return typeof process!=="undefined"&&!!process.send;}const RealDate=Date;let now=null;class MockDate extends RealDate{constructor(y,m,d,h,M,s,ms){super();let date;switch(arguments.length){case 0:if(now!==null)date=new RealDate(now.valueOf());else date=new RealDate();break;case 1:date=new RealDate(y);break;default:d=typeof d==="undefined"?1:d;h=h||0;M=M||0;s=s||0;ms=ms||0;date=new RealDate(y,m,d,h,M,s,ms);break;}Object.setPrototypeOf(date,MockDate.prototype);return date;}}MockDate.UTC=RealDate.UTC;MockDate.now=function(){return new MockDate().valueOf();};MockDate.parse=function(dateString){return RealDate.parse(dateString);};MockDate.toString=function(){return RealDate.toString();};function mockDate(date){const dateObj=new RealDate(date.valueOf());if(Number.isNaN(dateObj.getTime()))throw new TypeError(\`mockdate: The time set is an invalid date: \${date}\`);globalThis.Date=MockDate;now=dateObj.valueOf();}function resetDate(){globalThis.Date=RealDate;}function resetModules(modules,resetMocks=false){const skipPaths=[// Vitest +\${JSON.stringify(stacks)}\`);}stack.column--;this._inlineSnapshots.push(_objectSpread({snapshot:receivedSerialized},stack));}else if(options.rawSnapshot){this._rawSnapshots.push(_objectSpread(_objectSpread({},options.rawSnapshot),{},{snapshot:receivedSerialized}));}else{this._snapshotData[key]=receivedSerialized;}}clear(){this._snapshotData=this._initialData;this._counters=/* @__PURE__ */new Map();this.added=0;this.matched=0;this.unmatched=0;this.updated=0;this._dirty=false;}async save(){const hasExternalSnapshots=Object.keys(this._snapshotData).length;const hasInlineSnapshots=this._inlineSnapshots.length;const hasRawSnapshots=this._rawSnapshots.length;const isEmpty=!hasExternalSnapshots&&!hasInlineSnapshots&&!hasRawSnapshots;const status={deleted:false,saved:false};if((this._dirty||this._uncheckedKeys.size)&&!isEmpty){if(hasExternalSnapshots){await saveSnapshotFile(this._environment,this._snapshotData,this.snapshotPath);this._fileExists=true;}if(hasInlineSnapshots)await saveInlineSnapshots(this._environment,this._inlineSnapshots);if(hasRawSnapshots)await saveRawSnapshots(this._environment,this._rawSnapshots);status.saved=true;}else if(!hasExternalSnapshots&&this._fileExists){if(this._updateSnapshot==="all"){await this._environment.removeSnapshotFile(this.snapshotPath);this._fileExists=false;}status.deleted=true;}return status;}getUncheckedCount(){return this._uncheckedKeys.size||0;}getUncheckedKeys(){return Array.from(this._uncheckedKeys);}removeUncheckedKeys(){if(this._updateSnapshot==="all"&&this._uncheckedKeys.size){this._dirty=true;this._uncheckedKeys.forEach(key=>delete this._snapshotData[key]);this._uncheckedKeys.clear();}}match({testName,received,key,inlineSnapshot,isInline,error,rawSnapshot}){this._counters.set(testName,(this._counters.get(testName)||0)+1);const count=Number(this._counters.get(testName));if(!key)key=testNameToKey(testName,count);if(!(isInline&&this._snapshotData[key]!==void 0))this._uncheckedKeys.delete(key);let receivedSerialized=rawSnapshot&&typeof received==="string"?received:serialize(received,void 0,this._snapshotFormat);if(!rawSnapshot)receivedSerialized=addExtraLineBreaks(receivedSerialized);if(rawSnapshot){if(rawSnapshot.content&&rawSnapshot.content.match(/\\r\\n/)&&!receivedSerialized.match(/\\r\\n/))rawSnapshot.content=normalizeNewlines(rawSnapshot.content);}const expected=isInline?inlineSnapshot:rawSnapshot?rawSnapshot.content:this._snapshotData[key];const expectedTrimmed=prepareExpected(expected);const pass=expectedTrimmed===prepareExpected(receivedSerialized);const hasSnapshot=expected!==void 0;const snapshotIsPersisted=isInline||this._fileExists||rawSnapshot&&rawSnapshot.content!=null;if(pass&&!isInline&&!rawSnapshot){this._snapshotData[key]=receivedSerialized;}if(hasSnapshot&&this._updateSnapshot==="all"||(!hasSnapshot||!snapshotIsPersisted)&&(this._updateSnapshot==="new"||this._updateSnapshot==="all")){if(this._updateSnapshot==="all"){if(!pass){if(hasSnapshot)this.updated++;else this.added++;this._addSnapshot(key,receivedSerialized,{error,isInline,rawSnapshot});}else{this.matched++;}}else{this._addSnapshot(key,receivedSerialized,{error,isInline,rawSnapshot});this.added++;}return{actual:"",count,expected:"",key,pass:true};}else{if(!pass){this.unmatched++;return{actual:removeExtraLineBreaks(receivedSerialized),count,expected:expectedTrimmed!==void 0?removeExtraLineBreaks(expectedTrimmed):void 0,key,pass:false};}else{this.matched++;return{actual:"",count,expected:"",key,pass:true};}}}async pack(){const snapshot={filepath:this.testFilePath,added:0,fileDeleted:false,matched:0,unchecked:0,uncheckedKeys:[],unmatched:0,updated:0};const uncheckedCount=this.getUncheckedCount();const uncheckedKeys=this.getUncheckedKeys();if(uncheckedCount)this.removeUncheckedKeys();const status=await this.save();snapshot.fileDeleted=status.deleted;snapshot.added=this.added;snapshot.matched=this.matched;snapshot.unmatched=this.unmatched;snapshot.updated=this.updated;snapshot.unchecked=!status.deleted?uncheckedCount:0;snapshot.uncheckedKeys=Array.from(uncheckedKeys);return snapshot;}}function createMismatchError(message,expand,actual,expected){const error=new Error(message);Object.defineProperty(error,"actual",{value:actual,enumerable:true,configurable:true,writable:true});Object.defineProperty(error,"expected",{value:expected,enumerable:true,configurable:true,writable:true});Object.defineProperty(error,"diffOptions",{value:{expand}});return error;}class SnapshotClient{constructor(options={}){this.options=options;}filepath;name;snapshotState;snapshotStateMap=/* @__PURE__ */new Map();async startCurrentRun(filepath,name,options){var _a;this.filepath=filepath;this.name=name;if(((_a=this.snapshotState)==null?void 0:_a.testFilePath)!==filepath){await this.finishCurrentRun();if(!this.getSnapshotState(filepath)){this.snapshotStateMap.set(filepath,await SnapshotState.create(filepath,options));}this.snapshotState=this.getSnapshotState(filepath);}}getSnapshotState(filepath){return this.snapshotStateMap.get(filepath);}clearTest(){this.filepath=void 0;this.name=void 0;}skipTestSnapshots(name){var _a;(_a=this.snapshotState)==null?void 0:_a.markSnapshotsAsCheckedForTest(name);}assert(options){var _a,_b,_c,_d;const _options$filepath=options.filepath,filepath=_options$filepath===void 0?this.filepath:_options$filepath,_options$name=options.name,name=_options$name===void 0?this.name:_options$name,message=options.message,_options$isInline=options.isInline,isInline=_options$isInline===void 0?false:_options$isInline,properties=options.properties,inlineSnapshot=options.inlineSnapshot,error=options.error,errorMessage=options.errorMessage,rawSnapshot=options.rawSnapshot;let received=options.received;if(!filepath)throw new Error("Snapshot cannot be used outside of test");if(typeof properties==="object"){if(typeof received!=="object"||!received)throw new Error("Received value must be an object when the matcher has properties");try{const pass2=((_b=(_a=this.options).isEqual)==null?void 0:_b.call(_a,received,properties))??false;if(!pass2)throw createMismatchError("Snapshot properties mismatched",(_c=this.snapshotState)==null?void 0:_c.expand,received,properties);else received=deepMergeSnapshot(received,properties);}catch(err){err.message=errorMessage||"Snapshot mismatched";throw err;}}const testName=[name,...(message?[message]:[])].join(" > ");const snapshotState=this.getSnapshotState(filepath);const _snapshotState$match=snapshotState.match({testName,received,isInline,error,inlineSnapshot,rawSnapshot}),actual=_snapshotState$match.actual,expected=_snapshotState$match.expected,key=_snapshotState$match.key,pass=_snapshotState$match.pass;if(!pass)throw createMismatchError(\`Snapshot \\\`\${key||"unknown"}\\\` mismatched\`,(_d=this.snapshotState)==null?void 0:_d.expand,actual==null?void 0:actual.trim(),expected==null?void 0:expected.trim());}async assertRaw(options){if(!options.rawSnapshot)throw new Error("Raw snapshot is required");const _options$filepath2=options.filepath,filepath=_options$filepath2===void 0?this.filepath:_options$filepath2,rawSnapshot=options.rawSnapshot;if(rawSnapshot.content==null){if(!filepath)throw new Error("Snapshot cannot be used outside of test");const snapshotState=this.getSnapshotState(filepath);options.filepath||(options.filepath=filepath);rawSnapshot.file=await snapshotState.environment.resolveRawPath(filepath,rawSnapshot.file);rawSnapshot.content=(await snapshotState.environment.readSnapshotFile(rawSnapshot.file))||void 0;}return this.assert(options);}async finishCurrentRun(){if(!this.snapshotState)return null;const result=await this.snapshotState.pack();this.snapshotState=void 0;return result;}clear(){this.snapshotStateMap.clear();}}function getFullName(task,separator=" > "){return getNames(task).join(separator);}function isChildProcess(){return typeof process!=="undefined"&&!!process.send;}const RealDate=Date;let now=null;class MockDate extends RealDate{constructor(y,m,d,h,M,s,ms){super();let date;switch(arguments.length){case 0:if(now!==null)date=new RealDate(now.valueOf());else date=new RealDate();break;case 1:date=new RealDate(y);break;default:d=typeof d==="undefined"?1:d;h=h||0;M=M||0;s=s||0;ms=ms||0;date=new RealDate(y,m,d,h,M,s,ms);break;}Object.setPrototypeOf(date,MockDate.prototype);return date;}}MockDate.UTC=RealDate.UTC;MockDate.now=function(){return new MockDate().valueOf();};MockDate.parse=function(dateString){return RealDate.parse(dateString);};MockDate.toString=function(){return RealDate.toString();};function mockDate(date){const dateObj=new RealDate(date.valueOf());if(Number.isNaN(dateObj.getTime()))throw new TypeError(\`mockdate: The time set is an invalid date: \${date}\`);globalThis.Date=MockDate;now=dateObj.valueOf();}function resetDate(){globalThis.Date=RealDate;}function resetModules(modules,resetMocks=false){const skipPaths=[// Vitest /\\/vitest\\/dist\\//,/\\/vite-node\\/dist\\//,// yarn's .store folder /vitest-virtual-\\w+\\/dist/,// cnpm /@vitest\\/dist/,// don't clear mocks -...(!resetMocks?[/^mock:/]:[])];modules.forEach((mod,path)=>{if(skipPaths.some(re=>re.test(path)))return;modules.invalidateModule(mod);});}function waitNextTick(){const _getSafeTimers2=getSafeTimers(),setTimeout=_getSafeTimers2.setTimeout;return new Promise(resolve=>setTimeout(resolve,0));}async function waitForImportsToResolve(){await waitNextTick();const state=getWorkerState();const promises=[];let resolvingCount=0;for(const mod of state.moduleCache.values()){if(mod.promise&&!mod.evaluated)promises.push(mod.promise);if(mod.resolving)resolvingCount++;}if(!promises.length&&!resolvingCount)return;await Promise.allSettled(promises);await waitForImportsToResolve();}function commonjsRequire(path){throw new Error('Could not dynamically require "'+path+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');}var chaiSubset={exports:{}};(function(module,exports){(function(){(function(chaiSubset){if(typeof commonjsRequire==='function'&&'object'==='object'&&'object'==='object'){return module.exports=chaiSubset;}else{return chai.use(chaiSubset);}})(function(chai,utils){var Assertion=chai.Assertion;var assertionPrototype=Assertion.prototype;Assertion.addMethod('containSubset',function(expected){var actual=utils.flag(this,'object');var showDiff=chai.config.showDiff;assertionPrototype.assert.call(this,compare(expected,actual),'expected #{act} to contain subset #{exp}','expected #{act} to not contain subset #{exp}',expected,actual,showDiff);});chai.assert.containSubset=function(val,exp,msg){new chai.Assertion(val,msg).to.be.containSubset(exp);};function compare(expected,actual){if(expected===actual){return true;}if(typeof actual!==typeof expected){return false;}if(typeof expected!=='object'||expected===null){return expected===actual;}if(!!expected&&!actual){return false;}if(Array.isArray(expected)){if(typeof actual.length!=='number'){return false;}var aa=Array.prototype.slice.call(actual);return expected.every(function(exp){return aa.some(function(act){return compare(exp,act);});});}if(expected instanceof Date){if(actual instanceof Date){return expected.getTime()===actual.getTime();}else{return false;}}return Object.keys(expected).every(function(key){var eo=expected[key];var ao=actual[key];if(typeof eo==='object'&&eo!==null&&ao!==null){return compare(eo,ao);}if(typeof eo==='function'){return eo(ao);}return ao===eo;});}});}).call(commonjsGlobal);})(chaiSubset);var chaiSubsetExports=chaiSubset.exports;var Subset=/*@__PURE__*/getDefaultExportFromCjs$1(chaiSubsetExports);const MATCHERS_OBJECT=Symbol.for("matchers-object");const JEST_MATCHERS_OBJECT=Symbol.for("$$jest-matchers-object");const GLOBAL_EXPECT=Symbol.for("expect-global");const ASYMMETRIC_MATCHERS_OBJECT=Symbol.for("asymmetric-matchers-object");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT)){const globalState=/* @__PURE__ */new WeakMap();const matchers=/* @__PURE__ */Object.create(null);const customEqualityTesters=[];const assymetricMatchers=/* @__PURE__ */Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT,{get:()=>globalState});Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT,{configurable:true,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT]),matchers,customEqualityTesters})});Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT,{get:()=>assymetricMatchers});}function recordAsyncExpect(test,promise){if(test&&promise instanceof Promise){promise=promise.finally(()=>{const index=test.promises.indexOf(promise);if(index!==-1)test.promises.splice(index,1);});if(!test.promises)test.promises=[];test.promises.push(promise);}return promise;}let _client;function getSnapshotClient(){if(!_client){_client=new SnapshotClient({isEqual:(received,expected)=>{return equals(received,expected,[iterableEquality,subsetEquality]);}});}return _client;}function getError(expected,promise){if(typeof expected!=="function"){if(!promise)throw new Error(\`expected must be a function, received \${typeof expected}\`);return expected;}try{expected();}catch(e){return e;}throw new Error("snapshot function didn't throw");}const SnapshotPlugin=(chai,utils)=>{const getTestNames=test=>{var _a;if(!test)return{};return{filepath:(_a=test.file)==null?void 0:_a.filepath,name:getNames(test).slice(1).join(" > ")};};for(const key of["matchSnapshot","toMatchSnapshot"]){utils.addMethod(chai.Assertion.prototype,key,function(properties,message){const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");if(typeof properties==="string"&&typeof message==="undefined"){message=properties;properties=void 0;}const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:expected,message,isInline:false,properties,errorMessage},getTestNames(test)));});}utils.addMethod(chai.Assertion.prototype,"toMatchFileSnapshot",function(file,message){const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");const errorMessage=utils.flag(this,"message");const promise=getSnapshotClient().assertRaw(_objectSpread({received:expected,message,isInline:false,rawSnapshot:{file},errorMessage},getTestNames(test)));return recordAsyncExpect(test,promise);});utils.addMethod(chai.Assertion.prototype,"toMatchInlineSnapshot",function __INLINE_SNAPSHOT__(properties,inlineSnapshot,message){var _a;const test=utils.flag(this,"vitest-test");const isInsideEach=test&&(test.each||((_a=test.suite)==null?void 0:_a.each));if(isInsideEach)throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const expected=utils.flag(this,"object");const error=utils.flag(this,"error");if(typeof properties==="string"){message=inlineSnapshot;inlineSnapshot=properties;properties=void 0;}if(inlineSnapshot)inlineSnapshot=stripSnapshotIndentation(inlineSnapshot);const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:expected,message,isInline:true,properties,inlineSnapshot,error,errorMessage},getTestNames(test)));});utils.addMethod(chai.Assertion.prototype,"toThrowErrorMatchingSnapshot",function(message){const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");const promise=utils.flag(this,"promise");const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:getError(expected,promise),message,errorMessage},getTestNames(test)));});utils.addMethod(chai.Assertion.prototype,"toThrowErrorMatchingInlineSnapshot",function __INLINE_SNAPSHOT__(inlineSnapshot,message){var _a;const test=utils.flag(this,"vitest-test");const isInsideEach=test&&(test.each||((_a=test.suite)==null?void 0:_a.each));if(isInsideEach)throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const expected=utils.flag(this,"object");const error=utils.flag(this,"error");const promise=utils.flag(this,"promise");const errorMessage=utils.flag(this,"message");if(inlineSnapshot)inlineSnapshot=stripSnapshotIndentation(inlineSnapshot);getSnapshotClient().assert(_objectSpread({received:getError(expected,promise),message,inlineSnapshot,isInline:true,error,errorMessage},getTestNames(test)));});utils.addMethod(chai.expect,"addSnapshotSerializer",addSerializer);};use(JestExtend);use(JestChaiExpect);use(Subset);use(SnapshotPlugin);use(JestAsymmetricMatchers);function createExpect(test){var _a;const expect$1=(value,message)=>{const _getState=getState(expect$1),assertionCalls=_getState.assertionCalls;setState({assertionCalls:assertionCalls+1,soft:false},expect$1);const assert2=expect(value,message);const _test=test||getCurrentTest();if(_test)return assert2.withTest(_test);else return assert2;};Object.assign(expect$1,expect);Object.assign(expect$1,globalThis[ASYMMETRIC_MATCHERS_OBJECT$1]);expect$1.getState=()=>getState(expect$1);expect$1.setState=state=>setState(state,expect$1);const globalState=getState(globalThis[GLOBAL_EXPECT$1])||{};setState(_objectSpread(_objectSpread({},globalState),{},{assertionCalls:0,isExpectingAssertions:false,isExpectingAssertionsError:null,expectedAssertionsNumber:null,expectedAssertionsNumberErrorGen:null,environment:getCurrentEnvironment(),testPath:test?(_a=test.suite.file)==null?void 0:_a.filepath:globalState.testPath,currentTestName:test?getFullName(test):globalState.currentTestName}),expect$1);expect$1.extend=matchers=>expect.extend(expect$1,matchers);expect$1.addEqualityTesters=customTesters=>addCustomEqualityTesters(customTesters);expect$1.soft=(...args)=>{const assert2=expect$1(...args);expect$1.setState({soft:true});return assert2;};expect$1.unreachable=message=>{assert.fail(\`expected\${message?\` "\${message}" \`:" "}not to be reached\`);};function assertions(expected){const errorGen=()=>new Error(\`expected number of assertions to be \${expected}, but got \${expect$1.getState().assertionCalls}\`);if(Error.captureStackTrace)Error.captureStackTrace(errorGen(),assertions);expect$1.setState({expectedAssertionsNumber:expected,expectedAssertionsNumberErrorGen:errorGen});}function hasAssertions(){const error=new Error("expected any number of assertion, but got none");if(Error.captureStackTrace)Error.captureStackTrace(error,hasAssertions);expect$1.setState({isExpectingAssertions:true,isExpectingAssertionsError:error});}util.addMethod(expect$1,"assertions",assertions);util.addMethod(expect$1,"hasAssertions",hasAssertions);return expect$1;}const globalExpect=createExpect();Object.defineProperty(globalThis,GLOBAL_EXPECT$1,{value:globalExpect,writable:true,configurable:true});/** +...(!resetMocks?[/^mock:/]:[])];modules.forEach((mod,path)=>{if(skipPaths.some(re=>re.test(path)))return;modules.invalidateModule(mod);});}function waitNextTick(){const _getSafeTimers2=getSafeTimers(),setTimeout=_getSafeTimers2.setTimeout;return new Promise(resolve=>setTimeout(resolve,0));}async function waitForImportsToResolve(){await waitNextTick();const state=getWorkerState();const promises=[];let resolvingCount=0;for(const mod of state.moduleCache.values()){if(mod.promise&&!mod.evaluated)promises.push(mod.promise);if(mod.resolving)resolvingCount++;}if(!promises.length&&!resolvingCount)return;await Promise.allSettled(promises);await waitForImportsToResolve();}function commonjsRequire(path){throw new Error('Could not dynamically require "'+path+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');}var chaiSubset={exports:{}};(function(module,exports){(function(){(function(chaiSubset){if(typeof commonjsRequire==='function'&&'object'==='object'&&'object'==='object'){return module.exports=chaiSubset;}else{return chai.use(chaiSubset);}})(function(chai,utils){var Assertion=chai.Assertion;var assertionPrototype=Assertion.prototype;Assertion.addMethod('containSubset',function(expected){var actual=utils.flag(this,'object');var showDiff=chai.config.showDiff;assertionPrototype.assert.call(this,compare(expected,actual),'expected #{act} to contain subset #{exp}','expected #{act} to not contain subset #{exp}',expected,actual,showDiff);});chai.assert.containSubset=function(val,exp,msg){new chai.Assertion(val,msg).to.be.containSubset(exp);};function compare(expected,actual){if(expected===actual){return true;}if(typeof actual!==typeof expected){return false;}if(typeof expected!=='object'||expected===null){return expected===actual;}if(!!expected&&!actual){return false;}if(Array.isArray(expected)){if(typeof actual.length!=='number'){return false;}var aa=Array.prototype.slice.call(actual);return expected.every(function(exp){return aa.some(function(act){return compare(exp,act);});});}if(expected instanceof Date){if(actual instanceof Date){return expected.getTime()===actual.getTime();}else{return false;}}return Object.keys(expected).every(function(key){var eo=expected[key];var ao=actual[key];if(typeof eo==='object'&&eo!==null&&ao!==null){return compare(eo,ao);}if(typeof eo==='function'){return eo(ao);}return ao===eo;});}});}).call(commonjsGlobal);})(chaiSubset);var chaiSubsetExports=chaiSubset.exports;var Subset=/*@__PURE__*/getDefaultExportFromCjs$1(chaiSubsetExports);const MATCHERS_OBJECT=Symbol.for("matchers-object");const JEST_MATCHERS_OBJECT=Symbol.for("$$jest-matchers-object");const GLOBAL_EXPECT=Symbol.for("expect-global");const ASYMMETRIC_MATCHERS_OBJECT=Symbol.for("asymmetric-matchers-object");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT)){const globalState=/* @__PURE__ */new WeakMap();const matchers=/* @__PURE__ */Object.create(null);const customEqualityTesters=[];const assymetricMatchers=/* @__PURE__ */Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT,{get:()=>globalState});Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT,{configurable:true,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT]),matchers,customEqualityTesters})});Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT,{get:()=>assymetricMatchers});}function recordAsyncExpect(test,promise){if(test&&promise instanceof Promise){promise=promise.finally(()=>{const index=test.promises.indexOf(promise);if(index!==-1)test.promises.splice(index,1);});if(!test.promises)test.promises=[];test.promises.push(promise);}return promise;}let _client;function getSnapshotClient(){if(!_client){_client=new SnapshotClient({isEqual:(received,expected)=>{return equals(received,expected,[iterableEquality,subsetEquality]);}});}return _client;}function getError(expected,promise){if(typeof expected!=="function"){if(!promise)throw new Error(\`expected must be a function, received \${typeof expected}\`);return expected;}try{expected();}catch(e){return e;}throw new Error("snapshot function didn't throw");}const SnapshotPlugin=(chai,utils)=>{const getTestNames=test=>{var _a;if(!test)return{};return{filepath:(_a=test.file)==null?void 0:_a.filepath,name:getNames(test).slice(1).join(" > ")};};for(const key of["matchSnapshot","toMatchSnapshot"]){utils.addMethod(chai.Assertion.prototype,key,function(properties,message){const isNot=utils.flag(this,"negate");if(isNot)throw new Error(\`\${key} cannot be used with "not"\`);const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");if(typeof properties==="string"&&typeof message==="undefined"){message=properties;properties=void 0;}const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:expected,message,isInline:false,properties,errorMessage},getTestNames(test)));});}utils.addMethod(chai.Assertion.prototype,"toMatchFileSnapshot",function(file,message){const isNot=utils.flag(this,"negate");if(isNot)throw new Error('toMatchFileSnapshot cannot be used with "not"');const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");const errorMessage=utils.flag(this,"message");const promise=getSnapshotClient().assertRaw(_objectSpread({received:expected,message,isInline:false,rawSnapshot:{file},errorMessage},getTestNames(test)));return recordAsyncExpect(test,promise);});utils.addMethod(chai.Assertion.prototype,"toMatchInlineSnapshot",function __INLINE_SNAPSHOT__(properties,inlineSnapshot,message){var _a;const isNot=utils.flag(this,"negate");if(isNot)throw new Error('toMatchInlineSnapshot cannot be used with "not"');const test=utils.flag(this,"vitest-test");const isInsideEach=test&&(test.each||((_a=test.suite)==null?void 0:_a.each));if(isInsideEach)throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const expected=utils.flag(this,"object");const error=utils.flag(this,"error");if(typeof properties==="string"){message=inlineSnapshot;inlineSnapshot=properties;properties=void 0;}if(inlineSnapshot)inlineSnapshot=stripSnapshotIndentation(inlineSnapshot);const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:expected,message,isInline:true,properties,inlineSnapshot,error,errorMessage},getTestNames(test)));});utils.addMethod(chai.Assertion.prototype,"toThrowErrorMatchingSnapshot",function(message){const isNot=utils.flag(this,"negate");if(isNot)throw new Error('toThrowErrorMatchingSnapshot cannot be used with "not"');const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");const promise=utils.flag(this,"promise");const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:getError(expected,promise),message,errorMessage},getTestNames(test)));});utils.addMethod(chai.Assertion.prototype,"toThrowErrorMatchingInlineSnapshot",function __INLINE_SNAPSHOT__(inlineSnapshot,message){var _a;const isNot=utils.flag(this,"negate");if(isNot)throw new Error('toThrowErrorMatchingInlineSnapshot cannot be used with "not"');const test=utils.flag(this,"vitest-test");const isInsideEach=test&&(test.each||((_a=test.suite)==null?void 0:_a.each));if(isInsideEach)throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const expected=utils.flag(this,"object");const error=utils.flag(this,"error");const promise=utils.flag(this,"promise");const errorMessage=utils.flag(this,"message");if(inlineSnapshot)inlineSnapshot=stripSnapshotIndentation(inlineSnapshot);getSnapshotClient().assert(_objectSpread({received:getError(expected,promise),message,inlineSnapshot,isInline:true,error,errorMessage},getTestNames(test)));});utils.addMethod(chai.expect,"addSnapshotSerializer",addSerializer);};use(JestExtend);use(JestChaiExpect);use(Subset);use(SnapshotPlugin);use(JestAsymmetricMatchers);function createExpect(test){var _a;const expect$1=(value,message)=>{const _getState=getState(expect$1),assertionCalls=_getState.assertionCalls;setState({assertionCalls:assertionCalls+1,soft:false},expect$1);const assert2=expect(value,message);const _test=test||getCurrentTest();if(_test)return assert2.withTest(_test);else return assert2;};Object.assign(expect$1,expect);Object.assign(expect$1,globalThis[ASYMMETRIC_MATCHERS_OBJECT$1]);expect$1.getState=()=>getState(expect$1);expect$1.setState=state=>setState(state,expect$1);const globalState=getState(globalThis[GLOBAL_EXPECT$1])||{};setState(_objectSpread(_objectSpread({},globalState),{},{assertionCalls:0,isExpectingAssertions:false,isExpectingAssertionsError:null,expectedAssertionsNumber:null,expectedAssertionsNumberErrorGen:null,environment:getCurrentEnvironment(),testPath:test?(_a=test.suite.file)==null?void 0:_a.filepath:globalState.testPath,currentTestName:test?getFullName(test):globalState.currentTestName}),expect$1);expect$1.extend=matchers=>expect.extend(expect$1,matchers);expect$1.addEqualityTesters=customTesters=>addCustomEqualityTesters(customTesters);expect$1.soft=(...args)=>{const assert2=expect$1(...args);expect$1.setState({soft:true});return assert2;};expect$1.unreachable=message=>{assert.fail(\`expected\${message?\` "\${message}" \`:" "}not to be reached\`);};function assertions(expected){const errorGen=()=>new Error(\`expected number of assertions to be \${expected}, but got \${expect$1.getState().assertionCalls}\`);if(Error.captureStackTrace)Error.captureStackTrace(errorGen(),assertions);expect$1.setState({expectedAssertionsNumber:expected,expectedAssertionsNumberErrorGen:errorGen});}function hasAssertions(){const error=new Error("expected any number of assertion, but got none");if(Error.captureStackTrace)Error.captureStackTrace(error,hasAssertions);expect$1.setState({isExpectingAssertions:true,isExpectingAssertionsError:error});}util.addMethod(expect$1,"assertions",assertions);util.addMethod(expect$1,"hasAssertions",hasAssertions);return expect$1;}const globalExpect=createExpect();Object.defineProperty(globalThis,GLOBAL_EXPECT$1,{value:globalExpect,writable:true,configurable:true});/** * A reference to the global object * * @type {object} globalObject @@ -18290,9 +18322,9 @@ throw new ReferenceError("non-existent performance object cannot be faked");}}if * @property {createClock} createClock * @property {Function} install * @property {withGlobal} withGlobal - */ /* eslint-enable complexity */ /** @type {FakeTimers} */const defaultImplementation=withGlobal(globalObject);defaultImplementation.timers;defaultImplementation.createClock;defaultImplementation.install;var withGlobal_1=withGlobal;class FakeTimers{_global;_clock;_fakingTime;_fakingDate;_fakeTimers;_userConfig;_now=RealDate.now;constructor({global,config}){this._userConfig=config;this._fakingDate=false;this._fakingTime=false;this._fakeTimers=withGlobal_1(global);this._global=global;}clearAllTimers(){if(this._fakingTime)this._clock.reset();}dispose(){this.useRealTimers();}runAllTimers(){if(this._checkFakeTimers())this._clock.runAll();}async runAllTimersAsync(){if(this._checkFakeTimers())await this._clock.runAllAsync();}runOnlyPendingTimers(){if(this._checkFakeTimers())this._clock.runToLast();}async runOnlyPendingTimersAsync(){if(this._checkFakeTimers())await this._clock.runToLastAsync();}advanceTimersToNextTimer(steps=1){if(this._checkFakeTimers()){for(let i=steps;i>0;i--){this._clock.next();this._clock.tick(0);if(this._clock.countTimers()===0)break;}}}async advanceTimersToNextTimerAsync(steps=1){if(this._checkFakeTimers()){for(let i=steps;i>0;i--){await this._clock.nextAsync();this._clock.tick(0);if(this._clock.countTimers()===0)break;}}}advanceTimersByTime(msToRun){if(this._checkFakeTimers())this._clock.tick(msToRun);}async advanceTimersByTimeAsync(msToRun){if(this._checkFakeTimers())await this._clock.tickAsync(msToRun);}runAllTicks(){if(this._checkFakeTimers()){this._clock.runMicrotasks();}}useRealTimers(){if(this._fakingDate){resetDate();this._fakingDate=false;}if(this._fakingTime){this._clock.uninstall();this._fakingTime=false;}}useFakeTimers(){var _a,_b,_c;if(this._fakingDate){throw new Error('"setSystemTime" was called already and date was mocked. Reset timers using \`vi.useRealTimers()\` if you want to use fake timers again.');}if(!this._fakingTime){const toFake=Object.keys(this._fakeTimers.timers).filter(timer=>timer!=="nextTick");if(((_b=(_a=this._userConfig)==null?void 0:_a.toFake)==null?void 0:_b.includes("nextTick"))&&isChildProcess())throw new Error("process.nextTick cannot be mocked inside child_process");const existingFakedMethods=(((_c=this._userConfig)==null?void 0:_c.toFake)||toFake).filter(method=>{switch(method){case"setImmediate":case"clearImmediate":return method in this._global&&this._global[method];default:return true;}});this._clock=this._fakeTimers.install(_objectSpread(_objectSpread({now:Date.now()},this._userConfig),{},{toFake:existingFakedMethods}));this._fakingTime=true;}}reset(){if(this._checkFakeTimers()){const now=this._clock.now;this._clock.reset();this._clock.setSystemTime(now);}}setSystemTime(now){if(this._fakingTime){this._clock.setSystemTime(now);}else{mockDate(now??this.getRealSystemTime());this._fakingDate=true;}}getRealSystemTime(){return this._now();}getTimerCount(){if(this._checkFakeTimers())return this._clock.countTimers();return 0;}configure(config){this._userConfig=config;}isFakeTimers(){return this._fakingTime;}_checkFakeTimers(){if(!this._fakingTime){throw new Error('Timers are not mocked. Try calling "vi.useFakeTimers()" first.');}return this._fakingTime;}}function copyStackTrace(target,source){if(source.stack!==void 0)target.stack=source.stack.replace(source.message,target.message);return target;}function waitFor(callback,options={}){const _getSafeTimers3=getSafeTimers(),setTimeout=_getSafeTimers3.setTimeout,setInterval=_getSafeTimers3.setInterval,clearTimeout=_getSafeTimers3.clearTimeout,clearInterval=_getSafeTimers3.clearInterval;const _ref12=typeof options==="number"?{timeout:options}:options,_ref12$interval=_ref12.interval,interval=_ref12$interval===void 0?50:_ref12$interval,_ref12$timeout=_ref12.timeout,timeout=_ref12$timeout===void 0?1e3:_ref12$timeout;const STACK_TRACE_ERROR=new Error("STACK_TRACE_ERROR");return new Promise((resolve,reject)=>{let lastError;let promiseStatus="idle";let timeoutId;let intervalId;const onResolve=result=>{if(timeoutId)clearTimeout(timeoutId);if(intervalId)clearInterval(intervalId);resolve(result);};const handleTimeout=()=>{let error=lastError;if(!error)error=copyStackTrace(new Error("Timed out in waitFor!"),STACK_TRACE_ERROR);reject(error);};const checkCallback=()=>{if(vi.isFakeTimers())vi.advanceTimersByTime(interval);if(promiseStatus==="pending")return;try{const result=callback();if(result!==null&&typeof result==="object"&&typeof result.then==="function"){const thenable=result;promiseStatus="pending";thenable.then(resolvedValue=>{promiseStatus="resolved";onResolve(resolvedValue);},rejectedValue=>{promiseStatus="rejected";lastError=rejectedValue;});}else{onResolve(result);return true;}}catch(error){lastError=error;}};if(checkCallback()===true)return;timeoutId=setTimeout(handleTimeout,timeout);intervalId=setInterval(checkCallback,interval);});}function waitUntil(callback,options={}){const _getSafeTimers4=getSafeTimers(),setTimeout=_getSafeTimers4.setTimeout,setInterval=_getSafeTimers4.setInterval,clearTimeout=_getSafeTimers4.clearTimeout,clearInterval=_getSafeTimers4.clearInterval;const _ref13=typeof options==="number"?{timeout:options}:options,_ref13$interval=_ref13.interval,interval=_ref13$interval===void 0?50:_ref13$interval,_ref13$timeout=_ref13.timeout,timeout=_ref13$timeout===void 0?1e3:_ref13$timeout;const STACK_TRACE_ERROR=new Error("STACK_TRACE_ERROR");return new Promise((resolve,reject)=>{let promiseStatus="idle";let timeoutId;let intervalId;const onReject=error=>{if(!error)error=copyStackTrace(new Error("Timed out in waitUntil!"),STACK_TRACE_ERROR);reject(error);};const onResolve=result=>{if(!result)return;if(timeoutId)clearTimeout(timeoutId);if(intervalId)clearInterval(intervalId);resolve(result);return true;};const checkCallback=()=>{if(vi.isFakeTimers())vi.advanceTimersByTime(interval);if(promiseStatus==="pending")return;try{const result=callback();if(result!==null&&typeof result==="object"&&typeof result.then==="function"){const thenable=result;promiseStatus="pending";thenable.then(resolvedValue=>{promiseStatus="resolved";onResolve(resolvedValue);},rejectedValue=>{promiseStatus="rejected";onReject(rejectedValue);});}else{return onResolve(result);}}catch(error){onReject(error);}};if(checkCallback()===true)return;timeoutId=setTimeout(onReject,timeout);intervalId=setInterval(checkCallback,interval);});}function createVitest(){const _mocker=typeof __vitest_mocker__!=="undefined"?__vitest_mocker__:new Proxy({},{get(_,name){throw new Error(\`Vitest mocker was not initialized in this environment. vi.\${String(name)}() is forbidden.\`);}});let _mockedDate=null;let _config=null;const workerState=getWorkerState();const _timers=new FakeTimers({global:globalThis,config:workerState.config.fakeTimers});const _stubsGlobal=/* @__PURE__ */new Map();const _stubsEnv=/* @__PURE__ */new Map();const getImporter=()=>{const stackTrace=createSimpleStackTrace({stackTraceLimit:4});const importerStack=stackTrace.split("\\n")[4];const stack=parseSingleStack(importerStack);return(stack==null?void 0:stack.file)||"";};const utils={useFakeTimers(config){var _a,_b,_c,_d;if(isChildProcess()){if(((_a=config==null?void 0:config.toFake)==null?void 0:_a.includes("nextTick"))||((_d=(_c=(_b=workerState.config)==null?void 0:_b.fakeTimers)==null?void 0:_c.toFake)==null?void 0:_d.includes("nextTick"))){throw new Error('vi.useFakeTimers({ toFake: ["nextTick"] }) is not supported in node:child_process. Use --pool=threads if mocking nextTick is required.');}}if(config)_timers.configure(_objectSpread(_objectSpread({},workerState.config.fakeTimers),config));else _timers.configure(workerState.config.fakeTimers);_timers.useFakeTimers();return utils;},isFakeTimers(){return _timers.isFakeTimers();},useRealTimers(){_timers.useRealTimers();_mockedDate=null;return utils;},runOnlyPendingTimers(){_timers.runOnlyPendingTimers();return utils;},async runOnlyPendingTimersAsync(){await _timers.runOnlyPendingTimersAsync();return utils;},runAllTimers(){_timers.runAllTimers();return utils;},async runAllTimersAsync(){await _timers.runAllTimersAsync();return utils;},runAllTicks(){_timers.runAllTicks();return utils;},advanceTimersByTime(ms){_timers.advanceTimersByTime(ms);return utils;},async advanceTimersByTimeAsync(ms){await _timers.advanceTimersByTimeAsync(ms);return utils;},advanceTimersToNextTimer(){_timers.advanceTimersToNextTimer();return utils;},async advanceTimersToNextTimerAsync(){await _timers.advanceTimersToNextTimerAsync();return utils;},getTimerCount(){return _timers.getTimerCount();},setSystemTime(time){const date=time instanceof Date?time:new Date(time);_mockedDate=date;_timers.setSystemTime(date);return utils;},getMockedSystemTime(){return _mockedDate;},getRealSystemTime(){return _timers.getRealSystemTime();},clearAllTimers(){_timers.clearAllTimers();return utils;},// mocks + */ /* eslint-enable complexity */ /** @type {FakeTimers} */const defaultImplementation=withGlobal(globalObject);defaultImplementation.timers;defaultImplementation.createClock;defaultImplementation.install;var withGlobal_1=withGlobal;class FakeTimers{_global;_clock;_fakingTime;_fakingDate;_fakeTimers;_userConfig;_now=RealDate.now;constructor({global,config}){this._userConfig=config;this._fakingDate=false;this._fakingTime=false;this._fakeTimers=withGlobal_1(global);this._global=global;}clearAllTimers(){if(this._fakingTime)this._clock.reset();}dispose(){this.useRealTimers();}runAllTimers(){if(this._checkFakeTimers())this._clock.runAll();}async runAllTimersAsync(){if(this._checkFakeTimers())await this._clock.runAllAsync();}runOnlyPendingTimers(){if(this._checkFakeTimers())this._clock.runToLast();}async runOnlyPendingTimersAsync(){if(this._checkFakeTimers())await this._clock.runToLastAsync();}advanceTimersToNextTimer(steps=1){if(this._checkFakeTimers()){for(let i=steps;i>0;i--){this._clock.next();this._clock.tick(0);if(this._clock.countTimers()===0)break;}}}async advanceTimersToNextTimerAsync(steps=1){if(this._checkFakeTimers()){for(let i=steps;i>0;i--){await this._clock.nextAsync();this._clock.tick(0);if(this._clock.countTimers()===0)break;}}}advanceTimersByTime(msToRun){if(this._checkFakeTimers())this._clock.tick(msToRun);}async advanceTimersByTimeAsync(msToRun){if(this._checkFakeTimers())await this._clock.tickAsync(msToRun);}runAllTicks(){if(this._checkFakeTimers()){this._clock.runMicrotasks();}}useRealTimers(){if(this._fakingDate){resetDate();this._fakingDate=false;}if(this._fakingTime){this._clock.uninstall();this._fakingTime=false;}}useFakeTimers(){var _a,_b,_c;if(this._fakingDate){throw new Error('"setSystemTime" was called already and date was mocked. Reset timers using \`vi.useRealTimers()\` if you want to use fake timers again.');}if(!this._fakingTime){const toFake=Object.keys(this._fakeTimers.timers).filter(timer=>timer!=="nextTick");if(((_b=(_a=this._userConfig)==null?void 0:_a.toFake)==null?void 0:_b.includes("nextTick"))&&isChildProcess())throw new Error("process.nextTick cannot be mocked inside child_process");const existingFakedMethods=(((_c=this._userConfig)==null?void 0:_c.toFake)||toFake).filter(method=>{switch(method){case"setImmediate":case"clearImmediate":return method in this._global&&this._global[method];default:return true;}});this._clock=this._fakeTimers.install(_objectSpread(_objectSpread({now:Date.now()},this._userConfig),{},{toFake:existingFakedMethods}));this._fakingTime=true;}}reset(){if(this._checkFakeTimers()){const now=this._clock.now;this._clock.reset();this._clock.setSystemTime(now);}}setSystemTime(now){if(this._fakingTime){this._clock.setSystemTime(now);}else{mockDate(now??this.getRealSystemTime());this._fakingDate=true;}}getRealSystemTime(){return this._now();}getTimerCount(){if(this._checkFakeTimers())return this._clock.countTimers();return 0;}configure(config){this._userConfig=config;}isFakeTimers(){return this._fakingTime;}_checkFakeTimers(){if(!this._fakingTime){throw new Error('Timers are not mocked. Try calling "vi.useFakeTimers()" first.');}return this._fakingTime;}}function copyStackTrace(target,source){if(source.stack!==void 0)target.stack=source.stack.replace(source.message,target.message);return target;}function waitFor(callback,options={}){const _getSafeTimers3=getSafeTimers(),setTimeout=_getSafeTimers3.setTimeout,setInterval=_getSafeTimers3.setInterval,clearTimeout=_getSafeTimers3.clearTimeout,clearInterval=_getSafeTimers3.clearInterval;const _ref12=typeof options==="number"?{timeout:options}:options,_ref12$interval=_ref12.interval,interval=_ref12$interval===void 0?50:_ref12$interval,_ref12$timeout=_ref12.timeout,timeout=_ref12$timeout===void 0?1e3:_ref12$timeout;const STACK_TRACE_ERROR=new Error("STACK_TRACE_ERROR");return new Promise((resolve,reject)=>{let lastError;let promiseStatus="idle";let timeoutId;let intervalId;const onResolve=result=>{if(timeoutId)clearTimeout(timeoutId);if(intervalId)clearInterval(intervalId);resolve(result);};const handleTimeout=()=>{let error=lastError;if(!error)error=copyStackTrace(new Error("Timed out in waitFor!"),STACK_TRACE_ERROR);reject(error);};const checkCallback=()=>{if(vi.isFakeTimers())vi.advanceTimersByTime(interval);if(promiseStatus==="pending")return;try{const result=callback();if(result!==null&&typeof result==="object"&&typeof result.then==="function"){const thenable=result;promiseStatus="pending";thenable.then(resolvedValue=>{promiseStatus="resolved";onResolve(resolvedValue);},rejectedValue=>{promiseStatus="rejected";lastError=rejectedValue;});}else{onResolve(result);return true;}}catch(error){lastError=error;}};if(checkCallback()===true)return;timeoutId=setTimeout(handleTimeout,timeout);intervalId=setInterval(checkCallback,interval);});}function waitUntil(callback,options={}){const _getSafeTimers4=getSafeTimers(),setTimeout=_getSafeTimers4.setTimeout,setInterval=_getSafeTimers4.setInterval,clearTimeout=_getSafeTimers4.clearTimeout,clearInterval=_getSafeTimers4.clearInterval;const _ref13=typeof options==="number"?{timeout:options}:options,_ref13$interval=_ref13.interval,interval=_ref13$interval===void 0?50:_ref13$interval,_ref13$timeout=_ref13.timeout,timeout=_ref13$timeout===void 0?1e3:_ref13$timeout;const STACK_TRACE_ERROR=new Error("STACK_TRACE_ERROR");return new Promise((resolve,reject)=>{let promiseStatus="idle";let timeoutId;let intervalId;const onReject=error=>{if(!error)error=copyStackTrace(new Error("Timed out in waitUntil!"),STACK_TRACE_ERROR);reject(error);};const onResolve=result=>{if(!result)return;if(timeoutId)clearTimeout(timeoutId);if(intervalId)clearInterval(intervalId);resolve(result);return true;};const checkCallback=()=>{if(vi.isFakeTimers())vi.advanceTimersByTime(interval);if(promiseStatus==="pending")return;try{const result=callback();if(result!==null&&typeof result==="object"&&typeof result.then==="function"){const thenable=result;promiseStatus="pending";thenable.then(resolvedValue=>{promiseStatus="resolved";onResolve(resolvedValue);},rejectedValue=>{promiseStatus="rejected";onReject(rejectedValue);});}else{return onResolve(result);}}catch(error){onReject(error);}};if(checkCallback()===true)return;timeoutId=setTimeout(onReject,timeout);intervalId=setInterval(checkCallback,interval);});}function createVitest(){const _mocker=typeof __vitest_mocker__!=="undefined"?__vitest_mocker__:new Proxy({},{get(_,name){throw new Error(\`Vitest mocker was not initialized in this environment. vi.\${String(name)}() is forbidden.\`);}});let _mockedDate=null;let _config=null;const workerState=getWorkerState();let _timers;const timers=()=>_timers||(_timers=new FakeTimers({global:globalThis,config:workerState.config.fakeTimers}));const _stubsGlobal=/* @__PURE__ */new Map();const _stubsEnv=/* @__PURE__ */new Map();const _envBooleans=["PROD","DEV","SSR"];const getImporter=()=>{const stackTrace=createSimpleStackTrace({stackTraceLimit:4});const importerStack=stackTrace.split("\\n")[4];const stack=parseSingleStack(importerStack);return(stack==null?void 0:stack.file)||"";};const utils={useFakeTimers(config){var _a,_b,_c,_d;if(isChildProcess()){if(((_a=config==null?void 0:config.toFake)==null?void 0:_a.includes("nextTick"))||((_d=(_c=(_b=workerState.config)==null?void 0:_b.fakeTimers)==null?void 0:_c.toFake)==null?void 0:_d.includes("nextTick"))){throw new Error('vi.useFakeTimers({ toFake: ["nextTick"] }) is not supported in node:child_process. Use --pool=threads if mocking nextTick is required.');}}if(config)timers().configure(_objectSpread(_objectSpread({},workerState.config.fakeTimers),config));else timers().configure(workerState.config.fakeTimers);timers().useFakeTimers();return utils;},isFakeTimers(){return timers().isFakeTimers();},useRealTimers(){timers().useRealTimers();_mockedDate=null;return utils;},runOnlyPendingTimers(){timers().runOnlyPendingTimers();return utils;},async runOnlyPendingTimersAsync(){await timers().runOnlyPendingTimersAsync();return utils;},runAllTimers(){timers().runAllTimers();return utils;},async runAllTimersAsync(){await timers().runAllTimersAsync();return utils;},runAllTicks(){timers().runAllTicks();return utils;},advanceTimersByTime(ms){timers().advanceTimersByTime(ms);return utils;},async advanceTimersByTimeAsync(ms){await timers().advanceTimersByTimeAsync(ms);return utils;},advanceTimersToNextTimer(){timers().advanceTimersToNextTimer();return utils;},async advanceTimersToNextTimerAsync(){await timers().advanceTimersToNextTimerAsync();return utils;},getTimerCount(){return timers().getTimerCount();},setSystemTime(time){const date=time instanceof Date?time:new Date(time);_mockedDate=date;timers().setSystemTime(date);return utils;},getMockedSystemTime(){return _mockedDate;},getRealSystemTime(){return timers().getRealSystemTime();},clearAllTimers(){timers().clearAllTimers();return utils;},// mocks spyOn,fn,waitFor,waitUntil,hoisted(factory){assertTypes(factory,'"vi.hoisted" factory',["function"]);return factory();},mock(path,factory){const importer=getImporter();_mocker.queueMock(path,importer,factory?()=>factory(()=>_mocker.importActual(path,importer,_mocker.getMockContext().callstack)):void 0,true);},unmock(path){_mocker.queueUnmock(path,getImporter());},doMock(path,factory){const importer=getImporter();_mocker.queueMock(path,importer,factory?()=>factory(()=>_mocker.importActual(path,importer,_mocker.getMockContext().callstack)):void 0,false);},doUnmock(path){_mocker.queueUnmock(path,getImporter());},async importActual(path){return _mocker.importActual(path,getImporter(),_mocker.getMockContext().callstack);},async importMock(path){return _mocker.importMock(path,getImporter());},// this is typed in the interface so it's not necessary to type it here -mocked(item,_options={}){return item;},isMockFunction(fn2){return isMockFunction(fn2);},clearAllMocks(){mocks.forEach(spy=>spy.mockClear());return utils;},resetAllMocks(){mocks.forEach(spy=>spy.mockReset());return utils;},restoreAllMocks(){mocks.forEach(spy=>spy.mockRestore());return utils;},stubGlobal(name,value){if(!_stubsGlobal.has(name))_stubsGlobal.set(name,Object.getOwnPropertyDescriptor(globalThis,name));Object.defineProperty(globalThis,name,{value,writable:true,configurable:true,enumerable:true});return utils;},stubEnv(name,value){if(!_stubsEnv.has(name))_stubsEnv.set(name,process.env[name]);process.env[name]=value;return utils;},unstubAllGlobals(){_stubsGlobal.forEach((original,name)=>{if(!original)Reflect.deleteProperty(globalThis,name);else Object.defineProperty(globalThis,name,original);});_stubsGlobal.clear();return utils;},unstubAllEnvs(){_stubsEnv.forEach((original,name)=>{if(original===void 0)delete process.env[name];else process.env[name]=original;});_stubsEnv.clear();return utils;},resetModules(){resetModules(workerState.moduleCache);return utils;},async dynamicImportSettled(){return waitForImportsToResolve();},setConfig(config){if(!_config)_config=_objectSpread({},workerState.config);Object.assign(workerState.config,config);},resetConfig(){if(_config)Object.assign(workerState.config,_config);}};return utils;}const vitest=createVitest();const vi=vitest;class Spy{called=false;mock=()=>{};method(){}}function spy(){const inst=new Spy();return vi.fn(inst.mock);}async function wait(){}exports.spy=spy;exports.wait=wait; +mocked(item,_options={}){return item;},isMockFunction(fn2){return isMockFunction(fn2);},clearAllMocks(){mocks.forEach(spy=>spy.mockClear());return utils;},resetAllMocks(){mocks.forEach(spy=>spy.mockReset());return utils;},restoreAllMocks(){mocks.forEach(spy=>spy.mockRestore());return utils;},stubGlobal(name,value){if(!_stubsGlobal.has(name))_stubsGlobal.set(name,Object.getOwnPropertyDescriptor(globalThis,name));Object.defineProperty(globalThis,name,{value,writable:true,configurable:true,enumerable:true});return utils;},stubEnv(name,value){if(!_stubsEnv.has(name))_stubsEnv.set(name,process.env[name]);if(_envBooleans.includes(name))process.env[name]=value?"1":"";else process.env[name]=String(value);return utils;},unstubAllGlobals(){_stubsGlobal.forEach((original,name)=>{if(!original)Reflect.deleteProperty(globalThis,name);else Object.defineProperty(globalThis,name,original);});_stubsGlobal.clear();return utils;},unstubAllEnvs(){_stubsEnv.forEach((original,name)=>{if(original===void 0)delete process.env[name];else process.env[name]=original;});_stubsEnv.clear();return utils;},resetModules(){resetModules(workerState.moduleCache);return utils;},async dynamicImportSettled(){return waitForImportsToResolve();},setConfig(config){if(!_config)_config=_objectSpread({},workerState.config);Object.assign(workerState.config,config);},resetConfig(){if(_config)Object.assign(workerState.config,_config);}};return utils;}const vitest=createVitest();const vi=vitest;class Spy{called=false;mock=()=>{};method(){}}function spy(){const inst=new Spy();return vi.fn(inst.mock);}async function wait(){}exports.spy=spy;exports.wait=wait; //# sourceMappingURL=test.js.map " `; diff --git a/yarn.lock b/yarn.lock index a0affbc8..2ab839a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16288,12 +16288,12 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.3, magic-string@npm:^0.30.5, magic-string@npm:^0.30.7": - version: 0.30.7 - resolution: "magic-string@npm:0.30.7" +"magic-string@npm:^0.30.10, magic-string@npm:^0.30.3, magic-string@npm:^0.30.5": + version: 0.30.10 + resolution: "magic-string@npm:0.30.10" dependencies: "@jridgewell/sourcemap-codec": "npm:^1.4.15" - checksum: 10/883eaaf6792a3263e44f4bcdcd35ace272268e4b98ed5a770ad711947958d2f9fc683e474945e306e2bdc152b7e44d369ee312690d87025b9879fc63fbe1409c + checksum: 10/9f8bf6363a14c98a9d9f32ef833b194702a5c98fb931b05ac511b76f0b06fd30ed92beda6ca3261d2d52d21e39e891ef1136fbd032023f6cbb02d0b7d5767201 languageName: node linkType: hard @@ -19042,11 +19042,11 @@ __metadata: ink: "npm:^4.4.1" ink-progress-bar: "npm:^3.0.0" ink-spinner: "npm:^5.0.0" - magic-string: "npm:^0.30.7" + magic-string: "npm:^0.30.10" micromatch: "npm:^4.0.5" react: "npm:^18.2.0" resolve: "npm:^1.22.8" - rollup: "npm:^4.12.0" + rollup: "npm:^4.17.2" rollup-plugin-node-externals: "npm:^7.1.2" rollup-plugin-polyfill-node: "npm:^0.13.0" semver: "npm:^7.6.0" @@ -21376,7 +21376,7 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.12.0, rollup@npm:^4.13.0": +"rollup@npm:^4.13.0, rollup@npm:^4.17.2": version: 4.17.2 resolution: "rollup@npm:4.17.2" dependencies: